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

    
  <!-- Spot Style - Default Point Spot Style 1 -->
  <style name="IconDefaultPointSpotStyle1"
         url="%FIRSTXML%/spots/hotspot_neutral_sequence_user_defaultpoint0.png"
         visible="false"

         frame="0"
         lastframe="17"
         framewidth="70"
         frameheight="70"
         stopspotsequence="false"
         onloaded="setdefaultanimatedspotframe();startspotanimation(0.1);if(scene[get(xml.scene)].planar,if(zoom,set(zoom, false);););"

         zoom="true"
         
         alpha="0.8"
         onhover="onhoverIconDefaultPointSpotStyle1"
         onover="onoverIconDefaultPointSpotStyle1"
         onout="onoutIconDefaultPointSpotStyle1"
         height="25"
         width="25"
         />
  <action name="onhoverIconDefaultPointSpotStyle1">
    showtooltip(hotspot);
  </action>
  <action name="onoverIconDefaultPointSpotStyle1">
tween(scale, 1.2);
tween(alpha, 1);
pauseautorotation();
  </action>
  <action name="onoutIconDefaultPointSpotStyle1">
    hideTooltip();
tween(scale, 1);
tween(alpha, 0.8);
resumeautorotation();
  </action>

    
  <!-- Spot Style - Flèche droite -->
  <style name="IconFlèchedroite"
         url="%FIRSTXML%/spots/hotspot_direction_sequence_user_defaultpoint1.png"
         visible="false"

         frame="0"
         lastframe="15"
         framewidth="98"
         frameheight="48"
         stopspotsequence="false"
         onloaded="setdefaultanimatedspotframe();startspotanimation(0.1);"

         alpha="0.8"
         onhover="onhoverIconFlèchedroite"
         onover="onoverIconFlèchedroite"
         onout="onoutIconFlèchedroite"
         height="25"
         width="50"
         />
  <action name="onhoverIconFlèchedroite">
    showtooltip(hotspot);
  </action>
  <action name="onoverIconFlèchedroite">
tween(scale, 1.2);
tween(alpha, 1);
pauseautorotation();
  </action>
  <action name="onoutIconFlèchedroite">
    hideTooltip();
tween(scale, 1);
tween(alpha, 0.8);
resumeautorotation();
  </action>

    
  <!-- Spot Style - Flèche gauche -->
  <style name="IconFlèchegauche"
         url="%FIRSTXML%/spots/hotspot_direction_sequence_user_defaultpoint2.png"
         visible="false"

         frame="0"
         lastframe="15"
         framewidth="98"
         frameheight="48"
         stopspotsequence="false"
         onloaded="setdefaultanimatedspotframe();startspotanimation(0.1);"

         rotate="180"
         alpha="0.8"
         onhover="onhoverIconFlèchegauche"
         onover="onoverIconFlèchegauche"
         onout="onoutIconFlèchegauche"
         height="25"
         width="50"
         />
  <action name="onhoverIconFlèchegauche">
    showtooltip(hotspot);
  </action>
  <action name="onoverIconFlèchegauche">
tween(scale, 1.2);
tween(alpha, 1);
pauseautorotation();
  </action>
  <action name="onoutIconFlèchegauche">
    hideTooltip();
tween(scale, 1);
tween(alpha, 0.8);
resumeautorotation();
  </action>

    
  <!-- Spot Style - Flèche gauche bas -->
  <style name="IconFlèchegauchebas"
         url="%FIRSTXML%/spots/hotspot_direction_sequence_user_defaultpoint7.png"
         visible="false"

         frame="0"
         lastframe="15"
         framewidth="98"
         frameheight="48"
         stopspotsequence="false"
         onloaded="setdefaultanimatedspotframe();startspotanimation(0.1);"

         rotate="135"
         alpha="0.8"
         onhover="onhoverIconFlèchegauchebas"
         onover="onoverIconFlèchegauchebas"
         onout="onoutIconFlèchegauchebas"
         height="25"
         width="50"
         />
  <action name="onhoverIconFlèchegauchebas">
    showtooltip(hotspot);
  </action>
  <action name="onoverIconFlèchegauchebas">
tween(scale, 1.2);
tween(alpha, 1);
pauseautorotation();
  </action>
  <action name="onoutIconFlèchegauchebas">
    hideTooltip();
tween(scale, 1);
tween(alpha, 0.8);
resumeautorotation();
  </action>

    
  <!-- Spot Style - Ouvre autre visite -->
  <style name="IconOuvreautrevisite"
         url="%FIRSTXML%/spots/hotspot_neutral_sequence_user_defaultpoint9.png"
         visible="false"

         frame="0"
         lastframe="17"
         framewidth="70"
         frameheight="70"
         stopspotsequence="false"
         onloaded="setdefaultanimatedspotframe();startspotanimation(0.1);"

         alpha="0.8"
         onhover="onhoverIconOuvreautrevisite"
         onover="onoverIconOuvreautrevisite"
         onout="onoutIconOuvreautrevisite"
         height="40"
         width="40"
         />
  <action name="onhoverIconOuvreautrevisite">
    showtooltip(hotspot);
  </action>
  <action name="onoverIconOuvreautrevisite">
tween(scale, 1.2);
tween(alpha, 1);
pauseautorotation();
  </action>
  <action name="onoutIconOuvreautrevisite">
    hideTooltip();
tween(scale, 1);
tween(alpha, 0.8);
resumeautorotation();
  </action>

<!-- ************ -->
<!-- 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[fisheye].caption, contextmenufisheyelabel);
    getmessage(contextmenu.item[architectural].caption, contextmenuarchitecturallabel);
    getmessage(contextmenu.item[stereographic].caption, contextmenustereographiclabel);
    getmessage(contextmenu.item[pannini].caption, contextmenupanninilabel);
    getmessage(contextmenu.item[littleplanet].caption, contextmenulittleplanetlabel);
    getmessage(contextmenu.item[fisheyeball].caption, contextmenufisheyeballlabel);
    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|mobile"
        onavailable="delayedcall(1, checkGyroAvailability(););"
        enabled="false"
        />

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

