//combo
function openAjax() { 
var Ajax; 
try {Ajax = new XMLHttpRequest(); // XMLHttpRequest para browsers mais populares, como: Firefox, Safari, dentre outros. 
}catch(ee) { 
try {Ajax = new ActiveXObject("Msxml2.XMLHTTP"); // Para o IE da MS 
}catch(e) { 
try {Ajax = new ActiveXObject("Microsoft.XMLHTTP"); // Para o IE da MS 
}catch(e) {Ajax = false; 
} 
} 
} 
return Ajax; 
} 

function combo(sTipo,acao,div){ 
if(document.getElementById) { // Para os browsers complacentes com o DOM W3C. 
var exibeResultado = document.getElementById(div); // div que exibirá o resultado. 
var Ajax = openAjax(); // Inicia o Ajax. 
var url="combo.asp?tipo="+sTipo+"&acao="+acao
Ajax.open("GET", url, true); // fazendo a requisição 
Ajax.onreadystatechange = function() 
{ 
if(Ajax.readyState == 1) { // Quando estiver carregando, exibe: carregando... 
exibeResultado.innerHTML = "<select class='box'><option selected='selected' value='0'>&nbsp;&nbsp;Aguarde...</option></select>"; 
} 
if(Ajax.readyState == 4) { // Quando estiver tudo pronto. 
if(Ajax.status == 200) { 
var resultado = Ajax.responseText; // Coloca o retornado pelo Ajax nessa variável 
resultado = resultado.replace(/\+/g," "); // Resolve o problema dos acentos (saiba mais aqui: http://www.plugsites.net/leandro/?p=4) 
resultado = unescape(resultado); // Resolve o problema dos acentos 
exibeResultado.innerHTML = resultado; 
} else { 
exibeResultado.innerHTML = "Erro: ."; 
} 
} 
} 
Ajax.send(null); // submete 
} 
}
/////////////////////////////////////
//Form
function busca_pick(tipo){
	var vei = document.getElementById('pick_vei').value;
	var cat = document.getElementById('pick_cat').value;
	if (vei=='0'){
		alert('Selecione o veículo')
		return true;
	}
	if (cat=='0'){
		alert('Selecione a categoria')
		return true;
	}
	window.location = "produtos.asp?tipo="+tipo+"&vei="+vei+"&cat="+cat
	}
function busca_tun(tipo){
	var vei = document.getElementById('tun_vei').value;
	var cat = document.getElementById('tun_cat').value;
	if (vei=='0'){
		alert('Selecione o veículo')
		return true;
	}
	if (cat=='0'){
		alert('Selecione a categoria')
		return true;
	}
	window.location = "produtos.asp?tipo="+tipo+"&vei="+vei+"&cat="+cat
	}
function busca_off(tipo){
	var vei = document.getElementById('off_vei').value;
	var cat = document.getElementById('off_cat').value;
	if (vei=='0'){
		alert('Selecione o veículo')
		return true;
	}
	if (cat=='0'){
		alert('Selecione a categoria')
		return true;
	}
	window.location = "produtos.asp?tipo="+tipo+"&vei="+vei+"&cat="+cat
	}