/* 
* FitText.js 1.0 (min-font-size) - https://github.com/davatron5000/FitText.js/tree/min-font-size
* jQuery Blueberry Slider v0.1 BETA - http://marktyrrell.com/labs/blueberry/
* jSwipe - http://plugins.jquery.com/project/swipe - http://www.ryanscherf.com/demos/swipe/
*
*/
(function($){$.fn.fitText=function(kompressor,minSize){return this.each(function(){var $this=$(this);var maxFontSize=parseFloat($this.css('font-size'));var minFontSize=parseFloat(minSize)||0;var compressor=kompressor||1;var resizer=function(){$this.css('font-size',Math.max(Math.min($this.width()/(compressor*10),maxFontSize),minFontSize));};resizer();$(window).resize(resizer);});};})(jQuery);;(function($){$.fn.extend({blueberry:function(options){var defaults={interval:5000,duration:500,lineheight:1,hoverpause:false}
var options=$.extend(defaults,options);return this.each(function(){var o=options;var obj=$(this);var slides=$('.slides li',obj);var pager=$('.pager li',obj);var current=0;var next=current+1;var imgHeight=slides.eq(current).find('img').height();var imgWidth=slides.eq(current).find('img').width();var imgRatio=imgWidth/imgHeight;var sliderWidth=0;var cropHeight=0;slides.hide().eq(current).fadeIn(o.duration).addClass('active');pager.eq(current).addClass('active');rotate=function(){slides.eq(current).fadeOut(o.duration).removeClass('active').end().eq(next).fadeIn(o.duration).addClass('active').queue(function(){rotateTimer();$(this).dequeue()});pager.eq(current).removeClass('active').end().eq(next).addClass('active');current=next;next=current>=slides.length-1?0:current+1;};rotateTimer=function(){play=setTimeout(function(){rotate();},o.interval);};rotateTimer();if(o.hoverpause){slides.hover(function(){clearTimeout(play);},function(){rotateTimer();});}
$('a',pager).click(function(){clearTimeout(play);next=$(this).parent().index();rotate();return false;});setsize=function(){sliderWidth=$('.slides',obj).width();cropHeight=Math.floor(((sliderWidth/imgRatio)/o.lineheight))*o.lineheight;$('.slides',obj).css({height:cropHeight});};setsize();$(window).resize(function(){setsize();});});}});})(jQuery);;(function($){$.fn.swipe=function(options){var defaults={threshold:{x:30,y:10},swipeLeft:function(){alert('swiped left')},swipeRight:function(){alert('swiped right')}};var options=$.extend(defaults,options);if(!this)return false;return this.each(function(){var me=$(this)
var originalCoord={x:0,y:0}
var finalCoord={x:0,y:0}
function touchStart(event){originalCoord.x=event.targetTouches[0].pageX
originalCoord.y=event.targetTouches[0].pageY}
function touchMove(event){finalCoord.x=event.targetTouches[0].pageX
finalCoord.y=event.targetTouches[0].pageY}
function touchEnd(event){var changeY=originalCoord.y-finalCoord.y
if(changeY<defaults.threshold.y&&changeY>(defaults.threshold.y*-1)){changeX=originalCoord.x-finalCoord.x
if(changeX>defaults.threshold.x){defaults.swipeLeft()}
if(changeX<(defaults.threshold.x*-1)){defaults.swipeRight()}}}
function touchStart(event){originalCoord.x=event.targetTouches[0].pageX
originalCoord.y=event.targetTouches[0].pageY
finalCoord.x=originalCoord.x
finalCoord.y=originalCoord.y}
function touchCancel(event){}
this.addEventListener("touchstart",touchStart,false);this.addEventListener("touchmove",touchMove,false);this.addEventListener("touchend",touchEnd,false);this.addEventListener("touchcancel",touchCancel,false);});};})(jQuery);
