// SELECT MULTIPLI

var sel=new Array()
function MemMulti(ss){
	sel.length=0
	for(var i=0;i<ss.options.length;i++)
		if(ss.options[i].selected)
			sel[sel.length]=i	
}
function SelMulti(ss){
	var ultimo='nessuno'
	for(var i=0;i<ss.options.length;i++)
		if(ss.options[i].selected)
			ultimo=i
	for(i=0;i<ss.options.length;i++)
		ss.options[i].selected=false
	for(i=0;i<sel.length;i++)
		ss.options[sel[i]].selected=true
	if(ultimo!='nessuno')
		ss.options[ultimo].selected=!ss.options[ultimo].selected
}

function cancella_foto(foto,numero,categoria,calendario,id_sposi){
if (confirm('...sei sicuro di voler cancellare questa immagine?')){location.href='index.php?sez=foto_cancella&foto='+foto+'&numero='+numero+'&categoria='+categoria+'&calendario='+calendario+'&id_sposi='+id_sposi;}else{alert('procedura annullata.')};
}

// ASSEGNA PERCORSO

function assegna_percorso(testo){
document.getElementById('percorso').innerHTML = "<b>&nbsp;&nbsp;&nbsp;gestione tuttavita.it -> "+testo+"</b>";
																}
	
// CONFERMA DOMANDA
															
function conferma(domanda,link){
if(confirm(domanda)){location.href = link;}else{alert('procedura annullata.')};
															 }
															 
// FORMATTAZIONE TEXTAREA

function formatta_txt(ape,chi,testo,modulo){
frase = prompt(testo,'scrivere qui');
frase = " "+ape+frase+chi+" ";
modulo.value = modulo.value+frase;

																					 }

// FORMATTAZIONE TEXTAREA CON LINK

function formatta_txt_link(modulo){
link = prompt('Url al quale collegare il testo?','http://www.tuttavita.it/index.php?sezione=contatti&lang=italian');
testo = prompt('Testo da linkare?','contattaci');
frase = " [link=*"+link+"*]"+testo+"[/link] ";
modulo.value = modulo.value+frase;

																	}																				 
																					 
function aggiungi_video(myform) {

if (myform.categoria.value == "") {
alert("Seleziona una Categoria")
myform.categoria.focus();
return false;
			     }
			     
if (myform.categoria.value == "") {
alert("Seleziona una Categoria")
myform.categoria.focus();
return false;
			     }
           
if (myform.formato.value == "") {
alert("Seleziona formato video")
myform.formato.focus();
return false;
			     }   
           
if (myform.titolo.value == "") {
alert("Inserire un titolo al video")
myform.titolo.focus();
return false;
			     }            
           
if (myform.foto.value == "") {
alert("Caricare una foto")
myform.foto.focus();
return false;
			     }    
           
if (myform.video.value == "") {
alert("Caricare una video")
myform.video.focus();
return false;
			     }                   			     

if (myform.capitolo.value == "") {
alert("Selezionare un Capitolo per proseguire")
myform.capitolo.focus();
return false;
			     }   

			     

			
return ch(f,e) ;
		
}

function aggiungi_calendario(myform) {

      
if (myform.titolo.value == "") {
alert("Inserire un titolo al calendario")
myform.titolo.focus();
return false;
			     }            
           
if (myform.descrizione.value == "") {
alert("Inserire una descrizione")
myform.descrizione.focus();
return false;
			     }    
			
return ch(f,e) ;
		
}

function aggiungi_matrimonio(myform) {

      
if (myform.sposo.value == "") {
alert("Inserire il nome dello sposo")
myform.sposo.focus();
return false;
			     }

if (myform.sposa.value == "") {
alert("Inserire il nome della sposa")
myform.sposa.focus();
return false;
			     }                                   
           
if (myform.giorno.value == "") {
alert("Inserire il giorno nella data di matrimonio")
myform.giorno.focus();
return false;
			     }
if (myform.mese.value == "") {
alert("Inserire il mese nella data di matrimonio")
myform.mese.focus();
return false;
			     }    
if (myform.anno.value == "") {
alert("Inserire l'anno nella data di matrimonio")
myform.anno.focus();
return false;
			     } 
           
if (myform.nome.value == "") {
alert("Inserire l'username")
myform.nome.focus();
return false;
			     } 
           
if (myform.password.value == "") {
alert("Inserire la password")
myform.password.focus();
return false;
			     }                                                    
			
return ch(f,e) ;
		
}


function aggiungi_partners(myform) {

      
if (myform.titolo.value == "") {
alert("Inserire un titolo al partner")
myform.titolo.focus();
return false;
			     }            
           
if (myform.descrizione.value == "") {
alert("Inserire una descrizione")
myform.descrizione.focus();
return false;
			     }
		
return ch(f,e) ;
		
}