").attr("id",b).addclass("ui-tabs-panel ui-widget-content ui-corner-bottom").data("ui-tabs-destroy",!0)},_setupdisabled:function(b){a.isarray(b)&&(b.length?b.length===this.anchors.length&&(b=!0):b=!1);for(var c,d=0;c=this.tabs[d];d++)b===!0||-1!==a.inarray(d,b)?a(c).addclass("ui-state-disabled").attr("aria-disabled","true"):a(c).removeclass("ui-state-disabled").removeattr("aria-disabled");this.options.disabled=b},_setupevents:function(b){var c={};b&&a.each(b.split(" "),function(a,b){c[b]="_eventhandler"}),this._off(this.anchors.add(this.tabs).add(this.panels)),this._on(!0,this.anchors,{click:function(a){a.preventdefault()}}),this._on(this.anchors,c),this._on(this.tabs,{keydown:"_tabkeydown"}),this._on(this.panels,{keydown:"_panelkeydown"}),this._focusable(this.tabs),this._hoverable(this.tabs)},_setupheightstyle:function(b){var c,d=this.element.parent();"fill"===b?(c=d.height(),c-=this.element.outerheight()-this.element.height(),this.element.siblings(":visible").each(function(){var b=a(this),d=b.css("position");"absolute"!==d&&"fixed"!==d&&(c-=b.outerheight(!0))}),this.element.children().not(this.panels).each(function(){c-=a(this).outerheight(!0)}),this.panels.each(function(){a(this).height(math.max(0,c-a(this).innerheight()+a(this).height()))}).css("overflow","auto")):"auto"===b&&(c=0,this.panels.each(function(){c=math.max(c,a(this).height("").height())}).height(c))},_eventhandler:function(b){var c=this.options,d=this.active,e=a(b.currenttarget),f=e.closest("li"),g=f[0]===d[0],h=g&&c.collapsible,i=h?a():this._getpanelfortab(f),j=d.length?this._getpanelfortab(d):a(),k={oldtab:d,oldpanel:j,newtab:h?a():f,newpanel:i};b.preventdefault(),f.hasclass("ui-state-disabled")||f.hasclass("ui-tabs-loading")||this.running||g&&!c.collapsible||this._trigger("beforeactivate",b,k)===!1||(c.active=h?!1:this.tabs.index(f),this.active=g?a():f,this.xhr&&this.xhr.abort(),j.length||i.length||a.error("jquery ui tabs: mismatching fragment identifier."),i.length&&this.load(this.tabs.index(f),b),this._toggle(b,k))},_toggle:function(b,c){function d(){f.running=!1,f._trigger("activate",b,c)}function e(){c.newtab.closest("li").addclass("ui-tabs-active ui-state-active"),g.length&&f.options.show?f._show(g,f.options.show,d):(g.show(),d())}var f=this,g=c.newpanel,h=c.oldpanel;this.running=!0,h.length&&this.options.hide?this._hide(h,this.options.hide,function(){c.oldtab.closest("li").removeclass("ui-tabs-active ui-state-active"),e()}):(c.oldtab.closest("li").removeclass("ui-tabs-active ui-state-active"),h.hide(),e()),h.attr("aria-hidden","true"),c.oldtab.attr({"aria-selected":"false","aria-expanded":"false"}),g.length&&h.length?c.oldtab.attr("tabindex",-1):g.length&&this.tabs.filter(function(){return 0===a(this).attr("tabindex")}).attr("tabindex",-1),g.attr("aria-hidden","false"),c.newtab.attr({"aria-selected":"true","aria-expanded":"true",tabindex:0})},_activate:function(b){var c,d=this._findactive(b);d[0]!==this.active[0]&&(d.length||(d=this.active),c=d.find(".ui-tabs-anchor")[0],this._eventhandler({target:c,currenttarget:c,preventdefault:a.noop}))},_findactive:function(b){return b===!1?a():this.tabs.eq(b)},_getindex:function(a){return"string"==typeof a&&(a=this.anchors.index(this.anchors.filter("[href$='"+a+"']"))),a},_destroy:function(){this.xhr&&this.xhr.abort(),this.element.removeclass("ui-tabs ui-widget ui-widget-content ui-corner-all ui-tabs-collapsible"),this.tablist.removeclass("ui-tabs-nav ui-helper-reset ui-helper-clearfix ui-widget-header ui-corner-all").removeattr("role"),this.anchors.removeclass("ui-tabs-anchor").removeattr("role").removeattr("tabindex").removeuniqueid(),this.tablist.unbind(this.eventnamespace),this.tabs.add(this.panels).each(function(){a.data(this,"ui-tabs-destroy")?a(this).remove():a(this).removeclass("ui-state-default ui-state-active ui-state-disabled ui-corner-top ui-corner-bottom ui-widget-content ui-tabs-active ui-tabs-panel").removeattr("tabindex").removeattr("aria-live").removeattr("aria-busy").removeattr("aria-selected").removeattr("aria-labelledby").removeattr("aria-hidden").removeattr("aria-expanded").removeattr("role")}),this.tabs.each(function(){var b=a(this),c=b.data("ui-tabs-aria-controls");c?b.attr("aria-controls",c).removedata("ui-tabs-aria-controls"):b.removeattr("aria-controls")}),this.panels.show(),"content"!==this.options.heightstyle&&this.panels.css("height","")},enable:function(b){var c=this.options.disabled;c!==!1&&(void 0===b?c=!1:(b=this._getindex(b),c=a.isarray(c)?a.map(c,function(a){return a!==b?a:null}):a.map(this.tabs,function(a,c){return c!==b?c:null})),this._setupdisabled(c))},disable:function(b){var c=this.options.disabled;if(c!==!0){if(void 0===b)c=!0;else{if(b=this._getindex(b),-1!==a.inarray(b,c))return;c=a.isarray(c)?a.merge([b],c).sort():[b]}this._setupdisabled(c)}},load:function(b,c){b=this._getindex(b);var d=this,e=this.tabs.eq(b),f=e.find(".ui-tabs-anchor"),g=this._getpanelfortab(e),h={tab:e,panel:g},i=function(a,b){"abort"===b&&d.panels.stop(!1,!0),e.removeclass("ui-tabs-loading"),g.removeattr("aria-busy"),a===d.xhr&&delete d.xhr};this._islocal(f[0])||(this.xhr=a.ajax(this._ajaxsettings(f,c,h)),this.xhr&&"canceled"!==this.xhr.statustext&&(e.addclass("ui-tabs-loading"),g.attr("aria-busy","true"),this.xhr.done(function(a,b,e){settimeout(function(){g.html(a),d._trigger("load",c,h),i(e,b)},1)}).fail(function(a,b){settimeout(function(){i(a,b)},1)})))},_ajaxsettings:function(b,c,d){var e=this;return{url:b.attr("href"),beforesend:function(b,f){return e._trigger("beforeload",c,a.extend({jqxhr:b,ajaxsettings:f},d))}}},_getpanelfortab:function(b){var c=a(b).attr("aria-controls");return this.element.find(this._sanitizeselector("#"+c))}})});
;/*!
* jquery ui accordion 1.11.4
* http://jqueryui.com
*
* copyright jquery foundation and other contributors
* released under the mit license.
* http://jquery.org/license
*
* http://api.jqueryui.com/accordion/
*/
!function(a){"function"==typeof define&&define.amd?define(["jquery","./core","./widget"],a):a(jquery)}(function(a){return a.widget("ui.accordion",{version:"1.11.4",options:{active:0,animate:{},collapsible:!1,event:"click",header:"> li > :first-child,> :not(li):even",heightstyle:"auto",icons:{activeheader:"ui-icon-triangle-1-s",header:"ui-icon-triangle-1-e"},activate:null,beforeactivate:null},hideprops:{bordertopwidth:"hide",borderbottomwidth:"hide",paddingtop:"hide",paddingbottom:"hide",height:"hide"},showprops:{bordertopwidth:"show",borderbottomwidth:"show",paddingtop:"show",paddingbottom:"show",height:"show"},_create:function(){var b=this.options;this.prevshow=this.prevhide=a(),this.element.addclass("ui-accordion ui-widget ui-helper-reset").attr("role","tablist"),b.collapsible||b.active!==!1&&null!=b.active||(b.active=0),this._processpanels(),b.active<0&&(b.active+=this.headers.length),this._refresh()},_getcreateeventdata:function(){return{header:this.active,panel:this.active.length?this.active.next():a()}},_createicons:function(){var b=this.options.icons;b&&(a("
").addclass("ui-accordion-header-icon ui-icon "+b.header).prependto(this.headers),this.active.children(".ui-accordion-header-icon").removeclass(b.header).addclass(b.activeheader),this.headers.addclass("ui-accordion-icons"))},_destroyicons:function(){this.headers.removeclass("ui-accordion-icons").children(".ui-accordion-header-icon").remove()},_destroy:function(){var a;this.element.removeclass("ui-accordion ui-widget ui-helper-reset").removeattr("role"),this.headers.removeclass("ui-accordion-header ui-accordion-header-active ui-state-default ui-corner-all ui-state-active ui-state-disabled ui-corner-top").removeattr("role").removeattr("aria-expanded").removeattr("aria-selected").removeattr("aria-controls").removeattr("tabindex").removeuniqueid(),this._destroyicons(),a=this.headers.next().removeclass("ui-helper-reset ui-widget-content ui-corner-bottom ui-accordion-content ui-accordion-content-active ui-state-disabled").css("display","").removeattr("role").removeattr("aria-hidden").removeattr("aria-labelledby").removeuniqueid(),"content"!==this.options.heightstyle&&a.css("height","")},_setoption:function(a,b){return"active"===a?void this._activate(b):("event"===a&&(this.options.event&&this._off(this.headers,this.options.event),this._setupevents(b)),this._super(a,b),"collapsible"!==a||b||this.options.active!==!1||this._activate(0),"icons"===a&&(this._destroyicons(),b&&this._createicons()),void("disabled"===a&&(this.element.toggleclass("ui-state-disabled",!!b).attr("aria-disabled",b),this.headers.add(this.headers.next()).toggleclass("ui-state-disabled",!!b))))},_keydown:function(b){if(!b.altkey&&!b.ctrlkey){var c=a.ui.keycode,d=this.headers.length,e=this.headers.index(b.target),f=!1;switch(b.keycode){case c.right:case c.down:f=this.headers[(e+1)%d];break;case c.left:case c.up:f=this.headers[(e-1+d)%d];break;case c.space:case c.enter:this._eventhandler(b);break;case c.home:f=this.headers[0];break;case c.end:f=this.headers[d-1]}f&&(a(b.target).attr("tabindex",-1),a(f).attr("tabindex",0),f.focus(),b.preventdefault())}},_panelkeydown:function(b){b.keycode===a.ui.keycode.up&&b.ctrlkey&&a(b.currenttarget).prev().focus()},refresh:function(){var b=this.options;this._processpanels(),b.active===!1&&b.collapsible===!0||!this.headers.length?(b.active=!1,this.active=a()):b.active===!1?this._activate(0):this.active.length&&!a.contains(this.element[0],this.active[0])?this.headers.length===this.headers.find(".ui-state-disabled").length?(b.active=!1,this.active=a()):this._activate(math.max(0,b.active-1)):b.active=this.headers.index(this.active),this._destroyicons(),this._refresh()},_processpanels:function(){var a=this.headers,b=this.panels;this.headers=this.element.find(this.options.header).addclass("ui-accordion-header ui-state-default ui-corner-all"),this.panels=this.headers.next().addclass("ui-accordion-content ui-helper-reset ui-widget-content ui-corner-bottom").filter(":not(.ui-accordion-content-active)").hide(),b&&(this._off(a.not(this.headers)),this._off(b.not(this.panels)))},_refresh:function(){var b,c=this.options,d=c.heightstyle,e=this.element.parent();this.active=this._findactive(c.active).addclass("ui-accordion-header-active ui-state-active ui-corner-top").removeclass("ui-corner-all"),this.active.next().addclass("ui-accordion-content-active").show(),this.headers.attr("role","tab").each(function(){var b=a(this),c=b.uniqueid().attr("id"),d=b.next(),e=d.uniqueid().attr("id");b.attr("aria-controls",e),d.attr("aria-labelledby",c)}).next().attr("role","tabpanel"),this.headers.not(this.active).attr({"aria-selected":"false","aria-expanded":"false",tabindex:-1}).next().attr({"aria-hidden":"true"}).hide(),this.active.length?this.active.attr({"aria-selected":"true","aria-expanded":"true",tabindex:0}).next().attr({"aria-hidden":"false"}):this.headers.eq(0).attr("tabindex",0),this._createicons(),this._setupevents(c.event),"fill"===d?(b=e.height(),this.element.siblings(":visible").each(function(){var c=a(this),d=c.css("position");"absolute"!==d&&"fixed"!==d&&(b-=c.outerheight(!0))}),this.headers.each(function(){b-=a(this).outerheight(!0)}),this.headers.next().each(function(){a(this).height(math.max(0,b-a(this).innerheight()+a(this).height()))}).css("overflow","auto")):"auto"===d&&(b=0,this.headers.next().each(function(){b=math.max(b,a(this).css("height","").height())}).height(b))},_activate:function(b){var c=this._findactive(b)[0];c!==this.active[0]&&(c=c||this.active[0],this._eventhandler({target:c,currenttarget:c,preventdefault:a.noop}))},_findactive:function(b){return"number"==typeof b?this.headers.eq(b):a()},_setupevents:function(b){var c={keydown:"_keydown"};b&&a.each(b.split(" "),function(a,b){c[b]="_eventhandler"}),this._off(this.headers.add(this.headers.next())),this._on(this.headers,c),this._on(this.headers.next(),{keydown:"_panelkeydown"}),this._hoverable(this.headers),this._focusable(this.headers)},_eventhandler:function(b){var c=this.options,d=this.active,e=a(b.currenttarget),f=e[0]===d[0],g=f&&c.collapsible,h=g?a():e.next(),i=d.next(),j={oldheader:d,oldpanel:i,newheader:g?a():e,newpanel:h};b.preventdefault(),f&&!c.collapsible||this._trigger("beforeactivate",b,j)===!1||(c.active=g?!1:this.headers.index(e),this.active=f?a():e,this._toggle(j),d.removeclass("ui-accordion-header-active ui-state-active"),c.icons&&d.children(".ui-accordion-header-icon").removeclass(c.icons.activeheader).addclass(c.icons.header),f||(e.removeclass("ui-corner-all").addclass("ui-accordion-header-active ui-state-active ui-corner-top"),c.icons&&e.children(".ui-accordion-header-icon").removeclass(c.icons.header).addclass(c.icons.activeheader),e.next().addclass("ui-accordion-content-active")))},_toggle:function(b){var c=b.newpanel,d=this.prevshow.length?this.prevshow:b.oldpanel;this.prevshow.add(this.prevhide).stop(!0,!0),this.prevshow=c,this.prevhide=d,this.options.animate?this._animate(c,d,b):(d.hide(),c.show(),this._togglecomplete(b)),d.attr({"aria-hidden":"true"}),d.prev().attr({"aria-selected":"false","aria-expanded":"false"}),c.length&&d.length?d.prev().attr({tabindex:-1,"aria-expanded":"false"}):c.length&&this.headers.filter(function(){return 0===parseint(a(this).attr("tabindex"),10)}).attr("tabindex",-1),c.attr("aria-hidden","false").prev().attr({"aria-selected":"true","aria-expanded":"true",tabindex:0})},_animate:function(a,b,c){var d,e,f,g=this,h=0,i=a.css("box-sizing"),j=a.length&&(!b.length||a.index()=960?function(a,n){var n=jquery(n),i=jquery(this).attr("data-anim-type"),t=jquery(this).attr("data-anim-delay");n.visible(!0)&&settimeout(function(){n.addclass(i)},t)}:function(a,n){var n=jquery(n),i=jquery(this).attr("data-anim-type"),t=jquery(this).attr("data-anim-delay");settimeout(function(){n.addclass(i)},t)})}function randomclass(){var a=math.ceil(math.random()*classamount);return classesarray[a]}function animateonce(a,n){"random"==n&&(n=randomclass()),jquery(a).removeclass("trigger infinite "+triggerclasses).addclass("trigger").addclass(n).one("webkitanimationend oanimationend msanimationend animationend",function(){jquery(this).removeclass("trigger infinite "+triggerclasses)})}function animateinfinite(a,n){"random"==n&&(n=randomclass()),jquery(a).removeclass("trigger infinite "+triggerclasses).addclass("trigger infinite").addclass(n).one("webkitanimationend oanimationend msanimationend animationend",function(){jquery(this).removeclass("trigger infinite "+triggerclasses)})}function animateend(a){jquery(a).removeclass("trigger infinite "+triggerclasses)}jquery(document).ready(function(){jquery("html").hasclass("no-js")&&jquery("html").removeclass("no-js").addclass("js"),animateelement()}),jquery(window).resize(function(){animateelement()}),jquery(window).scroll(function(){animateelement(),jquery(window).scrolltop()+jquery(window).height()==jquery(document).height()&&animateelement()});var triggerclasses="flash strobe shakeh shakev bounce tada wave spincw spinccw slingshotcw slingshotccw wobble pulse pulsate heartbeat panic",classesarray=new array,classesarray=triggerclasses.split(" "),classamount=classesarray.length;
;/*
* jplayer plugin for jquery javascript library
* http://www.jplayer.org
*
* copyright (c) 2009 - 2013 happyworm ltd
* licensed under the mit license.
* http://opensource.org/licenses/mit
*
* author: mark j panaghiston
* version: 2.5.0
* date: 7th november 2013
*/
(function(b,f){"function"===typeof define&&define.amd?define(["jquery"],f):b.jquery?f(b.jquery):f(b.zepto)})(this,function(b,f){b.fn.jplayer=function(a){var c="string"===typeof a,d=array.prototype.slice.call(arguments,1),e=this;a=!c&&d.length?b.extend.apply(null,[!0,a].concat(d)):a;if(c&&"_"===a.charat(0))return e;c?this.each(function(){var c=b(this).data("jplayer"),h=c&&b.isfunction(c[a])?c[a].apply(c,d):c;if(h!==c&&h!==f)return e=h,!1}):this.each(function(){var c=b(this).data("jplayer");c?c.option(a||
{}):b(this).data("jplayer",new b.jplayer(a,this))});return e};b.jplayer=function(a,c){if(arguments.length){this.element=b(c);this.options=b.extend(!0,{},this.options,a);var d=this;this.element.bind("remove.jplayer",function(){d.destroy()});this._init()}};"function"!==typeof b.fn.stop&&(b.fn.stop=function(){});b.jplayer.emulatemethods="load play pause";b.jplayer.emulatestatus="src readystate networkstate currenttime duration paused ended playbackrate";b.jplayer.emulateoptions="muted volume";b.jplayer.reservedevent=
"ready flashreset resize repeat error warning";b.jplayer.event={};b.each("ready flashreset resize repeat click error warning loadstart progress suspend abort emptied stalled play pause loadedmetadata loadeddata waiting playing canplay canplaythrough seeking seeked timeupdate ended ratechange durationchange volumechange".split(" "),function(){b.jplayer.event[this]="jplayer_"+this});b.jplayer.htmlevent="loadstart abort emptied stalled loadedmetadata loadeddata canplay canplaythrough".split(" ");b.jplayer.pause=
function(){b.each(b.jplayer.prototype.instances,function(a,c){c.data("jplayer").status.srcset&&c.jplayer("pause")})};b.jplayer.timeformat={showhour:!1,showmin:!0,showsec:!0,padhour:!1,padmin:!0,padsec:!0,sephour:":",sepmin:":",sepsec:""};var m=function(){this.init()};m.prototype={init:function(){this.options={timeformat:b.jplayer.timeformat}},time:function(a){var c=new date(1e3*(a&&"number"===typeof a?a:0)),b=c.getutchours();a=this.options.timeformat.showhour?c.getutcminutes():c.getutcminutes()+60*
b;c=this.options.timeformat.showmin?c.getutcseconds():c.getutcseconds()+60*a;b=this.options.timeformat.padhour&&10>b?"0"+b:b;a=this.options.timeformat.padmin&&10>a?"0"+a:a;c=this.options.timeformat.padsec&&10>c?"0"+c:c;b=""+(this.options.timeformat.showhour?b+this.options.timeformat.sephour:"");b+=this.options.timeformat.showmin?a+this.options.timeformat.sepmin:"";return b+=this.options.timeformat.showsec?c+this.options.timeformat.sepsec:""}};var n=new m;b.jplayer.converttime=function(a){return n.time(a)};
b.jplayer.uabrowser=function(a){a=a.tolowercase();var c=/(opera)(?:.*version)?[ \/]([\w.]+)/,b=/(msie) ([\w.]+)/,e=/(mozilla)(?:.*? rv:([\w.]+))?/;a=/(webkit)[ \/]([\w.]+)/.exec(a)||c.exec(a)||b.exec(a)||0>a.indexof("compatible")&&e.exec(a)||[];return{browser:a[1]||"",version:a[2]||"0"}};b.jplayer.uaplatform=function(a){var c=a.tolowercase(),b=/(android)/,e=/(mobile)/;a=/(ipad|iphone|ipod|android|blackberry|playbook|windows ce|webos)/.exec(c)||[];c=/(ipad|playbook)/.exec(c)||!e.exec(c)&&b.exec(c)||
[];a[1]&&(a[1]=a[1].replace(/\s/g,"_"));return{platform:a[1]||"",tablet:c[1]||""}};b.jplayer.browser={};b.jplayer.platform={};var k=b.jplayer.uabrowser(navigator.useragent);k.browser&&(b.jplayer.browser[k.browser]=!0,b.jplayer.browser.version=k.version);k=b.jplayer.uaplatform(navigator.useragent);k.platform&&(b.jplayer.platform[k.platform]=!0,b.jplayer.platform.mobile=!k.tablet,b.jplayer.platform.tablet=!!k.tablet);b.jplayer.getdocmode=function(){var a;b.jplayer.browser.msie&&(document.documentmode?
a=document.documentmode:(a=5,document.compatmode&&"css1compat"===document.compatmode&&(a=7)));return a};b.jplayer.browser.documentmode=b.jplayer.getdocmode();b.jplayer.nativefeatures={init:function(){var a=document,c=a.createelement("video"),b={w3c:"fullscreenenabled fullscreenelement requestfullscreen exitfullscreen fullscreenchange fullscreenerror".split(" "),moz:"mozfullscreenenabled mozfullscreenelement mozrequestfullscreen mozcancelfullscreen mozfullscreenchange mozfullscreenerror".split(" "),
webkit:" webkitcurrentfullscreenelement webkitrequestfullscreen webkitcancelfullscreen webkitfullscreenchange ".split(" "),webkitvideo:"webkitsupportsfullscreen webkitdisplayingfullscreen webkitenterfullscreen webkitexitfullscreen ".split(" ")},e=["w3c","moz","webkit","webkitvideo"],g,h;this.fullscreen=c={support:{w3c:!!a[b.w3c[0]],moz:!!a[b.moz[0]],webkit:"function"===typeof a[b.webkit[3]],webkitvideo:"function"===typeof c[b.webkitvideo[2]]},used:{}};g=0;for(h=e.length;gnumber(b.jplayer.browser.version)||9>b.jplayer.browser.documentmode)){d=['','','','',''];c=document.createelement('');
for(var e=0;e").join(">").split('"').join(""")},_qualifyurl:function(a){var c=document.createelement("div");c.innerhtml='x';return c.firstchild.href},_absolutemediaurls:function(a){var c=this;b.each(a,function(b,e){c.format[b]&&
(a[b]=c._qualifyurl(e))});return a},setmedia:function(a){var c=this,d=!1,e=this.status.media.poster!==a.poster;this._resetmedia();this._resetgate();this._resetactive();a=this._absolutemediaurls(a);b.each(this.formats,function(e,f){var k="video"===c.format[f].media;b.each(c.solutions,function(b,e){if(c[e].support[f]&&c._validstring(a[f])){var g="html"===e;k?(g?(c.html.video.gate=!0,c._html_setvideo(a),c.html.active=!0):(c.flash.gate=!0,c._flash_setvideo(a),c.flash.active=!0),c.css.jq.videoplay.length&&
c.css.jq.videoplay.show(),c.status.video=!0):(g?(c.html.audio.gate=!0,c._html_setaudio(a),c.html.active=!0):(c.flash.gate=!0,c._flash_setaudio(a),c.flash.active=!0),c.css.jq.videoplay.length&&c.css.jq.videoplay.hide(),c.status.video=!1);d=!0;return!1}});if(d)return!1});d?(this.status.nativevideocontrols&&this.html.video.gate||!this._validstring(a.poster)||(e?this.htmlelement.poster.src=a.poster:this.internal.poster.jq.show()),this.status.srcset=!0,this.status.media=b.extend({},a),this._updatebuttons(!1),
this._updateinterface()):this._error({type:b.jplayer.error.no_support,context:"{supplied:'"+this.options.supplied+"'}",message:b.jplayer.errormsg.no_support,hint:b.jplayer.errorhint.no_support})},_resetmedia:function(){this._resetstatus();this._updatebuttons(!1);this._updateinterface();this._seeked();this.internal.poster.jq.hide();cleartimeout(this.internal.htmldlycmdid);this.html.active?this._html_resetmedia():this.flash.active&&this._flash_resetmedia()},clearmedia:function(){this._resetmedia();
this.html.active?this._html_clearmedia():this.flash.active&&this._flash_clearmedia();this._resetgate();this._resetactive()},load:function(){this.status.srcset?this.html.active?this._html_load():this.flash.active&&this._flash_load():this._urlnotseterror("load")},focus:function(){this.options.keyenabled&&(b.jplayer.focus=this)},play:function(a){a="number"===typeof a?a:nan;this.status.srcset?(this.focus(),this.html.active?this._html_play(a):this.flash.active&&this._flash_play(a)):this._urlnotseterror("play")},
videoplay:function(){this.play()},pause:function(a){a="number"===typeof a?a:nan;this.status.srcset?this.html.active?this._html_pause(a):this.flash.active&&this._flash_pause(a):this._urlnotseterror("pause")},tellothers:function(a,c){var d=this,e="function"===typeof c,g=array.prototype.slice.call(arguments);"string"===typeof a&&(e&&g.splice(1,1),b.each(this.instances,function(){d.element!==this&&(e&&!c.call(this.data("jplayer"),d)||this.jplayer.apply(this,g))}))},pauseothers:function(a){this.tellothers("pause",
function(){return this.status.srcset},a)},stop:function(){this.status.srcset?this.html.active?this._html_pause(0):this.flash.active&&this._flash_pause(0):this._urlnotseterror("stop")},playhead:function(a){a=this._limitvalue(a,0,100);this.status.srcset?this.html.active?this._html_playhead(a):this.flash.active&&this._flash_playhead(a):this._urlnotseterror("playhead")},_muted:function(a){this.mutedworker(a);this.options.globalvolume&&this.tellothers("mutedworker",function(){return this.options.globalvolume},
a)},mutedworker:function(a){this.options.muted=a;this.html.used&&this._html_setproperty("muted",a);this.flash.used&&this._flash_mute(a);this.html.video.gate||this.html.audio.gate||(this._updatemute(a),this._updatevolume(this.options.volume),this._trigger(b.jplayer.event.volumechange))},mute:function(a){a=a===f?!0:!!a;this._muted(a)},unmute:function(a){a=a===f?!0:!!a;this._muted(!a)},_updatemute:function(a){a===f&&(a=this.options.muted);this.css.jq.mute.length&&this.css.jq.unmute.length&&(this.status.novolume?
(this.css.jq.mute.hide(),this.css.jq.unmute.hide()):a?(this.css.jq.mute.hide(),this.css.jq.unmute.show()):(this.css.jq.mute.show(),this.css.jq.unmute.hide()))},volume:function(a){this.volumeworker(a);this.options.globalvolume&&this.tellothers("volumeworker",function(){return this.options.globalvolume},a)},volumeworker:function(a){a=this._limitvalue(a,0,1);this.options.volume=a;this.html.used&&this._html_setproperty("volume",a);this.flash.used&&this._flash_volume(a);this.html.video.gate||this.html.audio.gate||
(this._updatevolume(a),this._trigger(b.jplayer.event.volumechange))},volumebar:function(a){if(this.css.jq.volumebar.length){var c=b(a.currenttarget),d=c.offset(),e=a.pagex-d.left,g=c.width();a=c.height()-a.pagey+d.top;c=c.height();this.options.verticalvolume?this.volume(a/c):this.volume(e/g)}this.options.muted&&this._muted(!1)},volumebarvalue:function(){},_updatevolume:function(a){a===f&&(a=this.options.volume);a=this.options.muted?0:a;this.status.novolume?(this.css.jq.volumebar.length&&this.css.jq.volumebar.hide(),
this.css.jq.volumebarvalue.length&&this.css.jq.volumebarvalue.hide(),this.css.jq.volumemax.length&&this.css.jq.volumemax.hide()):(this.css.jq.volumebar.length&&this.css.jq.volumebar.show(),this.css.jq.volumebarvalue.length&&(this.css.jq.volumebarvalue.show(),this.css.jq.volumebarvalue[this.options.verticalvolume?"height":"width"](100*a+"%")),this.css.jq.volumemax.length&&this.css.jq.volumemax.show())},volumemax:function(){this.volume(1);this.options.muted&&this._muted(!1)},_cssselectorancestor:function(a){var c=
this;this.options.cssselectorancestor=a;this._removeuiclass();this.ancestorjq=a?b(a):[];a&&1!==this.ancestorjq.length&&this._warning({type:b.jplayer.warning.css_selector_count,context:a,message:b.jplayer.warningmsg.css_selector_count+this.ancestorjq.length+" found for cssselectorancestor.",hint:b.jplayer.warninghint.css_selector_count});this._adduiclass();b.each(this.options.cssselector,function(a,b){c._cssselector(a,b)});this._updateinterface();this._updatebuttons();this._updateautohide();this._updatevolume();
this._updatemute()},_cssselector:function(a,c){var d=this;"string"===typeof c?b.jplayer.prototype.options.cssselector[a]?(this.css.jq[a]&&this.css.jq[a].length&&this.css.jq[a].unbind(".jplayer"),this.options.cssselector[a]=c,this.css.cs[a]=this.options.cssselectorancestor+" "+c,this.css.jq[a]=c?b(this.css.cs[a]):[],this.css.jq[a].length&&this.css.jq[a].bind("click.jplayer",function(c){c.preventdefault();d[a](c);b(this).blur()}),c&&1!==this.css.jq[a].length&&this._warning({type:b.jplayer.warning.css_selector_count,
context:this.css.cs[a],message:b.jplayer.warningmsg.css_selector_count+this.css.jq[a].length+" found for "+a+" method.",hint:b.jplayer.warninghint.css_selector_count})):this._warning({type:b.jplayer.warning.css_selector_method,context:a,message:b.jplayer.warningmsg.css_selector_method,hint:b.jplayer.warninghint.css_selector_method}):this._warning({type:b.jplayer.warning.css_selector_string,context:c,message:b.jplayer.warningmsg.css_selector_string,hint:b.jplayer.warninghint.css_selector_string})},
seekbar:function(a){if(this.css.jq.seekbar.length){var c=b(a.currenttarget),d=c.offset();a=a.pagex-d.left;c=c.width();this.playhead(100*a/c)}},playbar:function(){},playbackrate:function(a){this._setoption("playbackrate",a)},playbackratebar:function(a){if(this.css.jq.playbackratebar.length){var c=b(a.currenttarget),d=c.offset(),e=a.pagex-d.left,g=c.width();a=c.height()-a.pagey+d.top;c=c.height();this.playbackrate((this.options.verticalplaybackrate?a/c:e/g)*(this.options.maxplaybackrate-this.options.minplaybackrate)+
this.options.minplaybackrate)}},playbackratebarvalue:function(){},_updateplaybackrate:function(){var a=(this.options.playbackrate-this.options.minplaybackrate)/(this.options.maxplaybackrate-this.options.minplaybackrate);this.status.playbackrateenabled?(this.css.jq.playbackratebar.length&&this.css.jq.playbackratebar.show(),this.css.jq.playbackratebarvalue.length&&(this.css.jq.playbackratebarvalue.show(),this.css.jq.playbackratebarvalue[this.options.verticalplaybackrate?"height":"width"](100*a+"%"))):
(this.css.jq.playbackratebar.length&&this.css.jq.playbackratebar.hide(),this.css.jq.playbackratebarvalue.length&&this.css.jq.playbackratebarvalue.hide())},repeat:function(){this._loop(!0)},repeatoff:function(){this._loop(!1)},_loop:function(a){this.options.loop!==a&&(this.options.loop=a,this._updatebuttons(),this._trigger(b.jplayer.event.repeat))},currenttime:function(){},duration:function(){},gui:function(){},nosolution:function(){},option:function(a,c){var d=a;if(0===arguments.length)return b.extend(!0,
{},this.options);if("string"===typeof a){var e=a.split(".");if(c===f){for(var d=b.extend(!0,{},this.options),g=0;g=
a&&(b=!0);return b},_validstring:function(a){return a&&"string"===typeof a},_limitvalue:function(a,b,d){return ad?d:a},_urlnotseterror:function(a){this._error({type:b.jplayer.error.url_not_set,context:a,message:b.jplayer.errormsg.url_not_set,hint:b.jplayer.errorhint.url_not_set})},_flasherror:function(a){var c;c=this.internal.ready?"flash_disabled":"flash";this._error({type:b.jplayer.error[c],context:this.internal.flash.swf,message:b.jplayer.errormsg[c]+a.message,hint:b.jplayer.errorhint[c]});
this.internal.flash.jq.css({width:"1px",height:"1px"})},_error:function(a){this._trigger(b.jplayer.event.error,a);this.options.erroralerts&&this._alert("error!"+(a.message?"\n"+a.message:"")+(a.hint?"\n"+a.hint:"")+"\ncontext: "+a.context)},_warning:function(a){this._trigger(b.jplayer.event.warning,f,a);this.options.warningalerts&&this._alert("warning!"+(a.message?"\n"+a.message:"")+(a.hint?"\n"+a.hint:"")+"\ncontext: "+a.context)},_alert:function(a){a="jplayer "+this.version.script+" : id='"+this.internal.self.id+
"' : "+a;this.options.consolealerts?console&&console.log&&console.log(a):alert(a)},_emulatehtmlbridge:function(){var a=this;b.each(b.jplayer.emulatemethods.split(/\s+/g),function(b,d){a.internal.domnode[d]=function(b){a[d](b)}});b.each(b.jplayer.event,function(c,d){var e=!0;b.each(b.jplayer.reservedevent.split(/\s+/g),function(a,b){if(b===c)return e=!1});e&&a.element.bind(d+".jplayer.jplayerhtml",function(){a._emulatehtmlupdate();var b=document.createevent("event");b.initevent(c,!1,!0);a.internal.domnode.dispatchevent(b)})})},
_emulatehtmlupdate:function(){var a=this;b.each(b.jplayer.emulatestatus.split(/\s+/g),function(b,d){a.internal.domnode[d]=a.status[d]});b.each(b.jplayer.emulateoptions.split(/\s+/g),function(b,d){a.internal.domnode[d]=a.options[d]})},_destroyhtmlbridge:function(){var a=this;this.element.unbind(".jplayerhtml");b.each((b.jplayer.emulatemethods+" "+b.jplayer.emulatestatus+" "+b.jplayer.emulateoptions).split(/\s+/g),function(b,d){delete a.internal.domnode[d]})}};b.jplayer.error={flash:"e_flash",flash_disabled:"e_flash_disabled",
no_solution:"e_no_solution",no_support:"e_no_support",url:"e_url",url_not_set:"e_url_not_set",version:"e_version"};b.jplayer.errormsg={flash:"jplayer's flash fallback is not configured correctly, or a command was issued before the jplayer ready event. details: ",flash_disabled:"jplayer's flash fallback has been disabled by the browser due to the css rules you have used. details: ",no_solution:"no solution can be found by jplayer in this browser. neither html nor flash can be used.",no_support:"it is not possible to play any media format provided in setmedia() on this browser using your current options.",
url:"media url could not be loaded.",url_not_set:"attempt to issue media playback commands, while no media url is set.",version:"jplayer "+b.jplayer.prototype.version.script+" needs jplayer.swf version "+b.jplayer.prototype.version.needflash+" but found "};b.jplayer.errorhint={flash:"check your swfpath option and that jplayer.swf is there.",flash_disabled:"check that you have not display:none; the jplayer entity or any ancestor.",no_solution:"review the jplayer options: support and supplied.",no_support:"video or audio formats defined in the supplied option are missing.",
url:"check media url is valid.",url_not_set:"use setmedia() to set the media url.",version:"update jplayer files."};b.jplayer.warning={css_selector_count:"e_css_selector_count",css_selector_method:"e_css_selector_method",css_selector_string:"e_css_selector_string",option_key:"e_option_key"};b.jplayer.warningmsg={css_selector_count:"the number of css selectors found did not equal one: ",css_selector_method:"the methodname given in jplayer('cssselector') is not a valid jplayer method.",css_selector_string:"the methodcssselector given in jplayer('cssselector') is not a string or is empty.",
option_key:"the option requested in jplayer('option') is undefined."};b.jplayer.warninghint={css_selector_count:"check your css selector and the ancestor.",css_selector_method:"check your method name.",css_selector_string:"check your css selector is a string.",option_key:"check your option name."}});
;/**
*
* color picker
* author: stefan petre www.eyecon.ro
*
* dual licensed under the mit and gpl licenses
*
*/
(function ($) {
var colorpicker = function () {
var
ids = {},
inaction,
charmin = 65,
visible,
tpl = '',
defaults = {
eventname: 'click',
onshow: function () {},
onbeforeshow: function(){},
onhide: function () {},
onchange: function () {},
onsubmit: function () {},
color: 'ff0000',
livepreview: true,
flat: false
},
fillrgbfields = function (hsb, cal) {
var rgb = hsbtorgb(hsb);
$(cal).data('colorpicker').fields
.eq(1).val(rgb.r).end()
.eq(2).val(rgb.g).end()
.eq(3).val(rgb.b).end();
},
fillhsbfields = function (hsb, cal) {
$(cal).data('colorpicker').fields
.eq(4).val(hsb.h).end()
.eq(5).val(hsb.s).end()
.eq(6).val(hsb.b).end();
},
fillhexfields = function (hsb, cal) {
$(cal).data('colorpicker').fields
.eq(0).val(hsbtohex(hsb)).end();
},
setselector = function (hsb, cal) {
$(cal).data('colorpicker').selector.css('backgroundcolor', '#' + hsbtohex({h: hsb.h, s: 100, b: 100}));
$(cal).data('colorpicker').selectorindic.css({
left: parseint(150 * hsb.s/100, 10),
top: parseint(150 * (100-hsb.b)/100, 10)
});
},
sethue = function (hsb, cal) {
$(cal).data('colorpicker').hue.css('top', parseint(150 - 150 * hsb.h/360, 10));
},
setcurrentcolor = function (hsb, cal) {
$(cal).data('colorpicker').currentcolor.css('backgroundcolor', '#' + hsbtohex(hsb));
},
setnewcolor = function (hsb, cal) {
$(cal).data('colorpicker').newcolor.css('backgroundcolor', '#' + hsbtohex(hsb));
},
keydown = function (ev) {
var pressedkey = ev.charcode || ev.keycode || -1;
if ((pressedkey > charmin && pressedkey <= 90) || pressedkey == 32) {
return false;
}
var cal = $(this).parent().parent();
if (cal.data('colorpicker').livepreview === true) {
change.apply(this);
}
},
change = function (ev) {
var cal = $(this).parent().parent(), col;
if (this.parentnode.classname.indexof('_hex') > 0) {
cal.data('colorpicker').color = col = hextohsb(fixhex(this.value));
} else if (this.parentnode.classname.indexof('_hsb') > 0) {
cal.data('colorpicker').color = col = fixhsb({
h: parseint(cal.data('colorpicker').fields.eq(4).val(), 10),
s: parseint(cal.data('colorpicker').fields.eq(5).val(), 10),
b: parseint(cal.data('colorpicker').fields.eq(6).val(), 10)
});
} else {
cal.data('colorpicker').color = col = rgbtohsb(fixrgb({
r: parseint(cal.data('colorpicker').fields.eq(1).val(), 10),
g: parseint(cal.data('colorpicker').fields.eq(2).val(), 10),
b: parseint(cal.data('colorpicker').fields.eq(3).val(), 10)
}));
}
if (ev) {
fillrgbfields(col, cal.get(0));
fillhexfields(col, cal.get(0));
fillhsbfields(col, cal.get(0));
}
setselector(col, cal.get(0));
sethue(col, cal.get(0));
setnewcolor(col, cal.get(0));
cal.data('colorpicker').onchange.apply(cal, [col, hsbtohex(col), hsbtorgb(col)]);
},
blur = function (ev) {
var cal = $(this).parent().parent();
cal.data('colorpicker').fields.parent().removeclass('colorpicker_focus');
},
focus = function () {
charmin = this.parentnode.classname.indexof('_hex') > 0 ? 70 : 65;
$(this).parent().parent().data('colorpicker').fields.parent().removeclass('colorpicker_focus');
$(this).parent().addclass('colorpicker_focus');
},
downincrement = function (ev) {
var field = $(this).parent().find('input').focus();
var current = {
el: $(this).parent().addclass('colorpicker_slider'),
max: this.parentnode.classname.indexof('_hsb_h') > 0 ? 360 : (this.parentnode.classname.indexof('_hsb') > 0 ? 100 : 255),
y: ev.pagey,
field: field,
val: parseint(field.val(), 10),
preview: $(this).parent().parent().data('colorpicker').livepreview
};
$(document).bind('mouseup', current, upincrement);
$(document).bind('mousemove', current, moveincrement);
},
moveincrement = function (ev) {
ev.data.field.val(math.max(0, math.min(ev.data.max, parseint(ev.data.val + ev.pagey - ev.data.y, 10))));
if (ev.data.preview) {
change.apply(ev.data.field.get(0), [true]);
}
return false;
},
upincrement = function (ev) {
change.apply(ev.data.field.get(0), [true]);
ev.data.el.removeclass('colorpicker_slider').find('input').focus();
$(document).unbind('mouseup', upincrement);
$(document).unbind('mousemove', moveincrement);
return false;
},
downhue = function (ev) {
var current = {
cal: $(this).parent(),
y: $(this).offset().top
};
current.preview = current.cal.data('colorpicker').livepreview;
$(document).bind('mouseup', current, uphue);
$(document).bind('mousemove', current, movehue);
},
movehue = function (ev) {
change.apply(
ev.data.cal.data('colorpicker')
.fields
.eq(4)
.val(parseint(360*(150 - math.max(0,math.min(150,(ev.pagey - ev.data.y))))/150, 10))
.get(0),
[ev.data.preview]
);
return false;
},
uphue = function (ev) {
fillrgbfields(ev.data.cal.data('colorpicker').color, ev.data.cal.get(0));
fillhexfields(ev.data.cal.data('colorpicker').color, ev.data.cal.get(0));
$(document).unbind('mouseup', uphue);
$(document).unbind('mousemove', movehue);
return false;
},
downselector = function (ev) {
var current = {
cal: $(this).parent(),
pos: $(this).offset()
};
current.preview = current.cal.data('colorpicker').livepreview;
$(document).bind('mouseup', current, upselector);
$(document).bind('mousemove', current, moveselector);
},
moveselector = function (ev) {
change.apply(
ev.data.cal.data('colorpicker')
.fields
.eq(6)
.val(parseint(100*(150 - math.max(0,math.min(150,(ev.pagey - ev.data.pos.top))))/150, 10))
.end()
.eq(5)
.val(parseint(100*(math.max(0,math.min(150,(ev.pagex - ev.data.pos.left))))/150, 10))
.get(0),
[ev.data.preview]
);
return false;
},
upselector = function (ev) {
fillrgbfields(ev.data.cal.data('colorpicker').color, ev.data.cal.get(0));
fillhexfields(ev.data.cal.data('colorpicker').color, ev.data.cal.get(0));
$(document).unbind('mouseup', upselector);
$(document).unbind('mousemove', moveselector);
return false;
},
entersubmit = function (ev) {
$(this).addclass('colorpicker_focus');
},
leavesubmit = function (ev) {
$(this).removeclass('colorpicker_focus');
},
clicksubmit = function (ev) {
var cal = $(this).parent();
var col = cal.data('colorpicker').color;
cal.data('colorpicker').origcolor = col;
setcurrentcolor(col, cal.get(0));
cal.data('colorpicker').onsubmit(col, hsbtohex(col), hsbtorgb(col), cal.data('colorpicker').el);
},
show = function (ev) {
var cal = $('#' + $(this).data('colorpickerid'));
cal.data('colorpicker').onbeforeshow.apply(this, [cal.get(0)]);
var pos = $(this).offset();
var viewport = getviewport();
var top = pos.top + this.offsetheight;
var left = pos.left;
if (top + 176 > viewport.t + viewport.h) {
top -= this.offsetheight + 176;
}
if (left + 356 > viewport.l + viewport.w) {
left -= 356;
}
cal.css({left: left + 'px', top: top + 'px'});
if (cal.data('colorpicker').onshow.apply(this, [cal.get(0)]) != false) {
cal.show();
}
$(document).bind('mousedown', {cal: cal}, hide);
return false;
},
hide = function (ev) {
if (!ischildof(ev.data.cal.get(0), ev.target, ev.data.cal.get(0))) {
if (ev.data.cal.data('colorpicker').onhide.apply(this, [ev.data.cal.get(0)]) != false) {
ev.data.cal.hide();
}
$(document).unbind('mousedown', hide);
}
},
ischildof = function(parentel, el, container) {
if (parentel == el) {
return true;
}
if (parentel.contains) {
return parentel.contains(el);
}
if ( parentel.comparedocumentposition ) {
return !!(parentel.comparedocumentposition(el) & 16);
}
var prel = el.parentnode;
while(prel && prel != container) {
if (prel == parentel)
return true;
prel = prel.parentnode;
}
return false;
},
getviewport = function () {
var m = document.compatmode == 'css1compat';
return {
l : window.pagexoffset || (m ? document.documentelement.scrollleft : document.body.scrollleft),
t : window.pageyoffset || (m ? document.documentelement.scrolltop : document.body.scrolltop),
w : window.innerwidth || (m ? document.documentelement.clientwidth : document.body.clientwidth),
h : window.innerheight || (m ? document.documentelement.clientheight : document.body.clientheight)
};
},
fixhsb = function (hsb) {
return {
h: math.min(360, math.max(0, hsb.h)),
s: math.min(100, math.max(0, hsb.s)),
b: math.min(100, math.max(0, hsb.b))
};
},
fixrgb = function (rgb) {
return {
r: math.min(255, math.max(0, rgb.r)),
g: math.min(255, math.max(0, rgb.g)),
b: math.min(255, math.max(0, rgb.b))
};
},
fixhex = function (hex) {
var len = 6 - hex.length;
if (len > 0) {
var o = [];
for (var i=0; i -1) ? hex.substring(1) : hex), 16);
return {r: hex >> 16, g: (hex & 0x00ff00) >> 8, b: (hex & 0x0000ff)};
},
hextohsb = function (hex) {
return rgbtohsb(hextorgb(hex));
},
rgbtohsb = function (rgb) {
var hsb = {
h: 0,
s: 0,
b: 0
};
var min = math.min(rgb.r, rgb.g, rgb.b);
var max = math.max(rgb.r, rgb.g, rgb.b);
var delta = max - min;
hsb.b = max;
if (max != 0) {
}
hsb.s = max != 0 ? 255 * delta / max : 0;
if (hsb.s != 0) {
if (rgb.r == max) {
hsb.h = (rgb.g - rgb.b) / delta;
} else if (rgb.g == max) {
hsb.h = 2 + (rgb.b - rgb.r) / delta;
} else {
hsb.h = 4 + (rgb.r - rgb.g) / delta;
}
} else {
hsb.h = -1;
}
hsb.h *= 60;
if (hsb.h < 0) {
hsb.h += 360;
}
hsb.s *= 100/255;
hsb.b *= 100/255;
return hsb;
},
hsbtorgb = function (hsb) {
var rgb = {};
var h = math.round(hsb.h);
var s = math.round(hsb.s*255/100);
var v = math.round(hsb.b*255/100);
if(s == 0) {
rgb.r = rgb.g = rgb.b = v;
} else {
var t1 = v;
var t2 = (255-s)*v/255;
var t3 = (t1-t2)*(h%60)/60;
if(h==360) h = 0;
if(h<60) {rgb.r=t1; rgb.b=t2; rgb.g=t2+t3}
else if(h<120) {rgb.g=t1; rgb.b=t2; rgb.r=t1-t3}
else if(h<180) {rgb.g=t1; rgb.r=t2; rgb.b=t2+t3}
else if(h<240) {rgb.b=t1; rgb.r=t2; rgb.g=t1-t3}
else if(h<300) {rgb.b=t1; rgb.g=t2; rgb.r=t2+t3}
else if(h<360) {rgb.r=t1; rgb.g=t2; rgb.b=t1-t3}
else {rgb.r=0; rgb.g=0; rgb.b=0}
}
return {r:math.round(rgb.r), g:math.round(rgb.g), b:math.round(rgb.b)};
},
rgbtohex = function (rgb) {
var hex = [
rgb.r.tostring(16),
rgb.g.tostring(16),
rgb.b.tostring(16)
];
$.each(hex, function (nr, val) {
if (val.length == 1) {
hex[nr] = '0' + val;
}
});
return hex.join('');
},
hsbtohex = function (hsb) {
return rgbtohex(hsbtorgb(hsb));
},
restoreoriginal = function () {
var cal = $(this).parent();
var col = cal.data('colorpicker').origcolor;
cal.data('colorpicker').color = col;
fillrgbfields(col, cal.get(0));
fillhexfields(col, cal.get(0));
fillhsbfields(col, cal.get(0));
setselector(col, cal.get(0));
sethue(col, cal.get(0));
setnewcolor(col, cal.get(0));
};
return {
init: function (opt) {
opt = $.extend({}, defaults, opt||{});
if (typeof opt.color == 'string') {
opt.color = hextohsb(opt.color);
} else if (opt.color.r != undefined && opt.color.g != undefined && opt.color.b != undefined) {
opt.color = rgbtohsb(opt.color);
} else if (opt.color.h != undefined && opt.color.s != undefined && opt.color.b != undefined) {
opt.color = fixhsb(opt.color);
} else {
return this;
}
return this.each(function () {
if (!$(this).data('colorpickerid')) {
var options = $.extend({}, opt);
options.origcolor = opt.color;
var id = 'collorpicker_' + parseint(math.random() * 1000);
$(this).data('colorpickerid', id);
var cal = $(tpl).attr('id', id);
if (options.flat) {
cal.appendto(this).show();
} else {
cal.appendto(document.body);
}
options.fields = cal
.find('input')
.bind('keyup', keydown)
.bind('change', change)
.bind('blur', blur)
.bind('focus', focus);
cal
.find('span').bind('mousedown', downincrement).end()
.find('>div.colorpicker_current_color').bind('click', restoreoriginal);
options.selector = cal.find('div.colorpicker_color').bind('mousedown', downselector);
options.selectorindic = options.selector.find('div div');
options.el = this;
options.hue = cal.find('div.colorpicker_hue div');
cal.find('div.colorpicker_hue').bind('mousedown', downhue);
options.newcolor = cal.find('div.colorpicker_new_color');
options.currentcolor = cal.find('div.colorpicker_current_color');
cal.data('colorpicker', options);
cal.find('div.colorpicker_submit')
.bind('mouseenter', entersubmit)
.bind('mouseleave', leavesubmit)
.bind('click', clicksubmit);
fillrgbfields(options.color, cal.get(0));
fillhsbfields(options.color, cal.get(0));
fillhexfields(options.color, cal.get(0));
sethue(options.color, cal.get(0));
setselector(options.color, cal.get(0));
setcurrentcolor(options.color, cal.get(0));
setnewcolor(options.color, cal.get(0));
if (options.flat) {
cal.css({
position: 'relative',
display: 'block'
});
} else {
$(this).bind(options.eventname, show);
}
}
});
},
showpicker: function() {
return this.each( function () {
if ($(this).data('colorpickerid')) {
show.apply(this);
}
});
},
hidepicker: function() {
return this.each( function () {
if ($(this).data('colorpickerid')) {
$('#' + $(this).data('colorpickerid')).hide();
}
});
},
setcolor: function(col) {
if (typeof col == 'string') {
col = hextohsb(col);
} else if (col.r != undefined && col.g != undefined && col.b != undefined) {
col = rgbtohsb(col);
} else if (col.h != undefined && col.s != undefined && col.b != undefined) {
col = fixhsb(col);
} else {
return this;
}
return this.each(function(){
if ($(this).data('colorpickerid')) {
var cal = $('#' + $(this).data('colorpickerid'));
cal.data('colorpicker').color = col;
cal.data('colorpicker').origcolor = col;
fillrgbfields(col, cal.get(0));
fillhsbfields(col, cal.get(0));
fillhexfields(col, cal.get(0));
sethue(col, cal.get(0));
setselector(col, cal.get(0));
setcurrentcolor(col, cal.get(0));
setnewcolor(col, cal.get(0));
}
});
}
};
}();
$.fn.extend({
colorpicker: colorpicker.init,
colorpickerhide: colorpicker.hidepicker,
colorpickershow: colorpicker.showpicker,
colorpickersetcolor: colorpicker.setcolor
});
})(jquery)
;/**
* isotope packaged v2.1.0
* filter & sort magical layouts
* http://isotope.metafizzy.co
*/
(function(t){function e(){}function i(t){function i(e){e.prototype.option||(e.prototype.option=function(e){t.isplainobject(e)&&(this.options=t.extend(!0,this.options,e))})}function n(e,i){t.fn[e]=function(n){if("string"==typeof n){for(var s=o.call(arguments,1),a=0,u=this.length;u>a;a++){var p=this[a],h=t.data(p,e);if(h)if(t.isfunction(h[n])&&"_"!==n.charat(0)){var f=h[n].apply(h,s);if(void 0!==f)return f}else r("no such method '"+n+"' for "+e+" instance");else r("cannot call methods on "+e+" prior to initialization; "+"attempted to call '"+n+"'")}return this}return this.each(function(){var o=t.data(this,e);o?(o.option(n),o._init()):(o=new i(this,n),t.data(this,e,o))})}}if(t){var r="undefined"==typeof console?e:function(t){console.error(t)};return t.bridget=function(t,e){i(e),n(t,e)},t.bridget}}var o=array.prototype.slice;"function"==typeof define&&define.amd?define("jquery-bridget/jquery.bridget",["jquery"],i):"object"==typeof exports?i(require("jquery")):i(t.jquery)})(window),function(t){function e(e){var i=t.event;return i.target=i.target||i.srcelement||e,i}var i=document.documentelement,o=function(){};i.addeventlistener?o=function(t,e,i){t.addeventlistener(e,i,!1)}:i.attachevent&&(o=function(t,i,o){t[i+o]=o.handleevent?function(){var i=e(t);o.handleevent.call(o,i)}:function(){var i=e(t);o.call(t,i)},t.attachevent("on"+i,t[i+o])});var n=function(){};i.removeeventlistener?n=function(t,e,i){t.removeeventlistener(e,i,!1)}:i.detachevent&&(n=function(t,e,i){t.detachevent("on"+e,t[e+i]);try{delete t[e+i]}catch(o){t[e+i]=void 0}});var r={bind:o,unbind:n};"function"==typeof define&&define.amd?define("eventie/eventie",r):"object"==typeof exports?module.exports=r:t.eventie=r}(this),function(t){function e(t){"function"==typeof t&&(e.isready?t():s.push(t))}function i(t){var i="readystatechange"===t.type&&"complete"!==r.readystate;e.isready||i||o()}function o(){e.isready=!0;for(var t=0,i=s.length;i>t;t++){var o=s[t];o()}}function n(n){return"complete"===r.readystate?o():(n.bind(r,"domcontentloaded",i),n.bind(r,"readystatechange",i),n.bind(t,"load",i)),e}var r=t.document,s=[];e.isready=!1,"function"==typeof define&&define.amd?define("doc-ready/doc-ready",["eventie/eventie"],n):"object"==typeof exports?module.exports=n(require("eventie")):t.docready=n(t.eventie)}(window),function(){function t(){}function e(t,e){for(var i=t.length;i--;)if(t[i].listener===e)return i;return-1}function i(t){return function(){return this[t].apply(this,arguments)}}var o=t.prototype,n=this,r=n.eventemitter;o.getlisteners=function(t){var e,i,o=this._getevents();if(t instanceof regexp){e={};for(i in o)o.hasownproperty(i)&&t.test(i)&&(e[i]=o[i])}else e=o[t]||(o[t]=[]);return e},o.flattenlisteners=function(t){var e,i=[];for(e=0;t.length>e;e+=1)i.push(t[e].listener);return i},o.getlistenersasobject=function(t){var e,i=this.getlisteners(t);return i instanceof array&&(e={},e[t]=i),e||i},o.addlistener=function(t,i){var o,n=this.getlistenersasobject(t),r="object"==typeof i;for(o in n)n.hasownproperty(o)&&-1===e(n[o],i)&&n[o].push(r?i:{listener:i,once:!1});return this},o.on=i("addlistener"),o.addoncelistener=function(t,e){return this.addlistener(t,{listener:e,once:!0})},o.once=i("addoncelistener"),o.defineevent=function(t){return this.getlisteners(t),this},o.defineevents=function(t){for(var e=0;t.length>e;e+=1)this.defineevent(t[e]);return this},o.removelistener=function(t,i){var o,n,r=this.getlistenersasobject(t);for(n in r)r.hasownproperty(n)&&(o=e(r[n],i),-1!==o&&r[n].splice(o,1));return this},o.off=i("removelistener"),o.addlisteners=function(t,e){return this.manipulatelisteners(!1,t,e)},o.removelisteners=function(t,e){return this.manipulatelisteners(!0,t,e)},o.manipulatelisteners=function(t,e,i){var o,n,r=t?this.removelistener:this.addlistener,s=t?this.removelisteners:this.addlisteners;if("object"!=typeof e||e instanceof regexp)for(o=i.length;o--;)r.call(this,e,i[o]);else for(o in e)e.hasownproperty(o)&&(n=e[o])&&("function"==typeof n?r.call(this,o,n):s.call(this,o,n));return this},o.removeevent=function(t){var e,i=typeof t,o=this._getevents();if("string"===i)delete o[t];else if(t instanceof regexp)for(e in o)o.hasownproperty(e)&&t.test(e)&&delete o[e];else delete this._events;return this},o.removealllisteners=i("removeevent"),o.emitevent=function(t,e){var i,o,n,r,s=this.getlistenersasobject(t);for(n in s)if(s.hasownproperty(n))for(o=s[n].length;o--;)i=s[n][o],i.once===!0&&this.removelistener(t,i.listener),r=i.listener.apply(this,e||[]),r===this._getoncereturnvalue()&&this.removelistener(t,i.listener);return this},o.trigger=i("emitevent"),o.emit=function(t){var e=array.prototype.slice.call(arguments,1);return this.emitevent(t,e)},o.setoncereturnvalue=function(t){return this._oncereturnvalue=t,this},o._getoncereturnvalue=function(){return this.hasownproperty("_oncereturnvalue")?this._oncereturnvalue:!0},o._getevents=function(){return this._events||(this._events={})},t.noconflict=function(){return n.eventemitter=r,t},"function"==typeof define&&define.amd?define("eventemitter/eventemitter",[],function(){return t}):"object"==typeof module&&module.exports?module.exports=t:n.eventemitter=t}.call(this),function(t){function e(t){if(t){if("string"==typeof o[t])return t;t=t.charat(0).touppercase()+t.slice(1);for(var e,n=0,r=i.length;r>n;n++)if(e=i[n]+t,"string"==typeof o[e])return e}}var i="webkit moz ms ms o".split(" "),o=document.documentelement.style;"function"==typeof define&&define.amd?define("get-style-property/get-style-property",[],function(){return e}):"object"==typeof exports?module.exports=e:t.getstyleproperty=e}(window),function(t){function e(t){var e=parsefloat(t),i=-1===t.indexof("%")&&!isnan(e);return i&&e}function i(){}function o(){for(var t={width:0,height:0,innerwidth:0,innerheight:0,outerwidth:0,outerheight:0},e=0,i=s.length;i>e;e++){var o=s[e];t[o]=0}return t}function n(i){function n(){if(!d){d=!0;var o=t.getcomputedstyle;if(p=function(){var t=o?function(t){return o(t,null)}:function(t){return t.currentstyle};return function(e){var i=t(e);return i||r("style returned "+i+". are you running this code in a hidden iframe on firefox? "+"see http://bit.ly/getsizebug1"),i}}(),h=i("boxsizing")){var n=document.createelement("div");n.style.width="200px",n.style.padding="1px 2px 3px 4px",n.style.borderstyle="solid",n.style.borderwidth="1px 2px 3px 4px",n.style[h]="border-box";var s=document.body||document.documentelement;s.appendchild(n);var a=p(n);f=200===e(a.width),s.removechild(n)}}}function a(t){if(n(),"string"==typeof t&&(t=document.queryselector(t)),t&&"object"==typeof t&&t.nodetype){var i=p(t);if("none"===i.display)return o();var r={};r.width=t.offsetwidth,r.height=t.offsetheight;for(var a=r.isborderbox=!(!h||!i[h]||"border-box"!==i[h]),d=0,l=s.length;l>d;d++){var c=s[d],y=i[c];y=u(t,y);var m=parsefloat(y);r[c]=isnan(m)?0:m}var g=r.paddingleft+r.paddingright,v=r.paddingtop+r.paddingbottom,_=r.marginleft+r.marginright,i=r.margintop+r.marginbottom,l=r.borderleftwidth+r.borderrightwidth,z=r.bordertopwidth+r.borderbottomwidth,b=a&&f,x=e(i.width);x!==!1&&(r.width=x+(b?0:g+l));var s=e(i.height);return s!==!1&&(r.height=s+(b?0:v+z)),r.innerwidth=r.width-(g+l),r.innerheight=r.height-(v+z),r.outerwidth=r.width+_,r.outerheight=r.height+i,r}}function u(e,i){if(t.getcomputedstyle||-1===i.indexof("%"))return i;var o=e.style,n=o.left,r=e.runtimestyle,s=r&&r.left;return s&&(r.left=e.currentstyle.left),o.left=i,i=o.pixelleft,o.left=n,s&&(r.left=s),i}var p,h,f,d=!1;return a}var r="undefined"==typeof console?i:function(t){console.error(t)},s=["paddingleft","paddingright","paddingtop","paddingbottom","marginleft","marginright","margintop","marginbottom","borderleftwidth","borderrightwidth","bordertopwidth","borderbottomwidth"];"function"==typeof define&&define.amd?define("get-size/get-size",["get-style-property/get-style-property"],n):"object"==typeof exports?module.exports=n(require("desandro-get-style-property")):t.getsize=n(t.getstyleproperty)}(window),function(t){function e(t,e){return t[s](e)}function i(t){if(!t.parentnode){var e=document.createdocumentfragment();e.appendchild(t)}}function o(t,e){i(t);for(var o=t.parentnode.queryselectorall(e),n=0,r=o.length;r>n;n++)if(o[n]===t)return!0;return!1}function n(t,o){return i(t),e(t,o)}var r,s=function(){if(t.matchesselector)return"matchesselector";for(var e=["webkit","moz","ms","o"],i=0,o=e.length;o>i;i++){var n=e[i],r=n+"matchesselector";if(t[r])return r}}();if(s){var a=document.createelement("div"),u=e(a,"div");r=u?e:n}else r=o;"function"==typeof define&&define.amd?define("matches-selector/matches-selector",[],function(){return r}):"object"==typeof exports?module.exports=r:window.matchesselector=r}(element.prototype),function(t){function e(t,e){for(var i in e)t[i]=e[i];return t}function i(t){for(var e in t)return!1;return e=null,!0}function o(t){return t.replace(/([a-z])/g,function(t){return"-"+t.tolowercase()})}function n(t,n,r){function a(t,e){t&&(this.element=t,this.layout=e,this.position={x:0,y:0},this._create())}var u=r("transition"),p=r("transform"),h=u&&p,f=!!r("perspective"),d={webkittransition:"webkittransitionend",moztransition:"transitionend",otransition:"otransitionend",transition:"transitionend"}[u],l=["transform","transition","transitionduration","transitionproperty"],c=function(){for(var t={},e=0,i=l.length;i>e;e++){var o=l[e],n=r(o);n&&n!==o&&(t[o]=n)}return t}();e(a.prototype,t.prototype),a.prototype._create=function(){this._transn={ingproperties:{},clean:{},onend:{}},this.css({position:"absolute"})},a.prototype.handleevent=function(t){var e="on"+t.type;this[e]&&this[e](t)},a.prototype.getsize=function(){this.size=n(this.element)},a.prototype.css=function(t){var e=this.element.style;for(var i in t){var o=c[i]||i;e[o]=t[i]}},a.prototype.getposition=function(){var t=s(this.element),e=this.layout.options,i=e.isoriginleft,o=e.isorigintop,n=parseint(t[i?"left":"right"],10),r=parseint(t[o?"top":"bottom"],10);n=isnan(n)?0:n,r=isnan(r)?0:r;var a=this.layout.size;n-=i?a.paddingleft:a.paddingright,r-=o?a.paddingtop:a.paddingbottom,this.position.x=n,this.position.y=r},a.prototype.layoutposition=function(){var t=this.layout.size,e=this.layout.options,i={};e.isoriginleft?(i.left=this.position.x+t.paddingleft+"px",i.right=""):(i.right=this.position.x+t.paddingright+"px",i.left=""),e.isorigintop?(i.top=this.position.y+t.paddingtop+"px",i.bottom=""):(i.bottom=this.position.y+t.paddingbottom+"px",i.top=""),this.css(i),this.emitevent("layout",[this])};var y=f?function(t,e){return"translate3d("+t+"px, "+e+"px, 0)"}:function(t,e){return"translate("+t+"px, "+e+"px)"};a.prototype._transitionto=function(t,e){this.getposition();var i=this.position.x,o=this.position.y,n=parseint(t,10),r=parseint(e,10),s=n===this.position.x&&r===this.position.y;if(this.setposition(t,e),s&&!this.istransitioning)return this.layoutposition(),void 0;var a=t-i,u=e-o,p={},h=this.layout.options;a=h.isoriginleft?a:-a,u=h.isorigintop?u:-u,p.transform=y(a,u),this.transition({to:p,ontransitionend:{transform:this.layoutposition},iscleaning:!0})},a.prototype.goto=function(t,e){this.setposition(t,e),this.layoutposition()},a.prototype.moveto=h?a.prototype._transitionto:a.prototype.goto,a.prototype.setposition=function(t,e){this.position.x=parseint(t,10),this.position.y=parseint(e,10)},a.prototype._nontransition=function(t){this.css(t.to),t.iscleaning&&this._removestyles(t.to);for(var e in t.ontransitionend)t.ontransitionend[e].call(this)},a.prototype._transition=function(t){if(!parsefloat(this.layout.options.transitionduration))return this._nontransition(t),void 0;var e=this._transn;for(var i in t.ontransitionend)e.onend[i]=t.ontransitionend[i];for(i in t.to)e.ingproperties[i]=!0,t.iscleaning&&(e.clean[i]=!0);if(t.from){this.css(t.from);var o=this.element.offsetheight;o=null}this.enabletransition(t.to),this.css(t.to),this.istransitioning=!0};var m=p&&o(p)+",opacity";a.prototype.enabletransition=function(){this.istransitioning||(this.css({transitionproperty:m,transitionduration:this.layout.options.transitionduration}),this.element.addeventlistener(d,this,!1))},a.prototype.transition=a.prototype[u?"_transition":"_nontransition"],a.prototype.onwebkittransitionend=function(t){this.ontransitionend(t)},a.prototype.onotransitionend=function(t){this.ontransitionend(t)};var g={"-webkit-transform":"transform","-moz-transform":"transform","-o-transform":"transform"};a.prototype.ontransitionend=function(t){if(t.target===this.element){var e=this._transn,o=g[t.propertyname]||t.propertyname;if(delete e.ingproperties[o],i(e.ingproperties)&&this.disabletransition(),o in e.clean&&(this.element.style[t.propertyname]="",delete e.clean[o]),o in e.onend){var n=e.onend[o];n.call(this),delete e.onend[o]}this.emitevent("transitionend",[this])}},a.prototype.disabletransition=function(){this.removetransitionstyles(),this.element.removeeventlistener(d,this,!1),this.istransitioning=!1},a.prototype._removestyles=function(t){var e={};for(var i in t)e[i]="";this.css(e)};var v={transitionproperty:"",transitionduration:""};return a.prototype.removetransitionstyles=function(){this.css(v)},a.prototype.removeelem=function(){this.element.parentnode.removechild(this.element),this.emitevent("remove",[this])},a.prototype.remove=function(){if(!u||!parsefloat(this.layout.options.transitionduration))return this.removeelem(),void 0;var t=this;this.on("transitionend",function(){return t.removeelem(),!0}),this.hide()},a.prototype.reveal=function(){delete this.ishidden,this.css({display:""});var t=this.layout.options;this.transition({from:t.hiddenstyle,to:t.visiblestyle,iscleaning:!0})},a.prototype.hide=function(){this.ishidden=!0,this.css({display:""});var t=this.layout.options;this.transition({from:t.visiblestyle,to:t.hiddenstyle,iscleaning:!0,ontransitionend:{opacity:function(){this.ishidden&&this.css({display:"none"})}}})},a.prototype.destroy=function(){this.css({position:"",left:"",right:"",top:"",bottom:"",transition:"",transform:""})},a}var r=t.getcomputedstyle,s=r?function(t){return r(t,null)}:function(t){return t.currentstyle};"function"==typeof define&&define.amd?define("outlayer/item",["eventemitter/eventemitter","get-size/get-size","get-style-property/get-style-property"],n):"object"==typeof exports?module.exports=n(require("wolfy87-eventemitter"),require("get-size"),require("desandro-get-style-property")):(t.outlayer={},t.outlayer.item=n(t.eventemitter,t.getsize,t.getstyleproperty))}(window),function(t){function e(t,e){for(var i in e)t[i]=e[i];return t}function i(t){return"[object array]"===f.call(t)}function o(t){var e=[];if(i(t))e=t;else if(t&&"number"==typeof t.length)for(var o=0,n=t.length;n>o;o++)e.push(t[o]);else e.push(t);return e}function n(t,e){var i=l(e,t);-1!==i&&e.splice(i,1)}function r(t){return t.replace(/(.)([a-z])/g,function(t,e,i){return e+"-"+i}).tolowercase()}function s(i,s,f,l,c,y){function m(t,i){if("string"==typeof t&&(t=a.queryselector(t)),!t||!d(t))return u&&u.error("bad "+this.constructor.namespace+" element: "+t),void 0;this.element=t,this.options=e({},this.constructor.defaults),this.option(i);var o=++g;this.element.outlayerguid=o,v[o]=this,this._create(),this.options.isinitlayout&&this.layout()}var g=0,v={};return m.namespace="outlayer",m.item=y,m.defaults={containerstyle:{position:"relative"},isinitlayout:!0,isoriginleft:!0,isorigintop:!0,isresizebound:!0,isresizingcontainer:!0,transitionduration:"0.4s",hiddenstyle:{opacity:0,transform:"scale(0.001)"},visiblestyle:{opacity:1,transform:"scale(1)"}},e(m.prototype,f.prototype),m.prototype.option=function(t){e(this.options,t)},m.prototype._create=function(){this.reloaditems(),this.stamps=[],this.stamp(this.options.stamp),e(this.element.style,this.options.containerstyle),this.options.isresizebound&&this.bindresize()},m.prototype.reloaditems=function(){this.items=this._itemize(this.element.children)},m.prototype._itemize=function(t){for(var e=this._filterfinditemelements(t),i=this.constructor.item,o=[],n=0,r=e.length;r>n;n++){var s=e[n],a=new i(s,this);o.push(a)}return o},m.prototype._filterfinditemelements=function(t){t=o(t);for(var e=this.options.itemselector,i=[],n=0,r=t.length;r>n;n++){var s=t[n];if(d(s))if(e){c(s,e)&&i.push(s);for(var a=s.queryselectorall(e),u=0,p=a.length;p>u;u++)i.push(a[u])}else i.push(s)}return i},m.prototype.getitemelements=function(){for(var t=[],e=0,i=this.items.length;i>e;e++)t.push(this.items[e].element);return t},m.prototype.layout=function(){this._resetlayout(),this._managestamps();var t=void 0!==this.options.islayoutinstant?this.options.islayoutinstant:!this._islayoutinited;this.layoutitems(this.items,t),this._islayoutinited=!0},m.prototype._init=m.prototype.layout,m.prototype._resetlayout=function(){this.getsize()},m.prototype.getsize=function(){this.size=l(this.element)},m.prototype._getmeasurement=function(t,e){var i,o=this.options[t];o?("string"==typeof o?i=this.element.queryselector(o):d(o)&&(i=o),this[t]=i?l(i)[e]:o):this[t]=0},m.prototype.layoutitems=function(t,e){t=this._getitemsforlayout(t),this._layoutitems(t,e),this._postlayout()},m.prototype._getitemsforlayout=function(t){for(var e=[],i=0,o=t.length;o>i;i++){var n=t[i];n.isignored||e.push(n)}return e},m.prototype._layoutitems=function(t,e){function i(){o.emitevent("layoutcomplete",[o,t])}var o=this;if(!t||!t.length)return i(),void 0;this._itemson(t,"layout",i);for(var n=[],r=0,s=t.length;s>r;r++){var a=t[r],u=this._getitemlayoutposition(a);u.item=a,u.isinstant=e||a.islayoutinstant,n.push(u)}this._processlayoutqueue(n)},m.prototype._getitemlayoutposition=function(){return{x:0,y:0}},m.prototype._processlayoutqueue=function(t){for(var e=0,i=t.length;i>e;e++){var o=t[e];this._positionitem(o.item,o.x,o.y,o.isinstant)}},m.prototype._positionitem=function(t,e,i,o){o?t.goto(e,i):t.moveto(e,i)},m.prototype._postlayout=function(){this.resizecontainer()},m.prototype.resizecontainer=function(){if(this.options.isresizingcontainer){var t=this._getcontainersize();t&&(this._setcontainermeasure(t.width,!0),this._setcontainermeasure(t.height,!1))}},m.prototype._getcontainersize=h,m.prototype._setcontainermeasure=function(t,e){if(void 0!==t){var i=this.size;i.isborderbox&&(t+=e?i.paddingleft+i.paddingright+i.borderleftwidth+i.borderrightwidth:i.paddingbottom+i.paddingtop+i.bordertopwidth+i.borderbottomwidth),t=math.max(t,0),this.element.style[e?"width":"height"]=t+"px"}},m.prototype._itemson=function(t,e,i){function o(){return n++,n===r&&i.call(s),!0}for(var n=0,r=t.length,s=this,a=0,u=t.length;u>a;a++){var p=t[a];p.on(e,o)}},m.prototype.ignore=function(t){var e=this.getitem(t);e&&(e.isignored=!0)},m.prototype.unignore=function(t){var e=this.getitem(t);e&&delete e.isignored},m.prototype.stamp=function(t){if(t=this._find(t)){this.stamps=this.stamps.concat(t);for(var e=0,i=t.length;i>e;e++){var o=t[e];this.ignore(o)}}},m.prototype.unstamp=function(t){if(t=this._find(t))for(var e=0,i=t.length;i>e;e++){var o=t[e];n(o,this.stamps),this.unignore(o)}},m.prototype._find=function(t){return t?("string"==typeof t&&(t=this.element.queryselectorall(t)),t=o(t)):void 0},m.prototype._managestamps=function(){if(this.stamps&&this.stamps.length){this._getboundingrect();for(var t=0,e=this.stamps.length;e>t;t++){var i=this.stamps[t];this._managestamp(i)}}},m.prototype._getboundingrect=function(){var t=this.element.getboundingclientrect(),e=this.size;this._boundingrect={left:t.left+e.paddingleft+e.borderleftwidth,top:t.top+e.paddingtop+e.bordertopwidth,right:t.right-(e.paddingright+e.borderrightwidth),bottom:t.bottom-(e.paddingbottom+e.borderbottomwidth)}},m.prototype._managestamp=h,m.prototype._getelementoffset=function(t){var e=t.getboundingclientrect(),i=this._boundingrect,o=l(t),n={left:e.left-i.left-o.marginleft,top:e.top-i.top-o.margintop,right:i.right-e.right-o.marginright,bottom:i.bottom-e.bottom-o.marginbottom};return n},m.prototype.handleevent=function(t){var e="on"+t.type;this[e]&&this[e](t)},m.prototype.bindresize=function(){this.isresizebound||(i.bind(t,"resize",this),this.isresizebound=!0)},m.prototype.unbindresize=function(){this.isresizebound&&i.unbind(t,"resize",this),this.isresizebound=!1},m.prototype.onresize=function(){function t(){e.resize(),delete e.resizetimeout}this.resizetimeout&&cleartimeout(this.resizetimeout);var e=this;this.resizetimeout=settimeout(t,100)},m.prototype.resize=function(){this.isresizebound&&this.needsresizelayout()&&this.layout()},m.prototype.needsresizelayout=function(){var t=l(this.element),e=this.size&&t;return e&&t.innerwidth!==this.size.innerwidth},m.prototype.additems=function(t){var e=this._itemize(t);return e.length&&(this.items=this.items.concat(e)),e},m.prototype.appended=function(t){var e=this.additems(t);e.length&&(this.layoutitems(e,!0),this.reveal(e))},m.prototype.prepended=function(t){var e=this._itemize(t);if(e.length){var i=this.items.slice(0);this.items=e.concat(i),this._resetlayout(),this._managestamps(),this.layoutitems(e,!0),this.reveal(e),this.layoutitems(i)}},m.prototype.reveal=function(t){var e=t&&t.length;if(e)for(var i=0;e>i;i++){var o=t[i];o.reveal()}},m.prototype.hide=function(t){var e=t&&t.length;if(e)for(var i=0;e>i;i++){var o=t[i];o.hide()}},m.prototype.getitem=function(t){for(var e=0,i=this.items.length;i>e;e++){var o=this.items[e];if(o.element===t)return o}},m.prototype.getitems=function(t){if(t&&t.length){for(var e=[],i=0,o=t.length;o>i;i++){var n=t[i],r=this.getitem(n);r&&e.push(r)}return e}},m.prototype.remove=function(t){t=o(t);var e=this.getitems(t);if(e&&e.length){this._itemson(e,"remove",function(){this.emitevent("removecomplete",[this,e])});for(var i=0,r=e.length;r>i;i++){var s=e[i];s.remove(),n(s,this.items)}}},m.prototype.destroy=function(){var t=this.element.style;t.height="",t.position="",t.width="";for(var e=0,i=this.items.length;i>e;e++){var o=this.items[e];o.destroy()}this.unbindresize();var n=this.element.outlayerguid;delete v[n],delete this.element.outlayerguid,p&&p.removedata(this.element,this.constructor.namespace)},m.data=function(t){var e=t&&t.outlayerguid;return e&&v[e]},m.create=function(t,i){function o(){m.apply(this,arguments)}return object.create?o.prototype=object.create(m.prototype):e(o.prototype,m.prototype),o.prototype.constructor=o,o.defaults=e({},m.defaults),e(o.defaults,i),o.prototype.settings={},o.namespace=t,o.data=m.data,o.item=function(){y.apply(this,arguments)},o.item.prototype=new y,s(function(){for(var e=r(t),i=a.queryselectorall(".js-"+e),n="data-"+e+"-options",s=0,h=i.length;h>s;s++){var f,d=i[s],l=d.getattribute(n);try{f=l&&json.parse(l)}catch(c){u&&u.error("error parsing "+n+" on "+d.nodename.tolowercase()+(d.id?"#"+d.id:"")+": "+c);continue}var y=new o(d,f);p&&p.data(d,t,y)}}),p&&p.bridget&&p.bridget(t,o),o},m.item=y,m}var a=t.document,u=t.console,p=t.jquery,h=function(){},f=object.prototype.tostring,d="function"==typeof htmlelement||"object"==typeof htmlelement?function(t){return t instanceof htmlelement}:function(t){return t&&"object"==typeof t&&1===t.nodetype&&"string"==typeof t.nodename},l=array.prototype.indexof?function(t,e){return t.indexof(e)}:function(t,e){for(var i=0,o=t.length;o>i;i++)if(t[i]===e)return i;return-1};"function"==typeof define&&define.amd?define("outlayer/outlayer",["eventie/eventie","doc-ready/doc-ready","eventemitter/eventemitter","get-size/get-size","matches-selector/matches-selector","./item"],s):"object"==typeof exports?module.exports=s(require("eventie"),require("doc-ready"),require("wolfy87-eventemitter"),require("get-size"),require("desandro-matches-selector"),require("./item")):t.outlayer=s(t.eventie,t.docready,t.eventemitter,t.getsize,t.matchesselector,t.outlayer.item)}(window),function(t){function e(t){function e(){t.item.apply(this,arguments)}e.prototype=new t.item,e.prototype._create=function(){this.id=this.layout.itemguid++,t.item.prototype._create.call(this),this.sortdata={}},e.prototype.updatesortdata=function(){if(!this.isignored){this.sortdata.id=this.id,this.sortdata["original-order"]=this.id,this.sortdata.random=math.random();var t=this.layout.options.getsortdata,e=this.layout._sorters;for(var i in t){var o=e[i];this.sortdata[i]=o(this.element,this)}}};var i=e.prototype.destroy;return e.prototype.destroy=function(){i.apply(this,arguments),this.css({display:""})},e}"function"==typeof define&&define.amd?define("isotope/js/item",["outlayer/outlayer"],e):"object"==typeof exports?module.exports=e(require("outlayer")):(t.isotope=t.isotope||{},t.isotope.item=e(t.outlayer))}(window),function(t){function e(t,e){function i(t){this.isotope=t,t&&(this.options=t.options[this.namespace],this.element=t.element,this.items=t.filtereditems,this.size=t.size)}return function(){function t(t){return function(){return e.prototype[t].apply(this.isotope,arguments)}}for(var o=["_resetlayout","_getitemlayoutposition","_managestamp","_getcontainersize","_getelementoffset","needsresizelayout"],n=0,r=o.length;r>n;n++){var s=o[n];i.prototype[s]=t(s)}}(),i.prototype.needsverticalresizelayout=function(){var e=t(this.isotope.element),i=this.isotope.size&&e;return i&&e.innerheight!==this.isotope.size.innerheight},i.prototype._getmeasurement=function(){this.isotope._getmeasurement.apply(this,arguments)},i.prototype.getcolumnwidth=function(){this.getsegmentsize("column","width")},i.prototype.getrowheight=function(){this.getsegmentsize("row","height")},i.prototype.getsegmentsize=function(t,e){var i=t+e,o="outer"+e;if(this._getmeasurement(i,o),!this[i]){var n=this.getfirstitemsize();this[i]=n&&n[o]||this.isotope.size["inner"+e]}},i.prototype.getfirstitemsize=function(){var e=this.isotope.filtereditems[0];return e&&e.element&&t(e.element)},i.prototype.layout=function(){this.isotope.layout.apply(this.isotope,arguments)},i.prototype.getsize=function(){this.isotope.getsize(),this.size=this.isotope.size},i.modes={},i.create=function(t,e){function o(){i.apply(this,arguments)}return o.prototype=new i,e&&(o.options=e),o.prototype.namespace=t,i.modes[t]=o,o},i}"function"==typeof define&&define.amd?define("isotope/js/layout-mode",["get-size/get-size","outlayer/outlayer"],e):"object"==typeof exports?module.exports=e(require("get-size"),require("outlayer")):(t.isotope=t.isotope||{},t.isotope.layoutmode=e(t.getsize,t.outlayer))}(window),function(t){function e(t,e){var o=t.create("masonry");return o.prototype._resetlayout=function(){this.getsize(),this._getmeasurement("columnwidth","outerwidth"),this._getmeasurement("gutter","outerwidth"),this.measurecolumns();var t=this.cols;for(this.colys=[];t--;)this.colys.push(0);this.maxy=0},o.prototype.measurecolumns=function(){if(this.getcontainerwidth(),!this.columnwidth){var t=this.items[0],i=t&&t.element;this.columnwidth=i&&e(i).outerwidth||this.containerwidth}this.columnwidth+=this.gutter,this.cols=math.floor((this.containerwidth+this.gutter)/this.columnwidth),this.cols=math.max(this.cols,1)},o.prototype.getcontainerwidth=function(){var t=this.options.isfitwidth?this.element.parentnode:this.element,i=e(t);this.containerwidth=i&&i.innerwidth},o.prototype._getitemlayoutposition=function(t){t.getsize();var e=t.size.outerwidth%this.columnwidth,o=e&&1>e?"round":"ceil",n=math[o](t.size.outerwidth/this.columnwidth);n=math.min(n,this.cols);for(var r=this._getcolgroup(n),s=math.min.apply(math,r),a=i(r,s),u={x:this.columnwidth*a,y:s},p=s+t.size.outerheight,h=this.cols+1-r.length,f=0;h>f;f++)this.colys[a+f]=p;return u},o.prototype._getcolgroup=function(t){if(2>t)return this.colys;for(var e=[],i=this.cols+1-t,o=0;i>o;o++){var n=this.colys.slice(o,o+t);e[o]=math.max.apply(math,n)}return e},o.prototype._managestamp=function(t){var i=e(t),o=this._getelementoffset(t),n=this.options.isoriginleft?o.left:o.right,r=n+i.outerwidth,s=math.floor(n/this.columnwidth);s=math.max(0,s);var a=math.floor(r/this.columnwidth);a-=r%this.columnwidth?0:1,a=math.min(this.cols-1,a);for(var u=(this.options.isorigintop?o.top:o.bottom)+i.outerheight,p=s;a>=p;p++)this.colys[p]=math.max(u,this.colys[p])},o.prototype._getcontainersize=function(){this.maxy=math.max.apply(math,this.colys);var t={height:this.maxy};return this.options.isfitwidth&&(t.width=this._getcontainerfitwidth()),t},o.prototype._getcontainerfitwidth=function(){for(var t=0,e=this.cols;--e&&0===this.colys[e];)t++;return(this.cols-t)*this.columnwidth-this.gutter},o.prototype.needsresizelayout=function(){var t=this.containerwidth;return this.getcontainerwidth(),t!==this.containerwidth},o}var i=array.prototype.indexof?function(t,e){return t.indexof(e)}:function(t,e){for(var i=0,o=t.length;o>i;i++){var n=t[i];if(n===e)return i}return-1};"function"==typeof define&&define.amd?define("masonry/masonry",["outlayer/outlayer","get-size/get-size"],e):"object"==typeof exports?module.exports=e(require("outlayer"),require("get-size")):t.masonry=e(t.outlayer,t.getsize)}(window),function(t){function e(t,e){for(var i in e)t[i]=e[i];return t}function i(t,i){var o=t.create("masonry"),n=o.prototype._getelementoffset,r=o.prototype.layout,s=o.prototype._getmeasurement;e(o.prototype,i.prototype),o.prototype._getelementoffset=n,o.prototype.layout=r,o.prototype._getmeasurement=s;var a=o.prototype.measurecolumns;o.prototype.measurecolumns=function(){this.items=this.isotope.filtereditems,a.call(this)};var u=o.prototype._managestamp;return o.prototype._managestamp=function(){this.options.isoriginleft=this.isotope.options.isoriginleft,this.options.isorigintop=this.isotope.options.isorigintop,u.apply(this,arguments)},o}"function"==typeof define&&define.amd?define("isotope/js/layout-modes/masonry",["../layout-mode","masonry/masonry"],i):"object"==typeof exports?module.exports=i(require("../layout-mode"),require("masonry-layout")):i(t.isotope.layoutmode,t.masonry)}(window),function(t){function e(t){var e=t.create("fitrows");return e.prototype._resetlayout=function(){this.x=0,this.y=0,this.maxy=0,this._getmeasurement("gutter","outerwidth")},e.prototype._getitemlayoutposition=function(t){t.getsize();var e=t.size.outerwidth+this.gutter,i=this.isotope.size.innerwidth+this.gutter;0!==this.x&&e+this.x>i&&(this.x=0,this.y=this.maxy);var o={x:this.x,y:this.y};return this.maxy=math.max(this.maxy,this.y+t.size.outerheight),this.x+=e,o},e.prototype._getcontainersize=function(){return{height:this.maxy}},e}"function"==typeof define&&define.amd?define("isotope/js/layout-modes/fit-rows",["../layout-mode"],e):"object"==typeof exports?module.exports=e(require("../layout-mode")):e(t.isotope.layoutmode)}(window),function(t){function e(t){var e=t.create("vertical",{horizontalalignment:0});return e.prototype._resetlayout=function(){this.y=0},e.prototype._getitemlayoutposition=function(t){t.getsize();var e=(this.isotope.size.innerwidth-t.size.outerwidth)*this.options.horizontalalignment,i=this.y;return this.y+=t.size.outerheight,{x:e,y:i}},e.prototype._getcontainersize=function(){return{height:this.y}},e}"function"==typeof define&&define.amd?define("isotope/js/layout-modes/vertical",["../layout-mode"],e):"object"==typeof exports?module.exports=e(require("../layout-mode")):e(t.isotope.layoutmode)}(window),function(t){function e(t,e){for(var i in e)t[i]=e[i];return t}function i(t){return"[object array]"===h.call(t)}function o(t){var e=[];if(i(t))e=t;else if(t&&"number"==typeof t.length)for(var o=0,n=t.length;n>o;o++)e.push(t[o]);else e.push(t);return e}function n(t,e){var i=f(e,t);-1!==i&&e.splice(i,1)}function r(t,i,r,u,h){function f(t,e){return function(i,o){for(var n=0,r=t.length;r>n;n++){var s=t[n],a=i.sortdata[s],u=o.sortdata[s];if(a>u||u>a){var p=void 0!==e[s]?e[s]:e,h=p?1:-1;return(a>u?1:-1)*h}}return 0}}var d=t.create("isotope",{layoutmode:"masonry",isjqueryfiltering:!0,sortascending:!0});d.item=u,d.layoutmode=h,d.prototype._create=function(){this.itemguid=0,this._sorters={},this._getsorters(),t.prototype._create.call(this),this.modes={},this.filtereditems=this.items,this.sorthistory=["original-order"];for(var e in h.modes)this._initlayoutmode(e)},d.prototype.reloaditems=function(){this.itemguid=0,t.prototype.reloaditems.call(this)},d.prototype._itemize=function(){for(var e=t.prototype._itemize.apply(this,arguments),i=0,o=e.length;o>i;i++){var n=e[i];n.id=this.itemguid++}return this._updateitemssortdata(e),e
},d.prototype._initlayoutmode=function(t){var i=h.modes[t],o=this.options[t]||{};this.options[t]=i.options?e(i.options,o):o,this.modes[t]=new i(this)},d.prototype.layout=function(){return!this._islayoutinited&&this.options.isinitlayout?(this.arrange(),void 0):(this._layout(),void 0)},d.prototype._layout=function(){var t=this._getisinstant();this._resetlayout(),this._managestamps(),this.layoutitems(this.filtereditems,t),this._islayoutinited=!0},d.prototype.arrange=function(t){this.option(t),this._getisinstant(),this.filtereditems=this._filter(this.items),this._sort(),this._layout()},d.prototype._init=d.prototype.arrange,d.prototype._getisinstant=function(){var t=void 0!==this.options.islayoutinstant?this.options.islayoutinstant:!this._islayoutinited;return this._isinstant=t,t},d.prototype._filter=function(t){function e(){f.reveal(n),f.hide(r)}var i=this.options.filter;i=i||"*";for(var o=[],n=[],r=[],s=this._getfiltertest(i),a=0,u=t.length;u>a;a++){var p=t[a];if(!p.isignored){var h=s(p);h&&o.push(p),h&&p.ishidden?n.push(p):h||p.ishidden||r.push(p)}}var f=this;return this._isinstant?this._notransition(e):e(),o},d.prototype._getfiltertest=function(t){return s&&this.options.isjqueryfiltering?function(e){return s(e.element).is(t)}:"function"==typeof t?function(e){return t(e.element)}:function(e){return r(e.element,t)}},d.prototype.updatesortdata=function(t){var e;t?(t=o(t),e=this.getitems(t)):e=this.items,this._getsorters(),this._updateitemssortdata(e)},d.prototype._getsorters=function(){var t=this.options.getsortdata;for(var e in t){var i=t[e];this._sorters[e]=l(i)}},d.prototype._updateitemssortdata=function(t){for(var e=t&&t.length,i=0;e&&e>i;i++){var o=t[i];o.updatesortdata()}};var l=function(){function t(t){if("string"!=typeof t)return t;var i=a(t).split(" "),o=i[0],n=o.match(/^\[(.+)\]$/),r=n&&n[1],s=e(r,o),u=d.sortdataparsers[i[1]];return t=u?function(t){return t&&u(s(t))}:function(t){return t&&s(t)}}function e(t,e){var i;return i=t?function(e){return e.getattribute(t)}:function(t){var i=t.queryselector(e);return i&&p(i)}}return t}();d.sortdataparsers={parseint:function(t){return parseint(t,10)},parsefloat:function(t){return parsefloat(t)}},d.prototype._sort=function(){var t=this.options.sortby;if(t){var e=[].concat.apply(t,this.sorthistory),i=f(e,this.options.sortascending);this.filtereditems.sort(i),t!==this.sorthistory[0]&&this.sorthistory.unshift(t)}},d.prototype._mode=function(){var t=this.options.layoutmode,e=this.modes[t];if(!e)throw error("no layout mode: "+t);return e.options=this.options[t],e},d.prototype._resetlayout=function(){t.prototype._resetlayout.call(this),this._mode()._resetlayout()},d.prototype._getitemlayoutposition=function(t){return this._mode()._getitemlayoutposition(t)},d.prototype._managestamp=function(t){this._mode()._managestamp(t)},d.prototype._getcontainersize=function(){return this._mode()._getcontainersize()},d.prototype.needsresizelayout=function(){return this._mode().needsresizelayout()},d.prototype.appended=function(t){var e=this.additems(t);if(e.length){var i=this._filterrevealadded(e);this.filtereditems=this.filtereditems.concat(i)}},d.prototype.prepended=function(t){var e=this._itemize(t);if(e.length){var i=this.items.slice(0);this.items=e.concat(i),this._resetlayout(),this._managestamps();var o=this._filterrevealadded(e);this.layoutitems(i),this.filtereditems=o.concat(this.filtereditems)}},d.prototype._filterrevealadded=function(t){var e=this._notransition(function(){return this._filter(t)});return this.layoutitems(e,!0),this.reveal(e),t},d.prototype.insert=function(t){var e=this.additems(t);if(e.length){var i,o,n=e.length;for(i=0;n>i;i++)o=e[i],this.element.appendchild(o.element);var r=this._filter(e);for(this._notransition(function(){this.hide(r)}),i=0;n>i;i++)e[i].islayoutinstant=!0;for(this.arrange(),i=0;n>i;i++)delete e[i].islayoutinstant;this.reveal(r)}};var c=d.prototype.remove;return d.prototype.remove=function(t){t=o(t);var e=this.getitems(t);if(c.call(this,t),e&&e.length)for(var i=0,r=e.length;r>i;i++){var s=e[i];n(s,this.filtereditems)}},d.prototype.shuffle=function(){for(var t=0,e=this.items.length;e>t;t++){var i=this.items[t];i.sortdata.random=math.random()}this.options.sortby="random",this._sort(),this._layout()},d.prototype._notransition=function(t){var e=this.options.transitionduration;this.options.transitionduration=0;var i=t.call(this);return this.options.transitionduration=e,i},d.prototype.getfiltereditemelements=function(){for(var t=[],e=0,i=this.filtereditems.length;i>e;e++)t.push(this.filtereditems[e].element);return t},d}var s=t.jquery,a=string.prototype.trim?function(t){return t.trim()}:function(t){return t.replace(/^\s+|\s+$/g,"")},u=document.documentelement,p=u.textcontent?function(t){return t.textcontent}:function(t){return t.innertext},h=object.prototype.tostring,f=array.prototype.indexof?function(t,e){return t.indexof(e)}:function(t,e){for(var i=0,o=t.length;o>i;i++)if(t[i]===e)return i;return-1};"function"==typeof define&&define.amd?define(["outlayer/outlayer","get-size/get-size","matches-selector/matches-selector","isotope/js/item","isotope/js/layout-mode","isotope/js/layout-modes/masonry","isotope/js/layout-modes/fit-rows","isotope/js/layout-modes/vertical"],r):"object"==typeof exports?module.exports=r(require("outlayer"),require("get-size"),require("desandro-matches-selector"),require("./item"),require("./layout-mode"),require("./layout-modes/masonry"),require("./layout-modes/fit-rows"),require("./layout-modes/vertical")):t.isotope=r(t.outlayer,t.getsize,t.matchesselector,t.isotope.item,t.isotope.layoutmode)}(window);
/**
* jquery caroufredsel 6.2.1
* demo's and documentation:
* caroufredsel.dev7studios.com
*
* copyright (c) 2013 fred heusschen
* www.frebsite.nl
*
* dual licensed under the mit and gpl licenses.
* http://en.wikipedia.org/wiki/mit_license
* http://en.wikipedia.org/wiki/gnu_general_public_license
*/
(function($){function sc_setscroll(a,b,c){return"transition"==c.transition&&"swing"==b&&(b="ease"),{anims:[],duration:a,orgduration:a,easing:b,starttime:gettime()}}function sc_startscroll(a,b){for(var c=0,d=a.anims.length;d>c;c++){var e=a.anims[c];e&&e[0][b.transition](e[1],a.duration,a.easing,e[2])}}function sc_stopscroll(a,b){is_boolean(b)||(b=!0),is_object(a.pre)&&sc_stopscroll(a.pre,b);for(var c=0,d=a.anims.length;d>c;c++){var e=a.anims[c];e[0].stop(!0),b&&(e[0].css(e[1]),is_function(e[2])&&e[2]())}is_object(a.post)&&sc_stopscroll(a.post,b)}function sc_afterscroll(a,b,c){switch(b&&b.remove(),c.fx){case"fade":case"crossfade":case"cover-fade":case"uncover-fade":a.css("opacity",1),a.css("filter","")}}function sc_firecallbacks(a,b,c,d,e){if(b[c]&&b[c].call(a,d),e[c].length)for(var f=0,g=e[c].length;g>f;f++)e[c][f].call(a,d);return[]}function sc_firequeue(a,b,c){return b.length&&(a.trigger(cf_e(b[0][0],c),b[0][1]),b.shift()),b}function sc_hidehiddenitems(a){a.each(function(){var a=$(this);a.data("_cfs_ishidden",a.is(":hidden")).hide()})}function sc_showhiddenitems(a){a&&a.each(function(){var a=$(this);a.data("_cfs_ishidden")||a.show()})}function sc_cleartimers(a){return a.auto&&cleartimeout(a.auto),a.progress&&clearinterval(a.progress),a}function sc_mapcallbackarguments(a,b,c,d,e,f,g){return{width:g.width,height:g.height,items:{old:a,skipped:b,visible:c},scroll:{items:d,direction:e,duration:f}}}function sc_getduration(a,b,c,d){var e=a.duration;return"none"==a.fx?0:("auto"==e?e=b.scroll.duration/b.scroll.items*c:10>e&&(e=d/e),1>e?0:("fade"==a.fx&&(e/=2),math.round(e)))}function nv_shownavi(a,b,c){var d=is_number(a.items.minimum)?a.items.minimum:a.items.visible+1;if("show"==b||"hide"==b)var e=b;else if(d>b){debug(c,"not enough items ("+b+" total, "+d+" needed): hiding navigation.");var e="hide"}else var e="show";var f="show"==e?"removeclass":"addclass",g=cf_c("hidden",c);a.auto.button&&a.auto.button[e]()[f](g),a.prev.button&&a.prev.button[e]()[f](g),a.next.button&&a.next.button[e]()[f](g),a.pagination.container&&a.pagination.container[e]()[f](g)}function nv_enablenavi(a,b,c){if(!a.circular&&!a.infinite){var d="removeclass"==b||"addclass"==b?b:!1,e=cf_c("disabled",c);if(a.auto.button&&d&&a.auto.button[d](e),a.prev.button){var f=d||0==b?"addclass":"removeclass";a.prev.button[f](e)}if(a.next.button){var f=d||b==a.items.visible?"addclass":"removeclass";a.next.button[f](e)}}}function go_getobject(a,b){return is_function(b)?b=b.call(a):is_undefined(b)&&(b={}),b}function go_getitemsobject(a,b){return b=go_getobject(a,b),is_number(b)?b={visible:b}:"variable"==b?b={visible:b,width:b,height:b}:is_object(b)||(b={}),b}function go_getscrollobject(a,b){return b=go_getobject(a,b),is_number(b)?b=50>=b?{items:b}:{duration:b}:is_string(b)?b={easing:b}:is_object(b)||(b={}),b}function go_getnaviobject(a,b){if(b=go_getobject(a,b),is_string(b)){var c=cf_getkeycode(b);b=-1==c?$(b):c}return b}function go_getautoobject(a,b){return b=go_getnaviobject(a,b),is_jquery(b)?b={button:b}:is_boolean(b)?b={play:b}:is_number(b)&&(b={timeoutduration:b}),b.progress&&(is_string(b.progress)||is_jquery(b.progress))&&(b.progress={bar:b.progress}),b}function go_complementautoobject(a,b){return is_function(b.button)&&(b.button=b.button.call(a)),is_string(b.button)&&(b.button=$(b.button)),is_boolean(b.play)||(b.play=!0),is_number(b.delay)||(b.delay=0),is_undefined(b.pauseonevent)&&(b.pauseonevent=!0),is_boolean(b.pauseonresize)||(b.pauseonresize=!0),is_number(b.timeoutduration)||(b.timeoutduration=10>b.duration?2500:5*b.duration),b.progress&&(is_function(b.progress.bar)&&(b.progress.bar=b.progress.bar.call(a)),is_string(b.progress.bar)&&(b.progress.bar=$(b.progress.bar)),b.progress.bar?(is_function(b.progress.updater)||(b.progress.updater=$.fn.caroufredsel.progressbarupdater),is_number(b.progress.interval)||(b.progress.interval=50)):b.progress=!1),b}function go_getprevnextobject(a,b){return b=go_getnaviobject(a,b),is_jquery(b)?b={button:b}:is_number(b)&&(b={key:b}),b}function go_complementprevnextobject(a,b){return is_function(b.button)&&(b.button=b.button.call(a)),is_string(b.button)&&(b.button=$(b.button)),is_string(b.key)&&(b.key=cf_getkeycode(b.key)),b}function go_getpaginationobject(a,b){return b=go_getnaviobject(a,b),is_jquery(b)?b={container:b}:is_boolean(b)&&(b={keys:b}),b}function go_complementpaginationobject(a,b){return is_function(b.container)&&(b.container=b.container.call(a)),is_string(b.container)&&(b.container=$(b.container)),is_number(b.items)||(b.items=!1),is_boolean(b.keys)||(b.keys=!1),is_function(b.anchorbuilder)||is_false(b.anchorbuilder)||(b.anchorbuilder=$.fn.caroufredsel.pageanchorbuilder),is_number(b.deviation)||(b.deviation=0),b}function go_getswipeobject(a,b){return is_function(b)&&(b=b.call(a)),is_undefined(b)&&(b={ontouch:!1}),is_true(b)?b={ontouch:b}:is_number(b)&&(b={items:b}),b}function go_complementswipeobject(a,b){return is_boolean(b.ontouch)||(b.ontouch=!0),is_boolean(b.onmouse)||(b.onmouse=!1),is_object(b.options)||(b.options={}),is_boolean(b.options.triggerontouchend)||(b.options.triggerontouchend=!1),b}function go_getmousewheelobject(a,b){return is_function(b)&&(b=b.call(a)),is_true(b)?b={}:is_number(b)?b={items:b}:is_undefined(b)&&(b=!1),b}function go_complementmousewheelobject(a,b){return b}function gn_getitemindex(a,b,c,d,e){if(is_string(a)&&(a=$(a,e)),is_object(a)&&(a=$(a,e)),is_jquery(a)?(a=e.children().index(a),is_boolean(c)||(c=!1)):is_boolean(c)||(c=!0),is_number(a)||(a=0),is_number(b)||(b=0),c&&(a+=d.first),a+=b,d.total>0){for(;a>=d.total;)a-=d.total;for(;0>a;)a+=d.total}return a}function gn_getvisibleitemsprev(a,b,c){for(var d=0,e=0,f=c;f>=0;f--){var g=a.eq(f);if(d+=g.is(":visible")?g[b.d.outerwidth](!0):0,d>b.maxdimension)return e;0==f&&(f=a.length),e++}}function gn_getvisibleitemsprevfilter(a,b,c){return gn_getitemsprevfilter(a,b.items.filter,b.items.visibleconf.org,c)}function gn_getscrollitemsprevfilter(a,b,c,d){return gn_getitemsprevfilter(a,b.items.filter,d,c)}function gn_getitemsprevfilter(a,b,c,d){for(var e=0,f=0,g=d,h=a.length;g>=0;g--){if(f++,f==h)return f;var i=a.eq(g);if(i.is(b)&&(e++,e==c))return f;0==g&&(g=h)}}function gn_getvisibleorg(a,b){return b.items.visibleconf.org||a.children().slice(0,b.items.visible).filter(b.items.filter).length}function gn_getvisibleitemsnext(a,b,c){for(var d=0,e=0,f=c,g=a.length-1;g>=f;f++){var h=a.eq(f);if(d+=h.is(":visible")?h[b.d.outerwidth](!0):0,d>b.maxdimension)return e;if(e++,e==g+1)return e;f==g&&(f=-1)}}function gn_getvisibleitemsnexttestcircular(a,b,c,d){var e=gn_getvisibleitemsnext(a,b,c);return b.circular||c+e>d&&(e=d-c),e}function gn_getvisibleitemsnextfilter(a,b,c){return gn_getitemsnextfilter(a,b.items.filter,b.items.visibleconf.org,c,b.circular)}function gn_getscrollitemsnextfilter(a,b,c,d){return gn_getitemsnextfilter(a,b.items.filter,d+1,c,b.circular)-1}function gn_getitemsnextfilter(a,b,c,d){for(var f=0,g=0,h=d,i=a.length-1;i>=h;h++){if(g++,g>=i)return g;var j=a.eq(h);if(j.is(b)&&(f++,f==c))return g;h==i&&(h=-1)}}function gi_getcurrentitems(a,b){return a.slice(0,b.items.visible)}function gi_getolditemsprev(a,b,c){return a.slice(c,b.items.visibleconf.old+c)}function gi_getnewitemsprev(a,b){return a.slice(0,b.items.visible)}function gi_getolditemsnext(a,b){return a.slice(0,b.items.visibleconf.old)}function gi_getnewitemsnext(a,b,c){return a.slice(c,b.items.visible+c)}function sz_storemargin(a,b,c){b.usepadding&&(is_string(c)||(c="_cfs_origcssmargin"),a.each(function(){var a=$(this),d=parseint(a.css(b.d.marginright),10);is_number(d)||(d=0),a.data(c,d)}))}function sz_resetmargin(a,b,c){if(b.usepadding){var d=is_boolean(c)?c:!1;is_number(c)||(c=0),sz_storemargin(a,b,"_cfs_tempcssmargin"),a.each(function(){var a=$(this);a.css(b.d.marginright,d?a.data("_cfs_tempcssmargin"):c+a.data("_cfs_origcssmargin"))})}}function sz_storeorigcss(a){a.each(function(){var a=$(this);a.data("_cfs_origcss",a.attr("style")||"")})}function sz_restoreorigcss(a){a.each(function(){var a=$(this);a.attr("style",a.data("_cfs_origcss")||"")})}function sz_setresponsivesizes(a,b){var d=(a.items.visible,a.items[a.d.width]),e=a[a.d.height],f=is_percentage(e);b.each(function(){var b=$(this),c=d-ms_getpaddingbordermargin(b,a,"width");b[a.d.width](c),f&&b[a.d.height](ms_getpercentage(c,e))})}function sz_setsizes(a,b){var c=a.parent(),d=a.children(),e=gi_getcurrentitems(d,b),f=cf_mapwrappersizes(ms_getsizes(e,b,!0),b,!1);if(c.css(f),b.usepadding){var g=b.padding,h=g[b.d[1]];b.align&&0>h&&(h=0);var i=e.last();i.css(b.d.marginright,i.data("_cfs_origcssmargin")+h),a.css(b.d.top,g[b.d[0]]),a.css(b.d.left,g[b.d[3]])}return a.css(b.d.width,f[b.d.width]+2*ms_gettotalsize(d,b,"width")),a.css(b.d.height,ms_getlargestsize(d,b,"height")),f}function ms_getsizes(a,b,c){return[ms_gettotalsize(a,b,"width",c),ms_getlargestsize(a,b,"height",c)]}function ms_getlargestsize(a,b,c,d){return is_boolean(d)||(d=!1),is_number(b[b.d[c]])&&d?b[b.d[c]]:is_number(b.items[b.d[c]])?b.items[b.d[c]]:(c=c.tolowercase().indexof("width")>-1?"outerwidth":"outerheight",ms_gettruelargestsize(a,b,c))}function ms_gettruelargestsize(a,b,c){for(var d=0,e=0,f=a.length;f>e;e++){var g=a.eq(e),h=g.is(":visible")?g[b.d[c]](!0):0;h>d&&(d=h)}return d}function ms_gettotalsize(a,b,c,d){if(is_boolean(d)||(d=!1),is_number(b[b.d[c]])&&d)return b[b.d[c]];if(is_number(b.items[b.d[c]]))return b.items[b.d[c]]*a.length;for(var e=c.tolowercase().indexof("width")>-1?"outerwidth":"outerheight",f=0,g=0,h=a.length;h>g;g++){var i=a.eq(g);f+=i.is(":visible")?i[b.d[e]](!0):0}return f}function ms_getparentsize(a,b,c){var d=a.is(":visible");d&&a.hide();var e=a.parent()[b.d[c]]();return d&&a.show(),e}function ms_getmaxdimension(a,b){return is_number(a[a.d.width])?a[a.d.width]:b}function ms_hasvariablesizes(a,b,c){for(var d=!1,e=!1,f=0,g=a.length;g>f;f++){var h=a.eq(f),i=h.is(":visible")?h[b.d[c]](!0):0;d===!1?d=i:d!=i&&(e=!0),0==d&&(e=!0)}return e}function ms_getpaddingbordermargin(a,b,c){return a[b.d["outer"+c]](!0)-a[b.d[c.tolowercase()]]()}function ms_getpercentage(a,b){if(is_percentage(b)){if(b=parseint(b.slice(0,-1),10),!is_number(b))return a;a*=b/100}return a}function cf_e(a,b,c,d,e){return is_boolean(c)||(c=!0),is_boolean(d)||(d=!0),is_boolean(e)||(e=!1),c&&(a=b.events.prefix+a),d&&(a=a+"."+b.events.namespace),d&&e&&(a+=b.serialnumber),a}function cf_c(a,b){return is_string(b.classnames[a])?b.classnames[a]:a}function cf_mapwrappersizes(a,b,c){is_boolean(c)||(c=!0);var d=b.usepadding&&c?b.padding:[0,0,0,0],e={};return e[b.d.width]=a[0]+d[1]+d[3],e[b.d.height]=a[1]+d[0]+d[2],e}function cf_sortparams(a,b){for(var c=[],d=0,e=a.length;e>d;d++)for(var f=0,g=b.length;g>f;f++)if(b[f].indexof(typeof a[d])>-1&&is_undefined(c[f])){c[f]=a[d];break}return c}function cf_getpadding(a){if(is_undefined(a))return[0,0,0,0];if(is_number(a))return[a,a,a,a];if(is_string(a)&&(a=a.split("px").join("").split("em").join("").split(" ")),!is_array(a))return[0,0,0,0];for(var b=0;4>b;b++)a[b]=parseint(a[b],10);switch(a.length){case 0:return[0,0,0,0];case 1:return[a[0],a[0],a[0],a[0]];case 2:return[a[0],a[1],a[0],a[1]];case 3:return[a[0],a[1],a[2],a[1]];default:return[a[0],a[1],a[2],a[3]]}}function cf_getalignpadding(a,b){var c=is_number(b[b.d.width])?math.ceil(b[b.d.width]-ms_gettotalsize(a,b,"width")):0;switch(b.align){case"left":return[0,c];case"right":return[c,0];case"center":default:return[math.ceil(c/2),math.floor(c/2)]}}function cf_getdimensions(a){for(var b=[["width","innerwidth","outerwidth","height","innerheight","outerheight","left","top","marginright",0,1,2,3],["height","innerheight","outerheight","width","innerwidth","outerwidth","top","left","marginbottom",3,2,1,0]],c=b[0].length,d="right"==a.direction||"left"==a.direction?0:1,e={},f=0;c>f;f++)e[b[0][f]]=b[d][f];return e}function cf_getadjust(a,b,c,d){var e=a;if(is_function(c))e=c.call(d,e);else if(is_string(c)){var f=c.split("+"),g=c.split("-");if(g.length>f.length)var h=!0,i=g[0],j=g[1];else var h=!1,i=f[0],j=f[1];switch(i){case"even":e=1==a%2?a-1:a;break;case"odd":e=0==a%2?a-1:a;break;default:e=a}j=parseint(j,10),is_number(j)&&(h&&(j=-j),e+=j)}return(!is_number(e)||1>e)&&(e=1),e}function cf_getitemsadjust(a,b,c,d){return cf_getitemadjustminmax(cf_getadjust(a,b,c,d),b.items.visibleconf)}function cf_getitemadjustminmax(a,b){return is_number(b.min)&&b.min>a&&(a=b.min),is_number(b.max)&&a>b.max&&(a=b.max),1>a&&(a=1),a}function cf_getsyncharr(a){is_array(a)||(a=[[a]]),is_array(a[0])||(a=[a]);for(var b=0,c=a.length;c>b;b++)is_string(a[b][0])&&(a[b][0]=$(a[b][0])),is_boolean(a[b][1])||(a[b][1]=!0),is_boolean(a[b][2])||(a[b][2]=!0),is_number(a[b][3])||(a[b][3]=0);return a}function cf_getkeycode(a){return"right"==a?39:"left"==a?37:"up"==a?38:"down"==a?40:-1}function cf_setcookie(a,b,c){if(a){var d=b.triggerhandler(cf_e("currentposition",c));$.fn.caroufredsel.cookie.set(a,d)}}function cf_getcookie(a){var b=$.fn.caroufredsel.cookie.get(a);return""==b?0:b}function in_mapcss(a,b){for(var c={},d=0,e=b.length;e>d;d++)c[b[d]]=a.css(b[d]);return c}function in_complementitems(a,b,c,d){return is_object(a.visibleconf)||(a.visibleconf={}),is_object(a.sizesconf)||(a.sizesconf={}),0==a.start&&is_number(d)&&(a.start=d),is_object(a.visible)?(a.visibleconf.min=a.visible.min,a.visibleconf.max=a.visible.max,a.visible=!1):is_string(a.visible)?("variable"==a.visible?a.visibleconf.variable=!0:a.visibleconf.adjust=a.visible,a.visible=!1):is_function(a.visible)&&(a.visibleconf.adjust=a.visible,a.visible=!1),is_string(a.filter)||(a.filter=c.filter(":hidden").length>0?":visible":"*"),a[b.d.width]||(b.responsive?(debug(!0,"set a "+b.d.width+" for the items!"),a[b.d.width]=ms_gettruelargestsize(c,b,"outerwidth")):a[b.d.width]=ms_hasvariablesizes(c,b,"outerwidth")?"variable":c[b.d.outerwidth](!0)),a[b.d.height]||(a[b.d.height]=ms_hasvariablesizes(c,b,"outerheight")?"variable":c[b.d.outerheight](!0)),a.sizesconf.width=a.width,a.sizesconf.height=a.height,a}function in_complementvisibleitems(a,b){return"variable"==a.items[a.d.width]&&(a.items.visibleconf.variable=!0),a.items.visibleconf.variable||(is_number(a[a.d.width])?a.items.visible=math.floor(a[a.d.width]/a.items[a.d.width]):(a.items.visible=math.floor(b/a.items[a.d.width]),a[a.d.width]=a.items.visible*a.items[a.d.width],a.items.visibleconf.adjust||(a.align=!1)),("infinity"==a.items.visible||1>a.items.visible)&&(debug(!0,'not a valid number of visible items: set to "variable".'),a.items.visibleconf.variable=!0)),a}function in_complementprimarysize(a,b,c){return"auto"==a&&(a=ms_gettruelargestsize(c,b,"outerwidth")),a}function in_complementsecondarysize(a,b,c){return"auto"==a&&(a=ms_gettruelargestsize(c,b,"outerheight")),a||(a=b.items[b.d.height]),a}function in_getalignpadding(a,b){var c=cf_getalignpadding(gi_getcurrentitems(b,a),a);return a.padding[a.d[1]]=c[1],a.padding[a.d[3]]=c[0],a}function in_getresponsivevalues(a,b){var d=cf_getitemadjustminmax(math.ceil(a[a.d.width]/a.items[a.d.width]),a.items.visibleconf);d>b.length&&(d=b.length);var e=math.floor(a[a.d.width]/d);return a.items.visible=d,a.items[a.d.width]=e,a[a.d.width]=d*e,a}function bt_pauseonhoverconfig(a){if(is_string(a))var b=a.indexof("immediate")>-1?!0:!1,c=a.indexof("resume")>-1?!0:!1;else var b=c=!1;return[b,c]}function bt_mousesheelnumber(a){return is_number(a)?a:null}function is_null(a){return null===a}function is_undefined(a){return is_null(a)||a===void 0||""===a||"undefined"===a}function is_array(a){return a instanceof array}function is_jquery(a){return a instanceof jquery}function is_object(a){return(a instanceof object||"object"==typeof a)&&!is_null(a)&&!is_jquery(a)&&!is_array(a)&&!is_function(a)}function is_number(a){return(a instanceof number||"number"==typeof a)&&!isnan(a)}function is_string(a){return(a instanceof string||"string"==typeof a)&&!is_undefined(a)&&!is_true(a)&&!is_false(a)}function is_function(a){return a instanceof function||"function"==typeof a}function is_boolean(a){return a instanceof boolean||"boolean"==typeof a||is_true(a)||is_false(a)}function is_true(a){return a===!0||"true"===a}function is_false(a){return a===!1||"false"===a}function is_percentage(a){return is_string(a)&&"%"==a.slice(-1)}function gettime(){return(new date).gettime()}function deprecated(a,b){debug(!0,a+" is deprecated, support for it will be removed. use "+b+" instead.")}function debug(a,b){if(!is_undefined(window.console)&&!is_undefined(window.console.log)){if(is_object(a)){var c=" ("+a.selector+")";a=a.debug}else var c="";if(!a)return!1;b=is_string(b)?"caroufredsel"+c+": "+b:["caroufredsel"+c+":",b],window.console.log(b)}return!1}$.fn.caroufredsel||($.fn.caroufredsel=$.fn.caroufredsel=function(options,configs){if(0==this.length)return debug(!0,'no element found for "'+this.selector+'".'),this;if(this.length>1)return this.each(function(){$(this).caroufredsel(options,configs)});var $cfs=this,$tt0=this[0],starting_position=!1;$cfs.data("_cfs_iscarousel")&&(starting_position=$cfs.triggerhandler("_cfs_triggerevent","currentposition"),$cfs.trigger("_cfs_triggerevent",["destroy",!0]));var fn={};fn._init=function(a,b,c){a=go_getobject($tt0,a),a.items=go_getitemsobject($tt0,a.items),a.scroll=go_getscrollobject($tt0,a.scroll),a.auto=go_getautoobject($tt0,a.auto),a.prev=go_getprevnextobject($tt0,a.prev),a.next=go_getprevnextobject($tt0,a.next),a.pagination=go_getpaginationobject($tt0,a.pagination),a.swipe=go_getswipeobject($tt0,a.swipe),a.mousewheel=go_getmousewheelobject($tt0,a.mousewheel),b&&(opts_orig=$.extend(!0,{},$.fn.caroufredsel.defaults,a)),opts=$.extend(!0,{},$.fn.caroufredsel.defaults,a),opts.d=cf_getdimensions(opts),crsl.direction="up"==opts.direction||"left"==opts.direction?"next":"prev";var d=$cfs.children(),e=ms_getparentsize($wrp,opts,"width");if(is_true(opts.cookie)&&(opts.cookie="caroufredsel_cookie_"+conf.serialnumber),opts.maxdimension=ms_getmaxdimension(opts,e),opts.items=in_complementitems(opts.items,opts,d,c),opts[opts.d.width]=in_complementprimarysize(opts[opts.d.width],opts,d),opts[opts.d.height]=in_complementsecondarysize(opts[opts.d.height],opts,d),opts.responsive&&(is_percentage(opts[opts.d.width])||(opts[opts.d.width]="100%")),is_percentage(opts[opts.d.width])&&(crsl.updateonwindowresize=!0,crsl.primarysizepercentage=opts[opts.d.width],opts[opts.d.width]=ms_getpercentage(e,crsl.primarysizepercentage),opts.items.visible||(opts.items.visibleconf.variable=!0)),opts.responsive?(opts.usepadding=!1,opts.padding=[0,0,0,0],opts.align=!1,opts.items.visibleconf.variable=!1):(opts.items.visible||(opts=in_complementvisibleitems(opts,e)),opts[opts.d.width]||(!opts.items.visibleconf.variable&&is_number(opts.items[opts.d.width])&&"*"==opts.items.filter?(opts[opts.d.width]=opts.items.visible*opts.items[opts.d.width],opts.align=!1):opts[opts.d.width]="variable"),is_undefined(opts.align)&&(opts.align=is_number(opts[opts.d.width])?"center":!1),opts.items.visibleconf.variable&&(opts.items.visible=gn_getvisibleitemsnext(d,opts,0))),"*"==opts.items.filter||opts.items.visibleconf.variable||(opts.items.visibleconf.org=opts.items.visible,opts.items.visible=gn_getvisibleitemsnextfilter(d,opts,0)),opts.items.visible=cf_getitemsadjust(opts.items.visible,opts,opts.items.visibleconf.adjust,$tt0),opts.items.visibleconf.old=opts.items.visible,opts.responsive)opts.items.visibleconf.min||(opts.items.visibleconf.min=opts.items.visible),opts.items.visibleconf.max||(opts.items.visibleconf.max=opts.items.visible),opts=in_getresponsivevalues(opts,d,e);else switch(opts.padding=cf_getpadding(opts.padding),"top"==opts.align?opts.align="left":"bottom"==opts.align&&(opts.align="right"),opts.align){case"center":case"left":case"right":"variable"!=opts[opts.d.width]&&(opts=in_getalignpadding(opts,d),opts.usepadding=!0);break;default:opts.align=!1,opts.usepadding=0==opts.padding[0]&&0==opts.padding[1]&&0==opts.padding[2]&&0==opts.padding[3]?!1:!0}is_number(opts.scroll.duration)||(opts.scroll.duration=500),is_undefined(opts.scroll.items)&&(opts.scroll.items=opts.responsive||opts.items.visibleconf.variable||"*"!=opts.items.filter?"visible":opts.items.visible),opts.auto=$.extend(!0,{},opts.scroll,opts.auto),opts.prev=$.extend(!0,{},opts.scroll,opts.prev),opts.next=$.extend(!0,{},opts.scroll,opts.next),opts.pagination=$.extend(!0,{},opts.scroll,opts.pagination),opts.auto=go_complementautoobject($tt0,opts.auto),opts.prev=go_complementprevnextobject($tt0,opts.prev),opts.next=go_complementprevnextobject($tt0,opts.next),opts.pagination=go_complementpaginationobject($tt0,opts.pagination),opts.swipe=go_complementswipeobject($tt0,opts.swipe),opts.mousewheel=go_complementmousewheelobject($tt0,opts.mousewheel),opts.synchronise&&(opts.synchronise=cf_getsyncharr(opts.synchronise)),opts.auto.onpausestart&&(opts.auto.ontimeoutstart=opts.auto.onpausestart,deprecated("auto.onpausestart","auto.ontimeoutstart")),opts.auto.onpausepause&&(opts.auto.ontimeoutpause=opts.auto.onpausepause,deprecated("auto.onpausepause","auto.ontimeoutpause")),opts.auto.onpauseend&&(opts.auto.ontimeoutend=opts.auto.onpauseend,deprecated("auto.onpauseend","auto.ontimeoutend")),opts.auto.pauseduration&&(opts.auto.timeoutduration=opts.auto.pauseduration,deprecated("auto.pauseduration","auto.timeoutduration"))},fn._build=function(){$cfs.data("_cfs_iscarousel",!0);var a=$cfs.children(),b=in_mapcss($cfs,["textalign","float","position","top","right","bottom","left","zindex","width","height","margintop","marginright","marginbottom","marginleft"]),c="relative";switch(b.position){case"absolute":case"fixed":c=b.position}"parent"==conf.wrapper?sz_storeorigcss($wrp):$wrp.css(b),$wrp.css({overflow:"hidden",position:c}),sz_storeorigcss($cfs),$cfs.data("_cfs_origcsszindex",b.zindex),$cfs.css({textalign:"left","float":"none",position:"absolute",top:0,right:"auto",bottom:"auto",left:0,margintop:0,marginright:0,marginbottom:0,marginleft:0}),sz_storemargin(a,opts),sz_storeorigcss(a),opts.responsive&&sz_setresponsivesizes(opts,a)},fn._bind_events=function(){fn._unbind_events(),$cfs.bind(cf_e("stop",conf),function(a,b){return a.stoppropagation(),crsl.isstopped||opts.auto.button&&opts.auto.button.addclass(cf_c("stopped",conf)),crsl.isstopped=!0,opts.auto.play&&(opts.auto.play=!1,$cfs.trigger(cf_e("pause",conf),b)),!0}),$cfs.bind(cf_e("finish",conf),function(a){return a.stoppropagation(),crsl.isscrolling&&sc_stopscroll(scrl),!0}),$cfs.bind(cf_e("pause",conf),function(a,b,c){if(a.stoppropagation(),tmrs=sc_cleartimers(tmrs),b&&crsl.isscrolling){scrl.isstopped=!0;var d=gettime()-scrl.starttime;scrl.duration-=d,scrl.pre&&(scrl.pre.duration-=d),scrl.post&&(scrl.post.duration-=d),sc_stopscroll(scrl,!1)}if(crsl.ispaused||crsl.isscrolling||c&&(tmrs.timepassed+=gettime()-tmrs.starttime),crsl.ispaused||opts.auto.button&&opts.auto.button.addclass(cf_c("paused",conf)),crsl.ispaused=!0,opts.auto.ontimeoutpause){var e=opts.auto.timeoutduration-tmrs.timepassed,f=100-math.ceil(100*e/opts.auto.timeoutduration);opts.auto.ontimeoutpause.call($tt0,f,e)}return!0}),$cfs.bind(cf_e("play",conf),function(a,b,c,d){a.stoppropagation(),tmrs=sc_cleartimers(tmrs);var e=[b,c,d],f=["string","number","boolean"],g=cf_sortparams(e,f);if(b=g[0],c=g[1],d=g[2],"prev"!=b&&"next"!=b&&(b=crsl.direction),is_number(c)||(c=0),is_boolean(d)||(d=!1),d&&(crsl.isstopped=!1,opts.auto.play=!0),!opts.auto.play)return a.stopimmediatepropagation(),debug(conf,"carousel stopped: not scrolling.");crsl.ispaused&&opts.auto.button&&(opts.auto.button.removeclass(cf_c("stopped",conf)),opts.auto.button.removeclass(cf_c("paused",conf))),crsl.ispaused=!1,tmrs.starttime=gettime();var h=opts.auto.timeoutduration+c;return dur2=h-tmrs.timepassed,perc=100-math.ceil(100*dur2/h),opts.auto.progress&&(tmrs.progress=setinterval(function(){var a=gettime()-tmrs.starttime+tmrs.timepassed,b=math.ceil(100*a/h);opts.auto.progress.updater.call(opts.auto.progress.bar[0],b)},opts.auto.progress.interval)),tmrs.auto=settimeout(function(){opts.auto.progress&&opts.auto.progress.updater.call(opts.auto.progress.bar[0],100),opts.auto.ontimeoutend&&opts.auto.ontimeoutend.call($tt0,perc,dur2),crsl.isscrolling?$cfs.trigger(cf_e("play",conf),b):$cfs.trigger(cf_e(b,conf),opts.auto)},dur2),opts.auto.ontimeoutstart&&opts.auto.ontimeoutstart.call($tt0,perc,dur2),!0}),$cfs.bind(cf_e("resume",conf),function(a){return a.stoppropagation(),scrl.isstopped?(scrl.isstopped=!1,crsl.ispaused=!1,crsl.isscrolling=!0,scrl.starttime=gettime(),sc_startscroll(scrl,conf)):$cfs.trigger(cf_e("play",conf)),!0}),$cfs.bind(cf_e("prev",conf)+" "+cf_e("next",conf),function(a,b,c,d,e){if(a.stoppropagation(),crsl.isstopped||$cfs.is(":hidden"))return a.stopimmediatepropagation(),debug(conf,"carousel stopped or hidden: not scrolling.");var f=is_number(opts.items.minimum)?opts.items.minimum:opts.items.visible+1;if(f>itms.total)return a.stopimmediatepropagation(),debug(conf,"not enough items ("+itms.total+" total, "+f+" needed): not scrolling.");var g=[b,c,d,e],h=["object","number/string","function","boolean"],i=cf_sortparams(g,h);b=i[0],c=i[1],d=i[2],e=i[3];var j=a.type.slice(conf.events.prefix.length);if(is_object(b)||(b={}),is_function(d)&&(b.onafter=d),is_boolean(e)&&(b.queue=e),b=$.extend(!0,{},opts[j],b),b.conditions&&!b.conditions.call($tt0,j))return a.stopimmediatepropagation(),debug(conf,'callback "conditions" returned false.');if(!is_number(c)){if("*"!=opts.items.filter)c="visible";else for(var k=[c,b.items,opts[j].items],i=0,l=k.length;l>i;i++)if(is_number(k[i])||"page"==k[i]||"visible"==k[i]){c=k[i];break}switch(c){case"page":return a.stopimmediatepropagation(),$cfs.triggerhandler(cf_e(j+"page",conf),[b,d]);case"visible":opts.items.visibleconf.variable||"*"!=opts.items.filter||(c=opts.items.visible)}}if(scrl.isstopped)return $cfs.trigger(cf_e("resume",conf)),$cfs.trigger(cf_e("queue",conf),[j,[b,c,d]]),a.stopimmediatepropagation(),debug(conf,"carousel resumed scrolling.");if(b.duration>0&&crsl.isscrolling)return b.queue&&("last"==b.queue&&(queu=[]),("first"!=b.queue||0==queu.length)&&$cfs.trigger(cf_e("queue",conf),[j,[b,c,d]])),a.stopimmediatepropagation(),debug(conf,"carousel currently scrolling.");if(tmrs.timepassed=0,$cfs.trigger(cf_e("slide_"+j,conf),[b,c]),opts.synchronise)for(var m=opts.synchronise,n=[b,c],o=0,l=m.length;l>o;o++){var p=j;m[o][2]||(p="prev"==p?"next":"prev"),m[o][1]||(n[0]=m[o][0].triggerhandler("_cfs_triggerevent",["configuration",p])),n[1]=c+m[o][3],m[o][0].trigger("_cfs_triggerevent",["slide_"+p,n])}return!0}),$cfs.bind(cf_e("slide_prev",conf),function(a,b,c){a.stoppropagation();var d=$cfs.children();if(!opts.circular&&0==itms.first)return opts.infinite&&$cfs.trigger(cf_e("next",conf),itms.total-1),a.stopimmediatepropagation();if(sz_resetmargin(d,opts),!is_number(c)){if(opts.items.visibleconf.variable)c=gn_getvisibleitemsprev(d,opts,itms.total-1);else if("*"!=opts.items.filter){var e=is_number(b.items)?b.items:gn_getvisibleorg($cfs,opts);c=gn_getscrollitemsprevfilter(d,opts,itms.total-1,e)}else c=opts.items.visible;c=cf_getadjust(c,opts,b.items,$tt0)}if(opts.circular||itms.total-c=opts.items.visible+c&&itms.total>c&&(c++,f=cf_getitemsadjust(gn_getvisibleitemsnext(d,opts,itms.total-c),opts,opts.items.visibleconf.adjust,$tt0)),opts.items.visible=f}else if("*"!=opts.items.filter){var f=gn_getvisibleitemsnextfilter(d,opts,itms.total-c);opts.items.visible=cf_getitemsadjust(f,opts,opts.items.visibleconf.adjust,$tt0)}if(sz_resetmargin(d,opts,!0),0==c)return a.stopimmediatepropagation(),debug(conf,"0 items to scroll: not scrolling.");for(debug(conf,"scrolling "+c+" items backward."),itms.first+=c;itms.first>=itms.total;)itms.first-=itms.total;opts.circular||(0==itms.first&&b.onend&&b.onend.call($tt0,"prev"),opts.infinite||nv_enablenavi(opts,itms.first,conf)),$cfs.children().slice(itms.total-c,itms.total).prependto($cfs),itms.totall?opts.padding[opts.d[3]]:0,p=!1,q=$();if(c>opts.items.visible&&(q=d.slice(opts.items.visibleconf.old,c),"directscroll"==b.fx)){var r=opts.items[opts.d.width];p=q,i=k,sc_hidehiddenitems(p),opts.items[opts.d.width]="variable"}var s=!1,t=ms_gettotalsize(d.slice(0,c),opts,"width"),u=cf_mapwrappersizes(ms_getsizes(h,opts,!0),opts,!opts.usepadding),v=0,w={},x={},y={},z={},a={},b={},c={},d=sc_getduration(b,opts,c,t);switch(b.fx){case"cover":case"cover-fade":v=ms_gettotalsize(d.slice(0,opts.items.visible),opts,"width")}p&&(opts.items[opts.d.width]=r),sz_resetmargin(d,opts,!0),m>=0&&sz_resetmargin(j,opts,opts.padding[opts.d[1]]),l>=0&&sz_resetmargin(i,opts,opts.padding[opts.d[3]]),opts.align&&(opts.padding[opts.d[1]]=m,opts.padding[opts.d[3]]=l),b[opts.d.left]=-(t-o),c[opts.d.left]=-(v-o),x[opts.d.left]=u[opts.d.width];var e=function(){},f=function(){},g=function(){},h=function(){},i=function(){},j=function(){},k=function(){},l=function(){},m=function(){},n=function(){},o=function(){};switch(b.fx){case"crossfade":case"cover":case"cover-fade":case"uncover":case"uncover-fade":s=$cfs.clone(!0).appendto($wrp)}switch(b.fx){case"crossfade":case"uncover":case"uncover-fade":s.children().slice(0,c).remove(),s.children().slice(opts.items.visibleconf.old).remove();break;case"cover":case"cover-fade":s.children().slice(opts.items.visible).remove(),s.css(c)}if($cfs.css(b),scrl=sc_setscroll(d,b.easing,conf),w[opts.d.left]=opts.usepadding?opts.padding[opts.d[3]]:0,("variable"==opts[opts.d.width]||"variable"==opts[opts.d.height])&&(e=function(){$wrp.css(u)},f=function(){scrl.anims.push([$wrp,u])}),opts.usepadding){switch(k.not(i).length&&(y[opts.d.marginright]=i.data("_cfs_origcssmargin"),0>l?i.css(y):(k=function(){i.css(y)},l=function(){scrl.anims.push([i,y])})),b.fx){case"cover":case"cover-fade":s.children().eq(c-1).css(y)}k.not(j).length&&(z[opts.d.marginright]=j.data("_cfs_origcssmargin"),g=function(){j.css(z)},h=function(){scrl.anims.push([j,z])}),m>=0&&(a[opts.d.marginright]=k.data("_cfs_origcssmargin")+opts.padding[opts.d[1]],i=function(){k.css(a)},j=function(){scrl.anims.push([k,a])})}o=function(){$cfs.css(w)};var p=opts.items.visible+c-itms.total;n=function(){if(p>0&&($cfs.children().slice(itms.total).remove(),g=$($cfs.children().slice(itms.total-(opts.items.visible-p)).get().concat($cfs.children().slice(0,p).get()))),sc_showhiddenitems(p),opts.usepadding){var a=$cfs.children().eq(opts.items.visible+c-1);a.css(opts.d.marginright,a.data("_cfs_origcssmargin"))}};var q=sc_mapcallbackarguments(g,q,h,c,"prev",d,u);switch(m=function(){sc_afterscroll($cfs,s,b),crsl.isscrolling=!1,clbk.onafter=sc_firecallbacks($tt0,b,"onafter",q,clbk),queu=sc_firequeue($cfs,queu,conf),crsl.ispaused||$cfs.trigger(cf_e("play",conf))},crsl.isscrolling=!0,tmrs=sc_cleartimers(tmrs),clbk.onbefore=sc_firecallbacks($tt0,b,"onbefore",q,clbk),b.fx){case"none":$cfs.css(w),e(),g(),i(),k(),o(),n(),m();break;case"fade":scrl.anims.push([$cfs,{opacity:0},function(){e(),g(),i(),k(),o(),n(),scrl=sc_setscroll(d,b.easing,conf),scrl.anims.push([$cfs,{opacity:1},m]),sc_startscroll(scrl,conf)}]);break;case"crossfade":$cfs.css({opacity:0}),scrl.anims.push([s,{opacity:0}]),scrl.anims.push([$cfs,{opacity:1},m]),f(),g(),i(),k(),o(),n();break;case"cover":scrl.anims.push([s,w,function(){g(),i(),k(),o(),n(),m()}]),f();break;case"cover-fade":scrl.anims.push([$cfs,{opacity:0}]),scrl.anims.push([s,w,function(){g(),i(),k(),o(),n(),m()}]),f();break;case"uncover":scrl.anims.push([s,x,m]),f(),g(),i(),k(),o(),n();break;case"uncover-fade":$cfs.css({opacity:0}),scrl.anims.push([$cfs,{opacity:1}]),scrl.anims.push([s,x,m]),f(),g(),i(),k(),o(),n();break;default:scrl.anims.push([$cfs,w,function(){n(),m()}]),f(),h(),j(),l()}return sc_startscroll(scrl,conf),cf_setcookie(opts.cookie,$cfs,conf),$cfs.trigger(cf_e("updatepagestatus",conf),[!1,u]),!0
}),$cfs.bind(cf_e("slide_next",conf),function(a,b,c){a.stoppropagation();var d=$cfs.children();if(!opts.circular&&itms.first==opts.items.visible)return opts.infinite&&$cfs.trigger(cf_e("prev",conf),itms.total-1),a.stopimmediatepropagation();if(sz_resetmargin(d,opts),!is_number(c)){if("*"!=opts.items.filter){var e=is_number(b.items)?b.items:gn_getvisibleorg($cfs,opts);c=gn_getscrollitemsnextfilter(d,opts,0,e)}else c=opts.items.visible;c=cf_getadjust(c,opts,b.items,$tt0)}var f=0==itms.first?itms.total:itms.first;if(!opts.circular){if(opts.items.visibleconf.variable)var g=gn_getvisibleitemsnext(d,opts,c),e=gn_getvisibleitemsprev(d,opts,f-1);else var g=opts.items.visible,e=opts.items.visible;c+g>f&&(c=f-e)}if(opts.items.visibleconf.old=opts.items.visible,opts.items.visibleconf.variable){for(var g=cf_getitemsadjust(gn_getvisibleitemsnexttestcircular(d,opts,c,f),opts,opts.items.visibleconf.adjust,$tt0);opts.items.visible-c>=g&&itms.total>c;)c++,g=cf_getitemsadjust(gn_getvisibleitemsnexttestcircular(d,opts,c,f),opts,opts.items.visibleconf.adjust,$tt0);opts.items.visible=g}else if("*"!=opts.items.filter){var g=gn_getvisibleitemsnextfilter(d,opts,c);opts.items.visible=cf_getitemsadjust(g,opts,opts.items.visibleconf.adjust,$tt0)}if(sz_resetmargin(d,opts,!0),0==c)return a.stopimmediatepropagation(),debug(conf,"0 items to scroll: not scrolling.");for(debug(conf,"scrolling "+c+" items forward."),itms.first-=c;0>itms.first;)itms.first+=itms.total;opts.circular||(itms.first==opts.items.visible&&b.onend&&b.onend.call($tt0,"next"),opts.infinite||nv_enablenavi(opts,itms.first,conf)),itms.totalopts.items.visibleconf.old&&(q=d.slice(opts.items.visibleconf.old,c),"directscroll"==b.fx)){var r=opts.items[opts.d.width];p=q,j=k,sc_hidehiddenitems(p),opts.items[opts.d.width]="variable"}var s=!1,t=ms_gettotalsize(d.slice(0,c),opts,"width"),u=cf_mapwrappersizes(ms_getsizes(i,opts,!0),opts,!opts.usepadding),v=0,w={},x={},y={},z={},a={},b=sc_getduration(b,opts,c,t);switch(b.fx){case"uncover":case"uncover-fade":v=ms_gettotalsize(d.slice(0,opts.items.visibleconf.old),opts,"width")}p&&(opts.items[opts.d.width]=r),opts.align&&0>opts.padding[opts.d[1]]&&(opts.padding[opts.d[1]]=0),sz_resetmargin(d,opts,!0),sz_resetmargin(k,opts,opts.padding[opts.d[1]]),opts.align&&(opts.padding[opts.d[1]]=n,opts.padding[opts.d[3]]=m),a[opts.d.left]=opts.usepadding?opts.padding[opts.d[3]]:0;var c=function(){},d=function(){},e=function(){},f=function(){},g=function(){},h=function(){},i=function(){},j=function(){},k=function(){};switch(b.fx){case"crossfade":case"cover":case"cover-fade":case"uncover":case"uncover-fade":s=$cfs.clone(!0).appendto($wrp),s.children().slice(opts.items.visibleconf.old).remove()}switch(b.fx){case"crossfade":case"cover":case"cover-fade":$cfs.css("zindex",1),s.css("zindex",0)}if(scrl=sc_setscroll(b,b.easing,conf),w[opts.d.left]=-t,x[opts.d.left]=-v,0>m&&(w[opts.d.left]+=m),("variable"==opts[opts.d.width]||"variable"==opts[opts.d.height])&&(c=function(){$wrp.css(u)},d=function(){scrl.anims.push([$wrp,u])}),opts.usepadding){var l=l.data("_cfs_origcssmargin");n>=0&&(l+=opts.padding[opts.d[1]]),l.css(opts.d.marginright,l),j.not(k).length&&(z[opts.d.marginright]=k.data("_cfs_origcssmargin")),e=function(){k.css(z)},f=function(){scrl.anims.push([k,z])};var m=j.data("_cfs_origcssmargin");m>0&&(m+=opts.padding[opts.d[3]]),y[opts.d.marginright]=m,g=function(){j.css(y)},h=function(){scrl.anims.push([j,y])}}k=function(){$cfs.css(a)};var n=opts.items.visible+c-itms.total;j=function(){n>0&&$cfs.children().slice(itms.total).remove();var a=$cfs.children().slice(0,c).appendto($cfs).last();if(n>0&&(i=gi_getcurrentitems(d,opts)),sc_showhiddenitems(p),opts.usepadding){if(itms.total=b?"next":"prev":0==itms.first||itms.first>b?"next":"prev"),"prev"==f&&(b=itms.total-b),$cfs.trigger(cf_e(f,conf),[e,b,g]),!0)}),$cfs.bind(cf_e("prevpage",conf),function(a,b,c){a.stoppropagation();var d=$cfs.triggerhandler(cf_e("currentpage",conf));return $cfs.triggerhandler(cf_e("slidetopage",conf),[d-1,b,"prev",c])}),$cfs.bind(cf_e("nextpage",conf),function(a,b,c){a.stoppropagation();var d=$cfs.triggerhandler(cf_e("currentpage",conf));return $cfs.triggerhandler(cf_e("slidetopage",conf),[d+1,b,"next",c])}),$cfs.bind(cf_e("slidetopage",conf),function(a,b,c,d,e){a.stoppropagation(),is_number(b)||(b=$cfs.triggerhandler(cf_e("currentpage",conf)));var f=opts.pagination.items||opts.items.visible,g=math.ceil(itms.total/f)-1;return 0>b&&(b=g),b>g&&(b=0),$cfs.triggerhandler(cf_e("slideto",conf),[b*f,0,!0,c,d,e])}),$cfs.bind(cf_e("jumptostart",conf),function(a,b){if(a.stoppropagation(),b=b?gn_getitemindex(b,0,!0,itms,$cfs):0,b+=itms.first,0!=b){if(itms.total>0)for(;b>itms.total;)b-=itms.total;$cfs.prepend($cfs.children().slice(b,itms.total))}return!0}),$cfs.bind(cf_e("synchronise",conf),function(a,b){if(a.stoppropagation(),b)b=cf_getsyncharr(b);else{if(!opts.synchronise)return debug(conf,"no carousel to synchronise.");b=opts.synchronise}for(var c=$cfs.triggerhandler(cf_e("currentposition",conf)),d=!0,e=0,f=b.length;f>e;e++)b[e][0].triggerhandler(cf_e("slideto",conf),[c,b[e][3],!0])||(d=!1);return d}),$cfs.bind(cf_e("queue",conf),function(a,b,c){return a.stoppropagation(),is_function(b)?b.call($tt0,queu):is_array(b)?queu=b:is_undefined(b)||queu.push([b,c]),queu}),$cfs.bind(cf_e("insertitem",conf),function(a,b,c,d,e){a.stoppropagation();var f=[b,c,d,e],g=["string/object","string/number/object","boolean","number"],h=cf_sortparams(f,g);if(b=h[0],c=h[1],d=h[2],e=h[3],is_object(b)&&!is_jquery(b)?b=$(b):is_string(b)&&(b=$(b)),!is_jquery(b)||0==b.length)return debug(conf,"not a valid object.");is_undefined(c)&&(c="end"),sz_storemargin(b,opts),sz_storeorigcss(b);var i=c,j="before";"end"==c?d?(0==itms.first?(c=itms.total-1,j="after"):(c=itms.first,itms.first+=b.length),0>c&&(c=0)):(c=itms.total-1,j="after"):c=gn_getitemindex(c,e,d,itms,$cfs);var k=$cfs.children().eq(c);return k.length?k[j](b):(debug(conf,"correct insert-position not found! appending item to the end."),$cfs.append(b)),"end"==i||d||itms.first>c&&(itms.first+=b.length),itms.total=$cfs.children().length,itms.first>=itms.total&&(itms.first-=itms.total),$cfs.trigger(cf_e("updatesizes",conf)),$cfs.trigger(cf_e("linkanchors",conf)),!0}),$cfs.bind(cf_e("removeitem",conf),function(a,b,c,d){a.stoppropagation();var e=[b,c,d],f=["string/number/object","boolean","number"],g=cf_sortparams(e,f);if(b=g[0],c=g[1],d=g[2],b instanceof $&&b.length>1)return i=$(),b.each(function(){var e=$cfs.trigger(cf_e("removeitem",conf),[$(this),c,d]);e&&(i=i.add(e))}),i;if(is_undefined(b)||"end"==b)i=$cfs.children().last();else{b=gn_getitemindex(b,d,c,itms,$cfs);var i=$cfs.children().eq(b);i.length&&itms.first>b&&(itms.first-=i.length)}return i&&i.length&&(i.detach(),itms.total=$cfs.children().length,$cfs.trigger(cf_e("updatesizes",conf))),i}),$cfs.bind(cf_e("onbefore",conf)+" "+cf_e("onafter",conf),function(a,b){a.stoppropagation();var c=a.type.slice(conf.events.prefix.length);return is_array(b)&&(clbk[c]=b),is_function(b)&&clbk[c].push(b),clbk[c]}),$cfs.bind(cf_e("currentposition",conf),function(a,b){if(a.stoppropagation(),0==itms.first)var c=0;else var c=itms.total-itms.first;return is_function(b)&&b.call($tt0,c),c}),$cfs.bind(cf_e("currentpage",conf),function(a,b){a.stoppropagation();var e,c=opts.pagination.items||opts.items.visible,d=math.ceil(itms.total/c-1);return e=0==itms.first?0:itms.firste&&(e=0),e>d&&(e=d),is_function(b)&&b.call($tt0,e),e}),$cfs.bind(cf_e("currentvisible",conf),function(a,b){a.stoppropagation();var c=gi_getcurrentitems($cfs.children(),opts);return is_function(b)&&b.call($tt0,c),c}),$cfs.bind(cf_e("slice",conf),function(a,b,c,d){if(a.stoppropagation(),0==itms.total)return!1;var e=[b,c,d],f=["number","number","function"],g=cf_sortparams(e,f);if(b=is_number(g[0])?g[0]:0,c=is_number(g[1])?g[1]:itms.total,d=g[2],b+=itms.first,c+=itms.first,items.total>0){for(;b>itms.total;)b-=itms.total;for(;c>itms.total;)c-=itms.total;for(;0>b;)b+=itms.total;for(;0>c;)c+=itms.total}var i,h=$cfs.children();return i=c>b?h.slice(b,c):$(h.slice(b,itms.total).get().concat(h.slice(0,c).get())),is_function(d)&&d.call($tt0,i),i}),$cfs.bind(cf_e("ispaused",conf)+" "+cf_e("isstopped",conf)+" "+cf_e("isscrolling",conf),function(a,b){a.stoppropagation();var c=a.type.slice(conf.events.prefix.length),d=crsl[c];return is_function(b)&&b.call($tt0,d),d}),$cfs.bind(cf_e("configuration",conf),function(e,a,b,c){e.stoppropagation();var reinit=!1;if(is_function(a))a.call($tt0,opts);else if(is_object(a))opts_orig=$.extend(!0,{},opts_orig,a),b!==!1?reinit=!0:opts=$.extend(!0,{},opts,a);else if(!is_undefined(a))if(is_function(b)){var val=eval("opts."+a);is_undefined(val)&&(val=""),b.call($tt0,val)}else{if(is_undefined(b))return eval("opts."+a);"boolean"!=typeof c&&(c=!0),eval("opts_orig."+a+" = b"),c!==!1?reinit=!0:eval("opts."+a+" = b")}if(reinit){sz_resetmargin($cfs.children(),opts),fn._init(opts_orig),fn._bind_buttons();var sz=sz_setsizes($cfs,opts);$cfs.trigger(cf_e("updatepagestatus",conf),[!0,sz])}return opts}),$cfs.bind(cf_e("linkanchors",conf),function(a,b,c){return a.stoppropagation(),is_undefined(b)?b=$("body"):is_string(b)&&(b=$(b)),is_jquery(b)&&0!=b.length?(is_string(c)||(c="a.caroufredsel"),b.find(c).each(function(){var a=this.hash||"";a.length>0&&-1!=$cfs.children().index($(a))&&$(this).unbind("click").click(function(b){b.preventdefault(),$cfs.trigger(cf_e("slideto",conf),a)})}),!0):debug(conf,"not a valid object.")}),$cfs.bind(cf_e("updatepagestatus",conf),function(a,b){if(a.stoppropagation(),opts.pagination.container){var d=opts.pagination.items||opts.items.visible,e=math.ceil(itms.total/d);b&&(opts.pagination.anchorbuilder&&(opts.pagination.container.children().remove(),opts.pagination.container.each(function(){for(var a=0;e>a;a++){var b=$cfs.children().eq(gn_getitemindex(a*d,0,!0,itms,$cfs));$(this).append(opts.pagination.anchorbuilder.call(b[0],a+1))}})),opts.pagination.container.each(function(){$(this).children().unbind(opts.pagination.event).each(function(a){$(this).bind(opts.pagination.event,function(b){b.preventdefault(),$cfs.trigger(cf_e("slideto",conf),[a*d,-opts.pagination.deviation,!0,opts.pagination])})})}));var f=$cfs.triggerhandler(cf_e("currentpage",conf))+opts.pagination.deviation;return f>=e&&(f=0),0>f&&(f=e-1),opts.pagination.container.each(function(){$(this).children().removeclass(cf_c("selected",conf)).eq(f).addclass(cf_c("selected",conf))}),!0}}),$cfs.bind(cf_e("updatesizes",conf),function(){var b=opts.items.visible,c=$cfs.children(),d=ms_getparentsize($wrp,opts,"width");if(itms.total=c.length,crsl.primarysizepercentage?(opts.maxdimension=d,opts[opts.d.width]=ms_getpercentage(d,crsl.primarysizepercentage)):opts.maxdimension=ms_getmaxdimension(opts,d),opts.responsive?(opts.items.width=opts.items.sizesconf.width,opts.items.height=opts.items.sizesconf.height,opts=in_getresponsivevalues(opts,c,d),b=opts.items.visible,sz_setresponsivesizes(opts,c)):opts.items.visibleconf.variable?b=gn_getvisibleitemsnext(c,opts,0):"*"!=opts.items.filter&&(b=gn_getvisibleitemsnextfilter(c,opts,0)),!opts.circular&&0!=itms.first&&b>itms.first){if(opts.items.visibleconf.variable)var e=gn_getvisibleitemsprev(c,opts,itms.first)-itms.first;else if("*"!=opts.items.filter)var e=gn_getvisibleitemsprevfilter(c,opts,itms.first)-itms.first;else var e=opts.items.visible-itms.first;debug(conf,"preventing non-circular: sliding "+e+" items backward."),$cfs.trigger(cf_e("prev",conf),e)}opts.items.visible=cf_getitemsadjust(b,opts,opts.items.visibleconf.adjust,$tt0),opts.items.visibleconf.old=opts.items.visible,opts=in_getalignpadding(opts,c);var f=sz_setsizes($cfs,opts);return $cfs.trigger(cf_e("updatepagestatus",conf),[!0,f]),nv_shownavi(opts,itms.total,conf),nv_enablenavi(opts,itms.first,conf),f}),$cfs.bind(cf_e("destroy",conf),function(a,b){return a.stoppropagation(),tmrs=sc_cleartimers(tmrs),$cfs.data("_cfs_iscarousel",!1),$cfs.trigger(cf_e("finish",conf)),b&&$cfs.trigger(cf_e("jumptostart",conf)),sz_restoreorigcss($cfs.children()),sz_restoreorigcss($cfs),fn._unbind_events(),fn._unbind_buttons(),"parent"==conf.wrapper?sz_restoreorigcss($wrp):$wrp.replacewith($cfs),!0}),$cfs.bind(cf_e("debug",conf),function(){return debug(conf,"carousel width: "+opts.width),debug(conf,"carousel height: "+opts.height),debug(conf,"item widths: "+opts.items.width),debug(conf,"item heights: "+opts.items.height),debug(conf,"number of items visible: "+opts.items.visible),opts.auto.play&&debug(conf,"number of items scrolled automatically: "+opts.auto.items),opts.prev.button&&debug(conf,"number of items scrolled backward: "+opts.prev.items),opts.next.button&&debug(conf,"number of items scrolled forward: "+opts.next.items),conf.debug}),$cfs.bind("_cfs_triggerevent",function(a,b,c){return a.stoppropagation(),$cfs.triggerhandler(cf_e(b,conf),c)})},fn._unbind_events=function(){$cfs.unbind(cf_e("",conf)),$cfs.unbind(cf_e("",conf,!1)),$cfs.unbind("_cfs_triggerevent")},fn._bind_buttons=function(){if(fn._unbind_buttons(),nv_shownavi(opts,itms.total,conf),nv_enablenavi(opts,itms.first,conf),opts.auto.pauseonhover){var a=bt_pauseonhoverconfig(opts.auto.pauseonhover);$wrp.bind(cf_e("mouseenter",conf,!1),function(){$cfs.trigger(cf_e("pause",conf),a)}).bind(cf_e("mouseleave",conf,!1),function(){$cfs.trigger(cf_e("resume",conf))})}if(opts.auto.button&&opts.auto.button.bind(cf_e(opts.auto.event,conf,!1),function(a){a.preventdefault();var b=!1,c=null;crsl.ispaused?b="play":opts.auto.pauseonevent&&(b="pause",c=bt_pauseonhoverconfig(opts.auto.pauseonevent)),b&&$cfs.trigger(cf_e(b,conf),c)}),opts.prev.button&&(opts.prev.button.bind(cf_e(opts.prev.event,conf,!1),function(a){a.preventdefault(),$cfs.trigger(cf_e("prev",conf))}),opts.prev.pauseonhover)){var a=bt_pauseonhoverconfig(opts.prev.pauseonhover);opts.prev.button.bind(cf_e("mouseenter",conf,!1),function(){$cfs.trigger(cf_e("pause",conf),a)}).bind(cf_e("mouseleave",conf,!1),function(){$cfs.trigger(cf_e("resume",conf))})}if(opts.next.button&&(opts.next.button.bind(cf_e(opts.next.event,conf,!1),function(a){a.preventdefault(),$cfs.trigger(cf_e("next",conf))}),opts.next.pauseonhover)){var a=bt_pauseonhoverconfig(opts.next.pauseonhover);opts.next.button.bind(cf_e("mouseenter",conf,!1),function(){$cfs.trigger(cf_e("pause",conf),a)}).bind(cf_e("mouseleave",conf,!1),function(){$cfs.trigger(cf_e("resume",conf))})}if(opts.pagination.container&&opts.pagination.pauseonhover){var a=bt_pauseonhoverconfig(opts.pagination.pauseonhover);opts.pagination.container.bind(cf_e("mouseenter",conf,!1),function(){$cfs.trigger(cf_e("pause",conf),a)}).bind(cf_e("mouseleave",conf,!1),function(){$cfs.trigger(cf_e("resume",conf))})}if((opts.prev.key||opts.next.key)&&$(document).bind(cf_e("keyup",conf,!1,!0,!0),function(a){var b=a.keycode;b==opts.next.key&&(a.preventdefault(),$cfs.trigger(cf_e("next",conf))),b==opts.prev.key&&(a.preventdefault(),$cfs.trigger(cf_e("prev",conf)))}),opts.pagination.keys&&$(document).bind(cf_e("keyup",conf,!1,!0,!0),function(a){var b=a.keycode;b>=49&&58>b&&(b=(b-49)*opts.items.visible,itms.total>=b&&(a.preventdefault(),$cfs.trigger(cf_e("slideto",conf),[b,0,!0,opts.pagination])))}),$.fn.swipe){var b="ontouchstart"in window;if(b&&opts.swipe.ontouch||!b&&opts.swipe.onmouse){var c=$.extend(!0,{},opts.prev,opts.swipe),d=$.extend(!0,{},opts.next,opts.swipe),e=function(){$cfs.trigger(cf_e("prev",conf),[c])},f=function(){$cfs.trigger(cf_e("next",conf),[d])};switch(opts.direction){case"up":case"down":opts.swipe.options.swipeup=f,opts.swipe.options.swipedown=e;break;default:opts.swipe.options.swipeleft=f,opts.swipe.options.swiperight=e}crsl.swipe&&$cfs.swipe("destroy"),$wrp.swipe(opts.swipe.options),$wrp.css("cursor","move"),crsl.swipe=!0}}if($.fn.mousewheel&&opts.mousewheel){var g=$.extend(!0,{},opts.prev,opts.mousewheel),h=$.extend(!0,{},opts.next,opts.mousewheel);crsl.mousewheel&&$wrp.unbind(cf_e("mousewheel",conf,!1)),$wrp.bind(cf_e("mousewheel",conf,!1),function(a,b){a.preventdefault(),b>0?$cfs.trigger(cf_e("prev",conf),[g]):$cfs.trigger(cf_e("next",conf),[h])}),crsl.mousewheel=!0}if(opts.auto.play&&$cfs.trigger(cf_e("play",conf),opts.auto.delay),crsl.updateonwindowresize){var i=function(){$cfs.trigger(cf_e("finish",conf)),opts.auto.pauseonresize&&!crsl.ispaused&&$cfs.trigger(cf_e("play",conf)),sz_resetmargin($cfs.children(),opts),$cfs.trigger(cf_e("updatesizes",conf))},j=$(window),k=null;if($.debounce&&"debounce"==conf.onwindowresize)k=$.debounce(200,i);else if($.throttle&&"throttle"==conf.onwindowresize)k=$.throttle(300,i);else{var l=0,m=0;k=function(){var a=j.width(),b=j.height();(a!=l||b!=m)&&(i(),l=a,m=b)}}j.bind(cf_e("resize",conf,!1,!0,!0),k)}},fn._unbind_buttons=function(){var b=(cf_e("",conf),cf_e("",conf,!1));ns3=cf_e("",conf,!1,!0,!0),$(document).unbind(ns3),$(window).unbind(ns3),$wrp.unbind(b),opts.auto.button&&opts.auto.button.unbind(b),opts.prev.button&&opts.prev.button.unbind(b),opts.next.button&&opts.next.button.unbind(b),opts.pagination.container&&(opts.pagination.container.unbind(b),opts.pagination.anchorbuilder&&opts.pagination.container.children().remove()),crsl.swipe&&($cfs.swipe("destroy"),$wrp.css("cursor","default"),crsl.swipe=!1),crsl.mousewheel&&(crsl.mousewheel=!1),nv_shownavi(opts,"hide",conf),nv_enablenavi(opts,"removeclass",conf)},is_boolean(configs)&&(configs={debug:configs});var crsl={direction:"next",ispaused:!0,isscrolling:!1,isstopped:!1,mousewheel:!1,swipe:!1},itms={total:$cfs.children().length,first:0},tmrs={auto:null,progress:null,starttime:gettime(),timepassed:0},scrl={isstopped:!1,duration:0,starttime:0,easing:"",anims:[]},clbk={onbefore:[],onafter:[]},queu=[],conf=$.extend(!0,{},$.fn.caroufredsel.configs,configs),opts={},opts_orig=$.extend(!0,{},options),$wrp="parent"==conf.wrapper?$cfs.parent():$cfs.wrap("<"+conf.wrapper.element+' class="'+conf.wrapper.classname+'" />').parent();if(conf.selector=$cfs.selector,conf.serialnumber=$.fn.caroufredsel.serialnumber++,conf.transition=conf.transition&&$.fn.transition?"transition":"animate",fn._init(opts_orig,!0,starting_position),fn._build(),fn._bind_events(),fn._bind_buttons(),is_array(opts.items.start))var start_arr=opts.items.start;else{var start_arr=[];0!=opts.items.start&&start_arr.push(opts.items.start)}if(opts.cookie&&start_arr.unshift(parseint(cf_getcookie(opts.cookie),10)),start_arr.length>0)for(var a=0,l=start_arr.length;l>a;a++){var s=start_arr[a];if(0!=s){if(s===!0){if(s=window.location.hash,1>s.length)continue}else"random"===s&&(s=math.floor(math.random()*itms.total));if($cfs.triggerhandler(cf_e("slideto",conf),[s,0,!0,{fx:"none"}]))break}}var siz=sz_setsizes($cfs,opts),itm=gi_getcurrentitems($cfs.children(),opts);return opts.oncreate&&opts.oncreate.call($tt0,{width:siz.width,height:siz.height,items:itm}),$cfs.trigger(cf_e("updatepagestatus",conf),[!0,siz]),$cfs.trigger(cf_e("linkanchors",conf)),conf.debug&&$cfs.trigger(cf_e("debug",conf)),$cfs},$.fn.caroufredsel.serialnumber=1,$.fn.caroufredsel.defaults={synchronise:!1,infinite:!0,circular:!0,responsive:!1,direction:"left",items:{start:0},scroll:{easing:"swing",duration:500,pauseonhover:!1,event:"click",queue:!1}},$.fn.caroufredsel.configs={debug:!1,transition:!1,onwindowresize:"throttle",events:{prefix:"",namespace:"cfs"},wrapper:{element:"div",classname:"caroufredsel_wrapper"},classnames:{}},$.fn.caroufredsel.pageanchorbuilder=function(a){return''+a+""},$.fn.caroufredsel.progressbarupdater=function(a){$(this).css("width",a+"%")},$.fn.caroufredsel.cookie={get:function(a){a+="=";for(var b=document.cookie.split(";"),c=0,d=b.length;d>c;c++){for(var e=b[c];" "==e.charat(0);)e=e.slice(1);if(0==e.indexof(a))return e.slice(a.length)}return 0},set:function(a,b,c){var d="";if(c){var e=new date;e.settime(e.gettime()+1e3*60*60*24*c),d="; expires="+e.togmtstring()}document.cookie=a+"="+b+d+"; path=/"},remove:function(a){$.fn.caroufredsel.cookie.set(a,"",-1)}},$.extend($.easing,{quadratic:function(a){var b=a*a;return a*(-b*a+4*b-6*a+4)},cubic:function(a){return a*(4*a*a-9*a+6)},elastic:function(a){var b=a*a;return a*(33*b*b-106*b*a+126*b-67*a+15)}}))})(jquery);
/**
* debouncedresize: special jquery event that happens once after a window resize
*
* latest version and complete readme available on github:
* https://github.com/louisremi/jquery-smartresize
*
* copyright 2012 @louis_remi
* licensed under the mit license.
*
* this saved you an hour of work?
* send me music http://www.amazon.co.uk/wishlist/hntu0468lqon
*/
(function(e){var t=e.event,n,r;n=t.special.debouncedresize={setup:function(){e(this).on("resize",n.handler)},teardown:function(){e(this).off("resize",n.handler)},handler:function(e,i){var s=this,o=arguments,u=function(){e.type="debouncedresize";t.dispatch.apply(s,o)};if(r){cleartimeout(r)}i?u():r=settimeout(u,n.threshold)},threshold:150}})(jquery);
/**
* class: prettyphoto
* use: lightbox clone for jquery
* author: stephane caron (http://www.no-margin-for-errors.com)
* version: 3.1.5
*/
(function(e){function t(){var e=location.href;hashtag=e.indexof("#prettyphoto")!==-1?decodeuri(e.substring(e.indexof("#prettyphoto")+1,e.length)):false;return hashtag}function n(){if(typeof therel=="undefined")return;location.hash=therel+"/"+rel_index+"/"}function r(){if(location.href.indexof("#prettyphoto")!==-1)location.hash="prettyphoto"}function i(e,t){e=e.replace(/[\[]/,"\\[").replace(/[\]]/,"\\]");var n="[\\?&]"+e+"=([^]*)";var r=new regexp(n);var i=r.exec(t);return i==null?"":i[1]}e.prettyphoto={version:"3.1.5"};e.fn.prettyphoto=function(s){function g(){e(".pp_loadericon").hide();projectedtop=scroll_pos["scrolltop"]+(d/2-a["containerheight"]/2);if(projectedtop<0)projectedtop=0;$ppt.fadeto(settings.animation_speed,1);$pp_pic_holder.find(".pp_content").animate({height:a["contentheight"],width:a["contentwidth"]},settings.animation_speed);$pp_pic_holder.animate({top:projectedtop,left:v/2-a["containerwidth"]/2<0?0:v/2-a["containerwidth"]/2,width:a["containerwidth"]},settings.animation_speed,function(){$pp_pic_holder.find(".pp_hovercontainer,#fullresimage").height(a["height"]).width(a["width"]);$pp_pic_holder.find(".pp_fade").fadein(settings.animation_speed);if(isset&&s(pp_images[set_position])=="image"){$pp_pic_holder.find(".pp_hovercontainer").show()}else{$pp_pic_holder.find(".pp_hovercontainer").hide()}if(settings.allow_expand){if(a["resized"]){e("a.pp_expand,a.pp_contract").show()}else{e("a.pp_expand").hide()}}if(settings.autoplay_slideshow&&!m&&!f)e.prettyphoto.startslideshow();settings.changepicturecallback();f=true});c();s.ajaxcallback()}function y(t){$pp_pic_holder.find("#pp_full_res object,#pp_full_res embed").css("visibility","hidden");$pp_pic_holder.find(".pp_fade").fadeout(settings.animation_speed,function(){e(".pp_loadericon").show();t()})}function b(t){t>1?e(".pp_nav").show():e(".pp_nav").hide()}function w(e,t){resized=false;e(e,t);imagewidth=e,imageheight=t;if((p>v||h>d)&&doresize&&settings.allow_resize&&!u){resized=true,fitting=false;while(!fitting){if(p>v){imagewidth=v-200;imageheight=t/e*imagewidth}else if(h>d){imageheight=d-200;imagewidth=e/t*imageheight}else{fitting=true}h=imageheight,p=imagewidth}if(p>v||h>d){w(p,h)}e(imagewidth,imageheight)}return{width:math.floor(imagewidth),height:math.floor(imageheight),containerheight:math.floor(h),containerwidth:math.floor(p)+settings.horizontal_padding*2,contentheight:math.floor(l),contentwidth:math.floor(c),resized:resized}}function e(t,n){t=parsefloat(t);n=parsefloat(n);$pp_details=$pp_pic_holder.find(".pp_details");$pp_details.width(t);detailsheight=parsefloat($pp_details.css("margintop"))+parsefloat($pp_details.css("marginbottom"));$pp_details=$pp_details.clone().addclass(settings.theme).width(t).appendto(e("body")).css({position:"absolute",top:-1e4});detailsheight+=$pp_details.height();detailsheight=detailsheight<=34?36:detailsheight;$pp_details.remove();$pp_title=$pp_pic_holder.find(".ppt");$pp_title.width(t);titleheight=parsefloat($pp_title.css("margintop"))+parsefloat($pp_title.css("marginbottom"));$pp_title=$pp_title.clone().appendto(e("body")).css({position:"absolute",top:-1e4});titleheight+=$pp_title.height();$pp_title.remove();l=n+detailsheight;c=t;h=l+titleheight+$pp_pic_holder.find(".pp_top").height()+$pp_pic_holder.find(".pp_bottom").height();p=t}function s(e){if(e.match(/youtube\.com\/watch/i)||e.match(/youtu\.be/i)){return"youtube"}else if(e.match(/vimeo\.com/i)){return"vimeo"}else if(e.match(/\b.mov\b/i)){return"quicktime"}else if(e.match(/\b.swf\b/i)){return"flash"}else if(e.match(/\biframe=true\b/i)){return"iframe"}else if(e.match(/\bajax=true\b/i)){return"ajax"}else if(e.match(/\bcustom=true\b/i)){return"custom"}else if(e.substr(0,1)=="#"){return"inline"}else{return"image"}}function x(){if(doresize&&typeof $pp_pic_holder!="undefined"){scroll_pos=t();contentheight=$pp_pic_holder.height(),contentwidth=$pp_pic_holder.width();projectedtop=d/2+scroll_pos["scrolltop"]-contentheight/2;if(projectedtop<0)projectedtop=0;if(contentheight>d)return;$pp_pic_holder.css({top:projectedtop,left:v/2+scroll_pos["scrollleft"]-contentwidth/2})}}function t(){if(self.pageyoffset){return{scrolltop:self.pageyoffset,scrollleft:self.pagexoffset}}else if(document.documentelement&&document.documentelement.scrolltop){return{scrolltop:document.documentelement.scrolltop,scrollleft:document.documentelement.scrollleft}}else if(document.body){return{scrolltop:document.body.scrolltop,scrollleft:document.body.scrollleft}}}function n(){d=e(window).height(),v=e(window).width();if(typeof $pp_overlay!="undefined")$pp_overlay.height(e(document).height()).width(v)}function c(){if(isset&&settings.overlay_gallery&&s(pp_images[set_position])=="image"){itemwidth=52+5;navwidth=settings.theme=="facebook"||settings.theme=="pp_default"?50:30;itemsperpage=math.floor((a["containerwidth"]-100-navwidth)/itemwidth);itemsperpage=itemsperpage"}toinject=settings.gallery_markup.replace(/{gallery}/g,toinject);$pp_pic_holder.find("#pp_full_res").after(toinject);$pp_gallery=e(".pp_pic_holder .pp_gallery"),$pp_gallery_li=$pp_gallery.find("li");$pp_gallery.find(".pp_arrow_next").click(function(){e.prettyphoto.changegallerypage("next");e.prettyphoto.stopslideshow();return false});$pp_gallery.find(".pp_arrow_previous").click(function(){e.prettyphoto.changegallerypage("previous");e.prettyphoto.stopslideshow();return false});$pp_pic_holder.find(".pp_content").hover(function(){$pp_pic_holder.find(".pp_gallery:not(.disabled)").fadein()},function(){$pp_pic_holder.find(".pp_gallery:not(.disabled)").fadeout()});itemwidth=52+5;$pp_gallery_li.each(function(t){e(this).find("a").click(function(){e.prettyphoto.changepage(t);e.prettyphoto.stopslideshow();return false})})}if(settings.slideshow){$pp_pic_holder.find(".pp_nav").prepend('play');$pp_pic_holder.find(".pp_nav .pp_play").click(function(){e.prettyphoto.startslideshow();return false})}$pp_pic_holder.attr("class","pp_pic_holder "+settings.theme);$pp_overlay.css({opacity:0,height:e(document).height(),width:e(window).width()}).bind("click",function(){if(!settings.modal)e.prettyphoto.close()});e("a.pp_close").bind("click",function(){e.prettyphoto.close();return false});if(settings.allow_expand){e("a.pp_expand").bind("click",function(t){if(e(this).hasclass("pp_expand")){e(this).removeclass("pp_expand").addclass("pp_contract");doresize=false}else{e(this).removeclass("pp_contract").addclass("pp_expand");doresize=true}y(function(){e.prettyphoto.open()});return false})}$pp_pic_holder.find(".pp_previous, .pp_nav .pp_arrow_previous").bind("click",function(){e.prettyphoto.changepage("previous");e.prettyphoto.stopslideshow();return false});$pp_pic_holder.find(".pp_next, .pp_nav .pp_arrow_next").bind("click",function(){e.prettyphoto.changepage("next");e.prettyphoto.stopslideshow();return false});x()}s=jquery.extend({hook:"rel",animation_speed:"fast",ajaxcallback:function(){},slideshow:5e3,autoplay_slideshow:false,opacity:.8,show_title:true,allow_resize:true,allow_expand:true,default_width:500,default_height:344,counter_separator_label:"/",theme:"pp_default",horizontal_padding:20,hideflash:false,wmode:"opaque",autoplay:true,modal:false,deeplinking:true,overlay_gallery:true,overlay_gallery_max:30,keyboard_shortcuts:true,changepicturecallback:function(){},callback:function(){},ie6_fallback:true,markup:' ',gallery_markup:'',image_markup:'',flash_markup:'',quicktime_markup:'',iframe_markup:'',inline_markup:'{content}
',custom_markup:"",social_tools:''},s);var o=this,u=false,a,f,l,c,h,p,d=e(window).height(),v=e(window).width(),m;doresize=true,scroll_pos=t();e(window).unbind("resize.prettyphoto").bind("resize.prettyphoto",function(){x();n()});if(s.keyboard_shortcuts){e(document).unbind("keydown.prettyphoto").bind("keydown.prettyphoto",function(t){if(typeof $pp_pic_holder!="undefined"){if($pp_pic_holder.is(":visible")){switch(t.keycode){case 37:e.prettyphoto.changepage("previous");t.preventdefault();break;case 39:e.prettyphoto.changepage("next");t.preventdefault();break;case 27:if(!settings.modal)e.prettyphoto.close();t.preventdefault();break}}}})}e.prettyphoto.initialize=function(){settings=s;if(settings.theme=="pp_default")settings.horizontal_padding=16;therel=e(this).attr(settings.hook);galleryregexp=/\[(?:.*)\]/;isset=galleryregexp.exec(therel)?true:false;pp_images=isset?jquery.map(o,function(t,n){if(e(t).attr(settings.hook).indexof(therel)!=-1)return e(t).attr("href")}):e.makearray(e(this).attr("href"));pp_titles=isset?jquery.map(o,function(t,n){if(e(t).attr(settings.hook).indexof(therel)!=-1)return e(t).find("img").attr("alt")?e(t).find("img").attr("alt"):""}):e.makearray(e(this).find("img").attr("alt"));pp_descriptions=isset?jquery.map(o,function(t,n){if(e(t).attr(settings.hook).indexof(therel)!=-1)return e(t).attr("title")?e(t).attr("title"):""}):e.makearray(e(this).attr("title"));if(pp_images.length>settings.overlay_gallery_max)settings.overlay_gallery=false;set_position=jquery.inarray(e(this).attr("href"),pp_images);rel_index=isset?set_position:e("a["+settings.hook+"^='"+therel+"']").index(e(this));k(this);if(settings.allow_resize)e(window).bind("scroll.prettyphoto",function(){x()});e.prettyphoto.open();return false};e.prettyphoto.open=function(t){if(typeof settings=="undefined"){settings=s;pp_images=e.makearray(arguments[0]);pp_titles=arguments[1]?e.makearray(arguments[1]):e.makearray("");pp_descriptions=arguments[2]?e.makearray(arguments[2]):e.makearray("");isset=pp_images.length>1?true:false;set_position=arguments[3]?arguments[3]:0;k(t.target)}if(settings.hideflash)e("object,embed,iframe[src*=youtube],iframe[src*=vimeo]").css("visibility","hidden");b(e(pp_images).size());e(".pp_loadericon").show();if(settings.deeplinking)n();if(settings.social_tools){facebook_like_link=settings.social_tools.replace("{location_href}",encodeuricomponent(location.href));$pp_pic_holder.find(".pp_social").html(facebook_like_link)}if($ppt.is(":hidden"))$ppt.css("opacity",0).show();$pp_overlay.show().fadeto(settings.animation_speed,settings.opacity);$pp_pic_holder.find(".currenttextholder").text(set_position+1+settings.counter_separator_label+e(pp_images).size());if(typeof pp_descriptions[set_position]!="undefined"&&pp_descriptions[set_position]!=""){$pp_pic_holder.find(".pp_description").show().html(unescape(pp_descriptions[set_position]))}else{$pp_pic_holder.find(".pp_description").hide()}movie_width=parsefloat(i("width",pp_images[set_position]))?i("width",pp_images[set_position]):settings.default_width.tostring();movie_height=parsefloat(i("height",pp_images[set_position]))?i("height",pp_images[set_position]):settings.default_height.tostring();u=false;if(movie_height.indexof("%")!=-1){movie_height=parsefloat(e(window).height()*parsefloat(movie_height)/100-150);u=true}if(movie_width.indexof("%")!=-1){movie_width=parsefloat(e(window).width()*parsefloat(movie_width)/100-150);u=true}$pp_pic_holder.fadein(function(){settings.show_title&&pp_titles[set_position]!=""&&typeof pp_titles[set_position]!="undefined"?$ppt.html(unescape(pp_titles[set_position])):$ppt.html("â ");imgpreloader="";skipinjection=false;switch(s(pp_images[set_position])){case"image":imgpreloader=new image;nextimage=new image;if(isset&&set_position0)movie_id=movie_id.substr(0,movie_id.indexof("?"));if(movie_id.indexof("&")>0)movie_id=movie_id.substr(0,movie_id.indexof("&"))}movie="http://www.youtube.com/embed/"+movie_id;i("rel",pp_images[set_position])?movie+="?rel="+i("rel",pp_images[set_position]):movie+="?rel=1";if(settings.autoplay)movie+="&autoplay=1";toinject=settings.iframe_markup.replace(/{width}/g,a["width"]).replace(/{height}/g,a["height"]).replace(/{wmode}/g,settings.wmode).replace(/{path}/g,movie);break;case"vimeo":a=w(movie_width,movie_height);movie_id=pp_images[set_position];var t=/http(s?):\/\/(www\.)?vimeo.com\/(\d+)/;var n=movie_id.match(t);movie="http://player.vimeo.com/video/"+n[3]+"?title=0&byline=0&portrait=0";if(settings.autoplay)movie+="&autoplay=1;";vimeo_width=a["width"]+"/embed/?moog_width="+a["width"];toinject=settings.iframe_markup.replace(/{width}/g,vimeo_width).replace(/{height}/g,a["height"]).replace(/{path}/g,movie);break;case"quicktime":a=w(movie_width,movie_height);a["height"]+=15;a["contentheight"]+=15;a["containerheight"]+=15;toinject=settings.quicktime_markup.replace(/{width}/g,a["width"]).replace(/{height}/g,a["height"]).replace(/{wmode}/g,settings.wmode).replace(/{path}/g,pp_images[set_position]).replace(/{autoplay}/g,settings.autoplay);break;case"flash":a=w(movie_width,movie_height);flash_vars=pp_images[set_position];flash_vars=flash_vars.substring(pp_images[set_position].indexof("flashvars")+10,pp_images[set_position].length);filename=pp_images[set_position];filename=filename.substring(0,filename.indexof("?"));toinject=settings.flash_markup.replace(/{width}/g,a["width"]).replace(/{height}/g,a["height"]).replace(/{wmode}/g,settings.wmode).replace(/{path}/g,filename+"?"+flash_vars);break;case"iframe":a=w(movie_width,movie_height);frame_url=pp_images[set_position];frame_url=frame_url.substr(0,frame_url.indexof("iframe")-1);toinject=settings.iframe_markup.replace(/{width}/g,a["width"]).replace(/{height}/g,a["height"]).replace(/{path}/g,frame_url);break;case"ajax":doresize=false;a=w(movie_width,movie_height);doresize=true;skipinjection=true;e.get(pp_images[set_position],function(e){toinject=settings.inline_markup.replace(/{content}/g,e);$pp_pic_holder.find("#pp_full_res")[0].innerhtml=toinject;g()});break;case"custom":a=w(movie_width,movie_height);toinject=settings.custom_markup;break;case"inline":myclone=e(pp_images[set_position]).clone().append('
').css({width:settings.default_width}).wrapinner('').appendto(e("body")).show();doresize=false;a=w(e(myclone).width(),e(myclone).height());doresize=true;e(myclone).remove();toinject=settings.inline_markup.replace(/{content}/g,e(pp_images[set_position]).html());break}if(!imgpreloader&&!skipinjection){$pp_pic_holder.find("#pp_full_res")[0].innerhtml=toinject;g()}});return false};e.prettyphoto.changepage=function(t){currentgallerypage=0;if(t=="previous"){set_position--;if(set_position<0)set_position=e(pp_images).size()-1}else if(t=="next"){set_position++;if(set_position>e(pp_images).size()-1)set_position=0}else{set_position=t}rel_index=set_position;if(!doresize)doresize=true;if(settings.allow_expand){e(".pp_contract").removeclass("pp_contract").addclass("pp_expand")}y(function(){e.prettyphoto.open()})};e.prettyphoto.changegallerypage=function(e){if(e=="next"){currentgallerypage++;if(currentgallerypage>totalpage)currentgallerypage=0}else if(e=="previous"){currentgallerypage--;if(currentgallerypage<0)currentgallerypage=totalpage}else{currentgallerypage=e}slide_speed=e=="next"||e=="previous"?settings.animation_speed:0;slide_to=currentgallerypage*itemsperpage*itemwidth;$pp_gallery.find("ul").animate({left:-slide_to},slide_speed)};e.prettyphoto.startslideshow=function(){if(typeof m=="undefined"){$pp_pic_holder.find(".pp_play").unbind("click").removeclass("pp_play").addclass("pp_pause").click(function(){e.prettyphoto.stopslideshow();return false});m=setinterval(e.prettyphoto.startslideshow,settings.slideshow)}else{e.prettyphoto.changepage("next")}};e.prettyphoto.stopslideshow=function(){$pp_pic_holder.find(".pp_pause").unbind("click").removeclass("pp_pause").addclass("pp_play").click(function(){e.prettyphoto.startslideshow();return false});clearinterval(m);m=undefined};e.prettyphoto.close=function(){if($pp_overlay.is(":animated"))return;e.prettyphoto.stopslideshow();$pp_pic_holder.stop().find("object,embed").css("visibility","hidden");e("div.pp_pic_holder,div.ppt,.pp_fade").fadeout(settings.animation_speed,function(){e(this).remove()});$pp_overlay.fadeout(settings.animation_speed,function(){if(settings.hideflash)e("object,embed,iframe[src*=youtube],iframe[src*=vimeo]").css("visibility","visible");e(this).remove();e(window).unbind("scroll.prettyphoto");r();settings.callback();doresize=true;f=false;delete settings})};if(!pp_alreadyinitialized&&t()){pp_alreadyinitialized=true;hashindex=t();hashrel=hashindex;hashindex=hashindex.substring(hashindex.indexof("/")+1,hashindex.length-1);hashrel=hashrel.substring(0,hashrel.indexof("/"));settimeout(function(){e("a["+s.hook+"^='"+hashrel+"']:eq("+hashindex+")").trigger("click")},50)}return this.unbind("click.prettyphoto").bind("click.prettyphoto",e.prettyphoto.initialize)};})(jquery);var pp_alreadyinitialized=false;
/**
* touchswipe - jquery plugin
* https://github.com/mattbryson/touchswipe-jquery-plugin
* http://labs.skinkers.com/touchswipe/
* http://plugins.jquery.com/project/touchswipe
*
* copyright (c) 2010 matt bryson (www.skinkers.com)
* dual licensed under the mit or gpl version 2 licenses.
*
* $version: 1.3.3
*/
(function(g){function p(c){if(c&&void 0===c.allowpagescroll&&(void 0!==c.swipe||void 0!==c.swipestatus))c.allowpagescroll=g;c||(c={});c=g.extend({},g.fn.swipe.defaults,c);return this.each(function(){var b=g(this),f=b.data(w);f||(f=new w(this,c),b.data(w,f))})}function w(c,b){var f,p,r,s;function h(a){var a=a.originalevent,c,q=n?a.touches[0]:a;d=r;n?h=a.touches.length:a.preventdefault();i=0;j=null;k=0;!n||h===b.fingers||b.fingers===x?(r=f=q.pagex,s=p=q.pagey,y=(new date).gettime(),b.swipestatus&&(c= l(a,d))):t(a);if(!1===c)return d=m,l(a,d),c;e.bind(i,j);e.bind(k,l)}function j(a){a=a.originalevent;if(!(d===q||d===m)){var c,e=n?a.touches[0]:a;f=e.pagex;p=e.pagey;u=(new date).gettime();j=s();n&&(h=a.touches.length);d=z;var e=a,g=j;if(b.allowpagescroll===g)e.preventdefault();else{var o=b.allowpagescroll===t;switch(g){case v:(b.swipeleft&&o||!o&&b.allowpagescroll!=m)&&e.preventdefault();break;case a:(b.swiperight&&o||!o&&b.allowpagescroll!=m)&&e.preventdefault();break;case b:(b.swipeup&&o||!o&&b.allowpagescroll!= n)&&e.preventdefault();break;case c:(b.swipedown&&o||!o&&b.allowpagescroll!=n)&&e.preventdefault()}}h===b.fingers||b.fingers===x||!n?(i=u(),k=u-y,b.swipestatus&&(c=l(a,d,j,i,k)),b.triggerontouchend||(e=!(b.maxtimethreshold?!(k>=b.maxtimethreshold):1),!0===d()?(d=q,c=l(a,d)):e&&(d=m,l(a,d)))):(d=m,l(a,d));!1===c&&(d=m,l(a,d))}}function l(a){a=a.originalevent;a.preventdefault();u=(new date).gettime();i=u();j=s();k=u-y;if(b.triggerontouchend||!1===b.triggerontouchend&&d===z)if(d=q,(h===b.fingers||b.fingers=== x||!n)&&0!==f){var c=!(b.maxtimethreshold?!(k>=b.maxtimethreshold):1);if((!0===d()||null===d())&&!c)l(a,d);else if(c||!1===d())d=m,l(a,d)}else d=m,l(a,d);else d===z&&(d=m,l(a,d));e.unbind(i,j,!1);e.unbind(k,l,!1)}function t(){y=u=p=f=s=r=h=0}function l(a,c){var d=void 0;b.swipestatus&&(d=b.swipestatus.call(e,a,c,j||null,i||0,k||0,h));if(c===m&&b.click&&(1===h||!n)&&(isnan(i)||0===i))d=b.click.call(e,a,a.target);if(c==q)switch(b.swipe&&(d=b.swipe.call(e,a,j,i,k,h)),j){case v:b.swipeleft&&(d=b.swipeleft.call(e, a,j,i,k,h));break;case a:b.swiperight&&(d=b.swiperight.call(e,a,j,i,k,h));break;case b:b.swipeup&&(d=b.swipeup.call(e,a,j,i,k,h));break;case c:b.swipedown&&(d=b.swipedown.call(e,a,j,i,k,h))}(c===m||c===q)&&t(a);return d}function d(){return null!==b.threshold?i>=b.threshold:null}function u(){return math.round(math.sqrt(math.pow(f-r,2)+math.pow(p-s,2)))}function s(){var a;a=math.atan2(p-s,r-f);a=math.round(180*a/math.pi);0>a&&(a=360-math.abs(a));return 45>=a&&0<=a?v:360>=a&&315<=a?v:135<=a&&225>=a? a:45a?c:b}function v(){e.unbind(e,h);e.unbind(f,t);e.unbind(i,j);e.unbind(k,l)}var o=n||!b.fallbacktomouseevents,e=o?"touchstart":"mousedown",i=o?"touchmove":"mousemove",k=o?"touchend":"mouseup",f="touchcancel",i=0,j=null,k=0,e=g(c),d="start",h=0,y=p=f=s=r=0,u=0;try{e.bind(e,h),e.bind(f,t)}catch(p){g.error("events not supported "+e+","+f+" on jquery.swipe")}this.enable=function(){e.bind(e,h);e.bind(f,t);return e};this.disable=function(){v();return e};this.destroy=function(){v();e.data(w,null); return e}}var v="left",a="right",b="up",c="down",g="none",t="auto",m="horizontal",n="vertical",x="all",r="start",z="move",q="end",m="cancel",n="ontouchstart"in window,w="touchswipe";g.fn.swipe=function(c){var b=g(this),f=b.data(w);if(f&&"string"===typeof c){if(f[c])return f[c].apply(this,array.prototype.slice.call(arguments,1));g.error("method "+c+" does not exist on jquery.swipe")}else if(!f&&("object"===typeof c||!c))return p.apply(this,arguments);return b};g.fn.swipe.defaults={fingers:1,threshold:75, maxtimethreshold:null,swipe:null,swipeleft:null,swiperight:null,swipeup:null,swipedown:null,swipestatus:null,click:null,triggerontouchend:!0,allowpagescroll:"auto",fallbacktomouseevents:!0};g.fn.swipe.phases={phase_start:r,phase_move:z,phase_end:q,phase_cancel:m};g.fn.swipe.directions={left:v,right:a,up:b,down:c};g.fn.swipe.pagescroll={none:g,horizontal:m,vertical:n,auto:t};g.fn.swipe.fingers={one:1,two:2,three:3,all:x}})(jquery);
/**
* jquery waypoints - v2.0.2
* copyright (c) 2011-2013 caleb troughton
* dual licensed under the mit license and gpl license.
* https://github.com/imakewebthings/jquery-waypoints/blob/master/licenses.txt
*/
(function(){var t=[].indexof||function(t){for(var e=0,n=this.length;e=0;s={horizontal:{},vertical:{}};f=1;a={};u="waypoints-context-id";p="resize.waypoints";y="scroll.waypoints";v=1;w="waypoints-waypoint-ids";g="waypoint";m="waypoints";o=function(){function t(t){var e=this;this.$element=t;this.element=t[0];this.didresize=false;this.didscroll=false;this.id="context"+f++;this.oldscroll={x:t.scrollleft(),y:t.scrolltop()};this.waypoints={horizontal:{},vertical:{}};t.data(u,this.id);a[this.id]=this;t.bind(y,function(){var t;if(!(e.didscroll||c)){e.didscroll=true;t=function(){e.doscroll();return e.didscroll=false};return r.settimeout(t,n[m].settings.scrollthrottle)}});t.bind(p,function(){var t;if(!e.didresize){e.didresize=true;t=function(){n[m]("refresh");return e.didresize=false};return r.settimeout(t,n[m].settings.resizethrottle)}})}t.prototype.doscroll=function(){var t,e=this;t={horizontal:{newscroll:this.$element.scrollleft(),oldscroll:this.oldscroll.x,forward:"right",backward:"left"},vertical:{newscroll:this.$element.scrolltop(),oldscroll:this.oldscroll.y,forward:"down",backward:"up"}};if(c&&(!t.vertical.oldscroll||!t.vertical.newscroll)){n[m]("refresh")}n.each(t,function(t,r){var i,o,l;l=[];o=r.newscroll>r.oldscroll;i=o?r.forward:r.backward;n.each(e.waypoints[t],function(t,e){var n,i;if(r.oldscroll<(n=e.offset)&&n<=r.newscroll){return l.push(e)}else if(r.newscroll<(i=e.offset)&&i<=r.oldscroll){return l.push(e)}});l.sort(function(t,e){return t.offset-e.offset});if(!o){l.reverse()}return n.each(l,function(t,e){if(e.options.continuous||t===l.length-1){return e.trigger([i])}})});return this.oldscroll={x:t.horizontal.newscroll,y:t.vertical.newscroll}};t.prototype.refresh=function(){var t,e,r,i=this;r=n.iswindow(this.element);e=this.$element.offset();this.doscroll();t={horizontal:{contextoffset:r?0:e.left,contextscroll:r?0:this.oldscroll.x,contextdimension:this.$element.width(),oldscroll:this.oldscroll.x,forward:"right",backward:"left",offsetprop:"left"},vertical:{contextoffset:r?0:e.top,contextscroll:r?0:this.oldscroll.y,contextdimension:r?n[m]("viewportheight"):this.$element.height(),oldscroll:this.oldscroll.y,forward:"down",backward:"up",offsetprop:"top"}};return n.each(t,function(t,e){return n.each(i.waypoints[t],function(t,r){var i,o,l,s,f;i=r.options.offset;l=r.offset;o=n.iswindow(r.element)?0:r.$element.offset()[e.offsetprop];if(n.isfunction(i)){i=i.apply(r.element)}else if(typeof i==="string"){i=parsefloat(i);if(r.options.offset.indexof("%")>-1){i=math.ceil(e.contextdimension*i/100)}}r.offset=o-e.contextoffset+e.contextscroll-i;if(r.options.onlyonscroll&&l!=null||!r.enabled){return}if(l!==null&&l<(s=e.oldscroll)&&s<=r.offset){return r.trigger([e.backward])}else if(l!==null&&l>(f=e.oldscroll)&&f>=r.offset){return r.trigger([e.forward])}else if(l===null&&e.oldscroll>=r.offset){return r.trigger([e.forward])}})})};t.prototype.checkempty=function(){if(n.isemptyobject(this.waypoints.horizontal)&&n.isemptyobject(this.waypoints.vertical)){this.$element.unbind([p,y].join(" "));return delete a[this.id]}};return t}();l=function(){function t(t,e,r){var i,o;r=n.extend({},n.fn[g].defaults,r);if(r.offset==="bottom-in-view"){r.offset=function(){var t;t=n[m]("viewportheight");if(!n.iswindow(e.element)){t=e.$element.height()}return t-n(this).outerheight()}}this.$element=t;this.element=t[0];this.axis=r.horizontal?"horizontal":"vertical";this.callback=r.handler;this.context=e;this.enabled=r.enabled;this.id="waypoints"+v++;this.offset=null;this.options=r;e.waypoints[this.axis][this.id]=this;s[this.axis][this.id]=this;i=(o=t.data(w))!=null?o:[];i.push(this.id);t.data(w,i)}t.prototype.trigger=function(t){if(!this.enabled){return}if(this.callback!=null){this.callback.apply(this.element,t)}if(this.options.triggeronce){return this.destroy()}};t.prototype.disable=function(){return this.enabled=false};t.prototype.enable=function(){this.context.refresh();return this.enabled=true};t.prototype.destroy=function(){delete s[this.axis][this.id];delete this.context.waypoints[this.axis][this.id];return this.context.checkempty()};t.getwaypointsbyelement=function(t){var e,r;r=n(t).data(w);if(!r){return[]}e=n.extend({},s.horizontal,s.vertical);return n.map(r,function(t){return e[t]})};return t}();d={init:function(t,e){var r;if(e==null){e={}}if((r=e.handler)==null){e.handler=t}this.each(function(){var t,r,i,s;t=n(this);i=(s=e.context)!=null?s:n.fn[g].defaults.context;if(!n.iswindow(i)){i=t.closest(i)}i=n(i);r=a[i.data(u)];if(!r){r=new o(i)}return new l(t,r,e)});n[m]("refresh");return this},disable:function(){return d._invoke(this,"disable")},enable:function(){return d._invoke(this,"enable")},destroy:function(){return d._invoke(this,"destroy")},prev:function(t,e){return d._traverse.call(this,t,e,function(t,e,n){if(e>0){return t.push(n[e-1])}})},next:function(t,e){return d._traverse.call(this,t,e,function(t,e,n){if(et.oldscroll.y})},left:function(t){if(t==null){t=r}return h._filter(t,"horizontal",function(t,e){return e.offset<=t.oldscroll.x})},right:function(t){if(t==null){t=r}return h._filter(t,"horizontal",function(t,e){return e.offset>t.oldscroll.x})},enable:function(){return h._invoke("enable")},disable:function(){return h._invoke("disable")},destroy:function(){return h._invoke("destroy")},extendfn:function(t,e){return d[t]=e},_invoke:function(t){var e;e=n.extend({},s.vertical,s.horizontal);return n.each(e,function(e,n){n[t]();return true})},_filter:function(t,e,r){var i,o;i=a[n(t).data(u)];if(!i){return[]}o=[];n.each(i.waypoints[e],function(t,e){if(r(i,e)){return o.push(e)}});o.sort(function(t,e){return t.offset-e.offset});return n.map(o,function(t){return t.element})}};n[m]=function(){var t,n;n=arguments[0],t=2<=arguments.length?e.call(arguments,1):[];if(h[n]){return h[n].apply(null,t)}else{return h.aggregate.call(null,n)}};n[m].settings={resizethrottle:100,scrollthrottle:30};return i.load(function(){return n[m]("refresh")})})}).call(this);
/**
* visible, sam sehnert, samatdf, teamdf, https://github.com/teamdf/jquery-visible/
*/
(function(e){e.fn.visible=function(t,n,r){var i=e(this).eq(0),s=i.get(0),o=e(window),u=o.scrolltop(),a=u+o.height(),f=o.scrollleft(),l=f+o.width(),c=i.offset().top,h=c+i.height(),p=i.offset().left,d=p+i.width(),v=t===true?h:c,m=t===true?c:h,g=t===true?d:p,y=t===true?p:d,b=n===true?s.offsetwidth*s.offsetheight:true,r=r?r:"both";if(r==="both")return!!b&&m<=a&&v>=u&&y<=l&&g>=f;else if(r==="vertical")return!!b&&m<=a&&v>=u;else if(r==="horizontal")return!!b&&y<=l&&g>=f}})(jquery);
/**
* retina.js v1.1.0
*
* copyright 2013 imulus, llc
* released under the mit license
*
* retina.js is an open source script that makes it easy to serve
* high-resolution images to devices with retina displays.
*/
(function(){var root=typeof exports=="undefined"?window:exports;var config={check_mime_type:true};root.retina=retina;function retina(){}retina.configure=function(options){if(options==null)options={};for(var prop in options)config[prop]=options[prop]};retina.init=function(context){if(context==null)context=root;var existing_onload=context.onload||new function;context.onload=function(){var images=document.getelementsbytagname("img"),retinaimages=[],i,image;for(i=0;i1)return true;if(root.matchmedia&&root.matchmedia(mediaquery).matches)return true;return false};root.retinaimagepath=retinaimagepath;function retinaimagepath(path,at_2x_path){this.path=path;if(typeof at_2x_path!=="undefined"&&at_2x_path!==null){this.at_2x_path=at_2x_path;this.perform_check=false}else{this.at_2x_path=path.replace(/\.\w+$/,function(match){return"@2x"+match});this.perform_check=true}}retinaimagepath.confirmed_paths=[];retinaimagepath.prototype.is_external=function(){return!!(this.path.match(/^https?\:/i)&&!this.path.match("//"+document.domain))};retinaimagepath.prototype.check_2x_variant=function(callback){var http,that=this;if(this.is_external()){return callback(false)}else if(!this.perform_check&&typeof this.at_2x_path!=="undefined"&&this.at_2x_path!==null){return callback(true)}else if(this.at_2x_path in retinaimagepath.confirmed_paths){return callback(true)}else{http=new xmlhttprequest;http.open("head",this.at_2x_path);http.onreadystatechange=function(){if(http.readystate!=4){return callback(false)}if(http.status>=200&&http.status<=399){if(config.check_mime_type){var type=http.getresponseheader("content-type");if(type==null||!type.match(/^image/i)){return callback(false)}}retinaimagepath.confirmed_paths.push(that.at_2x_path);return callback(true)}else{return callback(false)}};http.send()}};function retinaimage(el){this.el=el;this.path=new retinaimagepath(this.el.getattribute("src"),this.el.getattribute("data-at2x"));var that=this;this.path.check_2x_variant(function(hasvariant){if(hasvariant)that.swap()})}root.retinaimage=retinaimage;retinaimage.prototype.swap=function(path){if(typeof path=="undefined")path=this.path.at_2x_path;var that=this;function load(){if(!that.el.complete){settimeout(load,5)}else{that.el.setattribute("width",that.el.offsetwidth);that.el.setattribute("height",that.el.offsetheight);that.el.setattribute("src",path)}}load()};if(retina.isretina()){retina.init(root)}})();
/**
* easypiechart
* lightweight plugin to render simple, animated and retina optimized pie charts
*
* @license dual licensed under the mit (http://www.opensource.org/licenses/mit-license.php) and gpl (http://www.opensource.org/licenses/gpl-license.php) licenses.
* @author robert fleischmann (http://robert-fleischmann.de)
* @version 2.1.3
**/
!function(a,b){"object"==typeof exports?module.exports=b(require("jquery")):"function"==typeof define&&define.amd?define("easypiechart",["jquery"],b):b(a.jquery)}(this,function(a){var b=function(a,b){var c,d=document.createelement("canvas");"undefined"!=typeof g_vmlcanvasmanager&&g_vmlcanvasmanager.initelement(d);var e=d.getcontext("2d");d.width=d.height=b.size,a.appendchild(d);var f=1;window.devicepixelratio>1&&(f=window.devicepixelratio,d.style.width=d.style.height=[b.size,"px"].join(""),d.width=d.height=b.size*f,e.scale(f,f)),e.translate(b.size/2,b.size/2),e.rotate((-0.5+b.rotate/180)*math.pi);var g=(b.size-b.linewidth)/2;b.scalecolor&&b.scalelength&&(g-=b.scalelength+2),date.now=date.now||function(){return+new date};var h=function(a,b,c){c=math.min(math.max(-1,c||0),1);var d=0>=c?!0:!1;e.beginpath(),e.arc(0,0,g,0,2*math.pi*c,d),e.strokestyle=a,e.linewidth=b,e.stroke()},i=function(){var a,c,d=24;e.linewidth=1,e.fillstyle=b.scalecolor,e.save();for(var d=24;d>0;--d)0===d%6?(c=b.scalelength,a=0):(c=.6*b.scalelength,a=b.scalelength-c),e.fillrect(-b.size/2+a,0,c,1),e.rotate(math.pi/12);e.restore()},j=function(){return window.requestanimationframe||window.webkitrequestanimationframe||window.mozrequestanimationframe||function(a){window.settimeout(a,1e3/60)}}(),k=function(){b.scalecolor&&i(),b.trackcolor&&h(b.trackcolor,b.linewidth,1)};this.clear=function(){e.clearrect(b.size/-2,b.size/-2,b.size,b.size)},this.draw=function(a){b.scalecolor||b.trackcolor?e.getimagedata&&e.putimagedata?c?e.putimagedata(c,0,0):(k(),c=e.getimagedata(0,0,b.size*f,b.size*f)):(this.clear(),k()):this.clear(),e.linecap=b.linecap;var d;d="function"==typeof b.barcolor?b.barcolor(a):b.barcolor,h(d,b.linewidth,a/100)}.bind(this),this.animate=function(a,c){var d=date.now();b.onstart(a,c);var e=function(){var f=math.min(date.now()-d,b.animate),g=b.easing(this,f,a,c-a,b.animate);this.draw(g),b.onstep(a,c,g),f>=b.animate?b.onstop(a,c):j(e)}.bind(this);j(e)}.bind(this)},c=function(a,c){var d={barcolor:"#ef1e25",trackcolor:"#f9f9f9",scalecolor:"#dfe0e0",scalelength:5,linecap:"round",linewidth:3,size:110,rotate:0,animate:1e3,easing:function(a,b,c,d,e){return b/=e/2,1>b?d/2*b*b+c:-d/2*(--b*(b-2)-1)+c},onstart:function(){},onstep:function(){},onstop:function(){}};if("undefined"!=typeof b)d.renderer=b;else{if("undefined"==typeof svgrenderer)throw new error("please load either the svg- or the canvasrenderer");d.renderer=svgrenderer}var e={},f=0,g=function(){this.el=a,this.options=e;for(var b in d)d.hasownproperty(b)&&(e[b]=c&&"undefined"!=typeof c[b]?c[b]:d[b],"function"==typeof e[b]&&(e[b]=e[b].bind(this)));e.easing="string"==typeof e.easing&&"undefined"!=typeof jquery&&jquery.isfunction(jquery.easing[e.easing])?jquery.easing[e.easing]:d.easing,this.renderer=new e.renderer(a,e),this.renderer.draw(f),a.dataset&&a.dataset.percent?this.update(parsefloat(a.dataset.percent)):a.getattribute&&a.getattribute("data-percent")&&this.update(parsefloat(a.getattribute("data-percent")))}.bind(this);this.update=function(a){return a=parsefloat(a),e.animate?this.renderer.animate(f,a):this.renderer.draw(a),f=a,this}.bind(this),g()};a.fn.easypiechart=function(b){return this.each(function(){var d;a.data(this,"easypiechart")||(d=a.extend({},b,a(this).data()),a.data(this,"easypiechart",new c(this,d)))})}});
/**
* stellar.js v0.6.2
* copyright 2013, mark dalgleish
* http://markdalgleish.com/projects/stellar.js
* http://markdalgleish.mit-license.org
**/
!function(a,b,c,d){function e(b,c){this.element=b,this.options=a.extend({},g,c),this._defaults=g,this._name=f,this.init()}var f="stellar",g={scrollproperty:"scroll",positionproperty:"position",horizontalscrolling:!0,verticalscrolling:!0,horizontaloffset:0,verticaloffset:0,responsive:!1,parallaxbackgrounds:!0,parallaxelements:!0,hidedistantelements:!0,hideelement:function(a){a.hide()},showelement:function(a){a.show()}},h={scroll:{getleft:function(a){return a.scrollleft()},setleft:function(a,b){a.scrollleft(b)},gettop:function(a){return a.scrolltop()},settop:function(a,b){a.scrolltop(b)}},position:{getleft:function(a){return-1*parseint(a.css("left"),10)},gettop:function(a){return-1*parseint(a.css("top"),10)}},margin:{getleft:function(a){return-1*parseint(a.css("margin-left"),10)},gettop:function(a){return-1*parseint(a.css("margin-top"),10)}},transform:{getleft:function(a){var b=getcomputedstyle(a[0])[k];return"none"!==b?-1*parseint(b.match(/(-?[0-9]+)/g)[4],10):0},gettop:function(a){var b=getcomputedstyle(a[0])[k];return"none"!==b?-1*parseint(b.match(/(-?[0-9]+)/g)[5],10):0}}},i={position:{setleft:function(a,b){a.css("left",b)},settop:function(a,b){a.css("top",b)}},transform:{setposition:function(a,b,c,d,e){a[0].style[k]="translate3d("+(b-c)+"px, "+(d-e)+"px, 0)"}}},j=function(){var b,c=/^(moz|webkit|khtml|o|ms|icab)(?=[a-z])/,d=a("script")[0].style,e="";for(b in d)if(c.test(b)){e=b.match(c)[0];break}return"webkitopacity"in d&&(e="webkit"),"khtmlopacity"in d&&(e="khtml"),function(a){return e+(e.length>0?a.charat(0).touppercase()+a.slice(1):a)}}(),k=j("transform"),l=a("",{style:"background:#fff"}).css("background-position-x")!==d,m=l?function(a,b,c){a.css({"background-position-x":b,"background-position-y":c})}:function(a,b,c){a.css("background-position",b+" "+c)},n=l?function(a){return[a.css("background-position-x"),a.css("background-position-y")]}:function(a){return a.css("background-position").split(" ")},o=b.requestanimationframe||b.webkitrequestanimationframe||b.mozrequestanimationframe||b.orequestanimationframe||b.msrequestanimationframe||function(a){settimeout(a,1e3/60)};e.prototype={init:function(){this.options.name=f+"_"+math.floor(1e9*math.random()),this._defineelements(),this._definegetters(),this._definesetters(),this._handlewindowloadandresize(),this._detectviewport(),this.refresh({firstload:!0}),"scroll"===this.options.scrollproperty?this._handlescrollevent():this._startanimationloop()},_defineelements:function(){this.element===c.body&&(this.element=b),this.$scrollelement=a(this.element),this.$element=this.element===b?a("body"):this.$scrollelement,this.$viewportelement=this.options.viewportelement!==d?a(this.options.viewportelement):this.$scrollelement[0]===b||"scroll"===this.options.scrollproperty?this.$scrollelement:this.$scrollelement.parent()},_definegetters:function(){var a=this,b=h[a.options.scrollproperty];this._getscrollleft=function(){return b.getleft(a.$scrollelement)},this._getscrolltop=function(){return b.gettop(a.$scrollelement)}},_definesetters:function(){var b=this,c=h[b.options.scrollproperty],d=i[b.options.positionproperty],e=c.setleft,f=c.settop;this._setscrollleft="function"==typeof e?function(a){e(b.$scrollelement,a)}:a.noop,this._setscrolltop="function"==typeof f?function(a){f(b.$scrollelement,a)}:a.noop,this._setposition=d.setposition||function(a,c,e,f,g){b.options.horizontalscrolling&&d.setleft(a,c,e),b.options.verticalscrolling&&d.settop(a,f,g)}},_handlewindowloadandresize:function(){var c=this,d=a(b);c.options.responsive&&d.bind("load."+this.name,function(){c.refresh()}),d.bind("resize."+this.name,function(){c._detectviewport(),c.options.responsive&&c.refresh()})},refresh:function(c){var d=this,e=d._getscrollleft(),f=d._getscrolltop();c&&c.firstload||this._reset(),this._setscrollleft(0),this._setscrolltop(0),this._setoffsets(),this._findparticles(),this._findbackgrounds(),c&&c.firstload&&/webkit/.test(navigator.useragent)&&a(b).load(function(){var a=d._getscrollleft(),b=d._getscrolltop();d._setscrollleft(a+1),d._setscrolltop(b+1),d._setscrollleft(a),d._setscrolltop(b)}),this._setscrollleft(e),this._setscrolltop(f)},_detectviewport:function(){var a=this.$viewportelement.offset(),b=null!==a&&a!==d;this.viewportwidth=this.$viewportelement.width(),this.viewportheight=this.$viewportelement.height(),this.viewportoffsettop=b?a.top:0,this.viewportoffsetleft=b?a.left:0},_findparticles:function(){{var b=this;this._getscrollleft(),this._getscrolltop()}if(this.particles!==d)for(var c=this.particles.length-1;c>=0;c--)this.particles[c].$element.data("stellar-elementisactive",d);this.particles=[],this.options.parallaxelements&&this.$element.find("[data-stellar-ratio]").each(function(){var c,e,f,g,h,i,j,k,l,m=a(this),n=0,o=0,p=0,q=0;if(m.data("stellar-elementisactive")){if(m.data("stellar-elementisactive")!==this)return}else m.data("stellar-elementisactive",this);b.options.showelement(m),m.data("stellar-startingleft")?(m.css("left",m.data("stellar-startingleft")),m.css("top",m.data("stellar-startingtop"))):(m.data("stellar-startingleft",m.css("left")),m.data("stellar-startingtop",m.css("top"))),f=m.position().left,g=m.position().top,h="auto"===m.css("margin-left")?0:parseint(m.css("margin-left"),10),i="auto"===m.css("margin-top")?0:parseint(m.css("margin-top"),10),k=m.offset().left-h,l=m.offset().top-i,m.parents().each(function(){var b=a(this);return b.data("stellar-offset-parent")===!0?(n=p,o=q,j=b,!1):(p+=b.position().left,void(q+=b.position().top))}),c=m.data("stellar-horizontal-offset")!==d?m.data("stellar-horizontal-offset"):j!==d&&j.data("stellar-horizontal-offset")!==d?j.data("stellar-horizontal-offset"):b.horizontaloffset,e=m.data("stellar-vertical-offset")!==d?m.data("stellar-vertical-offset"):j!==d&&j.data("stellar-vertical-offset")!==d?j.data("stellar-vertical-offset"):b.verticaloffset,b.particles.push({$element:m,$offsetparent:j,isfixed:"fixed"===m.css("position"),horizontaloffset:c,verticaloffset:e,startingpositionleft:f,startingpositiontop:g,startingoffsetleft:k,startingoffsettop:l,parentoffsetleft:n,parentoffsettop:o,stellarratio:m.data("stellar-ratio")!==d?m.data("stellar-ratio"):1,width:m.outerwidth(!0),height:m.outerheight(!0),ishidden:!1})})},_findbackgrounds:function(){var b,c=this,e=this._getscrollleft(),f=this._getscrolltop();this.backgrounds=[],this.options.parallaxbackgrounds&&(b=this.$element.find("[data-stellar-background-ratio]"),this.$element.data("stellar-background-ratio")&&(b=b.add(this.$element)),b.each(function(){var b,g,h,i,j,k,l,o=a(this),p=n(o),q=0,r=0,s=0,t=0;if(o.data("stellar-backgroundisactive")){if(o.data("stellar-backgroundisactive")!==this)return}else o.data("stellar-backgroundisactive",this);o.data("stellar-backgroundstartingleft")?m(o,o.data("stellar-backgroundstartingleft"),o.data("stellar-backgroundstartingtop")):(o.data("stellar-backgroundstartingleft",p[0]),o.data("stellar-backgroundstartingtop",p[1])),h="auto"===o.css("margin-left")?0:parseint(o.css("margin-left"),10),i="auto"===o.css("margin-top")?0:parseint(o.css("margin-top"),10),j=o.offset().left-h-e,k=o.offset().top-i-f,o.parents().each(function(){var b=a(this);return b.data("stellar-offset-parent")===!0?(q=s,r=t,l=b,!1):(s+=b.position().left,void(t+=b.position().top))}),b=o.data("stellar-horizontal-offset")!==d?o.data("stellar-horizontal-offset"):l!==d&&l.data("stellar-horizontal-offset")!==d?l.data("stellar-horizontal-offset"):c.horizontaloffset,g=o.data("stellar-vertical-offset")!==d?o.data("stellar-vertical-offset"):l!==d&&l.data("stellar-vertical-offset")!==d?l.data("stellar-vertical-offset"):c.verticaloffset,c.backgrounds.push({$element:o,$offsetparent:l,isfixed:"fixed"===o.css("background-attachment"),horizontaloffset:b,verticaloffset:g,startingvalueleft:p[0],startingvaluetop:p[1],startingbackgroundpositionleft:isnan(parseint(p[0],10))?0:parseint(p[0],10),startingbackgroundpositiontop:isnan(parseint(p[1],10))?0:parseint(p[1],10),startingpositionleft:o.position().left,startingpositiontop:o.position().top,startingoffsetleft:j,startingoffsettop:k,parentoffsetleft:q,parentoffsettop:r,stellarratio:o.data("stellar-background-ratio")===d?1:o.data("stellar-background-ratio")})}))},_reset:function(){var a,b,c,d,e;for(e=this.particles.length-1;e>=0;e--)a=this.particles[e],b=a.$element.data("stellar-startingleft"),c=a.$element.data("stellar-startingtop"),this._setposition(a.$element,b,b,c,c),this.options.showelement(a.$element),a.$element.data("stellar-startingleft",null).data("stellar-elementisactive",null).data("stellar-backgroundisactive",null);for(e=this.backgrounds.length-1;e>=0;e--)d=this.backgrounds[e],d.$element.data("stellar-backgroundstartingleft",null).data("stellar-backgroundstartingtop",null),m(d.$element,d.startingvalueleft,d.startingvaluetop)},destroy:function(){this._reset(),this.$scrollelement.unbind("resize."+this.name).unbind("scroll."+this.name),this._animationloop=a.noop,a(b).unbind("load."+this.name).unbind("resize."+this.name)},_setoffsets:function(){var c=this,d=a(b);d.unbind("resize.horizontal-"+this.name).unbind("resize.vertical-"+this.name),"function"==typeof this.options.horizontaloffset?(this.horizontaloffset=this.options.horizontaloffset(),d.bind("resize.horizontal-"+this.name,function(){c.horizontaloffset=c.options.horizontaloffset()})):this.horizontaloffset=this.options.horizontaloffset,"function"==typeof this.options.verticaloffset?(this.verticaloffset=this.options.verticaloffset(),d.bind("resize.vertical-"+this.name,function(){c.verticaloffset=c.options.verticaloffset()})):this.verticaloffset=this.options.verticaloffset},_repositionelements:function(){var a,b,c,d,e,f,g,h,i,j,k=this._getscrollleft(),l=this._getscrolltop(),n=!0,o=!0;if(this.currentscrollleft!==k||this.currentscrolltop!==l||this.currentwidth!==this.viewportwidth||this.currentheight!==this.viewportheight){for(this.currentscrollleft=k,this.currentscrolltop=l,this.currentwidth=this.viewportwidth,this.currentheight=this.viewportheight,j=this.particles.length-1;j>=0;j--)a=this.particles[j],b=a.isfixed?1:0,this.options.horizontalscrolling?(f=(k+a.horizontaloffset+this.viewportoffsetleft+a.startingpositionleft-a.startingoffsetleft+a.parentoffsetleft)*-(a.stellarratio+b-1)+a.startingpositionleft,h=f-a.startingpositionleft+a.startingoffsetleft):(f=a.startingpositionleft,h=a.startingoffsetleft),this.options.verticalscrolling?(g=(l+a.verticaloffset+this.viewportoffsettop+a.startingpositiontop-a.startingoffsettop+a.parentoffsettop)*-(a.stellarratio+b-1)+a.startingpositiontop,i=g-a.startingpositiontop+a.startingoffsettop):(g=a.startingpositiontop,i=a.startingoffsettop),this.options.hidedistantelements&&(o=!this.options.horizontalscrolling||h+a.width>(a.isfixed?0:k)&&h<(a.isfixed?0:k)+this.viewportwidth+this.viewportoffsetleft,n=!this.options.verticalscrolling||i+a.height>(a.isfixed?0:l)&&i<(a.isfixed?0:l)+this.viewportheight+this.viewportoffsettop),o&&n?(a.ishidden&&(this.options.showelement(a.$element),a.ishidden=!1),this._setposition(a.$element,f,a.startingpositionleft,g,a.startingpositiontop)):a.ishidden||(this.options.hideelement(a.$element),a.ishidden=!0);for(j=this.backgrounds.length-1;j>=0;j--)c=this.backgrounds[j],b=c.isfixed?0:1,d=this.options.horizontalscrolling?(k+c.horizontaloffset-this.viewportoffsetleft-c.startingoffsetleft+c.parentoffsetleft-c.startingbackgroundpositionleft)*(b-c.stellarratio)+"px":c.startingvalueleft,e=this.options.verticalscrolling?(l+c.verticaloffset-this.viewportoffsettop-c.startingoffsettop+c.parentoffsettop-c.startingbackgroundpositiontop)*(b-c.stellarratio)+"px":c.startingvaluetop,m(c.$element,d,e)}},_handlescrollevent:function(){var a=this,b=!1,c=function(){a._repositionelements(),b=!1},d=function(){b||(o(c),b=!0)};this.$scrollelement.bind("scroll."+this.name,d),d()},_startanimationloop:function(){var a=this;this._animationloop=function(){o(a._animationloop),a._repositionelements()},this._animationloop()}},a.fn[f]=function(b){var c=arguments;return b===d||"object"==typeof b?this.each(function(){a.data(this,"plugin_"+f)||a.data(this,"plugin_"+f,new e(this,b))}):"string"==typeof b&&"_"!==b[0]&&"init"!==b?this.each(function(){var d=a.data(this,"plugin_"+f);d instanceof e&&"function"==typeof d[b]&&d[b].apply(d,array.prototype.slice.call(c,1)),"destroy"===b&&a.data(this,"plugin_"+f,null)}):void 0},a[f]=function(){var c=a(b);return c.stellar.apply(c,array.prototype.slice.call(arguments,0))},a[f].scrollproperty=h,a[f].positionproperty=i,b.stellar=e}(jquery,this,document);
/**
* downcount: simple countdown clock with offset
* author: sonny t. , sonnyt.com
*/
(function(e){e.fn.downcount=function(t,n){function o(){var e=new date(r.date),t=s();var o=e-t;if(o<0){clearinterval(u);if(n&&typeof n==="function")n();return}var a=1e3,f=a*60,l=f*60,c=l*24;var h=math.floor(o/c),p=math.floor(o%c/l),d=math.floor(o%l/f),v=math.floor(o%f/a);h=string(h).length>=2?h:"0"+h;p=string(p).length>=2?p:"0"+p;d=string(d).length>=2?d:"0"+d;v=string(v).length>=2?v:"0"+v;var m=h===1?"day":"days",g=p===1?"hour":"hours",y=d===1?"minute":"minutes",b=v===1?"second":"seconds";i.find(".days").text(h);i.find(".hours").text(p);i.find(".minutes").text(d);i.find(".seconds").text(v);i.find(".days_ref").text(m);i.find(".hours_ref").text(g);i.find(".minutes_ref").text(y);i.find(".seconds_ref").text(b)}var r=e.extend({date:null,offset:null},t);if(!r.date){e.error("date is not defined.")}if(!date.parse(r.date)){e.error("incorrect date format, it should look like this, 12/24/2012 12:00:00.")}var i=this;var s=function(){var e=new date;var t=e.gettime()+e.gettimezoneoffset()*6e4;var n=new date(t+36e5*r.offset);return n};var u=setinterval(o,1e3)}})(jquery);
/**
* jquery.nicescroll 3.5.4
* inuyaksa 2013 mit http://areaaperta.com/nicescroll
* */
(function(e){"function"===typeof define&&define.amd?define(["jquery"],e):e(jquery)})(function(e){var t=!1,n=!1,r=5e3,i=2e3,s=0,o=["ms","moz","webkit","o"],u=window.requestanimationframe||!1,a=window.cancelanimationframe||!1;if(!u)for(var f in o){var l=o[f];u||(u=window[l+"requestanimationframe"]);a||(a=window[l+"cancelanimationframe"]||window[l+"cancelrequestanimationframe"])}var c=window.mutationobserver||window.webkitmutationobserver||!1,h={zindex:"auto",cursoropacitymin:0,cursoropacitymax:1,cursorcolor:"#424242",cursorwidth:"5px",cursorborder:"1px solid #fff",cursorborderradius:"5px",scrollspeed:60,mousescrollstep:24,touchbehavior:!1,hwacceleration:!0,usetransition:!0,boxzoom:!1,dblclickzoom:!0,gesturezoom:!0,grabcursorenabled:!0,autohidemode:!0,background:"",iframeautoresize:!0,cursorminheight:32,preservenativescrolling:!0,railoffset:!1,bouncescroll:!0,spacebarenabled:!0,railpadding:{top:0,right:0,left:0,bottom:0},disableoutline:!0,horizrailenabled:!0,railalign:"right",railvalign:"bottom",enabletranslate3d:!0,enablemousewheel:!0,enablekeyboard:!0,smoothscroll:!0,sensitiverail:!0,enablemouselockapi:!0,cursorfixedheight:!1,directionlockdeadzone:6,hidecursordelay:400,nativeparentscrolling:!0,enablescrollonselection:!0,overflowx:!0,overflowy:!0,cursordragspeed:.3,rtlmode:"auto",cursordragontouch:!1,oneaxismousemode:"auto",scriptpath:function(){var e=document.getelementsbytagname("script"),e=e[e.length-1].src.split("?")[0];return 0i){if(y.getscrolltop()>=y.page.maxh)return!0}else if(0>=y.getscrolltop())return!0;y.scrollmom&&y.scrollmom.stop();y.lastdeltay+=i;y.debounced("mousewheely",function(){var e=y.lastdeltay;y.lastdeltay=0;y.rail.drag||y.doscrollby(e)},15)}e.stopimmediatepropagation();return e.preventdefault()}var y=this;this.version="3.5.4";this.name="nicescroll";this.me=f;this.opt={doc:e("body"),win:!1};e.extend(this.opt,h);this.opt.snapbackspeed=80;if(o)for(var b in y.opt)"undefined"!=typeof o[b]&&(y.opt[b]=o[b]);this.iddoc=(this.doc=y.opt.doc)&&this.doc[0]?this.doc[0].id||"":"";this.ispage=/^body|html/.test(y.opt.win?y.opt.win[0].nodename:this.doc[0].nodename);this.haswrapper=!1!==y.opt.win;this.win=y.opt.win||(this.ispage?e(window):this.doc);this.docscroll=this.ispage&&!this.haswrapper?e(window):this.win;this.body=e("body");this.iframe=this.isfixed=this.viewport=!1;this.isiframe="iframe"==this.doc[0].nodename&&"iframe"==this.win[0].nodename;this.istextarea="textarea"==this.win[0].nodename;this.forcescreen=!1;this.canshowonmouseevent="scroll"!=y.opt.autohidemode;this.page=this.view=this.onzoomout=this.onzoomin=this.onscrollcancel=this.onscrollend=this.onscrollstart=this.onclick=this.ongesturezoom=this.onkeypress=this.onmousewheel=this.onmousemove=this.onmouseup=this.onmousedown=!1;this.scroll={x:0,y:0};this.scrollratio={x:0,y:0};this.cursorheight=20;this.scrollvaluemax=0;this.observerremover=this.observer=this.scrollmom=this.scrollrunning=this.isrtlmode=!1;do this.id="ascrail"+i++;while(document.getelementbyid(this.id));this.hasmousefocus=this.hasfocus=this.zoomactive=this.zoom=this.selectiondrag=this.cursorfreezed=this.cursor=this.rail=!1;this.visibility=!0;this.hidden=this.locked=!1;this.cursoractive=!0;this.wheelprevented=!1;this.overflowx=y.opt.overflowx;this.overflowy=y.opt.overflowy;this.nativescrollingarea=!1;this.checkarea=0;this.events=[];this.saved={};this.delaylist={};this.synclist={};this.lastdeltay=this.lastdeltax=0;this.detected=d();var w=e.extend({},this.detected);this.ishwscroll=(this.canhwscroll=w.hastransform&&y.opt.hwacceleration)&&y.haswrapper;this.istouchcapable=!1;w.cantouch&&w.ischrome&&!w.isios&&!w.isandroid&&(this.istouchcapable=!0,w.cantouch=!1);w.cantouch&&w.ismozilla&&!w.isios&&!w.isandroid&&(this.istouchcapable=!0,w.cantouch=!1);y.opt.enablemouselockapi||(w.hasmousecapture=!1,w.haspointerlock=!1);this.delayed=function(e,t,n,r){var i=y.delaylist[e],s=(new date).gettime();if(!r&&i&&i.tt)return!1;i&&i.tt&&cleartimeout(i.tt);if(i&&i.last+n>s&&!i.tt)y.delaylist[e]={last:s+n,tt:settimeout(function(){y&&(y.delaylist[e].tt=0,t.call())},n)};else if(!i||!i.tt)y.delaylist[e]={last:s,tt:0},settimeout(function(){t.call()},0)};this.debounced=function(e,t,n){var r=y.delaylist[e];(new date).gettime();y.delaylist[e]=t;r||settimeout(function(){var t=y.delaylist[e];y.delaylist[e]=!1;t.call()},n)};var e=!1;this.synched=function(e,t){y.synclist[e]=t;(function(){e||(u(function(){e=!1;for(e in y.synclist){var t=y.synclist[e];t&&t.call(y);y.synclist[e]=!1}}),e=!0)})();return e};this.unsynched=function(e){y.synclist[e]&&(y.synclist[e]=!1)};this.css=function(e,t){for(var n in t)y.saved.css.push([e,n,e.css(n)]),e.css(n,t[n])};this.scrolltop=function(e){return"undefined"==typeof e?y.getscrolltop():y.setscrolltop(e)};this.scrollleft=function(e){return"undefined"==typeof e?y.getscrollleft():y.setscrollleft(e)};bezierclass=function(e,t,n,r,i,s,o){this.st=e;this.ed=t;this.spd=n;this.p1=r||0;this.p2=i||1;this.p3=s||0;this.p4=o||1;this.ts=(new date).gettime();this.df=this.ed-this.st};bezierclass.prototype={b2:function(e){return 3*e*e*(1-e)},b3:function(e){return 3*e*(1-e)*(1-e)},b4:function(e){return(1-e)*(1-e)*(1-e)},getnow:function(){var e=1-((new date).gettime()-this.ts)/this.spd,t=this.b2(e)+this.b3(e)+this.b4(e);return 0>e?this.ed:this.st+math.round(this.df*t)},update:function(e,t){this.st=this.getnow();this.ed=e;this.spd=t;this.ts=(new date).gettime();this.df=this.ed-this.st;return this}};if(this.ishwscroll){this.doc.translate={x:0,y:0,tx:"0px",ty:"0px"};w.hastranslate3d&&w.isios&&this.doc.css("-webkit-backface-visibility","hidden");var s=function(){var e=y.doc.css(w.trstyle);return e&&"matrix"==e.substr(0,6)?e.replace(/^.*\((.*)\)$/g,"$1").replace(/px/g,"").split(/, +/):!1};this.getscrolltop=function(e){if(!e){if(e=s())return 16==e.length?-e[13]:-e[5];if(y.timerscroll&&y.timerscroll.bz)return y.timerscroll.bz.getnow()}return y.doc.translate.y};this.getscrollleft=function(e){if(!e){if(e=s())return 16==e.length?-e[12]:-e[4];if(y.timerscroll&&y.timerscroll.bh)return y.timerscroll.bh.getnow()}return y.doc.translate.x};this.notifyscrollevent=document.createevent?function(e){var t=document.createevent("uievents");t.inituievent("scroll",!1,!0,window,1);e.dispatchevent(t)}:document.fireevent?function(e){var t=document.createeventobject();e.fireevent("onscroll");t.cancelbubble=!0}:function(e,t){};w.hastranslate3d&&y.opt.enabletranslate3d?(this.setscrolltop=function(e,t){y.doc.translate.y=e;y.doc.translate.ty=-1*e+"px";y.doc.css(w.trstyle,"translate3d("+y.doc.translate.tx+","+y.doc.translate.ty+",0px)");t||y.notifyscrollevent(y.win[0])},this.setscrollleft=function(e,t){y.doc.translate.x=e;y.doc.translate.tx=-1*e+"px";y.doc.css(w.trstyle,"translate3d("+y.doc.translate.tx+","+y.doc.translate.ty+",0px)");t||y.notifyscrollevent(y.win[0])}):(this.setscrolltop=function(e,t){y.doc.translate.y=e;y.doc.translate.ty=-1*e+"px";y.doc.css(w.trstyle,"translate("+y.doc.translate.tx+","+y.doc.translate.ty+")");t||y.notifyscrollevent(y.win[0])},this.setscrollleft=function(e,t){y.doc.translate.x=e;y.doc.translate.tx=-1*e+"px";y.doc.css(w.trstyle,"translate("+y.doc.translate.tx+","+y.doc.translate.ty+")");t||y.notifyscrollevent(y.win[0])})}else this.getscrolltop=function(){return y.docscroll.scrolltop()},this.setscrolltop=function(e){return y.docscroll.scrolltop(e)},this.getscrollleft=function(){return y.docscroll.scrollleft()},this.setscrollleft=function(e){return y.docscroll.scrollleft(e)};this.gettarget=function(e){return!e?!1:e.target?e.target:e.srcelement?e.srcelement:!1};this.hasparent=function(e,t){if(!e)return!1;for(var n=e.target||e.srcelement||e||!1;n&&n.id!=t;)n=n.parentnode||!1;return!1!==n};var t={thin:1,medium:3,thick:5};this.getoffset=function(){if(y.isfixed)return{top:parsefloat(y.win.css("top")),left:parsefloat(y.win.css("left"))};if(!y.viewport)return y.win.offset();var e=y.win.offset(),t=y.viewport.offset();return{top:e.top-t.top+y.viewport.scrolltop(),left:e.left-t.left+y.viewport.scrollleft()}};this.updatescrollbar=function(e){if(y.ishwscroll)y.rail.css({height:y.win.innerheight()}),y.railh&&y.railh.css({width:y.win.innerwidth()});else{var t=y.getoffset(),n=t.top,r=t.left,n=n+p(y.win,"border-top-width",!0);y.win.outerwidth();y.win.innerwidth();var r=r+(y.rail.align?y.win.outerwidth()-p(y.win,"border-right-width")-y.rail.width:p(y.win,"border-left-width")),i=y.opt.railoffset;i&&(i.top&&(n+=i.top),y.rail.align&&i.left&&(r+=i.left));y.locked||y.rail.css({top:n,left:r,height:e?e.h:y.win.innerheight()});y.zoom&&y.zoom.css({top:n+1,left:1==y.rail.align?r-20:r+y.rail.width+4});y.railh&&!y.locked&&(n=t.top,r=t.left,e=y.railh.align?n+p(y.win,"border-top-width",!0)+y.win.innerheight()-y.railh.height:n+p(y.win,"border-top-width",!0),r+=p(y.win,"border-left-width"),y.railh.css({top:e,left:r,width:y.railh.width}))}};this.dorailclick=function(e,t,n){var r;y.locked||(y.cancelevent(e),t?(t=n?y.doscrollleft:y.doscrolltop,r=n?(e.pagex-y.railh.offset().left-y.cursorwidth/2)*y.scrollratio.x:(e.pagey-y.rail.offset().top-y.cursorheight/2)*y.scrollratio.y,t(r)):(t=n?y.doscrollleftby:y.doscrollby,r=n?y.scroll.x:y.scroll.y,e=n?e.pagex-y.railh.offset().left:e.pagey-y.rail.offset().top,n=n?y.view.w:y.view.h,r>=e?t(n):t(-n)))};y.hasanimationframe=u;y.hascancelanimationframe=a;y.hasanimationframe?y.hascancelanimationframe||(a=function(){y.cancelanimationframe=!0}):(u=function(e){return settimeout(e,15-math.floor(+(new date)/1e3)%16)},a=clearinterval);this.init=function(){y.saved.css=[];if(w.isie7mobile||w.isoperamini)return!0;w.hasmstouch&&y.css(y.ispage?e("html"):y.win,{"-ms-touch-action":"none"});y.zindex="auto";y.zindex=!y.ispage&&"auto"==y.opt.zindex?l()||"auto":y.opt.zindex;!y.ispage&&"auto"!=y.zindex&&y.zindex>s&&(s=y.zindex);y.isie&&0==y.zindex&&"auto"==y.opt.zindex&&(y.zindex="auto");if(!y.ispage||!w.cantouch&&!w.isieold&&!w.isie9mobile){var i=y.docscroll;y.ispage&&(i=y.haswrapper?y.win:y.doc);w.isie9mobile||y.css(i,{"overflow-y":"hidden"});y.ispage&&w.isie7&&("body"==y.doc[0].nodename?y.css(e("html"),{"overflow-y":"hidden"}):"html"==y.doc[0].nodename&&y.css(e("body"),{"overflow-y":"hidden"}));w.isios&&!y.ispage&&!y.haswrapper&&y.css(e("body"),{"-webkit-overflow-scrolling":"touch"});var o=e(document.createelement("div"));o.css({position:"relative",top:0,"float":"right",width:y.opt.cursorwidth,height:"0px","background-color":y.opt.cursorcolor,border:y.opt.cursorborder,"background-clip":"padding-box","-webkit-border-radius":y.opt.cursorborderradius,"-moz-border-radius":y.opt.cursorborderradius,"border-radius":y.opt.cursorborderradius});o.hborder=parsefloat(o.outerheight()-o.innerheight());y.cursor=o;var u=e(document.createelement("div"));u.attr("id",y.id);u.addclass("nicescroll-rails");var a,f,h=["left","right"],p;for(p in h)f=h[p],(a=y.opt.railpadding[f])?u.css("padding-"+f,a+"px"):y.opt.railpadding[f]=0;u.append(o);u.width=math.max(parsefloat(y.opt.cursorwidth),o.outerwidth())+y.opt.railpadding.left+y.opt.railpadding.right;u.css({width:u.width+"px",zindex:y.zindex,background:y.opt.background,cursor:"default"});u.visibility=!0;u.scrollable=!0;u.align="left"==y.opt.railalign?0:1;y.rail=u;o=y.rail.drag=!1;y.opt.boxzoom&&!y.ispage&&!w.isieold&&(o=document.createelement("div"),y.bind(o,"click",y.dozoom),y.zoom=e(o),y.zoom.css({cursor:"pointer","z-index":y.zindex,backgroundimage:"url("+y.opt.scriptpath+"zoomico.png)",height:18,width:18,backgroundposition:"0px 0px"}),y.opt.dblclickzoom&&y.bind(y.win,"dblclick",y.dozoom),w.cantouch&&y.opt.gesturezoom&&(y.ongesturezoom=function(e){1.5e.scale&&y.dozoomout(e);return y.cancelevent(e)},y.bind(y.win,"gestureend",y.ongesturezoom)));y.railh=!1;if(y.opt.horizrailenabled){y.css(i,{"overflow-x":"hidden"});o=e(document.createelement("div"));o.css({position:"relative",top:0,height:y.opt.cursorwidth,width:"0px","background-color":y.opt.cursorcolor,border:y.opt.cursorborder,"background-clip":"padding-box","-webkit-border-radius":y.opt.cursorborderradius,"-moz-border-radius":y.opt.cursorborderradius,"border-radius":y.opt.cursorborderradius});o.wborder=parsefloat(o.outerwidth()-o.innerwidth());y.cursorh=o;var d=e(document.createelement("div"));d.attr("id",y.id+"-hr");d.addclass("nicescroll-rails");d.height=math.max(parsefloat(y.opt.cursorwidth),o.outerheight());d.css({height:d.height+"px",zindex:y.zindex,background:y.opt.background});d.append(o);d.visibility=!0;d.scrollable=!0;d.align="top"==y.opt.railvalign?0:1;y.railh=d;y.railh.drag=!1}y.ispage?(u.css({position:"fixed",top:"0px",height:"100%"}),u.align?u.css({right:"0px"}):u.css({left:"0px"}),y.body.append(u),y.railh&&(d.css({position:"fixed",left:"0px",width:"100%"}),d.align?d.css({bottom:"0px"}):d.css({top:"0px"}),y.body.append(d))):(y.ishwscroll?("static"==y.win.css("position")&&y.css(y.win,{position:"relative"}),i="html"==y.win[0].nodename?y.body:y.win,y.zoom&&(y.zoom.css({position:"absolute",top:1,right:0,"margin-right":u.width+4}),i.append(y.zoom)),u.css({position:"absolute",top:0}),u.align?u.css({right:0}):u.css({left:0}),i.append(u),d&&(d.css({position:"absolute",left:0,bottom:0}),d.align?d.css({bottom:0}):d.css({top:0}),i.append(d))):(y.isfixed="fixed"==y.win.css("position"),i=y.isfixed?"fixed":"absolute",y.isfixed||(y.viewport=y.getviewport(y.win[0])),y.viewport&&(y.body=y.viewport,!1==/fixed|relative|absolute/.test(y.viewport.css("position"))&&y.css(y.viewport,{position:"relative"})),u.css({position:i}),y.zoom&&y.zoom.css({position:i}),y.updatescrollbar(),y.body.append(u),y.zoom&&y.body.append(y.zoom),y.railh&&(d.css({position:i}),y.body.append(d))),w.isios&&y.css(y.win,{"-webkit-tap-highlight-color":"rgba(0,0,0,0)","-webkit-touch-callout":"none"}),w.isie&&y.opt.disableoutline&&y.win.attr("hidefocus","true"),w.iswebkit&&y.opt.disableoutline&&y.win.css({outline:"none"}));!1===y.opt.autohidemode?(y.autohidedom=!1,y.rail.css({opacity:y.opt.cursoropacitymax}),y.railh&&y.railh.css({opacity:y.opt.cursoropacitymax})):!0===y.opt.autohidemode||"leave"===y.opt.autohidemode?(y.autohidedom=e().add(y.rail),w.isie8&&(y.autohidedom=y.autohidedom.add(y.cursor)),y.railh&&(y.autohidedom=y.autohidedom.add(y.railh)),y.railh&&w.isie8&&(y.autohidedom=y.autohidedom.add(y.cursorh))):"scroll"==y.opt.autohidemode?(y.autohidedom=e().add(y.rail),y.railh&&(y.autohidedom=y.autohidedom.add(y.railh))):"cursor"==y.opt.autohidemode?(y.autohidedom=e().add(y.cursor),y.railh&&(y.autohidedom=y.autohidedom.add(y.cursorh))):"hidden"==y.opt.autohidemode&&(y.autohidedom=!1,y.hide(),y.locked=!1);if(w.isie9mobile)y.scrollmom=new m(y),y.onmangotouch=function(e){e=y.getscrolltop();var t=y.getscrollleft();if(e==y.scrollmom.lastscrolly&&t==y.scrollmom.lastscrollx)return!0;var n=e-y.mangotouch.sy,r=t-y.mangotouch.sx;if(0!=math.round(math.sqrt(math.pow(r,2)+math.pow(n,2)))){var i=0>n?-1:1,s=0>r?-1:1,o=+(new date);y.mangotouch.lazy&&cleartimeout(y.mangotouch.lazy);80a?a=math.round(a/2):a>y.page.maxh&&(a=y.page.maxh+math.round((a-y.page.maxh)/2)):(0>a&&(s=a=0),a>y.page.maxh&&(a=y.page.maxh,s=0));if(y.railh&&y.railh.scrollable){var f=y.rail.drag.sl-u;y.ishwscroll&&y.opt.bouncescroll?0>f?f=math.round(f/2):f>y.page.maxw&&(f=y.page.maxw+math.round((f-y.page.maxw)/2)):(0>f&&(o=f=0),f>y.page.maxw&&(f=y.page.maxw,o=0))}r=!1;if(y.rail.drag.dl)r=!0,"v"==y.rail.drag.dl?f=y.rail.drag.sl:"h"==y.rail.drag.dl&&(a=y.rail.drag.st);else{var i=math.abs(i),u=math.abs(u),l=y.opt.directionlockdeadzone;if("v"==y.rail.drag.ck){if(i>l&&u<=.3*i)return y.rail.drag=!1,!0;u>l&&(y.rail.drag.dl="f",e("body").scrolltop(e("body").scrolltop()))}else if("h"==y.rail.drag.ck){if(u>l&&i<=.3*u)return y.rail.drag=!1,!0;i>l&&(y.rail.drag.dl="f",e("body").scrollleft(e("body").scrollleft()))}}y.synched("touchmove",function(){y.rail.drag&&2==y.rail.drag.pt&&(y.preparetransition&&y.preparetransition(0),y.rail.scrollable&&y.setscrolltop(a),y.scrollmom.update(o,s),y.railh&&y.railh.scrollable?(y.setscrollleft(f),y.showcursor(a,f)):y.showcursor(a),w.isie10&&document.selection.clear())});w.ischrome&&y.istouchcapable&&(r=!1);if(r)return y.cancelevent(t)}}}y.onmousedown=function(e,t){if(!(y.rail.drag&&1!=y.rail.drag.pt)){if(y.locked)return y.cancelevent(e);y.cancelscroll();y.rail.drag={x:e.clientx,y:e.clienty,sx:y.scroll.x,sy:y.scroll.y,pt:1,hr:!!t};var n=y.gettarget(e);!y.ispage&&w.hasmousecapture&&n.setcapture();y.isiframe&&!w.hasmousecapture&&(y.saved.csspointerevents=y.doc.css("pointer-events"),y.css(y.doc,{"pointer-events":"none"}));y.hasmoving=!1;return y.cancelevent(e)}};y.onmouseup=function(e){if(y.rail.drag&&(w.hasmousecapture&&document.releasecapture(),y.isiframe&&!w.hasmousecapture&&y.doc.css("pointer-events",y.saved.csspointerevents),1==y.rail.drag.pt))return y.rail.drag=!1,y.hasmoving&&y.triggerscrollend(),y.cancelevent(e)};y.onmousemove=function(e){if(y.rail.drag&&1==y.rail.drag.pt){if(w.ischrome&&0==e.which)return y.onmouseup(e);y.cursorfreezed=!0;y.hasmoving=!0;if(y.rail.drag.hr){y.scroll.x=y.rail.drag.sx+(e.clientx-y.rail.drag.x);0>y.scroll.x&&(y.scroll.x=0);var t=y.scrollvaluemaxw;y.scroll.x>t&&(y.scroll.x=t)}else y.scroll.y=y.rail.drag.sy+(e.clienty-y.rail.drag.y),0>y.scroll.y&&(y.scroll.y=0),t=y.scrollvaluemax,y.scroll.y>t&&(y.scroll.y=t);y.synched("mousemove",function(){y.rail.drag&&1==y.rail.drag.pt&&(y.showcursor(),y.rail.drag.hr?y.doscrollleft(math.round(y.scroll.x*y.scrollratio.x),y.opt.cursordragspeed):y.doscrolltop(math.round(y.scroll.y*y.scrollratio.y),y.opt.cursordragspeed))});return y.cancelevent(e)}};if(w.cantouch||y.opt.touchbehavior)y.onpreventclick=function(e){if(y.preventclick)return y.preventclick.tg.onclick=y.preventclick.click,y.preventclick=!1,y.cancelevent(e)},y.bind(y.win,"mousedown",y.ontouchstart),y.onclick=w.isios?!1:function(e){return y.lastmouseup?(y.lastmouseup=!1,y.cancelevent(e)):!0},y.opt.grabcursorenabled&&w.cursorgrabvalue&&(y.css(y.ispage?y.doc:y.win,{cursor:w.cursorgrabvalue}),y.css(y.rail,{cursor:w.cursorgrabvalue}));else{var g=function(e){if(y.selectiondrag){if(e){var t=y.win.outerheight();e=e.pagey-y.selectiondrag.top;0=t&&(e-=t);y.selectiondrag.df=e}0!=y.selectiondrag.df&&(y.doscrollby(2*-math.floor(y.selectiondrag.df/6)),y.debounced("doselectionscroll",function(){g()},50))}};y.hastextselected="getselection"in document?function(){return 0y.page.maxh?y.doscrolltop(y.page.maxh):(y.scroll.y=math.round(y.getscrolltop()*(1/y.scrollratio.y)),y.scroll.x=math.round(y.getscrollleft()*(1/y.scrollratio.x)),y.cursoractive&&y.noticecursor());y.scroll.y&&0==y.getscrolltop()&&y.doscrollto(math.floor(y.scroll.y*y.scrollratio.y));return y};this.resize=y.onresize;this.lazyresize=function(e){e=isnan(e)?30:e;y.delayed("resize",y.resize,e);return y};this._bind=function(e,t,n,r){y.events.push({e:e,n:t,f:n,b:r,q:!1});e.addeventlistener?e.addeventlistener(t,n,r||!1):e.attachevent?e.attachevent("on"+t,n):e["on"+t]=n};this.jqbind=function(t,n,r){y.events.push({e:t,n:n,f:r,q:!0});e(t).bind(n,r)};this.bind=function(e,t,n,r){var i="jquery"in e?e[0]:e;"mousewheel"==t?"onwheel"in y.win?y._bind(i,"wheel",n,r||!1):(e="undefined"!=typeof document.onmousewheel?"mousewheel":"dommousescroll",v(i,e,n,r||!1),"dommousescroll"==e&&v(i,"mozmousepixelscroll",n,r||!1)):i.addeventlistener?(w.cantouch&&/mouseup|mousedown|mousemove/.test(t)&&y._bind(i,"mousedown"==t?"touchstart":"mouseup"==t?"touchend":"touchmove",function(e){if(e.touches){if(2>e.touches.length){var t=e.touches.length?e.touches[0]:e;t.original=e;n.call(this,t)}}else e.changedtouches&&(t=e.changedtouches[0],t.original=e,n.call(this,t))},r||!1),y._bind(i,t,n,r||!1),w.cantouch&&"mouseup"==t&&y._bind(i,"touchcancel",n,r||!1)):y._bind(i,t,function(e){if((e=e||window.event||!1)&&e.srcelement)e.target=e.srcelement;"pagey"in e||(e.pagex=e.clientx+document.documentelement.scrollleft,e.pagey=e.clienty+document.documentelement.scrolltop);return!1===n.call(i,e)||!1===r?y.cancelevent(e):!0})};this._unbind=function(e,t,n,r){e.removeeventlistener?e.removeeventlistener(t,n,r):e.detachevent?e.detachevent("on"+t,n):e["on"+t]=!1};this.unbindall=function(){for(var e=0;e(y.newscrolly-r)*(t-r)||0>(y.newscrollx-i)*(e-i))&&y.cancelscroll();!1==y.opt.bouncescroll&&(0>t?t=0:t>y.page.maxh&&(t=y.page.maxh),0>e?e=0:e>y.page.maxw&&(e=y.page.maxw));if(y.scrollrunning&&e==y.newscrollx&&t==y.newscrolly)return!1;y.newscrolly=t;y.newscrollx=e;y.newscrollspeed=n||!1;if(y.timer)return!1;y.timer=settimeout(function(){var n=y.getscrolltop(),r=y.getscrollleft(),i,s;i=e-r;s=t-n;i=math.round(math.sqrt(math.pow(i,2)+math.pow(s,2)));i=y.newscrollspeed&&1=y.newscrollspeed&&(i*=y.newscrollspeed);y.preparetransition(i,!0);y.timerscroll&&y.timerscroll.tm&&clearinterval(y.timerscroll.tm);0e?e=0:e>y.page.maxh&&(e=y.page.maxh);0>t?t=0:t>y.page.maxw&&(t=y.page.maxw);if(e!=y.newscrolly||t!=y.newscrollx)return y.doscrollpos(t,e,y.opt.snapbackspeed);y.onscrollend&&y.scrollrunning&&y.triggerscrollend();y.scrollrunning=!1}):(this.doscrollleft=function(e,t){var n=y.scrollrunning?y.newscrolly:y.getscrolltop();y.doscrollpos(e,n,t)},this.doscrolltop=function(e,t){var n=y.scrollrunning?y.newscrollx:y.getscrollleft();y.doscrollpos(n,e,t)},this.doscrollpos=function(e,t,n){function r(){if(y.cancelanimationframe)return!0;y.scrollrunning=!0;if(c=1-c)return y.timer=u(r)||1;var e=0,t=sy=y.getscrolltop();if(y.dst.ay){var t=y.bzscroll?y.dst.py+y.bzscroll.getnow()*y.dst.ay:y.newscrolly,n=t-sy;if(0>n&&ty.newscrolly)t=y.newscrolly;y.setscrolltop(t);t==y.newscrolly&&(e=1)}else e=1;var i=sx=y.getscrollleft();if(y.dst.ax){i=y.bzscroll?y.dst.px+y.bzscroll.getnow()*y.dst.ax:y.newscrollx;n=i-sx;if(0>n&&iy.newscrollx)i=y.newscrollx;y.setscrollleft(i);i==y.newscrollx&&(e+=1)}else e+=1;2==e?(y.timer=0,y.cursorfreezed=!1,y.bzscroll=!1,y.scrollrunning=!1,0>t?t=0:t>y.page.maxh&&(t=y.page.maxh),0>i?i=0:i>y.page.maxw&&(i=y.page.maxw),i!=y.newscrollx||t!=y.newscrolly?y.doscrollpos(i,t):y.onscrollend&&y.triggerscrollend()):y.timer=u(r)||1}t="undefined"==typeof t||!1===t?y.getscrolltop(!0):t;if(y.timer&&y.newscrolly==t&&y.newscrollx==e)return!0;y.timer&&a(y.timer);y.timer=0;var i=y.getscrolltop(),s=y.getscrollleft();(0>(y.newscrolly-i)*(t-i)||0>(y.newscrollx-s)*(e-s))&&y.cancelscroll();y.newscrolly=t;y.newscrollx=e;if(!y.bouncescroll||!y.rail.visibility)0>y.newscrolly?y.newscrolly=0:y.newscrolly>y.page.maxh&&(y.newscrolly=y.page.maxh);if(!y.bouncescroll||!y.railh.visibility)0>y.newscrollx?y.newscrollx=0:y.newscrollx>y.page.maxw&&(y.newscrollx=y.page.maxw);y.dst={};y.dst.x=e-s;y.dst.y=t-i;y.dst.px=s;y.dst.py=i;var o=math.round(math.sqrt(math.pow(y.dst.x,2)+math.pow(y.dst.y,2)));y.dst.ax=y.dst.x/o;y.dst.ay=y.dst.y/o;var f=0,l=o;0==y.dst.x?(f=i,l=t,y.dst.ay=1,y.dst.py=0):0==y.dst.y&&(f=s,l=e,y.dst.ax=1,y.dst.px=0);o=y.gettransitionspeed(o);n&&1>=n&&(o*=n);y.bzscroll=0=y.page.maxh||s==y.page.maxw&&e>=y.page.maxw)&&y.checkcontentsize();var c=1;y.cancelanimationframe=!1;y.timer=1;y.onscrollstart&&!y.scrollrunning&&y.onscrollstart.call(y,{type:"scrollstart",current:{x:s,y:i},request:{x:e,y:t},end:{x:y.newscrollx,y:y.newscrolly},speed:o});r();(i==y.page.maxh&&t>=i||s==y.page.maxw&&e>=s)&&y.checkcontentsize();y.noticecursor()}},this.cancelscroll=function(){y.timer&&a(y.timer);y.timer=0;y.bzscroll=!1;y.scrollrunning=!1;return y}):(this.doscrollleft=function(e,t){var n=y.getscrolltop();y.doscrollpos(e,n,t)},this.doscrolltop=function(e,t){var n=y.getscrollleft();y.doscrollpos(n,e,t)},this.doscrollpos=function(e,t,n){var r=e>y.page.maxw?y.page.maxw:e;0>r&&(r=0);var i=t>y.page.maxh?y.page.maxh:t;0>i&&(i=0);y.synched("scroll",function(){y.setscrolltop(i);y.setscrollleft(r)})},this.cancelscroll=function(){});this.doscrollby=function(e,t){var n=0,n=t?math.floor((y.scroll.y-e)*y.scrollratio.y):(y.timer?y.newscrolly:y.getscrolltop(!0))-e;if(y.bouncescroll){var r=math.round(y.view.h/2);n<-r?n=-r:n>y.page.maxh+r&&(n=y.page.maxh+r)}y.cursorfreezed=!1;py=y.getscrolltop(!0);if(0>n&&0>=py)return y.noticecursor();if(n>y.page.maxh&&py>=y.page.maxh)return y.checkcontentsize(),y.noticecursor();y.doscrolltop(n)};this.doscrollleftby=function(e,t){var n=0,n=t?math.floor((y.scroll.x-e)*y.scrollratio.x):(y.timer?y.newscrollx:y.getscrollleft(!0))-e;if(y.bouncescroll){var r=math.round(y.view.w/2);n<-r?n=-r:n>y.page.maxw+r&&(n=y.page.maxw+r)}y.cursorfreezed=!1;px=y.getscrollleft(!0);if(0>n&&0>=px||n>y.page.maxw&&px>=y.page.maxw)return y.noticecursor();y.doscrollleft(n)};this.doscrollto=function(e,t){t&&math.round(e*y.scrollratio.y);y.cursorfreezed=!1;y.doscrolltop(e)};this.checkcontentsize=function(){var e=y.getcontentsize();(e.h!=y.page.h||e.w!=y.page.w)&&y.resize(!1,e)};y.onscroll=function(e){y.rail.drag||y.cursorfreezed||y.synched("scroll",function(){y.scroll.y=math.round(y.getscrolltop()*(1/y.scrollratio.y));y.railh&&(y.scroll.x=math.round(y.getscrollleft()*(1/y.scrollratio.x)));y.noticecursor()})};y.bind(y.docscroll,"scroll",y.onscroll);this.dozoomin=function(t){if(!y.zoomactive){y.zoomactive=!0;y.zoomrestore={style:{}};var n="position top left zindex backgroundcolor margintop marginbottom marginleft marginright".split(" "),r=y.win[0].style,i;for(i in n){var o=n[i];y.zoomrestore.style[o]="undefined"!=typeof r[o]?r[o]:""}y.zoomrestore.style.width=y.win.css("width");y.zoomrestore.style.height=y.win.css("height");y.zoomrestore.padding={w:y.win.outerwidth()-y.win.width(),h:y.win.outerheight()-y.win.height()};w.isios4&&(y.zoomrestore.scrolltop=e(window).scrolltop(),e(window).scrolltop(0));y.win.css({position:w.isios4?"absolute":"fixed",top:0,left:0,"z-index":s+100,margin:"0px"});n=y.win.css("backgroundcolor");(""==n||/transparent|rgba\(0, 0, 0, 0\)|rgba\(0,0,0,0\)/.test(n))&&y.win.css("backgroundcolor","#fff");y.rail.css({"z-index":s+101});y.zoom.css({"z-index":s+102});y.zoom.css("backgroundposition","0px -18px");y.resizezoom();y.onzoomin&&y.onzoomin.call(y);return y.cancelevent(t)}};this.dozoomout=function(t){if(y.zoomactive)return y.zoomactive=!1,y.win.css("margin",""),y.win.css(y.zoomrestore.style),w.isios4&&e(window).scrolltop(y.zoomrestore.scrolltop),y.rail.css({"z-index":y.zindex}),y.zoom.css({"z-index":y.zindex}),y.zoomrestore=!1,y.zoom.css("backgroundposition","0px 0px"),y.onresize(),y.onzoomout&&y.onzoomout.call(y),y.cancelevent(t)};this.dozoom=function(e){return y.zoomactive?y.dozoomout(e):y.dozoomin(e)};this.resizezoom=function(){if(y.zoomactive){var t=y.getscrolltop();y.win.css({width:e(window).width()-y.zoomrestore.padding.w+"px",height:e(window).height()-y.zoomrestore.padding.h+"px"});y.onresize();y.setscrolltop(math.min(y.page.maxh,t))}};this.init();e.nicescroll.push(this)},m=function(e){var t=this;this.nc=e;this.steptime=this.lasttime=this.speedy=this.speedx=this.lasty=this.lastx=0;this.snapy=this.snapx=!1;this.demuly=this.demulx=0;this.lastscrolly=this.lastscrollx=-1;this.timer=this.chky=this.chkx=0;this.time=function(){return+(new date)};this.reset=function(e,n){t.stop();var r=t.time();t.steptime=0;t.lasttime=r;t.speedx=0;t.speedy=0;t.lastx=e;t.lasty=n;t.lastscrollx=-1;t.lastscrolly=-1};this.update=function(e,n){var r=t.time();t.steptime=r-t.lasttime;t.lasttime=r;var r=n-t.lasty,i=e-t.lastx,s=t.nc.getscrolltop(),o=t.nc.getscrollleft(),s=s+r,o=o+i;t.snapx=0>o||o>t.nc.page.maxw;t.snapy=0>s||s>t.nc.page.maxh;t.speedx=i;t.speedy=r;t.lastx=e;t.lasty=n};this.stop=function(){t.nc.unsynched("domomentum2d");t.timer&&cleartimeout(t.timer);t.timer=0;t.lastscrollx=-1;t.lastscrolly=-1};this.dosnapy=function(e,n){var r=!1;0>n?(n=0,r=!0):n>t.nc.page.maxh&&(n=t.nc.page.maxh,r=!0);0>e?(e=0,r=!0):e>t.nc.page.maxw&&(e=t.nc.page.maxw,r=!0);r?t.nc.doscrollpos(e,n,t.nc.opt.snapbackspeed):t.nc.triggerscrollend()};this.domomentum=function(e){var n=t.time(),r=e?n+e:t.lasttime;e=t.nc.getscrollleft();var i=t.nc.getscrolltop(),s=t.nc.page.maxh,o=t.nc.page.maxw;t.speedx=0=n-r;if(0>i||i>s||0>e||e>o)r=!1;e=t.speedx&&r?t.speedx:!1;if(t.speedy&&r&&t.speedy||e){var u=math.max(16,t.steptime);50a||a>o))e=.1;if(t.speedy&&(f=math.floor(t.lastscrolly-t.speedy*(1-t.demulxy)),t.lastscrolly=f,0>f||f>s))e=.1;t.demulxy=math.min(1,t.demulxy+e);t.nc.synched("domomentum2d",function(){t.speedx&&(t.nc.getscrollleft()!=t.chkx&&t.stop(),t.chkx=a,t.nc.setscrollleft(a));t.speedy&&(t.nc.getscrolltop()!=t.chky&&t.stop(),t.chky=f,t.nc.setscrolltop(f));t.timer||(t.nc.hidecursor(),t.dosnapy(a,f))});1>t.demulxy?t.timer=settimeout(l,u):(t.stop(),t.nc.hidecursor(),t.dosnapy(a,f))};l()}else t.dosnapy(t.nc.getscrollleft(),t.nc.getscrolltop())}},g=e.fn.scrolltop;e.csshooks.pageyoffset={get:function(t,n,r){return(n=e.data(t,"__nicescroll")||!1)&&n.ishwscroll?n.getscrolltop():g.call(t)},set:function(t,n){var r=e.data(t,"__nicescroll")||!1;r&&r.ishwscroll?r.setscrolltop(parseint(n)):g.call(t,n);return this}};e.fn.scrolltop=function(t){if("undefined"==typeof t){var n=this[0]?e.data(this[0],"__nicescroll")||!1:!1;return n&&n.ishwscroll?n.getscrolltop():g.call(this)}return this.each(function(){var n=e.data(this,"__nicescroll")||!1;n&&n.ishwscroll?n.setscrolltop(parseint(t)):g.call(e(this),t)})};var y=e.fn.scrollleft;e.csshooks.pagexoffset={get:function(t,n,r){return(n=e.data(t,"__nicescroll")||!1)&&n.ishwscroll?n.getscrollleft():y.call(t)},set:function(t,n){var r=e.data(t,"__nicescroll")||!1;r&&r.ishwscroll?r.setscrollleft(parseint(n)):y.call(t,n);return this}};e.fn.scrollleft=function(t){if("undefined"==typeof t){var n=this[0]?e.data(this[0],"__nicescroll")||!1:!1;return n&&n.ishwscroll?n.getscrollleft():y.call(this)}return this.each(function(){var n=e.data(this,"__nicescroll")||!1;n&&n.ishwscroll?n.setscrollleft(parseint(t)):y.call(e(this),t)})};var b=function(t){var n=this;this.length=0;this.name="nicescrollarray";this.each=function(e){for(var t=0,r=0;t0?r.intensity:1,a=e.isplainobject(r.speed)?r.speed.fadein:r.speed,f=e.isplainobject(r.speed)?r.speed.fadeout:r.speed,l=e(window),c=".blackandwhite",h=document.all&&!window.opera&&window.xmlhttprequest?true:false,p=" -webkit- -moz- -o- -ms- ".split(" "),d={},v=function(e){if(d[e]||d[e]===""){return d[e]+e}var t=document.createelement("div"),n=["","moz","webkit","o","ms","khtml"];for(var r in n){if(typeof t.style[n[r]+e]!=="undefined"){d[e]=n[r];return n[r]+e}}return e.tolowercase()},m=function(){var e=document.createelement("div");e.style.csstext=p.join("filter"+":blur(2px); ");return!!e.style.length&&(document.documentmode===undefined||document.documentmode>9)}(),g=!!document.createelement("canvas").getcontext,y=function(){return typeof worker!=="undefined"?true:false}(),b=v("filter"),w=[],e=y&&s?new worker(s+"bnwworker.js"):false,s=function(t){e(t.currenttarget).find(".bwfade").stop(true,true).animate({opacity:o?0:1},f)},x=function(t){e(t.currenttarget).find(".bwfade").stop(true,true).animate({opacity:o?1:0},f)},t=function(e){if(typeof r.onimageready==="function"){r.onimageready(e)}},n=function(e){if(e&&g&&!m&&!e){c()}},c=function(){if(!w.length){if(e.terminate){e.terminate()}if(e.close){e.close()}return}e.postmessage({imgdata:w[0].imagedata,intensity:u});e.onmessage=function(e){w[0].ctx.putimagedata(e.data,0,0);t(w[0].img);w.splice(0,1);c()}},k=function(e){return e.complete||typeof e.naturalwidth!=="undefined"&&e.naturalwidth},l=function(e,t,n,r){var i=t.getcontext("2d"),s=e,o=0,a;i.drawimage(e,0,0,n,r);var f=i.getimagedata(0,0,n,r),l=f.data,c=l.length;if(e){w.push({imagedata:f,ctx:i,img:e})}else{for(;o');a.width=t.width();a.height=t.height();l(r,f.get(0),r.naturalwidth,r.naturalheight)}else{a[b]="grayscale("+u*100+"%)";f=t.clone().addclass("bwfilter bwfade");t(r)}f.css(e.extend(a,{filter:"progid:dximagetransform.microsoft.basicimage(grayscale=1)"})).prependto(n);if(!e.support.opacity&&o){f.animate({opacity:0},0)}},o=function(){n.each(function(t,n){var r=e(n).find("img"),i=e(r).width(),s=e(r).height();e(this).find("canvas").css({width:i,height:s})})},m=function(){var t=n.find("img").filter(function(){return!e(this).data("_b&w")}).length;n.each(function(n,r){var i=e(r),s=i.find("img");if(s.data("_b&w")){return}if(!k(s[0])){s.on("load",function(){if(s.data("_b&w_loaded")||!s[0].complete){settimeout(function(){s.load()},20);return}a(s,i);s.data("_b&w_loaded",true);t--;n(t)}).load()}else{t--;a(s,i)}s.data("_b&w",true)});n(t);if(i){n.unbind(c).on("mouseleave"+c,s).on("mouseenter"+c,x)}if(g&&!m){l.unbind(c).on("resize"+c+" orientationchange"+c,o)}};var _=function(){n.off(c);l.off(c)};m();return{destroy:_}}})})(jquery);
;/*
@name: horizontal multilevel menu with wp megamenu support
@author: muffin group
@www: www.muffingroup.com
@version: 2.0
*/
;(function($){
$.fn.extend({
muffingroup_menu: function(options) {
var menu = $(this);
var defaults = {
addlast : false,
animation : 'fade',
arrows : false,
delay : 100,
hoverclass : 'hover'
};
options = $.extend(defaults, options);
// .submenu --------------------------
menu.find("li:has(ul)")
.addclass("submenu")
.append("