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

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


    
  <!-- Spot Style - Default Point Spot Style 1 -->
  <style name="IconDefaultPointSpotStyle1"
         url="%FIRSTXML%/spots/_3bl-360_orange_user_defaultpoint0.png"
         visible="false"
         onhover="onhoverIconDefaultPointSpotStyle1"
         onover="onoverIconDefaultPointSpotStyle1"
         onout="onoutIconDefaultPointSpotStyle1"

         height="60"
         width="60"
         />

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

  <action name="onoverIconDefaultPointSpotStyle1">


pauseautorotation(forcehotspot);

  </action>

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


resumeautorotation(forcehotspot);

  </action>



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



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

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

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

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

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

<action name="checkGyroAvailability">
  if(plugin[gyroscope],
    if (plugin[gyroscope].isavailable,
        
        switch(plugin[gyroscope].enabled);
        set(plugin[gyroscope].activated,true);
        
        set(tour_gyroscopedevices, true);
        events.dispatch(ongyroscopeavailable);
    ,
      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>

<!-- ********** -->
<!-- Three Bears Resort Waterpark -->
<!-- id : floorPlan -->
<!-- ********** -->

	<ptplugin name="floorPlan" engine="KolorFloorPlan">
		<settings>
			<option name="background_color" value="0089ad" type="string" />
			<option name="background_lighter_color" value="00a5d0" type="string" />
			<option name="background_darker_color" value="007290" type="string" />
			<option name="background_alpha" value="0.59999999999999998" type="float" />
			<option name="text_color" value="ffffff" 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="true" type="bool" />
			<option name="title" value="project_floor_title" type="string" />
			<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="0089ad" 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="ff8f11" type="string" />
			<option name="radar_line_alpha" value="1" type="float" />
			<option name="radar_fill_color" value="ff8f11" type="string" />
			<option name="radar_fill_alpha" value="1" type="float" />
			<option name="close_on_click" value="true" type="bool" />
			<option name="position" value="left" type="string" />
			<option name="zorder" value="2" type="int" />
			<option name="use_i18n" value="true" type="bool" />
		</settings>
		
		<floorplanItems selectedItem="fpitemmain" selectedSpot="" selectedSpotScene="" selectedSpotHeading="" selectedSpotFov="">
				
				<floorplanItem 
					name="fpitemmain" 
					width="450" 
					height="300" 
					groupName="" 
					url="floorplan/three-bears-lodge-indoor-waterpark-floor-plan-small.png" 
					title="project_floor_title"
					heading="0">
							<spot name="spotmap65" posX="0.874426007" posY="0.252873987" heading="0" desc="spotmap65_tooltip" descType="tooltip" groupName="" isScene="true" scene="pano63" jsClick="spotmap65ActionSpotFloorPlan">
								<icon url="spots/pin_2d_hole_user_defaultmap0.png" iconWidth="30" iconHeight="50" iconAnchor="bottom" />
							</spot>
							<spot name="spotmap66" posX="0.666155994" posY="0.250575006" heading="0" desc="spotmap66_tooltip" descType="tooltip" groupName="" isScene="true" scene="pano63" jsClick="spotmap66ActionSpotFloorPlan">
								<icon url="spots/pin_2d_hole_user_defaultmap0.png" iconWidth="30" iconHeight="50" iconAnchor="bottom" />
							</spot>
							<spot name="spotmap67" posX="0.529861987" posY="0.64597702" heading="0" desc="spotmap67_tooltip" descType="tooltip" groupName="" isScene="true" scene="pano63" jsClick="spotmap67ActionSpotFloorPlan">
								<icon url="spots/pin_2d_hole_user_defaultmap0.png" iconWidth="30" iconHeight="50" iconAnchor="bottom" />
							</spot>
							<spot name="spotmap68" posX="0.418069988" posY="0.388505995" heading="0" desc="spotmap68_tooltip" descType="tooltip" groupName="" isScene="true" scene="pano63" jsClick="spotmap68ActionSpotFloorPlan">
								<icon url="spots/pin_2d_hole_user_defaultmap0.png" iconWidth="30" iconHeight="50" iconAnchor="bottom" />
							</spot>
							<spot name="spotmap69" posX="0.376722991" posY="0.167815998" heading="0" desc="spotmap69_tooltip" descType="tooltip" groupName="" isScene="true" scene="pano63" jsClick="spotmap69ActionSpotFloorPlan">
								<icon url="spots/pin_2d_hole_user_defaultmap0.png" iconWidth="30" iconHeight="50" iconAnchor="bottom" />
							</spot>
							<spot name="spotmap70" posX="0.465543985" posY="0.450574994" heading="0" desc="spotmap70_tooltip" descType="tooltip" groupName="" isScene="true" scene="pano63" jsClick="spotmap70ActionSpotFloorPlan">
								<icon url="spots/pin_2d_hole_user_defaultmap0.png" iconWidth="30" iconHeight="50" iconAnchor="bottom" />
							</spot>
							<spot name="spotmap71" posX="0.460949004" posY="0.701148987" heading="0" desc="spotmap71_tooltip" descType="tooltip" groupName="" isScene="true" scene="pano63" jsClick="spotmap71ActionSpotFloorPlan">
								<icon url="spots/pin_2d_hole_user_defaultmap0.png" iconWidth="30" iconHeight="50" iconAnchor="bottom" />
							</spot>
							<spot name="spotmap72" posX="0.816232979" posY="0.121839002" heading="0" desc="spotmap72_tooltip" descType="tooltip" groupName="" isScene="true" scene="pano63" jsClick="spotmap72ActionSpotFloorPlan">
								<icon url="spots/pin_2d_hole_user_defaultmap0.png" iconWidth="30" iconHeight="50" iconAnchor="bottom" />
							</spot>
				</floorplanItem>
			
			
		</floorplanItems>
	</ptplugin>
	
	<action name="kolorFloorplanJsReady_floorPlan">
		set(ptplugin[floorPlan].jsready, true);
		
		ifnot(ptplugin[floorPlan].floorplanItems[0].selectedSpot == "",
			set(ptplugin[floorPlan].floorplanItems[0].selectedSpotFov, get(view.hfov));
			js(invokePluginFunction(floorPlan, setKolorFloorPlanSelectedSpotOptions, get(xml.scene), get(view.hlookat), get(view.hfov)));
		);
	</action>
	
	
		<!-- floorplan main spots counter : 8 -->
			<action name="spotmap65ActionSpotFloorPlan">
          mainloadscene(pano63);lookat(get(panoview.h), get(panoview.v), get(panoview.fov));

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

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

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

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

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

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

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

</action>
	
	
	
	<events name="floorPlanEvents" 
	onxmlcomplete="ifnot(floorPlanFloorPlanLoaded,set(tour_displayfloorplan,false););floorPlanActivateDefaultSpot();" 
	onviewchanged="floorPlanOnViewChange();" 
	onhidetourfloorplan="delayedcall(0.3,floorPlanCloseTourFloorPlan(););" 
	onshowtourfloorplan="if(tour_displayfloorplan,floorPlanOpenTourFloorPlan(););" 
	onTourStart=""
	changetourlanguage="floorPlanChangeLanguage();"
	keep="true" />
	
	<action name="floorPlanChangeLanguage">
		if(ptplugin[floorPlan].jsready,
			stopdelayedcall(delay_floorPlan);
			js(invokePluginFunction(floorPlan, changeLanguage));
			js(invokePluginFunction(floorPlanArea, changeLanguage, false));
		,
			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[0].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[0].selectedSpot, %1);
		set(ptplugin[floorPlan].floorplanItems[0].selectedItem, %2);
		
		if(%1 AND %1 != "",
			set(ptplugin[floorPlan].floorplanItems[0].selectedSpotScene, get(xml.scene));
			set(ptplugin[floorPlan].floorplanItems[0].selectedSpotHeading, get(view.hlookat));
			set(ptplugin[floorPlan].floorplanItems[0].selectedSpotFov, get(view.hfov));
		);
		
		js(invokePluginFunction(floorPlan, selectSpot, %1, %2, %3));

		if(%1 AND %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[0].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);
		
		
		set(defaultfloorplaniteminc_wait,50);
		for(set(defaultfloorplaniteminc,0), defaultfloorplaniteminc LT ptplugin[floorPlan].floorplanItems[0].floorplanItem.count , inc(defaultfloorplaniteminc),
			if(defaultfloorplaniteminc_wait == defaultfloorplaniteminc,
				add(defaultfloorplaniteminc_wait,50);
				wait(0);
			);
			if(floorPlanSpotSearchActivated == true,
				
				if(ptplugin[floorPlan].floorplanItems[0].floorplanItem[get(defaultfloorplaniteminc)].groupName == scene[get(xml.scene)].group,
					set(floorPlanItemFound, get(ptplugin[floorPlan].floorplanItems[0].floorplanItem[get(defaultfloorplaniteminc)].name));
					set(ptplugin[floorPlan].floorplanItems[0].selectedItem, get(ptplugin[floorPlan].floorplanItems[0].floorplanItem[get(defaultfloorplaniteminc)].name));
					set(floorPlanItemSearch, false);
				,
					
					if(floorPlanItemFound == "",
						set(floorPlanItemFound, get(ptplugin[floorPlan].floorplanItems[0].floorplanItem[fpitemmain].name));
						set(ptplugin[floorPlan].floorplanItems[0].selectedItem, get(ptplugin[floorPlan].floorplanItems[0].floorplanItem[fpitemmain].name));
					);
				);
			);
			if(floorPlanSpotSearchActivated == true,
				set(defaultspotinc_wait,50);
				for(set(defaultspotinc,0), defaultspotinc LT ptplugin[floorPlan].floorplanItems[0].floorplanItem[get(defaultfloorplaniteminc)].spot.count , inc(defaultspotinc),
					if(defaultspotinc_wait == defaultspotinc,
						add(defaultspotinc_wait,50);
						wait(0);
					);
					if(ptplugin[floorPlan].floorplanItems[0].floorplanItem[get(defaultfloorplaniteminc)].spot[get(defaultspotinc)].isScene == true,
					
						if(floorPlanSpotSearchContinue == true,
							if(ptplugin[floorPlan].floorplanItems[0].floorplanItem[get(defaultfloorplaniteminc)].spot[get(defaultspotinc)].scene == xml.scene,
								set(floorPlanSpotFound, get(ptplugin[floorPlan].floorplanItems[0].floorplanItem[get(defaultfloorplaniteminc)].spot[get(defaultspotinc)].name));
								set(floorPlanSpotScene, get(ptplugin[floorPlan].floorplanItems[0].floorplanItem[get(defaultfloorplaniteminc)].spot[get(defaultspotinc)].scene));
								set(ptplugin[floorPlan].floorplanItems[0].selectedItem, get(ptplugin[floorPlan].floorplanItems[0].floorplanItem[get(defaultfloorplaniteminc)].name));
								if(floorPlanItemSearch == false,
									set(floorPlanSpotSearchContinue, false);
									set(floorPlanSpotSearchActivated, false);
								);
							);
						);
					);
					
				);
			);
		);
		
		if(floorPlanSpotFound == "",
			
			
			floorPlanDeactivateSpot();
			
			
			set(ptplugin[floorPlan].floorplanItems[0].selectedItem, get(floorPlanItemFound));
			
			
			ifnot(ptplugin[floorPlan].floorplanItems[0].selectedItem == "",
				floorPlanActivateSpot("", get(ptplugin[floorPlan].floorplanItems[0].selectedItem), "");
			);
		,
			
			floorPlanActivateSpot(get(floorPlanSpotFound), get(ptplugin[floorPlan].floorplanItems[0].selectedItem), get(floorPlanSpotScene));
		);
	</action>
	
	<action name="floorPlanChangeTitle">
		js(invokePluginFunction(floorPlan, changeTitle, %1));
	</action>
	
	<ptplugin name="floorPlanArea" engine="kolorArea">
	<settings>
		<option name="position" value="left" 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="true" type="bool" />
		<option name="title" value="project_floor_title" type="string" />
		<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="0089ad" type="string" />
		<option name="close_displayed" value="true" type="bool" />
		<option name="close_text" value="floorPlandisplay_close_text" type="string" />

		<option name="background_color" value="0089ad" type="string" />
		<option name="background_alpha" value="0.59999999999999998" 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="padding" value="15" type="int" />
		<option name="topleft_radius" value="10" type="int" />
		<option name="topright_radius" value="10" type="int" />
		<option name="bottomleft_radius" value="10" type="int" />
		<option name="bottomright_radius" value="10" type="int" />
		<option name="area_border_width" value="2" type="int" />
		<option name="area_border_color" value="fd8f12" type="string" />
		<option name="area_border_alpha" value="1" type="float" />
		<option name="area_width" value="600" type="int" />
		<option name="area_height" value="400" type="int" />
		<option name="area_width_unit" value="pixel" type="string" />
		<option name="area_height_unit" value="pixel" 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="2" type="int" />
		<option name="use_i18n" value="true" type="bool" />
	</settings>
	</ptplugin>
	
	<action name="kolorAreaJsReady_floorPlanArea">
		set(ptplugin[floorPlanArea].jsready, true);

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

			js(showKolorArea(floorPlanArea, &lt;div id="floorPlanArea_floorplanDIV"&gt;&lt;/div&gt;));
			,
				set(ptplugin[floorPlanArea].currentCall, true);
				set(ptplugin[floorPlanArea].doNotDeleteMe, true);
				events.dispatch(onremovedisplayedobject);
				delayedcall(0.3,openKolorArea_floorPlanArea(););
			);
		);
	</action>
	
	<action name="closeKolorArea_floorPlanArea">
		if(ptplugin[floorPlanArea].isOpen,
			if(ptplugin[floorPlanArea].doNotDeleteMe,
				set(ptplugin[floorPlanArea].doNotDeleteMe, false);
			,
			js(invokePluginFunction(floorPlanArea, closeKolorArea));
			);
		);
	</action>
	
	<action name="toggleKolorArea_floorPlanArea">
		if(ptplugin[floorPlanArea].isOpen,
			closeKolorArea_floorPlanArea();
		,
			openKolorArea_floorPlanArea();
		);
	</action>
	
	<action name="closeKolorAreaCallback_floorPlanArea">
		set(ptplugin[floorPlanArea].doNotDeleteMe, false);
		if(ptplugin[floorPlanArea].isOpen,resumeautorotation(forceplugin);

			
		);
		set(ptplugin[floorPlanArea].isOpen, false);hideFloorplan();

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

		js(invokePluginFunction(floorPlanArea, showKolorArea, %1));
		,
			set(ptplugin[floorPlanArea].currentCall, true);
			set(ptplugin[floorPlanArea].doNotDeleteMe, true);
			events.dispatch(onremovedisplayedobject);
			delayedcall(0.3,showKolorArea_floorPlanArea(););
		);
	</action>
		
	<action name="hideKolorArea_floorPlanArea">
		if(ptplugin[floorPlanArea].doNotDeleteMe,
			set(ptplugin[floorPlanArea].doNotDeleteMe, false);
		,
		resumeautorotation(forceplugin);

		
		set(ptplugin[floorPlanArea].isOpen, false);
		js(invokePluginFunction(floorPlanArea, hideKolorArea, %1));
		);
	</action>
	
	<events name="kolorAreaEvents_floorPlanArea" 
		keep="true"
		hidetourcontrols="if(ptplugin[floorPlanArea].isOpen,set(restore_floorPlanArea, true);hideKolorArea_floorPlanArea(false);,set(restore_floorPlanArea, false););"
		showtourcontrols="if(tour_displayfloorplan,if(restore_floorPlanArea,showKolorArea_floorPlanArea(false);););"
		onremovedisplayedobject="ifnot(ptplugin[floorPlanArea].currentCall,if(ptplugin[floorPlanArea].isOpen,hideFloorplan();
););"
	/>
	
