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.asp",'privacy','scrollbars=yes,resizable=yes,directories=no,width=490,height=400,status=no,location=no,toolbar=no');
}

function c(p) {
	document.getElementById("img250b").style.backgroundImage = 'url('+p+')';
}


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.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 o Stato\n'; }
  if (!check_empty(document.form.Telefono.value))
  	{ validity = false; msg=msg+'Inserire Telefono\n'; }
  if (!check_empty(document.form.email.value) || !check_email(document.form.email.value))
  	{ validity = false; msg=msg+'EMAIL non corretta\n'; }
  if (!check_accetto())
  	{ validity = false; msg=msg+'Accettare le condizioni\n'; }
if (!validity)
  	alert (msg);
  return validity;
}
function check_empty(text) {
  return (text.length > 0); // returns false if empty
}
function check_email(Email) {
  if ((Email == "")
    || (Email.indexOf ('@') == -1)
    || (Email.indexOf ('.') == -1))
      return false;
  return true;
}
function check_accetto() {
	if (!document.form.accetto.checked)
		return false;
	return true;
}
