<!--

function mouseX(evt) {
   if (evt.pageX)
      return evt.pageX;
   else if (evt.clientX)
      return evt.clientX + (document.documentElement.scrollLeft ? document.documentElement.scrollLeft : document.body.scrollLeft);
   else
      return null;
}

function mouseY(evt) {
   if (evt.pageY)
      return evt.pageY;
   else if (evt.clientY)
      return evt.clientY + (document.documentElement.scrollTop ? document.documentElement.scrollTop : document.body.scrollTop);
   else
      return null;
}



function getInnerWindowWidth(){
    return (window.innerWidth ? window.innerWidth : (document.documentElement.clientWidth ? document.documentElement.clientWidth : document.body.offsetWidth));
}

function getInnerWindowHeight(){
    return (window.innerHeight ? window.innerHeight : (document.documentElement.clientHeight ? document.documentElement.clientHeight : document.body.offsetHeight));
}


function getDocumentWidth(){
	 return Math.max((document.documentElement && document.documentElement.scrollWidth) || (document.body && document.body.scrollWidth), getInnerWindowWidth());
	}
function getDocumentHeight(){
	 return Math.max((document.documentElement && document.documentElement.scrollHeight) || (document.body && document.body.scrollHeight), getInnerWindowHeight());
}



function getBodyScrollTop(){	
  return self.pageYOffset || (document.documentElement && document.documentElement.scrollTop) || (document.body && document.body.scrollTop);
}


function getBodyScrollLeft()
{
  return self.pageXOffset || (document.documentElement && document.documentElement.scrollLeft) || (document.body && document.body.scrollLeft);
}



function getElementLeft(id) {
   obj = (document.getElementById(id) || id);
   var x = 0;
   do {
      x += obj.offsetLeft;
      } while (typeof(obj = obj.offsetParent) != 'undefined' && obj != null);

   return x;
}


function getElementTop(id) {
   obj = (document.getElementById(id) || id);
   var y = 0;
   do {
      y += obj.offsetTop;
      } while (typeof(obj = obj.offsetParent) != 'undefined' && obj != null);
   return y;
}




function getElementWidth(id) {
  return (id.offsetWidth || document.getElementById(id).offsetWidth);
}


function getElementHeight(id) {
  return (id.offsetHeight || document.getElementById(id).offsetHeight);
}


function getInnerWindowCenterX()
{
  return getBodyScrollLeft()+getInnerWindowWidth()/2;
}
function getInnerWindowCenterY()
{
  return getBodyScrollTop()+getInnerWindowHeight()/2;
}

function moveElementToCenter(id){
    document.getElementById(id).style.left = getInnerWindowCenterX()-getElementWidth(id)/2+'px';
}


-->
