function hideEdit() {
    document.getElementById('editbox').style.visibility='hidden';
}

function showEdit() {
    document.getElementById('editbox').style.visibility='visible';
}

function hidebox() {
    document.getElementById('new').style.visibility='hidden';
}

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 showbox(boxid) {
   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;
   }
   //window.alert( 'Width = ' + myWidth );
   //window.alert( 'Height = ' + myHeight );
  
   var aaa = document.getElementById(boxid);
   var offset = document.documentElement.scrollTop;
   
   var num = 250;
   if (offset > 100) {
      num = 100;
   }
   if (aaa.offsetWidth > 700) {
      num = 50;
   }
   var posY = num + offset;

   var posX = myWidth*1 / 2*1;
   var offsetX = aaa.offsetWidth*1 / 2*1;
   posX = posX - offsetX;
   aaa.style.left = posX+"px";
   aaa.style.top = posY+"px";
   aaa.style.visibility="visible";
   return false;
}

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;
  }
  return scrOfY;
}
