function sendEmail(sUser, sDomain, sSubject)
{
	location.href = 'mailto:' + sUser + '@' + sDomain + '?subject=' + sSubject;
}

function NewWindow(mypage, myname, w, h) {
	var winl = (screen.width - w) / 2;
	var wint = (screen.height - h) / 2;
	winprops = 'height='+h+',width='+w+',top='+wint+',left='+winl+',scrollbars=no,resizable=no,directories=no,status=no,location=no,toolbar=no';
	win = window.open(mypage, myname, winprops);
	if (parseInt(navigator.appVersion) >= 4) { win.window.focus(); }
}

function privacy() {
        priv = window.open("privacy-IT.asp",'privacy','scrollbars=yes,resizable=yes,directories=no,width=500,height=400,status=no,location=no,toolbar=no');
}

function cont() {
		p1 = "in";
		p2 = "fos";
		window.location = p1 + p2 + ".htm";
}

function validate_form() {
  var validity = true; // assume valid
  var msg = "Verificare i seguenti dati:\n\n";
  if (!check_empty(document.form.nome.value))
  	{ validity = false; msg=msg+'Inserire NOME\n'; }
  if (!check_empty(document.form.cognome.value))
  	{ validity = false; msg=msg+'Inserire COGNOME\n'; }
  if (!check_empty(document.form.azienda.value))
  	{ validity = false; msg=msg+'Inserire AZIENDA\n'; }
  if (!check_empty(document.form.incarico.value))
  	{ validity = false; msg=msg+'Inserire INCARICO\n'; }
  if (!check_empty(document.form.indirizzo.value))
  	{ validity = false; msg=msg+'Inserire INDIRIZZO\n'; }
  if (!check_empty(document.form.citta.value))
  	{ validity = false; msg=msg+'Inserire CITTA\'\n'; }
  if (!check_empty(document.form.provincia.value))
  	{ validity = false; msg=msg+'Inserire PROVINCIA\n'; }
  if (!check_empty(document.form.telefono.value))
  	{ validity = false; msg=msg+'Inserire TELEFONO\n'; }
  if (!check_empty(document.form.email.value) || !checkEmail(document.form.email.value))
  	{ validity = false; msg=msg+'EMAIL non corretta\n'; }
  if (!check_accetto1())
  	{ validity = false; msg=msg+'E\' necessario dare il consenso\n'; }
  if (validity) {
	  document.form.method="post";
	  document.form.action="sendmail-IT.asp";
  } else { alert (msg); }
  return validity;
}

function check_empty(text) {
  return (text.length > 0); // returns false if empty
}
function checkEmail(toCheck) {
	if (/^([\w-]+(?:\.[\w-]+)*)@((?:[\w-]+\.)*\w[\w-]{0,66})\.([a-z]{2,6}(?:\.[a-z]{2})?)$/.test(toCheck)) return true; else return false;
}
function check_accetto1() {
	if (!document.form.accetto1[0].checked)
		return false;
	return true;
}