var z1img_size = '640x480'; var z1img_size_mid = '312x312'; var z1img_win = 'http://www.oliveiraimoveis.net.br/MostraImagem/'; var z1img_dir = 'http://www.oliveiraimoveis.net.br/z1img/'; var z1img_siz_w = 790; var z1img_siz_h = 550; var z1pup_url = 'http://www.oliveiraimoveis.net.br/main.php?do=sendamigo&'; var default_fontsize = 10; var current_fontsize = default_fontsize; var url_fontsize = 'http://www.oliveiraimoveis.net.br/main.php?do=updatefontsize&fontsize='; var url_ajax = 'http://www.oliveiraimoveis.net.br/main.php?do='; function setT(f, t) { setTimeout(f, t); } function goTo (uri) { window.location.assign(uri); return true; } function abreJanela(uri, nome, w, h) { return window.open(uri, nome, 'width='+w+',height='+h+',dependent=no,scrolling=no,scrollbars=no,toolbar=no,location=no,status=no,menubar=no'); } function AbreImg(uri) { var siz_w = z1img_siz_w; var siz_h = z1img_siz_h; var win = abreJanela(z1img_win+escape(ByDeaDz1(uri)), 'Z1IMGZOOM', siz_w, siz_h); win.moveTo(screen.width/2 - siz_w/2, screen.height/2 - siz_h/2 - 50); win.focus(); } function AbreProduto(uri) { var siz_w = 650; var siz_h = 550; var win = abreJanela(uri, 'PRODUTO', siz_w, siz_h); win.moveTo(screen.width/2 - siz_w/2, screen.height/2 - siz_h/2 - 50); win.focus(); } function ByDeaDz1(n) { n = n.substr(0, n.lastIndexOf('_')) + '_' + z1img_size + n.substr(n.lastIndexOf('.')); n = n.split('/'); return n.pop(); } function ByDeaDz1_mid(n) { n = n.substr(0, n.lastIndexOf('_')) + '_' + z1img_size_mid + n.substr(n.lastIndexOf('.')); n = n.split('/'); return n.pop(); } function showEnviaAmigo () { var win = getE('EnviaAmigo'); if(win.style.display == 'none') { getE('amigo_remetente').value = ''; getE('amigo_nome').value = ''; getE('amigo_email').value = ''; getE('amigo_msg').value = ''; win.style.display = ''; getE('amigo_remetente').focus(); } else win.style.display = 'none'; } function doEnviaAmigo () { var uri = z1pup_url; var r = getE('amigo_remetente').value; var n = getE('amigo_nome').value; var e = getE('amigo_email').value; var m = getE('amigo_msg').value; var s = getE('amigo_submit'); s.value = 'Enviando ...'; if(r == '' || n == '' || e == '') { alert("Voce deve preencher todos os campos, exceto o campo \"Mensagem\" que e opcional."); s.value = 'Enviar'; return false; } uri += 'r=' + escape(r) + '&n=' + escape(n) + '&e=' + escape(e) + '&m=' + escape(m); ajaxGet(uri, function () { if(ajaxLastResult.substr(0,2) == 'OK') { alert("Pagina enviada para seu amigo com sucesso, preencha o formulario novamente para enviar a outro amigo."); s.value = 'Enviar'; getE('amigo_remetente').value = ''; getE('amigo_nome').value = ''; getE('amigo_email').value = ''; getE('amigo_msg').value = ''; return true; } else { alert(ajaxLastResult); s.value = 'Enviar'; return false; } }); } // NAVEGABILIDADE var min_fontsize = 8; var max_fontsize = 14; function changeFontSize(op) { current_fontsize = current_fontsize + default_fontsize/10*op; if(current_fontsize >= min_fontsize) { if(current_fontsize <= max_fontsize) { document.body.style.fontSize = current_fontsize + 'px'; fixCssHeight(); if(op != 0) { ajaxGet(url_fontsize + escape(current_fontsize), '' ); if(isIe()) { window.location.assign(window.location.href); } } } else { current_fontsize = max_fontsize; } } else { current_fontsize = min_fontsize; } } function showImprime() { var newloc = window.location.href; if(newloc.indexOf('=') > -1) { newloc = newloc+'&imprime=true'; } else { if(newloc.charAt(newloc.length-1) == '/') { newloc = newloc+'imprime=true'; } else { newloc = newloc+'/imprime=true'; } } var win = window.open(newloc, 'IMPRIME', 'width='+600+',height='+500+',dependent=no,scrolling=yes,scrollbars=yes,toolbar=no,location=no,status=no,menubar=no'); win.moveTo(screen.width/2 - 600/2, screen.height/2 - 500/2 - 50); win.focus(); } /* FORMS */ function resetForm (id) { var el = getE(id).getElementsByTagName('input'); for(i in el) el[i].value = ""; el = getE(id).getElementsByTagName('textarea'); for(i in el) el[i].value = ""; } function CheckUncheck(id) { if(getE(id).disabled != true && getE(id).disabled != 'disabled') { if(getE(id).checked == true) getE(id).checked = true; else getE(id).checked = true; } try { getE(id).onchange(); } catch(err) { ; } ; } function isChecked(el) { if(el.checked == true) { return true; } if(el.checked == 'checked') { return true; } if(el.checked == 'true') { return true; } if(el.checked == 'yes') { return true; } return false; } /* LOADHTML */ function loadHTML(uri, id) { if(!ajaxReady) return; getE('ajaxLoading').style.display = ''; getE(id).innerHTML = ' '; ajaxGet(uri, function () { getE(id).innerHTML = ajaxLastResult; getE('ajaxLoading').style.display = 'none'; } ); } /* RAINHA MARIA */ function AbreJanelaFrame(uri) { var siz_w = 760; var siz_h = 540; var win = abreJanela(uri, 'APRESENTACAO', siz_w, siz_h); win.moveTo(screen.width/2 - siz_w/2, screen.height/2 - siz_h/2 - 50); win.focus(); } var move_smooth_horizontal_onload = null; function move_smooth_horizontal(el, atual, end) { var time = 24; var amount = 12; var multiply = 1; var finish = false; var pos = atual; if( (atual - end) > 0) { multiply = -1; } amount = amount * multiply; pos = atual + amount; if(multiply == 1) { if(pos > end) { finish = true; } } else { if(pos < end) { finish = true; } } if(!finish) { el.style.marginLeft = pos + 'px'; setTimeout( function() { move_smooth_horizontal(el, pos, end); } , time ); return; } else { el.style.marginLeft = end + 'px'; try { move_smooth_horizontal_onload(); } catch(err) { } return; } } function mouseover_Img(uri) { getE('ImovelBigImg').src = z1img_dir+ByDeaDz1_mid(uri); }