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

    
  <!-- Spot Style - Scene Link Spot -->


  <style name="IconSceneLinkSpot"
         url="%FIRSTXML%/spots/pin_2d_hole_user_defaultpoint0.png"
         visible="false"
         edge="bottom" ox="0" oy="0"
         alpha="0.8"
         onhover="onhoverIconSceneLinkSpot"
         onover="onoverIconSceneLinkSpot"
         onout="onoutIconSceneLinkSpot"

         height="24"
         width="14"
         />
  <action name="onhoverIconSceneLinkSpot">
    showtooltip('hotspot');
  </action>
  <action name="onoverIconSceneLinkSpot">
tween(scale, 1.2);
tween(alpha, 1);

  </action>
  <action name="onoutIconSceneLinkSpot">
    hideTooltip();
    tween(scale, 1);
    tween(alpha, 0.8);

  </action>



  <!-- unsupported kind of display : PointMap -->


    
  <!-- Spot Style - Areas of Interest 1_1 -->


  <style name="IconAreasofInterest1_1"
         url="%FIRSTXML%/spots/number_1_user_defaultpoint11_2.png"
         visible="false"
         edge="bottom" ox="0" oy="0"
         onhover="onhoverIconAreasofInterest1_1"
         onout="onoutIconAreasofInterest1_1"


         />
  <action name="onhoverIconAreasofInterest1_1">
    showtooltip('hotspot');
  </action>
  <action name="onoutIconAreasofInterest1_1">
    hideTooltip();



  </action>



    
  <!-- Spot Style - Age Dates -->


  <style name="IconAgeDates"
         url="%FIRSTXML%/spots/clock_user_defaultpoint2.png"
         visible="false"
         edge="center"
         onhover="onhoverIconAgeDates"
         onout="onoutIconAgeDates"

         height="30"
         width="30"
         />
  <action name="onhoverIconAgeDates">
    showtooltip('hotspot');
  </action>
  <action name="onoutIconAgeDates">
    hideTooltip();



  </action>



    
  <!-- Spot Style - 3D Model Spot -->


  <style name="Icon3DModelSpot"
         url="%FIRSTXML%/spots/sketchfab_logo_user_defaultpoint3.png"
         visible="false"
         edge="center"
         alpha="0.8"
         onhover="onhoverIcon3DModelSpot"
         onover="onoverIcon3DModelSpot"
         onout="onoutIcon3DModelSpot"

         height="40"
         width="40"
         />
  <action name="onhoverIcon3DModelSpot">
    showtooltip('hotspot');
  </action>
  <action name="onoverIcon3DModelSpot">

tween(alpha, 1);

  </action>
  <action name="onoutIcon3DModelSpot">
    hideTooltip();

    tween(alpha, 0.8);

  </action>



    
  <!-- Spot Style - Name -->


  <style name="IconName"
         url="%FIRSTXML%/spots/pin_3d_hole_user_defaultpoint4.png"
         visible="false"
         edge="bottom" ox="0" oy="0"
         alpha="0.8"
         onhover="onhoverIconName"
         onover="onoverIconName"
         onout="onoutIconName"

         height="22"
         width="12"
         />
  <action name="onhoverIconName">
    showtooltip('hotspot');
  </action>
  <action name="onoverIconName">
tween(scale, 1.2);
tween(alpha, 1);

  </action>
  <action name="onoutIconName">
    hideTooltip();
    tween(scale, 1);
    tween(alpha, 0.8);

  </action>



    
  <!-- Spot Style - Info Please -->


  <style name="IconInfoPlease"
         url="%FIRSTXML%/spots/hotspot_neutral_user_defaultpoint5.png"
         visible="false"
         edge="center"
         onhover="onhoverIconInfoPlease"
         onout="onoutIconInfoPlease"


         />
  <action name="onhoverIconInfoPlease">
    showtooltip('hotspot');
  </action>
  <action name="onoutIconInfoPlease">
    hideTooltip();



  </action>



<!-- ********** -->
<!-- Loading Information -->
<!-- id : loaderinfo -->
<!-- ********** -->

  <events name="loaderinfoevent" onxmlcomplete="loaderinfoupdate();" keep="true"/>

  <action name="loaderinfoupdate">
    if(scene[get(xml.scene)].video,
      set(layer[loaderinfotextfield].visible, false);
    ,
      if (progress.progress == 1,
        delayedcall(0.5, set(layer[loaderinfotextfield].visible, false); );
      ,
        set(layer[loaderinfotextfield].visible, true);
      );
      mul(progresstext, get(progress.progress),100);
      roundval(progresstext);
      txtadd(progresstext, get(progresstext), %);
      set(layer[loaderinfotextfield].html, get(progresstext));
      ifnot(progress.progress GE 1, delayedcall(0.01, loaderinfoupdate() ));
    );
  </action>

  <layer name="loaderinfotextfield"
         keep="true"
         zorder="1"
         type="text"
         align="center"
         x="0"
         y="0"
         bgborder="0"
         bg="false"
         capture="false"
         handcursor="false"
         interactivecontent="false"
         alpha="1"
         visible="true"
         css="
         text-align:center;
         color:#beefff;
         font-family:Calibri;
         font-weight:bold;
         font-size:20px;
         "
  />

<!-- ********** -->
<!-- Compass -->
<!-- id : compass -->
<!-- ********** -->

  <layer name="compassbackground"
         type="container"
         keep="true"
         handcursor="false"
         capture="false"
         align="topright"
         x="0"
         y="0"
         zorder="2"
         visible="false"
         active="true"
         started="false"

         height="125"
         width="125"

         >

    <layer name="compassrotatebackground"
           url="%FIRSTXML%/graphics/compass/compassbgffffff.png"
           keep="true"
           handcursor="false"
           capture="false"
           align="center"
           zorder="0"
           height="100%"
           width="100%"
           />


    <layer name="compassradar" keep="true"
         url.html5="%FIRSTXML%/graphics/radar.js"
         align="center"
         heading="0.0"
         headingoffset="0.0"
         fillcolor="0x938b14"
         fillalpha="0.50000762951094835"
         width="100%"
         height="100%"
         zorder="1"
         />


    <layer name="compasspointer"
           url="%FIRSTXML%/graphics/compass/compasspointer212177.png"
           keep="true"
           align="center"
           handcursor="false"
           capture="false"
           zorder="1"
           height="100%"
           width="100%"
          />
  </layer>

  <events name="compassevts"
          keep="true"
          onnewpano="compassUpdateOrientation();"
          onviewchanged="compassUpdateOrientation();"
    onTourStart="set(layer[compassbackground].started, true);showcompass();"
          hidetourcontrols="hidecompass();"
          showtourcontrols="set(layer[compassbackground].started, true);showcompass();"
         />

  <action name="compassUpdateOrientation">
    if(scene[get(xml.scene)].planar,
      set(layer[compassbackground].active, false);
      hidecompass();
    ,

      set(layer[compassbackground].active, true);
      mod(compasshlookat, view.hlookat, 360);
      mul(compassheading, -1, get(scene[get(xml.scene)].heading));
      if (compassheading == null, set(compassheading, 0));
      sub(layer[compassrotatebackground].rotate, compassheading, compasshlookat);

      sub(layer[compassradar].heading, 0, compasshlookat);

      showcompass();
    );
  </action>

 
  <action name="hidecompass">
    set(layer[compassbackground].visible, false);
  </action>
  <action name="showcompass">
    if(tour_displaycontrols,
    if(layer[compassbackground].active AND layer[compassbackground].started,set(layer[compassbackground].visible, true););
    ,hidecompass(););
  </action>


<!-- ********** -->
<!-- Simple Thumbnails Bar -->
<!-- id : thumbnailsBar -->
<!-- ********** -->







<layer name="thumbnailsBar_thumbnailsBar"
	keep="true"
	type="container"
	visible="false"
	align="bottomleft"

		width="0"
		height="100%"
		

	x="0"
	y="0"

	bgcolor="0xdedede"
	bgalpha="0.10000762951094835"

	zorder="3"
/>



<layer name="thumbnailBorderSource_thumbnailsBar"
	keep="true"
	visible="false"

	borderWidth="2"
	borderColorDefault="0xe6e6e6" 
	borderColorHover="0xffffff"
	borderColorSelected="0xffffff"
	borderAlphaDefault="0.50000762951094835" 
	borderAlphaHover="1"
	borderAlphaSelected="1"

	url=""
	offsetX="0"
	offsetY="0"
	quarterHeight="0"
