// GALLERIA

function galleria(nome){
			window.open(nome,"finestra", "height=489,width=700,status=no,toolbar=no,menubar=no,location=no,scrollbars=no");
			}
function cartina(nome){
			window.open(nome,"cartina", "height=450,width=600,status=no,toolbar=no,menubar=no,location=no,scrollbars=no");
			}
function foto_evento(nome){
			window.open(nome,"foto", "height=375,width=373,status=no,toolbar=no,menubar=no,location=no,scrollbars=no");
			}
function apri_credits(nome){
			window.open("http://www.ma-tic.com/credits/credits.htm","credits", "height=220,width=234,status=no,toolbar=no,menubar=no,location=no,scrollbars=no");
			}
function apri_popup(nome){
			window.open(nome,"popup", "height=533,width=800,status=no,toolbar=no,menubar=no,location=no,scrollbars=no");
			}
function privacy(theURL,winName,features) { //v2.0
  window.open("http://www.aslico.org/privacy.htm","privacy","width=550,height=300,scrollbars=yes");
}
//    ONMOUSEOVER



function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}

function MM_swapImgRestore() { //v3.0
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}

function MM_findObj(n, d) { //v4.01
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}

function MM_swapImage() { //v3.0
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}



//POPUP
function apri(nome){
			window.open(nome,"finestra", "height=445,width=420,status=no,toolbar=no,menubar=no,location=no,scrollbars=yes");
			}

function curriculum(nome){
			window.open(nome,"curriculum", "height=500,width=520,status=no,toolbar=no,menubar=no,location=no,scrollbars=yes");
			}
// pagina contatti **********************************************


function check_contatti() {
      var check = 0

      if (document.contatti.cognome.value == "") {
           alert("Insert your Surname");
		   return false
      }else check++

      if (document.contatti.nome.value == "") {
           alert("Insert your Name");
		   return false
      }else check++

      
      if (document.contatti.testo.value == "") {
           alert("Insert the Text")
		   return false
      }else check++
  
 		
	  if (check < 3){
			return false
	  }else return true

}

function check_mail_contatti()
 {	
   if ((document.contatti.email.value.indexOf("@") == -1) | (document.contatti.email.value.indexOf(".") == -1) | (document.contatti.email.length < 7)) 
        {
		window.alert("Insert a valid E-mail address")
		document.contatti.email.value="";
		document.contatti.email.focus();
		return false
	}
   else 
        {
 		return true
	}
}

function invia_contatti(){
	if (check_contatti() && check_mail_contatti()){ 
		document.contatti.submit()
	}	
}

// pagina newsletter **********************************************

function controlla_nl() {
      var check = 0
      if (document.newsl.nome.value.length == 0) {
           alert("Insert your Name");
		   return false
      }else check++
	  
  
      if (check < 1) {
           return false
      }else return true
		
}
function verifica_mail_nl()
 {
   if ((document.newsl.email.value.indexOf("@") == -1) | (document.newsl.email.value.indexOf(".") == -1) | (document.newsl.email.length < 7)) 
        {
		window.alert("Insert a valid E-mail address")
		document.newsl.email.value="";
		document.newsl.email.focus();
		return false
	}
   else 
        {
 		return true
	}
}

function verifica_data() {
if (document.newsl.data_nascita.value.length!=0){
	if(document.newsl.data_nascita.value.length!=10 || document.newsl.data_nascita.value.indexOf("/")==-1) {
		alert("Check your birthdate!\n Eg: 04/06/1974")
		document.newsl.data_nascita.value=""
		document.newsl.data_nascita.focus()
		return false
	} 
	else {
		 return true
		 }
}else {
		return true
	}
} 

function invia_nl() {
	if (controlla_nl() && verifica_mail_nl() && verifica_data()) {
		document.newsl.submit()
	} 
}


// pagina iscrizione 1 **********************************************

