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

    
  <!-- Spot Style - Default Point Spot Style -->
  <style name="IconDefaultPointSpotStyle"
         url="%FIRSTXML%/spots/hotspot_neutral_sequence_user_defaultpoint0.png"
         visible="false"
         frame="0"
         lastframe="15"
         framewidth="60"
         frameheight="60"
         stopspotsequence="false"
         crop="0|0|60|60"
         onloaded="startspotanimation(0.1);"
         onhover="onhoverIconDefaultPointSpotStyle"
         onout="onoutIconDefaultPointSpotStyle"


         />

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


  <action name="onoutIconDefaultPointSpotStyle">
    hideTooltip();



  </action>



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


<!-- ********** -->
<!-- Rounded Control Bar -->
<!-- id : controlBar_rounded -->
<!-- ********** -->

  <krpano controlBar_roundedbuilt="false" controlBar_roundednbbuttons="0" controlBar_roundedIsOpened="false" />

  <events name="controlBar_roundedevents" 

	openvideointerface="controlBar_roundedHideControlBar();"
	closevideointerface="controlBar_roundedShowControlBar();"

    onxmlcomplete="controlBar_roundedbuildMenuBar();" keep="true"/>
  <action name="controlBar_roundedbuildMenuBar">
    ifnot (controlBar_roundedbuilt, controlBar_roundedbuildMenu(); set(controlBar_roundedbuilt, true););
  </action>


<action name="controlBar_roundedHideControlBar">
	if(roundcornerbarIsOpened,
		set(layer[controlBar_roundedbtnbg0].visible, false);
		set(layer[controlBar_roundedbtnbg1].visible, false);
		set(layer[controlBar_roundedbtnbg2].visible, false);
		set(layer[controlBar_roundedbtnbg3].visible, false);
		set(layer[controlBar_roundedbtnbg4].visible, false);
		set(layer[controlBar_roundedbtnbg5].visible, false);
		set(layer[controlBar_roundedbtn_in].visible, false);
		set(layer[controlBar_roundedbtn_out].visible, false);
		set(layer[controlBar_roundedbtn_up].visible, false);
		set(layer[controlBar_roundedbtn_down].visible, false);
		set(layer[controlBar_roundedbtn_left].visible, false);
		set(layer[controlBar_roundedbtn_right].visible, false);
		set(layer[controlBar_roundedbtn_hidecontrols].visible, false);
		set(layer[controlBar_roundedmenu_roundcorner_bg].visible, false);
		controlBar_roundedHideFullscreenButtons();
	,
		set(layer[controlBar_roundedbtn_showcontrols].visible, false);
	);
</action>
<action name="controlBar_roundedShowControlBar">
	if(roundcornerbarIsOpened,
		set(layer[controlBar_roundedbtnbg0].visible, true);
		set(layer[controlBar_roundedbtnbg1].visible, true);
		set(layer[controlBar_roundedbtnbg2].visible, true);
		set(layer[controlBar_roundedbtnbg3].visible, true);
		set(layer[controlBar_roundedbtnbg4].visible, true);
		set(layer[controlBar_roundedbtnbg5].visible, true);
		set(layer[controlBar_roundedbtn_in].visible, true);
		set(layer[controlBar_roundedbtn_out].visible, true);
		set(layer[controlBar_roundedbtn_up].visible, true);
		set(layer[controlBar_roundedbtn_down].visible, true);
		set(layer[controlBar_roundedbtn_left].visible, true);
		set(layer[controlBar_roundedbtn_right].visible, true);
		set(layer[controlBar_roundedbtn_hidecontrols].visible, true);
		set(layer[controlBar_roundedmenu_roundcorner_bg].visible, true);
		controlBar_roundedShowFullscreenButtons();
	,
		set(layer[controlBar_roundedbtn_showcontrols].visible, true);
	);
</action>

  <action name="controlBar_roundedbuildMenu">
    txtadd(btnbgname, "controlBar_roundedbtnbg", get(controlBar_roundednbbuttons));





    if (controlBar_roundednbbuttons LT 6,
      set(layer[controlBar_roundedbtn_home].parent, get(btnbgname));
      set(layer[controlBar_roundedbtn_home].x     , get(plugin[get(btnbgname)].childx));
      set(layer[controlBar_roundedbtn_home].y     , get(plugin[get(btnbgname)].childy));
      inc(controlBar_roundednbbuttons);
      txtadd(btnbgname, "controlBar_roundedbtnbg", get(controlBar_roundednbbuttons));
    ,
      set(layer[controlBar_roundedbtn_home].disabled, true);
    );


    if (controlBar_roundednbbuttons LT 6,
      set(layer[controlBar_roundedbtn_sound_off].parent, get(btnbgname));
      set(layer[controlBar_roundedbtn_sound_off].x     , get(plugin[get(btnbgname)].childx));
      set(layer[controlBar_roundedbtn_sound_off].y     , get(plugin[get(btnbgname)].childy));
      set(layer[controlBar_roundedbtn_sound_on ].parent, get(btnbgname));
      set(layer[controlBar_roundedbtn_sound_on ].x     , get(plugin[get(btnbgname)].childx));
      set(layer[controlBar_roundedbtn_sound_on ].y     , get(plugin[get(btnbgname)].childy));
      inc(controlBar_roundednbbuttons);
      txtadd(btnbgname, "controlBar_roundedbtnbg", get(controlBar_roundednbbuttons));
    ,
      set(layer[controlBar_roundedbtn_sound_off].disabled, true);
      set(layer[controlBar_roundedbtn_sound_on].disabled, true);
    );


    if (controlBar_roundednbbuttons LT 6,
      set(layer[controlBar_roundedbtn_show_hotspots].parent, get(btnbgname));
      set(layer[controlBar_roundedbtn_show_hotspots].x     , get(plugin[get(btnbgname)].childx));
      set(layer[controlBar_roundedbtn_show_hotspots].y     , get(plugin[get(btnbgname)].childy));
      set(layer[controlBar_roundedbtn_hide_hotspots].parent, get(btnbgname));
      set(layer[controlBar_roundedbtn_hide_hotspots].x     , get(plugin[get(btnbgname)].childx));
      set(layer[controlBar_roundedbtn_hide_hotspots].y     , get(plugin[get(btnbgname)].childy));
      inc(controlBar_roundednbbuttons);
      txtadd(btnbgname, "controlBar_roundedbtnbg", get(controlBar_roundednbbuttons));
    ,
      set(layer[controlBar_roundedbtn_show_hotspots].disabled, true);
      set(layer[controlBar_roundedbtn_hide_hotspots].disabled, true);
    );


    if (controlBar_roundednbbuttons LT 6,
      set(layer[controlBar_roundedbtn_display_floorplan].parent, get(btnbgname));
      set(layer[controlBar_roundedbtn_display_floorplan].x     , get(plugin[get(btnbgname)].childx));
      set(layer[controlBar_roundedbtn_display_floorplan].y     , get(plugin[get(btnbgname)].childy));
      set(layer[controlBar_roundedbtn_hide_floorplan   ].parent, get(btnbgname));
      set(layer[controlBar_roundedbtn_hide_floorplan   ].x     , get(plugin[get(btnbgname)].childx));
      set(layer[controlBar_roundedbtn_hide_floorplan   ].y     , get(plugin[get(btnbgname)].childy));
      inc(controlBar_roundednbbuttons);
      txtadd(btnbgname, "controlBar_roundedbtnbg", get(controlBar_roundednbbuttons));
    ,
      set(layer[controlBar_roundedbtn_display_floorplan].disabled, true);
      set(layer[controlBar_roundedbtn_hide_floorplan].disabled, true);
    );


    if (controlBar_roundednbbuttons LT 6,
      set(layer[controlBar_roundedbtn_autorotate_on ].parent, get(btnbgname));
      set(layer[controlBar_roundedbtn_autorotate_on ].x     , get(plugin[get(btnbgname)].childx));
      set(layer[controlBar_roundedbtn_autorotate_on ].y     , get(plugin[get(btnbgname)].childy));
      set(layer[controlBar_roundedbtn_autorotate_off].parent, get(btnbgname));
      set(layer[controlBar_roundedbtn_autorotate_off].x     , get(plugin[get(btnbgname)].childx));
      set(layer[controlBar_roundedbtn_autorotate_off].y     , get(plugin[get(btnbgname)].childy));
      inc(controlBar_roundednbbuttons);
      txtadd(btnbgname, "controlBar_roundedbtnbg", get(controlBar_roundednbbuttons));
    ,
      set(layer[controlBar_roundedbtn_autorotate_on].disabled, true);
      set(layer[controlBar_roundedbtn_autorotate_off].disabled, true);
    );



    if (controlBar_roundednbbuttons LT 6,
      if (device.desktop,
        set(layer[controlBar_roundedbtn_ctrlmode_drag_to].parent, get(btnbgname));
        set(layer[controlBar_roundedbtn_ctrlmode_drag_to].x     , get(plugin[get(btnbgname)].childx));
        set(layer[controlBar_roundedbtn_ctrlmode_drag_to].y     , get(plugin[get(btnbgname)].childy));
        set(layer[controlBar_roundedbtn_ctrlmode_move_to].parent, get(btnbgname));
        set(layer[controlBar_roundedbtn_ctrlmode_move_to].x     , get(plugin[get(btnbgname)].childx));
        set(layer[controlBar_roundedbtn_ctrlmode_move_to].y     , get(plugin[get(btnbgname)].childy));
        inc(controlBar_roundednbbuttons);
        txtadd(btnbgname, "controlBar_roundedbtnbg", get(controlBar_roundednbbuttons));
      );
    ,
      set(layer[controlBar_roundedbtn_ctrlmode_drag_to].disabled, true);
      set(layer[controlBar_roundedbtn_ctrlmode_move_to].disabled, true);
    );


    if(plugin[ptpvrmode] AND device.html5 AND device.mobile,
      if (controlBar_roundednbbuttons LT 6,
          set(layer[controlBar_roundedbtn_enter_vr].parent, get(btnbgname));
          set(layer[controlBar_roundedbtn_enter_vr].x     , get(plugin[get(btnbgname)].childx));
          set(layer[controlBar_roundedbtn_enter_vr].y     , get(plugin[get(btnbgname)].childy));
          set(layer[controlBar_roundedbtn_enter_vr_not].parent, get(btnbgname));
          set(layer[controlBar_roundedbtn_enter_vr_not].x , get(plugin[get(btnbgname)].childx));
          set(layer[controlBar_roundedbtn_enter_vr_not].y , get(plugin[get(btnbgname)].childy));
          inc(controlBar_roundednbbuttons);
          txtadd(btnbgname, "controlBar_roundedbtnbg", get(controlBar_roundednbbuttons));
      ,
        set(layer[controlBar_roundedbtn_enter_vr].disabled, true);
      );
    );

    if (controlBar_roundednbbuttons LT 6,
      if (device.desktop,
        set(layer[controlBar_roundedbtn_display_help].parent, get(btnbgname));
        set(layer[controlBar_roundedbtn_display_help].x     , get(plugin[get(btnbgname)].childx));
        set(layer[controlBar_roundedbtn_display_help].y     , get(plugin[get(btnbgname)].childy));
        set(layer[controlBar_roundedbtn_close_help  ].parent, get(btnbgname));
        set(layer[controlBar_roundedbtn_close_help  ].x     , get(plugin[get(btnbgname)].childx));
        set(layer[controlBar_roundedbtn_close_help  ].y     , get(plugin[get(btnbgname)].childy));
        inc(controlBar_roundednbbuttons);
        txtadd(btnbgname, "controlBar_roundedbtnbg", get(controlBar_roundednbbuttons));
      );
    ,
      set(layer[controlBar_roundedbtn_display_help].disabled, true);
      set(layer[controlBar_roundedbtn_close_help].disabled, true);
    );

	

  </action>

