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

    
  <!-- Spot Style - stage deco 1 -->


  <style name="Iconstagedeco1"
         url="%FIRSTXML%/spots/hotspot_information_sequence_user_defaultpoint2.png"
         visible="false"
         frame="0"
         lastframe="9"
         framewidth="42"
         frameheight="67"
         stopspotsequence="false"
         crop="0|0|42|67"
         edge="center"
         onloaded="startspotanimation(0.1);"
         onhover="onhoverIconstagedeco1"
         onover="onoverIconstagedeco1"
         onout="onoutIconstagedeco1"


         />
  <action name="onhoverIconstagedeco1">
    showtooltip('hotspot');
  </action>
  <action name="onoverIconstagedeco1">


pauseautorotation(forcehotspot);

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


resumeautorotation(forcehotspot);

  </action>



    
  <!-- Spot Style - menu 1 -->


  <style name="Iconmenu1"
         url="%FIRSTXML%/spots/hotspot_information_sequence_user_defaultpoint3.png"
         visible="false"
         frame="0"
         lastframe="9"
         framewidth="42"
         frameheight="67"
         stopspotsequence="false"
         crop="0|0|42|67"
         edge="center"
         onloaded="startspotanimation(0.1);"
         onhover="onhoverIconmenu1"
         onover="onoverIconmenu1"
         onout="onoutIconmenu1"


         />
  <action name="onhoverIconmenu1">
    showtooltip('hotspot');
  </action>
  <action name="onoverIconmenu1">


pauseautorotation(forcehotspot);

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


resumeautorotation(forcehotspot);

  </action>



    
  <!-- Spot Style - Default Point Spot Style 1 -->


  <style name="IconDefaultPointSpotStyle1"
         url="%FIRSTXML%/spots/gold-star_user_defaultpoint5.png"
         visible="false"
         edge="center"
         onhover="onhoverIconDefaultPointSpotStyle1"
         onout="onoutIconDefaultPointSpotStyle1"

         height="20"
         width="20"
         />
  <action name="onhoverIconDefaultPointSpotStyle1">
    showtooltip('hotspot');
  </action>
  <action name="onoutIconDefaultPointSpotStyle1">
    hideTooltip();



  </action>



    
  <!-- Spot Style - find the stars -->


  <style name="Iconfindthestars"
         url="%FIRSTXML%/spots/hotspot_information_sequence_user_defaultpoint6.png"
         visible="false"
         frame="0"
         lastframe="9"
         framewidth="42"
         frameheight="67"
         stopspotsequence="false"
         crop="0|0|42|67"
         edge="center"
         onloaded="startspotanimation(0.1);showPermanentTooltip(std);"
         onover="onoverIconfindthestars"
         onout="onoutIconfindthestars"


         />
  <action name="onoverIconfindthestars">


pauseautorotation(forcehotspot);

  </action>
  <action name="onoutIconfindthestars">


resumeautorotation(forcehotspot);

  </action>



    
  <!-- Spot Style - Default Point Spot Style 2 -->


  <style name="IconDefaultPointSpotStyle2"
         url="%FIRSTXML%/spots/hotspot_neutral_black_sequence_user_defaultpoint7.png"
         visible="false"
         frame="0"
         lastframe="26"
         framewidth="50"
         frameheight="50"
         stopspotsequence="false"
         crop="0|0|50|50"
         edge="center"
         onloaded="startspotanimation(0.1);"
         onhover="onhoverIconDefaultPointSpotStyle2"
         onover="onoverIconDefaultPointSpotStyle2"
         onout="onoutIconDefaultPointSpotStyle2"


         />
  <action name="onhoverIconDefaultPointSpotStyle2">
    showtooltip('hotspot');
  </action>
  <action name="onoverIconDefaultPointSpotStyle2">


pauseautorotation(forcehotspot);

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


resumeautorotation(forcehotspot);

  </action>



<!-- ********** -->
<!-- stage gall -->
<!-- id : gallery -->
<!-- ********** -->

