// SUR Common JS functions

function mOver(nam, targ, flag){
	theImg = document.getElementById(nam + targ);
	if( flag==1){
		theImg.setAttribute("src","_img/btn_"+nam+"_on.gif");
	} else {
		theImg.setAttribute("src","_img/btn_"+nam+"_off.gif");
	}
}
function spamFighter(user,domain) {
	locationstring = "mailto:" + user + "@" + domain;
	window.location = locationstring;
}
/* open new centered window with scrolling ability */
/* USAGE: javascript:openPop('filename.html','windowname', width, height); */


function openWin(url,name,popW,popH) {
        version = navigator.appVersion;
	var w = 800, h = 600;
        if (version.toLowerCase().indexOf("mac")!=-1) {
                    popW = eval("popW-18");
        }
	if (document.all || document.layers) {
		w = screen.availWidth;
		h = screen.availHeight;
	}
	var leftPos = (w-popW)/2, topPos = (h-popH)/2;
	window.open(url,name,'width=' + popW + ',height=' + popH + ',scrollbars=yes,toolbar=no,status=yes,resizable=no,top=' + topPos + ',left=' + leftPos);void(0);
}




/* open new centered window without scrolling ability */
/* USAGE: javascript:openPop('filename.html','windowname', width, height); */


function openPop(url,name,popW,popH) {
        version = navigator.appVersion;
	var w = 800, h = 600;

	if (document.all || document.layers) {
		w = screen.availWidth;
		h = screen.availHeight;
	}
	var leftPos = (w-popW)/2, topPos = (h-popH)/2;
	window.open(url,name,'width=' + popW + ',height=' + popH + ',scrollbars=no,toolbar=no,status=yes,resizable=no,top=' + topPos + ',left=' + leftPos);void(0);
}

function checkFrames(){
	if (top.location == self.location){
		me = new String(self.location);
		var slashloc = me.lastIndexOf('/') + 1;
		var filename = me.substr(slashloc);
		location.href='index.php?section='+filename;
	}
}