<!-- ********** -->
<!-- iControl Bar -->
<!-- id : controlBar_i -->
<!-- ********** -->

  <krpano controlBar_ibarbuilt="false" controlBar_ibackgroundwidthwhenclosed="0" controlBar_ibackgroundwidthwhenopened="0" controlBar_iIsOpened="false" />
  <events name="controlBar_ievents" 
    onxmlcomplete="controlBar_ibuildMenuBar();" 


    keep="true" />



  <action name="controlBar_ibuildMenuBar">
    ifnot (controlBar_ibarbuilt, controlBar_ibuildMenu(); set(controlBar_ibarbuilt, true););
  </action>

  <style name="controlBar_i_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', controlBar_imenuTooltipStyle, bottom);"
         onout="hideTooltip();"
         />
  <style name="controlBar_i_btn_style_off"
         keep="true"
         edge="right"
         align="right"
         x="0" y="0"
         width="40" height="40"
         onhover="showTooltip('plugin', controlBar_imenuTooltipStyle, bottom);"
         onout="hideTooltip();"
         />

  <layer name="controlBar_i_menu_bg"
         keep="true"
         type="container"
         zorder="3"
         width="40"
         height="40"
         align="bottom"
         x="0" y="10"
         maskchildren="true"
         rotate="0"
         visible="false"
         >

    <layer name="controlBar_ibtn_gyroscope_off"
            url="%FIRSTXML%/graphics/icontrolbar/btn_gyroscope.png"
            style="controlBar_i_btn_style"
            onclick="disableGyroscope();
"
            devices="html5"
            tooltip="controlBar_igyroOffTip"
            visible="false"
            />
    <layer name="controlBar_ibtn_gyroscope_on"
            url="%FIRSTXML%/graphics/icontrolbar/btn_gyroscope.png"
            style="controlBar_i_btn_style"
            onclick="enableGyroscope();
"
            devices="html5"
            tooltip="controlBar_igyroOnTip"
            visible="false"
            />
    <layer name="controlBar_ibtn_gyroscope_not"
            url="%FIRSTXML%/graphics/icontrolbar/btn_gyroscope_off.png"
            style="controlBar_i_btn_style_off"
            enabled="true"
            capture="false"
            devices="html5"
            tooltip="controlBar_igyroNotTip"
            visible="false"
            />


    <layer name="controlBar_ibtn_in"
            url="%FIRSTXML%/graphics/icontrolbar/btn_zoom_in.png"
            ondown="viewControlZoomIn(false);"
            onup="viewControlZoomStop();
