function toggleMenu(currMenu) {
	if (document.getElementById) {
		thisMenu = document.getElementById(currMenu).style
		if (thisMenu.display == "block") {
			thisMenu.display = "none"
		}
		else {
			thisMenu.display = "block"
		}
		return false
	}
	else {
		return true
	}
}






function Initialize() {
	PreloadImages();
	readCookie();
}


function Toggle(ImageName) {
	if(document.images[ImageName].src.indexOf("_i.jpg") > -1) {
		var NewImage = document.images[ImageName].src.substring(document.images[ImageName].src.indexOf("images/") + 7,document.images[ImageName].src.indexOf("_i.jpg")) + "_a.jpg";
		document.images[ImageName].src = "images/" + NewImage;
	}
	else {
		var NewImage = document.images[ImageName].src.substring(document.images[ImageName].src.indexOf("images/") + 7,document.images[ImageName].src.indexOf("_a.jpg")) + "_i.jpg";
		document.images[ImageName].src = "images/" + NewImage;
	}
}



// Preload Rollover Images
function PreloadImages() {
	for (var i=0; i<document.images.length; i++) {
		if(document.images[i].src.indexOf("_i.jpg") > -1) {
			var RolloverName = document.images[i].src.substring(document.images[i].src.indexOf("images/") + 7,document.images[i].src.indexOf("_i.jpg")) + "_a.jpg";
			var ThisImage = new Image;
			ThisImage.src = "images/" + RolloverName;
		}
	}
}




//////////////////////////////////////////////////////////////////
// Calendar Popup Window Function.


function popupWindow (url,winName,details) {
	var showWindow = window.open(url,winName,details);
}

///////////////////////////////////////////////////////////////////




		


function readCookie() {
	var english = document.getElementById('english').style;
	var spanish = document.getElementById('spanish').style;
	var the_cookie = document.cookie;
	var broken_cookie = the_cookie.split("=");
	var the_value = broken_cookie[1];

	
	if (!the_cookie) {
		var the_value = "english";
	}
	
	if (document.getElementById) {
		if (the_value == "english") {
			english.display = "block"
			spanish.display = "none"
		} else {
			english.display = "none"
			spanish.display = "block"
		}
		
	}


}


//////////////////////////////////////////////////////////////////
// get the available content height space in the browser window.

// see page 385

function getInsideWindowHeight() {
	if (window.innerHeight) {
		return window.innerHeight;
	} else if (isIE6CSS) {
		// measure the html element's clientHeight
		return document.body.parentElement.clientHeight;
	} else if (document.body && document.body.clientHeight) {
		return document.body.clientHeight;
	}// closes window.innerheight
	
	return 0;

} // closes getInsideWindowHeight

