<action name="checkGyroAvailability">
	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="%FIRSTXML%/graphics/footer/footer.png" 
         bgalpha="0.500007629510948"
         align="bottom"
         x="0"
         y="0"
         zorder="2"
         enabled="false"
         capture="true"
         visible="false"

         height="47"
         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"
		
			tooltip="logotooltipText"
			onhover="showTooltip(bottomleft);"
			onout="hideTooltip();"
         url="%FIRSTXML%/graphics/logo/logo_zooomez_100px.png" 
         handcursor="false"

         width="6%"
         height="prop"

         />

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

  <action name="hidelogo">
    set(layer[logo].visible, false);
  </action>
  <action name="showlogo">
      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.desktop,
      set(layer[theme2btn_display_help].x, get(theme2button_pos));
      set(layer[theme2btn_close_help  ].x, get(theme2button_pos));
      inc(theme2button_pos, 36);
    );

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



    set(layer[theme2btn_autorotate_on ].x, get(theme2button_pos));
    set(layer[theme2btn_autorotate_off].x, get(theme2button_pos));
    inc(theme2button_pos, 36);


    set(layer[theme2btn_autotour_on ].x, get(theme2button_pos));
    set(layer[theme2btn_autotour_off].x, get(theme2button_pos));
    inc(theme2button_pos, 36);


    set(layer[theme2btn_show_thumbnails].x, get(theme2button_pos));
    set(layer[theme2btn_hide_thumbnails].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);
    );

    set(layer[theme2btn_show_hotspots].x, get(theme2button_pos));
    set(layer[theme2btn_hide_hotspots].x, get(theme2button_pos));
    inc(theme2button_pos, 36);


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


    set(layer[theme2btn_home].x, get(theme2button_pos));
    set(layer[theme2btn_home].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="5"
         url="%FIRSTXML%/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="5"
         type="container"
         zorder="5"
         width="40"
         height="40"
         visible="false"
         alpha="1.0"
         >

    <layer name="theme2btn_hide_hotspots"
            url="%FIRSTXML%/graphics/classiccontrolbar/btn_hide_show_hotspots.png"
            style="theme2_btn_style"
            onclick="hideHotspots();"
            tooltip="controlBar_classichideSpotsTip"
            visible="false"
            />
    <layer name="theme2btn_show_hotspots"
            url="%FIRSTXML%/graphics/classiccontrolbar/btn_hide_show_hotspots.png"
            style="theme2_btn_style"
            onclick="showHotspots();"
            tooltip="controlBar_classicshowSpotsTip"
            visible="false"
            />


    <layer name="theme2btn_gyroscope_off"
            url="%FIRSTXML%/graphics/classiccontrolbar/btn_gyroscope.png"
            style="theme2_btn_style"
            onclick="disableGyroscope();"
            devices="tablet|mobile"
            tooltip="controlBar_classicgyroOffTip"
            visible="false"
            />
    <layer name="theme2btn_gyroscope_on"
            url="%FIRSTXML%/graphics/classiccontrolbar/btn_gyroscope.png"
            style="theme2_btn_style"
            onclick="enableGyroscope();"
            devices="tablet|mobile"
            tooltip="controlBar_classicgyroOnTip"
            visible="false"
            />


    <layer name="theme2btn_ctrlmode_move_to"
            url="%FIRSTXML%/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="%FIRSTXML%/graphics/classiccontrolbar/btn_drag_to.png"
            style="theme2_btn_style"
            tooltip="controlBar_classicctrlmodeDragTip"
            onclick="setControlModeDragTo();"
            visible="false"
            devices="desktop"
            />

    <layer name="theme2btn_in"
            url="%FIRSTXML%/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="%FIRSTXML%/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_home"
           url="%FIRSTXML%/graphics/classiccontrolbar/btn_home.png"
           onclick="theme2btn_home_action();"
           style="theme2_btn_style"
           tooltip="controlBar_classichomeTip"
           visible="false"
           />


  <layer name="theme2btn_hide_thumbnails"
         url="%FIRSTXML%/graphics/classiccontrolbar/btn_hide_thumbnails.png"
         style="theme2_btn_style"
         onclick="hideTourThumbnails();"
         tooltip="controlBar_classichideThumbnailsTip"
         visible="false"
         />
  <layer name="theme2btn_show_thumbnails"
         url="%FIRSTXML%/graphics/classiccontrolbar/btn_show_thumbnails.png"
         style="theme2_btn_style"
         onclick="showTourThumbnails();"
         tooltip="controlBar_classicshowThumbnailsTip"
         visible="false"
         />



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

    <layer name="theme2btn_autorotate_on"
            url="%FIRSTXML%/graphics/classiccontrolbar/btn_start_autorotation.png"
            onclick="startautorotation();"
            style="theme2_btn_style"
            visible="false"
            tooltip="controlBar_classicautorotateOnTip"
            />
    <layer name="theme2btn_autorotate_off"
            url="%FIRSTXML%/graphics/classiccontrolbar/btn_stop_autorotation.png"
            onclick="stopautorotation();"
            style="theme2_btn_style"
            visible="false"
            tooltip="controlBar_classicautorotateOffTip"
            />


    <layer name="theme2btn_autotour_on"
            url="%FIRSTXML%/graphics/classiccontrolbar/btn_start_automatic_tour.png"
            onclick="startautotour();"
            style="theme2_btn_style"
            visible="false"
            tooltip="controlBar_classicautotourOnTip"
            />
    <layer name="theme2btn_autotour_off"
            url="%FIRSTXML%/graphics/classiccontrolbar/btn_stop_automatic_tour.png"
            onclick="stopautotour();"
            style="theme2_btn_style"
            visible="false"
            tooltip="controlBar_classicautotourOffTip"
            />


    <layer name="theme2btn_display_help"
            url="%FIRSTXML%/graphics/classiccontrolbar/btn_help.png"
            onclick="theme2displayHelp();"
            style="theme2_btn_style"
            devices="desktop"
            visible="false"
            tooltip="controlBar_classicdisplayHelpTip"
            />
    <layer name="theme2btn_close_help"
            url="%FIRSTXML%/graphics/classiccontrolbar/btn_help.png"
            onclick="theme2closeHelp();"
            style="theme2_btn_style"
            visible="false"
            devices="desktop"
            tooltip="controlBar_classichideHelpTip"
            />



    <layer name="theme2btn_hidecontrols"
            url="%FIRSTXML%/graphics/classiccontrolbar/btn_hide_controls.png"
            style="theme2_btn_style"
            onclick="hideTourControls();"
            visible="false"
            tooltip="controlBar_classichideControlsTip"
            />
    <layer name="theme2btn_showcontrols"
            url="%FIRSTXML%/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, false);
				set(layer[theme2btn_gyroscope_on].visible, true);
			,
				set(layer[theme2btn_gyroscope_off].visible, true);
				set(layer[theme2btn_gyroscope_on].visible, false);
			);
		,
			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="theme2hideshowthumbnailsevent" 
		hidetourthumbnails="theme2updateHideShowThumbnailsButtons();" 
		showtourthumbnails="theme2updateHideShowThumbnailsButtons();" 
		keep="true" />
	<action name="theme2HideHideShowThumbnailsButtons">
		set(layer[theme2btn_show_thumbnails].visible, false);
		set(layer[theme2btn_hide_thumbnails].visible, false);
	</action>
	<action name="theme2ShowHideShowThumbnailsButtons">
		if (tour_displaythumbnails,
			set(layer[theme2btn_hide_thumbnails].visible, true);
			set(layer[theme2btn_show_thumbnails].visible, false);
		,
			set(layer[theme2btn_show_thumbnails].visible, true);
			set(layer[theme2btn_hide_thumbnails].visible, false);
		);
	</action>
	<action name="theme2updateHideShowThumbnailsButtons">
		if (tour_displaycontrols,
			theme2ShowHideShowThumbnailsButtons();
		,
			theme2HideHideShowThumbnailsButtons();
		);
	</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();


    theme2updateAutorotationButtons();

    theme2updateAutotourButtons();

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


    theme2updateControlModeButtons();
    theme2updateHideShowHotspotsButtons();

    theme2updateGyroscopeButtons();

    theme2updateHelpButtons();


    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);
    );
    set(layer[theme2btn_home].visible, true);


    theme2updateControlModeButtons();
    theme2updateHideShowHotspotsButtons();

    theme2updateGyroscopeButtons();

    theme2updateHelpButtons();


    theme2updateFullscreenButtons();


    theme2updateAutorotationButtons();

    theme2updateAutotourButtons();

      theme2updateHideShowThumbnailsButtons();
  </action>


  <layer name="theme2helpScreenFg" align="center" keep="true" onclick="theme2closeHelp();" displayed="false" 
         url="%FIRSTXML%/graphics/classiccontrolbar/aide_thumbnails_hs_carte2.png" 
         alpha="1.0" 
         zorder="97"
         visible="false" />
  <action name="theme2displayHelp">
    set(layer[theme2helpScreenFg].displayed,true);
    set(layer[theme2helpScreenFg].visible,true);
    theme2updateHelpButtons();
  </action>
  <action name="theme2closeHelp">
    set(layer[theme2helpScreenFg].displayed,false);
    set(layer[theme2helpScreenFg].visible,false);
    theme2updateHelpButtons();
  </action>
	<action name="theme2HideHelpButtons">
		set(layer[theme2btn_display_help].visible, false);
		set(layer[theme2btn_close_help].visible, false);
	</action>
	<action name="theme2ShowHelpButtons">
		if (layer[theme2helpScreenFg].displayed,
			set(layer[theme2btn_close_help].visible, true);
			set(layer[theme2btn_display_help].visible, false);
		,
			set(layer[theme2btn_display_help].visible, true);
			set(layer[theme2btn_close_help].visible, false);
		);
	</action>
	<action name="theme2updateHelpButtons">
	if (device.desktop,
		if (tour_displaycontrols,
			theme2ShowHelpButtons();
		,
			theme2HideHelpButtons();
		);
	,
		theme2HideHelpButtons();
	);
	</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>

	<events name="theme2AutorotationEvents"
		onstartautorotation="theme2updateAutorotationButtons();"
		onresumeautorotation="theme2updateAutorotationButtons();"
		onstopautorotation="theme2updateAutorotationButtons();"
		onpauseautorotation="theme2updateAutorotationButtons();"
		keep="true"/>
	<action name="theme2HideAutorotationButtons">
		set(layer[theme2btn_autorotate_off].visible, false);
		set(layer[theme2btn_autorotate_on].visible , false);
	</action>
	<action name="theme2ShowAutorotationButtons">
		if(tour_autorotateenabled==false,
			set(layer[theme2btn_autorotate_off].visible, false);
			set(layer[theme2btn_autorotate_on].visible , true);
		,
			set(layer[theme2btn_autorotate_off].visible, true);
			set(layer[theme2btn_autorotate_on].visible , false);
		);
	</action>
	<action name="theme2updateAutorotationButtons">
		if (tour_displaycontrols,
			theme2ShowAutorotationButtons();
		,
			theme2HideAutorotationButtons();
		);
	</action>


	<events name="theme2AutotourEvents"
		onstartautotour="theme2updateAutotourButtons();"
		onstopautotour="theme2updateAutotourButtons();"
		keep="true"/>
	<action name="theme2HideAutotourButtons">
		set(layer[theme2btn_autotour_off].visible, false);
		set(layer[theme2btn_autotour_on].visible , false);
	</action>
	<action name="theme2ShowAutotourButtons">
		if (tour_autotourenabled == false,
			set(layer[theme2btn_autotour_off].visible, false);
			set(layer[theme2btn_autotour_on].visible , true);
		,
			set(layer[theme2btn_autotour_off].visible, true);
			set(layer[theme2btn_autotour_on].visible , false);
		);
	</action>
	<action name="theme2updateAutotourButtons">
		if (tour_displaycontrols,
			theme2ShowAutotourButtons();
		,
			theme2HideAutotourButtons();
		);
	</action>


	<events name="theme2hotspotsdisplayevents"
		hotspots_visibility_changed="theme2updateHideShowHotspotsButtons"
		keep="true"/>
	<action name="theme2HideHideShowHotspotsButtons">
		set(layer[theme2btn_show_hotspots].visible, false);
		set(layer[theme2btn_hide_hotspots].visible, false);
	</action>
	<action name="theme2ShowHideShowHotspotsButtons">
		if (tour_displayspots,
			set(layer[theme2btn_hide_hotspots].visible, true);
			set(layer[theme2btn_show_hotspots].visible, false);
		,
			set(layer[theme2btn_show_hotspots].visible, true);
			set(layer[theme2btn_hide_hotspots].visible, false);
		);
	</action>
	<action name="theme2updateHideShowHotspotsButtons">
		if (tour_displaycontrols,
			theme2ShowHideShowHotspotsButtons();
		,
			theme2HideHideShowHotspotsButtons();
		);
	</action>

    <action name="theme2btn_home_action">
      lookto(get(panoview.h),get(panoview.v),get(panoview.fov),smooth(100,20,50));
    </action>


  <textstyle name="theme2menuTooltipStyle"
             font="Helvetica"
             fontsize="16"
             bold="true"
             italic="false"
             background="false"
             border="false"
             alpha="0.8"
             blendmode="layer"
             textcolor="0xffffff"
             effect="glow(0x111111,0.8);"
             origin="bottom"
             yoffset="55"
             edge="center"
             xoffset="0"
             textalign="center"
             noclip="true"
             devices="flash"
             />
	<layer name="theme2menuTooltipStyle"
		keep="true"
		enabled="false"
		capture="false"
		url="%FIRSTXML%/graphics/textfield.swf"
		align="center"
		background="true"
		backgroundcolor="0xdedede"
		backgroundalpha="0"
		border="false"
		bordercolor="0xffffff"
		css="color:#ffffff;font-family:Helvetica;font-weight:bold;font-size:16px;text-align:center;"
		width="200"
		height="20"
		autoheight="true"
			edge="bottom"
		textshadow="1.0"
		selectable="false"
		zorder="0"
		html=""
		visible="false"
		devices="html5"
		/>

  <!-- ****** -->
  <!-- Header -->
  <!-- ****** -->
  <layer name="header"
         keep="true"
         url="%FIRSTXML%/graphics/header/header.png" 
         bgalpha="0.500007629510948"
         align="top"
         x="0"
         y="0"
         zorder="7"
         enabled="false"
         capture="true"
         visible="false"

         height="45"
         width="75%"

         />

  <events name="headerevents"
    onTourStart="showheader();"
    hidetourcontrols="hideheader();"
    showtourcontrols="showheader();"
    keep="true" />

  <action name="hideheader">
    set(layer[header].visible, false);
  </action>
  <action name="showheader">
    set(layer[header].visible, true);
  </action>

  <!-- ******************************************* -->
  <!-- Button : bottom -->
  <!-- ******************************************* -->
  <layer name="button"
         keep="true"
         url="%FIRSTXML%/graphics/button/btn_scroll_left_blanc.png" 
         align="bottom"
         x="-250"
         y="0"
         zorder="8"
         visible="false"
         onclick="buttonOnClick"
         alpha="0.7"
         tooltip="buttontooltip"
         onhover="showTooltip(bottom);"
         onout="hideTooltip();tween(scale, 1.0,0.5,easeOutQuad);tween(alpha,0.7,0.5,easeOutQuad);"
         onover="tween(scale, 1.2,0.5,easeOutQuad);tween(alpha,1.0,0.5,easeOutQuad);"
         />
  <action name="buttonOnClick">
