function getHeight()
{
  var h = 600;
  if (window.innerHeight)
  {
    h = window.innerHeight;
  } 
  else if (document.body.clientHeight) h = document.body.clientHeight;
  return h;
}
function check_height()
{
  var h = getHeight();
  if (h>550)
  {
    document.write('<style type="text/css">#main {top:'+Math.ceil((h-550)/2)+'px; position:absolute; }</style>');
  }
}
function openPreview(src, w, h)
{
  tmpWindow = window.open("", "_popup", "width="+w+",height="+h+",status=no,toolbar=no,menubar=no");
  tmpWindow.document.open();  
  tmpWindow.document.write('<html><head><title>Бомба - фоогалерея</title></head><body style="background:#FFFFFF; margin:0px; padding:0px;"><img src=' + src + ' border="0" /></body></html>');
  tmpWindow.document.close();
}
function checkForm(frm, arr)
{
  el = null;
  err = '';
  for(i in arr)
  {
    switch(frm.elements[i].type)
    {
      case 'text':
      case 'password':
        if (frm.elements[i].value == '')
        {
          if (!el) el = frm.elements[i];
          err += arr[i] + "\n";
        }
    	break;
      case 'select-one':
        if (frm.elements[i].selectedIndex == 0)
        {
          if (!el) el = frm.elements[i];
          err += arr[i] + "\n";
        }
    	break;
    }
  }
  if (err == '') return true;
  else
  {
    el.focus();
    alert("Please fill in required fields:\n-----------------------------------\n" + err + "-----------------------------------");
    return false;
  }
}
function MM_reloadPage(init) {  //reloads the window if Nav4 resized
  if (init==true) with (navigator) {if ((appName=="Netscape")&&(parseInt(appVersion)==4)) {
    document.MM_pgW=innerWidth; document.MM_pgH=innerHeight; onresize=MM_reloadPage; }}
  else if (innerWidth!=document.MM_pgW || innerHeight!=document.MM_pgH) location.reload();
}
MM_reloadPage(true);