"
            style="controlBar_i_btn_style"
            visible="false"
            tooltip="controlBar_izoomInTip"
            devices="desktop"
            />
    <layer name="controlBar_ibtn_out"
            url="%FIRSTXML%/graphics/icontrolbar/btn_zoom_out.png"
            ondown="viewControlZoomOut(false);
"
            onup="viewControlZoomStop();
"
            style="controlBar_i_btn_style"
            visible="false"
            tooltip="controlBar_izoomOutTip"
            devices="desktop"
            />

    <layer name="controlBar_ibtn_home"
           url="%FIRSTXML%/graphics/icontrolbar/btn_home.png"
           style="controlBar_i_btn_style"
           onclick="controlBar_ibtn_home_action();"
           visible="false"
           tooltip="controlBar_ihomeTip"
           />

    <layer name="controlBar_ibtn_left"
            url="%FIRSTXML%/graphics/icontrolbar/btn_move_left.png"
            ondown="viewControlMoveLeft(false);
"
            onup="viewControlMoveHoriStop();
"
            style="controlBar_i_btn_style"
            visible="false"
            tooltip="controlBar_imoveLeftTip"
            devices="desktop"
            />
    <layer name="controlBar_ibtn_right"
            url="%FIRSTXML%/graphics/icontrolbar/btn_move_right.png"
            ondown="viewControlMoveRight(false);
"
            onup="viewControlMoveHoriStop();
"
            style="controlBar_i_btn_style"
            visible="false"
            tooltip="controlBar_imoveRightTip"
            devices="desktop"
            />

    <layer name="controlBar_ibtn_up"
            url="%FIRSTXML%/graphics/icontrolbar/btn_move_up.png"
            ondown="viewControlMoveUp(false);
"
            onup="viewControlMoveVertStop();
"
            style="controlBar_i_btn_style"
            visible="false"
            tooltip="controlBar_imoveUpTip"
            devices="desktop"
            />
    <layer name="controlBar_ibtn_down"
            url="%FIRSTXML%/graphics/icontrolbar/btn_move_down.png"
            ondown="viewControlMoveDown(false);
"
            onup="viewControlMoveVertStop();
"
            style="controlBar_i_btn_style"
            visible="false"
            tooltip="controlBar_imoveDownTip"
            devices="desktop"
            />


    <layer name="controlBar_ibtn_sound_on"
            url="%FIRSTXML%/graphics/icontrolbar/btn_start_sound.png"
            onclick="playTourSounds();
"
            style="controlBar_i_btn_style"
            visible="false"
            tooltip="controlBar_isoundsOnTip"
            />
    <layer name="controlBar_ibtn_sound_off"
            url="%FIRSTXML%/graphics/icontrolbar/btn_stop_sound.png"
            onclick="stopTourSounds();
"
            style="controlBar_i_btn_style"
            visible="false"
            tooltip="controlBar_isoundsOffTip"
            />


    <layer name="controlBar_ibtn_prev_pano"
            url="%FIRSTXML%/graphics/icontrolbar/btn_previous_scene.png"
            onclick="loadPreviousScene();
"
            style="controlBar_i_btn_style"
            tooltip="controlBar_iprevSceneTip"
            visible="false"
            />
    <layer name="controlBar_ibtn_next_pano"
            url="%FIRSTXML%/graphics/icontrolbar/btn_next_scene.png"
            onclick="loadNextScene();
"
            style="controlBar_i_btn_style"
            tooltip="controlBar_inextSceneTip"
            visible="false"
            />



    <layer name="controlBar_ibtn_openfs"
            url="%FIRSTXML%/graphics/icontrolbar/btn_enter_fs.png"
            onclick="enterFullscreen();
"
            style="controlBar_i_btn_style"
            visible="false"
            devices="fullscreensupport"
            tooltip="controlBar_iopenFsTip"
            />
    <layer name="controlBar_ibtn_closefs"
            url="%FIRSTXML%/graphics/icontrolbar/btn_close_fs.png"
            onclick="exitFullscreen();
"
            style="controlBar_i_btn_style"
            visible="false"
            devices="fullscreensupport"
            tooltip="controlBar_icloseFsTip"
            />

    <layer name="controlBar_ibtn_autorotate_on"
            url="%FIRSTXML%/graphics/icontrolbar/btn_start_autorotation.png"
            onclick="resumeautorotation();
"
            style="controlBar_i_btn_style"
            visible="false"
            tooltip="controlBar_iautorotateOnTip"
            />
    <layer name="controlBar_ibtn_autorotate_off"
            url="%FIRSTXML%/graphics/icontrolbar/btn_stop_autorotation.png"
            onclick="pauseautorotation();
"
            style="controlBar_i_btn_style"
            visible="false"
            tooltip="controlBar_iautorotateOffTip"
            />



    <layer name="controlBar_ibtn_display_help"
            url="%FIRSTXML%/graphics/icontrolbar/btn_help.png"
            onclick="controlBar_idisplayHelp();"
            style="controlBar_i_btn_style"
            devices="desktop"
            visible="false"
            tooltip="controlBar_idisplayHelpTip"
            />
    <layer name="controlBar_ibtn_close_help"
            url="%FIRSTXML%/graphics/icontrolbar/btn_help.png"
            onclick="controlBar_icloseHelp();"
            style="controlBar_i_btn_style"
            visible="false"
            devices="desktop"
            tooltip="controlBar_ihideHelpTip"
            />



    <layer name="controlBar_ibtn_hidecontrols"
           url="%FIRSTXML%/graphics/icontrolbar/btn_hide_controls.png"
           style="controlBar_i_btn_style"
           onclick="controlBar_ihideMenuControls();hideTourControls();
"
           visible="false"
           tooltip="controlBar_ihideControlsTip"
           />
    <layer name="controlBar_ibtn_showcontrols"
           url="%FIRSTXML%/graphics/icontrolbar/btn_show_controls.png"
           style="controlBar_i_btn_style"
           onclick="controlBar_ishowMenuControls();showTourControls();
"
           tooltip="controlBar_idisplayControlsTip"
           visible="false"
           />
 </layer>

    <action name="controlBar_ibtn_home_action">
      hideTooltip();lookto(get(panoview.h),get(panoview.v),get(panoview.fov),smooth(100,20,50));
      if(scene[get(xml.scene)].video,
        plugin[get(videointerface_video)].seek(0);
        ifnot(plugin[get(videointerface_video)].ispaused,
          plugin[get(videointerface_video)].play();
        );
      );
    </action>



  <events name="controlBar_igyroscopeavailableevent"
          ongyroscopeavailable="controlBar_iupdateGyroscopeButtonsAvailability();"
          ongyroscopeunavailable="controlBar_iupdateGyroscopeButtonsAvailability();"
          ongyroscopeon="controlBar_ienableGyroscopeButtons(true);"
          ongyroscopeoff="controlBar_ienableGyroscopeButtons(false);"
          keep="true" devices="html5" />
  <krpano controlBar_imenugyroscopeavailable="false" controlBar_imenugyroscopeenabled="false"/>
  <action name="controlBar_iupdateGyroscopeButtonsAvailability">
    if (tour_gyroscopedevices,
      set(controlBar_imenugyroscopeavailable, true);
      controlBar_iupdateGyroscopeButtons();
    ,
      set(controlBar_imenugyroscopeavailable, false);
      controlBar_iupdateGyroscopeButtons();
    );
  </action>
  <action name="controlBar_ienableGyroscopeButtons">
    if (tour_gyroscopedevices,
      set(controlBar_imenugyroscopeenabled, %1);
      controlBar_iupdateGyroscopeButtons();
    );
  </action>
	<action name="controlBar_iHideGyroscopeButtons">
		set(layer[controlBar_ibtn_gyroscope_off].visible, false);
		set(layer[controlBar_ibtn_gyroscope_on].visible, false);
		if('%1' == 'true' AND plugin[gyroscope],
			set(layer[controlBar_ibtn_gyroscope_not].visible, true);
		,
			set(layer[controlBar_ibtn_gyroscope_not].visible, false);
		);
	</action>
	<action name="controlBar_iShowGyroscopeButtons">
		if (controlBar_imenugyroscopeavailable,
			if (controlBar_imenugyroscopeenabled,
				set(layer[controlBar_ibtn_gyroscope_off].visible, true);
				set(layer[controlBar_ibtn_gyroscope_on].visible, false);
			,
				set(layer[controlBar_ibtn_gyroscope_off].visible, false);
				set(layer[controlBar_ibtn_gyroscope_on].visible, true);
			);
			set(layer[controlBar_ibtn_gyroscope_not].visible, false);
		,
			controlBar_iHideGyroscopeButtons(true);
		);
	</action>
	<action name="controlBar_iupdateGyroscopeButtons">
	if (tour_gyroscopedevices,
		if (controlBar_iIsOpened,
			controlBar_iShowGyroscopeButtons();
		,
			controlBar_iHideGyroscopeButtons();
		);
	,
		if (controlBar_iIsOpened,
			controlBar_iHideGyroscopeButtons(true);
		,
			controlBar_iHideGyroscopeButtons();
		);
	);
	</action>



  <action name="controlBar_ihideMenuControls">
    set(controlBar_iIsOpened, false);
    set(layer[controlBar_ibtn_hidecontrols].visible, false);
    set(layer[controlBar_ibtn_showcontrols].visible, true);
