	function service_serverGetData(page, callback_fnc)
	{
	    if(document.all)
	    {
	   	  var sURL = page;
	      oXMLHTTP = new ActiveXObject( "Microsoft.XMLHTTP" );
		}
		else
		{
			var sURL = page;
			oXMLHTTP = new XMLHttpRequest
		}
	    oXMLHTTP.open( "POST", sURL, true );
	    oXMLHTTP.onreadystatechange = callback_fnc;
	    try
		{
	         oXMLHTTP.send(null);
	    }
	    catch (e)
		{
	         alert("Server is not available at this time to process your request.");
	    }
	}
  
  
       function inviaRichiestaInfoAjax(root)
      {
            var error_str = "";
            var error = 0;
            
            var nominativo   = document.modulo_richiesta_informazioni.nominativo.value;
            var email        = document.modulo_richiesta_informazioni.email.value;
            var telefono     = document.modulo_richiesta_informazioni.telefono.value;
            var domanda      = document.modulo_richiesta_informazioni.domanda.value;
            var veicolo      = document.modulo_richiesta_informazioni.veicolo.value;

            
            if (nominativo == "")
              {error_str = error_str + "\n\t - Nome e cognome non specificati"; error++; }
            if (email == "")
              {error_str = error_str + "\n\t - Email non specificata"; error++; }                
            if (telefono == "")
              {error_str = error_str + "\n\t - Telefono non specificato"; error++; }                
            if (domanda == "")
              {error_str = error_str + "\n\t - Messaggio della richiesta non specificato"; error++; }                        
              
            if ((error)>0)
            {
              alert("Completare i seguenti campi:\n" + error_str);
            }
            else
            {
               // richiesta Ajax
               document.modulo_richiesta_informazioni.button_richiesta.disabled = true;
               
              var page = root+"/servizi/richiesta_info.php?postingform=ok&nominativo="+nominativo+"&email="+email+"&telefono="+telefono+"&veicolo="+veicolo+"&domanda="+domanda;
              service_serverGetData(page, richiestaInfoCallBack);        
            } 
      }   
      
        function richiestaInfoCallBack()
        {
            switch (oXMLHTTP.readyState)
            {
                case 4:
                    document.modulo_richiesta_informazioni.button_richiesta.disabled = false;
                    var msg = oXMLHTTP.responseText;
                    alert("La richiesta  stata inoltrata, sarete contattati a breve");
                    document.getElementById('richieste').style.display='none';
                break;
          }
        } 
        
        
        /**
         * FUNZIONI DI RICERCA
         */
        function caricaListaAuto(root, marca, modello, ordine, tipoordine, step) {
            //attesaLoad();
            //alert("marca:"+marca + ", modello:" + modello+", ordine:"+ordine+", tipo:"+tipoordine+", step:"+step);
            location = root + '?filtro_marca='+marca+'&filtro_modello='+modello+'&ord='
                  +ordine+'&ordtype='+tipoordine+'&step='+step;
        }
        
        
        function attesaLoad()
        {
          document.getElementById('attesa_caricamento').style.display='block';
        }
  
  
        
  function popup(name,url,w,h) {
    var parametri="toolbar=no,status=no,menubar=no,location=no";
    parametri=parametri+",scrollbars=yes,resizable=no,height="+h+",width="+w;
    window.open(url,name,parametri);
  } 
