var agt=navigator.userAgent.toLowerCase();
var isV4Plus = parseInt(navigator.appVersion)>=4;
var isIE4 = isV4Plus && (navigator.appName.indexOf("Microsoft")!=-1);
var isIE4Mac = isIE4 && (navigator.appVersion.indexOf("Macintosh")!=-1);
var isIE5 = isIE4 && (agt.indexOf("msie 5.0")!=-1);
var isNav4 = isV4Plus && (navigator.appName.indexOf("Netscape")!=-1);

var coll = (isIE4) ? "all." : "";
var styleObj = (isIE4) ? ".style" : "";

if (isNav4) 
{
	origWidth = innerWidth;
	origHeight = innerHeight;
}
function reDo()
{
	if (innerWidth != origWidth || innerHeight != origHeight) 
		location.reload();
}
if (isNav4) onresize = reDo;

function moveLayer(layer, x, y)
{
	if (isIE4 && layer) {
		layer.pixelLeft = x;
		layer.pixelTop = y;
	}
	else if (isNav4 && layer) {
		layer.moveTo(x, y);
	}
}

function show(obj) {
	if (obj)
		obj.visibility = "visible";
}

function hide(obj)
{
	if (obj)
		obj.visibility = "hidden";
}

function getObject(obj)
{
	return (typeof obj == "string") ? eval("document." + coll + obj + styleObj) : obj;
}

function getObjHeight(obj)
{
	return (isNav4) ? obj.clip.height : obj.clientHeight;
}

function getObjWidth(obj)
{
	if (obj)
		return (isNav4) ? obj.clip.width : obj.clientWidth;
}

function getInsideWindowWidth()
{
	return (isNav4) ? window.innerWidth : document.body.clientWidth;
}

function getInsideWindowHeight()
{
	return (isNav4) ? window.innerHeight : document.body.clientHeight;
}

function writeToLayer(layer, content)
{
	if (layer) {
		if (isIE4) {
			layer.innerHTML = content;
		}
		else if (isNav4) {
			layer.document.open("text/html");
			layer.document.write(content);
			layer.document.close();
		}
	}
}
