(function(b){var a={};var c={mode:"horizontal",slideselector:"",infiniteloop:true,hidecontrolonend:false,speed:500,easing:null,slidemargin:0,startslide:0,randomstart:false,captions:false,ticker:false,tickerhover:false,adaptiveheight:false,adaptiveheightspeed:500,video:false,usecss:true,preloadimages:"visible",responsive:true,slidezindex:50,wrapperclass:"bx-wrapper",touchenabled:true,swipethreshold:50,onetoonetouch:true,preventdefaultswipex:true,preventdefaultswipey:false,pager:true,pagertype:"full",pagershortseparator:" / ",pagerselector:null,buildpager:null,pagercustom:null,controls:true,nexttext:"next",prevtext:"prev",nextselector:null,prevselector:null,autocontrols:false,starttext:"start",stoptext:"stop",autocontrolscombine:false,autocontrolsselector:null,auto:false,pause:4000,autostart:true,autodirection:"next",autohover:false,autodelay:0,autoslideforonepage:false,minslides:1,maxslides:1,moveslides:0,slidewidth:0,onsliderload:function(){},onslidebefore:function(){},onslideafter:function(){},onslidenext:function(){},onslideprev:function(){},onsliderresize:function(){}};b.fn.bxslider=function(s){if(this.length==0){return this}if(this.length>1){this.each(function(){b(this).bxslider(s)});return this}var j={};var h=this;a.el=this;var j=b(window).width();var m=b(window).height();var c=function(){j.settings=b.extend({},c,s);j.settings.slidewidth=parseint(j.settings.slidewidth);j.children=h.children(j.settings.slideselector);if(j.children.length1||j.settings.maxslides>1;if(j.carousel){j.settings.preloadimages="all"}j.minthreshold=(j.settings.minslides*j.settings.slidewidth)+((j.settings.minslides-1)*j.settings.slidemargin);j.maxthreshold=(j.settings.maxslides*j.settings.slidewidth)+((j.settings.maxslides-1)*j.settings.slidemargin);j.working=false;j.controls={};j.interval=null;j.animprop=j.settings.mode=="vertical"?"top":"left";j.usingcss=j.settings.usecss&&j.settings.mode!="fade"&&(function(){var t=document.createelement("div");var s=["webkitperspective","mozperspective","operspective","msperspective"];for(var r in s){if(t.style[s[r]]!==undefined){j.cssprefix=s[r].replace("perspective","").tolowercase();j.animprop="-"+j.cssprefix+"-transform";return true}}return false}());if(j.settings.mode=="vertical"){j.settings.maxslides=j.settings.minslides}h.data("origstyle",h.attr("style"));h.children(j.settings.slideselector).each(function(){b(this).data("origstyle",b(this).attr("style"))});m()};var m=function(){h.wrap('
');j.viewport=h.parent();j.loader=b('
');j.viewport.prepend(j.loader);h.css({width:j.settings.mode=="horizontal"?(j.children.length*100+215)+"%":"auto",position:"relative"});if(j.usingcss&&j.settings.easing){h.css("-"+j.cssprefix+"-transition-timing-function",j.settings.easing)}else{if(!j.settings.easing){j.settings.easing="swing"}}var r=a();j.viewport.css({width:"100%",overflow:"hidden",position:"relative"});j.viewport.parent().css({maxwidth:l()});if(!j.settings.pager){j.viewport.parent().css({margin:"0 auto 0px"})}j.children.css({"float":j.settings.mode=="horizontal"?"left":"none",liststyle:"none",position:"relative"});j.children.css("width",d());if(j.settings.mode=="horizontal"&&j.settings.slidemargin>0){j.children.css("marginright",j.settings.slidemargin)}if(j.settings.mode=="vertical"&&j.settings.slidemargin>0){j.children.css("marginbottom",j.settings.slidemargin)}if(j.settings.mode=="fade"){j.children.css({position:"absolute",zindex:0,display:"none"});j.children.eq(j.settings.startslide).css({zindex:j.settings.slidezindex,display:"block"})}j.controls.el=b('
');if(j.settings.captions){z()}j.active.last=j.settings.startslide==v()-1;if(j.settings.video){h.fitvids()}var s=j.children.eq(j.settings.startslide);if(j.settings.preloadimages=="all"){s=j.children}if(!j.settings.ticker){if(j.settings.pager){o()}if(j.settings.controls){k()}if(j.settings.auto&&j.settings.autocontrols){k()}if(j.settings.controls||j.settings.autocontrols||j.settings.pager){j.viewport.after(j.controls.el)}}else{j.settings.pager=false}d(s,t)};var d=function(r,u){var t=r.find("img, iframe").length;if(t==0){u();return}var s=0;r.find("img, iframe").each(function(){b(this).one("load",function(){if(++s==t){u()}}).each(function(){if(this.complete){b(this).load()}})})};var t=function(){if(j.settings.infiniteloop&&j.settings.mode!="fade"&&!j.settings.ticker){var t=j.settings.mode=="vertical"?j.settings.minslides:j.settings.maxslides;var s=j.children.slice(0,t).clone().addclass("bx-clone");var r=j.children.slice(-t).clone().addclass("bx-clone");h.append(s).prepend(r)}j.loader.remove();h();if(j.settings.mode=="vertical"){j.settings.adaptiveheight=true}j.viewport.height(o());h.redrawslider();j.settings.onsliderload(j.active.index);j.initialized=true;if(j.settings.responsive){b(window).bind("resize",n)}if(j.settings.auto&&j.settings.autostart&&(v()>1||j.settings.autoslideforonepage)){e()}if(j.settings.ticker){f()}if(j.settings.pager){q(j.settings.startslide)}if(j.settings.controls){l()}if(j.settings.touchenabled&&!j.settings.ticker){f()}};var o=function(){var r=0;var t=b();if(j.settings.mode!="vertical"&&!j.settings.adaptiveheight){t=j.children}else{if(!j.carousel){t=j.children.eq(j.active.index)}else{var s=j.settings.moveslides==1?j.active.index:j.active.index*q();t=j.children.eq(s);for(i=1;i<=j.settings.maxslides-1;i++){if(s+i>=j.children.length){t=t.add(j.children.eq(i-1))}else{t=t.add(j.children.eq(s+i))}}}}if(j.settings.mode=="vertical"){t.each(function(u){r+=b(this).outerheight()});if(j.settings.slidemargin>0){r+=j.settings.slidemargin*(j.settings.minslides-1)}}else{r=math.max.apply(math,t.map(function(){return b(this).outerheight(false)}).get())}if(j.viewport.css("box-sizing")=="border-box"){r+=parsefloat(j.viewport.css("padding-top"))+parsefloat(j.viewport.css("padding-bottom"))+parsefloat(j.viewport.css("border-top-width"))+parsefloat(j.viewport.css("border-bottom-width"))}else{if(j.viewport.css("box-sizing")=="padding-box"){r+=parsefloat(j.viewport.css("padding-top"))+parsefloat(j.viewport.css("padding-bottom"))}}return r};var l=function(){var r="100%";if(j.settings.slidewidth>0){if(j.settings.mode=="horizontal"){r=(j.settings.maxslides*j.settings.slidewidth)+((j.settings.maxslides-1)*j.settings.slidemargin)}else{r=j.settings.slidewidth}}return r};var d=function(){var s=j.settings.slidewidth;var r=j.viewport.width();if(j.settings.slidewidth==0||(j.settings.slidewidth>r&&!j.carousel)||j.settings.mode=="vertical"){s=r}else{if(j.settings.maxslides>1&&j.settings.mode=="horizontal"){if(r>j.maxthreshold){}else{if(r0){if(j.viewport.width()j.maxthreshold){s=j.settings.maxslides}else{var r=j.children.first().width()+j.settings.slidemargin;s=math.floor((j.viewport.width()+j.settings.slidemargin)/r)}}}else{if(j.settings.mode=="vertical"){s=j.settings.minslides}}return s};var v=function(){var s=0;if(j.settings.moveslides>0){if(j.settings.infiniteloop){s=math.ceil(j.children.length/q())}else{var t=0;var r=0;while(t0&&j.settings.moveslides<=a()){return j.settings.moveslides}return a()};var h=function(){if(j.children.length>j.settings.maxslides&&j.active.last&&!j.settings.infiniteloop){if(j.settings.mode=="horizontal"){var t=j.children.last();var r=t.position();b(-(r.left-(j.viewport.width()-t.outerwidth())),"reset",0)}else{if(j.settings.mode=="vertical"){var s=j.children.length-j.settings.minslides;var r=j.children.eq(s).position();b(-r.top,"reset",0)}}}else{var r=j.children.eq(j.active.index*q()).position();if(j.active.index==v()-1){j.active.last=true}if(r!=undefined){if(j.settings.mode=="horizontal"){b(-r.left,"reset",0)}else{if(j.settings.mode=="vertical"){b(-r.top,"reset",0)}}}}};var b=function(t,s,u,w){if(j.usingcss){var v=j.settings.mode=="vertical"?"translate3d(0, "+t+"px, 0)":"translate3d("+t+"px, 0, 0)";h.css("-"+j.cssprefix+"-transition-duration",u/1000+"s");if(s=="slide"){h.css(j.animprop,v);h.bind("transitionend webkittransitionend otransitionend mstransitionend",function(){h.unbind("transitionend webkittransitionend otransitionend mstransitionend");p()})}else{if(s=="reset"){h.css(j.animprop,v)}else{if(s=="ticker"){h.css("-"+j.cssprefix+"-transition-timing-function","linear");h.css(j.animprop,v);h.bind("transitionend webkittransitionend otransitionend mstransitionend",function(){h.unbind("transitionend webkittransitionend otransitionend mstransitionend");b(w.resetvalue,"reset",0);u()})}}}}else{var r={};r[j.animprop]=t;if(s=="slide"){h.animate(r,u,j.settings.easing,function(){p()})}else{if(s=="reset"){h.css(j.animprop,t)}else{if(s=="ticker"){h.animate(r,speed,"linear",function(){b(w.resetvalue,"reset",0);u()})}}}}};var r=function(){var u="";var t=v();for(var s=0;s1){u+=''}}j.pagerel.html(u)};var o=function(){if(!j.settings.pagercustom){j.pagerel=b('
');if(j.settings.pagerselector){b(j.settings.pagerselector).html(j.pagerel)}else{j.controls.el.addclass("bx-has-pager").append(j.pagerel)}r()}else{j.pagerel=b(j.settings.pagercustom)}j.pagerel.on("click","a",x)};var k=function(){if(j.settings.nextselector){b(j.settings.nextselector).bind("click",g)}if(j.settings.prevselector){b(j.settings.prevselector).bind("click",n)}if(!j.settings.nextselector&&!j.settings.prevselector){j.controls.directionel=b('
');j.controls.directionel.append(j.controls.prev).append(j.controls.next);j.controls.el.addclass("bx-has-controls-direction").append(j.controls.directionel)}};var k=function(){j.controls.start=b('");j.controls.stop=b('");j.controls.autoel=b('
');j.controls.autoel.on("click",".bx-start",w);j.controls.autoel.on("click",".bx-stop",p);if(j.settings.autocontrolscombine){j.controls.autoel.append(j.controls.start)}else{j.controls.autoel.append(j.controls.start).append(j.controls.stop)}if(j.settings.autocontrolsselector){b(j.settings.autocontrolsselector).html(j.controls.autoel)}else{j.controls.el.addclass("bx-has-controls-auto").append(j.controls.autoel)}g(j.settings.autostart?"stop":"start")};var z=function(){j.children.each(function(r){var s=b(this).find("img:first").attr("title");if(s!=undefined&&(""+s).length){b(this).append('
'+s+"
")}})};var g=function(r){if(j.settings.auto){h.stopauto()}h.gotonextslide();r.preventdefault()};var n=function(r){if(j.settings.auto){h.stopauto()}h.gotoprevslide();r.preventdefault()};var w=function(r){h.startauto();r.preventdefault()};var p=function(r){h.stopauto();r.preventdefault()};var x=function(t){if(j.settings.auto){h.stopauto()}var s=b(t.currenttarget);if(s.attr("data-slide-index")!==undefined){var r=parseint(s.attr("data-slide-index"));if(r!=j.active.index){h.gotoslide(r)}t.preventdefault()}};var q=function(s){var r=j.children.length;if(j.settings.pagertype=="short"){if(j.settings.maxslides>1){r=math.ceil(j.children.length/j.settings.maxslides)}j.pagerel.html((s+1)+j.settings.pagershortseparator+r);return}j.pagerel.find("a").removeclass("active");j.pagerel.each(function(t,u){b(u).find("a").eq(s).addclass("active")})};var p=function(){if(j.settings.infiniteloop){var r="";if(j.active.index==0){r=j.children.eq(0).position()}else{if(j.active.index==v()-1&&j.carousel){r=j.children.eq((v()-1)*q()).position()}else{if(j.active.index==j.children.length-1){r=j.children.eq(j.children.length-1).position()}}}if(r){if(j.settings.mode=="horizontal"){b(-r.left,"reset",0)}else{if(j.settings.mode=="vertical"){b(-r.top,"reset",0)}}}}j.working=false;j.settings.onslideafter(j.children.eq(j.active.index),j.oldindex,j.active.index)};var g=function(r){if(j.settings.autocontrolscombine){j.controls.autoel.html(j.controls[r])}else{j.controls.autoel.find("a").removeclass("active");j.controls.autoel.find("a:not(.bx-"+r+")").addclass("active")}};var l=function(){if(v()==1){j.controls.prev.addclass("disabled");j.controls.next.addclass("disabled")}else{if(!j.settings.infiniteloop&&j.settings.hidecontrolonend){if(j.active.index==0){j.controls.prev.addclass("disabled");j.controls.next.removeclass("disabled")}else{if(j.active.index==v()-1){j.controls.next.addclass("disabled");j.controls.prev.removeclass("disabled")}else{j.controls.prev.removeclass("disabled");j.controls.next.removeclass("disabled")}}}}};var e=function(){if(j.settings.autodelay>0){var r=settimeout(h.startauto,j.settings.autodelay)}else{h.startauto()}if(j.settings.autohover){h.hover(function(){if(j.interval){h.stopauto(true);j.autopaused=true}},function(){if(j.autopaused){h.startauto(true);j.autopaused=null}})}};var f=function(){var s=0;if(j.settings.autodirection=="next"){h.append(j.children.clone().addclass("bx-clone"))}else{h.prepend(j.children.clone().addclass("bx-clone"));var r=j.children.first().position();s=j.settings.mode=="horizontal"?-r.left:-r.top}b(s,"reset",0);j.settings.pager=false;j.settings.controls=false;j.settings.autocontrols=false;if(j.settings.tickerhover&&!j.usingcss){j.viewport.hover(function(){h.stop()},function(){var w=0;j.children.each(function(x){w+=j.settings.mode=="horizontal"?b(this).outerwidth(true):b(this).outerheight(true)});var t=j.settings.speed/w;var u=j.settings.mode=="horizontal"?"left":"top";var v=t*(w-(math.abs(parseint(h.css(u)))));u(v)})}u()};var u=function(w){speed=w?w:j.settings.speed;var r={left:0,top:0};var u={left:0,top:0};if(j.settings.autodirection=="next"){r=h.find(".bx-clone").first().position()}else{u=j.children.first().position()}var t=j.settings.mode=="horizontal"?-r.left:-r.top;var s=j.settings.mode=="horizontal"?-u.left:-u.top;var v={resetvalue:s};b(t,"ticker",speed,v)};var f=function(){j.touch={start:{x:0,y:0},end:{x:0,y:0}};j.viewport.bind("touchstart",e)};var e=function(r){if(j.working){r.preventdefault()}else{j.touch.originalpos=h.position();var s=r.originalevent;j.touch.start.x=s.changedtouches[0].pagex;j.touch.start.y=s.changedtouches[0].pagey;j.viewport.bind("touchmove",i);j.viewport.bind("touchend",y)}};var i=function(s){var w=s.originalevent;var t=math.abs(w.changedtouches[0].pagex-j.touch.start.x);var v=math.abs(w.changedtouches[0].pagey-j.touch.start.y);if((t*3)>v&&j.settings.preventdefaultswipex){s.preventdefault()}else{if((v*3)>t&&j.settings.preventdefaultswipey){s.preventdefault()}}if(j.settings.mode!="fade"&&j.settings.onetoonetouch){var r=0;if(j.settings.mode=="horizontal"){var u=w.changedtouches[0].pagex-j.touch.start.x;r=j.touch.originalpos.left+u}else{var u=w.changedtouches[0].pagey-j.touch.start.y;r=j.touch.originalpos.top+u}b(r,"reset",0)}};var y=function(s){j.viewport.unbind("touchmove",i);var u=s.originalevent;var r=0;j.touch.end.x=u.changedtouches[0].pagex;j.touch.end.y=u.changedtouches[0].pagey;if(j.settings.mode=="fade"){var t=math.abs(j.touch.start.x-j.touch.end.x);if(t>=j.settings.swipethreshold){j.touch.start.x>j.touch.end.x?h.gotonextslide():h.gotoprevslide();h.stopauto()}}else{var t=0;if(j.settings.mode=="horizontal"){t=j.touch.end.x-j.touch.start.x;r=j.touch.originalpos.left}else{t=j.touch.end.y-j.touch.start.y;r=j.touch.originalpos.top}if(!j.settings.infiniteloop&&((j.active.index==0&&t>0)||(j.active.last&&t<0))){b(r,"reset",200)}else{if(math.abs(t)>=j.settings.swipethreshold){t<0?h.gotonextslide():h.gotoprevslide();h.stopauto()}else{b(r,"reset",200)}}}j.viewport.unbind("touchend",y)};var n=function(s){if(!j.initialized){return}var r=b(window).width();var t=b(window).height();if(j!=r||m!=t){j=r;m=t;h.redrawslider();j.settings.onsliderresize.call(h,j.active.index)}};h.gotoslide=function(v,x){if(j.working||j.active.index==v){return}j.working=true;j.oldindex=j.active.index;if(v<0){j.active.index=v()-1}else{if(v>=v()){j.active.index=0}else{j.active.index=v}}j.settings.onslidebefore(j.children.eq(j.active.index),j.oldindex,j.active.index);if(x=="next"){j.settings.onslidenext(j.children.eq(j.active.index),j.oldindex,j.active.index)}else{if(x=="prev"){j.settings.onslideprev(j.children.eq(j.active.index),j.oldindex,j.active.index)}}j.active.last=j.active.index>=v()-1;if(j.settings.pager){q(j.active.index)}if(j.settings.controls){l()}if(j.settings.mode=="fade"){if(j.settings.adaptiveheight&&j.viewport.height()!=o()){j.viewport.animate({height:o()},j.settings.adaptiveheightspeed)}j.children.filter(":visible").fadeout(j.settings.speed).css({zindex:0});j.children.eq(j.active.index).css("zindex",j.settings.slidezindex+1).fadein(j.settings.speed,function(){b(this).css("zindex",j.settings.slidezindex);p()})}else{if(j.settings.adaptiveheight&&j.viewport.height()!=o()){j.viewport.animate({height:o()},j.settings.adaptiveheightspeed)}var w=0;var u={left:0,top:0};if(!j.settings.infiniteloop&&j.carousel&&j.active.last){if(j.settings.mode=="horizontal"){var r=j.children.eq(j.children.length-1);u=r.position();w=j.viewport.width()-r.outerwidth()}else{var t=j.children.length-j.settings.minslides;u=j.children.eq(t).position()}}else{if(j.carousel&&j.active.last&&x=="prev"){var z=j.settings.moveslides==1?j.settings.maxslides-q():((v()-1)*q())-(j.children.length-j.settings.maxslides);var r=h.children(".bx-clone").eq(z);u=r.position()}else{if(x=="next"&&j.active.index==0){u=h.find("> .bx-clone").eq(j.settings.maxslides).position();j.active.last=false}else{if(v>=0){var s=v*q();u=j.children.eq(s).position()}}}}if("undefined"!==typeof(u)){var y=j.settings.mode=="horizontal"?-(u.left-w):-u.top;b(y,"slide",j.settings.speed)}}};h.gotonextslide=function(){if(!j.settings.infiniteloop&&j.active.last){return}var r=parseint(j.active.index)+1;h.gotoslide(r,"next")};h.gotoprevslide=function(){if(!j.settings.infiniteloop&&j.active.index==0){return}var r=parseint(j.active.index)-1;h.gotoslide(r,"prev")};h.startauto=function(r){if(j.interval){return}j.interval=setinterval(function(){j.settings.autodirection=="next"?h.gotonextslide():h.gotoprevslide()},j.settings.pause);if(j.settings.autocontrols&&r!=true){g("stop")}};h.stopauto=function(r){if(!j.interval){return}clearinterval(j.interval);j.interval=null;if(j.settings.autocontrols&&r!=true){g("start")}};h.getcurrentslide=function(){return j.active.index};h.getcurrentslideelement=function(){return j.children.eq(j.active.index)};h.getslidecount=function(){return j.children.length};h.redrawslider=function(){j.children.add(h.find(".bx-clone")).width(d());j.viewport.css("height",o());if(!j.settings.ticker){h()}if(j.active.last){j.active.index=v()-1}if(j.active.index>=v()){j.active.last=true}if(j.settings.pager&&!j.settings.pagercustom){r();q(j.active.index)}};h.destroyslider=function(){if(!j.initialized){return}j.initialized=false;b(".bx-clone",this).remove();j.children.each(function(){b(this).data("origstyle")!=undefined?b(this).attr("style",b(this).data("origstyle")):b(this).removeattr("style")});b(this).data("origstyle")!=undefined?this.attr("style",b(this).data("origstyle")):b(this).removeattr("style");b(this).unwrap().unwrap();if(j.controls.el){j.controls.el.remove()}if(j.controls.next){j.controls.next.remove()}if(j.controls.prev){j.controls.prev.remove()}if(j.pagerel&&j.settings.controls){j.pagerel.remove()}b(".bx-caption",this).remove();if(j.controls.autoel){j.controls.autoel.remove()}clearinterval(j.interval);if(j.settings.responsive){b(window).unbind("resize",n)}};h.reloadslider=function(r){if(r!=undefined){s=r}h.destroyslider();c()};c();return this}})(jquery);