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

<!-- ************ -->
<!-- Context Menu -->
<!-- ************ -->
  <contextmenu fullscreen="false">
    <item name="website1"  />
    <item name="normal"        onclick="setViewNormal();
" separator="true"/>
    <item name="fisheye"       onclick="setViewFisheye();
"/>
    <item name="architectural" onclick="setViewArchitectural();
"/>
    <item name="stereographic" onclick="setViewStereographic();
"/>
    <item name="pannini"       onclick="setViewPannini();
"/>
    <item name="littleplanet"  onclick="setViewLittlePlanet();
"/>
    <item name="fisheyeball"   onclick="setViewFisheyeBall();
"/>
    <item name="fullscreenentry" onclick="enterFullscreen();
" separator="true"/>
  </contextmenu>

  <events name="contextmenuevents" keep="true" onenterfullscreen="updateContextMenu" onexitfullscreen="updateContextMenu" onxmlcomplete="updateContextMenu"/>
  <action name="updateContextMenu">
    getmessage(contextmenu.item[website1].caption, contextmenuwebsiteurl1);
    getmessage(contextmenu.item[normal].caption, contextmenunormallabel);
    getmessage(contextmenu.item[architectural].caption, contextmenuarchitecturallabel);
    
    set(sceneisfull360, false);
    if(scene[get(xml.scene)].full360,
      sub(viewhfov, view.hlookatmax, view.hlookatmin);
      if (viewhfov == 360,
        sub(viewvfov, view.vlookatmax, view.vlookatmin);
        if (viewvfov == 180,
          set(sceneisfull360, true);
        );
      );
    );
    if (sceneisfull360,
      set(contextmenu.item[fisheye].visible, true);
      getmessage(contextmenu.item[fisheye].caption, contextmenufisheyelabel);
      set(contextmenu.item[stereographic].visible, true);
      getmessage(contextmenu.item[stereographic].caption, contextmenustereographiclabel);
      set(contextmenu.item[pannini].visible, true);
      getmessage(contextmenu.item[pannini].caption, contextmenupanninilabel);
      set(contextmenu.item[littleplanet].visible, true);
      getmessage(contextmenu.item[littleplanet].caption, contextmenulittleplanetlabel);
      set(contextmenu.item[fisheyeball].visible, true);
      getmessage(contextmenu.item[fisheyeball].caption, contextmenufisheyeballlabel);
    ,
      set(contextmenu.item[fisheye].visible, false);
      set(contextmenu.item[stereographic].visible, false);
      set(contextmenu.item[pannini].visible, false);
      set(contextmenu.item[littleplanet].visible, false);
      set(contextmenu.item[fisheyeball].visible, false);
    );
    if(tour_fullscreen,
      getmessage(contextmenu.item[fullscreenentry].caption, contextmenucloseFsLabel);
      set(contextmenu.item[fullscreenentry].onclick, exitFullscreen();
);
     ,
      getmessage(contextmenu.item[fullscreenentry].caption, contextmenuopenFsLabel);
      set(contextmenu.item[fullscreenentry].onclick, enterFullscreen();
);
    );
  </action>


<!-- ********* -->
<!-- Gyroscope -->
<!-- ********* -->
<plugin name="gyroscope"
        url="graphics/gyro.js"
        keep="true"
        devices="tablet+!flash|mobile+!flash"

        onavailable="delayedcall(1, checkGyroAvailability(););"
        enabled="false"
        />

<action name="changeGyroscopeState">
  if(plugin[gyroscope],
    ifnot (plugin[gyroscope].available === undefined,
      if (plugin[gyroscope].available,
        if (%1 !=  plugin[gyroscope].enabled,
          switch(plugin[gyroscope].enabled);
          if (plugin[gyroscope].enabled, events.dispatch(ongyroscopeon);, events.dispatch(ongyroscopeoff););
        );
      );
    );
  );
</action>

<action name="checkGyroAvailability">
  if(plugin[gyroscope],
	ifnot (plugin[gyroscope].available === undefined, 
		if (plugin[gyroscope].available,
			set(tour_gyroscopedevices, true);
			events.dispatch(ongyroscopeavailable);
			if (plugin[gyroscope].enabled, events.dispatch(ongyroscopeon);, events.dispatch(ongyroscopeoff););
		,
			set(tour_gyroscopedevices, false);
			set(plugin[gyroscope].enabled, false);
		);
	,
		set(tour_gyroscopedevices, false);
		set(plugin[gyroscope].enabled, false);
	);
  );