<ptplugin name="gallery" engine="kolorBox">
	<settings>
		<option name="position" value="center" type="string" />
		<option name="margin_x" value="0" type="int" />
		<option name="margin_y" value="0" type="int" />
		<option name="external_padding" value="15" type="int" />
		<option name="draggable_box" value="false" type="bool" />
		<option name="slideshow_autoplay" value="false" type="bool" />
		<option name="slideshow" value="5000" type="int" />
		<option name="container_auto_size" value="true" type="bool" />
		<option name="container_width" value="100" type="int" />
		<option name="container_width_unit" value="percent" type="string" />
		<option name="container_height" value="100" type="int" />
		<option name="container_height_unit" value="percent" type="string" />
		<option name="container_color" value="000000" type="string" />
		<option name="container_alpha" value="0.80000000000000004" type="float" />
		<option name="container_topleft_border_radius" value="15" type="int" />
		<option name="container_topright_border_radius" value="15" type="int" />
		<option name="container_bottomleft_border_radius" value="15" type="int" />
		<option name="container_bottomright_border_radius" value="15" type="int" />
		<option name="container_border_width" value="0" type="int" />
		<option name="container_border_color" value="ffffff" type="string" />
		<option name="container_border_alpha" value="1" type="float" />
		<option name="overlay_displayed" value="true" type="bool" />
		<option name="overlay_color" value="000000" type="string" />
		<option name="overlay_alpha" value="0.50000762951094835" type="float" />

		<option name="item_border_width" value="0" type="int" />
		<option name="item_border_color" value="ffffff" type="string" />
		<option name="item_border_alpha" value="1" type="float" />
		
		<option name="title_displayed" value="false" type="bool" />
		
		<option name="caption_displayed" value="false" type="bool" />
		
		<option name="play_displayed" value="false" type="bool" />
		<option name="play_position" value="bottomleft" type="string" />
		<option name="play_text" value="galleryplay_text" type="string" />




		<option name="navigation_displayed" value="true" type="bool" />
		<option name="navigation_position" value="bottom" type="string" />
		<option name="counter_color" value="666666" type="string" />
		<option name="navprev_text" value="gallerynavprev_text" type="string" />
		<option name="navnext_text" value="gallerynavnext_text" type="string" />




		<option name="navigation_arrows" value="true" type="bool" />




		<option name="fullscreen_displayed" value="true" type="bool" />
		<option name="fullscreen_position" value="topleft" type="string" />
		<option name="fullscreen_text" value="galleryfullscreen_text" type="string" />




		<option name="close_displayed" value="true" type="bool" />
		<option name="close_position" value="topright" type="string" />
		<option name="close_text" value="galleryclose_text" type="string" />

		<option name="close_callback" value="invokeKrFunction('closeKolorBoxCallback_gallery')" type="string" />
		<option name="zorder" value="1" type="int" />
		<option name="use_i18n" value="true" type="bool" />
	</settings>
	<internaldata>
		<item name="item_1" title="gallerypicture_title0" caption="gallerypicture_caption0" value="Anams Gamedata/graphics/gallery/stage_1.jpg"/>
		<item name="item_2" title="gallerypicture_title1" caption="gallerypicture_caption1" value="Anams Gamedata/graphics/gallery/stage_2.jpg"/>
		<item name="item_3" title="gallerypicture_title2" caption="gallerypicture_caption2" value="Anams Gamedata/graphics/gallery/stage_3.jpg"/>
		<item name="item_4" title="gallerypicture_title3" caption="gallerypicture_caption3" value="Anams Gamedata/graphics/gallery/stage_4.jpg"/>
	</internaldata>
</ptplugin>

<action name="kolorBoxJsReady_gallery">
	set(ptplugin[gallery].jsready, true);
</action>

<action name="showGallery_gallery">
	ifnot(ptplugin[gallery].isOpen,
		set(ptplugin[gallery].isOpen, true);
		set(ptplugin[gallery].doNotDeleteMe, false);
		set(gallery_boxurl, %1);
		pauseautorotation(forceplugin);

		js(invokePluginFunction(gallery, openKolorBox, %1));
		events.dispatch(onremovedisplayedobject);
	,
		if(%1 !== null AND %1 != gallery_boxurl,
			closeKolorBox_gallery();
			delayedcall(0.3,showGallery_gallery(%1););
		);
	);
</action>

