function resize(){  
	var fdiv = document.getElementById('footer_main');
	var rdiv = document.getElementById('footer_stretch');
	if (!(rdiv.style.height)) { rdiv.style.height = '0'; }

	// Find html, window, and content heights
	var htmlHeight = document.body.parentNode.scrollHeight;  
	var windowHeight = window.innerHeight ? window.innerHeight : document.documentElement.clientHeight ? document.documentElement.clientHeight : document.body.clientHeight;
	var contentHeight =  parseInt(parseInt(getElementPosition(fdiv.id).top) - parseInt(rdiv.style.height) + 80);

	// Debug variables
	// document.getElementById('debug_div').innerHTML = htmlHeight+' '+windowHeight+' '+contentHeight+' '+a+' '+b+' '+rdiv.style.height+' '+parseInt(parseInt(rdiv.style.height) - (htmlHeight - windowHeight))+'px'+fdiv.style.height;

	// Increase height of stretch div
	if (windowHeight > contentHeight) { 
		stretch = parseInt(htmlHeight - contentHeight);
		rdiv.style.height = stretch+'px'; }

	// Decrease height of stretch div
	if (htmlHeight > windowHeight) { 
		stretch = parseInt(parseInt(rdiv.style.height) - (htmlHeight - windowHeight));
		if (stretch < 0) { stretch = 0; }
		rdiv.style.height = stretch+'px'; 
	}
}

function getElementPosition(elemID){
	var offsetTrail = document.getElementById(elemID);
	var offsetLeft = 0;
	var offsetTop = 0;

	while (offsetTrail){
		offsetLeft += offsetTrail.offsetLeft;
		offsetTop += offsetTrail.offsetTop;
		offsetTrail = offsetTrail.offsetParent;
	}

	if (navigator.userAgent.indexOf('Mac') != -1 && typeof document.body.leftMargin != 'undefined'){
		offsetLeft += document.body.leftMargin;
		offsetTop += document.body.topMargin;
	}

	return {left:offsetLeft,top:offsetTop};
}

