var maximized=false;
var oldheight=0;
function togglemaximize()
{
	if(maximized)restore();else maximize();
}

function viewportWidth()
{
	// all except Explorer
	if (self.innerHeight) return self.innerWidth;
	// Explorer 6 Strict Mode
	if (document.documentElement) return document.documentElement.clientWidth;
	// other Explorers
	if (document.body) return document.body.clientWidth;
}

function viewportHeight()
{
	// all except Explorer
	if (self.innerHeight) return self.innerHeight;
	// Explorer 6 Strict Mode
	if (document.documentElement) return document.documentElement.clientHeight;
	// other Explorers
	if (document.body) return document.body.clientHeight;
}

function maximize()
{
	oldheight=document.getElementById('content').clientHeight;
	y=viewportHeight();
	y-=document.getElementById('wrapper').clientHeight-document.getElementById('content').clientHeight;
	//printarr(document);
	document.getElementById('content').style.height=y.toString()+'px';
	maximized=true;
}

function restore()
{
	document.getElementById('content').style.height=oldheight.toString()+'px';
	maximized=false;
}

function printarr(arr)
{
	for(var x in arr)document.write(x.toString()+' : '+arr[x]+'<br />');
}