//Suckerfish Drop Down code for IE only...
//http://www.htmldog.com/articles/suckerfish/dropdowns/
sfHover = function() {
	
	if(document.getElementById("subnav")){
	
		var sfEls = document.getElementById("subnav").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);



// open popup window
function openPopup(URL, name, ww, hh) {
	var xcoord, ycoord, popWidth, popHeight, popName;
	
	xcoord = 0;
	ycoord = 0;
	
	if(name != null) {
		popName = name;
	}
	else {
		popName = "popup";
	}
	
	if(ww != null) {
		popWidth = ww;
	}
	else {
		popWidth = 460;
	}
	
	if(hh != null) {
		popHeight = hh;
	}
	else {
		popHeight = 580;
	}
	
	if(document.getElementById) {
		xcoord = Math.round((screen.availWidth - popWidth) / 2);
		ycoord = Math.round((screen.availHeight - popHeight) / 2);
	}
	
  myPopup = window.open(URL,popName,'width=' + popWidth + ',height=' + popHeight + ',left=' + xcoord + ',top=' + ycoord + ',directories=no,menubar=yesn,status=no,resizable=1,scrollbars=yes');
  if (!myPopup.opener) {
		myPopup.opener = self;
	}
	
	myPopup.focus();
}

// function to encode mailto links
function safe_mailto(username,domain,text) {
	//var domain = ".berkeley.edu";
	var atsign = "&#64;";
	var addr = username + atsign + domain;
	if (!text) {
		var text = addr;
	}
	document.write( 
		"<" + "a" + " " + "h" + "r" + "e" + "f" + "=" + "m" + "a" + "i" + "l" + "t" + "o" + ":" + addr + ">" +
		text +
		"<\/a>");
}
