//===========================================================
// open window
//===========================================================
function openWindow(url, name) {

	var l = openWindow.arguments.length;
	var w = "";
	var h = "";
	var features = "";

	for (i=2; i<l; i++) {
		var param = openWindow.arguments[i];
		if ( (parseInt(param) == 0) || (isNaN(parseInt(param))) ) {
			features += param + ',';
		} else {
			(w == "") ? w = "width=" + param + "," : h = "height=" + param;
		}
	}

	features += w + h;
	var code = "popupWin = window.open(url, name";
	if (l > 2) code += ", '" + features;
	code += "')";
	eval(code);
}


//===========================================================
// Mouseover funtions
//===========================================================
function buttonOn(imageName) {
	if (imagesPreloaded) {
		document[imageName].src = eval(imageName + "ON.src");
	}
}

function buttonOff(imageName) {
	if (imagesPreloaded) {
		document[imageName].src = eval(imageName + "OFF.src");
	}
}


//===========================================================
// Show/Hide funtions
//===========================================================
function checkBrowser() {
	this.ver = navigator.appVersion
	this.dom = document.getElementById?1:0
	this.ie5 = (this.ver.indexOf("MSIE 5")>-1 && this.dom)?1:0;
	this.ie4 = (document.all && !this.dom)?1:0;
	this.ns4 = (document.layers && !this.dom)?1:0;
	this.ns6 = document.getElementById?1:0	
	this.bw = (this.ie5 || this.ie4 || this.ns4 || this.ns6)
	return this
}
bw=new checkBrowser()

// Shows the div
function show(div,nest){
	obj=bw.dom?document.getElementById(div).style:bw.ie4?document.all[div].style:bw.ns4?nest?document[nest].document[div]:document[div]:0; 
	obj.visibility='visible'
}
// Hides the div
function hide(div,nest){
	obj=bw.dom?document.getElementById(div).style:bw.ie4?document.all[div].style:bw.ns4?nest?document[nest].document[div]:document[div]:0; 
	obj.visibility='hidden'
}
