// Version 2 Beta

// Detect Browser, Use this function for filter those browser which don't support DHTML and give different browser different function...
function BrowserMaster() {
	this.ver=navigator.appVersion;
	this.ua=navigator.userAgent;
	this.mac=(this.ua.indexOf("Mac")!=-1)?1:0;
	this.win=(this.ua.toUpperCase().indexOf("WINDOWS")!=-1)||(this.ua.toUpperCase().indexOf("WINNT")!=-1)?1:0;
	this.x11=(this.ua.toUpperCase().indexOf("X11")!=-1)?1:0;
	this.dom=document.getElementById?1:0;
    this.ie5=(this.ver.indexOf("MSIE")>-1 && this.dom)?1:0; 
	this.ie4=(document.all && !this.dom)?1:0; 
    this.ns5=(this.dom && parseInt(this.ver) >= 5) ?1:0; 
    this.ns4=(document.layers && !this.dom)?1:0; 
	this.bw=this.ie5?'ie5':this.ie4?'ie4':this.ns4?'ns4':this.ns5?'ns5':''
	return this;
}
// Browser detector
bw=new BrowserMaster();

var onImg = new Array();
var offImg = new Array();
for (var i = 0; i < imageNames.length; i++) {
	refName = imageNames[i];
	imgName = imageDir + refName + ".gif";
	imgHLName = imageDir + refName + "_on.gif";
	onImg[refName] = new Image();
	offImg[refName] = new Image();
	onImg[refName].src = imgHLName;
	offImg[refName].src = imgName;
}
function on(imgName) {
	if (bw.ns4)  document.images[imgName].src=onImg[imgName].src
	else document[imgName].src = onImg[imgName].src
}
function off(imgName) {
	if (bw.ns4)  document.images[imgName].src=offImg[imgName].src
	else document[imgName].src = offImg[imgName].src
}
function popup(url, popW, popH) {
	popWidth=popW?popW:400;
	popHeight=popH?popH:400;
	popName=url.substr(0,url.length-5);
	window.open(url, popName, "width="+popWidth+",height="+popHeight+",location=yes,menubar=yes,resizable=yes,scrollbars=yes,status=yes,titlebar=no,toolbar=no")
}
function showlayer(LayerName) {
	if (bw.ns4) document.layers[LayerName].visibility="visible"
	else if (bw.ns5) document.getElementById(LayerName).style.visibility="visible"
	else document.all(LayerName).style.visibility="visible"
}
function hidelayer(LayerName) {
	if (eval('s'+LayerName)==0) {
		if (bw.ns4) document.layers[LayerName].visibility="hidden"
		else if (bw.ns5) document.getElementById(LayerName).style.visibility="hidden"
		else document.all(LayerName).style.visibility="hidden"
	}
}
function hideit(LayerName) {
	setTimeout("hidelayer('"+LayerName+"')", 50)
}