<events name="controlBar_roundedStartTourEvents" onTourStart="controlBar_roundedCallOnStartTour();" keep="true" />

<action name="controlBar_roundedCallOnStartTour">
	
	hideTourControls();

</action>




  <layer name="controlBar_roundedmenu_roundcorner_bg"
          keep="true"
          url="%FIRSTXML%/graphics/roundcornerbar/footer.png"
          zorder="1"
          align="bottomright"
          handcursor="false"
          edge="right"
          x="0"
          y="0"
          rotate="180"
          capture="false"
          visible="false" />

  <style name="controlBar_rounded_btn_style"
         keep="true"
         align="bottomright"
         onhover="controlBar_roundedshowMenuTooltip();"
         onout="hideTooltip();"
         zorder="3"
         />

  <style name="controlBar_roundedbtnbgstyle" keep="true" pixelhittest="true" align="bottomright" zorder="2" alpha="0" />

  <layer name="controlBar_roundedbtnbg0" url="%FIRSTXML%/graphics/roundcornerbar/btn_round_corner_1.png" style="controlBar_roundedbtnbgstyle" x="144" y="0"   childx="10" childy="6"  crop="0|0|48|49" onovercrop="0|49|48|49" ondowncrop="0|98|48|49" visible="false" />
  <layer name="controlBar_roundedbtnbg1" url="%FIRSTXML%/graphics/roundcornerbar/btn_round_corner_2.png" style="controlBar_roundedbtnbgstyle" x="129" y="39"  childx="14" childy="10" crop="0|0|56|56" onovercrop="0|56|56|56" ondowncrop="0|112|56|56" visible="false" />
  <layer name="controlBar_roundedbtnbg2" url="%FIRSTXML%/graphics/roundcornerbar/btn_round_corner_3.png" style="controlBar_roundedbtnbgstyle" x="106" y="75"  childx="15" childy="14" crop="0|0|60|60" onovercrop="0|60|60|60" ondowncrop="0|120|60|60" visible="false" /> 
  <layer name="controlBar_roundedbtnbg3" url="%FIRSTXML%/graphics/roundcornerbar/btn_round_corner_4.png" style="controlBar_roundedbtnbgstyle" x="75"  y="106" childx="14" childy="15" crop="0|0|60|60" onovercrop="0|60|60|60" ondowncrop="0|120|60|60" visible="false" />
  <layer name="controlBar_roundedbtnbg4" url="%FIRSTXML%/graphics/roundcornerbar/btn_round_corner_5.png" style="controlBar_roundedbtnbgstyle" x="39"  y="129" childx="10" childy="14" crop="0|0|56|56" onovercrop="0|56|56|56" ondowncrop="0|112|56|56" visible="false" />
  <layer name="controlBar_roundedbtnbg5" url="%FIRSTXML%/graphics/roundcornerbar/btn_round_corner_6.png" style="controlBar_roundedbtnbgstyle" x="0"   y="144" childx="6"  childy="10" crop="0|0|48|48" onovercrop="0|48|48|48" ondowncrop="0|96|48|48" visible="false" />

  <layer name="controlBar_roundedbtn_home"
         url="%FIRSTXML%/graphics/roundcornerbar/btn_home.png"
         style="controlBar_rounded_btn_style"
         visible="false"
         onclick="controlBar_roundedbtn_home_action();"
         tooltip="controlBar_roundedhomeTip"
         />
    <action name="controlBar_roundedbtn_home_action">
      mainloadscene(pano10);
    </action>




  <layer name="controlBar_roundedbtn_sound_on"
          url="%FIRSTXML%/graphics/roundcornerbar/btn_start_sound.png"
          onclick="playTourSounds();
"
          style="controlBar_rounded_btn_style"
          visible="false"
          tooltip="controlBar_roundedsoundsOnTip"
          />
  <layer name="controlBar_roundedbtn_sound_off"
          url="%FIRSTXML%/graphics/roundcornerbar/btn_stop_sound.png"
          onclick="stopTourSounds();
"
          style="controlBar_rounded_btn_style"
          visible="false"
          tooltip="controlBar_roundedsoundsOffTip"
          />

  <events name="controlBar_roundedplaystopsoundsevent" playtoursoundsevent="controlBar_roundedupdateSoundButtons();" stoptoursoundsevent="controlBar_roundedupdateSoundButtons();" keep="true"/>
	<action name="controlBar_roundedHideSoundButtons">
		set(layer[controlBar_roundedbtn_sound_off].visible, false);
		set(layer[controlBar_roundedbtn_sound_on].visible , false);
	</action>
	<action name="controlBar_roundedShowSoundButtons">
		if (tour_soundson == false,
			set(layer[controlBar_roundedbtn_sound_off].visible, false);
			set(layer[controlBar_roundedbtn_sound_on].visible , true);
		,
			set(layer[controlBar_roundedbtn_sound_off].visible, true);
			set(layer[controlBar_roundedbtn_sound_on].visible , false);
		);
	</action>
	<action name="controlBar_roundedupdateSoundButtons">
		if (tour_displaycontrols,
			controlBar_roundedShowSoundButtons();
		,
			controlBar_roundedHideSoundButtons();
		);
	</action>


  <events name="controlBar_roundedhotspotsdisplayevents"
          hotspots_visibility_changed="controlBar_roundedupdateHideShowHotspotsButtons"
          keep="true"/>
	<action name="controlBar_roundedHideHideShowHotspotsButtons">
		set(layer[controlBar_roundedbtn_show_hotspots].visible, false);
		set(layer[controlBar_roundedbtn_hide_hotspots].visible, false);
	</action>
	<action name="controlBar_roundedShowHideShowHotspotsButtons">
		if (tour_displayspots,
			set(layer[controlBar_roundedbtn_hide_hotspots].visible, true);
			set(layer[controlBar_roundedbtn_show_hotspots].visible, false);
		,
			set(layer[controlBar_roundedbtn_show_hotspots].visible, true);
			set(layer[controlBar_roundedbtn_hide_hotspots].visible, false);
		);
	</action>
	<action name="controlBar_roundedupdateHideShowHotspotsButtons">
		if (tour_displaycontrols,
			controlBar_roundedShowHideShowHotspotsButtons();
		,
			controlBar_roundedHideHideShowHotspotsButtons();
		);
	</action>

  <layer name="controlBar_roundedbtn_hide_hotspots"
          url="%FIRSTXML%/graphics/roundcornerbar/btn_hide_show_hotspots.png"
          style="controlBar_rounded_btn_style"
          onclick="hideHotspots();
"
          tooltip="controlBar_roundedhideSpotsTip"
          visible="false"
          />
  <layer name="controlBar_roundedbtn_show_hotspots"
          url="%FIRSTXML%/graphics/roundcornerbar/btn_hide_show_hotspots.png"
          style="controlBar_rounded_btn_style"
          onclick="showHotspots();
"
          tooltip="controlBar_roundedshowSpotsTip"
          visible="false"
          />


  <layer name="controlBar_roundedbtn_display_floorplan"
          url="%FIRSTXML%/graphics/roundcornerbar/btn_floorplan.png"
          onclick="showFloorplan();
"
          style="controlBar_rounded_btn_style"
          visible="false"
          tooltip="controlBar_roundeddisplayFloorplanTip"
          />
  <layer name="controlBar_roundedbtn_hide_floorplan"
          url="%FIRSTXML%/graphics/roundcornerbar/btn_floorplan.png"
          onclick="hideFloorplan();
"
          style="controlBar_rounded_btn_style"
          visible="false"
          tooltip="controlBar_roundedhideFloorplanTip"
           />

	<events name="controlBar_roundedDisplayFloorPlanEvents" 
		onshowtourfloorplan="controlBar_roundedupdateFloorplanButtons();" 
		onhidetourfloorplan="controlBar_roundedupdateFloorplanButtons();" 
		keep="true" />
	<action name="controlBar_roundedHideFloorplanButtons">
		set(layer[controlBar_roundedbtn_display_floorplan].visible, false);
		set(layer[controlBar_roundedbtn_hide_floorplan].visible, false);
	</action>
	<action name="controlBar_roundedShowFloorplanButtons">
		if (tour_displayfloorplan,
			set(layer[controlBar_roundedbtn_hide_floorplan].visible, true);
			set(layer[controlBar_roundedbtn_display_floorplan].visible, false);
		,
			set(layer[controlBar_roundedbtn_display_floorplan].visible, true);
			set(layer[controlBar_roundedbtn_hide_floorplan].visible, false);
		);
	</action>
	<action name="controlBar_roundedupdateFloorplanButtons">
		if (tour_displaycontrols,
			controlBar_roundedShowFloorplanButtons();
		,
			controlBar_roundedHideFloorplanButtons();
		);
	</action>


  <layer name="controlBar_roundedbtn_autorotate_on"
          url="%FIRSTXML%/graphics/roundcornerbar/btn_start_autorotation.png"
          onclick="resumeautorotation();