</action>

  <!-- ****** -->
  <!-- Footer -->
  <!-- ****** -->
  <layer name="footer"
         keep="true"
         url="http://static.zooomez.fr/medias/panostmp/communs/v2/graphics/footer/footer.png"
         bgalpha="0.500007629510948"
         align="bottom"
         x="0"
         y="0"
         zorder="2"
         enabled="false"
         capture="true"
         visible="false"

         height="40"
         width="75%"

         />

  <events name="footerevents" 
    onTourStart="showfooter();"
    keep="true" />

  <action name="showfooter">
    set(layer[footer].visible, true);
  </action>


  <!-- ************ -->
  <!-- Logo : viewport / bottomleft -->
  <!-- ************ -->

  <layer align="bottomleft"
         x="10"
         y="10"
         zorder="3"
         name="logo"
         keep="true"
         visible="false"
         capture="false"

         url="http://static.zooomez.fr/medias/panostmp/communs/v2/graphics/logo/logo_zooomez_100px.png" 
         handcursor="false"

         width="80"
         height="prop"

         />

  <events name="logoevents" 
    onTourStart="showlogo();"
    hidetourcontrols="hidelogo();"
    showtourcontrols="showlogo();"
    keep="true" />

  <action name="hidelogo">
    set(layer[logo].visible, false);
  </action>
  <action name="showlogo">
    if (tour_displaycontrols,
      set(layer[logo].visible, true);
    );
  </action>





  <!-- ******************* -->
  <!-- Classic Control Bar -->
  <!-- ******************* -->

  <krpano theme2barbuilt="false" theme2backgroundwidthwhenclosed="0" theme2backgroundwidthwhenopened="0" theme2IsOpened="false" />
  <events name="theme2events" onxmlcomplete="theme2buildMenuBar();" keep="true"/>
  <action name="theme2buildMenuBar">
    ifnot (theme2barbuilt, theme2buildMenu(); set(theme2barbuilt, true););
  </action>

  <action name="theme2buildMenu">
    
    set(theme2button_pos, 20);

    set(layer[theme2btn_hidecontrols].x, get(theme2button_pos));
    set(layer[theme2btn_showcontrols].x, get(theme2button_pos));
    inc(theme2button_pos, 36);
    add(theme2backgroundwidthwhenclosed, get(theme2button_pos), 20);



    if (device.fullscreensupport,
      set(layer[theme2btn_openfs ].x, get(theme2button_pos));
      set(layer[theme2btn_closefs].x, get(theme2button_pos));
      inc(theme2button_pos, 36);
    );





    if (device.desktop,
      set(layer[theme2btn_ctrlmode_drag_to].x, get(theme2button_pos));
      set(layer[theme2btn_ctrlmode_move_to].x, get(theme2button_pos));
      inc(theme2button_pos, 36);
    );


    if(plugin[gyroscope],
      set(theme2DisplayGyroscopeButton, false);
      if (device.tablet, set(theme2DisplayGyroscopeButton, true););
      if (device.mobile, set(theme2DisplayGyroscopeButton, true););
      if(theme2DisplayGyroscopeButton,
        set(layer[theme2btn_gyroscope_on ].x, get(theme2button_pos));
        set(layer[theme2btn_gyroscope_off].x, get(theme2button_pos));
        inc(theme2button_pos, 36);
      );
    );


    if (device.desktop,
        set(layer[theme2btn_out].x, get(theme2button_pos));
        inc(theme2button_pos, 36);
        set(layer[theme2btn_in].x, get(theme2button_pos));
        inc(theme2button_pos, 36);
    );
    inc(theme2button_pos, 20);

    set(theme2backgroundwidthwhenopened, get(theme2button_pos));
    
    
    add(theme2VerifyVisibility, 20, 20);
    if(theme2backgroundwidthwhenopened == 20,
      set(theme2backgroundwidthwhenopened, 0);
    );

	
	
  </action>

	<events name="theme2StartTourEvents" onTourStart="theme2CallOnStartTour();" keep="true" />

	<action name="theme2CallOnStartTour">
		
		set(layer[theme2menu_controlbar_bg_img].width, get(theme2button_pos));
		set(layer[theme2menu_controlbar_bg].width, get(theme2button_pos));
		showTourControls();

	</action>

  <style name="theme2_btn_style"
         keep="true"
         alpha="0.8"
         edge="right" align="right"
         width="36" height="36"
         zorder="6"
         onover="theme2ctrlbaronoveraction();"
         onout="theme2ctrlbaronoutaction();"
	onhover="showTooltip(bottom, theme2menuTooltipStyle, bottom);"
         />
  <action name="theme2ctrlbaronoveraction">
    tween(alpha,1,0.1,easeoutquad);
    tween(y,-2,0.1,easeoutquad);
  </action>  
  <action name="theme2ctrlbaronoutaction">
    tween(alpha,0.8);
    tween(y,0,0.1,easeoutquad);
    hideTooltip();
  </action>

  <layer name="theme2menu_controlbar_bg_img"
         keep="true"
         align="bottom"
         x="0" y="2"
         url="http://static.zooomez.fr/medias/panostmp/communs/v2/graphics/classiccontrolbar/footer.png"
         zorder="4"
         width="40"
         height="40"
         scale9grid="10|10|80|80"
         visible="false"
         />
  <layer name="theme2menu_controlbar_bg"
         keep="true"
         align="bottom"
         x="0" y="2"
         type="container"
         zorder="5"
         width="40"
         height="40"
         visible="false"
         alpha="1.0"
         >


    <layer name="theme2btn_gyroscope_off"
            url="http://static.zooomez.fr/medias/panostmp/communs/v2/graphics/classiccontrolbar/btn_gyroscope.png"
            style="theme2_btn_style"
            onclick="disableGyroscope();
