

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=1,location=1,menubar=1,personalbar=1,scrollbars=1,status=1,toolbar=1,resizable=1";
  window.open(url,name,str);
  return false;
}

function tisk_polozky() {
		window.print();
		return false;
}


//////*****************************************************************///
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) {// jeden nebo druhy
	
	if (!zkontroluj_telefon(theForm.textfield2.value) && !zkontroluj_email(theForm.textfield6.value)) {
			theForm.textfield2.style.backgroundColor = "#c00";
			theForm.textfield2.style.color = "#fff";
  		theForm.textfield6.style.backgroundColor = "#c00";
			theForm.textfield6.style.color = "#fff";
			
			alert("Si prega di compilare il tuo numero di telefono corretto o e-mail!");

			return (false);
		}
	if (!theForm.textfield.value) {
			theForm.textfield.style.backgroundColor = "#FFD1D1";
			alert("Si prega di compilare il tuo nome ...");
			theForm.textfield.focus();
			return (false);
		}

	return (true);
}