<action name="toggleGallery_gallery">
	js(invokePluginFunction(gallery, toggleKolorBox, %1));
</action>


<action name="closeKolorBox_gallery">
	js(invokePluginFunction(gallery, closeKolorBox));
</action>

<action name="closeKolorBoxCallback_gallery">
	resumeautorotation(forceplugin);

	set(ptplugin[gallery].isOpen, false);
</action>

<action name="changeLanguage_gallery">
	if(ptplugin[gallery].jsready,
		js(invokePluginFunction(gallery, changeLanguage));
	,
		delayedcall(delay_gallery, 0.1, changeLanguage_gallery(););
	);
</action>

<events name="kolorBoxEvents_gallery" 
	keep="true"
	changetourlanguage="changeLanguage_gallery();"
	/>

<!-- ********** -->
<!-- menu -->
<!-- id : gallery1 -->
<!-- ********** -->

<ptplugin name="gallery1" engine="kolorBox">
	<settings>
		<option name="position" value="center" type="string" />
		<option name="margin_x" value="0" type="int" />
		<option name="margin_y" value="0" type="int" />
		<option name="external_padding" value="15" type="int" />
		<option name="draggable_box" value="false" type="bool" />
		<option name="slideshow_autoplay" value="false" type="bool" />
		<option name="slideshow" value="5000" type="int" />
		<option name="container_auto_size" value="true" type="bool" />
		<option name="container_width" value="100" type="int" />
		<option name="container_width_unit" value="percent" type="string" />
		<option name="container_height" value="100" type="int" />
		<option name="container_height_unit" value="percent" type="string" />
		<option name="container_color" value="000000" type="string" />
		<option name="container_alpha" value="0.80000000000000004" type="float" />
		<option name="container_topleft_border_radius" value="15" type="int" />
		<option name="container_topright_border_radius" value="15" type="int" />
		<option name="container_bottomleft_border_radius" value="15" type="int" />
		<option name="container_bottomright_border_radius" value="15" type="int" />
		<option name="container_border_width" value="0" type="int" />
		<option name="container_border_color" value="ffffff" type="string" />
		<option name="container_border_alpha" value="1" type="float" />
		<option name="overlay_displayed" value="true" type="bool" />
		<option name="overlay_color" value="000000" type="string" />
		<option name="overlay_alpha" value="0.50000762951094835" type="float" />

		<option name="item_border_width" value="0" type="int" />
		<option name="item_border_color" value="ffffff" type="string" />
		<option name="item_border_alpha" value="1" type="float" />
		
		<option name="title_displayed" value="false" type="bool" />
		
		<option name="caption_displayed" value="false" type="bool" />
		
		<option name="play_displayed" value="false" type="bool" />
		<option name="play_position" value="bottomleft" type="string" />
		<option name="play_text" value="gallery1play_text" type="string" />




		<option name="navigation_displayed" value="true" type="bool" />
		<option name="navigation_position" value="bottom" type="string" />
		<option name="counter_color" value="666666" type="string" />
		<option name="navprev_text" value="gallery1navprev_text" type="string" />
		<option name="navnext_text" value="gallery1navnext_text" type="string" />




		<option name="navigation_arrows" value="true" type="bool" />




		<option name="fullscreen_displayed" value="true" type="bool" />
		<option name="fullscreen_position" value="topleft" type="string" />
		<option name="fullscreen_text" value="gallery1fullscreen_text" type="string" />




		<option name="close_displayed" value="true" type="bool" />
		<option name="close_position" value="topright" type="string" />
		<option name="close_text" value="gallery1close_text" type="string" />

		<option name="close_callback" value="invokeKrFunction('closeKolorBoxCallback_gallery1')" type="string" />
		<option name="zorder" value="2" type="int" />
		<option name="use_i18n" value="true" type="bool" />
	</settings>
	<internaldata>
		<item name="item_1" title="gallery1picture_title0" caption="gallery1picture_caption0" value="Anams Gamedata/graphics/gallery1/menu_options.png"/>
		<item name="item_2" title="gallery1picture_title1" caption="gallery1picture_caption1" value="Anams Gamedata/graphics/gallery1/f1.jpg"/>
		<item name="item_3" title="gallery1picture_title2" caption="gallery1picture_caption2" value="Anams Gamedata/graphics/gallery1/f2.jpg"/>
	</internaldata>
