function animazione_flash() {
      document.write("<object type='application/x-shockwave-flash' data='intestazione.swf'width='1049' height='236' id='filmato'> ");
      document.write("<param name='movie' value='intestazione.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","nomecognome","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("Il tuo nome","Il tuo cognome e nome","Il tuo telefono","La tua email","La tua eta'","L'indirizzo","Il cap","La tua citta'","La tua Provincia","La tua email","Inserire oggetto messaggio","Il tuo messaggio");
	//3) Inserisci il messagio che deve precedere l'elenco dei campi non inseriti.
	var alertMsg = "Per favore, riempi i seguenti campi:\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.email.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.email.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 );
}

//Testo Lampeggiante
var c1='FF0000'
var c2='FFFFFF'
function colore1(){
codice='<font color=' + c1+ '><b>Last Minute </b></font>'
if(document.all)
{
document.all('testo').innerHTML=codice;
}
else if(document.getElementById){
document.getElementById("testo").innerHTML = codice
}
attesa = window.setTimeout("colore2()",500);
}
function colore2(){
codice='<font color=' + c2 + '><b>Last Minute </b></font>'
if(document.all)
{
document.all('testo').innerHTML=codice;
}
else if(document.getElementById){
document.getElementById("testo").innerHTML =codice
}
attesa = window.setTimeout("colore1()",500)
}
function avvia()
{
attesa = window.setTimeout("colore1()",500);
}


// Finestra di popup animata
function expandingWindow(website){
var windowprops='width=1,height=1,scrollbars=yes,status=no,resizable=yes,location=no'
var heightspeed = 2; 
var widthspeed = 2; 
var leftdist = 10;   
var topdist = 10; 
var lunghezza = 500;
var altezza = 600;
	if(lunghezza == 0){
		lunghezza = window.screen.availWidth;}
	if(altezza == 0){
		altezza = window.screen.availHeight;}
if (window.resizeTo&&navigator.userAgent.indexOf("Opera")==-1) {
var winwidth = lunghezza;
var winheight = altezza;
var sizer = window.open("","","left=" + leftdist + ",top=" + topdist +","+ windowprops);
for (sizeheight = 1; sizeheight < winheight; sizeheight += heightspeed)
sizer.resizeTo("1", sizeheight);
for (sizewidth = 1; sizewidth < winwidth; sizewidth += widthspeed)
sizer.resizeTo(sizewidth, sizeheight);
sizer.location = website;}
else
window.open(website,'mywindow');}



// Verifica sull'accordo della PRIVACY
var checkobj
function agreesubmit(el){
	checkobj=el
		if (document.all||document.getElementById){
				for (i=0;i<checkobj.form.length;i++){
				var tempobj=checkobj.form.elements[i]
		if(tempobj.type.toLowerCase()=="submit")
			tempobj.disabled=!checkobj.checked}
		}
		}
function defaultagree(el){
	if (!document.all&&!document.getElementById){
	if (window.checkobj&&checkobj.checked)
		return true
	else{
		alert("Per favore leggi e accetta i Termini e Condizioni!")
		return false}
	}
}