function launchWin(obrazek, w, h, popis)
         {
         var vlastnosti = "width=" + w + "; height=" + h + "; toolbar=no; location=no; status=no; menubar=no; directories=no; resizable=yes, scrollbars=yes";
         var aboutWindow = window.open("", "win", vlastnosti);
         aboutWindow.resizeTo(w,h);
         aboutWindow.document.open();
         aboutWindow.document.write("<html>\n");
         aboutWindow.document.write("<meta http-equiv=\"content-language\" content=\"cs\">\n");
         aboutWindow.document.write("<meta http-equiv=\"msthemecompatible\" content=\"no\">\n");
         aboutWindow.document.write("<meta http-equiv=\"imagetoolbar\" content=\"no\">\n");
         aboutWindow.document.write("<body bgcolor=#ffffff topmargin=0 leftmargin=0><img src='" + obrazek + "' alt='" + popis + "'>\n</body></html>");
         aboutWindow.document.title = popis;
         aboutWindow.document.close();
         aboutWindow.focus();
         }

function kontrola(){

   var errmsg = '';

   var filter_jm = /^[A-Z؎a-z]*$/;
   var filter_ul_me = /^[A-Za-z0-9 ,.\-/]+$/;
   var filter_mail = /^[_a-zA-Z0-9\.\-]+@[a-zA-Z0-9\.\-]+\.[a-zA-Z]{2,5}$/;
   var filter_tel = /^\+?[0-9]{0,3} ?[0-9]{3} ?[0-9]{3} ?[0-9]{3}$/;

      elem=document.src.jmeno;
      iActive('off',elem);
      if (elem.value==''){
           errmsg = errmsg + 'Zadejte platn jmno.\n';
           iActive('error',elem);
      }


      elem=document.src.telefon;
      iActive('off',elem);
      if (!filter_tel.test(elem.value))
          {
           errmsg = errmsg + 'Zadejte platn telefonn slo.\n';
           iActive('error',elem);
          }

      elem=document.src.email;
      if (elem!=''){
      iActive('off',elem);
      if (!filter_mail.test(elem.value))
          {
           errmsg = errmsg + 'Zadejte platnou e-mailovou adresu.\n';
           iActive('error',elem);
          }
      }    



    if (errmsg!=""){
        alert(errmsg);
        }
        else
        {
        document.src.action='?action=send';
        document.src.submit();
     }


}

function iActive(stav,elem){
  switch(stav){
  case 'on':      elem.style.borderColor='#FDFF00'; elem.style.backgroundColor='#FFFFFF'; break;
  case 'off':     elem.style.borderColor='#ADADAD'; elem.style.backgroundColor='#FFFFFF'; break;
  case 'error':   elem.style.borderColor='#BE1F2D'; elem.style.backgroundColor='#f4acb1'; break;
  }
}
