﻿function bindAno(comboAno, formName) {
j=0;
eval("document.getElementById(formName)."+comboAno+".options[0] = new Option('-', '')");
for (i=2009; i > 1908;i--){
j++;
eval("document.getElementById(formName)."+comboAno+".options[j] = new Option(i, i)");
}}
function carregaPreco(formName, cboPreco)
{
eval("document.getElementById(formName)."+cboPreco+".options[0] = new Option('R$', '0')");
for (i = 0; i<50; i++)
{
eval("document.getElementById(formName)."+cboPreco+".options[i+1] = new Option('"+(i*1000)+",00', '"+(i*1000)+"' )");
}}
function carregaPrecoFinal(formName, cboPreco, valor)
{
document.FormBusca.hidPreIni.value = valor;
limpaCombo(cboPreco);
eval("document.getElementById(formName)."+cboPreco+".options[0] = new Option('R$', '0')");
val = valor /1000 +1;
j = 0;
for (i = 0; i<75; i++)
{
eval("document.getElementById(formName)."+cboPreco+".options[j] = new Option('"+((i*2500)+(val*1000))+",00', '"+((i*2500)+(val*1000))+"' )");
j++;

}
for (i =75; i<125; i++)
{

eval("document.getElementById(formName)."+cboPreco+".options[j] = new Option('"+((i*5000)+((val-1)*1000)-184000)+",00', '"+((i*5000)+((val-1)*1000)-184000)+"' )");
j++;
}}
function newFunction(modeloid)
{
document.FormBusca.hidModeloID.value = modeloid;
}
function passPreco(preco)
{
document.FormBusca.hidPreFin.value =  preco;
}
function fillAnoM(comboAnoM, AnoFabri, formName)
{
limpaCombo('cboAnoM');
//alert(document.getElementById('cboAno').options[document.getElementById('cboAno').selectedIndex].value;
var AnoFab = AnoFabri;
j = 0;
if(AnoFabri != "")
{
eval("document.getElementById(formName)."+comboAnoM+".options[0] = new Option(AnoFabri, AnoFabri)");
for (i=AnoFab; i < 2009; i++)
{
j++;
AnoFab++;
//obj.options[j] = new Option(i, i);
eval("document.getElementById(formName)."+comboAnoM+".options[j] = new Option(AnoFab, AnoFab)");
}
document.FormBusca.hidAnoIni.value = AnoFabri - 1900;
}
else
{
bindAno('cboAnoM', 'FormBusca');
document.FormBusca.hidAnoIni.value = "0";
}
}
function bindModeloMarcaMoto(formName, comboModelo, valorMarca, valorModelo, PermitirNovos, PermitirUsados) {
var j=0;
limpaComboMoto(comboModelo);
eval("document.getElementById(formName)."+comboModelo+".options[0] = new Option('-', '')");
for (i = 0; i < modelosMoto.length; i++)
{
if (valorMarca == modelosMotoMarcaID[i]) 
{
j++;
eval("document.getElementById(formName)."+comboModelo+".options[j] = new Option(modelosMoto[i], i)");
if (eval("document.getElementById(formName)."+comboModelo+".options[j].value") == valorModelo)
eval("document.getElementById(formName)."+comboModelo+".options[j].selected=true");		
}}
}
function loadXMLModeloID(_valorMarcaID, _tipo, formName, comboModelo, valorMarca, valorEstado) {
xmlHttp = GetXmlHttpObject();
if (xmlHttp == null) {
alert("Seu navegador não suporta AJAX!");
return;
}
xmlHttp.onreadystatechange = function() {
switch(xmlHttp.readyState)
{
case 0: eval("document.getElementById('FormBusca').cboModelo.options[0] = new Option('Carregando.', '')");break;
case 1: eval("document.getElementById('FormBusca').cboModelo.options[0] = new Option('Carregando..', '')"); break;
case 2: eval("document.getElementById('FormBusca').cboModelo.options[0] = new Option('Carregando...', '')"); break;
case 3: eval("document.getElementById('FormBusca').cboModelo.options[0] = new Option('Carregando....', '')"); break;
}
if (xmlHttp.readyState == 4) {
//document.getElementById('hidpgini').value = pgini;
bindModeloAjax(xmlHttp.responseText,_tipo, formName, comboModelo, valorMarca);
}
}
xmlHttp.open("GET", '/ajax/ajax_busca_marca.aspx?marcaid=' + _valorMarcaID + '&tipo=' + _tipo+'&uf='+valorEstado, true);
xmlHttp.send(null);
return xmlHttp;
}
function bindMarca(formName, comboMarca, comboModelo, valorMarca) 
{
    limpaCombo(comboModelo);
    document.FormBusca.hidModeloID.value = "0";
    
eval("document.getElementById(formName)."+comboMarca+".options[0] = new Option('-', '')");

for (i=0;i<_marcas.length;i++)
{eval("document.getElementById(formName)."+comboMarca+".options[i+1] = new Option(_marcas[i], _marcasid[i])");
if(valorMarca!='')
{
if (eval("document.getElementById(formName)."+comboMarca+".options[i+1].value") == valorMarca)		
eval("document.getElementById(formName)."+comboMarca+".options[i+1].selected=true");	
}
}
if(valorMarca=='')
{
eval("document.getElementById(formName)."+comboMarca+".options[0].selected=true");	
}
document.FormBusca.hidTipo.value = "0";
//FunHiddenMoto() 
////{
//document.getElementById('comprarMoto').style.visibility='hidden';
//}
//document.write(valorMarca);
}
function bindModelo(formName, comboModelo, valorMarca, valorModelo) {
var j=0;
limpaCombo(comboModelo);
eval("document.getElementById(formName)."+comboModelo+".options[0] = new Option('-', '')");
for (i = 0; i < modelos.length; i++)
{
if (valorMarca == modelosMarcaid[i]) {
j++;
eval("document.getElementById(formName)."+comboModelo+".options[j] = new Option(modelos[i], modelosID[i])");
//alert(eval("document.getElementById(formName)."+comboModelo+".options.length"));	
//document.FormBusca.hidModeloID.value = i;	
if (eval("document.getElementById(formName)."+comboModelo+".options[j].value") == valorModelo)
eval("document.getElementById(formName)."+comboModelo+".options[j].selected=true");
}
}
}
function bindModeloAjax(_arrayModelos, _tipo, formName, comboModelo, valorMarca) {
limpaCombo(comboModelo);
Modelo = new Array();
ModeloID = new Array();
ModeloMarcaID = new Array();
if (_tipo == 0) {
Modelo = modelos;
ModeloID = modelosID;
ModeloMarcaID = modelosMarcaID;
}
if (_tipo == 1) {
Modelo = modelosMoto;
ModeloID = modelosMotoID;
ModeloMarcaID = modelosMotoMarcaID;
}
if (_arrayModelos == null || _arrayModelos == "") { eval("document.getElementById(formName)." + comboModelo + ".options[0] = new Option('Nenhum', '')"); }
else {
meuArrayModelos = _arrayModelos.split('|');
jota = 0;
eval("document.getElementById(formName)." + comboModelo + ".options[0] = new Option('-', '0')");
for (i = 0; i < meuArrayModelos.length; i++) {
for (nerv = 0; nerv < Modelo.length; nerv++) {
if (meuArrayModelos[i] == ModeloID[nerv]) {
jota++;
eval("document.getElementById(formName)." + comboModelo + ".options[jota] = new Option(Modelo[nerv], ModeloID[nerv])");
}}}}}
//mascara numeros
function mascara(o,f)
{
v_obj=o;
v_fun=f;
setTimeout("execmascara()",1);
}
function execmascara(){
v_obj.value=v_fun(v_obj.value);
}
function numeros(v)
{
return v.replace(/\D/g,""); //Remove tudo o que não é dígito
}
function limpaCombo(combo)
{
if (document.getElementById(combo) != null)
document.getElementById(combo).options.length = 0;
}
function bindSelect2(valueMarca) {
_iEstado = 0;
if (document.getElementById('cboEstado').value != 0) _iEstado = document.getElementById('cboEstado').value;
if (document.getElementById('rdoCarro').checked == true) {
loadXMLModeloID(valueMarca,0,'FormBusca','cboModelo', valueMarca, _iEstado);
}
else if (document.getElementById('rdoMoto').checked == true) {
loadXMLModeloID(valueMarca,1,'FormBusca','cboModelo', valueMarca, _iEstado);
}
document.FormBusca.hidMarcaID.value = valueMarca;
}
function passanofin(anofin)
{
document.FormBusca.hidAnoFin.value = anofin - 1900;
}
function limpaComboMoto(combo)
{
if (document.getElementById(combo) != null)
document.getElementById(combo).options.length = 0;
}
function bindMarcaMoto(formName, comboMarca, valorMarca)
{
var MarcaSel = true;
limpaComboMoto(comboMarca);
for (i = 0; i < MarcaMoto.length; i++)
{
eval("document.getElementById(formName)."+comboMarca+".options[i] = new Option(MarcaMoto[i], i)");
if (eval("document.getElementById(formName)."+comboMarca+".options[i].value") == valorMarca) {
if(MarcaSel) 
{
eval("document.getElementById(formName)."+comboMarca+".options[i].selected=true");
MarcaSel = false;
}}}}
function bindMarcaApagaModeloMoto(formName, comboMarca, comboModelo, valorMarca) 
{
var MarcaSel = true;
limpaComboMoto(comboModelo);
limpaComboMoto(comboMarca);
for (i = 0; i < marcaMoto.length; i++)
{
eval("document.getElementById(formName)."+comboMarca+".options[i] = new Option(marcaMoto[i], marcaMotoID[i])");
if (eval("document.getElementById(formName)."+comboMarca+".options[i].value") == valorMarca)
{
if(MarcaSel) 
{
eval("document.getElementById(formName)."+comboMarca+".options[i].selected=true");
MarcaSel = false; 
}
}
}
document.FormBusca.hidTipo.value = "1";
}
function fcGCO(c_name) {
if (document.cookie.length > 0) {
c_start = document.cookie.indexOf(c_name + "=");
if (c_start != -1) {
c_start = c_start + c_name.length + 1;
c_end = document.cookie.indexOf(";", c_start);
if (c_end == -1) c_end = document.cookie.length;
return unescape(document.cookie.substring(c_start, c_end));
}
}
return null;
}
function ir() {
var x = document.getElementById("cboMarca");
var xmodelo = document.getElementById("cboModelo");
var xst = document.getElementById("cboTipoCarro");
var textoBusca = "";
var _estado = "";
var rediIncom ="";
_estado   = _EstadosInteiro[parseInt(document.FormBusca.cboEstado.value)]
if (document.FormBusca.hidMarcaID.value != "0" && document.FormBusca.hidMarcaID.value != "") textoBusca += retirar_acento(x.options[x.selectedIndex].text);
if (document.FormBusca.hidModeloID.value != "0" && document.FormBusca.hidModeloID.value != "" && xmodelo.selectedIndex != "0" && xmodelo.selectedIndex != "-1" && xmodelo.options[xmodelo.selectedIndex].text != "Nenhum") textoBusca += "-" + retirar_acento(xmodelo.options[xmodelo.selectedIndex].text);
textoBusca = textoBusca.replace(" ","-");
if (x.selectedIndex != "0") {
if (document.FormBusca.cboEstado.value != "0" && document.FormBusca.cboEstado.value != "") rediIncom += "&estado=" + _estado;    
if (document.FormBusca.hidMarcaID.value != "0" && document.FormBusca.hidMarcaID.value != "") rediIncom += "&maid=" + document.FormBusca.hidMarcaID.value;
if (document.FormBusca.hidModeloID.value != "0" && document.FormBusca.hidModeloID.value != "" && xmodelo.selectedIndex != "0" && xmodelo.selectedIndex != "-1") rediIncom += "&moid=" + document.FormBusca.hidModeloID.value;
if (document.FormBusca.hidAnoIni.value != "0" && document.FormBusca.hidAnoIni.value != "") rediIncom += "&anoini=" + document.FormBusca.hidAnoIni.value;
if (document.FormBusca.hidAnoFin.value != "0" && document.FormBusca.hidAnoFin.value != "") rediIncom += "&anofin=" + document.FormBusca.hidAnoFin.value;
if (document.FormBusca.hidPreIni.value != "0" && document.FormBusca.hidPreIni.value != "") rediIncom += "&preini=" + document.FormBusca.hidPreIni.value;
if (document.FormBusca.hidPreFin.value != "0" && document.FormBusca.hidPreFin.value != "") rediIncom += "&prefin=" + document.FormBusca.hidPreFin.value;
if (document.FormBusca.cboEstado.value != "0" && document.FormBusca.cboEstado.value != "") rediIncom += "&uf=" + document.FormBusca.cboEstado.value;
rediIncom += "&pg=1";
if (document.FormBusca.hidTipo.value =="0" && xst.value == "0")window.location = "http://www.achacarro.com.br/achar-carros-usados/?busca="+textoBusca + rediIncom;
if (document.FormBusca.hidTipo.value == "1" && xst.value == "0") window.location = "http://www.achacarro.com.br/achar-motos-scooters/?busca=" + textoBusca + rediIncom;     
}
else {
alert('Selecione uma marca.');
}
}
function carregaDestaques(reg) {
carregaDesRevendas(reg,1);
carregaXml(reg, 1);
}
function passaValores(arXml, _pRegiao, _pNrPg) {
    if (_pRegiao == 0){document.getElementById('destaques').innerHTML = ""; return; }
txtDestaque = "";
document.getElementById('destaques').innerHTML = "";
if (_pNrPg == null || _pNrPg == undefined) _pNrPg = 1;
if (arXml == null && _txtfi == null) carregaXml(_pRegiao, _pNrPg);
if (arXml != null || _txtfi != null) {
var splitar = null;
if (arXml == null)
{ splitar = _txtfi; }
else
{ splitar = arXml; }
var myarrayDetalhes = splitar.split("&");
var nr_destaques = myarrayDetalhes.length -1;

_pags = parseInt(nr_destaques / 10);
_pagsFloat = parseFloat(nr_destaques / 10);

//alert(_pags + " " + _pagsFloat);
if (_pags == _pagsFloat)
{ _pags--; }
_pags++;
//alert(_pags + " " + _pagsFloat);
var _iNrFin = parseInt((_pNrPg - 1) * 10 + 11);
var _iNrIni = parseInt(_pNrPg * 10 - 9);
for (ironia = _iNrIni; ironia < _iNrFin; ironia++) {
var _for = myarrayDetalhes[ironia];
var _revenda = "";
var _versao = "";
var _local = "";
var _preco = "";
var _veiID = 0;
var _url = "";
if(_for != undefined) {
var _final = _for.split("|");
if(_final[0] != undefined) {
_veiID = _final[0];
}
if(_final[1] != undefined) {
_versao = _final[1];
}
if(_final[2] != undefined) {
_local = _final[2];
}
if(_final[3] != undefined) {
_revenda = _final[3];
}
if (_final[4] != undefined) {
_preco = _final[4];
}
if (_final[5] != undefined) {
    _url = _final[5];
}
txtDestaque += " <span class=\"panel\">" +
"<span class=\"imgDest\">" +
"<a href=\""+_url+"\" target='_blank'><img src=\"Fotos/Tum/t_1_" + _veiID + ".jpeg\" alt=\"\"  onerror=\"imgNF(this);\" /></a>" +
"</span>" +
"<span class=\"dirDest\">" + _versao + "<br />" + _revenda + "<br />" + _local + "<br /><b>R$ " + _preco + ",00</b>" +
"</span>" +
"</span>";
}
}
document.getElementById('destaques').innerHTML = txtDestaque;
if (txtDestaque == "") document.getElementById('destaques').innerHTML = "Nenhum destaque encontrado.";
_combo = "<select id=\"cboRoda\"   class=\"sl1\"  style=\"width:40px\" onchange=\"passaValores(_txtfi,_sRegiao,this.value);\"> ";
if (_pags != 0 && _pags != 1 && _pags != -1) {
for (inri = 1; inri <= _pags; inri++) {
if (inri == _pNrPg) {
_combo += "<option value=\"" + inri + "\"selected = \"selected\">" + inri + "</option>";
} else {
_combo += "<option value=\"" + inri + "\">" + inri + "</option>";
}
}
_combo += "</select>";
document.getElementById('cboPagina').innerHTML = _combo;
}
}
}
function passaValoresRevenda(parXml, _regiao, _nrIni) {
  
   
txtDestaqueRev = "";
if (_nrIni == null || _nrIni == undefined) _nrIni = 1;
if (parXml == null && _txtfi2 == null) carregaDesRevendas(_regiao, _nrIni);
if (parXml != null || _txtfi2 != null) {
var splitar = null;
if (parXml == null)
{ splitar = _txtfi2; }
else
{ splitar = parXml; }
var myarrayDetalhes = splitar.split("#");
var npg = parseInt(myarrayDetalhes.length / 10);
var npgFloat = parseFloat(myarrayDetalhes.length / 10);
var _iNrFinal = parseInt((_nrIni - 1) * 10 + 11);
var _iNrInicial = parseInt(_nrIni * 10 - 9);
for (i = _iNrInicial; i < _iNrFinal; i++) {
var _for = myarrayDetalhes[i];
var _nome = "";
var _descricao = "";
var _link = "";
var _revID = 0;
if (_for != undefined) {
var _final = _for.split("|");
if (_final[0] != undefined) {
_revID = _final[0];
}
if (_final[1] != undefined && _final[1] != "") {
_nome = _final[1];
}
if (_final[2] != undefined && _final[2] != "") {
_descricao = _final[2];
}
if (_final[3] != undefined && _final[3] != "") {
    _link = _final[3];
}
txtDestaqueRev += "<span class=\"RevendaDirRepeat\">" +
"<a href=\""+_link+"\"><img src=\"/Fotos/revendas/loguinho/" + _revID + ".jpg\" alt=\"\" class=\"revendasDir\"/></a>" +
"<span class=\"DadosRevendaDir\"><b><a href=\"" + _link + "\">" + _nome + "</a></b><br /> " + _descricao + "</span></span>";
}
}
document.getElementById('cboRev').innerHTML = "";
document.getElementById('revendasDestDir').innerHTML = txtDestaqueRev;
if (_regiao == "0") {
    document.getElementById('cboRev').innerHTML = "<br />";
}
var _sTxtCbo = "<select id=\"cboRodaRev\"   class=\"sl1\"  style=\"width:40px\" onchange=\"passaValoresRevenda(_txtfi2,_sRegiao, this.value);\"><br /> "
if (npg != 0 && npg != 1) {
npg++;
if (npg == npgFloat) npg--;
for (nri = 1; nri < npg; nri++) {
if (nri == _nrIni) {
_sTxtCbo += "<option value=\"" + nri + "\"selected = \"selected\">" + nri + "</option>";
}
else {
_sTxtCbo += "<option value=\"" + nri + "\">" + nri + "</option>";
}
_sTxtCbo += "</select>";
document.getElementById('cboRev').innerHTML = _sTxtCbo;
}}}}
function carregaDesRevendas(uf_, _nrIni) {
if (_nrIni == null || _nrIni == undefined) _nrIni = 1;
var xmlHttp = GetXmlHttpObject();
if (xmlHttp == null) {
alert("Seu navegador não suporta AJAX!");
return;
}
xmlHttp.onreadystatechange = function() {
if (xmlHttp.readyState == 4) {
_txtfi2 = xmlHttp.responseText;
passaValoresRevenda(xmlHttp.responseText, uf_, _nrIni);
}
}
xmlHttp.open("GET", "/ajax/ajax_desRevendas.aspx?estado=" + uf_, true);
xmlHttp.send(null);
return xmlHttp;
}
function carregaXml(_uf, _pnrpg) {
var xmlHttp = GetXmlHttpObject();
if (xmlHttp == null) {
alert("Seu navegador não suporta AJAX!");
return;
}
xmlHttp.onreadystatechange = function() {
//switch(xmlHttp.readyState)
//{
//case 0: alert('Inicio');break;
//case 1: alert('set');break;
//case 2: alert('Enviado');break;
//case 3: alert('Process');break;
//}
if (xmlHttp.readyState == 4) {
document.getElementById('cboPagina').innerHTML = "";
_txtfi = xmlHttp.responseText;
passaValores(xmlHttp.responseText, _uf, _pnrpg);
}
}
xmlHttp.open("GET", "/ajax/ajax_destaque.aspx?estado=" + _uf, true);
xmlHttp.send(null);
return xmlHttp;
}
function PVC(_sNome_c, _sNvalor) {
texto = fcGCO(_sNome_c);
_sNome = "vazio";
qs = new Array();
if (texto != "" && texto != null) {
variaveis = texto.replace(/\x3F/, "").replace(/\x2B/g, " ").split("&");
if (variaveis != "") {
for (i = 0; i < variaveis.length; i++) {
nvar = variaveis[i].split("=")
qs[nvar[0]] = unescape(nvar[0] + "=" + nvar[1] + "&")
}
}
variavei = texto.replace(/\x3F/, "").replace(/\x2B/g, " ").split("&");
if (variavei != "") {
for (i = 0; i < variavei.length; i++) {
nvara = variavei[i].split("=")
qs[nvara[0]] = unescape(nvara[1])
}
}
function QueryStringv(variavei) {
return qs[variavei]
}
if (QueryStringv(_sNvalor) != undefined) _sNome = QueryStringv(_sNvalor);
}
return _sNome;
}
function GetXmlHttpObject() {
var xmlHttp = null;
try {
// Firefox, Opera 8.0+, Safari
xmlHttp = new XMLHttpRequest();
}
catch (e) {
// Internet Explorer
try {
xmlHttp = new ActiveXObject("Msxml2.XMLHTTP");
}
catch (e) {
xmlHttp = new ActiveXObject("Microsoft.XMLHTTP");
}}
return xmlHttp;
}
function imgNF(_obj) {
    if (_obj.src.match('sem-foto.gif') == null) _obj.src = 'http://www.achacarro.com.br/Fotos/sem-foto.gif';
}
function montaLogin() {
function revor() {
if (PVC("Preferencias", "RevID") != "0" && PVC("Preferencias", "RevID") != "vazio") {
return true;
}
if (PVC("Preferencias", "UserID") != "0" && PVC("Preferencias", "UserID") != "vazio") {
return false;
}
}
if (PVC("Preferencias", "Nome") != "vazio") {
_sNome = "";
_sNome = PVC("Preferencias", "Nome");
_aNome = _sNome.split(" ");
if (revor()) {
txtfinal = "<span class='oa'>Olá " + _aNome[0] + " " + "</span><br />";
txtfinal += "<ul><li><a href='http://www.achacarro.com.br/rev/' rel=\"nofollow\">Minha Conta</a></li>";
txtfinal += "<li><a href='http://www.achacarro.com.br/rev/MeusVeiculos.aspx' rel=\"nofollow\">Meus Veículos</a></li>";
txtfinal += "<li><a href='http://www.achacarro.com.br/perguntas-frequentes.htm' rel=\"nofollow\">Perguntas frequentes</a></li>";
txtfinal += "<li><a href='http://www.achacarro.com.br/comprando/rev-pagar.aspx' rel=\"nofollow\">Pagamento</a></li>";
txtfinal += "<li><a href='http://www.achacarro.com.br/planos/precos-revendedores/default.aspx' rel=\"nofollow\">Preços Revendedores</a></li>";
txtfinal += "<li><a href='http://www.achacarro.com.br/perguntas-frequentes.htm#14' rel=\"nofollow\">Como incluir fotos</a></li>";
txtfinal += "<li><a href='http://www.achacarro.com.br/Logout.aspx' rel=\"nofollow\">Sair</a></li></ul>";
document.getElementById('nome').innerHTML = txtfinal;
}
else {
txtfinal = "<span class='oa'>Olá " + _aNome[0] + " " + "</span><br />";
txtfinal += "<ul><li><a href='http://www.achacarro.com.br/user/' rel=\"nofollow\">Minha Conta</a></li>";
txtfinal += "<li><a href='http://www.achacarro.com.br/user/MeusVeiculos.aspx' rel=\"nofollow\">Meus Veículos</a></li>";
txtfinal += "<li><a href='http://www.achacarro.com.br/comprando/user-pagar.aspx' rel=\"nofollow\">Pagamento</a></li>";
txtfinal += "<li><a href='http://www.achacarro.com.br/perguntas-frequentes.htm' rel=\"nofollow\">Perguntas frequentes</a></li>";
txtfinal += "<li><a href='http://www.achacarro.com.br/perguntas-frequentes.htm#14' rel=\"nofollow\">Como incluir fotos</a></li>";
txtfinal += "<li><a href='http://www.achacarro.com.br/planos/precos-particulares/' rel=\"nofollow\">Preços Particulares</a></li>";
txtfinal += "<li><a href='http://www.achacarro.com.br/Logout.aspx' rel=\"nofollow\">Sair</a></li></ul>"; 
document.getElementById('nome').innerHTML = txtfinal;
}
}
else {
txtNao = "<span class='para'>Seja bem-vindo visitante!</span><br />";
txtNao += "<ul><li><a href='https://www.achacarro.com.br/Login.aspx' rel=\"nofollow\">Login</a></li>";
txtNao += "<li><a href='https://www.achacarro.com.br/cadastro/nova-revenda/default.aspx' rel=\"nofollow\">Cadastro Revendedores</a></li>";
txtNao += "<li><a href='https://www.achacarro.com.br/cadastro/novo-usuario/default.aspx'  rel=\"nofollow\">Cadastro Particulares</a></li>";
txtNao += "<li><a href='http://www.achacarro.com.br/planos/precos-particulares/' rel=\"nofollow\">Preços Particulares</a></li>";
txtNao += "<li><a href='http://www.achacarro.com.br/planos/precos-revendedores/' rel=\"nofollow\">Preços Revendedores</a></li>";
txtNao += "<li><a href='http://www.achacarro.com.br/comprar/compra-segura/' rel=\"nofollow\">Compra Segura</a></li>";
txtNao += "<li><a href='http://www.achacarro.com.br/perguntas-frequentes.htm' rel=\"nofollow\">Perguntas Frequentes</a></li>";
txtNao += "<li><a href='http://www.achacarro.com.br/contato.aspx' rel=\"nofollow\">Contato</a></li>";
//txtNao += "<li><a href='http://www.achacarro.com.br/Ajuda.aspx' >Ajuda</a></li>  </ul>";
document.getElementById('nome').innerHTML = txtNao;
}
}
function abreVeiculo() {
_o_Veiid = document.getElementById('txtVeiid').value;
if(_o_Veiid == "")
{alert('Digite o Código do Veículo.') }
else{
str = "";
if (window.screen) {
ah = screen.availHeight - 30;
aw = screen.availWidth - 10;
xc = (aw - 1040) / 2;
yc = (ah - 800) / 2;
str = "height=" + ah + ",innerHeight=800";
str += ",width=" + aw + ",innerWidth=1040";
str += ",status=yes,scrollbars=yes,resizable=yes";
str += ",left=0,screenX=" + xc;
str += ",top=0,screenY=" + yc;
}

window.open('/veiculos/' + _o_Veiid + '.htm', 'Veículo', str);
    }
}
function Security(val, tamanho) {
document.getElementById('mensagemSenha').innerHTML = "";
if (val.length < 6) {
document.getElementById('mensagemSenha').innerHTML = "";
document.getElementById('senha2').style.width = '0%';
}
var lc = /[a-z]/; // lowercase letters
var uc = /[A-Z]/; // uppercase letters
var nm = /[0-9]/; // numbers
var un = /[A-Za-z0-9]/; // upper- and lower-case letters and numbers
var ec = /[@!#$%&*+=?|-]/; //caracteres especiais 
if (val.length >= tamanho && uc.test(val) && lc.test(val) && nm.test(val) || ec.test(val)) {
document.getElementById('mensagemSenha').innerHTML = "Forte!";
document.getElementById('senha2').style.width = '100%';
document.getElementById('senha2').style.backgroundColor = '#008000';
}
else {
if (val.length >= tamanho && uc.test(val) && lc.test(val) || lc.test(val) && nm.test(val) || uc.test(val) && nm.test(val)) {
document.getElementById('mensagemSenha').innerHTML = "Média!"
document.getElementById('senha2').style.width = '66%';
document.getElementById('senha2').style.backgroundColor = 'orange'
}
else {
if (val.length >= tamanho) {
document.getElementById('mensagemSenha').innerHTML = "Fraca!";
document.getElementById('senha2').style.width = '33%';
document.getElementById('senha2').style.backgroundColor = 'red';
}
}
}
}
function retirar_acento(palavra) {
    com_acento = 'áàãâäéèêëíìîïóòõôöúùûüçÁÀÃÂÄÉÈÊËÍÌÎÏÓÒÕÖÔÚÙÛÜÇ';
    sem_acento = 'aaaaaeeeeiiiiooooouuuucAAAAAEEEEIIIIOOOOOUUUUC';
    nova = '';
    for (i = 0; i < palavra.length; i++) {
        if (com_acento.search(palavra.substr(i, 1)) >= 0) {
            nova += sem_acento.substr(com_acento.search(palavra.substr(i, 1)), 1);
        }
        else {
            nova += palavra.substr(i, 1);
        }
    }
    return nova;
}