<krpano>

	<events onenterfullscreen="set(plugin[openfs].visible,false); set(plugin[closefs].visible,true);"
	        onexitfullscreen ="set(plugin[openfs].visible,true);  set(plugin[closefs].visible,false);"
	 />
			

	<textstyle name="buttonstyle" font="Arial" fontsize="11" border="false" background="false" textcolor="0xFFFFFF" effect="glow(0x000000,0.7,4,2);dropshadow(2,45,0x000000,3,1);" />
	

	<style name="button" keep="true" align="bottom" y="10" />


	<layer name="in" url="in.png" zorder="10" style="button" devices="!iphone+!ipad"  x="-180" onhover="showtext(缩小,buttonstyle);" ondown="set(fov_moveforce,-1);"  onup="set(fov_moveforce,0);" />
	<layer name="out" url="out.png" zorder="10" style="button" devices="!iphone+!ipad"  x="-135" onhover="showtext(放大,buttonstyle);" ondown="set(fov_moveforce,+1);"  onup="set(fov_moveforce,0);" />
	<layer name="left" url="left.png" zorder="10" style="button" devices="!iphone+!ipad"  x="-90" onhover="showtext(向左,buttonstyle);" ondown="set(hlookat_moveforce,-1);"  onup="set(hlookat_moveforce,0);" />
	<layer name="right" url="right.png" zorder="10" style="button" devices="!iphone+!ipad"  x="-45" onhover="showtext(向右,buttonstyle);" ondown="set(hlookat_moveforce,+1);"  onup="set(hlookat_moveforce,0);" />
	<layer name="up" url="up.png" zorder="10" style="button" devices="!iphone+!ipad"  x="+0"  onhover="showtext(向上,buttonstyle);" ondown="set(vlookat_moveforce,-1);"  onup="set(vlookat_moveforce,0);" />
	<layer name="down" url="down.png"  zorder="10"  style="button" devices="!iphone+!ipad"   x="+45"  onhover="showtext(向下,buttonstyle);" ondown="set(vlookat_moveforce,+1);"  onup="set(vlookat_moveforce,0);" />
	<layer name="rotate-on" url="rotate.png"  zorder="10" style="button" devices="!iphone+!ipad"   x="+90" onhover="showtext(使能自动旋转 buttonstyle);" onclick="set(autorotate.enabled,true); set(layer[rotate-on].visible,false); set(layer[rotate-off].visible,true);"  visible="false"  />
	<layer name="rotate-off" url="rotate.png"  zorder="10" style="button" devices="!iphone+!ipad"   x="+90" onhover="showtext(停止自动旋转,buttonstyle);" onclick="set(autorotate.enabled,false); set(layer[rotate-on].visible,true); set(layer[rotate-off].visible,false); " visible="true" />

	<layer name="openfs" url="full.png"  zorder="10" style="button" devices="!iphone+!ipad" x="+135" onhover="showtext(全屏, buttonstyle);" onclick="set(fullscreen,true);"  visible="true"  />
	<layer name="closefs" url="full.png" zorder="10" style="button" devices="!iphone+!ipad" x="+135" onhover="showtext(退出全屏,buttonstyle);" onclick="set(fullscreen,false);" visible="false" />
	
	<layer name="gyro-button" style="gyrobutton" zorder="10" visible="true" devices="iphone|ipad|android" align="righttop" x="30" y="30" width="120" html="[p]Gyro On[/p]" onclick="switch(plugin[gyro].enabled); set(view.camroll,0.0); if(plugin[gyro].enabled == false, set(html,[p]Gyro Off[/p]), set(html,[p]Gyro On[/p]));"/> /> 

	<style name="gyrobutton"
		url="%SWFPATH%/plugins/textfield.swf"
		keep="true"
		height="30"
		autosize="none"
		css="p{color:#FFFFFF; font-family:Arial; font-size:14; margin-left:5; margin-right:5; text-align:center; }"
		background="true" backgroundcolor="0x000000" backgroundalpha="0.7"
		bordercolor="0" borderwidth="0"
		blur="0"
		glow="4"
		glowcolor="16777215"
		roundedge="5"
		shadow="1"
		textblur="0" textglow="0" textglowcolor="16777215" textshadow="0"
	/>