/>



  <layer name="tooltipStyle_thumbnailsBar"
	       keep="true"
	       enabled="false"
         capture="false"
	       type="text"
         align="center"
         bg="false"
         bgborder="0"
         css="color:#ffffff;font-family:Helvetica;font-weight:bold;font-size:14px;text-align:left;"
         interactivecontent="false"
         zorder="0"
         padding="2"
         xoffset="0"
         yoffset="0"
         visible="false"
         html=""
         edge="left"
         />

	
	<krpano arrow1Loaded_thumbnailsBar="false" arrow2Loaded_thumbnailsBar="false" borderLoaded_thumbnailsBar="false" thumbnailsLoadedCounter_thumbnailsBar="0" thumbsCount_thumbnailsBar="0" thumbsCounter_thumbnailsBar="0" firstInit_thumbnailsBar="false" />
	
	
	<events name="thumbnailsScrollEvents_thumbnailsBar" 
		keep="true" 
		
		onxmlcomplete="ifnot(startResize_thumbnailsBar,set(isLoaded_thumbnailsBar, true);if(isStarted_thumbnailsBar,onLoadCompleteHandler_thumbnailsBar();););"
		onTourStart="set(isStarted_thumbnailsBar, true);if(isLoaded_thumbnailsBar,onLoadCompleteHandler_thumbnailsBar(););"
		onnewpano="if(startResize_thumbnailsBar,if(firstInit_thumbnailsBar,onLoadCompleteHandler_thumbnailsBar();););"
		onresize="onResizeHandler_thumbnailsBar();"
		hidetourthumbnails="hideWithThumbnailsButton_thumbnailsBar();" 
		showtourthumbnails="showWithThumbnailsButton_thumbnailsBar();" 
		hidetourcontrols="hideWithControlsBar_thumbnailsBar();" 
		showtourcontrols="showWithControlsBar_thumbnailsBar();" 
		onenterfullscreen="delayedcall(0.2,scrollToCurrentThumb_thumbnailsBar(););"
		onexitfullscreen="delayedcall(0.2,scrollToCurrentThumb_thumbnailsBar(););"	
	/>
	
	
	<layer name="scrollAreaContainer_thumbnailsBar" 
         keep="true"
         type="container" 
         align="topleft" x="10" y="10"
         marginX="10"
         marginY="10"
         width="0" height="0"
         targetWidth="0"
         targetHeight="0"
         scrollSpeedInit="10"
         scrollSpeed="10"
         scrollSpeedMax="70"
         scrollSpeedAcceleration="20"
         parent="thumbnailsBar_thumbnailsBar"
         thumbWidth="0"
         thumbHeight="0"
         itemWidth="100"
         itemHeight="50"
         offsetX="0" offsetY="0"
         thumbSpacer="10"
         currentThumbsCount="0"
         adjustToContent="false"
         zorder="1"
         visible="false"
         ready="false">
	
		
    <layer name="thumbsScrollArea_thumbnailsBar"
           url.html5="%FIRSTXML%/graphics/scrollarea.js"
           align="bottomleft" x="0" y="0"
           onhover_autoscrolling="false"
           direction="v"/>
	
	</layer>
	
	
	<layer name="scrollPrevArrow_thumbnailsBar" 
         keep="true"
         type="image"
         visible="false"
         parent="thumbnailsBar_thumbnailsBar"
         targetHeight="0"
         targetWidth="0"
         zorder="2"
         onloaded="loadedImages_thumbnailsBar(arrow1);"
         url="%FIRSTXML%/graphics/thumbnailsbar/btn_scroll_up.png"
         align="top"
	/>
	
	
	<layer name="scrollNextArrow_thumbnailsBar" 
         keep="true"
         type="image"
         visible="false"
         parent="thumbnailsBar_thumbnailsBar"
         targetHeight="0"
         targetWidth="0"
         zorder="2"
         onloaded="loadedImages_thumbnailsBar(arrow2);"
         url="%FIRSTXML%/graphics/thumbnailsbar/btn_scroll_down.png"
         align="bottom"
	/>
	
	<action name="loadedImages_thumbnailsBar">
		if(%1 == "arrow1",
			set(arrow1Loaded_thumbnailsBar, true);
		);
		if(%1 == "arrow2",
			set(arrow2Loaded_thumbnailsBar, true);
		);
		if(%1 == "border",
			if(layer[thumbnailBorderSource_thumbnailsBar].url,
				set(borderLoaded_thumbnailsBar, true);
			);
		);
		if(%1 == "thumbnail",
			inc(thumbnailsLoadedCounter_thumbnailsBar);
		);
	</action>
	
	<action name="onLoadCompleteHandler_thumbnailsBar">
		
		set(thumbsCount_thumbnailsBar, 0);
		
		
		set(thumbsCount_thumbnailsBar, get(scene.count));
		
		
		
		
		
		
		
		loadThumbs_thumbnailsBar();
		
		if(firstInit_thumbnailsBar,
			onLoadCompleteHandlerPartThree_thumbnailsBar();
		,
			onLoadCompleteHandlerPartTwo_thumbnailsBar();
		);
	</action>
	
	<action name="onLoadCompleteHandlerPartTwo_thumbnailsBar">
		set(imgCounter_thumbnailsBar, 3);
		
		if(arrow1Loaded_thumbnailsBar,
			dec(imgCounter_thumbnailsBar);
		);
		if(arrow2Loaded_thumbnailsBar,
			dec(imgCounter_thumbnailsBar);
		);
		if(thumbsCount_thumbnailsBar == thumbnailsLoadedCounter_thumbnailsBar,
			dec(imgCounter_thumbnailsBar);
		);
		
		if(imgCounter_thumbnailsBar LE 0,
			stopdelayedcall(delayedCallOnLoadComplete_thumbnailsBar);
			onLoadCompleteHandlerPartThree_thumbnailsBar();
		,
			delayedcall(delayedCallOnLoadComplete_thumbnailsBar, 0.2, onLoadCompleteHandlerPartTwo_thumbnailsBar());
		);
	</action>
	
	<action name="onLoadCompleteHandlerPartThree_thumbnailsBar">
		resetMouseBehavior_thumbnailsBar();
		highlightCurrentThumb_thumbnailsBar();
		
		
		if(layer[scrollAreaContainer_thumbnailsBar].adjustToContent,
			mul(adjustWidth_thumbnailsBar, get(layer[scrollAreaContainer_thumbnailsBar].marginX), 2);
			add(adjustWidth_thumbnailsBar, get(layer[thumbsScrollArea_thumbnailsBar].width));
			mul(adjustHeight_thumbnailsBar, get(layer[scrollAreaContainer_thumbnailsBar].marginY), 2);
			add(adjustHeight_thumbnailsBar, get(layer[thumbsScrollArea_thumbnailsBar].height));
			
			
			if(adjustWidth_thumbnailsBar GT stagewidth,
				set(adjustWidth_thumbnailsBar, get(stagewidth));
				set(layer[scrollAreaContainer_thumbnailsBar].adjustToContent, false);
			,
				if(adjustHeight_thumbnailsBar GT stageheight,
					set(adjustHeight_thumbnailsBar, get(stageheight));
					set(layer[scrollAreaContainer_thumbnailsBar].adjustToContent, false);
				);
			);
			
			setSize_thumbnailsBar(get(adjustWidth_thumbnailsBar), get(adjustHeight_thumbnailsBar));
		);
		
		setupArrows_thumbnailsBar(true);
		
		
		if (thumbsCounter_thumbnailsBar LE 0,
			set(layer[thumbnailsBar_thumbnailsBar].visible, false);
		);
		
		
		set(startResize_thumbnailsBar, true);
		set(firstInit_thumbnailsBar, true);
	</action>
	
	
	<action name="onResizeHandler_thumbnailsBar">
		
		delayedcall(0.1, onResizeCallback_thumbnailsBar(false); );
	</action>
	
	
	<action name="onResizeCallback_thumbnailsBar">
		if(startResize_thumbnailsBar,
			setSize_thumbnailsBar(get(layer[scrollAreaContainer_thumbnailsBar].targetWidth), get(layer[scrollAreaContainer_thumbnailsBar].targetHeight));
			setupArrows_thumbnailsBar(%1);
			
			
			if (thumbsCounter_thumbnailsBar LE 0,
				set(layer[thumbnailsBar_thumbnailsBar].visible, false);
			);
		);
	</action>
	
	
		<action name="showWithThumbnailsButton_thumbnailsBar">
			set(layer[thumbnailsBar_thumbnailsBar].visible, true);
			onResizeCallback_thumbnailsBar(true);
		</action>
		
		<action name="hideWithThumbnailsButton_thumbnailsBar">
			set(layer[thumbnailsBar_thumbnailsBar].visible, false);
		</action>
	
	
		<action name="showWithControlsBar_thumbnailsBar">
			
				if (tour_displaythumbnails,
					set(layer[thumbnailsBar_thumbnailsBar].visible, true);
					onResizeCallback_thumbnailsBar(true);
				,
					set(layer[thumbnailsBar_thumbnailsBar].visible, false);
				);
		</action>
		
		<action name="hideWithControlsBar_thumbnailsBar">
			set(layer[thumbnailsBar_thumbnailsBar].visible, false);
		</action>
	
	
	<action name="thumbnailBorderDrawInit_thumbnailsBar">
		
		set(layer[scrollAreaContainer_thumbnailsBar].offsetX, get(layer[thumbnailBorderSource_thumbnailsBar].borderWidth));
		set(layer[scrollAreaContainer_thumbnailsBar].offsetY, get(layer[thumbnailBorderSource_thumbnailsBar].borderWidth));
		
		
		mul(totalOffsetX_thumbnailsBar, get(layer[thumbnailBorderSource_thumbnailsBar].borderWidth), 2);
		mul(totalOffsetY_thumbnailsBar, get(layer[thumbnailBorderSource_thumbnailsBar].borderWidth), 2);
		
		
		if(startResize_thumbnailsBar,
			sub(layer[scrollAreaContainer_thumbnailsBar].itemWidth, get(totalOffsetX_thumbnailsBar));
			sub(layer[scrollAreaContainer_thumbnailsBar].itemHeight, get(totalOffsetY_thumbnailsBar));
		);
		
		
		set(layer[scrollAreaContainer_thumbnailsBar].thumbWidth, get(layer[scrollAreaContainer_thumbnailsBar].itemWidth));
		set(layer[scrollAreaContainer_thumbnailsBar].thumbHeight, get(layer[scrollAreaContainer_thumbnailsBar].itemHeight));
		
		add(layer[scrollAreaContainer_thumbnailsBar].itemWidth, get(totalOffsetX_thumbnailsBar));
		add(layer[scrollAreaContainer_thumbnailsBar].itemHeight, get(totalOffsetY_thumbnailsBar));
	</action>
		
	
	<action name="thumbnailBorderImageInit_thumbnailsBar">
		
		set(layer[scrollAreaContainer_thumbnailsBar].offsetX, get(layer[thumbnailBorderSource_thumbnailsBar].offsetX));
		set(layer[scrollAreaContainer_thumbnailsBar].offsetY, get(layer[thumbnailBorderSource_thumbnailsBar].offsetY));
		
		
		mul(totalOffsetX_thumbnailsBar, get(layer[thumbnailBorderSource_thumbnailsBar].offsetX), 2);
		mul(totalOffsetY_thumbnailsBar, get(layer[thumbnailBorderSource_thumbnailsBar].offsetY), 2);
		
		
		if(startResize_thumbnailsBar,
			sub(layer[scrollAreaContainer_thumbnailsBar].itemWidth, get(totalOffsetX_thumbnailsBar));
			sub(layer[scrollAreaContainer_thumbnailsBar].itemHeight, get(totalOffsetY_thumbnailsBar));
		);
		
		
		set(layer[scrollAreaContainer_thumbnailsBar].thumbWidth, get(layer[scrollAreaContainer_thumbnailsBar].itemWidth));
		set(layer[scrollAreaContainer_thumbnailsBar].thumbHeight, get(layer[scrollAreaContainer_thumbnailsBar].itemHeight));
		
		add(layer[scrollAreaContainer_thumbnailsBar].itemWidth, get(totalOffsetX_thumbnailsBar));
		add(layer[scrollAreaContainer_thumbnailsBar].itemHeight, get(totalOffsetY_thumbnailsBar));
		
		
		div(layer[thumbnailBorderSource_thumbnailsBar].quarterHeight, get(layer[thumbnailBorderSource_thumbnailsBar].height), 4);
		
		
		set(cropX_thumbnailsBar, 0);
		set(cropY_thumbnailsBar, 0);
		set(cropW_thumbnailsBar, get(layer[thumbnailBorderSource_thumbnailsBar].width));
		set(cropH_thumbnailsBar, get(layer[thumbnailBorderSource_thumbnailsBar].quarterHeight));
		txtadd(layer[thumbnailBorderSource_thumbnailsBar].cropDefault, get(cropX_thumbnailsBar), '|', get(cropY_thumbnailsBar), '|', get(cropW_thumbnailsBar), '|', get(cropH_thumbnailsBar));

		
		add(cropY_thumbnailsBar, get(layer[thumbnailBorderSource_thumbnailsBar].quarterHeight));
		txtadd(layer[thumbnailBorderSource_thumbnailsBar].cropHover, get(cropX_thumbnailsBar), '|', get(cropY_thumbnailsBar), '|', get(cropW_thumbnailsBar), '|', get(cropH_thumbnailsBar));
		
		
		add(cropY_thumbnailsBar, get(layer[thumbnailBorderSource_thumbnailsBar].quarterHeight));
		txtadd(layer[thumbnailBorderSource_thumbnailsBar].cropSelected, get(cropX_thumbnailsBar), '|', get(cropY_thumbnailsBar), '|', get(cropW_thumbnailsBar), '|', get(cropH_thumbnailsBar));
		
		
		add(cropY_thumbnailsBar, get(layer[thumbnailBorderSource_thumbnailsBar].quarterHeight));
		txtadd(layer[thumbnailBorderSource_thumbnailsBar].cropVisited, get(cropX_thumbnailsBar), '|', get(cropY_thumbnailsBar), '|', get(cropW_thumbnailsBar), '|', get(cropH_thumbnailsBar));
		
		
		set(scaleX_thumbnailsBar, get(layer[thumbnailBorderSource_thumbnailsBar].offsetX));
		set(scaleY_thumbnailsBar, get(layer[thumbnailBorderSource_thumbnailsBar].offsetY));
		sub(scaleW_thumbnailsBar, get(layer[thumbnailBorderSource_thumbnailsBar].width), get(totalOffsetX_thumbnailsBar));
		sub(scaleH_thumbnailsBar, get(layer[thumbnailBorderSource_thumbnailsBar].quarterHeight), get(totalOffsetY_thumbnailsBar));
		txtadd(layer[thumbnailBorderSource_thumbnailsBar].scale9grid, get(scaleX_thumbnailsBar), '|', get(scaleY_thumbnailsBar), '|', get(scaleW_thumbnailsBar), '|', get(scaleH_thumbnailsBar));
	</action>
	
	
	<action name="loadThumbs_thumbnailsBar">
		if(layer[thumbnailBorderSource_thumbnailsBar].url,
			set(imgCounter_thumbnailsBar, 1);
		,
			set(imgCounter_thumbnailsBar, 0);
		);
		
		if(layer[thumbnailBorderSource_thumbnailsBar].url,
			if(borderLoaded_thumbnailsBar,
				dec(imgCounter_thumbnailsBar);
			);
		);
		
		if(imgCounter_thumbnailsBar LE 0,
			stopdelayedcall(delayedCallOnLoadCompleteBorder_thumbnailsBar);
			loadThumbsPartTwo_thumbnailsBar();
		,
			delayedcall(delayedCallOnLoadCompleteBorder_thumbnailsBar, 0.2, loadThumbs_thumbnailsBar());
		);
	</action>
	
	<action name="loadThumbsPartTwo_thumbnailsBar">
		ifnot(layer[scrollAreaContainer_thumbnailsBar].ready,
			
			
			if(layer[thumbnailBorderSource_thumbnailsBar].url,
				thumbnailBorderImageInit_thumbnailsBar();
			,
				thumbnailBorderDrawInit_thumbnailsBar();
			);
			
			
			set(thumbsCounter_thumbnailsBar, 0);
			
			
				for( set(i_thumbnailsBar, 0), i_thumbnailsBar LT scene.count, inc(i_thumbnailsBar),
					createThumb_thumbnailsBar(get(scene[get(i_thumbnailsBar)].name), get(scene[get(i_thumbnailsBar)].thumburl), get(i_thumbnailsBar), get(scene[get(i_thumbnailsBar)].titleid));
					inc(thumbsCounter_thumbnailsBar);
				);
			
			
			
			
			
			
			set(layer[scrollAreaContainer_thumbnailsBar].currentThumbsCount, get(thumbsCounter_thumbnailsBar));
			
			
			setSize_thumbnailsBar(get(layer[get(layer[scrollAreaContainer_thumbnailsBar].parent)].width), get(layer[get(layer[scrollAreaContainer_thumbnailsBar].parent)].height));
			
			
			set(layer[scrollAreaContainer_thumbnailsBar].visible, true);
			
			
				if (tour_displaycontrols,
					showWithControlsBar_thumbnailsBar();
				,
					hideWithControlsBar_thumbnailsBar();
				);
			
			
			set(layer[scrollAreaContainer_thumbnailsBar].ready, true);
		);
	</action>
	
	
	<action name="setSize_thumbnailsBar">
		
		
		set(layer[scrollAreaContainer_thumbnailsBar].targetWidth, %1);
		set(layer[scrollAreaContainer_thumbnailsBar].targetHeight, %2);
		
		
		set(layer[get(layer[scrollAreaContainer_thumbnailsBar].parent)].width, %1);
		set(layer[get(layer[scrollAreaContainer_thumbnailsBar].parent)].height, %2);
		layer[get(layer[scrollAreaContainer_thumbnailsBar].parent)].updatepos();
		
		
		mul(totalMarginX_thumbnailsBar, get(layer[scrollAreaContainer_thumbnailsBar].marginX), 2);
		mul(totalMarginY_thumbnailsBar, get(layer[scrollAreaContainer_thumbnailsBar].marginY), 2);
		
			add(totalPluginWidth_thumbnailsBar, get(totalMarginX_thumbnailsBar), get(layer[scrollAreaContainer_thumbnailsBar].itemWidth));
			
			
			
			if(layer[get(layer[scrollAreaContainer_thumbnailsBar].parent)].pixelwidth LT totalPluginWidth_thumbnailsBar,
				set(layer[get(layer[scrollAreaContainer_thumbnailsBar].parent)].width, get(totalPluginWidth_thumbnailsBar));
			);
		
		layer[get(layer[scrollAreaContainer_thumbnailsBar].parent)].updatepos();
		
		
		sub(containerWidth_thumbnailsBar, get(layer[get(layer[scrollAreaContainer_thumbnailsBar].parent)].pixelwidth), get(totalMarginX_thumbnailsBar));
		sub(containerHeight_thumbnailsBar, get(layer[get(layer[scrollAreaContainer_thumbnailsBar].parent)].pixelheight), get(totalMarginY_thumbnailsBar));

		
		set(layer[scrollAreaContainer_thumbnailsBar].width, get(containerWidth_thumbnailsBar));
		set(layer[scrollAreaContainer_thumbnailsBar].height, get(containerHeight_thumbnailsBar));
		
		set(scrollAreaSize_thumbnailsBar, 0);
		
		
		mul(totalThumbsSpacer_thumbnailsBar, get(layer[scrollAreaContainer_thumbnailsBar].currentThumbsCount), get(layer[scrollAreaContainer_thumbnailsBar].thumbSpacer));
		sub(totalThumbsSpacer_thumbnailsBar, get(layer[scrollAreaContainer_thumbnailsBar].thumbSpacer));
		
		set(layer[get(layer[scrollAreaContainer_thumbnailsBar].parent)].visible, true);
		
		
			mul(scrollAreaSize_thumbnailsBar, get(layer[scrollAreaContainer_thumbnailsBar].itemHeight), get(layer[scrollAreaContainer_thumbnailsBar].currentThumbsCount));
			add(scrollAreaSize_thumbnailsBar, get(totalThumbsSpacer_thumbnailsBar));

			set(layer[thumbsScrollArea_thumbnailsBar].width, get(layer[scrollAreaContainer_thumbnailsBar].itemWidth));
			set(layer[thumbsScrollArea_thumbnailsBar].height, get(scrollAreaSize_thumbnailsBar));
			
			
			if(layer[scrollAreaContainer_thumbnailsBar].height LT layer[scrollAreaContainer_thumbnailsBar].itemHeight,
				set(layer[get(layer[scrollAreaContainer_thumbnailsBar].parent)].visible, false);
			,
				verifyThumbnailsBarVisibility_thumbnailsBar();
			);
			
		
		
		if(layer[get(layer[scrollAreaContainer_thumbnailsBar].parent)].width LT 0,
			set(layer[get(layer[scrollAreaContainer_thumbnailsBar].parent)].visible, false);
		);
		
	</action>
	
	
	<action name="verifyThumbnailsBarVisibility_thumbnailsBar">
		if(layer[get(layer[scrollAreaContainer_thumbnailsBar].parent)].visible,
			set(boolValue_thumbnailsBar, false);
			
			if (tour_displaythumbnails,
				if (tour_displaycontrols,
					set(boolValue_thumbnailsBar, true);
				);
			);
			
			set(layer[get(layer[scrollAreaContainer_thumbnailsBar].parent)].visible, get(boolValue_thumbnailsBar));
		);
	</action>
	
	
	<action name="createThumb_thumbnailsBar">

			add(offsetFactor_thumbnailsBar, get(layer[scrollAreaContainer_thumbnailsBar].itemHeight), get(layer[scrollAreaContainer_thumbnailsBar].thumbSpacer));
	
			mul(thumbIncPos_thumbnailsBar, %3, get(offsetFactor_thumbnailsBar));
			
			
			if(layer[thumbnailBorderSource_thumbnailsBar].url,
				add(thumbIncPos_thumbnailsBar, get(layer[scrollAreaContainer_thumbnailsBar].offsetY));
			);
			
		
		mul(negativeOffsetX_thumbnailsBar, get(layer[scrollAreaContainer_thumbnailsBar].offsetX), -1);
		mul(negativeOffsetY_thumbnailsBar, get(layer[scrollAreaContainer_thumbnailsBar].offsetY), -1);
		
		set(thumbName, 'thumb_');
		txtadd(thumbName, %1);
		txtadd(thumbName, '_thumbnailsBar');
		addlayer(get(thumbName));

		

		set(thumbBorderName, 'thumbBorder_');
		txtadd(thumbBorderName, %1);
		txtadd(thumbBorderName, '_thumbnailsBar');
		addlayer(get(thumbBorderName));
		
		
		ifnot(layer[thumbnailBorderSource_thumbnailsBar].url,
			set(layer[get(thumbBorderName)].type, container);
			set(layer[get(thumbBorderName)].parent, thumbsScrollArea_thumbnailsBar);
		);

		
		set(layer[get(thumbName)].onloaded, loadedImages_thumbnailsBar("thumbnail"););
		set(layer[get(thumbName)].url, %2);
		set(layer[get(thumbName)].keep, true);
		set(layer[get(thumbName)].width, get(layer[scrollAreaContainer_thumbnailsBar].thumbWidth));
		set(layer[get(thumbName)].height, get(layer[scrollAreaContainer_thumbnailsBar].thumbHeight));
		set(layer[get(thumbName)].align, topleft);
		
		
			set(layer[get(thumbName)].x, get(layer[scrollAreaContainer_thumbnailsBar].offsetX));
		
			if(layer[thumbnailBorderSource_thumbnailsBar].url,
				set(layer[get(thumbName)].parent, thumbsScrollArea_thumbnailsBar);
				set(layer[get(thumbName)].y, get(thumbIncPos_thumbnailsBar));
			,
				set(layer[get(thumbName)].parent, get(thumbBorderName));
				set(layer[get(thumbName)].y, get(layer[scrollAreaContainer_thumbnailsBar].offsetY));
				set(layer[get(thumbName)].onclick, resetMouseBehavior_thumbnailsBar(); mainloadscene(%1); delayedcall(0.1,highlightThumb_thumbnailsBar(%1)));
			);
			
		
		
		set(layer[get(thumbBorderName)].keep, true);
		set(layer[get(thumbBorderName)].width, get(layer[scrollAreaContainer_thumbnailsBar].itemWidth));
		set(layer[get(thumbBorderName)].height, get(layer[scrollAreaContainer_thumbnailsBar].itemHeight));
		set(layer[get(thumbBorderName)].align, topleft);
		
		if(layer[thumbnailBorderSource_thumbnailsBar].url,
			set(layer[get(thumbBorderName)].url, get(layer[thumbnailBorderSource_thumbnailsBar].url));
			set(layer[get(thumbBorderName)].scale9grid, get(layer[thumbnailBorderSource_thumbnailsBar].scale9grid));
			set(layer[get(thumbBorderName)].parent, get(thumbName));
			set(layer[get(thumbBorderName)].x, get(negativeOffsetX_thumbnailsBar));
			set(layer[get(thumbBorderName)].y, get(negativeOffsetY_thumbnailsBar));
			set(layer[get(thumbBorderName)].onclick, resetMouseBehavior_thumbnailsBar(); mainloadscene(%1); delayedcall(0.1,highlightThumb_thumbnailsBar(%1)));
		,
			
				set(layer[get(thumbBorderName)].y, get(thumbIncPos_thumbnailsBar)); 
				
		);


		
		setupMouseBehavior_thumbnailsBar(%1, %4);
		
	</action>
	
	
	
	<action name="removeThumb_thumbnailsBar">
		set(thumbName, 'thumb_');
		txtadd(thumbName, %1);
		txtadd(thumbName, '_thumbnailsBar');
		removelayer(get(thumbName));
		
		set(thumbBorderName, 'thumbBorder_');
		txtadd(thumbBorderName, %1);
		txtadd(thumbBorderName, '_thumbnailsBar');
		removelayer(get(thumbBorderName));


	</action>
	
	
	
	<action name="setupArrows_thumbnailsBar">
		
		if(layer[scrollAreaContainer_thumbnailsBar].adjustToContent,
			hideArrows_thumbnailsBar();
		,
			ifnot(device.touchdevice,
				
					if(layer[scrollAreaContainer_thumbnailsBar].height LT layer[thumbsScrollArea_thumbnailsBar].height,
				
					showArrows_thumbnailsBar();
				,
					hideArrows_thumbnailsBar();
				);
			,
				hideArrows_thumbnailsBar();
			);
		);
		
		
		if(%1,
			scrollToCurrentThumb_thumbnailsBar();
		);
		
		
			
			if(layer[scrollAreaContainer_thumbnailsBar].height LT layer[scrollAreaContainer_thumbnailsBar].itemHeight,
				set(layer[get(layer[scrollAreaContainer_thumbnailsBar].parent)].visible, false);
			);
	</action>
	
	
	<action name="showArrows_thumbnailsBar">
		
		
		
		
		set(layer[scrollPrevArrow_thumbnailsBar].visible, true);
		set(layer[scrollNextArrow_thumbnailsBar].visible, true);
		
		
		
			
			add(totalArrowSize_thumbnailsBar, get(layer[scrollPrevArrow_thumbnailsBar].height), get(layer[scrollNextArrow_thumbnailsBar].height));
		
			
			sub(scrollAreaContainerSize_thumbnailsBar, get(layer[get(layer[scrollAreaContainer_thumbnailsBar].parent)].pixelheight), get(totalArrowSize_thumbnailsBar));
		
			set(layer[scrollAreaContainer_thumbnailsBar].height, get(scrollAreaContainerSize_thumbnailsBar));
		
			set(layer[scrollAreaContainer_thumbnailsBar].y, get(layer[scrollPrevArrow_thumbnailsBar].height));
			
		
		
		set(layer[scrollPrevArrow_thumbnailsBar].onhover, scrollPrev_thumbnailsBar(););
		set(layer[scrollNextArrow_thumbnailsBar].onhover, scrollNext_thumbnailsBar(););
		
		set(layer[scrollPrevArrow_thumbnailsBar].onclick, scrollPrev_thumbnailsBar(get(layer[scrollAreaContainer_thumbnailsBar].scrollSpeedAcceleration)););
		set(layer[scrollNextArrow_thumbnailsBar].onclick, scrollNext_thumbnailsBar(get(layer[scrollAreaContainer_thumbnailsBar].scrollSpeedAcceleration)););
		
		
				set(layer[scrollPrevArrow_thumbnailsBar].onhover, scrollNext_thumbnailsBar(););
				set(layer[scrollNextArrow_thumbnailsBar].onhover, scrollPrev_thumbnailsBar(););
				
				set(layer[scrollPrevArrow_thumbnailsBar].onclick, scrollNext_thumbnailsBar(get(layer[scrollAreaContainer_thumbnailsBar].scrollSpeedAcceleration)););
				set(layer[scrollNextArrow_thumbnailsBar].onclick, scrollPrev_thumbnailsBar(get(layer[scrollAreaContainer_thumbnailsBar].scrollSpeedAcceleration)););
		
		
		
		set(layer[scrollPrevArrow_thumbnailsBar].onout, set(layer[scrollAreaContainer_thumbnailsBar].scrollSpeed, get(layer[scrollAreaContainer_thumbnailsBar].scrollSpeedInit)););
		set(layer[scrollNextArrow_thumbnailsBar].onout, set(layer[scrollAreaContainer_thumbnailsBar].scrollSpeed, get(layer[scrollAreaContainer_thumbnailsBar].scrollSpeedInit)););
		
	</action>
	
	
	
	
	<action name="hideArrows_thumbnailsBar">
		
		set(layer[scrollPrevArrow_thumbnailsBar].visible, false);
		set(layer[scrollNextArrow_thumbnailsBar].visible, false);
		
		
		
			mul(totalMargin_thumbnailsBar, get(layer[scrollAreaContainer_thumbnailsBar].marginY), 2);
			
			sub(scrollAreaContainerSize_thumbnailsBar, get(layer[get(layer[scrollAreaContainer_thumbnailsBar].parent)].pixelheight), get(totalMargin_thumbnailsBar));
			
			set(layer[scrollAreaContainer_thumbnailsBar].height, get(scrollAreaContainerSize_thumbnailsBar));
			set(layer[scrollAreaContainer_thumbnailsBar].y, get(layer[scrollAreaContainer_thumbnailsBar].marginY));
			 
			
	</action>
	
	
	<action name="scrollPrev_thumbnailsBar">
		
		
		if(%1,
			inc(layer[scrollAreaContainer_thumbnailsBar].scrollSpeed, %1);
		);
		
		layer[thumbsScrollArea_thumbnailsBar].stopscrolling();
		
		set(scrollLimit_thumbnailsBar, 0);
		
		
			
			
			add(layer[thumbsScrollArea_thumbnailsBar].y, get(layer[scrollAreaContainer_thumbnailsBar].scrollSpeed));
			if(layer[thumbsScrollArea_thumbnailsBar].y GE scrollLimit_thumbnailsBar,
				set(layer[thumbsScrollArea_thumbnailsBar].y, get(scrollLimit_thumbnailsBar));
			);
			
		
		if(layer[scrollAreaContainer_thumbnailsBar].scrollSpeed LT layer[scrollAreaContainer_thumbnailsBar].scrollSpeedMax,
			inc(layer[scrollAreaContainer_thumbnailsBar].scrollSpeed);
		);
		
	</action>
	
	
	<action name="scrollNext_thumbnailsBar">
		
		
		if(%1,
			inc(layer[scrollAreaContainer_thumbnailsBar].scrollSpeed, %1);
		);
		
		layer[thumbsScrollArea_thumbnailsBar].stopscrolling();
		
			
			sub(scrollLimit_thumbnailsBar, get(layer[thumbsScrollArea_thumbnailsBar].height), get(layer[scrollAreaContainer_thumbnailsBar].height));
			
			mul(scrollLimit_thumbnailsBar, -1);
			
			sub(layer[thumbsScrollArea_thumbnailsBar].y, get(layer[scrollAreaContainer_thumbnailsBar].scrollSpeed));
			if(layer[thumbsScrollArea_thumbnailsBar].y LE scrollLimit_thumbnailsBar,
				set(layer[thumbsScrollArea_thumbnailsBar].y, get(scrollLimit_thumbnailsBar));
			);
		
		if(layer[scrollAreaContainer_thumbnailsBar].scrollSpeed LT layer[scrollAreaContainer_thumbnailsBar].scrollSpeedMax,
			inc(layer[scrollAreaContainer_thumbnailsBar].scrollSpeed);
		);
		
	</action>
	
	
	<action name="resetMouseBehavior_thumbnailsBar">
	
		
		
			for( set(j_thumbnailsBar, 0), j_thumbnailsBar LT scene.count, inc(j_thumbnailsBar),
				set(thumbBorderName, 'thumbBorder_');
				txtadd(thumbBorderName, get(scene[get(j_thumbnailsBar)].name));
				txtadd(thumbBorderName, '_thumbnailsBar');
				
				setupMouseBehavior_thumbnailsBar(get(scene[get(j_thumbnailsBar)].name), get(scene[get(j_thumbnailsBar)].titleid));
			);
		
	</action>
	
	
	<action name="setupMouseBehavior_thumbnailsBar">

		set(thumbName, 'thumb_');
		txtadd(thumbName, %1);
		txtadd(thumbName, '_thumbnailsBar');
		
		set(thumbBorderName, 'thumbBorder_');
		txtadd(thumbBorderName, %1);
		txtadd(thumbBorderName, '_thumbnailsBar');
		
		if(layer[thumbnailBorderSource_thumbnailsBar].url,
			set(layer[get(thumbBorderName)].crop, get(layer[thumbnailBorderSource_thumbnailsBar].cropDefault));
			set(layer[get(thumbBorderName)].onovercrop, get(layer[thumbnailBorderSource_thumbnailsBar].cropHover));
			set(layer[get(thumbBorderName)].ondowncrop, get(layer[thumbnailBorderSource_thumbnailsBar].cropHover));
			set(layer[get(thumbBorderName)].tooltip, %2);
				set(layer[get(thumbBorderName)].onhover, showTooltip('plugin', tooltipStyle_thumbnailsBar));
				set(layer[get(thumbBorderName)].onout, hideTooltip());
		,
			set(layer[get(thumbBorderName)].bgcolor, get(layer[thumbnailBorderSource_thumbnailsBar].borderColorDefault));
			set(layer[get(thumbBorderName)].bgalpha, get(layer[thumbnailBorderSource_thumbnailsBar].borderAlphaDefault));
				set(layer[get(thumbName)].tooltip, %2);
				set(layer[get(thumbName)].onhover, showTooltip('plugin', tooltipStyle_thumbnailsBar));
			
			set(layer[get(thumbName)].onover, 
				set(layer[get(parent)].bgcolor, get(layer[thumbnailBorderSource_thumbnailsBar].borderColorHover));
				set(layer[get(parent)].bgalpha, get(layer[thumbnailBorderSource_thumbnailsBar].borderAlphaHover));
			);
			
			set(layer[get(thumbName)].onout, 
				set(layer[get(parent)].bgcolor, get(layer[thumbnailBorderSource_thumbnailsBar].borderColorDefault));
				set(layer[get(parent)].bgalpha, get(layer[thumbnailBorderSource_thumbnailsBar].borderAlphaDefault));
				hideTooltip();
			);
		);
	
	</action>
	
	
	<action name="highlightCurrentThumb_thumbnailsBar">
			delayedcall(0.1,highlightThumb_thumbnailsBar(get(xml.scene)));
	</action>
	
	
	<action name="highlightThumb_thumbnailsBar">
	
		set(thumbBorderName, 'thumbBorder_');
		txtadd(thumbBorderName, %1);
		txtadd(thumbBorderName, '_thumbnailsBar');
		
		if(layer[thumbnailBorderSource_thumbnailsBar].url,
			set(layer[get(thumbBorderName)].crop, get(layer[thumbnailBorderSource_thumbnailsBar].cropSelected));
			set(layer[get(thumbBorderName)].onovercrop, get(layer[thumbnailBorderSource_thumbnailsBar].cropSelected));
			set(layer[get(thumbBorderName)].ondowncrop, get(layer[thumbnailBorderSource_thumbnailsBar].cropSelected));
		,
			set(thumbName, 'thumb_');
			txtadd(thumbName, %1);
			txtadd(thumbName, '_thumbnailsBar');
			
			set(layer[get(thumbBorderName)].bgcolor, get(layer[thumbnailBorderSource_thumbnailsBar].borderColorSelected));
			set(layer[get(thumbBorderName)].bgalpha, get(layer[thumbnailBorderSource_thumbnailsBar].borderAlphaSelected));
			
			set(layer[get(thumbName)].onover, "");
			set(layer[get(thumbName)].onout, hideTooltip(););
		);

		scrollToThumb_thumbnailsBar(%1);
	</action>
	
	
	<action name="scrollToCurrentThumb_thumbnailsBar">
			scrollToThumb_thumbnailsBar(get(xml.scene));
	</action>
	
	
	<action name="scrollToThumb_thumbnailsBar">
		
		set(thumbName, 'thumb_');
		set(thumbBorderName, 'thumbBorder_');
		
		txtadd(thumbName, %1);
		txtadd(thumbName, '_thumbnailsBar');
		txtadd(thumbBorderName, %1);
		txtadd(thumbBorderName, '_thumbnailsBar');

			set(posY_thumbnailsBar, 0);
			if(layer[thumbnailBorderSource_thumbnailsBar].url,
				div(halfThumbHeight_thumbnailsBar, get(layer[get(thumbName)].height), 2);
				ifnot(layer[scrollAreaContainer_thumbnailsBar].adjustToContent,
					add(posY_thumbnailsBar, get(layer[get(thumbName)].y), get(halfThumbHeight_thumbnailsBar));
				);
				if(layer[thumbsScrollArea_thumbnailsBar].scrolltocenter,
					layer[thumbsScrollArea_thumbnailsBar].scrolltocenter(0, get(posY_thumbnailsBar));
				);
			,
				div(halfThumbHeight_thumbnailsBar, get(layer[get(thumbBorderName)].height), 2);
				ifnot(layer[scrollAreaContainer_thumbnailsBar].adjustToContent,
					add(posY_thumbnailsBar, get(layer[get(thumbBorderName)].y), get(halfThumbHeight_thumbnailsBar));
				);
				if(layer[thumbsScrollArea_thumbnailsBar].scrolltocenter,
					layer[thumbsScrollArea_thumbnailsBar].scrolltocenter(0, get(posY_thumbnailsBar));
				);
			);
		
		
	</action>
	





