function slideGalleryPhotos(n,t,i){var s=$("."+t+" .gallerySlider .slider .data").length,u=parseInt($(".hfGallerySliderPage"+i).val()),c=$("."+t+" .gallerySlider .slider .data").width(),l=parseInt($("."+t+" .gallerySlider .slider .data").css("marginRight")),o=c+l,a=$("."+t+" .gallerySlider .sliderContainer .center").width(),f=Math.round(a/o),v=f*u,h,r,e;n=="next"&&s>v&&(e=o*f*u,$("."+t+" .gallerySlider .slider .itemContainer").animate({marginLeft:-e},300),r=u+1,$(".hfGallerySliderPage"+i).val(r),$("."+t+" .gallerySlider .sliderContainer .left").fadeTo(0,1),h=f*r,s<=h&&$("."+t+" .gallerySlider .sliderContainer .right").fadeTo(0,.4)),n=="prev"&&u>1&&(r=u-1,$(".hfGallerySliderPage"+i).val(r),e=o*f*(r-1),$("."+t+" .gallerySlider .slider .itemContainer").animate({marginLeft:-e},300),$("."+t+" .gallerySlider .sliderContainer .right").fadeTo(0,1),r==1&&$("."+t+" .gallerySlider .sliderContainer .left").fadeTo(0,.4))}function SlidePhoto(n,t,i){var r=$("."+t+" .hfCurrentPhotoPosition"+i).val(),u,f;n=="next"?(u=parseInt(r)+1,ShowPhoto(u,t,i)):n=="prev"&&(f=parseInt(r)-1,ShowPhoto(f,t,i))}function ShowPhoto(n,t,r){var a=$("."+t+" .gallerySlider .slider .data").length,e,s,h,o,c;if(parseInt(n)>0&&parseInt(n)<=a&&(e=$("."+t+" .hfCurrentPhotoPosition"+r).val(),n!=e)){for(s="."+t+" .photo"+e,h="."+t+" .photo"+n,$(s).fadeOut("fast",function(){$(h).fadeIn("fast")}),$("."+t+" .hfCurrentPhotoPosition"+r).val(n),$("."+t+" .gallerySlider .slider .data").removeClass("current").fadeTo(0,.4),o=$("."+t+" .gallerySlider .slider .data"),i=0;i<o.length;i++)c=i+1,c==n&&$(o[i]).addClass("current").fadeTo(0,1);var u=parseInt($("."+t+" .hfGallerySliderPage"+r).val()),v=$("."+t+" .gallerySlider .slider .data").width(),y=parseInt($("."+t+" .gallerySlider .slider .data").css("marginRight")),p=v+y,w=$("."+t+" .gallerySlider .sliderContainer .center").width(),l=Math.round(w/p),b=l*u,f=Math.ceil(parseInt(n)/parseInt(l));if(f!=u)if(f>u)while(f>u)slideGalleryPhotos("next",t,r),u++;else if(f<u)while(f<u)slideGalleryPhotos("prev",t,r),u=u-1}ga("send","pageview",location.pathname)}function ContainerHover(n,t){var i=$("."+n+" .gallerySlider .slider .data").length,r=$(".hfCurrentPhotoPosition"+t).val();parseInt(r)>1&&parseInt(i)>1&&$("."+n+" .photo .container .advanceLeft").show(),parseInt(r)<i&&$("."+n+" .photo .container .advanceRight").show()}function ContainerHoverOut(){$(".photo .container .advanceRight").hide(),$(".photo .container .advanceLeft").hide()}$(document).ready(function(){var u,n,r,t;if($(".gallery .gallerySlider .slider").length>0){for($(".gallery .gallerySlider .sliderContainer .left").fadeTo(0,.4).show(),$(".gallery .gallerySlider .sliderContainer .right").show(),n=$(".gallery .gallerySlider .slider .data"),i=0;i<n.length;i++)i==0?$(n[i]).addClass("current"):$(n[i]).fadeTo(0,.4);$(".gallery .gallerySlider .slider .data").mouseover(function(){$(this).fadeTo(0,1)}),$(".gallery .gallerySlider .slider .data").mouseout(function(){$(this).hasClass("current")||$(this).fadeTo(0,.4)}),r=$(".gallery .photo .container").height(),t=(r-24)/2,$(".gallery .photo .container .advanceLeft").css({top:t}),$(".gallery .photo .container .advanceRight").css({top:t})}if($(".article .articleGallery .gallerySlider .slider").length>0){for($(".article .articleGallery .gallerySlider .sliderContainer .left").fadeTo(0,.4).show(),$(".article .articleGallery .gallerySlider .sliderContainer .right").show(),u=$(".article .articleGallery"),g=0;g<u.length;g++)for(n=$(u[g]).find(".gallerySlider .slider .data"),i=0;i<n.length;i++)i==0?$(n[i]).addClass("current"):$(n[i]).fadeTo(0,.4);$(".articleGallery .gallerySlider .slider .data").mouseover(function(){$(this).fadeTo(0,1)}),$(".articleGallery .gallerySlider .slider .data").mouseout(function(){$(this).hasClass("current")||$(this).fadeTo(0,.4)}),r=$(".articleGallery .photo .container").height(),t=(r-24)/2,$(".articleGallery .photo .container .advanceLeft").css({top:t}),$(".articleGallery .photo .container .advanceRight").css({top:t})}})