var ricerca_pro;
  
function cerca() 
{
    var valorecampo1 = document.form1.marca.options[document.form1.marca.selectedIndex].value;
    // branch for native XMLHttpRequest object
    if (window.XMLHttpRequest) {
        ricerca_pro = new XMLHttpRequest();
        ricerca_pro.onreadystatechange = ricevi;
        ricerca_pro.open("GET", "cercamodelli.asp?marca="+valorecampo1,true);
        ricerca_pro.send(null);
    // branch for IE/Windows ActiveX version
    } else if (window.ActiveXObject) {
        ricerca_pro = new ActiveXObject("Microsoft.XMLHTTP");
        if (ricerca_pro) {
            ricerca_pro.onreadystatechange = ricevi;
            ricerca_pro.open("GET", "cercamodelli.asp?marca="+valorecampo1,true);
            ricerca_pro.send();
        }
    }
}

function cerca_cil() 
{
	var valoremarca2 = document.form1.marca.options[document.form1.marca.selectedIndex].value;
    var valorecampo2 = document.form1.modello.options[document.form1.modello.selectedIndex].text;
   
    // branch for native XMLHttpRequest object
    if (window.XMLHttpRequest) {
        ricerca_proc = new XMLHttpRequest();
        ricerca_proc.onreadystatechange = ricevi_cil;
        ricerca_proc.open("GET", "cercamodelli.asp?marca=" + valoremarca2 + "&modello="+valorecampo2,true);
        ricerca_proc.send(null);
    // branch for IE/Windows ActiveX version
    } else if (window.ActiveXObject) {
        ricerca_proc = new ActiveXObject("Microsoft.XMLHTTP");
        if (ricerca_proc) {
            ricerca_proc.onreadystatechange = ricevi_cil;
            ricerca_proc.open("GET", "cercamodelli.asp?marca=" + valoremarca2 + "&modello="+valorecampo2,true);
            ricerca_proc.send();
        }
    }
}

function cerca_ann() 
{
	var valoremarca3 = document.form1.marca.options[document.form1.marca.selectedIndex].value;
    var valorecampo3 = document.form1.modello.options[document.form1.modello.selectedIndex].text;
	var valorecampo3b = document.form1.cilindrata.options[document.form1.cilindrata.selectedIndex].text;
   	
//	alert(valorecampo3b);
   
    // branch for native XMLHttpRequest object
    if (window.XMLHttpRequest) {
        ricerca_proa = new XMLHttpRequest();
        ricerca_proa.onreadystatechange = ricevi_ann;
        ricerca_proa.open("GET", "cercanno.asp?marca=" + valoremarca3 + "&modello="+valorecampo3+ "&cilindrata="+valorecampo3b,true);
        ricerca_proa.send(null);
    // branch for IE/Windows ActiveX version
    } else if (window.ActiveXObject) {
        ricerca_proa = new ActiveXObject("Microsoft.XMLHTTP");
        if (ricerca_proa) {
            ricerca_proa.onreadystatechange = ricevi_ann;
            ricerca_proa.open("GET", "cercanno.asp?marca=" + valoremarca3 + "&modello="+valorecampo3+ "&cilindrata="+valorecampo3b,true);
            ricerca_proa.send();
        }
    }
}

function ricevi() {   
    var strRes;       
    var arrValori;      
	  if (ricerca_pro.readyState == 4) {	    
		  strRes=ricerca_pro.responseText;
		  arrValori=strRes.split("|");
		  document.form1.modello.options.length=0;		    
//		  document.form1.modello.options[0].text= "Seleziona il modello"
		  for(i=0;i<arrValori.length;i++)
		  {
		    document.form1.modello.options[document.form1.modello.options.length]= new Option(arrValori[i].split("|")); 
		  }
		 }
	}
	
function ricevi_cil() {   
    var strResc;       
    var arrValoric;      
	  if (ricerca_proc.readyState == 4) {	    
		  strResc=ricerca_proc.responseText;
		  arrValoric=strResc.split("|");
		  document.form1.cilindrata.options.length=0;		    
		  for(i=0;i<arrValoric.length;i++)
		  {
		    document.form1.cilindrata.options[document.form1.cilindrata.options.length]= new Option(arrValoric[i].split("|")); 
		  }
		 }
	}
	
function ricevi_ann() {   
    var strResa;       
    var arrValoria;      
	  if (ricerca_proa.readyState == 4) {	    
		  strResa=ricerca_proa.responseText;
		  arrValoria=strResa.split("|");
		  document.form1.anno.options.length=0;		    
		  for(i=0;i<arrValoria.length;i++)
		  {
		    document.form1.anno.options[document.form1.anno.options.length]= new Option(arrValoria[i].split("|")); 
		  }
		 }
	}	
	
function opCt(theURL,winName,winWidth,winHeight,features) {
  var w = (screen.width - winWidth)/2;
  var h = (screen.height - winHeight)/2 - 60;
  features = features+',width='+winWidth+',height='+winHeight+',top='+h+',left='+w;
  window.open(theURL,winName,features);
}
	
<!--
function openBrW(theURL,winName,features) {
window.open(theURL,winName,features);
}

function LTrim(str)
{
   var whitespace = new String(" \t\n\r");

   var s = new String(str);

   if (whitespace.indexOf(s.charAt(0)) != -1) {
      var j=0, i = s.length;
      while (j < i && whitespace.indexOf(s.charAt(j)) != -1)
         j++;
      s = s.substring(j, i);
   }
   return s;
}

function RTrim(str)
{
   var whitespace = new String(" \t\n\r");
   var s = new String(str);
   if (whitespace.indexOf(s.charAt(s.length-1)) != -1) {
      var i = s.length - 1;
      while (i >= 0 && whitespace.indexOf(s.charAt(i)) != -1)
         i--;
      s = s.substring(0, i+1);
   }

   return s;
}

function Trim(str)
{
   return RTrim(LTrim(str));
}

function CheckModulo(){
var okay = true;

if ((Trim(document.formreq.r_nome.value)=='') && (okay == true)){
 alert ('Richiesto!');
 okay = false;
 document.formreq.r_nome.focus();
}

if ((Trim(document.formreq.r_tel.value)=='') && (okay == true)){
 alert ('Richiesto!');
 okay = false;
 document.formreq.r_tel.focus();
}

if ((Trim(document.formreq.r_citta.value)=='') && (okay == true)){
 alert ('Richiesto!');
 okay = false;
 document.formreq.r_citta.focus();
}

if ((Trim(document.formreq.r_richiesta.value)=='') && (okay == true)){
 alert ('Richiesto!');
 okay = false;
 document.formreq.r_richiesta.focus();
}

return okay;
}

var mainContent = true;
function document_load()
{
	
}
//-->