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

    
  <!-- Spot Style - Default Point Spot Style -->


  <style name="IconDefaultPointSpotStyle"
         url="%FIRSTXML%/spots/hotspot_plan_sequence_user_defaultpoint0.png"
         visible="false"
         frame="0"
         lastframe="9"
         framewidth="67"
         frameheight="67"
         stopspotsequence="false"
         crop="0|0|67|67"
         edge="center"
         onloaded="startspotanimation(0.1);"
         onhover="onhoverIconDefaultPointSpotStyle"
         onout="onoutIconDefaultPointSpotStyle"


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



  </action>



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


<!-- ********** -->
<!-- Plan -->
<!-- id : floorPlan -->
<!-- ********** -->

	<ptplugin name="floorPlan" engine="KolorFloorPlan">
		<settings>
			<option name="background_color" value="ffffff" type="string" />
			<option name="background_lighter_color" value="ffffff" type="string" />
			<option name="background_darker_color" value="d5d5d5" type="string" />
			<option name="background_alpha" value="0" type="float" />
			<option name="text_color" value="000000" type="string" />

			<option name="resize" value="true" type="bool" />
			<option name="fp_selector" value="one" type="string" />
			<option name="fp_selector_label" value="floorPlanmenu_label" type="string" />
			<option name="display_title" value="false" type="bool" />
			<option name="title_font" value="Verdana" type="string" />
			<option name="title_size" value="14" type="int" />
			<option name="title_weight" value="normal" type="string" />
			<option name="title_decoration" value="normal" type="string" />
			<option name="title_color" value="000000" type="string" />
			<option name="display_orientation" value="false" type="bool" />
			<option name="display_radar" value="true" type="bool" />
			<option name="radar_radius" value="50" type="int" />
			<option name="radar_line_width" value="1" type="int" />
			<option name="radar_line_color" value="747474" type="string" />
			<option name="radar_line_alpha" value="0.7000076295109483" type="float" />
			<option name="radar_fill_color" value="919191" type="string" />
			<option name="radar_fill_alpha" value="0.59999999999999998" type="float" />
			<option name="selected_effect" value="bounce" type="string" />
			<option name="close_on_click" value="true" type="bool" />
			<option name="position" value="topleft" type="string" />
			<option name="zorder" value="1" type="int" />
			<option name="use_i18n" value="true" type="bool" />
		</settings>
		
		<floorplanItems selectedItem="fpitemmain" selectedSpot="" selectedSpotScene="" selectedSpotHeading="" selectedSpotFov="">
				
				<floorplanItem 
					name="fpitemmain" 
					width="1230" 
					height="1042" 
					groupName="" 
					url="floorplan/plan_3d_modifie.jpg" 
					title="project_floor_title"
					heading="324">
							<spot name="spotmap300" posX="0.150288999" posY="0.471735001" heading="0" desc="spotmap300_tooltip" descType="tooltip" groupName="" isScene="true" planar="false" scene="pano14" jsClick="spotmap300ActionSpotFloorPlan">
								<icon url="spots/pin_2d_hole_white_user_defaultmap0.png" iconWidth="15" iconHeight="20" iconAnchor="center" />
							</spot>
							<spot name="spotmap301" posX="0.407927006" posY="0.371345013" heading="0" desc="spotmap301_tooltip" descType="tooltip" groupName="" isScene="true" planar="false" scene="pano16" jsClick="spotmap301ActionSpotFloorPlan">
								<icon url="spots/pin_2d_hole_white_user_defaultmap0.png" iconWidth="15" iconHeight="20" iconAnchor="center" />
							</spot>
							<spot name="spotmap302" posX="0.590421021" posY="0.270954996" heading="0" desc="spotmap302_tooltip" descType="tooltip" groupName="" isScene="true" planar="false" scene="pano18" jsClick="spotmap302ActionSpotFloorPlan">
								<icon url="spots/pin_2d_hole_white_user_defaultmap0.png" iconWidth="15" iconHeight="20" iconAnchor="center" />
							</spot>
							<spot name="spotmap303" posX="0.669694006" posY="0.461014003" heading="0" desc="spotmap303_tooltip" descType="tooltip" groupName="" isScene="true" planar="false" scene="pano51" jsClick="spotmap303ActionSpotFloorPlan">
								<icon url="spots/pin_2d_hole_white_user_defaultmap0.png" iconWidth="15" iconHeight="20" iconAnchor="center" />
							</spot>
							<spot name="spotmap305" posX="0.652352989" posY="0.342105001" heading="0" desc="spotmap305_tooltip" descType="tooltip" groupName="" isScene="true" planar="false" scene="pano52" jsClick="spotmap305ActionSpotFloorPlan">
								<icon url="spots/pin_2d_hole_white_user_defaultmap0.png" iconWidth="15" iconHeight="20" iconAnchor="center" />
							</spot>
							<spot name="spotmap306" posX="0.503715992" posY="0.57407397" heading="0" desc="spotmap306_tooltip" descType="tooltip" groupName="" isScene="true" planar="false" scene="pano60" jsClick="spotmap306ActionSpotFloorPlan">
								<icon url="spots/pin_2d_hole_white_user_defaultmap0.png" iconWidth="15" iconHeight="20" iconAnchor="center" />
							</spot>
							<spot name="spotmap307" posX="0.540875018" posY="0.745613992" heading="0" desc="spotmap307_tooltip" descType="tooltip" groupName="" isScene="true" planar="false" scene="pano64" jsClick="spotmap307ActionSpotFloorPlan">
								<icon url="spots/pin_2d_hole_white_user_defaultmap0.png" iconWidth="15" iconHeight="20" iconAnchor="center" />
							</spot>
							<spot name="spotmap308" posX="0.534268975" posY="0.89181298" heading="0" desc="spotmap308_tooltip" descType="tooltip" groupName="" isScene="true" planar="false" scene="pano65" jsClick="spotmap308ActionSpotFloorPlan">
								<icon url="spots/pin_2d_hole_white_user_defaultmap0.png" iconWidth="15" iconHeight="20" iconAnchor="center" />
							</spot>
							<spot name="spotmap309" posX="0.534529984" posY="0.0472313017" heading="0" desc="spotmap309_tooltip" descType="tooltip" groupName="" isScene="true" planar="false" scene="pano75" jsClick="spotmap309ActionSpotFloorPlan">
								<icon url="spots/pin_2d_hole_white_user_defaultmap0.png" iconWidth="15" iconHeight="20" iconAnchor="center" />
							</spot>
							<spot name="spotmap310" posX="0.657459021" posY="0.141693994" heading="0" desc="spotmap310_tooltip" descType="tooltip" groupName="" isScene="true" planar="false" scene="pano77" jsClick="spotmap310ActionSpotFloorPlan">
								<icon url="spots/pin_2d_hole_white_user_defaultmap0.png" iconWidth="15" iconHeight="20" iconAnchor="center" />
							</spot>
							<spot name="spotmap311" posX="0.922652006" posY="0.423453003" heading="0" desc="spotmap311_tooltip" descType="tooltip" groupName="" isScene="true" planar="false" scene="pano76" jsClick="spotmap311ActionSpotFloorPlan">
								<icon url="spots/pin_2d_hole_white_user_defaultmap0.png" iconWidth="15" iconHeight="20" iconAnchor="center" />
							</spot>
							<spot name="spotmap584" posX="0.427821994" posY="0.182662994" heading="0" desc="spotmap584_tooltip" descType="tooltip" groupName="" isScene="true" planar="false" scene="pano436" jsClick="spotmap584ActionSpotFloorPlan">
								<icon url="spots/pin_2d_hole_white_user_defaultmap0.png" iconWidth="15" iconHeight="20" iconAnchor="center" />
							</spot>
				</floorplanItem>
			
			
		</floorplanItems>
	</ptplugin>
	
	<action name="kolorFloorplanJsReady_floorPlan">
		set(ptplugin[floorPlan].jsready, true);
		
		ifnot(ptplugin[floorPlan].floorplanItems.selectedSpot == "",
			set(ptplugin[floorPlan].floorplanItems.selectedSpotFov, get(view.hfov));
			js(invokePluginFunction(floorPlan, setKolorFloorPlanSelectedSpotOptions, get(xml.scene), get(view.hlookat), get(view.hfov)));
		);
	</action>
	
	
		<!-- floorplan main spots counter : 12 -->
			<action name="spotmap300ActionSpotFloorPlan">
          mainloadscene(pano14);lookat(get(panoview.h), get(panoview.v), get(panoview.fov));

