// JavaScript Document
function RC_openBRWindow(theURL,winName,features) { //v2.0
	var theFuncString = "window.open('"+theURL+"','"+winName+"','"+features+"');"+winName+".focus();"
	eval(winName + " = " + theFuncString);
}

function writePano(thePano, scaleString, showController) {
	if (!showController) {
		showController = "false";
	}
	var str='';
	str+='<object classid="clsid:02BF25D5-8C17-4B23-BC80-D3488ABDDC6B" codebase="http:\/\/www.apple.com\/qtactivex\/qtplugin.cab" height="100%" width="100%" id="panorama">';
	str+='<param name="src" value="../panoramas/'
	str+=thePano;
	str+='">'
	str+='<param name="controller" value="'
	str+=showController;
	str+='">';
	str+='<param name="bgcolor" value="#ffffee">';
	str+='<param name="kioskmode" value="true">';
	str+='<param name="moviename" value="spincontrolled">';
	str+='<param name="scale" value="';
	str+=scaleString;
	str+='">';
	str+='<param name="enablejavascript" value="true">';
	str+='<param name="autoplay" value="true">';
	str+='<embed  width="100%" height="100%"';
	str+='pluginspage="http:\/\/www.apple.com\/quicktime\/download\/"';
	str+='src="'
	str+=thePano;
	str+='" type="video\/quicktime"';
	str+='controller="'
	str+=showController
	str+='"';
	str+='autoplay="true"';
	str+='enablejavascript="true"';
	str+='moviename="spincontrolled"';
	str+='kioskmode="true"';
	str+='scale="';
	str+=scaleString;
	str+='">'
	str+='<\/object>';
	document.write(str);
}

function fullScreen(theURL) {
	window.open(theURL, 'fullscreen' , 'resizable=yes, status=yes, scrollbars=no');
}

function fullSize() {
	window.focus();
	window.moveTo(0,0);
	window.resizeTo(window.screen.availWidth,window.screen.availHeight);
}

function closeLink() {
	if (window.name) {
		document.write('<a href="#" id="closelink" onclick="window.close()" title="Close this window">[ X ]<\/a>');
		getStyleObject("returnToIndex").visibility = "hidden";
	}
}

function getStyleObject(objectId) {
	// cross-browser function to get an object's style object given its id
	if(document.getElementById && document.getElementById(objectId)) {
	// W3C DOM
	return document.getElementById(objectId).style;
	} else if (document.all && document.all(objectId)) {
	// MSIE 4 DOM
	return document.all(objectId).style;
	} else if (document.layers && document.layers[objectId]) {
	// NN 4 DOM.. note: this won't find nested layers
	return document.layers[objectId];
	} else {
	return false;
	}
} // getStyleObject

function writeJavaPano(panoFile, viewString) {
	var str='';
	str+='<applet name="ptviewer" archive="..\/media\/ptviewer.jar" code="ptviewer.class" width="508" height="412">';
	str+='<param name=file value="ptviewer:0">';
	str+='<param name=view_x value="12">';
	str+='<param name=view_y value="15">';
	str+='<param name=view_width value="400">';
	str+='<param name=view_height value="300">';
	str+='<param name=frame value="..\/media\/z-viewer3.gif">';
	str+='<param name=wait value="..\/media\/z-loading3.gif">';
	str+='<param name=bar_x value="105">';
	str+='<param name=bar_y value="171">';
	str+='<param name=bar_width value="225">';
	str+='<param name=bar_height value="15">';
	str+='<param name=shotspot0 value=" x123 y333 a301 b398 u\'ptviewer:stopAutoPan()\' ">';
	str+='<param name=shotspot1 value=" x167 y337 a213 b371 p i\'..\/media\/z-arrow-left.gif\' u\'ptviewer:startAutoPan(-0.3,0,1)\' ">';
	str+='<param name=shotspot2 value=" x215 y358 a268 b394 p i\'..\/media\/z-arrow-right.gif\' u\'ptviewer:startAutoPan(0.3,0,1)\' ">';
	str+='<param name=shotspot3 value=" x438 y77 a491 b240 u\'ptviewer:stopAutoPan()\' ">';
	str+='<param name=shotspot4 value=" x459 y120 a490 b162 p i\'..\/media\/z-arrow-up.gif\' u\'ptviewer:startAutoPan(0,0.3,1)\' ">';
	str+='<param name=shotspot5 value=" x438 y165 a472 b209 p i\'..\/media\/z-arrow-down.gif\' u\'ptviewer:startAutoPan(0,-0.3,1)\' ">';
	str+='<param name=shotspot6 value=" x389 y352 a495 b405 u\'ptviewer:stopAutoPan()\' ">';
	str+='<param name=shotspot7 value=" x443 y358 a476 b387 p i\'..\/media\/z-arrow-in.gif\' u\'ptviewer:startAutoPan(0,0,0.995)\' ">';
	str+='<param name=shotspot8 value=" x407 y358 a439 b387 p i\'..\/media\/z-arrow-out.gif\' u\'ptviewer:startAutoPan(0,0,1.005)\' ">';
	str+='<param name=pano0 value="{file=..\/media\/';
	str+=panoFile;
	str+='}';
	str+=viewString;
	str+='{auto=-0.0}">';
	str+='<\/applet>';
	document.write(str);
}
