/* * jquery touch optimized sliders "r"us 2.4.2 * * copyright (c) fred heusschen * www.frebsite.nl * * plugin website: * tosrus.frebsite.nl * * licensed under the mit license. * http://en.wikipedia.org/wiki/mit_license */ !function(s){function i(){o=function(s){return t+"-"+s},d=function(s){return t+"-"+s},a=function(s){return s+"."+t},s.each([o,d,a],function(s,i){i.add=function(s){s=s.split(" ");for(var e in s)i[s[e]]=i(s[e])}}),o.add("touch desktop scale-1 scale-2 scale-3 wrapper opened opening fixed inline hover slider slide loading noanimation fastanimation"),d.add("slide anchor"),a.add("open opening close closing prev next slideto sliding click pinch scroll resize orientationchange load loading loaded transitionend webkittransitionend"),r={complobject:function(i,e){return s.isplainobject(i)||(i=e),i},complboolean:function(s,i){return"boolean"!=typeof s&&(s=i),s},complnumber:function(i,e){return s.isnumeric(i)||(i=e),i},complstring:function(s,i){return"string"!=typeof s&&(s=i),s},ispercentage:function(s){return"string"==typeof s&&"%"==s.slice(-1)},getpercentage:function(s){return parseint(s.slice(0,-1))},resizeratio:function(s,i,e,t,n){var o=i.width(),d=i.height();e&&o>e&&(o=e),t&&d>t&&(d=t),n>o/d?d=o/n:o=d*n,s.width(o).height(d)},transitionend:function(s,i,e){var t=!1,n=function(){t||i.call(s[0]),t=!0};s.one(a.transitionend,n),s.one(a.webkittransitionend,n),settimeout(n,1.1*e)},setviewportscale:function(){if(l.viewportscale){var s=l.viewportscale.getscale();"undefined"!=typeof s&&(s=1/s,l.$body.removeclass(o["scale-1"]).removeclass(o["scale-2"]).removeclass(o["scale-3"]).addclass(o["scale-"+math.max(math.min(math.round(s),3),1)]))}}},l={$wndw:s(window),$html:s("html"),$body:s("body"),scrollposition:0,viewportscale:null,viewportscaleinterval:null},l.$body.addclass(s[e].support.touch?o.touch:o.desktop),l.$wndw.on(a.scroll,function(s){l.$body.hasclass(o.opened)&&(window.scrollto(0,l.scrollposition),s.preventdefault(),s.stoppropagation(),s.stopimmediatepropagation())}),!l.viewportscale&&s[e].support.touch&&"undefined"!=typeof flameviewportscale&&(l.viewportscale=new flameviewportscale,r.setviewportscale(),l.$wndw.on(a.orientationchange+" "+a.resize,function(){l.viewportscaleinterval&&(cleartimeout(l.viewportscaleinterval),l.viewportscaleinterval=null),l.viewportscaleinterval=settimeout(function(){r.setviewportscale()},500)})),s[e]._c=o,s[e]._d=d,s[e]._e=a,s[e]._f=r,s[e]._g=l}var e="tosrus",t="tos",n="2.4.2";if(!s[e]){var o={},d={},a={},r={},l={};s[e]=function(s,i,e){return this.$node=s,this.opts=i,this.conf=e,this.vars={},this.nodes={},this.slides={},this._init(),this},s[e].prototype={_init:function(){var i=this;this._complementoptions(),this.vars.fixed="window"==this.opts.wrapper.target,this.nodes.$wrpr=s('
'),this.nodes.$sldr=s('
').appendto(this.nodes.$wrpr),this.nodes.$wrpr.addclass(this.vars.fixed?o.fixed:o.inline).addclass(o("fx-"+this.opts.effect)).addclass(o(this.opts.slides.scale)).addclass(this.opts.wrapper.classes),this.nodes.$wrpr.on(a.open+" "+a.close+" "+a.prev+" "+a.next+" "+a.slideto,function(s){arguments=array.prototype.slice.call(arguments);var s=arguments.shift(),e=s.type;s.stoppropagation(),"function"==typeof i[e]&&i[e].apply(i,arguments)}).on(a.opening+" "+a.closing+" "+a.sliding+" "+a.loading+" "+a.loaded,function(s){s.stoppropagation()}).on(a.click,function(e){switch(e.stoppropagation(),i.opts.wrapper.onclick){case"toggleui":i.nodes.$wrpr.toggleclass(o.hover);break;case"close":s(e.target).is("img")||i.close()}}),this.nodes.$anchors=this._initanchors(),this.nodes.$slides=this._initslides(),this.slides.total=this.nodes.$slides.length,this.slides.visible=this.opts.slides.visible,this.slides.index=0,this.vars.opened=!0;for(var t=0;ti){var d=0==this.slides.index;this.opts.infinite?i=d?this.slides.total-this.slides.visible:0:(i=0,d&&(n=!1))}if(i+this.slides.visible>this.slides.total){var l=this.slides.index+this.slides.visible>=this.slides.total;this.opts.infinite?i=l?0:this.slides.total-this.slides.visible:(i=this.slides.total-this.slides.visible,l&&(n=!1))}if(this.slides.index=i,this._loadcontents(),n){var h=0-this.slides.index*this.opts.slides.width+this.opts.slides.offset;this.slides.widthpercentage&&(h+="%"),t&&(this.nodes.$sldr.addclass(o.noanimation),r.transitionend(this.nodes.$sldr,function(){s(this).removeclass(o.noanimation)},5));for(var c in s[e].effects)if(c==this.opts.effect){s[e].effects[c].call(this,h,t);break}this.nodes.$wrpr.trigger(a.sliding,[i,t])}},_initanchors:function(){var i=this,t=s();if(this.$node.is("a"))for(var n in s[e].media)t=t.add(this.$node.filter(function(){if(i.opts.media[n]&&i.opts.media[n].filteranchors){var t=i.opts.media[n].filteranchors.call(i,s(this));if("boolean"==typeof t)return t}return s[e].media[n].filteranchors.call(i,s(this))}));return t},_initslides:function(){return this[this.$node.is("a")?"_initslidesfromanchors":"_initslidesfromcontent"](),this.nodes.$sldr.children().css("width",this.opts.slides.width+(this.slides.widthpercentage?"%":"px"))},_initslidesfromanchors:function(){var i=this;this.nodes.$anchors.each(function(e){var t=s(this),n=s('
').data(d.anchor,t).appendto(i.nodes.$sldr);t.data(d.slide,n).on(a.click,function(s){s.preventdefault(),i.open(e)})})},_initslidesfromcontent:function(){var i=this;this.$node.children().each(function(){var t=s(this);s('
').append(t).appendto(i.nodes.$sldr);for(var n in s[e].media){var d=null;if(i.opts.media[n]&&i.opts.media[n].filterslides&&(d=i.opts.media[n].filterslides.call(i,t)),"boolean"!=typeof d&&(d=s[e].media[n].filterslides.call(i,t)),d){s[e].media[n].initslides.call(i,t),t.parent().addclass(o(n));break}}})},_loadcontents:function(){var s=this;switch(this.opts.slides.load){case"all":this._loadcontent(0,this.slides.total);break;case"visible":this._loadcontent(this.slides.index,this.slides.index+this.slides.visible);break;case"near-visible":default:this._loadcontent(this.slides.index,this.slides.index+this.slides.visible),settimeout(function(){s._loadcontent(s.slides.index-s.slides.visible,s.slides.index),s._loadcontent(s.slides.index+s.slides.visible,s.slides.index+2*s.slides.visible)},this.conf.transitionduration)}},_loadcontent:function(i,t){var n=this;this.nodes.$slides.slice(i,t).each(function(){var i=s(this);if(0==i.children().length){var t=i.data(d.anchor),r=t.attr("href");for(var l in s[e].media){var h=null;if(n.opts.media[l]&&n.opts.media[l].filteranchors&&(h=n.opts.media[l].filteranchors.call(n,t)),"boolean"!=typeof h&&(h=s[e].media[l].filteranchors.call(n,t)),h){s[e].media[l].initanchors.call(n,i,r),i.addclass(o(l));break}}i.trigger(a.loading,[i.data(d.anchor)])}})},_complementoptions:function(){if("undefined"==typeof this.opts.wrapper.target&&(this.opts.wrapper.target=this.$node.is("a")?"window":this.$node),"window"!=this.opts.wrapper.target&&"string"==typeof this.opts.wrapper.target&&(this.opts.wrapper.target=s(this.opts.wrapper.target)),this.opts.show=r.complboolean(this.opts.show,"window"!=this.opts.wrapper.target),s.isnumeric(this.opts.slides.width))this.slides.widthpercentage=!1,this.opts.slides.visible=r.complnumber(this.opts.slides.visible,1);else{var i=r.ispercentage(this.opts.slides.width)?r.getpercentage(this.opts.slides.width):!1;this.slides.widthpercentage=!0,this.opts.slides.visible=r.complnumber(this.opts.slides.visible,i?math.floor(100/i):1),this.opts.slides.width=i?i:math.ceil(1e4/this.opts.slides.visible)/100}this.opts.slides.slide=r.complnumber(this.opts.slides.slide,this.opts.slides.visible),this.opts.slides.offset=r.ispercentage(this.opts.slides.offset)?r.getpercentage(this.opts.slides.offset):r.complnumber(this.opts.slides.offset,0)},_uniqueid:function(){return this.__uniqueid||(this.__uniqueid=0),this.__uniqueid++,o("uid-"+this.__uniqueid)}},s.fn[e]=function(t,n,o,d){l.$wndw||i(),t=s.extend(!0,{},s[e].defaults,t),t=s.extend(!0,{},t,s[e].support.touch?o:n),d=s.extend(!0,{},s[e].configuration,d);var a=new s[e](this,t,d);return this.data(e,a),a.nodes.$wrpr},s[e].support={touch:"ontouchstart"in window.document||navigator.msmaxtouchpoints},s[e].defaults={infinite:!1,effect:"slide",wrapper:{classes:"",onclick:"toggleui"},slides:{offset:0,scale:"fit",load:"near-visible",visible:1},media:{}},s[e].configuration={transitionduration:400},s[e].constants={},s[e].debug=function(){},s[e].deprecated=function(s,i){"undefined"!=typeof console&&"undefined"!=typeof console.warn&&console.warn(e+": "+s+" is deprecated, use "+i+" instead.")},s[e].effects={slide:function(s){this.nodes.$sldr.css("left",s)},fade:function(i){r.transitionend(this.nodes.$sldr,function(){s(this).css("left",i).css("opacity",1)},this.conf.transitionduration),this.nodes.$sldr.css("opacity",0)}},s[e].version=n,s[e].media={},s[e].addons=[],s[e].ui=[]}}(jquery); /* * jquery touch optimized sliders "r"us * autoplay addon * * copyright (c) fred heusschen * www.frebsite.nl */ !function(t){var o,s,u,a,i,n="tosrus",e="autoplay",p=!1;t[n].prototype["_addon_"+e]=function(){p||(o=t[n]._c,s=t[n]._d,u=t[n]._e,a=t[n]._f,i=t[n]._g,u.add("mouseover mouseout"),p=!0);var r=this,y=this.opts[e];y.play&&(this.opts.infinite=!0,this.nodes.$wrpr.on(u.sliding,function(){r.autoplay()}),y.pauseonhover&&this.nodes.$wrpr.on(u.mouseover,function(){r.autostop()}).on(u.mouseout,function(){r.autoplay()}),this.autoplay())},t[n].prototype.autoplay=function(){var t=this;this.autostop(),this.vars.autoplay=settimeout(function(){t.next()},this.opts[e].timeout)},t[n].prototype.autostop=function(){this.vars.autoplay&&cleartimeout(this.vars.autoplay)},t[n].defaults[e]={play:!1,timeout:4e3,pauseonhover:!1},t[n].addons.push(e)}(jquery); /* * jquery touch optimized sliders "r"us * buttons addon * * copyright (c) fred heusschen * www.frebsite.nl */ !function(s){function e(e,n){return s('')}function n(s,e,n,t){e.on(o.click,function(e){e.preventdefault(),e.stoppropagation(),s.trigger(o[n],[t])})}var t,i,o,d,p,l="tosrus",r="buttons",a=!1;s[l].prototype["_addon_"+r]=function(){a||(t=s[l]._c,i=s[l]._d,o=s[l]._e,d=s[l]._f,p=s[l]._g,t.add("prev next close disabled"),a=!0);var u=this,h=this.opts[r];this.nodes.$prev=null,this.nodes.$next=null,this.nodes.$clse=null,("boolean"==typeof h||"string"==typeof h&&"inline"==h)&&(h={prev:h,next:h}),"undefined"==typeof h.close&&(h.close=this.vars.fixed),this.nodes.$slides.length<2&&(h.prev=!1,h.next=!1),s.each({prev:"prev",next:"next",close:"clse"},function(i,d){h[i]&&("string"==typeof h[i]&&"inline"==h[i]?u.vars.fixed&&"close"!=i&&u.nodes.$slides.on(o.loading,function(){var o=e(i," "+t.inline)["prev"==i?"prependto":"appendto"](this);n(u.nodes.$wrpr,o,i,1),u.opts.infinite||("prev"==i&&s(this).is(":first-child")||"next"==i&&s(this).is(":last-child"))&&o.addclass(t.disabled)}):("string"==typeof h[i]&&(h[i]=s(h[i])),u.nodes["$"+d]=h[i]instanceof s?h[i]:e(i,"").appendto(u.nodes.$wrpr),n(u.nodes.$wrpr,u.nodes["$"+d],i,null)))}),this.opts.infinite||(this.updatebuttons(),this.nodes.$wrpr.on(o.sliding,function(){u.updatebuttons()}))},s[l].prototype.updatebuttons=function(){this.nodes.$prev&&this.nodes.$prev[(this.slides.index<1?"add":"remove")+"class"](t.disabled),this.nodes.$next&&this.nodes.$next[(this.slides.index>=this.slides.total-this.slides.visible?"add":"remove")+"class"](t.disabled)},s[l].defaults[r]={prev:!s[l].support.touch,next:!s[l].support.touch},s[l].addons.push(r),s[l].ui.push("prev"),s[l].ui.push("next"),s[l].ui.push("close")}(jquery); /* * jquery touch optimized sliders "r"us * caption addon * * copyright (c) fred heusschen * www.frebsite.nl */ !function(t){var i,s,a,e,d,n="tosrus",r="caption",o=!1;t[n].prototype["_addon_"+r]=function(){o||(i=t[n]._c,s=t[n]._d,a=t[n]._e,e=t[n]._f,d=t[n]._g,i.add("caption uibg"),s.add("caption"),o=!0);var p=this,c=this.opts[r];if(c.add){c.attributes=c.attributes||[],"string"==typeof c.target&&(c.target=t(c.target)),c.target instanceof t?this.nodes.$capt=c.target:(this.nodes.$capt=t('
').appendto(this.nodes.$wrpr),this.nodes.$uibg||(this.nodes.$uibg=t('
').prependto(this.nodes.$wrpr)));for(var h=0,l=this.slides.visible;l>h;h++)t('
').css("width",this.opts.slides.width+(this.slides.widthpercentage?"%":"px")).appendto(this.nodes.$capt);this.nodes.$slides.each(function(){var i=t(this),a=p.vars.fixed?i.data(s.anchor):i.children();i.data(s.caption,"");for(var e=0,d=c.attributes.length;d>e;e++){var n=a.attr(c.attributes[e]);if(n&&n.length){i.data(s.caption,n);break}}}),this.nodes.$wrpr.on(a.sliding,function(){for(var t=0,i=p.slides.visible;i>t;t++)p.nodes.$capt.children().eq(t).html(p.nodes.$sldr.children().eq(p.slides.index+t).data(s.caption)||"")})}},t[n].defaults[r]={add:!1,target:null,attributes:["title","alt","rel"]},t[n].addons.push(r),t[n].ui.push("caption")}(jquery); /* * jquery touch optimized sliders "r"us * drag addon * * copyright (c) fred heusschen * www.frebsite.nl */ !function(e){if("function"==typeof hammer){var n,s,t,i,r,a="tosrus",o="drag",d=!1;e[a].prototype["_addon_"+o]=function(){d||(n=e[a]._c,s=e[a]._d,t=e[a]._e,i=e[a]._f,r=e[a]._g,d=!0);var l=this;if(this.opts[o]&&"slide"==this.opts.effect){if(hammer.version<2)return e[a].deprecated("older version of the hammer library","version 2 or newer"),void 0;if(this.nodes.$slides.length>1){var f=0,p=!1,h=!1,c=new hammer(this.nodes.$wrpr[0]);c.on("panstart panleft panright panend swipeleft swiperight",function(e){e.preventdefault()}).on("panstart",function(){l.nodes.$sldr.addclass(n.noanimation)}).on("panleft panright",function(e){switch(f=e.deltax,h=!1,e.direction){case 2:p="left";break;case 4:p="right";break;default:p=!1}("left"==p&&l.slides.index+l.slides.visible>=l.slides.total||"right"==p&&0==l.slides.index)&&(f/=2.5),l.nodes.$sldr.css("margin-left",math.round(f))}).on("swipeleft swiperight",function(){h=!0}).on("panend",function(){if(l.nodes.$sldr.removeclass(n.noanimation).addclass(n.fastanimation),i.transitionend(l.nodes.$sldr,function(){l.nodes.$sldr.removeclass(n.fastanimation)},l.conf.transitionduration/2),l.nodes.$sldr.css("margin-left",0),"left"==p||"right"==p){if(h)var e=l.slides.visible;else var s=l.nodes.$slides.first().width(),e=math.floor((math.abs(f)+s/2)/s);e>0&&l.nodes.$wrpr.trigger(t["left"==p?"next":"prev"],[e])}p=!1})}}},e[a].defaults[o]=e[a].support.touch,e[a].addons.push(o)}}(jquery); /* * jquery touch optimized sliders "r"us * keys addon * * copyright (c) fred heusschen * www.frebsite.nl */ !function(e){var t,o,n,s,a,r="tosrus",p="keys",c=!1;e[r].prototype["_addon_"+p]=function(){c||(t=e[r]._c,o=e[r]._d,n=e[r]._e,s=e[r]._f,a=e[r]._g,n.add("keyup"),c=!0);var i=this,d=this.opts[p];if("boolean"==typeof d&&d&&(d={prev:!0,next:!0,close:!0}),e.isplainobject(d)){for(var f in e[r].constants[p])"boolean"==typeof d[f]&&d[f]&&(d[f]=e[r].constants[p][f]);this.nodes.$slides.length<2&&(d.prev=!1,d.next=!1),e(document).on(n.keyup,function(e){if(i.vars.opened){var t=!1;switch(e.keycode){case d.prev:t=n.prev;break;case d.next:t=n.next;break;case d.close:t=n.close}t&&(e.preventdefault(),e.stoppropagation(),i.nodes.$wrpr.trigger(t))}})}},e[r].defaults[p]=!1,e[r].constants[p]={prev:37,next:39,close:27},e[r].addons.push(p)}(jquery); /* * jquery touch optimized sliders "r"us * pagination addon * * copyright (c) fred heusschen * www.frebsite.nl */ !function(t){var e,i,n,s,a,r="tosrus",o="pagination",d=!1;t[r].prototype["_addon_"+o]=function(){d||(e=t[r]._c,i=t[r]._d,n=t[r]._e,s=t[r]._f,a=t[r]._g,e.add("pagination selected uibg bullets thumbnails"),d=!0);var u=this,l=this.opts[o];if(this.nodes.$slides.length<2&&(l.add=!1),l.add){if("string"==typeof l.target&&(l.target=t(l.target)),l.target instanceof t?this.nodes.$pagr=l.target:(this.nodes.$pagr=t('
').appendto(this.nodes.$wrpr),this.nodes.$uibg||(this.nodes.$uibg=t('
').prependto(this.nodes.$wrpr))),"function"!=typeof l.anchorbuilder)switch(l.type){case"thumbnails":var h='';l.anchorbuilder=this.vars.fixed?function(){return h+t(this).data(i.anchor).attr("href")+p}:function(){return h+t(this).find("img").attr("src")+p};break;case"bullets":default:l.anchorbuilder=function(){return''}}this.nodes.$slides.each(function(e){t(l.anchorbuilder.call(this,e+1)).appendto(u.nodes.$pagr).on(n.click,function(t){t.preventdefault(),t.stoppropagation(),u.nodes.$wrpr.trigger(n.slideto,[e])})}),this.updatepagination(),this.nodes.$wrpr.on(n.sliding,function(){u.updatepagination()})}},t[r].prototype.updatepagination=function(){this.nodes.$pagr&&this.nodes.$pagr.children().removeclass(e.selected).eq(this.slides.index).addclass(e.selected)},t[r].defaults[o]={add:!1,type:"bullets",target:null,anchorbuilder:null},t[r].addons.push(o),t[r].ui.push("pagination"),t[r].ui.push("bullets"),t[r].ui.push("thumbnails")}(jquery); /* * jquery touch optimized sliders "r"us * html media * * copyright (c) fred heusschen * www.frebsite.nl */ !function(i){var e="tosrus",n="html";i[e].media[n]={filteranchors:function(e){var n=e.attr("href");return"#"==n.slice(0,1)&&i(n).is("div")},initanchors:function(n,t){i('
').append(i(t)).appendto(n),n.removeclass(i[e]._c.loading).trigger(i[e]._e.loaded)},filterslides:function(i){return i.is("div")},initslides:function(){}},i[e].defaults.media[n]={}}(jquery); /* * jquery touch optimized sliders "r"us * images media * * copyright (c) fred heusschen * www.frebsite.nl */ !function(i){var e="tosrus",n="image";i[e].media[n]={filteranchors:function(e){return i.inarray(e.attr("href").tolowercase().split(".").pop().split("?")[0],["jpg","jpe","jpeg","gif","png"])>-1},initanchors:function(n,r){i('').on(i[e]._e.load,function(r){r.stoppropagation(),n.removeclass(i[e]._c.loading).trigger(i[e]._e.loaded)}).appendto(n).attr("src",r)},filterslides:function(i){return i.is("img")},initslides:function(){}},i[e].defaults.media[n]={}}(jquery); /* * jquery touch optimized sliders "r"us * vimeo media * * copyright (c) fred heusschen * www.frebsite.nl */ !function(i){function t(t){function l(){f.length&&(f.attr("src",""),f.attr("src",h))}c||(a=i[s]._c,e=i[s]._d,o=i[s]._e,r=i[s]._f,n=i[s]._g,e.add("ratio maxwidth maxheight"),c=!0);var f=t.children(),m=t.data(i[s]._d.anchor)||i(),h=f.attr("src"),u=m.data(e.ratio)||this.opts[d].ratio,g=m.data(e.maxwidth)||this.opts[d].maxwidth,p=m.data(e.maxheight)||this.opts[d].maxheight;t.removeclass(a.loading).trigger(o.loaded).on(o.loading,function(){r.resizeratio(f,t,g,p,u)}),this.nodes.$wrpr.on(o.sliding,function(){l()}).on(o.closing,function(){l()}),n.$wndw.on(o.resize,function(){r.resizeratio(f,t,g,p,u)})}var a,e,o,r,n,s="tosrus",d="vimeo",c=!1;i[s].media[d]={filteranchors:function(i){return i.attr("href").tolowercase().indexof("vimeo.com/")>-1},initanchors:function(a,e){var o=this._uniqueid();e=e.split("vimeo.com/")[1].split("?")[0]+"?api=1&player_id="+o,i('