// JavaScript Document
	try{
	xmlhttp = new XMLHttpRequest();}catch(ee){try{
	xmlhttp = new ActiveXObject("Msxml2.XMLHTTP");}catch(e){try{
	xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");}
	catch(E){xmlhttp = false;}}}

// cadastro
function ajaxCadastro() {
		xmlhttp.open("POST", "cadastro.asp" ,true);
		xmlhttp.setRequestHeader('Content-type','application/x-www-form-urlencoded; charset=utf-8');
		xmlhttp.onreadystatechange=function() { 
					document.getElementById('contens').innerHTML = '<div align="center"><font size="1" face="tahoma"><img src="img/loading2.gif"/> Aguarde carregando...</font></div>'
		   if(xmlhttp.readyState == 4){
					document.getElementById('contens').innerHTML = xmlhttp.responseText
				}}
			xmlhttp.send('') 
}

function ajaxChangeCityCadastro() {
		xmlhttp.open("POST", "includes/viewCities.asp?uf="+document.getElementById('uf').value ,true);
		xmlhttp.setRequestHeader('Content-type','application/x-www-form-urlencoded; charset=utf-8');
		xmlhttp.onreadystatechange=function() { 
					document.getElementById('id_cidade').innerHTML = '<select name="cidade" class="form" id="cidade" style="width: 200px;" disabled="disabled"><option value="">selecione</option></select>'
		   if(xmlhttp.readyState == 4){
					document.getElementById('id_cidade').innerHTML = xmlhttp.responseText
					ajaxChangeBairroCadastro()
				}}
			xmlhttp.send('') 
}
function ajaxChangeBairroCadastro() {
		xmlhttp.open("POST", "includes/viewBairros.asp?uf="+document.getElementById('uf').value+"&cidade="+document.getElementById('cidade').value ,true);
		xmlhttp.setRequestHeader('Content-type','application/x-www-form-urlencoded; charset=utf-8');
		xmlhttp.onreadystatechange=function() { 
					document.getElementById('id_bairro').innerHTML = '<select name="bairro" class="form" id="bairro" style="width: 200px;" disabled="disabled"><option value="">selecione</option></select>'
		   if(xmlhttp.readyState == 4){
					document.getElementById('id_bairro').innerHTML = xmlhttp.responseText
					ajaxChangeUfCidadeBairroCadastro()
				}}
			xmlhttp.send('') 
}
function ajaxChangeUfCidadeBairroCadastro() {
		xmlhttp.open("POST", "includes/viewUfCidadeBairros.asp?uf="+document.getElementById('uf').value+"&cidade="+document.getElementById('cidade').value+"&bairro="+document.getElementById('bairro').value ,true);
		xmlhttp.setRequestHeader('Content-type','application/x-www-form-urlencoded; charset=utf-8');
		xmlhttp.onreadystatechange=function() { 
					document.getElementById('ufCidadeBairro').innerHTML = ''
		   if(xmlhttp.readyState == 4){
					document.getElementById('ufCidadeBairro').innerHTML = xmlhttp.responseText
				}}
			xmlhttp.send('') 
}

//login



function ajaxLogin() {
		xmlhttp.open("POST", "login.asp" ,true);
		xmlhttp.setRequestHeader('Content-type','application/x-www-form-urlencoded; charset=utf-8');
		xmlhttp.onreadystatechange=function() { 
					document.getElementById('login').innerHTML = '<div align="center"><font size="1" face="tahoma"><img src="img/loading2.gif"/> Aguarde carregando...</font></div>'
		   if(xmlhttp.readyState == 4){
					document.getElementById('login').innerHTML = xmlhttp.responseText
				}}
			xmlhttp.send('') 
}
function ajaxTipoAnuncio(tipo) {
		var anuncio = "anuncio01.asp?"+tipo
		xmlhttp.open("POST", anuncio ,true);
		xmlhttp.setRequestHeader('Content-type','application/x-www-form-urlencoded; charset=utf-8');
		xmlhttp.onreadystatechange=function() { 
					document.getElementById('tipoanuncio').innerHTML = '<div align="center"><font size="1" face="tahoma"><img src="img/loading2.gif"/> Aguarde carregando...</font></div>'
		   if(xmlhttp.readyState == 4){
					document.getElementById('tipoanuncio').innerHTML = xmlhttp.responseText
				}}
			xmlhttp.send('') 
}
// veiculos

function ajaxViewModelos() {
		xmlhttp.open("POST", "viewModelos.asp?codigo="+ document.getElementById('marca').value ,true);
		xmlhttp.setRequestHeader('Content-type','application/x-www-form-urlencoded; charset=utf-8');
		xmlhttp.onreadystatechange=function() { 
					document.getElementById('modelox').innerHTML = '<font size="1" face="tahoma"><img src="img/loading2.gif"/> Aguarde carregando...</font>'
		   if(xmlhttp.readyState == 4){
					document.getElementById('modelox').innerHTML = xmlhttp.responseText
					ajaxViewVersao()
				}}
			xmlhttp.send('') 
}
function ajaxViewVersao() {
		xmlhttp.open("POST", "viewVersao.asp?codigo="+ document.getElementById('codmodelo').value ,true);
		xmlhttp.setRequestHeader('Content-type','application/x-www-form-urlencoded; charset=utf-8');
		xmlhttp.onreadystatechange=function() { 
					document.getElementById('versaox').innerHTML = '<font size="1" face="tahoma"><img src="img/loading2.gif"/> Aguarde carregando...</font>'
		   if(xmlhttp.readyState == 4){
					document.getElementById('versaox').innerHTML = xmlhttp.responseText
				}}
			xmlhttp.send('') 
}
function ajaxAnoFab() {
	if (document.formanuncio.anofab.value.length == 4){
		xmlhttp.open("POST", "anoModel.asp?anofab="+ document.getElementById('anofab').value ,true);
		xmlhttp.setRequestHeader('Content-type','application/x-www-form-urlencoded; charset=utf-8');
		xmlhttp.onreadystatechange=function() { 
					document.getElementById('anomodelx').innerHTML = '<font size="1" face="tahoma"><img src="img/loading2.gif"/> Aguarde carregando...</font>'
		   if(xmlhttp.readyState == 4){
					document.getElementById('anomodelx').innerHTML = xmlhttp.responseText
				}}
			xmlhttp.send('')
	}
}
function ajaxAnoFabSeguro(par) {
		xmlhttp.open("POST", "anoSeguro.asp?anofab="+ document.getElementById('anofab').value+"&check="+par ,true);
		xmlhttp.setRequestHeader('Content-type','application/x-www-form-urlencoded; charset=utf-8');
		xmlhttp.onreadystatechange=function() { 
					document.getElementById('anomodelx').innerHTML = '<font size="1" face="tahoma"><img src="img/loading2.gif"/> Aguarde carregando...</font>'
		   if(xmlhttp.readyState == 4){
					document.getElementById('anomodelx').innerHTML = xmlhttp.responseText
				}}
			xmlhttp.send('') 
}
function ajaxViewPlano() {
		var page = "viewPlanoVoce.asp?tipo="+document.getElementById('tipo').value+"&op="+document.getElementById('op').value+"&cod_anunciante="+document.getElementById('cod_anunciante').value+"&cod_anuncio="+ document.getElementById('cod_anuncio').value +"&cod_plano="+ document.getElementById('planopgto').value+"&cod_cupom="+document.getElementById('cod_cupom').value;
		xmlhttp.open("POST", page, true);
		xmlhttp.setRequestHeader('Content-type','application/x-www-form-urlencoded; charset=utf-8');
		xmlhttp.onreadystatechange=function() { 
					document.getElementById('pgto').innerHTML = '<font size="1" face="tahoma"><img src="img/loading2.gif"/> Aguarde carregando...</font>'
		   if(xmlhttp.readyState == 4){
					document.getElementById('pgto').innerHTML = xmlhttp.responseText
				}}
			xmlhttp.send('') 
}
function ajaxViewTrocaPlano() {
		var page = "viewPlanoTrocaVoce.asp?tipo="+document.getElementById('tipo').value+"&op="+document.getElementById('op').value+"&cod_anunciante="+document.getElementById('cod_anunciante').value+"&cod_anuncio="+ document.getElementById('cod_anuncio').value +"&cod_plano="+ document.getElementById('planopgto').value+"&cod_cupom="+document.getElementById('cod_cupom').value;
		xmlhttp.open("POST", page, true);
		xmlhttp.setRequestHeader('Content-type','application/x-www-form-urlencoded; charset=utf-8');
		xmlhttp.onreadystatechange=function() { 
					document.getElementById('pgto').innerHTML = '<font size="1" face="tahoma"><img src="img/loading2.gif"/> Aguarde carregando...</font>'
		   if(xmlhttp.readyState == 4){
					document.getElementById('pgto').innerHTML = xmlhttp.responseText
				}}
			xmlhttp.send('') 
}
function ajaxViewPlanoRev() {
		var page = "viewPlanoRevenda.asp?tipo="+document.getElementById('tipo').value+"&op="+document.getElementById('op').value+"&cod_anunciante="+document.getElementById('cod_anunciante').value+"&cod_plano="+ document.getElementById('planopgto').value+"&cod_cupom="+document.formcupom.cod_cupom.value;
		xmlhttp.open("POST", page, true);
		xmlhttp.setRequestHeader('Content-type','application/x-www-form-urlencoded; charset=utf-8');
		xmlhttp.onreadystatechange=function() { 
					document.getElementById('planospgto').innerHTML = '<font size="1" face="tahoma"><img src="img/loading2.gif"/> Aguarde carregando...</font>'
		   if(xmlhttp.readyState == 4){
					document.getElementById('planospgto').innerHTML = xmlhttp.responseText
				}}
			xmlhttp.send('') 
}
function ajaxTrocaPlanoRev() {
		var page = "trocaPlanoRevenda.asp?tipo="+document.getElementById('tipo').value+"&op="+document.getElementById('op').value+"&cod_anunciante="+document.getElementById('cod_anunciante').value+"&cod_plano="+ document.getElementById('planopgto').value+"&cod_cupom="+document.formcupom.cod_cupom.value;
		xmlhttp.open("POST", page, true);
		xmlhttp.setRequestHeader('Content-type','application/x-www-form-urlencoded; charset=utf-8');
		xmlhttp.onreadystatechange=function() { 
					document.getElementById('planospgto').innerHTML = '<font size="1" face="tahoma"><img src="img/loading2.gif"/> Aguarde carregando...</font>'
		   if(xmlhttp.readyState == 4){
					document.getElementById('planospgto').innerHTML = xmlhttp.responseText
				}}
			xmlhttp.send('') 
}
function ajaxVerifyDesc() {
		xmlhttp.open("POST", "verifyDesc.asp?cod_cupom="+ document.getElementById('cod_cupom').value ,true);
		xmlhttp.setRequestHeader('Content-type','application/x-www-form-urlencoded; charset=utf-8');
		xmlhttp.onreadystatechange=function() { 
					document.getElementById('verifyDesc').innerHTML = '<font size="1" face="tahoma"><img src="img/loading2.gif"/> Aguarde carregando...</font>'
		   if(xmlhttp.readyState == 4){
					document.getElementById('verifyDesc').innerHTML = xmlhttp.responseText
				}}
			xmlhttp.send('') 
}
function ajaxCheckDestaque() {
		xmlhttp.open("POST", "checkDestaque.asp?codigo="+ document.getElementById('planopgto').value ,true);
		xmlhttp.setRequestHeader('Content-type','application/x-www-form-urlencoded; charset=utf-8');
		xmlhttp.onreadystatechange=function() { 
					document.getElementById('checkDestaque').innerHTML = '<font size="1" face="tahoma"><img src="img/loading2.gif"/> Aguarde carregando...</font>'
		   if(xmlhttp.readyState == 4){
					document.getElementById('checkDestaque').innerHTML = xmlhttp.responseText
				}}
			xmlhttp.send('') 
}
function ajaxDisableAnuncio(codigo) {
		var urlDisable = "disableAnuncio.asp?action=disable&codigo="+codigo
		xmlhttp.open("POST", urlDisable, true);
		xmlhttp.setRequestHeader('Content-type','application/x-www-form-urlencoded; charset=utf-8');
		xmlhttp.onreadystatechange=function() { 
					document.getElementById('actionAnuncio').innerHTML = '<font size="1" face="tahoma"><img src="img/loading2.gif"/> Aguarde carregando...</font>'
		   if(xmlhttp.readyState == 4){
					document.getElementById('actionAnuncio').innerHTML = xmlhttp.responseText
				}}
			xmlhttp.send('') 
}
function ajaxEnableAnuncio(codigo) {
		var urlDisable = "disableAnuncio.asp"+codigo
		xmlhttp.open("POST", urlDisable, true);
		xmlhttp.setRequestHeader('Content-type','application/x-www-form-urlencoded; charset=utf-8');
		xmlhttp.onreadystatechange=function() { 
					document.getElementById('actionAnuncio').innerHTML = '<font size="1" face="tahoma"><img src="img/loading2.gif"/> Aguarde carregando...</font>'
		   if(xmlhttp.readyState == 4){
					document.getElementById('actionAnuncio').innerHTML = xmlhttp.responseText
				}}
			xmlhttp.send('') 
}
function ajaxDisableDestaque(codigo) {
		var urlDisable = "disableDestaque.asp?"+codigo
		xmlhttp.open("POST", urlDisable, true);
		xmlhttp.setRequestHeader('Content-type','application/x-www-form-urlencoded; charset=utf-8');
		xmlhttp.onreadystatechange=function() { 
					document.getElementById('actionAnuncio').innerHTML = '<font size="1" face="tahoma"><img src="img/loading2.gif"/> Aguarde carregando...</font>'
		   if(xmlhttp.readyState == 4){
					document.getElementById('actionAnuncio').innerHTML = xmlhttp.responseText
				}}
			xmlhttp.send('') 
}
function ajaxExcluirAnuncio(codigo, dadosAnuncio){
       if (confirm("Deseja realmente excluir este anúncio?"))
	   {
		var urlDisable = "updateAnuncio.asp?action=delete&codigo="+codigo+"&dados_anuncio="+dadosAnuncio;
		xmlhttp.open("POST", urlDisable, true);
		xmlhttp.setRequestHeader('Content-type','application/x-www-form-urlencoded; charset=utf-8');
		xmlhttp.onreadystatechange=function() { 
					document.getElementById('tdanuncios').innerHTML = '<font size="1" face="tahoma"><img src="img/loading2.gif"/> Aguarde carregando...</font>'
		   if(xmlhttp.readyState == 4){
					document.getElementById('tdanuncios').innerHTML = xmlhttp.responseText
				}}
			xmlhttp.send('') 
	   }
}

function ajaxExcluirAnuncioVoce(codigo, dadosAnuncioVoce){
       if (confirm("Deseja realmente excluir este anúncio?"))
	   {
		var urlDisable = "updateAnuncioVoce.asp?action=delete&codigo="+codigo+"&dados_anuncio="+dadosAnuncioVoce;
		xmlhttp.open("POST", urlDisable, true);
		xmlhttp.setRequestHeader('Content-type','application/x-www-form-urlencoded; charset=utf-8');
		xmlhttp.onreadystatechange=function() { 
					document.getElementById('tdanuncios').innerHTML = '<font size="1" face="tahoma"><img src="img/loading2.gif"/> Aguarde carregando...</font>'
		   if(xmlhttp.readyState == 4){
					document.getElementById('tdanuncios').innerHTML = xmlhttp.responseText
				}}
			xmlhttp.send('') 
	   }
}
function ajaxVerifyCnpjCpf() {
		var urlDelCompare = "verifyUserCnpjCpf.asp?cpfcnpj="+document.getElementById('cpfcnpj').value;
		xmlhttp.open("POST", urlDelCompare, true);
		xmlhttp.setRequestHeader('Content-type','application/x-www-form-urlencoded; charset=utf-8');
		xmlhttp.onreadystatechange=function() { 
					document.getElementById('verifycpfcnpj').innerHTML = '<img src="img/loading2.gif"/>'
		   if(xmlhttp.readyState == 4){
					document.getElementById('verifycpfcnpj').innerHTML = xmlhttp.responseText
				}}
			xmlhttp.send('') 
}
function ajaxVerifyCpf() {
		var urlDelCompare = "verifyUserCnpjCpf.asp?cpf="+document.getElementById('cpfcnpj').value;
		xmlhttp.open("POST", urlDelCompare, true);
		xmlhttp.setRequestHeader('Content-type','application/x-www-form-urlencoded; charset=utf-8');
		xmlhttp.onreadystatechange=function() { 
					document.getElementById('verifycpfcnpj').innerHTML = '<img src="img/loading2.gif"/>'
		   if(xmlhttp.readyState == 4){
					document.getElementById('verifycpfcnpj').innerHTML = xmlhttp.responseText
				}}
			xmlhttp.send('') 
}
function ajaxCheckCpf() {
		var urlDelCompare = "cpf.asp?cpf="+document.getElementById('cpfresp').value;
		xmlhttp.open("POST", urlDelCompare, true);
		xmlhttp.setRequestHeader('Content-type','application/x-www-form-urlencoded; charset=utf-8');
		xmlhttp.onreadystatechange=function() { 
					document.getElementById('verifycpf').innerHTML = '<img src="img/loading2.gif"/>'
		   if(xmlhttp.readyState == 4){
					document.getElementById('verifycpf').innerHTML = xmlhttp.responseText
				}}
			xmlhttp.send('') 
}

function ajaxVerifyEmail() {
		var urlDelCompare = "verifyUserCnpjCpf.asp?email="+document.getElementById('email').value;
		xmlhttp.open("POST", urlDelCompare, true);
		xmlhttp.setRequestHeader('Content-type','application/x-www-form-urlencoded; charset=utf-8');
		xmlhttp.onreadystatechange=function() { 
					document.getElementById('verifyemail').innerHTML = '<img src="img/loading2.gif"/>'
		   if(xmlhttp.readyState == 4){
					document.getElementById('verifyemail').innerHTML = xmlhttp.responseText
				}}
			xmlhttp.send('') 
}
function ajaxCloseWindow() {
		var urlClose = "close.asp"
		xmlhttp.open("POST", urlClose, true);
		xmlhttp.setRequestHeader('Content-type','application/x-www-form-urlencoded; charset=utf-8');
		xmlhttp.onreadystatechange=function() { 
					document.getElementById('contatoAnuncio').innerHTML = '<img src="img/loading2.gif"/>'
		   if(xmlhttp.readyState == 4){
					document.getElementById('contatoAnuncio').innerHTML = xmlhttp.responseText
				}}
			xmlhttp.send('') 
}
function ajaxClose() {
		var urlClose = "close.asp"
		xmlhttp.open("POST", urlClose, true);
		xmlhttp.setRequestHeader('Content-type','application/x-www-form-urlencoded; charset=utf-8');
		xmlhttp.onreadystatechange=function() { 
					document.getElementById('vejaAnuncio').innerHTML = '<img src="img/loading2.gif"/>'
		   if(xmlhttp.readyState == 4){
					document.getElementById('vejaAnuncio').innerHTML = xmlhttp.responseText
				}}
			xmlhttp.send('') 
}
function ajaxModeloAnuncio() {
		var urlClose = "modeloAnuncio.asp"
		xmlhttp.open("POST", urlClose, true);
		xmlhttp.setRequestHeader('Content-type','application/x-www-form-urlencoded; charset=utf-8');
		xmlhttp.onreadystatechange=function() { 
					document.getElementById('vejaAnuncio').innerHTML = '<img src="img/loading2.gif"/>'
		   if(xmlhttp.readyState == 4){
					document.getElementById('vejaAnuncio').innerHTML = xmlhttp.responseText
				}}
			xmlhttp.send('') 
}
function ajaxLoadingFotos() {
		var urlClose = "loading.asp"
		xmlhttp.open("POST", urlClose, true);
		xmlhttp.setRequestHeader('Content-type','application/x-www-form-urlencoded; charset=utf-8');
		xmlhttp.onreadystatechange=function() { 
					document.getElementById('loadingFoto').innerHTML = '<img src="img/loading2.gif"/>'
		   if(xmlhttp.readyState == 4){
					document.getElementById('loadingFoto').innerHTML = xmlhttp.responseText
				}}
			xmlhttp.send('') 
}
function ajaxAltSenha() {
	var urlDelCompare = "upSenha.asp?senha_ant="+document.formaltsenha.senha_ant.value+"&senha_new="+document.formaltsenha.senha_new.value;
	xmlhttp.open("POST", urlDelCompare, true);
	xmlhttp.setRequestHeader('Content-type','application/x-www-form-urlencoded; charset=utf-8');
	xmlhttp.onreadystatechange=function() { 
				document.getElementById('altSenha').innerHTML = '<img src="img/loading2.gif"/>'
	   if(xmlhttp.readyState == 4){
				document.getElementById('altSenha').innerHTML = xmlhttp.responseText
			}}
		xmlhttp.send('') 
}
function ajaxAltSenhaVoce() {
	var urlDelCompare = "upSenhaVoce.asp?senha_ant="+document.formaltsenha.senha_ant.value+"&senha_new="+document.formaltsenha.senha_new.value;
	xmlhttp.open("POST", urlDelCompare, true);
	xmlhttp.setRequestHeader('Content-type','application/x-www-form-urlencoded; charset=utf-8');
	xmlhttp.onreadystatechange=function() { 
				document.getElementById('altSenha').innerHTML = '<img src="img/loading2.gif"/>'
	   if(xmlhttp.readyState == 4){
				document.getElementById('altSenha').innerHTML = xmlhttp.responseText
			}}
		xmlhttp.send('') 
}
function ajaxRemoveFoto(varPar) {
		var urlDel = "removeFoto.asp"+varPar+"&action=delete"
		xmlhttp.open("POST", urlDel, true);
		xmlhttp.setRequestHeader('Content-type','application/x-www-form-urlencoded; charset=utf-8');
		xmlhttp.onreadystatechange=function() { 
					document.getElementById('listThumb').innerHTML = '<img src="img/loading2.gif"/>'
		   if(xmlhttp.readyState == 4){
					document.getElementById('listThumb').innerHTML = xmlhttp.responseText
				}}
			xmlhttp.send('') 
}
function ajaxRemoveFotoVoce(varPar) {
		var urlDel = "removeFotoVoce.asp"+varPar+"&action=delete"
		xmlhttp.open("POST", urlDel, true);
		xmlhttp.setRequestHeader('Content-type','application/x-www-form-urlencoded; charset=utf-8');
		xmlhttp.onreadystatechange=function() { 
					document.getElementById('listThumb').innerHTML = '<img src="img/loading2.gif"/>'
		   if(xmlhttp.readyState == 4){
					document.getElementById('listThumb').innerHTML = xmlhttp.responseText
				}}
			xmlhttp.send('') 
}
function ajaxVerifyPlaca() {
		var urlCompare = "verifyPlaca.asp?placa="+document.getElementById('alphaplaca').value+document.getElementById('numberplaca').value;
		xmlhttp.open("POST", urlCompare, true);
		xmlhttp.setRequestHeader('Content-type','application/x-www-form-urlencoded; charset=utf-8');
		xmlhttp.onreadystatechange=function() { 
					document.getElementById('checkplaca').innerHTML = '<img src="img/loading2.gif"/>'
		   if(xmlhttp.readyState == 4){
					document.getElementById('checkplaca').innerHTML = xmlhttp.responseText
				}}
			xmlhttp.send('') 
}
function ajaxVeicCorp() {
		var urlCompare = "planoVeiculoCorp.asp";
		xmlhttp.open("POST", urlCompare, true);
		xmlhttp.setRequestHeader('Content-type','application/x-www-form-urlencoded; charset=utf-8');
		xmlhttp.onreadystatechange=function() { 
					document.getElementById('tabplanos').innerHTML = '<font size="1" face="tahoma"><img src="img/loading2.gif"/> Aguarde carregando...</font>'
		   if(xmlhttp.readyState == 4){
					document.getElementById('tabplanos').innerHTML = xmlhttp.responseText
				}}
			xmlhttp.send('') 
}
function ajaxVeicVoce() {
		var urlCompare = "planoVeiculoVoce.asp";
		xmlhttp.open("POST", urlCompare, true);
		xmlhttp.setRequestHeader('Content-type','application/x-www-form-urlencoded; charset=utf-8');
		xmlhttp.onreadystatechange=function() { 
					document.getElementById('tabplanos').innerHTML = '<font size="1" face="tahoma"><img src="img/loading2.gif"/> Aguarde carregando...</font>'
		   if(xmlhttp.readyState == 4){
					document.getElementById('tabplanos').innerHTML = xmlhttp.responseText
				}}
			xmlhttp.send('') 
}
function ajaxThumbFotoCompara(filtro) {
		var page = "fotoThumbFotoCompara.asp?"+filtro
		xmlhttp.open("POST", page ,true);
		xmlhttp.setRequestHeader('Content-type','application/x-www-form-urlencoded; charset=utf-8');
		xmlhttp.onreadystatechange=function() { 
					document.getElementById('thumb').innerHTML = '<img src="img/loading3.gif" width="15" height="15" />'
		   if(xmlhttp.readyState == 4){
					document.getElementById('thumb').innerHTML = xmlhttp.responseText
				}}
			xmlhttp.send('') 
}
function ajaxAddClick(filtro) {
		var page = "addClickFotoCompara.asp?"+filtro
		xmlhttp.open("POST", page ,true);
		xmlhttp.setRequestHeader('Content-type','application/x-www-form-urlencoded; charset=utf-8');
		xmlhttp.onreadystatechange=function() { 
					document.getElementById('addclick').innerHTML = '<img src="img/loading3.gif" width="15" height="15" />'
		   if(xmlhttp.readyState == 4){
					document.getElementById('addclick').innerHTML = xmlhttp.responseText
				}}
			xmlhttp.send('') 
}
function ajaxDistanciaNacional() {
		var page = "destinoNacional.asp?origem1="+document.formnacional.origem1.value;
		xmlhttp.open("POST", page ,true);
		xmlhttp.setRequestHeader('Content-type','application/x-www-form-urlencoded; charset=utf-8');
		xmlhttp.onreadystatechange=function() { 
					document.getElementById('mdestino1').innerHTML = '<img src="img/loading3.gif" width="15" height="15" />'
		   if(xmlhttp.readyState == 4){
					document.getElementById('mdestino1').innerHTML = xmlhttp.responseText
				}}
			xmlhttp.send('') 
}
function ajaxViewDistanciaNacional() {
		var page = "mdistancia.asp?distancia="+document.formnacional.distancia1.value;
		xmlhttp.open("POST", page ,true);
		xmlhttp.setRequestHeader('Content-type','application/x-www-form-urlencoded; charset=utf-8');
		xmlhttp.onreadystatechange=function() { 
					document.getElementById('mdistancia1').innerHTML = '<img src="img/loading3.gif" width="15" height="15" />'
		   if(xmlhttp.readyState == 4){
					document.getElementById('mdistancia1').innerHTML = xmlhttp.responseText
				}}
			xmlhttp.send('') 
}
function ajaxDistanciaRegional() {
		var page = "destinoRegional.asp?origem2="+document.formregional.origem2.value;
		xmlhttp.open("POST", page ,true);
		xmlhttp.setRequestHeader('Content-type','application/x-www-form-urlencoded; charset=utf-8');
		xmlhttp.onreadystatechange=function() { 
					document.getElementById('mdestino2').innerHTML = '<img src="img/loading3.gif" width="15" height="15" />'
		   if(xmlhttp.readyState == 4){
					document.getElementById('mdestino2').innerHTML = xmlhttp.responseText
				}}
			xmlhttp.send('') 
}
function ajaxViewDistanciaRegional() {
		var page = "mdistancia.asp?distancia="+document.formregional.distancia2.value;
		xmlhttp.open("POST", page ,true);
		xmlhttp.setRequestHeader('Content-type','application/x-www-form-urlencoded; charset=utf-8');
		xmlhttp.onreadystatechange=function() { 
					document.getElementById('mdistancia2').innerHTML = '<img src="img/loading3.gif" width="15" height="15" />'
		   if(xmlhttp.readyState == 4){
					document.getElementById('mdistancia2').innerHTML = xmlhttp.responseText
				}}
			xmlhttp.send('') 
}

// QUERO COMPRAR

function ajaxViewMarcasQ(tipo) {
		xmlhttp.open("POST", "viewMarcasQ.asp?tipo="+tipo , true);
		xmlhttp.setRequestHeader('Content-type','application/x-www-form-urlencoded; charset=utf-8');
		xmlhttp.onreadystatechange=function() { 
					document.getElementById('marcaq').innerHTML = '<font size="1" face="tahoma"><img src="img/loading2.gif"/> Aguarde carregando...</font>'
		   if(xmlhttp.readyState == 4){
					document.getElementById('marcaq').innerHTML = xmlhttp.responseText
					ajaxViewModeloQ();
				}}
			xmlhttp.send('') 
}
function ajaxViewModeloQ() {
		xmlhttp.open("POST", "viewModeloQ.asp?tipo="+document.getElementById('tipo').value+"&marca="+document.getElementById('marca').value , true);
		xmlhttp.setRequestHeader('Content-type','application/x-www-form-urlencoded; charset=utf-8');
		xmlhttp.onreadystatechange=function() { 
					document.getElementById('modeloq').innerHTML = '<font size="1" face="tahoma"><img src="img/loading2.gif"/> Aguarde carregando...</font>'
		   if(xmlhttp.readyState == 4){
					document.getElementById('modeloq').innerHTML = xmlhttp.responseText
					ajaxViewVersaoQ();
				}}
			xmlhttp.send('') 
}
function ajaxViewVersaoQ() {
		xmlhttp.open("POST", "viewVersaoQ.asp?modelo="+document.getElementById('modelo').value , true);
		xmlhttp.setRequestHeader('Content-type','application/x-www-form-urlencoded; charset=utf-8');
		xmlhttp.onreadystatechange=function() { 
					document.getElementById('versaoq').innerHTML = '<font size="1" face="tahoma"><img src="img/loading2.gif"/> Aguarde carregando...</font>'
		   if(xmlhttp.readyState == 4){
					document.getElementById('versaoq').innerHTML = xmlhttp.responseText
				}}
			xmlhttp.send('') 
}

// atualiza qtd anuncios de veiculos

function ajaxLimitPage() {
		xmlhttp.open("POST", "updateLimitAnuncio.asp?limit="+document.getElementById('limit_page').value , true);
		xmlhttp.setRequestHeader('Content-type','application/x-www-form-urlencoded; charset=utf-8');
		xmlhttp.onreadystatechange=function() { 
					document.getElementById('idlimit_page').innerHTML = '<font size="1" face="tahoma"><img src="img/loading2.gif"/> Aguarde carregando...</font>'
		   if(xmlhttp.readyState == 4){
					document.getElementById('idlimit_page').innerHTML = xmlhttp.responseText
				}}
			xmlhttp.send('') 
}


// UPDATE MOTOS

function ajaxRemoveFotoMoto(varPar) {
		var urlDel = "removeFotoMoto.asp"+varPar+"&action=delete";
		xmlhttp.open("POST", urlDel, true);
		xmlhttp.setRequestHeader('Content-type','application/x-www-form-urlencoded; charset=utf-8');
		xmlhttp.onreadystatechange=function() { 
					document.getElementById('listThumb').innerHTML = '<img src="img/loading2.gif"/>'
		   if(xmlhttp.readyState == 4){
					document.getElementById('listThumb').innerHTML = xmlhttp.responseText
				}}
			xmlhttp.send('') 
}
function ajaxRemoveFotoMotoVoce(varPar) {
		var urlDel = "removeFotoMotoVoce.asp"+varPar+"&action=delete";
		xmlhttp.open("POST", urlDel, true);
		xmlhttp.setRequestHeader('Content-type','application/x-www-form-urlencoded; charset=utf-8');
		xmlhttp.onreadystatechange=function() { 
					document.getElementById('listThumb').innerHTML = '<img src="img/loading2.gif"/>'
		   if(xmlhttp.readyState == 4){
					document.getElementById('listThumb').innerHTML = xmlhttp.responseText
				}}
			xmlhttp.send('') 
}

function ajaxDisableAnuncioMoto(codigo) {
		var urlDisable = "disableAnuncioMoto.asp?action=disable&codigo="+codigo;
		xmlhttp.open("POST", urlDisable, true);
		xmlhttp.setRequestHeader('Content-type','application/x-www-form-urlencoded; charset=utf-8');
		xmlhttp.onreadystatechange=function() { 
					document.getElementById('actionAnuncio').innerHTML = '<font size="1" face="tahoma"><img src="img/loading2.gif"/> Aguarde carregando...</font>'
		   if(xmlhttp.readyState == 4){
					document.getElementById('actionAnuncio').innerHTML = xmlhttp.responseText
				}}
			xmlhttp.send('') 
}
function ajaxEnableAnuncioMoto(codigo) {
		var urlDisable = "disableAnuncioMoto.asp"+codigo;
		xmlhttp.open("POST", urlDisable, true);
		xmlhttp.setRequestHeader('Content-type','application/x-www-form-urlencoded; charset=utf-8');
		xmlhttp.onreadystatechange=function() { 
					document.getElementById('actionAnuncio').innerHTML = '<font size="1" face="tahoma"><img src="img/loading2.gif"/> Aguarde carregando...</font>'
		   if(xmlhttp.readyState == 4){
					document.getElementById('actionAnuncio').innerHTML = xmlhttp.responseText
				}}
			xmlhttp.send('') 
}
function ajaxDisableDestaqueMoto(codigo) {
		var urlDisable = "disableDestaqueMoto.asp?"+codigo;
		xmlhttp.open("POST", urlDisable, true);
		xmlhttp.setRequestHeader('Content-type','application/x-www-form-urlencoded; charset=utf-8');
		xmlhttp.onreadystatechange=function() { 
					document.getElementById('actionAnuncio').innerHTML = '<font size="1" face="tahoma"><img src="img/loading2.gif"/> Aguarde carregando...</font>'
		   if(xmlhttp.readyState == 4){
					document.getElementById('actionAnuncio').innerHTML = xmlhttp.responseText
				}}
			xmlhttp.send('') 
}
function ajaxExcluirAnuncioMoto(codigo, dadosAnuncioMoto){
       if (confirm("Deseja realmente excluir este anúncio?\n Será gerado um log da exclusão do anuncio."))
	   {
		var urlDisable = "updateAnuncioMoto.asp?action=delete&codigo="+codigo+"&dados_anuncio="+dadosAnuncioMoto;
		xmlhttp.open("POST", urlDisable, true);
		xmlhttp.setRequestHeader('Content-type','application/x-www-form-urlencoded; charset=utf-8');
		xmlhttp.onreadystatechange=function() { 
					document.getElementById('tdanuncios').innerHTML = '<font size="1" face="tahoma"><img src="img/loading2.gif"/> Aguarde carregando...</font>'
		   if(xmlhttp.readyState == 4){
					document.getElementById('tdanuncios').innerHTML = xmlhttp.responseText
				}}
			xmlhttp.send('') 
	   }
}

function ajaxExcluirAnuncioMotoVoce(codigo, dadosAnuncioMotoVoce){
       if (confirm("Deseja realmente excluir este anúncio?\n Será gerado um log da exclusão do anuncio."))
	   {
		var urlDisable = "updateAnuncioMotoVoce.asp?action=delete&codigo="+codigo+"&dados_anuncio="+dadosAnuncioMotoVoce;
		xmlhttp.open("POST", urlDisable, true);
		xmlhttp.setRequestHeader('Content-type','application/x-www-form-urlencoded; charset=utf-8');
		xmlhttp.onreadystatechange=function() { 
					document.getElementById('tdanuncios').innerHTML = '<font size="1" face="tahoma"><img src="img/loading2.gif"/> Aguarde carregando...</font>'
		   if(xmlhttp.readyState == 4){
					document.getElementById('tdanuncios').innerHTML = xmlhttp.responseText
				}}
			xmlhttp.send('') 
	   }
}


//// AJAX MANUTENÇÃO DE CADASTROS ANUNCIOS CAMINHÃO/CAVALO

//HABILITA DESABILIATA ANUNCIOS E DESTAQUES

function ajaxDisableAnuncioCaminhao(varPar, varIdAnuncio, setUpdate) {
		var urlDisable = "disableAnuncioCaminhao.asp?action="+varPar+"&id_anuncio_caminhao="+varIdAnuncio+"&setAnuncio="+setUpdate;
		xmlhttp.open("POST", urlDisable, true);
		xmlhttp.setRequestHeader('Content-type','application/x-www-form-urlencoded; charset=utf-8');
		xmlhttp.onreadystatechange=function() { 
					document.getElementById('actionAnuncio').innerHTML = '<font size="1" face="tahoma"><img src="img/loading2.gif"/> Aguarde carregando...</font>'
		   if(xmlhttp.readyState == 4){
					document.getElementById('actionAnuncio').innerHTML = xmlhttp.responseText
				}}
			xmlhttp.send('') 
}


function ajaxDisableDestaqueCaminhao(varPar2, varIdAnuncio2, setUpdate2) {
		var urlDisable = "disableDestaqueCaminhao.asp?action="+varPar2+"&id_anuncio_caminhao="+varIdAnuncio2+"&setAnuncio="+setUpdate2;
		xmlhttp.open("POST", urlDisable, true);
		xmlhttp.setRequestHeader('Content-type','application/x-www-form-urlencoded; charset=utf-8');
		xmlhttp.onreadystatechange=function() { 
					document.getElementById('actionAnuncio').innerHTML = '<font size="1" face="tahoma"><img src="img/loading2.gif"/> Aguarde carregando...</font>'
		   if(xmlhttp.readyState == 4){
					document.getElementById('actionAnuncio').innerHTML = xmlhttp.responseText
				}}
			xmlhttp.send('') 
}

//REMOVE FOTOS

function ajaxRemoveFotoCaminhao(varPar) {
		var urlDel = "removeFotoCaminhao.asp"+varPar+"&action=delete";
		xmlhttp.open("POST", urlDel, true);
		xmlhttp.setRequestHeader('Content-type','application/x-www-form-urlencoded; charset=utf-8');
		xmlhttp.onreadystatechange=function() { 
					document.getElementById('listThumb').innerHTML = '<img src="img/loading2.gif"/>'
		   if(xmlhttp.readyState == 4){
					document.getElementById('listThumb').innerHTML = xmlhttp.responseText
				}}
			xmlhttp.send('') 
}

// REMOVE ANÚNCIO(DELETA)

function ajaxExcluirAnuncioCaminhao(idAnuncioCaminhao, dadosAnuncioCaminhao){
       if (confirm("Deseja realmente excluir este anúncio?\n Será gerado um log da exclusão do anuncio."))
	   {
		var urlDisable = "updateAnuncioCaminhao.asp?action=delete&id_anuncio_caminhao="+idAnuncioCaminhao+"&dados_anuncio="+dadosAnuncioCaminhao;
		xmlhttp.open("POST", urlDisable, true);
		xmlhttp.setRequestHeader('Content-type','application/x-www-form-urlencoded; charset=utf-8');
		xmlhttp.onreadystatechange=function() { 
					document.getElementById('tdanuncios').innerHTML = '<font size="1" face="tahoma"><img src="img/loading2.gif"/> Aguarde carregando...</font>'
		   if(xmlhttp.readyState == 4){
					document.getElementById('tdanuncios').innerHTML = xmlhttp.responseText
				}}
			xmlhttp.send('') 
	   }
}


//// AJAX MANUTENÇÃO DE CADASTROS ANUNCIOS CARRETA

//HABILITA DESABILIATA ANUNCIOS E DESTAQUES

function ajaxDisableAnuncioCarreta(varPar, varIdAnuncio, setUpdate) {
		var urlDisable = "disableAnuncioCarreta.asp?action="+varPar+"&id_anuncio_carreta="+varIdAnuncio+"&setAnuncio="+setUpdate;
		xmlhttp.open("POST", urlDisable, true);
		xmlhttp.setRequestHeader('Content-type','application/x-www-form-urlencoded; charset=utf-8');
		xmlhttp.onreadystatechange=function() { 
					document.getElementById('actionAnuncio').innerHTML = '<font size="1" face="tahoma"><img src="img/loading2.gif"/> Aguarde carregando...</font>'
		   if(xmlhttp.readyState == 4){
					document.getElementById('actionAnuncio').innerHTML = xmlhttp.responseText
				}}
			xmlhttp.send('') 
}


function ajaxDisableDestaqueCarreta(varPar2, varIdAnuncio2, setUpdate2) {
		var urlDisable = "disableDestaqueCarreta.asp?action="+varPar2+"&id_anuncio_carreta="+varIdAnuncio2+"&setAnuncio="+setUpdate2;
		xmlhttp.open("POST", urlDisable, true);
		xmlhttp.setRequestHeader('Content-type','application/x-www-form-urlencoded; charset=utf-8');
		xmlhttp.onreadystatechange=function() { 
					document.getElementById('actionAnuncio').innerHTML = '<font size="1" face="tahoma"><img src="img/loading2.gif"/> Aguarde carregando...</font>'
		   if(xmlhttp.readyState == 4){
					document.getElementById('actionAnuncio').innerHTML = xmlhttp.responseText
				}}
			xmlhttp.send('') 
}

//REMOVE FOTOS

function ajaxRemoveFotoCarreta(varPar) {
		var urlDel = "removeFotoCarreta.asp"+varPar+"&action=delete";
		xmlhttp.open("POST", urlDel, true);
		xmlhttp.setRequestHeader('Content-type','application/x-www-form-urlencoded; charset=utf-8');
		xmlhttp.onreadystatechange=function() { 
					document.getElementById('listThumb').innerHTML = '<img src="img/loading2.gif"/>'
		   if(xmlhttp.readyState == 4){
					document.getElementById('listThumb').innerHTML = xmlhttp.responseText
				}}
			xmlhttp.send('') 
}

// REMOVE ANÚNCIO(DELETA)

function ajaxExcluirAnuncioCarreta(idAnuncioCarreta, dadosAnuncioCarreta){
       if (confirm("Deseja realmente excluir este anúncio?\n Será gerado um log da exclusão do anuncio."))
	   {
		var urlDisable = "updateAnuncioCarreta.asp?action=delete&id_anuncio_carreta="+idAnuncioCarreta+"&dados_anuncio="+dadosAnuncioCarreta;
		xmlhttp.open("POST", urlDisable, true);
		xmlhttp.setRequestHeader('Content-type','application/x-www-form-urlencoded; charset=utf-8');
		xmlhttp.onreadystatechange=function() { 
					document.getElementById('tdanuncios').innerHTML = '<font size="1" face="tahoma"><img src="img/loading2.gif"/> Aguarde carregando...</font>'
		   if(xmlhttp.readyState == 4){
					document.getElementById('tdanuncios').innerHTML = xmlhttp.responseText
				}}
			xmlhttp.send('') 
	   }
}



// ajax galeria


function ajaxFotoGaleria(filtro) {
		var page = "fotoFullGaleria.asp?id_img_galeria="+filtro
		xmlhttp.open("POST", page ,true);
		xmlhttp.setRequestHeader('Content-type','application/x-www-form-urlencoded; charset=utf-8');
		xmlhttp.onreadystatechange=function() { 
					document.getElementById('imgFull').innerHTML = '<font size="1" face="tahoma"><img src="img/loading.gif" width="15" height="15" /> Carregando...</font>'
		   if(xmlhttp.readyState == 4){
					document.getElementById('imgFull').innerHTML = xmlhttp.responseText
				}}
			xmlhttp.send('') 
}
function ajaxThumbGaleria(filtro) {
		var page = "fotoThumbGaleria.asp?"+filtro
		xmlhttp.open("POST", page ,true);
		xmlhttp.setRequestHeader('Content-type','application/x-www-form-urlencoded; charset=utf-8');
		xmlhttp.onreadystatechange=function() { 
					document.getElementById('thumbnails').innerHTML = '<img src="img/loading.gif" width="15" height="15" />'
		   if(xmlhttp.readyState == 4){
					document.getElementById('thumbnails').innerHTML = xmlhttp.responseText
				}}
			xmlhttp.send('') 
}

// COMPRA ANÚNCIOS JORNAL
function atualizaCompraJornal(pageAnuncioJornal) {
		var pageActionAnuncio = pageAnuncioJornal+"?qtd="+document.formvendajornal.qtd.value+"&valoranuncio="+document.formvendajornal.valor_anuncio_pj.value;
		xmlhttp.open("POST", pageActionAnuncio ,true);
		xmlhttp.setRequestHeader('Content-type','application/x-www-form-urlencoded; charset=utf-8');
		xmlhttp.onreadystatechange=function() { 
					document.getElementById('totalizaAnuncioJornal').innerHTML = '<img src="img/loading.gif" width="15" height="15" /><font class="tahomaNormalPretaSize11"> Aguarde carregando...</font>'
		   if(xmlhttp.readyState == 4){
					document.getElementById('totalizaAnuncioJornal').innerHTML = xmlhttp.responseText
				}}
			xmlhttp.send('') 
}

// ajax add anuncio jornal
function ajaxAddAnuncioJornalPJ(pageAddUp, edicaoJornal, idAnuncio, codigoBusca, idVdJornal, tipoAnuncio) {
		var pageActionAddUpAnuncio = pageAddUp+"?id_edicao="+edicaoJornal+"&id_anuncio="+idAnuncio+"&codigo_busca="+codigoBusca+"&id_vd_jornal="+idVdJornal+"&tipo="+tipoAnuncio+"&action=insert";
		xmlhttp.open("POST", pageActionAddUpAnuncio ,true);
		xmlhttp.setRequestHeader('Content-type','application/x-www-form-urlencoded; charset=utf-8');
		xmlhttp.onreadystatechange=function() { 
					document.getElementById('tdjornal').innerHTML = '<img src="img/loading.gif" width="15" height="15" /><font class="tahomaNormalPretaSize11"> Aguarde carregando...</font>'
		   if(xmlhttp.readyState == 4){
					document.getElementById('tdjornal').innerHTML = xmlhttp.responseText
					ajaxListAnuncioJornalPJ(edicaoJornal,idVdJornal)
				}}
			xmlhttp.send('') 
}

function ajaxRemoveAnuncioJornalPJ(pageAddUp, edicaoJornal, idAnuncioEdicao, idVdJornal, idAnuncio, tipoAnuncio) {
		var pageActionAddUpAnuncio = pageAddUp+"?id_edicao="+edicaoJornal+"&id_anuncio_edicao="+idAnuncioEdicao+"&id_vd_jornal="+idVdJornal+"&id_anuncio="+idAnuncio+"&tipo="+tipoAnuncio+"&action=delete";
		xmlhttp.open("POST", pageActionAddUpAnuncio ,true);
		xmlhttp.setRequestHeader('Content-type','application/x-www-form-urlencoded; charset=utf-8');
		xmlhttp.onreadystatechange=function() { 
					document.getElementById('tdjornal').innerHTML = '<img src="img/loading.gif" width="15" height="15" /><font class="tahomaNormalPretaSize11"> Aguarde carregando...</font>'
		   if(xmlhttp.readyState == 4){
					document.getElementById('tdjornal').innerHTML = xmlhttp.responseText
					ajaxListAnuncioJornalPJ(edicaoJornal,idVdJornal)
				}}
			xmlhttp.send('') 
}
function ajaxListAnuncioJornalPJ(idEdicaoJornal,vendaID) {
		var pageActionListAnuncio = "listAnuncioJornalPJ.asp?id_edicao="+idEdicaoJornal+"&id_vd_jornal="+vendaID;
		xmlhttp.open("POST", pageActionListAnuncio ,true);
		xmlhttp.setRequestHeader('Content-type','application/x-www-form-urlencoded; charset=utf-8');
		xmlhttp.onreadystatechange=function() { 
					document.getElementById('gridListAnuncios').innerHTML = '<img src="img/loading.gif" width="15" height="15" /><font class="tahomaNormalPretaSize11"> Aguarde carregando...</font>'
		   if(xmlhttp.readyState == 4){
					document.getElementById('gridListAnuncios').innerHTML = xmlhttp.responseText
				}}
			xmlhttp.send('') 
}
function ajaxVerifyDescJornal() {
		xmlhttp.open("POST", "verifyDescJornal.asp?cod_cupom="+ document.getElementById('cod_cupom').value ,true);
		xmlhttp.setRequestHeader('Content-type','application/x-www-form-urlencoded; charset=utf-8');
		xmlhttp.onreadystatechange=function() { 
					document.getElementById('verifyDesc').innerHTML = '<font size="1" face="tahoma"><img src="img/loading2.gif"/> Aguarde carregando...</font>'
		   if(xmlhttp.readyState == 4){
					document.getElementById('verifyDesc').innerHTML = xmlhttp.responseText
				}}
			xmlhttp.send('') 
}
