function pano2vrSkin(player,skinlayer) {
	var me=this;
	var flag=false;
	this.player=player;
	this.player.skinObj=this;
	this.divSkin=(skinlayer)?skinlayer:player.divSkin;
	this.elementMouseDown=new Array();
	this.elementMouseOver=new Array();
	this.updateSize=function(startElement) {
		var stack=new Array();
		stack.push(startElement);
		while(stack.length>0) {
			e=stack.pop();
			if (e.ggUpdatePosition) {
				e.ggUpdatePosition();
			}
			if (e.hasChildNodes()) {
				for(i=0;i<e.childNodes.length;i++) {
					stack.push(e.childNodes[i]);
				}
			}
		}
	}
	
	this.findElements=function(id) {
		var r=new Array();
		var stack=new Array();
		stack.push(me.divSkin);
		while(stack.length>0) {
			e=stack.pop();
			if (e.ggId==id) {
				r.push(e);
			}
			if (e.hasChildNodes()) {
				for(i=0;i<e.childNodes.length;i++) {
					stack.push(e.childNodes[i]);
				}
			}
		}
		return r;
	}
	
	this.addSkin=function() {
		this.loading_panel=document.createElement('div');
		this.loading_panel.ggId='Loading Panel'
		this.loading_panel.ggUpdatePosition=function() {
			this.style.webkitTransition='none';
			w=this.parentNode.offsetWidth;
			this.style.left=(-111 + w/2) + 'px';
			h=this.parentNode.offsetHeight;
			this.style.top=(-31 + h/2) + 'px';
		}
		hs ='position:absolute;';
		hs+='left: -111px;';
		hs+='top:  -31px;';
		hs+='width: 220px;';
		hs+='height: 59px;';
		hs+='-webkit-transform-origin: 50% 50%;';
		hs+='visibility: inherit;';
		hs+='border: 2px solid #000000;';
		hs+='background-image:url(Resources/alpha_background_222222_191.png);';
		this.loading_panel.setAttribute('style',hs);
		this.loading_text=document.createElement('div');
		this.loading_text.ggId='loading text'
		hs ='position:absolute;';
		hs+='left: 9px;';
		hs+='top:  14px;';
		hs+='width: 198px;';
		hs+='height: 20px;';
		hs+='-webkit-transform-origin: 50% 50%;';
		hs+='visibility: inherit;';
		hs+='border: 0px solid #000000;';
		hs+='color: #000000;';
		hs+='text-align: left;';
		hs+='white-space: nowrap;';
		hs+='padding: 0px 1px 0px 1px;'
		hs+='overflow: hidden;';
		this.loading_text.setAttribute('style',hs);
		this.loading_text.ggUpdateText=function() {
			this.innerHTML="<b>Loading... "+(me.player.getPercentLoaded()*100.0).toFixed(0)+"%<\/b>";
		}
		this.loading_text.ggUpdateText();
		this.loading_panel.appendChild(this.loading_text);
		this.loading_bar=document.createElement('div');
		this.loading_bar.ggId='loading bar'
		hs ='position:absolute;';
		hs+='left: 8px;';
		hs+='top:  38px;';
		hs+='width: 198px;';
		hs+='height: 10px;';
		hs+='-webkit-transform-origin: 0% 50%;';
		hs+='visibility: inherit;';
		hs+='border: 2px solid #000000;';
		hs+='background-color: #4f2021;';
		this.loading_bar.setAttribute('style',hs);
		this.loading_panel.appendChild(this.loading_bar);
		this.loading_close=document.createElement('div');
		this.loading_close.ggId='loading close'
		hs ='position:absolute;';
		hs+='left: 199px;';
		hs+='top:  4px;';
		hs+='width: 16px;';
		hs+='height: 16px;';
		hs+='-webkit-transform-origin: 50% 50%;';
		hs+='visibility: inherit;';
		this.loading_close.setAttribute('style',hs);
		this.loading_close__img=document.createElement('img');
		this.loading_close__img.setAttribute('src','Resources/loading_closea.png');
		this.loading_close__img.setAttribute('style','position: absolute;top: 0px;left: 0px;');
		me.player.checkLoaded.push(this.loading_close__img);
		this.loading_close.appendChild(this.loading_close__img);
		this.loading_close.onclick=function () {
			me.loading_panel.style.webkitTransition='none';
			me.loading_panel.style.visibility='hidden';
		}
		this.loading_panel.appendChild(this.loading_close);
		this.divSkin.appendChild(this.loading_panel);
		this.fullscreen=document.createElement('div');
		this.fullscreen.ggId='fullscreen'
		this.fullscreen.ggUpdatePosition=function() {
			this.style.webkitTransition='none';
			w=this.parentNode.offsetWidth;
			this.style.left=(-50 + w) + 'px';
			h=this.parentNode.offsetHeight;
			this.style.top=(-50 + h) + 'px';
		}
		hs ='position:absolute;';
		hs+='left: -50px;';
		hs+='top:  -50px;';
		hs+='width: 50px;';
		hs+='height: 50px;';
		hs+='-webkit-transform-origin: 100% 100%;';
		hs+='-webkit-transform: rotate(0deg) scale(0.5,0.5);';
		hs+='opacity: 0.5;';
		hs+='visibility: inherit;';
		hs+='cursor: pointer;';
		this.fullscreen.setAttribute('style',hs);
		this.fullscreen__img=document.createElement('img');
		this.fullscreen__img.setAttribute('src','Resources/fullscreena.png');
		this.fullscreen__img.setAttribute('style','position: absolute;top: 0px;left: 0px;');
		me.player.checkLoaded.push(this.fullscreen__img);
		this.fullscreen.appendChild(this.fullscreen__img);
		this.fullscreen.onclick=function () {
			me.player.toggleFullscreen();
		}
		this.fullscreen.onmouseover=function () {
			if (me.player.transitionsDisabled) {
				me.fullscreen.style.webkitTransition='none';
			} else {
				me.fullscreen.style.webkitTransition='all 500ms ease-out 0ms';
			}
			me.fullscreen.style.webkitTransform='scale(1,1)';
			if (me.player.transitionsDisabled) {
				me.fullscreen.style.webkitTransition='none';
			} else {
				me.fullscreen.style.webkitTransition='all 500ms ease-out 0ms';
			}
			me.fullscreen.style.opacity='1';
			me.fullscreen__img.src='Resources/fullscreeno.png';
		}
		this.fullscreen.onmouseout=function () {
			if (me.player.transitionsDisabled) {
				me.fullscreen.style.webkitTransition='none';
			} else {
				me.fullscreen.style.webkitTransition='all 500ms ease-out 0ms';
			}
			me.fullscreen.style.webkitTransform='scale(0.5,0.5)';
			if (me.player.transitionsDisabled) {
				me.fullscreen.style.webkitTransition='none';
			} else {
				me.fullscreen.style.webkitTransition='all 500ms ease-out 0ms';
			}
			me.fullscreen.style.opacity='0.5';
			me.fullscreen__img.src='Resources/fullscreena.png';
		}
		this.divSkin.appendChild(this.fullscreen);
		this.info=document.createElement('div');
		this.info.ggId='info'
		this.info.ggUpdatePosition=function() {
			this.style.webkitTransition='none';
			h=this.parentNode.offsetHeight;
			this.style.top=(-50 + h) + 'px';
		}
		hs ='position:absolute;';
		hs+='left: 0px;';
		hs+='top:  -50px;';
		hs+='width: 50px;';
		hs+='height: 50px;';
		hs+='-webkit-transform-origin: 0% 100%;';
		hs+='-webkit-transform: rotate(0deg) scale(0.5,0.5);';
		hs+='opacity: 0.5;';
		hs+='visibility: inherit;';
		hs+='cursor: pointer;';
		this.info.setAttribute('style',hs);
		this.info__img=document.createElement('img');
		this.info__img.setAttribute('src','Resources/infoa.png');
		this.info__img.setAttribute('style','position: absolute;top: 0px;left: 0px;');
		me.player.checkLoaded.push(this.info__img);
		this.info.appendChild(this.info__img);
		this.info.onclick=function () {
			flag=(me.userdata.style.visibility=='hidden');
			me.userdata.style.webkitTransition='none';
			me.userdata.style.visibility=flag?'inherit':'hidden';
		}
		this.info.onmouseover=function () {
			if (me.player.transitionsDisabled) {
				me.info.style.webkitTransition='none';
			} else {
				me.info.style.webkitTransition='all 500ms ease-out 0ms';
			}
			me.info.style.opacity='1';
			if (me.player.transitionsDisabled) {
				me.info.style.webkitTransition='none';
			} else {
				me.info.style.webkitTransition='all 500ms ease-out 0ms';
			}
			me.info.style.webkitTransform='scale(1,1)';
			me.info__img.src='Resources/infoo.png';
		}
		this.info.onmouseout=function () {
			if (me.player.transitionsDisabled) {
				me.info.style.webkitTransition='none';
			} else {
				me.info.style.webkitTransition='all 500ms ease-out 0ms';
			}
			me.info.style.opacity='0.5';
			if (me.player.transitionsDisabled) {
				me.info.style.webkitTransition='none';
			} else {
				me.info.style.webkitTransition='all 500ms ease-out 0ms';
			}
			me.info.style.webkitTransform='scale(0.5,0.5)';
			me.info__img.src='Resources/infoa.png';
		}
		this.divSkin.appendChild(this.info);
		this.userdata=document.createElement('div');
		this.userdata.ggId='Userdata'
		this.userdata.ggUpdatePosition=function() {
			this.style.webkitTransition='none';
			w=this.parentNode.offsetWidth;
			this.style.left=(-155 + w/2) + 'px';
			h=this.parentNode.offsetHeight;
			this.style.top=(-70 + h/2) + 'px';
		}
		hs ='position:absolute;';
		hs+='left: -155px;';
		hs+='top:  -70px;';
		hs+='width: 309px;';
		hs+='height: 114px;';
		hs+='-webkit-transform-origin: 50% 50%;';
		hs+='visibility: hidden;';
		hs+='border: 1px solid #000000;';
		hs+='background-image:url(Resources/alpha_background_011f44_128.png);';
		this.userdata.setAttribute('style',hs);
		this.userdata.onclick=function () {
			me.userdata.style.webkitTransition='none';
			me.userdata.style.visibility='hidden';
		}
		this.title=document.createElement('div');
		this.title.ggId='title'
		hs ='position:absolute;';
		hs+='left: 4px;';
		hs+='top:  4px;';
		hs+='width: 293px;';
		hs+='height: 20px;';
		hs+='-webkit-transform-origin: 50% 50%;';
		hs+='visibility: inherit;';
		hs+='border: 0px solid #000000;';
		hs+='color: #ffffff;';
		hs+='text-align: left;';
		hs+='white-space: nowrap;';
		hs+='padding: 0px 1px 0px 1px;'
		hs+='overflow: hidden;';
		this.title.setAttribute('style',hs);
		this.title.ggUpdateText=function() {
			this.innerHTML="<b>"+me.player.userdata.title+"<\/b>";
		}
		this.title.ggUpdateText();
		this.userdata.appendChild(this.title);
		this.author=document.createElement('div');
		this.author.ggId='author'
		hs ='position:absolute;';
		hs+='left: 4px;';
		hs+='top:  29px;';
		hs+='width: 293px;';
		hs+='height: 20px;';
		hs+='-webkit-transform-origin: 50% 50%;';
		hs+='visibility: inherit;';
		hs+='border: 0px solid #000000;';
		hs+='color: #ffffff;';
		hs+='text-align: left;';
		hs+='white-space: nowrap;';
		hs+='padding: 0px 1px 0px 1px;'
		hs+='overflow: hidden;';
		this.author.setAttribute('style',hs);
		this.author.ggUpdateText=function() {
			this.innerHTML=me.player.userdata.author;
		}
		this.author.ggUpdateText();
		this.userdata.appendChild(this.author);
		this.datetime=document.createElement('div');
		this.datetime.ggId='datetime'
		hs ='position:absolute;';
		hs+='left: 4px;';
		hs+='top:  49px;';
		hs+='width: 293px;';
		hs+='height: 20px;';
		hs+='-webkit-transform-origin: 50% 50%;';
		hs+='visibility: inherit;';
		hs+='border: 0px solid #000000;';
		hs+='color: #ffffff;';
		hs+='text-align: left;';
		hs+='white-space: nowrap;';
		hs+='padding: 0px 1px 0px 1px;'
		hs+='overflow: hidden;';
		this.datetime.setAttribute('style',hs);
		this.datetime.ggUpdateText=function() {
			this.innerHTML=me.player.userdata.datetime;
		}
		this.datetime.ggUpdateText();
		this.userdata.appendChild(this.datetime);
		this.description=document.createElement('div');
		this.description.ggId='description'
		hs ='position:absolute;';
		hs+='left: 4px;';
		hs+='top:  69px;';
		hs+='width: 293px;';
		hs+='height: 20px;';
		hs+='-webkit-transform-origin: 50% 50%;';
		hs+='visibility: inherit;';
		hs+='border: 0px solid #000000;';
		hs+='color: #ffffff;';
		hs+='text-align: left;';
		hs+='white-space: nowrap;';
		hs+='padding: 0px 1px 0px 1px;'
		hs+='overflow: hidden;';
		this.description.setAttribute('style',hs);
		this.description.ggUpdateText=function() {
			this.innerHTML=me.player.userdata.description;
		}
		this.description.ggUpdateText();
		this.userdata.appendChild(this.description);
		this.copyright=document.createElement('div');
		this.copyright.ggId='copyright'
		hs ='position:absolute;';
		hs+='left: 4px;';
		hs+='top:  89px;';
		hs+='width: 288px;';
		hs+='height: 20px;';
		hs+='-webkit-transform-origin: 50% 50%;';
		hs+='visibility: inherit;';
		hs+='border: 0px solid #000000;';
		hs+='color: #ffffff;';
		hs+='text-align: left;';
		hs+='white-space: nowrap;';
		hs+='padding: 0px 1px 0px 1px;'
		hs+='overflow: hidden;';
		this.copyright.setAttribute('style',hs);
		this.copyright.ggUpdateText=function() {
			this.innerHTML="&#169; "+me.player.userdata.copyright;
		}
		this.copyright.ggUpdateText();
		this.userdata.appendChild(this.copyright);
		this.divSkin.appendChild(this.userdata);
		this.m_path=document.createElement('div');
		this.m_path.ggId='m_path'
		hs ='position:absolute;';
		hs+='left: 0px;';
		hs+='top:  15px;';
		hs+='width: 20px;';
		hs+='height: 20px;';
		hs+='-webkit-transform-origin: 50% 50%;';
		hs+='visibility: inherit;';
		hs+='cursor: pointer;';
		this.m_path.setAttribute('style',hs);
		this.m_path__img=document.createElement('img');
		this.m_path__img.setAttribute('src','Resources/m_path.png');
		this.m_path__img.setAttribute('style','position: absolute;top: 0px;left: 0px;');
		me.player.checkLoaded.push(this.m_path__img);
		this.m_path.appendChild(this.m_path__img);
		this.m_path.onclick=function () {
			me.player.openUrl("path.swf",me.player.hotspot.target);
		}
		this.divSkin.appendChild(this.m_path);
		this.m_river_path=document.createElement('div');
		this.m_river_path.ggId='m_river_path'
		hs ='position:absolute;';
		hs+='left: 0px;';
		hs+='top:  0px;';
		hs+='width: 20px;';
		hs+='height: 20px;';
		hs+='-webkit-transform-origin: 50% 50%;';
		hs+='visibility: inherit;';
		hs+='cursor: pointer;';
		this.m_river_path.setAttribute('style',hs);
		this.m_river_path__img=document.createElement('img');
		this.m_river_path__img.setAttribute('src','Resources/m_path.png');
		this.m_river_path__img.setAttribute('style','position: absolute;top: 0px;left: 0px;');
		me.player.checkLoaded.push(this.m_river_path__img);
		this.m_river_path.appendChild(this.m_river_path__img);
		this.m_river_path.onclick=function () {
			me.player.openNext("river_path.swf",me.player.hotspot.target);
		}
		this.divSkin.appendChild(this.m_river_path);
		this.m_bridge=document.createElement('div');
		this.m_bridge.ggId='m_bridge'
		hs ='position:absolute;';
		hs+='left: 0px;';
		hs+='top:  35px;';
		hs+='width: 20px;';
		hs+='height: 20px;';
		hs+='-webkit-transform-origin: 50% 50%;';
		hs+='visibility: inherit;';
		hs+='cursor: pointer;';
		this.m_bridge.setAttribute('style',hs);
		this.m_bridge__img=document.createElement('img');
		this.m_bridge__img.setAttribute('src','Resources/m_path.png');
		this.m_bridge__img.setAttribute('style','position: absolute;top: 0px;left: 0px;');
		me.player.checkLoaded.push(this.m_bridge__img);
		this.m_bridge.appendChild(this.m_bridge__img);
		this.m_bridge.onclick=function () {
			me.player.openNext("bridge.swf",me.player.hotspot.target);
		}
		this.divSkin.appendChild(this.m_bridge);
		this.divSkin.ggUpdateSize=function(w,h) {
			me.updateSize(me.divSkin);
		}
		this.divSkin.ggLoaded=function() {
			me.loading_panel.style.webkitTransition='none';
			me.loading_panel.style.visibility='hidden';
		}
		this.divSkin.ggReLoaded=function() {
		}
		this.divSkin.ggEnterFullscreen=function() {
		}
		this.divSkin.ggExitFullscreen=function() {
		}
		this.skinTimerEvent();
	};
	this.hotspotProxyClick=function(id) {
		if (id=='path') {
			me.m_path.onclick();
		}
		if (id=='river_path') {
			me.m_river_path.onclick();
		}
		if (id=='bridge') {
			me.m_bridge.onclick();
		}
	}
	this.hotspotProxyOver=function(id) {
	}
	this.hotspotProxyOut=function(id) {
	}
	this.skinTimerEvent=function() {
		setTimeout(function() { me.skinTimerEvent(); }, 10);
		this.loading_text.ggUpdateText();
		var hs='';
		if (me.loading_bar.ggTransform) {
			hs+=me.loading_bar.ggTransform + ' ';
		}
		hs+='scale(' + (1 * me.player.getPercentLoaded() + 0) + ',1.0) ';
		me.loading_bar.style.webkitTransform=hs;
		this.title.ggUpdateText();
		this.author.ggUpdateText();
		this.datetime.ggUpdateText();
		this.description.ggUpdateText();
		this.copyright.ggUpdateText();
	};
	function SkinHotspotClass(skinObj,hotspot) {
		var me=this;
		var flag=false;
		this.player=skinObj.player;
		this.skin=skinObj;
		this.hotspot=hotspot;
		this.div=document.createElement('div');
		this.div.setAttribute('style','position:absolute; left:0px;top:0px;visibility: inherit;');
		{
			this.div=document.createElement('div');
			this.div.ggId='hs_next'
			hs ='position:absolute;';
			hs+='left: 305px;';
			hs+='top:  30px;';
			hs+='width: 5px;';
			hs+='height: 5px;';
			hs+='-webkit-transform-origin: 50% 50%;';
			hs+='visibility: inherit;';
			this.div.setAttribute('style',hs);
			this.div.onclick=function () {
				me.skin.hotspotProxyClick(me.hotspot.id);
			}
			this.div.onmouseover=function () {
				me.player.hotspot=me.hotspot;
				me.hs_image.style.webkitTransition='none';
				me.hs_image.style.opacity='1';
				me.hs_text.style.webkitTransition='none';
				me.hs_text.style.visibility='inherit';
				me.skin.hotspotProxyOver(me.hotspot.id);
			}
			this.div.onmouseout=function () {
				me.player.hotspot=me.player.emptyHotspot;
				me.hs_image.style.webkitTransition='none';
				me.hs_image.style.opacity='0.5';
				me.hs_text.style.webkitTransition='none';
				me.hs_text.style.visibility='inherit';
				me.skin.hotspotProxyOut(me.hotspot.id);
			}
			this.hs_image=document.createElement('div');
			this.hs_image.ggId='hs_image'
			hs ='position:absolute;';
			hs+='left: -25px;';
			hs+='top:  -25px;';
			hs+='width: 50px;';
			hs+='height: 50px;';
			hs+='-webkit-transform-origin: 50% 50%;';
			hs+='opacity: 0.2;';
			hs+='visibility: inherit;';
			hs+='cursor: pointer;';
			this.hs_image.setAttribute('style',hs);
			this.hs_image__img=document.createElement('img');
			this.hs_image__img.setAttribute('src','Resources/hs_image.png');
			this.hs_image__img.setAttribute('style','position: absolute;top: 0px;left: 0px;');
			me.player.checkLoaded.push(this.hs_image__img);
			this.hs_image.appendChild(this.hs_image__img);
			this.hs_text=document.createElement('div');
			this.hs_text.ggId='hs_text'
			this.hs_text.ggUpdatePosition=function() {
				this.style.webkitTransition='none';
				this.style.left=(-15 + (78-this.offsetWidth)/2) + 'px';
			}
			hs ='position:absolute;';
			hs+='left: -15px;';
			hs+='top:  50px;';
			hs+='width: auto;';
			hs+='height: auto;';
			hs+='-webkit-transform-origin: 50% 50%;';
			hs+='visibility: inherit;';
			hs+='border: 1px solid #000000;';
			hs+='color: #fefefe;';
			hs+='background-color: #000000;';
			hs+='text-align: center;';
			hs+='white-space: nowrap;';
			hs+='padding: 0px 1px 0px 1px;'
			hs+='overflow: hidden;';
			this.hs_text.setAttribute('style',hs);
			this.hs_text.innerHTML=me.hotspot.title;
			this.hs_image.appendChild(this.hs_text);
			this.div.appendChild(this.hs_image);
		}
	};
	this.addSkinHotspot=function(hotspot) {
		return new SkinHotspotClass(me,hotspot);
	}
	this.addSkin();
};
