<?xml version="1.0" encoding="UTF-8"?>
<krpano version="1.16.8">

	<!-- *********** -->
	<!-- Control Bar -->
	<!-- *********** -->


<krpano crosscornerbarbarbuilt="false" crosscornerbarhorizontalwidth="0" crosscornerbarverticalheight="0" crosscornerbarIsOpened="false" />

<events name="crosscornerbarevents" onxmlcomplete="crosscornerbarbuildMenuBar();" keep="true"/>

<action name="crosscornerbarbuildMenuBar">
	ifnot (crosscornerbarbarbuilt, crosscornerbarbuildMenu(); set(crosscornerbarbarbuilt, true););
</action>

<action name="crosscornerbarbuildMenu">
	
	<!-- VERTICAL -->
	
	set(crosscornerbarbutton_pos, 10);

		if (device.fullscreensupport,
			set(layer[crosscornerbarbtn_openfs].y, get(crosscornerbarbutton_pos));
			set(layer[crosscornerbarbtn_closefs].y, get(crosscornerbarbutton_pos));
			inc(crosscornerbarbutton_pos, 40);
		);
	
	


	
		if (device.desktop,
			set(layer[crosscornerbarbtn_out].y, get(crosscornerbarbutton_pos));
			inc(crosscornerbarbutton_pos, 40);
				set(layer[crosscornerbarzoom_slider_bg].y, get(crosscornerbarbutton_pos));
				inc(crosscornerbarbutton_pos, 70);
			set(layer[crosscornerbarbtn_in].y, get(crosscornerbarbutton_pos));
			inc(crosscornerbarbutton_pos, 40);
		);
	
		set(layer[crosscornerbarbtn_autorotate_on ].y, get(crosscornerbarbutton_pos));
		set(layer[crosscornerbarbtn_autorotate_off].y, get(crosscornerbarbutton_pos));
		inc(crosscornerbarbutton_pos, 40);
	


	
	if (crosscornerbarbutton_pos != 10,
		set(layer[crosscornerbarmenu_vertical_bg].height, get(crosscornerbarbutton_pos));
		set(layer[crosscornerbarmenu_vertical_bg_border].height, get(crosscornerbarbutton_pos));
		set(crosscornerbarverticalheight, get(crosscornerbarbutton_pos));
	,
		set(layer[crosscornerbarmenu_vertical_bg].height, 0);
	);
	
	<!-- HORIZONTAL -->
	
	set(crosscornerbarbutton_pos, 10);
	
	
		if (scene.count GT 1,
			set(layer[crosscornerbarbtn_prev_pano].x, get(crosscornerbarbutton_pos));
			inc(crosscornerbarbutton_pos, 40);
			
			set(layer[crosscornerbarbtn_next_pano].x, get(crosscornerbarbutton_pos));
			inc(crosscornerbarbutton_pos, 40);
		);
	

		set(layer[crosscornerbarbtn_sound_off].x, get(crosscornerbarbutton_pos));
		set(layer[crosscornerbarbtn_sound_on ].x, get(crosscornerbarbutton_pos));
		inc(crosscornerbarbutton_pos, 40);
		set(layer[crosscornerbarVolumeBarContainer].x, get(crosscornerbarbutton_pos));
		inc(crosscornerbarbutton_pos, get(layer[crosscornerbarVolumeBarContainer].width));
		inc(crosscornerbarbutton_pos, 10);

	
	
	

	
	
	

	
	
	if (crosscornerbarbutton_pos != 10,
		set(layer[crosscornerbarmenu_horizontal_bg].width, get(crosscornerbarbutton_pos));
		set(layer[crosscornerbarmenu_horizontal_bg_border].width, get(crosscornerbarbutton_pos));
		set(crosscornerbarhorizontalwidth, get(crosscornerbarbutton_pos));
	,
		set(layer[crosscornerbarmenu_horizontal_bg].width, 0);
	);
	
	
	
	
	crosscornerbarSetVolumeBarOffsetX();
</action>


<events name="crosscornerbarStartTourEvents" onTourStart="crosscornerbarCallOnStartTour();" keep="true" />

<action name="crosscornerbarCallOnStartTour">
	
	crosscornerbarshowMenuControls();
</action>


	<action name="crosscornerbarSetVolumeBarOffsetX">
		<!-- prepare x offset for volume bar -->
		
		add(volumeBarPosX, get(layer[crosscornerbarVolumeBarContainer].x), get(layer[get(layer[crosscornerbarVolumeBarContainer].parent)].x));
		
		set(layer[crosscornerbarVolumeBarContainer].xoffset, get(volumeBarPosX));
		
		crosscornerbarSetupVolumeBar();
	</action>
	
	
	<action name="crosscornerbarSetupVolumeBar">
		crosscornerbarCalculateSegmentWidth();
		
		for(set(i,0), i LT layer[crosscornerbarVolumeBarContainer].segmentCount, inc(i), 
			crosscornerbarCreateVolumeSegment(get(i));
		);
	</action>
	
	<action name="crosscornerbarCalculateSegmentWidth">
		sub(layer[crosscornerbarVolumeBarContainer].intervalCount, get(layer[crosscornerbarVolumeBarContainer].segmentCount), 1);
		
		mul(totalIntervalWidth, get(layer[crosscornerbarVolumeBarContainer].intervalWidth), get(layer[crosscornerbarVolumeBarContainer].intervalCount));
		
		sub(totalSegmentWidth, get(layer[crosscornerbarVolumeBarContainer].width), get(totalIntervalWidth));
		
		div(layer[crosscornerbarVolumeBarContainer].segmentWidth, get(totalSegmentWidth), get(layer[crosscornerbarVolumeBarContainer].segmentCount));
		
		add(layer[crosscornerbarVolumeBarContainer].incrementPosX, get(layer[crosscornerbarVolumeBarContainer].segmentWidth), get(layer[crosscornerbarVolumeBarContainer].intervalWidth));
		
		div(layer[crosscornerbarVolumeBarContainer].incrementHeight, get(layer[crosscornerbarVolumeBarContainer].height), get(layer[crosscornerbarVolumeBarContainer].segmentCount));
	</action>
	
	<action name="crosscornerbarCreateVolumeSegment">
		set(volumeSegmentName, 'volumeSegment_');
		txtadd(volumeSegmentName, %1);
		
		mul(posX, get(layer[crosscornerbarVolumeBarContainer].incrementPosX), %1);
		
		mul(segmentHeight, get(layer[crosscornerbarVolumeBarContainer].incrementHeight), %1);
		add(segmentHeight, get(layer[crosscornerbarVolumeBarContainer].incrementHeight));
		
		addlayer(get(volumeSegmentName));
		set(layer[get(volumeSegmentName)].keep, true);
		set(layer[get(volumeSegmentName)].type, container);
		set(layer[get(volumeSegmentName)].align, bottomleft);
		set(layer[get(volumeSegmentName)].parent, crosscornerbarVolumeBarContainer);
		set(layer[get(volumeSegmentName)].x, get(posX));
		set(layer[get(volumeSegmentName)].width, get(layer[crosscornerbarVolumeBarContainer].segmentWidth));
		set(layer[get(volumeSegmentName)].height, get(segmentHeight));
		
		set(layer[get(volumeSegmentName)].bgcolor, get(layer[crosscornerbarVolumeBarContainer].lightColor));
		set(layer[get(volumeSegmentName)].bgalpha, 1);
	</action>
	
	<action name="crosscornerbarAdjustHighlightToVolume">
		mul(segmentToHighlight, %1, get(layer[crosscornerbarVolumeBarContainer].segmentCount));
		div(segmentToHighlight, 100);
		Math.ceil(segmentToHighlight); 
		
		for(set(i,0), i LT layer[crosscornerbarVolumeBarContainer].segmentCount, inc(i), 
			set(volumeSegmentName, 'volumeSegment_');
			txtadd(volumeSegmentName, get(i));
			
			if(i LT segmentToHighlight,
				set(layer[get(volumeSegmentName)].bgcolor, get(layer[crosscornerbarVolumeBarContainer].lightColor));
				set(layer[get(volumeSegmentName)].bgalpha, 1.0);
			,
				set(layer[get(volumeSegmentName)].bgcolor, get(layer[crosscornerbarVolumeBarContainer].darkColor));
				set(layer[get(volumeSegmentName)].bgalpha, 0.4);
			);
		);
	</action>
	
	<action name="crosscornerbarVolumeBarClickHandler">
		if(false,
			
			sub(localPosX, stagewidth, get(layer[crosscornerbarVolumeBarContainer].xoffset));
			sub(localPosX, mouse.x);
			sub(localX, get(layer[crosscornerbarVolumeBarContainer].width), get(localPosX));
		,
			
			sub(localX, mouse.x, get(layer[crosscornerbarVolumeBarContainer].xoffset));
		);
		
		mul(percent, get(localX), 100);
		div(percent, get(layer[crosscornerbarVolumeBarContainer].width));
		Math.ceil(percent);
		
		
		setTourSoundsVolume(get(percent));
		
		
		if(tour_soundson == false,
			playTourSounds();
		);
		
		crosscornerbarAdjustHighlightToVolume(get(percent));
	</action>
	


<style name="crosscornerbarbtn_vertical_style"
	keep="true"
	align="bottom"
	onhover="crosscornerbarshowVerticalMenuTooltip();"
    onout="hideTooltip();"
	crop="0| 0|30|30"
	onovercrop="0|30|30|30"
	ondowncrop="0|60|30|30"
	x="0"
	/>
<style name="crosscornerbarbtn_vertical_style_alpha"
	alpha="1.0"
	devices="tablet|mobile"
	/>
<style name="crosscornerbarbtn_vertical_style_alpha"
	alpha="0.2"
	devices="desktop"
	/>

<style name="crosscornerbarmenu_bg_alpha"
	alpha="0.2"
	devices="desktop"
	/>
<style name="crosscornerbarmenu_bg_alpha"
	alpha="0.5"
	devices="tablet|mobile"
	/>

<layer name="crosscornerbarmenu_vertical_bg"
	url="%FIRSTXML%/graphics/crosscornerbar/btn_bg_vertical.png"
	keep="true"
	align="bottomleft"
	x="64"
	y="118"
	edge="bottom"
	zorder="0"
	scale9grid="12|10|3|40"
	style="crosscornerbarmenu_bg_alpha"
	visible="false"
	/>

