// Minified using Javascript Aggregator - see /sites/default/files/js/js_9034658b21379b1d46b15d024ab0c94e.js for original source including licensing information.

(function($){var change,initialize,reInitialize;change=function(){var newOffset,$pages,pushWidth,maxWidth,currentOffset,diff,wideWith,$this=$(this),$parent=$this.parent(),width=false;if($this.parent('.page').get(0)){$parent=$parent.parent();$pages=$parent.children();$parent=$parent.parent();width=$parent.parent().outerWidth();pushWidth=$parent.children(':first').outerWidth();maxWidth=Math.max(pushWidth,width);newOffset=0-$pages.index($this.parent())*maxWidth;}
if(width===false){width=$parent.parent().outerWidth();pushWidth=$parent.children(':first').outerWidth();maxWidth=Math.max(pushWidth,width);}
currentOffset=parseInt($parent.css('margin-left'),10);wideWith=$parent.width();if($this.hasClass('previous')){if(currentOffset%pushWidth<0){newOffset=currentOffset-currentOffset%pushWidth;}else{newOffset=Math.min(0,currentOffset+maxWidth);diff=newOffset%pushWidth;if(diff){newOffset-=pushWidth+diff;}}}else if($this.hasClass('next')){newOffset=currentOffset-maxWidth;}
newOffset-=newOffset%pushWidth;if(newOffset>0){newOffset=0;}else if(newOffset<width-wideWith){if(width-wideWith-newOffset>pushWidth/3){newOffset=0;}
else{newOffset=width-wideWith;}}
if(currentOffset!==newOffset||$parent.is(':animated')){$parent.children('.pager').children().removeClass('active').eq(Math.round((0-newOffset)/maxWidth)).addClass('active');if($('html').hasClass('csstransitions')){$parent.css('margin-left',newOffset);}else{$parent.stop(true).animate({'marginLeft':newOffset},200);}}
return false;};initialize=function(options){var $children,i,length,width,$pager,$page,containerWidth,maxWidth,next,autoNext,$this=$(this);$children=$this.children();length=$children.length;$children.css('float','left');width=$children.outerWidth();$this.width(length*width).css('margin-left',0);$('<a />').attr('href','#').text(options.prevText).addClass('previous').appendTo($this).click(change);next=$('<a />').attr('href','#').text(options.nextText).addClass('next').appendTo($this).click(change);containerWidth=$this.parent().outerWidth();maxWidth=Math.max(width,containerWidth);length=Math.round(length*width/maxWidth);if(length>1){$pager=$('<ul />').addClass('pager');$page=$('<li />').addClass('page').append($('<a />').attr('href','#'));for(i=0;i<length;i+=1){$page.clone().children('a').text(i+1).click(change).end().appendTo($pager);}
$pager.children(':first').addClass('active');$pager.appendTo($this);}
autoNext=function(){next.click();clearTimeout($this.data('autoNext'));$this.data('autoNext',setTimeout(autoNext,4000));};$this.hover(function(){clearTimeout($this.data('autoNext'));},function(){clearTimeout($this.data('autoNext'));$this.data('autoNext',setTimeout(autoNext,4000));});$this.data('autoNext',setTimeout(autoNext,4000));};reInitialize=function(options){$(this).unbind('mouseover').unbind('mouseout').children('a.previous, a.next, ul.pager').remove();initialize.call(this,options);};$.fn.goSlider=function(options){options=$.extend({},$.fn.goSlider.defaults,options);return this.each(function(){var timer,that=this;initialize.call(that,options);$(window).resize(function(){if(timer){clearTimeout(timer);}
timer=setTimeout(function(){reInitialize.call(that,options);},400);});});};$.fn.goSlider.defaults={prevText:'Previous',nextText:'Next'};}(jQuery));;