</ptplugin>

<action name="kolorBoxJsReady_gallery1">
	set(ptplugin[gallery1].jsready, true);
</action>

<action name="showGallery_gallery1">
	ifnot(ptplugin[gallery1].isOpen,
		set(ptplugin[gallery1].isOpen, true);
		set(ptplugin[gallery1].doNotDeleteMe, false);
		set(gallery1_boxurl, %1);
		pauseautorotation(forceplugin);

		js(invokePluginFunction(gallery1, openKolorBox, %1));
		events.dispatch(onremovedisplayedobject);
	,
		if(%1 !== null AND %1 != gallery1_boxurl,
			closeKolorBox_gallery1();
			delayedcall(0.3,showGallery_gallery1(%1););
		);
	);
</action>

<action name="toggleGallery_gallery1">
	js(invokePluginFunction(gallery1, toggleKolorBox, %1));
</action>


<action name="closeKolorBox_gallery1">
	js(invokePluginFunction(gallery1, closeKolorBox));
</action>

<action name="closeKolorBoxCallback_gallery1">
	resumeautorotation(forceplugin);

	set(ptplugin[gallery1].isOpen, false);
</action>

<action name="changeLanguage_gallery1">
	if(ptplugin[gallery1].jsready,
		js(invokePluginFunction(gallery1, changeLanguage));
	,
		delayedcall(delay_gallery1, 0.1, changeLanguage_gallery1(););
	);
</action>

<events name="kolorBoxEvents_gallery1" 
	keep="true"
	changetourlanguage="changeLanguage_gallery1();"
	/>

<!-- ********* -->
<!-- Gyroscope -->
<!-- ********* -->


<plugin name="gyroscope"
        url="%FIRSTXML%/graphics/gyro2.js"
        keep="true"
        devices="no-desktop.and.html5"

        onunavailable="checkGyroUnavailable();"
        sensor_mode="1"
        friction="auto"
        autocalibration="true"
        touch_mode="full"
        onavailable="delayedcall(1, checkGyroAvailability(););"
        enabled="false"
        activated="false"
        />

<events name="gyroscopeEvents" onnewpano="planarGyroscopeTest();" keep="true" />

<action name="planarGyroscopeTest">
  if(plugin[gyroscope],
    if(scene[get(xml.scene)].full360,
      set(sceneisfull360, false);
      sub(viewhfov, panoview.hmax, panoview.hmin);
      if (viewhfov == 360,
        sub(viewvfov, panoview.vmax, panoview.vmin);
        if (viewvfov == 180,
          set(sceneisfull360, true);
        );
      );
      if (sceneisfull360,
        set(plugin[gyroscope].camroll, true);
      ,
        set(plugin[gyroscope].camroll, false);
      );
    ,
      set(plugin[gyroscope].camroll, false);
    );
  );
</action>

<action name="changeGyroscopeState">
  if(plugin[gyroscope],
    if (plugin[gyroscope].isavailable,
      if(%1,
        set(plugin[gyroscope].activated,true);
      ,
        set(plugin[gyroscope].activated,false);
      );
      if (%1 != plugin[gyroscope].enabled,
        if(plugin[gyroscope].activated,
          switch(plugin[gyroscope].enabled);
        ,
          set(plugin[gyroscope].enabled, false);
        );
        if (plugin[gyroscope].enabled, events.dispatch(ongyroscopeon);, events.dispatch(ongyroscopeoff););
      );
    );
  );
</action>

<action name="checkGyroAvailability">
  if(plugin[gyroscope],
    if (plugin[gyroscope].isavailable,
      
      set(sceneisfull360, false);
      if (scene[get(xml.scene)].full360,
        sub(viewhfov, panoview.hmax, panoview.hmin);
        if (viewhfov == 360,
          sub(viewvfov, panoview.vmax, panoview.vmin);
          if (viewvfov == 180,
            set(sceneisfull360, true);
          );
        );
      );
      set(delaythegyrocheck, false);
      if (sceneisfull360 AND tour_firstlittleplanet, set(delaythegyrocheck, true));

      ifnot(delaythegyrocheck,
        set(tour_gyroscopedevices, true);
        events.dispatch(ongyroscopeavailable);
      ,
        delayedcall(1, checkGyroAvailability(););
      );
    ,
      set(tour_gyroscopedevices, false);
    );
    if (plugin[gyroscope].enabled, events.dispatch(ongyroscopeon);, events.dispatch(ongyroscopeoff););
  ,
    checkGyroUnavailable();
  );