</action>
			<action name="spotmap301ActionSpotFloorPlan">
          mainloadscene(pano16);lookat(get(panoview.h), get(panoview.v), get(panoview.fov));

</action>
			<action name="spotmap302ActionSpotFloorPlan">
          mainloadscene(pano18);lookat(-151.650000, 9.000000, 90.000000);

</action>
			<action name="spotmap303ActionSpotFloorPlan">
          mainloadscene(pano51);lookat(get(panoview.h), get(panoview.v), get(panoview.fov));

</action>
			<action name="spotmap305ActionSpotFloorPlan">
          mainloadscene(pano52);lookat(get(panoview.h), get(panoview.v), get(panoview.fov));

</action>
			<action name="spotmap306ActionSpotFloorPlan">
          mainloadscene(pano60);lookat(get(panoview.h), get(panoview.v), get(panoview.fov));

</action>
			<action name="spotmap307ActionSpotFloorPlan">
          mainloadscene(pano64);lookat(get(panoview.h), get(panoview.v), get(panoview.fov));

</action>
			<action name="spotmap308ActionSpotFloorPlan">
          mainloadscene(pano65);lookat(get(panoview.h), get(panoview.v), get(panoview.fov));

</action>
			<action name="spotmap309ActionSpotFloorPlan">
          mainloadscene(pano75);lookat(get(panoview.h), get(panoview.v), get(panoview.fov));

</action>
			<action name="spotmap310ActionSpotFloorPlan">
          mainloadscene(pano77);lookat(get(panoview.h), get(panoview.v), get(panoview.fov));

</action>
			<action name="spotmap311ActionSpotFloorPlan">
          mainloadscene(pano76);lookat(get(panoview.h), get(panoview.v), get(panoview.fov));

</action>
			<action name="spotmap584ActionSpotFloorPlan">
          mainloadscene(pano436);lookat(get(panoview.h), get(panoview.v), get(panoview.fov));

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

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

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

		<option name="overlay_image" value="Appartementdata/graphics/floorplan/mapmonde.jpg" type="string" />

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

		inc(tour_autorotation_openatstartplugin);
		set(ptplugin[floorPlanArea].autorotateBlocked, true);

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

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

			if(ptplugin[floorPlanArea].autorotateBlocked,if(tour_autorotation_openatstartplugin GT 0,dec(tour_autorotation_openatstartplugin);set(ptplugin[floorPlanArea].autorotateBlocked,false);););
		);
		set(ptplugin[floorPlanArea].isOpen, false);hideFloorplan();

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

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

		if(ptplugin[floorPlanArea].autorotateBlocked,if(tour_autorotation_openatstartplugin GT 0,dec(tour_autorotation_openatstartplugin);set(ptplugin[floorPlanArea].autorotateBlocked,false);););
		set(ptplugin[floorPlanArea].isOpen, false);
		js(invokePluginFunction(floorPlanArea, hideKolorArea, %1));
	</action>
	
	<events name="kolorAreaEvents_floorPlanArea" 
		keep="true"
	/>
	

<!-- ********** -->
<!-- Description -->
<!-- id : description -->
<!-- ********** -->

<ptplugin name="description" canStart="false" newPano="false" openatstart="true" mode="project" startMethod="showDescription_description" engine="kolorArea">
	<settings>
		<option name="position" value="topright" type="string" />
		<option name="start_position" value="right" type="string" />
		<option name="margin_x" value="0" type="int" />
		<option name="margin_y" value="0" type="int" />
		<option name="background_color" value="f2f2f2" type="string" />
		<option name="background_alpha" value="0.40000000000000002" type="float" />
		<option name="topleft_radius" value="0" type="int" />
		<option name="topright_radius" value="0" type="int" />
		<option name="bottomleft_radius" value="0" type="int" />
		<option name="bottomright_radius" value="0" type="int" />
		<option name="area_border_width" value="0" type="int" />
		<option name="area_border_color" value="f2f2f2" type="string" />
		<option name="area_border_alpha" value="1" type="float" />
		<option name="padding" value="15" type="int" />
		<option name="display_title" value="false" type="bool" />
		<option name="close_displayed" value="false" type="bool" />
		<option name="close_text" value="descriptiondisplay_close_text" type="string" />

		<option name="overlay_displayed" value="false" type="bool" />
		<option name="overlay_color" value="000000" type="string" />
		<option name="overlay_alpha" value="0.50000762951094835" type="float" />

		<option name="area_width" value="20" type="int" />
		<option name="area_height" value="100" type="int" />
		<option name="area_width_unit" value="percent" type="string" />
		<option name="area_height_unit" value="percent" type="string" />
		<option name="animation" value="true" type="bool" />
		<option name="animation_duration" value="500" type="int" />
		<option name="refresh_content" value="true" type="bool" />
		<option name="close_callback" value="invokeKrFunction('closeKolorAreaCallback_description')" type="string" />
		<option name="close_on_click" value="true" type="bool" />
		<option name="close_onclick_callback" value="invokeKrFunction('closeKolorAreaCallbackClick_description')" type="string" />
		<option name="zorder" value="2" type="int" />
		<option name="use_i18n" value="true" type="bool" />
	</settings>
</ptplugin>

<action name="kolorAreaJsReady_description">
	set(ptplugin[description].jsready, true);

</action>


<action name="openKolorArea_description">
	ifnot(ptplugin[description].isOpen,
		if(ptplugin[description].doNotDeleteMe,
		set(ptplugin[description].currentCall, false);
		set(ptplugin[description].doNotDeleteMe, false);
		set(ptplugin[description].isOpen, true);
		
		js(showKolorArea(description, get(ptplugin[description].descID)));
		,
			set(ptplugin[description].currentCall, true);
			set(ptplugin[description].doNotDeleteMe, true);
			events.dispatch(onremovedisplayedobject);
			delayedcall(0.3,openKolorArea_description(););
		);
	);
</action>

<action name="closeKolorArea_description">
	if(ptplugin[description].isOpen,
		if(ptplugin[description].doNotDeleteMe,
			set(ptplugin[description].doNotDeleteMe, false);
		,
		js(invokePluginFunction(description, closeKolorArea));
		);
	);
</action>

<action name="toggleKolorArea_description">
	if(ptplugin[description].isOpen,
		closeKolorArea_description();
	,
		openKolorArea_description();
	);
</action>

