// JavaScript Document
var ind = -1;
function getobj(id) {
      return document.getElementById ? document.getElementById(id) : document.all[id];
}

function urlParse() {
	var urlquery = location.href.split("?");
	var url_param = new Array();
	if (urlquery.length > 1) {
		url_param = urlquery[1].split("&");
	}
	
	return url_param;
}



// Figure out which VR tour to use
function getEmbed() {
	var url_param = urlParse();

  // adding the or "amp" thing in the javascript was quicker and easier than fixing the panos
	if (url_param.length > 0) {
		if (url_param[0] == "farend" || url_param[0] == "amp;farend") {
			document.write("<embed id=\"tour\" src=\"farend.mov\">");
		}
		else if (url_param[0] == "end" || url_param[0] == "amp;end") {
			document.write("<embed id=\"tour\" src=\"end.mov\">");
		}
		else if (url_param[0] == "middle02" || url_param[0] == "amp;middle02") {
			document.write("<embed id=\"tour\" src=\"middle02.mov\">");
		}
		else if (url_param[0] == "middle01" || url_param[0] == "amp;middle01") {
			document.write("<embed id=\"tour\" src=\"middle01.mov\">");
		}
		else {
		  document.write("<embed id=\"tour\" src=\"entry.mov\">");
		}
	}
	else {
		document.write("<embed id=\"tour\" src=\"entry.mov\">");
	}
}


// Writes out the code for the map at the left of the screen
function navmap() {
	document.write("<img src=\"map.gif\" usemap=\"#mapmap\" style=\"border:0\" />");
	document.write("<map name=\"mapmap\">");
	document.write("<area coords=\"44,260,14\" shape=\"circle\" href=\"index.html\" alt=\"01\">");
	document.write("<area coords=\"34,220,14\" shape=\"circle\" href=\"index.html?middle01\" alt=\"02\">");
	document.write("<area coords=\"34,180,12\" shape=\"circle\" href=\"index.html?middle02\" alt=\"03\">");
	document.write("<area coords=\"43,115,13\" shape=\"circle\" href=\"index.html?end\" alt=\"04\">");
	document.write("<area coords=\"43,70,13\" shape=\"circle\" href=\"index.html?farend\" alt=\"05\">");
	document.write("</map><br />");
}
