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

    
  <!-- Spot Style - Load panorama -->


  <style name="IconLoadpanorama"
         url="%FIRSTXML%/spots/hotspot_direction_sequence_user_defaultpoint5.png"
         visible="false"
         frame="0"
         lastframe="15"
         framewidth="88"
         frameheight="31"
         stopspotsequence="false"
         crop="0|0|88|31"
         edge="center"
         rotate="270"
         onloaded="startspotanimation(0.1);"
         onhover="onhoverIconLoadpanorama"
         onover="onoverIconLoadpanorama"
         onout="onoutIconLoadpanorama"

         height="60"
         width="60"
         />
  <action name="onhoverIconLoadpanorama">
    showtooltip('hotspot');
  </action>
  <action name="onoverIconLoadpanorama">


pauseautorotation(forcehotspot);

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


resumeautorotation(forcehotspot);

  </action>



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


  </action>
<!-- ********* -->
<!-- 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>

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

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


    keep="true" />



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

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

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



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

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


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


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



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


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


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


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


    inc(controlBar_classicbutton_pos, 20);

    set(controlBar_classicbackgroundwidthwhenopened, get(controlBar_classicbutton_pos));



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


    );

	
	
  </action>

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

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



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

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


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


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

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

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

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




    <layer name="controlBar_classicbtn_share"
            url="%FIRSTXML%/graphics/classiccontrolbar/btn_share.png"
            onclick="shareTour();
"
            style="controlBar_classic_btn_style"
            visible="false"
            tooltip="controlBar_classicshareTip"
            />


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

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


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

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



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


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

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


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


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

    set(layer[controlBar_classicbtn_share].visible, false);
    controlBar_classicupdateVrButtons();

    controlBar_classicupdateAutorotationButtons();


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


    controlBar_classicupdateControlModeButtons();

    controlBar_classicupdateGyroscopeButtons();

    controlBar_classicupdateHelpButtons();


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


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


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


    controlBar_classicupdateControlModeButtons();

    controlBar_classicupdateGyroscopeButtons();

    controlBar_classicupdateHelpButtons();


    controlBar_classicupdateFullscreenButtons();

    set(layer[controlBar_classicbtn_share].visible, true);
    controlBar_classicupdateVrButtons();

    controlBar_classicupdateAutorotationButtons();


  </action>

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

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



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

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




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



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

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

	<plugin name="ptpvrmode" devices="html5" keep="true"
		url="%FIRSTXML%/graphics/webvr.js"
		mobilevr_support="true"
		mobilevr_fake_support="true"
		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>
  <!-- Share Tour -->
  <action name="shareTour">events.dispatch(onsharetour);</action>

<action name="viewControlMoveUp">
	if(%1,
		if(%2,
			set(isfullvertical, false);
			ifnot(scene[get(xml.scene)].planar,
				sub(viewvfov, panoview.vmax, panoview.vmin);
				if (viewvfov == 180,
					set(isfullvertical, true);
				);
			);
			if(isfullvertical == false AND calc(view.vlookat-%2) LT view.vlookatmin,
				moveto(get(view.hlookat), get(view.vlookatmin));
			,
				moveto(get(view.hlookat), calc(view.vlookat-%2));
			);
		,
			set(vlookat_moveforce, -1);
			delayedcall(0.1, viewControlMoveVertStop());
		);
	,
		set(vlookat_moveforce, -1);
	);
</action>
<action name="viewControlMoveDown">
	if(%1,
		if(%2,
			set(isfullvertical, false);
			ifnot(scene[get(xml.scene)].planar,
				sub(viewvfov, panoview.vmax, panoview.vmin);
				if (viewvfov == 180,
					set(isfullvertical, true);
				);
			);
			if(sceneisfull360 == false AND calc(view.vlookat+%2) GT view.vlookatmax,
				moveto(get(view.hlookat), get(view.vlookatmax));
			,
				moveto(get(view.hlookat), calc(view.vlookat+%2));
			);
		,
			set(vlookat_moveforce, +1);
			delayedcall(0.1, viewControlMoveVertStop());
		);
	,
		set(vlookat_moveforce, +1);
	);
</action>
<action name="viewControlMoveLeft">
	if(%1,
		if(%2,
			set(isfullhorizontal, false);
			ifnot(scene[get(xml.scene)].planar,
				sub(viewhfov, panoview.hmax, panoview.hmin);
				if (viewhfov == 360,
					set(isfullhorizontal, true);
				);
			);
			if(isfullhorizontal == false AND calc(view.hlookat-%2) LT view.hlookatmin,
				moveto(get(view.hlookatmin), get(view.vlookat));
			,
				moveto(calc(view.hlookat-%2), get(view.vlookat));
			);
		,
			set(hlookat_moveforce, -1);
			delayedcall(0.1, viewControlMoveHoriStop());
		);
	,
		set(hlookat_moveforce, -1);
	);
</action>
<action name="viewControlMoveRight">
	if(%1,
		if(%2,
			set(isfullhorizontal, false);
			ifnot(scene[get(xml.scene)].planar,
				sub(viewhfov, panoview.hmax, panoview.hmin);
				if (viewhfov == 360,
					set(isfullhorizontal, true);
				);
			);
			if(isfullhorizontal == false AND calc(view.hlookat+%2) GT view.hlookatmax,
				moveto(get(view.hlookatmax), get(view.vlookat));
			,
				moveto(calc(view.hlookat+%2), get(view.vlookat));
			);
		,
			set(hlookat_moveforce, +1);
			delayedcall(0.1, viewControlMoveHoriStop());
			
		);
	,
		set(hlookat_moveforce, +1);
	);
</action>
<action name="viewControlMoveHoriStop">
	set(hlookat_moveforce, 0);
</action>
<action name="viewControlMoveVertStop">
	set(vlookat_moveforce, 0);
</action>

  <action name="enableGyroscope">
    changeGyroscopeState(true);
  </action>
  <action name="disableGyroscope">
    changeGyroscopeState(false);
  </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>


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

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

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

</krpano>