//--------------------------------图片滚动 js---------------------------------------//
/*scrollpic.js*/
var sina = { $: function (objname) { if (document.getelementbyid) { return eval('document.getelementbyid("' + objname + '")') } else { return eval('document.all.' + objname) } }, isie: navigator.appversion.indexof("msie") != -1 ? true : false, addevent: function (l, i, i) { if (l.attachevent) { l.attachevent("on" + i, i) } else { l.addeventlistener(i, i, false) } }, delevent: function (l, i, i) { if (l.detachevent) { l.detachevent("on" + i, i) } else { l.removeeventlistener(i, i, false) } }, readcookie: function (o) { var o = "", l = o + "="; if (document.cookie.length > 0) { var i = document.cookie.indexof(l); if (i != -1) { i += l.length; var i = document.cookie.indexof(";", i); if (i == -1) i = document.cookie.length; o = unescape(document.cookie.substring(i, i)) } }; return o }, writecookie: function (i, l, o, c) { var o = "", i = ""; if (o != null) { o = new date((new date).gettime() + o * 3600000); o = "; expires=" + o.togmtstring() }; if (c != null) { i = ";domain=" + c }; document.cookie = i + "=" + escape(l) + o + i }, readstyle: function (i, l) { if (i.style[l]) { return i.style[l] } else if (i.currentstyle) { return i.currentstyle[l] } else if (document.defaultview && document.defaultview.getcomputedstyle) { var i = document.defaultview.getcomputedstyle(i, null); return i.getpropertyvalue(l) } else { return null } } };
//滚动图片构造函数
//ui&ue dept. mengjia
//080623
function scrollpic(scrollcontid, arrleftid, arrrightid, dotlistid) { this.scrollcontid = scrollcontid; this.arrleftid = arrleftid; this.arrrightid = arrrightid; this.dotlistid = dotlistid; this.dotclassname = "dotitem"; this.dotonclassname = "dotitemon"; this.dotobjarr = []; this.pagewidth = 0; this.framewidth = 0; this.speed = 10; this.space = 10; this.pageindex = 0; this.autoplay = true; this.autoplaytime = 5; var _autotimeobj, _scrolltimeobj, _state = "ready"; this.stripdiv = document.createelement("div"); this.listdiv01 = document.createelement("div"); this.listdiv02 = document.createelement("div"); if (!scrollpic.childs) { scrollpic.childs = [] }; this.id = scrollpic.childs.length; scrollpic.childs.push(this); this.initialize = function () { if (!this.scrollcontid) { throw new error("必须指定scrollcontid."); return }; this.scrollcontdiv = sina.$(this.scrollcontid); if (!this.scrollcontdiv) { throw new error("scrollcontid不是正确的对象.(scrollcontid = \"" + this.scrollcontid + "\")"); return }; this.scrollcontdiv.style.width = this.framewidth + "px"; this.scrollcontdiv.style.overflow = "hidden"; this.listdiv01.innerhtml = this.listdiv02.innerhtml = this.scrollcontdiv.innerhtml; this.scrollcontdiv.innerhtml = ""; this.scrollcontdiv.appendchild(this.stripdiv); this.stripdiv.appendchild(this.listdiv01); this.stripdiv.appendchild(this.listdiv02); this.stripdiv.style.overflow = "hidden"; this.stripdiv.style.zoom = "1"; this.stripdiv.style.width = "32766px"; if(!+[1,]){this.listdiv01.style.stylefloat="left";this.listdiv02.style.stylefloat="left";}else{this.listdiv01.style.cssfloat="left";this.listdiv02.style.cssfloat="left";} sina.addevent(this.scrollcontdiv, "mouseover", function("scrollpic.childs[" + this.id + "].stop()")); sina.addevent(this.scrollcontdiv, "mouseout", function("scrollpic.childs[" + this.id + "].play()")); if (this.arrleftid) { this.arrleftobj = sina.$(this.arrleftid); if (this.arrleftobj) { sina.addevent(this.arrleftobj, "mousedown", function("scrollpic.childs[" + this.id + "].rightmousedown()")); sina.addevent(this.arrleftobj, "mouseup", function("scrollpic.childs[" + this.id + "].rightend()")); sina.addevent(this.arrleftobj, "mouseout", function("scrollpic.childs[" + this.id + "].rightend()")) } }; if (this.arrrightid) { this.arrrightobj = sina.$(this.arrrightid); if (this.arrrightobj) { sina.addevent(this.arrrightobj, "mousedown", function("scrollpic.childs[" + this.id + "].leftmousedown()")); sina.addevent(this.arrrightobj, "mouseup", function("scrollpic.childs[" + this.id + "].leftend()")); sina.addevent(this.arrrightobj, "mouseout", function("scrollpic.childs[" + this.id + "].leftend()")) } }; if (this.dotlistid) { this.dotlistobj = sina.$(this.dotlistid); if (this.dotlistobj) { var pages = math.round(this.listdiv01.offsetwidth / this.framewidth + 0.4), i, tempobj; for (i = 0; i < pages; i++) { tempobj = document.createelement("span"); this.dotlistobj.appendchild(tempobj); this.dotobjarr.push(tempobj); if (i == this.pageindex) { tempobj.classname = this.dotclassname } else { tempobj.classname = this.dotonclassname }; tempobj.title = "第" + (i + 1) + "页"; sina.addevent(tempobj, "click", function("scrollpic.childs[" + this.id + "].pageto(" + i + ")")) } } }; if (this.autoplay) { this.play() } }; this.leftmousedown = function () { if (_state != "ready") { return }; _state = "floating"; _scrolltimeobj = setinterval("scrollpic.childs[" + this.id + "].moveleft()", this.speed) }; this.rightmousedown = function () { if (_state != "ready") { return }; _state = "floating"; _scrolltimeobj = setinterval("scrollpic.childs[" + this.id + "].moveright()", this.speed) }; this.moveleft = function () { if (this.scrollcontdiv.scrollleft + this.space >= this.listdiv01.scrollwidth) { this.scrollcontdiv.scrollleft = this.scrollcontdiv.scrollleft + this.space - this.listdiv01.scrollwidth } else { this.scrollcontdiv.scrollleft += this.space }; this.accountpageindex() }; this.moveright = function () { if (this.scrollcontdiv.scrollleft - this.space <= 0) { this.scrollcontdiv.scrollleft = this.listdiv01.scrollwidth + this.scrollcontdiv.scrollleft - this.space } else { this.scrollcontdiv.scrollleft -= this.space }; this.accountpageindex() }; this.leftend = function () { if (_state != "floating") { return }; _state = "stoping"; clearinterval(_scrolltimeobj); var fill = this.pagewidth - this.scrollcontdiv.scrollleft % this.pagewidth; this.move(fill) }; this.rightend = function () { if (_state != "floating") { return }; _state = "stoping"; clearinterval(_scrolltimeobj); var fill = -this.scrollcontdiv.scrollleft % this.pagewidth; this.move(fill) }; this.move = function (num, quick) { var thismove = num / 5; if (!quick) { if (thismove > this.space) { thismove = this.space }; if (thismove < -this.space) { thismove = -this.space } }; if (math.abs(thismove) < 1 && thismove != 0) { thismove = thismove >= 0 ? 1 : -1 } else { thismove = math.round(thismove) }; var temp = this.scrollcontdiv.scrollleft + thismove; if (thismove > 0) { if (this.scrollcontdiv.scrollleft + thismove >= this.listdiv01.scrollwidth) { this.scrollcontdiv.scrollleft = this.scrollcontdiv.scrollleft + thismove - this.listdiv01.scrollwidth } else { this.scrollcontdiv.scrollleft += thismove } } else { if (this.scrollcontdiv.scrollleft - thismove <= 0) { this.scrollcontdiv.scrollleft = this.listdiv01.scrollwidth + this.scrollcontdiv.scrollleft - thismove } else { this.scrollcontdiv.scrollleft += thismove } }; num -= thismove; if (math.abs(num) == 0) { _state = "ready"; if (this.autoplay) { this.play() }; this.accountpageindex(); return } else { this.accountpageindex(); settimeout("scrollpic.childs[" + this.id + "].move(" + num + "," + quick + ")", this.speed) } }; this.next = function () { if (_state != "ready") { return }; _state = "stoping"; this.move(this.pagewidth, true) }; this.play = function () { if (!this.autoplay) { return }; clearinterval(_autotimeobj); _autotimeobj = setinterval("scrollpic.childs[" + this.id + "].next()", this.autoplaytime * 1000) }; this.stop = function () { clearinterval(_autotimeobj) }; this.pageto = function (num) { if (_state != "ready") { return }; _state = "stoping"; var fill = num * this.framewidth - this.scrollcontdiv.scrollleft; this.move(fill, true) }; this.accountpageindex = function () { this.pageindex = math.round(this.scrollcontdiv.scrollleft / this.framewidth); if (this.pageindex > math.round(this.listdiv01.offsetwidth / this.framewidth + 0.4) - 1) { this.pageindex = 0 }; var i; for (i = 0; i < this.dotobjarr.length; i++) { if (i == this.pageindex) { this.dotobjarr[i].classname = this.dotclassname } else { this.dotobjarr[i].classname = this.dotonclassname } } } };
//--------------------------------常见问题 js-----------------------------------//
$(function() {
//cache the ticker
var ticker = $("#ticker2");
//wrap dt:dd pairs in divs
ticker.children().filter("li").each(function() {
var dt = $(this),
container = $("
");
dt.next().appendto(container);
dt.prependto(container);
container.appendto(ticker);
});
//hide the scrollbar
ticker.css("overflow", "hidden");
//animator function
function animator(currentitem) {
//work out new anim duration
var distance = currentitem.height();
duration = (distance + parseint(currentitem.css("margintop"))) / 0.025;
//animate the first child of the ticker
currentitem.animate({ margintop: -distance }, duration, "linear", function() {
//move current item to the bottom
currentitem.appendto(currentitem.parent()).css("margintop", 0);
//recurse
animator(currentitem.parent().children(":first"));
});
};
//start the ticker
animator(ticker.children(":first"));
//set mouseenter
ticker.mouseenter(function() {
//stop current animation
ticker.children().stop();
});
//set mouseleave
ticker.mouseleave(function() {
//resume animation
animator(ticker.children(":first"));
});
});
//--------------------------------图片向下滚动 js-----------------------------------//
!function(a){a.fn.slide=function(b){return a.fn.slide.defaults={type:"slide",effect:"fade",autoplay:!1,delaytime:500,intertime:2500,triggertime:150,defaultindex:0,titcell:".hd li",maincell:".bd",targetcell:null,trigger:"mouseover",scroll:1,vis:1,titonclassname:"on",autopage:!1,prevcell:".prev",nextcell:".next",pagestatecell:".pagestate",opp:!1,pnloop:!0,easing:"swing",startfun:null,endfun:null,switchload:null,playstatecell:".playstate",mouseoverstop:!0,defaultplay:!0,returndefault:!1},this.each(function(){var c=a.extend({},a.fn.slide.defaults,b),d=a(this),e=c.effect,f=a(c.prevcell,d),g=a(c.nextcell,d),h=a(c.pagestatecell,d),i=a(c.playstatecell,d),j=a(c.titcell,d),k=j.size(),l=a(c.maincell,d),m=l.children().size(),n=c.switchload,o=a(c.targetcell,d),p=parseint(c.defaultindex),q=parseint(c.delaytime),r=parseint(c.intertime);parseint(c.triggertime);var q,t=parseint(c.scroll),u=parseint(c.vis),v="false"==c.autoplay||0==c.autoplay?!1:!0,w="false"==c.opp||0==c.opp?!1:!0,x="false"==c.autopage||0==c.autopage?!1:!0,y="false"==c.pnloop||0==c.pnloop?!1:!0,z="false"==c.mouseoverstop||0==c.mouseoverstop?!1:!0,a="false"==c.defaultplay||0==c.defaultplay?!1:!0,b="false"==c.returndefault||0==c.returndefault?!1:!0,c=0,d=0,e=0,f=0,g=c.easing,h=null,i=null,j=null,k=c.titonclassname,l=j.index(d.find("."+k)),m=p=-1==l?p:l,n=p,o=p,p=m>=u?0!=m%t?m%t:t:0,r="leftmarquee"==e||"topmarquee"==e?!0:!1,s=function(){a.isfunction(c.startfun)&&c.startfun(p,k,d,a(c.titcell,d),l,o,f,g)},t=function(){a.isfunction(c.endfun)&&c.endfun(p,k,d,a(c.titcell,d),l,o,f,g)},u=function(){j.removeclass(k),a&&j.eq(n).addclass(k)};if("menu"==c.type)return a&&j.removeclass(k).eq(p).addclass(k),j.hover(function(){q=a(this).find(c.targetcell);var b=j.index(a(this));i=settimeout(function(){switch(p=b,j.removeclass(k).eq(p).addclass(k),s(),e){case"fade":q.stop(!0,!0).animate({opacity:"show"},q,g,t);break;case"slidedown":q.stop(!0,!0).animate({height:"show"},q,g,t)}},c.triggertime)},function(){switch(cleartimeout(i),e){case"fade":q.animate({opacity:"hide"},q,g);break;case"slidedown":q.animate({height:"hide"},q,g)}}),b&&d.hover(function(){cleartimeout(j)},function(){j=settimeout(u,q)}),void 0;if(0==k&&(k=m),r&&(k=2),x){if(m>=u)if("leftloop"==e||"toploop"==e)k=0!=m%t?(0^m/t)+1:m/t;else{var v=m-u;k=1+parseint(0!=v%t?v/t+1:v/t),0>=k&&(k=1)}else k=1;j.html("");var w="";if(1==c.autopage||"true"==c.autopage)for(var x=0;k>x;x++)w+="
"+(x+1)+"";else for(var x=0;k>x;x++)w+=c.autopage.replace("$",x+1);j.html(w);var j=j.children()}if(m>=u){l.children().each(function(){a(this).width()>e&&(e=a(this).width(),d=a(this).outerwidth(!0)),a(this).height()>f&&(f=a(this).height(),c=a(this).outerheight(!0))});var y=l.children(),z=function(){for(var a=0;u>a;a++)y.eq(a).clone().addclass("clone").appendto(l);for(var a=0;p>a;a++)y.eq(m-a-1).clone().addclass("clone").prependto(l)};switch(e){case"fold":l.css({position:"relative",width:d,height:c}).children().css({position:"absolute",width:e,left:0,top:0,display:"none"});break;case"top":l.wrap('
').css({top:-(p*t)*c,position:"relative",padding:"0",margin:"0"}).children().css({height:f});break;case"left":l.wrap('
').css({width:m*d,left:-(p*t)*d,position:"relative",overflow:"hidden",padding:"0",margin:"0"}).children().css({"float":"left",width:e});break;case"leftloop":case"leftmarquee":z(),l.wrap('
').css({width:(m+u+p)*d,position:"relative",overflow:"hidden",padding:"0",margin:"0",left:-(p+p*t)*d}).children().css({"float":"left",width:e});break;case"toploop":case"topmarquee":z(),l.wrap('
').css({height:(m+u+p)*c,position:"relative",padding:"0",margin:"0",top:-(p+p*t)*c}).children().css({height:f})}}var $=function(a){var b=a*t;return a==k?b=m:-1==a&&0!=m%t&&(b=-m%t),b},_=function(b){var c=function(c){for(var d=c;u+c>d;d++)b.eq(d).find("img["+n+"]").each(function(){var b=a(this);if(b.attr("src",b.attr(n)).removeattr(n),l.find(".clone")[0])for(var c=l.children(),d=0;d
=1?p=1:0>=p&&(p=0):(o=p,p>=k?p=0:0>p&&(p=k-1)),s(),null!=n&&_(l.children()),o[0]&&(q=o.eq(p),null!=n&&_(o),"slidedown"==e?(o.not(q).stop(!0,!0).slideup(q),q.slidedown(q,g,function(){l[0]||t()})):(o.not(q).stop(!0,!0).hide(),q.animate({opacity:"show"},q,function(){l[0]||t()}))),m>=u)switch(e){case"fade":l.children().stop(!0,!0).eq(p).animate({opacity:"show"},q,g,function(){t()}).siblings().hide();break;case"fold":l.children().stop(!0,!0).eq(p).animate({opacity:"show"},q,g,function(){t()}).siblings().animate({opacity:"hide"},q,g);break;case"top":l.stop(!0,!1).animate({top:-p*t*c},q,g,function(){t()});break;case"left":l.stop(!0,!1).animate({left:-p*t*d},q,g,function(){t()});break;case"leftloop":var b=o;l.stop(!0,!0).animate({left:-($(o)+p)*d},q,g,function(){-1>=b?l.css("left",-(p+(k-1)*t)*d):b>=k&&l.css("left",-p*d),t()});break;case"toploop":var b=o;l.stop(!0,!0).animate({top:-($(o)+p)*c},q,g,function(){-1>=b?l.css("top",-(p+(k-1)*t)*c):b>=k&&l.css("top",-p*c),t()});break;case"leftmarquee":var c=l.css("left").replace("px","");0==p?l.animate({left:++c},0,function(){l.css("left").replace("px","")>=0&&l.css("left",-m*d)}):l.animate({left:--c},0,function(){l.css("left").replace("px","")<=-(m+p)*d&&l.css("left",-p*d)});break;case"topmarquee":var d=l.css("top").replace("px","");0==p?l.animate({top:++d},0,function(){l.css("top").replace("px","")>=0&&l.css("top",-m*c)}):l.animate({top:--d},0,function(){l.css("top").replace("px","")<=-(m+p)*c&&l.css("top",-p*c)})}j.removeclass(k).eq(p).addclass(k),m=p,y||(g.removeclass("nextstop"),f.removeclass("prevstop"),0==p&&f.addclass("prevstop"),p==k-1&&g.addclass("nextstop")),h.html(""+(p+1)+"/"+k)}};a&&ab(!0),b&&d.hover(function(){cleartimeout(j)},function(){j=settimeout(function(){p=n,a?ab():"slidedown"==e?q.slideup(q,u):q.animate({opacity:"hide"},q,u),m=p},300)});var bb=function(a){h=setinterval(function(){w?p--:p++,ab()},a?a:r)},cb=function(a){h=setinterval(ab,a?a:r)},db=function(){z||(clearinterval(h),bb())},eb=function(){(y||p!=k-1)&&(p++,ab(),r||db())},fb=function(){(y||0!=p)&&(p--,ab(),r||db())},gb=function(){clearinterval(h),r?cb():bb(),i.removeclass("pausestate")},hb=function(){clearinterval(h),i.addclass("pausestate")};if(v?r?(w?p--:p++,cb(),z&&l.hover(hb,gb)):(bb(),z&&d.hover(hb,gb)):(r&&(w?p--:p++),i.addclass("pausestate")),i.click(function(){i.hasclass("pausestate")?gb():hb()}),"mouseover"==c.trigger?j.hover(function(){var a=j.index(this);i=settimeout(function(){p=a,ab(),db()},c.triggertime)},function(){cleartimeout(i)}):j.click(function(){p=j.index(this),ab(),db()}),r){if(g.mousedown(eb),f.mousedown(fb),y){var ib,jb=function(){ib=settimeout(function(){clearinterval(h),cb(0^r/10)},150)},kb=function(){cleartimeout(ib),clearinterval(h),cb()};g.mousedown(jb),g.mouseup(kb),f.mousedown(jb),f.mouseup(kb)}"mouseover"==c.trigger&&(g.hover(eb,function(){}),f.hover(fb,function(){}))}else g.click(eb),f.click(fb)})}}(jquery),jquery.easing.jswing=jquery.easing.swing,jquery.extend(jquery.easing,{def:"easeoutquad",swing:function(a,b,c,d,e){return jquery.easing[jquery.easing.def](a,b,c,d,e)},easeinquad:function(a,b,c,d,e){return d*(b/=e)*b+c},easeoutquad:function(a,b,c,d,e){return-d*(b/=e)*(b-2)+c},easeinoutquad:function(a,b,c,d,e){return(b/=e/2)<1?d/2*b*b+c:-d/2*(--b*(b-2)-1)+c},easeincubic:function(a,b,c,d,e){return d*(b/=e)*b*b+c},easeoutcubic:function(a,b,c,d,e){return d*((b=b/e-1)*b*b+1)+c},easeinoutcubic:function(a,b,c,d,e){return(b/=e/2)<1?d/2*b*b*b+c:d/2*((b-=2)*b*b+2)+c},easeinquart:function(a,b,c,d,e){return d*(b/=e)*b*b*b+c},easeoutquart:function(a,b,c,d,e){return-d*((b=b/e-1)*b*b*b-1)+c},easeinoutquart:function(a,b,c,d,e){return(b/=e/2)<1?d/2*b*b*b*b+c:-d/2*((b-=2)*b*b*b-2)+c},easeinquint:function(a,b,c,d,e){return d*(b/=e)*b*b*b*b+c},easeoutquint:function(a,b,c,d,e){return d*((b=b/e-1)*b*b*b*b+1)+c},easeinoutquint:function(a,b,c,d,e){return(b/=e/2)<1?d/2*b*b*b*b*b+c:d/2*((b-=2)*b*b*b*b+2)+c},easeinsine:function(a,b,c,d,e){return-d*math.cos(b/e*(math.pi/2))+d+c},easeoutsine:function(a,b,c,d,e){return d*math.sin(b/e*(math.pi/2))+c},easeinoutsine:function(a,b,c,d,e){return-d/2*(math.cos(math.pi*b/e)-1)+c},easeinexpo:function(a,b,c,d,e){return 0==b?c:d*math.pow(2,10*(b/e-1))+c},easeoutexpo:function(a,b,c,d,e){return b==e?c+d:d*(-math.pow(2,-10*b/e)+1)+c},easeinoutexpo:function(a,b,c,d,e){return 0==b?c:b==e?c+d:(b/=e/2)<1?d/2*math.pow(2,10*(b-1))+c:d/2*(-math.pow(2,-10*--b)+2)+c},easeincirc:function(a,b,c,d,e){return-d*(math.sqrt(1-(b/=e)*b)-1)+c},easeoutcirc:function(a,b,c,d,e){return d*math.sqrt(1-(b=b/e-1)*b)+c},easeinoutcirc:function(a,b,c,d,e){return(b/=e/2)<1?-d/2*(math.sqrt(1-b*b)-1)+c:d/2*(math.sqrt(1-(b-=2)*b)+1)+c},easeinelastic:function(a,b,c,d,e){var f=1.70158,g=0,h=d;if(0==b)return c;if(1==(b/=e))return c+d;if(g||(g=.3*e),hb?-.5*h*math.pow(2,10*(b-=1))*math.sin((b*e-f)*2*math.pi/g)+c:.5*h*math.pow(2,-10*(b-=1))*math.sin((b*e-f)*2*math.pi/g)+d+c},easeinback:function(a,b,c,d,e,f){return void 0==f&&(f=1.70158),d*(b/=e)*b*((f+1)*b-f)+c},easeoutback:function(a,b,c,d,e,f){return void 0==f&&(f=1.70158),d*((b=b/e-1)*b*((f+1)*b+f)+1)+c},easeinoutback:function(a,b,c,d,e,f){return void 0==f&&(f=1.70158),(b/=e/2)<1?d/2*b*b*(((f*=1.525)+1)*b-f)+c:d/2*((b-=2)*b*(((f*=1.525)+1)*b+f)+2)+c},easeinbounce:function(a,b,c,d,e){return d-jquery.easing.easeoutbounce(a,e-b,0,d,e)+c},easeoutbounce:function(a,b,c,d,e){return(b/=e)<1/2.75?d*7.5625*b*b+c:2/2.75>b?d*(7.5625*(b-=1.5/2.75)*b+.75)+c:2.5/2.75>b?d*(7.5625*(b-=2.25/2.75)*b+.9375)+c:d*(7.5625*(b-=2.625/2.75)*b+.984375)+c},easeinoutbounce:function(a,b,c,d,e){return e/2>b?.5*jquery.easing.easeinbounce(a,2*b,0,d,e)+c:.5*jquery.easing.easeoutbounce(a,2*b-e,0,d,e)+.5*d+c}});
//--------------------------------banner js-------------------------------------//
/*
* jquery flexslider v2.2.0
* copyright 2012 woothemes
* contributing author: tyler smith
*/(function(e){e.flexslider=function(t,n){var r=e(t);r.vars=e.extend({},e.flexslider.defaults,n);var i=r.vars.namespace,s=window.navigator&&window.navigator.mspointerenabled&&window.msgesture,o=("ontouchstart"in window||s||window.documenttouch&&document instanceof documenttouch)&&r.vars.touch,u="click touchend mspointerup",a="",f,l=r.vars.direction==="vertical",c=r.vars.reverse,h=r.vars.itemwidth>0,p=r.vars.animation==="fade",d=r.vars.asnavfor!=="",v={},m=!0;e.data(t,"flexslider",r);v={init:function(){r.animating=!1;r.currentslide=parseint(r.vars.startat?r.vars.startat:0);isnan(r.currentslide)&&(r.currentslide=0);r.animatingto=r.currentslide;r.atend=r.currentslide===0||r.currentslide===r.last;r.containerselector=r.vars.selector.substr(0,r.vars.selector.search(" "));r.slides=e(r.vars.selector,r);r.container=e(r.containerselector,r);r.count=r.slides.length;r.syncexists=e(r.vars.sync).length>0;r.vars.animation==="slide"&&(r.vars.animation="swing");r.prop=l?"top":"marginleft";r.args={};r.manualpause=!1;r.stopped=!1;r.started=!1;r.starttimeout=null;r.transitions=!r.vars.video&&!p&&r.vars.usecss&&function(){var e=document.createelement("div"),t=["perspectiveproperty","webkitperspective","mozperspective","operspective","msperspective"];for(var n in t)if(e.style[t[n]]!==undefined){r.pfx=t[n].replace("perspective","").tolowercase();r.prop="-"+r.pfx+"-transform";return!0}return!1}();r.vars.controlscontainer!==""&&(r.controlscontainer=e(r.vars.controlscontainer).length>0&&e(r.vars.controlscontainer));r.vars.manualcontrols!==""&&(r.manualcontrols=e(r.vars.manualcontrols).length>0&&e(r.vars.manualcontrols));if(r.vars.randomize){r.slides.sort(function(){return math.round(math.random())-.5});r.container.empty().append(r.slides)}r.domath();r.setup("init");r.vars.controlnav&&v.controlnav.setup();r.vars.directionnav&&v.directionnav.setup();r.vars.keyboard&&(e(r.containerselector).length===1||r.vars.multiplekeyboard)&&e(document).bind("keyup",function(e){var t=e.keycode;if(!r.animating&&(t===39||t===37)){var n=t===39?r.gettarget("next"):t===37?r.gettarget("prev"):!1;r.flexanimate(n,r.vars.pauseonaction)}});r.vars.mousewheel&&r.bind("mousewheel",function(e,t,n,i){e.preventdefault();var s=t<0?r.gettarget("next"):r.gettarget("prev");r.flexanimate(s,r.vars.pauseonaction)});r.vars.pauseplay&&v.pauseplay.setup();r.vars.slideshow&&r.vars.pauseinvisible&&v.pauseinvisible.init();if(r.vars.slideshow){r.vars.pauseonhover&&r.hover(function(){!r.manualplay&&!r.manualpause&&r.pause()},function(){!r.manualpause&&!r.manualplay&&!r.stopped&&r.play()});if(!r.vars.pauseinvisible||!v.pauseinvisible.ishidden())r.vars.initdelay>0?r.starttimeout=settimeout(r.play,r.vars.initdelay):r.play()}d&&v.asnav.setup();o&&r.vars.touch&&v.touch();(!p||p&&r.vars.smoothheight)&&e(window).bind("resize orientationchange focus",v.resize);r.find("img").attr("draggable","false");settimeout(function(){r.vars.start(r)},200)},asnav:{setup:function(){r.asnav=!0;r.animatingto=math.floor(r.currentslide/r.move);r.currentitem=r.currentslide;r.slides.removeclass(i+"active-slide").eq(r.currentitem).addclass(i+"active-slide");if(!s)r.slides.click(function(t){t.preventdefault();var n=e(this),s=n.index(),o=n.offset().left-e(r).scrollleft();if(o<=0&&n.hasclass(i+"active-slide"))r.flexanimate(r.gettarget("prev"),!0);else if(!e(r.vars.asnavfor).data("flexslider").animating&&!n.hasclass(i+"active-slide")){r.direction=r.currentitem');if(r.pagingcount>1)for(var f=0;f':""+n+"";if("thumbnails"===r.vars.controlnav&&!0===r.vars.thumbcaptions){var l=o.attr("data-thumbcaption");""!=l&&undefined!=l&&(s+=''+l+"")}r.controlnavscaffold.append(""+s+"");n++}r.controlscontainer?e(r.controlscontainer).append(r.controlnavscaffold):r.append(r.controlnavscaffold);v.controlnav.set();v.controlnav.active();r.controlnavscaffold.delegate("a, img",u,function(t){t.preventdefault();if(a===""||a===t.type){var n=e(this),s=r.controlnav.index(n);if(!n.hasclass(i+"active")){r.direction=s>r.currentslide?"next":"prev";r.flexanimate(s,r.vars.pauseonaction)}}a===""&&(a=t.type);v.settoclearwatchedevent()})},setupmanual:function(){r.controlnav=r.manualcontrols;v.controlnav.active();r.controlnav.bind(u,function(t){t.preventdefault();if(a===""||a===t.type){var n=e(this),s=r.controlnav.index(n);if(!n.hasclass(i+"active")){s>r.currentslide?r.direction="next":r.direction="prev";r.flexanimate(s,r.vars.pauseonaction)}}a===""&&(a=t.type);v.settoclearwatchedevent()})},set:function(){var t=r.vars.controlnav==="thumbnails"?"img":"a";r.controlnav=e("."+i+"control-nav li "+t,r.controlscontainer?r.controlscontainer:r)},active:function(){r.controlnav.removeclass(i+"active").eq(r.animatingto).addclass(i+"active")},update:function(t,n){r.pagingcount>1&&t==="add"?r.controlnavscaffold.append(e(""+r.count+"")):r.pagingcount===1?r.controlnavscaffold.find("li").remove():r.controlnav.eq(n).closest("li").remove();v.controlnav.set();r.pagingcount>1&&r.pagingcount!==r.controlnav.length?r.update(n,t):v.controlnav.active()}},directionnav:{setup:function(){var t=e('");if(r.controlscontainer){e(r.controlscontainer).append(t);r.directionnav=e("."+i+"direction-nav li a",r.controlscontainer)}else{r.append(t);r.directionnav=e("."+i+"direction-nav li a",r)}v.directionnav.update();r.directionnav.bind(u,function(t){t.preventdefault();var n;if(a===""||a===t.type){n=e(this).hasclass(i+"next")?r.gettarget("next"):r.gettarget("prev");r.flexanimate(n,r.vars.pauseonaction)}a===""&&(a=t.type);v.settoclearwatchedevent()})},update:function(){var e=i+"disabled";r.pagingcount===1?r.directionnav.addclass(e).attr("tabindex","-1"):r.vars.animationloop?r.directionnav.removeclass(e).removeattr("tabindex"):r.animatingto===0?r.directionnav.removeclass(e).filter("."+i+"prev").addclass(e).attr("tabindex","-1"):r.animatingto===r.last?r.directionnav.removeclass(e).filter("."+i+"next").addclass(e).attr("tabindex","-1"):r.directionnav.removeclass(e).removeattr("tabindex")}},pauseplay:{setup:function(){var t=e('');if(r.controlscontainer){r.controlscontainer.append(t);r.pauseplay=e("."+i+"pauseplay a",r.controlscontainer)}else{r.append(t);r.pauseplay=e("."+i+"pauseplay a",r)}v.pauseplay.update(r.vars.slideshow?i+"pause":i+"play");r.pauseplay.bind(u,function(t){t.preventdefault();if(a===""||a===t.type)if(e(this).hasclass(i+"pause")){r.manualpause=!0;r.manualplay=!1;r.pause()}else{r.manualpause=!1;r.manualplay=!0;r.play()}a===""&&(a=t.type);v.settoclearwatchedevent()})},update:function(e){e==="play"?r.pauseplay.removeclass(i+"pause").addclass(i+"play").html(r.vars.playtext):r.pauseplay.removeclass(i+"play").addclass(i+"pause").html(r.vars.pausetext)}},touch:function(){var e,n,i,o,u,a,f=!1,d=0,v=0,m=0;if(!s){t.addeventlistener("touchstart",g,!1);function g(s){if(r.animating)s.preventdefault();else if(window.navigator.mspointerenabled||s.touches.length===1){r.pause();o=l?r.h:r.w;a=number(new date);d=s.touches[0].pagex;v=s.touches[0].pagey;i=h&&c&&r.animatingto===r.last?0:h&&c?r.limit-(r.itemw+r.vars.itemmargin)*r.move*r.animatingto:h&&r.currentslide===r.last?r.limit:h?(r.itemw+r.vars.itemmargin)*r.move*r.currentslide:c?(r.last-r.currentslide+r.cloneoffset)*o:(r.currentslide+r.cloneoffset)*o;e=l?v:d;n=l?d:v;t.addeventlistener("touchmove",y,!1);t.addeventlistener("touchend",b,!1)}}function y(t){d=t.touches[0].pagex;v=t.touches[0].pagey;u=l?e-v:e-d;f=l?math.abs(u)s){t.preventdefault();if(!p&&r.transitions){r.vars.animationloop||(u/=r.currentslide===0&&u<0||r.currentslide===r.last&&u>0?math.abs(u)/o+2:1);r.setprops(i+u,"settouch")}}}function b(s){t.removeeventlistener("touchmove",y,!1);if(r.animatingto===r.currentslide&&!f&&u!==null){var l=c?-u:u,h=l>0?r.gettarget("next"):r.gettarget("prev");r.canadvance(h)&&(number(new date)-a<550&&math.abs(l)>50||math.abs(l)>o/2)?r.flexanimate(h,r.vars.pauseonaction):p||r.flexanimate(r.currentslide,r.vars.pauseonaction,!0)}t.removeeventlistener("touchend",b,!1);e=null;n=null;u=null;i=null}}else{t.style.mstouchaction="none";t._gesture=new msgesture;t._gesture.target=t;t.addeventlistener("mspointerdown",w,!1);t._slider=r;t.addeventlistener("msgesturechange",e,!1);t.addeventlistener("msgestureend",s,!1);function w(e){e.stoppropagation();if(r.animating)e.preventdefault();else{r.pause();t._gesture.addpointer(e.pointerid);m=0;o=l?r.h:r.w;a=number(new date);i=h&&c&&r.animatingto===r.last?0:h&&c?r.limit-(r.itemw+r.vars.itemmargin)*r.move*r.animatingto:h&&r.currentslide===r.last?r.limit:h?(r.itemw+r.vars.itemmargin)*r.move*r.currentslide:c?(r.last-r.currentslide+r.cloneoffset)*o:(r.currentslide+r.cloneoffset)*o}}function e(e){e.stoppropagation();var n=e.target._slider;if(!n)return;var r=-e.translationx,s=-e.translationy;m+=l?s:r;u=m;f=l?math.abs(m)500){e.preventdefault();if(!p&&n.transitions){n.vars.animationloop||(u=m/(n.currentslide===0&&m<0||n.currentslide===n.last&&m>0?math.abs(m)/o+2:1));n.setprops(i+u,"settouch")}}}function s(t){t.stoppropagation();var r=t.target._slider;if(!r)return;if(r.animatingto===r.currentslide&&!f&&u!==null){var s=c?-u:u,l=s>0?r.gettarget("next"):r.gettarget("prev");r.canadvance(l)&&(number(new date)-a<550&&math.abs(s)>50||math.abs(s)>o/2)?r.flexanimate(l,r.vars.pauseonaction):p||r.flexanimate(r.currentslide,r.vars.pauseonaction,!0)}e=null;n=null;u=null;i=null;m=0}}},resize:function(){if(!r.animating&&r.is(":visible")){h||r.domath();if(p)v.smoothheight();else if(h){r.slides.width(r.computedw);r.update(r.pagingcount);r.setprops()}else if(l){r.viewport.height(r.h);r.setprops(r.h,"settotal")}else{r.vars.smoothheight&&v.smoothheight();r.newslides.width(r.computedw);r.setprops(r.computedw,"settotal")}}},smoothheight:function(e){if(!l||p){var t=p?r:r.viewport;e?t.animate({height:r.slides.eq(r.animatingto).height()},e):t.height(r.slides.eq(r.animatingto).height())}},sync:function(t){var n=e(r.vars.sync).data("flexslider"),i=r.animatingto;switch(t){case"animate":n.flexanimate(i,r.vars.pauseonaction,!1,!0);break;case"play":!n.playing&&!n.asnav&&n.play();break;case"pause":n.pause()}},pauseinvisible:{visprop:null,init:function(){var e=["webkit","moz","ms","o"];if("hidden"in document)return"hidden";for(var t=0;t0?settimeout(r.play,r.vars.initdelay):r.play()})}},ishidden:function(){return document[v.pauseinvisible.visprop]||!1}},settoclearwatchedevent:function(){cleartimeout(f);f=settimeout(function(){a=""},3e3)}};r.flexanimate=function(t,n,s,u,a){!r.vars.animationloop&&t!==r.currentslide&&(r.direction=t>r.currentslide?"next":"prev");d&&r.pagingcount===1&&(r.direction=r.currentitemr.limit&&r.visible!==1?r.limit:b}else r.currentslide===0&&t===r.count-1&&r.vars.animationloop&&r.direction!=="next"?y=c?(r.count+r.cloneoffset)*m:0:r.currentslide===r.last&&t===0&&r.vars.animationloop&&r.direction!=="prev"?y=c?0:(r.count+1)*m:y=c?(r.count-1-t+r.cloneoffset)*m:(t+r.cloneoffset)*m;r.setprops(y,"",r.vars.animationspeed);if(r.transitions){if(!r.vars.animationloop||!r.atend){r.animating=!1;r.currentslide=r.animatingto}r.container.unbind("webkittransitionend transitionend");r.container.bind("webkittransitionend transitionend",function(){r.wrapup(m)})}else r.container.animate(r.args,r.vars.animationspeed,r.vars.easing,function(){r.wrapup(m)})}else if(!o){r.slides.eq(r.currentslide).css({zindex:1}).animate({opacity:0},r.vars.animationspeed,r.vars.easing);r.slides.eq(t).css({zindex:2}).animate({opacity:1},r.vars.animationspeed,r.vars.easing,r.wrapup)}else{r.slides.eq(r.currentslide).css({opacity:0,zindex:1});r.slides.eq(t).css({opacity:1,zindex:2});r.wrapup(m)}r.vars.smoothheight&&v.smoothheight(r.vars.animationspeed)}};r.wrapup=function(e){!p&&!h&&(r.currentslide===0&&r.animatingto===r.last&&r.vars.animationloop?r.setprops(e,"jumpend"):r.currentslide===r.last&&r.animatingto===0&&r.vars.animationloop&&r.setprops(e,"jumpstart"));r.animating=!1;r.currentslide=r.animatingto;r.vars.after(r)};r.animateslides=function(){!r.animating&&m&&r.flexanimate(r.gettarget("next"))};r.pause=function(){clearinterval(r.animatedslides);r.animatedslides=null;r.playing=!1;r.vars.pauseplay&&v.pauseplay.update("play");r.syncexists&&v.sync("pause")};r.play=function(){r.playing&&clearinterval(r.animatedslides);r.animatedslides=r.animatedslides||setinterval(r.animateslides,r.vars.slideshowspeed);r.started=r.playing=!0;r.vars.pauseplay&&v.pauseplay.update("pause");r.syncexists&&v.sync("play")};r.stop=function(){r.pause();r.stopped=!0};r.canadvance=function(e,t){var n=d?r.pagingcount-1:r.last;return t?!0:d&&r.currentitem===r.count-1&&e===0&&r.direction==="prev"?!0:d&&r.currentitem===0&&e===r.pagingcount-1&&r.direction!=="next"?!1:e===r.currentslide&&!d?!1:r.vars.animationloop?!0:r.atend&&r.currentslide===0&&e===n&&r.direction!=="next"?!1:r.atend&&r.currentslide===n&&e===0&&r.direction==="next"?!1:!0};r.gettarget=function(e){r.direction=e;return e==="next"?r.currentslide===r.last?0:r.currentslide+1:r.currentslide===0?r.last:r.currentslide-1};r.setprops=function(e,t,n){var i=function(){var n=e?e:(r.itemw+r.vars.itemmargin)*r.move*r.animatingto,i=function(){if(h)return t==="settouch"?e:c&&r.animatingto===r.last?0:c?r.limit-(r.itemw+r.vars.itemmargin)*r.move*r.animatingto:r.animatingto===r.last?r.limit:n;switch(t){case"settotal":return c?(r.count-1-r.currentslide+r.cloneoffset)*e:(r.currentslide+r.cloneoffset)*e;case"settouch":return c?e:e;case"jumpend":return c?e:r.count*e;case"jumpstart":return c?r.count*e:e;default:return e}}();return i*-1+"px"}();if(r.transitions){i=l?"translate3d(0,"+i+",0)":"translate3d("+i+",0,0)";n=n!==undefined?n/1e3+"s":"0s";r.container.css("-"+r.pfx+"-transition-duration",n)}r.args[r.prop]=i;(r.transitions||n===undefined)&&r.container.css(r.args)};r.setup=function(t){if(!p){var n,s;if(t==="init"){r.viewport=e('').css({overflow:"hidden",position:"relative"}).appendto(r).append(r.container);r.clonecount=0;r.cloneoffset=0;if(c){s=e.makearray(r.slides).reverse();r.slides=e(s);r.container.empty().append(r.slides)}}if(r.vars.animationloop&&!h){r.clonecount=2;r.cloneoffset=1;t!=="init"&&r.container.find(".clone").remove();r.container.append(r.slides.first().clone().addclass("clone").attr("aria-hidden","true")).prepend(r.slides.last().clone().addclass("clone").attr("aria-hidden","true"))}r.newslides=e(r.vars.selector,r);n=c?r.count-1-r.currentslide+r.cloneoffset:r.currentslide+r.cloneoffset;if(l&&!h){r.container.height((r.count+r.clonecount)*200+"%").css("position","absolute").width("100%");settimeout(function(){r.newslides.css({display:"block"});r.domath();r.viewport.height(r.h);r.setprops(n*r.h,"init")},t==="init"?100:0)}else{r.container.width((r.count+r.clonecount)*200+"%");r.setprops(n*r.computedw,"init");settimeout(function(){r.domath();r.newslides.css({width:r.computedw,"float":"left",display:"block"});r.vars.smoothheight&&v.smoothheight()},t==="init"?100:0)}}else{r.slides.css({width:"100%","float":"left",marginright:"-100%",position:"relative"});t==="init"&&(o?r.slides.css({opacity:0,display:"block",webkittransition:"opacity "+r.vars.animationspeed/1e3+"s ease",zindex:1}).eq(r.currentslide).css({opacity:1,zindex:2}):r.slides.css({opacity:0,display:"block",zindex:1}).eq(r.currentslide).css({zindex:2}).animate({opacity:1},r.vars.animationspeed,r.vars.easing));r.vars.smoothheight&&v.smoothheight()}h||r.slides.removeclass(i+"active-slide").eq(r.currentslide).addclass(i+"active-slide")};r.domath=function(){var e=r.slides.first(),t=r.vars.itemmargin,n=r.vars.minitems,i=r.vars.maxitems;r.w=r.viewport===undefined?r.width():r.viewport.width();r.h=e.height();r.boxpadding=e.outerwidth()-e.width();if(h){r.itemt=r.vars.itemwidth+t;r.minw=n?n*r.itemt:r.w;r.maxw=i?i*r.itemt-t:r.w;r.itemw=r.minw>r.w?(r.w-t*(n-1))/n:r.maxwr.w?r.w:r.vars.itemwidth;r.visible=math.floor(r.w/r.itemw);r.move=r.vars.move>0&&r.vars.mover.w?r.itemw*(r.count-1)+t*(r.count-1):(r.itemw+t)*r.count-r.w-t}else{r.itemw=r.w;r.pagingcount=r.count;r.last=r.count-1}r.computedw=r.itemw-r.boxpadding};r.update=function(e,t){r.domath();if(!h){er.controlnav.length)v.controlnav.update("add");else if(t==="remove"&&!h||r.pagingcountr.last){r.currentslide-=1;r.animatingto-=1}v.controlnav.update("remove",r.last)}r.vars.directionnav&&v.directionnav.update()};r.addslide=function(t,n){var i=e(t);r.count+=1;r.last=r.count-1;l&&c?n!==undefined?r.slides.eq(r.count-n).after(i):r.container.prepend(i):n!==undefined?r.slides.eq(n).before(i):r.container.append(i);r.update(n,"add");r.slides=e(r.vars.selector+":not(.clone)",r);r.setup();r.vars.added(r)};r.removeslide=function(t){var n=isnan(t)?r.slides.index(e(t)):t;r.count-=1;r.last=r.count-1;isnan(t)?e(t,r.slides).remove():l&&c?r.slides.eq(r.last).remove():r.slides.eq(t).remove();r.domath();r.update(n,"remove");r.slides=e(r.vars.selector+":not(.clone)",r);r.setup();r.vars.removed(r)};v.init()};e(window).blur(function(e){focused=!1}).focus(function(e){focused=!0});e.flexslider.defaults={namespace:"flex-",selector:".slides > li",animation:"fade",easing:"swing",direction:"horizontal",reverse:!1,animationloop:!0,smoothheight:!1,startat:0,slideshow:!0,slideshowspeed:7e3,animationspeed:600,initdelay:0,randomize:!1,thumbcaptions:!1,pauseonaction:!0,pauseonhover:!1,pauseinvisible:!0,usecss:!0,touch:!0,video:!1,controlnav:!0,directionnav:!0,prevtext:"",nexttext:"",keyboard:!0,multiplekeyboard:!1,mousewheel:!1,pauseplay:!1,pausetext:"pause",playtext:"play",controlscontainer:"",manualcontrols:"",sync:"",asnavfor:"",itemwidth:0,itemmargin:0,minitems:1,maxitems:0,move:0,allowoneslide:!0,start:function(){},before:function(){},after:function(){},end:function(){},added:function(){},removed:function(){}};e.fn.flexslider=function(t){t===undefined&&(t={});if(typeof t=="object")return this.each(function(){var n=e(this),r=t.selector?t.selector:".slides > li",i=n.find(r);if(i.length===1&&t.allowoneslide===!0||i.length===0){i.fadein(400);t.start&&t.start(n)}else n.data("flexslider")===undefined&&new e.flexslider(this,t)});var n=e(this).data("flexslider");switch(t){case"play":n.play();break;case"pause":n.pause();break;case"stop":n.stop();break;case"next":n.flexanimate(n.gettarget("next"),!0);break;case"prev":case"previous":n.flexanimate(n.gettarget("prev"),!0);break;default:typeof t=="number"&&n.flexanimate(t,!0)}}})(jquery);