</action>

<action name="checkGyroUnavailable">
  set(plugin[gyroscope].activated, false);
  set(plugin[gyroscope].enabled, false);
  set(tour_gyroscopedevices, false);
  events.dispatch(ongyroscopeunavailable);
</action>

<!-- ********** -->
<!-- Double Click -->
<!-- id : doubleclick -->
<!-- ********** -->
  <events name="doubleclick_events" keep="true" ondoubleclick="doubleclick_ondoubleclick"/>
  <action name="doubleclick_ondoubleclick">switchFullscreen();


  </action>
<!-- ********** -->
<!-- Context menu -->
<!-- id : contextmenu -->
<!-- ********** -->
  <contextmenu fullscreen="false" versioninfo="false" touch="true">
    <item name="website1" onclick="getmessage(urltoopen,contextmenuwebsiteurl1);openurl(get(urltoopen),_blank);" />
    <item name="normal"        onclick="setViewNormal();
" separator="true"/>
    <item name="littleplanet"  onclick="setViewLittlePlanet();
"/>
    <item name="fullscreenentry" onclick="enterFullscreen();
" separator="true"/>
  </contextmenu>

  <events name="contextmenuevents" keep="true" 
    onenterfullscreen="updateContextMenu" onexitfullscreen="updateContextMenu" 
    onxmlcomplete="updateContextMenu" 
    changetourlanguage="updateContextMenu" 
    />
  <events name="contextmenuvrevents" keep="true" 
    onvravailable="updateContextMenu();" onvrunavailable="updateContextMenu();"
    devices="html5"
    />
  <action name="updateContextMenu">
    getmessage(contextmenu.item[website1].caption, contextmenuopenwebsitelabel1);
    getmessage(contextmenu.item[normal].caption, contextmenunormallabel);
    set(sceneisfull360, false);
    if(scene[get(xml.scene)].full360,
      sub(viewhfov, panoview.hmax, panoview.hmin);
      if (viewhfov == 360,
        sub(viewvfov, panoview.vmax, panoview.vmin);
        if (viewvfov == 180,
          set(sceneisfull360, true);
        );
      );
    );
    if (sceneisfull360 AND (device.webgl OR device.flash),
      set(contextmenu.item[littleplanet].visible, true);
      getmessage(contextmenu.item[littleplanet].caption, contextmenulittleplanetlabel);
    ,
      set(contextmenu.item[littleplanet].visible, false);
    );
    if (device.fullscreensupport,
      if(tour_fullscreen,
        getmessage(contextmenu.item[fullscreenentry].caption, contextmenucloseFsLabel);
        set(contextmenu.item[fullscreenentry].onclick, exitFullscreen();
);
       ,
        getmessage(contextmenu.item[fullscreenentry].caption, contextmenuopenFsLabel);
        set(contextmenu.item[fullscreenentry].onclick, enterFullscreen();
);
      );
     ,
      set(contextmenu.item[fullscreenentry].visible, false);
    );
  </action>

