ns4 = (document.layers)? true:false;
ie4 = (document.all)? true:false;
ns6 = (!document.all && document.getElementById)? true: false;

var docs = (ns4) ? "document.layers['":(ns6) ? "document.getElementById('":"";
var doce = (ns4) ? "']":(ns6) ? "')":"";
var doct = (ns4) ? "":".style";
var doctop = (ie4) ? "pixelTop":"top";
var docleft = (ie4) ? "pixelLeft":"left";
var show = (ns4) ? "show":"visible";
var hide = (ns4) ? "hide":"hidden";

function DivDo(div, action, result) {
	eval(docs + div + doce + doct + "." + action + " = '" + result + "'");
}

function GetVal(div, action) {
	return eval(docs + div + doce + doct + "." + action);
}

function HideIt(id){
	DivDo(id, 'visibility', hide);
}

function ShowIt(id){
        DivDo(id, 'visibility', show);
}

function OnOver(id) {

	HideIt('div1');
	HideIt('div2');
	HideIt('div3');
	HideIt('div4');
	ShowIt('div' + id);
	
}

function HideAll(id) {

	HideIt('div1');
	HideIt('div2');
	HideIt('div3');
	HideIt('div4');
	
}

function NewWindow(mypage, myname, w, h, scroll) {
	var winl = (screen.width - w) / 2;
	var wint = (screen.height - h) / 2;
	winprops = 'height='+h+',width='+w+',top='+wint+',left='+winl+',scrollbars='+scroll+',resizable'
	win = window.open(mypage, myname, winprops)
	if (parseInt(navigator.appVersion) >= 4) { win.window.focus(); }
}