var uptext,downText;function subir(c){var b=parseInt($("#"+c).css("top"))+2;b<0&&$("#"+c).css("top",b+"px")}function bajar(c){var b=$("#"+c).height(),d=parseInt($("#"+c).css("top"))-2,b=parseInt(b-144);b-=b*2;d>b&&$("#"+c).css("top",d+"px")}function leftSlide(c){var b=parseInt($("#"+c).css("left"))-2,d=0-parseInt($("#"+c).css("width"))+475;b>d&&$("#"+c).css("left",b+"px")}function rightSlide(c){var b=parseInt($("#"+c).css("left"))+2;b<2&&$("#"+c).css("left",b+"px")} $(document).ready(function(){$(".upArrow").mouseover(function(){var a=$(this).attr("noticia");upText=setInterval("subir('"+a+"')",20)});$(".upArrow").mouseout(function(){clearInterval(upText)});$(".downArrow").mouseover(function(){var a=$(this).attr("noticia");downText=setInterval("bajar('"+a+"')",20)});$(".downArrow").mouseout(function(){clearInterval(downText)});$(".leftArrow").mouseover(function(){var a=$(this).attr("galeria");derecha=setInterval("rightSlide('"+a+"')",1)});$(".leftArrow").mouseout(function(){clearInterval(derecha)}); $(".rightArrow").mouseover(function(){var a=$(this).attr("galeria");izquierda=setInterval("leftSlide('"+a+"')",1)});$(".rightArrow").mouseout(function(){clearInterval(izquierda)});var c,b,d;$(".imagenGaleria").click(function(){var a=$(this).attr("id").split("-"),f=a[1],a=parseInt(a[2]);siguiente=a+1;anterior=a-1;var g=$(this).attr("image"),j=parseInt($(this).attr("total")-1);img=new Image;img.src="galerias/"+g;var e=img.width,h=img.height,k=0-e/2,i=h/2-50;$("#bigImage").css("width",e+"px");$("#bigImage").css("height", h+"px");$("#bigImage").css("margin-left",k+"px");$("#rightArrowZoom").css("left",e-50+"px");$("#rightArrowZoom").css("top",i+"px");$("#leftArrowZoom").css("top",i+"px");a!=0&&$("#leftArrowZoom").css("display","block");a==j?d=!0:(d=!1,$("#rightArrowZoom").css("display","block"));c="galeria-"+f+"-"+siguiente;b="galeria-"+f+"-"+anterior;$("#bigImage").css("background-image","url(galerias/"+g+")");$("#lights").fadeIn("normal");$("#bigImage").fadeIn("slow")});$("#rightArrowZoom").click(function(){if(d== !1){var a=$("#"+c).attr("id").split("-"),f=a[1],a=parseInt(a[2]),g=$("#"+c).attr("image"),j=parseInt($("#"+c).attr("total")-1);img=new Image;img.src="galerias/"+g;var e=img.width,h=img.height,k=0-e/2,i=h/2-50;$("#bigImage").fadeOut("fast",function(){$("#bigImage").css("width",e+"px");$("#bigImage").css("height",h+"px");$("#bigImage").css("margin-left",k+"px");a==0?$("#leftArrowZoom").css("display","none"):$("#leftArrowZoom").css("display","block");a==j?d=!0:(d=!1,$("#rightArrowZoom").css("display", "block"));$("#rightArrowZoom").css("left",e-50+"px");$("#rightArrowZoom").css("top",i+"px");var l=a-1;c="galeria-"+f+"-"+(a+1);b="galeria-"+f+"-"+l;$("#leftArrowZoom").css("top",i+"px");$("#bigImage").css("background-image","url(galerias/"+g+")");$("#lights").fadeIn("normal");$("#bigImage").fadeIn("slow")})}});$("#leftArrowZoom").click(function(){var a=b.split("-"),f=a[1],a=parseInt(a[2]);if(a>=0){var a=$("#"+b).attr("id").split("-"),f=a[1],a=parseInt(a[2]),g=$("#"+b).attr("image"),j=parseInt($("#"+ b).attr("total")-1);img=new Image;img.src="galerias/"+g;var e=img.width,h=img.height,k=0-e/2,i=h/2-50;$("#bigImage").fadeOut("fast",function(){$("#bigImage").css("width",e+"px");$("#bigImage").css("height",h+"px");$("#bigImage").css("margin-left",k+"px");$("#leftArrowZoom").css("top",i+"px");$("#rightArrowZoom").css("left",e-50+"px");$("#rightArrowZoom").css("top",i+"px");a!=0&&$("#leftArrowZoom").css("display","block");a==j?d=!0:(d=!1,$("#rightArrowZoom").css("display","block"));var l=a-1;c="galeria-"+ f+"-"+(a+1);b="galeria-"+f+"-"+l;$("#bigImage").css("background-image","url(galerias/"+g+")");$("#bigImage").fadeIn("slow")})}});$("#cerrarImagen").click(function(){});$("#cerrarImagen").click(function(){$("#bigImage").fadeOut("slow",function(){$("#leftArrowZoom").fadeOut("fast");$("#rightArrowZoom").fadeOut("fast");$("#lights").fadeOut("fast")})});$(document).keypress(function(a){if(window.event)keyCode=window.event.keyCode;else if(a)keyCode=a.which;keyCode==0&&$("#lights").css("display")!="none"&& $("#bigImage").fadeOut("slow",function(){$("#lights").fadeOut("fast")})});$("#leftArrowZoom").mouseover(function(){$("#leftArrowZoom").css("background-image","url(imagens/leftArrow2.png)")});$("#leftArrowZoom").mouseout(function(){$("#leftArrowZoom").css("background-image","url(imagens/leftArrow.png)")});$("#rightArrowZoom").mouseover(function(){$("#rightArrowZoom").css("background-image","url(imagens/rightArrow2.png)")});$("#rightArrowZoom").mouseout(function(){$("#rightArrowZoom").css("background-image", "url(imagens/rightArrow.png)")})});

