// Garden Gnome Software - Skin
// Pano2VR 3.1.0/1777
// Filename: fs360_nav_fs.ggsk
// Generated Thu Sep 8 11:52:17 2011

function pano2vrSkin(player,skinlayer,base) {
	var me=this;
	var flag=false;
	this.player=player;
	this.player.skinObj=this;
	this.divSkin=(skinlayer)?skinlayer:player.divSkin;
	var basePath="";
	// auto detect base path
	if (base=='?') {
		var scripts = document.getElementsByTagName('script');
		for(var i=0;i<scripts.length;i++) {
			var src=scripts[i].src;
			if (src.indexOf('skin.js')>=0) {
				var p=src.lastIndexOf('/');
				if (p>=0) {
					basePath=src.substr(0,p+1);
				}
			}
		}
	} else
	if (base) {
		basePath=base;
	}
	this.elementMouseDown=new Array();
	this.elementMouseOver=new Array();
	var cssPrefix='';
	var domTransition='transition';
	var domTransform='transform';
	var prefixes='Webkit,Moz,O,ms,Ms'.split(',');
	var i;
	for(i=0;i<prefixes.length;i++) {
		if (typeof document.body.style[prefixes[i] + 'Transform'] !== 'undefined') {
			cssPrefix='-' + prefixes[i].toLowerCase() + '-';
			domTransition=prefixes[i] + 'Transition';
			domTransform=prefixes[i] + 'Transform';
		}
	}
	
	this.player.setMargins(0,0,0,0);
	
	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]);
				}
			}
		}
	}
	
	parameterToTransform=function(p) {
		return 'translate(' + p.rx + 'px,' + p.ry + 'px) rotate(' + p.a + 'deg) scale(' + p.sx + ',' + p.sy + ')';
	}
	
	this.findElements=function(id,regex) {
		var r=new Array();
		var stack=new Array();
		var pat=new RegExp(id,'');
		stack.push(me.divSkin);
		while(stack.length>0) {
			e=stack.pop();
			if (regex) {
				if (pat.test(e.ggId)) r.push(e);
			} else {
				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._image_110=document.createElement('div');
		this._image_110.ggId='Image 11'
		this._image_110.ggParameter={ rx:0,ry:0,a:0,sx:1,sy:1 };
		this._image_110.ggVisible=true;
		this._image_110.ggUpdatePosition=function() {
			this.style[domTransition]='none';
			w=this.parentNode.offsetWidth;
			this.style.left=(-1101 + w/2) + 'px';
			h=this.parentNode.offsetHeight;
			this.style.top=(-42 + h) + 'px';
		}
		hs ='position:absolute;';
		hs+='left: -1101px;';
		hs+='top:  -42px;';
		hs+='width: 4010px;';
		hs+='height: 42px;';
		hs+=cssPrefix + 'transform-origin: 50% 50%;';
		hs+='visibility: inherit;';
		this._image_110.setAttribute('style',hs);
		this._image_110__img=document.createElement('img');
		this._image_110__img.setAttribute('src',basePath + 'skin images/image_110.png');
		this._image_110__img.setAttribute('style','position: absolute;top: 0px;left: 0px;');
		me.player.checkLoaded.push(this._image_110__img);
		this._image_110.appendChild(this._image_110__img);
		this.divSkin.appendChild(this._image_110);
		this._image_10=document.createElement('div');
		this._image_10.ggId='Image 10'
		this._image_10.ggParameter={ rx:0,ry:0,a:0,sx:1,sy:1 };
		this._image_10.ggVisible=true;
		this._image_10.ggUpdatePosition=function() {
			this.style[domTransition]='none';
			h=this.parentNode.offsetHeight;
			this.style.top=(-42 + h) + 'px';
		}
		hs ='position:absolute;';
		hs+='left: 0px;';
		hs+='top:  -42px;';
		hs+='width: 7px;';
		hs+='height: 42px;';
		hs+=cssPrefix + 'transform-origin: 50% 50%;';
		hs+='visibility: inherit;';
		this._image_10.setAttribute('style',hs);
		this._image_10__img=document.createElement('img');
		this._image_10__img.setAttribute('src',basePath + 'skin images/image_10.png');
		this._image_10__img.setAttribute('style','position: absolute;top: 0px;left: 0px;');
		me.player.checkLoaded.push(this._image_10__img);
		this._image_10.appendChild(this._image_10__img);
		this.divSkin.appendChild(this._image_10);
		this._image_9=document.createElement('div');
		this._image_9.ggId='Image 9'
		this._image_9.ggParameter={ rx:0,ry:0,a:0,sx:1,sy:1 };
		this._image_9.ggVisible=true;
		this._image_9.ggUpdatePosition=function() {
			this.style[domTransition]='none';
			w=this.parentNode.offsetWidth;
			this.style.left=(-7 + w) + 'px';
			h=this.parentNode.offsetHeight;
			this.style.top=(-42 + h) + 'px';
		}
		hs ='position:absolute;';
		hs+='left: -7px;';
		hs+='top:  -42px;';
		hs+='width: 7px;';
		hs+='height: 42px;';
		hs+=cssPrefix + 'transform-origin: 50% 50%;';
		hs+='visibility: inherit;';
		this._image_9.setAttribute('style',hs);
		this._image_9__img=document.createElement('img');
		this._image_9__img.setAttribute('src',basePath + 'skin images/image_9.png');
		this._image_9__img.setAttribute('style','position: absolute;top: 0px;left: 0px;');
		me.player.checkLoaded.push(this._image_9__img);
		this._image_9.appendChild(this._image_9__img);
		this.divSkin.appendChild(this._image_9);
		this._button_2=document.createElement('div');
		this._button_2.ggId='Button 2'
		this._button_2.ggParameter={ rx:0,ry:0,a:0,sx:1,sy:1 };
		this._button_2.ggVisible=true;
		this._button_2.ggUpdatePosition=function() {
			this.style[domTransition]='none';
			h=this.parentNode.offsetHeight;
			this.style.top=(-38 + h) + 'px';
		}
		hs ='position:absolute;';
		hs+='left: 6px;';
		hs+='top:  -38px;';
		hs+='width: 27px;';
		hs+='height: 27px;';
		hs+=cssPrefix + 'transform-origin: 50% 50%;';
		hs+='visibility: inherit;';
		hs+='cursor: pointer;';
		this._button_2.setAttribute('style',hs);
		this._button_2__img=document.createElement('img');
		this._button_2__img.setAttribute('src',basePath + 'skin images/button_2.png');
		this._button_2__img.setAttribute('style','position: absolute;top: 0px;left: 0px;');
		me.player.checkLoaded.push(this._button_2__img);
		this._button_2.appendChild(this._button_2__img);
		this._button_2.onmouseout=function () {
			me.elementMouseDown['button_2']=false;
		}
		this._button_2.onmousedown=function () {
			me.elementMouseDown['button_2']=true;
		}
		this._button_2.onmouseup=function () {
			me.elementMouseDown['button_2']=false;
		}
		this._button_2.ontouchend=function () {
			me.elementMouseDown['button_2']=false;
		}
		this.divSkin.appendChild(this._button_2);
		this._image_11=document.createElement('div');
		this._image_11.ggId='Image 11'
		this._image_11.ggParameter={ rx:0,ry:0,a:0,sx:1,sy:1 };
		this._image_11.ggVisible=true;
		this._image_11.ggUpdatePosition=function() {
			this.style[domTransition]='none';
			w=this.parentNode.offsetWidth;
			this.style.left=(-123 + w) + 'px';
			h=this.parentNode.offsetHeight;
			this.style.top=(-25 + h) + 'px';
		}
		hs ='position:absolute;';
		hs+='left: -123px;';
		hs+='top:  -25px;';
		hs+='width: 112px;';
		hs+='height: 19px;';
		hs+=cssPrefix + 'transform-origin: 50% 50%;';
		hs+='visibility: inherit;';
		this._image_11.setAttribute('style',hs);
		this._image_11__img=document.createElement('img');
		this._image_11__img.setAttribute('src',basePath + 'skin images/image_11.png');
		this._image_11__img.setAttribute('style','position: absolute;top: 0px;left: 0px;');
		me.player.checkLoaded.push(this._image_11__img);
		this._image_11.appendChild(this._image_11__img);
		this._image_11.onclick=function () {
			me.player.openUrl("http:\/\/www.fullscreen360.com","");
		}
		this.divSkin.appendChild(this._image_11);
		this._button_4=document.createElement('div');
		this._button_4.ggId='Button 4'
		this._button_4.ggParameter={ rx:0,ry:0,a:0,sx:1,sy:1 };
		this._button_4.ggVisible=true;
		this._button_4.ggUpdatePosition=function() {
			this.style[domTransition]='none';
			h=this.parentNode.offsetHeight;
			this.style.top=(-38 + h) + 'px';
		}
		hs ='position:absolute;';
		hs+='left: 111px;';
		hs+='top:  -38px;';
		hs+='width: 27px;';
		hs+='height: 27px;';
		hs+=cssPrefix + 'transform-origin: 50% 50%;';
		hs+='visibility: inherit;';
		hs+='cursor: pointer;';
		this._button_4.setAttribute('style',hs);
		this._button_4__img=document.createElement('img');
		this._button_4__img.setAttribute('src',basePath + 'skin images/button_4.png');
		this._button_4__img.setAttribute('style','position: absolute;top: 0px;left: 0px;');
		me.player.checkLoaded.push(this._button_4__img);
		this._button_4.appendChild(this._button_4__img);
		this._button_4.onmouseout=function () {
			me.elementMouseDown['button_4']=false;
		}
		this._button_4.onmousedown=function () {
			me.elementMouseDown['button_4']=true;
		}
		this._button_4.onmouseup=function () {
			me.elementMouseDown['button_4']=false;
		}
		this._button_4.ontouchend=function () {
			me.elementMouseDown['button_4']=false;
		}
		this.divSkin.appendChild(this._button_4);
		this._button_6=document.createElement('div');
		this._button_6.ggId='Button 6'
		this._button_6.ggParameter={ rx:0,ry:0,a:0,sx:1,sy:1 };
		this._button_6.ggVisible=true;
		this._button_6.ggUpdatePosition=function() {
			this.style[domTransition]='none';
			h=this.parentNode.offsetHeight;
			this.style.top=(-38 + h) + 'px';
		}
		hs ='position:absolute;';
		hs+='left: 80px;';
		hs+='top:  -38px;';
		hs+='width: 27px;';
		hs+='height: 27px;';
		hs+=cssPrefix + 'transform-origin: 50% 50%;';
		hs+='visibility: inherit;';
		hs+='cursor: pointer;';
		this._button_6.setAttribute('style',hs);
		this._button_6__img=document.createElement('img');
		this._button_6__img.setAttribute('src',basePath + 'skin images/button_6.png');
		this._button_6__img.setAttribute('style','position: absolute;top: 0px;left: 0px;');
		me.player.checkLoaded.push(this._button_6__img);
		this._button_6.appendChild(this._button_6__img);
		this._button_6.onmouseout=function () {
			me.elementMouseDown['button_6']=false;
		}
		this._button_6.onmousedown=function () {
			me.elementMouseDown['button_6']=true;
		}
		this._button_6.onmouseup=function () {
			me.elementMouseDown['button_6']=false;
		}
		this._button_6.ontouchend=function () {
			me.elementMouseDown['button_6']=false;
		}
		this.divSkin.appendChild(this._button_6);
		this._button_7=document.createElement('div');
		this._button_7.ggId='Button 7'
		this._button_7.ggParameter={ rx:0,ry:0,a:0,sx:1,sy:1 };
		this._button_7.ggVisible=true;
		this._button_7.ggUpdatePosition=function() {
			this.style[domTransition]='none';
			h=this.parentNode.offsetHeight;
			this.style.top=(-38 + h) + 'px';
		}
		hs ='position:absolute;';
		hs+='left: 37px;';
		hs+='top:  -38px;';
		hs+='width: 27px;';
		hs+='height: 27px;';
		hs+=cssPrefix + 'transform-origin: 50% 50%;';
		hs+='visibility: inherit;';
		hs+='cursor: pointer;';
		this._button_7.setAttribute('style',hs);
		this._button_7__img=document.createElement('img');
		this._button_7__img.setAttribute('src',basePath + 'skin images/button_7.png');
		this._button_7__img.setAttribute('style','position: absolute;top: 0px;left: 0px;');
		me.player.checkLoaded.push(this._button_7__img);
		this._button_7.appendChild(this._button_7__img);
		this._button_7.onmouseout=function () {
			me.elementMouseDown['button_7']=false;
		}
		this._button_7.onmousedown=function () {
			me.elementMouseDown['button_7']=true;
		}
		this._button_7.onmouseup=function () {
			me.elementMouseDown['button_7']=false;
		}
		this._button_7.ontouchend=function () {
			me.elementMouseDown['button_7']=false;
		}
		this.divSkin.appendChild(this._button_7);
		this._button_5=document.createElement('div');
		this._button_5.ggId='Button 5'
		this._button_5.ggParameter={ rx:0,ry:0,a:0,sx:1,sy:1 };
		this._button_5.ggVisible=true;
		this._button_5.ggUpdatePosition=function() {
			this.style[domTransition]='none';
			h=this.parentNode.offsetHeight;
			this.style.top=(-16 + h) + 'px';
		}
		hs ='position:absolute;';
		hs+='left: 18px;';
		hs+='top:  -16px;';
		hs+='width: 35px;';
		hs+='height: 13px;';
		hs+=cssPrefix + 'transform-origin: 50% 50%;';
		hs+='visibility: inherit;';
		hs+='cursor: pointer;';
		this._button_5.setAttribute('style',hs);
		this._button_5__img=document.createElement('img');
		this._button_5__img.setAttribute('src',basePath + 'skin images/button_5.png');
		this._button_5__img.setAttribute('style','position: absolute;top: 0px;left: 0px;');
		me.player.checkLoaded.push(this._button_5__img);
		this._button_5.appendChild(this._button_5__img);
		this.divSkin.appendChild(this._button_5);
		this._button_8=document.createElement('div');
		this._button_8.ggId='Button 8'
		this._button_8.ggParameter={ rx:0,ry:0,a:0,sx:1,sy:1 };
		this._button_8.ggVisible=true;
		this._button_8.ggUpdatePosition=function() {
			this.style[domTransition]='none';
			h=this.parentNode.offsetHeight;
			this.style.top=(-15 + h) + 'px';
		}
		hs ='position:absolute;';
		hs+='left: 91px;';
		hs+='top:  -15px;';
		hs+='width: 35px;';
		hs+='height: 13px;';
		hs+=cssPrefix + 'transform-origin: 50% 50%;';
		hs+='visibility: inherit;';
		hs+='cursor: pointer;';
		this._button_8.setAttribute('style',hs);
		this._button_8__img=document.createElement('img');
		this._button_8__img.setAttribute('src',basePath + 'skin images/button_8.png');
		this._button_8__img.setAttribute('style','position: absolute;top: 0px;left: 0px;');
		me.player.checkLoaded.push(this._button_8__img);
		this._button_8.appendChild(this._button_8__img);
		this.divSkin.appendChild(this._button_8);
		this.divSkin.ggUpdateSize=function(w,h) {
			me.updateSize(me.divSkin);
		}
		this.divSkin.ggLoaded=function() {
		}
		this.divSkin.ggReLoaded=function() {
		}
		this.divSkin.ggEnterFullscreen=function() {
		}
		this.divSkin.ggExitFullscreen=function() {
		}
		this.skinTimerEvent();
	};
	this.hotspotProxyClick=function(id) {
	}
	this.hotspotProxyOver=function(id) {
	}
	this.hotspotProxyOut=function(id) {
	}
	this.skinTimerEvent=function() {
		setTimeout(function() { me.skinTimerEvent(); }, 10);
		if (me.elementMouseDown['button_2']) {
			me.player.changePan(0.5,true);
		}
		if (me.elementMouseDown['button_4']) {
			me.player.changeFovLog(0.5,true);
		}
		if (me.elementMouseDown['button_6']) {
			me.player.changeFovLog(-0.5,true);
		}
		if (me.elementMouseDown['button_7']) {
			me.player.changePan(-0.5,true);
		}
	};
	this.addSkin();
};
