

function changepage(miopath)
	{
   document.location.href=miopath;
   miopath=""
  }
  
 function menu(pagina)
	{
    //parent.menu.document.location.href='menu.php?pag='+pagina;
  }
  
  function resizeDiv()
	{
    if (screen.height>801)
    	{
        document.all('miodiv').style.height='550px';
        }
    else
    	{
        document.all('miodiv').style.height='350px';
        }
    }  
    
// parte ajax

function ajax(){
  var ajaxRequest;
 
  try{
    // controllo per i browser diversi da IE
    ajaxRequest = new XMLHttpRequest();
  }catch (e){
    // contorollo per IE
    try{
        ajaxRequest = new ActiveXObject("Microsoft.XMLHTTP");
      }catch (e){
        // controllo per i browser che non supportano l'XMLHttpRequest
        alert("Il browser non supporta questo ShoutBox");
        return false;
      }
    }
  return ajaxRequest;
}

// motore di ricerca 

function motoreRicerca(mioParametro) {
	if (mioParametro==""){
 			document.getElementById("motoreRes").style.display='none';
 			document.getElementById("Close").style.display='none';
 			document.getElementById("motoreResSearch").style.display='none';
			return;
	}else{
	document.getElementById("motoreResSearch").style.display='';
	document.getElementById("motoreRes").style.display='none';
  }
	
  htmlRequest = ajax();
  // controllo nel caso in cui non possa richiamato l'oggetto Xmlhttp
  if (htmlRequest==null){
    alert ("Il browser non supporta richieste HTTP");
    return;
  }
    htmlRequest.onreadystatechange = function(){
    // Restituisce lo stato della richiesta
    if(htmlRequest.readyState == 4){
      // Restituice il corpo della risposta come stringa
 			 if(htmlRequest.status  == 200){
 			 			document.getElementById("motoreResSearch").style.display='none';
 			 			document.getElementById("motoreRes").style.display='';
 			 			document.getElementById("motoreRes").innerHTML=htmlRequest.responseText;
						document.getElementById("Close").style.display='';				
        }
    }
  
  }
  // chiamata della pagina PHP che estrae i records
 
 
  htmlRequest.open('POST', 'searchAjax.php',true);
  htmlRequest.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');
 
param = mioParametro;
 
 
    para = 'keyword='+param ;
 
    htmlRequest.send(para);

}


// fine motore di ricerca 

// fine parte ajax    

function Loggati(come)
	{
	document.getElementById('trMenu').style.display='none';
	document.getElementById('trLogin').style.display='';
	document.getElementById('userFrm').src="userLogger.php?type="+come;
	}
