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

    
  <!-- Spot Style - Open website -->
  <style name="IconOpenwebsite"
         url="%FIRSTXML%/spots/hotspot_information_sequence_user_defaultpoint4.png"
         visible="false"
         frame="0"
         lastframe="17"
         framewidth="40"
         frameheight="40"
         stopspotsequence="false"
         crop="0|0|40|40"

         onloaded="startspotanimation(0.1);"
         onhover="onhoverIconOpenwebsite"
         onout="onoutIconOpenwebsite"


         />

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


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



  </action>



    
  <!-- Spot Style - Load panorama -->
  <style name="IconLoadpanorama"
         url="%FIRSTXML%/spots/hotspot_neutral_sequence_user_defaultpoint5.png"
         visible="false"
         frame="0"
         lastframe="17"
         framewidth="40"
         frameheight="40"
         stopspotsequence="false"
         crop="0|0|40|40"

         onloaded="startspotanimation(0.1);"
         onhover="onhoverIconLoadpanorama"
         onout="onoutIconLoadpanorama"


         />

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


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



  </action>



    
  <!-- Spot Style - Display a video -->
  <style name="IconDisplayavideo"
         url="%FIRSTXML%/spots/hotspot_image_sequence_user_defaultpoint7.png"
         visible="false"
         frame="0"
         lastframe="17"
         framewidth="40"
         frameheight="40"
         stopspotsequence="false"
         crop="0|0|40|40"

         onloaded="startspotanimation(0.1);"
         onhover="onhoverIconDisplayavideo"
         onover="onoverIconDisplayavideo"
         onout="onoutIconDisplayavideo"


         />

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

  <action name="onoverIconDisplayavideo">


pauseautorotation(forcehotspot);

  </action>

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


resumeautorotation(forcehotspot);

  </action>



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


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

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

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