<layer name="crosscornerbarmenu_vertical_bg_border"
	url="%FIRSTXML%/graphics/crosscornerbar/btn_bg_border_vertical.png"
	keep="true"
	align="bottomleft"
	x="64"
	y="118"
	edge="bottom"
	zorder="1"
	scale9grid="12|10|3|40"
	onout="crosscornerbarvertical_onout_action();"
	onover="crosscornerbarvertical_onover_action();"
	visible="false"
	>

  <layer name="crosscornerbarbtn_autorotate_on"
          url="%FIRSTXML%/graphics/crosscornerbar/btn_start_autorotation.png"
          onclick="startautorotation();"
          style="crosscornerbarbtn_vertical_style|crosscornerbarbtn_vertical_style_alpha"
          visible="false"
          tooltip="controlBar_dpadautorotateOnTip"
          />
  <layer name="crosscornerbarbtn_autorotate_off"
          url="%FIRSTXML%/graphics/crosscornerbar/btn_stop_autorotation.png"
          onclick="stopautorotation();"
          style="crosscornerbarbtn_vertical_style|crosscornerbarbtn_vertical_style_alpha"
          visible="false"
          tooltip="controlBar_dpadautorotateOffTip"
          />


  <layer name="crosscornerbarbtn_in"
          url="%FIRSTXML%/graphics/crosscornerbar/btn_zoom_in.png"
          style="crosscornerbarbtn_vertical_style|crosscornerbarbtn_vertical_style_alpha"
          ondown="set(fov_moveforce, -1);"
          onup="set(fov_moveforce, 0);"
          tooltip="controlBar_dpadzoomInTip"
          visible="false"
          devices="desktop"
          />

  <layer name="crosscornerbarbtn_out"
          url="%FIRSTXML%/graphics/crosscornerbar/btn_zoom_out.png"
          style="crosscornerbarbtn_vertical_style|crosscornerbarbtn_vertical_style_alpha"
          ondown="set(fov_moveforce, +1);"
          onup="set(fov_moveforce, 0);"
          tooltip="controlBar_dpadzoomOutTip"
          visible="false"
          devices="desktop"
          />
  <layer name="crosscornerbarzoom_slider_bg"
          url="%FIRSTXML%/graphics/crosscornerbar/slider_bg_vertical.png"
          keep="true"
          align="bottom"
          alpha="0.2"
          visible="false"
          devices="desktop"
          >
    <layer name="crosscornerbarzoom_slider_grip"
           keep="true"
           url="%FIRSTXML%/graphics/crosscornerbar/slider_grip_vertical.png"
           align="top"
           edge="center"
           ondown="crosscornerbarzoom_slider_grip_ondown();"
           />
  </layer>

  <layer name="crosscornerbarbtn_openfs"
          url="%FIRSTXML%/graphics/crosscornerbar/btn_enter_fs.png"
          onclick="enterFullscreen();"
          style="crosscornerbarbtn_vertical_style|crosscornerbarbtn_vertical_style_alpha"
          tooltip="controlBar_dpadopenFsTip"
          visible="false"
          devices="fullscreensupport"
          />
  <layer name="crosscornerbarbtn_closefs"
          url="%FIRSTXML%/graphics/crosscornerbar/btn_close_fs.png"
          onclick="exitFullscreen();"
          style="crosscornerbarbtn_vertical_style|crosscornerbarbtn_vertical_style_alpha"
          visible="false"
          tooltip="controlBar_dpadcloseFsTip"
          devices="fullscreensupport"
          />




</layer>

  <action name="crosscornerbarvertical_onout_action">
    set(layer[crosscornerbarmenu_vertical_bg].alpha, 0.2);
    if (device.fullscreensupport,
      set(layer[crosscornerbarbtn_openfs].alpha, 0.2);
      set(layer[crosscornerbarbtn_closefs].alpha, 0.2);
    );
    if (device.desktop,
    set(layer[crosscornerbarbtn_in].alpha, 0.2);
    set(layer[crosscornerbarbtn_out].alpha, 0.2);
    set(layer[crosscornerbarzoom_slider_bg].alpha, 0.2);
    );


    set(layer[crosscornerbarbtn_autorotate_off].alpha, 0.2);
    set(layer[crosscornerbarbtn_autorotate_on ].alpha, 0.2);
  </action>

  <action name="crosscornerbarvertical_onover_action">
    set(layer[crosscornerbarmenu_vertical_bg].alpha, 1);
    if (device.fullscreensupport,
      set(layer[crosscornerbarbtn_openfs].alpha, 1);
      set(layer[crosscornerbarbtn_closefs].alpha, 1);
    );
    if (device.desktop,
    set(layer[crosscornerbarbtn_in].alpha, 1);
    set(layer[crosscornerbarbtn_out].alpha, 1);
    set(layer[crosscornerbarzoom_slider_bg].alpha, 1);
    );


    set(layer[crosscornerbarbtn_autorotate_off].alpha, 1);
    set(layer[crosscornerbarbtn_autorotate_on ].alpha, 1);
  </action>

  <action name="crosscornerbarhorizontal_onout_action">
    set(layer[crosscornerbarmenu_horizontal_bg].alpha, 0.2);


    set(layer[crosscornerbarbtn_prev_pano].alpha, 0.2);
    set(layer[crosscornerbarbtn_next_pano].alpha, 0.2);

    set(layer[crosscornerbarbtn_sound_on].alpha, 0.2);
    set(layer[crosscornerbarbtn_sound_off].alpha, 0.2);
	set(layer[crosscornerbarVolumeBarContainer].alpha, 0.2);


 
  </action>

  <action name="crosscornerbarhorizontal_onover_action">
    set(layer[crosscornerbarmenu_horizontal_bg].alpha, 1);


    set(layer[crosscornerbarbtn_prev_pano].alpha, 1);
    set(layer[crosscornerbarbtn_next_pano].alpha, 1);

    set(layer[crosscornerbarbtn_sound_on].alpha, 1);
    set(layer[crosscornerbarbtn_sound_off].alpha, 1);
	set(layer[crosscornerbarVolumeBarContainer].alpha, 1);



  </action>

  <style name="crosscornerbarbtn_horizontal_style"
         keep="true"
         align="left"
         onhover="crosscornerbarshowHorizontalMenuTooltip();"
         onout="hideTooltip();"
               crop="0| 0|30|30"
         onovercrop="0|30|30|30"
         ondowncrop="0|60|30|30"
         y="0"
         />
<style name="crosscornerbarbtn_horizontal_style_alpha"
	alpha="1.0"
	devices="tablet|mobile"
	/>
<style name="crosscornerbarbtn_horizontal_style_alpha"
	alpha="0.2"
	devices="desktop"
	/>

  <layer name="crosscornerbarmenu_horizontal_bg"
          url="%FIRSTXML%/graphics/crosscornerbar/btn_bg_horizontal.png"
          keep="true"
          align="bottomleft"
          x="118"
          y="64"
          edge="left"
          zorder="0"
          scale9grid="10|12|40|3"
          style="crosscornerbarmenu_bg_alpha"
          visible="false"
          />

  <layer name="crosscornerbarmenu_horizontal_bg_border"
          url="%FIRSTXML%/graphics/crosscornerbar/btn_bg_border_horizontal.png"
          keep="true"
          align="bottomleft"
          x="118"
          y="64"
          edge="left"
          zorder="1"
          scale9grid="10|12|40|3"
          onout="crosscornerbarhorizontal_onout_action();"
          onover="crosscornerbarhorizontal_onover_action();"
          visible="false"
          >
    <layer name="crosscornerbarbtn_prev_pano"
            url="%FIRSTXML%/graphics/crosscornerbar/btn_previous_scene.png"
            onclick="loadPreviousScene();"
            style="crosscornerbarbtn_horizontal_style|crosscornerbarbtn_horizontal_style_alpha"
            tooltip="controlBar_dpadprevSceneTip"
            visible="false"
            />
    <layer name="crosscornerbarbtn_next_pano"
            url="%FIRSTXML%/graphics/crosscornerbar/btn_next_scene.png"
            onclick="loadNextScene();"
            style="crosscornerbarbtn_horizontal_style|crosscornerbarbtn_horizontal_style_alpha"
            tooltip="controlBar_dpadnextSceneTip"
            visible="false"
            />

  <layer name="crosscornerbarbtn_sound_on"
          url="%FIRSTXML%/graphics/crosscornerbar/btn_start_sound.png"
          onclick="playTourSounds();"
          style="crosscornerbarbtn_horizontal_style|crosscornerbarbtn_horizontal_style_alpha"
          visible="false"
          tooltip="controlBar_dpadsoundsOnTip"
          />
  <layer name="crosscornerbarbtn_sound_off"
          url="%FIRSTXML%/graphics/crosscornerbar/btn_stop_sound.png"
          onclick="stopTourSounds();"
          style="crosscornerbarbtn_horizontal_style|crosscornerbarbtn_horizontal_style_alpha"
          visible="false"
          tooltip="controlBar_dpadsoundsOffTip"
          />
	<layer name="crosscornerbarVolumeBarContainer"
		type="container"
		width="48"
		height="15"
		keep="true"
		align="left"
		x="0"
		y="0"
		visible="false"
		style="crosscornerbarbtn_horizontal_style_alpha"
		
		xoffset="0"
		
		bgcolor="0x454f72"
		bgalpha="0.00000001"
		bgcapture="true"
		
		segmentCount="10"
		segmentWidth="0" 
		
		intervalCount="0" 
		intervalWidth="2"
		
		incrementPosX="0"
		incrementHeight="0"
		
		lightColor="0xbafefd"
		darkColor="0xbafefd"
		
		onclick="crosscornerbarVolumeBarClickHandler"
	/>





  </layer>


	<!-- Common Style for all buttons in the Navigation cross -->
	<style name="crosscornerbarbtn_navigation_style"
		keep="true"
		onhover="crosscornerbarshowVerticalMenuTooltip();"
		onout="hideTooltip();"
		crop="0|0|30|30"
		onovercrop="0|30|30|30"
		ondowncrop="0|60|30|30"
	/>
	<style name="crosscornerbarbtn_navigation_style_alpha"
		alpha="1.0"
		devices="tablet|mobile"
	/>
	<style name="crosscornerbarbtn_navigation_style_alpha"
		alpha="0.2"
		devices="desktop"
	/>
	
	<layer name="crosscornerbarnavigation_bg"
		url="%FIRSTXML%/graphics/crosscornerbar/btn_bg_move.png"
		align="bottomleft"
		x="10"
		y="10"
		keep="true"
		capture="false"
		zorder="0"
		style="crosscornerbarmenu_bg_alpha"
		visible="false"
		/>

  <layer name="crosscornerbarnavigation_bg_border"
          url="%FIRSTXML%/graphics/crosscornerbar/btn_bg_border_move.png"
          keep="true"
          align="bottomleft"
          x="10"
          y="10"
          capture="false"
          zorder="1"
          onout="crosscornerbarnav_onout_action();"
          onover="crosscornerbarnav_onover_action();"
          visible="false"
          >
    <layer name="crosscornerbarbtn_left"
            ondown="set(hlookat_moveforce, -1);"
            onup="set(hlookat_moveforce, 0);"
            url="%FIRSTXML%/graphics/crosscornerbar/btn_move_left.png"
            style="crosscornerbarbtn_navigation_style|crosscornerbarbtn_navigation_style_alpha"
            tooltip="controlBar_dpadmoveLeftTip"
            x="5"
            y="0"
            edge="left"
            align="left"
            visible="false"
             />
    <layer name="crosscornerbarbtn_right"
            ondown="set(hlookat_moveforce, +1);"
            onup="set(hlookat_moveforce, 0);"
            url="%FIRSTXML%/graphics/crosscornerbar/btn_move_right.png"
            style="crosscornerbarbtn_navigation_style|crosscornerbarbtn_navigation_style_alpha"
            tooltip="controlBar_dpadmoveRightTip"
            x="5"
            y="0"
            edge="right"
            align="right"
            visible="false"
             />
    <layer name="crosscornerbarbtn_up"
            ondown="set(vlookat_moveforce, -1);"
            onup="set(vlookat_moveforce, 0);"
            url="%FIRSTXML%/graphics/crosscornerbar/btn_move_up.png"
            style="crosscornerbarbtn_navigation_style|crosscornerbarbtn_navigation_style_alpha"
            tooltip="controlBar_dpadmoveUpTip"
            x="0"
            y="5"
            align="top"
            edge="top"
            visible="false"
             />
    <layer name="crosscornerbarbtn_down"
            ondown="set(vlookat_moveforce, +1);"
            onup="set(vlookat_moveforce, 0);"
            url="%FIRSTXML%/graphics/crosscornerbar/btn_move_down.png"
            style="crosscornerbarbtn_navigation_style|crosscornerbarbtn_navigation_style_alpha"
            tooltip="controlBar_dpadmoveDownTip"
            x="0"
            y="5"
            edge="bottom"
            align="bottom"
            visible="false"
             />

	
