/*
 * jQuery Easing v1.3 - http://gsgd.co.uk/sandbox/jquery/easing/
 *
 * Uses the built in easing capabilities added In jQuery 1.1
 * to offer multiple easing options
 *
 * TERMS OF USE - jQuery Easing
 * 
 * Open source under the BSD License. 
 * 
 * Copyright © 2008 George McGinley Smith
 * All rights reserved.
 * 
 * Redistribution and use in source and binary forms, with or without modification, 
 * are permitted provided that the following conditions are met:
 * 
 * Redistributions of source code must retain the above copyright notice, this list of 
 * conditions and the following disclaimer.
 * Redistributions in binary form must reproduce the above copyright notice, this list 
 * of conditions and the following disclaimer in the documentation and/or other materials 
 * provided with the distribution.
 * 
 * Neither the name of the author nor the names of contributors may be used to endorse 
 * or promote products derived from this software without specific prior written permission.
 * 
 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY 
 * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
 * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
 *  COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
 *  EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
 *  GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED 
 * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
 *  NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED 
 * OF THE POSSIBILITY OF SUCH DAMAGE. 
 *
*/

jQuery.easing.jswing=jQuery.easing.swing;
jQuery.extend(jQuery.easing,{def:"easeOutQuad",swing:function(e,a,c,b,d){return jQuery.easing[jQuery.easing.def](e,a,c,b,d)},easeInQuad:function(e,a,c,b,d){return b*(a/=d)*a+c},easeOutQuad:function(e,a,c,b,d){return-b*(a/=d)*(a-2)+c},easeInOutQuad:function(e,a,c,b,d){return(a/=d/2)<1?b/2*a*a+c:-b/2*(--a*(a-2)-1)+c},easeInCubic:function(e,a,c,b,d){return b*(a/=d)*a*a+c},easeOutCubic:function(e,a,c,b,d){return b*((a=a/d-1)*a*a+1)+c},easeInOutCubic:function(e,a,c,b,d){return(a/=d/2)<1?b/2*a*a*a+c:b/2*((a-=2)*a*a+2)+c},easeInQuart:function(e,a,c,b,d){return b*(a/=d)*a*a*a+c},easeOutQuart:function(e,a,c,b,d){return-b*((a=a/d-1)*a*a*a-1)+c},easeInOutQuart:function(e,a,c,b,d){return(a/=d/2)<1?b/2*a*a*a*a+c:-b/2*((a-=2)*a*a*a-2)+c},easeInQuint:function(e,a,c,b,d){return b*(a/=d)*a*a*a*a+c},easeOutQuint:function(e,a,c,b,d){return b*((a=a/d-1)*a*a*a*a+1)+c},easeInOutQuint:function(e,a,c,b,d){return(a/=d/2)<1?b/2*a*a*a*a*a+c:b/2*((a-=2)*a*a*a*a+2)+c},easeInSine:function(e,a,c,b,d){return-b*Math.cos(a/d*(Math.PI/2))+b+c},easeOutSine:function(e,a,c,b,d){return b*Math.sin(a/d*(Math.PI/2))+c},easeInOutSine:function(e,a,c,b,d){return-b/2*(Math.cos(Math.PI*a/d)-1)+c},easeInExpo:function(e,a,c,b,d){return a==0?c:b*Math.pow(2,10*(a/d-1))+c},easeOutExpo:function(e,a,c,b,d){return a==d?c+b:b*(-Math.pow(2,-10*a/d)+1)+c},easeInOutExpo:function(e,a,c,b,d){return a==0?c:a==d?c+b:(a/=d/2)<1?b/2*Math.pow(2,10*(a-1))+c:b/2*(-Math.pow(2,-10*--a)+2)+c},easeInCirc:function(e,a,c,b,d){return-b*(Math.sqrt(1-(a/=d)*a)-1)+c},easeOutCirc:function(e,a,c,b,d){return b*Math.sqrt(1-(a=a/d-1)*a)+c},easeInOutCirc:function(e,a,c,b,d){return(a/=d/2)<1?-b/2*(Math.sqrt(1-a*a)-1)+c:b/2*(Math.sqrt(1-(a-=2)*a)+1)+c},easeInElastic:function(e,a,c,b,d){var e=1.70158,f=0,g=b;if(a==0)return c;if((a/=d)==1)return c+b;f||(f=d*0.3);g<Math.abs(b)?(g=b,e=f/4):e=f/(2*Math.PI)*Math.asin(b/g);return-(g*Math.pow(2,10*(a-=1))*Math.sin((a*d-e)*2*Math.PI/f))+c},easeOutElastic:function(e,a,c,b,d){var e=1.70158,f=0,g=b;if(a==0)return c;if((a/=d)==1)return c+b;f||(f=d*0.3);g<Math.abs(b)?(g=b,e=f/4):e=f/(2*Math.PI)*Math.asin(b/g);return g*Math.pow(2,-10*a)*Math.sin((a*d-e)*2*Math.PI/f)+b+c},easeInOutElastic:function(e,a,c,b,d){var e=1.70158,f=0,g=b;if(a==0)return c;if((a/=d/2)==2)return c+b;f||(f=d*0.3*1.5);g<Math.abs(b)?(g=b,e=f/4):e=f/(2*Math.PI)*Math.asin(b/g);return a<1?-0.5*g*Math.pow(2,10*(a-=1))*Math.sin((a*d-e)*2*Math.PI/f)+c:g*Math.pow(2,-10*(a-=1))*Math.sin((a*d-e)*2*Math.PI/f)*0.5+b+c},easeInBack:function(e,a,c,b,d,f){f==void 0&&(f=1.70158);return b*(a/=d)*a*((f+1)*a-f)+c},easeOutBack:function(e,a,c,b,d,f){f==void 0&&(f=1.70158);return b*((a=a/d-1)*a*((f+1)*a+f)+1)+c},easeInOutBack:function(e,a,c,b,d,f){f==void 0&&(f=1.70158);return(a/=d/2)<1?b/2*a*a*(((f*=1.525)+1)*a-f)+c:b/2*((a-=2)*a*(((f*=1.525)+1)*a+f)+2)+c},easeInBounce:function(e,a,c,b,d){return b-jQuery.easing.easeOutBounce(e,d-a,0,b,d)+c},easeOutBounce:function(e,a,c,b,d){return(a/=d)<1/2.75?b*7.5625*a*a+c:a<2/2.75?b*(7.5625*(a-=1.5/2.75)*a+0.75)+c:a<2.5/2.75?b*(7.5625*(a-=2.25/2.75)*a+0.9375)+c:b*(7.5625*(a-=2.625/2.75)*a+0.984375)+c},easeInOutBounce:function(e,a,c,b,d){return a<d/2?jQuery.easing.easeInBounce(e,a*2,0,b,d)*0.5+c:jQuery.easing.easeOutBounce(e,a*2-d,0,b,d)*0.5+b*0.5+c}});