<layer name="logo" url="svt-logo.png" zorder="10" keep="true" alpha="0.3" effect="dropshadow(2,45,0x000000,3,1);" edge="rightbottom" align="rightbottom" x="18" y="8" onhover="showtext(浏览全景大师网站);" onclick="openurl('http://vrm.net.cn',_blank);"  visible="true"  />
<plugin name="gyro" url="%SWFPATH%/plugins/gyro.js" enabled="true" camroll="true" friction="0.5" velastic="0.2" devices="html5" keep="true" onloaded="delayedcall(1,if(available, set(plugin[gyro-button].visible,true); ));"
/>

	<include url="androidskin.xml" devices="android+flash" />

	<action name="CallSkin_TourOnstart">
BuildGroupThumbs();
	</action>
	<action name="CallSkin_SceneOnXMLComplete">
VRM_SetThumbs();
	</action>
	<action name="VRM_SetThumbs">
if(layer[scene_%1] === null,
	BuildThumbs();
);
	</action>
	<action name="BuildGroupThumbs">
for(set(i,0),i LT Tour.Groups.GroupItem.Count,inc(i),
   	copy(groupname, Tour.Groups.GroupItem[get(i)].name);
   	copy(defscene, Tour.Groups.GroupItem[get(i)].defaultscene);
   	copy(caption, Tour.Groups.GroupItem[get(i)].caption);
	txtadd(thumburl,&apos;%FIRSTXML%/scene/&apos;,get(groupname),&apos;/&apos;,get(defscene),&apos;/ThumbImage.jpg&apos;);
	txtadd(pluginname,&apos;group_&apos;,get(groupname));
	trace(get(pluginname));
	addplugin(get(pluginname));
	set(plugin[get(pluginname)].visible,true);
	set(plugin[get(pluginname)].url, get(thumburl));
	set(plugin[get(pluginname)].keep, true);
	set(plugin[get(pluginname)].align, righttop);
	set(plugin[get(pluginname)].edge, righttop);
	set(plugin[get(pluginname)].alpha, &quot;0.8&quot;);
	mul(plugin[get(pluginname)].x, i,43);
	set(plugin[get(pluginname)].y, &quot;0&quot;);
	set(plugin[get(pluginname)].ox, &quot;-5&quot;);
	set(plugin[get(pluginname)].oy, &quot;5&quot;);
	set(plugin[get(pluginname)].width,  40);
	set(plugin[get(pluginname)].height, 28);
	set(plugin[get(pluginname)].zorder, 100);
	set(plugin[get(pluginname)].onover, &quot;set(effect,glow(0x00FFFF,0.7,4,4););set(alpha,1);&quot;);
	set(plugin[get(pluginname)].onhover, &quot;showtext(get(caption));&quot;);
	set(plugin[get(pluginname)].onout, &quot;set(effect,);set(alpha,0.8);&quot;);
	txtadd(clickevent,&quot;RemoveOldThumbs();VRM_LoadScene(&quot;,get(groupname),&quot;/&quot;,get(defscene),&quot;)&quot;);
	set(plugin[get(pluginname)].onclick, get(clickevent));
);
	</action>
	<action name="RemoveOldThumbs">
//showlog();
set(_count,get(Group.Scenes.SceneItem.Count));     
for(set(i,0),i LT _count,inc(i),
    set(xScene,get(Group.Scenes.SceneItem[get(i)].Name));
    txtadd(scenethumb,&quot;thumb_&quot;,get(i));
    removeplugin(get(scenethumb));
    txtadd(scenetitle,&quot;scenetitle_&quot;,get(xScene));
    removeplugin(get(scenetitle));
);
set(Group.Scenes.SceneItem.Count,&apos;0&apos;);
delete(i,xScene,_count,scenethumb,scenetitle);</action>	
	<action name="BuildThumbs">	
