/*! * IASD Bootstrap v1.5.0 (http://styleguide.adventistas.org) * Copyright 2014-2015 Igreja Adventista do Sétimo Dia * Licensed under MIT (https://github.com/igrejaadventista/styleguide/blob/master/LICENSE) */ /* Modernizr 2.6.2 (Custom Build) | MIT & BSD * Build: http://modernizr.com/download/#-touch-mq-cssclasses-teststyles-prefixes-load */ ;window.Modernizr=function(a,b,c){function x(a){j.cssText=a}function y(a,b){return x(m.join(a+";")+(b||""))}function z(a,b){return typeof a===b}function A(a,b){return!!~(""+a).indexOf(b)}function B(a,b,d){for(var e in a){var f=b[a[e]];if(f!==c)return d===!1?a[e]:z(f,"function")?f.bind(d||b):f}return!1}var d="2.6.2",e={},f=!0,g=b.documentElement,h="modernizr",i=b.createElement(h),j=i.style,k,l={}.toString,m=" -webkit- -moz- -o- -ms- ".split(" "),n={},o={},p={},q=[],r=q.slice,s,t=function(a,c,d,e){var f,i,j,k,l=b.createElement("div"),m=b.body,n=m||b.createElement("body");if(parseInt(d,10))while(d--)j=b.createElement("div"),j.id=e?e[d]:h+(d+1),l.appendChild(j);return f=["­",'"].join(""),l.id=h,(m?l:n).innerHTML+=f,n.appendChild(l),m||(n.style.background="",n.style.overflow="hidden",k=g.style.overflow,g.style.overflow="hidden",g.appendChild(n)),i=c(l,a),m?l.parentNode.removeChild(l):(n.parentNode.removeChild(n),g.style.overflow=k),!!i},u=function(b){var c=a.matchMedia||a.msMatchMedia;if(c)return c(b).matches;var d;return t("@media "+b+" { #"+h+" { position: absolute; } }",function(b){d=(a.getComputedStyle?getComputedStyle(b,null):b.currentStyle)["position"]=="absolute"}),d},v={}.hasOwnProperty,w;!z(v,"undefined")&&!z(v.call,"undefined")?w=function(a,b){return v.call(a,b)}:w=function(a,b){return b in a&&z(a.constructor.prototype[b],"undefined")},Function.prototype.bind||(Function.prototype.bind=function(b){var c=this;if(typeof c!="function")throw new TypeError;var d=r.call(arguments,1),e=function(){if(this instanceof e){var a=function(){};a.prototype=c.prototype;var f=new a,g=c.apply(f,d.concat(r.call(arguments)));return Object(g)===g?g:f}return c.apply(b,d.concat(r.call(arguments)))};return e}),n.touch=function(){var c;return"ontouchstart"in a||a.DocumentTouch&&b instanceof DocumentTouch?c=!0:t(["@media (",m.join("touch-enabled),("),h,")","{#modernizr{top:9px;position:absolute}}"].join(""),function(a){c=a.offsetTop===9}),c};for(var C in n)w(n,C)&&(s=C.toLowerCase(),e[s]=n[C](),q.push((e[s]?"":"no-")+s));return e.addTest=function(a,b){if(typeof a=="object")for(var d in a)w(a,d)&&e.addTest(d,a[d]);else{a=a.toLowerCase();if(e[a]!==c)return e;b=typeof b=="function"?b():b,typeof f!="undefined"&&f&&(g.className+=" "+(b?"":"no-")+a),e[a]=b}return e},x(""),i=k=null,e._version=d,e._prefixes=m,e.mq=u,e.testStyles=t,g.className=g.className.replace(/(^|\s)no-js(\s|$)/,"$1$2")+(f?" js "+q.join(" "):""),e}(this,this.document),function(a,b,c){function d(a){return"[object Function]"==o.call(a)}function e(a){return"string"==typeof a}function f(){}function g(a){return!a||"loaded"==a||"complete"==a||"uninitialized"==a}function h(){var a=p.shift();q=1,a?a.t?m(function(){("c"==a.t?B.injectCss:B.injectJs)(a.s,0,a.a,a.x,a.e,1)},0):(a(),h()):q=0}function i(a,c,d,e,f,i,j){function k(b){if(!o&&g(l.readyState)&&(u.r=o=1,!q&&h(),l.onload=l.onreadystatechange=null,b)){"img"!=a&&m(function(){t.removeChild(l)},50);for(var d in y[c])y[c].hasOwnProperty(d)&&y[c][d].onload()}}var j=j||B.errorTimeout,l=b.createElement(a),o=0,r=0,u={t:d,s:c,e:f,a:i,x:j};1===y[c]&&(r=1,y[c]=[]),"object"==a?l.data=c:(l.src=c,l.type=a),l.width=l.height="0",l.onerror=l.onload=l.onreadystatechange=function(){k.call(this,r)},p.splice(e,0,u),"img"!=a&&(r||2===y[c]?(t.insertBefore(l,s?null:n),m(k,j)):y[c].push(l))}function j(a,b,c,d,f){return q=0,b=b||"j",e(a)?i("c"==b?v:u,a,b,this.i++,c,d,f):(p.splice(this.i++,0,a),1==p.length&&h()),this}function k(){var a=B;return a.loader={load:j,i:0},a}var l=b.documentElement,m=a.setTimeout,n=b.getElementsByTagName("script")[0],o={}.toString,p=[],q=0,r="MozAppearance"in l.style,s=r&&!!b.createRange().compareNode,t=s?l:n.parentNode,l=a.opera&&"[object Opera]"==o.call(a.opera),l=!!b.attachEvent&&!l,u=r?"object":l?"script":"img",v=l?"script":u,w=Array.isArray||function(a){return"[object Array]"==o.call(a)},x=[],y={},z={timeout:function(a,b){return b.length&&(a.timeout=b[0]),a}},A,B;B=function(a){function b(a){var a=a.split("!"),b=x.length,c=a.pop(),d=a.length,c={url:c,origUrl:c,prefixes:a},e,f,g;for(f=0;fthis.$items.length-1||0>b?void 0:this.sliding?this.$element.one("slid",function(){c.to(b)}):d==b?this.pause().cycle():this.slide(b>d?"next":"prev",a(this.$items[b]))},b.prototype.pause=function(b){return b||(this.paused=!0),this.$element.find(".next, .prev").length&&a.support.transition.end&&(this.$element.trigger(a.support.transition.end),this.cycle(!0)),this.interval=clearInterval(this.interval),this},b.prototype.next=function(){return this.sliding?void 0:this.slide("next")},b.prototype.prev=function(){return this.sliding?void 0:this.slide("prev")},b.prototype.slide=function(b,c){var d=this.$element.find(".item.active"),e=c||d[b](),f=this.interval,g="next"==b?"left":"right",h="next"==b?"first":"last",i=this;if(!e.length){if(!this.options.wrap)return;e=this.$element.find(".item")[h]()}this.sliding=!0,f&&this.pause();var j=a.Event("slide.bs.carousel",{relatedTarget:e[0],direction:g});if(!e.hasClass("active")){if(this.$indicators.length&&(this.$indicators.find(".active").removeClass("active"),this.$element.one("slid",function(){var b=a(i.$indicators.children()[i.getActiveIndex()]);b&&b.addClass("active")})),a.support.transition&&this.$element.hasClass("slide")){if(this.$element.trigger(j),j.isDefaultPrevented())return;e.addClass(b),e[0].offsetWidth,d.addClass(g),e.addClass(g),d.one(a.support.transition.end,function(){e.removeClass([b,g].join(" ")).addClass("active"),d.removeClass(["active",g].join(" ")),i.sliding=!1,setTimeout(function(){i.$element.trigger("slid")},0)}).emulateTransitionEnd(600)}else{if(this.$element.trigger(j),j.isDefaultPrevented())return;d.removeClass("active"),e.addClass("active"),this.sliding=!1,this.$element.trigger("slid")}return f&&this.cycle(),this}};var c=a.fn.carousel;a.fn.carousel=function(c){return this.each(function(){var d=a(this),e=d.data("bs.carousel"),f=a.extend({},b.DEFAULTS,d.data(),"object"==typeof c&&c),g="string"==typeof c?c:f.slide;e||d.data("bs.carousel",e=new b(this,f)),"number"==typeof c?e.to(c):g?e[g]():f.interval&&e.pause().cycle()})},a.fn.carousel.Constructor=b,a.fn.carousel.noConflict=function(){return a.fn.carousel=c,this},a(document).on("click.bs.carousel.data-api","[data-slide], [data-slide-to]",function(b){var c,d=a(this),e=a(d.attr("data-target")||(c=d.attr("href"))&&c.replace(/.*(?=#[^\s]+$)/,"")),f=a.extend({},e.data(),d.data()),g=d.attr("data-slide-to");g&&(f.interval=!1),e.carousel(f),(g=d.attr("data-slide-to"))&&e.data("bs.carousel").to(g),b.preventDefault()}),a(window).on("load",function(){a('[data-ride="carousel"]').each(function(){var b=a(this);b.carousel(b.data())})})}(window.jQuery),+function(a){"use strict";var b=function(c,d){this.$element=a(c),this.options=a.extend({},b.DEFAULTS,d),this.transitioning=null,this.options.parent&&(this.$parent=a(this.options.parent)),this.options.toggle&&this.toggle()};b.DEFAULTS={toggle:!0},b.prototype.dimension=function(){var a=this.$element.hasClass("width");return a?"width":"height"},b.prototype.show=function(){if(!this.transitioning&&!this.$element.hasClass("in")){var b=a.Event("show.bs.collapse");if(this.$element.trigger(b),!b.isDefaultPrevented()){var c=this.$parent&&this.$parent.find("> .panel > .in");if(c&&c.length){var d=c.data("bs.collapse");if(d&&d.transitioning)return;c.collapse("hide"),d||c.data("bs.collapse",null)}var e=this.dimension();this.$element.removeClass("collapse").addClass("collapsing")[e](0),this.transitioning=1;var f=function(){this.$element.removeClass("collapsing").addClass("in")[e]("auto"),this.transitioning=0,this.$element.trigger("shown.bs.collapse")};if(!a.support.transition)return f.call(this);var g=a.camelCase(["scroll",e].join("-"));this.$element.one(a.support.transition.end,a.proxy(f,this)).emulateTransitionEnd(350)[e](this.$element[0][g])}}},b.prototype.hide=function(){if(!this.transitioning&&this.$element.hasClass("in")){var b=a.Event("hide.bs.collapse");if(this.$element.trigger(b),!b.isDefaultPrevented()){var c=this.dimension();this.$element[c](this.$element[c]())[0].offsetHeight,this.$element.addClass("collapsing").removeClass("collapse").removeClass("in"),this.transitioning=1;var d=function(){this.transitioning=0,this.$element.trigger("hidden.bs.collapse").removeClass("collapsing").addClass("collapse")};return a.support.transition?(this.$element[c](0).one(a.support.transition.end,a.proxy(d,this)).emulateTransitionEnd(350),void 0):d.call(this)}}},b.prototype.toggle=function(){this[this.$element.hasClass("in")?"hide":"show"]()};var c=a.fn.collapse;a.fn.collapse=function(c){return this.each(function(){var d=a(this),e=d.data("bs.collapse"),f=a.extend({},b.DEFAULTS,d.data(),"object"==typeof c&&c);e||d.data("bs.collapse",e=new b(this,f)),"string"==typeof c&&e[c]()})},a.fn.collapse.Constructor=b,a.fn.collapse.noConflict=function(){return a.fn.collapse=c,this},a(document).on("click.bs.collapse.data-api","[data-toggle=collapse]",function(b){var c,d=a(this),e=d.attr("data-target")||b.preventDefault()||(c=d.attr("href"))&&c.replace(/.*(?=#[^\s]+$)/,""),f=a(e),g=f.data("bs.collapse"),h=g?"toggle":d.data(),i=d.attr("data-parent"),j=i&&a(i);g&&g.transitioning||(j&&j.find('[data-toggle=collapse][data-parent="'+i+'"]').not(d).addClass("collapsed"),d[f.hasClass("in")?"addClass":"removeClass"]("collapsed")),f.collapse(h)})}(window.jQuery),+function(a){"use strict";function b(){a(d).remove(),a(e).each(function(b){var d=c(a(this));d.hasClass("open")&&(d.trigger(b=a.Event("hide.bs.dropdown")),b.isDefaultPrevented()||d.removeClass("open").trigger("hidden.bs.dropdown"))})}function c(b){var c=b.attr("data-target");c||(c=b.attr("href"),c=c&&/#/.test(c)&&c.replace(/.*(?=#[^\s]*$)/,""));var d=c&&a(c);return d&&d.length?d:b.parent()}var d=".dropdown-backdrop",e="[data-toggle=dropdown]",f=function(b){a(b).on("click.bs.dropdown",this.toggle)};f.prototype.toggle=function(d){var e=a(this);if(!e.is(".disabled, :disabled")){var f=c(e),g=f.hasClass("open");if(b(),!g){if("ontouchstart"in document.documentElement&&!f.closest(".navbar-nav").length&&a(''}),b.prototype=a.extend({},a.fn.tooltip.Constructor.prototype),b.prototype.constructor=b,b.prototype.getDefaults=function(){return b.DEFAULTS},b.prototype.setContent=function(){var a=this.tip(),b=this.getTitle(),c=this.getContent();a.find(".popover-title")[this.options.html?"html":"text"](b),a.find(".popover-content")[this.options.html?"html":"text"](c),a.removeClass("fade top bottom left right in"),a.find(".popover-title").html()||a.find(".popover-title").hide()},b.prototype.hasContent=function(){return this.getTitle()||this.getContent()},b.prototype.getContent=function(){var a=this.$element,b=this.options;return a.attr("data-content")||("function"==typeof b.content?b.content.call(a[0]):b.content)},b.prototype.arrow=function(){return this.$arrow=this.$arrow||this.tip().find(".arrow")},b.prototype.tip=function(){return this.$tip||(this.$tip=a(this.options.template)),this.$tip};var c=a.fn.popover;a.fn.popover=function(c){return this.each(function(){var d=a(this),e=d.data("bs.popover"),f="object"==typeof c&&c;e||d.data("bs.popover",e=new b(this,f)),"string"==typeof c&&e[c]()})},a.fn.popover.Constructor=b,a.fn.popover.noConflict=function(){return a.fn.popover=c,this}}(window.jQuery),+function(a){"use strict";function b(c,d){var e,f=a.proxy(this.process,this);this.$element=a(c).is("body")?a(window):a(c),this.$body=a("body"),this.$scrollElement=this.$element.on("scroll.bs.scroll-spy.data-api",f),this.options=a.extend({},b.DEFAULTS,d),this.selector=(this.options.target||(e=a(c).attr("href"))&&e.replace(/.*(?=#[^\s]+$)/,"")||"")+" .nav li > a",this.offsets=a([]),this.targets=a([]),this.activeTarget=null,this.refresh(),this.process()}b.DEFAULTS={offset:10},b.prototype.refresh=function(){var b=this.$element[0]==window?"offset":"position";this.offsets=a([]),this.targets=a([]);var c=this;this.$body.find(this.selector).map(function(){var d=a(this),e=d.data("target")||d.attr("href"),f=/^#\w/.test(e)&&a(e);return f&&f.length&&[[f[b]().top+(!a.isWindow(c.$scrollElement.get(0))&&c.$scrollElement.scrollTop()),e]]||null}).sort(function(a,b){return a[0]-b[0]}).each(function(){c.offsets.push(this[0]),c.targets.push(this[1])})},b.prototype.process=function(){var a,b=this.$scrollElement.scrollTop()+this.options.offset,c=this.$scrollElement[0].scrollHeight||this.$body[0].scrollHeight,d=c-this.$scrollElement.height(),e=this.offsets,f=this.targets,g=this.activeTarget;if(b>=d)return g!=(a=f.last()[0])&&this.activate(a);for(a=e.length;a--;)g!=f[a]&&b>=e[a]&&(!e[a+1]||b<=e[a+1])&&this.activate(f[a])},b.prototype.activate=function(b){this.activeTarget=b,a(this.selector).parents(".active").removeClass("active");var c=this.selector+'[data-target="'+b+'"],'+this.selector+'[href="'+b+'"]',d=a(c).parents("li").addClass("active");d.parent(".dropdown-menu").length&&(d=d.closest("li.dropdown").addClass("active")),d.trigger("activate")};var c=a.fn.scrollspy;a.fn.scrollspy=function(c){return this.each(function(){var d=a(this),e=d.data("bs.scrollspy"),f="object"==typeof c&&c;e||d.data("bs.scrollspy",e=new b(this,f)),"string"==typeof c&&e[c]()})},a.fn.scrollspy.Constructor=b,a.fn.scrollspy.noConflict=function(){return a.fn.scrollspy=c,this},a(window).on("load",function(){a('[data-spy="scroll"]').each(function(){var b=a(this);b.scrollspy(b.data())})})}(window.jQuery),+function(a){"use strict";var b=function(b){this.element=a(b)};b.prototype.show=function(){var b=this.element,c=b.closest("ul:not(.dropdown-menu)"),d=b.attr("data-target");if(d||(d=b.attr("href"),d=d&&d.replace(/.*(?=#[^\s]*$)/,"")),!b.parent("li").hasClass("active")){var e=c.find(".active:last a")[0],f=a.Event("show.bs.tab",{relatedTarget:e});if(b.trigger(f),!f.isDefaultPrevented()){var g=a(d);this.activate(b.parent("li"),c),this.activate(g,g.parent(),function(){b.trigger({type:"shown.bs.tab",relatedTarget:e})})}}},b.prototype.activate=function(b,c,d){function e(){f.removeClass("active").find("> .dropdown-menu > .active").removeClass("active"),b.addClass("active"),g?(b[0].offsetWidth,b.addClass("in")):b.removeClass("fade"),b.parent(".dropdown-menu")&&b.closest("li.dropdown").addClass("active"),d&&d()}var f=c.find("> .active"),g=d&&a.support.transition&&f.hasClass("fade");g?f.one(a.support.transition.end,e).emulateTransitionEnd(150):e(),f.removeClass("in")};var c=a.fn.tab;a.fn.tab=function(c){return this.each(function(){var d=a(this),e=d.data("bs.tab");e||d.data("bs.tab",e=new b(this)),"string"==typeof c&&e[c]()})},a.fn.tab.Constructor=b,a.fn.tab.noConflict=function(){return a.fn.tab=c,this},a(document).on("click.bs.tab.data-api",'[data-toggle="tab"], [data-toggle="pill"]',function(b){b.preventDefault(),a(this).tab("show")})}(window.jQuery),+function(a){"use strict";var b=function(c,d){this.options=a.extend({},b.DEFAULTS,d),this.$window=a(window).on("scroll.bs.affix.data-api",a.proxy(this.checkPosition,this)).on("click.bs.affix.data-api",a.proxy(this.checkPositionWithEventLoop,this)),this.$element=a(c),this.affixed=this.unpin=null,this.checkPosition()};b.RESET="affix affix-top affix-bottom",b.DEFAULTS={offset:0},b.prototype.checkPositionWithEventLoop=function(){setTimeout(a.proxy(this.checkPosition,this),1)},b.prototype.checkPosition=function(){if(this.$element.is(":visible")){var c=a(document).height(),d=this.$window.scrollTop(),e=this.$element.offset(),f=this.options.offset,g=f.top,h=f.bottom;"object"!=typeof f&&(h=g=f),"function"==typeof g&&(g=f.top()),"function"==typeof h&&(h=f.bottom());var i=null!=this.unpin&&d+this.unpin<=e.top?!1:null!=h&&e.top+this.$element.height()>=c-h?"bottom":null!=g&&g>=d?"top":!1;this.affixed!==i&&(this.unpin&&this.$element.css("top",""),this.affixed=i,this.unpin="bottom"==i?e.top-d:null,this.$element.removeClass(b.RESET).addClass("affix"+(i?"-"+i:"")),"bottom"==i&&this.$element.offset({top:document.body.offsetHeight-h-this.$element.height()}))}};var c=a.fn.affix;a.fn.affix=function(c){return this.each(function(){var d=a(this),e=d.data("bs.affix"),f="object"==typeof c&&c;e||d.data("bs.affix",e=new b(this,f)),"string"==typeof c&&e[c]()})},a.fn.affix.Constructor=b,a.fn.affix.noConflict=function(){return a.fn.affix=c,this},a(window).on("load",function(){a('[data-spy="affix"]').each(function(){var b=a(this),c=b.data();c.offset=c.offset||{},c.offsetBottom&&(c.offset.bottom=c.offsetBottom),c.offsetTop&&(c.offset.top=c.offsetTop),b.affix(c)})})}(window.jQuery); // Badonkatrunc 1.0.0, (http://badonkatrunc.com) // Copyright (c) 2012 Plexipixel, Inc. (http://plexipixel.com) // Developed by: Joel Day (joeld@plexipixel.com) // Co-conspirator: David Seelig // Permission is hereby granted, free of charge, to any person obtaining // a copy of this software and associated documentation files (the // "Software"), to deal in the Software without restriction, including // without limitation the rights to use, copy, modify, merge, publish, // distribute, sublicense, and/or sell copies of the Software, and to // permit persons to whom the Software is furnished to do so, subject to // the following conditions: // The above copyright notice and this permission notice shall be // included in all copies or substantial portions of the Software. // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE // LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION // OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. (function($){var methods={init:function(options){var all=this;var instanceOptions=$.extend(true,{},$.fn.badonkatrunc.defaultOptions,options);if(instanceOptions.fitDirection!="horizontal"&&instanceOptions.fitDirection!="vertical"){$.error("'"+instanceOptions.fitDirection+"' is not a valid fit direction. Use 'horizontal' or 'vertical.'");return this;}if(instanceOptions.truncateLocation!="start"&&instanceOptions.truncateLocation!="middle"&&instanceOptions.truncateLocation!="end"){$.error("'"+instanceOptions.truncateLocation+"' is not a valid truncation location. Use 'start,' 'middle' or 'end.'");return this;}if(instanceOptions.minimumFontSize>instanceOptions.maximumFontSize){$.error("Minimum font size can not exceed the maximum font size.");return this;}if(instanceOptions.minimumLetterSpacing>instanceOptions.maximumLetterSpacing){$.error("Minimum letter spacing can not exceed the maximum letter spacing.");return this;}return this.each(function(){var $this=$(this);var data=$(this).data("badonkatrunc");if(data){$this.badonkatrunc("destroy");}var instance=pluginInstance($this,instanceOptions,all);$(this).data("badonkatrunc",instance);instance.init();if(instance.options.automaticSizeTracking){resizeMonitor.add(instance);}});},destroy:function(){return this.each(function(){var $this=$(this);var data=$this.data("badonkatrunc");data.destroy();resizeMonitor.remove(data);dirtyMonitor.remove(data);$(window).unbind(".badonkatrunc");$this.removeData("badonkatrunc");});},refresh:function(){return this.each(function(){var $this=$(this);var data=$this.data("badonkatrunc");dirtyMonitor.remove(data);data.refresh();});},changeContents:function(newContents){return this.each(function(){var $this=$(this);var data=$this.data("badonkatrunc");if(typeof(newContents)=="string"){data.contentHtml=$("").text(newContents).html();}else{data.contentHtml=$(newContents).html();}dirtyMonitor.add(data);});}};$.fn.badonkatrunc=function(method){if(methods[method]){return methods[method].apply(this,Array.prototype.slice.call(arguments,1));}else{if(typeof method==="object"||!method){return methods.init.apply(this,arguments);}else{$.error("Method "+method+" does not exist on jQuery.badonkatrunc");}}};$.fn.badonkatrunc.settings={sizeTrackingTimeout:1000/60};$.fn.badonkatrunc.defaultOptions={automaticSizeTracking:false,fitDirection:"horizontal",minimumFontSize:1,maximumFontSize:1,fontSizeSynced:false,minimumLetterSpacing:0,maximumLetterSpacing:0,letterSpacingSynced:false,truncate:true,truncateString:"…",truncateLocation:"end",truncateOnlyWholeWords:false,extraOptimizeLimit:8};$.fn.btrunc=$.fn.badonkatrunc;var pluginInstance=function($target,options,$targetGroup){var createRenderState=function(content,fontSize,letterSpacing){return{content:content,fontSize:fontSize,letterSpacing:letterSpacing};};var instance={target:$target,options:options,refresh:function(){var self=this;var view=createHtmlTextView(this.contentHtml);var text=this.contentHtml;var fontSize=this.options.maximumFontSize;var letterSpacing=this.options.maximumLetterSpacing;var renderFunc=function(){var state=createRenderState(text,fontSize,letterSpacing);self.renderState(state);};var overflowFunc=function(){return self.getCurrentOverflow();};if(this.options.maximumFontSize-this.options.minimumFontSize>0){optimize(self.options.minimumFontSize,self.options.maximumFontSize,function(value){fontSize=value;renderFunc();},overflowFunc);}if(this.options.maximumLetterSpacing-this.options.minimumLetterSpacing>0){var truncationLevel=1;if(this.options.truncate){optimize(0,1,function(value){truncationLevel=value;text=getTruncatedHtml(view,self.options.truncateString,self.options.truncateLocation,value,true);optimize(self.options.minimumLetterSpacing,0,function(value){letterSpacing=value;renderFunc();},overflowFunc);renderFunc();},overflowFunc);}if(truncationLevel==1){optimize(self.options.minimumLetterSpacing,self.options.maximumLetterSpacing,function(value){letterSpacing=value;renderFunc();},overflowFunc);}}if(this.options.truncate){optimize(0,1,function(value){text=getTruncatedHtml(view,self.options.truncateString,self.options.truncateLocation,value,self.options.truncateOnlyWholeWords);renderFunc();},overflowFunc,this.options.extraOptimizeLimit);}this.renderState(createRenderState(text,fontSize,letterSpacing),!this.options.truncate);this.currentOptimalState=this.currentRenderedState;this.syncFonts();},syncFonts:function(){if($targetGroup.length>1&&(this.options.fontSizeSynced||this.options.letterSpacingSynced)){var lowestFontSize=this.currentOptimalState.fontSize;var lowestLetterSpacing=this.currentOptimalState.letterSpacing;for(var i=0;i<$targetGroup.length;i++){var groupInstance=$($targetGroup[i]).data("badonkatrunc");if(groupInstance!=null&&groupInstance.currentOptimalState!=null){if(groupInstance.currentOptimalState.fontSize');this.settingsWrapper.addClass("badonkatrunc-wrapper");if(!$.browser.mozilla&&!$.browser.opera&&!($.browser.msie&&$.browser.version=="7.0")){this.settingsWrapper.css("display","block");}this.target.empty();this.target.append(this.settingsWrapper);this.refresh();},destroy:function(){this.target.empty();this.target.append(this.contentHtml);},renderState:function(state,forceAllowWrap){this.settingsWrapper.css("font-size",state.fontSize+"em");this.settingsWrapper.css("letter-spacing",state.letterSpacing+"em");var whiteSpace=(!forceAllowWrap&&this.options.fitDirection=="horizontal")?"nowrap":"normal";this.settingsWrapper.css("white-space",whiteSpace);this.settingsWrapper.empty();this.settingsWrapper.append(state.content);this.currentRenderedState=state;},getCurrentOverflow:function(){var wrapper=this.settingsWrapper[0];var overflow=(this.options.fitDirection=="horizontal")?wrapper.scrollWidth-$target.width():wrapper.offsetHeight-$target.height();return overflow;}};return instance;};var createDispatcher=function(updateFunc,addFunc,removeFunc,updateTimeout){var dispatcherInstance={_instances:[],_updateLoop:function(){if($.isFunction(updateFunc)){for(var i=0;i0){setTimeout(dispatcherInstance._updateLoop,updateTimeout);}}else{dispatcherInstance._instances=[];}},add:function(instance){if($.inArray(instance,this._instances)!=-1){return;}if($.isFunction(addFunc)){addFunc(instance);}this._instances.push(instance);if(this._instances.length==1){if(updateTimeout==null){setTimeout(this._updateLoop);}else{this._updateLoop();}}},remove:function(instance){var index=$.inArray(instance,this._instances);if(index!=-1){this._instances.splice(index,1);if($.isFunction(removeFunc)){removeFunc(instance);}}}};return dispatcherInstance;};var resizeMonitor=createDispatcher(function(instance){instance.elementSizeCache.update();},function(instance){instance.elementSizeCache={width:null,height:null,update:function(){var newWidth=instance.target.width();var newHeight=instance.target.height();var hasChanged=((this.width!=null&&newWidth!=this.width)||(this.height!=null&&newHeight!=this.height));this.width=newWidth;this.height=newHeight;if(hasChanged){this.changed();}},changed:function(){dirtyMonitor.add(instance);}};},function(instance){instance.elementSizeCache=undefined;},$.fn.badonkatrunc.settings.sizeTrackingTimeout);var dirtyMonitor=createDispatcher(function(instance){instance.refresh.apply(instance);},null,null,null);var getTruncatedHtml=function(htmlTextView,truncateString,truncateLocation,amount,wordRounded){var text=htmlTextView.text;if(amount>1){amount=1;}if(amount<0){amount=0;}if(amount==1){return htmlTextView.html;}var getTruncatedRange=function(begin,length){var words=text.split(" ");var totalEntities=(wordRounded)?words.length:text.length;var entityBegin=totalEntities*begin;var entityLength=totalEntities*length;if(wordRounded){var getCharacterPosition=function(wordIndex){var characterCount=0;for(var i=0;i");$content.html(contentHtml);var view={html:contentHtml,text:$content.text(),getHtmlSubstring:function(index,length){var element=$content.clone()[0];var totalProcessedLength=0;var totalOutputLength=0;var nodesWithinRange=[];var withinRange=false;var stripOutOfRangeTextInElement=function(node){if(node.nodeType==3){var dataLength=node.data.length;var newData="";var wasWithinRange=false;for(var i=0;i=index&&totalOutputLengthresult){moreOptimal=false;}else{if(result==mostOptimalResult){if(currentValue<=mostOptimalValue){moreOptimal=false;}}}}if(moreOptimal){mostOptimalResult=result;mostOptimalValue=currentValue;}}if(result==lastResult){sameResultCount++;if(extraOptimizeLimit==undefined||sameResultCount==extraOptimizeLimit){if(mostOptimalValue!=null){actionFunc(mostOptimalValue);}return;}}if(result>0){currentMax=currentValue;var difference=(currentValue-currentMin);currentValue-=(difference/2);}else{if(result<=0){currentMin=currentValue;currentValue=currentMax;}}lastResult=result;}};})(jQuery); /* * jQuery OwlCarousel v1.3.2 * * Copyright (c) 2013 Bartosz Wojciechowski * http://www.owlgraphic.com/owlcarousel/ * * Licensed under MIT * */ /*JS Lint helpers: */ /*global dragMove: false, dragEnd: false, $, jQuery, alert, window, document */ /*jslint nomen: true, continue:true */ if (typeof Object.create !== "function") { Object.create = function (obj) { function F() {} F.prototype = obj; return new F(); }; } (function ($, window, document) { var Carousel = { init : function (options, el) { var base = this; base.$elem = $(el); base.options = $.extend({}, $.fn.owlCarousel.options, base.$elem.data(), options); base.userOptions = options; base.loadContent(); }, loadContent : function () { var base = this, url; function getData(data) { var i, content = ""; if (typeof base.options.jsonSuccess === "function") { base.options.jsonSuccess.apply(this, [data]); } else { for (i in data.owl) { if (data.owl.hasOwnProperty(i)) { content += data.owl[i].item; } } base.$elem.html(content); } base.logIn(); } if (typeof base.options.beforeInit === "function") { base.options.beforeInit.apply(this, [base.$elem]); } if (typeof base.options.jsonPath === "string") { url = base.options.jsonPath; $.getJSON(url, getData); } else { base.logIn(); } }, logIn : function () { var base = this; base.$elem.data("owl-originalStyles", base.$elem.attr("style")) .data("owl-originalClasses", base.$elem.attr("class")); base.$elem.css({opacity: 0}); base.orignalItems = base.options.items; base.checkBrowser(); base.wrapperWidth = 0; base.checkVisible = null; base.setVars(); }, setVars : function () { var base = this; if (base.$elem.children().length === 0) {return false; } base.baseClass(); base.eventTypes(); base.$userItems = base.$elem.children(); base.itemsAmount = base.$userItems.length; base.wrapItems(); base.$owlItems = base.$elem.find(".owl-item"); base.$owlWrapper = base.$elem.find(".owl-wrapper"); base.playDirection = "next"; base.prevItem = 0; base.prevArr = [0]; base.currentItem = 0; base.customEvents(); base.onStartup(); }, onStartup : function () { var base = this; base.updateItems(); base.calculateAll(); base.buildControls(); base.updateControls(); base.response(); base.moveEvents(); base.stopOnHover(); base.owlStatus(); if (base.options.transitionStyle !== false) { base.transitionTypes(base.options.transitionStyle); } if (base.options.autoPlay === true) { base.options.autoPlay = 5000; } base.play(); base.$elem.find(".owl-wrapper").css("display", "block"); if (!base.$elem.is(":visible")) { base.watchVisibility(); } else { base.$elem.css("opacity", 1); } base.onstartup = false; base.eachMoveUpdate(); if (typeof base.options.afterInit === "function") { base.options.afterInit.apply(this, [base.$elem]); } }, eachMoveUpdate : function () { var base = this; if (base.options.lazyLoad === true) { base.lazyLoad(); } if (base.options.autoHeight === true) { base.autoHeight(); } base.onVisibleItems(); if (typeof base.options.afterAction === "function") { base.options.afterAction.apply(this, [base.$elem]); } }, updateVars : function () { var base = this; if (typeof base.options.beforeUpdate === "function") { base.options.beforeUpdate.apply(this, [base.$elem]); } base.watchVisibility(); base.updateItems(); base.calculateAll(); base.updatePosition(); base.updateControls(); base.eachMoveUpdate(); if (typeof base.options.afterUpdate === "function") { base.options.afterUpdate.apply(this, [base.$elem]); } }, reload : function () { var base = this; window.setTimeout(function () { base.updateVars(); }, 0); }, watchVisibility : function () { var base = this; if (base.$elem.is(":visible") === false) { base.$elem.css({opacity: 0}); window.clearInterval(base.autoPlayInterval); window.clearInterval(base.checkVisible); } else { return false; } base.checkVisible = window.setInterval(function () { if (base.$elem.is(":visible")) { base.reload(); base.$elem.animate({opacity: 1}, 200); window.clearInterval(base.checkVisible); } }, 500); }, wrapItems : function () { var base = this; base.$userItems.wrapAll("
").wrap("
"); base.$elem.find(".owl-wrapper").wrap("
"); base.wrapperOuter = base.$elem.find(".owl-wrapper-outer"); base.$elem.css("display", "block"); }, baseClass : function () { var base = this, hasBaseClass = base.$elem.hasClass(base.options.baseClass), hasThemeClass = base.$elem.hasClass(base.options.theme); if (!hasBaseClass) { base.$elem.addClass(base.options.baseClass); } if (!hasThemeClass) { base.$elem.addClass(base.options.theme); } }, updateItems : function () { var base = this, width, i; if (base.options.responsive === false) { return false; } if (base.options.singleItem === true) { base.options.items = base.orignalItems = 1; base.options.itemsCustom = false; base.options.itemsDesktop = false; base.options.itemsDesktopSmall = false; base.options.itemsTablet = false; base.options.itemsTabletSmall = false; base.options.itemsMobile = false; return false; } width = $(base.options.responsiveBaseWidth).width(); if (width > (base.options.itemsDesktop[0] || base.orignalItems)) { base.options.items = base.orignalItems; } if (base.options.itemsCustom !== false) { //Reorder array by screen size base.options.itemsCustom.sort(function (a, b) {return a[0] - b[0]; }); for (i = 0; i < base.options.itemsCustom.length; i += 1) { if (base.options.itemsCustom[i][0] <= width) { base.options.items = base.options.itemsCustom[i][1]; } } } else { if (width <= base.options.itemsDesktop[0] && base.options.itemsDesktop !== false) { base.options.items = base.options.itemsDesktop[1]; } if (width <= base.options.itemsDesktopSmall[0] && base.options.itemsDesktopSmall !== false) { base.options.items = base.options.itemsDesktopSmall[1]; } if (width <= base.options.itemsTablet[0] && base.options.itemsTablet !== false) { base.options.items = base.options.itemsTablet[1]; } if (width <= base.options.itemsTabletSmall[0] && base.options.itemsTabletSmall !== false) { base.options.items = base.options.itemsTabletSmall[1]; } if (width <= base.options.itemsMobile[0] && base.options.itemsMobile !== false) { base.options.items = base.options.itemsMobile[1]; } } //if number of items is less than declared if (base.options.items > base.itemsAmount && base.options.itemsScaleUp === true) { base.options.items = base.itemsAmount; } }, response : function () { var base = this, smallDelay, lastWindowWidth; if (base.options.responsive !== true) { return false; } lastWindowWidth = $(window).width(); base.resizer = function () { if ($(window).width() !== lastWindowWidth) { if (base.options.autoPlay !== false) { window.clearInterval(base.autoPlayInterval); } window.clearTimeout(smallDelay); smallDelay = window.setTimeout(function () { lastWindowWidth = $(window).width(); base.updateVars(); }, base.options.responsiveRefreshRate); } }; $(window).resize(base.resizer); }, updatePosition : function () { var base = this; base.jumpTo(base.currentItem); if (base.options.autoPlay !== false) { base.checkAp(); } }, appendItemsSizes : function () { var base = this, roundPages = 0, lastItem = base.itemsAmount - base.options.items; base.$owlItems.each(function (index) { var $this = $(this); $this .css({"width": base.itemWidth}) .data("owl-item", Number(index)); if (index % base.options.items === 0 || index === lastItem) { if (!(index > lastItem)) { roundPages += 1; } } $this.data("owl-roundPages", roundPages); }); }, appendWrapperSizes : function () { var base = this, width = base.$owlItems.length * base.itemWidth; base.$owlWrapper.css({ "width": width * 2, "left": 0 }); base.appendItemsSizes(); }, calculateAll : function () { var base = this; base.calculateWidth(); base.appendWrapperSizes(); base.loops(); base.max(); }, calculateWidth : function () { var base = this; base.itemWidth = Math.round(base.$elem.width() / base.options.items); }, max : function () { var base = this, maximum = ((base.itemsAmount * base.itemWidth) - base.options.items * base.itemWidth) * -1; if (base.options.items > base.itemsAmount) { base.maximumItem = 0; maximum = 0; base.maximumPixels = 0; } else { base.maximumItem = base.itemsAmount - base.options.items; base.maximumPixels = maximum; } return maximum; }, min : function () { return 0; }, loops : function () { var base = this, prev = 0, elWidth = 0, i, item, roundPageNum; base.positionsInArray = [0]; base.pagesInArray = []; for (i = 0; i < base.itemsAmount; i += 1) { elWidth += base.itemWidth; base.positionsInArray.push(-elWidth); if (base.options.scrollPerPage === true) { item = $(base.$owlItems[i]); roundPageNum = item.data("owl-roundPages"); if (roundPageNum !== prev) { base.pagesInArray[prev] = base.positionsInArray[i]; prev = roundPageNum; } } } }, buildControls : function () { var base = this; if (base.options.navigation === true || base.options.pagination === true) { base.owlControls = $("
").toggleClass("clickable", !base.browser.isTouch).appendTo(base.$elem); } if (base.options.pagination === true) { base.buildPagination(); } if (base.options.navigation === true) { base.buildButtons(); } }, buildButtons : function () { var base = this, buttonsWrapper = $("
"); base.owlControls.append(buttonsWrapper); base.buttonPrev = $("
", { "class" : "owl-prev", "html" : base.options.navigationText[0] || "" }); base.buttonNext = $("
", { "class" : "owl-next", "html" : base.options.navigationText[1] || "" }); buttonsWrapper .append(base.buttonPrev) .append(base.buttonNext); buttonsWrapper.on("touchstart.owlControls mousedown.owlControls", "div[class^=\"owl\"]", function (event) { event.preventDefault(); }); buttonsWrapper.on("touchend.owlControls mouseup.owlControls", "div[class^=\"owl\"]", function (event) { event.preventDefault(); if ($(this).hasClass("owl-next")) { base.next(); } else { base.prev(); } }); }, buildPagination : function () { var base = this; base.paginationWrapper = $("
"); base.owlControls.append(base.paginationWrapper); base.paginationWrapper.on("touchend.owlControls mouseup.owlControls", ".owl-page", function (event) { event.preventDefault(); if (Number($(this).data("owl-page")) !== base.currentItem) { base.goTo(Number($(this).data("owl-page")), true); } }); }, updatePagination : function () { var base = this, counter, lastPage, lastItem, i, paginationButton, paginationButtonInner; if (base.options.pagination === false) { return false; } base.paginationWrapper.html(""); counter = 0; lastPage = base.itemsAmount - base.itemsAmount % base.options.items; for (i = 0; i < base.itemsAmount; i += 1) { if (i % base.options.items === 0) { counter += 1; if (lastPage === i) { lastItem = base.itemsAmount - base.options.items; } paginationButton = $("
", { "class" : "owl-page" }); paginationButtonInner = $("", { "text": base.options.paginationNumbers === true ? counter : "", "class": base.options.paginationNumbers === true ? "owl-numbers" : "" }); paginationButton.append(paginationButtonInner); paginationButton.data("owl-page", lastPage === i ? lastItem : i); paginationButton.data("owl-roundPages", counter); base.paginationWrapper.append(paginationButton); } } base.checkPagination(); }, checkPagination : function () { var base = this; if (base.options.pagination === false) { return false; } base.paginationWrapper.find(".owl-page").each(function () { if ($(this).data("owl-roundPages") === $(base.$owlItems[base.currentItem]).data("owl-roundPages")) { base.paginationWrapper .find(".owl-page") .removeClass("active"); $(this).addClass("active"); } }); }, checkNavigation : function () { var base = this; if (base.options.navigation === false) { return false; } if (base.options.rewindNav === false) { if (base.currentItem === 0 && base.maximumItem === 0) { base.buttonPrev.addClass("disabled"); base.buttonNext.addClass("disabled"); } else if (base.currentItem === 0 && base.maximumItem !== 0) { base.buttonPrev.addClass("disabled"); base.buttonNext.removeClass("disabled"); } else if (base.currentItem === base.maximumItem) { base.buttonPrev.removeClass("disabled"); base.buttonNext.addClass("disabled"); } else if (base.currentItem !== 0 && base.currentItem !== base.maximumItem) { base.buttonPrev.removeClass("disabled"); base.buttonNext.removeClass("disabled"); } } }, updateControls : function () { var base = this; base.updatePagination(); base.checkNavigation(); if (base.owlControls) { if (base.options.items >= base.itemsAmount) { base.owlControls.hide(); } else { base.owlControls.show(); } } }, destroyControls : function () { var base = this; if (base.owlControls) { base.owlControls.remove(); } }, next : function (speed) { var base = this; if (base.isTransition) { return false; } base.currentItem += base.options.scrollPerPage === true ? base.options.items : 1; if (base.currentItem > base.maximumItem + (base.options.scrollPerPage === true ? (base.options.items - 1) : 0)) { if (base.options.rewindNav === true) { base.currentItem = 0; speed = "rewind"; } else { base.currentItem = base.maximumItem; return false; } } base.goTo(base.currentItem, speed); }, prev : function (speed) { var base = this; if (base.isTransition) { return false; } if (base.options.scrollPerPage === true && base.currentItem > 0 && base.currentItem < base.options.items) { base.currentItem = 0; } else { base.currentItem -= base.options.scrollPerPage === true ? base.options.items : 1; } if (base.currentItem < 0) { if (base.options.rewindNav === true) { base.currentItem = base.maximumItem; speed = "rewind"; } else { base.currentItem = 0; return false; } } base.goTo(base.currentItem, speed); }, goTo : function (position, speed, drag) { var base = this, goToPixel; if (base.isTransition) { return false; } if (typeof base.options.beforeMove === "function") { base.options.beforeMove.apply(this, [base.$elem]); } if (position >= base.maximumItem) { position = base.maximumItem; } else if (position <= 0) { position = 0; } base.currentItem = base.owl.currentItem = position; if (base.options.transitionStyle !== false && drag !== "drag" && base.options.items === 1 && base.browser.support3d === true) { base.swapSpeed(0); if (base.browser.support3d === true) { base.transition3d(base.positionsInArray[position]); } else { base.css2slide(base.positionsInArray[position], 1); } base.afterGo(); base.singleItemTransition(); return false; } goToPixel = base.positionsInArray[position]; if (base.browser.support3d === true) { base.isCss3Finish = false; if (speed === true) { base.swapSpeed("paginationSpeed"); window.setTimeout(function () { base.isCss3Finish = true; }, base.options.paginationSpeed); } else if (speed === "rewind") { base.swapSpeed(base.options.rewindSpeed); window.setTimeout(function () { base.isCss3Finish = true; }, base.options.rewindSpeed); } else { base.swapSpeed("slideSpeed"); window.setTimeout(function () { base.isCss3Finish = true; }, base.options.slideSpeed); } base.transition3d(goToPixel); } else { if (speed === true) { base.css2slide(goToPixel, base.options.paginationSpeed); } else if (speed === "rewind") { base.css2slide(goToPixel, base.options.rewindSpeed); } else { base.css2slide(goToPixel, base.options.slideSpeed); } } base.afterGo(); }, jumpTo : function (position) { var base = this; if (typeof base.options.beforeMove === "function") { base.options.beforeMove.apply(this, [base.$elem]); } if (position >= base.maximumItem || position === -1) { position = base.maximumItem; } else if (position <= 0) { position = 0; } base.swapSpeed(0); if (base.browser.support3d === true) { base.transition3d(base.positionsInArray[position]); } else { base.css2slide(base.positionsInArray[position], 1); } base.currentItem = base.owl.currentItem = position; base.afterGo(); }, afterGo : function () { var base = this; base.prevArr.push(base.currentItem); base.prevItem = base.owl.prevItem = base.prevArr[base.prevArr.length - 2]; base.prevArr.shift(0); if (base.prevItem !== base.currentItem) { base.checkPagination(); base.checkNavigation(); base.eachMoveUpdate(); if (base.options.autoPlay !== false) { base.checkAp(); } } if (typeof base.options.afterMove === "function" && base.prevItem !== base.currentItem) { base.options.afterMove.apply(this, [base.$elem]); } }, stop : function () { var base = this; base.apStatus = "stop"; window.clearInterval(base.autoPlayInterval); }, checkAp : function () { var base = this; if (base.apStatus !== "stop") { base.play(); } }, play : function () { var base = this; base.apStatus = "play"; if (base.options.autoPlay === false) { return false; } window.clearInterval(base.autoPlayInterval); base.autoPlayInterval = window.setInterval(function () { base.next(true); }, base.options.autoPlay); }, swapSpeed : function (action) { var base = this; if (action === "slideSpeed") { base.$owlWrapper.css(base.addCssSpeed(base.options.slideSpeed)); } else if (action === "paginationSpeed") { base.$owlWrapper.css(base.addCssSpeed(base.options.paginationSpeed)); } else if (typeof action !== "string") { base.$owlWrapper.css(base.addCssSpeed(action)); } }, addCssSpeed : function (speed) { return { "-webkit-transition": "all " + speed + "ms ease", "-moz-transition": "all " + speed + "ms ease", "-o-transition": "all " + speed + "ms ease", "transition": "all " + speed + "ms ease" }; }, removeTransition : function () { return { "-webkit-transition": "", "-moz-transition": "", "-o-transition": "", "transition": "" }; }, doTranslate : function (pixels) { return { "-webkit-transform": "translate3d(" + pixels + "px, 0px, 0px)", "-moz-transform": "translate3d(" + pixels + "px, 0px, 0px)", "-o-transform": "translate3d(" + pixels + "px, 0px, 0px)", "-ms-transform": "translate3d(" + pixels + "px, 0px, 0px)", "transform": "translate3d(" + pixels + "px, 0px,0px)" }; }, transition3d : function (value) { var base = this; base.$owlWrapper.css(base.doTranslate(value)); }, css2move : function (value) { var base = this; base.$owlWrapper.css({"left" : value}); }, css2slide : function (value, speed) { var base = this; base.isCssFinish = false; base.$owlWrapper.stop(true, true).animate({ "left" : value }, { duration : speed || base.options.slideSpeed, complete : function () { base.isCssFinish = true; } }); }, checkBrowser : function () { var base = this, translate3D = "translate3d(0px, 0px, 0px)", tempElem = document.createElement("div"), regex, asSupport, support3d, isTouch; tempElem.style.cssText = " -moz-transform:" + translate3D + "; -ms-transform:" + translate3D + "; -o-transform:" + translate3D + "; -webkit-transform:" + translate3D + "; transform:" + translate3D; regex = /translate3d\(0px, 0px, 0px\)/g; asSupport = tempElem.style.cssText.match(regex); support3d = (asSupport !== null && asSupport.length === 1); isTouch = "ontouchstart" in window || window.navigator.msMaxTouchPoints; base.browser = { "support3d" : support3d, "isTouch" : isTouch }; }, moveEvents : function () { var base = this; if (base.options.mouseDrag !== false || base.options.touchDrag !== false) { base.gestures(); base.disabledEvents(); } }, eventTypes : function () { var base = this, types = ["s", "e", "x"]; base.ev_types = {}; if (base.options.mouseDrag === true && base.options.touchDrag === true) { types = [ "touchstart.owl mousedown.owl", "touchmove.owl mousemove.owl", "touchend.owl touchcancel.owl mouseup.owl" ]; } else if (base.options.mouseDrag === false && base.options.touchDrag === true) { types = [ "touchstart.owl", "touchmove.owl", "touchend.owl touchcancel.owl" ]; } else if (base.options.mouseDrag === true && base.options.touchDrag === false) { types = [ "mousedown.owl", "mousemove.owl", "mouseup.owl" ]; } base.ev_types.start = types[0]; base.ev_types.move = types[1]; base.ev_types.end = types[2]; }, disabledEvents : function () { var base = this; base.$elem.on("dragstart.owl", function (event) { event.preventDefault(); }); base.$elem.on("mousedown.disableTextSelect", function (e) { return $(e.target).is('input, textarea, select, option'); }); }, gestures : function () { /*jslint unparam: true*/ var base = this, locals = { offsetX : 0, offsetY : 0, baseElWidth : 0, relativePos : 0, position: null, minSwipe : null, maxSwipe: null, sliding : null, dargging: null, targetElement : null }; base.isCssFinish = true; function getTouches(event) { if (event.touches !== undefined) { return { x : event.touches[0].pageX, y : event.touches[0].pageY }; } if (event.touches === undefined) { if (event.pageX !== undefined) { return { x : event.pageX, y : event.pageY }; } if (event.pageX === undefined) { return { x : event.clientX, y : event.clientY }; } } } function swapEvents(type) { if (type === "on") { $(document).on(base.ev_types.move, dragMove); $(document).on(base.ev_types.end, dragEnd); } else if (type === "off") { $(document).off(base.ev_types.move); $(document).off(base.ev_types.end); } } function dragStart(event) { var ev = event.originalEvent || event || window.event, position; if (ev.which === 3) { return false; } if (base.itemsAmount <= base.options.items) { return; } if (base.isCssFinish === false && !base.options.dragBeforeAnimFinish) { return false; } if (base.isCss3Finish === false && !base.options.dragBeforeAnimFinish) { return false; } if (base.options.autoPlay !== false) { window.clearInterval(base.autoPlayInterval); } if (base.browser.isTouch !== true && !base.$owlWrapper.hasClass("grabbing")) { base.$owlWrapper.addClass("grabbing"); } base.newPosX = 0; base.newRelativeX = 0; $(this).css(base.removeTransition()); position = $(this).position(); locals.relativePos = position.left; locals.offsetX = getTouches(ev).x - position.left; locals.offsetY = getTouches(ev).y - position.top; swapEvents("on"); locals.sliding = false; locals.targetElement = ev.target || ev.srcElement; } function dragMove(event) { var ev = event.originalEvent || event || window.event, minSwipe, maxSwipe; base.newPosX = getTouches(ev).x - locals.offsetX; base.newPosY = getTouches(ev).y - locals.offsetY; base.newRelativeX = base.newPosX - locals.relativePos; if (typeof base.options.startDragging === "function" && locals.dragging !== true && base.newRelativeX !== 0) { locals.dragging = true; base.options.startDragging.apply(base, [base.$elem]); } if ((base.newRelativeX > 8 || base.newRelativeX < -8) && (base.browser.isTouch === true)) { if (ev.preventDefault !== undefined) { ev.preventDefault(); } else { ev.returnValue = false; } locals.sliding = true; } if ((base.newPosY > 10 || base.newPosY < -10) && locals.sliding === false) { $(document).off("touchmove.owl"); } minSwipe = function () { return base.newRelativeX / 5; }; maxSwipe = function () { return base.maximumPixels + base.newRelativeX / 5; }; base.newPosX = Math.max(Math.min(base.newPosX, minSwipe()), maxSwipe()); if (base.browser.support3d === true) { base.transition3d(base.newPosX); } else { base.css2move(base.newPosX); } } function dragEnd(event) { var ev = event.originalEvent || event || window.event, newPosition, handlers, owlStopEvent; ev.target = ev.target || ev.srcElement; locals.dragging = false; if (base.browser.isTouch !== true) { base.$owlWrapper.removeClass("grabbing"); } if (base.newRelativeX < 0) { base.dragDirection = base.owl.dragDirection = "left"; } else { base.dragDirection = base.owl.dragDirection = "right"; } if (base.newRelativeX !== 0) { newPosition = base.getNewPosition(); base.goTo(newPosition, false, "drag"); if (locals.targetElement === ev.target && base.browser.isTouch !== true) { $(ev.target).on("click.disable", function (ev) { ev.stopImmediatePropagation(); ev.stopPropagation(); ev.preventDefault(); $(ev.target).off("click.disable"); }); handlers = $._data(ev.target, "events").click; owlStopEvent = handlers.pop(); handlers.splice(0, 0, owlStopEvent); } } swapEvents("off"); } base.$elem.on(base.ev_types.start, ".owl-wrapper", dragStart); }, getNewPosition : function () { var base = this, newPosition = base.closestItem(); if (newPosition > base.maximumItem) { base.currentItem = base.maximumItem; newPosition = base.maximumItem; } else if (base.newPosX >= 0) { newPosition = 0; base.currentItem = 0; } return newPosition; }, closestItem : function () { var base = this, array = base.options.scrollPerPage === true ? base.pagesInArray : base.positionsInArray, goal = base.newPosX, closest = null; $.each(array, function (i, v) { if (goal - (base.itemWidth / 20) > array[i + 1] && goal - (base.itemWidth / 20) < v && base.moveDirection() === "left") { closest = v; if (base.options.scrollPerPage === true) { base.currentItem = $.inArray(closest, base.positionsInArray); } else { base.currentItem = i; } } else if (goal + (base.itemWidth / 20) < v && goal + (base.itemWidth / 20) > (array[i + 1] || array[i] - base.itemWidth) && base.moveDirection() === "right") { if (base.options.scrollPerPage === true) { closest = array[i + 1] || array[array.length - 1]; base.currentItem = $.inArray(closest, base.positionsInArray); } else { closest = array[i + 1]; base.currentItem = i + 1; } } }); return base.currentItem; }, moveDirection : function () { var base = this, direction; if (base.newRelativeX < 0) { direction = "right"; base.playDirection = "next"; } else { direction = "left"; base.playDirection = "prev"; } return direction; }, customEvents : function () { /*jslint unparam: true*/ var base = this; base.$elem.on("owl.next", function () { base.next(); }); base.$elem.on("owl.prev", function () { base.prev(); }); base.$elem.on("owl.play", function (event, speed) { base.options.autoPlay = speed; base.play(); base.hoverStatus = "play"; }); base.$elem.on("owl.stop", function () { base.stop(); base.hoverStatus = "stop"; }); base.$elem.on("owl.goTo", function (event, item) { base.goTo(item); }); base.$elem.on("owl.jumpTo", function (event, item) { base.jumpTo(item); }); }, stopOnHover : function () { var base = this; if (base.options.stopOnHover === true && base.browser.isTouch !== true && base.options.autoPlay !== false) { base.$elem.on("mouseover", function () { base.stop(); }); base.$elem.on("mouseout", function () { if (base.hoverStatus !== "stop") { base.play(); } }); } }, lazyLoad : function () { var base = this, i, $item, itemNumber, $lazyImg, follow; if (base.options.lazyLoad === false) { return false; } for (i = 0; i < base.itemsAmount; i += 1) { $item = $(base.$owlItems[i]); if ($item.data("owl-loaded") === "loaded") { continue; } itemNumber = $item.data("owl-item"); $lazyImg = $item.find(".lazyOwl"); if (typeof $lazyImg.data("src") !== "string") { $item.data("owl-loaded", "loaded"); continue; } if ($item.data("owl-loaded") === undefined) { $lazyImg.hide(); $item.addClass("loading").data("owl-loaded", "checked"); } if (base.options.lazyFollow === true) { follow = itemNumber >= base.currentItem; } else { follow = true; } if (follow && itemNumber < base.currentItem + base.options.items && $lazyImg.length) { base.lazyPreload($item, $lazyImg); } } }, lazyPreload : function ($item, $lazyImg) { var base = this, iterations = 0, isBackgroundImg; if ($lazyImg.prop("tagName") === "DIV") { $lazyImg.css("background-image", "url(" + $lazyImg.data("src") + ")"); isBackgroundImg = true; } else { $lazyImg[0].src = $lazyImg.data("src"); } function showImage() { $item.data("owl-loaded", "loaded").removeClass("loading"); $lazyImg.removeAttr("data-src"); if (base.options.lazyEffect === "fade") { $lazyImg.fadeIn(400); } else { $lazyImg.show(); } if (typeof base.options.afterLazyLoad === "function") { base.options.afterLazyLoad.apply(this, [base.$elem]); } } function checkLazyImage() { iterations += 1; if (base.completeImg($lazyImg.get(0)) || isBackgroundImg === true) { showImage(); } else if (iterations <= 100) {//if image loads in less than 10 seconds window.setTimeout(checkLazyImage, 100); } else { showImage(); } } checkLazyImage(); }, autoHeight : function () { var base = this, $currentimg = $(base.$owlItems[base.currentItem]).find("img"), iterations; function addHeight() { var $currentItem = $(base.$owlItems[base.currentItem]).height(); base.wrapperOuter.css("height", $currentItem + "px"); if (!base.wrapperOuter.hasClass("autoHeight")) { window.setTimeout(function () { base.wrapperOuter.addClass("autoHeight"); }, 0); } } function checkImage() { iterations += 1; if (base.completeImg($currentimg.get(0))) { addHeight(); } else if (iterations <= 100) { //if image loads in less than 10 seconds window.setTimeout(checkImage, 100); } else { base.wrapperOuter.css("height", ""); //Else remove height attribute } } if ($currentimg.get(0) !== undefined) { iterations = 0; checkImage(); } else { addHeight(); } }, completeImg : function (img) { var naturalWidthType; if (!img.complete) { return false; } naturalWidthType = typeof img.naturalWidth; if (naturalWidthType !== "undefined" && img.naturalWidth === 0) { return false; } return true; }, onVisibleItems : function () { var base = this, i; if (base.options.addClassActive === true) { base.$owlItems.removeClass("active"); } base.visibleItems = []; for (i = base.currentItem; i < base.currentItem + base.options.items; i += 1) { base.visibleItems.push(i); if (base.options.addClassActive === true) { $(base.$owlItems[i]).addClass("active"); } } base.owl.visibleItems = base.visibleItems; }, transitionTypes : function (className) { var base = this; //Currently available: "fade", "backSlide", "goDown", "fadeUp" base.outClass = "owl-" + className + "-out"; base.inClass = "owl-" + className + "-in"; }, singleItemTransition : function () { var base = this, outClass = base.outClass, inClass = base.inClass, $currentItem = base.$owlItems.eq(base.currentItem), $prevItem = base.$owlItems.eq(base.prevItem), prevPos = Math.abs(base.positionsInArray[base.currentItem]) + base.positionsInArray[base.prevItem], origin = Math.abs(base.positionsInArray[base.currentItem]) + base.itemWidth / 2, animEnd = 'webkitAnimationEnd oAnimationEnd MSAnimationEnd animationend'; base.isTransition = true; base.$owlWrapper .addClass('owl-origin') .css({ "-webkit-transform-origin" : origin + "px", "-moz-perspective-origin" : origin + "px", "perspective-origin" : origin + "px" }); function transStyles(prevPos) { return { "position" : "relative", "left" : prevPos + "px" }; } $prevItem .css(transStyles(prevPos, 10)) .addClass(outClass) .on(animEnd, function () { base.endPrev = true; $prevItem.off(animEnd); base.clearTransStyle($prevItem, outClass); }); $currentItem .addClass(inClass) .on(animEnd, function () { base.endCurrent = true; $currentItem.off(animEnd); base.clearTransStyle($currentItem, inClass); }); }, clearTransStyle : function (item, classToRemove) { var base = this; item.css({ "position" : "", "left" : "" }).removeClass(classToRemove); if (base.endPrev && base.endCurrent) { base.$owlWrapper.removeClass('owl-origin'); base.endPrev = false; base.endCurrent = false; base.isTransition = false; } }, owlStatus : function () { var base = this; base.owl = { "userOptions" : base.userOptions, "baseElement" : base.$elem, "userItems" : base.$userItems, "owlItems" : base.$owlItems, "currentItem" : base.currentItem, "prevItem" : base.prevItem, "visibleItems" : base.visibleItems, "isTouch" : base.browser.isTouch, "browser" : base.browser, "dragDirection" : base.dragDirection }; }, clearEvents : function () { var base = this; base.$elem.off(".owl owl mousedown.disableTextSelect"); $(document).off(".owl owl"); $(window).off("resize", base.resizer); }, unWrap : function () { var base = this; if (base.$elem.children().length !== 0) { base.$owlWrapper.unwrap(); base.$userItems.unwrap().unwrap(); if (base.owlControls) { base.owlControls.remove(); } } base.clearEvents(); base.$elem .attr("style", base.$elem.data("owl-originalStyles") || "") .attr("class", base.$elem.data("owl-originalClasses")); }, destroy : function () { var base = this; base.stop(); window.clearInterval(base.checkVisible); base.unWrap(); base.$elem.removeData(); }, reinit : function (newOptions) { var base = this, options = $.extend({}, base.userOptions, newOptions); base.unWrap(); base.init(options, base.$elem); }, addItem : function (htmlString, targetPosition) { var base = this, position; if (!htmlString) {return false; } if (base.$elem.children().length === 0) { base.$elem.append(htmlString); base.setVars(); return false; } base.unWrap(); if (targetPosition === undefined || targetPosition === -1) { position = -1; } else { position = targetPosition; } if (position >= base.$userItems.length || position === -1) { base.$userItems.eq(-1).after(htmlString); } else { base.$userItems.eq(position).before(htmlString); } base.setVars(); }, removeItem : function (targetPosition) { var base = this, position; if (base.$elem.children().length === 0) { return false; } if (targetPosition === undefined || targetPosition === -1) { position = -1; } else { position = targetPosition; } base.unWrap(); base.$userItems.eq(position).remove(); base.setVars(); } }; $.fn.owlCarousel = function (options) { return this.each(function () { if ($(this).data("owl-init") === true) { return false; } $(this).data("owl-init", true); var carousel = Object.create(Carousel); carousel.init(options, this); $.data(this, "owlCarousel", carousel); }); }; $.fn.owlCarousel.options = { items : 5, itemsCustom : false, itemsDesktop : [1199, 4], itemsDesktopSmall : [979, 3], itemsTablet : [768, 2], itemsTabletSmall : false, itemsMobile : [479, 1], singleItem : false, itemsScaleUp : false, slideSpeed : 200, paginationSpeed : 800, rewindSpeed : 1000, autoPlay : false, stopOnHover : false, navigation : false, navigationText : ["prev", "next"], rewindNav : true, scrollPerPage : false, pagination : true, paginationNumbers : false, responsive : true, responsiveRefreshRate : 200, responsiveBaseWidth : window, baseClass : "owl-carousel", theme : "owl-theme", lazyLoad : false, lazyFollow : true, lazyEffect : "fade", autoHeight : false, jsonPath : false, jsonSuccess : false, dragBeforeAnimFinish : true, mouseDrag : true, touchDrag : true, addClassActive : false, transitionStyle : false, beforeUpdate : false, afterUpdate : false, beforeInit : false, afterInit : false, beforeMove : false, afterMove : false, afterAction : false, startDragging : false, afterLazyLoad: false }; }(jQuery, window, document)); (function($){ $(document).ready(function (){ dropdownNav.handleEvents(); }); var dropdownNav = { handleEvents : function(){ $('.iasd-dropdown-navigation .dropdown-menu').on('click', dropdownNav.preventClosing); $('.iasd-dropdown-navigation .dropdown-toggle').on('click', dropdownNav.openMenu); $('.iasd-dropdown-navigation .dropdown-menu > ul > li:not(.dsa-link) > a').bind('click', dropdownNav.openSubmenu); $('.iasd-dropdown-navigation .back > a').bind('click', dropdownNav.closeSubmenu); }, preventClosing : function(e) { e.stopPropagation(); }, openMenu : function(){ var jqThis = $('.iasd-dropdown-navigation .dropdown-menu > ul > li').find('ul.active'); if (jqThis.size()){ setTimeout(function(){ $('.iasd-dropdown-navigation .dropdown-menu').css('height', jqThis.height()+15); //15px from padding }, 15); } }, openSubmenu : function(e) { var jqThis = $(this); var submenuTarget = jqThis.closest('li').find('ul'); submenuTarget.toggleClass('active'); $('.iasd-dropdown-navigation .dropdown-menu').css('height', submenuTarget.height()+15); //15px from padding e.preventDefault(); }, closeSubmenu : function(e) { var $this = $(this); var submenuTarget = $this.closest('ul'); $('.iasd-dropdown-navigation .dropdown-menu').css('height', ''); submenuTarget.removeClass('active'); e.preventDefault(); } }; })(jQuery); (function($){ $(document).ready(function (){ footer.handleEvents(); }); var footer = { handleEvents : function(){ $('body > footer .back-top').on('click', footer.backTop); }, backTop : function(e){ $('body,html').animate({ scrollTop: 0 }, 500, 'swing'); e.preventDefault(); } }; })(jQuery); if (!window.matchMedia){ window.matchMedia = function(){ return { matches:false }; }; } (function($){ $(document).ready(function (){ globalNav.handleEvents(); }); var isSmallDevice = window.matchMedia("(max-width: 767px)").matches; //Changes functionality on small devices var globalNav = { handleEvents : function(){ $('.iasd-global_navbar .more-panel a').on('click', globalNav.changeActiveTab); $('.iasd-global_navbar .more a').on('click', globalNav.toggleMorePanel); $('.iasd-global_navbar .navbar-header button').on('click', globalNav.toggleResponsiveMenu); $('.iasd-global_navbar .headquarters > li > a').on('click', globalNav.toggleSubmenu); $('.iasd-global_navbar .headquarters > li > a').on('mouseover', globalNav.changeMap); $('.iasd-global_navbar .headquarters > li > a').on('mouseout', globalNav.cleanMap); $('.iasd-global_navbar .search-link').on('click', globalNav.toggleSearchBox); }, changeActiveTab : function(e) { var jqThis = $(this); if (isSmallDevice) { jqThis.parent().toggleClass('active').find('> ul').toggleClass('open'); } else { jqThis.tab('show'); } e.preventDefault(); }, toggleMorePanel : function(e) { var jqThis = $(this); $('.iasd-global_navbar .search-link').removeClass('active'); $('.iasd-global_navbar .iasd-global_navbar-search').removeClass('open'); jqThis.parent().toggleClass('active'); $('.iasd-global_navbar .iasd-global_navbar-more').toggleClass('open'); $('.iasd-global_navbar .more-panel a:first').trigger( "click" ); e.preventDefault(); }, toggleResponsiveMenu : function(){ $('.iasd-global_navbar .search-link').removeClass('active'); $('.iasd-global_navbar .iasd-global_navbar-search').removeClass('open'); $('.iasd-global_navbar .navbar-collapse').toggleClass('collapse').toggleClass('in'); $('.iasd-global_navbar .iasd-global_navbar-more').toggleClass('open'); $('.iasd-global_navbar .more-panel a').each(function(){ var jqThis = $(this); var selector = jqThis.attr('href'); if (isSmallDevice) { $(selector).children('ul').insertAfter(jqThis); } }); }, toggleSubmenu : function(e){ var jqThis = $(this); if (isSmallDevice) { jqThis.parent().toggleClass('active').find('ul').toggleClass('open'); } else { jqThis.parent().parent().find('ul').removeClass('open'); jqThis.parent().find('> ul').addClass('open'); jqThis.parent().parent().find('li').removeClass('active'); jqThis.parent().addClass('active'); $('.tutorial').remove(); } e.preventDefault(); }, toggleSearchBox : function(e){ var jqThis = $(this); $('.iasd-global_navbar .navbar-collapse').addClass('collapse').removeClass('in'); $('.iasd-global_navbar .more a').parent().removeClass('active'); $('.iasd-global_navbar .iasd-global_navbar-more').removeClass('open'); jqThis.toggleClass('active'); $('.iasd-global_navbar .iasd-global_navbar-search').toggleClass('open'); e.preventDefault(); }, changeMap : function(){ var jqThis = $(this).attr('data-region'); $('.headquarters-map').attr('class', 'headquarters-map visible-md visible-lg'); $('.headquarters-map').addClass('map-region_'+jqThis); }, cleanMap : function(){ var jqThis = $(this); var defaultRegion = "01"; var newDefaultRegion = $('.iasd-global_navbar .headquarters > li.active > a').attr('data-region'); if(!newDefaultRegion){ $('.headquarters-map').attr('class', 'headquarters-map visible-md visible-lg map-region_'+defaultRegion); } else{ $('.headquarters-map').attr('class', 'headquarters-map visible-md visible-lg map-region_'+newDefaultRegion); } } }; })(jQuery); if (!window.matchMedia){ window.matchMedia = function(){ return { matches:false }; }; } (function($){ $(document).ready(function (){ mainNav.handleEvents(); mainNav.duplicateTouchLink(); }); var isSmallDevice = window.matchMedia("(max-width: 767px)").matches; //Changes functionality on small devices var mainNav = { handleEvents : function(){ $('.iasd-main_navbar .navbar-nav li > a').on('click', mainNav.preventDefaultTouchBehavior); // Fix events for large touch devices $('.iasd-main_navbar .navbar-toggle').on('click', mainNav.toggleResponsiveMenu); }, preventDefaultTouchBehavior : function(e) { var jqThis = $(this).parent(); if (!isSmallDevice) { jqThis.siblings().removeClass('open'); } jqThis.toggleClass('open'); if(jqThis.find('ul').length > 0 && (isSmallDevice || $('html').hasClass('touch')) ){ e.preventDefault(); } var aThis = jqThis.find('>:first-child'); if(aThis) if(aThis.attr('href') == '#') e.preventDefault(); }, duplicateTouchLink : function() { if(isSmallDevice || $('html').hasClass('touch')){ $('.iasd-main_navbar .navbar-nav li.has-children').each(function(){ var jqThis = $(this); var elementURL = jqThis.find('> a').attr('href'); var elementContent = jqThis.find('> a').html(); if(elementURL!='#'){ jqThis.find('> ul').prepend('
  • '+elementContent+'
  • '); //TODO Usar jquery templates } }); } }, toggleResponsiveMenu : function(){ $('.iasd-main_navbar .navbar-collapse').toggleClass('collapse').toggleClass('in'); } }; })(jQuery); (function($){ $(document).ready(function (){ iasdCloseModal.closeModal(); iasdFilterToggleActive.handleEvents(); iasdLoadMorePosts.handleEvents(); iasdReturnPageNav.handleEvents(); }); /* ------------------------------------------ */ var iasdCloseModal = { closeModal : function(e){ $('.modal').each(function(){ var src = $(this).find('iframe').attr('src'); $(this).on('click', function(){ $(this).find('iframe').attr('src', ''); $(this).find('iframe').attr('src', src); }); }); } }; var iasdFilterToggleActive = { handleEvents : function(){ $('.iasd-search-filters > a > h3').on('click', iasdFilterToggleActive.filterToggleActive); }, filterToggleActive : function(e){ $(this).toggleClass('active'); } }; var iasdReturnPageNav = { handleEvents : function(){ $('body').on('click','.iasd-plugin-return_page .toggle-visibility-link', iasdReturnPageNav.toggleVisibility); }, toggleVisibility : function(e){ jqThis = $(this); jqThis.parent().toggleClass('collapsed'); if(jqThis.parent().hasClass('collapsed')){ jqThis.attr("title", "Clique para visualizar o link da página anterior"); } else{ jqThis.attr("title", "Clique para fechar este link"); } e.preventDefault(); }, }; var iasdLoadMorePosts = { handleEvents : function(){ $('.load-more_posts-link').on('click', iasdLoadMorePosts.loadMorePosts); }, loadMorePosts : function(event) { var $button = jQuery(this); if(!$button.hasClass('loading')) { $button.addClass('loading'); $.ajax({ url : $button.attr('href'), context: $button, dataType: 'html' }).done(iasdLoadMorePosts.renderMorePosts).fail(iasdLoadMorePosts.renderMorePostsError); } event.preventDefault(); }, renderMorePosts : function(data, textStatus, jqXHR) { var $nextPage = jQuery(data); var $ajaxContainer = jQuery('.iasd-post-list-ajax'); var $newAjaxContainer = $nextPage.find('.iasd-post-list-ajax'); var nextPageHref = $nextPage.find('.load-more_posts-link').attr('href'); $newAjaxContainer.find('> .iasd-post-list-item-ajax').appendTo($ajaxContainer); var currentPage = $newAjaxContainer.data('page'); var maxPages = $ajaxContainer.data('pages'); $ajaxContainer.data('page', currentPage); var $button = jQuery(this); $button.removeClass('loading'); if(maxPages == currentPage) $button.hide(); jQuery('.load-more_posts-link').attr('href', nextPageHref); $button.trigger('after-render-page.iasd'); }, renderMorePostsError : function(){ var $button = jQuery(this); $button.removeClass('loading'); } }; })(jQuery); (function($){ var owlCarousels = []; var widthCheckerInterval = false; $(document).ready(function (){ widgets.handleEvents(); owlPlugin.initPostCarousel(); owlPlugin.initServiceCarouselLarge(); owlPlugin.initServiceCarouselSmall(); owlPlugin.initGalleriesCarousel(); owlPlugin.initColumnsCarousel(); owlPlugin.initMagazineCarousel(); owlPlugin.initNewsstandCarouselSmall(); owlPlugin.initNewsstandCarouselLarge(); owlPlugin.initInstitutionalCarousel(); $('.iasd-images-gallery').IASDImageGallery(); if(owlCarousels.length > 0) { widthCheckerInterval = setInterval(function() { for (var i = owlCarousels.length - 1; i >= 0; i--) { owlCarousels[i].updateVars(); }; }, 2000); setTimeout(function() { clearInterval(widthCheckerInterval); }, 30000); } }); var widgets = { handleEvents : function(){ $('.toggle-config-link').on('click', widgets.toggleConfig); $('.custom-select > select').on('change', widgets.removeFocus); }, toggleConfig : function(e){ jqThis = $(this); jqThis.parent().toggleClass('open'); e.preventDefault(); }, removeFocus : function(){ jqThis = $(this); jqThis.blur(); } }; var owlPlugin = { initPostCarousel : function(){ var element = $(".iasd-widget-slider > .posts, .iasd-widget-slider > .header"); if(element.length > 0) { owlCarousels.push(element.owlCarousel({ navigation : false, slideSpeed : 500, paginationSpeed : 1000, singleItem: true, autoPlay: true, stopOnHover: true, lazyLoad : true }).data('owlCarousel')); } }, initServiceCarouselLarge : function(){ var element = $(".iasd-widget-slider > .services.large"); if(element.length > 0) { owlCarousels.push(element.owlCarousel({ items : 5, itemsDesktop : [1200,5], itemsDesktopSmall : [991,5], itemsTablet : [768,3], itemsMobile: [479,2], slideSpeed : 500, paginationSpeed : 1000, autoPlay: false, stopOnHover: true }).data('owlCarousel')); } }, initServiceCarouselSmall : function(){ var element = $(".iasd-widget-slider > .services.small"); if(element.length > 0) { owlCarousels.push(element.owlCarousel({ items : 2, itemsDesktop : [1200,2], itemsDesktopSmall : [991,2], itemsTablet : [768,5], itemsMobile: [479,2], navigation : false, slideSpeed : 500, paginationSpeed : 1000, autoPlay: false, stopOnHover: true }).data('owlCarousel')); } }, initGalleriesCarousel : function(){ var element = $(".iasd-widget-slider > .galleries"); if(element.length > 0) { owlCarousels.push(element.owlCarousel({ navigation : true, slideSpeed : 500, pagination : false, singleItem: true, autoPlay: false, stopOnHover: true, navigationText: false, mouseDrag: false, touchDrag: false, transitionStyle : "fade", lazyLoad : true }).data('owlCarousel')); } }, initColumnsCarousel : function(){ var element = $(".iasd-widget-slider .columns > div"); if(element.length > 0) { owlCarousels.push(element.owlCarousel({ items: 5, itemsDesktop : [1200,4], itemsDesktopSmall : [992,4], itemsTablet : [768,2], itemsMobile: [480,1], navigation : false, slideSpeed : 500, paginationSpeed : 1000, autoPlay: false, stopOnHover: true }).data('owlCarousel')); } }, initMagazineCarousel : function(){ var element = $(".iasd-widget-slider > .magazine"); if(element.length > 0) { owlCarousels.push(element.owlCarousel({ navigation : true, items : 1, itemsDesktop : [1200,1], itemsDesktopSmall : [991,1], itemsTablet : [768,3], itemsMobile: [479,1], slideSpeed : 500, pagination : false, paginationSpeed : 1000, autoPlay: false, navigationText: false, stopOnHover: true, mouseDrag: false, touchDrag: false, lazyLoad : true }).data('owlCarousel')); } }, initNewsstandCarouselSmall : function(){ var element = $(".iasd-widget-slider > .newsstand.small"); if(element.length > 0) { owlCarousels.push(element.owlCarousel({ navigation : true, items : 1, itemsDesktop : [1200,1], itemsDesktopSmall : [991,3], itemsTablet : [768,2], itemsMobile: [479,1], slideSpeed : 500, pagination : false, paginationSpeed : 1000, autoPlay: false, navigationText: false, stopOnHover: true, mouseDrag: false, touchDrag: false, lazyLoad : true }).data('owlCarousel')); } }, initNewsstandCarouselLarge : function(){ var element = $(".iasd-widget-slider > .newsstand.large"); if(element.length > 0) { owlCarousels.push(element.owlCarousel({ navigation : true, items : 2, itemsDesktop : [1200,2], itemsDesktopSmall : [991,2], itemsTablet : [768,2], itemsMobile: [479,1], slideSpeed : 500, pagination : false, paginationSpeed : 1000, autoPlay: false, navigationText: false, stopOnHover: true, mouseDrag: false, touchDrag: false, lazyLoad : true }).data('owlCarousel')); } }, initInstitutionalCarousel : function(){ var element = $(".iasd-institutional-gallery"); if(element.length > 0) { owlCarousels.push(element.owlCarousel({ items : 1, itemsDesktop : [1200,1], itemsDesktopSmall : [991,1], itemsTablet : [768,1], itemsMobile: [479,1] }).data('owlCarousel')); } } }; $.fn.IASDImageGallery = function(options){ if ($.type(options) != 'object'){ options = {}; } this.each(function(){ ImageGalleryController.init.apply(this, [options]); }); } var ImageGalleryController = { defaultOptions : { items : 7, itemsDesktop : [1199,7], itemsDesktopSmall : [979,5], itemsTablet : [768,6], itemsMobile : [479,3], pagination : false, responsiveRefreshRate : 100, afterInit : function(el){ el.find(".owl-item").eq(0).addClass("synced"); } }, init : function (userOptions){ var $container = $(this); var options = $.extend({}, ImageGalleryController.defaultOptions, userOptions); var $pics = $container.find(".iasd-images-gallery-pics"); var $thumbs = $container.find(".iasd-images-gallery-thumbs"); $pics.owlCarousel({ afterAction : ImageGalleryController.syncPosition, pagination : false, responsiveRefreshRate : 200, navigation : false, singleItem : true, slideSpeed : 1000, autoHeight : true, autoPlay : false, lazyLoad : true, transitionStyle : "fade" }); $thumbs.owlCarousel({ pagination : false, navigation : false, responsiveRefreshRate : 200, autoPlay : false, autoHeight : true, lazyLoad : true, items : 7, itemsDesktop : [1199,7], itemsDesktopSmall : [979,5], itemsTablet : [768,6], itemsMobile : [479,3], pagination : false, transitionStyle : "fade" }); $thumbs.owlCarousel(options); $thumbs.on("click", ".owl-item", ImageGalleryController.onClickThumbItem); }, syncPosition: function(el){ $thumbs = $(el).closest('.iasd-images-gallery').find('.iasd-images-gallery-thumbs'); var current = this.currentItem; $thumbs.find(".owl-item").removeClass("synced").eq(current).addClass("synced"); if( $thumbs.data("owlCarousel") !== undefined ){ ImageGalleryController.center(current, $thumbs); } }, onClickThumbItem: function(e){ e.preventDefault(); $this = $(this); $pics = $this.closest('.iasd-images-gallery').find('.iasd-images-gallery-pics'); var number = $this.data("owlItem"); $pics.trigger("owl.goTo",number); }, center: function(number, $thumbs){ var $thumbsvisible = $thumbs.data("owlCarousel").owl.visibleItems; var num = number; var found = false; for(var i in $thumbsvisible){ if(num === $thumbsvisible[i]){ var found = true; } } if(found===false){ if(num>$thumbsvisible[$thumbsvisible.length-1]){ $thumbs.trigger("owl.goTo", num - $thumbsvisible.length+2) }else{ if(num - 1 === -1){ num = 0; } $thumbs.trigger("owl.goTo", num); } } else if(num === $thumbsvisible[$thumbsvisible.length-1]){ $thumbs.trigger("owl.goTo", $thumbsvisible[1]) } else if(num === $thumbsvisible[0]){ $thumbs.trigger("owl.goTo", num-1) } } }; })(jQuery); (function($){ $(window).load(function (){ $(".iasd-widget-posts_box address, .iasd-widget-posts_box h2, .iasd-widget-posts_categories h2, .iasd-widget-posts_categories p, .iasd-widget-posts_grid h2, .iasd-widget-posts_grid .post-horizontal-list-item h2, .iasd-widget-posts_grid .post-horizontal-list-item p, .iasd-widget-posts_list h2, .iasd-widget-slider .owl-carousel .slider-item h2, .iasd-widget-slider .owl-carousel .slider-item h3, .iasd-widget-slider .owl-carousel .slider-item p").badonkatrunc({ fitDirection: 'vertical', automaticSizeTracking: true }); $(".entry-content footer .more-posts li h3, .iasd-archive>article h2, .iasd-archive>article h2+p, .iasd-blogs-last-posts h1").badonkatrunc({ fitDirection: 'vertical', automaticSizeTracking: true }); }); })(jQuery);