<!--

ico_plus	= new Image(9,9); 	ico_plus.src	= "images/ico_plus2.jpg";
ico_less	= new Image(9,9); 	ico_less.src	= "images/ico_less2.jpg";

function imgOn(imgX) {
	document.images [imgX].src = eval(imgX + "_r.src");
}

function imgOff(imgX) {
	document.images [imgX].src = eval(imgX + ".src");
}

// inverte due immagini una con l'altra e viceversa
// imgX è in name dell' immagine, imgA e imgB con i due riferimenti image
function changeViewImg(imgX,imgA,imgB) {
	if (document.images [imgX].src == eval(imgA + ".src")) {
		document.images [imgX].src = eval(imgB + ".src");
	}
	else {
		document.images [imgX].src = eval(imgA + ".src");
	}
}


function showObj(tabName) {
	if (tabName) {
		if(document.getElementById) {
			document.getElementById(tabName).style.display = "block";
		}
		else if(document.all) {
			document.all[tabName].style.display = "block";
		}
	}
}


function hiddenObj(tabName) {
	if (tabName) {
		if(document.getElementById) {
			document.getElementById(tabName).style.display = "none";
		}
		else if(document.all) {
			document.all[tabName].style.display = "none";
		}
	}
}


// funzione che cambia la visione di un oggetto, showObj e hiddenObj fusi insieme
// necessita di: style="display: none;" nel codice, altrimenti il settaggio nel css non viene subito visto
function changeViewObj(tabName) {
	if (tabName) {
		if(document.getElementById) {
			if (document.getElementById(tabName).style.display == "none") {
				document.getElementById(tabName).style.display = "block";
			}
			else {
				document.getElementById(tabName).style.display = "none";
			}
		}
		else if(document.all) {
			if (document.all[tabName].style.display == "none") {
				document.all[tabName].style.display = "block";
			}
			else {
				document.all[tabName].style.display = "none";
			}
		}
	}
}


function vediFoto(foto,w,h) {hrefloc = location
	winCat=window.open ("", "Foto_Grande", "toolbar=no,directories=no,menubar=no,scrollbars=yes,resizable=yes,width="+ w +",height="+ h );
	winCat.document.write ("<html><head><base href=" + hrefloc + "><title></title>");
	winCat.document.write ("<body onLoad='self.focus()' bgcolor='#000000'>");
	winCat.document.write ("<p align='center'><img src='" + foto + "' border='0'></p>");
	winCat.document.write ("<form><p align='center'><input type='button' value='chiudi' onClick='window.close()' style='font-family: verdana, arial; font-size: 10px;'></p>");
	winCat.document.write ("</form></body></html>");
	winCat.document.close ();
}


function vediGoolgeMap(map,w,h) {hrefloc = location
	winMap=window.open ("", "Foto_Grande", "toolbar=no,directories=no,menubar=no,scrollbars=yes,resizable=yes,width="+ w +",height="+ h );
	winMap.document.write ("<html><head><base href=" + hrefloc + "><title></title><link rel='stylesheet' type='text/css' href='terre.css'></head>");
	winMap.document.write ("<body onLoad='self.focus()' bgcolor='#999999'>");
	winMap.document.write ("<p align='center'>" + map + "</p>");
	winMap.document.write ("<form><p align='center'><input type='button' value='chiudi' onClick='window.close()' style='font-family: verdana, arial; font-size: 10px;'></p>");
	winMap.document.write ("</form></body></html>");
	winMap.document.close ();
}


function checkContatti() {
	var errore = '';
	if (!(document.modulo.nome.value)) {
		errore = '\n - il nome';
	}
	if (!(document.modulo.tel.value)) {
		errore = errore + '\n - il numero di telefono';
	}
	if (!(document.modulo.mail.value)) {
		errore = errore + '\n - l\'indirizzo e-mail';
	}
	if (errore) {
		alert('ATTENZIONE !!!\nnon sono compilati i seguenti dati obbligatori:\n' + errore);
		return false;
	}
	else {
		return checkPrivacy();
	}
}

function checkPrivacy() {
	if (!(document.modulo.privacy[0].checked)) {
		alert('ATTENZIONE !!!\nse non si consente al trattamento dei dati personali secondo la legge 196/03, non è possibile proseguire.');
		return false;
	}
}


// funzione di pulitura di campo text. funzionamento: pulisciCampo(this)
function pulisciCampo(obj) {
	obj.value = "";
}


// funzione ceh permette il cambio dlela classe di un oggetto
function cambioClasse(id,nomeClasse) {
	document.getElementById(id).className = nomeClasse;
}




//-->