if (scene.count GT 1,
	set(layer[controlBar_ibtn_next_pano].visible, false);
	set(layer[controlBar_ibtn_prev_pano].visible, false);
);


set(layer[controlBar_ibtn_home].visible, false);
if (device.desktop,
	set(layer[controlBar_ibtn_in].visible, false);
	set(layer[controlBar_ibtn_out].visible, false);
);
if (device.desktop,
	set(layer[controlBar_ibtn_up].visible, false);
	set(layer[controlBar_ibtn_down].visible, false);
);
if (device.desktop,
	set(layer[controlBar_ibtn_left].visible, false);
	set(layer[controlBar_ibtn_right].visible, false);
);
	controlBar_iupdateFullscreenButtons();
	controlBar_iupdateHelpButtons();


	controlBar_iupdateAutorotationButtons();

	controlBar_iupdateSoundButtons();
	controlBar_iupdateGyroscopeButtons();





	set(layer[controlBar_i_menu_bg].width, get(controlBar_ibackgroundwidthwhenclosed));

	set(layer[controlBar_i_menu_bg].visible, true);
  </action>
  <action name="controlBar_ishowMenuControls">
    set(controlBar_iIsOpened, true);
    set(layer[controlBar_ibtn_hidecontrols].visible, true);
    set(layer[controlBar_ibtn_showcontrols].visible, false);
	set(layer[controlBar_i_menu_bg].visible, true);
if (scene.count GT 1,
	set(layer[controlBar_ibtn_next_pano].visible, true);
	set(layer[controlBar_ibtn_prev_pano].visible, true);
);


set(layer[controlBar_ibtn_home].visible, true);
if (device.desktop,
	set(layer[controlBar_ibtn_in].visible, true);
	set(layer[controlBar_ibtn_out].visible, true);
);
if (device.desktop,
	set(layer[controlBar_ibtn_up].visible, true);
	set(layer[controlBar_ibtn_down].visible, true);
);
if (device.desktop,
	set(layer[controlBar_ibtn_left].visible, true);
	set(layer[controlBar_ibtn_right].visible, true);
);
	controlBar_iupdateFullscreenButtons();
	controlBar_iupdateHelpButtons();


	controlBar_iupdateAutorotationButtons();

	controlBar_iupdateSoundButtons();
	controlBar_iupdateGyroscopeButtons();




    set(layer[controlBar_i_menu_bg].width, get(controlBar_ibackgroundwidthwhenopened));
  </action>

  <layer name="controlBar_ihelpScreenBg"
         align="center"
         keep="true"
         onclick="controlBar_icloseHelp();"
         url="%FIRSTXML%/graphics/icontrolbar/help_screen_bg.png"
         visible="false"
         rotate="-90"
         height="50%"
         width="prop"
         zorder="97"
         x="100%" />
  <layer name="controlBar_ihelpScreenFg"
         align="center"
         keep="true"
         onclick="controlBar_icloseHelp();"
         url="%FIRSTXML%/graphics/icontrolbar/help_screen_fg.png"
         height="50%"
         width="prop"
         visible="false"
         rotate="90"
         zorder="98"
         x="-100%"
         displayed="false" />
  <action name="controlBar_idisplayHelp">
  if (device.desktop,
    set(layer[controlBar_ihelpScreenFg].displayed,true);
    set(layer[controlBar_ihelpScreenBg].visible,true);
    set(layer[controlBar_ihelpScreenFg].visible,true);
    tween(layer[controlBar_ihelpScreenFg].rotate,0, 1);
    tween(layer[controlBar_ihelpScreenFg].x,0, 1);
    tween(layer[controlBar_ihelpScreenBg].rotate,0, 1);
    tween(layer[controlBar_ihelpScreenBg].x,0, 1);
    controlBar_iupdateHelpButtons();
  );
  </action>
  <action name="controlBar_icloseHelp">
  if (device.desktop,
    set(layer[controlBar_ihelpScreenFg].displayed,false);
    tween(layer[controlBar_ihelpScreenFg].rotate,  90, 1, easeOutQuad, set(layer[controlBar_ihelpScreenFg].visible,false););
    tween(layer[controlBar_ihelpScreenFg].x, -100%, 1);
    tween(layer[controlBar_ihelpScreenBg].rotate, -90, 1, easeOutQuad, set(layer[controlBar_ihelpScreenBg].visible,false););
    tween(layer[controlBar_ihelpScreenBg].x, 100%, 1);
    controlBar_iupdateHelpButtons();
  );
  </action>
	<action name="controlBar_iHideHelpButtons">
		set(layer[controlBar_ibtn_display_help].visible, false);
		set(layer[controlBar_ibtn_close_help].visible, false);
	</action>
	<action name="controlBar_iShowHelpButtons">
		if (layer[controlBar_ihelpScreenFg].displayed,
			set(layer[controlBar_ibtn_close_help].visible, true);
			set(layer[controlBar_ibtn_display_help].visible, false);
		,
			set(layer[controlBar_ibtn_display_help].visible, true);
			set(layer[controlBar_ibtn_close_help].visible, false);
		);
	</action>
	<action name="controlBar_iupdateHelpButtons">
	if (device.desktop,
		if (controlBar_iIsOpened,
			controlBar_iShowHelpButtons();
		,
			controlBar_iHideHelpButtons();
		);
	,
		controlBar_iHideHelpButtons();
	);
	</action>




  <events name="controlBar_imenufullscreenchangeevent"
          onenterfullscreen="controlBar_iupdateFullscreenButtons();"
          onexitfullscreen="controlBar_iupdateFullscreenButtons();"
          keep="true"/>
	<action name="controlBar_iHideFullscreenButtons">
		set(layer[controlBar_ibtn_openfs].visible , false);
		set(layer[controlBar_ibtn_closefs].visible, false);
	</action>
	<action name="controlBar_iShowFullscreenButtons">
		if (device.fullscreensupport,
			if(tour_fullscreen,
				set(layer[controlBar_ibtn_openfs].visible , false);
				set(layer[controlBar_ibtn_closefs].visible, true);
			,
				set(layer[controlBar_ibtn_openfs].visible ,true);
				set(layer[controlBar_ibtn_closefs].visible,false);
			);
		,
			controlBar_iHideFullscreenButtons();
		);
	</action>
	<action name="controlBar_iupdateFullscreenButtons">
		if (controlBar_iIsOpened,
			controlBar_iShowFullscreenButtons();
		,
			controlBar_iHideFullscreenButtons();
		);
	</action>

	<events name="controlBar_iAutorotationEvents"
		onstartautorotation="controlBar_iupdateAutorotationButtons();"
		onresumeautorotation="controlBar_iupdateAutorotationButtons();"
		onstopautorotation="controlBar_iupdateAutorotationButtons();"
		onpauseautorotation="controlBar_iupdateAutorotationButtons();"
		keep="true"/>
	<action name="controlBar_iHideAutorotationButtons">
		set(layer[controlBar_ibtn_autorotate_off].visible, false);
		set(layer[controlBar_ibtn_autorotate_on].visible , false);
	</action>
	<action name="controlBar_iShowAutorotationButtons">
		if(autorotate.enabled == false,
			set(layer[controlBar_ibtn_autorotate_off].visible, false);
			set(layer[controlBar_ibtn_autorotate_on].visible , true);
		,
			set(layer[controlBar_ibtn_autorotate_off].visible, true);
			set(layer[controlBar_ibtn_autorotate_on].visible , false);
		);
	</action>
	<action name="controlBar_iupdateAutorotationButtons">
		if (controlBar_iIsOpened,
			controlBar_iShowAutorotationButtons();
		,
			controlBar_iHideAutorotationButtons();
		);
	</action>


  <events name="controlBar_iplaystopsoundsevent" playtoursoundsevent="controlBar_iupdateSoundButtons();" stoptoursoundsevent="controlBar_iupdateSoundButtons();" keep="true"/>
	<action name="controlBar_iHideSoundButtons">
		set(layer[controlBar_ibtn_sound_off].visible, false);
		set(layer[controlBar_ibtn_sound_on].visible , false);
	</action>
	<action name="controlBar_iShowSoundButtons">
		if (tour_soundson == false,
			set(layer[controlBar_ibtn_sound_off].visible, false);
			set(layer[controlBar_ibtn_sound_on].visible , true);
		,
			set(layer[controlBar_ibtn_sound_off].visible, true);
			set(layer[controlBar_ibtn_sound_on].visible , false);
		);
	</action>
	<action name="controlBar_iupdateSoundButtons">
		if (controlBar_iIsOpened,
			controlBar_iShowSoundButtons();
		,
			controlBar_iHideSoundButtons();
		);
	</action>


