// JavaScript Document
<!--
function centerPop(mypage, myname, w, h, features) {
	var winl = (screen.width - w) / 2;
	var wint = (screen.height - h) / 2;
	winprops = 'height='+h+',width='+w+',top='+wint+',left='+winl+','+features
	win = window.open(mypage, myname, winprops)
	if (parseInt(navigator.appVersion) >= 4) { win.window.focus(); }
}

function indirizzoEmailValido(indirizzo) {
  if (window.RegExp) {
    var nonvalido = "(@.*@)|(\\.\\.)|(@\\.)|(\\.@)|(^\\.)";
    var valido = "^.+\\@(\\[?)[a-zA-Z0-9\\-\\.]+\\.([a-zA-Z]{2,4}|[0-9]{1,3})(\\]?)$";
    var regnv = new RegExp(nonvalido);
    var regv = new RegExp(valido);
    if (!regnv.test(indirizzo) && regv.test(indirizzo))
      return true;
    return false;
	}
  else {
	if(indirizzo.indexOf("@") >= 0)
		return true;
		return false;
	}
};

function controllo(wich){
	with(wich) {
		if(nome.value=="") {
			alert("Inserisci il tuo Nome");
			nome.focus();
			return false;
		}
		if(telefono.value=="") {
			alert("Inserisci il tuo Telefono");
			telefono.focus();
			return false;
		}
		if(indirizzoEmailValido(email.value)== false) {
			alert("Inserisci una E-Mail valida");
			email.focus();
			return false;
		}
	}
	return true;
}

function controllosem() { //v4.0
  if (document.getElementById){
    var i,p,q,nm,test,num,min,max,errors='',args=controllosem.arguments;
    for (i=0; i<(args.length-2); i+=3) { test=args[i+2]; val=document.getElementById(args[i]);
      if (val) { nm=val.name; if ((val=val.value)!="") {
        if (test.indexOf('isEmail')!=-1) { p=val.indexOf('@');
          if (p<1 || p==(val.length-1)) errors+='- '+nm+' deve contenere un indirizzo email valido.\n';
        } else if (test!='R') { num = parseFloat(val);
          if (isNaN(val)) errors+='- '+nm+' must contain a number.\n';
          if (test.indexOf('inRange') != -1) { p=test.indexOf(':');
            min=test.substring(8,p); max=test.substring(p+1);
            if (num<min || max<num) errors+='- '+nm+' must contain a number between '+min+' and '+max+'.\n';
      } } } else if (test.charAt(0) == 'R') errors += '- '+nm+' e\' richiesto.\n'; }
    } if (errors) alert('Riscontrati i seguenti errori:\n'+errors);
    document.returnValue = (errors == '');
} }

function controllo_pop(wich){
	with(wich) {
		if(nome.value=="") {
			alert("Inserisci il tuo Nome");
			nome.focus();
			return false;
		}
		if(indirizzoEmailValido(email.value)== false) {
			alert("Inserisci una E-Mail valida");
			email.focus();
			return false;
		}
	}
	return true;
}


function segnalaEmail() {
	location.href = "mailto:?Subject=Ti%20segnalo%20questo%20sito:%20www.iaki.it&Body=Ho%20trovato%20questo%20link%20molto%20interessante,%20te%20lo%20segnalo:%20http://www.iaki.it";
	urchinTracker('/pop/passa_parola.html?utm_source=IAKI&amp;utm_medium=url&amp;utm_content=Passa%2Bparola&amp;utm_campaign=contatti');
}

function stampa() {
window.open("/print_ita" + location.pathname)
}
//-->