/**
 * Simple Image Slider built for Christina Szczupak Photography
 * Copyright Christina Szczupak Photography. All rights reserved.
 *
 * @author Matt Bango <http://mattbango.com>
 */
 var ImageSlider={current:1,currentWedding:"steph-and-sam",total:0,height:548,width:860,speed:500,offset:0,imageContainer:".imagesContainer",prevControl:".prev",nextControl:".next",baseControlOpacity:0.6,init:function(a,d){var b=this;this.total=a;this.currentWedding=d;$(this.imageContainer).css({width:this.total*this.width});this.current!==1&&$(this.prevControl).show();$(this.prevControl).click(function(c){c.preventDefault();b.animate("prev")}).mouseenter(function(){$(this).stop().animate({opacity:1},
 200)}).mouseleave(function(){$(this).stop().animate({opacity:b.baseControlOpacity},200)});$(this.nextControl).click(function(c){c.preventDefault();b.animate("next")}).mouseenter(function(){$(this).stop().animate({opacity:1},200)}).mouseleave(function(){$(this).stop().animate({opacity:b.baseControlOpacity},200)})},initMobileActions:function(a){var d=this;$(this.imageContainer).css({width:this.total*this.width});$(a).swipe(function(b,c){b.preventDefault();c.direction==="left"?d.animate("next"):d.animate("prev")})},
 animate:function(a){this.current=a==="next"?this.current+1:this.current-1;if(this.current===this.total)$(this.nextControl).fadeOut(this.speed);else $(this.nextControl).css("display")==="none"&&$(this.nextControl).stop().fadeIn(this.speed);if(this.current===1)$(this.prevControl).fadeOut(this.speed);else $(this.prevControl).css("display")==="none"&&$(this.prevControl).stop().fadeIn(this.speed);a=(this.current-1)*this.width;$(this.imageContainer).stop().animate({left:-a},this.speed);typeof window.history.pushState==
 "function"&&this.updateHistory()},updateHistory:function(){var a=this.padNumber(this.current);window.history.pushState({},"Image "+a,"/weddings/"+this.currentWedding+"/"+a)},padNumber:function(a){return(a<10?"0":"")+a}};

