window.onerror = function (m,a1,a2,a3) { /*alert(m);*/ } window.debugging = false; var z1img_size = '640x480'; var z1img_win = 'http://www.restaurantecruzdemalta.com.br/MostraImagem/'; var z1img_siz_w = 790; var z1img_siz_h = 550; var z1pup_url = 'http://www.restaurantecruzdemalta.com.br/inicio.php?do=sendamigo&'; var default_fontsize = 10; var current_fontsize = default_fontsize; var url_fontsize = 'http://www.restaurantecruzdemalta.com.br/inicio.php?do=updatefontsize&fontsize='; var url_ajax = 'http://www.restaurantecruzdemalta.com.br/inicio.php?do='; var z1Alert_html = '

{TITLE}

{ICO}
{CONTENT}
 
'; loadNewCSS('js/z1alert.css'); 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 AbreLocalizacao(uri) { var siz_w = (parseInt(z1img_siz_w) + 50); var siz_h = z1img_siz_h; var win = abreJanela(uri, 'LOCALIZACAO', 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(); } var showEnviaAmigo_content = ''; function showEnviaAmigo () { $('html,body').animate({'scrollTop': '0'}, 300); if(showEnviaAmigo_content == '') { showEnviaAmigo_content = $('.EnviaAmigo:first').html(); $('.EnviaAmigo:first').html(''); } var htmlTag = document.createElement("div"); htmlTag.setAttribute('id', 'EnviaAmigo'); htmlTag.setAttribute('class', 'EnviaAmigo window'); htmlTag.style.display = 'none'; htmlTag.innerHTML = showEnviaAmigo_content; document.getElementsByTagName("body").item(0).appendChild(htmlTag); 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'; } try { $BindAll(); } catch(err) { } } 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 == '') { z1Alert("Voce deve preencher todos os campos, exceto o campo \"Mensagem\" que é 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') { z1Alert("Página enviada para seu amigo com sucesso, preencha o formulário 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 { z1Alert(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; } /* FRONT-END */ /* Produtos = { ajax : new Ajax(), Voltar : function () { try { this.loading(); this.ajax.get('/Ajax/do=produtos&direction=left&reference=' + getE('ProdutosReferenceArea').innerHTML ); } catch(err) { } }, Avancar : function () { try { this.loading(); this.ajax.get('/Ajax/do=produtos&direction=right&reference=' + getE('ProdutosReferenceArea').innerHTML ); } catch(err) { } }, loading : function () { getE('ProdutosLoadingArea').style.display = ''; getE('ProdutosArea').style.display = 'none'; getE('ProdutosBotaoVoltar').style.display = 'none'; getE('ProdutosBotaoAvancar').style.display = 'none'; }, loaded : function () { getE('ProdutosLoadingArea').style.display = 'none'; getE('ProdutosArea').style.display = ''; fadeIn(getE('ProdutosArea'), 0); getE('ProdutosBotaoVoltar').style.display = ''; getE('ProdutosBotaoAvancar').style.display = ''; } } Produtos.ajax.embed_js = false; Produtos.ajax.onload = function (response) { getE('ProdutosArea').innerHTML = response; Produtos.loaded(); }*/ Galeria = { ajax : new Ajax(), direction : 'left', Voltar : function () { this.loading(); this.direction = 'left'; this.ajax.get('/Ajax/do=galeria&direction=left&reference=' + getE('GaleriaReferenceArea').innerHTML ); }, Avancar : function () { this.loading(); this.direction = 'right'; this.ajax.get('/Ajax/do=galeria&direction=right&reference=' + getE('GaleriaReferenceArea').innerHTML ); }, loading : function () { getE('GaleriaLoadingArea').style.display = ''; getE('GaleriaBotaoVoltar').style.display = 'none'; getE('GaleriaBotaoAvancar').style.display = 'none'; }, loaded : function () { getE('GaleriaLoadingArea').style.display = 'none'; move_smooth_horizontal_onload = function () { getE('GaleriaBotaoVoltar').style.display = ''; getE('GaleriaBotaoAvancar').style.display = ''; getE('GaleriaArea').innerHTML = getE('GaleriaAjaxAreaL').innerHTML; getE('GaleriaScrollArea').style.left = '-482px'; }; if(this.direction == 'left') { move_smooth_horizontal(getE('GaleriaScrollArea'), -229, -458); } else { move_smooth_horizontal(getE('GaleriaScrollArea'), -229, 0); } } } Galeria.ajax.onload = function (response) { getE('GaleriaAjaxAreaL').innerHTML = response; getE('GaleriaAjaxAreaR').innerHTML = response; Galeria.loaded(); } Calendario = { ready_to_load : true, response : null, ajax : new Ajax(), Voltar : function (uri) { try { this.loading(); this.ajax.get(uri); } catch(err) { } }, Avancar : function (uri) { try { this.loading(); this.ajax.get(uri); } catch(err) { } }, loading : function () { this.ready_to_load = false; $('#CalendarioHolder .CalendarioSetas a').css({ visibility : 'hidden' }); $('#CalendarioHolder').css({ opacity : '1' }); $('#CalendarioHolder').animate({ opacity : '0' }, 400, 'linear', function () { $('#CalendarioCarregando').css({ display: '' }); Calendario.ready_to_load = true; } ); }, loaded : function () { if(!this.ready_to_load) { setTimeout( function () { Calendario.loaded(); }, 50); return; } getE('CalendarioHolder').innerHTML = Calendario.response; $('#CalendarioCarregando').css({ display:'none' }); $('#CalendarioHolder').css({ opacity : '0'}); $('#CalendarioHolder').animate({ opacity : '1'}, 400 ); setTimeout( function () { $('#CalendarioHolder .CalendarioSetas a').css({ visibility : 'visible' }); Calendario.fix(); }, 400); }, fix : function () { $('#CalendarioEventos').css('height', ( getElHeight(getE('CalendarioInner')) - getElHeight(getE('CalendarioPrint')) ) + 'px' ); } } Calendario.ajax.onload = function (response) { Calendario.response = response; Calendario.loaded(); } Produtos = { ajax : new Ajax(), direction : 'left', pp : 4 , cid : 0, Voltar : function () { this.loading(); this.direction = 'left'; this.ajax.get(this.geturi() + '&T=' + (parseInt(getE('InnerCardapio_T').innerHTML) - this.pp ) ); }, Avancar : function () { this.loading(); this.direction = 'right'; this.ajax.get(this.geturi() + '&T=' + (parseInt(getE('InnerCardapio_T').innerHTML) + this.pp ) ); }, Go : function (id_cid) { this.loading(); this.direction = ''; this.cid = id_cid; this.ajax.get(this.geturi() + '&T=0' ); }, geturi : function () { var uri = '/Ajax/do=produtos'; if(this.cid > 0) { uri += '&cid=' + this.cid; } return uri; }, loading : function () { getE('CardapioLoadingArea').style.display = ''; getE('CardapioBotaoVoltar').style.display = 'none'; getE('CardapioBotaoAvancar').style.display = 'none'; }, loaded : function () { getE('CardapioLoadingArea').style.display = 'none'; if(this.direction == 'right') { $('#CardapioScrollArea').animate({ marginLeft : '-1720px'}, 800, 'linear', function () { getE('AreaCardapio').innerHTML = getE('CardapioAjaxAreaL').innerHTML; $('#CardapioScrollArea').css({ marginLeft : '-860px'}); }); } else if(this.direction == 'left') { $('#CardapioScrollArea').animate({ marginLeft : '0'}, 800, 'linear', function () { getE('AreaCardapio').innerHTML = getE('CardapioAjaxAreaL').innerHTML; $('#CardapioScrollArea').css({ marginLeft : '-860px'}); }); } else { $('#CardapioScrollArea').animate({ opacity : '0'}, 400, 'linear', function () { getE('AreaCardapio').innerHTML = getE('CardapioAjaxAreaL').innerHTML; $('#CardapioScrollArea').animate({ opacity : '1'}); }); } } } Produtos.ajax.embed_js = true; Produtos.ajax.onload = function (response) { getE('CardapioAjaxAreaL').innerHTML = response; getE('CardapioAjaxAreaR').innerHTML = response; Produtos.loaded(); } ProdutosLeft = { ajax : new Ajax(), direction : 'up', pp : 3 , cid : 0, Up : function () { this.loading(); this.direction = 'up'; this.ajax.get(this.geturi() + '&T=' + (parseInt(getE('Inner_T').innerHTML) - this.pp ) ); }, Down : function () { this.loading(); this.direction = 'down'; this.ajax.get(this.geturi() + '&T=' + (parseInt(getE('Inner_T').innerHTML) + this.pp ) ); }, Go : function (id_cid) { this.loading(); this.direction = ''; this.cid = id_cid; this.ajax.get(this.geturi() + '&T=0' ); }, geturi : function () { var uri = '/Ajax/do=produtosleft'; if(this.cid > 0) { uri += '&cid = ' + this.cid; } return uri; }, loading : function () { getE('LoadingArea').style.display = ''; getE('BtUp').style.display = 'none'; getE('BtDown').style.display = 'none'; }, loaded : function () { getE('LoadingArea').style.display = 'none'; if(this.direction == 'down') { $('#ScrollArea').animate({ marginTop : '-1480px'}, 800, 'linear', function () { getE('Area').innerHTML = getE('AjaxAreaL').innerHTML; $('#ScrollArea').css({ marginTop : '-740px'}); }); } else if(this.direction == 'up') { $('#ScrollArea').animate({ marginTop : '0'}, 800, 'linear', function () { getE('Area').innerHTML = getE('AjaxAreaL').innerHTML; $('#ScrollArea').css({ marginTop : '-740px'}); }); } } } ProdutosLeft.ajax.embed_js = true; ProdutosLeft.ajax.onload = function (response) { getE('AjaxAreaL').innerHTML = response; getE('AjaxAreaR').innerHTML = response; ProdutosLeft.loaded(); } var z1Alert_onclose = ''; var z1Alert_rm_tag; function z1Alert(txt) { try { z1Alert_onclose = arguments[1]; } catch(err) { } var htmlTag = document.createElement("div"); htmlTag.style.width = '100%'; htmlTag.style.height = '100%'; ray = document.getElementsByTagName("input"); for (i=0;i 20) { if(newX + getElWidth(obj) + 20 < win.w) { obj.style.left = newX + 'px'; } } if(newY > 20) { if(newY + getElHeight(obj) + 20 < win.h) { obj.style.top = newY + 'px'; } } } } } // função para parar o drag function undoDrag(ev, obj) { if(doDrag_restore) { enableTextSel(); } document.onmouseup = null; document.onmousemove = null; if(typeof(obj.onfinishdrag) == 'function') { obj.onfinishdrag(ev, obj); } }