function initResize() {	
	
	pntAppendElementEventHandler(window, 'onload', resize);
	pntAppendElementEventHandler(window, 'onresize', resize);
}

function resize()
{
	var dimensions = pntGetWindowInnerDimensions();
	var offset = 500;
	var marginTop = Math.floor((dimensions.height-offset)/2);
	if (marginTop<1) marginTop = 0;
	document.getElementById('wbBanners').style.marginTop = marginTop + 'px';
}

function pntGetWindowInnerDimensions()
{
	var point = new Object();
  var myWidth = 0, myHeight = 0;
  if( typeof( window.innerWidth ) == 'number' ) {
    //Non-IE
    myWidth = window.innerWidth;
    myHeight = window.innerHeight;
  } 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;
  }
  point.width = myWidth;
  point.height = myHeight;
  return point;
}

function pntAppendElementEventHandler(elem,eventName,eventHandler)
{	
	var thisScope = arguments[3];
	var currentEventHandler = elem[eventName];
	if (!currentEventHandler) {
		elem[eventName] = eventHandler;
		return;
	}
	var anomFunction = function()
	{		
		currentEventHandler.call(elem);
		if (!pntIsDefined(thisScope)) thisScope = elem;
		eventHandler.call(thisScope);
	}
	elem[eventName] = anomFunction;
}



if (document.addEventListener) {
	document.addEventListener("DOMContentLoaded", initResize, false);
} else {
	 document.onreadystatechange = function() {
  if (this.readyState == "complete") {
		initResize();
  }
 }
}




