if (navigator.appName.indexOf("WebTV") != -1) { 
	window.location.href = "/html/help/misc/webtv.html"; 
}
biotechon = new Image();
biotechon.src = "../images/biotech-over.gif";
prospectiveon = new Image();
prospectiveon.src = "../images/prospective-over.gif";
currenton = new Image();
currenton.src = "../images/current-over.gif";
researcheron = new Image();
researcheron.src = "../images/researchers-over.gif";
abouton = new Image();
abouton.src = "../images/stakeholders-over.gif";

biotechoff = new Image();
biotechoff.src = "../images/biotech.gif";
prospectiveoff = new Image();
prospectiveoff.src = "../images/prospective.gif";
currentoff = new Image();
currentoff.src = "../images/current.gif";
researcheroff = new Image();
researcheroff.src = "../images/researchers.gif";
aboutoff = new Image();
aboutoff.src = "../images/stakeholders.gif";

//preload About nav images
biotech1on = new Image();
biotech1on.src = "../images/top_nav/about_aboutr.gif";
biotech2on = new Image();
biotech2on.src = "../images/top_nav/about_facilitiesr.gif";
biotech3on = new Image();
biotech3on.src = "../images/top_nav/about_projectsr.gif";
biotech4on = new Image();
biotech4on.src = "../images/top_nav/about_bioethicsr.gif";
biotech5on = new Image();
biotech5on.src = "../images/top_nav/about_contactr.gif";

biotech1off = new Image();
biotech1off.src = "../images/top_nav/about_about.gif";
biotech2off = new Image();
biotech2off.src = "../images/top_nav/about_facilities.gif";
biotech3off = new Image();
biotech3off.src = "../images/top_nav/about_projects.gif";
biotech4off = new Image();
biotech4off.src = "../images/top_nav/about_bioethics.gif";
biotech5off = new Image();
biotech5off.src = "../images/top_nav/about_contact.gif";

//preload Current nav images
current1on = new Image();
current1on.src = "../images/top_nav/current_careerr.gif";
current2on = new Image();
current2on.src = "../images/top_nav/current_grantsr.gif";
current3on = new Image();
current3on.src = "../images/top_nav/current_resourcesr.gif";
current4on = new Image();
current4on.src = "../images/top_nav/current_departmentsr.gif";


current1off = new Image();
current1off.src = "../images/top_nav/current_career.gif";
current2off = new Image();
current2off.src = "../images/top_nav/current_grants.gif";
current3off = new Image();
current3off.src = "../images/top_nav/current_resources.gif";
current4off = new Image();
current4off.src = "../images/top_nav/current_departments.gif";



//preload Prospective nav images
prospective1on = new Image();
prospective1on.src = "../images/top_nav/prospective_admissionsr.gif";
prospective2on = new Image();
prospective2on.src = "../images/top_nav/prospective_departmentsr.gif";
prospective3on = new Image();
prospective3on.src = "../images/top_nav/prospective_grantsr.gif";
prospective4on = new Image();
prospective4on.src = "../images/top_nav/prospective_resourcesr.gif";

prospective1off = new Image();
prospective1off.src = "../images/top_nav/prospective_admissions.gif";
prospective2off = new Image();
prospective2off.src = "../images/top_nav/prospective_departments.gif";
prospective3off = new Image();
prospective3off.src = "../images/top_nav/prospective_grants.gif";
prospective4off = new Image();
prospective4off.src = "../images/top_nav/prospective_resources.gif";

//preload Researcher Images
researcher1on = new Image();
researcher1on.src = "../images/top_nav/researcher_facilitiesr.gif";
researcher2on = new Image();
researcher2on.src = "../images/top_nav/researcher_regulationsr.gif";
researcher3on = new Image();
researcher3on.src = "../images/top_nav/researcher_fundingr.gif";

researcher1off = new Image();
researcher1off.src = "../images/top_nav/researcher_facilities.gif";
researcher2off = new Image();
researcher2off.src = "../images/top_nav/researcher_regulations.gif";
researcher3off = new Image();
researcher3off.src = "../images/top_nav/researcher_funding.gif";



//preload Stakeholders Images
about1on = new Image();
about1on.src = "../images/top_nav/stakeholders_corporater.gif";
about2on = new Image();
about2on.src = "../images/top_nav/stakeholders_governmentr.gif";
about3on = new Image();
about3on.src = "../images/top_nav/stakeholders_agenciesr.gif";