<!-- ********** -->
<!-- Find Objects Game -->
<!-- id : countergame -->
<!-- ********** -->


  <events name="countergame_events" 
    onTourStart="showcountergame();"
    hidetourcontrols="hidecountergame();" 
    showtourcontrols="showcountergame();" 
    onnewpano="updatecountergame();"
    keep="true" />

  <action name="hidecountergame">set(layer[countergame].visible, false);</action>
  <action name="showcountergame">set(layer[countergame].visible, true );</action>

  <krpano countergamenb="0" countergamemax="3" countergameremovedelements=""/>
  <action name="incrementcountergame" scope="local">
    inc(countergamenb);
    txtadd(countergameremovedelements, get(countergameremovedelements), xx, %1);
    updatecountergame();

    if (countergamenb == countergamemax,
displayImage(%FIRSTXML%/graphics/findobjectsgame/_2017-01-11_08-50-288.png
             ,center,0,0
             ,'',''
             ,true
             ,true
             ,false
             ,true
             ,000000
             ,0.80000000000000004);

    );
  </action>

  <action name="updatecountergame" scope="local">
    txtsplit(countergameremovedelements, xx, countergamearr);
    for(set(i,0), i LT countergamearr.count, inc(i),
      copy(elemtoremove, countergamearr[get(i)].value);
      if (elemtoremove,
        if (layer[get(elemtoremove)] !== null,
          removelayer(get(elemtoremove));
        );
        if (hotspot[get(elemtoremove)] !== null,
          removehotspot(get(elemtoremove));
        );
      );
    );

    getmessage(messagecounter, countergamemessagetemplate);
    txtreplace(messagecounter, "NB", get(countergamenb));
    txtreplace(messagecounter, "MAX", get(countergamemax));
    sub(remainingelements, countergamemax, countergamenb);
    txtreplace(messagecounter, "RMN", get(remainingelements));
    copy(layer[countergame].html, messagecounter);
  </action>

  <layer name="countergame" keep="true" zorder="6"
         url="%FIRSTXML%/graphics/textfield.swf"
         align="bottomright" x="10" y="10" width="100%" autoheight="true"
         background="false" capture="false" handcursor="false" selectable="false" enabled="false"
         borderwidth="0"
         alpha="1"
         visible="false"
         textshadow="1"
         css="text-align:right;
              color:#000000;
              font-family:Arial;
              font-weight:bold;
              font-size:16px;"/>
<!-- ********** -->
<!-- Gyro Button -->
<!-- id : gyroButton -->
<!-- ********** -->


  <layer name="gyroButton"
         keep="true"
         url="%FIRSTXML%/graphics/gyrobutton/disable_gyro2.png" 
         align="bottomright"
         x="155"
         y="30"
         zorder="7"
         tooltip=""
         onhover="gyroButtonOnHover"
         state="true"
         onclick="gyroButtonOnClick"
         onout="hideTooltip();"
         height="30"
         width="30"
         visible="false"
         />

  <action name="gyroButtonOnHover">
    if (state,
      set(tooltip, gyroButtonfirsttooltip);
     ,
      set(tooltip, gyroButtonsecondtooltip);
    );
    if (tooltip != "", showTooltip(bottomright,''););
  </action>
  <action name="gyroButtonOnClick">
    if (state,disableGyroscope();

     ,enableGyroscope();

    );
  </action>

  <events name="gyroButtonevents" 
    onTourStart="gyroButtonShowGyroscopeButtons();"
    hidetourcontrols="hidegyroButton();" 
    showtourcontrols="gyroButtonShowGyroscopeButtons();" 
	ongyroscopeavailable="gyroButtonupdateGyroscopeButtonsAvailability();"
	ongyroscopeunavailable="gyroButtonupdateGyroscopeButtonsAvailability();"
	ongyroscopeon="gyroButtonenableGyroscopeButtons(true);"
	ongyroscopeoff="gyroButtonenableGyroscopeButtons(false);"
    keep="true" device="html5" />

  <events name="gyroButtonDesktopEvents" onTourStart="delayedcall(gyroButton_desktopdelay,3.0,ifnot(plugin[gyroscope],gyroButtonHideGyroscopeButtons(true);););" keep="true" device="desktop" />

  <action name="hidegyroButton">if(layer[gyroButton],set(layer[gyroButton].visible, false););</action>
  <action name="showgyroButton">if(layer[gyroButton],set(layer[gyroButton].visible, true););</action>


  <krpano gyroButtongyroscopeavailable="false" gyroButtongyroscopeenabled="false"/>
  <action name="gyroButtonupdateGyroscopeButtonsAvailability">
    stopdelayedcall(gyroButton_desktopdelay);
	if (tour_gyroscopedevices,
      set(gyroButtongyroscopeavailable, true);
      gyroButtonupdateGyroscopeButtons();
    ,
      set(gyroButtongyroscopeavailable, false);
      gyroButtonHideGyroscopeButtons(true);
    );
  </action>
  <action name="gyroButtonenableGyroscopeButtons">
    if (tour_gyroscopedevices,
      set(gyroButtongyroscopeenabled, %1);
      gyroButtonupdateGyroscopeButtons();
    );
  </action>
  
  <action name="gyroButtonHideGyroscopeButtons">
		hidegyroButton();
		if('%1' == 'true',
			removelayer(gyroButton);
			set(events[gyroButtonevents].name, null);
			set(events[gyroButtonDesktopEvents].name, null);
		);
	</action>
	<action name="gyroButtonShowGyroscopeButtons">
		if (gyroButtongyroscopeavailable,
			if (gyroButtongyroscopeenabled,

				set(layer[gyroButton].state, true);
				set(layer[gyroButton].url,%FIRSTXML%/graphics/gyrobutton/enable_gyro2.png);
			,
				set(layer[gyroButton].state, false);

				set(layer[gyroButton].url,%FIRSTXML%/graphics/gyrobutton/disable_gyro2.png);
			);
			showgyroButton();
		,
			set(layer[gyroButton].state, false);
			gyroButtonHideGyroscopeButtons();
		);
	</action>
	<action name="gyroButtonupdateGyroscopeButtons">
	if (tour_gyroscopedevices,
		if (tour_displaycontrols,
			gyroButtonShowGyroscopeButtons();
		,
			gyroButtonHideGyroscopeButtons();
		);
	,
		gyroButtonHideGyroscopeButtons();
	);
	</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>


