function lib_bwcheck(){ //Browsercheck (needed)
	this.ver=navigator.appVersion
	this.agent=navigator.userAgent
	this.dom=document.getElementById?1:0
	this.opera5=this.agent.indexOf("Opera 5")>-1
	this.ie5=(this.ver.indexOf("MSIE 5")>-1 && this.dom && !this.opera5)?1:0; 
	this.ie6=(this.ver.indexOf("MSIE 6")>-1 && this.dom && !this.opera5)?1:0;
	this.ie4=(document.all && !this.dom && !this.opera5)?1:0;
	this.ie=this.ie4||this.ie5||this.ie6
	this.mac=this.agent.indexOf("Mac")>-1
	this.ns6=(this.dom && parseInt(this.ver) >= 5) ?1:0; 
	this.ns4=(document.layers && !this.dom)?1:0;
	this.bw=(this.ie6 || this.ie5 || this.ie4 || this.ns4 || this.ns6 || this.opera5)
	return this
}
function sideInit(){
	oPanoDesc=new makeObj('divPanoDesc')	
	godetail(0,1)
}
function settext(objname,s){
	if (document.getElementById)
		document.getElementById(objname).innerHTML = s;
	else if (document.all)
		document.all[objname].innerHTML = s;
	else if (document.layers && document.layers[objname]) {
		document.layers[objname].document.open();
		document.layers[objname].document.write(s);
		document.layers[objname].document.close();
	}
}
function makeObj(obj,nest){
	nest = (!nest) ? "":'document.'+nest+'.';
	this.elm = bw.ns4?eval(nest+"document.layers." +obj):bw.ie4?document.all[obj]:document.getElementById(obj);
   	this.css = bw.ns4?this.elm:this.elm.style;
	this.scrollWidth = bw.ns4?this.css.document.width:this.elm.offsetWidth;
	this.x = bw.ns4?this.css.left:this.elm.offsetLeft;
	this.y = bw.ns4?this.css.top:this.elm.offsetTop;
	return this;
}
function godetail(n,init){
	getPanoParams(n)
	settext('divPanoDesc',slCat+': '+slDesc)
	if(!init){
		document.ptviewer.newPano('{file='+slPic+'}{pan='+slPan+'}{tilt='+slTilt+'}{fov='+slFov+'}')		
		DoAutorotationStart();
	}
}
function DoZoomIn(){document.ptviewer.startAutoPan(0.0,0.0,1.0/1.01)}
function DoZoomOut(){document.ptviewer.startAutoPan(0.0,0.0,1.01)}
function DoReset(){DoAutorotationStart();document.ptviewer.gotoView(slPan,slTilt,slFov);}
function DoAutorotationStop(){document.ptviewer.stopAutoPan()}
function DoAutorotationStart(){document.ptviewer.startAutoPan(parseFloat(slRotSpeed),slP1,slP2)}
function pano(){
	getPanoParams(0)
	cc=''
	+'<map name="control"><area shape=rect coords="0,0,14,14"  alt="Autorotation Start" href="javascript:DoAutorotationStart()">'
	+'<area shape=rect coords="14,0,28,14" alt="Autorotation Stop"  href="javascript:DoAutorotationStop()">'
	+'<area shape=rect coords="28,0,42,14" alt="Zoom In" href="javascript:DoZoomIn()">'
	+'<area shape=rect coords="42,0,56,14" alt="Zoom Out" href="javascript:DoZoomOut()">'
	+'<area shape=rect coords="56,0,70,14" alt="Reset" href="javascript:DoReset()"></map>'
	slZout=95;slZin=65;slP1=0.0;slP2=1.0;slStyle1="{font-family:Tahoma,Arial;font-size:8pt;font-weight:bold;color:#999999;}"
	document.write(cc+"<table border=0 cellspacing=0 cellpadding=0><tr><td><table border=0 cellspacing=1 cellpadding=0 bgcolor=#CEC2A8><tr><td>"
	+"<applet name=ptviewer archive=ptviewer.jar code=ptviewer.class width=320 height=200 mayscript=true>"
	+"<PARAM name=file value=ptviewer:0><PARAM name=pano0 value={file="+slPic+"}{pan="+slPan+"}{tilt="+slTilt+"}"
	+"{fov="+slFov+"}{fovmax="+slZout+"}{fovmin="+slZin+"}{auto="+slRotSpeed+"}></applet></td></tr></table></td></tr>"
	+"<tr><td><img src=control.gif alt=\"\" border=0 usemap=#control height=14 width=322></td></tr>"
	+"<tr><td align=center><div id=\"divPanoDesc\"></div></td></tr></table>");
}
function getPanoParams(n){
	eval(pArr[n])
}
var pN=-1
var bw=new lib_bwcheck()
if (bw.bw) window.onload = sideInit;

