

function openwin(url,name) {
  var height = 800;
  var width = 1000;
  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=1,menubar=1,personalbar=1,scrollbars=1,status=1,toolbar=1,resizable=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.jmeno.value == "")
			{
				theForm.jmeno.style.backgroundColor = "#FFD1D1";
				alert("Nevyplnily jste své jméno!");
				theForm.jmeno.focus();
				return (false);
			}
			if (theForm.prijmeni.value == "")
			{
				theForm.prijmeni.style.backgroundColor = "#FFD1D1";
				alert("Nevyplnily jste své příjmení!");
				theForm.prijmeni.focus();
				return (false);
			}
			if (theForm.www.value == "")
			{
				theForm.www.style.backgroundColor = "#FFD1D1";
				alert("Nevyplnily jste internetovou adresu Vašich stránek!");
				theForm.www.focus();
				return (false);
			}
			if (!zkontroluj_email(theForm.email.value))
  		{
    		theForm.email.style.backgroundColor = "#FFD1D1";
				alert("Nevyplnily jste správně svůj kontaktní e-mail!");
				theForm.email.focus();
				return (false);
  }			
			
			if (!zkontroluj_telefon(theForm.tel.value))
			{
				theForm.tel.style.backgroundColor = "#FFD1D1";
				alert("Nevyplnily jste správně svůj kontaktní telefon!");
				theForm.tel.focus();
				return (false);
			}
		
		return (true);
		}