"
          style="controlBar_rounded_btn_style"
          visible="false"
          tooltip="controlBar_roundedautorotateOnTip"
          />
  <layer name="controlBar_roundedbtn_autorotate_off"
          url="%FIRSTXML%/graphics/roundcornerbar/btn_stop_autorotation.png"
          onclick="pauseautorotation();
"
          style="controlBar_rounded_btn_style"
          visible="false"
          tooltip="controlBar_roundedautorotateOffTip"
          />

	<events name="controlBar_roundedAutorotationEvents"
		onstartautorotation="controlBar_roundedupdateAutorotationButtons();"
		onresumeautorotation="controlBar_roundedupdateAutorotationButtons();"
		onstopautorotation="controlBar_roundedupdateAutorotationButtons();"
		onpauseautorotation="controlBar_roundedupdateAutorotationButtons();"
		keep="true"/>
	<action name="controlBar_roundedHideAutorotationButtons">
		set(layer[controlBar_roundedbtn_autorotate_off].visible, false);
		set(layer[controlBar_roundedbtn_autorotate_on].visible , false);
	</action>
	<action name="controlBar_roundedShowAutorotationButtons">
		if(autorotate.enabled == false,
			set(layer[controlBar_roundedbtn_autorotate_off].visible, false);
			set(layer[controlBar_roundedbtn_autorotate_on].visible , true);
		,
			set(layer[controlBar_roundedbtn_autorotate_off].visible, true);
			set(layer[controlBar_roundedbtn_autorotate_on].visible , false);
		);
	</action>
	<action name="controlBar_roundedupdateAutorotationButtons">
		if (tour_displaycontrols,
			controlBar_roundedShowAutorotationButtons();
		,
			controlBar_roundedHideAutorotationButtons();
		);
	</action>


  <layer name="controlBar_roundedbtn_enter_vr"
          url="%FIRSTXML%/graphics/roundcornerbar/btn_vr_mode.png"
          onclick="js(accessWebVr());
"
          style="controlBar_rounded_btn_style"
          visible="false"
          devices="html5.and.mobile"
          tooltip="controlBar_roundedenterVRTip"
          />
    <layer name="controlBar_roundedbtn_enter_vr_not"
          url="%FIRSTXML%/graphics/roundcornerbar/btn_vr_mode_off.png"
          style="controlBar_rounded_btn_style"
          tooltip="controlBar_roundedenterVRNotTip"
          enabled="true"
          capture="false"
          visible="false"
          devices="html5.and.mobile"
          />
<events name="controlBar_roundedvravailableevent"
		onvravailable="controlBar_roundedupdateVrButtonsAvailability();"
		onvrunavailable="controlBar_roundedupdateVrButtonsAvailability();"
		keep="true" devices="html5.and.mobile" />
	<krpano controlBar_roundedmenuvravailable="false" />
	<action name="controlBar_roundedupdateVrButtonsAvailability">
		if (tour_vrdevices,
			set(controlBar_roundedmenuvravailable, true);
		,
			set(controlBar_roundedmenuvravailable, false);
		);
		controlBar_roundedupdateVrButtons();
	</action>
	<action name="controlBar_roundedHideVrButtons">
		set(layer[controlBar_roundedbtn_enter_vr].visible, false);
		if('%1' == 'true' AND plugin[ptpvrmode],
			set(layer[controlBar_roundedbtn_enter_vr_not].visible, true);
		,
			set(layer[controlBar_roundedbtn_enter_vr_not].visible, false);
		);
	</action>
	<action name="controlBar_roundedShowVrButtons">
		if (controlBar_roundedmenuvravailable,
			set(layer[controlBar_roundedbtn_enter_vr].visible, true);
			set(layer[controlBar_roundedbtn_enter_vr_not].visible, false);
		,
			controlBar_roundedHideVrButtons(true);
		);
	</action>
	<action name="controlBar_roundedupdateVrButtons">
	if (tour_vrdevices,
		if (tour_displaycontrols,
			controlBar_roundedShowVrButtons();
		,
			controlBar_roundedHideVrButtons();
		);
	,
		if (tour_displaycontrols,
			controlBar_roundedHideVrButtons(true);
		,
			controlBar_roundedHideVrButtons();
		);
	);
	</action>


  <events name="controlBar_roundedcontrolmodechangeevent"
          oncontrolmodechanged="controlBar_roundedupdateControlModeButtons();"
          keep="true"/>
	<action name="controlBar_roundedHideControlModeButtons">
		set(layer[controlBar_roundedbtn_ctrlmode_move_to].visible, false);
		set(layer[controlBar_roundedbtn_ctrlmode_drag_to].visible, false);
	</action>
	<action name="controlBar_roundedShowControlModeButtons">
		if (tour_controlmodemousetype == "moveto",
			set(layer[controlBar_roundedbtn_ctrlmode_drag_to].visible, true);
			set(layer[controlBar_roundedbtn_ctrlmode_move_to].visible, false);
		,
			set(layer[controlBar_roundedbtn_ctrlmode_move_to].visible, true);
			set(layer[controlBar_roundedbtn_ctrlmode_drag_to].visible, false);
		);
	</action>
	<action name="controlBar_roundedupdateControlModeButtons">
	if (device.desktop,
		if (tour_displaycontrols,
			controlBar_roundedShowControlModeButtons();
		,
			controlBar_roundedHideControlModeButtons();
		);
	,
		controlBar_roundedHideControlModeButtons();
	);
	</action>
  <layer name="controlBar_roundedbtn_ctrlmode_move_to"
          url="%FIRSTXML%/graphics/roundcornerbar/btn_move_to.png"
          style="controlBar_rounded_btn_style"
          tooltip="controlBar_roundedctrlmodeMoveTip"
          onclick="setControlMode(moveto);"
          visible="false"
          devices="desktop"
          />
  <layer name="controlBar_roundedbtn_ctrlmode_drag_to"
          url="%FIRSTXML%/graphics/roundcornerbar/btn_drag_to.png"
          style="controlBar_rounded_btn_style"
          tooltip="controlBar_roundedctrlmodeDragTip"
          onclick="setControlMode(drag);"
          visible="false"
          devices="desktop"
          />

    <layer name="controlBar_roundedbtn_display_help"
            url="%FIRSTXML%/graphics/roundcornerbar/btn_help.png"
            onclick="controlBar_roundeddisplayHelp();"
            style="controlBar_rounded_btn_style"
            visible="false"
            tooltip="controlBar_roundeddisplayHelpTip"
            devices="desktop"
            />
    <layer name="controlBar_roundedbtn_close_help"
            url="%FIRSTXML%/graphics/roundcornerbar/btn_help.png"
            onclick="controlBar_roundedcloseHelp();"
            style="controlBar_rounded_btn_style"
            tooltip="controlBar_roundedhideHelpTip"
            devices="desktop"
            visible="false"
            />




  <style name="controlBar_roundedroundcorner_btn_nav_style"
         keep="true"
         pixelhittest="true"
         onhover="controlBar_roundedshowMenuTooltip();"
         onout="hideTooltip();"
         />

  
  <layer name="controlBar_roundedmenu_navigation_bg"
          keep="true"
          type="container"
          zorder="2"
          align="bottomright"
          edge="bottomright"
          x="10"
          y="10"
          width="102"
          height="102"
          visible="true"
          capture="false">

    <layer name="controlBar_roundedbtn_in"
         zorder="1"
            url="%FIRSTXML%/graphics/roundcornerbar/btn_zoom_in.png"
            style="controlBar_roundedroundcorner_btn_nav_style"
            crop="0|0|66|33"
            onovercrop="0|33|66|33"
            ondown="viewControlZoomIn(false);"
            onup="viewControlZoomStop();
"
            x="0" y="0"
            edge="bottom"
            align="center"
            visible="false"
            tooltip="controlBar_roundedzoomInTip"
             />
    <layer name="controlBar_roundedbtn_out"
         zorder="1"
            url="%FIRSTXML%/graphics/roundcornerbar/btn_zoom_out.png"
            style="controlBar_roundedroundcorner_btn_nav_style"
            crop="0|0|66|33"
            onovercrop="0|33|66|33"
            ondown="viewControlZoomOut(false);
"
            onup="viewControlZoomStop();
"
            x="0" y="0"
            edge="top"
            align="center"
            visible="false"
            tooltip="controlBar_roundedzoomOutTip"
             />

    <layer name="controlBar_roundedbtn_left"
           zorder="0"
           ondown="viewControlMoveLeft(false);
"
           onup="viewControlMoveHoriStop();
"
            url="%FIRSTXML%/graphics/roundcornerbar/btn_move_left.png"
            style="controlBar_roundedroundcorner_btn_nav_style"
            crop="0|0|29|74"
            onovercrop="0|74|29|74"
            x="0" y="0"
            edge="left"
            align="left"
            visible="false"
            tooltip="controlBar_roundedmoveLeftTip"
            />
    <layer name="controlBar_roundedbtn_right"
           zorder="0"
           ondown="viewControlMoveRight(false);
"
           onup="viewControlMoveHoriStop();
"
           url="%FIRSTXML%/graphics/roundcornerbar/btn_move_right.png"
           style="controlBar_roundedroundcorner_btn_nav_style"
           crop="0|0|29|74"
           onovercrop="0|74|29|74"
           x="0" y="0"
           edge="right"
           align="right"
           visible="false"
           tooltip="controlBar_roundedmoveRightTip"
           />

    <layer name="controlBar_roundedbtn_up"
           zorder="0"
           ondown="viewControlMoveUp(false);
"
           onup="viewControlMoveVertStop();