/*
 * jQuery Infinite Carousel
 * @author admin@catchmyfame.com - http://www.catchmyfame.com
 * @version 2.0.0
 * @date December 30, 2009
 * @category jQuery plugin
 * @copyright (c) 2009 admin@catchmyfame.com (www.catchmyfame.com)
 * @license CC Attribution-Share Alike 3.0 - http://creativecommons.org/licenses/by-sa/3.0/
 */
 (function(a){a.fn.extend({infiniteCarousel:function(s){s=a.extend({transitionSpeed:800,displayTime:6E3,textholderHeight:0.25,displayProgressBar:true,displayThumbnails:true,displayThumbnailNumbers:true,displayThumbnailBackground:true,thumbnailWidth:"20px",thumbnailHeight:"20px",thumbnailFontSize:".7em",easeLeft:"linear",easeRight:"linear",imagePath:"/js/infinitecarousel/images/",inView:1,padding:"0px",advance:1,showControls:true,autoHideControls:false,autoHideCaptions:false,autoStart:true,prevNextInternal:true,enableKeyboardNav:true,onSlideStart:function(){},onSlideEnd:function(){},onPauseClick:function(){}},s);return this.each(function(){function y(d){d=d==null?b.displayTime:d;a("#progress"+c).width("100%").height(5).hide().fadeIn();a("#progress"+c).animate({width:0},d)}function t(b,d){f&&(a("#minmax"+c+"_"+d).hide(),a("#close"+c+"_"+d).hide());b!=null&&(a("#textholder"+c+"_"+d+" span").html(b),a("#textholder"+c+"_"+d).stop().animate({marginBottom:"0px"},500),a("#minmax"+c+"_"+d).css("background-position","0 -8px"),z())}function z(){f||(a(".minmax",d).fadeIn(250),a(".close",d).fadeIn(250))}function u(){a(".textholder",d).stop().animate({marginBottom:-l*b.textholderHeight-j-1+"px"},500)}function A(){b.enableKeyboardNav&&a(document).keydown(function(b){b.keyCode==39&&(m("next"),a(document).unbind("keydown"));b.keyCode==37&&(m("prev"),a(document).unbind("keydown"));(b.keyCode==80||b.keyCode==111)&&v();if(b.keyCode==83||b.keyCode==115)r(),a(document).unbind("keydown")})}function m(d){b.onPauseClick.call(this);a("#btn_rt"+c).unbind("click");a("#btn_lt"+c).unbind("click");setTimeout(function(){a("#play_pause_btn"+c).css("background-position","0 -16px")},b.transitionSpeed-1);f=0;a("#progress"+c).stop().fadeOut();n="pause";clearTimeout(q);d=="prev"?B():o();a("#play_pause_btn"+c).unbind("click");setTimeout(function(){a("#play_pause_btn"+c).bind("click",function(){r()});a("#btn_rt"+c).bind("click",function(){m("next")});a("#btn_lt"+c).bind("click",function(){m("prev")})},b.transitionSpeed)}function v(){a("#play_pause_btn"+c).unbind("click");f&&(b.onPauseClick.call(this),a("#play_pause_btn"+c).fadeTo(250,0,function(){a(this).css({"background-position":"0 -16px",opacity:".5"})}).animate({opacity:0.5},250),f=0,z(),a("#progress"+c).stop().fadeOut(),clearTimeout(q),setTimeout(function(){a("#play_pause_btn"+c).bind("click",function(){r()})},b.transitionSpeed))}function r(){a("#play_pause_btn"+c).unbind("click");f||(setTimeout(function(){a("#play_pause_btn"+c).css("background-position","0 0")},b.transitionSpeed-1),f=1,o(),q=setInterval(function(){o()},b.displayTime+b.transitionSpeed),setTimeout(function(){a("#play_pause_btn"+c).bind("click",function(){v()})},b.transitionSpeed))}function C(){u();b.showControls&&b.prevNextInternal&&(a("#play_pause_btn"+c).fadeOut(200),a("#btn_lt"+c).fadeOut(200),a("#btn_rt"+c).fadeOut(200));if(b.displayThumbnails)for(i=1;i<=k;i++)a("#thumb"+c+"_"+i).css({"border-color":"#fff"}).animate({opacity:1},500)}function D(){b.showControls&&b.prevNextInternal&&(a("#play_pause_btn"+c).fadeIn(200),a("#btn_lt"+c).fadeIn(200),a("#btn_rt"+c).fadeIn(200));A();b.autoHideCaptions&&w&&E();if(b.displayThumbnails)for(i=0;i<e.length;i++)a("#thumb"+c+"_"+e[i]).css({"border-color":"#fff"}).animate({opacity:0.65},500);if(!b.autoHideCaptions)for(i=1;i<=b.inView;i++)t(a("li:eq("+i+") p",d).html(),i);b.displayThumbnails&&a("#thumbs"+c+" div").bind("click",F).css({cursor:"pointer"});ary=[];for(x=1;x<=b.inView;x++)ary.push(a("img:eq("+x+")",d).attr("src"));b.onSlideEnd.call(this,ary)}function o(c){if(c==null)c=b.advance;C();if(b.displayThumbnails)for(i=1;i<=c;i++)e.push(p.shift()),p.push(e.shift());b.displayTime==0&&clearInterval(q);a("li:lt("+c+")",d).clone(true).insertAfter(a("li:last",d));b.onSlideStart.call(this,e,"left");a("ul",d).animate({left:-g*(c+1)-parseInt(b.padding)*(c+1)*2},b.transitionSpeed,b.easeLeft,function(){a("li:lt("+c+")",d).remove();a(this).css({left:-g-parseInt(b.padding)*2});b.displayProgressBar&&f&&y();D();b.displayTime==0&&o()})}function B(c){if(c==null)c=b.advance;C();if(b.displayThumbnails)for(i=1;i<=c;i++)e.unshift(p.pop()),p.unshift(e.pop());a("li:gt("+(k-(c+1))+")",d).clone(true).insertBefore(a("li:first",d));b.onSlideStart.call(this,e,"right");a("ul",d).css("left",-(g*(c+1))-parseInt(b.padding)*(c+1)*2).animate({left:-g-parseInt(b.padding)*2},b.transitionSpeed,b.easeRight,function(){a("li:gt("+(k-1)+")",d).remove();D()})}var c=Math.round(Math.random()*1E8),b=s,d=a(this),f=b.autoStart,k=a("img",d).length,l=a("img:first",d).height(),g=a("img:first",d).width();if(b.inView>k-1)b.inView=k-1;a("p",d).hide();a(d).css({position:"relative",overflow:"hidden"}).width(g*b.inView+b.inView*parseInt(b.padding)*2).height(l+parseInt(b.padding)*2);a("ul",d).css({"list-style":"none",margin:"0",padding:"0",position:"relative"}).width(g*k);a("li",d).css({display:"inline","float":"left",padding:b.padding});a("li:last",d).prependTo(a("ul",d));a("ul",d).css("left",-g-parseInt(b.padding)*2+"px").width(9999);b.displayProgressBar&&(a(d).append('<div id="progress'+c+'" class="ic-progress-bar" style="position:absolute;bottom:0;background:#bbb;left:0;z-index:1"></div>'),a("#progress"+c).width("100%").height(5).css("opacity",".6"));var j=parseInt(a(d).css("border-bottom-width"))+parseInt(a(d).css("border-top-width"));isNaN(j)&&(j=0);var h=parseInt(a(d).css("padding-left"));for(i=1;i<=b.inView;i++)a(d).append('<div id="textholder'+c+"_"+i+'" class="textholder" style="position:absolute;width:'+g+"px;bottom:0px;margin-bottom:"+-(l*b.textholderHeight+j)+'px;"><span></span></div>'),a("#textholder"+c+"_"+i).css({left:(i-1)*(g+parseInt(b.padding)*2),"margin-left":parseInt(b.padding)+h,"margin-right":b.padding}),a("#textholder"+c+"_"+i).height(l*b.textholderHeight).css({backgroundColor:"#FFF",opacity:"0.5"}),html='<div class="minmax" id="minmax'+c+"_"+i+'" style="width:8px;height:8px;position:absolute;top:1px;right:10px;cursor:pointer;background:url('+b.imagePath+'caption.gif) no-repeat 0 -8px"></div>',html+='<div class="close" id="close'+c+"_"+i+'" style="width:8px;height:8px;position:absolute;top:1px;right:1px;cursor:pointer;background:url('+b.imagePath+'caption.gif) no-repeat 0 0"></div>',a("#textholder"+c+"_"+i).append(html),a("#minmax"+c+"_"+i).hide(),a("#close"+c+"_"+i).hide(),b.autoHideCaptions||t(a("li:eq("+i+") p",d).html(),i);h=parseInt(a("#textholder"+c+"_1").css("padding-left"))+parseInt(a("#textholder"+c+"_1").css("padding-right"));h>0&&a(".textholder",d).width(g-h);a(".close",d).each(function(d){a(this).click(function(){a("#textholder"+c+"_"+(d+1)).animate({marginBottom:-l*b.textholderHeight-j-1+"px"},500)})});a(".minmax",d).each(function(d){a(this).click(function(){parseInt(a("#textholder"+c+"_"+(d+1)).css("margin-bottom"))==0?a("#textholder"+c+"_"+(d+1)).animate({marginBottom:-l*b.textholderHeight-j+12+"px"},500,function(){a("#minmax"+c+"_"+(d+1)).css("background-position","0 -16px")}):a("#textholder"+c+"_"+(d+1)).animate({marginBottom:"0px"},500,function(){a("#minmax"+c+"_"+(d+1)).css("background-position","0 -8px")})})});if(b.displayThumbnails){var F=function(){target_num=this.id.split("_");e[0]!=target_num[1]&&(n="pause",a("#progress"+c).stop().fadeOut(),clearTimeout(q),a("#thumbs"+c+" div").css({cursor:"default"}).unbind("click"),f=0,setTimeout(function(){a("#play_pause_btn"+c).css("background-position","0 -16px")},b.transitionSpeed));target_num[1]>e[0]&&(diff=target_num[1]-e[0],o(diff));target_num[1]<e[0]&&(diff=e[0]-target_num[1],B(diff))},e=[],p=[];a(d).after('<div id="thumbs'+c+'" style="position:relative;overflow:auto;clear:left;text-align:left;padding-top:5px;"></div>');for(i=0;i<=k-1;i++)h=true,h==true&&i==k-1?(h=false,thumb=a("img:eq(0)",d).attr("src")):thumb=a("img:eq("+(i+1)+")",d).attr("src"),a("#thumbs"+c).append('<div class="thumb" id="thumb'+c+"_"+(i+1)+'" style="cursor:pointer;display:inline;float:left;width:'+b.thumbnailWidth+";height:"+b.thumbnailHeight+";line-height:"+b.thumbnailHeight+";padding:0;overflow:hidden;text-align:center;border:2px solid #ccc;margin-right:4px;font-size:"+b.thumbnailFontSize+';font-family:Arial;color:#000;text-shadow:0 0 3px #fff"><img src="'+thumb+'" height="40px" width="61px"/></div>'),i<=b.inView&&a("#thumb"+c+"_"+i).css({"border-color":"#ff0000"}),p.push(i+1);for(i=1;i<=b.inView;i++)e.push(p.shift());thumb=a("img:first",d).attr("src");a("#thumbs"+c).css({"padding-top":"0px",background:"#ca7700","margin-top":"1px",width:"929px","margin-right":"auto","margin-left":"auto"});a("#thumbs"+c+" div.thumb:first").css({opacity:0.65});a("#thumbs"+c+" div.thumb").hover(function(){a(this).animate({opacity:0.65},150)},function(){e[0]!=this.id.split("_")[1]&&a(this).animate({opacity:1},250)});a("#thumbs"+c+" div").bind("click",F);b.displayThumbnailNumbers||a("#thumbs"+c+" div").text("");b.displayThumbnailBackground||a("#thumbs"+c+" div").css({"background-image":"none"})}if(b.showControls){html='<div id="play_pause_btn'+c+'" class="playpause" style="z-index: 100;cursor:pointer;position:absolute;top:15px;right:15px;border:none;width:16px;height:16px;background:url('+b.imagePath+'playpause.gif) no-repeat 0 0"></div>';var n="play";a("#play_pause_btn"+c).css("opacity",0.5).hover(function(){a(this).animate({opacity:"1"},250)},function(){a(this).animate({opacity:".5"},250)});a("#play_pause_btn"+c).click(function(){n=n=="play"?"pause":"play";n=="play"?r():v()});b.prevNextInternal||(wrapID=a(d).attr("id")+"Wrapper",a(d).wrap('<div id="'+wrapID+'"></div>').css("margin","0 auto"),a("#"+wrapID).css("position","relative").width(a(d).width()+40+parseInt(a(d).css("padding-left"))+parseInt(a(d).css("padding-right"))));arrowsTop=l/2-15+parseInt(b.padding);html='<div id="btn_rt'+c+'" class="right" style="z-index: 100;position:absolute;right:2px;top:'+arrowsTop+"px;cursor:pointer;border:none;width:46px;height:63px;background:url("+b.imagePath+'arrows.png) no-repeat 0 0"></div>';html+='<div id="btn_lt'+c+'" class="left" style="z-index:100;position:absolute;left:2px;top:'+arrowsTop+"px;cursor:pointer;border:none;width:46px;height:63px;background:url("+b.imagePath+'arrows.png) no-repeat -46px 0"></div>';b.prevNextInternal?a(d).append(html):a("#"+wrapID).append(html);a("#btn_rt"+c).css("opacity",0.65).click(function(){m("next")}).hover(function(){a(this).animate({opacity:"1"},250)},function(){a(this).animate({opacity:".65"},250)});a("#btn_lt"+c).css("opacity",0.65).click(function(){m("prev")}).hover(function(){a(this).animate({opacity:"1"},250)},function(){a(this).animate({opacity:".65"},250)});b.autoHideControls&&b.prevNextInternal&&(h=function(){a("#play_pause_btn"+c).stop().animate({top:-16-j+"px",right:-16-j+"px"},250);a("#btn_rt"+c).stop().animate({right:"-16px"},250);a("#btn_lt"+c).stop().animate({left:"-16px"},250)},a(d).hover(function(){a("#play_pause_btn"+c).stop().animate({top:"3px",right:"3px"},250);a("#btn_rt"+c).stop().animate({top:arrowsTop+"px",right:"2px"},250);a("#btn_lt"+c).stop().animate({top:arrowsTop+"px",left:"2px"},250)},h),h());if(b.autoHideCaptions){var w,E=function(){w=true;for(i=1;i<=b.inView;i++)t(a("li:eq("+i+") p",d).html(),i)};a(d).hover(E,function(){w=false;u()});u()}}if(f){var q=setInterval(function(){o()},b.displayTime+b.transitionSpeed);b.displayProgressBar&&y(b.displayTime+b.transitionSpeed)}else n="pause",a("#play_pause_btn"+c).css({"background-position":"0 -16px"});A()})}})})(jQuery);
