/**
 * jQuery bxSlider v3.0
 * http://bxslider.com
 *
 * Copyright 2010, Steven Wanderski
 * http://bxcreative.com
 *
 * Free to use and abuse under the MIT license.
 * http://www.opensource.org/licenses/mit-license.php
 *
 */
(function(d){d.fn.bxSlider=function(a){function O(){if("horizontal"==a.mode||"vertical"==a.mode){var b=K(c,0,a.moveSlideQty,"backward");d.each(b,function(){e.prepend(d(this))});b=K(c,0,c.length+a.moveSlideQty-1-(c.length-a.displaySlideQty),"forward");a.infiniteLoop&&d.each(b,function(){e.append(d(this))})}}function P(){a.auto?a.infiniteLoop?"next"==a.autoDirection?q=setInterval(function(){h.goToNextSlide(!1)},a.pause):"prev"==a.autoDirection&&(q=setInterval(function(){h.goToPreviousSlide(!1)},a.pause)):
"next"==a.autoDirection?q=setInterval(function(){b+=a.moveSlideQty;b>r&&(b%=c.length);h.goToSlide(b,!1)},a.pause):"prev"==a.autoDirection&&(q=setInterval(function(){b-=a.moveSlideQty;0>b&&(negativeOffset=b%c.length,b=0==negativeOffset?0:c.length+negativeOffset);h.goToSlide(b,!1)},a.pause)):a.ticker&&(a.tickerSpeed*=10,d(".pager",f).each(function(){i+=d(this).width();k+=d(this).height()}),"prev"==a.tickerDirection&&"horizontal"==a.mode?e.css("left","-"+(i+v)+"px"):"prev"==a.tickerDirection&&"vertical"==
a.mode&&e.css("top","-"+(k+w)+"px"),"horizontal"==a.mode?(A=parseInt(e.css("left")),o(A,i,a.tickerSpeed)):"vertical"==a.mode&&(B=parseInt(e.css("top")),o(B,k,a.tickerSpeed)),a.tickerHover&&Q())}function o(b,c,d){"horizontal"==a.mode?"next"==a.tickerDirection?e.animate({left:"-="+c+"px"},d,"linear",function(){e.css("left",b);o(b,i,a.tickerSpeed)}):"prev"==a.tickerDirection&&e.animate({left:"+="+c+"px"},d,"linear",function(){e.css("left",b);o(b,i,a.tickerSpeed)}):"vertical"==a.mode&&("next"==a.tickerDirection?
e.animate({top:"-="+c+"px"},d,"linear",function(){e.css("top",b);o(b,k,a.tickerSpeed)}):"prev"==a.tickerDirection&&e.animate({top:"+="+c+"px"},d,"linear",function(){e.css("top",b);o(b,k,a.tickerSpeed)}))}function R(){f.find(".bx-window").hover(function(){l&&h.stopShow(!1)},function(){l&&h.startShow(!1)})}function Q(){e.hover(function(){l&&h.stopTicker(!1)},function(){l&&h.startTicker(!1)})}function I(){c.not(":eq("+b+")").fadeTo(a.speed,0).css("zIndex",98);c.eq(b).css("zIndex",99).fadeTo(a.speed,
1,function(){g=!1;jQuery.browser.msie&&c.eq(b).get(0).style.removeAttribute("filter");a.onAfterSlide(b,c.length,c.eq(b))})}function s(j){"full"==a.pagerType&&a.pager?(d("a",p).removeClass(a.pagerActiveClass),d("a",p).eq(j).addClass(a.pagerActiveClass)):"short"==a.pagerType&&a.pager&&d(".bx-pager-current",p).html(b+1)}function S(b,c,e,g){var i=d('<a href="" class="bx-next"></a>'),x=d('<a href="" class="bx-prev"></a>');"text"==b?i.html(c):i.html('<img src="'+c+'" />');"text"==e?x.html(g):x.html('<img src="'+
g+'" />');a.prevSelector?d(a.prevSelector).append(x):f.append(x);a.nextSelector?d(a.nextSelector).append(i):f.append(i);i.click(function(){h.goToNextSlide();return!1});x.click(function(){h.goToPreviousSlide();return!1})}function L(b){var e=c.length;1<a.moveSlideQty&&(e=0!=c.length%a.moveSlideQty?Math.ceil(c.length/a.moveSlideQty):c.length/a.moveSlideQty);var g="";if(a.buildPager)for(b=0;b<e;b++)g+=a.buildPager(b,c.eq(b*a.moveSlideQty));else if("full"==b)for(b=1;b<=e;b++)g+='<a href="" class="pager-link pager-'+
b+'">'+b+"</a>";else"short"==b&&(g='<span class="bx-pager-current">'+(a.startingSlide+1)+"</span> "+a.pagerShortSeparator+' <span class="bx-pager-total">'+c.length+"</span>");a.pagerSelector?(d(a.pagerSelector).append(g),p=d(a.pagerSelector)):(e=d('<div class="bx-pager"></div>'),e.append(g),"top"==a.pagerLocation?f.prepend(e):"bottom"==a.pagerLocation&&f.append(e),p=d(".bx-pager",f));p.children().click(function(){if("full"==a.pagerType){var b=p.children().index(this);1<a.moveSlideQty&&(b*=a.moveSlideQty);
h.goToSlide(b)}return!1})}function D(){var j=d("img",c.eq(b)).attr("title");""!=j?a.captionsSelector?d(a.captionsSelector).html(j):d(".bx-captions",f).html(j):a.captionsSelector?d(a.captionsSelector).html("&nbsp;"):d(".bx-captions",f).html("&nbsp;")}function T(b,c,e,g){m=d('<a href="" class="bx-start"></a>');E="text"==b?c:'<img src="'+c+'" />';F="text"==e?g:'<img src="'+g+'" />';a.autoControlsSelector?d(a.autoControlsSelector).append(m):(f.append('<div class="bx-auto"></div>'),d(".bx-auto",f).html(m));
m.click(function(){a.ticker?d(this).hasClass("stop")?h.stopTicker():d(this).hasClass("start")&&h.startTicker():d(this).hasClass("stop")?h.stopShow(!0):d(this).hasClass("start")&&h.startShow(!0);return!1})}function G(){!a.infiniteLoop&&a.hideControlOnEnd&&(b==H?d(".bx-prev",f).hide():d(".bx-prev",f).show(),b==r?d(".bx-next",f).hide():d(".bx-next",f).show())}function u(a,b){if("left"==b)var c=d(".pager",f).eq(a).position().left;else if("top"==b)c=d(".pager",f).eq(a).position().top;return c}function K(a,
b,c,e){var g=[],h=c,f=!1;"backward"==e&&(a=d.makeArray(a),a.reverse());for(;0<h;)d.each(a,function(a){if(0<h)f?(g.push(d(this).clone()),h--):a==b&&(f=!0,g.push(d(this).clone()),h--);else return!1});return g}var a=d.extend({mode:"horizontal",infiniteLoop:!0,hideControlOnEnd:!1,controls:!0,speed:500,easing:"swing",pager:!1,pagerSelector:null,pagerType:"full",pagerLocation:"bottom",pagerShortSeparator:"/",pagerActiveClass:"pager-active",nextText:"next",nextImage:"",nextSelector:null,prevText:"prev",
prevImage:"",prevSelector:null,captions:!1,captionsSelector:null,auto:!1,autoDirection:"next",autoControls:!1,autoControlsSelector:null,autoStart:!0,autoHover:!1,autoDelay:0,pause:3E3,startText:"start",startImage:"",stopText:"stop",stopImage:"",ticker:!1,tickerSpeed:5E3,tickerDirection:"next",tickerHover:!1,wrapperClass:"bx-wrapper",startingSlide:0,displaySlideQty:1,moveSlideQty:1,randomStart:!1,onBeforeSlide:function(){},onAfterSlide:function(){},onLastSlide:function(){},onFirstSlide:function(){},
onNextSlide:function(){},onPrevSlide:function(){},buildPager:null},a),h=this,e="",c="",f="",y="",M="",z="",J="",N="",p="",q="",m="",E="",F="",l=!0,t=0,n=0,b=0,v=0,w=0,i=0,k=0,A=0,B=0,g=!1,H=0,r=c.length-1;this.goToSlide=function(d,f){if(!g){g=!0;b=d;a.onBeforeSlide(b,c.length,c.eq(b));"undefined"==typeof f&&(f=!0);f&&a.auto&&h.stopShow(!0);slide=d;if(slide==H)a.onFirstSlide(b,c.length,c.eq(b));if(slide==r)a.onLastSlide(b,c.length,c.eq(b));"horizontal"==a.mode?e.animate({left:"-"+u(slide,"left")+"px"},
a.speed,a.easing,function(){g=!1;a.onAfterSlide(b,c.length,c.eq(b))}):"vertical"==a.mode?e.animate({top:"-"+u(slide,"top")+"px"},a.speed,a.easing,function(){g=!1;a.onAfterSlide(b,c.length,c.eq(b))}):"fade"==a.mode&&I();G();1<a.moveSlideQty&&(d=Math.floor(d/a.moveSlideQty));s(d);D()}};this.goToNextSlide=function(d){"undefined"==typeof d&&(d=!0);d&&a.auto&&h.stopShow(!0);if(a.infiniteLoop)g||(g=!0,f=!1,b+=a.moveSlideQty,b>r&&(b%=c.length,f=!0),a.onNextSlide(b,c.length,c.eq(b)),a.onBeforeSlide(b,c.length,
c.eq(b)),"horizontal"==a.mode?e.animate({left:"-="+a.moveSlideQty*z+"px"},a.speed,a.easing,function(){g=!1;f&&e.css("left","-"+u(b,"left")+"px");a.onAfterSlide(b,c.length,c.eq(b))}):"vertical"==a.mode?e.animate({top:"-="+a.moveSlideQty*n+"px"},a.speed,a.easing,function(){g=!1;f&&e.css("top","-"+u(b,"top")+"px");a.onAfterSlide(b,c.length,c.eq(b))}):"fade"==a.mode&&I(),1<a.moveSlideQty?s(Math.ceil(b/a.moveSlideQty)):s(b),D());else if(!g){var f=!1;b+=a.moveSlideQty;b<=r?(G(),a.onNextSlide(b,c.length,
c.eq(b)),h.goToSlide(b)):b-=a.moveSlideQty}};this.goToPreviousSlide=function(j){"undefined"==typeof j&&(j=!0);j&&a.auto&&h.stopShow(!0);if(a.infiniteLoop)g||(g=!0,C=!1,b-=a.moveSlideQty,0>b&&(negativeOffset=b%c.length,b=0==negativeOffset?0:c.length+negativeOffset,C=!0),a.onPrevSlide(b,c.length,c.eq(b)),a.onBeforeSlide(b,c.length,c.eq(b)),"horizontal"==a.mode?e.animate({left:"+="+a.moveSlideQty*z+"px"},a.speed,a.easing,function(){g=!1;C&&e.css("left","-"+u(b,"left")+"px");a.onAfterSlide(b,c.length,
c.eq(b))}):"vertical"==a.mode?e.animate({top:"+="+a.moveSlideQty*n+"px"},a.speed,a.easing,function(){g=!1;C&&e.css("top","-"+u(b,"top")+"px");a.onAfterSlide(b,c.length,c.eq(b))}):"fade"==a.mode&&I(),1<a.moveSlideQty?s(Math.ceil(b/a.moveSlideQty)):s(b),D());else if(!g){var C=!1;b-=a.moveSlideQty;0>b&&(b=0,a.hideControlOnEnd&&d(".bx-prev",f).hide());G();a.onPrevSlide(b,c.length,c.eq(b));h.goToSlide(b)}};this.goToFirstSlide=function(a){"undefined"==typeof a&&(a=!0);h.goToSlide(H,a)};this.goToLastSlide=
function(){if("undefined"==typeof a)var a=!0;h.goToSlide(r,a)};this.getCurrentSlide=function(){return b};this.getSlideCount=function(){return c.length};this.stopShow=function(b){clearInterval(q);"undefined"==typeof b&&(b=!0);b&&a.autoControls&&(m.html(E).removeClass("stop").addClass("start"),l=!1)};this.startShow=function(b){"undefined"==typeof b&&(b=!0);P();b&&a.autoControls&&(m.html(F).removeClass("start").addClass("stop"),l=!0)};this.stopTicker=function(b){e.stop();"undefined"==typeof b&&(b=!0);
b&&a.ticker&&(m.html(E).removeClass("stop").addClass("start"),l=!1)};this.startTicker=function(b){if("horizontal"==a.mode){if("next"==a.tickerDirection)var b=parseInt(e.css("left")),d=i+b+c.eq(0).width();else"prev"==a.tickerDirection&&(b=-parseInt(e.css("left")),d=b-c.eq(0).width());var f=d*a.tickerSpeed/i;o(A,d,f)}else"vertical"==a.mode&&("next"==a.tickerDirection?(d=parseInt(e.css("top")),d=k+d+c.eq(0).height()):"prev"==a.tickerDirection&&(d=-parseInt(e.css("top")),d-=c.eq(0).height()),f=d*a.tickerSpeed/
k,o(B,d,f),"undefined"==typeof b&&(b=!0),b&&a.ticker&&(m.html(F).removeClass("start").addClass("stop"),l=!0))};this.initShow=function(){e=d(this);e.clone();c=e.children();f="";y=e.children(":first");M=y.width();t=0;z=y.outerWidth();n=0;J=y.outerWidth()*a.displaySlideQty;N=y.outerHeight()*a.displaySlideQty;g=!1;p="";w=v=b=0;F=E=m=q="";l=!0;H=B=A=k=i=0;r=c.length-1;c.each(function(){d(this).outerHeight()>n&&(n=d(this).outerHeight());d(this).outerWidth()>t&&(t=d(this).outerWidth())});if(a.randomStart){var j=
Math.floor(Math.random()*c.length);b=j;v=z*(a.moveSlideQty+j);w=n*(a.moveSlideQty+j)}else b=a.startingSlide,v=z*(a.moveSlideQty+a.startingSlide),w=n*(a.moveSlideQty+a.startingSlide);O(a.startingSlide);"horizontal"==a.mode?(e.wrap('<div class="'+a.wrapperClass+'" style="width:'+J+'px; position:relative;"></div>').wrap('<div class="bx-window" style="position:relative; overflow:hidden; width:'+J+'px;"></div>').css({width:"999999px",position:"relative",left:"-"+v+"px"}),e.children().css({width:M,"float":"left",
listStyle:"none"}),f=e.parent().parent(),c.addClass("pager")):"vertical"==a.mode?(e.wrap('<div class="'+a.wrapperClass+'" style="width:'+t+'px; position:relative;"></div>').wrap('<div class="bx-window" style="width:'+t+"px; height:"+N+'px; position:relative; overflow:hidden;"></div>').css({height:"999999px",position:"relative",top:"-"+w+"px"}),e.children().css({listStyle:"none",height:n}),f=e.parent().parent(),c.addClass("pager")):"fade"==a.mode&&(e.wrap('<div class="'+a.wrapperClass+'" style="width:'+
t+'px; position:relative;"></div>').wrap('<div class="bx-window" style="height:'+n+"px; width:"+t+'px; position:relative; overflow:hidden;"></div>'),e.children().css({listStyle:"none",position:"absolute",top:0,left:0,zIndex:98}),f=e.parent().parent(),c.not(":eq("+b+")").fadeTo(0,0),c.eq(b).css("zIndex",99));a.captions&&null==a.captionsSelector&&f.append('<div class="bx-captions"></div>');a.pager&&!a.ticker&&("full"==a.pagerType?L("full"):"short"==a.pagerType&&L("short"));if(a.controls&&!a.ticker)""!=
a.nextImage?(nextContent=a.nextImage,nextType="image"):(nextContent=a.nextText,nextType="text"),""!=a.prevImage?(prevContent=a.prevImage,prevType="image"):(prevContent=a.prevText,prevType="text"),S(nextType,nextContent,prevType,prevContent);if(a.auto||a.ticker){if(a.autoControls)""!=a.startImage?(startContent=a.startImage,startType="image"):(startContent=a.startText,startType="text"),""!=a.stopImage?(stopContent=a.stopImage,stopType="image"):(stopContent=a.stopText,stopType="text"),T(startType,startContent,
stopType,stopContent);a.autoStart?setTimeout(function(){h.startShow(!0)},a.autoDelay):h.stopShow(!0);a.autoHover&&!a.ticker&&R()}1<a.moveSlideQty?s(Math.ceil(b/a.moveSlideQty)):s(b);G();a.captions&&D();a.onAfterSlide(b,c.length,c.eq(b))};this.destroyShow=function(){clearInterval(q);d(".bx-next, .bx-prev, .bx-pager, .bx-auto",f).remove();e.unwrap().unwrap().removeAttr("style");e.children().removeAttr("style").not(".pager").remove();c.removeClass("pager")};this.reloadShow=function(){h.destroyShow();
h.initShow()};this.each(function(){0<d(this).children().length&&h.initShow()});return this};jQuery.fx.prototype.cur=function(){return null!=this.elem[this.prop]&&(!this.elem.style||null==this.elem.style[this.prop])?this.elem[this.prop]:parseFloat(jQuery.css(this.elem,this.prop))}})(jQuery);