"
           url="%FIRSTXML%/graphics/roundcornerbar/btn_move_up.png"
           style="controlBar_roundedroundcorner_btn_nav_style"
           crop="0|0|74|29"
           onovercrop="0|29|74|29"
           x="0" y="0"
           align="top"
           edge="top"
           visible="false"
           tooltip="controlBar_roundedmoveUpTip"
           />
    <layer name="controlBar_roundedbtn_down"
           zorder="0"
           ondown="viewControlMoveDown(false);
"
           onup="viewControlMoveVertStop();
"
           url="%FIRSTXML%/graphics/roundcornerbar/btn_move_down.png"
           style="controlBar_roundedroundcorner_btn_nav_style"
           crop="0|0|74|29"
           onovercrop="0|29|74|29"
           x="0" y="0"
           edge="bottom"
           align="bottom"
           visible="false"
           tooltip="controlBar_roundedmoveDownTip"
           />

    <layer name="controlBar_roundedbtn_hidecontrols"
           onclick="hideTourControls();
"
           x="0" y="0"
           keep="true"
           zorder="2"
           url="%FIRSTXML%/graphics/roundcornerbar/btn_hide_controls.png"
                 crop="0| 0|28|28"
           onovercrop="0|28|28|28"
           ondowncrop="0|56|28|28"
           style="controlBar_roundedroundcorner_btn_nav_style"
           edge="center"
           align="center"
           height="28"
           width="28"
           visible="false"
           tooltip="controlBar_roundedhideControlsTip"
           />
    <layer name="controlBar_roundedbtn_showcontrols"
           onclick="showTourControls();
"
           x="0" y="0"
           keep="true"
           zorder="2"
           url="%FIRSTXML%/graphics/roundcornerbar/btn_show_controls.png"
                 crop="0| 0|28|28"
           onovercrop="0|28|28|28"
           ondowncrop="0|56|28|28"
           style="controlBar_roundedroundcorner_btn_nav_style"
           edge="center"
           align="center"
           visible="false"
           height="28"
           width="28"
           tooltip="controlBar_roundeddisplayControlsTip"
           />
  </layer>

  <style name="controlBar_roundedbtn_fs_bg_style" keep="true"
         url="%FIRSTXML%/graphics/roundcornerbar/btn_fs_bg.png"
         align="topright"
         zorder="1"
         x="0" y="0"
         crop="      0|  0|50|50"
         onovercrop="0| 50|50|50"
         ondowncrop="0|100|50|50"
         onhover="controlBar_roundedshowMenuTooltip();"
         onout="hideTooltip();"
         />
  <style name="controlBar_roundedbtn_fs_style" keep="true" align="topright"
         devices="fullscreensupport"
         x="5" y="5"
         onhover="controlBar_roundedshowMenuTooltip();"
         onout="hideTooltip();"
         />
  <layer name="controlBar_roundedbtn_openfs_bg"
         style="controlBar_roundedbtn_fs_bg_style"
         onclick="enterFullscreen();
"
         visible="false"
         devices="fullscreensupport"
         alpha="0"
         tooltip="controlBar_roundedopenFsTip"
          >
    <layer name="controlBar_roundedbtn_openfs"
           style="controlBar_roundedbtn_fs_style"
           url="%FIRSTXML%/graphics/roundcornerbar/btn_enter_fs.png"
           onclick="enterFullscreen();
"
           tooltip="controlBar_roundedopenFsTip"
           />
  </layer>

  <layer name="controlBar_roundedbtn_closefs_bg"
          style="controlBar_roundedbtn_fs_bg_style"
          visible="false"
          alpha="0"
          devices="fullscreensupport"
          onclick="exitFullscreen();
"
          tooltip="controlBar_roundedcloseFsTip"
         onhover="controlBar_roundedshowMenuTooltip();"
         onout="hideTooltip();"
          >
    <layer name="controlBar_roundedbtn_closefs"
           style="controlBar_roundedbtn_fs_style"
           url="%FIRSTXML%/graphics/roundcornerbar/btn_close_fs.png"
           onclick="exitFullscreen();
