A_tipoDeImovel = new Array(); A_cidade = new Array(); A_bairro = new Array(); A_tipoDeImovel[0] = "Loja/Prédio Comercial&10";A_cidade[0] = "Uberlandia &Uberlandia ";A_bairro["Uberlandia "] = new Array();A_bairro["Uberlandia "][0]="Centro&Centro";A_tipoDeImovel[1] = "Apartamento&1";A_cidade[1] = "Uberlândia&Uberlândia";A_bairro["Uberlândia"] = new Array();A_bairro["Uberlândia"][0]="Finote&Finote";A_tipoDeImovel[2] = "Barracão&3";A_bairro["Uberlândia"][1]="Industrial&Industrial";A_tipoDeImovel[3] = "Casa&4";A_bairro["Uberlândia"][2]="Parque São Jorge I&Parque sao jorge i";A_bairro["Uberlândia"][3]="Santa Mônica&Santa monica";A_bairro["Uberlândia"][4]="São Jorge&Sao jorge";V_tipoDeImovel = new Array(); V_cidade = new Array(); V_bairro = new Array(); V_tipoDeImovel[0] = "Chácara&6";V_cidade[0] = "Uberlândia&Uberlândia";V_bairro["Uberlândia"] = new Array();V_bairro["Uberlândia"][0]="Chácaras Eldorado&Chacaras eldorado";V_tipoDeImovel[1] = "Casa&4";V_bairro["Uberlândia"][1]="Planalto&Planalto";V_tipoDeImovel[2] = "Terreno&12";V_bairro["Uberlândia"][2]="Santa Mônica&Santa monica";var emobili; emobili = { codigo:"cityval", sistemas:"A-V", label:{ A:"Aluguel", V:"Venda", finalidade:"", tipoDeImovel:"Tipo de imóvel:", cidade:"Selecione a Cidade:", bairro:"Selecione um ou mais Bairros:", quartos:"Selecione o número de quartos:", codigo:"Pesquisa por código:", pesquisaFaixaDePreco:"Faixa de preço:", faixaDePreco:"Faixa de preço:" }, pesquisaFaixaDePreco:false, pesquisaPorFaixa:false, abrirFuncao:false, bairroSelect:false, pesquisaPorCodigo:true, exibeLabels:true, moduloFavoritos:false, sistemaAtual:"", carrega:function(){ var elemento= document.getElementById('emobiliDiv'); var ordem= this.sistemas.split("-"); var passou= 0; var topo = document.createElement("div"); topo.className = 'topo'; elemento.appendChild(topo); var tipoDiv = document.createElement("div"); tipoDiv.id = 'contorno_tipo'; tipoDiv.className = 'elementos'; var cidadeDiv = document.createElement("div"); cidadeDiv.className = 'elementos'; cidadeDiv.id = 'contorno_cidade'; var bairroCima = document.createElement("div"); bairroCima.id = 'contorno_bairro'; var bairroDiv = document.createElement("div"); bairroDiv.className = 'bairroDiv'; bairroDiv.id='emobiliBairroDiv'; var elementos = document.createElement("div"); elementos.className = 'elementos'; elementos.id = 'contorno_quartos'; var codigoDiv = document.createElement("div"); codigoDiv.className = 'elementos'; codigoDiv.id = 'contorno_codigo'; if(this.pesquisaPorFaixa){ var faixaDePreco = document.createElement("div"); faixaDePreco.className = 'faixaDePreco'; faixaDePreco.id = 'faixaDePreco'; var li = document.createElement("div"); li.innerHTML = this.label.faixaDePreco; li.className = 'labels'; faixaDePreco.appendChild(li); var fx_minimo = document.createElement("input"); fx_minimo.id = 'faixaDePreco_minimo'; fx_minimo.type= 'text'; fx_minimo.value = 'Preco minimo'; fx_minimo.onfocus = function(){ if(this.value == 'Preco minimo') this.value = ''; } fx_minimo.onblur = function(){ while(this.value.indexOf(".")>=0) this.value = this.value.replace(".", ""); vteste = this.value; while(vteste.indexOf(",")>=0) vteste = vteste.replace(",", ""); if( this.value == '' || isNaN(vteste) || parseInt(vteste) == 0 ){ this.value = 'Preco minimo'; }else{ if(this.value.indexOf(',')==-1){ this.value = this.value+',00'; }else{ var valor = this.value.split(','); if(valor[1].length == 0){ this.value = valor[0] + ',00'; } else if(valor.length == 2){ if(valor[1].length == 1){ this.value = valor[0] + ',' + valor[1] + '0'; }else if(valor[1].length > 2){ this.value = valor[0] + valor[1] + ',00'; } }else if(valor.length > 2){ this.value = ''; for(x=0; x < (valor.length-1); x++){ this.value = this.value+valor[x]; } if(valor[(valor.length-1)].length==2){ this.value = this.value+','+valor[(valor.length-1)]; }else{ this.value = this.value+valor[(valor.length-1)]+',00'; } } } valor = this.value.split(','); var valorTemp = ''; if(valor[0].length>3){ y = 0; for(x=valor[0].length;x!=-1;x--){ if(y==4){ y=1; valorTemp = '.'+valorTemp; } valorTemp = valor[0].substr(x,1)+valorTemp; y++; } this.value = valorTemp+","+valor[1]; }else if(valor[0].length==0) this.value = "0,00"; } } var fx_maximo = document.createElement("input"); fx_maximo.id = 'faixaDePreco_maximo'; fx_maximo.type= 'text'; fx_maximo.value = 'Preco maximo'; fx_maximo.onfocus = function(){ if(this.value == 'Preco maximo') this.value = ''; } fx_maximo.onblur = function(){ while(this.value.indexOf(".")>=0) this.value = this.value.replace(".", ""); vteste = this.value; while(vteste.indexOf(",")>=0) vteste = vteste.replace(",", ""); if( this.value == '' || isNaN(vteste) || parseInt(vteste) == 0 ){ this.value = 'Preco maximo'; }else{ if(this.value.indexOf(',')==-1){ this.value = this.value+',00'; }else{ var valor = this.value.split(','); if(valor[1].length == 0){ this.value = valor[0] + ',00'; } else if(valor.length == 2){ if(valor[1].length == 1){ this.value = valor[0] + ',' + valor[1] + '0'; }else if(valor[1].length > 2){ this.value = valor[0] + valor[1] + ',00'; } }else if(valor.length > 2){ this.value = ''; for(x=0; x < (valor.length-1); x++){ this.value = this.value+valor[x]; } if(valor[(valor.length-1)].length==2){ this.value = this.value+','+valor[(valor.length-1)]; }else{ this.value = this.value+valor[(valor.length-1)]+',00'; } } } valor = this.value.split(','); var valorTemp = ''; if(valor[0].length>3){ y = 0; for(x=valor[0].length;x!=-1;x--){ if(y==4){ y=1; valorTemp = '.'+valorTemp; } valorTemp = valor[0].substr(x,1)+valorTemp; y++; } this.value = valorTemp+","+valor[1]; }else if(valor[0].length==0) this.value = "0,00"; } } faixaDePreco.appendChild(fx_minimo); faixaDePreco.appendChild(fx_maximo); } var botoes = document.createElement("div"); botoes.className = 'botoes'; var pesquisaFaixaDePreco = document.createElement("div"); pesquisaFaixaDePreco.className = 'elementos'; pesquisaFaixaDePreco.id = 'contorno_pesquisaFaixaDePreco'; if(this.exibeLabels){ if(this.label.finalidade!=""){ var li = document.createElement("div"); li.innerHTML = this.label.finalidade; li.className = 'labels'; li.style.cursor='pointer'; topo.appendChild(li); } if(this.label.tipoDeImovel!=""){ var li = document.createElement("div"); li.innerHTML = this.label.tipoDeImovel; li.className = 'labels'; tipoDiv.appendChild(li); } if(this.label.cidade!=""){ var li = document.createElement("div"); li.innerHTML = this.label.cidade; li.className = 'labels'; cidadeDiv.appendChild(li); } if(this.label.bairro!=""){ var li = document.createElement("div"); li.innerHTML = this.label.bairro; li.className = 'labels'; bairroCima.appendChild(li); } } elemento.appendChild(tipoDiv); elemento.appendChild(cidadeDiv); bairroCima.appendChild(bairroDiv); elemento.appendChild(bairroCima); if(this.pesquisaPorFaixa){ elemento.appendChild(faixaDePreco); } elemento.appendChild(elementos); if(this.pesquisaPorCodigo){ elemento.appendChild(codigoDiv); } if(this.pesquisaFaixaDePreco){ elemento.appendChild(pesquisaFaixaDePreco); } elemento.appendChild(botoes); while(passou