  function ShowWin(url,x,y,name,isscrollbars)
   {
     cx = screen.width/2 - x/2;
     cy = screen.height/2 - y/2;

     isscrollbars=(isscrollbars=="no")?"no":"yes";
     window.open(url,name,"toolbar=no,status=no,directories=no,menubar=no,resizable=no,width="+x+",height="+y+",scrollbars="+isscrollbars+",top="+cy+",left="+cx);
   }

  function ShowImg(ImgPath, x, y)
   {
     cx = screen.width/2 - x/2;
     cy = screen.height/2 - y/2;
     var w = window.open("","pirz_guestbook","toolbar=no,status=no,directories=no,menubar=no,resizable=no,width="+x+",height="+y+",scrollbars=no,top="+cy+",left="+cx);
     var d = w.document;
     d.open();
     d.write('<html><head><link rel="stylesheet" type="text/css" href="/admin/css/style.css"></head>');
     d.write('<body><img src = "' + ImgPath + '"</body></html>');
     d.close();
   }

  function autofocus(field, limit, next, evt)
   {
     evt = (evt) ? evt : event;
     var charCode = (evt.charCode) ? evt.charCode : ((evt.keyCode) ?
         evt.keyCode : ((evt.which) ? evt.which : 0));
     if (charCode > 31 && field.value.length == limit)
     {
       field.form.elements[next].focus();
     }
   }

  function close_alert()
   {
     document.getElementById('alert_shadow').style.visibility = "hidden";
     document.getElementById('alert_message').style.visibility = "hidden";
   }

  function close_div(div_id)
   {
     document.getElementById(div_id).style.visibility = "hidden";
   }
