/*---- CREATE POP UP WINDOW ----*/

function popUp (page, width, height) {
  var baseURL = "http://" + location.hostname + "/";
  var file = baseURL + page;
  var pop = window.open(file, "pop", "width=" + width + ",height=" + height + ",resizable=yes,status=no,toolbar=no,scrollbars=no");
  pop.focus();
}


/*---- CLICK TO SHOW, CLICK TO HIDE PAGE ELEMENT ----*/

function toggleVisibility(elementID) {
	leftVal = document.getElementById(elementID).style.left;
	if (leftVal == "auto"){
		document.getElementById(elementID).style.left = "-999px";
	}
	else {
		document.getElementById(elementID).style.left = "auto";
	}
}

/*---- CREATE IE HOVER EVENT ----*/
/* IE does not support the :hover psuedo class for anything but links. 
   this script adds a hover event handler to UL and LI objects in the nav div. 
   courtesy of suckerfish */

sfHover = function() {
	var sfEls = document.getElementById("nav").getElementsByTagName("LI");
	for (var i=0; i<sfEls.length; i++) {
		sfEls[i].onmouseover=function() {
			this.className+=" sfhover";
		}
		sfEls[i].onmouseout=function() {
			this.className=this.className.replace(new RegExp(" sfhover\\b"), "");
		}
	}
}
if (window.attachEvent) window.attachEvent("onload", sfHover);