diff --git a/README.md b/README.md index 3051aea..6bca2f7 100644 --- a/README.md +++ b/README.md @@ -1,3 +1,6 @@ # open-JSD-8496 -JSD-8496 开源任务材料 \ No newline at end of file +JSD-8496 决策平台 simple主题 开源任务材料\ +免责说明:该源码为第三方爱好者提供,不保证源码和方案的可靠性,也不提供任何形式的源码教学指导和协助!\ +仅作为开发者学习参考使用!禁止用于任何商业用途!\ +为保护开发者隐私,开发者信息已隐去!若原开发者希望公开自己的信息,可联系hugh处理。 \ No newline at end of file diff --git a/plugin.xml b/plugin.xml new file mode 100644 index 0000000..6c21049 --- /dev/null +++ b/plugin.xml @@ -0,0 +1,22 @@ + + + com.fr.plugin.decision.theme.zxl.simple + + yes + 1.0.7.5 + 10.0 + 2018-10-10 + fr.open + 2020-02025 开始开发

+ ]]>
+ + + + + + + +
diff --git a/src/main/java/com/fr/plugin/theme/simple/SimpleComponent.java b/src/main/java/com/fr/plugin/theme/simple/SimpleComponent.java new file mode 100644 index 0000000..3226ba1 --- /dev/null +++ b/src/main/java/com/fr/plugin/theme/simple/SimpleComponent.java @@ -0,0 +1,84 @@ +package com.fr.plugin.theme.simple; + +import com.fr.decision.config.AppearanceConfig; +import com.fr.web.struct.AssembleComponent; +import com.fr.web.struct.Atom; +import com.fr.web.struct.Component; +import com.fr.web.struct.browser.RequestClient; +import com.fr.web.struct.category.FileType; +import com.fr.web.struct.category.ParserType; +import com.fr.web.struct.category.ScriptPath; +import com.fr.web.struct.category.StylePath; +import com.fr.web.struct.Filter; + + +public class SimpleComponent extends AssembleComponent { + + public static final SimpleComponent KEY = new SimpleComponent(); + + public SimpleComponent() { + ThemeConfig.getInstance();//初始化配置 + } + + @Override + public Atom[] refer() { + return new Atom[]{ + new Component() { + @Override + public ScriptPath script(RequestClient requestClient) { + return ScriptPath.build("com/fr/plugin/theme/simple/web/js/baseFun.js"); + } + }, + new Component() { + @Override + public ScriptPath script(RequestClient requestClient) { + return ScriptPath.build("com/fr/plugin/theme/simple/web/js/models.js"); + } + }, + new Component() { + @Override + public ScriptPath script(RequestClient requestClient) { + return ScriptPath.build("com/fr/plugin/theme/simple/web/js/panles.js"); + } + }, + new Component() { + @Override + public ScriptPath script(RequestClient requestClient) { + return ScriptPath.build("com/fr/plugin/theme/simple/web/js/customTree.js"); + } + }, + new Component() { + @Override + public ScriptPath script(RequestClient requestClient) { + return ScriptPath.build("com/fr/plugin/theme/simple/web/js/jquery.slimscroll.min.js"); + } + }, + new Component() { + @Override + public ScriptPath script(RequestClient requestClient) { + return ScriptPath.build("com/fr/plugin/theme/simple/web/js/jquery.nicescroll.min.js"); + } + }, + }; + } + + @Override + public ScriptPath script() { + return ScriptPath.build("com.fr.plugin.theme.simple.SimpleThemeJS", FileType.CLASS); + // return ScriptPath.build("com/fr/plugin/theme/simple/web/theme.js"); + } + + @Override + public StylePath style() { + return StylePath.build("com/fr/plugin/theme/simple/web/style.css", ParserType.DYNAMIC); + } + + @Override + public Filter filter() { + return new Filter() { + public boolean accept() { + return "com.fr.plugin.decision.theme.zxl.simple".equals(AppearanceConfig.getInstance().getThemeId()); + } + }; + } +} diff --git a/src/main/java/com/fr/plugin/theme/simple/SimpleHttpHanders.java b/src/main/java/com/fr/plugin/theme/simple/SimpleHttpHanders.java new file mode 100644 index 0000000..c4a6893 --- /dev/null +++ b/src/main/java/com/fr/plugin/theme/simple/SimpleHttpHanders.java @@ -0,0 +1,18 @@ +package com.fr.plugin.theme.simple; + +import com.fr.decision.fun.HttpHandler; +import com.fr.decision.fun.impl.AbstractHttpHandlerProvider; +import com.fr.stable.fun.Authorize; + +@Authorize(callSignKey = "com.fr.plugin.decision.theme.zxl.simple") +public class SimpleHttpHanders extends AbstractHttpHandlerProvider { + + private HttpHandler[] actions = new HttpHandler[]{ + + }; + + @Override + public HttpHandler[] registerHandlers() { + return actions; + } +} diff --git a/src/main/java/com/fr/plugin/theme/simple/SimpleTheme.java b/src/main/java/com/fr/plugin/theme/simple/SimpleTheme.java new file mode 100644 index 0000000..4ddce12 --- /dev/null +++ b/src/main/java/com/fr/plugin/theme/simple/SimpleTheme.java @@ -0,0 +1,40 @@ +package com.fr.plugin.theme.simple; + +import com.fr.decision.fun.impl.AbstractThemeVariousProvider; +import com.fr.decision.web.MainComponent; +import com.fr.intelli.record.Focus; +import com.fr.intelli.record.Original; +import com.fr.record.analyzer.EnableMetrics; +import com.fr.web.struct.Atom; + +@EnableMetrics +public class SimpleTheme extends AbstractThemeVariousProvider { + + + @Override + public Atom attach() { + return MainComponent.KEY; + } + + @Override + @Focus(id = "com.fr.plugin.decision.theme.zxl.simple", text = "Simple", source = Original.PLUGIN) + public Atom client() { + return SimpleComponent.KEY; + } + + @Override + public String name() { + return "Simple主题"; + } + + @Override + public String text() { + return "Simple主题"; + } + + @Override + public String coverPath() { + return "com/fr/plugin/theme/simple/web/icon.png"; + } + +} diff --git a/src/main/java/com/fr/plugin/theme/simple/SimpleThemeJS.java b/src/main/java/com/fr/plugin/theme/simple/SimpleThemeJS.java new file mode 100644 index 0000000..03dcf8d --- /dev/null +++ b/src/main/java/com/fr/plugin/theme/simple/SimpleThemeJS.java @@ -0,0 +1,39 @@ +package com.fr.plugin.theme.simple; + +import com.fr.base.TemplateUtils; +import com.fr.gen.TextGenerator; +import com.fr.plugin.context.PluginContexts; + +import javax.servlet.http.HttpServletRequest; +import javax.servlet.http.HttpServletResponse; +import java.util.HashMap; +import java.util.Map; + +public class SimpleThemeJS implements TextGenerator { + + + public String text(HttpServletRequest req, HttpServletResponse res) throws Exception { + Map renderMap = new HashMap(); + ThemeConfig instance = ThemeConfig.getInstance(); + Integer fontSize = instance.getFontSize(); + Integer zfontSize = instance.getzFontSize(); + renderMap.put("fontSize", fontSize); + renderMap.put("zFontSize", zfontSize); +// return TemplateUtils.renderTemplate(this.template(), renderMap); + if (PluginContexts.currentContext().isAvailable()) { + // 做认证通过的事情 + return TemplateUtils.renderTemplate(this.template(), renderMap); + } else { + // 做认证未通过的事情 + return "alert('未授权')"; + } + } + + public String mimeType() { + return "text/javascript"; + } + + public String template() { + return "/com/fr/plugin/theme/simple/web/theme.js"; + } +} diff --git a/src/main/java/com/fr/plugin/theme/simple/ThemeConfig.java b/src/main/java/com/fr/plugin/theme/simple/ThemeConfig.java new file mode 100644 index 0000000..d711ea5 --- /dev/null +++ b/src/main/java/com/fr/plugin/theme/simple/ThemeConfig.java @@ -0,0 +1,48 @@ +package com.fr.plugin.theme.simple; + +import com.fr.config.*; +import com.fr.config.holder.Conf; +import com.fr.config.holder.factory.Holders; + +@Visualization(category = "主题设置") +public class ThemeConfig extends DefaultConfiguration { + + private static volatile ThemeConfig config = null; + + public static ThemeConfig getInstance() { + if (config == null) { + config = ConfigContext.getConfigInstance(ThemeConfig.class); + } + return config; + } + + @Identifier(value = "fontSize", name = "字体大小(px)", description = "字体大小(px)", status = Status.SHOW) + private Conf fontSize = Holders.simple(16); + @Identifier(value = "zFontSize", name = "子菜单字体大小(px)", description = "子菜单字体大小(px)", status = Status.SHOW) + private Conf zFontSize = Holders.simple(14); + + public Integer getzFontSize() { + return zFontSize.get(); + } + + public void setzFontSize(Integer zFontSize) { + this.zFontSize.set(zFontSize); + } + + public Integer getFontSize() { + return fontSize.get(); + } + + public void setFontSize(Integer fontSize) { + this.fontSize.set(fontSize); + } + + @Override + public Object clone() throws CloneNotSupportedException { + ThemeConfig cloned = (ThemeConfig) super.clone(); + cloned.fontSize = (Conf) fontSize.clone(); + cloned.zFontSize = (Conf) zFontSize.clone(); + return cloned; + } + +} \ No newline at end of file diff --git a/src/main/resources/com/fr/plugin/theme/simple/web/icon.png b/src/main/resources/com/fr/plugin/theme/simple/web/icon.png new file mode 100644 index 0000000..f11e8cf Binary files /dev/null and b/src/main/resources/com/fr/plugin/theme/simple/web/icon.png differ diff --git a/src/main/resources/com/fr/plugin/theme/simple/web/images/ReportServer.jpg b/src/main/resources/com/fr/plugin/theme/simple/web/images/ReportServer.jpg new file mode 100644 index 0000000..5d52ba9 Binary files /dev/null and b/src/main/resources/com/fr/plugin/theme/simple/web/images/ReportServer.jpg differ diff --git a/src/main/resources/com/fr/plugin/theme/simple/web/images/backgroup.jpg b/src/main/resources/com/fr/plugin/theme/simple/web/images/backgroup.jpg new file mode 100644 index 0000000..c2ba81a Binary files /dev/null and b/src/main/resources/com/fr/plugin/theme/simple/web/images/backgroup.jpg differ diff --git a/src/main/resources/com/fr/plugin/theme/simple/web/images/backgroup.png b/src/main/resources/com/fr/plugin/theme/simple/web/images/backgroup.png new file mode 100644 index 0000000..f475cd4 Binary files /dev/null and b/src/main/resources/com/fr/plugin/theme/simple/web/images/backgroup.png differ diff --git a/src/main/resources/com/fr/plugin/theme/simple/web/js/baseFun.js b/src/main/resources/com/fr/plugin/theme/simple/web/js/baseFun.js new file mode 100644 index 0000000..f90ae09 --- /dev/null +++ b/src/main/resources/com/fr/plugin/theme/simple/web/js/baseFun.js @@ -0,0 +1,150 @@ +; + +function zxlresolvePath(path, isPublic) { + if (!path || path[0] !== '/') { + path = '/' + path; + } + return isPublic === true + ? '/plugin/public/com.fr.plugin.decision.theme.zxl.simple' + path + : '/plugin/private/com.fr.plugin.decision.theme.zxl.simple' + path; +} + +function sortMenu(a, b) { + var value1 = a["sortIndex"]; + var value2 = b["sortIndex"]; + return value1 - value2; +} + +function getImageUrl(name) { + return Dec.fineServletURL + "/resources?path=com/fr/plugin/theme/simple/web/images/" + name; +} + +function showLayer(okCallBack, cancelCallBack) { + var id = BI.UUID(); + var layer = BI.Layers.create(id, "body"); + BI.createWidget({ + type: "bi.absolute", + element: layer, + items: [ + { + el: { + type: "bi.center_adapt", + items: [ + { + type: "bi.center_adapt", + cls: "layer-backend", + width: 366, + height: 248, + items: [ + { + type: "bi.vertical", + items: [ + { + type: "bi.center_adapt", + items: [ + { + type: "bi.img", + cls: "clear-fav-img", + src: getImageUrl("exclamationMark.jpg"), + width: 50, + height: 50 + } + ] + }, + { + type: "bi.label", + text: "确定清空全部收藏吗", + textAlign: "center", + cls: "layer-text" + }, + { + type: "bi.vertical_adapt", + items: [ + { + type: "bi.text_button", + cls: "layer-cancel-btn", + text: "取消", + handler: function () { + if (BI.isFunction(cancelCallBack)) { + cancelCallBack(); + } + BI.Layers.hide(id) + } + }, + { + type: "bi.text_button", + cls: "layer-ok-btn", + text: "确定", + handler: function () { + if (BI.isFunction(okCallBack)) { + okCallBack(); + } + BI.Layers.hide(id) + } + } + ] + } + ] + } + + ] + } + ], + ref: function (e) { + $(e.element).css("zIndex", 999999) + }, + }, + left: 0, + top: 0, + right: 0, + bottom: 0 + }, + { + el: { + type: "bi.center_adapt", + cls: "bi-z-index-mask", + width: "100%", + height: "100%", + } + + } + ] + }); + BI.Layers.show(id); +} + +function openEntityCard(e) { + var t = ""; + switch (e.entryType) { + case DecCst.Entries.Entry_Type.BI_REPORT: + t = Dec.fineServletURL + "/v10/entry/access/" + e.id + "?dashboardType=" + (BI.isNotNull(e.homePageType) ? "5" : "4"); + break; + case DecCst.Entries.Entry_Type.SEARCH_SHARE: + t = Dec.fineServletURL + "/v5/design/report/" + e.id + "/view?entryType=6"; + break; + case DecCst.Entries.Entry_Type.LINK_TYPE: + t = e.path || e.pcURL; + break; + default: + t = BI.isKey(e.id) ? Dec.fineServletURL + "/v10/entry/access/" + e.id + "?dashboardType=5" : "about:blank" + } + BI.Providers.getProvider("dec.provider.tab_pane").behaviour("addCardByName", e.id, { + text: e.text, + value: e.id, + entry: true, + cardType: { + src:t + } + }) +} + +function getMenuCoverUrl(id) { + if (id) { + if (id.indexOf("MapCache") !== -1) { + return Dec.fineServletURL + "/v10/attach/image/" + id + } else if (id.indexOf("entry_") !== -1) { + return Dec.fineServletURL + "/resources?path=/com/fr/web/resources/dist/resources/cover/" + id + } + } + return Dec.fineServletURL + "/resources?path=/com/fr/web/resources/dist/resources/cover/entry_cover1.png" +} diff --git a/src/main/resources/com/fr/plugin/theme/simple/web/js/customTree.js b/src/main/resources/com/fr/plugin/theme/simple/web/js/customTree.js new file mode 100644 index 0000000..820e632 --- /dev/null +++ b/src/main/resources/com/fr/plugin/theme/simple/web/js/customTree.js @@ -0,0 +1,319 @@ +; + +/** + * menu item popup + */ +!(function () { + var Widget = BI.inherit(BI.Widget, { + + props: { + baseCls: "zxl-sidle-popup", + width: 228, + height: "100%" + }, + hasChild: function (menuId) { + return this.getChildMenu(menuId).length > 0 + }, + getChildMenu: function (menuId) { + var items = []; + BI.each(this.store.getAllMenu(), function (i, v) { + if (v.pId === menuId) { + items.push(v); + } + return true; + }); + return items.sort(sortMenu); + }, + _store: function () { + return BI.Models.getModel("dec.model.zxl.menus") + }, + beforeInit: function (render) { + this.store.initMenu(render); + }, + _getSystemMenu: function () { + var navs = BI.Constants.getConstant("dec.constant.management.navigation"); + var temp = BI.filter(Dec.decisionModules, function (i, v) { + return v.id !== "decision-management-root" && v.id !== "decision-management-maintenance-bi-notification" && BI.find(navs, function (ii, vv) { + return v.id === vv.id; + }) + }); + var managementModules = BI.map(temp, function (i, v) { + return BI.find(navs, function (ii, vv) { + return v.id === vv.id; + }) + }); + return BI.map(managementModules, function (i, v) { + return { + text: v.text, + icon: v.cls, + id:v.id, + item:v, + cls: "header-item", + handler: function () { + var find = BI.find(Dec.decisionModules, function (i, vv) { + return v.id === vv.id + }); + if (find) { + BI.Services.getService("dec.service.tabs").addItem(v.item); + } else { + openEntityCard(v); + } + } + } + }); + }, + render: function () { + var that = this; + var items = this.options.items; + var allMenu = this.store.getAllMenu(); + var temps = BI.map(items, function (i, v) { + if (v.text === "管理系统") { + var tps = that._getSystemMenu(); + return { + type: "zxl.tree.expander", + text: v.text, + icon: v.icon, + width: 233, + item: v, + items: tps + } + } + if (v.entryType === 3) { + return { + type: "zxl.tree.expander", + text: v.text, + item: v, + icon: v.icon ? v.icon : "dir-panel-folder-font", + width: 233, + allMenu: allMenu, + items: that.getChildMenu(v.id) + } + } + return { + type: "zxl.tree.node", + text: v.text, + item: v, + icon: v.icon ? v.icon : "dir-panel-template-font", + height: 48 + } + }); + return { + width: 228, + type: "bi.vertical", + height: "100%", + items: temps + }; + } + }); + BI.shortcut("zxl.header.menu.extItem.popup", Widget); +}()); +!(function () { + var Node = BI.inherit(BI.BasicButton, { + props: { + baseCls: "zxl-tree", + items: [], + open: false, + height: "auto", + width: "100%" + }, + getChildMenu: function (menuId) { + var items = []; + BI.each(this.options.allMenu, function (i, v) { + if (v.pId === menuId) { + items.push(v); + } + return true; + }); + return items.sort(sortMenu); + }, + render: function () { + var self = this, o = this.options, allMenu = this.options.allMenu; + var trigger = { + type: "zxl.tree.node", + text: o.text, + height: 42, + item: o.item, + open: o.open, + icon: o.icon, + listeners: [ + { + eventName: "EVENT_EXPAND", + action: function () { + self.showView(); + } + }, { + eventName: "EVENT_COLLAPSE", + action: function () { + self.popuop.setVisible(false); + } + } + ] + }; + + var items = BI.map(o.items, function (i, v) { + if (v.entryType === 3) { + return { + type: "zxl.tree.expander", + width: 233, + item: v, + text: v.text, + icon: v.icon ? v.icon : "dir-panel-folder-font", + allMenu: allMenu, + items: self.getChildMenu(v.id) + } + } + return { + type: "zxl.tree.node", + item: v, + text:v.text, + icon: v.icon ? v.icon : "dir-panel-template-font", + height: 48, + handler: function () { + var find = BI.find(Dec.decisionModules, function (i, vv) { + return v.id === vv.id + }); + if (find) { + BI.Services.getService("dec.service.tabs").addItem(v.item); + } else { + openEntityCard(v); + } + } + } + }); + return { + type: "bi.vertical", + items: [ + { + el: trigger + }, { + el: { + type: "bi.button_group", + cls: "demo-sidebar-expander-popup", + layouts: [ + { + type: "bi.vertical" + } + ], + ref: function (_ref) { + self.popuop = _ref; + }, + invisible: !o.open, + items: items + } + } + ] + + }; + }, + showView: function () { + var self = this, o = this.options; + if (BI.isEmptyArray(o.items)) { + Dec.Utils.getWorkbenchSubDirectoryById(o.id, function (res) { + o.items = BI.map(res.data, function (index, item) { + var temp = BI.extend({ + type: "demo.sidebar.item", + }, item); + return { + type: "bi.center_adapt", + cls: "item-line", + items: [ + temp + ] + } + }); + self.popuop.populate(o.items); + self.popuop.setVisible(true); + }); + } else { + self.popuop.setVisible(true); + } + } + }); + BI.shortcut("zxl.tree.expander", Node); +}()); + + +!(function () { + var Node = BI.inherit(BI.NodeButton, { + + props: { + baseCls: "zxl-tree-node", + id: "", + pId: "", + open: false, + height: 50, + iconCls: "dir-panel-folder-font" + }, + + render: function () { + + var self = this, o = this.options; + var text = this.options.text; + var icon = this.options.icon; + var items = []; + + items.push({ + el: { + type: "bi.icon_button", + cls: icon, + ref: function (e) { + self.iconBtn = e; + } + }, + width: 30 + }); + + items.push({ + el: { + type: "bi.label", + textAlign: "left", + cls: "menu-text", + text: o.text, + title: o.text + }, + height: o.height + }); + var cls="zxl-tree-node"; + if (o.item.entryType === 3 || o.item.text === "管理系统") { + cls="zxl-tree-menu"; + items.push({ + el: { + type: "bi.icon_button", + cls: "arraw-down-font", + ref: function (e) { + self.arraiconBtn = e; + } + }, + width: 30 + }); + } + + return { + type: "bi.htape", + cls:cls, + items: items + }; + }, + + isOnce: function () { + return false; + }, + + getValue: function () { + return this.options.id; + }, + setOpened: function (v) { + Node.superclass.setOpened.apply(this, arguments); + this.fireEvent(v ? "EVENT_EXPAND" : "EVENT_COLLAPSE"); + if (this.arraiconBtn) { + if (v) { + $(this.arraiconBtn.element).addClass("arraw-up-font").removeClass("arraw-down-font") + } else { + $(this.arraiconBtn.element).addClass("arraw-down-font").removeClass("arraw-up-font") + } + } + } + }); + + BI.shortcut("zxl.tree.node", Node); +}()); diff --git a/src/main/resources/com/fr/plugin/theme/simple/web/js/jquery.nicescroll.min.js b/src/main/resources/com/fr/plugin/theme/simple/web/js/jquery.nicescroll.min.js new file mode 100644 index 0000000..5fc24bc --- /dev/null +++ b/src/main/resources/com/fr/plugin/theme/simple/web/js/jquery.nicescroll.min.js @@ -0,0 +1,120 @@ +/* jquery.nicescroll 3.6.8 InuYaksa*2015 MIT http://nicescroll.areaaperta.com */(function(f){"function"===typeof define&&define.amd?define(["jquery"],f):"object"===typeof exports?module.exports=f(require("jquery")):f(jQuery)})(function(f){var B=!1,F=!1,O=0,P=2E3,A=0,J=["webkit","ms","moz","o"],v=window.requestAnimationFrame||!1,w=window.cancelAnimationFrame||!1;if(!v)for(var Q in J){var G=J[Q];if(v=window[G+"RequestAnimationFrame"]){w=window[G+"CancelAnimationFrame"]||window[G+"CancelRequestAnimationFrame"];break}}var x=window.MutationObserver||window.WebKitMutationObserver|| +!1,K={zindex:"auto",cursoropacitymin:0,cursoropacitymax:1,cursorcolor:"#424242",cursorwidth:"6px",cursorborder:"1px solid #fff",cursorborderradius:"5px",scrollspeed:60,mousescrollstep:24,touchbehavior:!1,hwacceleration:!0,usetransition:!0,boxzoom:!1,dblclickzoom:!0,gesturezoom:!0,grabcursorenabled:!0,autohidemode:!0,background:"",iframeautoresize:!0,cursorminheight:32,preservenativescrolling:!0,railoffset:!1,railhoffset:!1,bouncescroll:!0,spacebarenabled:!0,railpadding:{top:0,right:0,left:0,bottom:0}, +disableoutline:!0,horizrailenabled:!0,railalign:"right",railvalign:"bottom",enabletranslate3d:!0,enablemousewheel:!0,enablekeyboard:!0,smoothscroll:!0,sensitiverail:!0,enablemouselockapi:!0,cursorfixedheight:!1,directionlockdeadzone:6,hidecursordelay:400,nativeparentscrolling:!0,enablescrollonselection:!0,overflowx:!0,overflowy:!0,cursordragspeed:.3,rtlmode:"auto",cursordragontouch:!1,oneaxismousemode:"auto",scriptpath:function(){var f=document.getElementsByTagName("script"),f=f.length?f[f.length- +1].src.split("?")[0]:"";return 0d?a.getScrollLeft()>=a.page.maxw:0>=a.getScrollLeft())&&(e=d,d=0));a.isrtlmode&&(d=-d);d&&(a.scrollmom&&a.scrollmom.stop(),a.lastdeltax+=d,a.debounced("mousewheelx",function(){var b=a.lastdeltax;a.lastdeltax=0;a.rail.drag||a.doScrollLeftBy(b)},15));if(e){if(a.opt.nativeparentscrolling&&c&&!a.ispage&&!a.zoomactive)if(0>e){if(a.getScrollTop()>=a.page.maxh)return!0}else if(0>=a.getScrollTop())return!0;a.scrollmom&&a.scrollmom.stop();a.lastdeltay+=e; +a.synched("mousewheely",function(){var b=a.lastdeltay;a.lastdeltay=0;a.rail.drag||a.doScrollBy(b)},15)}b.stopImmediatePropagation();return b.preventDefault()}var a=this;this.version="3.6.8";this.name="nicescroll";this.me=c;this.opt={doc:f("body"),win:!1};f.extend(this.opt,K);this.opt.snapbackspeed=80;if(h)for(var r in a.opt)void 0!==h[r]&&(a.opt[r]=h[r]);a.opt.disablemutationobserver&&(x=!1);this.iddoc=(this.doc=a.opt.doc)&&this.doc[0]?this.doc[0].id||"":"";this.ispage=/^BODY|HTML/.test(a.opt.win? +a.opt.win[0].nodeName:this.doc[0].nodeName);this.haswrapper=!1!==a.opt.win;this.win=a.opt.win||(this.ispage?f(window):this.doc);this.docscroll=this.ispage&&!this.haswrapper?f(window):this.win;this.body=f("body");this.iframe=this.isfixed=this.viewport=!1;this.isiframe="IFRAME"==this.doc[0].nodeName&&"IFRAME"==this.win[0].nodeName;this.istextarea="TEXTAREA"==this.win[0].nodeName;this.forcescreen=!1;this.canshowonmouseevent="scroll"!=a.opt.autohidemode;this.page=this.view=this.onzoomout=this.onzoomin= +this.onscrollcancel=this.onscrollend=this.onscrollstart=this.onclick=this.ongesturezoom=this.onkeypress=this.onmousewheel=this.onmousemove=this.onmouseup=this.onmousedown=!1;this.scroll={x:0,y:0};this.scrollratio={x:0,y:0};this.cursorheight=20;this.scrollvaluemax=0;if("auto"==this.opt.rtlmode){r=this.win[0]==window?this.body:this.win;var p=r.css("writing-mode")||r.css("-webkit-writing-mode")||r.css("-ms-writing-mode")||r.css("-moz-writing-mode");"horizontal-tb"==p||"lr-tb"==p||""==p?(this.isrtlmode= +"rtl"==r.css("direction"),this.isvertical=!1):(this.isrtlmode="vertical-rl"==p||"tb"==p||"tb-rl"==p||"rl-tb"==p,this.isvertical="vertical-rl"==p||"tb"==p||"tb-rl"==p)}else this.isrtlmode=!0===this.opt.rtlmode,this.isvertical=!1;this.observerbody=this.observerremover=this.observer=this.scrollmom=this.scrollrunning=!1;do this.id="ascrail"+P++;while(document.getElementById(this.id));this.hasmousefocus=this.hasfocus=this.zoomactive=this.zoom=this.selectiondrag=this.cursorfreezed=this.cursor=this.rail= +!1;this.visibility=!0;this.hidden=this.locked=this.railslocked=!1;this.cursoractive=!0;this.wheelprevented=!1;this.overflowx=a.opt.overflowx;this.overflowy=a.opt.overflowy;this.nativescrollingarea=!1;this.checkarea=0;this.events=[];this.saved={};this.delaylist={};this.synclist={};this.lastdeltay=this.lastdeltax=0;this.detected=R();var e=f.extend({},this.detected);this.ishwscroll=(this.canhwscroll=e.hastransform&&a.opt.hwacceleration)&&a.haswrapper;this.hasreversehr=this.isrtlmode?this.isvertical? +!(e.iswebkit||e.isie||e.isie11):!(e.iswebkit||e.isie&&!e.isie10&&!e.isie11):!1;this.istouchcapable=!1;e.cantouch||!e.hasw3ctouch&&!e.hasmstouch?!e.cantouch||e.isios||e.isandroid||!e.iswebkit&&!e.ismozilla||(this.istouchcapable=!0):this.istouchcapable=!0;a.opt.enablemouselockapi||(e.hasmousecapture=!1,e.haspointerlock=!1);this.debounced=function(b,g,c){a&&(a.delaylist[b]||(g.call(a),a.delaylist[b]={h:v(function(){a.delaylist[b].fn.call(a);a.delaylist[b]=!1},c)}),a.delaylist[b].fn=g)};var I=!1;this.synched= +function(b,g){a.synclist[b]=g;(function(){I||(v(function(){if(a){I=!1;for(var b in a.synclist){var g=a.synclist[b];g&&g.call(a);a.synclist[b]=!1}}}),I=!0)})();return b};this.unsynched=function(b){a.synclist[b]&&(a.synclist[b]=!1)};this.css=function(b,g){for(var c in g)a.saved.css.push([b,c,b.css(c)]),b.css(c,g[c])};this.scrollTop=function(b){return void 0===b?a.getScrollTop():a.setScrollTop(b)};this.scrollLeft=function(b){return void 0===b?a.getScrollLeft():a.setScrollLeft(b)};var D=function(a,g, +c,d,e,f,k){this.st=a;this.ed=g;this.spd=c;this.p1=d||0;this.p2=e||1;this.p3=f||0;this.p4=k||1;this.ts=(new Date).getTime();this.df=this.ed-this.st};D.prototype={B2:function(a){return 3*a*a*(1-a)},B3:function(a){return 3*a*(1-a)*(1-a)},B4:function(a){return(1-a)*(1-a)*(1-a)},getNow:function(){var a=1-((new Date).getTime()-this.ts)/this.spd,g=this.B2(a)+this.B3(a)+this.B4(a);return 0>a?this.ed:this.st+Math.round(this.df*g)},update:function(a,g){this.st=this.getNow();this.ed=a;this.spd=g;this.ts=(new Date).getTime(); +this.df=this.ed-this.st;return this}};if(this.ishwscroll){this.doc.translate={x:0,y:0,tx:"0px",ty:"0px"};e.hastranslate3d&&e.isios&&this.doc.css("-webkit-backface-visibility","hidden");this.getScrollTop=function(b){if(!b){if(b=k())return 16==b.length?-b[13]:-b[5];if(a.timerscroll&&a.timerscroll.bz)return a.timerscroll.bz.getNow()}return a.doc.translate.y};this.getScrollLeft=function(b){if(!b){if(b=k())return 16==b.length?-b[12]:-b[4];if(a.timerscroll&&a.timerscroll.bh)return a.timerscroll.bh.getNow()}return a.doc.translate.x}; +this.notifyScrollEvent=function(a){var g=document.createEvent("UIEvents");g.initUIEvent("scroll",!1,!0,window,1);g.niceevent=!0;a.dispatchEvent(g)};var y=this.isrtlmode?1:-1;e.hastranslate3d&&a.opt.enabletranslate3d?(this.setScrollTop=function(b,g){a.doc.translate.y=b;a.doc.translate.ty=-1*b+"px";a.doc.css(e.trstyle,"translate3d("+a.doc.translate.tx+","+a.doc.translate.ty+",0px)");g||a.notifyScrollEvent(a.win[0])},this.setScrollLeft=function(b,g){a.doc.translate.x=b;a.doc.translate.tx=b*y+"px";a.doc.css(e.trstyle, +"translate3d("+a.doc.translate.tx+","+a.doc.translate.ty+",0px)");g||a.notifyScrollEvent(a.win[0])}):(this.setScrollTop=function(b,g){a.doc.translate.y=b;a.doc.translate.ty=-1*b+"px";a.doc.css(e.trstyle,"translate("+a.doc.translate.tx+","+a.doc.translate.ty+")");g||a.notifyScrollEvent(a.win[0])},this.setScrollLeft=function(b,g){a.doc.translate.x=b;a.doc.translate.tx=b*y+"px";a.doc.css(e.trstyle,"translate("+a.doc.translate.tx+","+a.doc.translate.ty+")");g||a.notifyScrollEvent(a.win[0])})}else this.getScrollTop= +function(){return a.docscroll.scrollTop()},this.setScrollTop=function(b){return setTimeout(function(){a&&a.docscroll.scrollTop(b)},1)},this.getScrollLeft=function(){return a.hasreversehr?a.detected.ismozilla?a.page.maxw-Math.abs(a.docscroll.scrollLeft()):a.page.maxw-a.docscroll.scrollLeft():a.docscroll.scrollLeft()},this.setScrollLeft=function(b){return setTimeout(function(){if(a)return a.hasreversehr&&(b=a.detected.ismozilla?-(a.page.maxw-b):a.page.maxw-b),a.docscroll.scrollLeft(b)},1)};this.getTarget= +function(a){return a?a.target?a.target:a.srcElement?a.srcElement:!1:!1};this.hasParent=function(a,g){if(!a)return!1;for(var c=a.target||a.srcElement||a||!1;c&&c.id!=g;)c=c.parentNode||!1;return!1!==c};var z={thin:1,medium:3,thick:5};this.getDocumentScrollOffset=function(){return{top:window.pageYOffset||document.documentElement.scrollTop,left:window.pageXOffset||document.documentElement.scrollLeft}};this.getOffset=function(){if(a.isfixed){var b=a.win.offset(),g=a.getDocumentScrollOffset();b.top-=g.top; +b.left-=g.left;return b}b=a.win.offset();if(!a.viewport)return b;g=a.viewport.offset();return{top:b.top-g.top,left:b.left-g.left}};this.updateScrollBar=function(b){var g,c,e;if(a.ishwscroll)a.rail.css({height:a.win.innerHeight()-(a.opt.railpadding.top+a.opt.railpadding.bottom)}),a.railh&&a.railh.css({width:a.win.innerWidth()-(a.opt.railpadding.left+a.opt.railpadding.right)});else{var f=a.getOffset();g=f.top;c=f.left-(a.opt.railpadding.left+a.opt.railpadding.right);g+=d(a.win,"border-top-width",!0); +c+=a.rail.align?a.win.outerWidth()-d(a.win,"border-right-width")-a.rail.width:d(a.win,"border-left-width");if(e=a.opt.railoffset)e.top&&(g+=e.top),e.left&&(c+=e.left);a.railslocked||a.rail.css({top:g,left:c,height:(b?b.h:a.win.innerHeight())-(a.opt.railpadding.top+a.opt.railpadding.bottom)});a.zoom&&a.zoom.css({top:g+1,left:1==a.rail.align?c-20:c+a.rail.width+4});if(a.railh&&!a.railslocked){g=f.top;c=f.left;if(e=a.opt.railhoffset)e.top&&(g+=e.top),e.left&&(c+=e.left);b=a.railh.align?g+d(a.win,"border-top-width", +!0)+a.win.innerHeight()-a.railh.height:g+d(a.win,"border-top-width",!0);c+=d(a.win,"border-left-width");a.railh.css({top:b-(a.opt.railpadding.top+a.opt.railpadding.bottom),left:c,width:a.railh.width})}}};this.doRailClick=function(b,g,c){var d;a.railslocked||(a.cancelEvent(b),g?(g=c?a.doScrollLeft:a.doScrollTop,d=c?(b.pageX-a.railh.offset().left-a.cursorwidth/2)*a.scrollratio.x:(b.pageY-a.rail.offset().top-a.cursorheight/2)*a.scrollratio.y,g(d)):(g=c?a.doScrollLeftBy:a.doScrollBy,d=c?a.scroll.x:a.scroll.y, +b=c?b.pageX-a.railh.offset().left:b.pageY-a.rail.offset().top,c=c?a.view.w:a.view.h,g(d>=b?c:-c)))};a.hasanimationframe=v;a.hascancelanimationframe=w;a.hasanimationframe?a.hascancelanimationframe||(w=function(){a.cancelAnimationFrame=!0}):(v=function(a){return setTimeout(a,15-Math.floor(+new Date/1E3)%16)},w=clearTimeout);this.init=function(){a.saved.css=[];if(e.isie7mobile||e.isoperamini)return!0;e.hasmstouch&&a.css(a.ispage?f("html"):a.win,{_touchaction:"none"});var b=e.ismodernie||e.isie10?{"-ms-overflow-style":"none"}: +{"overflow-y":"hidden"};a.zindex="auto";a.zindex=a.ispage||"auto"!=a.opt.zindex?a.opt.zindex:l()||"auto";!a.ispage&&"auto"!=a.zindex&&a.zindex>A&&(A=a.zindex);a.isie&&0==a.zindex&&"auto"==a.opt.zindex&&(a.zindex="auto");if(!a.ispage||!e.cantouch&&!e.isieold&&!e.isie9mobile){var c=a.docscroll;a.ispage&&(c=a.haswrapper?a.win:a.doc);e.isie9mobile||a.css(c,b);a.ispage&&e.isie7&&("BODY"==a.doc[0].nodeName?a.css(f("html"),{"overflow-y":"hidden"}):"HTML"==a.doc[0].nodeName&&a.css(f("body"),b));!e.isios|| +a.ispage||a.haswrapper||a.css(f("body"),{"-webkit-overflow-scrolling":"touch"});var d=f(document.createElement("div"));d.css({position:"relative",top:0,"float":"right",width:a.opt.cursorwidth,height:0,"background-color":a.opt.cursorcolor,border:a.opt.cursorborder,"background-clip":"padding-box","-webkit-border-radius":a.opt.cursorborderradius,"-moz-border-radius":a.opt.cursorborderradius,"border-radius":a.opt.cursorborderradius});d.hborder=parseFloat(d.outerHeight()-d.innerHeight());d.addClass("nicescroll-cursors"); +a.cursor=d;var m=f(document.createElement("div"));m.attr("id",a.id);m.addClass("nicescroll-rails nicescroll-rails-vr");var k,h,p=["left","right","top","bottom"],L;for(L in p)h=p[L],(k=a.opt.railpadding[h])?m.css("padding-"+h,k+"px"):a.opt.railpadding[h]=0;m.append(d);m.width=Math.max(parseFloat(a.opt.cursorwidth),d.outerWidth());m.css({width:m.width+"px",zIndex:a.zindex,background:a.opt.background,cursor:"default"});m.visibility=!0;m.scrollable=!0;m.align="left"==a.opt.railalign?0:1;a.rail=m;d=a.rail.drag= +!1;!a.opt.boxzoom||a.ispage||e.isieold||(d=document.createElement("div"),a.bind(d,"click",a.doZoom),a.bind(d,"mouseenter",function(){a.zoom.css("opacity",a.opt.cursoropacitymax)}),a.bind(d,"mouseleave",function(){a.zoom.css("opacity",a.opt.cursoropacitymin)}),a.zoom=f(d),a.zoom.css({cursor:"pointer",zIndex:a.zindex,backgroundImage:"url("+a.opt.scriptpath+"zoomico.png)",height:18,width:18,backgroundPosition:"0px 0px"}),a.opt.dblclickzoom&&a.bind(a.win,"dblclick",a.doZoom),e.cantouch&&a.opt.gesturezoom&& +(a.ongesturezoom=function(b){1.5b.scale&&a.doZoomOut(b);return a.cancelEvent(b)},a.bind(a.win,"gestureend",a.ongesturezoom)));a.railh=!1;var n;a.opt.horizrailenabled&&(a.css(c,{overflowX:"hidden"}),d=f(document.createElement("div")),d.css({position:"absolute",top:0,height:a.opt.cursorwidth,width:0,backgroundColor:a.opt.cursorcolor,border:a.opt.cursorborder,backgroundClip:"padding-box","-webkit-border-radius":a.opt.cursorborderradius,"-moz-border-radius":a.opt.cursorborderradius, +"border-radius":a.opt.cursorborderradius}),e.isieold&&d.css("overflow","hidden"),d.wborder=parseFloat(d.outerWidth()-d.innerWidth()),d.addClass("nicescroll-cursors"),a.cursorh=d,n=f(document.createElement("div")),n.attr("id",a.id+"-hr"),n.addClass("nicescroll-rails nicescroll-rails-hr"),n.height=Math.max(parseFloat(a.opt.cursorwidth),d.outerHeight()),n.css({height:n.height+"px",zIndex:a.zindex,background:a.opt.background}),n.append(d),n.visibility=!0,n.scrollable=!0,n.align="top"==a.opt.railvalign? +0:1,a.railh=n,a.railh.drag=!1);a.ispage?(m.css({position:"fixed",top:0,height:"100%"}),m.align?m.css({right:0}):m.css({left:0}),a.body.append(m),a.railh&&(n.css({position:"fixed",left:0,width:"100%"}),n.align?n.css({bottom:0}):n.css({top:0}),a.body.append(n))):(a.ishwscroll?("static"==a.win.css("position")&&a.css(a.win,{position:"relative"}),c="HTML"==a.win[0].nodeName?a.body:a.win,f(c).scrollTop(0).scrollLeft(0),a.zoom&&(a.zoom.css({position:"absolute",top:1,right:0,"margin-right":m.width+4}),c.append(a.zoom)), +m.css({position:"absolute",top:0}),m.align?m.css({right:0}):m.css({left:0}),c.append(m),n&&(n.css({position:"absolute",left:0,bottom:0}),n.align?n.css({bottom:0}):n.css({top:0}),c.append(n))):(a.isfixed="fixed"==a.win.css("position"),c=a.isfixed?"fixed":"absolute",a.isfixed||(a.viewport=a.getViewport(a.win[0])),a.viewport&&(a.body=a.viewport,0==/fixed|absolute/.test(a.viewport.css("position"))&&a.css(a.viewport,{position:"relative"})),m.css({position:c}),a.zoom&&a.zoom.css({position:c}),a.updateScrollBar(), +a.body.append(m),a.zoom&&a.body.append(a.zoom),a.railh&&(n.css({position:c}),a.body.append(n))),e.isios&&a.css(a.win,{"-webkit-tap-highlight-color":"rgba(0,0,0,0)","-webkit-touch-callout":"none"}),e.isie&&a.opt.disableoutline&&a.win.attr("hideFocus","true"),e.iswebkit&&a.opt.disableoutline&&a.win.css("outline","none"));!1===a.opt.autohidemode?(a.autohidedom=!1,a.rail.css({opacity:a.opt.cursoropacitymax}),a.railh&&a.railh.css({opacity:a.opt.cursoropacitymax})):!0===a.opt.autohidemode||"leave"===a.opt.autohidemode? +(a.autohidedom=f().add(a.rail),e.isie8&&(a.autohidedom=a.autohidedom.add(a.cursor)),a.railh&&(a.autohidedom=a.autohidedom.add(a.railh)),a.railh&&e.isie8&&(a.autohidedom=a.autohidedom.add(a.cursorh))):"scroll"==a.opt.autohidemode?(a.autohidedom=f().add(a.rail),a.railh&&(a.autohidedom=a.autohidedom.add(a.railh))):"cursor"==a.opt.autohidemode?(a.autohidedom=f().add(a.cursor),a.railh&&(a.autohidedom=a.autohidedom.add(a.cursorh))):"hidden"==a.opt.autohidemode&&(a.autohidedom=!1,a.hide(),a.railslocked= +!1);if(e.isie9mobile)a.scrollmom=new M(a),a.onmangotouch=function(){var b=a.getScrollTop(),c=a.getScrollLeft();if(b==a.scrollmom.lastscrolly&&c==a.scrollmom.lastscrollx)return!0;var g=b-a.mangotouch.sy,d=c-a.mangotouch.sx;if(0!=Math.round(Math.sqrt(Math.pow(d,2)+Math.pow(g,2)))){var e=0>g?-1:1,f=0>d?-1:1,u=+new Date;a.mangotouch.lazy&&clearTimeout(a.mangotouch.lazy);80h?h=Math.round(h/2):h>a.page.maxh&&(h=a.page.maxh+Math.round((h-a.page.maxh)/2)):(0>h&&(u=h=0),h>a.page.maxh&&(h=a.page.maxh,u=0));var l;a.railh&&a.railh.scrollable&&(l=a.isrtlmode?k-a.rail.drag.sl:a.rail.drag.sl-k,a.ishwscroll&&a.opt.bouncescroll?0>l?l=Math.round(l/2):l>a.page.maxw&&(l=a.page.maxw+Math.round((l-a.page.maxw)/ +2)):(0>l&&(m=l=0),l>a.page.maxw&&(l=a.page.maxw,m=0)));g=!1;if(a.rail.drag.dl)g=!0,"v"==a.rail.drag.dl?l=a.rail.drag.sl:"h"==a.rail.drag.dl&&(h=a.rail.drag.st);else{d=Math.abs(d);var k=Math.abs(k),C=a.opt.directionlockdeadzone;if("v"==a.rail.drag.ck){if(d>C&&k<=.3*d)return a.rail.drag=!1,!0;k>C&&(a.rail.drag.dl="f",f("body").scrollTop(f("body").scrollTop()))}else if("h"==a.rail.drag.ck){if(k>C&&d<=.3*k)return a.rail.drag=!1,!0;d>C&&(a.rail.drag.dl="f",f("body").scrollLeft(f("body").scrollLeft()))}}a.synched("touchmove", +function(){a.rail.drag&&2==a.rail.drag.pt&&(a.prepareTransition&&a.prepareTransition(0),a.rail.scrollable&&a.setScrollTop(h),a.scrollmom.update(m,u),a.railh&&a.railh.scrollable?(a.setScrollLeft(l),a.showCursor(h,l)):a.showCursor(h),e.isie10&&document.selection.clear())});e.ischrome&&a.istouchcapable&&(g=!1);if(g)return a.cancelEvent(b)}else if(1==a.rail.drag.pt)return a.onmousemove(b)}}a.onmousedown=function(b,c){if(!a.rail.drag||1==a.rail.drag.pt){if(a.railslocked)return a.cancelEvent(b);a.cancelScroll(); +a.rail.drag={x:b.clientX,y:b.clientY,sx:a.scroll.x,sy:a.scroll.y,pt:1,hr:!!c};var g=a.getTarget(b);!a.ispage&&e.hasmousecapture&&g.setCapture();a.isiframe&&!e.hasmousecapture&&(a.saved.csspointerevents=a.doc.css("pointer-events"),a.css(a.doc,{"pointer-events":"none"}));a.hasmoving=!1;return a.cancelEvent(b)}};a.onmouseup=function(b){if(a.rail.drag){if(1!=a.rail.drag.pt)return!0;e.hasmousecapture&&document.releaseCapture();a.isiframe&&!e.hasmousecapture&&a.doc.css("pointer-events",a.saved.csspointerevents); +a.rail.drag=!1;a.hasmoving&&a.triggerScrollEnd();return a.cancelEvent(b)}};a.onmousemove=function(b){if(a.rail.drag){if(1==a.rail.drag.pt){if(e.ischrome&&0==b.which)return a.onmouseup(b);a.cursorfreezed=!0;a.hasmoving=!0;if(a.rail.drag.hr){a.scroll.x=a.rail.drag.sx+(b.clientX-a.rail.drag.x);0>a.scroll.x&&(a.scroll.x=0);var c=a.scrollvaluemaxw;a.scroll.x>c&&(a.scroll.x=c)}else a.scroll.y=a.rail.drag.sy+(b.clientY-a.rail.drag.y),0>a.scroll.y&&(a.scroll.y=0),c=a.scrollvaluemax,a.scroll.y>c&&(a.scroll.y= +c);a.synched("mousemove",function(){a.rail.drag&&1==a.rail.drag.pt&&(a.showCursor(),a.rail.drag.hr?a.hasreversehr?a.doScrollLeft(a.scrollvaluemaxw-Math.round(a.scroll.x*a.scrollratio.x),a.opt.cursordragspeed):a.doScrollLeft(Math.round(a.scroll.x*a.scrollratio.x),a.opt.cursordragspeed):a.doScrollTop(Math.round(a.scroll.y*a.scrollratio.y),a.opt.cursordragspeed))});return a.cancelEvent(b)}}else a.checkarea=0};if(e.cantouch||a.opt.touchbehavior)a.onpreventclick=function(b){if(a.preventclick)return a.preventclick.tg.onclick= +a.preventclick.click,a.preventclick=!1,a.cancelEvent(b)},a.bind(a.win,"mousedown",a.ontouchstart),a.onclick=e.isios?!1:function(b){return a.lastmouseup?(a.lastmouseup=!1,a.cancelEvent(b)):!0},a.opt.grabcursorenabled&&e.cursorgrabvalue&&(a.css(a.ispage?a.doc:a.win,{cursor:e.cursorgrabvalue}),a.css(a.rail,{cursor:e.cursorgrabvalue}));else{var r=function(b){if(a.selectiondrag){if(b){var c=a.win.outerHeight();b=b.pageY-a.selectiondrag.top;0=c&&(b-=c);a.selectiondrag.df=b}0!=a.selectiondrag.df&& +(a.doScrollBy(2*-Math.floor(a.selectiondrag.df/6)),a.debounced("doselectionscroll",function(){r()},50))}};a.hasTextSelected="getSelection"in document?function(){return 0a.page.maxh?a.doScrollTop(a.page.maxh):(a.scroll.y=Math.round(a.getScrollTop()* +(1/a.scrollratio.y)),a.scroll.x=Math.round(a.getScrollLeft()*(1/a.scrollratio.x)),a.cursoractive&&a.noticeCursor());a.scroll.y&&0==a.getScrollTop()&&a.doScrollTo(Math.floor(a.scroll.y*a.scrollratio.y));return a};this.resize=a.onResize;this.hlazyresize=0;this.lazyResize=function(b){a.haswrapper||a.hide();a.hlazyresize&&clearTimeout(a.hlazyresize);a.hlazyresize=setTimeout(function(){a&&a.show().resize()},240);return a};this.jqbind=function(b,c,d){a.events.push({e:b,n:c,f:d,q:!0});f(b).bind(c,d)};this.mousewheel= +function(b,c,d){b="jquery"in b?b[0]:b;if("onwheel"in document.createElement("div"))a._bind(b,"wheel",c,d||!1);else{var e=void 0!==document.onmousewheel?"mousewheel":"DOMMouseScroll";q(b,e,c,d||!1);"DOMMouseScroll"==e&&q(b,"MozMousePixelScroll",c,d||!1)}};e.haseventlistener?(this.bind=function(b,c,d,e){a._bind("jquery"in b?b[0]:b,c,d,e||!1)},this._bind=function(b,c,d,e){a.events.push({e:b,n:c,f:d,b:e,q:!1});b.addEventListener(c,d,e||!1)},this.cancelEvent=function(a){if(!a)return!1;a=a.original?a.original: +a;a.cancelable&&a.preventDefault();a.stopPropagation();a.preventManipulation&&a.preventManipulation();return!1},this.stopPropagation=function(a){if(!a)return!1;a=a.original?a.original:a;a.stopPropagation();return!1},this._unbind=function(a,c,d,e){a.removeEventListener(c,d,e)}):(this.bind=function(b,c,d,e){var f="jquery"in b?b[0]:b;a._bind(f,c,function(b){(b=b||window.event||!1)&&b.srcElement&&(b.target=b.srcElement);"pageY"in b||(b.pageX=b.clientX+document.documentElement.scrollLeft,b.pageY=b.clientY+ +document.documentElement.scrollTop);return!1===d.call(f,b)||!1===e?a.cancelEvent(b):!0})},this._bind=function(b,c,d,e){a.events.push({e:b,n:c,f:d,b:e,q:!1});b.attachEvent?b.attachEvent("on"+c,d):b["on"+c]=d},this.cancelEvent=function(a){a=window.event||!1;if(!a)return!1;a.cancelBubble=!0;a.cancel=!0;return a.returnValue=!1},this.stopPropagation=function(a){a=window.event||!1;if(!a)return!1;a.cancelBubble=!0;return!1},this._unbind=function(a,c,d,e){a.detachEvent?a.detachEvent("on"+c,d):a["on"+c]=!1}); +this.unbindAll=function(){for(var b=0;b(a.newscrolly-f)*(c-f)||0>(a.newscrollx-k)*(b-k))&&a.cancelScroll();0==a.opt.bouncescroll&&(0>c?c=0:c>a.page.maxh&&(c=a.page.maxh),0>b?b=0:b>a.page.maxw&&(b=a.page.maxw));if(a.scrollrunning&&b==a.newscrollx&&c==a.newscrolly)return!1;a.newscrolly=c;a.newscrollx=b;a.newscrollspeed=d||!1;if(a.timer)return!1;a.timer=setTimeout(function(){var d=a.getScrollTop(),f=a.getScrollLeft(), +k=Math.round(Math.sqrt(Math.pow(b-f,2)+Math.pow(c-d,2))),k=a.newscrollspeed&&1=a.newscrollspeed&&(k*=a.newscrollspeed);a.prepareTransition(k,!0);a.timerscroll&&a.timerscroll.tm&&clearInterval(a.timerscroll.tm);0b?b=0:b>a.page.maxh&&(b=a.page.maxh);0>c?c=0:c>a.page.maxw&&(c=a.page.maxw);if(b!=a.newscrolly||c!=a.newscrollx)return a.doScrollPos(c, +b,a.opt.snapbackspeed);a.onscrollend&&a.scrollrunning&&a.triggerScrollEnd();a.scrollrunning=!1}):(this.doScrollLeft=function(b,c){var d=a.scrollrunning?a.newscrolly:a.getScrollTop();a.doScrollPos(b,d,c)},this.doScrollTop=function(b,c){var d=a.scrollrunning?a.newscrollx:a.getScrollLeft();a.doScrollPos(d,b,c)},this.doScrollPos=function(b,c,d){function e(){if(a.cancelAnimationFrame)return!0;a.scrollrunning=!0;if(p=1-p)return a.timer=v(e)||1;var b=0,c,d,f=d=a.getScrollTop();if(a.dst.ay){f=a.bzscroll? +a.dst.py+a.bzscroll.getNow()*a.dst.ay:a.newscrolly;c=f-d;if(0>c&&fa.newscrolly)f=a.newscrolly;a.setScrollTop(f);f==a.newscrolly&&(b=1)}else b=1;d=c=a.getScrollLeft();if(a.dst.ax){d=a.bzscroll?a.dst.px+a.bzscroll.getNow()*a.dst.ax:a.newscrollx;c=d-c;if(0>c&&da.newscrollx)d=a.newscrollx;a.setScrollLeft(d);d==a.newscrollx&&(b+=1)}else b+=1;2==b?(a.timer=0,a.cursorfreezed=!1,a.bzscroll=!1,a.scrollrunning=!1,0>f?f=0:f>a.page.maxh&&(f=Math.max(0,a.page.maxh)), +0>d?d=0:d>a.page.maxw&&(d=a.page.maxw),d!=a.newscrollx||f!=a.newscrolly?a.doScrollPos(d,f):a.onscrollend&&a.triggerScrollEnd()):a.timer=v(e)||1}c=void 0===c||!1===c?a.getScrollTop(!0):c;if(a.timer&&a.newscrolly==c&&a.newscrollx==b)return!0;a.timer&&w(a.timer);a.timer=0;var f=a.getScrollTop(),k=a.getScrollLeft();(0>(a.newscrolly-f)*(c-f)||0>(a.newscrollx-k)*(b-k))&&a.cancelScroll();a.newscrolly=c;a.newscrollx=b;a.bouncescroll&&a.rail.visibility||(0>a.newscrolly?a.newscrolly=0:a.newscrolly>a.page.maxh&& +(a.newscrolly=a.page.maxh));a.bouncescroll&&a.railh.visibility||(0>a.newscrollx?a.newscrollx=0:a.newscrollx>a.page.maxw&&(a.newscrollx=a.page.maxw));a.dst={};a.dst.x=b-k;a.dst.y=c-f;a.dst.px=k;a.dst.py=f;var h=Math.round(Math.sqrt(Math.pow(a.dst.x,2)+Math.pow(a.dst.y,2)));a.dst.ax=a.dst.x/h;a.dst.ay=a.dst.y/h;var l=0,n=h;0==a.dst.x?(l=f,n=c,a.dst.ay=1,a.dst.py=0):0==a.dst.y&&(l=k,n=b,a.dst.ax=1,a.dst.px=0);h=a.getTransitionSpeed(h);d&&1>=d&&(h*=d);a.bzscroll=0=a.page.maxh||k==a.page.maxw&&b>=a.page.maxw)&&a.checkContentSize();var p=1;a.cancelAnimationFrame=!1;a.timer=1;a.onscrollstart&&!a.scrollrunning&&a.onscrollstart.call(a,{type:"scrollstart",current:{x:k,y:f},request:{x:b,y:c},end:{x:a.newscrollx,y:a.newscrolly},speed:h});e();(f==a.page.maxh&&c>=f||k==a.page.maxw&&b>=k)&&a.checkContentSize();a.noticeCursor()}},this.cancelScroll=function(){a.timer&&w(a.timer);a.timer=0;a.bzscroll=!1;a.scrollrunning= +!1;return a}):(this.doScrollLeft=function(b,c){var d=a.getScrollTop();a.doScrollPos(b,d,c)},this.doScrollTop=function(b,c){var d=a.getScrollLeft();a.doScrollPos(d,b,c)},this.doScrollPos=function(b,c,d){var e=b>a.page.maxw?a.page.maxw:b;0>e&&(e=0);var f=c>a.page.maxh?a.page.maxh:c;0>f&&(f=0);a.synched("scroll",function(){a.setScrollTop(f);a.setScrollLeft(e)})},this.cancelScroll=function(){});this.doScrollBy=function(b,c){var d=0,d=c?Math.floor((a.scroll.y-b)*a.scrollratio.y):(a.timer?a.newscrolly: +a.getScrollTop(!0))-b;if(a.bouncescroll){var e=Math.round(a.view.h/2);d<-e?d=-e:d>a.page.maxh+e&&(d=a.page.maxh+e)}a.cursorfreezed=!1;e=a.getScrollTop(!0);if(0>d&&0>=e)return a.noticeCursor();if(d>a.page.maxh&&e>=a.page.maxh)return a.checkContentSize(),a.noticeCursor();a.doScrollTop(d)};this.doScrollLeftBy=function(b,c){var d=0,d=c?Math.floor((a.scroll.x-b)*a.scrollratio.x):(a.timer?a.newscrollx:a.getScrollLeft(!0))-b;if(a.bouncescroll){var e=Math.round(a.view.w/2);d<-e?d=-e:d>a.page.maxw+e&&(d=a.page.maxw+ +e)}a.cursorfreezed=!1;e=a.getScrollLeft(!0);if(0>d&&0>=e||d>a.page.maxw&&e>=a.page.maxw)return a.noticeCursor();a.doScrollLeft(d)};this.doScrollTo=function(b,c){a.cursorfreezed=!1;a.doScrollTop(b)};this.checkContentSize=function(){var b=a.getContentSize();b.h==a.page.h&&b.w==a.page.w||a.resize(!1,b)};a.onscroll=function(b){a.rail.drag||a.cursorfreezed||a.synched("scroll",function(){a.scroll.y=Math.round(a.getScrollTop()*(1/a.scrollratio.y));a.railh&&(a.scroll.x=Math.round(a.getScrollLeft()*(1/a.scrollratio.x))); +a.noticeCursor()})};a.bind(a.docscroll,"scroll",a.onscroll);this.doZoomIn=function(b){if(!a.zoomactive){a.zoomactive=!0;a.zoomrestore={style:{}};var c="position top left zIndex backgroundColor marginTop marginBottom marginLeft marginRight".split(" "),d=a.win[0].style,k;for(k in c){var h=c[k];a.zoomrestore.style[h]=void 0!==d[h]?d[h]:""}a.zoomrestore.style.width=a.win.css("width");a.zoomrestore.style.height=a.win.css("height");a.zoomrestore.padding={w:a.win.outerWidth()-a.win.width(),h:a.win.outerHeight()- +a.win.height()};e.isios4&&(a.zoomrestore.scrollTop=f(window).scrollTop(),f(window).scrollTop(0));a.win.css({position:e.isios4?"absolute":"fixed",top:0,left:0,zIndex:A+100,margin:0});c=a.win.css("backgroundColor");(""==c||/transparent|rgba\(0, 0, 0, 0\)|rgba\(0,0,0,0\)/.test(c))&&a.win.css("backgroundColor","#fff");a.rail.css({zIndex:A+101});a.zoom.css({zIndex:A+102});a.zoom.css("backgroundPosition","0px -18px");a.resizeZoom();a.onzoomin&&a.onzoomin.call(a);return a.cancelEvent(b)}};this.doZoomOut= +function(b){if(a.zoomactive)return a.zoomactive=!1,a.win.css("margin",""),a.win.css(a.zoomrestore.style),e.isios4&&f(window).scrollTop(a.zoomrestore.scrollTop),a.rail.css({"z-index":a.zindex}),a.zoom.css({"z-index":a.zindex}),a.zoomrestore=!1,a.zoom.css("backgroundPosition","0px 0px"),a.onResize(),a.onzoomout&&a.onzoomout.call(a),a.cancelEvent(b)};this.doZoom=function(b){return a.zoomactive?a.doZoomOut(b):a.doZoomIn(b)};this.resizeZoom=function(){if(a.zoomactive){var b=a.getScrollTop();a.win.css({width:f(window).width()- +a.zoomrestore.padding.w+"px",height:f(window).height()-a.zoomrestore.padding.h+"px"});a.onResize();a.setScrollTop(Math.min(a.page.maxh,b))}};this.init();f.nicescroll.push(this)},M=function(f){var c=this;this.nc=f;this.steptime=this.lasttime=this.speedy=this.speedx=this.lasty=this.lastx=0;this.snapy=this.snapx=!1;this.demuly=this.demulx=0;this.lastscrolly=this.lastscrollx=-1;this.timer=this.chky=this.chkx=0;this.time=function(){return+new Date};this.reset=function(f,h){c.stop();var d=c.time();c.steptime= +0;c.lasttime=d;c.speedx=0;c.speedy=0;c.lastx=f;c.lasty=h;c.lastscrollx=-1;c.lastscrolly=-1};this.update=function(f,h){var d=c.time();c.steptime=d-c.lasttime;c.lasttime=d;var d=h-c.lasty,q=f-c.lastx,t=c.nc.getScrollTop(),a=c.nc.getScrollLeft(),t=t+d,a=a+q;c.snapx=0>a||a>c.nc.page.maxw;c.snapy=0>t||t>c.nc.page.maxh;c.speedx=q;c.speedy=d;c.lastx=f;c.lasty=h};this.stop=function(){c.nc.unsynched("domomentum2d");c.timer&&clearTimeout(c.timer);c.timer=0;c.lastscrollx=-1;c.lastscrolly=-1};this.doSnapy=function(f, +h){var d=!1;0>h?(h=0,d=!0):h>c.nc.page.maxh&&(h=c.nc.page.maxh,d=!0);0>f?(f=0,d=!0):f>c.nc.page.maxw&&(f=c.nc.page.maxw,d=!0);d?c.nc.doScrollPos(f,h,c.nc.opt.snapbackspeed):c.nc.triggerScrollEnd()};this.doMomentum=function(f){var h=c.time(),d=f?h+f:c.lasttime;f=c.nc.getScrollLeft();var q=c.nc.getScrollTop(),t=c.nc.page.maxh,a=c.nc.page.maxw;c.speedx=0=h-d;if(0>q||q>t||0>f||f>a)d=!1;f=c.speedx&&d?c.speedx:!1;if(c.speedy&&d&&c.speedy|| +f){var r=Math.max(16,c.steptime);50p||p>a)&&(d=.1);c.speedy&&(e=Math.floor(c.lastscrolly-c.speedy*(1-c.demulxy)),c.lastscrolly=e,0>e||e>t)&&(d=.1);c.demulxy=Math.min(1,c.demulxy+ +d);c.nc.synched("domomentum2d",function(){c.speedx&&(c.nc.getScrollLeft(),c.chkx=p,c.nc.setScrollLeft(p));c.speedy&&(c.nc.getScrollTop(),c.chky=e,c.nc.setScrollTop(e));c.timer||(c.nc.hideCursor(),c.doSnapy(p,e))});1>c.demulxy?c.timer=setTimeout(v,r):(c.stop(),c.nc.hideCursor(),c.doSnapy(p,e))};v()}else c.doSnapy(c.nc.getScrollLeft(),c.nc.getScrollTop())}},y=f.fn.scrollTop;f.cssHooks.pageYOffset={get:function(h,c,k){return(c=f.data(h,"__nicescroll")||!1)&&c.ishwscroll?c.getScrollTop():y.call(h)},set:function(h, +c){var k=f.data(h,"__nicescroll")||!1;k&&k.ishwscroll?k.setScrollTop(parseInt(c)):y.call(h,c);return this}};f.fn.scrollTop=function(h){if(void 0===h){var c=this[0]?f.data(this[0],"__nicescroll")||!1:!1;return c&&c.ishwscroll?c.getScrollTop():y.call(this)}return this.each(function(){var c=f.data(this,"__nicescroll")||!1;c&&c.ishwscroll?c.setScrollTop(parseInt(h)):y.call(f(this),h)})};var z=f.fn.scrollLeft;f.cssHooks.pageXOffset={get:function(h,c,k){return(c=f.data(h,"__nicescroll")||!1)&&c.ishwscroll? +c.getScrollLeft():z.call(h)},set:function(h,c){var k=f.data(h,"__nicescroll")||!1;k&&k.ishwscroll?k.setScrollLeft(parseInt(c)):z.call(h,c);return this}};f.fn.scrollLeft=function(h){if(void 0===h){var c=this[0]?f.data(this[0],"__nicescroll")||!1:!1;return c&&c.ishwscroll?c.getScrollLeft():z.call(this)}return this.each(function(){var c=f.data(this,"__nicescroll")||!1;c&&c.ishwscroll?c.setScrollLeft(parseInt(h)):z.call(f(this),h)})};var E=function(h){var c=this;this.length=0;this.name="nicescrollarray"; +this.each=function(d){f.each(c,d);return c};this.push=function(d){c[c.length]=d;c.length++};this.eq=function(d){return c[d]};if(h)for(var k=0;k