function pesq_tipo( valor )
{
	http.open("GET", "/consulta_marca.php?id=" + valor, true);
	http.onreadystatechange = handleHttpResponse_tipo;
	http.send(null);
}

function pesq_marca( valor )
{
	http.open("GET", "/consulta_modelo.php?id=" + valor, true);
	http.onreadystatechange = handleHttpResponse_marca;
	http.send(null);
}

function handleHttpResponse_tipo()
{
	campo_select = document.form_busca.marca;
	if (http.readyState == 4) {
		campo_select.options.length = 0;
		results = http.responseText.split(",");
		for( i = 0; i < results.length; i++ )
		{ 
			string = results[i].split( "|" );
			campo_select.options[i] = new Option( string[0], string[1] );
		}
	}
}

function handleHttpResponse_marca()
{
	campo_select = document.form_busca.modelo;
	if (http.readyState == 4) {
		campo_select.options.length = 0;
		results = http.responseText.split(",");
		for( i = 0; i < results.length; i++ )
		{
			string = results[i].split( "|" );
			campo_select.options[i] = new Option( string[0], string[1] );
		}
	}
}

function getHTTPObject() {
  var xmlhttp;
  /*@cc_on
  @if (@_jscript_version >= 5)
    try {
      xmlhttp = new ActiveXObject("Msxml2.XMLHTTP");
    } catch (e) {
      try {
        xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
      } catch (e) {
        xmlhttp = false;
      }
    }
  @else
  xmlhttp = false;
  @end @*/
  if (!xmlhttp && typeof XMLHttpRequest != 'undefined') {
    try {
      xmlhttp = new XMLHttpRequest();
    } catch (e) {
      xmlhttp = false;
    }
  }
  return xmlhttp;
}
var http = getHTTPObject();

function verifica() {
	if (document.form_busca.tipo.value == ""){
		alert('Selecione o tipo de veículo');
		return false;
	}
}
