function openWindow(sURL, width, height) {
 var content = "<img src=\"" + sURL + "\" /><br />";
 createWindow(width, height, content);
}
function openPopup(sURL, width, height) {
 var sFeatures = "top=50,left=50,height=" + height + ",width=" + width + ",status=yes,scrollbars=no,resizable=1,menubar=";
 var win = window.open(sURL,"_popup",sFeatures);
 win.focus();
}
function openTour(code) {
 var image = '/images/vt/' + code + '_large.jpg';
 openTourImage(image);
}
function openTourImage(image) {
 var content = '<applet code="a3d.ImageRenderApplet.class" archive="apvp.jar" codebase="/custom" name="apv" width="600" height="382" align="center">';
 content += '<param name="regkey" value="971111081121121011051141101161011211124611499">';
 content += '<param name="wait" value="/custom/loading.gif">';
 content += '<param name="file" value="' + image + '">';
 content += '<param name="quality" value="2">';
 content += '<param name="fov" value="110">';
 content += '<param name="pano" value="Sphere">';
 content += '<param name="auto" value="10">';
 content += '<param name="panotilt" value="0">';
 content += '<param name="bar_show" value="1">';
 content += '<param name="StartZoomIn" value="a">';
 content += '<param name="StartZoomOut" value="z">';
 content += '</applet><br /><br />';
 content += "Click and drag for viewer control. 'A' button zooms in. 'Z' button zooms out.";
 createWindow(620, 420, content);
}
function createWindow(width, height, content) {
        if (width == '') {
         width = 600;
        }
        if (height == '') {
         height = 600;
        }
	var winHeight = height + 240;
	var winWidth = width + 40;
	var sFeatures = "top=50,left=50,height=" + winHeight + ",width=" + winWidth + ",status=yes,scrollbars=no,resizable=1,menubar=";
	var win = window.open("","_newwindow",sFeatures);
	win.resizeTo(winWidth, winHeight);
	win.document.writeln("<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Transitional//EN\" \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd\">");
	win.document.writeln("<html>");
	win.document.writeln("<head>");
	win.document.writeln("<style>");
	win.document.writeln("body {color: #FFFFFF; font-family: serif; font-size: 8pt; background-color: black; } a { color: white; }");
	win.document.writeln("</style>");
	win.document.writeln("</head>");
	win.document.writeln("<body>");
        win.document.writeln("<div align='center'>");
        win.document.writeln(content);
	win.document.writeln("<br /><br /><a href=\"javascript:window.close()\">Close Window</a>");
	win.document.writeln("</div>");
	win.document.writeln("</body>");
	win.document.writeln("</html>");
        win.document.close();
	win.focus();
}
