<!--

// -----------------------------------------------------------------------------------------

// js to place footer at bottom of the page or bottom of content, depending on window height



var bitExtra = 60;



function getWindowHeight() {

	var windowHeight=0;

	if (typeof(window.innerHeight)=='number') {

		windowHeight=window.innerHeight;

	} else {

		if (document.documentElement&&document.documentElement.clientHeight) {

			windowHeight=document.documentElement.clientHeight;

		} else {

			if (document.body&&document.body.clientHeight) {

				windowHeight=document.body.clientHeight;

			}

		}

	}

	return windowHeight;

}



function setFooter() {

	if (document.getElementById) {

		var windowHeight=getWindowHeight();

		var footerElement=document.getElementById('footer');

		

		var subcolHeight = 0;

		var maincolHeight = 0;

		var xcolHeight = 0;

		

		if (windowHeight>0) {

			

			var headerHeight = document.getElementById('header').offsetHeight;

			if(document.getElementById('subcol')) { var subcolHeight = document.getElementById('subcol').offsetHeight; }

			if(document.getElementById('maincol')) { var maincolHeight = document.getElementById('maincol').offsetHeight; }

			if(document.getElementById('xcol')) { var xcolHeight = document.getElementById('xcol').offsetHeight; }

			

			// find the tallest

			var foo = new Array(subcolHeight,maincolHeight,xcolHeight); 

			var tallestCol = 0; 

			for (x=0;x<foo.length;x++){ 

				if (foo[x] > tallestCol) { 

				tallestCol = foo[x]

				} 

			}

			

			var contentHeight = headerHeight + tallestCol + bitExtra;

			

			

			//jsAlerts(windowHeight,headerHeight,subcolHeight,maincolHeight,xcolHeight,contentHeight);



			

			if (windowHeight>contentHeight) {



				footerElement.style.position='absolute';

				footerElement.style.bottom='0px';

				document.getElementById('uberContainer').style.height = '100%';

			} else {

				//alert('windowHeight<contentHeight');

				footerElement.style.position='relative';

				document.getElementById('uberContainer').style.height = 'auto';

				}

		}

		footerElement.style.visibility = 'visible';

	}

}



function jsAlerts(windowHeight,headerHeight,subcolHeight,maincolHeight,xcolHeight,contentHeight) {

	alert('windowHeight = '+windowHeight);

	alert('headerHeight = '+headerHeight);

	alert('subcolHeight = '+subcolHeight);

	alert('maincolHeight = '+maincolHeight);

	alert('xcolHeight = '+xcolHeight);

	alert('contentHeight = '+contentHeight);

}



function initSetFooter() {

	// test for IE Mac

	// this has problems with 100% height divs

	if (document.all && !window.print) {

		//alert('mac ie');

		document.getElementById('uberContainer').style.height = getWindowHeight()+'px';

	}



	setFooter();

}





window.onload = initSetFooter;

window.onresize = initSetFooter;



//-->