<layer name="controlBar_imenuTooltipStyle"
	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="controlBar_ibuildMenu">
    
    set(controlBar_ibutton_pos, 0);

	set(controlBar_ibackgroundwidthwhenclosed, 40);
    set(layer[controlBar_ibtn_hidecontrols].x, get(controlBar_ibutton_pos));
    set(layer[controlBar_ibtn_showcontrols].x, get(controlBar_ibutton_pos));
    inc(controlBar_ibutton_pos, 45);



      if (device.desktop,
        set(layer[controlBar_ibtn_display_help].x, get(controlBar_ibutton_pos));
        set(layer[controlBar_ibtn_close_help].x  , get(controlBar_ibutton_pos));
        inc(controlBar_ibutton_pos, 45);
      );

      if (device.fullscreensupport,
        set(layer[controlBar_ibtn_openfs].x , get(controlBar_ibutton_pos));
        set(layer[controlBar_ibtn_closefs].x, get(controlBar_ibutton_pos));
        inc(controlBar_ibutton_pos, 45);
      );



      set(layer[controlBar_ibtn_autorotate_on].x , get(controlBar_ibutton_pos));
      set(layer[controlBar_ibtn_autorotate_off].x, get(controlBar_ibutton_pos));
      inc(controlBar_ibutton_pos, 45);


      set(layer[controlBar_ibtn_sound_on].x , get(controlBar_ibutton_pos));
      set(layer[controlBar_ibtn_sound_off].x, get(controlBar_ibutton_pos));
      inc(controlBar_ibutton_pos, 45);





      if(plugin[gyroscope],
        set(controlBar_iDisplayGyroscopeButton, false);
        if (device.tablet, set(controlBar_iDisplayGyroscopeButton, true););
        if (device.mobile, set(controlBar_iDisplayGyroscopeButton, true););
        if(controlBar_iDisplayGyroscopeButton,
          set(layer[controlBar_ibtn_gyroscope_on].x , get(controlBar_ibutton_pos));
          set(layer[controlBar_ibtn_gyroscope_off].x, get(controlBar_ibutton_pos));
          set(layer[controlBar_ibtn_gyroscope_not].x, get(controlBar_ibutton_pos));
          inc(controlBar_ibutton_pos, 45);
        );
      );


        set(layer[controlBar_ibtn_home].x, get(controlBar_ibutton_pos));
        inc(controlBar_ibutton_pos, 45);

      if (device.desktop,
        set(layer[controlBar_ibtn_right].x, get(controlBar_ibutton_pos));
        inc(controlBar_ibutton_pos, 45);
        set(layer[controlBar_ibtn_left].x, get(controlBar_ibutton_pos));
        inc(controlBar_ibutton_pos, 45);
      );

      if (device.desktop,
        set(layer[controlBar_ibtn_down].x, get(controlBar_ibutton_pos));
        inc(controlBar_ibutton_pos, 45);
        set(layer[controlBar_ibtn_up].x, get(controlBar_ibutton_pos));
        inc(controlBar_ibutton_pos, 45);
      );

      if (device.desktop,
        set(layer[controlBar_ibtn_out].x, get(controlBar_ibutton_pos));
        inc(controlBar_ibutton_pos, 45);
        set(layer[controlBar_ibtn_in].x, get(controlBar_ibutton_pos));
        inc(controlBar_ibutton_pos, 45);
      );

    if (scene.count GT 1,
        set(layer[controlBar_ibtn_next_pano].x, get(controlBar_ibutton_pos));
        inc(controlBar_ibutton_pos, 45);
        set(layer[controlBar_ibtn_prev_pano].x, get(controlBar_ibutton_pos));
        inc(controlBar_ibutton_pos, 45);
      );



      dec(controlBar_ibutton_pos, 5);

      set(controlBar_ibackgroundwidthwhenopened, get(controlBar_ibutton_pos));


    
      set(layer[controlBar_i_menu_bg].width, get(controlBar_ibackgroundwidthwhenopened));
	
	
	
    </action>

	<events name="controlBar_iStartTourEvents" onTourStart="controlBar_iCallOnStartTour();" keep="true" />
	
	<action name="controlBar_iCallOnStartTour">
		
		controlBar_ishowMenuControls();
	</action>



<!-- ********** -->
<!-- Header -->
<!-- id : header -->
<!-- ********** -->

  <layer name="header"
         keep="true"
         type="container"
         bgcolor="0x0089ad"
         bgalpha="1"
         align="top"
         x="0"
         y="0"
         zorder="4"
         enabled="false"
         capture="true"
         visible="false"
         height="60"
         width="100%"
         accuracy="1"
         />

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

  <!-- ************* -->
  <!-- Panorama Menu -->
  <!-- ************* -->

