function getViewportSize() {
  var intWidth = 0, intHeight = 0;
  if( typeof( window.innerWidth ) == 'number' ) {
    //Non-IE
    intWidth = window.innerWidth;
    intHeight = window.innerHeight;
  } else if( document.documentElement && ( document.documentElement.clientWidth || document.documentElement.clientHeight ) ) {
    //IE 6+ in 'standards compliant mode'
    intWidth = document.documentElement.clientWidth;
    intHeight = document.documentElement.clientHeight;
  } else if( document.body && ( document.body.clientWidth || document.body.clientHeight ) ) {
    //IE 4 compatible
    intWidth = document.body.clientWidth;
    intHeight = document.body.clientHeight;
  }
  
	arrReturn = new Object();
	arrReturn['width'] = intWidth;
	arrReturn['height'] = intHeight;
	return arrReturn;
}

function getScrollXY() {
  var scrOfX = 0, scrOfY = 0;
  if( typeof( window.pageYOffset ) == 'number' ) {
    //Netscape compliant
    scrOfY = window.pageYOffset;
    scrOfX = window.pageXOffset;
  } else if( document.body && ( document.body.scrollLeft || document.body.scrollTop ) ) {
    //DOM compliant
    scrOfY = document.body.scrollTop;
    scrOfX = document.body.scrollLeft;
  } else if( document.documentElement && ( document.documentElement.scrollLeft || document.documentElement.scrollTop ) ) {
    //IE6 standards compliant mode
    scrOfY = document.documentElement.scrollTop;
    scrOfX = document.documentElement.scrollLeft;
  }
  
  arrReturn = new Object();
  arrReturn['offX'] = scrOfX;
  arrReturn['offY'] = scrOfY;
  return arrReturn;
}

function getPageSizeWithScroll(){
	if (window.innerHeight && window.scrollMaxY) {
		// Firefox         
		yWithScroll = window.innerHeight + window.scrollMaxY;         
		xWithScroll = window.innerWidth + window.scrollMaxX;     
	} else if (document.body.scrollHeight > document.body.offsetHeight) { 
		// all but Explorer Mac         
		yWithScroll = document.body.scrollHeight;         
		xWithScroll = document.body.scrollWidth;     
	} else { 
		// works in Explorer 6 Strict, Mozilla (not FF) and Safari         
		yWithScroll = document.body.offsetHeight;         
		xWithScroll = document.body.offsetWidth;       
	}     
	
	arrReturn = new Object();
  	arrReturn['height'] = yWithScroll;
  	arrReturn['width'] = xWithScroll; 
	     
	return arrReturn; 
}