<action name="closeKolorAreaCallback_description">
	set(ptplugin[description].doNotDeleteMe, false);
	set(ptplugin[description].isOpen, false);
	if(tour_displayinfo,hideTourInfo();

	);
</action>

<action name="closeKolorAreaCallbackClick_description">


	if(tour_displayinfo,hideTourInfo();

	);
</action>


<action name="showKolorArea_description">
	ifnot(ptplugin[description].startMethod == "",
		delayedcall(0,get(ptplugin[description].startMethod));
	,
		if(ptplugin[description].doNotDeleteMe,
			set(ptplugin[description].currentCall, false);
			set(ptplugin[description].doNotDeleteMe, false);
		set(ptplugin[description].isOpen, true);
		
		js(invokePluginFunction(description, showKolorArea, %1));
		,
			set(ptplugin[description].currentCall, true);
			set(ptplugin[description].doNotDeleteMe, true);
			events.dispatch(onremovedisplayedobject);
			delayedcall(0.3,showKolorArea_description(%1););
		);
	);
</action>
	
<action name="hideKolorArea_description">
	if(ptplugin[description].doNotDeleteMe,
		set(ptplugin[description].doNotDeleteMe, false);
	,
	
	set(ptplugin[description].isOpen, false);
	js(invokePluginFunction(description, hideKolorArea, %1));
	);
</action>

<action name="openDescription_description">
	openKolorArea_description();
</action>

<action name="openSpotDescription_description">
	set(ptplugin[description].descID, %1);
	openKolorArea_description();
</action>

<action name="closeDescription_description">
	set(ptplugin[description].currentGroup, false);
	if(%1,
		set(restore_description, true);
	,
		set(restore_description, false);
	);
	closeKolorArea_description();
</action> 

<action name="showDescription_description">
	if(ptplugin[description].canStart,
		set(ptplugin[description].descID, get(projectdescriptionid));
		if(ptplugin[description].descID != "",
			openDescription_description();
		,
			hideKolorArea_description(false);
		);
		set(ptplugin[description].startMethod, "");
	);
</action>



<action name="changeLanguage_description">
	if(ptplugin[description].jsready,
		stopdelayedcall(delay_description);
		js(invokePluginFunction(description, changeLanguage, true));
	,
		delayedcall(delay_description, 0.1, changeLanguage_description(););
	);
</action>

<events name="kolorAreaEvents_description" 
	keep="true"
	onTourStart="set(ptplugin[description].canStart, true);if(ptplugin[description].openatstart,showTourInfo();
);"
	onshowtourinfo="if(tour_displayinfo,showDescription_description(););"
	onhidetourinfo="delayedcall(0.3,if(ptplugin[description].isOpen,closeDescription_description(false);););"
	onremovepano="if(ptplugin[description].isOpen,hideTourInfo();
);"
	onremovedisplayedobject="ifnot(ptplugin[description].currentCall,if(ptplugin[description].isOpen,hideTourInfo();
););"
	changetourlanguage="changeLanguage_description();"
/>

<!-- ********* -->
<!-- Gyroscope -->
<!-- ********* -->


<plugin name="gyroscope"
        url="%FIRSTXML%/graphics/gyro2.js"
        keep="true"
        devices="no-desktop.and.html5"

        onunavailable="checkGyroUnavailable();"
        sensor_mode="1"
        friction="auto"
        autocalibration="true"
        touch_mode="full"
        onavailable="delayedcall(1, checkGyroAvailability(););"
        enabled="false"
        activated="false"
        />

<events name="gyroscopeEvents" onnewpano="planarGyroscopeTest();" keep="true" />

<action name="planarGyroscopeTest">
  if(plugin[gyroscope],
    if(scene[get(xml.scene)].full360,
      set(sceneisfull360, false);
      sub(viewhfov, panoview.hmax, panoview.hmin);
      if (viewhfov == 360,
        sub(viewvfov, panoview.vmax, panoview.vmin);
        if (viewvfov == 180,
          set(sceneisfull360, true);
        );
      );
      if (sceneisfull360,
        set(plugin[gyroscope].camroll, true);
      ,
        set(plugin[gyroscope].camroll, false);
      );
    ,
      set(plugin[gyroscope].camroll, false);
    );
  );
</action>

<action name="changeGyroscopeState">
  if(plugin[gyroscope],
    if (plugin[gyroscope].isavailable,
      if(%1,
        set(plugin[gyroscope].activated,true);
      ,
        set(plugin[gyroscope].activated,false);
      );
      if (%1 != plugin[gyroscope].enabled,
        if(plugin[gyroscope].activated,
          switch(plugin[gyroscope].enabled);
        ,
          set(plugin[gyroscope].enabled, false);
        );
        if (plugin[gyroscope].enabled, events.dispatch(ongyroscopeon);, events.dispatch(ongyroscopeoff););
      );
    );
  );
</action>

<action name="checkGyroAvailability">
  if(plugin[gyroscope],
    if (plugin[gyroscope].isavailable,
      
      set(sceneisfull360, false);
      if (scene[get(xml.scene)].full360,
        sub(viewhfov, panoview.hmax, panoview.hmin);
        if (viewhfov == 360,
          sub(viewvfov, panoview.vmax, panoview.vmin);
          if (viewvfov == 180,
            set(sceneisfull360, true);
          );
        );
      );
      set(delaythegyrocheck, false);
      if (sceneisfull360 AND tour_firstlittleplanet, set(delaythegyrocheck, true));

      ifnot(delaythegyrocheck,
        switch(plugin[gyroscope].enabled);
        set(plugin[gyroscope].activated,true);
        set(tour_gyroscopedevices, true);
        events.dispatch(ongyroscopeavailable);
      ,
        delayedcall(1, checkGyroAvailability(););
      );
    ,
      set(tour_gyroscopedevices, false);
    );
    if (plugin[gyroscope].enabled, events.dispatch(ongyroscopeon);, events.dispatch(ongyroscopeoff););
  ,
    checkGyroUnavailable();
  );
</action>

<action name="checkGyroUnavailable">
  set(plugin[gyroscope].activated, false);
  set(plugin[gyroscope].enabled, false);
  set(tour_gyroscopedevices, false);
  events.dispatch(ongyroscopeunavailable);
</action>

<!-- ********* -->
<!-- Vibro -->
<!-- ********* -->
<action name="dovibrationsvibromobile" type="Javascript" autorun="" devices="mobile"><![CDATA[
  window.navigator.vibrate([100]);

]]></action>

<!-- ********** -->
<!-- Circles Control Bar -->
<!-- id : CirclesControlBar -->
<!-- ********** -->

  <krpano CirclesControlBarbarbuilt="false" CirclesControlBarbackgroundwidthwhenclosed="0" CirclesControlBarbackgroundwidthwhenopened="0" CirclesControlBarIsOpened="false" />
  <events name="CirclesControlBarevents" 
    onxmlcomplete="CirclesControlBarbuildMenuBar();" 


    keep="true" />



  <action name="CirclesControlBarbuildMenuBar">
    ifnot (CirclesControlBarbarbuilt, CirclesControlBarbuildMenu(); set(CirclesControlBarbarbuilt, true););
  </action>

  <style name="CirclesControlBar_btn_style"
         keep="true"
         edge="right"
         align="right"
         x="0" y="0"
         width="40" height="40"
         crop="0|0|60|60"
         onovercrop="0|60|60|60"
         ondowncrop="0|120|60|60"
         onhover="showTooltip('plugin', CirclesControlBarmenuTooltipStyle, bottom);"
         onout="hideTooltip();"
         />
  <style name="CirclesControlBar_btn_style_off"
         keep="true"
         edge="right"
         align="right"
         x="0" y="0"
         width="40" height="40"
         onhover="showTooltip('plugin', CirclesControlBarmenuTooltipStyle, bottom);"
         onout="hideTooltip();"
         />

  <layer name="CirclesControlBar_menu_bg"
         keep="true"
         type="container"
         zorder="5"
         width="40"
         height="40"
         align="bottom"
         x="0" y="50"
         maskchildren="true"
         rotate="0"
         visible="false"
         >

    <layer name="CirclesControlBarbtn_gyroscope_off"
            url="%FIRSTXML%/graphics/circlescontrolbar/btn_gyroscope.png"
            style="CirclesControlBar_btn_style"
            onclick="disableGyroscope();
