// JavaScript Document

function showMenu(object) {
	document.getElementById(object).style.visibility = 'visible';
}

function hideMenu(object) {
	document.getElementById(object).style.visibility = 'hidden';
}

function getBrowserType() {

	var ua = navigator.userAgent.toLowerCase();
	var os,browser,version,data;

	if (detect('konqueror')) {browser = "Konqueror"; os = "Linux";}
	else if (detect('safari')) browser = "Safari";
	else if (detect('omniweb')) browser = "OmniWeb";
	else if (detect('firefox')) browser = "FireFox";
	else if (detect('opera')) browser = "Opera";
	else if (detect('webtv')) browser = "WebTV";
	else if (detect('icab')) browser = "iCab";
	else if (detect('msie')) browser = "IE"; // Internet Explorer
	else if (!detect('compatible')) {browser = "Netscape"; version = ua.charAt(8);} // Netscape Navigator
	else browser = "An unknown browser";

	if (!version) version = ua.charAt(stringposition + data.length);

	function detect(text) {
	   stringposition = ua.indexOf(text) + 1;
	   data = text;
	   return stringposition;
	}

	return browser;

}

function getScreenSize() {
	var wHeight, wWidth, sHeight, sWidth, bitDepth;

	browser = getBrowserType();

	if (browser == "IE") { // document.all
		//alert('IE');
		wHeight = document.body.clientHeight;
		wWidth = document.body.clientWidth;
		sHeight = screen.height;
		sWidth = screen.width;
		bitDepth = screen.colorDepth;
	} else if (browser == "Netscape") { // document.layers
		//alert('Netscape');
		wHeight = window.innerHeight;
		wWidth = window.innerWidth;
		sHeight = screen.height;
		sWidth = screen.width;
		bitDepth = screen.colorDepth;
	} else if (browser == "FireFox") {
		//alert('FireFox');
		wHeight = document.body.clientHeight;
		wWidth = document.body.clientWidth;
		sHeight = screen.height;
		sWidth = screen.width;
		bitDepth = screen.colorDepth;
		//sWidth = document.body.clientWidth; // *** TEMP OVERRIDE
	} else {
		//alert('unknown');
		wHeight = document.body.clientHeight;
		wWidth = document.body.clientWidth;
		sHeight = screen.height;
		sWidth = screen.width;
		bitDepth = screen.colorDepth;		
	}
	
	// center form
	document.getElementById('s02').style.left = (wWidth - 740) / 2 + 79 + 'px';
	document.getElementById('s03').style.left = (wWidth - 740) / 2 + 170 + 'px';
	document.getElementById('s05').style.left = (wWidth - 740) / 2 + 322 + 'px';
}