"
           tooltip="controlBar_roundedcloseFsTip"
          />
  </layer>

  <events name="controlBar_roundedmenufullscreenchangeevent"
          onenterfullscreen="controlBar_roundedupdateFullscreenButtons();"
          onexitfullscreen="controlBar_roundedupdateFullscreenButtons();"
          keep="true"/>
	<action name="controlBar_roundedHideFullscreenButtons">
		tween(layer[controlBar_roundedbtn_openfs_bg].alpha, 0, 0.5, easeOutQuad, set(layer[controlBar_roundedbtn_openfs_bg].visible , false));
		tween(layer[controlBar_roundedbtn_closefs_bg].alpha, 0, 0.5, easeOutQuad, set(layer[controlBar_roundedbtn_closefs_bg].visible , false));
	</action>
	<action name="controlBar_roundedShowFullscreenButtons">
		if (device.fullscreensupport,
			if(tour_fullscreen,
				if(layer[controlBar_roundedbtn_openfs_bg].visible,
					set(layer[controlBar_roundedbtn_openfs_bg].visible , false);
					set(layer[controlBar_roundedbtn_closefs_bg].visible, true);
				,
					set(layer[controlBar_roundedbtn_openfs_bg].visible , false);
					set(layer[controlBar_roundedbtn_closefs_bg].visible, true);
					tween(layer[controlBar_roundedbtn_openfs_bg].alpha, 1, 0.5);
					tween(layer[controlBar_roundedbtn_closefs_bg].alpha, 1, 0.5);
				);
			,
				if(layer[controlBar_roundedbtn_closefs_bg].visible,
					set(layer[controlBar_roundedbtn_openfs_bg].visible ,true);
					set(layer[controlBar_roundedbtn_closefs_bg].visible,false);
				,
					set(layer[controlBar_roundedbtn_openfs_bg].visible , true);
					set(layer[controlBar_roundedbtn_closefs_bg].visible, false);
					tween(layer[controlBar_roundedbtn_openfs_bg].alpha, 1, 0.5);
					tween(layer[controlBar_roundedbtn_closefs_bg].alpha, 1, 0.5);
				);
			);
		,
			controlBar_roundedHideFullscreenButtons();
		);
	</action>
	<action name="controlBar_roundedupdateFullscreenButtons">
		if (tour_displaycontrols,
			controlBar_roundedShowFullscreenButtons();
		,
			controlBar_roundedHideFullscreenButtons();
		);
	</action>




  <events name="controlBar_roundedmenuhideshowcontrolsevent"
          hidetourcontrols="controlBar_roundedhideMenuControls();"
          showtourcontrols="controlBar_roundedshowMenuControls();"
          keep="true"/>


  <action name="controlBar_roundedhideMenuControls">
    set(controlBar_roundedIsOpened, false);
    if (controlBar_roundednbbuttons GT 0,
      stoptween(layer[controlBar_roundedmenu_roundcorner_bg].rotate);
      stoptween(layer[controlBar_roundedbtnbg0].alpha);
      stoptween(layer[controlBar_roundedbtnbg1].alpha);
      stoptween(layer[controlBar_roundedbtnbg2].alpha);
      stoptween(layer[controlBar_roundedbtnbg3].alpha);
      stoptween(layer[controlBar_roundedbtnbg4].alpha);
      stoptween(layer[controlBar_roundedbtnbg5].alpha);

      tween(layer[controlBar_roundedbtnbg0].alpha, 0, 0.5, easeOutQuad, set(layer[controlBar_roundedbtnbg0].visible, false));
      tween(layer[controlBar_roundedbtnbg1].alpha, 0, 0.5, easeOutQuad, set(layer[controlBar_roundedbtnbg1].visible, false));
      tween(layer[controlBar_roundedbtnbg2].alpha, 0, 0.5, easeOutQuad, set(layer[controlBar_roundedbtnbg2].visible, false));
      tween(layer[controlBar_roundedbtnbg3].alpha, 0, 0.5, easeOutQuad, set(layer[controlBar_roundedbtnbg3].visible, false));
      tween(layer[controlBar_roundedbtnbg4].alpha, 0, 0.5, easeOutQuad, set(layer[controlBar_roundedbtnbg4].visible, false));
      tween(layer[controlBar_roundedbtnbg5].alpha, 0, 0.5, easeOutQuad, set(layer[controlBar_roundedbtnbg5].visible, false));
    );

      set(layer[controlBar_roundedbtn_showcontrols].visible, true);
      set(layer[controlBar_roundedbtn_hidecontrols].visible, false);
      set(layer[controlBar_roundedbtn_in].visible, false);
      set(layer[controlBar_roundedbtn_out].visible, false);
      set(layer[controlBar_roundedbtn_up].visible, false);
      set(layer[controlBar_roundedbtn_down].visible, false);
      set(layer[controlBar_roundedbtn_left].visible, false);
      set(layer[controlBar_roundedbtn_right].visible, false);
      ifnot(layer[controlBar_roundedbtn_home].disabled,set(layer[controlBar_roundedbtn_home].visible, false););

    controlBar_roundedupdateFullscreenButtons();
	ifnot(layer[controlBar_roundedbtn_autorotate_on].disabled,controlBar_roundedupdateAutorotationButtons(););

	ifnot(layer[controlBar_roundedbtn_sound_on].disabled,controlBar_roundedupdateSoundButtons(););
	ifnot(layer[controlBar_roundedbtn_display_floorplan].disabled,controlBar_roundedupdateFloorplanButtons(););
	if(layer[controlBar_roundedbtn_enter_vr],ifnot(layer[controlBar_roundedbtn_enter_vr].disabled,controlBar_roundedupdateVrButtons();););

	ifnot(layer[controlBar_roundedbtn_ctrlmode_drag_to].disabled,controlBar_roundedupdateControlModeButtons(););
	ifnot(layer[controlBar_roundedbtn_show_hotspots].disabled,controlBar_roundedupdateHideShowHotspotsButtons(););

	ifnot(layer[controlBar_roundedbtn_display_help].disabled,controlBar_roundedupdateHelpButtons(););

    if (controlBar_roundednbbuttons GT 0,
      tween(layer[controlBar_roundedmenu_roundcorner_bg].rotate, 180, 0.5, easeOutQuad, set(layer[controlBar_roundedmenu_roundcorner_bg].visible, false););
    );
  </action>
  <action name="controlBar_roundedshowMenuControls">
    set(controlBar_roundedIsOpened, true);
    if (controlBar_roundednbbuttons GT 0,
      stoptween(layer[controlBar_roundedmenu_roundcorner_bg].rotate);
      stoptween(layer[controlBar_roundedbtnbg0].alpha);
      stoptween(layer[controlBar_roundedbtnbg1].alpha);
      stoptween(layer[controlBar_roundedbtnbg2].alpha);
      stoptween(layer[controlBar_roundedbtnbg3].alpha);
      stoptween(layer[controlBar_roundedbtnbg4].alpha);
      stoptween(layer[controlBar_roundedbtnbg5].alpha);
    );

      set(layer[controlBar_roundedbtn_hidecontrols].visible, true);
      set(layer[controlBar_roundedbtn_showcontrols].visible, false);


    set(layer[controlBar_roundedmenu_roundcorner_bg].visible, true);
    tween(layer[controlBar_roundedmenu_roundcorner_bg].rotate, 0, 0.5, easeOutQuad,

      if (controlBar_roundednbbuttons GT 0,
        set(  layer[controlBar_roundedbtnbg0].visible, true);
        tween(layer[controlBar_roundedbtnbg0].alpha  , 1, 0.5);
        set(  layer[controlBar_roundedbtnbg1].visible, true);
        tween(layer[controlBar_roundedbtnbg1].alpha  , 1, 0.5);
        set(  layer[controlBar_roundedbtnbg2].visible, true);
        tween(layer[controlBar_roundedbtnbg2].alpha  , 1, 0.5);
        set(  layer[controlBar_roundedbtnbg3].visible, true);
        tween(layer[controlBar_roundedbtnbg3].alpha  , 1, 0.5);
        set(  layer[controlBar_roundedbtnbg4].visible, true);
        tween(layer[controlBar_roundedbtnbg4].alpha  , 1, 0.5);
        set(  layer[controlBar_roundedbtnbg5].visible, true);
        tween(layer[controlBar_roundedbtnbg5].alpha  , 1, 0.5);
      );

      set(layer[controlBar_roundedbtn_in].visible, true);
      set(layer[controlBar_roundedbtn_out].visible, true);
      set(layer[controlBar_roundedbtn_up].visible, true);
      set(layer[controlBar_roundedbtn_down].visible, true);
      set(layer[controlBar_roundedbtn_left].visible, true);
      set(layer[controlBar_roundedbtn_right].visible, true);
      ifnot(layer[controlBar_roundedbtn_home].disabled,set(layer[controlBar_roundedbtn_home].visible, true););

      controlBar_roundedupdateFullscreenButtons();
	ifnot(layer[controlBar_roundedbtn_autorotate_on].disabled,controlBar_roundedupdateAutorotationButtons(););

	ifnot(layer[controlBar_roundedbtn_sound_on].disabled,controlBar_roundedupdateSoundButtons(););
	ifnot(layer[controlBar_roundedbtn_display_floorplan].disabled,controlBar_roundedupdateFloorplanButtons(););
	if(layer[controlBar_roundedbtn_enter_vr],ifnot(layer[controlBar_roundedbtn_enter_vr].disabled,controlBar_roundedupdateVrButtons();););

	ifnot(layer[controlBar_roundedbtn_ctrlmode_drag_to].disabled,controlBar_roundedupdateControlModeButtons(););
	ifnot(layer[controlBar_roundedbtn_show_hotspots].disabled,controlBar_roundedupdateHideShowHotspotsButtons(););

	ifnot(layer[controlBar_roundedbtn_display_help].disabled,controlBar_roundedupdateHelpButtons(););
    );
  </action>


  <layer name="controlBar_roundedhelpScreenBg"
          url="%FIRSTXML%/graphics/roundcornerbar/help_screen_bg.png"
          keep="true"
          align="bottomright"
          x="0"
          y="0"
          rotate="-90"
          zorder="97"
          onclick="controlBar_roundedcloseHelp();"
          visible="false"
          >
  <layer name="controlBar_roundedhelpScreen" 
          keep="true"
          align="center"
          x="0"
          y="0"
          displayed="false"
          onclick="controlBar_roundedcloseHelp();"
         url="%FIRSTXML%/graphics/roundcornerbar/help_screen.png" 
         zorder="0"
         />
  <layer name="controlBar_roundedbtnCloseHelpScreen"
          url="%FIRSTXML%/graphics/roundcornerbar/btn_close_window.png"
          keep="true"
          align="topright"
          onclick="controlBar_roundedcloseHelp();"
          tooltip="controlBar_roundedhideHelpTip"
          onhover="controlBar_roundedshowMenuTooltip();"
          onout="hideTooltip();"
          x="100"
          y="10"
          zorder="1"
           />
  </layer>
  <action name="controlBar_roundeddisplayHelp">
	if (device.desktop,
		set(layer[controlBar_roundedhelpScreen].displayed, true);

	

		controlBar_roundedupdateHelpButtons();
	);
  </action>
  <action name="controlBar_roundedcloseHelp">
	if (device.desktop,
		set(layer[controlBar_roundedhelpScreen].displayed, false);
		controlBar_roundedupdateHelpButtons();
		

	

	);
  </action>
	<action name="controlBar_roundedHideHelpButtons">
		set(layer[controlBar_roundedbtn_display_help].visible, false);
		set(layer[controlBar_roundedbtn_close_help].visible, false);
		ifnot(layer[controlBar_roundedhelpScreenBg].rotate == -90,
			tween(layer[controlBar_roundedhelpScreenBg].rotate, -90, 0.7, easeOutQuad, set(layer[controlBar_roundedhelpScreenBg].visible, false););
		);
	</action>
	<action name="controlBar_roundedShowHelpButtons">
		if (layer[controlBar_roundedhelpScreen].displayed,
			set(layer[controlBar_roundedbtn_close_help].visible, true);
			set(layer[controlBar_roundedbtn_display_help].visible, false);
			set(layer[controlBar_roundedhelpScreenBg].visible, true);
			ifnot(layer[controlBar_roundedhelpScreenBg].rotate == 0,
				tween(layer[controlBar_roundedhelpScreenBg].rotate, 0, 0.7);
			);
		,
			set(layer[controlBar_roundedbtn_display_help].visible, true);
			set(layer[controlBar_roundedbtn_close_help].visible, false);
			ifnot(layer[controlBar_roundedhelpScreenBg].rotate == -90,
				tween(layer[controlBar_roundedhelpScreenBg].rotate, -90, 0.7, easeOutQuad, set(layer[controlBar_roundedhelpScreenBg].visible, false););
			);
		);
	</action>
	<action name="controlBar_roundedupdateHelpButtons">
	if (device.desktop,
		if (tour_displaycontrols,
			controlBar_roundedShowHelpButtons();
		,
			controlBar_roundedHideHelpButtons();
		);
	,
		controlBar_roundedHideHelpButtons();
	);
	</action>





  <action name="controlBar_roundedshowMenuTooltip">
    if (tooltip !== null,
      getmessage(tooltipmess, get(tooltip));
      showTooltip('plugin', controlBar_roundedmenuTooltipStyle, bottomright);
    );
  </action>

  <layer name="controlBar_roundedmenuTooltipStyle"
	keep="true"
	enabled="false"
	capture="false"
	url="%FIRSTXML%/graphics/textfield.swf"
	align="center"
	background="true"
	backgroundcolor="0x9b9b9b"
	backgroundalpha="0.80000000000000004"
	border="false"
	css="color:#000000;font-family:Arial;font-weight:bold;font-size:14px;text-align:left;"
	height="20"
	autoheight="true"
	autowidth="auto"
	edge="bottomright"
	selectable="false"
	zorder="0"
	padding="2"
	xoffset="0"
	yoffset="0"
	visible="false"
	html=""
         />


<!-- ********* -->
<!-- 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,
        
        switch(plugin[gyroscope].enabled);
        set(plugin[gyroscope].activated,true);
        
        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>