copy(groupname, Group.groupname);		
for(set(i,0),i LT Group.Scenes.SceneItem.Count,inc(i),	

   	copy(scenename, Group.Scenes.SceneItem[get(i)].name);
   	copy(caption, Group.Scenes.SceneItem[get(i)].title);
	txtadd(thumburl,&apos;%FIRSTXML%/scene/&apos;,get(groupname),&apos;/&apos;,get(scenename),&apos;/ThumbImage.jpg&apos;);
	txtadd(thumbname,'thumb_',get(i));
			addplugin(get(thumbname));
			set(plugin[get(thumbname)].url, get(thumburl));
			set(plugin[get(thumbname)].keep, true);
			set(plugin[get(thumbname)].align, leftbottom);
			set(plugin[get(thumbname)].width,  40);
			set(plugin[get(thumbname)].height, 40);
			mul(plugin[get(thumbname)].x, i,3);
			mul(plugin[get(thumbname)].y, i,3);
			add(plugin[get(thumbname)].x, 5);
			add(plugin[get(thumbname)].y, 5);
			copy(plugin[get(thumbname)].xsmall, plugin[get(thumbname)].x);
			copy(plugin[get(thumbname)].ysmall, plugin[get(thumbname)].y);
			add(plugin[get(thumbname)].zorder, 100, i);
			set(plugin[get(thumbname)].effect, glow(0xFFFFFF,1.0,2,10000));
			set(plugin[get(thumbname)].jsborder, '1px solid #FFFFFF');
			copy(plugin[get(thumbname)].thumbpos, i);
			set(plugin[get(thumbname)].linkedscene, get(scenename) );
			set(plugin[get(thumbname)].onclick, openthumbs() );
		);
	</action>

	<action name="openthumb">
		if(%2 != NEXT,
			set(pos,0);
			copy(curpos, plugin[%1].thumbpos);
			set(xdst, 0);
			set(ydst, 0);
		  );
		if(pos LT curpos,
			inc(pos);
			inc(ydst,90);
			sub(ymax, stageheight, 100);
			if(ydst GT ymax, inc(xdst,90);set(ydst,0); );
			openthumb(%1,NEXT);
		  ,
			add(xdst,10);
			add(ydst,10);
			tween(plugin[%1].x, get(xdst) );
			tween(plugin[%1].y, get(ydst) );
			tween(plugin[%1].width, 80);
			tween(plugin[%1].height, 80);
		  );
	</action>

	<action name="closethumb">
		tween(plugin[%1].x, get(plugin[%1].xsmall));
		tween(plugin[%1].y, get(plugin[%1].ysmall));
		tween(plugin[%1].width, 40);
		tween(plugin[%1].height, 40);
	</action>

	<action name="openthumbs">
		if(%1 != NEXT,
			set(i,0);
			set(events.onclick, set(events.onclick,null); delayedcall(0.1, closethumbs() ); );
		  );

		if(i LT Group.Scenes.SceneItem.Count,
			txtadd(thumbname,'thumb_',get(i));
			openthumb(get(thumbname));
			set(plugin[get(thumbname)].onclick, set(events.onclick,null); closethumbs(); 
			copy(groupname, Group.groupname); 
			txtadd(ascene,get(groupname),&quot;/&quot;,get(linkedscene));
			VRM_LoadScene(get(ascene));
			//loadscene(get(linkedscene),null,MERGE,BLEND(1)); );
			inc(i);
			openthumbs(NEXT);
		  );
	</action>

	<action name="closethumbs">
		if(%1 != NEXT, set(i,0));
		if(i LT Group.Scenes.SceneItem.Count,
			txtadd(thumbname,'thumb_',get(i));
			closethumb(get(thumbname));
			set(plugin[get(thumbname)].onclick, openthumbs() );
			inc(i);
			closethumbs(NEXT);
		  );
	</action>

</krpano>