</layer>


  <action name="crosscornerbarnav_onout_action">
    set(layer[crosscornerbarnavigation_bg].alpha, 0.2);
    set(layer[crosscornerbarbtn_left].alpha, 0.2);
    set(layer[crosscornerbarbtn_right].alpha, 0.2);
    set(layer[crosscornerbarbtn_up].alpha, 0.2);
    set(layer[crosscornerbarbtn_down].alpha, 0.2);
  </action>

  <action name="crosscornerbarnav_onover_action">
    set(layer[crosscornerbarnavigation_bg].alpha, 1);
    set(layer[crosscornerbarbtn_left].alpha, 1);
    set(layer[crosscornerbarbtn_right].alpha, 1);
    set(layer[crosscornerbarbtn_up].alpha, 1);
    set(layer[crosscornerbarbtn_down].alpha, 1);
  </action>


	<events name="crosscornerbarplaystopsoundsevent" playtoursoundsevent="crosscornerbarupdateSoundButtons();" stoptoursoundsevent="crosscornerbarupdateSoundButtons();" keep="true"/>
	<action name="crosscornerbarHideSoundButtons">
		set(layer[crosscornerbarbtn_sound_off].visible, false);
		set(layer[crosscornerbarbtn_sound_on].visible , false);
		set(layer[crosscornerbarVolumeBarContainer].visible, false);
	</action>
	<action name="crosscornerbarShowSoundButtons">
		if (tour_soundson == false,
			set(layer[crosscornerbarbtn_sound_off].visible, false);
			set(layer[crosscornerbarbtn_sound_on].visible , true);
			set(layer[crosscornerbarVolumeBarContainer].visible, true);
			crosscornerbarAdjustHighlightToVolume(0);
		,
			set(layer[crosscornerbarbtn_sound_off].visible, true);
			set(layer[crosscornerbarbtn_sound_on].visible , false);
			set(layer[crosscornerbarVolumeBarContainer].visible, true);
			crosscornerbarAdjustHighlightToVolume(get(tour_soundsvolume));
		);
	</action>
	<action name="crosscornerbarupdateSoundButtons">
		set(crosscornerbarDisplaySoundButtons, false);
		if (crosscornerbarIsOpened, set(crosscornerbarDisplaySoundButtons, true););
		if (crosscornerbarDisplaySoundButtons,
			crosscornerbarShowSoundButtons();
		,
			crosscornerbarHideSoundButtons();
		);
	</action>


	<events name="crosscornerbarAutorotationEvents"
		onstartautorotation="crosscornerbarupdateAutorotationButtons();"
		onresumeautorotation="crosscornerbarupdateAutorotationButtons();"
		onstopautorotation="crosscornerbarupdateAutorotationButtons();"
		onpauseautorotation="crosscornerbarupdateAutorotationButtons();"
		keep="true"/>
	<action name="crosscornerbarHideAutorotationButtons">
		set(layer[crosscornerbarbtn_autorotate_off].visible, false);
		set(layer[crosscornerbarbtn_autorotate_on].visible , false);
	</action>
	<action name="crosscornerbarShowAutorotationButtons">
		if(tour_autorotateenabled==false,
			set(layer[crosscornerbarbtn_autorotate_off].visible, false);
			set(layer[crosscornerbarbtn_autorotate_on].visible , true);
		,
			set(layer[crosscornerbarbtn_autorotate_off].visible, true);
			set(layer[crosscornerbarbtn_autorotate_on].visible , false);
		);
	</action>
	<action name="crosscornerbarupdateAutorotationButtons">
		set(crosscornerbarDisplayAutorotationButtons, false);
		if (crosscornerbarIsOpened, set(crosscornerbarDisplayAutorotationButtons, true););
		if (crosscornerbarDisplayAutorotationButtons,
			crosscornerbarShowAutorotationButtons();
		,
			crosscornerbarHideAutorotationButtons();
		);
	</action>



  <action name="crosscornerbarzoom_slider_grip_dragging">
    if (pressed,
      sub(dy, mouse.stagey, drag_stagey); 
      add(newy, drag_currenty, dy); 

      if(newy LT 0, set(newy, 0) );
      if(newy GT layer[crosscornerbarzoom_slider_bg].pixelheight, copy(newy, layer[crosscornerbarzoom_slider_bg].pixelheight));
      copy(y, newy);

      div(val, newy, layer[crosscornerbarzoom_slider_bg].pixelheight);

      sub(fovrange, view.fovmax, view.fovmin);
      mul(newfov  , val, fovrange);
      add(newfov  , view.fovmin);
      set(view.fov, get(newfov));

      delayedcall(0, crosscornerbarzoom_slider_grip_dragging());
    );
  </action>
  <action name="crosscornerbarzoom_slider_grip_ondown">
    copy(drag_currenty, y);
    copy(drag_stagey, mouse.stagey);
    crosscornerbarzoom_slider_grip_dragging();
  </action>
  <events name="crosscornerbarzoom_slider_events" keep="true" onviewchanged="crosscornerbarzoom_slider_update();" />
  <action name="crosscornerbarzoom_slider_update">
    if (device.desktop,
    ifnot (layer[crosscornerbarzoom_slider_grip].pressed,
      sub(val, view.fov, view.fovmin);
      sub(fovrange, view.fovmax, view.fovmin);
      div(val, fovrange);
      mul(newy, val, layer[crosscornerbarzoom_slider_bg].pixelheight);
      set(layer[crosscornerbarzoom_slider_grip].y, get(newy));
    );
    );
  </action>

	<events name="crosscornerbarmenufullscreenchangeevent"
		onenterfullscreen="crosscornerbarupdateFullscreenButtons();"
		onexitfullscreen="crosscornerbarupdateFullscreenButtons();"
		keep="true"/>
	<action name="crosscornerbarHideFullscreenButtons">
		set(layer[crosscornerbarbtn_openfs].visible , false);
		set(layer[crosscornerbarbtn_closefs].visible, false);
	</action>
	<action name="crosscornerbarShowFullscreenButtons">
		if (device.fullscreensupport,
			if(tour_fullscreen,
				set(layer[crosscornerbarbtn_openfs].visible , false);
				set(layer[crosscornerbarbtn_closefs].visible, true);
			,
				set(layer[crosscornerbarbtn_openfs].visible ,true);
				set(layer[crosscornerbarbtn_closefs].visible,false);
			);
		,
			crosscornerbarHideFullscreenButtons();
		);
	</action>
	<action name="crosscornerbarupdateFullscreenButtons">
		set(crosscornerbarDisplayFullscreenButtons, false);
		if (crosscornerbarIsOpened, set(crosscornerbarDisplayFullscreenButtons, true););
		if (crosscornerbarDisplayFullscreenButtons,
			crosscornerbarShowFullscreenButtons();
		,
			crosscornerbarHideFullscreenButtons();
		);
	</action>
	



