window.onload = function() 
{
  xAddEventListener(window, "resize", spOnResize, false);
	var col2 = xGetElementById('col2');
	if (col2.style) col2.style.background = "url(http://www.physics.udel.edu/image/tab.gif) repeat-y";adjustlayout();
}

function spOnResize() 
{
  adjustlayout();
}

function adjustlayout() { 
	var hdr = xHeight("header");
	var ban = xHeight("banner");
	var totalhdr = ban + hdr;
	var col1h = xHeight("col1");
	var col2h = xHeight("col2");
	var col3h = xHeight("col3");
	if (col3h > col1h) col1h = col3h;
	if (col1h > col2h) {xHeight("container",col1h);xHeight("main",col1h);}
	var colhpos = Math.floor(xClientWidth() *.8);  			/* horizontal positon of col3 -left:80%*/
	xMoveTo("col3", colhpos, totalhdr); 
	xTop("col1",totalhdr);
	xShow("footer");
}

function toggle()
	{
	var xmt = xPageX('maintab');
	var col2 = xGetElementById('col2');
	
	if (xmt > 50) {xHide('col1'); col2.style.margin = "0px 20% 0px 0px";}
	
	else {xShow('col1'); col2.style.margin = "0px 20% 0px 20%";}
	
	adjustlayout();
	}
