iasd-bootstrap-sass 1.0.1 → 1.0.2

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,2193 @@
1
+ /*!
2
+ * IASD Bootstrap v1.0.1 (http://styleguide.adventistas.org)
3
+ * Copyright 2014-2014 Igreja Adventista do Sétimo Dia
4
+ * Licensed under MIT (https://github.com/igrejaadventista/styleguide/blob/master/LICENSE)
5
+ */
6
+
7
+ /* Modernizr 2.6.2 (Custom Build) | MIT & BSD
8
+ * Build: http://modernizr.com/download/#-touch-mq-cssclasses-teststyles-prefixes-load
9
+ */
10
+ ;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=["&#173;",'<style id="s',h,'">',a,"</style>"].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;f<d;f++)g=a[f].split("="),(e=z[g.shift()])&&(c=e(c,g));for(f=0;f<b;f++)c=x[f](c);return c}function g(a,e,f,g,h){var i=b(a),j=i.autoCallback;i.url.split(".").pop().split("?").shift(),i.bypass||(e&&(e=d(e)?e:e[a]||e[g]||e[a.split("/").pop().split("?")[0]]),i.instead?i.instead(a,e,f,g,h):(y[i.url]?i.noexec=!0:y[i.url]=1,f.load(i.url,i.forceCSS||!i.forceJS&&"css"==i.url.split(".").pop().split("?").shift()?"c":c,i.noexec,i.attrs,i.timeout),(d(e)||d(j))&&f.load(function(){k(),e&&e(i.origUrl,h,g),j&&j(i.origUrl,h,g),y[i.url]=2})))}function h(a,b){function c(a,c){if(a){if(e(a))c||(j=function(){var a=[].slice.call(arguments);k.apply(this,a),l()}),g(a,j,b,0,h);else if(Object(a)===a)for(n in m=function(){var b=0,c;for(c in a)a.hasOwnProperty(c)&&b++;return b}(),a)a.hasOwnProperty(n)&&(!c&&!--m&&(d(j)?j=function(){var a=[].slice.call(arguments);k.apply(this,a),l()}:j[n]=function(a){return function(){var b=[].slice.call(arguments);a&&a.apply(this,b),l()}}(k[n])),g(a[n],j,b,n,h))}else!c&&l()}var h=!!a.test,i=a.load||a.both,j=a.callback||f,k=j,l=a.complete||f,m,n;c(h?a.yep:a.nope,!!i),i&&c(i)}var i,j,l=this.yepnope.loader;if(e(a))g(a,0,l,0);else if(w(a))for(i=0;i<a.length;i++)j=a[i],e(j)?g(j,0,l,0):w(j)?B(j):Object(j)===j&&h(j,l);else Object(a)===a&&h(a,l)},B.addPrefix=function(a,b){z[a]=b},B.addFilter=function(a){x.push(a)},B.errorTimeout=1e4,null==b.readyState&&b.addEventListener&&(b.readyState="loading",b.addEventListener("DOMContentLoaded",A=function(){b.removeEventListener("DOMContentLoaded",A,0),b.readyState="complete"},0)),a.yepnope=k(),a.yepnope.executeStack=h,a.yepnope.injectJs=function(a,c,d,e,i,j){var k=b.createElement("script"),l,o,e=e||B.errorTimeout;k.src=a;for(o in d)k.setAttribute(o,d[o]);c=j?h:c||f,k.onreadystatechange=k.onload=function(){!l&&g(k.readyState)&&(l=1,c(),k.onload=k.onreadystatechange=null)},m(function(){l||(l=1,c(1))},e),i?k.onload():n.parentNode.insertBefore(k,n)},a.yepnope.injectCss=function(a,c,d,e,g,i){var e=b.createElement("link"),j,c=i?h:c||f;e.href=a,e.rel="stylesheet",e.type="text/css";for(j in d)e.setAttribute(j,d[j]);g||(n.parentNode.insertBefore(e,n),m(c,0))}}(this,document),Modernizr.load=function(){yepnope.apply(window,[].slice.call(arguments,0))};
11
+ /**
12
+ * bootstrap.js v3.0.0 by @fat and @mdo
13
+ * Copyright 2013 Twitter Inc.
14
+ * http://www.apache.org/licenses/LICENSE-2.0
15
+ */
16
+ if(!jQuery)throw new Error("Bootstrap requires jQuery");+function(a){"use strict";function b(){var a=document.createElement("bootstrap"),b={WebkitTransition:"webkitTransitionEnd",MozTransition:"transitionend",OTransition:"oTransitionEnd otransitionend",transition:"transitionend"};for(var c in b)if(void 0!==a.style[c])return{end:b[c]}}a.fn.emulateTransitionEnd=function(b){var c=!1,d=this;a(this).one(a.support.transition.end,function(){c=!0});var e=function(){c||a(d).trigger(a.support.transition.end)};return setTimeout(e,b),this},a(function(){a.support.transition=b()})}(window.jQuery),+function(a){"use strict";var b='[data-dismiss="alert"]',c=function(c){a(c).on("click",b,this.close)};c.prototype.close=function(b){function c(){f.trigger("closed.bs.alert").remove()}var d=a(this),e=d.attr("data-target");e||(e=d.attr("href"),e=e&&e.replace(/.*(?=#[^\s]*$)/,""));var f=a(e);b&&b.preventDefault(),f.length||(f=d.hasClass("alert")?d:d.parent()),f.trigger(b=a.Event("close.bs.alert")),b.isDefaultPrevented()||(f.removeClass("in"),a.support.transition&&f.hasClass("fade")?f.one(a.support.transition.end,c).emulateTransitionEnd(150):c())};var d=a.fn.alert;a.fn.alert=function(b){return this.each(function(){var d=a(this),e=d.data("bs.alert");e||d.data("bs.alert",e=new c(this)),"string"==typeof b&&e[b].call(d)})},a.fn.alert.Constructor=c,a.fn.alert.noConflict=function(){return a.fn.alert=d,this},a(document).on("click.bs.alert.data-api",b,c.prototype.close)}(window.jQuery),+function(a){"use strict";var b=function(c,d){this.$element=a(c),this.options=a.extend({},b.DEFAULTS,d)};b.DEFAULTS={loadingText:"loading..."},b.prototype.setState=function(a){var b="disabled",c=this.$element,d=c.is("input")?"val":"html",e=c.data();a+="Text",e.resetText||c.data("resetText",c[d]()),c[d](e[a]||this.options[a]),setTimeout(function(){"loadingText"==a?c.addClass(b).attr(b,b):c.removeClass(b).removeAttr(b)},0)},b.prototype.toggle=function(){var a=this.$element.closest('[data-toggle="buttons"]');if(a.length){var b=this.$element.find("input").prop("checked",!this.$element.hasClass("active")).trigger("change");"radio"===b.prop("type")&&a.find(".active").removeClass("active")}this.$element.toggleClass("active")};var c=a.fn.button;a.fn.button=function(c){return this.each(function(){var d=a(this),e=d.data("bs.button"),f="object"==typeof c&&c;e||d.data("bs.button",e=new b(this,f)),"toggle"==c?e.toggle():c&&e.setState(c)})},a.fn.button.Constructor=b,a.fn.button.noConflict=function(){return a.fn.button=c,this},a(document).on("click.bs.button.data-api","[data-toggle^=button]",function(b){var c=a(b.target);c.hasClass("btn")||(c=c.closest(".btn")),c.button("toggle"),b.preventDefault()})}(window.jQuery),+function(a){"use strict";var b=function(b,c){this.$element=a(b),this.$indicators=this.$element.find(".carousel-indicators"),this.options=c,this.paused=this.sliding=this.interval=this.$active=this.$items=null,"hover"==this.options.pause&&this.$element.on("mouseenter",a.proxy(this.pause,this)).on("mouseleave",a.proxy(this.cycle,this))};b.DEFAULTS={interval:5e3,pause:"hover",wrap:!0},b.prototype.cycle=function(b){return b||(this.paused=!1),this.interval&&clearInterval(this.interval),this.options.interval&&!this.paused&&(this.interval=setInterval(a.proxy(this.next,this),this.options.interval)),this},b.prototype.getActiveIndex=function(){return this.$active=this.$element.find(".item.active"),this.$items=this.$active.parent().children(),this.$items.index(this.$active)},b.prototype.to=function(b){var c=this,d=this.getActiveIndex();return b>this.$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('<div class="dropdown-backdrop"/>').insertAfter(a(this)).on("click",b),f.trigger(d=a.Event("show.bs.dropdown")),d.isDefaultPrevented())return;f.toggleClass("open").trigger("shown.bs.dropdown"),e.focus()}return!1}},f.prototype.keydown=function(b){if(/(38|40|27)/.test(b.keyCode)){var d=a(this);if(b.preventDefault(),b.stopPropagation(),!d.is(".disabled, :disabled")){var f=c(d),g=f.hasClass("open");if(!g||g&&27==b.keyCode)return 27==b.which&&f.find(e).focus(),d.click();var h=a("[role=menu] li:not(.divider):visible a",f);if(h.length){var i=h.index(h.filter(":focus"));38==b.keyCode&&i>0&&i--,40==b.keyCode&&i<h.length-1&&i++,~i||(i=0),h.eq(i).focus()}}}};var g=a.fn.dropdown;a.fn.dropdown=function(b){return this.each(function(){var c=a(this),d=c.data("dropdown");d||c.data("dropdown",d=new f(this)),"string"==typeof b&&d[b].call(c)})},a.fn.dropdown.Constructor=f,a.fn.dropdown.noConflict=function(){return a.fn.dropdown=g,this},a(document).on("click.bs.dropdown.data-api",b).on("click.bs.dropdown.data-api",".dropdown form",function(a){a.stopPropagation()}).on("click.bs.dropdown.data-api",e,f.prototype.toggle).on("keydown.bs.dropdown.data-api",e+", [role=menu]",f.prototype.keydown)}(window.jQuery),+function(a){"use strict";var b=function(b,c){this.options=c,this.$element=a(b),this.$backdrop=this.isShown=null,this.options.remote&&this.$element.load(this.options.remote)};b.DEFAULTS={backdrop:!0,keyboard:!0,show:!0},b.prototype.toggle=function(a){return this[this.isShown?"hide":"show"](a)},b.prototype.show=function(b){var c=this,d=a.Event("show.bs.modal",{relatedTarget:b});this.$element.trigger(d),this.isShown||d.isDefaultPrevented()||(this.isShown=!0,this.escape(),this.$element.on("click.dismiss.modal",'[data-dismiss="modal"]',a.proxy(this.hide,this)),this.backdrop(function(){var d=a.support.transition&&c.$element.hasClass("fade");c.$element.parent().length||c.$element.appendTo(document.body),c.$element.show(),d&&c.$element[0].offsetWidth,c.$element.addClass("in").attr("aria-hidden",!1),c.enforceFocus();var e=a.Event("shown.bs.modal",{relatedTarget:b});d?c.$element.find(".modal-dialog").one(a.support.transition.end,function(){c.$element.focus().trigger(e)}).emulateTransitionEnd(300):c.$element.focus().trigger(e)}))},b.prototype.hide=function(b){b&&b.preventDefault(),b=a.Event("hide.bs.modal"),this.$element.trigger(b),this.isShown&&!b.isDefaultPrevented()&&(this.isShown=!1,this.escape(),a(document).off("focusin.bs.modal"),this.$element.removeClass("in").attr("aria-hidden",!0).off("click.dismiss.modal"),a.support.transition&&this.$element.hasClass("fade")?this.$element.one(a.support.transition.end,a.proxy(this.hideModal,this)).emulateTransitionEnd(300):this.hideModal())},b.prototype.enforceFocus=function(){a(document).off("focusin.bs.modal").on("focusin.bs.modal",a.proxy(function(a){this.$element[0]===a.target||this.$element.has(a.target).length||this.$element.focus()},this))},b.prototype.escape=function(){this.isShown&&this.options.keyboard?this.$element.on("keyup.dismiss.bs.modal",a.proxy(function(a){27==a.which&&this.hide()},this)):this.isShown||this.$element.off("keyup.dismiss.bs.modal")},b.prototype.hideModal=function(){var a=this;this.$element.hide(),this.backdrop(function(){a.removeBackdrop(),a.$element.trigger("hidden.bs.modal")})},b.prototype.removeBackdrop=function(){this.$backdrop&&this.$backdrop.remove(),this.$backdrop=null},b.prototype.backdrop=function(b){var c=this.$element.hasClass("fade")?"fade":"";if(this.isShown&&this.options.backdrop){var d=a.support.transition&&c;if(this.$backdrop=a('<div class="modal-backdrop '+c+'" />').appendTo(document.body),this.$element.on("click.dismiss.modal",a.proxy(function(a){a.target===a.currentTarget&&("static"==this.options.backdrop?this.$element[0].focus.call(this.$element[0]):this.hide.call(this))},this)),d&&this.$backdrop[0].offsetWidth,this.$backdrop.addClass("in"),!b)return;d?this.$backdrop.one(a.support.transition.end,b).emulateTransitionEnd(150):b()}else!this.isShown&&this.$backdrop?(this.$backdrop.removeClass("in"),a.support.transition&&this.$element.hasClass("fade")?this.$backdrop.one(a.support.transition.end,b).emulateTransitionEnd(150):b()):b&&b()};var c=a.fn.modal;a.fn.modal=function(c,d){return this.each(function(){var e=a(this),f=e.data("bs.modal"),g=a.extend({},b.DEFAULTS,e.data(),"object"==typeof c&&c);f||e.data("bs.modal",f=new b(this,g)),"string"==typeof c?f[c](d):g.show&&f.show(d)})},a.fn.modal.Constructor=b,a.fn.modal.noConflict=function(){return a.fn.modal=c,this},a(document).on("click.bs.modal.data-api",'[data-toggle="modal"]',function(b){var c=a(this),d=c.attr("href"),e=a(c.attr("data-target")||d&&d.replace(/.*(?=#[^\s]+$)/,"")),f=e.data("modal")?"toggle":a.extend({remote:!/#/.test(d)&&d},e.data(),c.data());b.preventDefault(),e.modal(f,this).one("hide",function(){c.is(":visible")&&c.focus()})}),a(document).on("show.bs.modal",".modal",function(){a(document.body).addClass("modal-open")}).on("hidden.bs.modal",".modal",function(){a(document.body).removeClass("modal-open")})}(window.jQuery),+function(a){"use strict";var b=function(a,b){this.type=this.options=this.enabled=this.timeout=this.hoverState=this.$element=null,this.init("tooltip",a,b)};b.DEFAULTS={animation:!0,placement:"top",selector:!1,template:'<div class="tooltip"><div class="tooltip-arrow"></div><div class="tooltip-inner"></div></div>',trigger:"hover focus",title:"",delay:0,html:!1,container:!1},b.prototype.init=function(b,c,d){this.enabled=!0,this.type=b,this.$element=a(c),this.options=this.getOptions(d);for(var e=this.options.trigger.split(" "),f=e.length;f--;){var g=e[f];if("click"==g)this.$element.on("click."+this.type,this.options.selector,a.proxy(this.toggle,this));else if("manual"!=g){var h="hover"==g?"mouseenter":"focus",i="hover"==g?"mouseleave":"blur";this.$element.on(h+"."+this.type,this.options.selector,a.proxy(this.enter,this)),this.$element.on(i+"."+this.type,this.options.selector,a.proxy(this.leave,this))}}this.options.selector?this._options=a.extend({},this.options,{trigger:"manual",selector:""}):this.fixTitle()},b.prototype.getDefaults=function(){return b.DEFAULTS},b.prototype.getOptions=function(b){return b=a.extend({},this.getDefaults(),this.$element.data(),b),b.delay&&"number"==typeof b.delay&&(b.delay={show:b.delay,hide:b.delay}),b},b.prototype.getDelegateOptions=function(){var b={},c=this.getDefaults();return this._options&&a.each(this._options,function(a,d){c[a]!=d&&(b[a]=d)}),b},b.prototype.enter=function(b){var c=b instanceof this.constructor?b:a(b.currentTarget)[this.type](this.getDelegateOptions()).data("bs."+this.type);return clearTimeout(c.timeout),c.hoverState="in",c.options.delay&&c.options.delay.show?(c.timeout=setTimeout(function(){"in"==c.hoverState&&c.show()},c.options.delay.show),void 0):c.show()},b.prototype.leave=function(b){var c=b instanceof this.constructor?b:a(b.currentTarget)[this.type](this.getDelegateOptions()).data("bs."+this.type);return clearTimeout(c.timeout),c.hoverState="out",c.options.delay&&c.options.delay.hide?(c.timeout=setTimeout(function(){"out"==c.hoverState&&c.hide()},c.options.delay.hide),void 0):c.hide()},b.prototype.show=function(){var b=a.Event("show.bs."+this.type);if(this.hasContent()&&this.enabled){if(this.$element.trigger(b),b.isDefaultPrevented())return;var c=this.tip();this.setContent(),this.options.animation&&c.addClass("fade");var d="function"==typeof this.options.placement?this.options.placement.call(this,c[0],this.$element[0]):this.options.placement,e=/\s?auto?\s?/i,f=e.test(d);f&&(d=d.replace(e,"")||"top"),c.detach().css({top:0,left:0,display:"block"}).addClass(d),this.options.container?c.appendTo(this.options.container):c.insertAfter(this.$element);var g=this.getPosition(),h=c[0].offsetWidth,i=c[0].offsetHeight;if(f){var j=this.$element.parent(),k=d,l=document.documentElement.scrollTop||document.body.scrollTop,m="body"==this.options.container?window.innerWidth:j.outerWidth(),n="body"==this.options.container?window.innerHeight:j.outerHeight(),o="body"==this.options.container?0:j.offset().left;d="bottom"==d&&g.top+g.height+i-l>n?"top":"top"==d&&g.top-l-i<0?"bottom":"right"==d&&g.right+h>m?"left":"left"==d&&g.left-h<o?"right":d,c.removeClass(k).addClass(d)}var p=this.getCalculatedOffset(d,g,h,i);this.applyPlacement(p,d),this.$element.trigger("shown.bs."+this.type)}},b.prototype.applyPlacement=function(a,b){var c,d=this.tip(),e=d[0].offsetWidth,f=d[0].offsetHeight,g=parseInt(d.css("margin-top"),10),h=parseInt(d.css("margin-left"),10);isNaN(g)&&(g=0),isNaN(h)&&(h=0),a.top=a.top+g,a.left=a.left+h,d.offset(a).addClass("in");var i=d[0].offsetWidth,j=d[0].offsetHeight;if("top"==b&&j!=f&&(c=!0,a.top=a.top+f-j),/bottom|top/.test(b)){var k=0;a.left<0&&(k=-2*a.left,a.left=0,d.offset(a),i=d[0].offsetWidth,j=d[0].offsetHeight),this.replaceArrow(k-e+i,i,"left")}else this.replaceArrow(j-f,j,"top");c&&d.offset(a)},b.prototype.replaceArrow=function(a,b,c){this.arrow().css(c,a?50*(1-a/b)+"%":"")},b.prototype.setContent=function(){var a=this.tip(),b=this.getTitle();a.find(".tooltip-inner")[this.options.html?"html":"text"](b),a.removeClass("fade in top bottom left right")},b.prototype.hide=function(){function b(){"in"!=c.hoverState&&d.detach()}var c=this,d=this.tip(),e=a.Event("hide.bs."+this.type);return this.$element.trigger(e),e.isDefaultPrevented()?void 0:(d.removeClass("in"),a.support.transition&&this.$tip.hasClass("fade")?d.one(a.support.transition.end,b).emulateTransitionEnd(150):b(),this.$element.trigger("hidden.bs."+this.type),this)},b.prototype.fixTitle=function(){var a=this.$element;(a.attr("title")||"string"!=typeof a.attr("data-original-title"))&&a.attr("data-original-title",a.attr("title")||"").attr("title","")},b.prototype.hasContent=function(){return this.getTitle()},b.prototype.getPosition=function(){var b=this.$element[0];return a.extend({},"function"==typeof b.getBoundingClientRect?b.getBoundingClientRect():{width:b.offsetWidth,height:b.offsetHeight},this.$element.offset())},b.prototype.getCalculatedOffset=function(a,b,c,d){return"bottom"==a?{top:b.top+b.height,left:b.left+b.width/2-c/2}:"top"==a?{top:b.top-d,left:b.left+b.width/2-c/2}:"left"==a?{top:b.top+b.height/2-d/2,left:b.left-c}:{top:b.top+b.height/2-d/2,left:b.left+b.width}},b.prototype.getTitle=function(){var a,b=this.$element,c=this.options;return a=b.attr("data-original-title")||("function"==typeof c.title?c.title.call(b[0]):c.title)},b.prototype.tip=function(){return this.$tip=this.$tip||a(this.options.template)},b.prototype.arrow=function(){return this.$arrow=this.$arrow||this.tip().find(".tooltip-arrow")},b.prototype.validate=function(){this.$element[0].parentNode||(this.hide(),this.$element=null,this.options=null)},b.prototype.enable=function(){this.enabled=!0},b.prototype.disable=function(){this.enabled=!1},b.prototype.toggleEnabled=function(){this.enabled=!this.enabled},b.prototype.toggle=function(b){var c=b?a(b.currentTarget)[this.type](this.getDelegateOptions()).data("bs."+this.type):this;c.tip().hasClass("in")?c.leave(c):c.enter(c)},b.prototype.destroy=function(){this.hide().$element.off("."+this.type).removeData("bs."+this.type)};var c=a.fn.tooltip;a.fn.tooltip=function(c){return this.each(function(){var d=a(this),e=d.data("bs.tooltip"),f="object"==typeof c&&c;e||d.data("bs.tooltip",e=new b(this,f)),"string"==typeof c&&e[c]()})},a.fn.tooltip.Constructor=b,a.fn.tooltip.noConflict=function(){return a.fn.tooltip=c,this}}(window.jQuery),+function(a){"use strict";var b=function(a,b){this.init("popover",a,b)};if(!a.fn.tooltip)throw new Error("Popover requires tooltip.js");b.DEFAULTS=a.extend({},a.fn.tooltip.Constructor.DEFAULTS,{placement:"right",trigger:"click",content:"",template:'<div class="popover"><div class="arrow"></div><h3 class="popover-title"></h3><div class="popover-content"></div></div>'}),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);
17
+ /*
18
+ * jQuery OwlCarousel v1.3.2
19
+ *
20
+ * Copyright (c) 2013 Bartosz Wojciechowski
21
+ * http://www.owlgraphic.com/owlcarousel/
22
+ *
23
+ * Licensed under MIT
24
+ *
25
+ */
26
+
27
+ /*JS Lint helpers: */
28
+ /*global dragMove: false, dragEnd: false, $, jQuery, alert, window, document */
29
+ /*jslint nomen: true, continue:true */
30
+
31
+ if (typeof Object.create !== "function") {
32
+ Object.create = function (obj) {
33
+ function F() {}
34
+ F.prototype = obj;
35
+ return new F();
36
+ };
37
+ }
38
+ (function ($, window, document) {
39
+
40
+ var Carousel = {
41
+ init : function (options, el) {
42
+ var base = this;
43
+
44
+ base.$elem = $(el);
45
+ base.options = $.extend({}, $.fn.owlCarousel.options, base.$elem.data(), options);
46
+
47
+ base.userOptions = options;
48
+ base.loadContent();
49
+ },
50
+
51
+ loadContent : function () {
52
+ var base = this, url;
53
+
54
+ function getData(data) {
55
+ var i, content = "";
56
+ if (typeof base.options.jsonSuccess === "function") {
57
+ base.options.jsonSuccess.apply(this, [data]);
58
+ } else {
59
+ for (i in data.owl) {
60
+ if (data.owl.hasOwnProperty(i)) {
61
+ content += data.owl[i].item;
62
+ }
63
+ }
64
+ base.$elem.html(content);
65
+ }
66
+ base.logIn();
67
+ }
68
+
69
+ if (typeof base.options.beforeInit === "function") {
70
+ base.options.beforeInit.apply(this, [base.$elem]);
71
+ }
72
+
73
+ if (typeof base.options.jsonPath === "string") {
74
+ url = base.options.jsonPath;
75
+ $.getJSON(url, getData);
76
+ } else {
77
+ base.logIn();
78
+ }
79
+ },
80
+
81
+ logIn : function () {
82
+ var base = this;
83
+
84
+ base.$elem.data("owl-originalStyles", base.$elem.attr("style"))
85
+ .data("owl-originalClasses", base.$elem.attr("class"));
86
+
87
+ base.$elem.css({opacity: 0});
88
+ base.orignalItems = base.options.items;
89
+ base.checkBrowser();
90
+ base.wrapperWidth = 0;
91
+ base.checkVisible = null;
92
+ base.setVars();
93
+ },
94
+
95
+ setVars : function () {
96
+ var base = this;
97
+ if (base.$elem.children().length === 0) {return false; }
98
+ base.baseClass();
99
+ base.eventTypes();
100
+ base.$userItems = base.$elem.children();
101
+ base.itemsAmount = base.$userItems.length;
102
+ base.wrapItems();
103
+ base.$owlItems = base.$elem.find(".owl-item");
104
+ base.$owlWrapper = base.$elem.find(".owl-wrapper");
105
+ base.playDirection = "next";
106
+ base.prevItem = 0;
107
+ base.prevArr = [0];
108
+ base.currentItem = 0;
109
+ base.customEvents();
110
+ base.onStartup();
111
+ },
112
+
113
+ onStartup : function () {
114
+ var base = this;
115
+ base.updateItems();
116
+ base.calculateAll();
117
+ base.buildControls();
118
+ base.updateControls();
119
+ base.response();
120
+ base.moveEvents();
121
+ base.stopOnHover();
122
+ base.owlStatus();
123
+
124
+ if (base.options.transitionStyle !== false) {
125
+ base.transitionTypes(base.options.transitionStyle);
126
+ }
127
+ if (base.options.autoPlay === true) {
128
+ base.options.autoPlay = 5000;
129
+ }
130
+ base.play();
131
+
132
+ base.$elem.find(".owl-wrapper").css("display", "block");
133
+
134
+ if (!base.$elem.is(":visible")) {
135
+ base.watchVisibility();
136
+ } else {
137
+ base.$elem.css("opacity", 1);
138
+ }
139
+ base.onstartup = false;
140
+ base.eachMoveUpdate();
141
+ if (typeof base.options.afterInit === "function") {
142
+ base.options.afterInit.apply(this, [base.$elem]);
143
+ }
144
+ },
145
+
146
+ eachMoveUpdate : function () {
147
+ var base = this;
148
+
149
+ if (base.options.lazyLoad === true) {
150
+ base.lazyLoad();
151
+ }
152
+ if (base.options.autoHeight === true) {
153
+ base.autoHeight();
154
+ }
155
+ base.onVisibleItems();
156
+
157
+ if (typeof base.options.afterAction === "function") {
158
+ base.options.afterAction.apply(this, [base.$elem]);
159
+ }
160
+ },
161
+
162
+ updateVars : function () {
163
+ var base = this;
164
+ if (typeof base.options.beforeUpdate === "function") {
165
+ base.options.beforeUpdate.apply(this, [base.$elem]);
166
+ }
167
+ base.watchVisibility();
168
+ base.updateItems();
169
+ base.calculateAll();
170
+ base.updatePosition();
171
+ base.updateControls();
172
+ base.eachMoveUpdate();
173
+ if (typeof base.options.afterUpdate === "function") {
174
+ base.options.afterUpdate.apply(this, [base.$elem]);
175
+ }
176
+ },
177
+
178
+ reload : function () {
179
+ var base = this;
180
+ window.setTimeout(function () {
181
+ base.updateVars();
182
+ }, 0);
183
+ },
184
+
185
+ watchVisibility : function () {
186
+ var base = this;
187
+
188
+ if (base.$elem.is(":visible") === false) {
189
+ base.$elem.css({opacity: 0});
190
+ window.clearInterval(base.autoPlayInterval);
191
+ window.clearInterval(base.checkVisible);
192
+ } else {
193
+ return false;
194
+ }
195
+ base.checkVisible = window.setInterval(function () {
196
+ if (base.$elem.is(":visible")) {
197
+ base.reload();
198
+ base.$elem.animate({opacity: 1}, 200);
199
+ window.clearInterval(base.checkVisible);
200
+ }
201
+ }, 500);
202
+ },
203
+
204
+ wrapItems : function () {
205
+ var base = this;
206
+ base.$userItems.wrapAll("<div class=\"owl-wrapper\">").wrap("<div class=\"owl-item\"></div>");
207
+ base.$elem.find(".owl-wrapper").wrap("<div class=\"owl-wrapper-outer\">");
208
+ base.wrapperOuter = base.$elem.find(".owl-wrapper-outer");
209
+ base.$elem.css("display", "block");
210
+ },
211
+
212
+ baseClass : function () {
213
+ var base = this,
214
+ hasBaseClass = base.$elem.hasClass(base.options.baseClass),
215
+ hasThemeClass = base.$elem.hasClass(base.options.theme);
216
+
217
+ if (!hasBaseClass) {
218
+ base.$elem.addClass(base.options.baseClass);
219
+ }
220
+
221
+ if (!hasThemeClass) {
222
+ base.$elem.addClass(base.options.theme);
223
+ }
224
+ },
225
+
226
+ updateItems : function () {
227
+ var base = this, width, i;
228
+
229
+ if (base.options.responsive === false) {
230
+ return false;
231
+ }
232
+ if (base.options.singleItem === true) {
233
+ base.options.items = base.orignalItems = 1;
234
+ base.options.itemsCustom = false;
235
+ base.options.itemsDesktop = false;
236
+ base.options.itemsDesktopSmall = false;
237
+ base.options.itemsTablet = false;
238
+ base.options.itemsTabletSmall = false;
239
+ base.options.itemsMobile = false;
240
+ return false;
241
+ }
242
+
243
+ width = $(base.options.responsiveBaseWidth).width();
244
+
245
+ if (width > (base.options.itemsDesktop[0] || base.orignalItems)) {
246
+ base.options.items = base.orignalItems;
247
+ }
248
+ if (base.options.itemsCustom !== false) {
249
+ //Reorder array by screen size
250
+ base.options.itemsCustom.sort(function (a, b) {return a[0] - b[0]; });
251
+
252
+ for (i = 0; i < base.options.itemsCustom.length; i += 1) {
253
+ if (base.options.itemsCustom[i][0] <= width) {
254
+ base.options.items = base.options.itemsCustom[i][1];
255
+ }
256
+ }
257
+
258
+ } else {
259
+
260
+ if (width <= base.options.itemsDesktop[0] && base.options.itemsDesktop !== false) {
261
+ base.options.items = base.options.itemsDesktop[1];
262
+ }
263
+
264
+ if (width <= base.options.itemsDesktopSmall[0] && base.options.itemsDesktopSmall !== false) {
265
+ base.options.items = base.options.itemsDesktopSmall[1];
266
+ }
267
+
268
+ if (width <= base.options.itemsTablet[0] && base.options.itemsTablet !== false) {
269
+ base.options.items = base.options.itemsTablet[1];
270
+ }
271
+
272
+ if (width <= base.options.itemsTabletSmall[0] && base.options.itemsTabletSmall !== false) {
273
+ base.options.items = base.options.itemsTabletSmall[1];
274
+ }
275
+
276
+ if (width <= base.options.itemsMobile[0] && base.options.itemsMobile !== false) {
277
+ base.options.items = base.options.itemsMobile[1];
278
+ }
279
+ }
280
+
281
+ //if number of items is less than declared
282
+ if (base.options.items > base.itemsAmount && base.options.itemsScaleUp === true) {
283
+ base.options.items = base.itemsAmount;
284
+ }
285
+ },
286
+
287
+ response : function () {
288
+ var base = this,
289
+ smallDelay,
290
+ lastWindowWidth;
291
+
292
+ if (base.options.responsive !== true) {
293
+ return false;
294
+ }
295
+ lastWindowWidth = $(window).width();
296
+
297
+ base.resizer = function () {
298
+ if ($(window).width() !== lastWindowWidth) {
299
+ if (base.options.autoPlay !== false) {
300
+ window.clearInterval(base.autoPlayInterval);
301
+ }
302
+ window.clearTimeout(smallDelay);
303
+ smallDelay = window.setTimeout(function () {
304
+ lastWindowWidth = $(window).width();
305
+ base.updateVars();
306
+ }, base.options.responsiveRefreshRate);
307
+ }
308
+ };
309
+ $(window).resize(base.resizer);
310
+ },
311
+
312
+ updatePosition : function () {
313
+ var base = this;
314
+ base.jumpTo(base.currentItem);
315
+ if (base.options.autoPlay !== false) {
316
+ base.checkAp();
317
+ }
318
+ },
319
+
320
+ appendItemsSizes : function () {
321
+ var base = this,
322
+ roundPages = 0,
323
+ lastItem = base.itemsAmount - base.options.items;
324
+
325
+ base.$owlItems.each(function (index) {
326
+ var $this = $(this);
327
+ $this
328
+ .css({"width": base.itemWidth})
329
+ .data("owl-item", Number(index));
330
+
331
+ if (index % base.options.items === 0 || index === lastItem) {
332
+ if (!(index > lastItem)) {
333
+ roundPages += 1;
334
+ }
335
+ }
336
+ $this.data("owl-roundPages", roundPages);
337
+ });
338
+ },
339
+
340
+ appendWrapperSizes : function () {
341
+ var base = this,
342
+ width = base.$owlItems.length * base.itemWidth;
343
+
344
+ base.$owlWrapper.css({
345
+ "width": width * 2,
346
+ "left": 0
347
+ });
348
+ base.appendItemsSizes();
349
+ },
350
+
351
+ calculateAll : function () {
352
+ var base = this;
353
+ base.calculateWidth();
354
+ base.appendWrapperSizes();
355
+ base.loops();
356
+ base.max();
357
+ },
358
+
359
+ calculateWidth : function () {
360
+ var base = this;
361
+ base.itemWidth = Math.round(base.$elem.width() / base.options.items);
362
+ },
363
+
364
+ max : function () {
365
+ var base = this,
366
+ maximum = ((base.itemsAmount * base.itemWidth) - base.options.items * base.itemWidth) * -1;
367
+ if (base.options.items > base.itemsAmount) {
368
+ base.maximumItem = 0;
369
+ maximum = 0;
370
+ base.maximumPixels = 0;
371
+ } else {
372
+ base.maximumItem = base.itemsAmount - base.options.items;
373
+ base.maximumPixels = maximum;
374
+ }
375
+ return maximum;
376
+ },
377
+
378
+ min : function () {
379
+ return 0;
380
+ },
381
+
382
+ loops : function () {
383
+ var base = this,
384
+ prev = 0,
385
+ elWidth = 0,
386
+ i,
387
+ item,
388
+ roundPageNum;
389
+
390
+ base.positionsInArray = [0];
391
+ base.pagesInArray = [];
392
+
393
+ for (i = 0; i < base.itemsAmount; i += 1) {
394
+ elWidth += base.itemWidth;
395
+ base.positionsInArray.push(-elWidth);
396
+
397
+ if (base.options.scrollPerPage === true) {
398
+ item = $(base.$owlItems[i]);
399
+ roundPageNum = item.data("owl-roundPages");
400
+ if (roundPageNum !== prev) {
401
+ base.pagesInArray[prev] = base.positionsInArray[i];
402
+ prev = roundPageNum;
403
+ }
404
+ }
405
+ }
406
+ },
407
+
408
+ buildControls : function () {
409
+ var base = this;
410
+ if (base.options.navigation === true || base.options.pagination === true) {
411
+ base.owlControls = $("<div class=\"owl-controls\"/>").toggleClass("clickable", !base.browser.isTouch).appendTo(base.$elem);
412
+ }
413
+ if (base.options.pagination === true) {
414
+ base.buildPagination();
415
+ }
416
+ if (base.options.navigation === true) {
417
+ base.buildButtons();
418
+ }
419
+ },
420
+
421
+ buildButtons : function () {
422
+ var base = this,
423
+ buttonsWrapper = $("<div class=\"owl-buttons\"/>");
424
+ base.owlControls.append(buttonsWrapper);
425
+
426
+ base.buttonPrev = $("<div/>", {
427
+ "class" : "owl-prev",
428
+ "html" : base.options.navigationText[0] || ""
429
+ });
430
+
431
+ base.buttonNext = $("<div/>", {
432
+ "class" : "owl-next",
433
+ "html" : base.options.navigationText[1] || ""
434
+ });
435
+
436
+ buttonsWrapper
437
+ .append(base.buttonPrev)
438
+ .append(base.buttonNext);
439
+
440
+ buttonsWrapper.on("touchstart.owlControls mousedown.owlControls", "div[class^=\"owl\"]", function (event) {
441
+ event.preventDefault();
442
+ });
443
+
444
+ buttonsWrapper.on("touchend.owlControls mouseup.owlControls", "div[class^=\"owl\"]", function (event) {
445
+ event.preventDefault();
446
+ if ($(this).hasClass("owl-next")) {
447
+ base.next();
448
+ } else {
449
+ base.prev();
450
+ }
451
+ });
452
+ },
453
+
454
+ buildPagination : function () {
455
+ var base = this;
456
+
457
+ base.paginationWrapper = $("<div class=\"owl-pagination\"/>");
458
+ base.owlControls.append(base.paginationWrapper);
459
+
460
+ base.paginationWrapper.on("touchend.owlControls mouseup.owlControls", ".owl-page", function (event) {
461
+ event.preventDefault();
462
+ if (Number($(this).data("owl-page")) !== base.currentItem) {
463
+ base.goTo(Number($(this).data("owl-page")), true);
464
+ }
465
+ });
466
+ },
467
+
468
+ updatePagination : function () {
469
+ var base = this,
470
+ counter,
471
+ lastPage,
472
+ lastItem,
473
+ i,
474
+ paginationButton,
475
+ paginationButtonInner;
476
+
477
+ if (base.options.pagination === false) {
478
+ return false;
479
+ }
480
+
481
+ base.paginationWrapper.html("");
482
+
483
+ counter = 0;
484
+ lastPage = base.itemsAmount - base.itemsAmount % base.options.items;
485
+
486
+ for (i = 0; i < base.itemsAmount; i += 1) {
487
+ if (i % base.options.items === 0) {
488
+ counter += 1;
489
+ if (lastPage === i) {
490
+ lastItem = base.itemsAmount - base.options.items;
491
+ }
492
+ paginationButton = $("<div/>", {
493
+ "class" : "owl-page"
494
+ });
495
+ paginationButtonInner = $("<span></span>", {
496
+ "text": base.options.paginationNumbers === true ? counter : "",
497
+ "class": base.options.paginationNumbers === true ? "owl-numbers" : ""
498
+ });
499
+ paginationButton.append(paginationButtonInner);
500
+
501
+ paginationButton.data("owl-page", lastPage === i ? lastItem : i);
502
+ paginationButton.data("owl-roundPages", counter);
503
+
504
+ base.paginationWrapper.append(paginationButton);
505
+ }
506
+ }
507
+ base.checkPagination();
508
+ },
509
+ checkPagination : function () {
510
+ var base = this;
511
+ if (base.options.pagination === false) {
512
+ return false;
513
+ }
514
+ base.paginationWrapper.find(".owl-page").each(function () {
515
+ if ($(this).data("owl-roundPages") === $(base.$owlItems[base.currentItem]).data("owl-roundPages")) {
516
+ base.paginationWrapper
517
+ .find(".owl-page")
518
+ .removeClass("active");
519
+ $(this).addClass("active");
520
+ }
521
+ });
522
+ },
523
+
524
+ checkNavigation : function () {
525
+ var base = this;
526
+
527
+ if (base.options.navigation === false) {
528
+ return false;
529
+ }
530
+ if (base.options.rewindNav === false) {
531
+ if (base.currentItem === 0 && base.maximumItem === 0) {
532
+ base.buttonPrev.addClass("disabled");
533
+ base.buttonNext.addClass("disabled");
534
+ } else if (base.currentItem === 0 && base.maximumItem !== 0) {
535
+ base.buttonPrev.addClass("disabled");
536
+ base.buttonNext.removeClass("disabled");
537
+ } else if (base.currentItem === base.maximumItem) {
538
+ base.buttonPrev.removeClass("disabled");
539
+ base.buttonNext.addClass("disabled");
540
+ } else if (base.currentItem !== 0 && base.currentItem !== base.maximumItem) {
541
+ base.buttonPrev.removeClass("disabled");
542
+ base.buttonNext.removeClass("disabled");
543
+ }
544
+ }
545
+ },
546
+
547
+ updateControls : function () {
548
+ var base = this;
549
+ base.updatePagination();
550
+ base.checkNavigation();
551
+ if (base.owlControls) {
552
+ if (base.options.items >= base.itemsAmount) {
553
+ base.owlControls.hide();
554
+ } else {
555
+ base.owlControls.show();
556
+ }
557
+ }
558
+ },
559
+
560
+ destroyControls : function () {
561
+ var base = this;
562
+ if (base.owlControls) {
563
+ base.owlControls.remove();
564
+ }
565
+ },
566
+
567
+ next : function (speed) {
568
+ var base = this;
569
+
570
+ if (base.isTransition) {
571
+ return false;
572
+ }
573
+
574
+ base.currentItem += base.options.scrollPerPage === true ? base.options.items : 1;
575
+ if (base.currentItem > base.maximumItem + (base.options.scrollPerPage === true ? (base.options.items - 1) : 0)) {
576
+ if (base.options.rewindNav === true) {
577
+ base.currentItem = 0;
578
+ speed = "rewind";
579
+ } else {
580
+ base.currentItem = base.maximumItem;
581
+ return false;
582
+ }
583
+ }
584
+ base.goTo(base.currentItem, speed);
585
+ },
586
+
587
+ prev : function (speed) {
588
+ var base = this;
589
+
590
+ if (base.isTransition) {
591
+ return false;
592
+ }
593
+
594
+ if (base.options.scrollPerPage === true && base.currentItem > 0 && base.currentItem < base.options.items) {
595
+ base.currentItem = 0;
596
+ } else {
597
+ base.currentItem -= base.options.scrollPerPage === true ? base.options.items : 1;
598
+ }
599
+ if (base.currentItem < 0) {
600
+ if (base.options.rewindNav === true) {
601
+ base.currentItem = base.maximumItem;
602
+ speed = "rewind";
603
+ } else {
604
+ base.currentItem = 0;
605
+ return false;
606
+ }
607
+ }
608
+ base.goTo(base.currentItem, speed);
609
+ },
610
+
611
+ goTo : function (position, speed, drag) {
612
+ var base = this,
613
+ goToPixel;
614
+
615
+ if (base.isTransition) {
616
+ return false;
617
+ }
618
+ if (typeof base.options.beforeMove === "function") {
619
+ base.options.beforeMove.apply(this, [base.$elem]);
620
+ }
621
+ if (position >= base.maximumItem) {
622
+ position = base.maximumItem;
623
+ } else if (position <= 0) {
624
+ position = 0;
625
+ }
626
+
627
+ base.currentItem = base.owl.currentItem = position;
628
+ if (base.options.transitionStyle !== false && drag !== "drag" && base.options.items === 1 && base.browser.support3d === true) {
629
+ base.swapSpeed(0);
630
+ if (base.browser.support3d === true) {
631
+ base.transition3d(base.positionsInArray[position]);
632
+ } else {
633
+ base.css2slide(base.positionsInArray[position], 1);
634
+ }
635
+ base.afterGo();
636
+ base.singleItemTransition();
637
+ return false;
638
+ }
639
+ goToPixel = base.positionsInArray[position];
640
+
641
+ if (base.browser.support3d === true) {
642
+ base.isCss3Finish = false;
643
+
644
+ if (speed === true) {
645
+ base.swapSpeed("paginationSpeed");
646
+ window.setTimeout(function () {
647
+ base.isCss3Finish = true;
648
+ }, base.options.paginationSpeed);
649
+
650
+ } else if (speed === "rewind") {
651
+ base.swapSpeed(base.options.rewindSpeed);
652
+ window.setTimeout(function () {
653
+ base.isCss3Finish = true;
654
+ }, base.options.rewindSpeed);
655
+
656
+ } else {
657
+ base.swapSpeed("slideSpeed");
658
+ window.setTimeout(function () {
659
+ base.isCss3Finish = true;
660
+ }, base.options.slideSpeed);
661
+ }
662
+ base.transition3d(goToPixel);
663
+ } else {
664
+ if (speed === true) {
665
+ base.css2slide(goToPixel, base.options.paginationSpeed);
666
+ } else if (speed === "rewind") {
667
+ base.css2slide(goToPixel, base.options.rewindSpeed);
668
+ } else {
669
+ base.css2slide(goToPixel, base.options.slideSpeed);
670
+ }
671
+ }
672
+ base.afterGo();
673
+ },
674
+
675
+ jumpTo : function (position) {
676
+ var base = this;
677
+ if (typeof base.options.beforeMove === "function") {
678
+ base.options.beforeMove.apply(this, [base.$elem]);
679
+ }
680
+ if (position >= base.maximumItem || position === -1) {
681
+ position = base.maximumItem;
682
+ } else if (position <= 0) {
683
+ position = 0;
684
+ }
685
+ base.swapSpeed(0);
686
+ if (base.browser.support3d === true) {
687
+ base.transition3d(base.positionsInArray[position]);
688
+ } else {
689
+ base.css2slide(base.positionsInArray[position], 1);
690
+ }
691
+ base.currentItem = base.owl.currentItem = position;
692
+ base.afterGo();
693
+ },
694
+
695
+ afterGo : function () {
696
+ var base = this;
697
+
698
+ base.prevArr.push(base.currentItem);
699
+ base.prevItem = base.owl.prevItem = base.prevArr[base.prevArr.length - 2];
700
+ base.prevArr.shift(0);
701
+
702
+ if (base.prevItem !== base.currentItem) {
703
+ base.checkPagination();
704
+ base.checkNavigation();
705
+ base.eachMoveUpdate();
706
+
707
+ if (base.options.autoPlay !== false) {
708
+ base.checkAp();
709
+ }
710
+ }
711
+ if (typeof base.options.afterMove === "function" && base.prevItem !== base.currentItem) {
712
+ base.options.afterMove.apply(this, [base.$elem]);
713
+ }
714
+ },
715
+
716
+ stop : function () {
717
+ var base = this;
718
+ base.apStatus = "stop";
719
+ window.clearInterval(base.autoPlayInterval);
720
+ },
721
+
722
+ checkAp : function () {
723
+ var base = this;
724
+ if (base.apStatus !== "stop") {
725
+ base.play();
726
+ }
727
+ },
728
+
729
+ play : function () {
730
+ var base = this;
731
+ base.apStatus = "play";
732
+ if (base.options.autoPlay === false) {
733
+ return false;
734
+ }
735
+ window.clearInterval(base.autoPlayInterval);
736
+ base.autoPlayInterval = window.setInterval(function () {
737
+ base.next(true);
738
+ }, base.options.autoPlay);
739
+ },
740
+
741
+ swapSpeed : function (action) {
742
+ var base = this;
743
+ if (action === "slideSpeed") {
744
+ base.$owlWrapper.css(base.addCssSpeed(base.options.slideSpeed));
745
+ } else if (action === "paginationSpeed") {
746
+ base.$owlWrapper.css(base.addCssSpeed(base.options.paginationSpeed));
747
+ } else if (typeof action !== "string") {
748
+ base.$owlWrapper.css(base.addCssSpeed(action));
749
+ }
750
+ },
751
+
752
+ addCssSpeed : function (speed) {
753
+ return {
754
+ "-webkit-transition": "all " + speed + "ms ease",
755
+ "-moz-transition": "all " + speed + "ms ease",
756
+ "-o-transition": "all " + speed + "ms ease",
757
+ "transition": "all " + speed + "ms ease"
758
+ };
759
+ },
760
+
761
+ removeTransition : function () {
762
+ return {
763
+ "-webkit-transition": "",
764
+ "-moz-transition": "",
765
+ "-o-transition": "",
766
+ "transition": ""
767
+ };
768
+ },
769
+
770
+ doTranslate : function (pixels) {
771
+ return {
772
+ "-webkit-transform": "translate3d(" + pixels + "px, 0px, 0px)",
773
+ "-moz-transform": "translate3d(" + pixels + "px, 0px, 0px)",
774
+ "-o-transform": "translate3d(" + pixels + "px, 0px, 0px)",
775
+ "-ms-transform": "translate3d(" + pixels + "px, 0px, 0px)",
776
+ "transform": "translate3d(" + pixels + "px, 0px,0px)"
777
+ };
778
+ },
779
+
780
+ transition3d : function (value) {
781
+ var base = this;
782
+ base.$owlWrapper.css(base.doTranslate(value));
783
+ },
784
+
785
+ css2move : function (value) {
786
+ var base = this;
787
+ base.$owlWrapper.css({"left" : value});
788
+ },
789
+
790
+ css2slide : function (value, speed) {
791
+ var base = this;
792
+
793
+ base.isCssFinish = false;
794
+ base.$owlWrapper.stop(true, true).animate({
795
+ "left" : value
796
+ }, {
797
+ duration : speed || base.options.slideSpeed,
798
+ complete : function () {
799
+ base.isCssFinish = true;
800
+ }
801
+ });
802
+ },
803
+
804
+ checkBrowser : function () {
805
+ var base = this,
806
+ translate3D = "translate3d(0px, 0px, 0px)",
807
+ tempElem = document.createElement("div"),
808
+ regex,
809
+ asSupport,
810
+ support3d,
811
+ isTouch;
812
+
813
+ tempElem.style.cssText = " -moz-transform:" + translate3D +
814
+ "; -ms-transform:" + translate3D +
815
+ "; -o-transform:" + translate3D +
816
+ "; -webkit-transform:" + translate3D +
817
+ "; transform:" + translate3D;
818
+ regex = /translate3d\(0px, 0px, 0px\)/g;
819
+ asSupport = tempElem.style.cssText.match(regex);
820
+ support3d = (asSupport !== null && asSupport.length === 1);
821
+
822
+ isTouch = "ontouchstart" in window || window.navigator.msMaxTouchPoints;
823
+
824
+ base.browser = {
825
+ "support3d" : support3d,
826
+ "isTouch" : isTouch
827
+ };
828
+ },
829
+
830
+ moveEvents : function () {
831
+ var base = this;
832
+ if (base.options.mouseDrag !== false || base.options.touchDrag !== false) {
833
+ base.gestures();
834
+ base.disabledEvents();
835
+ }
836
+ },
837
+
838
+ eventTypes : function () {
839
+ var base = this,
840
+ types = ["s", "e", "x"];
841
+
842
+ base.ev_types = {};
843
+
844
+ if (base.options.mouseDrag === true && base.options.touchDrag === true) {
845
+ types = [
846
+ "touchstart.owl mousedown.owl",
847
+ "touchmove.owl mousemove.owl",
848
+ "touchend.owl touchcancel.owl mouseup.owl"
849
+ ];
850
+ } else if (base.options.mouseDrag === false && base.options.touchDrag === true) {
851
+ types = [
852
+ "touchstart.owl",
853
+ "touchmove.owl",
854
+ "touchend.owl touchcancel.owl"
855
+ ];
856
+ } else if (base.options.mouseDrag === true && base.options.touchDrag === false) {
857
+ types = [
858
+ "mousedown.owl",
859
+ "mousemove.owl",
860
+ "mouseup.owl"
861
+ ];
862
+ }
863
+
864
+ base.ev_types.start = types[0];
865
+ base.ev_types.move = types[1];
866
+ base.ev_types.end = types[2];
867
+ },
868
+
869
+ disabledEvents : function () {
870
+ var base = this;
871
+ base.$elem.on("dragstart.owl", function (event) { event.preventDefault(); });
872
+ base.$elem.on("mousedown.disableTextSelect", function (e) {
873
+ return $(e.target).is('input, textarea, select, option');
874
+ });
875
+ },
876
+
877
+ gestures : function () {
878
+ /*jslint unparam: true*/
879
+ var base = this,
880
+ locals = {
881
+ offsetX : 0,
882
+ offsetY : 0,
883
+ baseElWidth : 0,
884
+ relativePos : 0,
885
+ position: null,
886
+ minSwipe : null,
887
+ maxSwipe: null,
888
+ sliding : null,
889
+ dargging: null,
890
+ targetElement : null
891
+ };
892
+
893
+ base.isCssFinish = true;
894
+
895
+ function getTouches(event) {
896
+ if (event.touches !== undefined) {
897
+ return {
898
+ x : event.touches[0].pageX,
899
+ y : event.touches[0].pageY
900
+ };
901
+ }
902
+
903
+ if (event.touches === undefined) {
904
+ if (event.pageX !== undefined) {
905
+ return {
906
+ x : event.pageX,
907
+ y : event.pageY
908
+ };
909
+ }
910
+ if (event.pageX === undefined) {
911
+ return {
912
+ x : event.clientX,
913
+ y : event.clientY
914
+ };
915
+ }
916
+ }
917
+ }
918
+
919
+ function swapEvents(type) {
920
+ if (type === "on") {
921
+ $(document).on(base.ev_types.move, dragMove);
922
+ $(document).on(base.ev_types.end, dragEnd);
923
+ } else if (type === "off") {
924
+ $(document).off(base.ev_types.move);
925
+ $(document).off(base.ev_types.end);
926
+ }
927
+ }
928
+
929
+ function dragStart(event) {
930
+ var ev = event.originalEvent || event || window.event,
931
+ position;
932
+
933
+ if (ev.which === 3) {
934
+ return false;
935
+ }
936
+ if (base.itemsAmount <= base.options.items) {
937
+ return;
938
+ }
939
+ if (base.isCssFinish === false && !base.options.dragBeforeAnimFinish) {
940
+ return false;
941
+ }
942
+ if (base.isCss3Finish === false && !base.options.dragBeforeAnimFinish) {
943
+ return false;
944
+ }
945
+
946
+ if (base.options.autoPlay !== false) {
947
+ window.clearInterval(base.autoPlayInterval);
948
+ }
949
+
950
+ if (base.browser.isTouch !== true && !base.$owlWrapper.hasClass("grabbing")) {
951
+ base.$owlWrapper.addClass("grabbing");
952
+ }
953
+
954
+ base.newPosX = 0;
955
+ base.newRelativeX = 0;
956
+
957
+ $(this).css(base.removeTransition());
958
+
959
+ position = $(this).position();
960
+ locals.relativePos = position.left;
961
+
962
+ locals.offsetX = getTouches(ev).x - position.left;
963
+ locals.offsetY = getTouches(ev).y - position.top;
964
+
965
+ swapEvents("on");
966
+
967
+ locals.sliding = false;
968
+ locals.targetElement = ev.target || ev.srcElement;
969
+ }
970
+
971
+ function dragMove(event) {
972
+ var ev = event.originalEvent || event || window.event,
973
+ minSwipe,
974
+ maxSwipe;
975
+
976
+ base.newPosX = getTouches(ev).x - locals.offsetX;
977
+ base.newPosY = getTouches(ev).y - locals.offsetY;
978
+ base.newRelativeX = base.newPosX - locals.relativePos;
979
+
980
+ if (typeof base.options.startDragging === "function" && locals.dragging !== true && base.newRelativeX !== 0) {
981
+ locals.dragging = true;
982
+ base.options.startDragging.apply(base, [base.$elem]);
983
+ }
984
+
985
+ if ((base.newRelativeX > 8 || base.newRelativeX < -8) && (base.browser.isTouch === true)) {
986
+ if (ev.preventDefault !== undefined) {
987
+ ev.preventDefault();
988
+ } else {
989
+ ev.returnValue = false;
990
+ }
991
+ locals.sliding = true;
992
+ }
993
+
994
+ if ((base.newPosY > 10 || base.newPosY < -10) && locals.sliding === false) {
995
+ $(document).off("touchmove.owl");
996
+ }
997
+
998
+ minSwipe = function () {
999
+ return base.newRelativeX / 5;
1000
+ };
1001
+
1002
+ maxSwipe = function () {
1003
+ return base.maximumPixels + base.newRelativeX / 5;
1004
+ };
1005
+
1006
+ base.newPosX = Math.max(Math.min(base.newPosX, minSwipe()), maxSwipe());
1007
+ if (base.browser.support3d === true) {
1008
+ base.transition3d(base.newPosX);
1009
+ } else {
1010
+ base.css2move(base.newPosX);
1011
+ }
1012
+ }
1013
+
1014
+ function dragEnd(event) {
1015
+ var ev = event.originalEvent || event || window.event,
1016
+ newPosition,
1017
+ handlers,
1018
+ owlStopEvent;
1019
+
1020
+ ev.target = ev.target || ev.srcElement;
1021
+
1022
+ locals.dragging = false;
1023
+
1024
+ if (base.browser.isTouch !== true) {
1025
+ base.$owlWrapper.removeClass("grabbing");
1026
+ }
1027
+
1028
+ if (base.newRelativeX < 0) {
1029
+ base.dragDirection = base.owl.dragDirection = "left";
1030
+ } else {
1031
+ base.dragDirection = base.owl.dragDirection = "right";
1032
+ }
1033
+
1034
+ if (base.newRelativeX !== 0) {
1035
+ newPosition = base.getNewPosition();
1036
+ base.goTo(newPosition, false, "drag");
1037
+ if (locals.targetElement === ev.target && base.browser.isTouch !== true) {
1038
+ $(ev.target).on("click.disable", function (ev) {
1039
+ ev.stopImmediatePropagation();
1040
+ ev.stopPropagation();
1041
+ ev.preventDefault();
1042
+ $(ev.target).off("click.disable");
1043
+ });
1044
+ handlers = $._data(ev.target, "events").click;
1045
+ owlStopEvent = handlers.pop();
1046
+ handlers.splice(0, 0, owlStopEvent);
1047
+ }
1048
+ }
1049
+ swapEvents("off");
1050
+ }
1051
+ base.$elem.on(base.ev_types.start, ".owl-wrapper", dragStart);
1052
+ },
1053
+
1054
+ getNewPosition : function () {
1055
+ var base = this,
1056
+ newPosition = base.closestItem();
1057
+
1058
+ if (newPosition > base.maximumItem) {
1059
+ base.currentItem = base.maximumItem;
1060
+ newPosition = base.maximumItem;
1061
+ } else if (base.newPosX >= 0) {
1062
+ newPosition = 0;
1063
+ base.currentItem = 0;
1064
+ }
1065
+ return newPosition;
1066
+ },
1067
+ closestItem : function () {
1068
+ var base = this,
1069
+ array = base.options.scrollPerPage === true ? base.pagesInArray : base.positionsInArray,
1070
+ goal = base.newPosX,
1071
+ closest = null;
1072
+
1073
+ $.each(array, function (i, v) {
1074
+ if (goal - (base.itemWidth / 20) > array[i + 1] && goal - (base.itemWidth / 20) < v && base.moveDirection() === "left") {
1075
+ closest = v;
1076
+ if (base.options.scrollPerPage === true) {
1077
+ base.currentItem = $.inArray(closest, base.positionsInArray);
1078
+ } else {
1079
+ base.currentItem = i;
1080
+ }
1081
+ } else if (goal + (base.itemWidth / 20) < v && goal + (base.itemWidth / 20) > (array[i + 1] || array[i] - base.itemWidth) && base.moveDirection() === "right") {
1082
+ if (base.options.scrollPerPage === true) {
1083
+ closest = array[i + 1] || array[array.length - 1];
1084
+ base.currentItem = $.inArray(closest, base.positionsInArray);
1085
+ } else {
1086
+ closest = array[i + 1];
1087
+ base.currentItem = i + 1;
1088
+ }
1089
+ }
1090
+ });
1091
+ return base.currentItem;
1092
+ },
1093
+
1094
+ moveDirection : function () {
1095
+ var base = this,
1096
+ direction;
1097
+ if (base.newRelativeX < 0) {
1098
+ direction = "right";
1099
+ base.playDirection = "next";
1100
+ } else {
1101
+ direction = "left";
1102
+ base.playDirection = "prev";
1103
+ }
1104
+ return direction;
1105
+ },
1106
+
1107
+ customEvents : function () {
1108
+ /*jslint unparam: true*/
1109
+ var base = this;
1110
+ base.$elem.on("owl.next", function () {
1111
+ base.next();
1112
+ });
1113
+ base.$elem.on("owl.prev", function () {
1114
+ base.prev();
1115
+ });
1116
+ base.$elem.on("owl.play", function (event, speed) {
1117
+ base.options.autoPlay = speed;
1118
+ base.play();
1119
+ base.hoverStatus = "play";
1120
+ });
1121
+ base.$elem.on("owl.stop", function () {
1122
+ base.stop();
1123
+ base.hoverStatus = "stop";
1124
+ });
1125
+ base.$elem.on("owl.goTo", function (event, item) {
1126
+ base.goTo(item);
1127
+ });
1128
+ base.$elem.on("owl.jumpTo", function (event, item) {
1129
+ base.jumpTo(item);
1130
+ });
1131
+ },
1132
+
1133
+ stopOnHover : function () {
1134
+ var base = this;
1135
+ if (base.options.stopOnHover === true && base.browser.isTouch !== true && base.options.autoPlay !== false) {
1136
+ base.$elem.on("mouseover", function () {
1137
+ base.stop();
1138
+ });
1139
+ base.$elem.on("mouseout", function () {
1140
+ if (base.hoverStatus !== "stop") {
1141
+ base.play();
1142
+ }
1143
+ });
1144
+ }
1145
+ },
1146
+
1147
+ lazyLoad : function () {
1148
+ var base = this,
1149
+ i,
1150
+ $item,
1151
+ itemNumber,
1152
+ $lazyImg,
1153
+ follow;
1154
+
1155
+ if (base.options.lazyLoad === false) {
1156
+ return false;
1157
+ }
1158
+ for (i = 0; i < base.itemsAmount; i += 1) {
1159
+ $item = $(base.$owlItems[i]);
1160
+
1161
+ if ($item.data("owl-loaded") === "loaded") {
1162
+ continue;
1163
+ }
1164
+
1165
+ itemNumber = $item.data("owl-item");
1166
+ $lazyImg = $item.find(".lazyOwl");
1167
+
1168
+ if (typeof $lazyImg.data("src") !== "string") {
1169
+ $item.data("owl-loaded", "loaded");
1170
+ continue;
1171
+ }
1172
+ if ($item.data("owl-loaded") === undefined) {
1173
+ $lazyImg.hide();
1174
+ $item.addClass("loading").data("owl-loaded", "checked");
1175
+ }
1176
+ if (base.options.lazyFollow === true) {
1177
+ follow = itemNumber >= base.currentItem;
1178
+ } else {
1179
+ follow = true;
1180
+ }
1181
+ if (follow && itemNumber < base.currentItem + base.options.items && $lazyImg.length) {
1182
+ base.lazyPreload($item, $lazyImg);
1183
+ }
1184
+ }
1185
+ },
1186
+
1187
+ lazyPreload : function ($item, $lazyImg) {
1188
+ var base = this,
1189
+ iterations = 0,
1190
+ isBackgroundImg;
1191
+
1192
+ if ($lazyImg.prop("tagName") === "DIV") {
1193
+ $lazyImg.css("background-image", "url(" + $lazyImg.data("src") + ")");
1194
+ isBackgroundImg = true;
1195
+ } else {
1196
+ $lazyImg[0].src = $lazyImg.data("src");
1197
+ }
1198
+
1199
+ function showImage() {
1200
+ $item.data("owl-loaded", "loaded").removeClass("loading");
1201
+ $lazyImg.removeAttr("data-src");
1202
+ if (base.options.lazyEffect === "fade") {
1203
+ $lazyImg.fadeIn(400);
1204
+ } else {
1205
+ $lazyImg.show();
1206
+ }
1207
+ if (typeof base.options.afterLazyLoad === "function") {
1208
+ base.options.afterLazyLoad.apply(this, [base.$elem]);
1209
+ }
1210
+ }
1211
+
1212
+ function checkLazyImage() {
1213
+ iterations += 1;
1214
+ if (base.completeImg($lazyImg.get(0)) || isBackgroundImg === true) {
1215
+ showImage();
1216
+ } else if (iterations <= 100) {//if image loads in less than 10 seconds
1217
+ window.setTimeout(checkLazyImage, 100);
1218
+ } else {
1219
+ showImage();
1220
+ }
1221
+ }
1222
+
1223
+ checkLazyImage();
1224
+ },
1225
+
1226
+ autoHeight : function () {
1227
+ var base = this,
1228
+ $currentimg = $(base.$owlItems[base.currentItem]).find("img"),
1229
+ iterations;
1230
+
1231
+ function addHeight() {
1232
+ var $currentItem = $(base.$owlItems[base.currentItem]).height();
1233
+ base.wrapperOuter.css("height", $currentItem + "px");
1234
+ if (!base.wrapperOuter.hasClass("autoHeight")) {
1235
+ window.setTimeout(function () {
1236
+ base.wrapperOuter.addClass("autoHeight");
1237
+ }, 0);
1238
+ }
1239
+ }
1240
+
1241
+ function checkImage() {
1242
+ iterations += 1;
1243
+ if (base.completeImg($currentimg.get(0))) {
1244
+ addHeight();
1245
+ } else if (iterations <= 100) { //if image loads in less than 10 seconds
1246
+ window.setTimeout(checkImage, 100);
1247
+ } else {
1248
+ base.wrapperOuter.css("height", ""); //Else remove height attribute
1249
+ }
1250
+ }
1251
+
1252
+ if ($currentimg.get(0) !== undefined) {
1253
+ iterations = 0;
1254
+ checkImage();
1255
+ } else {
1256
+ addHeight();
1257
+ }
1258
+ },
1259
+
1260
+ completeImg : function (img) {
1261
+ var naturalWidthType;
1262
+
1263
+ if (!img.complete) {
1264
+ return false;
1265
+ }
1266
+ naturalWidthType = typeof img.naturalWidth;
1267
+ if (naturalWidthType !== "undefined" && img.naturalWidth === 0) {
1268
+ return false;
1269
+ }
1270
+ return true;
1271
+ },
1272
+
1273
+ onVisibleItems : function () {
1274
+ var base = this,
1275
+ i;
1276
+
1277
+ if (base.options.addClassActive === true) {
1278
+ base.$owlItems.removeClass("active");
1279
+ }
1280
+ base.visibleItems = [];
1281
+ for (i = base.currentItem; i < base.currentItem + base.options.items; i += 1) {
1282
+ base.visibleItems.push(i);
1283
+
1284
+ if (base.options.addClassActive === true) {
1285
+ $(base.$owlItems[i]).addClass("active");
1286
+ }
1287
+ }
1288
+ base.owl.visibleItems = base.visibleItems;
1289
+ },
1290
+
1291
+ transitionTypes : function (className) {
1292
+ var base = this;
1293
+ //Currently available: "fade", "backSlide", "goDown", "fadeUp"
1294
+ base.outClass = "owl-" + className + "-out";
1295
+ base.inClass = "owl-" + className + "-in";
1296
+ },
1297
+
1298
+ singleItemTransition : function () {
1299
+ var base = this,
1300
+ outClass = base.outClass,
1301
+ inClass = base.inClass,
1302
+ $currentItem = base.$owlItems.eq(base.currentItem),
1303
+ $prevItem = base.$owlItems.eq(base.prevItem),
1304
+ prevPos = Math.abs(base.positionsInArray[base.currentItem]) + base.positionsInArray[base.prevItem],
1305
+ origin = Math.abs(base.positionsInArray[base.currentItem]) + base.itemWidth / 2,
1306
+ animEnd = 'webkitAnimationEnd oAnimationEnd MSAnimationEnd animationend';
1307
+
1308
+ base.isTransition = true;
1309
+
1310
+ base.$owlWrapper
1311
+ .addClass('owl-origin')
1312
+ .css({
1313
+ "-webkit-transform-origin" : origin + "px",
1314
+ "-moz-perspective-origin" : origin + "px",
1315
+ "perspective-origin" : origin + "px"
1316
+ });
1317
+ function transStyles(prevPos) {
1318
+ return {
1319
+ "position" : "relative",
1320
+ "left" : prevPos + "px"
1321
+ };
1322
+ }
1323
+
1324
+ $prevItem
1325
+ .css(transStyles(prevPos, 10))
1326
+ .addClass(outClass)
1327
+ .on(animEnd, function () {
1328
+ base.endPrev = true;
1329
+ $prevItem.off(animEnd);
1330
+ base.clearTransStyle($prevItem, outClass);
1331
+ });
1332
+
1333
+ $currentItem
1334
+ .addClass(inClass)
1335
+ .on(animEnd, function () {
1336
+ base.endCurrent = true;
1337
+ $currentItem.off(animEnd);
1338
+ base.clearTransStyle($currentItem, inClass);
1339
+ });
1340
+ },
1341
+
1342
+ clearTransStyle : function (item, classToRemove) {
1343
+ var base = this;
1344
+ item.css({
1345
+ "position" : "",
1346
+ "left" : ""
1347
+ }).removeClass(classToRemove);
1348
+
1349
+ if (base.endPrev && base.endCurrent) {
1350
+ base.$owlWrapper.removeClass('owl-origin');
1351
+ base.endPrev = false;
1352
+ base.endCurrent = false;
1353
+ base.isTransition = false;
1354
+ }
1355
+ },
1356
+
1357
+ owlStatus : function () {
1358
+ var base = this;
1359
+ base.owl = {
1360
+ "userOptions" : base.userOptions,
1361
+ "baseElement" : base.$elem,
1362
+ "userItems" : base.$userItems,
1363
+ "owlItems" : base.$owlItems,
1364
+ "currentItem" : base.currentItem,
1365
+ "prevItem" : base.prevItem,
1366
+ "visibleItems" : base.visibleItems,
1367
+ "isTouch" : base.browser.isTouch,
1368
+ "browser" : base.browser,
1369
+ "dragDirection" : base.dragDirection
1370
+ };
1371
+ },
1372
+
1373
+ clearEvents : function () {
1374
+ var base = this;
1375
+ base.$elem.off(".owl owl mousedown.disableTextSelect");
1376
+ $(document).off(".owl owl");
1377
+ $(window).off("resize", base.resizer);
1378
+ },
1379
+
1380
+ unWrap : function () {
1381
+ var base = this;
1382
+ if (base.$elem.children().length !== 0) {
1383
+ base.$owlWrapper.unwrap();
1384
+ base.$userItems.unwrap().unwrap();
1385
+ if (base.owlControls) {
1386
+ base.owlControls.remove();
1387
+ }
1388
+ }
1389
+ base.clearEvents();
1390
+ base.$elem
1391
+ .attr("style", base.$elem.data("owl-originalStyles") || "")
1392
+ .attr("class", base.$elem.data("owl-originalClasses"));
1393
+ },
1394
+
1395
+ destroy : function () {
1396
+ var base = this;
1397
+ base.stop();
1398
+ window.clearInterval(base.checkVisible);
1399
+ base.unWrap();
1400
+ base.$elem.removeData();
1401
+ },
1402
+
1403
+ reinit : function (newOptions) {
1404
+ var base = this,
1405
+ options = $.extend({}, base.userOptions, newOptions);
1406
+ base.unWrap();
1407
+ base.init(options, base.$elem);
1408
+ },
1409
+
1410
+ addItem : function (htmlString, targetPosition) {
1411
+ var base = this,
1412
+ position;
1413
+
1414
+ if (!htmlString) {return false; }
1415
+
1416
+ if (base.$elem.children().length === 0) {
1417
+ base.$elem.append(htmlString);
1418
+ base.setVars();
1419
+ return false;
1420
+ }
1421
+ base.unWrap();
1422
+ if (targetPosition === undefined || targetPosition === -1) {
1423
+ position = -1;
1424
+ } else {
1425
+ position = targetPosition;
1426
+ }
1427
+ if (position >= base.$userItems.length || position === -1) {
1428
+ base.$userItems.eq(-1).after(htmlString);
1429
+ } else {
1430
+ base.$userItems.eq(position).before(htmlString);
1431
+ }
1432
+
1433
+ base.setVars();
1434
+ },
1435
+
1436
+ removeItem : function (targetPosition) {
1437
+ var base = this,
1438
+ position;
1439
+
1440
+ if (base.$elem.children().length === 0) {
1441
+ return false;
1442
+ }
1443
+ if (targetPosition === undefined || targetPosition === -1) {
1444
+ position = -1;
1445
+ } else {
1446
+ position = targetPosition;
1447
+ }
1448
+
1449
+ base.unWrap();
1450
+ base.$userItems.eq(position).remove();
1451
+ base.setVars();
1452
+ }
1453
+
1454
+ };
1455
+
1456
+ $.fn.owlCarousel = function (options) {
1457
+ return this.each(function () {
1458
+ if ($(this).data("owl-init") === true) {
1459
+ return false;
1460
+ }
1461
+ $(this).data("owl-init", true);
1462
+ var carousel = Object.create(Carousel);
1463
+ carousel.init(options, this);
1464
+ $.data(this, "owlCarousel", carousel);
1465
+ });
1466
+ };
1467
+
1468
+ $.fn.owlCarousel.options = {
1469
+
1470
+ items : 5,
1471
+ itemsCustom : false,
1472
+ itemsDesktop : [1199, 4],
1473
+ itemsDesktopSmall : [979, 3],
1474
+ itemsTablet : [768, 2],
1475
+ itemsTabletSmall : false,
1476
+ itemsMobile : [479, 1],
1477
+ singleItem : false,
1478
+ itemsScaleUp : false,
1479
+
1480
+ slideSpeed : 200,
1481
+ paginationSpeed : 800,
1482
+ rewindSpeed : 1000,
1483
+
1484
+ autoPlay : false,
1485
+ stopOnHover : false,
1486
+
1487
+ navigation : false,
1488
+ navigationText : ["prev", "next"],
1489
+ rewindNav : true,
1490
+ scrollPerPage : false,
1491
+
1492
+ pagination : true,
1493
+ paginationNumbers : false,
1494
+
1495
+ responsive : true,
1496
+ responsiveRefreshRate : 200,
1497
+ responsiveBaseWidth : window,
1498
+
1499
+ baseClass : "owl-carousel",
1500
+ theme : "owl-theme",
1501
+
1502
+ lazyLoad : false,
1503
+ lazyFollow : true,
1504
+ lazyEffect : "fade",
1505
+
1506
+ autoHeight : false,
1507
+
1508
+ jsonPath : false,
1509
+ jsonSuccess : false,
1510
+
1511
+ dragBeforeAnimFinish : true,
1512
+ mouseDrag : true,
1513
+ touchDrag : true,
1514
+
1515
+ addClassActive : false,
1516
+ transitionStyle : false,
1517
+
1518
+ beforeUpdate : false,
1519
+ afterUpdate : false,
1520
+ beforeInit : false,
1521
+ afterInit : false,
1522
+ beforeMove : false,
1523
+ afterMove : false,
1524
+ afterAction : false,
1525
+ startDragging : false,
1526
+ afterLazyLoad: false
1527
+ };
1528
+ }(jQuery, window, document));
1529
+ (function($){
1530
+
1531
+ $(document).ready(function (){
1532
+ dropdownNav.handleEvents();
1533
+ });
1534
+
1535
+ var dropdownNav = {
1536
+
1537
+ handleEvents : function(){
1538
+ $('.iasd-dropdown-navigation .dropdown-menu').on('click', dropdownNav.preventClosing);
1539
+ $('.iasd-dropdown-navigation .dropdown-toggle').on('click', dropdownNav.openMenu);
1540
+ $('.iasd-dropdown-navigation .dropdown-menu > ul > li:not(.dsa-link) > a').bind('click', dropdownNav.openSubmenu);
1541
+ $('.iasd-dropdown-navigation .back > a').bind('click', dropdownNav.closeSubmenu);
1542
+ },
1543
+
1544
+ preventClosing : function(e) {
1545
+ e.stopPropagation();
1546
+ },
1547
+
1548
+ openMenu : function(){
1549
+ var jqThis = $('.iasd-dropdown-navigation .dropdown-menu > ul > li').find('ul.active');
1550
+ if (jqThis.size()){
1551
+ setTimeout(function(){
1552
+ $('.iasd-dropdown-navigation .dropdown-menu').css('height', jqThis.height()+15); //15px from padding
1553
+ }, 15);
1554
+ }
1555
+ },
1556
+
1557
+ openSubmenu : function(e) {
1558
+ var jqThis = $(this);
1559
+ var submenuTarget = jqThis.closest('li').find('ul');
1560
+ submenuTarget.toggleClass('active');
1561
+ $('.iasd-dropdown-navigation .dropdown-menu').css('height', submenuTarget.height()+15); //15px from padding
1562
+ e.preventDefault();
1563
+ },
1564
+
1565
+ closeSubmenu : function(e) {
1566
+ var $this = $(this);
1567
+ var submenuTarget = $this.closest('ul');
1568
+ $('.iasd-dropdown-navigation .dropdown-menu').css('height', '');
1569
+ submenuTarget.removeClass('active');
1570
+ e.preventDefault();
1571
+ }
1572
+
1573
+ };
1574
+
1575
+ })(jQuery);
1576
+ (function($){
1577
+
1578
+ $(document).ready(function (){
1579
+ footer.handleEvents();
1580
+ });
1581
+
1582
+ var footer = {
1583
+
1584
+ handleEvents : function(){
1585
+ $('body > footer .back-top').on('click', footer.backTop);
1586
+ },
1587
+
1588
+ backTop : function(e){
1589
+ $('body,html').animate({
1590
+ scrollTop: 0
1591
+ }, 500, 'swing');
1592
+ e.preventDefault();
1593
+ }
1594
+ };
1595
+
1596
+ })(jQuery);
1597
+ if (!window.matchMedia){ window.matchMedia = function(){ return { matches:false }; }; }
1598
+
1599
+ (function($){
1600
+
1601
+ $(document).ready(function (){
1602
+ globalNav.handleEvents();
1603
+ });
1604
+
1605
+
1606
+ var isSmallDevice = window.matchMedia("(max-width: 767px)").matches; //Changes functionality on small devices
1607
+
1608
+ var globalNav = {
1609
+
1610
+ handleEvents : function(){
1611
+ $('.iasd-global_navbar .more-panel a').on('click', globalNav.changeActiveTab);
1612
+ $('.iasd-global_navbar .more a').on('click', globalNav.toggleMorePanel);
1613
+ $('.iasd-global_navbar .navbar-header button').on('click', globalNav.toggleResponsiveMenu);
1614
+ $('.iasd-global_navbar .headquarters > li > a').on('click', globalNav.toggleSubmenu);
1615
+ $('.iasd-global_navbar .headquarters > li > a').on('mouseover', globalNav.changeMap);
1616
+ $('.iasd-global_navbar .headquarters > li > a').on('mouseout', globalNav.cleanMap);
1617
+ $('.iasd-global_navbar .search-link').on('click', globalNav.toggleSearchBox);
1618
+ },
1619
+
1620
+ changeActiveTab : function(e) {
1621
+ var jqThis = $(this);
1622
+ if (isSmallDevice) {
1623
+ jqThis.parent().toggleClass('active').find('> ul').toggleClass('open');
1624
+ } else {
1625
+ jqThis.tab('show');
1626
+ }
1627
+ e.preventDefault();
1628
+ },
1629
+
1630
+ toggleMorePanel : function(e) {
1631
+ var jqThis = $(this);
1632
+ $('.iasd-global_navbar .search-link').removeClass('active');
1633
+ $('.iasd-global_navbar .iasd-global_navbar-search').removeClass('open');
1634
+ jqThis.parent().toggleClass('active');
1635
+ $('.iasd-global_navbar .iasd-global_navbar-more').toggleClass('open');
1636
+ $('.iasd-global_navbar .more-panel a:first').trigger( "click" );
1637
+ e.preventDefault();
1638
+ },
1639
+
1640
+ toggleResponsiveMenu : function(){
1641
+ $('.iasd-global_navbar .search-link').removeClass('active');
1642
+ $('.iasd-global_navbar .iasd-global_navbar-search').removeClass('open');
1643
+ $('.iasd-global_navbar .navbar-collapse').toggleClass('collapse').toggleClass('in');
1644
+ $('.iasd-global_navbar .iasd-global_navbar-more').toggleClass('open');
1645
+ $('.iasd-global_navbar .more-panel a').each(function(){
1646
+ var jqThis = $(this);
1647
+ var selector = jqThis.attr('href');
1648
+ if (isSmallDevice) {
1649
+ $(selector).children('ul').insertAfter(jqThis);
1650
+ }
1651
+ });
1652
+ },
1653
+
1654
+ toggleSubmenu : function(e){
1655
+ var jqThis = $(this);
1656
+ if (isSmallDevice) {
1657
+ jqThis.parent().toggleClass('active').find('ul').toggleClass('open');
1658
+ } else {
1659
+ jqThis.parent().parent().find('ul').removeClass('open');
1660
+ jqThis.parent().find('> ul').addClass('open');
1661
+ jqThis.parent().parent().find('li').removeClass('active');
1662
+ jqThis.parent().addClass('active');
1663
+ $('.tutorial').remove();
1664
+ }
1665
+ e.preventDefault();
1666
+ },
1667
+
1668
+ toggleSearchBox : function(e){
1669
+ var jqThis = $(this);
1670
+ $('.iasd-global_navbar .navbar-collapse').addClass('collapse').removeClass('in');
1671
+ $('.iasd-global_navbar .more a').parent().removeClass('active');
1672
+ $('.iasd-global_navbar .iasd-global_navbar-more').removeClass('open');
1673
+ jqThis.toggleClass('active');
1674
+ $('.iasd-global_navbar .iasd-global_navbar-search').toggleClass('open');
1675
+ e.preventDefault();
1676
+ },
1677
+
1678
+ changeMap : function(){
1679
+ var jqThis = $(this).attr('data-region');
1680
+ $('.headquarters-map').attr('class', 'headquarters-map visible-md visible-lg');
1681
+ $('.headquarters-map').addClass('map-region_'+jqThis);
1682
+ },
1683
+
1684
+ cleanMap : function(){
1685
+ var jqThis = $(this);
1686
+ var defaultRegion = "01";
1687
+ var newDefaultRegion = $('.iasd-global_navbar .headquarters > li.active > a').attr('data-region');
1688
+ if(!newDefaultRegion){
1689
+ $('.headquarters-map').attr('class', 'headquarters-map visible-md visible-lg map-region_'+defaultRegion);
1690
+ } else{
1691
+ $('.headquarters-map').attr('class', 'headquarters-map visible-md visible-lg map-region_'+newDefaultRegion);
1692
+ }
1693
+ }
1694
+
1695
+ };
1696
+
1697
+ })(jQuery);
1698
+ if (!window.matchMedia){ window.matchMedia = function(){ return { matches:false }; }; }
1699
+ (function($){
1700
+
1701
+ $(document).ready(function (){
1702
+ mainNav.handleEvents();
1703
+ mainNav.duplicateTouchLink();
1704
+ });
1705
+
1706
+ var isSmallDevice = window.matchMedia("(max-width: 767px)").matches; //Changes functionality on small devices
1707
+
1708
+ var mainNav = {
1709
+
1710
+ handleEvents : function(){
1711
+ $('.iasd-main_navbar .navbar-nav li > a').on('click', mainNav.preventDefaultTouchBehavior); // Fix events for large touch devices
1712
+ $('.iasd-main_navbar .navbar-toggle').on('click', mainNav.toggleResponsiveMenu);
1713
+ },
1714
+
1715
+ preventDefaultTouchBehavior : function(e) {
1716
+ var jqThis = $(this).parent();
1717
+ if (!isSmallDevice) {
1718
+ jqThis.siblings().removeClass('open');
1719
+ }
1720
+
1721
+ jqThis.toggleClass('open');
1722
+
1723
+ if(jqThis.find('ul').length > 0 && (isSmallDevice || $('html').hasClass('touch')) ){
1724
+ e.preventDefault();
1725
+ }
1726
+ var aThis = jqThis.find('>:first-child');
1727
+ if(aThis)
1728
+ if(aThis.attr('href') == '#')
1729
+ e.preventDefault();
1730
+ },
1731
+
1732
+ duplicateTouchLink : function() {
1733
+ if(isSmallDevice || $('html').hasClass('touch')){
1734
+ $('.iasd-main_navbar .navbar-nav li.has-children').each(function(){
1735
+ var jqThis = $(this);
1736
+ var elementURL = jqThis.find('> a').attr('href');
1737
+ var elementContent = jqThis.find('> a').html();
1738
+ if(elementURL!='#'){
1739
+ jqThis.find('> ul').prepend('<li><a href="'+ elementURL +'" title="'+elementContent+'">'+elementContent+'</a></li>'); //TODO Usar jquery templates
1740
+ }
1741
+ });
1742
+ }
1743
+ },
1744
+
1745
+ toggleResponsiveMenu : function(){
1746
+ $('.iasd-main_navbar .navbar-collapse').toggleClass('collapse').toggleClass('in');
1747
+ }
1748
+
1749
+ };
1750
+
1751
+ })(jQuery);
1752
+
1753
+ (function($){
1754
+
1755
+ $(document).ready(function (){
1756
+ iasdCloseModal.closeModal();
1757
+ iasdFilterToggleActive.handleEvents();
1758
+ iasdLoadMorePosts.handleEvents();
1759
+ iasdReturnPageNav.handleEvents();
1760
+ });
1761
+
1762
+ $(window).load(function() {
1763
+ iasdReturnPageNav.autoCollapse();
1764
+ });
1765
+
1766
+ /* ------------------------------------------ */
1767
+
1768
+ var iasdCloseModal = {
1769
+ closeModal : function(e){
1770
+ $('.modal').each(function(){
1771
+ var src = $(this).find('iframe').attr('src');
1772
+ $(this).on('click', function(){
1773
+ $(this).find('iframe').attr('src', '');
1774
+ $(this).find('iframe').attr('src', src);
1775
+ });
1776
+ });
1777
+ }
1778
+ };
1779
+
1780
+ var iasdFilterToggleActive = {
1781
+
1782
+ handleEvents : function(){
1783
+ $('.iasd-search-filters > a > h3').on('click', iasdFilterToggleActive.filterToggleActive);
1784
+ },
1785
+
1786
+ filterToggleActive : function(e){
1787
+ $(this).toggleClass('active');
1788
+ }
1789
+ };
1790
+
1791
+
1792
+
1793
+ var iasdReturnPageNav = {
1794
+
1795
+ handleEvents : function(){
1796
+ $('.iasd-plugin-return_page .toggle-visibility-link').on('click', iasdReturnPageNav.toggleVisibility);
1797
+ },
1798
+
1799
+ toggleVisibility : function(e){
1800
+ jqThis = $(this);
1801
+ jqThis.parent().toggleClass('collapsed');
1802
+ if(jqThis.parent().hasClass('collapsed')){
1803
+ jqThis.attr("title", "Clique para visualizar o link da página anterior");
1804
+ } else{
1805
+ jqThis.attr("title", "Clique para fechar este link");
1806
+ }
1807
+ e.preventDefault();
1808
+ },
1809
+
1810
+ autoCollapse : function(){
1811
+ var jqThis = $('.iasd-plugin-return_page')
1812
+ jqThis.removeClass('collapsed');
1813
+ jqThis.find('.toggle-visibility-link').attr("title", "Clique para fechar este link");
1814
+ setTimeout(function() {
1815
+ jqThis.addClass('collapsed');
1816
+ jqThis.find('.toggle-visibility-link').attr("title", "Clique para visualizar o link da página anterior");
1817
+ }, 5000);
1818
+ }
1819
+
1820
+ };
1821
+
1822
+ var iasdLoadMorePosts = {
1823
+
1824
+ handleEvents : function(){
1825
+ $('.load-more_posts-link').on('click', iasdLoadMorePosts.loadMorePosts);
1826
+ },
1827
+
1828
+ loadMorePosts : function(event) {
1829
+ var $button = jQuery(this);
1830
+
1831
+ if(!$button.hasClass('loading')) {
1832
+ $button.addClass('loading');
1833
+
1834
+ $.ajax({
1835
+ url : $button.attr('href'),
1836
+ context: $button,
1837
+ dataType: 'html'
1838
+ }).done(iasdLoadMorePosts.renderMorePosts).fail(iasdLoadMorePosts.renderMorePostsError);
1839
+
1840
+ }
1841
+ event.preventDefault();
1842
+ },
1843
+
1844
+ renderMorePosts : function(data, textStatus, jqXHR) {
1845
+ var $nextPage = jQuery(data);
1846
+ var $ajaxContainer = jQuery('.iasd-post-list-ajax');
1847
+ var $newAjaxContainer = $nextPage.find('.iasd-post-list-ajax');
1848
+ var nextPageHref = $nextPage.find('.load-more_posts-link').attr('href');
1849
+
1850
+ $newAjaxContainer.find('> .iasd-post-list-item-ajax').appendTo($ajaxContainer);
1851
+
1852
+ var currentPage = $newAjaxContainer.data('page');
1853
+ var maxPages = $ajaxContainer.data('pages');
1854
+ $ajaxContainer.data('page', currentPage);
1855
+
1856
+ var $button = jQuery(this);
1857
+ $button.removeClass('loading');
1858
+
1859
+ if(maxPages == currentPage)
1860
+ $button.hide();
1861
+
1862
+ jQuery('.load-more_posts-link').attr('href', nextPageHref);
1863
+ },
1864
+
1865
+ renderMorePostsError : function(){
1866
+ var $button = jQuery(this);
1867
+ $button.removeClass('loading');
1868
+ }
1869
+
1870
+ };
1871
+
1872
+ })(jQuery);
1873
+ (function($){
1874
+
1875
+ var owlCarousels = [];
1876
+ var widthCheckerInterval = false;
1877
+
1878
+ $(document).ready(function (){
1879
+ widgets.handleEvents();
1880
+ owlPlugin.initPostCarousel();
1881
+ owlPlugin.initServiceCarouselLarge();
1882
+ owlPlugin.initServiceCarouselSmall();
1883
+ owlPlugin.initGalleriesCarousel();
1884
+ owlPlugin.initColumnsCarousel();
1885
+ owlPlugin.initMagazineCarousel();
1886
+ owlPlugin.initNewsstandCarouselSmall();
1887
+ owlPlugin.initNewsstandCarouselLarge();
1888
+ owlPlugin.initInstitutionalCarousel();
1889
+ $('.iasd-images-gallery').IASDImageGallery();
1890
+
1891
+ if(owlCarousels.length > 0) {
1892
+ widthCheckerInterval = setInterval(function() { for (var i = owlCarousels.length - 1; i >= 0; i--) { owlCarousels[i].updateVars(); }; }, 2000);
1893
+ setTimeout(function() { clearInterval(widthCheckerInterval); }, 30000);
1894
+ }
1895
+ });
1896
+
1897
+ var widgets = {
1898
+
1899
+ handleEvents : function(){
1900
+ $('.toggle-config-link').on('click', widgets.toggleConfig);
1901
+ $('.custom-select > select').on('change', widgets.removeFocus);
1902
+ },
1903
+
1904
+ toggleConfig : function(e){
1905
+ jqThis = $(this);
1906
+ jqThis.parent().toggleClass('open');
1907
+ e.preventDefault();
1908
+ },
1909
+
1910
+ removeFocus : function(){
1911
+ jqThis = $(this);
1912
+ jqThis.blur();
1913
+ }
1914
+
1915
+ };
1916
+
1917
+ var owlPlugin = {
1918
+
1919
+ initPostCarousel : function(){
1920
+ var element = $(".iasd-widget-slider > .posts, .iasd-widget-slider > .header");
1921
+ if(element.length > 0) {
1922
+ owlCarousels.push(element.owlCarousel({
1923
+ navigation : false,
1924
+ slideSpeed : 500,
1925
+ paginationSpeed : 1000,
1926
+ singleItem: true,
1927
+ autoPlay: true,
1928
+ stopOnHover: true,
1929
+ lazyLoad : true
1930
+ }).data('owlCarousel'));
1931
+ }
1932
+ },
1933
+
1934
+ initServiceCarouselLarge : function(){
1935
+ var element = $(".iasd-widget-slider > .services.large");
1936
+ if(element.length > 0) {
1937
+ owlCarousels.push(element.owlCarousel({
1938
+ items : 5,
1939
+ itemsDesktop : [1200,5],
1940
+ itemsDesktopSmall : [991,5],
1941
+ itemsTablet : [768,3],
1942
+ itemsMobile: [479,2],
1943
+ slideSpeed : 500,
1944
+ paginationSpeed : 1000,
1945
+ autoPlay: false,
1946
+ stopOnHover: true
1947
+ }).data('owlCarousel'));
1948
+ }
1949
+ },
1950
+
1951
+ initServiceCarouselSmall : function(){
1952
+ var element = $(".iasd-widget-slider > .services.small");
1953
+ if(element.length > 0) {
1954
+ owlCarousels.push(element.owlCarousel({
1955
+ items : 2,
1956
+ itemsDesktop : [1200,2],
1957
+ itemsDesktopSmall : [991,2],
1958
+ itemsTablet : [768,5],
1959
+ itemsMobile: [479,2],
1960
+ navigation : false,
1961
+ slideSpeed : 500,
1962
+ paginationSpeed : 1000,
1963
+ autoPlay: false,
1964
+ stopOnHover: true
1965
+ }).data('owlCarousel'));
1966
+ }
1967
+ },
1968
+
1969
+ initGalleriesCarousel : function(){
1970
+ var element = $(".iasd-widget-slider > .galleries");
1971
+ if(element.length > 0) {
1972
+ owlCarousels.push(element.owlCarousel({
1973
+ navigation : true,
1974
+ slideSpeed : 500,
1975
+ pagination : false,
1976
+ singleItem: true,
1977
+ autoPlay: false,
1978
+ stopOnHover: true,
1979
+ navigationText: false,
1980
+ mouseDrag: false,
1981
+ touchDrag: false,
1982
+ transitionStyle : "fade",
1983
+ lazyLoad : true
1984
+ }).data('owlCarousel'));
1985
+ }
1986
+ },
1987
+
1988
+ initColumnsCarousel : function(){
1989
+ var element = $(".iasd-widget-slider .columns > div");
1990
+ if(element.length > 0) {
1991
+ owlCarousels.push(element.owlCarousel({
1992
+ items: 5,
1993
+ itemsDesktop : [1200,4],
1994
+ itemsDesktopSmall : [992,4],
1995
+ itemsTablet : [768,2],
1996
+ itemsMobile: [480,1],
1997
+ navigation : false,
1998
+ slideSpeed : 500,
1999
+ paginationSpeed : 1000,
2000
+ autoPlay: false,
2001
+ stopOnHover: true
2002
+ }).data('owlCarousel'));
2003
+ }
2004
+ },
2005
+
2006
+ initMagazineCarousel : function(){
2007
+ var element = $(".iasd-widget-slider > .magazine");
2008
+ if(element.length > 0) {
2009
+ owlCarousels.push(element.owlCarousel({
2010
+ navigation : true,
2011
+ items : 1,
2012
+ itemsDesktop : [1200,1],
2013
+ itemsDesktopSmall : [991,1],
2014
+ itemsTablet : [768,3],
2015
+ itemsMobile: [479,1],
2016
+ slideSpeed : 500,
2017
+ pagination : false,
2018
+ paginationSpeed : 1000,
2019
+ autoPlay: false,
2020
+ navigationText: false,
2021
+ stopOnHover: true,
2022
+ mouseDrag: false,
2023
+ touchDrag: false,
2024
+ lazyLoad : true
2025
+ }).data('owlCarousel'));
2026
+ }
2027
+ },
2028
+
2029
+
2030
+ initNewsstandCarouselSmall : function(){
2031
+ var element = $(".iasd-widget-slider > .newsstand.small");
2032
+ if(element.length > 0) {
2033
+ owlCarousels.push(element.owlCarousel({
2034
+ navigation : true,
2035
+ items : 1,
2036
+ itemsDesktop : [1200,1],
2037
+ itemsDesktopSmall : [991,3],
2038
+ itemsTablet : [768,2],
2039
+ itemsMobile: [479,1],
2040
+ slideSpeed : 500,
2041
+ pagination : false,
2042
+ paginationSpeed : 1000,
2043
+ autoPlay: false,
2044
+ navigationText: false,
2045
+ stopOnHover: true,
2046
+ mouseDrag: false,
2047
+ touchDrag: false,
2048
+ lazyLoad : true
2049
+ }).data('owlCarousel'));
2050
+ }
2051
+ },
2052
+
2053
+
2054
+ initNewsstandCarouselLarge : function(){
2055
+ var element = $(".iasd-widget-slider > .newsstand.large");
2056
+ if(element.length > 0) {
2057
+ owlCarousels.push(element.owlCarousel({
2058
+ navigation : true,
2059
+ items : 2,
2060
+ itemsDesktop : [1200,2],
2061
+ itemsDesktopSmall : [991,2],
2062
+ itemsTablet : [768,2],
2063
+ itemsMobile: [479,1],
2064
+ slideSpeed : 500,
2065
+ pagination : false,
2066
+ paginationSpeed : 1000,
2067
+ autoPlay: false,
2068
+ navigationText: false,
2069
+ stopOnHover: true,
2070
+ mouseDrag: false,
2071
+ touchDrag: false,
2072
+ lazyLoad : true
2073
+ }).data('owlCarousel'));
2074
+ }
2075
+ },
2076
+
2077
+ initInstitutionalCarousel : function(){
2078
+ var element = $(".iasd-institutional-gallery");
2079
+ if(element.length > 0) {
2080
+ owlCarousels.push(element.owlCarousel({
2081
+ items : 1,
2082
+ itemsDesktop : [1200,1],
2083
+ itemsDesktopSmall : [991,1],
2084
+ itemsTablet : [768,1],
2085
+ itemsMobile: [479,1]
2086
+ }).data('owlCarousel'));
2087
+ }
2088
+ }
2089
+
2090
+ };
2091
+
2092
+
2093
+ $.fn.IASDImageGallery = function(options){
2094
+
2095
+ if ($.type(options) != 'object'){
2096
+ options = {};
2097
+ }
2098
+
2099
+ this.each(function(){
2100
+ ImageGalleryController.init.apply(this, [options]);
2101
+ });
2102
+ }
2103
+
2104
+ var ImageGalleryController = {
2105
+ defaultOptions : {
2106
+ items : 7,
2107
+ itemsDesktop : [1199,7],
2108
+ itemsDesktopSmall : [979,5],
2109
+ itemsTablet : [768,6],
2110
+ itemsMobile : [479,3],
2111
+ pagination : false,
2112
+ responsiveRefreshRate : 100,
2113
+ afterInit : function(el){
2114
+ el.find(".owl-item").eq(0).addClass("synced");
2115
+ }
2116
+ },
2117
+
2118
+ init : function (userOptions){
2119
+ var $container = $(this);
2120
+
2121
+ var options = $.extend({}, ImageGalleryController.defaultOptions, userOptions);
2122
+ var $pics = $container.find(".iasd-images-gallery-pics");
2123
+ var $thumbs = $container.find(".iasd-images-gallery-thumbs");
2124
+
2125
+ $pics.owlCarousel({
2126
+ afterAction : ImageGalleryController.syncPosition,
2127
+ pagination : false,
2128
+ responsiveRefreshRate : 200,
2129
+ navigation : false,
2130
+ singleItem : true,
2131
+ slideSpeed : 1000,
2132
+ autoHeight : true,
2133
+ autoPlay : false,
2134
+ lazyLoad : true,
2135
+ transitionStyle : "fade"
2136
+ });
2137
+
2138
+ $thumbs.owlCarousel(options);
2139
+
2140
+ $thumbs.on("click", ".owl-item", ImageGalleryController.onClickThumbItem);
2141
+
2142
+ },
2143
+
2144
+ syncPosition: function(el){
2145
+ $thumbs = $(el).closest('.iasd-images-gallery').find('.iasd-images-gallery-thumbs');
2146
+ var current = this.currentItem;
2147
+ $thumbs.find(".owl-item").removeClass("synced").eq(current).addClass("synced");
2148
+
2149
+ if( $thumbs.data("owlCarousel") !== undefined ){
2150
+ ImageGalleryController.center(current, $thumbs);
2151
+ }
2152
+ },
2153
+
2154
+ onClickThumbItem: function(e){
2155
+ e.preventDefault();
2156
+
2157
+ $this = $(this);
2158
+ $pics = $this.closest('.iasd-images-gallery').find('.iasd-images-gallery-pics');
2159
+ var number = $this.data("owlItem");
2160
+ $pics.trigger("owl.goTo",number);
2161
+ },
2162
+
2163
+ center: function(number, $thumbs){
2164
+
2165
+ var $thumbsvisible = $thumbs.data("owlCarousel").owl.visibleItems;
2166
+ var num = number;
2167
+ var found = false;
2168
+ for(var i in $thumbsvisible){
2169
+ if(num === $thumbsvisible[i]){
2170
+ var found = true;
2171
+ }
2172
+ }
2173
+
2174
+ if(found===false){
2175
+ if(num>$thumbsvisible[$thumbsvisible.length-1]){
2176
+ $thumbs.trigger("owl.goTo", num - $thumbsvisible.length+2)
2177
+ }else{
2178
+ if(num - 1 === -1){
2179
+ num = 0;
2180
+ }
2181
+ $thumbs.trigger("owl.goTo", num);
2182
+ }
2183
+ } else if(num === $thumbsvisible[$thumbsvisible.length-1]){
2184
+ $thumbs.trigger("owl.goTo", $thumbsvisible[1])
2185
+ } else if(num === $thumbsvisible[0]){
2186
+ $thumbs.trigger("owl.goTo", num-1)
2187
+ }
2188
+
2189
+ }
2190
+
2191
+ };
2192
+
2193
+ })(jQuery);