<!-- ********** -->
<!-- Classic Control Bar -->
<!-- id : controlBar_classic -->
<!-- ********** -->

  <krpano controlBar_classicbarbuilt="false" controlBar_classicbackgroundwidthwhenclosed="0" controlBar_classicbackgroundwidthwhenopened="0" controlBar_classicIsOpened="false" />
  <events name="controlBar_classicevents" 
    onxmlcomplete="controlBar_classicbuildMenuBar();" 


    keep="true" />



  <action name="controlBar_classicbuildMenuBar">
    ifnot (controlBar_classicbarbuilt, controlBar_classicbuildMenu(); set(controlBar_classicbarbuilt, true););
  </action>

  <action name="controlBar_classicbuildMenu">
    
    set(controlBar_classicbutton_pos, 20);

    set(layer[controlBar_classicbtn_hidecontrols].x, get(controlBar_classicbutton_pos));
    set(layer[controlBar_classicbtn_showcontrols].x, get(controlBar_classicbutton_pos));
    inc(controlBar_classicbutton_pos, 36);
    add(controlBar_classicbackgroundwidthwhenclosed, get(controlBar_classicbutton_pos), 20);



    if (device.desktop,
      set(layer[controlBar_classicbtn_display_help].x, get(controlBar_classicbutton_pos));
      set(layer[controlBar_classicbtn_close_help  ].x, get(controlBar_classicbutton_pos));
      inc(controlBar_classicbutton_pos, 36);
    );

    if (device.fullscreensupport,
      set(layer[controlBar_classicbtn_openfs ].x, get(controlBar_classicbutton_pos));
      set(layer[controlBar_classicbtn_closefs].x, get(controlBar_classicbutton_pos));
      inc(controlBar_classicbutton_pos, 36);
    );


    set(layer[controlBar_classicbtn_display_map].x, get(controlBar_classicbutton_pos));
    set(layer[controlBar_classicbtn_hide_map   ].x, get(controlBar_classicbutton_pos));
    inc(controlBar_classicbutton_pos, 36);


    set(layer[controlBar_classicbtn_autorotate_on ].x, get(controlBar_classicbutton_pos));
    set(layer[controlBar_classicbtn_autorotate_off].x, get(controlBar_classicbutton_pos));
    inc(controlBar_classicbutton_pos, 36);



    set(layer[controlBar_classicbtn_show_thumbnails].x, get(controlBar_classicbutton_pos));
    set(layer[controlBar_classicbtn_hide_thumbnails].x, get(controlBar_classicbutton_pos));
    inc(controlBar_classicbutton_pos, 36);

    if (device.desktop,
      set(layer[controlBar_classicbtn_ctrlmode_drag_to].x, get(controlBar_classicbutton_pos));
      set(layer[controlBar_classicbtn_ctrlmode_move_to].x, get(controlBar_classicbutton_pos));
      inc(controlBar_classicbutton_pos, 36);
    );


    if(plugin[ptpvrmode] AND device.html5,
      set(layer[controlBar_classicbtn_enter_vr].x, get(controlBar_classicbutton_pos));
      set(layer[controlBar_classicbtn_enter_vr_not].x, get(controlBar_classicbutton_pos));
      inc(controlBar_classicbutton_pos, 36);
    );

    set(layer[controlBar_classicbtn_show_hotspots].x, get(controlBar_classicbutton_pos));
    set(layer[controlBar_classicbtn_hide_hotspots].x, get(controlBar_classicbutton_pos));
    inc(controlBar_classicbutton_pos, 36);


    if(plugin[gyroscope],
      set(controlBar_classicDisplayGyroscopeButton, false);
      if (device.tablet, set(controlBar_classicDisplayGyroscopeButton, true););
      if (device.mobile, set(controlBar_classicDisplayGyroscopeButton, true););
      if(controlBar_classicDisplayGyroscopeButton,
        set(layer[controlBar_classicbtn_gyroscope_on ].x, get(controlBar_classicbutton_pos));
        set(layer[controlBar_classicbtn_gyroscope_off].x, get(controlBar_classicbutton_pos));
        set(layer[controlBar_classicbtn_gyroscope_not].x, get(controlBar_classicbutton_pos));
        inc(controlBar_classicbutton_pos, 36);
      );
    );


    if (device.desktop,
        set(layer[controlBar_classicbtn_right].x, get(controlBar_classicbutton_pos));
        inc(controlBar_classicbutton_pos, 36);
        set(layer[controlBar_classicbtn_left].x, get(controlBar_classicbutton_pos));
        inc(controlBar_classicbutton_pos, 36);
    );
    if (device.desktop,
        set(layer[controlBar_classicbtn_down].x, get(controlBar_classicbutton_pos));
        inc(controlBar_classicbutton_pos, 36);
        set(layer[controlBar_classicbtn_up].x, get(controlBar_classicbutton_pos));
        inc(controlBar_classicbutton_pos, 36);
    );
    if (device.desktop,
        set(layer[controlBar_classicbtn_out].x, get(controlBar_classicbutton_pos));
        inc(controlBar_classicbutton_pos, 36);
        set(layer[controlBar_classicbtn_in].x, get(controlBar_classicbutton_pos));
        inc(controlBar_classicbutton_pos, 36);
    );


    inc(controlBar_classicbutton_pos, 20);

    set(controlBar_classicbackgroundwidthwhenopened, get(controlBar_classicbutton_pos));



    
    add(controlBar_classicVerifyVisibility, 20, 20);
    if(controlBar_classicbackgroundwidthwhenopened == controlBar_classicVerifyVisibility,
      set(controlBar_classicbackgroundwidthwhenopened, 0);


    );

	
	
  </action>

	<events name="controlBar_classicStartTourEvents" onTourStart="controlBar_classicCallOnStartTour();" keep="true" />

	<action name="controlBar_classicCallOnStartTour">
		
		set(layer[controlBar_classicmenu_controlbar_bg_img].width, get(controlBar_classicbutton_pos));
		set(layer[controlBar_classicmenu_controlbar_bg].width, get(controlBar_classicbutton_pos));
		showTourControls();

	</action>



  <style name="controlBar_classic_btn_style"
         keep="true"
         alpha="0.8"
         edge="right" align="right"
         width="36" height="36"
         zorder="6"
         onover="controlBar_classicctrlbaronoveraction();"
         onout="controlBar_classicctrlbaronoutaction();"
         onhover="showTooltip('plugin', controlBar_classicmenuTooltipStyle, bottom);"
         />
  <action name="controlBar_classicctrlbaronoveraction">
    tween(alpha,1,0.1,easeoutquad);
    tween(y,-2,0.1,easeoutquad);
  </action>  
  <action name="controlBar_classicctrlbaronoutaction">
    tween(alpha,0.8);
    tween(y,0,0.1,easeoutquad);
    hideTooltip();
  </action>

  <layer name="controlBar_classicmenu_controlbar_bg_img"
         keep="true"
         align="bottom"
         x="0" y="10"
         url="%FIRSTXML%/graphics/classiccontrolbar/footer.png"
         zorder="4"
         width="40"
         height="40"
         scale9grid="10|10|80|80"
         visible="false"
         />
  <layer name="controlBar_classicmenu_controlbar_bg"
         keep="true"
         align="bottom"
         x="0" y="10"
         type="container"
         zorder="5"
         width="40"
         height="40"
         visible="false"
         alpha="1.0"
         >

    <layer name="controlBar_classicbtn_hide_hotspots"
            url="%FIRSTXML%/graphics/classiccontrolbar/btn_hide_show_hotspots.png"
            style="controlBar_classic_btn_style"
            onclick="hideHotspots();