<action name="setViewLittlePlanet">
	set(sceneisfull360, false);
	if(scene[get(xml.scene)].full360,
		sub(viewhfov, panoview.hmax, panoview.hmin);
		if (viewhfov == 360,
			sub(viewvfov, panoview.vmax, panoview.vmin);
			if (viewvfov == 180,
				set(sceneisfull360, true);
			);
		);
	);
	if (sceneisfull360 AND (device.webgl OR device.flash),
		if(normalViewActivated,stopSetViewTweens(););
		if(current_view_isflat === true,
			setViewNonFlat(VFOV);
		);
		setViewLittlePlanetComplete();
	);
</action>

<action name="setViewLittlePlanetComplete">
	set(backtonormalfirst,false);
	if(view.pannini GE 1.0, set(backtonormalfirst,true));
	if(view.stereographic == false, set(backtonormalfirst,true));
	if(backtonormalfirst, hideTooltip();tween(view.fisheye, 0.0 ,distance(1.0, 0.25), easeOutQuad, WAIT); );
	set(view.stereographic, true);
	set(view.fisheyefovlink, 1.5);
	tween(view.architectural, 0.0, 0.25);
	tween(view.vlookat, 90, distance(179, 1.50));
	tween(view.pannini, 0.0, distance(1.0, 0.75), easeOutQuad, if(panniniViewActivated,restoreViewFromPannini();););
	if(panoview.fovmax LE 150, set(view.fovmax, 150); , set(view.fovmax, get(panoview.fovmax)); );
	tween(view.fisheye, 1.0, distance(1.0, 0.75));
	tween(view.fov, 150, distance(179, 0.75));
</action>

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


<action name="setViewNormal">
	stopSetViewTweens();
	if(current_view_isflat === true,
		setViewNonFlat(VFOV);
	);
	setViewNormalComplete();
</action>

<action name="setViewNormalComplete">
	set(view.fisheyefovlink, 0.5);
	set(view.fovmax, get(panoview.fovmax));
	tween(view.architectural, 0.0, distance(1.0, 0.45));
	tween(view.pannini, 0.0, distance(1.0, 0.45), easeOutQuad, if(panniniViewActivated,restoreViewFromPannini();););
	tween(view.vlookat, get(panoview.v), distance(90, 0.45));
	tween(view.fov, get(panoview.fov), distance(50, 0.45));
	tween(view.fisheye, 0.0, distance(1.0, 0.45),
		set(view.stereographic,false);
	);
</action>

<krpano normalViewActivated="true" />
<action name="stopSetViewTweens">
	stoptween(view.fov);
	stoptween(view.vlookat);
	stoptween(view.fisheye);
	stoptween(view.architectural);
	stoptween(view.pannini);
</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>

</krpano>