

function openwin(url,name) {
  var height = 600;
  var width = 800;
  var str = "height=" + height + ",innerHeight=" + height;
  str += ",width=" + width + ",innerWidth=" + width;
  if (window.screen) {
    var ah = screen.availHeight - 30;
    var aw = screen.availWidth - 10;
    var xc = Math.floor((aw - width) / 2);
    var yc = Math.floor((ah - height) / 2);
    str += ",left=" + xc + ",screenX=" + xc;
    str += ",top=" + yc + ",screenY=" + yc;
  }
  str += ",directories=0,location=0,menubar=1,personalbar=1,scrollbars=1,status=1,toolbar=1";
  return window.open(url,name,str);
}
function zkontroluj_email(adresa) {
  re = /^[^.]+(\.[^.]+)*@([^.]+[.])+[a-z]{2,3}$/;
  return adresa.search(re) == 0;
}

function zkontroluj_telefon(cislo) {
  re = /^[+]? ?\d{3,14} ?\d{2,9} ?\d{2,6} ?\d{2,3} ?\d{0,2}$/;
  return cislo.search(re) == 0;
}

function Form_Validatore(theForm)
		{

		if (theForm.Jméno.value == "")
			{
				alert("Zadejte jméno ...");
				theForm.Jméno.focus();
				return (false);
			}
			if (theForm.Ulice.value == "")
			{
				alert("Zadejte ulici ...");
				theForm.Ulice.focus();
				return (false);
			}
			if (theForm.Město.value == "")
			{
				alert("Zadejte město ...");
				theForm.Město.focus();
				return (false);
			}
			if (theForm.PSČ.value == "")
			{
				alert("Zadejte PSČ ...");
				theForm.PSČ.focus();
				return (false);
			}
			if (!zkontroluj_telefon(theForm.Telefon.value) && !zkontroluj_telefon(theForm.Mobil.value)) {
			   theForm.Telefon.style.backgroundColor = "#c00";
			   theForm.Telefon.style.color = "#fff";
  		   theForm.Mobil.style.backgroundColor = "#c00";
			   theForm.Mobil.style.color = "#fff";
			   alert("Nevyplnily jste správně svůj kontaktní telefon nebo mobil!");
			   return (false);
		  }
			if (!zkontroluj_email(theForm.Email.value)) {
  		    theForm.Email.style.backgroundColor = "#c00";
  		    theForm.Email.style.color = "#fff";
		    	alert("Nevyplnily jste správně svůj kontaktní E-mail!");
		    	theForm.Email.focus();
		    	return (false);
	   	}
	   	
		return (true);
		}
