var ricercaXMLHTTPRequest = null;

function removeRicercheLuoghiServizi(){
	 myLayer = new VEShapeLayer();
	 rimuoviMapLayer('luoghiTrovatiLayer', myLayer);
	 rimuoviMapLayer('serviziTrovatiLayer', myLayer);
	 rimuoviLayer('cercaLuoghiLayer1');
	 
	 moduloRicerca ='modulo_' +idmoduloRicerche;
	 hide(moduloRicerca);
	 modulo = 'modulo_' +idmodulo;
	 show(modulo);
}

function removeAllRicerche(){				
		removePortiLiveLayer();
		removeLocalite();
		removeMete();
		removePortiServ();
		removeServiziLayer();
		rimuoviLayerMeteo();
		rimuoviLayerMeteoMare();
		removeRicercheLuoghiServizi();
	//	hideshowPanelCart('subPorti', 'frPorti');
	//	hideshowPanelCart('subLocalita','frLocalita');
	//	hideshowPanelCart('subMete','frMete');
	//	hideshowPanelCart('subMeteo','frMeteo');
		hidePanelCart();
	}
 function ricercaRisByPage(url ) {

      	ricercaXMLHTTPRequest = makeRequest(url, 'html',null);
	    if (ricercaXMLHTTPRequest.readyState != 4)
	     ricercaXMLHTTPRequest.onreadystatechange = loadElenco;   
	    else 
	     loadElenco();
   }
   
  
   
    function loadElenco(){
     try{
	    if (ricercaXMLHTTPRequest.readyState == 4){
		     risultatiCartografico = getObject('risultati');
		     risultatiCartografico.innerHTML = ricercaXMLHTTPRequest.responseText;
	    }
	   
    }catch(e){
	    	alert (e.message);
	 }

   }

   
 function hideshowPanelCart(panel, freccia){
 if (document.getElementById(freccia).style.display=="none")
 {
  document.getElementById("frPorti").style.display="none";
  document.getElementById("frMete").style.display="none";
  document.getElementById("frLocalita").style.display="none";
  document.getElementById("frMeteo").style.display="none";
  document.getElementById(freccia).style.display="inline";
 }else if (document.getElementById(freccia).style.display=="inline")
 { 
   	if (freccia=="frPorti") document.getElementById("frPorti").style.display="none";
  	if (freccia=="frMete") document.getElementById("frMete").style.display="none";
  	if (freccia=="frLocalita") document.getElementById("frLocalita").style.display="none";
  	if (freccia=="frMeteo") document.getElementById("frMeteo").style.display="none"; 
 }
 if (document.getElementById(panel).style.display=="none")
 {
  document.getElementById("subPorti").style.display="none";
  document.getElementById("subMete").style.display="none";
  document.getElementById("subLocalita").style.display="none";
  document.getElementById("subMeteo").style.display="none";
  document.getElementById(panel).style.display="block";  
 }else if (document.getElementById(panel).style.display=="block"){
 
  if (panel=="subPorti")document.getElementById("subPorti").style.display="none";
  if (panel=="subMete")document.getElementById("subMete").style.display="none";
  if (panel=="subLocalita")document.getElementById("subLocalita").style.display="none";
  if (panel=="subMeteo")document.getElementById("subMeteo").style.display="none";  
 }
}

   function avviaMeteo(){
 	removeRicercheLuoghiServizi();
 	removePortiLiveLayer();
 	removeLocalite();
 	removeMete();
 	removePortiServ();
 	hideshowPanelCart('subMeteo','frMeteo');
 }
