if (typeof object.create !== "function") { object.create = function (obj) { function f() {} f.prototype = obj; return new f(); }; } (function ($, window, document) { var carousel = { init : function (options, el) { var base = this; base.$elem = $(el); base.options = $.extend({}, $.fn.owlcarousel.options, base.$elem.data(), options); base.useroptions = options; base.loadcontent(); }, loadcontent : function () { var base = this, url; function getdata(data) { var i, content = ""; if (typeof base.options.jsonsuccess === "function") { base.options.jsonsuccess.apply(this, [data]); } else { for (i in data.owl) { if (data.owl.hasownproperty(i)) { content += data.owl[i].item; } } base.$elem.html(content); } base.login(); } if (typeof base.options.beforeinit === "function") { base.options.beforeinit.apply(this, [base.$elem]); } if (typeof base.options.jsonpath === "string") { url = base.options.jsonpath; $.getjson(url, getdata); } else { base.login(); } }, login : function () { var base = this; base.$elem.data("owl-originalstyles", base.$elem.attr("style")); base.$elem.data("owl-originalclasses", base.$elem.attr("class")); base.$elem.css({opacity: 0}); base.orignalitems = base.options.items; base.checkbrowser(); base.wrapperwidth = 0; base.checkvisible = null; base.setvars(); }, setvars : function () { var base = this; if (base.$elem.children().length === 0) {return false; } base.baseclass(); base.eventtypes(); base.$useritems = base.$elem.children(); base.itemsamount = base.$useritems.length; base.wrapitems(); base.$owlitems = base.$elem.find(".owl-item"); base.$owlwrapper = base.$elem.find(".owl-wrapper"); base.playdirection = "next"; base.previtem = 0; base.prevarr = [0]; base.currentitem = 0; base.customevents(); base.onstartup(); }, onstartup : function () { var base = this; base.updateitems(); base.calculateall(); base.buildcontrols(); base.updatecontrols(); base.response(); base.moveevents(); base.stoponhover(); base.owlstatus(); if (base.options.transitionstyle !== false) { base.transitiontypes(base.options.transitionstyle); } if (base.options.autoplay === true) { base.options.autoplay = 5000; } base.play(); base.$elem.find(".owl-wrapper").css("display", "block"); if (!base.$elem.is(":visible")) { base.watchvisibility(); } else { base.$elem.css("opacity", 1); } base.onstartup = false; base.eachmoveupdate(); if (typeof base.options.afterinit === "function") { base.options.afterinit.apply(this, [base.$elem]); } }, eachmoveupdate : function () { var base = this; if (base.options.lazyload === true) { base.lazyload(); } if (base.options.autoheight === true) { base.autoheight(); } base.onvisibleitems(); if (typeof base.options.afteraction === "function") { base.options.afteraction.apply(this, [base.$elem]); } }, updatevars : function () { var base = this; if (typeof base.options.beforeupdate === "function") { base.options.beforeupdate.apply(this, [base.$elem]); } base.watchvisibility(); base.updateitems(); base.calculateall(); base.updateposition(); base.updatecontrols(); base.eachmoveupdate(); if (typeof base.options.afterupdate === "function") { base.options.afterupdate.apply(this, [base.$elem]); } }, reload : function () { var base = this; window.settimeout(function () { base.updatevars(); }, 0); }, watchvisibility : function () { var base = this; if (base.$elem.is(":visible") === false) { base.$elem.css({opacity: 0}); window.clearinterval(base.autoplayinterval); window.clearinterval(base.checkvisible); } else { return false; } base.checkvisible = window.setinterval(function () { if (base.$elem.is(":visible")) { base.reload(); base.$elem.animate({opacity: 1}, 200); window.clearinterval(base.checkvisible); } }, 500); }, wrapitems : function () { var base = this; base.$useritems.wrapall("