"
            tooltip="controlBar_classichideSpotsTip"
            visible="false"
            />
    <layer name="controlBar_classicbtn_show_hotspots"
            url="%FIRSTXML%/graphics/classiccontrolbar/btn_hide_show_hotspots.png"
            style="controlBar_classic_btn_style"
            onclick="showHotspots();
"
            tooltip="controlBar_classicshowSpotsTip"
            visible="false"
            />


    <layer name="controlBar_classicbtn_gyroscope_off"
            url="%FIRSTXML%/graphics/classiccontrolbar/btn_gyroscope.png"
            style="controlBar_classic_btn_style"
            onclick="disableGyroscope();
"
            devices="html5"
            tooltip="controlBar_classicgyroOffTip"
            visible="false"
            />
    <layer name="controlBar_classicbtn_gyroscope_on"
            url="%FIRSTXML%/graphics/classiccontrolbar/btn_gyroscope.png"
            style="controlBar_classic_btn_style"
            onclick="enableGyroscope();
"
            devices="html5"
            tooltip="controlBar_classicgyroOnTip"
            visible="false"
            />
    <layer name="controlBar_classicbtn_gyroscope_not"
            url="%FIRSTXML%/graphics/classiccontrolbar/btn_gyroscope_off.png"
            style="controlBar_classic_btn_style"
            enabled="true"
            capture="false"
            devices="html5"
            tooltip="controlBar_classicgyroNotTip"
            visible="false"
            />


    <layer name="controlBar_classicbtn_ctrlmode_move_to"
            url="%FIRSTXML%/graphics/classiccontrolbar/btn_move_to.png"
            style="controlBar_classic_btn_style"
            tooltip="controlBar_classicctrlmodeMoveTip"
            onclick="setControlModeMoveTo();
