//Javascript di proprietà Javabrothers
//author Mirko Pianetti

var descrizioneCategoria="";
function launch_search(){

	  var categoria = document.getElementById("categoria").value;
	  var campoOrd = document.getElementById("campoOrd").value;
	  var tipoOrd = document.getElementById("tipoOrd").value;
	  var ricerca  = document.getElementById("idSearch").value;
	  var regione  = document.getElementById("regione").value;
	  
	  
	  if (document.getElementById("sottocategorie").value != null && document.getElementById("sottocategorie").value != 0){
		  categoria = document.getElementById("sottocategorie").value
	  }
	  
	  UtilityDWR.getUrlElenco(categoria,ricerca,campoOrd,tipoOrd,regione, function(url){
			window.location.href = url ;
      });
	  return false;
};



function categoryChanged(categoria){
if (categoria == null || categoria == 0){
	var categoria = document.getElementById("categoria").value;
}
	var sottocategorie = document.getElementById("sottocategorie");
	var html="";
	
	if (categoria != null && categoria != 0 && categoria != ""){
    FiltroElenchiDWR.getCampiSottIns(categoria,   function(sottocategoriaDWR){
  		for (i = 0; i < sottocategoriaDWR.length; i++) {
  			html=html + sottocategoriaDWR[i].tagHtml;
  		};
  	   sottocategorie.innerHTML=html;
  	    if(document.all)
        {
          sottocategorie.outerHTML = sottocategorie.outerHTML;
        }
  	   
      });
    }
}
