function adjustLayout(onPurpose)
{
	if (!layoutRendered || onPurpose)
	{
		var childHeight = 0, otherLeftChildHeight = 0, leftChildHeight = 0, rightChildHeight = 0, parenHeight = 0, leftHeight = 0, rightHeight = 0, middleHeight = 0, wraperHeight = 0; 
		
		var leftChild  = document.getElementById('leftChild');
		if (null != leftChild)
			leftChildHeight = leftChild.offsetHeight;
		
		var leftChildStaticContent = document.getElementById('leftContentStatic');
		if (leftChildStaticContent != null)
			otherLeftChildHeight = leftChildStaticContent.offsetHeight + 80;
	  else
	  {
	    var leftChildContent = document.getElementById('leftContent');
	    if (leftChildContent != null)
	    	otherLeftChildHeight = leftChildContent.offsetHeight + 80;
	  }
		leftChildHeight = (leftChildHeight < otherLeftChildHeight)?otherLeftChildHeight:leftChildHeight;
		var rightChild = document.getElementById('rightChild');
		if (null != rightChild)
			rightChildHeight = rightChild.offsetHeight + 80;
		childHeight = (leftChildHeight < rightChildHeight)?rightChildHeight:leftChildHeight;
		var left  = document.getElementById('left');
		if (null != left)
			leftHeight = left.offsetHeight;
		
		var right = document.getElementById('right');
		if (null != right)
			rightHeight = right.offsetHeight;
		
		parentHeight = (leftHeight < rightHeight)?rightHeight:leftHeight;
		var middle = document.getElementById('middleContainer');
		if (null != middle)
			wraperHeight = middle.offsetHeight;
		
		middleHeight = (parentHeight < childHeight)?childHeight:parentHeight;
		left.style.height 	= middleHeight+'px';
		right.style.height 	= middleHeight+'px';
		
		var firstDiv = document.getElementById('firstDiv');
		if (null != firstDiv)
			middleHeight += firstDiv.offsetHeight;
		
		wraperHeight = (middleHeight < wraperHeight)?wraperHeight:middleHeight;
		middle.style.height = (wraperHeight) + 'px';
		
		if (document.getElementById('forceDownload'))
		{
			forceDownload();
		}
	}
	layoutRendered = true;
}


function writeFlashMap(id,swf,url) {
	document.getElementById(id).innerHTML = '<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,0" width="470" height="378" id="map_com" align="middle"><param name="allowScriptAccess" value="sameDomain" /><param name="FlashVars" value="url='+url+'"><param name="movie" value="'+swf+'" /><param name="quality" value="high" /><param name="wmode" value="transparent" /><embed src="'+swf+'" FlashVars="url='+url+'" quality="high" wmode="transparent" width="470" height="378" name="map_com" align="middle" allowScriptAccess="sameDomain" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" /></object>'
}

function activateSIFR()
{
    //<![CDATA[
    /* Replacement calls. Please see documentation for more information. */
    
    if(typeof sIFR == "function"){
    	sIFR.replaceElement(named({sSelector:"h3.normal", sFlashSrc: basePath + "extra/sIFR/fonts/myriad-bold-italic.swf", sColor:"#e32822", sLinkColor:"#e32822", sBgColor:"#fcc31a", sHoverColor:"#e32822", nPaddingTop:0, nPaddingBottom:0, sFlashVars:"textalign=left&offsetTop=0&underline=false"}));
    	sIFR.replaceElement(named({sSelector:"h3.staticPage", sFlashSrc: basePath + "extra/sIFR/fonts/myriad-bold-italic.swf", sColor:"#e32822", sLinkColor:"#e32822", sBgColor:"#fcc31a", sHoverColor:"#e32822", nPaddingTop:0, nPaddingBottom:0, sFlashVars:"textalign=left&offsetTop=0&underline=false"}));
    	sIFR.replaceElement(named({sSelector:"h3.comph3", sFlashSrc: basePath + "extra/sIFR/fonts/myriad-bold-italic.swf", sColor:"#e32822", sLinkColor:"#e32822",sBgColor:"#f39801", sHoverColor:"#e32822", nPaddingTop:0, nPaddingBottom:0, sFlashVars:"textalign=left&offsetTop=0&underline=false"}));
    	//sIFR.replaceElement(named({sSelector:"h5.h5red", sFlashSrc: basePath + "extra/sIFR/fonts/myriad-bold-italic.swf", sColor:"#e32822", sLinkColor:"#e32822", sBgColor:"#fcc31a", sHoverColor:"#e32822", nPaddingTop:0, nPaddingBottom:0, sFlashVars:"textalign=left&offsetTop=2&offsetBottom=0&underline=false"}));
    	//sIFR.replaceElement(named({sSelector:"h5.h5green", sFlashSrc: basePath + "extra/sIFR/fonts/myriad-bold-italic.swf", sColor:"#b18502", sLinkColor:"#b18502", sBgColor:"#fcc31a", sHoverColor:"#b18502", nPaddingTop:0, nPaddingBottom:0, sFlashVars:"textalign=left&offsetTop=2&offsetBottom=0&underline=false"}));
    	sIFR.replaceElement(named({sSelector:"h3.h3red", sFlashSrc: basePath + "extra/sIFR/fonts/myriad-bold-italic.swf", sColor:"#e32822", sLinkColor:"#e32822", sBgColor:"#fcc31a", sHoverColor:"#e32822", nPaddingTop:0, nPaddingBottom:0, sFlashVars:"textalign=left&offsetTop=0&underline=false"}));
    	sIFR.replaceElement(named({sSelector:"h3.h3black", sFlashSrc: basePath + "extra/sIFR/fonts/myriad-bold-italic.swf", sColor:"#000", sLinkColor:"#000",sBgColor:"#fcc31a", sHoverColor:"#000", nPaddingTop:0, nPaddingBottom:0, sFlashVars:"textalign=left&offsetTop=0&underline=false"}));
    	sIFR.replaceElement(named({sSelector:"h4", sFlashSrc: basePath + "/extra/sIFR/fonts/myriad-bold.swf", sColor:"#000", sLinkColor:"#000",sWmode:"transparent", sHoverColor:"#000", nPaddingTop:0, nPaddingBottom:0, sFlashVars:"textalign=left&offsetTop=0&underline=false"}));	        
    };	        
    //]]>	
}
