/*! jquery v1.8.3 jquery.com | jquery.org/license */ (function(e,t){function _(e){var t=m[e]={};return v.each(e.split(y),function(e,n){t[n]=!0}),t}function h(e,n,r){if(r===t&&e.nodetype===1){var i="data-"+n.replace(p,"-$1").tolowercase();r=e.getattribute(i);if(typeof r=="string"){try{r=r==="true"?!0:r==="false"?!1:r==="null"?null:+r+""===r?+r:d.test(r)?v.parsejson(r):r}catch(s){}v.data(e,n,r)}else r=t}return r}function b(e){var t;for(t in e){if(t==="data"&&v.isemptyobject(e[t]))continue;if(t!=="tojson")return!1}return!0}function et(){return!1}function tt(){return!0}function ut(e){return!e||!e.parentnode||e.parentnode.nodetype===11}function at(e,t){do e=e[t];while(e&&e.nodetype!==1);return e}function ft(e,t,n){t=t||0;if(v.isfunction(t))return v.grep(e,function(e,r){var i=!!t.call(e,r,e);return i===n});if(t.nodetype)return v.grep(e,function(e,r){return e===t===n});if(typeof t=="string"){var r=v.grep(e,function(e){return e.nodetype===1});if(it.test(t))return v.filter(t,r,!n);t=v.filter(t,r)}return v.grep(e,function(e,r){return v.inarray(e,t)>=0===n})}function lt(e){var t=ct.split("|"),n=e.createdocumentfragment();if(n.createelement)while(t.length)n.createelement(t.pop());return n}function lt(e,t){return e.getelementsbytagname(t)[0]||e.appendchild(e.ownerdocument.createelement(t))}function at(e,t){if(t.nodetype!==1||!v.hasdata(e))return;var n,r,i,s=v._data(e),o=v._data(t,s),u=s.events;if(u){delete o.handle,o.events={};for(n in u)for(r=0,i=u[n].length;r").appendto(i.body),n=t.css("display");t.remove();if(n==="none"||n===""){pt=i.body.appendchild(pt||v.extend(i.createelement("iframe"),{frameborder:0,width:0,height:0}));if(!ht||!pt.createelement)ht=(pt.contentwindow||pt.contentdocument).document,ht.write(""),ht.close();t=ht.body.appendchild(ht.createelement(e)),n=dt(t,"display"),i.body.removechild(pt)}return wt[e]=n,n}function fn(e,t,n,r){var i;if(v.isarray(t))v.each(t,function(t,i){n||sn.test(e)?r(e,i):fn(e+"["+(typeof i=="object"?t:"")+"]",i,n,r)});else if(!n&&v.type(t)==="object")for(i in t)fn(e+"["+i+"]",t[i],n,r);else r(e,t)}function cn(e){return function(t,n){typeof t!="string"&&(n=t,t="*");var r,i,s,o=t.tolowercase().split(y),u=0,a=o.length;if(v.isfunction(n))for(;u)[^>]*$|#([\w\-]*)$)/,e=/^<(\w+)\s*\/?>(?:<\/\1>|)$/,s=/^[\],:{}\s]*$/,x=/(?:^|:|,)(?:\s*\[)+/g,t=/\\(?:["\\\/bfnrt]|u[\da-fa-f]{4})/g,n=/"[^"\\\r\n]*"|true|false|null|-?(?:\d\d*\.|)\d+(?:[ee][\-+]?\d+|)/g,c=/^-ms-/,k=/-([\da-z])/gi,l=function(e,t){return(t+"").touppercase()},a=function(){i.addeventlistener?(i.removeeventlistener("domcontentloaded",a,!1),v.ready()):i.readystate==="complete"&&(i.detachevent("onreadystatechange",a),v.ready())},o={};v.fn=v.prototype={constructor:v,init:function(e,n,r){var s,o,u,a;if(!e)return this;if(e.nodetype)return this.context=this[0]=e,this.length=1,this;if(typeof e=="string"){e.charat(0)==="<"&&e.charat(e.length-1)===">"&&e.length>=3?s=[null,e,null]:s=w.exec(e);if(s&&(s[1]||!n)){if(s[1])return n=n instanceof v?n[0]:n,a=n&&n.nodetype?n.ownerdocument||n:i,e=v.parsehtml(s[1],a,!0),e.test(s[1])&&v.isplainobject(n)&&this.attr.call(e,n,!0),v.merge(this,e);o=i.getelementbyid(s[2]);if(o&&o.parentnode){if(o.id!==s[2])return r.find(e);this.length=1,this[0]=o}return this.context=i,this.selector=e,this}return!n||n.jquery?(n||r).find(e):this.constructor(n).find(e)}return v.isfunction(e)?r.ready(e):(e.selector!==t&&(this.selector=e.selector,this.context=e.context),v.makearray(e,this))},selector:"",jquery:"1.8.3",length:0,size:function(){return this.length},toarray:function(){return l.call(this)},get:function(e){return e==null?this.toarray():e<0?this[this.length+e]:this[e]},pushstack:function(e,t,n){var r=v.merge(this.constructor(),e);return r.prevobject=this,r.context=this.context,t==="find"?r.selector=this.selector+(this.selector?" ":"")+n:t&&(r.selector=this.selector+"."+t+"("+n+")"),r},each:function(e,t){return v.each(this,e,t)},ready:function(e){return v.ready.promise().done(e),this},eq:function(e){return e=+e,e===-1?this.slice(e):this.slice(e,e+1)},first:function(){return this.eq(0)},last:function(){return this.eq(-1)},slice:function(){return this.pushstack(l.apply(this,arguments),"slice",l.call(arguments).join(","))},map:function(e){return this.pushstack(v.map(this,function(t,n){return e.call(t,n,t)}))},end:function(){return this.prevobject||this.constructor(null)},push:f,sort:[].sort,splice:[].splice},v.fn.init.prototype=v.fn,v.extend=v.fn.extend=function(){var e,n,r,i,s,o,u=arguments[0]||{},a=1,f=arguments.length,l=!1;typeof u=="boolean"&&(l=u,u=arguments[1]||{},a=2),typeof u!="object"&&!v.isfunction(u)&&(u={}),f===a&&(u=this,--a);for(;a0)return;r.resolvewith(i,[v]),v.fn.trigger&&v(i).trigger("ready").off("ready")},isfunction:function(e){return v.type(e)==="function"},isarray:array.isarray||function(e){return v.type(e)==="array"},iswindow:function(e){return e!=null&&e==e.window},isnumeric:function(e){return!isnan(parsefloat(e))&&isfinite(e)},type:function(e){return e==null?string(e):o[h.call(e)]||"object"},isplainobject:function(e){if(!e||v.type(e)!=="object"||e.nodetype||v.iswindow(e))return!1;try{if(e.constructor&&!p.call(e,"constructor")&&!p.call(e.constructor.prototype,"isprototypeof"))return!1}catch(n){return!1}var r;for(r in e);return r===t||p.call(e,r)},isemptyobject:function(e){var t;for(t in e)return!1;return!0},error:function(e){throw new error(e)},parsehtml:function(e,t,n){var r;return!e||typeof e!="string"?null:(typeof t=="boolean"&&(n=t,t=0),t=t||i,(r=e.exec(e))?[t.createelement(r[1])]:(r=v.buildfragment([e],t,n?null:[]),v.merge([],(r.cacheable?v.clone(r.fragment):r.fragment).childnodes)))},parsejson:function(t){if(!t||typeof t!="string")return null;t=v.trim(t);if(e.json&&e.json.parse)return e.json.parse(t);if(s.test(t.replace(t,"@").replace(n,"]").replace(x,"")))return(new function("return "+t))();v.error("invalid json: "+t)},parsexml:function(n){var r,i;if(!n||typeof n!="string")return null;try{e.domparser?(i=new domparser,r=i.parsefromstring(n,"text/xml")):(r=new activexobject("microsoft.xmldom"),r.async="false",r.loadxml(n))}catch(s){r=t}return(!r||!r.documentelement||r.getelementsbytagname("parsererror").length)&&v.error("invalid xml: "+n),r},noop:function(){},globaleval:function(t){t&&g.test(t)&&(e.execscript||function(t){e.eval.call(e,t)})(t)},camelcase:function(e){return e.replace(c,"ms-").replace(k,l)},nodename:function(e,t){return e.nodename&&e.nodename.tolowercase()===t.tolowercase()},each:function(e,n,r){var i,s=0,o=e.length,u=o===t||v.isfunction(e);if(r){if(u){for(i in e)if(n.apply(e[i],r)===!1)break}else for(;s0&&e[0]&&e[a-1]||a===0||v.isarray(e));if(f)for(;u-1)a.splice(n,1),i&&(n<=o&&o--,n<=u&&u--)}),this},has:function(e){return v.inarray(e,a)>-1},empty:function(){return a=[],this},disable:function(){return a=f=n=t,this},disabled:function(){return!a},lock:function(){return f=t,n||c.disable(),this},locked:function(){return!f},firewith:function(e,t){return t=t||[],t=[e,t.slice?t.slice():t],a&&(!r||f)&&(i?f.push(t):l(t)),this},fire:function(){return c.firewith(this,arguments),this},fired:function(){return!!r}};return c},v.extend({deferred:function(e){var t=[["resolve","done",v.callbacks("once memory"),"resolved"],["reject","fail",v.callbacks("once memory"),"rejected"],["notify","progress",v.callbacks("memory")]],n="pending",r={state:function(){return n},always:function(){return i.done(arguments).fail(arguments),this},then:function(){var e=arguments;return v.deferred(function(n){v.each(t,function(t,r){var s=r[0],o=e[t];i[r[1]](v.isfunction(o)?function(){var e=o.apply(this,arguments);e&&v.isfunction(e.promise)?e.promise().done(n.resolve).fail(n.reject).progress(n.notify):n[s+"with"](this===i?n:this,[e])}:n[s])}),e=null}).promise()},promise:function(e){return e!=null?v.extend(e,r):r}},i={};return r.pipe=r.then,v.each(t,function(e,s){var o=s[2],u=s[3];r[s[1]]=o.add,u&&o.add(function(){n=u},t[e^1][2].disable,t[2][2].lock),i[s[0]]=o.fire,i[s[0]+"with"]=o.firewith}),r.promise(i),e&&e.call(i,i),i},when:function(e){var t=0,n=l.call(arguments),r=n.length,i=r!==1||e&&v.isfunction(e.promise)?r:0,s=i===1?e:v.deferred(),o=function(e,t,n){return function(r){t[e]=this,n[e]=arguments.length>1?l.call(arguments):r,n===u?s.notifywith(t,n):--i||s.resolvewith(t,n)}},u,a,f;if(r>1){u=new array(r),a=new array(r),f=new array(r);for(;t
a",n=p.getelementsbytagname("*"),r=p.getelementsbytagname("a")[0];if(!n||!r||!n.length)return{};s=i.createelement("select"),o=s.appendchild(i.createelement("option")),u=p.getelementsbytagname("input")[0],r.style.csstext="top:1px;float:left;opacity:.5",t={leadingwhitespace:p.firstchild.nodetype===3,tbody:!p.getelementsbytagname("tbody").length,htmlserialize:!!p.getelementsbytagname("link").length,style:/top/.test(r.getattribute("style")),hrefnormalized:r.getattribute("href")==="/a",opacity:/^0.5/.test(r.style.opacity),cssfloat:!!r.style.cssfloat,checkon:u.value==="on",optselected:o.selected,getsetattribute:p.classname!=="t",enctype:!!i.createelement("form").enctype,html5clone:i.createelement("nav").clonenode(!0).outerhtml!=="<:nav>",boxmodel:i.compatmode==="css1compat",submitbubbles:!0,changebubbles:!0,focusinbubbles:!1,deleteexpando:!0,nocloneevent:!0,inlineblockneedslayout:!1,shrinkwrapblocks:!1,reliablemarginright:!0,boxsizingreliable:!0,pixelposition:!1},u.checked=!0,t.noclonechecked=u.clonenode(!0).checked,s.disabled=!0,t.optdisabled=!o.disabled;try{delete p.test}catch(d){t.deleteexpando=!1}!p.addeventlistener&&p.attachevent&&p.fireevent&&(p.attachevent("onclick",h=function(){t.nocloneevent=!1}),p.clonenode(!0).fireevent("onclick"),p.detachevent("onclick",h)),u=i.createelement("input"),u.value="t",u.setattribute("type","radio"),t.radiovalue=u.value==="t",u.setattribute("checked","checked"),u.setattribute("name","t"),p.appendchild(u),a=i.createdocumentfragment(),a.appendchild(p.lastchild),t.checkclone=a.clonenode(!0).clonenode(!0).lastchild.checked,t.appendchecked=u.checked,a.removechild(u),a.appendchild(p);if(p.attachevent)for(l in{submit:!0,change:!0,focusin:!0})f="on"+l,c=f in p,c||(p.setattribute(f,"return;"),c=typeof p[f]=="function"),t[l+"bubbles"]=c;return v(function(){var n,r,s,o,u="padding:0;margin:0;border:0;display:block;overflow:hidden;",a=i.getelementsbytagname("body")[0];if(!a)return;n=i.createelement("div"),n.style.csstext="visibility:hidden;border:0;width:0;height:0;position:static;top:0;margin-top:1px",a.insertbefore(n,a.firstchild),r=i.createelement("div"),n.appendchild(r),r.innerhtml="
t
",s=r.getelementsbytagname("td"),s[0].style.csstext="padding:0;margin:0;border:0;display:none",c=s[0].offsetheight===0,s[0].style.display="",s[1].style.display="none",t.reliablehiddenoffsets=c&&s[0].offsetheight===0,r.innerhtml="",r.style.csstext="box-sizing:border-box;-moz-box-sizing:border-box;-webkit-box-sizing:border-box;padding:1px;border:1px;display:block;width:4px;margin-top:1%;position:absolute;top:1%;",t.boxsizing=r.offsetwidth===4,t.doesnotincludemargininbodyoffset=a.offsettop!==1,e.getcomputedstyle&&(t.pixelposition=(e.getcomputedstyle(r,null)||{}).top!=="1%",t.boxsizingreliable=(e.getcomputedstyle(r,null)||{width:"4px"}).width==="4px",o=i.createelement("div"),o.style.csstext=r.style.csstext=u,o.style.marginright=o.style.width="0",r.style.width="1px",r.appendchild(o),t.reliablemarginright=!parsefloat((e.getcomputedstyle(o,null)||{}).marginright)),typeof r.style.zoom!="undefined"&&(r.innerhtml="",r.style.csstext=u+"width:1px;padding:1px;display:inline;zoom:1",t.inlineblockneedslayout=r.offsetwidth===3,r.style.display="block",r.style.overflow="visible",r.innerhtml="
",r.firstchild.style.width="5px",t.shrinkwrapblocks=r.offsetwidth!==3,n.style.zoom=1),a.removechild(n),n=r=s=o=null}),a.removechild(p),n=r=s=o=u=a=p=null,t}();var d=/(?:\{[\s\s]*\}|\[[\s\s]*\])$/,p=/([a-z])/g;v.extend({cache:{},deletedids:[],uuid:0,expando:"jquery"+(v.fn.jquery+math.random()).replace(/\d/g,""),nodata:{embed:!0,object:"clsid:d27cdb6e-ae6d-11cf-96b8-444553540000",applet:!0},hasdata:function(e){return e=e.nodetype?v.cache[e[v.expando]]:e[v.expando],!!e&&!b(e)},data:function(e,n,r,i){if(!v.acceptdata(e))return;var s,o,u=v.expando,a=typeof n=="string",f=e.nodetype,l=f?v.cache:e,c=f?e[u]:e[u]&&u;if((!c||!l[c]||!i&&!l[c].data)&&a&&r===t)return;c||(f?e[u]=c=v.deletedids.pop()||v.guid++:c=u),l[c]||(l[c]={},f||(l[c].tojson=v.noop));if(typeof n=="object"||typeof n=="function")i?l[c]=v.extend(l[c],n):l[c].data=v.extend(l[c].data,n);return s=l[c],i||(s.data||(s.data={}),s=s.data),r!==t&&(s[v.camelcase(n)]=r),a?(o=s[n],o==null&&(o=s[v.camelcase(n)])):o=s,o},removedata:function(e,t,n){if(!v.acceptdata(e))return;var r,i,s,o=e.nodetype,u=o?v.cache:e,a=o?e[v.expando]:v.expando;if(!u[a])return;if(t){r=n?u[a]:u[a].data;if(r){v.isarray(t)||(t in r?t=[t]:(t=v.camelcase(t),t in r?t=[t]:t=t.split(" ")));for(i=0,s=t.length;i1,null,!1))},removedata:function(e){return this.each(function(){v.removedata(this,e)})}}),v.extend({queue:function(e,t,n){var r;if(e)return t=(t||"fx")+"queue",r=v._data(e,t),n&&(!r||v.isarray(n)?r=v._data(e,t,v.makearray(n)):r.push(n)),r||[]},dequeue:function(e,t){t=t||"fx";var n=v.queue(e,t),r=n.length,i=n.shift(),s=v._queuehooks(e,t),o=function(){v.dequeue(e,t)};i==="inprogress"&&(i=n.shift(),r--),i&&(t==="fx"&&n.unshift("inprogress"),delete s.stop,i.call(e,o,s)),!r&&s&&s.empty.fire()},_queuehooks:function(e,t){var n=t+"queuehooks";return v._data(e,n)||v._data(e,n,{empty:v.callbacks("once memory").add(function(){v.removedata(e,t+"queue",!0),v.removedata(e,n,!0)})})}}),v.fn.extend({queue:function(e,n){var r=2;return typeof e!="string"&&(n=e,e="fx",r--),arguments.length1)},removeattr:function(e){return this.each(function(){v.removeattr(this,e)})},prop:function(e,t){return v.access(this,v.prop,e,t,arguments.length>1)},removeprop:function(e){return e=v.propfix[e]||e,this.each(function(){try{this[e]=t,delete this[e]}catch(n){}})},addclass:function(e){var t,n,r,i,s,o,u;if(v.isfunction(e))return this.each(function(t){v(this).addclass(e.call(this,t,this.classname))});if(e&&typeof e=="string"){t=e.split(y);for(n=0,r=this.length;n=0)r=r.replace(" "+n[s]+" "," ");i.classname=e?v.trim(r):""}}}return this},toggleclass:function(e,t){var n=typeof e,r=typeof t=="boolean";return v.isfunction(e)?this.each(function(n){v(this).toggleclass(e.call(this,n,this.classname,t),t)}):this.each(function(){if(n==="string"){var i,s=0,o=v(this),u=t,a=e.split(y);while(i=a[s++])u=r?u:!o.hasclass(i),o[u?"addclass":"removeclass"](i)}else if(n==="undefined"||n==="boolean")this.classname&&v._data(this,"__classname__",this.classname),this.classname=this.classname||e===!1?"":v._data(this,"__classname__")||""})},hasclass:function(e){var t=" "+e+" ",n=0,r=this.length;for(;n=0)return!0;return!1},val:function(e){var n,r,i,s=this[0];if(!arguments.length){if(s)return n=v.valhooks[s.type]||v.valhooks[s.nodename.tolowercase()],n&&"get"in n&&(r=n.get(s,"value"))!==t?r:(r=s.value,typeof r=="string"?r.replace(r,""):r==null?"":r);return}return i=v.isfunction(e),this.each(function(r){var s,o=v(this);if(this.nodetype!==1)return;i?s=e.call(this,r,o.val()):s=e,s==null?s="":typeof s=="number"?s+="":v.isarray(s)&&(s=v.map(s,function(e){return e==null?"":e+""})),n=v.valhooks[this.type]||v.valhooks[this.nodename.tolowercase()];if(!n||!("set"in n)||n.set(this,s,"value")===t)this.value=s})}}),v.extend({valhooks:{option:{get:function(e){var t=e.attributes.value;return!t||t.specified?e.value:e.text}},select:{get:function(e){var t,n,r=e.options,i=e.selectedindex,s=e.type==="select-one"||i<0,o=s?null:[],u=s?i+1:r.length,a=i<0?u:s?i:0;for(;a=0}),n.length||(e.selectedindex=-1),n}}},attrfn:{},attr:function(e,n,r,i){var s,o,u,a=e.nodetype;if(!e||a===3||a===8||a===2)return;if(i&&v.isfunction(v.fn[n]))return v(e)[n](r);if(typeof e.getattribute=="undefined")return v.prop(e,n,r);u=a!==1||!v.isxmldoc(e),u&&(n=n.tolowercase(),o=v.attrhooks[n]||(x.test(n)?f:j));if(r!==t){if(r===null){v.removeattr(e,n);return}return o&&"set"in o&&u&&(s=o.set(e,r,n))!==t?s:(e.setattribute(n,r+""),r)}return o&&"get"in o&&u&&(s=o.get(e,n))!==null?s:(s=e.getattribute(n),s===null?t:s)},removeattr:function(e,t){var n,r,i,s,o=0;if(t&&e.nodetype===1){r=t.split(y);for(;o=0}})});var $=/^(?:textarea|input|select)$/i,j=/^([^\.]*|)(?:\.(.+)|)$/,k=/(?:^|\s)hover(\.\s+|)\b/,q=/^key/,g=/^(?:mouse|contextmenu)|click/,y=/^(?:focusinfocus|focusoutblur)$/,z=function(e){return v.event.special.hover?e:e.replace(k,"mouseenter$1 mouseleave$1")};v.event={add:function(e,n,r,i,s){var o,u,a,f,l,c,h,p,d,m,g;if(e.nodetype===3||e.nodetype===8||!n||!r||!(o=v._data(e)))return;r.handler&&(d=r,r=d.handler,s=d.selector),r.guid||(r.guid=v.guid++),a=o.events,a||(o.events=a={}),u=o.handle,u||(o.handle=u=function(e){return typeof v=="undefined"||!!e&&v.event.triggered===e.type?t:v.event.dispatch.apply(u.elem,arguments)},u.elem=e),n=v.trim(z(n)).split(" ");for(f=0;f=0&&(y=y.slice(0,-1),a=!0),y.indexof(".")>=0&&(b=y.split("."),y=b.shift(),b.sort());if((!s||v.event.customevent[y])&&!v.event.global[y])return;n=typeof n=="object"?n[v.expando]?n:new v.event(y,n):new v.event(y),n.type=y,n.istrigger=!0,n.exclusive=a,n.namespace=b.join("."),n.namespace_re=n.namespace?new regexp("(^|\\.)"+b.join("\\.(?:.*\\.|)")+"(\\.|$)"):null,h=y.indexof(":")<0?"on"+y:"";if(!s){u=v.cache;for(f in u)u[f].events&&u[f].events[y]&&v.event.trigger(n,r,u[f].handle.elem,!0);return}n.result=t,n.target||(n.target=s),r=r!=null?v.makearray(r):[],r.unshift(n),p=v.event.special[y]||{};if(p.trigger&&p.trigger.apply(s,r)===!1)return;m=[[s,p.bindtype||y]];if(!o&&!p.nobubble&&!v.iswindow(s)){g=p.delegatetype||y,l=y.test(g+y)?s:s.parentnode;for(c=s;l;l=l.parentnode)m.push([l,g]),c=l;c===(s.ownerdocument||i)&&m.push([c.defaultview||c.parentwindow||e,g])}for(f=0;f=0:v.find(h,this,null,[s]).length),u[h]&&f.push(c);f.length&&w.push({elem:s,matches:f})}d.length>m&&w.push({elem:this,matches:d.slice(m)});for(r=0;r0?this.on(t,null,e,n):this.trigger(t)},q.test(t)&&(v.event.fixhooks[t]=v.event.keyhooks),g.test(t)&&(v.event.fixhooks[t]=v.event.mousehooks)}),function(e,t){function nt(e,t,n,r){n=n||[],t=t||g;var i,s,a,f,l=t.nodetype;if(!e||typeof e!="string")return n;if(l!==1&&l!==9)return[];a=o(t);if(!a&&!r)if(i=r.exec(e))if(f=i[1]){if(l===9){s=t.getelementbyid(f);if(!s||!s.parentnode)return n;if(s.id===f)return n.push(s),n}else if(t.ownerdocument&&(s=t.ownerdocument.getelementbyid(f))&&u(t,s)&&s.id===f)return n.push(s),n}else{if(i[2])return s.apply(n,x.call(t.getelementsbytagname(e),0)),n;if((f=i[3])&&z&&t.getelementsbyclassname)return s.apply(n,x.call(t.getelementsbyclassname(f),0)),n}return vt(e.replace(j,"$1"),t,n,r,a)}function rt(e){return function(t){var n=t.nodename.tolowercase();return n==="input"&&t.type===e}}function it(e){return function(t){var n=t.nodename.tolowercase();return(n==="input"||n==="button")&&t.type===e}}function st(e){return n(function(t){return t=+t,n(function(n,r){var i,s=e([],n.length,t),o=s.length;while(o--)n[i=s[o]]&&(n[i]=!(r[i]=n[i]))})})}function ot(e,t,n){if(e===t)return n;var r=e.nextsibling;while(r){if(r===t)return-1;r=r.nextsibling}return 1}function ut(e,t){var n,r,s,o,u,a,f,l=l[d][e+" "];if(l)return t?0:l.slice(0);u=e,a=[],f=i.prefilter;while(u){if(!n||(r=f.exec(u)))r&&(u=u.slice(r[0].length)||u),a.push(s=[]);n=!1;if(r=i.exec(u))s.push(n=new m(r.shift())),u=u.slice(n.length),n.type=r[0].replace(j," ");for(o in i.filter)(r=j[o].exec(u))&&(!f[o]||(r=f[o](r)))&&(s.push(n=new m(r.shift())),u=u.slice(n.length),n.type=o,n.matches=r);if(!n)break}return t?u.length:u?nt.error(e):l(e,a).slice(0)}function at(e,t,r){var i=t.dir,s=r&&t.dir==="parentnode",o=w++;return t.first?function(t,n,r){while(t=t[i])if(s||t.nodetype===1)return e(t,n,r)}:function(t,r,u){if(!u){var a,f=b+" "+o+" ",l=f+n;while(t=t[i])if(s||t.nodetype===1){if((a=t[d])===l)return t.sizset;if(typeof a=="string"&&a.indexof(f)===0){if(t.sizset)return t}else{t[d]=l;if(e(t,r,u))return t.sizset=!0,t;t.sizset=!1}}}else while(t=t[i])if(s||t.nodetype===1)if(e(t,r,u))return t}}function ft(e){return e.length>1?function(t,n,r){var i=e.length;while(i--)if(!e[i](t,n,r))return!1;return!0}:e[0]}function lt(e,t,n,r,i){var s,o=[],u=0,a=e.length,f=t!=null;for(;u-1&&(s[f]=!(o[f]=c))}}else g=lt(g===o?g.splice(d,g.length):g),i?i(null,o,g,a):s.apply(o,g)})}function ht(e){var t,n,r,s=e.length,o=i.relative[e[0].type],u=o||i.relative[" "],a=o?1:0,f=at(function(e){return e===t},u,!0),l=at(function(e){return t.call(t,e)>-1},u,!0),h=[function(e,n,r){return!o&&(r||n!==c)||((t=n).nodetype?f(e,n,r):l(e,n,r))}];for(;a1&&ft(h),a>1&&e.slice(0,a-1).join("").replace(j,"$1"),n,a0,s=e.length>0,o=function(u,a,f,l,h){var p,d,v,m=[],y=0,w="0",x=u&&[],t=h!=null,n=c,c=u||s&&i.find.tag("*",h&&a.parentnode||a),k=b+=n==null?1:math.e;t&&(c=a!==g&&a,n=o.el);for(;(p=c[w])!=null;w++){if(s&&p){for(d=0;v=e[d];d++)if(v(p,a,f)){l.push(p);break}t&&(b=k,n=++o.el)}r&&((p=!v&&p)&&y--,u&&x.push(p))}y+=w;if(r&&w!==y){for(d=0;v=t[d];d++)v(x,m,a,f);if(u){if(y>0)while(w--)!x[w]&&!m[w]&&(m[w]=e.call(l));m=lt(m)}s.apply(l,m),t&&!u&&m.length>0&&y+t.length>1&&nt.uniquesort(l)}return t&&(b=k,c=n),x};return o.el=0,r?n(o):o}function dt(e,t,n){var r=0,i=t.length;for(;r2&&(f=u[0]).type==="id"&&t.nodetype===9&&!s&&i.relative[u[1].type]){t=i.find.id(f.matches[0].replace($,""),t,s)[0];if(!t)return n;e=e.slice(u.shift().length)}for(o=j.pos.test(e)?-1:u.length-1;o>=0;o--){f=u[o];if(i.relative[l=f.type])break;if(c=i.find[l])if(r=c(f.matches[0].replace($,""),z.test(u[0].type)&&t.parentnode||t,s)){u.splice(o,1),e=r.length&&u.join("");if(!e)return s.apply(n,x.call(r,0)),n;break}}}return a(e,h)(r,t,s,n,z.test(e)),n}function mt(){}var n,r,i,s,o,u,a,f,l,c,h=!0,p="undefined",d=("sizcache"+math.random()).replace(".",""),m=string,g=e.document,y=g.documentelement,b=0,w=0,e=[].pop,s=[].push,x=[].slice,t=[].indexof||function(e){var t=0,n=this.length;for(;ti.cachelength&&delete e[t.shift()],e[n+" "]=r},e)},k=c(),l=c(),a=c(),o="[\\x20\\t\\r\\n\\f]",m="(?:\\\\.|[-\\w]|[^\\x00-\\xa0])+",_=m.replace("w","w#"),d="([*^$|!~]?=)",p="\\["+o+"*("+m+")"+o+"*(?:"+d+o+"*(?:(['\"])((?:\\\\.|[^\\\\])*?)\\3|("+_+")|)|)"+o+"*\\]",h=":("+m+")(?:\\((?:(['\"])((?:\\\\.|[^\\\\])*?)\\2|([^()[\\]]*|(?:(?:"+p+")|[^:]|\\\\.)*|.*))\\)|)",b=":(even|odd|eq|gt|lt|nth|first|last)(?:\\("+o+"*((?:-\\d)?\\d*)"+o+"*\\)|)(?=[^-]|$)",j=new regexp("^"+o+"+|((?:^|[^\\\\])(?:\\\\.)*)"+o+"+$","g"),f=new regexp("^"+o+"*,"+o+"*"),i=new regexp("^"+o+"*([\\x20\\t\\r\\n\\f>+~])"+o+"*"),q=new regexp(h),r=/^(?:#([\w\-]+)|(\w+)|\.([\w\-]+))$/,u=/^:not/,z=/[\x20\t\r\n\f]*[+~]/,w=/:not\($/,x=/h\d/i,v=/input|select|textarea|button/i,$=/\\(?!\\)/g,j={id:new regexp("^#("+m+")"),class:new regexp("^\\.("+m+")"),name:new regexp("^\\[name=['\"]?("+m+")['\"]?\\]"),tag:new regexp("^("+m.replace("w","w*")+")"),attr:new regexp("^"+p),pseudo:new regexp("^"+h),pos:new regexp(b,"i"),child:new regexp("^:(only|nth|first|last)-child(?:\\("+o+"*(even|odd|(([+-]|)(\\d*)n|)"+o+"*(?:([+-]|)"+o+"*(\\d+)|))"+o+"*\\)|)","i"),needscontext:new regexp("^"+o+"*[>+~]|"+b,"i")},k=function(e){var t=g.createelement("div");try{return e(t)}catch(n){return!1}finally{t=null}},q=k(function(e){return e.appendchild(g.createcomment("")),!e.getelementsbytagname("*").length}),g=k(function(e){return e.innerhtml="",e.firstchild&&typeof e.firstchild.getattribute!==p&&e.firstchild.getattribute("href")==="#"}),y=k(function(e){e.innerhtml="";var t=typeof e.lastchild.getattribute("multiple");return t!=="boolean"&&t!=="string"}),z=k(function(e){return e.innerhtml="",!e.getelementsbyclassname||!e.getelementsbyclassname("e").length?!1:(e.lastchild.classname="e",e.getelementsbyclassname("e").length===2)}),et=k(function(e){e.id=d+0,e.innerhtml="
",y.insertbefore(e,y.firstchild);var t=g.getelementsbyname&&g.getelementsbyname(d).length===2+g.getelementsbyname(d+0).length;return r=!g.getelementbyid(d),y.removechild(e),t});try{x.call(y.childnodes,0)[0].nodetype}catch(tt){x=function(e){var t,n=[];for(;t=this[e];e++)n.push(t);return n}}nt.matches=function(e,t){return nt(e,null,null,t)},nt.matchesselector=function(e,t){return nt(t,null,null,[e]).length>0},s=nt.gettext=function(e){var t,n="",r=0,i=e.nodetype;if(i){if(i===1||i===9||i===11){if(typeof e.textcontent=="string")return e.textcontent;for(e=e.firstchild;e;e=e.nextsibling)n+=s(e)}else if(i===3||i===4)return e.nodevalue}else for(;t=e[r];r++)n+=s(t);return n},o=nt.isxml=function(e){var t=e&&(e.ownerdocument||e).documentelement;return t?t.nodename!=="html":!1},u=nt.contains=y.contains?function(e,t){var n=e.nodetype===9?e.documentelement:e,r=t&&t.parentnode;return e===r||!!(r&&r.nodetype===1&&n.contains&&n.contains(r))}:y.comparedocumentposition?function(e,t){return t&&!!(e.comparedocumentposition(t)&16)}:function(e,t){while(t=t.parentnode)if(t===e)return!0;return!1},nt.attr=function(e,t){var n,r=o(e);return r||(t=t.tolowercase()),(n=i.attrhandle[t])?n(e):r||y?e.getattribute(t):(n=e.getattributenode(t),n?typeof e[t]=="boolean"?e[t]?t:null:n.specified?n.value:null:null)},i=nt.selectors={cachelength:50,createpseudo:n,match:j,attrhandle:g?{}:{href:function(e){return e.getattribute("href",2)},type:function(e){return e.getattribute("type")}},find:{id:r?function(e,t,n){if(typeof t.getelementbyid!==p&&!n){var r=t.getelementbyid(e);return r&&r.parentnode?[r]:[]}}:function(e,n,r){if(typeof n.getelementbyid!==p&&!r){var i=n.getelementbyid(e);return i?i.id===e||typeof i.getattributenode!==p&&i.getattributenode("id").value===e?[i]:t:[]}},tag:q?function(e,t){if(typeof t.getelementsbytagname!==p)return t.getelementsbytagname(e)}:function(e,t){var n=t.getelementsbytagname(e);if(e==="*"){var r,i=[],s=0;for(;r=n[s];s++)r.nodetype===1&&i.push(r);return i}return n},name:et&&function(e,t){if(typeof t.getelementsbyname!==p)return t.getelementsbyname(name)},class:z&&function(e,t,n){if(typeof t.getelementsbyclassname!==p&&!n)return t.getelementsbyclassname(e)}},relative:{">":{dir:"parentnode",first:!0}," ":{dir:"parentnode"},"+":{dir:"previoussibling",first:!0},"~":{dir:"previoussibling"}},prefilter:{attr:function(e){return e[1]=e[1].replace($,""),e[3]=(e[4]||e[5]||"").replace($,""),e[2]==="~="&&(e[3]=" "+e[3]+" "),e.slice(0,4)},child:function(e){return e[1]=e[1].tolowercase(),e[1]==="nth"?(e[2]||nt.error(e[0]),e[3]=+(e[3]?e[4]+(e[5]||1):2*(e[2]==="even"||e[2]==="odd")),e[4]=+(e[6]+e[7]||e[2]==="odd")):e[2]&&nt.error(e[0]),e},pseudo:function(e){var t,n;if(j.child.test(e[0]))return null;if(e[3])e[2]=e[3];else if(t=e[4])q.test(t)&&(n=ut(t,!0))&&(n=t.indexof(")",t.length-n)-t.length)&&(t=t.slice(0,n),e[0]=e[0].slice(0,n)),e[2]=t;return e.slice(0,3)}},filter:{id:r?function(e){return e=e.replace($,""),function(t){return t.getattribute("id")===e}}:function(e){return e=e.replace($,""),function(t){var n=typeof t.getattributenode!==p&&t.getattributenode("id");return n&&n.value===e}},tag:function(e){return e==="*"?function(){return!0}:(e=e.replace($,"").tolowercase(),function(t){return t.nodename&&t.nodename.tolowercase()===e})},class:function(e){var t=k[d][e+" "];return t||(t=new regexp("(^|"+o+")"+e+"("+o+"|$)"))&&k(e,function(e){return t.test(e.classname||typeof e.getattribute!==p&&e.getattribute("class")||"")})},attr:function(e,t,n){return function(r,i){var s=nt.attr(r,e);return s==null?t==="!=":t?(s+="",t==="="?s===n:t==="!="?s!==n:t==="^="?n&&s.indexof(n)===0:t==="*="?n&&s.indexof(n)>-1:t==="$="?n&&s.substr(s.length-n.length)===n:t==="~="?(" "+s+" ").indexof(n)>-1:t==="|="?s===n||s.substr(0,n.length+1)===n+"-":!1):!0}},child:function(e,t,n,r){return e==="nth"?function(e){var t,i,s=e.parentnode;if(n===1&&r===0)return!0;if(s){i=0;for(t=s.firstchild;t;t=t.nextsibling)if(t.nodetype===1){i++;if(e===t)break}}return i-=r,i===n||i%n===0&&i/n>=0}:function(t){var n=t;switch(e){case"only":case"first":while(n=n.previoussibling)if(n.nodetype===1)return!1;if(e==="first")return!0;n=t;case"last":while(n=n.nextsibling)if(n.nodetype===1)return!1;return!0}}},pseudo:function(e,t){var n,r=i.pseudos[e]||i.setfilters[e.tolowercase()]||nt.error("unsupported pseudo: "+e);return r[d]?r(t):r.length>1?(n=[e,e,"",t],i.setfilters.hasownproperty(e.tolowercase())?n(function(e,n){var i,s=r(e,t),o=s.length;while(o--)i=t.call(e,s[o]),e[i]=!(n[i]=s[o])}):function(e){return r(e,0,n)}):r}},pseudos:{not:n(function(e){var t=[],n=[],r=a(e.replace(j,"$1"));return r[d]?n(function(e,t,n,i){var s,o=r(e,null,i,[]),u=e.length;while(u--)if(s=o[u])e[u]=!(t[u]=s)}):function(e,i,s){return t[0]=e,r(t,null,s,n),!n.pop()}}),has:n(function(e){return function(t){return nt(e,t).length>0}}),contains:n(function(e){return function(t){return(t.textcontent||t.innertext||s(t)).indexof(e)>-1}}),enabled:function(e){return e.disabled===!1},disabled:function(e){return e.disabled===!0},checked:function(e){var t=e.nodename.tolowercase();return t==="input"&&!!e.checked||t==="option"&&!!e.selected},selected:function(e){return e.parentnode&&e.parentnode.selectedindex,e.selected===!0},parent:function(e){return!i.pseudos.empty(e)},empty:function(e){var t;e=e.firstchild;while(e){if(e.nodename>"@"||(t=e.nodetype)===3||t===4)return!1;e=e.nextsibling}return!0},header:function(e){return x.test(e.nodename)},text:function(e){var t,n;return e.nodename.tolowercase()==="input"&&(t=e.type)==="text"&&((n=e.getattribute("type"))==null||n.tolowercase()===t)},radio:rt("radio"),checkbox:rt("checkbox"),file:rt("file"),password:rt("password"),image:rt("image"),submit:it("submit"),reset:it("reset"),button:function(e){var t=e.nodename.tolowercase();return t==="input"&&e.type==="button"||t==="button"},input:function(e){return v.test(e.nodename)},focus:function(e){var t=e.ownerdocument;return e===t.activeelement&&(!t.hasfocus||t.hasfocus())&&!!(e.type||e.href||~e.tabindex)},active:function(e){return e===e.ownerdocument.activeelement},first:st(function(){return[0]}),last:st(function(e,t){return[t-1]}),eq:st(function(e,t,n){return[n<0?n+t:n]}),even:st(function(e,t){for(var n=0;n=0;)e.push(r);return e}),gt:st(function(e,t,n){for(var r=n<0?n+t:n;++r",e.queryselectorall("[selected]").length||i.push("\\["+o+"*(?:checked|disabled|ismap|multiple|readonly|selected|value)"),e.queryselectorall(":checked").length||i.push(":checked")}),k(function(e){e.innerhtml="

",e.queryselectorall("[test^='']").length&&i.push("[*^$]="+o+"*(?:\"\"|'')"),e.innerhtml="",e.queryselectorall(":enabled").length||i.push(":enabled",":disabled")}),i=new regexp(i.join("|")),vt=function(e,r,s,o,u){if(!o&&!u&&!i.test(e)){var a,f,l=!0,c=d,h=r,p=r.nodetype===9&&e;if(r.nodetype===1&&r.nodename.tolowercase()!=="object"){a=ut(e),(l=r.getattribute("id"))?c=l.replace(n,"\\$&"):r.setattribute("id",c),c="[id='"+c+"'] ",f=a.length;while(f--)a[f]=c+a[f].join("");h=z.test(e)&&r.parentnode||r,p=a.join(",")}if(p)try{return s.apply(s,x.call(h.queryselectorall(p),0)),s}catch(v){}finally{l||r.removeattribute("id")}}return t(e,r,s,o,u)},u&&(k(function(t){e=u.call(t,"div");try{u.call(t,"[test!='']:sizzle"),s.push("!=",h)}catch(n){}}),s=new regexp(s.join("|")),nt.matchesselector=function(t,n){n=n.replace(r,"='$1']");if(!o(t)&&!s.test(n)&&!i.test(n))try{var a=u.call(t,n);if(a||e||t.document&&t.document.nodetype!==11)return a}catch(f){}return nt(n,null,null,[t]).length>0})}(),i.pseudos.nth=i.pseudos.eq,i.filters=mt.prototype=i.pseudos,i.setfilters=new mt,nt.attr=v.attr,v.find=nt,v.expr=nt.selectors,v.expr[":"]=v.expr.pseudos,v.unique=nt.uniquesort,v.text=nt.gettext,v.isxmldoc=nt.isxml,v.contains=nt.contains}(e);var nt=/until$/,rt=/^(?:parents|prev(?:until|all))/,it=/^.[^:#\[\.,]*$/,st=v.expr.match.needscontext,ot={children:!0,contents:!0,next:!0,prev:!0};v.fn.extend({find:function(e){var t,n,r,i,s,o,u=this;if(typeof e!="string")return v(e).filter(function(){for(t=0,n=u.length;t0)for(i=r;i=0:v.filter(e,this).length>0:this.filter(e).length>0)},closest:function(e,t){var n,r=0,i=this.length,s=[],o=st.test(e)||typeof e!="string"?v(e,t||this.context):0;for(;r-1:v.find.matchesselector(n,e)){s.push(n);break}n=n.parentnode}}return s=s.length>1?v.unique(s):s,this.pushstack(s,"closest",e)},index:function(e){return e?typeof e=="string"?v.inarray(this[0],v(e)):v.inarray(e.jquery?e[0]:e,this):this[0]&&this[0].parentnode?this.prevall().length:-1},add:function(e,t){var n=typeof e=="string"?v(e,t):v.makearray(e&&e.nodetype?[e]:e),r=v.merge(this.get(),n);return this.pushstack(ut(n[0])||ut(r[0])?r:v.unique(r))},addback:function(e){return this.add(e==null?this.prevobject:this.prevobject.filter(e))}}),v.fn.andself=v.fn.addback,v.each({parent:function(e){var t=e.parentnode;return t&&t.nodetype!==11?t:null},parents:function(e){return v.dir(e,"parentnode")},parentsuntil:function(e,t,n){return v.dir(e,"parentnode",n)},next:function(e){return at(e,"nextsibling")},prev:function(e){return at(e,"previoussibling")},nextall:function(e){return v.dir(e,"nextsibling")},prevall:function(e){return v.dir(e,"previoussibling")},nextuntil:function(e,t,n){return v.dir(e,"nextsibling",n)},prevuntil:function(e,t,n){return v.dir(e,"previoussibling",n)},siblings:function(e){return v.sibling((e.parentnode||{}).firstchild,e)},children:function(e){return v.sibling(e.firstchild)},contents:function(e){return v.nodename(e,"iframe")?e.contentdocument||e.contentwindow.document:v.merge([],e.childnodes)}},function(e,t){v.fn[e]=function(n,r){var i=v.map(this,t,n);return nt.test(e)||(r=n),r&&typeof r=="string"&&(i=v.filter(r,i)),i=this.length>1&&!ot[e]?v.unique(i):i,this.length>1&&rt.test(e)&&(i=i.reverse()),this.pushstack(i,e,l.call(arguments).join(","))}}),v.extend({filter:function(e,t,n){return n&&(e=":not("+e+")"),t.length===1?v.find.matchesselector(t[0],e)?[t[0]]:[]:v.find.matches(e,t)},dir:function(e,n,r){var i=[],s=e[n];while(s&&s.nodetype!==9&&(r===t||s.nodetype!==1||!v(s).is(r)))s.nodetype===1&&i.push(s),s=s[n];return i},sibling:function(e,t){var n=[];for(;e;e=e.nextsibling)e.nodetype===1&&e!==t&&n.push(e);return n}});var ct="abbr|article|aside|audio|bdi|canvas|data|datalist|details|figcaption|figure|footer|header|hgroup|mark|meter|nav|output|progress|section|summary|time|video",ht=/ jquery\d+="(?:null|\d+)"/g,pt=/^\s+/,dt=/<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:]+)[^>]*)\/>/gi,vt=/<([\w:]+)/,mt=/]","i"),et=/^(?:checkbox|radio)$/,st=/checked\s*(?:[^=]|=\s*.checked.)/i,xt=/\/(java|ecma)script/i,tt=/^\s*\s*$/g,nt={option:[1,""],legend:[1,"
","
"],thead:[1,"","
"],tr:[2,"","
"],td:[3,"","
"],col:[2,"","
"],area:[1,"",""],_default:[0,"",""]},ct=lt(i),kt=ct.appendchild(i.createelement("div"));nt.optgroup=nt.option,nt.tbody=nt.tfoot=nt.colgroup=nt.caption=nt.thead,nt.th=nt.td,v.support.htmlserialize||(nt._default=[1,"x
","
"]),v.fn.extend({text:function(e){return v.access(this,function(e){return e===t?v.text(this):this.empty().append((this[0]&&this[0].ownerdocument||i).createtextnode(e))},null,e,arguments.length)},wrapall:function(e){if(v.isfunction(e))return this.each(function(t){v(this).wrapall(e.call(this,t))});if(this[0]){var t=v(e,this[0].ownerdocument).eq(0).clone(!0);this[0].parentnode&&t.insertbefore(this[0]),t.map(function(){var e=this;while(e.firstchild&&e.firstchild.nodetype===1)e=e.firstchild;return e}).append(this)}return this},wrapinner:function(e){return v.isfunction(e)?this.each(function(t){v(this).wrapinner(e.call(this,t))}):this.each(function(){var t=v(this),n=t.contents();n.length?n.wrapall(e):t.append(e)})},wrap:function(e){var t=v.isfunction(e);return this.each(function(n){v(this).wrapall(t?e.call(this,n):e)})},unwrap:function(){return this.parent().each(function(){v.nodename(this,"body")||v(this).replacewith(this.childnodes)}).end()},append:function(){return this.dommanip(arguments,!0,function(e){(this.nodetype===1||this.nodetype===11)&&this.appendchild(e)})},prepend:function(){return this.dommanip(arguments,!0,function(e){(this.nodetype===1||this.nodetype===11)&&this.insertbefore(e,this.firstchild)})},before:function(){if(!ut(this[0]))return this.dommanip(arguments,!1,function(e){this.parentnode.insertbefore(e,this)});if(arguments.length){var e=v.clean(arguments);return this.pushstack(v.merge(e,this),"before",this.selector)}},after:function(){if(!ut(this[0]))return this.dommanip(arguments,!1,function(e){this.parentnode.insertbefore(e,this.nextsibling)});if(arguments.length){var e=v.clean(arguments);return this.pushstack(v.merge(this,e),"after",this.selector)}},remove:function(e,t){var n,r=0;for(;(n=this[r])!=null;r++)if(!e||v.filter(e,[n]).length)!t&&n.nodetype===1&&(v.cleandata(n.getelementsbytagname("*")),v.cleandata([n])),n.parentnode&&n.parentnode.removechild(n);return this},empty:function(){var e,t=0;for(;(e=this[t])!=null;t++){e.nodetype===1&&v.cleandata(e.getelementsbytagname("*"));while(e.firstchild)e.removechild(e.firstchild)}return this},clone:function(e,t){return e=e==null?!1:e,t=t==null?e:t,this.map(function(){return v.clone(this,e,t)})},html:function(e){return v.access(this,function(e){var n=this[0]||{},r=0,i=this.length;if(e===t)return n.nodetype===1?n.innerhtml.replace(ht,""):t;if(typeof e=="string"&&!yt.test(e)&&(v.support.htmlserialize||!wt.test(e))&&(v.support.leadingwhitespace||!pt.test(e))&&!nt[(vt.exec(e)||["",""])[1].tolowercase()]){e=e.replace(dt,"<$1>");try{for(;r1&&typeof f=="string"&&st.test(f))return this.each(function(){v(this).dommanip(e,n,r)});if(v.isfunction(f))return this.each(function(i){var s=v(this);e[0]=f.call(this,i,n?s.html():t),s.dommanip(e,n,r)});if(this[0]){i=v.buildfragment(e,this,l),o=i.fragment,s=o.firstchild,o.childnodes.length===1&&(o=s);if(s){n=n&&v.nodename(s,"tr");for(u=i.cacheable||c-1;a0?this.clone(!0):this).get(),v(o[i])[t](r),s=s.concat(r);return this.pushstack(s,e,o.selector)}}),v.extend({clone:function(e,t,n){var r,i,s,o;v.support.html5clone||v.isxmldoc(e)||!wt.test("<"+e.nodename+">")?o=e.clonenode(!0):(kt.innerhtml=e.outerhtml,kt.removechild(o=kt.firstchild));if((!v.support.nocloneevent||!v.support.noclonechecked)&&(e.nodetype===1||e.nodetype===11)&&!v.isxmldoc(e)){ot(e,o),r=mt(e),i=mt(o);for(s=0;r[s];++s)i[s]&&ot(r[s],i[s])}if(t){at(e,o);if(n){r=mt(e),i=mt(o);for(s=0;r[s];++s)at(r[s],i[s])}}return r=i=null,o},clean:function(e,t,n,r){var s,o,u,a,f,l,c,h,p,d,m,g,y=t===i&&ct,b=[];if(!t||typeof t.createdocumentfragment=="undefined")t=i;for(s=0;(u=e[s])!=null;s++){typeof u=="number"&&(u+="");if(!u)continue;if(typeof u=="string")if(!gt.test(u))u=t.createtextnode(u);else{y=y||lt(t),c=t.createelement("div"),y.appendchild(c),u=u.replace(dt,"<$1>"),a=(vt.exec(u)||["",""])[1].tolowercase(),f=nt[a]||nt._default,l=f[0],c.innerhtml=f[1]+u+f[2];while(l--)c=c.lastchild;if(!v.support.tbody){h=mt.test(u),p=a==="table"&&!h?c.firstchild&&c.firstchild.childnodes:f[1]===""&&!h?c.childnodes:[];for(o=p.length-1;o>=0;--o)v.nodename(p[o],"tbody")&&!p[o].childnodes.length&&p[o].parentnode.removechild(p[o])}!v.support.leadingwhitespace&&pt.test(u)&&c.insertbefore(t.createtextnode(pt.exec(u)[0]),c.firstchild),u=c.childnodes,c.parentnode.removechild(c)}u.nodetype?b.push(u):v.merge(b,u)}c&&(u=c=y=null);if(!v.support.appendchecked)for(s=0;(u=b[s])!=null;s++)v.nodename(u,"input")?_t(u):typeof u.getelementsbytagname!="undefined"&&v.grep(u.getelementsbytagname("input"),_t);if(n){m=function(e){if(!e.type||xt.test(e.type))return r?r.push(e.parentnode?e.parentnode.removechild(e):e):n.appendchild(e)};for(s=0;(u=b[s])!=null;s++)if(!v.nodename(u,"script")||!m(u))n.appendchild(u),typeof u.getelementsbytagname!="undefined"&&(g=v.grep(v.merge([],u.getelementsbytagname("script")),m),b.splice.apply(b,[s+1,0].concat(g)),s+=g.length)}return b},cleandata:function(e,t){var n,r,i,s,o=0,u=v.expando,a=v.cache,f=v.support.deleteexpando,l=v.event.special;for(;(i=e[o])!=null;o++)if(t||v.acceptdata(i)){r=i[u],n=r&&a[r];if(n){if(n.events)for(s in n.events)l[s]?v.event.remove(i,s):v.removeevent(i,s,n.handle);a[r]&&(delete a[r],f?delete i[u]:i.removeattribute?i.removeattribute(u):i[u]=null,v.deletedids.push(r))}}}}),function(){var e,t;v.uamatch=function(e){e=e.tolowercase();var t=/(chrome)[ \/]([\w.]+)/.exec(e)||/(webkit)[ \/]([\w.]+)/.exec(e)||/(opera)(?:.*version|)[ \/]([\w.]+)/.exec(e)||/(msie) ([\w.]+)/.exec(e)||e.indexof("compatible")<0&&/(mozilla)(?:.*? rv:([\w.]+)|)/.exec(e)||[];return{browser:t[1]||"",version:t[2]||"0"}},e=v.uamatch(o.useragent),t={},e.browser&&(t[e.browser]=!0,t.version=e.version),t.chrome?t.webkit=!0:t.webkit&&(t.safari=!0),v.browser=t,v.sub=function(){function e(t,n){return new e.fn.init(t,n)}v.extend(!0,e,this),e.superclass=this,e.fn=e.prototype=this(),e.fn.constructor=e,e.sub=this.sub,e.fn.init=function(r,i){return i&&i instanceof v&&!(i instanceof e)&&(i=e(i)),v.fn.init.call(this,r,i,t)},e.fn.init.prototype=e.fn;var t=e(i);return e}}();var dt,pt,ht,bt=/alpha\([^)]*\)/i,jt=/opacity=([^)]*)/,ft=/^(top|right|bottom|left)$/,it=/^(none|table(?!-c[ea]).+)/,qt=/^margin/,rt=new regexp("^("+m+")(.*)$","i"),ut=new regexp("^("+m+")(?!px)[a-z%]+$","i"),zt=new regexp("^([-+])=("+m+")","i"),wt={body:"block"},xt={position:"absolute",visibility:"hidden",display:"block"},vt={letterspacing:0,fontweight:400},$t=["top","right","bottom","left"],jt=["webkit","o","moz","ms"],kt=v.fn.toggle;v.fn.extend({css:function(e,n){return v.access(this,function(e,n,r){return r!==t?v.style(e,n,r):v.css(e,n)},e,n,arguments.length>1)},show:function(){return yt(this,!0)},hide:function(){return yt(this)},toggle:function(e,t){var n=typeof e=="boolean";return v.isfunction(e)&&v.isfunction(t)?kt.apply(this,arguments):this.each(function(){(n?e:gt(this))?v(this).show():v(this).hide()})}}),v.extend({csshooks:{opacity:{get:function(e,t){if(t){var n=dt(e,"opacity");return n===""?"1":n}}}},cssnumber:{fillopacity:!0,fontweight:!0,lineheight:!0,opacity:!0,orphans:!0,widows:!0,zindex:!0,zoom:!0},cssprops:{"float":v.support.cssfloat?"cssfloat":"stylefloat"},style:function(e,n,r,i){if(!e||e.nodetype===3||e.nodetype===8||!e.style)return;var s,o,u,a=v.camelcase(n),f=e.style;n=v.cssprops[a]||(v.cssprops[a]=qt(f,a)),u=v.csshooks[n]||v.csshooks[a];if(r===t)return u&&"get"in u&&(s=u.get(e,!1,i))!==t?s:f[n];o=typeof r,o==="string"&&(s=zt.exec(r))&&(r=(s[1]+1)*s[2]+parsefloat(v.css(e,n)),o="number");if(r==null||o==="number"&&isnan(r))return;o==="number"&&!v.cssnumber[a]&&(r+="px");if(!u||!("set"in u)||(r=u.set(e,r,i))!==t)try{f[n]=r}catch(l){}},css:function(e,n,r,i){var s,o,u,a=v.camelcase(n);return n=v.cssprops[a]||(v.cssprops[a]=qt(e.style,a)),u=v.csshooks[n]||v.csshooks[a],u&&"get"in u&&(s=u.get(e,!0,i)),s===t&&(s=dt(e,n)),s==="normal"&&n in vt&&(s=vt[n]),r||i!==t?(o=parsefloat(s),r||v.isnumeric(o)?o||0:s):s},swap:function(e,t,n){var r,i,s={};for(i in t)s[i]=e.style[i],e.style[i]=t[i];r=n.call(e);for(i in t)e.style[i]=s[i];return r}}),e.getcomputedstyle?dt=function(t,n){var r,i,s,o,u=e.getcomputedstyle(t,null),a=t.style;return u&&(r=u.getpropertyvalue(n)||u[n],r===""&&!v.contains(t.ownerdocument,t)&&(r=v.style(t,n)),ut.test(r)&&qt.test(n)&&(i=a.width,s=a.minwidth,o=a.maxwidth,a.minwidth=a.maxwidth=a.width=r,r=u.width,a.width=i,a.minwidth=s,a.maxwidth=o)),r}:i.documentelement.currentstyle&&(dt=function(e,t){var n,r,i=e.currentstyle&&e.currentstyle[t],s=e.style;return i==null&&s&&s[t]&&(i=s[t]),ut.test(i)&&!ft.test(t)&&(n=s.left,r=e.runtimestyle&&e.runtimestyle.left,r&&(e.runtimestyle.left=e.currentstyle.left),s.left=t==="fontsize"?"1em":i,i=s.pixelleft+"px",s.left=n,r&&(e.runtimestyle.left=r)),i===""?"auto":i}),v.each(["height","width"],function(e,t){v.csshooks[t]={get:function(e,n,r){if(n)return e.offsetwidth===0&&it.test(dt(e,"display"))?v.swap(e,xt,function(){return tn(e,t,r)}):tn(e,t,r)},set:function(e,n,r){return zt(e,n,r?en(e,t,r,v.support.boxsizing&&v.css(e,"boxsizing")==="border-box"):0)}}}),v.support.opacity||(v.csshooks.opacity={get:function(e,t){return jt.test((t&&e.currentstyle?e.currentstyle.filter:e.style.filter)||"")?.01*parsefloat(regexp.$1)+"":t?"1":""},set:function(e,t){var n=e.style,r=e.currentstyle,i=v.isnumeric(t)?"alpha(opacity="+t*100+")":"",s=r&&r.filter||n.filter||"";n.zoom=1;if(t>=1&&v.trim(s.replace(bt,""))===""&&n.removeattribute){n.removeattribute("filter");if(r&&!r.filter)return}n.filter=bt.test(s)?s.replace(bt,i):s+" "+i}}),v(function(){v.support.reliablemarginright||(v.csshooks.marginright={get:function(e,t){return v.swap(e,{display:"inline-block"},function(){if(t)return dt(e,"marginright")})}}),!v.support.pixelposition&&v.fn.position&&v.each(["top","left"],function(e,t){v.csshooks[t]={get:function(e,n){if(n){var r=dt(e,t);return ut.test(r)?v(e).position()[t]+"px":r}}}})}),v.expr&&v.expr.filters&&(v.expr.filters.hidden=function(e){return e.offsetwidth===0&&e.offsetheight===0||!v.support.reliablehiddenoffsets&&(e.style&&e.style.display||dt(e,"display"))==="none"},v.expr.filters.visible=function(e){return!v.expr.filters.hidden(e)}),v.each({margin:"",padding:"",border:"width"},function(e,t){v.csshooks[e+t]={expand:function(n){var r,i=typeof n=="string"?n.split(" "):[n],s={};for(r=0;r<4;r++)s[e+$t[r]+t]=i[r]||i[r-2]||i[0];return s}},qt.test(e)||(v.csshooks[e+t].set=zt)});var rn=/%20/g,sn=/\[\]$/,on=/\r?\n/g,un=/^(?:color|date|datetime|datetime-local|email|hidden|month|number|password|range|search|tel|text|time|url|week)$/i,an=/^(?:select|textarea)/i;v.fn.extend({serialize:function(){return v.param(this.serializearray())},serializearray:function(){return this.map(function(){return this.elements?v.makearray(this.elements):this}).filter(function(){return this.name&&!this.disabled&&(this.checked||an.test(this.nodename)||un.test(this.type))}).map(function(e,t){var n=v(this).val();return n==null?null:v.isarray(n)?v.map(n,function(e,n){return{name:t.name,value:e.replace(on,"\r\n")}}):{name:t.name,value:n.replace(on,"\r\n")}}).get()}}),v.param=function(e,n){var r,i=[],s=function(e,t){t=v.isfunction(t)?t():t==null?"":t,i[i.length]=encodeuricomponent(e)+"="+encodeuricomponent(t)};n===t&&(n=v.ajaxsettings&&v.ajaxsettings.traditional);if(v.isarray(e)||e.jquery&&!v.isplainobject(e))v.each(e,function(){s(this.name,this.value)});else for(r in e)fn(r,e[r],n,s);return i.join("&").replace(rn,"+")};var ln,cn,hn=/#.*$/,pn=/^(.*?):[ \t]*([^\r\n]*)\r?$/mg,dn=/^(?:about|app|app\-storage|.+\-extension|file|res|widget):$/,vn=/^(?:get|head)$/,mn=/^\/\//,gn=/\?/,yn=/)<[^<]*)*<\/script>/gi,bn=/([?&])_=[^&]*/,wn=/^([\w\+\.\-]+:)(?:\/\/([^\/?#:]*)(?::(\d+)|)|)/,en=v.fn.load,sn={},xn={},tn=["*/"]+["*"];try{cn=s.href}catch(nn){cn=i.createelement("a"),cn.href="",cn=cn.href}ln=wn.exec(cn.tolowercase())||[],v.fn.load=function(e,n,r){if(typeof e!="string"&&en)return en.apply(this,arguments);if(!this.length)return this;var i,s,o,u=this,a=e.indexof(" ");return a>=0&&(i=e.slice(a,e.length),e=e.slice(0,a)),v.isfunction(n)?(r=n,n=t):n&&typeof n=="object"&&(s="post"),v.ajax({url:e,type:s,datatype:"html",data:n,complete:function(e,t){r&&u.each(r,o||[e.responsetext,t,e])}}).done(function(e){o=arguments,u.html(i?v("
").append(e.replace(yn,"")).find(i):e)}),this},v.each("ajaxstart ajaxstop ajaxcomplete ajaxerror ajaxsuccess ajaxsend".split(" "),function(e,t){v.fn[t]=function(e){return this.on(t,e)}}),v.each(["get","post"],function(e,n){v[n]=function(e,r,i,s){return v.isfunction(r)&&(s=s||i,i=r,r=t),v.ajax({type:n,url:e,data:r,success:i,datatype:s})}}),v.extend({getscript:function(e,n){return v.get(e,t,n,"script")},getjson:function(e,t,n){return v.get(e,t,n,"json")},ajaxsetup:function(e,t){return t?ln(e,v.ajaxsettings):(t=e,e=v.ajaxsettings),ln(e,t),e},ajaxsettings:{url:cn,islocal:dn.test(ln[1]),global:!0,type:"get",contenttype:"application/x-www-form-urlencoded; charset=utf-8",processdata:!0,async:!0,accepts:{xml:"application/xml, text/xml",html:"text/html",text:"text/plain",json:"application/json, text/javascript","*":tn},contents:{xml:/xml/,html:/html/,json:/json/},responsefields:{xml:"responsexml",text:"responsetext"},converters:{"* text":e.string,"text html":!0,"text json":v.parsejson,"text xml":v.parsexml},flatoptions:{context:!0,url:!0}},ajaxprefilter:cn(sn),ajaxtransport:cn(xn),ajax:function(e,n){function t(e,n,s,a){var l,y,b,w,s,t=n;if(e===2)return;e=2,u&&cleartimeout(u),o=t,i=a||"",x.readystate=e>0?4:0,s&&(w=an(c,x,s));if(e>=200&&e<300||e===304)c.ifmodified&&(s=x.getresponseheader("last-modified"),s&&(v.lastmodified[r]=s),s=x.getresponseheader("etag"),s&&(v.etag[r]=s)),e===304?(t="notmodified",l=!0):(l=on(c,w),t=l.state,y=l.data,b=l.error,l=!b);else{b=t;if(!t||e)t="error",e<0&&(e=0)}x.status=e,x.statustext=(n||t)+"",l?d.resolvewith(h,[y,t,x]):d.rejectwith(h,[x,t,b]),x.statuscode(g),g=t,f&&p.trigger("ajax"+(l?"success":"error"),[x,c,l?y:b]),m.firewith(h,[x,t]),f&&(p.trigger("ajaxcomplete",[x,c]),--v.active||v.event.trigger("ajaxstop"))}typeof e=="object"&&(n=e,e=t),n=n||{};var r,i,s,o,u,a,f,l,c=v.ajaxsetup({},n),h=c.context||c,p=h!==c&&(h.nodetype||h instanceof v)?v(h):v.event,d=v.deferred(),m=v.callbacks("once memory"),g=c.statuscode||{},b={},w={},e=0,s="canceled",x={readystate:0,setrequestheader:function(e,t){if(!e){var n=e.tolowercase();e=w[n]=w[n]||e,b[e]=t}return this},getallresponseheaders:function(){return e===2?i:null},getresponseheader:function(e){var n;if(e===2){if(!s){s={};while(n=pn.exec(i))s[n[1].tolowercase()]=n[2]}n=s[e.tolowercase()]}return n===t?null:n},overridemimetype:function(e){return e||(c.mimetype=e),this},abort:function(e){return e=e||s,o&&o.abort(e),t(0,e),this}};d.promise(x),x.success=x.done,x.error=x.fail,x.complete=m.add,x.statuscode=function(e){if(e){var t;if(e<2)for(t in e)g[t]=[g[t],e[t]];else t=e[x.status],x.always(t)}return this},c.url=((e||c.url)+"").replace(hn,"").replace(mn,ln[1]+"//"),c.datatypes=v.trim(c.datatype||"*").tolowercase().split(y),c.crossdomain==null&&(a=wn.exec(c.url.tolowercase()),c.crossdomain=!(!a||a[1]===ln[1]&&a[2]===ln[2]&&(a[3]||(a[1]==="http:"?80:443))==(ln[3]||(ln[1]==="http:"?80:443)))),c.data&&c.processdata&&typeof c.data!="string"&&(c.data=v.param(c.data,c.traditional)),kn(sn,c,n,x);if(e===2)return x;f=c.global,c.type=c.type.touppercase(),c.hascontent=!vn.test(c.type),f&&v.active++===0&&v.event.trigger("ajaxstart");if(!c.hascontent){c.data&&(c.url+=(gn.test(c.url)?"&":"?")+c.data,delete c.data),r=c.url;if(c.cache===!1){var n=v.now(),c=c.url.replace(bn,"$1_="+n);c.url=c+(c===c.url?(gn.test(c.url)?"&":"?")+"_="+n:"")}}(c.data&&c.hascontent&&c.contenttype!==!1||n.contenttype)&&x.setrequestheader("content-type",c.contenttype),c.ifmodified&&(r=r||c.url,v.lastmodified[r]&&x.setrequestheader("if-modified-since",v.lastmodified[r]),v.etag[r]&&x.setrequestheader("if-none-match",v.etag[r])),x.setrequestheader("accept",c.datatypes[0]&&c.accepts[c.datatypes[0]]?c.accepts[c.datatypes[0]]+(c.datatypes[0]!=="*"?", "+tn+"; q=0.01":""):c.accepts["*"]);for(l in c.headers)x.setrequestheader(l,c.headers[l]);if(!c.beforesend||c.beforesend.call(h,x,c)!==!1&&e!==2){s="abort";for(l in{success:1,error:1,complete:1})x[l](c[l]);o=kn(xn,c,n,x);if(!o)t(-1,"no transport");else{x.readystate=1,f&&p.trigger("ajaxsend",[x,c]),c.async&&c.timeout>0&&(u=settimeout(function(){x.abort("timeout")},c.timeout));try{e=1,o.send(b,t)}catch(k){if(!(e<2))throw k;t(-1,k)}}return x}return x.abort()},active:0,lastmodified:{},etag:{}});var mn=[],_n=/\?/,dn=/(=)\?(?=&|$)|\?\?/,pn=v.now();v.ajaxsetup({jsonp:"callback",jsonpcallback:function(){var e=mn.pop()||v.expando+"_"+pn++;return this[e]=!0,e}}),v.ajaxprefilter("json jsonp",function(n,r,i){var s,o,u,a=n.data,f=n.url,l=n.jsonp!==!1,c=l&&dn.test(f),h=l&&!c&&typeof a=="string"&&!(n.contenttype||"").indexof("application/x-www-form-urlencoded")&&dn.test(a);if(n.datatypes[0]==="jsonp"||c||h)return s=n.jsonpcallback=v.isfunction(n.jsonpcallback)?n.jsonpcallback():n.jsonpcallback,o=e[s],c?n.url=f.replace(dn,"$1"+s):h?n.data=a.replace(dn,"$1"+s):l&&(n.url+=(_n.test(f)?"&":"?")+n.jsonp+"="+s),n.converters["script json"]=function(){return u||v.error(s+" was not called"),u[0]},n.datatypes[0]="json",e[s]=function(){u=arguments},i.always(function(){e[s]=o,n[s]&&(n.jsonpcallback=r.jsonpcallback,mn.push(s)),u&&v.isfunction(o)&&o(u[0]),u=o=t}),"script"}),v.ajaxsetup({accepts:{script:"text/javascript, application/javascript, application/ecmascript, application/x-ecmascript"},contents:{script:/javascript|ecmascript/},converters:{"text script":function(e){return v.globaleval(e),e}}}),v.ajaxprefilter("script",function(e){e.cache===t&&(e.cache=!1),e.crossdomain&&(e.type="get",e.global=!1)}),v.ajaxtransport("script",function(e){if(e.crossdomain){var n,r=i.head||i.getelementsbytagname("head")[0]||i.documentelement;return{send:function(s,o){n=i.createelement("script"),n.async="async",e.scriptcharset&&(n.charset=e.scriptcharset),n.src=e.url,n.onload=n.onreadystatechange=function(e,i){if(i||!n.readystate||/loaded|complete/.test(n.readystate))n.onload=n.onreadystatechange=null,r&&n.parentnode&&r.removechild(n),n=t,i||o(200,"success")},r.insertbefore(n,r.firstchild)},abort:function(){n&&n.onload(0,1)}}}});var hn,bn=e.activexobject?function(){for(var e in hn)hn[e](0,1)}:!1,jn=0;v.ajaxsettings.xhr=e.activexobject?function(){return!this.islocal&&fn()||in()}:fn,function(e){v.extend(v.support,{ajax:!!e,cors:!!e&&"withcredentials"in e})}(v.ajaxsettings.xhr()),v.support.ajax&&v.ajaxtransport(function(n){if(!n.crossdomain||v.support.cors){var r;return{send:function(i,s){var o,u,a=n.xhr();n.username?a.open(n.type,n.url,n.async,n.username,n.password):a.open(n.type,n.url,n.async);if(n.xhrfields)for(u in n.xhrfields)a[u]=n.xhrfields[u];n.mimetype&&a.overridemimetype&&a.overridemimetype(n.mimetype),!n.crossdomain&&!i["x-requested-with"]&&(i["x-requested-with"]="xmlhttprequest");try{for(u in i)a.setrequestheader(u,i[u])}catch(f){}a.send(n.hascontent&&n.data||null),r=function(e,i){var u,f,l,c,h;try{if(r&&(i||a.readystate===4)){r=t,o&&(a.onreadystatechange=v.noop,bn&&delete hn[o]);if(i)a.readystate!==4&&a.abort();else{u=a.status,l=a.getallresponseheaders(),c={},h=a.responsexml,h&&h.documentelement&&(c.xml=h);try{c.text=a.responsetext}catch(p){}try{f=a.statustext}catch(p){f=""}!u&&n.islocal&&!n.crossdomain?u=c.text?200:404:u===1223&&(u=204)}}}catch(d){i||s(-1,d)}c&&s(u,f,c,l)},n.async?a.readystate===4?settimeout(r,0):(o=++jn,bn&&(hn||(hn={},v(e).unload(bn)),hn[o]=r),a.onreadystatechange=r):r()},abort:function(){r&&r(0,1)}}}});var qn,rn,un=/^(?:toggle|show|hide)$/,zn=new regexp("^(?:([-+])=|)("+m+")([a-z%]*)$","i"),wn=/queuehooks$/,xn=[gn],vn={"*":[function(e,t){var n,r,i=this.createtween(e,t),s=zn.exec(t),o=i.cur(),u=+o||0,a=1,f=20;if(s){n=+s[2],r=s[3]||(v.cssnumber[e]?"":"px");if(r!=="px"&&u){u=v.css(i.elem,e,!0)||n||1;do a=a||".5",u/=a,v.style(i.elem,e,u+r);while(a!==(a=i.cur()/o)&&a!==1&&--f)}i.unit=r,i.start=u,i.end=s[1]?u+(s[1]+1)*n:n}return i}]};v.animation=v.extend(kn,{tweener:function(e,t){v.isfunction(e)?(t=e,e=["*"]):e=e.split(" ");var n,r=0,i=e.length;for(;r-1,f={},l={},c,h;a?(l=i.position(),c=l.top,h=l.left):(c=parsefloat(o)||0,h=parsefloat(u)||0),v.isfunction(t)&&(t=t.call(e,n,s)),t.top!=null&&(f.top=t.top-s.top+c),t.left!=null&&(f.left=t.left-s.left+h),"using"in t?t.using.call(e,f):i.css(f)}},v.fn.extend({position:function(){if(!this[0])return;var e=this[0],t=this.offsetparent(),n=this.offset(),r=er.test(t[0].nodename)?{top:0,left:0}:t.offset();return n.top-=parsefloat(v.css(e,"margintop"))||0,n.left-=parsefloat(v.css(e,"marginleft"))||0,r.top+=parsefloat(v.css(t[0],"bordertopwidth"))||0,r.left+=parsefloat(v.css(t[0],"borderleftwidth"))||0,{top:n.top-r.top,left:n.left-r.left}},offsetparent:function(){return this.map(function(){var e=this.offsetparent||i.body;while(e&&!er.test(e.nodename)&&v.css(e,"position")==="static")e=e.offsetparent;return e||i.body})}}),v.each({scrollleft:"pagexoffset",scrolltop:"pageyoffset"},function(e,n){var r=/y/.test(n);v.fn[e]=function(i){return v.access(this,function(e,i,s){var o=tr(e);if(s===t)return o?n in o?o[n]:o.document.documentelement[i]:e[i];o?o.scrollto(r?v(o).scrollleft():s,r?s:v(o).scrolltop()):e[i]=s},e,i,arguments.length,null)}}),v.each({height:"height",width:"width"},function(e,n){v.each({padding:"inner"+e,content:n,"":"outer"+e},function(r,i){v.fn[i]=function(i,s){var o=arguments.length&&(r||typeof i!="boolean"),u=r||(i===!0||s===!0?"margin":"border");return v.access(this,function(n,r,i){var s;return v.iswindow(n)?n.document.documentelement["client"+e]:n.nodetype===9?(s=n.documentelement,math.max(n.body["scroll"+e],s["scroll"+e],n.body["offset"+e],s["offset"+e],s["client"+e])):i===t?v.css(n,r,i,u):v.style(n,r,i,u)},n,o?i:t,o,null)}})}),e.jquery=e.$=v,typeof define=="function"&&define.amd&&define.amd.jquery&&define("jquery",[],function(){return v})})(window); /*! velocityjs.org (1.3.1). (c) 2014 julian shapiro. mit @license: en.wikipedia.org/wiki/mit_license */ /*! velocityjs.org jquery shim (1.0.1). (c) 2014 the jquery foundation. mit @license: en.wikipedia.org/wiki/mit_license. */ !function(a){"use strict";function b(a){var b=a.length,d=c.type(a);return"function"!==d&&!c.iswindow(a)&&(!(1!==a.nodetype||!b)||("array"===d||0===b||"number"==typeof b&&b>0&&b-1 in a))}if(!a.jquery){var c=function(a,b){return new c.fn.init(a,b)};c.iswindow=function(a){return a&&a===a.window},c.type=function(a){return a?"object"==typeof a||"function"==typeof a?e[g.call(a)]||"object":typeof a:a+""},c.isarray=array.isarray||function(a){return"array"===c.type(a)},c.isplainobject=function(a){var b;if(!a||"object"!==c.type(a)||a.nodetype||c.iswindow(a))return!1;try{if(a.constructor&&!f.call(a,"constructor")&&!f.call(a.constructor.prototype,"isprototypeof"))return!1}catch(d){return!1}for(b in a);return void 0===b||f.call(a,b)},c.each=function(a,c,d){var e,f=0,g=a.length,h=b(a);if(d){if(h)for(;f0?e=g:c=g;while(math.abs(f)>r&&++h=q?k(b,h):0===i?h:m(b,c,c+u)}function o(){y=!0,a===c&&d===e||l()}var p=4,q=.001,r=1e-7,s=10,t=11,u=1/(t-1),v="float32array"in b;if(4!==arguments.length)return!1;for(var w=0;w<4;++w)if("number"!=typeof arguments[w]||isnan(arguments[w])||!isfinite(arguments[w]))return!1;a=math.min(a,1),d=math.min(d,1),a=math.max(a,0),d=math.max(d,0);var x=v?new float32array(t):new array(t),y=!1,z=function(b){return y||o(),a===c&&d===e?b:0===b?0:1===b?1:i(n(b),c,e)};z.getcontrolpoints=function(){return[{x:a,y:c},{x:d,y:e}]};var a="generatebezier("+[a,c,d,e]+")";return z.tostring=function(){return a},z}function j(a,b){var c=a;return p.isstring(a)?t.easings[a]||(c=!1):c=p.isarray(a)&&1===a.length?h.apply(null,a):p.isarray(a)&&2===a.length?u.apply(null,a.concat([b])):!(!p.isarray(a)||4!==a.length)&&i.apply(null,a),c===!1&&(c=t.easings[t.defaults.easing]?t.defaults.easing:s),c}function k(a){if(a){var b=t.timestamp&&a!==!0?a:(new date).gettime(),c=t.state.calls.length;c>1e4&&(t.state.calls=e(t.state.calls),c=t.state.calls.length);for(var f=0;f4;a--){var b=c.createelement("div");if(b.innerhtml="",b.getelementsbytagname("span").length)return b=null,a}return d}(),o=function(){var a=0;return b.webkitrequestanimationframe||b.mozrequestanimationframe||function(b){var c,d=(new date).gettime();return c=math.max(0,16-(d-a)),a=d+c,settimeout(function(){b(d+c)},c)}}(),p={isstring:function(a){return"string"==typeof a},isarray:array.isarray||function(a){return"[object array]"===object.prototype.tostring.call(a)},isfunction:function(a){return"[object function]"===object.prototype.tostring.call(a)},isnode:function(a){return a&&a.nodetype},isnodelist:function(a){return"object"==typeof a&&/^\[object (htmlcollection|nodelist|object)\]$/.test(object.prototype.tostring.call(a))&&a.length!==d&&(0===a.length||"object"==typeof a[0]&&a[0].nodetype>0)},iswrapped:function(a){return a&&(a.jquery||b.zepto&&b.zepto.zepto.isz(a))},issvg:function(a){return b.svgelement&&a instanceof b.svgelement},isemptyobject:function(a){for(var b in a)if(a.hasownproperty(b))return!1;return!0}},q=!1;if(a.fn&&a.fn.jquery?(m=a,q=!0):m=b.velocity.utilities,n<=8&&!q)throw new error("velocity: ie8 and below require jquery to be loaded before velocity.");if(n<=7)return void(jquery.fn.velocity=jquery.fn.animate);var r=400,s="swing",t={state:{ismobile:/android|webos|iphone|ipad|ipod|blackberry|iemobile|opera mini/i.test(navigator.useragent),isandroid:/android/i.test(navigator.useragent),isgingerbread:/android 2\.3\.[3-7]/i.test(navigator.useragent),ischrome:b.chrome,isfirefox:/firefox/i.test(navigator.useragent),prefixelement:c.createelement("div"),prefixmatches:{},scrollanchor:null,scrollpropertyleft:null,scrollpropertytop:null,isticking:!1,calls:[]},css:{},utilities:m,redirects:{},easings:{},promise:b.promise,defaults:{queue:"",duration:r,easing:s,begin:d,complete:d,progress:d,display:d,visibility:d,loop:!1,delay:!1,mobileha:!0,_cachevalues:!0,promiserejectempty:!0},init:function(a){m.data(a,"velocity",{issvg:p.issvg(a),isanimating:!1,computedstyle:null,tweenscontainer:null,rootpropertyvaluecache:{},transformcache:{}})},hook:null,mock:!1,version:{major:1,minor:3,patch:1},debug:!1,timestamp:!0};b.pageyoffset!==d?(t.state.scrollanchor=b,t.state.scrollpropertyleft="pagexoffset",t.state.scrollpropertytop="pageyoffset"):(t.state.scrollanchor=c.documentelement||c.body.parentnode||c.body,t.state.scrollpropertyleft="scrollleft",t.state.scrollpropertytop="scrolltop");var u=function(){function a(a){return-a.tension*a.x-a.friction*a.v}function b(b,c,d){var e={x:b.x+d.dx*c,v:b.v+d.dv*c,tension:b.tension,friction:b.friction};return{dx:e.v,dv:a(e)}}function c(c,d){var e={dx:c.v,dv:a(c)},f=b(c,.5*d,e),g=b(c,.5*d,f),h=b(c,d,g),i=1/6*(e.dx+2*(f.dx+g.dx)+h.dx),j=1/6*(e.dv+2*(f.dv+g.dv)+h.dv);return c.x=c.x+i*d,c.v=c.v+j*d,c}return function d(a,b,e){var f,g,h,i={x:-1,v:0,tension:null,friction:null},j=[0],k=0,l=1e-4,m=.016;for(a=parsefloat(a)||500,b=parsefloat(b)||20,e=e||null,i.tension=a,i.friction=b,f=null!==e,f?(k=d(a,b),g=k/e*m):g=m;;)if(h=c(h||i,g),j.push(1+h.x),k+=16,!(math.abs(h.x)>l&&math.abs(h.v)>l))break;return f?function(a){return j[a*(j.length-1)|0]}:k}}();t.easings={linear:function(a){return a},swing:function(a){return.5-math.cos(a*math.pi)/2},spring:function(a){return 1-math.cos(4.5*a*math.pi)*math.exp(6*-a)}},m.each([["ease",[.25,.1,.25,1]],["ease-in",[.42,0,1,1]],["ease-out",[0,0,.58,1]],["ease-in-out",[.42,0,.58,1]],["easeinsine",[.47,0,.745,.715]],["easeoutsine",[.39,.575,.565,1]],["easeinoutsine",[.445,.05,.55,.95]],["easeinquad",[.55,.085,.68,.53]],["easeoutquad",[.25,.46,.45,.94]],["easeinoutquad",[.455,.03,.515,.955]],["easeincubic",[.55,.055,.675,.19]],["easeoutcubic",[.215,.61,.355,1]],["easeinoutcubic",[.645,.045,.355,1]],["easeinquart",[.895,.03,.685,.22]],["easeoutquart",[.165,.84,.44,1]],["easeinoutquart",[.77,0,.175,1]],["easeinquint",[.755,.05,.855,.06]],["easeoutquint",[.23,1,.32,1]],["easeinoutquint",[.86,0,.07,1]],["easeinexpo",[.95,.05,.795,.035]],["easeoutexpo",[.19,1,.22,1]],["easeinoutexpo",[1,0,0,1]],["easeincirc",[.6,.04,.98,.335]],["easeoutcirc",[.075,.82,.165,1]],["easeinoutcirc",[.785,.135,.15,.86]]],function(a,b){t.easings[b[0]]=i.apply(null,b[1])});var v=t.css={regex:{ishex:/^#([a-f\d]{3}){1,2}$/i,valueunwrap:/^[a-z]+\((.*)\)$/i,wrappedvaluealreadyextracted:/[0-9.]+ [0-9.]+ [0-9.]+( [0-9.]+)?/,valuesplit:/([a-z]+\(.+\))|(([a-z0-9#-.]+?)(?=\s|$))/gi},lists:{colors:["fill","stroke","stopcolor","color","backgroundcolor","bordercolor","bordertopcolor","borderrightcolor","borderbottomcolor","borderleftcolor","outlinecolor"],transformsbase:["translatex","translatey","scale","scalex","scaley","skewx","skewy","rotatez"],transforms3d:["transformperspective","translatez","scalez","rotatex","rotatey"]},hooks:{templates:{textshadow:["color x y blur","black 0px 0px 0px"],boxshadow:["color x y blur spread","black 0px 0px 0px 0px"],clip:["top right bottom left","0px 0px 0px 0px"],backgroundposition:["x y","0% 0%"],transformorigin:["x y z","50% 50% 0px"],perspectiveorigin:["x y","50% 50%"]},registered:{},register:function(){for(var a=0;a=1?"":"alpha(opacity="+parseint(100*parsefloat(c),10)+")"}else switch(a){case"name":return"opacity";case"extract":return c;case"inject":return c}}},register:function(){function a(a,b,c){var d="border-box"===v.getpropertyvalue(b,"boxsizing").tostring().tolowercase();if(d===(c||!1)){var e,f,g=0,h="width"===a?["left","right"]:["top","bottom"],i=["padding"+h[0],"padding"+h[1],"border"+h[0]+"width","border"+h[1]+"width"];for(e=0;e9)||t.state.isgingerbread||(v.lists.transformsbase=v.lists.transformsbase.concat(v.lists.transforms3d));for(var c=0;c8)&&3===f.split(" ").length&&(f+=" 1"),f;case"inject":return n<=8?4===e.split(" ").length&&(e=e.split(/\s+/).slice(0,3).join(" ")):3===e.split(" ").length&&(e+=" 1"),(n<=8?"rgb":"rgba")+"("+e.replace(/\s+/g,",").replace(/\.(\d)+(?=,)/g,"")+")"}}}();v.normalizations.registered.innerwidth=b("width",!0),v.normalizations.registered.innerheight=b("height",!0),v.normalizations.registered.outerwidth=b("width"),v.normalizations.registered.outerheight=b("height")}},names:{camelcase:function(a){return a.replace(/-(\w)/g,function(a,b){return b.touppercase()})},svgattribute:function(a){var b="width|height|x|y|cx|cy|r|rx|ry|x1|x2|y1|y2";return(n||t.state.isandroid&&!t.state.ischrome)&&(b+="|transform"),new regexp("^("+b+")$","i").test(a)},prefixcheck:function(a){if(t.state.prefixmatches[a])return[t.state.prefixmatches[a],!0];for(var b=["","webkit","moz","ms","o"],c=0,d=b.length;c=2&&console.log("get "+c+": "+i),i},setpropertyvalue:function(a,c,d,e,f){var h=c;if("scroll"===c)f.container?f.container["scroll"+f.direction]=d:"left"===f.direction?b.scrollto(d,f.alternatevalue):b.scrollto(f.alternatevalue,d);else if(v.normalizations.registered[c]&&"transform"===v.normalizations.registered[c]("name",a))v.normalizations.registered[c]("inject",a,d),h="transform",d=g(a).transformcache[c];else{if(v.hooks.registered[c]){var i=c,j=v.hooks.getroot(c);e=e||v.getpropertyvalue(a,j),d=v.hooks.injectvalue(i,d,e),c=j}if(v.normalizations.registered[c]&&(d=v.normalizations.registered[c]("inject",a,d),c=v.normalizations.registered[c]("name",a)),h=v.names.prefixcheck(c)[0],n<=8)try{a.style[h]=d}catch(k){t.debug&&console.log("browser does not support ["+d+"] for ["+h+"]")}else{var l=g(a);l&&l.issvg&&v.names.svgattribute(c)?a.setattribute(c,d):a.style[h]=d}t.debug>=2&&console.log("set "+c+" ("+h+"): "+d)}return[h,d]},flushtransformcache:function(a){var b="",c=g(a);if((n||t.state.isandroid&&!t.state.ischrome)&&c&&c.issvg){var d=function(b){return parsefloat(v.getpropertyvalue(a,b))},e={translate:[d("translatex"),d("translatey")],skewx:[d("skewx")],skewy:[d("skewy")],scale:1!==d("scale")?[d("scale"),d("scale")]:[d("scalex"),d("scaley")],rotate:[d("rotatez"),0,0]};m.each(g(a).transformcache,function(a){/^translate/i.test(a)?a="translate":/^scale/i.test(a)?a="scale":/^rotate/i.test(a)&&(a="rotate"),e[a]&&(b+=a+"("+e[a].join(" ")+") ",delete e[a])})}else{var f,h;m.each(g(a).transformcache,function(c){return f=g(a).transformcache[c],"transformperspective"===c?(h=f,!0):(9===n&&"rotatez"===c&&(c="rotate"),void(b+=c+f+" "))}),h&&(b="perspective"+h+" "+b)}v.setpropertyvalue(a,"transform",b)}};v.hooks.register(),v.normalizations.register(),t.hook=function(a,b,c){var e;return a=f(a),m.each(a,function(a,f){if(g(f)===d&&t.init(f),c===d)e===d&&(e=v.getpropertyvalue(f,b));else{var h=v.setpropertyvalue(f,b,c);"transform"===h[0]&&t.css.flushtransformcache(f),e=h}}),e};var w=function(){function a(){return i?y.promise||null:n}function e(a,e){function f(f){var n,o;if(i.begin&&0===a)try{i.begin.call(q,q)}catch(r){settimeout(function(){throw r},1)}if("scroll"===d){var w,x,b,c=/^x$/i.test(i.axis)?"left":"top",e=parsefloat(i.offset)||0;i.container?p.iswrapped(i.container)||p.isnode(i.container)?(i.container=i.container[0]||i.container,w=i.container["scroll"+c],b=w+m(a).position()[c.tolowercase()]+e):i.container=null:(w=t.state.scrollanchor[t.state["scrollproperty"+c]],x=t.state.scrollanchor[t.state["scrollproperty"+("left"===c?"top":"left")]],b=m(a).offset()[c.tolowercase()]+e),l={scroll:{rootpropertyvalue:!1,startvalue:w,currentvalue:w,endvalue:b,unittype:"",easing:i.easing,scrolldata:{container:i.container,direction:c,alternatevalue:x}},element:a},t.debug&&console.log("tweenscontainer (scroll): ",l.scroll,a)}else if("reverse"===d){if(n=g(a),!n)return;if(!n.tweenscontainer)return void m.dequeue(a,i.queue);"none"===n.opts.display&&(n.opts.display="auto"),"hidden"===n.opts.visibility&&(n.opts.visibility="visible"),n.opts.loop=!1,n.opts.begin=null,n.opts.complete=null,u.easing||delete i.easing,u.duration||delete i.duration,i=m.extend({},n.opts,i),o=m.extend(!0,{},n?n.tweenscontainer:null);for(var f in o)if(o.hasownproperty(f)&&"element"!==f){var g=o[f].startvalue;o[f].startvalue=o[f].currentvalue=o[f].endvalue,o[f].endvalue=g,p.isemptyobject(u)||(o[f].easing=i.easing),t.debug&&console.log("reverse tweenscontainer ("+f+"): "+json.stringify(o[f]),a)}l=o}else if("start"===d){n=g(a),n&&n.tweenscontainer&&n.isanimating===!0&&(o=n.tweenscontainer);var h=function(b,c){var f,g,h;return p.isfunction(b)&&(b=b.call(a,e,z)),p.isarray(b)?(f=b[0],!p.isarray(b[1])&&/^[\d-]/.test(b[1])||p.isfunction(b[1])||v.regex.ishex.test(b[1])?h=b[1]:(p.isstring(b[1])&&!v.regex.ishex.test(b[1])||p.isarray(b[1]))&&(g=c?b[1]:j(b[1],i.duration),b[2]!==d&&(h=b[2]))):f=b,c||(g=g||i.easing),p.isfunction(f)&&(f=f.call(a,e,z)),p.isfunction(h)&&(h=h.call(a,e,z)),[f||0,g,h]},k=function(e,f){var g=v.hooks.getroot(e),j=!1,k=f[0],p=f[1],q=f[2];if(!(n&&n.issvg||"tween"===g||v.names.prefixcheck(g)[1]!==!1||v.normalizations.registered[g]!==d))return void(t.debug&&console.log("skipping ["+g+"] due to a lack of browser support."));(i.display!==d&&null!==i.display&&"none"!==i.display||i.visibility!==d&&"hidden"!==i.visibility)&&/opacity|filter/.test(e)&&!q&&0!==k&&(q=0),i._cachevalues&&o&&o[e]?(q===d&&(q=o[e].endvalue+o[e].unittype),j=n.rootpropertyvaluecache[g]):v.hooks.registered[e]?q===d?(j=v.getpropertyvalue(a,g),q=v.getpropertyvalue(a,e,j)):j=v.hooks.templates[g][1]:q===d&&(q=v.getpropertyvalue(a,e));var r,s,u,w=!1,x=function(a,b){var c,d;return d=(b||"0").tostring().tolowercase().replace(/[%a-z]+$/,function(a){return c=a,""}),c||(c=v.values.getunittype(a)),[d,c]};r=x(e,q),q=r[0],u=r[1],r=x(e,k),k=r[0].replace(/^([+-\/*])=/,function(a,b){return w=b,""}),s=r[1],q=parsefloat(q)||0,k=parsefloat(k)||0,"%"===s&&(/^(fontsize|lineheight)$/.test(e)?(k/=100,s="em"):/^scale/.test(e)?(k/=100,s=""):/(red|green|blue)$/i.test(e)&&(k=k/100*255,s=""));var y=function(){var d={myparent:a.parentnode||c.body,position:v.getpropertyvalue(a,"position"),fontsize:v.getpropertyvalue(a,"fontsize")},e=d.position===i.lastposition&&d.myparent===i.lastparent,f=d.fontsize===i.lastfontsize;i.lastparent=d.myparent,i.lastposition=d.position,i.lastfontsize=d.fontsize;var g=100,h={};if(f&&e)h.emtopx=i.lastemtopx,h.percenttopxwidth=i.lastpercenttopxwidth,h.percenttopxheight=i.lastpercenttopxheight;else{var i=n&&n.issvg?c.createelementns("http://www.w3.org/2000/svg","rect"):c.createelement("div");t.init(i),d.myparent.appendchild(i),m.each(["overflow","overflowx","overflowy"],function(a,b){t.css.setpropertyvalue(i,b,"hidden")}),t.css.setpropertyvalue(i,"position",d.position),t.css.setpropertyvalue(i,"fontsize",d.fontsize),t.css.setpropertyvalue(i,"boxsizing","content-box"),m.each(["minwidth","maxwidth","width","minheight","maxheight","height"],function(a,b){t.css.setpropertyvalue(i,b,g+"%")}),t.css.setpropertyvalue(i,"paddingleft",g+"em"),h.percenttopxwidth=i.lastpercenttopxwidth=(parsefloat(v.getpropertyvalue(i,"width",null,!0))||1)/g,h.percenttopxheight=i.lastpercenttopxheight=(parsefloat(v.getpropertyvalue(i,"height",null,!0))||1)/g,h.emtopx=i.lastemtopx=(parsefloat(v.getpropertyvalue(i,"paddingleft"))||1)/g,d.myparent.removechild(i)}return null===i.remtopx&&(i.remtopx=parsefloat(v.getpropertyvalue(c.body,"fontsize"))||16),null===i.vwtopx&&(i.vwtopx=parsefloat(b.innerwidth)/100,i.vhtopx=parsefloat(b.innerheight)/100),h.remtopx=i.remtopx,h.vwtopx=i.vwtopx,h.vhtopx=i.vhtopx,t.debug>=1&&console.log("unit ratios: "+json.stringify(h),a),h};if(/[\/*]/.test(w))s=u;else if(u!==s&&0!==q)if(0===k)s=u;else{h=h||y();var z=/margin|padding|left|right|width|text|word|letter/i.test(e)||/x$/.test(e)||"x"===e?"x":"y";switch(u){case"%":q*="x"===z?h.percenttopxwidth:h.percenttopxheight;break;case"px":break;default:q*=h[u+"topx"]}switch(s){case"%":q*=1/("x"===z?h.percenttopxwidth:h.percenttopxheight);break;case"px":break;default:q*=1/h[s+"topx"]}}switch(w){case"+":k=q+k;break;case"-":k=q-k;break;case"*":k=q*k;break;case"/":k=q/k}l[e]={rootpropertyvalue:j,startvalue:q,currentvalue:q,endvalue:k,unittype:s,easing:p},t.debug&&console.log("tweenscontainer ("+e+"): "+json.stringify(l[e]),a)};for(var l in s)if(s.hasownproperty(l)){var m=v.names.camelcase(l),n=h(s[l]);if(v.lists.colors.indexof(m)>=0){var o=n[0],p=n[1],q=n[2];if(v.regex.ishex.test(o)){for(var r=["red","green","blue"],s=v.values.hextorgb(o),t=q?v.values.hextorgb(q):d,u=0;u.998){var n=this._time;this.render(0,!0,!1),this._initted=!1,this.render(n,!0,!1)}else if(this._time>0){this._initted=!1,this._init();for(var a,o=1/(1-r),h=this._firstpt;h;)a=h.s+h.c,h.c*=o,h.s=a-h.c,h=h._next}return this},l.render=function(t,e,i){this._initted||0===this._duration&&this.vars.repeat&&this.invalidate();var s,r,o,h,l,u,p,f,c=this._dirty?this.totalduration():this._totalduration,m=this._time,d=this._totaltime,g=this._cycle,v=this._duration,y=this._rawprevtime;if(t>=c?(this._totaltime=c,this._cycle=this._repeat,this._yoyo&&0!==(1&this._cycle)?(this._time=0,this.ratio=this._ease._calcend?this._ease.getratio(0):0):(this._time=v,this.ratio=this._ease._calcend?this._ease.getratio(1):1),this._reversed||(s=!0,r="oncomplete"),0===v&&(this._initted||!this.vars.lazy||i)&&(this._starttime===this._timeline._duration&&(t=0),(0===t||0>y||y===n)&&y!==t&&(i=!0,y>n&&(r="onreversecomplete")),this._rawprevtime=f=!e||t||y===t?t:n)):1e-7>t?(this._totaltime=this._time=this._cycle=0,this.ratio=this._ease._calcend?this._ease.getratio(0):0,(0!==d||0===v&&y>0&&y!==n)&&(r="onreversecomplete",s=this._reversed),0>t?(this._active=!1,0===v&&(this._initted||!this.vars.lazy||i)&&(y>=0&&(i=!0),this._rawprevtime=f=!e||t||y===t?t:n)):this._initted||(i=!0)):(this._totaltime=this._time=t,0!==this._repeat&&(h=v+this._repeatdelay,this._cycle=this._totaltime/h>>0,0!==this._cycle&&this._cycle===this._totaltime/h&&this._cycle--,this._time=this._totaltime-this._cycle*h,this._yoyo&&0!==(1&this._cycle)&&(this._time=v-this._time),this._time>v?this._time=v:0>this._time&&(this._time=0)),this._easetype?(l=this._time/v,u=this._easetype,p=this._easepower,(1===u||3===u&&l>=.5)&&(l=1-l),3===u&&(l*=2),1===p?l*=l:2===p?l*=l*l:3===p?l*=l*l*l:4===p&&(l*=l*l*l*l),this.ratio=1===u?1-l:2===u?l:.5>this._time/v?l/2:1-l/2):this.ratio=this._ease.getratio(this._time/v)),m===this._time&&!i&&g===this._cycle)return d!==this._totaltime&&this._onupdate&&(e||this._onupdate.apply(this.vars.onupdatescope||this,this.vars.onupdateparams||_)),void 0;if(!this._initted){if(this._init(),!this._initted||this._gc)return;if(!i&&this._firstpt&&(this.vars.lazy!==!1&&this._duration||this.vars.lazy&&!this._duration))return this._time=m,this._totaltime=d,this._rawprevtime=y,this._cycle=g,a.lazytweens.push(this),this._lazy=t,void 0;this._time&&!s?this.ratio=this._ease.getratio(this._time/v):s&&this._ease._calcend&&(this.ratio=this._ease.getratio(0===this._time?0:1))}for(this._lazy!==!1&&(this._lazy=!1),this._active||!this._paused&&this._time!==m&&t>=0&&(this._active=!0),0===d&&(2===this._initted&&t>0&&this._init(),this._startat&&(t>=0?this._startat.render(t,e,i):r||(r="_dummygs")),this.vars.onstart&&(0!==this._totaltime||0===v)&&(e||this.vars.onstart.apply(this.vars.onstartscope||this,this.vars.onstartparams||_))),o=this._firstpt;o;)o.f?o.t[o.p](o.c*this.ratio+o.s):o.t[o.p]=o.c*this.ratio+o.s,o=o._next;this._onupdate&&(0>t&&this._startat&&this._starttime&&this._startat.render(t,e,i),e||(this._totaltime!==d||s)&&this._onupdate.apply(this.vars.onupdatescope||this,this.vars.onupdateparams||_)),this._cycle!==g&&(e||this._gc||this.vars.onrepeat&&this.vars.onrepeat.apply(this.vars.onrepeatscope||this,this.vars.onrepeatparams||_)),r&&(this._gc||(0>t&&this._startat&&!this._onupdate&&this._starttime&&this._startat.render(t,e,i),s&&(this._timeline.autoremovechildren&&this._enabled(!1,!1),this._active=!1),!e&&this.vars[r]&&this.vars[r].apply(this.vars[r+"scope"]||this,this.vars[r+"params"]||_),0===v&&this._rawprevtime===n&&f!==n&&(this._rawprevtime=0)))},r.to=function(t,e,i){return new r(t,e,i)},r.from=function(t,e,i){return i.runbackwards=!0,i.immediaterender=0!=i.immediaterender,new r(t,e,i)},r.fromto=function(t,e,i,s){return s.startat=i,s.immediaterender=0!=s.immediaterender&&0!=i.immediaterender,new r(t,e,s)},r.staggerto=r.allto=function(t,e,n,a,l,u,p){a=a||0;var f,c,m,d,g=n.delay||0,v=[],y=function(){n.oncomplete&&n.oncomplete.apply(n.oncompletescope||this,arguments),l.apply(p||this,u||_)};for(h(t)||("string"==typeof t&&(t=i.selector(t)||t),o(t)&&(t=s.call(t,0))),f=t.length,m=0;f>m;m++){c={};for(d in n)c[d]=n[d];c.delay=g,m===f-1&&l&&(c.oncomplete=y),v[m]=new r(t[m],e,c),g+=a}return v},r.staggerfrom=r.allfrom=function(t,e,i,s,n,a,o){return i.runbackwards=!0,i.immediaterender=0!=i.immediaterender,r.staggerto(t,e,i,s,n,a,o)},r.staggerfromto=r.allfromto=function(t,e,i,s,n,a,o,h){return s.startat=i,s.immediaterender=0!=s.immediaterender&&0!=i.immediaterender,r.staggerto(t,e,s,n,a,o,h)},r.delayedcall=function(t,e,i,s,n){return new r(e,0,{delay:t,oncomplete:e,oncompleteparams:i,oncompletescope:s,onreversecomplete:e,onreversecompleteparams:i,onreversecompletescope:s,immediaterender:!1,useframes:n,overwrite:0})},r.set=function(t,e){return new r(t,0,e)},r.istweening=function(t){return i.gettweensof(t,!0).length>0};var u=function(t,e){for(var s=[],r=0,n=t._first;n;)n instanceof i?s[r++]=n:(e&&(s[r++]=n),s=s.concat(u(n,e)),r=s.length),n=n._next;return s},p=r.getalltweens=function(e){return u(t._roottimeline,e).concat(u(t._rootframestimeline,e))};r.killall=function(t,i,s,r){null==i&&(i=!0),null==s&&(s=!0);var n,a,o,h=p(0!=r),l=h.length,_=i&&s&&r;for(o=0;l>o;o++)a=h[o],(_||a instanceof e||(n=a.target===a.vars.oncomplete)&&s||i&&!n)&&(t?a.totaltime(a._reversed?0:a.totalduration()):a._enabled(!1,!1))},r.killchildtweensof=function(t,e){if(null!=t){var n,l,_,u,p,f=a.tweenlookup;if("string"==typeof t&&(t=i.selector(t)||t),o(t)&&(t=s.call(t,0)),h(t))for(u=t.length;--u>-1;)r.killchildtweensof(t[u],e);else{n=[];for(_ in f)for(l=f[_].target.parentnode;l;)l===t&&(n=n.concat(f[_].tweens)),l=l.parentnode;for(p=n.length,u=0;p>u;u++)e&&n[u].totaltime(n[u].totalduration()),n[u]._enabled(!1,!1)}}};var f=function(t,i,s,r){i=i!==!1,s=s!==!1,r=r!==!1;for(var n,a,o=p(r),h=i&&s&&r,l=o.length;--l>-1;)a=o[l],(h||a instanceof e||(n=a.target===a.vars.oncomplete)&&s||i&&!n)&&a.paused(t)};return r.pauseall=function(t,e,i){f(!0,t,e,i)},r.resumeall=function(t,e,i){f(!1,t,e,i)},r.globaltimescale=function(e){var s=t._roottimeline,r=i.ticker.time;return arguments.length?(e=e||n,s._starttime=r-(r-s._starttime)*s._timescale/e,s=t._rootframestimeline,r=i.ticker.frame,s._starttime=r-(r-s._starttime)*s._timescale/e,s._timescale=t._roottimeline._timescale=e,e):s._timescale},l.progress=function(t){return arguments.length?this.totaltime(this.duration()*(this._yoyo&&0!==(1&this._cycle)?1-t:t)+this._cycle*(this._duration+this._repeatdelay),!1):this._time/this.duration()},l.totalprogress=function(t){return arguments.length?this.totaltime(this.totalduration()*t,!1):this._totaltime/this.totalduration()},l.time=function(t,e){return arguments.length?(this._dirty&&this.totalduration(),t>this._duration&&(t=this._duration),this._yoyo&&0!==(1&this._cycle)?t=this._duration-t+this._cycle*(this._duration+this._repeatdelay):0!==this._repeat&&(t+=this._cycle*(this._duration+this._repeatdelay)),this.totaltime(t,e)):this._time},l.duration=function(e){return arguments.length?t.prototype.duration.call(this,e):this._duration},l.totalduration=function(t){return arguments.length?-1===this._repeat?this:this.duration((t-this._repeat*this._repeatdelay)/(this._repeat+1)):(this._dirty&&(this._totalduration=-1===this._repeat?999999999999:this._duration*(this._repeat+1)+this._repeatdelay*this._repeat,this._dirty=!1),this._totalduration)},l.repeat=function(t){return arguments.length?(this._repeat=t,this._uncache(!0)):this._repeat},l.repeatdelay=function(t){return arguments.length?(this._repeatdelay=t,this._uncache(!0)):this._repeatdelay},l.yoyo=function(t){return arguments.length?(this._yoyo=t,this):this._yoyo},r},!0),window._gsdefine("timelinelite",["core.animation","core.simpletimeline","tweenlite"],function(t,e,i){var s=function(t){e.call(this,t),this._labels={},this.autoremovechildren=this.vars.autoremovechildren===!0,this.smoothchildtiming=this.vars.smoothchildtiming===!0,this._sortchildren=!0,this._onupdate=this.vars.onupdate;var i,s,r=this.vars;for(s in r)i=r[s],a(i)&&-1!==i.join("").indexof("{self}")&&(r[s]=this._swapselfinparams(i));a(r.tweens)&&this.add(r.tweens,0,r.align,r.stagger)},r=1e-10,n=i._internals.isselector,a=i._internals.isarray,o=[],h=window._gsdefine.globals,l=function(t){var e,i={};for(e in t)i[e]=t[e];return i},_=function(t,e,i,s){t._timeline.pause(t._starttime),e&&e.apply(s||t._timeline,i||o)},u=o.slice,p=s.prototype=new e;return s.version="1.12.1",p.constructor=s,p.kill()._gc=!1,p.to=function(t,e,s,r){var n=s.repeat&&h.tweenmax||i;return e?this.add(new n(t,e,s),r):this.set(t,s,r)},p.from=function(t,e,s,r){return this.add((s.repeat&&h.tweenmax||i).from(t,e,s),r)},p.fromto=function(t,e,s,r,n){var a=r.repeat&&h.tweenmax||i;return e?this.add(a.fromto(t,e,s,r),n):this.set(t,r,n)},p.staggerto=function(t,e,r,a,o,h,_,p){var f,c=new s({oncomplete:h,oncompleteparams:_,oncompletescope:p,smoothchildtiming:this.smoothchildtiming});for("string"==typeof t&&(t=i.selector(t)||t),n(t)&&(t=u.call(t,0)),a=a||0,f=0;t.length>f;f++)r.startat&&(r.startat=l(r.startat)),c.to(t[f],e,l(r),f*a);return this.add(c,o)},p.staggerfrom=function(t,e,i,s,r,n,a,o){return i.immediaterender=0!=i.immediaterender,i.runbackwards=!0,this.staggerto(t,e,i,s,r,n,a,o)},p.staggerfromto=function(t,e,i,s,r,n,a,o,h){return s.startat=i,s.immediaterender=0!=s.immediaterender&&0!=i.immediaterender,this.staggerto(t,e,s,r,n,a,o,h)},p.call=function(t,e,s,r){return this.add(i.delayedcall(0,t,e,s),r)},p.set=function(t,e,s){return s=this._parsetimeorlabel(s,0,!0),null==e.immediaterender&&(e.immediaterender=s===this._time&&!this._paused),this.add(new i(t,0,e),s)},s.exportroot=function(t,e){t=t||{},null==t.smoothchildtiming&&(t.smoothchildtiming=!0);var r,n,a=new s(t),o=a._timeline;for(null==e&&(e=!0),o._remove(a,!0),a._starttime=0,a._rawprevtime=a._time=a._totaltime=o._time,r=o._first;r;)n=r._next,e&&r instanceof i&&r.target===r.vars.oncomplete||a.add(r,r._starttime-r._delay),r=n;return o.add(a,0),a},p.add=function(r,n,o,h){var l,_,u,p,f,c;if("number"!=typeof n&&(n=this._parsetimeorlabel(n,0,!0,r)),!(r instanceof t)){if(r instanceof array||r&&r.push&&a(r)){for(o=o||"normal",h=h||0,l=n,_=r.length,u=0;_>u;u++)a(p=r[u])&&(p=new s({tweens:p})),this.add(p,l),"string"!=typeof p&&"function"!=typeof p&&("sequence"===o?l=p._starttime+p.totalduration()/p._timescale:"start"===o&&(p._starttime-=p.delay())),l+=h;return this._uncache(!0)}if("string"==typeof r)return this.addlabel(r,n);if("function"!=typeof r)throw"cannot add "+r+" into the timeline; it is not a tween, timeline, function, or string.";r=i.delayedcall(0,r)}if(e.prototype.add.call(this,r,n),(this._gc||this._time===this._duration)&&!this._paused&&this._durationr._starttime;f._timeline;)c&&f._timeline.smoothchildtiming?f.totaltime(f._totaltime,!0):f._gc&&f._enabled(!0,!1),f=f._timeline;return this},p.remove=function(e){if(e instanceof t)return this._remove(e,!1);if(e instanceof array||e&&e.push&&a(e)){for(var i=e.length;--i>-1;)this.remove(e[i]);return this}return"string"==typeof e?this.removelabel(e):this.kill(null,e)},p._remove=function(t,i){e.prototype._remove.call(this,t,i);var s=this._last;return s?this._time>s._starttime+s._totalduration/s._timescale&&(this._time=this.duration(),this._totaltime=this._totalduration):this._time=this._totaltime=this._duration=this._totalduration=0,this},p.append=function(t,e){return this.add(t,this._parsetimeorlabel(null,e,!0,t))},p.insert=p.insertmultiple=function(t,e,i,s){return this.add(t,e||0,i,s)},p.appendmultiple=function(t,e,i,s){return this.add(t,this._parsetimeorlabel(null,e,!0,t),i,s)},p.addlabel=function(t,e){return this._labels[t]=this._parsetimeorlabel(e),this},p.addpause=function(t,e,i,s){return this.call(_,["{self}",e,i,s],this,t)},p.removelabel=function(t){return delete this._labels[t],this},p.getlabeltime=function(t){return null!=this._labels[t]?this._labels[t]:-1},p._parsetimeorlabel=function(e,i,s,r){var n;if(r instanceof t&&r.timeline===this)this.remove(r);else if(r&&(r instanceof array||r.push&&a(r)))for(n=r.length;--n>-1;)r[n]instanceof t&&r[n].timeline===this&&this.remove(r[n]);if("string"==typeof i)return this._parsetimeorlabel(i,s&&"number"==typeof e&&null==this._labels[i]?e-this.duration():0,s);if(i=i||0,"string"!=typeof e||!isnan(e)&&null==this._labels[e])null==e&&(e=this.duration());else{if(n=e.indexof("="),-1===n)return null==this._labels[e]?s?this._labels[e]=this.duration()+i:i:this._labels[e]+i;i=parseint(e.charat(n-1)+"1",10)*number(e.substr(n+1)),e=n>1?this._parsetimeorlabel(e.substr(0,n-1),0,s):this.duration()}return number(e)+i},p.seek=function(t,e){return this.totaltime("number"==typeof t?t:this._parsetimeorlabel(t),e!==!1)},p.stop=function(){return this.paused(!0)},p.gotoandplay=function(t,e){return this.play(t,e)},p.gotoandstop=function(t,e){return this.pause(t,e)},p.render=function(t,e,i){this._gc&&this._enabled(!0,!1);var s,n,a,h,l,_=this._dirty?this.totalduration():this._totalduration,u=this._time,p=this._starttime,f=this._timescale,c=this._paused;if(t>=_?(this._totaltime=this._time=_,this._reversed||this._haspausedchild()||(n=!0,h="oncomplete",0===this._duration&&(0===t||0>this._rawprevtime||this._rawprevtime===r)&&this._rawprevtime!==t&&this._first&&(l=!0,this._rawprevtime>r&&(h="onreversecomplete"))),this._rawprevtime=this._duration||!e||t||this._rawprevtime===t?t:r,t=_+1e-4):1e-7>t?(this._totaltime=this._time=0,(0!==u||0===this._duration&&this._rawprevtime!==r&&(this._rawprevtime>0||0>t&&this._rawprevtime>=0))&&(h="onreversecomplete",n=this._reversed),0>t?(this._active=!1,0===this._duration&&this._rawprevtime>=0&&this._first&&(l=!0),this._rawprevtime=t):(this._rawprevtime=this._duration||!e||t||this._rawprevtime===t?t:r,t=0,this._initted||(l=!0))):this._totaltime=this._time=this._rawprevtime=t,this._time!==u&&this._first||i||l){if(this._initted||(this._initted=!0),this._active||!this._paused&&this._time!==u&&t>0&&(this._active=!0),0===u&&this.vars.onstart&&0!==this._time&&(e||this.vars.onstart.apply(this.vars.onstartscope||this,this.vars.onstartparams||o)),this._time>=u)for(s=this._first;s&&(a=s._next,!this._paused||c);)(s._active||s._starttime<=this._time&&!s._paused&&!s._gc)&&(s._reversed?s.render((s._dirty?s.totalduration():s._totalduration)-(t-s._starttime)*s._timescale,e,i):s.render((t-s._starttime)*s._timescale,e,i)),s=a;else for(s=this._last;s&&(a=s._prev,!this._paused||c);)(s._active||u>=s._starttime&&!s._paused&&!s._gc)&&(s._reversed?s.render((s._dirty?s.totalduration():s._totalduration)-(t-s._starttime)*s._timescale,e,i):s.render((t-s._starttime)*s._timescale,e,i)),s=a;this._onupdate&&(e||this._onupdate.apply(this.vars.onupdatescope||this,this.vars.onupdateparams||o)),h&&(this._gc||(p===this._starttime||f!==this._timescale)&&(0===this._time||_>=this.totalduration())&&(n&&(this._timeline.autoremovechildren&&this._enabled(!1,!1),this._active=!1),!e&&this.vars[h]&&this.vars[h].apply(this.vars[h+"scope"]||this,this.vars[h+"params"]||o)))}},p._haspausedchild=function(){for(var t=this._first;t;){if(t._paused||t instanceof s&&t._haspausedchild())return!0;t=t._next}return!1},p.getchildren=function(t,e,s,r){r=r||-9999999999;for(var n=[],a=this._first,o=0;a;)r>a._starttime||(a instanceof i?e!==!1&&(n[o++]=a):(s!==!1&&(n[o++]=a),t!==!1&&(n=n.concat(a.getchildren(!0,e,s)),o=n.length))),a=a._next;return n},p.gettweensof=function(t,e){var s,r,n=this._gc,a=[],o=0;for(n&&this._enabled(!0,!0),s=i.gettweensof(t),r=s.length;--r>-1;)(s[r].timeline===this||e&&this._contains(s[r]))&&(a[o++]=s[r]);return n&&this._enabled(!1,!0),a},p._contains=function(t){for(var e=t.timeline;e;){if(e===this)return!0;e=e.timeline}return!1},p.shiftchildren=function(t,e,i){i=i||0;for(var s,r=this._first,n=this._labels;r;)r._starttime>=i&&(r._starttime+=t),r=r._next;if(e)for(s in n)n[s]>=i&&(n[s]+=t);return this._uncache(!0)},p._kill=function(t,e){if(!t&&!e)return this._enabled(!1,!1);for(var i=e?this.gettweensof(e):this.getchildren(!0,!0,!1),s=i.length,r=!1;--s>-1;)i[s]._kill(t,e)&&(r=!0);return r},p.clear=function(t){var e=this.getchildren(!1,!0,!0),i=e.length;for(this._time=this._totaltime=0;--i>-1;)e[i]._enabled(!1,!1);return t!==!1&&(this._labels={}),this._uncache(!0)},p.invalidate=function(){for(var t=this._first;t;)t.invalidate(),t=t._next;return this},p._enabled=function(t,i){if(t===this._gc)for(var s=this._first;s;)s._enabled(t,!0),s=s._next;return e.prototype._enabled.call(this,t,i)},p.duration=function(t){return arguments.length?(0!==this.duration()&&0!==t&&this.timescale(this._duration/t),this):(this._dirty&&this.totalduration(),this._duration)},p.totalduration=function(t){if(!arguments.length){if(this._dirty){for(var e,i,s=0,r=this._last,n=999999999999;r;)e=r._prev,r._dirty&&r.totalduration(),r._starttime>n&&this._sortchildren&&!r._paused?this.add(r,r._starttime-r._delay):n=r._starttime,0>r._starttime&&!r._paused&&(s-=r._starttime,this._timeline.smoothchildtiming&&(this._starttime+=r._starttime/this._timescale),this.shiftchildren(-r._starttime,!1,-9999999999),n=0),i=r._starttime+r._totalduration/r._timescale,i>s&&(s=i),r=e;this._duration=this._totalduration=s,this._dirty=!1}return this._totalduration}return 0!==this.totalduration()&&0!==t&&this.timescale(this._totalduration/t),this},p.usesframes=function(){for(var e=this._timeline;e._timeline;)e=e._timeline;return e===t._rootframestimeline},p.rawtime=function(){return this._paused?this._totaltime:(this._timeline.rawtime()-this._starttime)*this._timescale},s},!0),window._gsdefine("timelinemax",["timelinelite","tweenlite","easing.ease"],function(t,e,i){var s=function(e){t.call(this,e),this._repeat=this.vars.repeat||0,this._repeatdelay=this.vars.repeatdelay||0,this._cycle=0,this._yoyo=this.vars.yoyo===!0,this._dirty=!0},r=1e-10,n=[],a=new i(null,null,1,0),o=s.prototype=new t;return o.constructor=s,o.kill()._gc=!1,s.version="1.12.1",o.invalidate=function(){return this._yoyo=this.vars.yoyo===!0,this._repeat=this.vars.repeat||0,this._repeatdelay=this.vars.repeatdelay||0,this._uncache(!0),t.prototype.invalidate.call(this)},o.addcallback=function(t,i,s,r){return this.add(e.delayedcall(0,t,s,r),i)},o.removecallback=function(t,e){if(t)if(null==e)this._kill(null,t);else for(var i=this.gettweensof(t,!1),s=i.length,r=this._parsetimeorlabel(e);--s>-1;)i[s]._starttime===r&&i[s]._enabled(!1,!1);return this},o.tweento=function(t,i){i=i||{};var s,r,o,h={ease:a,overwrite:i.delay?2:1,useframes:this.usesframes(),immediaterender:!1};for(r in i)h[r]=i[r];return h.time=this._parsetimeorlabel(t),s=math.abs(number(h.time)-this._time)/this._timescale||.001,o=new e(this,s,h),h.onstart=function(){o.target.paused(!0),o.vars.time!==o.target.time()&&s===o.duration()&&o.duration(math.abs(o.vars.time-o.target.time())/o.target._timescale),i.onstart&&i.onstart.apply(i.onstartscope||o,i.onstartparams||n)},o},o.tweenfromto=function(t,e,i){i=i||{},t=this._parsetimeorlabel(t),i.startat={oncomplete:this.seek,oncompleteparams:[t],oncompletescope:this},i.immediaterender=i.immediaterender!==!1;var s=this.tweento(e,i);return s.duration(math.abs(s.vars.time-t)/this._timescale||.001)},o.render=function(t,e,i){this._gc&&this._enabled(!0,!1);var s,a,o,h,l,_,u=this._dirty?this.totalduration():this._totalduration,p=this._duration,f=this._time,c=this._totaltime,m=this._starttime,d=this._timescale,g=this._rawprevtime,v=this._paused,y=this._cycle;if(t>=u?(this._locked||(this._totaltime=u,this._cycle=this._repeat),this._reversed||this._haspausedchild()||(a=!0,h="oncomplete",0===this._duration&&(0===t||0>g||g===r)&&g!==t&&this._first&&(l=!0,g>r&&(h="onreversecomplete"))),this._rawprevtime=this._duration||!e||t||this._rawprevtime===t?t:r,this._yoyo&&0!==(1&this._cycle)?this._time=t=0:(this._time=p,t=p+1e-4)):1e-7>t?(this._locked||(this._totaltime=this._cycle=0),this._time=0,(0!==f||0===p&&g!==r&&(g>0||0>t&&g>=0)&&!this._locked)&&(h="onreversecomplete",a=this._reversed),0>t?(this._active=!1,0===p&&g>=0&&this._first&&(l=!0),this._rawprevtime=t):(this._rawprevtime=p||!e||t||this._rawprevtime===t?t:r,t=0,this._initted||(l=!0))):(0===p&&0>g&&(l=!0),this._time=this._rawprevtime=t,this._locked||(this._totaltime=t,0!==this._repeat&&(_=p+this._repeatdelay,this._cycle=this._totaltime/_>>0,0!==this._cycle&&this._cycle===this._totaltime/_&&this._cycle--,this._time=this._totaltime-this._cycle*_,this._yoyo&&0!==(1&this._cycle)&&(this._time=p-this._time),this._time>p?(this._time=p,t=p+1e-4):0>this._time?this._time=t=0:t=this._time))),this._cycle!==y&&!this._locked){var t=this._yoyo&&0!==(1&y),w=t===(this._yoyo&&0!==(1&this._cycle)),x=this._totaltime,b=this._cycle,p=this._rawprevtime,s=this._time;if(this._totaltime=y*p,y>this._cycle?t=!t:this._totaltime+=p,this._time=f,this._rawprevtime=0===p?g-1e-4:g,this._cycle=y,this._locked=!0,f=t?0:p,this.render(f,e,0===p),e||this._gc||this.vars.onrepeat&&this.vars.onrepeat.apply(this.vars.onrepeatscope||this,this.vars.onrepeatparams||n),w&&(f=t?p+1e-4:-1e-4,this.render(f,!0,!1)),this._locked=!1,this._paused&&!v)return;this._time=s,this._totaltime=x,this._cycle=b,this._rawprevtime=p}if(!(this._time!==f&&this._first||i||l))return c!==this._totaltime&&this._onupdate&&(e||this._onupdate.apply(this.vars.onupdatescope||this,this.vars.onupdateparams||n)),void 0;if(this._initted||(this._initted=!0),this._active||!this._paused&&this._totaltime!==c&&t>0&&(this._active=!0),0===c&&this.vars.onstart&&0!==this._totaltime&&(e||this.vars.onstart.apply(this.vars.onstartscope||this,this.vars.onstartparams||n)),this._time>=f)for(s=this._first;s&&(o=s._next,!this._paused||v);)(s._active||s._starttime<=this._time&&!s._paused&&!s._gc)&&(s._reversed?s.render((s._dirty?s.totalduration():s._totalduration)-(t-s._starttime)*s._timescale,e,i):s.render((t-s._starttime)*s._timescale,e,i)),s=o;else for(s=this._last;s&&(o=s._prev,!this._paused||v);)(s._active||f>=s._starttime&&!s._paused&&!s._gc)&&(s._reversed?s.render((s._dirty?s.totalduration():s._totalduration)-(t-s._starttime)*s._timescale,e,i):s.render((t-s._starttime)*s._timescale,e,i)),s=o;this._onupdate&&(e||this._onupdate.apply(this.vars.onupdatescope||this,this.vars.onupdateparams||n)),h&&(this._locked||this._gc||(m===this._starttime||d!==this._timescale)&&(0===this._time||u>=this.totalduration())&&(a&&(this._timeline.autoremovechildren&&this._enabled(!1,!1),this._active=!1),!e&&this.vars[h]&&this.vars[h].apply(this.vars[h+"scope"]||this,this.vars[h+"params"]||n)))},o.getactive=function(t,e,i){null==t&&(t=!0),null==e&&(e=!0),null==i&&(i=!1);var s,r,n=[],a=this.getchildren(t,e,i),o=0,h=a.length;for(s=0;h>s;s++)r=a[s],r.isactive()&&(n[o++]=r);return n},o.getlabelafter=function(t){t||0!==t&&(t=this._time);var e,i=this.getlabelsarray(),s=i.length;for(e=0;s>e;e++)if(i[e].time>t)return i[e].name;return null},o.getlabelbefore=function(t){null==t&&(t=this._time);for(var e=this.getlabelsarray(),i=e.length;--i>-1;)if(t>e[i].time)return e[i].name;return null},o.getlabelsarray=function(){var t,e=[],i=0;for(t in this._labels)e[i++]={time:this._labels[t],name:t};return e.sort(function(t,e){return t.time-e.time}),e},o.progress=function(t){return arguments.length?this.totaltime(this.duration()*(this._yoyo&&0!==(1&this._cycle)?1-t:t)+this._cycle*(this._duration+this._repeatdelay),!1):this._time/this.duration()},o.totalprogress=function(t){return arguments.length?this.totaltime(this.totalduration()*t,!1):this._totaltime/this.totalduration()},o.totalduration=function(e){return arguments.length?-1===this._repeat?this:this.duration((e-this._repeat*this._repeatdelay)/(this._repeat+1)):(this._dirty&&(t.prototype.totalduration.call(this),this._totalduration=-1===this._repeat?999999999999:this._duration*(this._repeat+1)+this._repeatdelay*this._repeat),this._totalduration)},o.time=function(t,e){return arguments.length?(this._dirty&&this.totalduration(),t>this._duration&&(t=this._duration),this._yoyo&&0!==(1&this._cycle)?t=this._duration-t+this._cycle*(this._duration+this._repeatdelay):0!==this._repeat&&(t+=this._cycle*(this._duration+this._repeatdelay)),this.totaltime(t,e)):this._time},o.repeat=function(t){return arguments.length?(this._repeat=t,this._uncache(!0)):this._repeat},o.repeatdelay=function(t){return arguments.length?(this._repeatdelay=t,this._uncache(!0)):this._repeatdelay},o.yoyo=function(t){return arguments.length?(this._yoyo=t,this):this._yoyo},o.currentlabel=function(t){return arguments.length?this.seek(t,!0):this.getlabelbefore(this._time+1e-8)},s},!0),function(){var t=180/math.pi,e=[],i=[],s=[],r={},n=function(t,e,i,s){this.a=t,this.b=e,this.c=i,this.d=s,this.da=s-t,this.ca=i-t,this.ba=e-t},a=",x,y,z,left,top,right,bottom,margintop,marginleft,marginright,marginbottom,paddingleft,paddingtop,paddingright,paddingbottom,backgroundposition,backgroundposition_y,",o=function(t,e,i,s){var r={a:t},n={},a={},o={c:s},h=(t+e)/2,l=(e+i)/2,_=(i+s)/2,u=(h+l)/2,p=(l+_)/2,f=(p-u)/8;return r.b=h+(t-h)/4,n.b=u+f,r.c=n.a=(r.b+n.b)/2,n.c=a.a=(u+p)/2,a.b=p-f,o.b=_+(s-_)/4,a.c=o.a=(a.b+o.b)/2,[r,n,a,o]},h=function(t,r,n,a,h){var l,_,u,p,f,c,m,d,g,v,y,t,w,x=t.length-1,b=0,p=t[0].a;for(l=0;x>l;l++)f=t[b],_=f.a,u=f.d,p=t[b+1].d,h?(y=e[l],t=i[l],w=.25*(t+y)*r/(a?.5:s[l]||.5),c=u-(u-_)*(a?.5*r:0!==y?w/y:0),m=u+(p-u)*(a?.5*r:0!==t?w/t:0),d=u-(c+((m-c)*(3*y/(y+t)+.5)/4||0))):(c=u-.5*(u-_)*r,m=u+.5*(p-u)*r,d=u-(c+m)/2),c+=d,m+=d,f.c=g=c,f.b=0!==l?p:p=f.a+.6*(f.c-f.a),f.da=u-_,f.ca=g-_,f.ba=p-_,n?(v=o(_,p,g,u),t.splice(b,1,v[0],v[1],v[2],v[3]),b+=4):b++,p=m;f=t[b],f.b=p,f.c=p+.4*(f.d-p),f.da=f.d-f.a,f.ca=f.c-f.a,f.ba=p-f.a,n&&(v=o(f.a,p,f.c,f.d),t.splice(b,1,v[0],v[1],v[2],v[3]))},l=function(t,s,r,a){var o,h,l,_,u,p,f=[];if(a)for(t=[a].concat(t),h=t.length;--h>-1;)"string"==typeof(p=t[h][s])&&"="===p.charat(1)&&(t[h][s]=a[s]+number(p.charat(0)+p.substr(2)));if(o=t.length-2,0>o)return f[0]=new n(t[0][s],0,0,t[-1>o?0:1][s]),f;for(h=0;o>h;h++)l=t[h][s],_=t[h+1][s],f[h]=new n(l,0,0,_),r&&(u=t[h+2][s],e[h]=(e[h]||0)+(_-l)*(_-l),i[h]=(i[h]||0)+(u-_)*(u-_));return f[h]=new n(t[h][s],0,0,t[h+1][s]),f},_=function(t,n,o,_,u,p){var f,c,m,d,g,v,y,t,w={},x=[],b=p||t[0];u="string"==typeof u?","+u+",":a,null==n&&(n=1);for(c in t[0])x.push(c);if(t.length>1){for(t=t[t.length-1],y=!0,f=x.length;--f>-1;)if(c=x[f],math.abs(b[c]-t[c])>.05){y=!1;break}y&&(t=t.concat(),p&&t.unshift(p),t.push(t[1]),p=t[t.length-3])}for(e.length=i.length=s.length=0,f=x.length;--f>-1;)c=x[f],r[c]=-1!==u.indexof(","+c+","),w[c]=l(t,c,r[c],p);for(f=e.length;--f>-1;)e[f]=math.sqrt(e[f]),i[f]=math.sqrt(i[f]);if(!_){for(f=x.length;--f>-1;)if(r[c])for(m=w[x[f]],v=m.length-1,d=0;v>d;d++)g=m[d+1].da/i[d]+m[d].da/e[d],s[d]=(s[d]||0)+g*g;for(f=s.length;--f>-1;)s[f]=math.sqrt(s[f])}for(f=x.length,d=o?4:1;--f>-1;)c=x[f],m=w[c],h(m,n,o,_,r[c]),y&&(m.splice(0,d),m.splice(m.length-d,d));return w},u=function(t,e,i){e=e||"soft";var s,r,a,o,h,l,_,u,p,f,c,m={},d="cubic"===e?3:2,g="soft"===e,v=[];if(g&&i&&(t=[i].concat(t)),null==t||d+1>t.length)throw"invalid bezier data";for(p in t[0])v.push(p);for(l=v.length;--l>-1;){for(p=v[l],m[p]=h=[],f=0,u=t.length,_=0;u>_;_++)s=null==i?t[_][p]:"string"==typeof(c=t[_][p])&&"="===c.charat(1)?i[p]+number(c.charat(0)+c.substr(2)):number(c),g&&_>1&&u-1>_&&(h[f++]=(s+h[f-2])/2),h[f++]=s;for(u=f-d+1,f=0,_=0;u>_;_+=d)s=h[_],r=h[_+1],a=h[_+2],o=2===d?0:h[_+3],h[f++]=c=3===d?new n(s,r,a,o):new n(s,(2*r+s)/3,(2*r+a)/3,a);h.length=f}return m},p=function(t,e,i){for(var s,r,n,a,o,h,l,_,u,p,f,c=1/i,m=t.length;--m>-1;)for(p=t[m],n=p.a,a=p.d-n,o=p.c-n,h=p.b-n,s=r=0,_=1;i>=_;_++)l=c*_,u=1-l,s=r-(r=(l*l*a+3*u*(l*o+u*h))*l),f=m*i+_-1,e[f]=(e[f]||0)+s*s},f=function(t,e){e=e>>0||6;var i,s,r,n,a=[],o=[],h=0,l=0,_=e-1,u=[],f=[];for(i in t)p(t[i],a,e);for(r=a.length,s=0;r>s;s++)h+=math.sqrt(a[s]),n=s%e,f[n]=h,n===_&&(l+=h,n=s/e>>0,u[n]=f,o[n]=l,h=0,f=[]);return{length:l,lengths:o,segments:u}},c=window._gsdefine.plugin({propname:"bezier",priority:-1,version:"1.3.2",api:2,global:!0,init:function(t,e,i){this._target=t,e instanceof array&&(e={values:e}),this._func={},this._round={},this._props=[],this._timeres=null==e.timeresolution?6:parseint(e.timeresolution,10);var s,r,n,a,o,h=e.values||[],l={},p=h[0],c=e.autorotate||i.vars.orienttobezier;this._autorotate=c?c instanceof array?c:[["x","y","rotation",c===!0?0:number(c)||0]]:null;for(s in p)this._props.push(s);for(n=this._props.length;--n>-1;)s=this._props[n],this._overwriteprops.push(s),r=this._func[s]="function"==typeof t[s],l[s]=r?t[s.indexof("set")||"function"!=typeof t["get"+s.substr(3)]?s:"get"+s.substr(3)]():parsefloat(t[s]),o||l[s]!==h[0][s]&&(o=l);if(this._beziers="cubic"!==e.type&&"quadratic"!==e.type&&"soft"!==e.type?_(h,isnan(e.curviness)?1:e.curviness,!1,"thrubasic"===e.type,e.correlate,o):u(h,e.type,l),this._segcount=this._beziers[s].length,this._timeres){var m=f(this._beziers,this._timeres);this._length=m.length,this._lengths=m.lengths,this._segments=m.segments,this._l1=this._li=this._s1=this._si=0,this._l2=this._lengths[0],this._curseg=this._segments[0],this._s2=this._curseg[0],this._prec=1/this._curseg.length}if(c=this._autorotate)for(this._initialrotations=[],c[0]instanceof array||(this._autorotate=c=[c]),n=c.length;--n>-1;){for(a=0;3>a;a++)s=c[n][a],this._func[s]="function"==typeof t[s]?t[s.indexof("set")||"function"!=typeof t["get"+s.substr(3)]?s:"get"+s.substr(3)]:!1;s=c[n][2],this._initialrotations[n]=this._func[s]?this._func[s].call(this._target):this._target[s]}return this._startratio=i.vars.runbackwards?1:0,!0},set:function(e){var i,s,r,n,a,o,h,l,_,u,p=this._segcount,f=this._func,c=this._target,m=e!==this._startratio;if(this._timeres){if(_=this._lengths,u=this._curseg,e*=this._length,r=this._li,e>this._l2&&p-1>r){for(l=p-1;l>r&&e>=(this._l2=_[++r]););this._l1=_[r-1],this._li=r,this._curseg=u=this._segments[r],this._s2=u[this._s1=this._si=0]}else if(this._l1>e&&r>0){for(;r>0&&(this._l1=_[--r])>=e;);0===r&&this._l1>e?this._l1=0:r++,this._l2=_[r],this._li=r,this._curseg=u=this._segments[r],this._s1=u[(this._si=u.length-1)-1]||0,this._s2=u[this._si]}if(i=r,e-=this._l1,r=this._si,e>this._s2&&u.length-1>r){for(l=u.length-1;l>r&&e>=(this._s2=u[++r]););this._s1=u[r-1],this._si=r}else if(this._s1>e&&r>0){for(;r>0&&(this._s1=u[--r])>=e;);0===r&&this._s1>e?this._s1=0:r++,this._s2=u[r],this._si=r}o=(r+(e-this._s1)/(this._s2-this._s1))*this._prec}else i=0>e?0:e>=1?p-1:p*e>>0,o=(e-i*(1/p))*p;for(s=1-o,r=this._props.length;--r>-1;)n=this._props[r],a=this._beziers[n][i],h=(o*o*a.da+3*s*(o*a.ca+s*a.ba))*o+a.a,this._round[n]&&(h=math.round(h)),f[n]?c[n](h):c[n]=h;if(this._autorotate){var d,g,v,y,t,w,x,b=this._autorotate;for(r=b.length;--r>-1;)n=b[r][2],w=b[r][3]||0,x=b[r][4]===!0?1:t,a=this._beziers[b[r][0]],d=this._beziers[b[r][1]],a&&d&&(a=a[i],d=d[i],g=a.a+(a.b-a.a)*o,y=a.b+(a.c-a.b)*o,g+=(y-g)*o,y+=(a.c+(a.d-a.c)*o-y)*o,v=d.a+(d.b-d.a)*o,t=d.b+(d.c-d.b)*o,v+=(t-v)*o,t+=(d.c+(d.d-d.c)*o-t)*o,h=m?math.atan2(t-v,y-g)*x+w:this._initialrotations[r],f[n]?c[n](h):c[n]=h) }}}),m=c.prototype;c.bezierthrough=_,c.cubictoquadratic=o,c._autocss=!0,c.quadratictocubic=function(t,e,i){return new n(t,(2*e+t)/3,(2*e+i)/3,i)},c._cssregister=function(){var t=window._gsdefine.globals.cssplugin;if(t){var e=t._internals,i=e._parsetoproxy,s=e._setpluginratio,r=e.cssproptween;e._registercomplexspecialprop("bezier",{parser:function(t,e,n,a,o,h){e instanceof array&&(e={values:e}),h=new c;var l,_,u,p=e.values,f=p.length-1,m=[],d={};if(0>f)return o;for(l=0;f>=l;l++)u=i(t,p[l],a,o,h,f!==l),m[l]=u.end;for(_ in e)d[_]=e[_];return d.values=m,o=new r(t,"bezier",0,0,u.pt,2),o.data=u,o.plugin=h,o.setratio=s,0===d.autorotate&&(d.autorotate=!0),!d.autorotate||d.autorotate instanceof array||(l=d.autorotate===!0?0:number(d.autorotate),d.autorotate=null!=u.end.left?[["left","top","rotation",l,!1]]:null!=u.end.x?[["x","y","rotation",l,!1]]:!1),d.autorotate&&(a._transform||a._enabletransforms(!1),u.autorotate=a._target._gstransform),h._oninittween(u.proxy,d,a._tween),o}})}},m._roundprops=function(t,e){for(var i=this._overwriteprops,s=i.length;--s>-1;)(t[i[s]]||t.bezier||t.bezierthrough)&&(this._round[i[s]]=e)},m._kill=function(t){var e,i,s=this._props;for(e in this._beziers)if(e in t)for(delete this._beziers[e],delete this._func[e],i=s.length;--i>-1;)s[i]===e&&s.splice(i,1);return this._super._kill.call(this,t)}}(),window._gsdefine("plugins.cssplugin",["plugins.tweenplugin","tweenlite"],function(t,e){var i,s,r,n,a=function(){t.call(this,"css"),this._overwriteprops.length=0,this.setratio=a.prototype.setratio},o={},h=a.prototype=new t("css");h.constructor=a,a.version="1.12.1",a.api=2,a.defaulttransformperspective=0,a.defaultskewtype="compensated",h="px",a.suffixmap={top:h,right:h,bottom:h,left:h,width:h,height:h,fontsize:h,padding:h,margin:h,perspective:h,lineheight:""};var l,_,u,p,f,c,m=/(?:\d|\-\d|\.\d|\-\.\d)+/g,d=/(?:\d|\-\d|\.\d|\-\.\d|\+=\d|\-=\d|\+=.\d|\-=\.\d)+/g,g=/(?:\+=|\-=|\-|\b)[\d\-\.]+[a-za-z0-9]*(?:%|\b)/gi,v=/[^\d\-\.]/g,y=/(?:\d|\-|\+|=|#|\.)*/g,t=/opacity *= *([^)]*)/i,w=/opacity:([^;]*)/i,x=/alpha\(opacity *=.+?\)/i,b=/^(rgb|hsl)/,p=/([a-z])/g,s=/-([a-z])/gi,k=/(^(?:url\(\"|url\())|(?:(\"\))$|\)$)/gi,r=function(t,e){return e.touppercase()},a=/(?:left|right|width)/i,c=/(m11|m12|m21|m22)=[\d\-\.e]+/gi,o=/progid\:dximagetransform\.microsoft\.matrix\(.+?\)/i,d=/,(?=[^\)]*(?:\(|$))/gi,m=math.pi/180,z=180/math.pi,i={},e=document,l=e.createelement("div"),f=e.createelement("img"),n=a._internals={_specialprops:o},x=navigator.useragent,u=function(){var t,e=x.indexof("android"),i=e.createelement("div");return u=-1!==x.indexof("safari")&&-1===x.indexof("chrome")&&(-1===e||number(x.substr(e+8,1))>3),f=u&&6>number(x.substr(x.indexof("version/")+8,1)),p=-1!==x.indexof("firefox"),/msie ([0-9]{1,}[\.0-9]{0,})/.exec(x)&&(c=parsefloat(regexp.$1)),i.innerhtml="a",t=i.getelementsbytagname("a")[0],t?/^0.55/.test(t.style.opacity):!1}(),y=function(t){return t.test("string"==typeof t?t:(t.currentstyle?t.currentstyle.filter:t.style.filter)||"")?parsefloat(regexp.$1)/100:1},j=function(t){window.console&&console.log(t)},b="",q="",v=function(t,e){e=e||l;var i,s,r=e.style;if(void 0!==r[t])return t;for(t=t.charat(0).touppercase()+t.substr(1),i=["o","moz","ms","ms","webkit"],s=5;--s>-1&&void 0===r[i[s]+t];);return s>=0?(q=3===s?"ms":i[s],b="-"+q.tolowercase()+"-",q+t):null},w=e.defaultview?e.defaultview.getcomputedstyle:function(){},g=a.getstyle=function(t,e,i,s,r){var n;return u||"opacity"!==e?(!s&&t.style[e]?n=t.style[e]:(i=i||w(t))?n=i[e]||i.getpropertyvalue(e)||i.getpropertyvalue(e.replace(p,"-$1").tolowercase()):t.currentstyle&&(n=t.currentstyle[e]),null==r||n&&"none"!==n&&"auto"!==n&&"auto auto"!==n?n:r):y(t)},$=n.converttopixels=function(t,i,s,r,n){if("px"===r||!r)return s;if("auto"===r||!s)return 0;var o,h,l,_=a.test(i),u=t,p=l.style,f=0>s;if(f&&(s=-s),"%"===r&&-1!==i.indexof("border"))o=s/100*(_?t.clientwidth:t.clientheight);else{if(p.csstext="border:0 solid red;position:"+g(t,"position")+";line-height:0;","%"!==r&&u.appendchild)p[_?"borderleftwidth":"bordertopwidth"]=s+r;else{if(u=t.parentnode||e.body,h=u._gscache,l=e.ticker.frame,h&&_&&h.time===l)return h.width*s/100;p[_?"width":"height"]=s+r}u.appendchild(l),o=parsefloat(l[_?"offsetwidth":"offsetheight"]),u.removechild(l),_&&"%"===r&&a.cachewidths!==!1&&(h=u._gscache=u._gscache||{},h.time=l,h.width=100*(o/s)),0!==o||n||(o=$(t,i,s,r,!0))}return f?-o:o},z=n.calculateoffset=function(t,e,i){if("absolute"!==g(t,"position",i))return 0;var s="left"===e?"left":"top",r=g(t,"margin"+s,i);return t["offset"+s]-($(t,e,parsefloat(r),r.replace(y,""))||0)},q=function(t,e){var i,s,r={};if(e=e||w(t,null))if(i=e.length)for(;--i>-1;)r[e[i].replace(s,r)]=e.getpropertyvalue(e[i]);else for(i in e)r[i]=e[i];else if(e=t.currentstyle||t.style)for(i in e)"string"==typeof i&&void 0===r[i]&&(r[i.replace(s,r)]=e[i]);return u||(r.opacity=y(t)),s=pe(t,e,!1),r.rotation=s.rotation,r.skewx=s.skewx,r.scalex=s.scalex,r.scaley=s.scaley,r.x=s.x,r.y=s.y,xe&&(r.z=s.z,r.rotationx=s.rotationx,r.rotationy=s.rotationy,r.scalez=s.scalez),r.filters&&delete r.filters,r},h=function(t,e,i,s,r){var n,a,o,h={},l=t.style;for(a in i)"csstext"!==a&&"length"!==a&&isnan(a)&&(e[a]!==(n=i[a])||r&&r[a])&&-1===a.indexof("origin")&&("number"==typeof n||"string"==typeof n)&&(h[a]="auto"!==n||"left"!==a&&"top"!==a?""!==n&&"auto"!==n&&"none"!==n||"string"!=typeof e[a]||""===e[a].replace(v,"")?n:0:z(t,a),void 0!==l[a]&&(o=new ue(l,a,l[a],o)));if(s)for(a in s)"classname"!==a&&(h[a]=s[a]);return{difs:h,firstmpt:o}},k={width:["left","right"],height:["top","bottom"]},j=["marginleft","marginright","margintop","marginbottom"],te=function(t,e,i){var s=parsefloat("width"===e?t.offsetwidth:t.offsetheight),r=k[e],n=r.length;for(i=i||w(t,null);--n>-1;)s-=parsefloat(g(t,"padding"+r[n],i,!0))||0,s-=parsefloat(g(t,"border"+r[n]+"width",i,!0))||0;return s},ee=function(t,e){(null==t||""===t||"auto"===t||"auto auto"===t)&&(t="0 0");var i=t.split(" "),s=-1!==t.indexof("left")?"0%":-1!==t.indexof("right")?"100%":i[0],r=-1!==t.indexof("top")?"0%":-1!==t.indexof("bottom")?"100%":i[1];return null==r?r="0":"center"===r&&(r="50%"),("center"===s||isnan(parsefloat(s))&&-1===(s+"").indexof("="))&&(s="50%"),e&&(e.oxp=-1!==s.indexof("%"),e.oyp=-1!==r.indexof("%"),e.oxr="="===s.charat(1),e.oyr="="===r.charat(1),e.ox=parsefloat(s.replace(v,"")),e.oy=parsefloat(r.replace(v,""))),s+" "+r+(i.length>2?" "+i[2]:"")},ie=function(t,e){return"string"==typeof t&&"="===t.charat(1)?parseint(t.charat(0)+"1",10)*parsefloat(t.substr(2)):parsefloat(t)-parsefloat(e)},se=function(t,e){return null==t?e:"string"==typeof t&&"="===t.charat(1)?parseint(t.charat(0)+"1",10)*number(t.substr(2))+e:parsefloat(t)},re=function(t,e,i,s){var r,n,a,o,h=1e-6;return null==t?o=e:"number"==typeof t?o=t:(r=360,n=t.split("_"),a=number(n[0].replace(v,""))*(-1===t.indexof("rad")?1:z)-("="===t.charat(1)?0:e),n.length&&(s&&(s[i]=e+a),-1!==t.indexof("short")&&(a%=r,a!==a%(r/2)&&(a=0>a?a+r:a-r)),-1!==t.indexof("_cw")&&0>a?a=(a+9999999999*r)%r-(0|a/r)*r:-1!==t.indexof("ccw")&&a>0&&(a=(a-9999999999*r)%r-(0|a/r)*r)),o=e+a),h>o&&o>-h&&(o=0),o},ne={aqua:[0,255,255],lime:[0,255,0],silver:[192,192,192],black:[0,0,0],maroon:[128,0,0],teal:[0,128,128],blue:[0,0,255],navy:[0,0,128],white:[255,255,255],fuchsia:[255,0,255],olive:[128,128,0],yellow:[255,255,0],orange:[255,165,0],gray:[128,128,128],purple:[128,0,128],green:[0,128,0],red:[255,0,0],pink:[255,192,203],cyan:[0,255,255],transparent:[255,255,255,0]},ae=function(t,e,i){return t=0>t?t+1:t>1?t-1:t,0|255*(1>6*t?e+6*(i-e)*t:.5>t?i:2>3*t?e+6*(i-e)*(2/3-t):e)+.5},oe=function(t){var e,i,s,r,n,a;return t&&""!==t?"number"==typeof t?[t>>16,255&t>>8,255&t]:(","===t.charat(t.length-1)&&(t=t.substr(0,t.length-1)),ne[t]?ne[t]:"#"===t.charat(0)?(4===t.length&&(e=t.charat(1),i=t.charat(2),s=t.charat(3),t="#"+e+e+i+i+s+s),t=parseint(t.substr(1),16),[t>>16,255&t>>8,255&t]):"hsl"===t.substr(0,3)?(t=t.match(m),r=number(t[0])%360/360,n=number(t[1])/100,a=number(t[2])/100,i=.5>=a?a*(n+1):a+n-a*n,e=2*a-i,t.length>3&&(t[3]=number(t[3])),t[0]=ae(r+1/3,e,i),t[1]=ae(r,e,i),t[2]=ae(r-1/3,e,i),t):(t=t.match(m)||ne.transparent,t[0]=number(t[0]),t[1]=number(t[1]),t[2]=number(t[2]),t.length>3&&(t[3]=number(t[3])),t)):ne.black},he="(?:\\b(?:(?:rgb|rgba|hsl|hsla)\\(.+?\\))|\\b#.+?\\b";for(h in ne)he+="|"+h+"\\b";he=regexp(he+")","gi");var le=function(t,e,i,s){if(null==t)return function(t){return t};var r,n=e?(t.match(he)||[""])[0]:"",a=t.split(n).join("").match(g)||[],o=t.substr(0,t.indexof(a[0])),h=")"===t.charat(t.length-1)?")":"",l=-1!==t.indexof(" ")?" ":",",_=a.length,u=_>0?a[0].replace(m,""):"";return _?r=e?function(t){var e,p,f,c;if("number"==typeof t)t+=u;else if(s&&d.test(t)){for(c=t.replace(d,"|").split("|"),f=0;c.length>f;f++)c[f]=r(c[f]);return c.join(",")}if(e=(t.match(he)||[n])[0],p=t.split(e).join("").match(g)||[],f=p.length,_>f--)for(;_>++f;)p[f]=i?p[0|(f-1)/2]:a[f];return o+p.join(l)+l+e+h+(-1!==t.indexof("inset")?" inset":"")}:function(t){var e,n,p;if("number"==typeof t)t+=u;else if(s&&d.test(t)){for(n=t.replace(d,"|").split("|"),p=0;n.length>p;p++)n[p]=r(n[p]);return n.join(",")}if(e=t.match(g)||[],p=e.length,_>p--)for(;_>++p;)e[p]=i?e[0|(p-1)/2]:a[p];return o+e.join(l)+h}:function(t){return t}},_e=function(t){return t=t.split(","),function(e,i,s,r,n,a,o){var h,l=(i+"").split(" ");for(o={},h=0;4>h;h++)o[t[h]]=l[h]=l[h]||l[(h-1)/2>>0];return r.parse(e,o,n,a)}},ue=(n._setpluginratio=function(t){this.plugin.setratio(t);for(var e,i,s,r,n=this.data,a=n.proxy,o=n.firstmpt,h=1e-6;o;)e=a[o.v],o.r?e=math.round(e):h>e&&e>-h&&(e=0),o.t[o.p]=e,o=o._next;if(n.autorotate&&(n.autorotate.rotation=a.rotation),1===t)for(o=n.firstmpt;o;){if(i=o.t,i.type){if(1===i.type){for(r=i.xs0+i.s+i.xs1,s=1;i.l>s;s++)r+=i["xn"+s]+i["xs"+(s+1)];i.e=r}}else i.e=i.s+i.xs0;o=o._next}},function(t,e,i,s,r){this.t=t,this.p=e,this.v=i,this.r=r,s&&(s._prev=this,this._next=s)}),pe=(n._parsetoproxy=function(t,e,i,s,r,n){var a,o,h,l,_,u=s,p={},f={},c=i._transform,m=i;for(i._transform=null,i=e,s=_=i.parse(t,e,s,r),i=m,n&&(i._transform=c,u&&(u._prev=null,u._prev&&(u._prev._next=null)));s&&s!==u;){if(1>=s.type&&(o=s.p,f[o]=s.s+s.c,p[o]=s.s,n||(l=new ue(s,"s",o,l,s.r),s.c=0),1===s.type))for(a=s.l;--a>0;)h="xn"+a,o=s.p+"_"+h,f[o]=s.data[h],p[o]=s[h],n||(l=new ue(s,h,o,l,s.rxp[h]));s=s._next}return{proxy:p,end:f,firstmpt:l,pt:_}},n.cssproptween=function(t,e,s,r,a,o,h,l,_,u,p){this.t=t,this.p=e,this.s=s,this.c=r,this.n=h||e,t instanceof pe||n.push(this.n),this.r=l,this.type=o||0,_&&(this.pr=_,i=!0),this.b=void 0===u?s:u,this.e=void 0===p?s+r:p,a&&(this._next=a,a._prev=this)}),fe=a.parsecomplex=function(t,e,i,s,r,n,a,o,h,_){i=i||n||"",a=new pe(t,e,0,0,a,_?2:1,null,!1,o,i,s),s+="";var u,p,f,c,g,v,y,t,w,x,p,s,k=i.split(", ").join(",").split(" "),r=s.split(", ").join(",").split(" "),a=k.length,c=l!==!1;for((-1!==s.indexof(",")||-1!==i.indexof(","))&&(k=k.join(" ").replace(d,", ").split(" "),r=r.join(" ").replace(d,", ").split(" "),a=k.length),a!==r.length&&(k=(n||"").split(" "),a=k.length),a.plugin=h,a.setratio=_,u=0;a>u;u++)if(c=k[u],g=r[u],t=parsefloat(c),t||0===t)a.appendxtra("",t,ie(g,t),g.replace(d,""),c&&-1!==g.indexof("px"),!0);else if(r&&("#"===c.charat(0)||ne[c]||b.test(c)))s=","===g.charat(g.length-1)?"),":")",c=oe(c),g=oe(g),w=c.length+g.length>6,w&&!u&&0===g[3]?(a["xs"+a.l]+=a.l?" transparent":"transparent",a.e=a.e.split(r[u]).join("transparent")):(u||(w=!1),a.appendxtra(w?"rgba(":"rgb(",c[0],g[0]-c[0],",",!0,!0).appendxtra("",c[1],g[1]-c[1],",",!0).appendxtra("",c[2],g[2]-c[2],w?",":s,!0),w&&(c=4>c.length?1:c[3],a.appendxtra("",c,(4>g.length?1:g[3])-c,s,!1)));else if(v=c.match(m)){if(y=g.match(d),!y||y.length!==v.length)return a;for(f=0,p=0;v.length>p;p++)p=v[p],x=c.indexof(p,f),a.appendxtra(c.substr(f,x-f),number(p),ie(y[p],p),"",c&&"px"===c.substr(x+p.length,2),0===p),f=x+p.length;a["xs"+a.l]+=c.substr(f)}else a["xs"+a.l]+=a.l?" "+c:c;if(-1!==s.indexof("=")&&a.data){for(s=a.xs0+a.data.s,u=1;a.l>u;u++)s+=a["xs"+u]+a.data["xn"+u];a.e=s+a["xs"+u]}return a.l||(a.type=-1,a.xs0=a.e),a.xfirst||a},ce=9;for(h=pe.prototype,h.l=h.pr=0;--ce>0;)h["xn"+ce]=0,h["xs"+ce]="";h.xs0="",h._next=h._prev=h.xfirst=h.data=h.plugin=h.setratio=h.rxp=null,h.appendxtra=function(t,e,i,s,r,n){var a=this,o=a.l;return a["xs"+o]+=n&&o?" "+t:t||"",i||0===o||a.plugin?(a.l++,a.type=a.setratio?2:1,a["xs"+a.l]=s||"",o>0?(a.data["xn"+o]=e+i,a.rxp["xn"+o]=r,a["xn"+o]=e,a.plugin||(a.xfirst=new pe(a,"xn"+o,e,i,a.xfirst||a,0,a.n,r,a.pr),a.xfirst.xs0=0),a):(a.data={s:e+i},a.rxp={},a.s=e,a.c=i,a.r=r,a)):(a["xs"+o]+=e+(s||""),a)};var me=function(t,e){e=e||{},this.p=e.prefix?v(t)||t:t,o[t]=o[this.p]=this,this.format=e.formatter||le(e.defaultvalue,e.color,e.collapsible,e.multi),e.parser&&(this.parse=e.parser),this.clrs=e.color,this.multi=e.multi,this.keyword=e.keyword,this.dflt=e.defaultvalue,this.pr=e.priority||0},de=n._registercomplexspecialprop=function(t,e,i){"object"!=typeof e&&(e={parser:i});var s,r,n=t.split(","),a=e.defaultvalue;for(i=i||[a],s=0;n.length>s;s++)e.prefix=0===s&&e.prefix,e.defaultvalue=i[s]||a,r=new me(n[s],e)},ge=function(t){if(!o[t]){var e=t.charat(0).touppercase()+t.substr(1)+"plugin";de(t,{parser:function(t,i,s,r,n,a,h){var l=(window.greensockglobals||window).com.greensock.plugins[e];return l?(l._cssregister(),o[s].parse(t,i,s,r,n,a,h)):(j("error: "+e+" js file not loaded."),n)}})}};h=me.prototype,h.parsecomplex=function(t,e,i,s,r,n){var a,o,h,l,_,u,p=this.keyword;if(this.multi&&(d.test(i)||d.test(e)?(o=e.replace(d,"|").split("|"),h=i.replace(d,"|").split("|")):p&&(o=[e],h=[i])),h){for(l=h.length>o.length?h.length:o.length,a=0;l>a;a++)e=o[a]=o[a]||this.dflt,i=h[a]=h[a]||this.dflt,p&&(_=e.indexof(p),u=i.indexof(p),_!==u&&(i=-1===u?h:o,i[a]+=" "+p));e=o.join(", "),i=h.join(", ")}return fe(t,this.p,e,i,this.clrs,this.dflt,s,this.pr,r,n)},h.parse=function(t,e,i,s,n,a){return this.parsecomplex(t.style,this.format(g(t,this.p,r,!1,this.dflt)),this.format(e),n,a)},a.registerspecialprop=function(t,e,i){de(t,{parser:function(t,s,r,n,a,o){var h=new pe(t,r,0,0,a,2,r,!1,i);return h.plugin=o,h.setratio=e(t,s,n._tween,r),h},priority:i})};var ve="scalex,scaley,scalez,x,y,z,skewx,skewy,rotation,rotationx,rotationy,perspective".split(","),ye=v("transform"),te=b+"transform",we=v("transformorigin"),xe=null!==v("perspective"),be=n.transform=function(){this.skewy=0},pe=n.gettransform=function(t,e,i,s){if(t._gstransform&&i&&!s)return t._gstransform;var r,n,o,h,l,_,u,p,f,c,m,d,g,v=i?t._gstransform||new be:new be,y=0>v.scalex,t=2e-5,w=1e5,x=179.99,b=x*m,p=xe?parsefloat(g(t,we,e,!1,"0 0 0").split(" ")[2])||v.zorigin||0:0;for(ye?r=g(t,te,e,!0):t.currentstyle&&(r=t.currentstyle.filter.match(c),r=r&&4===r.length?[r[0].substr(4),number(r[2].substr(4)),number(r[1].substr(4)),r[3].substr(4),v.x||0,v.y||0].join(","):""),n=(r||"").match(/(?:\-|\b)[\d\-\.e]+\b/gi)||[],o=n.length;--o>-1;)h=number(n[o]),n[o]=(l=h-(h|=0))?(0|l*w+(0>l?-.5:.5))/w+h:h;if(16===n.length){var s=n[8],k=n[9],r=n[10],a=n[12],o=n[13],d=n[14];if(v.zorigin&&(d=-v.zorigin,a=s*d-n[12],o=k*d-n[13],d=r*d+v.zorigin-n[14]),!i||s||null==v.rotationx){var i,e,l,f,n,x,u,y=n[0],j=n[1],b=n[2],q=n[3],v=n[4],w=n[5],$=n[6],z=n[7],q=n[11],h=math.atan2($,r),k=-b>h||h>b;v.rotationx=h*z,h&&(f=math.cos(-h),n=math.sin(-h),i=v*f+s*n,e=w*f+k*n,l=$*f+r*n,s=v*-n+s*f,k=w*-n+k*f,r=$*-n+r*f,q=z*-n+q*f,v=i,w=e,$=l),h=math.atan2(s,y),v.rotationy=h*z,h&&(x=-b>h||h>b,f=math.cos(-h),n=math.sin(-h),i=y*f-s*n,e=j*f-k*n,l=b*f-r*n,k=j*n+k*f,r=b*n+r*f,q=q*n+q*f,y=i,j=e,b=l),h=math.atan2(j,w),v.rotation=h*z,h&&(u=-b>h||h>b,f=math.cos(-h),n=math.sin(-h),y=y*f+v*n,e=j*f+w*n,w=j*-n+w*f,$=b*-n+$*f,j=e),u&&k?v.rotation=v.rotationx=0:u&&x?v.rotation=v.rotationy=0:x&&k&&(v.rotationy=v.rotationx=0),v.scalex=(0|math.sqrt(y*y+j*j)*w+.5)/w,v.scaley=(0|math.sqrt(w*w+k*k)*w+.5)/w,v.scalez=(0|math.sqrt($*$+r*r)*w+.5)/w,v.skewx=0,v.perspective=q?1/(0>q?-q:q):0,v.x=a,v.y=o,v.z=d}}else if(!(xe&&!s&&n.length&&v.x===n[4]&&v.y===n[5]&&(v.rotationx||v.rotationy)||void 0!==v.x&&"none"===g(t,"display",e))){var j=n.length>=6,te=j?n[0]:1,ee=n[1]||0,ie=n[2]||0,se=j?n[3]:1;v.x=n[4]||0,v.y=n[5]||0,_=math.sqrt(te*te+ee*ee),u=math.sqrt(se*se+ie*ie),p=te||ee?math.atan2(ee,te)*z:v.rotation||0,f=ie||se?math.atan2(ie,se)*z+p:v.skewx||0,c=_-math.abs(v.scalex||0),m=u-math.abs(v.scaley||0),math.abs(f)>90&&270>math.abs(f)&&(y?(_*=-1,f+=0>=p?180:-180,p+=0>=p?180:-180):(u*=-1,f+=0>=f?180:-180)),d=(p-v.rotation)%180,g=(f-v.skewx)%180,(void 0===v.skewx||c>t||-t>c||m>t||-t>m||d>-x&&x>d&&false|d*w||g>-x&&x>g&&false|g*w)&&(v.scalex=_,v.scaley=u,v.rotation=p,v.skewx=f),xe&&(v.rotationx=v.rotationy=v.z=0,v.perspective=parsefloat(a.defaulttransformperspective)||0,v.scalez=1)}v.zorigin=p;for(o in v)t>v[o]&&v[o]>-t&&(v[o]=0);return i&&(t._gstransform=v),v},se=function(t){var e,i,s=this.data,r=-s.rotation*m,n=r+s.skewx*m,a=1e5,o=(0|math.cos(r)*s.scalex*a)/a,h=(0|math.sin(r)*s.scalex*a)/a,l=(0|math.sin(n)*-s.scaley*a)/a,_=(0|math.cos(n)*s.scaley*a)/a,u=this.t.style,p=this.t.currentstyle;if(p){i=h,h=-l,l=-i,e=p.filter,u.filter="";var f,m,d=this.t.offsetwidth,g=this.t.offsetheight,v="absolute"!==p.position,w="progid:dximagetransform.microsoft.matrix(m11="+o+", m12="+h+", m21="+l+", m22="+_,x=s.x,b=s.y;if(null!=s.ox&&(f=(s.oxp?.01*d*s.ox:s.ox)-d/2,m=(s.oyp?.01*g*s.oy:s.oy)-g/2,x+=f-(f*o+m*h),b+=m-(f*l+m*_)),v?(f=d/2,m=g/2,w+=", dx="+(f-(f*o+m*h)+x)+", dy="+(m-(f*l+m*_)+b)+")"):w+=", sizingmethod='auto expand')",u.filter=-1!==e.indexof("dximagetransform.microsoft.matrix(")?e.replace(o,w):w+" "+e,(0===t||1===t)&&1===o&&0===h&&0===l&&1===_&&(v&&-1===w.indexof("dx=0, dy=0")||t.test(e)&&100!==parsefloat(regexp.$1)||-1===e.indexof("gradient("&&e.indexof("alpha"))&&u.removeattribute("filter")),!v){var p,s,k,r=8>c?1:-1;for(f=s.ieoffsetx||0,m=s.ieoffsety||0,s.ieoffsetx=math.round((d-((0>o?-o:o)*d+(0>h?-h:h)*g))/2+x),s.ieoffsety=math.round((g-((0>_?-_:_)*g+(0>l?-l:l)*d))/2+b),ce=0;4>ce;ce++)s=j[ce],p=p[s],i=-1!==p.indexof("px")?parsefloat(p):$(this.t,s,parsefloat(p),p.replace(y,""))||0,k=i!==s[s]?2>ce?-s.ieoffsetx:-s.ieoffsety:2>ce?f-s.ieoffsetx:m-s.ieoffsety,u[s]=(s[s]=math.round(i-k*(0===ce||2===ce?1:r)))+"px"}}},ke=n.set3dtransformratio=function(t){var e,i,s,r,n,a,o,h,l,_,u,f,c,m,d,g,v,y,t,w,x,b,p,s=this.data,k=this.t.style,r=s.rotation*m,a=s.scalex,c=s.scaley,o=s.scalez,d=s.perspective;if(!(1!==t&&0!==t||"auto"!==s.force3d||s.rotationy||s.rotationx||1!==o||d||s.z))return re.call(this,t),void 0;if(p){var z=1e-4;z>a&&a>-z&&(a=o=2e-5),z>c&&c>-z&&(c=o=2e-5),!d||s.z||s.rotationx||s.rotationy||(d=0)}if(r||s.skewx)y=math.cos(r),t=math.sin(r),e=y,n=t,s.skewx&&(r-=s.skewx*m,y=math.cos(r),t=math.sin(r),"simple"===s.skewtype&&(w=math.tan(s.skewx*m),w=math.sqrt(1+w*w),y*=w,t*=w)),i=-t,a=y;else{if(!(s.rotationy||s.rotationx||1!==o||d))return k[ye]="translate3d("+s.x+"px,"+s.y+"px,"+s.z+"px)"+(1!==a||1!==c?" scale("+a+","+c+")":""),void 0;e=a=1,i=n=0}u=1,s=r=o=h=l=_=f=c=m=0,d=d?-1/d:0,g=s.zorigin,v=1e5,r=s.rotationy*m,r&&(y=math.cos(r),t=math.sin(r),l=u*-t,c=d*-t,s=e*t,o=n*t,u*=y,d*=y,e*=y,n*=y),r=s.rotationx*m,r&&(y=math.cos(r),t=math.sin(r),w=i*y+s*t,x=a*y+o*t,b=_*y+u*t,p=m*y+d*t,s=i*-t+s*y,o=a*-t+o*y,u=_*-t+u*y,d=m*-t+d*y,i=w,a=x,_=b,m=p),1!==o&&(s*=o,o*=o,u*=o,d*=o),1!==c&&(i*=c,a*=c,_*=c,m*=c),1!==a&&(e*=a,n*=a,l*=a,c*=a),g&&(f-=g,r=s*f,h=o*f,f=u*f+g),r=(w=(r+=s.x)-(r|=0))?(0|w*v+(0>w?-.5:.5))/v+r:r,h=(w=(h+=s.y)-(h|=0))?(0|w*v+(0>w?-.5:.5))/v+h:h,f=(w=(f+=s.z)-(f|=0))?(0|w*v+(0>w?-.5:.5))/v+f:f,k[ye]="matrix3d("+[(0|e*v)/v,(0|n*v)/v,(0|l*v)/v,(0|c*v)/v,(0|i*v)/v,(0|a*v)/v,(0|_*v)/v,(0|m*v)/v,(0|s*v)/v,(0|o*v)/v,(0|u*v)/v,(0|d*v)/v,r,h,f,d?1+-f/d:1].join(",")+")"},re=n.set2dtransformratio=function(t){var e,i,s,r,n,a=this.data,o=this.t,h=o.style;return a.rotationx||a.rotationy||a.z||a.force3d===!0||"auto"===a.force3d&&1!==t&&0!==t?(this.setratio=ke,ke.call(this,t),void 0):(a.rotation||a.skewx?(e=a.rotation*m,i=e-a.skewx*m,s=1e5,r=a.scalex*s,n=a.scaley*s,h[ye]="matrix("+(0|math.cos(e)*r)/s+","+(0|math.sin(e)*r)/s+","+(0|math.sin(i)*-n)/s+","+(0|math.cos(i)*n)/s+","+a.x+","+a.y+")"):h[ye]="matrix("+a.scalex+",0,0,"+a.scaley+","+a.x+","+a.y+")",void 0)};de("transform,scale,scalex,scaley,scalez,x,y,z,rotation,rotationx,rotationy,rotationz,skewx,skewy,shortrotation,shortrotationx,shortrotationy,shortrotationz,transformorigin,transformperspective,directionalrotation,parsetransform,force3d,skewtype",{parser:function(t,e,i,s,n,o,h){if(s._transform)return n;var l,_,u,p,f,c,m,d=s._transform=pe(t,r,!0,h.parsetransform),g=t.style,v=1e-6,y=ve.length,t=h,w={};if("string"==typeof t.transform&&ye)u=l.style,u[ye]=t.transform,u.display="block",u.position="absolute",e.body.appendchild(l),l=pe(l,null,!1),e.body.removechild(l);else if("object"==typeof t){if(l={scalex:se(null!=t.scalex?t.scalex:t.scale,d.scalex),scaley:se(null!=t.scaley?t.scaley:t.scale,d.scaley),scalez:se(t.scalez,d.scalez),x:se(t.x,d.x),y:se(t.y,d.y),z:se(t.z,d.z),perspective:se(t.transformperspective,d.perspective)},m=t.directionalrotation,null!=m)if("object"==typeof m)for(u in m)t[u]=m[u];else t.rotation=m;l.rotation=re("rotation"in t?t.rotation:"shortrotation"in t?t.shortrotation+"_short":"rotationz"in t?t.rotationz:d.rotation,d.rotation,"rotation",w),xe&&(l.rotationx=re("rotationx"in t?t.rotationx:"shortrotationx"in t?t.shortrotationx+"_short":d.rotationx||0,d.rotationx,"rotationx",w),l.rotationy=re("rotationy"in t?t.rotationy:"shortrotationy"in t?t.shortrotationy+"_short":d.rotationy||0,d.rotationy,"rotationy",w)),l.skewx=null==t.skewx?d.skewx:re(t.skewx,d.skewx),l.skewy=null==t.skewy?d.skewy:re(t.skewy,d.skewy),(_=l.skewy-d.skewy)&&(l.skewx+=_,l.rotation+=_)}for(xe&&null!=t.force3d&&(d.force3d=t.force3d,c=!0),d.skewtype=t.skewtype||d.skewtype||a.defaultskewtype,f=d.force3d||d.z||d.rotationx||d.rotationy||l.z||l.rotationx||l.rotationy||l.perspective,f||null==t.scale||(l.scalez=1);--y>-1;)i=ve[y],p=l[i]-d[i],(p>v||-v>p||null!=i[i])&&(c=!0,n=new pe(d,i,d[i],p,n),i in w&&(n.e=w[i]),n.xs0=0,n.plugin=o,s._overwriteprops.push(n.n));return p=t.transformorigin,(p||xe&&f&&d.zorigin)&&(ye?(c=!0,i=we,p=(p||g(t,i,r,!1,"50% 50%"))+"",n=new pe(g,i,0,0,n,-1,"transformorigin"),n.b=g[i],n.plugin=o,xe?(u=d.zorigin,p=p.split(" "),d.zorigin=(p.length>2&&(0===u||"0px"!==p[2])?parsefloat(p[2]):u)||0,n.xs0=n.e=p[0]+" "+(p[1]||"50%")+" 0px",n=new pe(d,"zorigin",0,0,n,-1,n.n),n.b=u,n.xs0=n.e=d.zorigin):n.xs0=n.e=p):ee(p+"",d)),c&&(s._transformtype=f||3===this._transformtype?3:2),n},prefix:!0}),de("boxshadow",{defaultvalue:"0px 0px 0px 0px #999",prefix:!0,color:!0,multi:!0,keyword:"inset"}),de("borderradius",{defaultvalue:"0px",parser:function(t,e,i,n,a){e=this.format(e);var o,h,l,_,u,p,f,c,m,d,g,v,y,t,w,x,b=["bordertopleftradius","bordertoprightradius","borderbottomrightradius","borderbottomleftradius"],p=t.style;for(m=parsefloat(t.offsetwidth),d=parsefloat(t.offsetheight),o=e.split(" "),h=0;b.length>h;h++)this.p.indexof("border")&&(b[h]=v(b[h])),u=_=g(t,b[h],r,!1,"0px"),-1!==u.indexof(" ")&&(_=u.split(" "),u=_[0],_=_[1]),p=l=o[h],f=parsefloat(u),v=u.substr((f+"").length),y="="===p.charat(1),y?(c=parseint(p.charat(0)+"1",10),p=p.substr(2),c*=parsefloat(p),g=p.substr((c+"").length-(0>c?1:0))||""):(c=parsefloat(p),g=p.substr((c+"").length)),""===g&&(g=s[i]||v),g!==v&&(t=$(t,"borderleft",f,v),w=$(t,"bordertop",f,v),"%"===g?(u=100*(t/m)+"%",_=100*(w/d)+"%"):"em"===g?(x=$(t,"borderleft",1,"em"),u=t/x+"em",_=w/x+"em"):(u=t+"px",_=w+"px"),y&&(p=parsefloat(u)+c+g,l=parsefloat(_)+c+g)),a=fe(p,b[h],u+" "+_,p+" "+l,!1,"0px",a);return a},prefix:!0,formatter:le("0px 0px 0px 0px",!1,!0)}),de("backgroundposition",{defaultvalue:"0 0",parser:function(t,e,i,s,n,a){var o,h,l,_,u,p,f="background-position",m=r||w(t,null),d=this.format((m?c?m.getpropertyvalue(f+"-x")+" "+m.getpropertyvalue(f+"-y"):m.getpropertyvalue(f):t.currentstyle.backgroundpositionx+" "+t.currentstyle.backgroundpositiony)||"0 0"),g=this.format(e);if(-1!==d.indexof("%")!=(-1!==g.indexof("%"))&&(p=g(t,"backgroundimage").replace(k,""),p&&"none"!==p)){for(o=d.split(" "),h=g.split(" "),f.setattribute("src",p),l=2;--l>-1;)d=o[l],_=-1!==d.indexof("%"),_!==(-1!==h[l].indexof("%"))&&(u=0===l?t.offsetwidth-f.width:t.offsetheight-f.height,o[l]=_?parsefloat(d)/100*u+"px":100*(parsefloat(d)/u)+"%");d=o.join(" ")}return this.parsecomplex(t.style,d,g,n,a)},formatter:ee}),de("backgroundsize",{defaultvalue:"0 0",formatter:ee}),de("perspective",{defaultvalue:"0px",prefix:!0}),de("perspectiveorigin",{defaultvalue:"50% 50%",prefix:!0}),de("transformstyle",{prefix:!0}),de("backfacevisibility",{prefix:!0}),de("userselect",{prefix:!0}),de("margin",{parser:_e("margintop,marginright,marginbottom,marginleft")}),de("padding",{parser:_e("paddingtop,paddingright,paddingbottom,paddingleft")}),de("clip",{defaultvalue:"rect(0px,0px,0px,0px)",parser:function(t,e,i,s,n,a){var o,h,l;return 9>c?(h=t.currentstyle,l=8>c?" ":",",o="rect("+h.cliptop+l+h.clipright+l+h.clipbottom+l+h.clipleft+")",e=this.format(e).split(",").join(l)):(o=this.format(g(t,this.p,r,!1,this.dflt)),e=this.format(e)),this.parsecomplex(t.style,o,e,n,a)}}),de("textshadow",{defaultvalue:"0px 0px 0px #999",color:!0,multi:!0}),de("autoround,strictunits",{parser:function(t,e,i,s,r){return r}}),de("border",{defaultvalue:"0px solid #000",parser:function(t,e,i,s,n,a){return this.parsecomplex(t.style,this.format(g(t,"bordertopwidth",r,!1,"0px")+" "+g(t,"bordertopstyle",r,!1,"solid")+" "+g(t,"bordertopcolor",r,!1,"#000")),this.format(e),n,a)},color:!0,formatter:function(t){var e=t.split(" ");return e[0]+" "+(e[1]||"solid")+" "+(t.match(he)||["#000"])[0]}}),de("borderwidth",{parser:_e("bordertopwidth,borderrightwidth,borderbottomwidth,borderleftwidth")}),de("float,cssfloat,stylefloat",{parser:function(t,e,i,s,r){var n=t.style,a="cssfloat"in n?"cssfloat":"stylefloat";return new pe(n,a,0,0,r,-1,i,!1,0,n[a],e)}});var ae=function(t){var e,i=this.t,s=i.filter||g(this.data,"filter"),r=0|this.s+this.c*t;100===r&&(-1===s.indexof("atrix(")&&-1===s.indexof("radient(")&&-1===s.indexof("oader(")?(i.removeattribute("filter"),e=!g(this.data,"filter")):(i.filter=s.replace(x,""),e=!0)),e||(this.xn1&&(i.filter=s=s||"alpha(opacity="+r+")"),-1===s.indexof("pacity")?0===r&&this.xn1||(i.filter=s+" alpha(opacity="+r+")"):i.filter=s.replace(t,"opacity="+r))};de("opacity,alpha,autoalpha",{defaultvalue:"1",parser:function(t,e,i,s,n,a){var o=parsefloat(g(t,"opacity",r,!1,"1")),h=t.style,l="autoalpha"===i;return"string"==typeof e&&"="===e.charat(1)&&(e=("-"===e.charat(0)?-1:1)*parsefloat(e.substr(2))+o),l&&1===o&&"hidden"===g(t,"visibility",r)&&0!==e&&(o=0),u?n=new pe(h,"opacity",o,e-o,n):(n=new pe(h,"opacity",100*o,100*(e-o),n),n.xn1=l?1:0,h.zoom=1,n.type=2,n.b="alpha(opacity="+n.s+")",n.e="alpha(opacity="+(n.s+n.c)+")",n.data=t,n.plugin=a,n.setratio=ae),l&&(n=new pe(h,"visibility",0,0,n,-1,null,!1,0,0!==o?"inherit":"hidden",0===e?"hidden":"inherit"),n.xs0="inherit",s._overwriteprops.push(n.n),s._overwriteprops.push(i)),n}});var ce=function(t,e){e&&(t.removeproperty?("ms"===e.substr(0,2)&&(e="m"+e.substr(1)),t.removeproperty(e.replace(p,"-$1").tolowercase())):t.removeattribute(e))},oe=function(t){if(this.t._gsclasspt=this,1===t||0===t){this.t.setattribute("class",0===t?this.b:this.e);for(var e=this.data,i=this.t.style;e;)e.v?i[e.p]=e.v:ce(i,e.p),e=e._next;1===t&&this.t._gsclasspt===this&&(this.t._gsclasspt=null)}else this.t.getattribute("class")!==this.e&&this.t.setattribute("class",this.e)};de("classname",{parser:function(t,e,s,n,a,o,h){var l,_,u,p,f,c=t.getattribute("class")||"",m=t.style.csstext;if(a=n._classnamept=new pe(t,s,0,0,a,2),a.setratio=oe,a.pr=-11,i=!0,a.b=c,_=q(t,r),u=t._gsclasspt){for(p={},f=u.data;f;)p[f.p]=1,f=f._next;u.setratio(1)}return t._gsclasspt=a,a.e="="!==e.charat(1)?e:c.replace(regexp("\\s*\\b"+e.substr(2)+"\\b"),"")+("+"===e.charat(0)?" "+e.substr(2):""),n._tween._duration&&(t.setattribute("class",a.e),l=h(t,_,q(t),h,p),t.setattribute("class",c),a.data=l.firstmpt,t.style.csstext=m,a=a.xfirst=n.parse(t,l.difs,a,o)),a}});var de=function(t){if((1===t||0===t)&&this.data._totaltime===this.data._totalduration&&"isfromstart"!==this.data.data){var e,i,s,r,n=this.t.style,a=o.transform.parse;if("all"===this.e)n.csstext="",r=!0;else for(e=this.e.split(","),s=e.length;--s>-1;)i=e[s],o[i]&&(o[i].parse===a?r=!0:i="transformorigin"===i?we:o[i].p),ce(n,i);r&&(ce(n,ye),this.t._gstransform&&delete this.t._gstransform)}};for(de("clearprops",{parser:function(t,e,s,r,n){return n=new pe(t,s,0,0,n,2),n.setratio=de,n.e=e,n.pr=-10,n.data=r._tween,i=!0,n}}),h="bezier,throwprops,physicsprops,physics2d".split(","),ce=h.length;ce--;)ge(h[ce]);h=a.prototype,h._firstpt=null,h._oninittween=function(t,e,o){if(!t.nodetype)return!1;this._target=t,this._tween=o,this._vars=e,l=e.autoround,i=!1,s=e.suffixmap||a.suffixmap,r=w(t,""),n=this._overwriteprops;var h,p,c,m,d,g,v,y,t,x=t.style;if(_&&""===x.zindex&&(h=g(t,"zindex",r),("auto"===h||""===h)&&this._addlazyset(x,"zindex",0)),"string"==typeof e&&(m=x.csstext,h=q(t,r),x.csstext=m+";"+e,h=h(t,h,q(t)).difs,!u&&w.test(e)&&(h.opacity=parsefloat(regexp.$1)),e=h,x.csstext=m),this._firstpt=p=this.parse(t,e,null),this._transformtype){for(t=3===this._transformtype,ye?u&&(_=!0,""===x.zindex&&(v=g(t,"zindex",r),("auto"===v||""===v)&&this._addlazyset(x,"zindex",0)),f&&this._addlazyset(x,"webkitbackfacevisibility",this._vars.webkitbackfacevisibility||(t?"visible":"hidden"))):x.zoom=1,c=p;c&&c._next;)c=c._next;y=new pe(t,"transform",0,0,null,2),this._linkcssp(y,null,c),y.setratio=t&&xe?ke:ye?re:se,y.data=this._transform||pe(t,r,!0),n.pop()}if(i){for(;p;){for(g=p._next,c=m;c&&c.pr>p.pr;)c=c._next;(p._prev=c?c._prev:d)?p._prev._next=p:m=p,(p._next=c)?c._prev=p:d=p,p=g}this._firstpt=m}return!0},h.parse=function(t,e,i,n){var a,h,_,u,p,f,c,m,d,g,v=t.style;for(a in e)f=e[a],h=o[a],h?i=h.parse(t,f,a,this,i,n,e):(p=g(t,a,r)+"",d="string"==typeof f,"color"===a||"fill"===a||"stroke"===a||-1!==a.indexof("color")||d&&b.test(f)?(d||(f=oe(f),f=(f.length>3?"rgba(":"rgb(")+f.join(",")+")"),i=fe(v,a,p,f,!0,"transparent",i,0,n)):!d||-1===f.indexof(" ")&&-1===f.indexof(",")?(_=parsefloat(p),c=_||0===_?p.substr((_+"").length):"",(""===p||"auto"===p)&&("width"===a||"height"===a?(_=te(t,a,r),c="px"):"left"===a||"top"===a?(_=z(t,a,r),c="px"):(_="opacity"!==a?0:1,c="")),g=d&&"="===f.charat(1),g?(u=parseint(f.charat(0)+"1",10),f=f.substr(2),u*=parsefloat(f),m=f.replace(y,"")):(u=parsefloat(f),m=d?f.substr((u+"").length)||"":""),""===m&&(m=a in s?s[a]:c),f=u||0===u?(g?u+_:u)+m:e[a],c!==m&&""!==m&&(u||0===u)&&_&&(_=$(t,a,_,c),"%"===m?(_/=$(t,a,100,"%")/100,e.strictunits!==!0&&(p=_+"%")):"em"===m?_/=$(t,a,1,"em"):"px"!==m&&(u=$(t,a,u,m),m="px"),g&&(u||0===u)&&(f=u+_+m)),g&&(u+=_),!_&&0!==_||!u&&0!==u?void 0!==v[a]&&(f||"nan"!=f+""&&null!=f)?(i=new pe(v,a,u||_||0,0,i,-1,a,!1,0,p,f),i.xs0="none"!==f||"display"!==a&&-1===a.indexof("style")?f:p):j("invalid "+a+" tween value: "+e[a]):(i=new pe(v,a,_,u-_,i,0,a,l!==!1&&("px"===m||"zindex"===a),0,p,f),i.xs0=m)):i=fe(v,a,p,f,!0,null,i,0,n)),n&&i&&!i.plugin&&(i.plugin=n);return i},h.setratio=function(t){var e,i,s,r=this._firstpt,n=1e-6;if(1!==t||this._tween._time!==this._tween._duration&&0!==this._tween._time)if(t||this._tween._time!==this._tween._duration&&0!==this._tween._time||this._tween._rawprevtime===-1e-6)for(;r;){if(e=r.c*t+r.s,r.r?e=math.round(e):n>e&&e>-n&&(e=0),r.type)if(1===r.type)if(s=r.l,2===s)r.t[r.p]=r.xs0+e+r.xs1+r.xn1+r.xs2;else if(3===s)r.t[r.p]=r.xs0+e+r.xs1+r.xn1+r.xs2+r.xn2+r.xs3;else if(4===s)r.t[r.p]=r.xs0+e+r.xs1+r.xn1+r.xs2+r.xn2+r.xs3+r.xn3+r.xs4;else if(5===s)r.t[r.p]=r.xs0+e+r.xs1+r.xn1+r.xs2+r.xn2+r.xs3+r.xn3+r.xs4+r.xn4+r.xs5;else{for(i=r.xs0+e+r.xs1,s=1;r.l>s;s++)i+=r["xn"+s]+r["xs"+(s+1)];r.t[r.p]=i}else-1===r.type?r.t[r.p]=r.xs0:r.setratio&&r.setratio(t);else r.t[r.p]=e+r.xs0;r=r._next}else for(;r;)2!==r.type?r.t[r.p]=r.b:r.setratio(t),r=r._next;else for(;r;)2!==r.type?r.t[r.p]=r.e:r.setratio(t),r=r._next},h._enabletransforms=function(t){this._transformtype=t||3===this._transformtype?3:2,this._transform=this._transform||pe(this._target,r,!0)};var me=function(){this.t[this.p]=this.e,this.data._linkcssp(this,this._next,null,!0) };h._addlazyset=function(t,e,i){var s=this._firstpt=new pe(t,e,0,0,this._firstpt,2);s.e=i,s.setratio=me,s.data=this},h._linkcssp=function(t,e,i,s){return t&&(e&&(e._prev=t),t._next&&(t._next._prev=t._prev),t._prev?t._prev._next=t._next:this._firstpt===t&&(this._firstpt=t._next,s=!0),i?i._next=t:s||null!==this._firstpt||(this._firstpt=t),t._next=e,t._prev=i),t},h._kill=function(e){var i,s,r,n=e;if(e.autoalpha||e.alpha){n={};for(s in e)n[s]=e[s];n.opacity=1,n.autoalpha&&(n.visibility=1)}return e.classname&&(i=this._classnamept)&&(r=i.xfirst,r&&r._prev?this._linkcssp(r._prev,i._next,r._prev._prev):r===this._firstpt&&(this._firstpt=i._next),i._next&&this._linkcssp(i._next,i._next._next,r._prev),this._classnamept=null),t.prototype._kill.call(this,n)};var ze=function(t,e,i){var s,r,n,a;if(t.slice)for(r=t.length;--r>-1;)ze(t[r],e,i);else for(s=t.childnodes,r=s.length;--r>-1;)n=s[r],a=n.type,n.style&&(e.push(q(n)),i&&i.push(n)),1!==a&&9!==a&&11!==a||!n.childnodes.length||ze(n,e,i)};return a.cascadeto=function(t,i,s){var r,n,a,o=e.to(t,i,s),h=[o],l=[],_=[],u=[],p=e._internals.reservedprops;for(t=o._targets||o.target,ze(t,l,u),o.render(i,!0),ze(t,_),o.render(0,!0),o._enabled(!0),r=u.length;--r>-1;)if(n=h(u[r],l[r],_[r]),n.firstmpt){n=n.difs;for(a in s)p[a]&&(n[a]=s[a]);h.push(e.to(u[r],i,n))}return h},t.activate([a]),a},!0),function(){var t=window._gsdefine.plugin({propname:"roundprops",priority:-1,api:2,init:function(t,e,i){return this._tween=i,!0}}),e=t.prototype;e._oninitallprops=function(){for(var t,e,i,s=this._tween,r=s.vars.roundprops instanceof array?s.vars.roundprops:s.vars.roundprops.split(","),n=r.length,a={},o=s._proplookup.roundprops;--n>-1;)a[r[n]]=1;for(n=r.length;--n>-1;)for(t=r[n],e=s._firstpt;e;)i=e._next,e.pg?e.t._roundprops(a,!0):e.n===t&&(this._add(e.t,t,e.s,e.c),i&&(i._prev=e._prev),e._prev?e._prev._next=i:s._firstpt===e&&(s._firstpt=i),e._next=e._prev=null,s._proplookup[t]=o),e=i;return!1},e._add=function(t,e,i,s){this._addtween(t,e,i,i+s,e,!0),this._overwriteprops.push(e)}}(),window._gsdefine.plugin({propname:"attr",api:2,version:"0.3.2",init:function(t,e){var i,s,r;if("function"!=typeof t.setattribute)return!1;this._target=t,this._proxy={},this._start={},this._end={};for(i in e)this._start[i]=this._proxy[i]=s=t.getattribute(i),r=this._addtween(this._proxy,i,parsefloat(s),e[i],i),this._end[i]=r?r.s+r.c:e[i],this._overwriteprops.push(i);return!0},set:function(t){this._super.setratio.call(this,t);for(var e,i=this._overwriteprops,s=i.length,r=1===t?this._end:t?this._proxy:this._start;--s>-1;)e=i[s],this._target.setattribute(e,r[e]+"")}}),window._gsdefine.plugin({propname:"directionalrotation",api:2,version:"0.2.0",init:function(t,e){"object"!=typeof e&&(e={rotation:e}),this.finals={};var i,s,r,n,a,o,h=e.useradians===!0?2*math.pi:360,l=1e-6;for(i in e)"useradians"!==i&&(o=(e[i]+"").split("_"),s=o[0],r=parsefloat("function"!=typeof t[i]?t[i]:t[i.indexof("set")||"function"!=typeof t["get"+i.substr(3)]?i:"get"+i.substr(3)]()),n=this.finals[i]="string"==typeof s&&"="===s.charat(1)?r+parseint(s.charat(0)+"1",10)*number(s.substr(2)):number(s)||0,a=n-r,o.length&&(s=o.join("_"),-1!==s.indexof("short")&&(a%=h,a!==a%(h/2)&&(a=0>a?a+h:a-h)),-1!==s.indexof("_cw")&&0>a?a=(a+9999999999*h)%h-(0|a/h)*h:-1!==s.indexof("ccw")&&a>0&&(a=(a-9999999999*h)%h-(0|a/h)*h)),(a>l||-l>a)&&(this._addtween(t,i,r,r+a,i),this._overwriteprops.push(i)));return!0},set:function(t){var e;if(1!==t)this._super.setratio.call(this,t);else for(e=this._firstpt;e;)e.f?e.t[e.p](this.finals[e.p]):e.t[e.p]=this.finals[e.p],e=e._next}})._autocss=!0,window._gsdefine("easing.back",["easing.ease"],function(t){var e,i,s,r=window.greensockglobals||window,n=r.com.greensock,a=2*math.pi,o=math.pi/2,h=n._class,l=function(e,i){var s=h("easing."+e,function(){},!0),r=s.prototype=new t;return r.constructor=s,r.getratio=i,s},_=t.register||function(){},u=function(t,e,i,s){var r=h("easing."+t,{easeout:new e,easein:new i,easeinout:new s},!0);return _(r,t),r},p=function(t,e,i){this.t=t,this.v=e,i&&(this.next=i,i.prev=this,this.c=i.v-e,this.gap=i.t-t)},f=function(e,i){var s=h("easing."+e,function(t){this._p1=t||0===t?t:1.70158,this._p2=1.525*this._p1},!0),r=s.prototype=new t;return r.constructor=s,r.getratio=i,r.config=function(t){return new s(t)},s},c=u("back",f("backout",function(t){return(t-=1)*t*((this._p1+1)*t+this._p1)+1}),f("backin",function(t){return t*t*((this._p1+1)*t-this._p1)}),f("backinout",function(t){return 1>(t*=2)?.5*t*t*((this._p2+1)*t-this._p2):.5*((t-=2)*t*((this._p2+1)*t+this._p2)+2)})),m=h("easing.slowmo",function(t,e,i){e=e||0===e?e:.7,null==t?t=.7:t>1&&(t=1),this._p=1!==t?e:0,this._p1=(1-t)/2,this._p2=t,this._p3=this._p1+this._p2,this._calcend=i===!0},!0),d=m.prototype=new t;return d.constructor=m,d.getratio=function(t){var e=t+(.5-t)*this._p;return this._p1>t?this._calcend?1-(t=1-t/this._p1)*t:e-(t=1-t/this._p1)*t*t*t*e:t>this._p3?this._calcend?1-(t=(t-this._p3)/this._p1)*t:e+(t-e)*(t=(t-this._p3)/this._p1)*t*t*t:this._calcend?1:e},m.ease=new m(.7,.7),d.config=m.config=function(t,e,i){return new m(t,e,i)},e=h("easing.steppedease",function(t){t=t||1,this._p1=1/t,this._p2=t+1},!0),d=e.prototype=new t,d.constructor=e,d.getratio=function(t){return 0>t?t=0:t>=1&&(t=.999999999),(this._p2*t>>0)*this._p1},d.config=e.config=function(t){return new e(t)},i=h("easing.roughease",function(e){e=e||{};for(var i,s,r,n,a,o,h=e.taper||"none",l=[],_=0,u=0|(e.points||20),f=u,c=e.randomize!==!1,m=e.clamp===!0,d=e.template instanceof t?e.template:null,g="number"==typeof e.strength?.4*e.strength:.4;--f>-1;)i=c?math.random():1/u*f,s=d?d.getratio(i):i,"none"===h?r=g:"out"===h?(n=1-i,r=n*n*g):"in"===h?r=i*i*g:.5>i?(n=2*i,r=.5*n*n*g):(n=2*(1-i),r=.5*n*n*g),c?s+=math.random()*r-.5*r:f%2?s+=.5*r:s-=.5*r,m&&(s>1?s=1:0>s&&(s=0)),l[_++]={x:i,y:s};for(l.sort(function(t,e){return t.x-e.x}),o=new p(1,1,null),f=u;--f>-1;)a=l[f],o=new p(a.x,a.y,o);this._prev=new p(0,0,0!==o.t?o:o.next)},!0),d=i.prototype=new t,d.constructor=i,d.getratio=function(t){var e=this._prev;if(t>e.t){for(;e.next&&t>=e.t;)e=e.next;e=e.prev}else for(;e.prev&&e.t>=t;)e=e.prev;return this._prev=e,e.v+(t-e.t)/e.gap*e.c},d.config=function(t){return new i(t)},i.ease=new i,u("bounce",l("bounceout",function(t){return 1/2.75>t?7.5625*t*t:2/2.75>t?7.5625*(t-=1.5/2.75)*t+.75:2.5/2.75>t?7.5625*(t-=2.25/2.75)*t+.9375:7.5625*(t-=2.625/2.75)*t+.984375}),l("bouncein",function(t){return 1/2.75>(t=1-t)?1-7.5625*t*t:2/2.75>t?1-(7.5625*(t-=1.5/2.75)*t+.75):2.5/2.75>t?1-(7.5625*(t-=2.25/2.75)*t+.9375):1-(7.5625*(t-=2.625/2.75)*t+.984375)}),l("bounceinout",function(t){var e=.5>t;return t=e?1-2*t:2*t-1,t=1/2.75>t?7.5625*t*t:2/2.75>t?7.5625*(t-=1.5/2.75)*t+.75:2.5/2.75>t?7.5625*(t-=2.25/2.75)*t+.9375:7.5625*(t-=2.625/2.75)*t+.984375,e?.5*(1-t):.5*t+.5})),u("circ",l("circout",function(t){return math.sqrt(1-(t-=1)*t)}),l("circin",function(t){return-(math.sqrt(1-t*t)-1)}),l("circinout",function(t){return 1>(t*=2)?-.5*(math.sqrt(1-t*t)-1):.5*(math.sqrt(1-(t-=2)*t)+1)})),s=function(e,i,s){var r=h("easing."+e,function(t,e){this._p1=t||1,this._p2=e||s,this._p3=this._p2/a*(math.asin(1/this._p1)||0)},!0),n=r.prototype=new t;return n.constructor=r,n.getratio=i,n.config=function(t,e){return new r(t,e)},r},u("elastic",s("elasticout",function(t){return this._p1*math.pow(2,-10*t)*math.sin((t-this._p3)*a/this._p2)+1},.3),s("elasticin",function(t){return-(this._p1*math.pow(2,10*(t-=1))*math.sin((t-this._p3)*a/this._p2))},.3),s("elasticinout",function(t){return 1>(t*=2)?-.5*this._p1*math.pow(2,10*(t-=1))*math.sin((t-this._p3)*a/this._p2):.5*this._p1*math.pow(2,-10*(t-=1))*math.sin((t-this._p3)*a/this._p2)+1},.45)),u("expo",l("expoout",function(t){return 1-math.pow(2,-10*t)}),l("expoin",function(t){return math.pow(2,10*(t-1))-.001}),l("expoinout",function(t){return 1>(t*=2)?.5*math.pow(2,10*(t-1)):.5*(2-math.pow(2,-10*(t-1)))})),u("sine",l("sineout",function(t){return math.sin(t*o)}),l("sinein",function(t){return-math.cos(t*o)+1}),l("sineinout",function(t){return-.5*(math.cos(math.pi*t)-1)})),h("easing.easelookup",{find:function(e){return t.map[e]}},!0),_(r.slowmo,"slowmo","ease,"),_(i,"roughease","ease,"),_(e,"steppedease","ease,"),c},!0)}),function(t){"use strict";var e=t.greensockglobals||t;if(!e.tweenlite){var i,s,r,n,a,o=function(t){var i,s=t.split("."),r=e;for(i=0;s.length>i;i++)r[s[i]]=r=r[s[i]]||{};return r},h=o("com.greensock"),l=1e-10,_=[].slice,u=function(){},p=function(){var t=object.prototype.tostring,e=t.call([]);return function(i){return null!=i&&(i instanceof array||"object"==typeof i&&!!i.push&&t.call(i)===e)}}(),f={},c=function(i,s,r,n){this.sc=f[i]?f[i].sc:[],f[i]=this,this.gsclass=null,this.func=r;var a=[];this.check=function(h){for(var l,_,u,p,m=s.length,d=m;--m>-1;)(l=f[s[m]]||new c(s[m],[])).gsclass?(a[m]=l.gsclass,d--):h&&l.sc.push(this);if(0===d&&r)for(_=("com.greensock."+i).split("."),u=_.pop(),p=o(_.join("."))[u]=this.gsclass=r.apply(r,a),n&&(e[u]=p,"function"==typeof define&&define.amd?define((t.greensockamdpath?t.greensockamdpath+"/":"")+i.split(".").join("/"),[],function(){return p}):"undefined"!=typeof module&&module.exports&&(module.exports=p)),m=0;this.sc.length>m;m++)this.sc[m].check()},this.check(!0)},m=t._gsdefine=function(t,e,i,s){return new c(t,e,i,s)},d=h._class=function(t,e,i){return e=e||function(){},m(t,[],function(){return e},i),e};m.globals=e;var g=[0,0,1,1],v=[],y=d("easing.ease",function(t,e,i,s){this._func=t,this._type=i||0,this._power=s||0,this._params=e?g.concat(e):g},!0),t=y.map={},w=y.register=function(t,e,i,s){for(var r,n,a,o,l=e.split(","),_=l.length,u=(i||"easein,easeout,easeinout").split(",");--_>-1;)for(n=l[_],r=s?d("easing."+n,null,!0):h.easing[n]||{},a=u.length;--a>-1;)o=u[a],t[n+"."+o]=t[o+n]=r[o]=t.getratio?t:t[o]||new t};for(r=y.prototype,r._calcend=!1,r.getratio=function(t){if(this._func)return this._params[0]=t,this._func.apply(null,this._params);var e=this._type,i=this._power,s=1===e?1-t:2===e?t:.5>t?2*t:2*(1-t);return 1===i?s*=s:2===i?s*=s*s:3===i?s*=s*s*s:4===i&&(s*=s*s*s*s),1===e?1-s:2===e?s:.5>t?s/2:1-s/2},i=["linear","quad","cubic","quart","quint,strong"],s=i.length;--s>-1;)r=i[s]+",power"+s,w(new y(null,null,1,s),r,"easeout",!0),w(new y(null,null,2,s),r,"easein"+(0===s?",easenone":"")),w(new y(null,null,3,s),r,"easeinout");t.linear=h.easing.linear.easein,t.swing=h.easing.quad.easeinout;var x=d("events.eventdispatcher",function(t){this._listeners={},this._eventtarget=t||this});r=x.prototype,r.addeventlistener=function(t,e,i,s,r){r=r||0;var o,h,l=this._listeners[t],_=0;for(null==l&&(this._listeners[t]=l=[]),h=l.length;--h>-1;)o=l[h],o.c===e&&o.s===i?l.splice(h,1):0===_&&r>o.pr&&(_=h+1);l.splice(_,0,{c:e,s:i,up:s,pr:r}),this!==n||a||n.wake()},r.removeeventlistener=function(t,e){var i,s=this._listeners[t];if(s)for(i=s.length;--i>-1;)if(s[i].c===e)return s.splice(i,1),void 0},r.dispatchevent=function(t){var e,i,s,r=this._listeners[t];if(r)for(e=r.length,i=this._eventtarget;--e>-1;)s=r[e],s.up?s.c.call(s.s||i,{type:t,target:i}):s.c.call(s.s||i)};var b=t.requestanimationframe,p=t.cancelanimationframe,s=date.now||function(){return(new date).gettime()},k=s();for(i=["ms","moz","webkit","o"],s=i.length;--s>-1&&!b;)b=t[i[s]+"requestanimationframe"],p=t[i[s]+"cancelanimationframe"]||t[i[s]+"cancelrequestanimationframe"];d("ticker",function(t,e){var i,s,r,o,h,_=this,p=s(),f=e!==!1&&b,c=500,m=33,d=function(t){var e,n,a=s()-k;a>c&&(p+=a-m),k+=a,_.time=(k-p)/1e3,e=_.time-h,(!i||e>0||t===!0)&&(_.frame++,h+=e+(e>=o?.004:o-e),n=!0),t!==!0&&(r=s(d)),n&&_.dispatchevent("tick")};x.call(_),_.time=_.frame=0,_.tick=function(){d(!0)},_.lagsmoothing=function(t,e){c=t||1/l,m=math.min(e,c,0)},_.sleep=function(){null!=r&&(f&&p?p(r):cleartimeout(r),s=u,r=null,_===n&&(a=!1))},_.wake=function(){null!==r?_.sleep():_.frame>10&&(k=s()-c+5),s=0===i?u:f&&b?b:function(t){return settimeout(t,0|1e3*(h-_.time)+1)},_===n&&(a=!0),d(2)},_.fps=function(t){return arguments.length?(i=t,o=1/(i||60),h=this.time+o,_.wake(),void 0):i},_.useraf=function(t){return arguments.length?(_.sleep(),f=t,_.fps(i),void 0):f},_.fps(t),settimeout(function(){f&&(!r||5>_.frame)&&_.useraf(!1)},1500)}),r=h.ticker.prototype=new h.events.eventdispatcher,r.constructor=h.ticker;var r=d("core.animation",function(t,e){if(this.vars=e=e||{},this._duration=this._totalduration=t||0,this._delay=number(e.delay)||0,this._timescale=1,this._active=e.immediaterender===!0,this.data=e.data,this._reversed=e.reversed===!0,j){a||n.wake();var i=this.vars.useframes?y:j;i.add(this,i._time),this.vars.paused&&this.paused(!0)}});n=r.ticker=new h.ticker,r=r.prototype,r._dirty=r._gc=r._initted=r._paused=!1,r._totaltime=r._time=0,r._rawprevtime=-1,r._next=r._last=r._onupdate=r._timeline=r.timeline=null,r._paused=!1;var a=function(){a&&s()-k>2e3&&n.wake(),settimeout(a,2e3)};a(),r.play=function(t,e){return null!=t&&this.seek(t,e),this.reversed(!1).paused(!1)},r.pause=function(t,e){return null!=t&&this.seek(t,e),this.paused(!0)},r.resume=function(t,e){return null!=t&&this.seek(t,e),this.paused(!1)},r.seek=function(t,e){return this.totaltime(number(t),e!==!1)},r.restart=function(t,e){return this.reversed(!1).paused(!1).totaltime(t?-this._delay:0,e!==!1,!0)},r.reverse=function(t,e){return null!=t&&this.seek(t||this.totalduration(),e),this.reversed(!0).paused(!1)},r.render=function(){},r.invalidate=function(){return this},r.isactive=function(){var t,e=this._timeline,i=this._starttime;return!e||!this._gc&&!this._paused&&e.isactive()&&(t=e.rawtime())>=i&&i+this.totalduration()/this._timescale>t},r._enabled=function(t,e){return a||n.wake(),this._gc=!t,this._active=this.isactive(),e!==!0&&(t&&!this.timeline?this._timeline.add(this,this._starttime-this._delay):!t&&this.timeline&&this._timeline._remove(this,!0)),!1},r._kill=function(){return this._enabled(!1,!1)},r.kill=function(t,e){return this._kill(t,e),this},r._uncache=function(t){for(var e=t?this:this.timeline;e;)e._dirty=!0,e=e.timeline;return this},r._swapselfinparams=function(t){for(var e=t.length,i=t.concat();--e>-1;)"{self}"===t[e]&&(i[e]=this);return i},r.eventcallback=function(t,e,i,s){if("on"===(t||"").substr(0,2)){var r=this.vars;if(1===arguments.length)return r[t];null==e?delete r[t]:(r[t]=e,r[t+"params"]=p(i)&&-1!==i.join("").indexof("{self}")?this._swapselfinparams(i):i,r[t+"scope"]=s),"onupdate"===t&&(this._onupdate=e)}return this},r.delay=function(t){return arguments.length?(this._timeline.smoothchildtiming&&this.starttime(this._starttime+t-this._delay),this._delay=t,this):this._delay},r.duration=function(t){return arguments.length?(this._duration=this._totalduration=t,this._uncache(!0),this._timeline.smoothchildtiming&&this._time>0&&this._timethis._duration?this._duration:t,e)):this._time},r.totaltime=function(t,e,i){if(a||n.wake(),!arguments.length)return this._totaltime;if(this._timeline){if(0>t&&!i&&(t+=this.totalduration()),this._timeline.smoothchildtiming){this._dirty&&this.totalduration();var s=this._totalduration,r=this._timeline;if(t>s&&!i&&(t=s),this._starttime=(this._paused?this._pausetime:r._time)-(this._reversed?s-t:t)/this._timescale,r._dirty||this._uncache(!1),r._timeline)for(;r._timeline;)r._timeline._time!==(r._starttime+r._totaltime)/r._timescale&&r.totaltime(r._totaltime,!0),r=r._timeline}this._gc&&this._enabled(!0,!1),(this._totaltime!==t||0===this._duration)&&(this.render(t,e,!1),z.length&&b())}return this},r.progress=r.totalprogress=function(t,e){return arguments.length?this.totaltime(this.duration()*t,e):this._time/this.duration()},r.starttime=function(t){return arguments.length?(t!==this._starttime&&(this._starttime=t,this.timeline&&this.timeline._sortchildren&&this.timeline.add(this,t-this._delay)),this):this._starttime},r.timescale=function(t){if(!arguments.length)return this._timescale;if(t=t||l,this._timeline&&this._timeline.smoothchildtiming){var e=this._pausetime,i=e||0===e?e:this._timeline.totaltime();this._starttime=i-(i-this._starttime)*this._timescale/t}return this._timescale=t,this._uncache(!1)},r.reversed=function(t){return arguments.length?(t!=this._reversed&&(this._reversed=t,this.totaltime(this._timeline&&!this._timeline.smoothchildtiming?this.totalduration()-this._totaltime:this._totaltime,!0)),this):this._reversed},r.paused=function(t){if(!arguments.length)return this._paused;if(t!=this._paused&&this._timeline){a||t||n.wake();var e=this._timeline,i=e.rawtime(),s=i-this._pausetime;!t&&e.smoothchildtiming&&(this._starttime+=s,this._uncache(!1)),this._pausetime=t?i:null,this._paused=t,this._active=this.isactive(),!t&&0!==s&&this._initted&&this.duration()&&this.render(e.smoothchildtiming?this._totaltime:(i-this._starttime)/this._timescale,!0,!0)}return this._gc&&!t&&this._enabled(!0,!1),this};var c=d("core.simpletimeline",function(t){r.call(this,0,t),this.autoremovechildren=this.smoothchildtiming=!0});r=c.prototype=new r,r.constructor=c,r.kill()._gc=!1,r._first=r._last=null,r._sortchildren=!1,r.add=r.insert=function(t,e){var i,s;if(t._starttime=number(e||0)+t._delay,t._paused&&this!==t._timeline&&(t._pausetime=t._starttime+(this.rawtime()-t._starttime)/t._timescale),t.timeline&&t.timeline._remove(t,!0),t.timeline=t._timeline=this,t._gc&&t._enabled(!0,!0),i=this._last,this._sortchildren)for(s=t._starttime;i&&i._starttime>s;)i=i._prev;return i?(t._next=i._next,i._next=t):(t._next=this._first,this._first=t),t._next?t._next._prev=t:this._last=t,t._prev=i,this._timeline&&this._uncache(!0),this},r._remove=function(t,e){return t.timeline===this&&(e||t._enabled(!1,!0),t.timeline=null,t._prev?t._prev._next=t._next:this._first===t&&(this._first=t._next),t._next?t._next._prev=t._prev:this._last===t&&(this._last=t._prev),this._timeline&&this._uncache(!0)),this},r.render=function(t,e,i){var s,r=this._first;for(this._totaltime=this._time=this._rawprevtime=t;r;)s=r._next,(r._active||t>=r._starttime&&!r._paused)&&(r._reversed?r.render((r._dirty?r.totalduration():r._totalduration)-(t-r._starttime)*r._timescale,e,i):r.render((t-r._starttime)*r._timescale,e,i)),r=s},r.rawtime=function(){return a||n.wake(),this._totaltime};var o=d("tweenlite",function(e,i,s){if(r.call(this,i,s),this.render=o.prototype.render,null==e)throw"cannot tween a null target.";this.target=e="string"!=typeof e?e:o.selector(e)||e;var r,n,a,o=e.jquery||e.length&&e!==t&&e[0]&&(e[0]===t||e[0].nodetype&&e[0].style&&!e.nodetype),h=this.vars.overwrite;if(this._overwrite=h=null==h?u[o.defaultoverwrite]:"number"==typeof h?h>>0:u[h],(o||e instanceof array||e.push&&p(e))&&"number"!=typeof e[0])for(this._targets=a=_.call(e,0),this._proplookup=[],this._siblings=[],r=0;a.length>r;r++)n=a[r],n?"string"!=typeof n?n.length&&n!==t&&n[0]&&(n[0]===t||n[0].nodetype&&n[0].style&&!n.nodetype)?(a.splice(r--,1),this._targets=a=a.concat(_.call(n,0))):(this._siblings[r]=q(n,this,!1),1===h&&this._siblings[r].length>1&&v(n,this,null,1,this._siblings[r])):(n=a[r--]=o.selector(n),"string"==typeof n&&a.splice(r+1,1)):a.splice(r--,1);else this._proplookup={},this._siblings=q(e,this,!1),1===h&&this._siblings.length>1&&v(e,this,null,1,this._siblings);(this.vars.immediaterender||0===i&&0===this._delay&&this.vars.immediaterender!==!1)&&(this._time=-l,this.render(-this._delay))},!0),d=function(e){return e.length&&e!==t&&e[0]&&(e[0]===t||e[0].nodetype&&e[0].style&&!e.nodetype)},m=function(t,e){var i,s={};for(i in t)x[i]||i in e&&"transform"!==i&&"x"!==i&&"y"!==i&&"width"!==i&&"height"!==i&&"classname"!==i&&"border"!==i||!(!l[i]||l[i]&&l[i]._autocss)||(s[i]=t[i],delete t[i]);t.css=s};r=o.prototype=new r,r.constructor=o,r.kill()._gc=!1,r.ratio=0,r._firstpt=r._targets=r._overwrittenprops=r._startat=null,r._notifypluginsofenabled=r._lazy=!1,o.version="1.12.1",o.defaultease=r._ease=new y(null,null,1,1),o.defaultoverwrite="auto",o.ticker=n,o.autosleep=!0,o.lagsmoothing=function(t,e){n.lagsmoothing(t,e)},o.selector=t.$||t.jquery||function(e){return t.$?(o.selector=t.$,t.$(e)):t.document?t.document.getelementbyid("#"===e.charat(0)?e.substr(1):e):e};var z=[],i={},e=o._internals={isarray:p,isselector:d,lazytweens:z},l=o._plugins={},f=e.tweenlookup={},n=0,x=e.reservedprops={ease:1,delay:1,overwrite:1,oncomplete:1,oncompleteparams:1,oncompletescope:1,useframes:1,runbackwards:1,startat:1,onupdate:1,onupdateparams:1,onupdatescope:1,onstart:1,onstartparams:1,onstartscope:1,onreversecomplete:1,onreversecompleteparams:1,onreversecompletescope:1,onrepeat:1,onrepeatparams:1,onrepeatscope:1,easeparams:1,yoyo:1,immediaterender:1,repeat:1,repeatdelay:1,data:1,paused:1,reversed:1,autocss:1,lazy:1},u={none:0,all:1,auto:2,concurrent:3,allonstart:4,preexisting:5,"true":1,"false":0},y=r._rootframestimeline=new c,j=r._roottimeline=new c,b=function(){var t=z.length;for(i={};--t>-1;)i=z[t],i&&i._lazy!==!1&&(i.render(i._lazy,!1,!0),i._lazy=!1);z.length=0};j._starttime=n.time,y._starttime=n.frame,j._active=y._active=!0,settimeout(b,1),r._updateroot=o.render=function(){var t,e,i;if(z.length&&b(),j.render((n.time-j._starttime)*j._timescale,!1,!1),y.render((n.frame-y._starttime)*y._timescale,!1,!1),z.length&&b(),!(n.frame%120)){for(i in f){for(e=f[i].tweens,t=e.length;--t>-1;)e[t]._gc&&e.splice(t,1);0===e.length&&delete f[i]}if(i=j._first,(!i||i._paused)&&o.autosleep&&!y._first&&1===n._listeners.tick.length){for(;i&&i._paused;)i=i._next;i||n.sleep()}}},n.addeventlistener("tick",r._updateroot);var q=function(t,e,i){var s,r,n=t._gstweenid;if(f[n||(t._gstweenid=n="t"+n++)]||(f[n]={target:t,tweens:[]}),e&&(s=f[n].tweens,s[r=s.length]=e,i))for(;--r>-1;)s[r]===e&&s.splice(r,1);return f[n].tweens},v=function(t,e,i,s,r){var n,a,o,h;if(1===s||s>=4){for(h=r.length,n=0;h>n;n++)if((o=r[n])!==e)o._gc||o._enabled(!1,!1)&&(a=!0);else if(5===s)break;return a}var _,u=e._starttime+l,p=[],f=0,c=0===e._duration;for(n=r.length;--n>-1;)(o=r[n])===e||o._gc||o._paused||(o._timeline!==e._timeline?(_=_||w(e,0,c),0===w(o,_,c)&&(p[f++]=o)):u>=o._starttime&&o._starttime+o.totalduration()/o._timescale>u&&((c||!o._initted)&&2e-10>=u-o._starttime||(p[f++]=o)));for(n=f;--n>-1;)o=p[n],2===s&&o._kill(i,t)&&(a=!0),(2!==s||!o._firstpt&&o._initted)&&o._enabled(!1,!1)&&(a=!0);return a},w=function(t,e,i){for(var s=t._timeline,r=s._timescale,n=t._starttime;s._timeline;){if(n+=s._starttime,r*=s._timescale,s._paused)return-100;s=s._timeline}return n/=r,n>e?n-e:i&&n===e||!t._initted&&2*l>n-e?l:(n+=t.totalduration()/t._timescale/r)>e+l?0:n-e-l};r._init=function(){var t,e,i,s,r,n=this.vars,a=this._overwrittenprops,o=this._duration,h=!!n.immediaterender,l=n.ease;if(n.startat){this._startat&&(this._startat.render(-1,!0),this._startat.kill()),r={};for(s in n.startat)r[s]=n.startat[s];if(r.overwrite=!1,r.immediaterender=!0,r.lazy=h&&n.lazy!==!1,r.startat=r.delay=null,this._startat=o.to(this.target,0,r),h)if(this._time>0)this._startat=null;else if(0!==o)return}else if(n.runbackwards&&0!==o)if(this._startat)this._startat.render(-1,!0),this._startat.kill(),this._startat=null;else{i={};for(s in n)x[s]&&"autocss"!==s||(i[s]=n[s]);if(i.overwrite=0,i.data="isfromstart",i.lazy=h&&n.lazy!==!1,i.immediaterender=h,this._startat=o.to(this.target,0,i),h){if(0===this._time)return}else this._startat._init(),this._startat._enabled(!1)}if(this._ease=l?l instanceof y?n.easeparams instanceof array?l.config.apply(l,n.easeparams):l:"function"==typeof l?new y(l,n.easeparams):t[l]||o.defaultease:o.defaultease,this._easetype=this._ease._type,this._easepower=this._ease._power,this._firstpt=null,this._targets)for(t=this._targets.length;--t>-1;)this._initprops(this._targets[t],this._proplookup[t]={},this._siblings[t],a?a[t]:null)&&(e=!0);else e=this._initprops(this.target,this._proplookup,this._siblings,a);if(e&&o._onpluginevent("_oninitallprops",this),a&&(this._firstpt||"function"!=typeof this.target&&this._enabled(!1,!1)),n.runbackwards)for(i=this._firstpt;i;)i.s+=i.c,i.c=-i.c,i=i._next;this._onupdate=n.onupdate,this._initted=!0},r._initprops=function(e,i,s,r){var n,a,o,h,l,_;if(null==e)return!1;i[e._gstweenid]&&b(),this.vars.css||e.style&&e!==t&&e.nodetype&&l.css&&this.vars.autocss!==!1&&m(this.vars,e);for(n in this.vars){if(_=this.vars[n],x[n])_&&(_ instanceof array||_.push&&p(_))&&-1!==_.join("").indexof("{self}")&&(this.vars[n]=_=this._swapselfinparams(_,this));else if(l[n]&&(h=new l[n])._oninittween(e,this.vars[n],this)){for(this._firstpt=l={_next:this._firstpt,t:h,p:"setratio",s:0,c:1,f:!0,n:n,pg:!0,pr:h._priority},a=h._overwriteprops.length;--a>-1;)i[h._overwriteprops[a]]=this._firstpt;(h._priority||h._oninitallprops)&&(o=!0),(h._ondisable||h._onenable)&&(this._notifypluginsofenabled=!0)}else this._firstpt=i[n]=l={_next:this._firstpt,t:e,p:n,f:"function"==typeof e[n],n:n,pg:!1,pr:0},l.s=l.f?e[n.indexof("set")||"function"!=typeof e["get"+n.substr(3)]?n:"get"+n.substr(3)]():parsefloat(e[n]),l.c="string"==typeof _&&"="===_.charat(1)?parseint(_.charat(0)+"1",10)*number(_.substr(2)):number(_)-l.s||0;l&&l._next&&(l._next._prev=l)}return r&&this._kill(r,e)?this._initprops(e,i,s,r):this._overwrite>1&&this._firstpt&&s.length>1&&v(e,this,i,this._overwrite,s)?(this._kill(i,e),this._initprops(e,i,s,r)):(this._firstpt&&(this.vars.lazy!==!1&&this._duration||this.vars.lazy&&!this._duration)&&(i[e._gstweenid]=!0),o)},r.render=function(t,e,i){var s,r,n,a,o=this._time,h=this._duration,_=this._rawprevtime;if(t>=h)this._totaltime=this._time=h,this.ratio=this._ease._calcend?this._ease.getratio(1):1,this._reversed||(s=!0,r="oncomplete"),0===h&&(this._initted||!this.vars.lazy||i)&&(this._starttime===this._timeline._duration&&(t=0),(0===t||0>_||_===l)&&_!==t&&(i=!0,_>l&&(r="onreversecomplete")),this._rawprevtime=a=!e||t||_===t?t:l);else if(1e-7>t)this._totaltime=this._time=0,this.ratio=this._ease._calcend?this._ease.getratio(0):0,(0!==o||0===h&&_>0&&_!==l)&&(r="onreversecomplete",s=this._reversed),0>t?(this._active=!1,0===h&&(this._initted||!this.vars.lazy||i)&&(_>=0&&(i=!0),this._rawprevtime=a=!e||t||_===t?t:l)):this._initted||(i=!0);else if(this._totaltime=this._time=t,this._easetype){var u=t/h,p=this._easetype,f=this._easepower;(1===p||3===p&&u>=.5)&&(u=1-u),3===p&&(u*=2),1===f?u*=u:2===f?u*=u*u:3===f?u*=u*u*u:4===f&&(u*=u*u*u*u),this.ratio=1===p?1-u:2===p?u:.5>t/h?u/2:1-u/2}else this.ratio=this._ease.getratio(t/h);if(this._time!==o||i){if(!this._initted){if(this._init(),!this._initted||this._gc)return;if(!i&&this._firstpt&&(this.vars.lazy!==!1&&this._duration||this.vars.lazy&&!this._duration))return this._time=this._totaltime=o,this._rawprevtime=_,z.push(this),this._lazy=t,void 0;this._time&&!s?this.ratio=this._ease.getratio(this._time/h):s&&this._ease._calcend&&(this.ratio=this._ease.getratio(0===this._time?0:1))}for(this._lazy!==!1&&(this._lazy=!1),this._active||!this._paused&&this._time!==o&&t>=0&&(this._active=!0),0===o&&(this._startat&&(t>=0?this._startat.render(t,e,i):r||(r="_dummygs")),this.vars.onstart&&(0!==this._time||0===h)&&(e||this.vars.onstart.apply(this.vars.onstartscope||this,this.vars.onstartparams||v))),n=this._firstpt;n;)n.f?n.t[n.p](n.c*this.ratio+n.s):n.t[n.p]=n.c*this.ratio+n.s,n=n._next;this._onupdate&&(0>t&&this._startat&&this._starttime&&this._startat.render(t,e,i),e||(this._time!==o||s)&&this._onupdate.apply(this.vars.onupdatescope||this,this.vars.onupdateparams||v)),r&&(this._gc||(0>t&&this._startat&&!this._onupdate&&this._starttime&&this._startat.render(t,e,i),s&&(this._timeline.autoremovechildren&&this._enabled(!1,!1),this._active=!1),!e&&this.vars[r]&&this.vars[r].apply(this.vars[r+"scope"]||this,this.vars[r+"params"]||v),0===h&&this._rawprevtime===l&&a!==l&&(this._rawprevtime=0)))}},r._kill=function(t,e){if("all"===t&&(t=null),null==t&&(null==e||e===this.target))return this._lazy=!1,this._enabled(!1,!1);e="string"!=typeof e?e||this._targets||this.target:o.selector(e)||e;var i,s,r,n,a,o,h,l;if((p(e)||d(e))&&"number"!=typeof e[0])for(i=e.length;--i>-1;)this._kill(t,e[i])&&(o=!0);else{if(this._targets){for(i=this._targets.length;--i>-1;)if(e===this._targets[i]){a=this._proplookup[i]||{},this._overwrittenprops=this._overwrittenprops||[],s=this._overwrittenprops[i]=t?this._overwrittenprops[i]||{}:"all";break}}else{if(e!==this.target)return!1;a=this._proplookup,s=this._overwrittenprops=t?this._overwrittenprops||{}:"all"}if(a){h=t||a,l=t!==s&&"all"!==s&&t!==a&&("object"!=typeof t||!t._tempkill);for(r in h)(n=a[r])&&(n.pg&&n.t._kill(h)&&(o=!0),n.pg&&0!==n.t._overwriteprops.length||(n._prev?n._prev._next=n._next:n===this._firstpt&&(this._firstpt=n._next),n._next&&(n._next._prev=n._prev),n._next=n._prev=null),delete a[r]),l&&(s[r]=1);!this._firstpt&&this._initted&&this._enabled(!1,!1)}}return o},r.invalidate=function(){return this._notifypluginsofenabled&&o._onpluginevent("_ondisable",this),this._firstpt=null,this._overwrittenprops=null,this._onupdate=null,this._startat=null,this._initted=this._active=this._notifypluginsofenabled=this._lazy=!1,this._proplookup=this._targets?{}:[],this},r._enabled=function(t,e){if(a||n.wake(),t&&this._gc){var i,s=this._targets;if(s)for(i=s.length;--i>-1;)this._siblings[i]=q(s[i],this,!0);else this._siblings=q(this.target,this,!0)}return r.prototype._enabled.call(this,t,e),this._notifypluginsofenabled&&this._firstpt?o._onpluginevent(t?"_onenable":"_ondisable",this):!1},o.to=function(t,e,i){return new o(t,e,i)},o.from=function(t,e,i){return i.runbackwards=!0,i.immediaterender=0!=i.immediaterender,new o(t,e,i)},o.fromto=function(t,e,i,s){return s.startat=i,s.immediaterender=0!=s.immediaterender&&0!=i.immediaterender,new o(t,e,s)},o.delayedcall=function(t,e,i,s,r){return new o(e,0,{delay:t,oncomplete:e,oncompleteparams:i,oncompletescope:s,onreversecomplete:e,onreversecompleteparams:i,onreversecompletescope:s,immediaterender:!1,useframes:r,overwrite:0})},o.set=function(t,e){return new o(t,0,e)},o.gettweensof=function(t,e){if(null==t)return[];t="string"!=typeof t?t:o.selector(t)||t;var i,s,r,n;if((p(t)||d(t))&&"number"!=typeof t[0]){for(i=t.length,s=[];--i>-1;)s=s.concat(o.gettweensof(t[i],e));for(i=s.length;--i>-1;)for(n=s[i],r=i;--r>-1;)n===s[r]&&s.splice(i,1)}else for(s=q(t).concat(),i=s.length;--i>-1;)(s[i]._gc||e&&!s[i].isactive())&&s.splice(i,1);return s},o.killtweensof=o.killdelayedcallsto=function(t,e,i){"object"==typeof e&&(i=e,e=!1);for(var s=o.gettweensof(t,e),r=s.length;--r>-1;)s[r]._kill(i,t)};var g=d("plugins.tweenplugin",function(t,e){this._overwriteprops=(t||"").split(","),this._propname=this._overwriteprops[0],this._priority=e||0,this._super=g.prototype},!0);if(r=g.prototype,g.version="1.10.1",g.api=2,r._firstpt=null,r._addtween=function(t,e,i,s,r,n){var a,o;return null!=s&&(a="number"==typeof s||"="!==s.charat(1)?number(s)-i:parseint(s.charat(0)+"1",10)*number(s.substr(2)))?(this._firstpt=o={_next:this._firstpt,t:t,p:e,s:i,c:a,f:"function"==typeof t[e],n:r||e,r:n},o._next&&(o._next._prev=o),o):void 0},r.setratio=function(t){for(var e,i=this._firstpt,s=1e-6;i;)e=i.c*t+i.s,i.r?e=math.round(e):s>e&&e>-s&&(e=0),i.f?i.t[i.p](e):i.t[i.p]=e,i=i._next},r._kill=function(t){var e,i=this._overwriteprops,s=this._firstpt;if(null!=t[this._propname])this._overwriteprops=[];else for(e=i.length;--e>-1;)null!=t[i[e]]&&i.splice(e,1);for(;s;)null!=t[s.n]&&(s._next&&(s._next._prev=s._prev),s._prev?(s._prev._next=s._next,s._prev=null):this._firstpt===s&&(this._firstpt=s._next)),s=s._next;return!1},r._roundprops=function(t,e){for(var i=this._firstpt;i;)(t[this._propname]||null!=i.n&&t[i.n.split(this._propname+"_").join("")])&&(i.r=e),i=i._next},o._onpluginevent=function(t,e){var i,s,r,n,a,o=e._firstpt;if("_oninitallprops"===t){for(;o;){for(a=o._next,s=r;s&&s.pr>o.pr;)s=s._next;(o._prev=s?s._prev:n)?o._prev._next=o:r=o,(o._next=s)?s._prev=o:n=o,o=a}o=e._firstpt=r}for(;o;)o.pg&&"function"==typeof o.t[t]&&o.t[t]()&&(i=!0),o=o._next;return i},g.activate=function(t){for(var e=t.length;--e>-1;)t[e].api===g.api&&(l[(new t[e])._propname]=t[e]);return!0},m.plugin=function(t){if(!(t&&t.propname&&t.init&&t.api))throw"illegal plugin definition."; var e,i=t.propname,s=t.priority||0,r=t.overwriteprops,n={init:"_oninittween",set:"setratio",kill:"_kill",round:"_roundprops",initall:"_oninitallprops"},a=d("plugins."+i.charat(0).touppercase()+i.substr(1)+"plugin",function(){g.call(this,i,s),this._overwriteprops=r||[]},t.global===!0),o=a.prototype=new g(i);o.constructor=a,a.api=t.api;for(e in n)"function"==typeof t[e]&&(o[n[e]]=t[e]);return a.version=t.version,g.activate([a]),a},i=t._gsqueue){for(s=0;i.length>s;s++)i[s]();for(r in f)f[r].func||t.console.log("gsap encountered missing dependency: com.greensock."+r)}a=!1}}(window); $(function(){ if($(window).width()< 768 && window.innerheight < window.innerwidth ) $('.turn_device').fadein(); window.app={ wrapper: document.getelementbyid('wrapper'), moving: false, //scrolling main slides onscroll:false, //flipping sticky slides scrstartpos: 0, //scroll start position scrollpos:0, //scroll position sliding: false, active: 0, // active sticky index sltimer: 0, newdate: 0, olddate: 0, wrappery:0, lasty:0, loaded:0, //images loaded toload:0, //images expected to load loadedpercent:0 }; app.config={ backdur:700, flipdur:900, flipdelta:40 }; app.odorun = function(){ var el_1 = $('.od_1')[0]; var el_2 = $('.od_2')[0]; var el_3 = $('.od_3')[0]; var el_4 = $('.od_4')[0]; app.od_1 = new odometer({ el: el_1, duration: 5000, animation: 'count' }); app.od_2 = new odometer({ el: el_2, duration: 5000, animation: 'count' }); app.od_3 = new odometer({ el: el_3, duration: 5000, animation: 'count' }); app.od_4 = new odometer({ el: el_4, duration: 5000, animation: 'count', format: '( ddd)' }); app.od_1.update($(el_1).attr('data-num')); app.od_2.update($(el_2).attr('data-num')); app.od_3.update($(el_3).attr('data-num')); app.od_4.update($(el_4).attr('data-num')); }; app.odoreset = function(){ app.od_1.update(0); app.od_2.update(0); app.od_3.update(0); app.od_4.update(0); }; $('.arr_up, .arr_dn').click(function(){ if($(this).hasclass('arr_dn')) app.active++; else app.active--; if(app.active>$('.sticky').length-1){ app.active--; return; } if(app.active<0){ app.active++; return; } $.fn.fullpage.moveto(app.active+1); //app.flip(); }); $('.search_btn').click(function(){ $('.search_form').toggleclass('active'); }); $('.search_box input[type="text"]').focus(function(){ $('.search_box').addclass('focus'); }); $('.search_box input[type="text"]').blur(function(){ $('.search_box').removeclass('focus'); }); $('.search_box a').click(function(){ $('.search_form form').submit(); }); $('.search_form').click(function(e){ if(!$(e.target).hasclass('search_form')) return; $('.search_form').removeclass('active'); }); $('.menu-link').click(function() { $('.menu-link').toggleclass('active'); app.togglenav(); return false; }); app.togglenav = function(){ var $nav = $('.main_nav') ; var navtl = new timelinelite(); if(!$nav.hasclass('active')){ $nav.addclass('active'); $('.nav_ovrl').addclass('active'); settimeout(function(){ $('.main_nav ul li, .main_nav .pdf, .main_nav .nav_contact').each(function(index,el){ navtl.set($(el), {opacity:1, x:0}, index * 0.025); }); },100); } else{ $nav.removeclass('active'); $('.nav_ovrl').removeclass('active'); $('.main_nav ul li, .main_nav .pdf, .main_nav .nav_contact').each(function(index,el){ navtl.set($(el), {opacity:0, x:20}, index * 0.03); }); } }; $('.nav_ovrl').click(function(){ $('.menu-link').click(); }); app.showitems = function(items, interval){ items.each(function(index,el){ settimeout(function(){ $(el).removeclass('hid'); },index * interval); }); }; app.init = function(){ app.isfirefox = typeof installtrigger !== 'undefined'; //console.log(app.isfirefox); app.showitems($('.top_contact .hid, .soc_links a, .project_char'),200); settimeout(function(){ app.showitems($('.menu-link, .search_btn'),200); },300); settimeout(function(){ app.showitems($('.lng .hid'),300); },600); settimeout(function(){ app.showitems($('.arr_up, .arr_dn, .mouse_scroll'),200); },800); var navtl = new timelinelite(); navtl.set($('.main_nav ul li, .main_nav .pdf, .main_nav .nav_contact'), {opacity:0, x:20}); }; app.initscrollbars = function(){ $(".contact_info, .main_nav").mcustomscrollbar({ theme:"dark", autohidescrollbar: true }); $('.main_page').fullpage({ sectionselector: '.sticky', slideselector: '.sticky_slide', css3: true, scrollingspeed: 700, fittosection: true, fittosectiondelay: 1000, scrollbar: false, easing: 'easeinoutcubic', afterrender: function(){ $('.sticky').eq(1).addclass('next'); }, onleave: function(index, nextindex, direction){ //console.log(nextindex-1); $('.sticky').removeclass('prev next'); $('.sticky').eq(nextindex-1-1).addclass('prev'); $('.sticky').eq(nextindex-1+1).addclass('next'); app.active = nextindex-1; if (nextindex-1==1) settimeout(function(){app.odorun()}, 300); }, afterload:function(){ if($('#sb3').hasclass('active') === true) $('#sb3').addclass('active_bim'); else $('#sb3').removeclass('active_bim'); } }); $(".main_page1").mcustomscrollbar({ theme:"minimal", autohidescrollbar: true, alwaystriggeroffsets: false, snapamount:$(window).height(), mousewheel:{ preventdefault: true, normalizedelta: true, scrollamount: $(window).height()*0.51, }, callbacks:{ whilescrolling: function(e){ if (-this.mcs.top > $('.numbers').parent().offset().top) settimeout(function(){app.odorun()}, 300); app.active = math.round(-this.mcs.top / $(window).height()); console.log(app.active); }, } }); }; app.flip = function(){ $(".main_page").mcustomscrollbar("stop"); //$(".main_page").mcustomscrollbar("disable"); app.onscroll=true; settimeout(function(){ app.onscroll=false; app.moving = false; }, app.config.flipdur); var scr_id = $('.sticky').eq(app.active).attr('id'); app.scrollpos = $('.sticky').eq(app.active).position().top; $(".main_page").mcustomscrollbar("scrollto", "#"+scr_id,{ scrolleasing:"easeinout", scrollinertia:app.config.flipdur, callbacks:false }); if (app.active==$('.numbers').parent().index()) settimeout(function(){app.odorun()}, 300); if (app.active===0) $('.slider, .slider_texts').removeclass('notrans').css({ 'transform': 'translatey(0)', 'opacity':1 }); else $('.slider, .slider_texts').removeclass('notrans').css({ 'transform': 'translatey('+$(window).height()*0.3+'px)', 'opacity': 0.5 }); if (app.active < 3) $('#sber .bg').removeclass('notrans').css({ 'transform': 'translatey(0)', 'opacity':1 }); else $('#sber .bg').removeclass('notrans').css({ 'transform': 'translatey('+$(window).height()*0.3+'px)', 'opacity': 0.5 }); $('.numbers, #sber .text_block').removeclass('notrans').css({ 'transform': 'translatey(0)' }); }; app.initslider = function(){ var $slider = $('.slider'); app.slider={}; app.slider.active = 0; app.slider.cnt = $('.slider .slide').length; if(!$slider.hasclass('project_slider')){ $slider.append('
    ') for(var i=0; i0'+(i+1)+''); $slider.find('.slide').eq(i).addclass('sl'+i); } $slider.find('.sl_num li').eq(0).addclass('active'); } settimeout(function(){ $('.slider').removeclass('zoomed'); app.settimer(); $('.sl_text').eq(0).removeclass('hid'); },600); }; app.companyinit = function(){ $('#wrapper').bind('mousewheel', function(e){ if(e.originalevent.wheeldelta /120 > 0) $('.sl_l').click(); else $('.sl_r').click(); }); var lasty; $('#wrapper').on('touchmove', function (e){ e.preventdefault(); var currenty = e.originalevent.touches[0].clienty; if(currenty < (lasty-60)) $('.sl_l').click(); else if(currenty > lasty+60) $('.sl_r').click(); lasty = currenty; }); $(document).keydown(function(e) { switch(e.which) { case 37: // left $('.sl_l').click(); break; case 38: // up $('.sl_l').click(); break; case 39: // right $('.sl_r').click(); break; case 40: // down $('.sl_r').click(); break; default: return; // exit this handler for other keys } e.preventdefault(); // prevent the default action (scroll / move caret) }); $('.arr_up').click(function(){ $('.sl_l').click(); }); $('.arr_dn').click(function(){ $('.sl_r').click(); }); }; app.settimer = function(){ //console.log("timer set 1"); if(app.sltimer !== 0) clearinterval(app.sltimer); app.sltimer = setinterval(function(){ if(app.moving === false && app.active === 0) $('.sl_r').click(); },6000); }; app.slideto = function(n){ app.sliding = true; $('.sl_num li').removeclass('active'); $('.sl_num li').eq(n).addclass('active'); $('.slider .slide').removeclass('active'); $('.sl'+n).addclass('active'); app.showtext(n); }; app.hidetext = function(n){ $('.sl_text').removeclass('hid'); }; app.showtext = function(n){ $('.sl_text').eq(n).siblings().addclass('hid2'); settimeout(function(){ $('.sl_text').eq(n).removeclass('hid'); }, 600); settimeout(function(){ $('.sl_text').eq(n).siblings().addclass('hid').removeclass('hid2'); app.sliding = false; }, 1200); }; $('.main_nav_wr ul li a, .logo, .to_serv, .news_pic .moar, .sticky .moar, .project_item').click(function(e){ var lng = $('html').attr('lang'); var href = $(this).attr('href'); if(href === undefined) return; console.log(href); if(lng == "en" && href!="/en/") href = "en/"+href; if(href.indexof("http") == -1) href = "/"+href; if(href == '//') href='/'; console.log(href); if(href == '//en/') href='/en/'; e.preventdefault(); e.stoppropagation(); $('.pagecover').addclass('show'); $('.menu-link').click(); settimeout(function(){ window.location = href; },500); }); $('.bim_item').click(function(){ $(this).find('a').click(); }); $('.service_item').click(function(){ var h2; var id = $(this).attr('data-id'); var hbg = $('.service_full_item[data-id="'+id+'"]').attr('data-src'); h2 = $('.service_full_item[data-id="'+id+'"]').outerheight() + parseint($('.service_full .right_col .content').css('padding-top'))+50; if(h2< $('ul.service').outerheight()+110) h2 = $('ul.service').outerheight()+110; $('.service_full .right_col .content').animate({ height: h2 }, 500); $("html, body").animate({ scrolltop: 0 }, 500); $('.header_bg').css('background-image', 'url('+hbg+')').addclass('show'); $('.services').addclass('lift'); $('.service_full').addclass('show'); $('.service_full .active').removeclass('active'); $('.service_full [data-id="'+id+'"]').addclass('active'); }); $('.left_col .back').click(function(){ $('.header_bg').removeclass('show'); $('.services').removeclass('lift'); $('.service_full').removeclass('show'); }); $('.left_col ul li').click(function(){ if($(this).is('.active, .back')) return; var h1, h2; var id = $(this).attr('data-id'); var hbg = $('.service_full_item[data-id="'+id+'"]').attr('data-src'); $('.header').prepend('
    '); $('.header_bg').eq(1).removeclass('show'); settimeout(function(){ $('.header_bg').eq(1).remove(); }, 1000); h1 = $('.service_full .right_col .content').eq(0).outerheight(); h2 = $('.service_full_item[data-id="'+id+'"]').outerheight() + parseint($('.service_full .right_col .content').css('padding-top'))+50; if(h2< $('ul.service').outerheight()+110) h2 = $('ul.service').outerheight()+110; //console.log(parseint($('.service_full .right_col .content').css('padding-top'))); console.log($('.service_full_item[data-id="'+id+'"]').outerheight()); $('.service_full .right_col .content').outerheight(h1+'px'); $('.service_full .active').removeclass('active'); $("html, body").animate({ scrolltop: 0 }, 600); $('.service_full .right_col .content').animate({ height: h2 }, 300, function(){ $('.service_full [data-id="'+id+'"]').addclass('active'); }); }); $(window).scroll(function(){ if(!$('.service_full').is('.show')) return; var left_nav_bottom = $('ul.service').offset().top+$('ul.service').outerheight()+30, footer_top = $('.footer_inner').offset().top; /* if(left_nav_bottom > footer_top) $('ul.service').css({ bottom: left_nav_bottom - footer_top-10, }); else $('ul.service').css({ top: 'auto', bottom:'auto' });*/ }); $('body').on('click', '.sl_num li', function(){ if(app.sliding === true) return; app.slider.active = $(this).index(); app.slideto(app.slider.active); }); $('body').on('click', '.c_panel img', function(){ if(app.sliding === true) return; if($(this).hasclass('sl_r')) app.slider.active++; else app.slider.active--; if(app.slider.active>app.slider.cnt-1){ app.slider.active = 0; } if(app.slider.active<0){ app.slider.active = app.slider.cnt-1; } app.slideto(app.slider.active); app.settimer(); }); $('body').on('hover', '.bim_item', function(){ if($(document).width()<=768)return; var n = $(this).index(); $('.bim_vid').removeclass('active'); $('.bim_vid').eq(n).addclass('active'); }); $('body').on('click', '.filter_btn', function(){ if($(document).width()>960)return; $('.pr_filter').toggleclass('hid'); }); app.fancy = $("a.fancybox-media").fancybox( { "framewidth" : 800, "frameheight" : 600, "overlayopacity" : 0.8, "hideoncontentclick" :true }); $(window).on("resize", function(){ if($('input:focus').length > 0)return; if($(window).width()< 768 && window.innerheight < window.innerwidth ) $('.turn_device').fadein(); else $('.turn_device').fadeout(); if($(window).width()< 768){ app.fancy.margin = 10; } }); /*********** page loading ***********/ //console.log($(window).width()); if($(window).width()<=800){ $('.project_image').remove(); } if($(window).width()<=768){ $('.bim_videos, .bim_bg').remove(); } //remove nbsp for content pages if($('.content').length>0){ var el = document.queryselector('.content'); el.innerhtml = el.innerhtml.replace(/ /g,' '); } //---------------------------- app.toload = $('img, [data-src]').length; $('img').load(function(){ app.loaded++; app.updateloadedprogress(); }); $('[data-src]').each(function(){ var el = this; //console.log($(el).attr('data-src')); $('').attr('src', $(el).attr('data-src')).load(function() { $(this).remove(); // prevent memory leaks //$(el).css('background-image', 'url(/'+$(el).attr('data-src')+')'); //console.log('bg loaded'); app.loaded++; app.updateloadedprogress(); }); }); $(window).load(function(){ //app.loaded = app.toload; app.updateloadedprogress(); settimeout(function(){ $('.preloader').addclass('hid'); }, 100); settimeout(function(){ app.init(); }, 500); //console.log('page loaded'); }); app.updateloadedprogress = function(){ if(app.loadedpercent < math.round(app.loaded / app.toload * 100)) { app.loadedpercent++; //console.log(app.loadedpercent); $('.loading_percent').html(app.loadedpercent+'%'); $('.loading_bar').css('width', app.loadedpercent+'%'); settimeout(function(){ app.updateloadedprogress(); },10); } } //console.log(app.toload); /*********** page loading end***********/ app.initslider(); app.initscrollbars(); $('.sticky').css('height', $(window).height()); }); /* == malihu jquery custom scrollbar plugin == version: 3.1.5 plugin uri: http://manos.malihu.gr/jquery-custom-content-scroller author: malihu author uri: http://manos.malihu.gr license: mit license (mit) */ /* copyright manos malihutsakis (email: manos@malihu.gr) permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "software"), to deal in the software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the software, and to permit persons to whom the software is furnished to do so, subject to the following conditions: the above copyright notice and this permission notice shall be included in all copies or substantial portions of the software. the software is provided "as is", without warranty of any kind, express or implied, including but not limited to the warranties of merchantability, fitness for a particular purpose and noninfringement. in no event shall the authors or copyright holders be liable for any claim, damages or other liability, whether in an action of contract, tort or otherwise, arising from, out of or in connection with the software or the use or other dealings in the software. */ /* the code below is fairly long, fully commented and should be normally used in development. for production, use either the minified jquery.mcustomscrollbar.min.js script or the production-ready jquery.mcustomscrollbar.concat.min.js which contains the plugin and dependencies (minified). */ (function(factory){ if(typeof define==="function" && define.amd){ define(["jquery"],factory); }else if(typeof module!=="undefined" && module.exports){ module.exports=factory; }else{ factory(jquery,window,document); } }(function($){ (function(init){ var _rjs=typeof define==="function" && define.amd, /* requirejs */ _njs=typeof module !== "undefined" && module.exports, /* nodejs */ _dlp=("https:"==document.location.protocol) ? "https:" : "http:", /* location protocol */ _url="cdnjs.cloudflare.com/ajax/libs/jquery-mousewheel/3.1.13/jquery.mousewheel.min.js"; if(!_rjs){ if(_njs){ require("jquery-mousewheel")($); }else{ /* load jquery-mousewheel plugin (via cdn) if it's not present or not loaded via requirejs (works when mcustomscrollbar fn is called on window load) */ $.event.special.mousewheel || $("head").append(decodeuri("%3cscript src="+_dlp+"//"+_url+"%3e%3c/script%3e")); } } init(); }(function(){ /* ---------------------------------------- plugin namespace, prefix, default selector(s) ---------------------------------------- */ var pluginns="mcustomscrollbar", pluginpfx="mcs", defaultselector=".mcustomscrollbar", /* ---------------------------------------- default options ---------------------------------------- */ defaults={ /* set element/content width/height programmatically values: boolean, pixels, percentage option default ------------------------------------- setwidth false setheight false */ /* set the initial css top property of content values: string (e.g. "-100px", "10%" etc.) */ settop:0, /* set the initial css left property of content values: string (e.g. "-100px", "10%" etc.) */ setleft:0, /* scrollbar axis (vertical and/or horizontal scrollbars) values (string): "y", "x", "yx" */ axis:"y", /* position of scrollbar relative to content values (string): "inside", "outside" ("outside" requires elements with position:relative) */ scrollbarposition:"inside", /* scrolling inertia values: integer (milliseconds) */ scrollinertia:950, /* auto-adjust scrollbar dragger length values: boolean */ autodraggerlength:true, /* auto-hide scrollbar when idle values: boolean option default ------------------------------------- autohidescrollbar false */ /* auto-expands scrollbar on mouse-over and dragging values: boolean option default ------------------------------------- autoexpandscrollbar false */ /* always show scrollbar, even when there's nothing to scroll values: integer (0=disable, 1=always show dragger rail and buttons, 2=always show dragger rail, dragger and buttons), boolean */ alwaysshowscrollbar:0, /* scrolling always snaps to a multiple of this number in pixels values: integer, array ([y,x]) option default ------------------------------------- snapamount null */ /* when snapping, snap with this number in pixels as an offset values: integer */ snapoffset:0, /* mouse-wheel scrolling */ mousewheel:{ /* enable mouse-wheel scrolling values: boolean */ enable:true, /* scrolling amount in pixels values: "auto", integer */ scrollamount:"auto", /* mouse-wheel scrolling axis the default scrolling direction when both vertical and horizontal scrollbars are present values (string): "y", "x" */ axis:"y", /* prevent the default behaviour which automatically scrolls the parent element(s) when end of scrolling is reached values: boolean option default ------------------------------------- preventdefault null */ /* the reported mouse-wheel delta value. the number of lines (translated to pixels) one wheel notch scrolls. values: "auto", integer "auto" uses the default os/browser value */ deltafactor:"auto", /* normalize mouse-wheel delta to -1 or 1 (disables mouse-wheel acceleration) values: boolean option default ------------------------------------- normalizedelta null */ /* invert mouse-wheel scrolling direction values: boolean option default ------------------------------------- invert null */ /* the tags that disable mouse-wheel when cursor is over them */ disableover:["select","option","keygen","datalist","textarea"] }, /* scrollbar buttons */ scrollbuttons:{ /* enable scrollbar buttons values: boolean option default ------------------------------------- enable null */ /* scrollbar buttons scrolling type values (string): "stepless", "stepped" */ scrolltype:"stepless", /* scrolling amount in pixels values: "auto", integer */ scrollamount:"auto" /* tabindex of the scrollbar buttons values: false, integer option default ------------------------------------- tabindex null */ }, /* keyboard scrolling */ keyboard:{ /* enable scrolling via keyboard values: boolean */ enable:true, /* keyboard scrolling type values (string): "stepless", "stepped" */ scrolltype:"stepless", /* scrolling amount in pixels values: "auto", integer */ scrollamount:"auto" }, /* enable content touch-swipe scrolling values: boolean, integer, string (number) integer values define the axis-specific minimum amount required for scrolling momentum */ contenttouchscroll:25, /* enable/disable document (default) touch-swipe scrolling */ documenttouchscroll:true, /* advanced option parameters */ advanced:{ /* auto-expand content horizontally (for "x" or "yx" axis) values: boolean, integer (the value 2 forces the non scrollheight/scrollwidth method, the value 3 forces the scrollheight/scrollwidth method) option default ------------------------------------- autoexpandhorizontalscroll null */ /* auto-scroll to elements with focus */ autoscrollonfocus:"input,textarea,select,button,datalist,keygen,a[tabindex],area,object,[contenteditable='true']", /* auto-update scrollbars on content, element or viewport resize should be true for fluid layouts/elements, adding/removing content dynamically, hiding/showing elements, content with images etc. values: boolean */ updateoncontentresize:true, /* auto-update scrollbars each time each image inside the element is fully loaded values: "auto", boolean */ updateonimageload:"auto", /* auto-update scrollbars based on the amount and size changes of specific selectors useful when you need to update the scrollbar(s) automatically, each time a type of element is added, removed or changes its size values: boolean, string (e.g. "ul li" will auto-update scrollbars each time list-items inside the element are changed) a value of true (boolean) will auto-update scrollbars each time any element is changed option default ------------------------------------- updateonselectorchange null */ /* extra selectors that'll allow scrollbar dragging upon mousemove/up, pointermove/up, touchend etc. (e.g. "selector-1, selector-2") option default ------------------------------------- extradraggableselectors null */ /* extra selectors that'll release scrollbar dragging upon mouseup, pointerup, touchend etc. (e.g. "selector-1, selector-2") option default ------------------------------------- releasedraggableselectors null */ /* auto-update timeout values: integer (milliseconds) */ autoupdatetimeout:60 }, /* scrollbar theme values: string (see css/plugin uri for a list of ready-to-use themes) */ theme:"light", /* user defined callback functions */ callbacks:{ /* available callbacks: callback default ------------------------------------- oncreate null oninit null onscrollstart null onscroll null ontotalscroll null ontotalscrollback null whilescrolling null onoverflowy null onoverflowx null onoverflowynone null onoverflowxnone null onimageload null onselectorchange null onbeforeupdate null onupdate null */ ontotalscrolloffset:0, ontotalscrollbackoffset:0, alwaystriggeroffsets:true } /* add scrollbar(s) on all elements matching the current selector, now and in the future values: boolean, string string values: "on" (enable), "once" (disable after first invocation), "off" (disable) liveselector values: string (selector) option default ------------------------------------- live false liveselector null */ }, /* ---------------------------------------- vars, constants ---------------------------------------- */ totalinstances=0, /* plugin instances amount */ livetimers={}, /* live option timers */ oldie=(window.attachevent && !window.addeventlistener) ? 1 : 0, /* detect ie < 9 */ touchactive=false,touchable, /* global touch vars (for touch and pointer events) */ /* general plugin classes */ classes=[ "mcsb_dragger_ondrag","mcsb_scrolltools_ondrag","mcs_img_loaded","mcs_disabled","mcs_destroyed","mcs_no_scrollbar", "mcs-autohide","mcs-dir-rtl","mcs_no_scrollbar_y","mcs_no_scrollbar_x","mcs_y_hidden","mcs_x_hidden","mcsb_draggercontainer", "mcsb_buttonup","mcsb_buttondown","mcsb_buttonleft","mcsb_buttonright" ], /* ---------------------------------------- methods ---------------------------------------- */ methods={ /* plugin initialization method creates the scrollbar(s), plugin data object and options ---------------------------------------- */ init:function(options){ var options=$.extend(true,{},defaults,options), selector=_selector.call(this); /* validate selector */ /* if live option is enabled, monitor for elements matching the current selector and apply scrollbar(s) when found (now and in the future) */ if(options.live){ var liveselector=options.liveselector || this.selector || defaultselector, /* live selector(s) */ $liveselector=$(liveselector); /* live selector(s) as jquery object */ if(options.live==="off"){ /* disable live if requested usage: $(selector).mcustomscrollbar({live:"off"}); */ removelivetimers(liveselector); return; } livetimers[liveselector]=settimeout(function(){ /* call mcustomscrollbar fn on live selector(s) every half-second */ $liveselector.mcustomscrollbar(options); if(options.live==="once" && $liveselector.length){ /* disable live after first invocation */ removelivetimers(liveselector); } },500); }else{ removelivetimers(liveselector); } /* options backward compatibility (for versions < 3.0.0) and normalization */ options.setwidth=(options.set_width) ? options.set_width : options.setwidth; options.setheight=(options.set_height) ? options.set_height : options.setheight; options.axis=(options.horizontalscroll) ? "x" : _findaxis(options.axis); options.scrollinertia=options.scrollinertia>0 && options.scrollinertia<17 ? 17 : options.scrollinertia; if(typeof options.mousewheel!=="object" && options.mousewheel==true){ /* old school mousewheel option (non-object) */ options.mousewheel={enable:true,scrollamount:"auto",axis:"y",preventdefault:false,deltafactor:"auto",normalizedelta:false,invert:false} } options.mousewheel.scrollamount=!options.mousewheelpixels ? options.mousewheel.scrollamount : options.mousewheelpixels; options.mousewheel.normalizedelta=!options.advanced.normalizemousewheeldelta ? options.mousewheel.normalizedelta : options.advanced.normalizemousewheeldelta; options.scrollbuttons.scrolltype=_findscrollbuttonstype(options.scrollbuttons.scrolltype); _theme(options); /* theme-specific options */ /* plugin constructor */ return $(selector).each(function(){ var $this=$(this); if(!$this.data(pluginpfx)){ /* prevent multiple instantiations */ /* store options and create objects in jquery data */ $this.data(pluginpfx,{ idx:++totalinstances, /* instance index */ opt:options, /* options */ scrollratio:{y:null,x:null}, /* scrollbar to content ratio */ overflowed:null, /* overflowed axis */ contentreset:{y:null,x:null}, /* object to check when content resets */ bindevents:false, /* object to check if events are bound */ tweenrunning:false, /* object to check if tween is running */ sequential:{}, /* sequential scrolling object */ langdir:$this.css("direction"), /* detect/store direction (ltr or rtl) */ cboffsets:null, /* object to check whether callback offsets always trigger */ /* object to check how scrolling events where last triggered "internal" (default - triggered by this script), "external" (triggered by other scripts, e.g. via scrollto method) usage: object.data("mcs").trigger */ trigger:null, /* object to check for changes in elements in order to call the update method automatically */ poll:{size:{o:0,n:0},img:{o:0,n:0},change:{o:0,n:0}} }); var d=$this.data(pluginpfx),o=d.opt, /* html data attributes */ htmldataaxis=$this.data("mcs-axis"),htmldatasbpos=$this.data("mcs-scrollbar-position"),htmldatatheme=$this.data("mcs-theme"); if(htmldataaxis){o.axis=htmldataaxis;} /* usage example: data-mcs-axis="y" */ if(htmldatasbpos){o.scrollbarposition=htmldatasbpos;} /* usage example: data-mcs-scrollbar-position="outside" */ if(htmldatatheme){ /* usage example: data-mcs-theme="minimal" */ o.theme=htmldatatheme; _theme(o); /* theme-specific options */ } _pluginmarkup.call(this); /* add plugin markup */ if(d && o.callbacks.oncreate && typeof o.callbacks.oncreate==="function"){o.callbacks.oncreate.call(this);} /* callbacks: oncreate */ $("#mcsb_"+d.idx+"_container img:not(."+classes[2]+")").addclass(classes[2]); /* flag loaded images */ methods.update.call(null,$this); /* call the update method */ } }); }, /* ---------------------------------------- */ /* plugin update method updates content and scrollbar(s) values, events and status ---------------------------------------- usage: $(selector).mcustomscrollbar("update"); */ update:function(el,cb){ var selector=el || _selector.call(this); /* validate selector */ return $(selector).each(function(){ var $this=$(this); if($this.data(pluginpfx)){ /* check if plugin has initialized */ var d=$this.data(pluginpfx),o=d.opt, mcsb_container=$("#mcsb_"+d.idx+"_container"), mcustomscrollbox=$("#mcsb_"+d.idx), mcsb_dragger=[$("#mcsb_"+d.idx+"_dragger_vertical"),$("#mcsb_"+d.idx+"_dragger_horizontal")]; if(!mcsb_container.length){return;} if(d.tweenrunning){_stop($this);} /* stop any running tweens while updating */ if(cb && d && o.callbacks.onbeforeupdate && typeof o.callbacks.onbeforeupdate==="function"){o.callbacks.onbeforeupdate.call(this);} /* callbacks: onbeforeupdate */ /* if element was disabled or destroyed, remove class(es) */ if($this.hasclass(classes[3])){$this.removeclass(classes[3]);} if($this.hasclass(classes[4])){$this.removeclass(classes[4]);} /* css flexbox fix, detect/set max-height */ mcustomscrollbox.css("max-height","none"); if(mcustomscrollbox.height()!==$this.height()){mcustomscrollbox.css("max-height",$this.height());} _expandcontenthorizontally.call(this); /* expand content horizontally */ if(o.axis!=="y" && !o.advanced.autoexpandhorizontalscroll){ mcsb_container.css("width",_contentwidth(mcsb_container)); } d.overflowed=_overflowed.call(this); /* determine if scrolling is required */ _scrollbarvisibility.call(this); /* show/hide scrollbar(s) */ /* auto-adjust scrollbar dragger length analogous to content */ if(o.autodraggerlength){_setdraggerlength.call(this);} _scrollratio.call(this); /* calculate and store scrollbar to content ratio */ _bindevents.call(this); /* bind scrollbar events */ /* reset scrolling position and/or events */ var to=[math.abs(mcsb_container[0].offsettop),math.abs(mcsb_container[0].offsetleft)]; if(o.axis!=="x"){ /* y/yx axis */ if(!d.overflowed[0]){ /* y scrolling is not required */ _resetcontentposition.call(this); /* reset content position */ if(o.axis==="y"){ _unbindevents.call(this); }else if(o.axis==="yx" && d.overflowed[1]){ _scrollto($this,to[1].tostring(),{dir:"x",dur:0,overwrite:"none"}); } }else if(mcsb_dragger[0].height()>mcsb_dragger[0].parent().height()){ _resetcontentposition.call(this); /* reset content position */ }else{ /* y scrolling is required */ _scrollto($this,to[0].tostring(),{dir:"y",dur:0,overwrite:"none"}); d.contentreset.y=null; } } if(o.axis!=="y"){ /* x/yx axis */ if(!d.overflowed[1]){ /* x scrolling is not required */ _resetcontentposition.call(this); /* reset content position */ if(o.axis==="x"){ _unbindevents.call(this); }else if(o.axis==="yx" && d.overflowed[0]){ _scrollto($this,to[0].tostring(),{dir:"y",dur:0,overwrite:"none"}); } }else if(mcsb_dragger[1].width()>mcsb_dragger[1].parent().width()){ _resetcontentposition.call(this); /* reset content position */ }else{ /* x scrolling is required */ _scrollto($this,to[1].tostring(),{dir:"x",dur:0,overwrite:"none"}); d.contentreset.x=null; } } /* callbacks: onimageload, onselectorchange, onupdate */ if(cb && d){ if(cb===2 && o.callbacks.onimageload && typeof o.callbacks.onimageload==="function"){ o.callbacks.onimageload.call(this); }else if(cb===3 && o.callbacks.onselectorchange && typeof o.callbacks.onselectorchange==="function"){ o.callbacks.onselectorchange.call(this); }else if(o.callbacks.onupdate && typeof o.callbacks.onupdate==="function"){ o.callbacks.onupdate.call(this); } } _autoupdate.call(this); /* initialize automatic updating (for dynamic content, fluid layouts etc.) */ } }); }, /* ---------------------------------------- */ /* plugin scrollto method triggers a scrolling event to a specific value ---------------------------------------- usage: $(selector).mcustomscrollbar("scrollto",value,options); */ scrollto:function(val,options){ /* prevent silly things like $(selector).mcustomscrollbar("scrollto",undefined); */ if(typeof val=="undefined" || val==null){return;} var selector=_selector.call(this); /* validate selector */ return $(selector).each(function(){ var $this=$(this); if($this.data(pluginpfx)){ /* check if plugin has initialized */ var d=$this.data(pluginpfx),o=d.opt, /* method default options */ methoddefaults={ trigger:"external", /* method is by default triggered externally (e.g. from other scripts) */ scrollinertia:o.scrollinertia, /* scrolling inertia (animation duration) */ scrolleasing:"mcseaseinout", /* animation easing */ movedragger:false, /* move dragger instead of content */ timeout:60, /* scroll-to delay */ callbacks:true, /* enable/disable callbacks */ onstart:true, onupdate:true, oncomplete:true }, methodoptions=$.extend(true,{},methoddefaults,options), to=_arr.call(this,val),dur=methodoptions.scrollinertia>0 && methodoptions.scrollinertia<17 ? 17 : methodoptions.scrollinertia; /* translate yx values to actual scroll-to positions */ to[0]=_to.call(this,to[0],"y"); to[1]=_to.call(this,to[1],"x"); /* check if scroll-to value moves the dragger instead of content. only pixel values apply on dragger (e.g. 100, "100px", "-=100" etc.) */ if(methodoptions.movedragger){ to[0]*=d.scrollratio.y; to[1]*=d.scrollratio.x; } methodoptions.dur=_istabhidden() ? 0 : dur; //skip animations if browser tab is hidden settimeout(function(){ /* do the scrolling */ if(to[0]!==null && typeof to[0]!=="undefined" && o.axis!=="x" && d.overflowed[0]){ /* scroll y */ methodoptions.dir="y"; methodoptions.overwrite="all"; _scrollto($this,to[0].tostring(),methodoptions); } if(to[1]!==null && typeof to[1]!=="undefined" && o.axis!=="y" && d.overflowed[1]){ /* scroll x */ methodoptions.dir="x"; methodoptions.overwrite="none"; _scrollto($this,to[1].tostring(),methodoptions); } },methodoptions.timeout); } }); }, /* ---------------------------------------- */ /* plugin stop method stops scrolling animation ---------------------------------------- usage: $(selector).mcustomscrollbar("stop"); */ stop:function(){ var selector=_selector.call(this); /* validate selector */ return $(selector).each(function(){ var $this=$(this); if($this.data(pluginpfx)){ /* check if plugin has initialized */ _stop($this); } }); }, /* ---------------------------------------- */ /* plugin disable method temporarily disables the scrollbar(s) ---------------------------------------- usage: $(selector).mcustomscrollbar("disable",reset); reset (boolean): resets content position to 0 */ disable:function(r){ var selector=_selector.call(this); /* validate selector */ return $(selector).each(function(){ var $this=$(this); if($this.data(pluginpfx)){ /* check if plugin has initialized */ var d=$this.data(pluginpfx); _autoupdate.call(this,"remove"); /* remove automatic updating */ _unbindevents.call(this); /* unbind events */ if(r){_resetcontentposition.call(this);} /* reset content position */ _scrollbarvisibility.call(this,true); /* show/hide scrollbar(s) */ $this.addclass(classes[3]); /* add disable class */ } }); }, /* ---------------------------------------- */ /* plugin destroy method completely removes the scrollbar(s) and returns the element to its original state ---------------------------------------- usage: $(selector).mcustomscrollbar("destroy"); */ destroy:function(){ var selector=_selector.call(this); /* validate selector */ return $(selector).each(function(){ var $this=$(this); if($this.data(pluginpfx)){ /* check if plugin has initialized */ var d=$this.data(pluginpfx),o=d.opt, mcustomscrollbox=$("#mcsb_"+d.idx), mcsb_container=$("#mcsb_"+d.idx+"_container"), scrollbar=$(".mcsb_"+d.idx+"_scrollbar"); if(o.live){removelivetimers(o.liveselector || $(selector).selector);} /* remove live timers */ _autoupdate.call(this,"remove"); /* remove automatic updating */ _unbindevents.call(this); /* unbind events */ _resetcontentposition.call(this); /* reset content position */ $this.removedata(pluginpfx); /* remove plugin data object */ _delete(this,"mcs"); /* delete callbacks object */ /* remove plugin markup */ scrollbar.remove(); /* remove scrollbar(s) first (those can be either inside or outside plugin's inner wrapper) */ mcsb_container.find("img."+classes[2]).removeclass(classes[2]); /* remove loaded images flag */ mcustomscrollbox.replacewith(mcsb_container.contents()); /* replace plugin's inner wrapper with the original content */ /* remove plugin classes from the element and add destroy class */ $this.removeclass(pluginns+" _"+pluginpfx+"_"+d.idx+" "+classes[6]+" "+classes[7]+" "+classes[5]+" "+classes[3]).addclass(classes[4]); } }); } /* ---------------------------------------- */ }, /* ---------------------------------------- functions ---------------------------------------- */ /* validates selector (if selector is invalid or undefined uses the default one) */ _selector=function(){ return (typeof $(this)!=="object" || $(this).length<1) ? defaultselector : this; }, /* -------------------- */ /* changes options according to theme */ _theme=function(obj){ var fixedsizescrollbarthemes=["rounded","rounded-dark","rounded-dots","rounded-dots-dark"], nonexpandedscrollbarthemes=["rounded-dots","rounded-dots-dark","3d","3d-dark","3d-thick","3d-thick-dark","inset","inset-dark","inset-2","inset-2-dark","inset-3","inset-3-dark"], disabledscrollbuttonsthemes=["minimal","minimal-dark"], enabledautohidescrollbarthemes=["minimal","minimal-dark"], scrollbarpositionoutsidethemes=["minimal","minimal-dark"]; obj.autodraggerlength=$.inarray(obj.theme,fixedsizescrollbarthemes) > -1 ? false : obj.autodraggerlength; obj.autoexpandscrollbar=$.inarray(obj.theme,nonexpandedscrollbarthemes) > -1 ? false : obj.autoexpandscrollbar; obj.scrollbuttons.enable=$.inarray(obj.theme,disabledscrollbuttonsthemes) > -1 ? false : obj.scrollbuttons.enable; obj.autohidescrollbar=$.inarray(obj.theme,enabledautohidescrollbarthemes) > -1 ? true : obj.autohidescrollbar; obj.scrollbarposition=$.inarray(obj.theme,scrollbarpositionoutsidethemes) > -1 ? "outside" : obj.scrollbarposition; }, /* -------------------- */ /* live option timers removal */ removelivetimers=function(selector){ if(livetimers[selector]){ cleartimeout(livetimers[selector]); _delete(livetimers,selector); } }, /* -------------------- */ /* normalizes axis option to valid values: "y", "x", "yx" */ _findaxis=function(val){ return (val==="yx" || val==="xy" || val==="auto") ? "yx" : (val==="x" || val==="horizontal") ? "x" : "y"; }, /* -------------------- */ /* normalizes scrollbuttons.scrolltype option to valid values: "stepless", "stepped" */ _findscrollbuttonstype=function(val){ return (val==="stepped" || val==="pixels" || val==="step" || val==="click") ? "stepped" : "stepless"; }, /* -------------------- */ /* generates plugin markup */ _pluginmarkup=function(){ var $this=$(this),d=$this.data(pluginpfx),o=d.opt, expandclass=o.autoexpandscrollbar ? " "+classes[1]+"_expand" : "", scrollbar=["
    ","
    "], wrapperclass=o.axis==="yx" ? "mcsb_vertical_horizontal" : o.axis==="x" ? "mcsb_horizontal" : "mcsb_vertical", scrollbars=o.axis==="yx" ? scrollbar[0]+scrollbar[1] : o.axis==="x" ? scrollbar[1] : scrollbar[0], contentwrapper=o.axis==="yx" ? "
    " : "", autohideclass=o.autohidescrollbar ? " "+classes[6] : "", scrollbardirclass=(o.axis!=="x" && d.langdir==="rtl") ? " "+classes[7] : ""; if(o.setwidth){$this.css("width",o.setwidth);} /* set element width */ if(o.setheight){$this.css("height",o.setheight);} /* set element height */ o.setleft=(o.axis!=="y" && d.langdir==="rtl") ? "989999px" : o.setleft; /* adjust left position for rtl direction */ $this.addclass(pluginns+" _"+pluginpfx+"_"+d.idx+autohideclass+scrollbardirclass).wrapinner("
    "); var mcustomscrollbox=$("#mcsb_"+d.idx), mcsb_container=$("#mcsb_"+d.idx+"_container"); if(o.axis!=="y" && !o.advanced.autoexpandhorizontalscroll){ mcsb_container.css("width",_contentwidth(mcsb_container)); } if(o.scrollbarposition==="outside"){ if($this.css("position")==="static"){ /* requires elements with non-static position */ $this.css("position","relative"); } $this.css("overflow","visible"); mcustomscrollbox.addclass("mcsb_outside").after(scrollbars); }else{ mcustomscrollbox.addclass("mcsb_inside").append(scrollbars); mcsb_container.wrap(contentwrapper); } _scrollbuttons.call(this); /* add scrollbar buttons */ /* minimum dragger length */ var mcsb_dragger=[$("#mcsb_"+d.idx+"_dragger_vertical"),$("#mcsb_"+d.idx+"_dragger_horizontal")]; mcsb_dragger[0].css("min-height",mcsb_dragger[0].height()); mcsb_dragger[1].css("min-width",mcsb_dragger[1].width()); }, /* -------------------- */ /* calculates content width */ _contentwidth=function(el){ var val=[el[0].scrollwidth,math.max.apply(math,el.children().map(function(){return $(this).outerwidth(true);}).get())],w=el.parent().width(); return val[0]>w ? val[0] : val[1]>w ? val[1] : "100%"; }, /* -------------------- */ /* expands content horizontally */ _expandcontenthorizontally=function(){ var $this=$(this),d=$this.data(pluginpfx),o=d.opt, mcsb_container=$("#mcsb_"+d.idx+"_container"); if(o.advanced.autoexpandhorizontalscroll && o.axis!=="y"){ /* calculate scrollwidth */ mcsb_container.css({"width":"auto","min-width":0,"overflow-x":"scroll"}); var w=math.ceil(mcsb_container[0].scrollwidth); if(o.advanced.autoexpandhorizontalscroll===3 || (o.advanced.autoexpandhorizontalscroll!==2 && w>mcsb_container.parent().width())){ mcsb_container.css({"width":w,"min-width":"100%","overflow-x":"inherit"}); }else{ /* wrap content with an infinite width div and set its position to absolute and width to auto. setting width to auto before calculating the actual width is important! we must let the browser set the width as browser zoom values are impossible to calculate. */ mcsb_container.css({"overflow-x":"inherit","position":"absolute"}) .wrap("
    ") .css({ /* set actual width, original position and un-wrap */ /* get the exact width (with decimals) and then round-up. using jquery outerwidth() will round the width value which will mess up with inner elements that have non-integer width */ "width":(math.ceil(mcsb_container[0].getboundingclientrect().right+0.4)-math.floor(mcsb_container[0].getboundingclientrect().left)), "min-width":"100%", "position":"relative" }).unwrap(); } } }, /* -------------------- */ /* adds scrollbar buttons */ _scrollbuttons=function(){ var $this=$(this),d=$this.data(pluginpfx),o=d.opt, mcsb_scrolltools=$(".mcsb_"+d.idx+"_scrollbar:first"), tabindex=!_isnumeric(o.scrollbuttons.tabindex) ? "" : "tabindex='"+o.scrollbuttons.tabindex+"'", btnhtml=[ "", "", "", "" ], btn=[(o.axis==="x" ? btnhtml[2] : btnhtml[0]),(o.axis==="x" ? btnhtml[3] : btnhtml[1]),btnhtml[2],btnhtml[3]]; if(o.scrollbuttons.enable){ mcsb_scrolltools.prepend(btn[0]).append(btn[1]).next(".mcsb_scrolltools").prepend(btn[2]).append(btn[3]); } }, /* -------------------- */ /* auto-adjusts scrollbar dragger length */ _setdraggerlength=function(){ var $this=$(this),d=$this.data(pluginpfx), mcustomscrollbox=$("#mcsb_"+d.idx), mcsb_container=$("#mcsb_"+d.idx+"_container"), mcsb_dragger=[$("#mcsb_"+d.idx+"_dragger_vertical"),$("#mcsb_"+d.idx+"_dragger_horizontal")], ratio=[mcustomscrollbox.height()/mcsb_container.outerheight(false),mcustomscrollbox.width()/mcsb_container.outerwidth(false)], l=[ parseint(mcsb_dragger[0].css("min-height")),math.round(ratio[0]*mcsb_dragger[0].parent().height()), parseint(mcsb_dragger[1].css("min-width")),math.round(ratio[1]*mcsb_dragger[1].parent().width()) ], h=oldie && (l[1]contentheight){contentheight=h;} if(w>contentwidth){contentwidth=w;} return [contentheight>mcustomscrollbox.height(),contentwidth>mcustomscrollbox.width()]; }, /* -------------------- */ /* resets content position to 0 */ _resetcontentposition=function(){ var $this=$(this),d=$this.data(pluginpfx),o=d.opt, mcustomscrollbox=$("#mcsb_"+d.idx), mcsb_container=$("#mcsb_"+d.idx+"_container"), mcsb_dragger=[$("#mcsb_"+d.idx+"_dragger_vertical"),$("#mcsb_"+d.idx+"_dragger_horizontal")]; _stop($this); /* stop any current scrolling before resetting */ if((o.axis!=="x" && !d.overflowed[0]) || (o.axis==="y" && d.overflowed[0])){ /* reset y */ mcsb_dragger[0].add(mcsb_container).css("top",0); _scrollto($this,"_resety"); } if((o.axis!=="y" && !d.overflowed[1]) || (o.axis==="x" && d.overflowed[1])){ /* reset x */ var cx=dx=0; if(d.langdir==="rtl"){ /* adjust left position for rtl direction */ cx=mcustomscrollbox.width()-mcsb_container.outerwidth(false); dx=math.abs(cx/d.scrollratio.x); } mcsb_container.css("left",cx); mcsb_dragger[1].css("left",dx); _scrollto($this,"_resetx"); } }, /* -------------------- */ /* binds scrollbar events */ _bindevents=function(){ var $this=$(this),d=$this.data(pluginpfx),o=d.opt; if(!d.bindevents){ /* check if events are already bound */ _draggable.call(this); if(o.contenttouchscroll){_contentdraggable.call(this);} _selectable.call(this); if(o.mousewheel.enable){ /* bind mousewheel fn when plugin is available */ function _mwt(){ mousewheeltimeout=settimeout(function(){ if(!$.event.special.mousewheel){ _mwt(); }else{ cleartimeout(mousewheeltimeout); _mousewheel.call($this[0]); } },100); } var mousewheeltimeout; _mwt(); } _draggerrail.call(this); _wrapperscroll.call(this); if(o.advanced.autoscrollonfocus){_focus.call(this);} if(o.scrollbuttons.enable){_buttons.call(this);} if(o.keyboard.enable){_keyboard.call(this);} d.bindevents=true; } }, /* -------------------- */ /* unbinds scrollbar events */ _unbindevents=function(){ var $this=$(this),d=$this.data(pluginpfx),o=d.opt, namespace=pluginpfx+"_"+d.idx, sb=".mcsb_"+d.idx+"_scrollbar", sel=$("#mcsb_"+d.idx+",#mcsb_"+d.idx+"_container,#mcsb_"+d.idx+"_container_wrapper,"+sb+" ."+classes[12]+",#mcsb_"+d.idx+"_dragger_vertical,#mcsb_"+d.idx+"_dragger_horizontal,"+sb+">a"), mcsb_container=$("#mcsb_"+d.idx+"_container"); if(o.advanced.releasedraggableselectors){sel.add($(o.advanced.releasedraggableselectors));} if(o.advanced.extradraggableselectors){sel.add($(o.advanced.extradraggableselectors));} if(d.bindevents){ /* check if events are bound */ /* unbind namespaced events from document/selectors */ $(document).add($(!_canaccessiframe() || top.document)).unbind("."+namespace); sel.each(function(){ $(this).unbind("."+namespace); }); /* clear and delete timeouts/objects */ cleartimeout($this[0]._focustimeout); _delete($this[0],"_focustimeout"); cleartimeout(d.sequential.step); _delete(d.sequential,"step"); cleartimeout(mcsb_container[0].oncompletetimeout); _delete(mcsb_container[0],"oncompletetimeout"); d.bindevents=false; } }, /* -------------------- */ /* toggles scrollbar visibility */ _scrollbarvisibility=function(disabled){ var $this=$(this),d=$this.data(pluginpfx),o=d.opt, contentwrapper=$("#mcsb_"+d.idx+"_container_wrapper"), content=contentwrapper.length ? contentwrapper : $("#mcsb_"+d.idx+"_container"), scrollbar=[$("#mcsb_"+d.idx+"_scrollbar_vertical"),$("#mcsb_"+d.idx+"_scrollbar_horizontal")], mcsb_dragger=[scrollbar[0].find(".mcsb_dragger"),scrollbar[1].find(".mcsb_dragger")]; if(o.axis!=="x"){ if(d.overflowed[0] && !disabled){ scrollbar[0].add(mcsb_dragger[0]).add(scrollbar[0].children("a")).css("display","block"); content.removeclass(classes[8]+" "+classes[10]); }else{ if(o.alwaysshowscrollbar){ if(o.alwaysshowscrollbar!==2){mcsb_dragger[0].css("display","none");} content.removeclass(classes[10]); }else{ scrollbar[0].css("display","none"); content.addclass(classes[10]); } content.addclass(classes[8]); } } if(o.axis!=="y"){ if(d.overflowed[1] && !disabled){ scrollbar[1].add(mcsb_dragger[1]).add(scrollbar[1].children("a")).css("display","block"); content.removeclass(classes[9]+" "+classes[11]); }else{ if(o.alwaysshowscrollbar){ if(o.alwaysshowscrollbar!==2){mcsb_dragger[1].css("display","none");} content.removeclass(classes[11]); }else{ scrollbar[1].css("display","none"); content.addclass(classes[11]); } content.addclass(classes[9]); } } if(!d.overflowed[0] && !d.overflowed[1]){ $this.addclass(classes[5]); }else{ $this.removeclass(classes[5]); } }, /* -------------------- */ /* returns input coordinates of pointer, touch and mouse events (relative to document) */ _coordinates=function(e){ var t=e.type,o=e.target.ownerdocument!==document && frameelement!==null ? [$(frameelement).offset().top,$(frameelement).offset().left] : null, io=_canaccessiframe() && e.target.ownerdocument!==top.document && frameelement!==null ? [$(e.view.frameelement).offset().top,$(e.view.frameelement).offset().left] : [0,0]; switch(t){ case "pointerdown": case "mspointerdown": case "pointermove": case "mspointermove": case "pointerup": case "mspointerup": return o ? [e.originalevent.pagey-o[0]+io[0],e.originalevent.pagex-o[1]+io[1],false] : [e.originalevent.pagey,e.originalevent.pagex,false]; break; case "touchstart": case "touchmove": case "touchend": var touch=e.originalevent.touches[0] || e.originalevent.changedtouches[0], touches=e.originalevent.touches.length || e.originalevent.changedtouches.length; return e.target.ownerdocument!==document ? [touch.screeny,touch.screenx,touches>1] : [touch.pagey,touch.pagex,touches>1]; break; default: return o ? [e.pagey-o[0]+io[0],e.pagex-o[1]+io[1],false] : [e.pagey,e.pagex,false]; } }, /* -------------------- */ /* scrollbar drag events scrolls content via scrollbar dragging */ _draggable=function(){ var $this=$(this),d=$this.data(pluginpfx),o=d.opt, namespace=pluginpfx+"_"+d.idx, draggerid=["mcsb_"+d.idx+"_dragger_vertical","mcsb_"+d.idx+"_dragger_horizontal"], mcsb_container=$("#mcsb_"+d.idx+"_container"), mcsb_dragger=$("#"+draggerid[0]+",#"+draggerid[1]), draggable,dragy,dragx, rds=o.advanced.releasedraggableselectors ? mcsb_dragger.add($(o.advanced.releasedraggableselectors)) : mcsb_dragger, eds=o.advanced.extradraggableselectors ? $(!_canaccessiframe() || top.document).add($(o.advanced.extradraggableselectors)) : $(!_canaccessiframe() || top.document); mcsb_dragger.bind("contextmenu."+namespace,function(e){ e.preventdefault(); //prevent right click }).bind("mousedown."+namespace+" touchstart."+namespace+" pointerdown."+namespace+" mspointerdown."+namespace,function(e){ e.stopimmediatepropagation(); e.preventdefault(); if(!_mousebtnleft(e)){return;} /* left mouse button only */ touchactive=true; if(oldie){document.onselectstart=function(){return false;}} /* disable text selection for ie < 9 */ _iframe.call(mcsb_container,false); /* enable scrollbar dragging over iframes by disabling their events */ _stop($this); draggable=$(this); var offset=draggable.offset(),y=_coordinates(e)[0]-offset.top,x=_coordinates(e)[1]-offset.left, h=draggable.height()+offset.top,w=draggable.width()+offset.left; if(y0 && x0){ dragy=y; dragx=x; } _ondragclasses(draggable,"active",o.autoexpandscrollbar); }).bind("touchmove."+namespace,function(e){ e.stopimmediatepropagation(); e.preventdefault(); var offset=draggable.offset(),y=_coordinates(e)[0]-offset.top,x=_coordinates(e)[1]-offset.left; _drag(dragy,dragx,y,x); }); $(document).add(eds).bind("mousemove."+namespace+" pointermove."+namespace+" mspointermove."+namespace,function(e){ if(draggable){ var offset=draggable.offset(),y=_coordinates(e)[0]-offset.top,x=_coordinates(e)[1]-offset.left; if(dragy===y && dragx===x){return;} /* has it really moved? */ _drag(dragy,dragx,y,x); } }).add(rds).bind("mouseup."+namespace+" touchend."+namespace+" pointerup."+namespace+" mspointerup."+namespace,function(e){ if(draggable){ _ondragclasses(draggable,"active",o.autoexpandscrollbar); draggable=null; } touchactive=false; if(oldie){document.onselectstart=null;} /* enable text selection for ie < 9 */ _iframe.call(mcsb_container,true); /* enable iframes events */ }); function _drag(dragy,dragx,y,x){ mcsb_container[0].idletimer=o.scrollinertia<233 ? 250 : 0; if(draggable.attr("id")===draggerid[1]){ var dir="x",to=((draggable[0].offsetleft-dragx)+x)*d.scrollratio.x; }else{ var dir="y",to=((draggable[0].offsettop-dragy)+y)*d.scrollratio.y; } _scrollto($this,to.tostring(),{dir:dir,drag:true}); } }, /* -------------------- */ /* touch swipe events scrolls content via touch swipe emulates the native touch-swipe scrolling with momentum found in ios, android and wp devices */ _contentdraggable=function(){ var $this=$(this),d=$this.data(pluginpfx),o=d.opt, namespace=pluginpfx+"_"+d.idx, mcustomscrollbox=$("#mcsb_"+d.idx), mcsb_container=$("#mcsb_"+d.idx+"_container"), mcsb_dragger=[$("#mcsb_"+d.idx+"_dragger_vertical"),$("#mcsb_"+d.idx+"_dragger_horizontal")], draggable,dragy,dragx,touchstarty,touchstartx,touchmovey=[],touchmovex=[],starttime,runningtime,endtime,distance,speed,amount, dura=0,durb,overwrite=o.axis==="yx" ? "none" : "all",touchintent=[],touchdrag,docdrag, iframe=mcsb_container.find("iframe"), events=[ "touchstart."+namespace+" pointerdown."+namespace+" mspointerdown."+namespace, //start "touchmove."+namespace+" pointermove."+namespace+" mspointermove."+namespace, //move "touchend."+namespace+" pointerup."+namespace+" mspointerup."+namespace //end ], touchaction=document.body.style.touchaction!==undefined && document.body.style.touchaction!==""; mcsb_container.bind(events[0],function(e){ _ontouchstart(e); }).bind(events[1],function(e){ _ontouchmove(e); }); mcustomscrollbox.bind(events[0],function(e){ _ontouchstart2(e); }).bind(events[2],function(e){ _ontouchend(e); }); if(iframe.length){ iframe.each(function(){ $(this).bind("load",function(){ /* bind events on accessible iframes */ if(_canaccessiframe(this)){ $(this.contentdocument || this.contentwindow.document).bind(events[0],function(e){ _ontouchstart(e); _ontouchstart2(e); }).bind(events[1],function(e){ _ontouchmove(e); }).bind(events[2],function(e){ _ontouchend(e); }); } }); }); } function _ontouchstart(e){ if(!_pointertouch(e) || touchactive || _coordinates(e)[2]){touchable=0; return;} touchable=1; touchdrag=0; docdrag=0; draggable=1; $this.removeclass("mcs_touch_action"); var offset=mcsb_container.offset(); dragy=_coordinates(e)[0]-offset.top; dragx=_coordinates(e)[1]-offset.left; touchintent=[_coordinates(e)[0],_coordinates(e)[1]]; } function _ontouchmove(e){ if(!_pointertouch(e) || touchactive || _coordinates(e)[2]){return;} if(!o.documenttouchscroll){e.preventdefault();} e.stopimmediatepropagation(); if(docdrag && !touchdrag){return;} if(draggable){ runningtime=_gettime(); var offset=mcustomscrollbox.offset(),y=_coordinates(e)[0]-offset.top,x=_coordinates(e)[1]-offset.left, easing="mcslinearout"; touchmovey.push(y); touchmovex.push(x); touchintent[2]=math.abs(_coordinates(e)[0]-touchintent[0]); touchintent[3]=math.abs(_coordinates(e)[1]-touchintent[1]); if(d.overflowed[0]){ var limit=mcsb_dragger[0].parent().height()-mcsb_dragger[0].height(), prevent=((dragy-y)>0 && (y-dragy)>-(limit*d.scrollratio.y) && (touchintent[3]*20 && (x-dragx)>-(limitx*d.scrollratio.x) && (touchintent[2]*230){return;} speed=1000/(endtime-starttime); var easing="mcseaseout",slow=speed<2.5, diff=slow ? [touchmovey[touchmovey.length-2],touchmovex[touchmovex.length-2]] : [0,0]; distance=slow ? [(y-diff[0]),(x-diff[1])] : [y-touchstarty,x-touchstartx]; var absdistance=[math.abs(distance[0]),math.abs(distance[1])]; speed=slow ? [math.abs(distance[0]/4),math.abs(distance[1]/4)] : [speed,speed]; var a=[ math.abs(mcsb_container[0].offsettop)-(distance[0]*_m((absdistance[0]/speed[0]),speed[0])), math.abs(mcsb_container[0].offsetleft)-(distance[1]*_m((absdistance[1]/speed[1]),speed[1])) ]; amount=o.axis==="yx" ? [a[0],a[1]] : o.axis==="x" ? [null,a[1]] : [a[0],null]; durb=[(absdistance[0]*4)+o.scrollinertia,(absdistance[1]*4)+o.scrollinertia]; var md=parseint(o.contenttouchscroll) || 0; /* absolute minimum distance required */ amount[0]=absdistance[0]>md ? amount[0] : 0; amount[1]=absdistance[1]>md ? amount[1] : 0; if(d.overflowed[0]){_drag(amount[0],durb[0],easing,"y",overwrite,false);} if(d.overflowed[1]){_drag(amount[1],durb[1],easing,"x",overwrite,false);} } function _m(ds,s){ var r=[s*1.5,s*2,s/1.5,s/2]; if(ds>90){ return s>4 ? r[0] : r[3]; }else if(ds>60){ return s>3 ? r[3] : r[2]; }else if(ds>30){ return s>8 ? r[1] : s>6 ? r[0] : s>4 ? s : r[2]; }else{ return s>8 ? s : r[3]; } } function _drag(amount,dur,easing,dir,overwrite,drag){ if(!amount){return;} _scrollto($this,amount.tostring(),{dur:dur,scrolleasing:easing,dir:dir,overwrite:overwrite,drag:drag}); } }, /* -------------------- */ /* select text events scrolls content when text is selected */ _selectable=function(){ var $this=$(this),d=$this.data(pluginpfx),o=d.opt,seq=d.sequential, namespace=pluginpfx+"_"+d.idx, mcsb_container=$("#mcsb_"+d.idx+"_container"), wrapper=mcsb_container.parent(), action; mcsb_container.bind("mousedown."+namespace,function(e){ if(touchable){return;} if(!action){action=1; touchactive=true;} }).add(document).bind("mousemove."+namespace,function(e){ if(!touchable && action && _sel()){ var offset=mcsb_container.offset(), y=_coordinates(e)[0]-offset.top+mcsb_container[0].offsettop,x=_coordinates(e)[1]-offset.left+mcsb_container[0].offsetleft; if(y>0 && y0 && xwrapper.height()){ _seq("on",40); } } if(o.axis!=="y" && d.overflowed[1]){ if(x<0){ _seq("on",37); }else if(x>wrapper.width()){ _seq("on",39); } } } } }).bind("mouseup."+namespace+" dragend."+namespace,function(e){ if(touchable){return;} if(action){action=0; _seq("off",null);} touchactive=false; }); function _sel(){ return window.getselection ? window.getselection().tostring() : document.selection && document.selection.type!="control" ? document.selection.createrange().text : 0; } function _seq(a,c,s){ seq.type=s && action ? "stepped" : "stepless"; seq.scrollamount=10; _sequentialscroll($this,a,c,"mcslinearout",s ? 60 : null); } }, /* -------------------- */ /* mouse wheel event scrolls content via mouse-wheel via mouse-wheel plugin (https://github.com/brandonaaron/jquery-mousewheel) */ _mousewheel=function(){ if(!$(this).data(pluginpfx)){return;} /* check if the scrollbar is ready to use mousewheel events (issue: #185) */ var $this=$(this),d=$this.data(pluginpfx),o=d.opt, namespace=pluginpfx+"_"+d.idx, mcustomscrollbox=$("#mcsb_"+d.idx), mcsb_dragger=[$("#mcsb_"+d.idx+"_dragger_vertical"),$("#mcsb_"+d.idx+"_dragger_horizontal")], iframe=$("#mcsb_"+d.idx+"_container").find("iframe"); if(iframe.length){ iframe.each(function(){ $(this).bind("load",function(){ /* bind events on accessible iframes */ if(_canaccessiframe(this)){ $(this.contentdocument || this.contentwindow.document).bind("mousewheel."+namespace,function(e,delta){ _onmousewheel(e,delta); }); } }); }); } mcustomscrollbox.bind("mousewheel."+namespace,function(e,delta){ _onmousewheel(e,delta); }); function _onmousewheel(e,delta){ _stop($this); if(_disablemousewheel($this,e.target)){return;} /* disables mouse-wheel when hovering specific elements */ var deltafactor=o.mousewheel.deltafactor!=="auto" ? parseint(o.mousewheel.deltafactor) : (oldie && e.deltafactor<100) ? 100 : e.deltafactor || 100, dur=o.scrollinertia; if(o.axis==="x" || o.mousewheel.axis==="x"){ var dir="x", px=[math.round(deltafactor*d.scrollratio.x),parseint(o.mousewheel.scrollamount)], amount=o.mousewheel.scrollamount!=="auto" ? px[1] : px[0]>=mcustomscrollbox.width() ? mcustomscrollbox.width()*0.9 : px[0], contentpos=math.abs($("#mcsb_"+d.idx+"_container")[0].offsetleft), draggerpos=mcsb_dragger[1][0].offsetleft, limit=mcsb_dragger[1].parent().width()-mcsb_dragger[1].width(), dlt=o.mousewheel.axis==="y" ? (e.deltay || delta) : e.deltax; }else{ var dir="y", px=[math.round(deltafactor*d.scrollratio.y),parseint(o.mousewheel.scrollamount)], amount=o.mousewheel.scrollamount!=="auto" ? px[1] : px[0]>=mcustomscrollbox.height() ? mcustomscrollbox.height()*0.9 : px[0], contentpos=math.abs($("#mcsb_"+d.idx+"_container")[0].offsettop), draggerpos=mcsb_dragger[0][0].offsettop, limit=mcsb_dragger[0].parent().height()-mcsb_dragger[0].height(), dlt=e.deltay || delta; } if((dir==="y" && !d.overflowed[0]) || (dir==="x" && !d.overflowed[1])){return;} if(o.mousewheel.invert || e.webkitdirectioninvertedfromdevice){dlt=-dlt;} if(o.mousewheel.normalizedelta){dlt=dlt<0 ? -1 : 1;} if((dlt>0 && draggerpos!==0) || (dlt<0 && draggerpos!==limit) || o.mousewheel.preventdefault){ e.stopimmediatepropagation(); e.preventdefault(); } if(e.deltafactor<5 && !o.mousewheel.normalizedelta){ //very low deltafactor values mean some kind of delta acceleration (e.g. osx trackpad), so adjusting scrolling accordingly amount=e.deltafactor; dur=17; } _scrollto($this,(contentpos-(dlt*amount)).tostring(),{dir:dir,dur:dur}); } }, /* -------------------- */ /* checks if iframe can be accessed */ _canaccessiframecache=new object(), _canaccessiframe=function(iframe){ var result=false,cachekey=false,html=null; if(iframe===undefined){ cachekey="#empty"; }else if($(iframe).attr("id")!==undefined){ cachekey=$(iframe).attr("id"); } if(cachekey!==false && _canaccessiframecache[cachekey]!==undefined){ return _canaccessiframecache[cachekey]; } if(!iframe){ try{ var doc=top.document; html=doc.body.innerhtml; }catch(err){/* do nothing */} result=(html!==null); }else{ try{ var doc=iframe.contentdocument || iframe.contentwindow.document; html=doc.body.innerhtml; }catch(err){/* do nothing */} result=(html!==null); } if(cachekey!==false){_canaccessiframecache[cachekey]=result;} return result; }, /* -------------------- */ /* switches iframe's pointer-events property (drag, mousewheel etc. over cross-domain iframes) */ _iframe=function(evt){ var el=this.find("iframe"); if(!el.length){return;} /* check if content contains iframes */ var val=!evt ? "none" : "auto"; el.css("pointer-events",val); /* for ie11, iframe's display property should not be "block" */ }, /* -------------------- */ /* disables mouse-wheel when hovering specific elements like select, datalist etc. */ _disablemousewheel=function(el,target){ var tag=target.nodename.tolowercase(), tags=el.data(pluginpfx).opt.mousewheel.disableover, /* elements that require focus */ focustags=["select","textarea"]; return $.inarray(tag,tags) > -1 && !($.inarray(tag,focustags) > -1 && !$(target).is(":focus")); }, /* -------------------- */ /* dragger rail click event scrolls content via dragger rail */ _draggerrail=function(){ var $this=$(this),d=$this.data(pluginpfx), namespace=pluginpfx+"_"+d.idx, mcsb_container=$("#mcsb_"+d.idx+"_container"), wrapper=mcsb_container.parent(), mcsb_draggercontainer=$(".mcsb_"+d.idx+"_scrollbar ."+classes[12]), clickable; mcsb_draggercontainer.bind("mousedown."+namespace+" touchstart."+namespace+" pointerdown."+namespace+" mspointerdown."+namespace,function(e){ touchactive=true; if(!$(e.target).hasclass("mcsb_dragger")){clickable=1;} }).bind("touchend."+namespace+" pointerup."+namespace+" mspointerup."+namespace,function(e){ touchactive=false; }).bind("click."+namespace,function(e){ if(!clickable){return;} clickable=0; if($(e.target).hasclass(classes[12]) || $(e.target).hasclass("mcsb_draggerrail")){ _stop($this); var el=$(this),mcsb_dragger=el.find(".mcsb_dragger"); if(el.parent(".mcsb_scrolltools_horizontal").length>0){ if(!d.overflowed[1]){return;} var dir="x", clickdir=e.pagex>mcsb_dragger.offset().left ? -1 : 1, to=math.abs(mcsb_container[0].offsetleft)-(clickdir*(wrapper.width()*0.9)); }else{ if(!d.overflowed[0]){return;} var dir="y", clickdir=e.pagey>mcsb_dragger.offset().top ? -1 : 1, to=math.abs(mcsb_container[0].offsettop)-(clickdir*(wrapper.height()*0.9)); } _scrollto($this,to.tostring(),{dir:dir,scrolleasing:"mcseaseinout"}); } }); }, /* -------------------- */ /* focus event scrolls content via element focus (e.g. clicking an input, pressing tab key etc.) */ _focus=function(){ var $this=$(this),d=$this.data(pluginpfx),o=d.opt, namespace=pluginpfx+"_"+d.idx, mcsb_container=$("#mcsb_"+d.idx+"_container"), wrapper=mcsb_container.parent(); mcsb_container.bind("focusin."+namespace,function(e){ var el=$(document.activeelement), nested=mcsb_container.find(".mcustomscrollbox").length, dur=0; if(!el.is(o.advanced.autoscrollonfocus)){return;} _stop($this); cleartimeout($this[0]._focustimeout); $this[0]._focustimer=nested ? (dur+17)*nested : 0; $this[0]._focustimeout=settimeout(function(){ var to=[_childpos(el)[0],_childpos(el)[1]], contentpos=[mcsb_container[0].offsettop,mcsb_container[0].offsetleft], isvisible=[ (contentpos[0]+to[0]>=0 && contentpos[0]+to[0]=0 && contentpos[0]+to[1]a"); btn.bind("contextmenu."+namespace,function(e){ e.preventdefault(); //prevent right click }).bind("mousedown."+namespace+" touchstart."+namespace+" pointerdown."+namespace+" mspointerdown."+namespace+" mouseup."+namespace+" touchend."+namespace+" pointerup."+namespace+" mspointerup."+namespace+" mouseout."+namespace+" pointerout."+namespace+" mspointerout."+namespace+" click."+namespace,function(e){ e.preventdefault(); if(!_mousebtnleft(e)){return;} /* left mouse button only */ var btnclass=$(this).attr("class"); seq.type=o.scrollbuttons.scrolltype; switch(e.type){ case "mousedown": case "touchstart": case "pointerdown": case "mspointerdown": if(seq.type==="stepped"){return;} touchactive=true; d.tweenrunning=false; _seq("on",btnclass); break; case "mouseup": case "touchend": case "pointerup": case "mspointerup": case "mouseout": case "pointerout": case "mspointerout": if(seq.type==="stepped"){return;} touchactive=false; if(seq.dir){_seq("off",btnclass);} break; case "click": if(seq.type!=="stepped" || d.tweenrunning){return;} _seq("on",btnclass); break; } function _seq(a,c){ seq.scrollamount=o.scrollbuttons.scrollamount; _sequentialscroll($this,a,c); } }); }, /* -------------------- */ /* keyboard events scrolls content via keyboard keys: up arrow, down arrow, left arrow, right arrow, pgup, pgdn, home, end */ _keyboard=function(){ var $this=$(this),d=$this.data(pluginpfx),o=d.opt,seq=d.sequential, namespace=pluginpfx+"_"+d.idx, mcustomscrollbox=$("#mcsb_"+d.idx), mcsb_container=$("#mcsb_"+d.idx+"_container"), wrapper=mcsb_container.parent(), editables="input,textarea,select,datalist,keygen,[contenteditable='true']", iframe=mcsb_container.find("iframe"), events=["blur."+namespace+" keydown."+namespace+" keyup."+namespace]; if(iframe.length){ iframe.each(function(){ $(this).bind("load",function(){ /* bind events on accessible iframes */ if(_canaccessiframe(this)){ $(this.contentdocument || this.contentwindow.document).bind(events[0],function(e){ _onkeyboard(e); }); } }); }); } mcustomscrollbox.attr("tabindex","0").bind(events[0],function(e){ _onkeyboard(e); }); function _onkeyboard(e){ switch(e.type){ case "blur": if(d.tweenrunning && seq.dir){_seq("off",null);} break; case "keydown": case "keyup": var code=e.keycode ? e.keycode : e.which,action="on"; if((o.axis!=="x" && (code===38 || code===40)) || (o.axis!=="y" && (code===37 || code===39))){ /* up (38), down (40), left (37), right (39) arrows */ if(((code===38 || code===40) && !d.overflowed[0]) || ((code===37 || code===39) && !d.overflowed[1])){return;} if(e.type==="keyup"){action="off";} if(!$(document.activeelement).is(editables)){ e.preventdefault(); e.stopimmediatepropagation(); _seq(action,code); } }else if(code===33 || code===34){ /* pgup (33), pgdn (34) */ if(d.overflowed[0] || d.overflowed[1]){ e.preventdefault(); e.stopimmediatepropagation(); } if(e.type==="keyup"){ _stop($this); var keyboarddir=code===34 ? -1 : 1; if(o.axis==="x" || (o.axis==="yx" && d.overflowed[1] && !d.overflowed[0])){ var dir="x",to=math.abs(mcsb_container[0].offsetleft)-(keyboarddir*(wrapper.width()*0.9)); }else{ var dir="y",to=math.abs(mcsb_container[0].offsettop)-(keyboarddir*(wrapper.height()*0.9)); } _scrollto($this,to.tostring(),{dir:dir,scrolleasing:"mcseaseinout"}); } }else if(code===35 || code===36){ /* end (35), home (36) */ if(!$(document.activeelement).is(editables)){ if(d.overflowed[0] || d.overflowed[1]){ e.preventdefault(); e.stopimmediatepropagation(); } if(e.type==="keyup"){ if(o.axis==="x" || (o.axis==="yx" && d.overflowed[1] && !d.overflowed[0])){ var dir="x",to=code===35 ? math.abs(wrapper.width()-mcsb_container.outerwidth(false)) : 0; }else{ var dir="y",to=code===35 ? math.abs(wrapper.height()-mcsb_container.outerheight(false)) : 0; } _scrollto($this,to.tostring(),{dir:dir,scrolleasing:"mcseaseinout"}); } } } break; } function _seq(a,c){ seq.type=o.keyboard.scrolltype; seq.scrollamount=o.keyboard.scrollamount; if(seq.type==="stepped" && d.tweenrunning){return;} _sequentialscroll($this,a,c); } } }, /* -------------------- */ /* scrolls content sequentially (used when scrolling via buttons, keyboard arrows etc.) */ _sequentialscroll=function(el,action,trigger,e,s){ var d=el.data(pluginpfx),o=d.opt,seq=d.sequential, mcsb_container=$("#mcsb_"+d.idx+"_container"), once=seq.type==="stepped" ? true : false, steplessspeed=o.scrollinertia < 26 ? 26 : o.scrollinertia, /* 26/1.5=17 */ steppedspeed=o.scrollinertia < 1 ? 17 : o.scrollinertia; switch(action){ case "on": seq.dir=[ (trigger===classes[16] || trigger===classes[15] || trigger===39 || trigger===37 ? "x" : "y"), (trigger===classes[13] || trigger===classes[15] || trigger===38 || trigger===37 ? -1 : 1) ]; _stop(el); if(_isnumeric(trigger) && seq.type==="stepped"){return;} _on(once); break; case "off": _off(); if(once || (d.tweenrunning && seq.dir)){ _on(true); } break; } /* starts sequence */ function _on(once){ if(o.snapamount){seq.scrollamount=!(o.snapamount instanceof array) ? o.snapamount : seq.dir[0]==="x" ? o.snapamount[1] : o.snapamount[0];} /* scrolling snapping */ var c=seq.type!=="stepped", /* continuous scrolling */ t=s ? s : !once ? 1000/60 : c ? steplessspeed/1.5 : steppedspeed, /* timer */ m=!once ? 2.5 : c ? 7.5 : 40, /* multiplier */ contentpos=[math.abs(mcsb_container[0].offsettop),math.abs(mcsb_container[0].offsetleft)], ratio=[d.scrollratio.y>10 ? 10 : d.scrollratio.y,d.scrollratio.x>10 ? 10 : d.scrollratio.x], amount=seq.dir[0]==="x" ? contentpos[1]+(seq.dir[1]*(ratio[1]*m)) : contentpos[0]+(seq.dir[1]*(ratio[0]*m)), px=seq.dir[0]==="x" ? contentpos[1]+(seq.dir[1]*parseint(seq.scrollamount)) : contentpos[0]+(seq.dir[1]*parseint(seq.scrollamount)), to=seq.scrollamount!=="auto" ? px : amount, easing=e ? e : !once ? "mcslinear" : c ? "mcslinearout" : "mcseaseinout", oncomplete=!once ? false : true; if(once && t<17){ to=seq.dir[0]==="x" ? contentpos[1] : contentpos[0]; } _scrollto(el,to.tostring(),{dir:seq.dir[0],scrolleasing:easing,dur:t,oncomplete:oncomplete}); if(once){ seq.dir=false; return; } cleartimeout(seq.step); seq.step=settimeout(function(){ _on(); },t); } /* stops sequence */ function _off(){ cleartimeout(seq.step); _delete(seq,"step"); _stop(el); } }, /* -------------------- */ /* returns a yx array from value */ _arr=function(val){ var o=$(this).data(pluginpfx).opt,vals=[]; if(typeof val==="function"){val=val();} /* check if the value is a single anonymous function */ /* check if value is object or array, its length and create an array with yx values */ if(!(val instanceof array)){ /* object value (e.g. {y:"100",x:"100"}, 100 etc.) */ vals[0]=val.y ? val.y : val.x || o.axis==="x" ? null : val; vals[1]=val.x ? val.x : val.y || o.axis==="y" ? null : val; }else{ /* array value (e.g. [100,100]) */ vals=val.length>1 ? [val[0],val[1]] : o.axis==="x" ? [null,val[0]] : [val[0],null]; } /* check if array values are anonymous functions */ if(typeof vals[0]==="function"){vals[0]=vals[0]();} if(typeof vals[1]==="function"){vals[1]=vals[1]();} return vals; }, /* -------------------- */ /* translates values (e.g. "top", 100, "100px", "#id") to actual scroll-to positions */ _to=function(val,dir){ if(val==null || typeof val=="undefined"){return;} var $this=$(this),d=$this.data(pluginpfx),o=d.opt, mcsb_container=$("#mcsb_"+d.idx+"_container"), wrapper=mcsb_container.parent(), t=typeof val; if(!dir){dir=o.axis==="x" ? "x" : "y";} var contentlength=dir==="x" ? mcsb_container.outerwidth(false)-wrapper.width() : mcsb_container.outerheight(false)-wrapper.height(), contentpos=dir==="x" ? mcsb_container[0].offsetleft : mcsb_container[0].offsettop, cssprop=dir==="x" ? "left" : "top"; switch(t){ case "function": /* this currently is not used. consider removing it */ return val(); break; case "object": /* js/jquery object */ var obj=val.jquery ? val : $(val); if(!obj.length){return;} return dir==="x" ? _childpos(obj)[1] : _childpos(obj)[0]; break; case "string": case "number": if(_isnumeric(val)){ /* numeric value */ return math.abs(val); }else if(val.indexof("%")!==-1){ /* percentage value */ return math.abs(contentlength*parseint(val)/100); }else if(val.indexof("-=")!==-1){ /* decrease value */ return math.abs(contentpos-parseint(val.split("-=")[1])); }else if(val.indexof("+=")!==-1){ /* inrease value */ var p=(contentpos+parseint(val.split("+=")[1])); return p>=0 ? 0 : math.abs(p); }else if(val.indexof("px")!==-1 && _isnumeric(val.split("px")[0])){ /* pixels string value (e.g. "100px") */ return math.abs(val.split("px")[0]); }else{ if(val==="top" || val==="left"){ /* special strings */ return 0; }else if(val==="bottom"){ return math.abs(wrapper.height()-mcsb_container.outerheight(false)); }else if(val==="right"){ return math.abs(wrapper.width()-mcsb_container.outerwidth(false)); }else if(val==="first" || val==="last"){ var obj=mcsb_container.find(":"+val); return dir==="x" ? _childpos(obj)[1] : _childpos(obj)[0]; }else{ if($(val).length){ /* jquery selector */ return dir==="x" ? _childpos($(val))[1] : _childpos($(val))[0]; }else{ /* other values (e.g. "100em") */ mcsb_container.css(cssprop,val); methods.update.call(null,$this[0]); return; } } } break; } }, /* -------------------- */ /* calls the update method automatically */ _autoupdate=function(rem){ var $this=$(this),d=$this.data(pluginpfx),o=d.opt, mcsb_container=$("#mcsb_"+d.idx+"_container"); if(rem){ /* removes autoupdate timer usage: _autoupdate.call(this,"remove"); */ cleartimeout(mcsb_container[0].autoupdate); _delete(mcsb_container[0],"autoupdate"); return; } upd(); function upd(){ cleartimeout(mcsb_container[0].autoupdate); if($this.parents("html").length===0){ /* check element in dom tree */ $this=null; return; } mcsb_container[0].autoupdate=settimeout(function(){ /* update on specific selector(s) length and size change */ if(o.advanced.updateonselectorchange){ d.poll.change.n=sizessum(); if(d.poll.change.n!==d.poll.change.o){ d.poll.change.o=d.poll.change.n; doupd(3); return; } } /* update on main element and scrollbar size changes */ if(o.advanced.updateoncontentresize){ d.poll.size.n=$this[0].scrollheight+$this[0].scrollwidth+mcsb_container[0].offsetheight+$this[0].offsetheight+$this[0].offsetwidth; if(d.poll.size.n!==d.poll.size.o){ d.poll.size.o=d.poll.size.n; doupd(1); return; } } /* update on image load */ if(o.advanced.updateonimageload){ if(!(o.advanced.updateonimageload==="auto" && o.axis==="y")){ //by default, it doesn't run on vertical content d.poll.img.n=mcsb_container.find("img").length; if(d.poll.img.n!==d.poll.img.o){ d.poll.img.o=d.poll.img.n; mcsb_container.find("img").each(function(){ imgloader(this); }); return; } } } if(o.advanced.updateonselectorchange || o.advanced.updateoncontentresize || o.advanced.updateonimageload){upd();} },o.advanced.autoupdatetimeout); } /* a tiny image loader */ function imgloader(el){ if($(el).hasclass(classes[2])){doupd(); return;} var img=new image(); function createdelegate(contextobject,delegatemethod){ return function(){return delegatemethod.apply(contextobject,arguments);} } function imgonload(){ this.onload=null; $(el).addclass(classes[2]); doupd(2); } img.onload=createdelegate(img,imgonload); img.src=el.src; } /* returns the total height and width sum of all elements matching the selector */ function sizessum(){ if(o.advanced.updateonselectorchange===true){o.advanced.updateonselectorchange="*";} var total=0,sel=mcsb_container.find(o.advanced.updateonselectorchange); if(o.advanced.updateonselectorchange && sel.length>0){sel.each(function(){total+=this.offsetheight+this.offsetwidth;});} return total; } /* calls the update method */ function doupd(cb){ cleartimeout(mcsb_container[0].autoupdate); methods.update.call(null,$this[0],cb); } }, /* -------------------- */ /* snaps scrolling to a multiple of a pixels number */ _snapamount=function(to,amount,offset){ return (math.round(to/amount)*amount-offset); }, /* -------------------- */ /* stops content and scrollbar animations */ _stop=function(el){ var d=el.data(pluginpfx), sel=$("#mcsb_"+d.idx+"_container,#mcsb_"+d.idx+"_container_wrapper,#mcsb_"+d.idx+"_dragger_vertical,#mcsb_"+d.idx+"_dragger_horizontal"); sel.each(function(){ _stoptween.call(this); }); }, /* -------------------- */ /* animates content this is where the actual scrolling happens */ _scrollto=function(el,to,options){ var d=el.data(pluginpfx),o=d.opt, defaults={ trigger:"internal", dir:"y", scrolleasing:"mcseaseout", drag:false, dur:o.scrollinertia, overwrite:"all", callbacks:true, onstart:true, onupdate:true, oncomplete:true }, options=$.extend(defaults,options), dur=[options.dur,(options.drag ? 0 : options.dur)], mcustomscrollbox=$("#mcsb_"+d.idx), mcsb_container=$("#mcsb_"+d.idx+"_container"), wrapper=mcsb_container.parent(), totalscrolloffsets=o.callbacks.ontotalscrolloffset ? _arr.call(el,o.callbacks.ontotalscrolloffset) : [0,0], totalscrollbackoffsets=o.callbacks.ontotalscrollbackoffset ? _arr.call(el,o.callbacks.ontotalscrollbackoffset) : [0,0]; d.trigger=options.trigger; if(wrapper.scrolltop()!==0 || wrapper.scrollleft()!==0){ /* always reset scrolltop/left */ $(".mcsb_"+d.idx+"_scrollbar").css("visibility","visible"); wrapper.scrolltop(0).scrollleft(0); } if(to==="_resety" && !d.contentreset.y){ /* callbacks: onoverflowynone */ if(_cb("onoverflowynone")){o.callbacks.onoverflowynone.call(el[0]);} d.contentreset.y=1; } if(to==="_resetx" && !d.contentreset.x){ /* callbacks: onoverflowxnone */ if(_cb("onoverflowxnone")){o.callbacks.onoverflowxnone.call(el[0]);} d.contentreset.x=1; } if(to==="_resety" || to==="_resetx"){return;} if((d.contentreset.y || !el[0].mcs) && d.overflowed[0]){ /* callbacks: onoverflowy */ if(_cb("onoverflowy")){o.callbacks.onoverflowy.call(el[0]);} d.contentreset.x=null; } if((d.contentreset.x || !el[0].mcs) && d.overflowed[1]){ /* callbacks: onoverflowx */ if(_cb("onoverflowx")){o.callbacks.onoverflowx.call(el[0]);} d.contentreset.x=null; } if(o.snapamount){ /* scrolling snapping */ var snapamount=!(o.snapamount instanceof array) ? o.snapamount : options.dir==="x" ? o.snapamount[1] : o.snapamount[0]; to=_snapamount(to,snapamount,o.snapoffset); } switch(options.dir){ case "x": var mcsb_dragger=$("#mcsb_"+d.idx+"_dragger_horizontal"), property="left", contentpos=mcsb_container[0].offsetleft, limit=[ mcustomscrollbox.width()-mcsb_container.outerwidth(false), mcsb_dragger.parent().width()-mcsb_dragger.width() ], scrollto=[to,to===0 ? 0 : (to/d.scrollratio.x)], tso=totalscrolloffsets[1], tsbo=totalscrollbackoffsets[1], totalscrolloffset=tso>0 ? tso/d.scrollratio.x : 0, totalscrollbackoffset=tsbo>0 ? tsbo/d.scrollratio.x : 0; break; case "y": var mcsb_dragger=$("#mcsb_"+d.idx+"_dragger_vertical"), property="top", contentpos=mcsb_container[0].offsettop, limit=[ mcustomscrollbox.height()-mcsb_container.outerheight(false), mcsb_dragger.parent().height()-mcsb_dragger.height() ], scrollto=[to,to===0 ? 0 : (to/d.scrollratio.y)], tso=totalscrolloffsets[0], tsbo=totalscrollbackoffsets[0], totalscrolloffset=tso>0 ? tso/d.scrollratio.y : 0, totalscrollbackoffset=tsbo>0 ? tsbo/d.scrollratio.y : 0; break; } if(scrollto[1]<0 || (scrollto[0]===0 && scrollto[1]===0)){ scrollto=[0,0]; }else if(scrollto[1]>=limit[1]){ scrollto=[limit[0],limit[1]]; }else{ scrollto[0]=-scrollto[0]; } if(!el[0].mcs){ _mcs(); /* init mcs object (once) to make it available before callbacks */ if(_cb("oninit")){o.callbacks.oninit.call(el[0]);} /* callbacks: oninit */ } cleartimeout(mcsb_container[0].oncompletetimeout); _tweento(mcsb_dragger[0],property,math.round(scrollto[1]),dur[1],options.scrolleasing); if(!d.tweenrunning && ((contentpos===0 && scrollto[0]>=0) || (contentpos===limit[0] && scrollto[0]<=limit[0]))){return;} _tweento(mcsb_container[0],property,math.round(scrollto[0]),dur[0],options.scrolleasing,options.overwrite,{ onstart:function(){ if(options.callbacks && options.onstart && !d.tweenrunning){ /* callbacks: onscrollstart */ if(_cb("onscrollstart")){_mcs(); o.callbacks.onscrollstart.call(el[0]);} d.tweenrunning=true; _ondragclasses(mcsb_dragger); d.cboffsets=_cboffsets(); } },onupdate:function(){ if(options.callbacks && options.onupdate){ /* callbacks: whilescrolling */ if(_cb("whilescrolling")){_mcs(); o.callbacks.whilescrolling.call(el[0]);} } },oncomplete:function(){ if(options.callbacks && options.oncomplete){ if(o.axis==="yx"){cleartimeout(mcsb_container[0].oncompletetimeout);} var t=mcsb_container[0].idletimer || 0; mcsb_container[0].oncompletetimeout=settimeout(function(){ /* callbacks: onscroll, ontotalscroll, ontotalscrollback */ if(_cb("onscroll")){_mcs(); o.callbacks.onscroll.call(el[0]);} if(_cb("ontotalscroll") && scrollto[1]>=limit[1]-totalscrolloffset && d.cboffsets[0]){_mcs(); o.callbacks.ontotalscroll.call(el[0]);} if(_cb("ontotalscrollback") && scrollto[1]<=totalscrollbackoffset && d.cboffsets[1]){_mcs(); o.callbacks.ontotalscrollback.call(el[0]);} d.tweenrunning=false; mcsb_container[0].idletimer=0; _ondragclasses(mcsb_dragger,"hide"); },t); } } }); /* checks if callback function exists */ function _cb(cb){ return d && o.callbacks[cb] && typeof o.callbacks[cb]==="function"; } /* checks whether callback offsets always trigger */ function _cboffsets(){ return [o.callbacks.alwaystriggeroffsets || contentpos>=limit[0]+tso,o.callbacks.alwaystriggeroffsets || contentpos<=-tsbo]; } /* populates object with useful values for the user values: content: this.mcs.content content top position: this.mcs.top content left position: this.mcs.left dragger top position: this.mcs.draggertop dragger left position: this.mcs.draggerleft scrolling y percentage: this.mcs.toppct scrolling x percentage: this.mcs.leftpct scrolling direction: this.mcs.direction */ function _mcs(){ var cp=[mcsb_container[0].offsettop,mcsb_container[0].offsetleft], /* content position */ dp=[mcsb_dragger[0].offsettop,mcsb_dragger[0].offsetleft], /* dragger position */ cl=[mcsb_container.outerheight(false),mcsb_container.outerwidth(false)], /* content length */ pl=[mcustomscrollbox.height(),mcustomscrollbox.width()]; /* content parent length */ el[0].mcs={ content:mcsb_container, /* original content wrapper as jquery object */ top:cp[0],left:cp[1],draggertop:dp[0],draggerleft:dp[1], toppct:math.round((100*math.abs(cp[0]))/(math.abs(cl[0])-pl[0])),leftpct:math.round((100*math.abs(cp[1]))/(math.abs(cl[1])-pl[1])), direction:options.dir }; /* this refers to the original element containing the scrollbar(s) usage: this.mcs.top, this.mcs.leftpct etc. */ } }, /* -------------------- */ /* custom javascript animation tween lighter and faster than jquery animate() and css transitions animates top/left properties and includes easings */ _tweento=function(el,prop,to,duration,easing,overwrite,callbacks){ if(!el._mtween){el._mtween={top:{},left:{}};} var callbacks=callbacks || {}, onstart=callbacks.onstart || function(){},onupdate=callbacks.onupdate || function(){},oncomplete=callbacks.oncomplete || function(){}, starttime=_gettime(),_delay,progress=0,from=el.offsettop,elstyle=el.style,_request,tobj=el._mtween[prop]; if(prop==="left"){from=el.offsetleft;} var diff=to-from; tobj.stop=0; if(overwrite!=="none"){_canceltween();} _starttween(); function _step(){ if(tobj.stop){return;} if(!progress){onstart.call();} progress=_gettime()-starttime; _tween(); if(progress>=tobj.time){ tobj.time=(progress>tobj.time) ? progress+_delay-(progress-tobj.time) : progress+_delay-1; if(tobj.time0){ tobj.currval=_ease(tobj.time,from,diff,duration,easing); elstyle[prop]=math.round(tobj.currval)+"px"; }else{ elstyle[prop]=to+"px"; } onupdate.call(); } function _starttween(){ _delay=1000/60; tobj.time=progress+_delay; _request=(!window.requestanimationframe) ? function(f){_tween(); return settimeout(f,0.01);} : window.requestanimationframe; tobj.id=_request(_step); } function _canceltween(){ if(tobj.id==null){return;} if(!window.requestanimationframe){cleartimeout(tobj.id); }else{window.cancelanimationframe(tobj.id);} tobj.id=null; } function _ease(t,b,c,d,type){ switch(type){ case "linear": case "mcslinear": return c*t/d + b; break; case "mcslinearout": t/=d; t--; return c * math.sqrt(1 - t*t) + b; break; case "easeinoutsmooth": t/=d/2; if(t<1) return c/2*t*t + b; t--; return -c/2 * (t*(t-2) - 1) + b; break; case "easeinoutstrong": t/=d/2; if(t<1) return c/2 * math.pow( 2, 10 * (t - 1) ) + b; t--; return c/2 * ( -math.pow( 2, -10 * t) + 2 ) + b; break; case "easeinout": case "mcseaseinout": t/=d/2; if(t<1) return c/2*t*t*t + b; t-=2; return c/2*(t*t*t + 2) + b; break; case "easeoutsmooth": t/=d; t--; return -c * (t*t*t*t - 1) + b; break; case "easeoutstrong": return c * ( -math.pow( 2, -10 * t/d ) + 1 ) + b; break; case "easeout": case "mcseaseout": default: var ts=(t/=d)*t,tc=ts*t; return b+c*(0.499999999999997*tc*ts + -2.5*ts*ts + 5.5*tc + -6.5*ts + 4*t); } } }, /* -------------------- */ /* returns current time */ _gettime=function(){ if(window.performance && window.performance.now){ return window.performance.now(); }else{ if(window.performance && window.performance.webkitnow){ return window.performance.webkitnow(); }else{ if(date.now){return date.now();}else{return new date().gettime();} } } }, /* -------------------- */ /* stops a tween */ _stoptween=function(){ var el=this; if(!el._mtween){el._mtween={top:{},left:{}};} var props=["top","left"]; for(var i=0; i
    '),t.parent().wrap('
    '),n.find(v).css("width",i+"%"),o>1&&(l.controlarrows&&te(n),l.slidesnavigation&&pn(n,o)),t.each(function(n){e(this).css("width",a+"%"),l.verticalcentered&&mn(e(this))});var r=n.find(d);r.length&&(0!==e(b).index(y)||0===e(b).index(y)&&0!==r.index())?zn(r):t.eq(0).addclass(p)}function be(n,t){t||0!==e(b).length||n.addclass(p),n.css("height",gt+"px"),l.paddingtop&&n.css("padding-top",l.paddingtop),l.paddingbottom&&n.css("padding-bottom",l.paddingbottom),"undefined"!=typeof l.sectionscolor[t]&&n.css("background-color",l.sectionscolor[t]),"undefined"!=typeof l.anchors[t]&&n.attr("data-anchor",l.anchors[t])}function xe(n,t){"undefined"!=typeof l.anchors[t]&&n.hasclass(p)&&in(l.anchors[t],t),l.menu&&l.css3&&e(l.menu).closest(r).length&&e(l.menu).appendto(lt)}function ce(){vt.find(l.sectionselector).addclass(s),vt.find(l.slideselector).addclass(r)}function te(e){e.find(q).after('
    '),"#fff"!=l.controlarrowcolor&&(e.find(ee).css("border-color","transparent transparent transparent "+l.controlarrowcolor),e.find(j).css("border-color","transparent "+l.controlarrowcolor+" transparent transparent")),l.loophorizontal||e.find(j).hide()}function ke(){lt.append('
      ');var n=e(a);n.addclass(function(){return l.showactivetooltip?h+" "+l.navigationposition:l.navigationposition});for(var t=0;t
      ',a=l.navigationtooltips[t];"undefined"!=typeof a&&""!==a&&(i+='
      '+a+"
      "),i+="",n.find("ul").append(i)}e(a).css("margin-top","-"+e(a).height()/2+"px"),e(a).find("li").eq(e(b).index(y)).find("a").addclass(p)}function ie(){e(y).each(function(){var n=e(this).find(z);n.length?n.each(function(){an(e(this))}):an(e(this))}),me()}function le(){vt.find('iframe[src*="youtube.com/embed/"]').each(function(){ee(e(this),"enablejsapi=1")})}function ee(e,n){var t=e.attr("src");e.attr("src",t+ae(t)+n)}function ae(e){return/\?/.test(e)?"&":"?"}function me(){var n=e(b);n.addclass(g),l.scrolloverflowhandler.afterrender&&l.scrolloverflowhandler.afterrender(n),ze(n),$e(n),l.scrolloverflowhandler.afterload(),e.isfunction(l.afterload)&&l.afterload.call(n,n.data("anchor"),n.index(y)+1),e.isfunction(l.afterrender)&&l.afterrender.call(vt)}function oe(){var n;if(!l.autoscrolling||l.scrollbar){var o=ne.scrolltop(),i=be(o),a=0,r=o+ne.height()/2,s=lt.height()-ne.height()===o,c=t.queryselectorall(y);if(s)a=c.length-1;else if(o)for(var d=0;d=ne.scrolltop()+ne.height():t<=ne.scrolltop()}function be(e){var n=e>mt?"down":"up";return mt=e,dt=e,n}function re(e,n){if(bt.m[e]){var t="down"===e?"bottom":"top",o="down"===e?ce:se;if(n.length>0){if(!l.scrolloverflowhandler.isscrolled(t,n))return!0;o()}else o()}}function ze(e){var n=e.originalevent;!pe(e.target)&&l.autoscrolling&&qe(n)&&e.preventdefault()}function de(n){var t=n.originalevent,i=e(t.target).closest(y);if(!pe(n.target)&&qe(t)){l.autoscrolling&&n.preventdefault();var a=l.scrolloverflowhandler.scrollable(i),r=jn(t);bt=r.y,rt=r.x,i.find(q).length&&o.abs(ht-rt)>o.abs(ot-bt)?!ut&&o.abs(ht-rt)>ne.outerwidth()/100*l.touchsensitivity&&(ht>rt?bt.m.right&&ue(i):bt.m.left&&he(i)):l.autoscrolling&&st&&o.abs(ot-bt)>ne.height()/100*l.touchsensitivity&&(ot>bt?re("down",a):bt>ot&&re("up",a))}}function pe(n,t){t=t||0;var o=e(n).parent();return t149&&yt.shift(),yt.push(o.abs(r)),l.scrollbar&&(t.preventdefault?t.preventdefault():t.returnvalue=!1);var f=e(b),u=l.scrolloverflowhandler.scrollable(f),h=i-zt;if(zt=i,h>200&&(yt=[]),st){var p=ve(yt,10),v=ve(yt,70),g=p>=v;g&&d&&(0>s?re("down",u):re("up",u))}return!1}l.fittosection&&rt.stop()}function ye(n,t){var o="undefined"==typeof t?e(b):t,i=o.find(q),a=i.find(z).length;if(!(!i.length||ut||2>a)){var r=i.find(d),s=null;if(s="left"===n?r.prev(z):r.next(z),!s.length){if(!l.loophorizontal)return;s="left"===n?r.siblings(":last"):r.siblings(":first")}ut=!0,gn(i,s,n)}}function je(){e(d).each(function(){zn(e(this),"internal")})}function ne(e){var n=e.position(),t=n.top,o=n.top>dt,i=t-gt+e.outerheight(),a=l.bigsectionsdestination;return e.outerheight()>gt?(!o&&!a||"bottom"===a)&&(t=i):(o||mt&&e.is(":last-child"))&&(t=i),dt=t,t}function ue(n,t,o){if("undefined"!=typeof n){var i,a,r=ne(n),s={element:n,callback:t,ismovementup:o,dtop:r,ymovement:ln(n),anchorlink:n.data("anchor"),sectionindex:n.index(y),activeslide:n.find(d),activesection:e(b),leavingsection:e(b).index(y)+1,localisresizing:mt};s.activesection.is(n)&&!mt||l.scrollbar&&ne.scrolltop()===s.dtop&&!n.hasclass(i)||(s.activeslide.length&&(i=s.activeslide.data("anchor"),a=s.activeslide.index()),l.autoscrolling&&l.continuousvertical&&"undefined"!=typeof s.ismovementup&&(!s.ismovementup&&"up"==s.ymovement||s.ismovementup&&"down"==s.ymovement)&&(s=qe(s)),(!e.isfunction(l.onleave)||s.localisresizing||l.onleave.call(s.activesection,s.leavingsection,s.sectionindex+1,s.ymovement)!==!1)&&(en(s.activesection),l.scrolloverflowhandler.beforeleave(),n.addclass(p).siblings().removeclass(p),ze(n),l.scrolloverflowhandler.onleave(),st=!1,qn(a,i,s.anchorlink,s.sectionindex),xe(s),ct=s.anchorlink,in(s.anchorlink,s.sectionindex)))}}function xe(n){if(l.css3&&l.autoscrolling&&!l.scrollbar){var t="translate3d(0px, -"+o.round(n.dtop)+"px, 0px)";hn(t,!0),l.scrollingspeed?(cleartimeout(ct),ct=settimeout(function(){je(n)},l.scrollingspeed)):je(n)}else{var i=ke(n);e(i.element).animate(i.options,l.scrollingspeed,l.easing).promise().done(function(){l.scrollbar?settimeout(function(){je(n)},30):je(n)})}}function ke(e){var n={};return l.autoscrolling&&!l.scrollbar?(n.options={top:-e.dtop},n.element=r):(n.options={scrolltop:e.dtop},n.element="html, body"),n}function qe(n){return n.ismovementup?e(b).before(n.activesection.nextall(y)):e(b).after(n.activesection.prevall(y).get().reverse()),$n(e(b).position().top),je(),n.wraparoundelements=n.activesection,n.dtop=n.element.position().top,n.ymovement=ln(n.element),n}function ge(n){n.wraparoundelements&&n.wraparoundelements.length&&(n.ismovementup?e(x).before(n.wraparoundelements):e(c).after(n.wraparoundelements),$n(e(b).position().top),je())}function je(n){ge(n),e.isfunction(l.afterload)&&!n.localisresizing&&l.afterload.call(n.element,n.anchorlink,n.sectionindex+1),l.scrolloverflowhandler.afterload(),n.localisresizing||$e(n.element),n.element.addclass(g).siblings().removeclass(g),st=!0,e.isfunction(n.callback)&&n.callback.call(this)}function ze(n){if(l.lazyloading){var t,o=nn(n);o.find("img[data-src], source[data-src], audio[data-src], iframe[data-src]").each(function(){t=e(this),t.attr("src",t.data("src")),t.removeattr("data-src"),t.is("source")&&t.closest("video").get(0).load()})}}function $e(n){var t=nn(n);t.find("video, audio").each(function(){var n=e(this).get(0);n.hasattribute("data-autoplay")&&"function"==typeof n.play&&n.play()}),t.find('iframe[src*="youtube.com/embed/"]').each(function(){var n=e(this).get(0);n.hasattribute("data-autoplay")&&_e(n),n.onload=function(){n.hasattribute("data-autoplay")&&_e(n)}})}function _e(e){e.contentwindow.postmessage('{"event":"command","func":"playvideo","args":""}',"*")}function en(n){var t=nn(n);t.find("video, audio").each(function(){var n=e(this).get(0);n.hasattribute("data-keepplaying")||"function"!=typeof n.pause||n.pause()}),t.find('iframe[src*="youtube.com/embed/"]').each(function(){var n=e(this).get(0);/youtube\.com\/embed\//.test(e(this).attr("src"))&&!n.hasattribute("data-keepplaying")&&e(this).get(0).contentwindow.postmessage('{"event":"command","func":"pausevideo","args":""}',"*")})}function nn(n){var t=n.find(d);return t.length&&(n=e(t)),n}function tn(){var e=n.location.hash.replace("#","").split("/"),t=decodeuricomponent(e[0]),o=decodeuricomponent(e[1]);t&&(l.animateanchor?zn(t,o):de(t,o))}function on(){if(!at&&!l.lockanchors){var e=n.location.hash.replace("#","").split("/"),t=decodeuricomponent(e[0]),o=decodeuricomponent(e[1]),i="undefined"==typeof ct,a="undefined"==typeof ct&&"undefined"==typeof o&&!ut;t.length&&(t&&t!==ct&&!i||a||!ut&&dt!=o)&&zn(t,o)}}function an(n){cleartimeout(lt);var t=e(":focus");if(!t.is("textarea")&&!t.is("input")&&!t.is("select")&&"true"!==t.attr("contenteditable")&&""!==t.attr("contenteditable")&&l.keyboardscrolling&&l.autoscrolling){var o=n.which,i=[40,38,32,33,34];e.inarray(o,i)>-1&&n.preventdefault(),ft=n.ctrlkey,lt=settimeout(function(){pn(n)},150)}}function rn(){e(this).prev().trigger("click")}function ln(e){wt&&(ft=e.ctrlkey)}function sn(e){2==e.which&&(pt=e.pagey,vt.on("mousemove",vn))}function cn(e){2==e.which&&vt.off("mousemove")}function dn(){var n=e(this).closest(y);e(this).hasclass(k)?bt.m.left&&he(n):bt.m.right&&ue(n)}function fn(){wt=!1,ft=!1}function un(n){n.preventdefault();var t=e(this).parent().index();ue(e(y).eq(t))}function hn(n){n.preventdefault();var t=e(this).closest(y).find(q),o=t.find(z).eq(e(this).closest("li").index());gn(t,o)}function pn(n){var t=n.shiftkey;switch(n.which){case 38:case 33:bt.k.up&&se();break;case 32:if(t&&bt.k.up){se();break}case 40:case 34:bt.k.down&&ce();break;case 36:bt.k.up&&fe(1);break;case 35:bt.k.down&&fe(e(y).length);break;case 37:bt.k.left&&he();break;case 39:bt.k.right&&ue();break;default:return}}function vn(e){st&&(e.pageypt&&bt.m.down&&ce()),pt=e.pagey}function gn(n,t,o){var i=n.closest(y),a={slides:n,destiny:t,direction:o,destinypos:t.position(),slideindex:t.index(),section:i,sectionindex:i.index(y),anchorlink:i.data("anchor"),slidesnav:i.find(j),slideanchor:vn(t),prevslide:i.find(d),prevslideindex:i.find(d).index(),localisresizing:mt};return a.xmovement=en(a.prevslideindex,a.slideindex),a.localisresizing||(st=!1),l.onslideleave&&!a.localisresizing&&"none"!==a.xmovement&&e.isfunction(l.onslideleave)&&l.onslideleave.call(a.prevslide,a.anchorlink,a.sectionindex+1,a.prevslideindex,a.xmovement,a.slideindex)===!1?void(ut=!1):(t.addclass(p).siblings().removeclass(p),a.localisresizing||(en(a.prevslide),ze(t)),!l.loophorizontal&&l.controlarrows&&(i.find(j).toggle(0!==a.slideindex),i.find(ee).toggle(!t.is(":last-child"))),i.hasclass(p)&&qn(a.slideindex,a.slideanchor,a.anchorlink,a.sectionindex),void wn(n,a,!0))}function mn(n){sn(n.slidesnav,n.slideindex),n.localisresizing||(e.isfunction(l.afterslideload)&&l.afterslideload.call(n.destiny,n.anchorlink,n.sectionindex+1,n.slideanchor,n.slideindex),st=!0,$e(n.destiny)),ut=!1}function wn(e,n,t){var i=n.destinypos;if(l.css3){var a="translate3d(-"+o.round(i.left)+"px, 0px, 0px)";xn(e.find(v)).css(_n(a)),tt=settimeout(function(){t&&mn(n)},l.scrollingspeed,l.easing)}else e.animate({scrollleft:o.round(i.left)},l.scrollingspeed,l.easing,function(){t&&mn(n)})}function sn(e,n){e.find(v).removeclass(p),e.find("li").eq(n).find("a").addclass(p)}function yn(){if(bn(),ht){var n=e(t.activeelement);if(!n.is("textarea")&&!n.is("input")&&!n.is("select")){var i=ne.height();o.abs(i-qt)>20*o.max(qt,i)/100&&(pe(!0),qt=i)}}else cleartimeout(xt),xt=settimeout(function(){pe(!0)},350)}function bn(){var e=l.responsive||l.responsivewidth,n=l.responsiveheight,t=e&&ne.outerwidth()o?"up":"down"}function en(e,n){return e==n?"none":e>n?"left":"right"}function an(e){if(!e.hasclass("fp-noscroll")){e.css("overflow","hidden");var n,t=l.scrolloverflowhandler,o=t.wrapcontent(),i=e.closest(y),a=t.scrollable(e);a.length?n=t.scrollheight(e):(n=e.get(0).scrollheight,l.verticalcentered&&(n=e.find(k).get(0).scrollheight));var r=gt-parseint(i.css("padding-bottom"))-parseint(i.css("padding-top"));n>r?a.length?t.update(e,r):(l.verticalcentered?e.find(k).wrapinner(o):e.wrapinner(o),t.create(e,r)):t.remove(e),e.css("overflow","")}}function mn(e){e.hasclass(w)||e.addclass(w).wrapinner('
      ')}function on(e){var n=gt;if(l.paddingtop||l.paddingbottom){var t=e;t.hasclass(s)||(t=e.closest(y));var o=parseint(t.css("padding-top"))+parseint(t.css("padding-bottom"));n=gt-o}return n}function hn(e,n){n?xn(vt):cn(vt),vt.css(_n(e)),settimeout(function(){vt.removeclass(d)},10)}function bn(n){var t=vt.find(y+'[data-anchor="'+n+'"]');return t.length||(t=e(y).eq(n-1)),t}function rn(e,n){var t=n.find(q),o=t.find(z+'[data-anchor="'+e+'"]');return o.length||(o=t.find(z).eq(e)),o}function zn(e,n){var t=bn(e);t.length&&("undefined"==typeof n&&(n=0),e===ct||t.hasclass(p)?dn(t,n):ue(t,function(){dn(t,n)}))}function dn(e,n){if("undefined"!=typeof n){var t=e.find(q),o=rn(n,e);o.length&&gn(t,o)}}function pn(e,n){e.append('
        ');var t=e.find(j);t.addclass(l.slidesnavposition);for(var o=0;n>o;o++)t.find("ul").append('
      • ');t.css("margin-left","-"+t.width()/2+"px"),t.find("li").first().find("a").addclass(p)}function qn(e,n,t,o){var i="";l.anchors.length&&!l.lockanchors&&(e?("undefined"!=typeof t&&(i=t),"undefined"==typeof n&&(n=e),dt=n,fn(i+"/"+n)):"undefined"!=typeof e?(dt=n,fn(t)):fn(t)),wn()}function fn(e){if(l.recordhistory)location.hash=e;else if(ht||pt)n.history.replacestate(i,i,"#"+e);else{var t=n.location.href.split("#")[0];n.location.replace(t+"#"+e)}}function vn(e){var n=e.data("anchor"),t=e.index();return"undefined"==typeof n&&(n=t),n}function wn(){var n=e(b),t=n.find(d),o=vn(n),i=vn(t),a=string(o);t.length&&(a=a+"-"+i),a=a.replace("/","-").replace("#","");var r=new regexp("\\b\\s?"+h+"-[^\\s]+\\b","g");lt[0].classname=lt[0].classname.replace(r,""),lt.addclass(h+"-"+a)}function yn(){var e,o=t.createelement("p"),a={webkittransform:"-webkit-transform",otransform:"-o-transform",mstransform:"-ms-transform",moztransform:"-moz-transform",transform:"transform"};t.body.insertbefore(o,null);for(var r in a)o.style[r]!==i&&(o.style[r]="translate3d(1px,1px,1px)",e=n.getcomputedstyle(o).getpropertyvalue(a[r]));return t.body.removechild(o),e!==i&&e.length>0&&"none"!==e}function jn(){t.addeventlistener?(t.removeeventlistener("mousewheel",we,!1),t.removeeventlistener("wheel",we,!1),t.removeeventlistener("mozmousepixelscroll",we,!1)):t.detachevent("onmousewheel",we)}function nn(){var e,o="";n.addeventlistener?e="addeventlistener":(e="attachevent",o="on");var a="onwheel"in t.createelement("div")?"wheel":t.onmousewheel!==i?"mousewheel":"dommousescroll";"dommousescroll"==a?t[e](o+"mozmousepixelscroll",we,!1):t[e](o+a,we,!1)}function un(){vt.on("mousedown",sn).on("mouseup",cn)}function xn(){vt.off("mousedown",sn).off("mouseup",cn)}function kn(){if(l.autoscrolling&&(ht||pt)){var n=gn();lt.off("touchmove "+n.move).on("touchmove "+n.move,ze),e(r).off("touchstart "+n.down).on("touchstart "+n.down,fe).off("touchmove "+n.move).on("touchmove "+n.move,de)}}function qn(){if(ht||pt){var n=gn();e(r).off("touchstart "+n.down).off("touchmove "+n.move)}}function gn(){var e;return e=n.pointerevent?{down:"pointerdown",move:"pointermove"}:{down:"mspointerdown",move:"mspointermove"}}function jn(e){var n=[];return n.y="undefined"!=typeof e.pagey&&(e.pagey||e.pagex)?e.pagey:e.touches[0].pagey,n.x="undefined"!=typeof e.pagex&&(e.pagey||e.pagex)?e.pagex:e.touches[0].pagex,pt&&qe(e)&&l.scrollbar&&(n.y=e.touches[0].pagey,n.x=e.touches[0].pagex),n}function zn(e,n){q(0,"internal"),"undefined"!=typeof n&&(mt=!0),gn(e.closest(q),e),"undefined"!=typeof n&&(mt=!1),q(et.scrollingspeed,"internal")}function $n(e){var n=o.round(e);if(l.scrollbar||!l.autoscrolling)vt.scrolltop(n);else if(l.css3){var t="translate3d(0px, -"+n+"px, 0px)";hn(t,!1)}else vt.css("top",-n)}function _n(e){return{"-webkit-transform":e,"-moz-transform":e,"-ms-transform":e,transform:e}}function et(e,n,t){switch(n){case"up":bt[t].up=e;break;case"down":bt[t].down=e;break;case"left":bt[t].left=e;break;case"right":bt[t].right=e;break;case"all":"m"==t?re(e):le(e)}}function nt(n){s(!1,"internal"),re(!1),le(!1),vt.addclass(f),cleartimeout(tt),cleartimeout(ct),cleartimeout(xt),cleartimeout(kt),cleartimeout(it),ne.off("scroll",oe).off("hashchange",on).off("resize",yn),te.off("click touchstart",a+" a").off("mouseenter",a+" li").off("mouseleave",a+" li").off("click touchstart",n).off("mouseover",l.normalscrollelements).off("mouseout",l.normalscrollelements),e(y).off("click touchstart",x),cleartimeout(tt),cleartimeout(ct),n&&tt()}function tt(){$n(0),vt.find("img[data-src], source[data-src], audio[data-src], iframe[data-src]").each(function(){e(this).attr("src",e(this).data("src")),e(this).removeattr("data-src")}),e(a+", "+j+", "+x).remove(),e(y).css({height:"","background-color":"",padding:""}),e(z).css({width:""}),vt.css({height:"",position:"","-ms-touch-action":"","touch-action":""}),rt.css({overflow:"",height:""}),e("html").removeclass(u),lt.removeclass(c),e.each(lt.get(0).classname.split(/\s+/),function(e,n){0===n.indexof(h)&<.removeclass(n)}),e(y+", "+z).each(function(){l.scrolloverflowhandler.remove(e(this)),e(this).removeclass(w+" "+p)}),cn(vt),vt.find(k+", "+v+", "+q).each(function(){e(this).replacewith(this.childnodes)}),rt.scrolltop(0);var n=[s,r,f];e.each(n,function(n,t){e("."+t).removeclass(t)})}function ot(e,n,t){l[e]=n,"internal"!==t&&(et[e]=n)}function it(){var n=["fadingeffect","continuoushorizontal","scrollhorizontally","interlockedslides","resetsliders","responsiveslides","offsetsections","dragandmove"];return e("html").hasclass(u)?void at("error","fullpage.js can only be initialized once and you are doing it multiple times!"):(l.continuousvertical&&(l.looptop||l.loopbottom)&&(l.continuousvertical=!1,at("warn","option `looptop/loopbottom` is mutually exclusive with `continuousvertical`; `continuousvertical` disabled")),l.scrollbar&&l.scrolloverflow&&at("warn","option `scrollbar` is mutually exclusive with `scrolloverflow`. sections with scrolloverflow might not work well in firefox"),!l.continuousvertical||!l.scrollbar&&l.autoscrolling||(l.continuousvertical=!1,at("warn","scroll bars (`scrollbar:true` or `autoscrolling:false`) are mutually exclusive with `continuousvertical`; `continuousvertical` disabled")),e.each(n,function(e,n){l[n]&&at("warn","fullpage.js extensions require jquery.fullpage.extensions.min.js file instead of the usual jquery.fullpage.js. requested: "+n)}),void e.each(l.anchors,function(n,t){var o=te.find("[name]").filter(function(){return e(this).attr("name")&&e(this).attr("name").tolowercase()==t.tolowercase()}),i=te.find("[id]").filter(function(){return e(this).attr("id")&&e(this).attr("id").tolowercase()==t.tolowercase()});(i.length||o.length)&&(at("error","data-anchor tags can not have the same value as any `id` element on the site (or `name` element for ie)."),i.length&&at("error",'"'+t+'" is is being used by another element `id` property'),o.length&&at("error",'"'+t+'" is is being used by another element `name` property'))}))}function at(e,n){console&&console[e]&&console[e]("fullpage: "+n)}if(e("html").hasclass(u))return void it();var rt=e("html, body"),lt=e("body"),st=e.fn.fullpage;l=e.extend({menu:!1,anchors:[],lockanchors:!1,navigation:!1,navigationposition:"right",navigationtooltips:[],showactivetooltip:!1,slidesnavigation:!1,slidesnavposition:"bottom",scrollbar:!1,hybrid:!1,css3:!0,scrollingspeed:700,autoscrolling:!0,fittosection:!0,fittosectiondelay:1e3,easing:"easeinoutcubic",easingcss3:"ease",loopbottom:!1,looptop:!1,loophorizontal:!0,continuousvertical:!1,continuoushorizontal:!1,scrollhorizontally:!1,interlockedslides:!1,dragandmove:!1,offsetsections:!1,resetsliders:!1,fadingeffect:!1,normalscrollelements:null,scrolloverflow:!1,scrolloverflowhandler:ie,scrolloverflowoptions:null,touchsensitivity:5,normalscrollelementtouchthreshold:5,bigsectionsdestination:null,keyboardscrolling:!0,animateanchor:!0,recordhistory:!0,controlarrows:!0,controlarrowcolor:"#fff",verticalcentered:!0,sectionscolor:[],paddingtop:0,paddingbottom:0,fixedelements:null,responsive:0,responsivewidth:0,responsiveheight:0,responsiveslides:!1,sectionselector:w,slideselector:b,afterload:null,onleave:null,afterrender:null,afterresize:null,afterrebuild:null,afterslideload:null,onslideleave:null,afterresponsive:null,lazyloading:!0},l);var ct,dt,ft,ut=!1,ht=navigator.useragent.match(/(iphone|ipod|ipad|android|playbook|silk|blackberry|bb10|windows phone|tizen|bada|webos|iemobile|opera mini)/),pt="ontouchstart"in n||navigator.msmaxtouchpoints>0||navigator.maxtouchpoints,vt=e(this),gt=ne.height(),mt=!1,wt=!0,st=!0,yt=[],bt={};bt.m={up:!0,down:!0,left:!0,right:!0},bt.k=e.extend(!0,{},bt.m);var xt,ct,tt,kt,it,lt,et=e.extend(!0,{},l);it(),oe.click=pt,oe=e.extend(oe,l.scrolloverflowoptions),e.extend(e.easing,{easeinoutcubic:function(e,n,t,o,i){return(n/=i/2)<1?o/2*n*n*n+t:o/2*((n-=2)*n*n+2)+t}}),e(this).length&&(st.setautoscrolling=s,st.setrecordhistory=u,st.setscrollingspeed=q,st.setfittosection=z,st.setlockanchors=$,st.setmousewheelscrolling=ae,st.setallowscrolling=re,st.setkeyboardscrolling=le,st.movesectionup=se,st.movesectiondown=ce,st.silentmoveto=de,st.moveto=fe,st.moveslideright=ue,st.moveslideleft=he,st.rebuild=pe,st.setresponsive=ve,st.destroy=nt,ge(),me());var at=!1,mt=0,ot=0,ht=0,bt=0,rt=0,zt=(new date).gettime(),dt=0,pt=0,qt=gt},"undefined"!=typeof iscroll&&(iscroll.prototype.wheelon=function(){this.wrapper.addeventlistener("wheel",this),this.wrapper.addeventlistener("mousewheel",this),this.wrapper.addeventlistener("dommousescroll",this)},iscroll.prototype.wheeloff=function(){this.wrapper.removeeventlistener("wheel",this),this.wrapper.removeeventlistener("mousewheel",this),this.wrapper.removeeventlistener("dommousescroll",this)});var ie={refreshid:null,iscrollinstances:[],togglewheel:function(n){var t=e(b).find(s);t.each(function(){var t=e(this).data("iscrollinstance");"undefined"!=typeof t&&t&&(n?t.wheelon():t.wheeloff())})},onleave:function(){ie.togglewheel(!1)},beforeleave:function(){ie.onleave()},afterload:function(){ie.togglewheel(!0)},create:function(n,t){var o=n.find(s);o.height(t),o.each(function(){var n=e(this),t=n.data("iscrollinstance");t&&e.each(ie.iscrollinstances,function(){e(this).destroy()}),t=new iscroll(n.get(0),oe),ie.iscrollinstances.push(t),t.wheeloff(),n.data("iscrollinstance",t)})},isscrolled:function(e,n){var t=n.data("iscrollinstance");return t?"top"===e?t.y>=0&&!n.scrolltop():"bottom"===e?0-t.y+n.scrolltop()+1+n.innerheight()>=n[0].scrollheight:void 0:!0},scrollable:function(e){return e.find(q).length?e.find(d).find(s):e.find(s)},scrollheight:function(e){return e.find(s).children().first().get(0).scrollheight},remove:function(e){var n=e.find(s);if(n.length){var t=n.data("iscrollinstance");t.destroy(),n.data("iscrollinstance",null)}e.find(s).children().first().children().first().unwrap().unwrap()},update:function(n,t){cleartimeout(ie.refreshid),ie.refreshid=settimeout(function(){e.each(ie.iscrollinstances,function(){e(this).get(0).refresh()})},150),n.find(s).css("height",t+"px").parent().css("height",t+"px")},wrapcontent:function(){return'
        '}}}); //# sourcemappingurl=jquery.fullpage.min.js.map /*! * imagesloaded packaged v4.1.1 * javascript is all like "you images are done yet or what?" * mit license */ !function(t,e){"function"==typeof define&&define.amd?define("ev-emitter/ev-emitter",e):"object"==typeof module&&module.exports?module.exports=e():t.evemitter=e()}("undefined"!=typeof window?window:this,function(){function t(){}var e=t.prototype;return e.on=function(t,e){if(t&&e){var i=this._events=this._events||{},n=i[t]=i[t]||[];return-1==n.indexof(e)&&n.push(e),this}},e.once=function(t,e){if(t&&e){this.on(t,e);var i=this._onceevents=this._onceevents||{},n=i[t]=i[t]||{};return n[e]=!0,this}},e.off=function(t,e){var i=this._events&&this._events[t];if(i&&i.length){var n=i.indexof(e);return-1!=n&&i.splice(n,1),this}},e.emitevent=function(t,e){var i=this._events&&this._events[t];if(i&&i.length){var n=0,o=i[n];e=e||[];for(var r=this._onceevents&&this._onceevents[t];o;){var s=r&&r[o];s&&(this.off(t,o),delete r[o]),o.apply(this,e),n+=s?0:1,o=i[n]}return this}},t}),function(t,e){"use strict";"function"==typeof define&&define.amd?define(["ev-emitter/ev-emitter"],function(i){return e(t,i)}):"object"==typeof module&&module.exports?module.exports=e(t,require("ev-emitter")):t.imagesloaded=e(t,t.evemitter)}(window,function(t,e){function i(t,e){for(var i in e)t[i]=e[i];return t}function n(t){var e=[];if(array.isarray(t))e=t;else if("number"==typeof t.length)for(var i=0;i 0; }, isscrollable = function(el) { return (el && !(el.style.overflow && el.style.overflow === 'hidden') && ((el.clientwidth && el.scrollwidth > el.clientwidth) || (el.clientheight && el.scrollheight > el.clientheight))); }, getscalar = function(orig, dim) { var value = parseint(orig, 10) || 0; if (dim && ispercentage(orig)) { value = f.getviewport()[ dim ] / 100 * value; } return math.ceil(value); }, getvalue = function(value, dim) { return getscalar(value, dim) + 'px'; }; $.extend(f, { // the current version of fancybox version: '2.1.5', defaults: { padding : 15, margin : 20, width : 800, height : 600, minwidth : 100, minheight : 100, maxwidth : 9999, maxheight : 9999, pixelratio: 1, // set to 2 for retina display support autosize : true, autoheight : false, autowidth : false, autoresize : true, autocenter : !istouch, fittoview : true, aspectratio : false, topratio : 0.5, leftratio : 0.5, scrolling : 'auto', // 'auto', 'yes' or 'no' wrapcss : '', arrows : true, closebtn : true, closeclick : false, nextclick : false, mousewheel : true, autoplay : false, playspeed : 3000, preload : 3, modal : false, loop : true, ajax : { datatype : 'html', headers : { 'x-fancybox': true } }, iframe : { scrolling : 'auto', preload : true }, swf : { wmode: 'transparent', allowfullscreen : 'true', allowscriptaccess : 'always' }, keys : { next : { 13 : 'left', // enter 34 : 'up', // page down 39 : 'left', // right arrow 40 : 'up' // down arrow }, prev : { 8 : 'right', // backspace 33 : 'down', // page up 37 : 'right', // left arrow 38 : 'down' // up arrow }, close : [27], // escape key play : [32], // space - start/stop slideshow toggle : [70] // letter "f" - toggle fullscreen }, direction : { next : 'left', prev : 'right' }, scrolloutside : true, // override some properties index : 0, type : null, href : null, content : null, title : null, // html templates tpl: { wrap : '
        ', image : '', iframe : '', error : '

        запрашиваемый контент не может быть загружен.
        пожалуйста, повторите попытку позже.

        ', closebtn : '', next : '', prev : '' }, // properties for each animation type // opening fancybox openeffect : 'fade', // 'elastic', 'fade' or 'none' openspeed : 250, openeasing : 'swing', openopacity : true, openmethod : 'zoomin', // closing fancybox closeeffect : 'fade', // 'elastic', 'fade' or 'none' closespeed : 250, closeeasing : 'swing', closeopacity : true, closemethod : 'zoomout', // changing next gallery item nexteffect : 'elastic', // 'elastic', 'fade' or 'none' nextspeed : 250, nexteasing : 'swing', nextmethod : 'changein', // changing previous gallery item preveffect : 'elastic', // 'elastic', 'fade' or 'none' prevspeed : 250, preveasing : 'swing', prevmethod : 'changeout', // enable default helpers helpers : { overlay : true, title : true }, // callbacks oncancel : $.noop, // if canceling beforeload : $.noop, // before loading afterload : $.noop, // after loading beforeshow : $.noop, // before changing in current item aftershow : $.noop, // after opening beforechange : $.noop, // before changing gallery item beforeclose : $.noop, // before closing afterclose : $.noop // after closing }, //current state group : {}, // selected group opts : {}, // group options previous : null, // previous element coming : null, // element being loaded current : null, // currently loaded element isactive : false, // is activated isopen : false, // is currently open isopened : false, // have been fully opened at least once wrap : null, skin : null, outer : null, inner : null, player : { timer : null, isactive : false }, // loaders ajaxload : null, imgpreload : null, // some collections transitions : {}, helpers : {}, /* * static methods */ open: function (group, opts) { if (!group) { return; } if (!$.isplainobject(opts)) { opts = {}; } // close if already active if (false === f.close(true)) { return; } // normalize group if (!$.isarray(group)) { group = isquery(group) ? $(group).get() : [group]; } // recheck if the type of each element is `object` and set content type (image, ajax, etc) $.each(group, function(i, element) { var obj = {}, href, title, content, type, rez, hrefparts, selector; if ($.type(element) === "object") { // check if is dom element if (element.nodetype) { element = $(element); } if (isquery(element)) { obj = { href : element.data('fancybox-href') || element.attr('href'), title : element.data('fancybox-title') || element.attr('title'), isdom : true, element : element }; if ($.metadata) { $.extend(true, obj, element.metadata()); } } else { obj = element; } } href = opts.href || obj.href || (isstring(element) ? element : null); title = opts.title !== undefined ? opts.title : obj.title || ''; content = opts.content || obj.content; type = content ? 'html' : (opts.type || obj.type); if (!type && obj.isdom) { type = element.data('fancybox-type'); if (!type) { rez = element.prop('class').match(/fancybox\.(\w+)/); type = rez ? rez[1] : null; } } if (isstring(href)) { // try to guess the content type if (!type) { if (f.isimage(href)) { type = 'image'; } else if (f.isswf(href)) { type = 'swf'; } else if (href.charat(0) === '#') { type = 'inline'; } else if (isstring(element)) { type = 'html'; content = element; } } // split url into two pieces with source url and content selector, e.g, // "/mypage.html #my_id" will load "/mypage.html" and display element having id "my_id" if (type === 'ajax') { hrefparts = href.split(/\s+/, 2); href = hrefparts.shift(); selector = hrefparts.shift(); } } if (!content) { if (type === 'inline') { if (href) { content = $( isstring(href) ? href.replace(/.*(?=#[^\s]+$)/, '') : href ); //strip for ie7 } else if (obj.isdom) { content = element; } } else if (type === 'html') { content = href; } else if (!type && !href && obj.isdom) { type = 'inline'; content = element; } } $.extend(obj, { href : href, type : type, content : content, title : title, selector : selector }); group[ i ] = obj; }); // extend the defaults f.opts = $.extend(true, {}, f.defaults, opts); // all options are merged recursive except keys if (opts.keys !== undefined) { f.opts.keys = opts.keys ? $.extend({}, f.defaults.keys, opts.keys) : false; } f.group = group; return f._start(f.opts.index); }, // cancel image loading or abort ajax request cancel: function () { var coming = f.coming; if (!coming || false === f.trigger('oncancel')) { return; } f.hideloading(); if (f.ajaxload) { f.ajaxload.abort(); } f.ajaxload = null; if (f.imgpreload) { f.imgpreload.onload = f.imgpreload.onerror = null; } if (coming.wrap) { coming.wrap.stop(true, true).trigger('onreset').remove(); } f.coming = null; // if the first item has been canceled, then clear everything if (!f.current) { f._afterzoomout( coming ); } }, // start closing animation if is open; remove immediately if opening/closing close: function (event) { f.cancel(); if (false === f.trigger('beforeclose')) { return; } f.unbindevents(); if (!f.isactive) { return; } if (!f.isopen || event === true) { $('.fancybox-wrap').stop(true).trigger('onreset').remove(); f._afterzoomout(); } else { f.isopen = f.isopened = false; f.isclosing = true; $('.fancybox-item, .fancybox-nav').remove(); f.wrap.stop(true, true).removeclass('fancybox-opened'); f.transitions[ f.current.closemethod ](); } }, // manage slideshow: // $.fancybox.play(); - toggle slideshow // $.fancybox.play( true ); - start // $.fancybox.play( false ); - stop play: function ( action ) { var clear = function () { cleartimeout(f.player.timer); }, set = function () { clear(); if (f.current && f.player.isactive) { f.player.timer = settimeout(f.next, f.current.playspeed); } }, stop = function () { clear(); d.unbind('.player'); f.player.isactive = false; f.trigger('onplayend'); }, start = function () { if (f.current && (f.current.loop || f.current.index < f.group.length - 1)) { f.player.isactive = true; d.bind({ 'oncancel.player beforeclose.player' : stop, 'onupdate.player' : set, 'beforeload.player' : clear }); set(); f.trigger('onplaystart'); } }; if (action === true || (!f.player.isactive && action !== false)) { start(); } else { stop(); } }, // navigate to next gallery item next: function ( direction ) { var current = f.current; if (current) { if (!isstring(direction)) { direction = current.direction.next; } f.jumpto(current.index + 1, direction, 'next'); } }, // navigate to previous gallery item prev: function ( direction ) { var current = f.current; if (current) { if (!isstring(direction)) { direction = current.direction.prev; } f.jumpto(current.index - 1, direction, 'prev'); } }, // navigate to gallery item by index jumpto: function ( index, direction, router ) { var current = f.current; if (!current) { return; } index = getscalar(index); f.direction = direction || current.direction[ (index >= current.index ? 'next' : 'prev') ]; f.router = router || 'jumpto'; if (current.loop) { if (index < 0) { index = current.group.length + (index % current.group.length); } index = index % current.group.length; } if (current.group[ index ] !== undefined) { f.cancel(); f._start(index); } }, // center inside viewport and toggle position type to fixed or absolute if needed reposition: function (e, onlyabsolute) { var current = f.current, wrap = current ? current.wrap : null, pos; if (wrap) { pos = f._getposition(onlyabsolute); if (e && e.type === 'scroll') { delete pos.position; wrap.stop(true, true).animate(pos, 200); } else { wrap.css(pos); current.pos = $.extend({}, current.dim, pos); } } }, update: function (e) { var type = (e && e.type), anyway = !type || type === 'orientationchange'; if (anyway) { cleartimeout(didupdate); didupdate = null; } if (!f.isopen || didupdate) { return; } didupdate = settimeout(function() { var current = f.current; if (!current || f.isclosing) { return; } f.wrap.removeclass('fancybox-tmp'); if (anyway || type === 'load' || (type === 'resize' && current.autoresize)) { f._setdimension(); } if (!(type === 'scroll' && current.canshrink)) { f.reposition(e); } f.trigger('onupdate'); didupdate = null; }, (anyway && !istouch ? 0 : 300)); }, // shrink content to fit inside viewport or restore if resized toggle: function ( action ) { if (f.isopen) { f.current.fittoview = $.type(action) === "boolean" ? action : !f.current.fittoview; // help browser to restore document dimensions if (istouch) { f.wrap.removeattr('style').addclass('fancybox-tmp'); f.trigger('onupdate'); } f.update(); } }, hideloading: function () { d.unbind('.loading'); $('#fancybox-loading').remove(); }, showloading: function () { var el, viewport; f.hideloading(); el = $('
        ').click(f.cancel).appendto('body'); // if user will press the escape-button, the request will be canceled d.bind('keydown.loading', function(e) { if ((e.which || e.keycode) === 27) { e.preventdefault(); f.cancel(); } }); if (!f.defaults.fixed) { viewport = f.getviewport(); el.css({ position : 'absolute', top : (viewport.h * 0.5) + viewport.y, left : (viewport.w * 0.5) + viewport.x }); } }, getviewport: function () { var locked = (f.current && f.current.locked) || false, rez = { x: w.scrollleft(), y: w.scrolltop() }; if (locked) { rez.w = locked[0].clientwidth; rez.h = locked[0].clientheight; } else { // see http://bugs.jquery.com/ticket/6724 rez.w = istouch && window.innerwidth ? window.innerwidth : w.width(); rez.h = istouch && window.innerheight ? window.innerheight : w.height(); } return rez; }, // unbind the keyboard / clicking actions unbindevents: function () { if (f.wrap && isquery(f.wrap)) { f.wrap.unbind('.fb'); } d.unbind('.fb'); w.unbind('.fb'); }, bindevents: function () { var current = f.current, keys; if (!current) { return; } // changing document height on ios devices triggers a 'resize' event, // that can change document height... repeating infinitely w.bind('orientationchange.fb' + (istouch ? '' : ' resize.fb') + (current.autocenter && !current.locked ? ' scroll.fb' : ''), f.update); keys = current.keys; if (keys) { d.bind('keydown.fb', function (e) { var code = e.which || e.keycode, target = e.target || e.srcelement; // skip esc key if loading, because showloading will cancel preloading if (code === 27 && f.coming) { return false; } // ignore key combinations and key events within form elements if (!e.ctrlkey && !e.altkey && !e.shiftkey && !e.metakey && !(target && (target.type || $(target).is('[contenteditable]')))) { $.each(keys, function(i, val) { if (current.group.length > 1 && val[ code ] !== undefined) { f[ i ]( val[ code ] ); e.preventdefault(); return false; } if ($.inarray(code, val) > -1) { f[ i ] (); e.preventdefault(); return false; } }); } }); } if ($.fn.mousewheel && current.mousewheel) { f.wrap.bind('mousewheel.fb', function (e, delta, deltax, deltay) { var target = e.target || null, parent = $(target), canscroll = false; while (parent.length) { if (canscroll || parent.is('.fancybox-skin') || parent.is('.fancybox-wrap')) { break; } canscroll = isscrollable( parent[0] ); parent = $(parent).parent(); } if (delta !== 0 && !canscroll) { if (f.group.length > 1 && !current.canshrink) { if (deltay > 0 || deltax > 0) { f.prev( deltay > 0 ? 'down' : 'left' ); } else if (deltay < 0 || deltax < 0) { f.next( deltay < 0 ? 'up' : 'right' ); } e.preventdefault(); } } }); } }, trigger: function (event, o) { var ret, obj = o || f.coming || f.current; if (!obj) { return; } if ($.isfunction( obj[event] )) { ret = obj[event].apply(obj, array.prototype.slice.call(arguments, 1)); } if (ret === false) { return false; } if (obj.helpers) { $.each(obj.helpers, function (helper, opts) { if (opts && f.helpers[helper] && $.isfunction(f.helpers[helper][event])) { f.helpers[helper][event]($.extend(true, {}, f.helpers[helper].defaults, opts), obj); } }); } d.trigger(event); }, isimage: function (str) { return isstring(str) && str.match(/(^data:image\/.*,)|(\.(jp(e|g|eg)|gif|png|bmp|webp|svg)((\?|#).*)?$)/i); }, isswf: function (str) { return isstring(str) && str.match(/\.(swf)((\?|#).*)?$/i); }, _start: function (index) { var coming = {}, obj, href, type, margin, padding; index = getscalar( index ); obj = f.group[ index ] || null; if (!obj) { return false; } coming = $.extend(true, {}, f.opts, obj); // convert margin and padding properties to array - top, right, bottom, left margin = coming.margin; padding = coming.padding; if ($.type(margin) === 'number') { coming.margin = [margin, margin, margin, margin]; } if ($.type(padding) === 'number') { coming.padding = [padding, padding, padding, padding]; } // 'modal' propery is just a shortcut if (coming.modal) { $.extend(true, coming, { closebtn : false, closeclick : false, nextclick : false, arrows : false, mousewheel : false, keys : null, helpers: { overlay : { closeclick : false } } }); } // 'autosize' property is a shortcut, too if (coming.autosize) { coming.autowidth = coming.autoheight = true; } if (coming.width === 'auto') { coming.autowidth = true; } if (coming.height === 'auto') { coming.autoheight = true; } /* * add reference to the group, so it`s possible to access from callbacks, example: * afterload : function() { * this.title = 'image ' + (this.index + 1) + ' of ' + this.group.length + (this.title ? ' - ' + this.title : ''); * } */ coming.group = f.group; coming.index = index; // give a chance for callback or helpers to update coming item (type, title, etc) f.coming = coming; if (false === f.trigger('beforeload')) { f.coming = null; return; } type = coming.type; href = coming.href; if (!type) { f.coming = null; //if we can not determine content type then drop silently or display next/prev item if looping through gallery if (f.current && f.router && f.router !== 'jumpto') { f.current.index = index; return f[ f.router ]( f.direction ); } return false; } f.isactive = true; if (type === 'image' || type === 'swf') { coming.autoheight = coming.autowidth = false; coming.scrolling = 'visible'; } if (type === 'image') { coming.aspectratio = true; } if (type === 'iframe' && istouch) { coming.scrolling = 'scroll'; } // build the neccessary markup coming.wrap = $(coming.tpl.wrap).addclass('fancybox-' + (istouch ? 'mobile' : 'desktop') + ' fancybox-type-' + type + ' fancybox-tmp ' + coming.wrapcss).appendto( coming.parent || 'body' ); $.extend(coming, { skin : $('.fancybox-skin', coming.wrap), outer : $('.fancybox-outer', coming.wrap), inner : $('.fancybox-inner', coming.wrap) }); $.each(["top", "right", "bottom", "left"], function(i, v) { coming.skin.css('padding' + v, getvalue(coming.padding[ i ])); }); f.trigger('onready'); // check before try to load; 'inline' and 'html' types need content, others - href if (type === 'inline' || type === 'html') { if (!coming.content || !coming.content.length) { return f._error( 'content' ); } } else if (!href) { return f._error( 'href' ); } if (type === 'image') { f._loadimage(); } else if (type === 'ajax') { f._loadajax(); } else if (type === 'iframe') { f._loadiframe(); } else { f._afterload(); } }, _error: function ( type ) { $.extend(f.coming, { type : 'html', autowidth : true, autoheight : true, minwidth : 0, minheight : 0, scrolling : 'no', haserror : type, content : f.coming.tpl.error }); f._afterload(); }, _loadimage: function () { // reset preload image so it is later possible to check "complete" property var img = f.imgpreload = new image(); img.onload = function () { this.onload = this.onerror = null; f.coming.width = this.width / f.opts.pixelratio; f.coming.height = this.height / f.opts.pixelratio; f._afterload(); }; img.onerror = function () { this.onload = this.onerror = null; f._error( 'image' ); }; img.src = f.coming.href; if (img.complete !== true) { f.showloading(); } }, _loadajax: function () { var coming = f.coming; f.showloading(); f.ajaxload = $.ajax($.extend({}, coming.ajax, { url: coming.href, error: function (jqxhr, textstatus) { if (f.coming && textstatus !== 'abort') { f._error( 'ajax', jqxhr ); } else { f.hideloading(); } }, success: function (data, textstatus) { if (textstatus === 'success') { coming.content = data; f._afterload(); } } })); }, _loadiframe: function() { var coming = f.coming, iframe = $(coming.tpl.iframe.replace(/\{rnd\}/g, new date().gettime())) .attr('scrolling', istouch ? 'auto' : coming.iframe.scrolling) .attr('src', coming.href); // this helps ie $(coming.wrap).bind('onreset', function () { try { $(this).find('iframe').hide().attr('src', '//about:blank').end().empty(); } catch (e) {} }); if (coming.iframe.preload) { f.showloading(); iframe.one('load', function() { $(this).data('ready', 1); // ios will lose scrolling if we resize if (!istouch) { $(this).bind('load.fb', f.update); } // without this trick: // - iframe won't scroll on ios devices // - ie7 sometimes displays empty iframe $(this).parents('.fancybox-wrap').width('100%').removeclass('fancybox-tmp').show(); f._afterload(); }); } coming.content = iframe.appendto( coming.inner ); if (!coming.iframe.preload) { f._afterload(); } }, _preloadimages: function() { var group = f.group, current = f.current, len = group.length, cnt = current.preload ? math.min(current.preload, len - 1) : 0, item, i; for (i = 1; i <= cnt; i += 1) { item = group[ (current.index + i ) % len ]; if (item.type === 'image' && item.href) { new image().src = item.href; } } }, _afterload: function () { var coming = f.coming, previous = f.current, placeholder = 'fancybox-placeholder', current, content, type, scrolling, href, embed; f.hideloading(); if (!coming || f.isactive === false) { return; } if (false === f.trigger('afterload', coming, previous)) { coming.wrap.stop(true).trigger('onreset').remove(); f.coming = null; return; } if (previous) { f.trigger('beforechange', previous); previous.wrap.stop(true).removeclass('fancybox-opened') .find('.fancybox-item, .fancybox-nav') .remove(); } f.unbindevents(); current = coming; content = coming.content; type = coming.type; scrolling = coming.scrolling; $.extend(f, { wrap : current.wrap, skin : current.skin, outer : current.outer, inner : current.inner, current : current, previous : previous }); href = current.href; switch (type) { case 'inline': case 'ajax': case 'html': if (current.selector) { content = $('
        ').html(content).find(current.selector); } else if (isquery(content)) { if (!content.data(placeholder)) { content.data(placeholder, $('
        ').insertafter( content ).hide() ); } content = content.show().detach(); current.wrap.bind('onreset', function () { if ($(this).find(content).length) { content.hide().replaceall( content.data(placeholder) ).data(placeholder, false); } }); } break; case 'image': content = current.tpl.image.replace('{href}', href); break; case 'swf': content = ''; embed = ''; $.each(current.swf, function(name, val) { content += ''; embed += ' ' + name + '="' + val + '"'; }); content += ''; break; } if (!(isquery(content) && content.parent().is(current.inner))) { current.inner.append( content ); } // give a chance for helpers or callbacks to update elements f.trigger('beforeshow'); // set scrolling before calculating dimensions current.inner.css('overflow', scrolling === 'yes' ? 'scroll' : (scrolling === 'no' ? 'hidden' : scrolling)); // set initial dimensions and start position f._setdimension(); f.reposition(); f.isopen = false; f.coming = null; f.bindevents(); if (!f.isopened) { $('.fancybox-wrap').not( current.wrap ).stop(true).trigger('onreset').remove(); } else if (previous.prevmethod) { f.transitions[ previous.prevmethod ](); } f.transitions[ f.isopened ? current.nextmethod : current.openmethod ](); f._preloadimages(); }, _setdimension: function () { var viewport = f.getviewport(), steps = 0, canshrink = false, canexpand = false, wrap = f.wrap, skin = f.skin, inner = f.inner, current = f.current, width = current.width, height = current.height, minwidth = current.minwidth, minheight = current.minheight, maxwidth = current.maxwidth, maxheight = current.maxheight, scrolling = current.scrolling, scrollout = current.scrolloutside ? current.scrollbarwidth : 0, margin = current.margin, wmargin = getscalar(margin[1] + margin[3]), hmargin = getscalar(margin[0] + margin[2]), wpadding, hpadding, wspace, hspace, origwidth, origheight, origmaxwidth, origmaxheight, ratio, width_, height_, maxwidth_, maxheight_, iframe, body; // reset dimensions so we could re-check actual size wrap.add(skin).add(inner).width('auto').height('auto').removeclass('fancybox-tmp'); wpadding = getscalar(skin.outerwidth(true) - skin.width()); hpadding = getscalar(skin.outerheight(true) - skin.height()); // any space between content and viewport (margin, padding, border, title) wspace = wmargin + wpadding; hspace = hmargin + hpadding; origwidth = ispercentage(width) ? (viewport.w - wspace) * getscalar(width) / 100 : width; origheight = ispercentage(height) ? (viewport.h - hspace) * getscalar(height) / 100 : height; if (current.type === 'iframe') { iframe = current.content; if (current.autoheight && iframe.data('ready') === 1) { try { if (iframe[0].contentwindow.document.location) { inner.width( origwidth ).height(9999); body = iframe.contents().find('body'); if (scrollout) { body.css('overflow-x', 'hidden'); } origheight = body.outerheight(true); } } catch (e) {} } } else if (current.autowidth || current.autoheight) { inner.addclass( 'fancybox-tmp' ); // set width or height in case we need to calculate only one dimension if (!current.autowidth) { inner.width( origwidth ); } if (!current.autoheight) { inner.height( origheight ); } if (current.autowidth) { origwidth = inner.width(); } if (current.autoheight) { origheight = inner.height(); } inner.removeclass( 'fancybox-tmp' ); } width = getscalar( origwidth ); height = getscalar( origheight ); ratio = origwidth / origheight; // calculations for the content minwidth = getscalar(ispercentage(minwidth) ? getscalar(minwidth, 'w') - wspace : minwidth); maxwidth = getscalar(ispercentage(maxwidth) ? getscalar(maxwidth, 'w') - wspace : maxwidth); minheight = getscalar(ispercentage(minheight) ? getscalar(minheight, 'h') - hspace : minheight); maxheight = getscalar(ispercentage(maxheight) ? getscalar(maxheight, 'h') - hspace : maxheight); // these will be used to determine if wrap can fit in the viewport origmaxwidth = maxwidth; origmaxheight = maxheight; if (current.fittoview) { maxwidth = math.min(viewport.w - wspace, maxwidth); maxheight = math.min(viewport.h - hspace, maxheight); } maxwidth_ = viewport.w - wmargin; maxheight_ = viewport.h - hmargin; if (current.aspectratio) { if (width > maxwidth) { width = maxwidth; height = getscalar(width / ratio); } if (height > maxheight) { height = maxheight; width = getscalar(height * ratio); } if (width < minwidth) { width = minwidth; height = getscalar(width / ratio); } if (height < minheight) { height = minheight; width = getscalar(height * ratio); } } else { width = math.max(minwidth, math.min(width, maxwidth)); if (current.autoheight && current.type !== 'iframe') { inner.width( width ); height = inner.height(); } height = math.max(minheight, math.min(height, maxheight)); } // try to fit inside viewport (including the title) if (current.fittoview) { inner.width( width ).height( height ); wrap.width( width + wpadding ); // real wrap dimensions width_ = wrap.width(); height_ = wrap.height(); if (current.aspectratio) { while ((width_ > maxwidth_ || height_ > maxheight_) && width > minwidth && height > minheight) { if (steps++ > 19) { break; } height = math.max(minheight, math.min(maxheight, height - 10)); width = getscalar(height * ratio); if (width < minwidth) { width = minwidth; height = getscalar(width / ratio); } if (width > maxwidth) { width = maxwidth; height = getscalar(width / ratio); } inner.width( width ).height( height ); wrap.width( width + wpadding ); width_ = wrap.width(); height_ = wrap.height(); } } else { width = math.max(minwidth, math.min(width, width - (width_ - maxwidth_))); height = math.max(minheight, math.min(height, height - (height_ - maxheight_))); } } if (scrollout && scrolling === 'auto' && height < origheight && (width + wpadding + scrollout) < maxwidth_) { width += scrollout; } inner.width( width ).height( height ); wrap.width( width + wpadding ); width_ = wrap.width(); height_ = wrap.height(); canshrink = (width_ > maxwidth_ || height_ > maxheight_) && width > minwidth && height > minheight; canexpand = current.aspectratio ? (width < origmaxwidth && height < origmaxheight && width < origwidth && height < origheight) : ((width < origmaxwidth || height < origmaxheight) && (width < origwidth || height < origheight)); $.extend(current, { dim : { width : getvalue( width_ ), height : getvalue( height_ ) }, origwidth : origwidth, origheight : origheight, canshrink : canshrink, canexpand : canexpand, wpadding : wpadding, hpadding : hpadding, wrapspace : height_ - skin.outerheight(true), skinspace : skin.height() - height }); if (!iframe && current.autoheight && height > minheight && height < maxheight && !canexpand) { inner.height('auto'); } }, _getposition: function (onlyabsolute) { var current = f.current, viewport = f.getviewport(), margin = current.margin, width = f.wrap.width() + margin[1] + margin[3], height = f.wrap.height() + margin[0] + margin[2], rez = { position: 'absolute', top : margin[0], left : margin[3] }; if (current.autocenter && current.fixed && !onlyabsolute && height <= viewport.h && width <= viewport.w) { rez.position = 'fixed'; } else if (!current.locked) { rez.top += viewport.y; rez.left += viewport.x; } rez.top = getvalue(math.max(rez.top, rez.top + ((viewport.h - height) * current.topratio))); rez.left = getvalue(math.max(rez.left, rez.left + ((viewport.w - width) * current.leftratio))); return rez; }, _afterzoomin: function () { var current = f.current; if (!current) { return; } f.isopen = f.isopened = true; f.wrap.css('overflow', 'visible').addclass('fancybox-opened'); f.update(); // assign a click event if ( current.closeclick || (current.nextclick && f.group.length > 1) ) { f.inner.css('cursor', 'pointer').bind('click.fb', function(e) { if (!$(e.target).is('a') && !$(e.target).parent().is('a')) { e.preventdefault(); f[ current.closeclick ? 'close' : 'next' ](); } }); } // create a close button if (current.closebtn) { $(current.tpl.closebtn).appendto(f.skin).bind('click.fb', function(e) { e.preventdefault(); f.close(); }); } // create navigation arrows if (current.arrows && f.group.length > 1) { if (current.loop || current.index > 0) { $(current.tpl.prev).appendto(f.outer).bind('click.fb', f.prev); } if (current.loop || current.index < f.group.length - 1) { $(current.tpl.next).appendto(f.outer).bind('click.fb', f.next); } } f.trigger('aftershow'); // stop the slideshow if this is the last item if (!current.loop && current.index === current.group.length - 1) { f.play( false ); } else if (f.opts.autoplay && !f.player.isactive) { f.opts.autoplay = false; f.play(); } }, _afterzoomout: function ( obj ) { obj = obj || f.current; $('.fancybox-wrap').trigger('onreset').remove(); $.extend(f, { group : {}, opts : {}, router : false, current : null, isactive : false, isopened : false, isopen : false, isclosing : false, wrap : null, skin : null, outer : null, inner : null }); f.trigger('afterclose', obj); } }); /* * default transitions */ f.transitions = { getorigposition: function () { var current = f.current, element = current.element, orig = current.orig, pos = {}, width = 50, height = 50, hpadding = current.hpadding, wpadding = current.wpadding, viewport = f.getviewport(); if (!orig && current.isdom && element.is(':visible')) { orig = element.find('img:first'); if (!orig.length) { orig = element; } } if (isquery(orig)) { pos = orig.offset(); if (orig.is('img')) { width = orig.outerwidth(); height = orig.outerheight(); } } else { pos.top = viewport.y + (viewport.h - height) * current.topratio; pos.left = viewport.x + (viewport.w - width) * current.leftratio; } if (f.wrap.css('position') === 'fixed' || current.locked) { pos.top -= viewport.y; pos.left -= viewport.x; } pos = { top : getvalue(pos.top - hpadding * current.topratio), left : getvalue(pos.left - wpadding * current.leftratio), width : getvalue(width + wpadding), height : getvalue(height + hpadding) }; return pos; }, step: function (now, fx) { var ratio, padding, value, prop = fx.prop, current = f.current, wrapspace = current.wrapspace, skinspace = current.skinspace; if (prop === 'width' || prop === 'height') { ratio = fx.end === fx.start ? 1 : (now - fx.start) / (fx.end - fx.start); if (f.isclosing) { ratio = 1 - ratio; } padding = prop === 'width' ? current.wpadding : current.hpadding; value = now - padding; f.skin[ prop ]( getscalar( prop === 'width' ? value : value - (wrapspace * ratio) ) ); f.inner[ prop ]( getscalar( prop === 'width' ? value : value - (wrapspace * ratio) - (skinspace * ratio) ) ); } }, zoomin: function () { var current = f.current, startpos = current.pos, effect = current.openeffect, elastic = effect === 'elastic', endpos = $.extend({opacity : 1}, startpos); // remove "position" property that breaks older ie delete endpos.position; if (elastic) { startpos = this.getorigposition(); if (current.openopacity) { startpos.opacity = 0.1; } } else if (effect === 'fade') { startpos.opacity = 0.1; } f.wrap.css(startpos).animate(endpos, { duration : effect === 'none' ? 0 : current.openspeed, easing : current.openeasing, step : elastic ? this.step : null, complete : f._afterzoomin }); }, zoomout: function () { var current = f.current, effect = current.closeeffect, elastic = effect === 'elastic', endpos = {opacity : 0.1}; if (elastic) { endpos = this.getorigposition(); if (current.closeopacity) { endpos.opacity = 0.1; } } f.wrap.animate(endpos, { duration : effect === 'none' ? 0 : current.closespeed, easing : current.closeeasing, step : elastic ? this.step : null, complete : f._afterzoomout }); }, changein: function () { var current = f.current, effect = current.nexteffect, startpos = current.pos, endpos = { opacity : 1 }, direction = f.direction, distance = 200, field; startpos.opacity = 0.1; if (effect === 'elastic') { field = direction === 'down' || direction === 'up' ? 'top' : 'left'; if (direction === 'down' || direction === 'right') { startpos[ field ] = getvalue(getscalar(startpos[ field ]) - distance); endpos[ field ] = '+=' + distance + 'px'; } else { startpos[ field ] = getvalue(getscalar(startpos[ field ]) + distance); endpos[ field ] = '-=' + distance + 'px'; } } // workaround for http://bugs.jquery.com/ticket/12273 if (effect === 'none') { f._afterzoomin(); } else { f.wrap.css(startpos).animate(endpos, { duration : current.nextspeed, easing : current.nexteasing, complete : f._afterzoomin }); } }, changeout: function () { var previous = f.previous, effect = previous.preveffect, endpos = { opacity : 0.1 }, direction = f.direction, distance = 200; if (effect === 'elastic') { endpos[ direction === 'down' || direction === 'up' ? 'top' : 'left' ] = ( direction === 'up' || direction === 'left' ? '-' : '+' ) + '=' + distance + 'px'; } previous.wrap.animate(endpos, { duration : effect === 'none' ? 0 : previous.prevspeed, easing : previous.preveasing, complete : function () { $(this).trigger('onreset').remove(); } }); } }; /* * overlay helper */ f.helpers.overlay = { defaults : { closeclick : true, // if true, fancybox will be closed when user clicks on the overlay speedout : 200, // duration of fadeout animation showearly : true, // indicates if should be opened immediately or wait until the content is ready css : {}, // custom css properties locked : !istouch, // if true, the content will be locked into overlay fixed : true // if false, the overlay css position property will not be set to "fixed" }, overlay : null, // current handle fixed : false, // indicates if the overlay has position "fixed" el : $('html'), // element that contains "the lock" // public methods create : function(opts) { opts = $.extend({}, this.defaults, opts); if (this.overlay) { this.close(); } this.overlay = $('
        ').appendto( f.coming ? f.coming.parent : opts.parent ); this.fixed = false; if (opts.fixed && f.defaults.fixed) { this.overlay.addclass('fancybox-overlay-fixed'); this.fixed = true; } }, open : function(opts) { var that = this; opts = $.extend({}, this.defaults, opts); if (this.overlay) { this.overlay.unbind('.overlay').width('auto').height('auto'); } else { this.create(opts); } if (!this.fixed) { w.bind('resize.overlay', $.proxy( this.update, this) ); this.update(); } if (opts.closeclick) { this.overlay.bind('click.overlay', function(e) { if ($(e.target).hasclass('fancybox-overlay')) { if (f.isactive) { f.close(); } else { that.close(); } return false; } }); } this.overlay.css( opts.css ).show(); }, close : function() { var scrollv, scrollh; w.unbind('resize.overlay'); if (this.el.hasclass('fancybox-lock')) { $('.fancybox-margin').removeclass('fancybox-margin'); scrollv = w.scrolltop(); scrollh = w.scrollleft(); this.el.removeclass('fancybox-lock'); w.scrolltop( scrollv ).scrollleft( scrollh ); } $('.fancybox-overlay').remove().hide(); $.extend(this, { overlay : null, fixed : false }); }, // private, callbacks update : function () { var width = '100%', offsetwidth; // reset width/height so it will not mess this.overlay.width(width).height('100%'); // jquery does not return reliable result for ie if (ie) { offsetwidth = math.max(document.documentelement.offsetwidth, document.body.offsetwidth); if (d.width() > offsetwidth) { width = d.width(); } } else if (d.width() > w.width()) { width = d.width(); } this.overlay.width(width).height(d.height()); }, // this is where we can manipulate dom, because later it would cause iframes to reload onready : function (opts, obj) { var overlay = this.overlay; $('.fancybox-overlay').stop(true, true); if (!overlay) { this.create(opts); } if (opts.locked && this.fixed && obj.fixed) { if (!overlay) { this.margin = d.height() > w.height() ? $('html').css('margin-right').replace("px", "") : false; } obj.locked = this.overlay.append( obj.wrap ); obj.fixed = false; } if (opts.showearly === true) { this.beforeshow.apply(this, arguments); } }, beforeshow : function(opts, obj) { var scrollv, scrollh; if (obj.locked) { if (this.margin !== false) { $('*').filter(function(){ return ($(this).css('position') === 'fixed' && !$(this).hasclass("fancybox-overlay") && !$(this).hasclass("fancybox-wrap") ); }).addclass('fancybox-margin'); this.el.addclass('fancybox-margin'); } scrollv = w.scrolltop(); scrollh = w.scrollleft(); this.el.addclass('fancybox-lock'); w.scrolltop( scrollv ).scrollleft( scrollh ); } this.open(opts); }, onupdate : function() { if (!this.fixed) { this.update(); } }, afterclose: function (opts) { // remove overlay if exists and fancybox is not opening // (e.g., it is not being open using afterclose callback) //if (this.overlay && !f.isactive) { if (this.overlay && !f.coming) { this.overlay.fadeout(opts.speedout, $.proxy( this.close, this )); } } }; /* * title helper */ f.helpers.title = { defaults : { type : 'float', // 'float', 'inside', 'outside' or 'over', position : 'bottom' // 'top' or 'bottom' }, beforeshow: function (opts) { var current = f.current, text = current.title, type = opts.type, title, target; if ($.isfunction(text)) { text = text.call(current.element, current); } if (!isstring(text) || $.trim(text) === '') { return; } title = $('
        ' + text + '
        '); switch (type) { case 'inside': target = f.skin; break; case 'outside': target = f.wrap; break; case 'over': target = f.inner; break; default: // 'float' target = f.skin; title.appendto('body'); if (ie) { title.width( title.width() ); } title.wrapinner(''); //increase bottom margin so this title will also fit into viewport f.current.margin[2] += math.abs( getscalar(title.css('margin-bottom')) ); break; } title[ (opts.position === 'top' ? 'prependto' : 'appendto') ](target); } }; // jquery plugin initialization $.fn.fancybox = function (options) { var index, that = $(this), selector = this.selector || '', run = function(e) { var what = $(this).blur(), idx = index, reltype, relval; if (!(e.ctrlkey || e.altkey || e.shiftkey || e.metakey) && !what.is('.fancybox-wrap')) { reltype = options.groupattr || 'data-fancybox-group'; relval = what.attr(reltype); if (!relval) { reltype = 'rel'; relval = what.get(0)[ reltype ]; } if (relval && relval !== '' && relval !== 'nofollow') { what = selector.length ? $(selector) : that; what = what.filter('[' + reltype + '="' + relval + '"]'); idx = what.index(this); } options.index = idx; // stop an event from bubbling if everything is fine if (f.open(what, options) !== false) { e.preventdefault(); } } }; options = options || {}; index = options.index || 0; if (!selector || options.live === false) { that.unbind('click.fb-start').bind('click.fb-start', run); } else { d.undelegate(selector, 'click.fb-start').delegate(selector + ":not('.fancybox-item, .fancybox-nav')", 'click.fb-start', run); } this.filter('[data-fancybox-start=1]').trigger('click'); return this; }; // tests that need a body at doc ready d.ready(function() { var w1, w2; if ( $.scrollbarwidth === undefined ) { // http://benalman.com/projects/jquery-misc-plugins/#scrollbarwidth $.scrollbarwidth = function() { var parent = $('
        ').appendto('body'), child = parent.children(), width = child.innerwidth() - child.height( 99 ).innerwidth(); parent.remove(); return width; }; } if ( $.support.fixedposition === undefined ) { $.support.fixedposition = (function() { var elem = $('
        ').appendto('body'), fixed = ( elem[0].offsettop === 20 || elem[0].offsettop === 15 ); elem.remove(); return fixed; }()); } $.extend(f.defaults, { scrollbarwidth : $.scrollbarwidth(), fixed : $.support.fixedposition, parent : $('body') }); //get real width of page scroll-bar w1 = $(window).width(); h.addclass('fancybox-lock-test'); w2 = $(window).width(); h.removeclass('fancybox-lock-test'); $("").appendto("head"); }); }(window, document, jquery));