"
            devices="html5"
            tooltip="CirclesControlBargyroOffTip"
            visible="false"
            />
    <layer name="CirclesControlBarbtn_gyroscope_on"
            url="%FIRSTXML%/graphics/circlescontrolbar/btn_gyroscope.png"
            style="CirclesControlBar_btn_style"
            onclick="enableGyroscope();
"
            devices="html5"
            tooltip="CirclesControlBargyroOnTip"
            visible="false"
            />
    <layer name="CirclesControlBarbtn_gyroscope_not"
            url="%FIRSTXML%/graphics/circlescontrolbar/btn_gyroscope_off.png"
            style="CirclesControlBar_btn_style_off"
            enabled="true"
            capture="false"
            devices="html5"
            tooltip="CirclesControlBargyroNotTip"
            visible="false"
            />

    <layer name="CirclesControlBarbtn_enter_vr"
            url="%FIRSTXML%/graphics/circlescontrolbar/btn_vr_mode.png"
            style="CirclesControlBar_btn_style"
            onclick="if(scene[get(xml.scene)].full360 AND disableCurrentSceneVrConservation !== true,
    js(accessWebVr(get(xml.scene),get(videoscenestarttime)));
,
    js(accessWebVr(null));
);"
            tooltip="CirclesControlBarenterVRTip"
            visible="false"
            devices="html5"
            />
    <layer name="CirclesControlBarbtn_enter_vr_not"
            url="%FIRSTXML%/graphics/circlescontrolbar/btn_vr_mode_off.png"
            style="CirclesControlBar_btn_style"
            tooltip="CirclesControlBarenterVRNotTip"
            enabled="true"
            capture="false"
            visible="false"
            devices="html5"
            />

    <layer name="CirclesControlBarbtn_home"
           url="%FIRSTXML%/graphics/circlescontrolbar/btn_home.png"
           style="CirclesControlBar_btn_style"
           onclick="CirclesControlBarbtn_home_action();"
           visible="false"
           tooltip="CirclesControlBarhomeTip"
           />


    <layer name="CirclesControlBarbtn_sound_on"
            url="%FIRSTXML%/graphics/circlescontrolbar/btn_start_sound.png"
            onclick="playTourSounds();
"
            style="CirclesControlBar_btn_style"
            visible="false"
            tooltip="CirclesControlBarsoundsOnTip"
            />
    <layer name="CirclesControlBarbtn_sound_off"
            url="%FIRSTXML%/graphics/circlescontrolbar/btn_stop_sound.png"
            onclick="stopTourSounds();
"
            style="CirclesControlBar_btn_style"
            visible="false"
            tooltip="CirclesControlBarsoundsOffTip"
            />



    <layer name="CirclesControlBarbtn_display_floorplan"
            url="%FIRSTXML%/graphics/circlescontrolbar/btn_floorplan.png"
            onclick="showFloorplan();
"
            style="CirclesControlBar_btn_style"
            visible="false"
            tooltip="CirclesControlBardisplayFloorplanTip"
            />
    <layer name="CirclesControlBarbtn_hide_floorplan"
            url="%FIRSTXML%/graphics/circlescontrolbar/btn_floorplan.png"
            onclick="hideFloorplan();
"
            style="CirclesControlBar_btn_style"
            visible="false"
            tooltip="CirclesControlBarhideFloorplanTip"
            />


    <layer name="CirclesControlBarbtn_openfs"
            url="%FIRSTXML%/graphics/circlescontrolbar/btn_enter_fs.png"
            onclick="enterFullscreen();
"
            style="CirclesControlBar_btn_style"
            visible="false"
            devices="fullscreensupport"
            tooltip="CirclesControlBaropenFsTip"
            />
    <layer name="CirclesControlBarbtn_closefs"
            url="%FIRSTXML%/graphics/circlescontrolbar/btn_close_fs.png"
            onclick="exitFullscreen();
"
            style="CirclesControlBar_btn_style"
            visible="false"
            devices="fullscreensupport"
            tooltip="CirclesControlBarcloseFsTip"
            />




    <layer name="CirclesControlBarbtn_display_info"
            url="%FIRSTXML%/graphics/circlescontrolbar/btn_info.png"
            onclick="showTourInfo();
"
            style="CirclesControlBar_btn_style"
            visible="false"
            tooltip="CirclesControlBardisplayInfoTip"
            />

    <layer name="CirclesControlBarbtn_close_info"
            url="%FIRSTXML%/graphics/circlescontrolbar/btn_info.png"
            onclick="hideTourInfo();
"
            style="CirclesControlBar_btn_style"
            visible="false"
            tooltip="CirclesControlBarhideInfoTip"
            />


 </layer>

    <action name="CirclesControlBarbtn_home_action">
      mainloadscene(pano14);
    </action>


