function GetXMLHttp() {  
    if (navigator.appName == "Microsoft Internet Explorer") {  
        xmlHttp = new ActiveXObject("Microsoft.XMLHTTP");  
    } else {  
        xmlHttp = new XMLHttpRequest();  
    }  
    return xmlHttp;  
}  
var mod = GetXMLHttp();

function carregaLista (tipo){
		mod.open("POST", "veiculo.asp", true);  
	    mod.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");  
	    mod.onreadystatechange = function() {  
        if (mod.readyState == 4) {  
            document.getElementById("marca").innerHTML = mod.responseText;
			valor = 0;
			verifica(valor);
        }  
    }  
    mod.send("tipo_marca="+tipo);	
}

function verifica(valor){
var veiculo = document.getElementById("veiculo1").checked;
    if (veiculo)
    {
         mod.open("POST", "carrega.ajax.asp", true);
	   mod.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");  
       mod.onreadystatechange = function() {  
        if (mod.readyState == 4) {  
            document.getElementById("modelo").innerHTML = mod.responseText;  
        }  
	}
	mod.send("id="+valor);	
    }
    else
    {
    	 mod.open("POST", "carrega.ajax_motos.asp", true);
	   mod.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");  
       mod.onreadystatechange = function() {  
        if (mod.readyState == 4) {  
            document.getElementById("modelo").innerHTML = mod.responseText;  
        }  
	}
	mod.send("id="+valor);
	}
}
function testaveiculo(){
var veiculo = document.getElementById("veiculo1").checked;
    if (veiculo)
    {
		document.getElementById("frm_principal").action = "resultado_carros.asp";
	} else {
		document.getElementById("frm_principal").action = "resultado_motos.asp";
	}
}
