var dom=(document.getElementById)
var whoison=1;
//var pause = 3000; 

function getContainer(dv) { 
	var container;
	if(dom){
		if(document.getElementById(dv)) container = document.getElementById(dv);  
	}
	else {
		var c=eval(dv);
		 if(c) container = c;
	}
	return container;
}
  
function MM_openBrWindow(theURL,winName,features) {
  window.open(theURL,winName,features);
 }
  
  
function g6openWin(url, winName, w, h, wTop, wLeft) {  
	if (!w) var w=550;
	if (!h) var h=450;  
	// valign center if not given or 0
	if (!wTop) var wTop=  (screen.height - (h+0)) / 2; // wTop = document.body.scrollTop+50;  
	// align center if not given or 0
	if (!wLeft) var wLeft =  (screen.width - (w+0)) / 2;  
	if (!winName) var winName="mywin"; 
	window.open(url,winName,'resizable=1,scrollbars=1,width='+w+',height='+h+',top='+wTop+',left='+wLeft+',directories=0,location=0,menubar=0,status=0,toolbar=0')
}
  
  
function mouseOver(who) {  
	if(dom) {   
			if (who != whoison) {    
				document.getElementById("tab" + who + "Left").className="hoverTabLeft";
				document.getElementById("tab" + who + "Center").className="hoverTabCenter";
				document.getElementById("tab" + who + "Right").className="hoverTabRight"; 
			} 
	}//if
	else { 
			if (who != whoison) {   
				leftTab=eval("tab" + who + "Left");
				leftTab.className="hoverTabLeft"; 
				centerTab=eval("tab" + who + "Center");
				centerTab.className="hoverTabCenter"; 
				rightTab=eval("tab" + who + "Right");
				rightTab.className="hoverTabRight";
			}
	}//if/else 
}//function

function mouseOut(who) {  
	if(dom) {   
			if (who != whoison) {    
				document.getElementById("tab" + who + "Left").className="tabLeft";
				document.getElementById("tab" + who + "Center").className="tabCenter";
				document.getElementById("tab" + who + "Right").className="tabRight"; 
			} 
	}//if
	else { 
		if (who != whoison) {   
			leftTab=eval("tab" + who + "Left");
			leftTab.className="tabLeft"; 
			centerTab=eval("tab" + who + "Center");
			centerTab.className="tabCenter"; 
			rightTab=eval("tab" + who + "Right");
			rightTab.className="tabRight";
		}
	}//if/else 
}//function   


// IMAGE PRELOADING
function newImage(arg) {
	if (document.images) {
		rslt = new Image();
		rslt.src = arg;
		return rslt;
	}
}
function preloadImages() {
	if (document.images) {
		NavField_NEC_base_over = newImage("images/NavField-NEC_base_over.png");
		BodySpace_NEC_base_over = newImage("images/BodySpace-NEC_base_over.png");
		NEC_base_over = newImage("images/NEC_base-over.png");
		BotmNav_NEC_base_over = newImage("images/BotmNav-NEC_base_over.png");
		copyright_NEC_base_over = newImage("images/copyright-NEC_base_over.png");
		GoButton_down1 = newImage("images/GoButton_down.gif");
		GoButton_over1 = newImage("images/GoButton_over.gif");
		ResetButton_over1 = newImage("images/ResetButton_over.gif");
		ResetButton_down1 = newImage("images/ResetButton_down.gif"); 
		submit_base_over = newImage("images/submit_over.gif");
		submit_base_down = newImage("images/submit_down.gif");
		dir = newImage("images/dir.gif");
		next_base_over = newImage("images/next_over.gif");
		next_base_down = newImage("images/next_down.gif");
		back_base_over = newImage("images/back_over.gif");
		back_base_down = newImage("images/back_down.gif");
		preloadFlag = true;
	}
}
function changeImages() {
	if (document.images && (preloadFlag == true)) {
		for (var i=0; i<changeImages.arguments.length; i+=2) {
			document[changeImages.arguments[i]].src = changeImages.arguments[i+1];
		}
	}
} 
 // BROWSER SNOOP
var thisbrowser="ie"; 
 if (document.layers) {
     var thisbrowser="NS4";
 }
 if (document.all) {
     var  thisbrowser="ie"
 }
 if (!document.all && document.getElementById) {
    var  thisbrowser="NS6";
 }  
 // STATE, COURSE SWITCHES
var preloadFlag = false;
var selectOrder=1;
var optionTest = true;
var stateIDs=0;  
/*
<!---  no longer used
function populate2()
{ 
	box3 = document.stateForm.courseStateSel2;
	stateID = box3.options[box3.selectedIndex].value; 
	if (!stateID) return;
 								
	courseList = stateCourseArray[stateID];

	var box4 = document.stateForm.courseSel2;
	
	box4.options.length = 0;

	for(i=0; i < courseList.length; i+=2)
	{			
		box4.options[i/2] = new Option(courseList[i+1], courseList[i]);
	}
	selectOrder=2;
	
	 // populate all states 		 
	 stateList = stateCourseArray['ALL'];
	 startBox2 = document.stateForm.courseStateSel2; 
	 startBox2.options.length = 0; 
	 for(i=0; i < stateList.length; i+=2) {			 	 
	 	startBox2.options[i/2] = new Option(stateList[i+1], stateList[i]); // state, state
	 }		 
	  for(i=0; i < startBox2.options.length; i++) {
			 if (startBox2.options[i].value==stateID)  startBox2.selectedIndex=i;
	  }	 
} 
function switchStart1() {
	if (selectOrder==1) {	 
		box2s = document.searchForm.courseStateSel;
		stateIDs = box2s.options[box2s.selectedIndex].value; 
		
		box3 = document.stateForm.courseStateSel2;
		box3.options[box3.selectedIndex].value = stateIDs;
		populate2();
		
		if ( thisbrowser=="NS4") {
			document.allCourses.visibility="hidden";
			document.allStates.visibility="visible";
		}
	 
		if (thisbrowser=="NS6") {
				document.getElementById("allCourses").style.visibility="hidden";
				document.getElementById("allStates").style.visibility="visible";
		}
		if (thisbrowser !="NS4" && thisbrowser !="NS6") {
				 allCourses.style.visibility='hidden';
				 allStates.style.visibility='visible'; 
		} 
	}
} 
*/ 
function switchStart2() {
	if (selectOrder==1) {	
		populate();
		if ( thisbrowser=="NS4") {
			document.allCourses.visibility="visible";
			document.allStates.visibility="hidden";
		} 
		if (thisbrowser=="NS6") {
				document.getElementById("allCourses").style.visibility="visible";
				document.getElementById("allStates").style.visibility="hidden";
		}
		if (thisbrowser !="NS4" && thisbrowser !="NS6") {
				 allCourses.style.visibility='visible';
				 allStates.style.visibility='hidden'; 
		}
	}
}		 