"
            devices="html5"
            tooltip="controlBar_classicgyroOffTip"
            visible="false"
            />
    <layer name="theme2btn_gyroscope_on"
            url="http://static.zooomez.fr/medias/panostmp/communs/v2/graphics/classiccontrolbar/btn_gyroscope.png"
            style="theme2_btn_style"
            onclick="enableGyroscope();
"
            devices="html5"
            tooltip="controlBar_classicgyroOnTip"
            visible="false"
            />


    <layer name="theme2btn_ctrlmode_move_to"
            url="http://static.zooomez.fr/medias/panostmp/communs/v2/graphics/classiccontrolbar/btn_move_to.png"
            style="theme2_btn_style"
            tooltip="controlBar_classicctrlmodeMoveTip"
            onclick="setControlModeMoveTo();
"
            visible="false"
            devices="desktop"
            />
    <layer name="theme2btn_ctrlmode_drag_to"
            url="http://static.zooomez.fr/medias/panostmp/communs/v2/graphics/classiccontrolbar/btn_drag_to.png"
            style="theme2_btn_style"
            tooltip="controlBar_classicctrlmodeDragTip"
            onclick="setControlModeDragTo();
"
            visible="false"
            devices="desktop"
            />

    <layer name="theme2btn_in"
            url="http://static.zooomez.fr/medias/panostmp/communs/v2/graphics/classiccontrolbar/btn_zoom_in.png"
            ondown="set(fov_moveforce, -1);
"
            onup="set(fov_moveforce, 0);
"
            style="theme2_btn_style"
            tooltip="controlBar_classiczoomInTip"
            devices="desktop"
            visible="false"
            />
    <layer name="theme2btn_out"
            url="http://static.zooomez.fr/medias/panostmp/communs/v2/graphics/classiccontrolbar/btn_zoom_out.png"
            ondown="set(fov_moveforce, +1);
"
            onup="set(fov_moveforce, 0);
"
            style="theme2_btn_style"
            tooltip="controlBar_classiczoomOutTip"
            devices="desktop"
            visible="false"
            />





    <layer name="theme2btn_openfs"
            url="http://static.zooomez.fr/medias/panostmp/communs/v2/graphics/classiccontrolbar/btn_enter_fs.png"
            onclick="enterFullscreen();
"
            style="theme2_btn_style"
            devices="fullscreensupport"
            visible="false"
            tooltip="controlBar_classicopenFsTip"
            />
    <layer name="theme2btn_closefs"
            url="http://static.zooomez.fr/medias/panostmp/communs/v2/graphics/classiccontrolbar/btn_close_fs.png"
            onclick="exitFullscreen();
