/* Create alternate row colors for tables */

function colorAltTableRows(id){
	if(document.getElementsByTagName){
		var table = document.getElementById(id);
		var rows = table.getElementsByTagName("tr");
		// set 'i' so skip any headers, remember to start with '0'
		for(i = 1; i < rows.length; i++){
			// change the color of the rows
			rows[i].className = (i % 2 == 0) ? "even" : "odd";
		}
	}
}

/* This script will allow the pop-up file to interact with the parent window to go to the details page of a selected school. Used for the map.cfm and map_popup.html documents. */

function newWindow(location) {
	var popWindow = window.open(location,"popWin","toolbar=no,location=no,scrollbars=yes,width=780,height=580");
	return false;
}

function toggleDisplay(keyNum) {
	img1 = new Image; img1.src = "../images/ui/plus.gif";
	img2 = new Image; img2.src = "../images/ui/minus.gif";
	
	if (document.getElementById) {
		menuState = document.getElementById("dd" + keyNum).style;
		if (menuState.display == "block") {
			menuState.display = "none";
			document.getElementById("list" + keyNum).src = img1.src;
		}
		else {
			menuState.display = "block";
			document.getElementById("list" + keyNum).src = img2.src;
		}
		return false;
	}
	else {
		return true;
	}
}