function removeFrame () {
	if (window.location != top.location)    {
		top.location.href = window.location
	}
}

function setPage (newAddress) {
        if (newAddress != "") {
		top.location.href = newAddress;
	}
}

function getBrowserWidth()
{
	if (window.innerWidth)
	{
		return window.innerWidth;
	}
	else if (document.documentElement && document.documentElement.clientWidth != 0)
	{
		return document.documentElement.clientWidth;
	}
	else if (document.body)
	{
		return document.body.clientWidth;
	}
	
	return 0;
}

function getBrowserHeight()
{
	if (window.innerHeight)
	{
		return window.innerHeight;
	}
	else if (document.documentElement && document.documentElement.clientHeight != 0)
	{
		return document.documentElement.clientHeight;
	}
	else if (document.body)
	{
		return document.body.clientHeight;
	}
	
	return 0;
}

var foundDOM = 0;
var isID = 0; 
var isDHTML = 0; 
var isLayers = 0; 
var isAll = 0; 

function findDOM(objectID) { 
	if (!foundDOM) {
		if (document.getElementById) { 
			isID = 1; isDHTML = 1; 
		} else { 
			browserVersion = parseInt(navigator.appVersion); 
			if ((navigator.appName.indexOf('Netscape') != -1) && (browserVersion == 4)) { 
				isLayers = 1; isDHTML = 1; 
			} else { 
				if (document.all) { 
				 isAll = 1; isDHTML = 1; 
				} 
			} 
		} 
		foundDOM = 1;
	}
	if (isID) { 
		return (document.getElementById(objectID)); 
	} else { 
		if (isAll) { 
			return (document.all[objectID]); 
		} else { 
			if (isLayers) { 
				return getObjNN4(top.document,objectID); 
			} 
		} 
	} 
} 

function getObjNN4(obj,name) 
{ 
	var x = obj.layers; 
	for (var i=0; i<x.length; i++) 
	{ 
		if (x[i].id == name) 
			return x[i]; 
		else if (x[i].layers.length) 
			var tmp = getObjNN4(x[i],name); 
		if (tmp) return tmp; 
	} 
	return null; 
} 

function writeToLayer ( id, text ) 
{ 
	// first we get a reference to the layer we want 
	// to modify 
	x = findDOM( id, 0 ); 

	if ( !x ) 
		return; 
	if ( isLayers ) { 
		// write does open for us 
		x.document.write(text); 
		x.document.close(); 
	} else { 
		x.innerHTML = text; 
	} 
} 