"
            style="theme2_btn_style"
            visible="false"
            devices="fullscreensupport"
            tooltip="controlBar_classiccloseFsTip"
            />





    <layer name="theme2btn_hidecontrols"
            url="http://static.zooomez.fr/medias/panostmp/communs/v2/graphics/classiccontrolbar/btn_hide_controls.png"
            style="theme2_btn_style"
            onclick="hideTourControls();
"
            visible="false"
            tooltip="controlBar_classichideControlsTip"
            />
    <layer name="theme2btn_showcontrols"
            url="http://static.zooomez.fr/medias/panostmp/communs/v2/graphics/classiccontrolbar/btn_show_controls.png"
            style="theme2_btn_style"
            onclick="showTourControls();
"
            tooltip="controlBar_classicdisplayControlsTip"
            visible="false"
            />
  </layer>


	<events name="theme2gyroscopeavailableevent"
		ongyroscopeavailable="theme2updateGyroscopeButtonsAvailability();"
		ongyroscopeon="theme2enableGyroscopeButtons(true);"
		ongyroscopeoff="theme2enableGyroscopeButtons(false);"
		keep="true" />
	<krpano theme2menugyroscopeavailable="false" theme2menugyroscopeenabled="false" />
	<action name="theme2updateGyroscopeButtonsAvailability">
		if (tour_gyroscopedevices,
			set(theme2menugyroscopeavailable, true);
			theme2updateGyroscopeButtons();
		);
	</action>
	<action name="theme2enableGyroscopeButtons">
		if (tour_gyroscopedevices,
			set(theme2menugyroscopeenabled, %1);
			theme2updateGyroscopeButtons();
		);
	</action>
	<action name="theme2HideGyroscopeButtons">
		set(layer[theme2btn_gyroscope_off].visible, false);
		set(layer[theme2btn_gyroscope_on].visible, false);
	</action>
	<action name="theme2ShowGyroscopeButtons">
		if (theme2menugyroscopeavailable,
			if (theme2menugyroscopeenabled,
				set(layer[theme2btn_gyroscope_off].visible, true);
				set(layer[theme2btn_gyroscope_on].visible, false);
			,
				set(layer[theme2btn_gyroscope_off].visible, false);
				set(layer[theme2btn_gyroscope_on].visible, true);
			);
		,
			theme2HideGyroscopeButtons();
		);
	</action>
	<action name="theme2updateGyroscopeButtons">
	if (tour_gyroscopedevices,
		if (tour_displaycontrols,
			theme2ShowGyroscopeButtons();
		,
			theme2HideGyroscopeButtons();
		);
	,
		theme2HideGyroscopeButtons();
	);
	</action>


	<events name="theme2controlmodechangedevent" 
		oncontrolmodechanged="theme2updateControlModeButtons();" 
		keep="true" />
	<action name="theme2HideControlModeButtons">
		set(layer[theme2btn_ctrlmode_move_to].visible, false);
		set(layer[theme2btn_ctrlmode_drag_to].visible, false);
	</action>
	<action name="theme2ShowControlModeButtons">
		if (tour_controlmodemousetype == "moveto",
			set(layer[theme2btn_ctrlmode_drag_to].visible, true);
			set(layer[theme2btn_ctrlmode_move_to].visible, false);
		,
			set(layer[theme2btn_ctrlmode_move_to].visible, true);
			set(layer[theme2btn_ctrlmode_drag_to].visible, false);
		);
	</action>
	<action name="theme2updateControlModeButtons">
	if (device.desktop,
		if (tour_displaycontrols,
			theme2ShowControlModeButtons();
		,
			theme2HideControlModeButtons();
		);
	,
		theme2HideControlModeButtons();
	);
	</action>

  <events name="theme2hideshowcontrolsevent" 
    hidetourcontrols="theme2hideMenuControls();" 
    showtourcontrols="theme2showMenuControls();" 
    keep="true" />

  <action name="theme2hideMenuControls">
    set(theme2IsOpened, false);
    set(layer[theme2btn_hidecontrols].visible, false);
    set(layer[theme2btn_showcontrols].visible, true);
    theme2updateFullscreenButtons();




    set(layer[theme2btn_in].visible , false);
    set(layer[theme2btn_out].visible, false);


    theme2updateControlModeButtons();

    theme2updateGyroscopeButtons();



    set(layer[theme2menu_controlbar_bg_img].visible, true);
    set(layer[theme2menu_controlbar_bg].visible, true);
    tween(layer[theme2menu_controlbar_bg_img].width , get(theme2backgroundwidthwhenclosed));
    tween(layer[theme2menu_controlbar_bg].width , get(theme2backgroundwidthwhenclosed));
    tween(layer[theme2menu_controlbar_bg_img].alpha, 0);
  </action>
  <action name="theme2showMenuControls">
    set(theme2IsOpened, true);
    set(layer[theme2btn_hidecontrols].visible, true);
    set(layer[theme2btn_showcontrols].visible, false);
    if(theme2backgroundwidthwhenopened == 0,
      set(layer[theme2menu_controlbar_bg_img].visible, false);
      set(layer[theme2menu_controlbar_bg].visible, false);
    ,
      set(layer[theme2menu_controlbar_bg_img].visible, true);
      set(layer[theme2menu_controlbar_bg].visible, true);
    );
    tween(layer[theme2menu_controlbar_bg_img].alpha, 0);
    tween(layer[theme2menu_controlbar_bg_img].width, get(theme2backgroundwidthwhenopened), 0.5, easeOutQuad, theme2showMenuButtons(););
    tween(layer[theme2menu_controlbar_bg].width, get(theme2backgroundwidthwhenopened), 0.5, easeOutQuad, theme2showMenuButtons(););
  </action>
  <action name="theme2showMenuButtons">
    if (device.desktop,
    set(layer[theme2btn_in].visible , true);
    set(layer[theme2btn_out].visible, true);
    );


    theme2updateControlModeButtons();

    theme2updateGyroscopeButtons();



    theme2updateFullscreenButtons();




  </action>



	<events name="theme2menufullscreenchangeevent"
		onenterfullscreen="theme2updateFullscreenButtons();"
		onexitfullscreen="theme2updateFullscreenButtons();"
		keep="true"/>
	<action name="theme2HideFullscreenButtons">
		set(layer[theme2btn_openfs].visible , false);
		set(layer[theme2btn_closefs].visible, false);
	</action>
	<action name="theme2ShowFullscreenButtons">
		if (device.fullscreensupport,
			if(tour_fullscreen,
				set(layer[theme2btn_openfs].visible , false);
				set(layer[theme2btn_closefs].visible, true);
			,
				set(layer[theme2btn_openfs].visible ,true);
				set(layer[theme2btn_closefs].visible,false);
			);
		,
			theme2HideFullscreenButtons();
		);
	</action>
	<action name="theme2updateFullscreenButtons">
		if (tour_displaycontrols,
			theme2ShowFullscreenButtons();
		,
			theme2HideFullscreenButtons();
		);
	</action>




