﻿sfHover = function() {
var sfEls = document.getElementById("navTop").getElementsByTagName("LI");
for (var i=0; i<sfEls.length; i++) {
    sfEls[i].onmouseover=function() {
	    this.className+=" over";
    }
    sfEls[i].onmouseout=function() {
	    this.className=this.className.replace(new RegExp(" over\\b"), "");
    }
}
}
if (window.attachEvent) window.attachEvent("onload", sfHover);

function addOption(selectbox,text,value )
{
	var optn = document.createElement("OPTION");
	optn.text = text;
	optn.value = value;
	selectbox.options.add(optn);
}
function resetCampus(action){
    //alert(action);
	var i;
	var selectbox = document.getElementById('Campus');
	if (action=="Respiratory Therapist")
	{
	        var bIE=false;
		for(i=selectbox.options.length-1;i>=0;i--)
		{
			if (selectbox.options[i].value == "Inland Empire") bIE=true;
			if(selectbox.options[i].value == "Los Angeles" || selectbox.options[i].value == "Orange County")
			{
				selectbox.remove(i);
			}
		}
		if (!bIE) addOption(selectbox,"Inland Empire","Inland Empire" )
	}
	else if (action=="Dental Assistant")
	{
	    var bLA=false;
	    var bOC=false;
	    var bOT=false;
		for(i=selectbox.options.length-1;i>=0;i--)
		{
			if (selectbox.options[i].value == "Los Angeles") bLA=true;
			if (selectbox.options[i].value == "Orange County") bOC=true;
			if (selectbox.options[i].value == "Ontario") bOT=true;
			if(selectbox.options[i].value == "Inland Empire")
			{
				selectbox.remove(i);
			}
		}
	    	if (!bLA) addOption(selectbox,"Los Angeles","Los Angeles");
	    	if (!bOT) addOption(selectbox,"Ontario","Ontario");
	    	if (!bOC) addOption(selectbox,"Orange County","Orange County");
	} 
	else
	{
	    var bIE=false;
	    var bLA=false;
	    var bOC=false;
		for(i=selectbox.options.length-1;i>=0;i--)
		{
			if (selectbox.options[i].value == "Inland Empire") bIE=true;
			if (selectbox.options[i].value == "Los Angeles") bLA=true;
			if (selectbox.options[i].value == "Orange County") bOC=true;
		}
		if (!bIE) addOption(selectbox,"Inland Empire","Inland Empire");
	    	if (!bLA) addOption(selectbox,"Los Angeles","Los Angeles");
	    	if (!bOC) addOption(selectbox,"Orange County","Orange County");
	}
}

function MM_openBrWindow(theURL, winName, features) { //v2.0
    window.open(theURL, winName, features);
} 