//window.onerror = null;
browserName = navigator.appName;
browserVer = parseInt(navigator.appVersion);

if (browserVer >= 3) version = "n3";
else version = "n2";
if (version == "n3") {
	ordealup = new Image;			ordealup.src = "GIFs/ordealup.gif";
	ordealdn = new Image;			ordealdn.src = "GIFs/ordealdn.gif";
	brotherhoodup = new Image;		brotherhoodup.src = "GIFs/brotherhoodup.gif";
	brotherhooddn = new Image;		brotherhooddn.src = "GIFs/brotherhooddn.gif";
	programup = new Image;			programup.src = "GIFs/programup.gif";
	programdn = new Image;			programdn.src = "GIFs/programdn.gif";
	historyup = new Image;			historyup.src = "GIFs/historyup.gif";
	historydn = new Image;			historydn.src = "GIFs/historydn.gif";

	ordeal1up = new Image;			ordeal1up.src = "GIFs/ordeal1up.gif";
	ordeal2up = new Image;			ordeal2up.src = "GIFs/ordeal2up.gif";
	ordeal3up = new Image;			ordeal3up.src = "GIFs/ordeal3up.gif";
	brotherhood1up = new Image;		brotherhood1up.src = "GIFs/brotherhood1up.gif";
	brotherhood2up = new Image;		brotherhood2up.src = "GIFs/brotherhood2up.gif";
	brotherhood3up = new Image;		brotherhood3up.src = "GIFs/brotherhood3up.gif";
	programs1up = new Image;		programs1up.src = "GIFs/programs1up.gif";
	programs2up = new Image;		programs2up.src = "GIFs/programs2up.gif";
	programs3up = new Image;		programs3up.src = "GIFs/programs3up.gif";
	history1up = new Image;			history1up.src = "GIFs/history1up.gif";
	history2up = new Image;			history2up.src = "GIFs/history2up.gif";
	history3up = new Image;			history3up.src = "GIFs/history3up.gif";
	ordeal1dn = new Image;			ordeal1dn.src = "GIFs/ordeal1dn.gif";
	ordeal2dn = new Image;			ordeal2dn.src = "GIFs/ordeal2dn.gif";
	ordeal3dn = new Image;			ordeal3dn.src = "GIFs/ordeal3dn.gif";
	brotherhood1dn = new Image;		brotherhood1dn.src = "GIFs/brotherhood1dn.gif";
	brotherhood2dn = new Image;		brotherhood2dn.src = "GIFs/brotherhood2dn.gif";
	brotherhood3dn = new Image;		brotherhood3dn.src = "GIFs/brotherhood3dn.gif";
	program1dn = new Image;			program1dn.src = "GIFs/program1dn.gif";
	program2dn = new Image;			program2dn.src = "GIFs/program2dn.gif";
	program3dn = new Image;			program3dn.src = "GIFs/program3dn.gif";
	history1dn = new Image;			history1dn.src = "GIFs/history1dn.gif";
	history2dn = new Image;			history2dn.src = "GIFs/history2dn.gif";
	history3dn = new Image;			history3dn.src = "GIFs/history3dn.gif";
	subnav1 = new Image;			subnav1.src = "GIFs/blank.gif";
	subnav2 = new Image;			subnav2.src = "GIFs/blank.gif";
	subnav3 = new Image;			subnav3.src = "GIFs/blank.gif";
	SUBNAVIMG1 = new Image;			
	SUBNAVIMG2 = new Image;	
	SUBNAVIMG3 = new Image;	
	SUBNAVIMG1up = new Image;		SUBNAVIMG1up.src = "GIFs/history1.gif"
	SUBNAVIMG1dn = new Image;		SUBNAVIMG1dn.src = "GIFs/history1.gif"
	SUBNAVIMG2up = new Image;		SUBNAVIMG2up.src = "GIFs/history2.gif"
	SUBNAVIMG2dn = new Image;		SUBNAVIMG2dn.src = "GIFs/history2.gif"
	SUBNAVIMG3up = new Image;		SUBNAVIMG3up.src = "GIFs/history3.gif"
	SUBNAVIMG3dn = new Image;		SUBNAVIMG3dn.src = "GIFs/history3.gif"	
}

function flip (imageID,objectName) {
if (version == "n3") {document.images[imageID].src = eval(objectName + ".src");}
}

//  ----- MATT'S NAVBAR VARIABLE CODE ------	
var navID;
var subnavID;
var topnavID;
var subnavlink1 = "work1.html";
var subnavlink2 = "work2.html";
var subnavlink3 = "work3.html";

function setnavID(navID) {
	subnavID = navID;
	topnavID = navID;
	setsubnav(navID);
	settopnav(navID);
}

function settopnav() {
	if (topnavID == "ordeal") {
		flip('ordeal','ordealdn');
		flip('brotherhood','brotherhoodup');
		flip('program','programup');
		flip('history','historyup');
		}
	if (topnavID == "brotherhood") {
		flip('ordeal','ordealup');
		flip('brotherhood','brotherhooddn');
		flip('program','programup');
		flip('history','historyup');
		}
	if (topnavID == "program") {
		flip('ordeal','ordealup');
		flip('brotherhood','brotherhoodup');
		flip('program','programdn');
		flip('history','historyup');
		}
	if (topnavID == "history") {
		flip('ordeal','ordealup');
		flip('brotherhood','brotherhoodup');
		flip('program','programup');
		flip('history','historydn');
		}
	if (topnavID == "blank") {
		flip('ordeal','ordealup');
		flip('brotherhood','brotherhoodup');
		flip('program','programup');
		flip('history','historyup');
		}
}

