var xmlHttp;addEvent(window,'load',addListeners);var arialroundedbold = {	src: 'arialroundedbold.swf'};sIFR.activate(arialroundedbold);sIFR.replace(arialroundedbold, {	selector: '.title',      css: [      '.sIFR-root {color:#004976 }'      ],		wmode: 'transparent'});sIFR.replace(arialroundedbold, {	selector: '.subtitle',      css: [      '.sIFR-root {color:#004976 }'      ],		wmode: 'transparent'});sIFR.replace(arialroundedbold, {	selector: '.sth2',      css: [      '.sIFR-root {color:#b2b2b2 }'      ],		wmode: 'transparent'});onload=function(){if(!document.getElementsByTagName) return;l=document.getElementsByTagName("a");for(i=0;i<l.length;i++){	if(l[i].className.indexOf("aut")!=-1){		l[i].title="richiesta autorizzazione";		l[i].onclick=function(){startRequestAut(this.id)};    }	else if(l[i].className.indexOf("est")!=-1){		l[i].title="link esterno, si apre in una nuova finestra";		l[i].onclick=function(){window.open(this.href);return(false)};    }	else if(l[i].className.indexOf("directdownload")!=-1){	    l[i].title="scarica il documento";		l[i].onclick=function(){window.open('http://www.puligest.it/esterni/direct_download.php?id=' + this.id);return(false)};		//l[i].href="http://www.studiodaly.it/esterni/direct_download.php?id=" + l[i].id;	    //l[i].onclick=function(){window.open(this.href);return(false)};    }	}  	// setupZoom(); // abilita lo zoom delle immagini  }//Eventsfunction addEvent(elm, evType, fn) {	// cross-browser event handling	if(elm.addEventListener) {		elm.addEventListener(evType, fn, false);		return true;	}	else if(elm.attachEvent) {		var r = elm.attachEvent('on'+evType,fn);		return r;	}	else {		elm['on'+evType] = fn	}}function addListeners(e) {//var sl1 = document.getElementById('iter1');	//	addEvent(sl1,'click',page1);}function ripristina_criteri() {	document.getElementById("testo").style.height = "400px";	document.getElementById("trolley").style.height = "400px";	document.getElementById("scaffale").style.height = "400px";	document.getElementById("annuncio").style.height = "400px";	document.getElementById("contannuncio").style.height = "400px";	document.getElementById("scaffale").style.left = "0px";	document.getElementById("annuncio").style.display = "none";}function visualizza_annuncio(idannuncio) {	    createXMLHttpRequest();    xmlHttp.onreadystatechange = handleStateChangeCer;    xmlHttp.open("GET", "esterni/cerca_annuncio.php?id=" + encodeURI(idannuncio), true);    xmlHttp.send(null);	document.getElementById("scaffale").style.left = "-376px";	}function handleStateChangeCer() {    if(xmlHttp.readyState == 4) {        if(xmlHttp.status == 200) {			document.getElementById("testo").style.height = "2000px";			document.getElementById("trolley").style.height = "2000px";			document.getElementById("scaffale").style.height = "2000px";			document.getElementById("annuncio").style.height = "2000px";			document.getElementById("contannuncio").style.height = "2000px";            document.getElementById("annuncio").innerHTML = xmlHttp.responseText;			$('annuncio').appear({ duration: 1.0 });        }    }	}function createXMLHttpRequest() {    if (window.ActiveXObject) {        xmlHttp = new ActiveXObject("Microsoft.XMLHTTP");    }     else if (window.XMLHttpRequest) {        xmlHttp = new XMLHttpRequest();    }}    function startRequestPg(lingua, pagina) {    createXMLHttpRequest();    xmlHttp.onreadystatechange = handleStateChangePg;    xmlHttp.open("GET", "esterni/pagina_risultati.php?lang=" + encodeURI(lingua) + "&page=" + encodeURI(pagina), true);    xmlHttp.send(null);}    function handleStateChangePg() {    if(xmlHttp.readyState == 4) {        if(xmlHttp.status == 200) {            document.getElementById("risultati").innerHTML = xmlHttp.responseText;        }    }	}function startRequestRic() {    createXMLHttpRequest();	var dati_post = "location=" +					encodeURIComponent( document.getElementById("location").value ) + 					"&lingua=" +					encodeURIComponent( document.getElementById("lingua").value ) + 					"&prezzoda=" +					encodeURIComponent( document.getElementById("prezzoda").value ) + 					"&prezzoa=" +					encodeURIComponent( document.getElementById("prezzoa").value ) + 					"&vanida=" +					encodeURIComponent( document.getElementById("vanida").value ) + 					"&vania=" +					encodeURIComponent( document.getElementById("vania").value ) + 					"&categoria=" +					encodeURIComponent( document.getElementById("categoria").value );	xmlHttp.open('POST', 'esterni/ricerca_immobili.php', true);	xmlHttp.onreadystatechange = handleStateChangeRic;		xmlHttp.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");	xmlHttp.setRequestHeader("Content-length", dati_post.length);	xmlHttp.setRequestHeader("Connection", "close");	xmlHttp.send(dati_post);}    function handleStateChangeRic() {    if(xmlHttp.readyState == 4) {        if(xmlHttp.status == 200) {            document.getElementById("risultati").innerHTML = xmlHttp.responseText;        }    }	}function reset_results() {	document.getElementById("location").value = "CAP, indirizzo o zona";	document.getElementById("prezzoda").value = "0";	document.getElementById("prezzoa").value = "0";	document.getElementById("vanida").value = 0;	document.getElementById("vania").value = 0;	document.getElementById("categoria").value = 0;	startRequestRic();}