function animazione_flash() {
      document.write("<object type='application/x-shockwave-flash' data='header.swf' width='800' height='242' id='filmato'> ");
      document.write("<param name='movie' value='header.swf' /> ");
      document.write("<param name='quality' value='high' /><param name='wmode' value='transparent' /> ");
      document.write("</object> ");
}

//Controllo campi obbligatori
function formCheck(formobj){
	//1) Inserisci il nome che hai assegnato ai tuoi campi con name
	var fieldRequired = Array("nome","telefono","email","eta","indirizzo","cap","citta","provincia","mail","oggetto","messaggio");
	//2) Inserisci la descrizione del campo da riempire che appare nel messaggio a video
	var fieldDescription = Array("Su nombre completo","Su teléfono","Su correo electrónico","Su edad","La dirección","Il cap","Tu Ciudad","Nacion","E-mail","Inserire oggetto messaggio","Mensaje");
	//3) Inserisci il messagio che deve precedere l'elenco dei campi non inseriti.
	var alertMsg = "Por favor, rellene los siguientes campos:\n";
	
	var l_Msg = alertMsg.length;
	
	for (var i = 0; i < fieldRequired.length; i++){
		var obj = formobj.elements[fieldRequired[i]];
		if (obj){
			switch(obj.type){
			case "select-one":
				if (obj.selectedIndex == -1 || obj.options[obj.selectedIndex].text == ""){
					alertMsg += " - " + fieldDescription[i] + "\n";
				}
				break;
			case "select-multiple":
				if (obj.selectedIndex == -1){
					alertMsg += " - " + fieldDescription[i] + "\n";
				}
				break;
			case "text":
			case "textarea":
				if (obj.value == "" || obj.value == null){
					alertMsg += " - " + fieldDescription[i] + "\n";
				}
				break;
			default:
				if (obj.value == "" || obj.value == null){
					alertMsg += " - " + fieldDescription[i] + "\n";
				}
			}
		}
	}

	if (alertMsg.length == l_Msg){
		return true;
	}else{
		alert(alertMsg);
		return false;
	}
}

function formCheck1(formobj){
	//1) Inserisci il nome che hai assegnato ai tuoi campi con name
	var fieldRequired = Array("data1","data2");
	//2) Inserisci la descrizione del campo da riempire che appare nel messaggio a video
	var fieldDescription = Array("Del","Al");
	//3) Inserisci il messagio che deve precedere l'elenco dei campi non inseriti.
	var alertMsg = "Por favor, rellene los siguientes campos:\n";
	
	var l_Msg = alertMsg.length;
	
	for (var i = 0; i < fieldRequired.length; i++){
		var obj = formobj.elements[fieldRequired[i]];
		if (obj){
			switch(obj.type){
			case "select-one":
				if (obj.selectedIndex == -1 || obj.options[obj.selectedIndex].text == ""){
					alertMsg += " - " + fieldDescription[i] + "\n";
				}
				break;
			case "select-multiple":
				if (obj.selectedIndex == -1){
					alertMsg += " - " + fieldDescription[i] + "\n";
				}
				break;
			case "text":
			case "textarea":
				if (obj.value == "" || obj.value == null){
					alertMsg += " - " + fieldDescription[i] + "\n";
				}
				break;
			default:
				if (obj.value == "" || obj.value == null){
					alertMsg += " - " + fieldDescription[i] + "\n";
				}
			}
		}
	}

	if (alertMsg.length == l_Msg){
		return true;
	}else{
		alert(alertMsg);
		return false;
	}
}
//Controllo email!
function ControllaMail(){
   EmailAddr = document.modulo.mail.value;
   Filtro = /^([a-zA-Z0-9_\.\-])+\@(([a-zA-Z0-9\-]{2,})+\.)+([a-zA-Z0-9]{2,})+$/;
   if (Filtro.test(EmailAddr))
      return true;
   else
      {
		  if(EmailAddr != ""){
			  alert("Indirizzo e-mail non valido!");
			  document.modulo.mail.focus();
			  return false;
		}
      }
}
// Verifica maggiorenne
function valid_eta(){
	anni = document.modulo.eta.value;
  if (anni.length!=0 && anni<18){
  	 alert("Devi essere maggiorenne per registrarti!");
	 document.modulo.eta.focus();
  }
}
// Verifica campi numerici
function validate(){
var test=document.modulo.eta.value;
var test1=document.modulo.cap.value;
var test2=document.modulo.telefono.value;
var strNumber = isNaN (test);
var strNumber1 = isNaN (test1);
var strNumber2 = isNaN (test2);
if (strNumber == true) {alert (test+ " non e' un numero!");
document.modulo.eta.focus();}
if (strNumber1 == true) {alert (test1+ " non e' un numero!");
document.modulo.cap.focus();}
if (strNumber2 == true) {alert (test2+ " non e' un numero!");
document.modulo.telefono.focus();}
}

// Solo campi numerici
function verificanumero(champ){
var chiffres = new RegExp("[0-9\.]");
var verif;
var points = 0;
for(x = 0; x < champ.value.length; x++){
verif = chiffres.test(champ.value.charAt(x));
if(champ.value.charAt(x) == "."){points++;}
if(points > 1){verif = false; points = 1;}
if(verif == false){champ.value = champ.value.substr(0,x) + champ.value.substr(x+1,champ.value.length-x+1); x--;}
}
}

//Popup a centro pagina
function centerPopUp( url, name, width, height, scrollbars ) {
if( scrollbars == null ) scrollbars = "0"
str = "";
str += "resizable=1,";
str += "scrollbars=" + scrollbars + ",";
str += "width=" + width + ",";
str += "height=" + height + ",";
if ( window.screen ) {
var ah = screen.availHeight - 30;
var aw = screen.availWidth - 10;
var xc = ( aw - width ) / 2;
var yc = ( ah - height ) / 2;
str += ",left=" + xc + ",screenX=" + xc;
str += ",top=" + yc + ",screenY=" + yc;
}
window.open( url, name, str );
}