"
            visible="false"
            devices="desktop"
            />
    <layer name="controlBar_classicbtn_ctrlmode_drag_to"
            url="%FIRSTXML%/graphics/classiccontrolbar/btn_drag_to.png"
            style="controlBar_classic_btn_style"
            tooltip="controlBar_classicctrlmodeDragTip"
            onclick="setControlModeDragTo();
"
            visible="false"
            devices="desktop"
            />

    <layer name="controlBar_classicbtn_in"
            url="%FIRSTXML%/graphics/classiccontrolbar/btn_zoom_in.png"
            ondown="viewControlZoomIn(false);"
            onup="viewControlZoomStop();
"
            style="controlBar_classic_btn_style"
            tooltip="controlBar_classiczoomInTip"
            devices="desktop"
            visible="false"
            />
    <layer name="controlBar_classicbtn_out"
            url="%FIRSTXML%/graphics/classiccontrolbar/btn_zoom_out.png"
            ondown="viewControlZoomOut(false);
"
            onup="viewControlZoomStop();
"
            style="controlBar_classic_btn_style"
            tooltip="controlBar_classiczoomOutTip"
            devices="desktop"
            visible="false"
            />

    <layer name="controlBar_classicbtn_left"
            url="%FIRSTXML%/graphics/classiccontrolbar/btn_move_left.png"
            ondown="viewControlMoveLeft(false);
"
            onup="viewControlMoveHoriStop();
"
            style="controlBar_classic_btn_style"
            tooltip="controlBar_classicmoveLeftTip"
            devices="desktop"
            visible="false"
            />
    <layer name="controlBar_classicbtn_right"
            url="%FIRSTXML%/graphics/classiccontrolbar/btn_move_right.png"
            ondown="viewControlMoveRight(false);
"
            onup="viewControlMoveHoriStop();
"
            style="controlBar_classic_btn_style"
            tooltip="controlBar_classicmoveRightTip"
            devices="desktop"
            visible="false"
            />

    <layer name="controlBar_classicbtn_up"
            url="%FIRSTXML%/graphics/classiccontrolbar/btn_move_up.png"
            ondown="viewControlMoveUp(false);
"
            onup="viewControlMoveVertStop();
"
            style="controlBar_classic_btn_style"
            tooltip="controlBar_classicmoveUpTip"
            devices="desktop"
            visible="false"
            />
    <layer name="controlBar_classicbtn_down"
            url="%FIRSTXML%/graphics/classiccontrolbar/btn_move_down.png"
            ondown="viewControlMoveDown(false);
"
            onup="viewControlMoveVertStop();
"
            style="controlBar_classic_btn_style"
            tooltip="controlBar_classicmoveDownTip"
            devices="desktop"
            visible="false"
            />



  <layer name="controlBar_classicbtn_hide_thumbnails"
         url="%FIRSTXML%/graphics/classiccontrolbar/btn_hide_thumbnails.png"
         style="controlBar_classic_btn_style"
         onclick="hideTourThumbnails();
"
         tooltip="controlBar_classichideThumbnailsTip"
         visible="false"
         />
  <layer name="controlBar_classicbtn_show_thumbnails"
         url="%FIRSTXML%/graphics/classiccontrolbar/btn_show_thumbnails.png"
         style="controlBar_classic_btn_style"
         onclick="showTourThumbnails();
"
         tooltip="controlBar_classicshowThumbnailsTip"
         visible="false"
         />


    <layer name="controlBar_classicbtn_display_map"
            url="%FIRSTXML%/graphics/classiccontrolbar/btn_map.png"
            onclick="controlBar_classicdisplayMap();"
            style="controlBar_classic_btn_style"
            visible="false"
            tooltip="controlBar_classicdisplayMapTip"
            />
    <layer name="controlBar_classicbtn_hide_map"
            url="%FIRSTXML%/graphics/classiccontrolbar/btn_map.png"
            onclick="controlBar_classichideMap();"
            style="controlBar_classic_btn_style"
            visible="false"
            tooltip="controlBar_classichideMapTip"
            />


    <layer name="controlBar_classicbtn_openfs"
            url="%FIRSTXML%/graphics/classiccontrolbar/btn_enter_fs.png"
            onclick="enterFullscreen();
"
            style="controlBar_classic_btn_style"
            devices="fullscreensupport"
            visible="false"
            tooltip="controlBar_classicopenFsTip"
            />
    <layer name="controlBar_classicbtn_closefs"
            url="%FIRSTXML%/graphics/classiccontrolbar/btn_close_fs.png"
            onclick="exitFullscreen();
"
            style="controlBar_classic_btn_style"
            visible="false"
            devices="fullscreensupport"
            tooltip="controlBar_classiccloseFsTip"
            />

    <layer name="controlBar_classicbtn_autorotate_on"
            url="%FIRSTXML%/graphics/classiccontrolbar/btn_start_autorotation.png"
            onclick="resumeautorotation();
"
            style="controlBar_classic_btn_style"
            visible="false"
            tooltip="controlBar_classicautorotateOnTip"
            />
    <layer name="controlBar_classicbtn_autorotate_off"
            url="%FIRSTXML%/graphics/classiccontrolbar/btn_stop_autorotation.png"
            onclick="pauseautorotation();
"
            style="controlBar_classic_btn_style"
            visible="false"
            tooltip="controlBar_classicautorotateOffTip"
            />


    <layer name="controlBar_classicbtn_enter_vr"
           url="%FIRSTXML%/graphics/classiccontrolbar/btn_vr_mode.png"
           onclick="if(scene[get(xml.scene)].full360 AND disableCurrentSceneVrConservation !== true,
    js(accessWebVr(get(xml.scene),get(videoscenestarttime)));
,
    js(accessWebVr(null));
);"
           style="controlBar_classic_btn_style"
           visible="false"
           devices="html5"
           tooltip="controlBar_classicenterVRTip"
           />
    <layer name="controlBar_classicbtn_enter_vr_not"
           url="%FIRSTXML%/graphics/classiccontrolbar/btn_vr_mode_off.png"
           style="controlBar_classic_btn_style"
           enabled="true"
           capture="false"
           visible="false"
           devices="html5"
           tooltip="controlBar_classicenterVRNotTip"
           />

    <layer name="controlBar_classicbtn_display_help"
            url="%FIRSTXML%/graphics/classiccontrolbar/btn_help.png"
            onclick="controlBar_classicdisplayHelp();"
            style="controlBar_classic_btn_style"
            devices="desktop"
            visible="false"
            tooltip="controlBar_classicdisplayHelpTip"
            />
    <layer name="controlBar_classicbtn_close_help"
            url="%FIRSTXML%/graphics/classiccontrolbar/btn_help.png"
            onclick="controlBar_classiccloseHelp();"
            style="controlBar_classic_btn_style"
            visible="false"
            devices="desktop"
            tooltip="controlBar_classichideHelpTip"
            />



    <layer name="controlBar_classicbtn_hidecontrols"
            url="%FIRSTXML%/graphics/classiccontrolbar/btn_hide_controls.png"
            style="controlBar_classic_btn_style"
            onclick="hideTourControls();
"
            visible="false"
            tooltip="controlBar_classichideControlsTip"
            />
    <layer name="controlBar_classicbtn_showcontrols"
            url="%FIRSTXML%/graphics/classiccontrolbar/btn_show_controls.png"
            style="controlBar_classic_btn_style"
            onclick="showTourControls();
"
            tooltip="controlBar_classicdisplayControlsTip"
            visible="false"
            />
  </layer>