loadPreviousScene();
  </action>

  <events name="buttonevents" 
    onTourStart="showbutton();"
    hidetourcontrols="hidebutton();" 
    showtourcontrols="showbutton();" 
    keep="true" />
  <action name="hidebutton">set(layer[button].visible, false);</action>
  <action name="showbutton">set(layer[button].visible, true);</action>

  <!-- ******************************************* -->
  <!-- Button : bottom -->
  <!-- ******************************************* -->
  <layer name="button1"
         keep="true"
         url="%FIRSTXML%/graphics/button1/btn_scroll_right_blanc.png" 
         align="bottom"
         x="250"
         y="0"
         zorder="9"
         visible="false"
         onclick="button1OnClick"
         alpha="0.7"
         onout="tween(scale, 1.0,0.5,easeOutQuad);tween(alpha,0.7,0.5,easeOutQuad);"
         onover="tween(scale, 1.2,0.5,easeOutQuad);tween(alpha,1.0,0.5,easeOutQuad);"
         />
  <action name="button1OnClick">
loadNextScene();
  </action>

  <events name="button1events" 
    onTourStart="showbutton1();"
    hidetourcontrols="hidebutton1();" 
    showtourcontrols="showbutton1();" 
    keep="true" />
  <action name="hidebutton1">set(layer[button1].visible, false);</action>
  <action name="showbutton1">set(layer[button1].visible, true);</action>

	<!-- ********************** -->
	<!-- Classic Thumbnails Bar -->
	<!-- ********************** -->




<layer name="thumbnailsBar-thumbnailsBar-theme02" 
	keep="true" 
	type="image" 
	visible="false"
	align="right" 
	
		width="0" 
		height="75%" 
	
	x="0"
	y="10"
	
	url="%FIRSTXML%/graphics/classicthumbnailsbar/frame_bg.png" 
	scale9grid="10|10|80|80"
	
	zorder="10"
/>



<layer name="thumbnailBorderSource-thumbnailsBar-theme02"
	keep="true"
	visible="false"
	onloaded="loadedImages-thumbnailsBar-theme02(border);"
	url="%FIRSTXML%/graphics/classicthumbnailsbar/thumbnails_states.png" 
	offsetX="10"
	offsetY="10"
	quarterHeight="0"			
/>



<textstyle name="tooltipStyle-thumbnailsBar-theme02"
	font="Helvetica"
	fontsize="16"
	bold="true"
	italic="false"
	background="false"
	border="false"
	alpha="0.8"
	blendmode="layer"
	textcolor="0xFFFFFF"
	effect="glow(0x111111,0.8);"
	edge="bottom"
	origin="cursor"
	noclip="true"
	devices="flash"
/>
<layer name="tooltipStyle-thumbnailsBar-theme02"
	keep="true"
	enabled="false"
	capture="false"
	url="%FIRSTXML%/graphics/textfield.swf"
	align="center"
	background="true"
	backgroundcolor="0xffffff"
	backgroundalpha="0.4"
	border="false"
	bordercolor="0xffffff"
	css="color:#FFFFFF;font-family:Helvetica;font-weight:bold;font-size:16px;text-align:center;"
	width="200"
	height="20"
	autoheight="true"
	edge="bottom"
	selectable="false"
	zorder="0"
	visible="false"
	html=""
	devices="html5"
