/* Profile
 * Copyright (c)2008 John Lawson
 * All Rights Reserved
 */

function resize()
{
	var margin  = 40;
	var spacing = 20;
	
	var myWidth = 0, myHeight = 0;
	if(typeof(window.innerWidth) == 'number')
	{
		// Non-IE
		myWidth = window.innerWidth;
		myHeight = window.innerHeight;
	}
	else if(document.documentElement && (document.documentElement.clientWidth || document.documentElement.clientHeight))
	{
		// IE 6+ in 'standards compliant mode'
		myWidth = document.documentElement.clientWidth;
		myHeight = document.documentElement.clientHeight;
	}
	else if(document.body && (document.body.clientWidth || document.body.clientHeight))
	{
		// IE 4 compatible
		myWidth = document.body.clientWidth;
		myHeight = document.body.clientHeight;
	}

	var width  = myWidth - (margin + margin);
	var height = myHeight - (margin + margin);

	var controlHeight   =  20;
	var leftWidth       = 205;
	
	document.getElementById('icon').style.position    = 'absolute';
	document.getElementById('icon').style.top         = margin;
	document.getElementById('icon').style.left        = margin;
	document.getElementById('icon').style.width       = leftWidth;
	document.getElementById('icon').style.height      = controlHeight;

	document.getElementById('top').style.position    = 'absolute';
	document.getElementById('top').style.top         = margin;
	document.getElementById('top').style.left        = leftWidth + margin + 20;
	document.getElementById('top').style.width       = width -leftWidth - 20;
	document.getElementById('top').style.height      = controlHeight;

	document.getElementById('left').style.position    = 'absolute';
	document.getElementById('left').style.top         = 120 + margin + spacing;
	document.getElementById('left').style.left        = margin;
	document.getElementById('left').style.width       = leftWidth;
	document.getElementById('left').style.height      = height - spacing - 120;

	document.getElementById('center').style.position = 'absolute';
	document.getElementById('center').style.top      = 140 + margin;
	document.getElementById('center').style.left     = margin + leftWidth + spacing;
	document.getElementById('center').style.width    = width - (spacing + leftWidth);
	document.getElementById('center').style.height   = height - 140;
	
	document.getElementById('canvas').style.width    = width - 284;
	document.getElementById('canvas').style.height   = height - 182;
	
	document.getElementById('contact').style.position = 'absolute';
	document.getElementById('contact').style.top      = height + margin;
	document.getElementById('contact').style.left     = margin;
	document.getElementById('contact').style.width    = width;
	document.getElementById('contact').style.height   = 20;
}