<events name="controlBar_classicvravailableevent"
		onvravailable="controlBar_classicupdateVrButtonsAvailability();"
		onvrunavailable="controlBar_classicupdateVrButtonsAvailability();"
		keep="true" devices="html5" />
	<krpano controlBar_classicmenuvravailable="false" />
	<action name="controlBar_classicupdateVrButtonsAvailability">
		if (tour_vrdevices,
			set(controlBar_classicmenuvravailable, true);
		,
			set(controlBar_classicmenuvravailable, false);
		);
		controlBar_classicupdateVrButtons();
	</action>
	<action name="controlBar_classicHideVrButtons">
		set(layer[controlBar_classicbtn_enter_vr].visible, false);
		if('%1' == 'true' AND plugin[ptpvrmode],
			set(layer[controlBar_classicbtn_enter_vr_not].visible, true);
		,
			set(layer[controlBar_classicbtn_enter_vr_not].visible, false);
		);
	</action>
	<action name="controlBar_classicShowVrButtons">
		if (controlBar_classicmenuvravailable,
			set(layer[controlBar_classicbtn_enter_vr].visible, true);
			set(layer[controlBar_classicbtn_enter_vr_not].visible, false);
		,
			controlBar_classicHideVrButtons(true);
		);
	</action>
	<action name="controlBar_classicupdateVrButtons">
	if (tour_vrdevices,
		if (tour_displaycontrols,
			controlBar_classicShowVrButtons();
		,
			controlBar_classicHideVrButtons();
		);
	,
		if (tour_displaycontrols,
			controlBar_classicHideVrButtons(true);
		,
			controlBar_classicHideVrButtons();
		);
	);
	</action>

	<events name="controlBar_classicgyroscopeavailableevent"
		ongyroscopeavailable="controlBar_classicupdateGyroscopeButtonsAvailability();"
		ongyroscopeunavailable="controlBar_classicupdateGyroscopeButtonsAvailability();"
		ongyroscopeon="controlBar_classicenableGyroscopeButtons(true);"
		ongyroscopeoff="controlBar_classicenableGyroscopeButtons(false);"
		keep="true" devices="html5" />
	<krpano controlBar_classicmenugyroscopeavailable="false" controlBar_classicmenugyroscopeenabled="false" />
	<action name="controlBar_classicupdateGyroscopeButtonsAvailability">
		if (tour_gyroscopedevices,
			set(controlBar_classicmenugyroscopeavailable, true);
			controlBar_classicupdateGyroscopeButtons();
		,
			set(controlBar_classicmenugyroscopeavailable, false);
			controlBar_classicupdateGyroscopeButtons();
		);
	</action>
	<action name="controlBar_classicenableGyroscopeButtons">
		if (tour_gyroscopedevices,
			set(controlBar_classicmenugyroscopeenabled, %1);
			controlBar_classicupdateGyroscopeButtons();
		);
	</action>
	<action name="controlBar_classicHideGyroscopeButtons">
		set(layer[controlBar_classicbtn_gyroscope_off].visible, false);
		set(layer[controlBar_classicbtn_gyroscope_on].visible, false);
		if('%1' == 'true' AND plugin[gyroscope],
			set(layer[controlBar_classicbtn_gyroscope_not].visible, true);
		,
			set(layer[controlBar_classicbtn_gyroscope_not].visible, false);
		);
	</action>
	<action name="controlBar_classicShowGyroscopeButtons">
		if (controlBar_classicmenugyroscopeavailable,
			if (controlBar_classicmenugyroscopeenabled,
				set(layer[controlBar_classicbtn_gyroscope_off].visible, true);
				set(layer[controlBar_classicbtn_gyroscope_on].visible, false);
			,
				set(layer[controlBar_classicbtn_gyroscope_off].visible, false);
				set(layer[controlBar_classicbtn_gyroscope_on].visible, true);
			);
			set(layer[controlBar_classicbtn_gyroscope_not].visible, false);
		,
			controlBar_classicHideGyroscopeButtons(true);
		);
	</action>
	<action name="controlBar_classicupdateGyroscopeButtons">
	if (tour_gyroscopedevices,
		if (tour_displaycontrols,
			controlBar_classicShowGyroscopeButtons();
		,
			controlBar_classicHideGyroscopeButtons();
		);
	,
		if (tour_displaycontrols,
			controlBar_classicHideGyroscopeButtons(true);
		,
			controlBar_classicHideGyroscopeButtons();
		);
	);
	</action>


	<events name="controlBar_classiccontrolmodechangedevent" 
		oncontrolmodechanged="controlBar_classicupdateControlModeButtons();" 
		keep="true" />
	<action name="controlBar_classicHideControlModeButtons">
		set(layer[controlBar_classicbtn_ctrlmode_move_to].visible, false);
		set(layer[controlBar_classicbtn_ctrlmode_drag_to].visible, false);
	</action>
	<action name="controlBar_classicShowControlModeButtons">
		if (tour_controlmodemousetype == "moveto",
			set(layer[controlBar_classicbtn_ctrlmode_drag_to].visible, true);
			set(layer[controlBar_classicbtn_ctrlmode_move_to].visible, false);
		,
			set(layer[controlBar_classicbtn_ctrlmode_move_to].visible, true);
			set(layer[controlBar_classicbtn_ctrlmode_drag_to].visible, false);
		);
	</action>
	<action name="controlBar_classicupdateControlModeButtons">
	if (device.desktop,
		if (tour_displaycontrols,
			controlBar_classicShowControlModeButtons();
		,
			controlBar_classicHideControlModeButtons();
		);
	,
		controlBar_classicHideControlModeButtons();
	);
	</action>

	<events name="controlBar_classichideshowthumbnailsevent" 
		hidetourthumbnails="controlBar_classicupdateHideShowThumbnailsButtons();" 
		showtourthumbnails="controlBar_classicupdateHideShowThumbnailsButtons();" 
		keep="true" />
	<action name="controlBar_classicHideHideShowThumbnailsButtons">
		set(layer[controlBar_classicbtn_show_thumbnails].visible, false);
		set(layer[controlBar_classicbtn_hide_thumbnails].visible, false);
	</action>
	<action name="controlBar_classicShowHideShowThumbnailsButtons">
		if (tour_displaythumbnails,
			set(layer[controlBar_classicbtn_hide_thumbnails].visible, true);
			set(layer[controlBar_classicbtn_show_thumbnails].visible, false);
		,
			set(layer[controlBar_classicbtn_show_thumbnails].visible, true);
			set(layer[controlBar_classicbtn_hide_thumbnails].visible, false);
		);
	</action>
	<action name="controlBar_classicupdateHideShowThumbnailsButtons">
		if (tour_displaycontrols,
			controlBar_classicShowHideShowThumbnailsButtons();
		,
			controlBar_classicHideHideShowThumbnailsButtons();
		);
	</action>

  <events name="controlBar_classichideshowcontrolsevent" 
    hidetourcontrols="controlBar_classichideMenuControls();" 
    showtourcontrols="controlBar_classicshowMenuControls();" 
    keep="true" />

  <action name="controlBar_classichideMenuControls">
    set(controlBar_classicIsOpened, false);
    set(layer[controlBar_classicbtn_hidecontrols].visible, false);
    set(layer[controlBar_classicbtn_showcontrols].visible, true);
    controlBar_classicupdateFullscreenButtons();

    controlBar_classicupdateVrButtons();

    controlBar_classicupdateAutorotationButtons();


    controlBar_classicupdateHideShowThumbnailsButtons();
    set(layer[controlBar_classicbtn_up].visible  , false);
    set(layer[controlBar_classicbtn_down].visible, false);
    set(layer[controlBar_classicbtn_right].visible, false);
    set(layer[controlBar_classicbtn_left].visible , false);
    set(layer[controlBar_classicbtn_in].visible , false);
    set(layer[controlBar_classicbtn_out].visible, false);

    controlBar_classicupdateMapButtons();

    controlBar_classicupdateControlModeButtons();
    controlBar_classicupdateHideShowHotspotsButtons();

    controlBar_classicupdateGyroscopeButtons();

    controlBar_classicupdateHelpButtons();


    if(controlBar_classicbackgroundwidthwhenclosed == 0,
      set(layer[controlBar_classicmenu_controlbar_bg_img].visible, false);
      set(layer[controlBar_classicmenu_controlbar_bg].visible, false);
    ,
      set(layer[controlBar_classicmenu_controlbar_bg_img].visible, true);
      set(layer[controlBar_classicmenu_controlbar_bg].visible, true);
    );
    tween(layer[controlBar_classicmenu_controlbar_bg_img].width,get(controlBar_classicbackgroundwidthwhenclosed),0.5,easeOutQuad);
    tween(layer[controlBar_classicmenu_controlbar_bg].width,get(controlBar_classicbackgroundwidthwhenclosed),0.5,easeOutQuad);
    tween(layer[controlBar_classicmenu_controlbar_bg_img].alpha,1.0,0.5,easeOutQuad);
  </action>
  <action name="controlBar_classicshowMenuControls">
    set(controlBar_classicIsOpened, true);
    set(layer[controlBar_classicbtn_hidecontrols].visible, true);
    set(layer[controlBar_classicbtn_showcontrols].visible, false);
    if(controlBar_classicbackgroundwidthwhenopened == 0,
      set(layer[controlBar_classicmenu_controlbar_bg_img].visible, false);
      set(layer[controlBar_classicmenu_controlbar_bg].visible, false);
    ,
      set(layer[controlBar_classicmenu_controlbar_bg_img].visible, true);
      set(layer[controlBar_classicmenu_controlbar_bg].visible, true);
    );
    tween(layer[controlBar_classicmenu_controlbar_bg_img].alpha,1.0,0.5,easeOutQuad);
    controlBar_classicshowMenuButtons();


      tween(layer[controlBar_classicmenu_controlbar_bg_img].width, get(controlBar_classicbackgroundwidthwhenopened),0.5,easeOutQuad);
      tween(layer[controlBar_classicmenu_controlbar_bg].width, get(controlBar_classicbackgroundwidthwhenopened),0.5,easeOutQuad);


  </action>
  <action name="controlBar_classicshowMenuButtons">
    if (device.desktop,
    set(layer[controlBar_classicbtn_up].visible  , true);
    set(layer[controlBar_classicbtn_down].visible, true);
    );
    if (device.desktop,
    set(layer[controlBar_classicbtn_right].visible, true);
    set(layer[controlBar_classicbtn_left].visible , true);
    );
    if (device.desktop,
    set(layer[controlBar_classicbtn_in].visible , true);
    set(layer[controlBar_classicbtn_out].visible, true);
    );

    controlBar_classicupdateMapButtons();

    controlBar_classicupdateControlModeButtons();
    controlBar_classicupdateHideShowHotspotsButtons();

    controlBar_classicupdateGyroscopeButtons();

    controlBar_classicupdateHelpButtons();


    controlBar_classicupdateFullscreenButtons();

    controlBar_classicupdateVrButtons();

    controlBar_classicupdateAutorotationButtons();


      controlBar_classicupdateHideShowThumbnailsButtons();
  </action>

  <layer name="controlBar_classichelpScreen" align="center" keep="true" onclick="controlBar_classiccloseHelp();" url="%FIRSTXML%/graphics/classiccontrolbar/help_screen_bg.png" visible="false" zorder="97" height="10%" width="prop" />

  <layer name="controlBar_classichelpScreenFg" align="center" keep="true" onclick="controlBar_classiccloseHelp();" displayed="false" 
         url="%FIRSTXML%/graphics/classiccontrolbar/help_screen_fg.png" 
         alpha="0.8" 
         height="50%" 
         width="prop" 
         zorder="98"
         visible="false" />
  <action name="controlBar_classicdisplayHelp">
    set(layer[controlBar_classichelpScreenFg].displayed,true);
    set(layer[controlBar_classichelpScreen].visible,true);
    tween(layer[controlBar_classichelpScreen].height, 50%, 1, easeOutQuad,
      set(layer[controlBar_classichelpScreenFg].visible,true);
    );
    controlBar_classicupdateHelpButtons();
  </action>
  <action name="controlBar_classiccloseHelp">
    set(layer[controlBar_classichelpScreenFg].displayed,false);
    set(layer[controlBar_classichelpScreenFg].visible,false);
    tween(layer[controlBar_classichelpScreen].height, 10%, 1, easeOutQuad,
      set(layer[controlBar_classichelpScreen].visible,false);
    );
    controlBar_classicupdateHelpButtons();
  </action>
	<action name="controlBar_classicHideHelpButtons">
		set(layer[controlBar_classicbtn_display_help].visible, false);
		set(layer[controlBar_classicbtn_close_help].visible, false);
	</action>
	<action name="controlBar_classicShowHelpButtons">
		if (layer[controlBar_classichelpScreenFg].displayed,
			set(layer[controlBar_classicbtn_close_help].visible, true);
			set(layer[controlBar_classicbtn_display_help].visible, false);
		,
			set(layer[controlBar_classicbtn_display_help].visible, true);
			set(layer[controlBar_classicbtn_close_help].visible, false);
		);
	</action>
	<action name="controlBar_classicupdateHelpButtons">
	if (device.desktop,
		if (tour_displaycontrols,
			controlBar_classicShowHelpButtons();
		,
			controlBar_classicHideHelpButtons();
		);
	,
		controlBar_classicHideHelpButtons();
	);
	</action>


  <action name="controlBar_classicdisplayMap">showMap();

  </action>
  <action name="controlBar_classichideMap">hideMap();

  </action>

	<events name="controlBar_classicdisplaymapchangeevent"
		onshowtourmap="controlBar_classicupdateMapButtons();"
		onhidetourmap="controlBar_classicupdateMapButtons();"
		keep="true"/>
	<action name="controlBar_classicHideMapButtons">
		set(layer[controlBar_classicbtn_display_map].visible, false);
		set(layer[controlBar_classicbtn_hide_map].visible, false);
	</action>
	<action name="controlBar_classicShowMapButtons">
		if (tour_displaymap,
			set(layer[controlBar_classicbtn_hide_map].visible, true);
			set(layer[controlBar_classicbtn_display_map].visible, false);
		,
			set(layer[controlBar_classicbtn_display_map].visible, true);
			set(layer[controlBar_classicbtn_hide_map].visible, false);
		);
	</action>
	<action name="controlBar_classicupdateMapButtons">
		if (tour_displaycontrols,
			controlBar_classicShowMapButtons();
		,
			controlBar_classicHideMapButtons();
		);
	</action>


	<events name="controlBar_classicmenufullscreenchangeevent"
		onenterfullscreen="controlBar_classicupdateFullscreenButtons();"
		onexitfullscreen="controlBar_classicupdateFullscreenButtons();"
		keep="true"/>
	<action name="controlBar_classicHideFullscreenButtons">
		set(layer[controlBar_classicbtn_openfs].visible , false);
		set(layer[controlBar_classicbtn_closefs].visible, false);
	</action>
	<action name="controlBar_classicShowFullscreenButtons">
		if (device.fullscreensupport,
			if(tour_fullscreen,
				set(layer[controlBar_classicbtn_openfs].visible , false);
				set(layer[controlBar_classicbtn_closefs].visible, true);
			,
				set(layer[controlBar_classicbtn_openfs].visible ,true);
				set(layer[controlBar_classicbtn_closefs].visible,false);
			);
		,
			controlBar_classicHideFullscreenButtons();
		);
	</action>
	<action name="controlBar_classicupdateFullscreenButtons">
		if (tour_displaycontrols,
			controlBar_classicShowFullscreenButtons();
		,
			controlBar_classicHideFullscreenButtons();
		);
	</action>

	<events name="controlBar_classicAutorotationEvents"
		onstartautorotation="controlBar_classicupdateAutorotationButtons();"
		onresumeautorotation="controlBar_classicupdateAutorotationButtons();"
		onstopautorotation="controlBar_classicupdateAutorotationButtons();"
		onpauseautorotation="controlBar_classicupdateAutorotationButtons();"
		keep="true"/>
	<action name="controlBar_classicHideAutorotationButtons">
		set(layer[controlBar_classicbtn_autorotate_off].visible, false);
		set(layer[controlBar_classicbtn_autorotate_on].visible , false);
	</action>
	<action name="controlBar_classicShowAutorotationButtons">
		if(autorotate.enabled == false,
			set(layer[controlBar_classicbtn_autorotate_off].visible, false);
			set(layer[controlBar_classicbtn_autorotate_on].visible , true);
		,
			set(layer[controlBar_classicbtn_autorotate_off].visible, true);
			set(layer[controlBar_classicbtn_autorotate_on].visible , false);
		);
	</action>
	<action name="controlBar_classicupdateAutorotationButtons">
		if (tour_displaycontrols,
			controlBar_classicShowAutorotationButtons();
		,
			controlBar_classicHideAutorotationButtons();
		);
	</action>



	<events name="controlBar_classichotspotsdisplayevents"
		hotspots_visibility_changed="controlBar_classicupdateHideShowHotspotsButtons"
		keep="true"/>
	<action name="controlBar_classicHideHideShowHotspotsButtons">
		set(layer[controlBar_classicbtn_show_hotspots].visible, false);
		set(layer[controlBar_classicbtn_hide_hotspots].visible, false);
	</action>
	<action name="controlBar_classicShowHideShowHotspotsButtons">
		if (tour_displayspots,
			set(layer[controlBar_classicbtn_hide_hotspots].visible, true);
			set(layer[controlBar_classicbtn_show_hotspots].visible, false);
		,
			set(layer[controlBar_classicbtn_show_hotspots].visible, true);
			set(layer[controlBar_classicbtn_hide_hotspots].visible, false);
		);
	</action>
	<action name="controlBar_classicupdateHideShowHotspotsButtons">
		if (tour_displaycontrols,
			controlBar_classicShowHideShowHotspotsButtons();
		,
			controlBar_classicHideHideShowHotspotsButtons();
		);
	</action>


