/*In the event the user changes the dimensions of their browser window
call the 'findWindowDim' function*/

window.onresize = findWindowDim;

function findWindowDim(){

/*Constructing the function to work with Netscape 6 (innerHeight)
and Netscape 7+, Mozilla 1.0.1+ and IE6+ (clientHeight).*/

//Determining browser type by functionality.
//Start IE5+, NS7 and Mozilla based on build 1.0.1

var objLinks = document.getElementById('links');

var leftHeight = document.getElementById('left').offsetHeight;
var centerHeight = document.getElementById('center').offsetHeight;
var rightHeight = document.getElementById('right').offsetHeight;
var	linksHeight = document.getElementById('links').offsetHeight;
var mastheadHeight = document.getElementById('masthead').offsetHeight;

var objFooter = document.getElementById('footer')

if (document.body.clientHeight > 200){
function hideError() {
	return true;
	}
window.onerror = hideError;

	linksY = rightHeight + mastheadHeight;
	linksYPosPx = linksY+"px";
	objLinks.style.top = linksYPosPx;

	}
//End IE5+, NS7, Mozilla 1.0.1

//Start NS6 (Mozilla 0.9.4) and exclude NS7.0 and Mozilla 1.0.1 and earlier.

if (window.setCursor && (window.innerHeight > 200)){

function hideError() {
	return true;
	}
window.onerror = hideError;

	linksY = rightHeight + mastheadHeight;
	linksYPosPx = linksY+"px";
	objLinks.style.top = linksYPosPx;
	
	}
//End NS6


/*Position footer to tallest column.*/
if ((centerHeight + mastheadHeight > leftHeight) && (centerHeight > rightHeight + linksHeight)){
	footerTop = mastheadHeight + centerHeight;
	footerTopPx = footerTop+"px"
	objFooter.style.top = footerTopPx;
	}
else if ((leftHeight > centerHeight + mastheadHeight) && (leftHeight > rightHeight + mastheadHeight + linksHeight)){
	footerTop = leftHeight;
	footerTopPx = footerTop+"px"
	objFooter.style.top = footerTopPx;	
	}
else {
	footerTop = mastheadHeight + rightHeight + linksHeight;
	footerTopPx = footerTop+"px"
	objFooter.style.top = footerTopPx;	
	}
}