function setsubnav(subnavID) {						// Reset variables for sub-navbars
 	if (subnavID == "ordeal") {						// Set the subnavbars to "Ordeal"
		SUBNAVIMG1.src = "GIFs/ordeal1up.gif";
		SUBNAVIMG1up.src = "GIFs/ordeal1up.gif";
		SUBNAVIMG1dn.src = "GIFs/ordeal1dn.gif";
		SUBNAVIMG2.src = "GIFs/ordeal2up.gif";
		SUBNAVIMG2up.src = "GIFs/ordeal2up.gif";
		SUBNAVIMG2dn.src = "GIFs/ordeal2dn.gif";
		SUBNAVIMG3.src = "GIFs/ordeal3up.gif";
		SUBNAVIMG3up.src = "GIFs/ordeal3up.gif";
		SUBNAVIMG3dn.src = "GIFs/ordeal3dn.gif";
		flip('SUBNAVIMG1','SUBNAVIMG1up');
		flip('SUBNAVIMG2','SUBNAVIMG2up');
		flip('SUBNAVIMG3','SUBNAVIMG3up'); 
		document.links[6].href = "OR_Preo.php";
		document.links[7].href = "OR_Basic.php";
		document.links[8].href = "OR_Cere.php";
 		}
 	if (subnavID == 'brotherhood') {				// Set the subnavbars to "Brotherhood"
		SUBNAVIMG1.src = "GIFs/brotherhood1up.gif";
		SUBNAVIMG1up.src = "GIFs/brotherhood1up.gif";
		SUBNAVIMG1dn.src = "GIFs/brotherhood1dn.gif";
		SUBNAVIMG2.src = "GIFs/brotherhood2up.gif";
		SUBNAVIMG2up.src = "GIFs/brotherhood2up.gif";
		SUBNAVIMG2dn.src = "GIFs/brotherhood2dn.gif";
		SUBNAVIMG3.src = "GIFs/brotherhood3up.gif";
		SUBNAVIMG3up.src = "GIFs/brotherhood3up.gif";
		SUBNAVIMG3dn.src = "GIFs/brotherhood3dn.gif";
		flip('SUBNAVIMG1','SUBNAVIMG1up');
		flip('SUBNAVIMG2','SUBNAVIMG2up');
		flip('SUBNAVIMG3','SUBNAVIMG3up');
		document.links[6].href = "BH_Main.php";
		document.links[7].href = "BH_Asmt.php";
		document.links[8].href = "#";
 		}
 	if (subnavID == 'program') {					// Set the subnavbars to "Program"
		SUBNAVIMG1.src = "GIFs/program1up.gif";
		SUBNAVIMG1up.src = "GIFs/program1up.gif";
		SUBNAVIMG1dn.src = "GIFs/program1dn.gif";
		SUBNAVIMG2.src = "GIFs/program2up.gif";
		SUBNAVIMG2up.src = "GIFs/program2up.gif";
		SUBNAVIMG2dn.src = "GIFs/program2dn.gif";
		SUBNAVIMG3.src = "GIFs/program3up.gif";
		SUBNAVIMG3up.src = "GIFs/program3up.gif";
		SUBNAVIMG3dn.src = "GIFs/program3dn.gif";
		flip('SUBNAVIMG1','SUBNAVIMG1up');
		flip('SUBNAVIMG2','SUBNAVIMG2up');
		flip('SUBNAVIMG3','SUBNAVIMG3up');
		document.links[6].href = "PR_Nat.php";
		document.links[7].href = "PR_Loc.php";
		document.links[8].href = "PR_Adult.php";
 		}
 	if (subnavID == 'history') {					// Set the subnavbars to "History"
		SUBNAVIMG1.src = "GIFs/history1.gif";
		SUBNAVIMG1up.src = "GIFs/history1.gif";
		SUBNAVIMG1dn.src = "GIFs/history1.gif";
		SUBNAVIMG2.src = "GIFs/history2.gif";
		SUBNAVIMG2up.src = "GIFs/history2.gif";
		SUBNAVIMG2dn.src = "GIFs/history2.gif";
		SUBNAVIMG3.src = "GIFs/history3.gif";
		SUBNAVIMG3up.src = "GIFs/history3.gif";
		SUBNAVIMG3dn.src = "GIFs/history3.gif";
		flip('SUBNAVIMG1','SUBNAVIMG1up');
		flip('SUBNAVIMG2','SUBNAVIMG2up');
		flip('SUBNAVIMG3','SUBNAVIMG3up');
		document.links[6].href = "#";
		document.links[7].href = "#";
		document.links[8].href = "#";
 		}
 	if (subnavID == 'blank') {					// Set the subnavbars to "Blank"
		SUBNAVIMG1.src = "GIFs/history1.gif";
		SUBNAVIMG1up.src = "GIFs/history1.gif";
		SUBNAVIMG1dn.src = "GIFs/history1.gif";
		SUBNAVIMG2.src = "GIFs/history2.gif";
		SUBNAVIMG2up.src = "GIFs/history2.gif";
		SUBNAVIMG2dn.src = "GIFs/history2.gif";
		SUBNAVIMG3.src = "GIFs/history3.gif";
		SUBNAVIMG3up.src = "GIFs/history3.gif";
		SUBNAVIMG3dn.src = "GIFs/history3.gif";
		flip('SUBNAVIMG1','SUBNAVIMG1up');
		flip('SUBNAVIMG2','SUBNAVIMG2up');
		flip('SUBNAVIMG3','SUBNAVIMG3up');
		document.links[6].href = "#";
		document.links[7].href = "#";
		document.links[8].href = "#";
 		}
}