<layer name="theme2menuTooltipStyle"
	keep="true"
	enabled="false"
	capture="false"
	url="http://static.zooomez.fr/medias/panostmp/communs/v2/graphics/textfield.swf"
	align="center"
	background="true"
	backgroundcolor="0x000000"
	backgroundalpha="0.700007629510948"
	border="false"
	shadow="1" shadowrange="4.0" shadowangle="45" shadowcolor="0x000000" shadowalpha="1"
	textshadow="1" textshadowrange="4.0" textshadowangle="45" textshadowcolor="0x000000" textshadowalpha="1"
	css="color:#e6e6e6;font-family:Century Gothic;font-size:12px;text-align:left;"
	height="20" 
	autoheight="true"
	autowidth="auto"
	selectable="false"
	zorder="0"
	visible="false"
	html=""
	edge="bottom"
	/>


  <!-- ************ -->
  <!-- Logo : viewport / bottomright -->
  <!-- ************ -->

  <layer align="bottomright"
         x="10"
         y="10"
         zorder="7"
         name="logo1"
         keep="true"
         visible="false"
         capture="false"

         url="http://static.zooomez.fr/medias/panostmp/communs/v2/graphics/logo3/logo_herault_tourisme_200px.png"
         handcursor="false"

         width="90"
         height="prop"

         />

  <events name="logo1events" 
    onTourStart="showlogo1();"
    hidetourcontrols="hidelogo1();"
    showtourcontrols="showlogo1();"
    keep="true" />

  <action name="hidelogo1">
    set(layer[logo1].visible, false);
  </action>
  <action name="showlogo1">
    if (tour_displaycontrols,
      set(layer[logo1].visible, true);
    );
  </action>





  <!-- ************ -->
  <!-- Logo : sphere / nadir -->
  <!-- ************ -->

  <hotspot ath="0" atv="90"
         zorder="0"
         name="logo2"
         keep="true"
         visible="false"
         capture="false"

			tooltip="logo2tooltipText"
			onhover="showTooltip(hotspot,'');"
			onout="hideTooltip();"
         url="http://static.zooomez.fr/medias/panostmp/communs/v2/graphics/logo4/nadir_catalogue34.png" 
         handcursor="false"


         />

  <events name="logo2events" 
    onTourStart="showlogo2();"
    keep="true" />

  <action name="hidelogo2">
    set(hotspot[logo2].visible, false);
  </action>
  <action name="showlogo2">
      set(hotspot[logo2].visible, true);
  </action>



  <events name="logo2showevents" onremovepano="hidelogo2" onPanoStart="showlogo2" keep="true"/>



