function OpenCert(id)
  {
   var newURL="/personal/cert/" + id + ".html";
   Widb=window.open(newURL,'cert','toolbar=0,scrollbars=0,location=0,directories=0,status=0,menubar=0,width=640,height=360,border=thin,top=0,left=0,help=0');
   return false;
  }

function getWindowSize() {
    var myWidth = 0, myHeight = 0;
    if( typeof( window.innerWidth ) == 'number' ) {
        //Non-IE
        myHeight = window.innerHeight;
    } else if( document.documentElement && ( document.documentElement.clientWidth || document.documentElement.clientHeight ) ) {
        //IE 6+ in 'standards compliant mode'
        myHeight = document.documentElement.clientHeight;
    } else if( document.body && ( document.body.clientWidth || document.body.clientHeight ) ) {
        //IE 4 compatible
        myHeight = document.body.clientHeight;
    }
    return myHeight;
}

function InitBottom() {
      //высота шапки
      topH  = document.getElementById("TopTable").offsetHeight;
      //высота серединки
      midH  = document.getElementById("MiddleAll").offsetHeight;
      //высота подвала
       botH  = (document.getElementById("BottomAll") ? document.getElementById("BottomAll").offsetHeight : 0);

      //высота всего контента
      Vsego = topH + midH + botH;

      //высота окна
      cliH  = getWindowSize();

      //если подвал подвис
      if (cliH > Vsego) {
         myMargin = cliH - Vsego;
         document.getElementById("MiddleAll").style.margin = '0px 0px ' + myMargin + 'px 0px';
      } else {
         document.getElementById("MiddleAll").style.margin = '0px 0px 0px 0px';
      }
}


window.onload = InitBottom;
window.onresize = InitBottom;