\",\r\n\toptions: {\r\n\t\tdisabled: false,\r\n\r\n\t\t// callbacks\r\n\t\tcreate: null\r\n\t},\r\n\t_createWidget: function( options, element ) {\r\n\t\telement = $( element || this.defaultElement || this )[ 0 ];\r\n\t\tthis.element = $( element );\r\n\t\tthis.uuid = uuid++;\r\n\t\tthis.eventNamespace = \".\" + this.widgetName + this.uuid;\r\n\t\tthis.options = $.widget.extend( {},\r\n\t\t\tthis.options,\r\n\t\t\tthis._getCreateOptions(),\r\n\t\t\toptions );\r\n\r\n\t\tthis.bindings = $();\r\n\t\tthis.hoverable = $();\r\n\t\tthis.focusable = $();\r\n\r\n\t\tif ( element !== this ) {\r\n\t\t\t$.data( element, this.widgetFullName, this );\r\n\t\t\tthis._on( true, this.element, {\r\n\t\t\t\tremove: function( event ) {\r\n\t\t\t\t\tif ( event.target === element ) {\r\n\t\t\t\t\t\tthis.destroy();\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t});\r\n\t\t\tthis.document = $( element.style ?\r\n\t\t\t\t// element within the document\r\n\t\t\t\telement.ownerDocument :\r\n\t\t\t\t// element is window or document\r\n\t\t\t\telement.document || element );\r\n\t\t\tthis.window = $( this.document[0].defaultView || this.document[0].parentWindow );\r\n\t\t}\r\n\r\n\t\tthis._create();\r\n\t\tthis._trigger( \"create\", null, this._getCreateEventData() );\r\n\t\tthis._init();\r\n\t},\r\n\t_getCreateOptions: $.noop,\r\n\t_getCreateEventData: $.noop,\r\n\t_create: $.noop,\r\n\t_init: $.noop,\r\n\r\n\tdestroy: function() {\r\n\t\tthis._destroy();\r\n\t\t// we can probably remove the unbind calls in 2.0\r\n\t\t// all event bindings should go through this._on()\r\n\t\tthis.element\r\n\t\t\t.unbind( this.eventNamespace )\r\n\t\t\t// 1.9 BC for #7810\r\n\t\t\t// TODO remove dual storage\r\n\t\t\t.removeData( this.widgetName )\r\n\t\t\t.removeData( this.widgetFullName )\r\n\t\t\t// support: jquery <1.6.3\r\n\t\t\t// http://bugs.jquery.com/ticket/9413\r\n\t\t\t.removeData( $.camelCase( this.widgetFullName ) );\r\n\t\tthis.widget()\r\n\t\t\t.unbind( this.eventNamespace )\r\n\t\t\t.removeAttr( \"aria-disabled\" )\r\n\t\t\t.removeClass(\r\n\t\t\t\tthis.widgetFullName + \"-disabled \" +\r\n\t\t\t\t\"ui-state-disabled\" );\r\n\r\n\t\t// clean up events and states\r\n\t\tthis.bindings.unbind( this.eventNamespace );\r\n\t\tthis.hoverable.removeClass( \"ui-state-hover\" );\r\n\t\tthis.focusable.removeClass( \"ui-state-focus\" );\r\n\t},\r\n\t_destroy: $.noop,\r\n\r\n\twidget: function() {\r\n\t\treturn this.element;\r\n\t},\r\n\r\n\toption: function( key, value ) {\r\n\t\tvar options = key,\r\n\t\t\tparts,\r\n\t\t\tcurOption,\r\n\t\t\ti;\r\n\r\n\t\tif ( arguments.length === 0 ) {\r\n\t\t\t// don't return a reference to the internal hash\r\n\t\t\treturn $.widget.extend( {}, this.options );\r\n\t\t}\r\n\r\n\t\tif ( typeof key === \"string\" ) {\r\n\t\t\t// handle nested keys, e.g., \"foo.bar\" => { foo: { bar: ___ } }\r\n\t\t\toptions = {};\r\n\t\t\tparts = key.split( \".\" );\r\n\t\t\tkey = parts.shift();\r\n\t\t\tif ( parts.length ) {\r\n\t\t\t\tcurOption = options[ key ] = $.widget.extend( {}, this.options[ key ] );\r\n\t\t\t\tfor ( i = 0; i < parts.length - 1; i++ ) {\r\n\t\t\t\t\tcurOption[ parts[ i ] ] = curOption[ parts[ i ] ] || {};\r\n\t\t\t\t\tcurOption = curOption[ parts[ i ] ];\r\n\t\t\t\t}\r\n\t\t\t\tkey = parts.pop();\r\n\t\t\t\tif ( value === undefined ) {\r\n\t\t\t\t\treturn curOption[ key ] === undefined ? null : curOption[ key ];\r\n\t\t\t\t}\r\n\t\t\t\tcurOption[ key ] = value;\r\n\t\t\t} else {\r\n\t\t\t\tif ( value === undefined ) {\r\n\t\t\t\t\treturn this.options[ key ] === undefined ? null : this.options[ key ];\r\n\t\t\t\t}\r\n\t\t\t\toptions[ key ] = value;\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tthis._setOptions( options );\r\n\r\n\t\treturn this;\r\n\t},\r\n\t_setOptions: function( options ) {\r\n\t\tvar key;\r\n\r\n\t\tfor ( key in options ) {\r\n\t\t\tthis._setOption( key, options[ key ] );\r\n\t\t}\r\n\r\n\t\treturn this;\r\n\t},\r\n\t_setOption: function( key, value ) {\r\n\t\tthis.options[ key ] = value;\r\n\r\n\t\tif ( key === \"disabled\" ) {\r\n\t\t\tthis.widget()\r\n\t\t\t\t.toggleClass( this.widgetFullName + \"-disabled ui-state-disabled\", !!value )\r\n\t\t\t\t.attr( \"aria-disabled\", value );\r\n\t\t\tthis.hoverable.removeClass( \"ui-state-hover\" );\r\n\t\t\tthis.focusable.removeClass( \"ui-state-focus\" );\r\n\t\t}\r\n\r\n\t\treturn this;\r\n\t},\r\n\r\n\tenable: function() {\r\n\t\treturn this._setOption( \"disabled\", false );\r\n\t},\r\n\tdisable: function() {\r\n\t\treturn this._setOption( \"disabled\", true );\r\n\t},\r\n\r\n\t_on: function( suppressDisabledCheck, element, handlers ) {\r\n\t\tvar delegateElement,\r\n\t\t\tinstance = this;\r\n\r\n\t\t// no suppressDisabledCheck flag, shuffle arguments\r\n\t\tif ( typeof suppressDisabledCheck !== \"boolean\" ) {\r\n\t\t\thandlers = element;\r\n\t\t\telement = suppressDisabledCheck;\r\n\t\t\tsuppressDisabledCheck = false;\r\n\t\t}\r\n\r\n\t\t// no element argument, shuffle and use this.element\r\n\t\tif ( !handlers ) {\r\n\t\t\thandlers = element;\r\n\t\t\telement = this.element;\r\n\t\t\tdelegateElement = this.widget();\r\n\t\t} else {\r\n\t\t\t// accept selectors, DOM elements\r\n\t\t\telement = delegateElement = $( element );\r\n\t\t\tthis.bindings = this.bindings.add( element );\r\n\t\t}\r\n\r\n\t\t$.each( handlers, function( event, handler ) {\r\n\t\t\tfunction handlerProxy() {\r\n\t\t\t\t// allow widgets to customize the disabled handling\r\n\t\t\t\t// - disabled as an array instead of boolean\r\n\t\t\t\t// - disabled class as method for disabling individual parts\r\n\t\t\t\tif ( !suppressDisabledCheck &&\r\n\t\t\t\t\t\t( instance.options.disabled === true ||\r\n\t\t\t\t\t\t\t$( this ).hasClass( \"ui-state-disabled\" ) ) ) {\r\n\t\t\t\t\treturn;\r\n\t\t\t\t}\r\n\t\t\t\treturn ( typeof handler === \"string\" ? instance[ handler ] : handler )\r\n\t\t\t\t\t.apply( instance, arguments );\r\n\t\t\t}\r\n\r\n\t\t\t// copy the guid so direct unbinding works\r\n\t\t\tif ( typeof handler !== \"string\" ) {\r\n\t\t\t\thandlerProxy.guid = handler.guid =\r\n\t\t\t\t\thandler.guid || handlerProxy.guid || $.guid++;\r\n\t\t\t}\r\n\r\n\t\t\tvar match = event.match( /^(\\w+)\\s*(.*)$/ ),\r\n\t\t\t\teventName = match[1] + instance.eventNamespace,\r\n\t\t\t\tselector = match[2];\r\n\t\t\tif ( selector ) {\r\n\t\t\t\tdelegateElement.delegate( selector, eventName, handlerProxy );\r\n\t\t\t} else {\r\n\t\t\t\telement.bind( eventName, handlerProxy );\r\n\t\t\t}\r\n\t\t});\r\n\t},\r\n\r\n\t_off: function( element, eventName ) {\r\n\t\teventName = (eventName || \"\").split( \" \" ).join( this.eventNamespace + \" \" ) + this.eventNamespace;\r\n\t\telement.unbind( eventName ).undelegate( eventName );\r\n\t},\r\n\r\n\t_delay: function( handler, delay ) {\r\n\t\tfunction handlerProxy() {\r\n\t\t\treturn ( typeof handler === \"string\" ? instance[ handler ] : handler )\r\n\t\t\t\t.apply( instance, arguments );\r\n\t\t}\r\n\t\tvar instance = this;\r\n\t\treturn setTimeout( handlerProxy, delay || 0 );\r\n\t},\r\n\r\n\t_hoverable: function( element ) {\r\n\t\tthis.hoverable = this.hoverable.add( element );\r\n\t\tthis._on( element, {\r\n\t\t\tmouseenter: function( event ) {\r\n\t\t\t\t$( event.currentTarget ).addClass( \"ui-state-hover\" );\r\n\t\t\t},\r\n\t\t\tmouseleave: function( event ) {\r\n\t\t\t\t$( event.currentTarget ).removeClass( \"ui-state-hover\" );\r\n\t\t\t}\r\n\t\t});\r\n\t},\r\n\r\n\t_focusable: function( element ) {\r\n\t\tthis.focusable = this.focusable.add( element );\r\n\t\tthis._on( element, {\r\n\t\t\tfocusin: function( event ) {\r\n\t\t\t\t$( event.currentTarget ).addClass( \"ui-state-focus\" );\r\n\t\t\t},\r\n\t\t\tfocusout: function( event ) {\r\n\t\t\t\t$( event.currentTarget ).removeClass( \"ui-state-focus\" );\r\n\t\t\t}\r\n\t\t});\r\n\t},\r\n\r\n\t_trigger: function( type, event, data ) {\r\n\t\tvar prop, orig,\r\n\t\t\tcallback = this.options[ type ];\r\n\r\n\t\tdata = data || {};\r\n\t\tevent = $.Event( event );\r\n\t\tevent.type = ( type === this.widgetEventPrefix ?\r\n\t\t\ttype :\r\n\t\t\tthis.widgetEventPrefix + type ).toLowerCase();\r\n\t\t// the original event may come from any element\r\n\t\t// so we need to reset the target on the new event\r\n\t\tevent.target = this.element[ 0 ];\r\n\r\n\t\t// copy original event properties over to the new event\r\n\t\torig = event.originalEvent;\r\n\t\tif ( orig ) {\r\n\t\t\tfor ( prop in orig ) {\r\n\t\t\t\tif ( !( prop in event ) ) {\r\n\t\t\t\t\tevent[ prop ] = orig[ prop ];\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tthis.element.trigger( event, data );\r\n\t\treturn !( $.isFunction( callback ) &&\r\n\t\t\tcallback.apply( this.element[0], [ event ].concat( data ) ) === false ||\r\n\t\t\tevent.isDefaultPrevented() );\r\n\t}\r\n};\r\n\r\n$.each( { show: \"fadeIn\", hide: \"fadeOut\" }, function( method, defaultEffect ) {\r\n\t$.Widget.prototype[ \"_\" + method ] = function( element, options, callback ) {\r\n\t\tif ( typeof options === \"string\" ) {\r\n\t\t\toptions = { effect: options };\r\n\t\t}\r\n\t\tvar hasOptions,\r\n\t\t\teffectName = !options ?\r\n\t\t\t\tmethod :\r\n\t\t\t\toptions === true || typeof options === \"number\" ?\r\n\t\t\t\t\tdefaultEffect :\r\n\t\t\t\t\toptions.effect || defaultEffect;\r\n\t\toptions = options || {};\r\n\t\tif ( typeof options === \"number\" ) {\r\n\t\t\toptions = { duration: options };\r\n\t\t}\r\n\t\thasOptions = !$.isEmptyObject( options );\r\n\t\toptions.complete = callback;\r\n\t\tif ( options.delay ) {\r\n\t\t\telement.delay( options.delay );\r\n\t\t}\r\n\t\tif ( hasOptions && $.effects && $.effects.effect[ effectName ] ) {\r\n\t\t\telement[ method ]( options );\r\n\t\t} else if ( effectName !== method && element[ effectName ] ) {\r\n\t\t\telement[ effectName ]( options.duration, options.easing, callback );\r\n\t\t} else {\r\n\t\t\telement.queue(function( next ) {\r\n\t\t\t\t$( this )[ method ]();\r\n\t\t\t\tif ( callback ) {\r\n\t\t\t\t\tcallback.call( element[ 0 ] );\r\n\t\t\t\t}\r\n\t\t\t\tnext();\r\n\t\t\t});\r\n\t\t}\r\n\t};\r\n});\r\n\r\n})( jQuery );\r\n(function( $, undefined ) {\r\n\r\n$.ui = $.ui || {};\r\n\r\nvar cachedScrollbarWidth,\r\n\tmax = Math.max,\r\n\tabs = Math.abs,\r\n\tround = Math.round,\r\n\trhorizontal = /left|center|right/,\r\n\trvertical = /top|center|bottom/,\r\n\troffset = /[\\+\\-]\\d+(\\.[\\d]+)?%?/,\r\n\trposition = /^\\w+/,\r\n\trpercent = /%$/,\r\n\t_position = $.fn.position;\r\n\r\nfunction getOffsets( offsets, width, height ) {\r\n\treturn [\r\n\t\tparseFloat( offsets[ 0 ] ) * ( rpercent.test( offsets[ 0 ] ) ? width / 100 : 1 ),\r\n\t\tparseFloat( offsets[ 1 ] ) * ( rpercent.test( offsets[ 1 ] ) ? height / 100 : 1 )\r\n\t];\r\n}\r\n\r\nfunction parseCss( element, property ) {\r\n\treturn parseInt( $.css( element, property ), 10 ) || 0;\r\n}\r\n\r\nfunction getDimensions( elem ) {\r\n\tvar raw = elem[0];\r\n\tif ( raw.nodeType === 9 ) {\r\n\t\treturn {\r\n\t\t\twidth: elem.width(),\r\n\t\t\theight: elem.height(),\r\n\t\t\toffset: { top: 0, left: 0 }\r\n\t\t};\r\n\t}\r\n\tif ( $.isWindow( raw ) ) {\r\n\t\treturn {\r\n\t\t\twidth: elem.width(),\r\n\t\t\theight: elem.height(),\r\n\t\t\toffset: { top: elem.scrollTop(), left: elem.scrollLeft() }\r\n\t\t};\r\n\t}\r\n\tif ( raw.preventDefault ) {\r\n\t\treturn {\r\n\t\t\twidth: 0,\r\n\t\t\theight: 0,\r\n\t\t\toffset: { top: raw.pageY, left: raw.pageX }\r\n\t\t};\r\n\t}\r\n\treturn {\r\n\t\twidth: elem.outerWidth(),\r\n\t\theight: elem.outerHeight(),\r\n\t\toffset: elem.offset()\r\n\t};\r\n}\r\n\r\n$.position = {\r\n\tscrollbarWidth: function() {\r\n\t\tif ( cachedScrollbarWidth !== undefined ) {\r\n\t\t\treturn cachedScrollbarWidth;\r\n\t\t}\r\n\t\tvar w1, w2,\r\n\t\t\tdiv = $( \"
\" ),\r\n\t\t\tinnerDiv = div.children()[0];\r\n\r\n\t\t$( \"body\" ).append( div );\r\n\t\tw1 = innerDiv.offsetWidth;\r\n\t\tdiv.css( \"overflow\", \"scroll\" );\r\n\r\n\t\tw2 = innerDiv.offsetWidth;\r\n\r\n\t\tif ( w1 === w2 ) {\r\n\t\t\tw2 = div[0].clientWidth;\r\n\t\t}\r\n\r\n\t\tdiv.remove();\r\n\r\n\t\treturn (cachedScrollbarWidth = w1 - w2);\r\n\t},\r\n\tgetScrollInfo: function( within ) {\r\n\t\tvar overflowX = within.isWindow ? \"\" : within.element.css( \"overflow-x\" ),\r\n\t\t\toverflowY = within.isWindow ? \"\" : within.element.css( \"overflow-y\" ),\r\n\t\t\thasOverflowX = overflowX === \"scroll\" ||\r\n\t\t\t\t( overflowX === \"auto\" && within.width < within.element[0].scrollWidth ),\r\n\t\t\thasOverflowY = overflowY === \"scroll\" ||\r\n\t\t\t\t( overflowY === \"auto\" && within.height < within.element[0].scrollHeight );\r\n\t\treturn {\r\n\t\t\twidth: hasOverflowX ? $.position.scrollbarWidth() : 0,\r\n\t\t\theight: hasOverflowY ? $.position.scrollbarWidth() : 0\r\n\t\t};\r\n\t},\r\n\tgetWithinInfo: function( element ) {\r\n\t\tvar withinElement = $( element || window ),\r\n\t\t\tisWindow = $.isWindow( withinElement[0] );\r\n\t\treturn {\r\n\t\t\telement: withinElement,\r\n\t\t\tisWindow: isWindow,\r\n\t\t\toffset: withinElement.offset() || { left: 0, top: 0 },\r\n\t\t\tscrollLeft: withinElement.scrollLeft(),\r\n\t\t\tscrollTop: withinElement.scrollTop(),\r\n\t\t\twidth: isWindow ? withinElement.width() : withinElement.outerWidth(),\r\n\t\t\theight: isWindow ? withinElement.height() : withinElement.outerHeight()\r\n\t\t};\r\n\t}\r\n};\r\n\r\n$.fn.position = function( options ) {\r\n\tif ( !options || !options.of ) {\r\n\t\treturn _position.apply( this, arguments );\r\n\t}\r\n\r\n\t// make a copy, we don't want to modify arguments\r\n\toptions = $.extend( {}, options );\r\n\r\n\tvar atOffset, targetWidth, targetHeight, targetOffset, basePosition, dimensions,\r\n\t\ttarget = $( options.of ),\r\n\t\twithin = $.position.getWithinInfo( options.within ),\r\n\t\tscrollInfo = $.position.getScrollInfo( within ),\r\n\t\tcollision = ( options.collision || \"flip\" ).split( \" \" ),\r\n\t\toffsets = {};\r\n\r\n\tdimensions = getDimensions( target );\r\n\tif ( target[0].preventDefault ) {\r\n\t\t// force left top to allow flipping\r\n\t\toptions.at = \"left top\";\r\n\t}\r\n\ttargetWidth = dimensions.width;\r\n\ttargetHeight = dimensions.height;\r\n\ttargetOffset = dimensions.offset;\r\n\t// clone to reuse original targetOffset later\r\n\tbasePosition = $.extend( {}, targetOffset );\r\n\r\n\t// force my and at to have valid horizontal and vertical positions\r\n\t// if a value is missing or invalid, it will be converted to center\r\n\t$.each( [ \"my\", \"at\" ], function() {\r\n\t\tvar pos = ( options[ this ] || \"\" ).split( \" \" ),\r\n\t\t\thorizontalOffset,\r\n\t\t\tverticalOffset;\r\n\r\n\t\tif ( pos.length === 1) {\r\n\t\t\tpos = rhorizontal.test( pos[ 0 ] ) ?\r\n\t\t\t\tpos.concat( [ \"center\" ] ) :\r\n\t\t\t\trvertical.test( pos[ 0 ] ) ?\r\n\t\t\t\t\t[ \"center\" ].concat( pos ) :\r\n\t\t\t\t\t[ \"center\", \"center\" ];\r\n\t\t}\r\n\t\tpos[ 0 ] = rhorizontal.test( pos[ 0 ] ) ? pos[ 0 ] : \"center\";\r\n\t\tpos[ 1 ] = rvertical.test( pos[ 1 ] ) ? pos[ 1 ] : \"center\";\r\n\r\n\t\t// calculate offsets\r\n\t\thorizontalOffset = roffset.exec( pos[ 0 ] );\r\n\t\tverticalOffset = roffset.exec( pos[ 1 ] );\r\n\t\toffsets[ this ] = [\r\n\t\t\thorizontalOffset ? horizontalOffset[ 0 ] : 0,\r\n\t\t\tverticalOffset ? verticalOffset[ 0 ] : 0\r\n\t\t];\r\n\r\n\t\t// reduce to just the positions without the offsets\r\n\t\toptions[ this ] = [\r\n\t\t\trposition.exec( pos[ 0 ] )[ 0 ],\r\n\t\t\trposition.exec( pos[ 1 ] )[ 0 ]\r\n\t\t];\r\n\t});\r\n\r\n\t// normalize collision option\r\n\tif ( collision.length === 1 ) {\r\n\t\tcollision[ 1 ] = collision[ 0 ];\r\n\t}\r\n\r\n\tif ( options.at[ 0 ] === \"right\" ) {\r\n\t\tbasePosition.left += targetWidth;\r\n\t} else if ( options.at[ 0 ] === \"center\" ) {\r\n\t\tbasePosition.left += targetWidth / 2;\r\n\t}\r\n\r\n\tif ( options.at[ 1 ] === \"bottom\" ) {\r\n\t\tbasePosition.top += targetHeight;\r\n\t} else if ( options.at[ 1 ] === \"center\" ) {\r\n\t\tbasePosition.top += targetHeight / 2;\r\n\t}\r\n\r\n\tatOffset = getOffsets( offsets.at, targetWidth, targetHeight );\r\n\tbasePosition.left += atOffset[ 0 ];\r\n\tbasePosition.top += atOffset[ 1 ];\r\n\r\n\treturn this.each(function() {\r\n\t\tvar collisionPosition, using,\r\n\t\t\telem = $( this ),\r\n\t\t\telemWidth = elem.outerWidth(),\r\n\t\t\telemHeight = elem.outerHeight(),\r\n\t\t\tmarginLeft = parseCss( this, \"marginLeft\" ),\r\n\t\t\tmarginTop = parseCss( this, \"marginTop\" ),\r\n\t\t\tcollisionWidth = elemWidth + marginLeft + parseCss( this, \"marginRight\" ) + scrollInfo.width,\r\n\t\t\tcollisionHeight = elemHeight + marginTop + parseCss( this, \"marginBottom\" ) + scrollInfo.height,\r\n\t\t\tposition = $.extend( {}, basePosition ),\r\n\t\t\tmyOffset = getOffsets( offsets.my, elem.outerWidth(), elem.outerHeight() );\r\n\r\n\t\tif ( options.my[ 0 ] === \"right\" ) {\r\n\t\t\tposition.left -= elemWidth;\r\n\t\t} else if ( options.my[ 0 ] === \"center\" ) {\r\n\t\t\tposition.left -= elemWidth / 2;\r\n\t\t}\r\n\r\n\t\tif ( options.my[ 1 ] === \"bottom\" ) {\r\n\t\t\tposition.top -= elemHeight;\r\n\t\t} else if ( options.my[ 1 ] === \"center\" ) {\r\n\t\t\tposition.top -= elemHeight / 2;\r\n\t\t}\r\n\r\n\t\tposition.left += myOffset[ 0 ];\r\n\t\tposition.top += myOffset[ 1 ];\r\n\r\n\t\t// if the browser doesn't support fractions, then round for consistent results\r\n\t\tif ( !$.support.offsetFractions ) {\r\n\t\t\tposition.left = round( position.left );\r\n\t\t\tposition.top = round( position.top );\r\n\t\t}\r\n\r\n\t\tcollisionPosition = {\r\n\t\t\tmarginLeft: marginLeft,\r\n\t\t\tmarginTop: marginTop\r\n\t\t};\r\n\r\n\t\t$.each( [ \"left\", \"top\" ], function( i, dir ) {\r\n\t\t\tif ( $.ui.position[ collision[ i ] ] ) {\r\n\t\t\t\t$.ui.position[ collision[ i ] ][ dir ]( position, {\r\n\t\t\t\t\ttargetWidth: targetWidth,\r\n\t\t\t\t\ttargetHeight: targetHeight,\r\n\t\t\t\t\telemWidth: elemWidth,\r\n\t\t\t\t\telemHeight: elemHeight,\r\n\t\t\t\t\tcollisionPosition: collisionPosition,\r\n\t\t\t\t\tcollisionWidth: collisionWidth,\r\n\t\t\t\t\tcollisionHeight: collisionHeight,\r\n\t\t\t\t\toffset: [ atOffset[ 0 ] + myOffset[ 0 ], atOffset [ 1 ] + myOffset[ 1 ] ],\r\n\t\t\t\t\tmy: options.my,\r\n\t\t\t\t\tat: options.at,\r\n\t\t\t\t\twithin: within,\r\n\t\t\t\t\telem : elem\r\n\t\t\t\t});\r\n\t\t\t}\r\n\t\t});\r\n\r\n\t\tif ( options.using ) {\r\n\t\t\t// adds feedback as second argument to using callback, if present\r\n\t\t\tusing = function( props ) {\r\n\t\t\t\tvar left = targetOffset.left - position.left,\r\n\t\t\t\t\tright = left + targetWidth - elemWidth,\r\n\t\t\t\t\ttop = targetOffset.top - position.top,\r\n\t\t\t\t\tbottom = top + targetHeight - elemHeight,\r\n\t\t\t\t\tfeedback = {\r\n\t\t\t\t\t\ttarget: {\r\n\t\t\t\t\t\t\telement: target,\r\n\t\t\t\t\t\t\tleft: targetOffset.left,\r\n\t\t\t\t\t\t\ttop: targetOffset.top,\r\n\t\t\t\t\t\t\twidth: targetWidth,\r\n\t\t\t\t\t\t\theight: targetHeight\r\n\t\t\t\t\t\t},\r\n\t\t\t\t\t\telement: {\r\n\t\t\t\t\t\t\telement: elem,\r\n\t\t\t\t\t\t\tleft: position.left,\r\n\t\t\t\t\t\t\ttop: position.top,\r\n\t\t\t\t\t\t\twidth: elemWidth,\r\n\t\t\t\t\t\t\theight: elemHeight\r\n\t\t\t\t\t\t},\r\n\t\t\t\t\t\thorizontal: right < 0 ? \"left\" : left > 0 ? \"right\" : \"center\",\r\n\t\t\t\t\t\tvertical: bottom < 0 ? \"top\" : top > 0 ? \"bottom\" : \"middle\"\r\n\t\t\t\t\t};\r\n\t\t\t\tif ( targetWidth < elemWidth && abs( left + right ) < targetWidth ) {\r\n\t\t\t\t\tfeedback.horizontal = \"center\";\r\n\t\t\t\t}\r\n\t\t\t\tif ( targetHeight < elemHeight && abs( top + bottom ) < targetHeight ) {\r\n\t\t\t\t\tfeedback.vertical = \"middle\";\r\n\t\t\t\t}\r\n\t\t\t\tif ( max( abs( left ), abs( right ) ) > max( abs( top ), abs( bottom ) ) ) {\r\n\t\t\t\t\tfeedback.important = \"horizontal\";\r\n\t\t\t\t} else {\r\n\t\t\t\t\tfeedback.important = \"vertical\";\r\n\t\t\t\t}\r\n\t\t\t\toptions.using.call( this, props, feedback );\r\n\t\t\t};\r\n\t\t}\r\n\r\n\t\telem.offset( $.extend( position, { using: using } ) );\r\n\t});\r\n};\r\n\r\n$.ui.position = {\r\n\tfit: {\r\n\t\tleft: function( position, data ) {\r\n\t\t\tvar within = data.within,\r\n\t\t\t\twithinOffset = within.isWindow ? within.scrollLeft : within.offset.left,\r\n\t\t\t\touterWidth = within.width,\r\n\t\t\t\tcollisionPosLeft = position.left - data.collisionPosition.marginLeft,\r\n\t\t\t\toverLeft = withinOffset - collisionPosLeft,\r\n\t\t\t\toverRight = collisionPosLeft + data.collisionWidth - outerWidth - withinOffset,\r\n\t\t\t\tnewOverRight;\r\n\r\n\t\t\t// element is wider than within\r\n\t\t\tif ( data.collisionWidth > outerWidth ) {\r\n\t\t\t\t// element is initially over the left side of within\r\n\t\t\t\tif ( overLeft > 0 && overRight <= 0 ) {\r\n\t\t\t\t\tnewOverRight = position.left + overLeft + data.collisionWidth - outerWidth - withinOffset;\r\n\t\t\t\t\tposition.left += overLeft - newOverRight;\r\n\t\t\t\t// element is initially over right side of within\r\n\t\t\t\t} else if ( overRight > 0 && overLeft <= 0 ) {\r\n\t\t\t\t\tposition.left = withinOffset;\r\n\t\t\t\t// element is initially over both left and right sides of within\r\n\t\t\t\t} else {\r\n\t\t\t\t\tif ( overLeft > overRight ) {\r\n\t\t\t\t\t\tposition.left = withinOffset + outerWidth - data.collisionWidth;\r\n\t\t\t\t\t} else {\r\n\t\t\t\t\t\tposition.left = withinOffset;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t// too far left -> align with left edge\r\n\t\t\t} else if ( overLeft > 0 ) {\r\n\t\t\t\tposition.left += overLeft;\r\n\t\t\t// too far right -> align with right edge\r\n\t\t\t} else if ( overRight > 0 ) {\r\n\t\t\t\tposition.left -= overRight;\r\n\t\t\t// adjust based on position and margin\r\n\t\t\t} else {\r\n\t\t\t\tposition.left = max( position.left - collisionPosLeft, position.left );\r\n\t\t\t}\r\n\t\t},\r\n\t\ttop: function( position, data ) {\r\n\t\t\tvar within = data.within,\r\n\t\t\t\twithinOffset = within.isWindow ? within.scrollTop : within.offset.top,\r\n\t\t\t\touterHeight = data.within.height,\r\n\t\t\t\tcollisionPosTop = position.top - data.collisionPosition.marginTop,\r\n\t\t\t\toverTop = withinOffset - collisionPosTop,\r\n\t\t\t\toverBottom = collisionPosTop + data.collisionHeight - outerHeight - withinOffset,\r\n\t\t\t\tnewOverBottom;\r\n\r\n\t\t\t// element is taller than within\r\n\t\t\tif ( data.collisionHeight > outerHeight ) {\r\n\t\t\t\t// element is initially over the top of within\r\n\t\t\t\tif ( overTop > 0 && overBottom <= 0 ) {\r\n\t\t\t\t\tnewOverBottom = position.top + overTop + data.collisionHeight - outerHeight - withinOffset;\r\n\t\t\t\t\tposition.top += overTop - newOverBottom;\r\n\t\t\t\t// element is initially over bottom of within\r\n\t\t\t\t} else if ( overBottom > 0 && overTop <= 0 ) {\r\n\t\t\t\t\tposition.top = withinOffset;\r\n\t\t\t\t// element is initially over both top and bottom of within\r\n\t\t\t\t} else {\r\n\t\t\t\t\tif ( overTop > overBottom ) {\r\n\t\t\t\t\t\tposition.top = withinOffset + outerHeight - data.collisionHeight;\r\n\t\t\t\t\t} else {\r\n\t\t\t\t\t\tposition.top = withinOffset;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t// too far up -> align with top\r\n\t\t\t} else if ( overTop > 0 ) {\r\n\t\t\t\tposition.top += overTop;\r\n\t\t\t// too far down -> align with bottom edge\r\n\t\t\t} else if ( overBottom > 0 ) {\r\n\t\t\t\tposition.top -= overBottom;\r\n\t\t\t// adjust based on position and margin\r\n\t\t\t} else {\r\n\t\t\t\tposition.top = max( position.top - collisionPosTop, position.top );\r\n\t\t\t}\r\n\t\t}\r\n\t},\r\n\tflip: {\r\n\t\tleft: function( position, data ) {\r\n\t\t\tvar within = data.within,\r\n\t\t\t\twithinOffset = within.offset.left + within.scrollLeft,\r\n\t\t\t\touterWidth = within.width,\r\n\t\t\t\toffsetLeft = within.isWindow ? within.scrollLeft : within.offset.left,\r\n\t\t\t\tcollisionPosLeft = position.left - data.collisionPosition.marginLeft,\r\n\t\t\t\toverLeft = collisionPosLeft - offsetLeft,\r\n\t\t\t\toverRight = collisionPosLeft + data.collisionWidth - outerWidth - offsetLeft,\r\n\t\t\t\tmyOffset = data.my[ 0 ] === \"left\" ?\r\n\t\t\t\t\t-data.elemWidth :\r\n\t\t\t\t\tdata.my[ 0 ] === \"right\" ?\r\n\t\t\t\t\t\tdata.elemWidth :\r\n\t\t\t\t\t\t0,\r\n\t\t\t\tatOffset = data.at[ 0 ] === \"left\" ?\r\n\t\t\t\t\tdata.targetWidth :\r\n\t\t\t\t\tdata.at[ 0 ] === \"right\" ?\r\n\t\t\t\t\t\t-data.targetWidth :\r\n\t\t\t\t\t\t0,\r\n\t\t\t\toffset = -2 * data.offset[ 0 ],\r\n\t\t\t\tnewOverRight,\r\n\t\t\t\tnewOverLeft;\r\n\r\n\t\t\tif ( overLeft < 0 ) {\r\n\t\t\t\tnewOverRight = position.left + myOffset + atOffset + offset + data.collisionWidth - outerWidth - withinOffset;\r\n\t\t\t\tif ( newOverRight < 0 || newOverRight < abs( overLeft ) ) {\r\n\t\t\t\t\tposition.left += myOffset + atOffset + offset;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\telse if ( overRight > 0 ) {\r\n\t\t\t\tnewOverLeft = position.left - data.collisionPosition.marginLeft + myOffset + atOffset + offset - offsetLeft;\r\n\t\t\t\tif ( newOverLeft > 0 || abs( newOverLeft ) < overRight ) {\r\n\t\t\t\t\tposition.left += myOffset + atOffset + offset;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t},\r\n\t\ttop: function( position, data ) {\r\n\t\t\tvar within = data.within,\r\n\t\t\t\twithinOffset = within.offset.top + within.scrollTop,\r\n\t\t\t\touterHeight = within.height,\r\n\t\t\t\toffsetTop = within.isWindow ? within.scrollTop : within.offset.top,\r\n\t\t\t\tcollisionPosTop = position.top - data.collisionPosition.marginTop,\r\n\t\t\t\toverTop = collisionPosTop - offsetTop,\r\n\t\t\t\toverBottom = collisionPosTop + data.collisionHeight - outerHeight - offsetTop,\r\n\t\t\t\ttop = data.my[ 1 ] === \"top\",\r\n\t\t\t\tmyOffset = top ?\r\n\t\t\t\t\t-data.elemHeight :\r\n\t\t\t\t\tdata.my[ 1 ] === \"bottom\" ?\r\n\t\t\t\t\t\tdata.elemHeight :\r\n\t\t\t\t\t\t0,\r\n\t\t\t\tatOffset = data.at[ 1 ] === \"top\" ?\r\n\t\t\t\t\tdata.targetHeight :\r\n\t\t\t\t\tdata.at[ 1 ] === \"bottom\" ?\r\n\t\t\t\t\t\t-data.targetHeight :\r\n\t\t\t\t\t\t0,\r\n\t\t\t\toffset = -2 * data.offset[ 1 ],\r\n\t\t\t\tnewOverTop,\r\n\t\t\t\tnewOverBottom;\r\n\t\t\tif ( overTop < 0 ) {\r\n\t\t\t\tnewOverBottom = position.top + myOffset + atOffset + offset + data.collisionHeight - outerHeight - withinOffset;\r\n\t\t\t\tif ( ( position.top + myOffset + atOffset + offset) > overTop && ( newOverBottom < 0 || newOverBottom < abs( overTop ) ) ) {\r\n\t\t\t\t\tposition.top += myOffset + atOffset + offset;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\telse if ( overBottom > 0 ) {\r\n\t\t\t\tnewOverTop = position.top - data.collisionPosition.marginTop + myOffset + atOffset + offset - offsetTop;\r\n\t\t\t\tif ( ( position.top + myOffset + atOffset + offset) > overBottom && ( newOverTop > 0 || abs( newOverTop ) < overBottom ) ) {\r\n\t\t\t\t\tposition.top += myOffset + atOffset + offset;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t},\r\n\tflipfit: {\r\n\t\tleft: function() {\r\n\t\t\t$.ui.position.flip.left.apply( this, arguments );\r\n\t\t\t$.ui.position.fit.left.apply( this, arguments );\r\n\t\t},\r\n\t\ttop: function() {\r\n\t\t\t$.ui.position.flip.top.apply( this, arguments );\r\n\t\t\t$.ui.position.fit.top.apply( this, arguments );\r\n\t\t}\r\n\t}\r\n};\r\n\r\n// fraction support test\r\n(function () {\r\n\tvar testElement, testElementParent, testElementStyle, offsetLeft, i,\r\n\t\tbody = document.getElementsByTagName( \"body\" )[ 0 ],\r\n\t\tdiv = document.createElement( \"div\" );\r\n\r\n\t//Create a \"fake body\" for testing based on method used in jQuery.support\r\n\ttestElement = document.createElement( body ? \"div\" : \"body\" );\r\n\ttestElementStyle = {\r\n\t\tvisibility: \"hidden\",\r\n\t\twidth: 0,\r\n\t\theight: 0,\r\n\t\tborder: 0,\r\n\t\tmargin: 0,\r\n\t\tbackground: \"none\"\r\n\t};\r\n\tif ( body ) {\r\n\t\t$.extend( testElementStyle, {\r\n\t\t\tposition: \"absolute\",\r\n\t\t\tleft: \"-1000px\",\r\n\t\t\ttop: \"-1000px\"\r\n\t\t});\r\n\t}\r\n\tfor ( i in testElementStyle ) {\r\n\t\ttestElement.style[ i ] = testElementStyle[ i ];\r\n\t}\r\n\ttestElement.appendChild( div );\r\n\ttestElementParent = body || document.documentElement;\r\n\ttestElementParent.insertBefore( testElement, testElementParent.firstChild );\r\n\r\n\tdiv.style.cssText = \"position: absolute; left: 10.7432222px;\";\r\n\r\n\toffsetLeft = $( div ).offset().left;\r\n\t$.support.offsetFractions = offsetLeft > 10 && offsetLeft < 11;\r\n\r\n\ttestElement.innerHTML = \"\";\r\n\ttestElementParent.removeChild( testElement );\r\n})();\r\n\r\n}( jQuery ) );\r\n(function( $, undefined ) {\r\n\r\n// used to prevent race conditions with remote data sources\r\nvar requestIndex = 0;\r\n\r\n$.widget( \"ui.autocomplete\", {\r\n\tversion: \"1.10.1\",\r\n\tdefaultElement: \"
\",\r\n\toptions: {\r\n\t\tappendTo: null,\r\n\t\tautoFocus: false,\r\n\t\tdelay: 300,\r\n\t\tminLength: 1,\r\n\t\tposition: {\r\n\t\t\tmy: \"left top\",\r\n\t\t\tat: \"left bottom\",\r\n\t\t\tcollision: \"none\"\r\n\t\t},\r\n\t\tsource: null,\r\n\r\n\t\t// callbacks\r\n\t\tchange: null,\r\n\t\tclose: null,\r\n\t\tfocus: null,\r\n\t\topen: null,\r\n\t\tresponse: null,\r\n\t\tsearch: null,\r\n\t\tselect: null\r\n\t},\r\n\r\n\tpending: 0,\r\n\r\n\t_create: function() {\r\n\t\t// Some browsers only repeat keydown events, not keypress events,\r\n\t\t// so we use the suppressKeyPress flag to determine if we've already\r\n\t\t// handled the keydown event. #7269\r\n\t\t// Unfortunately the code for & in keypress is the same as the up arrow,\r\n\t\t// so we use the suppressKeyPressRepeat flag to avoid handling keypress\r\n\t\t// events when we know the keydown event was used to modify the\r\n\t\t// search term. #7799\r\n\t\tvar suppressKeyPress, suppressKeyPressRepeat, suppressInput,\r\n\t\t\tnodeName = this.element[0].nodeName.toLowerCase(),\r\n\t\t\tisTextarea = nodeName === \"textarea\",\r\n\t\t\tisInput = nodeName === \"input\";\r\n\r\n\t\tthis.isMultiLine =\r\n\t\t\t// Textareas are always multi-line\r\n\t\t\tisTextarea ? true :\r\n\t\t\t// Inputs are always single-line, even if inside a contentEditable element\r\n\t\t\t// IE also treats inputs as contentEditable\r\n\t\t\tisInput ? false :\r\n\t\t\t// All other element types are determined by whether or not they're contentEditable\r\n\t\t\tthis.element.prop( \"isContentEditable\" );\r\n\r\n\t\tthis.valueMethod = this.element[ isTextarea || isInput ? \"val\" : \"text\" ];\r\n\t\tthis.isNewMenu = true;\r\n\r\n\t\tthis.element\r\n\t\t\t.addClass( \"ui-autocomplete-input\" )\r\n\t\t\t.attr( \"autocomplete\", \"off\" );\r\n\r\n\t\tthis._on( this.element, {\r\n\t\t\tkeydown: function( event ) {\r\n\t\t\t\t/*jshint maxcomplexity:15*/\r\n\t\t\t\tif ( this.element.prop( \"readOnly\" ) ) {\r\n\t\t\t\t\tsuppressKeyPress = true;\r\n\t\t\t\t\tsuppressInput = true;\r\n\t\t\t\t\tsuppressKeyPressRepeat = true;\r\n\t\t\t\t\treturn;\r\n\t\t\t\t}\r\n\r\n\t\t\t\tsuppressKeyPress = false;\r\n\t\t\t\tsuppressInput = false;\r\n\t\t\t\tsuppressKeyPressRepeat = false;\r\n\t\t\t\tvar keyCode = $.ui.keyCode;\r\n\t\t\t\tswitch( event.keyCode ) {\r\n\t\t\t\tcase keyCode.PAGE_UP:\r\n\t\t\t\t\tsuppressKeyPress = true;\r\n\t\t\t\t\tthis._move( \"previousPage\", event );\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tcase keyCode.PAGE_DOWN:\r\n\t\t\t\t\tsuppressKeyPress = true;\r\n\t\t\t\t\tthis._move( \"nextPage\", event );\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tcase keyCode.UP:\r\n\t\t\t\t\tsuppressKeyPress = true;\r\n\t\t\t\t\tthis._keyEvent( \"previous\", event );\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tcase keyCode.DOWN:\r\n\t\t\t\t\tsuppressKeyPress = true;\r\n\t\t\t\t\tthis._keyEvent( \"next\", event );\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tcase keyCode.ENTER:\r\n\t\t\t\tcase keyCode.NUMPAD_ENTER:\r\n\t\t\t\t\t// when menu is open and has focus\r\n\t\t\t\t\tif ( this.menu.active ) {\r\n\t\t\t\t\t\t// #6055 - Opera still allows the keypress to occur\r\n\t\t\t\t\t\t// which causes forms to submit\r\n\t\t\t\t\t\tsuppressKeyPress = true;\r\n\t\t\t\t\t\tevent.preventDefault();\r\n\t\t\t\t\t\tthis.menu.select( event );\r\n\t\t\t\t\t}\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tcase keyCode.TAB:\r\n\t\t\t\t\tif ( this.menu.active ) {\r\n\t\t\t\t\t\tthis.menu.select( event );\r\n\t\t\t\t\t}\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tcase keyCode.ESCAPE:\r\n\t\t\t\t\tif ( this.menu.element.is( \":visible\" ) ) {\r\n\t\t\t\t\t\tthis._value( this.term );\r\n\t\t\t\t\t\tthis.close( event );\r\n\t\t\t\t\t\t// Different browsers have different default behavior for escape\r\n\t\t\t\t\t\t// Single press can mean undo or clear\r\n\t\t\t\t\t\t// Double press in IE means clear the whole form\r\n\t\t\t\t\t\tevent.preventDefault();\r\n\t\t\t\t\t}\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tdefault:\r\n\t\t\t\t\tsuppressKeyPressRepeat = true;\r\n\t\t\t\t\t// search timeout should be triggered before the input value is changed\r\n\t\t\t\t\tthis._searchTimeout( event );\r\n\t\t\t\t\tbreak;\r\n\t\t\t\t}\r\n\t\t\t},\r\n\t\t\tkeypress: function( event ) {\r\n\t\t\t\tif ( suppressKeyPress ) {\r\n\t\t\t\t\tsuppressKeyPress = false;\r\n\t\t\t\t\tevent.preventDefault();\r\n\t\t\t\t\treturn;\r\n\t\t\t\t}\r\n\t\t\t\tif ( suppressKeyPressRepeat ) {\r\n\t\t\t\t\treturn;\r\n\t\t\t\t}\r\n\r\n\t\t\t\t// replicate some key handlers to allow them to repeat in Firefox and Opera\r\n\t\t\t\tvar keyCode = $.ui.keyCode;\r\n\t\t\t\tswitch( event.keyCode ) {\r\n\t\t\t\tcase keyCode.PAGE_UP:\r\n\t\t\t\t\tthis._move( \"previousPage\", event );\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tcase keyCode.PAGE_DOWN:\r\n\t\t\t\t\tthis._move( \"nextPage\", event );\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tcase keyCode.UP:\r\n\t\t\t\t\tthis._keyEvent( \"previous\", event );\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tcase keyCode.DOWN:\r\n\t\t\t\t\tthis._keyEvent( \"next\", event );\r\n\t\t\t\t\tbreak;\r\n\t\t\t\t}\r\n\t\t\t},\r\n\t\t\tinput: function( event ) {\r\n\t\t\t\tif ( suppressInput ) {\r\n\t\t\t\t\tsuppressInput = false;\r\n\t\t\t\t\tevent.preventDefault();\r\n\t\t\t\t\treturn;\r\n\t\t\t\t}\r\n\t\t\t\tthis._searchTimeout( event );\r\n\t\t\t},\r\n\t\t\tfocus: function() {\r\n\t\t\t\tthis.selectedItem = null;\r\n\t\t\t\tthis.previous = this._value();\r\n\t\t\t},\r\n\t\t\tblur: function( event ) {\r\n\t\t\t\tif ( this.cancelBlur ) {\r\n\t\t\t\t\tdelete this.cancelBlur;\r\n\t\t\t\t\treturn;\r\n\t\t\t\t}\r\n\r\n\t\t\t\tclearTimeout( this.searching );\r\n\t\t\t\tthis.close( event );\r\n\t\t\t\tthis._change( event );\r\n\t\t\t}\r\n\t\t});\r\n\r\n\t\tthis._initSource();\r\n\t\tthis.menu = $( \"
\" )\r\n\t\t\t.addClass( \"ui-autocomplete ui-front\" )\r\n\t\t\t.appendTo( this._appendTo() )\r\n\t\t\t.menu({\r\n\t\t\t\t// custom key handling for now\r\n\t\t\t\tinput: $(),\r\n\t\t\t\t// disable ARIA support, the live region takes care of that\r\n\t\t\t\trole: null\r\n\t\t\t})\r\n\t\t\t.hide()\r\n\t\t\t.data( \"ui-menu\" );\r\n\r\n\t\tthis._on( this.menu.element, {\r\n\t\t\tmousedown: function( event ) {\r\n\t\t\t\t// prevent moving focus out of the text field\r\n\t\t\t\tevent.preventDefault();\r\n\r\n\t\t\t\t// IE doesn't prevent moving focus even with event.preventDefault()\r\n\t\t\t\t// so we set a flag to know when we should ignore the blur event\r\n\t\t\t\tthis.cancelBlur = true;\r\n\t\t\t\tthis._delay(function() {\r\n\t\t\t\t\tdelete this.cancelBlur;\r\n\t\t\t\t});\r\n\r\n\t\t\t\t// clicking on the scrollbar causes focus to shift to the body\r\n\t\t\t\t// but we can't detect a mouseup or a click immediately afterward\r\n\t\t\t\t// so we have to track the next mousedown and close the menu if\r\n\t\t\t\t// the user clicks somewhere outside of the autocomplete\r\n\t\t\t\tvar menuElement = this.menu.element[ 0 ];\r\n\t\t\t\tif ( !$( event.target ).closest( \".ui-menu-item\" ).length ) {\r\n\t\t\t\t\tthis._delay(function() {\r\n\t\t\t\t\t\tvar that = this;\r\n\t\t\t\t\t\tthis.document.one( \"mousedown\", function( event ) {\r\n\t\t\t\t\t\t\tif ( event.target !== that.element[ 0 ] &&\r\n\t\t\t\t\t\t\t\t\tevent.target !== menuElement &&\r\n\t\t\t\t\t\t\t\t\t!$.contains( menuElement, event.target ) ) {\r\n\t\t\t\t\t\t\t\tthat.close();\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\tmenufocus: function( event, ui ) {\r\n\t\t\t\t// #7024 - Prevent accidental activation of menu items in Firefox\r\n\t\t\t\tif ( this.isNewMenu ) {\r\n\t\t\t\t\tthis.isNewMenu = false;\r\n\t\t\t\t\tif ( event.originalEvent && /^mouse/.test( event.originalEvent.type ) ) {\r\n\t\t\t\t\t\tthis.menu.blur();\r\n\r\n\t\t\t\t\t\tthis.document.one( \"mousemove\", function() {\r\n\t\t\t\t\t\t\t$( event.target ).trigger( event.originalEvent );\r\n\t\t\t\t\t\t});\r\n\r\n\t\t\t\t\t\treturn;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\r\n\t\t\t\tvar item = ui.item.data( \"ui-autocomplete-item\" );\r\n\t\t\t\tif ( false !== this._trigger( \"focus\", event, { item: item } ) ) {\r\n\t\t\t\t\t// use value to match what will end up in the input, if it was a key event\r\n\t\t\t\t\tif ( event.originalEvent && /^key/.test( event.originalEvent.type ) ) {\r\n\t\t\t\t\t\tthis._value( item.value );\r\n\t\t\t\t\t}\r\n\t\t\t\t} else {\r\n\t\t\t\t\t// Normally the input is populated with the item's value as the\r\n\t\t\t\t\t// menu is navigated, causing screen readers to notice a change and\r\n\t\t\t\t\t// announce the item. Since the focus event was canceled, this doesn't\r\n\t\t\t\t\t// happen, so we update the live region so that screen readers can\r\n\t\t\t\t\t// still notice the change and announce it.\r\n\t\t\t\t\tthis.liveRegion.text( item.value );\r\n\t\t\t\t}\r\n\t\t\t},\r\n\t\t\tmenuselect: function( event, ui ) {\r\n\t\t\t\tvar item = ui.item.data( \"ui-autocomplete-item\" ),\r\n\t\t\t\t\tprevious = this.previous;\r\n\r\n\t\t\t\t// only trigger when focus was lost (click on menu)\r\n\t\t\t\tif ( this.element[0] !== this.document[0].activeElement ) {\r\n\t\t\t\t\tthis.element.focus();\r\n\t\t\t\t\tthis.previous = previous;\r\n\t\t\t\t\t// #6109 - IE triggers two focus events and the second\r\n\t\t\t\t\t// is asynchronous, so we need to reset the previous\r\n\t\t\t\t\t// term synchronously and asynchronously :-(\r\n\t\t\t\t\tthis._delay(function() {\r\n\t\t\t\t\t\tthis.previous = previous;\r\n\t\t\t\t\t\tthis.selectedItem = item;\r\n\t\t\t\t\t});\r\n\t\t\t\t}\r\n\r\n\t\t\t\tif ( false !== this._trigger( \"select\", event, { item: item } ) ) {\r\n\t\t\t\t\tthis._value( item.value );\r\n\t\t\t\t}\r\n\t\t\t\t// reset the term after the select event\r\n\t\t\t\t// this allows custom select handling to work properly\r\n\t\t\t\tthis.term = this._value();\r\n\r\n\t\t\t\tthis.close( event );\r\n\t\t\t\tthis.selectedItem = item;\r\n\t\t\t}\r\n\t\t});\r\n\r\n\t\tthis.liveRegion = $( \"\", {\r\n\t\t\t\trole: \"status\",\r\n\t\t\t\t\"aria-live\": \"polite\"\r\n\t\t\t})\r\n\t\t\t.addClass( \"ui-helper-hidden-accessible\" )\r\n\t\t\t.insertAfter( this.element );\r\n\r\n\t\t// turning off autocomplete prevents the browser from remembering the\r\n\t\t// value when navigating through history, so we re-enable autocomplete\r\n\t\t// if the page is unloaded before the widget is destroyed. #7790\r\n\t\tthis._on( this.window, {\r\n\t\t\tbeforeunload: function() {\r\n\t\t\t\tthis.element.removeAttr( \"autocomplete\" );\r\n\t\t\t}\r\n\t\t});\r\n\t},\r\n\r\n\t_destroy: function() {\r\n\t\tclearTimeout( this.searching );\r\n\t\tthis.element\r\n\t\t\t.removeClass( \"ui-autocomplete-input\" )\r\n\t\t\t.removeAttr( \"autocomplete\" );\r\n\t\tthis.menu.element.remove();\r\n\t\tthis.liveRegion.remove();\r\n\t},\r\n\r\n\t_setOption: function( key, value ) {\r\n\t\tthis._super( key, value );\r\n\t\tif ( key === \"source\" ) {\r\n\t\t\tthis._initSource();\r\n\t\t}\r\n\t\tif ( key === \"appendTo\" ) {\r\n\t\t\tthis.menu.element.appendTo( this._appendTo() );\r\n\t\t}\r\n\t\tif ( key === \"disabled\" && value && this.xhr ) {\r\n\t\t\tthis.xhr.abort();\r\n\t\t}\r\n\t},\r\n\r\n\t_appendTo: function() {\r\n\t\tvar element = this.options.appendTo;\r\n\r\n\t\tif ( element ) {\r\n\t\t\telement = element.jquery || element.nodeType ?\r\n\t\t\t\t$( element ) :\r\n\t\t\t\tthis.document.find( element ).eq( 0 );\r\n\t\t}\r\n\r\n\t\tif ( !element ) {\r\n\t\t\telement = this.element.closest( \".ui-front\" );\r\n\t\t}\r\n\r\n\t\tif ( !element.length ) {\r\n\t\t\telement = this.document[0].body;\r\n\t\t}\r\n\r\n\t\treturn element;\r\n\t},\r\n\r\n\t_initSource: function() {\r\n\t\tvar array, url,\r\n\t\t\tthat = this;\r\n\t\tif ( $.isArray(this.options.source) ) {\r\n\t\t\tarray = this.options.source;\r\n\t\t\tthis.source = function( request, response ) {\r\n\t\t\t\tresponse( $.ui.autocomplete.filter( array, request.term ) );\r\n\t\t\t};\r\n\t\t} else if ( typeof this.options.source === \"string\" ) {\r\n\t\t\turl = this.options.source;\r\n\t\t\tthis.source = function( request, response ) {\r\n\t\t\t\tif ( that.xhr ) {\r\n\t\t\t\t\tthat.xhr.abort();\r\n\t\t\t\t}\r\n\t\t\t\tthat.xhr = $.ajax({\r\n\t\t\t\t\turl: url,\r\n\t\t\t\t\tdata: request,\r\n\t\t\t\t\tdataType: \"json\",\r\n\t\t\t\t\tsuccess: function( data ) {\r\n\t\t\t\t\t\tresponse( data );\r\n\t\t\t\t\t},\r\n\t\t\t\t\terror: function() {\r\n\t\t\t\t\t\tresponse( [] );\r\n\t\t\t\t\t}\r\n\t\t\t\t});\r\n\t\t\t};\r\n\t\t} else {\r\n\t\t\tthis.source = this.options.source;\r\n\t\t}\r\n\t},\r\n\r\n\t_searchTimeout: function( event ) {\r\n\t\tclearTimeout( this.searching );\r\n\t\tthis.searching = this._delay(function() {\r\n\t\t\t// only search if the value has changed\r\n\t\t\tif ( this.term !== this._value() ) {\r\n\t\t\t\tthis.selectedItem = null;\r\n\t\t\t\tthis.search( null, event );\r\n\t\t\t}\r\n\t\t}, this.options.delay );\r\n\t},\r\n\r\n\tsearch: function( value, event ) {\r\n\t\tvalue = value != null ? value : this._value();\r\n\r\n\t\t// always save the actual value, not the one passed as an argument\r\n\t\tthis.term = this._value();\r\n\r\n\t\tif ( value.length < this.options.minLength ) {\r\n\t\t\treturn this.close( event );\r\n\t\t}\r\n\r\n\t\tif ( this._trigger( \"search\", event ) === false ) {\r\n\t\t\treturn;\r\n\t\t}\r\n\r\n\t\treturn this._search( value );\r\n\t},\r\n\r\n\t_search: function( value ) {\r\n\t\tthis.pending++;\r\n\t\tthis.element.addClass( \"ui-autocomplete-loading\" );\r\n\t\tthis.cancelSearch = false;\r\n\r\n\t\tthis.source( { term: value }, this._response() );\r\n\t},\r\n\r\n\t_response: function() {\r\n\t\tvar that = this,\r\n\t\t\tindex = ++requestIndex;\r\n\r\n\t\treturn function( content ) {\r\n\t\t\tif ( index === requestIndex ) {\r\n\t\t\t\tthat.__response( content );\r\n\t\t\t}\r\n\r\n\t\t\tthat.pending--;\r\n\t\t\tif ( !that.pending ) {\r\n\t\t\t\tthat.element.removeClass( \"ui-autocomplete-loading\" );\r\n\t\t\t}\r\n\t\t};\r\n\t},\r\n\r\n\t__response: function( content ) {\r\n\t\tif ( content ) {\r\n\t\t\tcontent = this._normalize( content );\r\n\t\t}\r\n\t\tthis._trigger( \"response\", null, { content: content } );\r\n\t\tif ( !this.options.disabled && content && content.length && !this.cancelSearch ) {\r\n\t\t\tthis._suggest( content );\r\n\t\t\tthis._trigger( \"open\" );\r\n\t\t} else {\r\n\t\t\t// use ._close() instead of .close() so we don't cancel future searches\r\n\t\t\tthis._close();\r\n\t\t}\r\n\t},\r\n\r\n\tclose: function( event ) {\r\n\t\tthis.cancelSearch = true;\r\n\t\tthis._close( event );\r\n\t},\r\n\r\n\t_close: function( event ) {\r\n\t\tif ( this.menu.element.is( \":visible\" ) ) {\r\n\t\t\tthis.menu.element.hide();\r\n\t\t\tthis.menu.blur();\r\n\t\t\tthis.isNewMenu = true;\r\n\t\t\tthis._trigger( \"close\", event );\r\n\t\t}\r\n\t},\r\n\r\n\t_change: function( event ) {\r\n\t\tif ( this.previous !== this._value() ) {\r\n\t\t\tthis._trigger( \"change\", event, { item: this.selectedItem } );\r\n\t\t}\r\n\t},\r\n\r\n\t_normalize: function( items ) {\r\n\t\t// assume all items have the right format when the first item is complete\r\n\t\tif ( items.length && items[0].label && items[0].value ) {\r\n\t\t\treturn items;\r\n\t\t}\r\n\t\treturn $.map( items, function( item ) {\r\n\t\t\tif ( typeof item === \"string\" ) {\r\n\t\t\t\treturn {\r\n\t\t\t\t\tlabel: item,\r\n\t\t\t\t\tvalue: item\r\n\t\t\t\t};\r\n\t\t\t}\r\n\t\t\treturn $.extend({\r\n\t\t\t\tlabel: item.label || item.value,\r\n\t\t\t\tvalue: item.value || item.label\r\n\t\t\t}, item );\r\n\t\t});\r\n\t},\r\n\r\n\t_suggest: function( items ) {\r\n\t\tvar ul = this.menu.element.empty();\r\n\t\tthis._renderMenu( ul, items );\r\n\t\tthis.menu.refresh();\r\n\r\n\t\t// size and position menu\r\n\t\tul.show();\r\n\t\tthis._resizeMenu();\r\n\t\tul.position( $.extend({\r\n\t\t\tof: this.element\r\n\t\t}, this.options.position ));\r\n\r\n\t\tif ( this.options.autoFocus ) {\r\n\t\t\tthis.menu.next();\r\n\t\t}\r\n\t},\r\n\r\n\t_resizeMenu: function() {\r\n\t\tvar ul = this.menu.element;\r\n\t\tul.outerWidth( Math.max(\r\n\t\t\t// Firefox wraps long text (possibly a rounding bug)\r\n\t\t\t// so we add 1px to avoid the wrapping (#7513)\r\n\t\t\tul.width( \"\" ).outerWidth() + 1,\r\n\t\t\tthis.element.outerWidth()\r\n\t\t) );\r\n\t},\r\n\r\n\t_renderMenu: function( ul, items ) {\r\n\t\tvar that = this;\r\n\t\t$.each( items, function( index, item ) {\r\n\t\t\tthat._renderItemData( ul, item );\r\n\t\t});\r\n\t},\r\n\r\n\t_renderItemData: function( ul, item ) {\r\n\t\treturn this._renderItem( ul, item ).data( \"ui-autocomplete-item\", item );\r\n\t},\r\n\r\n\t_renderItem: function( ul, item ) {\r\n\t\treturn $( \"- \" )\r\n\t\t\t.append( $( \"\" ).text( item.label ) )\r\n\t\t\t.appendTo( ul );\r\n\t},\r\n\r\n\t_move: function( direction, event ) {\r\n\t\tif ( !this.menu.element.is( \":visible\" ) ) {\r\n\t\t\tthis.search( null, event );\r\n\t\t\treturn;\r\n\t\t}\r\n\t\tif ( this.menu.isFirstItem() && /^previous/.test( direction ) ||\r\n\t\t\t\tthis.menu.isLastItem() && /^next/.test( direction ) ) {\r\n\t\t\tthis._value( this.term );\r\n\t\t\tthis.menu.blur();\r\n\t\t\treturn;\r\n\t\t}\r\n\t\tthis.menu[ direction ]( event );\r\n\t},\r\n\r\n\twidget: function() {\r\n\t\treturn this.menu.element;\r\n\t},\r\n\r\n\t_value: function() {\r\n\t\treturn this.valueMethod.apply( this.element, arguments );\r\n\t},\r\n\r\n\t_keyEvent: function( keyEvent, event ) {\r\n\t\tif ( !this.isMultiLine || this.menu.element.is( \":visible\" ) ) {\r\n\t\t\tthis._move( keyEvent, event );\r\n\r\n\t\t\t// prevents moving cursor to beginning/end of the text field in some browsers\r\n\t\t\tevent.preventDefault();\r\n\t\t}\r\n\t}\r\n});\r\n\r\n$.extend( $.ui.autocomplete, {\r\n\tescapeRegex: function( value ) {\r\n\t\treturn value.replace(/[\\-\\[\\]{}()*+?.,\\\\\\^$|#\\s]/g, \"\\\\$&\");\r\n\t},\r\n\tfilter: function(array, term) {\r\n\t\tvar matcher = new RegExp( $.ui.autocomplete.escapeRegex(term), \"i\" );\r\n\t\treturn $.grep( array, function(value) {\r\n\t\t\treturn matcher.test( value.label || value.value || value );\r\n\t\t});\r\n\t}\r\n});\r\n\r\n\r\n// live region extension, adding a `messages` option\r\n// NOTE: This is an experimental API. We are still investigating\r\n// a full solution for string manipulation and internationalization.\r\n$.widget( \"ui.autocomplete\", $.ui.autocomplete, {\r\n\toptions: {\r\n\t\tmessages: {\r\n\t\t\tnoResults: \"No search results.\",\r\n\t\t\tresults: function( amount ) {\r\n\t\t\t\treturn amount + ( amount > 1 ? \" results are\" : \" result is\" ) +\r\n\t\t\t\t\t\" available, use up and down arrow keys to navigate.\";\r\n\t\t\t}\r\n\t\t}\r\n\t},\r\n\r\n\t__response: function( content ) {\r\n\t\tvar message;\r\n\t\tthis._superApply( arguments );\r\n\t\tif ( this.options.disabled || this.cancelSearch ) {\r\n\t\t\treturn;\r\n\t\t}\r\n\t\tif ( content && content.length ) {\r\n\t\t\tmessage = this.options.messages.results( content.length );\r\n\t\t} else {\r\n\t\t\tmessage = this.options.messages.noResults;\r\n\t\t}\r\n\t\tthis.liveRegion.text( message );\r\n\t}\r\n});\r\n\r\n}( jQuery ));\r\n(function( $, undefined ) {\r\n\r\n$.widget( \"ui.menu\", {\r\n\tversion: \"1.10.1\",\r\n\tdefaultElement: \"
\",\r\n\tdelay: 300,\r\n\toptions: {\r\n\t\ticons: {\r\n\t\t\tsubmenu: \"ui-icon-carat-1-e\"\r\n\t\t},\r\n\t\tmenus: \"ul\",\r\n\t\tposition: {\r\n\t\t\tmy: \"left top\",\r\n\t\t\tat: \"right top\"\r\n\t\t},\r\n\t\trole: \"menu\",\r\n\r\n\t\t// callbacks\r\n\t\tblur: null,\r\n\t\tfocus: null,\r\n\t\tselect: null\r\n\t},\r\n\r\n\t_create: function() {\r\n\t\tthis.activeMenu = this.element;\r\n\t\t// flag used to prevent firing of the click handler\r\n\t\t// as the event bubbles up through nested menus\r\n\t\tthis.mouseHandled = false;\r\n\t\tthis.element\r\n\t\t\t.uniqueId()\r\n\t\t\t.addClass( \"ui-menu ui-widget ui-widget-content ui-corner-all\" )\r\n\t\t\t.toggleClass( \"ui-menu-icons\", !!this.element.find( \".ui-icon\" ).length )\r\n\t\t\t.attr({\r\n\t\t\t\trole: this.options.role,\r\n\t\t\t\ttabIndex: 0\r\n\t\t\t})\r\n\t\t\t// need to catch all clicks on disabled menu\r\n\t\t\t// not possible through _on\r\n\t\t\t.bind( \"click\" + this.eventNamespace, $.proxy(function( event ) {\r\n\t\t\t\tif ( this.options.disabled ) {\r\n\t\t\t\t\tevent.preventDefault();\r\n\t\t\t\t}\r\n\t\t\t}, this ));\r\n\r\n\t\tif ( this.options.disabled ) {\r\n\t\t\tthis.element\r\n\t\t\t\t.addClass( \"ui-state-disabled\" )\r\n\t\t\t\t.attr( \"aria-disabled\", \"true\" );\r\n\t\t}\r\n\r\n\t\tthis._on({\r\n\t\t\t// Prevent focus from sticking to links inside menu after clicking\r\n\t\t\t// them (focus should always stay on UL during navigation).\r\n\t\t\t\"mousedown .ui-menu-item > a\": function( event ) {\r\n\t\t\t\tevent.preventDefault();\r\n\t\t\t},\r\n\t\t\t\"click .ui-state-disabled > a\": function( event ) {\r\n\t\t\t\tevent.preventDefault();\r\n\t\t\t},\r\n\t\t\t\"click .ui-menu-item:has(a)\": function( event ) {\r\n\t\t\t\tvar target = $( event.target ).closest( \".ui-menu-item\" );\r\n\t\t\t\tif ( !this.mouseHandled && target.not( \".ui-state-disabled\" ).length ) {\r\n\t\t\t\t\tthis.mouseHandled = true;\r\n\r\n\t\t\t\t\tthis.select( event );\r\n\t\t\t\t\t// Open submenu on click\r\n\t\t\t\t\tif ( target.has( \".ui-menu\" ).length ) {\r\n\t\t\t\t\t\tthis.expand( event );\r\n\t\t\t\t\t} else if ( !this.element.is( \":focus\" ) ) {\r\n\t\t\t\t\t\t// Redirect focus to the menu\r\n\t\t\t\t\t\tthis.element.trigger( \"focus\", [ true ] );\r\n\r\n\t\t\t\t\t\t// If the active item is on the top level, let it stay active.\r\n\t\t\t\t\t\t// Otherwise, blur the active item since it is no longer visible.\r\n\t\t\t\t\t\tif ( this.active && this.active.parents( \".ui-menu\" ).length === 1 ) {\r\n\t\t\t\t\t\t\tclearTimeout( this.timer );\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\t\"mouseenter .ui-menu-item\": function( event ) {\r\n\t\t\t\tvar target = $( event.currentTarget );\r\n\t\t\t\t// Remove ui-state-active class from siblings of the newly focused menu item\r\n\t\t\t\t// to avoid a jump caused by adjacent elements both having a class with a border\r\n\t\t\t\ttarget.siblings().children( \".ui-state-active\" ).removeClass( \"ui-state-active\" );\r\n\t\t\t\tthis.focus( event, target );\r\n\t\t\t},\r\n\t\t\tmouseleave: \"collapseAll\",\r\n\t\t\t\"mouseleave .ui-menu\": \"collapseAll\",\r\n\t\t\tfocus: function( event, keepActiveItem ) {\r\n\t\t\t\t// If there's already an active item, keep it active\r\n\t\t\t\t// If not, activate the first item\r\n\t\t\t\tvar item = this.active || this.element.children( \".ui-menu-item\" ).eq( 0 );\r\n\r\n\t\t\t\tif ( !keepActiveItem ) {\r\n\t\t\t\t\tthis.focus( event, item );\r\n\t\t\t\t}\r\n\t\t\t},\r\n\t\t\tblur: function( event ) {\r\n\t\t\t\tthis._delay(function() {\r\n\t\t\t\t\tif ( !$.contains( this.element[0], this.document[0].activeElement ) ) {\r\n\t\t\t\t\t\tthis.collapseAll( event );\r\n\t\t\t\t\t}\r\n\t\t\t\t});\r\n\t\t\t},\r\n\t\t\tkeydown: \"_keydown\"\r\n\t\t});\r\n\r\n\t\tthis.refresh();\r\n\r\n\t\t// Clicks outside of a menu collapse any open menus\r\n\t\tthis._on( this.document, {\r\n\t\t\tclick: function( event ) {\r\n\t\t\t\tif ( !$( event.target ).closest( \".ui-menu\" ).length ) {\r\n\t\t\t\t\tthis.collapseAll( event );\r\n\t\t\t\t}\r\n\r\n\t\t\t\t// Reset the mouseHandled flag\r\n\t\t\t\tthis.mouseHandled = false;\r\n\t\t\t}\r\n\t\t});\r\n\t},\r\n\r\n\t_destroy: function() {\r\n\t\t// Destroy (sub)menus\r\n\t\tthis.element\r\n\t\t\t.removeAttr( \"aria-activedescendant\" )\r\n\t\t\t.find( \".ui-menu\" ).addBack()\r\n\t\t\t\t.removeClass( \"ui-menu ui-widget ui-widget-content ui-corner-all ui-menu-icons\" )\r\n\t\t\t\t.removeAttr( \"role\" )\r\n\t\t\t\t.removeAttr( \"tabIndex\" )\r\n\t\t\t\t.removeAttr( \"aria-labelledby\" )\r\n\t\t\t\t.removeAttr( \"aria-expanded\" )\r\n\t\t\t\t.removeAttr( \"aria-hidden\" )\r\n\t\t\t\t.removeAttr( \"aria-disabled\" )\r\n\t\t\t\t.removeUniqueId()\r\n\t\t\t\t.show();\r\n\r\n\t\t// Destroy menu items\r\n\t\tthis.element.find( \".ui-menu-item\" )\r\n\t\t\t.removeClass( \"ui-menu-item\" )\r\n\t\t\t.removeAttr( \"role\" )\r\n\t\t\t.removeAttr( \"aria-disabled\" )\r\n\t\t\t.children( \"a\" )\r\n\t\t\t\t.removeUniqueId()\r\n\t\t\t\t.removeClass( \"ui-corner-all ui-state-hover\" )\r\n\t\t\t\t.removeAttr( \"tabIndex\" )\r\n\t\t\t\t.removeAttr( \"role\" )\r\n\t\t\t\t.removeAttr( \"aria-haspopup\" )\r\n\t\t\t\t.children().each( function() {\r\n\t\t\t\t\tvar elem = $( this );\r\n\t\t\t\t\tif ( elem.data( \"ui-menu-submenu-carat\" ) ) {\r\n\t\t\t\t\t\telem.remove();\r\n\t\t\t\t\t}\r\n\t\t\t\t});\r\n\r\n\t\t// Destroy menu dividers\r\n\t\tthis.element.find( \".ui-menu-divider\" ).removeClass( \"ui-menu-divider ui-widget-content\" );\r\n\t},\r\n\r\n\t_keydown: function( event ) {\r\n\t\t/*jshint maxcomplexity:20*/\r\n\t\tvar match, prev, character, skip, regex,\r\n\t\t\tpreventDefault = true;\r\n\r\n\t\tfunction escape( value ) {\r\n\t\t\treturn value.replace( /[\\-\\[\\]{}()*+?.,\\\\\\^$|#\\s]/g, \"\\\\$&\" );\r\n\t\t}\r\n\r\n\t\tswitch ( event.keyCode ) {\r\n\t\tcase $.ui.keyCode.PAGE_UP:\r\n\t\t\tthis.previousPage( event );\r\n\t\t\tbreak;\r\n\t\tcase $.ui.keyCode.PAGE_DOWN:\r\n\t\t\tthis.nextPage( event );\r\n\t\t\tbreak;\r\n\t\tcase $.ui.keyCode.HOME:\r\n\t\t\tthis._move( \"first\", \"first\", event );\r\n\t\t\tbreak;\r\n\t\tcase $.ui.keyCode.END:\r\n\t\t\tthis._move( \"last\", \"last\", event );\r\n\t\t\tbreak;\r\n\t\tcase $.ui.keyCode.UP:\r\n\t\t\tthis.previous( event );\r\n\t\t\tbreak;\r\n\t\tcase $.ui.keyCode.DOWN:\r\n\t\t\tthis.next( event );\r\n\t\t\tbreak;\r\n\t\tcase $.ui.keyCode.LEFT:\r\n\t\t\tthis.collapse( event );\r\n\t\t\tbreak;\r\n\t\tcase $.ui.keyCode.RIGHT:\r\n\t\t\tif ( this.active && !this.active.is( \".ui-state-disabled\" ) ) {\r\n\t\t\t\tthis.expand( event );\r\n\t\t\t}\r\n\t\t\tbreak;\r\n\t\tcase $.ui.keyCode.ENTER:\r\n\t\tcase $.ui.keyCode.SPACE:\r\n\t\t\tthis._activate( event );\r\n\t\t\tbreak;\r\n\t\tcase $.ui.keyCode.ESCAPE:\r\n\t\t\tthis.collapse( event );\r\n\t\t\tbreak;\r\n\t\tdefault:\r\n\t\t\tpreventDefault = false;\r\n\t\t\tprev = this.previousFilter || \"\";\r\n\t\t\tcharacter = String.fromCharCode( event.keyCode );\r\n\t\t\tskip = false;\r\n\r\n\t\t\tclearTimeout( this.filterTimer );\r\n\r\n\t\t\tif ( character === prev ) {\r\n\t\t\t\tskip = true;\r\n\t\t\t} else {\r\n\t\t\t\tcharacter = prev + character;\r\n\t\t\t}\r\n\r\n\t\t\tregex = new RegExp( \"^\" + escape( character ), \"i\" );\r\n\t\t\tmatch = this.activeMenu.children( \".ui-menu-item\" ).filter(function() {\r\n\t\t\t\treturn regex.test( $( this ).children( \"a\" ).text() );\r\n\t\t\t});\r\n\t\t\tmatch = skip && match.index( this.active.next() ) !== -1 ?\r\n\t\t\t\tthis.active.nextAll( \".ui-menu-item\" ) :\r\n\t\t\t\tmatch;\r\n\r\n\t\t\t// If no matches on the current filter, reset to the last character pressed\r\n\t\t\t// to move down the menu to the first item that starts with that character\r\n\t\t\tif ( !match.length ) {\r\n\t\t\t\tcharacter = String.fromCharCode( event.keyCode );\r\n\t\t\t\tregex = new RegExp( \"^\" + escape( character ), \"i\" );\r\n\t\t\t\tmatch = this.activeMenu.children( \".ui-menu-item\" ).filter(function() {\r\n\t\t\t\t\treturn regex.test( $( this ).children( \"a\" ).text() );\r\n\t\t\t\t});\r\n\t\t\t}\r\n\r\n\t\t\tif ( match.length ) {\r\n\t\t\t\tthis.focus( event, match );\r\n\t\t\t\tif ( match.length > 1 ) {\r\n\t\t\t\t\tthis.previousFilter = character;\r\n\t\t\t\t\tthis.filterTimer = this._delay(function() {\r\n\t\t\t\t\t\tdelete this.previousFilter;\r\n\t\t\t\t\t}, 1000 );\r\n\t\t\t\t} else {\r\n\t\t\t\t\tdelete this.previousFilter;\r\n\t\t\t\t}\r\n\t\t\t} else {\r\n\t\t\t\tdelete this.previousFilter;\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tif ( preventDefault ) {\r\n\t\t\tevent.preventDefault();\r\n\t\t}\r\n\t},\r\n\r\n\t_activate: function( event ) {\r\n\t\tif ( !this.active.is( \".ui-state-disabled\" ) ) {\r\n\t\t\tif ( this.active.children( \"a[aria-haspopup='true']\" ).length ) {\r\n\t\t\t\tthis.expand( event );\r\n\t\t\t} else {\r\n\t\t\t\tthis.select( event );\r\n\t\t\t}\r\n\t\t}\r\n\t},\r\n\r\n\trefresh: function() {\r\n\t\tvar menus,\r\n\t\t\ticon = this.options.icons.submenu,\r\n\t\t\tsubmenus = this.element.find( this.options.menus );\r\n\r\n\t\t// Initialize nested menus\r\n\t\tsubmenus.filter( \":not(.ui-menu)\" )\r\n\t\t\t.addClass( \"ui-menu ui-widget ui-widget-content ui-corner-all\" )\r\n\t\t\t.hide()\r\n\t\t\t.attr({\r\n\t\t\t\trole: this.options.role,\r\n\t\t\t\t\"aria-hidden\": \"true\",\r\n\t\t\t\t\"aria-expanded\": \"false\"\r\n\t\t\t})\r\n\t\t\t.each(function() {\r\n\t\t\t\tvar menu = $( this ),\r\n\t\t\t\t\titem = menu.prev( \"a\" ),\r\n\t\t\t\t\tsubmenuCarat = $( \"\" )\r\n\t\t\t\t\t\t.addClass( \"ui-menu-icon ui-icon \" + icon )\r\n\t\t\t\t\t\t.data( \"ui-menu-submenu-carat\", true );\r\n\r\n\t\t\t\titem\r\n\t\t\t\t\t.attr( \"aria-haspopup\", \"true\" )\r\n\t\t\t\t\t.prepend( submenuCarat );\r\n\t\t\t\tmenu.attr( \"aria-labelledby\", item.attr( \"id\" ) );\r\n\t\t\t});\r\n\r\n\t\tmenus = submenus.add( this.element );\r\n\r\n\t\t// Don't refresh list items that are already adapted\r\n\t\tmenus.children( \":not(.ui-menu-item):has(a)\" )\r\n\t\t\t.addClass( \"ui-menu-item\" )\r\n\t\t\t.attr( \"role\", \"presentation\" )\r\n\t\t\t.children( \"a\" )\r\n\t\t\t\t.uniqueId()\r\n\t\t\t\t.addClass( \"ui-corner-all\" )\r\n\t\t\t\t.attr({\r\n\t\t\t\t\ttabIndex: -1,\r\n\t\t\t\t\trole: this._itemRole()\r\n\t\t\t\t});\r\n\r\n\t\t// Initialize unlinked menu-items containing spaces and/or dashes only as dividers\r\n\t\tmenus.children( \":not(.ui-menu-item)\" ).each(function() {\r\n\t\t\tvar item = $( this );\r\n\t\t\t// hyphen, em dash, en dash\r\n\t\t\tif ( !/[^\\-\\u2014\\u2013\\s]/.test( item.text() ) ) {\r\n\t\t\t\titem.addClass( \"ui-widget-content ui-menu-divider\" );\r\n\t\t\t}\r\n\t\t});\r\n\r\n\t\t// Add aria-disabled attribute to any disabled menu item\r\n\t\tmenus.children( \".ui-state-disabled\" ).attr( \"aria-disabled\", \"true\" );\r\n\r\n\t\t// If the active item has been removed, blur the menu\r\n\t\tif ( this.active && !$.contains( this.element[ 0 ], this.active[ 0 ] ) ) {\r\n\t\t\tthis.blur();\r\n\t\t}\r\n\t},\r\n\r\n\t_itemRole: function() {\r\n\t\treturn {\r\n\t\t\tmenu: \"menuitem\",\r\n\t\t\tlistbox: \"option\"\r\n\t\t}[ this.options.role ];\r\n\t},\r\n\r\n\t_setOption: function( key, value ) {\r\n\t\tif ( key === \"icons\" ) {\r\n\t\t\tthis.element.find( \".ui-menu-icon\" )\r\n\t\t\t\t.removeClass( this.options.icons.submenu )\r\n\t\t\t\t.addClass( value.submenu );\r\n\t\t}\r\n\t\tthis._super( key, value );\r\n\t},\r\n\r\n\tfocus: function( event, item ) {\r\n\t\tvar nested, focused;\r\n\t\tthis.blur( event, event && event.type === \"focus\" );\r\n\r\n\t\tthis._scrollIntoView( item );\r\n\r\n\t\tthis.active = item.first();\r\n\t\tfocused = this.active.children( \"a\" ).addClass( \"ui-state-focus\" );\r\n\t\t// Only update aria-activedescendant if there's a role\r\n\t\t// otherwise we assume focus is managed elsewhere\r\n\t\tif ( this.options.role ) {\r\n\t\t\tthis.element.attr( \"aria-activedescendant\", focused.attr( \"id\" ) );\r\n\t\t}\r\n\r\n\t\t// Highlight active parent menu item, if any\r\n\t\tthis.active\r\n\t\t\t.parent()\r\n\t\t\t.closest( \".ui-menu-item\" )\r\n\t\t\t.children( \"a:first\" )\r\n\t\t\t.addClass( \"ui-state-active\" );\r\n\r\n\t\tif ( event && event.type === \"keydown\" ) {\r\n\t\t\tthis._close();\r\n\t\t} else {\r\n\t\t\tthis.timer = this._delay(function() {\r\n\t\t\t\tthis._close();\r\n\t\t\t}, this.delay );\r\n\t\t}\r\n\r\n\t\tnested = item.children( \".ui-menu\" );\r\n\t\tif ( nested.length && ( /^mouse/.test( event.type ) ) ) {\r\n\t\t\tthis._startOpening(nested);\r\n\t\t}\r\n\t\tthis.activeMenu = item.parent();\r\n\r\n\t\tthis._trigger( \"focus\", event, { item: item } );\r\n\t},\r\n\r\n\t_scrollIntoView: function( item ) {\r\n\t\tvar borderTop, paddingTop, offset, scroll, elementHeight, itemHeight;\r\n\t\tif ( this._hasScroll() ) {\r\n\t\t\tborderTop = parseFloat( $.css( this.activeMenu[0], \"borderTopWidth\" ) ) || 0;\r\n\t\t\tpaddingTop = parseFloat( $.css( this.activeMenu[0], \"paddingTop\" ) ) || 0;\r\n\t\t\toffset = item.offset().top - this.activeMenu.offset().top - borderTop - paddingTop;\r\n\t\t\tscroll = this.activeMenu.scrollTop();\r\n\t\t\telementHeight = this.activeMenu.height();\r\n\t\t\titemHeight = item.height();\r\n\r\n\t\t\tif ( offset < 0 ) {\r\n\t\t\t\tthis.activeMenu.scrollTop( scroll + offset );\r\n\t\t\t} else if ( offset + itemHeight > elementHeight ) {\r\n\t\t\t\tthis.activeMenu.scrollTop( scroll + offset - elementHeight + itemHeight );\r\n\t\t\t}\r\n\t\t}\r\n\t},\r\n\r\n\tblur: function( event, fromFocus ) {\r\n\t\tif ( !fromFocus ) {\r\n\t\t\tclearTimeout( this.timer );\r\n\t\t}\r\n\r\n\t\tif ( !this.active ) {\r\n\t\t\treturn;\r\n\t\t}\r\n\r\n\t\tthis.active.children( \"a\" ).removeClass( \"ui-state-focus\" );\r\n\t\tthis.active = null;\r\n\r\n\t\tthis._trigger( \"blur\", event, { item: this.active } );\r\n\t},\r\n\r\n\t_startOpening: function( submenu ) {\r\n\t\tclearTimeout( this.timer );\r\n\r\n\t\t// Don't open if already open fixes a Firefox bug that caused a .5 pixel\r\n\t\t// shift in the submenu position when mousing over the carat icon\r\n\t\tif ( submenu.attr( \"aria-hidden\" ) !== \"true\" ) {\r\n\t\t\treturn;\r\n\t\t}\r\n\r\n\t\tthis.timer = this._delay(function() {\r\n\t\t\tthis._close();\r\n\t\t\tthis._open( submenu );\r\n\t\t}, this.delay );\r\n\t},\r\n\r\n\t_open: function( submenu ) {\r\n\t\tvar position = $.extend({\r\n\t\t\tof: this.active\r\n\t\t}, this.options.position );\r\n\r\n\t\tclearTimeout( this.timer );\r\n\t\tthis.element.find( \".ui-menu\" ).not( submenu.parents( \".ui-menu\" ) )\r\n\t\t\t.hide()\r\n\t\t\t.attr( \"aria-hidden\", \"true\" );\r\n\r\n\t\tsubmenu\r\n\t\t\t.show()\r\n\t\t\t.removeAttr( \"aria-hidden\" )\r\n\t\t\t.attr( \"aria-expanded\", \"true\" )\r\n\t\t\t.position( position );\r\n\t},\r\n\r\n\tcollapseAll: function( event, all ) {\r\n\t\tclearTimeout( this.timer );\r\n\t\tthis.timer = this._delay(function() {\r\n\t\t\t// If we were passed an event, look for the submenu that contains the event\r\n\t\t\tvar currentMenu = all ? this.element :\r\n\t\t\t\t$( event && event.target ).closest( this.element.find( \".ui-menu\" ) );\r\n\r\n\t\t\t// If we found no valid submenu ancestor, use the main menu to close all sub menus anyway\r\n\t\t\tif ( !currentMenu.length ) {\r\n\t\t\t\tcurrentMenu = this.element;\r\n\t\t\t}\r\n\r\n\t\t\tthis._close( currentMenu );\r\n\r\n\t\t\tthis.blur( event );\r\n\t\t\tthis.activeMenu = currentMenu;\r\n\t\t}, this.delay );\r\n\t},\r\n\r\n\t// With no arguments, closes the currently active menu - if nothing is active\r\n\t// it closes all menus. If passed an argument, it will search for menus BELOW\r\n\t_close: function( startMenu ) {\r\n\t\tif ( !startMenu ) {\r\n\t\t\tstartMenu = this.active ? this.active.parent() : this.element;\r\n\t\t}\r\n\r\n\t\tstartMenu\r\n\t\t\t.find( \".ui-menu\" )\r\n\t\t\t\t.hide()\r\n\t\t\t\t.attr( \"aria-hidden\", \"true\" )\r\n\t\t\t\t.attr( \"aria-expanded\", \"false\" )\r\n\t\t\t.end()\r\n\t\t\t.find( \"a.ui-state-active\" )\r\n\t\t\t\t.removeClass( \"ui-state-active\" );\r\n\t},\r\n\r\n\tcollapse: function( event ) {\r\n\t\tvar newItem = this.active &&\r\n\t\t\tthis.active.parent().closest( \".ui-menu-item\", this.element );\r\n\t\tif ( newItem && newItem.length ) {\r\n\t\t\tthis._close();\r\n\t\t\tthis.focus( event, newItem );\r\n\t\t}\r\n\t},\r\n\r\n\texpand: function( event ) {\r\n\t\tvar newItem = this.active &&\r\n\t\t\tthis.active\r\n\t\t\t\t.children( \".ui-menu \" )\r\n\t\t\t\t.children( \".ui-menu-item\" )\r\n\t\t\t\t.first();\r\n\r\n\t\tif ( newItem && newItem.length ) {\r\n\t\t\tthis._open( newItem.parent() );\r\n\r\n\t\t\t// Delay so Firefox will not hide activedescendant change in expanding submenu from AT\r\n\t\t\tthis._delay(function() {\r\n\t\t\t\tthis.focus( event, newItem );\r\n\t\t\t});\r\n\t\t}\r\n\t},\r\n\r\n\tnext: function( event ) {\r\n\t\tthis._move( \"next\", \"first\", event );\r\n\t},\r\n\r\n\tprevious: function( event ) {\r\n\t\tthis._move( \"prev\", \"last\", event );\r\n\t},\r\n\r\n\tisFirstItem: function() {\r\n\t\treturn this.active && !this.active.prevAll( \".ui-menu-item\" ).length;\r\n\t},\r\n\r\n\tisLastItem: function() {\r\n\t\treturn this.active && !this.active.nextAll( \".ui-menu-item\" ).length;\r\n\t},\r\n\r\n\t_move: function( direction, filter, event ) {\r\n\t\tvar next;\r\n\t\tif ( this.active ) {\r\n\t\t\tif ( direction === \"first\" || direction === \"last\" ) {\r\n\t\t\t\tnext = this.active\r\n\t\t\t\t\t[ direction === \"first\" ? \"prevAll\" : \"nextAll\" ]( \".ui-menu-item\" )\r\n\t\t\t\t\t.eq( -1 );\r\n\t\t\t} else {\r\n\t\t\t\tnext = this.active\r\n\t\t\t\t\t[ direction + \"All\" ]( \".ui-menu-item\" )\r\n\t\t\t\t\t.eq( 0 );\r\n\t\t\t}\r\n\t\t}\r\n\t\tif ( !next || !next.length || !this.active ) {\r\n\t\t\tnext = this.activeMenu.children( \".ui-menu-item\" )[ filter ]();\r\n\t\t}\r\n\r\n\t\tthis.focus( event, next );\r\n\t},\r\n\r\n\tnextPage: function( event ) {\r\n\t\tvar item, base, height;\r\n\r\n\t\tif ( !this.active ) {\r\n\t\t\tthis.next( event );\r\n\t\t\treturn;\r\n\t\t}\r\n\t\tif ( this.isLastItem() ) {\r\n\t\t\treturn;\r\n\t\t}\r\n\t\tif ( this._hasScroll() ) {\r\n\t\t\tbase = this.active.offset().top;\r\n\t\t\theight = this.element.height();\r\n\t\t\tthis.active.nextAll( \".ui-menu-item\" ).each(function() {\r\n\t\t\t\titem = $( this );\r\n\t\t\t\treturn item.offset().top - base - height < 0;\r\n\t\t\t});\r\n\r\n\t\t\tthis.focus( event, item );\r\n\t\t} else {\r\n\t\t\tthis.focus( event, this.activeMenu.children( \".ui-menu-item\" )\r\n\t\t\t\t[ !this.active ? \"first\" : \"last\" ]() );\r\n\t\t}\r\n\t},\r\n\r\n\tpreviousPage: function( event ) {\r\n\t\tvar item, base, height;\r\n\t\tif ( !this.active ) {\r\n\t\t\tthis.next( event );\r\n\t\t\treturn;\r\n\t\t}\r\n\t\tif ( this.isFirstItem() ) {\r\n\t\t\treturn;\r\n\t\t}\r\n\t\tif ( this._hasScroll() ) {\r\n\t\t\tbase = this.active.offset().top;\r\n\t\t\theight = this.element.height();\r\n\t\t\tthis.active.prevAll( \".ui-menu-item\" ).each(function() {\r\n\t\t\t\titem = $( this );\r\n\t\t\t\treturn item.offset().top - base + height > 0;\r\n\t\t\t});\r\n\r\n\t\t\tthis.focus( event, item );\r\n\t\t} else {\r\n\t\t\tthis.focus( event, this.activeMenu.children( \".ui-menu-item\" ).first() );\r\n\t\t}\r\n\t},\r\n\r\n\t_hasScroll: function() {\r\n\t\treturn this.element.outerHeight() < this.element.prop( \"scrollHeight\" );\r\n\t},\r\n\r\n\tselect: function( event ) {\r\n\t\t// TODO: It should never be possible to not have an active item at this\r\n\t\t// point, but the tests don't trigger mouseenter before click.\r\n\t\tthis.active = this.active || $( event.target ).closest( \".ui-menu-item\" );\r\n\t\tvar ui = { item: this.active };\r\n\t\tif ( !this.active.has( \".ui-menu\" ).length ) {\r\n\t\t\tthis.collapseAll( event, true );\r\n\t\t}\r\n\t\tthis._trigger( \"select\", event, ui );\r\n\t}\r\n});\r\n\r\n}( jQuery ));\r\n","/*\r\n* jQuery Easing v1.3 - http://gsgd.co.uk/sandbox/jquery/easing/\r\n*\r\n* Uses the built in easing capabilities added In jQuery 1.1\r\n* to offer multiple easing options\r\n*\r\n* TERMS OF USE - jQuery Easing\r\n* \r\n* Open source under the BSD License. \r\n* \r\n* Copyright © 2008 George McGinley Smith\r\n* All rights reserved.\r\n* \r\n* Redistribution and use in source and binary forms, with or without modification, \r\n* are permitted provided that the following conditions are met:\r\n* \r\n* Redistributions of source code must retain the above copyright notice, this list of \r\n* conditions and the following disclaimer.\r\n* Redistributions in binary form must reproduce the above copyright notice, this list \r\n* of conditions and the following disclaimer in the documentation and/or other materials \r\n* provided with the distribution.\r\n* \r\n* Neither the name of the author nor the names of contributors may be used to endorse \r\n* or promote products derived from this software without specific prior written permission.\r\n* \r\n* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND ANY \r\n* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF\r\n* MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE\r\n* COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,\r\n* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE\r\n* GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED \r\n* AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING\r\n* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED \r\n* OF THE POSSIBILITY OF SUCH DAMAGE. \r\n*\r\n*/\r\n\r\n// t: current time, b: begInnIng value, c: change In value, d: duration\r\njQuery.easing['jswing'] = jQuery.easing['swing'];\r\n\r\njQuery.extend(jQuery.easing,\r\n{\r\n def: 'easeOutQuad',\r\n swing: function (x, t, b, c, d) {\r\n //alert(jQuery.easing.default);\r\n return jQuery.easing[jQuery.easing.def](x, t, b, c, d);\r\n },\r\n easeInQuad: function (x, t, b, c, d) {\r\n return c * (t /= d) * t + b;\r\n },\r\n easeOutQuad: function (x, t, b, c, d) {\r\n return -c * (t /= d) * (t - 2) + b;\r\n },\r\n easeInOutQuad: function (x, t, b, c, d) {\r\n if ((t /= d / 2) < 1) return c / 2 * t * t + b;\r\n return -c / 2 * ((--t) * (t - 2) - 1) + b;\r\n },\r\n easeInCubic: function (x, t, b, c, d) {\r\n return c * (t /= d) * t * t + b;\r\n },\r\n easeOutCubic: function (x, t, b, c, d) {\r\n return c * ((t = t / d - 1) * t * t + 1) + b;\r\n },\r\n easeInOutCubic: function (x, t, b, c, d) {\r\n if ((t /= d / 2) < 1) return c / 2 * t * t * t + b;\r\n return c / 2 * ((t -= 2) * t * t + 2) + b;\r\n },\r\n easeInQuart: function (x, t, b, c, d) {\r\n return c * (t /= d) * t * t * t + b;\r\n },\r\n easeOutQuart: function (x, t, b, c, d) {\r\n return -c * ((t = t / d - 1) * t * t * t - 1) + b;\r\n },\r\n easeInOutQuart: function (x, t, b, c, d) {\r\n if ((t /= d / 2) < 1) return c / 2 * t * t * t * t + b;\r\n return -c / 2 * ((t -= 2) * t * t * t - 2) + b;\r\n },\r\n easeInQuint: function (x, t, b, c, d) {\r\n return c * (t /= d) * t * t * t * t + b;\r\n },\r\n easeOutQuint: function (x, t, b, c, d) {\r\n return c * ((t = t / d - 1) * t * t * t * t + 1) + b;\r\n },\r\n easeInOutQuint: function (x, t, b, c, d) {\r\n if ((t /= d / 2) < 1) return c / 2 * t * t * t * t * t + b;\r\n return c / 2 * ((t -= 2) * t * t * t * t + 2) + b;\r\n },\r\n easeInSine: function (x, t, b, c, d) {\r\n return -c * Math.cos(t / d * (Math.PI / 2)) + c + b;\r\n },\r\n easeOutSine: function (x, t, b, c, d) {\r\n return c * Math.sin(t / d * (Math.PI / 2)) + b;\r\n },\r\n easeInOutSine: function (x, t, b, c, d) {\r\n return -c / 2 * (Math.cos(Math.PI * t / d) - 1) + b;\r\n },\r\n easeInExpo: function (x, t, b, c, d) {\r\n return (t == 0) ? b : c * Math.pow(2, 10 * (t / d - 1)) + b;\r\n },\r\n easeOutExpo: function (x, t, b, c, d) {\r\n return (t == d) ? b + c : c * (-Math.pow(2, -10 * t / d) + 1) + b;\r\n },\r\n easeInOutExpo: function (x, t, b, c, d) {\r\n if (t == 0) return b;\r\n if (t == d) return b + c;\r\n if ((t /= d / 2) < 1) return c / 2 * Math.pow(2, 10 * (t - 1)) + b;\r\n return c / 2 * (-Math.pow(2, -10 * --t) + 2) + b;\r\n },\r\n easeInCirc: function (x, t, b, c, d) {\r\n return -c * (Math.sqrt(1 - (t /= d) * t) - 1) + b;\r\n },\r\n easeOutCirc: function (x, t, b, c, d) {\r\n return c * Math.sqrt(1 - (t = t / d - 1) * t) + b;\r\n },\r\n easeInOutCirc: function (x, t, b, c, d) {\r\n if ((t /= d / 2) < 1) return -c / 2 * (Math.sqrt(1 - t * t) - 1) + b;\r\n return c / 2 * (Math.sqrt(1 - (t -= 2) * t) + 1) + b;\r\n },\r\n easeInElastic: function (x, t, b, c, d) {\r\n var s = 1.70158; var p = 0; var a = c;\r\n if (t == 0) return b; if ((t /= d) == 1) return b + c; if (!p) p = d * .3;\r\n if (a < Math.abs(c)) { a = c; var s = p / 4; }\r\n else var s = p / (2 * Math.PI) * Math.asin(c / a);\r\n return -(a * Math.pow(2, 10 * (t -= 1)) * Math.sin((t * d - s) * (2 * Math.PI) / p)) + b;\r\n },\r\n easeOutElastic: function (x, t, b, c, d) {\r\n var s = 1.70158; var p = 0; var a = c;\r\n if (t == 0) return b; if ((t /= d) == 1) return b + c; if (!p) p = d * .3;\r\n if (a < Math.abs(c)) { a = c; var s = p / 4; }\r\n else var s = p / (2 * Math.PI) * Math.asin(c / a);\r\n return a * Math.pow(2, -10 * t) * Math.sin((t * d - s) * (2 * Math.PI) / p) + c + b;\r\n },\r\n easeInOutElastic: function (x, t, b, c, d) {\r\n var s = 1.70158; var p = 0; var a = c;\r\n if (t == 0) return b; if ((t /= d / 2) == 2) return b + c; if (!p) p = d * (.3 * 1.5);\r\n if (a < Math.abs(c)) { a = c; var s = p / 4; }\r\n else var s = p / (2 * Math.PI) * Math.asin(c / a);\r\n if (t < 1) return -.5 * (a * Math.pow(2, 10 * (t -= 1)) * Math.sin((t * d - s) * (2 * Math.PI) / p)) + b;\r\n return a * Math.pow(2, -10 * (t -= 1)) * Math.sin((t * d - s) * (2 * Math.PI) / p) * .5 + c + b;\r\n },\r\n easeInBack: function (x, t, b, c, d, s) {\r\n if (s == undefined) s = 1.70158;\r\n return c * (t /= d) * t * ((s + 1) * t - s) + b;\r\n },\r\n easeOutBack: function (x, t, b, c, d, s) {\r\n if (s == undefined) s = 1.70158;\r\n return c * ((t = t / d - 1) * t * ((s + 1) * t + s) + 1) + b;\r\n },\r\n easeInOutBack: function (x, t, b, c, d, s) {\r\n if (s == undefined) s = 1.70158;\r\n if ((t /= d / 2) < 1) return c / 2 * (t * t * (((s *= (1.525)) + 1) * t - s)) + b;\r\n return c / 2 * ((t -= 2) * t * (((s *= (1.525)) + 1) * t + s) + 2) + b;\r\n },\r\n easeInBounce: function (x, t, b, c, d) {\r\n return c - jQuery.easing.easeOutBounce(x, d - t, 0, c, d) + b;\r\n },\r\n easeOutBounce: function (x, t, b, c, d) {\r\n if ((t /= d) < (1 / 2.75)) {\r\n return c * (7.5625 * t * t) + b;\r\n } else if (t < (2 / 2.75)) {\r\n return c * (7.5625 * (t -= (1.5 / 2.75)) * t + .75) + b;\r\n } else if (t < (2.5 / 2.75)) {\r\n return c * (7.5625 * (t -= (2.25 / 2.75)) * t + .9375) + b;\r\n } else {\r\n return c * (7.5625 * (t -= (2.625 / 2.75)) * t + .984375) + b;\r\n }\r\n },\r\n easeInOutBounce: function (x, t, b, c, d) {\r\n if (t < d / 2) return jQuery.easing.easeInBounce(x, t * 2, 0, c, d) * .5 + b;\r\n return jQuery.easing.easeOutBounce(x, t * 2 - d, 0, c, d) * .5 + c * .5 + b;\r\n }\r\n});\r\n\r\n/*\r\n*\r\n* TERMS OF USE - EASING EQUATIONS\r\n* \r\n* Open source under the BSD License. \r\n* \r\n* Copyright © 2001 Robert Penner\r\n* All rights reserved.\r\n* \r\n* Redistribution and use in source and binary forms, with or without modification, \r\n* are permitted provided that the following conditions are met:\r\n* \r\n* Redistributions of source code must retain the above copyright notice, this list of \r\n* conditions and the following disclaimer.\r\n* Redistributions in binary form must reproduce the above copyright notice, this list \r\n* of conditions and the following disclaimer in the documentation and/or other materials \r\n* provided with the distribution.\r\n* \r\n* Neither the name of the author nor the names of contributors may be used to endorse \r\n* or promote products derived from this software without specific prior written permission.\r\n* \r\n* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND ANY \r\n* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF\r\n* MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE\r\n* COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,\r\n* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE\r\n* GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED \r\n* AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING\r\n* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED \r\n* OF THE POSSIBILITY OF SUCH DAMAGE. \r\n*\r\n*/","/*!\r\n SerializeJSON jQuery plugin.\r\n https://github.com/marioizquierdo/jquery.serializeJSON\r\n version 2.6.0 (Apr, 2015)\r\n\r\n Copyright (c) 2012, 2015 Mario Izquierdo\r\n Dual licensed under the MIT (http://www.opensource.org/licenses/mit-license.php)\r\n and GPL (http://www.opensource.org/licenses/gpl-license.php) licenses.\r\n*/\r\n(function ($) {\r\n \"use strict\";\r\n\r\n // jQuery('form').serializeJSON()\r\n $.fn.serializeJSON = function (options) {\r\n var serializedObject, formAsArray, keys, type, value, _ref, f, opts;\r\n f = $.serializeJSON;\r\n opts = f.setupOpts(options); // calculate values for options {parseNumbers, parseBoolens, parseNulls}\r\n formAsArray = this.serializeArray(); // array of objects {name, value}\r\n f.readCheckboxUncheckedValues(formAsArray, this, opts); // add {name, value} of unchecked checkboxes if needed\r\n\r\n serializedObject = {};\r\n $.each(formAsArray, function (i, input) {\r\n keys = f.splitInputNameIntoKeysArray(input.name, opts);\r\n type = keys.pop(); // the last element is always the type (\"string\" by default)\r\n if (type !== 'skip') { // easy way to skip a value\r\n value = f.parseValue(input.value, type, opts); // string, number, boolean or null\r\n if (opts.parseWithFunction && type === '_') value = opts.parseWithFunction(value, input.name); // allow for custom parsing\r\n f.deepSet(serializedObject, keys, value, opts);\r\n }\r\n });\r\n return serializedObject;\r\n };\r\n\r\n // Use $.serializeJSON as namespace for the auxiliar functions\r\n // and to define defaults\r\n $.serializeJSON = {\r\n\r\n defaultOptions: {\r\n checkboxUncheckedValue: undefined, // to include that value for unchecked checkboxes (instead of ignoring them)\r\n\r\n parseNumbers: false, // convert values like \"1\", \"-2.33\" to 1, -2.33\r\n parseBooleans: false, // convert \"true\", \"false\" to true, false\r\n parseNulls: false, // convert \"null\" to null\r\n parseAll: false, // all of the above\r\n parseWithFunction: null, // to use custom parser, a function like: function(val){ return parsed_val; }\r\n\r\n customTypes: {}, // override defaultTypes\r\n defaultTypes: {\r\n string: function(str) { return String(str) },\r\n number: function(str) { return Number(str) },\r\n boolean: function(str) { return ([\"false\", \"null\", \"undefined\", \"\", \"0\"].indexOf(str) === -1) },\r\n null: function(str) { return ([\"false\", \"null\", \"undefined\", \"\", \"0\"].indexOf(str) !== -1) ? null : str },\r\n array: function(str) { return JSON.parse(str) },\r\n object: function(str) { return JSON.parse(str) },\r\n auto: function(str) { return $.serializeJSON.parseValue(str, null, {parseNumbers: true, parseBooleans: true, parseNulls: true}) } // try again with something like \"parseAll\"\r\n },\r\n\r\n useIntKeysAsArrayIndex: false, // name=\"foo[2]\" value=\"v\" => {foo: [null, null, \"v\"]}, instead of {foo: [\"2\": \"v\"]}\r\n },\r\n\r\n // Merge option defaults into the options\r\n setupOpts: function(options) {\r\n var opt, validOpts, defaultOptions, optWithDefault, parseAll, f;\r\n f = $.serializeJSON;\r\n\r\n if (options == null) options = {}; // options ||= {}\r\n defaultOptions = f.defaultOptions || {}; // defaultOptions\r\n\r\n // Make sure that the user didn't misspell an option\r\n validOpts = ['checkboxUncheckedValue', 'parseNumbers', 'parseBooleans', 'parseNulls', 'parseAll', 'parseWithFunction', 'customTypes', 'defaultTypes', 'useIntKeysAsArrayIndex']; // re-define because the user may override the defaultOptions\r\n for (opt in options) {\r\n if (validOpts.indexOf(opt) === -1) {\r\n throw new Error(\"serializeJSON ERROR: invalid option '\" + opt + \"'. Please use one of \" + validOpts.join(', '));\r\n }\r\n }\r\n\r\n // Helper to get the default value for this option if none is specified by the user\r\n optWithDefault = function(key) { return (options[key] !== false) && (options[key] !== '') && (options[key] || defaultOptions[key]); }\r\n\r\n // Return computed options (opts to be used in the rest of the script)\r\n parseAll = optWithDefault('parseAll');\r\n return {\r\n checkboxUncheckedValue: optWithDefault('checkboxUncheckedValue'),\r\n\r\n parseNumbers: parseAll || optWithDefault('parseNumbers'),\r\n parseBooleans: parseAll || optWithDefault('parseBooleans'),\r\n parseNulls: parseAll || optWithDefault('parseNulls'),\r\n parseWithFunction: optWithDefault('parseWithFunction'),\r\n\r\n typeFunctions: $.extend({}, optWithDefault('defaultTypes'), optWithDefault('customTypes')),\r\n\r\n useIntKeysAsArrayIndex: optWithDefault('useIntKeysAsArrayIndex'),\r\n }\r\n },\r\n\r\n // Given a string, apply the type or the relevant \"parse\" options, to return the parsed value\r\n parseValue: function(str, type, opts) {\r\n var typeFunction, f;\r\n f = $.serializeJSON;\r\n\r\n // Parse with a type if available\r\n typeFunction = opts.typeFunctions && opts.typeFunctions[type];\r\n if (typeFunction) return typeFunction(str); // use specific type\r\n\r\n // Otherwise, check if there is any auto-parse option enabled and use it.\r\n if (opts.parseNumbers && f.isNumeric(str)) return Number(str); // auto: number\r\n if (opts.parseBooleans && (str === \"true\" || str === \"false\")) return str === \"true\"; // auto: boolean\r\n if (opts.parseNulls && str == \"null\") return null; // auto: null\r\n\r\n // If none applies, just return the str\r\n return str;\r\n },\r\n\r\n isObject: function(obj) { return obj === Object(obj); }, // is this variable an object?\r\n isUndefined: function(obj) { return obj === void 0; }, // safe check for undefined values\r\n isValidArrayIndex: function(val) { return /^[0-9]+$/.test(String(val)); }, // 1,2,3,4 ... are valid array indexes\r\n isNumeric: function(obj) { return obj - parseFloat(obj) >= 0; }, // taken from jQuery.isNumeric implementation. Not using jQuery.isNumeric to support old jQuery and Zepto versions\r\n\r\n optionKeys: function(obj) { if(Object.keys){ return Object.keys(obj); } else { var keys = []; for(var key in obj){ keys.push(key) }; return keys;} }, // polyfill Object.keys to get option keys in IE<9\r\n\r\n // Split the input name in programatically readable keys.\r\n // The last element is always the type (default \"_\").\r\n // Examples:\r\n // \"foo\" => ['foo', '_']\r\n // \"foo:string\" => ['foo', 'string']\r\n // \"foo:boolean\" => ['foo', 'boolean']\r\n // \"[foo]\" => ['foo', '_']\r\n // \"foo[inn][bar]\" => ['foo', 'inn', 'bar', '_']\r\n // \"foo[inn[bar]]\" => ['foo', 'inn', 'bar', '_']\r\n // \"foo[inn][arr][0]\" => ['foo', 'inn', 'arr', '0', '_']\r\n // \"arr[][val]\" => ['arr', '', 'val', '_']\r\n // \"arr[][val]:null\" => ['arr', '', 'val', 'null']\r\n splitInputNameIntoKeysArray: function(name, opts) {\r\n var keys, nameWithoutType, type, _ref, f;\r\n f = $.serializeJSON;\r\n _ref = f.extractTypeFromInputName(name, opts), nameWithoutType = _ref[0], type = _ref[1];\r\n keys = nameWithoutType.split('['); // split string into array\r\n keys = $.map(keys, function (key) { return key.replace(/]/g, ''); }); // remove closing brackets\r\n if (keys[0] === '') { keys.shift(); } // ensure no opening bracket (\"[foo][inn]\" should be same as \"foo[inn]\")\r\n keys.push(type); // add type at the end\r\n return keys;\r\n },\r\n\r\n // Returns [name-without-type, type] from name.\r\n // \"foo\" => [\"foo\", '_']\r\n // \"foo:boolean\" => [\"foo\", 'boolean']\r\n // \"foo[bar]:null\" => [\"foo[bar]\", 'null']\r\n extractTypeFromInputName: function(name, opts) {\r\n var match, validTypes, f;\r\n if (match = name.match(/(.*):([^:]+)$/)){\r\n f = $.serializeJSON;\r\n\r\n validTypes = f.optionKeys(opts ? opts.typeFunctions : f.defaultOptions.defaultTypes);\r\n validTypes.push('skip'); // skip is a special type that makes it easy to remove\r\n if (validTypes.indexOf(match[2]) !== -1) {\r\n return [match[1], match[2]];\r\n } else {\r\n throw new Error(\"serializeJSON ERROR: Invalid type \" + match[2] + \" found in input name '\" + name + \"', please use one of \" + validTypes.join(', '))\r\n }\r\n } else {\r\n return [name, '_']; // no defined type, then use parse options\r\n }\r\n },\r\n\r\n // Set a value in an object or array, using multiple keys to set in a nested object or array:\r\n //\r\n // deepSet(obj, ['foo'], v) // obj['foo'] = v\r\n // deepSet(obj, ['foo', 'inn'], v) // obj['foo']['inn'] = v // Create the inner obj['foo'] object, if needed\r\n // deepSet(obj, ['foo', 'inn', '123'], v) // obj['foo']['arr']['123'] = v //\r\n //\r\n // deepSet(obj, ['0'], v) // obj['0'] = v\r\n // deepSet(arr, ['0'], v, {useIntKeysAsArrayIndex: true}) // arr[0] = v\r\n // deepSet(arr, [''], v) // arr.push(v)\r\n // deepSet(obj, ['arr', ''], v) // obj['arr'].push(v)\r\n //\r\n // arr = [];\r\n // deepSet(arr, ['', v] // arr => [v]\r\n // deepSet(arr, ['', 'foo'], v) // arr => [v, {foo: v}]\r\n // deepSet(arr, ['', 'bar'], v) // arr => [v, {foo: v, bar: v}]\r\n // deepSet(arr, ['', 'bar'], v) // arr => [v, {foo: v, bar: v}, {bar: v}]\r\n //\r\n deepSet: function (o, keys, value, opts) {\r\n var key, nextKey, tail, lastIdx, lastVal, f;\r\n if (opts == null) opts = {};\r\n f = $.serializeJSON;\r\n if (f.isUndefined(o)) { throw new Error(\"ArgumentError: param 'o' expected to be an object or array, found undefined\"); }\r\n if (!keys || keys.length === 0) { throw new Error(\"ArgumentError: param 'keys' expected to be an array with least one element\"); }\r\n\r\n key = keys[0];\r\n\r\n // Only one key, then it's not a deepSet, just assign the value.\r\n if (keys.length === 1) {\r\n if (key === '') {\r\n o.push(value); // '' is used to push values into the array (assume o is an array)\r\n } else {\r\n o[key] = value; // other keys can be used as object keys or array indexes\r\n }\r\n\r\n // With more keys is a deepSet. Apply recursively.\r\n } else {\r\n nextKey = keys[1];\r\n\r\n // '' is used to push values into the array,\r\n // with nextKey, set the value into the same object, in object[nextKey].\r\n // Covers the case of ['', 'foo'] and ['', 'var'] to push the object {foo, var}, and the case of nested arrays.\r\n if (key === '') {\r\n lastIdx = o.length - 1; // asume o is array\r\n lastVal = o[lastIdx];\r\n if (f.isObject(lastVal) && (f.isUndefined(lastVal[nextKey]) || keys.length > 2)) { // if nextKey is not present in the last object element, or there are more keys to deep set\r\n key = lastIdx; // then set the new value in the same object element\r\n } else {\r\n key = lastIdx + 1; // otherwise, point to set the next index in the array\r\n }\r\n }\r\n\r\n // '' is used to push values into the array \"array[]\"\r\n if (nextKey === '') {\r\n if (f.isUndefined(o[key]) || !$.isArray(o[key])) {\r\n o[key] = []; // define (or override) as array to push values\r\n }\r\n } else {\r\n if (opts.useIntKeysAsArrayIndex && f.isValidArrayIndex(nextKey)) { // if 1, 2, 3 ... then use an array, where nextKey is the index\r\n if (f.isUndefined(o[key]) || !$.isArray(o[key])) {\r\n o[key] = []; // define (or override) as array, to insert values using int keys as array indexes\r\n }\r\n } else { // for anything else, use an object, where nextKey is going to be the attribute name\r\n if (f.isUndefined(o[key]) || !f.isObject(o[key])) {\r\n o[key] = {}; // define (or override) as object, to set nested properties\r\n }\r\n }\r\n }\r\n\r\n // Recursively set the inner object\r\n tail = keys.slice(1);\r\n f.deepSet(o[key], tail, value, opts);\r\n }\r\n },\r\n\r\n // Fill the formAsArray object with values for the unchecked checkbox inputs,\r\n // using the same format as the jquery.serializeArray function.\r\n // The value of the unchecked values is determined from the opts.checkboxUncheckedValue\r\n // and/or the data-unchecked-value attribute of the inputs.\r\n readCheckboxUncheckedValues: function (formAsArray, $form, opts) {\r\n var selector, $uncheckedCheckboxes, $el, dataUncheckedValue, f;\r\n if (opts == null) opts = {};\r\n f = $.serializeJSON;\r\n\r\n selector = 'input[type=checkbox][name]:not(:checked):not([disabled])';\r\n $uncheckedCheckboxes = $form.find(selector).add($form.filter(selector));\r\n $uncheckedCheckboxes.each(function (i, el) {\r\n $el = $(el);\r\n dataUncheckedValue = $el.attr('data-unchecked-value');\r\n if(dataUncheckedValue) { // data-unchecked-value has precedence over option opts.checkboxUncheckedValue\r\n formAsArray.push({name: el.name, value: dataUncheckedValue});\r\n } else {\r\n if (!f.isUndefined(opts.checkboxUncheckedValue)) {\r\n formAsArray.push({name: el.name, value: opts.checkboxUncheckedValue});\r\n }\r\n }\r\n });\r\n }\r\n\r\n };\r\n\r\n}(window.jQuery || window.Zepto || window.$));\r\n","/*\r\n * Remodal - v1.0.1\r\n * Responsive, lightweight, fast, synchronized with CSS animations, fully customizable modal window plugin with declarative configuration and hash tracking.\r\n * http://vodkabears.github.io/remodal/\r\n *\r\n * Made by Ilya Makarov\r\n * Under MIT License\r\n */\r\n\r\n!function(a,b){\"function\"==typeof define&&define.amd?define([\"jquery\"],function(c){return b(a,c)}):\"object\"==typeof exports?b(a,require(\"jquery\")):b(a,a.jQuery||a.Zepto)}(this,function(a,b){\"use strict\";function c(a){if(v&&\"none\"===a.css(\"animation-name\")&&\"none\"===a.css(\"-webkit-animation-name\")&&\"none\"===a.css(\"-moz-animation-name\")&&\"none\"===a.css(\"-o-animation-name\")&&\"none\"===a.css(\"-ms-animation-name\"))return 0;var b,c,d,e,f=a.css(\"animation-duration\")||a.css(\"-webkit-animation-duration\")||a.css(\"-moz-animation-duration\")||a.css(\"-o-animation-duration\")||a.css(\"-ms-animation-duration\")||\"0s\",g=a.css(\"animation-delay\")||a.css(\"-webkit-animation-delay\")||a.css(\"-moz-animation-delay\")||a.css(\"-o-animation-delay\")||a.css(\"-ms-animation-delay\")||\"0s\",h=a.css(\"animation-iteration-count\")||a.css(\"-webkit-animation-iteration-count\")||a.css(\"-moz-animation-iteration-count\")||a.css(\"-o-animation-iteration-count\")||a.css(\"-ms-animation-iteration-count\")||\"1\";for(f=f.split(\", \"),g=g.split(\", \"),h=h.split(\", \"),e=0,c=f.length,b=Number.NEGATIVE_INFINITY;c>e;e++)d=parseFloat(f[e])*parseInt(h[e],10)+parseFloat(g[e]),d>b&&(b=d);return d}function d(){if(b(document.body).height()<=b(window).height())return 0;var a,c,d=document.createElement(\"div\"),e=document.createElement(\"div\");return d.style.visibility=\"hidden\",d.style.width=\"100px\",document.body.appendChild(d),a=d.offsetWidth,d.style.overflow=\"scroll\",e.style.width=\"100%\",d.appendChild(e),c=e.offsetWidth,d.parentNode.removeChild(d),a-c}function e(){var a,c,e=b(\"html\"),f=p+\"-is-locked\";e.hasClass(f)||(c=b(document.body),a=parseInt(c.css(\"padding-right\"),10)+d(),c.css(\"padding-right\",a+\"px\"),e.addClass(f))}function f(){var a,c,e=b(\"html\"),f=p+\"-is-locked\";e.hasClass(f)&&(c=b(document.body),a=parseInt(c.css(\"padding-right\"),10)-d(),c.css(\"padding-right\",a+\"px\"),e.removeClass(f))}function g(a,b,c,d){a.$bg.removeClass(p+\"-is-\"+t.CLOSING+\" \"+p+\"-is-\"+t.OPENING+\" \"+p+\"-is-\"+t.CLOSED+\" \"+p+\"-is-\"+t.OPENED).addClass(p+\"-is-\"+b),a.$overlay.removeClass(p+\"-is-\"+t.CLOSING+\" \"+p+\"-is-\"+t.OPENING+\" \"+p+\"-is-\"+t.CLOSED+\" \"+p+\"-is-\"+t.OPENED).addClass(p+\"-is-\"+b),a.$wrapper.removeClass(p+\"-is-\"+t.CLOSING+\" \"+p+\"-is-\"+t.OPENING+\" \"+p+\"-is-\"+t.CLOSED+\" \"+p+\"-is-\"+t.OPENED).addClass(p+\"-is-\"+b),a.$modal.removeClass(p+\"-is-\"+t.CLOSING+\" \"+p+\"-is-\"+t.OPENING+\" \"+p+\"-is-\"+t.CLOSED+\" \"+p+\"-is-\"+t.OPENED).addClass(p+\"-is-\"+b),a.state=b,!c&&a.$modal.trigger({type:b,reason:d},[{reason:d}])}function h(a,d,e){var f=0,g=function(a){a.target===this&&f++},h=function(a){a.target===this&&0===--f&&(b.each([\"$bg\",\"$overlay\",\"$wrapper\",\"$modal\"],function(a,b){e[b].off(q+\" \"+r)}),d())};b.each([\"$bg\",\"$overlay\",\"$wrapper\",\"$modal\"],function(a,b){e[b].on(q,g).on(r,h)}),a(),0===c(e.$bg)&&0===c(e.$overlay)&&0===c(e.$wrapper)&&0===c(e.$modal)&&(b.each([\"$bg\",\"$overlay\",\"$wrapper\",\"$modal\"],function(a,b){e[b].off(q+\" \"+r)}),d())}function i(a){a.state!==t.CLOSED&&(b.each([\"$bg\",\"$overlay\",\"$wrapper\",\"$modal\"],function(b,c){a[c].off(q+\" \"+r)}),a.$bg.removeClass(a.settings.modifier),a.$overlay.removeClass(a.settings.modifier).hide(),a.$wrapper.hide(),f(),g(a,t.CLOSED,!0))}function j(a){var b,c,d,e,f={};for(a=a.replace(/\\s*:\\s*/g,\":\").replace(/\\s*,\\s*/g,\",\"),b=a.split(\",\"),e=0,c=b.length;c>e;e++)b[e]=b[e].split(\":\"),d=b[e][1],(\"string\"==typeof d||d instanceof String)&&(d=\"true\"===d||(\"false\"===d?!1:d)),(\"string\"==typeof d||d instanceof String)&&(d=isNaN(d)?d:+d),f[b[e][0]]=d;return f}function k(){var a,c,d=location.hash.replace(\"#\",\"\");if(d){try{c=b(\"[data-\"+o+\"-id=\"+d.replace(new RegExp(\"/\",\"g\"),\"\\\\/\")+\"]\")}catch(e){}c&&c.length&&(a=b[o].lookup[c.data(o)],a&&a.settings.hashTracking&&a.open())}else m&&m.state===t.OPENED&&m.settings.hashTracking&&m.close()}function l(a,c){var d=b(document.body),e=this;e.settings=b.extend({},s,c),e.index=b[o].lookup.push(e)-1,e.state=t.CLOSED,e.$overlay=b(\".\"+p+\"-overlay\"),e.$overlay.length||(e.$overlay=b(\"\").addClass(p+\"-overlay \"+p+\"-is-\"+t.CLOSED).hide(),d.append(e.$overlay)),e.$bg=b(\".\"+p+\"-bg\").addClass(p+\"-is-\"+t.CLOSED),e.$modal=a,e.$modal.addClass(p+\"-is-initialized \"+p+\" \"+e.settings.modifier+\" \"+p+\"-is-\"+t.CLOSED),e.$wrapper=b(\"
\").addClass(p+\"-wrapper \"+e.settings.modifier+\" \"+p+\"-is-\"+t.CLOSED).hide().append(e.$modal),d.append(e.$wrapper),e.$wrapper.on(\"click.\"+p,\"[data-\"+o+'-action=\"close\"]',function(a){a.preventDefault(),e.close()}),e.$wrapper.on(\"click.\"+p,\"[data-\"+o+'-action=\"cancel\"]',function(a){a.preventDefault(),e.$modal.trigger(u.CANCELLATION),e.settings.closeOnCancel&&e.close(u.CANCELLATION)}),e.$wrapper.on(\"click.\"+p,\"[data-\"+o+'-action=\"confirm\"]',function(a){a.preventDefault(),e.$modal.trigger(u.CONFIRMATION),e.settings.closeOnConfirm&&e.close(u.CONFIRMATION)}),e.$wrapper.on(\"click.\"+p,function(a){var c=b(a.target);c.hasClass(p+\"-wrapper\")&&e.settings.closeOnOutsideClick&&e.close()})}var m,n,o=\"remodal\",p=a.REMODAL_GLOBALS&&a.REMODAL_GLOBALS.NAMESPACE||o,q=b.map([\"animationstart\",\"webkitAnimationStart\",\"MSAnimationStart\",\"oAnimationStart\"],function(a){return a+\".\"+p}).join(\" \"),r=b.map([\"animationend\",\"webkitAnimationEnd\",\"MSAnimationEnd\",\"oAnimationEnd\"],function(a){return a+\".\"+p}).join(\" \"),s=b.extend({hashTracking:!0,closeOnConfirm:!0,closeOnCancel:!0,closeOnEscape:!0,closeOnOutsideClick:!0,modifier:\"\"},a.REMODAL_GLOBALS&&a.REMODAL_GLOBALS.DEFAULTS),t={CLOSING:\"closing\",CLOSED:\"closed\",OPENING:\"opening\",OPENED:\"opened\"},u={CONFIRMATION:\"confirmation\",CANCELLATION:\"cancellation\"},v=function(){var a=document.createElement(\"div\").style;return void 0!==a.animationName||void 0!==a.WebkitAnimationName||void 0!==a.MozAnimationName||void 0!==a.msAnimationName||void 0!==a.OAnimationName}();l.prototype.open=function(){var a,c=this;c.state!==t.OPENING&&c.state!==t.CLOSING&&(a=c.$modal.attr(\"data-\"+o+\"-id\"),a&&c.settings.hashTracking&&(n=b(window).scrollTop(),location.hash=a),m&&m!==c&&i(m),m=c,e(),c.$bg.addClass(c.settings.modifier),c.$overlay.addClass(c.settings.modifier).show(),c.$wrapper.show().scrollTop(0),h(function(){g(c,t.OPENING)},function(){g(c,t.OPENED)},c))},l.prototype.close=function(a){var c=this;c.state!==t.OPENING&&c.state!==t.CLOSING&&(c.settings.hashTracking&&c.$modal.attr(\"data-\"+o+\"-id\")===location.hash.substr(1)&&(location.hash=\"\",b(window).scrollTop(n)),h(function(){g(c,t.CLOSING,!1,a)},function(){c.$bg.removeClass(c.settings.modifier),c.$overlay.removeClass(c.settings.modifier).hide(),c.$wrapper.hide(),f(),g(c,t.CLOSED,!1,a)},c))},l.prototype.getState=function(){return this.state},l.prototype.destroy=function(){var a,c=b[o].lookup;i(this),this.$wrapper.remove(),delete c[this.index],a=b.grep(c,function(a){return!!a}).length,0===a&&(this.$overlay.remove(),this.$bg.removeClass(p+\"-is-\"+t.CLOSING+\" \"+p+\"-is-\"+t.OPENING+\" \"+p+\"-is-\"+t.CLOSED+\" \"+p+\"-is-\"+t.OPENED))},b[o]={lookup:[]},b.fn[o]=function(a){var c,d;return this.each(function(e,f){d=b(f),null==d.data(o)?(c=new l(d,a),d.data(o,c.index),c.settings.hashTracking&&d.attr(\"data-\"+o+\"-id\")===location.hash.substr(1)&&c.open()):c=b[o].lookup[d.data(o)]}),c},b(document).ready(function(){b(document).on(\"click\",\"[data-\"+o+\"-target]\",function(a){a.preventDefault();var c=a.currentTarget,d=c.getAttribute(\"data-\"+o+\"-target\"),e=b(\"[data-\"+o+\"-id=\"+d+\"]\");b[o].lookup[e.data(o)].open()}),b(document).find(\".\"+p).each(function(a,c){var d=b(c),e=d.data(o+\"-options\");e?(\"string\"==typeof e||e instanceof String)&&(e=j(e)):e={},d[o](e)}),b(document).on(\"keyup.\"+p,function(a){m&&m.settings.closeOnEscape&&m.state===t.OPENED&&27===a.keyCode&&m.close()}),b(window).on(\"hashchange.\"+p,k)})});","/*\r\n\r\n scrollup v2.1.1\r\n Author: Mark Goodyear - http://markgoodyear.com\r\n Git: https://github.com/markgoodyear/scrollup\r\n\r\n Copyright 2013 Mark Goodyear.\r\n Licensed under the MIT license\r\n http://www.opensource.org/licenses/mit-license.php\r\n\r\n Twitter: @markgdyr\r\n\r\n */\r\n(function($, window, document) {\r\n\r\n // Main function\r\n $.fn.scrollUp = function (options) {\r\n // Ensure that only one scrollUp exists\r\n if ( ! $.data( document.body, 'scrollUp' ) ) {\r\n $.data( document.body, 'scrollUp', true );\r\n $.fn.scrollUp.init(options);\r\n }\r\n };\r\n\r\n // Init\r\n $.fn.scrollUp.init = function(options) {\r\n // Apply any options to the settings, override the defaults\r\n var o = $.fn.scrollUp.settings = $.extend({}, $.fn.scrollUp.defaults, options),\r\n\r\n // Set scrollTitle\r\n scrollTitle = (o.scrollTitle) ? o.scrollTitle : o.scrollText,\r\n\r\n // Create element\r\n $self = $('
', {\r\n id: o.scrollName,\r\n href: '#top',\r\n title: scrollTitle\r\n }).appendTo('body');\r\n\r\n // If not using an image display text\r\n if (!o.scrollImg) {\r\n $self.html(o.scrollText);\r\n }\r\n\r\n // Minimum CSS to make the magic happen\r\n $self.css({\r\n display: 'none',\r\n position: 'fixed',\r\n zIndex: o.zIndex\r\n });\r\n\r\n // Active point overlay\r\n if (o.activeOverlay) {\r\n $('
', { id: o.scrollName + '-active' }).css({ position: 'absolute', 'top': o.scrollDistance + 'px', width: '100%', borderTop: '1px dotted' + o.activeOverlay, zIndex: o.zIndex }).appendTo('body');\r\n }\r\n\r\n // Scroll function\r\n scrollEvent = $(window).scroll(function() {\r\n // If from top or bottom\r\n if (o.scrollFrom === 'top') {\r\n scrollDis = o.scrollDistance;\r\n } else {\r\n scrollDis = $(document).height() - $(window).height() - o.scrollDistance;\r\n }\r\n\r\n // Switch animation type\r\n switch (o.animation) {\r\n case 'fade':\r\n $( ($(window).scrollTop() > scrollDis) ? $self.fadeIn(o.animationInSpeed) : $self.fadeOut(o.animationOutSpeed) );\r\n break;\r\n case 'slide':\r\n $( ($(window).scrollTop() > scrollDis) ? $self.slideDown(o.animationInSpeed) : $self.slideUp(o.animationOutSpeed) );\r\n break;\r\n default:\r\n $( ($(window).scrollTop() > scrollDis) ? $self.show(0) : $self.hide(0) );\r\n }\r\n });\r\n\r\n // To the top\r\n $self.click(function(e) {\r\n e.preventDefault();\r\n $('html, body').animate({\r\n scrollTop:0\r\n }, o.scrollSpeed, o.easingType);\r\n });\r\n };\r\n\r\n // Defaults\r\n $.fn.scrollUp.defaults = {\r\n scrollName: 'scrollUp', // Element ID\r\n scrollDistance: 300, // Distance from top/bottom before showing element (px)\r\n scrollFrom: 'top', // 'top' or 'bottom'\r\n scrollSpeed: 300, // Speed back to top (ms)\r\n easingType: 'linear', // Scroll to top easing (see http://easings.net/)\r\n animation: 'fade', // Fade, slide, none\r\n animationInSpeed: 200, // Animation in speed (ms)\r\n animationOutSpeed: 200, // Animation out speed (ms)\r\n scrollText: 'Scroll to top', // Text for element, can contain HTML\r\n scrollTitle: false, // Set a custom
title if required. Defaults to scrollText\r\n scrollImg: false, // Set true to use image\r\n activeOverlay: false, // Set CSS color to display scrollUp active point, e.g '#00FFFF'\r\n zIndex: 2147483647 // Z-Index for the overlay\r\n };\r\n\r\n // Destroy scrollUp plugin and clean all modifications to the DOM\r\n $.fn.scrollUp.destroy = function (scrollEvent){\r\n $.removeData( document.body, 'scrollUp' );\r\n $( '#' + $.fn.scrollUp.settings.scrollName ).remove();\r\n $( '#' + $.fn.scrollUp.settings.scrollName + '-active' ).remove();\r\n\r\n // If 1.7 or above use the new .off()\r\n if ($.fn.jquery.split('.')[1] >= 7) {\r\n $(window).off( 'scroll', scrollEvent );\r\n\r\n // Else use the old .unbind()\r\n } else {\r\n $(window).unbind( 'scroll', scrollEvent );\r\n }\r\n };\r\n\r\n $.scrollUp = $.fn.scrollUp;\r\n\r\n})(jQuery, window, document);\r\n","/**\r\n* jquery-match-height 0.7.0 by @liabru\r\n* http://brm.io/jquery-match-height/\r\n* License: MIT\r\n*/\r\n\r\n;(function(factory) { // eslint-disable-line no-extra-semi\r\n 'use strict';\r\n if (typeof define === 'function' && define.amd) {\r\n // AMD\r\n define(['jquery'], factory);\r\n } else if (typeof module !== 'undefined' && module.exports) {\r\n // CommonJS\r\n module.exports = factory(require('jquery'));\r\n } else {\r\n // Global\r\n factory(jQuery);\r\n }\r\n})(function($) {\r\n /*\r\n * internal\r\n */\r\n\r\n var _previousResizeWidth = -1,\r\n _updateTimeout = -1;\r\n\r\n /*\r\n * _parse\r\n * value parse utility function\r\n */\r\n\r\n var _parse = function(value) {\r\n // parse value and convert NaN to 0\r\n return parseFloat(value) || 0;\r\n };\r\n\r\n /*\r\n * _rows\r\n * utility function returns array of jQuery selections representing each row\r\n * (as displayed after float wrapping applied by browser)\r\n */\r\n\r\n var _rows = function(elements) {\r\n var tolerance = 1,\r\n $elements = $(elements),\r\n lastTop = null,\r\n rows = [];\r\n\r\n // group elements by their top position\r\n $elements.each(function(){\r\n var $that = $(this),\r\n top = $that.offset().top - _parse($that.css('margin-top')),\r\n lastRow = rows.length > 0 ? rows[rows.length - 1] : null;\r\n\r\n if (lastRow === null) {\r\n // first item on the row, so just push it\r\n rows.push($that);\r\n } else {\r\n // if the row top is the same, add to the row group\r\n if (Math.floor(Math.abs(lastTop - top)) <= tolerance) {\r\n rows[rows.length - 1] = lastRow.add($that);\r\n } else {\r\n // otherwise start a new row group\r\n rows.push($that);\r\n }\r\n }\r\n\r\n // keep track of the last row top\r\n lastTop = top;\r\n });\r\n\r\n return rows;\r\n };\r\n\r\n /*\r\n * _parseOptions\r\n * handle plugin options\r\n */\r\n\r\n var _parseOptions = function(options) {\r\n var opts = {\r\n byRow: true,\r\n property: 'height',\r\n target: null,\r\n remove: false\r\n };\r\n\r\n if (typeof options === 'object') {\r\n return $.extend(opts, options);\r\n }\r\n\r\n if (typeof options === 'boolean') {\r\n opts.byRow = options;\r\n } else if (options === 'remove') {\r\n opts.remove = true;\r\n }\r\n\r\n return opts;\r\n };\r\n\r\n /*\r\n * matchHeight\r\n * plugin definition\r\n */\r\n\r\n var matchHeight = $.fn.matchHeight = function(options) {\r\n var opts = _parseOptions(options);\r\n\r\n // handle remove\r\n if (opts.remove) {\r\n var that = this;\r\n\r\n // remove fixed height from all selected elements\r\n this.css(opts.property, '');\r\n\r\n // remove selected elements from all groups\r\n $.each(matchHeight._groups, function(key, group) {\r\n group.elements = group.elements.not(that);\r\n });\r\n\r\n // TODO: cleanup empty groups\r\n\r\n return this;\r\n }\r\n\r\n if (this.length <= 1 && !opts.target) {\r\n return this;\r\n }\r\n\r\n // keep track of this group so we can re-apply later on load and resize events\r\n matchHeight._groups.push({\r\n elements: this,\r\n options: opts\r\n });\r\n\r\n // match each element's height to the tallest element in the selection\r\n matchHeight._apply(this, opts);\r\n\r\n return this;\r\n };\r\n\r\n /*\r\n * plugin global options\r\n */\r\n\r\n matchHeight.version = '0.7.0';\r\n matchHeight._groups = [];\r\n matchHeight._throttle = 80;\r\n matchHeight._maintainScroll = false;\r\n matchHeight._beforeUpdate = null;\r\n matchHeight._afterUpdate = null;\r\n matchHeight._rows = _rows;\r\n matchHeight._parse = _parse;\r\n matchHeight._parseOptions = _parseOptions;\r\n\r\n /*\r\n * matchHeight._apply\r\n * apply matchHeight to given elements\r\n */\r\n\r\n matchHeight._apply = function(elements, options) {\r\n var opts = _parseOptions(options),\r\n $elements = $(elements),\r\n rows = [$elements];\r\n\r\n // take note of scroll position\r\n var scrollTop = $(window).scrollTop(),\r\n htmlHeight = $('html').outerHeight(true);\r\n\r\n // get hidden parents\r\n var $hiddenParents = $elements.parents().filter(':hidden');\r\n\r\n // cache the original inline style\r\n $hiddenParents.each(function() {\r\n var $that = $(this);\r\n $that.data('style-cache', $that.attr('style'));\r\n });\r\n\r\n // temporarily must force hidden parents visible\r\n $hiddenParents.css('display', 'block');\r\n\r\n // get rows if using byRow, otherwise assume one row\r\n if (opts.byRow && !opts.target) {\r\n\r\n // must first force an arbitrary equal height so floating elements break evenly\r\n $elements.each(function() {\r\n var $that = $(this),\r\n display = $that.css('display');\r\n\r\n // temporarily force a usable display value\r\n if (display !== 'inline-block' && display !== 'flex' && display !== 'inline-flex') {\r\n display = 'block';\r\n }\r\n\r\n // cache the original inline style\r\n $that.data('style-cache', $that.attr('style'));\r\n\r\n $that.css({\r\n 'display': display,\r\n 'padding-top': '0',\r\n 'padding-bottom': '0',\r\n 'margin-top': '0',\r\n 'margin-bottom': '0',\r\n 'border-top-width': '0',\r\n 'border-bottom-width': '0',\r\n 'height': '100px',\r\n 'overflow': 'hidden'\r\n });\r\n });\r\n\r\n // get the array of rows (based on element top position)\r\n rows = _rows($elements);\r\n\r\n // revert original inline styles\r\n $elements.each(function() {\r\n var $that = $(this);\r\n $that.attr('style', $that.data('style-cache') || '');\r\n });\r\n }\r\n\r\n $.each(rows, function(key, row) {\r\n var $row = $(row),\r\n targetHeight = 0;\r\n\r\n if (!opts.target) {\r\n // skip apply to rows with only one item\r\n if (opts.byRow && $row.length <= 1) {\r\n $row.css(opts.property, '');\r\n return;\r\n }\r\n\r\n // iterate the row and find the max height\r\n $row.each(function(){\r\n var $that = $(this),\r\n style = $that.attr('style'),\r\n display = $that.css('display');\r\n\r\n // temporarily force a usable display value\r\n if (display !== 'inline-block' && display !== 'flex' && display !== 'inline-flex') {\r\n display = 'block';\r\n }\r\n\r\n // ensure we get the correct actual height (and not a previously set height value)\r\n var css = { 'display': display };\r\n css[opts.property] = '';\r\n $that.css(css);\r\n\r\n // find the max height (including padding, but not margin)\r\n if ($that.outerHeight(false) > targetHeight) {\r\n targetHeight = $that.outerHeight(false);\r\n }\r\n\r\n // revert styles\r\n if (style) {\r\n $that.attr('style', style);\r\n } else {\r\n $that.css('display', '');\r\n }\r\n });\r\n } else {\r\n // if target set, use the height of the target element\r\n targetHeight = opts.target.outerHeight(false);\r\n }\r\n\r\n // iterate the row and apply the height to all elements\r\n $row.each(function(){\r\n var $that = $(this),\r\n verticalPadding = 0;\r\n\r\n // don't apply to a target\r\n if (opts.target && $that.is(opts.target)) {\r\n return;\r\n }\r\n\r\n // handle padding and border correctly (required when not using border-box)\r\n if ($that.css('box-sizing') !== 'border-box') {\r\n verticalPadding += _parse($that.css('border-top-width')) + _parse($that.css('border-bottom-width'));\r\n verticalPadding += _parse($that.css('padding-top')) + _parse($that.css('padding-bottom'));\r\n }\r\n\r\n // set the height (accounting for padding and border)\r\n $that.css(opts.property, (targetHeight - verticalPadding) + 'px');\r\n });\r\n });\r\n\r\n // revert hidden parents\r\n $hiddenParents.each(function() {\r\n var $that = $(this);\r\n $that.attr('style', $that.data('style-cache') || null);\r\n });\r\n\r\n // restore scroll position if enabled\r\n if (matchHeight._maintainScroll) {\r\n $(window).scrollTop((scrollTop / htmlHeight) * $('html').outerHeight(true));\r\n }\r\n\r\n return this;\r\n };\r\n\r\n /*\r\n * matchHeight._applyDataApi\r\n * applies matchHeight to all elements with a data-match-height attribute\r\n */\r\n\r\n matchHeight._applyDataApi = function() {\r\n var groups = {};\r\n\r\n // generate groups by their groupId set by elements using data-match-height\r\n $('[data-match-height], [data-mh]').each(function() {\r\n var $this = $(this),\r\n groupId = $this.attr('data-mh') || $this.attr('data-match-height');\r\n\r\n if (groupId in groups) {\r\n groups[groupId] = groups[groupId].add($this);\r\n } else {\r\n groups[groupId] = $this;\r\n }\r\n });\r\n\r\n // apply matchHeight to each group\r\n $.each(groups, function() {\r\n this.matchHeight(true);\r\n });\r\n };\r\n\r\n /*\r\n * matchHeight._update\r\n * updates matchHeight on all current groups with their correct options\r\n */\r\n\r\n var _update = function(event) {\r\n if (matchHeight._beforeUpdate) {\r\n matchHeight._beforeUpdate(event, matchHeight._groups);\r\n }\r\n\r\n $.each(matchHeight._groups, function() {\r\n matchHeight._apply(this.elements, this.options);\r\n });\r\n\r\n if (matchHeight._afterUpdate) {\r\n matchHeight._afterUpdate(event, matchHeight._groups);\r\n }\r\n };\r\n\r\n matchHeight._update = function(throttle, event) {\r\n // prevent update if fired from a resize event\r\n // where the viewport width hasn't actually changed\r\n // fixes an event looping bug in IE8\r\n if (event && event.type === 'resize') {\r\n var windowWidth = $(window).width();\r\n if (windowWidth === _previousResizeWidth) {\r\n return;\r\n }\r\n _previousResizeWidth = windowWidth;\r\n }\r\n\r\n // throttle updates\r\n if (!throttle) {\r\n _update(event);\r\n } else if (_updateTimeout === -1) {\r\n _updateTimeout = setTimeout(function() {\r\n _update(event);\r\n _updateTimeout = -1;\r\n }, matchHeight._throttle);\r\n }\r\n };\r\n\r\n /*\r\n * bind events\r\n */\r\n\r\n // apply on DOM ready event\r\n $(matchHeight._applyDataApi);\r\n\r\n // update heights on load and resize events\r\n $(window).bind('load', function(event) {\r\n matchHeight._update(false, event);\r\n });\r\n\r\n // throttled update heights on resize events\r\n $(window).bind('resize orientationchange', function(event) {\r\n matchHeight._update(true, event);\r\n });\r\n\r\n});\r\n","/*\r\n * Copyright (C) 2012 PrimeBox (info@primebox.co.uk)\r\n * \r\n * This work is licensed under the Creative Commons\r\n * Attribution 3.0 Unported License. To view a copy\r\n * of this license, visit\r\n * http://creativecommons.org/licenses/by/3.0/.\r\n * \r\n * Documentation available at:\r\n * http://www.primebox.co.uk/projects/cookie-bar/\r\n * \r\n * When using this software you use it at your own risk. We hold\r\n * no responsibility for any damage caused by using this plugin\r\n * or the documentation provided.\r\n */\r\n(function($){\r\n\t$.cookieBar = function(options,val){\r\n\t\tif(options=='cookies'){\r\n\t\t\tvar doReturn = 'cookies';\r\n\t\t}else if(options=='set'){\r\n\t\t\tvar doReturn = 'set';\r\n\t\t}else{\r\n\t\t\tvar doReturn = false;\r\n\t\t}\r\n\t\tvar defaults = {\r\n\t\t\tmessage: 'We use cookies to track usage and preferences.', //Message displayed on bar\r\n\t\t\tacceptButton: true, //Set to true to show accept/enable button\r\n\t\t\tacceptText: 'I Understand', //Text on accept/enable button\r\n\t\t\tacceptFunction: function(cookieValue){if(cookieValue!='enabled' && cookieValue!='accepted') window.location = window.location.href;}, //Function to run after accept\r\n\t\t\tdeclineButton: false, //Set to true to show decline/disable button\r\n\t\t\tdeclineText: 'Disable Cookies', //Text on decline/disable button\r\n\t\t\tdeclineFunction: function(cookieValue){if(cookieValue=='enabled' || cookieValue=='accepted') window.location = window.location.href;}, //Function to run after decline\r\n\t\t\tpolicyButton: false, //Set to true to show Privacy Policy button\r\n\t\t\tpolicyText: 'Privacy Policy', //Text on Privacy Policy button\r\n\t\t\tpolicyURL: '/privacy-policy/', //URL of Privacy Policy\r\n\t\t\tautoEnable: true, //Set to true for cookies to be accepted automatically. Banner still shows\r\n\t\t\tacceptOnContinue: false, //Set to true to accept cookies when visitor moves to another page\r\n\t\t\tacceptOnScroll: false, //Set to true to accept cookies when visitor scrolls X pixels up or down\r\n\t\t\tacceptAnyClick: false, //Set to true to accept cookies when visitor clicks anywhere on the page\r\n\t\t\texpireDays: 365, //Number of days for cookieBar cookie to be stored for\r\n\t\t\trenewOnVisit: false, //Renew the cookie upon revisit to website\r\n\t\t\tforceShow: false, //Force cookieBar to show regardless of user cookie preference\r\n\t\t\teffect: 'slide', //Options: slide, fade, hide\r\n\t\t\telement: 'body', //Element to append/prepend cookieBar to. Remember \".\" for class or \"#\" for id.\r\n\t\t\tappend: false, //Set to true for cookieBar HTML to be placed at base of website. Actual position may change according to CSS\r\n\t\t\tfixed: false, //Set to true to add the class \"fixed\" to the cookie bar. Default CSS should fix the position\r\n\t\t\tbottom: false, //Force CSS when fixed, so bar appears at bottom of website\r\n\t\t\tzindex: '', //Can be set in CSS, although some may prefer to set here\r\n\t\t\tdomain: String(window.location.hostname), //Location of privacy policy\r\n\t\t\treferrer: String(document.referrer) //Where visitor has come from\r\n\t\t};\r\n\t\tvar options = $.extend(defaults,options);\r\n\t\t\r\n\t\t//Sets expiration date for cookie\r\n\t\tvar expireDate = new Date();\r\n\t\texpireDate.setTime(expireDate.getTime()+(options.expireDays*86400000));\r\n\t\texpireDate = expireDate.toGMTString();\r\n\t\t\r\n\t\tvar cookieEntry = 'cb-enabled={value}; expires='+expireDate+'; path=/';\r\n\t\t\r\n\t\t//Retrieves current cookie preference\r\n\t\tvar i,cookieValue='',aCookie,aCookies=document.cookie.split('; ');\r\n\t\tfor (i=0;i=0 && String(window.location.href).indexOf(options.policyURL)==-1 && doReturn!='cookies' && doReturn!='set' && cookieValue!='accepted' && cookieValue!='declined'){\r\n\t\t\t\tdoReturn = 'set';\r\n\t\t\t\tval = 'accepted';\r\n\t\t\t}\r\n\t\t}\r\n\t\tif(doReturn=='cookies'){\r\n\t\t\t//Returns true if cookies are enabled, false otherwise\r\n\t\t\tif(cookieValue=='enabled' || cookieValue=='accepted'){\r\n\t\t\t\treturn true;\r\n\t\t\t}else{\r\n\t\t\t\treturn false;\r\n\t\t\t}\r\n\t\t}else if(doReturn=='set' && (val=='accepted' || val=='declined')){\r\n\t\t\t//Sets value of cookie to 'accepted' or 'declined'\r\n\t\t\tdocument.cookie = cookieEntry.replace('{value}',val);\r\n\t\t\tif(val=='accepted'){\r\n\t\t\t\treturn true;\r\n\t\t\t}else{\r\n\t\t\t\treturn false;\r\n\t\t\t}\r\n\t\t}else{\r\n\t\t\t//Sets up enable/accept button if required\r\n\t\t\tvar message = options.message.replace('{policy_url}',options.policyURL);\r\n\t\t\t\r\n\t\t\tif(options.acceptButton){\r\n\t\t\t\tvar acceptButton = ''+options.acceptText+'';\r\n\t\t\t}else{\r\n\t\t\t\tvar acceptButton = '';\r\n\t\t\t}\r\n\t\t\t//Sets up disable/decline button if required\r\n\t\t\tif(options.declineButton){\r\n\t\t\t\tvar declineButton = ''+options.declineText+'';\r\n\t\t\t}else{\r\n\t\t\t\tvar declineButton = '';\r\n\t\t\t}\r\n\t\t\t//Sets up privacy policy button if required\r\n\t\t\tif(options.policyButton){\r\n\t\t\t\tvar policyButton = ''+options.policyText+'';\r\n\t\t\t}else{\r\n\t\t\t\tvar policyButton = '';\r\n\t\t\t}\r\n\t\t\t//Whether to add \"fixed\" class to cookie bar\r\n\t\t\tif(options.fixed){\r\n\t\t\t\tif(options.bottom){\r\n\t\t\t\t\tvar fixed = ' class=\"fixed bottom\"';\r\n\t\t\t\t}else{\r\n\t\t\t\t\tvar fixed = ' class=\"fixed\"';\r\n\t\t\t\t}\r\n\t\t\t}else{\r\n\t\t\t\tvar fixed = '';\r\n\t\t\t}\r\n\t\t\tif(options.zindex!=''){\r\n\t\t\t\tvar zindex = ' style=\"z-index:'+options.zindex+';\"';\r\n\t\t\t}else{\r\n\t\t\t\tvar zindex = '';\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\t//Displays the cookie bar if arguments met\r\n\t\t\tif(options.forceShow || cookieValue=='enabled' || cookieValue==''){\r\n\t\t\t\tif(options.append){\r\n\t\t\t\t\t$(options.element).append(''+message+acceptButton+declineButton+policyButton+'
');\r\n\t\t\t\t}else{\r\n\t\t\t\t\t$(options.element).prepend(''+message+acceptButton+declineButton+policyButton+'
');\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tvar removeBar = function(func){\r\n\t\t\t\tif(options.acceptOnScroll) $(document).off('scroll');\r\n\t\t\t\tif(typeof(func)==='function') func(cookieValue);\r\n\t\t\t\tif(options.effect=='slide'){\r\n\t\t\t\t\t$('#cookie-bar').slideUp(300,function(){$('#cookie-bar').remove();});\r\n\t\t\t\t}else if(options.effect=='fade'){\r\n\t\t\t\t\t$('#cookie-bar').fadeOut(300,function(){$('#cookie-bar').remove();});\r\n\t\t\t\t}else{\r\n\t\t\t\t\t$('#cookie-bar').hide(0,function(){$('#cookie-bar').remove();});\r\n\t\t\t\t}\r\n\t\t\t\t$(document).unbind('click',anyClick);\r\n\t\t\t};\r\n\t\t\tvar cookieAccept = function(){\r\n\t\t\t\tdocument.cookie = cookieEntry.replace('{value}','accepted');\r\n\t\t\t\tremoveBar(options.acceptFunction);\r\n\t\t\t};\r\n\t\t\tvar cookieDecline = function(){\r\n\t\t\t\tvar deleteDate = new Date();\r\n\t\t\t\tdeleteDate.setTime(deleteDate.getTime()-(864000000));\r\n\t\t\t\tdeleteDate = deleteDate.toGMTString();\r\n\t\t\t\taCookies=document.cookie.split('; ');\r\n\t\t\t\tfor (i=0;i=0){\r\n\t\t\t\t\t\tdocument.cookie = aCookie[0]+'=0; expires='+deleteDate+'; domain='+options.domain.replace('www','')+'; path=/';\r\n\t\t\t\t\t}else{\r\n\t\t\t\t\t\tdocument.cookie = aCookie[0]+'=0; expires='+deleteDate+'; path=/';\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\tdocument.cookie = cookieEntry.replace('{value}','declined');\r\n\t\t\t\tremoveBar(options.declineFunction);\r\n\t\t\t};\r\n\t\t\tvar anyClick = function(e){\r\n\t\t\t\tif(!$(e.target).hasClass('cb-policy')) cookieAccept();\r\n\t\t\t};\r\n\t\t\t\r\n\t\t\t$('#cookie-bar .cb-enable').click(function(){cookieAccept();return false;});\r\n\t\t\t$('#cookie-bar .cb-disable').click(function(){cookieDecline();return false;});\r\n\t\t\tif(options.acceptOnScroll){\r\n\t\t\t\tvar scrollStart = $(document).scrollTop(),scrollNew,scrollDiff;\r\n\t\t\t\t$(document).on('scroll',function(){\r\n\t\t\t\t\tscrollNew = $(document).scrollTop();\r\n\t\t\t\t\tif(scrollNew>scrollStart){\r\n\t\t\t\t\t\tscrollDiff = scrollNew - scrollStart;\r\n\t\t\t\t\t}else{\r\n\t\t\t\t\t\tscrollDiff = scrollStart - scrollNew;\r\n\t\t\t\t\t}\r\n\t\t\t\t\tif(scrollDiff>=Math.round(options.acceptOnScroll)) cookieAccept();\r\n\t\t\t\t});\r\n\t\t\t}\r\n\t\t\tif(options.acceptAnyClick){\r\n\t\t\t\t$(document).bind('click',anyClick);\r\n\t\t\t}\r\n\t\t}\r\n\t};\r\n})(jQuery);"]}