<layer name="controlBar_classicmenuTooltipStyle"
	keep="true"
	enabled="false"
	capture="false"
	type="text"
	align="center"
	bg="false"
	bgborder="0"
	txtshadow="1.0 1.0 4.0 0x000000 1"
	css="color:#e6e6e6;font-family:Helvetica;font-weight:bold;font-size:14px;text-align:left;"
	interactivecontent="false"
	zorder="0"
	visible="false"
	html=""
	padding="2"
	xoffset="0"
	yoffset="0"
	edge="bottom"
	/>



<!-- ********** -->
<!-- Description -->
<!-- id : description -->
<!-- ********** -->

<ptplugin name="description" canStart="false" newPano="false" openatstart="false" mode="spot" startMethod="" engine="kolorArea">
	<settings>
		<option name="position" value="center" type="string" />
		<option name="start_position" value="left" type="string" />
		<option name="margin_x" value="0" type="int" />
		<option name="margin_y" value="0" type="int" />
		<option name="background_color" value="f2f2f2" type="string" />
		<option name="background_alpha" value="1" type="float" />
		<option name="topleft_radius" value="0" type="int" />
		<option name="topright_radius" value="0" type="int" />
		<option name="bottomleft_radius" value="0" type="int" />
		<option name="bottomright_radius" value="0" type="int" />
		<option name="area_border_width" value="5" type="int" />
		<option name="area_border_color" value="38b3db" type="string" />
		<option name="area_border_alpha" value="1" type="float" />
		<option name="padding" value="15" type="int" />
		<option name="display_title" value="false" type="bool" />
		<option name="close_displayed" value="true" type="bool" />
		<option name="close_text" value="descriptiondisplay_close_text" type="string" />

		<option name="overlay_displayed" value="false" type="bool" />
		<option name="overlay_color" value="000000" type="string" />
		<option name="overlay_alpha" value="0.50000762951094835" type="float" />

		<option name="area_width" value="10" type="int" />
		<option name="area_height" value="10" type="int" />
		<option name="area_width_unit" value="percent" type="string" />
		<option name="area_height_unit" value="percent" type="string" />
		<option name="animation" value="false" type="bool" />
		<option name="animation_duration" value="500" type="int" />
		<option name="refresh_content" value="true" type="bool" />
		<option name="close_callback" value="invokeKrFunction('closeKolorAreaCallback_description')" type="string" />
		<option name="close_on_click" value="true" type="bool" />
		<option name="close_onclick_callback" value="invokeKrFunction('closeKolorAreaCallbackClick_description')" type="string" />
		<option name="zorder" value="7" type="int" />
		<option name="use_i18n" value="true" type="bool" />
	</settings>
</ptplugin>

<action name="kolorAreaJsReady_description">
	set(ptplugin[description].jsready, true);

</action>


<action name="openKolorArea_description">
	ifnot(ptplugin[description].isOpen,
		if(ptplugin[description].doNotDeleteMe,
		set(ptplugin[description].currentCall, false);
		set(ptplugin[description].doNotDeleteMe, false);
		set(ptplugin[description].isOpen, true);
		pauseautorotation(forceplugin);

		js(showKolorArea(description, get(ptplugin[description].descID)));
		,
			set(ptplugin[description].currentCall, true);
			set(ptplugin[description].doNotDeleteMe, true);
			events.dispatch(onremovedisplayedobject);
			delayedcall(0.3,openKolorArea_description(););
		);
	);
</action>

<action name="closeKolorArea_description">
	if(ptplugin[description].isOpen,
		if(ptplugin[description].doNotDeleteMe,
			set(ptplugin[description].doNotDeleteMe, false);
		,
		js(invokePluginFunction(description, closeKolorArea));
		);
	);
</action>

<action name="toggleKolorArea_description">
	if(ptplugin[description].isOpen,
		closeKolorArea_description();
	,
		openKolorArea_description();
	);
</action>

<action name="closeKolorAreaCallback_description">
	set(ptplugin[description].doNotDeleteMe, false);
	if(ptplugin[description].isOpen,resumeautorotation(forceplugin);

		
	);
	set(ptplugin[description].isOpen, false);
	if(tour_displayinfo,hideTourInfo();

	);
</action>

<action name="closeKolorAreaCallbackClick_description">


	if(tour_displayinfo,hideTourInfo();

	);
</action>


<action name="showKolorArea_description">
	ifnot(ptplugin[description].startMethod == "",
		delayedcall(0,get(ptplugin[description].startMethod));
	,
		if(ptplugin[description].doNotDeleteMe,
			set(ptplugin[description].currentCall, false);
			set(ptplugin[description].doNotDeleteMe, false);
		set(ptplugin[description].isOpen, true);
		pauseautorotation(forceplugin);

		js(invokePluginFunction(description, showKolorArea, %1));
		,
			set(ptplugin[description].currentCall, true);
			set(ptplugin[description].doNotDeleteMe, true);
			events.dispatch(onremovedisplayedobject);
			delayedcall(0.3,showKolorArea_description(%1););
		);
	);
</action>
	
<action name="hideKolorArea_description">
	if(ptplugin[description].doNotDeleteMe,
		set(ptplugin[description].doNotDeleteMe, false);
	,
	resumeautorotation(forceplugin);

	
	set(ptplugin[description].isOpen, false);
	js(invokePluginFunction(description, hideKolorArea, %1));
	);
</action>

<action name="openDescription_description">
	openKolorArea_description();
</action>

<action name="openSpotDescription_description">
	set(ptplugin[description].descID, %1);
	openKolorArea_description();
</action>

<action name="closeDescription_description">
	set(ptplugin[description].currentGroup, false);
	if(%1,
		set(restore_description, true);
	,
		set(restore_description, false);
	);
	closeKolorArea_description();
</action> 

<action name="showDescription_description">
	if(ptplugin[description].canStart,
		if(ptplugin[description].descID != "",
			openDescription_description();
		,
			hideKolorArea_description(false);
		);
		set(ptplugin[description].startMethod, "");
	);
</action>



<action name="changeLanguage_description">
	if(ptplugin[description].jsready,
		stopdelayedcall(delay_description);
		js(invokePluginFunction(description, changeLanguage, true));
	,
		delayedcall(delay_description, 0.1, changeLanguage_description(););
	);
</action>

<events name="kolorAreaEvents_description" 
	keep="true"
	onTourStart="set(ptplugin[description].canStart, true);if(ptplugin[description].openatstart,if(tour_displaycontrols,showTourInfo();
););"
	onhidetourinfo="delayedcall(0.3,if(ptplugin[description].isOpen,closeDescription_description(false);););"
	onremovepano="if(ptplugin[description].isOpen,hideTourInfo();
);"
	onremovedisplayedobject="ifnot(ptplugin[description].currentCall,if(ptplugin[description].isOpen,hideTourInfo();
););"
	hidetourcontrols="if(ptplugin[description].isOpen,hideKolorArea_description(false););"
	showtourcontrols="if(tour_displayinfo,if(ptplugin[description].isOpen,showKolorArea_description(false);,););"
	changetourlanguage="changeLanguage_description();"
/>

<!-- ********** -->
<!-- Yosemite IVFE Demo -->
<!-- id : title -->
<!-- ********** -->

  <events name="title_events" 
    onTourStart="showtitle();"
    hidetourcontrols="hidetitle();" 
    showtourcontrols="showtitle();" 
    onnewpano="updatetitle();"
    changetourlanguage="changeLanguagetitle"
    keep="true" />

  <action name="hidetitle">set(layer[title].visible, false);</action>
  <action name="showtitle">set(layer[title].visible, true );</action>

  <action name="changeLanguagetitle">
    updatetitle();
  </action>

  <action name="updatetitle">
    getmessage(layer[title].html, get(scene[get(xml.scene)].titleid));
    escape(layer[title].html);
  </action>
  <layer name="title" keep="true" zorder="8"
         type="text"
         align="top" x="0" y="15"
         bg="false"
         bgborder="0"
         alpha="1"
         visible="false"
         capture="false" handcursor="false" enabled="false"
         interactivecontent="false" 
         txtshadow="1.0 1.0 4.0 0x000000 1.0"
         css="text-align:center;
              color:#ffffff;
              font-family:Trebuchet MS;
              font-weight:bold;
              font-size:22px;"/>

<action name="viewControlZoomIn">
	if(%1,
		if(%2,
			if(%2 LT view.fovmin,
				zoomto(get(view.fovmin));
			,
				if(%2 LT view.fov,
					zoomto(%2);
				);
			);
		,
			set(fov_moveforce, -1);
			delayedcall(0.1, viewControlZoomStop());
		);
	,
		set(fov_moveforce, -1);
	);
</action>
<action name="viewControlZoomOut">
	if(%1,
		if(%2,
			if(%2 GT view.fovmax,
				zoomto(get(view.fovmax));
			,
				if(%2 GT view.fov,
					zoomto(%2);
				);
			);
		,
			set(fov_moveforce, +1);
			delayedcall(0.1, viewControlZoomStop());
		);
	,
		set(fov_moveforce, +1);
	);
</action>
<action name="viewControlZoomStop">
	set(fov_moveforce, 0);