function cambia(valore)
{
	switch (valore){
		//traviata
		case "violetta" :
			document.iscrizione1.violetta.checked = true;
			document.iscrizione1.alfredo.checked = false;
			document.iscrizione1.germont.checked = false;
			document.iscrizione1.ruolotraviata.value=valore;
			break;
		case "alfredo" :
			document.iscrizione1.alfredo.checked = true;
			document.iscrizione1.violetta.checked = false;
			document.iscrizione1.germont.checked = false;
			document.iscrizione1.ruolotraviata.value=valore;
			break;
		case "germont" :
			document.iscrizione1.germont.checked = true;
			document.iscrizione1.violetta.checked = false;
			document.iscrizione1.alfredo.checked = false;
			document.iscrizione1.ruolotraviata.value=valore;
			break;
		//elisir
		case "nemorino" :
			document.iscrizione1.nemorino.checked = true;
			document.iscrizione1.adina.checked = false;
			document.iscrizione1.belcore.checked = false;
			document.iscrizione1.dulcamara.checked = false;
			document.iscrizione1.ruoloelisir.value=valore;
			break;	
		case "adina" :
			document.iscrizione1.nemorino.checked = false;
			document.iscrizione1.adina.checked = true;
			document.iscrizione1.belcore.checked = false;
			document.iscrizione1.dulcamara.checked = false;
			document.iscrizione1.ruoloelisir.value=valore;
			break;
		case "belcore" :
			document.iscrizione1.nemorino.checked = false;
			document.iscrizione1.adina.checked = false;
			document.iscrizione1.belcore.checked = true;
			document.iscrizione1.dulcamara.checked = false;
			document.iscrizione1.ruoloelisir.value=valore;
			break;
		case "dulcamara" :
			document.iscrizione1.nemorino.checked = false;
			document.iscrizione1.adina.checked = false;
			document.iscrizione1.belcore.checked = false;
			document.iscrizione1.dulcamara.checked = true;
			document.iscrizione1.ruoloelisir.value=valore;
			break;
		//werther
		case "werther" :
			document.iscrizione1.werther.checked = true;
			document.iscrizione1.charlotte.checked = false;
			document.iscrizione1.sophie.checked = false;
			document.iscrizione1.albert.checked = false;
			document.iscrizione1.ruolowerther.value=valore;
			break;
		case "charlotte" :
			document.iscrizione1.werther.checked = false;
			document.iscrizione1.charlotte.checked = true;
			document.iscrizione1.sophie.checked = false;
			document.iscrizione1.albert.checked = false;
			document.iscrizione1.ruolowerther.value=valore;
			break;	
		case "sophie" :
			document.iscrizione1.werther.checked = false;
			document.iscrizione1.charlotte.checked = false;
			document.iscrizione1.sophie.checked = true;
			document.iscrizione1.albert.checked = false;
			document.iscrizione1.ruolowerther.value=valore;
			break;	
		case "albert" :
			document.iscrizione1.werther.checked = false;
			document.iscrizione1.charlotte.checked = false;
			document.iscrizione1.sophie.checked = false;
			document.iscrizione1.albert.checked = true;
			document.iscrizione1.ruolowerther.value=valore;
			break;	
		
	}	
}

function invia_iscrizione1(){
	//if (document.iscrizione1.ruolotraviata.value!="" && document.iscrizione1.ruoloelisir.value!="" && document.iscrizione1.ruolowerther.value!="" ){
		document.iscrizione1.submit()	
	//}else window.alert("Per proseguire č necessario scegliere un ruolo per ogni opera a concorso");
	
}

// pagina iscrizione 1 inglese **********************************************

function invia_iscrizione1_en(){
	//if (document.iscrizione1_en.ruolotraviata.value!="" && document.iscrizione1_en.ruoloelisir.value!="" && document.iscrizione1_en.ruolowerther.value!="" ){
		document.iscrizione1_en.submit()	
	//}else window.alert("Per proseguire č necessario scegliere un ruolo per ogni opera a concorso");
	
}

// pagina iscrizione 3 **********************************************

function check_iscrizione3() {
      var check = 0

      if (document.iscrizione3.cognome.value == "") {
           alert("Inserisci il tuo Cognome");
		   return false
      }else check++

      if (document.iscrizione3.nome.value == "") {
           alert("Inserisci il tuo Nome");
		   return false
      }else check++

      
      if (document.iscrizione3.indirizzo.value == "") {
           alert("Inserisci l'indirizzo")
		   return false
      }else check++
  
	  if (document.iscrizione3.cap.value == "") {
           alert("Inserisci il cap")
		   return false
      }else check++
      
      if (document.iscrizione3.nazionalita.value == "") {
           alert("Inserisci la nazionalita")
		   return false
      }else check++
 		
 	  if (document.iscrizione3.telefono.value == "") {
           alert("Inserisci il telefono")
		   return false
      }else check++
      
      if (document.iscrizione3.fax.value == "") {
           alert("Inserisci il fax")
		   return false
      }else check++
      
      if (document.iscrizione3.email.value == "") {
           alert("Inserisci l'indirizzo email")
		   return false
      }else check++
      
      if (document.iscrizione3.data_nascita.value == "") {
           alert("Inserisci la data di nascita")
		   return false
      }else check++
      
      if (document.iscrizione3.insegnante_canto.value == "") {
           alert("Inserisci il nome dell'insegnante di canto")
		   return false
      }else check++
 	  
 	  
 	  if (document.iscrizione3.registro_vocale.value == "") {
           alert("Inserisci il registro vocale")
		   return false
      }else check++
      
      if (document.iscrizione3.citta_preselezione.value == "") {
           alert("Inserisci il nome della cittā per la preselezione")
		   return false
      }else check++
      
      if (document.iscrizione3.curriculum.value == "") {
           alert("Inserisci il file del curriculum")
		   return false
      }else check++
      	
	  if (check < 13){
			return false
	  }else return true

}

