V_tipoDeImovel = new Array(); V_cidade = new Array(); V_bairro = new Array(); V_tipoDeImovel[0] = "APARTAMENTO&4";V_cidade[0] = "Fortaleza&Fortaleza";V_bairro["Fortaleza"] = new Array();V_bairro["Fortaleza"][0]="Aldeota&Aldeota";V_bairro["Fortaleza"][1]="BAIRRO DE FÁTIMA&Bairro de fatima";V_bairro["Fortaleza"][2]="CAJAZEIRAS&Cajazeiras";V_bairro["Fortaleza"][3]="CAMBEBA&Cambeba";V_bairro["Fortaleza"][4]="Castelão&Castelao";V_tipoDeImovel[1] = "CASA PLANA&3";V_bairro["Fortaleza"][5]="DIONÍSIO TORRES&DionÃsio torres";V_bairro["Fortaleza"][6]="EDSON QUEIROZ&Edson queiroz";V_bairro["Fortaleza"][7]="MARAPONGA&Maraponga";V_tipoDeImovel[2] = "CASA DUPLEX&7";V_bairro["Fortaleza"][8]="Passaré&Passare";V_tipoDeImovel[3] = "LOTE&11";V_bairro["Fortaleza"][9]="PRAIA DO FUTURO&Praia do futuro";V_bairro["Fortaleza"][10]="Siqueira&Siqueira";var emobili; emobili = { codigo:"waltermota", sistemas:"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