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);

function switchDiv(div_id) {
	var style_sheet = getStyleObject(div_id);
	if (style_sheet) {
		changeObjectVisibility(div_id,"hidden");
	  	changeObjectVisibility(div_id,"visible");
	} 
}

function hideDiv(div_id) {
	var style_sheet = getStyleObject(div_id);
	if (style_sheet) {
		changeObjectVisibility(div_id,"hidden");
	} 
}

function getStyleObject(objectId) {
	if(document.getElementById && document.getElementById(objectId)) {
		return document.getElementById(objectId).style;
	}
	else if (document.all && document.all(objectId)) {  
		return document.all(objectId).style;
	} 
	else if (document.layers && document.layers[objectId]) { 
		return document.layers[objectId];
	} else {
		return false;
	}
}

function changeObjectVisibility(objectId, newVisibility) {
    var styleObject = getStyleObject(objectId);
    if(styleObject) {
		styleObject.visibility = newVisibility;
		return true;
    } else {
		return false;
    }
}

var win=null;
function makeWin (mypage,myname,w,h,scroll,pos) {
    if(pos=="random") {
		LeftPosition=(screen.width)?Math.floor(Math.random()*(screen.width-w)):100;
		TopPosition=(screen.height)?Math.floor(Math.random()*((screen.height-h)-75)):100;
	}
	if(pos=="center") {
		LeftPosition=(screen.width)?(screen.width-w)/2:100;
		TopPosition=(screen.height)?(screen.height-h)/2:100;
	} else
		if ((pos!="center" && pos!="random") || pos==null) {
			LeftPosition=0;TopPosition=20
		}
		settings = 'width=' + w + ',height=' + h + ',top=' + TopPosition + ',left=' + LeftPosition + ',scrollbars=' + scroll + ',location=no,directories=no,status=no,menubar=no,toolbar=no,resizable=yes';
	win=window.open(mypage,myname,settings);
	win.focus();
}

function _foo(e) {}
function _eval(a,b,c,d) {
	if (a.addEventListener) {
		a.addEventListener(b,c,false)
	} else if (a.attachEvent) { 
		a.attachEvent(((d==1)?"":"on")+b,c)
	}
}
_eval(window,"unload",_foo,1);