sfHover = function() {
	var sfEls = document.getElementById("mainmenu").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"), ""); //this wouldn't work in Firefox with the gallery switcher down below
			this.className=this.className.replace(new RegExp("sfhover"), "");
		}
	}
}


//<![CDATA[

 // If you don't want to put unstandard properties in your stylesheet, here's yet
 // another means of activating the script. This assumes that you have at least one
 // stylesheet included already. Remove the /* and */ lines to activate.


 if (document.all && document.styleSheets && document.styleSheets[1] &&
  document.styleSheets[1].addRule)
 {
  // Feel free to add rules for specific tags only, you just have to call it several times.
  //document.styleSheets[0].addRule('#galleryfaculty a', 'behavior: url(/css/iepngfix.htc)');

  
 }


 //]]>
 
 //pop up window script
function popup(theURL,name,theSize)
{
	var settings = 'toolbars=0,location=0,directories=0,status=0,scrollbars=1,' + theSize;
	window.open(theURL,name,settings);
}

//===================== Gallery switcher =====================//


function makeActive(bleh) {
	if (bleh != "switchtype") {
		document.getElementById("switchtype").className = "switch type";
		document.getElementById("switchname").className = "switch name";
	}
	else {
		document.getElementById("switchtype").className = "switch activetype";
		document.getElementById("switchname").className = "switch activename";
	}	
}

function fixLinks(){
	if (!document.getElementById("switchnav")) return null;
	var page = document.getElementById("switchnav");
	var anchors = page.getElementsByTagName("A");
	for(var i=0; i < anchors.length; i++){
		var a = anchors[i];
		var href = a.href;
		var id = a.id;
		var title = a.title;
		if (href.indexOf("#header") != -1) { // back to top
			a.className = "alt";
		}
		else if ((href.indexOf("#") != -1) && (href.indexOf("header") == -1)) { // jump ref
			var index = href.indexOf("#") + 1;
			href = "javascript:show('" + href.substring(index) + "');" + "javascript:makeActive('" + id + "');";
			a.setAttribute("href",href);
			//a.onmouseclick = makeActive();
			
			//a.setAttribute("style","background:url(/~sfa/images/blank.gif);");
		}
	}
}

function hideDivs(exempt){
	if (!document.getElementsByTagName) return null;
	if (!exempt) exempt = "";
	var lists = document.getElementsByTagName("ul");
	for(var i=0; i < lists.length; i++){
		var list = lists[i];
		var id = list.id
		var className = list.className;
		if ((id != "menusmall") && (id != "mainmenu") && (className != "submenu") && (className != "submenu2") && (className != "gallery") && (className != "bottom") && (id != exempt)){
			list.className = "hidden";
		}
	}
}

function show(what){
	if (!document.getElementById) return null;
	showWhat = document.getElementById(what);
	showWhat.className = "visible";
	hideDivs(what);
}