var bolFirst = 1;

function adjustLayout()  
{  
 // Get heights  
 var cHeight = xHeight("nav") + xHeight("secondary");  
 var rHeight = xHeight("content") + xHeight("foot-allude") + 20;  
 
 var BreadCrumb = xHeight("thepage");
 
 if (BreadCrumb)
 	{
 	cHeight += BreadCrumb+40;
	}
 	
 	
 // Find the maximum height  
 var maxHeight = Math.max(cHeight, rHeight);  

if (bolFirst == 1)
	{
	setTimeout("ShowFooter()", 600);			
	}

 // Assign maximum height to columns  
if (maxHeight > rHeight)
	{
	bolFirst = 0;		
 	xHeight("content", maxHeight - xHeight("foot-allude"));  
	}
else
	{
	if (bolFirst == 1)
		{
		setTimeout("EnableAllude()", 600);				
		bolFirst = 0;			
		}		
	}
 // Show the footer  
// xShow(footer);
 
}

function ShowFooter()
	{
	 var footer = xGetElementById('footer');
	 if (footer)
		 footer.style.display="block";				
	}

function EnableAllude()
	{
	var hallude = xGetElementById('head-allude');
	if (hallude)
		{
		hallude.style.display = "block";		
		xMoveTo(hallude, xLeft(hallude), xTop('nav')+xHeight('nav')+80);
		}
		
	adjustLayout();
	}
 
window.onload = function()  
{  
adjustLayout();
xAddEventListener(window, "resize",  
	adjustLayout, false); 
}
