// vrwa_main.js

function submitSearch(button) {

	if (button.name == "searchwww") {
		document.searchform.sitesearch.value = "";
	}
	
	if (button.name == "searchsite") {
		document.searchform.sitesearch.value = "www.vtruralwater.org";
	}

}

function showDesc(courseID) {
	var mywin = window.open("view_course.php?c="+courseID, "popup", "width=450, height=400, menubar=0, status=1, location=0, resizable=1, toolbar=0, directories=0, scrollbars=1");
}


/*  
Script made by Martial Boissonneault © 2002-2003 http://getElementById.com/
This script may be used and changed freely as long as this msg is intact
Visit http://getElementById.com/ for more free scripts and tutorials.
*/
var ie5 = (document.getElementById && document.all); 
var ns6 = (document.getElementById && !document.all);

/* RHM hack: adds "parent" parameter so functions can change parent link color based on what menu we're in */

function showFilter(obj, parent, visibility) {
	if(ie5){
		menu[obj].style.visibility = visibility;
		menu[parent].style.color = "#5a8acc";
		
	}
	else if(ns6){
		menu[obj].style.visibility = visibility;
		menu[parent].style.color = "#5a8acc";
	}
}

function showHide(obj, parent, visibility) {
	if(ie5 || ns6){
		menu[obj].style.visibility = visibility;
		
		/* RHM hack to change color of parent element based on rollover status */
		
		if (visibility == "visible") {
			var color = "#5a8acc";
		} else {
			var color = "#5c9352";
		}
		menu[parent].style.color = color;
		
		/* end hack */
	}
}

function menuBarInit() {
	if(ie5 || ns6){
   		menu = document.getElementsByTagName("span");
	}
}