<ptplugin name="panoramaMenu" engine="kolorMenu">
	<settings>
		<option name="position" value="topleft" type="string" />
		<option name="orientation" value="horizontal" type="string" />
		<option name="sub_orientation" value="vertical" type="string" />
		<option name="margin_x" value="5" type="int" />
		<option name="margin_y" value="5" type="int" />
		<option name="background_color" value="0089ad" type="string" />
		<option name="background_alpha" value="1" type="float" />
		<option name="item_spacer" value="5" type="int" />
		<option name="border_radius" value="2" type="int" />
		<option name="full_size" value="false" type="bool" />
		<option name="use_out_effect" value="true" type="bool" />
		<option name="item_out_border_radius" value="2" type="int" />
		<option name="item_hover_border_radius" value="2" type="int" />
		<option name="item_out_border_width" value="0" type="int" />
		<option name="item_hover_border_width" value="0" type="int" />
		<option name="item_out_bg_color" value="0089ad" type="string" />
		<option name="item_out_bg_alpha" value="1" type="float" />
		<option name="item_out_font_color" value="ffffff" type="string" />
		<option name="item_out_font_family" value="Arial" type="string" />
		<option name="item_out_font_size" value="14" type="int" />
		<option name="item_out_font_weight" value="normal" type="string" />
		<option name="item_out_font_style" value="normal" type="string" />
		<option name="item_out_font_decoration" value="normal" type="string" />
		<option name="use_hover_effect" value="true" type="bool" />
		<option name="item_hover_bg_color" value="00a5d0" type="string" />
		<option name="item_hover_bg_alpha" value="1" type="float" />
		<option name="item_hover_font_color" value="ffffff" type="string" />
		<option name="item_hover_font_family" value="Arial" type="string" />
		<option name="item_hover_font_size" value="14" type="int" />
		<option name="item_hover_font_weight" value="normal" type="string" />
		<option name="item_hover_font_style" value="normal" type="string" />
		<option name="item_hover_font_decoration" value="normal" type="string" />
		<option name="padding_main" value="10" type="int" />
		<option name="padding_sub" value="10" type="int" />
		<option name="item_selected_color" value="ff8f11" type="string" />
		<option name="item_selected_alpha" value="1" type="float" />
		
		<option name="item_selected_hover_color" value="ffa744" type="string" />
		<option name="item_selected_hover_alpha" value="1" type="float" />
		
		<option name="open_callback" value="invokeKrFunction('changeSelectedItem_panoramaMenu');" type="string" />
		<option name="text_align" value="bottom" type="string" />
		<option name="item_thumb_max_width" value="150" type="int" />
		<option name="item_thumb_max_height" value="75" type="int" />
		
		<option name="zorder" value="5" type="int" />
		<option name="use_i18n" value="true" type="bool" />
	</settings>
	<internaldata>
				<group name="group_1"
						titleID="panogroup24_title"
						thumbnail=""
						subMenu="true"
						cssClass="panogroup24"> 

				
				
						<item name="group_1_item_1"
							action="invokeKrFunction('mainloadscene', 'pano63')"
								titleID="pano63_title"
								thumbnail="2016ThreeBearsResortAmenitiesdata/front_exterior_63/thumbnail.jpg"
							cssClass="pano63">
						
								<option name="item_out_bg_color" value="0089ad" type="string" />
								<option name="item_out_bg_alpha" value="1" type="float" />
								<option name="item_hover_bg_color" value="00a5d0" type="string" />
								<option name="item_hover_bg_alpha" value="1" type="float" />
						
						</item>
						<item name="group_1_item_2"
							action="invokeKrFunction('mainloadscene', 'pano60')"
								titleID="pano60_title"
								thumbnail="2016ThreeBearsResortAmenitiesdata/front_entrance_60/thumbnail.jpg"
							cssClass="pano60">
						
								<option name="item_out_bg_color" value="0089ad" type="string" />
								<option name="item_out_bg_alpha" value="1" type="float" />
								<option name="item_hover_bg_color" value="00a5d0" type="string" />
								<option name="item_hover_bg_alpha" value="1" type="float" />
						
						</item>
						<item name="group_1_item_3"
							action="invokeKrFunction('mainloadscene', 'pano13')"
								titleID="pano13_title"
								thumbnail="2016ThreeBearsResortAmenitiesdata/frontexterior_img_01_13/thumbnail.jpg"
							cssClass="pano13">
						
								<option name="item_out_bg_color" value="0089ad" type="string" />
								<option name="item_out_bg_alpha" value="1" type="float" />
								<option name="item_hover_bg_color" value="00a5d0" type="string" />
								<option name="item_hover_bg_alpha" value="1" type="float" />
						
						</item>
					
						<option name="background_color" value="0089ad" type="string" />
						<option name="background_alpha" value="1" type="float" />
				
				</group>
				<group name="group_2"
						titleID="panogroup186_title"
						thumbnail=""
						subMenu="true"
						cssClass="panogroup186"> 

				
				
						<item name="group_2_item_1"
							action="invokeKrFunction('mainloadscene', 'pano121')"
								titleID="pano121_title"
								thumbnail="2016ThreeBearsResortAmenitiesdata/lobby_img_0043_panor_121/thumbnail.jpg"
							cssClass="pano121">
						
								<option name="item_out_bg_color" value="0089ad" type="string" />
								<option name="item_out_bg_alpha" value="1" type="float" />
								<option name="item_hover_bg_color" value="00a5d0" type="string" />
								<option name="item_hover_bg_alpha" value="1" type="float" />
						
						</item>
						<item name="group_2_item_2"
							action="invokeKrFunction('mainloadscene', 'pano183')"
								titleID="pano183_title"
								thumbnail="2016ThreeBearsResortAmenitiesdata/restaurant_1_183/thumbnail.jpg"
							cssClass="pano183">
						
								<option name="item_out_bg_color" value="0089ad" type="string" />
								<option name="item_out_bg_alpha" value="1" type="float" />
								<option name="item_hover_bg_color" value="00a5d0" type="string" />
								<option name="item_hover_bg_alpha" value="1" type="float" />
						
						</item>
						<item name="group_2_item_3"
							action="invokeKrFunction('mainloadscene', 'pano184')"
								titleID="pano184_title"
								thumbnail="2016ThreeBearsResortAmenitiesdata/restaurant_2_184/thumbnail.jpg"
							cssClass="pano184">
						
								<option name="item_out_bg_color" value="0089ad" type="string" />
								<option name="item_out_bg_alpha" value="1" type="float" />
								<option name="item_hover_bg_color" value="00a5d0" type="string" />
								<option name="item_hover_bg_alpha" value="1" type="float" />
						
						</item>
						<item name="group_2_item_4"
							action="invokeKrFunction('mainloadscene', 'pano12')"
								titleID="pano12_title"
								thumbnail="2016ThreeBearsResortAmenitiesdata/exerciseroom_img_994_12/thumbnail.jpg"
							cssClass="pano12">
						
								<option name="item_out_bg_color" value="0089ad" type="string" />
								<option name="item_out_bg_alpha" value="1" type="float" />
								<option name="item_hover_bg_color" value="00a5d0" type="string" />
								<option name="item_hover_bg_alpha" value="1" type="float" />
						
						</item>
						<item name="group_2_item_5"
							action="invokeKrFunction('mainloadscene', 'pano9')"
								titleID="pano9_title"
								thumbnail="2016ThreeBearsResortAmenitiesdata/_2ndfloorwalkway_img__9/thumbnail.jpg"
							cssClass="pano9">
						
								<option name="item_out_bg_color" value="0089ad" type="string" />
								<option name="item_out_bg_alpha" value="1" type="float" />
								<option name="item_hover_bg_color" value="00a5d0" type="string" />
								<option name="item_hover_bg_alpha" value="1" type="float" />
						
						</item>
						<item name="group_2_item_6"
							action="invokeKrFunction('mainloadscene', 'pano10')"
								titleID="pano10_title"
								thumbnail="2016ThreeBearsResortAmenitiesdata/arcade1_img_9902_pan_10/thumbnail.jpg"
							cssClass="pano10">
						
								<option name="item_out_bg_color" value="0089ad" type="string" />
								<option name="item_out_bg_alpha" value="1" type="float" />
								<option name="item_hover_bg_color" value="00a5d0" type="string" />
								<option name="item_hover_bg_alpha" value="1" type="float" />
						
						</item>
						<item name="group_2_item_7"
							action="invokeKrFunction('mainloadscene', 'pano11')"
								titleID="pano11_title"
								thumbnail="2016ThreeBearsResortAmenitiesdata/arcade2_img_9931_pan_11/thumbnail.jpg"
							cssClass="pano11">
						
								<option name="item_out_bg_color" value="0089ad" type="string" />
								<option name="item_out_bg_alpha" value="1" type="float" />
								<option name="item_hover_bg_color" value="00a5d0" type="string" />
								<option name="item_hover_bg_alpha" value="1" type="float" />
						
						</item>
						<item name="group_2_item_8"
							action="invokeKrFunction('mainloadscene', 'pano119')"
								titleID="pano119_title"
								thumbnail="2016ThreeBearsResortAmenitiesdata/img_1679_panorama_wc_119/thumbnail.jpg"
							cssClass="pano119">
						
								<option name="item_out_bg_color" value="0089ad" type="string" />
								<option name="item_out_bg_alpha" value="1" type="float" />
								<option name="item_hover_bg_color" value="00a5d0" type="string" />
								<option name="item_hover_bg_alpha" value="1" type="float" />
						
						</item>
						<item name="group_2_item_9"
							action="invokeKrFunction('mainloadscene', 'pano120')"
								titleID="pano120_title"
								thumbnail="2016ThreeBearsResortAmenitiesdata/img_1715_panorama_wc_120/thumbnail.jpg"
							cssClass="pano120">
						
								<option name="item_out_bg_color" value="0089ad" type="string" />
								<option name="item_out_bg_alpha" value="1" type="float" />
								<option name="item_hover_bg_color" value="00a5d0" type="string" />
								<option name="item_hover_bg_alpha" value="1" type="float" />
						
						</item>
						<item name="group_2_item_10"
							action="invokeKrFunction('mainloadscene', 'pano53')"
								titleID="pano53_title"
								thumbnail="2016ThreeBearsResortAmenitiesdata/family_activity_room_53/thumbnail.jpg"
							cssClass="pano53">
						
								<option name="item_out_bg_color" value="0089ad" type="string" />
								<option name="item_out_bg_alpha" value="1" type="float" />
								<option name="item_hover_bg_color" value="00a5d0" type="string" />
								<option name="item_hover_bg_alpha" value="1" type="float" />
						
						</item>
					
						<option name="background_color" value="0089ad" type="string" />
						<option name="background_alpha" value="1" type="float" />
				
				</group>
	</internaldata>
</ptplugin>

<action name="kolorMenuJsReady_panoramaMenu">
	set(ptplugin[panoramaMenu].jsready, true);
</action>

<action name="showKolorMenu_panoramaMenu">
	
	ifnot(ptplugin[panoramaMenu].isOpen,
		stopdelayedcall(delay_panoramaMenu);
		set(ptplugin[panoramaMenu].isOpen, true);
		set(ptplugin[panoramaMenu].displayed, true);
		js(openKolorMenu(panoramaMenu));
	,
		if(ptplugin[panoramaMenu].jsready,
			stopdelayedcall(delay_panoramaMenu);
			set(ptplugin[panoramaMenu].displayed, true);
			js(invokePluginFunction(panoramaMenu, showKolorMenu));
		,
			delayedcall(delay_panoramaMenu, 0.1, showKolorMenu_panoramaMenu(););
		);
	);
</action>

<action name="hideKolorMenu_panoramaMenu">
	if(ptplugin[panoramaMenu].jsready,
		stopdelayedcall(delay_panoramaMenu);
		set(ptplugin[panoramaMenu].displayed, false);
		js(invokePluginFunction(panoramaMenu, hideKolorMenu));
	,
		delayedcall(delay_panoramaMenu, 0.1, hideKolorMenu_panoramaMenu(););
	);
</action>

<action name="changeSelectedItem_panoramaMenu">
	js(invokePluginFunction(panoramaMenu, changeSelectedItem, get(xml.scene)));
</action>

<action name="changeLanguage_panoramaMenu">
	if(ptplugin[panoramaMenu].jsready,
		stopdelayedcall(delay_panoramaMenu);
		js(invokePluginFunction(panoramaMenu, changeLanguage));
	,
		delayedcall(delay_panoramaMenu, 0.1, changeLanguage_panoramaMenu(););
	);
</action>


<events name="kolorMenuEvents_panoramaMenu" 
	keep="true"
	
	
	onTourStart="showKolorMenu_panoramaMenu();"
	onnewpano="changeSelectedItem_panoramaMenu();"
	changetourlanguage="changeLanguage_panoramaMenu"
/>

<!-- ********** -->
<!-- Gallery -->
<!-- id : gallery -->
<!-- ********** -->

