function testes(){if(pagina==1){$("#zoomesq").hide();$("#zoomdir").show();$(".b-counter").hide()}else if(pagina>maxpaginas){$("#zoomesq").show();$("#zoomdir").hide();$(".b-counter").hide()}else{$("#zoomesq").show();$("#zoomdir").show();$(".b-counter").show()}}function salta(){$.scrollTo("700px","slow")}function acima(){$.scrollTo("0px","slow")}function pag_revista(e){location.hash="#/page/"+e+"/";getpagina();setpagina();testes()}function getpagina(){if(location.hash.indexOf("#/page/")!=-1);pagina=parseInt(location.hash.substring(7))}function setpagina(){if(pagina>1)$.post("revistapag/"+revista_actual+"/"+(pagina-1)+"/");if(pagina<maxpaginas)$.post("revistapag/"+revista_actual+"/"+pagina+"/")}function zoom(e,t){$.fancybox({opacity:true,margin:0,padding:0,scrolling:"no",autoScale:true,autoDimensions:true,showCloseButton:false,overlayColor:"#000000",href:"zoom.php?r="+e+"&p="+t})}function print_popup(e){$.fancybox({opacity:true,margin:0,padding:0,scrolling:"no",autoScale:true,autoDimensions:true,showCloseButton:false,overlayColor:"#000000",href:"print.php?r="+e})}function popup(e){$.fancybox({opacity:true,margin:0,padding:0,scrolling:"no",autoScale:true,autoDimensions:true,showCloseButton:false,overlayColor:"#000000",href:e+".php"})}$(function(){function e(){$("#loading").hide();$("#book").show();if(vai){$.scrollTo("700px","slow")}}vai=0;home=0;$("#book").hide();$("#book").booklet({width:936,height:590,arrows:true,hash:true,pagePadding:0,closed:true,manual:false,overlays:false,shadows:true,hovers:false,pageNumbers:true,after:e()});$(".b-arrow").click(function(){getpagina();setpagina();testes()});$("#apag_num").click(function(e){e.preventDefault();var t=parseInt($("#numero_da_pagina").val());if(t>0){location.href="#/pag/"+t+"/"}});$("#azoomdir").click(function(e){e.preventDefault();getpagina();zoom(revista_actual,pagina)});$("#azoomesq").click(function(e){e.preventDefault();getpagina();zoom(revista_actual,pagina-1)});getpagina();setpagina();testes()})