<!-- ********** -->
<!-- Floor plan -->
<!-- id : floorPlan -->
<!-- ********** -->

	<ptplugin name="floorPlan" engine="KolorFloorPlan">
		<settings>
			<option name="background_color" value="ffffff" type="string" />
			<option name="background_lighter_color" value="ffffff" type="string" />
			<option name="background_darker_color" value="d5d5d5" type="string" />
			<option name="background_alpha" value="0.50000762951094835" type="float" />
			<option name="text_color" value="000000" type="string" />
			<option name="resize" value="true" type="bool" />
			<option name="fp_selector" value="one" type="string" />
			<option name="fp_selector_label" value="floorPlanmenu_label" type="string" />
			<option name="display_title" value="true" type="bool" />
			<option name="title" value="project_floor_title" type="string" />
			<option name="title_font" value="Verdana" type="string" />
			<option name="title_size" value="18" type="int" />
			<option name="title_weight" value="bold" type="string" />
			<option name="title_decoration" value="normal" type="string" />
			<option name="title_color" value="ffa148" type="string" />
			<option name="display_orientation" value="false" type="bool" />
			<option name="display_radar" value="false" type="bool" />
			<option name="selected_effect" value="pulsate" type="string" />
			<option name="close_on_click" value="false" type="bool" />
			<option name="position" value="center" type="string" />
			<option name="zorder" value="5" type="int" />
			<option name="use_i18n" value="true" type="bool" />
		</settings>
		
		<floorplanItems selectedItem="fpitemmain" selectedSpot="" selectedSpotScene="" selectedSpotHeading="" selectedSpotFov="">
				
				<floorplanItem 
					name="fpitemmain" 
					width="2223" 
					height="1524" 
					groupName="" 
					url="floorplan/floorplan3b.jpg" 
					title="project_floor_title"
					heading="0">
							<spot name="spotmap65" posX="0.239825994" posY="0.413136005" heading="0" desc="spotmap65_tooltip" descType="tooltip" groupName="" isScene="true" planar="false" scene="pano13" jsClick="spotmap65ActionSpotFloorPlan">
								<icon url="spots/hotspot_image_user_defaultmap0.png" iconWidth="32" iconHeight="32" iconAnchor="center" />
							</spot>
							<spot name="spotmap66" posX="0.50436002" posY="0.512712002" heading="0" desc="spotmap66_tooltip" descType="tooltip" groupName="" isScene="true" planar="false" scene="pano10" jsClick="spotmap66ActionSpotFloorPlan">
								<icon url="spots/hotspot_image_user_defaultmap0.png" iconWidth="32" iconHeight="32" iconAnchor="center" />
							</spot>
							<spot name="spotmap67" posX="0.678779006" posY="0.466102004" heading="0" desc="spotmap67_tooltip" descType="tooltip" groupName="" isScene="true" planar="false" scene="pano12" jsClick="spotmap67ActionSpotFloorPlan">
								<icon url="spots/hotspot_image_user_defaultmap0.png" iconWidth="32" iconHeight="32" iconAnchor="center" />
							</spot>
							<spot name="spotmap158" posX="0.191860005" posY="0.565678" heading="0" desc="spotmap158_tooltip" descType="tooltip" groupName="" isScene="true" planar="false" scene="pano154" jsClick="spotmap158ActionSpotFloorPlan">
								<icon url="spots/hotspot_image_user_defaultmap0.png" iconWidth="32" iconHeight="32" iconAnchor="center" />
							</spot>
				</floorplanItem>
			
			
		</floorplanItems>
	</ptplugin>
	
	<action name="kolorFloorplanJsReady_floorPlan">
		set(ptplugin[floorPlan].jsready, true);
		
		ifnot(ptplugin[floorPlan].floorplanItems[0].selectedSpot == "",
			set(ptplugin[floorPlan].floorplanItems[0].selectedSpotFov, get(view.hfov));
			js(invokePluginFunction(floorPlan, setKolorFloorPlanSelectedSpotOptions, get(xml.scene), get(view.hlookat), get(view.hfov)));
		);
	</action>
	
	
		<!-- floorplan main spots counter : 4 -->
			<action name="spotmap65ActionSpotFloorPlan">hideTooltip();zoomto(get(panoview.fov),smooth(400,20,100));
          mainloadscene(pano13);lookat(get(panoview.h), get(panoview.v), get(panoview.fov));

</action>
			<action name="spotmap66ActionSpotFloorPlan">hideTooltip();zoomto(get(panoview.fov),smooth(400,20,100));
          mainloadscene(pano10);lookat(get(panoview.h), get(panoview.v), get(panoview.fov));

</action>
			<action name="spotmap67ActionSpotFloorPlan">hideTooltip();zoomto(get(panoview.fov),smooth(400,20,100));
          mainloadscene(pano12);lookat(get(panoview.h), get(panoview.v), get(panoview.fov));

</action>
			<action name="spotmap158ActionSpotFloorPlan">hideTooltip();zoomto(get(panoview.fov),smooth(400,20,100));
          mainloadscene(pano154);lookat(get(panoview.h), get(panoview.v), get(panoview.fov));

</action>
	
	
	
	<events name="floorPlanEvents" 
	onxmlcomplete="ifnot(floorPlanFloorPlanLoaded,set(tour_displayfloorplan,false););floorPlanActivateDefaultSpot();" 
	onhidetourfloorplan="floorPlanCloseTourFloorPlan();" 
	onshowtourfloorplan="if(tour_displayfloorplan,floorPlanOpenTourFloorPlan(););" 
	onTourStart=""
	changetourlanguage="floorPlanChangeLanguage();"
	keep="true" />
	
	<action name="floorPlanChangeLanguage">
		if(ptplugin[floorPlan].jsready,
			stopdelayedcall(delay_floorPlan);
			js(invokePluginFunction(floorPlan, changeLanguage));
			js(invokePluginFunction(floorPlanArea, changeLanguage, false));
		,
			delayedcall(delay_floorPlan, 0.1, floorPlanChangeLanguage(););
		);
	</action>
	
	
	<krpano floorPlanFloorPlanLoaded="false" />
	
	<action name="floorPlanHideTourFloorPlan">
		hideKolorArea_floorPlanArea(true);
	</action>
	
	<action name="floorPlanCloseTourFloorPlan">
		closeKolorArea_floorPlanArea();
	</action>
	
	<action name="floorPlanShowTourFloorPlan">
		if(ptplugin[floorPlanArea].isOpen === null,
			openKolorArea_floorPlanArea();
		,
			showKolorArea_floorPlanArea(true);
		);
	</action>
	
	<action name="floorPlanOpenTourFloorPlan">
		openKolorArea_floorPlanArea();
	</action>
	
	
	<action name="floorPlanActivateSpot">
		
		set(ptplugin[floorPlan].floorplanItems[0].selectedSpot, %1);
		set(ptplugin[floorPlan].floorplanItems[0].selectedItem, %2);
		
		if(%1 !== "",
			set(ptplugin[floorPlan].floorplanItems[0].selectedSpotScene, get(xml.scene));
			set(ptplugin[floorPlan].floorplanItems[0].selectedSpotHeading, get(view.hlookat));
			set(ptplugin[floorPlan].floorplanItems[0].selectedSpotFov, get(view.hfov));
		);
		
		
		if(ptplugin[floorPlanArea].isOpen,
			floorPlanSelectActivatedSpot(%1, %2, %3);
		);
	</action>
	
	<action name="floorPlanSelectActivatedSpot">
		js(invokePluginFunction(floorPlan, selectSpot, %1, %2, %3));

	</action>
	
	<action name="floorPlanDeactivateSpot">
		set(ptplugin[floorPlan].floorplanItems[0].selectedSpot, "");
		
		js(invokePluginFunction(floorPlan, unselectSpot));
	</action>
	
	<action name="floorPlanActivateDefaultSpot">
		set(floorPlanFloorPlanLoaded, true);
		
		set(floorPlanSpotFound, "");
		set(floorPlanSpotScene, "");
		set(floorPlanItemFound, "");
		set(floorPlanItemSearch, true);
		set(floorPlanSpotSearchActivated, true);
		set(floorPlanSpotSearchContinue, true);
		
		
		for(set(defaultfloorplaniteminc,0), defaultfloorplaniteminc LT ptplugin[floorPlan].floorplanItems[0].floorplanItem.count , inc(defaultfloorplaniteminc),
                        if(floorPlanSpotSearchActivated == true,
				
				if(ptplugin[floorPlan].floorplanItems[0].floorplanItem[get(defaultfloorplaniteminc)].groupName == scene[get(xml.scene)].group,
					set(floorPlanItemFound, get(ptplugin[floorPlan].floorplanItems[0].floorplanItem[get(defaultfloorplaniteminc)].name));
					set(ptplugin[floorPlan].floorplanItems[0].selectedItem, get(ptplugin[floorPlan].floorplanItems[0].floorplanItem[get(defaultfloorplaniteminc)].name));
					set(floorPlanItemSearch, false);
				,
					
					if(floorPlanItemFound == "",
						set(floorPlanItemFound, get(ptplugin[floorPlan].floorplanItems[0].floorplanItem[fpitemmain].name));
						set(ptplugin[floorPlan].floorplanItems[0].selectedItem, get(ptplugin[floorPlan].floorplanItems[0].floorplanItem[fpitemmain].name));
					);
				);
			);
			if(floorPlanSpotSearchActivated == true,
                                for(set(defaultspotinc,0), defaultspotinc LT ptplugin[floorPlan].floorplanItems[0].floorplanItem[get(defaultfloorplaniteminc)].spot.count , inc(defaultspotinc),
                                        if(ptplugin[floorPlan].floorplanItems[0].floorplanItem[get(defaultfloorplaniteminc)].spot[get(defaultspotinc)].isScene == true,
					
						if(floorPlanSpotSearchContinue == true,
							if(ptplugin[floorPlan].floorplanItems[0].floorplanItem[get(defaultfloorplaniteminc)].spot[get(defaultspotinc)].scene == xml.scene,
								set(floorPlanSpotFound, get(ptplugin[floorPlan].floorplanItems[0].floorplanItem[get(defaultfloorplaniteminc)].spot[get(defaultspotinc)].name));
								set(floorPlanSpotScene, get(ptplugin[floorPlan].floorplanItems[0].floorplanItem[get(defaultfloorplaniteminc)].spot[get(defaultspotinc)].scene));
								set(ptplugin[floorPlan].floorplanItems[0].selectedItem, get(ptplugin[floorPlan].floorplanItems[0].floorplanItem[get(defaultfloorplaniteminc)].name));
								if(floorPlanItemSearch == false,
									set(floorPlanSpotSearchContinue, false);
									set(floorPlanSpotSearchActivated, false);
								);
							);
						);
					);
					
				);
			);
		);
		
		if(floorPlanSpotFound == "",
			
			
			floorPlanDeactivateSpot();
			
			
			set(ptplugin[floorPlan].floorplanItems[0].selectedItem, get(floorPlanItemFound));
			
			
			ifnot(ptplugin[floorPlan].floorplanItems[0].selectedItem == "",
				floorPlanActivateSpot("", get(ptplugin[floorPlan].floorplanItems[0].selectedItem), "");
			);
		,
			
			floorPlanActivateSpot(get(floorPlanSpotFound), get(ptplugin[floorPlan].floorplanItems[0].selectedItem), get(floorPlanSpotScene));
		);
	</action>
	
	<action name="floorPlanChangeTitle">
		js(invokePluginFunction(floorPlan, changeTitle, %1));
	</action>
	
	<ptplugin name="floorPlanArea" engine="kolorArea">
	<settings>
		<option name="position" value="center" type="string" />
		<option name="start_position" value="top" type="string" />
		<option name="margin_x" value="0" type="int" />
		<option name="margin_y" value="0" type="int" />
		<option name="display_title" value="true" type="bool" />
		<option name="title" value="project_floor_title" type="string" />
		<option name="title_font" value="Verdana" type="string" />
		<option name="title_size" value="18" type="int" />
		<option name="title_weight" value="bold" type="string" />
		<option name="title_decoration" value="normal" type="string" />
		<option name="title_color" value="ffa148" type="string" />
		<option name="close_displayed" value="true" type="bool" />
		<option name="close_text" value="floorPlandisplay_close_text" type="string" />

		<option name="background_color" value="ffffff" type="string" />
		<option name="background_alpha" value="0.50000762951094835" type="float" />
		<option name="overlay_displayed" value="true" type="bool" />
		<option name="overlay_color" value="ffffff" type="string" />
		<option name="overlay_alpha" value="0" type="float" />

		<option name="padding" value="15" type="int" />
		<option name="topleft_radius" value="10" type="int" />
		<option name="topright_radius" value="10" type="int" />
		<option name="bottomleft_radius" value="10" type="int" />
		<option name="bottomright_radius" value="10" type="int" />
		<option name="area_border_width" value="10" type="int" />
		<option name="area_border_color" value="ffffff" type="string" />
		<option name="area_border_alpha" value="0.50000762951094835" type="float" />
		<option name="area_width" value="80" type="int" />
		<option name="area_height" value="80" type="int" />
		<option name="area_width_unit" value="percent" type="string" />
		<option name="area_height_unit" value="percent" type="string" />
		<option name="animation" value="true" type="bool" />
		<option name="animation_duration" value="500" type="int" />
		<option name="close_on_click" value="false" type="bool" />
		<option name="refresh_content" value="false" type="bool" />
		<option name="open_callback" value="addKolorFloorPlan('floorPlan', 'floorPlanArea_floorplanDIV');" type="string" />
		<option name="close_callback" value="invokeKrFunction('closeKolorAreaCallback_floorPlanArea')" type="string" />
		<option name="zorder" value="5" type="int" />
		<option name="use_i18n" value="true" type="bool" />
	</settings>
	</ptplugin>
	
	<action name="kolorAreaJsReady_floorPlanArea">
		set(ptplugin[floorPlanArea].jsready, true);

	</action>
	
	<action name="openKolorArea_floorPlanArea">
		ifnot(ptplugin[floorPlanArea].isOpen,
			set(ptplugin[floorPlanArea].isOpen, true);
			pauseautorotation(forceplugin);

			js(showKolorArea(floorPlanArea, &lt;div id="floorPlanArea_floorplanDIV"&gt;&lt;/div&gt;));
			
			if(ptplugin[floorPlan].floorplanItems[0].selectedSpot != "",
				floorPlanSelectActivatedSpot(get(ptplugin[floorPlan].floorplanItems[0].selectedSpot), get(ptplugin[floorPlan].floorplanItems[0].selectedItem), get(ptplugin[floorPlan].floorplanItems[0].selectedSpotScene));
			);
			events.dispatch(onremovedisplayedobject);
		);
	</action>
	
	<action name="closeKolorArea_floorPlanArea">
		if(ptplugin[floorPlanArea].isOpen,
			js(invokePluginFunction(floorPlanArea, closeKolorArea));
		);
	</action>
	
	<action name="toggleKolorArea_floorPlanArea">
		if(ptplugin[floorPlanArea].isOpen,
			closeKolorArea_floorPlanArea();
		,
			openKolorArea_floorPlanArea();
		);
	</action>
	
	<action name="closeKolorAreaCallback_floorPlanArea">
		if(ptplugin[floorPlanArea].isOpen,resumeautorotation(forceplugin);

			
		);
		set(ptplugin[floorPlanArea].isOpen, false);hideFloorplan();

	</action>
	
	<action name="changeTitleKolorArea_floorPlanArea">
		js(invokePluginFunction(floorPlanArea, changeTitle, %1));
	</action>
	
	<action name="showKolorArea_floorPlanArea">
		set(ptplugin[floorPlanArea].isOpen, true);
		pauseautorotation(forceplugin);

		js(invokePluginFunction(floorPlanArea, showKolorArea, %1));
		events.dispatch(onremovedisplayedobject);
	</action>
		
	<action name="hideKolorArea_floorPlanArea">
		resumeautorotation(forceplugin);

		
		set(ptplugin[floorPlanArea].isOpen, false);
		js(invokePluginFunction(floorPlanArea, hideKolorArea, %1));
	</action>
	
	<events name="kolorAreaEvents_floorPlanArea" 
		keep="true"
		hidetourcontrols="if(ptplugin[floorPlanArea].isOpen,set(restore_floorPlanArea, true);hideKolorArea_floorPlanArea(false);,set(restore_floorPlanArea, false););"
		showtourcontrols="if(tour_displayfloorplan,if(restore_floorPlanArea,showKolorArea_floorPlanArea(false);););"
	/>
	

