\").append( jQuery.parseHTML( responseText ) ).find( selector ) :\n\n\t\t\t\t// Otherwise use the full result\n\t\t\t\tresponseText );\n\n\t\t}).complete( callback && function( jqXHR, status ) {\n\t\t\tself.each( callback, response || [ jqXHR.responseText, status, jqXHR ] );\n\t\t});\n\t}\n\n\treturn this;\n};\n\n\n\n\n// Attach a bunch of functions for handling common AJAX events\njQuery.each( [ \"ajaxStart\", \"ajaxStop\", \"ajaxComplete\", \"ajaxError\", \"ajaxSuccess\", \"ajaxSend\" ], function( i, type ) {\n\tjQuery.fn[ type ] = function( fn ) {\n\t\treturn this.on( type, fn );\n\t};\n});\n\n\n\n\njQuery.expr.filters.animated = function( elem ) {\n\treturn jQuery.grep(jQuery.timers, function( fn ) {\n\t\treturn elem === fn.elem;\n\t}).length;\n};\n\n\n\n\n\nvar docElem = window.document.documentElement;\n\n/**\n * Gets a window from an element\n */\nfunction getWindow( elem ) {\n\treturn jQuery.isWindow( elem ) ?\n\t\telem :\n\t\telem.nodeType === 9 ?\n\t\t\telem.defaultView || elem.parentWindow :\n\t\t\tfalse;\n}\n\njQuery.offset = {\n\tsetOffset: function( elem, options, i ) {\n\t\tvar curPosition, curLeft, curCSSTop, curTop, curOffset, curCSSLeft, calculatePosition,\n\t\t\tposition = jQuery.css( elem, \"position\" ),\n\t\t\tcurElem = jQuery( elem ),\n\t\t\tprops = {};\n\n\t\t// set position first, in-case top/left are set even on static elem\n\t\tif ( position === \"static\" ) {\n\t\t\telem.style.position = \"relative\";\n\t\t}\n\n\t\tcurOffset = curElem.offset();\n\t\tcurCSSTop = jQuery.css( elem, \"top\" );\n\t\tcurCSSLeft = jQuery.css( elem, \"left\" );\n\t\tcalculatePosition = ( position === \"absolute\" || position === \"fixed\" ) &&\n\t\t\tjQuery.inArray(\"auto\", [ curCSSTop, curCSSLeft ] ) > -1;\n\n\t\t// need to be able to calculate position if either top or left is auto and position is either absolute or fixed\n\t\tif ( calculatePosition ) {\n\t\t\tcurPosition = curElem.position();\n\t\t\tcurTop = curPosition.top;\n\t\t\tcurLeft = curPosition.left;\n\t\t} else {\n\t\t\tcurTop = parseFloat( curCSSTop ) || 0;\n\t\t\tcurLeft = parseFloat( curCSSLeft ) || 0;\n\t\t}\n\n\t\tif ( jQuery.isFunction( options ) ) {\n\t\t\toptions = options.call( elem, i, curOffset );\n\t\t}\n\n\t\tif ( options.top != null ) {\n\t\t\tprops.top = ( options.top - curOffset.top ) + curTop;\n\t\t}\n\t\tif ( options.left != null ) {\n\t\t\tprops.left = ( options.left - curOffset.left ) + curLeft;\n\t\t}\n\n\t\tif ( \"using\" in options ) {\n\t\t\toptions.using.call( elem, props );\n\t\t} else {\n\t\t\tcurElem.css( props );\n\t\t}\n\t}\n};\n\njQuery.fn.extend({\n\toffset: function( options ) {\n\t\tif ( arguments.length ) {\n\t\t\treturn options === undefined ?\n\t\t\t\tthis :\n\t\t\t\tthis.each(function( i ) {\n\t\t\t\t\tjQuery.offset.setOffset( this, options, i );\n\t\t\t\t});\n\t\t}\n\n\t\tvar docElem, win,\n\t\t\tbox = { top: 0, left: 0 },\n\t\t\telem = this[ 0 ],\n\t\t\tdoc = elem && elem.ownerDocument;\n\n\t\tif ( !doc ) {\n\t\t\treturn;\n\t\t}\n\n\t\tdocElem = doc.documentElement;\n\n\t\t// Make sure it's not a disconnected DOM node\n\t\tif ( !jQuery.contains( docElem, elem ) ) {\n\t\t\treturn box;\n\t\t}\n\n\t\t// If we don't have gBCR, just use 0,0 rather than error\n\t\t// BlackBerry 5, iOS 3 (original iPhone)\n\t\tif ( typeof elem.getBoundingClientRect !== strundefined ) {\n\t\t\tbox = elem.getBoundingClientRect();\n\t\t}\n\t\twin = getWindow( doc );\n\t\treturn {\n\t\t\ttop: box.top + ( win.pageYOffset || docElem.scrollTop ) - ( docElem.clientTop || 0 ),\n\t\t\tleft: box.left + ( win.pageXOffset || docElem.scrollLeft ) - ( docElem.clientLeft || 0 )\n\t\t};\n\t},\n\n\tposition: function() {\n\t\tif ( !this[ 0 ] ) {\n\t\t\treturn;\n\t\t}\n\n\t\tvar offsetParent, offset,\n\t\t\tparentOffset = { top: 0, left: 0 },\n\t\t\telem = this[ 0 ];\n\n\t\t// fixed elements are offset from window (parentOffset = {top:0, left: 0}, because it is its only offset parent\n\t\tif ( jQuery.css( elem, \"position\" ) === \"fixed\" ) {\n\t\t\t// we assume that getBoundingClientRect is available when computed position is fixed\n\t\t\toffset = elem.getBoundingClientRect();\n\t\t} else {\n\t\t\t// Get *real* offsetParent\n\t\t\toffsetParent = this.offsetParent();\n\n\t\t\t// Get correct offsets\n\t\t\toffset = this.offset();\n\t\t\tif ( !jQuery.nodeName( offsetParent[ 0 ], \"html\" ) ) {\n\t\t\t\tparentOffset = offsetParent.offset();\n\t\t\t}\n\n\t\t\t// Add offsetParent borders\n\t\t\tparentOffset.top += jQuery.css( offsetParent[ 0 ], \"borderTopWidth\", true );\n\t\t\tparentOffset.left += jQuery.css( offsetParent[ 0 ], \"borderLeftWidth\", true );\n\t\t}\n\n\t\t// Subtract parent offsets and element margins\n\t\t// note: when an element has margin: auto the offsetLeft and marginLeft\n\t\t// are the same in Safari causing offset.left to incorrectly be 0\n\t\treturn {\n\t\t\ttop: offset.top - parentOffset.top - jQuery.css( elem, \"marginTop\", true ),\n\t\t\tleft: offset.left - parentOffset.left - jQuery.css( elem, \"marginLeft\", true)\n\t\t};\n\t},\n\n\toffsetParent: function() {\n\t\treturn this.map(function() {\n\t\t\tvar offsetParent = this.offsetParent || docElem;\n\n\t\t\twhile ( offsetParent && ( !jQuery.nodeName( offsetParent, \"html\" ) && jQuery.css( offsetParent, \"position\" ) === \"static\" ) ) {\n\t\t\t\toffsetParent = offsetParent.offsetParent;\n\t\t\t}\n\t\t\treturn offsetParent || docElem;\n\t\t});\n\t}\n});\n\n// Create scrollLeft and scrollTop methods\njQuery.each( { scrollLeft: \"pageXOffset\", scrollTop: \"pageYOffset\" }, function( method, prop ) {\n\tvar top = /Y/.test( prop );\n\n\tjQuery.fn[ method ] = function( val ) {\n\t\treturn access( this, function( elem, method, val ) {\n\t\t\tvar win = getWindow( elem );\n\n\t\t\tif ( val === undefined ) {\n\t\t\t\treturn win ? (prop in win) ? win[ prop ] :\n\t\t\t\t\twin.document.documentElement[ method ] :\n\t\t\t\t\telem[ method ];\n\t\t\t}\n\n\t\t\tif ( win ) {\n\t\t\t\twin.scrollTo(\n\t\t\t\t\t!top ? val : jQuery( win ).scrollLeft(),\n\t\t\t\t\ttop ? val : jQuery( win ).scrollTop()\n\t\t\t\t);\n\n\t\t\t} else {\n\t\t\t\telem[ method ] = val;\n\t\t\t}\n\t\t}, method, val, arguments.length, null );\n\t};\n});\n\n// Add the top/left cssHooks using jQuery.fn.position\n// Webkit bug: https://bugs.webkit.org/show_bug.cgi?id=29084\n// getComputedStyle returns percent when specified for top/left/bottom/right\n// rather than make the css module depend on the offset module, we just check for it here\njQuery.each( [ \"top\", \"left\" ], function( i, prop ) {\n\tjQuery.cssHooks[ prop ] = addGetHookIf( support.pixelPosition,\n\t\tfunction( elem, computed ) {\n\t\t\tif ( computed ) {\n\t\t\t\tcomputed = curCSS( elem, prop );\n\t\t\t\t// if curCSS returns percentage, fallback to offset\n\t\t\t\treturn rnumnonpx.test( computed ) ?\n\t\t\t\t\tjQuery( elem ).position()[ prop ] + \"px\" :\n\t\t\t\t\tcomputed;\n\t\t\t}\n\t\t}\n\t);\n});\n\n\n// Create innerHeight, innerWidth, height, width, outerHeight and outerWidth methods\njQuery.each( { Height: \"height\", Width: \"width\" }, function( name, type ) {\n\tjQuery.each( { padding: \"inner\" + name, content: type, \"\": \"outer\" + name }, function( defaultExtra, funcName ) {\n\t\t// margin is only for outerHeight, outerWidth\n\t\tjQuery.fn[ funcName ] = function( margin, value ) {\n\t\t\tvar chainable = arguments.length && ( defaultExtra || typeof margin !== \"boolean\" ),\n\t\t\t\textra = defaultExtra || ( margin === true || value === true ? \"margin\" : \"border\" );\n\n\t\t\treturn access( this, function( elem, type, value ) {\n\t\t\t\tvar doc;\n\n\t\t\t\tif ( jQuery.isWindow( elem ) ) {\n\t\t\t\t\t// As of 5/8/2012 this will yield incorrect results for Mobile Safari, but there\n\t\t\t\t\t// isn't a whole lot we can do. See pull request at this URL for discussion:\n\t\t\t\t\t// https://github.com/jquery/jquery/pull/764\n\t\t\t\t\treturn elem.document.documentElement[ \"client\" + name ];\n\t\t\t\t}\n\n\t\t\t\t// Get document width or height\n\t\t\t\tif ( elem.nodeType === 9 ) {\n\t\t\t\t\tdoc = elem.documentElement;\n\n\t\t\t\t\t// Either scroll[Width/Height] or offset[Width/Height] or client[Width/Height], whichever is greatest\n\t\t\t\t\t// unfortunately, this causes bug #3838 in IE6/8 only, but there is currently no good, small way to fix it.\n\t\t\t\t\treturn Math.max(\n\t\t\t\t\t\telem.body[ \"scroll\" + name ], doc[ \"scroll\" + name ],\n\t\t\t\t\t\telem.body[ \"offset\" + name ], doc[ \"offset\" + name ],\n\t\t\t\t\t\tdoc[ \"client\" + name ]\n\t\t\t\t\t);\n\t\t\t\t}\n\n\t\t\t\treturn value === undefined ?\n\t\t\t\t\t// Get width or height on the element, requesting but not forcing parseFloat\n\t\t\t\t\tjQuery.css( elem, type, extra ) :\n\n\t\t\t\t\t// Set width or height on the element\n\t\t\t\t\tjQuery.style( elem, type, value, extra );\n\t\t\t}, type, chainable ? margin : undefined, chainable, null );\n\t\t};\n\t});\n});\n\n\n// The number of elements contained in the matched element set\njQuery.fn.size = function() {\n\treturn this.length;\n};\n\njQuery.fn.andSelf = jQuery.fn.addBack;\n\n\n\n\n// Register as a named AMD module, since jQuery can be concatenated with other\n// files that may use define, but not via a proper concatenation script that\n// understands anonymous AMD modules. A named AMD is safest and most robust\n// way to register. Lowercase jquery is used because AMD module names are\n// derived from file names, and jQuery is normally delivered in a lowercase\n// file name. Do this after creating the global so that if an AMD module wants\n// to call noConflict to hide this version of jQuery, it will work.\n\n// Note that for maximum portability, libraries that are not jQuery should\n// declare themselves as anonymous modules, and avoid setting a global if an\n// AMD loader is present. jQuery is a special case. For more information, see\n// https://github.com/jrburke/requirejs/wiki/Updating-existing-libraries#wiki-anon\n\nif ( typeof define === \"function\" && define.amd ) {\n\tdefine( \"jquery\", [], function() {\n\t\treturn jQuery;\n\t});\n}\n\n\n\n\nvar\n\t// Map over jQuery in case of overwrite\n\t_jQuery = window.jQuery,\n\n\t// Map over the $ in case of overwrite\n\t_$ = window.$;\n\njQuery.noConflict = function( deep ) {\n\tif ( window.$ === jQuery ) {\n\t\twindow.$ = _$;\n\t}\n\n\tif ( deep && window.jQuery === jQuery ) {\n\t\twindow.jQuery = _jQuery;\n\t}\n\n\treturn jQuery;\n};\n\n// Expose jQuery and $ identifiers, even in\n// AMD (#7102#comment:10, https://github.com/jquery/jquery/pull/557)\n// and CommonJS for browser emulators (#13566)\nif ( typeof noGlobal === strundefined ) {\n\twindow.jQuery = window.$ = jQuery;\n}\n\n\n\n\nreturn jQuery;\n\n}));\n","/*!\r\n * SmartMenus jQuery Plugin - v0.9.7 - August 25, 2014\r\n * http://www.smartmenus.org/\r\n *\r\n * Copyright 2014 Vasil Dinkov, Vadikom Web Ltd.\r\n * http://vadikom.com\r\n *\r\n * Licensed MIT\r\n */\r\n\r\n(function($) {\r\n\r\n\tvar menuTrees = [],\r\n\t\tIE = !!window.createPopup, // detect it for the iframe shim\r\n\t\tmouse = false, // optimize for touch by default - we will detect for mouse input\r\n\t\tmouseDetectionEnabled = false;\r\n\r\n\t// Handle detection for mouse input (i.e. desktop browsers, tablets with a mouse, etc.)\r\n\tfunction initMouseDetection(disable) {\r\n\t\tvar eNS = '.smartmenus_mouse';\r\n\t\tif (!mouseDetectionEnabled && !disable) {\r\n\t\t\t// if we get two consecutive mousemoves within 2 pixels from each other and within 300ms, we assume a real mouse/cursor is present\r\n\t\t\t// in practice, this seems like impossible to trick unintentianally with a real mouse and a pretty safe detection on touch devices (even with older browsers that do not support touch events)\r\n\t\t\tvar firstTime = true,\r\n\t\t\t\tlastMove = null;\r\n\t\t\t$(document).bind(getEventsNS([\r\n\t\t\t\t['mousemove', function(e) {\r\n\t\t\t\t\tvar thisMove = { x: e.pageX, y: e.pageY, timeStamp: new Date().getTime() };\r\n\t\t\t\t\tif (lastMove) {\r\n\t\t\t\t\t\tvar deltaX = Math.abs(lastMove.x - thisMove.x),\r\n\t\t\t\t\t\t\tdeltaY = Math.abs(lastMove.y - thisMove.y);\r\n\t \t\t\t\t\tif ((deltaX > 0 || deltaY > 0) && deltaX <= 2 && deltaY <= 2 && thisMove.timeStamp - lastMove.timeStamp <= 300) {\r\n\t\t\t\t\t\t\tmouse = true;\r\n\t\t\t\t\t\t\t// if this is the first check after page load, check if we are not over some item by chance and call the mouseenter handler if yes\r\n\t\t\t\t\t\t\tif (firstTime) {\r\n\t\t\t\t\t\t\t\tvar $a = $(e.target).closest('a');\r\n\t\t\t\t\t\t\t\tif ($a.is('a')) {\r\n\t\t\t\t\t\t\t\t\t$.each(menuTrees, function() {\r\n\t\t\t\t\t\t\t\t\t\tif ($.contains(this.$root[0], $a[0])) {\r\n\t\t\t\t\t\t\t\t\t\t\tthis.itemEnter({ currentTarget: $a[0] });\r\n\t\t\t\t\t\t\t\t\t\t\treturn false;\r\n\t\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t\t});\r\n\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\tfirstTime = false;\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t\tlastMove = thisMove;\r\n\t\t\t\t}],\r\n\t\t\t\t[touchEvents() ? 'touchstart' : 'pointerover pointermove pointerout MSPointerOver MSPointerMove MSPointerOut', function(e) {\r\n\t\t\t\t\tif (isTouchEvent(e.originalEvent)) {\r\n\t\t\t\t\t\tmouse = false;\r\n\t\t\t\t\t}\r\n\t\t\t\t}]\r\n\t\t\t], eNS));\r\n\t\t\tmouseDetectionEnabled = true;\r\n\t\t} else if (mouseDetectionEnabled && disable) {\r\n\t\t\t$(document).unbind(eNS);\r\n\t\t\tmouseDetectionEnabled = false;\r\n\t\t}\r\n\t}\r\n\r\n\tfunction isTouchEvent(e) {\r\n\t\treturn !/^(4|mouse)$/.test(e.pointerType);\r\n\t}\r\n\r\n\t// we use this just to choose between toucn and pointer events when we need to, not for touch screen detection\r\n\tfunction touchEvents() {\r\n\t\treturn 'ontouchstart' in window;\r\n\t}\r\n\r\n\t// returns a jQuery bind() ready object\r\n\tfunction getEventsNS(defArr, eNS) {\r\n\t\tif (!eNS) {\r\n\t\t\teNS = '';\r\n\t\t}\r\n\t\tvar obj = {};\r\n\t\t$.each(defArr, function(index, value) {\r\n\t\t\tobj[value[0].split(' ').join(eNS + ' ') + eNS] = value[1];\r\n\t\t});\r\n\t\treturn obj;\r\n\t}\r\n\r\n\t$.SmartMenus = function(elm, options) {\r\n\t\tthis.$root = $(elm);\r\n\t\tthis.opts = options;\r\n\t\tthis.rootId = ''; // internal\r\n\t\tthis.$subArrow = null;\r\n\t\tthis.subMenus = []; // all sub menus in the tree (UL elms) in no particular order (only real - e.g. UL's in mega sub menus won't be counted)\r\n\t\tthis.activatedItems = []; // stores last activated A's for each level\r\n\t\tthis.visibleSubMenus = []; // stores visible sub menus UL's\r\n\t\tthis.showTimeout = 0;\r\n\t\tthis.hideTimeout = 0;\r\n\t\tthis.scrollTimeout = 0;\r\n\t\tthis.clickActivated = false;\r\n\t\tthis.zIndexInc = 0;\r\n\t\tthis.$firstLink = null; // we'll use these for some tests\r\n\t\tthis.$firstSub = null; // at runtime so we'll cache them\r\n\t\tthis.disabled = false;\r\n\t\tthis.$disableOverlay = null;\r\n\t\tthis.isTouchScrolling = false;\r\n\t\tthis.init();\r\n\t};\r\n\r\n\t$.extend($.SmartMenus, {\r\n\t\thideAll: function() {\r\n\t\t\t$.each(menuTrees, function() {\r\n\t\t\t\tthis.menuHideAll();\r\n\t\t\t});\r\n\t\t},\r\n\t\tdestroy: function() {\r\n\t\t\twhile (menuTrees.length) {\r\n\t\t\t\tmenuTrees[0].destroy();\r\n\t\t\t}\r\n\t\t\tinitMouseDetection(true);\r\n\t\t},\r\n\t\tprototype: {\r\n\t\t\tinit: function(refresh) {\r\n\t\t\t\tvar self = this;\r\n\r\n\t\t\t\tif (!refresh) {\r\n\t\t\t\t\tmenuTrees.push(this);\r\n\r\n\t\t\t\t\tthis.rootId = (new Date().getTime() + Math.random() + '').replace(/\\D/g, '');\r\n\r\n\t\t\t\t\tif (this.$root.hasClass('sm-rtl')) {\r\n\t\t\t\t\t\tthis.opts.rightToLeftSubMenus = true;\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\t// init root (main menu)\r\n\t\t\t\t\tvar eNS = '.smartmenus';\r\n\t\t\t\t\tthis.$root\r\n\t\t\t\t\t\t.data('smartmenus', this)\r\n\t\t\t\t\t\t.attr('data-smartmenus-id', this.rootId)\r\n\t\t\t\t\t\t.dataSM('level', 1)\r\n\t\t\t\t\t\t.bind(getEventsNS([\r\n\t\t\t\t\t\t\t['mouseover focusin', $.proxy(this.rootOver, this)],\r\n\t\t\t\t\t\t\t['mouseout focusout', $.proxy(this.rootOut, this)]\r\n\t\t\t\t\t\t], eNS))\r\n\t\t\t\t\t\t.delegate('a', getEventsNS([\r\n\t\t\t\t\t\t\t['mouseenter', $.proxy(this.itemEnter, this)],\r\n\t\t\t\t\t\t\t['mouseleave', $.proxy(this.itemLeave, this)],\r\n\t\t\t\t\t\t\t['mousedown', $.proxy(this.itemDown, this)],\r\n\t\t\t\t\t\t\t['focus', $.proxy(this.itemFocus, this)],\r\n\t\t\t\t\t\t\t['blur', $.proxy(this.itemBlur, this)],\r\n\t\t\t\t\t\t\t['click', $.proxy(this.itemClick, this)],\r\n\t\t\t\t\t\t\t['touchend', $.proxy(this.itemTouchEnd, this)]\r\n\t\t\t\t\t\t], eNS));\r\n\r\n\t\t\t\t\t// hide menus on tap or click outside the root UL\r\n\t\t\t\t\teNS += this.rootId;\r\n\t\t\t\t\tif (this.opts.hideOnClick) {\r\n\t\t\t\t\t\t$(document).bind(getEventsNS([\r\n\t\t\t\t\t\t\t['touchstart', $.proxy(this.docTouchStart, this)],\r\n\t\t\t\t\t\t\t['touchmove', $.proxy(this.docTouchMove, this)],\r\n\t\t\t\t\t\t\t['touchend', $.proxy(this.docTouchEnd, this)],\r\n\t\t\t\t\t\t\t// for Opera Mobile < 11.5, webOS browser, etc. we'll check click too\r\n\t\t\t\t\t\t\t['click', $.proxy(this.docClick, this)]\r\n\t\t\t\t\t\t], eNS));\r\n\t\t\t\t\t}\r\n\t\t\t\t\t// hide sub menus on resize\r\n\t\t\t\t\t$(window).bind(getEventsNS([['resize orientationchange', $.proxy(this.winResize, this)]], eNS));\r\n\r\n\t\t\t\t\tif (this.opts.subIndicators) {\r\n\t\t\t\t\t\tthis.$subArrow = $('
').addClass('sub-arrow');\r\n\t\t\t\t\t\tif (this.opts.subIndicatorsText) {\r\n\t\t\t\t\t\t\tthis.$subArrow.html(this.opts.subIndicatorsText);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\t// make sure mouse detection is enabled\r\n\t\t\t\t\tinitMouseDetection();\r\n\t\t\t\t}\r\n\r\n\t\t\t\t// init sub menus\r\n\t\t\t\tthis.$firstSub = this.$root.find('ul').each(function() { self.menuInit($(this)); }).eq(0);\r\n\r\n\t\t\t\tthis.$firstLink = this.$root.find('a').eq(0);\r\n\r\n\t\t\t\t// find current item\r\n\t\t\t\tif (this.opts.markCurrentItem) {\r\n\t\t\t\t\tvar reDefaultDoc = /(index|default)\\.[^#\\?\\/]*/i,\r\n\t\t\t\t\t\treHash = /#.*/,\r\n\t\t\t\t\t\tlocHref = window.location.href.replace(reDefaultDoc, ''),\r\n\t\t\t\t\t\tlocHrefNoHash = locHref.replace(reHash, '');\r\n\t\t\t\t\tthis.$root.find('a').each(function() {\r\n\t\t\t\t\t\tvar href = this.href.replace(reDefaultDoc, ''),\r\n\t\t\t\t\t\t\t$this = $(this);\r\n\t\t\t\t\t\tif (href == locHref || href == locHrefNoHash) {\r\n\t\t\t\t\t\t\t$this.addClass('current');\r\n\t\t\t\t\t\t\tif (self.opts.markCurrentTree) {\r\n\t\t\t\t\t\t\t\t$this.parent().parentsUntil('[data-smartmenus-id]', 'li').children('a').addClass('current');\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t});\r\n\t\t\t\t}\r\n\t\t\t},\r\n\t\t\tdestroy: function() {\r\n\t\t\t\tthis.menuHideAll();\r\n\t\t\t\tvar eNS = '.smartmenus';\r\n\t\t\t\tthis.$root\r\n\t\t\t\t\t.removeData('smartmenus')\r\n\t\t\t\t\t.removeAttr('data-smartmenus-id')\r\n\t\t\t\t\t.removeDataSM('level')\r\n\t\t\t\t\t.unbind(eNS)\r\n\t\t\t\t\t.undelegate(eNS);\r\n\t\t\t\teNS += this.rootId;\r\n\t\t\t\t$(document).unbind(eNS);\r\n\t\t\t\t$(window).unbind(eNS);\r\n\t\t\t\tif (this.opts.subIndicators) {\r\n\t\t\t\t\tthis.$subArrow = null;\r\n\t\t\t\t}\r\n\t\t\t\tvar self = this;\r\n\t\t\t\t$.each(this.subMenus, function() {\r\n\t\t\t\t\tif (this.hasClass('mega-menu')) {\r\n\t\t\t\t\t\tthis.find('ul').removeDataSM('in-mega');\r\n\t\t\t\t\t}\r\n\t\t\t\t\tif (this.dataSM('shown-before')) {\r\n\t\t\t\t\t\tif (self.opts.subMenusMinWidth || self.opts.subMenusMaxWidth) {\r\n\t\t\t\t\t\t\tthis.css({ width: '', minWidth: '', maxWidth: '' }).removeClass('sm-nowrap');\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\tif (this.dataSM('scroll-arrows')) {\r\n\t\t\t\t\t\t\tthis.dataSM('scroll-arrows').remove();\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\tthis.css({ zIndex: '', top: '', left: '', marginLeft: '', marginTop: '', display: '' });\r\n\t\t\t\t\t}\r\n\t\t\t\t\tif (self.opts.subIndicators) {\r\n\t\t\t\t\t\tthis.dataSM('parent-a').removeClass('has-submenu').children('span.sub-arrow').remove();\r\n\t\t\t\t\t}\r\n\t\t\t\t\tthis.removeDataSM('shown-before')\r\n\t\t\t\t\t\t.removeDataSM('ie-shim')\r\n\t\t\t\t\t\t.removeDataSM('scroll-arrows')\r\n\t\t\t\t\t\t.removeDataSM('parent-a')\r\n\t\t\t\t\t\t.removeDataSM('level')\r\n\t\t\t\t\t\t.removeDataSM('beforefirstshowfired')\r\n\t\t\t\t\t\t.parent().removeDataSM('sub');\r\n\t\t\t\t});\r\n\t\t\t\tif (this.opts.markCurrentItem) {\r\n\t\t\t\t\tthis.$root.find('a.current').removeClass('current');\r\n\t\t\t\t}\r\n\t\t\t\tthis.$root = null;\r\n\t\t\t\tthis.$firstLink = null;\r\n\t\t\t\tthis.$firstSub = null;\r\n\t\t\t\tif (this.$disableOverlay) {\r\n\t\t\t\t\tthis.$disableOverlay.remove();\r\n\t\t\t\t\tthis.$disableOverlay = null;\r\n\t\t\t\t}\r\n\t\t\t\tmenuTrees.splice($.inArray(this, menuTrees), 1);\r\n\t\t\t},\r\n\t\t\tdisable: function(noOverlay) {\r\n\t\t\t\tif (!this.disabled) {\r\n\t\t\t\t\tthis.menuHideAll();\r\n\t\t\t\t\t// display overlay over the menu to prevent interaction\r\n\t\t\t\t\tif (!noOverlay && !this.opts.isPopup && this.$root.is(':visible')) {\r\n\t\t\t\t\t\tvar pos = this.$root.offset();\r\n\t\t\t\t\t\tthis.$disableOverlay = $('
').css({\r\n\t\t\t\t\t\t\tposition: 'absolute',\r\n\t\t\t\t\t\t\ttop: pos.top,\r\n\t\t\t\t\t\t\tleft: pos.left,\r\n\t\t\t\t\t\t\twidth: this.$root.outerWidth(),\r\n\t\t\t\t\t\t\theight: this.$root.outerHeight(),\r\n\t\t\t\t\t\t\tzIndex: this.getStartZIndex(true),\r\n\t\t\t\t\t\t\topacity: 0\r\n\t\t\t\t\t\t}).appendTo(document.body);\r\n\t\t\t\t\t}\r\n\t\t\t\t\tthis.disabled = true;\r\n\t\t\t\t}\r\n\t\t\t},\r\n\t\t\tdocClick: function(e) {\r\n\t\t\t\tif (this.isTouchScrolling) {\r\n\t\t\t\t\tthis.isTouchScrolling = false;\r\n\t\t\t\t\treturn;\r\n\t\t\t\t}\r\n\t\t\t\t// hide on any click outside the menu or on a menu link\r\n\t\t\t\tif (this.visibleSubMenus.length && !$.contains(this.$root[0], e.target) || $(e.target).is('a')) {\r\n\t\t\t\t\tthis.menuHideAll();\r\n\t\t\t\t}\r\n\t\t\t},\r\n\t\t\tdocTouchEnd: function(e) {\r\n\t\t\t\tif (!this.lastTouch) {\r\n\t\t\t\t\treturn;\r\n\t\t\t\t}\r\n\t\t\t\tif (this.visibleSubMenus.length && (this.lastTouch.x2 === undefined || this.lastTouch.x1 == this.lastTouch.x2) && (this.lastTouch.y2 === undefined || this.lastTouch.y1 == this.lastTouch.y2) && (!this.lastTouch.target || !$.contains(this.$root[0], this.lastTouch.target))) {\r\n\t\t\t\t\tif (this.hideTimeout) {\r\n\t\t\t\t\t\tclearTimeout(this.hideTimeout);\r\n\t\t\t\t\t\tthis.hideTimeout = 0;\r\n\t\t\t\t\t}\r\n\t\t\t\t\t// hide with a delay to prevent triggering accidental unwanted click on some page element\r\n\t\t\t\t\tvar self = this;\r\n\t\t\t\t\tthis.hideTimeout = setTimeout(function() { self.menuHideAll(); }, 350);\r\n\t\t\t\t}\r\n\t\t\t\tthis.lastTouch = null;\r\n\t\t\t},\r\n\t\t\tdocTouchMove: function(e) {\r\n\t\t\t\tif (!this.lastTouch) {\r\n\t\t\t\t\treturn;\r\n\t\t\t\t}\r\n\t\t\t\tvar touchPoint = e.originalEvent.touches[0];\r\n\t\t\t\tthis.lastTouch.x2 = touchPoint.pageX;\r\n\t\t\t\tthis.lastTouch.y2 = touchPoint.pageY;\r\n\t\t\t},\r\n\t\t\tdocTouchStart: function(e) {\r\n\t\t\t\tvar touchPoint = e.originalEvent.touches[0];\r\n\t\t\t\tthis.lastTouch = { x1: touchPoint.pageX, y1: touchPoint.pageY, target: touchPoint.target };\r\n\t\t\t},\r\n\t\t\tenable: function() {\r\n\t\t\t\tif (this.disabled) {\r\n\t\t\t\t\tif (this.$disableOverlay) {\r\n\t\t\t\t\t\tthis.$disableOverlay.remove();\r\n\t\t\t\t\t\tthis.$disableOverlay = null;\r\n\t\t\t\t\t}\r\n\t\t\t\t\tthis.disabled = false;\r\n\t\t\t\t}\r\n\t\t\t},\r\n\t\t\tgetClosestMenu: function(elm) {\r\n\t\t\t\tvar $closestMenu = $(elm).closest('ul');\r\n\t\t\t\twhile ($closestMenu.dataSM('in-mega')) {\r\n\t\t\t\t\t$closestMenu = $closestMenu.parent().closest('ul');\r\n\t\t\t\t}\r\n\t\t\t\treturn $closestMenu[0] || null;\r\n\t\t\t},\r\n\t\t\tgetHeight: function($elm) {\r\n\t\t\t\treturn this.getOffset($elm, true);\r\n\t\t\t},\r\n\t\t\t// returns precise width/height float values\r\n\t\t\tgetOffset: function($elm, height) {\r\n\t\t\t\tvar old;\r\n\t\t\t\tif ($elm.css('display') == 'none') {\r\n\t\t\t\t\told = { position: $elm[0].style.position, visibility: $elm[0].style.visibility };\r\n\t\t\t\t\t$elm.css({ position: 'absolute', visibility: 'hidden' }).show();\r\n\t\t\t\t}\r\n\t\t\t\tvar box = $elm[0].getBoundingClientRect && $elm[0].getBoundingClientRect(),\r\n\t\t\t\t\tval = box && (height ? box.height || box.bottom - box.top : box.width || box.right - box.left);\r\n\t\t\t\tif (!val && val !== 0) {\r\n\t\t\t\t\tval = height ? $elm[0].offsetHeight : $elm[0].offsetWidth;\r\n\t\t\t\t}\r\n\t\t\t\tif (old) {\r\n\t\t\t\t\t$elm.hide().css(old);\r\n\t\t\t\t}\r\n\t\t\t\treturn val;\r\n\t\t\t},\r\n\t\t\tgetStartZIndex: function(root) {\r\n\t\t\t\tvar zIndex = parseInt(this[root ? '$root' : '$firstSub'].css('z-index'));\r\n\t\t\t\tif (!root && isNaN(zIndex)) {\r\n\t\t\t\t\tzIndex = parseInt(this.$root.css('z-index'));\r\n\t\t\t\t}\r\n\t\t\t\treturn !isNaN(zIndex) ? zIndex : 1;\r\n\t\t\t},\r\n\t\t\tgetTouchPoint: function(e) {\r\n\t\t\t\treturn e.touches && e.touches[0] || e.changedTouches && e.changedTouches[0] || e;\r\n\t\t\t},\r\n\t\t\tgetViewport: function(height) {\r\n\t\t\t\tvar name = height ? 'Height' : 'Width',\r\n\t\t\t\t\tval = document.documentElement['client' + name],\r\n\t\t\t\t\tval2 = window['inner' + name];\r\n\t\t\t\tif (val2) {\r\n\t\t\t\t\tval = Math.min(val, val2);\r\n\t\t\t\t}\r\n\t\t\t\treturn val;\r\n\t\t\t},\r\n\t\t\tgetViewportHeight: function() {\r\n\t\t\t\treturn this.getViewport(true);\r\n\t\t\t},\r\n\t\t\tgetViewportWidth: function() {\r\n\t\t\t\treturn this.getViewport();\r\n\t\t\t},\r\n\t\t\tgetWidth: function($elm) {\r\n\t\t\t\treturn this.getOffset($elm);\r\n\t\t\t},\r\n\t\t\thandleEvents: function() {\r\n\t\t\t\treturn !this.disabled && this.isCSSOn();\r\n\t\t\t},\r\n\t\t\thandleItemEvents: function($a) {\r\n\t\t\t\treturn this.handleEvents() && !this.isLinkInMegaMenu($a);\r\n\t\t\t},\r\n\t\t\tisCollapsible: function() {\r\n\t\t\t\treturn this.$firstSub.css('position') == 'static';\r\n\t\t\t},\r\n\t\t\tisCSSOn: function() {\r\n\t\t\t\treturn this.$firstLink.css('display') == 'block';\r\n\t\t\t},\r\n\t\t\tisFixed: function() {\r\n\t\t\t\tvar isFixed = this.$root.css('position') == 'fixed';\r\n\t\t\t\tif (!isFixed) {\r\n\t\t\t\t\tthis.$root.parentsUntil('body').each(function() {\r\n\t\t\t\t\t\tif ($(this).css('position') == 'fixed') {\r\n\t\t\t\t\t\t\tisFixed = true;\r\n\t\t\t\t\t\t\treturn false;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t});\r\n\t\t\t\t}\r\n\t\t\t\treturn isFixed;\r\n\t\t\t},\r\n\t\t\tisLinkInMegaMenu: function($a) {\r\n\t\t\t\treturn !$a.parent().parent().dataSM('level');\r\n\t\t\t},\r\n\t\t\tisTouchMode: function() {\r\n\t\t\t\treturn !mouse || this.isCollapsible();\r\n\t\t\t},\r\n\t\t\titemActivate: function($a) {\r\n\t\t\t\tvar $li = $a.parent(),\r\n\t\t\t\t\t$ul = $li.parent(),\r\n\t\t\t\t\tlevel = $ul.dataSM('level');\r\n\t\t\t\t// if for some reason the parent item is not activated (e.g. this is an API call to activate the item), activate all parent items first\r\n\t\t\t\tif (level > 1 && (!this.activatedItems[level - 2] || this.activatedItems[level - 2][0] != $ul.dataSM('parent-a')[0])) {\r\n\t\t\t\t\tvar self = this;\r\n\t\t\t\t\t$($ul.parentsUntil('[data-smartmenus-id]', 'ul').get().reverse()).add($ul).each(function() {\r\n\t\t\t\t\t\tself.itemActivate($(this).dataSM('parent-a'));\r\n\t\t\t\t\t});\r\n\t\t\t\t}\r\n\t\t\t\t// hide any visible deeper level sub menus\r\n\t\t\t\tif (this.visibleSubMenus.length > level) {\r\n\t\t\t\t\tthis.menuHideSubMenus(!this.activatedItems[level - 1] || this.activatedItems[level - 1][0] != $a[0] ? level - 1 : level);\r\n\t\t\t\t}\r\n\t\t\t\t// save new active item and sub menu for this level\r\n\t\t\t\tthis.activatedItems[level - 1] = $a;\r\n\t\t\t\tthis.visibleSubMenus[level - 1] = $ul;\r\n\t\t\t\tif (this.$root.triggerHandler('activate.smapi', $a[0]) === false) {\r\n\t\t\t\t\treturn;\r\n\t\t\t\t}\r\n\t\t\t\t// show the sub menu if this item has one\r\n\t\t\t\tvar $sub = $li.dataSM('sub');\r\n\t\t\t\tif ($sub && (this.isTouchMode() || (!this.opts.showOnClick || this.clickActivated))) {\r\n\t\t\t\t\tthis.menuShow($sub);\r\n\t\t\t\t}\r\n\t\t\t},\r\n\t\t\titemBlur: function(e) {\r\n\t\t\t\tvar $a = $(e.currentTarget);\r\n\t\t\t\tif (!this.handleItemEvents($a)) {\r\n\t\t\t\t\treturn;\r\n\t\t\t\t}\r\n\t\t\t\tthis.$root.triggerHandler('blur.smapi', $a[0]);\r\n\t\t\t},\r\n\t\t\titemClick: function(e) {\r\n\t\t\t\tif (this.isTouchScrolling) {\r\n\t\t\t\t\tthis.isTouchScrolling = false;\r\n\t\t\t\t\te.stopPropagation();\r\n\t\t\t\t\treturn false;\r\n\t\t\t\t}\r\n\t\t\t\tvar $a = $(e.currentTarget);\r\n\t\t\t\tif (!this.handleItemEvents($a)) {\r\n\t\t\t\t\treturn;\r\n\t\t\t\t}\r\n\t\t\t\t$a.removeDataSM('mousedown');\r\n\t\t\t\tif (this.$root.triggerHandler('click.smapi', $a[0]) === false) {\r\n\t\t\t\t\treturn false;\r\n\t\t\t\t}\r\n\t\t\t\tvar $sub = $a.parent().dataSM('sub');\r\n\t\t\t\tif (this.isTouchMode()) {\r\n\t\t\t\t\t// undo fix: prevent the address bar on iPhone from sliding down when expanding a sub menu\r\n\t\t\t\t\tif ($a.dataSM('href')) {\r\n\t\t\t\t\t\t$a.attr('href', $a.dataSM('href')).removeDataSM('href');\r\n\t\t\t\t\t}\r\n\t\t\t\t\t// if the sub is not visible\r\n\t\t\t\t\tif ($sub && (!$sub.dataSM('shown-before') || !$sub.is(':visible'))) {\r\n\t\t\t\t\t\t// try to activate the item and show the sub\r\n\t\t\t\t\t\tthis.itemActivate($a);\r\n\t\t\t\t\t\t// if \"itemActivate\" showed the sub, prevent the click so that the link is not loaded\r\n\t\t\t\t\t\t// if it couldn't show it, then the sub menus are disabled with an !important declaration (e.g. via mobile styles) so let the link get loaded\r\n\t\t\t\t\t\tif ($sub.is(':visible')) {\r\n\t\t\t\t\t\t\treturn false;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t} else if (this.opts.showOnClick && $a.parent().parent().dataSM('level') == 1 && $sub) {\r\n\t\t\t\t\tthis.clickActivated = true;\r\n\t\t\t\t\tthis.menuShow($sub);\r\n\t\t\t\t\treturn false;\r\n\t\t\t\t}\r\n\t\t\t\tif ($a.hasClass('disabled')) {\r\n\t\t\t\t\treturn false;\r\n\t\t\t\t}\r\n\t\t\t\tif (this.$root.triggerHandler('select.smapi', $a[0]) === false) {\r\n\t\t\t\t\treturn false;\r\n\t\t\t\t}\r\n\t\t\t},\r\n\t\t\titemDown: function(e) {\r\n\t\t\t\tvar $a = $(e.currentTarget);\r\n\t\t\t\tif (!this.handleItemEvents($a)) {\r\n\t\t\t\t\treturn;\r\n\t\t\t\t}\r\n\t\t\t\t$a.dataSM('mousedown', true);\r\n\t\t\t},\r\n\t\t\titemEnter: function(e) {\r\n\t\t\t\tvar $a = $(e.currentTarget);\r\n\t\t\t\tif (!this.handleItemEvents($a)) {\r\n\t\t\t\t\treturn;\r\n\t\t\t\t}\r\n\t\t\t\tif (!this.isTouchMode()) {\r\n\t\t\t\t\tif (this.showTimeout) {\r\n\t\t\t\t\t\tclearTimeout(this.showTimeout);\r\n\t\t\t\t\t\tthis.showTimeout = 0;\r\n\t\t\t\t\t}\r\n\t\t\t\t\tvar self = this;\r\n\t\t\t\t\tthis.showTimeout = setTimeout(function() { self.itemActivate($a); }, this.opts.showOnClick && $a.parent().parent().dataSM('level') == 1 ? 1 : this.opts.showTimeout);\r\n\t\t\t\t}\r\n\t\t\t\tthis.$root.triggerHandler('mouseenter.smapi', $a[0]);\r\n\t\t\t},\r\n\t\t\titemFocus: function(e) {\r\n\t\t\t\tvar $a = $(e.currentTarget);\r\n\t\t\t\tif (!this.handleItemEvents($a)) {\r\n\t\t\t\t\treturn;\r\n\t\t\t\t}\r\n\t\t\t\t// fix (the mousedown check): in some browsers a tap/click produces consecutive focus + click events so we don't need to activate the item on focus\r\n\t\t\t\tif ((!this.isTouchMode() || !$a.dataSM('mousedown')) && (!this.activatedItems.length || this.activatedItems[this.activatedItems.length - 1][0] != $a[0])) {\r\n\t\t\t\t\tthis.itemActivate($a);\r\n\t\t\t\t}\r\n\t\t\t\tthis.$root.triggerHandler('focus.smapi', $a[0]);\r\n\t\t\t},\r\n\t\t\titemLeave: function(e) {\r\n\t\t\t\tvar $a = $(e.currentTarget);\r\n\t\t\t\tif (!this.handleItemEvents($a)) {\r\n\t\t\t\t\treturn;\r\n\t\t\t\t}\r\n\t\t\t\tif (!this.isTouchMode()) {\r\n\t\t\t\t\tif ($a[0].blur) {\r\n\t\t\t\t\t\t$a[0].blur();\r\n\t\t\t\t\t}\r\n\t\t\t\t\tif (this.showTimeout) {\r\n\t\t\t\t\t\tclearTimeout(this.showTimeout);\r\n\t\t\t\t\t\tthis.showTimeout = 0;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\t$a.removeDataSM('mousedown');\r\n\t\t\t\tthis.$root.triggerHandler('mouseleave.smapi', $a[0]);\r\n\t\t\t},\r\n\t\t\titemTouchEnd: function(e) {\r\n\t\t\t\tvar $a = $(e.currentTarget);\r\n\t\t\t\tif (!this.handleItemEvents($a)) {\r\n\t\t\t\t\treturn;\r\n\t\t\t\t}\r\n\t\t\t\t// prevent the address bar on iPhone from sliding down when expanding a sub menu\r\n\t\t\t\tvar $sub = $a.parent().dataSM('sub');\r\n\t\t\t\tif ($a.attr('href').charAt(0) !== '#' && $sub && (!$sub.dataSM('shown-before') || !$sub.is(':visible'))) {\r\n\t\t\t\t\t$a.dataSM('href', $a.attr('href'));\r\n\t\t\t\t\t$a.attr('href', '#');\r\n\t\t\t\t}\r\n\t\t\t},\r\n\t\t\tmenuFixLayout: function($ul) {\r\n\t\t\t\t// fixes a menu that is being shown for the first time\r\n\t\t\t\tif (!$ul.dataSM('shown-before')) {\r\n\t\t\t\t\t$ul.hide().dataSM('shown-before', true);\r\n\t\t\t\t}\r\n\t\t\t},\r\n\t\t\tmenuHide: function($sub) {\r\n\t\t\t\tif (this.$root.triggerHandler('beforehide.smapi', $sub[0]) === false) {\r\n\t\t\t\t\treturn;\r\n\t\t\t\t}\r\n\t\t\t\t$sub.stop(true, true);\r\n\t\t\t\tif ($sub.is(':visible')) {\r\n\t\t\t\t\tvar complete = function() {\r\n\t\t\t\t\t\t// unset z-index\r\n\t\t\t\t\t\t$sub.css('z-index', '');\r\n\t\t\t\t\t};\r\n\t\t\t\t\t// if sub is collapsible (mobile view)\r\n\t\t\t\t\tif (this.isCollapsible()) {\r\n\t\t\t\t\t\tif (this.opts.collapsibleHideFunction) {\r\n\t\t\t\t\t\t\tthis.opts.collapsibleHideFunction.call(this, $sub, complete);\r\n\t\t\t\t\t\t} else {\r\n\t\t\t\t\t\t\t$sub.hide(this.opts.collapsibleHideDuration, complete);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t} else {\r\n\t\t\t\t\t\tif (this.opts.hideFunction) {\r\n\t\t\t\t\t\t\tthis.opts.hideFunction.call(this, $sub, complete);\r\n\t\t\t\t\t\t} else {\r\n\t\t\t\t\t\t\t$sub.hide(this.opts.hideDuration, complete);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t\t// remove IE iframe shim\r\n\t\t\t\t\tif ($sub.dataSM('ie-shim')) {\r\n\t\t\t\t\t\t$sub.dataSM('ie-shim').remove();\r\n\t\t\t\t\t}\r\n\t\t\t\t\t// deactivate scrolling if it is activated for this sub\r\n\t\t\t\t\tif ($sub.dataSM('scroll')) {\r\n\t\t\t\t\t\tthis.menuScrollStop($sub);\r\n\t\t\t\t\t\t$sub.css({ 'touch-action': '', '-ms-touch-action': '' })\r\n\t\t\t\t\t\t\t.unbind('.smartmenus_scroll').removeDataSM('scroll').dataSM('scroll-arrows').hide();\r\n\t\t\t\t\t}\r\n\t\t\t\t\t// unhighlight parent item\r\n\t\t\t\t\t$sub.dataSM('parent-a').removeClass('highlighted');\r\n\t\t\t\t\tvar level = $sub.dataSM('level');\r\n\t\t\t\t\tthis.activatedItems.splice(level - 1, 1);\r\n\t\t\t\t\tthis.visibleSubMenus.splice(level - 1, 1);\r\n\t\t\t\t\tthis.$root.triggerHandler('hide.smapi', $sub[0]);\r\n\t\t\t\t}\r\n\t\t\t},\r\n\t\t\tmenuHideAll: function() {\r\n\t\t\t\tif (this.showTimeout) {\r\n\t\t\t\t\tclearTimeout(this.showTimeout);\r\n\t\t\t\t\tthis.showTimeout = 0;\r\n\t\t\t\t}\r\n\t\t\t\t// hide all subs\r\n\t\t\t\tthis.menuHideSubMenus();\r\n\t\t\t\t// hide root if it's popup\r\n\t\t\t\tif (this.opts.isPopup) {\r\n\t\t\t\t\tthis.$root.stop(true, true);\r\n\t\t\t\t\tif (this.$root.is(':visible')) {\r\n\t\t\t\t\t\tif (this.opts.hideFunction) {\r\n\t\t\t\t\t\t\tthis.opts.hideFunction.call(this, this.$root);\r\n\t\t\t\t\t\t} else {\r\n\t\t\t\t\t\t\tthis.$root.hide(this.opts.hideDuration);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\t// remove IE iframe shim\r\n\t\t\t\t\t\tif (this.$root.dataSM('ie-shim')) {\r\n\t\t\t\t\t\t\tthis.$root.dataSM('ie-shim').remove();\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\tthis.activatedItems = [];\r\n\t\t\t\tthis.visibleSubMenus = [];\r\n\t\t\t\tthis.clickActivated = false;\r\n\t\t\t\t// reset z-index increment\r\n\t\t\t\tthis.zIndexInc = 0;\r\n\t\t\t},\r\n\t\t\tmenuHideSubMenus: function(level) {\r\n\t\t\t\tif (!level)\r\n\t\t\t\t\tlevel = 0;\r\n\t\t\t\tfor (var i = this.visibleSubMenus.length - 1; i > level; i--) {\r\n\t\t\t\t\tthis.menuHide(this.visibleSubMenus[i]);\r\n\t\t\t\t}\r\n\t\t\t},\r\n\t\t\tmenuIframeShim: function($ul) {\r\n\t\t\t\t// create iframe shim for the menu\r\n\t\t\t\tif (IE && this.opts.overlapControlsInIE && !$ul.dataSM('ie-shim')) {\r\n\t\t\t\t\t$ul.dataSM('ie-shim', $('
').attr({ src: 'javascript:0', tabindex: -9 })\r\n\t\t\t\t\t\t.css({ position: 'absolute', top: 'auto', left: '0', opacity: 0, border: '0' })\r\n\t\t\t\t\t);\r\n\t\t\t\t}\r\n\t\t\t},\r\n\t\t\tmenuInit: function($ul) {\r\n\t\t\t\tif (!$ul.dataSM('in-mega')) {\r\n\t\t\t\t\tthis.subMenus.push($ul);\r\n\t\t\t\t\t// mark UL's in mega drop downs (if any) so we can neglect them\r\n\t\t\t\t\tif ($ul.hasClass('mega-menu')) {\r\n\t\t\t\t\t\t$ul.find('ul').dataSM('in-mega', true);\r\n\t\t\t\t\t}\r\n\t\t\t\t\t// get level (much faster than, for example, using parentsUntil)\r\n\t\t\t\t\tvar level = 2,\r\n\t\t\t\t\t\tpar = $ul[0];\r\n\t\t\t\t\twhile ((par = par.parentNode.parentNode) != this.$root[0]) {\r\n\t\t\t\t\t\tlevel++;\r\n\t\t\t\t\t}\r\n\t\t\t\t\t// cache stuff\r\n\t\t\t\t\t$ul.dataSM('parent-a', $ul.prevAll('a').eq(-1))\r\n\t\t\t\t\t\t.dataSM('level', level)\r\n\t\t\t\t\t\t.parent().dataSM('sub', $ul);\r\n\t\t\t\t\t// add sub indicator to parent item\r\n\t\t\t\t\tif (this.opts.subIndicators) {\r\n\t\t\t\t\t\t$ul.dataSM('parent-a').addClass('has-submenu')[this.opts.subIndicatorsPos](this.$subArrow.clone());\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t},\r\n\t\t\tmenuPosition: function($sub) {\r\n\t\t\t\tvar $a = $sub.dataSM('parent-a'),\r\n\t\t\t\t\t$ul = $sub.parent().parent(),\r\n\t\t\t\t\tlevel = $sub.dataSM('level'),\r\n\t\t\t\t\tsubW = this.getWidth($sub),\r\n\t\t\t\t\tsubH = this.getHeight($sub),\r\n\t\t\t\t\titemOffset = $a.offset(),\r\n\t\t\t\t\titemX = itemOffset.left,\r\n\t\t\t\t\titemY = itemOffset.top,\r\n\t\t\t\t\titemW = this.getWidth($a),\r\n\t\t\t\t\titemH = this.getHeight($a),\r\n\t\t\t\t\t$win = $(window),\r\n\t\t\t\t\twinX = $win.scrollLeft(),\r\n\t\t\t\t\twinY = $win.scrollTop(),\r\n\t\t\t\t\twinW = this.getViewportWidth(),\r\n\t\t\t\t\twinH = this.getViewportHeight(),\r\n\t\t\t\t\thorizontalParent = $ul.hasClass('sm') && !$ul.hasClass('sm-vertical'),\r\n\t\t\t\t\tsubOffsetX = level == 2 ? this.opts.mainMenuSubOffsetX : this.opts.subMenusSubOffsetX,\r\n\t\t\t\t\tsubOffsetY = level == 2 ? this.opts.mainMenuSubOffsetY : this.opts.subMenusSubOffsetY,\r\n\t\t\t\t\tx, y;\r\n\t\t\t\tif (horizontalParent) {\r\n\t\t\t\t\tx = this.opts.rightToLeftSubMenus ? itemW - subW - subOffsetX : subOffsetX;\r\n\t\t\t\t\ty = this.opts.bottomToTopSubMenus ? -subH - subOffsetY : itemH + subOffsetY;\r\n\t\t\t\t} else {\r\n\t\t\t\t\tx = this.opts.rightToLeftSubMenus ? subOffsetX - subW : itemW - subOffsetX;\r\n\t\t\t\t\ty = this.opts.bottomToTopSubMenus ? itemH - subOffsetY - subH : subOffsetY;\r\n\t\t\t\t}\r\n\t\t\t\tif (this.opts.keepInViewport && !this.isCollapsible()) {\r\n\t\t\t\t\tvar absX = itemX + x,\r\n\t\t\t\t\t\tabsY = itemY + y;\r\n\t\t\t\t\tif (this.opts.rightToLeftSubMenus && absX < winX) {\r\n\t\t\t\t\t\tx = horizontalParent ? winX - absX + x : itemW - subOffsetX;\r\n\t\t\t\t\t} else if (!this.opts.rightToLeftSubMenus && absX + subW > winX + winW) {\r\n\t\t\t\t\t\tx = horizontalParent ? winX + winW - subW - absX + x : subOffsetX - subW;\r\n\t\t\t\t\t}\r\n\t\t\t\t\tif (!horizontalParent) {\r\n\t\t\t\t\t\tif (subH < winH && absY + subH > winY + winH) {\r\n\t\t\t\t\t\t\ty += winY + winH - subH - absY;\r\n\t\t\t\t\t\t} else if (subH >= winH || absY < winY) {\r\n\t\t\t\t\t\t\ty += winY - absY;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t\t// do we need scrolling?\r\n\t\t\t\t\t// 0.49 used for better precision when dealing with float values\r\n\t\t\t\t\tif (horizontalParent && (absY + subH > winY + winH + 0.49 || absY < winY) || !horizontalParent && subH > winH + 0.49) {\r\n\t\t\t\t\t\tvar self = this;\r\n\t\t\t\t\t\tif (!$sub.dataSM('scroll-arrows')) {\r\n\t\t\t\t\t\t\t$sub.dataSM('scroll-arrows', $([$('
')[0], $('
')[0]])\r\n\t\t\t\t\t\t\t\t.bind({\r\n\t\t\t\t\t\t\t\t\tmouseenter: function() {\r\n\t\t\t\t\t\t\t\t\t\t$sub.dataSM('scroll').up = $(this).hasClass('scroll-up');\r\n\t\t\t\t\t\t\t\t\t\tself.menuScroll($sub);\r\n\t\t\t\t\t\t\t\t\t},\r\n\t\t\t\t\t\t\t\t\tmouseleave: function(e) {\r\n\t\t\t\t\t\t\t\t\t\tself.menuScrollStop($sub);\r\n\t\t\t\t\t\t\t\t\t\tself.menuScrollOut($sub, e);\r\n\t\t\t\t\t\t\t\t\t},\r\n\t\t\t\t\t\t\t\t\t'mousewheel DOMMouseScroll': function(e) { e.preventDefault(); }\r\n\t\t\t\t\t\t\t\t})\r\n\t\t\t\t\t\t\t\t.insertAfter($sub)\r\n\t\t\t\t\t\t\t);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\t// bind scroll events and save scroll data for this sub\r\n\t\t\t\t\t\tvar eNS = '.smartmenus_scroll';\r\n\t\t\t\t\t\t$sub.dataSM('scroll', {\r\n\t\t\t\t\t\t\t\tstep: 1,\r\n\t\t\t\t\t\t\t\t// cache stuff for faster recalcs later\r\n\t\t\t\t\t\t\t\titemH: itemH,\r\n\t\t\t\t\t\t\t\tsubH: subH,\r\n\t\t\t\t\t\t\t\tarrowDownH: this.getHeight($sub.dataSM('scroll-arrows').eq(1))\r\n\t\t\t\t\t\t\t})\r\n\t\t\t\t\t\t\t.bind(getEventsNS([\r\n\t\t\t\t\t\t\t\t['mouseover', function(e) { self.menuScrollOver($sub, e); }],\r\n\t\t\t\t\t\t\t\t['mouseout', function(e) { self.menuScrollOut($sub, e); }],\r\n\t\t\t\t\t\t\t\t['mousewheel DOMMouseScroll', function(e) { self.menuScrollMousewheel($sub, e); }]\r\n\t\t\t\t\t\t\t], eNS))\r\n\t\t\t\t\t\t\t.dataSM('scroll-arrows').css({ top: 'auto', left: '0', marginLeft: x + (parseInt($sub.css('border-left-width')) || 0), width: subW - (parseInt($sub.css('border-left-width')) || 0) - (parseInt($sub.css('border-right-width')) || 0), zIndex: $sub.css('z-index') })\r\n\t\t\t\t\t\t\t\t.eq(horizontalParent && this.opts.bottomToTopSubMenus ? 0 : 1).show();\r\n\t\t\t\t\t\t// when a menu tree is fixed positioned we allow scrolling via touch too\r\n\t\t\t\t\t\t// since there is no other way to access such long sub menus if no mouse is present\r\n\t\t\t\t\t\tif (this.isFixed()) {\r\n\t\t\t\t\t\t\t$sub.css({ 'touch-action': 'none', '-ms-touch-action': 'none' })\r\n\t\t\t\t\t\t\t\t.bind(getEventsNS([\r\n\t\t\t\t\t\t\t\t\t[touchEvents() ? 'touchstart touchmove touchend' : 'pointerdown pointermove pointerup MSPointerDown MSPointerMove MSPointerUp', function(e) {\r\n\t\t\t\t\t\t\t\t\t\tself.menuScrollTouch($sub, e);\r\n\t\t\t\t\t\t\t\t\t}]\r\n\t\t\t\t\t\t\t\t], eNS));\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\t$sub.css({ top: 'auto', left: '0', marginLeft: x, marginTop: y - itemH });\r\n\t\t\t\t// IE iframe shim\r\n\t\t\t\tthis.menuIframeShim($sub);\r\n\t\t\t\tif ($sub.dataSM('ie-shim')) {\r\n\t\t\t\t\t$sub.dataSM('ie-shim').css({ zIndex: $sub.css('z-index'), width: subW, height: subH, marginLeft: x, marginTop: y - itemH });\r\n\t\t\t\t}\r\n\t\t\t},\r\n\t\t\tmenuScroll: function($sub, once, step) {\r\n\t\t\t\tvar data = $sub.dataSM('scroll'),\r\n\t\t\t\t\t$arrows = $sub.dataSM('scroll-arrows'),\r\n\t\t\t\t\ty = parseFloat($sub.css('margin-top')),\r\n\t\t\t\t\tend = data.up ? data.upEnd : data.downEnd,\r\n\t\t\t\t\tdiff;\r\n\t\t\t\tif (!once && data.velocity) {\r\n\t\t\t\t\tdata.velocity *= 0.9;\r\n\t\t\t\t\tdiff = data.velocity;\r\n\t\t\t\t\tif (diff < 0.5) {\r\n\t\t\t\t\t\tthis.menuScrollStop($sub);\r\n\t\t\t\t\t\treturn;\r\n\t\t\t\t\t}\r\n\t\t\t\t} else {\r\n\t\t\t\t\tdiff = step || (once || !this.opts.scrollAccelerate ? this.opts.scrollStep : Math.floor(data.step));\r\n\t\t\t\t}\r\n\t\t\t\t// hide any visible deeper level sub menus\r\n\t\t\t\tvar level = $sub.dataSM('level');\r\n\t\t\t\tif (this.visibleSubMenus.length > level) {\r\n\t\t\t\t\tthis.menuHideSubMenus(level - 1);\r\n\t\t\t\t}\r\n\t\t\t\tvar newY = data.up && end <= y || !data.up && end >= y ? y : (Math.abs(end - y) > diff ? y + (data.up ? diff : -diff) : end);\r\n\t\t\t\t$sub.add($sub.dataSM('ie-shim')).css('margin-top', newY);\r\n\t\t\t\t// show opposite arrow if appropriate\r\n\t\t\t\tif (mouse && (data.up && newY > data.downEnd || !data.up && newY < data.upEnd)) {\r\n\t\t\t\t\t$arrows.eq(data.up ? 1 : 0).show();\r\n\t\t\t\t}\r\n\t\t\t\t// if we've reached the end\r\n\t\t\t\tif (newY == end) {\r\n\t\t\t\t\tif (mouse) {\r\n\t\t\t\t\t\t$arrows.eq(data.up ? 0 : 1).hide();\r\n\t\t\t\t\t}\r\n\t\t\t\t\tthis.menuScrollStop($sub);\r\n\t\t\t\t} else if (!once) {\r\n\t\t\t\t\tif (this.opts.scrollAccelerate && data.step < this.opts.scrollStep) {\r\n\t\t\t\t\t\tdata.step += 0.5;\r\n\t\t\t\t\t}\r\n\t\t\t\t\tvar self = this;\r\n\t\t\t\t\tthis.scrollTimeout = setTimeout(function() { self.menuScroll($sub); }, this.opts.scrollInterval);\r\n\t\t\t\t}\r\n\t\t\t},\r\n\t\t\tmenuScrollMousewheel: function($sub, e) {\r\n\t\t\t\tif (this.getClosestMenu(e.target) == $sub[0]) {\r\n\t\t\t\t\te = e.originalEvent;\r\n\t\t\t\t\tvar up = (e.wheelDelta || -e.detail) > 0;\r\n\t\t\t\t\tif ($sub.dataSM('scroll-arrows').eq(up ? 0 : 1).is(':visible')) {\r\n\t\t\t\t\t\t$sub.dataSM('scroll').up = up;\r\n\t\t\t\t\t\tthis.menuScroll($sub, true);\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\te.preventDefault();\r\n\t\t\t},\r\n\t\t\tmenuScrollOut: function($sub, e) {\r\n\t\t\t\tif (mouse) {\r\n\t\t\t\t\tif (!/^scroll-(up|down)/.test((e.relatedTarget || '').className) && ($sub[0] != e.relatedTarget && !$.contains($sub[0], e.relatedTarget) || this.getClosestMenu(e.relatedTarget) != $sub[0])) {\r\n\t\t\t\t\t\t$sub.dataSM('scroll-arrows').css('visibility', 'hidden');\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t},\r\n\t\t\tmenuScrollOver: function($sub, e) {\r\n\t\t\t\tif (mouse) {\r\n\t\t\t\t\tif (!/^scroll-(up|down)/.test(e.target.className) && this.getClosestMenu(e.target) == $sub[0]) {\r\n\t\t\t\t\t\tthis.menuScrollRefreshData($sub);\r\n\t\t\t\t\t\tvar data = $sub.dataSM('scroll');\r\n\t\t\t\t\t\t$sub.dataSM('scroll-arrows').eq(0).css('margin-top', data.upEnd).end()\r\n\t\t\t\t\t\t\t.eq(1).css('margin-top', data.downEnd + data.subH - data.arrowDownH).end()\r\n\t\t\t\t\t\t\t.css('visibility', 'visible');\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t},\r\n\t\t\tmenuScrollRefreshData: function($sub) {\r\n\t\t\t\tvar data = $sub.dataSM('scroll'),\r\n\t\t\t\t\t$win = $(window),\r\n\t\t\t\t\tvportY = $win.scrollTop() - $sub.dataSM('parent-a').offset().top - data.itemH;\r\n\t\t\t\t$.extend(data, {\r\n\t\t\t\t\tupEnd: vportY,\r\n\t\t\t\t\tdownEnd: vportY + this.getViewportHeight() - data.subH\r\n\t\t\t\t});\r\n\t\t\t},\r\n\t\t\tmenuScrollStop: function($sub) {\r\n\t\t\t\tif (this.scrollTimeout) {\r\n\t\t\t\t\tclearTimeout(this.scrollTimeout);\r\n\t\t\t\t\tthis.scrollTimeout = 0;\r\n\t\t\t\t\t$.extend($sub.dataSM('scroll'), {\r\n\t\t\t\t\t\tstep: 1,\r\n\t\t\t\t\t\tvelocity: 0\r\n\t\t\t\t\t});\r\n\t\t\t\t\treturn true;\r\n\t\t\t\t}\r\n\t\t\t},\r\n\t\t\tmenuScrollTouch: function($sub, e) {\r\n\t\t\t\te = e.originalEvent;\r\n\t\t\t\tif (isTouchEvent(e)) {\r\n\t\t\t\t\tvar touchPoint = this.getTouchPoint(e);\r\n\t\t\t\t\t// neglect event if we touched a visible deeper level sub menu\r\n\t\t\t\t\tif (this.getClosestMenu(touchPoint.target) == $sub[0]) {\r\n\t\t\t\t\t\tvar data = $sub.dataSM('scroll');\r\n\t\t\t\t\t\tif (/(start|down)$/i.test(e.type)) {\r\n\t\t\t\t\t\t\tif (this.menuScrollStop($sub)) {\r\n\t\t\t\t\t\t\t\t// if we were scrolling, just stop and don't activate any link on the first touch\r\n\t\t\t\t\t\t\t\te.preventDefault();\r\n\t\t\t\t\t\t\t\tthis.isTouchScrolling = true;\r\n\t\t\t\t\t\t\t} else {\r\n\t\t\t\t\t\t\t\tthis.isTouchScrolling = false;\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t// update scroll data since the user might have zoomed, etc.\r\n\t\t\t\t\t\t\tthis.menuScrollRefreshData($sub);\r\n\t\t\t\t\t\t\t// extend it with the touch properties\r\n\t\t\t\t\t\t\t$.extend(data, {\r\n\t\t\t\t\t\t\t\ttouchY: touchPoint.pageY,\r\n\t\t\t\t\t\t\t\ttouchTimestamp: e.timeStamp,\r\n\t\t\t\t\t\t\t\tvelocity: 0\r\n\t\t\t\t\t\t\t});\r\n\t\t\t\t\t\t} else if (/move$/i.test(e.type)) {\r\n\t\t\t\t\t\t\tvar prevY = data.touchY;\r\n\t\t\t\t\t\t\tif (prevY !== undefined && prevY != touchPoint.pageY) {\r\n\t\t\t\t\t\t\t\tthis.isTouchScrolling = true;\r\n\t\t\t\t\t\t\t\t$.extend(data, {\r\n\t\t\t\t\t\t\t\t\tup: prevY < touchPoint.pageY,\r\n\t\t\t\t\t\t\t\t\ttouchY: touchPoint.pageY,\r\n\t\t\t\t\t\t\t\t\ttouchTimestamp: e.timeStamp,\r\n\t\t\t\t\t\t\t\t\tvelocity: data.velocity + Math.abs(touchPoint.pageY - prevY) * 0.5\r\n\t\t\t\t\t\t\t\t});\r\n\t\t\t\t\t\t\t\tthis.menuScroll($sub, true, Math.abs(data.touchY - prevY));\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\te.preventDefault();\r\n\t\t\t\t\t\t} else { // touchend/pointerup\r\n\t\t\t\t\t\t\tif (data.touchY !== undefined) {\r\n\t\t\t\t\t\t\t\t// check if we need to scroll\r\n\t\t\t\t\t\t\t\tif (e.timeStamp - data.touchTimestamp < 120 && data.velocity > 0) {\r\n\t\t\t\t\t\t\t\t\tdata.velocity *= 0.5;\r\n\t\t\t\t\t\t\t\t\tthis.menuScrollStop($sub);\r\n\t\t\t\t\t\t\t\t\tthis.menuScroll($sub);\r\n\t\t\t\t\t\t\t\t\te.preventDefault();\r\n\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\tdelete data.touchY;\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t},\r\n\t\t\tmenuShow: function($sub) {\r\n\t\t\t\tif (!$sub.dataSM('beforefirstshowfired')) {\r\n\t\t\t\t\t$sub.dataSM('beforefirstshowfired', true);\r\n\t\t\t\t\tif (this.$root.triggerHandler('beforefirstshow.smapi', $sub[0]) === false) {\r\n\t\t\t\t\t\treturn;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\tif (this.$root.triggerHandler('beforeshow.smapi', $sub[0]) === false) {\r\n\t\t\t\t\treturn;\r\n\t\t\t\t}\r\n\t\t\t\tthis.menuFixLayout($sub);\r\n\t\t\t\t$sub.stop(true, true);\r\n\t\t\t\tif (!$sub.is(':visible')) {\r\n\t\t\t\t\t// set z-index\r\n\t\t\t\t\t$sub.css('z-index', this.zIndexInc = (this.zIndexInc || this.getStartZIndex()) + 1);\r\n\t\t\t\t\t// highlight parent item\r\n\t\t\t\t\tif (this.opts.keepHighlighted || this.isCollapsible()) {\r\n\t\t\t\t\t\t$sub.dataSM('parent-a').addClass('highlighted');\r\n\t\t\t\t\t}\r\n\t\t\t\t\t// min/max-width fix - no way to rely purely on CSS as all UL's are nested\r\n\t\t\t\t\tif (this.opts.subMenusMinWidth || this.opts.subMenusMaxWidth) {\r\n\t\t\t\t\t\t$sub.css({ width: 'auto', minWidth: '', maxWidth: '' }).addClass('sm-nowrap');\r\n\t\t\t\t\t\tif (this.opts.subMenusMinWidth) {\r\n\t\t\t\t\t\t \t$sub.css('min-width', this.opts.subMenusMinWidth);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\tif (this.opts.subMenusMaxWidth) {\r\n\t\t\t\t\t\t \tvar noMaxWidth = this.getWidth($sub);\r\n\t\t\t\t\t\t \t$sub.css('max-width', this.opts.subMenusMaxWidth);\r\n\t\t\t\t\t\t\tif (noMaxWidth > this.getWidth($sub)) {\r\n\t\t\t\t\t\t\t\t$sub.removeClass('sm-nowrap').css('width', this.opts.subMenusMaxWidth);\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t\tthis.menuPosition($sub);\r\n\t\t\t\t\t// insert IE iframe shim\r\n\t\t\t\t\tif ($sub.dataSM('ie-shim')) {\r\n\t\t\t\t\t\t$sub.dataSM('ie-shim').insertBefore($sub);\r\n\t\t\t\t\t}\r\n\t\t\t\t\tvar complete = function() {\r\n\t\t\t\t\t\t// fix: \"overflow: hidden;\" is not reset on animation complete in jQuery < 1.9.0 in Chrome when global \"box-sizing: border-box;\" is used\r\n\t\t\t\t\t\t$sub.css('overflow', '');\r\n\t\t\t\t\t};\r\n\t\t\t\t\t// if sub is collapsible (mobile view)\r\n\t\t\t\t\tif (this.isCollapsible()) {\r\n\t\t\t\t\t\tif (this.opts.collapsibleShowFunction) {\r\n\t\t\t\t\t\t\tthis.opts.collapsibleShowFunction.call(this, $sub, complete);\r\n\t\t\t\t\t\t} else {\r\n\t\t\t\t\t\t\t$sub.show(this.opts.collapsibleShowDuration, complete);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t} else {\r\n\t\t\t\t\t\tif (this.opts.showFunction) {\r\n\t\t\t\t\t\t\tthis.opts.showFunction.call(this, $sub, complete);\r\n\t\t\t\t\t\t} else {\r\n\t\t\t\t\t\t\t$sub.show(this.opts.showDuration, complete);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t\t// save new sub menu for this level\r\n\t\t\t\t\tthis.visibleSubMenus[$sub.dataSM('level') - 1] = $sub;\r\n\t\t\t\t\tthis.$root.triggerHandler('show.smapi', $sub[0]);\r\n\t\t\t\t}\r\n\t\t\t},\r\n\t\t\tpopupHide: function(noHideTimeout) {\r\n\t\t\t\tif (this.hideTimeout) {\r\n\t\t\t\t\tclearTimeout(this.hideTimeout);\r\n\t\t\t\t\tthis.hideTimeout = 0;\r\n\t\t\t\t}\r\n\t\t\t\tvar self = this;\r\n\t\t\t\tthis.hideTimeout = setTimeout(function() {\r\n\t\t\t\t\tself.menuHideAll();\r\n\t\t\t\t}, noHideTimeout ? 1 : this.opts.hideTimeout);\r\n\t\t\t},\r\n\t\t\tpopupShow: function(left, top) {\r\n\t\t\t\tif (!this.opts.isPopup) {\r\n\t\t\t\t\talert('SmartMenus jQuery Error:\\n\\nIf you want to show this menu via the \"popupShow\" method, set the isPopup:true option.');\r\n\t\t\t\t\treturn;\r\n\t\t\t\t}\r\n\t\t\t\tif (this.hideTimeout) {\r\n\t\t\t\t\tclearTimeout(this.hideTimeout);\r\n\t\t\t\t\tthis.hideTimeout = 0;\r\n\t\t\t\t}\r\n\t\t\t\tthis.menuFixLayout(this.$root);\r\n\t\t\t\tthis.$root.stop(true, true);\r\n\t\t\t\tif (!this.$root.is(':visible')) {\r\n\t\t\t\t\tthis.$root.css({ left: left, top: top });\r\n\t\t\t\t\t// IE iframe shim\r\n\t\t\t\t\tthis.menuIframeShim(this.$root);\r\n\t\t\t\t\tif (this.$root.dataSM('ie-shim')) {\r\n\t\t\t\t\t\tthis.$root.dataSM('ie-shim').css({ zIndex: this.$root.css('z-index'), width: this.getWidth(this.$root), height: this.getHeight(this.$root), left: left, top: top }).insertBefore(this.$root);\r\n\t\t\t\t\t}\r\n\t\t\t\t\t// show menu\r\n\t\t\t\t\tvar self = this,\r\n\t\t\t\t\t\tcomplete = function() {\r\n\t\t\t\t\t\t\tself.$root.css('overflow', '');\r\n\t\t\t\t\t\t};\r\n\t\t\t\t\tif (this.opts.showFunction) {\r\n\t\t\t\t\t\tthis.opts.showFunction.call(this, this.$root, complete);\r\n\t\t\t\t\t} else {\r\n\t\t\t\t\t\tthis.$root.show(this.opts.showDuration, complete);\r\n\t\t\t\t\t}\r\n\t\t\t\t\tthis.visibleSubMenus[0] = this.$root;\r\n\t\t\t\t}\r\n\t\t\t},\r\n\t\t\trefresh: function() {\r\n\t\t\t\tthis.menuHideAll();\r\n\t\t\t\tthis.$root.find('ul').each(function() {\r\n\t\t\t\t\t\tvar $this = $(this);\r\n\t\t\t\t\t\tif ($this.dataSM('scroll-arrows')) {\r\n\t\t\t\t\t\t\t$this.dataSM('scroll-arrows').remove();\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t})\r\n\t\t\t\t\t.removeDataSM('in-mega')\r\n\t\t\t\t\t.removeDataSM('shown-before')\r\n\t\t\t\t\t.removeDataSM('ie-shim')\r\n\t\t\t\t\t.removeDataSM('scroll-arrows')\r\n\t\t\t\t\t.removeDataSM('parent-a')\r\n\t\t\t\t\t.removeDataSM('level')\r\n\t\t\t\t\t.removeDataSM('beforefirstshowfired');\r\n\t\t\t\tthis.$root.find('a.has-submenu').removeClass('has-submenu')\r\n\t\t\t\t\t.parent().removeDataSM('sub');\r\n\t\t\t\tif (this.opts.subIndicators) {\r\n\t\t\t\t\tthis.$root.find('span.sub-arrow').remove();\r\n\t\t\t\t}\r\n\t\t\t\tif (this.opts.markCurrentItem) {\r\n\t\t\t\t\tthis.$root.find('a.current').removeClass('current');\r\n\t\t\t\t}\r\n\t\t\t\tthis.subMenus = [];\r\n\t\t\t\tthis.init(true);\r\n\t\t\t},\r\n\t\t\trootOut: function(e) {\r\n\t\t\t\tif (!this.handleEvents() || this.isTouchMode() || e.target == this.$root[0]) {\r\n\t\t\t\t\treturn;\r\n\t\t\t\t}\r\n\t\t\t\tif (this.hideTimeout) {\r\n\t\t\t\t\tclearTimeout(this.hideTimeout);\r\n\t\t\t\t\tthis.hideTimeout = 0;\r\n\t\t\t\t}\r\n\t\t\t\tif (!this.opts.showOnClick || !this.opts.hideOnClick) {\r\n\t\t\t\t\tvar self = this;\r\n\t\t\t\t\tthis.hideTimeout = setTimeout(function() { self.menuHideAll(); }, this.opts.hideTimeout);\r\n\t\t\t\t}\r\n\t\t\t},\r\n\t\t\trootOver: function(e) {\r\n\t\t\t\tif (!this.handleEvents() || this.isTouchMode() || e.target == this.$root[0]) {\r\n\t\t\t\t\treturn;\r\n\t\t\t\t}\r\n\t\t\t\tif (this.hideTimeout) {\r\n\t\t\t\t\tclearTimeout(this.hideTimeout);\r\n\t\t\t\t\tthis.hideTimeout = 0;\r\n\t\t\t\t}\r\n\t\t\t},\r\n\t\t\twinResize: function(e) {\r\n\t\t\t\tif (!this.handleEvents()) {\r\n\t\t\t\t\t// we still need to resize the disable overlay if it's visible\r\n\t\t\t\t\tif (this.$disableOverlay) {\r\n\t\t\t\t\t\tvar pos = this.$root.offset();\r\n\t \t\t\t\t\tthis.$disableOverlay.css({\r\n\t\t\t\t\t\t\ttop: pos.top,\r\n\t\t\t\t\t\t\tleft: pos.left,\r\n\t\t\t\t\t\t\twidth: this.$root.outerWidth(),\r\n\t\t\t\t\t\t\theight: this.$root.outerHeight()\r\n\t\t\t\t\t\t});\r\n\t\t\t\t\t}\r\n\t\t\t\t\treturn;\r\n\t\t\t\t}\r\n\t\t\t\t// hide sub menus on resize - on mobile do it only on orientation change\r\n\t\t\t\tif (!this.isCollapsible() && (!('onorientationchange' in window) || e.type == 'orientationchange')) {\r\n\t\t\t\t\tif (this.activatedItems.length) {\r\n\t\t\t\t\t\tthis.activatedItems[this.activatedItems.length - 1][0].blur();\r\n\t\t\t\t\t}\r\n\t\t\t\t\tthis.menuHideAll();\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t});\r\n\r\n\t$.fn.dataSM = function(key, val) {\r\n\t\tif (val) {\r\n\t\t\treturn this.data(key + '_smartmenus', val);\r\n\t\t}\r\n\t\treturn this.data(key + '_smartmenus');\r\n\t}\r\n\r\n\t$.fn.removeDataSM = function(key) {\r\n\t\treturn this.removeData(key + '_smartmenus');\r\n\t}\r\n\r\n\t$.fn.smartmenus = function(options) {\r\n\t\tif (typeof options == 'string') {\r\n\t\t\tvar args = arguments,\r\n\t\t\t\tmethod = options;\r\n\t\t\tArray.prototype.shift.call(args);\r\n\t\t\treturn this.each(function() {\r\n\t\t\t\tvar smartmenus = $(this).data('smartmenus');\r\n\t\t\t\tif (smartmenus && smartmenus[method]) {\r\n\t\t\t\t\tsmartmenus[method].apply(smartmenus, args);\r\n\t\t\t\t}\r\n\t\t\t});\r\n\t\t}\r\n\t\tvar opts = $.extend({}, $.fn.smartmenus.defaults, options);\r\n\t\treturn this.each(function() {\r\n\t\t\tnew $.SmartMenus(this, opts);\r\n\t\t});\r\n\t}\r\n\r\n\t// default settings\r\n\t$.fn.smartmenus.defaults = {\r\n\t\tisPopup:\t\tfalse,\t\t// is this a popup menu (can be shown via the popupShow/popupHide methods) or a permanent menu bar\r\n\t\tmainMenuSubOffsetX:\t0,\t\t// pixels offset from default position\r\n\t\tmainMenuSubOffsetY:\t0,\t\t// pixels offset from default position\r\n\t\tsubMenusSubOffsetX:\t0,\t\t// pixels offset from default position\r\n\t\tsubMenusSubOffsetY:\t0,\t\t// pixels offset from default position\r\n\t\tsubMenusMinWidth:\t'10em',\t\t// min-width for the sub menus (any CSS unit) - if set, the fixed width set in CSS will be ignored\r\n\t\tsubMenusMaxWidth:\t'20em',\t\t// max-width for the sub menus (any CSS unit) - if set, the fixed width set in CSS will be ignored\r\n\t\tsubIndicators: \t\ttrue,\t\t// create sub menu indicators - creates a SPAN and inserts it in the A\r\n\t\tsubIndicatorsPos: \t'prepend',\t// position of the SPAN relative to the menu item content ('prepend', 'append')\r\n\t\tsubIndicatorsText:\t'+',\t\t// [optionally] add text in the SPAN (e.g. '+') (you may want to check the CSS for the sub indicators too)\r\n\t\tscrollStep: \t\t30,\t\t// pixels step when scrolling long sub menus that do not fit in the viewport height\r\n\t\tscrollInterval:\t\t30,\t\t// interval between each scrolling step\r\n\t\tscrollAccelerate:\ttrue,\t\t// accelerate scrolling or use a fixed step\r\n\t\tshowTimeout:\t\t250,\t\t// timeout before showing the sub menus\r\n\t\thideTimeout:\t\t500,\t\t// timeout before hiding the sub menus\r\n\t\tshowDuration:\t\t0,\t\t// duration for show animation - set to 0 for no animation - matters only if showFunction:null\r\n\t\tshowFunction:\t\tnull,\t\t// custom function to use when showing a sub menu (the default is the jQuery 'show')\r\n\t\t\t\t\t\t\t// don't forget to call complete() at the end of whatever you do\r\n\t\t\t\t\t\t\t// e.g.: function($ul, complete) { $ul.fadeIn(250, complete); }\r\n\t\thideDuration:\t\t0,\t\t// duration for hide animation - set to 0 for no animation - matters only if hideFunction:null\r\n\t\thideFunction:\t\tfunction($ul, complete) { $ul.fadeOut(200, complete); },\t// custom function to use when hiding a sub menu (the default is the jQuery 'hide')\r\n\t\t\t\t\t\t\t// don't forget to call complete() at the end of whatever you do\r\n\t\t\t\t\t\t\t// e.g.: function($ul, complete) { $ul.fadeOut(250, complete); }\r\n\t\tcollapsibleShowDuration:0,\t\t// duration for show animation for collapsible sub menus - matters only if collapsibleShowFunction:null\r\n\t\tcollapsibleShowFunction:function($ul, complete) { $ul.slideDown(200, complete); },\t// custom function to use when showing a collapsible sub menu\r\n\t\t\t\t\t\t\t// (i.e. when mobile styles are used to make the sub menus collapsible)\r\n\t\tcollapsibleHideDuration:0,\t\t// duration for hide animation for collapsible sub menus - matters only if collapsibleHideFunction:null\r\n\t\tcollapsibleHideFunction:function($ul, complete) { $ul.slideUp(200, complete); },\t// custom function to use when hiding a collapsible sub menu\r\n\t\t\t\t\t\t\t// (i.e. when mobile styles are used to make the sub menus collapsible)\r\n\t\tshowOnClick:\t\tfalse,\t\t// show the first-level sub menus onclick instead of onmouseover (matters only for mouse input)\r\n\t\thideOnClick:\t\ttrue,\t\t// hide the sub menus on click/tap anywhere on the page\r\n\t\tkeepInViewport:\t\ttrue,\t\t// reposition the sub menus if needed to make sure they always appear inside the viewport\r\n\t\tkeepHighlighted:\ttrue,\t\t// keep all ancestor items of the current sub menu highlighted (adds the 'highlighted' class to the A's)\r\n\t\tmarkCurrentItem:\tfalse,\t\t// automatically add the 'current' class to the A element of the item linking to the current URL\r\n\t\tmarkCurrentTree:\ttrue,\t\t// add the 'current' class also to the A elements of all ancestor items of the current item\r\n\t\trightToLeftSubMenus:\tfalse,\t\t// right to left display of the sub menus (check the CSS for the sub indicators' position)\r\n\t\tbottomToTopSubMenus:\tfalse,\t\t// bottom to top display of the sub menus\r\n\t\toverlapControlsInIE:\ttrue\t\t// make sure sub menus appear on top of special OS controls in IE (i.e. SELECT, OBJECT, EMBED, etc.)\r\n\t};\r\n\r\n})(jQuery);","/*!\r\n * Chart.js\r\n * http://chartjs.org/\r\n * Version: 1.0.1-beta.4\r\n *\r\n * Copyright 2014 Nick Downie\r\n * Released under the MIT license\r\n * https://github.com/nnnick/Chart.js/blob/master/LICENSE.md\r\n */\r\n(function(){\"use strict\";var t=this,i=t.Chart,e=function(t){this.canvas=t.canvas,this.ctx=t;this.width=t.canvas.width,this.height=t.canvas.height;return this.aspectRatio=this.width/this.height,s.retinaScale(this),this};e.defaults={global:{animation:!0,animationSteps:60,animationEasing:\"easeOutQuart\",showScale:!0,scaleOverride:!1,scaleSteps:null,scaleStepWidth:null,scaleStartValue:null,scaleLineColor:\"rgba(0,0,0,.1)\",scaleLineWidth:1,scaleShowLabels:!0,scaleLabel:\"<%=value%>\",scaleIntegersOnly:!0,scaleBeginAtZero:!1,scaleFontFamily:\"'Helvetica Neue', 'Helvetica', 'Arial', sans-serif\",scaleFontSize:12,scaleFontStyle:\"normal\",scaleFontColor:\"#666\",responsive:!1,maintainAspectRatio:!0,showTooltips:!0,tooltipEvents:[\"mousemove\",\"touchstart\",\"touchmove\",\"mouseout\"],tooltipFillColor:\"rgba(0,0,0,0.8)\",tooltipFontFamily:\"'Helvetica Neue', 'Helvetica', 'Arial', sans-serif\",tooltipFontSize:14,tooltipFontStyle:\"normal\",tooltipFontColor:\"#fff\",tooltipTitleFontFamily:\"'Helvetica Neue', 'Helvetica', 'Arial', sans-serif\",tooltipTitleFontSize:14,tooltipTitleFontStyle:\"bold\",tooltipTitleFontColor:\"#fff\",tooltipYPadding:6,tooltipXPadding:6,tooltipCaretSize:8,tooltipCornerRadius:6,tooltipXOffset:10,tooltipTemplate:\"<%if (label){%><%=label%>: <%}%><%= value %>\",multiTooltipTemplate:\"<%= value %>\",multiTooltipKeyBackground:\"#fff\",onAnimationProgress:function(){},onAnimationComplete:function(){}}},e.types={};var s=e.helpers={},n=s.each=function(t,i,e){var s=Array.prototype.slice.call(arguments,3);if(t)if(t.length===+t.length){var n;for(n=0;n
=0;s--){var n=t[s];if(i(n))return n}},s.inherits=function(t){var i=this,e=t&&t.hasOwnProperty(\"constructor\")?t.constructor:function(){return i.apply(this,arguments)},s=function(){this.constructor=e};return s.prototype=i.prototype,e.prototype=new s,e.extend=r,t&&a(e.prototype,t),e.__super__=i.prototype,e}),c=s.noop=function(){},u=s.uid=function(){var t=0;return function(){return\"chart-\"+t++}}(),d=s.warn=function(t){window.console&&\"function\"==typeof window.console.warn&&console.warn(t)},p=s.amd=\"function\"==typeof t.define&&t.define.amd,f=s.isNumber=function(t){return!isNaN(parseFloat(t))&&isFinite(t)},g=s.max=function(t){return Math.max.apply(Math,t)},m=s.min=function(t){return Math.min.apply(Math,t)},v=(s.cap=function(t,i,e){if(f(i)){if(t>i)return i}else if(f(e)&&e>t)return e;return t},s.getDecimalPlaces=function(t){return t%1!==0&&f(t)?t.toString().split(\".\")[1].length:0}),x=s.radians=function(t){return t*(Math.PI/180)},S=(s.getAngleFromPoint=function(t,i){var e=i.x-t.x,s=i.y-t.y,n=Math.sqrt(e*e+s*s),o=2*Math.PI+Math.atan2(s,e);return 0>e&&0>s&&(o+=2*Math.PI),{angle:o,distance:n}},s.aliasPixel=function(t){return t%2===0?0:.5}),y=(s.splineCurve=function(t,i,e,s){var n=Math.sqrt(Math.pow(i.x-t.x,2)+Math.pow(i.y-t.y,2)),o=Math.sqrt(Math.pow(e.x-i.x,2)+Math.pow(e.y-i.y,2)),a=s*n/(n+o),h=s*o/(n+o);return{inner:{x:i.x-a*(e.x-t.x),y:i.y-a*(e.y-t.y)},outer:{x:i.x+h*(e.x-t.x),y:i.y+h*(e.y-t.y)}}},s.calculateOrderOfMagnitude=function(t){return Math.floor(Math.log(t)/Math.LN10)}),C=(s.calculateScaleRange=function(t,i,e,s,n){var o=2,a=Math.floor(i/(1.5*e)),h=o>=a,l=g(t),r=m(t);l===r&&(l+=.5,r>=.5&&!s?r-=.5:l+=.5);for(var c=Math.abs(l-r),u=y(c),d=Math.ceil(l/(1*Math.pow(10,u)))*Math.pow(10,u),p=s?0:Math.floor(r/(1*Math.pow(10,u)))*Math.pow(10,u),f=d-p,v=Math.pow(10,u),x=Math.round(f/v);(x>a||a>2*x)&&!h;)if(x>a)v*=2,x=Math.round(f/v),x%1!==0&&(h=!0);else if(n&&u>=0){if(v/2%1!==0)break;v/=2,x=Math.round(f/v)}else v/=2,x=Math.round(f/v);return h&&(x=o,v=f/x),{steps:x,stepValue:v,min:p,max:p+x*v}},s.template=function(t,i){function e(t,i){var e=/\\W/.test(t)?new Function(\"obj\",\"var p=[],print=function(){p.push.apply(p,arguments);};with(obj){p.push('\"+t.replace(/[\\r\\t\\n]/g,\" \").split(\"<%\").join(\"\t\").replace(/((^|%>)[^\\t]*)'/g,\"$1\\r\").replace(/\\t=(.*?)%>/g,\"',$1,'\").split(\"\t\").join(\"');\").split(\"%>\").join(\"p.push('\").split(\"\\r\").join(\"\\\\'\")+\"');}return p.join('');\"):s[t]=s[t];return i?e(i):e}if(t instanceof Function)return t(i);var s={};return e(t,i)}),b=(s.generateLabels=function(t,i,e,s){var o=new Array(i);return labelTemplateString&&n(o,function(i,n){o[n]=C(t,{value:e+s*(n+1)})}),o},s.easingEffects={linear:function(t){return t},easeInQuad:function(t){return t*t},easeOutQuad:function(t){return-1*t*(t-2)},easeInOutQuad:function(t){return(t/=.5)<1?.5*t*t:-0.5*(--t*(t-2)-1)},easeInCubic:function(t){return t*t*t},easeOutCubic:function(t){return 1*((t=t/1-1)*t*t+1)},easeInOutCubic:function(t){return(t/=.5)<1?.5*t*t*t:.5*((t-=2)*t*t+2)},easeInQuart:function(t){return t*t*t*t},easeOutQuart:function(t){return-1*((t=t/1-1)*t*t*t-1)},easeInOutQuart:function(t){return(t/=.5)<1?.5*t*t*t*t:-0.5*((t-=2)*t*t*t-2)},easeInQuint:function(t){return 1*(t/=1)*t*t*t*t},easeOutQuint:function(t){return 1*((t=t/1-1)*t*t*t*t+1)},easeInOutQuint:function(t){return(t/=.5)<1?.5*t*t*t*t*t:.5*((t-=2)*t*t*t*t+2)},easeInSine:function(t){return-1*Math.cos(t/1*(Math.PI/2))+1},easeOutSine:function(t){return 1*Math.sin(t/1*(Math.PI/2))},easeInOutSine:function(t){return-0.5*(Math.cos(Math.PI*t/1)-1)},easeInExpo:function(t){return 0===t?1:1*Math.pow(2,10*(t/1-1))},easeOutExpo:function(t){return 1===t?1:1*(-Math.pow(2,-10*t/1)+1)},easeInOutExpo:function(t){return 0===t?0:1===t?1:(t/=.5)<1?.5*Math.pow(2,10*(t-1)):.5*(-Math.pow(2,-10*--t)+2)},easeInCirc:function(t){return t>=1?t:-1*(Math.sqrt(1-(t/=1)*t)-1)},easeOutCirc:function(t){return 1*Math.sqrt(1-(t=t/1-1)*t)},easeInOutCirc:function(t){return(t/=.5)<1?-0.5*(Math.sqrt(1-t*t)-1):.5*(Math.sqrt(1-(t-=2)*t)+1)},easeInElastic:function(t){var i=1.70158,e=0,s=1;return 0===t?0:1==(t/=1)?1:(e||(e=.3),st?-.5*s*Math.pow(2,10*(t-=1))*Math.sin(2*(1*t-i)*Math.PI/e):s*Math.pow(2,-10*(t-=1))*Math.sin(2*(1*t-i)*Math.PI/e)*.5+1)},easeInBack:function(t){var i=1.70158;return 1*(t/=1)*t*((i+1)*t-i)},easeOutBack:function(t){var i=1.70158;return 1*((t=t/1-1)*t*((i+1)*t+i)+1)},easeInOutBack:function(t){var i=1.70158;return(t/=.5)<1?.5*t*t*(((i*=1.525)+1)*t-i):.5*((t-=2)*t*(((i*=1.525)+1)*t+i)+2)},easeInBounce:function(t){return 1-b.easeOutBounce(1-t)},easeOutBounce:function(t){return(t/=1)<1/2.75?7.5625*t*t:2/2.75>t?1*(7.5625*(t-=1.5/2.75)*t+.75):2.5/2.75>t?1*(7.5625*(t-=2.25/2.75)*t+.9375):1*(7.5625*(t-=2.625/2.75)*t+.984375)},easeInOutBounce:function(t){return.5>t?.5*b.easeInBounce(2*t):.5*b.easeOutBounce(2*t-1)+.5}}),w=s.requestAnimFrame=function(){return window.requestAnimationFrame||window.webkitRequestAnimationFrame||window.mozRequestAnimationFrame||window.oRequestAnimationFrame||window.msRequestAnimationFrame||function(t){return window.setTimeout(t,1e3/60)}}(),P=(s.cancelAnimFrame=function(){return window.cancelAnimationFrame||window.webkitCancelAnimationFrame||window.mozCancelAnimationFrame||window.oCancelAnimationFrame||window.msCancelAnimationFrame||function(t){return window.clearTimeout(t,1e3/60)}}(),s.animationLoop=function(t,i,e,s,n,o){var a=0,h=b[e]||b.linear,l=function(){a++;var e=a/i,r=h(e);t.call(o,r,e,a),s.call(o,r,e),i>a?o.animationFrame=w(l):n.apply(o)};w(l)},s.getRelativePosition=function(t){var i,e,s=t.originalEvent||t,n=t.currentTarget||t.srcElement,o=n.getBoundingClientRect();return s.touches?(i=s.touches[0].clientX-o.left,e=s.touches[0].clientY-o.top):(i=s.clientX-o.left,e=s.clientY-o.top),{x:i,y:e}},s.addEvent=function(t,i,e){t.addEventListener?t.addEventListener(i,e):t.attachEvent?t.attachEvent(\"on\"+i,e):t[\"on\"+i]=e}),L=s.removeEvent=function(t,i,e){t.removeEventListener?t.removeEventListener(i,e,!1):t.detachEvent?t.detachEvent(\"on\"+i,e):t[\"on\"+i]=c},k=(s.bindEvents=function(t,i,e){t.events||(t.events={}),n(i,function(i){t.events[i]=function(){e.apply(t,arguments)},P(t.chart.canvas,i,t.events[i])})},s.unbindEvents=function(t,i){n(i,function(i,e){L(t.chart.canvas,e,i)})}),F=s.getMaximumWidth=function(t){var i=t.parentNode;return i.clientWidth},R=s.getMaximumHeight=function(t){var i=t.parentNode;return i.clientHeight},A=(s.getMaximumSize=s.getMaximumWidth,s.retinaScale=function(t){var i=t.ctx,e=t.canvas.width,s=t.canvas.height;window.devicePixelRatio&&(i.canvas.style.width=e+\"px\",i.canvas.style.height=s+\"px\",i.canvas.height=s*window.devicePixelRatio,i.canvas.width=e*window.devicePixelRatio,i.scale(window.devicePixelRatio,window.devicePixelRatio))}),T=s.clear=function(t){t.ctx.clearRect(0,0,t.width,t.height)},M=s.fontString=function(t,i,e){return i+\" \"+t+\"px \"+e},W=s.longestText=function(t,i,e){t.font=i;var s=0;return n(e,function(i){var e=t.measureText(i).width;s=e>s?e:s}),s},z=s.drawRoundedRectangle=function(t,i,e,s,n,o){t.beginPath(),t.moveTo(i+o,e),t.lineTo(i+s-o,e),t.quadraticCurveTo(i+s,e,i+s,e+o),t.lineTo(i+s,e+n-o),t.quadraticCurveTo(i+s,e+n,i+s-o,e+n),t.lineTo(i+o,e+n),t.quadraticCurveTo(i,e+n,i,e+n-o),t.lineTo(i,e+o),t.quadraticCurveTo(i,e,i+o,e),t.closePath()};e.instances={},e.Type=function(t,i,s){this.options=i,this.chart=s,this.id=u(),e.instances[this.id]=this,i.responsive&&this.resize(),this.initialize.call(this,t)},a(e.Type.prototype,{initialize:function(){return this},clear:function(){return T(this.chart),this},stop:function(){return s.cancelAnimFrame.call(t,this.animationFrame),this},resize:function(t){this.stop();var i=this.chart.canvas,e=F(this.chart.canvas),s=this.options.maintainAspectRatio?e/this.chart.aspectRatio:R(this.chart.canvas);return i.width=this.chart.width=e,i.height=this.chart.height=s,A(this.chart),\"function\"==typeof t&&t.apply(this,Array.prototype.slice.call(arguments,1)),this},reflow:c,render:function(t){return t&&this.reflow(),this.options.animation&&!t?s.animationLoop(this.draw,this.options.animationSteps,this.options.animationEasing,this.options.onAnimationProgress,this.options.onAnimationComplete,this):(this.draw(),this.options.onAnimationComplete.call(this)),this},generateLegend:function(){return C(this.options.legendTemplate,this)},destroy:function(){this.clear(),k(this,this.events),delete e.instances[this.id]},showTooltip:function(t,i){\"undefined\"==typeof this.activeElements&&(this.activeElements=[]);var o=function(t){var i=!1;return t.length!==this.activeElements.length?i=!0:(n(t,function(t,e){t!==this.activeElements[e]&&(i=!0)},this),i)}.call(this,t);if(o||i){if(this.activeElements=t,this.draw(),t.length>0)if(this.datasets&&this.datasets.length>1){for(var a,h,r=this.datasets.length-1;r>=0&&(a=this.datasets[r].points||this.datasets[r].bars||this.datasets[r].segments,h=l(a,t[0]),-1===h);r--);var c=[],u=[],d=function(){var t,i,e,n,o,a=[],l=[],r=[];return s.each(this.datasets,function(i){t=i.points||i.bars||i.segments,t[h]&&t[h].hasValue()&&a.push(t[h])}),s.each(a,function(t){l.push(t.x),r.push(t.y),c.push(s.template(this.options.multiTooltipTemplate,t)),u.push({fill:t._saved.fillColor||t.fillColor,stroke:t._saved.strokeColor||t.strokeColor})},this),o=m(r),e=g(r),n=m(l),i=g(l),{x:n>this.chart.width/2?n:i,y:(o+e)/2}}.call(this,h);new e.MultiTooltip({x:d.x,y:d.y,xPadding:this.options.tooltipXPadding,yPadding:this.options.tooltipYPadding,xOffset:this.options.tooltipXOffset,fillColor:this.options.tooltipFillColor,textColor:this.options.tooltipFontColor,fontFamily:this.options.tooltipFontFamily,fontStyle:this.options.tooltipFontStyle,fontSize:this.options.tooltipFontSize,titleTextColor:this.options.tooltipTitleFontColor,titleFontFamily:this.options.tooltipTitleFontFamily,titleFontStyle:this.options.tooltipTitleFontStyle,titleFontSize:this.options.tooltipTitleFontSize,cornerRadius:this.options.tooltipCornerRadius,labels:c,legendColors:u,legendColorBackground:this.options.multiTooltipKeyBackground,title:t[0].label,chart:this.chart,ctx:this.chart.ctx}).draw()}else n(t,function(t){var i=t.tooltipPosition();new e.Tooltip({x:Math.round(i.x),y:Math.round(i.y),xPadding:this.options.tooltipXPadding,yPadding:this.options.tooltipYPadding,fillColor:this.options.tooltipFillColor,textColor:this.options.tooltipFontColor,fontFamily:this.options.tooltipFontFamily,fontStyle:this.options.tooltipFontStyle,fontSize:this.options.tooltipFontSize,caretHeight:this.options.tooltipCaretSize,cornerRadius:this.options.tooltipCornerRadius,text:C(this.options.tooltipTemplate,t),chart:this.chart}).draw()},this);return this}},toBase64Image:function(){return this.chart.canvas.toDataURL.apply(this.chart.canvas,arguments)}}),e.Type.extend=function(t){var i=this,s=function(){return i.apply(this,arguments)};if(s.prototype=o(i.prototype),a(s.prototype,t),s.extend=e.Type.extend,t.name||i.prototype.name){var n=t.name||i.prototype.name,l=e.defaults[i.prototype.name]?o(e.defaults[i.prototype.name]):{};e.defaults[n]=a(l,t.defaults),e.types[n]=s,e.prototype[n]=function(t,i){var o=h(e.defaults.global,e.defaults[n],i||{});return new s(t,o,this)}}else d(\"Name not provided for this chart, so it hasn't been registered\");return i},e.Element=function(t){a(this,t),this.initialize.apply(this,arguments),this.save()},a(e.Element.prototype,{initialize:function(){},restore:function(t){return t?n(t,function(t){this[t]=this._saved[t]},this):a(this,this._saved),this},save:function(){return this._saved=o(this),delete this._saved._saved,this},update:function(t){return n(t,function(t,i){this._saved[i]=this[i],this[i]=t},this),this},transition:function(t,i){return n(t,function(t,e){this[e]=(t-this._saved[e])*i+this._saved[e]},this),this},tooltipPosition:function(){return{x:this.x,y:this.y}},hasValue:function(){return f(this.value)}}),e.Element.extend=r,e.Point=e.Element.extend({display:!0,inRange:function(t,i){var e=this.hitDetectionRadius+this.radius;return Math.pow(t-this.x,2)+Math.pow(i-this.y,2)=this.startAngle&&e.angle<=this.endAngle,o=e.distance>=this.innerRadius&&e.distance<=this.outerRadius;return n&&o},tooltipPosition:function(){var t=this.startAngle+(this.endAngle-this.startAngle)/2,i=(this.outerRadius-this.innerRadius)/2+this.innerRadius;return{x:this.x+Math.cos(t)*i,y:this.y+Math.sin(t)*i}},draw:function(t){var i=this.ctx;i.beginPath(),i.arc(this.x,this.y,this.outerRadius,this.startAngle,this.endAngle),i.arc(this.x,this.y,this.innerRadius,this.endAngle,this.startAngle,!0),i.closePath(),i.strokeStyle=this.strokeColor,i.lineWidth=this.strokeWidth,i.fillStyle=this.fillColor,i.fill(),i.lineJoin=\"bevel\",this.showStroke&&i.stroke()}}),e.Rectangle=e.Element.extend({draw:function(){var t=this.ctx,i=this.width/2,e=this.x-i,s=this.x+i,n=this.base-(this.base-this.y),o=this.strokeWidth/2;this.showStroke&&(e+=o,s-=o,n+=o),t.beginPath(),t.fillStyle=this.fillColor,t.strokeStyle=this.strokeColor,t.lineWidth=this.strokeWidth,t.moveTo(e,this.base),t.lineTo(e,n),t.lineTo(s,n),t.lineTo(s,this.base),t.fill(),this.showStroke&&t.stroke()},height:function(){return this.base-this.y},inRange:function(t,i){return t>=this.x-this.width/2&&t<=this.x+this.width/2&&i>=this.y&&i<=this.base}}),e.Tooltip=e.Element.extend({draw:function(){var t=this.chart.ctx;t.font=M(this.fontSize,this.fontStyle,this.fontFamily),this.xAlign=\"center\",this.yAlign=\"above\";var i=2,e=t.measureText(this.text).width+2*this.xPadding,s=this.fontSize+2*this.yPadding,n=s+this.caretHeight+i;this.x+e/2>this.chart.width?this.xAlign=\"left\":this.x-e/2<0&&(this.xAlign=\"right\"),this.y-n<0&&(this.yAlign=\"below\");var o=this.x-e/2,a=this.y-n;switch(t.fillStyle=this.fillColor,this.yAlign){case\"above\":t.beginPath(),t.moveTo(this.x,this.y-i),t.lineTo(this.x+this.caretHeight,this.y-(i+this.caretHeight)),t.lineTo(this.x-this.caretHeight,this.y-(i+this.caretHeight)),t.closePath(),t.fill();break;case\"below\":a=this.y+i+this.caretHeight,t.beginPath(),t.moveTo(this.x,this.y+i),t.lineTo(this.x+this.caretHeight,this.y+i+this.caretHeight),t.lineTo(this.x-this.caretHeight,this.y+i+this.caretHeight),t.closePath(),t.fill()}switch(this.xAlign){case\"left\":o=this.x-e+(this.cornerRadius+this.caretHeight);break;case\"right\":o=this.x-(this.cornerRadius+this.caretHeight)}z(t,o,a,e,s,this.cornerRadius),t.fill(),t.fillStyle=this.textColor,t.textAlign=\"center\",t.textBaseline=\"middle\",t.fillText(this.text,o+e/2,a+s/2)}}),e.MultiTooltip=e.Element.extend({initialize:function(){this.font=M(this.fontSize,this.fontStyle,this.fontFamily),this.titleFont=M(this.titleFontSize,this.titleFontStyle,this.titleFontFamily),this.height=this.labels.length*this.fontSize+(this.labels.length-1)*(this.fontSize/2)+2*this.yPadding+1.5*this.titleFontSize,this.ctx.font=this.titleFont;var t=this.ctx.measureText(this.title).width,i=W(this.ctx,this.font,this.labels)+this.fontSize+3,e=g([i,t]);this.width=e+2*this.xPadding;var s=this.height/2;this.y-s<0?this.y=s:this.y+s>this.chart.height&&(this.y=this.chart.height-s),this.x>this.chart.width/2?this.x-=this.xOffset+this.width:this.x+=this.xOffset},getLineHeight:function(t){var i=this.y-this.height/2+this.yPadding,e=t-1;return 0===t?i+this.titleFontSize/2:i+(1.5*this.fontSize*e+this.fontSize/2)+1.5*this.titleFontSize},draw:function(){z(this.ctx,this.x,this.y-this.height/2,this.width,this.height,this.cornerRadius);var t=this.ctx;t.fillStyle=this.fillColor,t.fill(),t.closePath(),t.textAlign=\"left\",t.textBaseline=\"middle\",t.fillStyle=this.titleTextColor,t.font=this.titleFont,t.fillText(this.title,this.x+this.xPadding,this.getLineHeight(0)),t.font=this.font,s.each(this.labels,function(i,e){t.fillStyle=this.textColor,t.fillText(i,this.x+this.xPadding+this.fontSize+3,this.getLineHeight(e+1)),t.fillStyle=this.legendColorBackground,t.fillRect(this.x+this.xPadding,this.getLineHeight(e+1)-this.fontSize/2,this.fontSize,this.fontSize),t.fillStyle=this.legendColors[e].fill,t.fillRect(this.x+this.xPadding,this.getLineHeight(e+1)-this.fontSize/2,this.fontSize,this.fontSize)},this)}}),e.Scale=e.Element.extend({initialize:function(){this.fit()},buildYLabels:function(){this.yLabels=[];for(var t=v(this.stepValue),i=0;i<=this.steps;i++)this.yLabels.push(C(this.templateString,{value:(this.min+i*this.stepValue).toFixed(t)}));this.yLabelWidth=this.display&&this.showLabels?W(this.ctx,this.font,this.yLabels):0},addXLabel:function(t){this.xLabels.push(t),this.valuesCount++,this.fit()},removeXLabel:function(){this.xLabels.shift(),this.valuesCount--,this.fit()},fit:function(){this.startPoint=this.display?this.fontSize:0,this.endPoint=this.display?this.height-1.5*this.fontSize-5:this.height,this.startPoint+=this.padding,this.endPoint-=this.padding;var t,i=this.endPoint-this.startPoint;for(this.calculateYRange(i),this.buildYLabels(),this.calculateXLabelRotation();i>this.endPoint-this.startPoint;)i=this.endPoint-this.startPoint,t=this.yLabelWidth,this.calculateYRange(i),this.buildYLabels(),tthis.yLabelWidth+10?e/2:this.yLabelWidth+10,this.xLabelRotation=0,this.display){var n,o=W(this.ctx,this.font,this.xLabels);this.xLabelWidth=o;for(var a=Math.floor(this.calculateX(1)-this.calculateX(0))-6;this.xLabelWidth>a&&0===this.xLabelRotation||this.xLabelWidth>a&&this.xLabelRotation<=90&&this.xLabelRotation>0;)n=Math.cos(x(this.xLabelRotation)),t=n*e,i=n*s,t+this.fontSize/2>this.yLabelWidth+8&&(this.xScalePaddingLeft=t+this.fontSize/2),this.xScalePaddingRight=this.fontSize/2,this.xLabelRotation++,this.xLabelWidth=n*o;this.xLabelRotation>0&&(this.endPoint-=Math.sin(x(this.xLabelRotation))*o+3)}else this.xLabelWidth=0,this.xScalePaddingRight=this.padding,this.xScalePaddingLeft=this.padding},calculateYRange:c,drawingArea:function(){return this.startPoint-this.endPoint},calculateY:function(t){var i=this.drawingArea()/(this.min-this.max);return this.endPoint-i*(t-this.min)},calculateX:function(t){var i=(this.xLabelRotation>0,this.width-(this.xScalePaddingLeft+this.xScalePaddingRight)),e=i/(this.valuesCount-(this.offsetGridLines?0:1)),s=e*t+this.xScalePaddingLeft;return this.offsetGridLines&&(s+=e/2),Math.round(s)},update:function(t){s.extend(this,t),this.fit()},draw:function(){var t=this.ctx,i=(this.endPoint-this.startPoint)/this.steps,e=Math.round(this.xScalePaddingLeft);this.display&&(t.fillStyle=this.textColor,t.font=this.font,n(this.yLabels,function(n,o){var a=this.endPoint-i*o,h=Math.round(a);t.textAlign=\"right\",t.textBaseline=\"middle\",this.showLabels&&t.fillText(n,e-10,a),t.beginPath(),o>0?(t.lineWidth=this.gridLineWidth,t.strokeStyle=this.gridLineColor):(t.lineWidth=this.lineWidth,t.strokeStyle=this.lineColor),h+=s.aliasPixel(t.lineWidth),t.moveTo(e,h),t.lineTo(this.width,h),t.stroke(),t.closePath(),t.lineWidth=this.lineWidth,t.strokeStyle=this.lineColor,t.beginPath(),t.moveTo(e-5,h),t.lineTo(e,h),t.stroke(),t.closePath()},this),n(this.xLabels,function(i,e){var s=this.calculateX(e)+S(this.lineWidth),n=this.calculateX(e-(this.offsetGridLines?.5:0))+S(this.lineWidth),o=this.xLabelRotation>0;t.beginPath(),e>0?(t.lineWidth=this.gridLineWidth,t.strokeStyle=this.gridLineColor):(t.lineWidth=this.lineWidth,t.strokeStyle=this.lineColor),t.moveTo(n,this.endPoint),t.lineTo(n,this.startPoint-3),t.stroke(),t.closePath(),t.lineWidth=this.lineWidth,t.strokeStyle=this.lineColor,t.beginPath(),t.moveTo(n,this.endPoint),t.lineTo(n,this.endPoint+5),t.stroke(),t.closePath(),t.save(),t.translate(s,o?this.endPoint+12:this.endPoint+8),t.rotate(-1*x(this.xLabelRotation)),t.font=this.font,t.textAlign=o?\"right\":\"center\",t.textBaseline=o?\"middle\":\"top\",t.fillText(i,0,0),t.restore()},this))}}),e.RadialScale=e.Element.extend({initialize:function(){this.size=m([this.height,this.width]),this.drawingArea=this.display?this.size/2-(this.fontSize/2+this.backdropPaddingY):this.size/2},calculateCenterOffset:function(t){var i=this.drawingArea/(this.max-this.min);return(t-this.min)*i},update:function(){this.lineArc?this.drawingArea=this.display?this.size/2-(this.fontSize/2+this.backdropPaddingY):this.size/2:this.setScaleSize(),this.buildYLabels()},buildYLabels:function(){this.yLabels=[];for(var t=v(this.stepValue),i=0;i<=this.steps;i++)this.yLabels.push(C(this.templateString,{value:(this.min+i*this.stepValue).toFixed(t)}))},getCircumference:function(){return 2*Math.PI/this.valuesCount},setScaleSize:function(){var t,i,e,s,n,o,a,h,l,r,c,u,d=m([this.height/2-this.pointLabelFontSize-5,this.width/2]),p=this.width,g=0;for(this.ctx.font=M(this.pointLabelFontSize,this.pointLabelFontStyle,this.pointLabelFontFamily),i=0;ip&&(p=t.x+s,n=i),t.x-sp&&(p=t.x+e,n=i):i>this.valuesCount/2&&t.x-e0){var s,n=e*(this.drawingArea/this.steps),o=this.yCenter-n;if(this.lineWidth>0)if(t.strokeStyle=this.lineColor,t.lineWidth=this.lineWidth,this.lineArc)t.beginPath(),t.arc(this.xCenter,this.yCenter,n,0,2*Math.PI),t.closePath(),t.stroke();else{t.beginPath();for(var a=0;a=0;i--){if(this.angleLineWidth>0){var e=this.getPointPosition(i,this.calculateCenterOffset(this.max));t.beginPath(),t.moveTo(this.xCenter,this.yCenter),t.lineTo(e.x,e.y),t.stroke(),t.closePath()}var s=this.getPointPosition(i,this.calculateCenterOffset(this.max)+5);t.font=M(this.pointLabelFontSize,this.pointLabelFontStyle,this.pointLabelFontFamily),t.fillStyle=this.pointLabelFontColor;var o=this.labels.length,a=this.labels.length/2,h=a/2,l=h>i||i>o-h,r=i===h||i===o-h;t.textAlign=0===i?\"center\":i===a?\"center\":a>i?\"left\":\"right\",t.textBaseline=r?\"middle\":l?\"bottom\":\"top\",t.fillText(this.labels[i],s.x,s.y)}}}}}),s.addEvent(window,\"resize\",function(){var t;return function(){clearTimeout(t),t=setTimeout(function(){n(e.instances,function(t){t.options.responsive&&t.resize(t.render,!0)})},50)}}()),p?define(function(){return e}):\"object\"==typeof module&&module.exports&&(module.exports=e),t.Chart=e,e.noConflict=function(){return t.Chart=i,e}}).call(this),function(){\"use strict\";var t=this,i=t.Chart,e=i.helpers,s={scaleBeginAtZero:!0,scaleShowGridLines:!0,scaleGridLineColor:\"rgba(0,0,0,.05)\",scaleGridLineWidth:1,barShowStroke:!0,barStrokeWidth:2,barValueSpacing:5,barDatasetSpacing:1,legendTemplate:'-legend\"><% for (var i=0; i- \"><%if(datasets[i].label){%><%=datasets[i].label%><%}%>
<%}%>
'};i.Type.extend({name:\"Bar\",defaults:s,initialize:function(t){var s=this.options;this.ScaleClass=i.Scale.extend({offsetGridLines:!0,calculateBarX:function(t,i,e){var n=this.calculateBaseWidth(),o=this.calculateX(e)-n/2,a=this.calculateBarWidth(t);return o+a*i+i*s.barDatasetSpacing+a/2},calculateBaseWidth:function(){return this.calculateX(1)-this.calculateX(0)-2*s.barValueSpacing},calculateBarWidth:function(t){var i=this.calculateBaseWidth()-(t-1)*s.barDatasetSpacing;return i/t}}),this.datasets=[],this.options.showTooltips&&e.bindEvents(this,this.options.tooltipEvents,function(t){var i=\"mouseout\"!==t.type?this.getBarsAtEvent(t):[];this.eachBars(function(t){t.restore([\"fillColor\",\"strokeColor\"])}),e.each(i,function(t){t.fillColor=t.highlightFill,t.strokeColor=t.highlightStroke}),this.showTooltip(i)}),this.BarClass=i.Rectangle.extend({strokeWidth:this.options.barStrokeWidth,showStroke:this.options.barShowStroke,ctx:this.chart.ctx}),e.each(t.datasets,function(i){var s={label:i.label||null,fillColor:i.fillColor,strokeColor:i.strokeColor,bars:[]};this.datasets.push(s),e.each(i.data,function(e,n){s.bars.push(new this.BarClass({value:e,label:t.labels[n],datasetLabel:i.label,strokeColor:i.strokeColor,fillColor:i.fillColor,highlightFill:i.highlightFill||i.fillColor,highlightStroke:i.highlightStroke||i.strokeColor}))},this)},this),this.buildScale(t.labels),this.BarClass.prototype.base=this.scale.endPoint,this.eachBars(function(t,i,s){e.extend(t,{width:this.scale.calculateBarWidth(this.datasets.length),x:this.scale.calculateBarX(this.datasets.length,s,i),y:this.scale.endPoint}),t.save()},this),this.render()},update:function(){this.scale.update(),e.each(this.activeElements,function(t){t.restore([\"fillColor\",\"strokeColor\"])}),this.eachBars(function(t){t.save()}),this.render()},eachBars:function(t){e.each(this.datasets,function(i,s){e.each(i.bars,t,this,s)},this)},getBarsAtEvent:function(t){for(var i,s=[],n=e.getRelativePosition(t),o=function(t){s.push(t.bars[i])},a=0;a-legend\"><% for (var i=0; i\"><%if(segments[i].label){%><%=segments[i].label%><%}%><%}%>'};\r\ni.Type.extend({name:\"Doughnut\",defaults:s,initialize:function(t){this.segments=[],this.outerRadius=(e.min([this.chart.width,this.chart.height])-this.options.segmentStrokeWidth/2)/2,this.SegmentArc=i.Arc.extend({ctx:this.chart.ctx,x:this.chart.width/2,y:this.chart.height/2}),this.options.showTooltips&&e.bindEvents(this,this.options.tooltipEvents,function(t){var i=\"mouseout\"!==t.type?this.getSegmentsAtEvent(t):[];e.each(this.segments,function(t){t.restore([\"fillColor\"])}),e.each(i,function(t){t.fillColor=t.highlightColor}),this.showTooltip(i)}),this.calculateTotal(t),e.each(t,function(t,i){this.addData(t,i,!0)},this),this.render()},getSegmentsAtEvent:function(t){var i=[],s=e.getRelativePosition(t);return e.each(this.segments,function(t){t.inRange(s.x,s.y)&&i.push(t)},this),i},addData:function(t,i,e){var s=i||this.segments.length;this.segments.splice(s,0,new this.SegmentArc({value:t.value,outerRadius:this.options.animateScale?0:this.outerRadius,innerRadius:this.options.animateScale?0:this.outerRadius/100*this.options.percentageInnerCutout,fillColor:t.color,highlightColor:t.highlight||t.color,showStroke:this.options.segmentShowStroke,strokeWidth:this.options.segmentStrokeWidth,strokeColor:this.options.segmentStrokeColor,startAngle:1.5*Math.PI,circumference:this.options.animateRotate?0:this.calculateCircumference(t.value),label:t.label})),e||(this.reflow(),this.update())},calculateCircumference:function(t){return 2*Math.PI*(t/this.total)},calculateTotal:function(t){this.total=0,e.each(t,function(t){this.total+=t.value},this)},update:function(){this.calculateTotal(this.segments),e.each(this.activeElements,function(t){t.restore([\"fillColor\"])}),e.each(this.segments,function(t){t.save()}),this.render()},removeData:function(t){var i=e.isNumber(t)?t:this.segments.length-1;this.segments.splice(i,1),this.reflow(),this.update()},reflow:function(){e.extend(this.SegmentArc.prototype,{x:this.chart.width/2,y:this.chart.height/2}),this.outerRadius=(e.min([this.chart.width,this.chart.height])-this.options.segmentStrokeWidth/2)/2,e.each(this.segments,function(t){t.update({outerRadius:this.outerRadius,innerRadius:this.outerRadius/100*this.options.percentageInnerCutout})},this)},draw:function(t){var i=t?t:1;this.clear(),e.each(this.segments,function(t,e){t.transition({circumference:this.calculateCircumference(t.value),outerRadius:this.outerRadius,innerRadius:this.outerRadius/100*this.options.percentageInnerCutout},i),t.endAngle=t.startAngle+t.circumference,t.draw(),0===e&&(t.startAngle=1.5*Math.PI),e-legend\"><% for (var i=0; i\"><%if(datasets[i].label){%><%=datasets[i].label%><%}%><%}%>'};i.Type.extend({name:\"Line\",defaults:s,initialize:function(t){this.PointClass=i.Point.extend({strokeWidth:this.options.pointDotStrokeWidth,radius:this.options.pointDotRadius,display:this.options.pointDot,hitDetectionRadius:this.options.pointHitDetectionRadius,ctx:this.chart.ctx,inRange:function(t){return Math.pow(t-this.x,2)0&&ithis.scale.endPoint?t.controlPoints.outer.y=this.scale.endPoint:t.controlPoints.outer.ythis.scale.endPoint?t.controlPoints.inner.y=this.scale.endPoint:t.controlPoints.inner.y0&&(s.lineTo(h[h.length-1].x,this.scale.endPoint),s.lineTo(h[0].x,this.scale.endPoint),s.fillStyle=t.fillColor,s.closePath(),s.fill()),e.each(h,function(t){t.draw()})},this)}})}.call(this),function(){\"use strict\";var t=this,i=t.Chart,e=i.helpers,s={scaleShowLabelBackdrop:!0,scaleBackdropColor:\"rgba(255,255,255,0.75)\",scaleBeginAtZero:!0,scaleBackdropPaddingY:2,scaleBackdropPaddingX:2,scaleShowLine:!0,segmentShowStroke:!0,segmentStrokeColor:\"#fff\",segmentStrokeWidth:2,animationSteps:100,animationEasing:\"easeOutBounce\",animateRotate:!0,animateScale:!1,legendTemplate:'-legend\"><% for (var i=0; i- \"><%if(segments[i].label){%><%=segments[i].label%><%}%>
<%}%>
'};i.Type.extend({name:\"PolarArea\",defaults:s,initialize:function(t){this.segments=[],this.SegmentArc=i.Arc.extend({showStroke:this.options.segmentShowStroke,strokeWidth:this.options.segmentStrokeWidth,strokeColor:this.options.segmentStrokeColor,ctx:this.chart.ctx,innerRadius:0,x:this.chart.width/2,y:this.chart.height/2}),this.scale=new i.RadialScale({display:this.options.showScale,fontStyle:this.options.scaleFontStyle,fontSize:this.options.scaleFontSize,fontFamily:this.options.scaleFontFamily,fontColor:this.options.scaleFontColor,showLabels:this.options.scaleShowLabels,showLabelBackdrop:this.options.scaleShowLabelBackdrop,backdropColor:this.options.scaleBackdropColor,backdropPaddingY:this.options.scaleBackdropPaddingY,backdropPaddingX:this.options.scaleBackdropPaddingX,lineWidth:this.options.scaleShowLine?this.options.scaleLineWidth:0,lineColor:this.options.scaleLineColor,lineArc:!0,width:this.chart.width,height:this.chart.height,xCenter:this.chart.width/2,yCenter:this.chart.height/2,ctx:this.chart.ctx,templateString:this.options.scaleLabel,valuesCount:t.length}),this.updateScaleRange(t),this.scale.update(),e.each(t,function(t,i){this.addData(t,i,!0)},this),this.options.showTooltips&&e.bindEvents(this,this.options.tooltipEvents,function(t){var i=\"mouseout\"!==t.type?this.getSegmentsAtEvent(t):[];e.each(this.segments,function(t){t.restore([\"fillColor\"])}),e.each(i,function(t){t.fillColor=t.highlightColor}),this.showTooltip(i)}),this.render()},getSegmentsAtEvent:function(t){var i=[],s=e.getRelativePosition(t);return e.each(this.segments,function(t){t.inRange(s.x,s.y)&&i.push(t)},this),i},addData:function(t,i,e){var s=i||this.segments.length;this.segments.splice(s,0,new this.SegmentArc({fillColor:t.color,highlightColor:t.highlight||t.color,label:t.label,value:t.value,outerRadius:this.options.animateScale?0:this.scale.calculateCenterOffset(t.value),circumference:this.options.animateRotate?0:this.scale.getCircumference(),startAngle:1.5*Math.PI})),e||(this.reflow(),this.update())},removeData:function(t){var i=e.isNumber(t)?t:this.segments.length-1;this.segments.splice(i,1),this.reflow(),this.update()},calculateTotal:function(t){this.total=0,e.each(t,function(t){this.total+=t.value},this),this.scale.valuesCount=this.segments.length},updateScaleRange:function(t){var i=[];e.each(t,function(t){i.push(t.value)});var s=this.options.scaleOverride?{steps:this.options.scaleSteps,stepValue:this.options.scaleStepWidth,min:this.options.scaleStartValue,max:this.options.scaleStartValue+this.options.scaleSteps*this.options.scaleStepWidth}:e.calculateScaleRange(i,e.min([this.chart.width,this.chart.height])/2,this.options.scaleFontSize,this.options.scaleBeginAtZero,this.options.scaleIntegersOnly);e.extend(this.scale,s,{size:e.min([this.chart.width,this.chart.height]),xCenter:this.chart.width/2,yCenter:this.chart.height/2})},update:function(){this.calculateTotal(this.segments),e.each(this.segments,function(t){t.save()}),this.render()},reflow:function(){e.extend(this.SegmentArc.prototype,{x:this.chart.width/2,y:this.chart.height/2}),this.updateScaleRange(this.segments),this.scale.update(),e.extend(this.scale,{xCenter:this.chart.width/2,yCenter:this.chart.height/2}),e.each(this.segments,function(t){t.update({outerRadius:this.scale.calculateCenterOffset(t.value)})},this)},draw:function(t){var i=t||1;this.clear(),e.each(this.segments,function(t,e){t.transition({circumference:this.scale.getCircumference(),outerRadius:this.scale.calculateCenterOffset(t.value)},i),t.endAngle=t.startAngle+t.circumference,0===e&&(t.startAngle=1.5*Math.PI),e-legend\"><% for (var i=0; i\"><%if(datasets[i].label){%><%=datasets[i].label%><%}%><%}%>'},initialize:function(t){this.PointClass=i.Point.extend({strokeWidth:this.options.pointDotStrokeWidth,radius:this.options.pointDotRadius,display:this.options.pointDot,hitDetectionRadius:this.options.pointHitDetectionRadius,ctx:this.chart.ctx}),this.datasets=[],this.buildScale(t),this.options.showTooltips&&e.bindEvents(this,this.options.tooltipEvents,function(t){var i=\"mouseout\"!==t.type?this.getPointsAtEvent(t):[];this.eachPoints(function(t){t.restore([\"fillColor\",\"strokeColor\"])}),e.each(i,function(t){t.fillColor=t.highlightFill,t.strokeColor=t.highlightStroke}),this.showTooltip(i)}),e.each(t.datasets,function(i){var s={label:i.label||null,fillColor:i.fillColor,strokeColor:i.strokeColor,pointColor:i.pointColor,pointStrokeColor:i.pointStrokeColor,points:[]};this.datasets.push(s),e.each(i.data,function(e,n){var o;this.scale.animation||(o=this.scale.getPointPosition(n,this.scale.calculateCenterOffset(e))),s.points.push(new this.PointClass({value:e,label:t.labels[n],datasetLabel:i.label,x:this.options.animation?this.scale.xCenter:o.x,y:this.options.animation?this.scale.yCenter:o.y,strokeColor:i.pointStrokeColor,fillColor:i.pointColor,highlightFill:i.pointHighlightFill||i.pointColor,highlightStroke:i.pointHighlightStroke||i.pointStrokeColor}))},this)},this),this.render()},eachPoints:function(t){e.each(this.datasets,function(i){e.each(i.points,t,this)},this)},getPointsAtEvent:function(t){var i=e.getRelativePosition(t),s=e.getAngleFromPoint({x:this.scale.xCenter,y:this.scale.yCenter},i),n=2*Math.PI/this.scale.valuesCount,o=Math.round((s.angle-1.5*Math.PI)/n),a=[];return(o>=this.scale.valuesCount||0>o)&&(o=0),s.distance<=this.scale.drawingArea&&e.each(this.datasets,function(t){a.push(t.points[o])}),a},buildScale:function(t){this.scale=new i.RadialScale({display:this.options.showScale,fontStyle:this.options.scaleFontStyle,fontSize:this.options.scaleFontSize,fontFamily:this.options.scaleFontFamily,fontColor:this.options.scaleFontColor,showLabels:this.options.scaleShowLabels,showLabelBackdrop:this.options.scaleShowLabelBackdrop,backdropColor:this.options.scaleBackdropColor,backdropPaddingY:this.options.scaleBackdropPaddingY,backdropPaddingX:this.options.scaleBackdropPaddingX,lineWidth:this.options.scaleShowLine?this.options.scaleLineWidth:0,lineColor:this.options.scaleLineColor,angleLineColor:this.options.angleLineColor,angleLineWidth:this.options.angleShowLineOut?this.options.angleLineWidth:0,pointLabelFontColor:this.options.pointLabelFontColor,pointLabelFontSize:this.options.pointLabelFontSize,pointLabelFontFamily:this.options.pointLabelFontFamily,pointLabelFontStyle:this.options.pointLabelFontStyle,height:this.chart.height,width:this.chart.width,xCenter:this.chart.width/2,yCenter:this.chart.height/2,ctx:this.chart.ctx,templateString:this.options.scaleLabel,labels:t.labels,valuesCount:t.datasets[0].data.length}),this.scale.setScaleSize(),this.updateScaleRange(t.datasets),this.scale.buildYLabels()},updateScaleRange:function(t){var i=function(){var i=[];return e.each(t,function(t){t.data?i=i.concat(t.data):e.each(t.points,function(t){i.push(t.value)})}),i}(),s=this.options.scaleOverride?{steps:this.options.scaleSteps,stepValue:this.options.scaleStepWidth,min:this.options.scaleStartValue,max:this.options.scaleStartValue+this.options.scaleSteps*this.options.scaleStepWidth}:e.calculateScaleRange(i,e.min([this.chart.width,this.chart.height])/2,this.options.scaleFontSize,this.options.scaleBeginAtZero,this.options.scaleIntegersOnly);e.extend(this.scale,s)},addData:function(t,i){this.scale.valuesCount++,e.each(t,function(t,e){var s=this.scale.getPointPosition(this.scale.valuesCount,this.scale.calculateCenterOffset(t));this.datasets[e].points.push(new this.PointClass({value:t,label:i,x:s.x,y:s.y,strokeColor:this.datasets[e].pointStrokeColor,fillColor:this.datasets[e].pointColor}))},this),this.scale.labels.push(i),this.reflow(),this.update()},removeData:function(){this.scale.valuesCount--,this.scale.labels.shift(),e.each(this.datasets,function(t){t.points.shift()},this),this.reflow(),this.update()},update:function(){this.eachPoints(function(t){t.save()}),this.reflow(),this.render()},reflow:function(){e.extend(this.scale,{width:this.chart.width,height:this.chart.height,size:e.min([this.chart.width,this.chart.height]),xCenter:this.chart.width/2,yCenter:this.chart.height/2}),this.updateScaleRange(this.datasets),this.scale.setScaleSize(),this.scale.buildYLabels()},draw:function(t){var i=t||1,s=this.chart.ctx;this.clear(),this.scale.draw(),e.each(this.datasets,function(t){e.each(t.points,function(t,e){t.hasValue()&&t.transition(this.scale.getPointPosition(e,this.scale.calculateCenterOffset(t.value)),i)},this),s.lineWidth=this.options.datasetStrokeWidth,s.strokeStyle=t.strokeColor,s.beginPath(),e.each(t.points,function(t,i){0===i?s.moveTo(t.x,t.y):s.lineTo(t.x,t.y)},this),s.closePath(),s.stroke(),s.fillStyle=t.fillColor,s.fill(),e.each(t.points,function(t){t.hasValue()&&t.draw()})},this)}})}.call(this);"],"sourceRoot":"/source/"}