
  function hideRegForm ()
  {
    document.getElementById('regForm').style.display = 'none';
    document.getElementById('regFormBg').style.display = 'none';
    document.body.style.overflowX = 'visible';
    return false;
  }

  function positionRegForm (o)
  {
    var s = getBodySize();
    
    document.getElementById('regFormBg').style.width = s[0] + 'px';
    document.getElementById('regFormBg').style.height = s[1] + 'px';
    
    document.getElementById('regFormBg').style.display = 'block';
  
    var l = document.getElementById('regForm');
    
    var pos = findPos(o);
    
    l.style.display = 'block';

    l.style.left = (pos[0] - l.offsetWidth + 33) + 'px';
    l.style.top  = (pos[1] - l.offsetHeight + 222) + 'px';
    
    if (!window.navigator.userAgent.match(/Opera/)) document.body.style.overflowX = 'hidden';  
  }
  
  function getBodySize() {
    var myWidth = 0, myHeight = 0;
    if( typeof( window.innerWidth ) == 'number' ) {
      //Non-IE
      myWidth = window.innerWidth;
      //myHeight = window.innerHeight;
      myHeight = document.body.clientHeight + 100;
//      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.scrollHeight;
    } else if( document.body && ( document.body.clientWidth || document.body.clientHeight ) ) {
      //IE 4 compatible
      myWidth = document.body.clientWidth;
      myHeight = document.body.scrollHeight;
    }
    
    return [myWidth, myHeight];
  }
