// JavaScript Document
	var explorer=false
	if(window.navigator.appName.toLowerCase().indexOf("microsoft")>-1)
		explorer=true;
	function PrendiOggetto(nome){
		if(explorer)
			return document.all(nome)
		else
			return document.getElementById(nome)
	}

	function RicercaAvanzata(){	
		document.location.href = "sito_old/catalogo/FiltroCatalogoXp.asp?Lang="+lingua+""	
	}
	function AvviaRicerca(){
		var parNomeGruppo=PrendiOggetto("NomeGruppo").value
		var strCartella=""
		if(document.location.pathname.toString().indexOf(strCartella)>-1)
			strCartella="";
		document.location=strCartella+"?az=ricerca&Lang="+lingua+"&NomeGruppo="+parNomeGruppo
	}

	function Enter(evento){
		if(evento.keyCode==13)
			AvviaRicerca();
	}

function SelezionaAreaGeografica(codice){
		var combo=PrendiOggetto("AreaGeografica")
		for(i=0;i<combo.options.length;i++){
			if(("|"+combo.options[i].value).toString().indexOf("|"+codice+"|")>-1){
				combo.selectedIndex=i
				PrendiOggetto("NomeGruppo").value="";
				PrendiOggetto("Tipologia").selectedIndex=0;
				AvviaRicerca();
			}
		}
}
function ApriMailingList(){
	var strCartella="sito_old/catalogo/"
	if(document.location.pathname.toString().indexOf(strCartella)>-1)
		strCartella="";
	var winMailing=window.open(strCartella+"mailing.asp?Lang="+lingua+"&Mail=","Mailing","status=no,scrollbars=no,resizable=no,width=340,height=250")
	winMailing.focus();
}
function ApriProprietario(){
	var strCartella="sito_old/catalogo/"
	if(document.location.pathname.toString().indexOf(strCartella)>-1)
		strCartella="";
	var winMailing=window.open(strCartella+"proprietari.asp?Lang="+lingua+"","Proprietari","scrollbars=yes,status=no,resizable=no,width=590,height=550,top=0,left=0")
	winMailing.focus();
}
function Enter(evento){
	if(evento.keyCode==13)
		AvviaRicerca();
}
function caricaEvento(Id){
	if (Id>0)
		document.location="?az=eventi&Id="+Id
}
function VisIns(){
	var ul=PrendiOggetto("ulIns")
	if(ul.style.display=="")
		ul.style.display="none"
	else
		ul.style.display=""
}

	function AvviaRicercaAvanzata(){
		var parAreaGeografica=document.FormRicerca.cmbAreaGeografica.options[document.FormRicerca.cmbAreaGeografica.selectedIndex].value
		var tmp=parAreaGeografica.indexOf("|")
		parAreaGeografica=parAreaGeografica.substr(tmp+1)
		var par
		par="&AreaGeografica="+parAreaGeografica
		par=par+"&Tipologia="+document.FormRicerca.cmbTipologia.options[document.FormRicerca.cmbTipologia.selectedIndex].value
		par=par+"&PostiLetto="+document.FormRicerca.cmbPax[document.FormRicerca.cmbPax.selectedIndex].value
		par=par+"&Dal="+document.FormRicerca.cmbDal[document.FormRicerca.cmbDal.selectedIndex].value
		par=par+"&Al="+document.FormRicerca.cmbAl[document.FormRicerca.cmbAl.selectedIndex].value
		if(document.FormRicerca.chkAnimali.checked)
			par=par+"&Animali=SI"
		else
			par=par+"&Animali="
		if(document.FormRicerca.chkLavatrice.checked)
			par=par+"&Lavatrice=SI"
		else
			par=par+"&Lavatrice="
		if(document.FormRicerca.chkPiscina.checked)
			par=par+"&Piscina=SI"
		else
			par=par+"&Piscina="
		if(document.FormRicerca.chkDisabili.checked)
			par=par+"&Disabili=SI"
		else
			par=par+"&Disabili="
		if(document.FormRicerca.chkRiscaldamento.checked)
			par=par+"&Riscaldamento=SI"
		else
			par=par+"&Riscaldamento="
		if(document.FormRicerca.chkTelefono.checked)
			par=par+"&Telefono=SI"
		else
			par=par+"&Telefono="
		var strCartella=""
		if(document.location.pathname.toString().indexOf(strCartella)>-1)
			strCartella="";
		document.location=strCartella+"?az=ricerca&Lang="+lingua+""+par
	}
	function A(Id){
		var strCartella=""
		if(document.location.pathname.toString().indexOf(strCartella)>-1)
			strCartella="";
		document.location=strCartella+"?az=ricerca&Lang="+lingua+"&AreaGeografica="+Id
/*		document.FormRicerca.cmbAreaGeografica.value=Id
		AvviaRicercaAvanzata()*/
	}
	function C(Paese,Areag){
		var strCartella=""
		if(document.location.pathname.toString().indexOf(strCartella)>-1)
			strCartella="";
		document.location=strCartella+"?az=ricerca&Lang="+lingua+"&Paese="+Paese+"&AreaGeografica="+Areag;
	}
	function ComboDate(combo){
		var cmbDa=document.FormRicerca.cmbDal
		var cmbA=document.FormRicerca.cmbAl
		if (cmbDa.selectedIndex>cmbA.selectedIndex)
			if(combo==cmbDa)
				cmbA.selectedIndex=cmbDa.selectedIndex
			else
				cmbDa.selectedIndex=cmbA.selectedIndex
	}
	function SelezionaAreaGeografica(codice){
			var combo=PrendiOggetto("cmbAreaGeografica")
			for(i=0;i<combo.options.length;i++){
				if(("|"+combo.options[i].value).toString().indexOf("|"+codice+"|")>-1){
					combo.selectedIndex=i
					PrendiOggetto("cmbDal").selectedIndex=0;
					PrendiOggetto("cmbAl").selectedIndex=0;
					PrendiOggetto("cmbTipologia").selectedIndex=0;
					PrendiOggetto("cmbPax").selectedIndex=0;
					PrendiOggetto("chkLavatrice").checked=false;
					PrendiOggetto("chkAnimali").checked=false;
					PrendiOggetto("chkPiscina").checked=false;
					PrendiOggetto("chkDisabili").checked=false;
					PrendiOggetto("chkRiscaldamento").checked=false;
					PrendiOggetto("chkTelefono").checked=false;
					AvviaRicercaAvanzata();
				}
			}
	}	
	