function check_mail_iscrizione3()
 {	
   if ((document.iscrizione3.email.value.indexOf("@") == -1) | (document.iscrizione3.email.value.indexOf(".") == -1) | (document.iscrizione3.email.length < 7)) 
        {
		window.alert("Inserisci un indirizzo E-mail corretto")
		document.iscrizione3.email.value="";
		document.iscrizione3.email.focus();
		return false
	}
   else 
        {
 		return true
	}
}

function verifica_data_iscrizione3() {
if (document.iscrizione3.data_nascita.value.length!=0){
	if(document.iscrizione3.data_nascita.value.length!=10 || document.iscrizione3.data_nascita.value.indexOf("/")==-1) {
		alert("Hai inserito una data errata\n  o in formato non valido\n      es: 04/06/1974")
		document.iscrizione3.data_nascita.value=""
		document.iscrizione3.data_nascita.focus()
		return false
	} 
	else {
		 return true
		 }
}else {
		return true
	}
} 

function invia_iscrizione3(){
	if (check_iscrizione3() && check_mail_iscrizione3() &&  verifica_data_iscrizione3()){ 
		document.iscrizione3.submit()
	}	
}


// pagina iscrizione 3 inglese **********************************************

function check_iscrizione3_en() {
      var check = 0

      if (document.iscrizione3_en.cognome.value == "") {
           alert("Insert your Surname");
		   return false
      }else check++

      if (document.iscrizione3_en.nome.value == "") {
           alert("Insert your  Name");
		   return false
      }else check++

      
      if (document.iscrizione3_en.indirizzo.value == "") {
           alert("Insert your  Address")
		   return false
      }else check++
  
	  if (document.iscrizione3_en.cap.value == "") {
           alert("Insert your Post code")
		   return false
      }else check++
      
      if (document.iscrizione3_en.nazionalita.value == "") {
           alert("Insert your Nationality")
		   return false
      }else check++
 		
 	  if (document.iscrizione3_en.telefono.value == "") {
           alert("Insert your Phone")
		   return false
      }else check++
      
      if (document.iscrizione3_en.fax.value == "") {
           alert("Insert your fax")
		   return false
      }else check++
      
      if (document.iscrizione3_en.email.value == "") {
           alert("Insert your E-mail")
		   return false
      }else check++
      
      if (document.iscrizione3_en.data_nascita.value == "") {
           alert("Insert your Birth date")
		   return false
      }else check++
      
      if (document.iscrizione3_en.insegnante_canto.value == "") {
           alert("Insert your Current singing teacher")
		   return false
      }else check++
 	  
 	  
 	  if (document.iscrizione3_en.registro_vocale.value == "") {
           alert("Insert your Vocal register")
		   return false
      }else check++
      
      if (document.iscrizione3_en.citta_preselezione.value == "") {
           alert("Insert the City choosen for the preselection")
		   return false
      }else check++
      
      if (document.iscrizione3_en.curriculum.value == "") {
           alert("Insert the file of your Curriculum")
		   return false
      }else check++
      	
	  if (check < 13){
			return false
	  }else return true

}

function check_mail_iscrizione3_en()
 {	
   if ((document.iscrizione3_en.email.value.indexOf("@") == -1) | (document.iscrizione3_en.email.value.indexOf(".") == -1) | (document.iscrizione3_en.email.length < 7)) 
        {
		window.alert("Insert a valid E-mail address")
		document.iscrizione3_en.email.value="";
		document.iscrizione3_en.email.focus();
		return false
	}
   else 
        {
 		return true
	}
}

function verifica_data_iscrizione3_en() {
if (document.iscrizione3_en.data_nascita.value.length!=0){
	if(document.iscrizione3_en.data_nascita.value.length!=10 || document.iscrizione3_en.data_nascita.value.indexOf("/")==-1) {
		alert("Check your birthdate!\n Eg: 04/06/1974")
		document.iscrizione3_en.data_nascita.value=""
		document.iscrizione3_en.data_nascita.focus()
		return false
	} 
	else {
		 return true
		 }
}else {
		return true
	}
} 

function invia_iscrizione3_en(){
	if (check_iscrizione3_en() && check_mail_iscrizione3_en() &&  verifica_data_iscrizione3_en()){ 
		document.iscrizione3_en.submit()
	}	
}