<action name="setViewPannini">
	set(sceneisfull360, false);
	if(scene[get(xml.scene)].full360,
		sub(viewhfov, view.hlookatmax, view.hlookatmin);
		if (viewhfov == 360,
			sub(viewvfov, view.vlookatmax, view.vlookatmin);
			if (viewvfov == 180,
				set(sceneisfull360, true);
			);
		);
	);
	if (sceneisfull360,
		stopSetViewTweens();
		setViewPanniniComplete();
	);
</action>

<action name="setViewPanniniComplete">
	tween(view.architectural, 0.0, 0.25, easeoutquad,
		tween(view.fovmax, get(panoview.fovmax), distance(179, 1.00));
		set(backtonormalfirst,false);
		if(view.pannini == false, set(backtonormalfirst,true); );
		if(view.stereographic == false, set(backtonormalfirst,true); );
		if(backtonormalfirst, tween(view.fisheye, 0.0 ,distance(1.0, 0.25), easeoutquad, WAIT); );
		set(view.pannini, true);
		set(view.stereographic, true);
		set(view.fisheyefovlink, 1.5);
		tween(view.fisheye, 1.0, distance(1.0, 0.75));
		tween(view.vlookat, get(panoview.v), 1.25);
		if(panoview.fov LE view.fov, tween(view.fov, get(panoview.fov), distance(50, 0.45)); );
	);
</action>

<action name="setViewFisheye">
	set(sceneisfull360, false);
	if(scene[get(xml.scene)].full360,
		sub(viewhfov, view.hlookatmax, view.hlookatmin);
		if (viewhfov == 360,
			sub(viewvfov, view.vlookatmax, view.vlookatmin);
			if (viewvfov == 180,
				set(sceneisfull360, true);
			);
		);
	);
	if (sceneisfull360,
		stopSetViewTweens();
		setViewFisheyeComplete();
	);
</action>

<action name="setViewFisheyeComplete">
	tween(view.architectural, 0.0, distance(1.0, 0.30), easeoutquad, 
		tween(view.fisheye, 0.0, distance(1.0, 0.30), easeoutquad,
			set(view.stereographic,false);
			if(view.pannini, set(view.pannini,false); delayedcall(0,updateobject(true,true)); );
			tween(view.fovmax, 179, 0.25);
			set(view.fisheyefovlink, 1.5);
			if(panoview.fov LE view.fov, tween(view.fov, get(panoview.fov), distance(50, 0.45)); );
			tween(view.fisheye, 0.40, distance(1.0, 1.25));
			tween(view.vlookat, get(panoview.v), 1.25);
		);
	);
</action>

<action name="setViewStereographic">
	set(sceneisfull360, false);
	if(scene[get(xml.scene)].full360,
		sub(viewhfov, view.hlookatmax, view.hlookatmin);
		if (viewhfov == 360,
			sub(viewvfov, view.vlookatmax, view.vlookatmin);
			if (viewvfov == 180,
				set(sceneisfull360, true);
			);
		);
	);
	if (sceneisfull360,
		stopSetViewTweens();
		setViewStereographicComplete();
	);
</action>

