sfHover = function() {
	var sfEls = document.getElementById("menu").getElementsByTagName("LI");
	for (var i=0; i<sfEls.length; i++) {
		sfEls[i].onmouseover=function() {
			this.className+=" sfhover";
		}
		sfEls[i].onmouseout=function() {
			this.className=this.className.replace(new RegExp(" sfhover\\b"), "");
		}
	}
	var sfEls1 = document.getElementById("nav").getElementsByTagName("LI");
	for (var a=0; a<sfEls1.length; a++) {
		sfEls1[a].onmouseover=function() {
			this.className+=" sfhover";
		}
		sfEls1[a].onmouseout=function() {
			this.className=this.className.replace(new RegExp(" sfhover\\b"), "");
		}
	}
}
//window.onload = sfHover;
if (window.attachEvent) window.attachEvent("onload", sfHover);

// funzione per far aprire un pop up
function gowindow(str,titolo,w,h)
{
	openwin = window.open(str,titolo,'width='+ w +',height='+ h +',status=no,scrollbars=no,resizable=no,location=no,toolbar=no');
	return false;
}

// inserisci nelle note il nome dell'appartamento
function note () {
	if (location.search.substr(1)){
		var variabile = location.search.substr(1);
		var regEx = /arrivo=(.*)&partenza=(.*)/;
		var risul = regEx.exec(variabile);
		var arrivo = unescape(risul[1]);
		var partenza = unescape(risul[2]);
		form.DATA_ARRIVO.value = arrivo.replace(/\+/g," ");
		form.DATA_PARTENZA.value = partenza.replace(/\+/g," ");
	}
}

// cambio immagini foto gallery
$(document).ready(function(){
	$('#gallery a, #gallery_premio a').click(function(){
		var nome = $(this).attr("href");
		//alert (nome);
		if (($(this).attr("class")) == 'foto_small') {
			$('#main_foto_2').attr({ src: nome });
		} else if (($(this).attr("class")) == 'foto_big') {
			$('#main_foto_1').attr({ src: nome });
		} else if (($(this).attr("class")) == 'video') {
			window.open(nome,"video","width=" + 384 + ",height=" + 330 + ",status=no,scrollbars=no,resizable=no,location=no,toolbar=no");
			return false;
		} else {
			$('#main_foto').attr({ src: nome });
		}
		return false;
	});
	$('.video').click(function(){
		var dove = $(this).attr("href");
		window.open(dove,"video","width=" + 384 + ",height=" + 330 + ",status=no,scrollbars=no,resizable=no,location=no,toolbar=no");
		return false;
	});
});