<events name="CirclesControlBarvravailableevent"
		onvravailable="CirclesControlBarupdateVrButtonsAvailability();"
		onvrunavailable="CirclesControlBarupdateVrButtonsAvailability();"
		keep="true" devices="html5" />
	<krpano CirclesControlBarmenuvravailable="false" />
	<action name="CirclesControlBarupdateVrButtonsAvailability">
		if (tour_vrdevices,
			set(CirclesControlBarmenuvravailable, true);
		,
			set(CirclesControlBarmenuvravailable, false);
		);
		CirclesControlBarupdateVrButtons();
	</action>
	<action name="CirclesControlBarHideVrButtons">
		set(layer[CirclesControlBarbtn_enter_vr].visible, false);
		if('%1' == 'true' AND plugin[ptpvrmode],
			set(layer[CirclesControlBarbtn_enter_vr_not].visible, true);
		,
			set(layer[CirclesControlBarbtn_enter_vr_not].visible, false);
		);
	</action>
	<action name="CirclesControlBarShowVrButtons">
		if (CirclesControlBarmenuvravailable,
			set(layer[CirclesControlBarbtn_enter_vr].visible, true);
			set(layer[CirclesControlBarbtn_enter_vr_not].visible, false);
		,
			CirclesControlBarHideVrButtons(true);
		);
	</action>
	<action name="CirclesControlBarupdateVrButtons">
	if (tour_vrdevices,
		if (CirclesControlBarIsOpened,
			CirclesControlBarShowVrButtons();
		,
			CirclesControlBarHideVrButtons();
		);
	,
		if (CirclesControlBarIsOpened,
			CirclesControlBarHideVrButtons(true);
		,
			CirclesControlBarHideVrButtons();
		);
	);
	</action>

  <events name="CirclesControlBargyroscopeavailableevent"
          ongyroscopeavailable="CirclesControlBarupdateGyroscopeButtonsAvailability();"
          ongyroscopeunavailable="CirclesControlBarupdateGyroscopeButtonsAvailability();"
          ongyroscopeon="CirclesControlBarenableGyroscopeButtons(true);"
          ongyroscopeoff="CirclesControlBarenableGyroscopeButtons(false);"
          keep="true" devices="html5" />
  <krpano CirclesControlBarmenugyroscopeavailable="false" CirclesControlBarmenugyroscopeenabled="false"/>
  <action name="CirclesControlBarupdateGyroscopeButtonsAvailability">
    if (tour_gyroscopedevices,
      set(CirclesControlBarmenugyroscopeavailable, true);
      CirclesControlBarupdateGyroscopeButtons();
    ,
      set(CirclesControlBarmenugyroscopeavailable, false);
      CirclesControlBarupdateGyroscopeButtons();
    );
  </action>
  <action name="CirclesControlBarenableGyroscopeButtons">
    if (tour_gyroscopedevices,
      set(CirclesControlBarmenugyroscopeenabled, %1);
      CirclesControlBarupdateGyroscopeButtons();
    );
  </action>
	<action name="CirclesControlBarHideGyroscopeButtons">
		set(layer[CirclesControlBarbtn_gyroscope_off].visible, false);
		set(layer[CirclesControlBarbtn_gyroscope_on].visible, false);
		if('%1' == 'true' AND plugin[gyroscope],
			set(layer[CirclesControlBarbtn_gyroscope_not].visible, true);
		,
			set(layer[CirclesControlBarbtn_gyroscope_not].visible, false);
		);
	</action>
	<action name="CirclesControlBarShowGyroscopeButtons">
		if (CirclesControlBarmenugyroscopeavailable,
			if (CirclesControlBarmenugyroscopeenabled,
				set(layer[CirclesControlBarbtn_gyroscope_off].visible, true);
				set(layer[CirclesControlBarbtn_gyroscope_on].visible, false);
			,
				set(layer[CirclesControlBarbtn_gyroscope_off].visible, false);
				set(layer[CirclesControlBarbtn_gyroscope_on].visible, true);
			);
			set(layer[CirclesControlBarbtn_gyroscope_not].visible, false);
		,
			CirclesControlBarHideGyroscopeButtons(true);
		);
	</action>
	<action name="CirclesControlBarupdateGyroscopeButtons">
	if (tour_gyroscopedevices,
		if (CirclesControlBarIsOpened,
			CirclesControlBarShowGyroscopeButtons();
		,
			CirclesControlBarHideGyroscopeButtons();
		);
	,
		if (CirclesControlBarIsOpened,
			CirclesControlBarHideGyroscopeButtons(true);
		,
			CirclesControlBarHideGyroscopeButtons();
		);
	);
	</action>



  <action name="CirclesControlBarhideMenuControls">
    set(CirclesControlBarIsOpened, false);


set(layer[CirclesControlBarbtn_home].visible, false);
	CirclesControlBarupdateFullscreenButtons();

	CirclesControlBarupdateInfoButtons();


	CirclesControlBarupdateSoundButtons();
	CirclesControlBarupdateGyroscopeButtons();


	CirclesControlBarupdateFloorplanButtons();
	CirclesControlBarupdateVrButtons();



	set(layer[CirclesControlBar_menu_bg].width, get(CirclesControlBarbackgroundwidthwhenclosed));

	set(layer[CirclesControlBar_menu_bg].visible, true);
  </action>
  <action name="CirclesControlBarshowMenuControls">
    set(CirclesControlBarIsOpened, true);
	set(layer[CirclesControlBar_menu_bg].visible, true);


set(layer[CirclesControlBarbtn_home].visible, true);
	CirclesControlBarupdateFullscreenButtons();

	CirclesControlBarupdateInfoButtons();


	CirclesControlBarupdateSoundButtons();
	CirclesControlBarupdateGyroscopeButtons();
	CirclesControlBarupdateVrButtons();


	CirclesControlBarupdateFloorplanButtons();


    set(layer[CirclesControlBar_menu_bg].width, get(CirclesControlBarbackgroundwidthwhenopened));
  </action>


	<events name="CirclesControlBarhideshowinfoevent" 
		onhidetourinfo="CirclesControlBarupdateInfoButtons();" 
		onshowtourinfo="CirclesControlBarupdateInfoButtons();" 
		keep="true" />
	<action name="CirclesControlBarHideInfoButtons">
		set(layer[CirclesControlBarbtn_display_info].visible, false);
		set(layer[CirclesControlBarbtn_close_info].visible, false);
	</action>
	<action name="CirclesControlBarShowInfoButtons">
		if (tour_displayinfo,
			set(layer[CirclesControlBarbtn_close_info].visible, true);
			set(layer[CirclesControlBarbtn_display_info].visible, false);
		,
			set(layer[CirclesControlBarbtn_display_info].visible, true);
			set(layer[CirclesControlBarbtn_close_info].visible, false);
		);
	</action>
	<action name="CirclesControlBarupdateInfoButtons">
		if (CirclesControlBarIsOpened,
			CirclesControlBarShowInfoButtons();
		,
			CirclesControlBarHideInfoButtons();
		);
	</action>

	<events name="CirclesControlBarDisplayFloorPlanEvents" 
		onshowtourfloorplan="CirclesControlBarupdateFloorplanButtons();" 
		onhidetourfloorplan="CirclesControlBarupdateFloorplanButtons();" 
		keep="true" />
	<action name="CirclesControlBarHideFloorplanButtons">
		set(layer[CirclesControlBarbtn_display_floorplan].visible, false);
		set(layer[CirclesControlBarbtn_hide_floorplan].visible, false);
	</action>
	<action name="CirclesControlBarShowFloorplanButtons">
		if (tour_displayfloorplan,
			set(layer[CirclesControlBarbtn_hide_floorplan].visible, true);
			set(layer[CirclesControlBarbtn_display_floorplan].visible, false);
		,
			set(layer[CirclesControlBarbtn_display_floorplan].visible, true);
			set(layer[CirclesControlBarbtn_hide_floorplan].visible, false);
		);
	</action>
	<action name="CirclesControlBarupdateFloorplanButtons">
		if (CirclesControlBarIsOpened,
			CirclesControlBarShowFloorplanButtons();
		,
			CirclesControlBarHideFloorplanButtons();
		);
	</action>



  <events name="CirclesControlBarmenufullscreenchangeevent"
          onenterfullscreen="CirclesControlBarupdateFullscreenButtons();"
          onexitfullscreen="CirclesControlBarupdateFullscreenButtons();"
          keep="true"/>
	<action name="CirclesControlBarHideFullscreenButtons">
		set(layer[CirclesControlBarbtn_openfs].visible , false);
		set(layer[CirclesControlBarbtn_closefs].visible, false);
	</action>
	<action name="CirclesControlBarShowFullscreenButtons">
		if (device.fullscreensupport,
			if(tour_fullscreen,
				set(layer[CirclesControlBarbtn_openfs].visible , false);
				set(layer[CirclesControlBarbtn_closefs].visible, true);
			,
				set(layer[CirclesControlBarbtn_openfs].visible ,true);
				set(layer[CirclesControlBarbtn_closefs].visible,false);
			);
		,
			CirclesControlBarHideFullscreenButtons();
		);
	</action>
	<action name="CirclesControlBarupdateFullscreenButtons">
		if (CirclesControlBarIsOpened,
			CirclesControlBarShowFullscreenButtons();
		,
			CirclesControlBarHideFullscreenButtons();
		);
	</action>


  <events name="CirclesControlBarplaystopsoundsevent" playtoursoundsevent="CirclesControlBarupdateSoundButtons();" stoptoursoundsevent="CirclesControlBarupdateSoundButtons();" keep="true"/>
	<action name="CirclesControlBarHideSoundButtons">
		set(layer[CirclesControlBarbtn_sound_off].visible, false);
		set(layer[CirclesControlBarbtn_sound_on].visible , false);
	</action>
	<action name="CirclesControlBarShowSoundButtons">
		if (tour_soundson == false,
			set(layer[CirclesControlBarbtn_sound_off].visible, false);
			set(layer[CirclesControlBarbtn_sound_on].visible , true);
		,
			set(layer[CirclesControlBarbtn_sound_off].visible, true);
			set(layer[CirclesControlBarbtn_sound_on].visible , false);
		);
	</action>
	<action name="CirclesControlBarupdateSoundButtons">
		if (CirclesControlBarIsOpened,
			CirclesControlBarShowSoundButtons();
		,
			CirclesControlBarHideSoundButtons();
		);
	</action>


