var arrPorts = new Array();

		if (document.layers){
			window.captureEvents(Event.RESIZE) ;
			window.onresize = fnResize ;
			}
		else if (document.all){
			window.onresize = fnResize ;
			}
		else if (window.addEventListener){
			window.addEventListener("resize" , fnResize , false) ;
			};
			

function getAbsLeft(o) {
	 var oLeft=0;
     oLeft = o.offsetLeft;
     while(o.offsetParent!=null) {
		  alert( oLeft);
          oParent = o.offsetParent;
          oLeft += oParent.offsetLeft;
          oLeft -= oLeft ;    // Added this line
          o = oParent;
     }
     return oLeft;
}
function getAbsoluteLeft(oNode){
var oCurrentNode=oNode;
var iLeft=0;
while(oCurrentNode.tagName!="BODY"){
iLeft+=oCurrentNode.offsetLeft;
oCurrentNode=oCurrentNode.offsetParent;
}
return iLeft;
}
function getAbsoluteTop(oNode){
var oCurrentNode=oNode;
var iTop=0;
while(oCurrentNode.tagName!="BODY"){
iTop+=oCurrentNode.offsetTop;
oCurrentNode=oCurrentNode.offsetParent;
}
return iTop;
}
function fnResize() {
  var myWidth = 0, myHeight = 0;
  var agt=navigator.userAgent.toLowerCase();
  var docObj;
  // get window height
  if (typeof( window.innerWidth) == 'number') {
    //Non-IE
      myWidth = window.innerWidth-12;
      myHeight = window.innerHeight-8;
  } else if (document.documentElement && (document.documentElement.clientWidth || document.documentElement.clientHeight)) {
    //IE 6+ in 'standards compliant mode'
    myWidth = document.documentElement.clientWidth;
    myHeight = document.documentElement.clientHeight;
  } else if (document.body && (document.body.clientWidth || document.body.clientHeight)) {
    //IE 4 compatible
    myWidth = document.body.clientWidth;
    myHeight = document.body.clientHeight;
  }
  
  for (var iPort=0; iPort < arrPorts.length; iPort++) {
	docObj = document.getElementById(arrPorts[iPort]);
	if (docObj!=null) {
		if ((myHeight-getAbsoluteTop(docObj)) > 0){
			docObj.style.height = (myHeight-getAbsoluteTop(docObj))+'px';
			}
		if (iPort == 0) {
			if ((myWidth-getAbsoluteLeft(docObj)) > 0){
				docObj.style.width = (myWidth-getAbsoluteLeft(docObj))+'px';
				}
			} else {
				docObj.style.width=docObj.parentNode.width
			}
		}
	}

	window.scrollTo(0,0);
}

function addPort(sPort) {
	arrPorts.push(sPort);
}	
