//--------------------------------收藏js-------------------------------------//
//收藏本页
function addfavorite(surl, stitle){
try{
window.external.addfavorite(surl, stitle);
}
catch(e){
try{
window.sidebar.addpanel(stitle, surl, "");
}
catch(e){
alert("加入收藏失败,请使用ctrl+d进行添加");
};
};
};
//收藏设置页面(首页)
function addtofavorite(){
var d="http://www.btoe.com/";
var c="你的网站名字";
if(document.all){
window.external.addfavorite(d,c);
}else{
if(window.sidebar){
window.sidebar.addpanel(c,d,"");
}else{
alert("对不起,您的浏览器不支持此操作!\n请您使用菜单栏或ctrl+d收藏本站。");
}
}
}
//设为首页
function sethome(obj){
try{
obj.style.behavior='url(#default#homepage)';
obj.sethomepage('http://www.btoe.com/');
}catch(e){
if(window.netscape){
try{
netscape.security.privilegemanager.enableprivilege("universalxpconnect");
}catch(e){
alert("抱歉,此操作被浏览器拒绝!\n\n请在浏览器地址栏输入并回车然后将[signed.applets.codebase_principal_support]设置为'true'");
};
}else{
alert("抱歉,您所使用的浏览器无法完成此操作。\n\n您需要手动设置首页。");
};
};
};
//--------------------------------导航 js-------------------------------------//
function dropmenu(obj){
$(obj).each(function(){
var thespan = $(this);
var themenu = thespan.find(".submenu");
var tarheight = themenu.height();
themenu.css({height:0,opacity:0});
var t1;
function expand() {
cleartimeout(t1);
thespan.find('a').addclass("selected");
themenu.stop().show().animate({height:tarheight,opacity:1},200);
}
function collapse() {
cleartimeout(t1);
t1 = settimeout(function(){
thespan.find('a').removeclass("selected");
themenu.stop().animate({height:0,opacity:0},200,function(){
$(this).css({display:"none"});
});
}, 250);
}
thespan.hover(expand, collapse);
themenu.hover(expand, collapse);
});
}
$(document).ready(function(){
dropmenu(".nav_li");
});
//--------------------------------图片滚动 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-----------------------------------//
$(document).ready(function(){
var $tab_li = $('#tab ul li');
$tab_li.hover(function(){
$(this).addclass('selected').siblings().removeclass('selected');
var index = $tab_li.index(this);
$('div.tab_box > div').eq(index).show().siblings().show();
});
});
//纵向//
$(document).ready(function(){
var $tab_li = $('#tab1 ul li');
$tab_li.hover(function(){
$(this).addclass('selected').siblings().removeclass('selected');
var index = $tab_li.index(this);
$('div.tab_box1 > div').eq(index).show().siblings().show();
});
});
//--------------------------------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);