<layer name="CirclesControlBarmenuTooltipStyle"
	keep="true"
	enabled="false"
	capture="false"
	url="%FIRSTXML%/graphics/textfield.swf"
	align="center"
	background="false"
	border="false"
	css="color:#000000;font-family:Helvetica;font-weight:bold;font-size:14px;text-align:left;"
	height="20"
	autoheight="true"
	autowidth="auto"
	xoffset="0"
	yoffset="0"
	padding="2"
	selectable="false"
	zorder="0"
	visible="false"
	html=""
	edge="bottom"
/>
  <action name="CirclesControlBarbuildMenu">
    
    set(CirclesControlBarbutton_pos, 0);


    set(layer[CirclesControlBarbtn_display_info].x, get(CirclesControlBarbutton_pos));
    set(layer[CirclesControlBarbtn_close_info].x  , get(CirclesControlBarbutton_pos));
    inc(CirclesControlBarbutton_pos, 45);


      if (device.fullscreensupport,
        set(layer[CirclesControlBarbtn_openfs].x , get(CirclesControlBarbutton_pos));
        set(layer[CirclesControlBarbtn_closefs].x, get(CirclesControlBarbutton_pos));
        inc(CirclesControlBarbutton_pos, 45);
      );


      set(layer[CirclesControlBarbtn_display_floorplan].x , get(CirclesControlBarbutton_pos));
      set(layer[CirclesControlBarbtn_hide_floorplan].x    , get(CirclesControlBarbutton_pos));
      inc(CirclesControlBarbutton_pos, 45);



      set(layer[CirclesControlBarbtn_sound_on].x , get(CirclesControlBarbutton_pos));
      set(layer[CirclesControlBarbtn_sound_off].x, get(CirclesControlBarbutton_pos));
      inc(CirclesControlBarbutton_pos, 45);



    if(plugin[ptpvrmode] AND device.html5,
      set(layer[CirclesControlBarbtn_enter_vr].x, get(CirclesControlBarbutton_pos));
      set(layer[CirclesControlBarbtn_enter_vr_not].x, get(CirclesControlBarbutton_pos));
      inc(CirclesControlBarbutton_pos, 45);
    );


      if(plugin[gyroscope],
        set(CirclesControlBarDisplayGyroscopeButton, false);
        if (device.tablet, set(CirclesControlBarDisplayGyroscopeButton, true););
        if (device.mobile, set(CirclesControlBarDisplayGyroscopeButton, true););
        if(CirclesControlBarDisplayGyroscopeButton,
          set(layer[CirclesControlBarbtn_gyroscope_on].x , get(CirclesControlBarbutton_pos));
          set(layer[CirclesControlBarbtn_gyroscope_off].x, get(CirclesControlBarbutton_pos));
          set(layer[CirclesControlBarbtn_gyroscope_not].x, get(CirclesControlBarbutton_pos));
          inc(CirclesControlBarbutton_pos, 45);
        );
      );


        set(layer[CirclesControlBarbtn_home].x, get(CirclesControlBarbutton_pos));
        inc(CirclesControlBarbutton_pos, 45);



      dec(CirclesControlBarbutton_pos, 5);

      set(CirclesControlBarbackgroundwidthwhenopened, get(CirclesControlBarbutton_pos));


    
      set(layer[CirclesControlBar_menu_bg].width, get(CirclesControlBarbackgroundwidthwhenopened));
	
	
	
    </action>

	<events name="CirclesControlBarStartTourEvents" onTourStart="CirclesControlBarCallOnStartTour();" keep="true" />
	
	<action name="CirclesControlBarCallOnStartTour">
		
		CirclesControlBarshowMenuControls();
	</action>



<!-- ********** -->
<!-- Boussole -->
<!-- id : compass -->
<!-- ********** -->

  <layer name="compassbackground"
         url="%FIRSTXML%/graphics/compass/compassbg53a0d7.png"
         keep="true"
         handcursor="false"
         capture="false"
         align="bottomleft"
         x="0"
         y="0"
         zorder="6"
         visible="false"
         active="true"
         started="false"

         height="100"
         width="100"

         >



    <layer name="compassradar" keep="true"
         url.flash="%FIRSTXML%/graphics/radar.swf"
         url.html5="%FIRSTXML%/graphics/radar.js"
         align="center"
         heading="0.0"
         headingoffset="0.0"
         fillcolor="0xb17135"
         fillalpha="0.50000762951094835"
         width="100%"
         height="100%"
         zorder="1"
         />


    <layer name="compasspointer"
           url="%FIRSTXML%/graphics/compass/compasspointerb17135.png"
           keep="true"
           align="center"
           handcursor="false"
           capture="false"
           zorder="1"
           height="100%"
           width="100%"
          />
  </layer>

  <events name="compassevts"
          keep="true"
          onnewpano="compassUpdateOrientation();"
          onviewchanged="compassUpdateOrientation();"
    onTourStart="set(layer[compassbackground].started, true);showcompass();"
          hidetourcontrols="hidecompass();"
          showtourcontrols="set(layer[compassbackground].started, true);showcompass();"
         />

  <action name="compassUpdateOrientation">
    if(scene[get(xml.scene)].planar,
      set(layer[compassbackground].active, false);
      hidecompass();
    ,

      set(layer[compassbackground].active, true);
      mod(compasshlookat, view.hlookat, 360);
      mul(compassheading, -1, get(scene[get(xml.scene)].heading));
      if (compassheading == null, set(compassheading, 0));
      sub(layer[compasspointer].rotate, compasshlookat, compassheading);

      set(layer[compassradar].heading, get(scene[get(xml.scene)].heading));

      showcompass();
    );
  </action>

 
  <action name="hidecompass">
    set(layer[compassbackground].visible, false);
  </action>
  <action name="showcompass">
    if(tour_displaycontrols,
    if(layer[compassbackground].active AND layer[compassbackground].started,set(layer[compassbackground].visible, true););
    ,hidecompass(););
  </action>


