var detect = navigator.userAgent.toLowerCase();
var OS,browser,version,total,thestring;

if (checkIt('konqueror'))
{
	browser = "Konqueror";
	OS = "Linux";
}
else if (checkIt('safari')) browser = "Safari"
else if (checkIt('omniweb')) browser = "OmniWeb"
else if (checkIt('opera')) browser = "Opera"
else if (checkIt('webtv')) browser = "WebTV";
else if (checkIt('icab')) browser = "iCab"
else if (checkIt('msie')) browser = "Internet Explorer"
else if (!checkIt('compatible'))
{
	browser = "Netscape Navigator"
	version = detect.charAt(8);
}
else browser = "An unknown browser";

if (!version) version = detect.charAt(place + thestring.length);

if (!OS)
{
	if (checkIt('linux')) OS = "Linux";
	else if (checkIt('x11')) OS = "Unix";
	else if (checkIt('mac')) OS = "Mac"
	else if (checkIt('win')) OS = "Windows"
	else OS = "an unknown operating system";
}

function checkIt(string)
{
	place = detect.indexOf(string) + 1;
	thestring = string;
	return place;
}

function showObj(obj)
{
	obj.style.visibility = 'visible';
}

function hideObj(obj)
{
	obj.style.visibility = 'hidden';
	obj.style.left = '-5000px';
	obj.style.top = '-5000px';
}

function centreObj(obj)
{
	ns4 = (document.layers)? true:false
	ie4 = (document.all)? true:false

	var scW, scH, obW, obH;
	if (ie4) {
		scW = parseInt(document.body.clientWidth);
		scH = parseInt(document.body.clientHeight); }
	else {
		scW = parseInt(screenSize.width);
		scH = parseInt(screenSize.height); }
		
	obW = parseInt(obj.style.width);
	obH = parseInt(obj.style.height);
	
	obj.style.left = (scW/2)-(obW/2) + 'px';
	obj.style.top = (scH/2)-(obH/2) + 'px';
	
	window.status = 'Screen width : ' + scW + 'px';
}
