// JavaScript Document


// Se ho attivato TOUR disattivo tutti i checkbox e anche quello do PACCHETTO.. e viceversa
function DisattivaAllCheck(ogg,idnascondi) {
	var ogg;
	if(ogg.checked==true) {
		for(i=0;i<15;i++) {
			ids='checkbox_'+i;
			if(document.getElementById(ids)) {
				document.getElementById(ids).checked='';
			}
		}
		document.getElementById(idnascondi).checked='';
	}
}


// Se clicco su un checkbox qualsiasi disattivo automaticamente anche TOUR e PACCHETTO
function DisattivaTourPacchetto(ogg) {
	var ogg;
	if(ogg.checked==true) {
		if(document.getElementById('checkbox_tour').checked==true) {
			document.getElementById('checkbox_tour').checked='';
		} else if(document.getElementById('checkbox_pacchetto').checked==true) {
			document.getElementById('checkbox_pacchetto').checked='';
		}
		
	}
}

/* FUNZIONI CAMBIO SELECT */
/* Visto che ci sono 3 select (hotel, tour e pacchetti) devo stabilire quando far vedere uno o l'altro. */

function MostraNascondiSelect(ogg,idmostra,idnascondi1,idnascondi2) {
	var ogg;
	if(ogg.checked==true) {
		showEl(idmostra);
		hideEl(idnascondi1);
		hideEl(idnascondi2);
	}
}


function SetSelectOnload() {
	if(document.getElementById('checkbox_tour').checked==true) {
		showEl('destinazione_tour');
		hideEl('destinazione_hotel');
		hideEl('destinazione_pacchetto');
	} else if(document.getElementById('checkbox_pacchetto').checked==true) {
		showEl('destinazione_pacchetto');
		hideEl('destinazione_hotel');
		hideEl('destinazione_tour');
	} else {
		showEl('destinazione_hotel');
		hideEl('destinazione_tour');
		hideEl('destinazione_pacchetto');
	}
}

/* 	FUNZIONE VECCHIA

function DisattivaAllCheckEx(id,idn) {
	if(document.getElementById(id).checked==true) {
		for(i=0;i<15;i++) {
			ids='checkbox_'+i;
			if(document.getElementById(ids)) {
				document.getElementById(ids).checked='';
			}
		}
		document.getElementById(idn).checked='';
	}
}

*/
