function getWindowSize() {
  var myWidth = 0, myHeight = 0;
  if( typeof( window.innerWidth ) == 'number' ) {
    //Non-IE
    windowSize = new Array(window.innerWidth, window.innerHeight);
  } else if( document.documentElement && ( document.documentElement.clientWidth || document.documentElement.clientHeight ) ) {
    //IE 6+ in 'standards compliant mode'
    windowSize = new Array(document.documentElement.clientWidth, document.documentElement.clientHeight);
  } else if( document.body && ( document.body.clientWidth || document.body.clientHeight ) ) {
    //IE 4 compatible
    windowSize = new Array(document.body.clientWidth, document.body.clientHeight);
  }
  // return an array with [0] = width and [1] = height
  return windowSize;
}

function getElemOffset(obj) {
	var elemOffsetX = 0;
	var elemOffsetY = 0;
    if (obj.offsetParent)
        while(1) {
			curleft += obj.offsetLeft;
			if (!obj.offsetParent)
			break;
			obj = obj.offsetParent;
        } else 
			if(obj.x)
				curleft += obj.x;
	// return an array with [0] = x offset and [1] = y offset
	elemOffset = new Array(elemOffsetX, elemOffsetY);
    return elemOffset;
	}