<ptplugin name="gallery" engine="kolorBox">
	<settings>
		<option name="position" value="center" type="string" />
		<option name="margin_x" value="0" type="int" />
		<option name="margin_y" value="0" type="int" />
		<option name="external_padding" value="15" type="int" />
		<option name="draggable_box" value="false" type="bool" />
		<option name="slideshow_autoplay" value="false" type="bool" />
		<option name="slideshow" value="5000" type="int" />
		<option name="container_auto_size" value="true" type="bool" />
		<option name="container_width" value="100" type="int" />
		<option name="container_width_unit" value="percent" type="string" />
		<option name="container_height" value="100" type="int" />
		<option name="container_height_unit" value="percent" type="string" />
		<option name="container_color" value="0089ad" type="string" />
		<option name="container_alpha" value="1" type="float" />
		<option name="container_topleft_border_radius" value="15" type="int" />
		<option name="container_topright_border_radius" value="15" type="int" />
		<option name="container_bottomleft_border_radius" value="15" type="int" />
		<option name="container_bottomright_border_radius" value="15" type="int" />
		<option name="container_border_width" value="2" type="int" />
		<option name="container_border_color" value="ff8f11" type="string" />
		<option name="container_border_alpha" value="1" 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="item_border_width" value="2" type="int" />
		<option name="item_border_color" value="ffffff" type="string" />
		<option name="item_border_alpha" value="1" type="float" />
		
		<option name="title_displayed" value="false" type="bool" />
		
		<option name="caption_displayed" value="false" type="bool" />
		
		<option name="play_displayed" value="true" type="bool" />
		<option name="play_position" value="bottomleft" type="string" />
		<option name="play_text" value="galleryplay_text" type="string" />




		<option name="navigation_displayed" value="true" type="bool" />
		<option name="navigation_position" value="bottom" type="string" />
		<option name="counter_color" value="666666" type="string" />
		<option name="navprev_text" value="gallerynavprev_text" type="string" />
		<option name="navnext_text" value="gallerynavnext_text" type="string" />




		<option name="navigation_arrows" value="true" type="bool" />




		<option name="fullscreen_displayed" value="false" type="bool" />
		<option name="fullscreen_position" value="topleft" type="string" />
		<option name="fullscreen_text" value="galleryfullscreen_text" type="string" />




		<option name="close_displayed" value="true" type="bool" />
		<option name="close_position" value="topright" type="string" />
		<option name="close_text" value="galleryclose_text" type="string" />

		<option name="close_callback" value="invokeKrFunction('closeKolorBoxCallback_gallery')" type="string" />
		<option name="zorder" value="6" type="int" />
		<option name="use_i18n" value="true" type="bool" />
	</settings>
	<internaldata>
		<item name="item_1" title="gallerypicture_title0" caption="gallerypicture_caption0" value="2016ThreeBearsResortAmenitiesdata/graphics/gallery/_00-img_2498.jpg"/>
		<item name="item_2" title="gallerypicture_title1" caption="gallerypicture_caption1" value="2016ThreeBearsResortAmenitiesdata/graphics/gallery/"/>
		<item name="item_3" title="gallerypicture_title2" caption="gallerypicture_caption2" value="2016ThreeBearsResortAmenitiesdata/graphics/gallery/img_2574_-_copy.jpg"/>
		<item name="item_4" title="gallerypicture_title3" caption="gallerypicture_caption3" value="2016ThreeBearsResortAmenitiesdata/graphics/gallery/"/>
		<item name="item_5" title="gallerypicture_title4" caption="gallerypicture_caption4" value="2016ThreeBearsResortAmenitiesdata/graphics/gallery/"/>
		<item name="item_6" title="gallerypicture_title5" caption="gallerypicture_caption5" value="2016ThreeBearsResortAmenitiesdata/graphics/gallery/"/>
		<item name="item_7" title="gallerypicture_title6" caption="gallerypicture_caption6" value="2016ThreeBearsResortAmenitiesdata/graphics/gallery/"/>
		<item name="item_8" title="gallerypicture_title7" caption="gallerypicture_caption7" value="2016ThreeBearsResortAmenitiesdata/graphics/gallery/"/>
		<item name="item_9" title="gallerypicture_title8" caption="gallerypicture_caption8" value="2016ThreeBearsResortAmenitiesdata/graphics/gallery/img_2289_-_copy.jpg"/>
		<item name="item_10" title="gallerypicture_title9" caption="gallerypicture_caption9" value="2016ThreeBearsResortAmenitiesdata/graphics/gallery/"/>
	</internaldata>
</ptplugin>

<action name="kolorBoxJsReady_gallery">
	set(ptplugin[gallery].jsready, true);
</action>

<action name="showGallery_gallery">
	ifnot(ptplugin[gallery].isOpen,
		set(ptplugin[gallery].isOpen, true);
		set(ptplugin[gallery].doNotDeleteMe, false);
		set(gallery_boxurl, %1);
		pauseautorotation(forceplugin);

		js(invokePluginFunction(gallery, openKolorBox, %1));
		events.dispatch(onremovedisplayedobject);
	,
		if(%1 !== null AND %1 != gallery_boxurl,
			closeKolorBox_gallery();
			delayedcall(0.3,showGallery_gallery(%1););
		);
	);
</action>

<action name="toggleGallery_gallery">
	js(invokePluginFunction(gallery, toggleKolorBox, %1));
</action>


<action name="closeKolorBox_gallery">
	js(invokePluginFunction(gallery, closeKolorBox));
</action>

<action name="closeKolorBoxCallback_gallery">
	resumeautorotation(forceplugin);

	set(ptplugin[gallery].isOpen, false);
</action>

<action name="changeLanguage_gallery">
	if(ptplugin[gallery].jsready,
		js(invokePluginFunction(gallery, changeLanguage));
	,
		delayedcall(delay_gallery, 0.1, changeLanguage_gallery(););
	);
</action>

<events name="kolorBoxEvents_gallery" 
	keep="true"
	changetourlanguage="changeLanguage_gallery();"
	/>

<!-- ********** -->
<!-- Colored Area -->
<!-- id : coloredarea -->
<!-- ********** -->

  <layer name="coloredarea"
         keep="true"
         type="container"
         align="top"
         x="0"
         y="60"
         zorder="7"
         height="10"
         width="100%"
         accuracy="1"
         visible="false"
         bgcolor="0xff8f11"
         bgalpha="1"
         />

  <events name="coloredareaevents"
    onTourStart="showcoloredarea();"
    hidetourcontrols="hidecoloredarea();"
    showtourcontrols="showcoloredarea();"
    keep="true"/>

  <action name="hidecoloredarea">
    set(layer[coloredarea].visible, false);
  </action>
  <action name="showcoloredarea">
    set(layer[coloredarea].visible, true);
  </action>


<!-- ********** -->
<!-- Logo -->
<!-- id : logo -->
<!-- ********** -->

  <layer align="top"
         x="0"
         y="0"
         zorder="8"
         name="logo"
         keep="true"
         visible="false"
         capture="false"

			tooltip="logotooltipText"
			onhover="showTooltip('plugin');"
			onout="hideTooltip();"
         url="%FIRSTXML%/graphics/logo/threebearslogo.png" 
         onclick="openurl(http://www.threebearslodgewarrens.com/,_blank);
"

         height="103"
         width="200"

         />

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




<!-- ********** -->
<!-- Panorama Combobox -->
<!-- id : panoramacombobox -->
<!-- ********** -->

<events name="panoramacomboboxStartTourEvents" onTourStart="set(layer[panoramacombobox].isStarted, true);if(layer[panoramacombobox].isLoaded,panoramacomboboxShow(););" keep="true" />


  <layer name="panoramacombobox"
         url="%FIRSTXML%/graphics/combobox.js"
         keep="true"
         visible="false"
         zorder="9"
         align="topright"
         x="5" y="10"
         rowcount="10"
         onloaded="panoramacomboboxLoaded();"
         isStarted="false"
         isLoaded="false"
         itemcount="0"
         itemfontsize.normal="14"
         itempadding.normal="8"
         itemfontsize.mobile="11"
         itempadding.mobile="5"
         cbdesignscale.mobile="1"
         />

  <action name="panoramacomboboxLoaded">
    
    layer[panoramacombobox].removeAll();
    set(layer[panoramacombobox].itemcount, 0);
    
    panoramacomboboxAddItem(pano63_title, pano63, pano63, false);
    panoramacomboboxAddItem(pano60_title, pano60, pano60, false);
    panoramacomboboxAddItem(pano13_title, pano13, pano13, false);
    panoramacomboboxAddItem(pano121_title, pano121, pano121, false);
    panoramacomboboxAddItem(pano183_title, pano183, pano183, false);
    panoramacomboboxAddItem(pano184_title, pano184, pano184, false);
    panoramacomboboxAddItem(pano12_title, pano12, pano12, false);
    panoramacomboboxAddItem(pano9_title, pano9, pano9, false);
    panoramacomboboxAddItem(pano10_title, pano10, pano10, false);
    panoramacomboboxAddItem(pano11_title, pano11, pano11, false);
    panoramacomboboxAddItem(pano119_title, pano119, pano119, false);
    panoramacomboboxAddItem(pano120_title, pano120, pano120, false);
    panoramacomboboxAddItem(pano53_title, pano53, pano53, false);
    set(layer[panoramacombobox].isLoaded, true);
    
    if(layer[panoramacombobox].isStarted,
      panoramacomboboxShow();
    );
  </action>


  <action name="panoramacomboboxAddItem">
    getmessage(caption, %1);
    
    indexoftxt(found, get(caption), '&amp;');
    if(found GE 0,
      subtxt(part1, get(caption), 0, get(found));
      add(found, 1);
      subtxt(part2, get(caption), get(found), get(caption.length));
      txtadd(caption, get(part1), '&amp;', get(part2));
    );
    if(%4,
      txtadd(title, "&#x00A0;&#x00A0;&#x00A0;", get(caption));
    ,
      set(title, get(caption));
    );
    layer[panoramacombobox].addIdItem(%2, get(title), mainloadscene(%3));
    inc(layer[panoramacombobox].itemcount);
  </action>

  <action name="panoramacomboboxUpdateLanguage">
    layer[panoramacombobox].closeList();
    layer[panoramacombobox].removeAll();
    set(layer[panoramacombobox].itemcount, 0);

    panoramacomboboxAddItem(pano63_title, pano63, pano63, false);
    panoramacomboboxAddItem(pano60_title, pano60, pano60, false);
    panoramacomboboxAddItem(pano13_title, pano13, pano13, false);
    panoramacomboboxAddItem(pano121_title, pano121, pano121, false);
    panoramacomboboxAddItem(pano183_title, pano183, pano183, false);
    panoramacomboboxAddItem(pano184_title, pano184, pano184, false);
    panoramacomboboxAddItem(pano12_title, pano12, pano12, false);
    panoramacomboboxAddItem(pano9_title, pano9, pano9, false);
    panoramacomboboxAddItem(pano10_title, pano10, pano10, false);
    panoramacomboboxAddItem(pano11_title, pano11, pano11, false);
    panoramacomboboxAddItem(pano119_title, pano119, pano119, false);
    panoramacomboboxAddItem(pano120_title, pano120, pano120, false);
    panoramacomboboxAddItem(pano53_title, pano53, pano53, false);

    panoramacomboboxUpdateList();
  </action>

  <events name="panoramacomboboxEvents"
          hidetourcontrols="panoramacomboboxHide();"
          showtourcontrols="panoramacomboboxShow();"
          onnewpano="panoramacomboboxOnPanorama();"
          changetourlanguage="panoramacomboboxUpdateLanguage();"
          keep="true"/>

  <action name="panoramacomboboxHide">
    set(layer[panoramacombobox].visible, false);
  </action>
  <action name="panoramacomboboxShow">
  if(layer[panoramacombobox].isLoaded,
    if (layer[panoramacombobox].itemcount GT 0,
      set(layer[panoramacombobox].visible, true);
    ,
      set(layer[panoramacombobox].visible, false);
    );
  ,
    set(layer[panoramacombobox].visible, false);
  );
  </action>

  <action name="panoramacomboboxOnPanorama">
    if(layer[panoramacombobox].isLoaded,
      panoramacomboboxUpdateList();
    ,
      delayedcall(0.2, panoramacomboboxOnPanorama);
    );
  </action>


  <action name="panoramacomboboxUpdateList">
    set(itemtoselect, get(scene[get(xml.scene)].name));
    layer[panoramacombobox].selectIdItem(get(itemtoselect));
  </action>


