<krpano>
	<!-- krpano 1.16.5 - Default Virtual Tour Skin -->

	<!-- Global Skin settings (can be overridden in the 'outer' xml) -->
	<skin_settings bingmaps="false"
	               bingmaps_key=""
	               bingmaps_zoombuttons="false"
	               gyro="true"
	               thumbs_width="120" thumbs_height="80" thumbs_padding="10" thumbs_crop="0|40|240|160"
	               thumbs_opened="false"
	               thumbs_text="false"
	               thumbs_dragging="false"
	               thumbs_onhoverscrolling="false"
	               thumbs_scrollbuttons="false"
	               thumbs_scrollindicator="false"
	               tooltips_thumbs="false"
	               tooltips_hotspots="false"
	               tooltips_mapspots="false"
	               controlbar_offset="20"
	               />


	<!-- Skin Styles -->

	<!-- skin_base - the base skin image -->
	<style name="skin_base" url="vtourskin.png" />

	<!-- skin_glow - button glowing, if ondown/onup events were needed, then ondown2/onup2 need to be used instead when using this style -->
	<style name="skin_glow"
	       ondown="copy(skin_lockglow,name); skin_buttonglow(get(name)); if(ondown2, ondown2() );"
	       onover="if(skin_lockglow === null, copy(skin_lockglow,name); skin_buttonglow(get(name),0.3) ); "
	       onout="if(skin_lockglow === name, ifnot(pressed, skin_buttonglow(null);delete(skin_lockglow); ));"
	       onup="if(hovering, skin_buttonglow(get(name),0.3), skin_buttonglow(null);delete(skin_lockglow); ); if(onup2, onup2() );"
	       />

	<!-- skin_thumbtext_style - style/textfield for the (optional, skin_settings.thumbs_text) thumbnails texts -->
	<style name="skin_thumbtext_style" url="%SWFPATH%/plugins/textfield.swf" align="bottom" width="100%" autoheight="true" y="5" enabled="false" background="false" border="false" css="text-align:center; color:#FFFFFF; font-family:Arial; font-weight:bold; font-size:10px;" textshadow="1" />

	<!-- tooltips textstyle -->
	<textstyle name="SKIN_TOOLTIPS" font="Arial" fontsize="16" bold="true" italic="false" background="false" border="false" textcolor="0xFFFFFF" effect="dropshadow(1,45,0x000000,4,1);" fadeintime="0.1" fadetime="0.05" />


	<!-- Skin Layout -->
	<layer name="skin_control_bar" keep="true" type="container" bgcolor="0x000000" bgalpha="0.5" align="leftbottom" width="100%" height="40" x="0" y="20" y_opened="20" y_closed="-42" zorder="3">
		<layer name="skin_btmborder"  style="skin_base"           crop="2|52|60|12"   align="bottomleft" edge="topleft" width="100%" height="12" x="0" y="0" enabled="false" />
		<layer name="skin_btn_lt"     style="skin_base|skin_glow" crop="0|192|64|64"  align="bottom"      x="-100" y="4"   scale="0.5" ondown2="set(hlookat_moveforce,-1);" onup2="set(hlookat_moveforce,0);" />
		<layer name="skin_btn_rt"     style="skin_base|skin_glow" crop="64|192|64|64" align="bottom"      x="-60"  y="4"   scale="0.5" ondown2="set(hlookat_moveforce,+1);" onup2="set(hlookat_moveforce,0);" />
		<layer name="skin_btn_up"     style="skin_base|skin_glow" crop="0|256|64|64"  align="bottom"      x="-20"  y="4"   scale="0.5" ondown2="set(vlookat_moveforce,-1);" onup2="set(vlookat_moveforce,0);" />
		<layer name="skin_btn_dn"     style="skin_base|skin_glow" crop="64|256|64|64" align="bottom"      x="+20"  y="4"   scale="0.5" ondown2="set(vlookat_moveforce,+1);" onup2="set(vlookat_moveforce,0);" />
		<layer name="skin_btn_in"     style="skin_base|skin_glow" crop="0|320|64|64"  align="bottom"      x="+60"  y="4"   scale="0.5" ondown2="set(fov_moveforce,-1);"     onup2="set(fov_moveforce,0);" />
		<layer name="skin_btn_ou"     style="skin_base|skin_glow" crop="64|320|64|64" align="bottom"      x="+100" y="4"   scale="0.5" ondown2="set(fov_moveforce,+1);"     onup2="set(fov_moveforce,0);" />
		<layer name="skin_btn_gyro"   style="skin_base|skin_glow" crop="0|384|64|64"  align="bottom"      x="140"  y="4"   scale="0.5" ondown2="skin_showmap(false);" onclick="switch(plugin[skin_gyro].enabled);" visible="false" devices="html5" />
		<layer name="skin_btn_fs"     style="skin_base|skin_glow" crop="0|576|64|64"  align="bottom"      x="140"  y="4"   scale="0.5" onclick="switch(fullscreen);" devices="fullscreensupport" />
		<layer name="skin_btn_hide"   style="skin_base|skin_glow" crop="0|448|64|64"  align="right"       x="50"   y="0"   scale="0.5" onclick="skin_hideskin()" />
		<layer name="skin_btn_show"   style="skin_base|skin_glow" crop="64|448|64|64" align="right"       x="5"    y="-36" scale="0.5" alpha="0" visible="false" onclick="skin_showskin()" />
	</layer>
	<layer name="skin_buttonglow"   keep="true" style="skin_base" crop="64|384|64|64" align="center" x="0" y="1" alpha="0.0" visible="false" enabled="false" />
	<layer name="skin_thumbborder"  keep="true" url="vtourskin_thumbborder.png" visible="false" enabled="false" align="lefttop" scale="0.5" ox="-2" oy="-2" />
	<layer name="skin_logo"         keep="true" url="" align="righttop" x="5" y="5" capture="false" accuracy="1" state="small" onclick="if(state == 'small', skin_openlogo(); , skin_closelogo('now'); opened_onclick(); );" />

	<plugin name="skin_gyro"        keep="true" url="" html5_url="%SWFPATH%/plugins/gyro.js" devices="html5+!firefox+!android" enabled="false" camroll="true" friction="0" velastic="0" onavailable="if(device.fullscreensupport, if(device.mobile,add(layer[skin_btn_gyro].x,40),add(layer[skin_btn_gyro].x,20));); set(layer[skin_btn_gyro].visible,true);" />


	<!-- Skin Events -->

	<events name="skin_events" keep="true"
	        onxmlcomplete="set(events[skin_events].onxmlcomplete,null); skin_startup();"
	        onnewpano="skin_showloading(true); skin_update_scene_infos();"
	        onremovepano="skin_showloading(true);"
	        onloadcomplete="skin_showloading(false);"
	        onresize="skin_onresize();"
	        />

	<events name="skin_events" devices="fullscreensupport"
	        onenterfullscreen="set(layer[skin_btn_fs].crop, '64|576|64|64');"
	        onexitfullscreen="set(layer[skin_btn_fs].crop, '0|576|64|64');"
	        />


	<!-- Alternative small screen layout for mobile devices (override/extend settings) -->

	<krpano devices="mobile">
		<layer name="skin_control_bar" height="64" y="0" y_opened="0" y_closed="-68">
			<layer name="skin_btn_prev"   scale="1" y="0" align="left" x="0" />
			<layer name="skin_btn_next"   scale="1" y="0" align="left" x="80" />
			<layer name="skin_btn_lt"     visible="false" />
			<layer name="skin_btn_rt"     visible="false" />
			<layer name="skin_btn_up"     visible="false" />
			<layer name="skin_btn_dn"     visible="false" />
			<layer name="skin_btn_in"     visible="false" />
			<layer name="skin_btn_ou"     visible="false" />
			<layer name="skin_btn_gyro"   scale="1" y="0" align="left" x="320" />
			<layer name="skin_btn_fs"     scale="1" y="0" align="left" x="320" />
			<layer name="skin_btn_hide"   scale="1" x="5" />
			<layer name="skin_btn_show"   scale="1" x="0" y="-58" />
		</layer>

		<layer name="skin_buttonglow"  scale="2.0" />
		<layer name="skin_thumbborder" scale="1" />

		<style name="skin_thumbtext_style" css="text-align:center; color:#FFFFFF; font-family:Arial; font-weight:bold; font-size:20px;" />
	</krpano>

	<!-- Additional layout changes for Android Flashplayer Mobiles - different fullscreen button layout, zooming buttons, smaller loading text size -->

	<krpano devices="mobile+android+flash">
		<layer name="skin_scroll_window">
			<layer name="skin_scroll_layer">
				<layer name="skin_title" width="100%" css="text-align:left; color:#FFFFFF; font-family:Arial; font-weight:bold; font-size:20px;" />
			</layer>
		</layer>

		<layer name="skin_control_bar">
			<layer name="skin_btn_fs"   scale="1" align="right" x="70" y="0" />
			<layer name="skin_btn_show" x="-10" y="-40" />
		</layer>

		<layer name="skin_loadingtext" css="text-align:center; color:#FFFFFF; font-family:Arial; font-weight:bold; font-style:italic; font-size:30px;" />

		<layer name="skin_androidzoom_buttons" keep="true" type="container" width="60" height="160" align="right">
			<layer name="skin_androidzoom_in"  style="skin_base" effect="glow(0,0.5);" crop="9|512|46|64" align="center" x="0" y="-40" zorder="2" ondown="if(layer[skin_map].state == 'closed',set(fov_moveforce,-1));skin_buttonglow(get(name));" onup="if(layer[skin_map].state == 'closed',set(fov_moveforce,0),layer[skin_map].zoomin());skin_buttonglow(null);" />
			<layer name="skin_androidzoom_out" style="skin_base" effect="glow(0,0.5);" crop="73|512|46|64" align="center" x="0" y="+40" zorder="2" ondown="if(layer[skin_map].state == 'closed',set(fov_moveforce,+1));skin_buttonglow(get(name));" onup="if(layer[skin_map].state == 'closed',set(fov_moveforce,0),layer[skin_map].zoomout());skin_buttonglow(null);" />
		</layer>
	</krpano>



	<!-- Skin Actions -->

	<action name="skin_startup">
		if(device.mobile == false,
			copy(layer[skin_control_bar].y, skin_settings.controlbar_offset);
			copy(layer[skin_control_bar].y_opened, skin_settings.controlbar_offset);
			add(layer[skin_scroll_window].y, layer[skin_control_bar].height, layer[skin_control_bar].y);
			add(layer[skin_scroll_window].y_opened, layer[skin_control_bar].height, layer[skin_control_bar].y_opened);

			);

		if(device.android, if(device.flash, set(skin_settings.bingmaps_zoombuttons, false); ));

		skin_onresize();
		skin_updatescroll();

		copy(usegyro, skin_settings.gyro);
		if(device.desktop, set(usegyro, false));
		if(device.flash, set(usegyro, false));
		if(usegyro, copy(plugin[skin_gyro].url, plugin[skin_gyro].html5_url); );

		if(skin_settings.bingmaps == true,
			set(layer[skin_btn_map].visible, true);
			copy(layer[skin_map].key, skin_settings.bingmaps_key);
			copy(layer[skin_map_zoom_in].visible,  skin_settings.bingmaps_zoombuttons);
			copy(layer[skin_map_zoom_out].visible, skin_settings.bingmaps_zoombuttons);
			if(device.flash, copy(layer[skin_map].url, layer[skin_map].flash_url), copy(layer[skin_map].url, layer[skin_map].html5_url) );
		  ,
			if(device.mobile, copy(layer[skin_btn_gyro].x, layer[skin_btn_map].x) );
		  );
	</action>

	<action name="skin_onresize">
		mul(mh, stageheight, -1);
		if(layer[skin_map].state == 'opened', sub(hh,stageheight,skin_settings.controlbar_offset); sub(hh,layer[skin_control_bar].height); sub(hh,32); copy(layer[skin_map].height, hh); add(mh,hh); );
		set(layer[skin_scroll_layer].y, get(mh));
		ifnot(device.mobile, if(stagewidth LT 480, skin_showbuttons(false), skin_showbuttons(true)); );
	</action>

	<action name="skin_showbuttons">
		set(layer[skin_btn_lt].visible, %1);
		set(layer[skin_btn_rt].visible, %1);
		set(layer[skin_btn_up].visible, %1);
		set(layer[skin_btn_dn].visible, %1);
		set(layer[skin_btn_in].visible, %1);
		set(layer[skin_btn_ou].visible, %1);
		if(%1 == true,
			if(plugin[skin_gyro].available == true, set(layer[skin_btn_gyro].visible, %1) );
			if(device.fullscreensupport, set(layer[skin_btn_fs].visible, %1) );
		  ,
			set(layer[skin_btn_gyro].visible, %1);
			set(layer[skin_btn_fs].visible, %1);
		  );
	</action>

	<action name="skin_showloading">
		set(layer[skin_loadingtext].visible, %1);
	</action>

	<action name="skin_buttonglow">
		if(%1 != null,
			set(strength,0.7);
			if(%2 != null, set(strength,%2));
			set(layer[skin_buttonglow].parent, %1);
			set(layer[skin_buttonglow].visible, true);
			tween(layer[skin_buttonglow].alpha, get(strength), 0.07);
		  ,
			tween(layer[skin_buttonglow].alpha, 0.0, 0.1, default, set(layer[skin_buttonglow].parent, null); set(layer[skin_buttonglow].visible, false); );
		  );
	</action>

	<action name="skin_hideskin">
		if(layer[skin_map].state != 'closed', skin_showmap(false); wait(0.4); );
		tween(layer[skin_scroll_window].y, get(layer[skin_scroll_window].y_closed), 0.5, easeOutQuint);
		tween(layer[skin_control_bar].y, get(layer[skin_control_bar].y_closed), 0.5, easeOutQuint);
		set(layer[skin_btn_show].visible,true);
		tween(layer[skin_btn_show].alpha, 1, 0.25, easeOutQuint);
	</action>

	<action name="skin_showskin">
		tween(layer[skin_scroll_window].y, get(layer[skin_scroll_window].y_opened), 0.5, easeOutQuint);
		tween(layer[skin_control_bar].y, get(layer[skin_control_bar].y_opened), 0.5, easeOutQuint);
		set(layer[skin_btn_show].visible,false);
		tween(layer[skin_btn_show].alpha,0,0);
	</action>

	<action name="skin_openlogo">
		if(layer[skin_logo].state == 'small',
			set(layer[skin_logo].state, 'opening');
			copy(backup_logo_align, layer[skin_logo].align);
			copy(backup_logo_x, layer[skin_logo].x);
			copy(backup_logo_y, layer[skin_logo].y);
			copy(backup_logo_scale, layer[skin_logo].scale);
			layer[skin_logo].changeorigin(center);
			tween(layer[skin_logo].x, 0, 0.5, easeOutQuint);
			tween(layer[skin_logo].y, 0, 0.5, easeOutQuint);
			tween(layer[skin_logo].scale, 1, 0.5, easeOutQuint);
			delayedcall(0.5, set(layer[skin_logo].state, 'opened') );
			delayedcall(0, set(events[skin_events].onmouseup, delayedcall(0, skin_closelogo()) ) );
		  );
	</action>

	<action name="skin_closelogo">
		if(layer[skin_logo].state == 'opened',
			set(layer[skin_logo].state, 'closing');
			layer[skin_logo].changeorigin(get(backup_logo_align));
			if(%1 == 'now',
				stoptween(layer[skin_logo].x, layer[skin_logo].y, layer[skin_logo].scale);
				copy(layer[skin_logo].x, backup_logo_x);
				copy(layer[skin_logo].y, backup_logo_y);
				copy(layer[skin_logo].scale, backup_logo_scale);
				set(layer[skin_logo].state, 'small');
			  ,
				tween(layer[skin_logo].x, get(backup_logo_x), 0.5, easeOutQuint);
				tween(layer[skin_logo].y, get(backup_logo_y), 0.5, easeOutQuint);
				tween(layer[skin_logo].scale, get(backup_logo_scale), 0.5, easeOutQuint);
				delayedcall(0.5, set(layer[skin_logo].state, 'small'));
			  );
			set(events[skin_events].onmouseup, null);
		  );
	</action>

</krpano>