<action name="setViewStereographicComplete">
	tween(view.architectural, 0.0, 0.25, easeoutquad, 
		tween(view.fovmax, get(panoview.fovmax), distance(179, 1.00));
		set(backtonormalfirst,false);
		if(view.pannini == true, set(backtonormalfirst,true) );
		if(view.stereographic == false, set(backtonormalfirst,true) );
		if(backtonormalfirst, tween(view.fisheye, 0.0 ,distance(1.0, 0.25), easeoutquad, WAIT); );
		if(view.pannini, set(view.pannini,false); delayedcall(0,updateobject(true,true)); );
		set(view.stereographic, true);
		set(view.fisheyefovlink, 1.5);
		tween(view.fisheye, 1.0, distance(1.0, 0.75), easeoutquad);
		tween(view.vlookat, get(panoview.v), 1.25);
		if(panoview.fov LE view.fov, tween(view.fov, get(panoview.fov), distance(50, 0.45)); );
	);
</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>

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


<action name="setViewArchitectural">
	stopSetViewTweens();
	setViewArchitecturalComplete();
</action>

<action name="setViewArchitecturalComplete">
	tween(view.fovmax, get(panoview.fovmax), distance(179, 1.00), easeoutquad);
	tween(view.architectural, 1.0, distance(1.0, 0.45), easeoutquad, 
		tween(view.fisheye, 0.0, distance(1.0, 0.45), easeoutquad, 
			set(view.fisheyefovlink, 0.5);
			set(view.stereographic,false);
			if(view.pannini, set(view.pannini,false); delayedcall(0,updateobject(true,true)); );
			tween(view.vlookat, get(panoview.v), 1.25);
			if(panoview.fov LE view.fov, 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, view.hlookatmax, view.hlookatmin);
		if (viewhfov == 360,
			sub(viewvfov, view.vlookatmax, view.vlookatmin);
			if (viewvfov == 180,
				set(sceneisfull360, true);
			);
		);
	);
	if (sceneisfull360,
		stopSetViewTweens();
		setViewLittlePlanetComplete();
	);
</action>

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

<action name="setViewFisheyeBall">
	set(sceneisfull360, false);
	if(scene[get(xml.scene)].full360,
		sub(viewhfov, view.hlookatmax, view.hlookatmin);
		if (viewhfov == 360,
			sub(viewvfov, view.vlookatmax, view.vlookatmin);
			if (viewvfov == 180,
				set(sceneisfull360, true);
			);
		);
	);
	if (sceneisfull360,
		stopSetViewTweens();
		setViewFisheyeBallComplete();
	);
</action>

<action name="setViewFisheyeBallComplete">
	tween(view.architectural, 0.0, distance(1.0, 0.30), easeoutquad, 
		set(view.fisheyefovlink, 1.5);
		tween(view.fisheye, 1.0, distance(1.0, 0.30), easeoutquad,
			set(view.stereographic,false);
			if(view.pannini, set(view.pannini,false); delayedcall(0,updateobject(true,true)); );
			if(panoview.fovmax LE 179, set(view.fovmax, 179); , set(view.fovmax, get(panoview.fovmax)); );
			tween(view.fov, 179, 4.0, easeInOutQuad );
			tween(view.vlookat, get(panoview.v), 1.25);
			set(display.details, 22);
		);
	);
</action>

<action name="setViewNormal">
	stopSetViewTweens();
	setViewNormalComplete();
</action>

<action name="setViewNormalComplete">
	tween(view.architectural, 0.0, distance(1.0, 0.45), easeoutquad,
		tween(view.fovmax, get(panoview.fovmax), distance(179, 1.00));
		tween(view.vlookat, get(panoview.v), distance(90, 0.45));
		tween(view.fisheye, 0.0, distance(1.0, 0.45), easeoutquad,
			set(view.stereographic,false);
			if(view.pannini, set(view.pannini,false); delayedcall(0,updateobject(true,true)); );
			set(view.fisheyefovlink, 0.5);
			if(panoview.fov LE view.fov, tween(view.fov, get(panoview.fov), distance(50, 0.45)); );
		);
	);
</action>

<action name="stopSetViewTweens">
	stoptween(view.fov);
	stoptween(view.fovmax);
	stoptween(view.vlookat);
	stoptween(view.fisheye);
	stoptween(view.architectural);
</action>

</krpano>