<!-- ********** -->
<!-- Small Gallery Bar - Scene specific -->
<!-- id : gallerybarforasinglepano -->
<!-- ********** -->

  <krpano gallerybarforasinglepanobuilt="false" gallerybarforasinglepanoBuildable="false" />
  <events name="gallerybarforasinglepanoevents"
          onxmlcomplete="gallerybarforasinglepanobuildBar();"
          hidetourcontrols="hidegallerybarforasinglepano();"
          showtourcontrols="showgallerybarforasinglepano();"
          keep="true"/>
  <action name="gallerybarforasinglepanobuildBar">
    ifnot (gallerybarforasinglepanobuilt,
      set(gallerybarforasinglepanoBuildable, true);
      gallerybarforasinglepanothumbbar_addimage(0,%FIRSTXML%/graphics/gallerybarforasinglepano/reimaginehome_1785059175480_1x.jpg);
      set(gallerybarforasinglepanobuilt, true);
      
    );
  </action>

  <events name="gallerybarforasinglepanoStartEvents" onPanoStart="showgallerybarforasinglepano();" onTourStart="showgallerybarforasinglepano();" keep="true" />



  <layer name="gallerybarforasinglepanobackground" type="container" keep="true"
         bgcolor="0xffffff"
         bgalpha="0"
         alpha="1.0"
         align="bottomleft"
         x="150"
         y="50"
         zorder="7"
         visible="false"
         height="152"
         width="262"
         />

  <action name="hidegallerybarforasinglepano">
	gallerybarforasinglepanothumbbar_set_visible(false);
  </action>
  <action name="showgallerybarforasinglepano">
    set(displaythegallery_gallerybarforasinglepano, false);
    if(tour_displaycontrols,

    if (xml.scene == pano52, set(displaythegallery_gallerybarforasinglepano, true); );
    );
    if (displaythegallery_gallerybarforasinglepano,
      if(gallerybarforasinglepanoBuildable,
        gallerybarforasinglepanothumbbar_set_visible(true);
      );
    ,
      hidegallerybarforasinglepano();
    );
  </action>


  <action name="gallerybarforasinglepanothumbbar_addimage">
    txtadd(pname, 'gallerybarforasinglepanoPicture', %1);
    addplugin(get(pname));
    set(layer[%pname].zorder, 8);
    set(layer[%pname].url, %2);
    set(layer[%pname].align, bottomleft);
    set(layer[%pname].width, 250);
    set(layer[%pname].height, 140);
    set(layer[%pname].onclick, gallerybarforasinglepano_showimage(get(name)));
    set(layer[%pname].visible, false);
    set(layer[%pname].keep, true);

    
    set(layer[%pname].x, 156);

    mul(tmp, 146, %1);
    add(tmp, tmp, 6);
    add(layer[%pname].y, 50, tmp );


    copy(layer[%pname].thumbx, layer[%pname].x);
    copy(layer[%pname].thumby, layer[%pname].y);
  </action>

  <action name="gallerybarforasinglepano_showimage">
    gallerybarforasinglepano_hide_allimages();

    set(layer[%1].zorder, 9);

    push(layer[%1].width);
    push(layer[%1].height);
    layer[%1].resetsize();
    copy(layer[%1].originalwidth , layer[%1].width);
    copy(layer[%1].originalheight, layer[%1].height);
    pop(layer[%1].height);
    pop(layer[%1].width);

    set(imgwidth , get(layer[%1].originalwidth));
    set(imgheight, get(layer[%1].originalheight));

    set(maxwidth, get(stagewidth));
    sub(maxwidth, get(stagewidth), 836);

    set(maxheight, get(stageheight));
    sub(maxheight, get(stageheight), 12);

    if(imgwidth GT maxwidth,
      mul(imgheight, imgheight, maxwidth);
      div(imgheight, imgheight, imgwidth);
      copy(imgwidth, maxwidth);
    );

    if(imgheight GT maxheight,
      mul(imgwidth, imgwidth, maxheight);
      div(imgwidth, imgwidth, imgheight);
      copy(imgheight, maxheight);
    );

    tween(layer[%1].width , get(imgwidth));
    tween(layer[%1].height, get(imgheight));

    layer[%1].changeorigin(center,center);

    tween(layer[%1].x, 0);
    tween(layer[%1].y, 0);

    set(layer[%1].onclick, gallerybarforasinglepano_hideimage(%1) );
  </action>

  <action name="gallerybarforasinglepano_hideimage">
    layer[%1].changeorigin(bottomleft,bottomleft);

    set(layer[%1].zorder, 8);

    tween(layer[%1].width , 250);
    tween(layer[%1].height, 140);
    tween(layer[%1].x, get(layer[%1].thumbx));
    tween(layer[%1].y, get(layer[%1].thumby));

    set(layer[%1].onclick, gallerybarforasinglepano_showimage(%1) );
  </action>

  <action name="gallerybarforasinglepano_hide_allimages">
    gallerybarforasinglepano_hideimage(gallerybarforasinglepanoPicture0);
  </action>

  <action name="gallerybarforasinglepanothumbbar_set_visible">
    set(layer[gallerybarforasinglepanoPicture0].visible,%1);
    set(layer[gallerybarforasinglepanobackground].visible, %1);
  </action>