about1off = new Image();
about1off.src = "../images/top_nav/stakeholders_corporate.gif";
about2off = new Image();
about2off.src = "../images/top_nav/stakeholders_government.gif";
about3off = new Image();
about3off.src = "../images/top_nav/stakeholders_agencies.gif";

//get browser type
var bName = navigator.appName;
var browser;

if(bName == "Netscape") {
	browser = "nn";
}

//image rollover for sub navs.
function subOn(subNav, img) {
	if (browser == 'nn') {
		document.layers[subNav].document.images[img].src = eval(img + "on.src");
	} else {
		window.document.images[img].src = eval(img + "on.src");
	}
}

function subOff(subNav, img) {
	if (browser == 'nn') {
		document.layers[subNav].document.images[img].src = eval(img + "off.src");
	} else {
		window.document.images[img].src = eval(img + "off.src");
	}
}

var mainSwitch = 0;
var isModelsOn = false;
var lastLayer;
var lastImgLayer;
var lastImg;
var x1,x2,y1,y2;

function turnOn() {
	mainSwitch = 1;
}


if (window.captureEvents) {
        window.captureEvents(Event.MOUSEMOVE);
        window.onmousemove = mouseTracker;
} else {
        document.onmousemove = mouseTracker;
        
}

function mouseTracker(e) {
	e = e || window.Event || window.event;
    window.pageX = e.pageX || e.clientX;
    window.pageY = e.pageY || e.clientY;

	setTimeout("",3000);

			y1 = 0;				//pixels above nav
			x1 = 0;				//pixels to left of nav
			y2  = 175;			//pixels below nav
			x2 =  800;			//pixels to right of nav

			my1 = 0;			//pixels above model nav
			mx1 = 0;			//pixels to left of model nav
			my2  = 175;			//pixels below model nav
			mx2 =  500;			//pixels to right of model nav
		
		if (isModelsOn == true) {
			if((window.pageX < (mx1-10) || window.pageX > mx2 || window.pageY < (my1-5) || window.pageY > my2) ) {
				hide('models');
			}
		} else if ((window.pageX < (x1-10) || window.pageX > x2 || window.pageY < (y1-5) || window.pageY > y2) && lastLayer != null) {
				hide(lastLayer);
				changeImage(lastImg,lastImg + 'off','false');
				lastLayer = null;
		}
}

function menuSwitch(aLayer,imgName) {
	if (mainSwitch == 1) {
		if (lastLayer != null) {
			hide(lastLayer);
			changeImage(lastImg,lastImg + 'off','false');
		}
		changeImage(imgName,imgName + 'on','false');
		show(aLayer)
		lastLayer = aLayer;
		lastImg = imgName;
	}
}

function changeImage(imgName,imgObj,isLayerOn) {
	if (mainSwitch == 1) {
		if (isModelsOn == true) {
			hide('models');
		}
		if (isLayerOn == 'true' && lastLayer != null) {
			hide(lastLayer);
			lastLayer = null;
			window.document.images[lastImg].src = eval(lastImg + "off.src");
		}
		window.document.images[imgName].src = eval(imgObj + ".src");
	}
}

// hide element  
function hide(aLayer) {
	if (mainSwitch == 1) {
		if (aLayer == 'models') {
			isModelsOn = false;
			subOff('biotech', 'biotech2');
		}
	  	theobjs[aLayer].objHide();
	}
}

// show element
function show(aLayer) {
	if (mainSwitch == 1) {
		if (aLayer == 'models') {
			isModelsOn = true;
			subOn('biotech', 'biotech2');
		}
	   	theobjs[aLayer].objShow();
	}
}

//popup window function
//pass the url, the width, and the height
var theWin

function popup(theURL, width, height) {

	if(theWin == null || theWin.closed) {
		theWin = window.open(theURL, "popup", "toolbar=no,location=no,directories=no,status=yes,menubar=no,scrollbars=no,resizable=no,width=" + width + ",height=" + height + ",top=100,left=100");
	} else {
		theWin.close()
		theWin = window.open(theURL, "popup", "toolbar=no,location=no,directories=no,status=yes,menubar=no,scrollbars=no,resizable=no,width=" + width + ",height=" + height + ",top=100,left=100");
	}
}