function foto(name, w, h)
{
 window.open("show_img.php?"+name, "foto","tollbar=no,menubar=no,location=no,personalbar=no,scrollbars=yes,status=no,resizable=yes,width="+w+",height="+h+", top="+((screen.height/2)-(h/2))+",left="+((screen.width/2)-(w/2)));
}

function mleczna_apteka(name, w, h)
{
 window.open("mleczna_apteka_popup.php?"+name, "Mleczna_apteka","tollbar=no,menubar=no,location=no,personalbar=no,scrollbars=yes,status=no,resizable=no,width="+w+",height="+h+", top="+((screen.height/2)-(h/2))+",left="+((screen.width/2)-(w/2)));
}

function is_empty (form)
{
  with (form)
  {
    for (n = 0; n < length; n++)
    {
      if ((elements[n].type == 'text' || elements[n].type == 'textarea' || elements[n].type == 'password' || elements[n].type == 'file') && elements[n].value == '')
      {
        alert ('Wypełnij wszystkie pola tekstowe.');
        return true;
      }
    }
    return false;
  }
}

function is_email (email)
{
  if (!email.match (/^[_a-z0-9-]+(\.[_a-z0-9-]+)*@([a-z0-9](-?[a-z0-9])*\.)+[a-z]{2,3}$/))
  {
    alert ('Podano nieprawidłowy adres email.');
    return false;
  }
  return true;
}
