function myLayer (x){
	
//object finding
if(document.layers){ // browser="NN4";
lay=document.layers[x];
}
if(document.all){ // browser="IE";
lay=eval("document.all." + x);
}
if(!document.all && document.getElementById){ // browser="NN6+ or IE5+ if you’re willing to dump the !document.all stuff";
lay=document.getElementById(x);
}
return lay;
}



function fnCaptcha(){
var numero=Math.random()*7*666;
var numero=Math.floor(numero);

myLayer("captchaNumber").innerHTML = numero;

document.form1.captchaHidden.value = numero;
}


function fnCaptchaCheck(f){

if ((f.captcha.value == "") || 

(f.email.value == "") ||


(f.captcha.value != f.captchaHidden.value)){
alert("Errore: il campo email è obbligatorio, controlla inoltre la correttezza del codice inserito");

return false

}


else{
alert("Modulo compilato correttamente");
}
return true;
}



window.onload=function(){fnCaptcha();}

