var resized = "not resized";
function isIE(ifIe, notIe)
{
	if (document.all)
	{
		return ifIe;
	}
	else
	{
		return notIe;
	}
}
function getObject(id)
{
	obj = window.document.getElementById(id);
	if (obj == null)
	{
//		alert('Object ' + id + ' not found!');
	}
	return obj;
}
function resizeAll()
{	
	resized = "not resized";
	var workarea = window.document.getElementById("viewportworkarea");
//	if (workarea!=null && getObject('esslogo').offsetWidth>0)
	{

		body = getObject('essbody');
		menu = getObject('essmenu');
 		menu.style.width = "16em";
		decor = getObject('essrightimg');
		decorWidth = decor != null ? decor.offsetWidth : 0;
		maxHeight = workarea.offsetHeight;
		if (maxHeight==0) 
		{
			maxHeight= document.body.offsetHeight;
			workarea.height = maxHeight;
		}
		maxWidth = workarea.offsetWidth;
		if (maxWidth==0) 
		{
			maxWidth= document.body.offsetWidth;
			workarea.width = maxWidth;
		}
		body.style.width = "45em";
		bodyMaxWidth = body.offsetWidth;
		newWidth = (maxWidth - menu.offsetWidth - decorWidth - isIE(0,39));
		body.style.width = newWidth + "px";
		if (newWidth>bodyMaxWidth)
		{
			body.style.width = "45em";
		}
		try {body.style.height = (maxHeight - 115) + "px";} catch(er) {}
		try {menu.style.height = (maxHeight - 115) + "px";} catch(er) {}
		menu.style.top = 115 + "px";
		window.status = "W:" + maxWidth + " H:" + maxHeight;
		
		resized = "resized";

	}
/*	else
	{
		document.write("Tjosan!");
		body = getObject('essbody');
		body.style.width = "100%";
	}*/
}
//window.onResize = resizeAll();