<action name="crosscornerbarhideMenuControls">
		set(crosscornerbarIsOpened, false);
		set(layer[crosscornerbarnavigation_bg].visible, false);
		
			set(layer[crosscornerbarbtn_up].visible, false);
			set(layer[crosscornerbarbtn_down].visible, false);
			set(layer[crosscornerbarbtn_left].visible, false);
			set(layer[crosscornerbarbtn_right].visible, false);
		
		set(layer[crosscornerbarnavigation_bg_border].visible, true);
		tween(layer[crosscornerbarnavigation_bg_border].alpha, 0.5, 1);
		
		<!-- VERTICAL -->
		if(crosscornerbarverticalheight != 0,
			set(layer[crosscornerbarmenu_vertical_bg].visible, false);
				set(layer[crosscornerbarbtn_in].visible, false);
				set(layer[crosscornerbarbtn_out].visible, false);
					set(layer[crosscornerbarzoom_slider_bg].visible, false);


				crosscornerbarupdateAutorotationButtons();


				crosscornerbarupdateFullscreenButtons();
			tween(layer[crosscornerbarmenu_vertical_bg_border].alpha , 0, 1);
			tween(layer[crosscornerbarmenu_vertical_bg_border].height , 0, 1, easeOutQuad, set(layer[crosscornerbarmenu_vertical_bg_border].visible, false));
		);
		
		<!-- HORIZONTAL -->
		if(crosscornerbarhorizontalwidth != 0,
			set(layer[crosscornerbarmenu_horizontal_bg].visible, false);


				if (scene.count GT 1,
					set(layer[crosscornerbarbtn_prev_pano].visible, false);
					set(layer[crosscornerbarbtn_next_pano].visible, false);
				);

				crosscornerbarupdateSoundButtons();



			tween(layer[crosscornerbarmenu_horizontal_bg_border].alpha , 0, 1);
			tween(layer[crosscornerbarmenu_horizontal_bg_border].width, 0, 1, easeOutQuad, set(layer[crosscornerbarmenu_horizontal_bg_border].visible, false));
		);
	</action>
	
	<action name="crosscornerbarshowMenuControls">
	set(crosscornerbarIsOpened, true);
    set(layer[crosscornerbarnavigation_bg].visible, true);

    set(layer[crosscornerbarbtn_up].visible, true);
    set(layer[crosscornerbarbtn_down].visible, true);
    set(layer[crosscornerbarbtn_left].visible, true);
    set(layer[crosscornerbarbtn_right].visible, true);

    set(layer[crosscornerbarnavigation_bg_border].visible, true);
    tween(layer[crosscornerbarnavigation_bg_border].alpha, 1, 1);

    <!-- VERTICAL -->
    if(crosscornerbarverticalheight != 0,
      set(layer[crosscornerbarmenu_vertical_bg_border].visible, true);
      tween(layer[crosscornerbarmenu_vertical_bg_border].alpha, 1, 1);
      tween(layer[crosscornerbarmenu_vertical_bg_border].height, get(crosscornerbarverticalheight), 1, easeOutQuad,
        set(layer[crosscornerbarmenu_vertical_bg].visible, true);
        crosscornerbarupdateFullscreenButtons();
        crosscornerbarupdateAutorotationButtons();


        if (device.desktop,
        set(layer[crosscornerbarbtn_in].visible, true);
        set(layer[crosscornerbarbtn_out].visible, true);
        set(layer[crosscornerbarzoom_slider_bg].visible, true);
        );


      );
    );

    <!-- HORIZONTAL -->
    if(crosscornerbarhorizontalwidth != 0,
      set(layer[crosscornerbarmenu_horizontal_bg_border].visible, true);
      tween(layer[crosscornerbarmenu_horizontal_bg_border].alpha, 1, 1);
      tween(layer[crosscornerbarmenu_horizontal_bg_border].width, get(crosscornerbarhorizontalwidth), 1, easeOutQuad,
        set(layer[crosscornerbarmenu_horizontal_bg].visible, true);


        if (scene.count GT 1,
          set(layer[crosscornerbarbtn_prev_pano].visible, true);
          set(layer[crosscornerbarbtn_next_pano].visible, true);
        );

        crosscornerbarupdateSoundButtons();





      );
    );
  </action>



  <action name="crosscornerbarshowHorizontalMenuTooltip">
    if (tooltip !== null, showTooltip(bottomleft, crosscornerbarhorizMenuTooltipStyle, bottom););
  </action>
  <action name="crosscornerbarshowVerticalMenuTooltip">
    if (tooltip !== null, showTooltip(bottomleft, crosscornerbarverticalMenuTooltipStyle, left););
  </action>

  <textstyle name="crosscornerbarhorizMenuTooltipStyle"
             font="Times"
             fontsize="14"
             bold="true"
             italic="false"
             textcolor="0xffffff"
             background="true"
             backgroundcolor="0x454f72"
             alpha="0.8"
             blendmode="normal"
		     effect="glow(0x454f72,1,10,100); "
             origin="cursor"
             textalign="center"
             border="0"
             xoffset="0"
             edge="bottom"
             yoffset="-25"
             devices="flash"
             noclip="true"/>

  <textstyle name="crosscornerbarverticalMenuTooltipStyle"
             font="Times"
             fontsize="14"
             bold="true"
             italic="false"
             textcolor="0xffffff"
             background="true"
             backgroundcolor="0x454f72"
             alpha="0.8"
             blendmode="normal"
		     effect="glow(0x454f72,1,10,100); "
             origin="cursor"
             edge="left"
             textalign="left"
             xoffset="25"
             border="0"
             yoffset="0"
             devices="flash"
             noclip="true"/>

  <layer name="crosscornerbarhorizMenuTooltipStyle"
	     keep="true"
	     enabled="false"
	     capture="false"
	     url="%FIRSTXML%/graphics/textfield.swf"
	     align="center"
	     background="true"
	     backgroundcolor="0x454f72"
	     border="true"
	     bordercolor="0x454f72"
	     css="color:#ffffff;font-family:Times;font-weight:bold;font-size:14px;text-align:center;"
	     width="200"
	     height="20"
	     autoheight="true"
         edge="bottom"
	     yoffset="-25"
	     xoffset="0"
	     selectable="false"
	     zorder="0"
	     visible="false"
	     html=""
	     devices="html5"
         />
  <layer name="crosscornerbarverticalMenuTooltipStyle"
	     keep="true"
	     enabled="false"
	     capture="false"
	     url="%FIRSTXML%/graphics/textfield.swf"
	     align="center"
	     background="true"
	     backgroundcolor="0x454f72"
	     border="true"
	     bordercolor="0x454f72"
	     css="color:#ffffff;font-family:Times;font-weight:bold;font-size:14px;text-align:center;"
	     width="200"
	     height="20"
	     autoheight="true"
	     edge="left"
	     xoffset="25"
	     yoffset="0"
	     selectable="false"
	     zorder="0"
	     visible="false"
	     html=""
	     devices="html5"
         />






	<!-- ************** -->
	<!-- Thumbnails Bar -->
	<!-- ************** -->




<layer name="thumbnailsBar-thumbnailsBar-theme02" 
	keep="true" 
	type="image" 
	visible="false"
	align="top" 
	
		width="100%" 
		height="0" 
	
	x="0"
	y="10"
	
	url="%FIRSTXML%/graphics/classicthumbnailsbar/frame_bg.png" 
	scale9grid="10|10|80|80"
	
	zorder="2"
/>



<layer name="thumbnailBorderSource-thumbnailsBar-theme02"
	keep="true"
	visible="false"
	
	url="%FIRSTXML%/graphics/classicthumbnailsbar/thumbnails_states.png" 
	offsetX="10"
	offsetY="10"
	quarterHeight="0"			
/>



<textstyle name="tooltipStyle-thumbnailsBar-theme02"
	font="Helvetica"
	fontsize="16"
	bold="true"
	italic="false"
	background="false"
	border="false"
	alpha="0.8"
	blendmode="layer"
	textcolor="0xFFFFFF"
	effect="glow(0x111111,0.8);"
	edge="bottom"
	origin="cursor"
	noclip="true"
	devices="flash"
/>
<layer name="tooltipStyle-thumbnailsBar-theme02"
	keep="true"
	enabled="false"
	capture="false"
	url="%FIRSTXML%/graphics/textfield.swf"
	align="center"
	background="true"
	backgroundcolor="0xffffff"
	backgroundalpha="0.4"
	border="false"
	bordercolor="0xffffff"
	css="color:#FFFFFF;font-family:Helvetica;font-weight:bold;font-size:16px;text-align:center;"
	width="200"
	height="20"
	autoheight="true"
	edge="bottom"
	selectable="false"
	zorder="0"
	visible="false"
	html=""
	devices="html5"
