
	// make sure the following line is in the head section of your document:
	// <script Language="javascript" src="includes/sizeObjToFooter.js" Type="text/javascript"></script>

function findPosY(obj)
{
	var curtop = 0;
	if (obj.offsetParent)
	{
		while (obj.offsetParent)
		{
			curtop += obj.offsetTop
			obj = obj.offsetParent;
		}
	}
	else if (obj.y)
		curtop += obj.y;
	return curtop;
}

function sizeObject(objectID, bottomMargin) {
  var objectTop = 0, browserHeight = 0;

  if( typeof( window.innerWidth ) == 'number' ) {
    //Non-IE works with FireFox
    objectTop = new Number(findPosY(document.getElementById(objectID)));
    browserHeight = window.innerHeight;
    document.getElementById(objectID).style.minHeight = (browserHeight - objectTop - bottomMargin) + 'px';
    //showAlerts();
  } else if( document.documentElement && ( document.documentElement.clientWidth || document.documentElement.clientHeight ) ) {
    //IE 6+ in 'standards compliant mode'
    objectTop = new Number(findPosY(document.getElementById(objectID)));
	  browserHeight = new Number(document.documentElement.clientHeight);    
    document.getElementById(objectID).style.posHeight = browserHeight - objectTop - bottomMargin;
    //showAlerts();
  } else if( document.body && ( document.body.clientWidth || document.body.clientHeight ) ) {
    //IE 4 compatible
    objectTop = new Number(findPosY(document.getElementById(objectID)));
    browserHeight = document.body.clientHeight;
    document.getElementById(objectID).style.posHeight = browserHeight - objectTop - bottomMargin;
    //showAlerts();  
  }

  function showAlerts() {
  window.alert( 'posHeight = ' + (browserHeight - objectTop - bottomMargin)); 
  window.alert( 'browserHeight = ' + browserHeight);
  window.alert( 'objectTop = ' + objectTop);
  window.alert( 'objectid = ' + objectID);
  }   
}