<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>

	<!-- 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>
  <!-- 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="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>

  <!-- 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>


  <!-- Sounds Management -->
  <plugin name="soundinterface"
          preload="true"
          url="%SWFPATH%/graphics/soundinterface.swf"
          alturl="%FIRSTXML%/graphics/soundinterface.js"
          rootpath="%$videos_sounds_path%/sounds"
          backgroundsound=""
          backgroundsoundloops="0"
          bgsound="false"
          bgsoundpaused="false"
          bgsoundloopended="false"
          volumeinitialized="false"
          started="true"
          keep="true"/>
  <events name="soundmanagementevents"
          onnewpano="if(plugin[soundinterface].started,playbackgroundsound(););"
          onxmlcomplete="soundinterfaceonxmlcomplete();"
          keep="true"/>
  <action name="soundinterfaceonxmlcomplete">
    ifnot(plugin[soundinterface].volumeinitialized,
      div(plugin[soundinterface].volume, tour_soundsvolume, 100);
      set(plugin[soundinterface].volumeinitialized,true);
    );
  </action>
  <action name="playsound3Dwhenpossible">
    set(really_play_sound, true);
    if (tour_current_played_sound,
      if (%1 == tour_current_played_sound,
        delete(tour_current_played_sound);
        set(tour_current_played_sound_state, 0);
        delete(tour_current_played_sound_paused);
        stopsound(%1);
        set(really_play_sound, false);
        if(%4,
          delete(tour_current_played_sound_pausesound);
          resumeTourSoundsActions(true,true,true,true,true);
        );
      );
    );
    if (really_play_sound,
      if (tour_current_played_sound,
        stopsound(get(tour_current_played_sound));

        ifnot(%4,
          if(tour_current_played_sound_pausesound,
            delete(tour_current_played_sound_pausesound);
            resumeTourSoundsActions(true,true,true,true,true);
          );
        );
      );
      if(%4,
        set(tour_current_played_sound_pausesound, true);
        pauseTourSoundsActions(true,false,true,true,true);
      );
      set(tour_current_played_sound, %1);
      if(tour_current_played_video,
        set(tour_current_played_sound_state, 2);
      ,
        set(tour_current_played_sound_state, 1);
      );
      set(tour_current_played_sound_paused, false);
      if (%3,
        if (device.flash,
          div(volume, tour_soundsvolume, 100);
          if(%9 != null,
            playsound3D(%1,%2,%5,%6,%7,get(volume),%8,stopsound3Dwhenpossible(%1,%4));
          ,
            playsound3D(%1,%2,%5,%6,%7,get(volume),%8);
          );
        ,
          if(%9 != null,
            playsound(%1,%2,%8,stopsound3Dwhenpossible(%1,%4));
          ,
            playsound(%1,%2,%8);
          );
        );
      ,
        if(%6 != null,
          playsound(%1,%2,%5,stopsound3Dwhenpossible(%1,%4));
        ,
          playsound(%1,%2,%5);
        );
      );

      ifnot(tour_soundson,
        set(tour_current_played_sound_paused, true);
        pausesound(%1);
      );
    );
  </action>
  <action name="stopsound3Dwhenpossible">
    if (%1 == tour_current_played_sound,
      delete(tour_current_played_sound);
      set(tour_current_played_sound_state, 0);
      delete(tour_current_played_sound_paused);

      ifnot(device.safari,
        stopsound(%1);
      );
      if(%2,
        delete(tour_current_played_sound_pausesound);
        resumeTourSoundsActions(true,true,true,true,true);
      );
    );
  </action>
  <action name="playbackgroundsound">
  if(playsound,
    if (xml.scene,
      if (scene[get(xml.scene)].backgroundsound,
        if (plugin[soundinterface].backgroundsound != scene[get(xml.scene)].backgroundsound,
          copy(plugin[soundinterface].backgroundsound, scene[get(xml.scene)].backgroundsound);
          copy(plugin[soundinterface].backgroundsoundloops, scene[get(xml.scene)].backgroundsoundloops);
          if (tour_soundson,
            set(plugin[soundinterface].bgsound, true);
            set(plugin[soundinterface].bgsoundpaused, false);
            set(plugin[soundinterface].bgsoundloopended, false);
            if(plugin[soundinterface].backgroundsoundloops GT 0,
              playsound(bgsoundname, get(plugin[soundinterface].backgroundsound), get(plugin[soundinterface].backgroundsoundloops), stopbackgroundsoundoncomplete());
            ,
              playsound(bgsoundname, get(plugin[soundinterface].backgroundsound), get(plugin[soundinterface].backgroundsoundloops));
            );
           ,
            set(plugin[soundinterface].bgsound, false);
          );
        ,
          if (tour_soundson,
            if((plugin[soundinterface].bgsoundpaused == true AND scene[get(xml.scene)].video == false) OR (scene[get(xml.scene)].video == true AND scene[get(xml.scene)].scenevideomute == true),
              resumesound(bgsoundname);
              set(plugin[soundinterface].bgsoundpaused, false);
            );
          ,
            set(plugin[soundinterface].bgsound, false);
          );
        );
      );
    );
  ,
    delayedcall(0.2, playbackgroundsound());
  );
  </action>
  <action name="stopbackgroundsoundoncomplete">
    if (plugin[soundinterface].backgroundsound,
    if (plugin[soundinterface].backgroundsoundloops GT 0,

      set(plugin[soundinterface].backgroundsoundloops, 0);
      set(plugin[soundinterface].bgsound, false);
      set(plugin[soundinterface].bgsoundpaused, false);
      set(plugin[soundinterface].bgsoundloopended, true);
    );
    );
  </action>
  <action name="resetbackgroundsoundifneeded">
    if (xml.scene,
      if (scene[get(xml.scene)].backgroundsound != scene[%1].backgroundsound,
        if(plugin[soundinterface].backgroundsound,
          stopsound(bgsoundname);
        );
        set(plugin[soundinterface].backgroundsound, "");
        set(plugin[soundinterface].backgroundsoundloops, 0);
        set(plugin[soundinterface].bgsound, false);
        set(plugin[soundinterface].bgsoundpaused, false);
        set(plugin[soundinterface].bgsoundloopended, false);
      );
    );
  </action>
  <action name="pausebackgroundsound">
    if(plugin[soundinterface].backgroundsound,
      if (plugin[soundinterface].bgsound,
        if(plugin[soundinterface].bgsoundpaused == false AND plugin[soundinterface].bgsoundloopended == false,
          pausesound(bgsoundname);
          set(plugin[soundinterface].bgsoundpaused, true);
        );
      );
    );
    
  </action>
  <action name="resumebackgroundsound">
    set(bgSoundOnResume, true);
    set(forceBgSoundOnResume, true);
    if(layer[displayedStandardVideo],
    if(layer[displayedStandardVideo].pausebgsound AND tour_current_played_video,
      set(bgSoundOnResume, false);
      set(forceBgSoundOnResume, false);
    ););
    if(layer[webvideodisplay_player],
    if(layer[webvideodisplay_player].pausebgsound AND tour_current_played_web_video,
      set(bgSoundOnResume, false);
      set(forceBgSoundOnResume, false);
    ););
    if(tour_current_played_sound_pausesound AND tour_current_played_sound,
      set(bgSoundOnResume, false);
    );
    ifnot(plugin[soundinterface].backgroundsound AND scene[get(xml.scene)].backgroundsound,
      set(bgSoundOnResume, false);
    );
    if(videospots_playing GT 0,
      set(bgSoundOnResume, false);
      set(forceBgSoundOnResume, false);
    );
    if(bgSoundOnResume,
      if (plugin[soundinterface].backgroundsound,
        if (tour_soundson,
          if (plugin[soundinterface].bgsound AND plugin[soundinterface].bgsoundloopended == false,
            if((plugin[soundinterface].bgsoundpaused == true AND scene[get(xml.scene)].video == false) OR (scene[get(xml.scene)].video == true AND scene[get(xml.scene)].scenevideomute == true),
              resumesound(bgsoundname);
              set(plugin[soundinterface].bgsoundpaused, false);
            );
          ,
            set(plugin[soundinterface].bgsound, true);
            set(plugin[soundinterface].bgsoundpaused, false);
            set(plugin[soundinterface].bgsoundloopended, false);
            if(plugin[soundinterface].backgroundsoundloops GT 0,
              playsound(bgsoundname, get(plugin[soundinterface].backgroundsound), get(plugin[soundinterface].backgroundsoundloops), stopbackgroundsoundoncomplete());
            ,
              playsound(bgsoundname, get(plugin[soundinterface].backgroundsound), get(plugin[soundinterface].backgroundsoundloops));
            );
          );
        );
      );
      
    ,
      if(forceBgSoundOnResume,
        playbackgroundsound();
        
      );
    );
  </action>
  <action name="preloadSounds">
    preloadsound("_201_full_colors-of-the-world_0172.mp3");
  </action>

  <action name="play3DLocalSounds">
    if (xml.scene, if (scene[get(xml.scene)].haslocalsounds, playpanolocalsounds();););
  </action>
  <action name="stop3DLocalSounds">
    if (xml.scene, if (scene[get(xml.scene)].haslocalsounds, stoppanolocalsounds();););
  </action>
  <action name="resume3DLocalSounds">
    if (xml.scene, if (scene[get(xml.scene)].haslocalsounds, 
      set(kill3dSoundOnResume, true);
      if(layer[displayedStandardVideo],
      if(layer[displayedStandardVideo].pausebgsound,
      if(tour_current_played_video,
        set(kill3dSoundOnResume, false);
      );););
      if(layer[webvideodisplay_player],
      if(layer[webvideodisplay_player].pausebgsound,
      if(tour_current_played_web_video,
        set(kill3dSoundOnResume, false);
      );););
      if(tour_current_played_sound_pausesound,
      if(tour_current_played_sound,
        set(kill3dSoundOnResume, false);
      ););
      if(kill3dSoundOnResume,
        resumepanolocalsounds();
      );
    ););
  </action>
  <action name="pause3DLocalSounds">
    if (xml.scene, if (scene[get(xml.scene)].haslocalsounds, pausepanolocalsounds();););
  </action>
  <action name="set3DLocalSoundsVolume">
    if (xml.scene, if (scene[get(xml.scene)].haslocalsounds, setpanolocalsoundsvolume();););
  </action>
  <action name="playTourSounds">
    set(tour_soundson, true);events.dispatch(playtoursoundsevent);
    resumeTourSoundsActions(true,true,true,true,true);
  </action>
  <action name="stopTourSounds">
    set(tour_soundson, false);events.dispatch(stoptoursoundsevent);
    pauseTourSoundsActions(true,true,true,true,true);
  </action>
  <action name="setTourSoundsVolume">
    set(tour_soundsvolume, %1);events.dispatch(changetoursoundsevent);
    div(volume, tour_soundsvolume, 100);
    set(plugin[soundinterface].volume, get(volume));
    set3DLocalSoundsVolume();
  </action>
  <action name="playTourSoundsActions">
    if(%1,
      if(plugin[soundinterface],
        if(plugin[soundinterface].started,
        play3DLocalSounds();
        );
      );
    );
    if(%2,
      if(plugin[soundinterface],
        if(plugin[soundinterface].started,
          resumebackgroundsound();
        );
      );
    );
  </action>
  <action name="stopTourSoundsActions">
    if(%1,
      stop3DLocalSounds();
    );
    if(%2,
      stopSoundActionsSounds();
    );
    if(%3,
      stopVideoActionsSounds();
    );
    if(%4,
      pausebackgroundsound();
    );
  </action>
  <action name="resumeTourSoundsActions">
    if(%1,
      if(plugin[soundinterface],
        if(plugin[soundinterface].started,
        resume3DLocalSounds();
        );
      );
    );
    if(%2,
      resumeSoundActionsSounds();
    );
    if(%3,
      resumeVideoActionsSounds();
    );
    if(%4,
      if(%5,
        if(plugin[soundinterface],
          if(plugin[soundinterface].started,
            resumebackgroundsound();
          );
        );
      ,
        pausebackgroundsound();
      );
    );
  </action>
  <action name="pauseTourSoundsActions">
    if(%1,
      pause3DLocalSounds();
    );
    if(%2,
      pauseSoundActionsSounds();
    );
    if(%3,
      pauseVideoActionsSounds();
    );
    if(%4,
      if(%5,
        pausebackgroundsound();
      ,
        if(plugin[soundinterface],
          if(plugin[soundinterface].started,
            resumebackgroundsound();
          );
        );
      );
    );
  </action>
  <action name="stopSoundActionsSounds">
    if (tour_current_played_sound,
      delete(tour_current_played_sound_paused);
      stopsound(get(tour_current_played_sound));
      delete(tour_current_played_sound);
      set(tour_current_played_sound_state, 0);
    );
  </action>
  <action name="stopVideoActionsSounds">
    if(tour_current_played_video,
      if(layer[displayedStandardVideo],
        layer[displayedStandardVideo].stop();
        removelayer(displayedStandardVideo);
        if(layer[displayedStandardVideoOverlayButton], removelayer(displayedStandardVideoOverlayButton); );
        if(layer[displayedStandardVideoOverlay], removelayer(displayedStandardVideoOverlay); );
        delete(tour_current_played_video);
        set(tour_current_played_video_state, 0);
      );
    );
    if(tour_current_played_web_video,
      displayWebVideoObjectClose();
    );
  </action>
  <action name="resumeSoundActionsSounds">
    if (tour_current_played_sound,
      set(resumeSoundActionsVerification, true);
      if(tour_current_played_video,
        if(tour_current_played_sound_state LT tour_current_played_video_state,
          set(resumeSoundActionsVerification, false);
        );
      );
      if(resumeSoundActionsVerification,
        if (tour_soundson,
          if(tour_current_played_sound_paused,
            set(tour_current_played_sound_paused, false);
            resumesound(get(tour_current_played_sound));
          );
        );
      );
    );
  </action>
  <action name="resumeVideoActionsSounds">
    if(tour_current_played_video,
      set(resumeVideoActionsVerification, true);
      if(tour_current_played_sound,
        if(tour_current_played_video_state LT tour_current_played_sound_state,
          set(resumeVideoActionsVerification, false);
        );
      );
      if(resumeVideoActionsVerification,
        if (tour_soundson,
          div(volume, tour_soundsvolume, 100);
          if(device.flash OR (device.webgl AND !device.ios),
            set(layer[displayedStandardVideo].volume, get(volume));
          ,
            ifnot(device.ios,
              js(kpanotour.Sounds.startVideosSounds(get(volume)));
            );
          );
        ,
          if(device.flash OR (device.webgl AND !device.ios),
            set(layer[displayedStandardVideo].volume, 0);
          ,
            ifnot(device.ios,
              js(kpanotour.Sounds.stopVideosSounds());
            );
          );
        );
      );
    );
  </action>
  <action name="pauseSoundActionsSounds">
    if (tour_current_played_sound,
      ifnot(tour_current_played_sound_paused,
        set(tour_current_played_sound_paused, true);
        pausesound(get(tour_current_played_sound));
      );
    );
  </action>
  <action name="pauseVideoActionsSounds">
    if(tour_current_played_video,
      if(device.flash OR (device.webgl AND !device.ios),
        set(layer[displayedStandardVideo].volume, 0);
      ,
        ifnot(device.ios,
          js(kpanotour.Sounds.stopVideosSounds());
        );
      );
    );
  </action>

  <!-- FLOORPLAN -->
  <action name="hideFloorplan">set(tour_displayfloorplan, false);events.dispatch(onhidetourfloorplan);</action>
  <action name="showFloorplan">set(tour_displayfloorplan, true); events.dispatch(onshowtourfloorplan);</action>


</krpano>