
function resScreenX()
{
/* returns the resolution of the screen - width (works in netscape and IE)*/
return screen.width;
}


function resScreenY()
{
/* returns the resolution of the screen - height (works in netscape and IE)*/
return screen.height;
}

function pageY()
{
/*returns the available working width of the page*/
var myHeight;

if (window.innerHeight!=null)
		myHeight = window.innerHeight
else if (document.body.clientHeight!=null)
		 myHeight = document.body.clientHeight
else
	myHeight=0;	

return myHeight;
}

function pageX()
{
/*returns the available working width of the page*/
var myWidth
if (window.innerWidth!=null)
		myWidth= window.innerWidth
else if (document.body.clientWidth!=null)
		myWidth= document.body.clientWidth 
else
	myWidth=0;	
	
return myWidth;
}

function sizeInfo(id,whatInfo)
{
/* for a given element identified by its id, the function returns the desired information:
	top,left height or width*/
 
var objElement = document.getElementById(id);
var val;

switch (whatInfo)
	{
	case "top" : 	if (objElement.offsetTop)
						val = objElement.offsetTop
					else
						if (objElement.pixelTop)
							val = objElement.pixelTop;
			break;

	case "left" : 	if (objElement.offsetLeft)
						val = objElement.offsetLeft
					else
						if (objElement.pixelLeft)
							val = objElement.pixelLeft;	
			break;

	case "height" : val = objElement.offsetHeight;
			break;

	case "width" :   val = objElement.offsetWidth;
			break;
	}
return val;
}


function maincontentAvailSize(val)
{
var avail
(val=="height") ? avail=pageY() : avail=pageX();
if (val=="height")
	avail=avail-getHeaderY();	
else
	avail=avail-60;	
return avail;
}

function setMainContentX()
{var x ; 
x= pageX()-30-30;
if (document.getElementById("maincontent"))
	document.getElementById("maincontent").style.width = x;
	
return x;
}

function setMainContentXov()
{
//use this if you know there will be length overflow, the scroll will be over the graphics.
var x ;
x= pageX()-32;
if (document.getElementById("maincontent"))
	document.getElementById("maincontent").style.width = x;

return x;
}

function setMainContentY()
{
var y;
y= pageY()-getHeaderY()-5;
if (document.getElementById("maincontent"))
	document.getElementById("maincontent").style.height = y;
	
return y;
}

function getHeaderY()
{ 
if (document.getElementById("companyheader"))
	return (document.getElementById("companyheader").offsetHeight+
		document.getElementById("headmessage").offsetHeight+
		document.getElementById("mainmenu").offsetHeight)
else
	return 0;
}


function siz()
{
setMainContentXov();
setMainContentY();
}

function siz2()
{
setMainContentX();
setMainContentY();
}

