﻿
function popupWindow(url,ht,wd) {
	
	var windowheight=ht;
	var windowwidth=wd;
	
	//gets top and left positions based on user's resolution so hint window is centered.
	var iMyWidth = (window.screen.width/2) - ((windowheight/2) + 10);
	var iMyHeight = (window.screen.height/2) - ((windowwidth/2) + 50);
	var win2 = window.open(url,"vrtour","status,height=" + windowheight + ",width=" + windowwidth + ",resizable=no,left=" + iMyWidth + ",top=" + iMyHeight + ",screenX=" + iMyWidth + ",screenY=" + iMyHeight + ",scrollbars=yes");
	win2.resizeTo(windowwidth,windowheight);
	win2.focus();
}

function newImage(arg) {
	if (document.images) {
		rslt = new Image();
		rslt.src = arg;
		return rslt;
	}
}

function changeImages() {
	if (document.images && (preloadFlag == true)) {
		for (var i=0; i<changeImages.arguments.length; i+=2) {
			document[changeImages.arguments[i]].src = changeImages.arguments[i+1];
		}
	}
}

var preloadFlag = false;
function preloadImages() {
	if (document.images) {
		groupmenu_02_over = newImage("images/groupmenu_02-over.gif");
		groupmenu_03_over = newImage("images/groupmenu_03-over.gif");
		groupmenu_04_over = newImage("images/groupmenu_04-over.gif");
		groupmenu_05_over = newImage("images/groupmenu_05-over.gif");
		groupmenu_06_over = newImage("images/groupmenu_06-over.gif");
		groupmenu_07_over = newImage("images/groupmenu_07-over.gif");
		vr_header_03_over = newImage("images/vr_header_03-over.gif");
		vr_header_04_over = newImage("images/vr_header_04-over.gif");
		vr_header_05_over = newImage("images/vr_header_05-over.gif");
		vr_header_06_over = newImage("images/vr_header_06-over.gif");
		vr_header_07_over = newImage("images/vr_header_07-over.gif");
		vr_header_08_over = newImage("images/vr_header_08-over.gif");
		vr_header_09_over = newImage("images/vr_header_09-over.gif");
		vr_header_10_over = newImage("images/vr_header_10-over.gif");
		preloadFlag = true;
	}
}

// JScript File

function CreateControl(CLSID, ObjectID, WIDTH, HEIGHT, MOVIE, BGCOLOR)
{
	document.writeln('<object classid="' + CLSID + '" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,0,0" id="' + ObjectID + '" width="' + WIDTH + '" height="' + HEIGHT +'">');
	document.writeln('	<PARAM NAME="movie" VALUE="' + MOVIE + '" />');
	document.writeln('	<PARAM NAME="quality" VALUE="high" />');
	document.writeln('	<PARAM NAME="bgcolor" VALUE="' + BGCOLOR + '" />');
	document.writeln('	<PARAM NAME="wmode" VALUE="opaque" />');
	document.writeln('	<EMBED src="' + MOVIE + '" quality="high" wmode="opaque" bgcolor="' + BGCOLOR + '" WIDTH="' + WIDTH + '" HEIGHT="' + HEIGHT + '" NAME="' + ObjectID + '" ALIGN="" TYPE="application/x-shockwave-flash" PLUGINSPAGE="http://www.macromedia.com/go/getflashplayer"></EMBED>');
	document.writeln('</object>');
}

function VRTour(Image, WIDTH, HEIGHT)
{

	// Begin Copy Of Panoramic Image and Java Script
	document.writeln('<center>');
	document.writeln('	<applet code="ptviewer.class" align="baseline" width="' + WIDTH + '" height="' + HEIGHT + '" archive="ptviewer.jar">');
	document.writeln('		<param name="auto" value=".5">');

	// Image name
	document.writeln('		<PARAM name=file value="' + Image + '">');
	
	document.writeln('		<param name="fov" value="110">');
	document.writeln('		<param name="fovmax" value="130">');
	document.writeln('		<param name="fovmin" value="45">');
	document.writeln('		<param name="pan" value="-25">');
	document.writeln('		<param name="tilt" value="5">');
	document.writeln('		<PARAM name=wait value="images/wait.gif">');
	document.writeln('		<PARAM name=frame value=images/mtnavbar.gif>');

	document.writeln('		<PARAM name=waittime value="500">');
	document.writeln('		<PARAM name=bar_x value="104">');
	document.writeln('		<PARAM name=bar_y value="173">');
	document.writeln('		<PARAM name=bar_height value="7">');
	document.writeln('		<PARAM name=bar_width value="156">');
	document.writeln('		<PARAM name=barcolor value="cccccc">');
	document.writeln('		<PARAM name=bgcolor value="ffffff">');

	// Start Pan & Tilt Reset - First Number is Pan - Second Number is Tilt
	
	document.writeln('		<PARAM name=shotspot0   value=" x5 y237 a32 b260 p u\'ptviewer:moveTo(-25,5,110,40)\' ">');	
	document.writeln('		<PARAM name=shotspot1   value=" x32 y237 a52 b260 p u\'ptviewer:startAutoPan(-0.95,0,1)\' ">');
	document.writeln('		<PARAM name=shotspot2   value=" x52 y237 a78 b245 p u\'ptviewer:startAutoPan(0,0.65,1)\' ">');
	document.writeln('		<PARAM name=shotspot3   value=" x52 y246 a78 b260 p u\'ptviewer:startAutoPan(0,-0.65,1)\' ">');
	document.writeln('		<PARAM name=shotspot4   value=" x78 y237 a99 b260 p u\'ptviewer:startAutoPan(0.95,0,1)\' ">');
	document.writeln('		<PARAM name=shotspot5   value=" x99 y237 a130 b260 p u\'ptviewer:stopAutoPan()\' ">');
	document.writeln('		<PARAM name=shotspot6   value=" x130 y237 a161 b260 p u\'ptviewer:startAutoPan(0,0,0.99)\' ">');
	document.writeln('		<PARAM name=shotspot7   value=" x161 y237 a190 b260 p u\'ptviewer:startAutoPan(0,0,1.01)\' ">');
	document.writeln('		<PARAM name=shotspot8   value=" x191 y237 a215 b260 u\'instructions/index.html\' t\'_blank\' ">');
	
	
	document.writeln('	</applet>');
	document.writeln('	<br>');
	document.writeln('	<FONT size="-1">Click and drag on the image above to control the action.');
	document.writeln('	<BR>');
	document.writeln('	Press "+" to Zoom In and "-" to Zoom Out. <br><BR>');
	document.writeln('</center>');

	// End Copy Of Panoramic Image and Java Script

}