﻿window.onload = initForm;
window.onunload = function() {};

function initForm() {
	document.getElementById("links").selectedIndex = 0;
	document.getElementById("links").onchange = jumpPage;
	AllLinks = document.getElementsByTagName("a");
	for (i=0; i< AllLinks.length; i++)
		if (AllLinks[i].href.indexOf("moreinfo")>-1)
			AllLinks[i].onclick = windowPopUpInfo;
}

function jumpPage()	{
	var newLoc = document.getElementById("links");
	var newPage = newLoc.options[newLoc.selectedIndex].value;
	
	if ((newPage != "") && (newLoc.options[newLoc.selectedIndex].className.indexOf("popup")==-1)) {
		window.location = newPage; return false;
	} else if (newLoc.options[newLoc.selectedIndex].className.indexOf("popup")>-1) windowPopUp();
}

function windowPopUp() {
	newLoc = document.getElementById("links");
	var winX = (screen.width/2); 
	var winY = (screen.height/2); 
	popUp = window.open(newLoc.options[newLoc.selectedIndex].value+".html", newLoc.options[newLoc.selectedIndex].id, "width=" + winX + ",height=" + winY + ",scrollbars=yes");
	return false;
}

function windowPopUpInfo() {
	  var winX = (screen.width/2); 
	  var winY = (screen.height/2); 
	popUp = window.open(this.href, this.id, "width=" + winX + ",height=" + winY + ",scrollbars=yes");
	return false;
}