<!-- ********** -->
<!-- Small Gallery Bar - Scene specific1 -->
<!-- id : gallerybarforasinglepano1 -->
<!-- ********** -->

  <krpano gallerybarforasinglepano1built="false" gallerybarforasinglepano1Buildable="false" />
  <events name="gallerybarforasinglepano1events"
          onxmlcomplete="gallerybarforasinglepano1buildBar();"
          hidetourcontrols="hidegallerybarforasinglepano1();"
          showtourcontrols="showgallerybarforasinglepano1();"
          keep="true"/>
  <action name="gallerybarforasinglepano1buildBar">
    ifnot (gallerybarforasinglepano1built,
      set(gallerybarforasinglepano1Buildable, true);
      gallerybarforasinglepano1thumbbar_addimage(0,%FIRSTXML%/graphics/gallerybarforasinglepano1/reimaginehome_1785061230816_1x.jpg);
      set(gallerybarforasinglepano1built, true);
      
    );
  </action>

  <events name="gallerybarforasinglepano1StartEvents" onPanoStart="showgallerybarforasinglepano1();" onTourStart="showgallerybarforasinglepano1();" keep="true" />



  <layer name="gallerybarforasinglepano1background" type="container" keep="true"
         bgcolor="0xffffff"
         bgalpha="0"
         alpha="1.0"
         align="bottomleft"
         x="150"
         y="50"
         zorder="10"
         visible="false"
         height="152"
         width="262"
         />

  <action name="hidegallerybarforasinglepano1">
	gallerybarforasinglepano1thumbbar_set_visible(false);
  </action>
  <action name="showgallerybarforasinglepano1">
    set(displaythegallery_gallerybarforasinglepano1, false);
    if(tour_displaycontrols,

    if (xml.scene == pano436, set(displaythegallery_gallerybarforasinglepano1, true); );
    );
    if (displaythegallery_gallerybarforasinglepano1,
      if(gallerybarforasinglepano1Buildable,
        gallerybarforasinglepano1thumbbar_set_visible(true);
      );
    ,
      hidegallerybarforasinglepano1();
    );
  </action>


  <action name="gallerybarforasinglepano1thumbbar_addimage">
    txtadd(pname, 'gallerybarforasinglepano1Picture', %1);
    addplugin(get(pname));
    set(layer[%pname].zorder, 11);
    set(layer[%pname].url, %2);
    set(layer[%pname].align, bottomleft);
    set(layer[%pname].width, 250);
    set(layer[%pname].height, 140);
    set(layer[%pname].onclick, gallerybarforasinglepano1_showimage(get(name)));
    set(layer[%pname].visible, false);
    set(layer[%pname].keep, true);

    
    set(layer[%pname].x, 156);

    mul(tmp, 146, %1);
    add(tmp, tmp, 6);
    add(layer[%pname].y, 50, tmp );


    copy(layer[%pname].thumbx, layer[%pname].x);
    copy(layer[%pname].thumby, layer[%pname].y);
  </action>

  <action name="gallerybarforasinglepano1_showimage">
    gallerybarforasinglepano1_hide_allimages();

    set(layer[%1].zorder, 12);

    push(layer[%1].width);
    push(layer[%1].height);
    layer[%1].resetsize();
    copy(layer[%1].originalwidth , layer[%1].width);
    copy(layer[%1].originalheight, layer[%1].height);
    pop(layer[%1].height);
    pop(layer[%1].width);

    set(imgwidth , get(layer[%1].originalwidth));
    set(imgheight, get(layer[%1].originalheight));

    set(maxwidth, get(stagewidth));
    sub(maxwidth, get(stagewidth), 836);

    set(maxheight, get(stageheight));
    sub(maxheight, get(stageheight), 12);

    if(imgwidth GT maxwidth,
      mul(imgheight, imgheight, maxwidth);
      div(imgheight, imgheight, imgwidth);
      copy(imgwidth, maxwidth);
    );

    if(imgheight GT maxheight,
      mul(imgwidth, imgwidth, maxheight);
      div(imgwidth, imgwidth, imgheight);
      copy(imgheight, maxheight);
    );

    tween(layer[%1].width , get(imgwidth));
    tween(layer[%1].height, get(imgheight));

    layer[%1].changeorigin(center,center);

    tween(layer[%1].x, 0);
    tween(layer[%1].y, 0);

    set(layer[%1].onclick, gallerybarforasinglepano1_hideimage(%1) );
  </action>

  <action name="gallerybarforasinglepano1_hideimage">
    layer[%1].changeorigin(bottomleft,bottomleft);

    set(layer[%1].zorder, 11);

    tween(layer[%1].width , 250);
    tween(layer[%1].height, 140);
    tween(layer[%1].x, get(layer[%1].thumbx));
    tween(layer[%1].y, get(layer[%1].thumby));

    set(layer[%1].onclick, gallerybarforasinglepano1_showimage(%1) );
  </action>

  <action name="gallerybarforasinglepano1_hide_allimages">
    gallerybarforasinglepano1_hideimage(gallerybarforasinglepano1Picture0);
  </action>

  <action name="gallerybarforasinglepano1thumbbar_set_visible">
    set(layer[gallerybarforasinglepano1Picture0].visible,%1);
    set(layer[gallerybarforasinglepano1background].visible, %1);
  </action>

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


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

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

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

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

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

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

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

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

              if(device.mobile OR device.tablet OR device.safari OR device.chrome,
                resumesound(bgsoundname);
                set(plugin[soundinterface].bgsoundpaused, false);
              );
            );
          ,
            if(((plugin[soundinterface].bgsoundpaused == true OR plugin[soundinterface].bgsoundtoforce == true) AND scene[get(xml.scene)].video == false) OR (scene[get(xml.scene)].video == true AND scene[get(xml.scene)].scenevideomute == true),
              set(plugin[soundinterface].bgsound, true);
              set(plugin[soundinterface].bgsoundpaused, false);
              set(plugin[soundinterface].bgsoundloopended, false);
              set(plugin[soundinterface].bgsoundtoforce, false);
              if(plugin[soundinterface].backgroundsoundloops GT 0,
                playsound(bgsoundname, get(plugin[soundinterface].backgroundsound), get(plugin[soundinterface].backgroundsoundloops), stopbackgroundsoundoncomplete());
              ,
                playsound(bgsoundname, get(plugin[soundinterface].backgroundsound), get(plugin[soundinterface].backgroundsoundloops));
              );
            );
          );
        );
      );
      
    ,
      if(forceBgSoundOnResume,
        playbackgroundsound();
        
      );
    );
  </action>
  <action name="preloadSounds">
    preloadsound("whispers-of-the-night-sky_89639.mp3");
  </action>

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

            if(device.mobile OR device.tablet OR device.safari OR device.chrome,
              set(tour_current_played_sound_paused, false);
              resumesound(get(tour_current_played_sound));
            );
          );
        );
      );
    );
  </action>
  <action name="resumeVideoActionsSounds">
    if(tour_current_played_video,
      set(resumeVideoActionsVerification, true);
      if(tour_current_played_sound,
        if(tour_current_played_video_state LT tour_current_played_sound_state,
          set(resumeVideoActionsVerification, false);
        );
      );
      if(resumeVideoActionsVerification,
        if (tour_soundson,
          if(device.flash OR (device.webgl AND !device.ios),
            div(volume, tour_soundsvolume, 100);
            set(layer[displayedStandardVideo].volume, get(volume));
          ,
            ifnot(device.ios,
              js(kpanotour.Sounds.startVideosSounds(get(volume)));
            ,
              if(tour_soundsvolume GT 0,
                set(layer[displayedStandardVideo].muted, false);
              ,
                set(layer[displayedStandardVideo].muted, true);
              );
            );
          );
        ,
          if(device.flash OR (device.webgl AND !device.ios),
            set(layer[displayedStandardVideo].volume, 0);
          ,
            ifnot(device.ios,
              js(kpanotour.Sounds.stopVideosSounds());
            ,
              set(layer[displayedStandardVideo].muted, true);
            );
          );
        );
      );
    );
  </action>
  <action name="pauseSoundActionsSounds">
    if (tour_current_played_sound,
      ifnot(tour_current_played_sound_paused,
        set(tour_current_played_sound_paused, true);
        pausesound(get(tour_current_played_sound));
      );
    );
  </action>
  <action name="pauseVideoActionsSounds">
    if(tour_current_played_video,
      if(device.flash OR (device.webgl AND !device.ios),
        set(layer[displayedStandardVideo].volume, 0);
      ,
        ifnot(device.ios,
          js(kpanotour.Sounds.stopVideosSounds());
        ,
          set(layer[displayedStandardVideo].muted, true);
        );
      );
    );
  </action>

  <!-- Tour Information -->
  <action name="hideTourInfo">set(tour_displayinfo, false);events.dispatch(onhidetourinfo);</action>
  <action name="showTourInfo">set(tour_displayinfo, true); events.dispatch(onshowtourinfo);</action>


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

	<plugin name="ptpvrmode" devices="html5" keep="true"
		url="%FIRSTXML%/graphics/webvr.js"
		mobilevr_support="true"
		mobilevr_fake_support="false"
		vr_cursor=""
		vr_cursor_enabled="false"
		onavailable="delayedcall(1, checkVrAvailability(););"
		onunavailable="checkVrUnavailable();"
		/>
	<action name="checkVrAvailability">
		if(plugin[ptpvrmode],
			if (plugin[ptpvrmode].isavailable,
				set(tour_vrdevices, true);
				events.dispatch(onvravailable);
			,
				set(tour_vrdevices, false);
			);
		,
			checkVrUnavailable();
		);
	</action>
	<action name="checkVrUnavailable">
		set(tour_vrdevices, false);
		events.dispatch(onvrunavailable);
	</action>
  <!-- FLOORPLAN -->
  <action name="hideFloorplan">set(tour_displayfloorplan, false);events.dispatch(onhidetourfloorplan);</action>
  <action name="showFloorplan">set(tour_displayfloorplan, true); events.dispatch(onshowtourfloorplan);</action>


</krpano>