<action name="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(mod(view.vlookat, 90)-%2) LT view.vlookatmin,
				moveto(get(view.hlookat), get(view.vlookatmin));
			,
				moveto(get(view.hlookat), calc(mod(view.vlookat, 90)-%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(mod(view.vlookat, 90)+%2) GT view.vlookatmax,
				moveto(get(view.hlookat), get(view.vlookatmax));
			,
				moveto(get(view.hlookat), calc(mod(view.vlookat, 90)+%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="viewControlZoomIn">
	if(%1,
		if(%2,
			if(%2 LT view.fovmin,
				zoomto(get(view.fovmin));
			,
				if(%2 LT view.fov,
					zoomto(%2);
				);
			);
		,
			set(fov_moveforce, -1);
			delayedcall(0.1, viewControlZoomStop());
		);
	,
		set(fov_moveforce, -1);
	);
</action>
<action name="viewControlZoomOut">
	if(%1,
		if(%2,
			if(%2 GT view.fovmax,
				zoomto(get(view.fovmax));
			,
				if(%2 GT view.fov,
					zoomto(%2);
				);
			);
		,
			set(fov_moveforce, +1);
			delayedcall(0.1, viewControlZoomStop());
		);
	,
		set(fov_moveforce, +1);
	);
</action>
<action name="viewControlZoomStop">
	set(fov_moveforce, 0);
</action>

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

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

<krpano normalViewActivated="true" />
<action name="stopSetViewTweens">
	stoptween(view.fov);
	stoptween(view.vlookat);
	stoptween(view.fisheye);
	stoptween(view.architectural);
	stoptween(view.pannini);
</action>

  <action name="displayVideo">
    set(displayedVideoObjectToCreate, true);
    set(displayedVideoObjectForDesktop, true);
    if(%10,
      set(displayedVideoObjectForDesktop, false);
    ,
      if (device.tablet, set(displayedVideoObjectForDesktop, false););
      if (device.mobile, set(displayedVideoObjectForDesktop, false););
    );
    
    if (layer[displayedStandardVideo],
      if(layer[displayedStandardVideo].donotdeleteme,
        set(layer[displayedStandardVideo].fromdesktop, get(displayedVideoObjectForDesktop));
        set(layer[displayedStandardVideo].currentCall, false);
        set(layer[displayedStandardVideo].visible, true);
        if(layer[displayedStandardVideo].overlay,set(layer[displayedStandardVideoOverlayBkg].visible, true););
        set(layer[displayedStandardVideo].donotdeleteme, false);
        set(layer[displayedStandardVideo].pausebgsound, %11);
        if (%1 == layer[displayedStandardVideo].videourl,
          layer[displayedStandardVideo].stop();
          ifnot(layer[displayedStandardVideo].fromdesktop,
            removelayer(displayedStandardVideoOverlayButton);
            removelayer(displayedStandardVideoOverlay);
          );resumeautorotation(forcehotspot);

          delete(tour_current_played_video);
          set(tour_current_played_video_state, 0);
          if(layer[displayedStandardVideo].overlay,removelayer(displayedStandardVideoOverlayBkg););
          removelayer(displayedStandardVideo);
        ,
          
          set(tour_current_played_video, %1);
          if(tour_current_played_sound,
            set(tour_current_played_video_state, 2);
          ,
            set(tour_current_played_video_state, 1);
          );
          set(layer[displayedStandardVideo].onloaded, displayVideoWhenLoaded(%1););
          set(layer[displayedStandardVideo].autoresume, true);
          if(device.html5,
            set(layer[displayedStandardVideo].url, %FIRSTXML%/graphics/videoplayer.js);
          ,
            set(layer[displayedStandardVideo].url, %SWFPATH%/graphics/videoplayer.swf);
          );
        );
      ,
        events.dispatch(onremovedisplayedobject);
        if (%1 != layer[displayedStandardVideo].videourl,
          delayedcall(0.2,displayVideo(%1, %2, %3, %4, %5, %6, %7, %8, %9, %10, %11, %12, %13, %14););
        );
      );
    ,
      if(%12,
        addlayer(displayedStandardVideoOverlayBkg);
        set(layer[displayedStandardVideoOverlayBkg].keep, false);
        set(layer[displayedStandardVideoOverlayBkg].visible , false);
        set(layer[displayedStandardVideoOverlayBkg].onclick, displayedVideoObjectStartStopAction(););
        set(layer[displayedStandardVideoOverlayBkg].zorder , 97);
        set(layer[displayedStandardVideoOverlayBkg].type, container);
        set(layer[displayedStandardVideoOverlayBkg].width   , 100%);
        set(layer[displayedStandardVideoOverlayBkg].height  , 100%);
        set(layer[displayedStandardVideoOverlayBkg].bgcolor, "0x%13");
        set(layer[displayedStandardVideoOverlayBkg].bgalpha, %14);
        set(layer[displayedStandardVideoOverlayBkg].bgcapture, true);
      );
      addlayer(displayedStandardVideo);
      set(layer[displayedStandardVideo].keep, false);
      set(layer[displayedStandardVideo].visible , false);
      set(layer[displayedStandardVideo].onclick, displayedVideoObjectStartStopAction(););
      set(layer[displayedStandardVideo].zorder , 98);
      set(layer[displayedStandardVideo].align   , %2);
      set(layer[displayedStandardVideo].x       , %3);
      set(layer[displayedStandardVideo].y       , %4);
      set(layer[displayedStandardVideo].width   , %5);
      set(layer[displayedStandardVideo].height  , %6);
      set(layer[displayedStandardVideo].overlay , %12);
      
      if (%7,
        set(layer[displayedStandardVideo].loop, true);
       ,
        set(layer[displayedStandardVideo].onvideocomplete, displayedVideoObjectStartStopAction(););
      );
      if (displayedVideoObjectForDesktop,
        set(layer[displayedStandardVideo].pausedonstart, false);
        set(layer[displayedStandardVideo].onvideoready, set(layer[displayedStandardVideo].visible, true);if(layer[displayedStandardVideo].overlay,set(layer[displayedStandardVideoOverlayBkg].visible, true);););
      ,
        
        set(layer[displayedStandardVideo].pausedonstart, true);
        set(layer[displayedStandardVideo].onvideoready, set(layer[displayedStandardVideo].started, false);set(layer[displayedStandardVideo].visible, true);if(layer[displayedStandardVideo].overlay,set(layer[displayedStandardVideoOverlayBkg].visible, true););delayedcall(0.1,applyDisplayedStandardVideoOverlay(%1, %2, %3, %4, %5, %6, %7, %8, %9, %10, %11)););
      );
      
      set(layer[displayedStandardVideo].currentCall, true);
      set(layer[displayedStandardVideo].donotdeleteme, true);
      events.dispatch(onremovedisplayedobject);
      delayedcall(0.2,displayVideo(%1, %2, %3, %4, %5, %6, %7, %8, %9, %10, %11, %12, %13, %14););
      if (%8,pauseautorotation(forcehotspot);
);
    );
  </action>
  <action name="applyDisplayedStandardVideoOverlay">
      addlayer(displayedStandardVideoOverlay);
      
      set(layer[displayedStandardVideoOverlay].type, container);
      set(layer[displayedStandardVideoOverlay].visible, true);
      set(layer[displayedStandardVideoOverlay].zorder, 99);
      set(layer[displayedStandardVideoOverlay].keep, false);
      set(layer[displayedStandardVideoOverlay].align, %2);
      set(layer[displayedStandardVideoOverlay].x, %3);
      set(layer[displayedStandardVideoOverlay].y, %4);
      set(layer[displayedStandardVideoOverlay].width, get(layer[displayedStandardVideo].pixelwidth));
      set(layer[displayedStandardVideoOverlay].height, get(layer[displayedStandardVideo].pixelheight));
      
      addlayer(displayedStandardVideoOverlayButton);
      set(layer[displayedStandardVideoOverlayButton].visible, true);
      set(layer[displayedStandardVideoOverlayButton].keep, false);
      set(layer[displayedStandardVideoOverlayButton].parent, displayedStandardVideoOverlay);
      set(layer[displayedStandardVideoOverlayButton].align, center);
      set(layer[displayedStandardVideoOverlayButton].url, %FIRSTXML%/graphics/videoplayer_play_button.png);
      set(layer[displayedStandardVideoOverlayButton].width, 50);
      set(layer[displayedStandardVideoOverlayButton].height, 50);
      set(layer[displayedStandardVideoOverlayButton].alpha, 0.5);
      set(layer[displayedStandardVideoOverlayButton].enabled, false);
      set(layer[displayedStandardVideoOverlayButton].capture, false);
      set(layer[displayedStandardVideoOverlayButton].onclick, displayedVideoObjectStartStopAction(););
  </action>
  <action name="displayVideoWhenLoaded">
    layer[displayedStandardVideo].playVideo(%1);
    ifnot(tour_soundson,
      pauseVideoActionsSounds();
    );
  </action>
  <action name="displayedVideoObjectStartStopAction">
    if(layer[displayedStandardVideo].fromdesktop,
      layer[displayedStandardVideo].stop();
      set(layer[displayedStandardVideo].visible, false);
      if(layer[displayedStandardVideo].overlay,set(layer[displayedStandardVideoOverlayBkg].visible, false););resumeautorotation(forcehotspot);

      delete(tour_current_played_video);
      set(tour_current_played_video_state, 0);
      if(layer[displayedStandardVideo].overlay,removelayer(displayedStandardVideoOverlayBkg););
      removelayer(displayedStandardVideo);
    ,
      if (layer[displayedStandardVideo].started == false,
        set(layer[displayedStandardVideo].visible , true);
        if(layer[displayedStandardVideo].overlay,set(layer[displayedStandardVideoOverlayBkg].visible, true););
        set(layer[displayedStandardVideoOverlay].visible , false);
        removelayer(displayedStandardVideoOverlayButton);
        removelayer(displayedStandardVideoOverlay);
        set(layer[displayedStandardVideo].started, true);
        layer[displayedStandardVideo].play();
        ifnot(tour_soundson,
          pauseVideoActionsSounds();
        );
      ,
        layer[displayedStandardVideo].stop();
        set(layer[displayedStandardVideo].visible , false);
        if(layer[displayedStandardVideo].overlay,set(layer[displayedStandardVideoOverlayBkg].visible, false););resumeautorotation(forcehotspot);

        delete(tour_current_played_video);
        set(tour_current_played_video_state, 0);
        if(layer[displayedStandardVideo].overlay,removelayer(displayedStandardVideoOverlayBkg););
        removelayer(displayedStandardVideo);
      );
    );
  </action>
  <events name="displayedVideoObjectEvents" keep="true" onremovedisplayedobject="displayedVideoObjectOnRemoveDisplayedObject"/>
  <action name="displayedVideoObjectOnRemoveDisplayedObject">
    ifnot(layer[displayedStandardVideo].currentCall,
      if(layer[displayedStandardVideo].visible,
        layer[displayedStandardVideo].stop();
        ifnot(layer[displayedStandardVideo].fromdesktop,
          removelayer(displayedStandardVideoOverlayButton);
          removelayer(displayedStandardVideoOverlay);
        );
        set(layer[displayedStandardVideo].visible , false);
        if(layer[displayedStandardVideo].overlay,set(layer[displayedStandardVideoOverlayBkg].visible, false););resumeautorotation(forcehotspot);

        delete(tour_current_played_video);
        set(tour_current_played_video_state, 0);
        if(layer[displayedStandardVideo].overlay,removelayer(displayedStandardVideoOverlayBkg););
        removelayer(displayedStandardVideo);
      );
    );
  </action>

<action name="setViewArchitectural">
	if(normalViewActivated,stopSetViewTweens(););
	if(current_view_isflat === true,
		setViewNonFlat(VFOV);
	);
	setViewArchitecturalComplete();
</action>

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

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

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

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


</krpano>