// <!-- hide from old browsers 

function windowWidth() {
	var myWidth = 0;
	if ( typeof( window.innerWidth ) == 'number' )
	{
		//Non-IE
		myWidth = window.innerWidth;
	}
	else if( document.documentElement &&
      		( document.documentElement.clientWidth || document.documentElement.clientHeight ) ) 
	{
		//IE 6+ in 'standards compliant mode'
		myWidth = document.documentElement.clientWidth;
	} 
	else if( document.body && ( document.body.clientWidth || document.body.clientHeight ) ) {
		//IE 4 compatible
		myWidth = document.body.clientWidth;
	}
	//window.alert( 'Width = ' + myWidth + ' Height = ' + myHeight);
	return myWidth;
}

function windowHeight() {
	var myHeight = 0;
	if ( typeof( window.innerWidth ) == 'number' )
	{
		//Non-IE
		myHeight = window.innerHeight;
	}
	else if( document.documentElement &&
      		( document.documentElement.clientWidth || document.documentElement.clientHeight ) ) 
	{
		//IE 6+ in 'standards compliant mode'
		myHeight = document.documentElement.clientHeight;
	} 
	else if( document.body && ( document.body.clientWidth || document.body.clientHeight ) ) {
		//IE 4 compatible
		myHeight = document.body.clientHeight;
	}
	//window.alert( 'Width = ' + myWidth + ' Height = ' + myHeight);
	return myHeight;
}

function getHeight(id) {
	if (document.getElementById(id)) return document.getElementById(id).clientHeight;
	else alert('function getHeight : Element ' + id + ' does not exist!');	
}

function setHeight(id,value) {
	if (document.getElementById(id)) document.getElementById(id).style.height = value + 'px';
	else alert('function setHeight : Element ' + id + ' does not exist!');	
}

function getWidth(id) {
	if (document.getElementById(id)) return document.getElementById(id).clientWidth;
	else alert('function getWidth : Element ' + id + ' does not exist!');	
}

function setWidth(id,value) {
	if (document.getElementById(id)) document.getElementById(id).style.width = value + 'px';
	else alert('function setWidth : Element ' + id + ' does not exist!');	
}

function getLeft(id) {
	if (document.getElementById(id)) 
	{
		if (navigator.appName.match("Explorer") || navigator.userAgent.match("Safari"))
		{
			return document.getElementById(id).offsetLeft;
			return(getAbsX(document.getElementById(id)))-getWidth(id);
		}
		else
			return (getAbsX(document.getElementById(id)));
	}
	else alert('function getLeft : Element ' + id + ' does not exist!');	
}

function setLeft(id,value) {
	if (document.getElementById(id)) document.getElementById(id).style.left = value + 'px';
	else alert('function setLeft : Element ' + id + ' does not exist!');	
}

function getTop(id) {
	if (document.getElementById(id)) 
	{
		if (navigator.appName.match("Explorer")) 
			return document.getElementById(id).offsetTop;
		else
			return(getAbsY(document.getElementById(id)));
	}
	else alert('function getLeft : Element ' + id + ' does not exist!');	
}



function setTop(id,value) {
	if (document.getElementById(id)) document.getElementById(id).style.top = value + 'px';
	else alert('function setLeft : Element ' + id + ' does not exist!');	
}

// get the true offset of anything on NS4, IE4/5 & NS6, even if it's in a table!
function getAbsX(elt) { 
	return (elt.x) ? elt.x : getAbsPos(elt,"Left"); 
}

function getAbsY(elt) { return (elt.y) ? elt.y : getAbsPos(elt,"Top"); }

function getAbsPos(elt,which) {
	iPos = 0;
	while (elt != null) {
		iPos += elt["offset" + which];
		elt = elt.offsetParent;
	}
	return iPos;
}

// End hiding --> 