<!-- ********** -->
<!-- Analytics -->
<!-- id : analytics -->
<!-- ********** -->

<ptplugin name="analytics" engine="kolorAnalytics">
	<settings>
		<option name="source" value="google" type="string" />
		<option name="tracking_id" value="UA-41542029-1" type="string" />
		<option name="force_ssl" value="true" type="bool" />
		<option name="force_test" value="false" type="bool" />
		<option name="start_page" value="2016ThreeBearsResortAmenities" type="string" />
		<option name="start_title" value="Three Bears Lodge-Warrens WI" type="string" />
		<option name="start_lang" value="en" type="string" />
		<option name="use_i18n" value="true" type="bool" />
	</settings>
</ptplugin>

<action name="kolorAnalyticsJsReady_analytics">
	set(ptplugin[analytics].jsready, true);
</action>

<action name="activate_analytics">
	if(ptplugin[analytics].jsready,
		stopdelayedcall(delay_analytics_active);
		js(invokePluginFunction(analytics, toggleDeactivation, false));
	,
		delayedcall(delay_analytics_active, 0.1, activate_analytics(););
	);
</action>

<action name="deactivate_analytics">
	if(ptplugin[analytics].jsready,
		stopdelayedcall(delay_analytics_active);
		js(invokePluginFunction(analytics, toggleDeactivation, true));
	,
		delayedcall(delay_analytics_active, 0.1, deactivate_analytics(););
	);
</action>

<action name="sendPage_analytics">
	if(ptplugin[analytics].jsready,
		stopdelayedcall(delay_analytics_page);
		js(invokePluginFunction(analytics, sendPageview, %1, %2));
	,
		delayedcall(delay_analytics_page,0.5,sendPage_analytics(%1,%2));
	);
</action>

<!-- 
sendEvent_analytics action :
* param1 : category
* param2 : action
* param3 : label
* param4 : number value
-->
<action name="sendEvent_analytics">
	if(ptplugin[analytics].jsready,
		stopdelayedcall(delay_analytics_event);
		js(invokePluginFunction(analytics, sendEvent, %1, %2, %3, %4));
	,
		delayedcall(delay_analytics_event,0.5,sendEvent_analytics(%1,%2,%3,%4));
	);
</action>

<action name="changeLanguage_analytics">
	if(ptplugin[analytics].jsready,
		stopdelayedcall(delay_analytics_lang);
		js(invokePluginFunction(analytics, changeLanguage));
	,
		delayedcall(delay_analytics_lang,0.1,changeLanguage_analytics());
	);
</action>

<events name="kolorAnalyticsEvents_analytics" 
	keep="true"
	onTourStart="sendEvent_analytics('panotour','tour start', 'Three Bears Lodge-Warrens WI');"
	onnewpano="sendPage_analytics(get(scene[get(xml.scene)].name), get(scene[get(xml.scene)].titleid));"
	changetourlanguage="changeLanguage_analytics();"
	/>

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

<action name="viewControlZoomIn">
	if(%1,
		if(%2,
			if(%2 LT view.fovmin,
				zoomto(get(view.fovmin));
			,
				if(%2 LT view.fov,
					zoomto(%2);
				);
			);
		,
			set(fov_moveforce, -1);
			delayedcall(0.1, viewControlZoomStop());
		);
	,
		set(fov_moveforce, -1);
	);
</action>
<action name="viewControlZoomOut">
	if(%1,
		if(%2,
			if(%2 GT view.fovmax,
				zoomto(get(view.fovmax));
			,
				if(%2 GT view.fov,
					zoomto(%2);
				);
			);
		,
			set(fov_moveforce, +1);
			delayedcall(0.1, viewControlZoomStop());
		);
	,
		set(fov_moveforce, +1);
	);
</action>
<action name="viewControlZoomStop">
	set(fov_moveforce, 0);
</action>

  <!-- Sounds Management -->
  <plugin name="soundinterface"
          preload="true"
          url="%FIRSTXML%/graphics/soundinterface.js"
          rootpath="%$videos_sounds_path%/sounds"
          backgroundsound=""
          backgroundsoundloops="0"
          bgsound="false"
          bgsoundpaused="false"
          bgsoundloopended="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);
      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);
            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].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].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(killBgSoundOnResume, true);
    set(forceBgSoundOnResume, true);
    if(layer[displayedStandardVideo],
    if(layer[displayedStandardVideo].pausebgsound AND tour_current_played_video,
      set(killBgSoundOnResume, false);
      set(forceBgSoundOnResume, false);
    ););
    if(layer[webvideodisplay_player],
    if(layer[webvideodisplay_player].pausebgsound AND tour_current_played_web_video,
      set(killBgSoundOnResume, false);
      set(forceBgSoundOnResume, false);
    ););
    if(tour_current_played_sound_pausesound AND tour_current_played_sound,
      set(killBgSoundOnResume, false);
    );
    ifnot(plugin[soundinterface].backgroundsound AND scene[get(xml.scene)].backgroundsound,
      set(killBgSoundOnResume, false);
    );
    if(videospots_playing GT 0,
      set(killBgSoundOnResume, false);
      set(forceBgSoundOnResume, false);
    );
    if(killBgSoundOnResume,
      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);
            );
          ,
            set(plugin[soundinterface].bgsound, true);
            set(plugin[soundinterface].bgsoundpaused, false);
            set(plugin[soundinterface].bgsoundloopended, 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("abrighterday.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));
          );
        );
      );
    );
  </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,
          div(volume, tour_soundsvolume, 100);
          if(device.flash,
            set(layer[displayedStandardVideo].volume, get(volume));
          ,
            ifnot(device.ios,
              js(kpanotour.Sounds.startVideosSounds(get(volume)));
            );
          );
        ,
          if(device.flash,
            set(layer[displayedStandardVideo].volume, 0);
          ,
            ifnot(device.ios,
              js(kpanotour.Sounds.stopVideosSounds());
            );
          );
        );
      );
    );
  </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,
        set(layer[displayedStandardVideo].volume, 0);
      ,
        ifnot(device.ios,
          js(kpanotour.Sounds.stopVideosSounds());
        );
      );
    );
  </action>

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


  <!-- FLOORPLAN -->
  <action name="hideFloorplan">set(tour_displayfloorplan, false);events.dispatch(onhidetourfloorplan);</action>
  <action name="showFloorplan">set(tour_displayfloorplan, true); events.dispatch(onshowtourfloorplan);</action>


  <!-- Hide / Show Controls -->
  <action name="hideTourControls">set(tour_displaycontrols, false);events.dispatch(hidetourcontrols);</action>
  <action name="showTourControls">set(tour_displaycontrols, true); events.dispatch(showtourcontrols);</action>


  <!-- Fullscreen Management -->
  <action name="exitFullScreen" devices="fullscreensupport">set(tour_fullscreen,false);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>

</krpano>