/>

	<events name="thumbnailsScrollEvents-thumbnailsBar-theme02" 
		keep="true" 
		
		onloadcomplete="ifnot(startResize-thumbnailsBar-theme02,set(isLoaded-thumbnailsBar-theme02, true);if(isStarted-thumbnailsBar-theme02,onLoadCompleteHandler-thumbnailsBar-theme02();););"
		onTourStart="set(isStarted-thumbnailsBar-theme02, true);if(isLoaded-thumbnailsBar-theme02,onLoadCompleteHandler-thumbnailsBar-theme02(););"
		onnewpano="if(startResize-thumbnailsBar-theme02,onLoadCompleteHandler-thumbnailsBar-theme02(););"
		onresize="onResizeHandler-thumbnailsBar-theme02();"
		hidetourthumbnails="hideWithThumbnailsButton-thumbnailsBar-theme02();" 
		showtourthumbnails="showWithThumbnailsButton-thumbnailsBar-theme02();" 
		hidetourcontrols="hideWithControlsBar-thumbnailsBar-theme02();" 
		showtourcontrols="showWithControlsBar-thumbnailsBar-theme02();" 
		onenterfullscreen="delayedcall(0.2,scrollToCurrentThumb-thumbnailsBar-theme02(););"
		onexitfullscreen="delayedcall(0.2,scrollToCurrentThumb-thumbnailsBar-theme02(););"
	/>
	
	
	<layer name="scrollAreaContainer-thumbnailsBar-theme02" 
		keep="true"
		type="container" 
		align="topleft"
		x="5"
		y="5"
		
		marginX="5"
		marginY="5"
		
		width="0" 
		height="0"
		
		scrollSpeedInit="10"
		scrollSpeed="10"
		scrollSpeedMax="70"
		scrollSpeedAcceleration="20"
		
		parent="thumbnailsBar-thumbnailsBar-theme02"
		
		thumbWidth="0"
		thumbHeight="0"
		
		itemWidth="100"
		itemHeight="50"
		
		offsetX="0"
		offsetY="0"
		
		thumbSpacer="0"
		currentThumbsCount="0"
		
		adjustToContent="false"
		
		zorder="1"
		visible="false"
		ready="false"
	>
	
		
		<layer name="thumbsScrollArea-thumbnailsBar-theme02" 
			url="%FIRSTXML%/graphics/scrollarea.swf" 
			alturl="%FIRSTXML%/graphics/scrollarea.js" 
			align="top"
			onhover_autoscrolling="false"
			
			x="0"
			y="0"
			 
				direction="h" 
		/>
	
	</layer>
	
	
	
	<layer name="scrollPrevArrow-thumbnailsBar-theme02" 
		keep="true"
		type="image"
		visible="false"
		parent="thumbnailsBar-thumbnailsBar-theme02"
		targetHeight="0"
		tagertWidth="0"
		zorder="2"
		
			url="%FIRSTXML%/graphics/classicthumbnailsbar/btn_scroll_left.png"
			align="left"
	/>
	
	
	
	<layer name="scrollNextArrow-thumbnailsBar-theme02" 
		keep="true"
		type="image"
		visible="false"
		parent="thumbnailsBar-thumbnailsBar-theme02"
		targetHeight="0"
		targetWidth="0"
		zorder="2"
		
			url="%FIRSTXML%/graphics/classicthumbnailsbar/btn_scroll_right.png"
			align="right"
	/>
	
	
	<action name="onLoadCompleteHandler-thumbnailsBar-theme02">
		loadThumbs-thumbnailsBar-theme02();
		resetMouseBehavior-thumbnailsBar-theme02();
		highlightCurrentThumb-thumbnailsBar-theme02();
		
		
		if(layer[scrollAreaContainer-thumbnailsBar-theme02].adjustToContent,
			mul(adjustWidth-thumbnailsBar-theme02, get(layer[scrollAreaContainer-thumbnailsBar-theme02].marginX), 2);
			add(adjustWidth-thumbnailsBar-theme02, get(layer[thumbsScrollArea-thumbnailsBar-theme02].width));
			mul(adjustHeight-thumbnailsBar-theme02, get(layer[scrollAreaContainer-thumbnailsBar-theme02].marginY), 2);
			add(adjustHeight-thumbnailsBar-theme02, get(layer[thumbsScrollArea-thumbnailsBar-theme02].height));
			
			
			if(adjustWidth-thumbnailsBar-theme02 GT stagewidth,
				set(adjustWidth-thumbnailsBar-theme02, get(stagewidth));
				set(layer[scrollAreaContainer-thumbnailsBar-theme02].adjustToContent, false);
			,
				if(adjustHeight-thumbnailsBar-theme02 GT stageheight,
					set(adjustHeight-thumbnailsBar-theme02, get(stageheight));
					set(layer[scrollAreaContainer-thumbnailsBar-theme02].adjustToContent, false);
				);
			);
			
			setSize-thumbnailsBar-theme02(get(adjustWidth-thumbnailsBar-theme02), get(adjustHeight-thumbnailsBar-theme02));
		);
		
		setupArrows-thumbnailsBar-theme02(true);
		
		
		if (thumbsCount-thumbnailsBar-theme02 LE 0,
			set(layer[thumbnailsBar-thumbnailsBar-theme02].visible, false);
		);
		
		
		set(startResize-thumbnailsBar-theme02, true);
	</action>
	
	
	<action name="onResizeHandler-thumbnailsBar-theme02">
		
		delayedcall(0.1, onResizeCallback-thumbnailsBar-theme02(false); );
	</action>
	
	
	<action name="onResizeCallback-thumbnailsBar-theme02">
		if(startResize-thumbnailsBar-theme02,
			setSize-thumbnailsBar-theme02(get(layer[scrollAreaContainer-thumbnailsBar-theme02].targetWidth), get(layer[scrollAreaContainer-thumbnailsBar-theme02].targetHeight));
			setupArrows-thumbnailsBar-theme02(%1);
			
			
			if (thumbsCount-thumbnailsBar-theme02 LE 0,
				set(layer[thumbnailsBar-thumbnailsBar-theme02].visible, false);
			);
		);
	</action>
	
	
		<action name="showWithThumbnailsButton-thumbnailsBar-theme02">
			set(layer[thumbnailsBar-thumbnailsBar-theme02].visible, true);
			onResizeCallback-thumbnailsBar-theme02(true);
		</action>
		
		<action name="hideWithThumbnailsButton-thumbnailsBar-theme02">
			set(layer[thumbnailsBar-thumbnailsBar-theme02].visible, false);
		</action>
	
	
		<action name="showWithControlsBar-thumbnailsBar-theme02">
			
				if (tour_displaythumbnails,
					set(layer[thumbnailsBar-thumbnailsBar-theme02].visible, true);
					onResizeCallback-thumbnailsBar-theme02(true);
				,
					set(layer[thumbnailsBar-thumbnailsBar-theme02].visible, false);
				);
		</action>
		
		<action name="hideWithControlsBar-thumbnailsBar-theme02">
			set(layer[thumbnailsBar-thumbnailsBar-theme02].visible, false);
		</action>
	
	
	<action name="thumbnailBorderDrawInit-thumbnailsBar-theme02">
		
		set(layer[scrollAreaContainer-thumbnailsBar-theme02].offsetX, get(layer[thumbnailBorderSource-thumbnailsBar-theme02].borderWidth));
		set(layer[scrollAreaContainer-thumbnailsBar-theme02].offsetY, get(layer[thumbnailBorderSource-thumbnailsBar-theme02].borderWidth));
		
		
		mul(totalOffsetX-thumbnailsBar-theme02, get(layer[thumbnailBorderSource-thumbnailsBar-theme02].borderWidth), 2);
		mul(totalOffsetY-thumbnailsBar-theme02, get(layer[thumbnailBorderSource-thumbnailsBar-theme02].borderWidth), 2);
		
		
		if(startResize-thumbnailsBar-theme02,
			sub(layer[scrollAreaContainer-thumbnailsBar-theme02].itemWidth, get(totalOffsetX-thumbnailsBar-theme02));
			sub(layer[scrollAreaContainer-thumbnailsBar-theme02].itemHeight, get(totalOffsetY-thumbnailsBar-theme02));
		);
		
		
		set(layer[scrollAreaContainer-thumbnailsBar-theme02].thumbWidth, get(layer[scrollAreaContainer-thumbnailsBar-theme02].itemWidth));
		set(layer[scrollAreaContainer-thumbnailsBar-theme02].thumbHeight, get(layer[scrollAreaContainer-thumbnailsBar-theme02].itemHeight));
		
		add(layer[scrollAreaContainer-thumbnailsBar-theme02].itemWidth, get(totalOffsetX-thumbnailsBar-theme02));
		add(layer[scrollAreaContainer-thumbnailsBar-theme02].itemHeight, get(totalOffsetY-thumbnailsBar-theme02));
	</action>
		
	
	<action name="thumbnailBorderImageInit-thumbnailsBar-theme02">
		
		set(layer[scrollAreaContainer-thumbnailsBar-theme02].offsetX, get(layer[thumbnailBorderSource-thumbnailsBar-theme02].offsetX));
		set(layer[scrollAreaContainer-thumbnailsBar-theme02].offsetY, get(layer[thumbnailBorderSource-thumbnailsBar-theme02].offsetY));
		
		
		mul(totalOffsetX-thumbnailsBar-theme02, get(layer[thumbnailBorderSource-thumbnailsBar-theme02].offsetX), 2);
		mul(totalOffsetY-thumbnailsBar-theme02, get(layer[thumbnailBorderSource-thumbnailsBar-theme02].offsetY), 2);
		
		
		if(startResize-thumbnailsBar-theme02,
			sub(layer[scrollAreaContainer-thumbnailsBar-theme02].itemWidth, get(totalOffsetX-thumbnailsBar-theme02));
			sub(layer[scrollAreaContainer-thumbnailsBar-theme02].itemHeight, get(totalOffsetY-thumbnailsBar-theme02));
		);
		
		
		set(layer[scrollAreaContainer-thumbnailsBar-theme02].thumbWidth, get(layer[scrollAreaContainer-thumbnailsBar-theme02].itemWidth));
		set(layer[scrollAreaContainer-thumbnailsBar-theme02].thumbHeight, get(layer[scrollAreaContainer-thumbnailsBar-theme02].itemHeight));
		
		add(layer[scrollAreaContainer-thumbnailsBar-theme02].itemWidth, get(totalOffsetX-thumbnailsBar-theme02));
		add(layer[scrollAreaContainer-thumbnailsBar-theme02].itemHeight, get(totalOffsetY-thumbnailsBar-theme02));
		
		
		div(layer[thumbnailBorderSource-thumbnailsBar-theme02].quarterHeight, get(layer[thumbnailBorderSource-thumbnailsBar-theme02].height), 4);
		
		
		set(cropX-thumbnailsBar-theme02, 0);
		set(cropY-thumbnailsBar-theme02, 0);
		set(cropW-thumbnailsBar-theme02, get(layer[thumbnailBorderSource-thumbnailsBar-theme02].width));
		set(cropH-thumbnailsBar-theme02, get(layer[thumbnailBorderSource-thumbnailsBar-theme02].quarterHeight));
		txtadd(layer[thumbnailBorderSource-thumbnailsBar-theme02].cropDefault, get(cropX-thumbnailsBar-theme02), '|', get(cropY-thumbnailsBar-theme02), '|', get(cropW-thumbnailsBar-theme02), '|', get(cropH-thumbnailsBar-theme02));

		
		add(cropY-thumbnailsBar-theme02, get(layer[thumbnailBorderSource-thumbnailsBar-theme02].quarterHeight));
		txtadd(layer[thumbnailBorderSource-thumbnailsBar-theme02].cropHover, get(cropX-thumbnailsBar-theme02), '|', get(cropY-thumbnailsBar-theme02), '|', get(cropW-thumbnailsBar-theme02), '|', get(cropH-thumbnailsBar-theme02));
		
		
		add(cropY-thumbnailsBar-theme02, get(layer[thumbnailBorderSource-thumbnailsBar-theme02].quarterHeight));
		txtadd(layer[thumbnailBorderSource-thumbnailsBar-theme02].cropSelected, get(cropX-thumbnailsBar-theme02), '|', get(cropY-thumbnailsBar-theme02), '|', get(cropW-thumbnailsBar-theme02), '|', get(cropH-thumbnailsBar-theme02));
		
		
		add(cropY-thumbnailsBar-theme02, get(layer[thumbnailBorderSource-thumbnailsBar-theme02].quarterHeight));
		txtadd(layer[thumbnailBorderSource-thumbnailsBar-theme02].cropVisited, get(cropX-thumbnailsBar-theme02), '|', get(cropY-thumbnailsBar-theme02), '|', get(cropW-thumbnailsBar-theme02), '|', get(cropH-thumbnailsBar-theme02));
		
		
		set(scaleX-thumbnailsBar-theme02, get(layer[thumbnailBorderSource-thumbnailsBar-theme02].offsetX));
		set(scaleY-thumbnailsBar-theme02, get(layer[thumbnailBorderSource-thumbnailsBar-theme02].offsetY));
		sub(scaleW-thumbnailsBar-theme02, get(layer[thumbnailBorderSource-thumbnailsBar-theme02].width), get(totalOffsetX-thumbnailsBar-theme02));
		sub(scaleH-thumbnailsBar-theme02, get(layer[thumbnailBorderSource-thumbnailsBar-theme02].quarterHeight), get(totalOffsetY-thumbnailsBar-theme02));
		txtadd(layer[thumbnailBorderSource-thumbnailsBar-theme02].scale9grid, get(scaleX-thumbnailsBar-theme02), '|', get(scaleY-thumbnailsBar-theme02), '|', get(scaleW-thumbnailsBar-theme02), '|', get(scaleH-thumbnailsBar-theme02));
	</action>
	
	
	<action name="loadThumbs-thumbnailsBar-theme02">
		
		

		ifnot(layer[scrollAreaContainer-thumbnailsBar-theme02].ready,
			
			
			if(layer[thumbnailBorderSource-thumbnailsBar-theme02].url,
				thumbnailBorderImageInit-thumbnailsBar-theme02();
			,
				thumbnailBorderDrawInit-thumbnailsBar-theme02();
			);
			
			
			set(thumbsCount-thumbnailsBar-theme02, 0);
			
			
				for( set(i-thumbnailsBar-theme02, 0), i-thumbnailsBar-theme02 LT scene.count, inc(i-thumbnailsBar-theme02),
					createThumb-thumbnailsBar-theme02(get(scene[get(i-thumbnailsBar-theme02)].name), get(scene[get(i-thumbnailsBar-theme02)].thumburl), get(i-thumbnailsBar-theme02), get(scene[get(i-thumbnailsBar-theme02)].titleid));
					inc(thumbsCount-thumbnailsBar-theme02);
				);
			
			
			
			
			
			
			set(layer[scrollAreaContainer-thumbnailsBar-theme02].currentThumbsCount, get(thumbsCount-thumbnailsBar-theme02));
			
			
			setSize-thumbnailsBar-theme02(get(layer[get(layer[scrollAreaContainer-thumbnailsBar-theme02].parent)].width), get(layer[get(layer[scrollAreaContainer-thumbnailsBar-theme02].parent)].height));
			
			
			set(layer[scrollAreaContainer-thumbnailsBar-theme02].visible, true);
			
			
				if (tour_displaycontrols,
					showWithControlsBar-thumbnailsBar-theme02();
				,
					hideWithControlsBar-thumbnailsBar-theme02();
				);
			
			
			set(layer[scrollAreaContainer-thumbnailsBar-theme02].ready, true);
		);
	</action>
	
	
	<action name="setSize-thumbnailsBar-theme02">
		
		
		set(layer[scrollAreaContainer-thumbnailsBar-theme02].targetWidth, %1);
		set(layer[scrollAreaContainer-thumbnailsBar-theme02].targetHeight, %2);
		
		
		set(layer[get(layer[scrollAreaContainer-thumbnailsBar-theme02].parent)].width, %1);
		set(layer[get(layer[scrollAreaContainer-thumbnailsBar-theme02].parent)].height, %2);
		layer[get(layer[scrollAreaContainer-thumbnailsBar-theme02].parent)].updatepos();
		
		
		mul(totalMarginX-thumbnailsBar-theme02, get(layer[scrollAreaContainer-thumbnailsBar-theme02].x), 2);
		mul(totalMarginY-thumbnailsBar-theme02, get(layer[scrollAreaContainer-thumbnailsBar-theme02].y), 2);
		
			add(totalPluginHeight-thumbnailsBar-theme02, get(totalMarginY-thumbnailsBar-theme02), get(layer[scrollAreaContainer-thumbnailsBar-theme02].itemHeight));
			
			
			
			if(layer[get(layer[scrollAreaContainer-thumbnailsBar-theme02].parent)].pixelheight LT totalPluginHeight-thumbnailsBar-theme02,
				set(layer[get(layer[scrollAreaContainer-thumbnailsBar-theme02].parent)].height, get(totalPluginHeight-thumbnailsBar-theme02));
			);
		
		layer[get(layer[scrollAreaContainer-thumbnailsBar-theme02].parent)].updatepos();
		
		
		sub(containerWidth-thumbnailsBar-theme02, get(layer[get(layer[scrollAreaContainer-thumbnailsBar-theme02].parent)].pixelwidth), get(totalMarginX-thumbnailsBar-theme02));
		sub(containerHeight-thumbnailsBar-theme02, get(layer[get(layer[scrollAreaContainer-thumbnailsBar-theme02].parent)].pixelheight), get(totalMarginY-thumbnailsBar-theme02));

		
		set(layer[scrollAreaContainer-thumbnailsBar-theme02].width, get(containerWidth-thumbnailsBar-theme02));
		set(layer[scrollAreaContainer-thumbnailsBar-theme02].height, get(containerHeight-thumbnailsBar-theme02));
		
		set(scrollAreaSize-thumbnailsBar-theme02, 0);
		
		
		mul(totalThumbsSpacer-thumbnailsBar-theme02, get(layer[scrollAreaContainer-thumbnailsBar-theme02].currentThumbsCount), get(layer[scrollAreaContainer-thumbnailsBar-theme02].thumbSpacer));
		sub(totalThumbsSpacer-thumbnailsBar-theme02, get(layer[scrollAreaContainer-thumbnailsBar-theme02].thumbSpacer));
		
		set(layer[get(layer[scrollAreaContainer-thumbnailsBar-theme02].parent)].visible, true);
		

			mul(scrollAreaSize-thumbnailsBar-theme02, get(layer[scrollAreaContainer-thumbnailsBar-theme02].itemWidth), get(layer[scrollAreaContainer-thumbnailsBar-theme02].currentThumbsCount));
			add(scrollAreaSize-thumbnailsBar-theme02, get(totalThumbsSpacer-thumbnailsBar-theme02));
			
			set(layer[thumbsScrollArea-thumbnailsBar-theme02].width, get(scrollAreaSize-thumbnailsBar-theme02));
			set(layer[thumbsScrollArea-thumbnailsBar-theme02].height, get(layer[scrollAreaContainer-thumbnailsBar-theme02].itemHeight));
			
			
			if(layer[scrollAreaContainer-thumbnailsBar-theme02].width LT layer[scrollAreaContainer-thumbnailsBar-theme02].itemWidth,
				set(layer[get(layer[scrollAreaContainer-thumbnailsBar-theme02].parent)].visible, false);
			,
				verifyThumbnailsBarVisibility-thumbnailsBar-theme02();
			);
			
		
		
		if(layer[get(layer[scrollAreaContainer-thumbnailsBar-theme02].parent)].width LT 0,
			set(layer[get(layer[scrollAreaContainer-thumbnailsBar-theme02].parent)].visible, false);
		);
		
	</action>
	
	
	<action name="verifyThumbnailsBarVisibility-thumbnailsBar-theme02">
		if(layer[get(layer[scrollAreaContainer-thumbnailsBar-theme02].parent)].visible,
			set(boolValue-thumbnailsBar-theme02, false);
			
			if (tour_displaythumbnails,
				if (tour_displaycontrols,
					set(boolValue-thumbnailsBar-theme02, true);
				);
			);
			
			set(layer[get(layer[scrollAreaContainer-thumbnailsBar-theme02].parent)].visible, get(boolValue-thumbnailsBar-theme02));
		);
	</action>
	
	
	<action name="createThumb-thumbnailsBar-theme02">

			add(offsetFactor-thumbnailsBar-theme02, get(layer[scrollAreaContainer-thumbnailsBar-theme02].itemWidth), get(layer[scrollAreaContainer-thumbnailsBar-theme02].thumbSpacer));
	
			mul(thumbIncPos-thumbnailsBar-theme02, %3, get(offsetFactor-thumbnailsBar-theme02));
			
			
			if(layer[thumbnailBorderSource-thumbnailsBar-theme02].url,
				add(thumbIncPos-thumbnailsBar-theme02, get(layer[scrollAreaContainer-thumbnailsBar-theme02].offsetX));
			);
			
		
		mul(negativeOffsetX-thumbnailsBar-theme02, get(layer[scrollAreaContainer-thumbnailsBar-theme02].offsetX), -1);
		mul(negativeOffsetY-thumbnailsBar-theme02, get(layer[scrollAreaContainer-thumbnailsBar-theme02].offsetY), -1);
		
		set(thumbName, 'thumb_');
		txtadd(thumbName, %1);
		txtadd(thumbName, '-thumbnailsBar-theme02');
		addlayer(get(thumbName));
		
		set(thumbBorderName, 'thumbBorder_');
		txtadd(thumbBorderName, %1);
		txtadd(thumbBorderName, '-thumbnailsBar-theme02');
		addlayer(get(thumbBorderName));
		
		
		ifnot(layer[thumbnailBorderSource-thumbnailsBar-theme02].url,
			set(layer[get(thumbBorderName)].type, container);
			set(layer[get(thumbBorderName)].parent, thumbsScrollArea-thumbnailsBar-theme02);
		);
		
		<!-- THUMB -->
		set(layer[get(thumbName)].url, %2);
		set(layer[get(thumbName)].keep, true);
		set(layer[get(thumbName)].width, get(layer[scrollAreaContainer-thumbnailsBar-theme02].thumbWidth));
		set(layer[get(thumbName)].height, get(layer[scrollAreaContainer-thumbnailsBar-theme02].thumbHeight));
		set(layer[get(thumbName)].align, topleft);
		
		
			set(layer[get(thumbName)].y, get(layer[scrollAreaContainer-thumbnailsBar-theme02].offsetY));
		
			if(layer[thumbnailBorderSource-thumbnailsBar-theme02].url,
				set(layer[get(thumbName)].parent, thumbsScrollArea-thumbnailsBar-theme02);
				set(layer[get(thumbName)].x, get(thumbIncPos-thumbnailsBar-theme02));
			,
				set(layer[get(thumbName)].parent, get(thumbBorderName));
				set(layer[get(thumbName)].x, get(layer[scrollAreaContainer-thumbnailsBar-theme02].offsetX));
				set(layer[get(thumbName)].onclick, mainloadscene(%1); resetMouseBehavior-thumbnailsBar-theme02(); highlightThumb-thumbnailsBar-theme02(%1));
			);	
			
		
		<!-- BORDER -->
		set(layer[get(thumbBorderName)].keep, true);
		set(layer[get(thumbBorderName)].width, get(layer[scrollAreaContainer-thumbnailsBar-theme02].itemWidth));
		set(layer[get(thumbBorderName)].height, get(layer[scrollAreaContainer-thumbnailsBar-theme02].itemHeight));
		set(layer[get(thumbBorderName)].align, topleft);
		
		if(layer[thumbnailBorderSource-thumbnailsBar-theme02].url,
			set(layer[get(thumbBorderName)].url, get(layer[thumbnailBorderSource-thumbnailsBar-theme02].url));
			set(layer[get(thumbBorderName)].scale9grid, get(layer[thumbnailBorderSource-thumbnailsBar-theme02].scale9grid));
			set(layer[get(thumbBorderName)].parent, get(thumbName));
			set(layer[get(thumbBorderName)].x, get(negativeOffsetX-thumbnailsBar-theme02));
			set(layer[get(thumbBorderName)].y, get(negativeOffsetY-thumbnailsBar-theme02));
			set(layer[get(thumbBorderName)].onclick, mainloadscene(%1); resetMouseBehavior-thumbnailsBar-theme02(); highlightThumb-thumbnailsBar-theme02(%1));
		,
			
				set(layer[get(thumbBorderName)].x, get(thumbIncPos-thumbnailsBar-theme02)); 
				
		);
		
		
		setupMouseBehavior-thumbnailsBar-theme02(%1, %4);
		
	</action>
	
	
	<action name="removeThumb-thumbnailsBar-theme02">
		set(thumbName, 'thumb_');
		txtadd(thumbName, %1);
		txtadd(thumbName, '-thumbnailsBar-theme02');
		removelayer(get(thumbName));
		
		set(thumbBorderName, 'thumbBorder_');
		txtadd(thumbBorderName, %1);
		txtadd(thumbBorderName, '-thumbnailsBar-theme02');
		removelayer(get(thumbBorderName));
	</action>
	
	
	
	<action name="setupArrows-thumbnailsBar-theme02">
		
		if(layer[scrollAreaContainer-thumbnailsBar-theme02].adjustToContent,
			hideArrows-thumbnailsBar-theme02();
		,
			ifnot(device.touchdevice,
				
					if(layer[scrollAreaContainer-thumbnailsBar-theme02].width LT layer[thumbsScrollArea-thumbnailsBar-theme02].width,
				
					showArrows-thumbnailsBar-theme02();
				,
					hideArrows-thumbnailsBar-theme02();
				);
			,
				hideArrows-thumbnailsBar-theme02();
			);
		);
		
		
		if(%1,
			scrollToCurrentThumb-thumbnailsBar-theme02();
		);
		
		
			
			if(layer[scrollAreaContainer-thumbnailsBar-theme02].width LT layer[scrollAreaContainer-thumbnailsBar-theme02].itemWidth,
				set(layer[get(layer[scrollAreaContainer-thumbnailsBar-theme02].parent)].visible, false);
			);
	</action>
	
	
	<action name="showArrows-thumbnailsBar-theme02">
		
		
		
		
		set(layer[scrollPrevArrow-thumbnailsBar-theme02].visible, true);
		set(layer[scrollNextArrow-thumbnailsBar-theme02].visible, true);
		
		
		
			
			add(totalArrowSize-thumbnailsBar-theme02, get(layer[scrollPrevArrow-thumbnailsBar-theme02].width), get(layer[scrollNextArrow-thumbnailsBar-theme02].width));
		
			
			sub(scrollAreaContainerSize-thumbnailsBar-theme02, get(layer[get(layer[scrollAreaContainer-thumbnailsBar-theme02].parent)].pixelwidth), get(totalArrowSize-thumbnailsBar-theme02));
		
			set(layer[scrollAreaContainer-thumbnailsBar-theme02].width, get(scrollAreaContainerSize-thumbnailsBar-theme02));
			
			set(layer[scrollAreaContainer-thumbnailsBar-theme02].x, get(layer[scrollPrevArrow-thumbnailsBar-theme02].width));
			
		
		
		set(layer[scrollPrevArrow-thumbnailsBar-theme02].onhover, scrollPrev-thumbnailsBar-theme02(););
		set(layer[scrollNextArrow-thumbnailsBar-theme02].onhover, scrollNext-thumbnailsBar-theme02(););
		
		set(layer[scrollPrevArrow-thumbnailsBar-theme02].onclick, scrollPrev-thumbnailsBar-theme02(get(layer[scrollAreaContainer-thumbnailsBar-theme02].scrollSpeedAcceleration)););
		set(layer[scrollNextArrow-thumbnailsBar-theme02].onclick, scrollNext-thumbnailsBar-theme02(get(layer[scrollAreaContainer-thumbnailsBar-theme02].scrollSpeedAcceleration)););
		
		
		
		
		
		set(layer[scrollPrevArrow-thumbnailsBar-theme02].onout, set(layer[scrollAreaContainer-thumbnailsBar-theme02].scrollSpeed, get(layer[scrollAreaContainer-thumbnailsBar-theme02].scrollSpeedInit)););
		set(layer[scrollNextArrow-thumbnailsBar-theme02].onout, set(layer[scrollAreaContainer-thumbnailsBar-theme02].scrollSpeed, get(layer[scrollAreaContainer-thumbnailsBar-theme02].scrollSpeedInit)););
		
	</action>
	
	
	
	
	<action name="hideArrows-thumbnailsBar-theme02">
		<!-- Hide Arrows -->
		set(layer[scrollPrevArrow-thumbnailsBar-theme02].visible, false);
		set(layer[scrollNextArrow-thumbnailsBar-theme02].visible, false);
		
		

			mul(totalMargin-thumbnailsBar-theme02, get(layer[scrollAreaContainer-thumbnailsBar-theme02].marginX), 2);
			
			sub(scrollAreaContainerSize-thumbnailsBar-theme02, get(layer[get(layer[scrollAreaContainer-thumbnailsBar-theme02].parent)].pixelwidth), get(totalMargin-thumbnailsBar-theme02));

			set(layer[scrollAreaContainer-thumbnailsBar-theme02].width, get(scrollAreaContainerSize-thumbnailsBar-theme02));
			set(layer[scrollAreaContainer-thumbnailsBar-theme02].x, get(layer[scrollAreaContainer-thumbnailsBar-theme02].marginX));
			 
			
	</action>
	
	
	<action name="scrollPrev-thumbnailsBar-theme02">
		
		
		if(%1,
			inc(layer[scrollAreaContainer-thumbnailsBar-theme02].scrollSpeed, %1);
		);
		
		layer[thumbsScrollArea-thumbnailsBar-theme02].stopscrolling();
		
		set(scrollLimit-thumbnailsBar-theme02, 0);
		
		
			
				sub(scrollLimit-thumbnailsBar-theme02, get(layer[thumbsScrollArea-thumbnailsBar-theme02].width), get(layer[scrollAreaContainer-thumbnailsBar-theme02].width));
				div(scrollLimit-thumbnailsBar-theme02, 2);
			
			add(layer[thumbsScrollArea-thumbnailsBar-theme02].x, get(layer[scrollAreaContainer-thumbnailsBar-theme02].scrollSpeed));
			if(layer[thumbsScrollArea-thumbnailsBar-theme02].x GE scrollLimit-thumbnailsBar-theme02,
				set(layer[thumbsScrollArea-thumbnailsBar-theme02].x, get(scrollLimit-thumbnailsBar-theme02));
			);
		
		if(layer[scrollAreaContainer-thumbnailsBar-theme02].scrollSpeed LT layer[scrollAreaContainer-thumbnailsBar-theme02].scrollSpeedMax,
			inc(layer[scrollAreaContainer-thumbnailsBar-theme02].scrollSpeed);
		);
		
	</action>
	
	
	<action name="scrollNext-thumbnailsBar-theme02">
		
		
		if(%1,
			inc(layer[scrollAreaContainer-thumbnailsBar-theme02].scrollSpeed, %1);
		);
		
		layer[thumbsScrollArea-thumbnailsBar-theme02].stopscrolling();
		
			
			sub(scrollLimit-thumbnailsBar-theme02, get(layer[thumbsScrollArea-thumbnailsBar-theme02].width), get(layer[scrollAreaContainer-thumbnailsBar-theme02].width));
			
				div(scrollLimit-thumbnailsBar-theme02, 2);
			mul(scrollLimit-thumbnailsBar-theme02, -1);
			
			sub(layer[thumbsScrollArea-thumbnailsBar-theme02].x, get(layer[scrollAreaContainer-thumbnailsBar-theme02].scrollSpeed));
			if(layer[thumbsScrollArea-thumbnailsBar-theme02].x LE scrollLimit-thumbnailsBar-theme02,
				set(layer[thumbsScrollArea-thumbnailsBar-theme02].x, get(scrollLimit-thumbnailsBar-theme02));
			);
		
		if(layer[scrollAreaContainer-thumbnailsBar-theme02].scrollSpeed LT layer[scrollAreaContainer-thumbnailsBar-theme02].scrollSpeedMax,
			inc(layer[scrollAreaContainer-thumbnailsBar-theme02].scrollSpeed);
		);
		
	</action>
	
	
	<action name="resetMouseBehavior-thumbnailsBar-theme02">
	
		
		
			for( set(i, 0), i LT scene.count, inc(i),
				set(thumbBorderName, 'thumbBorder_');
				txtadd(thumbBorderName, get(scene[get(i)].name));
				txtadd(thumbBorderName, '-thumbnailsBar-theme02');
				
				setupMouseBehavior-thumbnailsBar-theme02(get(scene[get(i)].name), get(scene[get(i)].titleid));
			);
		
	</action>
	
	
	<action name="setupMouseBehavior-thumbnailsBar-theme02">

		set(thumbName, 'thumb_');
		txtadd(thumbName, %1);
		txtadd(thumbName, '-thumbnailsBar-theme02');
		
		set(thumbBorderName, 'thumbBorder_');
		txtadd(thumbBorderName, %1);
		txtadd(thumbBorderName, '-thumbnailsBar-theme02');
		
		if(layer[thumbnailBorderSource-thumbnailsBar-theme02].url,
			set(layer[get(thumbBorderName)].crop, get(layer[thumbnailBorderSource-thumbnailsBar-theme02].cropDefault));
			set(layer[get(thumbBorderName)].onovercrop, get(layer[thumbnailBorderSource-thumbnailsBar-theme02].cropHover));
			set(layer[get(thumbBorderName)].ondowncrop, get(layer[thumbnailBorderSource-thumbnailsBar-theme02].cropHover));
			set(layer[get(thumbBorderName)].tooltip, %2);
				set(layer[get(thumbBorderName)].onhover, showToolTip(get(align), tooltipStyle-thumbnailsBar-theme02));
				set(layer[get(thumbBorderName)].onout, hideTooltip());
		,
			set(layer[get(thumbBorderName)].bgcolor, get(layer[thumbnailBorderSource-thumbnailsBar-theme02].borderColorDefault));
			set(layer[get(thumbBorderName)].bgalpha, get(layer[thumbnailBorderSource-thumbnailsBar-theme02].borderAlphaDefault));
				set(layer[get(thumbName)].tooltip, %2);
				set(layer[get(thumbName)].onhover, showToolTip(get(align), tooltipStyle-thumbnailsBar-theme02));
			
			set(layer[get(thumbName)].onover, 
				set(layer[get(parent)].bgcolor, get(layer[thumbnailBorderSource-thumbnailsBar-theme02].borderColorHover));
				set(layer[get(parent)].bgalpha, get(layer[thumbnailBorderSource-thumbnailsBar-theme02].borderAlphaHover));
			);
			
			set(layer[get(thumbName)].onout, 
				set(layer[get(parent)].bgcolor, get(layer[thumbnailBorderSource-thumbnailsBar-theme02].borderColorDefault));
				set(layer[get(parent)].bgalpha, get(layer[thumbnailBorderSource-thumbnailsBar-theme02].borderAlphaDefault));
				hideTooltip();
			);
		);
	
	</action>
	
	
	<action name="highlightCurrentThumb-thumbnailsBar-theme02">
			highlightThumb-thumbnailsBar-theme02(get(xml.scene));
	</action>
	
	
	<action name="highlightThumb-thumbnailsBar-theme02">
	
		set(thumbBorderName, 'thumbBorder_');
		txtadd(thumbBorderName, %1);
		txtadd(thumbBorderName, '-thumbnailsBar-theme02');
		
		if(layer[thumbnailBorderSource-thumbnailsBar-theme02].url,
			set(layer[get(thumbBorderName)].crop, get(layer[thumbnailBorderSource-thumbnailsBar-theme02].cropSelected));
			set(layer[get(thumbBorderName)].onovercrop, get(layer[thumbnailBorderSource-thumbnailsBar-theme02].cropSelected));
			set(layer[get(thumbBorderName)].ondowncrop, get(layer[thumbnailBorderSource-thumbnailsBar-theme02].cropSelected));
		,
			set(thumbName, 'thumb_');
			txtadd(thumbName, %1);
			txtadd(thumbName, '-thumbnailsBar-theme02');
			
			set(layer[get(thumbBorderName)].bgcolor, get(layer[thumbnailBorderSource-thumbnailsBar-theme02].borderColorSelected));
			set(layer[get(thumbBorderName)].bgalpha, get(layer[thumbnailBorderSource-thumbnailsBar-theme02].borderAlphaSelected));
			
			set(layer[get(thumbName)].onover, "");
			set(layer[get(thumbName)].onout, hideTooltip(););
		);

		scrollToThumb-thumbnailsBar-theme02(%1);
	</action>
	
	
	<action name="scrollToCurrentThumb-thumbnailsBar-theme02">
			scrollToThumb-thumbnailsBar-theme02(get(xml.scene));
	</action>
	
	
	<action name="scrollToThumb-thumbnailsBar-theme02">
		
		set(thumbName, 'thumb_');
		set(thumbBorderName, 'thumbBorder_');
		
		txtadd(thumbName, %1);
		txtadd(thumbName, '-thumbnailsBar-theme02');
		txtadd(thumbBorderName, %1);
		txtadd(thumbBorderName, '-thumbnailsBar-theme02');

			set(posX-thumbnailsBar-theme02, 0);
			if(layer[thumbnailBorderSource-thumbnailsBar-theme02].url,
				div(halfThumbWidth-thumbnailsBar-theme02, get(layer[get(thumbName)].width), 2);
				ifnot(layer[scrollAreaContainer-thumbnailsBar-theme02].adjustToContent,
					add(posX-thumbnailsBar-theme02, get(layer[get(thumbName)].x), get(halfThumbWidth-thumbnailsBar-theme02));
				);
				if(layer[thumbsScrollArea-thumbnailsBar-theme02].scrolltocenter,
					layer[thumbsScrollArea-thumbnailsBar-theme02].scrolltocenter(get(posX-thumbnailsBar-theme02), 0);
				);
			,
				div(halfThumbWidth-thumbnailsBar-theme02, get(layer[get(thumbBorderName)].width), 2);
				ifnot(layer[scrollAreaContainer-thumbnailsBar-theme02].adjustToContent,
					add(posX-thumbnailsBar-theme02, get(layer[get(thumbBorderName)].x), get(halfThumbWidth-thumbnailsBar-theme02));
				);
				if(layer[thumbsScrollArea-thumbnailsBar-theme02].scrolltocenter,
					layer[thumbsScrollArea-thumbnailsBar-theme02].scrolltocenter(get(posX-thumbnailsBar-theme02), 0);
				);
			);
		
	</action>




  <!-- Sounds Management -->
  <plugin name="soundinterface"
          preload="true"
          url="%FIRSTXML%/graphics/soundinterface.swf"
          alturl="%FIRSTXML%/graphics/soundinterface.js"
          rootpath="%FIRSTXML%/sounds"
          backgroundsound=""
          backgroundsoundloops="0"
          bgsound="false"
          volumeinitialized="false"
          keep="true"/>
  <events name="soundmanagementevents"
          onnewpano="playbackgroundsound();"
          onxmlcomplete="soundinterfaceonxmlcomplete();"
          keep="true"/>
  <action name="soundinterfaceonxmlcomplete">
    ifnot(plugin[soundinterface].volumeinitialized,
      div(plugin[soundinterface].volume, tour_soundsvolume, 100);
      set(plugin[soundinterface].volumeinitialized,true);
    );
  </action>
  <action name="playbackgroundsound">
    if (xml.scene,
      if (scene[get(xml.scene)].backgroundsound,
        if (plugin[soundinterface].backgroundsound != scene[get(xml.scene)].backgroundsound,
          copy(plugin[soundinterface].backgroundsound     , scene[get(xml.scene)].backgroundsound);
          copy(plugin[soundinterface].backgroundsoundloops, scene[get(xml.scene)].backgroundsoundloops);
          if (tour_soundson == true,
            playsound(bgsoundname, get(plugin[soundinterface].backgroundsound), get(plugin[soundinterface].backgroundsoundloops));
            set(plugin[soundinterface].bgsound, true);
           ,
            set(plugin[soundinterface].bgsound, false);
          );
        );
      );
    );
  </action>
  <action name="resetbackgroundsoundifneeded">
    if (xml.scene,
      if (scene[get(xml.scene)].backgroundsound != scene[%1].backgroundsound,
        if (plugin[soundinterface].backgroundsound,
          if (plugin[soundinterface].bgsound,
            stopsound(bgsoundname);
          );
        );
        set(plugin[soundinterface].backgroundsound     , "");
        set(plugin[soundinterface].backgroundsoundloops, 0);
        set(plugin[soundinterface].bgsound             , false);
      );
    );
  </action>
  <action name="pausebackgroundsound">
    if (plugin[soundinterface].backgroundsound,
      if (plugin[soundinterface].bgsound,
        pausesound(bgsoundname);
      );
    );
  </action>
  <action name="resumebackgroundsound">
    if (tour_soundson == true,
      if (plugin[soundinterface].backgroundsound,
        if (plugin[soundinterface].bgsound,
          resumesound(bgsoundname);
         ,
          playsound(bgsoundname, get(plugin[soundinterface].backgroundsound), get(plugin[soundinterface].backgroundsoundloops));
          set(plugin[soundinterface].bgsound, true);
        );
      );
    );
  </action>
  <action name="preloadSounds">
    preloadsound("main entrance.mp3");
    preloadsound("library.mp3");
    preloadsound("science.mp3");
    preloadsound("connected learning.mp3");
    preloadsound("agriculture.mp3");
    preloadsound("hospitality.mp3");
    preloadsound("food technology.mp3");
    preloadsound("technology and applied science.mp3");
  </action>
  <action name="play3DLocalSounds">
    if (xml.scene, if (scene[get(xml.scene)].haslocalsounds, playpanolocalsounds();););
  </action>
  <action name="stop3DLocalSounds">
    if (xml.scene, if (scene[get(xml.scene)].haslocalsounds, stoppanolocalsounds();););
  </action>
  <action name="set3DLocalSoundsVolume">
    if (xml.scene, if (scene[get(xml.scene)].haslocalsounds, setpanolocalsoundsvolume();););
  </action>
  <action name="playTourSounds">
    set(tour_soundson, true);events.dispatch(playtoursoundsevent);
    play3DLocalSounds();
    resumebackgroundsound();
  </action>
  <action name="stopTourSounds">
    set(tour_soundson, false);events.dispatch(stoptoursoundsevent);
    stop3DLocalSounds();
    pausebackgroundsound();
  </action>
  <action name="setTourSoundsVolume">
    set(tour_soundsvolume, %1);
    div(volume, tour_soundsvolume, 100);
    set(plugin[soundinterface].volume, get(volume));
    set3DLocalSoundsVolume();
  </action>
  <!-- Fullscreen Management -->
  <action name="exitFullScreen">set(tour_fullscreen,false);set(fullscreen,false);</action>
  <action name="enterFullScreen">set(tour_fullscreen,true);set(fullscreen,true);</action>
  <action name="switchFullScreen">if(tour_fullscreen,exitFullScreen();,enterFullScreen(););</action>

  
  <events name="krpanoExitFullscreenEvent"
    onexitfullscreen="if(tour_fullscreen,exitFullScreenChangeEvent(););"
    keep="true" />

  <action name="exitFullScreenChangeEvent">set(tour_fullscreen,false);events.dispatch(onexitfullscreen);</action>
</krpano>