/>

	<krpano arrow1Loaded-thumbnailsBar-theme02="false" arrow2Loaded-thumbnailsBar-theme02="false" borderLoaded-thumbnailsBar-theme02="false" thumbnailsLoadedCounter-thumbnailsBar-theme02="0" thumbsCount-thumbnailsBar-theme02="0" thumbsCounter-thumbnailsBar-theme02="0" firstInit-thumbnailsBar-theme02="false" />
	
	
	<events name="thumbnailsScrollEvents-thumbnailsBar-theme02" 
		keep="true" 
		
		onxmlcomplete="ifnot(startResize-thumbnailsBar-theme02,set(isLoaded-thumbnailsBar-theme02, true);if(isStarted-thumbnailsBar-theme02,onLoadCompleteHandler-thumbnailsBar-theme02();););"
		onTourStart="set(isStarted-thumbnailsBar-theme02, true);if(isLoaded-thumbnailsBar-theme02,onLoadCompleteHandler-thumbnailsBar-theme02(););"
		onnewpano="if(startResize-thumbnailsBar-theme02,if(firstInit-thumbnailsBar-theme02,onLoadCompleteHandler-thumbnailsBar-theme02();););"
		onresize="onResizeHandler-thumbnailsBar-theme02();"
		hidetourthumbnails="hideWithThumbnailsButton-thumbnailsBar-theme02();" 
		showtourthumbnails="showWithThumbnailsButton-thumbnailsBar-theme02();" 
		hidetourcontrols="hideWithControlsBar-thumbnailsBar-theme02();" 
		showtourcontrols="showWithControlsBar-thumbnailsBar-theme02();" 
		onenterfullscreen="delayedcall(0.2,scrollToCurrentThumb-thumbnailsBar-theme02(););"
		onexitfullscreen="delayedcall(0.2,scrollToCurrentThumb-thumbnailsBar-theme02(););"
	/>
	
	
	<layer name="scrollAreaContainer-thumbnailsBar-theme02" 
		keep="true"
		type="container" 
		align="topleft"
		x="5"
		y="5"
		
		marginX="5"
		marginY="5"
		
		width="0" 
		height="0"
		
		scrollSpeedInit="10"
		scrollSpeed="10"
		scrollSpeedMax="70"
		scrollSpeedAcceleration="20"
		
		parent="thumbnailsBar-thumbnailsBar-theme02"
		
		thumbWidth="0"
		thumbHeight="0"
		
		itemWidth="150"
		itemHeight="75"
		
		offsetX="0"
		offsetY="0"
		
		thumbSpacer="0"
		currentThumbsCount="0"
		
		adjustToContent="true"
		
		zorder="1"
		visible="false"
		ready="false"
	>
	
		
		<layer name="thumbsScrollArea-thumbnailsBar-theme02" 
			url="%FIRSTXML%/graphics/scrollarea.swf" 
			alturl="%FIRSTXML%/graphics/scrollarea.js" 
			align="right"
			onhover_autoscrolling="false"
			
			x="0"
			y="0"
			 
				direction="v" 
		/>
	
	</layer>
	
	
	
	<layer name="scrollPrevArrow-thumbnailsBar-theme02" 
		keep="true"
		type="image"
		visible="false"
		parent="thumbnailsBar-thumbnailsBar-theme02"
		targetHeight="0"
		tagertWidth="0"
		zorder="2"
		onloaded="loadedImages-thumbnailsBar-theme02(arrow1);"
			url="%FIRSTXML%/graphics/classicthumbnailsbar/btn_scroll_up.png"
			align="top"
	/>
	
	
	
	<layer name="scrollNextArrow-thumbnailsBar-theme02" 
		keep="true"
		type="image"
		visible="false"
		parent="thumbnailsBar-thumbnailsBar-theme02"
		targetHeight="0"
		targetWidth="0"
		zorder="2"
		onloaded="loadedImages-thumbnailsBar-theme02(arrow2);"
			url="%FIRSTXML%/graphics/classicthumbnailsbar/btn_scroll_down.png"
			align="bottom"
	/>
	
	<action name="loadedImages-thumbnailsBar-theme02">
		if(%1 == "arrow1",
			set(arrow1Loaded-thumbnailsBar-theme02, true);
		);
		if(%1 == "arrow2",
			set(arrow2Loaded-thumbnailsBar-theme02, true);
		);
		if(%1 == "border",
			if(layer[thumbnailBorderSource-thumbnailsBar-theme02].url,
				set(borderLoaded-thumbnailsBar-theme02, true);
			);
		);
		if(%1 == "thumbnail",
			inc(thumbnailsLoadedCounter-thumbnailsBar-theme02);
		);
	</action>
	
	<action name="onLoadCompleteHandler-thumbnailsBar-theme02">
		
		set(thumbsCount-thumbnailsBar-theme02, 0);
		
		
		set(thumbsCount-thumbnailsBar-theme02, get(scene.count));
		
		
		
		
		
		loadThumbs-thumbnailsBar-theme02();
		
		if(firstInit-thumbnailsBar-theme02,
			onLoadCompleteHandlerPartThree-thumbnailsBar-theme02();
		,
			onLoadCompleteHandlerPartTwo-thumbnailsBar-theme02();
		);
	</action>
	
	<action name="onLoadCompleteHandlerPartTwo-thumbnailsBar-theme02">
		set(imgCounter-thumbnailsBar-theme02, 3);
		
		if(arrow1Loaded-thumbnailsBar-theme02,
			dec(imgCounter-thumbnailsBar-theme02);
		);
		if(arrow2Loaded-thumbnailsBar-theme02,
			dec(imgCounter-thumbnailsBar-theme02);
		);
		if(thumbsCount-thumbnailsBar-theme02 == thumbnailsLoadedCounter-thumbnailsBar-theme02,
			dec(imgCounter-thumbnailsBar-theme02);
		);
		
		if(imgCounter-thumbnailsBar-theme02 LE 0,
			stopdelayedcall(delayedCallOnLoadComplete-thumbnailsBar-theme02);
			onLoadCompleteHandlerPartThree-thumbnailsBar-theme02();
		,
			delayedcall(delayedCallOnLoadComplete-thumbnailsBar-theme02, 0.2, onLoadCompleteHandlerPartTwo-thumbnailsBar-theme02());
		);
	</action>
	
	<action name="onLoadCompleteHandlerPartThree-thumbnailsBar-theme02">
		resetMouseBehavior-thumbnailsBar-theme02();
		highlightCurrentThumb-thumbnailsBar-theme02();
		
		
		if(layer[scrollAreaContainer-thumbnailsBar-theme02].adjustToContent,
			mul(adjustWidth-thumbnailsBar-theme02, get(layer[scrollAreaContainer-thumbnailsBar-theme02].marginX), 2);
			add(adjustWidth-thumbnailsBar-theme02, get(layer[thumbsScrollArea-thumbnailsBar-theme02].width));
			mul(adjustHeight-thumbnailsBar-theme02, get(layer[scrollAreaContainer-thumbnailsBar-theme02].marginY), 2);
			add(adjustHeight-thumbnailsBar-theme02, get(layer[thumbsScrollArea-thumbnailsBar-theme02].height));
			
			
			if(adjustWidth-thumbnailsBar-theme02 GT stagewidth,
				set(adjustWidth-thumbnailsBar-theme02, get(stagewidth));
				set(layer[scrollAreaContainer-thumbnailsBar-theme02].adjustToContent, false);
			,
				if(adjustHeight-thumbnailsBar-theme02 GT stageheight,
					set(adjustHeight-thumbnailsBar-theme02, get(stageheight));
					set(layer[scrollAreaContainer-thumbnailsBar-theme02].adjustToContent, false);
				);
			);
			
			setSize-thumbnailsBar-theme02(get(adjustWidth-thumbnailsBar-theme02), get(adjustHeight-thumbnailsBar-theme02));
		);
		
		setupArrows-thumbnailsBar-theme02(true);
		
		
		if (thumbsCounter-thumbnailsBar-theme02 LE 0,
			set(layer[thumbnailsBar-thumbnailsBar-theme02].visible, false);
		);
		
		
		set(startResize-thumbnailsBar-theme02, true);
		set(firstInit-thumbnailsBar-theme02, true);
	</action>
	
	
	<action name="onResizeHandler-thumbnailsBar-theme02">
		
		delayedcall(0.1, onResizeCallback-thumbnailsBar-theme02(false); );
	</action>
	
	
	<action name="onResizeCallback-thumbnailsBar-theme02">
		if(startResize-thumbnailsBar-theme02,
			setSize-thumbnailsBar-theme02(get(layer[scrollAreaContainer-thumbnailsBar-theme02].targetWidth), get(layer[scrollAreaContainer-thumbnailsBar-theme02].targetHeight));
			setupArrows-thumbnailsBar-theme02(%1);
			
			
			if (thumbsCounter-thumbnailsBar-theme02 LE 0,
				set(layer[thumbnailsBar-thumbnailsBar-theme02].visible, false);
			);
		);
	</action>
	
	
		<action name="showWithThumbnailsButton-thumbnailsBar-theme02">
			set(layer[thumbnailsBar-thumbnailsBar-theme02].visible, true);
			onResizeCallback-thumbnailsBar-theme02(true);
		</action>
		
		<action name="hideWithThumbnailsButton-thumbnailsBar-theme02">
			set(layer[thumbnailsBar-thumbnailsBar-theme02].visible, false);
		</action>
	
	
		<action name="showWithControlsBar-thumbnailsBar-theme02">
			
				if (tour_displaythumbnails,
					set(layer[thumbnailsBar-thumbnailsBar-theme02].visible, true);
					onResizeCallback-thumbnailsBar-theme02(true);
				,
					set(layer[thumbnailsBar-thumbnailsBar-theme02].visible, false);
				);
		</action>
		
		<action name="hideWithControlsBar-thumbnailsBar-theme02">
			set(layer[thumbnailsBar-thumbnailsBar-theme02].visible, false);
		</action>
	
	
	<action name="thumbnailBorderDrawInit-thumbnailsBar-theme02">
		
		set(layer[scrollAreaContainer-thumbnailsBar-theme02].offsetX, get(layer[thumbnailBorderSource-thumbnailsBar-theme02].borderWidth));
		set(layer[scrollAreaContainer-thumbnailsBar-theme02].offsetY, get(layer[thumbnailBorderSource-thumbnailsBar-theme02].borderWidth));
		
		
		mul(totalOffsetX-thumbnailsBar-theme02, get(layer[thumbnailBorderSource-thumbnailsBar-theme02].borderWidth), 2);
		mul(totalOffsetY-thumbnailsBar-theme02, get(layer[thumbnailBorderSource-thumbnailsBar-theme02].borderWidth), 2);
		
		
		if(startResize-thumbnailsBar-theme02,
			sub(layer[scrollAreaContainer-thumbnailsBar-theme02].itemWidth, get(totalOffsetX-thumbnailsBar-theme02));
			sub(layer[scrollAreaContainer-thumbnailsBar-theme02].itemHeight, get(totalOffsetY-thumbnailsBar-theme02));
		);
		
		
		set(layer[scrollAreaContainer-thumbnailsBar-theme02].thumbWidth, get(layer[scrollAreaContainer-thumbnailsBar-theme02].itemWidth));
		set(layer[scrollAreaContainer-thumbnailsBar-theme02].thumbHeight, get(layer[scrollAreaContainer-thumbnailsBar-theme02].itemHeight));
		
		add(layer[scrollAreaContainer-thumbnailsBar-theme02].itemWidth, get(totalOffsetX-thumbnailsBar-theme02));
		add(layer[scrollAreaContainer-thumbnailsBar-theme02].itemHeight, get(totalOffsetY-thumbnailsBar-theme02));
	</action>
		
	
	<action name="thumbnailBorderImageInit-thumbnailsBar-theme02">
		
		set(layer[scrollAreaContainer-thumbnailsBar-theme02].offsetX, get(layer[thumbnailBorderSource-thumbnailsBar-theme02].offsetX));
		set(layer[scrollAreaContainer-thumbnailsBar-theme02].offsetY, get(layer[thumbnailBorderSource-thumbnailsBar-theme02].offsetY));
		
		
		mul(totalOffsetX-thumbnailsBar-theme02, get(layer[thumbnailBorderSource-thumbnailsBar-theme02].offsetX), 2);
		mul(totalOffsetY-thumbnailsBar-theme02, get(layer[thumbnailBorderSource-thumbnailsBar-theme02].offsetY), 2);
		
		
		if(startResize-thumbnailsBar-theme02,
			sub(layer[scrollAreaContainer-thumbnailsBar-theme02].itemWidth, get(totalOffsetX-thumbnailsBar-theme02));
			sub(layer[scrollAreaContainer-thumbnailsBar-theme02].itemHeight, get(totalOffsetY-thumbnailsBar-theme02));
		);
		
		
		set(layer[scrollAreaContainer-thumbnailsBar-theme02].thumbWidth, get(layer[scrollAreaContainer-thumbnailsBar-theme02].itemWidth));
		set(layer[scrollAreaContainer-thumbnailsBar-theme02].thumbHeight, get(layer[scrollAreaContainer-thumbnailsBar-theme02].itemHeight));
		
		add(layer[scrollAreaContainer-thumbnailsBar-theme02].itemWidth, get(totalOffsetX-thumbnailsBar-theme02));
		add(layer[scrollAreaContainer-thumbnailsBar-theme02].itemHeight, get(totalOffsetY-thumbnailsBar-theme02));
		
		
		div(layer[thumbnailBorderSource-thumbnailsBar-theme02].quarterHeight, get(layer[thumbnailBorderSource-thumbnailsBar-theme02].height), 4);
		
		
		set(cropX-thumbnailsBar-theme02, 0);
		set(cropY-thumbnailsBar-theme02, 0);
		set(cropW-thumbnailsBar-theme02, get(layer[thumbnailBorderSource-thumbnailsBar-theme02].width));
		set(cropH-thumbnailsBar-theme02, get(layer[thumbnailBorderSource-thumbnailsBar-theme02].quarterHeight));
		txtadd(layer[thumbnailBorderSource-thumbnailsBar-theme02].cropDefault, get(cropX-thumbnailsBar-theme02), '|', get(cropY-thumbnailsBar-theme02), '|', get(cropW-thumbnailsBar-theme02), '|', get(cropH-thumbnailsBar-theme02));

		
		add(cropY-thumbnailsBar-theme02, get(layer[thumbnailBorderSource-thumbnailsBar-theme02].quarterHeight));
		txtadd(layer[thumbnailBorderSource-thumbnailsBar-theme02].cropHover, get(cropX-thumbnailsBar-theme02), '|', get(cropY-thumbnailsBar-theme02), '|', get(cropW-thumbnailsBar-theme02), '|', get(cropH-thumbnailsBar-theme02));
		
		
		add(cropY-thumbnailsBar-theme02, get(layer[thumbnailBorderSource-thumbnailsBar-theme02].quarterHeight));
		txtadd(layer[thumbnailBorderSource-thumbnailsBar-theme02].cropSelected, get(cropX-thumbnailsBar-theme02), '|', get(cropY-thumbnailsBar-theme02), '|', get(cropW-thumbnailsBar-theme02), '|', get(cropH-thumbnailsBar-theme02));
		
		
		add(cropY-thumbnailsBar-theme02, get(layer[thumbnailBorderSource-thumbnailsBar-theme02].quarterHeight));
		txtadd(layer[thumbnailBorderSource-thumbnailsBar-theme02].cropVisited, get(cropX-thumbnailsBar-theme02), '|', get(cropY-thumbnailsBar-theme02), '|', get(cropW-thumbnailsBar-theme02), '|', get(cropH-thumbnailsBar-theme02));
		
		
		set(scaleX-thumbnailsBar-theme02, get(layer[thumbnailBorderSource-thumbnailsBar-theme02].offsetX));
		set(scaleY-thumbnailsBar-theme02, get(layer[thumbnailBorderSource-thumbnailsBar-theme02].offsetY));
		sub(scaleW-thumbnailsBar-theme02, get(layer[thumbnailBorderSource-thumbnailsBar-theme02].width), get(totalOffsetX-thumbnailsBar-theme02));
		sub(scaleH-thumbnailsBar-theme02, get(layer[thumbnailBorderSource-thumbnailsBar-theme02].quarterHeight), get(totalOffsetY-thumbnailsBar-theme02));
		txtadd(layer[thumbnailBorderSource-thumbnailsBar-theme02].scale9grid, get(scaleX-thumbnailsBar-theme02), '|', get(scaleY-thumbnailsBar-theme02), '|', get(scaleW-thumbnailsBar-theme02), '|', get(scaleH-thumbnailsBar-theme02));
	</action>
	
	
	<action name="loadThumbs-thumbnailsBar-theme02">
		
		

		loadThumbsPartTwo-thumbnailsBar-theme02();
	</action>
	
	<action name="loadThumbsPartTwo-thumbnailsBar-theme02">
		if(layer[thumbnailBorderSource-thumbnailsBar-theme02].url,
			set(imgCounter-thumbnailsBar-theme02, 1);
		,
			set(imgCounter-thumbnailsBar-theme02, 0);
		);
		
		if(layer[thumbnailBorderSource-thumbnailsBar-theme02].url,
			if(borderLoaded-thumbnailsBar-theme02,
				dec(imgCounter-thumbnailsBar-theme02);
			);
		);
		
		if(imgCounter-thumbnailsBar-theme02 LE 0,
			stopdelayedcall(delayedCallOnLoadCompleteBorder-thumbnailsBar-theme02);
			loadThumbsPartThree-thumbnailsBar-theme02();
		,
			delayedcall(delayedCallOnLoadCompleteBorder-thumbnailsBar-theme02, 0.2, loadThumbsPartTwo-thumbnailsBar-theme02());
		);
	</action>
	
	<action name="loadThumbsPartThree-thumbnailsBar-theme02">
		ifnot(layer[scrollAreaContainer-thumbnailsBar-theme02].ready,
			
			
			if(layer[thumbnailBorderSource-thumbnailsBar-theme02].url,
				thumbnailBorderImageInit-thumbnailsBar-theme02();
			,
				thumbnailBorderDrawInit-thumbnailsBar-theme02();
			);
			
			
			set(thumbsCounter-thumbnailsBar-theme02, 0);
			
			
			set(i-thumbnailsBar-theme02-wait,25);
			
			
				for( set(i-thumbnailsBar-theme02, 0), i-thumbnailsBar-theme02 LT scene.count, inc(i-thumbnailsBar-theme02),
					if(i-thumbnailsBar-theme02-wait == i-thumbnailsBar-theme02,
						add(i-thumbnailsBar-theme02-wait,25);
						wait(0);
					);
					createThumb-thumbnailsBar-theme02(get(scene[get(i-thumbnailsBar-theme02)].name), get(scene[get(i-thumbnailsBar-theme02)].thumburl), get(i-thumbnailsBar-theme02), get(scene[get(i-thumbnailsBar-theme02)].titleid));
					inc(thumbsCounter-thumbnailsBar-theme02);
				);
			
			
			
			
			
			
			set(layer[scrollAreaContainer-thumbnailsBar-theme02].currentThumbsCount, get(thumbsCounter-thumbnailsBar-theme02));
			
			
			setSize-thumbnailsBar-theme02(get(layer[get(layer[scrollAreaContainer-thumbnailsBar-theme02].parent)].width), get(layer[get(layer[scrollAreaContainer-thumbnailsBar-theme02].parent)].height));
			
			
			set(layer[scrollAreaContainer-thumbnailsBar-theme02].visible, true);
			
			
				if (tour_displaycontrols,
					showWithControlsBar-thumbnailsBar-theme02();
				,
					hideWithControlsBar-thumbnailsBar-theme02();
				);
			
			
			set(layer[scrollAreaContainer-thumbnailsBar-theme02].ready, true);
		);
	</action>
	
	
	<action name="setSize-thumbnailsBar-theme02">
		
		
		set(layer[scrollAreaContainer-thumbnailsBar-theme02].targetWidth, %1);
		set(layer[scrollAreaContainer-thumbnailsBar-theme02].targetHeight, %2);
		
		
		set(layer[get(layer[scrollAreaContainer-thumbnailsBar-theme02].parent)].width, %1);
		set(layer[get(layer[scrollAreaContainer-thumbnailsBar-theme02].parent)].height, %2);
		layer[get(layer[scrollAreaContainer-thumbnailsBar-theme02].parent)].updatepos();
		
		
		mul(totalMarginX-thumbnailsBar-theme02, get(layer[scrollAreaContainer-thumbnailsBar-theme02].x), 2);
		mul(totalMarginY-thumbnailsBar-theme02, get(layer[scrollAreaContainer-thumbnailsBar-theme02].y), 2);
		
			add(totalPluginWidth-thumbnailsBar-theme02, get(totalMarginX-thumbnailsBar-theme02), get(layer[scrollAreaContainer-thumbnailsBar-theme02].itemWidth));
			
			
			
			if(layer[get(layer[scrollAreaContainer-thumbnailsBar-theme02].parent)].pixelwidth LT totalPluginWidth-thumbnailsBar-theme02,
				set(layer[get(layer[scrollAreaContainer-thumbnailsBar-theme02].parent)].width, get(totalPluginWidth-thumbnailsBar-theme02));
			);
		
		layer[get(layer[scrollAreaContainer-thumbnailsBar-theme02].parent)].updatepos();
		
		
		sub(containerWidth-thumbnailsBar-theme02, get(layer[get(layer[scrollAreaContainer-thumbnailsBar-theme02].parent)].pixelwidth), get(totalMarginX-thumbnailsBar-theme02));
		sub(containerHeight-thumbnailsBar-theme02, get(layer[get(layer[scrollAreaContainer-thumbnailsBar-theme02].parent)].pixelheight), get(totalMarginY-thumbnailsBar-theme02));

		
		set(layer[scrollAreaContainer-thumbnailsBar-theme02].width, get(containerWidth-thumbnailsBar-theme02));
		set(layer[scrollAreaContainer-thumbnailsBar-theme02].height, get(containerHeight-thumbnailsBar-theme02));
		
		set(scrollAreaSize-thumbnailsBar-theme02, 0);
		
		
		mul(totalThumbsSpacer-thumbnailsBar-theme02, get(layer[scrollAreaContainer-thumbnailsBar-theme02].currentThumbsCount), get(layer[scrollAreaContainer-thumbnailsBar-theme02].thumbSpacer));
		sub(totalThumbsSpacer-thumbnailsBar-theme02, get(layer[scrollAreaContainer-thumbnailsBar-theme02].thumbSpacer));
		
		set(layer[get(layer[scrollAreaContainer-thumbnailsBar-theme02].parent)].visible, true);
		
		
			mul(scrollAreaSize-thumbnailsBar-theme02, get(layer[scrollAreaContainer-thumbnailsBar-theme02].itemHeight), get(layer[scrollAreaContainer-thumbnailsBar-theme02].currentThumbsCount));
			add(scrollAreaSize-thumbnailsBar-theme02, get(totalThumbsSpacer-thumbnailsBar-theme02));

			set(layer[thumbsScrollArea-thumbnailsBar-theme02].width, get(layer[scrollAreaContainer-thumbnailsBar-theme02].itemWidth));
			set(layer[thumbsScrollArea-thumbnailsBar-theme02].height, get(scrollAreaSize-thumbnailsBar-theme02));
			
			
			if(layer[scrollAreaContainer-thumbnailsBar-theme02].height LT layer[scrollAreaContainer-thumbnailsBar-theme02].itemHeight,
				set(layer[get(layer[scrollAreaContainer-thumbnailsBar-theme02].parent)].visible, false);
			,
				verifyThumbnailsBarVisibility-thumbnailsBar-theme02();
			);
			
		
		
		if(layer[get(layer[scrollAreaContainer-thumbnailsBar-theme02].parent)].width LT 0,
			set(layer[get(layer[scrollAreaContainer-thumbnailsBar-theme02].parent)].visible, false);
		);
		
	</action>
	
	
	<action name="verifyThumbnailsBarVisibility-thumbnailsBar-theme02">
		if(layer[get(layer[scrollAreaContainer-thumbnailsBar-theme02].parent)].visible,
			set(boolValue-thumbnailsBar-theme02, false);
			
			if (tour_displaythumbnails,
				if (tour_displaycontrols,
					set(boolValue-thumbnailsBar-theme02, true);
				);
			);
			
			set(layer[get(layer[scrollAreaContainer-thumbnailsBar-theme02].parent)].visible, get(boolValue-thumbnailsBar-theme02));
		);
	</action>
	
	
	<action name="createThumb-thumbnailsBar-theme02">

			add(offsetFactor-thumbnailsBar-theme02, get(layer[scrollAreaContainer-thumbnailsBar-theme02].itemHeight), get(layer[scrollAreaContainer-thumbnailsBar-theme02].thumbSpacer));
	
			mul(thumbIncPos-thumbnailsBar-theme02, %3, get(offsetFactor-thumbnailsBar-theme02));
			
			
			if(layer[thumbnailBorderSource-thumbnailsBar-theme02].url,
				add(thumbIncPos-thumbnailsBar-theme02, get(layer[scrollAreaContainer-thumbnailsBar-theme02].offsetY));
			);
			
		
		mul(negativeOffsetX-thumbnailsBar-theme02, get(layer[scrollAreaContainer-thumbnailsBar-theme02].offsetX), -1);
		mul(negativeOffsetY-thumbnailsBar-theme02, get(layer[scrollAreaContainer-thumbnailsBar-theme02].offsetY), -1);
		
		set(thumbName, 'thumb_');
		txtadd(thumbName, %1);
		txtadd(thumbName, '-thumbnailsBar-theme02');
		addlayer(get(thumbName));
		
		set(thumbBorderName, 'thumbBorder_');
		txtadd(thumbBorderName, %1);
		txtadd(thumbBorderName, '-thumbnailsBar-theme02');
		addlayer(get(thumbBorderName));
		
		
		ifnot(layer[thumbnailBorderSource-thumbnailsBar-theme02].url,
			set(layer[get(thumbBorderName)].type, container);
			set(layer[get(thumbBorderName)].parent, thumbsScrollArea-thumbnailsBar-theme02);
		);
		
		
		set(layer[get(thumbName)].onloaded, loadedImages-thumbnailsBar-theme02("thumbnail"););
		set(layer[get(thumbName)].url, %2);
		set(layer[get(thumbName)].keep, true);
		set(layer[get(thumbName)].width, get(layer[scrollAreaContainer-thumbnailsBar-theme02].thumbWidth));
		set(layer[get(thumbName)].height, get(layer[scrollAreaContainer-thumbnailsBar-theme02].thumbHeight));
		set(layer[get(thumbName)].align, topleft);
		
		
			set(layer[get(thumbName)].x, get(layer[scrollAreaContainer-thumbnailsBar-theme02].offsetX));
		
			if(layer[thumbnailBorderSource-thumbnailsBar-theme02].url,
				set(layer[get(thumbName)].parent, thumbsScrollArea-thumbnailsBar-theme02);
				set(layer[get(thumbName)].y, get(thumbIncPos-thumbnailsBar-theme02));
			,
				set(layer[get(thumbName)].parent, get(thumbBorderName));
				set(layer[get(thumbName)].y, get(layer[scrollAreaContainer-thumbnailsBar-theme02].offsetY));
				set(layer[get(thumbName)].onclick, mainloadscene(%1); resetMouseBehavior-thumbnailsBar-theme02(); highlightThumb-thumbnailsBar-theme02(%1));
			);
			
		
		
		set(layer[get(thumbBorderName)].keep, true);
		set(layer[get(thumbBorderName)].width, get(layer[scrollAreaContainer-thumbnailsBar-theme02].itemWidth));
		set(layer[get(thumbBorderName)].height, get(layer[scrollAreaContainer-thumbnailsBar-theme02].itemHeight));
		set(layer[get(thumbBorderName)].align, topleft);
		
		if(layer[thumbnailBorderSource-thumbnailsBar-theme02].url,
			set(layer[get(thumbBorderName)].url, get(layer[thumbnailBorderSource-thumbnailsBar-theme02].url));
			set(layer[get(thumbBorderName)].scale9grid, get(layer[thumbnailBorderSource-thumbnailsBar-theme02].scale9grid));
			set(layer[get(thumbBorderName)].parent, get(thumbName));
			set(layer[get(thumbBorderName)].x, get(negativeOffsetX-thumbnailsBar-theme02));
			set(layer[get(thumbBorderName)].y, get(negativeOffsetY-thumbnailsBar-theme02));
			set(layer[get(thumbBorderName)].onclick, mainloadscene(%1); resetMouseBehavior-thumbnailsBar-theme02(); highlightThumb-thumbnailsBar-theme02(%1));
		,
			
				set(layer[get(thumbBorderName)].y, get(thumbIncPos-thumbnailsBar-theme02)); 
				
		);
		
		
		setupMouseBehavior-thumbnailsBar-theme02(%1, %4);
		
	</action>
	
	
	<action name="removeThumb-thumbnailsBar-theme02">
		set(thumbName, 'thumb_');
		txtadd(thumbName, %1);
		txtadd(thumbName, '-thumbnailsBar-theme02');
		removelayer(get(thumbName));
		
		set(thumbBorderName, 'thumbBorder_');
		txtadd(thumbBorderName, %1);
		txtadd(thumbBorderName, '-thumbnailsBar-theme02');
		removelayer(get(thumbBorderName));
	</action>
	
	
	
	<action name="setupArrows-thumbnailsBar-theme02">
		
		if(layer[scrollAreaContainer-thumbnailsBar-theme02].adjustToContent,
			hideArrows-thumbnailsBar-theme02();
		,
			ifnot(device.touchdevice,
				
					if(layer[scrollAreaContainer-thumbnailsBar-theme02].height LT layer[thumbsScrollArea-thumbnailsBar-theme02].height,
				
					showArrows-thumbnailsBar-theme02();
				,
					hideArrows-thumbnailsBar-theme02();
				);
			,
				hideArrows-thumbnailsBar-theme02();
			);
		);
		
		
		if(%1,
			scrollToCurrentThumb-thumbnailsBar-theme02();
		);
		
		
			
			if(layer[scrollAreaContainer-thumbnailsBar-theme02].height LT layer[scrollAreaContainer-thumbnailsBar-theme02].itemHeight,
				set(layer[get(layer[scrollAreaContainer-thumbnailsBar-theme02].parent)].visible, false);
			);
	</action>
	
	
	<action name="showArrows-thumbnailsBar-theme02">
		
		
		
		
		set(layer[scrollPrevArrow-thumbnailsBar-theme02].visible, true);
		set(layer[scrollNextArrow-thumbnailsBar-theme02].visible, true);
		
		
		
			
			add(totalArrowSize-thumbnailsBar-theme02, get(layer[scrollPrevArrow-thumbnailsBar-theme02].height), get(layer[scrollNextArrow-thumbnailsBar-theme02].height));
		
			
			sub(scrollAreaContainerSize-thumbnailsBar-theme02, get(layer[get(layer[scrollAreaContainer-thumbnailsBar-theme02].parent)].pixelheight), get(totalArrowSize-thumbnailsBar-theme02));
		
			set(layer[scrollAreaContainer-thumbnailsBar-theme02].height, get(scrollAreaContainerSize-thumbnailsBar-theme02));
		
			set(layer[scrollAreaContainer-thumbnailsBar-theme02].y, get(layer[scrollPrevArrow-thumbnailsBar-theme02].height));
			
		
		
		set(layer[scrollPrevArrow-thumbnailsBar-theme02].onhover, scrollPrev-thumbnailsBar-theme02(););
		set(layer[scrollNextArrow-thumbnailsBar-theme02].onhover, scrollNext-thumbnailsBar-theme02(););
		
		set(layer[scrollPrevArrow-thumbnailsBar-theme02].onclick, scrollPrev-thumbnailsBar-theme02(get(layer[scrollAreaContainer-thumbnailsBar-theme02].scrollSpeedAcceleration)););
		set(layer[scrollNextArrow-thumbnailsBar-theme02].onclick, scrollNext-thumbnailsBar-theme02(get(layer[scrollAreaContainer-thumbnailsBar-theme02].scrollSpeedAcceleration)););
		
		
		
		
		
		set(layer[scrollPrevArrow-thumbnailsBar-theme02].onout, set(layer[scrollAreaContainer-thumbnailsBar-theme02].scrollSpeed, get(layer[scrollAreaContainer-thumbnailsBar-theme02].scrollSpeedInit)););
		set(layer[scrollNextArrow-thumbnailsBar-theme02].onout, set(layer[scrollAreaContainer-thumbnailsBar-theme02].scrollSpeed, get(layer[scrollAreaContainer-thumbnailsBar-theme02].scrollSpeedInit)););
		
	</action>
	
	
	
	
	<action name="hideArrows-thumbnailsBar-theme02">
		
		set(layer[scrollPrevArrow-thumbnailsBar-theme02].visible, false);
		set(layer[scrollNextArrow-thumbnailsBar-theme02].visible, false);
		
		
		
			mul(totalMargin-thumbnailsBar-theme02, get(layer[scrollAreaContainer-thumbnailsBar-theme02].marginY), 2);
			
			sub(scrollAreaContainerSize-thumbnailsBar-theme02, get(layer[get(layer[scrollAreaContainer-thumbnailsBar-theme02].parent)].pixelheight), get(totalMargin-thumbnailsBar-theme02));
			
			set(layer[scrollAreaContainer-thumbnailsBar-theme02].height, get(scrollAreaContainerSize-thumbnailsBar-theme02));
			set(layer[scrollAreaContainer-thumbnailsBar-theme02].y, get(layer[scrollAreaContainer-thumbnailsBar-theme02].marginY));
			 
			
	</action>
	
	
	<action name="scrollPrev-thumbnailsBar-theme02">
		
		
		if(%1,
			inc(layer[scrollAreaContainer-thumbnailsBar-theme02].scrollSpeed, %1);
		);
		
		layer[thumbsScrollArea-thumbnailsBar-theme02].stopscrolling();
		
		set(scrollLimit-thumbnailsBar-theme02, 0);
		
		
			
				sub(scrollLimit-thumbnailsBar-theme02, get(layer[thumbsScrollArea-thumbnailsBar-theme02].height), get(layer[scrollAreaContainer-thumbnailsBar-theme02].height));
				div(scrollLimit-thumbnailsBar-theme02, 2);
			
			add(layer[thumbsScrollArea-thumbnailsBar-theme02].y, get(layer[scrollAreaContainer-thumbnailsBar-theme02].scrollSpeed));
			if(layer[thumbsScrollArea-thumbnailsBar-theme02].y GE scrollLimit-thumbnailsBar-theme02,
				set(layer[thumbsScrollArea-thumbnailsBar-theme02].y, get(scrollLimit-thumbnailsBar-theme02));
			);
			
		
		if(layer[scrollAreaContainer-thumbnailsBar-theme02].scrollSpeed LT layer[scrollAreaContainer-thumbnailsBar-theme02].scrollSpeedMax,
			inc(layer[scrollAreaContainer-thumbnailsBar-theme02].scrollSpeed);
		);
		
	</action>
	
	
	<action name="scrollNext-thumbnailsBar-theme02">
		
		
		if(%1,
			inc(layer[scrollAreaContainer-thumbnailsBar-theme02].scrollSpeed, %1);
		);
		
		layer[thumbsScrollArea-thumbnailsBar-theme02].stopscrolling();
		
			
			sub(scrollLimit-thumbnailsBar-theme02, get(layer[thumbsScrollArea-thumbnailsBar-theme02].height), get(layer[scrollAreaContainer-thumbnailsBar-theme02].height));
			
				div(scrollLimit-thumbnailsBar-theme02, 2);
			mul(scrollLimit-thumbnailsBar-theme02, -1);
			
			sub(layer[thumbsScrollArea-thumbnailsBar-theme02].y, get(layer[scrollAreaContainer-thumbnailsBar-theme02].scrollSpeed));
			if(layer[thumbsScrollArea-thumbnailsBar-theme02].y LE scrollLimit-thumbnailsBar-theme02,
				set(layer[thumbsScrollArea-thumbnailsBar-theme02].y, get(scrollLimit-thumbnailsBar-theme02));
			);
		
		if(layer[scrollAreaContainer-thumbnailsBar-theme02].scrollSpeed LT layer[scrollAreaContainer-thumbnailsBar-theme02].scrollSpeedMax,
			inc(layer[scrollAreaContainer-thumbnailsBar-theme02].scrollSpeed);
		);
		
	</action>
	
	
	<action name="resetMouseBehavior-thumbnailsBar-theme02">
	
		
		
		
		set(j-thumbnailsBar-theme02-wait,25);
		
			for( set(j-thumbnailsBar-theme02, 0), j-thumbnailsBar-theme02 LT scene.count, inc(j-thumbnailsBar-theme02),
				if(j-thumbnailsBar-theme02-wait == j-thumbnailsBar-theme02,
					add(j-thumbnailsBar-theme02-wait,25);
					wait(0);
				);
				set(thumbBorderName, 'thumbBorder_');
				txtadd(thumbBorderName, get(scene[get(j-thumbnailsBar-theme02)].name));
				txtadd(thumbBorderName, '-thumbnailsBar-theme02');
				
				setupMouseBehavior-thumbnailsBar-theme02(get(scene[get(j-thumbnailsBar-theme02)].name), get(scene[get(j-thumbnailsBar-theme02)].titleid));
			);
		
	</action>
	
	
	<action name="setupMouseBehavior-thumbnailsBar-theme02">

		set(thumbName, 'thumb_');
		txtadd(thumbName, %1);
		txtadd(thumbName, '-thumbnailsBar-theme02');
		
		set(thumbBorderName, 'thumbBorder_');
		txtadd(thumbBorderName, %1);
		txtadd(thumbBorderName, '-thumbnailsBar-theme02');
		
		if(layer[thumbnailBorderSource-thumbnailsBar-theme02].url,
			set(layer[get(thumbBorderName)].crop, get(layer[thumbnailBorderSource-thumbnailsBar-theme02].cropDefault));
			set(layer[get(thumbBorderName)].onovercrop, get(layer[thumbnailBorderSource-thumbnailsBar-theme02].cropHover));
			set(layer[get(thumbBorderName)].ondowncrop, get(layer[thumbnailBorderSource-thumbnailsBar-theme02].cropHover));
			set(layer[get(thumbBorderName)].tooltip, %2);
				set(layer[get(thumbBorderName)].onhover, showToolTip(get(align), tooltipStyle-thumbnailsBar-theme02));
				set(layer[get(thumbBorderName)].onout, hideTooltip());
		,
			set(layer[get(thumbBorderName)].bgcolor, get(layer[thumbnailBorderSource-thumbnailsBar-theme02].borderColorDefault));
			set(layer[get(thumbBorderName)].bgalpha, get(layer[thumbnailBorderSource-thumbnailsBar-theme02].borderAlphaDefault));
				set(layer[get(thumbName)].tooltip, %2);
				set(layer[get(thumbName)].onhover, showToolTip(get(align), tooltipStyle-thumbnailsBar-theme02));
			
			set(layer[get(thumbName)].onover, 
				set(layer[get(parent)].bgcolor, get(layer[thumbnailBorderSource-thumbnailsBar-theme02].borderColorHover));
				set(layer[get(parent)].bgalpha, get(layer[thumbnailBorderSource-thumbnailsBar-theme02].borderAlphaHover));
			);
			
			set(layer[get(thumbName)].onout, 
				set(layer[get(parent)].bgcolor, get(layer[thumbnailBorderSource-thumbnailsBar-theme02].borderColorDefault));
				set(layer[get(parent)].bgalpha, get(layer[thumbnailBorderSource-thumbnailsBar-theme02].borderAlphaDefault));
				hideTooltip();
			);
		);
	
	</action>
	
	
	<action name="highlightCurrentThumb-thumbnailsBar-theme02">
			highlightThumb-thumbnailsBar-theme02(get(xml.scene));
	</action>
	
	
	<action name="highlightThumb-thumbnailsBar-theme02">
	
		set(thumbBorderName, 'thumbBorder_');
		txtadd(thumbBorderName, %1);
		txtadd(thumbBorderName, '-thumbnailsBar-theme02');
		
		if(layer[thumbnailBorderSource-thumbnailsBar-theme02].url,
			set(layer[get(thumbBorderName)].crop, get(layer[thumbnailBorderSource-thumbnailsBar-theme02].cropSelected));
			set(layer[get(thumbBorderName)].onovercrop, get(layer[thumbnailBorderSource-thumbnailsBar-theme02].cropSelected));
			set(layer[get(thumbBorderName)].ondowncrop, get(layer[thumbnailBorderSource-thumbnailsBar-theme02].cropSelected));
		,
			set(thumbName, 'thumb_');
			txtadd(thumbName, %1);
			txtadd(thumbName, '-thumbnailsBar-theme02');
			
			set(layer[get(thumbBorderName)].bgcolor, get(layer[thumbnailBorderSource-thumbnailsBar-theme02].borderColorSelected));
			set(layer[get(thumbBorderName)].bgalpha, get(layer[thumbnailBorderSource-thumbnailsBar-theme02].borderAlphaSelected));
			
			set(layer[get(thumbName)].onover, "");
			set(layer[get(thumbName)].onout, hideTooltip(););
		);

		scrollToThumb-thumbnailsBar-theme02(%1);
	</action>
	
	
	<action name="scrollToCurrentThumb-thumbnailsBar-theme02">
			scrollToThumb-thumbnailsBar-theme02(get(xml.scene));
	</action>
	
	
	<action name="scrollToThumb-thumbnailsBar-theme02">
		
		set(thumbName, 'thumb_');
		set(thumbBorderName, 'thumbBorder_');
		
		txtadd(thumbName, %1);
		txtadd(thumbName, '-thumbnailsBar-theme02');
		txtadd(thumbBorderName, %1);
		txtadd(thumbBorderName, '-thumbnailsBar-theme02');

			set(posY-thumbnailsBar-theme02, 0);
			if(layer[thumbnailBorderSource-thumbnailsBar-theme02].url,
				div(halfThumbHeight-thumbnailsBar-theme02, get(layer[get(thumbName)].height), 2);
				ifnot(layer[scrollAreaContainer-thumbnailsBar-theme02].adjustToContent,
					add(posY-thumbnailsBar-theme02, get(layer[get(thumbName)].y), get(halfThumbHeight-thumbnailsBar-theme02));
				);
				if(layer[thumbsScrollArea-thumbnailsBar-theme02].scrolltocenter,
					layer[thumbsScrollArea-thumbnailsBar-theme02].scrolltocenter(0, get(posY-thumbnailsBar-theme02));
				);
			,
				div(halfThumbHeight-thumbnailsBar-theme02, get(layer[get(thumbBorderName)].height), 2);
				ifnot(layer[scrollAreaContainer-thumbnailsBar-theme02].adjustToContent,
					add(posY-thumbnailsBar-theme02, get(layer[get(thumbBorderName)].y), get(halfThumbHeight-thumbnailsBar-theme02));
				);
				if(layer[thumbsScrollArea-thumbnailsBar-theme02].scrolltocenter,
					layer[thumbsScrollArea-thumbnailsBar-theme02].scrolltocenter(0, get(posY-thumbnailsBar-theme02));
				);
			);
		
		
	</action>




  <!-- ************************ -->
  <!-- Title : current panorama -->
  <!-- ************************ -->

  <events name="title_currentpanorama_events" 
    onTourStart="showtitle_currentpanorama();"
    hidetourcontrols="hidetitle_currentpanorama();" 
    showtourcontrols="showtitle_currentpanorama();" 
    onnewpano="updatetitle_currentpanorama();" 
    keep="true" />

  <action name="hidetitle_currentpanorama">set(layer[title_currentpanorama].visible, false);</action>
  <action name="showtitle_currentpanorama">set(layer[title_currentpanorama].visible, true );</action>

  <action name="updatetitle_currentpanorama">
    getmessage(layer[title_currentpanorama].html, get(scene[get(xml.scene)].titleid));
    escape(layer[title_currentpanorama].html);
  </action>
  <layer name="title_currentpanorama" keep="true" zorder="11"
         url="%FIRSTXML%/graphics/textfield.swf"
         align="top" x="0" y="50" width="100%" autoheight="true"
         background="false" capture="false" handcursor="false" selectable="false" enabled="false"
         borderwidth="0"
         alpha="1"
         visible="false"
         textshadow="1"
         css="text-align:center;
              color:#ebebeb;
              font-family:Century Gothic;
              font-size:18px;"/>
  <!-- *********************** -->
  <!-- Title : current project -->
  <!-- *********************** -->

  <events name="title_currentproject1_events" 
    onTourStart="showtitle_currentproject1();"
    hidetourcontrols="hidetitle_currentproject1();" 
    showtourcontrols="showtitle_currentproject1();"  
    keep="true" />

  <action name="hidetitle_currentproject1">set(layer[title_currentproject1].visible, false);</action>
  <action name="showtitle_currentproject1">set(layer[title_currentproject1].visible, true );</action>

  <layer name="title_currentproject1" keep="true" zorder="12"
         url="%FIRSTXML%/graphics/textfield.swf"
         align="top" x="0" y="5" width="100%" autoheight="true"
         onloaded="getmessage(html,get(projecttitleid));escape(html);"
         background="false" capture="false" handcursor="false" selectable="false" enabled="false"
         borderwidth="0"
         alpha="1"
         visible="false"
         textshadow="1"
         css="text-align:center;
              color:#ebebeb;
              font-family:Century Gothic;
              font-weight:bold;
              font-size:24px;"/>
  <!-- ************ -->
  <!-- Logo : viewport / bottomright -->
  <!-- ************ -->


  <layer align="bottomright"
         x="10"
         y="10"
         zorder="13"
         name="logo1"
         keep="true"
         visible="false"
         capture="false"
		
			tooltip="logo1tooltipText"
			onhover="showTooltip(bottomright);"
			onout="hideTooltip();"
         url="%FIRSTXML%/graphics/logo1/_6360.jpg" 
         onclick="openurl(http://static.zooomez.fr/medias/pr/ph/120227-phidar/vm/fr/30/570/gites_mouretou/gite1/vm.html,_self);"

         width="8%"
         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>




<action name="setViewPannini">
	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">
	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">
	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>
  <!-- Hide / Show Thumbnails -->
  <action name="hideTourThumbnails">set(tour_displaythumbnails, false);events.dispatch(hidetourthumbnails);</action>
  <action name="showTourThumbnails">set(tour_displaythumbnails, true); events.dispatch(showtourthumbnails);</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();
  </action>
  <action name="disableGyroscope">
    changeGyroscopeState();
  </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">
	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">
	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>