</action>

  <action name="enableGyroscope">
    changeGyroscopeState(true);
  </action>
  <action name="disableGyroscope">
    changeGyroscopeState(false);
  </action>


  <!-- Fullscreen Management -->
  <action name="exitFullScreen" devices="fullscreensupport">set(tour_fullscreen,false);js(setFullscreen(false));</action>
  <action name="enterFullScreen" devices="fullscreensupport">set(tour_fullscreen,true);js(setFullscreen(true));</action>
  <action name="switchFullScreen">if(tour_fullscreen,exitFullScreen();,enterFullScreen(););</action>

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

  <action name="exitFullScreenChangeEvent" devices="fullscreensupport">set(tour_fullscreen,false);events.dispatch(onexitfullscreen);</action>
  <action name="enterFullScreenChangeEvent" devices="fullscreensupport">set(tour_fullscreen,true);events.dispatch(onenterfullscreen);</action>
  <action name="exitFullScreenFallback">set(fullscreen,false);</action>
  <action name="enterFullScreenFallback">set(fullscreen,true);</action>
  
  <action name="resizeFullScreenEvent">delayedcall(0,updatescreen(););</action>

  <action name="displayImage">
    if (layer[displayedStandardImage],
      if(layer[displayedStandardImage].doNotDeleteMe,
        set(layer[displayedStandardImage].currentCall, false);
        set(layer[displayedStandardImage].doNotDeleteMe, false);
        
        if (%1 == layer[displayedStandardImage].url,
          applyDisplayedImageObjectAnimation(%8);
        ,
          setDisplayedImageObjectParameters(%1, %2, %3, %4, %5, %6, %7, %8, %9, %10);
        );
      ,
        set(layer[displayedStandardImage].currentCall, false);
        set(layer[displayedStandardImage].doNotDeleteMe, true);
        events.dispatch(onremovedisplayedobject);
        delayedcall(0.2,displayImage(%1, %2, %3, %4, %5, %6, %7, %8, %9, %10, %11, %12););
      );
    ,
      if(%10,
        addlayer(displayedStandardImageOverlay);
        set(layer[displayedStandardImageOverlay].keep, false);
        set(layer[displayedStandardImageOverlay].width, 100%);
        set(layer[displayedStandardImageOverlay].height, 100%);
        set(layer[displayedStandardImageOverlay].type, container);
        set(layer[displayedStandardImageOverlay].zorder, 98);
        set(layer[displayedStandardImageOverlay].visible, false);
        set(layer[displayedStandardImageOverlay].onclick, applyDisplayedImageObjectAnimation(%8););
        set(layer[displayedStandardImageOverlay].bgcolor, "0x%11");
        set(layer[displayedStandardImageOverlay].bgalpha, %12);
        set(layer[displayedStandardImageOverlay].bgcapture, true);
      );
      addlayer(displayedStandardImage);
      set(layer[displayedStandardImage].keep, false);
      set(layer[displayedStandardImage].onclick, applyDisplayedImageObjectAnimation(%8););
      set(layer[displayedStandardImage].zorder , 99);
      set(layer[displayedStandardImage].currentCall, true);
      set(layer[displayedStandardImage].doNotDeleteMe, true);
      set(layer[displayedStandardImage].onloaded, resizeDisplayedImageObject());
      events.dispatch(onremovedisplayedobject);
      delayedcall(0.2,displayImage(%1, %2, %3, %4, %5, %6, %7, %8, %9, %10, %11, %12););
      set(layer[displayedStandardImage].visible, false);
    );
  </action>
  <action name="applyDisplayedImageObjectAnimation">resumeautorotation(forcehotspot);

    if (%1,
      stoptween(layer[displayedStandardImage].width, layer[displayedStandardImage].height);
      tween(layer[displayedStandardImage].width|layer[displayedStandardImage].height, 1|1, 1, easeOutQuad, WAIT);
      if(layer[displayedStandardImage].overlay,removelayer(displayedStandardImageOverlay););removelayer(displayedStandardImage);
    ,
      if(layer[displayedStandardImage].overlay,removelayer(displayedStandardImageOverlay););removelayer(displayedStandardImage);
    );
  </action>
  <action name="setDisplayedImageObjectParameters">
    set(layer[displayedStandardImage].url       , %1);
    set(layer[displayedStandardImage].align     , %2);
    set(layer[displayedStandardImage].x         , %3);
    set(layer[displayedStandardImage].y         , %4);
    set(layer[displayedStandardImage].imgwidth  , %5);
    set(layer[displayedStandardImage].imgheight , %6);
    set(layer[displayedStandardImage].animated  , %8);
    set(layer[displayedStandardImage].applyratio, %9);
    set(layer[displayedStandardImage].overlay   , %10);
    if (%7,pauseautorotation(forcehotspot);
);
  </action>
  <action name="resizeDisplayedImageObject">
    if(layer[displayedStandardImage].url,
    set(layer[displayedStandardImage].fullwidth, get(layer[displayedStandardImage].width));
    set(layer[displayedStandardImage].fullheight, get(layer[displayedStandardImage].height));
    if(layer[displayedStandardImage].animated,
      set(layer[displayedStandardImage].width , 1);
      set(layer[displayedStandardImage].height, 1);
    );
    if(layer[displayedStandardImage].imgwidth != "" AND layer[displayedStandardImage].imgheight != "",
      if(layer[displayedStandardImage].imgwidth == "prop",
        set(tempDisplayedImageObjectHeight, get(layer[displayedStandardImage].imgheight));
        indexoftxt(tempDisplayedImageObjectHeightPercent, get(tempDisplayedImageObjectHeight), "%");
        if(tempDisplayedImageObjectHeightPercent GT 0,
          txtreplace(tempDisplayedImageObjectHeight, '%', '');
          mul(tempDisplayedImageObjectHeight, get(stageheight));
          div(tempDisplayedImageObjectHeight, 100);
          Math.round(tempDisplayedImageObjectHeight);
        );
        mul(flyingImgWidth,get(layer[displayedStandardImage].fullwidth),get(tempDisplayedImageObjectHeight));
        div(flyingImgWidth,get(layer[displayedStandardImage].fullheight));
        Math.round(flyingImgWidth);
        set(layer[displayedStandardImage].imgwidth , get(flyingImgWidth));
        set(layer[displayedStandardImage].imgheight, get(tempDisplayedImageObjectHeight));
      ,
        if(layer[displayedStandardImage].imgheight == "prop",
          set(tempDisplayedImageObjectWidth, get(layer[displayedStandardImage].imgwidth));
          indexoftxt(tempDisplayedImageObjectWidthPercent, get(tempDisplayedImageObjectWidth), "%");
          if(tempDisplayedImageObjectWidthPercent GT 0,
            txtreplace(tempDisplayedImageObjectWidth, '%', '');
            mul(tempDisplayedImageObjectWidth, get(stagewidth));
            div(tempDisplayedImageObjectWidth, 100);
            Math.round(tempDisplayedImageObjectWidth);
          );
          mul(flyingImgHeight,get(layer[displayedStandardImage].fullheight),get(tempDisplayedImageObjectWidth));
          div(flyingImgHeight,get(layer[displayedStandardImage].fullwidth));
          Math.round(flyingImgHeight);
          set(layer[displayedStandardImage].imgwidth , get(tempDisplayedImageObjectWidth));
          set(layer[displayedStandardImage].imgheight , get(flyingImgHeight));
        ,
          set(tempDisplayedImageObjectWidth, get(layer[displayedStandardImage].imgwidth));
          set(tempDisplayedImageObjectHeight, get(layer[displayedStandardImage].imgheight));
          indexoftxt(tempDisplayedImageObjectWidthPercent, get(tempDisplayedImageObjectWidth), "%");
          indexoftxt(tempDisplayedImageObjectHeightPercent, get(tempDisplayedImageObjectHeight), "%");
          if(tempDisplayedImageObjectWidthPercent GT 0,
            txtreplace(tempDisplayedImageObjectWidth, '%', '');
            mul(tempDisplayedImageObjectWidth, get(stagewidth));
            div(tempDisplayedImageObjectWidth, 100);
            Math.round(tempDisplayedImageObjectWidth);
          );
          if(tempDisplayedImageObjectHeightPercent GT 0,
            txtreplace(tempDisplayedImageObjectHeight, '%', '');
            mul(tempDisplayedImageObjectHeight, get(stageheight));
            div(tempDisplayedImageObjectHeight, 100);
            Math.round(tempDisplayedImageObjectHeight);
          );
          set(layer[displayedStandardImage].imgwidth , get(tempDisplayedImageObjectWidth));
          set(layer[displayedStandardImage].imgheight, get(tempDisplayedImageObjectHeight));
        );
      );
    ,
      set(layer[displayedStandardImage].imgwidth , get(layer[displayedStandardImage].fullwidth));
      set(layer[displayedStandardImage].imgheight, get(layer[displayedStandardImage].fullheight));
    );
    
    set(resizedwidth, get(layer[displayedStandardImage].imgwidth));
    set(resizedheight, get(layer[displayedStandardImage].imgheight));
    if(layer[displayedStandardImage].applyratio,
      sub(resizedstagewidth, get(stagewidth), get(layer[displayedStandardImage].x));
      sub(resizedstageheight, get(stageheight), get(layer[displayedStandardImage].y));
      Math.abs(resizedstagewidth);
      Math.abs(resizedstageheight);
      if(resizedwidth GT resizedstagewidth,
        mul(tempresizedheight, get(resizedheight), get(resizedstagewidth));
        div(tempresizedheight, get(resizedwidth));
        Math.round(tempresizedheight);
        set(resizedwidth, get(resizedstagewidth));
        set(resizedheight, get(tempresizedheight));
      );
      if(resizedheight GT resizedstageheight,
        mul(tempresizedwidth, get(resizedwidth), get(resizedstageheight));
        div(tempresizedwidth, get(resizedheight));
        Math.round(tempresizedwidth);
        set(resizedheight, get(resizedstageheight));
        set(resizedwidth, get(tempresizedwidth));
      );
    );
    
    if(layer[displayedStandardImage].animated,
      set(layer[displayedStandardImage].animated, false);
      tween(layer[displayedStandardImage].width , get(resizedwidth), 1, easeOutQuad);
      tween(layer[displayedStandardImage].height, get(resizedheight), 1, easeOutQuad);
    ,
      set(layer[displayedStandardImage].width , get(resizedwidth));
      set(layer[displayedStandardImage].height, get(resizedheight));
    );
    if(layer[displayedStandardImage].overlay,set(layer[displayedStandardImageOverlay].visible, true););
    set(layer[displayedStandardImage].visible, true);
    ,
      delayedcall(0.2,resizeDisplayedImageObject(););
    );
  </action>
  <events name="displayedImageObjectEvents" keep="true" onremovedisplayedobject="displayedImageObjectOnRemoveDisplayedObject" onresize="if(layer[displayedStandardImage],resizeDisplayedImageObject());" />
  <action name="displayedImageObjectOnRemoveDisplayedObject">
    ifnot(layer[displayedStandardImage].currentCall,if(layer[displayedStandardImage].visible,resumeautorotation(forcehotspot);

      if(layer[displayedStandardImage].overlay,removelayer(displayedStandardImageOverlay););
      removelayer(displayedStandardImage);
    ););
  </action>


  <!-- Tour Information -->
  <action name="hideTourInfo">set(tour_displayinfo, false);events.dispatch(onhidetourinfo);</action>
  <action name="showTourInfo">set(tour_displayinfo, true); events.dispatch(onshowtourinfo);</action>


  <!-- Hide / Show Controls -->
  <action name="hideTourControls">set(tour_displaycontrols, false);events.dispatch(hidetourcontrols);</action>
  <action name="showTourControls">set(tour_displaycontrols, true); events.dispatch(showtourcontrols);</action>


  <!-- MAP -->
  <action name="hideMap">set(tour_displaymap, false);events.dispatch(onhidetourmap);</action>
  <action name="showMap">set(tour_displaymap, true); events.dispatch(onshowtourmap);</action>

	<!-- WebVR plugin for VR availability tests -->

	<plugin name="ptpvrmode" devices="html5" keep="true"
		url="%FIRSTXML%/graphics/webvr.js"
		mobilevr_support="true"
		mobilevr_fake_support="false"
		vr_cursor=""
		vr_cursor_enabled="false"
		onavailable="delayedcall(1, checkVrAvailability(););"
		onunavailable="checkVrUnavailable();"
		/>
	<action name="checkVrAvailability">
		if(plugin[ptpvrmode],
			if (plugin[ptpvrmode].isavailable,
				set(tour_vrdevices, true);
				events.dispatch(onvravailable);
			,
				set(tour_vrdevices, false);
			);
		,
			checkVrUnavailable();
		);
	</action>
	<action name="checkVrUnavailable">
		set(tour_vrdevices, false);
		events.dispatch(onvrunavailable);
	</action>
<action name="viewControlMoveUp">
	if(%1,
		if(%2,
			set(isfullvertical, false);
			ifnot(scene[get(xml.scene)].planar,
				sub(viewvfov, panoview.vmax, panoview.vmin);
				if (viewvfov == 180,
					set(isfullvertical, true);
				);
			);
			if(isfullvertical == false AND calc(view.vlookat-%2) LT view.vlookatmin,
				moveto(get(view.hlookat), get(view.vlookatmin));
			,
				moveto(get(view.hlookat), calc(view.vlookat-%2));
			);
		,
			set(vlookat_moveforce, -1);
			delayedcall(0.1, viewControlMoveVertStop());
		);
	,
		set(vlookat_moveforce, -1);
	);
</action>
<action name="viewControlMoveDown">
	if(%1,
		if(%2,
			set(isfullvertical, false);
			ifnot(scene[get(xml.scene)].planar,
				sub(viewvfov, panoview.vmax, panoview.vmin);
				if (viewvfov == 180,
					set(isfullvertical, true);
				);
			);
			if(sceneisfull360 == false AND calc(view.vlookat+%2) GT view.vlookatmax,
				moveto(get(view.hlookat), get(view.vlookatmax));
			,
				moveto(get(view.hlookat), calc(view.vlookat+%2));
			);
		,
			set(vlookat_moveforce, +1);
			delayedcall(0.1, viewControlMoveVertStop());
		);
	,
		set(vlookat_moveforce, +1);
	);
</action>
<action name="viewControlMoveLeft">
	if(%1,
		if(%2,
			set(isfullhorizontal, false);
			ifnot(scene[get(xml.scene)].planar,
				sub(viewhfov, panoview.hmax, panoview.hmin);
				if (viewhfov == 360,
					set(isfullhorizontal, true);
				);
			);
			if(isfullhorizontal == false AND calc(view.hlookat-%2) LT view.hlookatmin,
				moveto(get(view.hlookatmin), get(view.vlookat));
			,
				moveto(calc(view.hlookat-%2), get(view.vlookat));
			);
		,
			set(hlookat_moveforce, -1);
			delayedcall(0.1, viewControlMoveHoriStop());
		);
	,
		set(hlookat_moveforce, -1);
	);
</action>
<action name="viewControlMoveRight">
	if(%1,
		if(%2,
			set(isfullhorizontal, false);
			ifnot(scene[get(xml.scene)].planar,
				sub(viewhfov, panoview.hmax, panoview.hmin);
				if (viewhfov == 360,
					set(isfullhorizontal, true);
				);
			);
			if(isfullhorizontal == false AND calc(view.hlookat+%2) GT view.hlookatmax,
				moveto(get(view.hlookatmax), get(view.vlookat));
			,
				moveto(calc(view.hlookat+%2), get(view.vlookat));
			);
		,
			set(hlookat_moveforce, +1);
			delayedcall(0.1, viewControlMoveHoriStop());
			
		);
	,
		set(hlookat_moveforce, +1);
	);
</action>
<action name="viewControlMoveHoriStop">
	set(hlookat_moveforce, 0);
</action>
<action name="viewControlMoveVertStop">
	set(vlookat_moveforce, 0);
</action>

  <!-- Hide / Show Thumbnails -->
  <action name="hideTourThumbnails">set(tour_displaythumbnails, false);events.dispatch(hidetourthumbnails);</action>
  <action name="showTourThumbnails">set(tour_displaythumbnails, true); events.dispatch(showtourthumbnails);</action>


</krpano>