//
// JavaScript functions
//


var PAGEWIDTH = 740;

var ns4;
var ie4;
var ns6;

// Test for which browser
if (document.layers) ns4 = true;
if (document.all) ie4 = true;
if ((document.getElementById) && (!document.all)) ns6 = true;


function ShowDiv(which)
{
	if (ie4) {
		document.all[which].style.visibility = "visible";
	}
	if (ns6) {
		document.getElementById(which).style.visibility = "visible";
	}
	if (ns4) {
		document.layers[which].visibility = "show";
	}
}

function HideDiv(which)
{
	if (ie4) {
		document.all[which].style.visibility = "hidden";
	}
	if (ns6) {
		document.getElementById(which).style.visibility = "hidden";
	}
	if (ns4) {
		document.layers[which].visibility = "hide";
	}
}

function ShowDivs(divlist)
{
	var divs = divlist.split(",");
	for (i = 0;  i < divs.length;  i++) {
		ShowDiv(divs[i]);
	}
}

function HideDivs(divlist)
{
	var divs = divlist.split(",");
	for (i = 0;  i < divs.length;  i++) {
		HideDiv(divs[i]);
	}
}


function DisplayBlock(which)
{
	if (ie4) {
		document.all[which].style.display = "block";
	}
	if (ns6) {
		document.getElementById(which).style.display = "block";
	}
	if (ns4) {
		document.layers[which].display = "block";
	}
}

function DisplayNone(which)
{
	if (ie4) {
		document.all[which].style.display = "none";
	}
	if (ns6) {
		document.getElementById(which).style.display = "none";
	}
	if (ns4) {
		document.layers[which].display = "none";
	}
}

function SetImage(imageName, imagePath)
{
	img = new Image();
	img.src = imagePath;
	document[imageName].src = img.src;
}

function getWindowWidth(offset)
{
	var winW = 1;
	
	if (parseInt(navigator.appVersion) > 3) {
		if (navigator.appName == "Netscape") {
			winW = window.innerWidth;
		}
		if (navigator.appName.indexOf("Microsoft") != -1) {
			winW = document.body.offsetWidth;
		}
	}
	
	if (winW == 1) {
		return winW;
	} else {
		return winW - offset;
	}
}

function getWindowHeight(offset)
{
	var winH = 1;

	if (parseInt(navigator.appVersion) > 3) {
		if (navigator.appName == "Netscape") {
			winH = window.innerHeight;
		}
		if (navigator.appName.indexOf("Microsoft") != -1) {
			winH = document.body.offsetHeight;
		}
	}
	if (winH == 1) {
		return winH;
	} else {
		return winH - offset;
	}
}

function getPageWidth(offset)
{
	return PAGEWIDTH - offset;
}

function isOlderNetscape()
{
	if ((navigator.appName == "Netscape") && (parseInt(navigator.appVersion) < 5)) {
		return true;
	} else {
		return false;
	}
}

function NewWindow(url, name, options)
{
	mynewwindow = window.open(url, name, options);
	mynewwindow.document.close();
}

