PageSourceSearch

https://www.postgaarden.dk/typo3temp/compressor/merged-99ac310d719…c69f5c7a442fbf4698127c2b409d1.js?1774941824

js postgaarden.dk collected 2026-09-26 17:11:06 UTC 1,558,859 bytes, 41,771 lines download raw bytes

vendor: 2,276 bytes, lines 1-3
1
2/*! jQuery v2.2.1 | (c) jQuery Foundation | jquery.org/license */
3!function(a,b){"object"==typeof module&&"object"==typeof module.exports?module.exports=a.document?b(a,!0):function(a){if(!a.document)throw new Error("jQuery requires a window with a document");return b(a)}:b(a)}("undefined"!=typeof window?window:this,function(a,b){var c=[],d=a.document,e=c.slice,f=c.concat,g=c.push,h=c.indexOf,i={},j=i.toString,k=i.hasOwnProperty,l={},m="2.2.1",n=function(a,b){return new n.fn.init(a,b)},o=/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,p=/^-ms-/,q=/-([\da-z])/gi,r=function(a,b){return b.toUpperCase()};n.fn=n.prototype={jquery:m,constructor:n,selector:"",length:0,toArray:function(){return e.call(this)},get:function(a){return null!=a?0>a?this[a+this.length]:this[a]:e.call(this)},pushStack:function(a){var b=n.merge(this.constructor(),a);return b.prevObject=this,b.context=this.context,b},each:function(a){return n.each(this,a)},map:function(a){return this.pushStack(n.map(this,function(b,c){return a.call(b,c,b)}))},slice:function(){return this.pushStack(e.apply(this,arguments))},first:function(){return this.eq(0)},last:function(){return this.eq(-1)},eq:function(a){var b=this.length,c=+a+(0>a?b:0);return this.pushStack(c>=0&&b>c?[this[c]]:[])},end:function(){return this.prevObject||this.constructor()},push:g,sort:c.sort,splice:c.splice},n.extend=n.fn.extend=function(){var a,b,c,d,e,f,g=arguments[0]||{},h=1,i=arguments.length,j=!1;for("boolean"==typeof g&&(j=g,g=arguments[h]||{},h++),"object"==typeof g||n.isFunction(g)||(g={}),h===i&&(g=this,h--);i>h;h++)if(null!=(a=arguments[h]))for(b in a)c=g[b],d=a[b],g!==d&&(j&&d&&(n.isPlainObject(d)||(e=n.isArray(d)))?(e?(e=!1,f=c&&n.isArray(c)?c:[]):f=c&&n.isPlainObject(c)?c:{},g[b]=n.extend(j,f,d)):void 0!==d&&(g[b]=d));return g},n.extend({expando:"jQuery"+(m+Math.random()).replace(/\D/g,""),isReady:!0,error:function(a){throw new Error(a)},noop:function(){},isFunction:function(a){return"function"===n.type(a)},isArray:Array.isArray,isWindow:function(a){return null!=a&&a===a.window},isNumeric:function(a){var b=a&&a.toString();return!n.isArray(a)&&b-parseFloat(b)+1>=0},isPlainObject:function(a){return"object"!==n.type(a)||a.nodeType||n.isWindow(a)?!1:a.constructor&&!k.call(a.constructor.prototype,"isPrototypeOf")?!1:!0
vendor: 5,019 bytes, line 3
3},isEmptyObject:function(a){var b;for(b in a)return!1;return!0},type:function(a){return null==a?a+"":"object"==typeof a||"function"==typeof a?i[j.call(a)]||"object":typeof a},globalEval:function(a){var b,c=eval;a=n.trim(a),a&&(1===a.indexOf("use strict")?(b=d.createElement("script"),b.text=a,d.head.appendChild(b).parentNode.removeChild(b)):c(a))},camelCase:function(a){return a.replace(p,"ms-").replace(q,r)},nodeName:function(a,b){return a.nodeName&&a.nodeName.toLowerCase()===b.toLowerCase()},each:function(a,b){var c,d=0;if(s(a)){for(c=a.length;c>d;d++)if(b.call(a[d],d,a[d])===!1)break}else for(d in a)if(b.call(a[d],d,a[d])===!1)break;return a},trim:function(a){return null==a?"":(a+"").replace(o,"")},makeArray:function(a,b){var c=b||[];return null!=a&&(s(Object(a))?n.merge(c,"string"==typeof a?[a]:a):g.call(c,a)),c},inArray:function(a,b,c){return null==b?-1:h.call(b,a,c)},merge:function(a,b){for(var c=+b.length,d=0,e=a.length;c>d;d++)a[e++]=b[d];return a.length=e,a},grep:function(a,b,c){for(var d,e=[],f=0,g=a.length,h=!c;g>f;f++)d=!b(a[f],f),d!==h&&e.push(a[f]);return e},map:function(a,b,c){var d,e,g=0,h=[];if(s(a))for(d=a.length;d>g;g++)e=b(a[g],g,c),null!=e&&h.push(e);else for(g in a)e=b(a[g],g,c),null!=e&&h.push(e);return f.apply([],h)},guid:1,proxy:function(a,b){var c,d,f;return"string"==typeof b&&(c=a[b],b=a,a=c),n.isFunction(a)?(d=e.call(arguments,2),f=function(){return a.apply(b||this,d.concat(e.call(arguments)))},f.guid=a.guid=a.guid||n.guid++,f):void 0},now:Date.now,support:l}),"function"==typeof Symbol&&(n.fn[Symbol.iterator]=c[Symbol.iterator]),n.each("Boolean Number String Function Array Date RegExp Object Error Symbol".split(" "),function(a,b){i["[object "+b+"]"]=b.toLowerCase()});function s(a){var b=!!a&&"length"in a&&a.length,c=n.type(a);return"function"===c||n.isWindow(a)?!1:"array"===c||0===b||"number"==typeof b&&b>0&&b-1 in a}var t=function(a){var b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u="sizzle"+1*new Date,v=a.document,w=0,x=0,y=ga(),z=ga(),A=ga(),B=function(a,b){return a===b&&(l=!0),0},C=1<<31,D={}.hasOwnProperty,E=[],F=E.pop,G=E.push,H=E.push,I=E.slice,J=function(a,b){for(var c=0,d=a.length;d>c;c++)if(a[c]===b)return c;return-1},K="checked|selected|async|autofocus|autoplay|controls|defer|disabled|hidden|ismap|loop|multiple|open|readonly|required|scoped",L="[\\x20\\t\\r\\n\\f]",M="(?:\\\\.|[\\w-]|[^\\x00-\\xa0])+",N="\\["+L+"*("+M+")(?:"+L+"*([*^$|!~]?=)"+L+"*(?:'((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\"|("+M+"))|)"+L+"*\\]",O=":("+M+")(?:\\((('((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\")|((?:\\\\.|[^\\\\()[\\]]|"+N+")*)|.*)\\)|)",P=new RegExp(L+"+","g"),Q=new RegExp("^"+L+"+|((?:^|[^\\\\])(?:\\\\.)*)"+L+"+$","g"),R=new RegExp("^"+L+"*,"+L+"*"),S=new RegExp("^"+L+"*([>+~]|"+L+")"+L+"*"),T=new RegExp("="+L+"*([^\\]'\"]*?)"+L+"*\\]","g"),U=new RegExp(O),V=new RegExp("^"+M+"$"),W={ID:new RegExp("^#("+M+")"),CLASS:new RegExp("^\\.("+M+")"),TAG:new RegExp("^("+M+"|[*])"),ATTR:new RegExp("^"+N),PSEUDO:new RegExp("^"+O),CHILD:new RegExp("^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\("+L+"*(even|odd|(([+-]|)(\\d*)n|)"+L+"*(?:([+-]|)"+L+"*(\\d+)|))"+L+"*\\)|)","i"),bool:new RegExp("^(?:"+K+")$","i"),needsContext:new RegExp("^"+L+"*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\("+L+"*((?:-\\d)?\\d*)"+L+"*\\)|)(?=[^-]|$)","i")},X=/^(?:input|select|textarea|button)$/i,Y=/^h\d$/i,Z=/^[^{]+\{\s*\[native \w/,$=/^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/,_=/[+~]/,aa=/'|\\/g,ba=new RegExp("\\\\([\\da-f]{1,6}"+L+"?|("+L+")|.)","ig"),ca=function(a,b,c){var d="0x"+b-65536;return d!==d||c?b:0>d?String.fromCharCode(d+65536):String.fromCharCode(d>>10|55296,1023&d|56320)},da=function(){m()};try{H.apply(E=I.call(v.childNodes),v.childNodes),E[v.childNodes.length].nodeType}catch(ea){H={apply:E.length?function(a,b){G.apply(a,I.call(b))}:function(a,b){var c=a.length,d=0;while(a[c++]=b[d++]);a.length=c-1}}}function fa(a,b,d,e){var f,h,j,k,l,o,r,s,w=b&&b.ownerDocument,x=b?b.nodeType:9;if(d=d||[],"string"!=typeof a||!a||1!==x&&9!==x&&11!==x)return d;if(!e&&((b?b.ownerDocument||b:v)!==n&&m(b),b=b||n,p)){if(11!==x&&(o=$.exec(a)))if(f=o[1]){if(9===x){if(!(j=b.getElementById(f)))return d;if(j.id===f)return d.push(j),d}else if(w&&(j=w.getElementById(f))&&t(b,j)&&j.id===f)return d.push(j),d}else{if(o[2])return H.apply(d,b.getElementsByTagName(a)),d;if((f=o[3])&&c.getElementsByClassName&&b.getElementsByClassName)return H.apply(d,b.getElementsByClassName(f)),d}if(c.qsa&&!A[a+" "]&&(!q||!q.test(a))){if(1!==x)w=b,s=a;else if("object"!==b.nodeName.toLowerCase()){(k=b.getAttribute("id"))?k=k.replace(aa,"\\$&"):b.setAttribute("id",k=u),r=g(a),h=r.length,l=V.test(k)?"#"+k:"[id='"+k+"']";while(h--)r[h]=l+" "+qa(r[h]);s=r.join(","),w=_.test(a)&&oa(b.parentNode)||b}if(s)try{return H.apply(d,w.querySelectorAll(s)),d}catch(y){}finally{k===u&&b.removeAttribute("id")}}}return i(a.replace(Q,"$1"),b,d,e)}function ga(){var a=[];function b(c,e){return a.push(c+" ")>d.cacheLength&&delete b[a.shift()],b[c+" "]=e}return b}function ha(a){return a[u]=!0,a}
vendor: 13,851 bytes, line 3
3function ia(a){var b=n.createElement("div");try{return!!a(b)}catch(c){return!1}finally{b.parentNode&&b.parentNode.removeChild(b),b=null}}function ja(a,b){var c=a.split("|"),e=c.length;while(e--)d.attrHandle[c[e]]=b}function ka(a,b){var c=b&&a,d=c&&1===a.nodeType&&1===b.nodeType&&(~b.sourceIndex||C)-(~a.sourceIndex||C);if(d)return d;if(c)while(c=c.nextSibling)if(c===b)return-1;return a?1:-1}function la(a){return function(b){var c=b.nodeName.toLowerCase();return"input"===c&&b.type===a}}function ma(a){return function(b){var c=b.nodeName.toLowerCase();return("input"===c||"button"===c)&&b.type===a}}function na(a){return ha(function(b){return b=+b,ha(function(c,d){var e,f=a([],c.length,b),g=f.length;while(g--)c[e=f[g]]&&(c[e]=!(d[e]=c[e]))})})}function oa(a){return a&&"undefined"!=typeof a.getElementsByTagName&&a}c=fa.support={},f=fa.isXML=function(a){var b=a&&(a.ownerDocument||a).documentElement;return b?"HTML"!==b.nodeName:!1},m=fa.setDocument=function(a){var b,e,g=a?a.ownerDocument||a:v;return g!==n&&9===g.nodeType&&g.documentElement?(n=g,o=n.documentElement,p=!f(n),(e=n.defaultView)&&e.top!==e&&(e.addEventListener?e.addEventListener("unload",da,!1):e.attachEvent&&e.attachEvent("onunload",da)),c.attributes=ia(function(a){return a.className="i",!a.getAttribute("className")}),c.getElementsByTagName=ia(function(a){return a.appendChild(n.createComment("")),!a.getElementsByTagName("*").length}),c.getElementsByClassName=Z.test(n.getElementsByClassName),c.getById=ia(function(a){return o.appendChild(a).id=u,!n.getElementsByName||!n.getElementsByName(u).length}),c.getById?(d.find.ID=function(a,b){if("undefined"!=typeof b.getElementById&&p){var c=b.getElementById(a);return c?[c]:[]}},d.filter.ID=function(a){var b=a.replace(ba,ca);return function(a){return a.getAttribute("id")===b}}):(delete d.find.ID,d.filter.ID=function(a){var b=a.replace(ba,ca);return function(a){var c="undefined"!=typeof a.getAttributeNode&&a.getAttributeNode("id");return c&&c.value===b}}),d.find.TAG=c.getElementsByTagName?function(a,b){return"undefined"!=typeof b.getElementsByTagName?b.getElementsByTagName(a):c.qsa?b.querySelectorAll(a):void 0}:function(a,b){var c,d=[],e=0,f=b.getElementsByTagName(a);if("*"===a){while(c=f[e++])1===c.nodeType&&d.push(c);return d}return f},d.find.CLASS=c.getElementsByClassName&&function(a,b){return"undefined"!=typeof b.getElementsByClassName&&p?b.getElementsByClassName(a):void 0},r=[],q=[],(c.qsa=Z.test(n.querySelectorAll))&&(ia(function(a){o.appendChild(a).innerHTML="<a id='"+u+"'></a><select id='"+u+"-\r\\' msallowcapture=''><option selected=''></option></select>",a.querySelectorAll("[msallowcapture^='']").length&&q.push("[*^$]="+L+"*(?:''|\"\")"),a.querySelectorAll("[selected]").length||q.push("\\["+L+"*(?:value|"+K+")"),a.querySelectorAll("[id~="+u+"-]").length||q.push("~="),a.querySelectorAll(":checked").length||q.push(":checked"),a.querySelectorAll("a#"+u+"+*").length||q.push(".#.+[+~]")}),ia(function(a){var b=n.createElement("input");b.setAttribute("type","hidden"),a.appendChild(b).setAttribute("name","D"),a.querySelectorAll("[name=d]").length&&q.push("name"+L+"*[*^$|!~]?="),a.querySelectorAll(":enabled").length||q.push(":enabled",":disabled"),a.querySelectorAll("*,:x"),q.push(",.*:")})),(c.matchesSelector=Z.test(s=o.matches||o.webkitMatchesSelector||o.mozMatchesSelector||o.oMatchesSelector||o.msMatchesSelector))&&ia(function(a){c.disconnectedMatch=s.call(a,"div"),s.call(a,"[s!='']:x"),r.push("!=",O)}),q=q.length&&new RegExp(q.join("|")),r=r.length&&new RegExp(r.join("|")),b=Z.test(o.compareDocumentPosition),t=b||Z.test(o.contains)?function(a,b){var c=9===a.nodeType?a.documentElement:a,d=b&&b.parentNode;return a===d||!(!d||1!==d.nodeType||!(c.contains?c.contains(d):a.compareDocumentPosition&&16&a.compareDocumentPosition(d)))}:function(a,b){if(b)while(b=b.parentNode)if(b===a)return!0;return!1},B=b?function(a,b){if(a===b)return l=!0,0;var d=!a.compareDocumentPosition-!b.compareDocumentPosition;return d?d:(d=(a.ownerDocument||a)===(b.ownerDocument||b)?a.compareDocumentPosition(b):1,1&d||!c.sortDetached&&b.compareDocumentPosition(a)===d?a===n||a.ownerDocument===v&&t(v,a)?-1:b===n||b.ownerDocument===v&&t(v,b)?1:k?J(k,a)-J(k,b):0:4&d?-1:1)}:function(a,b){if(a===b)return l=!0,0;var c,d=0,e=a.parentNode,f=b.parentNode,g=[a],h=[b];if(!e||!f)return a===n?-1:b===n?1:e?-1:f?1:k?J(k,a)-J(k,b):0;if(e===f)return ka(a,b);c=a;while(c=c.parentNode)g.unshift(c);c=b;while(c=c.parentNode)h.unshift(c);while(g[d]===h[d])d++;return d?ka(g[d],h[d]):g[d]===v?-1:h[d]===v?1:0},n):n},fa.matches=function(a,b){return fa(a,null,null,b)},fa.matchesSelector=function(a,b){if((a.ownerDocument||a)!==n&&m(a),b=b.replace(T,"='$1']"),c.matchesSelector&&p&&!A[b+" "]&&(!r||!r.test(b))&&(!q||!q.test(b)))try{var d=s.call(a,b);if(d||c.disconnectedMatch||a.document&&11!==a.document.nodeType)return d}catch(e){}return fa(b,n,null,[a]).length>0},fa.contains=function(a,b){return(a.ownerDocument||a)!==n&&m(a),t(a,b)},fa.attr=function(a,b){(a.ownerDocument||a)!==n&&m(a);var e=d.attrHandle[b.toLowerCase()],f=e&&D.call(d.attrHandle,b.toLowerCase())?e(a,b,!p):void 0;return void 0!==f?f:c.attributes||!p?a.getAttribute(b):(f=a.getAttributeNode(b))&&f.specified?f.value:null},fa.error=function(a){throw new Error("Syntax error, unrecognized expression: "+a)},fa.uniqueSort=function(a){var b,d=[],e=0,f=0;if(l=!c.detectDuplicates,k=!c.sortStable&&a.slice(0),a.sort(B),l){while(b=a[f++])b===a[f]&&(e=d.push(f));while(e--)a.splice(d[e],1)}return k=null,a},e=fa.getText=function(a){var b,c="",d=0,f=a.nodeType;if(f){if(1===f||9===f||11===f){if("string"==typeof a.textContent)return a.textContent;for(a=a.firstChild;a;a=a.nextSibling)c+=e(a)}else if(3===f||4===f)return a.nodeValue}else while(b=a[d++])c+=e(b);return c},d=fa.selectors={cacheLength:50,createPseudo:ha,match:W,attrHandle:{},find:{},relative:{">":{dir:"parentNode",first:!0}," ":{dir:"parentNode"},"+":{dir:"previousSibling",first:!0},"~":{dir:"previousSibling"}},preFilter:{ATTR:function(a){return a[1]=a[1].replace(ba,ca),a[3]=(a[3]||a[4]||a[5]||"").replace(ba,ca),"~="===a[2]&&(a[3]=" "+a[3]+" "),a.slice(0,4)},CHILD:function(a){return a[1]=a[1].toLowerCase(),"nth"===a[1].slice(0,3)?(a[3]||fa.error(a[0]),a[4]=+(a[4]?a[5]+(a[6]||1):2*("even"===a[3]||"odd"===a[3])),a[5]=+(a[7]+a[8]||"odd"===a[3])):a[3]&&fa.error(a[0]),a},PSEUDO:function(a){var b,c=!a[6]&&a[2];return W.CHILD.test(a[0])?null:(a[3]?a[2]=a[4]||a[5]||"":c&&U.test(c)&&(b=g(c,!0))&&(b=c.indexOf(")",c.length-b)-c.length)&&(a[0]=a[0].slice(0,b),a[2]=c.slice(0,b)),a.slice(0,3))}},filter:{TAG:function(a){var b=a.replace(ba,ca).toLowerCase();return"*"===a?function(){return!0}:function(a){return a.nodeName&&a.nodeName.toLowerCase()===b}},CLASS:function(a){var b=y[a+" "];return b||(b=new RegExp("(^|"+L+")"+a+"("+L+"|$)"))&&y(a,function(a){return b.test("string"==typeof a.className&&a.className||"undefined"!=typeof a.getAttribute&&a.getAttribute("class")||"")})},ATTR:function(a,b,c){return function(d){var e=fa.attr(d,a);return null==e?"!="===b:b?(e+="","="===b?e===c:"!="===b?e!==c:"^="===b?c&&0===e.indexOf(c):"*="===b?c&&e.indexOf(c)>-1:"$="===b?c&&e.slice(-c.length)===c:"~="===b?(" "+e.replace(P," ")+" ").indexOf(c)>-1:"|="===b?e===c||e.slice(0,c.length+1)===c+"-":!1):!0}},CHILD:function(a,b,c,d,e){var f="nth"!==a.slice(0,3),g="last"!==a.slice(-4),h="of-type"===b;return 1===d&&0===e?function(a){return!!a.parentNode}:function(b,c,i){var j,k,l,m,n,o,p=f!==g?"nextSibling":"previousSibling",q=b.parentNode,r=h&&b.nodeName.toLowerCase(),s=!i&&!h,t=!1;if(q){if(f){while(p){m=b;while(m=m[p])if(h?m.nodeName.toLowerCase()===r:1===m.nodeType)return!1;o=p="only"===a&&!o&&"nextSibling"}return!0}if(o=[g?q.firstChild:q.lastChild],g&&s){m=q,l=m[u]||(m[u]={}),k=l[m.uniqueID]||(l[m.uniqueID]={}),j=k[a]||[],n=j[0]===w&&j[1],t=n&&j[2],m=n&&q.childNodes[n];while(m=++n&&m&&m[p]||(t=n=0)||o.pop())if(1===m.nodeType&&++t&&m===b){k[a]=[w,n,t];break}}else if(s&&(m=b,l=m[u]||(m[u]={}),k=l[m.uniqueID]||(l[m.uniqueID]={}),j=k[a]||[],n=j[0]===w&&j[1],t=n),t===!1)while(m=++n&&m&&m[p]||(t=n=0)||o.pop())if((h?m.nodeName.toLowerCase()===r:1===m.nodeType)&&++t&&(s&&(l=m[u]||(m[u]={}),k=l[m.uniqueID]||(l[m.uniqueID]={}),k[a]=[w,t]),m===b))break;return t-=e,t===d||t%d===0&&t/d>=0}}},PSEUDO:function(a,b){var c,e=d.pseudos[a]||d.setFilters[a.toLowerCase()]||fa.error("unsupported pseudo: "+a);return e[u]?e(b):e.length>1?(c=[a,a,"",b],d.setFilters.hasOwnProperty(a.toLowerCase())?ha(function(a,c){var d,f=e(a,b),g=f.length;while(g--)d=J(a,f[g]),a[d]=!(c[d]=f[g])}):function(a){return e(a,0,c)}):e}},pseudos:{not:ha(function(a){var b=[],c=[],d=h(a.replace(Q,"$1"));return d[u]?ha(function(a,b,c,e){var f,g=d(a,null,e,[]),h=a.length;while(h--)(f=g[h])&&(a[h]=!(b[h]=f))}):function(a,e,f){return b[0]=a,d(b,null,f,c),b[0]=null,!c.pop()}}),has:ha(function(a){return function(b){return fa(a,b).length>0}}),contains:ha(function(a){return a=a.replace(ba,ca),function(b){return(b.textContent||b.innerText||e(b)).indexOf(a)>-1}}),lang:ha(function(a){return V.test(a||"")||fa.error("unsupported lang: "+a),a=a.replace(ba,ca).toLowerCase(),function(b){var c;do if(c=p?b.lang:b.getAttribute("xml:lang")||b.getAttribute("lang"))return c=c.toLowerCase(),c===a||0===c.indexOf(a+"-");while((b=b.parentNode)&&1===b.nodeType);return!1}}),target:function(b){var c=a.location&&a.location.hash;return c&&c.slice(1)===b.id},root:function(a){return a===o},focus:function(a){return a===n.activeElement&&(!n.hasFocus||n.hasFocus())&&!!(a.type||a.href||~a.tabIndex)},enabled:function(a){return a.disabled===!1},disabled:function(a){return a.disabled===!0},checked:function(a){var b=a.nodeName.toLowerCase();return"input"===b&&!!a.checked||"option"===b&&!!a.selected},selected:function(a){return a.parentNode&&a.parentNode.selectedIndex,a.selected===!0},empty:function(a){for(a=a.firstChild;a;a=a.nextSibling)if(a.nodeType<6)return!1;return!0},parent:function(a){return!d.pseudos.empty(a)},header:function(a){return Y.test(a.nodeName)},input:function(a){return X.test(a.nodeName)},button:function(a){var b=a.nodeName.toLowerCase();return"input"===b&&"button"===a.type||"button"===b},text:function(a){var b;return"input"===a.nodeName.toLowerCase()&&"text"===a.type&&(null==(b=a.getAttribute("type"))||"text"===b.toLowerCase())},first:na(function(){return[0]}),last:na(function(a,b){return[b-1]}),eq:na(function(a,b,c){return[0>c?c+b:c]}),even:na(function(a,b){for(var c=0;b>c;c+=2)a.push(c);return a}),odd:na(function(a,b){for(var c=1;b>c;c+=2)a.push(c);return a}),lt:na(function(a,b,c){for(var d=0>c?c+b:c;--d>=0;)a.push(d);return a}),gt:na(function(a,b,c){for(var d=0>c?c+b:c;++d<b;)a.push(d);return a})}},d.pseudos.nth=d.pseudos.eq;for(b in{radio:!0,checkbox:!0,file:!0,password:!0,image:!0})d.pseudos[b]=la(b);for(b in{submit:!0,reset:!0})d.pseudos[b]=ma(b);function pa(){}pa.prototype=d.filters=d.pseudos,d.setFilters=new pa,g=fa.tokenize=function(a,b){var c,e,f,g,h,i,j,k=z[a+" "];if(k)return b?0:k.slice(0);h=a,i=[],j=d.preFilter;while(h){(!c||(e=R.exec(h)))&&(e&&(h=h.slice(e[0].length)||h),i.push(f=[])),c=!1,(e=S.exec(h))&&(c=e.shift(),f.push({value:c,type:e[0].replace(Q," ")}),h=h.slice(c.length));for(g in d.filter)!(e=W[g].exec(h))||j[g]&&!(e=j[g](e))||(c=e.shift(),f.push({value:c,type:g,matches:e}),h=h.slice(c.length));if(!c)break}return b?h.length:h?fa.error(a):z(a,i).slice(0)};function qa(a){for(var b=0,c=a.length,d="";c>b;b++)d+=a[b].value;return d}function ra(a,b,c){var d=b.dir,e=c&&"parentNode"===d,f=x++;return b.first?function(b,c,f){while(b=b[d])if(1===b.nodeType||e)return a(b,c,f)}:function(b,c,g){var h,i,j,k=[w,f];if(g){while(b=b[d])if((1===b.nodeType||e)&&a(b,c,g))return!0}else while(b=b[d])if(1===b.nodeType||e){if(j=b[u]||(b[u]={}),i=j[b.uniqueID]||(j[b.uniqueID]={}),(h=i[d])&&h[0]===w&&h[1]===f)return k[2]=h[2];if(i[d]=k,k[2]=a(b,c,g))return!0}}}function sa(a){return a.length>1?function(b,c,d){var e=a.length;while(e--)if(!a[e](b,c,d))return!1;return!0}:a[0]}function ta(a,b,c){for(var d=0,e=b.length;e>d;d++)fa(a,b[d],c);return c}function ua(a,b,c,d,e){for(var f,g=[],h=0,i=a.length,j=null!=b;i>h;h++)(f=a[h])&&(!c||c(f,d,e))&&(g.push(f),j&&b.push(h));return g}function va(a,b,c,d,e,f){return d&&!d[u]&&(d=va(d)),e&&!e[u]&&(e=va(e,f)),ha(function(f,g,h,i){var j,k,l,m=[],n=[],o=g.length,p=f||ta(b||"*",h.nodeType?[h]:h,[]),q=!a||!f&&b?p:ua(p,m,a,h,i),r=c?e||(f?a:o||d)?[]:g:q;if(c&&c(q,r,h,i),d){j=ua(r,n),d(j,[],h,i),k=j.length;while(k--)(l=j[k])&&(r[n[k]]=!(q[n[k]]=l))}if(f){if(e||a){if(e){j=[],k=r.length;while(k--)(l=r[k])&&j.push(q[k]=l);e(null,r=[],j,i)}k=r.length;while(k--)(l=r[k])&&(j=e?J(f,l):m[k])>-1&&(f[j]=!(g[j]=l))}}else r=ua(r===g?r.splice(o,r.length):r),e?e(null,g,r,i):H.apply(g,r)})}function wa(a){for(var b,c,e,f=a.length,g=d.relative[a[0].type],h=g||d.relative[" "],i=g?1:0,k=ra(function(a){return a===b},h,!0),l=ra(function(a){return J(b,a)>-1},h,!0),m=[function(a,c,d){var e=!g&&(d||c!==j)||((b=c).nodeType?k(a,c,d):l(a,c,d));return b=null,e}];f>i;i++)if(c=d.relative[a[i].type])m=[ra(sa(m),c)];else{if(c=d.filter[a[i].type].apply(null,a[i].matches),c[u]){for(e=++i;f>e;e++)if(d.relative[a[e].type])break;return va(i>1&&sa(m),i>1&&qa(a.slice(0,i-1).concat({value:" "===a[i-2].type?"*":""})).replace(Q,"$1"),c,e>i&&wa(a.slice(i,e)),f>e&&wa(a=a.slice(e)),f>e&&qa(a))}m.push(c)}return sa(m)}function xa(a,b){var c=b.length>0,e=a.length>0,f=function(f,g,h,i,k){var l,o,q,r=0,s="0",t=f&&[],u=[],v=j,x=f||e&&d.find.TAG("*",k),y=w+=null==v?1:Math.random()||.1,z=x.length;for(k&&(j=g===n||g||k);s!==z&&null!=(l=x[s]);s++){if(e&&l){o=0,g||l.ownerDocument===n||(m(l),h=!p);while(q=a[o++])if(q(l,g||n,h)){i.push(l);break}k&&(w=y)}c&&((l=!q&&l)&&r--,f&&t.push(l))}if(r+=s,c&&s!==r){o=0;while(q=b[o++])q(t,u,g,h);if(f){if(r>0)while(s--)t[s]||u[s]||(u[s]=F.call(i));u=ua(u)}H.apply(i,u),k&&!f&&u.length>0&&r+b.length>1&&fa.uniqueSort(i)}return k&&(w=y,j=v),t};return c?ha(f):f}
vendor: 10,899 bytes, line 3
3return h=fa.compile=function(a,b){var c,d=[],e=[],f=A[a+" "];if(!f){b||(b=g(a)),c=b.length;while(c--)f=wa(b[c]),f[u]?d.push(f):e.push(f);f=A(a,xa(e,d)),f.selector=a}return f},i=fa.select=function(a,b,e,f){var i,j,k,l,m,n="function"==typeof a&&a,o=!f&&g(a=n.selector||a);if(e=e||[],1===o.length){if(j=o[0]=o[0].slice(0),j.length>2&&"ID"===(k=j[0]).type&&c.getById&&9===b.nodeType&&p&&d.relative[j[1].type]){if(b=(d.find.ID(k.matches[0].replace(ba,ca),b)||[])[0],!b)return e;n&&(b=b.parentNode),a=a.slice(j.shift().value.length)}i=W.needsContext.test(a)?0:j.length;while(i--){if(k=j[i],d.relative[l=k.type])break;if((m=d.find[l])&&(f=m(k.matches[0].replace(ba,ca),_.test(j[0].type)&&oa(b.parentNode)||b))){if(j.splice(i,1),a=f.length&&qa(j),!a)return H.apply(e,f),e;break}}}return(n||h(a,o))(f,b,!p,e,!b||_.test(a)&&oa(b.parentNode)||b),e},c.sortStable=u.split("").sort(B).join("")===u,c.detectDuplicates=!!l,m(),c.sortDetached=ia(function(a){return 1&a.compareDocumentPosition(n.createElement("div"))}),ia(function(a){return a.innerHTML="<a href='#'></a>","#"===a.firstChild.getAttribute("href")})||ja("type|href|height|width",function(a,b,c){return c?void 0:a.getAttribute(b,"type"===b.toLowerCase()?1:2)}),c.attributes&&ia(function(a){return a.innerHTML="<input/>",a.firstChild.setAttribute("value",""),""===a.firstChild.getAttribute("value")})||ja("value",function(a,b,c){return c||"input"!==a.nodeName.toLowerCase()?void 0:a.defaultValue}),ia(function(a){return null==a.getAttribute("disabled")})||ja(K,function(a,b,c){var d;return c?void 0:a[b]===!0?b.toLowerCase():(d=a.getAttributeNode(b))&&d.specified?d.value:null}),fa}(a);n.find=t,n.expr=t.selectors,n.expr[":"]=n.expr.pseudos,n.uniqueSort=n.unique=t.uniqueSort,n.text=t.getText,n.isXMLDoc=t.isXML,n.contains=t.contains;var u=function(a,b,c){var d=[],e=void 0!==c;while((a=a[b])&&9!==a.nodeType)if(1===a.nodeType){if(e&&n(a).is(c))break;d.push(a)}return d},v=function(a,b){for(var c=[];a;a=a.nextSibling)1===a.nodeType&&a!==b&&c.push(a);return c},w=n.expr.match.needsContext,x=/^<([\w-]+)\s*\/?>(?:<\/\1>|)$/,y=/^.[^:#\[\.,]*$/;function z(a,b,c){if(n.isFunction(b))return n.grep(a,function(a,d){return!!b.call(a,d,a)!==c});if(b.nodeType)return n.grep(a,function(a){return a===b!==c});if("string"==typeof b){if(y.test(b))return n.filter(b,a,c);b=n.filter(b,a)}return n.grep(a,function(a){return h.call(b,a)>-1!==c})}n.filter=function(a,b,c){var d=b[0];return c&&(a=":not("+a+")"),1===b.length&&1===d.nodeType?n.find.matchesSelector(d,a)?[d]:[]:n.find.matches(a,n.grep(b,function(a){return 1===a.nodeType}))},n.fn.extend({find:function(a){var b,c=this.length,d=[],e=this;if("string"!=typeof a)return this.pushStack(n(a).filter(function(){for(b=0;c>b;b++)if(n.contains(e[b],this))return!0}));for(b=0;c>b;b++)n.find(a,e[b],d);return d=this.pushStack(c>1?n.unique(d):d),d.selector=this.selector?this.selector+" "+a:a,d},filter:function(a){return this.pushStack(z(this,a||[],!1))},not:function(a){return this.pushStack(z(this,a||[],!0))},is:function(a){return!!z(this,"string"==typeof a&&w.test(a)?n(a):a||[],!1).length}});var A,B=/^(?:\s*(<[\w\W]+>)[^>]*|#([\w-]*))$/,C=n.fn.init=function(a,b,c){var e,f;if(!a)return this;if(c=c||A,"string"==typeof a){if(e="<"===a[0]&&">"===a[a.length-1]&&a.length>=3?[null,a,null]:B.exec(a),!e||!e[1]&&b)return!b||b.jquery?(b||c).find(a):this.constructor(b).find(a);if(e[1]){if(b=b instanceof n?b[0]:b,n.merge(this,n.parseHTML(e[1],b&&b.nodeType?b.ownerDocument||b:d,!0)),x.test(e[1])&&n.isPlainObject(b))for(e in b)n.isFunction(this[e])?this[e](b[e]):this.attr(e,b[e]);return this}return f=d.getElementById(e[2]),f&&f.parentNode&&(this.length=1,this[0]=f),this.context=d,this.selector=a,this}return a.nodeType?(this.context=this[0]=a,this.length=1,this):n.isFunction(a)?void 0!==c.ready?c.ready(a):a(n):(void 0!==a.selector&&(this.selector=a.selector,this.context=a.context),n.makeArray(a,this))};C.prototype=n.fn,A=n(d);var D=/^(?:parents|prev(?:Until|All))/,E={children:!0,contents:!0,next:!0,prev:!0};n.fn.extend({has:function(a){var b=n(a,this),c=b.length;return this.filter(function(){for(var a=0;c>a;a++)if(n.contains(this,b[a]))return!0})},closest:function(a,b){for(var c,d=0,e=this.length,f=[],g=w.test(a)||"string"!=typeof a?n(a,b||this.context):0;e>d;d++)for(c=this[d];c&&c!==b;c=c.parentNode)if(c.nodeType<11&&(g?g.index(c)>-1:1===c.nodeType&&n.find.matchesSelector(c,a))){f.push(c);break}return this.pushStack(f.length>1?n.uniqueSort(f):f)},index:function(a){return a?"string"==typeof a?h.call(n(a),this[0]):h.call(this,a.jquery?a[0]:a):this[0]&&this[0].parentNode?this.first().prevAll().length:-1},add:function(a,b){return this.pushStack(n.uniqueSort(n.merge(this.get(),n(a,b))))},addBack:function(a){return this.add(null==a?this.prevObject:this.prevObject.filter(a))}});function F(a,b){while((a=a[b])&&1!==a.nodeType);return a}n.each({parent:function(a){var b=a.parentNode;return b&&11!==b.nodeType?b:null},parents:function(a){return u(a,"parentNode")},parentsUntil:function(a,b,c){return u(a,"parentNode",c)},next:function(a){return F(a,"nextSibling")},prev:function(a){return F(a,"previousSibling")},nextAll:function(a){return u(a,"nextSibling")},prevAll:function(a){return u(a,"previousSibling")},nextUntil:function(a,b,c){return u(a,"nextSibling",c)},prevUntil:function(a,b,c){return u(a,"previousSibling",c)},siblings:function(a){return v((a.parentNode||{}).firstChild,a)},children:function(a){return v(a.firstChild)},contents:function(a){return a.contentDocument||n.merge([],a.childNodes)}},function(a,b){n.fn[a]=function(c,d){var e=n.map(this,b,c);return"Until"!==a.slice(-5)&&(d=c),d&&"string"==typeof d&&(e=n.filter(d,e)),this.length>1&&(E[a]||n.uniqueSort(e),D.test(a)&&e.reverse()),this.pushStack(e)}});var G=/\S+/g;function H(a){var b={};return n.each(a.match(G)||[],function(a,c){b[c]=!0}),b}n.Callbacks=function(a){a="string"==typeof a?H(a):n.extend({},a);var b,c,d,e,f=[],g=[],h=-1,i=function(){for(e=a.once,d=b=!0;g.length;h=-1){c=g.shift();while(++h<f.length)f[h].apply(c[0],c[1])===!1&&a.stopOnFalse&&(h=f.length,c=!1)}a.memory||(c=!1),b=!1,e&&(f=c?[]:"")},j={add:function(){return f&&(c&&!b&&(h=f.length-1,g.push(c)),function d(b){n.each(b,function(b,c){n.isFunction(c)?a.unique&&j.has(c)||f.push(c):c&&c.length&&"string"!==n.type(c)&&d(c)})}(arguments),c&&!b&&i()),this},remove:function(){return n.each(arguments,function(a,b){var c;while((c=n.inArray(b,f,c))>-1)f.splice(c,1),h>=c&&h--}),this},has:function(a){return a?n.inArray(a,f)>-1:f.length>0},empty:function(){return f&&(f=[]),this},disable:function(){return e=g=[],f=c="",this},disabled:function(){return!f},lock:function(){return e=g=[],c||(f=c=""),this},locked:function(){return!!e},fireWith:function(a,c){return e||(c=c||[],c=[a,c.slice?c.slice():c],g.push(c),b||i()),this},fire:function(){return j.fireWith(this,arguments),this},fired:function(){return!!d}};return j},n.extend({Deferred:function(a){var b=[["resolve","done",n.Callbacks("once memory"),"resolved"],["reject","fail",n.Callbacks("once memory"),"rejected"],["notify","progress",n.Callbacks("memory")]],c="pending",d={state:function(){return c},always:function(){return e.done(arguments).fail(arguments),this},then:function(){var a=arguments;return n.Deferred(function(c){n.each(b,function(b,f){var g=n.isFunction(a[b])&&a[b];e[f[1]](function(){var a=g&&g.apply(this,arguments);a&&n.isFunction(a.promise)?a.promise().progress(c.notify).done(c.resolve).fail(c.reject):c[f[0]+"With"](this===d?c.promise():this,g?[a]:arguments)})}),a=null}).promise()},promise:function(a){return null!=a?n.extend(a,d):d}},e={};return d.pipe=d.then,n.each(b,function(a,f){var g=f[2],h=f[3];d[f[1]]=g.add,h&&g.add(function(){c=h},b[1^a][2].disable,b[2][2].lock),e[f[0]]=function(){return e[f[0]+"With"](this===e?d:this,arguments),this},e[f[0]+"With"]=g.fireWith}),d.promise(e),a&&a.call(e,e),e},when:function(a){var b=0,c=e.call(arguments),d=c.length,f=1!==d||a&&n.isFunction(a.promise)?d:0,g=1===f?a:n.Deferred(),h=function(a,b,c){return function(d){b[a]=this,c[a]=arguments.length>1?e.call(arguments):d,c===i?g.notifyWith(b,c):--f||g.resolveWith(b,c)}},i,j,k;if(d>1)for(i=new Array(d),j=new Array(d),k=new Array(d);d>b;b++)c[b]&&n.isFunction(c[b].promise)?c[b].promise().progress(h(b,j,i)).done(h(b,k,c)).fail(g.reject):--f;return f||g.resolveWith(k,c),g.promise()}});var I;n.fn.ready=function(a){return n.ready.promise().done(a),this},n.extend({isReady:!1,readyWait:1,holdReady:function(a){a?n.readyWait++:n.ready(!0)},ready:function(a){(a===!0?--n.readyWait:n.isReady)||(n.isReady=!0,a!==!0&&--n.readyWait>0||(I.resolveWith(d,[n]),n.fn.triggerHandler&&(n(d).triggerHandler("ready"),n(d).off("ready"))))}});function J(){d.removeEventListener("DOMContentLoaded",J),a.removeEventListener("load",J),n.ready()}n.ready.promise=function(b){return I||(I=n.Deferred(),"complete"===d.readyState||"loading"!==d.readyState&&!d.documentElement.doScroll?a.setTimeout(n.ready):(d.addEventListener("DOMContentLoaded",J),a.addEventListener("load",J))),I.promise(b)},n.ready.promise();var K=function(a,b,c,d,e,f,g){var h=0,i=a.length,j=null==c;if("object"===n.type(c)){e=!0;for(h in c)K(a,b,h,c[h],!0,f,g)}else if(void 0!==d&&(e=!0,n.isFunction(d)||(g=!0),j&&(g?(b.call(a,d),b=null):(j=b,b=function(a,b,c){return j.call(n(a),c)})),b))for(;i>h;h++)b(a[h],c,g?d:d.call(a[h],h,b(a[h],c)));return e?a:j?b.call(a):i?b(a[0],c):f},L=function(a){return 1===a.nodeType||9===a.nodeType||!+a.nodeType};function M(){this.expando=n.expando+M.uid++}M.uid=1,M.prototype={register:function(a,b){var c=b||{};return a.nodeType?a[this.expando]=c:Object.defineProperty(a,this.expando,{value:c,writable:!0,configurable:!0}),a[this.expando]},cache:function(a){if(!L(a))return{};var b=a[this.expando];return b||(b={},L(a)&&(a.nodeType?a[this.expando]=b:Object.defineProperty(a,this.expando,{value:b,configurable:!0}))),b},set:function(a,b,c){var d,e=this.cache(a);if("string"==typeof b)e[b]=c;else for(d in b)e[d]=b[d];return e},get:function(a,b){return void 0===b?this.cache(a):a[this.expando]&&a[this.expando][b]},access:function(a,b,c){var d;return void 0===b||b&&"string"==typeof b&&void 0===c?(d=this.get(a,b),void 0!==d?d:this.get(a,n.camelCase(b))):(this.set(a,b,c),void 0!==c?c:b)},remove:function(a,b){var c,d,e,f=a[this.expando];if(void 0!==f){if(void 0===b)this.register(a);else{n.isArray(b)?d=b.concat(b.map(n.camelCase)):(e=n.camelCase(b),b in f?d=[b,e]:(d=e,d=d in f?[d]:d.match(G)||[])),c=d.length;while(c--)delete f[d[c]]}(void 0===b||n.isEmptyObject(f))&&(a.nodeType?a[this.expando]=void 0:delete a[this.expando])}},hasData:function(a){var b=a[this.expando];return void 0!==b&&!n.isEmptyObject(b)}};var N=new M,O=new M,P=/^(?:\{[\w\W]*\}|\[[\w\W]*\])$/,Q=/[A-Z]/g;function R(a,b,c){var d;if(void 0===c&&1===a.nodeType)if(d="data-"+b.replace(Q,"-$&").toLowerCase(),c=a.getAttribute(d),"string"==typeof c){try{c="true"===c?!0:"false"===c?!1:"null"===c?null:+c+""===c?+c:P.test(c)?n.parseJSON(c):c
vendor: 7,455 bytes, lines 3-4
3}catch(e){}O.set(a,b,c);
4}else c=void 0;return c}n.extend({hasData:function(a){return O.hasData(a)||N.hasData(a)},data:function(a,b,c){return O.access(a,b,c)},removeData:function(a,b){O.remove(a,b)},_data:function(a,b,c){return N.access(a,b,c)},_removeData:function(a,b){N.remove(a,b)}}),n.fn.extend({data:function(a,b){var c,d,e,f=this[0],g=f&&f.attributes;if(void 0===a){if(this.length&&(e=O.get(f),1===f.nodeType&&!N.get(f,"hasDataAttrs"))){c=g.length;while(c--)g[c]&&(d=g[c].name,0===d.indexOf("data-")&&(d=n.camelCase(d.slice(5)),R(f,d,e[d])));N.set(f,"hasDataAttrs",!0)}return e}return"object"==typeof a?this.each(function(){O.set(this,a)}):K(this,function(b){var c,d;if(f&&void 0===b){if(c=O.get(f,a)||O.get(f,a.replace(Q,"-$&").toLowerCase()),void 0!==c)return c;if(d=n.camelCase(a),c=O.get(f,d),void 0!==c)return c;if(c=R(f,d,void 0),void 0!==c)return c}else d=n.camelCase(a),this.each(function(){var c=O.get(this,d);O.set(this,d,b),a.indexOf("-")>-1&&void 0!==c&&O.set(this,a,b)})},null,b,arguments.length>1,null,!0)},removeData:function(a){return this.each(function(){O.remove(this,a)})}}),n.extend({queue:function(a,b,c){var d;return a?(b=(b||"fx")+"queue",d=N.get(a,b),c&&(!d||n.isArray(c)?d=N.access(a,b,n.makeArray(c)):d.push(c)),d||[]):void 0},dequeue:function(a,b){b=b||"fx";var c=n.queue(a,b),d=c.length,e=c.shift(),f=n._queueHooks(a,b),g=function(){n.dequeue(a,b)};"inprogress"===e&&(e=c.shift(),d--),e&&("fx"===b&&c.unshift("inprogress"),delete f.stop,e.call(a,g,f)),!d&&f&&f.empty.fire()},_queueHooks:function(a,b){var c=b+"queueHooks";return N.get(a,c)||N.access(a,c,{empty:n.Callbacks("once memory").add(function(){N.remove(a,[b+"queue",c])})})}}),n.fn.extend({queue:function(a,b){var c=2;return"string"!=typeof a&&(b=a,a="fx",c--),arguments.length<c?n.queue(this[0],a):void 0===b?this:this.each(function(){var c=n.queue(this,a,b);n._queueHooks(this,a),"fx"===a&&"inprogress"!==c[0]&&n.dequeue(this,a)})},dequeue:function(a){return this.each(function(){n.dequeue(this,a)})},clearQueue:function(a){return this.queue(a||"fx",[])},promise:function(a,b){var c,d=1,e=n.Deferred(),f=this,g=this.length,h=function(){--d||e.resolveWith(f,[f])};"string"!=typeof a&&(b=a,a=void 0),a=a||"fx";while(g--)c=N.get(f[g],a+"queueHooks"),c&&c.empty&&(d++,c.empty.add(h));return h(),e.promise(b)}});var S=/[+-]?(?:\d*\.|)\d+(?:[eE][+-]?\d+|)/.source,T=new RegExp("^(?:([+-])=|)("+S+")([a-z%]*)$","i"),U=["Top","Right","Bottom","Left"],V=function(a,b){return a=b||a,"none"===n.css(a,"display")||!n.contains(a.ownerDocument,a)};function W(a,b,c,d){var e,f=1,g=20,h=d?function(){return d.cur()}:function(){return n.css(a,b,"")},i=h(),j=c&&c[3]||(n.cssNumber[b]?"":"px"),k=(n.cssNumber[b]||"px"!==j&&+i)&&T.exec(n.css(a,b));if(k&&k[3]!==j){j=j||k[3],c=c||[],k=+i||1;do f=f||".5",k/=f,n.style(a,b,k+j);while(f!==(f=h()/i)&&1!==f&&--g)}return c&&(k=+k||+i||0,e=c[1]?k+(c[1]+1)*c[2]:+c[2],d&&(d.unit=j,d.start=k,d.end=e)),e}var X=/^(?:checkbox|radio)$/i,Y=/<([\w:-]+)/,Z=/^$|\/(?:java|ecma)script/i,$={option:[1,"<select multiple='multiple'>","</select>"],thead:[1,"<table>","</table>"],col:[2,"<table><colgroup>","</colgroup></table>"],tr:[2,"<table><tbody>","</tbody></table>"],td:[3,"<table><tbody><tr>","</tr></tbody></table>"],_default:[0,"",""]};$.optgroup=$.option,$.tbody=$.tfoot=$.colgroup=$.caption=$.thead,$.th=$.td;function _(a,b){var c="undefined"!=typeof a.getElementsByTagName?a.getElementsByTagName(b||"*"):"undefined"!=typeof a.querySelectorAll?a.querySelectorAll(b||"*"):[];return void 0===b||b&&n.nodeName(a,b)?n.merge([a],c):c}function aa(a,b){for(var c=0,d=a.length;d>c;c++)N.set(a[c],"globalEval",!b||N.get(b[c],"globalEval"))}var ba=/<|&#?\w+;/;function ca(a,b,c,d,e){for(var f,g,h,i,j,k,l=b.createDocumentFragment(),m=[],o=0,p=a.length;p>o;o++)if(f=a[o],f||0===f)if("object"===n.type(f))n.merge(m,f.nodeType?[f]:f);else if(ba.test(f)){g=g||l.appendChild(b.createElement("div")),h=(Y.exec(f)||["",""])[1].toLowerCase(),i=$[h]||$._default,g.innerHTML=i[1]+n.htmlPrefilter(f)+i[2],k=i[0];while(k--)g=g.lastChild;n.merge(m,g.childNodes),g=l.firstChild,g.textContent=""}else m.push(b.createTextNode(f));l.textContent="",o=0;while(f=m[o++])if(d&&n.inArray(f,d)>-1)e&&e.push(f);else if(j=n.contains(f.ownerDocument,f),g=_(l.appendChild(f),"script"),j&&aa(g),c){k=0;while(f=g[k++])Z.test(f.type||"")&&c.push(f)}return l}!function(){var a=d.createDocumentFragment(),b=a.appendChild(d.createElement("div")),c=d.createElement("input");c.setAttribute("type","radio"),c.setAttribute("checked","checked"),c.setAttribute("name","t"),b.appendChild(c),l.checkClone=b.cloneNode(!0).cloneNode(!0).lastChild.checked,b.innerHTML="<textarea>x</textarea>",l.noCloneChecked=!!b.cloneNode(!0).lastChild.defaultValue}();var da=/^key/,ea=/^(?:mouse|pointer|contextmenu|drag|drop)|click/,fa=/^([^.]*)(?:\.(.+)|)/;function ga(){return!0}function ha(){return!1}function ia(){try{return d.activeElement}catch(a){}}function ja(a,b,c,d,e,f){var g,h;if("object"==typeof b){"string"!=typeof c&&(d=d||c,c=void 0);for(h in b)ja(a,h,c,d,b[h],f);return a}if(null==d&&null==e?(e=c,d=c=void 0):null==e&&("string"==typeof c?(e=d,d=void 0):(e=d,d=c,c=void 0)),e===!1)e=ha;else if(!e)return a;return 1===f&&(g=e,e=function(a){return n().off(a),g.apply(this,arguments)},e.guid=g.guid||(g.guid=n.guid++)),a.each(function(){n.event.add(this,b,e,d,c)})}n.event={global:{},add:function(a,b,c,d,e){var f,g,h,i,j,k,l,m,o,p,q,r=N.get(a);if(r){c.handler&&(f=c,c=f.handler,e=f.selector),c.guid||(c.guid=n.guid++),(i=r.events)||(i=r.events={}),(g=r.handle)||(g=r.handle=function(b){return"undefined"!=typeof n&&n.event.triggered!==b.type?n.event.dispatch.apply(a,arguments):void 0}),b=(b||"").match(G)||[""],j=b.length;while(j--)h=fa.exec(b[j])||[],o=q=h[1],p=(h[2]||"").split(".").sort(),o&&(l=n.event.special[o]||{},o=(e?l.delegateType:l.bindType)||o,l=n.event.special[o]||{},k=n.extend({type:o,origType:q,data:d,handler:c,guid:c.guid,selector:e,needsContext:e&&n.expr.match.needsContext.test(e),namespace:p.join(".")},f),(m=i[o])||(m=i[o]=[],m.delegateCount=0,l.setup&&l.setup.call(a,d,p,g)!==!1||a.addEventListener&&a.addEventListener(o,g)),l.add&&(l.add.call(a,k),k.handler.guid||(k.handler.guid=c.guid)),e?m.splice(m.delegateCount++,0,k):m.push(k),n.event.global[o]=!0)}},remove:function(a,b,c,d,e){var f,g,h,i,j,k,l,m,o,p,q,r=N.hasData(a)&&N.get(a);if(r&&(i=r.events)){b=(b||"").match(G)||[""],j=b.length;while(j--)if(h=fa.exec(b[j])||[],o=q=h[1],p=(h[2]||"").split(".").sort(),o){l=n.event.special[o]||{},o=(d?l.delegateType:l.bindType)||o,m=i[o]||[],h=h[2]&&new RegExp("(^|\\.)"+p.join("\\.(?:.*\\.|)")+"(\\.|$)"),g=f=m.length;while(f--)k=m[f],!e&&q!==k.origType||c&&c.guid!==k.guid||h&&!h.test(k.namespace)||d&&d!==k.selector&&("**"!==d||!k.selector)||(m.splice(f,1),k.selector&&m.delegateCount--,l.remove&&l.remove.call(a,k));g&&!m.length&&(l.teardown&&l.teardown.call(a,p,r.handle)!==!1||n.removeEvent(a,o,r.handle),delete i[o])}else for(o in i)n.event.remove(a,o+b[j],c,d,!0);n.isEmptyObject(i)&&N.remove(a,"handle events")}},dispatch:function(a){a=n.event.fix(a);var b,c,d,f,g,h=[],i=e.call(arguments),j=(N.get(this,"events")||{})[a.type]||[],k=n.event.special[a.type]||{};if(i[0]=a,a.delegateTarget=this,!k.preDispatch||k.preDispatch.call(this,a)!==!1){h=n.event.handlers.call(this,a,j),b=0;while((f=h[b++])&&!a.isPropagationStopped()){a.currentTarget=f.elem,c=0;while((g=f.handlers[c++])&&!a.isImmediatePropagationStopped())(!a.rnamespace||a.rnamespace.test(g.namespace))&&
vendor: 3,536 bytes, line 4
4(a.handleObj=g,a.data=g.data,d=((n.event.special[g.origType]||{}).handle||g.handler).apply(f.elem,i),void 0!==d&&(a.result=d)===!1&&(a.preventDefault(),a.stopPropagation()))}return k.postDispatch&&k.postDispatch.call(this,a),a.result}},handlers:function(a,b){var c,d,e,f,g=[],h=b.delegateCount,i=a.target;if(h&&i.nodeType&&("click"!==a.type||isNaN(a.button)||a.button<1))for(;i!==this;i=i.parentNode||this)if(1===i.nodeType&&(i.disabled!==!0||"click"!==a.type)){for(d=[],c=0;h>c;c++)f=b[c],e=f.selector+" ",void 0===d[e]&&(d[e]=f.needsContext?n(e,this).index(i)>-1:n.find(e,this,null,[i]).length),d[e]&&d.push(f);d.length&&g.push({elem:i,handlers:d})}return h<b.length&&g.push({elem:this,handlers:b.slice(h)}),g},props:"altKey bubbles cancelable ctrlKey currentTarget detail eventPhase metaKey relatedTarget shiftKey target timeStamp view which".split(" "),fixHooks:{},keyHooks:{props:"char charCode key keyCode".split(" "),filter:function(a,b){return null==a.which&&(a.which=null!=b.charCode?b.charCode:b.keyCode),a}},mouseHooks:{props:"button buttons clientX clientY offsetX offsetY pageX pageY screenX screenY toElement".split(" "),filter:function(a,b){var c,e,f,g=b.button;return null==a.pageX&&null!=b.clientX&&(c=a.target.ownerDocument||d,e=c.documentElement,f=c.body,a.pageX=b.clientX+(e&&e.scrollLeft||f&&f.scrollLeft||0)-(e&&e.clientLeft||f&&f.clientLeft||0),a.pageY=b.clientY+(e&&e.scrollTop||f&&f.scrollTop||0)-(e&&e.clientTop||f&&f.clientTop||0)),a.which||void 0===g||(a.which=1&g?1:2&g?3:4&g?2:0),a}},fix:function(a){if(a[n.expando])return a;var b,c,e,f=a.type,g=a,h=this.fixHooks[f];h||(this.fixHooks[f]=h=ea.test(f)?this.mouseHooks:da.test(f)?this.keyHooks:{}),e=h.props?this.props.concat(h.props):this.props,a=new n.Event(g),b=e.length;while(b--)c=e[b],a[c]=g[c];return a.target||(a.target=d),3===a.target.nodeType&&(a.target=a.target.parentNode),h.filter?h.filter(a,g):a},special:{load:{noBubble:!0},focus:{trigger:function(){return this!==ia()&&this.focus?(this.focus(),!1):void 0},delegateType:"focusin"},blur:{trigger:function(){return this===ia()&&this.blur?(this.blur(),!1):void 0},delegateType:"focusout"},click:{trigger:function(){return"checkbox"===this.type&&this.click&&n.nodeName(this,"input")?(this.click(),!1):void 0},_default:function(a){return n.nodeName(a.target,"a")}},beforeunload:{postDispatch:function(a){void 0!==a.result&&a.originalEvent&&(a.originalEvent.returnValue=a.result)}}}},n.removeEvent=function(a,b,c){a.removeEventListener&&a.removeEventListener(b,c)},n.Event=function(a,b){return this instanceof n.Event?(a&&a.type?(this.originalEvent=a,this.type=a.type,this.isDefaultPrevented=a.defaultPrevented||void 0===a.defaultPrevented&&a.returnValue===!1?ga:ha):this.type=a,b&&n.extend(this,b),this.timeStamp=a&&a.timeStamp||n.now(),void(this[n.expando]=!0)):new n.Event(a,b)},n.Event.prototype={constructor:n.Event,isDefaultPrevented:ha,isPropagationStopped:ha,isImmediatePropagationStopped:ha,preventDefault:function(){var a=this.originalEvent;this.isDefaultPrevented=ga,a&&a.preventDefault()},stopPropagation:function(){var a=this.originalEvent;this.isPropagationStopped=ga,a&&a.stopPropagation()},stopImmediatePropagation:function(){var a=this.originalEvent;this.isImmediatePropagationStopped=ga,a&&a.stopImmediatePropagation(),this.stopPropagation()}},n.each({mouseenter:"mouseover",mouseleave:"mouseout",pointerenter:"pointerover",pointerleave:"pointerout"},function(a,b){n.event.special[a]={delegateType:b,bindType:b,handle:function(a){var c,d=this,e=a.relatedTarget,f=a.handleObj;return
vendor: 1,663 bytes, line 4
4(!e||e!==d&&!n.contains(d,e))&&(a.type=f.origType,c=f.handler.apply(this,arguments),a.type=b),c}}}),n.fn.extend({on:function(a,b,c,d){return ja(this,a,b,c,d)},one:function(a,b,c,d){return ja(this,a,b,c,d,1)},off:function(a,b,c){var d,e;if(a&&a.preventDefault&&a.handleObj)return d=a.handleObj,n(a.delegateTarget).off(d.namespace?d.origType+"."+d.namespace:d.origType,d.selector,d.handler),this;if("object"==typeof a){for(e in a)this.off(e,b,a[e]);return this}return(b===!1||"function"==typeof b)&&(c=b,b=void 0),c===!1&&(c=ha),this.each(function(){n.event.remove(this,a,c,b)})}});var ka=/<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:-]+)[^>]*)\/>/gi,la=/<script|<style|<link/i,ma=/checked\s*(?:[^=]|=\s*.checked.)/i,na=/^true\/(.*)/,oa=/^\s*<!(?:\[CDATA\[|--)|(?:\]\]|--)>\s*$/g;function pa(a,b){return n.nodeName(a,"table")&&n.nodeName(11!==b.nodeType?b:b.firstChild,"tr")?a.getElementsByTagName("tbody")[0]||a.appendChild(a.ownerDocument.createElement("tbody")):a}function qa(a){return a.type=(null!==a.getAttribute("type"))+"/"+a.type,a}function ra(a){var b=na.exec(a.type);return b?a.type=b[1]:a.removeAttribute("type"),a}function sa(a,b){var c,d,e,f,g,h,i,j;if(1===b.nodeType){if(N.hasData(a)&&(f=N.access(a),g=N.set(b,f),j=f.events)){delete g.handle,g.events={};for(e in j)for(c=0,d=j[e].length;d>c;c++)n.event.add(b,e,j[e][c])}O.hasData(a)&&(h=O.access(a),i=n.extend({},h),O.set(b,i))}}function ta(a,b){var c=b.nodeName.toLowerCase();"input"===c&&X.test(a.type)?b.checked=a.checked:("input"===c||"textarea"===c)&&(b.defaultValue=a.defaultValue)}function ua(a,b,c,d){b=f.apply([],b);var e,g,h,i,j,k,m=0,o=a.length,p=o-1,q=b[0],r=n.isFunction(q);
vendor: 13,112 bytes, line 4
4if(r||o>1&&"string"==typeof q&&!l.checkClone&&ma.test(q))return a.each(function(e){var f=a.eq(e);r&&(b[0]=q.call(this,e,f.html())),ua(f,b,c,d)});if(o&&(e=ca(b,a[0].ownerDocument,!1,a,d),g=e.firstChild,1===e.childNodes.length&&(e=g),g||d)){for(h=n.map(_(e,"script"),qa),i=h.length;o>m;m++)j=e,m!==p&&(j=n.clone(j,!0,!0),i&&n.merge(h,_(j,"script"))),c.call(a[m],j,m);if(i)for(k=h[h.length-1].ownerDocument,n.map(h,ra),m=0;i>m;m++)j=h[m],Z.test(j.type||"")&&!N.access(j,"globalEval")&&n.contains(k,j)&&(j.src?n._evalUrl&&n._evalUrl(j.src):n.globalEval(j.textContent.replace(oa,"")))}return a}function va(a,b,c){for(var d,e=b?n.filter(b,a):a,f=0;null!=(d=e[f]);f++)c||1!==d.nodeType||n.cleanData(_(d)),d.parentNode&&(c&&n.contains(d.ownerDocument,d)&&aa(_(d,"script")),d.parentNode.removeChild(d));return a}n.extend({htmlPrefilter:function(a){return a.replace(ka,"<$1></$2>")},clone:function(a,b,c){var d,e,f,g,h=a.cloneNode(!0),i=n.contains(a.ownerDocument,a);if(!(l.noCloneChecked||1!==a.nodeType&&11!==a.nodeType||n.isXMLDoc(a)))for(g=_(h),f=_(a),d=0,e=f.length;e>d;d++)ta(f[d],g[d]);if(b)if(c)for(f=f||_(a),g=g||_(h),d=0,e=f.length;e>d;d++)sa(f[d],g[d]);else sa(a,h);return g=_(h,"script"),g.length>0&&aa(g,!i&&_(a,"script")),h},cleanData:function(a){for(var b,c,d,e=n.event.special,f=0;void 0!==(c=a[f]);f++)if(L(c)){if(b=c[N.expando]){if(b.events)for(d in b.events)e[d]?n.event.remove(c,d):n.removeEvent(c,d,b.handle);c[N.expando]=void 0}c[O.expando]&&(c[O.expando]=void 0)}}}),n.fn.extend({domManip:ua,detach:function(a){return va(this,a,!0)},remove:function(a){return va(this,a)},text:function(a){return K(this,function(a){return void 0===a?n.text(this):this.empty().each(function(){(1===this.nodeType||11===this.nodeType||9===this.nodeType)&&(this.textContent=a)})},null,a,arguments.length)},append:function(){return ua(this,arguments,function(a){if(1===this.nodeType||11===this.nodeType||9===this.nodeType){var b=pa(this,a);b.appendChild(a)}})},prepend:function(){return ua(this,arguments,function(a){if(1===this.nodeType||11===this.nodeType||9===this.nodeType){var b=pa(this,a);b.insertBefore(a,b.firstChild)}})},before:function(){return ua(this,arguments,function(a){this.parentNode&&this.parentNode.insertBefore(a,this)})},after:function(){return ua(this,arguments,function(a){this.parentNode&&this.parentNode.insertBefore(a,this.nextSibling)})},empty:function(){for(var a,b=0;null!=(a=this[b]);b++)1===a.nodeType&&(n.cleanData(_(a,!1)),a.textContent="");return this},clone:function(a,b){return a=null==a?!1:a,b=null==b?a:b,this.map(function(){return n.clone(this,a,b)})},html:function(a){return K(this,function(a){var b=this[0]||{},c=0,d=this.length;if(void 0===a&&1===b.nodeType)return b.innerHTML;if("string"==typeof a&&!la.test(a)&&!$[(Y.exec(a)||["",""])[1].toLowerCase()]){a=n.htmlPrefilter(a);try{for(;d>c;c++)b=this[c]||{},1===b.nodeType&&(n.cleanData(_(b,!1)),b.innerHTML=a);b=0}catch(e){}}b&&this.empty().append(a)},null,a,arguments.length)},replaceWith:function(){var a=[];return ua(this,arguments,function(b){var c=this.parentNode;n.inArray(this,a)<0&&(n.cleanData(_(this)),c&&c.replaceChild(b,this))},a)}}),n.each({appendTo:"append",prependTo:"prepend",insertBefore:"before",insertAfter:"after",replaceAll:"replaceWith"},function(a,b){n.fn[a]=function(a){for(var c,d=[],e=n(a),f=e.length-1,h=0;f>=h;h++)c=h===f?this:this.clone(!0),n(e[h])[b](c),g.apply(d,c.get());return this.pushStack(d)}});var wa,xa={HTML:"block",BODY:"block"};function ya(a,b){var c=n(b.createElement(a)).appendTo(b.body),d=n.css(c[0],"display");return c.detach(),d}function za(a){var b=d,c=xa[a];return c||(c=ya(a,b),"none"!==c&&c||(wa=(wa||n("<iframe frameborder='0' width='0' height='0'/>")).appendTo(b.documentElement),b=wa[0].contentDocument,b.write(),b.close(),c=ya(a,b),wa.detach()),xa[a]=c),c}var Aa=/^margin/,Ba=new RegExp("^("+S+")(?!px)[a-z%]+$","i"),Ca=function(b){var c=b.ownerDocument.defaultView;return c&&c.opener||(c=a),c.getComputedStyle(b)},Da=function(a,b,c,d){var e,f,g={};for(f in b)g[f]=a.style[f],a.style[f]=b[f];e=c.apply(a,d||[]);for(f in b)a.style[f]=g[f];return e},Ea=d.documentElement;!function(){var b,c,e,f,g=d.createElement("div"),h=d.createElement("div");if(h.style){h.style.backgroundClip="content-box",h.cloneNode(!0).style.backgroundClip="",l.clearCloneStyle="content-box"===h.style.backgroundClip,g.style.cssText="border:0;width:8px;height:0;top:0;left:-9999px;padding:0;margin-top:1px;position:absolute",g.appendChild(h);function i(){h.style.cssText="-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;position:relative;display:block;margin:auto;border:1px;padding:1px;top:1%;width:50%",h.innerHTML="",Ea.appendChild(g);var d=a.getComputedStyle(h);b="1%"!==d.top,f="2px"===d.marginLeft,c="4px"===d.width,h.style.marginRight="50%",e="4px"===d.marginRight,Ea.removeChild(g)}n.extend(l,{pixelPosition:function(){return i(),b},boxSizingReliable:function(){return null==c&&i(),c},pixelMarginRight:function(){return null==c&&i(),e},reliableMarginLeft:function(){return null==c&&i(),f},reliableMarginRight:function(){var b,c=h.appendChild(d.createElement("div"));return c.style.cssText=h.style.cssText="-webkit-box-sizing:content-box;box-sizing:content-box;display:block;margin:0;border:0;padding:0",c.style.marginRight=c.style.width="0",h.style.width="1px",Ea.appendChild(g),b=!parseFloat(a.getComputedStyle(c).marginRight),Ea.removeChild(g),h.removeChild(c),b}})}}();function Fa(a,b,c){var d,e,f,g,h=a.style;return c=c||Ca(a),g=c?c.getPropertyValue(b)||c[b]:void 0,""!==g&&void 0!==g||n.contains(a.ownerDocument,a)||(g=n.style(a,b)),c&&!l.pixelMarginRight()&&Ba.test(g)&&Aa.test(b)&&(d=h.width,e=h.minWidth,f=h.maxWidth,h.minWidth=h.maxWidth=h.width=g,g=c.width,h.width=d,h.minWidth=e,h.maxWidth=f),void 0!==g?g+"":g}function Ga(a,b){return{get:function(){return a()?void delete this.get:(this.get=b).apply(this,arguments)}}}var Ha=/^(none|table(?!-c[ea]).+)/,Ia={position:"absolute",visibility:"hidden",display:"block"},Ja={letterSpacing:"0",fontWeight:"400"},Ka=["Webkit","O","Moz","ms"],La=d.createElement("div").style;function Ma(a){if(a in La)return a;var b=a[0].toUpperCase()+a.slice(1),c=Ka.length;while(c--)if(a=Ka[c]+b,a in La)return a}function Na(a,b,c){var d=T.exec(b);return d?Math.max(0,d[2]-(c||0))+(d[3]||"px"):b}function Oa(a,b,c,d,e){for(var f=c===(d?"border":"content")?4:"width"===b?1:0,g=0;4>f;f+=2)"margin"===c&&(g+=n.css(a,c+U[f],!0,e)),d?("content"===c&&(g-=n.css(a,"padding"+U[f],!0,e)),"margin"!==c&&(g-=n.css(a,"border"+U[f]+"Width",!0,e))):(g+=n.css(a,"padding"+U[f],!0,e),"padding"!==c&&(g+=n.css(a,"border"+U[f]+"Width",!0,e)));return g}function Pa(b,c,e){var f=!0,g="width"===c?b.offsetWidth:b.offsetHeight,h=Ca(b),i="border-box"===n.css(b,"boxSizing",!1,h);if(d.msFullscreenElement&&a.top!==a&&b.getClientRects().length&&(g=Math.round(100*b.getBoundingClientRect()[c])),0>=g||null==g){if(g=Fa(b,c,h),(0>g||null==g)&&(g=b.style[c]),Ba.test(g))return g;f=i&&(l.boxSizingReliable()||g===b.style[c]),g=parseFloat(g)||0}return g+Oa(b,c,e||(i?"border":"content"),f,h)+"px"}function Qa(a,b){for(var c,d,e,f=[],g=0,h=a.length;h>g;g++)d=a[g],d.style&&(f[g]=N.get(d,"olddisplay"),c=d.style.display,b?(f[g]||"none"!==c||(d.style.display=""),""===d.style.display&&V(d)&&(f[g]=N.access(d,"olddisplay",za(d.nodeName)))):(e=V(d),"none"===c&&e||N.set(d,"olddisplay",e?c:n.css(d,"display"))));for(g=0;h>g;g++)d=a[g],d.style&&(b&&"none"!==d.style.display&&""!==d.style.display||(d.style.display=b?f[g]||"":"none"));return a}n.extend({cssHooks:{opacity:{get:function(a,b){if(b){var c=Fa(a,"opacity");return""===c?"1":c}}}},cssNumber:{animationIterationCount:!0,columnCount:!0,fillOpacity:!0,flexGrow:!0,flexShrink:!0,fontWeight:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,widows:!0,zIndex:!0,zoom:!0},cssProps:{"float":"cssFloat"},style:function(a,b,c,d){if(a&&3!==a.nodeType&&8!==a.nodeType&&a.style){var e,f,g,h=n.camelCase(b),i=a.style;return b=n.cssProps[h]||(n.cssProps[h]=Ma(h)||h),g=n.cssHooks[b]||n.cssHooks[h],void 0===c?g&&"get"in g&&void 0!==(e=g.get(a,!1,d))?e:i[b]:(f=typeof c,"string"===f&&(e=T.exec(c))&&e[1]&&(c=W(a,b,e),f="number"),null!=c&&c===c&&("number"===f&&(c+=e&&e[3]||(n.cssNumber[h]?"":"px")),l.clearCloneStyle||""!==c||0!==b.indexOf("background")||(i[b]="inherit"),g&&"set"in g&&void 0===(c=g.set(a,c,d))||(i[b]=c)),void 0)}},css:function(a,b,c,d){var e,f,g,h=n.camelCase(b);return b=n.cssProps[h]||(n.cssProps[h]=Ma(h)||h),g=n.cssHooks[b]||n.cssHooks[h],g&&"get"in g&&(e=g.get(a,!0,c)),void 0===e&&(e=Fa(a,b,d)),"normal"===e&&b in Ja&&(e=Ja[b]),""===c||c?(f=parseFloat(e),c===!0||isFinite(f)?f||0:e):e}}),n.each(["height","width"],function(a,b){n.cssHooks[b]={get:function(a,c,d){return c?Ha.test(n.css(a,"display"))&&0===a.offsetWidth?Da(a,Ia,function(){return Pa(a,b,d)}):Pa(a,b,d):void 0},set:function(a,c,d){var e,f=d&&Ca(a),g=d&&Oa(a,b,d,"border-box"===n.css(a,"boxSizing",!1,f),f);return g&&(e=T.exec(c))&&"px"!==(e[3]||"px")&&(a.style[b]=c,c=n.css(a,b)),Na(a,c,g)}}}),n.cssHooks.marginLeft=Ga(l.reliableMarginLeft,function(a,b){return b?(parseFloat(Fa(a,"marginLeft"))||a.getBoundingClientRect().left-Da(a,{marginLeft:0},function(){return a.getBoundingClientRect().left}))+"px":void 0}),n.cssHooks.marginRight=Ga(l.reliableMarginRight,function(a,b){return b?Da(a,{display:"inline-block"},Fa,[a,"marginRight"]):void 0}),n.each({margin:"",padding:"",border:"Width"},function(a,b){n.cssHooks[a+b]={expand:function(c){for(var d=0,e={},f="string"==typeof c?c.split(" "):[c];4>d;d++)e[a+U[d]+b]=f[d]||f[d-2]||f[0];return e}},Aa.test(a)||(n.cssHooks[a+b].set=Na)}),n.fn.extend({css:function(a,b){return K(this,function(a,b,c){var d,e,f={},g=0;if(n.isArray(b)){for(d=Ca(a),e=b.length;e>g;g++)f[b[g]]=n.css(a,b[g],!1,d);return f}return void 0!==c?n.style(a,b,c):n.css(a,b)},a,b,arguments.length>1)},show:function(){return Qa(this,!0)},hide:function(){return Qa(this)},toggle:function(a){return"boolean"==typeof a?a?this.show():this.hide():this.each(function(){V(this)?n(this).show():n(this).hide()})}});function Ra(a,b,c,d,e){return new Ra.prototype.init(a,b,c,d,e)}n.Tween=Ra,Ra.prototype={constructor:Ra,init:function(a,b,c,d,e,f){this.elem=a,this.prop=c,this.easing=e||n.easing._default,this.options=b,this.start=this.now=this.cur(),this.end=d,this.unit=f||(n.cssNumber[c]?"":"px")},cur:function(){var a=Ra.propHooks[this.prop];return a&&a.get?a.get(this):Ra.propHooks._default.get(this)},run:function(a){var b,c=Ra.propHooks[this.prop];return this.options.duration?this.pos=b=n.easing[this.easing](a,this.options.duration*a,0,1,this.options.duration):this.pos=b=a,this.now=(this.end-this.start)*b+this.start,this.options.step&&this.options.step.call(this.elem,this.now,this),c&&c.set?c.set(this):Ra.propHooks._default.set(this),this}},Ra.prototype.init.prototype=Ra.prototype,Ra.propHooks={_default:{get:function(a){var b;return 1!==a.elem.nodeType||null!=a.elem[a.prop]&&null==a.elem.style[a.prop]?a.elem[a.prop]:(b=n.css(a.elem,a.prop,""),b&&"auto"!==b?b:0)},set:function(a){n.fx.step[a.prop]?n.fx.step[a.prop](a):1!==a.elem.nodeType||null==a.elem.style[n.cssProps[a.prop]]&&!n.cssHooks[a.prop]?a.elem[a.prop]=a.now:n.style(a.elem,a.prop,a.now+a.unit)}}},Ra.propHooks.scrollTop=Ra.propHooks.scrollLeft={set:function(a){a.elem.nodeType&&a.elem.parentNode&&(a.elem[a.prop]=a.now)}},n.easing={linear:function(a){return a},swing:function(a){return.5-Math.cos(a*Math.PI)/2},_default:"swing"},n.fx=Ra.prototype.init,n.fx.step={};var Sa,Ta,Ua=/^(?:toggle|show|hide)$/,Va=/queueHooks$/;function Wa(){return a.setTimeout(function(){Sa=void 0}),Sa=n.now()}function Xa(a,b){var c,d=0,e={height:a};for(b=b?1:0;4>d;d+=2-b)c=U[d],e["margin"+c]=e["padding"+c]=a;return b&&(e.opacity=e.width=a),e}function Ya(a,b,c){for(var d,e=(_a.tweeners[b]||[]).concat(_a.tweeners["*"]),f=0,g=e.length;g>f;f++)if(d=e[f].call(c,b,a))return d}function Za(a,b,c){var d,e,f,g,h,i,j,k,l=this,m={},o=a.style,p=a.nodeType&&V(a),q=N.get(a,"fxshow");c.queue||(h=n._queueHooks(a,"fx"),null==h.unqueued&&(h.unqueued=0,i=h.empty.fire,h.empty.fire=function(){h.unqueued||i()}),h.unqueued++,l.always(function(){l.always(function(){h.unqueued--,n.queue(a,"fx").length||h.empty.fire()})})),1===a.nodeType&&("height"in b||"width"in b)&&(c.overflow=[o.overflow,o.overflowX,o.overflowY],j=n.css(a,"display"),k="none"===j?N.get(a,"olddisplay")||za(a.nodeName):j,"inline"===k&&"none"===n.css(a,"float")&&(o.display="inline-block")),c.overflow&&(o.overflow="hidden",l.always(function(){o.overflow=c.overflow[0],o.overflowX=c.overflow[1],o.overflowY=c.overflow[2]}));for(d in b)if(e=b[d],Ua.exec(e)){if(delete b[d],f=f||"toggle"===e,e===(p?"hide":"show")){if("show"!==e||!q||void 0===q[d])continue;p=!0}m[d]=q&&q[d]||n.style(a,d)}else j=void 0;if(n.isEmptyObject(m))"inline"===("none"===j?za(a.nodeName):j)&&(o.display=j);else{q?"hidden"in q&&(p=q.hidden):q=N.access(a,"fxshow",{}),f&&(q.hidden=!p),p?n(a).show():l.done(function(){n(a).hide()}),l.done(function(){var b;N.remove(a,"fxshow");for(b in m)n.style(a,b,m[b])});for(d in m)g=Ya(p?q[d]:0,d,l),d in q||(q[d]=g.start,p&&(g.end=g.start,g.start="width"===d||"height"===d?1:0))}}function $a(a,b){var c,d,e,f,g;
vendor: 4,264 bytes, line 4
4for(c in a)if(d=n.camelCase(c),e=b[d],f=a[c],n.isArray(f)&&(e=f[1],f=a[c]=f[0]),c!==d&&(a[d]=f,delete a[c]),g=n.cssHooks[d],g&&"expand"in g){f=g.expand(f),delete a[d];for(c in f)c in a||(a[c]=f[c],b[c]=e)}else b[d]=e}function _a(a,b,c){var d,e,f=0,g=_a.prefilters.length,h=n.Deferred().always(function(){delete i.elem}),i=function(){if(e)return!1;for(var b=Sa||Wa(),c=Math.max(0,j.startTime+j.duration-b),d=c/j.duration||0,f=1-d,g=0,i=j.tweens.length;i>g;g++)j.tweens[g].run(f);return h.notifyWith(a,[j,f,c]),1>f&&i?c:(h.resolveWith(a,[j]),!1)},j=h.promise({elem:a,props:n.extend({},b),opts:n.extend(!0,{specialEasing:{},easing:n.easing._default},c),originalProperties:b,originalOptions:c,startTime:Sa||Wa(),duration:c.duration,tweens:[],createTween:function(b,c){var d=n.Tween(a,j.opts,b,c,j.opts.specialEasing[b]||j.opts.easing);return j.tweens.push(d),d},stop:function(b){var c=0,d=b?j.tweens.length:0;if(e)return this;for(e=!0;d>c;c++)j.tweens[c].run(1);return b?(h.notifyWith(a,[j,1,0]),h.resolveWith(a,[j,b])):h.rejectWith(a,[j,b]),this}}),k=j.props;for($a(k,j.opts.specialEasing);g>f;f++)if(d=_a.prefilters[f].call(j,a,k,j.opts))return n.isFunction(d.stop)&&(n._queueHooks(j.elem,j.opts.queue).stop=n.proxy(d.stop,d)),d;return n.map(k,Ya,j),n.isFunction(j.opts.start)&&j.opts.start.call(a,j),n.fx.timer(n.extend(i,{elem:a,anim:j,queue:j.opts.queue})),j.progress(j.opts.progress).done(j.opts.done,j.opts.complete).fail(j.opts.fail).always(j.opts.always)}n.Animation=n.extend(_a,{tweeners:{"*":[function(a,b){var c=this.createTween(a,b);return W(c.elem,a,T.exec(b),c),c}]},tweener:function(a,b){n.isFunction(a)?(b=a,a=["*"]):a=a.match(G);for(var c,d=0,e=a.length;e>d;d++)c=a[d],_a.tweeners[c]=_a.tweeners[c]||[],_a.tweeners[c].unshift(b)},prefilters:[Za],prefilter:function(a,b){b?_a.prefilters.unshift(a):_a.prefilters.push(a)}}),n.speed=function(a,b,c){var d=a&&"object"==typeof a?n.extend({},a):{complete:c||!c&&b||n.isFunction(a)&&a,duration:a,easing:c&&b||b&&!n.isFunction(b)&&b};return d.duration=n.fx.off?0:"number"==typeof d.duration?d.duration:d.duration in n.fx.speeds?n.fx.speeds[d.duration]:n.fx.speeds._default,(null==d.queue||d.queue===!0)&&(d.queue="fx"),d.old=d.complete,d.complete=function(){n.isFunction(d.old)&&d.old.call(this),d.queue&&n.dequeue(this,d.queue)},d},n.fn.extend({fadeTo:function(a,b,c,d){return this.filter(V).css("opacity",0).show().end().animate({opacity:b},a,c,d)},animate:function(a,b,c,d){var e=n.isEmptyObject(a),f=n.speed(b,c,d),g=function(){var b=_a(this,n.extend({},a),f);(e||N.get(this,"finish"))&&b.stop(!0)};return g.finish=g,e||f.queue===!1?this.each(g):this.queue(f.queue,g)},stop:function(a,b,c){var d=function(a){var b=a.stop;delete a.stop,b(c)};return"string"!=typeof a&&(c=b,b=a,a=void 0),b&&a!==!1&&this.queue(a||"fx",[]),this.each(function(){var b=!0,e=null!=a&&a+"queueHooks",f=n.timers,g=N.get(this);if(e)g[e]&&g[e].stop&&d(g[e]);else for(e in g)g[e]&&g[e].stop&&Va.test(e)&&d(g[e]);for(e=f.length;e--;)f[e].elem!==this||null!=a&&f[e].queue!==a||(f[e].anim.stop(c),b=!1,f.splice(e,1));(b||!c)&&n.dequeue(this,a)})},finish:function(a){return a!==!1&&(a=a||"fx"),this.each(function(){var b,c=N.get(this),d=c[a+"queue"],e=c[a+"queueHooks"],f=n.timers,g=d?d.length:0;for(c.finish=!0,n.queue(this,a,[]),e&&e.stop&&e.stop.call(this,!0),b=f.length;b--;)f[b].elem===this&&f[b].queue===a&&(f[b].anim.stop(!0),f.splice(b,1));for(b=0;g>b;b++)d[b]&&d[b].finish&&d[b].finish.call(this);delete c.finish})}}),n.each(["toggle","show","hide"],function(a,b){var c=n.fn[b];n.fn[b]=function(a,d,e){return null==a||"boolean"==typeof a?c.apply(this,arguments):this.animate(Xa(b,!0),a,d,e)}}),n.each({slideDown:Xa("show"),slideUp:Xa("hide"),slideToggle:Xa("toggle"),fadeIn:{opacity:"show"},fadeOut:{opacity:"hide"},fadeToggle:{opacity:"toggle"}},function(a,b){n.fn[a]=function(a,c,d){return this.animate(b,a,c,d)}}),n.timers=[],n.fx.tick=function(){var a,b=0,c=n.timers;for(Sa=n.now();b<c.length;b++)a=c[b],a()||c[b]!==a||c.splice(b--,1);c.length||n.fx.stop(),Sa=void 0},n.fx.timer=function(a){n.timers.push(a),a()?n.fx.start():n.timers.pop()},n.fx.interval=13,n.fx.start=function(){Ta||(Ta=a.setInterval(n.fx.tick,n.fx.interval))},n.fx.stop=function(){a.clearInterval(Ta),Ta=null},n.fx.speeds={slow:600,fast:200,_default:400}
vendor: 5,961 bytes, lines 4-5
4,n.fn.delay=function(b,c){return b=n.fx?n.fx.speeds[b]||b:b,c=c||"fx",this.queue(c,function(c,d){var e=a.setTimeout(c,b);d.stop=function(){a.clearTimeout(e)}})},function(){var a=d.createElement("input"),b=d.createElement("select"),c=b.appendChild(d.createElement("option"));a.type="checkbox",l.checkOn=""!==a.value,l.optSelected=c.selected,b.disabled=!0,l.optDisabled=!c.disabled,a=d.createElement("input"),a.value="t",a.type="radio",l.radioValue="t"===a.value}();var ab,bb=n.expr.attrHandle;n.fn.extend({attr:function(a,b){return K(this,n.attr,a,b,arguments.length>1)},removeAttr:function(a){return this.each(function(){n.removeAttr(this,a)})}}),n.extend({attr:function(a,b,c){var d,e,f=a.nodeType;if(3!==f&&8!==f&&2!==f)return"undefined"==typeof a.getAttribute?n.prop(a,b,c):(1===f&&n.isXMLDoc(a)||(b=b.toLowerCase(),e=n.attrHooks[b]||(n.expr.match.bool.test(b)?ab:void 0)),void 0!==c?null===c?void n.removeAttr(a,b):e&&"set"in e&&void 0!==(d=e.set(a,c,b))?d:(a.setAttribute(b,c+""),c):e&&"get"in e&&null!==(d=e.get(a,b))?d:(d=n.find.attr(a,b),null==d?void 0:d))},attrHooks:{type:{set:function(a,b){if(!l.radioValue&&"radio"===b&&n.nodeName(a,"input")){var c=a.value;return a.setAttribute("type",b),c&&(a.value=c),b}}}},removeAttr:function(a,b){var c,d,e=0,f=b&&b.match(G);if(f&&1===a.nodeType)while(c=f[e++])d=n.propFix[c]||c,n.expr.match.bool.test(c)&&(a[d]=!1),a.removeAttribute(c)}}),ab={set:function(a,b,c){return b===!1?n.removeAttr(a,c):a.setAttribute(c,c),c}},n.each(n.expr.match.bool.source.match(/\w+/g),function(a,b){var c=bb[b]||n.find.attr;bb[b]=function(a,b,d){var e,f;return d||(f=bb[b],bb[b]=e,e=null!=c(a,b,d)?b.toLowerCase():null,bb[b]=f),e}});var cb=/^(?:input|select|textarea|button)$/i,db=/^(?:a|area)$/i;n.fn.extend({prop:function(a,b){return K(this,n.prop,a,b,arguments.length>1)},removeProp:function(a){return this.each(function(){delete this[n.propFix[a]||a]})}}),n.extend({prop:function(a,b,c){var d,e,f=a.nodeType;if(3!==f&&8!==f&&2!==f)return 1===f&&n.isXMLDoc(a)||(b=n.propFix[b]||b,
5e=n.propHooks[b]),void 0!==c?e&&"set"in e&&void 0!==(d=e.set(a,c,b))?d:a[b]=c:e&&"get"in e&&null!==(d=e.get(a,b))?d:a[b]},propHooks:{tabIndex:{get:function(a){var b=n.find.attr(a,"tabindex");return b?parseInt(b,10):cb.test(a.nodeName)||db.test(a.nodeName)&&a.href?0:-1}}},propFix:{"for":"htmlFor","class":"className"}}),l.optSelected||(n.propHooks.selected={get:function(a){var b=a.parentNode;return b&&b.parentNode&&b.parentNode.selectedIndex,null}}),n.each(["tabIndex","readOnly","maxLength","cellSpacing","cellPadding","rowSpan","colSpan","useMap","frameBorder","contentEditable"],function(){n.propFix[this.toLowerCase()]=this});var eb=/[\t\r\n\f]/g;function fb(a){return a.getAttribute&&a.getAttribute("class")||""}n.fn.extend({addClass:function(a){var b,c,d,e,f,g,h,i=0;if(n.isFunction(a))return this.each(function(b){n(this).addClass(a.call(this,b,fb(this)))});if("string"==typeof a&&a){b=a.match(G)||[];while(c=this[i++])if(e=fb(c),d=1===c.nodeType&&(" "+e+" ").replace(eb," ")){g=0;while(f=b[g++])d.indexOf(" "+f+" ")<0&&(d+=f+" ");h=n.trim(d),e!==h&&c.setAttribute("class",h)}}return this},removeClass:function(a){var b,c,d,e,f,g,h,i=0;if(n.isFunction(a))return this.each(function(b){n(this).removeClass(a.call(this,b,fb(this)))});if(!arguments.length)return this.attr("class","");if("string"==typeof a&&a){b=a.match(G)||[];while(c=this[i++])if(e=fb(c),d=1===c.nodeType&&(" "+e+" ").replace(eb," ")){g=0;while(f=b[g++])while(d.indexOf(" "+f+" ")>-1)d=d.replace(" "+f+" "," ");h=n.trim(d),e!==h&&c.setAttribute("class",h)}}return this},toggleClass:function(a,b){var c=typeof a;return"boolean"==typeof b&&"string"===c?b?this.addClass(a):this.removeClass(a):n.isFunction(a)?this.each(function(c){n(this).toggleClass(a.call(this,c,fb(this),b),b)}):this.each(function(){var b,d,e,f;if("string"===c){d=0,e=n(this),f=a.match(G)||[];while(b=f[d++])e.hasClass(b)?e.removeClass(b):e.addClass(b)}else(void 0===a||"boolean"===c)&&(b=fb(this),b&&N.set(this,"__className__",b),this.setAttribute&&this.setAttribute("class",b||a===!1?"":N.get(this,"__className__")||""))})},hasClass:function(a){var b,c,d=0;b=" "+a+" ";while(c=this[d++])if(1===c.nodeType&&(" "+fb(c)+" ").replace(eb," ").indexOf(b)>-1)return!0;return!1}});var gb=/\r/g;n.fn.extend({val:function(a){var b,c,d,e=this[0];{if(arguments.length)return d=n.isFunction(a),this.each(function(c){var e;1===this.nodeType&&(e=d?a.call(this,c,n(this).val()):a,null==e?e="":"number"==typeof e?e+="":n.isArray(e)&&(e=n.map(e,function(a){return null==a?"":a+""})),b=n.valHooks[this.type]||n.valHooks[this.nodeName.toLowerCase()],b&&"set"in b&&void 0!==b.set(this,e,"value")||(this.value=e))});if(e)return b=n.valHooks[e.type]||n.valHooks[e.nodeName.toLowerCase()],b&&"get"in b&&void 0!==(c=b.get(e,"value"))?c:(c=e.value,"string"==typeof c?c.replace(gb,""):null==c?"":c)}}}),n.extend({valHooks:{option:{get:function(a){return n.trim(a.value)}},select:{get:function(a){for(var b,c,d=a.options,e=a.selectedIndex,f="select-one"===a.type||0>e,g=f?null:[],h=f?e+1:d.length,i=0>e?h:f?e:0;h>i;i++)if(c=d[i],(c.selected||i===e)&&(l.optDisabled?!c.disabled:null===c.getAttribute("disabled"))&&(!c.parentNode.disabled||!n.nodeName(c.parentNode,"optgroup"))){if(b=n(c).val(),f)return b;g.push(b)}return g},set:function(a,b){var c,d,e=a.options,f=n.makeArray(b),g=e.length;while(g--)d=e[g],(d.selected=n.inArray(n.valHooks.option.get(d),f)>-1)&&(c=!0);return c||(a.selectedIndex=-1),f}}}}),n.each(["radio","checkbox"],function(){n.valHooks[this]={set:function(a,b){return n.isArray(b)?a.checked=n.inArray(n(a).val(),b)>-1:void 0}},l.checkOn||(n.valHooks[this].get=function(a){return null===a.getAttribute("value")?"on":a.value})});var hb=/^(?:focusinfocus|focusoutblur)$/;n.extend(n.event,{trigger:function(b,c,e,f){var g,h,i,j,l,m,o,p=[e||d],q=k.call(b,"type")?b.type:b,r=k.call(b,"namespace")?b.namespace.split("."):[];if(h=i=e=e||d,3!==e.nodeType&&8!==e.nodeType&&!hb.test(q+n.event.triggered)&&(q.indexOf(".")>
vendor: 4,892 bytes, line 5
5-1&&(r=q.split("."),q=r.shift(),r.sort()),l=q.indexOf(":")<0&&"on"+q,b=b[n.expando]?b:new n.Event(q,"object"==typeof b&&b),b.isTrigger=f?2:3,b.namespace=r.join("."),b.rnamespace=b.namespace?new RegExp("(^|\\.)"+r.join("\\.(?:.*\\.|)")+"(\\.|$)"):null,b.result=void 0,b.target||(b.target=e),c=null==c?[b]:n.makeArray(c,[b]),o=n.event.special[q]||{},f||!o.trigger||o.trigger.apply(e,c)!==!1)){if(!f&&!o.noBubble&&!n.isWindow(e)){for(j=o.delegateType||q,hb.test(j+q)||(h=h.parentNode);h;h=h.parentNode)p.push(h),i=h;i===(e.ownerDocument||d)&&p.push(i.defaultView||i.parentWindow||a)}g=0;while((h=p[g++])&&!b.isPropagationStopped())b.type=g>1?j:o.bindType||q,m=(N.get(h,"events")||{})[b.type]&&N.get(h,"handle"),m&&m.apply(h,c),m=l&&h[l],m&&m.apply&&L(h)&&(b.result=m.apply(h,c),b.result===!1&&b.preventDefault());return b.type=q,f||b.isDefaultPrevented()||o._default&&o._default.apply(p.pop(),c)!==!1||!L(e)||l&&n.isFunction(e[q])&&!n.isWindow(e)&&(i=e[l],i&&(e[l]=null),n.event.triggered=q,e[q](),n.event.triggered=void 0,i&&(e[l]=i)),b.result}},simulate:function(a,b,c){var d=n.extend(new n.Event,c,{type:a,isSimulated:!0});n.event.trigger(d,null,b),d.isDefaultPrevented()&&c.preventDefault()}}),n.fn.extend({trigger:function(a,b){return this.each(function(){n.event.trigger(a,b,this)})},triggerHandler:function(a,b){var c=this[0];return c?n.event.trigger(a,b,c,!0):void 0}}),n.each("blur focus focusin focusout load resize scroll unload click dblclick mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave change select submit keydown keypress keyup error contextmenu".split(" "),function(a,b){n.fn[b]=function(a,c){return arguments.length>0?this.on(b,null,a,c):this.trigger(b)}}),n.fn.extend({hover:function(a,b){return this.mouseenter(a).mouseleave(b||a)}}),l.focusin="onfocusin"in a,l.focusin||n.each({focus:"focusin",blur:"focusout"},function(a,b){var c=function(a){n.event.simulate(b,a.target,n.event.fix(a))};n.event.special[b]={setup:function(){var d=this.ownerDocument||this,e=N.access(d,b);e||d.addEventListener(a,c,!0),N.access(d,b,(e||0)+1)},teardown:function(){var d=this.ownerDocument||this,e=N.access(d,b)-1;e?N.access(d,b,e):(d.removeEventListener(a,c,!0),N.remove(d,b))}}});var ib=a.location,jb=n.now(),kb=/\?/;n.parseJSON=function(a){return JSON.parse(a+"")},n.parseXML=function(b){var c;if(!b||"string"!=typeof b)return null;try{c=(new a.DOMParser).parseFromString(b,"text/xml")}catch(d){c=void 0}return(!c||c.getElementsByTagName("parsererror").length)&&n.error("Invalid XML: "+b),c};var lb=/#.*$/,mb=/([?&])_=[^&]*/,nb=/^(.*?):[ \t]*([^\r\n]*)$/gm,ob=/^(?:about|app|app-storage|.+-extension|file|res|widget):$/,pb=/^(?:GET|HEAD)$/,qb=/^\/\//,rb={},sb={},tb="*/".concat("*"),ub=d.createElement("a");ub.href=ib.href;function vb(a){return function(b,c){"string"!=typeof b&&(c=b,b="*");var d,e=0,f=b.toLowerCase().match(G)||[];if(n.isFunction(c))while(d=f[e++])"+"===d[0]?(d=d.slice(1)||"*",(a[d]=a[d]||[]).unshift(c)):(a[d]=a[d]||[]).push(c)}}function wb(a,b,c,d){var e={},f=a===sb;function g(h){var i;return e[h]=!0,n.each(a[h]||[],function(a,h){var j=h(b,c,d);return"string"!=typeof j||f||e[j]?f?!(i=j):void 0:(b.dataTypes.unshift(j),g(j),!1)}),i}return g(b.dataTypes[0])||!e["*"]&&g("*")}function xb(a,b){var c,d,e=n.ajaxSettings.flatOptions||{};for(c in b)void 0!==b[c]&&((e[c]?a:d||(d={}))[c]=b[c]);return d&&n.extend(!0,a,d),a}function yb(a,b,c){var d,e,f,g,h=a.contents,i=a.dataTypes;while("*"===i[0])i.shift(),void 0===d&&(d=a.mimeType||b.getResponseHeader("Content-Type"));if(d)for(e in h)if(h[e]&&h[e].test(d)){i.unshift(e);break}if(i[0]in c)f=i[0];else{for(e in c){if(!i[0]||a.converters[e+" "+i[0]]){f=e;break}g||(g=e)}f=f||g}return f?(f!==i[0]&&i.unshift(f),c[f]):void 0}function zb(a,b,c,d){var e,f,g,h,i,j={},k=a.dataTypes.slice();if(k[1])for(g in a.converters)j[g.toLowerCase()]=a.converters[g];f=k.shift();while(f)if(a.responseFields[f]&&(c[a.responseFields[f]]=b),!i&&d&&a.dataFilter&&(b=a.dataFilter(b,a.dataType)),i=f,f=k.shift())if("*"===f)f=i;else if("*"!==i&&i!==f){if(g=j[i+" "+f]||j["* "+f],!g)for(e in j)if(h=e.split(" "),h[1]===f&&(g=j[i+" "+h[0]]||j["* "+h[0]])){g===!0?g=j[e]:j[e]!==!0&&(f=h[0],k.unshift(h[1]));break}if(g!==!0)if(g&&a["throws"])b=g(b);else try{b=g(b)}catch(l){return{state:"parsererror",error:g?l:"No conversion from "+i+" to "+f}}}return{state:"success",data:b}}n.extend({active:0,lastModified:{},etag:{},ajaxSettings:{url:ib.href,type:"GET",isLocal:ob.test(ib.protocol),global:!0,processData:!0,async:!0,contentType:"application/x-www-form-urlencoded; charset=UTF-8",accepts:{"*":tb,text:"text/plain",html:"text/html",xml:"application/xml, text/xml",json:"application/json, text/javascript"},contents:{xml:/\bxml\b/,html:/\bhtml/,json:/\bjson\b/},responseFields:{xml:"responseXML",text:"responseText",json:"responseJSON"},converters:{"* text":String,"text html":!0,"text json":n.parseJSON,"text xml":n.parseXML}
vendor: 13,322 bytes, lines 5-10
5,flatOptions:{url:!0,context:!0}},ajaxSetup:function(a,b){return b?xb(xb(a,n.ajaxSettings),b):xb(n.ajaxSettings,a)},ajaxPrefilter:vb(rb),ajaxTransport:vb(sb),ajax:function(b,c){"object"==typeof b&&(c=b,b=void 0),c=c||{};var e,f,g,h,i,j,k,l,m=n.ajaxSetup({},c),o=m.context||m,p=m.context&&(o.nodeType||o.jquery)?n(o):n.event,q=n.Deferred(),r=n.Callbacks("once memory"),s=m.statusCode||{},t={},u={},v=0,w="canceled",x={readyState:0,getResponseHeader:function(a){var b;if(2===v){if(!h){h={};while(b=nb.exec(g))h[b[1].toLowerCase()]=b[2]}b=h[a.toLowerCase()]}return null==b?null:b},getAllResponseHeaders:function(){return 2===v?g:null},setRequestHeader:function(a,b){var c=a.toLowerCase();return v||(a=u[c]=u[c]||a,t[a]=b),this},overrideMimeType:function(a){return v||(m.mimeType=a),this},statusCode:function(a){var b;if(a)if(2>v)for(b in a)s[b]=[s[b],a[b]];else x.always(a[x.status]);return this},abort:function(a){var b=a||w;return e&&e.abort(b),z(0,b),this}};if(q.promise(x).complete=r.add,x.success=x.done,x.error=x.fail,m.url=((b||m.url||ib.href)+"").replace(lb,"").replace(qb,ib.protocol+"//"),m.type=c.method||c.type||m.method||m.type,m.dataTypes=n.trim(m.dataType||"*").toLowerCase().match(G)||[""],null==m.crossDomain){j=d.createElement("a");try{j.href=m.url,j.href=j.href,m.crossDomain=ub.protocol+"//"+ub.host!=j.protocol+"//"+j.host}catch(y){m.crossDomain=!0}}if(m.data&&m.processData&&"string"!=typeof m.data&&(m.data=n.param(m.data,m.traditional)),wb(rb,m,c,x),2===v)return x;k=n.event&&m.global,k&&0===n.active++&&n.event.trigger("ajaxStart"),m.type=m.type.toUpperCase(),m.hasContent=!pb.test(m.type),f=m.url,m.hasContent||(m.data&&(f=m.url+=(kb.test(f)?"&":"?")+m.data,delete m.data),m.cache===!1&&(m.url=mb.test(f)?f.replace(mb,"$1_="+jb++):f+(kb.test(f)?"&":"?")+"_="+jb++)),m.ifModified&&(n.lastModified[f]&&x.setRequestHeader("If-Modified-Since",n.lastModified[f]),n.etag[f]&&x.setRequestHeader("If-None-Match",n.etag[f])),(m.data&&m.hasContent&&m.contentType!==!1||c.contentType)&&x.setRequestHeader("Content-Type",m.contentType),x.setRequestHeader("Accept",m.dataTypes[0]&&m.accepts[m.dataTypes[0]]?m.accepts[m.dataTypes[0]]+("*"!==m.dataTypes[0]?", "+tb+"; q=0.01":""):m.accepts["*"]);for(l in m.headers)x.setRequestHeader(l,m.headers[l]);if(m.beforeSend&&(m.beforeSend.call(o,x,m)===!1||2===v))return x.abort();w="abort";for(l in{success:1,error:1,complete:1})x[l](m[l]);if(e=wb(sb,m,c,x)){if(x.readyState=1,k&&p.trigger("ajaxSend",[x,m]),2===v)return x;m.async&&m.timeout>0&&(i=a.setTimeout(function(){x.abort("timeout")},m.timeout));try{v=1,e.send(t,z)}catch(y){if(!(2>v))throw y;z(-1,y)}}else z(-1,"No Transport");function z(b,c,d,h){var j,l,t,u,w,y=c;2!==v&&(v=2,i&&a.clearTimeout(i),e=void 0,g=h||"",x.readyState=b>0?4:0,j=b>=200&&300>b||304===b,d&&(u=yb(m,x,d)),u=zb(m,u,x,j),j?(m.ifModified&&(w=x.getResponseHeader("Last-Modified"),w&&(n.lastModified[f]=w),w=x.getResponseHeader("etag"),w&&(n.etag[f]=w)),204===b||"HEAD"===m.type?y="nocontent":304===b?y="notmodified":(y=u.state,l=u.data,t=u.error,j=!t)):(t=y,(b||!y)&&(y="error",0>b&&(b=0))),x.status=b,x.statusText=(c||y)+"",j?q.resolveWith(o,[l,y,x]):q.rejectWith(o,[x,y,t]),x.statusCode(s),s=void 0,k&&p.trigger(j?"ajaxSuccess":"ajaxError",[x,m,j?l:t]),r.fireWith(o,[x,y]),k&&(p.trigger("ajaxComplete",[x,m]),--n.active||n.event.trigger("ajaxStop")))}return x},getJSON:function(a,b,c){return n.get(a,b,c,"json")},getScript:function(a,b){return n.get(a,void 0,b,"script")}}),n.each(["get","post"],function(a,b){n[b]=function(a,c,d,e){return n.isFunction(c)&&(e=e||d,d=c,c=void 0),n.ajax(n.extend({url:a,type:b,dataType:e,data:c,success:d},n.isPlainObject(a)&&a))}}),n._evalUrl=function(a){return n.ajax({url:a,type:"GET",dataType:"script",async:!1,global:!1,"throws":!0})},n.fn.extend({wrapAll:function(a){var b;return n.isFunction(a)?this.each(function(b){n(this).wrapAll(a.call(this,b))}):(this[0]&&(b=n(a,this[0].ownerDocument).eq(0).clone(!0),this[0].parentNode&&b.insertBefore(this[0]),b.map(function(){var a=this;while(a.firstElementChild)a=a.firstElementChild;return a}).append(this)),this)},wrapInner:function(a){return n.isFunction(a)?this.each(function(b){n(this).wrapInner(a.call(this,b))}):this.each(function(){var b=n(this),c=b.contents();c.length?c.wrapAll(a):b.append(a)})},wrap:function(a){var b=n.isFunction(a);return this.each(function(c){n(this).wrapAll(b?a.call(this,c):a)})},unwrap:function(){return this.parent().each(function(){n.nodeName(this,"body")||n(this).replaceWith(this.childNodes)}).end()}}),n.expr.filters.hidden=function(a){return!n.expr.filters.visible(a)},n.expr.filters.visible=function(a){return a.offsetWidth>0||a.offsetHeight>0||a.getClientRects().length>0};var Ab=/%20/g,Bb=/\[\]$/,Cb=/\r?\n/g,Db=/^(?:submit|button|image|reset|file)$/i,Eb=/^(?:input|select|textarea|keygen)/i;function Fb(a,b,c,d){var e;if(n.isArray(b))n.each(b,function(b,e){c||Bb.test(a)?d(a,e):Fb(a+"["+("object"==typeof e&&null!=e?b:"")+"]",e,c,d)});else if(c||"object"!==n.type(b))d(a,b);else for(e in b)Fb(a+"["+e+"]",b[e],c,d)}n.param=function(a,b){var c,d=[],e=function(a,b){b=n.isFunction(b)?b():null==b?"":b,d[d.length]=encodeURIComponent(a)+"="+encodeURIComponent(b)};if(void 0===b&&(b=n.ajaxSettings&&n.ajaxSettings.traditional),n.isArray(a)||a.jquery&&!n.isPlainObject(a))n.each(a,function(){e(this.name,this.value)});else for(c in a)Fb(c,a[c],b,e);return d.join("&").replace(Ab,"+")},n.fn.extend({serialize:function(){return n.param(this.serializeArray())},serializeArray:function(){return this.map(function(){var a=n.prop(this,"elements");return a?n.makeArray(a):this}).filter(function(){var a=this.type;return this.name&&!n(this).is(":disabled")&&Eb.test(this.nodeName)&&!Db.test(a)&&(this.checked||!X.test(a))}).map(function(a,b){var c=n(this).val();return null==c?null:n.isArray(c)?n.map(c,function(a){return{name:b.name,value:a.replace(Cb,"\r\n")}}):{name:b.name,value:c.replace(Cb,"\r\n")}}).get()}}),n.ajaxSettings.xhr=function(){try{return new a.XMLHttpRequest}catch(b){}};var Gb={0:200,1223:204},Hb=n.ajaxSettings.xhr();l.cors=!!Hb&&"withCredentials"in Hb,l.ajax=Hb=!!Hb,n.ajaxTransport(function(b){var c,d;return l.cors||Hb&&!b.crossDomain?{send:function(e,f){var g,h=b.xhr();if(h.open(b.type,b.url,b.async,b.username,b.password),b.xhrFields)for(g in b.xhrFields)h[g]=b.xhrFields[g];b.mimeType&&h.overrideMimeType&&h.overrideMimeType(b.mimeType),b.crossDomain||e["X-Requested-With"]||(e["X-Requested-With"]="XMLHttpRequest");for(g in e)h.setRequestHeader(g,e[g]);c=function(a){return function(){c&&(c=d=h.onload=h.onerror=h.onabort=h.onreadystatechange=null,"abort"===a?h.abort():"error"===a?"number"!=typeof h.status?f(0,"error"):f(h.status,h.statusText):f(Gb[h.status]||h.status,h.statusText,"text"!==(h.responseType||"text")||"string"!=typeof h.responseText?{binary:h.response}:{text:h.responseText},h.getAllResponseHeaders()))}},h.onload=c(),d=h.onerror=c("error"),void 0!==h.onabort?h.onabort=d:h.onreadystatechange=function(){4===h.readyState&&a.setTimeout(function(){c&&d()})},c=c("abort");try{h.send(b.hasContent&&b.data||null)}catch(i){if(c)throw i}},abort:function(){c&&c()}}:void 0}),n.ajaxSetup({accepts:{script:"text/javascript, application/javascript, application/ecmascript, application/x-ecmascript"},contents:{script:/\b(?:java|ecma)script\b/},converters:{"text script":function(a){return n.globalEval(a),a}}}),n.ajaxPrefilter("script",function(a){void 0===a.cache&&(a.cache=!1),a.crossDomain&&(a.type="GET")}),n.ajaxTransport("script",function(a){if(a.crossDomain){var b,c;return{send:function(e,f){b=n("<script>").prop({charset:a.scriptCharset,src:a.url}).on("load error",c=function(a){b.remove(),c=null,a&&f("error"===a.type?404:200,a.type)}),d.head.appendChild(b[0])},abort:function(){c&&c()}}}});var Ib=[],Jb=/(=)\?(?=&|$)|\?\?/;n.ajaxSetup({jsonp:"callback",jsonpCallback:function(){var a=Ib.pop()||n.expando+"_"+jb++;return this[a]=!0,a}}),n.ajaxPrefilter("json jsonp",function(b,c,d){var e,f,g,h=b.jsonp!==!1&&(Jb.test(b.url)?"url":"string"==typeof b.data&&0===(b.contentType||"").indexOf("application/x-www-form-urlencoded")&&Jb.test(b.data)&&"data");return h||"jsonp"===b.dataTypes[0]?(e=b.jsonpCallback=n.isFunction(b.jsonpCallback)?b.jsonpCallback():b.jsonpCallback,h?b[h]=b[h].replace(Jb,"$1"+e):b.jsonp!==!1&&(b.url+=(kb.test(b.url)?"&":"?")+b.jsonp+"="+e),b.converters["script json"]=function(){return g||n.error(e+" was not called"),g[0]},b.dataTypes[0]="json",f=a[e],a[e]=function(){g=arguments},d.always(function(){void 0===f?n(a).removeProp(e):a[e]=f,b[e]&&(b.jsonpCallback=c.jsonpCallback,Ib.push(e)),g&&n.isFunction(f)&&f(g[0]),g=f=void 0}),"script"):void 0}),l.createHTMLDocument=function(){var a=d.implementation.createHTMLDocument("").body;return a.innerHTML="<form></form><form></form>",2===a.childNodes.length}(),n.parseHTML=function(a,b,c){if(!a||"string"!=typeof a)return null;"boolean"==typeof b&&(c=b,b=!1),b=b||(l.createHTMLDocument?d.implementation.createHTMLDocument(""):d);var e=x.exec(a),f=!c&&[];return e?[b.createElement(e[1])]:(e=ca([a],b,f),f&&f.length&&n(f).remove(),n.merge([],e.childNodes))};var Kb=n.fn.load;n.fn.load=function(a,b,c){if("string"!=typeof a&&Kb)return Kb.apply(this,arguments);var d,e,f,g=this,h=a.indexOf(" ");return h>-1&&(d=n.trim(a.slice(h)),a=a.slice(0,h)),n.isFunction(b)?(c=b,b=void 0):b&&"object"==typeof b&&(e="POST"),g.length>0&&n.ajax({url:a,type:e||"GET",dataType:"html",data:b}).done(function(a){f=arguments,g.html(d?n("<div>").append(n.parseHTML(a)).find(d):a)}).always(c&&function(a,b){g.each(function(){c.apply(g,f||[a.responseText,b,a])})}),this},n.each(["ajaxStart","ajaxStop","ajaxComplete","ajaxError","ajaxSuccess","ajaxSend"],function(a,b){n.fn[b]=function(a){return this.on(b,a)}}),n.expr.filters.animated=function(a){return n.grep(n.timers,function(b){return a===b.elem}).length};function Lb(a){return n.isWindow(a)?a:9===a.nodeType&&a.defaultView}n.offset={setOffset:function(a,b,c){var d,e,f,g,h,i,j,k=n.css(a,"position"),l=n(a),m={};"static"===k&&(a.style.position="relative"),h=l.offset(),f=n.css(a,"top"),i=n.css(a,"left"),j=("absolute"===k||"fixed"===k)&&(f+i).indexOf("auto")>-1,j?(d=l.position(),g=d.top,e=d.left):(g=parseFloat(f)||0,e=parseFloat(i)||0),n.isFunction(b)&&(b=b.call(a,c,n.extend({},h))),null!=b.top&&(m.top=b.top-h.top+g),null!=b.left&&(m.left=b.left-h.left+e),"using"in b?b.using.call(a,m):l.css(m)}},n.fn.extend({offset:function(a){if(arguments.length)return void 0===a?this:this.each(function(b){n.offset.setOffset(this,a,b)});var b,c,d=this[0],e={top:0,left:0},f=d&&d.ownerDocument;if(f)return b=f.documentElement,n.contains(b,d)?(e=d.getBoundingClientRect(),c=Lb(f),{top:e.top+c.pageYOffset-b.clientTop,left:e.left+c.pageXOffset-b.clientLeft}):e},position:function(){if(this[0]){var a,b,c=this[0],d={top:0,left:0};return"fixed"===n.css(c,"position")?b=c.getBoundingClientRect():(a=this.offsetParent(),b=this.offset(),n.nodeName(a[0],"html")||(d=a.offset()),d.top+=n.css(a[0],"borderTopWidth",!0),d.left+=n.css(a[0],"borderLeftWidth",!0)),{top:b.top-d.top-n.css(c,"marginTop",!0),left:b.left-d.left-n.css(c,"marginLeft",!0)}}},offsetParent:function(){return this.map(function(){var a=this.offsetParent;while(a&&"static"===n.css(a,"position"))a=a.offsetParent;return a||Ea})}}),n.each({scrollLeft:"pageXOffset",scrollTop:"pageYOffset"},function(a,b){var c="pageYOffset"===b;n.fn[a]=function(d){return K(this,function(a,d,e){var f=Lb(a);return void 0===e?f?f[b]:a[d]:void(f?f.scrollTo(c?f.pageXOffset:e,c?e:f.pageYOffset):a[d]=e)},a,d,arguments.length)}}),n.each(["top","left"],function(a,b){n.cssHooks[b]=Ga(l.pixelPosition,function(a,c){return c?(c=Fa(a,b),Ba.test(c)?n(a).position()[b]+"px":c):void 0})}),n.each({Height:"height",Width:"width"},function(a,b){n.each({padding:"inner"+a,content:b,"":"outer"+a},function(c,d){n.fn[d]=function(d,e){var f=arguments.length&&(c||"boolean"!=typeof d),g=c||(d===!0||e===!0?"margin":"border");return K(this,function(b,c,d){var e;return n.isWindow(b)?b.document.documentElement["client"+a]:9===b.nodeType?(e=b.documentElement,Math.max(b.body["scroll"+a],e["scroll"+a],b.body["offset"+a],e["offset"+a],e["client"+a])):void 0===d?n.css(b,c,g):n.style(b,c,d,g)},b,f?d:void 0,f,null)}})}),n.fn.extend({bind:function(a,b,c){return this.on(a,null,b,c)},unbind:function(a,b){return this.off(a,null,b)},delegate:function(a,b,c,d){return this.on(b,a,c,d)},undelegate:function(a,b,c){return 1===arguments.length?this.off(a,"**"):this.off(b,a||"**",c)},size:function(){return this.length}}),n.fn.andSelf=n.fn.addBack,"function"==typeof define&&define.amd&&define("jquery",[],function(){return n});var Mb=a.jQuery,Nb=a.$;return n.noConflict=function(b){return a.$===n&&(a.$=Nb),b&&a.jQuery===n&&(a.jQuery=Mb),n},b||(a.jQuery=a.$=n),n});
6
7/*! jQuery UI - v1.11.4 - 2016-06-22
8* http://jqueryui.com
9* Includes: core.js, widget.js, mouse.js, position.js, draggable.js, droppable.js, resizable.js, selectable.js, sortable.js, accordion.js, autocomplete.js, button.js, datepicker.js, dialog.js, menu.js, progressbar.js, selectmenu.js, slider.js, spinner.js, tabs.js, tooltip.js, effect.js, effect-blind.js, effect-bounce.js, effect-clip.js, effect-drop.js, effect-explode.js, effect-fade.js, effect-fold.js, effect-highlight.js, effect-puff.js, effect-pulsate.js, effect-scale.js, effect-shake.js, effect-size.js, effect-slide.js, effect-transfer.js
10* Copyright
vendor: 32,932 bytes, lines 10-1209
10 jQuery Foundation and other contributors; Licensed MIT */
11
12(function( factory ) {
13	if ( typeof define === "function" && define.amd ) {
14
15		// AMD. Register as an anonymous module.
16		define([ "jquery" ], factory );
17	} else {
18
19		// Browser globals
20		factory( jQuery );
21	}
22}(function( $ ) {
23/*!
24 * jQuery UI Core 1.11.4
25 * http://jqueryui.com
26 *
27 * Copyright jQuery Foundation and other contributors
28 * Released under the MIT license.
29 * http://jquery.org/license
30 *
31 * http://api.jqueryui.com/category/ui-core/
32 */
33
34
35// $.ui might exist from components with no dependencies, e.g., $.ui.position
36$.ui = $.ui || {};
37
38$.extend( $.ui, {
39	version: "1.11.4",
40
41	keyCode: {
42		BACKSPACE: 8,
43		COMMA: 188,
44		DELETE: 46,
45		DOWN: 40,
46		END: 35,
47		ENTER: 13,
48		ESCAPE: 27,
49		HOME: 36,
50		LEFT: 37,
51		PAGE_DOWN: 34,
52		PAGE_UP: 33,
53		PERIOD: 190,
54		RIGHT: 39,
55		SPACE: 32,
56		TAB: 9,
57		UP: 38
58	}
59});
60
61// plugins
62$.fn.extend({
63	scrollParent: function( includeHidden ) {
64		var position = this.css( "position" ),
65			excludeStaticParent = position === "absolute",
66			overflowRegex = includeHidden ? /(auto|scroll|hidden)/ : /(auto|scroll)/,
67			scrollParent = this.parents().filter( function() {
68				var parent = $( this );
69				if ( excludeStaticParent && parent.css( "position" ) === "static" ) {
70					return false;
71				}
72				return overflowRegex.test( parent.css( "overflow" ) + parent.css( "overflow-y" ) + parent.css( "overflow-x" ) );
73			}).eq( 0 );
74
75		return position === "fixed" || !scrollParent.length ? $( this[ 0 ].ownerDocument || document ) : scrollParent;
76	},
77
78	uniqueId: (function() {
79		var uuid = 0;
80
81		return function() {
82			return this.each(function() {
83				if ( !this.id ) {
84					this.id = "ui-id-" + ( ++uuid );
85				}
86			});
87		};
88	})(),
89
90	removeUniqueId: function() {
91		return this.each(function() {
92			if ( /^ui-id-\d+$/.test( this.id ) ) {
93				$( this ).removeAttr( "id" );
94			}
95		});
96	}
97});
98
99// selectors
100function focusable( element, isTabIndexNotNaN ) {
101	var map, mapName, img,
102		nodeName = element.nodeName.toLowerCase();
103	if ( "area" === nodeName ) {
104		map = element.parentNode;
105		mapName = map.name;
106		if ( !element.href || !mapName || map.nodeName.toLowerCase() !== "map" ) {
107			return false;
108		}
109		img = $( "img[usemap='#" + mapName + "']" )[ 0 ];
110		return !!img && visible( img );
111	}
112	return ( /^(input|select|textarea|button|object)$/.test( nodeName ) ?
113		!element.disabled :
114		"a" === nodeName ?
115			element.href || isTabIndexNotNaN :
116			isTabIndexNotNaN) &&
117		// the element and all of its ancestors must be visible
118		visible( element );
119}
120
121function visible( element ) {
122	return $.expr.filters.visible( element ) &&
123		!$( element ).parents().addBack().filter(function() {
124			return $.css( this, "visibility" ) === "hidden";
125		}).length;
126}
127
128$.extend( $.expr[ ":" ], {
129	data: $.expr.createPseudo ?
130		$.expr.createPseudo(function( dataName ) {
131			return function( elem ) {
132				return !!$.data( elem, dataName );
133			};
134		}) :
135		// support: jQuery <1.8
136		function( elem, i, match ) {
137			return !!$.data( elem, match[ 3 ] );
138		},
139
140	focusable: function( element ) {
141		return focusable( element, !isNaN( $.attr( element, "tabindex" ) ) );
142	},
143
144	tabbable: function( element ) {
145		var tabIndex = $.attr( element, "tabindex" ),
146			isTabIndexNaN = isNaN( tabIndex );
147		return ( isTabIndexNaN || tabIndex >= 0 ) && focusable( element, !isTabIndexNaN );
148	}
149});
150
151// support: jQuery <1.8
152if ( !$( "<a>" ).outerWidth( 1 ).jquery ) {
153	$.each( [ "Width", "Height" ], function( i, name ) {
154		var side = name === "Width" ? [ "Left", "Right" ] : [ "Top", "Bottom" ],
155			type = name.toLowerCase(),
156			orig = {
157				innerWidth: $.fn.innerWidth,
158				innerHeight: $.fn.innerHeight,
159				outerWidth: $.fn.outerWidth,
160				outerHeight: $.fn.outerHeight
161			};
162
163		function reduce( elem, size, border, margin ) {
164			$.each( side, function() {
165				size -= parseFloat( $.css( elem, "padding" + this ) ) || 0;
166				if ( border ) {
167					size -= parseFloat( $.css( elem, "border" + this + "Width" ) ) || 0;
168				}
169				if ( margin ) {
170					size -= parseFloat( $.css( elem, "margin" + this ) ) || 0;
171				}
172			});
173			return size;
174		}
175
176		$.fn[ "inner" + name ] = function( size ) {
177			if ( size === undefined ) {
178				return orig[ "inner" + name ].call( this );
179			}
180
181			return this.each(function() {
182				$( this ).css( type, reduce( this, size ) + "px" );
183			});
184		};
185
186		$.fn[ "outer" + name] = function( size, margin ) {
187			if ( typeof size !== "number" ) {
188				return orig[ "outer" + name ].call( this, size );
189			}
190
191			return this.each(function() {
192				$( this).css( type, reduce( this, size, true, margin ) + "px" );
193			});
194		};
195	});
196}
197
198// support: jQuery <1.8
199if ( !$.fn.addBack ) {
200	$.fn.addBack = function( selector ) {
201		return this.add( selector == null ?
202			this.prevObject : this.prevObject.filter( selector )
203		);
204	};
205}
206
207// support: jQuery 1.6.1, 1.6.2 (http://bugs.jquery.com/ticket/9413)
208if ( $( "<a>" ).data( "a-b", "a" ).removeData( "a-b" ).data( "a-b" ) ) {
209	$.fn.removeData = (function( removeData ) {
210		return function( key ) {
211			if ( arguments.length ) {
212				return removeData.call( this, $.camelCase( key ) );
213			} else {
214				return removeData.call( this );
215			}
216		};
217	})( $.fn.removeData );
218}
219
220// deprecated
221$.ui.ie = !!/msie [\w.]+/.exec( navigator.userAgent.toLowerCase() );
222
223$.fn.extend({
224	focus: (function( orig ) {
225		return function( delay, fn ) {
226			return typeof delay === "number" ?
227				this.each(function() {
228					var elem = this;
229					setTimeout(function() {
230						$( elem ).focus();
231						if ( fn ) {
232							fn.call( elem );
233						}
234					}, delay );
235				}) :
236				orig.apply( this, arguments );
237		};
238	})( $.fn.focus ),
239
240	disableSelection: (function() {
241		var eventType = "onselectstart" in document.createElement( "div" ) ?
242			"selectstart" :
243			"mousedown";
244
245		return function() {
246			return this.bind( eventType + ".ui-disableSelection", function( event ) {
247				event.preventDefault();
248			});
249		};
250	})(),
251
252	enableSelection: function() {
253		return this.unbind( ".ui-disableSelection" );
254	},
255
256	zIndex: function( zIndex ) {
257		if ( zIndex !== undefined ) {
258			return this.css( "zIndex", zIndex );
259		}
260
261		if ( this.length ) {
262			var elem = $( this[ 0 ] ), position, value;
263			while ( elem.length && elem[ 0 ] !== document ) {
264				// Ignore z-index if position is set to a value where z-index is ignored by the browser
265				// This makes behavior of this function consistent across browsers
266				// WebKit always returns auto if the element is positioned
267				position = elem.css( "position" );
268				if ( position === "absolute" || position === "relative" || position === "fixed" ) {
269					// IE returns 0 when zIndex is not specified
270					// other browsers return a string
271					// we ignore the case of nested elements with an explicit value of 0
272					// <div style="z-index: -10;"><div style="z-index: 0;"></div></div>
273					value = parseInt( elem.css( "zIndex" ), 10 );
274					if ( !isNaN( value ) && value !== 0 ) {
275						return value;
276					}
277				}
278				elem = elem.parent();
279			}
280		}
281
282		return 0;
283	}
284});
285
286// $.ui.plugin is deprecated. Use $.widget() extensions instead.
287$.ui.plugin = {
288	add: function( module, option, set ) {
289		var i,
290			proto = $.ui[ module ].prototype;
291		for ( i in set ) {
292			proto.plugins[ i ] = proto.plugins[ i ] || [];
293			proto.plugins[ i ].push( [ option, set[ i ] ] );
294		}
295	},
296	call: function( instance, name, args, allowDisconnected ) {
297		var i,
298			set = instance.plugins[ name ];
299
300		if ( !set ) {
301			return;
302		}
303
304		if ( !allowDisconnected && ( !instance.element[ 0 ].parentNode || instance.element[ 0 ].parentNode.nodeType === 11 ) ) {
305			return;
306		}
307
308		for ( i = 0; i < set.length; i++ ) {
309			if ( instance.options[ set[ i ][ 0 ] ] ) {
310				set[ i ][ 1 ].apply( instance.element, args );
311			}
312		}
313	}
314};
315
316
317/*!
318 * jQuery UI Widget 1.11.4
319 * http://jqueryui.com
320 *
321 * Copyright jQuery Foundation and other contributors
322 * Released under the MIT license.
323 * http://jquery.org/license
324 *
325 * http://api.jqueryui.com/jQuery.widget/
326 */
327
328
329var widget_uuid = 0,
330	widget_slice = Array.prototype.slice;
331
332$.cleanData = (function( orig ) {
333	return function( elems ) {
334		var events, elem, i;
335		for ( i = 0; (elem = elems[i]) != null; i++ ) {
336			try {
337
338				// Only trigger remove when necessary to save time
339				events = $._data( elem, "events" );
340				if ( events && events.remove ) {
341					$( elem ).triggerHandler( "remove" );
342				}
343
344			// http://bugs.jquery.com/ticket/8235
345			} catch ( e ) {}
346		}
347		orig( elems );
348	};
349})( $.cleanData );
350
351$.widget = function( name, base, prototype ) {
352	var fullName, existingConstructor, constructor, basePrototype,
353		// proxiedPrototype allows the provided prototype to remain unmodified
354		// so that it can be used as a mixin for multiple widgets (#8876)
355		proxiedPrototype = {},
356		namespace = name.split( "." )[ 0 ];
357
358	name = name.split( "." )[ 1 ];
359	fullName = namespace + "-" + name;
360
361	if ( !prototype ) {
362		prototype = base;
363		base = $.Widget;
364	}
365
366	// create selector for plugin
367	$.expr[ ":" ][ fullName.toLowerCase() ] = function( elem ) {
368		return !!$.data( elem, fullName );
369	};
370
371	$[ namespace ] = $[ namespace ] || {};
372	existingConstructor = $[ namespace ][ name ];
373	constructor = $[ namespace ][ name ] = function( options, element ) {
374		// allow instantiation without "new" keyword
375		if ( !this._createWidget ) {
376			return new constructor( options, element );
377		}
378
379		// allow instantiation without initializing for simple inheritance
380		// must use "new" keyword (the code above always passes args)
381		if ( arguments.length ) {
382			this._createWidget( options, element );
383		}
384	};
385	// extend with the existing constructor to carry over any static properties
386	$.extend( constructor, existingConstructor, {
387		version: prototype.version,
388		// copy the object used to create the prototype in case we need to
389		// redefine the widget later
390		_proto: $.extend( {}, prototype ),
391		// track widgets that inherit from this widget in case this widget is
392		// redefined after a widget inherits from it
393		_childConstructors: []
394	});
395
396	basePrototype = new base();
397	// we need to make the options hash a property directly on the new instance
398	// otherwise we'll modify the options hash on the prototype that we're
399	// inheriting from
400	basePrototype.options = $.widget.extend( {}, basePrototype.options );
401	$.each( prototype, function( prop, value ) {
402		if ( !$.isFunction( value ) ) {
403			proxiedPrototype[ prop ] = value;
404			return;
405		}
406		proxiedPrototype[ prop ] = (function() {
407			var _super = function() {
408					return base.prototype[ prop ].apply( this, arguments );
409				},
410				_superApply = function( args ) {
411					return base.prototype[ prop ].apply( this, args );
412				};
413			return function() {
414				var __super = this._super,
415					__superApply = this._superApply,
416					returnValue;
417
418				this._super = _super;
419				this._superApply = _superApply;
420
421				returnValue = value.apply( this, arguments );
422
423				this._super = __super;
424				this._superApply = __superApply;
425
426				return returnValue;
427			};
428		})();
429	});
430	constructor.prototype = $.widget.extend( basePrototype, {
431		// TODO: remove support for widgetEventPrefix
432		// always use the name + a colon as the prefix, e.g., draggable:start
433		// don't prefix for widgets that aren't DOM-based
434		widgetEventPrefix: existingConstructor ? (basePrototype.widgetEventPrefix || name) : name
435	}, proxiedPrototype, {
436		constructor: constructor,
437		namespace: namespace,
438		widgetName: name,
439		widgetFullName: fullName
440	});
441
442	// If this widget is being redefined then we need to find all widgets that
443	// are inheriting from it and redefine all of them so that they inherit from
444	// the new version of this widget. We're essentially trying to replace one
445	// level in the prototype chain.
446	if ( existingConstructor ) {
447		$.each( existingConstructor._childConstructors, function( i, child ) {
448			var childPrototype = child.prototype;
449
450			// redefine the child widget using the same prototype that was
451			// originally used, but inherit from the new version of the base
452			$.widget( childPrototype.namespace + "." + childPrototype.widgetName, constructor, child._proto );
453		});
454		// remove the list of existing child constructors from the old constructor
455		// so the old child constructors can be garbage collected
456		delete existingConstructor._childConstructors;
457	} else {
458		base._childConstructors.push( constructor );
459	}
460
461	$.widget.bridge( name, constructor );
462
463	return constructor;
464};
465
466$.widget.extend = function( target ) {
467	var input = widget_slice.call( arguments, 1 ),
468		inputIndex = 0,
469		inputLength = input.length,
470		key,
471		value;
472	for ( ; inputIndex < inputLength; inputIndex++ ) {
473		for ( key in input[ inputIndex ] ) {
474			value = input[ inputIndex ][ key ];
475			if ( input[ inputIndex ].hasOwnProperty( key ) && value !== undefined ) {
476				// Clone objects
477				if ( $.isPlainObject( value ) ) {
478					target[ key ] = $.isPlainObject( target[ key ] ) ?
479						$.widget.extend( {}, target[ key ], value ) :
480						// Don't extend strings, arrays, etc. with objects
481						$.widget.extend( {}, value );
482				// Copy everything else by reference
483				} else {
484					target[ key ] = value;
485				}
486			}
487		}
488	}
489	return target;
490};
491
492$.widget.bridge = function( name, object ) {
493	var fullName = object.prototype.widgetFullName || name;
494	$.fn[ name ] = function( options ) {
495		var isMethodCall = typeof options === "string",
496			args = widget_slice.call( arguments, 1 ),
497			returnValue = this;
498
499		if ( isMethodCall ) {
500			this.each(function() {
501				var methodValue,
502					instance = $.data( this, fullName );
503				if ( options === "instance" ) {
504					returnValue = instance;
505					return false;
506				}
507				if ( !instance ) {
508					return $.error( "cannot call methods on " + name + " prior to initialization; " +
509						"attempted to call method '" + options + "'" );
510				}
511				if ( !$.isFunction( instance[options] ) || options.charAt( 0 ) === "_" ) {
512					return $.error( "no such method '" + options + "' for " + name + " widget instance" );
513				}
514				methodValue = instance[ options ].apply( instance, args );
515				if ( methodValue !== instance && methodValue !== undefined ) {
516					returnValue = methodValue && methodValue.jquery ?
517						returnValue.pushStack( methodValue.get() ) :
518						methodValue;
519					return false;
520				}
521			});
522		} else {
523
524			// Allow multiple hashes to be passed on init
525			if ( args.length ) {
526				options = $.widget.extend.apply( null, [ options ].concat(args) );
527			}
528
529			this.each(function() {
530				var instance = $.data( this, fullName );
531				if ( instance ) {
532					instance.option( options || {} );
533					if ( instance._init ) {
534						instance._init();
535					}
536				} else {
537					$.data( this, fullName, new object( options, this ) );
538				}
539			});
540		}
541
542		return returnValue;
543	};
544};
545
546$.Widget = function( /* options, element */ ) {};
547$.Widget._childConstructors = [];
548
549$.Widget.prototype = {
550	widgetName: "widget",
551	widgetEventPrefix: "",
552	defaultElement: "<div>",
553	options: {
554		disabled: false,
555
556		// callbacks
557		create: null
558	},
559	_createWidget: function( options, element ) {
560		element = $( element || this.defaultElement || this )[ 0 ];
561		this.element = $( element );
562		this.uuid = widget_uuid++;
563		this.eventNamespace = "." + this.widgetName + this.uuid;
564
565		this.bindings = $();
566		this.hoverable = $();
567		this.focusable = $();
568
569		if ( element !== this ) {
570			$.data( element, this.widgetFullName, this );
571			this._on( true, this.element, {
572				remove: function( event ) {
573					if ( event.target === element ) {
574						this.destroy();
575					}
576				}
577			});
578			this.document = $( element.style ?
579				// element within the document
580				element.ownerDocument :
581				// element is window or document
582				element.document || element );
583			this.window = $( this.document[0].defaultView || this.document[0].parentWindow );
584		}
585
586		this.options = $.widget.extend( {},
587			this.options,
588			this._getCreateOptions(),
589			options );
590
591		this._create();
592		this._trigger( "create", null, this._getCreateEventData() );
593		this._init();
594	},
595	_getCreateOptions: $.noop,
596	_getCreateEventData: $.noop,
597	_create: $.noop,
598	_init: $.noop,
599
600	destroy: function() {
601		this._destroy();
602		// we can probably remove the unbind calls in 2.0
603		// all event bindings should go through this._on()
604		this.element
605			.unbind( this.eventNamespace )
606			.removeData( this.widgetFullName )
607			// support: jquery <1.6.3
608			// http://bugs.jquery.com/ticket/9413
609			.removeData( $.camelCase( this.widgetFullName ) );
610		this.widget()
611			.unbind( this.eventNamespace )
612			.removeAttr( "aria-disabled" )
613			.removeClass(
614				this.widgetFullName + "-disabled " +
615				"ui-state-disabled" );
616
617		// clean up events and states
618		this.bindings.unbind( this.eventNamespace );
619		this.hoverable.removeClass( "ui-state-hover" );
620		this.focusable.removeClass( "ui-state-focus" );
621	},
622	_destroy: $.noop,
623
624	widget: function() {
625		return this.element;
626	},
627
628	option: function( key, value ) {
629		var options = key,
630			parts,
631			curOption,
632			i;
633
634		if ( arguments.length === 0 ) {
635			// don't return a reference to the internal hash
636			return $.widget.extend( {}, this.options );
637		}
638
639		if ( typeof key === "string" ) {
640			// handle nested keys, e.g., "foo.bar" => { foo: { bar: ___ } }
641			options = {};
642			parts = key.split( "." );
643			key = parts.shift();
644			if ( parts.length ) {
645				curOption = options[ key ] = $.widget.extend( {}, this.options[ key ] );
646				for ( i = 0; i < parts.length - 1; i++ ) {
647					curOption[ parts[ i ] ] = curOption[ parts[ i ] ] || {};
648					curOption = curOption[ parts[ i ] ];
649				}
650				key = parts.pop();
651				if ( arguments.length === 1 ) {
652					return curOption[ key ] === undefined ? null : curOption[ key ];
653				}
654				curOption[ key ] = value;
655			} else {
656				if ( arguments.length === 1 ) {
657					return this.options[ key ] === undefined ? null : this.options[ key ];
658				}
659				options[ key ] = value;
660			}
661		}
662
663		this._setOptions( options );
664
665		return this;
666	},
667	_setOptions: function( options ) {
668		var key;
669
670		for ( key in options ) {
671			this._setOption( key, options[ key ] );
672		}
673
674		return this;
675	},
676	_setOption: function( key, value ) {
677		this.options[ key ] = value;
678
679		if ( key === "disabled" ) {
680			this.widget()
681				.toggleClass( this.widgetFullName + "-disabled", !!value );
682
683			// If the widget is becoming disabled, then nothing is interactive
684			if ( value ) {
685				this.hoverable.removeClass( "ui-state-hover" );
686				this.focusable.removeClass( "ui-state-focus" );
687			}
688		}
689
690		return this;
691	},
692
693	enable: function() {
694		return this._setOptions({ disabled: false });
695	},
696	disable: function() {
697		return this._setOptions({ disabled: true });
698	},
699
700	_on: function( suppressDisabledCheck, element, handlers ) {
701		var delegateElement,
702			instance = this;
703
704		// no suppressDisabledCheck flag, shuffle arguments
705		if ( typeof suppressDisabledCheck !== "boolean" ) {
706			handlers = element;
707			element = suppressDisabledCheck;
708			suppressDisabledCheck = false;
709		}
710
711		// no element argument, shuffle and use this.element
712		if ( !handlers ) {
713			handlers = element;
714			element = this.element;
715			delegateElement = this.widget();
716		} else {
717			element = delegateElement = $( element );
718			this.bindings = this.bindings.add( element );
719		}
720
721		$.each( handlers, function( event, handler ) {
722			function handlerProxy() {
723				// allow widgets to customize the disabled handling
724				// - disabled as an array instead of boolean
725				// - disabled class as method for disabling individual parts
726				if ( !suppressDisabledCheck &&
727						( instance.options.disabled === true ||
728							$( this ).hasClass( "ui-state-disabled" ) ) ) {
729					return;
730				}
731				return ( typeof handler === "string" ? instance[ handler ] : handler )
732					.apply( instance, arguments );
733			}
734
735			// copy the guid so direct unbinding works
736			if ( typeof handler !== "string" ) {
737				handlerProxy.guid = handler.guid =
738					handler.guid || handlerProxy.guid || $.guid++;
739			}
740
741			var match = event.match( /^([\w:-]*)\s*(.*)$/ ),
742				eventName = match[1] + instance.eventNamespace,
743				selector = match[2];
744			if ( selector ) {
745				delegateElement.delegate( selector, eventName, handlerProxy );
746			} else {
747				element.bind( eventName, handlerProxy );
748			}
749		});
750	},
751
752	_off: function( element, eventName ) {
753		eventName = (eventName || "").split( " " ).join( this.eventNamespace + " " ) +
754			this.eventNamespace;
755		element.unbind( eventName ).undelegate( eventName );
756
757		// Clear the stack to avoid memory leaks (#10056)
758		this.bindings = $( this.bindings.not( element ).get() );
759		this.focusable = $( this.focusable.not( element ).get() );
760		this.hoverable = $( this.hoverable.not( element ).get() );
761	},
762
763	_delay: function( handler, delay ) {
764		function handlerProxy() {
765			return ( typeof handler === "string" ? instance[ handler ] : handler )
766				.apply( instance, arguments );
767		}
768		var instance = this;
769		return setTimeout( handlerProxy, delay || 0 );
770	},
771
772	_hoverable: function( element ) {
773		this.hoverable = this.hoverable.add( element );
774		this._on( element, {
775			mouseenter: function( event ) {
776				$( event.currentTarget ).addClass( "ui-state-hover" );
777			},
778			mouseleave: function( event ) {
779				$( event.currentTarget ).removeClass( "ui-state-hover" );
780			}
781		});
782	},
783
784	_focusable: function( element ) {
785		this.focusable = this.focusable.add( element );
786		this._on( element, {
787			focusin: function( event ) {
788				$( event.currentTarget ).addClass( "ui-state-focus" );
789			},
790			focusout: function( event ) {
791				$( event.currentTarget ).removeClass( "ui-state-focus" );
792			}
793		});
794	},
795
796	_trigger: function( type, event, data ) {
797		var prop, orig,
798			callback = this.options[ type ];
799
800		data = data || {};
801		event = $.Event( event );
802		event.type = ( type === this.widgetEventPrefix ?
803			type :
804			this.widgetEventPrefix + type ).toLowerCase();
805		// the original event may come from any element
806		// so we need to reset the target on the new event
807		event.target = this.element[ 0 ];
808
809		// copy original event properties over to the new event
810		orig = event.originalEvent;
811		if ( orig ) {
812			for ( prop in orig ) {
813				if ( !( prop in event ) ) {
814					event[ prop ] = orig[ prop ];
815				}
816			}
817		}
818
819		this.element.trigger( event, data );
820		return !( $.isFunction( callback ) &&
821			callback.apply( this.element[0], [ event ].concat( data ) ) === false ||
822			event.isDefaultPrevented() );
823	}
824};
825
826$.each( { show: "fadeIn", hide: "fadeOut" }, function( method, defaultEffect ) {
827	$.Widget.prototype[ "_" + method ] = function( element, options, callback ) {
828		if ( typeof options === "string" ) {
829			options = { effect: options };
830		}
831		var hasOptions,
832			effectName = !options ?
833				method :
834				options === true || typeof options === "number" ?
835					defaultEffect :
836					options.effect || defaultEffect;
837		options = options || {};
838		if ( typeof options === "number" ) {
839			options = { duration: options };
840		}
841		hasOptions = !$.isEmptyObject( options );
842		options.complete = callback;
843		if ( options.delay ) {
844			element.delay( options.delay );
845		}
846		if ( hasOptions && $.effects && $.effects.effect[ effectName ] ) {
847			element[ method ]( options );
848		} else if ( effectName !== method && element[ effectName ] ) {
849			element[ effectName ]( options.duration, options.easing, callback );
850		} else {
851			element.queue(function( next ) {
852				$( this )[ method ]();
853				if ( callback ) {
854					callback.call( element[ 0 ] );
855				}
856				next();
857			});
858		}
859	};
860});
861
862var widget = $.widget;
863
864
865/*!
866 * jQuery UI Mouse 1.11.4
867 * http://jqueryui.com
868 *
869 * Copyright jQuery Foundation and other contributors
870 * Released under the MIT license.
871 * http://jquery.org/license
872 *
873 * http://api.jqueryui.com/mouse/
874 */
875
876
877var mouseHandled = false;
878$( document ).mouseup( function() {
879	mouseHandled = false;
880});
881
882var mouse = $.widget("ui.mouse", {
883	version: "1.11.4",
884	options: {
885		cancel: "input,textarea,button,select,option",
886		distance: 1,
887		delay: 0
888	},
889	_mouseInit: function() {
890		var that = this;
891
892		this.element
893			.bind("mousedown." + this.widgetName, function(event) {
894				return that._mouseDown(event);
895			})
896			.bind("click." + this.widgetName, function(event) {
897				if (true === $.data(event.target, that.widgetName + ".preventClickEvent")) {
898					$.removeData(event.target, that.widgetName + ".preventClickEvent");
899					event.stopImmediatePropagation();
900					return false;
901				}
902			});
903
904		this.started = false;
905	},
906
907	// TODO: make sure destroying one instance of mouse doesn't mess with
908	// other instances of mouse
909	_mouseDestroy: function() {
910		this.element.unbind("." + this.widgetName);
911		if ( this._mouseMoveDelegate ) {
912			this.document
913				.unbind("mousemove." + this.widgetName, this._mouseMoveDelegate)
914				.unbind("mouseup." + this.widgetName, this._mouseUpDelegate);
915		}
916	},
917
918	_mouseDown: function(event) {
919		// don't let more than one widget handle mouseStart
920		if ( mouseHandled ) {
921			return;
922		}
923
924		this._mouseMoved = false;
925
926		// we may have missed mouseup (out of window)
927		(this._mouseStarted && this._mouseUp(event));
928
929		this._mouseDownEvent = event;
930
931		var that = this,
932			btnIsLeft = (event.which === 1),
933			// event.target.nodeName works around a bug in IE 8 with
934			// disabled inputs (#7620)
935			elIsCancel = (typeof this.options.cancel === "string" && event.target.nodeName ? $(event.target).closest(this.options.cancel).length : false);
936		if (!btnIsLeft || elIsCancel || !this._mouseCapture(event)) {
937			return true;
938		}
939
940		this.mouseDelayMet = !this.options.delay;
941		if (!this.mouseDelayMet) {
942			this._mouseDelayTimer = setTimeout(function() {
943				that.mouseDelayMet = true;
944			}, this.options.delay);
945		}
946
947		if (this._mouseDistanceMet(event) && this._mouseDelayMet(event)) {
948			this._mouseStarted = (this._mouseStart(event) !== false);
949			if (!this._mouseStarted) {
950				event.preventDefault();
951				return true;
952			}
953		}
954
955		// Click event may never have fired (Gecko & Opera)
956		if (true === $.data(event.target, this.widgetName + ".preventClickEvent")) {
957			$.removeData(event.target, this.widgetName + ".preventClickEvent");
958		}
959
960		// these delegates are required to keep context
961		this._mouseMoveDelegate = function(event) {
962			return that._mouseMove(event);
963		};
964		this._mouseUpDelegate = function(event) {
965			return that._mouseUp(event);
966		};
967
968		this.document
969			.bind( "mousemove." + this.widgetName, this._mouseMoveDelegate )
970			.bind( "mouseup." + this.widgetName, this._mouseUpDelegate );
971
972		event.preventDefault();
973
974		mouseHandled = true;
975		return true;
976	},
977
978	_mouseMove: function(event) {
979		// Only check for mouseups outside the document if you've moved inside the document
980		// at least once. This prevents the firing of mouseup in the case of IE<9, which will
981		// fire a mousemove event if content is placed under the cursor. See #7778
982		// Support: IE <9
983		if ( this._mouseMoved ) {
984			// IE mouseup check - mouseup happened when mouse was out of window
985			if ($.ui.ie && ( !document.documentMode || document.documentMode < 9 ) && !event.button) {
986				return this._mouseUp(event);
987
988			// Iframe mouseup check - mouseup occurred in another document
989			} else if ( !event.which ) {
990				return this._mouseUp( event );
991			}
992		}
993
994		if ( event.which || event.button ) {
995			this._mouseMoved = true;
996		}
997
998		if (this._mouseStarted) {
999			this._mouseDrag(event);
1000			return event.preventDefault();
1001		}
1002
1003		if (this._mouseDistanceMet(event) && this._mouseDelayMet(event)) {
1004			this._mouseStarted =
1005				(this._mouseStart(this._mouseDownEvent, event) !== false);
1006			(this._mouseStarted ? this._mouseDrag(event) : this._mouseUp(event));
1007		}
1008
1009		return !this._mouseStarted;
1010	},
1011
1012	_mouseUp: function(event) {
1013		this.document
1014			.unbind( "mousemove." + this.widgetName, this._mouseMoveDelegate )
1015			.unbind( "mouseup." + this.widgetName, this._mouseUpDelegate );
1016
1017		if (this._mouseStarted) {
1018			this._mouseStarted = false;
1019
1020			if (event.target === this._mouseDownEvent.target) {
1021				$.data(event.target, this.widgetName + ".preventClickEvent", true);
1022			}
1023
1024			this._mouseStop(event);
1025		}
1026
1027		mouseHandled = false;
1028		return false;
1029	},
1030
1031	_mouseDistanceMet: function(event) {
1032		return (Math.max(
1033				Math.abs(this._mouseDownEvent.pageX - event.pageX),
1034				Math.abs(this._mouseDownEvent.pageY - event.pageY)
1035			) >= this.options.distance
1036		);
1037	},
1038
1039	_mouseDelayMet: function(/* event */) {
1040		return this.mouseDelayMet;
1041	},
1042
1043	// These are placeholder methods, to be overriden by extending plugin
1044	_mouseStart: function(/* event */) {},
1045	_mouseDrag: function(/* event */) {},
1046	_mouseStop: function(/* event */) {},
1047	_mouseCapture: function(/* event */) { return true; }
1048});
1049
1050
1051/*!
1052 * jQuery UI Position 1.11.4
1053 * http://jqueryui.com
1054 *
1055 * Copyright jQuery Foundation and other contributors
1056 * Released under the MIT license.
1057 * http://jquery.org/license
1058 *
1059 * http://api.jqueryui.com/position/
1060 */
1061
1062(function() {
1063
1064$.ui = $.ui || {};
1065
1066var cachedScrollbarWidth, supportsOffsetFractions,
1067	max = Math.max,
1068	abs = Math.abs,
1069	round = Math.round,
1070	rhorizontal = /left|center|right/,
1071	rvertical = /top|center|bottom/,
1072	roffset = /[\+\-]\d+(\.[\d]+)?%?/,
1073	rposition = /^\w+/,
1074	rpercent = /%$/,
1075	_position = $.fn.position;
1076
1077function getOffsets( offsets, width, height ) {
1078	return [
1079		parseFloat( offsets[ 0 ] ) * ( rpercent.test( offsets[ 0 ] ) ? width / 100 : 1 ),
1080		parseFloat( offsets[ 1 ] ) * ( rpercent.test( offsets[ 1 ] ) ? height / 100 : 1 )
1081	];
1082}
1083
1084function parseCss( element, property ) {
1085	return parseInt( $.css( element, property ), 10 ) || 0;
1086}
1087
1088function getDimensions( elem ) {
1089	var raw = elem[0];
1090	if ( raw.nodeType === 9 ) {
1091		return {
1092			width: elem.width(),
1093			height: elem.height(),
1094			offset: { top: 0, left: 0 }
1095		};
1096	}
1097	if ( $.isWindow( raw ) ) {
1098		return {
1099			width: elem.width(),
1100			height: elem.height(),
1101			offset: { top: elem.scrollTop(), left: elem.scrollLeft() }
1102		};
1103	}
1104	if ( raw.preventDefault ) {
1105		return {
1106			width: 0,
1107			height: 0,
1108			offset: { top: raw.pageY, left: raw.pageX }
1109		};
1110	}
1111	return {
1112		width: elem.outerWidth(),
1113		height: elem.outerHeight(),
1114		offset: elem.offset()
1115	};
1116}
1117
1118$.position = {
1119	scrollbarWidth: function() {
1120		if ( cachedScrollbarWidth !== undefined ) {
1121			return cachedScrollbarWidth;
1122		}
1123		var w1, w2,
1124			div = $( "<div style='display:block;position:absolute;width:50px;height:50px;overflow:hidden;'><div style='height:100px;width:auto;'></div></div>" ),
1125			innerDiv = div.children()[0];
1126
1127		$( "body" ).append( div );
1128		w1 = innerDiv.offsetWidth;
1129		div.css( "overflow", "scroll" );
1130
1131		w2 = innerDiv.offsetWidth;
1132
1133		if ( w1 === w2 ) {
1134			w2 = div[0].clientWidth;
1135		}
1136
1137		div.remove();
1138
1139		return (cachedScrollbarWidth = w1 - w2);
1140	},
1141	getScrollInfo: function( within ) {
1142		var overflowX = within.isWindow || within.isDocument ? "" :
1143				within.element.css( "overflow-x" ),
1144			overflowY = within.isWindow || within.isDocument ? "" :
1145				within.element.css( "overflow-y" ),
1146			hasOverflowX = overflowX === "scroll" ||
1147				( overflowX === "auto" && within.width < within.element[0].scrollWidth ),
1148			hasOverflowY = overflowY === "scroll" ||
1149				( overflowY === "auto" && within.height < within.element[0].scrollHeight );
1150		return {
1151			width: hasOverflowY ? $.position.scrollbarWidth() : 0,
1152			height: hasOverflowX ? $.position.scrollbarWidth() : 0
1153		};
1154	},
1155	getWithinInfo: function( element ) {
1156		var withinElement = $( element || window ),
1157			isWindow = $.isWindow( withinElement[0] ),
1158			isDocument = !!withinElement[ 0 ] && withinElement[ 0 ].nodeType === 9;
1159		return {
1160			element: withinElement,
1161			isWindow: isWindow,
1162			isDocument: isDocument,
1163			offset: withinElement.offset() || { left: 0, top: 0 },
1164			scrollLeft: withinElement.scrollLeft(),
1165			scrollTop: withinElement.scrollTop(),
1166
1167			// support: jQuery 1.6.x
1168			// jQuery 1.6 doesn't support .outerWidth/Height() on documents or windows
1169			width: isWindow || isDocument ? withinElement.width() : withinElement.outerWidth(),
1170			height: isWindow || isDocument ? withinElement.height() : withinElement.outerHeight()
1171		};
1172	}
1173};
1174
1175$.fn.position = function( options ) {
1176	if ( !options || !options.of ) {
1177		return _position.apply( this, arguments );
1178	}
1179
1180	// make a copy, we don't want to modify arguments
1181	options = $.extend( {}, options );
1182
1183	var atOffset, targetWidth, targetHeight, targetOffset, basePosition, dimensions,
1184		target = $( options.of ),
1185		within = $.position.getWithinInfo( options.within ),
1186		scrollInfo = $.position.getScrollInfo( within ),
1187		collision = ( options.collision || "flip" ).split( " " ),
1188		offsets = {};
1189
1190	dimensions = getDimensions( target );
1191	if ( target[0].preventDefault ) {
1192		// force left top to allow flipping
1193		options.at = "left top";
1194	}
1195	targetWidth = dimensions.width;
1196	targetHeight = dimensions.height;
1197	targetOffset = dimensions.offset;
1198	// clone to reuse original targetOffset later
1199	basePosition = $.extend( {}, targetOffset );
1200
1201	// force my and at to have valid horizontal and vertical positions
1202	// if a value is missing or invalid, it will be converted to center
1203	$.each( [ "my", "at" ], function() {
1204		var pos = ( options[ this ] || "" ).split( " " ),
1205			horizontalOffset,
1206			verticalOffset;
1207
1208		if ( pos.length === 1) {
1209			pos = rhorizontal.test( pos[ 0 ] ) ?
vendor: 9,546 bytes, lines 1210-1491
1210				pos.concat( [ "center" ] ) :
1211				rvertical.test( pos[ 0 ] ) ?
1212					[ "center" ].concat( pos ) :
1213					[ "center", "center" ];
1214		}
1215		pos[ 0 ] = rhorizontal.test( pos[ 0 ] ) ? pos[ 0 ] : "center";
1216		pos[ 1 ] = rvertical.test( pos[ 1 ] ) ? pos[ 1 ] : "center";
1217
1218		// calculate offsets
1219		horizontalOffset = roffset.exec( pos[ 0 ] );
1220		verticalOffset = roffset.exec( pos[ 1 ] );
1221		offsets[ this ] = [
1222			horizontalOffset ? horizontalOffset[ 0 ] : 0,
1223			verticalOffset ? verticalOffset[ 0 ] : 0
1224		];
1225
1226		// reduce to just the positions without the offsets
1227		options[ this ] = [
1228			rposition.exec( pos[ 0 ] )[ 0 ],
1229			rposition.exec( pos[ 1 ] )[ 0 ]
1230		];
1231	});
1232
1233	// normalize collision option
1234	if ( collision.length === 1 ) {
1235		collision[ 1 ] = collision[ 0 ];
1236	}
1237
1238	if ( options.at[ 0 ] === "right" ) {
1239		basePosition.left += targetWidth;
1240	} else if ( options.at[ 0 ] === "center" ) {
1241		basePosition.left += targetWidth / 2;
1242	}
1243
1244	if ( options.at[ 1 ] === "bottom" ) {
1245		basePosition.top += targetHeight;
1246	} else if ( options.at[ 1 ] === "center" ) {
1247		basePosition.top += targetHeight / 2;
1248	}
1249
1250	atOffset = getOffsets( offsets.at, targetWidth, targetHeight );
1251	basePosition.left += atOffset[ 0 ];
1252	basePosition.top += atOffset[ 1 ];
1253
1254	return this.each(function() {
1255		var collisionPosition, using,
1256			elem = $( this ),
1257			elemWidth = elem.outerWidth(),
1258			elemHeight = elem.outerHeight(),
1259			marginLeft = parseCss( this, "marginLeft" ),
1260			marginTop = parseCss( this, "marginTop" ),
1261			collisionWidth = elemWidth + marginLeft + parseCss( this, "marginRight" ) + scrollInfo.width,
1262			collisionHeight = elemHeight + marginTop + parseCss( this, "marginBottom" ) + scrollInfo.height,
1263			position = $.extend( {}, basePosition ),
1264			myOffset = getOffsets( offsets.my, elem.outerWidth(), elem.outerHeight() );
1265
1266		if ( options.my[ 0 ] === "right" ) {
1267			position.left -= elemWidth;
1268		} else if ( options.my[ 0 ] === "center" ) {
1269			position.left -= elemWidth / 2;
1270		}
1271
1272		if ( options.my[ 1 ] === "bottom" ) {
1273			position.top -= elemHeight;
1274		} else if ( options.my[ 1 ] === "center" ) {
1275			position.top -= elemHeight / 2;
1276		}
1277
1278		position.left += myOffset[ 0 ];
1279		position.top += myOffset[ 1 ];
1280
1281		// if the browser doesn't support fractions, then round for consistent results
1282		if ( !supportsOffsetFractions ) {
1283			position.left = round( position.left );
1284			position.top = round( position.top );
1285		}
1286
1287		collisionPosition = {
1288			marginLeft: marginLeft,
1289			marginTop: marginTop
1290		};
1291
1292		$.each( [ "left", "top" ], function( i, dir ) {
1293			if ( $.ui.position[ collision[ i ] ] ) {
1294				$.ui.position[ collision[ i ] ][ dir ]( position, {
1295					targetWidth: targetWidth,
1296					targetHeight: targetHeight,
1297					elemWidth: elemWidth,
1298					elemHeight: elemHeight,
1299					collisionPosition: collisionPosition,
1300					collisionWidth: collisionWidth,
1301					collisionHeight: collisionHeight,
1302					offset: [ atOffset[ 0 ] + myOffset[ 0 ], atOffset [ 1 ] + myOffset[ 1 ] ],
1303					my: options.my,
1304					at: options.at,
1305					within: within,
1306					elem: elem
1307				});
1308			}
1309		});
1310
1311		if ( options.using ) {
1312			// adds feedback as second argument to using callback, if present
1313			using = function( props ) {
1314				var left = targetOffset.left - position.left,
1315					right = left + targetWidth - elemWidth,
1316					top = targetOffset.top - position.top,
1317					bottom = top + targetHeight - elemHeight,
1318					feedback = {
1319						target: {
1320							element: target,
1321							left: targetOffset.left,
1322							top: targetOffset.top,
1323							width: targetWidth,
1324							height: targetHeight
1325						},
1326						element: {
1327							element: elem,
1328							left: position.left,
1329							top: position.top,
1330							width: elemWidth,
1331							height: elemHeight
1332						},
1333						horizontal: right < 0 ? "left" : left > 0 ? "right" : "center",
1334						vertical: bottom < 0 ? "top" : top > 0 ? "bottom" : "middle"
1335					};
1336				if ( targetWidth < elemWidth && abs( left + right ) < targetWidth ) {
1337					feedback.horizontal = "center";
1338				}
1339				if ( targetHeight < elemHeight && abs( top + bottom ) < targetHeight ) {
1340					feedback.vertical = "middle";
1341				}
1342				if ( max( abs( left ), abs( right ) ) > max( abs( top ), abs( bottom ) ) ) {
1343					feedback.important = "horizontal";
1344				} else {
1345					feedback.important = "vertical";
1346				}
1347				options.using.call( this, props, feedback );
1348			};
1349		}
1350
1351		elem.offset( $.extend( position, { using: using } ) );
1352	});
1353};
1354
1355$.ui.position = {
1356	fit: {
1357		left: function( position, data ) {
1358			var within = data.within,
1359				withinOffset = within.isWindow ? within.scrollLeft : within.offset.left,
1360				outerWidth = within.width,
1361				collisionPosLeft = position.left - data.collisionPosition.marginLeft,
1362				overLeft = withinOffset - collisionPosLeft,
1363				overRight = collisionPosLeft + data.collisionWidth - outerWidth - withinOffset,
1364				newOverRight;
1365
1366			// element is wider than within
1367			if ( data.collisionWidth > outerWidth ) {
1368				// element is initially over the left side of within
1369				if ( overLeft > 0 && overRight <= 0 ) {
1370					newOverRight = position.left + overLeft + data.collisionWidth - outerWidth - withinOffset;
1371					position.left += overLeft - newOverRight;
1372				// element is initially over right side of within
1373				} else if ( overRight > 0 && overLeft <= 0 ) {
1374					position.left = withinOffset;
1375				// element is initially over both left and right sides of within
1376				} else {
1377					if ( overLeft > overRight ) {
1378						position.left = withinOffset + outerWidth - data.collisionWidth;
1379					} else {
1380						position.left = withinOffset;
1381					}
1382				}
1383			// too far left -> align with left edge
1384			} else if ( overLeft > 0 ) {
1385				position.left += overLeft;
1386			// too far right -> align with right edge
1387			} else if ( overRight > 0 ) {
1388				position.left -= overRight;
1389			// adjust based on position and margin
1390			} else {
1391				position.left = max( position.left - collisionPosLeft, position.left );
1392			}
1393		},
1394		top: function( position, data ) {
1395			var within = data.within,
1396				withinOffset = within.isWindow ? within.scrollTop : within.offset.top,
1397				outerHeight = data.within.height,
1398				collisionPosTop = position.top - data.collisionPosition.marginTop,
1399				overTop = withinOffset - collisionPosTop,
1400				overBottom = collisionPosTop + data.collisionHeight - outerHeight - withinOffset,
1401				newOverBottom;
1402
1403			// element is taller than within
1404			if ( data.collisionHeight > outerHeight ) {
1405				// element is initially over the top of within
1406				if ( overTop > 0 && overBottom <= 0 ) {
1407					newOverBottom = position.top + overTop + data.collisionHeight - outerHeight - withinOffset;
1408					position.top += overTop - newOverBottom;
1409				// element is initially over bottom of within
1410				} else if ( overBottom > 0 && overTop <= 0 ) {
1411					position.top = withinOffset;
1412				// element is initially over both top and bottom of within
1413				} else {
1414					if ( overTop > overBottom ) {
1415						position.top = withinOffset + outerHeight - data.collisionHeight;
1416					} else {
1417						position.top = withinOffset;
1418					}
1419				}
1420			// too far up -> align with top
1421			} else if ( overTop > 0 ) {
1422				position.top += overTop;
1423			// too far down -> align with bottom edge
1424			} else if ( overBottom > 0 ) {
1425				position.top -= overBottom;
1426			// adjust based on position and margin
1427			} else {
1428				position.top = max( position.top - collisionPosTop, position.top );
1429			}
1430		}
1431	},
1432	flip: {
1433		left: function( position, data ) {
1434			var within = data.within,
1435				withinOffset = within.offset.left + within.scrollLeft,
1436				outerWidth = within.width,
1437				offsetLeft = within.isWindow ? within.scrollLeft : within.offset.left,
1438				collisionPosLeft = position.left - data.collisionPosition.marginLeft,
1439				overLeft = collisionPosLeft - offsetLeft,
1440				overRight = collisionPosLeft + data.collisionWidth - outerWidth - offsetLeft,
1441				myOffset = data.my[ 0 ] === "left" ?
1442					-data.elemWidth :
1443					data.my[ 0 ] === "right" ?
1444						data.elemWidth :
1445						0,
1446				atOffset = data.at[ 0 ] === "left" ?
1447					data.targetWidth :
1448					data.at[ 0 ] === "right" ?
1449						-data.targetWidth :
1450						0,
1451				offset = -2 * data.offset[ 0 ],
1452				newOverRight,
1453				newOverLeft;
1454
1455			if ( overLeft < 0 ) {
1456				newOverRight = position.left + myOffset + atOffset + offset + data.collisionWidth - outerWidth - withinOffset;
1457				if ( newOverRight < 0 || newOverRight < abs( overLeft ) ) {
1458					position.left += myOffset + atOffset + offset;
1459				}
1460			} else if ( overRight > 0 ) {
1461				newOverLeft = position.left - data.collisionPosition.marginLeft + myOffset + atOffset + offset - offsetLeft;
1462				if ( newOverLeft > 0 || abs( newOverLeft ) < overRight ) {
1463					position.left += myOffset + atOffset + offset;
1464				}
1465			}
1466		},
1467		top: function( position, data ) {
1468			var within = data.within,
1469				withinOffset = within.offset.top + within.scrollTop,
1470				outerHeight = within.height,
1471				offsetTop = within.isWindow ? within.scrollTop : within.offset.top,
1472				collisionPosTop = position.top - data.collisionPosition.marginTop,
1473				overTop = collisionPosTop - offsetTop,
1474				overBottom = collisionPosTop + data.collisionHeight - outerHeight - offsetTop,
1475				top = data.my[ 1 ] === "top",
1476				myOffset = top ?
1477					-data.elemHeight :
1478					data.my[ 1 ] === "bottom" ?
1479						data.elemHeight :
1480						0,
1481				atOffset = data.at[ 1 ] === "top" ?
1482					data.targetHeight :
1483					data.at[ 1 ] === "bottom" ?
1484						-data.targetHeight :
1485						0,
1486				offset = -2 * data.offset[ 1 ],
1487				newOverTop,
1488				newOverBottom;
1489			if ( overTop < 0 ) {
1490				newOverBottom = position.top + myOffset + atOffset + offset + data.collisionHeight - outerHeight - withinOffset;
1491				if ( 
vendor: 1,789 bytes, lines 1491-1555
1491newOverBottom < 0 || newOverBottom < abs( overTop ) ) {
1492					position.top += myOffset + atOffset + offset;
1493				}
1494			} else if ( overBottom > 0 ) {
1495				newOverTop = position.top - data.collisionPosition.marginTop + myOffset + atOffset + offset - offsetTop;
1496				if ( newOverTop > 0 || abs( newOverTop ) < overBottom ) {
1497					position.top += myOffset + atOffset + offset;
1498				}
1499			}
1500		}
1501	},
1502	flipfit: {
1503		left: function() {
1504			$.ui.position.flip.left.apply( this, arguments );
1505			$.ui.position.fit.left.apply( this, arguments );
1506		},
1507		top: function() {
1508			$.ui.position.flip.top.apply( this, arguments );
1509			$.ui.position.fit.top.apply( this, arguments );
1510		}
1511	}
1512};
1513
1514// fraction support test
1515(function() {
1516	var testElement, testElementParent, testElementStyle, offsetLeft, i,
1517		body = document.getElementsByTagName( "body" )[ 0 ],
1518		div = document.createElement( "div" );
1519
1520	//Create a "fake body" for testing based on method used in jQuery.support
1521	testElement = document.createElement( body ? "div" : "body" );
1522	testElementStyle = {
1523		visibility: "hidden",
1524		width: 0,
1525		height: 0,
1526		border: 0,
1527		margin: 0,
1528		background: "none"
1529	};
1530	if ( body ) {
1531		$.extend( testElementStyle, {
1532			position: "absolute",
1533			left: "-1000px",
1534			top: "-1000px"
1535		});
1536	}
1537	for ( i in testElementStyle ) {
1538		testElement.style[ i ] = testElementStyle[ i ];
1539	}
1540	testElement.appendChild( div );
1541	testElementParent = body || document.documentElement;
1542	testElementParent.insertBefore( testElement, testElementParent.firstChild );
1543
1544	div.style.cssText = "position: absolute; left: 10.7432222px;";
1545
1546	offsetLeft = $( div ).offset().left;
1547	supportsOffsetFractions = offsetLeft > 10 && offsetLeft < 11;
1548
1549	testElement.innerHTML = "";
1550	testElementParent.removeChild( testElement );
1551})();
1552
1553})();
1554
1555var position = $.ui.position
vendor: 74,430 bytes, lines 1555-4210
1555;
1556
1557
1558/*!
1559 * jQuery UI Draggable 1.11.4
1560 * http://jqueryui.com
1561 *
1562 * Copyright jQuery Foundation and other contributors
1563 * Released under the MIT license.
1564 * http://jquery.org/license
1565 *
1566 * http://api.jqueryui.com/draggable/
1567 */
1568
1569
1570$.widget("ui.draggable", $.ui.mouse, {
1571	version: "1.11.4",
1572	widgetEventPrefix: "drag",
1573	options: {
1574		addClasses: true,
1575		appendTo: "parent",
1576		axis: false,
1577		connectToSortable: false,
1578		containment: false,
1579		cursor: "auto",
1580		cursorAt: false,
1581		grid: false,
1582		handle: false,
1583		helper: "original",
1584		iframeFix: false,
1585		opacity: false,
1586		refreshPositions: false,
1587		revert: false,
1588		revertDuration: 500,
1589		scope: "default",
1590		scroll: true,
1591		scrollSensitivity: 20,
1592		scrollSpeed: 20,
1593		snap: false,
1594		snapMode: "both",
1595		snapTolerance: 20,
1596		stack: false,
1597		zIndex: false,
1598
1599		// callbacks
1600		drag: null,
1601		start: null,
1602		stop: null
1603	},
1604	_create: function() {
1605
1606		if ( this.options.helper === "original" ) {
1607			this._setPositionRelative();
1608		}
1609		if (this.options.addClasses){
1610			this.element.addClass("ui-draggable");
1611		}
1612		if (this.options.disabled){
1613			this.element.addClass("ui-draggable-disabled");
1614		}
1615		this._setHandleClassName();
1616
1617		this._mouseInit();
1618	},
1619
1620	_setOption: function( key, value ) {
1621		this._super( key, value );
1622		if ( key === "handle" ) {
1623			this._removeHandleClassName();
1624			this._setHandleClassName();
1625		}
1626	},
1627
1628	_destroy: function() {
1629		if ( ( this.helper || this.element ).is( ".ui-draggable-dragging" ) ) {
1630			this.destroyOnClear = true;
1631			return;
1632		}
1633		this.element.removeClass( "ui-draggable ui-draggable-dragging ui-draggable-disabled" );
1634		this._removeHandleClassName();
1635		this._mouseDestroy();
1636	},
1637
1638	_mouseCapture: function(event) {
1639		var o = this.options;
1640
1641		this._blurActiveElement( event );
1642
1643		// among others, prevent a drag on a resizable-handle
1644		if (this.helper || o.disabled || $(event.target).closest(".ui-resizable-handle").length > 0) {
1645			return false;
1646		}
1647
1648		//Quit if we're not on a valid handle
1649		this.handle = this._getHandle(event);
1650		if (!this.handle) {
1651			return false;
1652		}
1653
1654		this._blockFrames( o.iframeFix === true ? "iframe" : o.iframeFix );
1655
1656		return true;
1657
1658	},
1659
1660	_blockFrames: function( selector ) {
1661		this.iframeBlocks = this.document.find( selector ).map(function() {
1662			var iframe = $( this );
1663
1664			return $( "<div>" )
1665				.css( "position", "absolute" )
1666				.appendTo( iframe.parent() )
1667				.outerWidth( iframe.outerWidth() )
1668				.outerHeight( iframe.outerHeight() )
1669				.offset( iframe.offset() )[ 0 ];
1670		});
1671	},
1672
1673	_unblockFrames: function() {
1674		if ( this.iframeBlocks ) {
1675			this.iframeBlocks.remove();
1676			delete this.iframeBlocks;
1677		}
1678	},
1679
1680	_blurActiveElement: function( event ) {
1681		var document = this.document[ 0 ];
1682
1683		// Only need to blur if the event occurred on the draggable itself, see #10527
1684		if ( !this.handleElement.is( event.target ) ) {
1685			return;
1686		}
1687
1688		// support: IE9
1689		// IE9 throws an "Unspecified error" accessing document.activeElement from an <iframe>
1690		try {
1691
1692			// Support: IE9, IE10
1693			// If the <body> is blurred, IE will switch windows, see #9520
1694			if ( document.activeElement && document.activeElement.nodeName.toLowerCase() !== "body" ) {
1695
1696				// Blur any element that currently has focus, see #4261
1697				$( document.activeElement ).blur();
1698			}
1699		} catch ( error ) {}
1700	},
1701
1702	_mouseStart: function(event) {
1703
1704		var o = this.options;
1705
1706		//Create and append the visible helper
1707		this.helper = this._createHelper(event);
1708
1709		this.helper.addClass("ui-draggable-dragging");
1710
1711		//Cache the helper size
1712		this._cacheHelperProportions();
1713
1714		//If ddmanager is used for droppables, set the global draggable
1715		if ($.ui.ddmanager) {
1716			$.ui.ddmanager.current = this;
1717		}
1718
1719		/*
1720		 * - Position generation -
1721		 * This block generates everything position related - it's the core of draggables.
1722		 */
1723
1724		//Cache the margins of the original element
1725		this._cacheMargins();
1726
1727		//Store the helper's css position
1728		this.cssPosition = this.helper.css( "position" );
1729		this.scrollParent = this.helper.scrollParent( true );
1730		this.offsetParent = this.helper.offsetParent();
1731		this.hasFixedAncestor = this.helper.parents().filter(function() {
1732				return $( this ).css( "position" ) === "fixed";
1733			}).length > 0;
1734
1735		//The element's absolute position on the page minus margins
1736		this.positionAbs = this.element.offset();
1737		this._refreshOffsets( event );
1738
1739		//Generate the original position
1740		this.originalPosition = this.position = this._generatePosition( event, false );
1741		this.originalPageX = event.pageX;
1742		this.originalPageY = event.pageY;
1743
1744		//Adjust the mouse offset relative to the helper if "cursorAt" is supplied
1745		(o.cursorAt && this._adjustOffsetFromHelper(o.cursorAt));
1746
1747		//Set a containment if given in the options
1748		this._setContainment();
1749
1750		//Trigger event + callbacks
1751		if (this._trigger("start", event) === false) {
1752			this._clear();
1753			return false;
1754		}
1755
1756		//Recache the helper size
1757		this._cacheHelperProportions();
1758
1759		//Prepare the droppable offsets
1760		if ($.ui.ddmanager && !o.dropBehaviour) {
1761			$.ui.ddmanager.prepareOffsets(this, event);
1762		}
1763
1764		// Reset helper's right/bottom css if they're set and set explicit width/height instead
1765		// as this prevents resizing of elements with right/bottom set (see #7772)
1766		this._normalizeRightBottom();
1767
1768		this._mouseDrag(event, true); //Execute the drag once - this causes the helper not to be visible before getting its correct position
1769
1770		//If the ddmanager is used for droppables, inform the manager that dragging has started (see #5003)
1771		if ( $.ui.ddmanager ) {
1772			$.ui.ddmanager.dragStart(this, event);
1773		}
1774
1775		return true;
1776	},
1777
1778	_refreshOffsets: function( event ) {
1779		this.offset = {
1780			top: this.positionAbs.top - this.margins.top,
1781			left: this.positionAbs.left - this.margins.left,
1782			scroll: false,
1783			parent: this._getParentOffset(),
1784			relative: this._getRelativeOffset()
1785		};
1786
1787		this.offset.click = {
1788			left: event.pageX - this.offset.left,
1789			top: event.pageY - this.offset.top
1790		};
1791	},
1792
1793	_mouseDrag: function(event, noPropagation) {
1794		// reset any necessary cached properties (see #5009)
1795		if ( this.hasFixedAncestor ) {
1796			this.offset.parent = this._getParentOffset();
1797		}
1798
1799		//Compute the helpers position
1800		this.position = this._generatePosition( event, true );
1801		this.positionAbs = this._convertPositionTo("absolute");
1802
1803		//Call plugins and callbacks and use the resulting position if something is returned
1804		if (!noPropagation) {
1805			var ui = this._uiHash();
1806			if (this._trigger("drag", event, ui) === false) {
1807				this._mouseUp({});
1808				return false;
1809			}
1810			this.position = ui.position;
1811		}
1812
1813		this.helper[ 0 ].style.left = this.position.left + "px";
1814		this.helper[ 0 ].style.top = this.position.top + "px";
1815
1816		if ($.ui.ddmanager) {
1817			$.ui.ddmanager.drag(this, event);
1818		}
1819
1820		return false;
1821	},
1822
1823	_mouseStop: function(event) {
1824
1825		//If we are using droppables, inform the manager about the drop
1826		var that = this,
1827			dropped = false;
1828		if ($.ui.ddmanager && !this.options.dropBehaviour) {
1829			dropped = $.ui.ddmanager.drop(this, event);
1830		}
1831
1832		//if a drop comes from outside (a sortable)
1833		if (this.dropped) {
1834			dropped = this.dropped;
1835			this.dropped = false;
1836		}
1837
1838		if ((this.options.revert === "invalid" && !dropped) || (this.options.revert === "valid" && dropped) || this.options.revert === true || ($.isFunction(this.options.revert) && this.options.revert.call(this.element, dropped))) {
1839			$(this.helper).animate(this.originalPosition, parseInt(this.options.revertDuration, 10), function() {
1840				if (that._trigger("stop", event) !== false) {
1841					that._clear();
1842				}
1843			});
1844		} else {
1845			if (this._trigger("stop", event) !== false) {
1846				this._clear();
1847			}
1848		}
1849
1850		return false;
1851	},
1852
1853	_mouseUp: function( event ) {
1854		this._unblockFrames();
1855
1856		//If the ddmanager is used for droppables, inform the manager that dragging has stopped (see #5003)
1857		if ( $.ui.ddmanager ) {
1858			$.ui.ddmanager.dragStop(this, event);
1859		}
1860
1861		// Only need to focus if the event occurred on the draggable itself, see #10527
1862		if ( this.handleElement.is( event.target ) ) {
1863			// The interaction is over; whether or not the click resulted in a drag, focus the element
1864			this.element.focus();
1865		}
1866
1867		return $.ui.mouse.prototype._mouseUp.call(this, event);
1868	},
1869
1870	cancel: function() {
1871
1872		if (this.helper.is(".ui-draggable-dragging")) {
1873			this._mouseUp({});
1874		} else {
1875			this._clear();
1876		}
1877
1878		return this;
1879
1880	},
1881
1882	_getHandle: function(event) {
1883		return this.options.handle ?
1884			!!$( event.target ).closest( this.element.find( this.options.handle ) ).length :
1885			true;
1886	},
1887
1888	_setHandleClassName: function() {
1889		this.handleElement = this.options.handle ?
1890			this.element.find( this.options.handle ) : this.element;
1891		this.handleElement.addClass( "ui-draggable-handle" );
1892	},
1893
1894	_removeHandleClassName: function() {
1895		this.handleElement.removeClass( "ui-draggable-handle" );
1896	},
1897
1898	_createHelper: function(event) {
1899
1900		var o = this.options,
1901			helperIsFunction = $.isFunction( o.helper ),
1902			helper = helperIsFunction ?
1903				$( o.helper.apply( this.element[ 0 ], [ event ] ) ) :
1904				( o.helper === "clone" ?
1905					this.element.clone().removeAttr( "id" ) :
1906					this.element );
1907
1908		if (!helper.parents("body").length) {
1909			helper.appendTo((o.appendTo === "parent" ? this.element[0].parentNode : o.appendTo));
1910		}
1911
1912		// http://bugs.jqueryui.com/ticket/9446
1913		// a helper function can return the original element
1914		// which wouldn't have been set to relative in _create
1915		if ( helperIsFunction && helper[ 0 ] === this.element[ 0 ] ) {
1916			this._setPositionRelative();
1917		}
1918
1919		if (helper[0] !== this.element[0] && !(/(fixed|absolute)/).test(helper.css("position"))) {
1920			helper.css("position", "absolute");
1921		}
1922
1923		return helper;
1924
1925	},
1926
1927	_setPositionRelative: function() {
1928		if ( !( /^(?:r|a|f)/ ).test( this.element.css( "position" ) ) ) {
1929			this.element[ 0 ].style.position = "relative";
1930		}
1931	},
1932
1933	_adjustOffsetFromHelper: function(obj) {
1934		if (typeof obj === "string") {
1935			obj = obj.split(" ");
1936		}
1937		if ($.isArray(obj)) {
1938			obj = { left: +obj[0], top: +obj[1] || 0 };
1939		}
1940		if ("left" in obj) {
1941			this.offset.click.left = obj.left + this.margins.left;
1942		}
1943		if ("right" in obj) {
1944			this.offset.click.left = this.helperProportions.width - obj.right + this.margins.left;
1945		}
1946		if ("top" in obj) {
1947			this.offset.click.top = obj.top + this.margins.top;
1948		}
1949		if ("bottom" in obj) {
1950			this.offset.click.top = this.helperProportions.height - obj.bottom + this.margins.top;
1951		}
1952	},
1953
1954	_isRootNode: function( element ) {
1955		return ( /(html|body)/i ).test( element.tagName ) || element === this.document[ 0 ];
1956	},
1957
1958	_getParentOffset: function() {
1959
1960		//Get the offsetParent and cache its position
1961		var po = this.offsetParent.offset(),
1962			document = this.document[ 0 ];
1963
1964		// This is a special case where we need to modify a offset calculated on start, since the following happened:
1965		// 1. The position of the helper is absolute, so it's position is calculated based on the next positioned parent
1966		// 2. The actual offset parent is a child of the scroll parent, and the scroll parent isn't the document, which means that
1967		//    the scroll is included in the initial calculation of the offset of the parent, and never recalculated upon drag
1968		if (this.cssPosition === "absolute" && this.scrollParent[0] !== document && $.contains(this.scrollParent[0], this.offsetParent[0])) {
1969			po.left += this.scrollParent.scrollLeft();
1970			po.top += this.scrollParent.scrollTop();
1971		}
1972
1973		if ( this._isRootNode( this.offsetParent[ 0 ] ) ) {
1974			po = { top: 0, left: 0 };
1975		}
1976
1977		return {
1978			top: po.top + (parseInt(this.offsetParent.css("borderTopWidth"), 10) || 0),
1979			left: po.left + (parseInt(this.offsetParent.css("borderLeftWidth"), 10) || 0)
1980		};
1981
1982	},
1983
1984	_getRelativeOffset: function() {
1985		if ( this.cssPosition !== "relative" ) {
1986			return { top: 0, left: 0 };
1987		}
1988
1989		var p = this.element.position(),
1990			scrollIsRootNode = this._isRootNode( this.scrollParent[ 0 ] );
1991
1992		return {
1993			top: p.top - ( parseInt(this.helper.css( "top" ), 10) || 0 ) + ( !scrollIsRootNode ? this.scrollParent.scrollTop() : 0 ),
1994			left: p.left - ( parseInt(this.helper.css( "left" ), 10) || 0 ) + ( !scrollIsRootNode ? this.scrollParent.scrollLeft() : 0 )
1995		};
1996
1997	},
1998
1999	_cacheMargins: function() {
2000		this.margins = {
2001			left: (parseInt(this.element.css("marginLeft"), 10) || 0),
2002			top: (parseInt(this.element.css("marginTop"), 10) || 0),
2003			right: (parseInt(this.element.css("marginRight"), 10) || 0),
2004			bottom: (parseInt(this.element.css("marginBottom"), 10) || 0)
2005		};
2006	},
2007
2008	_cacheHelperProportions: function() {
2009		this.helperProportions = {
2010			width: this.helper.outerWidth(),
2011			height: this.helper.outerHeight()
2012		};
2013	},
2014
2015	_setContainment: function() {
2016
2017		var isUserScrollable, c, ce,
2018			o = this.options,
2019			document = this.document[ 0 ];
2020
2021		this.relativeContainer = null;
2022
2023		if ( !o.containment ) {
2024			this.containment = null;
2025			return;
2026		}
2027
2028		if ( o.containment === "window" ) {
2029			this.containment = [
2030				$( window ).scrollLeft() - this.offset.relative.left - this.offset.parent.left,
2031				$( window ).scrollTop() - this.offset.relative.top - this.offset.parent.top,
2032				$( window ).scrollLeft() + $( window ).width() - this.helperProportions.width - this.margins.left,
2033				$( window ).scrollTop() + ( $( window ).height() || document.body.parentNode.scrollHeight ) - this.helperProportions.height - this.margins.top
2034			];
2035			return;
2036		}
2037
2038		if ( o.containment === "document") {
2039			this.containment = [
2040				0,
2041				0,
2042				$( document ).width() - this.helperProportions.width - this.margins.left,
2043				( $( document ).height() || document.body.parentNode.scrollHeight ) - this.helperProportions.height - this.margins.top
2044			];
2045			return;
2046		}
2047
2048		if ( o.containment.constructor === Array ) {
2049			this.containment = o.containment;
2050			return;
2051		}
2052
2053		if ( o.containment === "parent" ) {
2054			o.containment = this.helper[ 0 ].parentNode;
2055		}
2056
2057		c = $( o.containment );
2058		ce = c[ 0 ];
2059
2060		if ( !ce ) {
2061			return;
2062		}
2063
2064		isUserScrollable = /(scroll|auto)/.test( c.css( "overflow" ) );
2065
2066		this.containment = [
2067			( parseInt( c.css( "borderLeftWidth" ), 10 ) || 0 ) + ( parseInt( c.css( "paddingLeft" ), 10 ) || 0 ),
2068			( parseInt( c.css( "borderTopWidth" ), 10 ) || 0 ) + ( parseInt( c.css( "paddingTop" ), 10 ) || 0 ),
2069			( isUserScrollable ? Math.max( ce.scrollWidth, ce.offsetWidth ) : ce.offsetWidth ) -
2070				( parseInt( c.css( "borderRightWidth" ), 10 ) || 0 ) -
2071				( parseInt( c.css( "paddingRight" ), 10 ) || 0 ) -
2072				this.helperProportions.width -
2073				this.margins.left -
2074				this.margins.right,
2075			( isUserScrollable ? Math.max( ce.scrollHeight, ce.offsetHeight ) : ce.offsetHeight ) -
2076				( parseInt( c.css( "borderBottomWidth" ), 10 ) || 0 ) -
2077				( parseInt( c.css( "paddingBottom" ), 10 ) || 0 ) -
2078				this.helperProportions.height -
2079				this.margins.top -
2080				this.margins.bottom
2081		];
2082		this.relativeContainer = c;
2083	},
2084
2085	_convertPositionTo: function(d, pos) {
2086
2087		if (!pos) {
2088			pos = this.position;
2089		}
2090
2091		var mod = d === "absolute" ? 1 : -1,
2092			scrollIsRootNode = this._isRootNode( this.scrollParent[ 0 ] );
2093
2094		return {
2095			top: (
2096				pos.top	+																// The absolute mouse position
2097				this.offset.relative.top * mod +										// Only for relative positioned nodes: Relative offset from element to offset parent
2098				this.offset.parent.top * mod -										// The offsetParent's offset without borders (offset + border)
2099				( ( this.cssPosition === "fixed" ? -this.offset.scroll.top : ( scrollIsRootNode ? 0 : this.offset.scroll.top ) ) * mod)
2100			),
2101			left: (
2102				pos.left +																// The absolute mouse position
2103				this.offset.relative.left * mod +										// Only for relative positioned nodes: Relative offset from element to offset parent
2104				this.offset.parent.left * mod	-										// The offsetParent's offset without borders (offset + border)
2105				( ( this.cssPosition === "fixed" ? -this.offset.scroll.left : ( scrollIsRootNode ? 0 : this.offset.scroll.left ) ) * mod)
2106			)
2107		};
2108
2109	},
2110
2111	_generatePosition: function( event, constrainPosition ) {
2112
2113		var containment, co, top, left,
2114			o = this.options,
2115			scrollIsRootNode = this._isRootNode( this.scrollParent[ 0 ] ),
2116			pageX = event.pageX,
2117			pageY = event.pageY;
2118
2119		// Cache the scroll
2120		if ( !scrollIsRootNode || !this.offset.scroll ) {
2121			this.offset.scroll = {
2122				top: this.scrollParent.scrollTop(),
2123				left: this.scrollParent.scrollLeft()
2124			};
2125		}
2126
2127		/*
2128		 * - Position constraining -
2129		 * Constrain the position to a mix of grid, containment.
2130		 */
2131
2132		// If we are not dragging yet, we won't check for options
2133		if ( constrainPosition ) {
2134			if ( this.containment ) {
2135				if ( this.relativeContainer ){
2136					co = this.relativeContainer.offset();
2137					containment = [
2138						this.containment[ 0 ] + co.left,
2139						this.containment[ 1 ] + co.top,
2140						this.containment[ 2 ] + co.left,
2141						this.containment[ 3 ] + co.top
2142					];
2143				} else {
2144					containment = this.containment;
2145				}
2146
2147				if (event.pageX - this.offset.click.left < containment[0]) {
2148					pageX = containment[0] + this.offset.click.left;
2149				}
2150				if (event.pageY - this.offset.click.top < containment[1]) {
2151					pageY = containment[1] + this.offset.click.top;
2152				}
2153				if (event.pageX - this.offset.click.left > containment[2]) {
2154					pageX = containment[2] + this.offset.click.left;
2155				}
2156				if (event.pageY - this.offset.click.top > containment[3]) {
2157					pageY = containment[3] + this.offset.click.top;
2158				}
2159			}
2160
2161			if (o.grid) {
2162				//Check for grid elements set to 0 to prevent divide by 0 error causing invalid argument errors in IE (see ticket #6950)
2163				top = o.grid[1] ? this.originalPageY + Math.round((pageY - this.originalPageY) / o.grid[1]) * o.grid[1] : this.originalPageY;
2164				pageY = containment ? ((top - this.offset.click.top >= containment[1] || top - this.offset.click.top > containment[3]) ? top : ((top - this.offset.click.top >= containment[1]) ? top - o.grid[1] : top + o.grid[1])) : top;
2165
2166				left = o.grid[0] ? this.originalPageX + Math.round((pageX - this.originalPageX) / o.grid[0]) * o.grid[0] : this.originalPageX;
2167				pageX = containment ? ((left - this.offset.click.left >= containment[0] || left - this.offset.click.left > containment[2]) ? left : ((left - this.offset.click.left >= containment[0]) ? left - o.grid[0] : left + o.grid[0])) : left;
2168			}
2169
2170			if ( o.axis === "y" ) {
2171				pageX = this.originalPageX;
2172			}
2173
2174			if ( o.axis === "x" ) {
2175				pageY = this.originalPageY;
2176			}
2177		}
2178
2179		return {
2180			top: (
2181				pageY -																	// The absolute mouse position
2182				this.offset.click.top	-												// Click offset (relative to the element)
2183				this.offset.relative.top -												// Only for relative positioned nodes: Relative offset from element to offset parent
2184				this.offset.parent.top +												// The offsetParent's offset without borders (offset + border)
2185				( this.cssPosition === "fixed" ? -this.offset.scroll.top : ( scrollIsRootNode ? 0 : this.offset.scroll.top ) )
2186			),
2187			left: (
2188				pageX -																	// The absolute mouse position
2189				this.offset.click.left -												// Click offset (relative to the element)
2190				this.offset.relative.left -												// Only for relative positioned nodes: Relative offset from element to offset parent
2191				this.offset.parent.left +												// The offsetParent's offset without borders (offset + border)
2192				( this.cssPosition === "fixed" ? -this.offset.scroll.left : ( scrollIsRootNode ? 0 : this.offset.scroll.left ) )
2193			)
2194		};
2195
2196	},
2197
2198	_clear: function() {
2199		this.helper.removeClass("ui-draggable-dragging");
2200		if (this.helper[0] !== this.element[0] && !this.cancelHelperRemoval) {
2201			this.helper.remove();
2202		}
2203		this.helper = null;
2204		this.cancelHelperRemoval = false;
2205		if ( this.destroyOnClear ) {
2206			this.destroy();
2207		}
2208	},
2209
2210	_normalizeRightBottom: function() {
2211		if ( this.options.axis !== "y" && this.helper.css( "right" ) !== "auto" ) {
2212			this.helper.width( this.helper.width() );
2213			this.helper.css( "right", "auto" );
2214		}
2215		if ( this.options.axis !== "x" && this.helper.css( "bottom" ) !== "auto" ) {
2216			this.helper.height( this.helper.height() );
2217			this.helper.css( "bottom", "auto" );
2218		}
2219	},
2220
2221	// From now on bulk stuff - mainly helpers
2222
2223	_trigger: function( type, event, ui ) {
2224		ui = ui || this._uiHash();
2225		$.ui.plugin.call( this, type, [ event, ui, this ], true );
2226
2227		// Absolute position and offset (see #6884 ) have to be recalculated after plugins
2228		if ( /^(drag|start|stop)/.test( type ) ) {
2229			this.positionAbs = this._convertPositionTo( "absolute" );
2230			ui.offset = this.positionAbs;
2231		}
2232		return $.Widget.prototype._trigger.call( this, type, event, ui );
2233	},
2234
2235	plugins: {},
2236
2237	_uiHash: function() {
2238		return {
2239			helper: this.helper,
2240			position: this.position,
2241			originalPosition: this.originalPosition,
2242			offset: this.positionAbs
2243		};
2244	}
2245
2246});
2247
2248$.ui.plugin.add( "draggable", "connectToSortable", {
2249	start: function( event, ui, draggable ) {
2250		var uiSortable = $.extend( {}, ui, {
2251			item: draggable.element
2252		});
2253
2254		draggable.sortables = [];
2255		$( draggable.options.connectToSortable ).each(function() {
2256			var sortable = $( this ).sortable( "instance" );
2257
2258			if ( sortable && !sortable.options.disabled ) {
2259				draggable.sortables.push( sortable );
2260
2261				// refreshPositions is called at drag start to refresh the containerCache
2262				// which is used in drag. This ensures it's initialized and synchronized
2263				// with any changes that might have happened on the page since initialization.
2264				sortable.refreshPositions();
2265				sortable._trigger("activate", event, uiSortable);
2266			}
2267		});
2268	},
2269	stop: function( event, ui, draggable ) {
2270		var uiSortable = $.extend( {}, ui, {
2271			item: draggable.element
2272		});
2273
2274		draggable.cancelHelperRemoval = false;
2275
2276		$.each( draggable.sortables, function() {
2277			var sortable = this;
2278
2279			if ( sortable.isOver ) {
2280				sortable.isOver = 0;
2281
2282				// Allow this sortable to handle removing the helper
2283				draggable.cancelHelperRemoval = true;
2284				sortable.cancelHelperRemoval = false;
2285
2286				// Use _storedCSS To restore properties in the sortable,
2287				// as this also handles revert (#9675) since the draggable
2288				// may have modified them in unexpected ways (#8809)
2289				sortable._storedCSS = {
2290					position: sortable.placeholder.css( "position" ),
2291					top: sortable.placeholder.css( "top" ),
2292					left: sortable.placeholder.css( "left" )
2293				};
2294
2295				sortable._mouseStop(event);
2296
2297				// Once drag has ended, the sortable should return to using
2298				// its original helper, not the shared helper from draggable
2299				sortable.options.helper = sortable.options._helper;
2300			} else {
2301				// Prevent this Sortable from removing the helper.
2302				// However, don't set the draggable to remove the helper
2303				// either as another connected Sortable may yet handle the removal.
2304				sortable.cancelHelperRemoval = true;
2305
2306				sortable._trigger( "deactivate", event, uiSortable );
2307			}
2308		});
2309	},
2310	drag: function( event, ui, draggable ) {
2311		$.each( draggable.sortables, function() {
2312			var innermostIntersecting = false,
2313				sortable = this;
2314
2315			// Copy over variables that sortable's _intersectsWith uses
2316			sortable.positionAbs = draggable.positionAbs;
2317			sortable.helperProportions = draggable.helperProportions;
2318			sortable.offset.click = draggable.offset.click;
2319
2320			if ( sortable._intersectsWith( sortable.containerCache ) ) {
2321				innermostIntersecting = true;
2322
2323				$.each( draggable.sortables, function() {
2324					// Copy over variables that sortable's _intersectsWith uses
2325					this.positionAbs = draggable.positionAbs;
2326					this.helperProportions = draggable.helperProportions;
2327					this.offset.click = draggable.offset.click;
2328
2329					if ( this !== sortable &&
2330							this._intersectsWith( this.containerCache ) &&
2331							$.contains( sortable.element[ 0 ], this.element[ 0 ] ) ) {
2332						innermostIntersecting = false;
2333					}
2334
2335					return innermostIntersecting;
2336				});
2337			}
2338
2339			if ( innermostIntersecting ) {
2340				// If it intersects, we use a little isOver variable and set it once,
2341				// so that the move-in stuff gets fired only once.
2342				if ( !sortable.isOver ) {
2343					sortable.isOver = 1;
2344
2345					// Store draggable's parent in case we need to reappend to it later.
2346					draggable._parent = ui.helper.parent();
2347
2348					sortable.currentItem = ui.helper
2349						.appendTo( sortable.element )
2350						.data( "ui-sortable-item", true );
2351
2352					// Store helper option to later restore it
2353					sortable.options._helper = sortable.options.helper;
2354
2355					sortable.options.helper = function() {
2356						return ui.helper[ 0 ];
2357					};
2358
2359					// Fire the start events of the sortable with our passed browser event,
2360					// and our own helper (so it doesn't create a new one)
2361					event.target = sortable.currentItem[ 0 ];
2362					sortable._mouseCapture( event, true );
2363					sortable._mouseStart( event, true, true );
2364
2365					// Because the browser event is way off the new appended portlet,
2366					// modify necessary variables to reflect the changes
2367					sortable.offset.click.top = draggable.offset.click.top;
2368					sortable.offset.click.left = draggable.offset.click.left;
2369					sortable.offset.parent.left -= draggable.offset.parent.left -
2370						sortable.offset.parent.left;
2371					sortable.offset.parent.top -= draggable.offset.parent.top -
2372						sortable.offset.parent.top;
2373
2374					draggable._trigger( "toSortable", event );
2375
2376					// Inform draggable that the helper is in a valid drop zone,
2377					// used solely in the revert option to handle "valid/invalid".
2378					draggable.dropped = sortable.element;
2379
2380					// Need to refreshPositions of all sortables in the case that
2381					// adding to one sortable changes the location of the other sortables (#9675)
2382					$.each( draggable.sortables, function() {
2383						this.refreshPositions();
2384					});
2385
2386					// hack so receive/update callbacks work (mostly)
2387					draggable.currentItem = draggable.element;
2388					sortable.fromOutside = draggable;
2389				}
2390
2391				if ( sortable.currentItem ) {
2392					sortable._mouseDrag( event );
2393					// Copy the sortable's position because the draggable's can potentially reflect
2394					// a relative position, while sortable is always absolute, which the dragged
2395					// element has now become. (#8809)
2396					ui.position = sortable.position;
2397				}
2398			} else {
2399				// If it doesn't intersect with the sortable, and it intersected before,
2400				// we fake the drag stop of the sortable, but make sure it doesn't remove
2401				// the helper by using cancelHelperRemoval.
2402				if ( sortable.isOver ) {
2403
2404					sortable.isOver = 0;
2405					sortable.cancelHelperRemoval = true;
2406
2407					// Calling sortable's mouseStop would trigger a revert,
2408					// so revert must be temporarily false until after mouseStop is called.
2409					sortable.options._revert = sortable.options.revert;
2410					sortable.options.revert = false;
2411
2412					sortable._trigger( "out", event, sortable._uiHash( sortable ) );
2413					sortable._mouseStop( event, true );
2414
2415					// restore sortable behaviors that were modfied
2416					// when the draggable entered the sortable area (#9481)
2417					sortable.options.revert = sortable.options._revert;
2418					sortable.options.helper = sortable.options._helper;
2419
2420					if ( sortable.placeholder ) {
2421						sortable.placeholder.remove();
2422					}
2423
2424					// Restore and recalculate the draggable's offset considering the sortable
2425					// may have modified them in unexpected ways. (#8809, #10669)
2426					ui.helper.appendTo( draggable._parent );
2427					draggable._refreshOffsets( event );
2428					ui.position = draggable._generatePosition( event, true );
2429
2430					draggable._trigger( "fromSortable", event );
2431
2432					// Inform draggable that the helper is no longer in a valid drop zone
2433					draggable.dropped = false;
2434
2435					// Need to refreshPositions of all sortables just in case removing
2436					// from one sortable changes the location of other sortables (#9675)
2437					$.each( draggable.sortables, function() {
2438						this.refreshPositions();
2439					});
2440				}
2441			}
2442		});
2443	}
2444});
2445
2446$.ui.plugin.add("draggable", "cursor", {
2447	start: function( event, ui, instance ) {
2448		var t = $( "body" ),
2449			o = instance.options;
2450
2451		if (t.css("cursor")) {
2452			o._cursor = t.css("cursor");
2453		}
2454		t.css("cursor", o.cursor);
2455	},
2456	stop: function( event, ui, instance ) {
2457		var o = instance.options;
2458		if (o._cursor) {
2459			$("body").css("cursor", o._cursor);
2460		}
2461	}
2462});
2463
2464$.ui.plugin.add("draggable", "opacity", {
2465	start: function( event, ui, instance ) {
2466		var t = $( ui.helper ),
2467			o = instance.options;
2468		if (t.css("opacity")) {
2469			o._opacity = t.css("opacity");
2470		}
2471		t.css("opacity", o.opacity);
2472	},
2473	stop: function( event, ui, instance ) {
2474		var o = instance.options;
2475		if (o._opacity) {
2476			$(ui.helper).css("opacity", o._opacity);
2477		}
2478	}
2479});
2480
2481$.ui.plugin.add("draggable", "scroll", {
2482	start: function( event, ui, i ) {
2483		if ( !i.scrollParentNotHidden ) {
2484			i.scrollParentNotHidden = i.helper.scrollParent( false );
2485		}
2486
2487		if ( i.scrollParentNotHidden[ 0 ] !== i.document[ 0 ] && i.scrollParentNotHidden[ 0 ].tagName !== "HTML" ) {
2488			i.overflowOffset = i.scrollParentNotHidden.offset();
2489		}
2490	},
2491	drag: function( event, ui, i  ) {
2492
2493		var o = i.options,
2494			scrolled = false,
2495			scrollParent = i.scrollParentNotHidden[ 0 ],
2496			document = i.document[ 0 ];
2497
2498		if ( scrollParent !== document && scrollParent.tagName !== "HTML" ) {
2499			if ( !o.axis || o.axis !== "x" ) {
2500				if ( ( i.overflowOffset.top + scrollParent.offsetHeight ) - event.pageY < o.scrollSensitivity ) {
2501					scrollParent.scrollTop = scrolled = scrollParent.scrollTop + o.scrollSpeed;
2502				} else if ( event.pageY - i.overflowOffset.top < o.scrollSensitivity ) {
2503					scrollParent.scrollTop = scrolled = scrollParent.scrollTop - o.scrollSpeed;
2504				}
2505			}
2506
2507			if ( !o.axis || o.axis !== "y" ) {
2508				if ( ( i.overflowOffset.left + scrollParent.offsetWidth ) - event.pageX < o.scrollSensitivity ) {
2509					scrollParent.scrollLeft = scrolled = scrollParent.scrollLeft + o.scrollSpeed;
2510				} else if ( event.pageX - i.overflowOffset.left < o.scrollSensitivity ) {
2511					scrollParent.scrollLeft = scrolled = scrollParent.scrollLeft - o.scrollSpeed;
2512				}
2513			}
2514
2515		} else {
2516
2517			if (!o.axis || o.axis !== "x") {
2518				if (event.pageY - $(document).scrollTop() < o.scrollSensitivity) {
2519					scrolled = $(document).scrollTop($(document).scrollTop() - o.scrollSpeed);
2520				} else if ($(window).height() - (event.pageY - $(document).scrollTop()) < o.scrollSensitivity) {
2521					scrolled = $(document).scrollTop($(document).scrollTop() + o.scrollSpeed);
2522				}
2523			}
2524
2525			if (!o.axis || o.axis !== "y") {
2526				if (event.pageX - $(document).scrollLeft() < o.scrollSensitivity) {
2527					scrolled = $(document).scrollLeft($(document).scrollLeft() - o.scrollSpeed);
2528				} else if ($(window).width() - (event.pageX - $(document).scrollLeft()) < o.scrollSensitivity) {
2529					scrolled = $(document).scrollLeft($(document).scrollLeft() + o.scrollSpeed);
2530				}
2531			}
2532
2533		}
2534
2535		if (scrolled !== false && $.ui.ddmanager && !o.dropBehaviour) {
2536			$.ui.ddmanager.prepareOffsets(i, event);
2537		}
2538
2539	}
2540});
2541
2542$.ui.plugin.add("draggable", "snap", {
2543	start: function( event, ui, i ) {
2544
2545		var o = i.options;
2546
2547		i.snapElements = [];
2548
2549		$(o.snap.constructor !== String ? ( o.snap.items || ":data(ui-draggable)" ) : o.snap).each(function() {
2550			var $t = $(this),
2551				$o = $t.offset();
2552			if (this !== i.element[0]) {
2553				i.snapElements.push({
2554					item: this,
2555					width: $t.outerWidth(), height: $t.outerHeight(),
2556					top: $o.top, left: $o.left
2557				});
2558			}
2559		});
2560
2561	},
2562	drag: function( event, ui, inst ) {
2563
2564		var ts, bs, ls, rs, l, r, t, b, i, first,
2565			o = inst.options,
2566			d = o.snapTolerance,
2567			x1 = ui.offset.left, x2 = x1 + inst.helperProportions.width,
2568			y1 = ui.offset.top, y2 = y1 + inst.helperProportions.height;
2569
2570		for (i = inst.snapElements.length - 1; i >= 0; i--){
2571
2572			l = inst.snapElements[i].left - inst.margins.left;
2573			r = l + inst.snapElements[i].width;
2574			t = inst.snapElements[i].top - inst.margins.top;
2575			b = t + inst.snapElements[i].height;
2576
2577			if ( x2 < l - d || x1 > r + d || y2 < t - d || y1 > b + d || !$.contains( inst.snapElements[ i ].item.ownerDocument, inst.snapElements[ i ].item ) ) {
2578				if (inst.snapElements[i].snapping) {
2579					(inst.options.snap.release && inst.options.snap.release.call(inst.element, event, $.extend(inst._uiHash(), { snapItem: inst.snapElements[i].item })));
2580				}
2581				inst.snapElements[i].snapping = false;
2582				continue;
2583			}
2584
2585			if (o.snapMode !== "inner") {
2586				ts = Math.abs(t - y2) <= d;
2587				bs = Math.abs(b - y1) <= d;
2588				ls = Math.abs(l - x2) <= d;
2589				rs = Math.abs(r - x1) <= d;
2590				if (ts) {
2591					ui.position.top = inst._convertPositionTo("relative", { top: t - inst.helperProportions.height, left: 0 }).top;
2592				}
2593				if (bs) {
2594					ui.position.top = inst._convertPositionTo("relative", { top: b, left: 0 }).top;
2595				}
2596				if (ls) {
2597					ui.position.left = inst._convertPositionTo("relative", { top: 0, left: l - inst.helperProportions.width }).left;
2598				}
2599				if (rs) {
2600					ui.position.left = inst._convertPositionTo("relative", { top: 0, left: r }).left;
2601				}
2602			}
2603
2604			first = (ts || bs || ls || rs);
2605
2606			if (o.snapMode !== "outer") {
2607				ts = Math.abs(t - y1) <= d;
2608				bs = Math.abs(b - y2) <= d;
2609				ls = Math.abs(l - x1) <= d;
2610				rs = Math.abs(r - x2) <= d;
2611				if (ts) {
2612					ui.position.top = inst._convertPositionTo("relative", { top: t, left: 0 }).top;
2613				}
2614				if (bs) {
2615					ui.position.top = inst._convertPositionTo("relative", { top: b - inst.helperProportions.height, left: 0 }).top;
2616				}
2617				if (ls) {
2618					ui.position.left = inst._convertPositionTo("relative", { top: 0, left: l }).left;
2619				}
2620				if (rs) {
2621					ui.position.left = inst._convertPositionTo("relative", { top: 0, left: r - inst.helperProportions.width }).left;
2622				}
2623			}
2624
2625			if (!inst.snapElements[i].snapping && (ts || bs || ls || rs || first)) {
2626				(inst.options.snap.snap && inst.options.snap.snap.call(inst.element, event, $.extend(inst._uiHash(), { snapItem: inst.snapElements[i].item })));
2627			}
2628			inst.snapElements[i].snapping = (ts || bs || ls || rs || first);
2629
2630		}
2631
2632	}
2633});
2634
2635$.ui.plugin.add("draggable", "stack", {
2636	start: function( event, ui, instance ) {
2637		var min,
2638			o = instance.options,
2639			group = $.makeArray($(o.stack)).sort(function(a, b) {
2640				return (parseInt($(a).css("zIndex"), 10) || 0) - (parseInt($(b).css("zIndex"), 10) || 0);
2641			});
2642
2643		if (!group.length) { return; }
2644
2645		min = parseInt($(group[0]).css("zIndex"), 10) || 0;
2646		$(group).each(function(i) {
2647			$(this).css("zIndex", min + i);
2648		});
2649		this.css("zIndex", (min + group.length));
2650	}
2651});
2652
2653$.ui.plugin.add("draggable", "zIndex", {
2654	start: function( event, ui, instance ) {
2655		var t = $( ui.helper ),
2656			o = instance.options;
2657
2658		if (t.css("zIndex")) {
2659			o._zIndex = t.css("zIndex");
2660		}
2661		t.css("zIndex", o.zIndex);
2662	},
2663	stop: function( event, ui, instance ) {
2664		var o = instance.options;
2665
2666		if (o._zIndex) {
2667			$(ui.helper).css("zIndex", o._zIndex);
2668		}
2669	}
2670});
2671
2672var draggable = $.ui.draggable;
2673
2674
2675/*!
2676 * jQuery UI Droppable 1.11.4
2677 * http://jqueryui.com
2678 *
2679 * Copyright jQuery Foundation and other contributors
2680 * Released under the MIT license.
2681 * http://jquery.org/license
2682 *
2683 * http://api.jqueryui.com/droppable/
2684 */
2685
2686
2687$.widget( "ui.droppable", {
2688	version: "1.11.4",
2689	widgetEventPrefix: "drop",
2690	options: {
2691		accept: "*",
2692		activeClass: false,
2693		addClasses: true,
2694		greedy: false,
2695		hoverClass: false,
2696		scope: "default",
2697		tolerance: "intersect",
2698
2699		// callbacks
2700		activate: null,
2701		deactivate: null,
2702		drop: null,
2703		out: null,
2704		over: null
2705	},
2706	_create: function() {
2707
2708		var proportions,
2709			o = this.options,
2710			accept = o.accept;
2711
2712		this.isover = false;
2713		this.isout = true;
2714
2715		this.accept = $.isFunction( accept ) ? accept : function( d ) {
2716			return d.is( accept );
2717		};
2718
2719		this.proportions = function( /* valueToWrite */ ) {
2720			if ( arguments.length ) {
2721				// Store the droppable's proportions
2722				proportions = arguments[ 0 ];
2723			} else {
2724				// Retrieve or derive the droppable's proportions
2725				return proportions ?
2726					proportions :
2727					proportions = {
2728						width: this.element[ 0 ].offsetWidth,
2729						height: this.element[ 0 ].offsetHeight
2730					};
2731			}
2732		};
2733
2734		this._addToManager( o.scope );
2735
2736		o.addClasses && this.element.addClass( "ui-droppable" );
2737
2738	},
2739
2740	_addToManager: function( scope ) {
2741		// Add the reference and positions to the manager
2742		$.ui.ddmanager.droppables[ scope ] = $.ui.ddmanager.droppables[ scope ] || [];
2743		$.ui.ddmanager.droppables[ scope ].push( this );
2744	},
2745
2746	_splice: function( drop ) {
2747		var i = 0;
2748		for ( ; i < drop.length; i++ ) {
2749			if ( drop[ i ] === this ) {
2750				drop.splice( i, 1 );
2751			}
2752		}
2753	},
2754
2755	_destroy: function() {
2756		var drop = $.ui.ddmanager.droppables[ this.options.scope ];
2757
2758		this._splice( drop );
2759
2760		this.element.removeClass( "ui-droppable ui-droppable-disabled" );
2761	},
2762
2763	_setOption: function( key, value ) {
2764
2765		if ( key === "accept" ) {
2766			this.accept = $.isFunction( value ) ? value : function( d ) {
2767				return d.is( value );
2768			};
2769		} else if ( key === "scope" ) {
2770			var drop = $.ui.ddmanager.droppables[ this.options.scope ];
2771
2772			this._splice( drop );
2773			this._addToManager( value );
2774		}
2775
2776		this._super( key, value );
2777	},
2778
2779	_activate: function( event ) {
2780		var draggable = $.ui.ddmanager.current;
2781		if ( this.options.activeClass ) {
2782			this.element.addClass( this.options.activeClass );
2783		}
2784		if ( draggable ){
2785			this._trigger( "activate", event, this.ui( draggable ) );
2786		}
2787	},
2788
2789	_deactivate: function( event ) {
2790		var draggable = $.ui.ddmanager.current;
2791		if ( this.options.activeClass ) {
2792			this.element.removeClass( this.options.activeClass );
2793		}
2794		if ( draggable ){
2795			this._trigger( "deactivate", event, this.ui( draggable ) );
2796		}
2797	},
2798
2799	_over: function( event ) {
2800
2801		var draggable = $.ui.ddmanager.current;
2802
2803		// Bail if draggable and droppable are same element
2804		if ( !draggable || ( draggable.currentItem || draggable.element )[ 0 ] === this.element[ 0 ] ) {
2805			return;
2806		}
2807
2808		if ( this.accept.call( this.element[ 0 ], ( draggable.currentItem || draggable.element ) ) ) {
2809			if ( this.options.hoverClass ) {
2810				this.element.addClass( this.options.hoverClass );
2811			}
2812			this._trigger( "over", event, this.ui( draggable ) );
2813		}
2814
2815	},
2816
2817	_out: function( event ) {
2818
2819		var draggable = $.ui.ddmanager.current;
2820
2821		// Bail if draggable and droppable are same element
2822		if ( !draggable || ( draggable.currentItem || draggable.element )[ 0 ] === this.element[ 0 ] ) {
2823			return;
2824		}
2825
2826		if ( this.accept.call( this.element[ 0 ], ( draggable.currentItem || draggable.element ) ) ) {
2827			if ( this.options.hoverClass ) {
2828				this.element.removeClass( this.options.hoverClass );
2829			}
2830			this._trigger( "out", event, this.ui( draggable ) );
2831		}
2832
2833	},
2834
2835	_drop: function( event, custom ) {
2836
2837		var draggable = custom || $.ui.ddmanager.current,
2838			childrenIntersection = false;
2839
2840		// Bail if draggable and droppable are same element
2841		if ( !draggable || ( draggable.currentItem || draggable.element )[ 0 ] === this.element[ 0 ] ) {
2842			return false;
2843		}
2844
2845		this.element.find( ":data(ui-droppable)" ).not( ".ui-draggable-dragging" ).each(function() {
2846			var inst = $( this ).droppable( "instance" );
2847			if (
2848				inst.options.greedy &&
2849				!inst.options.disabled &&
2850				inst.options.scope === draggable.options.scope &&
2851				inst.accept.call( inst.element[ 0 ], ( draggable.currentItem || draggable.element ) ) &&
2852				$.ui.intersect( draggable, $.extend( inst, { offset: inst.element.offset() } ), inst.options.tolerance, event )
2853			) { childrenIntersection = true; return false; }
2854		});
2855		if ( childrenIntersection ) {
2856			return false;
2857		}
2858
2859		if ( this.accept.call( this.element[ 0 ], ( draggable.currentItem || draggable.element ) ) ) {
2860			if ( this.options.activeClass ) {
2861				this.element.removeClass( this.options.activeClass );
2862			}
2863			if ( this.options.hoverClass ) {
2864				this.element.removeClass( this.options.hoverClass );
2865			}
2866			this._trigger( "drop", event, this.ui( draggable ) );
2867			return this.element;
2868		}
2869
2870		return false;
2871
2872	},
2873
2874	ui: function( c ) {
2875		return {
2876			draggable: ( c.currentItem || c.element ),
2877			helper: c.helper,
2878			position: c.position,
2879			offset: c.positionAbs
2880		};
2881	}
2882
2883});
2884
2885$.ui.intersect = (function() {
2886	function isOverAxis( x, reference, size ) {
2887		return ( x >= reference ) && ( x < ( reference + size ) );
2888	}
2889
2890	return function( draggable, droppable, toleranceMode, event ) {
2891
2892		if ( !droppable.offset ) {
2893			return false;
2894		}
2895
2896		var x1 = ( draggable.positionAbs || draggable.position.absolute ).left + draggable.margins.left,
2897			y1 = ( draggable.positionAbs || draggable.position.absolute ).top + draggable.margins.top,
2898			x2 = x1 + draggable.helperProportions.width,
2899			y2 = y1 + draggable.helperProportions.height,
2900			l = droppable.offset.left,
2901			t = droppable.offset.top,
2902			r = l + droppable.proportions().width,
2903			b = t + droppable.proportions().height;
2904
2905		switch ( toleranceMode ) {
2906		case "fit":
2907			return ( l <= x1 && x2 <= r && t <= y1 && y2 <= b );
2908		case "intersect":
2909			return ( l < x1 + ( draggable.helperProportions.width / 2 ) && // Right Half
2910				x2 - ( draggable.helperProportions.width / 2 ) < r && // Left Half
2911				t < y1 + ( draggable.helperProportions.height / 2 ) && // Bottom Half
2912				y2 - ( draggable.helperProportions.height / 2 ) < b ); // Top Half
2913		case "pointer":
2914			return isOverAxis( event.pageY, t, droppable.proportions().height ) && isOverAxis( event.pageX, l, droppable.proportions().width );
2915		case "touch":
2916			return (
2917				( y1 >= t && y1 <= b ) || // Top edge touching
2918				( y2 >= t && y2 <= b ) || // Bottom edge touching
2919				( y1 < t && y2 > b ) // Surrounded vertically
2920			) && (
2921				( x1 >= l && x1 <= r ) || // Left edge touching
2922				( x2 >= l && x2 <= r ) || // Right edge touching
2923				( x1 < l && x2 > r ) // Surrounded horizontally
2924			);
2925		default:
2926			return false;
2927		}
2928	};
2929})();
2930
2931/*
2932	This manager tracks offsets of draggables and droppables
2933*/
2934$.ui.ddmanager = {
2935	current: null,
2936	droppables: { "default": [] },
2937	prepareOffsets: function( t, event ) {
2938
2939		var i, j,
2940			m = $.ui.ddmanager.droppables[ t.options.scope ] || [],
2941			type = event ? event.type : null, // workaround for #2317
2942			list = ( t.currentItem || t.element ).find( ":data(ui-droppable)" ).addBack();
2943
2944		droppablesLoop: for ( i = 0; i < m.length; i++ ) {
2945
2946			// No disabled and non-accepted
2947			if ( m[ i ].options.disabled || ( t && !m[ i ].accept.call( m[ i ].element[ 0 ], ( t.currentItem || t.element ) ) ) ) {
2948				continue;
2949			}
2950
2951			// Filter out elements in the current dragged item
2952			for ( j = 0; j < list.length; j++ ) {
2953				if ( list[ j ] === m[ i ].element[ 0 ] ) {
2954					m[ i ].proportions().height = 0;
2955					continue droppablesLoop;
2956				}
2957			}
2958
2959			m[ i ].visible = m[ i ].element.css( "display" ) !== "none";
2960			if ( !m[ i ].visible ) {
2961				continue;
2962			}
2963
2964			// Activate the droppable if used directly from draggables
2965			if ( type === "mousedown" ) {
2966				m[ i ]._activate.call( m[ i ], event );
2967			}
2968
2969			m[ i ].offset = m[ i ].element.offset();
2970			m[ i ].proportions({ width: m[ i ].element[ 0 ].offsetWidth, height: m[ i ].element[ 0 ].offsetHeight });
2971
2972		}
2973
2974	},
2975	drop: function( draggable, event ) {
2976
2977		var dropped = false;
2978		// Create a copy of the droppables in case the list changes during the drop (#9116)
2979		$.each( ( $.ui.ddmanager.droppables[ draggable.options.scope ] || [] ).slice(), function() {
2980
2981			if ( !this.options ) {
2982				return;
2983			}
2984			if ( !this.options.disabled && this.visible && $.ui.intersect( draggable, this, this.options.tolerance, event ) ) {
2985				dropped = this._drop.call( this, event ) || dropped;
2986			}
2987
2988			if ( !this.options.disabled && this.visible && this.accept.call( this.element[ 0 ], ( draggable.currentItem || draggable.element ) ) ) {
2989				this.isout = true;
2990				this.isover = false;
2991				this._deactivate.call( this, event );
2992			}
2993
2994		});
2995		return dropped;
2996
2997	},
2998	dragStart: function( draggable, event ) {
2999		// Listen for scrolling so that if the dragging causes scrolling the position of the droppables can be recalculated (see #5003)
3000		draggable.element.parentsUntil( "body" ).bind( "scroll.droppable", function() {
3001			if ( !draggable.options.refreshPositions ) {
3002				$.ui.ddmanager.prepareOffsets( draggable, event );
3003			}
3004		});
3005	},
3006	drag: function( draggable, event ) {
3007
3008		// If you have a highly dynamic page, you might try this option. It renders positions every time you move the mouse.
3009		if ( draggable.options.refreshPositions ) {
3010			$.ui.ddmanager.prepareOffsets( draggable, event );
3011		}
3012
3013		// Run through all droppables and check their positions based on specific tolerance options
3014		$.each( $.ui.ddmanager.droppables[ draggable.options.scope ] || [], function() {
3015
3016			if ( this.options.disabled || this.greedyChild || !this.visible ) {
3017				return;
3018			}
3019
3020			var parentInstance, scope, parent,
3021				intersects = $.ui.intersect( draggable, this, this.options.tolerance, event ),
3022				c = !intersects && this.isover ? "isout" : ( intersects && !this.isover ? "isover" : null );
3023			if ( !c ) {
3024				return;
3025			}
3026
3027			if ( this.options.greedy ) {
3028				// find droppable parents with same scope
3029				scope = this.options.scope;
3030				parent = this.element.parents( ":data(ui-droppable)" ).filter(function() {
3031					return $( this ).droppable( "instance" ).options.scope === scope;
3032				});
3033
3034				if ( parent.length ) {
3035					parentInstance = $( parent[ 0 ] ).droppable( "instance" );
3036					parentInstance.greedyChild = ( c === "isover" );
3037				}
3038			}
3039
3040			// we just moved into a greedy child
3041			if ( parentInstance && c === "isover" ) {
3042				parentInstance.isover = false;
3043				parentInstance.isout = true;
3044				parentInstance._out.call( parentInstance, event );
3045			}
3046
3047			this[ c ] = true;
3048			this[c === "isout" ? "isover" : "isout"] = false;
3049			this[c === "isover" ? "_over" : "_out"].call( this, event );
3050
3051			// we just moved out of a greedy child
3052			if ( parentInstance && c === "isout" ) {
3053				parentInstance.isout = false;
3054				parentInstance.isover = true;
3055				parentInstance._over.call( parentInstance, event );
3056			}
3057		});
3058
3059	},
3060	dragStop: function( draggable, event ) {
3061		draggable.element.parentsUntil( "body" ).unbind( "scroll.droppable" );
3062		// Call prepareOffsets one final time since IE does not fire return scroll events when overflow was caused by drag (see #5003)
3063		if ( !draggable.options.refreshPositions ) {
3064			$.ui.ddmanager.prepareOffsets( draggable, event );
3065		}
3066	}
3067};
3068
3069var droppable = $.ui.droppable;
3070
3071
3072/*!
3073 * jQuery UI Resizable 1.11.4
3074 * http://jqueryui.com
3075 *
3076 * Copyright jQuery Foundation and other contributors
3077 * Released under the MIT license.
3078 * http://jquery.org/license
3079 *
3080 * http://api.jqueryui.com/resizable/
3081 */
3082
3083
3084$.widget("ui.resizable", $.ui.mouse, {
3085	version: "1.11.4",
3086	widgetEventPrefix: "resize",
3087	options: {
3088		alsoResize: false,
3089		animate: false,
3090		animateDuration: "slow",
3091		animateEasing: "swing",
3092		aspectRatio: false,
3093		autoHide: false,
3094		containment: false,
3095		ghost: false,
3096		grid: false,
3097		handles: "e,s,se",
3098		helper: false,
3099		maxHeight: null,
3100		maxWidth: null,
3101		minHeight: 10,
3102		minWidth: 10,
3103		// See #7960
3104		zIndex: 90,
3105
3106		// callbacks
3107		resize: null,
3108		start: null,
3109		stop: null
3110	},
3111
3112	_num: function( value ) {
3113		return parseInt( value, 10 ) || 0;
3114	},
3115
3116	_isNumber: function( value ) {
3117		return !isNaN( parseInt( value, 10 ) );
3118	},
3119
3120	_hasScroll: function( el, a ) {
3121
3122		if ( $( el ).css( "overflow" ) === "hidden") {
3123			return false;
3124		}
3125
3126		var scroll = ( a && a === "left" ) ? "scrollLeft" : "scrollTop",
3127			has = false;
3128
3129		if ( el[ scroll ] > 0 ) {
3130			return true;
3131		}
3132
3133		// TODO: determine which cases actually cause this to happen
3134		// if the element doesn't have the scroll set, see if it's possible to
3135		// set the scroll
3136		el[ scroll ] = 1;
3137		has = ( el[ scroll ] > 0 );
3138		el[ scroll ] = 0;
3139		return has;
3140	},
3141
3142	_create: function() {
3143
3144		var n, i, handle, axis, hname,
3145			that = this,
3146			o = this.options;
3147		this.element.addClass("ui-resizable");
3148
3149		$.extend(this, {
3150			_aspectRatio: !!(o.aspectRatio),
3151			aspectRatio: o.aspectRatio,
3152			originalElement: this.element,
3153			_proportionallyResizeElements: [],
3154			_helper: o.helper || o.ghost || o.animate ? o.helper || "ui-resizable-helper" : null
3155		});
3156
3157		// Wrap the element if it cannot hold child nodes
3158		if (this.element[0].nodeName.match(/^(canvas|textarea|input|select|button|img)$/i)) {
3159
3160			this.element.wrap(
3161				$("<div class='ui-wrapper' style='overflow: hidden;'></div>").css({
3162					position: this.element.css("position"),
3163					width: this.element.outerWidth(),
3164					height: this.element.outerHeight(),
3165					top: this.element.css("top"),
3166					left: this.element.css("left")
3167				})
3168			);
3169
3170			this.element = this.element.parent().data(
3171				"ui-resizable", this.element.resizable( "instance" )
3172			);
3173
3174			this.elementIsWrapper = true;
3175
3176			this.element.css({
3177				marginLeft: this.originalElement.css("marginLeft"),
3178				marginTop: this.originalElement.css("marginTop"),
3179				marginRight: this.originalElement.css("marginRight"),
3180				marginBottom: this.originalElement.css("marginBottom")
3181			});
3182			this.originalElement.css({
3183				marginLeft: 0,
3184				marginTop: 0,
3185				marginRight: 0,
3186				marginBottom: 0
3187			});
3188			// support: Safari
3189			// Prevent Safari textarea resize
3190			this.originalResizeStyle = this.originalElement.css("resize");
3191			this.originalElement.css("resize", "none");
3192
3193			this._proportionallyResizeElements.push( this.originalElement.css({
3194				position: "static",
3195				zoom: 1,
3196				display: "block"
3197			}) );
3198
3199			// support: IE9
3200			// avoid IE jump (hard set the margin)
3201			this.originalElement.css({ margin: this.originalElement.css("margin") });
3202
3203			this._proportionallyResize();
3204		}
3205
3206		this.handles = o.handles ||
3207			( !$(".ui-resizable-handle", this.element).length ?
3208				"e,s,se" : {
3209					n: ".ui-resizable-n",
3210					e: ".ui-resizable-e",
3211					s: ".ui-resizable-s",
3212					w: ".ui-resizable-w",
3213					se: ".ui-resizable-se",
3214					sw: ".ui-resizable-sw",
3215					ne: ".ui-resizable-ne",
3216					nw: ".ui-resizable-nw"
3217				} );
3218
3219		this._handles = $();
3220		if ( this.handles.constructor === String ) {
3221
3222			if ( this.handles === "all") {
3223				this.handles = "n,e,s,w,se,sw,ne,nw";
3224			}
3225
3226			n = this.handles.split(",");
3227			this.handles = {};
3228
3229			for (i = 0; i < n.length; i++) {
3230
3231				handle = $.trim(n[i]);
3232				hname = "ui-resizable-" + handle;
3233				axis = $("<div class='ui-resizable-handle " + hname + "'></div>");
3234
3235				axis.css({ zIndex: o.zIndex });
3236
3237				// TODO : What's going on here?
3238				if ("se" === handle) {
3239					axis.addClass("ui-icon ui-icon-gripsmall-diagonal-se");
3240				}
3241
3242				this.handles[handle] = ".ui-resizable-" + handle;
3243				this.element.append(axis);
3244			}
3245
3246		}
3247
3248		this._renderAxis = function(target) {
3249
3250			var i, axis, padPos, padWrapper;
3251
3252			target = target || this.element;
3253
3254			for (i in this.handles) {
3255
3256				if (this.handles[i].constructor === String) {
3257					this.handles[i] = this.element.children( this.handles[ i ] ).first().show();
3258				} else if ( this.handles[ i ].jquery || this.handles[ i ].nodeType ) {
3259					this.handles[ i ] = $( this.handles[ i ] );
3260					this._on( this.handles[ i ], { "mousedown": that._mouseDown });
3261				}
3262
3263				if (this.elementIsWrapper && this.originalElement[0].nodeName.match(/^(textarea|input|select|button)$/i)) {
3264
3265					axis = $(this.handles[i], this.element);
3266
3267					padWrapper = /sw|ne|nw|se|n|s/.test(i) ? axis.outerHeight() : axis.outerWidth();
3268
3269					padPos = [ "padding",
3270						/ne|nw|n/.test(i) ? "Top" :
3271						/se|sw|s/.test(i) ? "Bottom" :
3272						/^e$/.test(i) ? "Right" : "Left" ].join("");
3273
3274					target.css(padPos, padWrapper);
3275
3276					this._proportionallyResize();
3277				}
3278
3279				this._handles = this._handles.add( this.handles[ i ] );
3280			}
3281		};
3282
3283		// TODO: make renderAxis a prototype function
3284		this._renderAxis(this.element);
3285
3286		this._handles = this._handles.add( this.element.find( ".ui-resizable-handle" ) );
3287		this._handles.disableSelection();
3288
3289		this._handles.mouseover(function() {
3290			if (!that.resizing) {
3291				if (this.className) {
3292					axis = this.className.match(/ui-resizable-(se|sw|ne|nw|n|e|s|w)/i);
3293				}
3294				that.axis = axis && axis[1] ? axis[1] : "se";
3295			}
3296		});
3297
3298		if (o.autoHide) {
3299			this._handles.hide();
3300			$(this.element)
3301				.addClass("ui-resizable-autohide")
3302				.mouseenter(function() {
3303					if (o.disabled) {
3304						return;
3305					}
3306					$(this).removeClass("ui-resizable-autohide");
3307					that._handles.show();
3308				})
3309				.mouseleave(function() {
3310					if (o.disabled) {
3311						return;
3312					}
3313					if (!that.resizing) {
3314						$(this).addClass("ui-resizable-autohide");
3315						that._handles.hide();
3316					}
3317				});
3318		}
3319
3320		this._mouseInit();
3321	},
3322
3323	_destroy: function() {
3324
3325		this._mouseDestroy();
3326
3327		var wrapper,
3328			_destroy = function(exp) {
3329				$(exp)
3330					.removeClass("ui-resizable ui-resizable-disabled ui-resizable-resizing")
3331					.removeData("resizable")
3332					.removeData("ui-resizable")
3333					.unbind(".resizable")
3334					.find(".ui-resizable-handle")
3335						.remove();
3336			};
3337
3338		// TODO: Unwrap at same DOM position
3339		if (this.elementIsWrapper) {
3340			_destroy(this.element);
3341			wrapper = this.element;
3342			this.originalElement.css({
3343				position: wrapper.css("position"),
3344				width: wrapper.outerWidth(),
3345				height: wrapper.outerHeight(),
3346				top: wrapper.css("top"),
3347				left: wrapper.css("left")
3348			}).insertAfter( wrapper );
3349			wrapper.remove();
3350		}
3351
3352		this.originalElement.css("resize", this.originalResizeStyle);
3353		_destroy(this.originalElement);
3354
3355		return this;
3356	},
3357
3358	_mouseCapture: function(event) {
3359		var i, handle,
3360			capture = false;
3361
3362		for (i in this.handles) {
3363			handle = $(this.handles[i])[0];
3364			if (handle === event.target || $.contains(handle, event.target)) {
3365				capture = true;
3366			}
3367		}
3368
3369		return !this.options.disabled && capture;
3370	},
3371
3372	_mouseStart: function(event) {
3373
3374		var curleft, curtop, cursor,
3375			o = this.options,
3376			el = this.element;
3377
3378		this.resizing = true;
3379
3380		this._renderProxy();
3381
3382		curleft = this._num(this.helper.css("left"));
3383		curtop = this._num(this.helper.css("top"));
3384
3385		if (o.containment) {
3386			curleft += $(o.containment).scrollLeft() || 0;
3387			curtop += $(o.containment).scrollTop() || 0;
3388		}
3389
3390		this.offset = this.helper.offset();
3391		this.position = { left: curleft, top: curtop };
3392
3393		this.size = this._helper ? {
3394				width: this.helper.width(),
3395				height: this.helper.height()
3396			} : {
3397				width: el.width(),
3398				height: el.height()
3399			};
3400
3401		this.originalSize = this._helper ? {
3402				width: el.outerWidth(),
3403				height: el.outerHeight()
3404			} : {
3405				width: el.width(),
3406				height: el.height()
3407			};
3408
3409		this.sizeDiff = {
3410			width: el.outerWidth() - el.width(),
3411			height: el.outerHeight() - el.height()
3412		};
3413
3414		this.originalPosition = { left: curleft, top: curtop };
3415		this.originalMousePosition = { left: event.pageX, top: event.pageY };
3416
3417		this.aspectRatio = (typeof o.aspectRatio === "number") ?
3418			o.aspectRatio :
3419			((this.originalSize.width / this.originalSize.height) || 1);
3420
3421		cursor = $(".ui-resizable-" + this.axis).css("cursor");
3422		$("body").css("cursor", cursor === "auto" ? this.axis + "-resize" : cursor);
3423
3424		el.addClass("ui-resizable-resizing");
3425		this._propagate("start", event);
3426		return true;
3427	},
3428
3429	_mouseDrag: function(event) {
3430
3431		var data, props,
3432			smp = this.originalMousePosition,
3433			a = this.axis,
3434			dx = (event.pageX - smp.left) || 0,
3435			dy = (event.pageY - smp.top) || 0,
3436			trigger = this._change[a];
3437
3438		this._updatePrevProperties();
3439
3440		if (!trigger) {
3441			return false;
3442		}
3443
3444		data = trigger.apply(this, [ event, dx, dy ]);
3445
3446		this._updateVirtualBoundaries(event.shiftKey);
3447		if (this._aspectRatio || event.shiftKey) {
3448			data = this._updateRatio(data, event);
3449		}
3450
3451		data = this._respectSize(data, event);
3452
3453		this._updateCache(data);
3454
3455		this._propagate("resize", event);
3456
3457		props = this._applyChanges();
3458
3459		if ( !this._helper && this._proportionallyResizeElements.length ) {
3460			this._proportionallyResize();
3461		}
3462
3463		if ( !$.isEmptyObject( props ) ) {
3464			this._updatePrevProperties();
3465			this._trigger( "resize", event, this.ui() );
3466			this._applyChanges();
3467		}
3468
3469		return false;
3470	},
3471
3472	_mouseStop: function(event) {
3473
3474		this.resizing = false;
3475		var pr, ista, soffseth, soffsetw, s, left, top,
3476			o = this.options, that = this;
3477
3478		if (this._helper) {
3479
3480			pr = this._proportionallyResizeElements;
3481			ista = pr.length && (/textarea/i).test(pr[0].nodeName);
3482			soffseth = ista && this._hasScroll(pr[0], "left") ? 0 : that.sizeDiff.height;
3483			soffsetw = ista ? 0 : that.sizeDiff.width;
3484
3485			s = {
3486				width: (that.helper.width()  - soffsetw),
3487				height: (that.helper.height() - soffseth)
3488			};
3489			left = (parseInt(that.element.css("left"), 10) +
3490				(that.position.left - that.originalPosition.left)) || null;
3491			top = (parseInt(that.element.css("top"), 10) +
3492				(that.position.top - that.originalPosition.top)) || null;
3493
3494			if (!o.animate) {
3495				this.element.css($.extend(s, { top: top, left: left }));
3496			}
3497
3498			that.helper.height(that.size.height);
3499			that.helper.width(that.size.width);
3500
3501			if (this._helper && !o.animate) {
3502				this._proportionallyResize();
3503			}
3504		}
3505
3506		$("body").css("cursor", "auto");
3507
3508		this.element.removeClass("ui-resizable-resizing");
3509
3510		this._propagate("stop", event);
3511
3512		if (this._helper) {
3513			this.helper.remove();
3514		}
3515
3516		return false;
3517
3518	},
3519
3520	_updatePrevProperties: function() {
3521		this.prevPosition = {
3522			top: this.position.top,
3523			left: this.position.left
3524		};
3525		this.prevSize = {
3526			width: this.size.width,
3527			height: this.size.height
3528		};
3529	},
3530
3531	_applyChanges: function() {
3532		var props = {};
3533
3534		if ( this.position.top !== this.prevPosition.top ) {
3535			props.top = this.position.top + "px";
3536		}
3537		if ( this.position.left !== this.prevPosition.left ) {
3538			props.left = this.position.left + "px";
3539		}
3540		if ( this.size.width !== this.prevSize.width ) {
3541			props.width = this.size.width + "px";
3542		}
3543		if ( this.size.height !== this.prevSize.height ) {
3544			props.height = this.size.height + "px";
3545		}
3546
3547		this.helper.css( props );
3548
3549		return props;
3550	},
3551
3552	_updateVirtualBoundaries: function(forceAspectRatio) {
3553		var pMinWidth, pMaxWidth, pMinHeight, pMaxHeight, b,
3554			o = this.options;
3555
3556		b = {
3557			minWidth: this._isNumber(o.minWidth) ? o.minWidth : 0,
3558			maxWidth: this._isNumber(o.maxWidth) ? o.maxWidth : Infinity,
3559			minHeight: this._isNumber(o.minHeight) ? o.minHeight : 0,
3560			maxHeight: this._isNumber(o.maxHeight) ? o.maxHeight : Infinity
3561		};
3562
3563		if (this._aspectRatio || forceAspectRatio) {
3564			pMinWidth = b.minHeight * this.aspectRatio;
3565			pMinHeight = b.minWidth / this.aspectRatio;
3566			pMaxWidth = b.maxHeight * this.aspectRatio;
3567			pMaxHeight = b.maxWidth / this.aspectRatio;
3568
3569			if (pMinWidth > b.minWidth) {
3570				b.minWidth = pMinWidth;
3571			}
3572			if (pMinHeight > b.minHeight) {
3573				b.minHeight = pMinHeight;
3574			}
3575			if (pMaxWidth < b.maxWidth) {
3576				b.maxWidth = pMaxWidth;
3577			}
3578			if (pMaxHeight < b.maxHeight) {
3579				b.maxHeight = pMaxHeight;
3580			}
3581		}
3582		this._vBoundaries = b;
3583	},
3584
3585	_updateCache: function(data) {
3586		this.offset = this.helper.offset();
3587		if (this._isNumber(data.left)) {
3588			this.position.left = data.left;
3589		}
3590		if (this._isNumber(data.top)) {
3591			this.position.top = data.top;
3592		}
3593		if (this._isNumber(data.height)) {
3594			this.size.height = data.height;
3595		}
3596		if (this._isNumber(data.width)) {
3597			this.size.width = data.width;
3598		}
3599	},
3600
3601	_updateRatio: function( data ) {
3602
3603		var cpos = this.position,
3604			csize = this.size,
3605			a = this.axis;
3606
3607		if (this._isNumber(data.height)) {
3608			data.width = (data.height * this.aspectRatio);
3609		} else if (this._isNumber(data.width)) {
3610			data.height = (data.width / this.aspectRatio);
3611		}
3612
3613		if (a === "sw") {
3614			data.left = cpos.left + (csize.width - data.width);
3615			data.top = null;
3616		}
3617		if (a === "nw") {
3618			data.top = cpos.top + (csize.height - data.height);
3619			data.left = cpos.left + (csize.width - data.width);
3620		}
3621
3622		return data;
3623	},
3624
3625	_respectSize: function( data ) {
3626
3627		var o = this._vBoundaries,
3628			a = this.axis,
3629			ismaxw = this._isNumber(data.width) && o.maxWidth && (o.maxWidth < data.width),
3630			ismaxh = this._isNumber(data.height) && o.maxHeight && (o.maxHeight < data.height),
3631			isminw = this._isNumber(data.width) && o.minWidth && (o.minWidth > data.width),
3632			isminh = this._isNumber(data.height) && o.minHeight && (o.minHeight > data.height),
3633			dw = this.originalPosition.left + this.originalSize.width,
3634			dh = this.position.top + this.size.height,
3635			cw = /sw|nw|w/.test(a), ch = /nw|ne|n/.test(a);
3636		if (isminw) {
3637			data.width = o.minWidth;
3638		}
3639		if (isminh) {
3640			data.height = o.minHeight;
3641		}
3642		if (ismaxw) {
3643			data.width = o.maxWidth;
3644		}
3645		if (ismaxh) {
3646			data.height = o.maxHeight;
3647		}
3648
3649		if (isminw && cw) {
3650			data.left = dw - o.minWidth;
3651		}
3652		if (ismaxw && cw) {
3653			data.left = dw - o.maxWidth;
3654		}
3655		if (isminh && ch) {
3656			data.top = dh - o.minHeight;
3657		}
3658		if (ismaxh && ch) {
3659			data.top = dh - o.maxHeight;
3660		}
3661
3662		// Fixing jump error on top/left - bug #2330
3663		if (!data.width && !data.height && !data.left && data.top) {
3664			data.top = null;
3665		} else if (!data.width && !data.height && !data.top && data.left) {
3666			data.left = null;
3667		}
3668
3669		return data;
3670	},
3671
3672	_getPaddingPlusBorderDimensions: function( element ) {
3673		var i = 0,
3674			widths = [],
3675			borders = [
3676				element.css( "borderTopWidth" ),
3677				element.css( "borderRightWidth" ),
3678				element.css( "borderBottomWidth" ),
3679				element.css( "borderLeftWidth" )
3680			],
3681			paddings = [
3682				element.css( "paddingTop" ),
3683				element.css( "paddingRight" ),
3684				element.css( "paddingBottom" ),
3685				element.css( "paddingLeft" )
3686			];
3687
3688		for ( ; i < 4; i++ ) {
3689			widths[ i ] = ( parseInt( borders[ i ], 10 ) || 0 );
3690			widths[ i ] += ( parseInt( paddings[ i ], 10 ) || 0 );
3691		}
3692
3693		return {
3694			height: widths[ 0 ] + widths[ 2 ],
3695			width: widths[ 1 ] + widths[ 3 ]
3696		};
3697	},
3698
3699	_proportionallyResize: function() {
3700
3701		if (!this._proportionallyResizeElements.length) {
3702			return;
3703		}
3704
3705		var prel,
3706			i = 0,
3707			element = this.helper || this.element;
3708
3709		for ( ; i < this._proportionallyResizeElements.length; i++) {
3710
3711			prel = this._proportionallyResizeElements[i];
3712
3713			// TODO: Seems like a bug to cache this.outerDimensions
3714			// considering that we are in a loop.
3715			if (!this.outerDimensions) {
3716				this.outerDimensions = this._getPaddingPlusBorderDimensions( prel );
3717			}
3718
3719			prel.css({
3720				height: (element.height() - this.outerDimensions.height) || 0,
3721				width: (element.width() - this.outerDimensions.width) || 0
3722			});
3723
3724		}
3725
3726	},
3727
3728	_renderProxy: function() {
3729
3730		var el = this.element, o = this.options;
3731		this.elementOffset = el.offset();
3732
3733		if (this._helper) {
3734
3735			this.helper = this.helper || $("<div style='overflow:hidden;'></div>");
3736
3737			this.helper.addClass(this._helper).css({
3738				width: this.element.outerWidth() - 1,
3739				height: this.element.outerHeight() - 1,
3740				position: "absolute",
3741				left: this.elementOffset.left + "px",
3742				top: this.elementOffset.top + "px",
3743				zIndex: ++o.zIndex //TODO: Don't modify option
3744			});
3745
3746			this.helper
3747				.appendTo("body")
3748				.disableSelection();
3749
3750		} else {
3751			this.helper = this.element;
3752		}
3753
3754	},
3755
3756	_change: {
3757		e: function(event, dx) {
3758			return { width: this.originalSize.width + dx };
3759		},
3760		w: function(event, dx) {
3761			var cs = this.originalSize, sp = this.originalPosition;
3762			return { left: sp.left + dx, width: cs.width - dx };
3763		},
3764		n: function(event, dx, dy) {
3765			var cs = this.originalSize, sp = this.originalPosition;
3766			return { top: sp.top + dy, height: cs.height - dy };
3767		},
3768		s: function(event, dx, dy) {
3769			return { height: this.originalSize.height + dy };
3770		},
3771		se: function(event, dx, dy) {
3772			return $.extend(this._change.s.apply(this, arguments),
3773				this._change.e.apply(this, [ event, dx, dy ]));
3774		},
3775		sw: function(event, dx, dy) {
3776			return $.extend(this._change.s.apply(this, arguments),
3777				this._change.w.apply(this, [ event, dx, dy ]));
3778		},
3779		ne: function(event, dx, dy) {
3780			return $.extend(this._change.n.apply(this, arguments),
3781				this._change.e.apply(this, [ event, dx, dy ]));
3782		},
3783		nw: function(event, dx, dy) {
3784			return $.extend(this._change.n.apply(this, arguments),
3785				this._change.w.apply(this, [ event, dx, dy ]));
3786		}
3787	},
3788
3789	_propagate: function(n, event) {
3790		$.ui.plugin.call(this, n, [ event, this.ui() ]);
3791		(n !== "resize" && this._trigger(n, event, this.ui()));
3792	},
3793
3794	plugins: {},
3795
3796	ui: function() {
3797		return {
3798			originalElement: this.originalElement,
3799			element: this.element,
3800			helper: this.helper,
3801			position: this.position,
3802			size: this.size,
3803			originalSize: this.originalSize,
3804			originalPosition: this.originalPosition
3805		};
3806	}
3807
3808});
3809
3810/*
3811 * Resizable Extensions
3812 */
3813
3814$.ui.plugin.add("resizable", "animate", {
3815
3816	stop: function( event ) {
3817		var that = $(this).resizable( "instance" ),
3818			o = that.options,
3819			pr = that._proportionallyResizeElements,
3820			ista = pr.length && (/textarea/i).test(pr[0].nodeName),
3821			soffseth = ista && that._hasScroll(pr[0], "left") ? 0 : that.sizeDiff.height,
3822			soffsetw = ista ? 0 : that.sizeDiff.width,
3823			style = { width: (that.size.width - soffsetw), height: (that.size.height - soffseth) },
3824			left = (parseInt(that.element.css("left"), 10) +
3825				(that.position.left - that.originalPosition.left)) || null,
3826			top = (parseInt(that.element.css("top"), 10) +
3827				(that.position.top - that.originalPosition.top)) || null;
3828
3829		that.element.animate(
3830			$.extend(style, top && left ? { top: top, left: left } : {}), {
3831				duration: o.animateDuration,
3832				easing: o.animateEasing,
3833				step: function() {
3834
3835					var data = {
3836						width: parseInt(that.element.css("width"), 10),
3837						height: parseInt(that.element.css("height"), 10),
3838						top: parseInt(that.element.css("top"), 10),
3839						left: parseInt(that.element.css("left"), 10)
3840					};
3841
3842					if (pr && pr.length) {
3843						$(pr[0]).css({ width: data.width, height: data.height });
3844					}
3845
3846					// propagating resize, and updating values for each animation step
3847					that._updateCache(data);
3848					that._propagate("resize", event);
3849
3850				}
3851			}
3852		);
3853	}
3854
3855});
3856
3857$.ui.plugin.add( "resizable", "containment", {
3858
3859	start: function() {
3860		var element, p, co, ch, cw, width, height,
3861			that = $( this ).resizable( "instance" ),
3862			o = that.options,
3863			el = that.element,
3864			oc = o.containment,
3865			ce = ( oc instanceof $ ) ? oc.get( 0 ) : ( /parent/.test( oc ) ) ? el.parent().get( 0 ) : oc;
3866
3867		if ( !ce ) {
3868			return;
3869		}
3870
3871		that.containerElement = $( ce );
3872
3873		if ( /document/.test( oc ) || oc === document ) {
3874			that.containerOffset = {
3875				left: 0,
3876				top: 0
3877			};
3878			that.containerPosition = {
3879				left: 0,
3880				top: 0
3881			};
3882
3883			that.parentData = {
3884				element: $( document ),
3885				left: 0,
3886				top: 0,
3887				width: $( document ).width(),
3888				height: $( document ).height() || document.body.parentNode.scrollHeight
3889			};
3890		} else {
3891			element = $( ce );
3892			p = [];
3893			$([ "Top", "Right", "Left", "Bottom" ]).each(function( i, name ) {
3894				p[ i ] = that._num( element.css( "padding" + name ) );
3895			});
3896
3897			that.containerOffset = element.offset();
3898			that.containerPosition = element.position();
3899			that.containerSize = {
3900				height: ( element.innerHeight() - p[ 3 ] ),
3901				width: ( element.innerWidth() - p[ 1 ] )
3902			};
3903
3904			co = that.containerOffset;
3905			ch = that.containerSize.height;
3906			cw = that.containerSize.width;
3907			width = ( that._hasScroll ( ce, "left" ) ? ce.scrollWidth : cw );
3908			height = ( that._hasScroll ( ce ) ? ce.scrollHeight : ch ) ;
3909
3910			that.parentData = {
3911				element: ce,
3912				left: co.left,
3913				top: co.top,
3914				width: width,
3915				height: height
3916			};
3917		}
3918	},
3919
3920	resize: function( event ) {
3921		var woset, hoset, isParent, isOffsetRelative,
3922			that = $( this ).resizable( "instance" ),
3923			o = that.options,
3924			co = that.containerOffset,
3925			cp = that.position,
3926			pRatio = that._aspectRatio || event.shiftKey,
3927			cop = {
3928				top: 0,
3929				left: 0
3930			},
3931			ce = that.containerElement,
3932			continueResize = true;
3933
3934		if ( ce[ 0 ] !== document && ( /static/ ).test( ce.css( "position" ) ) ) {
3935			cop = co;
3936		}
3937
3938		if ( cp.left < ( that._helper ? co.left : 0 ) ) {
3939			that.size.width = that.size.width +
3940				( that._helper ?
3941					( that.position.left - co.left ) :
3942					( that.position.left - cop.left ) );
3943
3944			if ( pRatio ) {
3945				that.size.height = that.size.width / that.aspectRatio;
3946				continueResize = false;
3947			}
3948			that.position.left = o.helper ? co.left : 0;
3949		}
3950
3951		if ( cp.top < ( that._helper ? co.top : 0 ) ) {
3952			that.size.height = that.size.height +
3953				( that._helper ?
3954					( that.position.top - co.top ) :
3955					that.position.top );
3956
3957			if ( pRatio ) {
3958				that.size.width = that.size.height * that.aspectRatio;
3959				continueResize = false;
3960			}
3961			that.position.top = that._helper ? co.top : 0;
3962		}
3963
3964		isParent = that.containerElement.get( 0 ) === that.element.parent().get( 0 );
3965		isOffsetRelative = /relative|absolute/.test( that.containerElement.css( "position" ) );
3966
3967		if ( isParent && isOffsetRelative ) {
3968			that.offset.left = that.parentData.left + that.position.left;
3969			that.offset.top = that.parentData.top + that.position.top;
3970		} else {
3971			that.offset.left = that.element.offset().left;
3972			that.offset.top = that.element.offset().top;
3973		}
3974
3975		woset = Math.abs( that.sizeDiff.width +
3976			(that._helper ?
3977				that.offset.left - cop.left :
3978				(that.offset.left - co.left)) );
3979
3980		hoset = Math.abs( that.sizeDiff.height +
3981			(that._helper ?
3982				that.offset.top - cop.top :
3983				(that.offset.top - co.top)) );
3984
3985		if ( woset + that.size.width >= that.parentData.width ) {
3986			that.size.width = that.parentData.width - woset;
3987			if ( pRatio ) {
3988				that.size.height = that.size.width / that.aspectRatio;
3989				continueResize = false;
3990			}
3991		}
3992
3993		if ( hoset + that.size.height >= that.parentData.height ) {
3994			that.size.height = that.parentData.height - hoset;
3995			if ( pRatio ) {
3996				that.size.width = that.size.height * that.aspectRatio;
3997				continueResize = false;
3998			}
3999		}
4000
4001		if ( !continueResize ) {
4002			that.position.left = that.prevPosition.left;
4003			that.position.top = that.prevPosition.top;
4004			that.size.width = that.prevSize.width;
4005			that.size.height = that.prevSize.height;
4006		}
4007	},
4008
4009	stop: function() {
4010		var that = $( this ).resizable( "instance" ),
4011			o = that.options,
4012			co = that.containerOffset,
4013			cop = that.containerPosition,
4014			ce = that.containerElement,
4015			helper = $( that.helper ),
4016			ho = helper.offset(),
4017			w = helper.outerWidth() - that.sizeDiff.width,
4018			h = helper.outerHeight() - that.sizeDiff.height;
4019
4020		if ( that._helper && !o.animate && ( /relative/ ).test( ce.css( "position" ) ) ) {
4021			$( this ).css({
4022				left: ho.left - cop.left - co.left,
4023				width: w,
4024				height: h
4025			});
4026		}
4027
4028		if ( that._helper && !o.animate && ( /static/ ).test( ce.css( "position" ) ) ) {
4029			$( this ).css({
4030				left: ho.left - cop.left - co.left,
4031				width: w,
4032				height: h
4033			});
4034		}
4035	}
4036});
4037
4038$.ui.plugin.add("resizable", "alsoResize", {
4039
4040	start: function() {
4041		var that = $(this).resizable( "instance" ),
4042			o = that.options;
4043
4044		$(o.alsoResize).each(function() {
4045			var el = $(this);
4046			el.data("ui-resizable-alsoresize", {
4047				width: parseInt(el.width(), 10), height: parseInt(el.height(), 10),
4048				left: parseInt(el.css("left"), 10), top: parseInt(el.css("top"), 10)
4049			});
4050		});
4051	},
4052
4053	resize: function(event, ui) {
4054		var that = $(this).resizable( "instance" ),
4055			o = that.options,
4056			os = that.originalSize,
4057			op = that.originalPosition,
4058			delta = {
4059				height: (that.size.height - os.height) || 0,
4060				width: (that.size.width - os.width) || 0,
4061				top: (that.position.top - op.top) || 0,
4062				left: (that.position.left - op.left) || 0
4063			};
4064
4065			$(o.alsoResize).each(function() {
4066				var el = $(this), start = $(this).data("ui-resizable-alsoresize"), style = {},
4067					css = el.parents(ui.originalElement[0]).length ?
4068							[ "width", "height" ] :
4069							[ "width", "height", "top", "left" ];
4070
4071				$.each(css, function(i, prop) {
4072					var sum = (start[prop] || 0) + (delta[prop] || 0);
4073					if (sum && sum >= 0) {
4074						style[prop] = sum || null;
4075					}
4076				});
4077
4078				el.css(style);
4079			});
4080	},
4081
4082	stop: function() {
4083		$(this).removeData("resizable-alsoresize");
4084	}
4085});
4086
4087$.ui.plugin.add("resizable", "ghost", {
4088
4089	start: function() {
4090
4091		var that = $(this).resizable( "instance" ), o = that.options, cs = that.size;
4092
4093		that.ghost = that.originalElement.clone();
4094		that.ghost
4095			.css({
4096				opacity: 0.25,
4097				display: "block",
4098				position: "relative",
4099				height: cs.height,
4100				width: cs.width,
4101				margin: 0,
4102				left: 0,
4103				top: 0
4104			})
4105			.addClass("ui-resizable-ghost")
4106			.addClass(typeof o.ghost === "string" ? o.ghost : "");
4107
4108		that.ghost.appendTo(that.helper);
4109
4110	},
4111
4112	resize: function() {
4113		var that = $(this).resizable( "instance" );
4114		if (that.ghost) {
4115			that.ghost.css({
4116				position: "relative",
4117				height: that.size.height,
4118				width: that.size.width
4119			});
4120		}
4121	},
4122
4123	stop: function() {
4124		var that = $(this).resizable( "instance" );
4125		if (that.ghost && that.helper) {
4126			that.helper.get(0).removeChild(that.ghost.get(0));
4127		}
4128	}
4129
4130});
4131
4132$.ui.plugin.add("resizable", "grid", {
4133
4134	resize: function() {
4135		var outerDimensions,
4136			that = $(this).resizable( "instance" ),
4137			o = that.options,
4138			cs = that.size,
4139			os = that.originalSize,
4140			op = that.originalPosition,
4141			a = that.axis,
4142			grid = typeof o.grid === "number" ? [ o.grid, o.grid ] : o.grid,
4143			gridX = (grid[0] || 1),
4144			gridY = (grid[1] || 1),
4145			ox = Math.round((cs.width - os.width) / gridX) * gridX,
4146			oy = Math.round((cs.height - os.height) / gridY) * gridY,
4147			newWidth = os.width + ox,
4148			newHeight = os.height + oy,
4149			isMaxWidth = o.maxWidth && (o.maxWidth < newWidth),
4150			isMaxHeight = o.maxHeight && (o.maxHeight < newHeight),
4151			isMinWidth = o.minWidth && (o.minWidth > newWidth),
4152			isMinHeight = o.minHeight && (o.minHeight > newHeight);
4153
4154		o.grid = grid;
4155
4156		if (isMinWidth) {
4157			newWidth += gridX;
4158		}
4159		if (isMinHeight) {
4160			newHeight += gridY;
4161		}
4162		if (isMaxWidth) {
4163			newWidth -= gridX;
4164		}
4165		if (isMaxHeight) {
4166			newHeight -= gridY;
4167		}
4168
4169		if (/^(se|s|e)$/.test(a)) {
4170			that.size.width = newWidth;
4171			that.size.height = newHeight;
4172		} else if (/^(ne)$/.test(a)) {
4173			that.size.width = newWidth;
4174			that.size.height = newHeight;
4175			that.position.top = op.top - oy;
4176		} else if (/^(sw)$/.test(a)) {
4177			that.size.width = newWidth;
4178			that.size.height = newHeight;
4179			that.position.left = op.left - ox;
4180		} else {
4181			if ( newHeight - gridY <= 0 || newWidth - gridX <= 0) {
4182				outerDimensions = that._getPaddingPlusBorderDimensions( this );
4183			}
4184
4185			if ( newHeight - gridY > 0 ) {
4186				that.size.height = newHeight;
4187				that.position.top = op.top - oy;
4188			} else {
4189				newHeight = gridY - outerDimensions.height;
4190				that.size.height = newHeight;
4191				that.position.top = op.top + os.height - newHeight;
4192			}
4193			if ( newWidth - gridX > 0 ) {
4194				that.size.width = newWidth;
4195				that.position.left = op.left - ox;
4196			} else {
4197				newWidth = gridX - outerDimensions.width;
4198				that.size.width = newWidth;
4199				that.position.left = op.left + os.width - newWidth;
4200			}
4201		}
4202	}
4203
4204});
4205
4206var resizable = $.ui.resizable;
4207
4208
4209/*!
4210 * jQuery UI 
vendor: 6,622 bytes, lines 4210-4464
4210Selectable 1.11.4
4211 * http://jqueryui.com
4212 *
4213 * Copyright jQuery Foundation and other contributors
4214 * Released under the MIT license.
4215 * http://jquery.org/license
4216 *
4217 * http://api.jqueryui.com/selectable/
4218 */
4219
4220
4221var selectable = $.widget("ui.selectable", $.ui.mouse, {
4222	version: "1.11.4",
4223	options: {
4224		appendTo: "body",
4225		autoRefresh: true,
4226		distance: 0,
4227		filter: "*",
4228		tolerance: "touch",
4229
4230		// callbacks
4231		selected: null,
4232		selecting: null,
4233		start: null,
4234		stop: null,
4235		unselected: null,
4236		unselecting: null
4237	},
4238	_create: function() {
4239		var selectees,
4240			that = this;
4241
4242		this.element.addClass("ui-selectable");
4243
4244		this.dragged = false;
4245
4246		// cache selectee children based on filter
4247		this.refresh = function() {
4248			selectees = $(that.options.filter, that.element[0]);
4249			selectees.addClass("ui-selectee");
4250			selectees.each(function() {
4251				var $this = $(this),
4252					pos = $this.offset();
4253				$.data(this, "selectable-item", {
4254					element: this,
4255					$element: $this,
4256					left: pos.left,
4257					top: pos.top,
4258					right: pos.left + $this.outerWidth(),
4259					bottom: pos.top + $this.outerHeight(),
4260					startselected: false,
4261					selected: $this.hasClass("ui-selected"),
4262					selecting: $this.hasClass("ui-selecting"),
4263					unselecting: $this.hasClass("ui-unselecting")
4264				});
4265			});
4266		};
4267		this.refresh();
4268
4269		this.selectees = selectees.addClass("ui-selectee");
4270
4271		this._mouseInit();
4272
4273		this.helper = $("<div class='ui-selectable-helper'></div>");
4274	},
4275
4276	_destroy: function() {
4277		this.selectees
4278			.removeClass("ui-selectee")
4279			.removeData("selectable-item");
4280		this.element
4281			.removeClass("ui-selectable ui-selectable-disabled");
4282		this._mouseDestroy();
4283	},
4284
4285	_mouseStart: function(event) {
4286		var that = this,
4287			options = this.options;
4288
4289		this.opos = [ event.pageX, event.pageY ];
4290
4291		if (this.options.disabled) {
4292			return;
4293		}
4294
4295		this.selectees = $(options.filter, this.element[0]);
4296
4297		this._trigger("start", event);
4298
4299		$(options.appendTo).append(this.helper);
4300		// position helper (lasso)
4301		this.helper.css({
4302			"left": event.pageX,
4303			"top": event.pageY,
4304			"width": 0,
4305			"height": 0
4306		});
4307
4308		if (options.autoRefresh) {
4309			this.refresh();
4310		}
4311
4312		this.selectees.filter(".ui-selected").each(function() {
4313			var selectee = $.data(this, "selectable-item");
4314			selectee.startselected = true;
4315			if (!event.metaKey && !event.ctrlKey) {
4316				selectee.$element.removeClass("ui-selected");
4317				selectee.selected = false;
4318				selectee.$element.addClass("ui-unselecting");
4319				selectee.unselecting = true;
4320				// selectable UNSELECTING callback
4321				that._trigger("unselecting", event, {
4322					unselecting: selectee.element
4323				});
4324			}
4325		});
4326
4327		$(event.target).parents().addBack().each(function() {
4328			var doSelect,
4329				selectee = $.data(this, "selectable-item");
4330			if (selectee) {
4331				doSelect = (!event.metaKey && !event.ctrlKey) || !selectee.$element.hasClass("ui-selected");
4332				selectee.$element
4333					.removeClass(doSelect ? "ui-unselecting" : "ui-selected")
4334					.addClass(doSelect ? "ui-selecting" : "ui-unselecting");
4335				selectee.unselecting = !doSelect;
4336				selectee.selecting = doSelect;
4337				selectee.selected = doSelect;
4338				// selectable (UN)SELECTING callback
4339				if (doSelect) {
4340					that._trigger("selecting", event, {
4341						selecting: selectee.element
4342					});
4343				} else {
4344					that._trigger("unselecting", event, {
4345						unselecting: selectee.element
4346					});
4347				}
4348				return false;
4349			}
4350		});
4351
4352	},
4353
4354	_mouseDrag: function(event) {
4355
4356		this.dragged = true;
4357
4358		if (this.options.disabled) {
4359			return;
4360		}
4361
4362		var tmp,
4363			that = this,
4364			options = this.options,
4365			x1 = this.opos[0],
4366			y1 = this.opos[1],
4367			x2 = event.pageX,
4368			y2 = event.pageY;
4369
4370		if (x1 > x2) { tmp = x2; x2 = x1; x1 = tmp; }
4371		if (y1 > y2) { tmp = y2; y2 = y1; y1 = tmp; }
4372		this.helper.css({ left: x1, top: y1, width: x2 - x1, height: y2 - y1 });
4373
4374		this.selectees.each(function() {
4375			var selectee = $.data(this, "selectable-item"),
4376				hit = false;
4377
4378			//prevent helper from being selected if appendTo: selectable
4379			if (!selectee || selectee.element === that.element[0]) {
4380				return;
4381			}
4382
4383			if (options.tolerance === "touch") {
4384				hit = ( !(selectee.left > x2 || selectee.right < x1 || selectee.top > y2 || selectee.bottom < y1) );
4385			} else if (options.tolerance === "fit") {
4386				hit = (selectee.left > x1 && selectee.right < x2 && selectee.top > y1 && selectee.bottom < y2);
4387			}
4388
4389			if (hit) {
4390				// SELECT
4391				if (selectee.selected) {
4392					selectee.$element.removeClass("ui-selected");
4393					selectee.selected = false;
4394				}
4395				if (selectee.unselecting) {
4396					selectee.$element.removeClass("ui-unselecting");
4397					selectee.unselecting = false;
4398				}
4399				if (!selectee.selecting) {
4400					selectee.$element.addClass("ui-selecting");
4401					selectee.selecting = true;
4402					// selectable SELECTING callback
4403					that._trigger("selecting", event, {
4404						selecting: selectee.element
4405					});
4406				}
4407			} else {
4408				// UNSELECT
4409				if (selectee.selecting) {
4410					if ((event.metaKey || event.ctrlKey) && selectee.startselected) {
4411						selectee.$element.removeClass("ui-selecting");
4412						selectee.selecting = false;
4413						selectee.$element.addClass("ui-selected");
4414						selectee.selected = true;
4415					} else {
4416						selectee.$element.removeClass("ui-selecting");
4417						selectee.selecting = false;
4418						if (selectee.startselected) {
4419							selectee.$element.addClass("ui-unselecting");
4420							selectee.unselecting = true;
4421						}
4422						// selectable UNSELECTING callback
4423						that._trigger("unselecting", event, {
4424							unselecting: selectee.element
4425						});
4426					}
4427				}
4428				if (selectee.selected) {
4429					if (!event.metaKey && !event.ctrlKey && !selectee.startselected) {
4430						selectee.$element.removeClass("ui-selected");
4431						selectee.selected = false;
4432
4433						selectee.$element.addClass("ui-unselecting");
4434						selectee.unselecting = true;
4435						// selectable UNSELECTING callback
4436						that._trigger("unselecting", event, {
4437							unselecting: selectee.element
4438						});
4439					}
4440				}
4441			}
4442		});
4443
4444		return false;
4445	},
4446
4447	_mouseStop: function(event) {
4448		var that = this;
4449
4450		this.dragged = false;
4451
4452		$(".ui-unselecting", this.element[0]).each(function() {
4453			var selectee = $.data(this, "selectable-item");
4454			selectee.$element.removeClass("ui-unselecting");
4455			selectee.unselecting = false;
4456			selectee.startselected = false;
4457			that._trigger("unselected", event, {
4458				unselected: selectee.element
4459			});
4460		});
4461		$(".ui-selecting", this.element[0]).each(function() {
4462			var selectee = $.data(this, "selectable-item");
4463			selectee.$element.removeClass("ui-selecting").addClass("ui-selected");
4464			selectee.selecting = false;
4465			selectee.selected = true;
4466			selectee.startselected = true;
4467			that._trigger("selected", event, {
4468				selected: selectee.element
4469			});
4470		});
4471		this._trigger("stop", event);
4472
4473		this.helper.remove();
4474
4475		return false;
4476	}
vendor: 65,728 bytes, lines 4477-6651
4477
4478});
4479
4480
4481/*!
4482 * jQuery UI Sortable 1.11.4
4483 * http://jqueryui.com
4484 *
4485 * Copyright jQuery Foundation and other contributors
4486 * Released under the MIT license.
4487 * http://jquery.org/license
4488 *
4489 * http://api.jqueryui.com/sortable/
4490 */
4491
4492
4493var sortable = $.widget("ui.sortable", $.ui.mouse, {
4494	version: "1.11.4",
4495	widgetEventPrefix: "sort",
4496	ready: false,
4497	options: {
4498		appendTo: "parent",
4499		axis: false,
4500		connectWith: false,
4501		containment: false,
4502		cursor: "auto",
4503		cursorAt: false,
4504		dropOnEmpty: true,
4505		forcePlaceholderSize: false,
4506		forceHelperSize: false,
4507		grid: false,
4508		handle: false,
4509		helper: "original",
4510		items: "> *",
4511		opacity: false,
4512		placeholder: false,
4513		revert: false,
4514		scroll: true,
4515		scrollSensitivity: 20,
4516		scrollSpeed: 20,
4517		scope: "default",
4518		tolerance: "intersect",
4519		zIndex: 1000,
4520
4521		// callbacks
4522		activate: null,
4523		beforeStop: null,
4524		change: null,
4525		deactivate: null,
4526		out: null,
4527		over: null,
4528		receive: null,
4529		remove: null,
4530		sort: null,
4531		start: null,
4532		stop: null,
4533		update: null
4534	},
4535
4536	_isOverAxis: function( x, reference, size ) {
4537		return ( x >= reference ) && ( x < ( reference + size ) );
4538	},
4539
4540	_isFloating: function( item ) {
4541		return (/left|right/).test(item.css("float")) || (/inline|table-cell/).test(item.css("display"));
4542	},
4543
4544	_create: function() {
4545		this.containerCache = {};
4546		this.element.addClass("ui-sortable");
4547
4548		//Get the items
4549		this.refresh();
4550
4551		//Let's determine the parent's offset
4552		this.offset = this.element.offset();
4553
4554		//Initialize mouse events for interaction
4555		this._mouseInit();
4556
4557		this._setHandleClassName();
4558
4559		//We're ready to go
4560		this.ready = true;
4561
4562	},
4563
4564	_setOption: function( key, value ) {
4565		this._super( key, value );
4566
4567		if ( key === "handle" ) {
4568			this._setHandleClassName();
4569		}
4570	},
4571
4572	_setHandleClassName: function() {
4573		this.element.find( ".ui-sortable-handle" ).removeClass( "ui-sortable-handle" );
4574		$.each( this.items, function() {
4575			( this.instance.options.handle ?
4576				this.item.find( this.instance.options.handle ) : this.item )
4577				.addClass( "ui-sortable-handle" );
4578		});
4579	},
4580
4581	_destroy: function() {
4582		this.element
4583			.removeClass( "ui-sortable ui-sortable-disabled" )
4584			.find( ".ui-sortable-handle" )
4585				.removeClass( "ui-sortable-handle" );
4586		this._mouseDestroy();
4587
4588		for ( var i = this.items.length - 1; i >= 0; i-- ) {
4589			this.items[i].item.removeData(this.widgetName + "-item");
4590		}
4591
4592		return this;
4593	},
4594
4595	_mouseCapture: function(event, overrideHandle) {
4596		var currentItem = null,
4597			validHandle = false,
4598			that = this;
4599
4600		if (this.reverting) {
4601			return false;
4602		}
4603
4604		if(this.options.disabled || this.options.type === "static") {
4605			return false;
4606		}
4607
4608		//We have to refresh the items data once first
4609		this._refreshItems(event);
4610
4611		//Find out if the clicked node (or one of its parents) is a actual item in this.items
4612		$(event.target).parents().each(function() {
4613			if($.data(this, that.widgetName + "-item") === that) {
4614				currentItem = $(this);
4615				return false;
4616			}
4617		});
4618		if($.data(event.target, that.widgetName + "-item") === that) {
4619			currentItem = $(event.target);
4620		}
4621
4622		if(!currentItem) {
4623			return false;
4624		}
4625		if(this.options.handle && !overrideHandle) {
4626			$(this.options.handle, currentItem).find("*").addBack().each(function() {
4627				if(this === event.target) {
4628					validHandle = true;
4629				}
4630			});
4631			if(!validHandle) {
4632				return false;
4633			}
4634		}
4635
4636		this.currentItem = currentItem;
4637		this._removeCurrentsFromItems();
4638		return true;
4639
4640	},
4641
4642	_mouseStart: function(event, overrideHandle, noActivation) {
4643
4644		var i, body,
4645			o = this.options;
4646
4647		this.currentContainer = this;
4648
4649		//We only need to call refreshPositions, because the refreshItems call has been moved to mouseCapture
4650		this.refreshPositions();
4651
4652		//Create and append the visible helper
4653		this.helper = this._createHelper(event);
4654
4655		//Cache the helper size
4656		this._cacheHelperProportions();
4657
4658		/*
4659		 * - Position generation -
4660		 * This block generates everything position related - it's the core of draggables.
4661		 */
4662
4663		//Cache the margins of the original element
4664		this._cacheMargins();
4665
4666		//Get the next scrolling parent
4667		this.scrollParent = this.helper.scrollParent();
4668
4669		//The element's absolute position on the page minus margins
4670		this.offset = this.currentItem.offset();
4671		this.offset = {
4672			top: this.offset.top - this.margins.top,
4673			left: this.offset.left - this.margins.left
4674		};
4675
4676		$.extend(this.offset, {
4677			click: { //Where the click happened, relative to the element
4678				left: event.pageX - this.offset.left,
4679				top: event.pageY - this.offset.top
4680			},
4681			parent: this._getParentOffset(),
4682			relative: this._getRelativeOffset() //This is a relative to absolute position minus the actual position calculation - only used for relative positioned helper
4683		});
4684
4685		// Only after we got the offset, we can change the helper's position to absolute
4686		// TODO: Still need to figure out a way to make relative sorting possible
4687		this.helper.css("position", "absolute");
4688		this.cssPosition = this.helper.css("position");
4689
4690		//Generate the original position
4691		this.originalPosition = this._generatePosition(event);
4692		this.originalPageX = event.pageX;
4693		this.originalPageY = event.pageY;
4694
4695		//Adjust the mouse offset relative to the helper if "cursorAt" is supplied
4696		(o.cursorAt && this._adjustOffsetFromHelper(o.cursorAt));
4697
4698		//Cache the former DOM position
4699		this.domPosition = { prev: this.currentItem.prev()[0], parent: this.currentItem.parent()[0] };
4700
4701		//If the helper is not the original, hide the original so it's not playing any role during the drag, won't cause anything bad this way
4702		if(this.helper[0] !== this.currentItem[0]) {
4703			this.currentItem.hide();
4704		}
4705
4706		//Create the placeholder
4707		this._createPlaceholder();
4708
4709		//Set a containment if given in the options
4710		if(o.containment) {
4711			this._setContainment();
4712		}
4713
4714		if( o.cursor && o.cursor !== "auto" ) { // cursor option
4715			body = this.document.find( "body" );
4716
4717			// support: IE
4718			this.storedCursor = body.css( "cursor" );
4719			body.css( "cursor", o.cursor );
4720
4721			this.storedStylesheet = $( "<style>*{ cursor: "+o.cursor+" !important; }</style>" ).appendTo( body );
4722		}
4723
4724		if(o.opacity) { // opacity option
4725			if (this.helper.css("opacity")) {
4726				this._storedOpacity = this.helper.css("opacity");
4727			}
4728			this.helper.css("opacity", o.opacity);
4729		}
4730
4731		if(o.zIndex) { // zIndex option
4732			if (this.helper.css("zIndex")) {
4733				this._storedZIndex = this.helper.css("zIndex");
4734			}
4735			this.helper.css("zIndex", o.zIndex);
4736		}
4737
4738		//Prepare scrolling
4739		if(this.scrollParent[0] !== this.document[0] && this.scrollParent[0].tagName !== "HTML") {
4740			this.overflowOffset = this.scrollParent.offset();
4741		}
4742
4743		//Call callbacks
4744		this._trigger("start", event, this._uiHash());
4745
4746		//Recache the helper size
4747		if(!this._preserveHelperProportions) {
4748			this._cacheHelperProportions();
4749		}
4750
4751
4752		//Post "activate" events to possible containers
4753		if( !noActivation ) {
4754			for ( i = this.containers.length - 1; i >= 0; i-- ) {
4755				this.containers[ i ]._trigger( "activate", event, this._uiHash( this ) );
4756			}
4757		}
4758
4759		//Prepare possible droppables
4760		if($.ui.ddmanager) {
4761			$.ui.ddmanager.current = this;
4762		}
4763
4764		if ($.ui.ddmanager && !o.dropBehaviour) {
4765			$.ui.ddmanager.prepareOffsets(this, event);
4766		}
4767
4768		this.dragging = true;
4769
4770		this.helper.addClass("ui-sortable-helper");
4771		this._mouseDrag(event); //Execute the drag once - this causes the helper not to be visible before getting its correct position
4772		return true;
4773
4774	},
4775
4776	_mouseDrag: function(event) {
4777		var i, item, itemElement, intersection,
4778			o = this.options,
4779			scrolled = false;
4780
4781		//Compute the helpers position
4782		this.position = this._generatePosition(event);
4783		this.positionAbs = this._convertPositionTo("absolute");
4784
4785		if (!this.lastPositionAbs) {
4786			this.lastPositionAbs = this.positionAbs;
4787		}
4788
4789		//Do scrolling
4790		if(this.options.scroll) {
4791			if(this.scrollParent[0] !== this.document[0] && this.scrollParent[0].tagName !== "HTML") {
4792
4793				if((this.overflowOffset.top + this.scrollParent[0].offsetHeight) - event.pageY < o.scrollSensitivity) {
4794					this.scrollParent[0].scrollTop = scrolled = this.scrollParent[0].scrollTop + o.scrollSpeed;
4795				} else if(event.pageY - this.overflowOffset.top < o.scrollSensitivity) {
4796					this.scrollParent[0].scrollTop = scrolled = this.scrollParent[0].scrollTop - o.scrollSpeed;
4797				}
4798
4799				if((this.overflowOffset.left + this.scrollParent[0].offsetWidth) - event.pageX < o.scrollSensitivity) {
4800					this.scrollParent[0].scrollLeft = scrolled = this.scrollParent[0].scrollLeft + o.scrollSpeed;
4801				} else if(event.pageX - this.overflowOffset.left < o.scrollSensitivity) {
4802					this.scrollParent[0].scrollLeft = scrolled = this.scrollParent[0].scrollLeft - o.scrollSpeed;
4803				}
4804
4805			} else {
4806
4807				if(event.pageY - this.document.scrollTop() < o.scrollSensitivity) {
4808					scrolled = this.document.scrollTop(this.document.scrollTop() - o.scrollSpeed);
4809				} else if(this.window.height() - (event.pageY - this.document.scrollTop()) < o.scrollSensitivity) {
4810					scrolled = this.document.scrollTop(this.document.scrollTop() + o.scrollSpeed);
4811				}
4812
4813				if(event.pageX - this.document.scrollLeft() < o.scrollSensitivity) {
4814					scrolled = this.document.scrollLeft(this.document.scrollLeft() - o.scrollSpeed);
4815				} else if(this.window.width() - (event.pageX - this.document.scrollLeft()) < o.scrollSensitivity) {
4816					scrolled = this.document.scrollLeft(this.document.scrollLeft() + o.scrollSpeed);
4817				}
4818
4819			}
4820
4821			if(scrolled !== false && $.ui.ddmanager && !o.dropBehaviour) {
4822				$.ui.ddmanager.prepareOffsets(this, event);
4823			}
4824		}
4825
4826		//Regenerate the absolute position used for position checks
4827		this.positionAbs = this._convertPositionTo("absolute");
4828
4829		//Set the helper position
4830		if(!this.options.axis || this.options.axis !== "y") {
4831			this.helper[0].style.left = this.position.left+"px";
4832		}
4833		if(!this.options.axis || this.options.axis !== "x") {
4834			this.helper[0].style.top = this.position.top+"px";
4835		}
4836
4837		//Rearrange
4838		for (i = this.items.length - 1; i >= 0; i--) {
4839
4840			//Cache variables and intersection, continue if no intersection
4841			item = this.items[i];
4842			itemElement = item.item[0];
4843			intersection = this._intersectsWithPointer(item);
4844			if (!intersection) {
4845				continue;
4846			}
4847
4848			// Only put the placeholder inside the current Container, skip all
4849			// items from other containers. This works because when moving
4850			// an item from one container to another the
4851			// currentContainer is switched before the placeholder is moved.
4852			//
4853			// Without this, moving items in "sub-sortables" can cause
4854			// the placeholder to jitter between the outer and inner container.
4855			if (item.instance !== this.currentContainer) {
4856				continue;
4857			}
4858
4859			// cannot intersect with itself
4860			// no useless actions that have been done before
4861			// no action if the item moved is the parent of the item checked
4862			if (itemElement !== this.currentItem[0] &&
4863				this.placeholder[intersection === 1 ? "next" : "prev"]()[0] !== itemElement &&
4864				!$.contains(this.placeholder[0], itemElement) &&
4865				(this.options.type === "semi-dynamic" ? !$.contains(this.element[0], itemElement) : true)
4866			) {
4867
4868				this.direction = intersection === 1 ? "down" : "up";
4869
4870				if (this.options.tolerance === "pointer" || this._intersectsWithSides(item)) {
4871					this._rearrange(event, item);
4872				} else {
4873					break;
4874				}
4875
4876				this._trigger("change", event, this._uiHash());
4877				break;
4878			}
4879		}
4880
4881		//Post events to containers
4882		this._contactContainers(event);
4883
4884		//Interconnect with droppables
4885		if($.ui.ddmanager) {
4886			$.ui.ddmanager.drag(this, event);
4887		}
4888
4889		//Call callbacks
4890		this._trigger("sort", event, this._uiHash());
4891
4892		this.lastPositionAbs = this.positionAbs;
4893		return false;
4894
4895	},
4896
4897	_mouseStop: function(event, noPropagation) {
4898
4899		if(!event) {
4900			return;
4901		}
4902
4903		//If we are using droppables, inform the manager about the drop
4904		if ($.ui.ddmanager && !this.options.dropBehaviour) {
4905			$.ui.ddmanager.drop(this, event);
4906		}
4907
4908		if(this.options.revert) {
4909			var that = this,
4910				cur = this.placeholder.offset(),
4911				axis = this.options.axis,
4912				animation = {};
4913
4914			if ( !axis || axis === "x" ) {
4915				animation.left = cur.left - this.offset.parent.left - this.margins.left + (this.offsetParent[0] === this.document[0].body ? 0 : this.offsetParent[0].scrollLeft);
4916			}
4917			if ( !axis || axis === "y" ) {
4918				animation.top = cur.top - this.offset.parent.top - this.margins.top + (this.offsetParent[0] === this.document[0].body ? 0 : this.offsetParent[0].scrollTop);
4919			}
4920			this.reverting = true;
4921			$(this.helper).animate( animation, parseInt(this.options.revert, 10) || 500, function() {
4922				that._clear(event);
4923			});
4924		} else {
4925			this._clear(event, noPropagation);
4926		}
4927
4928		return false;
4929
4930	},
4931
4932	cancel: function() {
4933
4934		if(this.dragging) {
4935
4936			this._mouseUp({ target: null });
4937
4938			if(this.options.helper === "original") {
4939				this.currentItem.css(this._storedCSS).removeClass("ui-sortable-helper");
4940			} else {
4941				this.currentItem.show();
4942			}
4943
4944			//Post deactivating events to containers
4945			for (var i = this.containers.length - 1; i >= 0; i--){
4946				this.containers[i]._trigger("deactivate", null, this._uiHash(this));
4947				if(this.containers[i].containerCache.over) {
4948					this.containers[i]._trigger("out", null, this._uiHash(this));
4949					this.containers[i].containerCache.over = 0;
4950				}
4951			}
4952
4953		}
4954
4955		if (this.placeholder) {
4956			//$(this.placeholder[0]).remove(); would have been the jQuery way - unfortunately, it unbinds ALL events from the original node!
4957			if(this.placeholder[0].parentNode) {
4958				this.placeholder[0].parentNode.removeChild(this.placeholder[0]);
4959			}
4960			if(this.options.helper !== "original" && this.helper && this.helper[0].parentNode) {
4961				this.helper.remove();
4962			}
4963
4964			$.extend(this, {
4965				helper: null,
4966				dragging: false,
4967				reverting: false,
4968				_noFinalSort: null
4969			});
4970
4971			if(this.domPosition.prev) {
4972				$(this.domPosition.prev).after(this.currentItem);
4973			} else {
4974				$(this.domPosition.parent).prepend(this.currentItem);
4975			}
4976		}
4977
4978		return this;
4979
4980	},
4981
4982	serialize: function(o) {
4983
4984		var items = this._getItemsAsjQuery(o && o.connected),
4985			str = [];
4986		o = o || {};
4987
4988		$(items).each(function() {
4989			var res = ($(o.item || this).attr(o.attribute || "id") || "").match(o.expression || (/(.+)[\-=_](.+)/));
4990			if (res) {
4991				str.push((o.key || res[1]+"[]")+"="+(o.key && o.expression ? res[1] : res[2]));
4992			}
4993		});
4994
4995		if(!str.length && o.key) {
4996			str.push(o.key + "=");
4997		}
4998
4999		return str.join("&");
5000
5001	},
5002
5003	toArray: function(o) {
5004
5005		var items = this._getItemsAsjQuery(o && o.connected),
5006			ret = [];
5007
5008		o = o || {};
5009
5010		items.each(function() { ret.push($(o.item || this).attr(o.attribute || "id") || ""); });
5011		return ret;
5012
5013	},
5014
5015	/* Be careful with the following core functions */
5016	_intersectsWith: function(item) {
5017
5018		var x1 = this.positionAbs.left,
5019			x2 = x1 + this.helperProportions.width,
5020			y1 = this.positionAbs.top,
5021			y2 = y1 + this.helperProportions.height,
5022			l = item.left,
5023			r = l + item.width,
5024			t = item.top,
5025			b = t + item.height,
5026			dyClick = this.offset.click.top,
5027			dxClick = this.offset.click.left,
5028			isOverElementHeight = ( this.options.axis === "x" ) || ( ( y1 + dyClick ) > t && ( y1 + dyClick ) < b ),
5029			isOverElementWidth = ( this.options.axis === "y" ) || ( ( x1 + dxClick ) > l && ( x1 + dxClick ) < r ),
5030			isOverElement = isOverElementHeight && isOverElementWidth;
5031
5032		if ( this.options.tolerance === "pointer" ||
5033			this.options.forcePointerForContainers ||
5034			(this.options.tolerance !== "pointer" && this.helperProportions[this.floating ? "width" : "height"] > item[this.floating ? "width" : "height"])
5035		) {
5036			return isOverElement;
5037		} else {
5038
5039			return (l < x1 + (this.helperProportions.width / 2) && // Right Half
5040				x2 - (this.helperProportions.width / 2) < r && // Left Half
5041				t < y1 + (this.helperProportions.height / 2) && // Bottom Half
5042				y2 - (this.helperProportions.height / 2) < b ); // Top Half
5043
5044		}
5045	},
5046
5047	_intersectsWithPointer: function(item) {
5048
5049		var isOverElementHeight = (this.options.axis === "x") || this._isOverAxis(this.positionAbs.top + this.offset.click.top, item.top, item.height),
5050			isOverElementWidth = (this.options.axis === "y") || this._isOverAxis(this.positionAbs.left + this.offset.click.left, item.left, item.width),
5051			isOverElement = isOverElementHeight && isOverElementWidth,
5052			verticalDirection = this._getDragVerticalDirection(),
5053			horizontalDirection = this._getDragHorizontalDirection();
5054
5055		if (!isOverElement) {
5056			return false;
5057		}
5058
5059		return this.floating ?
5060			( ((horizontalDirection && horizontalDirection === "right") || verticalDirection === "down") ? 2 : 1 )
5061			: ( verticalDirection && (verticalDirection === "down" ? 2 : 1) );
5062
5063	},
5064
5065	_intersectsWithSides: function(item) {
5066
5067		var isOverBottomHalf = this._isOverAxis(this.positionAbs.top + this.offset.click.top, item.top + (item.height/2), item.height),
5068			isOverRightHalf = this._isOverAxis(this.positionAbs.left + this.offset.click.left, item.left + (item.width/2), item.width),
5069			verticalDirection = this._getDragVerticalDirection(),
5070			horizontalDirection = this._getDragHorizontalDirection();
5071
5072		if (this.floating && horizontalDirection) {
5073			return ((horizontalDirection === "right" && isOverRightHalf) || (horizontalDirection === "left" && !isOverRightHalf));
5074		} else {
5075			return verticalDirection && ((verticalDirection === "down" && isOverBottomHalf) || (verticalDirection === "up" && !isOverBottomHalf));
5076		}
5077
5078	},
5079
5080	_getDragVerticalDirection: function() {
5081		var delta = this.positionAbs.top - this.lastPositionAbs.top;
5082		return delta !== 0 && (delta > 0 ? "down" : "up");
5083	},
5084
5085	_getDragHorizontalDirection: function() {
5086		var delta = this.positionAbs.left - this.lastPositionAbs.left;
5087		return delta !== 0 && (delta > 0 ? "right" : "left");
5088	},
5089
5090	refresh: function(event) {
5091		this._refreshItems(event);
5092		this._setHandleClassName();
5093		this.refreshPositions();
5094		return this;
5095	},
5096
5097	_connectWith: function() {
5098		var options = this.options;
5099		return options.connectWith.constructor === String ? [options.connectWith] : options.connectWith;
5100	},
5101
5102	_getItemsAsjQuery: function(connected) {
5103
5104		var i, j, cur, inst,
5105			items = [],
5106			queries = [],
5107			connectWith = this._connectWith();
5108
5109		if(connectWith && connected) {
5110			for (i = connectWith.length - 1; i >= 0; i--){
5111				cur = $(connectWith[i], this.document[0]);
5112				for ( j = cur.length - 1; j >= 0; j--){
5113					inst = $.data(cur[j], this.widgetFullName);
5114					if(inst && inst !== this && !inst.options.disabled) {
5115						queries.push([$.isFunction(inst.options.items) ? inst.options.items.call(inst.element) : $(inst.options.items, inst.element).not(".ui-sortable-helper").not(".ui-sortable-placeholder"), inst]);
5116					}
5117				}
5118			}
5119		}
5120
5121		queries.push([$.isFunction(this.options.items) ? this.options.items.call(this.element, null, { options: this.options, item: this.currentItem }) : $(this.options.items, this.element).not(".ui-sortable-helper").not(".ui-sortable-placeholder"), this]);
5122
5123		function addItems() {
5124			items.push( this );
5125		}
5126		for (i = queries.length - 1; i >= 0; i--){
5127			queries[i][0].each( addItems );
5128		}
5129
5130		return $(items);
5131
5132	},
5133
5134	_removeCurrentsFromItems: function() {
5135
5136		var list = this.currentItem.find(":data(" + this.widgetName + "-item)");
5137
5138		this.items = $.grep(this.items, function (item) {
5139			for (var j=0; j < list.length; j++) {
5140				if(list[j] === item.item[0]) {
5141					return false;
5142				}
5143			}
5144			return true;
5145		});
5146
5147	},
5148
5149	_refreshItems: function(event) {
5150
5151		this.items = [];
5152		this.containers = [this];
5153
5154		var i, j, cur, inst, targetData, _queries, item, queriesLength,
5155			items = this.items,
5156			queries = [[$.isFunction(this.options.items) ? this.options.items.call(this.element[0], event, { item: this.currentItem }) : $(this.options.items, this.element), this]],
5157			connectWith = this._connectWith();
5158
5159		if(connectWith && this.ready) { //Shouldn't be run the first time through due to massive slow-down
5160			for (i = connectWith.length - 1; i >= 0; i--){
5161				cur = $(connectWith[i], this.document[0]);
5162				for (j = cur.length - 1; j >= 0; j--){
5163					inst = $.data(cur[j], this.widgetFullName);
5164					if(inst && inst !== this && !inst.options.disabled) {
5165						queries.push([$.isFunction(inst.options.items) ? inst.options.items.call(inst.element[0], event, { item: this.currentItem }) : $(inst.options.items, inst.element), inst]);
5166						this.containers.push(inst);
5167					}
5168				}
5169			}
5170		}
5171
5172		for (i = queries.length - 1; i >= 0; i--) {
5173			targetData = queries[i][1];
5174			_queries = queries[i][0];
5175
5176			for (j=0, queriesLength = _queries.length; j < queriesLength; j++) {
5177				item = $(_queries[j]);
5178
5179				item.data(this.widgetName + "-item", targetData); // Data for target checking (mouse manager)
5180
5181				items.push({
5182					item: item,
5183					instance: targetData,
5184					width: 0, height: 0,
5185					left: 0, top: 0
5186				});
5187			}
5188		}
5189
5190	},
5191
5192	refreshPositions: function(fast) {
5193
5194		// Determine whether items are being displayed horizontally
5195		this.floating = this.items.length ?
5196			this.options.axis === "x" || this._isFloating( this.items[ 0 ].item ) :
5197			false;
5198
5199		//This has to be redone because due to the item being moved out/into the offsetParent, the offsetParent's position will change
5200		if(this.offsetParent && this.helper) {
5201			this.offset.parent = this._getParentOffset();
5202		}
5203
5204		var i, item, t, p;
5205
5206		for (i = this.items.length - 1; i >= 0; i--){
5207			item = this.items[i];
5208
5209			//We ignore calculating positions of all connected containers when we're not over them
5210			if(item.instance !== this.currentContainer && this.currentContainer && item.item[0] !== this.currentItem[0]) {
5211				continue;
5212			}
5213
5214			t = this.options.toleranceElement ? $(this.options.toleranceElement, item.item) : item.item;
5215
5216			if (!fast) {
5217				item.width = t.outerWidth();
5218				item.height = t.outerHeight();
5219			}
5220
5221			p = t.offset();
5222			item.left = p.left;
5223			item.top = p.top;
5224		}
5225
5226		if(this.options.custom && this.options.custom.refreshContainers) {
5227			this.options.custom.refreshContainers.call(this);
5228		} else {
5229			for (i = this.containers.length - 1; i >= 0; i--){
5230				p = this.containers[i].element.offset();
5231				this.containers[i].containerCache.left = p.left;
5232				this.containers[i].containerCache.top = p.top;
5233				this.containers[i].containerCache.width = this.containers[i].element.outerWidth();
5234				this.containers[i].containerCache.height = this.containers[i].element.outerHeight();
5235			}
5236		}
5237
5238		return this;
5239	},
5240
5241	_createPlaceholder: function(that) {
5242		that = that || this;
5243		var className,
5244			o = that.options;
5245
5246		if(!o.placeholder || o.placeholder.constructor === String) {
5247			className = o.placeholder;
5248			o.placeholder = {
5249				element: function() {
5250
5251					var nodeName = that.currentItem[0].nodeName.toLowerCase(),
5252						element = $( "<" + nodeName + ">", that.document[0] )
5253							.addClass(className || that.currentItem[0].className+" ui-sortable-placeholder")
5254							.removeClass("ui-sortable-helper");
5255
5256					if ( nodeName === "tbody" ) {
5257						that._createTrPlaceholder(
5258							that.currentItem.find( "tr" ).eq( 0 ),
5259							$( "<tr>", that.document[ 0 ] ).appendTo( element )
5260						);
5261					} else if ( nodeName === "tr" ) {
5262						that._createTrPlaceholder( that.currentItem, element );
5263					} else if ( nodeName === "img" ) {
5264						element.attr( "src", that.currentItem.attr( "src" ) );
5265					}
5266
5267					if ( !className ) {
5268						element.css( "visibility", "hidden" );
5269					}
5270
5271					return element;
5272				},
5273				update: function(container, p) {
5274
5275					// 1. If a className is set as 'placeholder option, we don't force sizes - the class is responsible for that
5276					// 2. The option 'forcePlaceholderSize can be enabled to force it even if a class name is specified
5277					if(className && !o.forcePlaceholderSize) {
5278						return;
5279					}
5280
5281					//If the element doesn't have a actual height by itself (without styles coming from a stylesheet), it receives the inline height from the dragged item
5282					if(!p.height()) { p.height(that.currentItem.innerHeight() - parseInt(that.currentItem.css("paddingTop")||0, 10) - parseInt(that.currentItem.css("paddingBottom")||0, 10)); }
5283					if(!p.width()) { p.width(that.currentItem.innerWidth() - parseInt(that.currentItem.css("paddingLeft")||0, 10) - parseInt(that.currentItem.css("paddingRight")||0, 10)); }
5284				}
5285			};
5286		}
5287
5288		//Create the placeholder
5289		that.placeholder = $(o.placeholder.element.call(that.element, that.currentItem));
5290
5291		//Append it after the actual current item
5292		that.currentItem.after(that.placeholder);
5293
5294		//Update the size of the placeholder (TODO: Logic to fuzzy, see line 316/317)
5295		o.placeholder.update(that, that.placeholder);
5296
5297	},
5298
5299	_createTrPlaceholder: function( sourceTr, targetTr ) {
5300		var that = this;
5301
5302		sourceTr.children().each(function() {
5303			$( "<td>&#160;</td>", that.document[ 0 ] )
5304				.attr( "colspan", $( this ).attr( "colspan" ) || 1 )
5305				.appendTo( targetTr );
5306		});
5307	},
5308
5309	_contactContainers: function(event) {
5310		var i, j, dist, itemWithLeastDistance, posProperty, sizeProperty, cur, nearBottom, floating, axis,
5311			innermostContainer = null,
5312			innermostIndex = null;
5313
5314		// get innermost container that intersects with item
5315		for (i = this.containers.length - 1; i >= 0; i--) {
5316
5317			// never consider a container that's located within the item itself
5318			if($.contains(this.currentItem[0], this.containers[i].element[0])) {
5319				continue;
5320			}
5321
5322			if(this._intersectsWith(this.containers[i].containerCache)) {
5323
5324				// if we've already found a container and it's more "inner" than this, then continue
5325				if(innermostContainer && $.contains(this.containers[i].element[0], innermostContainer.element[0])) {
5326					continue;
5327				}
5328
5329				innermostContainer = this.containers[i];
5330				innermostIndex = i;
5331
5332			} else {
5333				// container doesn't intersect. trigger "out" event if necessary
5334				if(this.containers[i].containerCache.over) {
5335					this.containers[i]._trigger("out", event, this._uiHash(this));
5336					this.containers[i].containerCache.over = 0;
5337				}
5338			}
5339
5340		}
5341
5342		// if no intersecting containers found, return
5343		if(!innermostContainer) {
5344			return;
5345		}
5346
5347		// move the item into the container if it's not there already
5348		if(this.containers.length === 1) {
5349			if (!this.containers[innermostIndex].containerCache.over) {
5350				this.containers[innermostIndex]._trigger("over", event, this._uiHash(this));
5351				this.containers[innermostIndex].containerCache.over = 1;
5352			}
5353		} else {
5354
5355			//When entering a new container, we will find the item with the least distance and append our item near it
5356			dist = 10000;
5357			itemWithLeastDistance = null;
5358			floating = innermostContainer.floating || this._isFloating(this.currentItem);
5359			posProperty = floating ? "left" : "top";
5360			sizeProperty = floating ? "width" : "height";
5361			axis = floating ? "clientX" : "clientY";
5362
5363			for (j = this.items.length - 1; j >= 0; j--) {
5364				if(!$.contains(this.containers[innermostIndex].element[0], this.items[j].item[0])) {
5365					continue;
5366				}
5367				if(this.items[j].item[0] === this.currentItem[0]) {
5368					continue;
5369				}
5370
5371				cur = this.items[j].item.offset()[posProperty];
5372				nearBottom = false;
5373				if ( event[ axis ] - cur > this.items[ j ][ sizeProperty ] / 2 ) {
5374					nearBottom = true;
5375				}
5376
5377				if ( Math.abs( event[ axis ] - cur ) < dist ) {
5378					dist = Math.abs( event[ axis ] - cur );
5379					itemWithLeastDistance = this.items[ j ];
5380					this.direction = nearBottom ? "up": "down";
5381				}
5382			}
5383
5384			//Check if dropOnEmpty is enabled
5385			if(!itemWithLeastDistance && !this.options.dropOnEmpty) {
5386				return;
5387			}
5388
5389			if(this.currentContainer === this.containers[innermostIndex]) {
5390				if ( !this.currentContainer.containerCache.over ) {
5391					this.containers[ innermostIndex ]._trigger( "over", event, this._uiHash() );
5392					this.currentContainer.containerCache.over = 1;
5393				}
5394				return;
5395			}
5396
5397			itemWithLeastDistance ? this._rearrange(event, itemWithLeastDistance, null, true) : this._rearrange(event, null, this.containers[innermostIndex].element, true);
5398			this._trigger("change", event, this._uiHash());
5399			this.containers[innermostIndex]._trigger("change", event, this._uiHash(this));
5400			this.currentContainer = this.containers[innermostIndex];
5401
5402			//Update the placeholder
5403			this.options.placeholder.update(this.currentContainer, this.placeholder);
5404
5405			this.containers[innermostIndex]._trigger("over", event, this._uiHash(this));
5406			this.containers[innermostIndex].containerCache.over = 1;
5407		}
5408
5409
5410	},
5411
5412	_createHelper: function(event) {
5413
5414		var o = this.options,
5415			helper = $.isFunction(o.helper) ? $(o.helper.apply(this.element[0], [event, this.currentItem])) : (o.helper === "clone" ? this.currentItem.clone() : this.currentItem);
5416
5417		//Add the helper to the DOM if that didn't happen already
5418		if(!helper.parents("body").length) {
5419			$(o.appendTo !== "parent" ? o.appendTo : this.currentItem[0].parentNode)[0].appendChild(helper[0]);
5420		}
5421
5422		if(helper[0] === this.currentItem[0]) {
5423			this._storedCSS = { width: this.currentItem[0].style.width, height: this.currentItem[0].style.height, position: this.currentItem.css("position"), top: this.currentItem.css("top"), left: this.currentItem.css("left") };
5424		}
5425
5426		if(!helper[0].style.width || o.forceHelperSize) {
5427			helper.width(this.currentItem.width());
5428		}
5429		if(!helper[0].style.height || o.forceHelperSize) {
5430			helper.height(this.currentItem.height());
5431		}
5432
5433		return helper;
5434
5435	},
5436
5437	_adjustOffsetFromHelper: function(obj) {
5438		if (typeof obj === "string") {
5439			obj = obj.split(" ");
5440		}
5441		if ($.isArray(obj)) {
5442			obj = {left: +obj[0], top: +obj[1] || 0};
5443		}
5444		if ("left" in obj) {
5445			this.offset.click.left = obj.left + this.margins.left;
5446		}
5447		if ("right" in obj) {
5448			this.offset.click.left = this.helperProportions.width - obj.right + this.margins.left;
5449		}
5450		if ("top" in obj) {
5451			this.offset.click.top = obj.top + this.margins.top;
5452		}
5453		if ("bottom" in obj) {
5454			this.offset.click.top = this.helperProportions.height - obj.bottom + this.margins.top;
5455		}
5456	},
5457
5458	_getParentOffset: function() {
5459
5460
5461		//Get the offsetParent and cache its position
5462		this.offsetParent = this.helper.offsetParent();
5463		var po = this.offsetParent.offset();
5464
5465		// This is a special case where we need to modify a offset calculated on start, since the following happened:
5466		// 1. The position of the helper is absolute, so it's position is calculated based on the next positioned parent
5467		// 2. The actual offset parent is a child of the scroll parent, and the scroll parent isn't the document, which means that
5468		//    the scroll is included in the initial calculation of the offset of the parent, and never recalculated upon drag
5469		if(this.cssPosition === "absolute" && this.scrollParent[0] !== this.document[0] && $.contains(this.scrollParent[0], this.offsetParent[0])) {
5470			po.left += this.scrollParent.scrollLeft();
5471			po.top += this.scrollParent.scrollTop();
5472		}
5473
5474		// This needs to be actually done for all browsers, since pageX/pageY includes this information
5475		// with an ugly IE fix
5476		if( this.offsetParent[0] === this.document[0].body || (this.offsetParent[0].tagName && this.offsetParent[0].tagName.toLowerCase() === "html" && $.ui.ie)) {
5477			po = { top: 0, left: 0 };
5478		}
5479
5480		return {
5481			top: po.top + (parseInt(this.offsetParent.css("borderTopWidth"),10) || 0),
5482			left: po.left + (parseInt(this.offsetParent.css("borderLeftWidth"),10) || 0)
5483		};
5484
5485	},
5486
5487	_getRelativeOffset: function() {
5488
5489		if(this.cssPosition === "relative") {
5490			var p = this.currentItem.position();
5491			return {
5492				top: p.top - (parseInt(this.helper.css("top"),10) || 0) + this.scrollParent.scrollTop(),
5493				left: p.left - (parseInt(this.helper.css("left"),10) || 0) + this.scrollParent.scrollLeft()
5494			};
5495		} else {
5496			return { top: 0, left: 0 };
5497		}
5498
5499	},
5500
5501	_cacheMargins: function() {
5502		this.margins = {
5503			left: (parseInt(this.currentItem.css("marginLeft"),10) || 0),
5504			top: (parseInt(this.currentItem.css("marginTop"),10) || 0)
5505		};
5506	},
5507
5508	_cacheHelperProportions: function() {
5509		this.helperProportions = {
5510			width: this.helper.outerWidth(),
5511			height: this.helper.outerHeight()
5512		};
5513	},
5514
5515	_setContainment: function() {
5516
5517		var ce, co, over,
5518			o = this.options;
5519		if(o.containment === "parent") {
5520			o.containment = this.helper[0].parentNode;
5521		}
5522		if(o.containment === "document" || o.containment === "window") {
5523			this.containment = [
5524				0 - this.offset.relative.left - this.offset.parent.left,
5525				0 - this.offset.relative.top - this.offset.parent.top,
5526				o.containment === "document" ? this.document.width() : this.window.width() - this.helperProportions.width - this.margins.left,
5527				(o.containment === "document" ? this.document.width() : this.window.height() || this.document[0].body.parentNode.scrollHeight) - this.helperProportions.height - this.margins.top
5528			];
5529		}
5530
5531		if(!(/^(document|window|parent)$/).test(o.containment)) {
5532			ce = $(o.containment)[0];
5533			co = $(o.containment).offset();
5534			over = ($(ce).css("overflow") !== "hidden");
5535
5536			this.containment = [
5537				co.left + (parseInt($(ce).css("borderLeftWidth"),10) || 0) + (parseInt($(ce).css("paddingLeft"),10) || 0) - this.margins.left,
5538				co.top + (parseInt($(ce).css("borderTopWidth"),10) || 0) + (parseInt($(ce).css("paddingTop"),10) || 0) - this.margins.top,
5539				co.left+(over ? Math.max(ce.scrollWidth,ce.offsetWidth) : ce.offsetWidth) - (parseInt($(ce).css("borderLeftWidth"),10) || 0) - (parseInt($(ce).css("paddingRight"),10) || 0) - this.helperProportions.width - this.margins.left,
5540				co.top+(over ? Math.max(ce.scrollHeight,ce.offsetHeight) : ce.offsetHeight) - (parseInt($(ce).css("borderTopWidth"),10) || 0) - (parseInt($(ce).css("paddingBottom"),10) || 0) - this.helperProportions.height - this.margins.top
5541			];
5542		}
5543
5544	},
5545
5546	_convertPositionTo: function(d, pos) {
5547
5548		if(!pos) {
5549			pos = this.position;
5550		}
5551		var mod = d === "absolute" ? 1 : -1,
5552			scroll = this.cssPosition === "absolute" && !(this.scrollParent[0] !== this.document[0] && $.contains(this.scrollParent[0], this.offsetParent[0])) ? this.offsetParent : this.scrollParent,
5553			scrollIsRootNode = (/(html|body)/i).test(scroll[0].tagName);
5554
5555		return {
5556			top: (
5557				pos.top	+																// The absolute mouse position
5558				this.offset.relative.top * mod +										// Only for relative positioned nodes: Relative offset from element to offset parent
5559				this.offset.parent.top * mod -											// The offsetParent's offset without borders (offset + border)
5560				( ( this.cssPosition === "fixed" ? -this.scrollParent.scrollTop() : ( scrollIsRootNode ? 0 : scroll.scrollTop() ) ) * mod)
5561			),
5562			left: (
5563				pos.left +																// The absolute mouse position
5564				this.offset.relative.left * mod +										// Only for relative positioned nodes: Relative offset from element to offset parent
5565				this.offset.parent.left * mod	-										// The offsetParent's offset without borders (offset + border)
5566				( ( this.cssPosition === "fixed" ? -this.scrollParent.scrollLeft() : scrollIsRootNode ? 0 : scroll.scrollLeft() ) * mod)
5567			)
5568		};
5569
5570	},
5571
5572	_generatePosition: function(event) {
5573
5574		var top, left,
5575			o = this.options,
5576			pageX = event.pageX,
5577			pageY = event.pageY,
5578			scroll = this.cssPosition === "absolute" && !(this.scrollParent[0] !== this.document[0] && $.contains(this.scrollParent[0], this.offsetParent[0])) ? this.offsetParent : this.scrollParent, scrollIsRootNode = (/(html|body)/i).test(scroll[0].tagName);
5579
5580		// This is another very weird special case that only happens for relative elements:
5581		// 1. If the css position is relative
5582		// 2. and the scroll parent is the document or similar to the offset parent
5583		// we have to refresh the relative offset during the scroll so there are no jumps
5584		if(this.cssPosition === "relative" && !(this.scrollParent[0] !== this.document[0] && this.scrollParent[0] !== this.offsetParent[0])) {
5585			this.offset.relative = this._getRelativeOffset();
5586		}
5587
5588		/*
5589		 * - Position constraining -
5590		 * Constrain the position to a mix of grid, containment.
5591		 */
5592
5593		if(this.originalPosition) { //If we are not dragging yet, we won't check for options
5594
5595			if(this.containment) {
5596				if(event.pageX - this.offset.click.left < this.containment[0]) {
5597					pageX = this.containment[0] + this.offset.click.left;
5598				}
5599				if(event.pageY - this.offset.click.top < this.containment[1]) {
5600					pageY = this.containment[1] + this.offset.click.top;
5601				}
5602				if(event.pageX - this.offset.click.left > this.containment[2]) {
5603					pageX = this.containment[2] + this.offset.click.left;
5604				}
5605				if(event.pageY - this.offset.click.top > this.containment[3]) {
5606					pageY = this.containment[3] + this.offset.click.top;
5607				}
5608			}
5609
5610			if(o.grid) {
5611				top = this.originalPageY + Math.round((pageY - this.originalPageY) / o.grid[1]) * o.grid[1];
5612				pageY = this.containment ? ( (top - this.offset.click.top >= this.containment[1] && top - this.offset.click.top <= this.containment[3]) ? top : ((top - this.offset.click.top >= this.containment[1]) ? top - o.grid[1] : top + o.grid[1])) : top;
5613
5614				left = this.originalPageX + Math.round((pageX - this.originalPageX) / o.grid[0]) * o.grid[0];
5615				pageX = this.containment ? ( (left - this.offset.click.left >= this.containment[0] && left - this.offset.click.left <= this.containment[2]) ? left : ((left - this.offset.click.left >= this.containment[0]) ? left - o.grid[0] : left + o.grid[0])) : left;
5616			}
5617
5618		}
5619
5620		return {
5621			top: (
5622				pageY -																// The absolute mouse position
5623				this.offset.click.top -													// Click offset (relative to the element)
5624				this.offset.relative.top	-											// Only for relative positioned nodes: Relative offset from element to offset parent
5625				this.offset.parent.top +												// The offsetParent's offset without borders (offset + border)
5626				( ( this.cssPosition === "fixed" ? -this.scrollParent.scrollTop() : ( scrollIsRootNode ? 0 : scroll.scrollTop() ) ))
5627			),
5628			left: (
5629				pageX -																// The absolute mouse position
5630				this.offset.click.left -												// Click offset (relative to the element)
5631				this.offset.relative.left	-											// Only for relative positioned nodes: Relative offset from element to offset parent
5632				this.offset.parent.left +												// The offsetParent's offset without borders (offset + border)
5633				( ( this.cssPosition === "fixed" ? -this.scrollParent.scrollLeft() : scrollIsRootNode ? 0 : scroll.scrollLeft() ))
5634			)
5635		};
5636
5637	},
5638
5639	_rearrange: function(event, i, a, hardRefresh) {
5640
5641		a ? a[0].appendChild(this.placeholder[0]) : i.item[0].parentNode.insertBefore(this.placeholder[0], (this.direction === "down" ? i.item[0] : i.item[0].nextSibling));
5642
5643		//Various things done here to improve the performance:
5644		// 1. we create a setTimeout, that calls refreshPositions
5645		// 2. on the instance, we have a counter variable, that get's higher after every append
5646		// 3. on the local scope, we copy the counter variable, and check in the timeout, if it's still the same
5647		// 4. this lets only the last addition to the timeout stack through
5648		this.counter = this.counter ? ++this.counter : 1;
5649		var counter = this.counter;
5650
5651		this._delay(function() {
5652			if(counter === this.counter) {
5653				this.refreshPositions(!hardRefresh); //Precompute after each DOM insertion, NOT on mousemove
5654			}
5655		});
5656
5657	},
5658
5659	_clear: function(event, noPropagation) {
5660
5661		this.reverting = false;
5662		// We delay all events that have to be triggered to after the point where the placeholder has been removed and
5663		// everything else normalized again
5664		var i,
5665			delayedTriggers = [];
5666
5667		// We first have to update the dom position of the actual currentItem
5668		// Note: don't do it if the current item is already removed (by a user), or it gets reappended (see #4088)
5669		if(!this._noFinalSort && this.currentItem.parent().length) {
5670			this.placeholder.before(this.currentItem);
5671		}
5672		this._noFinalSort = null;
5673
5674		if(this.helper[0] === this.currentItem[0]) {
5675			for(i in this._storedCSS) {
5676				if(this._storedCSS[i] === "auto" || this._storedCSS[i] === "static") {
5677					this._storedCSS[i] = "";
5678				}
5679			}
5680			this.currentItem.css(this._storedCSS).removeClass("ui-sortable-helper");
5681		} else {
5682			this.currentItem.show();
5683		}
5684
5685		if(this.fromOutside && !noPropagation) {
5686			delayedTriggers.push(function(event) { this._trigger("receive", event, this._uiHash(this.fromOutside)); });
5687		}
5688		if((this.fromOutside || this.domPosition.prev !== this.currentItem.prev().not(".ui-sortable-helper")[0] || this.domPosition.parent !== this.currentItem.parent()[0]) && !noPropagation) {
5689			delayedTriggers.push(function(event) { this._trigger("update", event, this._uiHash()); }); //Trigger update callback if the DOM position has changed
5690		}
5691
5692		// Check if the items Container has Changed and trigger appropriate
5693		// events.
5694		if (this !== this.currentContainer) {
5695			if(!noPropagation) {
5696				delayedTriggers.push(function(event) { this._trigger("remove", event, this._uiHash()); });
5697				delayedTriggers.push((function(c) { return function(event) { c._trigger("receive", event, this._uiHash(this)); };  }).call(this, this.currentContainer));
5698				delayedTriggers.push((function(c) { return function(event) { c._trigger("update", event, this._uiHash(this));  }; }).call(this, this.currentContainer));
5699			}
5700		}
5701
5702
5703		//Post events to containers
5704		function delayEvent( type, instance, container ) {
5705			return function( event ) {
5706				container._trigger( type, event, instance._uiHash( instance ) );
5707			};
5708		}
5709		for (i = this.containers.length - 1; i >= 0; i--){
5710			if (!noPropagation) {
5711				delayedTriggers.push( delayEvent( "deactivate", this, this.containers[ i ] ) );
5712			}
5713			if(this.containers[i].containerCache.over) {
5714				delayedTriggers.push( delayEvent( "out", this, this.containers[ i ] ) );
5715				this.containers[i].containerCache.over = 0;
5716			}
5717		}
5718
5719		//Do what was originally in plugins
5720		if ( this.storedCursor ) {
5721			this.document.find( "body" ).css( "cursor", this.storedCursor );
5722			this.storedStylesheet.remove();
5723		}
5724		if(this._storedOpacity) {
5725			this.helper.css("opacity", this._storedOpacity);
5726		}
5727		if(this._storedZIndex) {
5728			this.helper.css("zIndex", this._storedZIndex === "auto" ? "" : this._storedZIndex);
5729		}
5730
5731		this.dragging = false;
5732
5733		if(!noPropagation) {
5734			this._trigger("beforeStop", event, this._uiHash());
5735		}
5736
5737		//$(this.placeholder[0]).remove(); would have been the jQuery way - unfortunately, it unbinds ALL events from the original node!
5738		this.placeholder[0].parentNode.removeChild(this.placeholder[0]);
5739
5740		if ( !this.cancelHelperRemoval ) {
5741			if ( this.helper[ 0 ] !== this.currentItem[ 0 ] ) {
5742				this.helper.remove();
5743			}
5744			this.helper = null;
5745		}
5746
5747		if(!noPropagation) {
5748			for (i=0; i < delayedTriggers.length; i++) {
5749				delayedTriggers[i].call(this, event);
5750			} //Trigger all delayed events
5751			this._trigger("stop", event, this._uiHash());
5752		}
5753
5754		this.fromOutside = false;
5755		return !this.cancelHelperRemoval;
5756
5757	},
5758
5759	_trigger: function() {
5760		if ($.Widget.prototype._trigger.apply(this, arguments) === false) {
5761			this.cancel();
5762		}
5763	},
5764
5765	_uiHash: function(_inst) {
5766		var inst = _inst || this;
5767		return {
5768			helper: inst.helper,
5769			placeholder: inst.placeholder || $([]),
5770			position: inst.position,
5771			originalPosition: inst.originalPosition,
5772			offset: inst.positionAbs,
5773			item: inst.currentItem,
5774			sender: _inst ? _inst.element : null
5775		};
5776	}
5777
5778});
5779
5780
5781/*!
5782 * jQuery UI Accordion 1.11.4
5783 * http://jqueryui.com
5784 *
5785 * Copyright jQuery Foundation and other contributors
5786 * Released under the MIT license.
5787 * http://jquery.org/license
5788 *
5789 * http://api.jqueryui.com/accordion/
5790 */
5791
5792
5793var accordion = $.widget( "ui.accordion", {
5794	version: "1.11.4",
5795	options: {
5796		active: 0,
5797		animate: {},
5798		collapsible: false,
5799		event: "click",
5800		header: "> li > :first-child,> :not(li):even",
5801		heightStyle: "auto",
5802		icons: {
5803			activeHeader: "ui-icon-triangle-1-s",
5804			header: "ui-icon-triangle-1-e"
5805		},
5806
5807		// callbacks
5808		activate: null,
5809		beforeActivate: null
5810	},
5811
5812	hideProps: {
5813		borderTopWidth: "hide",
5814		borderBottomWidth: "hide",
5815		paddingTop: "hide",
5816		paddingBottom: "hide",
5817		height: "hide"
5818	},
5819
5820	showProps: {
5821		borderTopWidth: "show",
5822		borderBottomWidth: "show",
5823		paddingTop: "show",
5824		paddingBottom: "show",
5825		height: "show"
5826	},
5827
5828	_create: function() {
5829		var options = this.options;
5830		this.prevShow = this.prevHide = $();
5831		this.element.addClass( "ui-accordion ui-widget ui-helper-reset" )
5832			// ARIA
5833			.attr( "role", "tablist" );
5834
5835		// don't allow collapsible: false and active: false / null
5836		if ( !options.collapsible && (options.active === false || options.active == null) ) {
5837			options.active = 0;
5838		}
5839
5840		this._processPanels();
5841		// handle negative values
5842		if ( options.active < 0 ) {
5843			options.active += this.headers.length;
5844		}
5845		this._refresh();
5846	},
5847
5848	_getCreateEventData: function() {
5849		return {
5850			header: this.active,
5851			panel: !this.active.length ? $() : this.active.next()
5852		};
5853	},
5854
5855	_createIcons: function() {
5856		var icons = this.options.icons;
5857		if ( icons ) {
5858			$( "<span>" )
5859				.addClass( "ui-accordion-header-icon ui-icon " + icons.header )
5860				.prependTo( this.headers );
5861			this.active.children( ".ui-accordion-header-icon" )
5862				.removeClass( icons.header )
5863				.addClass( icons.activeHeader );
5864			this.headers.addClass( "ui-accordion-icons" );
5865		}
5866	},
5867
5868	_destroyIcons: function() {
5869		this.headers
5870			.removeClass( "ui-accordion-icons" )
5871			.children( ".ui-accordion-header-icon" )
5872				.remove();
5873	},
5874
5875	_destroy: function() {
5876		var contents;
5877
5878		// clean up main element
5879		this.element
5880			.removeClass( "ui-accordion ui-widget ui-helper-reset" )
5881			.removeAttr( "role" );
5882
5883		// clean up headers
5884		this.headers
5885			.removeClass( "ui-accordion-header ui-accordion-header-active ui-state-default " +
5886				"ui-corner-all ui-state-active ui-state-disabled ui-corner-top" )
5887			.removeAttr( "role" )
5888			.removeAttr( "aria-expanded" )
5889			.removeAttr( "aria-selected" )
5890			.removeAttr( "aria-controls" )
5891			.removeAttr( "tabIndex" )
5892			.removeUniqueId();
5893
5894		this._destroyIcons();
5895
5896		// clean up content panels
5897		contents = this.headers.next()
5898			.removeClass( "ui-helper-reset ui-widget-content ui-corner-bottom " +
5899				"ui-accordion-content ui-accordion-content-active ui-state-disabled" )
5900			.css( "display", "" )
5901			.removeAttr( "role" )
5902			.removeAttr( "aria-hidden" )
5903			.removeAttr( "aria-labelledby" )
5904			.removeUniqueId();
5905
5906		if ( this.options.heightStyle !== "content" ) {
5907			contents.css( "height", "" );
5908		}
5909	},
5910
5911	_setOption: function( key, value ) {
5912		if ( key === "active" ) {
5913			// _activate() will handle invalid values and update this.options
5914			this._activate( value );
5915			return;
5916		}
5917
5918		if ( key === "event" ) {
5919			if ( this.options.event ) {
5920				this._off( this.headers, this.options.event );
5921			}
5922			this._setupEvents( value );
5923		}
5924
5925		this._super( key, value );
5926
5927		// setting collapsible: false while collapsed; open first panel
5928		if ( key === "collapsible" && !value && this.options.active === false ) {
5929			this._activate( 0 );
5930		}
5931
5932		if ( key === "icons" ) {
5933			this._destroyIcons();
5934			if ( value ) {
5935				this._createIcons();
5936			}
5937		}
5938
5939		// #5332 - opacity doesn't cascade to positioned elements in IE
5940		// so we need to add the disabled class to the headers and panels
5941		if ( key === "disabled" ) {
5942			this.element
5943				.toggleClass( "ui-state-disabled", !!value )
5944				.attr( "aria-disabled", value );
5945			this.headers.add( this.headers.next() )
5946				.toggleClass( "ui-state-disabled", !!value );
5947		}
5948	},
5949
5950	_keydown: function( event ) {
5951		if ( event.altKey || event.ctrlKey ) {
5952			return;
5953		}
5954
5955		var keyCode = $.ui.keyCode,
5956			length = this.headers.length,
5957			currentIndex = this.headers.index( event.target ),
5958			toFocus = false;
5959
5960		switch ( event.keyCode ) {
5961			case keyCode.RIGHT:
5962			case keyCode.DOWN:
5963				toFocus = this.headers[ ( currentIndex + 1 ) % length ];
5964				break;
5965			case keyCode.LEFT:
5966			case keyCode.UP:
5967				toFocus = this.headers[ ( currentIndex - 1 + length ) % length ];
5968				break;
5969			case keyCode.SPACE:
5970			case keyCode.ENTER:
5971				this._eventHandler( event );
5972				break;
5973			case keyCode.HOME:
5974				toFocus = this.headers[ 0 ];
5975				break;
5976			case keyCode.END:
5977				toFocus = this.headers[ length - 1 ];
5978				break;
5979		}
5980
5981		if ( toFocus ) {
5982			$( event.target ).attr( "tabIndex", -1 );
5983			$( toFocus ).attr( "tabIndex", 0 );
5984			toFocus.focus();
5985			event.preventDefault();
5986		}
5987	},
5988
5989	_panelKeyDown: function( event ) {
5990		if ( event.keyCode === $.ui.keyCode.UP && event.ctrlKey ) {
5991			$( event.currentTarget ).prev().focus();
5992		}
5993	},
5994
5995	refresh: function() {
5996		var options = this.options;
5997		this._processPanels();
5998
5999		// was collapsed or no panel
6000		if ( ( options.active === false && options.collapsible === true ) || !this.headers.length ) {
6001			options.active = false;
6002			this.active = $();
6003		// active false only when collapsible is true
6004		} else if ( options.active === false ) {
6005			this._activate( 0 );
6006		// was active, but active panel is gone
6007		} else if ( this.active.length && !$.contains( this.element[ 0 ], this.active[ 0 ] ) ) {
6008			// all remaining panel are disabled
6009			if ( this.headers.length === this.headers.find(".ui-state-disabled").length ) {
6010				options.active = false;
6011				this.active = $();
6012			// activate previous panel
6013			} else {
6014				this._activate( Math.max( 0, options.active - 1 ) );
6015			}
6016		// was active, active panel still exists
6017		} else {
6018			// make sure active index is correct
6019			options.active = this.headers.index( this.active );
6020		}
6021
6022		this._destroyIcons();
6023
6024		this._refresh();
6025	},
6026
6027	_processPanels: function() {
6028		var prevHeaders = this.headers,
6029			prevPanels = this.panels;
6030
6031		this.headers = this.element.find( this.options.header )
6032			.addClass( "ui-accordion-header ui-state-default ui-corner-all" );
6033
6034		this.panels = this.headers.next()
6035			.addClass( "ui-accordion-content ui-helper-reset ui-widget-content ui-corner-bottom" )
6036			.filter( ":not(.ui-accordion-content-active)" )
6037			.hide();
6038
6039		// Avoid memory leaks (#10056)
6040		if ( prevPanels ) {
6041			this._off( prevHeaders.not( this.headers ) );
6042			this._off( prevPanels.not( this.panels ) );
6043		}
6044	},
6045
6046	_refresh: function() {
6047		var maxHeight,
6048			options = this.options,
6049			heightStyle = options.heightStyle,
6050			parent = this.element.parent();
6051
6052		this.active = this._findActive( options.active )
6053			.addClass( "ui-accordion-header-active ui-state-active ui-corner-top" )
6054			.removeClass( "ui-corner-all" );
6055		this.active.next()
6056			.addClass( "ui-accordion-content-active" )
6057			.show();
6058
6059		this.headers
6060			.attr( "role", "tab" )
6061			.each(function() {
6062				var header = $( this ),
6063					headerId = header.uniqueId().attr( "id" ),
6064					panel = header.next(),
6065					panelId = panel.uniqueId().attr( "id" );
6066				header.attr( "aria-controls", panelId );
6067				panel.attr( "aria-labelledby", headerId );
6068			})
6069			.next()
6070				.attr( "role", "tabpanel" );
6071
6072		this.headers
6073			.not( this.active )
6074			.attr({
6075				"aria-selected": "false",
6076				"aria-expanded": "false",
6077				tabIndex: -1
6078			})
6079			.next()
6080				.attr({
6081					"aria-hidden": "true"
6082				})
6083				.hide();
6084
6085		// make sure at least one header is in the tab order
6086		if ( !this.active.length ) {
6087			this.headers.eq( 0 ).attr( "tabIndex", 0 );
6088		} else {
6089			this.active.attr({
6090				"aria-selected": "true",
6091				"aria-expanded": "true",
6092				tabIndex: 0
6093			})
6094			.next()
6095				.attr({
6096					"aria-hidden": "false"
6097				});
6098		}
6099
6100		this._createIcons();
6101
6102		this._setupEvents( options.event );
6103
6104		if ( heightStyle === "fill" ) {
6105			maxHeight = parent.height();
6106			this.element.siblings( ":visible" ).each(function() {
6107				var elem = $( this ),
6108					position = elem.css( "position" );
6109
6110				if ( position === "absolute" || position === "fixed" ) {
6111					return;
6112				}
6113				maxHeight -= elem.outerHeight( true );
6114			});
6115
6116			this.headers.each(function() {
6117				maxHeight -= $( this ).outerHeight( true );
6118			});
6119
6120			this.headers.next()
6121				.each(function() {
6122					$( this ).height( Math.max( 0, maxHeight -
6123						$( this ).innerHeight() + $( this ).height() ) );
6124				})
6125				.css( "overflow", "auto" );
6126		} else if ( heightStyle === "auto" ) {
6127			maxHeight = 0;
6128			this.headers.next()
6129				.each(function() {
6130					maxHeight = Math.max( maxHeight, $( this ).css( "height", "" ).height() );
6131				})
6132				.height( maxHeight );
6133		}
6134	},
6135
6136	_activate: function( index ) {
6137		var active = this._findActive( index )[ 0 ];
6138
6139		// trying to activate the already active panel
6140		if ( active === this.active[ 0 ] ) {
6141			return;
6142		}
6143
6144		// trying to collapse, simulate a click on the currently active header
6145		active = active || this.active[ 0 ];
6146
6147		this._eventHandler({
6148			target: active,
6149			currentTarget: active,
6150			preventDefault: $.noop
6151		});
6152	},
6153
6154	_findActive: function( selector ) {
6155		return typeof selector === "number" ? this.headers.eq( selector ) : $();
6156	},
6157
6158	_setupEvents: function( event ) {
6159		var events = {
6160			keydown: "_keydown"
6161		};
6162		if ( event ) {
6163			$.each( event.split( " " ), function( index, eventName ) {
6164				events[ eventName ] = "_eventHandler";
6165			});
6166		}
6167
6168		this._off( this.headers.add( this.headers.next() ) );
6169		this._on( this.headers, events );
6170		this._on( this.headers.next(), { keydown: "_panelKeyDown" });
6171		this._hoverable( this.headers );
6172		this._focusable( this.headers );
6173	},
6174
6175	_eventHandler: function( event ) {
6176		var options = this.options,
6177			active = this.active,
6178			clicked = $( event.currentTarget ),
6179			clickedIsActive = clicked[ 0 ] === active[ 0 ],
6180			collapsing = clickedIsActive && options.collapsible,
6181			toShow = collapsing ? $() : clicked.next(),
6182			toHide = active.next(),
6183			eventData = {
6184				oldHeader: active,
6185				oldPanel: toHide,
6186				newHeader: collapsing ? $() : clicked,
6187				newPanel: toShow
6188			};
6189
6190		event.preventDefault();
6191
6192		if (
6193				// click on active header, but not collapsible
6194				( clickedIsActive && !options.collapsible ) ||
6195				// allow canceling activation
6196				( this._trigger( "beforeActivate", event, eventData ) === false ) ) {
6197			return;
6198		}
6199
6200		options.active = collapsing ? false : this.headers.index( clicked );
6201
6202		// when the call to ._toggle() comes after the class changes
6203		// it causes a very odd bug in IE 8 (see #6720)
6204		this.active = clickedIsActive ? $() : clicked;
6205		this._toggle( eventData );
6206
6207		// switch classes
6208		// corner classes on the previously active header stay after the animation
6209		active.removeClass( "ui-accordion-header-active ui-state-active" );
6210		if ( options.icons ) {
6211			active.children( ".ui-accordion-header-icon" )
6212				.removeClass( options.icons.activeHeader )
6213				.addClass( options.icons.header );
6214		}
6215
6216		if ( !clickedIsActive ) {
6217			clicked
6218				.removeClass( "ui-corner-all" )
6219				.addClass( "ui-accordion-header-active ui-state-active ui-corner-top" );
6220			if ( options.icons ) {
6221				clicked.children( ".ui-accordion-header-icon" )
6222					.removeClass( options.icons.header )
6223					.addClass( options.icons.activeHeader );
6224			}
6225
6226			clicked
6227				.next()
6228				.addClass( "ui-accordion-content-active" );
6229		}
6230	},
6231
6232	_toggle: function( data ) {
6233		var toShow = data.newPanel,
6234			toHide = this.prevShow.length ? this.prevShow : data.oldPanel;
6235
6236		// handle activating a panel during the animation for another activation
6237		this.prevShow.add( this.prevHide ).stop( true, true );
6238		this.prevShow = toShow;
6239		this.prevHide = toHide;
6240
6241		if ( this.options.animate ) {
6242			this._animate( toShow, toHide, data );
6243		} else {
6244			toHide.hide();
6245			toShow.show();
6246			this._toggleComplete( data );
6247		}
6248
6249		toHide.attr({
6250			"aria-hidden": "true"
6251		});
6252		toHide.prev().attr({
6253			"aria-selected": "false",
6254			"aria-expanded": "false"
6255		});
6256		// if we're switching panels, remove the old header from the tab order
6257		// if we're opening from collapsed state, remove the previous header from the tab order
6258		// if we're collapsing, then keep the collapsing header in the tab order
6259		if ( toShow.length && toHide.length ) {
6260			toHide.prev().attr({
6261				"tabIndex": -1,
6262				"aria-expanded": "false"
6263			});
6264		} else if ( toShow.length ) {
6265			this.headers.filter(function() {
6266				return parseInt( $( this ).attr( "tabIndex" ), 10 ) === 0;
6267			})
6268			.attr( "tabIndex", -1 );
6269		}
6270
6271		toShow
6272			.attr( "aria-hidden", "false" )
6273			.prev()
6274				.attr({
6275					"aria-selected": "true",
6276					"aria-expanded": "true",
6277					tabIndex: 0
6278				});
6279	},
6280
6281	_animate: function( toShow, toHide, data ) {
6282		var total, easing, duration,
6283			that = this,
6284			adjust = 0,
6285			boxSizing = toShow.css( "box-sizing" ),
6286			down = toShow.length &&
6287				( !toHide.length || ( toShow.index() < toHide.index() ) ),
6288			animate = this.options.animate || {},
6289			options = down && animate.down || animate,
6290			complete = function() {
6291				that._toggleComplete( data );
6292			};
6293
6294		if ( typeof options === "number" ) {
6295			duration = options;
6296		}
6297		if ( typeof options === "string" ) {
6298			easing = options;
6299		}
6300		// fall back from options to animation in case of partial down settings
6301		easing = easing || options.easing || animate.easing;
6302		duration = duration || options.duration || animate.duration;
6303
6304		if ( !toHide.length ) {
6305			return toShow.animate( this.showProps, duration, easing, complete );
6306		}
6307		if ( !toShow.length ) {
6308			return toHide.animate( this.hideProps, duration, easing, complete );
6309		}
6310
6311		total = toShow.show().outerHeight();
6312		toHide.animate( this.hideProps, {
6313			duration: duration,
6314			easing: easing,
6315			step: function( now, fx ) {
6316				fx.now = Math.round( now );
6317			}
6318		});
6319		toShow
6320			.hide()
6321			.animate( this.showProps, {
6322				duration: duration,
6323				easing: easing,
6324				complete: complete,
6325				step: function( now, fx ) {
6326					fx.now = Math.round( now );
6327					if ( fx.prop !== "height" ) {
6328						if ( boxSizing === "content-box" ) {
6329							adjust += fx.now;
6330						}
6331					} else if ( that.options.heightStyle !== "content" ) {
6332						fx.now = Math.round( total - toHide.outerHeight() - adjust );
6333						adjust = 0;
6334					}
6335				}
6336			});
6337	},
6338
6339	_toggleComplete: function( data ) {
6340		var toHide = data.oldPanel;
6341
6342		toHide
6343			.removeClass( "ui-accordion-content-active" )
6344			.prev()
6345				.removeClass( "ui-corner-top" )
6346				.addClass( "ui-corner-all" );
6347
6348		// Work around for rendering bug in IE (#5421)
6349		if ( toHide.length ) {
6350			toHide.parent()[ 0 ].className = toHide.parent()[ 0 ].className;
6351		}
6352		this._trigger( "activate", null, data );
6353	}
6354});
6355
6356
6357/*!
6358 * jQuery UI Menu 1.11.4
6359 * http://jqueryui.com
6360 *
6361 * Copyright jQuery Foundation and other contributors
6362 * Released under the MIT license.
6363 * http://jquery.org/license
6364 *
6365 * http://api.jqueryui.com/menu/
6366 */
6367
6368
6369var menu = $.widget( "ui.menu", {
6370	version: "1.11.4",
6371	defaultElement: "<ul>",
6372	delay: 300,
6373	options: {
6374		icons: {
6375			submenu: "ui-icon-carat-1-e"
6376		},
6377		items: "> *",
6378		menus: "ul",
6379		position: {
6380			my: "left-1 top",
6381			at: "right top"
6382		},
6383		role: "menu",
6384
6385		// callbacks
6386		blur: null,
6387		focus: null,
6388		select: null
6389	},
6390
6391	_create: function() {
6392		this.activeMenu = this.element;
6393
6394		// Flag used to prevent firing of the click handler
6395		// as the event bubbles up through nested menus
6396		this.mouseHandled = false;
6397		this.element
6398			.uniqueId()
6399			.addClass( "ui-menu ui-widget ui-widget-content" )
6400			.toggleClass( "ui-menu-icons", !!this.element.find( ".ui-icon" ).length )
6401			.attr({
6402				role: this.options.role,
6403				tabIndex: 0
6404			});
6405
6406		if ( this.options.disabled ) {
6407			this.element
6408				.addClass( "ui-state-disabled" )
6409				.attr( "aria-disabled", "true" );
6410		}
6411
6412		this._on({
6413			// Prevent focus from sticking to links inside menu after clicking
6414			// them (focus should always stay on UL during navigation).
6415			"mousedown .ui-menu-item": function( event ) {
6416				event.preventDefault();
6417			},
6418			"click .ui-menu-item": function( event ) {
6419				var target = $( event.target );
6420				if ( !this.mouseHandled && target.not( ".ui-state-disabled" ).length ) {
6421					this.select( event );
6422
6423					// Only set the mouseHandled flag if the event will bubble, see #9469.
6424					if ( !event.isPropagationStopped() ) {
6425						this.mouseHandled = true;
6426					}
6427
6428					// Open submenu on click
6429					if ( target.has( ".ui-menu" ).length ) {
6430						this.expand( event );
6431					} else if ( !this.element.is( ":focus" ) && $( this.document[ 0 ].activeElement ).closest( ".ui-menu" ).length ) {
6432
6433						// Redirect focus to the menu
6434						this.element.trigger( "focus", [ true ] );
6435
6436						// If the active item is on the top level, let it stay active.
6437						// Otherwise, blur the active item since it is no longer visible.
6438						if ( this.active && this.active.parents( ".ui-menu" ).length === 1 ) {
6439							clearTimeout( this.timer );
6440						}
6441					}
6442				}
6443			},
6444			"mouseenter .ui-menu-item": function( event ) {
6445				// Ignore mouse events while typeahead is active, see #10458.
6446				// Prevents focusing the wrong item when typeahead causes a scroll while the mouse
6447				// is over an item in the menu
6448				if ( this.previousFilter ) {
6449					return;
6450				}
6451				var target = $( event.currentTarget );
6452				// Remove ui-state-active class from siblings of the newly focused menu item
6453				// to avoid a jump caused by adjacent elements both having a class with a border
6454				target.siblings( ".ui-state-active" ).removeClass( "ui-state-active" );
6455				this.focus( event, target );
6456			},
6457			mouseleave: "collapseAll",
6458			"mouseleave .ui-menu": "collapseAll",
6459			focus: function( event, keepActiveItem ) {
6460				// If there's already an active item, keep it active
6461				// If not, activate the first item
6462				var item = this.active || this.element.find( this.options.items ).eq( 0 );
6463
6464				if ( !keepActiveItem ) {
6465					this.focus( event, item );
6466				}
6467			},
6468			blur: function( event ) {
6469				this._delay(function() {
6470					if ( !$.contains( this.element[0], this.document[0].activeElement ) ) {
6471						this.collapseAll( event );
6472					}
6473				});
6474			},
6475			keydown: "_keydown"
6476		});
6477
6478		this.refresh();
6479
6480		// Clicks outside of a menu collapse any open menus
6481		this._on( this.document, {
6482			click: function( event ) {
6483				if ( this._closeOnDocumentClick( event ) ) {
6484					this.collapseAll( event );
6485				}
6486
6487				// Reset the mouseHandled flag
6488				this.mouseHandled = false;
6489			}
6490		});
6491	},
6492
6493	_destroy: function() {
6494		// Destroy (sub)menus
6495		this.element
6496			.removeAttr( "aria-activedescendant" )
6497			.find( ".ui-menu" ).addBack()
6498				.removeClass( "ui-menu ui-widget ui-widget-content ui-menu-icons ui-front" )
6499				.removeAttr( "role" )
6500				.removeAttr( "tabIndex" )
6501				.removeAttr( "aria-labelledby" )
6502				.removeAttr( "aria-expanded" )
6503				.removeAttr( "aria-hidden" )
6504				.removeAttr( "aria-disabled" )
6505				.removeUniqueId()
6506				.show();
6507
6508		// Destroy menu items
6509		this.element.find( ".ui-menu-item" )
6510			.removeClass( "ui-menu-item" )
6511			.removeAttr( "role" )
6512			.removeAttr( "aria-disabled" )
6513			.removeUniqueId()
6514			.removeClass( "ui-state-hover" )
6515			.removeAttr( "tabIndex" )
6516			.removeAttr( "role" )
6517			.removeAttr( "aria-haspopup" )
6518			.children().each( function() {
6519				var elem = $( this );
6520				if ( elem.data( "ui-menu-submenu-carat" ) ) {
6521					elem.remove();
6522				}
6523			});
6524
6525		// Destroy menu dividers
6526		this.element.find( ".ui-menu-divider" ).removeClass( "ui-menu-divider ui-widget-content" );
6527	},
6528
6529	_keydown: function( event ) {
6530		var match, prev, character, skip,
6531			preventDefault = true;
6532
6533		switch ( event.keyCode ) {
6534		case $.ui.keyCode.PAGE_UP:
6535			this.previousPage( event );
6536			break;
6537		case $.ui.keyCode.PAGE_DOWN:
6538			this.nextPage( event );
6539			break;
6540		case $.ui.keyCode.HOME:
6541			this._move( "first", "first", event );
6542			break;
6543		case $.ui.keyCode.END:
6544			this._move( "last", "last", event );
6545			break;
6546		case $.ui.keyCode.UP:
6547			this.previous( event );
6548			break;
6549		case $.ui.keyCode.DOWN:
6550			this.next( event );
6551			break;
6552		case $.ui.keyCode.LEFT:
6553			this.collapse( event );
6554			break;
6555		case $.ui.keyCode.RIGHT:
6556			if ( this.active && !this.active.is( ".ui-state-disabled" ) ) {
6557				this.expand( event );
6558			}
6559			break;
6560		case $.ui.keyCode.ENTER:
6561		case $.ui.keyCode.SPACE:
6562			this._activate( event );
6563			break;
6564		case $.ui.keyCode.ESCAPE:
6565			this.collapse( event );
6566			break;
6567		default:
6568			preventDefault = false;
6569			prev = this.previousFilter || "";
6570			character = String.fromCharCode( event.keyCode );
6571			skip = false;
6572
6573			clearTimeout( this.filterTimer );
6574
6575			if ( character === prev ) {
6576				skip = true;
6577			} else {
6578				character = prev + character;
6579			}
6580
6581			match = this._filterMenuItems( character );
6582			match = skip && match.index( this.active.next() ) !== -1 ?
6583				this.active.nextAll( ".ui-menu-item" ) :
6584				match;
6585
6586			// If no matches on the current filter, reset to the last character pressed
6587			// to move down the menu to the first item that starts with that character
6588			if ( !match.length ) {
6589				character = String.fromCharCode( event.keyCode );
6590				match = this._filterMenuItems( character );
6591			}
6592
6593			if ( match.length ) {
6594				this.focus( event, match );
6595				this.previousFilter = character;
6596				this.filterTimer = this._delay(function() {
6597					delete this.previousFilter;
6598				}, 1000 );
6599			} else {
6600				delete this.previousFilter;
6601			}
6602		}
6603
6604		if ( preventDefault ) {
6605			event.preventDefault();
6606		}
6607	},
6608
6609	_activate: function( event ) {
6610		if ( !this.active.is( ".ui-state-disabled" ) ) {
6611			if ( this.active.is( "[aria-haspopup='true']" ) ) {
6612				this.expand( event );
6613			} else {
6614				this.select( event );
6615			}
6616		}
6617	},
6618
6619	refresh: function() {
6620		var menus, items,
6621			that = this,
6622			icon = this.options.icons.submenu,
6623			submenus = this.element.find( this.options.menus );
6624
6625		this.element.toggleClass( "ui-menu-icons", !!this.element.find( ".ui-icon" ).length );
6626
6627		// Initialize nested menus
6628		submenus.filter( ":not(.ui-menu)" )
6629			.addClass( "ui-menu ui-widget ui-widget-content ui-front" )
6630			.hide()
6631			.attr({
6632				role: this.options.role,
6633				"aria-hidden": "true",
6634				"aria-expanded": "false"
6635			})
6636			.each(function() {
6637				var menu = $( this ),
6638					item = menu.parent(),
6639					submenuCarat = $( "<span>" )
6640						.addClass( "ui-menu-icon ui-icon " + icon )
6641						.data( "ui-menu-submenu-carat", true );
6642
6643				item
6644					.attr( "aria-haspopup", "true" )
6645					.prepend( submenuCarat );
6646				menu.attr( "aria-labelledby", item.attr( "id" ) );
6647			});
6648
6649		menus = submenus.add( this.element );
6650		items = menus.find( this.options.items );
6651
vendor: 4,109 bytes, lines 6652-6803
6652		// Initialize menu-items containing spaces and/or dashes only as dividers
6653		items.not( ".ui-menu-item" ).each(function() {
6654			var item = $( this );
6655			if ( that._isDivider( item ) ) {
6656				item.addClass( "ui-widget-content ui-menu-divider" );
6657			}
6658		});
6659
6660		// Don't refresh list items that are already adapted
6661		items.not( ".ui-menu-item, .ui-menu-divider" )
6662			.addClass( "ui-menu-item" )
6663			.uniqueId()
6664			.attr({
6665				tabIndex: -1,
6666				role: this._itemRole()
6667			});
6668
6669		// Add aria-disabled attribute to any disabled menu item
6670		items.filter( ".ui-state-disabled" ).attr( "aria-disabled", "true" );
6671
6672		// If the active item has been removed, blur the menu
6673		if ( this.active && !$.contains( this.element[ 0 ], this.active[ 0 ] ) ) {
6674			this.blur();
6675		}
6676	},
6677
6678	_itemRole: function() {
6679		return {
6680			menu: "menuitem",
6681			listbox: "option"
6682		}[ this.options.role ];
6683	},
6684
6685	_setOption: function( key, value ) {
6686		if ( key === "icons" ) {
6687			this.element.find( ".ui-menu-icon" )
6688				.removeClass( this.options.icons.submenu )
6689				.addClass( value.submenu );
6690		}
6691		if ( key === "disabled" ) {
6692			this.element
6693				.toggleClass( "ui-state-disabled", !!value )
6694				.attr( "aria-disabled", value );
6695		}
6696		this._super( key, value );
6697	},
6698
6699	focus: function( event, item ) {
6700		var nested, focused;
6701		this.blur( event, event && event.type === "focus" );
6702
6703		this._scrollIntoView( item );
6704
6705		this.active = item.first();
6706		focused = this.active.addClass( "ui-state-focus" ).removeClass( "ui-state-active" );
6707		// Only update aria-activedescendant if there's a role
6708		// otherwise we assume focus is managed elsewhere
6709		if ( this.options.role ) {
6710			this.element.attr( "aria-activedescendant", focused.attr( "id" ) );
6711		}
6712
6713		// Highlight active parent menu item, if any
6714		this.active
6715			.parent()
6716			.closest( ".ui-menu-item" )
6717			.addClass( "ui-state-active" );
6718
6719		if ( event && event.type === "keydown" ) {
6720			this._close();
6721		} else {
6722			this.timer = this._delay(function() {
6723				this._close();
6724			}, this.delay );
6725		}
6726
6727		nested = item.children( ".ui-menu" );
6728		if ( nested.length && event && ( /^mouse/.test( event.type ) ) ) {
6729			this._startOpening(nested);
6730		}
6731		this.activeMenu = item.parent();
6732
6733		this._trigger( "focus", event, { item: item } );
6734	},
6735
6736	_scrollIntoView: function( item ) {
6737		var borderTop, paddingTop, offset, scroll, elementHeight, itemHeight;
6738		if ( this._hasScroll() ) {
6739			borderTop = parseFloat( $.css( this.activeMenu[0], "borderTopWidth" ) ) || 0;
6740			paddingTop = parseFloat( $.css( this.activeMenu[0], "paddingTop" ) ) || 0;
6741			offset = item.offset().top - this.activeMenu.offset().top - borderTop - paddingTop;
6742			scroll = this.activeMenu.scrollTop();
6743			elementHeight = this.activeMenu.height();
6744			itemHeight = item.outerHeight();
6745
6746			if ( offset < 0 ) {
6747				this.activeMenu.scrollTop( scroll + offset );
6748			} else if ( offset + itemHeight > elementHeight ) {
6749				this.activeMenu.scrollTop( scroll + offset - elementHeight + itemHeight );
6750			}
6751		}
6752	},
6753
6754	blur: function( event, fromFocus ) {
6755		if ( !fromFocus ) {
6756			clearTimeout( this.timer );
6757		}
6758
6759		if ( !this.active ) {
6760			return;
6761		}
6762
6763		this.active.removeClass( "ui-state-focus" );
6764		this.active = null;
6765
6766		this._trigger( "blur", event, { item: this.active } );
6767	},
6768
6769	_startOpening: function( submenu ) {
6770		clearTimeout( this.timer );
6771
6772		// Don't open if already open fixes a Firefox bug that caused a .5 pixel
6773		// shift in the submenu position when mousing over the carat icon
6774		if ( submenu.attr( "aria-hidden" ) !== "true" ) {
6775			return;
6776		}
6777
6778		this.timer = this._delay(function() {
6779			this._close();
6780			this._open( submenu );
6781		}, this.delay );
6782	},
6783
6784	_open: function( submenu ) {
6785		var position = $.extend({
6786			of: this.active
6787		}, this.options.position );
6788
6789		clearTimeout( this.timer );
6790		this.element.find( ".ui-menu" ).not( submenu.parents( ".ui-menu" ) )
6791			.hide()
6792			.attr( "aria-hidden", "true" );
6793
6794		submenu
6795			.show()
6796			.removeAttr( "aria-hidden" )
6797			.attr( "aria-expanded", "true" )
6798			.position( position );
6799	},
6800
6801	collapseAll: function( event, all ) {
6802		clearTimeout( this.timer );
6803		this.timer = this._delay(function() {
vendor: 11,138 bytes, lines 6804-7220
6804			// If we were passed an event, look for the submenu that contains the event
6805			var currentMenu = all ? this.element :
6806				$( event && event.target ).closest( this.element.find( ".ui-menu" ) );
6807
6808			// If we found no valid submenu ancestor, use the main menu to close all sub menus anyway
6809			if ( !currentMenu.length ) {
6810				currentMenu = this.element;
6811			}
6812
6813			this._close( currentMenu );
6814
6815			this.blur( event );
6816			this.activeMenu = currentMenu;
6817		}, this.delay );
6818	},
6819
6820	// With no arguments, closes the currently active menu - if nothing is active
6821	// it closes all menus.  If passed an argument, it will search for menus BELOW
6822	_close: function( startMenu ) {
6823		if ( !startMenu ) {
6824			startMenu = this.active ? this.active.parent() : this.element;
6825		}
6826
6827		startMenu
6828			.find( ".ui-menu" )
6829				.hide()
6830				.attr( "aria-hidden", "true" )
6831				.attr( "aria-expanded", "false" )
6832			.end()
6833			.find( ".ui-state-active" ).not( ".ui-state-focus" )
6834				.removeClass( "ui-state-active" );
6835	},
6836
6837	_closeOnDocumentClick: function( event ) {
6838		return !$( event.target ).closest( ".ui-menu" ).length;
6839	},
6840
6841	_isDivider: function( item ) {
6842
6843		// Match hyphen, em dash, en dash
6844		return !/[^\-\u2014\u2013\s]/.test( item.text() );
6845	},
6846
6847	collapse: function( event ) {
6848		var newItem = this.active &&
6849			this.active.parent().closest( ".ui-menu-item", this.element );
6850		if ( newItem && newItem.length ) {
6851			this._close();
6852			this.focus( event, newItem );
6853		}
6854	},
6855
6856	expand: function( event ) {
6857		var newItem = this.active &&
6858			this.active
6859				.children( ".ui-menu " )
6860				.find( this.options.items )
6861				.first();
6862
6863		if ( newItem && newItem.length ) {
6864			this._open( newItem.parent() );
6865
6866			// Delay so Firefox will not hide activedescendant change in expanding submenu from AT
6867			this._delay(function() {
6868				this.focus( event, newItem );
6869			});
6870		}
6871	},
6872
6873	next: function( event ) {
6874		this._move( "next", "first", event );
6875	},
6876
6877	previous: function( event ) {
6878		this._move( "prev", "last", event );
6879	},
6880
6881	isFirstItem: function() {
6882		return this.active && !this.active.prevAll( ".ui-menu-item" ).length;
6883	},
6884
6885	isLastItem: function() {
6886		return this.active && !this.active.nextAll( ".ui-menu-item" ).length;
6887	},
6888
6889	_move: function( direction, filter, event ) {
6890		var next;
6891		if ( this.active ) {
6892			if ( direction === "first" || direction === "last" ) {
6893				next = this.active
6894					[ direction === "first" ? "prevAll" : "nextAll" ]( ".ui-menu-item" )
6895					.eq( -1 );
6896			} else {
6897				next = this.active
6898					[ direction + "All" ]( ".ui-menu-item" )
6899					.eq( 0 );
6900			}
6901		}
6902		if ( !next || !next.length || !this.active ) {
6903			next = this.activeMenu.find( this.options.items )[ filter ]();
6904		}
6905
6906		this.focus( event, next );
6907	},
6908
6909	nextPage: function( event ) {
6910		var item, base, height;
6911
6912		if ( !this.active ) {
6913			this.next( event );
6914			return;
6915		}
6916		if ( this.isLastItem() ) {
6917			return;
6918		}
6919		if ( this._hasScroll() ) {
6920			base = this.active.offset().top;
6921			height = this.element.height();
6922			this.active.nextAll( ".ui-menu-item" ).each(function() {
6923				item = $( this );
6924				return item.offset().top - base - height < 0;
6925			});
6926
6927			this.focus( event, item );
6928		} else {
6929			this.focus( event, this.activeMenu.find( this.options.items )
6930				[ !this.active ? "first" : "last" ]() );
6931		}
6932	},
6933
6934	previousPage: function( event ) {
6935		var item, base, height;
6936		if ( !this.active ) {
6937			this.next( event );
6938			return;
6939		}
6940		if ( this.isFirstItem() ) {
6941			return;
6942		}
6943		if ( this._hasScroll() ) {
6944			base = this.active.offset().top;
6945			height = this.element.height();
6946			this.active.prevAll( ".ui-menu-item" ).each(function() {
6947				item = $( this );
6948				return item.offset().top - base + height > 0;
6949			});
6950
6951			this.focus( event, item );
6952		} else {
6953			this.focus( event, this.activeMenu.find( this.options.items ).first() );
6954		}
6955	},
6956
6957	_hasScroll: function() {
6958		return this.element.outerHeight() < this.element.prop( "scrollHeight" );
6959	},
6960
6961	select: function( event ) {
6962		// TODO: It should never be possible to not have an active item at this
6963		// point, but the tests don't trigger mouseenter before click.
6964		this.active = this.active || $( event.target ).closest( ".ui-menu-item" );
6965		var ui = { item: this.active };
6966		if ( !this.active.has( ".ui-menu" ).length ) {
6967			this.collapseAll( event, true );
6968		}
6969		this._trigger( "select", event, ui );
6970	},
6971
6972	_filterMenuItems: function(character) {
6973		var escapedCharacter = character.replace( /[\-\[\]{}()*+?.,\\\^$|#\s]/g, "\\$&" ),
6974			regex = new RegExp( "^" + escapedCharacter, "i" );
6975
6976		return this.activeMenu
6977			.find( this.options.items )
6978
6979			// Only match on items, not dividers or other content (#10571)
6980			.filter( ".ui-menu-item" )
6981			.filter(function() {
6982				return regex.test( $.trim( $( this ).text() ) );
6983			});
6984	}
6985});
6986
6987
6988/*!
6989 * jQuery UI Autocomplete 1.11.4
6990 * http://jqueryui.com
6991 *
6992 * Copyright jQuery Foundation and other contributors
6993 * Released under the MIT license.
6994 * http://jquery.org/license
6995 *
6996 * http://api.jqueryui.com/autocomplete/
6997 */
6998
6999
7000$.widget( "ui.autocomplete", {
7001	version: "1.11.4",
7002	defaultElement: "<input>",
7003	options: {
7004		appendTo: null,
7005		autoFocus: false,
7006		delay: 300,
7007		minLength: 1,
7008		position: {
7009			my: "left top",
7010			at: "left bottom",
7011			collision: "none"
7012		},
7013		source: null,
7014
7015		// callbacks
7016		change: null,
7017		close: null,
7018		focus: null,
7019		open: null,
7020		response: null,
7021		search: null,
7022		select: null
7023	},
7024
7025	requestIndex: 0,
7026	pending: 0,
7027
7028	_create: function() {
7029		// Some browsers only repeat keydown events, not keypress events,
7030		// so we use the suppressKeyPress flag to determine if we've already
7031		// handled the keydown event. #7269
7032		// Unfortunately the code for & in keypress is the same as the up arrow,
7033		// so we use the suppressKeyPressRepeat flag to avoid handling keypress
7034		// events when we know the keydown event was used to modify the
7035		// search term. #7799
7036		var suppressKeyPress, suppressKeyPressRepeat, suppressInput,
7037			nodeName = this.element[ 0 ].nodeName.toLowerCase(),
7038			isTextarea = nodeName === "textarea",
7039			isInput = nodeName === "input";
7040
7041		this.isMultiLine =
7042			// Textareas are always multi-line
7043			isTextarea ? true :
7044			// Inputs are always single-line, even if inside a contentEditable element
7045			// IE also treats inputs as contentEditable
7046			isInput ? false :
7047			// All other element types are determined by whether or not they're contentEditable
7048			this.element.prop( "isContentEditable" );
7049
7050		this.valueMethod = this.element[ isTextarea || isInput ? "val" : "text" ];
7051		this.isNewMenu = true;
7052
7053		this.element
7054			.addClass( "ui-autocomplete-input" )
7055			.attr( "autocomplete", "off" );
7056
7057		this._on( this.element, {
7058			keydown: function( event ) {
7059				if ( this.element.prop( "readOnly" ) ) {
7060					suppressKeyPress = true;
7061					suppressInput = true;
7062					suppressKeyPressRepeat = true;
7063					return;
7064				}
7065
7066				suppressKeyPress = false;
7067				suppressInput = false;
7068				suppressKeyPressRepeat = false;
7069				var keyCode = $.ui.keyCode;
7070				switch ( event.keyCode ) {
7071				case keyCode.PAGE_UP:
7072					suppressKeyPress = true;
7073					this._move( "previousPage", event );
7074					break;
7075				case keyCode.PAGE_DOWN:
7076					suppressKeyPress = true;
7077					this._move( "nextPage", event );
7078					break;
7079				case keyCode.UP:
7080					suppressKeyPress = true;
7081					this._keyEvent( "previous", event );
7082					break;
7083				case keyCode.DOWN:
7084					suppressKeyPress = true;
7085					this._keyEvent( "next", event );
7086					break;
7087				case keyCode.ENTER:
7088					// when menu is open and has focus
7089					if ( this.menu.active ) {
7090						// #6055 - Opera still allows the keypress to occur
7091						// which causes forms to submit
7092						suppressKeyPress = true;
7093						event.preventDefault();
7094						this.menu.select( event );
7095					}
7096					break;
7097				case keyCode.TAB:
7098					if ( this.menu.active ) {
7099						this.menu.select( event );
7100					}
7101					break;
7102				case keyCode.ESCAPE:
7103					if ( this.menu.element.is( ":visible" ) ) {
7104						if ( !this.isMultiLine ) {
7105							this._value( this.term );
7106						}
7107						this.close( event );
7108						// Different browsers have different default behavior for escape
7109						// Single press can mean undo or clear
7110						// Double press in IE means clear the whole form
7111						event.preventDefault();
7112					}
7113					break;
7114				default:
7115					suppressKeyPressRepeat = true;
7116					// search timeout should be triggered before the input value is changed
7117					this._searchTimeout( event );
7118					break;
7119				}
7120			},
7121			keypress: function( event ) {
7122				if ( suppressKeyPress ) {
7123					suppressKeyPress = false;
7124					if ( !this.isMultiLine || this.menu.element.is( ":visible" ) ) {
7125						event.preventDefault();
7126					}
7127					return;
7128				}
7129				if ( suppressKeyPressRepeat ) {
7130					return;
7131				}
7132
7133				// replicate some key handlers to allow them to repeat in Firefox and Opera
7134				var keyCode = $.ui.keyCode;
7135				switch ( event.keyCode ) {
7136				case keyCode.PAGE_UP:
7137					this._move( "previousPage", event );
7138					break;
7139				case keyCode.PAGE_DOWN:
7140					this._move( "nextPage", event );
7141					break;
7142				case keyCode.UP:
7143					this._keyEvent( "previous", event );
7144					break;
7145				case keyCode.DOWN:
7146					this._keyEvent( "next", event );
7147					break;
7148				}
7149			},
7150			input: function( event ) {
7151				if ( suppressInput ) {
7152					suppressInput = false;
7153					event.preventDefault();
7154					return;
7155				}
7156				this._searchTimeout( event );
7157			},
7158			focus: function() {
7159				this.selectedItem = null;
7160				this.previous = this._value();
7161			},
7162			blur: function( event ) {
7163				if ( this.cancelBlur ) {
7164					delete this.cancelBlur;
7165					return;
7166				}
7167
7168				clearTimeout( this.searching );
7169				this.close( event );
7170				this._change( event );
7171			}
7172		});
7173
7174		this._initSource();
7175		this.menu = $( "<ul>" )
7176			.addClass( "ui-autocomplete ui-front" )
7177			.appendTo( this._appendTo() )
7178			.menu({
7179				// disable ARIA support, the live region takes care of that
7180				role: null
7181			})
7182			.hide()
7183			.menu( "instance" );
7184
7185		this._on( this.menu.element, {
7186			mousedown: function( event ) {
7187				// prevent moving focus out of the text field
7188				event.preventDefault();
7189
7190				// IE doesn't prevent moving focus even with event.preventDefault()
7191				// so we set a flag to know when we should ignore the blur event
7192				this.cancelBlur = true;
7193				this._delay(function() {
7194					delete this.cancelBlur;
7195				});
7196
7197				// clicking on the scrollbar causes focus to shift to the body
7198				// but we can't detect a mouseup or a click immediately afterward
7199				// so we have to track the next mousedown and close the menu if
7200				// the user clicks somewhere outside of the autocomplete
7201				var menuElement = this.menu.element[ 0 ];
7202				if ( !$( event.target ).closest( ".ui-menu-item" ).length ) {
7203					this._delay(function() {
7204						var that = this;
7205						this.document.one( "mousedown", function( event ) {
7206							if ( event.target !== that.element[ 0 ] &&
7207									event.target !== menuElement &&
7208									!$.contains( menuElement, event.target ) ) {
7209								that.close();
7210							}
7211						});
7212					});
7213				}
7214			},
7215			menufocus: function( event, ui ) {
7216				var label, item;
7217				// support: Firefox
7218				// Prevent accidental activation of menu items in Firefox (#7024 #9118)
7219				if ( this.isNewMenu ) {
7220					this.isNewMenu = false;
vendor: 4,086 bytes, lines 7221-7371
7221					if ( event.originalEvent && /^mouse/.test( event.originalEvent.type ) ) {
7222						this.menu.blur();
7223
7224						this.document.one( "mousemove", function() {
7225							$( event.target ).trigger( event.originalEvent );
7226						});
7227
7228						return;
7229					}
7230				}
7231
7232				item = ui.item.data( "ui-autocomplete-item" );
7233				if ( false !== this._trigger( "focus", event, { item: item } ) ) {
7234					// use value to match what will end up in the input, if it was a key event
7235					if ( event.originalEvent && /^key/.test( event.originalEvent.type ) ) {
7236						this._value( item.value );
7237					}
7238				}
7239
7240				// Announce the value in the liveRegion
7241				label = ui.item.attr( "aria-label" ) || item.value;
7242				if ( label && $.trim( label ).length ) {
7243					this.liveRegion.children().hide();
7244					$( "<div>" ).text( label ).appendTo( this.liveRegion );
7245				}
7246			},
7247			menuselect: function( event, ui ) {
7248				var item = ui.item.data( "ui-autocomplete-item" ),
7249					previous = this.previous;
7250
7251				// only trigger when focus was lost (click on menu)
7252				if ( this.element[ 0 ] !== this.document[ 0 ].activeElement ) {
7253					this.element.focus();
7254					this.previous = previous;
7255					// #6109 - IE triggers two focus events and the second
7256					// is asynchronous, so we need to reset the previous
7257					// term synchronously and asynchronously :-(
7258					this._delay(function() {
7259						this.previous = previous;
7260						this.selectedItem = item;
7261					});
7262				}
7263
7264				if ( false !== this._trigger( "select", event, { item: item } ) ) {
7265					this._value( item.value );
7266				}
7267				// reset the term after the select event
7268				// this allows custom select handling to work properly
7269				this.term = this._value();
7270
7271				this.close( event );
7272				this.selectedItem = item;
7273			}
7274		});
7275
7276		this.liveRegion = $( "<span>", {
7277				role: "status",
7278				"aria-live": "assertive",
7279				"aria-relevant": "additions"
7280			})
7281			.addClass( "ui-helper-hidden-accessible" )
7282			.appendTo( this.document[ 0 ].body );
7283
7284		// turning off autocomplete prevents the browser from remembering the
7285		// value when navigating through history, so we re-enable autocomplete
7286		// if the page is unloaded before the widget is destroyed. #7790
7287		this._on( this.window, {
7288			beforeunload: function() {
7289				this.element.removeAttr( "autocomplete" );
7290			}
7291		});
7292	},
7293
7294	_destroy: function() {
7295		clearTimeout( this.searching );
7296		this.element
7297			.removeClass( "ui-autocomplete-input" )
7298			.removeAttr( "autocomplete" );
7299		this.menu.element.remove();
7300		this.liveRegion.remove();
7301	},
7302
7303	_setOption: function( key, value ) {
7304		this._super( key, value );
7305		if ( key === "source" ) {
7306			this._initSource();
7307		}
7308		if ( key === "appendTo" ) {
7309			this.menu.element.appendTo( this._appendTo() );
7310		}
7311		if ( key === "disabled" && value && this.xhr ) {
7312			this.xhr.abort();
7313		}
7314	},
7315
7316	_appendTo: function() {
7317		var element = this.options.appendTo;
7318
7319		if ( element ) {
7320			element = element.jquery || element.nodeType ?
7321				$( element ) :
7322				this.document.find( element ).eq( 0 );
7323		}
7324
7325		if ( !element || !element[ 0 ] ) {
7326			element = this.element.closest( ".ui-front" );
7327		}
7328
7329		if ( !element.length ) {
7330			element = this.document[ 0 ].body;
7331		}
7332
7333		return element;
7334	},
7335
7336	_initSource: function() {
7337		var array, url,
7338			that = this;
7339		if ( $.isArray( this.options.source ) ) {
7340			array = this.options.source;
7341			this.source = function( request, response ) {
7342				response( $.ui.autocomplete.filter( array, request.term ) );
7343			};
7344		} else if ( typeof this.options.source === "string" ) {
7345			url = this.options.source;
7346			this.source = function( request, response ) {
7347				if ( that.xhr ) {
7348					that.xhr.abort();
7349				}
7350				that.xhr = $.ajax({
7351					url: url,
7352					data: request,
7353					dataType: "json",
7354					success: function( data ) {
7355						response( data );
7356					},
7357					error: function() {
7358						response([]);
7359					}
7360				});
7361			};
7362		} else {
7363			this.source = this.options.source;
7364		}
7365	},
7366
7367	_searchTimeout: function( event ) {
7368		clearTimeout( this.searching );
7369		this.searching = this._delay(function() {
7370
7371			// Search if the value has changed, or if the user retypes the same value (see #7434)
vendor: 8,850 bytes, lines 7372-7720
7372			var equalValues = this.term === this._value(),
7373				menuVisible = this.menu.element.is( ":visible" ),
7374				modifierKey = event.altKey || event.ctrlKey || event.metaKey || event.shiftKey;
7375
7376			if ( !equalValues || ( equalValues && !menuVisible && !modifierKey ) ) {
7377				this.selectedItem = null;
7378				this.search( null, event );
7379			}
7380		}, this.options.delay );
7381	},
7382
7383	search: function( value, event ) {
7384		value = value != null ? value : this._value();
7385
7386		// always save the actual value, not the one passed as an argument
7387		this.term = this._value();
7388
7389		if ( value.length < this.options.minLength ) {
7390			return this.close( event );
7391		}
7392
7393		if ( this._trigger( "search", event ) === false ) {
7394			return;
7395		}
7396
7397		return this._search( value );
7398	},
7399
7400	_search: function( value ) {
7401		this.pending++;
7402		this.element.addClass( "ui-autocomplete-loading" );
7403		this.cancelSearch = false;
7404
7405		this.source( { term: value }, this._response() );
7406	},
7407
7408	_response: function() {
7409		var index = ++this.requestIndex;
7410
7411		return $.proxy(function( content ) {
7412			if ( index === this.requestIndex ) {
7413				this.__response( content );
7414			}
7415
7416			this.pending--;
7417			if ( !this.pending ) {
7418				this.element.removeClass( "ui-autocomplete-loading" );
7419			}
7420		}, this );
7421	},
7422
7423	__response: function( content ) {
7424		if ( content ) {
7425			content = this._normalize( content );
7426		}
7427		this._trigger( "response", null, { content: content } );
7428		if ( !this.options.disabled && content && content.length && !this.cancelSearch ) {
7429			this._suggest( content );
7430			this._trigger( "open" );
7431		} else {
7432			// use ._close() instead of .close() so we don't cancel future searches
7433			this._close();
7434		}
7435	},
7436
7437	close: function( event ) {
7438		this.cancelSearch = true;
7439		this._close( event );
7440	},
7441
7442	_close: function( event ) {
7443		if ( this.menu.element.is( ":visible" ) ) {
7444			this.menu.element.hide();
7445			this.menu.blur();
7446			this.isNewMenu = true;
7447			this._trigger( "close", event );
7448		}
7449	},
7450
7451	_change: function( event ) {
7452		if ( this.previous !== this._value() ) {
7453			this._trigger( "change", event, { item: this.selectedItem } );
7454		}
7455	},
7456
7457	_normalize: function( items ) {
7458		// assume all items have the right format when the first item is complete
7459		if ( items.length && items[ 0 ].label && items[ 0 ].value ) {
7460			return items;
7461		}
7462		return $.map( items, function( item ) {
7463			if ( typeof item === "string" ) {
7464				return {
7465					label: item,
7466					value: item
7467				};
7468			}
7469			return $.extend( {}, item, {
7470				label: item.label || item.value,
7471				value: item.value || item.label
7472			});
7473		});
7474	},
7475
7476	_suggest: function( items ) {
7477		var ul = this.menu.element.empty();
7478		this._renderMenu( ul, items );
7479		this.isNewMenu = true;
7480		this.menu.refresh();
7481
7482		// size and position menu
7483		ul.show();
7484		this._resizeMenu();
7485		ul.position( $.extend({
7486			of: this.element
7487		}, this.options.position ) );
7488
7489		if ( this.options.autoFocus ) {
7490			this.menu.next();
7491		}
7492	},
7493
7494	_resizeMenu: function() {
7495		var ul = this.menu.element;
7496		ul.outerWidth( Math.max(
7497			// Firefox wraps long text (possibly a rounding bug)
7498			// so we add 1px to avoid the wrapping (#7513)
7499			ul.width( "" ).outerWidth() + 1,
7500			this.element.outerWidth()
7501		) );
7502	},
7503
7504	_renderMenu: function( ul, items ) {
7505		var that = this;
7506		$.each( items, function( index, item ) {
7507			that._renderItemData( ul, item );
7508		});
7509	},
7510
7511	_renderItemData: function( ul, item ) {
7512		return this._renderItem( ul, item ).data( "ui-autocomplete-item", item );
7513	},
7514
7515	_renderItem: function( ul, item ) {
7516		return $( "<li>" ).text( item.label ).appendTo( ul );
7517	},
7518
7519	_move: function( direction, event ) {
7520		if ( !this.menu.element.is( ":visible" ) ) {
7521			this.search( null, event );
7522			return;
7523		}
7524		if ( this.menu.isFirstItem() && /^previous/.test( direction ) ||
7525				this.menu.isLastItem() && /^next/.test( direction ) ) {
7526
7527			if ( !this.isMultiLine ) {
7528				this._value( this.term );
7529			}
7530
7531			this.menu.blur();
7532			return;
7533		}
7534		this.menu[ direction ]( event );
7535	},
7536
7537	widget: function() {
7538		return this.menu.element;
7539	},
7540
7541	_value: function() {
7542		return this.valueMethod.apply( this.element, arguments );
7543	},
7544
7545	_keyEvent: function( keyEvent, event ) {
7546		if ( !this.isMultiLine || this.menu.element.is( ":visible" ) ) {
7547			this._move( keyEvent, event );
7548
7549			// prevents moving cursor to beginning/end of the text field in some browsers
7550			event.preventDefault();
7551		}
7552	}
7553});
7554
7555$.extend( $.ui.autocomplete, {
7556	escapeRegex: function( value ) {
7557		return value.replace( /[\-\[\]{}()*+?.,\\\^$|#\s]/g, "\\$&" );
7558	},
7559	filter: function( array, term ) {
7560		var matcher = new RegExp( $.ui.autocomplete.escapeRegex( term ), "i" );
7561		return $.grep( array, function( value ) {
7562			return matcher.test( value.label || value.value || value );
7563		});
7564	}
7565});
7566
7567// live region extension, adding a `messages` option
7568// NOTE: This is an experimental API. We are still investigating
7569// a full solution for string manipulation and internationalization.
7570$.widget( "ui.autocomplete", $.ui.autocomplete, {
7571	options: {
7572		messages: {
7573			noResults: "No search results.",
7574			results: function( amount ) {
7575				return amount + ( amount > 1 ? " results are" : " result is" ) +
7576					" available, use up and down arrow keys to navigate.";
7577			}
7578		}
7579	},
7580
7581	__response: function( content ) {
7582		var message;
7583		this._superApply( arguments );
7584		if ( this.options.disabled || this.cancelSearch ) {
7585			return;
7586		}
7587		if ( content && content.length ) {
7588			message = this.options.messages.results( content.length );
7589		} else {
7590			message = this.options.messages.noResults;
7591		}
7592		this.liveRegion.children().hide();
7593		$( "<div>" ).text( message ).appendTo( this.liveRegion );
7594	}
7595});
7596
7597var autocomplete = $.ui.autocomplete;
7598
7599
7600/*!
7601 * jQuery UI Button 1.11.4
7602 * http://jqueryui.com
7603 *
7604 * Copyright jQuery Foundation and other contributors
7605 * Released under the MIT license.
7606 * http://jquery.org/license
7607 *
7608 * http://api.jqueryui.com/button/
7609 */
7610
7611
7612var lastActive,
7613	baseClasses = "ui-button ui-widget ui-state-default ui-corner-all",
7614	typeClasses = "ui-button-icons-only ui-button-icon-only ui-button-text-icons ui-button-text-icon-primary ui-button-text-icon-secondary ui-button-text-only",
7615	formResetHandler = function() {
7616		var form = $( this );
7617		setTimeout(function() {
7618			form.find( ":ui-button" ).button( "refresh" );
7619		}, 1 );
7620	},
7621	radioGroup = function( radio ) {
7622		var name = radio.name,
7623			form = radio.form,
7624			radios = $( [] );
7625		if ( name ) {
7626			name = name.replace( /'/g, "\\'" );
7627			if ( form ) {
7628				radios = $( form ).find( "[name='" + name + "'][type=radio]" );
7629			} else {
7630				radios = $( "[name='" + name + "'][type=radio]", radio.ownerDocument )
7631					.filter(function() {
7632						return !this.form;
7633					});
7634			}
7635		}
7636		return radios;
7637	};
7638
7639$.widget( "ui.button", {
7640	version: "1.11.4",
7641	defaultElement: "<button>",
7642	options: {
7643		disabled: null,
7644		text: true,
7645		label: null,
7646		icons: {
7647			primary: null,
7648			secondary: null
7649		}
7650	},
7651	_create: function() {
7652		this.element.closest( "form" )
7653			.unbind( "reset" + this.eventNamespace )
7654			.bind( "reset" + this.eventNamespace, formResetHandler );
7655
7656		if ( typeof this.options.disabled !== "boolean" ) {
7657			this.options.disabled = !!this.element.prop( "disabled" );
7658		} else {
7659			this.element.prop( "disabled", this.options.disabled );
7660		}
7661
7662		this._determineButtonType();
7663		this.hasTitle = !!this.buttonElement.attr( "title" );
7664
7665		var that = this,
7666			options = this.options,
7667			toggleButton = this.type === "checkbox" || this.type === "radio",
7668			activeClass = !toggleButton ? "ui-state-active" : "";
7669
7670		if ( options.label === null ) {
7671			options.label = (this.type === "input" ? this.buttonElement.val() : this.buttonElement.html());
7672		}
7673
7674		this._hoverable( this.buttonElement );
7675
7676		this.buttonElement
7677			.addClass( baseClasses )
7678			.attr( "role", "button" )
7679			.bind( "mouseenter" + this.eventNamespace, function() {
7680				if ( options.disabled ) {
7681					return;
7682				}
7683				if ( this === lastActive ) {
7684					$( this ).addClass( "ui-state-active" );
7685				}
7686			})
7687			.bind( "mouseleave" + this.eventNamespace, function() {
7688				if ( options.disabled ) {
7689					return;
7690				}
7691				$( this ).removeClass( activeClass );
7692			})
7693			.bind( "click" + this.eventNamespace, function( event ) {
7694				if ( options.disabled ) {
7695					event.preventDefault();
7696					event.stopImmediatePropagation();
7697				}
7698			});
7699
7700		// Can't use _focusable() because the element that receives focus
7701		// and the element that gets the ui-state-focus class are different
7702		this._on({
7703			focus: function() {
7704				this.buttonElement.addClass( "ui-state-focus" );
7705			},
7706			blur: function() {
7707				this.buttonElement.removeClass( "ui-state-focus" );
7708			}
7709		});
7710
7711		if ( toggleButton ) {
7712			this.element.bind( "change" + this.eventNamespace, function() {
7713				that.refresh();
7714			});
7715		}
7716
7717		if ( this.type === "checkbox" ) {
7718			this.buttonElement.bind( "click" + this.eventNamespace, function() {
7719				if ( options.disabled ) {
7720					return false;
vendor: 5,528 bytes, lines 7721-7905
7721				}
7722			});
7723		} else if ( this.type === "radio" ) {
7724			this.buttonElement.bind( "click" + this.eventNamespace, function() {
7725				if ( options.disabled ) {
7726					return false;
7727				}
7728				$( this ).addClass( "ui-state-active" );
7729				that.buttonElement.attr( "aria-pressed", "true" );
7730
7731				var radio = that.element[ 0 ];
7732				radioGroup( radio )
7733					.not( radio )
7734					.map(function() {
7735						return $( this ).button( "widget" )[ 0 ];
7736					})
7737					.removeClass( "ui-state-active" )
7738					.attr( "aria-pressed", "false" );
7739			});
7740		} else {
7741			this.buttonElement
7742				.bind( "mousedown" + this.eventNamespace, function() {
7743					if ( options.disabled ) {
7744						return false;
7745					}
7746					$( this ).addClass( "ui-state-active" );
7747					lastActive = this;
7748					that.document.one( "mouseup", function() {
7749						lastActive = null;
7750					});
7751				})
7752				.bind( "mouseup" + this.eventNamespace, function() {
7753					if ( options.disabled ) {
7754						return false;
7755					}
7756					$( this ).removeClass( "ui-state-active" );
7757				})
7758				.bind( "keydown" + this.eventNamespace, function(event) {
7759					if ( options.disabled ) {
7760						return false;
7761					}
7762					if ( event.keyCode === $.ui.keyCode.SPACE || event.keyCode === $.ui.keyCode.ENTER ) {
7763						$( this ).addClass( "ui-state-active" );
7764					}
7765				})
7766				// see #8559, we bind to blur here in case the button element loses
7767				// focus between keydown and keyup, it would be left in an "active" state
7768				.bind( "keyup" + this.eventNamespace + " blur" + this.eventNamespace, function() {
7769					$( this ).removeClass( "ui-state-active" );
7770				});
7771
7772			if ( this.buttonElement.is("a") ) {
7773				this.buttonElement.keyup(function(event) {
7774					if ( event.keyCode === $.ui.keyCode.SPACE ) {
7775						// TODO pass through original event correctly (just as 2nd argument doesn't work)
7776						$( this ).click();
7777					}
7778				});
7779			}
7780		}
7781
7782		this._setOption( "disabled", options.disabled );
7783		this._resetButton();
7784	},
7785
7786	_determineButtonType: function() {
7787		var ancestor, labelSelector, checked;
7788
7789		if ( this.element.is("[type=checkbox]") ) {
7790			this.type = "checkbox";
7791		} else if ( this.element.is("[type=radio]") ) {
7792			this.type = "radio";
7793		} else if ( this.element.is("input") ) {
7794			this.type = "input";
7795		} else {
7796			this.type = "button";
7797		}
7798
7799		if ( this.type === "checkbox" || this.type === "radio" ) {
7800			// we don't search against the document in case the element
7801			// is disconnected from the DOM
7802			ancestor = this.element.parents().last();
7803			labelSelector = "label[for='" + this.element.attr("id") + "']";
7804			this.buttonElement = ancestor.find( labelSelector );
7805			if ( !this.buttonElement.length ) {
7806				ancestor = ancestor.length ? ancestor.siblings() : this.element.siblings();
7807				this.buttonElement = ancestor.filter( labelSelector );
7808				if ( !this.buttonElement.length ) {
7809					this.buttonElement = ancestor.find( labelSelector );
7810				}
7811			}
7812			this.element.addClass( "ui-helper-hidden-accessible" );
7813
7814			checked = this.element.is( ":checked" );
7815			if ( checked ) {
7816				this.buttonElement.addClass( "ui-state-active" );
7817			}
7818			this.buttonElement.prop( "aria-pressed", checked );
7819		} else {
7820			this.buttonElement = this.element;
7821		}
7822	},
7823
7824	widget: function() {
7825		return this.buttonElement;
7826	},
7827
7828	_destroy: function() {
7829		this.element
7830			.removeClass( "ui-helper-hidden-accessible" );
7831		this.buttonElement
7832			.removeClass( baseClasses + " ui-state-active " + typeClasses )
7833			.removeAttr( "role" )
7834			.removeAttr( "aria-pressed" )
7835			.html( this.buttonElement.find(".ui-button-text").html() );
7836
7837		if ( !this.hasTitle ) {
7838			this.buttonElement.removeAttr( "title" );
7839		}
7840	},
7841
7842	_setOption: function( key, value ) {
7843		this._super( key, value );
7844		if ( key === "disabled" ) {
7845			this.widget().toggleClass( "ui-state-disabled", !!value );
7846			this.element.prop( "disabled", !!value );
7847			if ( value ) {
7848				if ( this.type === "checkbox" || this.type === "radio" ) {
7849					this.buttonElement.removeClass( "ui-state-focus" );
7850				} else {
7851					this.buttonElement.removeClass( "ui-state-focus ui-state-active" );
7852				}
7853			}
7854			return;
7855		}
7856		this._resetButton();
7857	},
7858
7859	refresh: function() {
7860		//See #8237 & #8828
7861		var isDisabled = this.element.is( "input, button" ) ? this.element.is( ":disabled" ) : this.element.hasClass( "ui-button-disabled" );
7862
7863		if ( isDisabled !== this.options.disabled ) {
7864			this._setOption( "disabled", isDisabled );
7865		}
7866		if ( this.type === "radio" ) {
7867			radioGroup( this.element[0] ).each(function() {
7868				if ( $( this ).is( ":checked" ) ) {
7869					$( this ).button( "widget" )
7870						.addClass( "ui-state-active" )
7871						.attr( "aria-pressed", "true" );
7872				} else {
7873					$( this ).button( "widget" )
7874						.removeClass( "ui-state-active" )
7875						.attr( "aria-pressed", "false" );
7876				}
7877			});
7878		} else if ( this.type === "checkbox" ) {
7879			if ( this.element.is( ":checked" ) ) {
7880				this.buttonElement
7881					.addClass( "ui-state-active" )
7882					.attr( "aria-pressed", "true" );
7883			} else {
7884				this.buttonElement
7885					.removeClass( "ui-state-active" )
7886					.attr( "aria-pressed", "false" );
7887			}
7888		}
7889	},
7890
7891	_resetButton: function() {
7892		if ( this.type === "input" ) {
7893			if ( this.options.label ) {
7894				this.element.val( this.options.label );
7895			}
7896			return;
7897		}
7898		var buttonElement = this.buttonElement.removeClass( typeClasses ),
7899			buttonText = $( "<span></span>", this.document[0] )
7900				.addClass( "ui-button-text" )
7901				.html( this.options.label )
7902				.appendTo( buttonElement.empty() )
7903				.text(),
7904			icons = this.options.icons,
7905			multipleIcons = icons.primary && icons.secondary,
vendor: 6,515 bytes, lines 7906-8076
7906			buttonClasses = [];
7907
7908		if ( icons.primary || icons.secondary ) {
7909			if ( this.options.text ) {
7910				buttonClasses.push( "ui-button-text-icon" + ( multipleIcons ? "s" : ( icons.primary ? "-primary" : "-secondary" ) ) );
7911			}
7912
7913			if ( icons.primary ) {
7914				buttonElement.prepend( "<span class='ui-button-icon-primary ui-icon " + icons.primary + "'></span>" );
7915			}
7916
7917			if ( icons.secondary ) {
7918				buttonElement.append( "<span class='ui-button-icon-secondary ui-icon " + icons.secondary + "'></span>" );
7919			}
7920
7921			if ( !this.options.text ) {
7922				buttonClasses.push( multipleIcons ? "ui-button-icons-only" : "ui-button-icon-only" );
7923
7924				if ( !this.hasTitle ) {
7925					buttonElement.attr( "title", $.trim( buttonText ) );
7926				}
7927			}
7928		} else {
7929			buttonClasses.push( "ui-button-text-only" );
7930		}
7931		buttonElement.addClass( buttonClasses.join( " " ) );
7932	}
7933});
7934
7935$.widget( "ui.buttonset", {
7936	version: "1.11.4",
7937	options: {
7938		items: "button, input[type=button], input[type=submit], input[type=reset], input[type=checkbox], input[type=radio], a, :data(ui-button)"
7939	},
7940
7941	_create: function() {
7942		this.element.addClass( "ui-buttonset" );
7943	},
7944
7945	_init: function() {
7946		this.refresh();
7947	},
7948
7949	_setOption: function( key, value ) {
7950		if ( key === "disabled" ) {
7951			this.buttons.button( "option", key, value );
7952		}
7953
7954		this._super( key, value );
7955	},
7956
7957	refresh: function() {
7958		var rtl = this.element.css( "direction" ) === "rtl",
7959			allButtons = this.element.find( this.options.items ),
7960			existingButtons = allButtons.filter( ":ui-button" );
7961
7962		// Initialize new buttons
7963		allButtons.not( ":ui-button" ).button();
7964
7965		// Refresh existing buttons
7966		existingButtons.button( "refresh" );
7967
7968		this.buttons = allButtons
7969			.map(function() {
7970				return $( this ).button( "widget" )[ 0 ];
7971			})
7972				.removeClass( "ui-corner-all ui-corner-left ui-corner-right" )
7973				.filter( ":first" )
7974					.addClass( rtl ? "ui-corner-right" : "ui-corner-left" )
7975				.end()
7976				.filter( ":last" )
7977					.addClass( rtl ? "ui-corner-left" : "ui-corner-right" )
7978				.end()
7979			.end();
7980	},
7981
7982	_destroy: function() {
7983		this.element.removeClass( "ui-buttonset" );
7984		this.buttons
7985			.map(function() {
7986				return $( this ).button( "widget" )[ 0 ];
7987			})
7988				.removeClass( "ui-corner-left ui-corner-right" )
7989			.end()
7990			.button( "destroy" );
7991	}
7992});
7993
7994var button = $.ui.button;
7995
7996
7997/*!
7998 * jQuery UI Datepicker 1.11.4
7999 * http://jqueryui.com
8000 *
8001 * Copyright jQuery Foundation and other contributors
8002 * Released under the MIT license.
8003 * http://jquery.org/license
8004 *
8005 * http://api.jqueryui.com/datepicker/
8006 */
8007
8008
8009$.extend($.ui, { datepicker: { version: "1.11.4" } });
8010
8011var datepicker_instActive;
8012
8013function datepicker_getZindex( elem ) {
8014	var position, value;
8015	while ( elem.length && elem[ 0 ] !== document ) {
8016		// Ignore z-index if position is set to a value where z-index is ignored by the browser
8017		// This makes behavior of this function consistent across browsers
8018		// WebKit always returns auto if the element is positioned
8019		position = elem.css( "position" );
8020		if ( position === "absolute" || position === "relative" || position === "fixed" ) {
8021			// IE returns 0 when zIndex is not specified
8022			// other browsers return a string
8023			// we ignore the case of nested elements with an explicit value of 0
8024			// <div style="z-index: -10;"><div style="z-index: 0;"></div></div>
8025			value = parseInt( elem.css( "zIndex" ), 10 );
8026			if ( !isNaN( value ) && value !== 0 ) {
8027				return value;
8028			}
8029		}
8030		elem = elem.parent();
8031	}
8032
8033	return 0;
8034}
8035/* Date picker manager.
8036   Use the singleton instance of this class, $.datepicker, to interact with the date picker.
8037   Settings for (groups of) date pickers are maintained in an instance object,
8038   allowing multiple different settings on the same page. */
8039
8040function Datepicker() {
8041	this._curInst = null; // The current instance in use
8042	this._keyEvent = false; // If the last event was a key event
8043	this._disabledInputs = []; // List of date picker inputs that have been disabled
8044	this._datepickerShowing = false; // True if the popup picker is showing , false if not
8045	this._inDialog = false; // True if showing within a "dialog", false if not
8046	this._mainDivId = "ui-datepicker-div"; // The ID of the main datepicker division
8047	this._inlineClass = "ui-datepicker-inline"; // The name of the inline marker class
8048	this._appendClass = "ui-datepicker-append"; // The name of the append marker class
8049	this._triggerClass = "ui-datepicker-trigger"; // The name of the trigger marker class
8050	this._dialogClass = "ui-datepicker-dialog"; // The name of the dialog marker class
8051	this._disableClass = "ui-datepicker-disabled"; // The name of the disabled covering marker class
8052	this._unselectableClass = "ui-datepicker-unselectable"; // The name of the unselectable cell marker class
8053	this._currentClass = "ui-datepicker-current-day"; // The name of the current day marker class
8054	this._dayOverClass = "ui-datepicker-days-cell-over"; // The name of the day hover marker class
8055	this.regional = []; // Available regional settings, indexed by language code
8056	this.regional[""] = { // Default regional settings
8057		closeText: "Done", // Display text for close link
8058		prevText: "Prev", // Display text for previous month link
8059		nextText: "Next", // Display text for next month link
8060		currentText: "Today", // Display text for current month link
8061		monthNames: ["January","February","March","April","May","June",
8062			"July","August","September","October","November","December"], // Names of months for drop-down and formatting
8063		monthNamesShort: ["Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"], // For formatting
8064		dayNames: ["Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday"], // For formatting
8065		dayNamesShort: ["Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat"], // For formatting
8066		dayNamesMin: ["Su","Mo","Tu","We","Th","Fr","Sa"], // Column headings for days starting at Sunday
8067		weekHeader: "Wk", // Column header for week of the year
8068		dateFormat: "mm/dd/yy", // See format options on parseDate
8069		firstDay: 0, // The first day of the week, Sun = 0, Mon = 1, ...
8070		isRTL: false, // True if right-to-left language, false if left-to-right
8071		showMonthAfterYear: false, // True if the year select precedes month, false for month then year
8072		yearSuffix: "" // Additional text to append to the year in the month headers
8073	};
8074	this._defaults = { // Global defaults for all the date picker instances
8075		showOn: "focus", // "focus" for popup on focus,
8076			// "button" for trigger button, or "both" for either
vendor: 19,263 bytes, lines 8077-8576
8077		showAnim: "fadeIn", // Name of jQuery animation for popup
8078		showOptions: {}, // Options for enhanced animations
8079		defaultDate: null, // Used when field is blank: actual date,
8080			// +/-number for offset from today, null for today
8081		appendText: "", // Display text following the input box, e.g. showing the format
8082		buttonText: "...", // Text for trigger button
8083		buttonImage: "", // URL for trigger button image
8084		buttonImageOnly: false, // True if the image appears alone, false if it appears on a button
8085		hideIfNoPrevNext: false, // True to hide next/previous month links
8086			// if not applicable, false to just disable them
8087		navigationAsDateFormat: false, // True if date formatting applied to prev/today/next links
8088		gotoCurrent: false, // True if today link goes back to current selection instead
8089		changeMonth: false, // True if month can be selected directly, false if only prev/next
8090		changeYear: false, // True if year can be selected directly, false if only prev/next
8091		yearRange: "c-10:c+10", // Range of years to display in drop-down,
8092			// either relative to today's year (-nn:+nn), relative to currently displayed year
8093			// (c-nn:c+nn), absolute (nnnn:nnnn), or a combination of the above (nnnn:-n)
8094		showOtherMonths: false, // True to show dates in other months, false to leave blank
8095		selectOtherMonths: false, // True to allow selection of dates in other months, false for unselectable
8096		showWeek: false, // True to show week of the year, false to not show it
8097		calculateWeek: this.iso8601Week, // How to calculate the week of the year,
8098			// takes a Date and returns the number of the week for it
8099		shortYearCutoff: "+10", // Short year values < this are in the current century,
8100			// > this are in the previous century,
8101			// string value starting with "+" for current year + value
8102		minDate: null, // The earliest selectable date, or null for no limit
8103		maxDate: null, // The latest selectable date, or null for no limit
8104		duration: "fast", // Duration of display/closure
8105		beforeShowDay: null, // Function that takes a date and returns an array with
8106			// [0] = true if selectable, false if not, [1] = custom CSS class name(s) or "",
8107			// [2] = cell title (optional), e.g. $.datepicker.noWeekends
8108		beforeShow: null, // Function that takes an input field and
8109			// returns a set of custom settings for the date picker
8110		onSelect: null, // Define a callback function when a date is selected
8111		onChangeMonthYear: null, // Define a callback function when the month or year is changed
8112		onClose: null, // Define a callback function when the datepicker is closed
8113		numberOfMonths: 1, // Number of months to show at a time
8114		showCurrentAtPos: 0, // The position in multipe months at which to show the current month (starting at 0)
8115		stepMonths: 1, // Number of months to step back/forward
8116		stepBigMonths: 12, // Number of months to step back/forward for the big links
8117		altField: "", // Selector for an alternate field to store selected dates into
8118		altFormat: "", // The date format to use for the alternate field
8119		constrainInput: true, // The input is constrained by the current date format
8120		showButtonPanel: false, // True to show button panel, false to not show it
8121		autoSize: false, // True to size the input for the date format, false to leave as is
8122		disabled: false // The initial disabled state
8123	};
8124	$.extend(this._defaults, this.regional[""]);
8125	this.regional.en = $.extend( true, {}, this.regional[ "" ]);
8126	this.regional[ "en-US" ] = $.extend( true, {}, this.regional.en );
8127	this.dpDiv = datepicker_bindHover($("<div id='" + this._mainDivId + "' class='ui-datepicker ui-widget ui-widget-content ui-helper-clearfix ui-corner-all'></div>"));
8128}
8129
8130$.extend(Datepicker.prototype, {
8131	/* Class name added to elements to indicate already configured with a date picker. */
8132	markerClassName: "hasDatepicker",
8133
8134	//Keep track of the maximum number of rows displayed (see #7043)
8135	maxRows: 4,
8136
8137	// TODO rename to "widget" when switching to widget factory
8138	_widgetDatepicker: function() {
8139		return this.dpDiv;
8140	},
8141
8142	/* Override the default settings for all instances of the date picker.
8143	 * @param  settings  object - the new settings to use as defaults (anonymous object)
8144	 * @return the manager object
8145	 */
8146	setDefaults: function(settings) {
8147		datepicker_extendRemove(this._defaults, settings || {});
8148		return this;
8149	},
8150
8151	/* Attach the date picker to a jQuery selection.
8152	 * @param  target	element - the target input field or division or span
8153	 * @param  settings  object - the new settings to use for this date picker instance (anonymous)
8154	 */
8155	_attachDatepicker: function(target, settings) {
8156		var nodeName, inline, inst;
8157		nodeName = target.nodeName.toLowerCase();
8158		inline = (nodeName === "div" || nodeName === "span");
8159		if (!target.id) {
8160			this.uuid += 1;
8161			target.id = "dp" + this.uuid;
8162		}
8163		inst = this._newInst($(target), inline);
8164		inst.settings = $.extend({}, settings || {});
8165		if (nodeName === "input") {
8166			this._connectDatepicker(target, inst);
8167		} else if (inline) {
8168			this._inlineDatepicker(target, inst);
8169		}
8170	},
8171
8172	/* Create a new instance object. */
8173	_newInst: function(target, inline) {
8174		var id = target[0].id.replace(/([^A-Za-z0-9_\-])/g, "\\\\$1"); // escape jQuery meta chars
8175		return {id: id, input: target, // associated target
8176			selectedDay: 0, selectedMonth: 0, selectedYear: 0, // current selection
8177			drawMonth: 0, drawYear: 0, // month being drawn
8178			inline: inline, // is datepicker inline or not
8179			dpDiv: (!inline ? this.dpDiv : // presentation div
8180			datepicker_bindHover($("<div class='" + this._inlineClass + " ui-datepicker ui-widget ui-widget-content ui-helper-clearfix ui-corner-all'></div>")))};
8181	},
8182
8183	/* Attach the date picker to an input field. */
8184	_connectDatepicker: function(target, inst) {
8185		var input = $(target);
8186		inst.append = $([]);
8187		inst.trigger = $([]);
8188		if (input.hasClass(this.markerClassName)) {
8189			return;
8190		}
8191		this._attachments(input, inst);
8192		input.addClass(this.markerClassName).keydown(this._doKeyDown).
8193			keypress(this._doKeyPress).keyup(this._doKeyUp);
8194		this._autoSize(inst);
8195		$.data(target, "datepicker", inst);
8196		//If disabled option is true, disable the datepicker once it has been attached to the input (see ticket #5665)
8197		if( inst.settings.disabled ) {
8198			this._disableDatepicker( target );
8199		}
8200	},
8201
8202	/* Make attachments based on settings. */
8203	_attachments: function(input, inst) {
8204		var showOn, buttonText, buttonImage,
8205			appendText = this._get(inst, "appendText"),
8206			isRTL = this._get(inst, "isRTL");
8207
8208		if (inst.append) {
8209			inst.append.remove();
8210		}
8211		if (appendText) {
8212			inst.append = $("<span class='" + this._appendClass + "'>" + appendText + "</span>");
8213			input[isRTL ? "before" : "after"](inst.append);
8214		}
8215
8216		input.unbind("focus", this._showDatepicker);
8217
8218		if (inst.trigger) {
8219			inst.trigger.remove();
8220		}
8221
8222		showOn = this._get(inst, "showOn");
8223		if (showOn === "focus" || showOn === "both") { // pop-up date picker when in the marked field
8224			input.focus(this._showDatepicker);
8225		}
8226		if (showOn === "button" || showOn === "both") { // pop-up date picker when button clicked
8227			buttonText = this._get(inst, "buttonText");
8228			buttonImage = this._get(inst, "buttonImage");
8229			inst.trigger = $(this._get(inst, "buttonImageOnly") ?
8230				$("<img/>").addClass(this._triggerClass).
8231					attr({ src: buttonImage, alt: buttonText, title: buttonText }) :
8232				$("<button type='button'></button>").addClass(this._triggerClass).
8233					html(!buttonImage ? buttonText : $("<img/>").attr(
8234					{ src:buttonImage, alt:buttonText, title:buttonText })));
8235			input[isRTL ? "before" : "after"](inst.trigger);
8236			inst.trigger.click(function() {
8237				if ($.datepicker._datepickerShowing && $.datepicker._lastInput === input[0]) {
8238					$.datepicker._hideDatepicker();
8239				} else if ($.datepicker._datepickerShowing && $.datepicker._lastInput !== input[0]) {
8240					$.datepicker._hideDatepicker();
8241					$.datepicker._showDatepicker(input[0]);
8242				} else {
8243					$.datepicker._showDatepicker(input[0]);
8244				}
8245				return false;
8246			});
8247		}
8248	},
8249
8250	/* Apply the maximum length for the date format. */
8251	_autoSize: function(inst) {
8252		if (this._get(inst, "autoSize") && !inst.inline) {
8253			var findMax, max, maxI, i,
8254				date = new Date(2009, 12 - 1, 20), // Ensure double digits
8255				dateFormat = this._get(inst, "dateFormat");
8256
8257			if (dateFormat.match(/[DM]/)) {
8258				findMax = function(names) {
8259					max = 0;
8260					maxI = 0;
8261					for (i = 0; i < names.length; i++) {
8262						if (names[i].length > max) {
8263							max = names[i].length;
8264							maxI = i;
8265						}
8266					}
8267					return maxI;
8268				};
8269				date.setMonth(findMax(this._get(inst, (dateFormat.match(/MM/) ?
8270					"monthNames" : "monthNamesShort"))));
8271				date.setDate(findMax(this._get(inst, (dateFormat.match(/DD/) ?
8272					"dayNames" : "dayNamesShort"))) + 20 - date.getDay());
8273			}
8274			inst.input.attr("size", this._formatDate(inst, date).length);
8275		}
8276	},
8277
8278	/* Attach an inline date picker to a div. */
8279	_inlineDatepicker: function(target, inst) {
8280		var divSpan = $(target);
8281		if (divSpan.hasClass(this.markerClassName)) {
8282			return;
8283		}
8284		divSpan.addClass(this.markerClassName).append(inst.dpDiv);
8285		$.data(target, "datepicker", inst);
8286		this._setDate(inst, this._getDefaultDate(inst), true);
8287		this._updateDatepicker(inst);
8288		this._updateAlternate(inst);
8289		//If disabled option is true, disable the datepicker before showing it (see ticket #5665)
8290		if( inst.settings.disabled ) {
8291			this._disableDatepicker( target );
8292		}
8293		// Set display:block in place of inst.dpDiv.show() which won't work on disconnected elements
8294		// http://bugs.jqueryui.com/ticket/7552 - A Datepicker created on a detached div has zero height
8295		inst.dpDiv.css( "display", "block" );
8296	},
8297
8298	/* Pop-up the date picker in a "dialog" box.
8299	 * @param  input element - ignored
8300	 * @param  date	string or Date - the initial date to display
8301	 * @param  onSelect  function - the function to call when a date is selected
8302	 * @param  settings  object - update the dialog date picker instance's settings (anonymous object)
8303	 * @param  pos int[2] - coordinates for the dialog's position within the screen or
8304	 *					event - with x/y coordinates or
8305	 *					leave empty for default (screen centre)
8306	 * @return the manager object
8307	 */
8308	_dialogDatepicker: function(input, date, onSelect, settings, pos) {
8309		var id, browserWidth, browserHeight, scrollX, scrollY,
8310			inst = this._dialogInst; // internal instance
8311
8312		if (!inst) {
8313			this.uuid += 1;
8314			id = "dp" + this.uuid;
8315			this._dialogInput = $("<input type='text' id='" + id +
8316				"' style='position: absolute; top: -100px; width: 0px;'/>");
8317			this._dialogInput.keydown(this._doKeyDown);
8318			$("body").append(this._dialogInput);
8319			inst = this._dialogInst = this._newInst(this._dialogInput, false);
8320			inst.settings = {};
8321			$.data(this._dialogInput[0], "datepicker", inst);
8322		}
8323		datepicker_extendRemove(inst.settings, settings || {});
8324		date = (date && date.constructor === Date ? this._formatDate(inst, date) : date);
8325		this._dialogInput.val(date);
8326
8327		this._pos = (pos ? (pos.length ? pos : [pos.pageX, pos.pageY]) : null);
8328		if (!this._pos) {
8329			browserWidth = document.documentElement.clientWidth;
8330			browserHeight = document.documentElement.clientHeight;
8331			scrollX = document.documentElement.scrollLeft || document.body.scrollLeft;
8332			scrollY = document.documentElement.scrollTop || document.body.scrollTop;
8333			this._pos = // should use actual width/height below
8334				[(browserWidth / 2) - 100 + scrollX, (browserHeight / 2) - 150 + scrollY];
8335		}
8336
8337		// move input on screen for focus, but hidden behind dialog
8338		this._dialogInput.css("left", (this._pos[0] + 20) + "px").css("top", this._pos[1] + "px");
8339		inst.settings.onSelect = onSelect;
8340		this._inDialog = true;
8341		this.dpDiv.addClass(this._dialogClass);
8342		this._showDatepicker(this._dialogInput[0]);
8343		if ($.blockUI) {
8344			$.blockUI(this.dpDiv);
8345		}
8346		$.data(this._dialogInput[0], "datepicker", inst);
8347		return this;
8348	},
8349
8350	/* Detach a datepicker from its control.
8351	 * @param  target	element - the target input field or division or span
8352	 */
8353	_destroyDatepicker: function(target) {
8354		var nodeName,
8355			$target = $(target),
8356			inst = $.data(target, "datepicker");
8357
8358		if (!$target.hasClass(this.markerClassName)) {
8359			return;
8360		}
8361
8362		nodeName = target.nodeName.toLowerCase();
8363		$.removeData(target, "datepicker");
8364		if (nodeName === "input") {
8365			inst.append.remove();
8366			inst.trigger.remove();
8367			$target.removeClass(this.markerClassName).
8368				unbind("focus", this._showDatepicker).
8369				unbind("keydown", this._doKeyDown).
8370				unbind("keypress", this._doKeyPress).
8371				unbind("keyup", this._doKeyUp);
8372		} else if (nodeName === "div" || nodeName === "span") {
8373			$target.removeClass(this.markerClassName).empty();
8374		}
8375
8376		if ( datepicker_instActive === inst ) {
8377			datepicker_instActive = null;
8378		}
8379	},
8380
8381	/* Enable the date picker to a jQuery selection.
8382	 * @param  target	element - the target input field or division or span
8383	 */
8384	_enableDatepicker: function(target) {
8385		var nodeName, inline,
8386			$target = $(target),
8387			inst = $.data(target, "datepicker");
8388
8389		if (!$target.hasClass(this.markerClassName)) {
8390			return;
8391		}
8392
8393		nodeName = target.nodeName.toLowerCase();
8394		if (nodeName === "input") {
8395			target.disabled = false;
8396			inst.trigger.filter("button").
8397				each(function() { this.disabled = false; }).end().
8398				filter("img").css({opacity: "1.0", cursor: ""});
8399		} else if (nodeName === "div" || nodeName === "span") {
8400			inline = $target.children("." + this._inlineClass);
8401			inline.children().removeClass("ui-state-disabled");
8402			inline.find("select.ui-datepicker-month, select.ui-datepicker-year").
8403				prop("disabled", false);
8404		}
8405		this._disabledInputs = $.map(this._disabledInputs,
8406			function(value) { return (value === target ? null : value); }); // delete entry
8407	},
8408
8409	/* Disable the date picker to a jQuery selection.
8410	 * @param  target	element - the target input field or division or span
8411	 */
8412	_disableDatepicker: function(target) {
8413		var nodeName, inline,
8414			$target = $(target),
8415			inst = $.data(target, "datepicker");
8416
8417		if (!$target.hasClass(this.markerClassName)) {
8418			return;
8419		}
8420
8421		nodeName = target.nodeName.toLowerCase();
8422		if (nodeName === "input") {
8423			target.disabled = true;
8424			inst.trigger.filter("button").
8425				each(function() { this.disabled = true; }).end().
8426				filter("img").css({opacity: "0.5", cursor: "default"});
8427		} else if (nodeName === "div" || nodeName === "span") {
8428			inline = $target.children("." + this._inlineClass);
8429			inline.children().addClass("ui-state-disabled");
8430			inline.find("select.ui-datepicker-month, select.ui-datepicker-year").
8431				prop("disabled", true);
8432		}
8433		this._disabledInputs = $.map(this._disabledInputs,
8434			function(value) { return (value === target ? null : value); }); // delete entry
8435		this._disabledInputs[this._disabledInputs.length] = target;
8436	},
8437
8438	/* Is the first field in a jQuery collection disabled as a datepicker?
8439	 * @param  target	element - the target input field or division or span
8440	 * @return boolean - true if disabled, false if enabled
8441	 */
8442	_isDisabledDatepicker: function(target) {
8443		if (!target) {
8444			return false;
8445		}
8446		for (var i = 0; i < this._disabledInputs.length; i++) {
8447			if (this._disabledInputs[i] === target) {
8448				return true;
8449			}
8450		}
8451		return false;
8452	},
8453
8454	/* Retrieve the instance data for the target control.
8455	 * @param  target  element - the target input field or division or span
8456	 * @return  object - the associated instance data
8457	 * @throws  error if a jQuery problem getting data
8458	 */
8459	_getInst: function(target) {
8460		try {
8461			return $.data(target, "datepicker");
8462		}
8463		catch (err) {
8464			throw "Missing instance data for this datepicker";
8465		}
8466	},
8467
8468	/* Update or retrieve the settings for a date picker attached to an input field or division.
8469	 * @param  target  element - the target input field or division or span
8470	 * @param  name	object - the new settings to update or
8471	 *				string - the name of the setting to change or retrieve,
8472	 *				when retrieving also "all" for all instance settings or
8473	 *				"defaults" for all global defaults
8474	 * @param  value   any - the new value for the setting
8475	 *				(omit if above is an object or to retrieve a value)
8476	 */
8477	_optionDatepicker: function(target, name, value) {
8478		var settings, date, minDate, maxDate,
8479			inst = this._getInst(target);
8480
8481		if (arguments.length === 2 && typeof name === "string") {
8482			return (name === "defaults" ? $.extend({}, $.datepicker._defaults) :
8483				(inst ? (name === "all" ? $.extend({}, inst.settings) :
8484				this._get(inst, name)) : null));
8485		}
8486
8487		settings = name || {};
8488		if (typeof name === "string") {
8489			settings = {};
8490			settings[name] = value;
8491		}
8492
8493		if (inst) {
8494			if (this._curInst === inst) {
8495				this._hideDatepicker();
8496			}
8497
8498			date = this._getDateDatepicker(target, true);
8499			minDate = this._getMinMaxDate(inst, "min");
8500			maxDate = this._getMinMaxDate(inst, "max");
8501			datepicker_extendRemove(inst.settings, settings);
8502			// reformat the old minDate/maxDate values if dateFormat changes and a new minDate/maxDate isn't provided
8503			if (minDate !== null && settings.dateFormat !== undefined && settings.minDate === undefined) {
8504				inst.settings.minDate = this._formatDate(inst, minDate);
8505			}
8506			if (maxDate !== null && settings.dateFormat !== undefined && settings.maxDate === undefined) {
8507				inst.settings.maxDate = this._formatDate(inst, maxDate);
8508			}
8509			if ( "disabled" in settings ) {
8510				if ( settings.disabled ) {
8511					this._disableDatepicker(target);
8512				} else {
8513					this._enableDatepicker(target);
8514				}
8515			}
8516			this._attachments($(target), inst);
8517			this._autoSize(inst);
8518			this._setDate(inst, date);
8519			this._updateAlternate(inst);
8520			this._updateDatepicker(inst);
8521		}
8522	},
8523
8524	// change method deprecated
8525	_changeDatepicker: function(target, name, value) {
8526		this._optionDatepicker(target, name, value);
8527	},
8528
8529	/* Redraw the date picker attached to an input field or division.
8530	 * @param  target  element - the target input field or division or span
8531	 */
8532	_refreshDatepicker: function(target) {
8533		var inst = this._getInst(target);
8534		if (inst) {
8535			this._updateDatepicker(inst);
8536		}
8537	},
8538
8539	/* Set the dates for a jQuery selection.
8540	 * @param  target element - the target input field or division or span
8541	 * @param  date	Date - the new date
8542	 */
8543	_setDateDatepicker: function(target, date) {
8544		var inst = this._getInst(target);
8545		if (inst) {
8546			this._setDate(inst, date);
8547			this._updateDatepicker(inst);
8548			this._updateAlternate(inst);
8549		}
8550	},
8551
8552	/* Get the date(s) for the first entry in a jQuery selection.
8553	 * @param  target element - the target input field or division or span
8554	 * @param  noDefault boolean - true if no default date is to be used
8555	 * @return Date - the current date
8556	 */
8557	_getDateDatepicker: function(target, noDefault) {
8558		var inst = this._getInst(target);
8559		if (inst && !inst.inline) {
8560			this._setDateFromField(inst, noDefault);
8561		}
8562		return (inst ? this._getDate(inst) : null);
8563	},
8564
8565	/* Handle keystrokes. */
8566	_doKeyDown: function(event) {
8567		var onSelect, dateStr, sel,
8568			inst = $.datepicker._getInst(event.target),
8569			handled = true,
8570			isRTL = inst.dpDiv.is(".ui-datepicker-rtl");
8571
8572		inst._keyEvent = true;
8573		if ($.datepicker._datepickerShowing) {
8574			switch (event.keyCode) {
8575				case 9: $.datepicker._hideDatepicker();
8576						handled = false;
vendor: 4,495 bytes, lines 8577-8700
8577						break; // hide on tab out
8578				case 13: sel = $("td." + $.datepicker._dayOverClass + ":not(." +
8579									$.datepicker._currentClass + ")", inst.dpDiv);
8580						if (sel[0]) {
8581							$.datepicker._selectDay(event.target, inst.selectedMonth, inst.selectedYear, sel[0]);
8582						}
8583
8584						onSelect = $.datepicker._get(inst, "onSelect");
8585						if (onSelect) {
8586							dateStr = $.datepicker._formatDate(inst);
8587
8588							// trigger custom callback
8589							onSelect.apply((inst.input ? inst.input[0] : null), [dateStr, inst]);
8590						} else {
8591							$.datepicker._hideDatepicker();
8592						}
8593
8594						return false; // don't submit the form
8595				case 27: $.datepicker._hideDatepicker();
8596						break; // hide on escape
8597				case 33: $.datepicker._adjustDate(event.target, (event.ctrlKey ?
8598							-$.datepicker._get(inst, "stepBigMonths") :
8599							-$.datepicker._get(inst, "stepMonths")), "M");
8600						break; // previous month/year on page up/+ ctrl
8601				case 34: $.datepicker._adjustDate(event.target, (event.ctrlKey ?
8602							+$.datepicker._get(inst, "stepBigMonths") :
8603							+$.datepicker._get(inst, "stepMonths")), "M");
8604						break; // next month/year on page down/+ ctrl
8605				case 35: if (event.ctrlKey || event.metaKey) {
8606							$.datepicker._clearDate(event.target);
8607						}
8608						handled = event.ctrlKey || event.metaKey;
8609						break; // clear on ctrl or command +end
8610				case 36: if (event.ctrlKey || event.metaKey) {
8611							$.datepicker._gotoToday(event.target);
8612						}
8613						handled = event.ctrlKey || event.metaKey;
8614						break; // current on ctrl or command +home
8615				case 37: if (event.ctrlKey || event.metaKey) {
8616							$.datepicker._adjustDate(event.target, (isRTL ? +1 : -1), "D");
8617						}
8618						handled = event.ctrlKey || event.metaKey;
8619						// -1 day on ctrl or command +left
8620						if (event.originalEvent.altKey) {
8621							$.datepicker._adjustDate(event.target, (event.ctrlKey ?
8622								-$.datepicker._get(inst, "stepBigMonths") :
8623								-$.datepicker._get(inst, "stepMonths")), "M");
8624						}
8625						// next month/year on alt +left on Mac
8626						break;
8627				case 38: if (event.ctrlKey || event.metaKey) {
8628							$.datepicker._adjustDate(event.target, -7, "D");
8629						}
8630						handled = event.ctrlKey || event.metaKey;
8631						break; // -1 week on ctrl or command +up
8632				case 39: if (event.ctrlKey || event.metaKey) {
8633							$.datepicker._adjustDate(event.target, (isRTL ? -1 : +1), "D");
8634						}
8635						handled = event.ctrlKey || event.metaKey;
8636						// +1 day on ctrl or command +right
8637						if (event.originalEvent.altKey) {
8638							$.datepicker._adjustDate(event.target, (event.ctrlKey ?
8639								+$.datepicker._get(inst, "stepBigMonths") :
8640								+$.datepicker._get(inst, "stepMonths")), "M");
8641						}
8642						// next month/year on alt +right
8643						break;
8644				case 40: if (event.ctrlKey || event.metaKey) {
8645							$.datepicker._adjustDate(event.target, +7, "D");
8646						}
8647						handled = event.ctrlKey || event.metaKey;
8648						break; // +1 week on ctrl or command +down
8649				default: handled = false;
8650			}
8651		} else if (event.keyCode === 36 && event.ctrlKey) { // display the date picker on ctrl+home
8652			$.datepicker._showDatepicker(this);
8653		} else {
8654			handled = false;
8655		}
8656
8657		if (handled) {
8658			event.preventDefault();
8659			event.stopPropagation();
8660		}
8661	},
8662
8663	/* Filter entered characters - based on date format. */
8664	_doKeyPress: function(event) {
8665		var chars, chr,
8666			inst = $.datepicker._getInst(event.target);
8667
8668		if ($.datepicker._get(inst, "constrainInput")) {
8669			chars = $.datepicker._possibleChars($.datepicker._get(inst, "dateFormat"));
8670			chr = String.fromCharCode(event.charCode == null ? event.keyCode : event.charCode);
8671			return event.ctrlKey || event.metaKey || (chr < " " || !chars || chars.indexOf(chr) > -1);
8672		}
8673	},
8674
8675	/* Synchronise manual entry and field/alternate field. */
8676	_doKeyUp: function(event) {
8677		var date,
8678			inst = $.datepicker._getInst(event.target);
8679
8680		if (inst.input.val() !== inst.lastVal) {
8681			try {
8682				date = $.datepicker.parseDate($.datepicker._get(inst, "dateFormat"),
8683					(inst.input ? inst.input.val() : null),
8684					$.datepicker._getFormatConfig(inst));
8685
8686				if (date) { // only if valid
8687					$.datepicker._setDateFromField(inst);
8688					$.datepicker._updateAlternate(inst);
8689					$.datepicker._updateDatepicker(inst);
8690				}
8691			}
8692			catch (err) {
8693			}
8694		}
8695		return true;
8696	},
8697
8698	/* Pop-up the date picker for a given input field.
8699	 * If false returned from beforeShow event handler do not show.
8700	 * @param  input  element - the input field attached to the date picker or
vendor: 9,398 bytes, lines 8701-8975
8701	 *					event - if triggered by focus
8702	 */
8703	_showDatepicker: function(input) {
8704		input = input.target || input;
8705		if (input.nodeName.toLowerCase() !== "input") { // find from button/image trigger
8706			input = $("input", input.parentNode)[0];
8707		}
8708
8709		if ($.datepicker._isDisabledDatepicker(input) || $.datepicker._lastInput === input) { // already here
8710			return;
8711		}
8712
8713		var inst, beforeShow, beforeShowSettings, isFixed,
8714			offset, showAnim, duration;
8715
8716		inst = $.datepicker._getInst(input);
8717		if ($.datepicker._curInst && $.datepicker._curInst !== inst) {
8718			$.datepicker._curInst.dpDiv.stop(true, true);
8719			if ( inst && $.datepicker._datepickerShowing ) {
8720				$.datepicker._hideDatepicker( $.datepicker._curInst.input[0] );
8721			}
8722		}
8723
8724		beforeShow = $.datepicker._get(inst, "beforeShow");
8725		beforeShowSettings = beforeShow ? beforeShow.apply(input, [input, inst]) : {};
8726		if(beforeShowSettings === false){
8727			return;
8728		}
8729		datepicker_extendRemove(inst.settings, beforeShowSettings);
8730
8731		inst.lastVal = null;
8732		$.datepicker._lastInput = input;
8733		$.datepicker._setDateFromField(inst);
8734
8735		if ($.datepicker._inDialog) { // hide cursor
8736			input.value = "";
8737		}
8738		if (!$.datepicker._pos) { // position below input
8739			$.datepicker._pos = $.datepicker._findPos(input);
8740			$.datepicker._pos[1] += input.offsetHeight; // add the height
8741		}
8742
8743		isFixed = false;
8744		$(input).parents().each(function() {
8745			isFixed |= $(this).css("position") === "fixed";
8746			return !isFixed;
8747		});
8748
8749		offset = {left: $.datepicker._pos[0], top: $.datepicker._pos[1]};
8750		$.datepicker._pos = null;
8751		//to avoid flashes on Firefox
8752		inst.dpDiv.empty();
8753		// determine sizing offscreen
8754		inst.dpDiv.css({position: "absolute", display: "block", top: "-1000px"});
8755		$.datepicker._updateDatepicker(inst);
8756		// fix width for dynamic number of date pickers
8757		// and adjust position before showing
8758		offset = $.datepicker._checkOffset(inst, offset, isFixed);
8759		inst.dpDiv.css({position: ($.datepicker._inDialog && $.blockUI ?
8760			"static" : (isFixed ? "fixed" : "absolute")), display: "none",
8761			left: offset.left + "px", top: offset.top + "px"});
8762
8763		if (!inst.inline) {
8764			showAnim = $.datepicker._get(inst, "showAnim");
8765			duration = $.datepicker._get(inst, "duration");
8766			inst.dpDiv.css( "z-index", datepicker_getZindex( $( input ) ) + 1 );
8767			$.datepicker._datepickerShowing = true;
8768
8769			if ( $.effects && $.effects.effect[ showAnim ] ) {
8770				inst.dpDiv.show(showAnim, $.datepicker._get(inst, "showOptions"), duration);
8771			} else {
8772				inst.dpDiv[showAnim || "show"](showAnim ? duration : null);
8773			}
8774
8775			if ( $.datepicker._shouldFocusInput( inst ) ) {
8776				inst.input.focus();
8777			}
8778
8779			$.datepicker._curInst = inst;
8780		}
8781	},
8782
8783	/* Generate the date picker content. */
8784	_updateDatepicker: function(inst) {
8785		this.maxRows = 4; //Reset the max number of rows being displayed (see #7043)
8786		datepicker_instActive = inst; // for delegate hover events
8787		inst.dpDiv.empty().append(this._generateHTML(inst));
8788		this._attachHandlers(inst);
8789
8790		var origyearshtml,
8791			numMonths = this._getNumberOfMonths(inst),
8792			cols = numMonths[1],
8793			width = 17,
8794			activeCell = inst.dpDiv.find( "." + this._dayOverClass + " a" );
8795
8796		if ( activeCell.length > 0 ) {
8797			datepicker_handleMouseover.apply( activeCell.get( 0 ) );
8798		}
8799
8800		inst.dpDiv.removeClass("ui-datepicker-multi-2 ui-datepicker-multi-3 ui-datepicker-multi-4").width("");
8801		if (cols > 1) {
8802			inst.dpDiv.addClass("ui-datepicker-multi-" + cols).css("width", (width * cols) + "em");
8803		}
8804		inst.dpDiv[(numMonths[0] !== 1 || numMonths[1] !== 1 ? "add" : "remove") +
8805			"Class"]("ui-datepicker-multi");
8806		inst.dpDiv[(this._get(inst, "isRTL") ? "add" : "remove") +
8807			"Class"]("ui-datepicker-rtl");
8808
8809		if (inst === $.datepicker._curInst && $.datepicker._datepickerShowing && $.datepicker._shouldFocusInput( inst ) ) {
8810			inst.input.focus();
8811		}
8812
8813		// deffered render of the years select (to avoid flashes on Firefox)
8814		if( inst.yearshtml ){
8815			origyearshtml = inst.yearshtml;
8816			setTimeout(function(){
8817				//assure that inst.yearshtml didn't change.
8818				if( origyearshtml === inst.yearshtml && inst.yearshtml ){
8819					inst.dpDiv.find("select.ui-datepicker-year:first").replaceWith(inst.yearshtml);
8820				}
8821				origyearshtml = inst.yearshtml = null;
8822			}, 0);
8823		}
8824	},
8825
8826	// #6694 - don't focus the input if it's already focused
8827	// this breaks the change event in IE
8828	// Support: IE and jQuery <1.9
8829	_shouldFocusInput: function( inst ) {
8830		return inst.input && inst.input.is( ":visible" ) && !inst.input.is( ":disabled" ) && !inst.input.is( ":focus" );
8831	},
8832
8833	/* Check positioning to remain on screen. */
8834	_checkOffset: function(inst, offset, isFixed) {
8835		var dpWidth = inst.dpDiv.outerWidth(),
8836			dpHeight = inst.dpDiv.outerHeight(),
8837			inputWidth = inst.input ? inst.input.outerWidth() : 0,
8838			inputHeight = inst.input ? inst.input.outerHeight() : 0,
8839			viewWidth = document.documentElement.clientWidth + (isFixed ? 0 : $(document).scrollLeft()),
8840			viewHeight = document.documentElement.clientHeight + (isFixed ? 0 : $(document).scrollTop());
8841
8842		offset.left -= (this._get(inst, "isRTL") ? (dpWidth - inputWidth) : 0);
8843		offset.left -= (isFixed && offset.left === inst.input.offset().left) ? $(document).scrollLeft() : 0;
8844		offset.top -= (isFixed && offset.top === (inst.input.offset().top + inputHeight)) ? $(document).scrollTop() : 0;
8845
8846		// now check if datepicker is showing outside window viewport - move to a better place if so.
8847		offset.left -= Math.min(offset.left, (offset.left + dpWidth > viewWidth && viewWidth > dpWidth) ?
8848			Math.abs(offset.left + dpWidth - viewWidth) : 0);
8849		offset.top -= Math.min(offset.top, (offset.top + dpHeight > viewHeight && viewHeight > dpHeight) ?
8850			Math.abs(dpHeight + inputHeight) : 0);
8851
8852		return offset;
8853	},
8854
8855	/* Find an object's position on the screen. */
8856	_findPos: function(obj) {
8857		var position,
8858			inst = this._getInst(obj),
8859			isRTL = this._get(inst, "isRTL");
8860
8861		while (obj && (obj.type === "hidden" || obj.nodeType !== 1 || $.expr.filters.hidden(obj))) {
8862			obj = obj[isRTL ? "previousSibling" : "nextSibling"];
8863		}
8864
8865		position = $(obj).offset();
8866		return [position.left, position.top];
8867	},
8868
8869	/* Hide the date picker from view.
8870	 * @param  input  element - the input field attached to the date picker
8871	 */
8872	_hideDatepicker: function(input) {
8873		var showAnim, duration, postProcess, onClose,
8874			inst = this._curInst;
8875
8876		if (!inst || (input && inst !== $.data(input, "datepicker"))) {
8877			return;
8878		}
8879
8880		if (this._datepickerShowing) {
8881			showAnim = this._get(inst, "showAnim");
8882			duration = this._get(inst, "duration");
8883			postProcess = function() {
8884				$.datepicker._tidyDialog(inst);
8885			};
8886
8887			// DEPRECATED: after BC for 1.8.x $.effects[ showAnim ] is not needed
8888			if ( $.effects && ( $.effects.effect[ showAnim ] || $.effects[ showAnim ] ) ) {
8889				inst.dpDiv.hide(showAnim, $.datepicker._get(inst, "showOptions"), duration, postProcess);
8890			} else {
8891				inst.dpDiv[(showAnim === "slideDown" ? "slideUp" :
8892					(showAnim === "fadeIn" ? "fadeOut" : "hide"))]((showAnim ? duration : null), postProcess);
8893			}
8894
8895			if (!showAnim) {
8896				postProcess();
8897			}
8898			this._datepickerShowing = false;
8899
8900			onClose = this._get(inst, "onClose");
8901			if (onClose) {
8902				onClose.apply((inst.input ? inst.input[0] : null), [(inst.input ? inst.input.val() : ""), inst]);
8903			}
8904
8905			this._lastInput = null;
8906			if (this._inDialog) {
8907				this._dialogInput.css({ position: "absolute", left: "0", top: "-100px" });
8908				if ($.blockUI) {
8909					$.unblockUI();
8910					$("body").append(this.dpDiv);
8911				}
8912			}
8913			this._inDialog = false;
8914		}
8915	},
8916
8917	/* Tidy up after a dialog display. */
8918	_tidyDialog: function(inst) {
8919		inst.dpDiv.removeClass(this._dialogClass).unbind(".ui-datepicker-calendar");
8920	},
8921
8922	/* Close date picker if clicked elsewhere. */
8923	_checkExternalClick: function(event) {
8924		if (!$.datepicker._curInst) {
8925			return;
8926		}
8927
8928		var $target = $(event.target),
8929			inst = $.datepicker._getInst($target[0]);
8930
8931		if ( ( ( $target[0].id !== $.datepicker._mainDivId &&
8932				$target.parents("#" + $.datepicker._mainDivId).length === 0 &&
8933				!$target.hasClass($.datepicker.markerClassName) &&
8934				!$target.closest("." + $.datepicker._triggerClass).length &&
8935				$.datepicker._datepickerShowing && !($.datepicker._inDialog && $.blockUI) ) ) ||
8936			( $target.hasClass($.datepicker.markerClassName) && $.datepicker._curInst !== inst ) ) {
8937				$.datepicker._hideDatepicker();
8938		}
8939	},
8940
8941	/* Adjust one of the date sub-fields. */
8942	_adjustDate: function(id, offset, period) {
8943		var target = $(id),
8944			inst = this._getInst(target[0]);
8945
8946		if (this._isDisabledDatepicker(target[0])) {
8947			return;
8948		}
8949		this._adjustInstDate(inst, offset +
8950			(period === "M" ? this._get(inst, "showCurrentAtPos") : 0), // undo positioning
8951			period);
8952		this._updateDatepicker(inst);
8953	},
8954
8955	/* Action for current link. */
8956	_gotoToday: function(id) {
8957		var date,
8958			target = $(id),
8959			inst = this._getInst(target[0]);
8960
8961		if (this._get(inst, "gotoCurrent") && inst.currentDay) {
8962			inst.selectedDay = inst.currentDay;
8963			inst.drawMonth = inst.selectedMonth = inst.currentMonth;
8964			inst.drawYear = inst.selectedYear = inst.currentYear;
8965		} else {
8966			date = new Date();
8967			inst.selectedDay = date.getDate();
8968			inst.drawMonth = inst.selectedMonth = date.getMonth();
8969			inst.drawYear = inst.selectedYear = date.getFullYear();
8970		}
8971		this._notifyChange(inst);
8972		this._adjustDate(target);
8973	},
8974
8975	/* Action for selecting a new month/year. */
vendor: 4,436 bytes, lines 8976-9107
8976	_selectMonthYear: function(id, select, period) {
8977		var target = $(id),
8978			inst = this._getInst(target[0]);
8979
8980		inst["selected" + (period === "M" ? "Month" : "Year")] =
8981		inst["draw" + (period === "M" ? "Month" : "Year")] =
8982			parseInt(select.options[select.selectedIndex].value,10);
8983
8984		this._notifyChange(inst);
8985		this._adjustDate(target);
8986	},
8987
8988	/* Action for selecting a day. */
8989	_selectDay: function(id, month, year, td) {
8990		var inst,
8991			target = $(id);
8992
8993		if ($(td).hasClass(this._unselectableClass) || this._isDisabledDatepicker(target[0])) {
8994			return;
8995		}
8996
8997		inst = this._getInst(target[0]);
8998		inst.selectedDay = inst.currentDay = $("a", td).html();
8999		inst.selectedMonth = inst.currentMonth = month;
9000		inst.selectedYear = inst.currentYear = year;
9001		this._selectDate(id, this._formatDate(inst,
9002			inst.currentDay, inst.currentMonth, inst.currentYear));
9003	},
9004
9005	/* Erase the input field and hide the date picker. */
9006	_clearDate: function(id) {
9007		var target = $(id);
9008		this._selectDate(target, "");
9009	},
9010
9011	/* Update the input field with the selected date. */
9012	_selectDate: function(id, dateStr) {
9013		var onSelect,
9014			target = $(id),
9015			inst = this._getInst(target[0]);
9016
9017		dateStr = (dateStr != null ? dateStr : this._formatDate(inst));
9018		if (inst.input) {
9019			inst.input.val(dateStr);
9020		}
9021		this._updateAlternate(inst);
9022
9023		onSelect = this._get(inst, "onSelect");
9024		if (onSelect) {
9025			onSelect.apply((inst.input ? inst.input[0] : null), [dateStr, inst]);  // trigger custom callback
9026		} else if (inst.input) {
9027			inst.input.trigger("change"); // fire the change event
9028		}
9029
9030		if (inst.inline){
9031			this._updateDatepicker(inst);
9032		} else {
9033			this._hideDatepicker();
9034			this._lastInput = inst.input[0];
9035			if (typeof(inst.input[0]) !== "object") {
9036				inst.input.focus(); // restore focus
9037			}
9038			this._lastInput = null;
9039		}
9040	},
9041
9042	/* Update any alternate field to synchronise with the main field. */
9043	_updateAlternate: function(inst) {
9044		var altFormat, date, dateStr,
9045			altField = this._get(inst, "altField");
9046
9047		if (altField) { // update alternate field too
9048			altFormat = this._get(inst, "altFormat") || this._get(inst, "dateFormat");
9049			date = this._getDate(inst);
9050			dateStr = this.formatDate(altFormat, date, this._getFormatConfig(inst));
9051			$(altField).each(function() { $(this).val(dateStr); });
9052		}
9053	},
9054
9055	/* Set as beforeShowDay function to prevent selection of weekends.
9056	 * @param  date  Date - the date to customise
9057	 * @return [boolean, string] - is this date selectable?, what is its CSS class?
9058	 */
9059	noWeekends: function(date) {
9060		var day = date.getDay();
9061		return [(day > 0 && day < 6), ""];
9062	},
9063
9064	/* Set as calculateWeek to determine the week of the year based on the ISO 8601 definition.
9065	 * @param  date  Date - the date to get the week for
9066	 * @return  number - the number of the week within the year that contains this date
9067	 */
9068	iso8601Week: function(date) {
9069		var time,
9070			checkDate = new Date(date.getTime());
9071
9072		// Find Thursday of this week starting on Monday
9073		checkDate.setDate(checkDate.getDate() + 4 - (checkDate.getDay() || 7));
9074
9075		time = checkDate.getTime();
9076		checkDate.setMonth(0); // Compare with Jan 1
9077		checkDate.setDate(1);
9078		return Math.floor(Math.round((time - checkDate) / 86400000) / 7) + 1;
9079	},
9080
9081	/* Parse a string value into a date object.
9082	 * See formatDate below for the possible formats.
9083	 *
9084	 * @param  format string - the expected format of the date
9085	 * @param  value string - the date in the above format
9086	 * @param  settings Object - attributes include:
9087	 *					shortYearCutoff  number - the cutoff year for determining the century (optional)
9088	 *					dayNamesShort	string[7] - abbreviated names of the days from Sunday (optional)
9089	 *					dayNames		string[7] - names of the days from Sunday (optional)
9090	 *					monthNamesShort string[12] - abbreviated names of the months (optional)
9091	 *					monthNames		string[12] - names of the months (optional)
9092	 * @return  Date - the extracted date value or null if value is blank
9093	 */
9094	parseDate: function (format, value, settings) {
9095		if (format == null || value == null) {
9096			throw "Invalid arguments";
9097		}
9098
9099		value = (typeof value === "object" ? value.toString() : value + "");
9100		if (value === "") {
9101			return null;
9102		}
9103
9104		var iFormat, dim, extra,
9105			iValue = 0,
9106			shortYearCutoffTemp = (settings ? settings.shortYearCutoff : null) || this._defaults.shortYearCutoff,
9107			shortYearCutoff = (typeof shortYearCutoffTemp !== "string" ? shortYearCutoffTemp 
vendor: 5,261 bytes, lines 9107-9293
9107:
9108				new Date().getFullYear() % 100 + parseInt(shortYearCutoffTemp, 10)),
9109			dayNamesShort = (settings ? settings.dayNamesShort : null) || this._defaults.dayNamesShort,
9110			dayNames = (settings ? settings.dayNames : null) || this._defaults.dayNames,
9111			monthNamesShort = (settings ? settings.monthNamesShort : null) || this._defaults.monthNamesShort,
9112			monthNames = (settings ? settings.monthNames : null) || this._defaults.monthNames,
9113			year = -1,
9114			month = -1,
9115			day = -1,
9116			doy = -1,
9117			literal = false,
9118			date,
9119			// Check whether a format character is doubled
9120			lookAhead = function(match) {
9121				var matches = (iFormat + 1 < format.length && format.charAt(iFormat + 1) === match);
9122				if (matches) {
9123					iFormat++;
9124				}
9125				return matches;
9126			},
9127			// Extract a number from the string value
9128			getNumber = function(match) {
9129				var isDoubled = lookAhead(match),
9130					size = (match === "@" ? 14 : (match === "!" ? 20 :
9131					(match === "y" && isDoubled ? 4 : (match === "o" ? 3 : 2)))),
9132					minSize = (match === "y" ? size : 1),
9133					digits = new RegExp("^\\d{" + minSize + "," + size + "}"),
9134					num = value.substring(iValue).match(digits);
9135				if (!num) {
9136					throw "Missing number at position " + iValue;
9137				}
9138				iValue += num[0].length;
9139				return parseInt(num[0], 10);
9140			},
9141			// Extract a name from the string value and convert to an index
9142			getName = function(match, shortNames, longNames) {
9143				var index = -1,
9144					names = $.map(lookAhead(match) ? longNames : shortNames, function (v, k) {
9145						return [ [k, v] ];
9146					}).sort(function (a, b) {
9147						return -(a[1].length - b[1].length);
9148					});
9149
9150				$.each(names, function (i, pair) {
9151					var name = pair[1];
9152					if (value.substr(iValue, name.length).toLowerCase() === name.toLowerCase()) {
9153						index = pair[0];
9154						iValue += name.length;
9155						return false;
9156					}
9157				});
9158				if (index !== -1) {
9159					return index + 1;
9160				} else {
9161					throw "Unknown name at position " + iValue;
9162				}
9163			},
9164			// Confirm that a literal character matches the string value
9165			checkLiteral = function() {
9166				if (value.charAt(iValue) !== format.charAt(iFormat)) {
9167					throw "Unexpected literal at position " + iValue;
9168				}
9169				iValue++;
9170			};
9171
9172		for (iFormat = 0; iFormat < format.length; iFormat++) {
9173			if (literal) {
9174				if (format.charAt(iFormat) === "'" && !lookAhead("'")) {
9175					literal = false;
9176				} else {
9177					checkLiteral();
9178				}
9179			} else {
9180				switch (format.charAt(iFormat)) {
9181					case "d":
9182						day = getNumber("d");
9183						break;
9184					case "D":
9185						getName("D", dayNamesShort, dayNames);
9186						break;
9187					case "o":
9188						doy = getNumber("o");
9189						break;
9190					case "m":
9191						month = getNumber("m");
9192						break;
9193					case "M":
9194						month = getName("M", monthNamesShort, monthNames);
9195						break;
9196					case "y":
9197						year = getNumber("y");
9198						break;
9199					case "@":
9200						date = new Date(getNumber("@"));
9201						year = date.getFullYear();
9202						month = date.getMonth() + 1;
9203						day = date.getDate();
9204						break;
9205					case "!":
9206						date = new Date((getNumber("!") - this._ticksTo1970) / 10000);
9207						year = date.getFullYear();
9208						month = date.getMonth() + 1;
9209						day = date.getDate();
9210						break;
9211					case "'":
9212						if (lookAhead("'")){
9213							checkLiteral();
9214						} else {
9215							literal = true;
9216						}
9217						break;
9218					default:
9219						checkLiteral();
9220				}
9221			}
9222		}
9223
9224		if (iValue < value.length){
9225			extra = value.substr(iValue);
9226			if (!/^\s+/.test(extra)) {
9227				throw "Extra/unparsed characters found in date: " + extra;
9228			}
9229		}
9230
9231		if (year === -1) {
9232			year = new Date().getFullYear();
9233		} else if (year < 100) {
9234			year += new Date().getFullYear() - new Date().getFullYear() % 100 +
9235				(year <= shortYearCutoff ? 0 : -100);
9236		}
9237
9238		if (doy > -1) {
9239			month = 1;
9240			day = doy;
9241			do {
9242				dim = this._getDaysInMonth(year, month - 1);
9243				if (day <= dim) {
9244					break;
9245				}
9246				month++;
9247				day -= dim;
9248			} while (true);
9249		}
9250
9251		date = this._daylightSavingAdjust(new Date(year, month - 1, day));
9252		if (date.getFullYear() !== year || date.getMonth() + 1 !== month || date.getDate() !== day) {
9253			throw "Invalid date"; // E.g. 31/02/00
9254		}
9255		return date;
9256	},
9257
9258	/* Standard date formats. */
9259	ATOM: "yy-mm-dd", // RFC 3339 (ISO 8601)
9260	COOKIE: "D, dd M yy",
9261	ISO_8601: "yy-mm-dd",
9262	RFC_822: "D, d M y",
9263	RFC_850: "DD, dd-M-y",
9264	RFC_1036: "D, d M y",
9265	RFC_1123: "D, d M yy",
9266	RFC_2822: "D, d M yy",
9267	RSS: "D, d M y", // RFC 822
9268	TICKS: "!",
9269	TIMESTAMP: "@",
9270	W3C: "yy-mm-dd", // ISO 8601
9271
9272	_ticksTo1970: (((1970 - 1) * 365 + Math.floor(1970 / 4) - Math.floor(1970 / 100) +
9273		Math.floor(1970 / 400)) * 24 * 60 * 60 * 10000000),
9274
9275	/* Format a date object into a string value.
9276	 * The format can be combinations of the following:
9277	 * d  - day of month (no leading zero)
9278	 * dd - day of month (two digit)
9279	 * o  - day of year (no leading zeros)
9280	 * oo - day of year (three digit)
9281	 * D  - day name short
9282	 * DD - day name long
9283	 * m  - month of year (no leading zero)
9284	 * mm - month of year (two digit)
9285	 * M  - month name short
9286	 * MM - month name long
9287	 * y  - year (two digit)
9288	 * yy - year (four digit)
9289	 * @ - Unix timestamp (ms since 01/01/1970)
9290	 * ! - Windows ticks (100ns since 01/01/0001)
9291	 * "..." - literal text
9292	 * '' - single quote
9293	 *
vendor: 11,157 bytes, lines 9294-9627
9294	 * @param  format string - the desired format of the date
9295	 * @param  date Date - the date value to format
9296	 * @param  settings Object - attributes include:
9297	 *					dayNamesShort	string[7] - abbreviated names of the days from Sunday (optional)
9298	 *					dayNames		string[7] - names of the days from Sunday (optional)
9299	 *					monthNamesShort string[12] - abbreviated names of the months (optional)
9300	 *					monthNames		string[12] - names of the months (optional)
9301	 * @return  string - the date in the above format
9302	 */
9303	formatDate: function (format, date, settings) {
9304		if (!date) {
9305			return "";
9306		}
9307
9308		var iFormat,
9309			dayNamesShort = (settings ? settings.dayNamesShort : null) || this._defaults.dayNamesShort,
9310			dayNames = (settings ? settings.dayNames : null) || this._defaults.dayNames,
9311			monthNamesShort = (settings ? settings.monthNamesShort : null) || this._defaults.monthNamesShort,
9312			monthNames = (settings ? settings.monthNames : null) || this._defaults.monthNames,
9313			// Check whether a format character is doubled
9314			lookAhead = function(match) {
9315				var matches = (iFormat + 1 < format.length && format.charAt(iFormat + 1) === match);
9316				if (matches) {
9317					iFormat++;
9318				}
9319				return matches;
9320			},
9321			// Format a number, with leading zero if necessary
9322			formatNumber = function(match, value, len) {
9323				var num = "" + value;
9324				if (lookAhead(match)) {
9325					while (num.length < len) {
9326						num = "0" + num;
9327					}
9328				}
9329				return num;
9330			},
9331			// Format a name, short or long as requested
9332			formatName = function(match, value, shortNames, longNames) {
9333				return (lookAhead(match) ? longNames[value] : shortNames[value]);
9334			},
9335			output = "",
9336			literal = false;
9337
9338		if (date) {
9339			for (iFormat = 0; iFormat < format.length; iFormat++) {
9340				if (literal) {
9341					if (format.charAt(iFormat) === "'" && !lookAhead("'")) {
9342						literal = false;
9343					} else {
9344						output += format.charAt(iFormat);
9345					}
9346				} else {
9347					switch (format.charAt(iFormat)) {
9348						case "d":
9349							output += formatNumber("d", date.getDate(), 2);
9350							break;
9351						case "D":
9352							output += formatName("D", date.getDay(), dayNamesShort, dayNames);
9353							break;
9354						case "o":
9355							output += formatNumber("o",
9356								Math.round((new Date(date.getFullYear(), date.getMonth(), date.getDate()).getTime() - new Date(date.getFullYear(), 0, 0).getTime()) / 86400000), 3);
9357							break;
9358						case "m":
9359							output += formatNumber("m", date.getMonth() + 1, 2);
9360							break;
9361						case "M":
9362							output += formatName("M", date.getMonth(), monthNamesShort, monthNames);
9363							break;
9364						case "y":
9365							output += (lookAhead("y") ? date.getFullYear() :
9366								(date.getYear() % 100 < 10 ? "0" : "") + date.getYear() % 100);
9367							break;
9368						case "@":
9369							output += date.getTime();
9370							break;
9371						case "!":
9372							output += date.getTime() * 10000 + this._ticksTo1970;
9373							break;
9374						case "'":
9375							if (lookAhead("'")) {
9376								output += "'";
9377							} else {
9378								literal = true;
9379							}
9380							break;
9381						default:
9382							output += format.charAt(iFormat);
9383					}
9384				}
9385			}
9386		}
9387		return output;
9388	},
9389
9390	/* Extract all possible characters from the date format. */
9391	_possibleChars: function (format) {
9392		var iFormat,
9393			chars = "",
9394			literal = false,
9395			// Check whether a format character is doubled
9396			lookAhead = function(match) {
9397				var matches = (iFormat + 1 < format.length && format.charAt(iFormat + 1) === match);
9398				if (matches) {
9399					iFormat++;
9400				}
9401				return matches;
9402			};
9403
9404		for (iFormat = 0; iFormat < format.length; iFormat++) {
9405			if (literal) {
9406				if (format.charAt(iFormat) === "'" && !lookAhead("'")) {
9407					literal = false;
9408				} else {
9409					chars += format.charAt(iFormat);
9410				}
9411			} else {
9412				switch (format.charAt(iFormat)) {
9413					case "d": case "m": case "y": case "@":
9414						chars += "0123456789";
9415						break;
9416					case "D": case "M":
9417						return null; // Accept anything
9418					case "'":
9419						if (lookAhead("'")) {
9420							chars += "'";
9421						} else {
9422							literal = true;
9423						}
9424						break;
9425					default:
9426						chars += format.charAt(iFormat);
9427				}
9428			}
9429		}
9430		return chars;
9431	},
9432
9433	/* Get a setting value, defaulting if necessary. */
9434	_get: function(inst, name) {
9435		return inst.settings[name] !== undefined ?
9436			inst.settings[name] : this._defaults[name];
9437	},
9438
9439	/* Parse existing date and initialise date picker. */
9440	_setDateFromField: function(inst, noDefault) {
9441		if (inst.input.val() === inst.lastVal) {
9442			return;
9443		}
9444
9445		var dateFormat = this._get(inst, "dateFormat"),
9446			dates = inst.lastVal = inst.input ? inst.input.val() : null,
9447			defaultDate = this._getDefaultDate(inst),
9448			date = defaultDate,
9449			settings = this._getFormatConfig(inst);
9450
9451		try {
9452			date = this.parseDate(dateFormat, dates, settings) || defaultDate;
9453		} catch (event) {
9454			dates = (noDefault ? "" : dates);
9455		}
9456		inst.selectedDay = date.getDate();
9457		inst.drawMonth = inst.selectedMonth = date.getMonth();
9458		inst.drawYear = inst.selectedYear = date.getFullYear();
9459		inst.currentDay = (dates ? date.getDate() : 0);
9460		inst.currentMonth = (dates ? date.getMonth() : 0);
9461		inst.currentYear = (dates ? date.getFullYear() : 0);
9462		this._adjustInstDate(inst);
9463	},
9464
9465	/* Retrieve the default date shown on opening. */
9466	_getDefaultDate: function(inst) {
9467		return this._restrictMinMax(inst,
9468			this._determineDate(inst, this._get(inst, "defaultDate"), new Date()));
9469	},
9470
9471	/* A date may be specified as an exact value or a relative one. */
9472	_determineDate: function(inst, date, defaultDate) {
9473		var offsetNumeric = function(offset) {
9474				var date = new Date();
9475				date.setDate(date.getDate() + offset);
9476				return date;
9477			},
9478			offsetString = function(offset) {
9479				try {
9480					return $.datepicker.parseDate($.datepicker._get(inst, "dateFormat"),
9481						offset, $.datepicker._getFormatConfig(inst));
9482				}
9483				catch (e) {
9484					// Ignore
9485				}
9486
9487				var date = (offset.toLowerCase().match(/^c/) ?
9488					$.datepicker._getDate(inst) : null) || new Date(),
9489					year = date.getFullYear(),
9490					month = date.getMonth(),
9491					day = date.getDate(),
9492					pattern = /([+\-]?[0-9]+)\s*(d|D|w|W|m|M|y|Y)?/g,
9493					matches = pattern.exec(offset);
9494
9495				while (matches) {
9496					switch (matches[2] || "d") {
9497						case "d" : case "D" :
9498							day += parseInt(matches[1],10); break;
9499						case "w" : case "W" :
9500							day += parseInt(matches[1],10) * 7; break;
9501						case "m" : case "M" :
9502							month += parseInt(matches[1],10);
9503							day = Math.min(day, $.datepicker._getDaysInMonth(year, month));
9504							break;
9505						case "y": case "Y" :
9506							year += parseInt(matches[1],10);
9507							day = Math.min(day, $.datepicker._getDaysInMonth(year, month));
9508							break;
9509					}
9510					matches = pattern.exec(offset);
9511				}
9512				return new Date(year, month, day);
9513			},
9514			newDate = (date == null || date === "" ? defaultDate : (typeof date === "string" ? offsetString(date) :
9515				(typeof date === "number" ? (isNaN(date) ? defaultDate : offsetNumeric(date)) : new Date(date.getTime()))));
9516
9517		newDate = (newDate && newDate.toString() === "Invalid Date" ? defaultDate : newDate);
9518		if (newDate) {
9519			newDate.setHours(0);
9520			newDate.setMinutes(0);
9521			newDate.setSeconds(0);
9522			newDate.setMilliseconds(0);
9523		}
9524		return this._daylightSavingAdjust(newDate);
9525	},
9526
9527	/* Handle switch to/from daylight saving.
9528	 * Hours may be non-zero on daylight saving cut-over:
9529	 * > 12 when midnight changeover, but then cannot generate
9530	 * midnight datetime, so jump to 1AM, otherwise reset.
9531	 * @param  date  (Date) the date to check
9532	 * @return  (Date) the corrected date
9533	 */
9534	_daylightSavingAdjust: function(date) {
9535		if (!date) {
9536			return null;
9537		}
9538		date.setHours(date.getHours() > 12 ? date.getHours() + 2 : 0);
9539		return date;
9540	},
9541
9542	/* Set the date(s) directly. */
9543	_setDate: function(inst, date, noChange) {
9544		var clear = !date,
9545			origMonth = inst.selectedMonth,
9546			origYear = inst.selectedYear,
9547			newDate = this._restrictMinMax(inst, this._determineDate(inst, date, new Date()));
9548
9549		inst.selectedDay = inst.currentDay = newDate.getDate();
9550		inst.drawMonth = inst.selectedMonth = inst.currentMonth = newDate.getMonth();
9551		inst.drawYear = inst.selectedYear = inst.currentYear = newDate.getFullYear();
9552		if ((origMonth !== inst.selectedMonth || origYear !== inst.selectedYear) && !noChange) {
9553			this._notifyChange(inst);
9554		}
9555		this._adjustInstDate(inst);
9556		if (inst.input) {
9557			inst.input.val(clear ? "" : this._formatDate(inst));
9558		}
9559	},
9560
9561	/* Retrieve the date(s) directly. */
9562	_getDate: function(inst) {
9563		var startDate = (!inst.currentYear || (inst.input && inst.input.val() === "") ? null :
9564			this._daylightSavingAdjust(new Date(
9565			inst.currentYear, inst.currentMonth, inst.currentDay)));
9566			return startDate;
9567	},
9568
9569	/* Attach the onxxx handlers.  These are declared statically so
9570	 * they work with static code transformers like Caja.
9571	 */
9572	_attachHandlers: function(inst) {
9573		var stepMonths = this._get(inst, "stepMonths"),
9574			id = "#" + inst.id.replace( /\\\\/g, "\\" );
9575		inst.dpDiv.find("[data-handler]").map(function () {
9576			var handler = {
9577				prev: function () {
9578					$.datepicker._adjustDate(id, -stepMonths, "M");
9579				},
9580				next: function () {
9581					$.datepicker._adjustDate(id, +stepMonths, "M");
9582				},
9583				hide: function () {
9584					$.datepicker._hideDatepicker();
9585				},
9586				today: function () {
9587					$.datepicker._gotoToday(id);
9588				},
9589				selectDay: function () {
9590					$.datepicker._selectDay(id, +this.getAttribute("data-month"), +this.getAttribute("data-year"), this);
9591					return false;
9592				},
9593				selectMonth: function () {
9594					$.datepicker._selectMonthYear(id, this, "M");
9595					return false;
9596				},
9597				selectYear: function () {
9598					$.datepicker._selectMonthYear(id, this, "Y");
9599					return false;
9600				}
9601			};
9602			$(this).bind(this.getAttribute("data-event"), handler[this.getAttribute("data-handler")]);
9603		});
9604	},
9605
9606	/* Generate the HTML for the current state of the date picker. */
9607	_generateHTML: function(inst) {
9608		var maxDraw, prevText, prev, nextText, next, currentText, gotoDate,
9609			controls, buttonPanel, firstDay, showWeek, dayNames, dayNamesMin,
9610			monthNames, monthNamesShort, beforeShowDay, showOtherMonths,
9611			selectOtherMonths, defaultDate, html, dow, row, group, col, selectedDate,
9612			cornerClass, calender, thead, day, daysInMonth, leadDays, curRows, numRows,
9613			printDate, dRow, tbody, daySettings, otherMonth, unselectable,
9614			tempDate = new Date(),
9615			today = this._daylightSavingAdjust(
9616				new Date(tempDate.getFullYear(), tempDate.getMonth(), tempDate.getDate())), // clear time
9617			isRTL = this._get(inst, "isRTL"),
9618			showButtonPanel = this._get(inst, "showButtonPanel"),
9619			hideIfNoPrevNext = this._get(inst, "hideIfNoPrevNext"),
9620			navigationAsDateFormat = this._get(inst, "navigationAsDateFormat"),
9621			numMonths = this._getNumberOfMonths(inst),
9622			showCurrentAtPos = this._get(inst, "showCurrentAtPos"),
9623			stepMonths = this._get(inst, "stepMonths"),
9624			isMultiMonth = (numMonths[0] !== 1 || numMonths[1] !== 1),
9625			currentDate = this._daylightSavingAdjust((!inst.currentDay ? new Date(9999, 9, 9) :
9626				new Date(inst.currentYear, inst.currentMonth, inst.currentDay))),
9627			minDate = this._getMinMaxDate(inst, "min"),
vendor: 9,139 bytes, lines 9628-9786
9628			maxDate = this._getMinMaxDate(inst, "max"),
9629			drawMonth = inst.drawMonth - showCurrentAtPos,
9630			drawYear = inst.drawYear;
9631
9632		if (drawMonth < 0) {
9633			drawMonth += 12;
9634			drawYear--;
9635		}
9636		if (maxDate) {
9637			maxDraw = this._daylightSavingAdjust(new Date(maxDate.getFullYear(),
9638				maxDate.getMonth() - (numMonths[0] * numMonths[1]) + 1, maxDate.getDate()));
9639			maxDraw = (minDate && maxDraw < minDate ? minDate : maxDraw);
9640			while (this._daylightSavingAdjust(new Date(drawYear, drawMonth, 1)) > maxDraw) {
9641				drawMonth--;
9642				if (drawMonth < 0) {
9643					drawMonth = 11;
9644					drawYear--;
9645				}
9646			}
9647		}
9648		inst.drawMonth = drawMonth;
9649		inst.drawYear = drawYear;
9650
9651		prevText = this._get(inst, "prevText");
9652		prevText = (!navigationAsDateFormat ? prevText : this.formatDate(prevText,
9653			this._daylightSavingAdjust(new Date(drawYear, drawMonth - stepMonths, 1)),
9654			this._getFormatConfig(inst)));
9655
9656		prev = (this._canAdjustMonth(inst, -1, drawYear, drawMonth) ?
9657			"<a class='ui-datepicker-prev ui-corner-all' data-handler='prev' data-event='click'" +
9658			" title='" + prevText + "'><span class='ui-icon ui-icon-circle-triangle-" + ( isRTL ? "e" : "w") + "'>" + prevText + "</span></a>" :
9659			(hideIfNoPrevNext ? "" : "<a class='ui-datepicker-prev ui-corner-all ui-state-disabled' title='"+ prevText +"'><span class='ui-icon ui-icon-circle-triangle-" + ( isRTL ? "e" : "w") + "'>" + prevText + "</span></a>"));
9660
9661		nextText = this._get(inst, "nextText");
9662		nextText = (!navigationAsDateFormat ? nextText : this.formatDate(nextText,
9663			this._daylightSavingAdjust(new Date(drawYear, drawMonth + stepMonths, 1)),
9664			this._getFormatConfig(inst)));
9665
9666		next = (this._canAdjustMonth(inst, +1, drawYear, drawMonth) ?
9667			"<a class='ui-datepicker-next ui-corner-all' data-handler='next' data-event='click'" +
9668			" title='" + nextText + "'><span class='ui-icon ui-icon-circle-triangle-" + ( isRTL ? "w" : "e") + "'>" + nextText + "</span></a>" :
9669			(hideIfNoPrevNext ? "" : "<a class='ui-datepicker-next ui-corner-all ui-state-disabled' title='"+ nextText + "'><span class='ui-icon ui-icon-circle-triangle-" + ( isRTL ? "w" : "e") + "'>" + nextText + "</span></a>"));
9670
9671		currentText = this._get(inst, "currentText");
9672		gotoDate = (this._get(inst, "gotoCurrent") && inst.currentDay ? currentDate : today);
9673		currentText = (!navigationAsDateFormat ? currentText :
9674			this.formatDate(currentText, gotoDate, this._getFormatConfig(inst)));
9675
9676		controls = (!inst.inline ? "<button type='button' class='ui-datepicker-close ui-state-default ui-priority-primary ui-corner-all' data-handler='hide' data-event='click'>" +
9677			this._get(inst, "closeText") + "</button>" : "");
9678
9679		buttonPanel = (showButtonPanel) ? "<div class='ui-datepicker-buttonpane ui-widget-content'>" + (isRTL ? controls : "") +
9680			(this._isInRange(inst, gotoDate) ? "<button type='button' class='ui-datepicker-current ui-state-default ui-priority-secondary ui-corner-all' data-handler='today' data-event='click'" +
9681			">" + currentText + "</button>" : "") + (isRTL ? "" : controls) + "</div>" : "";
9682
9683		firstDay = parseInt(this._get(inst, "firstDay"),10);
9684		firstDay = (isNaN(firstDay) ? 0 : firstDay);
9685
9686		showWeek = this._get(inst, "showWeek");
9687		dayNames = this._get(inst, "dayNames");
9688		dayNamesMin = this._get(inst, "dayNamesMin");
9689		monthNames = this._get(inst, "monthNames");
9690		monthNamesShort = this._get(inst, "monthNamesShort");
9691		beforeShowDay = this._get(inst, "beforeShowDay");
9692		showOtherMonths = this._get(inst, "showOtherMonths");
9693		selectOtherMonths = this._get(inst, "selectOtherMonths");
9694		defaultDate = this._getDefaultDate(inst);
9695		html = "";
9696		dow;
9697		for (row = 0; row < numMonths[0]; row++) {
9698			group = "";
9699			this.maxRows = 4;
9700			for (col = 0; col < numMonths[1]; col++) {
9701				selectedDate = this._daylightSavingAdjust(new Date(drawYear, drawMonth, inst.selectedDay));
9702				cornerClass = " ui-corner-all";
9703				calender = "";
9704				if (isMultiMonth) {
9705					calender += "<div class='ui-datepicker-group";
9706					if (numMonths[1] > 1) {
9707						switch (col) {
9708							case 0: calender += " ui-datepicker-group-first";
9709								cornerClass = " ui-corner-" + (isRTL ? "right" : "left"); break;
9710							case numMonths[1]-1: calender += " ui-datepicker-group-last";
9711								cornerClass = " ui-corner-" + (isRTL ? "left" : "right"); break;
9712							default: calender += " ui-datepicker-group-middle"; cornerClass = ""; break;
9713						}
9714					}
9715					calender += "'>";
9716				}
9717				calender += "<div class='ui-datepicker-header ui-widget-header ui-helper-clearfix" + cornerClass + "'>" +
9718					(/all|left/.test(cornerClass) && row === 0 ? (isRTL ? next : prev) : "") +
9719					(/all|right/.test(cornerClass) && row === 0 ? (isRTL ? prev : next) : "") +
9720					this._generateMonthYearHeader(inst, drawMonth, drawYear, minDate, maxDate,
9721					row > 0 || col > 0, monthNames, monthNamesShort) + // draw month headers
9722					"</div><table class='ui-datepicker-calendar'><thead>" +
9723					"<tr>";
9724				thead = (showWeek ? "<th class='ui-datepicker-week-col'>" + this._get(inst, "weekHeader") + "</th>" : "");
9725				for (dow = 0; dow < 7; dow++) { // days of the week
9726					day = (dow + firstDay) % 7;
9727					thead += "<th scope='col'" + ((dow + firstDay + 6) % 7 >= 5 ? " class='ui-datepicker-week-end'" : "") + ">" +
9728						"<span title='" + dayNames[day] + "'>" + dayNamesMin[day] + "</span></th>";
9729				}
9730				calender += thead + "</tr></thead><tbody>";
9731				daysInMonth = this._getDaysInMonth(drawYear, drawMonth);
9732				if (drawYear === inst.selectedYear && drawMonth === inst.selectedMonth) {
9733					inst.selectedDay = Math.min(inst.selectedDay, daysInMonth);
9734				}
9735				leadDays = (this._getFirstDayOfMonth(drawYear, drawMonth) - firstDay + 7) % 7;
9736				curRows = Math.ceil((leadDays + daysInMonth) / 7); // calculate the number of rows to generate
9737				numRows = (isMultiMonth ? this.maxRows > curRows ? this.maxRows : curRows : curRows); //If multiple months, use the higher number of rows (see #7043)
9738				this.maxRows = numRows;
9739				printDate = this._daylightSavingAdjust(new Date(drawYear, drawMonth, 1 - leadDays));
9740				for (dRow = 0; dRow < numRows; dRow++) { // create date picker rows
9741					calender += "<tr>";
9742					tbody = (!showWeek ? "" : "<td class='ui-datepicker-week-col'>" +
9743						this._get(inst, "calculateWeek")(printDate) + "</td>");
9744					for (dow = 0; dow < 7; dow++) { // create date picker days
9745						daySettings = (beforeShowDay ?
9746							beforeShowDay.apply((inst.input ? inst.input[0] : null), [printDate]) : [true, ""]);
9747						otherMonth = (printDate.getMonth() !== drawMonth);
9748						unselectable = (otherMonth && !selectOtherMonths) || !daySettings[0] ||
9749							(minDate && printDate < minDate) || (maxDate && printDate > maxDate);
9750						tbody += "<td class='" +
9751							((dow + firstDay + 6) % 7 >= 5 ? " ui-datepicker-week-end" : "") + // highlight weekends
9752							(otherMonth ? " ui-datepicker-other-month" : "") + // highlight days from other months
9753							((printDate.getTime() === selectedDate.getTime() && drawMonth === inst.selectedMonth && inst._keyEvent) || // user pressed key
9754							(defaultDate.getTime() === printDate.getTime() && defaultDate.getTime() === selectedDate.getTime()) ?
9755							// or defaultDate is current printedDate and defaultDate is selectedDate
9756							" " + this._dayOverClass : "") + // highlight selected day
9757							(unselectable ? " " + this._unselectableClass + " ui-state-disabled": "") +  // highlight unselectable days
9758							(otherMonth && !showOtherMonths ? "" : " " + daySettings[1] + // highlight custom dates
9759							(printDate.getTime() === currentDate.getTime() ? " " + this._currentClass : "") + // highlight selected day
9760							(printDate.getTime() === today.getTime() ? " ui-datepicker-today" : "")) + "'" + // highlight today (if different)
9761							((!otherMonth || showOtherMonths) && daySettings[2] ? " title='" + daySettings[2].replace(/'/g, "&#39;") + "'" : "") + // cell title
9762							(unselectable ? "" : " data-handler='selectDay' data-event='click' data-month='" + printDate.getMonth() + "' data-year='" + printDate.getFullYear() + "'") + ">" + // actions
9763							(otherMonth && !showOtherMonths ? "&#xa0;" : // display for other months
9764							(unselectable ? "<span class='ui-state-default'>" + printDate.getDate() + "</span>" : "<a class='ui-state-default" +
9765							(printDate.getTime() === today.getTime() ? " ui-state-highlight" : "") +
9766							(printDate.getTime() === currentDate.getTime() ? " ui-state-active" : "") + // highlight selected day
9767							(otherMonth ? " ui-priority-secondary" : "") + // distinguish dates from other months
9768							"' href='#'>" + printDate.getDate() + "</a>")) + "</td>"; // display selectable date
9769						printDate.setDate(printDate.getDate() + 1);
9770						printDate = this._daylightSavingAdjust(printDate);
9771					}
9772					calender += tbody + "</tr>";
9773				}
9774				drawMonth++;
9775				if (drawMonth > 11) {
9776					drawMonth = 0;
9777					drawYear++;
9778				}
9779				calender += "</tbody></table>" + (isMultiMonth ? "</div>" +
9780							((numMonths[0] > 0 && col === numMonths[1]-1) ? "<div class='ui-datepicker-row-break'></div>" : "") : "");
9781				group += calender;
9782			}
9783			html += group;
9784		}
9785		html += buttonPanel;
9786		inst._keyEvent = false;
vendor: 5,431 bytes, lines 9787-9930
9787		return html;
9788	},
9789
9790	/* Generate the month and year header. */
9791	_generateMonthYearHeader: function(inst, drawMonth, drawYear, minDate, maxDate,
9792			secondary, monthNames, monthNamesShort) {
9793
9794		var inMinYear, inMaxYear, month, years, thisYear, determineYear, year, endYear,
9795			changeMonth = this._get(inst, "changeMonth"),
9796			changeYear = this._get(inst, "changeYear"),
9797			showMonthAfterYear = this._get(inst, "showMonthAfterYear"),
9798			html = "<div class='ui-datepicker-title'>",
9799			monthHtml = "";
9800
9801		// month selection
9802		if (secondary || !changeMonth) {
9803			monthHtml += "<span class='ui-datepicker-month'>" + monthNames[drawMonth] + "</span>";
9804		} else {
9805			inMinYear = (minDate && minDate.getFullYear() === drawYear);
9806			inMaxYear = (maxDate && maxDate.getFullYear() === drawYear);
9807			monthHtml += "<select class='ui-datepicker-month' data-handler='selectMonth' data-event='change'>";
9808			for ( month = 0; month < 12; month++) {
9809				if ((!inMinYear || month >= minDate.getMonth()) && (!inMaxYear || month <= maxDate.getMonth())) {
9810					monthHtml += "<option value='" + month + "'" +
9811						(month === drawMonth ? " selected='selected'" : "") +
9812						">" + monthNamesShort[month] + "</option>";
9813				}
9814			}
9815			monthHtml += "</select>";
9816		}
9817
9818		if (!showMonthAfterYear) {
9819			html += monthHtml + (secondary || !(changeMonth && changeYear) ? "&#xa0;" : "");
9820		}
9821
9822		// year selection
9823		if ( !inst.yearshtml ) {
9824			inst.yearshtml = "";
9825			if (secondary || !changeYear) {
9826				html += "<span class='ui-datepicker-year'>" + drawYear + "</span>";
9827			} else {
9828				// determine range of years to display
9829				years = this._get(inst, "yearRange").split(":");
9830				thisYear = new Date().getFullYear();
9831				determineYear = function(value) {
9832					var year = (value.match(/c[+\-].*/) ? drawYear + parseInt(value.substring(1), 10) :
9833						(value.match(/[+\-].*/) ? thisYear + parseInt(value, 10) :
9834						parseInt(value, 10)));
9835					return (isNaN(year) ? thisYear : year);
9836				};
9837				year = determineYear(years[0]);
9838				endYear = Math.max(year, determineYear(years[1] || ""));
9839				year = (minDate ? Math.max(year, minDate.getFullYear()) : year);
9840				endYear = (maxDate ? Math.min(endYear, maxDate.getFullYear()) : endYear);
9841				inst.yearshtml += "<select class='ui-datepicker-year' data-handler='selectYear' data-event='change'>";
9842				for (; year <= endYear; year++) {
9843					inst.yearshtml += "<option value='" + year + "'" +
9844						(year === drawYear ? " selected='selected'" : "") +
9845						">" + year + "</option>";
9846				}
9847				inst.yearshtml += "</select>";
9848
9849				html += inst.yearshtml;
9850				inst.yearshtml = null;
9851			}
9852		}
9853
9854		html += this._get(inst, "yearSuffix");
9855		if (showMonthAfterYear) {
9856			html += (secondary || !(changeMonth && changeYear) ? "&#xa0;" : "") + monthHtml;
9857		}
9858		html += "</div>"; // Close datepicker_header
9859		return html;
9860	},
9861
9862	/* Adjust one of the date sub-fields. */
9863	_adjustInstDate: function(inst, offset, period) {
9864		var year = inst.drawYear + (period === "Y" ? offset : 0),
9865			month = inst.drawMonth + (period === "M" ? offset : 0),
9866			day = Math.min(inst.selectedDay, this._getDaysInMonth(year, month)) + (period === "D" ? offset : 0),
9867			date = this._restrictMinMax(inst, this._daylightSavingAdjust(new Date(year, month, day)));
9868
9869		inst.selectedDay = date.getDate();
9870		inst.drawMonth = inst.selectedMonth = date.getMonth();
9871		inst.drawYear = inst.selectedYear = date.getFullYear();
9872		if (period === "M" || period === "Y") {
9873			this._notifyChange(inst);
9874		}
9875	},
9876
9877	/* Ensure a date is within any min/max bounds. */
9878	_restrictMinMax: function(inst, date) {
9879		var minDate = this._getMinMaxDate(inst, "min"),
9880			maxDate = this._getMinMaxDate(inst, "max"),
9881			newDate = (minDate && date < minDate ? minDate : date);
9882		return (maxDate && newDate > maxDate ? maxDate : newDate);
9883	},
9884
9885	/* Notify change of month/year. */
9886	_notifyChange: function(inst) {
9887		var onChange = this._get(inst, "onChangeMonthYear");
9888		if (onChange) {
9889			onChange.apply((inst.input ? inst.input[0] : null),
9890				[inst.selectedYear, inst.selectedMonth + 1, inst]);
9891		}
9892	},
9893
9894	/* Determine the number of months to show. */
9895	_getNumberOfMonths: function(inst) {
9896		var numMonths = this._get(inst, "numberOfMonths");
9897		return (numMonths == null ? [1, 1] : (typeof numMonths === "number" ? [1, numMonths] : numMonths));
9898	},
9899
9900	/* Determine the current maximum date - ensure no time components are set. */
9901	_getMinMaxDate: function(inst, minMax) {
9902		return this._determineDate(inst, this._get(inst, minMax + "Date"), null);
9903	},
9904
9905	/* Find the number of days in a given month. */
9906	_getDaysInMonth: function(year, month) {
9907		return 32 - this._daylightSavingAdjust(new Date(year, month, 32)).getDate();
9908	},
9909
9910	/* Find the day of the week of the first of a month. */
9911	_getFirstDayOfMonth: function(year, month) {
9912		return new Date(year, month, 1).getDay();
9913	},
9914
9915	/* Determines if we should allow a "next/prev" month display change. */
9916	_canAdjustMonth: function(inst, offset, curYear, curMonth) {
9917		var numMonths = this._getNumberOfMonths(inst),
9918			date = this._daylightSavingAdjust(new Date(curYear,
9919			curMonth + (offset < 0 ? offset : numMonths[0] * numMonths[1]), 1));
9920
9921		if (offset < 0) {
9922			date.setDate(this._getDaysInMonth(date.getFullYear(), date.getMonth()));
9923		}
9924		return this._isInRange(inst, date);
9925	},
9926
9927	/* Is the given date in the accepted range? */
9928	_isInRange: function(inst, date) {
9929		var yearSplit, currentYear,
9930			minDate = this._getMinMaxDate(inst, "min"),
vendor: 4,958 bytes, lines 9931-10066
9931			maxDate = this._getMinMaxDate(inst, "max"),
9932			minYear = null,
9933			maxYear = null,
9934			years = this._get(inst, "yearRange");
9935			if (years){
9936				yearSplit = years.split(":");
9937				currentYear = new Date().getFullYear();
9938				minYear = parseInt(yearSplit[0], 10);
9939				maxYear = parseInt(yearSplit[1], 10);
9940				if ( yearSplit[0].match(/[+\-].*/) ) {
9941					minYear += currentYear;
9942				}
9943				if ( yearSplit[1].match(/[+\-].*/) ) {
9944					maxYear += currentYear;
9945				}
9946			}
9947
9948		return ((!minDate || date.getTime() >= minDate.getTime()) &&
9949			(!maxDate || date.getTime() <= maxDate.getTime()) &&
9950			(!minYear || date.getFullYear() >= minYear) &&
9951			(!maxYear || date.getFullYear() <= maxYear));
9952	},
9953
9954	/* Provide the configuration settings for formatting/parsing. */
9955	_getFormatConfig: function(inst) {
9956		var shortYearCutoff = this._get(inst, "shortYearCutoff");
9957		shortYearCutoff = (typeof shortYearCutoff !== "string" ? shortYearCutoff :
9958			new Date().getFullYear() % 100 + parseInt(shortYearCutoff, 10));
9959		return {shortYearCutoff: shortYearCutoff,
9960			dayNamesShort: this._get(inst, "dayNamesShort"), dayNames: this._get(inst, "dayNames"),
9961			monthNamesShort: this._get(inst, "monthNamesShort"), monthNames: this._get(inst, "monthNames")};
9962	},
9963
9964	/* Format the given date for display. */
9965	_formatDate: function(inst, day, month, year) {
9966		if (!day) {
9967			inst.currentDay = inst.selectedDay;
9968			inst.currentMonth = inst.selectedMonth;
9969			inst.currentYear = inst.selectedYear;
9970		}
9971		var date = (day ? (typeof day === "object" ? day :
9972			this._daylightSavingAdjust(new Date(year, month, day))) :
9973			this._daylightSavingAdjust(new Date(inst.currentYear, inst.currentMonth, inst.currentDay)));
9974		return this.formatDate(this._get(inst, "dateFormat"), date, this._getFormatConfig(inst));
9975	}
9976});
9977
9978/*
9979 * Bind hover events for datepicker elements.
9980 * Done via delegate so the binding only occurs once in the lifetime of the parent div.
9981 * Global datepicker_instActive, set by _updateDatepicker allows the handlers to find their way back to the active picker.
9982 */
9983function datepicker_bindHover(dpDiv) {
9984	var selector = "button, .ui-datepicker-prev, .ui-datepicker-next, .ui-datepicker-calendar td a";
9985	return dpDiv.delegate(selector, "mouseout", function() {
9986			$(this).removeClass("ui-state-hover");
9987			if (this.className.indexOf("ui-datepicker-prev") !== -1) {
9988				$(this).removeClass("ui-datepicker-prev-hover");
9989			}
9990			if (this.className.indexOf("ui-datepicker-next") !== -1) {
9991				$(this).removeClass("ui-datepicker-next-hover");
9992			}
9993		})
9994		.delegate( selector, "mouseover", datepicker_handleMouseover );
9995}
9996
9997function datepicker_handleMouseover() {
9998	if (!$.datepicker._isDisabledDatepicker( datepicker_instActive.inline? datepicker_instActive.dpDiv.parent()[0] : datepicker_instActive.input[0])) {
9999		$(this).parents(".ui-datepicker-calendar").find("a").removeClass("ui-state-hover");
10000		$(this).addClass("ui-state-hover");
10001		if (this.className.indexOf("ui-datepicker-prev") !== -1) {
10002			$(this).addClass("ui-datepicker-prev-hover");
10003		}
10004		if (this.className.indexOf("ui-datepicker-next") !== -1) {
10005			$(this).addClass("ui-datepicker-next-hover");
10006		}
10007	}
10008}
10009
10010/* jQuery extend now ignores nulls! */
10011function datepicker_extendRemove(target, props) {
10012	$.extend(target, props);
10013	for (var name in props) {
10014		if (props[name] == null) {
10015			target[name] = props[name];
10016		}
10017	}
10018	return target;
10019}
10020
10021/* Invoke the datepicker functionality.
10022   @param  options  string - a command, optionally followed by additional parameters or
10023					Object - settings for attaching new datepicker functionality
10024   @return  jQuery object */
10025$.fn.datepicker = function(options){
10026
10027	/* Verify an empty collection wasn't passed - Fixes #6976 */
10028	if ( !this.length ) {
10029		return this;
10030	}
10031
10032	/* Initialise the date picker. */
10033	if (!$.datepicker.initialized) {
10034		$(document).mousedown($.datepicker._checkExternalClick);
10035		$.datepicker.initialized = true;
10036	}
10037
10038	/* Append datepicker main container to body if not exist. */
10039	if ($("#"+$.datepicker._mainDivId).length === 0) {
10040		$("body").append($.datepicker.dpDiv);
10041	}
10042
10043	var otherArgs = Array.prototype.slice.call(arguments, 1);
10044	if (typeof options === "string" && (options === "isDisabled" || options === "getDate" || options === "widget")) {
10045		return $.datepicker["_" + options + "Datepicker"].
10046			apply($.datepicker, [this[0]].concat(otherArgs));
10047	}
10048	if (options === "option" && arguments.length === 2 && typeof arguments[1] === "string") {
10049		return $.datepicker["_" + options + "Datepicker"].
10050			apply($.datepicker, [this[0]].concat(otherArgs));
10051	}
10052	return this.each(function() {
10053		typeof options === "string" ?
10054			$.datepicker["_" + options + "Datepicker"].
10055				apply($.datepicker, [this].concat(otherArgs)) :
10056			$.datepicker._attachDatepicker(this, options);
10057	});
10058};
10059
10060$.datepicker = new Datepicker(); // singleton instance
10061$.datepicker.initialized = false;
10062$.datepicker.uuid = new Date().getTime();
10063$.datepicker.version = "1.11.4";
10064
10065var datepicker = $.datepicker;
10066
vendor: 24,872 bytes, lines 10067-11066
10067
10068/*!
10069 * jQuery UI Dialog 1.11.4
10070 * http://jqueryui.com
10071 *
10072 * Copyright jQuery Foundation and other contributors
10073 * Released under the MIT license.
10074 * http://jquery.org/license
10075 *
10076 * http://api.jqueryui.com/dialog/
10077 */
10078
10079
10080var dialog = $.widget( "ui.dialog", {
10081	version: "1.11.4",
10082	options: {
10083		appendTo: "body",
10084		autoOpen: true,
10085		buttons: [],
10086		closeOnEscape: true,
10087		closeText: "Close",
10088		dialogClass: "",
10089		draggable: true,
10090		hide: null,
10091		height: "auto",
10092		maxHeight: null,
10093		maxWidth: null,
10094		minHeight: 150,
10095		minWidth: 150,
10096		modal: false,
10097		position: {
10098			my: "center",
10099			at: "center",
10100			of: window,
10101			collision: "fit",
10102			// Ensure the titlebar is always visible
10103			using: function( pos ) {
10104				var topOffset = $( this ).css( pos ).offset().top;
10105				if ( topOffset < 0 ) {
10106					$( this ).css( "top", pos.top - topOffset );
10107				}
10108			}
10109		},
10110		resizable: true,
10111		show: null,
10112		title: null,
10113		width: 300,
10114
10115		// callbacks
10116		beforeClose: null,
10117		close: null,
10118		drag: null,
10119		dragStart: null,
10120		dragStop: null,
10121		focus: null,
10122		open: null,
10123		resize: null,
10124		resizeStart: null,
10125		resizeStop: null
10126	},
10127
10128	sizeRelatedOptions: {
10129		buttons: true,
10130		height: true,
10131		maxHeight: true,
10132		maxWidth: true,
10133		minHeight: true,
10134		minWidth: true,
10135		width: true
10136	},
10137
10138	resizableRelatedOptions: {
10139		maxHeight: true,
10140		maxWidth: true,
10141		minHeight: true,
10142		minWidth: true
10143	},
10144
10145	_create: function() {
10146		this.originalCss = {
10147			display: this.element[ 0 ].style.display,
10148			width: this.element[ 0 ].style.width,
10149			minHeight: this.element[ 0 ].style.minHeight,
10150			maxHeight: this.element[ 0 ].style.maxHeight,
10151			height: this.element[ 0 ].style.height
10152		};
10153		this.originalPosition = {
10154			parent: this.element.parent(),
10155			index: this.element.parent().children().index( this.element )
10156		};
10157		this.originalTitle = this.element.attr( "title" );
10158		this.options.title = this.options.title || this.originalTitle;
10159
10160		this._createWrapper();
10161
10162		this.element
10163			.show()
10164			.removeAttr( "title" )
10165			.addClass( "ui-dialog-content ui-widget-content" )
10166			.appendTo( this.uiDialog );
10167
10168		this._createTitlebar();
10169		this._createButtonPane();
10170
10171		if ( this.options.draggable && $.fn.draggable ) {
10172			this._makeDraggable();
10173		}
10174		if ( this.options.resizable && $.fn.resizable ) {
10175			this._makeResizable();
10176		}
10177
10178		this._isOpen = false;
10179
10180		this._trackFocus();
10181	},
10182
10183	_init: function() {
10184		if ( this.options.autoOpen ) {
10185			this.open();
10186		}
10187	},
10188
10189	_appendTo: function() {
10190		var element = this.options.appendTo;
10191		if ( element && (element.jquery || element.nodeType) ) {
10192			return $( element );
10193		}
10194		return this.document.find( element || "body" ).eq( 0 );
10195	},
10196
10197	_destroy: function() {
10198		var next,
10199			originalPosition = this.originalPosition;
10200
10201		this._untrackInstance();
10202		this._destroyOverlay();
10203
10204		this.element
10205			.removeUniqueId()
10206			.removeClass( "ui-dialog-content ui-widget-content" )
10207			.css( this.originalCss )
10208			// Without detaching first, the following becomes really slow
10209			.detach();
10210
10211		this.uiDialog.stop( true, true ).remove();
10212
10213		if ( this.originalTitle ) {
10214			this.element.attr( "title", this.originalTitle );
10215		}
10216
10217		next = originalPosition.parent.children().eq( originalPosition.index );
10218		// Don't try to place the dialog next to itself (#8613)
10219		if ( next.length && next[ 0 ] !== this.element[ 0 ] ) {
10220			next.before( this.element );
10221		} else {
10222			originalPosition.parent.append( this.element );
10223		}
10224	},
10225
10226	widget: function() {
10227		return this.uiDialog;
10228	},
10229
10230	disable: $.noop,
10231	enable: $.noop,
10232
10233	close: function( event ) {
10234		var activeElement,
10235			that = this;
10236
10237		if ( !this._isOpen || this._trigger( "beforeClose", event ) === false ) {
10238			return;
10239		}
10240
10241		this._isOpen = false;
10242		this._focusedElement = null;
10243		this._destroyOverlay();
10244		this._untrackInstance();
10245
10246		if ( !this.opener.filter( ":focusable" ).focus().length ) {
10247
10248			// support: IE9
10249			// IE9 throws an "Unspecified error" accessing document.activeElement from an <iframe>
10250			try {
10251				activeElement = this.document[ 0 ].activeElement;
10252
10253				// Support: IE9, IE10
10254				// If the <body> is blurred, IE will switch windows, see #4520
10255				if ( activeElement && activeElement.nodeName.toLowerCase() !== "body" ) {
10256
10257					// Hiding a focused element doesn't trigger blur in WebKit
10258					// so in case we have nothing to focus on, explicitly blur the active element
10259					// https://bugs.webkit.org/show_bug.cgi?id=47182
10260					$( activeElement ).blur();
10261				}
10262			} catch ( error ) {}
10263		}
10264
10265		this._hide( this.uiDialog, this.options.hide, function() {
10266			that._trigger( "close", event );
10267		});
10268	},
10269
10270	isOpen: function() {
10271		return this._isOpen;
10272	},
10273
10274	moveToTop: function() {
10275		this._moveToTop();
10276	},
10277
10278	_moveToTop: function( event, silent ) {
10279		var moved = false,
10280			zIndices = this.uiDialog.siblings( ".ui-front:visible" ).map(function() {
10281				return +$( this ).css( "z-index" );
10282			}).get(),
10283			zIndexMax = Math.max.apply( null, zIndices );
10284
10285		if ( zIndexMax >= +this.uiDialog.css( "z-index" ) ) {
10286			this.uiDialog.css( "z-index", zIndexMax + 1 );
10287			moved = true;
10288		}
10289
10290		if ( moved && !silent ) {
10291			this._trigger( "focus", event );
10292		}
10293		return moved;
10294	},
10295
10296	open: function() {
10297		var that = this;
10298		if ( this._isOpen ) {
10299			if ( this._moveToTop() ) {
10300				this._focusTabbable();
10301			}
10302			return;
10303		}
10304
10305		this._isOpen = true;
10306		this.opener = $( this.document[ 0 ].activeElement );
10307
10308		this._size();
10309		this._position();
10310		this._createOverlay();
10311		this._moveToTop( null, true );
10312
10313		// Ensure the overlay is moved to the top with the dialog, but only when
10314		// opening. The overlay shouldn't move after the dialog is open so that
10315		// modeless dialogs opened after the modal dialog stack properly.
10316		if ( this.overlay ) {
10317			this.overlay.css( "z-index", this.uiDialog.css( "z-index" ) - 1 );
10318		}
10319
10320		this._show( this.uiDialog, this.options.show, function() {
10321			that._focusTabbable();
10322			that._trigger( "focus" );
10323		});
10324
10325		// Track the dialog immediately upon openening in case a focus event
10326		// somehow occurs outside of the dialog before an element inside the
10327		// dialog is focused (#10152)
10328		this._makeFocusTarget();
10329
10330		this._trigger( "open" );
10331	},
10332
10333	_focusTabbable: function() {
10334		// Set focus to the first match:
10335		// 1. An element that was focused previously
10336		// 2. First element inside the dialog matching [autofocus]
10337		// 3. Tabbable element inside the content element
10338		// 4. Tabbable element inside the buttonpane
10339		// 5. The close button
10340		// 6. The dialog itself
10341		var hasFocus = this._focusedElement;
10342		if ( !hasFocus ) {
10343			hasFocus = this.element.find( "[autofocus]" );
10344		}
10345		if ( !hasFocus.length ) {
10346			hasFocus = this.element.find( ":tabbable" );
10347		}
10348		if ( !hasFocus.length ) {
10349			hasFocus = this.uiDialogButtonPane.find( ":tabbable" );
10350		}
10351		if ( !hasFocus.length ) {
10352			hasFocus = this.uiDialogTitlebarClose.filter( ":tabbable" );
10353		}
10354		if ( !hasFocus.length ) {
10355			hasFocus = this.uiDialog;
10356		}
10357		hasFocus.eq( 0 ).focus();
10358	},
10359
10360	_keepFocus: function( event ) {
10361		function checkFocus() {
10362			var activeElement = this.document[0].activeElement,
10363				isActive = this.uiDialog[0] === activeElement ||
10364					$.contains( this.uiDialog[0], activeElement );
10365			if ( !isActive ) {
10366				this._focusTabbable();
10367			}
10368		}
10369		event.preventDefault();
10370		checkFocus.call( this );
10371		// support: IE
10372		// IE <= 8 doesn't prevent moving focus even with event.preventDefault()
10373		// so we check again later
10374		this._delay( checkFocus );
10375	},
10376
10377	_createWrapper: function() {
10378		this.uiDialog = $("<div>")
10379			.addClass( "ui-dialog ui-widget ui-widget-content ui-corner-all ui-front " +
10380				this.options.dialogClass )
10381			.hide()
10382			.attr({
10383				// Setting tabIndex makes the div focusable
10384				tabIndex: -1,
10385				role: "dialog"
10386			})
10387			.appendTo( this._appendTo() );
10388
10389		this._on( this.uiDialog, {
10390			keydown: function( event ) {
10391				if ( this.options.closeOnEscape && !event.isDefaultPrevented() && event.keyCode &&
10392						event.keyCode === $.ui.keyCode.ESCAPE ) {
10393					event.preventDefault();
10394					this.close( event );
10395					return;
10396				}
10397
10398				// prevent tabbing out of dialogs
10399				if ( event.keyCode !== $.ui.keyCode.TAB || event.isDefaultPrevented() ) {
10400					return;
10401				}
10402				var tabbables = this.uiDialog.find( ":tabbable" ),
10403					first = tabbables.filter( ":first" ),
10404					last = tabbables.filter( ":last" );
10405
10406				if ( ( event.target === last[0] || event.target === this.uiDialog[0] ) && !event.shiftKey ) {
10407					this._delay(function() {
10408						first.focus();
10409					});
10410					event.preventDefault();
10411				} else if ( ( event.target === first[0] || event.target === this.uiDialog[0] ) && event.shiftKey ) {
10412					this._delay(function() {
10413						last.focus();
10414					});
10415					event.preventDefault();
10416				}
10417			},
10418			mousedown: function( event ) {
10419				if ( this._moveToTop( event ) ) {
10420					this._focusTabbable();
10421				}
10422			}
10423		});
10424
10425		// We assume that any existing aria-describedby attribute means
10426		// that the dialog content is marked up properly
10427		// otherwise we brute force the content as the description
10428		if ( !this.element.find( "[aria-describedby]" ).length ) {
10429			this.uiDialog.attr({
10430				"aria-describedby": this.element.uniqueId().attr( "id" )
10431			});
10432		}
10433	},
10434
10435	_createTitlebar: function() {
10436		var uiDialogTitle;
10437
10438		this.uiDialogTitlebar = $( "<div>" )
10439			.addClass( "ui-dialog-titlebar ui-widget-header ui-corner-all ui-helper-clearfix" )
10440			.prependTo( this.uiDialog );
10441		this._on( this.uiDialogTitlebar, {
10442			mousedown: function( event ) {
10443				// Don't prevent click on close button (#8838)
10444				// Focusing a dialog that is partially scrolled out of view
10445				// causes the browser to scroll it into view, preventing the click event
10446				if ( !$( event.target ).closest( ".ui-dialog-titlebar-close" ) ) {
10447					// Dialog isn't getting focus when dragging (#8063)
10448					this.uiDialog.focus();
10449				}
10450			}
10451		});
10452
10453		// support: IE
10454		// Use type="button" to prevent enter keypresses in textboxes from closing the
10455		// dialog in IE (#9312)
10456		this.uiDialogTitlebarClose = $( "<button type='button'></button>" )
10457			.button({
10458				label: this.options.closeText,
10459				icons: {
10460					primary: "ui-icon-closethick"
10461				},
10462				text: false
10463			})
10464			.addClass( "ui-dialog-titlebar-close" )
10465			.appendTo( this.uiDialogTitlebar );
10466		this._on( this.uiDialogTitlebarClose, {
10467			click: function( event ) {
10468				event.preventDefault();
10469				this.close( event );
10470			}
10471		});
10472
10473		uiDialogTitle = $( "<span>" )
10474			.uniqueId()
10475			.addClass( "ui-dialog-title" )
10476			.prependTo( this.uiDialogTitlebar );
10477		this._title( uiDialogTitle );
10478
10479		this.uiDialog.attr({
10480			"aria-labelledby": uiDialogTitle.attr( "id" )
10481		});
10482	},
10483
10484	_title: function( title ) {
10485		if ( !this.options.title ) {
10486			title.html( "&#160;" );
10487		}
10488		title.text( this.options.title );
10489	},
10490
10491	_createButtonPane: function() {
10492		this.uiDialogButtonPane = $( "<div>" )
10493			.addClass( "ui-dialog-buttonpane ui-widget-content ui-helper-clearfix" );
10494
10495		this.uiButtonSet = $( "<div>" )
10496			.addClass( "ui-dialog-buttonset" )
10497			.appendTo( this.uiDialogButtonPane );
10498
10499		this._createButtons();
10500	},
10501
10502	_createButtons: function() {
10503		var that = this,
10504			buttons = this.options.buttons;
10505
10506		// if we already have a button pane, remove it
10507		this.uiDialogButtonPane.remove();
10508		this.uiButtonSet.empty();
10509
10510		if ( $.isEmptyObject( buttons ) || ($.isArray( buttons ) && !buttons.length) ) {
10511			this.uiDialog.removeClass( "ui-dialog-buttons" );
10512			return;
10513		}
10514
10515		$.each( buttons, function( name, props ) {
10516			var click, buttonOptions;
10517			props = $.isFunction( props ) ?
10518				{ click: props, text: name } :
10519				props;
10520			// Default to a non-submitting button
10521			props = $.extend( { type: "button" }, props );
10522			// Change the context for the click callback to be the main element
10523			click = props.click;
10524			props.click = function() {
10525				click.apply( that.element[ 0 ], arguments );
10526			};
10527			buttonOptions = {
10528				icons: props.icons,
10529				text: props.showText
10530			};
10531			delete props.icons;
10532			delete props.showText;
10533			$( "<button></button>", props )
10534				.button( buttonOptions )
10535				.appendTo( that.uiButtonSet );
10536		});
10537		this.uiDialog.addClass( "ui-dialog-buttons" );
10538		this.uiDialogButtonPane.appendTo( this.uiDialog );
10539	},
10540
10541	_makeDraggable: function() {
10542		var that = this,
10543			options = this.options;
10544
10545		function filteredUi( ui ) {
10546			return {
10547				position: ui.position,
10548				offset: ui.offset
10549			};
10550		}
10551
10552		this.uiDialog.draggable({
10553			cancel: ".ui-dialog-content, .ui-dialog-titlebar-close",
10554			handle: ".ui-dialog-titlebar",
10555			containment: "document",
10556			start: function( event, ui ) {
10557				$( this ).addClass( "ui-dialog-dragging" );
10558				that._blockFrames();
10559				that._trigger( "dragStart", event, filteredUi( ui ) );
10560			},
10561			drag: function( event, ui ) {
10562				that._trigger( "drag", event, filteredUi( ui ) );
10563			},
10564			stop: function( event, ui ) {
10565				var left = ui.offset.left - that.document.scrollLeft(),
10566					top = ui.offset.top - that.document.scrollTop();
10567
10568				options.position = {
10569					my: "left top",
10570					at: "left" + (left >= 0 ? "+" : "") + left + " " +
10571						"top" + (top >= 0 ? "+" : "") + top,
10572					of: that.window
10573				};
10574				$( this ).removeClass( "ui-dialog-dragging" );
10575				that._unblockFrames();
10576				that._trigger( "dragStop", event, filteredUi( ui ) );
10577			}
10578		});
10579	},
10580
10581	_makeResizable: function() {
10582		var that = this,
10583			options = this.options,
10584			handles = options.resizable,
10585			// .ui-resizable has position: relative defined in the stylesheet
10586			// but dialogs have to use absolute or fixed positioning
10587			position = this.uiDialog.css("position"),
10588			resizeHandles = typeof handles === "string" ?
10589				handles	:
10590				"n,e,s,w,se,sw,ne,nw";
10591
10592		function filteredUi( ui ) {
10593			return {
10594				originalPosition: ui.originalPosition,
10595				originalSize: ui.originalSize,
10596				position: ui.position,
10597				size: ui.size
10598			};
10599		}
10600
10601		this.uiDialog.resizable({
10602			cancel: ".ui-dialog-content",
10603			containment: "document",
10604			alsoResize: this.element,
10605			maxWidth: options.maxWidth,
10606			maxHeight: options.maxHeight,
10607			minWidth: options.minWidth,
10608			minHeight: this._minHeight(),
10609			handles: resizeHandles,
10610			start: function( event, ui ) {
10611				$( this ).addClass( "ui-dialog-resizing" );
10612				that._blockFrames();
10613				that._trigger( "resizeStart", event, filteredUi( ui ) );
10614			},
10615			resize: function( event, ui ) {
10616				that._trigger( "resize", event, filteredUi( ui ) );
10617			},
10618			stop: function( event, ui ) {
10619				var offset = that.uiDialog.offset(),
10620					left = offset.left - that.document.scrollLeft(),
10621					top = offset.top - that.document.scrollTop();
10622
10623				options.height = that.uiDialog.height();
10624				options.width = that.uiDialog.width();
10625				options.position = {
10626					my: "left top",
10627					at: "left" + (left >= 0 ? "+" : "") + left + " " +
10628						"top" + (top >= 0 ? "+" : "") + top,
10629					of: that.window
10630				};
10631				$( this ).removeClass( "ui-dialog-resizing" );
10632				that._unblockFrames();
10633				that._trigger( "resizeStop", event, filteredUi( ui ) );
10634			}
10635		})
10636		.css( "position", position );
10637	},
10638
10639	_trackFocus: function() {
10640		this._on( this.widget(), {
10641			focusin: function( event ) {
10642				this._makeFocusTarget();
10643				this._focusedElement = $( event.target );
10644			}
10645		});
10646	},
10647
10648	_makeFocusTarget: function() {
10649		this._untrackInstance();
10650		this._trackingInstances().unshift( this );
10651	},
10652
10653	_untrackInstance: function() {
10654		var instances = this._trackingInstances(),
10655			exists = $.inArray( this, instances );
10656		if ( exists !== -1 ) {
10657			instances.splice( exists, 1 );
10658		}
10659	},
10660
10661	_trackingInstances: function() {
10662		var instances = this.document.data( "ui-dialog-instances" );
10663		if ( !instances ) {
10664			instances = [];
10665			this.document.data( "ui-dialog-instances", instances );
10666		}
10667		return instances;
10668	},
10669
10670	_minHeight: function() {
10671		var options = this.options;
10672
10673		return options.height === "auto" ?
10674			options.minHeight :
10675			Math.min( options.minHeight, options.height );
10676	},
10677
10678	_position: function() {
10679		// Need to show the dialog to get the actual offset in the position plugin
10680		var isVisible = this.uiDialog.is( ":visible" );
10681		if ( !isVisible ) {
10682			this.uiDialog.show();
10683		}
10684		this.uiDialog.position( this.options.position );
10685		if ( !isVisible ) {
10686			this.uiDialog.hide();
10687		}
10688	},
10689
10690	_setOptions: function( options ) {
10691		var that = this,
10692			resize = false,
10693			resizableOptions = {};
10694
10695		$.each( options, function( key, value ) {
10696			that._setOption( key, value );
10697
10698			if ( key in that.sizeRelatedOptions ) {
10699				resize = true;
10700			}
10701			if ( key in that.resizableRelatedOptions ) {
10702				resizableOptions[ key ] = value;
10703			}
10704		});
10705
10706		if ( resize ) {
10707			this._size();
10708			this._position();
10709		}
10710		if ( this.uiDialog.is( ":data(ui-resizable)" ) ) {
10711			this.uiDialog.resizable( "option", resizableOptions );
10712		}
10713	},
10714
10715	_setOption: function( key, value ) {
10716		var isDraggable, isResizable,
10717			uiDialog = this.uiDialog;
10718
10719		if ( key === "dialogClass" ) {
10720			uiDialog
10721				.removeClass( this.options.dialogClass )
10722				.addClass( value );
10723		}
10724
10725		if ( key === "disabled" ) {
10726			return;
10727		}
10728
10729		this._super( key, value );
10730
10731		if ( key === "appendTo" ) {
10732			this.uiDialog.appendTo( this._appendTo() );
10733		}
10734
10735		if ( key === "buttons" ) {
10736			this._createButtons();
10737		}
10738
10739		if ( key === "closeText" ) {
10740			this.uiDialogTitlebarClose.button({
10741				// Ensure that we always pass a string
10742				label: "" + value
10743			});
10744		}
10745
10746		if ( key === "draggable" ) {
10747			isDraggable = uiDialog.is( ":data(ui-draggable)" );
10748			if ( isDraggable && !value ) {
10749				uiDialog.draggable( "destroy" );
10750			}
10751
10752			if ( !isDraggable && value ) {
10753				this._makeDraggable();
10754			}
10755		}
10756
10757		if ( key === "position" ) {
10758			this._position();
10759		}
10760
10761		if ( key === "resizable" ) {
10762			// currently resizable, becoming non-resizable
10763			isResizable = uiDialog.is( ":data(ui-resizable)" );
10764			if ( isResizable && !value ) {
10765				uiDialog.resizable( "destroy" );
10766			}
10767
10768			// currently resizable, changing handles
10769			if ( isResizable && typeof value === "string" ) {
10770				uiDialog.resizable( "option", "handles", value );
10771			}
10772
10773			// currently non-resizable, becoming resizable
10774			if ( !isResizable && value !== false ) {
10775				this._makeResizable();
10776			}
10777		}
10778
10779		if ( key === "title" ) {
10780			this._title( this.uiDialogTitlebar.find( ".ui-dialog-title" ) );
10781		}
10782	},
10783
10784	_size: function() {
10785		// If the user has resized the dialog, the .ui-dialog and .ui-dialog-content
10786		// divs will both have width and height set, so we need to reset them
10787		var nonContentHeight, minContentHeight, maxContentHeight,
10788			options = this.options;
10789
10790		// Reset content sizing
10791		this.element.show().css({
10792			width: "auto",
10793			minHeight: 0,
10794			maxHeight: "none",
10795			height: 0
10796		});
10797
10798		if ( options.minWidth > options.width ) {
10799			options.width = options.minWidth;
10800		}
10801
10802		// reset wrapper sizing
10803		// determine the height of all the non-content elements
10804		nonContentHeight = this.uiDialog.css({
10805				height: "auto",
10806				width: options.width
10807			})
10808			.outerHeight();
10809		minContentHeight = Math.max( 0, options.minHeight - nonContentHeight );
10810		maxContentHeight = typeof options.maxHeight === "number" ?
10811			Math.max( 0, options.maxHeight - nonContentHeight ) :
10812			"none";
10813
10814		if ( options.height === "auto" ) {
10815			this.element.css({
10816				minHeight: minContentHeight,
10817				maxHeight: maxContentHeight,
10818				height: "auto"
10819			});
10820		} else {
10821			this.element.height( Math.max( 0, options.height - nonContentHeight ) );
10822		}
10823
10824		if ( this.uiDialog.is( ":data(ui-resizable)" ) ) {
10825			this.uiDialog.resizable( "option", "minHeight", this._minHeight() );
10826		}
10827	},
10828
10829	_blockFrames: function() {
10830		this.iframeBlocks = this.document.find( "iframe" ).map(function() {
10831			var iframe = $( this );
10832
10833			return $( "<div>" )
10834				.css({
10835					position: "absolute",
10836					width: iframe.outerWidth(),
10837					height: iframe.outerHeight()
10838				})
10839				.appendTo( iframe.parent() )
10840				.offset( iframe.offset() )[0];
10841		});
10842	},
10843
10844	_unblockFrames: function() {
10845		if ( this.iframeBlocks ) {
10846			this.iframeBlocks.remove();
10847			delete this.iframeBlocks;
10848		}
10849	},
10850
10851	_allowInteraction: function( event ) {
10852		if ( $( event.target ).closest( ".ui-dialog" ).length ) {
10853			return true;
10854		}
10855
10856		// TODO: Remove hack when datepicker implements
10857		// the .ui-front logic (#8989)
10858		return !!$( event.target ).closest( ".ui-datepicker" ).length;
10859	},
10860
10861	_createOverlay: function() {
10862		if ( !this.options.modal ) {
10863			return;
10864		}
10865
10866		// We use a delay in case the overlay is created from an
10867		// event that we're going to be cancelling (#2804)
10868		var isOpening = true;
10869		this._delay(function() {
10870			isOpening = false;
10871		});
10872
10873		if ( !this.document.data( "ui-dialog-overlays" ) ) {
10874
10875			// Prevent use of anchors and inputs
10876			// Using _on() for an event handler shared across many instances is
10877			// safe because the dialogs stack and must be closed in reverse order
10878			this._on( this.document, {
10879				focusin: function( event ) {
10880					if ( isOpening ) {
10881						return;
10882					}
10883
10884					if ( !this._allowInteraction( event ) ) {
10885						event.preventDefault();
10886						this._trackingInstances()[ 0 ]._focusTabbable();
10887					}
10888				}
10889			});
10890		}
10891
10892		this.overlay = $( "<div>" )
10893			.addClass( "ui-widget-overlay ui-front" )
10894			.appendTo( this._appendTo() );
10895		this._on( this.overlay, {
10896			mousedown: "_keepFocus"
10897		});
10898		this.document.data( "ui-dialog-overlays",
10899			(this.document.data( "ui-dialog-overlays" ) || 0) + 1 );
10900	},
10901
10902	_destroyOverlay: function() {
10903		if ( !this.options.modal ) {
10904			return;
10905		}
10906
10907		if ( this.overlay ) {
10908			var overlays = this.document.data( "ui-dialog-overlays" ) - 1;
10909
10910			if ( !overlays ) {
10911				this.document
10912					.unbind( "focusin" )
10913					.removeData( "ui-dialog-overlays" );
10914			} else {
10915				this.document.data( "ui-dialog-overlays", overlays );
10916			}
10917
10918			this.overlay.remove();
10919			this.overlay = null;
10920		}
10921	}
10922});
10923
10924
10925/*!
10926 * jQuery UI Progressbar 1.11.4
10927 * http://jqueryui.com
10928 *
10929 * Copyright jQuery Foundation and other contributors
10930 * Released under the MIT license.
10931 * http://jquery.org/license
10932 *
10933 * http://api.jqueryui.com/progressbar/
10934 */
10935
10936
10937var progressbar = $.widget( "ui.progressbar", {
10938	version: "1.11.4",
10939	options: {
10940		max: 100,
10941		value: 0,
10942
10943		change: null,
10944		complete: null
10945	},
10946
10947	min: 0,
10948
10949	_create: function() {
10950		// Constrain initial value
10951		this.oldValue = this.options.value = this._constrainedValue();
10952
10953		this.element
10954			.addClass( "ui-progressbar ui-widget ui-widget-content ui-corner-all" )
10955			.attr({
10956				// Only set static values, aria-valuenow and aria-valuemax are
10957				// set inside _refreshValue()
10958				role: "progressbar",
10959				"aria-valuemin": this.min
10960			});
10961
10962		this.valueDiv = $( "<div class='ui-progressbar-value ui-widget-header ui-corner-left'></div>" )
10963			.appendTo( this.element );
10964
10965		this._refreshValue();
10966	},
10967
10968	_destroy: function() {
10969		this.element
10970			.removeClass( "ui-progressbar ui-widget ui-widget-content ui-corner-all" )
10971			.removeAttr( "role" )
10972			.removeAttr( "aria-valuemin" )
10973			.removeAttr( "aria-valuemax" )
10974			.removeAttr( "aria-valuenow" );
10975
10976		this.valueDiv.remove();
10977	},
10978
10979	value: function( newValue ) {
10980		if ( newValue === undefined ) {
10981			return this.options.value;
10982		}
10983
10984		this.options.value = this._constrainedValue( newValue );
10985		this._refreshValue();
10986	},
10987
10988	_constrainedValue: function( newValue ) {
10989		if ( newValue === undefined ) {
10990			newValue = this.options.value;
10991		}
10992
10993		this.indeterminate = newValue === false;
10994
10995		// sanitize value
10996		if ( typeof newValue !== "number" ) {
10997			newValue = 0;
10998		}
10999
11000		return this.indeterminate ? false :
11001			Math.min( this.options.max, Math.max( this.min, newValue ) );
11002	},
11003
11004	_setOptions: function( options ) {
11005		// Ensure "value" option is set after other values (like max)
11006		var value = options.value;
11007		delete options.value;
11008
11009		this._super( options );
11010
11011		this.options.value = this._constrainedValue( value );
11012		this._refreshValue();
11013	},
11014
11015	_setOption: function( key, value ) {
11016		if ( key === "max" ) {
11017			// Don't allow a max less than min
11018			value = Math.max( this.min, value );
11019		}
11020		if ( key === "disabled" ) {
11021			this.element
11022				.toggleClass( "ui-state-disabled", !!value )
11023				.attr( "aria-disabled", value );
11024		}
11025		this._super( key, value );
11026	},
11027
11028	_percentage: function() {
11029		return this.indeterminate ? 100 : 100 * ( this.options.value - this.min ) / ( this.options.max - this.min );
11030	},
11031
11032	_refreshValue: function() {
11033		var value = this.options.value,
11034			percentage = this._percentage();
11035
11036		this.valueDiv
11037			.toggle( this.indeterminate || value > this.min )
11038			.toggleClass( "ui-corner-right", value === this.options.max )
11039			.width( percentage.toFixed(0) + "%" );
11040
11041		this.element.toggleClass( "ui-progressbar-indeterminate", this.indeterminate );
11042
11043		if ( this.indeterminate ) {
11044			this.element.removeAttr( "aria-valuenow" );
11045			if ( !this.overlayDiv ) {
11046				this.overlayDiv = $( "<div class='ui-progressbar-overlay'></div>" ).appendTo( this.valueDiv );
11047			}
11048		} else {
11049			this.element.attr({
11050				"aria-valuemax": this.options.max,
11051				"aria-valuenow": value
11052			});
11053			if ( this.overlayDiv ) {
11054				this.overlayDiv.remove();
11055				this.overlayDiv = null;
11056			}
11057		}
11058
11059		if ( this.oldValue !== value ) {
11060			this.oldValue = value;
11061			this._trigger( "change" );
11062		}
11063		if ( value === this.options.max ) {
11064			this._trigger( "complete" );
11065		}
11066	}
vendor: 18,427 bytes, lines 11066-11870
11066
11067});
11068
11069
11070/*!
11071 * jQuery UI Selectmenu 1.11.4
11072 * http://jqueryui.com
11073 *
11074 * Copyright jQuery Foundation and other contributors
11075 * Released under the MIT license.
11076 * http://jquery.org/license
11077 *
11078 * http://api.jqueryui.com/selectmenu
11079 */
11080
11081
11082var selectmenu = $.widget( "ui.selectmenu", {
11083	version: "1.11.4",
11084	defaultElement: "<select>",
11085	options: {
11086		appendTo: null,
11087		disabled: null,
11088		icons: {
11089			button: "ui-icon-triangle-1-s"
11090		},
11091		position: {
11092			my: "left top",
11093			at: "left bottom",
11094			collision: "none"
11095		},
11096		width: null,
11097
11098		// callbacks
11099		change: null,
11100		close: null,
11101		focus: null,
11102		open: null,
11103		select: null
11104	},
11105
11106	_create: function() {
11107		var selectmenuId = this.element.uniqueId().attr( "id" );
11108		this.ids = {
11109			element: selectmenuId,
11110			button: selectmenuId + "-button",
11111			menu: selectmenuId + "-menu"
11112		};
11113
11114		this._drawButton();
11115		this._drawMenu();
11116
11117		if ( this.options.disabled ) {
11118			this.disable();
11119		}
11120	},
11121
11122	_drawButton: function() {
11123		var that = this;
11124
11125		// Associate existing label with the new button
11126		this.label = $( "label[for='" + this.ids.element + "']" ).attr( "for", this.ids.button );
11127		this._on( this.label, {
11128			click: function( event ) {
11129				this.button.focus();
11130				event.preventDefault();
11131			}
11132		});
11133
11134		// Hide original select element
11135		this.element.hide();
11136
11137		// Create button
11138		this.button = $( "<span>", {
11139			"class": "ui-selectmenu-button ui-widget ui-state-default ui-corner-all",
11140			tabindex: this.options.disabled ? -1 : 0,
11141			id: this.ids.button,
11142			role: "combobox",
11143			"aria-expanded": "false",
11144			"aria-autocomplete": "list",
11145			"aria-owns": this.ids.menu,
11146			"aria-haspopup": "true"
11147		})
11148			.insertAfter( this.element );
11149
11150		$( "<span>", {
11151			"class": "ui-icon " + this.options.icons.button
11152		})
11153			.prependTo( this.button );
11154
11155		this.buttonText = $( "<span>", {
11156			"class": "ui-selectmenu-text"
11157		})
11158			.appendTo( this.button );
11159
11160		this._setText( this.buttonText, this.element.find( "option:selected" ).text() );
11161		this._resizeButton();
11162
11163		this._on( this.button, this._buttonEvents );
11164		this.button.one( "focusin", function() {
11165
11166			// Delay rendering the menu items until the button receives focus.
11167			// The menu may have already been rendered via a programmatic open.
11168			if ( !that.menuItems ) {
11169				that._refreshMenu();
11170			}
11171		});
11172		this._hoverable( this.button );
11173		this._focusable( this.button );
11174	},
11175
11176	_drawMenu: function() {
11177		var that = this;
11178
11179		// Create menu
11180		this.menu = $( "<ul>", {
11181			"aria-hidden": "true",
11182			"aria-labelledby": this.ids.button,
11183			id: this.ids.menu
11184		});
11185
11186		// Wrap menu
11187		this.menuWrap = $( "<div>", {
11188			"class": "ui-selectmenu-menu ui-front"
11189		})
11190			.append( this.menu )
11191			.appendTo( this._appendTo() );
11192
11193		// Initialize menu widget
11194		this.menuInstance = this.menu
11195			.menu({
11196				role: "listbox",
11197				select: function( event, ui ) {
11198					event.preventDefault();
11199
11200					// support: IE8
11201					// If the item was selected via a click, the text selection
11202					// will be destroyed in IE
11203					that._setSelection();
11204
11205					that._select( ui.item.data( "ui-selectmenu-item" ), event );
11206				},
11207				focus: function( event, ui ) {
11208					var item = ui.item.data( "ui-selectmenu-item" );
11209
11210					// Prevent inital focus from firing and check if its a newly focused item
11211					if ( that.focusIndex != null && item.index !== that.focusIndex ) {
11212						that._trigger( "focus", event, { item: item } );
11213						if ( !that.isOpen ) {
11214							that._select( item, event );
11215						}
11216					}
11217					that.focusIndex = item.index;
11218
11219					that.button.attr( "aria-activedescendant",
11220						that.menuItems.eq( item.index ).attr( "id" ) );
11221				}
11222			})
11223			.menu( "instance" );
11224
11225		// Adjust menu styles to dropdown
11226		this.menu
11227			.addClass( "ui-corner-bottom" )
11228			.removeClass( "ui-corner-all" );
11229
11230		// Don't close the menu on mouseleave
11231		this.menuInstance._off( this.menu, "mouseleave" );
11232
11233		// Cancel the menu's collapseAll on document click
11234		this.menuInstance._closeOnDocumentClick = function() {
11235			return false;
11236		};
11237
11238		// Selects often contain empty items, but never contain dividers
11239		this.menuInstance._isDivider = function() {
11240			return false;
11241		};
11242	},
11243
11244	refresh: function() {
11245		this._refreshMenu();
11246		this._setText( this.buttonText, this._getSelectedItem().text() );
11247		if ( !this.options.width ) {
11248			this._resizeButton();
11249		}
11250	},
11251
11252	_refreshMenu: function() {
11253		this.menu.empty();
11254
11255		var item,
11256			options = this.element.find( "option" );
11257
11258		if ( !options.length ) {
11259			return;
11260		}
11261
11262		this._parseOptions( options );
11263		this._renderMenu( this.menu, this.items );
11264
11265		this.menuInstance.refresh();
11266		this.menuItems = this.menu.find( "li" ).not( ".ui-selectmenu-optgroup" );
11267
11268		item = this._getSelectedItem();
11269
11270		// Update the menu to have the correct item focused
11271		this.menuInstance.focus( null, item );
11272		this._setAria( item.data( "ui-selectmenu-item" ) );
11273
11274		// Set disabled state
11275		this._setOption( "disabled", this.element.prop( "disabled" ) );
11276	},
11277
11278	open: function( event ) {
11279		if ( this.options.disabled ) {
11280			return;
11281		}
11282
11283		// If this is the first time the menu is being opened, render the items
11284		if ( !this.menuItems ) {
11285			this._refreshMenu();
11286		} else {
11287
11288			// Menu clears focus on close, reset focus to selected item
11289			this.menu.find( ".ui-state-focus" ).removeClass( "ui-state-focus" );
11290			this.menuInstance.focus( null, this._getSelectedItem() );
11291		}
11292
11293		this.isOpen = true;
11294		this._toggleAttr();
11295		this._resizeMenu();
11296		this._position();
11297
11298		this._on( this.document, this._documentClick );
11299
11300		this._trigger( "open", event );
11301	},
11302
11303	_position: function() {
11304		this.menuWrap.position( $.extend( { of: this.button }, this.options.position ) );
11305	},
11306
11307	close: function( event ) {
11308		if ( !this.isOpen ) {
11309			return;
11310		}
11311
11312		this.isOpen = false;
11313		this._toggleAttr();
11314
11315		this.range = null;
11316		this._off( this.document );
11317
11318		this._trigger( "close", event );
11319	},
11320
11321	widget: function() {
11322		return this.button;
11323	},
11324
11325	menuWidget: function() {
11326		return this.menu;
11327	},
11328
11329	_renderMenu: function( ul, items ) {
11330		var that = this,
11331			currentOptgroup = "";
11332
11333		$.each( items, function( index, item ) {
11334			if ( item.optgroup !== currentOptgroup ) {
11335				$( "<li>", {
11336					"class": "ui-selectmenu-optgroup ui-menu-divider" +
11337						( item.element.parent( "optgroup" ).prop( "disabled" ) ?
11338							" ui-state-disabled" :
11339							"" ),
11340					text: item.optgroup
11341				})
11342					.appendTo( ul );
11343
11344				currentOptgroup = item.optgroup;
11345			}
11346
11347			that._renderItemData( ul, item );
11348		});
11349	},
11350
11351	_renderItemData: function( ul, item ) {
11352		return this._renderItem( ul, item ).data( "ui-selectmenu-item", item );
11353	},
11354
11355	_renderItem: function( ul, item ) {
11356		var li = $( "<li>" );
11357
11358		if ( item.disabled ) {
11359			li.addClass( "ui-state-disabled" );
11360		}
11361		this._setText( li, item.label );
11362
11363		return li.appendTo( ul );
11364	},
11365
11366	_setText: function( element, value ) {
11367		if ( value ) {
11368			element.text( value );
11369		} else {
11370			element.html( "&#160;" );
11371		}
11372	},
11373
11374	_move: function( direction, event ) {
11375		var item, next,
11376			filter = ".ui-menu-item";
11377
11378		if ( this.isOpen ) {
11379			item = this.menuItems.eq( this.focusIndex );
11380		} else {
11381			item = this.menuItems.eq( this.element[ 0 ].selectedIndex );
11382			filter += ":not(.ui-state-disabled)";
11383		}
11384
11385		if ( direction === "first" || direction === "last" ) {
11386			next = item[ direction === "first" ? "prevAll" : "nextAll" ]( filter ).eq( -1 );
11387		} else {
11388			next = item[ direction + "All" ]( filter ).eq( 0 );
11389		}
11390
11391		if ( next.length ) {
11392			this.menuInstance.focus( event, next );
11393		}
11394	},
11395
11396	_getSelectedItem: function() {
11397		return this.menuItems.eq( this.element[ 0 ].selectedIndex );
11398	},
11399
11400	_toggle: function( event ) {
11401		this[ this.isOpen ? "close" : "open" ]( event );
11402	},
11403
11404	_setSelection: function() {
11405		var selection;
11406
11407		if ( !this.range ) {
11408			return;
11409		}
11410
11411		if ( window.getSelection ) {
11412			selection = window.getSelection();
11413			selection.removeAllRanges();
11414			selection.addRange( this.range );
11415
11416		// support: IE8
11417		} else {
11418			this.range.select();
11419		}
11420
11421		// support: IE
11422		// Setting the text selection kills the button focus in IE, but
11423		// restoring the focus doesn't kill the selection.
11424		this.button.focus();
11425	},
11426
11427	_documentClick: {
11428		mousedown: function( event ) {
11429			if ( !this.isOpen ) {
11430				return;
11431			}
11432
11433			if ( !$( event.target ).closest( ".ui-selectmenu-menu, #" + this.ids.button ).length ) {
11434				this.close( event );
11435			}
11436		}
11437	},
11438
11439	_buttonEvents: {
11440
11441		// Prevent text selection from being reset when interacting with the selectmenu (#10144)
11442		mousedown: function() {
11443			var selection;
11444
11445			if ( window.getSelection ) {
11446				selection = window.getSelection();
11447				if ( selection.rangeCount ) {
11448					this.range = selection.getRangeAt( 0 );
11449				}
11450
11451			// support: IE8
11452			} else {
11453				this.range = document.selection.createRange();
11454			}
11455		},
11456
11457		click: function( event ) {
11458			this._setSelection();
11459			this._toggle( event );
11460		},
11461
11462		keydown: function( event ) {
11463			var preventDefault = true;
11464			switch ( event.keyCode ) {
11465				case $.ui.keyCode.TAB:
11466				case $.ui.keyCode.ESCAPE:
11467					this.close( event );
11468					preventDefault = false;
11469					break;
11470				case $.ui.keyCode.ENTER:
11471					if ( this.isOpen ) {
11472						this._selectFocusedItem( event );
11473					}
11474					break;
11475				case $.ui.keyCode.UP:
11476					if ( event.altKey ) {
11477						this._toggle( event );
11478					} else {
11479						this._move( "prev", event );
11480					}
11481					break;
11482				case $.ui.keyCode.DOWN:
11483					if ( event.altKey ) {
11484						this._toggle( event );
11485					} else {
11486						this._move( "next", event );
11487					}
11488					break;
11489				case $.ui.keyCode.SPACE:
11490					if ( this.isOpen ) {
11491						this._selectFocusedItem( event );
11492					} else {
11493						this._toggle( event );
11494					}
11495					break;
11496				case $.ui.keyCode.LEFT:
11497					this._move( "prev", event );
11498					break;
11499				case $.ui.keyCode.RIGHT:
11500					this._move( "next", event );
11501					break;
11502				case $.ui.keyCode.HOME:
11503				case $.ui.keyCode.PAGE_UP:
11504					this._move( "first", event );
11505					break;
11506				case $.ui.keyCode.END:
11507				case $.ui.keyCode.PAGE_DOWN:
11508					this._move( "last", event );
11509					break;
11510				default:
11511					this.menu.trigger( event );
11512					preventDefault = false;
11513			}
11514
11515			if ( preventDefault ) {
11516				event.preventDefault();
11517			}
11518		}
11519	},
11520
11521	_selectFocusedItem: function( event ) {
11522		var item = this.menuItems.eq( this.focusIndex );
11523		if ( !item.hasClass( "ui-state-disabled" ) ) {
11524			this._select( item.data( "ui-selectmenu-item" ), event );
11525		}
11526	},
11527
11528	_select: function( item, event ) {
11529		var oldIndex = this.element[ 0 ].selectedIndex;
11530
11531		// Change native select element
11532		this.element[ 0 ].selectedIndex = item.index;
11533		this._setText( this.buttonText, item.label );
11534		this._setAria( item );
11535		this._trigger( "select", event, { item: item } );
11536
11537		if ( item.index !== oldIndex ) {
11538			this._trigger( "change", event, { item: item } );
11539		}
11540
11541		this.close( event );
11542	},
11543
11544	_setAria: function( item ) {
11545		var id = this.menuItems.eq( item.index ).attr( "id" );
11546
11547		this.button.attr({
11548			"aria-labelledby": id,
11549			"aria-activedescendant": id
11550		});
11551		this.menu.attr( "aria-activedescendant", id );
11552	},
11553
11554	_setOption: function( key, value ) {
11555		if ( key === "icons" ) {
11556			this.button.find( "span.ui-icon" )
11557				.removeClass( this.options.icons.button )
11558				.addClass( value.button );
11559		}
11560
11561		this._super( key, value );
11562
11563		if ( key === "appendTo" ) {
11564			this.menuWrap.appendTo( this._appendTo() );
11565		}
11566
11567		if ( key === "disabled" ) {
11568			this.menuInstance.option( "disabled", value );
11569			this.button
11570				.toggleClass( "ui-state-disabled", value )
11571				.attr( "aria-disabled", value );
11572
11573			this.element.prop( "disabled", value );
11574			if ( value ) {
11575				this.button.attr( "tabindex", -1 );
11576				this.close();
11577			} else {
11578				this.button.attr( "tabindex", 0 );
11579			}
11580		}
11581
11582		if ( key === "width" ) {
11583			this._resizeButton();
11584		}
11585	},
11586
11587	_appendTo: function() {
11588		var element = this.options.appendTo;
11589
11590		if ( element ) {
11591			element = element.jquery || element.nodeType ?
11592				$( element ) :
11593				this.document.find( element ).eq( 0 );
11594		}
11595
11596		if ( !element || !element[ 0 ] ) {
11597			element = this.element.closest( ".ui-front" );
11598		}
11599
11600		if ( !element.length ) {
11601			element = this.document[ 0 ].body;
11602		}
11603
11604		return element;
11605	},
11606
11607	_toggleAttr: function() {
11608		this.button
11609			.toggleClass( "ui-corner-top", this.isOpen )
11610			.toggleClass( "ui-corner-all", !this.isOpen )
11611			.attr( "aria-expanded", this.isOpen );
11612		this.menuWrap.toggleClass( "ui-selectmenu-open", this.isOpen );
11613		this.menu.attr( "aria-hidden", !this.isOpen );
11614	},
11615
11616	_resizeButton: function() {
11617		var width = this.options.width;
11618
11619		if ( !width ) {
11620			width = this.element.show().outerWidth();
11621			this.element.hide();
11622		}
11623
11624		this.button.outerWidth( width );
11625	},
11626
11627	_resizeMenu: function() {
11628		this.menu.outerWidth( Math.max(
11629			this.button.outerWidth(),
11630
11631			// support: IE10
11632			// IE10 wraps long text (possibly a rounding bug)
11633			// so we add 1px to avoid the wrapping
11634			this.menu.width( "" ).outerWidth() + 1
11635		) );
11636	},
11637
11638	_getCreateOptions: function() {
11639		return { disabled: this.element.prop( "disabled" ) };
11640	},
11641
11642	_parseOptions: function( options ) {
11643		var data = [];
11644		options.each(function( index, item ) {
11645			var option = $( item ),
11646				optgroup = option.parent( "optgroup" );
11647			data.push({
11648				element: option,
11649				index: index,
11650				value: option.val(),
11651				label: option.text(),
11652				optgroup: optgroup.attr( "label" ) || "",
11653				disabled: optgroup.prop( "disabled" ) || option.prop( "disabled" )
11654			});
11655		});
11656		this.items = data;
11657	},
11658
11659	_destroy: function() {
11660		this.menuWrap.remove();
11661		this.button.remove();
11662		this.element.show();
11663		this.element.removeUniqueId();
11664		this.label.attr( "for", this.ids.element );
11665	}
11666});
11667
11668
11669/*!
11670 * jQuery UI Slider 1.11.4
11671 * http://jqueryui.com
11672 *
11673 * Copyright jQuery Foundation and other contributors
11674 * Released under the MIT license.
11675 * http://jquery.org/license
11676 *
11677 * http://api.jqueryui.com/slider/
11678 */
11679
11680
11681var slider = $.widget( "ui.slider", $.ui.mouse, {
11682	version: "1.11.4",
11683	widgetEventPrefix: "slide",
11684
11685	options: {
11686		animate: false,
11687		distance: 0,
11688		max: 100,
11689		min: 0,
11690		orientation: "horizontal",
11691		range: false,
11692		step: 1,
11693		value: 0,
11694		values: null,
11695
11696		// callbacks
11697		change: null,
11698		slide: null,
11699		start: null,
11700		stop: null
11701	},
11702
11703	// number of pages in a slider
11704	// (how many times can you page up/down to go through the whole range)
11705	numPages: 5,
11706
11707	_create: function() {
11708		this._keySliding = false;
11709		this._mouseSliding = false;
11710		this._animateOff = true;
11711		this._handleIndex = null;
11712		this._detectOrientation();
11713		this._mouseInit();
11714		this._calculateNewMax();
11715
11716		this.element
11717			.addClass( "ui-slider" +
11718				" ui-slider-" + this.orientation +
11719				" ui-widget" +
11720				" ui-widget-content" +
11721				" ui-corner-all");
11722
11723		this._refresh();
11724		this._setOption( "disabled", this.options.disabled );
11725
11726		this._animateOff = false;
11727	},
11728
11729	_refresh: function() {
11730		this._createRange();
11731		this._createHandles();
11732		this._setupEvents();
11733		this._refreshValue();
11734	},
11735
11736	_createHandles: function() {
11737		var i, handleCount,
11738			options = this.options,
11739			existingHandles = this.element.find( ".ui-slider-handle" ).addClass( "ui-state-default ui-corner-all" ),
11740			handle = "<span class='ui-slider-handle ui-state-default ui-corner-all' tabindex='0'></span>",
11741			handles = [];
11742
11743		handleCount = ( options.values && options.values.length ) || 1;
11744
11745		if ( existingHandles.length > handleCount ) {
11746			existingHandles.slice( handleCount ).remove();
11747			existingHandles = existingHandles.slice( 0, handleCount );
11748		}
11749
11750		for ( i = existingHandles.length; i < handleCount; i++ ) {
11751			handles.push( handle );
11752		}
11753
11754		this.handles = existingHandles.add( $( handles.join( "" ) ).appendTo( this.element ) );
11755
11756		this.handle = this.handles.eq( 0 );
11757
11758		this.handles.each(function( i ) {
11759			$( this ).data( "ui-slider-handle-index", i );
11760		});
11761	},
11762
11763	_createRange: function() {
11764		var options = this.options,
11765			classes = "";
11766
11767		if ( options.range ) {
11768			if ( options.range === true ) {
11769				if ( !options.values ) {
11770					options.values = [ this._valueMin(), this._valueMin() ];
11771				} else if ( options.values.length && options.values.length !== 2 ) {
11772					options.values = [ options.values[0], options.values[0] ];
11773				} else if ( $.isArray( options.values ) ) {
11774					options.values = options.values.slice(0);
11775				}
11776			}
11777
11778			if ( !this.range || !this.range.length ) {
11779				this.range = $( "<div></div>" )
11780					.appendTo( this.element );
11781
11782				classes = "ui-slider-range" +
11783				// note: this isn't the most fittingly semantic framework class for this element,
11784				// but worked best visually with a variety of themes
11785				" ui-widget-header ui-corner-all";
11786			} else {
11787				this.range.removeClass( "ui-slider-range-min ui-slider-range-max" )
11788					// Handle range switching from true to min/max
11789					.css({
11790						"left": "",
11791						"bottom": ""
11792					});
11793			}
11794
11795			this.range.addClass( classes +
11796				( ( options.range === "min" || options.range === "max" ) ? " ui-slider-range-" + options.range : "" ) );
11797		} else {
11798			if ( this.range ) {
11799				this.range.remove();
11800			}
11801			this.range = null;
11802		}
11803	},
11804
11805	_setupEvents: function() {
11806		this._off( this.handles );
11807		this._on( this.handles, this._handleEvents );
11808		this._hoverable( this.handles );
11809		this._focusable( this.handles );
11810	},
11811
11812	_destroy: function() {
11813		this.handles.remove();
11814		if ( this.range ) {
11815			this.range.remove();
11816		}
11817
11818		this.element
11819			.removeClass( "ui-slider" +
11820				" ui-slider-horizontal" +
11821				" ui-slider-vertical" +
11822				" ui-widget" +
11823				" ui-widget-content" +
11824				" ui-corner-all" );
11825
11826		this._mouseDestroy();
11827	},
11828
11829	_mouseCapture: function( event ) {
11830		var position, normValue, distance, closestHandle, index, allowed, offset, mouseOverHandle,
11831			that = this,
11832			o = this.options;
11833
11834		if ( o.disabled ) {
11835			return false;
11836		}
11837
11838		this.elementSize = {
11839			width: this.element.outerWidth(),
11840			height: this.element.outerHeight()
11841		};
11842		this.elementOffset = this.element.offset();
11843
11844		position = { x: event.pageX, y: event.pageY };
11845		normValue = this._normValueFromMouse( position );
11846		distance = this._valueMax() - this._valueMin() + 1;
11847		this.handles.each(function( i ) {
11848			var thisDistance = Math.abs( normValue - that.values(i) );
11849			if (( distance > thisDistance ) ||
11850				( distance === thisDistance &&
11851					(i === that._lastChangedValue || that.values(i) === o.min ))) {
11852				distance = thisDistance;
11853				closestHandle = $( this );
11854				index = i;
11855			}
11856		});
11857
11858		allowed = this._start( event, index );
11859		if ( allowed === false ) {
11860			return false;
11861		}
11862		this._mouseSliding = true;
11863
11864		this._handleIndex = index;
11865
11866		closestHandle
11867			.addClass( "ui-state-active" )
11868			.focus();
11869
11870		offset = closestHandle.offset();
vendor: 4,641 bytes, lines 11871-12043
11871		mouseOverHandle = !$( event.target ).parents().addBack().is( ".ui-slider-handle" );
11872		this._clickOffset = mouseOverHandle ? { left: 0, top: 0 } : {
11873			left: event.pageX - offset.left - ( closestHandle.width() / 2 ),
11874			top: event.pageY - offset.top -
11875				( closestHandle.height() / 2 ) -
11876				( parseInt( closestHandle.css("borderTopWidth"), 10 ) || 0 ) -
11877				( parseInt( closestHandle.css("borderBottomWidth"), 10 ) || 0) +
11878				( parseInt( closestHandle.css("marginTop"), 10 ) || 0)
11879		};
11880
11881		if ( !this.handles.hasClass( "ui-state-hover" ) ) {
11882			this._slide( event, index, normValue );
11883		}
11884		this._animateOff = true;
11885		return true;
11886	},
11887
11888	_mouseStart: function() {
11889		return true;
11890	},
11891
11892	_mouseDrag: function( event ) {
11893		var position = { x: event.pageX, y: event.pageY },
11894			normValue = this._normValueFromMouse( position );
11895
11896		this._slide( event, this._handleIndex, normValue );
11897
11898		return false;
11899	},
11900
11901	_mouseStop: function( event ) {
11902		this.handles.removeClass( "ui-state-active" );
11903		this._mouseSliding = false;
11904
11905		this._stop( event, this._handleIndex );
11906		this._change( event, this._handleIndex );
11907
11908		this._handleIndex = null;
11909		this._clickOffset = null;
11910		this._animateOff = false;
11911
11912		return false;
11913	},
11914
11915	_detectOrientation: function() {
11916		this.orientation = ( this.options.orientation === "vertical" ) ? "vertical" : "horizontal";
11917	},
11918
11919	_normValueFromMouse: function( position ) {
11920		var pixelTotal,
11921			pixelMouse,
11922			percentMouse,
11923			valueTotal,
11924			valueMouse;
11925
11926		if ( this.orientation === "horizontal" ) {
11927			pixelTotal = this.elementSize.width;
11928			pixelMouse = position.x - this.elementOffset.left - ( this._clickOffset ? this._clickOffset.left : 0 );
11929		} else {
11930			pixelTotal = this.elementSize.height;
11931			pixelMouse = position.y - this.elementOffset.top - ( this._clickOffset ? this._clickOffset.top : 0 );
11932		}
11933
11934		percentMouse = ( pixelMouse / pixelTotal );
11935		if ( percentMouse > 1 ) {
11936			percentMouse = 1;
11937		}
11938		if ( percentMouse < 0 ) {
11939			percentMouse = 0;
11940		}
11941		if ( this.orientation === "vertical" ) {
11942			percentMouse = 1 - percentMouse;
11943		}
11944
11945		valueTotal = this._valueMax() - this._valueMin();
11946		valueMouse = this._valueMin() + percentMouse * valueTotal;
11947
11948		return this._trimAlignValue( valueMouse );
11949	},
11950
11951	_start: function( event, index ) {
11952		var uiHash = {
11953			handle: this.handles[ index ],
11954			value: this.value()
11955		};
11956		if ( this.options.values && this.options.values.length ) {
11957			uiHash.value = this.values( index );
11958			uiHash.values = this.values();
11959		}
11960		return this._trigger( "start", event, uiHash );
11961	},
11962
11963	_slide: function( event, index, newVal ) {
11964		var otherVal,
11965			newValues,
11966			allowed;
11967
11968		if ( this.options.values && this.options.values.length ) {
11969			otherVal = this.values( index ? 0 : 1 );
11970
11971			if ( ( this.options.values.length === 2 && this.options.range === true ) &&
11972					( ( index === 0 && newVal > otherVal) || ( index === 1 && newVal < otherVal ) )
11973				) {
11974				newVal = otherVal;
11975			}
11976
11977			if ( newVal !== this.values( index ) ) {
11978				newValues = this.values();
11979				newValues[ index ] = newVal;
11980				// A slide can be canceled by returning false from the slide callback
11981				allowed = this._trigger( "slide", event, {
11982					handle: this.handles[ index ],
11983					value: newVal,
11984					values: newValues
11985				} );
11986				otherVal = this.values( index ? 0 : 1 );
11987				if ( allowed !== false ) {
11988					this.values( index, newVal );
11989				}
11990			}
11991		} else {
11992			if ( newVal !== this.value() ) {
11993				// A slide can be canceled by returning false from the slide callback
11994				allowed = this._trigger( "slide", event, {
11995					handle: this.handles[ index ],
11996					value: newVal
11997				} );
11998				if ( allowed !== false ) {
11999					this.value( newVal );
12000				}
12001			}
12002		}
12003	},
12004
12005	_stop: function( event, index ) {
12006		var uiHash = {
12007			handle: this.handles[ index ],
12008			value: this.value()
12009		};
12010		if ( this.options.values && this.options.values.length ) {
12011			uiHash.value = this.values( index );
12012			uiHash.values = this.values();
12013		}
12014
12015		this._trigger( "stop", event, uiHash );
12016	},
12017
12018	_change: function( event, index ) {
12019		if ( !this._keySliding && !this._mouseSliding ) {
12020			var uiHash = {
12021				handle: this.handles[ index ],
12022				value: this.value()
12023			};
12024			if ( this.options.values && this.options.values.length ) {
12025				uiHash.value = this.values( index );
12026				uiHash.values = this.values();
12027			}
12028
12029			//store the last changed value index for reference when handles overlap
12030			this._lastChangedValue = index;
12031
12032			this._trigger( "change", event, uiHash );
12033		}
12034	},
12035
12036	value: function( newValue ) {
12037		if ( arguments.length ) {
12038			this.options.value = this._trimAlignValue( newValue );
12039			this._refreshValue();
12040			this._change( null, 0 );
12041			return;
12042		}
12043
vendor: 34,569 bytes, lines 12044-13342
12044		return this._value();
12045	},
12046
12047	values: function( index, newValue ) {
12048		var vals,
12049			newValues,
12050			i;
12051
12052		if ( arguments.length > 1 ) {
12053			this.options.values[ index ] = this._trimAlignValue( newValue );
12054			this._refreshValue();
12055			this._change( null, index );
12056			return;
12057		}
12058
12059		if ( arguments.length ) {
12060			if ( $.isArray( arguments[ 0 ] ) ) {
12061				vals = this.options.values;
12062				newValues = arguments[ 0 ];
12063				for ( i = 0; i < vals.length; i += 1 ) {
12064					vals[ i ] = this._trimAlignValue( newValues[ i ] );
12065					this._change( null, i );
12066				}
12067				this._refreshValue();
12068			} else {
12069				if ( this.options.values && this.options.values.length ) {
12070					return this._values( index );
12071				} else {
12072					return this.value();
12073				}
12074			}
12075		} else {
12076			return this._values();
12077		}
12078	},
12079
12080	_setOption: function( key, value ) {
12081		var i,
12082			valsLength = 0;
12083
12084		if ( key === "range" && this.options.range === true ) {
12085			if ( value === "min" ) {
12086				this.options.value = this._values( 0 );
12087				this.options.values = null;
12088			} else if ( value === "max" ) {
12089				this.options.value = this._values( this.options.values.length - 1 );
12090				this.options.values = null;
12091			}
12092		}
12093
12094		if ( $.isArray( this.options.values ) ) {
12095			valsLength = this.options.values.length;
12096		}
12097
12098		if ( key === "disabled" ) {
12099			this.element.toggleClass( "ui-state-disabled", !!value );
12100		}
12101
12102		this._super( key, value );
12103
12104		switch ( key ) {
12105			case "orientation":
12106				this._detectOrientation();
12107				this.element
12108					.removeClass( "ui-slider-horizontal ui-slider-vertical" )
12109					.addClass( "ui-slider-" + this.orientation );
12110				this._refreshValue();
12111
12112				// Reset positioning from previous orientation
12113				this.handles.css( value === "horizontal" ? "bottom" : "left", "" );
12114				break;
12115			case "value":
12116				this._animateOff = true;
12117				this._refreshValue();
12118				this._change( null, 0 );
12119				this._animateOff = false;
12120				break;
12121			case "values":
12122				this._animateOff = true;
12123				this._refreshValue();
12124				for ( i = 0; i < valsLength; i += 1 ) {
12125					this._change( null, i );
12126				}
12127				this._animateOff = false;
12128				break;
12129			case "step":
12130			case "min":
12131			case "max":
12132				this._animateOff = true;
12133				this._calculateNewMax();
12134				this._refreshValue();
12135				this._animateOff = false;
12136				break;
12137			case "range":
12138				this._animateOff = true;
12139				this._refresh();
12140				this._animateOff = false;
12141				break;
12142		}
12143	},
12144
12145	//internal value getter
12146	// _value() returns value trimmed by min and max, aligned by step
12147	_value: function() {
12148		var val = this.options.value;
12149		val = this._trimAlignValue( val );
12150
12151		return val;
12152	},
12153
12154	//internal values getter
12155	// _values() returns array of values trimmed by min and max, aligned by step
12156	// _values( index ) returns single value trimmed by min and max, aligned by step
12157	_values: function( index ) {
12158		var val,
12159			vals,
12160			i;
12161
12162		if ( arguments.length ) {
12163			val = this.options.values[ index ];
12164			val = this._trimAlignValue( val );
12165
12166			return val;
12167		} else if ( this.options.values && this.options.values.length ) {
12168			// .slice() creates a copy of the array
12169			// this copy gets trimmed by min and max and then returned
12170			vals = this.options.values.slice();
12171			for ( i = 0; i < vals.length; i += 1) {
12172				vals[ i ] = this._trimAlignValue( vals[ i ] );
12173			}
12174
12175			return vals;
12176		} else {
12177			return [];
12178		}
12179	},
12180
12181	// returns the step-aligned value that val is closest to, between (inclusive) min and max
12182	_trimAlignValue: function( val ) {
12183		if ( val <= this._valueMin() ) {
12184			return this._valueMin();
12185		}
12186		if ( val >= this._valueMax() ) {
12187			return this._valueMax();
12188		}
12189		var step = ( this.options.step > 0 ) ? this.options.step : 1,
12190			valModStep = (val - this._valueMin()) % step,
12191			alignValue = val - valModStep;
12192
12193		if ( Math.abs(valModStep) * 2 >= step ) {
12194			alignValue += ( valModStep > 0 ) ? step : ( -step );
12195		}
12196
12197		// Since JavaScript has problems with large floats, round
12198		// the final value to 5 digits after the decimal point (see #4124)
12199		return parseFloat( alignValue.toFixed(5) );
12200	},
12201
12202	_calculateNewMax: function() {
12203		var max = this.options.max,
12204			min = this._valueMin(),
12205			step = this.options.step,
12206			aboveMin = Math.floor( ( +( max - min ).toFixed( this._precision() ) ) / step ) * step;
12207		max = aboveMin + min;
12208		this.max = parseFloat( max.toFixed( this._precision() ) );
12209	},
12210
12211	_precision: function() {
12212		var precision = this._precisionOf( this.options.step );
12213		if ( this.options.min !== null ) {
12214			precision = Math.max( precision, this._precisionOf( this.options.min ) );
12215		}
12216		return precision;
12217	},
12218
12219	_precisionOf: function( num ) {
12220		var str = num.toString(),
12221			decimal = str.indexOf( "." );
12222		return decimal === -1 ? 0 : str.length - decimal - 1;
12223	},
12224
12225	_valueMin: function() {
12226		return this.options.min;
12227	},
12228
12229	_valueMax: function() {
12230		return this.max;
12231	},
12232
12233	_refreshValue: function() {
12234		var lastValPercent, valPercent, value, valueMin, valueMax,
12235			oRange = this.options.range,
12236			o = this.options,
12237			that = this,
12238			animate = ( !this._animateOff ) ? o.animate : false,
12239			_set = {};
12240
12241		if ( this.options.values && this.options.values.length ) {
12242			this.handles.each(function( i ) {
12243				valPercent = ( that.values(i) - that._valueMin() ) / ( that._valueMax() - that._valueMin() ) * 100;
12244				_set[ that.orientation === "horizontal" ? "left" : "bottom" ] = valPercent + "%";
12245				$( this ).stop( 1, 1 )[ animate ? "animate" : "css" ]( _set, o.animate );
12246				if ( that.options.range === true ) {
12247					if ( that.orientation === "horizontal" ) {
12248						if ( i === 0 ) {
12249							that.range.stop( 1, 1 )[ animate ? "animate" : "css" ]( { left: valPercent + "%" }, o.animate );
12250						}
12251						if ( i === 1 ) {
12252							that.range[ animate ? "animate" : "css" ]( { width: ( valPercent - lastValPercent ) + "%" }, { queue: false, duration: o.animate } );
12253						}
12254					} else {
12255						if ( i === 0 ) {
12256							that.range.stop( 1, 1 )[ animate ? "animate" : "css" ]( { bottom: ( valPercent ) + "%" }, o.animate );
12257						}
12258						if ( i === 1 ) {
12259							that.range[ animate ? "animate" : "css" ]( { height: ( valPercent - lastValPercent ) + "%" }, { queue: false, duration: o.animate } );
12260						}
12261					}
12262				}
12263				lastValPercent = valPercent;
12264			});
12265		} else {
12266			value = this.value();
12267			valueMin = this._valueMin();
12268			valueMax = this._valueMax();
12269			valPercent = ( valueMax !== valueMin ) ?
12270					( value - valueMin ) / ( valueMax - valueMin ) * 100 :
12271					0;
12272			_set[ this.orientation === "horizontal" ? "left" : "bottom" ] = valPercent + "%";
12273			this.handle.stop( 1, 1 )[ animate ? "animate" : "css" ]( _set, o.animate );
12274
12275			if ( oRange === "min" && this.orientation === "horizontal" ) {
12276				this.range.stop( 1, 1 )[ animate ? "animate" : "css" ]( { width: valPercent + "%" }, o.animate );
12277			}
12278			if ( oRange === "max" && this.orientation === "horizontal" ) {
12279				this.range[ animate ? "animate" : "css" ]( { width: ( 100 - valPercent ) + "%" }, { queue: false, duration: o.animate } );
12280			}
12281			if ( oRange === "min" && this.orientation === "vertical" ) {
12282				this.range.stop( 1, 1 )[ animate ? "animate" : "css" ]( { height: valPercent + "%" }, o.animate );
12283			}
12284			if ( oRange === "max" && this.orientation === "vertical" ) {
12285				this.range[ animate ? "animate" : "css" ]( { height: ( 100 - valPercent ) + "%" }, { queue: false, duration: o.animate } );
12286			}
12287		}
12288	},
12289
12290	_handleEvents: {
12291		keydown: function( event ) {
12292			var allowed, curVal, newVal, step,
12293				index = $( event.target ).data( "ui-slider-handle-index" );
12294
12295			switch ( event.keyCode ) {
12296				case $.ui.keyCode.HOME:
12297				case $.ui.keyCode.END:
12298				case $.ui.keyCode.PAGE_UP:
12299				case $.ui.keyCode.PAGE_DOWN:
12300				case $.ui.keyCode.UP:
12301				case $.ui.keyCode.RIGHT:
12302				case $.ui.keyCode.DOWN:
12303				case $.ui.keyCode.LEFT:
12304					event.preventDefault();
12305					if ( !this._keySliding ) {
12306						this._keySliding = true;
12307						$( event.target ).addClass( "ui-state-active" );
12308						allowed = this._start( event, index );
12309						if ( allowed === false ) {
12310							return;
12311						}
12312					}
12313					break;
12314			}
12315
12316			step = this.options.step;
12317			if ( this.options.values && this.options.values.length ) {
12318				curVal = newVal = this.values( index );
12319			} else {
12320				curVal = newVal = this.value();
12321			}
12322
12323			switch ( event.keyCode ) {
12324				case $.ui.keyCode.HOME:
12325					newVal = this._valueMin();
12326					break;
12327				case $.ui.keyCode.END:
12328					newVal = this._valueMax();
12329					break;
12330				case $.ui.keyCode.PAGE_UP:
12331					newVal = this._trimAlignValue(
12332						curVal + ( ( this._valueMax() - this._valueMin() ) / this.numPages )
12333					);
12334					break;
12335				case $.ui.keyCode.PAGE_DOWN:
12336					newVal = this._trimAlignValue(
12337						curVal - ( (this._valueMax() - this._valueMin()) / this.numPages ) );
12338					break;
12339				case $.ui.keyCode.UP:
12340				case $.ui.keyCode.RIGHT:
12341					if ( curVal === this._valueMax() ) {
12342						return;
12343					}
12344					newVal = this._trimAlignValue( curVal + step );
12345					break;
12346				case $.ui.keyCode.DOWN:
12347				case $.ui.keyCode.LEFT:
12348					if ( curVal === this._valueMin() ) {
12349						return;
12350					}
12351					newVal = this._trimAlignValue( curVal - step );
12352					break;
12353			}
12354
12355			this._slide( event, index, newVal );
12356		},
12357		keyup: function( event ) {
12358			var index = $( event.target ).data( "ui-slider-handle-index" );
12359
12360			if ( this._keySliding ) {
12361				this._keySliding = false;
12362				this._stop( event, index );
12363				this._change( event, index );
12364				$( event.target ).removeClass( "ui-state-active" );
12365			}
12366		}
12367	}
12368});
12369
12370
12371/*!
12372 * jQuery UI Spinner 1.11.4
12373 * http://jqueryui.com
12374 *
12375 * Copyright jQuery Foundation and other contributors
12376 * Released under the MIT license.
12377 * http://jquery.org/license
12378 *
12379 * http://api.jqueryui.com/spinner/
12380 */
12381
12382
12383function spinner_modifier( fn ) {
12384	return function() {
12385		var previous = this.element.val();
12386		fn.apply( this, arguments );
12387		this._refresh();
12388		if ( previous !== this.element.val() ) {
12389			this._trigger( "change" );
12390		}
12391	};
12392}
12393
12394var spinner = $.widget( "ui.spinner", {
12395	version: "1.11.4",
12396	defaultElement: "<input>",
12397	widgetEventPrefix: "spin",
12398	options: {
12399		culture: null,
12400		icons: {
12401			down: "ui-icon-triangle-1-s",
12402			up: "ui-icon-triangle-1-n"
12403		},
12404		incremental: true,
12405		max: null,
12406		min: null,
12407		numberFormat: null,
12408		page: 10,
12409		step: 1,
12410
12411		change: null,
12412		spin: null,
12413		start: null,
12414		stop: null
12415	},
12416
12417	_create: function() {
12418		// handle string values that need to be parsed
12419		this._setOption( "max", this.options.max );
12420		this._setOption( "min", this.options.min );
12421		this._setOption( "step", this.options.step );
12422
12423		// Only format if there is a value, prevents the field from being marked
12424		// as invalid in Firefox, see #9573.
12425		if ( this.value() !== "" ) {
12426			// Format the value, but don't constrain.
12427			this._value( this.element.val(), true );
12428		}
12429
12430		this._draw();
12431		this._on( this._events );
12432		this._refresh();
12433
12434		// turning off autocomplete prevents the browser from remembering the
12435		// value when navigating through history, so we re-enable autocomplete
12436		// if the page is unloaded before the widget is destroyed. #7790
12437		this._on( this.window, {
12438			beforeunload: function() {
12439				this.element.removeAttr( "autocomplete" );
12440			}
12441		});
12442	},
12443
12444	_getCreateOptions: function() {
12445		var options = {},
12446			element = this.element;
12447
12448		$.each( [ "min", "max", "step" ], function( i, option ) {
12449			var value = element.attr( option );
12450			if ( value !== undefined && value.length ) {
12451				options[ option ] = value;
12452			}
12453		});
12454
12455		return options;
12456	},
12457
12458	_events: {
12459		keydown: function( event ) {
12460			if ( this._start( event ) && this._keydown( event ) ) {
12461				event.preventDefault();
12462			}
12463		},
12464		keyup: "_stop",
12465		focus: function() {
12466			this.previous = this.element.val();
12467		},
12468		blur: function( event ) {
12469			if ( this.cancelBlur ) {
12470				delete this.cancelBlur;
12471				return;
12472			}
12473
12474			this._stop();
12475			this._refresh();
12476			if ( this.previous !== this.element.val() ) {
12477				this._trigger( "change", event );
12478			}
12479		},
12480		mousewheel: function( event, delta ) {
12481			if ( !delta ) {
12482				return;
12483			}
12484			if ( !this.spinning && !this._start( event ) ) {
12485				return false;
12486			}
12487
12488			this._spin( (delta > 0 ? 1 : -1) * this.options.step, event );
12489			clearTimeout( this.mousewheelTimer );
12490			this.mousewheelTimer = this._delay(function() {
12491				if ( this.spinning ) {
12492					this._stop( event );
12493				}
12494			}, 100 );
12495			event.preventDefault();
12496		},
12497		"mousedown .ui-spinner-button": function( event ) {
12498			var previous;
12499
12500			// We never want the buttons to have focus; whenever the user is
12501			// interacting with the spinner, the focus should be on the input.
12502			// If the input is focused then this.previous is properly set from
12503			// when the input first received focus. If the input is not focused
12504			// then we need to set this.previous based on the value before spinning.
12505			previous = this.element[0] === this.document[0].activeElement ?
12506				this.previous : this.element.val();
12507			function checkFocus() {
12508				var isActive = this.element[0] === this.document[0].activeElement;
12509				if ( !isActive ) {
12510					this.element.focus();
12511					this.previous = previous;
12512					// support: IE
12513					// IE sets focus asynchronously, so we need to check if focus
12514					// moved off of the input because the user clicked on the button.
12515					this._delay(function() {
12516						this.previous = previous;
12517					});
12518				}
12519			}
12520
12521			// ensure focus is on (or stays on) the text field
12522			event.preventDefault();
12523			checkFocus.call( this );
12524
12525			// support: IE
12526			// IE doesn't prevent moving focus even with event.preventDefault()
12527			// so we set a flag to know when we should ignore the blur event
12528			// and check (again) if focus moved off of the input.
12529			this.cancelBlur = true;
12530			this._delay(function() {
12531				delete this.cancelBlur;
12532				checkFocus.call( this );
12533			});
12534
12535			if ( this._start( event ) === false ) {
12536				return;
12537			}
12538
12539			this._repeat( null, $( event.currentTarget ).hasClass( "ui-spinner-up" ) ? 1 : -1, event );
12540		},
12541		"mouseup .ui-spinner-button": "_stop",
12542		"mouseenter .ui-spinner-button": function( event ) {
12543			// button will add ui-state-active if mouse was down while mouseleave and kept down
12544			if ( !$( event.currentTarget ).hasClass( "ui-state-active" ) ) {
12545				return;
12546			}
12547
12548			if ( this._start( event ) === false ) {
12549				return false;
12550			}
12551			this._repeat( null, $( event.currentTarget ).hasClass( "ui-spinner-up" ) ? 1 : -1, event );
12552		},
12553		// TODO: do we really want to consider this a stop?
12554		// shouldn't we just stop the repeater and wait until mouseup before
12555		// we trigger the stop event?
12556		"mouseleave .ui-spinner-button": "_stop"
12557	},
12558
12559	_draw: function() {
12560		var uiSpinner = this.uiSpinner = this.element
12561			.addClass( "ui-spinner-input" )
12562			.attr( "autocomplete", "off" )
12563			.wrap( this._uiSpinnerHtml() )
12564			.parent()
12565				// add buttons
12566				.append( this._buttonHtml() );
12567
12568		this.element.attr( "role", "spinbutton" );
12569
12570		// button bindings
12571		this.buttons = uiSpinner.find( ".ui-spinner-button" )
12572			.attr( "tabIndex", -1 )
12573			.button()
12574			.removeClass( "ui-corner-all" );
12575
12576		// IE 6 doesn't understand height: 50% for the buttons
12577		// unless the wrapper has an explicit height
12578		if ( this.buttons.height() > Math.ceil( uiSpinner.height() * 0.5 ) &&
12579				uiSpinner.height() > 0 ) {
12580			uiSpinner.height( uiSpinner.height() );
12581		}
12582
12583		// disable spinner if element was already disabled
12584		if ( this.options.disabled ) {
12585			this.disable();
12586		}
12587	},
12588
12589	_keydown: function( event ) {
12590		var options = this.options,
12591			keyCode = $.ui.keyCode;
12592
12593		switch ( event.keyCode ) {
12594		case keyCode.UP:
12595			this._repeat( null, 1, event );
12596			return true;
12597		case keyCode.DOWN:
12598			this._repeat( null, -1, event );
12599			return true;
12600		case keyCode.PAGE_UP:
12601			this._repeat( null, options.page, event );
12602			return true;
12603		case keyCode.PAGE_DOWN:
12604			this._repeat( null, -options.page, event );
12605			return true;
12606		}
12607
12608		return false;
12609	},
12610
12611	_uiSpinnerHtml: function() {
12612		return "<span class='ui-spinner ui-widget ui-widget-content ui-corner-all'></span>";
12613	},
12614
12615	_buttonHtml: function() {
12616		return "" +
12617			"<a class='ui-spinner-button ui-spinner-up ui-corner-tr'>" +
12618				"<span class='ui-icon " + this.options.icons.up + "'>&#9650;</span>" +
12619			"</a>" +
12620			"<a class='ui-spinner-button ui-spinner-down ui-corner-br'>" +
12621				"<span class='ui-icon " + this.options.icons.down + "'>&#9660;</span>" +
12622			"</a>";
12623	},
12624
12625	_start: function( event ) {
12626		if ( !this.spinning && this._trigger( "start", event ) === false ) {
12627			return false;
12628		}
12629
12630		if ( !this.counter ) {
12631			this.counter = 1;
12632		}
12633		this.spinning = true;
12634		return true;
12635	},
12636
12637	_repeat: function( i, steps, event ) {
12638		i = i || 500;
12639
12640		clearTimeout( this.timer );
12641		this.timer = this._delay(function() {
12642			this._repeat( 40, steps, event );
12643		}, i );
12644
12645		this._spin( steps * this.options.step, event );
12646	},
12647
12648	_spin: function( step, event ) {
12649		var value = this.value() || 0;
12650
12651		if ( !this.counter ) {
12652			this.counter = 1;
12653		}
12654
12655		value = this._adjustValue( value + step * this._increment( this.counter ) );
12656
12657		if ( !this.spinning || this._trigger( "spin", event, { value: value } ) !== false) {
12658			this._value( value );
12659			this.counter++;
12660		}
12661	},
12662
12663	_increment: function( i ) {
12664		var incremental = this.options.incremental;
12665
12666		if ( incremental ) {
12667			return $.isFunction( incremental ) ?
12668				incremental( i ) :
12669				Math.floor( i * i * i / 50000 - i * i / 500 + 17 * i / 200 + 1 );
12670		}
12671
12672		return 1;
12673	},
12674
12675	_precision: function() {
12676		var precision = this._precisionOf( this.options.step );
12677		if ( this.options.min !== null ) {
12678			precision = Math.max( precision, this._precisionOf( this.options.min ) );
12679		}
12680		return precision;
12681	},
12682
12683	_precisionOf: function( num ) {
12684		var str = num.toString(),
12685			decimal = str.indexOf( "." );
12686		return decimal === -1 ? 0 : str.length - decimal - 1;
12687	},
12688
12689	_adjustValue: function( value ) {
12690		var base, aboveMin,
12691			options = this.options;
12692
12693		// make sure we're at a valid step
12694		// - find out where we are relative to the base (min or 0)
12695		base = options.min !== null ? options.min : 0;
12696		aboveMin = value - base;
12697		// - round to the nearest step
12698		aboveMin = Math.round(aboveMin / options.step) * options.step;
12699		// - rounding is based on 0, so adjust back to our base
12700		value = base + aboveMin;
12701
12702		// fix precision from bad JS floating point math
12703		value = parseFloat( value.toFixed( this._precision() ) );
12704
12705		// clamp the value
12706		if ( options.max !== null && value > options.max) {
12707			return options.max;
12708		}
12709		if ( options.min !== null && value < options.min ) {
12710			return options.min;
12711		}
12712
12713		return value;
12714	},
12715
12716	_stop: function( event ) {
12717		if ( !this.spinning ) {
12718			return;
12719		}
12720
12721		clearTimeout( this.timer );
12722		clearTimeout( this.mousewheelTimer );
12723		this.counter = 0;
12724		this.spinning = false;
12725		this._trigger( "stop", event );
12726	},
12727
12728	_setOption: function( key, value ) {
12729		if ( key === "culture" || key === "numberFormat" ) {
12730			var prevValue = this._parse( this.element.val() );
12731			this.options[ key ] = value;
12732			this.element.val( this._format( prevValue ) );
12733			return;
12734		}
12735
12736		if ( key === "max" || key === "min" || key === "step" ) {
12737			if ( typeof value === "string" ) {
12738				value = this._parse( value );
12739			}
12740		}
12741		if ( key === "icons" ) {
12742			this.buttons.first().find( ".ui-icon" )
12743				.removeClass( this.options.icons.up )
12744				.addClass( value.up );
12745			this.buttons.last().find( ".ui-icon" )
12746				.removeClass( this.options.icons.down )
12747				.addClass( value.down );
12748		}
12749
12750		this._super( key, value );
12751
12752		if ( key === "disabled" ) {
12753			this.widget().toggleClass( "ui-state-disabled", !!value );
12754			this.element.prop( "disabled", !!value );
12755			this.buttons.button( value ? "disable" : "enable" );
12756		}
12757	},
12758
12759	_setOptions: spinner_modifier(function( options ) {
12760		this._super( options );
12761	}),
12762
12763	_parse: function( val ) {
12764		if ( typeof val === "string" && val !== "" ) {
12765			val = window.Globalize && this.options.numberFormat ?
12766				Globalize.parseFloat( val, 10, this.options.culture ) : +val;
12767		}
12768		return val === "" || isNaN( val ) ? null : val;
12769	},
12770
12771	_format: function( value ) {
12772		if ( value === "" ) {
12773			return "";
12774		}
12775		return window.Globalize && this.options.numberFormat ?
12776			Globalize.format( value, this.options.numberFormat, this.options.culture ) :
12777			value;
12778	},
12779
12780	_refresh: function() {
12781		this.element.attr({
12782			"aria-valuemin": this.options.min,
12783			"aria-valuemax": this.options.max,
12784			// TODO: what should we do with values that can't be parsed?
12785			"aria-valuenow": this._parse( this.element.val() )
12786		});
12787	},
12788
12789	isValid: function() {
12790		var value = this.value();
12791
12792		// null is invalid
12793		if ( value === null ) {
12794			return false;
12795		}
12796
12797		// if value gets adjusted, it's invalid
12798		return value === this._adjustValue( value );
12799	},
12800
12801	// update the value without triggering change
12802	_value: function( value, allowAny ) {
12803		var parsed;
12804		if ( value !== "" ) {
12805			parsed = this._parse( value );
12806			if ( parsed !== null ) {
12807				if ( !allowAny ) {
12808					parsed = this._adjustValue( parsed );
12809				}
12810				value = this._format( parsed );
12811			}
12812		}
12813		this.element.val( value );
12814		this._refresh();
12815	},
12816
12817	_destroy: function() {
12818		this.element
12819			.removeClass( "ui-spinner-input" )
12820			.prop( "disabled", false )
12821			.removeAttr( "autocomplete" )
12822			.removeAttr( "role" )
12823			.removeAttr( "aria-valuemin" )
12824			.removeAttr( "aria-valuemax" )
12825			.removeAttr( "aria-valuenow" );
12826		this.uiSpinner.replaceWith( this.element );
12827	},
12828
12829	stepUp: spinner_modifier(function( steps ) {
12830		this._stepUp( steps );
12831	}),
12832	_stepUp: function( steps ) {
12833		if ( this._start() ) {
12834			this._spin( (steps || 1) * this.options.step );
12835			this._stop();
12836		}
12837	},
12838
12839	stepDown: spinner_modifier(function( steps ) {
12840		this._stepDown( steps );
12841	}),
12842	_stepDown: function( steps ) {
12843		if ( this._start() ) {
12844			this._spin( (steps || 1) * -this.options.step );
12845			this._stop();
12846		}
12847	},
12848
12849	pageUp: spinner_modifier(function( pages ) {
12850		this._stepUp( (pages || 1) * this.options.page );
12851	}),
12852
12853	pageDown: spinner_modifier(function( pages ) {
12854		this._stepDown( (pages || 1) * this.options.page );
12855	}),
12856
12857	value: function( newVal ) {
12858		if ( !arguments.length ) {
12859			return this._parse( this.element.val() );
12860		}
12861		spinner_modifier( this._value ).call( this, newVal );
12862	},
12863
12864	widget: function() {
12865		return this.uiSpinner;
12866	}
12867});
12868
12869
12870/*!
12871 * jQuery UI Tabs 1.11.4
12872 * http://jqueryui.com
12873 *
12874 * Copyright jQuery Foundation and other contributors
12875 * Released under the MIT license.
12876 * http://jquery.org/license
12877 *
12878 * http://api.jqueryui.com/tabs/
12879 */
12880
12881
12882var tabs = $.widget( "ui.tabs", {
12883	version: "1.11.4",
12884	delay: 300,
12885	options: {
12886		active: null,
12887		collapsible: false,
12888		event: "click",
12889		heightStyle: "content",
12890		hide: null,
12891		show: null,
12892
12893		// callbacks
12894		activate: null,
12895		beforeActivate: null,
12896		beforeLoad: null,
12897		load: null
12898	},
12899
12900	_isLocal: (function() {
12901		var rhash = /#.*$/;
12902
12903		return function( anchor ) {
12904			var anchorUrl, locationUrl;
12905
12906			// support: IE7
12907			// IE7 doesn't normalize the href property when set via script (#9317)
12908			anchor = anchor.cloneNode( false );
12909
12910			anchorUrl = anchor.href.replace( rhash, "" );
12911			locationUrl = location.href.replace( rhash, "" );
12912
12913			// decoding may throw an error if the URL isn't UTF-8 (#9518)
12914			try {
12915				anchorUrl = decodeURIComponent( anchorUrl );
12916			} catch ( error ) {}
12917			try {
12918				locationUrl = decodeURIComponent( locationUrl );
12919			} catch ( error ) {}
12920
12921			return anchor.hash.length > 1 && anchorUrl === locationUrl;
12922		};
12923	})(),
12924
12925	_create: function() {
12926		var that = this,
12927			options = this.options;
12928
12929		this.running = false;
12930
12931		this.element
12932			.addClass( "ui-tabs ui-widget ui-widget-content ui-corner-all" )
12933			.toggleClass( "ui-tabs-collapsible", options.collapsible );
12934
12935		this._processTabs();
12936		options.active = this._initialActive();
12937
12938		// Take disabling tabs via class attribute from HTML
12939		// into account and update option properly.
12940		if ( $.isArray( options.disabled ) ) {
12941			options.disabled = $.unique( options.disabled.concat(
12942				$.map( this.tabs.filter( ".ui-state-disabled" ), function( li ) {
12943					return that.tabs.index( li );
12944				})
12945			) ).sort();
12946		}
12947
12948		// check for length avoids error when initializing empty list
12949		if ( this.options.active !== false && this.anchors.length ) {
12950			this.active = this._findActive( options.active );
12951		} else {
12952			this.active = $();
12953		}
12954
12955		this._refresh();
12956
12957		if ( this.active.length ) {
12958			this.load( options.active );
12959		}
12960	},
12961
12962	_initialActive: function() {
12963		var active = this.options.active,
12964			collapsible = this.options.collapsible,
12965			locationHash = location.hash.substring( 1 );
12966
12967		if ( active === null ) {
12968			// check the fragment identifier in the URL
12969			if ( locationHash ) {
12970				this.tabs.each(function( i, tab ) {
12971					if ( $( tab ).attr( "aria-controls" ) === locationHash ) {
12972						active = i;
12973						return false;
12974					}
12975				});
12976			}
12977
12978			// check for a tab marked active via a class
12979			if ( active === null ) {
12980				active = this.tabs.index( this.tabs.filter( ".ui-tabs-active" ) );
12981			}
12982
12983			// no active tab, set to false
12984			if ( active === null || active === -1 ) {
12985				active = this.tabs.length ? 0 : false;
12986			}
12987		}
12988
12989		// handle numbers: negative, out of range
12990		if ( active !== false ) {
12991			active = this.tabs.index( this.tabs.eq( active ) );
12992			if ( active === -1 ) {
12993				active = collapsible ? false : 0;
12994			}
12995		}
12996
12997		// don't allow collapsible: false and active: false
12998		if ( !collapsible && active === false && this.anchors.length ) {
12999			active = 0;
13000		}
13001
13002		return active;
13003	},
13004
13005	_getCreateEventData: function() {
13006		return {
13007			tab: this.active,
13008			panel: !this.active.length ? $() : this._getPanelForTab( this.active )
13009		};
13010	},
13011
13012	_tabKeydown: function( event ) {
13013		var focusedTab = $( this.document[0].activeElement ).closest( "li" ),
13014			selectedIndex = this.tabs.index( focusedTab ),
13015			goingForward = true;
13016
13017		if ( this._handlePageNav( event ) ) {
13018			return;
13019		}
13020
13021		switch ( event.keyCode ) {
13022			case $.ui.keyCode.RIGHT:
13023			case $.ui.keyCode.DOWN:
13024				selectedIndex++;
13025				break;
13026			case $.ui.keyCode.UP:
13027			case $.ui.keyCode.LEFT:
13028				goingForward = false;
13029				selectedIndex--;
13030				break;
13031			case $.ui.keyCode.END:
13032				selectedIndex = this.anchors.length - 1;
13033				break;
13034			case $.ui.keyCode.HOME:
13035				selectedIndex = 0;
13036				break;
13037			case $.ui.keyCode.SPACE:
13038				// Activate only, no collapsing
13039				event.preventDefault();
13040				clearTimeout( this.activating );
13041				this._activate( selectedIndex );
13042				return;
13043			case $.ui.keyCode.ENTER:
13044				// Toggle (cancel delayed activation, allow collapsing)
13045				event.preventDefault();
13046				clearTimeout( this.activating );
13047				// Determine if we should collapse or activate
13048				this._activate( selectedIndex === this.options.active ? false : selectedIndex );
13049				return;
13050			default:
13051				return;
13052		}
13053
13054		// Focus the appropriate tab, based on which key was pressed
13055		event.preventDefault();
13056		clearTimeout( this.activating );
13057		selectedIndex = this._focusNextTab( selectedIndex, goingForward );
13058
13059		// Navigating with control/command key will prevent automatic activation
13060		if ( !event.ctrlKey && !event.metaKey ) {
13061
13062			// Update aria-selected immediately so that AT think the tab is already selected.
13063			// Otherwise AT may confuse the user by stating that they need to activate the tab,
13064			// but the tab will already be activated by the time the announcement finishes.
13065			focusedTab.attr( "aria-selected", "false" );
13066			this.tabs.eq( selectedIndex ).attr( "aria-selected", "true" );
13067
13068			this.activating = this._delay(function() {
13069				this.option( "active", selectedIndex );
13070			}, this.delay );
13071		}
13072	},
13073
13074	_panelKeydown: function( event ) {
13075		if ( this._handlePageNav( event ) ) {
13076			return;
13077		}
13078
13079		// Ctrl+up moves focus to the current tab
13080		if ( event.ctrlKey && event.keyCode === $.ui.keyCode.UP ) {
13081			event.preventDefault();
13082			this.active.focus();
13083		}
13084	},
13085
13086	// Alt+page up/down moves focus to the previous/next tab (and activates)
13087	_handlePageNav: function( event ) {
13088		if ( event.altKey && event.keyCode === $.ui.keyCode.PAGE_UP ) {
13089			this._activate( this._focusNextTab( this.options.active - 1, false ) );
13090			return true;
13091		}
13092		if ( event.altKey && event.keyCode === $.ui.keyCode.PAGE_DOWN ) {
13093			this._activate( this._focusNextTab( this.options.active + 1, true ) );
13094			return true;
13095		}
13096	},
13097
13098	_findNextTab: function( index, goingForward ) {
13099		var lastTabIndex = this.tabs.length - 1;
13100
13101		function constrain() {
13102			if ( index > lastTabIndex ) {
13103				index = 0;
13104			}
13105			if ( index < 0 ) {
13106				index = lastTabIndex;
13107			}
13108			return index;
13109		}
13110
13111		while ( $.inArray( constrain(), this.options.disabled ) !== -1 ) {
13112			index = goingForward ? index + 1 : index - 1;
13113		}
13114
13115		return index;
13116	},
13117
13118	_focusNextTab: function( index, goingForward ) {
13119		index = this._findNextTab( index, goingForward );
13120		this.tabs.eq( index ).focus();
13121		return index;
13122	},
13123
13124	_setOption: function( key, value ) {
13125		if ( key === "active" ) {
13126			// _activate() will handle invalid values and update this.options
13127			this._activate( value );
13128			return;
13129		}
13130
13131		if ( key === "disabled" ) {
13132			// don't use the widget factory's disabled handling
13133			this._setupDisabled( value );
13134			return;
13135		}
13136
13137		this._super( key, value);
13138
13139		if ( key === "collapsible" ) {
13140			this.element.toggleClass( "ui-tabs-collapsible", value );
13141			// Setting collapsible: false while collapsed; open first panel
13142			if ( !value && this.options.active === false ) {
13143				this._activate( 0 );
13144			}
13145		}
13146
13147		if ( key === "event" ) {
13148			this._setupEvents( value );
13149		}
13150
13151		if ( key === "heightStyle" ) {
13152			this._setupHeightStyle( value );
13153		}
13154	},
13155
13156	_sanitizeSelector: function( hash ) {
13157		return hash ? hash.replace( /[!"$%&'()*+,.\/:;<=>?@\[\]\^`{|}~]/g, "\\$&" ) : "";
13158	},
13159
13160	refresh: function() {
13161		var options = this.options,
13162			lis = this.tablist.children( ":has(a[href])" );
13163
13164		// get disabled tabs from class attribute from HTML
13165		// this will get converted to a boolean if needed in _refresh()
13166		options.disabled = $.map( lis.filter( ".ui-state-disabled" ), function( tab ) {
13167			return lis.index( tab );
13168		});
13169
13170		this._processTabs();
13171
13172		// was collapsed or no tabs
13173		if ( options.active === false || !this.anchors.length ) {
13174			options.active = false;
13175			this.active = $();
13176		// was active, but active tab is gone
13177		} else if ( this.active.length && !$.contains( this.tablist[ 0 ], this.active[ 0 ] ) ) {
13178			// all remaining tabs are disabled
13179			if ( this.tabs.length === options.disabled.length ) {
13180				options.active = false;
13181				this.active = $();
13182			// activate previous tab
13183			} else {
13184				this._activate( this._findNextTab( Math.max( 0, options.active - 1 ), false ) );
13185			}
13186		// was active, active tab still exists
13187		} else {
13188			// make sure active index is correct
13189			options.active = this.tabs.index( this.active );
13190		}
13191
13192		this._refresh();
13193	},
13194
13195	_refresh: function() {
13196		this._setupDisabled( this.options.disabled );
13197		this._setupEvents( this.options.event );
13198		this._setupHeightStyle( this.options.heightStyle );
13199
13200		this.tabs.not( this.active ).attr({
13201			"aria-selected": "false",
13202			"aria-expanded": "false",
13203			tabIndex: -1
13204		});
13205		this.panels.not( this._getPanelForTab( this.active ) )
13206			.hide()
13207			.attr({
13208				"aria-hidden": "true"
13209			});
13210
13211		// Make sure one tab is in the tab order
13212		if ( !this.active.length ) {
13213			this.tabs.eq( 0 ).attr( "tabIndex", 0 );
13214		} else {
13215			this.active
13216				.addClass( "ui-tabs-active ui-state-active" )
13217				.attr({
13218					"aria-selected": "true",
13219					"aria-expanded": "true",
13220					tabIndex: 0
13221				});
13222			this._getPanelForTab( this.active )
13223				.show()
13224				.attr({
13225					"aria-hidden": "false"
13226				});
13227		}
13228	},
13229
13230	_processTabs: function() {
13231		var that = this,
13232			prevTabs = this.tabs,
13233			prevAnchors = this.anchors,
13234			prevPanels = this.panels;
13235
13236		this.tablist = this._getList()
13237			.addClass( "ui-tabs-nav ui-helper-reset ui-helper-clearfix ui-widget-header ui-corner-all" )
13238			.attr( "role", "tablist" )
13239
13240			// Prevent users from focusing disabled tabs via click
13241			.delegate( "> li", "mousedown" + this.eventNamespace, function( event ) {
13242				if ( $( this ).is( ".ui-state-disabled" ) ) {
13243					event.preventDefault();
13244				}
13245			})
13246
13247			// support: IE <9
13248			// Preventing the default action in mousedown doesn't prevent IE
13249			// from focusing the element, so if the anchor gets focused, blur.
13250			// We don't have to worry about focusing the previously focused
13251			// element since clicking on a non-focusable element should focus
13252			// the body anyway.
13253			.delegate( ".ui-tabs-anchor", "focus" + this.eventNamespace, function() {
13254				if ( $( this ).closest( "li" ).is( ".ui-state-disabled" ) ) {
13255					this.blur();
13256				}
13257			});
13258
13259		this.tabs = this.tablist.find( "> li:has(a[href])" )
13260			.addClass( "ui-state-default ui-corner-top" )
13261			.attr({
13262				role: "tab",
13263				tabIndex: -1
13264			});
13265
13266		this.anchors = this.tabs.map(function() {
13267				return $( "a", this )[ 0 ];
13268			})
13269			.addClass( "ui-tabs-anchor" )
13270			.attr({
13271				role: "presentation",
13272				tabIndex: -1
13273			});
13274
13275		this.panels = $();
13276
13277		this.anchors.each(function( i, anchor ) {
13278			var selector, panel, panelId,
13279				anchorId = $( anchor ).uniqueId().attr( "id" ),
13280				tab = $( anchor ).closest( "li" ),
13281				originalAriaControls = tab.attr( "aria-controls" );
13282
13283			// inline tab
13284			if ( that._isLocal( anchor ) ) {
13285				selector = anchor.hash;
13286				panelId = selector.substring( 1 );
13287				panel = that.element.find( that._sanitizeSelector( selector ) );
13288			// remote tab
13289			} else {
13290				// If the tab doesn't already have aria-controls,
13291				// generate an id by using a throw-away element
13292				panelId = tab.attr( "aria-controls" ) || $( {} ).uniqueId()[ 0 ].id;
13293				selector = "#" + panelId;
13294				panel = that.element.find( selector );
13295				if ( !panel.length ) {
13296					panel = that._createPanel( panelId );
13297					panel.insertAfter( that.panels[ i - 1 ] || that.tablist );
13298				}
13299				panel.attr( "aria-live", "polite" );
13300			}
13301
13302			if ( panel.length) {
13303				that.panels = that.panels.add( panel );
13304			}
13305			if ( originalAriaControls ) {
13306				tab.data( "ui-tabs-aria-controls", originalAriaControls );
13307			}
13308			tab.attr({
13309				"aria-controls": panelId,
13310				"aria-labelledby": anchorId
13311			});
13312			panel.attr( "aria-labelledby", anchorId );
13313		});
13314
13315		this.panels
13316			.addClass( "ui-tabs-panel ui-widget-content ui-corner-bottom" )
13317			.attr( "role", "tabpanel" );
13318
13319		// Avoid memory leaks (#10056)
13320		if ( prevTabs ) {
13321			this._off( prevTabs.not( this.tabs ) );
13322			this._off( prevAnchors.not( this.anchors ) );
13323			this._off( prevPanels.not( this.panels ) );
13324		}
13325	},
13326
13327	// allow overriding how to find the list for rare usage scenarios (#7715)
13328	_getList: function() {
13329		return this.tablist || this.element.find( "ol,ul" ).eq( 0 );
13330	},
13331
13332	_createPanel: function( id ) {
13333		return $( "<div>" )
13334			.attr( "id", id )
13335			.addClass( "ui-tabs-panel ui-widget-content ui-corner-bottom" )
13336			.data( "ui-tabs-destroy", true );
13337	},
13338
13339	_setupDisabled: function( disabled ) {
13340		if ( $.isArray( disabled ) ) {
13341			if ( !disabled.length ) {
13342				disabled = false;
vendor: 4,561 bytes, lines 13343-13510
13343			} else if ( disabled.length === this.anchors.length ) {
13344				disabled = true;
13345			}
13346		}
13347
13348		// disable tabs
13349		for ( var i = 0, li; ( li = this.tabs[ i ] ); i++ ) {
13350			if ( disabled === true || $.inArray( i, disabled ) !== -1 ) {
13351				$( li )
13352					.addClass( "ui-state-disabled" )
13353					.attr( "aria-disabled", "true" );
13354			} else {
13355				$( li )
13356					.removeClass( "ui-state-disabled" )
13357					.removeAttr( "aria-disabled" );
13358			}
13359		}
13360
13361		this.options.disabled = disabled;
13362	},
13363
13364	_setupEvents: function( event ) {
13365		var events = {};
13366		if ( event ) {
13367			$.each( event.split(" "), function( index, eventName ) {
13368				events[ eventName ] = "_eventHandler";
13369			});
13370		}
13371
13372		this._off( this.anchors.add( this.tabs ).add( this.panels ) );
13373		// Always prevent the default action, even when disabled
13374		this._on( true, this.anchors, {
13375			click: function( event ) {
13376				event.preventDefault();
13377			}
13378		});
13379		this._on( this.anchors, events );
13380		this._on( this.tabs, { keydown: "_tabKeydown" } );
13381		this._on( this.panels, { keydown: "_panelKeydown" } );
13382
13383		this._focusable( this.tabs );
13384		this._hoverable( this.tabs );
13385	},
13386
13387	_setupHeightStyle: function( heightStyle ) {
13388		var maxHeight,
13389			parent = this.element.parent();
13390
13391		if ( heightStyle === "fill" ) {
13392			maxHeight = parent.height();
13393			maxHeight -= this.element.outerHeight() - this.element.height();
13394
13395			this.element.siblings( ":visible" ).each(function() {
13396				var elem = $( this ),
13397					position = elem.css( "position" );
13398
13399				if ( position === "absolute" || position === "fixed" ) {
13400					return;
13401				}
13402				maxHeight -= elem.outerHeight( true );
13403			});
13404
13405			this.element.children().not( this.panels ).each(function() {
13406				maxHeight -= $( this ).outerHeight( true );
13407			});
13408
13409			this.panels.each(function() {
13410				$( this ).height( Math.max( 0, maxHeight -
13411					$( this ).innerHeight() + $( this ).height() ) );
13412			})
13413			.css( "overflow", "auto" );
13414		} else if ( heightStyle === "auto" ) {
13415			maxHeight = 0;
13416			this.panels.each(function() {
13417				maxHeight = Math.max( maxHeight, $( this ).height( "" ).height() );
13418			}).height( maxHeight );
13419		}
13420	},
13421
13422	_eventHandler: function( event ) {
13423		var options = this.options,
13424			active = this.active,
13425			anchor = $( event.currentTarget ),
13426			tab = anchor.closest( "li" ),
13427			clickedIsActive = tab[ 0 ] === active[ 0 ],
13428			collapsing = clickedIsActive && options.collapsible,
13429			toShow = collapsing ? $() : this._getPanelForTab( tab ),
13430			toHide = !active.length ? $() : this._getPanelForTab( active ),
13431			eventData = {
13432				oldTab: active,
13433				oldPanel: toHide,
13434				newTab: collapsing ? $() : tab,
13435				newPanel: toShow
13436			};
13437
13438		event.preventDefault();
13439
13440		if ( tab.hasClass( "ui-state-disabled" ) ||
13441				// tab is already loading
13442				tab.hasClass( "ui-tabs-loading" ) ||
13443				// can't switch durning an animation
13444				this.running ||
13445				// click on active header, but not collapsible
13446				( clickedIsActive && !options.collapsible ) ||
13447				// allow canceling activation
13448				( this._trigger( "beforeActivate", event, eventData ) === false ) ) {
13449			return;
13450		}
13451
13452		options.active = collapsing ? false : this.tabs.index( tab );
13453
13454		this.active = clickedIsActive ? $() : tab;
13455		if ( this.xhr ) {
13456			this.xhr.abort();
13457		}
13458
13459		if ( !toHide.length && !toShow.length ) {
13460			$.error( "jQuery UI Tabs: Mismatching fragment identifier." );
13461		}
13462
13463		if ( toShow.length ) {
13464			this.load( this.tabs.index( tab ), event );
13465		}
13466		this._toggle( event, eventData );
13467	},
13468
13469	// handles show/hide for selecting tabs
13470	_toggle: function( event, eventData ) {
13471		var that = this,
13472			toShow = eventData.newPanel,
13473			toHide = eventData.oldPanel;
13474
13475		this.running = true;
13476
13477		function complete() {
13478			that.running = false;
13479			that._trigger( "activate", event, eventData );
13480		}
13481
13482		function show() {
13483			eventData.newTab.closest( "li" ).addClass( "ui-tabs-active ui-state-active" );
13484
13485			if ( toShow.length && that.options.show ) {
13486				that._show( toShow, that.options.show, complete );
13487			} else {
13488				toShow.show();
13489				complete();
13490			}
13491		}
13492
13493		// start out by hiding, then showing, then completing
13494		if ( toHide.length && this.options.hide ) {
13495			this._hide( toHide, this.options.hide, function() {
13496				eventData.oldTab.closest( "li" ).removeClass( "ui-tabs-active ui-state-active" );
13497				show();
13498			});
13499		} else {
13500			eventData.oldTab.closest( "li" ).removeClass( "ui-tabs-active ui-state-active" );
13501			toHide.hide();
13502			show();
13503		}
13504
13505		toHide.attr( "aria-hidden", "true" );
13506		eventData.oldTab.attr({
13507			"aria-selected": "false",
13508			"aria-expanded": "false"
13509		});
13510		// If we're switching tabs, remove the old tab from the tab order.
vendor: 18,498 bytes, lines 13511-14199
13511		// If we're opening from collapsed state, remove the previous tab from the tab order.
13512		// If we're collapsing, then keep the collapsing tab in the tab order.
13513		if ( toShow.length && toHide.length ) {
13514			eventData.oldTab.attr( "tabIndex", -1 );
13515		} else if ( toShow.length ) {
13516			this.tabs.filter(function() {
13517				return $( this ).attr( "tabIndex" ) === 0;
13518			})
13519			.attr( "tabIndex", -1 );
13520		}
13521
13522		toShow.attr( "aria-hidden", "false" );
13523		eventData.newTab.attr({
13524			"aria-selected": "true",
13525			"aria-expanded": "true",
13526			tabIndex: 0
13527		});
13528	},
13529
13530	_activate: function( index ) {
13531		var anchor,
13532			active = this._findActive( index );
13533
13534		// trying to activate the already active panel
13535		if ( active[ 0 ] === this.active[ 0 ] ) {
13536			return;
13537		}
13538
13539		// trying to collapse, simulate a click on the current active header
13540		if ( !active.length ) {
13541			active = this.active;
13542		}
13543
13544		anchor = active.find( ".ui-tabs-anchor" )[ 0 ];
13545		this._eventHandler({
13546			target: anchor,
13547			currentTarget: anchor,
13548			preventDefault: $.noop
13549		});
13550	},
13551
13552	_findActive: function( index ) {
13553		return index === false ? $() : this.tabs.eq( index );
13554	},
13555
13556	_getIndex: function( index ) {
13557		// meta-function to give users option to provide a href string instead of a numerical index.
13558		if ( typeof index === "string" ) {
13559			index = this.anchors.index( this.anchors.filter( "[href$='" + index + "']" ) );
13560		}
13561
13562		return index;
13563	},
13564
13565	_destroy: function() {
13566		if ( this.xhr ) {
13567			this.xhr.abort();
13568		}
13569
13570		this.element.removeClass( "ui-tabs ui-widget ui-widget-content ui-corner-all ui-tabs-collapsible" );
13571
13572		this.tablist
13573			.removeClass( "ui-tabs-nav ui-helper-reset ui-helper-clearfix ui-widget-header ui-corner-all" )
13574			.removeAttr( "role" );
13575
13576		this.anchors
13577			.removeClass( "ui-tabs-anchor" )
13578			.removeAttr( "role" )
13579			.removeAttr( "tabIndex" )
13580			.removeUniqueId();
13581
13582		this.tablist.unbind( this.eventNamespace );
13583
13584		this.tabs.add( this.panels ).each(function() {
13585			if ( $.data( this, "ui-tabs-destroy" ) ) {
13586				$( this ).remove();
13587			} else {
13588				$( this )
13589					.removeClass( "ui-state-default ui-state-active ui-state-disabled " +
13590						"ui-corner-top ui-corner-bottom ui-widget-content ui-tabs-active ui-tabs-panel" )
13591					.removeAttr( "tabIndex" )
13592					.removeAttr( "aria-live" )
13593					.removeAttr( "aria-busy" )
13594					.removeAttr( "aria-selected" )
13595					.removeAttr( "aria-labelledby" )
13596					.removeAttr( "aria-hidden" )
13597					.removeAttr( "aria-expanded" )
13598					.removeAttr( "role" );
13599			}
13600		});
13601
13602		this.tabs.each(function() {
13603			var li = $( this ),
13604				prev = li.data( "ui-tabs-aria-controls" );
13605			if ( prev ) {
13606				li
13607					.attr( "aria-controls", prev )
13608					.removeData( "ui-tabs-aria-controls" );
13609			} else {
13610				li.removeAttr( "aria-controls" );
13611			}
13612		});
13613
13614		this.panels.show();
13615
13616		if ( this.options.heightStyle !== "content" ) {
13617			this.panels.css( "height", "" );
13618		}
13619	},
13620
13621	enable: function( index ) {
13622		var disabled = this.options.disabled;
13623		if ( disabled === false ) {
13624			return;
13625		}
13626
13627		if ( index === undefined ) {
13628			disabled = false;
13629		} else {
13630			index = this._getIndex( index );
13631			if ( $.isArray( disabled ) ) {
13632				disabled = $.map( disabled, function( num ) {
13633					return num !== index ? num : null;
13634				});
13635			} else {
13636				disabled = $.map( this.tabs, function( li, num ) {
13637					return num !== index ? num : null;
13638				});
13639			}
13640		}
13641		this._setupDisabled( disabled );
13642	},
13643
13644	disable: function( index ) {
13645		var disabled = this.options.disabled;
13646		if ( disabled === true ) {
13647			return;
13648		}
13649
13650		if ( index === undefined ) {
13651			disabled = true;
13652		} else {
13653			index = this._getIndex( index );
13654			if ( $.inArray( index, disabled ) !== -1 ) {
13655				return;
13656			}
13657			if ( $.isArray( disabled ) ) {
13658				disabled = $.merge( [ index ], disabled ).sort();
13659			} else {
13660				disabled = [ index ];
13661			}
13662		}
13663		this._setupDisabled( disabled );
13664	},
13665
13666	load: function( index, event ) {
13667		index = this._getIndex( index );
13668		var that = this,
13669			tab = this.tabs.eq( index ),
13670			anchor = tab.find( ".ui-tabs-anchor" ),
13671			panel = this._getPanelForTab( tab ),
13672			eventData = {
13673				tab: tab,
13674				panel: panel
13675			},
13676			complete = function( jqXHR, status ) {
13677				if ( status === "abort" ) {
13678					that.panels.stop( false, true );
13679				}
13680
13681				tab.removeClass( "ui-tabs-loading" );
13682				panel.removeAttr( "aria-busy" );
13683
13684				if ( jqXHR === that.xhr ) {
13685					delete that.xhr;
13686				}
13687			};
13688
13689		// not remote
13690		if ( this._isLocal( anchor[ 0 ] ) ) {
13691			return;
13692		}
13693
13694		this.xhr = $.ajax( this._ajaxSettings( anchor, event, eventData ) );
13695
13696		// support: jQuery <1.8
13697		// jQuery <1.8 returns false if the request is canceled in beforeSend,
13698		// but as of 1.8, $.ajax() always returns a jqXHR object.
13699		if ( this.xhr && this.xhr.statusText !== "canceled" ) {
13700			tab.addClass( "ui-tabs-loading" );
13701			panel.attr( "aria-busy", "true" );
13702
13703			this.xhr
13704				.done(function( response, status, jqXHR ) {
13705					// support: jQuery <1.8
13706					// http://bugs.jquery.com/ticket/11778
13707					setTimeout(function() {
13708						panel.html( response );
13709						that._trigger( "load", event, eventData );
13710
13711						complete( jqXHR, status );
13712					}, 1 );
13713				})
13714				.fail(function( jqXHR, status ) {
13715					// support: jQuery <1.8
13716					// http://bugs.jquery.com/ticket/11778
13717					setTimeout(function() {
13718						complete( jqXHR, status );
13719					}, 1 );
13720				});
13721		}
13722	},
13723
13724	_ajaxSettings: function( anchor, event, eventData ) {
13725		var that = this;
13726		return {
13727			url: anchor.attr( "href" ),
13728			beforeSend: function( jqXHR, settings ) {
13729				return that._trigger( "beforeLoad", event,
13730					$.extend( { jqXHR: jqXHR, ajaxSettings: settings }, eventData ) );
13731			}
13732		};
13733	},
13734
13735	_getPanelForTab: function( tab ) {
13736		var id = $( tab ).attr( "aria-controls" );
13737		return this.element.find( this._sanitizeSelector( "#" + id ) );
13738	}
13739});
13740
13741
13742/*!
13743 * jQuery UI Tooltip 1.11.4
13744 * http://jqueryui.com
13745 *
13746 * Copyright jQuery Foundation and other contributors
13747 * Released under the MIT license.
13748 * http://jquery.org/license
13749 *
13750 * http://api.jqueryui.com/tooltip/
13751 */
13752
13753
13754var tooltip = $.widget( "ui.tooltip", {
13755	version: "1.11.4",
13756	options: {
13757		content: function() {
13758			// support: IE<9, Opera in jQuery <1.7
13759			// .text() can't accept undefined, so coerce to a string
13760			var title = $( this ).attr( "title" ) || "";
13761			// Escape title, since we're going from an attribute to raw HTML
13762			return $( "<a>" ).text( title ).html();
13763		},
13764		hide: true,
13765		// Disabled elements have inconsistent behavior across browsers (#8661)
13766		items: "[title]:not([disabled])",
13767		position: {
13768			my: "left top+15",
13769			at: "left bottom",
13770			collision: "flipfit flip"
13771		},
13772		show: true,
13773		tooltipClass: null,
13774		track: false,
13775
13776		// callbacks
13777		close: null,
13778		open: null
13779	},
13780
13781	_addDescribedBy: function( elem, id ) {
13782		var describedby = (elem.attr( "aria-describedby" ) || "").split( /\s+/ );
13783		describedby.push( id );
13784		elem
13785			.data( "ui-tooltip-id", id )
13786			.attr( "aria-describedby", $.trim( describedby.join( " " ) ) );
13787	},
13788
13789	_removeDescribedBy: function( elem ) {
13790		var id = elem.data( "ui-tooltip-id" ),
13791			describedby = (elem.attr( "aria-describedby" ) || "").split( /\s+/ ),
13792			index = $.inArray( id, describedby );
13793
13794		if ( index !== -1 ) {
13795			describedby.splice( index, 1 );
13796		}
13797
13798		elem.removeData( "ui-tooltip-id" );
13799		describedby = $.trim( describedby.join( " " ) );
13800		if ( describedby ) {
13801			elem.attr( "aria-describedby", describedby );
13802		} else {
13803			elem.removeAttr( "aria-describedby" );
13804		}
13805	},
13806
13807	_create: function() {
13808		this._on({
13809			mouseover: "open",
13810			focusin: "open"
13811		});
13812
13813		// IDs of generated tooltips, needed for destroy
13814		this.tooltips = {};
13815
13816		// IDs of parent tooltips where we removed the title attribute
13817		this.parents = {};
13818
13819		if ( this.options.disabled ) {
13820			this._disable();
13821		}
13822
13823		// Append the aria-live region so tooltips announce correctly
13824		this.liveRegion = $( "<div>" )
13825			.attr({
13826				role: "log",
13827				"aria-live": "assertive",
13828				"aria-relevant": "additions"
13829			})
13830			.addClass( "ui-helper-hidden-accessible" )
13831			.appendTo( this.document[ 0 ].body );
13832	},
13833
13834	_setOption: function( key, value ) {
13835		var that = this;
13836
13837		if ( key === "disabled" ) {
13838			this[ value ? "_disable" : "_enable" ]();
13839			this.options[ key ] = value;
13840			// disable element style changes
13841			return;
13842		}
13843
13844		this._super( key, value );
13845
13846		if ( key === "content" ) {
13847			$.each( this.tooltips, function( id, tooltipData ) {
13848				that._updateContent( tooltipData.element );
13849			});
13850		}
13851	},
13852
13853	_disable: function() {
13854		var that = this;
13855
13856		// close open tooltips
13857		$.each( this.tooltips, function( id, tooltipData ) {
13858			var event = $.Event( "blur" );
13859			event.target = event.currentTarget = tooltipData.element[ 0 ];
13860			that.close( event, true );
13861		});
13862
13863		// remove title attributes to prevent native tooltips
13864		this.element.find( this.options.items ).addBack().each(function() {
13865			var element = $( this );
13866			if ( element.is( "[title]" ) ) {
13867				element
13868					.data( "ui-tooltip-title", element.attr( "title" ) )
13869					.removeAttr( "title" );
13870			}
13871		});
13872	},
13873
13874	_enable: function() {
13875		// restore title attributes
13876		this.element.find( this.options.items ).addBack().each(function() {
13877			var element = $( this );
13878			if ( element.data( "ui-tooltip-title" ) ) {
13879				element.attr( "title", element.data( "ui-tooltip-title" ) );
13880			}
13881		});
13882	},
13883
13884	open: function( event ) {
13885		var that = this,
13886			target = $( event ? event.target : this.element )
13887				// we need closest here due to mouseover bubbling,
13888				// but always pointing at the same event target
13889				.closest( this.options.items );
13890
13891		// No element to show a tooltip for or the tooltip is already open
13892		if ( !target.length || target.data( "ui-tooltip-id" ) ) {
13893			return;
13894		}
13895
13896		if ( target.attr( "title" ) ) {
13897			target.data( "ui-tooltip-title", target.attr( "title" ) );
13898		}
13899
13900		target.data( "ui-tooltip-open", true );
13901
13902		// kill parent tooltips, custom or native, for hover
13903		if ( event && event.type === "mouseover" ) {
13904			target.parents().each(function() {
13905				var parent = $( this ),
13906					blurEvent;
13907				if ( parent.data( "ui-tooltip-open" ) ) {
13908					blurEvent = $.Event( "blur" );
13909					blurEvent.target = blurEvent.currentTarget = this;
13910					that.close( blurEvent, true );
13911				}
13912				if ( parent.attr( "title" ) ) {
13913					parent.uniqueId();
13914					that.parents[ this.id ] = {
13915						element: this,
13916						title: parent.attr( "title" )
13917					};
13918					parent.attr( "title", "" );
13919				}
13920			});
13921		}
13922
13923		this._registerCloseHandlers( event, target );
13924		this._updateContent( target, event );
13925	},
13926
13927	_updateContent: function( target, event ) {
13928		var content,
13929			contentOption = this.options.content,
13930			that = this,
13931			eventType = event ? event.type : null;
13932
13933		if ( typeof contentOption === "string" ) {
13934			return this._open( event, target, contentOption );
13935		}
13936
13937		content = contentOption.call( target[0], function( response ) {
13938
13939			// IE may instantly serve a cached response for ajax requests
13940			// delay this call to _open so the other call to _open runs first
13941			that._delay(function() {
13942
13943				// Ignore async response if tooltip was closed already
13944				if ( !target.data( "ui-tooltip-open" ) ) {
13945					return;
13946				}
13947
13948				// jQuery creates a special event for focusin when it doesn't
13949				// exist natively. To improve performance, the native event
13950				// object is reused and the type is changed. Therefore, we can't
13951				// rely on the type being correct after the event finished
13952				// bubbling, so we set it back to the previous value. (#8740)
13953				if ( event ) {
13954					event.type = eventType;
13955				}
13956				this._open( event, target, response );
13957			});
13958		});
13959		if ( content ) {
13960			this._open( event, target, content );
13961		}
13962	},
13963
13964	_open: function( event, target, content ) {
13965		var tooltipData, tooltip, delayedShow, a11yContent,
13966			positionOption = $.extend( {}, this.options.position );
13967
13968		if ( !content ) {
13969			return;
13970		}
13971
13972		// Content can be updated multiple times. If the tooltip already
13973		// exists, then just update the content and bail.
13974		tooltipData = this._find( target );
13975		if ( tooltipData ) {
13976			tooltipData.tooltip.find( ".ui-tooltip-content" ).html( content );
13977			return;
13978		}
13979
13980		// if we have a title, clear it to prevent the native tooltip
13981		// we have to check first to avoid defining a title if none exists
13982		// (we don't want to cause an element to start matching [title])
13983		//
13984		// We use removeAttr only for key events, to allow IE to export the correct
13985		// accessible attributes. For mouse events, set to empty string to avoid
13986		// native tooltip showing up (happens only when removing inside mouseover).
13987		if ( target.is( "[title]" ) ) {
13988			if ( event && event.type === "mouseover" ) {
13989				target.attr( "title", "" );
13990			} else {
13991				target.removeAttr( "title" );
13992			}
13993		}
13994
13995		tooltipData = this._tooltip( target );
13996		tooltip = tooltipData.tooltip;
13997		this._addDescribedBy( target, tooltip.attr( "id" ) );
13998		tooltip.find( ".ui-tooltip-content" ).html( content );
13999
14000		// Support: Voiceover on OS X, JAWS on IE <= 9
14001		// JAWS announces deletions even when aria-relevant="additions"
14002		// Voiceover will sometimes re-read the entire log region's contents from the beginning
14003		this.liveRegion.children().hide();
14004		if ( content.clone ) {
14005			a11yContent = content.clone();
14006			a11yContent.removeAttr( "id" ).find( "[id]" ).removeAttr( "id" );
14007		} else {
14008			a11yContent = content;
14009		}
14010		$( "<div>" ).html( a11yContent ).appendTo( this.liveRegion );
14011
14012		function position( event ) {
14013			positionOption.of = event;
14014			if ( tooltip.is( ":hidden" ) ) {
14015				return;
14016			}
14017			tooltip.position( positionOption );
14018		}
14019		if ( this.options.track && event && /^mouse/.test( event.type ) ) {
14020			this._on( this.document, {
14021				mousemove: position
14022			});
14023			// trigger once to override element-relative positioning
14024			position( event );
14025		} else {
14026			tooltip.position( $.extend({
14027				of: target
14028			}, this.options.position ) );
14029		}
14030
14031		tooltip.hide();
14032
14033		this._show( tooltip, this.options.show );
14034		// Handle tracking tooltips that are shown with a delay (#8644). As soon
14035		// as the tooltip is visible, position the tooltip using the most recent
14036		// event.
14037		if ( this.options.show && this.options.show.delay ) {
14038			delayedShow = this.delayedShow = setInterval(function() {
14039				if ( tooltip.is( ":visible" ) ) {
14040					position( positionOption.of );
14041					clearInterval( delayedShow );
14042				}
14043			}, $.fx.interval );
14044		}
14045
14046		this._trigger( "open", event, { tooltip: tooltip } );
14047	},
14048
14049	_registerCloseHandlers: function( event, target ) {
14050		var events = {
14051			keyup: function( event ) {
14052				if ( event.keyCode === $.ui.keyCode.ESCAPE ) {
14053					var fakeEvent = $.Event(event);
14054					fakeEvent.currentTarget = target[0];
14055					this.close( fakeEvent, true );
14056				}
14057			}
14058		};
14059
14060		// Only bind remove handler for delegated targets. Non-delegated
14061		// tooltips will handle this in destroy.
14062		if ( target[ 0 ] !== this.element[ 0 ] ) {
14063			events.remove = function() {
14064				this._removeTooltip( this._find( target ).tooltip );
14065			};
14066		}
14067
14068		if ( !event || event.type === "mouseover" ) {
14069			events.mouseleave = "close";
14070		}
14071		if ( !event || event.type === "focusin" ) {
14072			events.focusout = "close";
14073		}
14074		this._on( true, target, events );
14075	},
14076
14077	close: function( event ) {
14078		var tooltip,
14079			that = this,
14080			target = $( event ? event.currentTarget : this.element ),
14081			tooltipData = this._find( target );
14082
14083		// The tooltip may already be closed
14084		if ( !tooltipData ) {
14085
14086			// We set ui-tooltip-open immediately upon open (in open()), but only set the
14087			// additional data once there's actually content to show (in _open()). So even if the
14088			// tooltip doesn't have full data, we always remove ui-tooltip-open in case we're in
14089			// the period between open() and _open().
14090			target.removeData( "ui-tooltip-open" );
14091			return;
14092		}
14093
14094		tooltip = tooltipData.tooltip;
14095
14096		// disabling closes the tooltip, so we need to track when we're closing
14097		// to avoid an infinite loop in case the tooltip becomes disabled on close
14098		if ( tooltipData.closing ) {
14099			return;
14100		}
14101
14102		// Clear the interval for delayed tracking tooltips
14103		clearInterval( this.delayedShow );
14104
14105		// only set title if we had one before (see comment in _open())
14106		// If the title attribute has changed since open(), don't restore
14107		if ( target.data( "ui-tooltip-title" ) && !target.attr( "title" ) ) {
14108			target.attr( "title", target.data( "ui-tooltip-title" ) );
14109		}
14110
14111		this._removeDescribedBy( target );
14112
14113		tooltipData.hiding = true;
14114		tooltip.stop( true );
14115		this._hide( tooltip, this.options.hide, function() {
14116			that._removeTooltip( $( this ) );
14117		});
14118
14119		target.removeData( "ui-tooltip-open" );
14120		this._off( target, "mouseleave focusout keyup" );
14121
14122		// Remove 'remove' binding only on delegated targets
14123		if ( target[ 0 ] !== this.element[ 0 ] ) {
14124			this._off( target, "remove" );
14125		}
14126		this._off( this.document, "mousemove" );
14127
14128		if ( event && event.type === "mouseleave" ) {
14129			$.each( this.parents, function( id, parent ) {
14130				$( parent.element ).attr( "title", parent.title );
14131				delete that.parents[ id ];
14132			});
14133		}
14134
14135		tooltipData.closing = true;
14136		this._trigger( "close", event, { tooltip: tooltip } );
14137		if ( !tooltipData.hiding ) {
14138			tooltipData.closing = false;
14139		}
14140	},
14141
14142	_tooltip: function( element ) {
14143		var tooltip = $( "<div>" )
14144				.attr( "role", "tooltip" )
14145				.addClass( "ui-tooltip ui-widget ui-corner-all ui-widget-content " +
14146					( this.options.tooltipClass || "" ) ),
14147			id = tooltip.uniqueId().attr( "id" );
14148
14149		$( "<div>" )
14150			.addClass( "ui-tooltip-content" )
14151			.appendTo( tooltip );
14152
14153		tooltip.appendTo( this.document[0].body );
14154
14155		return this.tooltips[ id ] = {
14156			element: element,
14157			tooltip: tooltip
14158		};
14159	},
14160
14161	_find: function( target ) {
14162		var id = target.data( "ui-tooltip-id" );
14163		return id ? this.tooltips[ id ] : null;
14164	},
14165
14166	_removeTooltip: function( tooltip ) {
14167		tooltip.remove();
14168		delete this.tooltips[ tooltip.attr( "id" ) ];
14169	},
14170
14171	_destroy: function() {
14172		var that = this;
14173
14174		// close open tooltips
14175		$.each( this.tooltips, function( id, tooltipData ) {
14176			// Delegate to close method to handle common cleanup
14177			var event = $.Event( "blur" ),
14178				element = tooltipData.element;
14179			event.target = event.currentTarget = element[ 0 ];
14180			that.close( event, true );
14181
14182			// Remove immediately; destroying an open tooltip doesn't use the
14183			// hide animation
14184			$( "#" + id ).remove();
14185
14186			// Restore the title
14187			if ( element.data( "ui-tooltip-title" ) ) {
14188				// If the title attribute has changed since open(), don't restore
14189				if ( !element.attr( "title" ) ) {
14190					element.attr( "title", element.data( "ui-tooltip-title" ) );
14191				}
14192				element.removeData( "ui-tooltip-title" );
14193			}
14194		});
14195		this.liveRegion.remove();
14196	}
14197});
14198
14199
14200/*!
14201 * jQuery UI Effects 1.11.4
14202 * http://jqueryui.com
14203 *
14204 * Copyright
vendor: 13,076 bytes, lines 14204-14738
14204 jQuery Foundation and other contributors
14205 * Released under the MIT license.
14206 * http://jquery.org/license
14207 *
14208 * http://api.jqueryui.com/category/effects-core/
14209 */
14210
14211
14212var dataSpace = "ui-effects-",
14213
14214	// Create a local jQuery because jQuery Color relies on it and the
14215	// global may not exist with AMD and a custom build (#10199)
14216	jQuery = $;
14217
14218$.effects = {
14219	effect: {}
14220};
14221
14222/*!
14223 * jQuery Color Animations v2.1.2
14224 * https://github.com/jquery/jquery-color
14225 *
14226 * Copyright 2014 jQuery Foundation and other contributors
14227 * Released under the MIT license.
14228 * http://jquery.org/license
14229 *
14230 * Date: Wed Jan 16 08:47:09 2013 -0600
14231 */
14232(function( jQuery, undefined ) {
14233
14234	var stepHooks = "backgroundColor borderBottomColor borderLeftColor borderRightColor borderTopColor color columnRuleColor outlineColor textDecorationColor textEmphasisColor",
14235
14236	// plusequals test for += 100 -= 100
14237	rplusequals = /^([\-+])=\s*(\d+\.?\d*)/,
14238	// a set of RE's that can match strings and generate color tuples.
14239	stringParsers = [ {
14240			re: /rgba?\(\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d{1,3})\s*(?:,\s*(\d?(?:\.\d+)?)\s*)?\)/,
14241			parse: function( execResult ) {
14242				return [
14243					execResult[ 1 ],
14244					execResult[ 2 ],
14245					execResult[ 3 ],
14246					execResult[ 4 ]
14247				];
14248			}
14249		}, {
14250			re: /rgba?\(\s*(\d+(?:\.\d+)?)\%\s*,\s*(\d+(?:\.\d+)?)\%\s*,\s*(\d+(?:\.\d+)?)\%\s*(?:,\s*(\d?(?:\.\d+)?)\s*)?\)/,
14251			parse: function( execResult ) {
14252				return [
14253					execResult[ 1 ] * 2.55,
14254					execResult[ 2 ] * 2.55,
14255					execResult[ 3 ] * 2.55,
14256					execResult[ 4 ]
14257				];
14258			}
14259		}, {
14260			// this regex ignores A-F because it's compared against an already lowercased string
14261			re: /#([a-f0-9]{2})([a-f0-9]{2})([a-f0-9]{2})/,
14262			parse: function( execResult ) {
14263				return [
14264					parseInt( execResult[ 1 ], 16 ),
14265					parseInt( execResult[ 2 ], 16 ),
14266					parseInt( execResult[ 3 ], 16 )
14267				];
14268			}
14269		}, {
14270			// this regex ignores A-F because it's compared against an already lowercased string
14271			re: /#([a-f0-9])([a-f0-9])([a-f0-9])/,
14272			parse: function( execResult ) {
14273				return [
14274					parseInt( execResult[ 1 ] + execResult[ 1 ], 16 ),
14275					parseInt( execResult[ 2 ] + execResult[ 2 ], 16 ),
14276					parseInt( execResult[ 3 ] + execResult[ 3 ], 16 )
14277				];
14278			}
14279		}, {
14280			re: /hsla?\(\s*(\d+(?:\.\d+)?)\s*,\s*(\d+(?:\.\d+)?)\%\s*,\s*(\d+(?:\.\d+)?)\%\s*(?:,\s*(\d?(?:\.\d+)?)\s*)?\)/,
14281			space: "hsla",
14282			parse: function( execResult ) {
14283				return [
14284					execResult[ 1 ],
14285					execResult[ 2 ] / 100,
14286					execResult[ 3 ] / 100,
14287					execResult[ 4 ]
14288				];
14289			}
14290		} ],
14291
14292	// jQuery.Color( )
14293	color = jQuery.Color = function( color, green, blue, alpha ) {
14294		return new jQuery.Color.fn.parse( color, green, blue, alpha );
14295	},
14296	spaces = {
14297		rgba: {
14298			props: {
14299				red: {
14300					idx: 0,
14301					type: "byte"
14302				},
14303				green: {
14304					idx: 1,
14305					type: "byte"
14306				},
14307				blue: {
14308					idx: 2,
14309					type: "byte"
14310				}
14311			}
14312		},
14313
14314		hsla: {
14315			props: {
14316				hue: {
14317					idx: 0,
14318					type: "degrees"
14319				},
14320				saturation: {
14321					idx: 1,
14322					type: "percent"
14323				},
14324				lightness: {
14325					idx: 2,
14326					type: "percent"
14327				}
14328			}
14329		}
14330	},
14331	propTypes = {
14332		"byte": {
14333			floor: true,
14334			max: 255
14335		},
14336		"percent": {
14337			max: 1
14338		},
14339		"degrees": {
14340			mod: 360,
14341			floor: true
14342		}
14343	},
14344	support = color.support = {},
14345
14346	// element for support tests
14347	supportElem = jQuery( "<p>" )[ 0 ],
14348
14349	// colors = jQuery.Color.names
14350	colors,
14351
14352	// local aliases of functions called often
14353	each = jQuery.each;
14354
14355// determine rgba support immediately
14356supportElem.style.cssText = "background-color:rgba(1,1,1,.5)";
14357support.rgba = supportElem.style.backgroundColor.indexOf( "rgba" ) > -1;
14358
14359// define cache name and alpha properties
14360// for rgba and hsla spaces
14361each( spaces, function( spaceName, space ) {
14362	space.cache = "_" + spaceName;
14363	space.props.alpha = {
14364		idx: 3,
14365		type: "percent",
14366		def: 1
14367	};
14368});
14369
14370function clamp( value, prop, allowEmpty ) {
14371	var type = propTypes[ prop.type ] || {};
14372
14373	if ( value == null ) {
14374		return (allowEmpty || !prop.def) ? null : prop.def;
14375	}
14376
14377	// ~~ is an short way of doing floor for positive numbers
14378	value = type.floor ? ~~value : parseFloat( value );
14379
14380	// IE will pass in empty strings as value for alpha,
14381	// which will hit this case
14382	if ( isNaN( value ) ) {
14383		return prop.def;
14384	}
14385
14386	if ( type.mod ) {
14387		// we add mod before modding to make sure that negatives values
14388		// get converted properly: -10 -> 350
14389		return (value + type.mod) % type.mod;
14390	}
14391
14392	// for now all property types without mod have min and max
14393	return 0 > value ? 0 : type.max < value ? type.max : value;
14394}
14395
14396function stringParse( string ) {
14397	var inst = color(),
14398		rgba = inst._rgba = [];
14399
14400	string = string.toLowerCase();
14401
14402	each( stringParsers, function( i, parser ) {
14403		var parsed,
14404			match = parser.re.exec( string ),
14405			values = match && parser.parse( match ),
14406			spaceName = parser.space || "rgba";
14407
14408		if ( values ) {
14409			parsed = inst[ spaceName ]( values );
14410
14411			// if this was an rgba parse the assignment might happen twice
14412			// oh well....
14413			inst[ spaces[ spaceName ].cache ] = parsed[ spaces[ spaceName ].cache ];
14414			rgba = inst._rgba = parsed._rgba;
14415
14416			// exit each( stringParsers ) here because we matched
14417			return false;
14418		}
14419	});
14420
14421	// Found a stringParser that handled it
14422	if ( rgba.length ) {
14423
14424		// if this came from a parsed string, force "transparent" when alpha is 0
14425		// chrome, (and maybe others) return "transparent" as rgba(0,0,0,0)
14426		if ( rgba.join() === "0,0,0,0" ) {
14427			jQuery.extend( rgba, colors.transparent );
14428		}
14429		return inst;
14430	}
14431
14432	// named colors
14433	return colors[ string ];
14434}
14435
14436color.fn = jQuery.extend( color.prototype, {
14437	parse: function( red, green, blue, alpha ) {
14438		if ( red === undefined ) {
14439			this._rgba = [ null, null, null, null ];
14440			return this;
14441		}
14442		if ( red.jquery || red.nodeType ) {
14443			red = jQuery( red ).css( green );
14444			green = undefined;
14445		}
14446
14447		var inst = this,
14448			type = jQuery.type( red ),
14449			rgba = this._rgba = [];
14450
14451		// more than 1 argument specified - assume ( red, green, blue, alpha )
14452		if ( green !== undefined ) {
14453			red = [ red, green, blue, alpha ];
14454			type = "array";
14455		}
14456
14457		if ( type === "string" ) {
14458			return this.parse( stringParse( red ) || colors._default );
14459		}
14460
14461		if ( type === "array" ) {
14462			each( spaces.rgba.props, function( key, prop ) {
14463				rgba[ prop.idx ] = clamp( red[ prop.idx ], prop );
14464			});
14465			return this;
14466		}
14467
14468		if ( type === "object" ) {
14469			if ( red instanceof color ) {
14470				each( spaces, function( spaceName, space ) {
14471					if ( red[ space.cache ] ) {
14472						inst[ space.cache ] = red[ space.cache ].slice();
14473					}
14474				});
14475			} else {
14476				each( spaces, function( spaceName, space ) {
14477					var cache = space.cache;
14478					each( space.props, function( key, prop ) {
14479
14480						// if the cache doesn't exist, and we know how to convert
14481						if ( !inst[ cache ] && space.to ) {
14482
14483							// if the value was null, we don't need to copy it
14484							// if the key was alpha, we don't need to copy it either
14485							if ( key === "alpha" || red[ key ] == null ) {
14486								return;
14487							}
14488							inst[ cache ] = space.to( inst._rgba );
14489						}
14490
14491						// this is the only case where we allow nulls for ALL properties.
14492						// call clamp with alwaysAllowEmpty
14493						inst[ cache ][ prop.idx ] = clamp( red[ key ], prop, true );
14494					});
14495
14496					// everything defined but alpha?
14497					if ( inst[ cache ] && jQuery.inArray( null, inst[ cache ].slice( 0, 3 ) ) < 0 ) {
14498						// use the default of 1
14499						inst[ cache ][ 3 ] = 1;
14500						if ( space.from ) {
14501							inst._rgba = space.from( inst[ cache ] );
14502						}
14503					}
14504				});
14505			}
14506			return this;
14507		}
14508	},
14509	is: function( compare ) {
14510		var is = color( compare ),
14511			same = true,
14512			inst = this;
14513
14514		each( spaces, function( _, space ) {
14515			var localCache,
14516				isCache = is[ space.cache ];
14517			if (isCache) {
14518				localCache = inst[ space.cache ] || space.to && space.to( inst._rgba ) || [];
14519				each( space.props, function( _, prop ) {
14520					if ( isCache[ prop.idx ] != null ) {
14521						same = ( isCache[ prop.idx ] === localCache[ prop.idx ] );
14522						return same;
14523					}
14524				});
14525			}
14526			return same;
14527		});
14528		return same;
14529	},
14530	_space: function() {
14531		var used = [],
14532			inst = this;
14533		each( spaces, function( spaceName, space ) {
14534			if ( inst[ space.cache ] ) {
14535				used.push( spaceName );
14536			}
14537		});
14538		return used.pop();
14539	},
14540	transition: function( other, distance ) {
14541		var end = color( other ),
14542			spaceName = end._space(),
14543			space = spaces[ spaceName ],
14544			startColor = this.alpha() === 0 ? color( "transparent" ) : this,
14545			start = startColor[ space.cache ] || space.to( startColor._rgba ),
14546			result = start.slice();
14547
14548		end = end[ space.cache ];
14549		each( space.props, function( key, prop ) {
14550			var index = prop.idx,
14551				startValue = start[ index ],
14552				endValue = end[ index ],
14553				type = propTypes[ prop.type ] || {};
14554
14555			// if null, don't override start value
14556			if ( endValue === null ) {
14557				return;
14558			}
14559			// if null - use end
14560			if ( startValue === null ) {
14561				result[ index ] = endValue;
14562			} else {
14563				if ( type.mod ) {
14564					if ( endValue - startValue > type.mod / 2 ) {
14565						startValue += type.mod;
14566					} else if ( startValue - endValue > type.mod / 2 ) {
14567						startValue -= type.mod;
14568					}
14569				}
14570				result[ index ] = clamp( ( endValue - startValue ) * distance + startValue, prop );
14571			}
14572		});
14573		return this[ spaceName ]( result );
14574	},
14575	blend: function( opaque ) {
14576		// if we are already opaque - return ourself
14577		if ( this._rgba[ 3 ] === 1 ) {
14578			return this;
14579		}
14580
14581		var rgb = this._rgba.slice(),
14582			a = rgb.pop(),
14583			blend = color( opaque )._rgba;
14584
14585		return color( jQuery.map( rgb, function( v, i ) {
14586			return ( 1 - a ) * blend[ i ] + a * v;
14587		}));
14588	},
14589	toRgbaString: function() {
14590		var prefix = "rgba(",
14591			rgba = jQuery.map( this._rgba, function( v, i ) {
14592				return v == null ? ( i > 2 ? 1 : 0 ) : v;
14593			});
14594
14595		if ( rgba[ 3 ] === 1 ) {
14596			rgba.pop();
14597			prefix = "rgb(";
14598		}
14599
14600		return prefix + rgba.join() + ")";
14601	},
14602	toHslaString: function() {
14603		var prefix = "hsla(",
14604			hsla = jQuery.map( this.hsla(), function( v, i ) {
14605				if ( v == null ) {
14606					v = i > 2 ? 1 : 0;
14607				}
14608
14609				// catch 1 and 2
14610				if ( i && i < 3 ) {
14611					v = Math.round( v * 100 ) + "%";
14612				}
14613				return v;
14614			});
14615
14616		if ( hsla[ 3 ] === 1 ) {
14617			hsla.pop();
14618			prefix = "hsl(";
14619		}
14620		return prefix + hsla.join() + ")";
14621	},
14622	toHexString: function( includeAlpha ) {
14623		var rgba = this._rgba.slice(),
14624			alpha = rgba.pop();
14625
14626		if ( includeAlpha ) {
14627			rgba.push( ~~( alpha * 255 ) );
14628		}
14629
14630		return "#" + jQuery.map( rgba, function( v ) {
14631
14632			// default to 0 when nulls exist
14633			v = ( v || 0 ).toString( 16 );
14634			return v.length === 1 ? "0" + v : v;
14635		}).join("");
14636	},
14637	toString: function() {
14638		return this._rgba[ 3 ] === 0 ? "transparent" : this.toRgbaString();
14639	}
14640});
14641color.fn.parse.prototype = color.fn;
14642
14643// hsla conversions adapted from:
14644// https://code.google.com/p/maashaack/source/browse/packages/graphics/trunk/src/graphics/colors/HUE2RGB.as?r=5021
14645
14646function hue2rgb( p, q, h ) {
14647	h = ( h + 1 ) % 1;
14648	if ( h * 6 < 1 ) {
14649		return p + ( q - p ) * h * 6;
14650	}
14651	if ( h * 2 < 1) {
14652		return q;
14653	}
14654	if ( h * 3 < 2 ) {
14655		return p + ( q - p ) * ( ( 2 / 3 ) - h ) * 6;
14656	}
14657	return p;
14658}
14659
14660spaces.hsla.to = function( rgba ) {
14661	if ( rgba[ 0 ] == null || rgba[ 1 ] == null || rgba[ 2 ] == null ) {
14662		return [ null, null, null, rgba[ 3 ] ];
14663	}
14664	var r = rgba[ 0 ] / 255,
14665		g = rgba[ 1 ] / 255,
14666		b = rgba[ 2 ] / 255,
14667		a = rgba[ 3 ],
14668		max = Math.max( r, g, b ),
14669		min = Math.min( r, g, b ),
14670		diff = max - min,
14671		add = max + min,
14672		l = add * 0.5,
14673		h, s;
14674
14675	if ( min === max ) {
14676		h = 0;
14677	} else if ( r === max ) {
14678		h = ( 60 * ( g - b ) / diff ) + 360;
14679	} else if ( g === max ) {
14680		h = ( 60 * ( b - r ) / diff ) + 120;
14681	} else {
14682		h = ( 60 * ( r - g ) / diff ) + 240;
14683	}
14684
14685	// chroma (diff) == 0 means greyscale which, by definition, saturation = 0%
14686	// otherwise, saturation is based on the ratio of chroma (diff) to lightness (add)
14687	if ( diff === 0 ) {
14688		s = 0;
14689	} else if ( l <= 0.5 ) {
14690		s = diff / add;
14691	} else {
14692		s = diff / ( 2 - add );
14693	}
14694	return [ Math.round(h) % 360, s, l, a == null ? 1 : a ];
14695};
14696
14697spaces.hsla.from = function( hsla ) {
14698	if ( hsla[ 0 ] == null || hsla[ 1 ] == null || hsla[ 2 ] == null ) {
14699		return [ null, null, null, hsla[ 3 ] ];
14700	}
14701	var h = hsla[ 0 ] / 360,
14702		s = hsla[ 1 ],
14703		l = hsla[ 2 ],
14704		a = hsla[ 3 ],
14705		q = l <= 0.5 ? l * ( 1 + s ) : l + s - l * s,
14706		p = 2 * l - q;
14707
14708	return [
14709		Math.round( hue2rgb( p, q, h + ( 1 / 3 ) ) * 255 ),
14710		Math.round( hue2rgb( p, q, h ) * 255 ),
14711		Math.round( hue2rgb( p, q, h - ( 1 / 3 ) ) * 255 ),
14712		a
14713	];
14714};
14715
14716each( spaces, function( spaceName, space ) {
14717	var props = space.props,
14718		cache = space.cache,
14719		to = space.to,
14720		from = space.from;
14721
14722	// makes rgba() and hsla()
14723	color.fn[ spaceName ] = function( value ) {
14724
14725		// generate a cache for this space if it doesn't exist
14726		if ( to && !this[ cache ] ) {
14727			this[ cache ] = to( this._rgba );
14728		}
14729		if ( value === undefined ) {
14730			return this[ cache ].slice();
14731		}
14732
14733		var ret,
14734			type = jQuery.type( value ),
14735			arr = ( type === "array" || type === "object" ) ? value : arguments,
14736			local = this[ cache ].slice();
14737
14738		each( props, function( key, prop ) {
vendor: 46,221 bytes, lines 14739-16621
14739			var val = arr[ type === "object" ? key : prop.idx ];
14740			if ( val == null ) {
14741				val = local[ prop.idx ];
14742			}
14743			local[ prop.idx ] = clamp( val, prop );
14744		});
14745
14746		if ( from ) {
14747			ret = color( from( local ) );
14748			ret[ cache ] = local;
14749			return ret;
14750		} else {
14751			return color( local );
14752		}
14753	};
14754
14755	// makes red() green() blue() alpha() hue() saturation() lightness()
14756	each( props, function( key, prop ) {
14757		// alpha is included in more than one space
14758		if ( color.fn[ key ] ) {
14759			return;
14760		}
14761		color.fn[ key ] = function( value ) {
14762			var vtype = jQuery.type( value ),
14763				fn = ( key === "alpha" ? ( this._hsla ? "hsla" : "rgba" ) : spaceName ),
14764				local = this[ fn ](),
14765				cur = local[ prop.idx ],
14766				match;
14767
14768			if ( vtype === "undefined" ) {
14769				return cur;
14770			}
14771
14772			if ( vtype === "function" ) {
14773				value = value.call( this, cur );
14774				vtype = jQuery.type( value );
14775			}
14776			if ( value == null && prop.empty ) {
14777				return this;
14778			}
14779			if ( vtype === "string" ) {
14780				match = rplusequals.exec( value );
14781				if ( match ) {
14782					value = cur + parseFloat( match[ 2 ] ) * ( match[ 1 ] === "+" ? 1 : -1 );
14783				}
14784			}
14785			local[ prop.idx ] = value;
14786			return this[ fn ]( local );
14787		};
14788	});
14789});
14790
14791// add cssHook and .fx.step function for each named hook.
14792// accept a space separated string of properties
14793color.hook = function( hook ) {
14794	var hooks = hook.split( " " );
14795	each( hooks, function( i, hook ) {
14796		jQuery.cssHooks[ hook ] = {
14797			set: function( elem, value ) {
14798				var parsed, curElem,
14799					backgroundColor = "";
14800
14801				if ( value !== "transparent" && ( jQuery.type( value ) !== "string" || ( parsed = stringParse( value ) ) ) ) {
14802					value = color( parsed || value );
14803					if ( !support.rgba && value._rgba[ 3 ] !== 1 ) {
14804						curElem = hook === "backgroundColor" ? elem.parentNode : elem;
14805						while (
14806							(backgroundColor === "" || backgroundColor === "transparent") &&
14807							curElem && curElem.style
14808						) {
14809							try {
14810								backgroundColor = jQuery.css( curElem, "backgroundColor" );
14811								curElem = curElem.parentNode;
14812							} catch ( e ) {
14813							}
14814						}
14815
14816						value = value.blend( backgroundColor && backgroundColor !== "transparent" ?
14817							backgroundColor :
14818							"_default" );
14819					}
14820
14821					value = value.toRgbaString();
14822				}
14823				try {
14824					elem.style[ hook ] = value;
14825				} catch ( e ) {
14826					// wrapped to prevent IE from throwing errors on "invalid" values like 'auto' or 'inherit'
14827				}
14828			}
14829		};
14830		jQuery.fx.step[ hook ] = function( fx ) {
14831			if ( !fx.colorInit ) {
14832				fx.start = color( fx.elem, hook );
14833				fx.end = color( fx.end );
14834				fx.colorInit = true;
14835			}
14836			jQuery.cssHooks[ hook ].set( fx.elem, fx.start.transition( fx.end, fx.pos ) );
14837		};
14838	});
14839
14840};
14841
14842color.hook( stepHooks );
14843
14844jQuery.cssHooks.borderColor = {
14845	expand: function( value ) {
14846		var expanded = {};
14847
14848		each( [ "Top", "Right", "Bottom", "Left" ], function( i, part ) {
14849			expanded[ "border" + part + "Color" ] = value;
14850		});
14851		return expanded;
14852	}
14853};
14854
14855// Basic color names only.
14856// Usage of any of the other color names requires adding yourself or including
14857// jquery.color.svg-names.js.
14858colors = jQuery.Color.names = {
14859	// 4.1. Basic color keywords
14860	aqua: "#00ffff",
14861	black: "#000000",
14862	blue: "#0000ff",
14863	fuchsia: "#ff00ff",
14864	gray: "#808080",
14865	green: "#008000",
14866	lime: "#00ff00",
14867	maroon: "#800000",
14868	navy: "#000080",
14869	olive: "#808000",
14870	purple: "#800080",
14871	red: "#ff0000",
14872	silver: "#c0c0c0",
14873	teal: "#008080",
14874	white: "#ffffff",
14875	yellow: "#ffff00",
14876
14877	// 4.2.3. "transparent" color keyword
14878	transparent: [ null, null, null, 0 ],
14879
14880	_default: "#ffffff"
14881};
14882
14883})( jQuery );
14884
14885/******************************************************************************/
14886/****************************** CLASS ANIMATIONS ******************************/
14887/******************************************************************************/
14888(function() {
14889
14890var classAnimationActions = [ "add", "remove", "toggle" ],
14891	shorthandStyles = {
14892		border: 1,
14893		borderBottom: 1,
14894		borderColor: 1,
14895		borderLeft: 1,
14896		borderRight: 1,
14897		borderTop: 1,
14898		borderWidth: 1,
14899		margin: 1,
14900		padding: 1
14901	};
14902
14903$.each([ "borderLeftStyle", "borderRightStyle", "borderBottomStyle", "borderTopStyle" ], function( _, prop ) {
14904	$.fx.step[ prop ] = function( fx ) {
14905		if ( fx.end !== "none" && !fx.setAttr || fx.pos === 1 && !fx.setAttr ) {
14906			jQuery.style( fx.elem, prop, fx.end );
14907			fx.setAttr = true;
14908		}
14909	};
14910});
14911
14912function getElementStyles( elem ) {
14913	var key, len,
14914		style = elem.ownerDocument.defaultView ?
14915			elem.ownerDocument.defaultView.getComputedStyle( elem, null ) :
14916			elem.currentStyle,
14917		styles = {};
14918
14919	if ( style && style.length && style[ 0 ] && style[ style[ 0 ] ] ) {
14920		len = style.length;
14921		while ( len-- ) {
14922			key = style[ len ];
14923			if ( typeof style[ key ] === "string" ) {
14924				styles[ $.camelCase( key ) ] = style[ key ];
14925			}
14926		}
14927	// support: Opera, IE <9
14928	} else {
14929		for ( key in style ) {
14930			if ( typeof style[ key ] === "string" ) {
14931				styles[ key ] = style[ key ];
14932			}
14933		}
14934	}
14935
14936	return styles;
14937}
14938
14939function styleDifference( oldStyle, newStyle ) {
14940	var diff = {},
14941		name, value;
14942
14943	for ( name in newStyle ) {
14944		value = newStyle[ name ];
14945		if ( oldStyle[ name ] !== value ) {
14946			if ( !shorthandStyles[ name ] ) {
14947				if ( $.fx.step[ name ] || !isNaN( parseFloat( value ) ) ) {
14948					diff[ name ] = value;
14949				}
14950			}
14951		}
14952	}
14953
14954	return diff;
14955}
14956
14957// support: jQuery <1.8
14958if ( !$.fn.addBack ) {
14959	$.fn.addBack = function( selector ) {
14960		return this.add( selector == null ?
14961			this.prevObject : this.prevObject.filter( selector )
14962		);
14963	};
14964}
14965
14966$.effects.animateClass = function( value, duration, easing, callback ) {
14967	var o = $.speed( duration, easing, callback );
14968
14969	return this.queue( function() {
14970		var animated = $( this ),
14971			baseClass = animated.attr( "class" ) || "",
14972			applyClassChange,
14973			allAnimations = o.children ? animated.find( "*" ).addBack() : animated;
14974
14975		// map the animated objects to store the original styles.
14976		allAnimations = allAnimations.map(function() {
14977			var el = $( this );
14978			return {
14979				el: el,
14980				start: getElementStyles( this )
14981			};
14982		});
14983
14984		// apply class change
14985		applyClassChange = function() {
14986			$.each( classAnimationActions, function(i, action) {
14987				if ( value[ action ] ) {
14988					animated[ action + "Class" ]( value[ action ] );
14989				}
14990			});
14991		};
14992		applyClassChange();
14993
14994		// map all animated objects again - calculate new styles and diff
14995		allAnimations = allAnimations.map(function() {
14996			this.end = getElementStyles( this.el[ 0 ] );
14997			this.diff = styleDifference( this.start, this.end );
14998			return this;
14999		});
15000
15001		// apply original class
15002		animated.attr( "class", baseClass );
15003
15004		// map all animated objects again - this time collecting a promise
15005		allAnimations = allAnimations.map(function() {
15006			var styleInfo = this,
15007				dfd = $.Deferred(),
15008				opts = $.extend({}, o, {
15009					queue: false,
15010					complete: function() {
15011						dfd.resolve( styleInfo );
15012					}
15013				});
15014
15015			this.el.animate( this.diff, opts );
15016			return dfd.promise();
15017		});
15018
15019		// once all animations have completed:
15020		$.when.apply( $, allAnimations.get() ).done(function() {
15021
15022			// set the final class
15023			applyClassChange();
15024
15025			// for each animated element,
15026			// clear all css properties that were animated
15027			$.each( arguments, function() {
15028				var el = this.el;
15029				$.each( this.diff, function(key) {
15030					el.css( key, "" );
15031				});
15032			});
15033
15034			// this is guarnteed to be there if you use jQuery.speed()
15035			// it also handles dequeuing the next anim...
15036			o.complete.call( animated[ 0 ] );
15037		});
15038	});
15039};
15040
15041$.fn.extend({
15042	addClass: (function( orig ) {
15043		return function( classNames, speed, easing, callback ) {
15044			return speed ?
15045				$.effects.animateClass.call( this,
15046					{ add: classNames }, speed, easing, callback ) :
15047				orig.apply( this, arguments );
15048		};
15049	})( $.fn.addClass ),
15050
15051	removeClass: (function( orig ) {
15052		return function( classNames, speed, easing, callback ) {
15053			return arguments.length > 1 ?
15054				$.effects.animateClass.call( this,
15055					{ remove: classNames }, speed, easing, callback ) :
15056				orig.apply( this, arguments );
15057		};
15058	})( $.fn.removeClass ),
15059
15060	toggleClass: (function( orig ) {
15061		return function( classNames, force, speed, easing, callback ) {
15062			if ( typeof force === "boolean" || force === undefined ) {
15063				if ( !speed ) {
15064					// without speed parameter
15065					return orig.apply( this, arguments );
15066				} else {
15067					return $.effects.animateClass.call( this,
15068						(force ? { add: classNames } : { remove: classNames }),
15069						speed, easing, callback );
15070				}
15071			} else {
15072				// without force parameter
15073				return $.effects.animateClass.call( this,
15074					{ toggle: classNames }, force, speed, easing );
15075			}
15076		};
15077	})( $.fn.toggleClass ),
15078
15079	switchClass: function( remove, add, speed, easing, callback) {
15080		return $.effects.animateClass.call( this, {
15081			add: add,
15082			remove: remove
15083		}, speed, easing, callback );
15084	}
15085});
15086
15087})();
15088
15089/******************************************************************************/
15090/*********************************** EFFECTS **********************************/
15091/******************************************************************************/
15092
15093(function() {
15094
15095$.extend( $.effects, {
15096	version: "1.11.4",
15097
15098	// Saves a set of properties in a data storage
15099	save: function( element, set ) {
15100		for ( var i = 0; i < set.length; i++ ) {
15101			if ( set[ i ] !== null ) {
15102				element.data( dataSpace + set[ i ], element[ 0 ].style[ set[ i ] ] );
15103			}
15104		}
15105	},
15106
15107	// Restores a set of previously saved properties from a data storage
15108	restore: function( element, set ) {
15109		var val, i;
15110		for ( i = 0; i < set.length; i++ ) {
15111			if ( set[ i ] !== null ) {
15112				val = element.data( dataSpace + set[ i ] );
15113				// support: jQuery 1.6.2
15114				// http://bugs.jquery.com/ticket/9917
15115				// jQuery 1.6.2 incorrectly returns undefined for any falsy value.
15116				// We can't differentiate between "" and 0 here, so we just assume
15117				// empty string since it's likely to be a more common value...
15118				if ( val === undefined ) {
15119					val = "";
15120				}
15121				element.css( set[ i ], val );
15122			}
15123		}
15124	},
15125
15126	setMode: function( el, mode ) {
15127		if (mode === "toggle") {
15128			mode = el.is( ":hidden" ) ? "show" : "hide";
15129		}
15130		return mode;
15131	},
15132
15133	// Translates a [top,left] array into a baseline value
15134	// this should be a little more flexible in the future to handle a string & hash
15135	getBaseline: function( origin, original ) {
15136		var y, x;
15137		switch ( origin[ 0 ] ) {
15138			case "top": y = 0; break;
15139			case "middle": y = 0.5; break;
15140			case "bottom": y = 1; break;
15141			default: y = origin[ 0 ] / original.height;
15142		}
15143		switch ( origin[ 1 ] ) {
15144			case "left": x = 0; break;
15145			case "center": x = 0.5; break;
15146			case "right": x = 1; break;
15147			default: x = origin[ 1 ] / original.width;
15148		}
15149		return {
15150			x: x,
15151			y: y
15152		};
15153	},
15154
15155	// Wraps the element around a wrapper that copies position properties
15156	createWrapper: function( element ) {
15157
15158		// if the element is already wrapped, return it
15159		if ( element.parent().is( ".ui-effects-wrapper" )) {
15160			return element.parent();
15161		}
15162
15163		// wrap the element
15164		var props = {
15165				width: element.outerWidth(true),
15166				height: element.outerHeight(true),
15167				"float": element.css( "float" )
15168			},
15169			wrapper = $( "<div></div>" )
15170				.addClass( "ui-effects-wrapper" )
15171				.css({
15172					fontSize: "100%",
15173					background: "transparent",
15174					border: "none",
15175					margin: 0,
15176					padding: 0
15177				}),
15178			// Store the size in case width/height are defined in % - Fixes #5245
15179			size = {
15180				width: element.width(),
15181				height: element.height()
15182			},
15183			active = document.activeElement;
15184
15185		// support: Firefox
15186		// Firefox incorrectly exposes anonymous content
15187		// https://bugzilla.mozilla.org/show_bug.cgi?id=561664
15188		try {
15189			active.id;
15190		} catch ( e ) {
15191			active = document.body;
15192		}
15193
15194		element.wrap( wrapper );
15195
15196		// Fixes #7595 - Elements lose focus when wrapped.
15197		if ( element[ 0 ] === active || $.contains( element[ 0 ], active ) ) {
15198			$( active ).focus();
15199		}
15200
15201		wrapper = element.parent(); //Hotfix for jQuery 1.4 since some change in wrap() seems to actually lose the reference to the wrapped element
15202
15203		// transfer positioning properties to the wrapper
15204		if ( element.css( "position" ) === "static" ) {
15205			wrapper.css({ position: "relative" });
15206			element.css({ position: "relative" });
15207		} else {
15208			$.extend( props, {
15209				position: element.css( "position" ),
15210				zIndex: element.css( "z-index" )
15211			});
15212			$.each([ "top", "left", "bottom", "right" ], function(i, pos) {
15213				props[ pos ] = element.css( pos );
15214				if ( isNaN( parseInt( props[ pos ], 10 ) ) ) {
15215					props[ pos ] = "auto";
15216				}
15217			});
15218			element.css({
15219				position: "relative",
15220				top: 0,
15221				left: 0,
15222				right: "auto",
15223				bottom: "auto"
15224			});
15225		}
15226		element.css(size);
15227
15228		return wrapper.css( props ).show();
15229	},
15230
15231	removeWrapper: function( element ) {
15232		var active = document.activeElement;
15233
15234		if ( element.parent().is( ".ui-effects-wrapper" ) ) {
15235			element.parent().replaceWith( element );
15236
15237			// Fixes #7595 - Elements lose focus when wrapped.
15238			if ( element[ 0 ] === active || $.contains( element[ 0 ], active ) ) {
15239				$( active ).focus();
15240			}
15241		}
15242
15243		return element;
15244	},
15245
15246	setTransition: function( element, list, factor, value ) {
15247		value = value || {};
15248		$.each( list, function( i, x ) {
15249			var unit = element.cssUnit( x );
15250			if ( unit[ 0 ] > 0 ) {
15251				value[ x ] = unit[ 0 ] * factor + unit[ 1 ];
15252			}
15253		});
15254		return value;
15255	}
15256});
15257
15258// return an effect options object for the given parameters:
15259function _normalizeArguments( effect, options, speed, callback ) {
15260
15261	// allow passing all options as the first parameter
15262	if ( $.isPlainObject( effect ) ) {
15263		options = effect;
15264		effect = effect.effect;
15265	}
15266
15267	// convert to an object
15268	effect = { effect: effect };
15269
15270	// catch (effect, null, ...)
15271	if ( options == null ) {
15272		options = {};
15273	}
15274
15275	// catch (effect, callback)
15276	if ( $.isFunction( options ) ) {
15277		callback = options;
15278		speed = null;
15279		options = {};
15280	}
15281
15282	// catch (effect, speed, ?)
15283	if ( typeof options === "number" || $.fx.speeds[ options ] ) {
15284		callback = speed;
15285		speed = options;
15286		options = {};
15287	}
15288
15289	// catch (effect, options, callback)
15290	if ( $.isFunction( speed ) ) {
15291		callback = speed;
15292		speed = null;
15293	}
15294
15295	// add options to effect
15296	if ( options ) {
15297		$.extend( effect, options );
15298	}
15299
15300	speed = speed || options.duration;
15301	effect.duration = $.fx.off ? 0 :
15302		typeof speed === "number" ? speed :
15303		speed in $.fx.speeds ? $.fx.speeds[ speed ] :
15304		$.fx.speeds._default;
15305
15306	effect.complete = callback || options.complete;
15307
15308	return effect;
15309}
15310
15311function standardAnimationOption( option ) {
15312	// Valid standard speeds (nothing, number, named speed)
15313	if ( !option || typeof option === "number" || $.fx.speeds[ option ] ) {
15314		return true;
15315	}
15316
15317	// Invalid strings - treat as "normal" speed
15318	if ( typeof option === "string" && !$.effects.effect[ option ] ) {
15319		return true;
15320	}
15321
15322	// Complete callback
15323	if ( $.isFunction( option ) ) {
15324		return true;
15325	}
15326
15327	// Options hash (but not naming an effect)
15328	if ( typeof option === "object" && !option.effect ) {
15329		return true;
15330	}
15331
15332	// Didn't match any standard API
15333	return false;
15334}
15335
15336$.fn.extend({
15337	effect: function( /* effect, options, speed, callback */ ) {
15338		var args = _normalizeArguments.apply( this, arguments ),
15339			mode = args.mode,
15340			queue = args.queue,
15341			effectMethod = $.effects.effect[ args.effect ];
15342
15343		if ( $.fx.off || !effectMethod ) {
15344			// delegate to the original method (e.g., .show()) if possible
15345			if ( mode ) {
15346				return this[ mode ]( args.duration, args.complete );
15347			} else {
15348				return this.each( function() {
15349					if ( args.complete ) {
15350						args.complete.call( this );
15351					}
15352				});
15353			}
15354		}
15355
15356		function run( next ) {
15357			var elem = $( this ),
15358				complete = args.complete,
15359				mode = args.mode;
15360
15361			function done() {
15362				if ( $.isFunction( complete ) ) {
15363					complete.call( elem[0] );
15364				}
15365				if ( $.isFunction( next ) ) {
15366					next();
15367				}
15368			}
15369
15370			// If the element already has the correct final state, delegate to
15371			// the core methods so the internal tracking of "olddisplay" works.
15372			if ( elem.is( ":hidden" ) ? mode === "hide" : mode === "show" ) {
15373				elem[ mode ]();
15374				done();
15375			} else {
15376				effectMethod.call( elem[0], args, done );
15377			}
15378		}
15379
15380		return queue === false ? this.each( run ) : this.queue( queue || "fx", run );
15381	},
15382
15383	show: (function( orig ) {
15384		return function( option ) {
15385			if ( standardAnimationOption( option ) ) {
15386				return orig.apply( this, arguments );
15387			} else {
15388				var args = _normalizeArguments.apply( this, arguments );
15389				args.mode = "show";
15390				return this.effect.call( this, args );
15391			}
15392		};
15393	})( $.fn.show ),
15394
15395	hide: (function( orig ) {
15396		return function( option ) {
15397			if ( standardAnimationOption( option ) ) {
15398				return orig.apply( this, arguments );
15399			} else {
15400				var args = _normalizeArguments.apply( this, arguments );
15401				args.mode = "hide";
15402				return this.effect.call( this, args );
15403			}
15404		};
15405	})( $.fn.hide ),
15406
15407	toggle: (function( orig ) {
15408		return function( option ) {
15409			if ( standardAnimationOption( option ) || typeof option === "boolean" ) {
15410				return orig.apply( this, arguments );
15411			} else {
15412				var args = _normalizeArguments.apply( this, arguments );
15413				args.mode = "toggle";
15414				return this.effect.call( this, args );
15415			}
15416		};
15417	})( $.fn.toggle ),
15418
15419	// helper functions
15420	cssUnit: function(key) {
15421		var style = this.css( key ),
15422			val = [];
15423
15424		$.each( [ "em", "px", "%", "pt" ], function( i, unit ) {
15425			if ( style.indexOf( unit ) > 0 ) {
15426				val = [ parseFloat( style ), unit ];
15427			}
15428		});
15429		return val;
15430	}
15431});
15432
15433})();
15434
15435/******************************************************************************/
15436/*********************************** EASING ***********************************/
15437/******************************************************************************/
15438
15439(function() {
15440
15441// based on easing equations from Robert Penner (http://www.robertpenner.com/easing)
15442
15443var baseEasings = {};
15444
15445$.each( [ "Quad", "Cubic", "Quart", "Quint", "Expo" ], function( i, name ) {
15446	baseEasings[ name ] = function( p ) {
15447		return Math.pow( p, i + 2 );
15448	};
15449});
15450
15451$.extend( baseEasings, {
15452	Sine: function( p ) {
15453		return 1 - Math.cos( p * Math.PI / 2 );
15454	},
15455	Circ: function( p ) {
15456		return 1 - Math.sqrt( 1 - p * p );
15457	},
15458	Elastic: function( p ) {
15459		return p === 0 || p === 1 ? p :
15460			-Math.pow( 2, 8 * (p - 1) ) * Math.sin( ( (p - 1) * 80 - 7.5 ) * Math.PI / 15 );
15461	},
15462	Back: function( p ) {
15463		return p * p * ( 3 * p - 2 );
15464	},
15465	Bounce: function( p ) {
15466		var pow2,
15467			bounce = 4;
15468
15469		while ( p < ( ( pow2 = Math.pow( 2, --bounce ) ) - 1 ) / 11 ) {}
15470		return 1 / Math.pow( 4, 3 - bounce ) - 7.5625 * Math.pow( ( pow2 * 3 - 2 ) / 22 - p, 2 );
15471	}
15472});
15473
15474$.each( baseEasings, function( name, easeIn ) {
15475	$.easing[ "easeIn" + name ] = easeIn;
15476	$.easing[ "easeOut" + name ] = function( p ) {
15477		return 1 - easeIn( 1 - p );
15478	};
15479	$.easing[ "easeInOut" + name ] = function( p ) {
15480		return p < 0.5 ?
15481			easeIn( p * 2 ) / 2 :
15482			1 - easeIn( p * -2 + 2 ) / 2;
15483	};
15484});
15485
15486})();
15487
15488var effect = $.effects;
15489
15490
15491/*!
15492 * jQuery UI Effects Blind 1.11.4
15493 * http://jqueryui.com
15494 *
15495 * Copyright jQuery Foundation and other contributors
15496 * Released under the MIT license.
15497 * http://jquery.org/license
15498 *
15499 * http://api.jqueryui.com/blind-effect/
15500 */
15501
15502
15503var effectBlind = $.effects.effect.blind = function( o, done ) {
15504	// Create element
15505	var el = $( this ),
15506		rvertical = /up|down|vertical/,
15507		rpositivemotion = /up|left|vertical|horizontal/,
15508		props = [ "position", "top", "bottom", "left", "right", "height", "width" ],
15509		mode = $.effects.setMode( el, o.mode || "hide" ),
15510		direction = o.direction || "up",
15511		vertical = rvertical.test( direction ),
15512		ref = vertical ? "height" : "width",
15513		ref2 = vertical ? "top" : "left",
15514		motion = rpositivemotion.test( direction ),
15515		animation = {},
15516		show = mode === "show",
15517		wrapper, distance, margin;
15518
15519	// if already wrapped, the wrapper's properties are my property. #6245
15520	if ( el.parent().is( ".ui-effects-wrapper" ) ) {
15521		$.effects.save( el.parent(), props );
15522	} else {
15523		$.effects.save( el, props );
15524	}
15525	el.show();
15526	wrapper = $.effects.createWrapper( el ).css({
15527		overflow: "hidden"
15528	});
15529
15530	distance = wrapper[ ref ]();
15531	margin = parseFloat( wrapper.css( ref2 ) ) || 0;
15532
15533	animation[ ref ] = show ? distance : 0;
15534	if ( !motion ) {
15535		el
15536			.css( vertical ? "bottom" : "right", 0 )
15537			.css( vertical ? "top" : "left", "auto" )
15538			.css({ position: "absolute" });
15539
15540		animation[ ref2 ] = show ? margin : distance + margin;
15541	}
15542
15543	// start at 0 if we are showing
15544	if ( show ) {
15545		wrapper.css( ref, 0 );
15546		if ( !motion ) {
15547			wrapper.css( ref2, margin + distance );
15548		}
15549	}
15550
15551	// Animate
15552	wrapper.animate( animation, {
15553		duration: o.duration,
15554		easing: o.easing,
15555		queue: false,
15556		complete: function() {
15557			if ( mode === "hide" ) {
15558				el.hide();
15559			}
15560			$.effects.restore( el, props );
15561			$.effects.removeWrapper( el );
15562			done();
15563		}
15564	});
15565};
15566
15567
15568/*!
15569 * jQuery UI Effects Bounce 1.11.4
15570 * http://jqueryui.com
15571 *
15572 * Copyright jQuery Foundation and other contributors
15573 * Released under the MIT license.
15574 * http://jquery.org/license
15575 *
15576 * http://api.jqueryui.com/bounce-effect/
15577 */
15578
15579
15580var effectBounce = $.effects.effect.bounce = function( o, done ) {
15581	var el = $( this ),
15582		props = [ "position", "top", "bottom", "left", "right", "height", "width" ],
15583
15584		// defaults:
15585		mode = $.effects.setMode( el, o.mode || "effect" ),
15586		hide = mode === "hide",
15587		show = mode === "show",
15588		direction = o.direction || "up",
15589		distance = o.distance,
15590		times = o.times || 5,
15591
15592		// number of internal animations
15593		anims = times * 2 + ( show || hide ? 1 : 0 ),
15594		speed = o.duration / anims,
15595		easing = o.easing,
15596
15597		// utility:
15598		ref = ( direction === "up" || direction === "down" ) ? "top" : "left",
15599		motion = ( direction === "up" || direction === "left" ),
15600		i,
15601		upAnim,
15602		downAnim,
15603
15604		// we will need to re-assemble the queue to stack our animations in place
15605		queue = el.queue(),
15606		queuelen = queue.length;
15607
15608	// Avoid touching opacity to prevent clearType and PNG issues in IE
15609	if ( show || hide ) {
15610		props.push( "opacity" );
15611	}
15612
15613	$.effects.save( el, props );
15614	el.show();
15615	$.effects.createWrapper( el ); // Create Wrapper
15616
15617	// default distance for the BIGGEST bounce is the outer Distance / 3
15618	if ( !distance ) {
15619		distance = el[ ref === "top" ? "outerHeight" : "outerWidth" ]() / 3;
15620	}
15621
15622	if ( show ) {
15623		downAnim = { opacity: 1 };
15624		downAnim[ ref ] = 0;
15625
15626		// if we are showing, force opacity 0 and set the initial position
15627		// then do the "first" animation
15628		el.css( "opacity", 0 )
15629			.css( ref, motion ? -distance * 2 : distance * 2 )
15630			.animate( downAnim, speed, easing );
15631	}
15632
15633	// start at the smallest distance if we are hiding
15634	if ( hide ) {
15635		distance = distance / Math.pow( 2, times - 1 );
15636	}
15637
15638	downAnim = {};
15639	downAnim[ ref ] = 0;
15640	// Bounces up/down/left/right then back to 0 -- times * 2 animations happen here
15641	for ( i = 0; i < times; i++ ) {
15642		upAnim = {};
15643		upAnim[ ref ] = ( motion ? "-=" : "+=" ) + distance;
15644
15645		el.animate( upAnim, speed, easing )
15646			.animate( downAnim, speed, easing );
15647
15648		distance = hide ? distance * 2 : distance / 2;
15649	}
15650
15651	// Last Bounce when Hiding
15652	if ( hide ) {
15653		upAnim = { opacity: 0 };
15654		upAnim[ ref ] = ( motion ? "-=" : "+=" ) + distance;
15655
15656		el.animate( upAnim, speed, easing );
15657	}
15658
15659	el.queue(function() {
15660		if ( hide ) {
15661			el.hide();
15662		}
15663		$.effects.restore( el, props );
15664		$.effects.removeWrapper( el );
15665		done();
15666	});
15667
15668	// inject all the animations we just queued to be first in line (after "inprogress")
15669	if ( queuelen > 1) {
15670		queue.splice.apply( queue,
15671			[ 1, 0 ].concat( queue.splice( queuelen, anims + 1 ) ) );
15672	}
15673	el.dequeue();
15674
15675};
15676
15677
15678/*!
15679 * jQuery UI Effects Clip 1.11.4
15680 * http://jqueryui.com
15681 *
15682 * Copyright jQuery Foundation and other contributors
15683 * Released under the MIT license.
15684 * http://jquery.org/license
15685 *
15686 * http://api.jqueryui.com/clip-effect/
15687 */
15688
15689
15690var effectClip = $.effects.effect.clip = function( o, done ) {
15691	// Create element
15692	var el = $( this ),
15693		props = [ "position", "top", "bottom", "left", "right", "height", "width" ],
15694		mode = $.effects.setMode( el, o.mode || "hide" ),
15695		show = mode === "show",
15696		direction = o.direction || "vertical",
15697		vert = direction === "vertical",
15698		size = vert ? "height" : "width",
15699		position = vert ? "top" : "left",
15700		animation = {},
15701		wrapper, animate, distance;
15702
15703	// Save & Show
15704	$.effects.save( el, props );
15705	el.show();
15706
15707	// Create Wrapper
15708	wrapper = $.effects.createWrapper( el ).css({
15709		overflow: "hidden"
15710	});
15711	animate = ( el[0].tagName === "IMG" ) ? wrapper : el;
15712	distance = animate[ size ]();
15713
15714	// Shift
15715	if ( show ) {
15716		animate.css( size, 0 );
15717		animate.css( position, distance / 2 );
15718	}
15719
15720	// Create Animation Object:
15721	animation[ size ] = show ? distance : 0;
15722	animation[ position ] = show ? 0 : distance / 2;
15723
15724	// Animate
15725	animate.animate( animation, {
15726		queue: false,
15727		duration: o.duration,
15728		easing: o.easing,
15729		complete: function() {
15730			if ( !show ) {
15731				el.hide();
15732			}
15733			$.effects.restore( el, props );
15734			$.effects.removeWrapper( el );
15735			done();
15736		}
15737	});
15738
15739};
15740
15741
15742/*!
15743 * jQuery UI Effects Drop 1.11.4
15744 * http://jqueryui.com
15745 *
15746 * Copyright jQuery Foundation and other contributors
15747 * Released under the MIT license.
15748 * http://jquery.org/license
15749 *
15750 * http://api.jqueryui.com/drop-effect/
15751 */
15752
15753
15754var effectDrop = $.effects.effect.drop = function( o, done ) {
15755
15756	var el = $( this ),
15757		props = [ "position", "top", "bottom", "left", "right", "opacity", "height", "width" ],
15758		mode = $.effects.setMode( el, o.mode || "hide" ),
15759		show = mode === "show",
15760		direction = o.direction || "left",
15761		ref = ( direction === "up" || direction === "down" ) ? "top" : "left",
15762		motion = ( direction === "up" || direction === "left" ) ? "pos" : "neg",
15763		animation = {
15764			opacity: show ? 1 : 0
15765		},
15766		distance;
15767
15768	// Adjust
15769	$.effects.save( el, props );
15770	el.show();
15771	$.effects.createWrapper( el );
15772
15773	distance = o.distance || el[ ref === "top" ? "outerHeight" : "outerWidth" ]( true ) / 2;
15774
15775	if ( show ) {
15776		el
15777			.css( "opacity", 0 )
15778			.css( ref, motion === "pos" ? -distance : distance );
15779	}
15780
15781	// Animation
15782	animation[ ref ] = ( show ?
15783		( motion === "pos" ? "+=" : "-=" ) :
15784		( motion === "pos" ? "-=" : "+=" ) ) +
15785		distance;
15786
15787	// Animate
15788	el.animate( animation, {
15789		queue: false,
15790		duration: o.duration,
15791		easing: o.easing,
15792		complete: function() {
15793			if ( mode === "hide" ) {
15794				el.hide();
15795			}
15796			$.effects.restore( el, props );
15797			$.effects.removeWrapper( el );
15798			done();
15799		}
15800	});
15801};
15802
15803
15804/*!
15805 * jQuery UI Effects Explode 1.11.4
15806 * http://jqueryui.com
15807 *
15808 * Copyright jQuery Foundation and other contributors
15809 * Released under the MIT license.
15810 * http://jquery.org/license
15811 *
15812 * http://api.jqueryui.com/explode-effect/
15813 */
15814
15815
15816var effectExplode = $.effects.effect.explode = function( o, done ) {
15817
15818	var rows = o.pieces ? Math.round( Math.sqrt( o.pieces ) ) : 3,
15819		cells = rows,
15820		el = $( this ),
15821		mode = $.effects.setMode( el, o.mode || "hide" ),
15822		show = mode === "show",
15823
15824		// show and then visibility:hidden the element before calculating offset
15825		offset = el.show().css( "visibility", "hidden" ).offset(),
15826
15827		// width and height of a piece
15828		width = Math.ceil( el.outerWidth() / cells ),
15829		height = Math.ceil( el.outerHeight() / rows ),
15830		pieces = [],
15831
15832		// loop
15833		i, j, left, top, mx, my;
15834
15835	// children animate complete:
15836	function childComplete() {
15837		pieces.push( this );
15838		if ( pieces.length === rows * cells ) {
15839			animComplete();
15840		}
15841	}
15842
15843	// clone the element for each row and cell.
15844	for ( i = 0; i < rows ; i++ ) { // ===>
15845		top = offset.top + i * height;
15846		my = i - ( rows - 1 ) / 2 ;
15847
15848		for ( j = 0; j < cells ; j++ ) { // |||
15849			left = offset.left + j * width;
15850			mx = j - ( cells - 1 ) / 2 ;
15851
15852			// Create a clone of the now hidden main element that will be absolute positioned
15853			// within a wrapper div off the -left and -top equal to size of our pieces
15854			el
15855				.clone()
15856				.appendTo( "body" )
15857				.wrap( "<div></div>" )
15858				.css({
15859					position: "absolute",
15860					visibility: "visible",
15861					left: -j * width,
15862					top: -i * height
15863				})
15864
15865			// select the wrapper - make it overflow: hidden and absolute positioned based on
15866			// where the original was located +left and +top equal to the size of pieces
15867				.parent()
15868				.addClass( "ui-effects-explode" )
15869				.css({
15870					position: "absolute",
15871					overflow: "hidden",
15872					width: width,
15873					height: height,
15874					left: left + ( show ? mx * width : 0 ),
15875					top: top + ( show ? my * height : 0 ),
15876					opacity: show ? 0 : 1
15877				}).animate({
15878					left: left + ( show ? 0 : mx * width ),
15879					top: top + ( show ? 0 : my * height ),
15880					opacity: show ? 1 : 0
15881				}, o.duration || 500, o.easing, childComplete );
15882		}
15883	}
15884
15885	function animComplete() {
15886		el.css({
15887			visibility: "visible"
15888		});
15889		$( pieces ).remove();
15890		if ( !show ) {
15891			el.hide();
15892		}
15893		done();
15894	}
15895};
15896
15897
15898/*!
15899 * jQuery UI Effects Fade 1.11.4
15900 * http://jqueryui.com
15901 *
15902 * Copyright jQuery Foundation and other contributors
15903 * Released under the MIT license.
15904 * http://jquery.org/license
15905 *
15906 * http://api.jqueryui.com/fade-effect/
15907 */
15908
15909
15910var effectFade = $.effects.effect.fade = function( o, done ) {
15911	var el = $( this ),
15912		mode = $.effects.setMode( el, o.mode || "toggle" );
15913
15914	el.animate({
15915		opacity: mode
15916	}, {
15917		queue: false,
15918		duration: o.duration,
15919		easing: o.easing,
15920		complete: done
15921	});
15922};
15923
15924
15925/*!
15926 * jQuery UI Effects Fold 1.11.4
15927 * http://jqueryui.com
15928 *
15929 * Copyright jQuery Foundation and other contributors
15930 * Released under the MIT license.
15931 * http://jquery.org/license
15932 *
15933 * http://api.jqueryui.com/fold-effect/
15934 */
15935
15936
15937var effectFold = $.effects.effect.fold = function( o, done ) {
15938
15939	// Create element
15940	var el = $( this ),
15941		props = [ "position", "top", "bottom", "left", "right", "height", "width" ],
15942		mode = $.effects.setMode( el, o.mode || "hide" ),
15943		show = mode === "show",
15944		hide = mode === "hide",
15945		size = o.size || 15,
15946		percent = /([0-9]+)%/.exec( size ),
15947		horizFirst = !!o.horizFirst,
15948		widthFirst = show !== horizFirst,
15949		ref = widthFirst ? [ "width", "height" ] : [ "height", "width" ],
15950		duration = o.duration / 2,
15951		wrapper, distance,
15952		animation1 = {},
15953		animation2 = {};
15954
15955	$.effects.save( el, props );
15956	el.show();
15957
15958	// Create Wrapper
15959	wrapper = $.effects.createWrapper( el ).css({
15960		overflow: "hidden"
15961	});
15962	distance = widthFirst ?
15963		[ wrapper.width(), wrapper.height() ] :
15964		[ wrapper.height(), wrapper.width() ];
15965
15966	if ( percent ) {
15967		size = parseInt( percent[ 1 ], 10 ) / 100 * distance[ hide ? 0 : 1 ];
15968	}
15969	if ( show ) {
15970		wrapper.css( horizFirst ? {
15971			height: 0,
15972			width: size
15973		} : {
15974			height: size,
15975			width: 0
15976		});
15977	}
15978
15979	// Animation
15980	animation1[ ref[ 0 ] ] = show ? distance[ 0 ] : size;
15981	animation2[ ref[ 1 ] ] = show ? distance[ 1 ] : 0;
15982
15983	// Animate
15984	wrapper
15985		.animate( animation1, duration, o.easing )
15986		.animate( animation2, duration, o.easing, function() {
15987			if ( hide ) {
15988				el.hide();
15989			}
15990			$.effects.restore( el, props );
15991			$.effects.removeWrapper( el );
15992			done();
15993		});
15994
15995};
15996
15997
15998/*!
15999 * jQuery UI Effects Highlight 1.11.4
16000 * http://jqueryui.com
16001 *
16002 * Copyright jQuery Foundation and other contributors
16003 * Released under the MIT license.
16004 * http://jquery.org/license
16005 *
16006 * http://api.jqueryui.com/highlight-effect/
16007 */
16008
16009
16010var effectHighlight = $.effects.effect.highlight = function( o, done ) {
16011	var elem = $( this ),
16012		props = [ "backgroundImage", "backgroundColor", "opacity" ],
16013		mode = $.effects.setMode( elem, o.mode || "show" ),
16014		animation = {
16015			backgroundColor: elem.css( "backgroundColor" )
16016		};
16017
16018	if (mode === "hide") {
16019		animation.opacity = 0;
16020	}
16021
16022	$.effects.save( elem, props );
16023
16024	elem
16025		.show()
16026		.css({
16027			backgroundImage: "none",
16028			backgroundColor: o.color || "#ffff99"
16029		})
16030		.animate( animation, {
16031			queue: false,
16032			duration: o.duration,
16033			easing: o.easing,
16034			complete: function() {
16035				if ( mode === "hide" ) {
16036					elem.hide();
16037				}
16038				$.effects.restore( elem, props );
16039				done();
16040			}
16041		});
16042};
16043
16044
16045/*!
16046 * jQuery UI Effects Size 1.11.4
16047 * http://jqueryui.com
16048 *
16049 * Copyright jQuery Foundation and other contributors
16050 * Released under the MIT license.
16051 * http://jquery.org/license
16052 *
16053 * http://api.jqueryui.com/size-effect/
16054 */
16055
16056
16057var effectSize = $.effects.effect.size = function( o, done ) {
16058
16059	// Create element
16060	var original, baseline, factor,
16061		el = $( this ),
16062		props0 = [ "position", "top", "bottom", "left", "right", "width", "height", "overflow", "opacity" ],
16063
16064		// Always restore
16065		props1 = [ "position", "top", "bottom", "left", "right", "overflow", "opacity" ],
16066
16067		// Copy for children
16068		props2 = [ "width", "height", "overflow" ],
16069		cProps = [ "fontSize" ],
16070		vProps = [ "borderTopWidth", "borderBottomWidth", "paddingTop", "paddingBottom" ],
16071		hProps = [ "borderLeftWidth", "borderRightWidth", "paddingLeft", "paddingRight" ],
16072
16073		// Set options
16074		mode = $.effects.setMode( el, o.mode || "effect" ),
16075		restore = o.restore || mode !== "effect",
16076		scale = o.scale || "both",
16077		origin = o.origin || [ "middle", "center" ],
16078		position = el.css( "position" ),
16079		props = restore ? props0 : props1,
16080		zero = {
16081			height: 0,
16082			width: 0,
16083			outerHeight: 0,
16084			outerWidth: 0
16085		};
16086
16087	if ( mode === "show" ) {
16088		el.show();
16089	}
16090	original = {
16091		height: el.height(),
16092		width: el.width(),
16093		outerHeight: el.outerHeight(),
16094		outerWidth: el.outerWidth()
16095	};
16096
16097	if ( o.mode === "toggle" && mode === "show" ) {
16098		el.from = o.to || zero;
16099		el.to = o.from || original;
16100	} else {
16101		el.from = o.from || ( mode === "show" ? zero : original );
16102		el.to = o.to || ( mode === "hide" ? zero : original );
16103	}
16104
16105	// Set scaling factor
16106	factor = {
16107		from: {
16108			y: el.from.height / original.height,
16109			x: el.from.width / original.width
16110		},
16111		to: {
16112			y: el.to.height / original.height,
16113			x: el.to.width / original.width
16114		}
16115	};
16116
16117	// Scale the css box
16118	if ( scale === "box" || scale === "both" ) {
16119
16120		// Vertical props scaling
16121		if ( factor.from.y !== factor.to.y ) {
16122			props = props.concat( vProps );
16123			el.from = $.effects.setTransition( el, vProps, factor.from.y, el.from );
16124			el.to = $.effects.setTransition( el, vProps, factor.to.y, el.to );
16125		}
16126
16127		// Horizontal props scaling
16128		if ( factor.from.x !== factor.to.x ) {
16129			props = props.concat( hProps );
16130			el.from = $.effects.setTransition( el, hProps, factor.from.x, el.from );
16131			el.to = $.effects.setTransition( el, hProps, factor.to.x, el.to );
16132		}
16133	}
16134
16135	// Scale the content
16136	if ( scale === "content" || scale === "both" ) {
16137
16138		// Vertical props scaling
16139		if ( factor.from.y !== factor.to.y ) {
16140			props = props.concat( cProps ).concat( props2 );
16141			el.from = $.effects.setTransition( el, cProps, factor.from.y, el.from );
16142			el.to = $.effects.setTransition( el, cProps, factor.to.y, el.to );
16143		}
16144	}
16145
16146	$.effects.save( el, props );
16147	el.show();
16148	$.effects.createWrapper( el );
16149	el.css( "overflow", "hidden" ).css( el.from );
16150
16151	// Adjust
16152	if (origin) { // Calculate baseline shifts
16153		baseline = $.effects.getBaseline( origin, original );
16154		el.from.top = ( original.outerHeight - el.outerHeight() ) * baseline.y;
16155		el.from.left = ( original.outerWidth - el.outerWidth() ) * baseline.x;
16156		el.to.top = ( original.outerHeight - el.to.outerHeight ) * baseline.y;
16157		el.to.left = ( original.outerWidth - el.to.outerWidth ) * baseline.x;
16158	}
16159	el.css( el.from ); // set top & left
16160
16161	// Animate
16162	if ( scale === "content" || scale === "both" ) { // Scale the children
16163
16164		// Add margins/font-size
16165		vProps = vProps.concat([ "marginTop", "marginBottom" ]).concat(cProps);
16166		hProps = hProps.concat([ "marginLeft", "marginRight" ]);
16167		props2 = props0.concat(vProps).concat(hProps);
16168
16169		el.find( "*[width]" ).each( function() {
16170			var child = $( this ),
16171				c_original = {
16172					height: child.height(),
16173					width: child.width(),
16174					outerHeight: child.outerHeight(),
16175					outerWidth: child.outerWidth()
16176				};
16177			if (restore) {
16178				$.effects.save(child, props2);
16179			}
16180
16181			child.from = {
16182				height: c_original.height * factor.from.y,
16183				width: c_original.width * factor.from.x,
16184				outerHeight: c_original.outerHeight * factor.from.y,
16185				outerWidth: c_original.outerWidth * factor.from.x
16186			};
16187			child.to = {
16188				height: c_original.height * factor.to.y,
16189				width: c_original.width * factor.to.x,
16190				outerHeight: c_original.height * factor.to.y,
16191				outerWidth: c_original.width * factor.to.x
16192			};
16193
16194			// Vertical props scaling
16195			if ( factor.from.y !== factor.to.y ) {
16196				child.from = $.effects.setTransition( child, vProps, factor.from.y, child.from );
16197				child.to = $.effects.setTransition( child, vProps, factor.to.y, child.to );
16198			}
16199
16200			// Horizontal props scaling
16201			if ( factor.from.x !== factor.to.x ) {
16202				child.from = $.effects.setTransition( child, hProps, factor.from.x, child.from );
16203				child.to = $.effects.setTransition( child, hProps, factor.to.x, child.to );
16204			}
16205
16206			// Animate children
16207			child.css( child.from );
16208			child.animate( child.to, o.duration, o.easing, function() {
16209
16210				// Restore children
16211				if ( restore ) {
16212					$.effects.restore( child, props2 );
16213				}
16214			});
16215		});
16216	}
16217
16218	// Animate
16219	el.animate( el.to, {
16220		queue: false,
16221		duration: o.duration,
16222		easing: o.easing,
16223		complete: function() {
16224			if ( el.to.opacity === 0 ) {
16225				el.css( "opacity", el.from.opacity );
16226			}
16227			if ( mode === "hide" ) {
16228				el.hide();
16229			}
16230			$.effects.restore( el, props );
16231			if ( !restore ) {
16232
16233				// we need to calculate our new positioning based on the scaling
16234				if ( position === "static" ) {
16235					el.css({
16236						position: "relative",
16237						top: el.to.top,
16238						left: el.to.left
16239					});
16240				} else {
16241					$.each([ "top", "left" ], function( idx, pos ) {
16242						el.css( pos, function( _, str ) {
16243							var val = parseInt( str, 10 ),
16244								toRef = idx ? el.to.left : el.to.top;
16245
16246							// if original was "auto", recalculate the new value from wrapper
16247							if ( str === "auto" ) {
16248								return toRef + "px";
16249							}
16250
16251							return val + toRef + "px";
16252						});
16253					});
16254				}
16255			}
16256
16257			$.effects.removeWrapper( el );
16258			done();
16259		}
16260	});
16261
16262};
16263
16264
16265/*!
16266 * jQuery UI Effects Scale 1.11.4
16267 * http://jqueryui.com
16268 *
16269 * Copyright jQuery Foundation and other contributors
16270 * Released under the MIT license.
16271 * http://jquery.org/license
16272 *
16273 * http://api.jqueryui.com/scale-effect/
16274 */
16275
16276
16277var effectScale = $.effects.effect.scale = function( o, done ) {
16278
16279	// Create element
16280	var el = $( this ),
16281		options = $.extend( true, {}, o ),
16282		mode = $.effects.setMode( el, o.mode || "effect" ),
16283		percent = parseInt( o.percent, 10 ) ||
16284			( parseInt( o.percent, 10 ) === 0 ? 0 : ( mode === "hide" ? 0 : 100 ) ),
16285		direction = o.direction || "both",
16286		origin = o.origin,
16287		original = {
16288			height: el.height(),
16289			width: el.width(),
16290			outerHeight: el.outerHeight(),
16291			outerWidth: el.outerWidth()
16292		},
16293		factor = {
16294			y: direction !== "horizontal" ? (percent / 100) : 1,
16295			x: direction !== "vertical" ? (percent / 100) : 1
16296		};
16297
16298	// We are going to pass this effect to the size effect:
16299	options.effect = "size";
16300	options.queue = false;
16301	options.complete = done;
16302
16303	// Set default origin and restore for show/hide
16304	if ( mode !== "effect" ) {
16305		options.origin = origin || [ "middle", "center" ];
16306		options.restore = true;
16307	}
16308
16309	options.from = o.from || ( mode === "show" ? {
16310		height: 0,
16311		width: 0,
16312		outerHeight: 0,
16313		outerWidth: 0
16314	} : original );
16315	options.to = {
16316		height: original.height * factor.y,
16317		width: original.width * factor.x,
16318		outerHeight: original.outerHeight * factor.y,
16319		outerWidth: original.outerWidth * factor.x
16320	};
16321
16322	// Fade option to support puff
16323	if ( options.fade ) {
16324		if ( mode === "show" ) {
16325			options.from.opacity = 0;
16326			options.to.opacity = 1;
16327		}
16328		if ( mode === "hide" ) {
16329			options.from.opacity = 1;
16330			options.to.opacity = 0;
16331		}
16332	}
16333
16334	// Animate
16335	el.effect( options );
16336
16337};
16338
16339
16340/*!
16341 * jQuery UI Effects Puff 1.11.4
16342 * http://jqueryui.com
16343 *
16344 * Copyright jQuery Foundation and other contributors
16345 * Released under the MIT license.
16346 * http://jquery.org/license
16347 *
16348 * http://api.jqueryui.com/puff-effect/
16349 */
16350
16351
16352var effectPuff = $.effects.effect.puff = function( o, done ) {
16353	var elem = $( this ),
16354		mode = $.effects.setMode( elem, o.mode || "hide" ),
16355		hide = mode === "hide",
16356		percent = parseInt( o.percent, 10 ) || 150,
16357		factor = percent / 100,
16358		original = {
16359			height: elem.height(),
16360			width: elem.width(),
16361			outerHeight: elem.outerHeight(),
16362			outerWidth: elem.outerWidth()
16363		};
16364
16365	$.extend( o, {
16366		effect: "scale",
16367		queue: false,
16368		fade: true,
16369		mode: mode,
16370		complete: done,
16371		percent: hide ? percent : 100,
16372		from: hide ?
16373			original :
16374			{
16375				height: original.height * factor,
16376				width: original.width * factor,
16377				outerHeight: original.outerHeight * factor,
16378				outerWidth: original.outerWidth * factor
16379			}
16380	});
16381
16382	elem.effect( o );
16383};
16384
16385
16386/*!
16387 * jQuery UI Effects Pulsate 1.11.4
16388 * http://jqueryui.com
16389 *
16390 * Copyright jQuery Foundation and other contributors
16391 * Released under the MIT license.
16392 * http://jquery.org/license
16393 *
16394 * http://api.jqueryui.com/pulsate-effect/
16395 */
16396
16397
16398var effectPulsate = $.effects.effect.pulsate = function( o, done ) {
16399	var elem = $( this ),
16400		mode = $.effects.setMode( elem, o.mode || "show" ),
16401		show = mode === "show",
16402		hide = mode === "hide",
16403		showhide = ( show || mode === "hide" ),
16404
16405		// showing or hiding leaves of the "last" animation
16406		anims = ( ( o.times || 5 ) * 2 ) + ( showhide ? 1 : 0 ),
16407		duration = o.duration / anims,
16408		animateTo = 0,
16409		queue = elem.queue(),
16410		queuelen = queue.length,
16411		i;
16412
16413	if ( show || !elem.is(":visible")) {
16414		elem.css( "opacity", 0 ).show();
16415		animateTo = 1;
16416	}
16417
16418	// anims - 1 opacity "toggles"
16419	for ( i = 1; i < anims; i++ ) {
16420		elem.animate({
16421			opacity: animateTo
16422		}, duration, o.easing );
16423		animateTo = 1 - animateTo;
16424	}
16425
16426	elem.animate({
16427		opacity: animateTo
16428	}, duration, o.easing);
16429
16430	elem.queue(function() {
16431		if ( hide ) {
16432			elem.hide();
16433		}
16434		done();
16435	});
16436
16437	// We just queued up "anims" animations, we need to put them next in the queue
16438	if ( queuelen > 1 ) {
16439		queue.splice.apply( queue,
16440			[ 1, 0 ].concat( queue.splice( queuelen, anims + 1 ) ) );
16441	}
16442	elem.dequeue();
16443};
16444
16445
16446/*!
16447 * jQuery UI Effects Shake 1.11.4
16448 * http://jqueryui.com
16449 *
16450 * Copyright jQuery Foundation and other contributors
16451 * Released under the MIT license.
16452 * http://jquery.org/license
16453 *
16454 * http://api.jqueryui.com/shake-effect/
16455 */
16456
16457
16458var effectShake = $.effects.effect.shake = function( o, done ) {
16459
16460	var el = $( this ),
16461		props = [ "position", "top", "bottom", "left", "right", "height", "width" ],
16462		mode = $.effects.setMode( el, o.mode || "effect" ),
16463		direction = o.direction || "left",
16464		distance = o.distance || 20,
16465		times = o.times || 3,
16466		anims = times * 2 + 1,
16467		speed = Math.round( o.duration / anims ),
16468		ref = (direction === "up" || direction === "down") ? "top" : "left",
16469		positiveMotion = (direction === "up" || direction === "left"),
16470		animation = {},
16471		animation1 = {},
16472		animation2 = {},
16473		i,
16474
16475		// we will need to re-assemble the queue to stack our animations in place
16476		queue = el.queue(),
16477		queuelen = queue.length;
16478
16479	$.effects.save( el, props );
16480	el.show();
16481	$.effects.createWrapper( el );
16482
16483	// Animation
16484	animation[ ref ] = ( positiveMotion ? "-=" : "+=" ) + distance;
16485	animation1[ ref ] = ( positiveMotion ? "+=" : "-=" ) + distance * 2;
16486	animation2[ ref ] = ( positiveMotion ? "-=" : "+=" ) + distance * 2;
16487
16488	// Animate
16489	el.animate( animation, speed, o.easing );
16490
16491	// Shakes
16492	for ( i = 1; i < times; i++ ) {
16493		el.animate( animation1, speed, o.easing ).animate( animation2, speed, o.easing );
16494	}
16495	el
16496		.animate( animation1, speed, o.easing )
16497		.animate( animation, speed / 2, o.easing )
16498		.queue(function() {
16499			if ( mode === "hide" ) {
16500				el.hide();
16501			}
16502			$.effects.restore( el, props );
16503			$.effects.removeWrapper( el );
16504			done();
16505		});
16506
16507	// inject all the animations we just queued to be first in line (after "inprogress")
16508	if ( queuelen > 1) {
16509		queue.splice.apply( queue,
16510			[ 1, 0 ].concat( queue.splice( queuelen, anims + 1 ) ) );
16511	}
16512	el.dequeue();
16513
16514};
16515
16516
16517/*!
16518 * jQuery UI Effects Slide 1.11.4
16519 * http://jqueryui.com
16520 *
16521 * Copyright jQuery Foundation and other contributors
16522 * Released under the MIT license.
16523 * http://jquery.org/license
16524 *
16525 * http://api.jqueryui.com/slide-effect/
16526 */
16527
16528
16529var effectSlide = $.effects.effect.slide = function( o, done ) {
16530
16531	// Create element
16532	var el = $( this ),
16533		props = [ "position", "top", "bottom", "left", "right", "width", "height" ],
16534		mode = $.effects.setMode( el, o.mode || "show" ),
16535		show = mode === "show",
16536		direction = o.direction || "left",
16537		ref = (direction === "up" || direction === "down") ? "top" : "left",
16538		positiveMotion = (direction === "up" || direction === "left"),
16539		distance,
16540		animation = {};
16541
16542	// Adjust
16543	$.effects.save( el, props );
16544	el.show();
16545	distance = o.distance || el[ ref === "top" ? "outerHeight" : "outerWidth" ]( true );
16546
16547	$.effects.createWrapper( el ).css({
16548		overflow: "hidden"
16549	});
16550
16551	if ( show ) {
16552		el.css( ref, positiveMotion ? (isNaN(distance) ? "-" + distance : -distance) : distance );
16553	}
16554
16555	// Animation
16556	animation[ ref ] = ( show ?
16557		( positiveMotion ? "+=" : "-=") :
16558		( positiveMotion ? "-=" : "+=")) +
16559		distance;
16560
16561	// Animate
16562	el.animate( animation, {
16563		queue: false,
16564		duration: o.duration,
16565		easing: o.easing,
16566		complete: function() {
16567			if ( mode === "hide" ) {
16568				el.hide();
16569			}
16570			$.effects.restore( el, props );
16571			$.effects.removeWrapper( el );
16572			done();
16573		}
16574	});
16575};
16576
16577
16578/*!
16579 * jQuery UI Effects Transfer 1.11.4
16580 * http://jqueryui.com
16581 *
16582 * Copyright jQuery Foundation and other contributors
16583 * Released under the MIT license.
16584 * http://jquery.org/license
16585 *
16586 * http://api.jqueryui.com/transfer-effect/
16587 */
16588
16589
16590var effectTransfer = $.effects.effect.transfer = function( o, done ) {
16591	var elem = $( this ),
16592		target = $( o.to ),
16593		targetFixed = target.css( "position" ) === "fixed",
16594		body = $("body"),
16595		fixTop = targetFixed ? body.scrollTop() : 0,
16596		fixLeft = targetFixed ? body.scrollLeft() : 0,
16597		endPosition = target.offset(),
16598		animation = {
16599			top: endPosition.top - fixTop,
16600			left: endPosition.left - fixLeft,
16601			height: target.innerHeight(),
16602			width: target.innerWidth()
16603		},
16604		startPosition = elem.offset(),
16605		transfer = $( "<div class='ui-effects-transfer'></div>" )
16606			.appendTo( document.body )
16607			.addClass( o.className )
16608			.css({
16609				top: startPosition.top - fixTop,
16610				left: startPosition.left - fixLeft,
16611				height: elem.innerHeight(),
16612				width: elem.innerWidth(),
16613				position: targetFixed ? "fixed" : "absolute"
16614			})
16615			.animate( animation, o.duration, o.easing, function() {
16616				transfer.remove();
16617				done();
16618			});
16619};
16620
16621
16622
16623}));
16624/*!
16625 * Bootstrap Package v7.0.2 (http://www.bk2k.info)
16626 * Copyright 2014-2016 Benjamin Kott
16627 * Licensed under the MIT license
16628 */
16629+function(a){function b(){return this.each(function(){var b=a(this),d=b.data("bk2k.equalheight");d?d.process():b.data("bk2k.equalheight",d=new c(this))})}var c=function(b){this.$container=a(b),this.$elements=this.$container.find("[data-equalheight=item]"),this.init()};c.prototype.init=function(){this.process()},c.prototype.reset=function(){this.$elements.height("auto")},c.prototype.process=function(){this.reset();var b=[],c=null,d=null,e=0,f=this.$elements;f.each(function(){var f=a(this);f.is(":hidden")||(e=f.offset().top,c!==e?(a.each(b,function(){a(this).height(d)}),b.length=0,c=e,d=f.height(),b.push(f)):(b.push(f),d=d<f.height()?f.height():d),a.each(b,function(){a(this).height(d)}))})};var d=a.fn.equalheight;a.fn.equalheight=b,a.fn.equalheight.Constructor=c,a.fn.equalheight.noConflict=function(){return a.fn.carousel=d,this},a(window).on("load resize calculate.bk2k.equalheight",function(){a("[data-equalheight=container]").each(function(){var c=a(this);b.call(c,c.data())})}),a("img").on("load",function(){a(window).trigger("calculate.bk2k.equalheight")})}(jQuery);
vendor: 36,868 bytes, lines 16630-16636
16630/*!
16631 * Bootstrap v3.3.6 (http://getbootstrap.com)
16632 * Copyright 2011-2015 Twitter, Inc.
16633 * Licensed under the MIT license
16634 */
16635if("undefined"==typeof jQuery)throw new Error("Bootstrap's JavaScript requires jQuery");+function(a){"use strict";var b=a.fn.jquery.split(" ")[0].split(".");if(b[0]<2&&b[1]<9||1==b[0]&&9==b[1]&&b[2]<1||b[0]>2)throw new Error("Bootstrap's JavaScript requires jQuery version 1.9.1 or higher, but lower than version 3")}(jQuery),+function(a){"use strict";function b(){var a=document.createElement("bootstrap"),b={WebkitTransition:"webkitTransitionEnd",MozTransition:"transitionend",OTransition:"oTransitionEnd otransitionend",transition:"transitionend"};for(var c in b)if(void 0!==a.style[c])return{end:b[c]};return!1}a.fn.emulateTransitionEnd=function(b){var c=!1,d=this;a(this).one("bsTransitionEnd",function(){c=!0});var e=function(){c||a(d).trigger(a.support.transition.end)};return setTimeout(e,b),this},a(function(){a.support.transition=b(),a.support.transition&&(a.event.special.bsTransitionEnd={bindType:a.support.transition.end,delegateType:a.support.transition.end,handle:function(b){return a(b.target).is(this)?b.handleObj.handler.apply(this,arguments):void 0}})})}(jQuery),+function(a){"use strict";function b(b){return this.each(function(){var c=a(this),e=c.data("bs.alert");e||c.data("bs.alert",e=new d(this)),"string"==typeof b&&e[b].call(c)})}var c='[data-dismiss="alert"]',d=function(b){a(b).on("click",c,this.close)};d.VERSION="3.3.6",d.TRANSITION_DURATION=150,d.prototype.close=function(b){function c(){g.detach().trigger("closed.bs.alert").remove()}var e=a(this),f=e.attr("data-target");f||(f=e.attr("href"),f=f&&f.replace(/.*(?=#[^\s]*$)/,""));var g=a(f);b&&b.preventDefault(),g.length||(g=e.closest(".alert")),g.trigger(b=a.Event("close.bs.alert")),b.isDefaultPrevented()||(g.removeClass("in"),a.support.transition&&g.hasClass("fade")?g.one("bsTransitionEnd",c).emulateTransitionEnd(d.TRANSITION_DURATION):c())};var e=a.fn.alert;a.fn.alert=b,a.fn.alert.Constructor=d,a.fn.alert.noConflict=function(){return a.fn.alert=e,this},a(document).on("click.bs.alert.data-api",c,d.prototype.close)}(jQuery),+function(a){"use strict";function b(b){return this.each(function(){var d=a(this),e=d.data("bs.button"),f="object"==typeof b&&b;e||d.data("bs.button",e=new c(this,f)),"toggle"==b?e.toggle():b&&e.setState(b)})}var c=function(b,d){this.$element=a(b),this.options=a.extend({},c.DEFAULTS,d),this.isLoading=!1};c.VERSION="3.3.6",c.DEFAULTS={loadingText:"loading..."},c.prototype.setState=function(b){var c="disabled",d=this.$element,e=d.is("input")?"val":"html",f=d.data();b+="Text",null==f.resetText&&d.data("resetText",d[e]()),setTimeout(a.proxy(function(){d[e](null==f[b]?this.options[b]:f[b]),"loadingText"==b?(this.isLoading=!0,d.addClass(c).attr(c,c)):this.isLoading&&(this.isLoading=!1,d.removeClass(c).removeAttr(c))},this),0)},c.prototype.toggle=function(){var a=!0,b=this.$element.closest('[data-toggle="buttons"]');if(b.length){var c=this.$element.find("input");"radio"==c.prop("type")?(c.prop("checked")&&(a=!1),b.find(".active").removeClass("active"),this.$element.addClass("active")):"checkbox"==c.prop("type")&&(c.prop("checked")!==this.$element.hasClass("active")&&(a=!1),this.$element.toggleClass("active")),c.prop("checked",this.$element.hasClass("active")),a&&c.trigger("change")}else this.$element.attr("aria-pressed",!this.$element.hasClass("active")),this.$element.toggleClass("active")};var d=a.fn.button;a.fn.button=b,a.fn.button.Constructor=c,a.fn.button.noConflict=function(){return a.fn.button=d,this},a(document).on("click.bs.button.data-api",'[data-toggle^="button"]',function(c){var d=a(c.target);d.hasClass("btn")||(d=d.closest(".btn")),b.call(d,"toggle"),a(c.target).is('input[type="radio"]')||a(c.target).is('input[type="checkbox"]')||c.preventDefault()}).on("focus.bs.button.data-api blur.bs.button.data-api",'[data-toggle^="button"]',function(b){a(b.target).closest(".btn").toggleClass("focus",/^focus(in)?$/.test(b.type))})}(jQuery),+function(a){"use strict";function b(b){return this.each(function(){var d=a(this),e=d.data("bs.carousel"),f=a.extend({},c.DEFAULTS,d.data(),"object"==typeof b&&b),g="string"==typeof b?b:f.slide;e||d.data("bs.carousel",e=new c(this,f)),"number"==typeof b?e.to(b):g?e[g]():f.interval&&e.pause().cycle()})}var c=function(b,c){this.$element=a(b),this.$indicators=this.$element.find(".carousel-indicators"),this.options=c,this.paused=null,this.sliding=null,this.interval=null,this.$active=null,this.$items=null,this.options.keyboard&&this.$element.on("keydown.bs.carousel",a.proxy(this.keydown,this)),"hover"==this.options.pause&&!("ontouchstart"in document.documentElement)&&this.$element.on("mouseenter.bs.carousel",a.proxy(this.pause,this)).on("mouseleave.bs.carousel",a.proxy(this.cycle,this))};c.VERSION="3.3.6",c.TRANSITION_DURATION=600,c.DEFAULTS={interval:5e3,pause:"hover",wrap:!0,keyboard:!0},c.prototype.keydown=function(a){if(!/input|textarea/i.test(a.target.tagName)){switch(a.which){case 37:this.prev();break;case 39:this.next();break;default:return}a.preventDefault()}},c.prototype.cycle=function(b){return b||(this.paused=!1),this.interval&&clearInterval(this.interval),this.options.interval&&!this.paused&&(this.interval=setInterval(a.proxy(this.next,this),this.options.interval)),this},c.prototype.getItemIndex=function(a){return this.$items=a.parent().children(".item"),this.$items.index(a||this.$active)},c.prototype.getItemForDirection=function(a,b){var c=this.getItemIndex(b),d="prev"==a&&0===c||"next"==a&&c==this.$items.length-1;if(d&&!this.options.wrap)return b;var e="prev"==a?-1:1,f=(c+e)%this.$items.length;return this.$items.eq(f)},c.prototype.to=function(a){var b=this,c=this.getItemIndex(this.$active=this.$element.find(".item.active"));return a>this.$items.length-1||0>a?void 0:this.sliding?this.$element.one("slid.bs.carousel",function(){b.to(a)}):c==a?this.pause().cycle():this.slide(a>c?"next":"prev",this.$items.eq(a))},c.prototype.pause=function(b){return b||(this.paused=!0),this.$element.find(".next, .prev").length&&a.support.transition&&(this.$element.trigger(a.support.transition.end),this.cycle(!0)),this.interval=clearInterval(this.interval),this},c.prototype.next=function(){return this.sliding?void 0:this.slide("next")},c.prototype.prev=function(){return this.sliding?void 0:this.slide("prev")},c.prototype.slide=function(b,d){var e=this.$element.find(".item.active"),f=d||this.getItemForDirection(b,e),g=this.interval,h="next"==b?"left":"right",i=this;if(f.hasClass("active"))return this.sliding=!1;var j=f[0],k=a.Event("slide.bs.carousel",{relatedTarget:j,direction:h});if(this.$element.trigger(k),!k.isDefaultPrevented()){if(this.sliding=!0,g&&this.pause(),this.$indicators.length){this.$indicators.find(".active").removeClass("active");var l=a(this.$indicators.children()[this.getItemIndex(f)]);l&&l.addClass("active")}var m=a.Event("slid.bs.carousel",{relatedTarget:j,direction:h});return a.support.transition&&this.$element.hasClass("slide")?(f.addClass(b),f[0].offsetWidth,e.addClass(h),f.addClass(h),e.one("bsTransitionEnd",function(){f.removeClass([b,h].join(" ")).addClass("active"),e.removeClass(["active",h].join(" ")),i.sliding=!1,setTimeout(function(){i.$element.trigger(m)},0)}).emulateTransitionEnd(c.TRANSITION_DURATION)):(e.removeClass("active"),f.addClass("active"),this.sliding=!1,this.$element.trigger(m)),g&&this.cycle(),this}};var d=a.fn.carousel;a.fn.carousel=b,a.fn.carousel.Constructor=c,a.fn.carousel.noConflict=function(){return a.fn.carousel=d,this};var e=function(c){var d,e=a(this),f=a(e.attr("data-target")||(d=e.attr("href"))&&d.replace(/.*(?=#[^\s]+$)/,""));if(f.hasClass("carousel")){var g=a.extend({},f.data(),e.data()),h=e.attr("data-slide-to");h&&(g.interval=!1),b.call(f,g),h&&f.data("bs.carousel").to(h),c.preventDefault()}};a(document).on("click.bs.carousel.data-api","[data-slide]",e).on("click.bs.carousel.data-api","[data-slide-to]",e),a(window).on("load",function(){a('[data-ride="carousel"]').each(function(){var c=a(this);b.call(c,c.data())})})}(jQuery),+function(a){"use strict";function b(b){var c,d=b.attr("data-target")||(c=b.attr("href"))&&c.replace(/.*(?=#[^\s]+$)/,"");return a(d)}function c(b){return this.each(function(){var c=a(this),e=c.data("bs.collapse"),f=a.extend({},d.DEFAULTS,c.data(),"object"==typeof b&&b);!e&&f.toggle&&/show|hide/.test(b)&&(f.toggle=!1),e||c.data("bs.collapse",e=new d(this,f)),"string"==typeof b&&e[b]()})}var d=function(b,c){this.$element=a(b),this.options=a.extend({},d.DEFAULTS,c),this.$trigger=a('[data-toggle="collapse"][href="#'+b.id+'"],[data-toggle="collapse"][data-target="#'+b.id+'"]'),this.transitioning=null,this.options.parent?this.$parent=this.getParent():this.addAriaAndCollapsedClass(this.$element,this.$trigger),this.options.toggle&&this.toggle()};d.VERSION="3.3.6",d.TRANSITION_DURATION=350,d.DEFAULTS={toggle:!0},d.prototype.dimension=function(){var a=this.$element.hasClass("width");return a?"width":"height"},d.prototype.show=function(){if(!this.transitioning&&!this.$element.hasClass("in")){var b,e=this.$parent&&this.$parent.children(".panel").children(".in, .collapsing");if(!(e&&e.length&&(b=e.data("bs.collapse"),b&&b.transitioning))){var f=a.Event("show.bs.collapse");if(this.$element.trigger(f),!f.isDefaultPrevented()){e&&e.length&&(c.call(e,"hide"),b||e.data("bs.collapse",null));var g=this.dimension();this.$element.removeClass("collapse").addClass("collapsing")[g](0).attr("aria-expanded",!0),this.$trigger.removeClass("collapsed").attr("aria-expanded",!0),this.transitioning=1;var h=function(){this.$element.removeClass("collapsing").addClass("collapse in")[g](""),this.transitioning=0,this.$element.trigger("shown.bs.collapse")};if(!a.support.transition)return h.call(this);var i=a.camelCase(["scroll",g].join("-"));this.$element.one("bsTransitionEnd",a.proxy(h,this)).emulateTransitionEnd(d.TRANSITION_DURATION)[g](this.$element[0][i])}}}},d.prototype.hide=function(){if(!this.transitioning&&this.$element.hasClass("in")){var b=a.Event("hide.bs.collapse");if(this.$element.trigger(b),!b.isDefaultPrevented()){var c=this.dimension();this.$element[c](this.$element[c]())[0].offsetHeight,this.$element.addClass("collapsing").removeClass("collapse in").attr("aria-expanded",!1),this.$trigger.addClass("collapsed").attr("aria-expanded",!1),this.transitioning=1;var e=function(){this.transitioning=0,this.$element.removeClass("collapsing").addClass("collapse").trigger("hidden.bs.collapse")};return a.support.transition?void this.$element[c](0).one("bsTransitionEnd",a.proxy(e,this)).emulateTransitionEnd(d.TRANSITION_DURATION):e.call(this)}}},d.prototype.toggle=function(){this[this.$element.hasClass("in")?"hide":"show"]()},d.prototype.getParent=function(){return a(this.options.parent).find('[data-toggle="collapse"][data-parent="'+this.options.parent+'"]').each(a.proxy(function(c,d){var e=a(d);this.addAriaAndCollapsedClass(b(e),e)},this)).end()},d.prototype.addAriaAndCollapsedClass=function(a,b){var c=a.hasClass("in");a.attr("aria-expanded",c),b.toggleClass("collapsed",!c).attr("aria-expanded",c)};var e=a.fn.collapse;a.fn.collapse=c,a.fn.collapse.Constructor=d,a.fn.collapse.noConflict=function(){return a.fn.collapse=e,this},a(document).on("click.bs.collapse.data-api",'[data-toggle="collapse"]',function(d){var e=a(this);e.attr("data-target")||d.preventDefault();var f=b(e),g=f.data("bs.collapse"),h=g?"toggle":e.data();c.call(f,h)})}(jQuery),+function(a){"use strict";function b(b){var c=b.attr("data-target");c||(c=b.attr("href"),c=c&&/#[A-Za-z]/.test(c)&&c.replace(/.*(?=#[^\s]*$)/,""));var d=c&&a(c);return d&&d.length?d:b.parent()}function c(c){c&&3===c.which||(a(e).remove(),a(f).each(function(){var d=a(this),e=b(d),f={relatedTarget:this};e.hasClass("open")&&(c&&"click"==c.type&&/input|textarea/i.test(c.target.tagName)&&a.contains(e[0],c.target)||(e.trigger(c=a.Event("hide.bs.dropdown",f)),c.isDefaultPrevented()||(d.attr("aria-expanded","false"),e.removeClass("open").trigger(a.Event("hidden.bs.dropdown",f)))))}))}function d(b){return this.each(function(){var c=a(this),d=c.data("bs.dropdown");d||c.data("bs.dropdown",d=new g(this)),"string"==typeof b&&d[b].call(c)})}var e=".dropdown-backdrop",f='[data-toggle="dropdown"]',g=function(b){a(b).on("click.bs.dropdown",this.toggle)};g.VERSION="3.3.6",g.prototype.toggle=function(d){var e=a(this);if(!e.is(".disabled, :disabled")){var f=b(e),g=f.hasClass("open");if(c(),!g){"ontouchstart"in document.documentElement&&!f.closest(".navbar-nav").length&&a(document.createElement("div")).addClass("dropdown-backdrop").insertAfter(a(this)).on("click",c);var h={relatedTarget:this};if(f.trigger(d=a.Event("show.bs.dropdown",h)),d.isDefaultPrevented())return;e.trigger("focus").attr("aria-expanded","true"),f.toggleClass("open").trigger(a.Event("shown.bs.dropdown",h))}return!1}},g.prototype.keydown=function(c){if(/(38|40|27|32)/.test(c.which)&&!/input|textarea/i.test(c.target.tagName)){var d=a(this);if(c.preventDefault(),c.stopPropagation(),!d.is(".disabled, :disabled")){var e=b(d),g=e.hasClass("open");if(!g&&27!=c.which||g&&27==c.which)return 27==c.which&&e.find(f).trigger("focus"),d.trigger("click");var h=" li:not(.disabled):visible a",i=e.find(".dropdown-menu"+h);if(i.length){var j=i.index(c.target);38==c.which&&j>0&&j--,40==c.which&&j<i.length-1&&j++,~j||(j=0),i.eq(j).trigger("focus")}}}};var h=a.fn.dropdown;a.fn.dropdown=d,a.fn.dropdown.Constructor=g,a.fn.dropdown.noConflict=function(){return a.fn.dropdown=h,this},a(document).on("click.bs.dropdown.data-api",c).on("click.bs.dropdown.data-api",".dropdown form",function(a){a.stopPropagation()}).on("click.bs.dropdown.data-api",f,g.prototype.toggle).on("keydown.bs.dropdown.data-api",f,g.prototype.keydown).on("keydown.bs.dropdown.data-api",".dropdown-menu",g.prototype.keydown)}(jQuery),+function(a){"use strict";function b(b,d){return this.each(function(){var e=a(this),f=e.data("bs.modal"),g=a.extend({},c.DEFAULTS,e.data(),"object"==typeof b&&b);f||e.data("bs.modal",f=new c(this,g)),"string"==typeof b?f[b](d):g.show&&f.show(d)})}var c=function(b,c){this.options=c,this.$body=a(document.body),this.$element=a(b),this.$dialog=this.$element.find(".modal-dialog"),this.$backdrop=null,this.isShown=null,this.originalBodyPad=null,this.scrollbarWidth=0,this.ignoreBackdropClick=!1,this.options.remote&&this.$element.find(".modal-content").load(this.options.remote,a.proxy(function(){this.$element.trigger("loaded.bs.modal")},this))};c.VERSION="3.3.6",c.TRANSITION_DURATION=300,c.BACKDROP_TRANSITION_DURATION=150,c.DEFAULTS={backdrop:!0,keyboard:!0,show:!0},c.prototype.toggle=function(a){return this.isShown?this.hide():this.show(a)},c.prototype.show=function(b){var d=this,e=a.Event("show.bs.modal",{relatedTarget:b});this.$element.trigger(e),this.isShown||e.isDefaultPrevented()||(this.isShown=!0,this.checkScrollbar(),this.setScrollbar(),this.$body.addClass("modal-open"),this.escape(),this.resize(),this.$element.on("click.dismiss.bs.modal",'[data-dismiss="modal"]',a.proxy(this.hide,this)),this.$dialog.on("mousedown.dismiss.bs.modal",function(){d.$element.one("mouseup.dismiss.bs.modal",function(b){a(b.target).is(d.$element)&&(d.ignoreBackdropClick=!0)})}),this.backdrop(function(){var e=a.support.transition&&d.$element.hasClass("fade");d.$element.parent().length||d.$element.appendTo(d.$body),d.$element.show().scrollTop(0),d.adjustDialog(),e&&d.$element[0].offsetWidth,d.$element.addClass("in"),d.enforceFocus();var f=a.Event("shown.bs.modal",{relatedTarget:b});e?d.$dialog.one("bsTransitionEnd",function(){d.$element.trigger("focus").trigger(f)}).emulateTransitionEnd(c.TRANSITION_DURATION):d.$element.trigger("focus").trigger(f)}))},c.prototype.hide=function(b){b&&b.preventDefault(),b=a.Event("hide.bs.modal"),this.$element.trigger(b),this.isShown&&!b.isDefaultPrevented()&&(this.isShown=!1,this.escape(),this.resize(),a(document).off("focusin.bs.modal"),this.$element.removeClass("in").off("click.dismiss.bs.modal").off("mouseup.dismiss.bs.modal"),this.$dialog.off("mousedown.dismiss.bs.modal"),a.support.transition&&this.$element.hasClass("fade")?this.$element.one("bsTransitionEnd",a.proxy(this.hideModal,this)).emulateTransitionEnd(c.TRANSITION_DURATION):this.hideModal())},c.prototype.enforceFocus=function(){a(document).off("focusin.bs.modal").on("focusin.bs.modal",a.proxy(function(a){this.$element[0]===a.target||this.$element.has(a.target).length||this.$element.trigger("focus")},this))},c.prototype.escape=function(){this.isShown&&this.options.keyboard?this.$element.on("keydown.dismiss.bs.modal",a.proxy(function(a){27==a.which&&this.hide()},this)):this.isShown||this.$element.off("keydown.dismiss.bs.modal")},c.prototype.resize=function(){this.isShown?a(window).on("resize.bs.modal",a.proxy(this.handleUpdate,this)):a(window).off("resize.bs.modal")},c.prototype.hideModal=function(){var a=this;this.$element.hide(),this.backdrop(function(){a.$body.removeClass("modal-open"),a.resetAdjustments(),a.resetScrollbar(),a.$element.trigger("hidden.bs.modal")})},c.prototype.removeBackdrop=function(){this.$backdrop&&this.$backdrop.remove(),this.$backdrop=null},c.prototype.backdrop=function(b){var d=this,e=this.$element.hasClass("fade")?"fade":"";if(this.isShown&&this.options.backdrop){var f=a.support.transition&&e;if(this.$backdrop=a(document.createElement("div")).addClass("modal-backdrop "+e).appendTo(this.$body),this.$element.on("click.dismiss.bs.modal",a.proxy(function(a){return this.ignoreBackdropClick?void(this.ignoreBackdropClick=!1):void(a.target===a.currentTarget&&("static"==this.options.backdrop?this.$element[0].focus():this.hide()))},this)),f&&this.$backdrop[0].offsetWidth,this.$backdrop.addClass("in"),!b)return;f?this.$backdrop.one("bsTransitionEnd",b).emulateTransitionEnd(c.BACKDROP_TRANSITION_DURATION):b()}else if(!this.isShown&&this.$backdrop){this.$backdrop.removeClass("in");var g=function(){d.removeBackdrop(),b&&b()};a.support.transition&&this.$element.hasClass("fade")?this.$backdrop.one("bsTransitionEnd",g).emulateTransitionEnd(c.BACKDROP_TRANSITION_DURATION):g()}else b&&b()},c.prototype.handleUpdate=function(){this.adjustDialog()},c.prototype.adjustDialog=function(){var a=this.$element[0].scrollHeight>document.documentElement.clientHeight;this.$element.css({paddingLeft:!this.bodyIsOverflowing&&a?this.scrollbarWidth:"",paddingRight:this.bodyIsOverflowing&&!a?this.scrollbarWidth:""})},c.prototype.resetAdjustments=function(){this.$element.css({paddingLeft:"",paddingRight:""})},c.prototype.checkScrollbar=function(){var a=window.innerWidth;if(!a){var b=document.documentElement.getBoundingClientRect();a=b.right-Math.abs(b.left)}this.bodyIsOverflowing=document.body.clientWidth<a,this.scrollbarWidth=this.measureScrollbar()},c.prototype.setScrollbar=function(){var a=parseInt(this.$body.css("padding-right")||0,10);this.originalBodyPad=document.body.style.paddingRight||"",this.bodyIsOverflowing&&this.$body.css("padding-right",a+this.scrollbarWidth)},c.prototype.resetScrollbar=function(){this.$body.css("padding-right",this.originalBodyPad)},c.prototype.measureScrollbar=function(){var a=document.createElement("div");a.className="modal-scrollbar-measure",this.$body.append(a);var b=a.offsetWidth-a.clientWidth;return this.$body[0].removeChild(a),b};var d=a.fn.modal;a.fn.modal=b,a.fn.modal.Constructor=c,a.fn.modal.noConflict=function(){return a.fn.modal=d,this},a(document).on("click.bs.modal.data-api",'[data-toggle="modal"]',function(c){var d=a(this),e=d.attr("href"),f=a(d.attr("data-target")||e&&e.replace(/.*(?=#[^\s]+$)/,"")),g=f.data("bs.modal")?"toggle":a.extend({remote:!/#/.test(e)&&e},f.data(),d.data());d.is("a")&&c.preventDefault(),f.one("show.bs.modal",function(a){a.isDefaultPrevented()||f.one("hidden.bs.modal",function(){d.is(":visible")&&d.trigger("focus")})}),b.call(f,g,this)})}(jQuery),+function(a){"use strict";function b(b){return this.each(function(){var d=a(this),e=d.data("bs.tooltip"),f="object"==typeof b&&b;(e||!/destroy|hide/.test(b))&&(e||d.data("bs.tooltip",e=new c(this,f)),"string"==typeof b&&e[b]())})}var c=function(a,b){this.type=null,this.options=null,this.enabled=null,this.timeout=null,this.hoverState=null,this.$element=null,this.inState=null,this.init("tooltip",a,b)};c.VERSION="3.3.6",c.TRANSITION_DURATION=150,c.DEFAULTS={animation:!0,placement:"top",selector:!1,template:'<div class="tooltip" role="tooltip"><div class="tooltip-arrow"></div><div class="tooltip-inner"></div></div>',trigger:"hover focus",title:"",delay:0,html:!1,container:!1,viewport:{selector:"body",padding:0}},c.prototype.init=function(b,c,d){if(this.enabled=!0,this.type=b,this.$element=a(c),this.options=this.getOptions(d),this.$viewport=this.options.viewport&&a(a.isFunction(this.options.viewport)?this.options.viewport.call(this,this.$element):this.options.viewport.selector||this.options.viewport),this.inState={click:!1,hover:!1,focus:!1},this.$element[0]instanceof document.constructor&&!this.options.selector)throw new Error("`selector` option must be specified when initializing "+this.type+" on the window.document object!");for(var e=this.options.trigger.split(" "),f=e.length;f--;){var g=e[f];if("click"==g)this.$element.on("click."+this.type,this.options.selector,a.proxy(this.toggle,this));else if("manual"!=g){var h="hover"==g?"mouseenter":"focusin",i="hover"==g?"mouseleave":"focusout";this.$element.on(h+"."+this.type,this.options.selector,a.proxy(this.enter,this)),this.$element.on(i+"."+this.type,this.options.selector,a.proxy(this.leave,this))}}this.options.selector?this._options=a.extend({},this.options,{trigger:"manual",selector:""}):this.fixTitle()},c.prototype.getDefaults=function(){return c.DEFAULTS},c.prototype.getOptions=function(b){return b=a.extend({},this.getDefaults(),this.$element.data(),b),b.delay&&"number"==typeof b.delay&&(b.delay={show:b.delay,hide:b.delay}),b},c.prototype.getDelegateOptions=function(){var b={},c=this.getDefaults();return this._options&&a.each(this._options,function(a,d){c[a]!=d&&(b[a]=d)}),b},c.prototype.enter=function(b){var c=b instanceof this.constructor?b:a(b.currentTarget).data("bs."+this.type);return c||(c=new this.constructor(b.currentTarget,this.getDelegateOptions()),a(b.currentTarget).data("bs."+this.type,c)),b instanceof a.Event&&(c.inState["focusin"==b.type?"focus":"hover"]=!0),c.tip().hasClass("in")||"in"==c.hoverState?void(c.hoverState="in"):(clearTimeout(c.timeout),c.hoverState="in",c.options.delay&&c.options.delay.show?void(c.timeout=setTimeout(function(){"in"==c.hoverState&&c.show()},c.options.delay.show)):c.show())},c.prototype.isInStateTrue=function(){for(var a in this.inState)if(this.inState[a])return!0;return!1},c.prototype.leave=function(b){var c=b instanceof this.constructor?b:a(b.currentTarget).data("bs."+this.type);return c||(c=new this.constructor(b.currentTarget,this.getDelegateOptions()),a(b.currentTarget).data("bs."+this.type,c)),b instanceof a.Event&&(c.inState["focusout"==b.type?"focus":"hover"]=!1),c.isInStateTrue()?void 0:(clearTimeout(c.timeout),c.hoverState="out",c.options.delay&&c.options.delay.hide?void(c.timeout=setTimeout(function(){"out"==c.hoverState&&c.hide()},c.options.delay.hide)):c.hide())},c.prototype.show=function(){var b=a.Event("show.bs."+this.type);if(this.hasContent()&&this.enabled){this.$element.trigger(b);var d=a.contains(this.$element[0].ownerDocument.documentElement,this.$element[0]);if(b.isDefaultPrevented()||!d)return;var e=this,f=this.tip(),g=this.getUID(this.type);this.setContent(),f.attr("id",g),this.$element.attr("aria-describedby",g),this.options.animation&&f.addClass("fade");var h="function"==typeof this.options.placement?this.options.placement.call(this,f[0],this.$element[0]):this.options.placement,i=/\s?auto?\s?/i,j=i.test(h);j&&(h=h.replace(i,"")||"top"),f.detach().css({top:0,left:0,display:"block"}).addClass(h).data("bs."+this.type,this),this.options.container?f.appendTo(this.options.container):f.insertAfter(this.$element),this.$element.trigger("inserted.bs."+this.type);var k=this.getPosition(),l=f[0].offsetWidth,m=f[0].offsetHeight;if(j){var n=h,o=this.getPosition(this.$viewport);h="bottom"==h&&k.bottom+m>o.bottom?"top":"top"==h&&k.top-m<o.top?"bottom":"right"==h&&k.right+l>o.width?"left":"left"==h&&k.left-l<o.left?"right":h,f.removeClass(n).addClass(h)}var p=this.getCalculatedOffset(h,k,l,m);this.applyPlacement(p,h);var q=function(){var a=e.hoverState;e.$element.trigger("shown.bs."+e.type),e.hoverState=null,"out"==a&&e.leave(e)};a.support.transition&&this.$tip.hasClass("fade")?f.one("bsTransitionEnd",q).emulateTransitionEnd(c.TRANSITION_DURATION):q()}},c.prototype.applyPlacement=function(b,c){var d=this.tip(),e=d[0].offsetWidth,f=d[0].offsetHeight,g=parseInt(d.css("margin-top"),10),h=parseInt(d.css("margin-left"),10);isNaN(g)&&(g=0),isNaN(h)&&(h=0),b.top+=g,b.left+=h,a.offset.setOffset(d[0],a.extend({using:function(a){d.css({top:Math.round(a.top),left:Math.round(a.left)})}},b),0),d.addClass("in");var i=d[0].offsetWidth,j=d[0].offsetHeight;"top"==c&&j!=f&&(b.top=b.top+f-j);var k=this.getViewportAdjustedDelta(c,b,i,j);k.left?b.left+=k.left:b.top+=k.top;var l=/top|bottom/.test(c),m=l?2*k.left-e+i:2*k.top-f+j,n=l?"offsetWidth":"offsetHeight";d.offset(b),this.replaceArrow(m,d[0][n],l)},c.prototype.replaceArrow=function(a,b,c){this.arrow().css(c?"left":"top",50*(1-a/b)+"%").css(c?"top":"left","")},c.prototype.setContent=function(){var a=this.tip(),b=this.getTitle();a.find(".tooltip-inner")[this.options.html?"html":"text"](b),a.removeClass("fade in top bottom left right")},c.prototype.hide=function(b){function d(){"in"!=e.hoverState&&f.detach(),e.$element.removeAttr("aria-describedby").trigger("hidden.bs."+e.type),b&&b()}var e=this,f=a(this.$tip),g=a.Event("hide.bs."+this.type);return this.$element.trigger(g),g.isDefaultPrevented()?void 0:(f.removeClass("in"),a.support.transition&&f.hasClass("fade")?f.one("bsTransitionEnd",d).emulateTransitionEnd(c.TRANSITION_DURATION):d(),this.hoverState=null,this)},c.prototype.fixTitle=function(){var a=this.$element;(a.attr("title")||"string"!=typeof a.attr("data-original-title"))&&a.attr("data-original-title",a.attr("title")||"").attr("title","")},c.prototype.hasContent=function(){return this.getTitle()},c.prototype.getPosition=function(b){b=b||this.$element;var c=b[0],d="BODY"==c.tagName,e=c.getBoundingClientRect();null==e.width&&(e=a.extend({},e,{width:e.right-e.left,height:e.bottom-e.top}));var f=d?{top:0,left:0}:b.offset(),g={scroll:d?document.documentElement.scrollTop||document.body.scrollTop:b.scrollTop()},h=d?{width:a(window).width(),height:a(window).height()}:null;return a.extend({},e,g,h,f)},c.prototype.getCalculatedOffset=function(a,b,c,d){return"bottom"==a?{top:b.top+b.height,left:b.left+b.width/2-c/2}:"top"==a?{top:b.top-d,left:b.left+b.width/2-c/2}:"left"==a?{top:b.top+b.height/2-d/2,left:b.left-c}:{top:b.top+b.height/2-d/2,left:b.left+b.width}},c.prototype.getViewportAdjustedDelta=function(a,b,c,d){var e={top:0,left:0};if(!this.$viewport)return e;var f=this.options.viewport&&this.options.viewport.padding||0,g=this.getPosition(this.$viewport);if(/right|left/.test(a)){var h=b.top-f-g.scroll,i=b.top+f-g.scroll+d;h<g.top?e.top=g.top-h:i>g.top+g.height&&(e.top=g.top+g.height-i)}else{var j=b.left-f,k=b.left+f+c;j<g.left?e.left=g.left-j:k>g.right&&(e.left=g.left+g.width-k)}return e},c.prototype.getTitle=function(){var a,b=this.$element,c=this.options;return a=b.attr("data-original-title")||("function"==typeof c.title?c.title.call(b[0]):c.title)},c.prototype.getUID=function(a){do a+=~~(1e6*Math.random());while(document.getElementById(a));return a},c.prototype.tip=function(){if(!this.$tip&&(this.$tip=a(this.options.template),1!=this.$tip.length))throw new Error(this.type+" `template` option must consist of exactly 1 top-level element!");return this.$tip},c.prototype.arrow=function(){return this.$arrow=this.$arrow||this.tip().find(".tooltip-arrow")},c.prototype.enable=function(){this.enabled=!0},c.prototype.disable=function(){this.enabled=!1},c.prototype.toggleEnabled=function(){this.enabled=!this.enabled},c.prototype.toggle=function(b){var c=this;b&&(c=a(b.currentTarget).data("bs."+this.type),c||(c=new this.constructor(b.currentTarget,this.getDelegateOptions()),a(b.currentTarget).data("bs."+this.type,c))),b?(c.inState.click=!c.inState.click,c.isInStateTrue()?c.enter(c):c.leave(c)):c.tip().hasClass("in")?c.leave(c):c.enter(c)},c.prototype.destroy=function(){var a=this;clearTimeout(this.timeout),this.hide(function(){a.$element.off("."+a.type).removeData("bs."+a.type),a.$tip&&a.$tip.detach(),a.$tip=null,a.$arrow=null,a.$viewport=null})};var d=a.fn.tooltip;a.fn.tooltip=b,a.fn.tooltip.Constructor=c,a.fn.tooltip.noConflict=function(){return a.fn.tooltip=d,this}}(jQuery),+function(a){"use strict";function b(b){return this.each(function(){var d=a(this),e=d.data("bs.popover"),f="object"==typeof b&&b;(e||!/destroy|hide/.test(b))&&(e||d.data("bs.popover",e=new c(this,f)),"string"==typeof b&&e[b]())})}var c=function(a,b){this.init("popover",a,b)};if(!a.fn.tooltip)throw new Error("Popover requires tooltip.js");c.VERSION="3.3.6",c.DEFAULTS=a.extend({},a.fn.tooltip.Constructor.DEFAULTS,{placement:"right",trigger:"click",content:"",template:'<div class="popover" role="tooltip"><div class="arrow"></div><h3 class="popover-title"></h3><div class="popover-content"></div></div>'}),c.prototype=a.extend({},a.fn.tooltip.Constructor.prototype),c.prototype.constructor=c,c.prototype.getDefaults=function(){return c.DEFAULTS},c.prototype.setContent=function(){var a=this.tip(),b=this.getTitle(),c=this.getContent();a.find(".popover-title")[this.options.html?"html":"text"](b),a.find(".popover-content").children().detach().end()[this.options.html?"string"==typeof c?"html":"append":"text"](c),a.removeClass("fade top bottom left right in"),a.find(".popover-title").html()||a.find(".popover-title").hide()},c.prototype.hasContent=function(){return this.getTitle()||this.getContent()},c.prototype.getContent=function(){var a=this.$element,b=this.options;return a.attr("data-content")||("function"==typeof b.content?b.content.call(a[0]):b.content)},c.prototype.arrow=function(){return this.$arrow=this.$arrow||this.tip().find(".arrow")};var d=a.fn.popover;a.fn.popover=b,a.fn.popover.Constructor=c,a.fn.popover.noConflict=function(){return a.fn.popover=d,this}}(jQuery),+function(a){"use strict";function b(c,d){this.$body=a(document.body),this.$scrollElement=a(a(c).is(document.body)?window:c),this.options=a.extend({},b.DEFAULTS,d),this.selector=(this.options.target||"")+" .nav li > a",this.offsets=[],this.targets=[],this.activeTarget=null,this.scrollHeight=0,this.$scrollElement.on("scroll.bs.scrollspy",a.proxy(this.process,this)),this.refresh(),this.process()}function c(c){return this.each(function(){var d=a(this),e=d.data("bs.scrollspy"),f="object"==typeof c&&c;e||d.data("bs.scrollspy",e=new b(this,f)),"string"==typeof c&&e[c]()})}b.VERSION="3.3.6",b.DEFAULTS={offset:10},b.prototype.getScrollHeight=function(){return this.$scrollElement[0].scrollHeight||Math.max(this.$body[0].scrollHeight,document.documentElement.scrollHeight)},b.prototype.refresh=function(){var b=this,c="offset",d=0;this.offsets=[],this.targets=[],this.scrollHeight=this.getScrollHeight(),a.isWindow(this.$scrollElement[0])||(c="position",d=this.$scrollElement.scrollTop()),this.$body.find(this.selector).map(function(){var b=a(this),e=b.data("target")||b.attr("href"),f=/^#./.test(e)&&a(e);return f&&f.length&&f.is(":visible")&&[[f[c]().top+d,e]]||null}).sort(function(a,b){return a[0]-b[0]}).each(function(){b.offsets.push(this[0]),b.targets.push(this[1])})},b.prototype.process=function(){var a,b=this.$scrollElement.scrollTop()+this.options.offset,c=this.getScrollHeight(),d=this.options.offset+c-this.$scrollElement.height(),e=this.offsets,f=this.targets,g=this.activeTarget;if(this.scrollHeight!=c&&this.refresh(),b>=d)return g!=(a=f[f.length-1])&&this.activate(a);if(g&&b<e[0])return this.activeTarget=null,this.clear();for(a=e.length;a--;)g!=f[a]&&b>=e[a]&&(void 0===e[a+1]||b<e[a+1])&&this.activate(f[a])},b.prototype.activate=function(b){this.activeTarget=b,this.clear();var c=this.selector+'[data-target="'+b+'"],'+this.selector+'[href="'+b+'"]',d=a(c).parents("li").addClass("active");
16636d.parent(".dropdown-menu").length&&(d=d.closest("li.dropdown").addClass("active")),d.trigger("activate.bs.scrollspy")},b.prototype.clear=function(){a(this.selector).parentsUntil(this.options.target,".active").removeClass("active")};var d=a.fn.scrollspy;a.fn.scrollspy=c,a.fn.scrollspy.Constructor=b,a.fn.scrollspy.noConflict=function(){return a.fn.scrollspy=d,this},a(window).on("load.bs.scrollspy.data-api",function(){a('[data-spy="scroll"]').each(function(){var b=a(this);c.call(b,b.data())})})}(jQuery),+function(a){"use strict";function b(b){return this.each(function(){var d=a(this),e=d.data("bs.tab");e||d.data("bs.tab",e=new c(this)),"string"==typeof b&&e[b]()})}var c=function(b){this.element=a(b)};c.VERSION="3.3.6",c.TRANSITION_DURATION=150,c.prototype.show=function(){var b=this.element,c=b.closest("ul:not(.dropdown-menu)"),d=b.data("target");if(d||(d=b.attr("href"),d=d&&d.replace(/.*(?=#[^\s]*$)/,"")),!b.parent("li").hasClass("active")){var e=c.find(".active:last a"),f=a.Event("hide.bs.tab",{relatedTarget:b[0]}),g=a.Event("show.bs.tab",{relatedTarget:e[0]});if(e.trigger(f),b.trigger(g),!g.isDefaultPrevented()&&!f.isDefaultPrevented()){var h=a(d);this.activate(b.closest("li"),c),this.activate(h,h.parent(),function(){e.trigger({type:"hidden.bs.tab",relatedTarget:b[0]}),b.trigger({type:"shown.bs.tab",relatedTarget:e[0]})})}}},c.prototype.activate=function(b,d,e){function f(){g.removeClass("active").find("> .dropdown-menu > .active").removeClass("active").end().find('[data-toggle="tab"]').attr("aria-expanded",!1),b.addClass("active").find('[data-toggle="tab"]').attr("aria-expanded",!0),h?(b[0].offsetWidth,b.addClass("in")):b.removeClass("fade"),b.parent(".dropdown-menu").length&&b.closest("li.dropdown").addClass("active").end().find('[data-toggle="tab"]').attr("aria-expanded",!0),e&&e()}var g=d.find("> .active"),h=e&&a.support.transition&&(g.length&&g.hasClass("fade")||!!d.find("> .fade").length);g.length&&h?g.one("bsTransitionEnd",f).emulateTransitionEnd(c.TRANSITION_DURATION):f(),g.removeClass("in")};var d=a.fn.tab;a.fn.tab=b,a.fn.tab.Constructor=c,a.fn.tab.noConflict=function(){return a.fn.tab=d,this};var e=function(c){c.preventDefault(),b.call(a(this),"show")};a(document).on("click.bs.tab.data-api",'[data-toggle="tab"]',e).on("click.bs.tab.data-api",'[data-toggle="pill"]',e)}(jQuery),+function(a){"use strict";function b(b){return this.each(function(){var d=a(this),e=d.data("bs.affix"),f="object"==typeof b&&b;e||d.data("bs.affix",e=new c(this,f)),"string"==typeof b&&e[b]()})}var c=function(b,d){this.options=a.extend({},c.DEFAULTS,d),this.$target=a(this.options.target).on("scroll.bs.affix.data-api",a.proxy(this.checkPosition,this)).on("click.bs.affix.data-api",a.proxy(this.checkPositionWithEventLoop,this)),this.$element=a(b),this.affixed=null,this.unpin=null,this.pinnedOffset=null,this.checkPosition()};c.VERSION="3.3.6",c.RESET="affix affix-top affix-bottom",c.DEFAULTS={offset:0,target:window},c.prototype.getState=function(a,b,c,d){var e=this.$target.scrollTop(),f=this.$element.offset(),g=this.$target.height();if(null!=c&&"top"==this.affixed)return c>e?"top":!1;if("bottom"==this.affixed)return null!=c?e+this.unpin<=f.top?!1:"bottom":a-d>=e+g?!1:"bottom";var h=null==this.affixed,i=h?e:f.top,j=h?g:b;return null!=c&&c>=e?"top":null!=d&&i+j>=a-d?"bottom":!1},c.prototype.getPinnedOffset=function(){if(this.pinnedOffset)return this.pinnedOffset;this.$element.removeClass(c.RESET).addClass("affix");var a=this.$target.scrollTop(),b=this.$element.offset();return this.pinnedOffset=b.top-a},c.prototype.checkPositionWithEventLoop=function(){setTimeout(a.proxy(this.checkPosition,this),1)},c.prototype.checkPosition=function(){if(this.$element.is(":visible")){var b=this.$element.height(),d=this.options.offset,e=d.top,f=d.bottom,g=Math.max(a(document).height(),a(document.body).height());"object"!=typeof d&&(f=e=d),"function"==typeof e&&(e=d.top(this.$element)),"function"==typeof f&&(f=d.bottom(this.$element));var h=this.getState(g,b,e,f);if(this.affixed!=h){null!=this.unpin&&this.$element.css("top","");var i="affix"+(h?"-"+h:""),j=a.Event(i+".bs.affix");if(this.$element.trigger(j),j.isDefaultPrevented())return;this.affixed=h,this.unpin="bottom"==h?this.getPinnedOffset():null,this.$element.removeClass(c.RESET).addClass(i).trigger(i.replace("affix","affixed")+".bs.affix")}"bottom"==h&&this.$element.offset({top:g-b-f})}};var d=a.fn.affix;a.fn.affix=b,a.fn.affix.Constructor=c,a.fn.affix.noConflict=function(){return a.fn.affix=d,this},a(window).on("load",function(){a('[data-spy="affix"]').each(function(){var c=a(this),d=c.data();d.offset=d.offset||{},null!=d.offsetBottom&&(d.offset.bottom=d.offsetBottom),null!=d.offsetTop&&(d.offset.top=d.offsetTop),b.call(c,d)})})}(jQuery);
16636
16637/*! PhotoSwipe - v4.1.1 - 2015-12-24
16638* http://photoswipe.com
16639* Copyright (c) 2015 Dmitry Semenov; */
16640!function(a,b){"function"==typeof define&&define.amd?define(b):"object"==typeof exports?module.exports=b():a.PhotoSwipe=b()}(this,function(){"use strict";var a=function(a,b,c,d){var e={features:null,bind:function(a,b,c,d){var e=(d?"remove":"add")+"EventListener";b=b.split(" ");for(var f=0;f<b.length;f++)b[f]&&a[e](b[f],c,!1)},isArray:function(a){return a instanceof Array},createEl:function(a,b){var c=document.createElement(b||"div");return a&&(c.className=a),c},getScrollY:function(){var a=window.pageYOffset;return void 0!==a?a:document.documentElement.scrollTop},unbind:function(a,b,c){e.bind(a,b,c,!0)},removeClass:function(a,b){var c=new RegExp("(\\s|^)"+b+"(\\s|$)");a.className=a.className.replace(c," ").replace(/^\s\s*/,"").replace(/\s\s*$/,"")},addClass:function(a,b){e.hasClass(a,b)||(a.className+=(a.className?" ":"")+b)},hasClass:function(a,b){return a.className&&new RegExp("(^|\\s)"+b+"(\\s|$)").test(a.className)},getChildByClass:function(a,b){for(var c=a.firstChild;c;){if(e.hasClass(c,b))return c;c=c.nextSibling}},arraySearch:function(a,b,c){for(var d=a.length;d--;)if(a[d][c]===b)return d;return-1},extend:function(a,b,c){for(var d in b)if(b.hasOwnProperty(d)){if(c&&a.hasOwnProperty(d))continue;a[d]=b[d]}},easing:{sine:{out:function(a){return Math.sin(a*(Math.PI/2))},inOut:function(a){return-(Math.cos(Math.PI*a)-1)/2}},cubic:{out:function(a){return--a*a*a+1}}},detectFeatures:function(){if(e.features)return e.features;var a=e.createEl(),b=a.style,c="",d={};if(d.oldIE=document.all&&!document.addEventListener,d.touch="ontouchstart"in window,window.requestAnimationFrame&&(d.raf=window.requestAnimationFrame,d.caf=window.cancelAnimationFrame),d.pointerEvent=navigator.pointerEnabled||navigator.msPointerEnabled,!d.pointerEvent){var f=navigator.userAgent;if(/iP(hone|od)/.test(navigator.platform)){var g=navigator.appVersion.match(/OS (\d+)_(\d+)_?(\d+)?/);g&&g.length>0&&(g=parseInt(g[1],10),g>=1&&8>g&&(d.isOldIOSPhone=!0))}var h=f.match(/Android\s([0-9\.]*)/),i=h?h[1]:0;i=parseFloat(i),i>=1&&(4.4>i&&(d.isOldAndroid=!0),d.androidVersion=i),d.isMobileOpera=/opera mini|o
16640pera mobi/i.test(f)}for(var j,k,l=["transform","perspective","animationName"],m=["","webkit","Moz","ms","O"],n=0;4>n;n++){c=m[n];for(var o=0;3>o;o++)j=l[o],k=c+(c?j.charAt(0).toUpperCase()+j.slice(1):j),!d[j]&&k in b&&(d[j]=k);c&&!d.raf&&(c=c.toLowerCase(),d.raf=window[c+"RequestAnimationFrame"],d.raf&&(d.caf=window[c+"CancelAnimationFrame"]||window[c+"CancelRequestAnimationFrame"]))}if(!d.raf){var p=0;d.raf=function(a){var b=(new Date).getTime(),c=Math.max(0,16-(b-p)),d=window.setTimeout(function(){a(b+c)},c);return p=b+c,d},d.caf=function(a){clearTimeout(a)}}return d.svg=!!document.createElementNS&&!!document.createElementNS("http://www.w3.org/2000/svg","svg").createSVGRect,e.features=d,d}};e.detectFeatures(),e.features.oldIE&&(e.bind=function(a,b,c,d){b=b.split(" ");for(var e,f=(d?"detach":"attach")+"Event",g=function(){c.handleEvent.call(c)},h=0;h<b.length;h++)if(e=b[h])if("object"==typeof c&&c.handleEvent){if(d){if(!c["oldIE"+e])return!1}else c["oldIE"+e]=g;a[f]("on"+e,c["oldIE"+e])}else a[f]("on"+e,c)});var f=this,g=25,h=3,i={allowPanToNext:!0,spacing:.12,bgOpacity:1,mouseUsed:!1,loop:!0,pinchToClose:!0,closeOnScroll:!0,closeOnVerticalDrag:!0,verticalDragRange:.75,hideAnimationDuration:333,showAnimationDuration:333,showHideOpacity:!1,focus:!0,escKey:!0,arrowKeys:!0,mainScrollEndFriction:.35,panEndFriction:.35,isClickableElement:function(a){return"A"===a.tagName},getDoubleTapZoom:function(a,b){return a?1:b.initialZoomLevel<.7?1:1.33},maxSpreadZoom:1.33,modal:!0,scaleMode:"fit"};e.extend(i,d);var j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z,A,B,C,D,E,F,G,H,I,J,K,L,M,N,O,P,Q,R,S,T,U,V,W,X,Y,Z,$,_,aa,ba,ca,da,ea,fa,ga,ha,ia,ja,ka,la=function(){return{x:0,y:0}},ma=la(),na=la(),oa=la(),pa={},qa=0,ra={},sa=la(),ta=0,ua=!0,va=[],wa={},xa=!1,ya=function(a,b){e.extend(f,b.publicMethods),va.push(a)},za=function(a){var b=_b();return a>b-1?a-b:0>a?b+a:a},Aa={},Ba=function(a,b){return Aa[a]||(Aa[a]=[]),Aa[a].push(b)},Ca=function(a){var b=Aa[a];if(b){var c=Array.prototype.slice.call(arguments);c.shift();for(var d=0;d<b.length;d++)b[d].apply(f,c)}},Da=function(){return(new Date).getTime()},Ea=function(a){ia=a,f.bg.style.opacity=a*i.bgOpacity},Fa=function(a,b,c,d,e){(!xa||e&&e!==f.currItem)&&(d/=e?e.fitRatio:f.currItem.fitRatio),a[E]=u+b+"px, "+c+"px"+v+" scale("+d+")"},Ga=function(a){da&&(a&&(s>f.currItem.fitRatio?xa||(lc(f.currItem,!1,!0),xa=!0):xa&&(lc(f.currItem),xa=!1)),Fa(da,oa.x,oa.y,s))},Ha=function(a){a.container&&Fa(a.container.style,a.initialPosition.x,a.initialPosition.y,a.initialZoomLevel,a)},Ia=function(a,b){b[E]=u+a+"px, 0px"+v},Ja=function(a,b){if(!i.loop&&b){var c=m+(sa.x*qa-a)/sa.x,d=Math.round(a-sb.x);(0>c&&d>0||c>=_b()-1&&0>d)&&(a=sb.x+d*i.mainScrollEndFriction)}sb.x=a,Ia(a,n)},Ka=function(a,b){var c=tb[a]-ra[a];return na[a]+ma[a]+c-c*(b/t)},La=function(a,b){a.x=b.x,a.y=b.y,b.id&&(a.id=b.id)},Ma=function(a){a.x=Math.round(a.x),a.y=Math.round(a.y)},Na=null,Oa=function(){Na&&(e.unbind(document,"mousemove",Oa),e.addClass(a,"pswp--has_mouse"),i.mouseUsed=!0,Ca("mouseUsed")),Na=setTimeout(function(){Na=null},100)},Pa=function(){e.bind(document,"keydown",f),N.transform&&e.bind(f.scrollWrap,"click",f),i.mouseUsed||e.bind(document,"mousemove",Oa),e.bind(window,"resize scroll",f),Ca("bindEvents")},Qa=function(){e.unbind(window,"resize",f),e.unbind(window,"scroll",r.scroll),e.unbind(document,"keydown",f),e.unbind(document,"mousemove",Oa),N.transform&&e.unbind(f.scrollWrap,"click",f),U&&e.unbind(window,p,f),Ca("unbindEvents")},Ra=function(a,b){var c=hc(f.currItem,pa,a);return b&&(ca=c),c},Sa=function(a){return a||(a=f.currItem),a.initialZoomLevel},Ta=function(a){return a||(a=f.currItem),a.w>0?i.maxSpreadZoom:1},Ua=function(a,b,c,d){return d===f.currItem.initialZoomLevel?(c[a]=f.currItem.initialPosition[a],!0):(c[a]=Ka(a,d),c[a]>b.min[a]?(c[a]=b.min[a],!0):c[a]<b.max[a]?(c[a]=b.max[a],!0):!1)},Va=function(){if(E){var b=N.perspective&&!G;return u="translate"+(b?"3d(":"("),void(v=N.perspective?", 0px)":")")}E="left",e.addClass(a,"pswp--ie"),Ia=function(a,b){b.left=a+"px"},Ha=function(a){var b=a.fitRatio>1?1:a.fitRatio,c=a.container.style,d=b*a.w,e=b*a.h;c.width=d+"px",c.height=e+"px",c.left=a.initialPosition.x+"px",c.top=a.initialPosition.y+"px"},Ga=function(){if(da){var a=da,b=f.currItem,c=b.fitRatio>1?1:b.fitRatio,d=c*b.w,e=c*b.h;a.width=d+"px",a.height=e+"px",a.left=oa.x+"px",a.top=oa.y+"px"}}},Wa=function(a){var b="";i.escKey&&27===a.keyCode?b="close":i.arrowKeys&&(37===a.keyCode?b="prev":39===a.keyCode&&(b="next")),b&&(a.ctrlKey||a.altKey||a.shiftKey||a.metaKey||(a.preventDefault?a.preventDefault():a.returnValue=!1,f[b]()))},Xa=function(a){a&&(X||W||ea||S)&&(a.preventDefault(),a.stopPropagation())},Ya=function(){f.setScrollOffset(0,e.getScrollY())},Za={},$a=0,_a=function(a){Za[a]&&(Za[a].raf&&I(Za[a].raf),$a--,delete Za[a])},ab=function(a){Za[a]&&_a(a),Za[a]||($a++,Za[a]={})},bb=function(){for(var a in Za)Za.hasOwnProperty(a)&&_a(a)},cb=function(a,b,c,d,e,f,g){var h,i=Da();ab(a);var j=function(){if(Za[a]){if(h=Da()-i,h>=d)return _a(a),f(c),void(g&&g());f((c-b)*e(h/d)+b),Za[a].raf=H(j)}};j()},db={shout:Ca,listen:Ba,viewportSize:pa,options:i,isMainScrollAnimating:function(){return ea},getZoomLevel:function(){return s},getCurrentIndex:function(){return m},isDragging:function(){return U},isZooming:function(){return _},setScrollOffset:function(a,b){ra.x=a,M=ra.y=b,Ca("updateScrollOffset",ra)},applyZoomPan:function(a,b,c,d){oa.x=b,oa.y=c,s=a,Ga(d)},init:function(){if(!j&&!k){var c;f.framework=e,f.template=a,f.bg=e.getChildByClass(a,"pswp__bg"),J=a.className,j=!0,N=e.detectFeatures(),H=N.raf,I=N.caf,E=N.transform,L=N.oldIE,f.scrollWrap=e.getChildByClass(a,"pswp__scroll-wrap"),f.container=e.getChildByClass(f.scrollWrap,"pswp__container"),n=f.container.style,f.itemHolders=y=[{el:f.container.children[0],wrap:0,index:-1},{el:f.container.children[1],wrap:0,index:-1},{el:f.container.children[2],wrap:0,index:-1}],y[0].el.style.display=y[2].el.style.display="none",Va(),r={resize:f.updateSize,scroll:Ya,keydown:Wa,click:Xa};var d=N.isOldIOSPhone||N.isOldAndroid||N.isMobileOpera;for(N.animationName&&N.transform&&!d||(i.showAnimationDuration=i.hideAnimationDuration=0),c=0;c<va.length;c++)f["init"+va[c]]();if(b){var g=f.ui=new b(f,e);g.init()}Ca("firstUpdate"),m=m||i.index||0,(isNaN(m)||0>m||m>=_b())&&(m=0),f.currItem=$b(m),(N.isOldIOSPhone||N.isOldAndroid)&&(ua=!1),a.setAttribute("aria-hidden","false"),i.modal&&(ua?a.style.position="fixed":(a.style.position="absolute",a.style.top=e.getScrollY()+"px")),void 0===M&&(Ca("initialLayout"),M=K=e.getScrollY());var l="pswp--open ";for(i.mainClass&&(l+=i.mainClass+" "),i.showHideOpacity&&(l+="pswp--animate_opacity "),l+=G?"pswp--touch":"pswp--notouch",l+=N.animationName?" pswp--css_animation":"",l+=N.svg?" pswp--svg":"",e.addClass(a,l),f.updateSize(),o=-1,ta=null,c=0;h>c;c++)Ia((c+o)*sa.x,y[c].el.style);L||e.bind(f.scrollWrap,q,f),Ba("initialZoomInEnd",function(){f.setContent(y[0],m-1),f.setContent(y[2],m+1),y[0].el.style.display=y[2].el.style.display="block",i.focus&&a.focus(),Pa()}),f.setContent(y[1],m),f.updateCurrItem(),Ca("afterInit"),ua||(w=setInterval(function(){$a||U||_||s!==f.currItem.initialZoomLevel||f.updateSize()},1e3)),e.addClass(a,"pswp--visible")}}
16640,close:function(){j&&(j=!1,k=!0,Ca("close"),Qa(),bc(f.currItem,null,!0,f.destroy))},destroy:function(){Ca("destroy"),Wb&&clearTimeout(Wb),a.setAttribute("aria-hidden","true"),a.className=J,w&&clearInterval(w),e.unbind(f.scrollWrap,q,f),e.unbind(window,"scroll",f),yb(),bb(),Aa=null},panTo:function(a,b,c){c||(a>ca.min.x?a=ca.min.x:a<ca.max.x&&(a=ca.max.x),b>ca.min.y?b=ca.min.y:b<ca.max.y&&(b=ca.max.y)),oa.x=a,oa.y=b,Ga()},handleEvent:function(a){a=a||window.event,r[a.type]&&r[a.type](a)},goTo:function(a){a=za(a);var b=a-m;ta=b,m=a,f.currItem=$b(m),qa-=b,Ja(sa.x*qa),bb(),ea=!1,f.updateCurrItem()},next:function(){f.goTo(m+1)},prev:function(){f.goTo(m-1)},updateCurrZoomItem:function(a){if(a&&Ca("beforeChange",0),y[1].el.children.length){var b=y[1].el.children[0];da=e.hasClass(b,"pswp__zoom-wrap")?b.style:null}else da=null;ca=f.currItem.bounds,t=s=f.currItem.initialZoomLevel,oa.x=ca.center.x,oa.y=ca.center.y,a&&Ca("afterChange")},invalidateCurrItems:function(){x=!0;for(var a=0;h>a;a++)y[a].item&&(y[a].item.needsUpdate=!0)},updateCurrItem:function(a){if(0!==ta){var b,c=Math.abs(ta);if(!(a&&2>c)){f.currItem=$b(m),xa=!1,Ca("beforeChange",ta),c>=h&&(o+=ta+(ta>0?-h:h),c=h);for(var d=0;c>d;d++)ta>0?(b=y.shift(),y[h-1]=b,o++,Ia((o+2)*sa.x,b.el.style),f.setContent(b,m-c+d+1+1)):(b=y.pop(),y.unshift(b),o--,Ia(o*sa.x,b.el.style),f.setContent(b,m+c-d-1-1));if(da&&1===Math.abs(ta)){var e=$b(z);e.initialZoomLevel!==s&&(hc(e,pa),lc(e),Ha(e))}ta=0,f.updateCurrZoomItem(),z=m,Ca("afterChange")}}},updateSize:function(b){if(!ua&&i.modal){var c=e.getScrollY();if(M!==c&&(a.style.top=c+"px",M=c),!b&&wa.x===window.innerWidth&&wa.y===window.innerHeight)return;wa.x=window.innerWidth,wa.y=window.innerHeight,a.style.height=wa.y+"px"}if(pa.x=f.scrollWrap.clientWidth,pa.y=f.scrollWrap.clientHeight,Ya(),sa.x=pa.x+Math.round(pa.x*i.spacing),sa.y=pa.y,Ja(sa.x*qa),Ca("beforeResize"),void 0!==o){for(var d,g,j,k=0;h>k;k++)d=y[k],Ia((k+o)*sa.x,d.el.style),j=m+k-1,i.loop&&_b()>2&&(j=za(j)),g=$b(j),g&&(x||g.needsUpdate||!g.bounds)?(f.cleanSlide(g),f.setContent(d,j),1===k&&(f.currItem=g,f.updateCurrZoomItem(!0)),g.needsUpdate=!1):-1===d.index&&j>=0&&f.setContent(d,j),g&&g.container&&(hc(g,pa),lc(g),Ha(g));x=!1}
16640t=s=f.currItem.initialZoomLevel,ca=f.currItem.bounds,ca&&(oa.x=ca.center.x,oa.y=ca.center.y,Ga(!0)),Ca("resize")},zoomTo:function(a,b,c,d,f){b&&(t=s,tb.x=Math.abs(b.x)-oa.x,tb.y=Math.abs(b.y)-oa.y,La(na,oa));var g=Ra(a,!1),h={};Ua("x",g,h,a),Ua("y",g,h,a);var i=s,j={x:oa.x,y:oa.y};Ma(h);var k=function(b){1===b?(s=a,oa.x=h.x,oa.y=h.y):(s=(a-i)*b+i,oa.x=(h.x-j.x)*b+j.x,oa.y=(h.y-j.y)*b+j.y),f&&f(b),Ga(1===b)};c?cb("customZoomTo",0,1,c,d||e.easing.sine.inOut,k):k(1)}},eb=30,fb=10,gb={},hb={},ib={},jb={},kb={},lb=[],mb={},nb=[],ob={},pb=0,qb=la(),rb=0,sb=la(),tb=la(),ub=la(),vb=function(a,b){return a.x===b.x&&a.y===b.y},wb=function(a,b){return Math.abs(a.x-b.x)<g&&Math.abs(a.y-b.y)<g},xb=function(a,b){return ob.x=Math.abs(a.x-b.x),ob.y=Math.abs(a.y-b.y),Math.sqrt(ob.x*ob.x+ob.y*ob.y)},yb=function(){Y&&(I(Y),Y=null)},zb=function(){U&&(Y=H(zb),Pb())},Ab=function(){return!("fit"===i.scaleMode&&s===f.currItem.initialZoomLevel)},Bb=function(a,b){return a&&a!==document?a.getAttribute("class")&&a.getAttribute("class").indexOf("pswp__scroll-wrap")>-1?!1:b(a)?a:Bb(a.parentNode,b):!1},Cb={},Db=function(a,b){return Cb.prevent=!Bb(a.target,i.isClickableElement),Ca("preventDragEvent",a,b,Cb),Cb.prevent},Eb=function(a,b){return b.x=a.pageX,b.y=a.pageY,b.id=a.identifier,b},Fb=function(a,b,c){c.x=.5*(a.x+b.x),c.y=.5*(a.y+b.y)},Gb=function(a,b,c){if(a-P>50){var d=nb.length>2?nb.shift():{};d.x=b,d.y=c,nb.push(d),P=a}},Hb=function(){var a=oa.y-f.currItem.initialPosition.y;return 1-Math.abs(a/(pa.y/2))},Ib={},Jb={},Kb=[],Lb=function(a){for(;Kb.length>0;)Kb.pop();return F?(ka=0,lb.forEach(function(a){0===ka?Kb[0]=a:1===ka&&(Kb[1]=a),ka++})):a.type.indexOf("touch")>-1?a.touches&&a.touches.length>0&&(Kb[0]=Eb(a.touches[0],Ib),a.touches.length>1&&(Kb[1]=Eb(a.touches[1],Jb))):(Ib.x=a.pageX,Ib.y=a.pageY,Ib.id="",Kb[0]=Ib),Kb},Mb=function(a,b){var c,d,e,g,h=0,j=oa[a]+b[a],k=b[a]>0,l=sb.x+b.x,m=sb.x-mb.x;return c=j>ca.min[a]||j<ca.max[a]?i.panEndFriction:1,j=oa[a]+b[a]*c,!i.allowPanToNext&&s!==f.currItem.initialZoomLevel||(da?"h"!==fa||"x"!==a||W||(k?(j>ca.min[a]&&(c=i.panEndFriction,h=ca.min[a]-j,d=ca.min[a]-na[a]),(0>=d||0>m)&&_b()>1?(g=l,0>m&&l>mb.x&&(g=mb.x)):ca.min.x!==ca.max.x&&(e=j)):(j<ca.max[a]&&(c=i.panEndFriction,h=j-ca.max[a],d=na[a]-ca.max[a]),(0>=d||m>0)&&_b()>1?(g=l,m>0&&l<mb.x&&(g=mb.x)):ca.min.x!==ca.max.x&&(e=j))):g=l,"x"!==a)?void(ea||Z||s>f.currItem.fitRatio&&(oa[a]+=b[a]*c)):(void 0!==g&&(Ja(g,!0),Z=g===mb.x?!1:!0),ca.min.x!==ca.max.x&&(void 0!==e?oa.x=e:Z||(oa.x+=b.x*c)),void 0!==g)},Nb=function(a){if(!("mousedown"===a.type&&a.button>0)){if(Zb)return void a.preventDefault();if(!T||"mousedown"!==a.type){if(Db(a,!0)&&a.preventDefault(),Ca("pointerDown"),F){var b=e.arraySearch(lb,a.pointerId,"id");0>b&&(b=lb.length),lb[b]={x:a.pageX,y:a.pageY,id:a.pointerId}}var c=Lb(a),d=c.length;$=null,bb(),U&&1!==d||(U=ga=!0,e.bind(window,p,f),R=ja=ha=S=Z=X=V=W=!1,fa=null,Ca("firstTouchStart",c),La(na,oa),ma.x=ma.y=0,La(jb,c[0]),La(kb,jb),mb.x=sa.x*qa,nb=[{x:jb.x,y:jb.y}],P=O=Da(),Ra(s,!0),yb(),zb()),!_&&d>1&&!ea&&!Z&&(t=s,W=!1,_=V=!0,ma.y=ma.x=0,La(na,oa),La(gb,c[0]),La(hb,c[1]),Fb(gb,hb,ub),tb.x=Math.abs(ub.x)-oa.x,tb.y=Math.abs(ub.y)-oa.y,aa=ba=xb(gb,hb))}}},Ob=function(a){if(a.preventDefault(),F){var b=e.arraySearch(lb,a.pointerId,"id");if(b>-1){var c=lb[b];c.x=a.pageX,c.y=a.pageY}}if(U){var d=Lb(a);if(fa||X||_)$=d;else if(sb.x!==sa.x*qa)fa="h";else{var f=Math.abs(d[0].x-jb.x)-Math.abs(d[0].y-jb.y);Math.abs(f)>=fb&&(fa=f>0?"h":"v",$=d)}}},Pb=function(){if($){var a=$.length;if(0!==a)if(La(gb,$[0]),ib.x=gb.x-jb.x,ib.y=gb.y-jb.y,_&&a>1){if(jb.x=gb.x,jb.y=gb.y,!ib.x&&!ib.y&&vb($[1],hb))return;La(hb,$[1]),W||(W=!0,Ca("zoomGestureStarted"));var b=xb(gb,hb),c=Ub(b);c>f.currItem.initialZoomLevel+f.currItem.initialZoomLevel/15&&(ja=!0);var d=1,e=Sa(),g=Ta();if(e>c)if(i.pinchToClose&&!ja&&t<=f.currItem.initialZoomLevel){var h=e-c,j=1-h/(e/1.2);Ea(j),Ca("onPinchClose",j),ha=!0}else d=(e-c)/e,d>1&&(d=1),c=e-d*(e/3);else c>g&&(d=(c-g)/(6*e),d>1&&(d=1),c=g+d*e);0>d&&(d=0),aa=b,Fb(gb,hb,qb),ma.x+=qb.x-ub.x,ma.y+=qb.y-ub.y,La(ub,qb),oa.x=Ka("x",c),oa.y=Ka("y",c),R=c>s,s=c,Ga()}else{if(!fa)return;if(ga&&(ga=!1,Math.abs(ib.x)>=fb&&(ib.x-=$[0].x-kb.x),Math.abs(ib.y)>=fb&&(ib.y-=$[0].y-kb.y)),jb.x=gb.x,jb.y=gb.y,0===ib.x&&0===ib.y)return;if("v"===fa&&i.closeOnVerticalDrag&&!Ab()){ma.y+=ib.y,oa.y+=ib.y;var k=Hb();return S=!0,Ca("onVerticalDrag",k),Ea(k),void Ga()}Gb(Da(),gb.x,gb.y),X=!0,ca=f.currItem.bounds;var l=Mb("x",ib);
16640l||(Mb("y",ib),Ma(oa),Ga())}}},Qb=function(a){if(N.isOldAndroid){if(T&&"mouseup"===a.type)return;a.type.indexOf("touch")>-1&&(clearTimeout(T),T=setTimeout(function(){T=0},600))}Ca("pointerUp"),Db(a,!1)&&a.preventDefault();var b;if(F){var c=e.arraySearch(lb,a.pointerId,"id");if(c>-1)if(b=lb.splice(c,1)[0],navigator.pointerEnabled)b.type=a.pointerType||"mouse";else{var d={4:"mouse",2:"touch",3:"pen"};b.type=d[a.pointerType],b.type||(b.type=a.pointerType||"mouse")}}var g,h=Lb(a),j=h.length;if("mouseup"===a.type&&(j=0),2===j)return $=null,!0;1===j&&La(kb,h[0]),0!==j||fa||ea||(b||("mouseup"===a.type?b={x:a.pageX,y:a.pageY,type:"mouse"}:a.changedTouches&&a.changedTouches[0]&&(b={x:a.changedTouches[0].pageX,y:a.changedTouches[0].pageY,type:"touch"})),Ca("touchRelease",a,b));var k=-1;if(0===j&&(U=!1,e.unbind(window,p,f),yb(),_?k=0:-1!==rb&&(k=Da()-rb)),rb=1===j?Da():-1,g=-1!==k&&150>k?"zoom":"swipe",_&&2>j&&(_=!1,1===j&&(g="zoomPointerUp"),Ca("zoomGestureEnded")),$=null,X||W||ea||S)if(bb(),Q||(Q=Rb()),Q.calculateSwipeSpeed("x"),S){var l=Hb();if(l<i.verticalDragRange)f.close();else{var m=oa.y,n=ia;cb("verticalDrag",0,1,300,e.easing.cubic.out,function(a){oa.y=(f.currItem.initialPosition.y-m)*a+m,Ea((1-n)*a+n),Ga()}),Ca("onVerticalDrag",1)}}else{if((Z||ea)&&0===j){var o=Tb(g,Q);if(o)return;g="zoomPointerUp"}if(!ea)return"swipe"!==g?void Vb():void(!Z&&s>f.currItem.fitRatio&&Sb(Q))}},Rb=function(){var a,b,c={lastFlickOffset:{},lastFlickDist:{},lastFlickSpeed:{},slowDownRatio:{},slowDownRatioReverse:{},speedDecelerationRatio:{},speedDecelerationRatioAbs:{},distanceOffset:{},backAnimDestination:{},backAnimStarted:{},calculateSwipeSpeed:function(d){nb.length>1?(a=Da()-P+50,b=nb[nb.length-2][d]):(a=Da()-O,b=kb[d]),c.lastFlickOffset[d]=jb[d]-b,c.lastFlickDist[d]=Math.abs(c.lastFlickOffset[d]),c.lastFlickDist[d]>20?c.lastFlickSpeed[d]=c.lastFlickOffset[d]/a:c.lastFlickSpeed[d]=0,Math.abs(c.lastFlickSpeed[d])<.1&&(c.lastFlickSpeed[d]=0),c.slowDownRatio[d]=.95,c.slowDownRatioReverse[d]=1-c.slowDownRatio[d],c.speedDecelerationRatio[d]=1},calculateOverBoundsAnimOffset:function(a,b){c.backAnimStarted[a]||(oa[a]>ca.min[a]?c.backAnimDestination[a]=ca.min[a]:oa[a]<ca.max[a]&&(c.backA
16640nimDestination[a]=ca.max[a]),void 0!==c.backAnimDestination[a]&&(c.slowDownRatio[a]=.7,c.slowDownRatioReverse[a]=1-c.slowDownRatio[a],c.speedDecelerationRatioAbs[a]<.05&&(c.lastFlickSpeed[a]=0,c.backAnimStarted[a]=!0,cb("bounceZoomPan"+a,oa[a],c.backAnimDestination[a],b||300,e.easing.sine.out,function(b){oa[a]=b,Ga()}))))},calculateAnimOffset:function(a){c.backAnimStarted[a]||(c.speedDecelerationRatio[a]=c.speedDecelerationRatio[a]*(c.slowDownRatio[a]+c.slowDownRatioReverse[a]-c.slowDownRatioReverse[a]*c.timeDiff/10),c.speedDecelerationRatioAbs[a]=Math.abs(c.lastFlickSpeed[a]*c.speedDecelerationRatio[a]),c.distanceOffset[a]=c.lastFlickSpeed[a]*c.speedDecelerationRatio[a]*c.timeDiff,oa[a]+=c.distanceOffset[a])},panAnimLoop:function(){return Za.zoomPan&&(Za.zoomPan.raf=H(c.panAnimLoop),c.now=Da(),c.timeDiff=c.now-c.lastNow,c.lastNow=c.now,c.calculateAnimOffset("x"),c.calculateAnimOffset("y"),Ga(),c.calculateOverBoundsAnimOffset("x"),c.calculateOverBoundsAnimOffset("y"),c.speedDecelerationRatioAbs.x<.05&&c.speedDecelerationRatioAbs.y<.05)?(oa.x=Math.round(oa.x),oa.y=Math.round(oa.y),Ga(),void _a("zoomPan")):void 0}};return c},Sb=function(a){return a.calculateSwipeSpeed("y"),ca=f.currItem.bounds,a.backAnimDestination={},a.backAnimStarted={},Math.abs(a.lastFlickSpeed.x)<=.05&&Math.abs(a.lastFlickSpeed.y)<=.05?(a.speedDecelerationRatioAbs.x=a.speedDecelerationRatioAbs.y=0,a.calculateOverBoundsAnimOffset("x"),a.calculateOverBoundsAnimOffset("y"),!0):(ab("zoomPan"),a.lastNow=Da(),void a.panAnimLoop())},Tb=function(a,b){var c;ea||(pb=m);var d;if("swipe"===a){var g=jb.x-kb.x,h=b.lastFlickDist.x<10;g>eb&&(h||b.lastFlickOffset.x>20)?d=-1:-eb>g&&(h||b.lastFlickOffset.x<-20)&&(d=1)}var j;d&&(m+=d,0>m?(m=i.loop?_b()-1:0,j=!0):m>=_b()&&(m=i.loop?0:_b()-1,j=!0),(!j||i.loop)&&(ta+=d,qa-=d,c=!0));var k,l=sa.x*qa,n=Math.abs(l-sb.x);return c||l>sb.x==b.lastFlickSpeed.x>0?(k=Math.abs(b.lastFlickSpeed.x)>0?n/Math.abs(b.lastFlickSpeed.x):333,k=Math.min(k,400),k=Math.max(k,250)):k=333,pb===m&&(c=!1),ea=!0,Ca("mainScrollAnimStart"),cb("mainScroll",sb.x,l,k,e.easing.cubic.out,Ja,function(){bb(),ea=!1,pb=-1,(c||pb!==m)&&f.updateCurrItem(),Ca("mainScrollAnimComplete")}),c&&f.updateCurrItem(!0),c},Ub=function(a){return 1/ba*a*t},Vb=function(){var a=s,b=Sa(),c=Ta();b>s?a=b:s>c&&(a=c);var d,g=1,h=ia;return ha&&!R&&!ja&&b>s?(f.close(),!0):(ha&&(d=function(a){Ea((g-h)*a+h)}),f.zoomTo(a,0,200,e.easing.cubic.out,d),!0)};ya("Gestures",{publicMethods:{initGestures:function(){var a=function(a,b,c,d,e){A=a+b,B=a+c,C=a+d,D=e?a+e:""};F=N.pointerEvent,F&&N.touch&&(N.touch=!1),F?navigator.pointerEnabled?a("pointer","down","move","up","cancel"):a("MSPointer","Down","Move","Up","Cancel"):N.touch?(a("touch","start","move","end","cancel"),G=!0):a("mouse","down","move","up"),p=B+" "+C+" "+D,q=A,F&&!G&&(G=navigator.maxTouchPoints>1||navigator.msMaxTouchPoints>1),f.likelyTouchDevice=G,r[A]=Nb,r[B]=Ob,r[C]=Qb,D&&(r[D]=r[C]),N.touch&&(q+=" mousedown",p+=" mousemove mouseup",r.mousedown=r[A],r.mousemove=r[B],r.mouseup=r[C]),G||(i.allowPanToNext=!1)}}});var Wb,Xb,Yb,Zb,$b,_b,ac,bc=function(b,c,d,g){Wb&&clearTimeout(Wb),Zb=!0,Yb=!0;var h;b.initialLayout?(h=b.initialLayout,b.initialLayout=null):h=i.getThumbBoundsFn&&i.getThumbBoundsFn(m);var j=d?i.hideAnimationDuration:i.showAnimationDuration,k=function(){_a("initialZoom"),d?(f.template.removeAttribute("style"),f.bg.removeAttribute("style")):(Ea(1),c&&(c.style.display="block"),e.addClass(a,"pswp--animated-in"),Ca("initialZoom"+(d?"OutEnd":"InEnd"))),g&&g(),Zb=!1};if(!j||!h||void 0===h.x)return Ca("initialZoom"+(d?"Out":"In")),s=b.initialZoomLevel,La(oa,b.initialPosition),Ga(),a.style.opacity=d?0:1,Ea(1),void(j?setTimeout(function(){k()},j):k());var n=function(){var c=l,g=!f.currItem.src||f.currItem.loadError||i.showHideOpacity;b.miniImg&&(b.miniImg.style.webkitBackfaceVisibility="hidden"),d||(s=h.w/b.w,oa.x=h.x,oa.y=h.y-K,f[g?"template":"bg"].style.opacity=.001,Ga()),ab("initialZoom"),d&&!c&&e.removeClass(a,"pswp--animated-in"),g&&(d?e[(c?"remove":"add")+"Class"](a,"pswp--animate_opacity"):setTimeout(function(){e.addClass(a,"pswp--animate_opacity")},30)),Wb=setTimeout(function(){if(Ca("initialZoom"+(d?"Out":"In")),d){var f=h.w/b.w,i={x:oa.x,y:oa.y},l=s,m=ia,n=function(b){1===b?(s=f,oa.x=h.x,oa.y=h.y-M):(s=(f-l)*b+l,oa.x=(h.x-i.x)*b+i.x,oa.y=(h.y-M-i.y)*b+i.y),Ga(),g?a.style.opacity=1-b:Ea(m-b*m)};c?cb("initialZoom",0,1,j,e.easing.cubic.out,n,k):(n(1),Wb=setTimeout(k,j+20))}else s=b.initialZoomLevel,La(oa,b.initialPosition),Ga(),Ea(1),g?a.style.opacity=1:Ea(1),Wb=setTimeout(k,j+20)},d?25:90)};n()},cc={},dc=[],ec={index:0,errorMsg:'<div class="pswp__error-msg"><a href="%url%" target="_blank">The image</a> could not be loaded.</div>',forceProgressiveLoading:!1,preload:[1,1],getNumItemsFn:function(){return Xb.length}},fc=function(){return{center:{x:0,y:0},max:{x:0,y:0},min:{x:0,y:0}}},gc=function(a,b,c){var d=a.bounds;d.center.x=Math.round((cc.x-b)/2),d.center.y=Math.round((cc.y-c)/2)+a.vGap.top,d.max.x=b>cc.x?Math.round(cc.x-b):d.center.x,d.max.y=c>cc.y?Math.round(cc.y-c)+a.vGap.top:d.center.y,d.min.x=b>cc.x?0:d.center.x,d.min.y=c>cc.y?a.vGap.top:d.center.y},hc=function(a,b,c){if(a.src&&!a.loadError){var d=!c;if(d&&(a.vGap||(a.vGap={top:0,bottom:0}),Ca("parseVerticalMargin",a)),cc.x=b.x,cc.y=b.y-a.vGap.top-a.vGap.bottom,d){var e=cc.x/a.w,f=cc.y/a.h;a.fitRatio=f>e?e:f;var g=i.scaleMode;"orig"===g?c=1:"fit"===g&&(c=a.fitRatio),c>1&&(c=1),a.initialZoomLevel=c,a.bounds||(a.bounds=fc())}if(!c)return;return gc(a,a.w*c,a.h*c),d&&c===a.initialZoomLevel&&(a.initialPosition=a.bounds.center),a.bounds}return a.w=a.h=0,a.initialZoomLevel=a.fitRatio=1,a.bounds=fc(),a.initialPosition=a.bounds.center,a.bounds},ic=function(a,b,c,d,e,g){b.loadError||d&&(b.imageAppended=!0,lc(b,d,b===f.currItem&&xa),c.appendChild(d),g&&setTimeout(function(){b&&b.loaded&&b.placeholder&&(b.placeholder.style.display="none",b.placeholder=null)},500))},jc=function(a){a.loading=!0,a.loaded=!1;var b=a.img=e.createEl("pswp__img","img"),c=function(){a.loading=!1,a.loaded=!0,a.loadComplete?a.loadComplete(a):a.img=null,b.onload=b.onerror=null,b=null};
16640return b.onload=c,b.onerror=function(){a.loadError=!0,c()},b.src=a.src,b},kc=function(a,b){return a.src&&a.loadError&&a.container?(b&&(a.container.innerHTML=""),a.container.innerHTML=i.errorMsg.replace("%url%",a.src),!0):void 0},lc=function(a,b,c){if(a.src){b||(b=a.container.lastChild);var d=c?a.w:Math.round(a.w*a.fitRatio),e=c?a.h:Math.round(a.h*a.fitRatio);a.placeholder&&!a.loaded&&(a.placeholder.style.width=d+"px",a.placeholder.style.height=e+"px"),b.style.width=d+"px",b.style.height=e+"px"}},mc=function(){if(dc.length){for(var a,b=0;b<dc.length;b++)a=dc[b],a.holder.index===a.index&&ic(a.index,a.item,a.baseDiv,a.img,!1,a.clearPlaceholder);dc=[]}};ya("Controller",{publicMethods:{lazyLoadItem:function(a){a=za(a);var b=$b(a);b&&(!b.loaded&&!b.loading||x)&&(Ca("gettingData",a,b),b.src&&jc(b))},initController:function(){e.extend(i,ec,!0),f.items=Xb=c,$b=f.getItemAt,_b=i.getNumItemsFn,ac=i.loop,_b()<3&&(i.loop=!1),Ba("beforeChange",function(a){var b,c=i.preload,d=null===a?!0:a>=0,e=Math.min(c[0],_b()),g=Math.min(c[1],_b());for(b=1;(d?g:e)>=b;b++)f.lazyLoadItem(m+b);for(b=1;(d?e:g)>=b;b++)f.lazyLoadItem(m-b)}),Ba("initialLayout",function(){f.currItem.initialLayout=i.getThumbBoundsFn&&i.getThumbBoundsFn(m)}),Ba("mainScrollAnimComplete",mc),Ba("initialZoomInEnd",mc),Ba("destroy",function(){for(var a,b=0;b<Xb.length;b++)a=Xb[b],a.container&&(a.container=null),a.placeholder&&(a.placeholder=null),a.img&&(a.img=null),a.preloader&&(a.preloader=null),a.loadError&&(a.loaded=a.loadError=!1);dc=null})},getItemAt:function(a){return a>=0&&void 0!==Xb[a]?Xb[a]:!1},allowProgressiveImg:function(){return i.forceProgressiveLoading||!G||i.mouseUsed||screen.width>1200},setContent:function(a,b){i.loop&&(b=za(b));var c=f.getItemAt(a.index);c&&(c.container=null);var d,g=f.getItemAt(b);if(!g)return void(a.el.innerHTML="");Ca("gettingData",b,g),a.index=b,a.item=g;var h=g.container=e.createEl("pswp__zoom-wrap");if(!g.src&&g.html&&(g.html.tagName?h.appendChild(g.html):h.innerHTML=g.html),kc(g),hc(g,pa),!g.src||g.loadError||g.loaded)g.src&&!g.loadError&&(d=e.createEl("pswp__img","img"),d.style.opacity=1,d.src=g.src,lc(g,d),ic(b,g,h,d,!0));else{if(g.loadComplete=function(c){if(j){if(a&&a.index===b){if(kc(c,!0))return c.loadComplete=c.img=null,hc(c,pa),Ha(c),void(a.index===m&&f.updateCurrZoomItem());c.imageAppended?!Zb&&c.placeholder&&(c.placeholder.style.display="none",c.placeholder=null):N.transform&&(ea||Zb)?dc.push({item:c,baseDiv:h,img:c.img,index:b,holder:a,clearPlaceholder:!0}):ic(b,c,h,c.img,ea||Zb,!0)}c.loadComplete=null,c.img=null,Ca("imageLoadComplete",b,c)}},e.features.transform){var k="pswp__img pswp__img--placeholder";k+=g.msrc?"":" pswp__img--placeholder--blank";var l=e.createEl(k,g.msrc?"img":"");g.msrc&&(l.src=g.msrc),lc(g,l),h.appendChild(l),g.placeholder=l}g.loading||jc(g),f.allowProgressiveImg()&&(!Yb&&N.transform?dc.push({item:g,baseDiv:h,img:g.img,index:b,holder:a}):ic(b,g,h,g.img,!0,!0))}Yb||b!==m?Ha(g):(da=h.style,bc(g,d||g.img)),a.el.innerHTML="",a.el.appendChild(h)},cleanSlide:function(a){a.img&&(a.img.onload=a.img.onerror=null),a.loaded=a.loading=a.img=a.imageAppended=!1}}});var nc,oc={},pc=function(a,b,c){var d=document.createEvent("CustomEvent"),e={origEvent:a,target:a.target,releasePoint:b,pointerType:c||"touch"};d.initCustomEvent("pswpTap",!0,!0,e),a.target.dispatchEvent(d)};ya("Tap",{publicMethods:{initTap:function(){Ba("firstTouchStart",f.onTapStart),Ba("touchRelease",f.onTapRelease),Ba("destroy",function(){oc={},nc=null})},onTapStart:function(a){a.length>1&&(clearTimeout(nc),nc=null)},onTapRelease:function(a,b){if(b&&!X&&!V&&!$a){var c=b;if(nc&&(clearTimeout(nc),nc=null,wb(c,oc)))return void Ca("doubleTap",c);if("mouse"===b.type)return void pc(a,b,"mouse");var d=a.target.tagName.toUpperCase();if("BUTTON"===d||e.hasClass(a.target,"pswp__single-tap"))return void pc(a,b);La(oc,c),nc=setTimeout(function(){pc(a,b),nc=null},300)}}}});var qc;ya("DesktopZoom",{publicMethods:{initDesktopZoom:function(){L||(G?Ba("mouseUsed",function(){f.setupDesktopZoom()}):f.setupDesktopZoom(!0))},setupDesktopZoom:function(b){qc={};var c="wheel mousewheel DOMMouseScroll";Ba("bindEvents",function(){e.bind(a,c,f.handleMouseWheel)}),Ba("unbindEvents",function(){qc&&e.unbind(a,c,f.handleMouseWheel)}),f.mouseZoomedIn=!1;var d,g=function(){f.mouseZoomedIn&&(e.removeClass(a,"pswp--zoomed-in"),f.mouseZoomedIn=!1),1>s?e.addClass(a,"pswp--zoom-allowed"):e.removeClass(a,"pswp--zoom-allowed"),h()},h=function(){d&&(e.removeClass(a,"pswp--dragging"),d=!1)};Ba("resize",g),Ba("afterChange",g),Ba("pointerDown",function(){f.mouseZoomedIn&&(d=!0,e.addClass(a,"pswp--dragging"))}),Ba("pointerUp",h),b||g()}
16640,handleMouseWheel:function(a){if(s<=f.currItem.fitRatio)return i.modal&&(!i.closeOnScroll||$a||U?a.preventDefault():E&&Math.abs(a.deltaY)>2&&(l=!0,f.close())),!0;if(a.stopPropagation(),qc.x=0,"deltaX"in a)1===a.deltaMode?(qc.x=18*a.deltaX,qc.y=18*a.deltaY):(qc.x=a.deltaX,qc.y=a.deltaY);else if("wheelDelta"in a)a.wheelDeltaX&&(qc.x=-.16*a.wheelDeltaX),a.wheelDeltaY?qc.y=-.16*a.wheelDeltaY:qc.y=-.16*a.wheelDelta;else{if(!("detail"in a))return;qc.y=a.detail}Ra(s,!0);var b=oa.x-qc.x,c=oa.y-qc.y;(i.modal||b<=ca.min.x&&b>=ca.max.x&&c<=ca.min.y&&c>=ca.max.y)&&a.preventDefault(),f.panTo(b,c)},toggleDesktopZoom:function(b){b=b||{x:pa.x/2+ra.x,y:pa.y/2+ra.y};var c=i.getDoubleTapZoom(!0,f.currItem),d=s===c;f.mouseZoomedIn=!d,f.zoomTo(d?f.currItem.initialZoomLevel:c,b,333),e[(d?"remove":"add")+"Class"](a,"pswp--zoomed-in")}}});var rc,sc,tc,uc,vc,wc,xc,yc,zc,Ac,Bc,Cc,Dc={history:!0,galleryUID:1},Ec=function(){return Bc.hash.substring(1)},Fc=function(){rc&&clearTimeout(rc),tc&&clearTimeout(tc)},Gc=function(){var a=Ec(),b={};if(a.length<5)return b;var c,d=a.split("&");for(c=0;c<d.length;c++)if(d[c]){var e=d[c].split("=");e.length<2||(b[e[0]]=e[1])}if(i.galleryPIDs){var f=b.pid;for(b.pid=0,c=0;c<Xb.length;c++)if(Xb[c].pid===f){b.pid=c;break}}else b.pid=parseInt(b.pid,10)-1;return b.pid<0&&(b.pid=0),b},Hc=function(){if(tc&&clearTimeout(tc),$a||U)return void(tc=setTimeout(Hc,500));uc?clearTimeout(sc):uc=!0;var a=m+1,b=$b(m);b.hasOwnProperty("pid")&&(a=b.pid);var c=xc+"&gid="+i.galleryUID+"&pid="+a;yc||-1===Bc.hash.indexOf(c)&&(Ac=!0);var d=Bc.href.split("#")[0]+"#"+c;Cc?"#"+c!==window.location.hash&&history[yc?"replaceState":"pushState"]("",document.title,d):yc?Bc.replace(d):Bc.hash=c,yc=!0,sc=setTimeout(function(){uc=!1},60)};ya("History",{publicMethods:{initHistory:function(){if(e.extend(i,Dc,!0),i.history){Bc=window.location,Ac=!1,zc=!1,yc=!1,xc=Ec(),Cc="pushState"in history,xc.indexOf("gid=")>-1&&(xc=xc.split("&gid=")[0],xc=xc.split("?gid=")[0]),Ba("afterChange",f.updateURL),Ba("unbindEvents",function(){e.unbind(window,"hashchange",f.onHashChange)});var a=function(){wc=!0,zc||(Ac?history.back():xc?Bc.hash=xc:Cc?history.pushState("",document.title,Bc.pathname+Bc.search):Bc.hash=""),Fc()};Ba("unbindEvents",function(){l&&a()}),Ba("destroy",function(){wc||a()}),Ba("firstUpdate",function(){m=Gc().pid});var b=xc.indexOf("pid=");b>-1&&(xc=xc.substring(0,b),"&"===xc.slice(-1)&&(xc=xc.slice(0,-1))),setTimeout(function(){j&&e.bind(window,"hashchange",f.onHashChange)},40)}},onHashChange:function(){return Ec()===xc?(zc=!0,void f.close()):void(uc||(vc=!0,f.goTo(Gc().pid),vc=!1))},updateURL:function(){Fc(),vc||(yc?rc=setTimeout(Hc,800):Hc())}}}),e.extend(f,db)};return a});
16641/*! PhotoSwipe Default UI - 4.1.1 - 2015-12-24
16642* http://photoswipe.com
16643* Copyright (c) 2015 Dmitry Semenov; */
16644!function(a,b){"function"==typeof define&&define.amd?define(b):"object"==typeof exports?module.exports=b():a.PhotoSwipeUI_Default=b()}(this,function(){"use strict";var a=function(a,b){var c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v=this,w=!1,x=!0,y=!0,z={barsSize:{top:44,bottom:"auto"},closeElClasses:["item","caption","zoom-wrap","ui","top-bar"],timeToIdle:4e3,timeToIdleOutside:1e3,loadingIndicatorDelay:1e3,addCaptionHTMLFn:function(a,b){return a.title?(b.children[0].innerHTML=a.title,!0):(b.children[0].innerHTML="",!1)},closeEl:!0,captionEl:!0,fullscreenEl:!0,zoomEl:!0,shareEl:!0,counterEl:!0,arrowEl:!0,preloaderEl:!0,tapToClose:!1,tapToToggleControls:!0,clickToCloseNonZoomable:!0,shareButtons:[{id:"facebook",label:"Share on Facebook",url:"https://www.facebook.com/sharer/sharer.php?u={{url}}"},{id:"twitter",label:"Tweet",url:"https://twitter.com/intent/tweet?text={{text}}&url={{url}}"},{id:"pinterest",label:"Pin it",url:"http://www.pinterest.com/pin/create/button/?url={{url}}&media={{image_url}}&description={{text}}"},{id:"download",label:"Download image",url:"{{raw_image_url}}",download:!0}],getImageURLForShare:function(){return a.currItem.src||""},getPageURLForShare:function(){return window.location.href},getTextForShare:function(){return a.currItem.title||""},indexIndicatorSep:" / ",fitControlsWidth:1200}
16644,A=function(a){if(r)return!0;a=a||window.event,q.timeToIdle&&q.mouseUsed&&!k&&K();for(var c,d,e=a.target||a.srcElement,f=e.getAttribute("class")||"",g=0;g<S.length;g++)c=S[g],c.onTap&&f.indexOf("pswp__"+c.name)>-1&&(c.onTap(),d=!0);if(d){a.stopPropagation&&a.stopPropagation(),r=!0;var h=b.features.isOldAndroid?600:30;s=setTimeout(function(){r=!1},h)}},B=function(){return!a.likelyTouchDevice||q.mouseUsed||screen.width>q.fitControlsWidth},C=function(a,c,d){b[(d?"add":"remove")+"Class"](a,"pswp__"+c)},D=function(){var a=1===q.getNumItemsFn();a!==p&&(C(d,"ui--one-slide",a),p=a)},E=function(){C(i,"share-modal--hidden",y)},F=function(){return y=!y,y?(b.removeClass(i,"pswp__share-modal--fade-in"),setTimeout(function(){y&&E()},300)):(E(),setTimeout(function(){y||b.addClass(i,"pswp__share-modal--fade-in")},30)),y||H(),!1},G=function(b){b=b||window.event;var c=b.target||b.srcElement;return a.shout("shareLinkClick",b,c),c.href?c.hasAttribute("download")?!0:(window.open(c.href,"pswp_share","scrollbars=yes,resizable=yes,toolbar=no,location=yes,width=550,height=420,top=100,left="+(window.screen?Math.round(screen.width/2-275):100)),y||F(),!1):!1},H=function(){for(var a,b,c,d,e,f="",g=0;g<q.shareButtons.length;g++)a=q.shareButtons[g],c=q.getImageURLForShare(a),d=q.getPageURLForShare(a),e=q.getTextForShare(a),b=a.url.replace("{{url}}",encodeURIComponent(d)).replace("{{image_url}}",encodeURIComponent(c)).replace("{{raw_image_url}}",c).replace("{{text}}",encodeURIComponent(e)),f+='<a href="'+b+'" target="_blank" class="pswp__share--'+a.id+'"'+(a.download?"download":"")+">"+a.label+"</a>",q.parseShareButtonOut&&(f=q.parseShareButtonOut(a,f));i.children[0].innerHTML=f,i.children[0].onclick=G},I=function(a){for(var c=0;c<q.closeElClasses.length;c++)if(b.hasClass(a,"pswp__"+q.closeElClasses[c]))return!0},J=0,K=function(){clearTimeout(u),J=0,k&&v.setIdle(!1)},L=function(a){a=a?a:window.event;var b=a.relatedTarget||a.toElement;b&&"HTML"!==b.nodeName||(clearTimeout(u),u=setTimeout(function(){v.setIdle(!0)},q.timeToIdleOutside))},M=function(){q.fullscreenEl&&!b.features.isOldAndroid&&(c||(c=v.getFullscreenAPI()),c?(b.bind(document,c.eventK,v.updateFullscreen),v.updateFullscreen(),b.addClass(a.template,"pswp--supports-fs")):b.removeClass(a.template,"pswp--supports-fs"))},N=function(){q.preloaderEl&&(O(!0),l("beforeChange",function(){clearTimeout(o),o=setTimeout(function(){a.currItem&&a.currItem.loading?(!a.allowProgressiveImg()||a.currItem.img&&!a.currItem.img.naturalWidth)&&O(!1):O(!0)},q.loadingIndicatorDelay)}),l("imageLoadComplete",function(b,c){a.currItem===c&&O(!0)}))},O=function(a){n!==a&&(C(m,"preloader--active",!a),n=a)},P=function(a){var c=a.vGap;if(B()){var g=q.barsSize;if(q.captionEl&&"auto"===g.bottom)if(f||(f=b.createEl("pswp__caption pswp__caption--fake"),f.appendChild(b.createEl("pswp__caption__center")),d.insertBefore(f,e),b.addClass(d,"pswp__ui--fit")),q.addCaptionHTMLFn(a,f,!0)){var h=f.clientHeight;c.bottom=parseInt(h,10)||44}else c.bottom=g.top;else c.bottom="auto"===g.bottom?0:g.bottom;c.top=g.top}else c.top=c.bottom=0},Q=function(){q.timeToIdle&&l("mouseUsed",function(){b.bind(document,"mousemove",K),b.bind(document,"mouseout",L),t=setInterval(function(){J++,2===J&&v.setIdle(!0)},q.timeToIdle/2)})},R=function(){l("onVerticalDrag",function(a){x&&.95>a?v.hideControls():!x&&a>=.95&&v.showControls()});var a;l("onPinchClose",function(b){x&&.9>b?(v.hideControls(),a=!0):a&&!x&&b>.9&&v.showControls()}),l("zoomGestureEnded",function(){a=!1,a&&!x&&v.showControls()})},S=[{name:"caption",option:"captionEl",onInit:function(a){e=a}},{name:"share-modal",option:"shareEl",onInit:function(a){i=a},onTap:function(){F()}},{name:"button--share",option:"shareEl",onInit:function(a){h=a},onTap:function(){F()}},{name:"button--zoom",option:"zoomEl",onTap:a.toggleDesktopZoom},{name:"counter",option:"counterEl",onInit:function(a){g=a}},{name:"button--close",option:"closeEl",onTap:a.close},{name:"button--arrow--left",option:"arrowEl",onTap:a.prev},{name:"button--arrow--right",option:"arrowEl",onTap:a.next},{name:"button--fs",option:"fullscreenEl",onTap:function(){c.isFullscreen()?c.exit():c.enter()}},{name:"preloader",option:"preloaderEl",onInit:function(a){m=a}}],T=function(){var a,c,e,f=function(d){if(d)for(var f=d.length,g=0;f>g;g++){a=d[g],c=a.className;for(var h=0;h<S.length;h++)e=S[h],c.indexOf("pswp__"+e.name)>-1&&(q[e.option]?(b.removeClass(a,"pswp__element--disabled"),e.onInit&&e.onInit(
16644a)):b.addClass(a,"pswp__element--disabled"))}};f(d.children);var g=b.getChildByClass(d,"pswp__top-bar");g&&f(g.children)};v.init=function(){b.extend(a.options,z,!0),q=a.options,d=b.getChildByClass(a.scrollWrap,"pswp__ui"),l=a.listen,R(),l("beforeChange",v.update),l("doubleTap",function(b){var c=a.currItem.initialZoomLevel;a.getZoomLevel()!==c?a.zoomTo(c,b,333):a.zoomTo(q.getDoubleTapZoom(!1,a.currItem),b,333)}),l("preventDragEvent",function(a,b,c){var d=a.target||a.srcElement;d&&d.getAttribute("class")&&a.type.indexOf("mouse")>-1&&(d.getAttribute("class").indexOf("__caption")>0||/(SMALL|STRONG|EM)/i.test(d.tagName))&&(c.prevent=!1)}),l("bindEvents",function(){b.bind(d,"pswpTap click",A),b.bind(a.scrollWrap,"pswpTap",v.onGlobalTap),a.likelyTouchDevice||b.bind(a.scrollWrap,"mouseover",v.onMouseOver)}),l("unbindEvents",function(){y||F(),t&&clearInterval(t),b.unbind(document,"mouseout",L),b.unbind(document,"mousemove",K),b.unbind(d,"pswpTap click",A),b.unbind(a.scrollWrap,"pswpTap",v.onGlobalTap),b.unbind(a.scrollWrap,"mouseover",v.onMouseOver),c&&(b.unbind(document,c.eventK,v.updateFullscreen),c.isFullscreen()&&(q.hideAnimationDuration=0,c.exit()),c=null)}),l("destroy",function(){q.captionEl&&(f&&d.removeChild(f),b.removeClass(e,"pswp__caption--empty")),i&&(i.children[0].onclick=null),b.removeClass(d,"pswp__ui--over-close"),b.addClass(d,"pswp__ui--hidden"),v.setIdle(!1)}),q.showAnimationDuration||b.removeClass(d,"pswp__ui--hidden"),l("initialZoomIn",function(){q.showAnimationDuration&&b.removeClass(d,"pswp__ui--hidden")}),l("initialZoomOut",function(){b.addClass(d,"pswp__ui--hidden")}),l("parseVerticalMargin",P),T(),q.shareEl&&h&&i&&(y=!0),D(),Q(),M(),N()},v.setIdle=function(a){k=a,C(d,"ui--idle",a)},v.update=function(){x&&a.currItem?(v.updateIndexIndicator(),q.captionEl&&(q.addCaptionHTMLFn(a.currItem,e),C(e,"caption--empty",!a.currItem.title)),w=!0):w=!1,y||F(),D()},v.updateFullscreen=function(d){d&&setTimeout(function(){a.setScrollOffset(0,b.getScrollY())},50),b[(c.isFullscreen()?"add":"remove")+"Class"](a.template,"pswp--fs")},v.updateIndexIndicator=function(){q.counterEl&&(g.innerHTML=a.getCurrentIndex()+1+q.indexIndicatorSep+q.getNumItemsFn())},v.onGlobalTap=function(c){c=c||window.event;var d=c.target||c.srcElement;if(!r)if(c.detail&&"mouse"===c.detail.pointerType){if(I(d))return void a.close();b.hasClass(d,"pswp__img")&&(1===a.getZoomLevel()&&a.getZoomLevel()<=a.currItem.fitRatio?q.clickToCloseNonZoomable&&a.close():a.toggleDesktopZoom(c.detail.releasePoint))}else if(q.tapToToggleControls&&(x?v.hideControls():v.showControls()),q.tapToClose&&(b.hasClass(d,"pswp__img")||I(d)))return void a.close()},v.onMouseOver=function(a){a=a||window.event;var b=a.target||a.srcElement;C(d,"ui--over-close",I(b))},v.hideControls=function(){b.addClass(d,"pswp__ui--hidden"),x=!1},v.showControls=function(){x=!0,w||v.update(),b.removeClass(d,"pswp__ui--hidden")},v.supportsFullscreen=function(){var a=document;return!!(a.exitFullscreen||a.mozCancelFullScreen||a.webkitExitFullscreen||a.msExitFullscreen)},v.getFullscreenAPI=function(){var b,c=document.documentElement,d="fullscreenchange";return c.requestFullscreen?b={enterK:"requestFullscreen",exitK:"exitFullscreen",elementK:"fullscreenElement",eventK:d}:c.mozRequestFullScreen?b={enterK:"mozRequestFullScreen",exitK:"mozCancelFullScreen",elementK:"mozFullScreenElement",eventK:"moz"+d}:c.webkitRequestFullscreen?b={enterK:"webkitRequestFullscreen",exitK:"webkitExitFullscreen",elementK:"webkitFullscreenElement",eventK:"webkit"+d}:c.msRequestFullscreen&&(b={enterK:"msRequestFullscreen",exitK:"msExitFullscreen",elementK:"msFullscreenElement",eventK:"MSFullscreenChange"}),b&&(b.enter=function(){return j=q.closeOnScroll,q.closeOnScroll=!1,"webkitRequestFullscreen"!==this.enterK?a.template[this.enterK]():void a.template[this.enterK](Element.ALLOW_KEYBOARD_INPUT)},b.exit=function(){return q.closeOnScroll=j,document[this.exitK]()},b.isFullscreen=function(){return document[this.elementK]}),b}};return a});
16645/*! Hammer.JS - v2.0.6 - 2015-12-23
16646 * http://hammerjs.github.io/
16647 *
16648 * Copyright (c) 2015 Jorik Tangelder;
16649 * Licensed under the  license */
16650!function(a,b,c,d){"use strict";
vendor: 20,144 bytes, lines 16650-16660
16650function e(a,b,c){return setTimeout(j(a,c),b)}function f(a,b,c){return Array.isArray(a)?(g(a,c[b],c),!0):!1}function g(a,b,c){var e;if(a)if(a.forEach)a.forEach(b,c);else if(a.length!==d)for(e=0;e<a.length;)b.call(c,a[e],e,a),e++;else for(e in a)a.hasOwnProperty(e)&&b.call(c,a[e],e,a)}function h(b,c,d){var e="DEPRECATED METHOD: "+c+"\n"+d+" AT \n";return function(){var c=new Error("get-stack-trace"),d=c&&c.stack?c.stack.replace(/^[^\(]+?[\n$]/gm,"").replace(/^\s+at\s+/gm,"").replace(/^Object.<anonymous>\s*\(/gm,"{anonymous}()@"):"Unknown Stack Trace",f=a.console&&(a.console.warn||a.console.log);return f&&f.call(a.console,e,d),b.apply(this,arguments)}}function i(a,b,c){var d,e=b.prototype;d=a.prototype=Object.create(e),d.constructor=a,d._super=e,c&&hb(d,c)}function j(a,b){return function(){return a.apply(b,arguments)}}function k(a,b){return typeof a==kb?a.apply(b?b[0]||d:d,b):a}function l(a,b){return a===d?b:a}function m(a,b,c){g(q(b),function(b){a.addEventListener(b,c,!1)})}function n(a,b,c){g(q(b),function(b){a.removeEventListener(b,c,!1)})}function o(a,b){for(;a;){if(a==b)return!0;a=a.parentNode}return!1}function p(a,b){return a.indexOf(b)>-1}function q(a){return a.trim().split(/\s+/g)}function r(a,b,c){if(a.indexOf&&!c)return a.indexOf(b);for(var d=0;d<a.length;){if(c&&a[d][c]==b||!c&&a[d]===b)return d;d++}return-1}function s(a){return Array.prototype.slice.call(a,0)}function t(a,b,c){for(var d=[],e=[],f=0;f<a.length;){var g=b?a[f][b]:a[f];r(e,g)<0&&d.push(a[f]),e[f]=g,f++}return c&&(d=b?d.sort(function(a,c){return a[b]>c[b]}):d.sort()),d}function u(a,b){for(var c,e,f=b[0].toUpperCase()+b.slice(1),g=0;g<ib.length;){if(c=ib[g],e=c?c+f:b,e in a)return e;g++}return d}function v(){return qb++}function w(b){var c=b.ownerDocument||b;return c.defaultView||c.parentWindow||a}function x(a,b){var c=this;this.manager=a,this.callback=b,this.element=a.element,this.target=a.options.inputTarget,this.domHandler=function(b){k(a.options.enable,[a])&&c.handler(b)},this.init()}function y(a){var b,c=a.options.inputClass;return new(b=c?c:tb?M:ub?P:sb?R:L)(a,z)}function z(a,b,c){var d=c.pointers.length,e=c.changedPointers.length,f=b&Ab&&d-e===0,g=b&(Cb|Db)&&d-e===0;c.isFirst=!!f,c.isFinal=!!g,f&&(a.session={}),c.eventType=b,A(a,c),a.emit("hammer.input",c),a.recognize(c),a.session.prevInput=c}function A(a,b){var c=a.session,d=b.pointers,e=d.length;c.firstInput||(c.firstInput=D(b)),e>1&&!c.firstMultiple?c.firstMultiple=D(b):1===e&&(c.firstMultiple=!1);var f=c.firstInput,g=c.firstMultiple,h=g?g.center:f.center,i=b.center=E(d);b.timeStamp=nb(),b.deltaTime=b.timeStamp-f.timeStamp,b.angle=I(h,i),b.distance=H(h,i),B(c,b),b.offsetDirection=G(b.deltaX,b.deltaY);var j=F(b.deltaTime,b.deltaX,b.deltaY);b.overallVelocityX=j.x,b.overallVelocityY=j.y,b.overallVelocity=mb(j.x)>mb(j.y)?j.x:j.y,b.scale=g?K(g.pointers,d):1,b.rotation=g?J(g.pointers,d):0,b.maxPointers=c.prevInput?b.pointers.length>c.prevInput.maxPointers?b.pointers.length:c.prevInput.maxPointers:b.pointers.length,C(c,b);var k=a.element;o(b.srcEvent.target,k)&&(k=b.srcEvent.target),b.target=k}function B(a,b){var c=b.center,d=a.offsetDelta||{},e=a.prevDelta||{},f=a.prevInput||{};(b.eventType===Ab||f.eventType===Cb)&&(e=a.prevDelta={x:f.deltaX||0,y:f.deltaY||0},d=a.offsetDelta={x:c.x,y:c.y}),b.deltaX=e.x+(c.x-d.x),b.deltaY=e.y+(c.y-d.y)}function C(a,b){var c,e,f,g,h=a.lastInterval||b,i=b.timeStamp-h.timeStamp;if(b.eventType!=Db&&(i>zb||h.velocity===d)){var j=b.deltaX-h.deltaX,k=b.deltaY-h.deltaY,l=F(i,j,k);e=l.x,f=l.y,c=mb(l.x)>mb(l.y)?l.x:l.y,g=G(j,k),a.lastInterval=b}else c=h.velocity,e=h.velocityX,f=h.velocityY,g=h.direction;b.velocity=c,b.velocityX=e,b.velocityY=f,b.direction=g}function D(a){for(var b=[],c=0;c<a.pointers.length;)b[c]={clientX:lb(a.pointers[c].clientX),clientY:lb(a.pointers[c].clientY)},c++;return{timeStamp:nb(),pointers:b,center:E(b),deltaX:a.deltaX,deltaY:a.deltaY}}function E(a){var b=a.length;if(1===b)return{x:lb(a[0].clientX),y:lb(a[0].clientY)};for(var c=0,d=0,e=0;b>e;)c+=a[e].clientX,d+=a[e].clientY,e++;return{x:lb(c/b),y:lb(d/b)}}function F(a,b,c){return{x:b/a||0,y:c/a||0}}function G(a,b){return a===b?Eb:mb(a)>=mb(b)?0>a?Fb:Gb:0>b?Hb:Ib}function H(a,b,c){c||(c=Mb);var d=b[c[0]]-a[c[0]],e=b[c[1]]-a[c[1]];return Math.sqrt(d*d+e*e)}function I(a,b,c){c||(c=Mb);var d=b[c[0]]-a[c[0]],e=b[c[1]]-a[c[1]];return 180*Math.atan2(e,d)/Math.PI}function J(a,b){return I(b[1],b[0],Nb)+I(a[1],a[0],Nb)}function K(a,b){return H(b[0],b[1],Nb)/H(a[0],a[1],Nb)}function L(){this.evEl=Pb,this.evWin=Qb,this.allow=!0,this.pressed=!1,x.apply(this,arguments)}function M(){this.evEl=Tb,this.evWin=Ub,x.apply(this,arguments),this.store=this.manager.session.pointerEvents=[]}function N(){this.evTarget=Wb,this.evWin=Xb,this.started=!1,x.apply(this,arguments)}function O(a,b){var c=s(a.touches),d=s(a.changedTouches);return b&(Cb|Db)&&(c=t(c.concat(d),"identifier",!0)),[c,d]}function P(){this.evTarget=Zb,this.targetIds={},x.apply(this,arguments)}function Q(a,b){var c=s(a.touches),d=this.targetIds;if(b&(Ab|Bb)&&1===c.length)return d[c[0].identifier]=!0,[c,c];var e,f,g=s(a.changedTouches),h=[],i=this.target;if(f=c.filter(function(a){return o(a.target,i)}),b===Ab)for(e=0;e<f.length;)d[f[e].identifier]=!0,e++;for(e=0;e<g.length;)d[g[e].identifier]&&h.push(g[e]),b&(Cb|Db)&&delete d[g[e].identifier],e++;return h.length?[t(f.concat(h),"identifier",!0),h]:void 0}function R(){x.apply(this,arguments);var a=j(this.handler,this);this.touch=new P(this.manager,a),this.mouse=new L(this.manager,a)}function S(a,b){this.manager=a,this.set(b)}function T(a){if(p(a,dc))return dc;var b=p(a,ec),c=p(a,fc);return b&&c?dc:b||c?b?ec:fc:p(a,cc)?cc:bc}function U(a){this.options=hb({},this.defaults,a||{}),this.id=v(),this.manager=null,this.options.enable=l(this.options.enable,!0),this.state=gc,this.simultaneous={},this.requireFail=[]}function V(a){return a&lc?"cancel":a&jc?"end":a&ic?"move":a&hc?"start":""}function W(a){return a==Ib?"down":a==Hb?"up":a==Fb?"left":a==Gb?"right":""}function X(a,b){var c=b.manager;return c?c.get(a):a}function Y(){U.apply(this,arguments)}function Z(){Y.apply(this,arguments),this.pX=null,this.pY=null}function $(){Y.apply(this,arguments)}function _(){U.apply(this,arguments),this._timer=null,this._input=null}function ab(){Y.apply(this,arguments)}function bb(){Y.apply(this,arguments)}function cb(){U.apply(this,arguments),this.pTime=!1,this.pCenter=!1,this._timer=null,this._input=null,this.count=0}function db(a,b){return b=b||{},b.recognizers=l(b.recognizers,db.defaults.preset),new eb(a,b)}function eb(a,b){this.options=hb({},db.defaults,b||{}),this.options.inputTarget=this.options.inputTarget||a,this.handlers={},this.session={},this.recognizers=[],this.element=a,this.input=y(this),this.touchAction=new S(this,this.options.touchAction),fb(this,!0),g(this.options.recognizers,function(a){var b=this.add(new a[0](a[1]));a[2]&&b.recognizeWith(a[2]),a[3]&&b.requireFailure(a[3])},this)}function fb(a,b){var c=a.element;c.style&&g(a.options.cssProps,function(a,d){c.style[u(c.style,d)]=b?a:""})}function gb(a,c){var d=b.createEvent("Event");d.initEvent(a,!0,!0),d.gesture=c,c.target.dispatchEvent(d)}var hb,ib=["","webkit","Moz","MS","ms","o"],jb=b.createElement("div"),kb="function",lb=Math.round,mb=Math.abs,nb=Date.now;hb="function"!=typeof Object.assign?function(a){if(a===d||null===a)throw new TypeError("Cannot convert undefined or null to object");for(var b=Object(a),c=1;c<arguments.length;c++){var e=arguments[c];if(e!==d&&null!==e)for(var f in e)e.hasOwnProperty(f)&&(b[f]=e[f])}return b}:Object.assign;var ob=h(function(a,b,c){for(var e=Object.keys(b),f=0;f<e.length;)(!c||c&&a[e[f]]===d)&&(a[e[f]]=b[e[f]]),f++;return a},"extend","Use `assign`."),pb=h(function(a,b){return ob(a,b,!0)},"merge","Use `assign`."),qb=1,rb=/mobile|tablet|ip(ad|hone|od)|android/i,sb="ontouchstart"in a,tb=u(a,"PointerEvent")!==d,ub=sb&&rb.test(navigator.userAgent),vb="touch",wb="pen",xb="mouse",yb="kinect",zb=25,Ab=1,Bb=2,Cb=4,Db=8,Eb=1,Fb=2,Gb=4,Hb=8,Ib=16,Jb=Fb|Gb,Kb=Hb|Ib,Lb=Jb|Kb,Mb=["x","y"],Nb=["clientX","clientY"];x.prototype={handler:function(){},init:function(){this.evEl&&m(this.element,this.evEl,this.domHandler),this.evTarget&&m(this.target,this.evTarget,this.domHandler),this.evWin&&m(w(this.element),this.evWin,this.domHandler)},destroy:function(){this.evEl&&n(this.element,this.evEl,this.domHandler),this.evTarget&&n(this.target,this.evTarget,this.domHandler),this.evWin&&n(w(this.element),this.evWin,this.domHandler)}};var Ob={mousedown:Ab,mousemove:Bb,mouseup:Cb},Pb="mousedown",Qb="mousemove mouseup";i(L,x,{handler:function(a){var b=Ob[a.type];b&Ab&&0===a.button&&(this.pressed=!0),b&Bb&&1!==a.which&&(b=Cb),this.pressed&&this.allow&&(b&Cb&&(this.pressed=!1),this.callback(this.manager,b,{pointers:[a],changedPointers:[a],pointerType:xb,srcEvent:a}))}});var Rb={pointerdown:Ab,pointermove:Bb,pointerup:Cb,pointercancel:Db,pointerout:Db},Sb={2:vb,3:wb,4:xb,5:yb},Tb="pointerdown",Ub="pointermove pointerup pointercancel";a.MSPointerEvent&&!a.PointerEvent&&(Tb="MSPointerDown",Ub="MSPointerMove MSPointerUp MSPointerCancel"),i(M,x,{handler:function(a){var b=this.store,c=!1,d=a.type.toLowerCase().replace("ms",""),e=Rb[d],f=Sb[a.pointerType]||a.pointerType,g=f==vb,h=r(b,a.pointerId,"pointerId");e&Ab&&(0===a.button||g)?0>h&&(b.push(a),h=b.length-1):e&(Cb|Db)&&(c=!0),0>h||(b[h]=a,this.callback(this.manager,e,{pointers:b,changedPointers:[a],pointerType:f,srcEvent:a}),c&&b.splice(h,1))}});var Vb={touchstart:Ab,touchmove:Bb,touchend:Cb,touchcancel:Db},Wb="touchstart",Xb="touchstart touchmove touchend touchcancel";i(N,x,{handler:function(a){var b=Vb[a.type];if(b===Ab&&(this.started=!0),this.started){var c=O.call(this,a,b);b&(Cb|Db)&&c[0].length-c[1].length===0&&(this.started=!1),this.callback(this.manager,b,{pointers:c[0],changedPointers:c[1],pointerType:vb,srcEvent:a})}}});var Yb={touchstart:Ab,touchmove:Bb,touchend:Cb,touchcancel:Db},Zb="touchstart touchmove touchend touchcancel";i(P,x,{handler:function(a){var b=Yb[a.type],c=Q.call(this,a,b);c&&this.callback(this.manager,b,{pointers:c[0],changedPointers:c[1],pointerType:vb,srcEvent:a})}}),i(R,x,{handler:function(a,b,c){var d=c.pointerType==vb,e=c.pointerType==xb;if(d)this.mouse.allow=!1;else if(e&&!this.mouse.allow)return;b&(Cb|Db)&&(this.mouse.allow=!0),this.callback(a,b,c)},destroy:function(){this.touch.destroy(),this.mouse.destroy()}});var $b=u(jb.style,"touchAction"),_b=$b!==d,ac="compute",bc="auto",cc="manipulation",dc="none",ec="pan-x",fc="pan-y";S.prototype={set:function(a){a==ac&&(a=this.compute()),_b&&this.manager.element.style&&(this.manager.element.style[$b]=a),this.actions=a.toLowerCase().trim()},update:function(){this.set(this.manager.options.touchAction)},compute:function(){var a=[];return g(this.manager.recognizers,function(b){k(b.options.enable,[b])&&(a=a.concat(b.getTouchAction()))}),T(a.join(" "))},preventDefaults:function(a){if(!_b){var b=a.srcEvent,c=a.offsetDirection;if(this.manager.session.prevented)return void b.preventDefault();var d=this.actions,e=p(d,dc),f=p(d,fc),g=p(d,ec);if(e){var h=1===a.pointers.length,i=a.distance<2,j=a.deltaTime<250;if(h&&i&&j)return}if(!g||!f)return e||f&&c&Jb||g&&c&Kb?this.preventSrc(b):void 0}},preventSrc:function(a){this.manager.session.prevented=!0,a.preventDefault()}};var gc=1,hc=2,ic=4,jc=8,kc=jc,lc=16,mc=32;U.prototype={defaults:{},set:function(a){return hb(this.options,a),this.manager&&this.manager.touchAction.update(),this},recognizeWith:function(a){if(f(a,"recognizeWith",this))return this;var b=this.simultaneous;return a=X(a,this),b[a.id]||(b[a.id]=a,a.recognizeWith(this)),this},dropRecognizeWith:function(a){return f(a,"dropRecognizeWith",this)?this:(a=X(a,this),delete this.simultaneous[a.id],this)},requireFailure:function(a){if(f(a,"requireFailure",this))return this;var b=this.requireFail;return a=X(a,this),-1===r(b,a)&&(b.push(a),a.requireFailure(this)),this},dropRequireFailure:function(a){if(f(a,"dropRequireFailure",this))return this;a=X(a,this);var b=r(this.requireFail,a);return b>-1&&this.requireFail.splice(b,1),this},hasRequireFailures:function(){return this.requireFail.length>0},canRecognizeWith:function(a){return!!this.simultaneous[a.id]},emit:function(a){function b(b){c.manager.emit(b,a)}var c=this,d=this.state;jc>d&&b(c.options.event+V(d)),b(c.options.event),a.additionalEvent&&b(a.additionalEvent),d>=jc&&b(c.options.event+V(d))},tryEmit:function(a){return this.canEmit()?this.emit(a):void(this.state=mc)},canEmit:function(){for(var a=0;a<this.requireFail.length;){if(!(this.requireFail[a].state&(mc|gc)))return!1;a++}return!0},recognize:function(a){var b=hb({},a);return k(this.options.enable,[this,b])?(this.state&(kc|lc|mc)&&(this.state=gc),this.state=this.process(b),void(this.state&(hc|ic|jc|lc)&&this.tryEmit(b))):(this.reset(),void(this.state=mc))},process:function(){},getTouchAction:function(){},reset:function(){}},i(Y,U,{defaults:{pointers:1},attrTest:function(a){var b=this.options.pointers;return 0===b||a.pointers.length===b},process:function(a){var b=this.state,c=a.eventType,d=b&(hc|ic),e=this.attrTest(a);return d&&(c&Db||!e)?b|lc:d||e?c&Cb?b|jc:b&hc?b|ic:hc:mc}}),i(Z,Y,{defaults:{event:"pan",threshold:10,pointers:1,direction:Lb},getTouchAction:function(){var a=this.options.direction,b=[];return a&Jb&&b.push(fc),a&Kb&&b.push(ec),b},directionTest:function(a){var b=this.options,c=!0,d=a.distance,e=a.direction,f=a.deltaX,g=a.deltaY;return e&b.direction||(b.direction&Jb?(e=0===f?Eb:0>f?Fb:Gb,c=f!=this.pX,d=Math.abs(a.deltaX)):(e=0===g?Eb:0>g?Hb:Ib,c=g!=this.pY,d=Math.abs(a.deltaY))),a.direction=e,c&&d>b.threshold&&e&b.direction},attrTest:function(a){return Y.prototype.attrTest.call(this,a)&&(this.state&hc||!(this.state&hc)&&this.directionTest(a))},emit:function(a){this.pX=a.deltaX,this.pY=a.deltaY;var b=W(a.direction);b&&(a.additionalEvent=this.options.event+b),this._super.emit.call(this,a)}}),i($,Y,{defaults:{event:"pinch",threshold:0,pointers:2},getTouchAction:function(){return[dc]},attrTest:function(a){return this._super.attrTest.call(this,a)&&(Math.abs(a.scale-1)>this.options.threshold||this.state&hc)},emit:function(a){if(1!==a.scale){var b=a.scale<1?"in":"out";a.additionalEvent=this.options.event+b}this._super.emit.call(this,a)}}),i(_,U,{defaults:{event:"press",pointers:1,time:251,threshold:9},getTouchAction:function(){return[bc]},process:function(a){var b=this.options,c=a.pointers.length===b.pointers,d=a.distance<b.threshold,f=a.deltaTime>b.time;if(this._input=a,!d||!c||a.eventType&(Cb|Db)&&!f)this.reset();else if(a.eventType&Ab)this.reset(),this._timer=e(function(){this.state=kc,this.tryEmit()},b.time,this);else if(a.eventType&Cb)return kc;return mc},reset:function(){clearTimeout(this._timer)},emit:function(a){this.state===kc&&(a&&a.eventType&Cb?this.manager.emit(this.options.event+"up",a):(this._input.timeStamp=nb(),this.manager.emit(this.options.event,this._input)))}}),i(ab,Y,{defaults:{event:"rotate",threshold:0,pointers:2},getTouchAction:function(){return[dc]},attrTest:function(a){return this._super.attrTest.call(this,a)&&(Math.abs(a.rotation)>this.options.threshold||this.state&hc)}}),i(bb,Y,{defaults:{event:"swipe",threshold:10,velocity:.3,direction:Jb|Kb,pointers:1},getTouchAction:function(){return Z.prototype.getTouchAction.call(this)},attrTest:function(a){var b,c=this.options.direction;return c&(Jb|Kb)?b=a.overallVelocity:c&Jb?b=a.overallVelocityX:c&Kb&&(b=a.overallVelocityY),this._super.attrTest.call(this,a)&&c&a.offsetDirection&&a.distance>this.options.threshold&&a.maxPointers==this.options.pointers&&mb(b)>this.options.velocity&&a.eventType&Cb},emit:function(a){var b=W(a.offsetDirection);b&&this.manager.emit(this.options.event+b,a),this.manager.emit(this.options.event,a)}}),i(cb,U,{defaults:{event:"tap",pointers:1,taps:1,interval:300,time:250,threshold:9,posThreshold:10},getTouchAction:function(){return[cc]},process:function(a){var b=this.options,c=a.pointers.length===b.pointers,d=a.distance<b.threshold,f=a.deltaTime<b.time;if(this.reset(),a.eventType&Ab&&0===this.count)return this.failTimeout();if(d&&f&&c){if(a.eventType!=Cb)return this.failTimeout();var g=this.pTime?a.timeStamp-this.pTime<b.interval:!0,h=!this.pCenter||H(this.pCenter,a.center)<b.posThreshold;this.pTime=a.timeStamp,this.pCenter=a.center,h&&g?this.count+=1:this.count=1,this._input=a;var i=this.count%b.taps;if(0===i)return this.hasRequireFailures()?(this._timer=e(function(){this.state=kc,this.tryEmit()},b.interval,this),hc):kc}return mc},failTimeout:function(){return this._timer=e(function(){this.state=mc},this.options.interval,this),mc},reset:function(){clearTimeout(this._timer)},emit:function(){this.state==kc&&(this._input.tapCount=this.count,this.manager.emit(this.options.event,this._input))}}),db.VERSION="2.0.6",db.defaults={domEvents:!1,touchAction:ac,enable:!0,inputTarget:null,inputClass:null,preset:[[ab,{enable:!1}],[$,{enable:!1},["rotate"]],[bb,{direction:Jb}],[Z,{direction:Jb},["swipe"]],[cb],[cb,{event:"doubletap",taps:2},["tap"]],[_]],cssProps:{userSelect:"none",touchSelect:"none",touchCallout:"none",contentZooming:"none",userDrag:"none",tapHighlightColor:"rgba(0,0,0,0)"}};var nc=1,oc=2;eb.prototype={set:function(a){return hb(this.options,a),a.touchAction&&this.touchAction.update(),a.inputTarget&&(this.input.destroy(),this.input.target=a.inputTarget,this.input.init()),this},stop:function(a){this.session.stopped=a?oc:nc},recognize:function(a){var b=this.session;if(!b.stopped){this.touchAction.preventDefaults(a);var c,d=this.recognizers,e=b.curRecognizer;(!e||e&&e.state&kc)&&(e=b.curRecognizer=null);for(var f=0;f<d.length;)c=d[f],b.stopped===oc||e&&c!=e&&!c.canRecognizeWith(e)?c.reset():c.recognize(a),!e&&c.state&(hc|ic|jc)&&(e=b.curRecognizer=c),f++}},get:function(a){if(a instanceof U)return a;for(var b=this.recognizers,c=0;c<b.length;c++)if(b[c].options.event==a)return b[c];return null},add:function(a){if(f(a,"add",this))return this;var b=this.get(a.options.event);return b&&this.remove(b),this.recognizers.push(a),a.manager=this,this.touchAction.update(),a},remove:function(a){if(f(a,"remove",this))return this;if(a=this.get(a)){var b=this.recognizers,c=r(b,a);-1!==c&&(b.splice(c,1),this.touchAction.update())}return this},on:function(a,b){var c=this.handlers;return g(q(a),function(a){c[a]=c[a]||[],c[a].push(b)}),this},off:function(a,b){var c=this.handlers;return g(q(a),function(a){b?c[a]&&c[a].splice(r(c[a],b),1):delete c[a]}),this},emit:function(a,b){this.options.domEvents&&gb(a,b);var c=this.handlers[a]&&this.handlers[a].slice();if(c&&c.length){b.type=a,b.preventDefault=function(){b.srcEvent.preventDefault()};for(var d=0;d<c.length;)c[d](b),d++}},destroy:function(){this.element&&fb(this,!1),this.handlers={},this.session={},this.input.destroy(),this.element=null}},hb(db,{INPUT_START:Ab,INPUT_MOVE:Bb,INPUT_END:Cb,INPUT_CANCEL:Db,STATE_POSSIBLE:gc,STATE_BEGAN:hc,STATE_CHANGED:ic,STATE_ENDED:jc,STATE_RECOGNIZED:kc,STATE_CANCELLED:lc,STATE_FAILED:mc,DIRECTION_NONE:Eb,DIRECTION_LEFT:Fb,DIRECTION_RIGHT:Gb,DIRECTION_UP:Hb,DIRECTION_DOWN:Ib,DIRECTION_HORIZONTAL:Jb,DIRECTION_VERTICAL:Kb,DIRECTION_ALL:Lb,Manager:eb,Input:x,TouchAction:S,TouchInput:P,MouseInput:L,PointerEventInput:M,TouchMouseInput:R,SingleTouchInput:N,Recognizer:U,AttrRecognizer:Y,Tap:cb,Pan:Z,Swipe:bb,Pinch:$,Rotate:ab,Press:_,on:m,off:n,each:g,merge:pb,extend:ob,assign:hb,inherit:i,bindFn:j,prefixed:u});var pc="undefined"!=typeof a?a:"undefined"!=typeof self?self:{};pc.Hammer=db,"function"==typeof define&&define.amd?define(function(){return db}):"undefined"!=typeof module&&module.exports?module.exports=db:a[c]=db}(window,document,"Hammer");
16651//# sourceMappingURL=hammer.min.map
16652/*!
16653 * Bootstrap Package v7.0.2 (http://www.bk2k.info)
16654 * Copyright 2014-2016 Benjamin Kott
16655 * Licensed under the MIT license
16656 */
16657$(function(){function a(a){b&&(a.stopPropagation(),a.preventDefault()),b=!1}var b=!1;$(".carousel").each(function(){var a=new Hammer(this);a.on("swipeleft swiperight release",function(c){"swipeleft"===c.type&&(b=!0,$(a.element).carousel("next")),"swiperight"===c.type&&(b=!0,$(a.element).carousel("prev"))})}),$(document).on("click",a)});
16658/*!
16659 * Bootstrap Package v7.0.2 (http://www.bk2k.info)
16660 * Copyright 2014-2016 Benjamin Kott
16661 * Licensed under the MIT license
16662 */
16663$(function(){$('[data-toggle="popover"]').popover()});
16664/*!
16665 * Bootstrap Package v7.0.2 (http://www.bk2k.info)
16666 * Copyright 2014-2016 Benjamin Kott
16667 * Licensed under the MIT license
16668 */
16669$(function(){if($("a.lightbox").length>0){var a='            <div class="pswp" tabindex="-1" role="dialog" aria-hidden="true">                <div class="pswp__bg"></div>                <div class="pswp__scroll-wrap">                    <div class="pswp__container">                        <div class="pswp__item"></div>                        <div class="pswp__item"></div>                        <div class="pswp__item"></div>                    </div>                    <div class="pswp__ui pswp__ui--hidden">                        <div class="pswp__top-bar">                            <div class="pswp__counter"></div>                            <button class="pswp__button pswp__button--close" title="Close (Esc)" aria-label="Close (Esc)"></button>                            <button class="pswp__button pswp__button--share" title="Share" aria-label="Share"></button>                            <button class="pswp__button pswp__button--fs" title="Toggle fullscreen" aria-label="Toggle fullscreen"></button>                            <button class="pswp__button pswp__button--zoom" title="Zoom in/out" aria-label="Zoom in/out"></button>                            <div class="pswp__preloader">                                <div class="pswp__preloader__icn">                                    <div class="pswp__preloader__cut">                                        <div class="pswp__preloader__donut"></div>                                    </div>                                </div>                            </div>                        </div>                        <div class="pswp__share-modal pswp__share-modal--hidden pswp__single-tap">                            <div class="pswp__share-tooltip"></div>                         </div>                        <button class="pswp__button pswp__button--arrow--left" title="Previous (arrow left)" aria-label="Previous (arrow left)"></button>                        <button class="pswp__button pswp__button--arrow--right" title="Next (arrow right)" aria-label="Next (arrow right)"></button>                        <div class="pswp__caption">                            <div class="pswp__caption__center"></div>                        </div>                    </div>                </div>            </div>';$("body").append(a)}var b=function(a,b){var c=document.querySelectorAll(".pswp")[0],d=[];$("a.lightbox[rel="+b+"]").each(function(){var a="";a=$(this).data("lightbox-caption")?$(this).data("lightbox-caption"):$(this).next("figcaption").text(),d.push({src:$(this).attr("href"),title:$(this).attr("title"),w:$(this).data("lightbox-width"),h:$(this).data("lightbox-height"),caption:a,pid:$(this).index("a.lightbox[rel="+b+"]")})});var e={index:a,addCaptionHTMLFn:function(a,b,c){return a.title?(b.children[0].innerHTML='<div class="pswp__caption__title">'+a.title+"</div>",a.caption&&(b.children[0].innerHTML+='<div class="pswp__caption__subtitle">'+a.caption+"</div>"),!0):(b.children[0].innerHTML="",!1)},spacing:.12,loop:!0,bgOpacity:1,closeOnScroll:!0,history:!0,galleryUID:b,galleryPIDs:!0,closeEl:!0,captionEl:!0,fullscreenEl:!0,zoomEl:!0,shareEl:!0,counterEl:!0,arrowEl:!0,preloaderEl:!0};if(d.length>0){var f=new PhotoSwipe(c,PhotoSwipeUI_Default,d,e);f.init()}},c=function(){var a=window.location.hash.substring(1),b={};if(a.length<5)return b;for(var c=a.split("&"),d=0;d<c.length;d++)if(c[d]){var e=c[d].split("=");e.length<2||(b[e[0]]=e[1])}return b},d=c();d.pid&&d.gid&&b(parseInt(d.pid),d.gid),$("a.lightbox").on("click",function(a){a.preventDefault();var c=$(this).attr("rel"),d=$(this).index("a.lightbox[rel="+c+"]");b(d,c)})});
16670/*!
16671 * Bootstrap Package v7.0.2 (http://www.bk2k.info)
16672 * Copyright 2014-2016 Benjamin Kott
16673 * Licensed under the MIT license
16674 */
16675$(function(){$(".navbar-collapse").on("show.bs.collapse",function(){$(".navbar-toggle").removeClass("collapsed")}).on("hide.bs.collapse",function(){$(".navbar-toggle").addClass("collapsed")})});
16676/**
16677 * @preserve jQuery Scroller plugin v1.0.1
16678 * @homepage http://xdsoft.net
16679 * (c) 2014, Chupurnov Valeriy <[email protected]>.
16680 */
16681(function($){'use strict';$.fn.xdsoftScroller=function(g){return this.each(function(){var f=$(this),pointerEventToXY=function(e){var a={x:0,y:0},touch;if(e.type==='touchstart'||e.type==='touchmove'||e.type==='touchend'||e.type==='touchcancel'){touch=e.originalEvent.touches[0]||e.originalEvent.changedTouches[0];a.x=touch.clientX;a.y=touch.clientY}else if(e.type==='mousedown'||e.type==='mouseup'||e.type==='mousemove'||e.type==='mouseover'||e.type==='mouseout'||e.type==='mouseenter'||e.type==='mouseleave'){a.x=e.clientX;a.y=e.clientY}return a},move=0,timebox,parentHeight,height,scrollbar,scroller,maximumOffset=100,start=false,startY=0,startTop=0,h1=0,touchStart=false,startTopScroll=0,calcOffset=function(){};if(g==='hide'){f.find('.xdsoft_scrollbar').hide();return}if(!$(this).hasClass('xdsoft_scroller_box')){timebox=f.children().eq(0);parentHeight=f[0].clientHeight;height=timebox[0].offsetHeight;scrollbar=$('<div class="xdsoft_scrollbar"></div>');scroller=$('<div class="xdsoft_scroller"></div>');scrollbar.append(scroller);f.addClass('xdsoft_scroller_box').append(scrollbar);
16681calcOffset=function calcOffset(a){var b=pointerEventToXY(a).y-startY+startTopScroll;if(b<0){b=0}if(b+scroller[0].offsetHeight>h1){b=h1-scroller[0].offsetHeight}f.trigger('scroll_element.xdsoft_scroller',[maximumOffset?b/maximumOffset:0])};scroller.on('touchstart.xdsoft_scroller mousedown.xdsoft_scroller',function(a){if(!parentHeight){f.trigger('resize_scroll.xdsoft_scroller',[g])}startY=pointerEventToXY(a).y;startTopScroll=parseInt(scroller.css('margin-top'),10);h1=scrollbar[0].offsetHeight;if(a.type==='mousedown'){if(document){$(document.body).addClass('xdsoft_noselect')}$([document.body,window]).on('mouseup.xdsoft_scroller',function arguments_callee(){$([document.body,window]).off('mouseup.xdsoft_scroller',arguments_callee).off('mousemove.xdsoft_scroller',calcOffset).removeClass('xdsoft_noselect')});$(document.body).on('mousemove.xdsoft_scroller',calcOffset)}else{touchStart=true}a.stopPropagation();a.preventDefault()}).on('touchmove',function(a){if(touchStart){a.preventDefault();calcOffset(a)}}).on('touchend touchcancel',function(a){touchStart=false;startTopScroll=0});f.on('scroll_element.xdsoft_scroller',function(a,b){if(!parentHeight){f.trigger('resize_scroll.xdsoft_scroller',[b,true])}b=b>1?1:(b<0||isNaN(b))?0:b;scroller.css('margin-top',maximumOffset*b);setTimeout(function(){timebox.css('marginTop',-parseInt((timebox[0].offsetHeight-parentHeight)*b,10))},10)}).on('resize_scroll.xdsoft_scroller',function(a,b,c){var d,sh;parentHeight=f[0].clientHeight;height=timebox[0].offsetHeight;d=parentHeight/height;sh=d*scrollbar[0].offsetHeight;if(d>=1){scroller.hide()}else{scroller.show();scroller.css('height',parseInt(sh>10?sh:10,10));maximumOffset=scrollbar[0].offsetHeight-scroller[0].offsetHeight;if(c!==true){f.trigger('scroll_element.xdsoft_scroller',[b||Math.abs(parseInt(timebox.css('marginTop'),10))/(height-parentHeight)])}}});f.on('mousewheel',function(a){var b=Math.abs(parseInt(timebox.css('marginTop'),10));b=b-(a.deltaY*20);if(b<0){b=0}f.trigger('scroll_element.xdsoft_scroller',[b/(height-parentHeight)]);a.stopPropagation();return false});f.on('touchstart',function(a){start=pointerEventToXY(a);startTop=Math.abs(parseInt(timebox.css('marginTop'),10))});f.on('touchmove',function(a){if(start){a.preventDefault();var b=pointerEventToXY(a);f.trigger('scroll_element.xdsoft_scroller',[(startTop-(b.y-start.y))/(height-parentHeight)])}});f.on('touchend touchcancel',function(a){start=false;startTop=0})}f.trigger('resize_scroll.xdsoft_scroller',[g])})}}(jQuery));
vendor: 520,714 bytes, lines 16682-35387
16682/*! jQuery UI - v1.12.1 - 2016-09-14
16683* http://jqueryui.com
16684* Includes: widget.js, position.js, data.js, disable-selection.js, effect.js, effects/effect-blind.js, effects/effect-bounce.js, effects/effect-clip.js, effects/effect-drop.js, effects/effect-explode.js, effects/effect-fade.js, effects/effect-fold.js, effects/effect-highlight.js, effects/effect-puff.js, effects/effect-pulsate.js, effects/effect-scale.js, effects/effect-shake.js, effects/effect-size.js, effects/effect-slide.js, effects/effect-transfer.js, focusable.js, form-reset-mixin.js, jquery-1-7.js, keycode.js, labels.js, scroll-parent.js, tabbable.js, unique-id.js, widgets/accordion.js, widgets/autocomplete.js, widgets/button.js, widgets/checkboxradio.js, widgets/controlgroup.js, widgets/datepicker.js, widgets/dialog.js, widgets/draggable.js, widgets/droppable.js, widgets/menu.js, widgets/mouse.js, widgets/progressbar.js, widgets/resizable.js, widgets/selectable.js, widgets/selectmenu.js, widgets/slider.js, widgets/sortable.js, widgets/spinner.js, widgets/tabs.js, widgets/tooltip.js
16685* Copyright jQuery Foundation and other contributors; Licensed MIT */
16686
16687(function( factory ) {
16688	if ( typeof define === "function" && define.amd ) {
16689
16690		// AMD. Register as an anonymous module.
16691		define([ "jquery" ], factory );
16692	} else {
16693
16694		// Browser globals
16695		factory( jQuery );
16696	}
16697}(function( $ ) {
16698
16699$.ui = $.ui || {};
16700
16701var version = $.ui.version = "1.12.1";
16702
16703
16704/*!
16705 * jQuery UI Widget 1.12.1
16706 * http://jqueryui.com
16707 *
16708 * Copyright jQuery Foundation and other contributors
16709 * Released under the MIT license.
16710 * http://jquery.org/license
16711 */
16712
16713//>>label: Widget
16714//>>group: Core
16715//>>description: Provides a factory for creating stateful widgets with a common API.
16716//>>docs: http://api.jqueryui.com/jQuery.widget/
16717//>>demos: http://jqueryui.com/widget/
16718
16719
16720
16721var widgetUuid = 0;
16722var widgetSlice = Array.prototype.slice;
16723
16724$.cleanData = ( function( orig ) {
16725	return function( elems ) {
16726		var events, elem, i;
16727		for ( i = 0; ( elem = elems[ i ] ) != null; i++ ) {
16728			try {
16729
16730				// Only trigger remove when necessary to save time
16731				events = $._data( elem, "events" );
16732				if ( events && events.remove ) {
16733					$( elem ).triggerHandler( "remove" );
16734				}
16735
16736			// Http://bugs.jquery.com/ticket/8235
16737			} catch ( e ) {}
16738		}
16739		orig( elems );
16740	};
16741} )( $.cleanData );
16742
16743$.widget = function( name, base, prototype ) {
16744	var existingConstructor, constructor, basePrototype;
16745
16746	// ProxiedPrototype allows the provided prototype to remain unmodified
16747	// so that it can be used as a mixin for multiple widgets (#8876)
16748	var proxiedPrototype = {};
16749
16750	var namespace = name.split( "." )[ 0 ];
16751	name = name.split( "." )[ 1 ];
16752	var fullName = namespace + "-" + name;
16753
16754	if ( !prototype ) {
16755		prototype = base;
16756		base = $.Widget;
16757	}
16758
16759	if ( $.isArray( prototype ) ) {
16760		prototype = $.extend.apply( null, [ {} ].concat( prototype ) );
16761	}
16762
16763	// Create selector for plugin
16764	$.expr[ ":" ][ fullName.toLowerCase() ] = function( elem ) {
16765		return !!$.data( elem, fullName );
16766	};
16767
16768	$[ namespace ] = $[ namespace ] || {};
16769	existingConstructor = $[ namespace ][ name ];
16770	constructor = $[ namespace ][ name ] = function( options, element ) {
16771
16772		// Allow instantiation without "new" keyword
16773		if ( !this._createWidget ) {
16774			return new constructor( options, element );
16775		}
16776
16777		// Allow instantiation without initializing for simple inheritance
16778		// must use "new" keyword (the code above always passes args)
16779		if ( arguments.length ) {
16780			this._createWidget( options, element );
16781		}
16782	};
16783
16784	// Extend with the existing constructor to carry over any static properties
16785	$.extend( constructor, existingConstructor, {
16786		version: prototype.version,
16787
16788		// Copy the object used to create the prototype in case we need to
16789		// redefine the widget later
16790		_proto: $.extend( {}, prototype ),
16791
16792		// Track widgets that inherit from this widget in case this widget is
16793		// redefined after a widget inherits from it
16794		_childConstructors: []
16795	} );
16796
16797	basePrototype = new base();
16798
16799	// We need to make the options hash a property directly on the new instance
16800	// otherwise we'll modify the options hash on the prototype that we're
16801	// inheriting from
16802	basePrototype.options = $.widget.extend( {}, basePrototype.options );
16803	$.each( prototype, function( prop, value ) {
16804		if ( !$.isFunction( value ) ) {
16805			proxiedPrototype[ prop ] = value;
16806			return;
16807		}
16808		proxiedPrototype[ prop ] = ( function() {
16809			function _super() {
16810				return base.prototype[ prop ].apply( this, arguments );
16811			}
16812
16813			function _superApply( args ) {
16814				return base.prototype[ prop ].apply( this, args );
16815			}
16816
16817			return function() {
16818				var __super = this._super;
16819				var __superApply = this._superApply;
16820				var returnValue;
16821
16822				this._super = _super;
16823				this._superApply = _superApply;
16824
16825				returnValue = value.apply( this, arguments );
16826
16827				this._super = __super;
16828				this._superApply = __superApply;
16829
16830				return returnValue;
16831			};
16832		} )();
16833	} );
16834	constructor.prototype = $.widget.extend( basePrototype, {
16835
16836		// TODO: remove support for widgetEventPrefix
16837		// always use the name + a colon as the prefix, e.g., draggable:start
16838		// don't prefix for widgets that aren't DOM-based
16839		widgetEventPrefix: existingConstructor ? ( basePrototype.widgetEventPrefix || name ) : name
16840	}, proxiedPrototype, {
16841		constructor: constructor,
16842		namespace: namespace,
16843		widgetName: name,
16844		widgetFullName: fullName
16845	} );
16846
16847	// If this widget is being redefined then we need to find all widgets that
16848	// are inheriting from it and redefine all of them so that they inherit from
16849	// the new version of this widget. We're essentially trying to replace one
16850	// level in the prototype chain.
16851	if ( existingConstructor ) {
16852		$.each( existingConstructor._childConstructors, function( i, child ) {
16853			var childPrototype = child.prototype;
16854
16855			// Redefine the child widget using the same prototype that was
16856			// originally used, but inherit from the new version of the base
16857			$.widget( childPrototype.namespace + "." + childPrototype.widgetName, constructor,
16858				child._proto );
16859		} );
16860
16861		// Remove the list of existing child constructors from the old constructor
16862		// so the old child constructors can be garbage collected
16863		delete existingConstructor._childConstructors;
16864	} else {
16865		base._childConstructors.push( constructor );
16866	}
16867
16868	$.widget.bridge( name, constructor );
16869
16870	return constructor;
16871};
16872
16873$.widget.extend = function( target ) {
16874	var input = widgetSlice.call( arguments, 1 );
16875	var inputIndex = 0;
16876	var inputLength = input.length;
16877	var key;
16878	var value;
16879
16880	for ( ; inputIndex < inputLength; inputIndex++ ) {
16881		for ( key in input[ inputIndex ] ) {
16882			value = input[ inputIndex ][ key ];
16883			if ( input[ inputIndex ].hasOwnProperty( key ) && value !== undefined ) {
16884
16885				// Clone objects
16886				if ( $.isPlainObject( value ) ) {
16887					target[ key ] = $.isPlainObject( target[ key ] ) ?
16888						$.widget.extend( {}, target[ key ], value ) :
16889
16890						// Don't extend strings, arrays, etc. with objects
16891						$.widget.extend( {}, value );
16892
16893				// Copy everything else by reference
16894				} else {
16895					target[ key ] = value;
16896				}
16897			}
16898		}
16899	}
16900	return target;
16901};
16902
16903$.widget.bridge = function( name, object ) {
16904	var fullName = object.prototype.widgetFullName || name;
16905	$.fn[ name ] = function( options ) {
16906		var isMethodCall = typeof options === "string";
16907		var args = widgetSlice.call( arguments, 1 );
16908		var returnValue = this;
16909
16910		if ( isMethodCall ) {
16911
16912			// If this is an empty collection, we need to have the instance method
16913			// return undefined instead of the jQuery instance
16914			if ( !this.length && options === "instance" ) {
16915				returnValue = undefined;
16916			} else {
16917				this.each( function() {
16918					var methodValue;
16919					var instance = $.data( this, fullName );
16920
16921					if ( options === "instance" ) {
16922						returnValue = instance;
16923						return false;
16924					}
16925
16926					if ( !instance ) {
16927						return $.error( "cannot call methods on " + name +
16928							" prior to initialization; " +
16929							"attempted to call method '" + options + "'" );
16930					}
16931
16932					if ( !$.isFunction( instance[ options ] ) || options.charAt( 0 ) === "_" ) {
16933						return $.error( "no such method '" + options + "' for " + name +
16934							" widget instance" );
16935					}
16936
16937					methodValue = instance[ options ].apply( instance, args );
16938
16939					if ( methodValue !== instance && methodValue !== undefined ) {
16940						returnValue = methodValue && methodValue.jquery ?
16941							returnValue.pushStack( methodValue.get() ) :
16942							methodValue;
16943						return false;
16944					}
16945				} );
16946			}
16947		} else {
16948
16949			// Allow multiple hashes to be passed on init
16950			if ( args.length ) {
16951				options = $.widget.extend.apply( null, [ options ].concat( args ) );
16952			}
16953
16954			this.each( function() {
16955				var instance = $.data( this, fullName );
16956				if ( instance ) {
16957					instance.option( options || {} );
16958					if ( instance._init ) {
16959						instance._init();
16960					}
16961				} else {
16962					$.data( this, fullName, new object( options, this ) );
16963				}
16964			} );
16965		}
16966
16967		return returnValue;
16968	};
16969};
16970
16971$.Widget = function( /* options, element */ ) {};
16972$.Widget._childConstructors = [];
16973
16974$.Widget.prototype = {
16975	widgetName: "widget",
16976	widgetEventPrefix: "",
16977	defaultElement: "<div>",
16978
16979	options: {
16980		classes: {},
16981		disabled: false,
16982
16983		// Callbacks
16984		create: null
16985	},
16986
16987	_createWidget: function( options, element ) {
16988		element = $( element || this.defaultElement || this )[ 0 ];
16989		this.element = $( element );
16990		this.uuid = widgetUuid++;
16991		this.eventNamespace = "." + this.widgetName + this.uuid;
16992
16993		this.bindings = $();
16994		this.hoverable = $();
16995		this.focusable = $();
16996		this.classesElementLookup = {};
16997
16998		if ( element !== this ) {
16999			$.data( element, this.widgetFullName, this );
17000			this._on( true, this.element, {
17001				remove: function( event ) {
17002					if ( event.target === element ) {
17003						this.destroy();
17004					}
17005				}
17006			} );
17007			this.document = $( element.style ?
17008
17009				// Element within the document
17010				element.ownerDocument :
17011
17012				// Element is window or document
17013				element.document || element );
17014			this.window = $( this.document[ 0 ].defaultView || this.document[ 0 ].parentWindow );
17015		}
17016
17017		this.options = $.widget.extend( {},
17018			this.options,
17019			this._getCreateOptions(),
17020			options );
17021
17022		this._create();
17023
17024		if ( this.options.disabled ) {
17025			this._setOptionDisabled( this.options.disabled );
17026		}
17027
17028		this._trigger( "create", null, this._getCreateEventData() );
17029		this._init();
17030	},
17031
17032	_getCreateOptions: function() {
17033		return {};
17034	},
17035
17036	_getCreateEventData: $.noop,
17037
17038	_create: $.noop,
17039
17040	_init: $.noop,
17041
17042	destroy: function() {
17043		var that = this;
17044
17045		this._destroy();
17046		$.each( this.classesElementLookup, function( key, value ) {
17047			that._removeClass( value, key );
17048		} );
17049
17050		// We can probably remove the unbind calls in 2.0
17051		// all event bindings should go through this._on()
17052		this.element
17053			.off( this.eventNamespace )
17054			.removeData( this.widgetFullName );
17055		this.widget()
17056			.off( this.eventNamespace )
17057			.removeAttr( "aria-disabled" );
17058
17059		// Clean up events and states
17060		this.bindings.off( this.eventNamespace );
17061	},
17062
17063	_destroy: $.noop,
17064
17065	widget: function() {
17066		return this.element;
17067	},
17068
17069	option: function( key, value ) {
17070		var options = key;
17071		var parts;
17072		var curOption;
17073		var i;
17074
17075		if ( arguments.length === 0 ) {
17076
17077			// Don't return a reference to the internal hash
17078			return $.widget.extend( {}, this.options );
17079		}
17080
17081		if ( typeof key === "string" ) {
17082
17083			// Handle nested keys, e.g., "foo.bar" => { foo: { bar: ___ } }
17084			options = {};
17085			parts = key.split( "." );
17086			key = parts.shift();
17087			if ( parts.length ) {
17088				curOption = options[ key ] = $.widget.extend( {}, this.options[ key ] );
17089				for ( i = 0; i < parts.length - 1; i++ ) {
17090					curOption[ parts[ i ] ] = curOption[ parts[ i ] ] || {};
17091					curOption = curOption[ parts[ i ] ];
17092				}
17093				key = parts.pop();
17094				if ( arguments.length === 1 ) {
17095					return curOption[ key ] === undefined ? null : curOption[ key ];
17096				}
17097				curOption[ key ] = value;
17098			} else {
17099				if ( arguments.length === 1 ) {
17100					return this.options[ key ] === undefined ? null : this.options[ key ];
17101				}
17102				options[ key ] = value;
17103			}
17104		}
17105
17106		this._setOptions( options );
17107
17108		return this;
17109	},
17110
17111	_setOptions: function( options ) {
17112		var key;
17113
17114		for ( key in options ) {
17115			this._setOption( key, options[ key ] );
17116		}
17117
17118		return this;
17119	},
17120
17121	_setOption: function( key, value ) {
17122		if ( key === "classes" ) {
17123			this._setOptionClasses( value );
17124		}
17125
17126		this.options[ key ] = value;
17127
17128		if ( key === "disabled" ) {
17129			this._setOptionDisabled( value );
17130		}
17131
17132		return this;
17133	},
17134
17135	_setOptionClasses: function( value ) {
17136		var classKey, elements, currentElements;
17137
17138		for ( classKey in value ) {
17139			currentElements = this.classesElementLookup[ classKey ];
17140			if ( value[ classKey ] === this.options.classes[ classKey ] ||
17141					!currentElements ||
17142					!currentElements.length ) {
17143				continue;
17144			}
17145
17146			// We are doing this to create a new jQuery object because the _removeClass() call
17147			// on the next line is going to destroy the reference to the current elements being
17148			// tracked. We need to save a copy of this collection so that we can add the new classes
17149			// below.
17150			elements = $( currentElements.get() );
17151			this._removeClass( currentElements, classKey );
17152
17153			// We don't use _addClass() here, because that uses this.options.classes
17154			// for generating the string of classes. We want to use the value passed in from
17155			// _setOption(), this is the new value of the classes option which was passed to
17156			// _setOption(). We pass this value directly to _classes().
17157			elements.addClass( this._classes( {
17158				element: elements,
17159				keys: classKey,
17160				classes: value,
17161				add: true
17162			} ) );
17163		}
17164	},
17165
17166	_setOptionDisabled: function( value ) {
17167		this._toggleClass( this.widget(), this.widgetFullName + "-disabled", null, !!value );
17168
17169		// If the widget is becoming disabled, then nothing is interactive
17170		if ( value ) {
17171			this._removeClass( this.hoverable, null, "ui-state-hover" );
17172			this._removeClass( this.focusable, null, "ui-state-focus" );
17173		}
17174	},
17175
17176	enable: function() {
17177		return this._setOptions( { disabled: false } );
17178	},
17179
17180	disable: function() {
17181		return this._setOptions( { disabled: true } );
17182	},
17183
17184	_classes: function( options ) {
17185		var full = [];
17186		var that = this;
17187
17188		options = $.extend( {
17189			element: this.element,
17190			classes: this.options.classes || {}
17191		}, options );
17192
17193		function processClassString( classes, checkOption ) {
17194			var current, i;
17195			for ( i = 0; i < classes.length; i++ ) {
17196				current = that.classesElementLookup[ classes[ i ] ] || $();
17197				if ( options.add ) {
17198					current = $( $.unique( current.get().concat( options.element.get() ) ) );
17199				} else {
17200					current = $( current.not( options.element ).get() );
17201				}
17202				that.classesElementLookup[ classes[ i ] ] = current;
17203				full.push( classes[ i ] );
17204				if ( checkOption && options.classes[ classes[ i ] ] ) {
17205					full.push( options.classes[ classes[ i ] ] );
17206				}
17207			}
17208		}
17209
17210		this._on( options.element, {
17211			"remove": "_untrackClassesElement"
17212		} );
17213
17214		if ( options.keys ) {
17215			processClassString( options.keys.match( /\S+/g ) || [], true );
17216		}
17217		if ( options.extra ) {
17218			processClassString( options.extra.match( /\S+/g ) || [] );
17219		}
17220
17221		return full.join( " " );
17222	},
17223
17224	_untrackClassesElement: function( event ) {
17225		var that = this;
17226		$.each( that.classesElementLookup, function( key, value ) {
17227			if ( $.inArray( event.target, value ) !== -1 ) {
17228				that.classesElementLookup[ key ] = $( value.not( event.target ).get() );
17229			}
17230		} );
17231	},
17232
17233	_removeClass: function( element, keys, extra ) {
17234		return this._toggleClass( element, keys, extra, false );
17235	},
17236
17237	_addClass: function( element, keys, extra ) {
17238		return this._toggleClass( element, keys, extra, true );
17239	},
17240
17241	_toggleClass: function( element, keys, extra, add ) {
17242		add = ( typeof add === "boolean" ) ? add : extra;
17243		var shift = ( typeof element === "string" || element === null ),
17244			options = {
17245				extra: shift ? keys : extra,
17246				keys: shift ? element : keys,
17247				element: shift ? this.element : element,
17248				add: add
17249			};
17250		options.element.toggleClass( this._classes( options ), add );
17251		return this;
17252	},
17253
17254	_on: function( suppressDisabledCheck, element, handlers ) {
17255		var delegateElement;
17256		var instance = this;
17257
17258		// No suppressDisabledCheck flag, shuffle arguments
17259		if ( typeof suppressDisabledCheck !== "boolean" ) {
17260			handlers = element;
17261			element = suppressDisabledCheck;
17262			suppressDisabledCheck = false;
17263		}
17264
17265		// No element argument, shuffle and use this.element
17266		if ( !handlers ) {
17267			handlers = element;
17268			element = this.element;
17269			delegateElement = this.widget();
17270		} else {
17271			element = delegateElement = $( element );
17272			this.bindings = this.bindings.add( element );
17273		}
17274
17275		$.each( handlers, function( event, handler ) {
17276			function handlerProxy() {
17277
17278				// Allow widgets to customize the disabled handling
17279				// - disabled as an array instead of boolean
17280				// - disabled class as method for disabling individual parts
17281				if ( !suppressDisabledCheck &&
17282						( instance.options.disabled === true ||
17283						$( this ).hasClass( "ui-state-disabled" ) ) ) {
17284					return;
17285				}
17286				return ( typeof handler === "string" ? instance[ handler ] : handler )
17287					.apply( instance, arguments );
17288			}
17289
17290			// Copy the guid so direct unbinding works
17291			if ( typeof handler !== "string" ) {
17292				handlerProxy.guid = handler.guid =
17293					handler.guid || handlerProxy.guid || $.guid++;
17294			}
17295
17296			var match = event.match( /^([\w:-]*)\s*(.*)$/ );
17297			var eventName = match[ 1 ] + instance.eventNamespace;
17298			var selector = match[ 2 ];
17299
17300			if ( selector ) {
17301				delegateElement.on( eventName, selector, handlerProxy );
17302			} else {
17303				element.on( eventName, handlerProxy );
17304			}
17305		} );
17306	},
17307
17308	_off: function( element, eventName ) {
17309		eventName = ( eventName || "" ).split( " " ).join( this.eventNamespace + " " ) +
17310			this.eventNamespace;
17311		element.off( eventName ).off( eventName );
17312
17313		// Clear the stack to avoid memory leaks (#10056)
17314		this.bindings = $( this.bindings.not( element ).get() );
17315		this.focusable = $( this.focusable.not( element ).get() );
17316		this.hoverable = $( this.hoverable.not( element ).get() );
17317	},
17318
17319	_delay: function( handler, delay ) {
17320		function handlerProxy() {
17321			return ( typeof handler === "string" ? instance[ handler ] : handler )
17322				.apply( instance, arguments );
17323		}
17324		var instance = this;
17325		return setTimeout( handlerProxy, delay || 0 );
17326	},
17327
17328	_hoverable: function( element ) {
17329		this.hoverable = this.hoverable.add( element );
17330		this._on( element, {
17331			mouseenter: function( event ) {
17332				this._addClass( $( event.currentTarget ), null, "ui-state-hover" );
17333			},
17334			mouseleave: function( event ) {
17335				this._removeClass( $( event.currentTarget ), null, "ui-state-hover" );
17336			}
17337		} );
17338	},
17339
17340	_focusable: function( element ) {
17341		this.focusable = this.focusable.add( element );
17342		this._on( element, {
17343			focusin: function( event ) {
17344				this._addClass( $( event.currentTarget ), null, "ui-state-focus" );
17345			},
17346			focusout: function( event ) {
17347				this._removeClass( $( event.currentTarget ), null, "ui-state-focus" );
17348			}
17349		} );
17350	},
17351
17352	_trigger: function( type, event, data ) {
17353		var prop, orig;
17354		var callback = this.options[ type ];
17355
17356		data = data || {};
17357		event = $.Event( event );
17358		event.type = ( type === this.widgetEventPrefix ?
17359			type :
17360			this.widgetEventPrefix + type ).toLowerCase();
17361
17362		// The original event may come from any element
17363		// so we need to reset the target on the new event
17364		event.target = this.element[ 0 ];
17365
17366		// Copy original event properties over to the new event
17367		orig = event.originalEvent;
17368		if ( orig ) {
17369			for ( prop in orig ) {
17370				if ( !( prop in event ) ) {
17371					event[ prop ] = orig[ prop ];
17372				}
17373			}
17374		}
17375
17376		this.element.trigger( event, data );
17377		return !( $.isFunction( callback ) &&
17378			callback.apply( this.element[ 0 ], [ event ].concat( data ) ) === false ||
17379			event.isDefaultPrevented() );
17380	}
17381};
17382
17383$.each( { show: "fadeIn", hide: "fadeOut" }, function( method, defaultEffect ) {
17384	$.Widget.prototype[ "_" + method ] = function( element, options, callback ) {
17385		if ( typeof options === "string" ) {
17386			options = { effect: options };
17387		}
17388
17389		var hasOptions;
17390		var effectName = !options ?
17391			method :
17392			options === true || typeof options === "number" ?
17393				defaultEffect :
17394				options.effect || defaultEffect;
17395
17396		options = options || {};
17397		if ( typeof options === "number" ) {
17398			options = { duration: options };
17399		}
17400
17401		hasOptions = !$.isEmptyObject( options );
17402		options.complete = callback;
17403
17404		if ( options.delay ) {
17405			element.delay( options.delay );
17406		}
17407
17408		if ( hasOptions && $.effects && $.effects.effect[ effectName ] ) {
17409			element[ method ]( options );
17410		} else if ( effectName !== method && element[ effectName ] ) {
17411			element[ effectName ]( options.duration, options.easing, callback );
17412		} else {
17413			element.queue( function( next ) {
17414				$( this )[ method ]();
17415				if ( callback ) {
17416					callback.call( element[ 0 ] );
17417				}
17418				next();
17419			} );
17420		}
17421	};
17422} );
17423
17424var widget = $.widget;
17425
17426
17427/*!
17428 * jQuery UI Position 1.12.1
17429 * http://jqueryui.com
17430 *
17431 * Copyright jQuery Foundation and other contributors
17432 * Released under the MIT license.
17433 * http://jquery.org/license
17434 *
17435 * http://api.jqueryui.com/position/
17436 */
17437
17438//>>label: Position
17439//>>group: Core
17440//>>description: Positions elements relative to other elements.
17441//>>docs: http://api.jqueryui.com/position/
17442//>>demos: http://jqueryui.com/position/
17443
17444
17445( function() {
17446var cachedScrollbarWidth,
17447	max = Math.max,
17448	abs = Math.abs,
17449	rhorizontal = /left|center|right/,
17450	rvertical = /top|center|bottom/,
17451	roffset = /[\+\-]\d+(\.[\d]+)?%?/,
17452	rposition = /^\w+/,
17453	rpercent = /%$/,
17454	_position = $.fn.position;
17455
17456function getOffsets( offsets, width, height ) {
17457	return [
17458		parseFloat( offsets[ 0 ] ) * ( rpercent.test( offsets[ 0 ] ) ? width / 100 : 1 ),
17459		parseFloat( offsets[ 1 ] ) * ( rpercent.test( offsets[ 1 ] ) ? height / 100 : 1 )
17460	];
17461}
17462
17463function parseCss( element, property ) {
17464	return parseInt( $.css( element, property ), 10 ) || 0;
17465}
17466
17467function getDimensions( elem ) {
17468	var raw = elem[ 0 ];
17469	if ( raw.nodeType === 9 ) {
17470		return {
17471			width: elem.width(),
17472			height: elem.height(),
17473			offset: { top: 0, left: 0 }
17474		};
17475	}
17476	if ( $.isWindow( raw ) ) {
17477		return {
17478			width: elem.width(),
17479			height: elem.height(),
17480			offset: { top: elem.scrollTop(), left: elem.scrollLeft() }
17481		};
17482	}
17483	if ( raw.preventDefault ) {
17484		return {
17485			width: 0,
17486			height: 0,
17487			offset: { top: raw.pageY, left: raw.pageX }
17488		};
17489	}
17490	return {
17491		width: elem.outerWidth(),
17492		height: elem.outerHeight(),
17493		offset: elem.offset()
17494	};
17495}
17496
17497$.position = {
17498	scrollbarWidth: function() {
17499		if ( cachedScrollbarWidth !== undefined ) {
17500			return cachedScrollbarWidth;
17501		}
17502		var w1, w2,
17503			div = $( "<div " +
17504				"style='display:block;position:absolute;width:50px;height:50px;overflow:hidden;'>" +
17505				"<div style='height:100px;width:auto;'></div></div>" ),
17506			innerDiv = div.children()[ 0 ];
17507
17508		$( "body" ).append( div );
17509		w1 = innerDiv.offsetWidth;
17510		div.css( "overflow", "scroll" );
17511
17512		w2 = innerDiv.offsetWidth;
17513
17514		if ( w1 === w2 ) {
17515			w2 = div[ 0 ].clientWidth;
17516		}
17517
17518		div.remove();
17519
17520		return ( cachedScrollbarWidth = w1 - w2 );
17521	},
17522	getScrollInfo: function( within ) {
17523		var overflowX = within.isWindow || within.isDocument ? "" :
17524				within.element.css( "overflow-x" ),
17525			overflowY = within.isWindow || within.isDocument ? "" :
17526				within.element.css( "overflow-y" ),
17527			hasOverflowX = overflowX === "scroll" ||
17528				( overflowX === "auto" && within.width < within.element[ 0 ].scrollWidth ),
17529			hasOverflowY = overflowY === "scroll" ||
17530				( overflowY === "auto" && within.height < within.element[ 0 ].scrollHeight );
17531		return {
17532			width: hasOverflowY ? $.position.scrollbarWidth() : 0,
17533			height: hasOverflowX ? $.position.scrollbarWidth() : 0
17534		};
17535	},
17536	getWithinInfo: function( element ) {
17537		var withinElement = $( element || window ),
17538			isWindow = $.isWindow( withinElement[ 0 ] ),
17539			isDocument = !!withinElement[ 0 ] && withinElement[ 0 ].nodeType === 9,
17540			hasOffset = !isWindow && !isDocument;
17541		return {
17542			element: withinElement,
17543			isWindow: isWindow,
17544			isDocument: isDocument,
17545			offset: hasOffset ? $( element ).offset() : { left: 0, top: 0 },
17546			scrollLeft: withinElement.scrollLeft(),
17547			scrollTop: withinElement.scrollTop(),
17548			width: withinElement.outerWidth(),
17549			height: withinElement.outerHeight()
17550		};
17551	}
17552};
17553
17554$.fn.position = function( options ) {
17555	if ( !options || !options.of ) {
17556		return _position.apply( this, arguments );
17557	}
17558
17559	// Make a copy, we don't want to modify arguments
17560	options = $.extend( {}, options );
17561
17562	var atOffset, targetWidth, targetHeight, targetOffset, basePosition, dimensions,
17563		target = $( options.of ),
17564		within = $.position.getWithinInfo( options.within ),
17565		scrollInfo = $.position.getScrollInfo( within ),
17566		collision = ( options.collision || "flip" ).split( " " ),
17567		offsets = {};
17568
17569	dimensions = getDimensions( target );
17570	if ( target[ 0 ].preventDefault ) {
17571
17572		// Force left top to allow flipping
17573		options.at = "left top";
17574	}
17575	targetWidth = dimensions.width;
17576	targetHeight = dimensions.height;
17577	targetOffset = dimensions.offset;
17578
17579	// Clone to reuse original targetOffset later
17580	basePosition = $.extend( {}, targetOffset );
17581
17582	// Force my and at to have valid horizontal and vertical positions
17583	// if a value is missing or invalid, it will be converted to center
17584	$.each( [ "my", "at" ], function() {
17585		var pos = ( options[ this ] || "" ).split( " " ),
17586			horizontalOffset,
17587			verticalOffset;
17588
17589		if ( pos.length === 1 ) {
17590			pos = rhorizontal.test( pos[ 0 ] ) ?
17591				pos.concat( [ "center" ] ) :
17592				rvertical.test( pos[ 0 ] ) ?
17593					[ "center" ].concat( pos ) :
17594					[ "center", "center" ];
17595		}
17596		pos[ 0 ] = rhorizontal.test( pos[ 0 ] ) ? pos[ 0 ] : "center";
17597		pos[ 1 ] = rvertical.test( pos[ 1 ] ) ? pos[ 1 ] : "center";
17598
17599		// Calculate offsets
17600		horizontalOffset = roffset.exec( pos[ 0 ] );
17601		verticalOffset = roffset.exec( pos[ 1 ] );
17602		offsets[ this ] = [
17603			horizontalOffset ? horizontalOffset[ 0 ] : 0,
17604			verticalOffset ? verticalOffset[ 0 ] : 0
17605		];
17606
17607		// Reduce to just the positions without the offsets
17608		options[ this ] = [
17609			rposition.exec( pos[ 0 ] )[ 0 ],
17610			rposition.exec( pos[ 1 ] )[ 0 ]
17611		];
17612	} );
17613
17614	// Normalize collision option
17615	if ( collision.length === 1 ) {
17616		collision[ 1 ] = collision[ 0 ];
17617	}
17618
17619	if ( options.at[ 0 ] === "right" ) {
17620		basePosition.left += targetWidth;
17621	} else if ( options.at[ 0 ] === "center" ) {
17622		basePosition.left += targetWidth / 2;
17623	}
17624
17625	if ( options.at[ 1 ] === "bottom" ) {
17626		basePosition.top += targetHeight;
17627	} else if ( options.at[ 1 ] === "center" ) {
17628		basePosition.top += targetHeight / 2;
17629	}
17630
17631	atOffset = getOffsets( offsets.at, targetWidth, targetHeight );
17632	basePosition.left += atOffset[ 0 ];
17633	basePosition.top += atOffset[ 1 ];
17634
17635	return this.each( function() {
17636		var collisionPosition, using,
17637			elem = $( this ),
17638			elemWidth = elem.outerWidth(),
17639			elemHeight = elem.outerHeight(),
17640			marginLeft = parseCss( this, "marginLeft" ),
17641			marginTop = parseCss( this, "marginTop" ),
17642			collisionWidth = elemWidth + marginLeft + parseCss( this, "marginRight" ) +
17643				scrollInfo.width,
17644			collisionHeight = elemHeight + marginTop + parseCss( this, "marginBottom" ) +
17645				scrollInfo.height,
17646			position = $.extend( {}, basePosition ),
17647			myOffset = getOffsets( offsets.my, elem.outerWidth(), elem.outerHeight() );
17648
17649		if ( options.my[ 0 ] === "right" ) {
17650			position.left -= elemWidth;
17651		} else if ( options.my[ 0 ] === "center" ) {
17652			position.left -= elemWidth / 2;
17653		}
17654
17655		if ( options.my[ 1 ] === "bottom" ) {
17656			position.top -= elemHeight;
17657		} else if ( options.my[ 1 ] === "center" ) {
17658			position.top -= elemHeight / 2;
17659		}
17660
17661		position.left += myOffset[ 0 ];
17662		position.top += myOffset[ 1 ];
17663
17664		collisionPosition = {
17665			marginLeft: marginLeft,
17666			marginTop: marginTop
17667		};
17668
17669		$.each( [ "left", "top" ], function( i, dir ) {
17670			if ( $.ui.position[ collision[ i ] ] ) {
17671				$.ui.position[ collision[ i ] ][ dir ]( position, {
17672					targetWidth: targetWidth,
17673					targetHeight: targetHeight,
17674					elemWidth: elemWidth,
17675					elemHeight: elemHeight,
17676					collisionPosition: collisionPosition,
17677					collisionWidth: collisionWidth,
17678					collisionHeight: collisionHeight,
17679					offset: [ atOffset[ 0 ] + myOffset[ 0 ], atOffset [ 1 ] + myOffset[ 1 ] ],
17680					my: options.my,
17681					at: options.at,
17682					within: within,
17683					elem: elem
17684				} );
17685			}
17686		} );
17687
17688		if ( options.using ) {
17689
17690			// Adds feedback as second argument to using callback, if present
17691			using = function( props ) {
17692				var left = targetOffset.left - position.left,
17693					right = left + targetWidth - elemWidth,
17694					top = targetOffset.top - position.top,
17695					bottom = top + targetHeight - elemHeight,
17696					feedback = {
17697						target: {
17698							element: target,
17699							left: targetOffset.left,
17700							top: targetOffset.top,
17701							width: targetWidth,
17702							height: targetHeight
17703						},
17704						element: {
17705							element: elem,
17706							left: position.left,
17707							top: position.top,
17708							width: elemWidth,
17709							height: elemHeight
17710						},
17711						horizontal: right < 0 ? "left" : left > 0 ? "right" : "center",
17712						vertical: bottom < 0 ? "top" : top > 0 ? "bottom" : "middle"
17713					};
17714				if ( targetWidth < elemWidth && abs( left + right ) < targetWidth ) {
17715					feedback.horizontal = "center";
17716				}
17717				if ( targetHeight < elemHeight && abs( top + bottom ) < targetHeight ) {
17718					feedback.vertical = "middle";
17719				}
17720				if ( max( abs( left ), abs( right ) ) > max( abs( top ), abs( bottom ) ) ) {
17721					feedback.important = "horizontal";
17722				} else {
17723					feedback.important = "vertical";
17724				}
17725				options.using.call( this, props, feedback );
17726			};
17727		}
17728
17729		elem.offset( $.extend( position, { using: using } ) );
17730	} );
17731};
17732
17733$.ui.position = {
17734	fit: {
17735		left: function( position, data ) {
17736			var within = data.within,
17737				withinOffset = within.isWindow ? within.scrollLeft : within.offset.left,
17738				outerWidth = within.width,
17739				collisionPosLeft = position.left - data.collisionPosition.marginLeft,
17740				overLeft = withinOffset - collisionPosLeft,
17741				overRight = collisionPosLeft + data.collisionWidth - outerWidth - withinOffset,
17742				newOverRight;
17743
17744			// Element is wider than within
17745			if ( data.collisionWidth > outerWidth ) {
17746
17747				// Element is initially over the left side of within
17748				if ( overLeft > 0 && overRight <= 0 ) {
17749					newOverRight = position.left + overLeft + data.collisionWidth - outerWidth -
17750						withinOffset;
17751					position.left += overLeft - newOverRight;
17752
17753				// Element is initially over right side of within
17754				} else if ( overRight > 0 && overLeft <= 0 ) {
17755					position.left = withinOffset;
17756
17757				// Element is initially over both left and right sides of within
17758				} else {
17759					if ( overLeft > overRight ) {
17760						position.left = withinOffset + outerWidth - data.collisionWidth;
17761					} else {
17762						position.left = withinOffset;
17763					}
17764				}
17765
17766			// Too far left -> align with left edge
17767			} else if ( overLeft > 0 ) {
17768				position.left += overLeft;
17769
17770			// Too far right -> align with right edge
17771			} else if ( overRight > 0 ) {
17772				position.left -= overRight;
17773
17774			// Adjust based on position and margin
17775			} else {
17776				position.left = max( position.left - collisionPosLeft, position.left );
17777			}
17778		},
17779		top: function( position, data ) {
17780			var within = data.within,
17781				withinOffset = within.isWindow ? within.scrollTop : within.offset.top,
17782				outerHeight = data.within.height,
17783				collisionPosTop = position.top - data.collisionPosition.marginTop,
17784				overTop = withinOffset - collisionPosTop,
17785				overBottom = collisionPosTop + data.collisionHeight - outerHeight - withinOffset,
17786				newOverBottom;
17787
17788			// Element is taller than within
17789			if ( data.collisionHeight > outerHeight ) {
17790
17791				// Element is initially over the top of within
17792				if ( overTop > 0 && overBottom <= 0 ) {
17793					newOverBottom = position.top + overTop + data.collisionHeight - outerHeight -
17794						withinOffset;
17795					position.top += overTop - newOverBottom;
17796
17797				// Element is initially over bottom of within
17798				} else if ( overBottom > 0 && overTop <= 0 ) {
17799					position.top = withinOffset;
17800
17801				// Element is initially over both top and bottom of within
17802				} else {
17803					if ( overTop > overBottom ) {
17804						position.top = withinOffset + outerHeight - data.collisionHeight;
17805					} else {
17806						position.top = withinOffset;
17807					}
17808				}
17809
17810			// Too far up -> align with top
17811			} else if ( overTop > 0 ) {
17812				position.top += overTop;
17813
17814			// Too far down -> align with bottom edge
17815			} else if ( overBottom > 0 ) {
17816				position.top -= overBottom;
17817
17818			// Adjust based on position and margin
17819			} else {
17820				position.top = max( position.top - collisionPosTop, position.top );
17821			}
17822		}
17823	},
17824	flip: {
17825		left: function( position, data ) {
17826			var within = data.within,
17827				withinOffset = within.offset.left + within.scrollLeft,
17828				outerWidth = within.width,
17829				offsetLeft = within.isWindow ? within.scrollLeft : within.offset.left,
17830				collisionPosLeft = position.left - data.collisionPosition.marginLeft,
17831				overLeft = collisionPosLeft - offsetLeft,
17832				overRight = collisionPosLeft + data.collisionWidth - outerWidth - offsetLeft,
17833				myOffset = data.my[ 0 ] === "left" ?
17834					-data.elemWidth :
17835					data.my[ 0 ] === "right" ?
17836						data.elemWidth :
17837						0,
17838				atOffset = data.at[ 0 ] === "left" ?
17839					data.targetWidth :
17840					data.at[ 0 ] === "right" ?
17841						-data.targetWidth :
17842						0,
17843				offset = -2 * data.offset[ 0 ],
17844				newOverRight,
17845				newOverLeft;
17846
17847			if ( overLeft < 0 ) {
17848				newOverRight = position.left + myOffset + atOffset + offset + data.collisionWidth -
17849					outerWidth - withinOffset;
17850				if ( newOverRight < 0 || newOverRight < abs( overLeft ) ) {
17851					position.left += myOffset + atOffset + offset;
17852				}
17853			} else if ( overRight > 0 ) {
17854				newOverLeft = position.left - data.collisionPosition.marginLeft + myOffset +
17855					atOffset + offset - offsetLeft;
17856				if ( newOverLeft > 0 || abs( newOverLeft ) < overRight ) {
17857					position.left += myOffset + atOffset + offset;
17858				}
17859			}
17860		},
17861		top: function( position, data ) {
17862			var within = data.within,
17863				withinOffset = within.offset.top + within.scrollTop,
17864				outerHeight = within.height,
17865				offsetTop = within.isWindow ? within.scrollTop : within.offset.top,
17866				collisionPosTop = position.top - data.collisionPosition.marginTop,
17867				overTop = collisionPosTop - offsetTop,
17868				overBottom = collisionPosTop + data.collisionHeight - outerHeight - offsetTop,
17869				top = data.my[ 1 ] === "top",
17870				myOffset = top ?
17871					-data.elemHeight :
17872					data.my[ 1 ] === "bottom" ?
17873						data.elemHeight :
17874						0,
17875				atOffset = data.at[ 1 ] === "top" ?
17876					data.targetHeight :
17877					data.at[ 1 ] === "bottom" ?
17878						-data.targetHeight :
17879						0,
17880				offset = -2 * data.offset[ 1 ],
17881				newOverTop,
17882				newOverBottom;
17883			if ( overTop < 0 ) {
17884				newOverBottom = position.top + myOffset + atOffset + offset + data.collisionHeight -
17885					outerHeight - withinOffset;
17886				if ( newOverBottom < 0 || newOverBottom < abs( overTop ) ) {
17887					position.top += myOffset + atOffset + offset;
17888				}
17889			} else if ( overBottom > 0 ) {
17890				newOverTop = position.top - data.collisionPosition.marginTop + myOffset + atOffset +
17891					offset - offsetTop;
17892				if ( newOverTop > 0 || abs( newOverTop ) < overBottom ) {
17893					position.top += myOffset + atOffset + offset;
17894				}
17895			}
17896		}
17897	},
17898	flipfit: {
17899		left: function() {
17900			$.ui.position.flip.left.apply( this, arguments );
17901			$.ui.position.fit.left.apply( this, arguments );
17902		},
17903		top: function() {
17904			$.ui.position.flip.top.apply( this, arguments );
17905			$.ui.position.fit.top.apply( this, arguments );
17906		}
17907	}
17908};
17909
17910} )();
17911
17912var position = $.ui.position;
17913
17914
17915/*!
17916 * jQuery UI :data 1.12.1
17917 * http://jqueryui.com
17918 *
17919 * Copyright jQuery Foundation and other contributors
17920 * Released under the MIT license.
17921 * http://jquery.org/license
17922 */
17923
17924//>>label: :data Selector
17925//>>group: Core
17926//>>description: Selects elements which have data stored under the specified key.
17927//>>docs: http://api.jqueryui.com/data-selector/
17928
17929
17930var data = $.extend( $.expr[ ":" ], {
17931	data: $.expr.createPseudo ?
17932		$.expr.createPseudo( function( dataName ) {
17933			return function( elem ) {
17934				return !!$.data( elem, dataName );
17935			};
17936		} ) :
17937
17938		// Support: jQuery <1.8
17939		function( elem, i, match ) {
17940			return !!$.data( elem, match[ 3 ] );
17941		}
17942} );
17943
17944/*!
17945 * jQuery UI Disable Selection 1.12.1
17946 * http://jqueryui.com
17947 *
17948 * Copyright jQuery Foundation and other contributors
17949 * Released under the MIT license.
17950 * http://jquery.org/license
17951 */
17952
17953//>>label: disableSelection
17954//>>group: Core
17955//>>description: Disable selection of text content within the set of matched elements.
17956//>>docs: http://api.jqueryui.com/disableSelection/
17957
17958// This file is deprecated
17959
17960
17961var disableSelection = $.fn.extend( {
17962	disableSelection: ( function() {
17963		var eventType = "onselectstart" in document.createElement( "div" ) ?
17964			"selectstart" :
17965			"mousedown";
17966
17967		return function() {
17968			return this.on( eventType + ".ui-disableSelection", function( event ) {
17969				event.preventDefault();
17970			} );
17971		};
17972	} )(),
17973
17974	enableSelection: function() {
17975		return this.off( ".ui-disableSelection" );
17976	}
17977} );
17978
17979
17980/*!
17981 * jQuery UI Effects 1.12.1
17982 * http://jqueryui.com
17983 *
17984 * Copyright jQuery Foundation and other contributors
17985 * Released under the MIT license.
17986 * http://jquery.org/license
17987 */
17988
17989//>>label: Effects Core
17990//>>group: Effects
17991// jscs:disable maximumLineLength
17992//>>description: Extends the internal jQuery effects. Includes morphing and easing. Required by all other effects.
17993// jscs:enable maximumLineLength
17994//>>docs: http://api.jqueryui.com/category/effects-core/
17995//>>demos: http://jqueryui.com/effect/
17996
17997
17998
17999var dataSpace = "ui-effects-",
18000	dataSpaceStyle = "ui-effects-style",
18001	dataSpaceAnimated = "ui-effects-animated",
18002
18003	// Create a local jQuery because jQuery Color relies on it and the
18004	// global may not exist with AMD and a custom build (#10199)
18005	jQuery = $;
18006
18007$.effects = {
18008	effect: {}
18009};
18010
18011/*!
18012 * jQuery Color Animations v2.1.2
18013 * https://github.com/jquery/jquery-color
18014 *
18015 * Copyright 2014 jQuery Foundation and other contributors
18016 * Released under the MIT license.
18017 * http://jquery.org/license
18018 *
18019 * Date: Wed Jan 16 08:47:09 2013 -0600
18020 */
18021( function( jQuery, undefined ) {
18022
18023	var stepHooks = "backgroundColor borderBottomColor borderLeftColor borderRightColor " +
18024		"borderTopColor color columnRuleColor outlineColor textDecorationColor textEmphasisColor",
18025
18026	// Plusequals test for += 100 -= 100
18027	rplusequals = /^([\-+])=\s*(\d+\.?\d*)/,
18028
18029	// A set of RE's that can match strings and generate color tuples.
18030	stringParsers = [ {
18031			re: /rgba?\(\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d{1,3})\s*(?:,\s*(\d?(?:\.\d+)?)\s*)?\)/,
18032			parse: function( execResult ) {
18033				return [
18034					execResult[ 1 ],
18035					execResult[ 2 ],
18036					execResult[ 3 ],
18037					execResult[ 4 ]
18038				];
18039			}
18040		}, {
18041			re: /rgba?\(\s*(\d+(?:\.\d+)?)\%\s*,\s*(\d+(?:\.\d+)?)\%\s*,\s*(\d+(?:\.\d+)?)\%\s*(?:,\s*(\d?(?:\.\d+)?)\s*)?\)/,
18042			parse: function( execResult ) {
18043				return [
18044					execResult[ 1 ] * 2.55,
18045					execResult[ 2 ] * 2.55,
18046					execResult[ 3 ] * 2.55,
18047					execResult[ 4 ]
18048				];
18049			}
18050		}, {
18051
18052			// This regex ignores A-F because it's compared against an already lowercased string
18053			re: /#([a-f0-9]{2})([a-f0-9]{2})([a-f0-9]{2})/,
18054			parse: function( execResult ) {
18055				return [
18056					parseInt( execResult[ 1 ], 16 ),
18057					parseInt( execResult[ 2 ], 16 ),
18058					parseInt( execResult[ 3 ], 16 )
18059				];
18060			}
18061		}, {
18062
18063			// This regex ignores A-F because it's compared against an already lowercased string
18064			re: /#([a-f0-9])([a-f0-9])([a-f0-9])/,
18065			parse: function( execResult ) {
18066				return [
18067					parseInt( execResult[ 1 ] + execResult[ 1 ], 16 ),
18068					parseInt( execResult[ 2 ] + execResult[ 2 ], 16 ),
18069					parseInt( execResult[ 3 ] + execResult[ 3 ], 16 )
18070				];
18071			}
18072		}, {
18073			re: /hsla?\(\s*(\d+(?:\.\d+)?)\s*,\s*(\d+(?:\.\d+)?)\%\s*,\s*(\d+(?:\.\d+)?)\%\s*(?:,\s*(\d?(?:\.\d+)?)\s*)?\)/,
18074			space: "hsla",
18075			parse: function( execResult ) {
18076				return [
18077					execResult[ 1 ],
18078					execResult[ 2 ] / 100,
18079					execResult[ 3 ] / 100,
18080					execResult[ 4 ]
18081				];
18082			}
18083		} ],
18084
18085	// JQuery.Color( )
18086	color = jQuery.Color = function( color, green, blue, alpha ) {
18087		return new jQuery.Color.fn.parse( color, green, blue, alpha );
18088	},
18089	spaces = {
18090		rgba: {
18091			props: {
18092				red: {
18093					idx: 0,
18094					type: "byte"
18095				},
18096				green: {
18097					idx: 1,
18098					type: "byte"
18099				},
18100				blue: {
18101					idx: 2,
18102					type: "byte"
18103				}
18104			}
18105		},
18106
18107		hsla: {
18108			props: {
18109				hue: {
18110					idx: 0,
18111					type: "degrees"
18112				},
18113				saturation: {
18114					idx: 1,
18115					type: "percent"
18116				},
18117				lightness: {
18118					idx: 2,
18119					type: "percent"
18120				}
18121			}
18122		}
18123	},
18124	propTypes = {
18125		"byte": {
18126			floor: true,
18127			max: 255
18128		},
18129		"percent": {
18130			max: 1
18131		},
18132		"degrees": {
18133			mod: 360,
18134			floor: true
18135		}
18136	},
18137	support = color.support = {},
18138
18139	// Element for support tests
18140	supportElem = jQuery( "<p>" )[ 0 ],
18141
18142	// Colors = jQuery.Color.names
18143	colors,
18144
18145	// Local aliases of functions called often
18146	each = jQuery.each;
18147
18148// Determine rgba support immediately
18149supportElem.style.cssText = "background-color:rgba(1,1,1,.5)";
18150support.rgba = supportElem.style.backgroundColor.indexOf( "rgba" ) > -1;
18151
18152// Define cache name and alpha properties
18153// for rgba and hsla spaces
18154each( spaces, function( spaceName, space ) {
18155	space.cache = "_" + spaceName;
18156	space.props.alpha = {
18157		idx: 3,
18158		type: "percent",
18159		def: 1
18160	};
18161} );
18162
18163function clamp( value, prop, allowEmpty ) {
18164	var type = propTypes[ prop.type ] || {};
18165
18166	if ( value == null ) {
18167		return ( allowEmpty || !prop.def ) ? null : prop.def;
18168	}
18169
18170	// ~~ is an short way of doing floor for positive numbers
18171	value = type.floor ? ~~value : parseFloat( value );
18172
18173	// IE will pass in empty strings as value for alpha,
18174	// which will hit this case
18175	if ( isNaN( value ) ) {
18176		return prop.def;
18177	}
18178
18179	if ( type.mod ) {
18180
18181		// We add mod before modding to make sure that negatives values
18182		// get converted properly: -10 -> 350
18183		return ( value + type.mod ) % type.mod;
18184	}
18185
18186	// For now all property types without mod have min and max
18187	return 0 > value ? 0 : type.max < value ? type.max : value;
18188}
18189
18190function stringParse( string ) {
18191	var inst = color(),
18192		rgba = inst._rgba = [];
18193
18194	string = string.toLowerCase();
18195
18196	each( stringParsers, function( i, parser ) {
18197		var parsed,
18198			match = parser.re.exec( string ),
18199			values = match && parser.parse( match ),
18200			spaceName = parser.space || "rgba";
18201
18202		if ( values ) {
18203			parsed = inst[ spaceName ]( values );
18204
18205			// If this was an rgba parse the assignment might happen twice
18206			// oh well....
18207			inst[ spaces[ spaceName ].cache ] = parsed[ spaces[ spaceName ].cache ];
18208			rgba = inst._rgba = parsed._rgba;
18209
18210			// Exit each( stringParsers ) here because we matched
18211			return false;
18212		}
18213	} );
18214
18215	// Found a stringParser that handled it
18216	if ( rgba.length ) {
18217
18218		// If this came from a parsed string, force "transparent" when alpha is 0
18219		// chrome, (and maybe others) return "transparent" as rgba(0,0,0,0)
18220		if ( rgba.join() === "0,0,0,0" ) {
18221			jQuery.extend( rgba, colors.transparent );
18222		}
18223		return inst;
18224	}
18225
18226	// Named colors
18227	return colors[ string ];
18228}
18229
18230color.fn = jQuery.extend( color.prototype, {
18231	parse: function( red, green, blue, alpha ) {
18232		if ( red === undefined ) {
18233			this._rgba = [ null, null, null, null ];
18234			return this;
18235		}
18236		if ( red.jquery || red.nodeType ) {
18237			red = jQuery( red ).css( green );
18238			green = undefined;
18239		}
18240
18241		var inst = this,
18242			type = jQuery.type( red ),
18243			rgba = this._rgba = [];
18244
18245		// More than 1 argument specified - assume ( red, green, blue, alpha )
18246		if ( green !== undefined ) {
18247			red = [ red, green, blue, alpha ];
18248			type = "array";
18249		}
18250
18251		if ( type === "string" ) {
18252			return this.parse( stringParse( red ) || colors._default );
18253		}
18254
18255		if ( type === "array" ) {
18256			each( spaces.rgba.props, function( key, prop ) {
18257				rgba[ prop.idx ] = clamp( red[ prop.idx ], prop );
18258			} );
18259			return this;
18260		}
18261
18262		if ( type === "object" ) {
18263			if ( red instanceof color ) {
18264				each( spaces, function( spaceName, space ) {
18265					if ( red[ space.cache ] ) {
18266						inst[ space.cache ] = red[ space.cache ].slice();
18267					}
18268				} );
18269			} else {
18270				each( spaces, function( spaceName, space ) {
18271					var cache = space.cache;
18272					each( space.props, function( key, prop ) {
18273
18274						// If the cache doesn't exist, and we know how to convert
18275						if ( !inst[ cache ] && space.to ) {
18276
18277							// If the value was null, we don't need to copy it
18278							// if the key was alpha, we don't need to copy it either
18279							if ( key === "alpha" || red[ key ] == null ) {
18280								return;
18281							}
18282							inst[ cache ] = space.to( inst._rgba );
18283						}
18284
18285						// This is the only case where we allow nulls for ALL properties.
18286						// call clamp with alwaysAllowEmpty
18287						inst[ cache ][ prop.idx ] = clamp( red[ key ], prop, true );
18288					} );
18289
18290					// Everything defined but alpha?
18291					if ( inst[ cache ] &&
18292							jQuery.inArray( null, inst[ cache ].slice( 0, 3 ) ) < 0 ) {
18293
18294						// Use the default of 1
18295						inst[ cache ][ 3 ] = 1;
18296						if ( space.from ) {
18297							inst._rgba = space.from( inst[ cache ] );
18298						}
18299					}
18300				} );
18301			}
18302			return this;
18303		}
18304	},
18305	is: function( compare ) {
18306		var is = color( compare ),
18307			same = true,
18308			inst = this;
18309
18310		each( spaces, function( _, space ) {
18311			var localCache,
18312				isCache = is[ space.cache ];
18313			if ( isCache ) {
18314				localCache = inst[ space.cache ] || space.to && space.to( inst._rgba ) || [];
18315				each( space.props, function( _, prop ) {
18316					if ( isCache[ prop.idx ] != null ) {
18317						same = ( isCache[ prop.idx ] === localCache[ prop.idx ] );
18318						return same;
18319					}
18320				} );
18321			}
18322			return same;
18323		} );
18324		return same;
18325	},
18326	_space: function() {
18327		var used = [],
18328			inst = this;
18329		each( spaces, function( spaceName, space ) {
18330			if ( inst[ space.cache ] ) {
18331				used.push( spaceName );
18332			}
18333		} );
18334		return used.pop();
18335	},
18336	transition: function( other, distance ) {
18337		var end = color( other ),
18338			spaceName = end._space(),
18339			space = spaces[ spaceName ],
18340			startColor = this.alpha() === 0 ? color( "transparent" ) : this,
18341			start = startColor[ space.cache ] || space.to( startColor._rgba ),
18342			result = start.slice();
18343
18344		end = end[ space.cache ];
18345		each( space.props, function( key, prop ) {
18346			var index = prop.idx,
18347				startValue = start[ index ],
18348				endValue = end[ index ],
18349				type = propTypes[ prop.type ] || {};
18350
18351			// If null, don't override start value
18352			if ( endValue === null ) {
18353				return;
18354			}
18355
18356			// If null - use end
18357			if ( startValue === null ) {
18358				result[ index ] = endValue;
18359			} else {
18360				if ( type.mod ) {
18361					if ( endValue - startValue > type.mod / 2 ) {
18362						startValue += type.mod;
18363					} else if ( startValue - endValue > type.mod / 2 ) {
18364						startValue -= type.mod;
18365					}
18366				}
18367				result[ index ] = clamp( ( endValue - startValue ) * distance + startValue, prop );
18368			}
18369		} );
18370		return this[ spaceName ]( result );
18371	},
18372	blend: function( opaque ) {
18373
18374		// If we are already opaque - return ourself
18375		if ( this._rgba[ 3 ] === 1 ) {
18376			return this;
18377		}
18378
18379		var rgb = this._rgba.slice(),
18380			a = rgb.pop(),
18381			blend = color( opaque )._rgba;
18382
18383		return color( jQuery.map( rgb, function( v, i ) {
18384			return ( 1 - a ) * blend[ i ] + a * v;
18385		} ) );
18386	},
18387	toRgbaString: function() {
18388		var prefix = "rgba(",
18389			rgba = jQuery.map( this._rgba, function( v, i ) {
18390				return v == null ? ( i > 2 ? 1 : 0 ) : v;
18391			} );
18392
18393		if ( rgba[ 3 ] === 1 ) {
18394			rgba.pop();
18395			prefix = "rgb(";
18396		}
18397
18398		return prefix + rgba.join() + ")";
18399	},
18400	toHslaString: function() {
18401		var prefix = "hsla(",
18402			hsla = jQuery.map( this.hsla(), function( v, i ) {
18403				if ( v == null ) {
18404					v = i > 2 ? 1 : 0;
18405				}
18406
18407				// Catch 1 and 2
18408				if ( i && i < 3 ) {
18409					v = Math.round( v * 100 ) + "%";
18410				}
18411				return v;
18412			} );
18413
18414		if ( hsla[ 3 ] === 1 ) {
18415			hsla.pop();
18416			prefix = "hsl(";
18417		}
18418		return prefix + hsla.join() + ")";
18419	},
18420	toHexString: function( includeAlpha ) {
18421		var rgba = this._rgba.slice(),
18422			alpha = rgba.pop();
18423
18424		if ( includeAlpha ) {
18425			rgba.push( ~~( alpha * 255 ) );
18426		}
18427
18428		return "#" + jQuery.map( rgba, function( v ) {
18429
18430			// Default to 0 when nulls exist
18431			v = ( v || 0 ).toString( 16 );
18432			return v.length === 1 ? "0" + v : v;
18433		} ).join( "" );
18434	},
18435	toString: function() {
18436		return this._rgba[ 3 ] === 0 ? "transparent" : this.toRgbaString();
18437	}
18438} );
18439color.fn.parse.prototype = color.fn;
18440
18441// Hsla conversions adapted from:
18442// https://code.google.com/p/maashaack/source/browse/packages/graphics/trunk/src/graphics/colors/HUE2RGB.as?r=5021
18443
18444function hue2rgb( p, q, h ) {
18445	h = ( h + 1 ) % 1;
18446	if ( h * 6 < 1 ) {
18447		return p + ( q - p ) * h * 6;
18448	}
18449	if ( h * 2 < 1 ) {
18450		return q;
18451	}
18452	if ( h * 3 < 2 ) {
18453		return p + ( q - p ) * ( ( 2 / 3 ) - h ) * 6;
18454	}
18455	return p;
18456}
18457
18458spaces.hsla.to = function( rgba ) {
18459	if ( rgba[ 0 ] == null || rgba[ 1 ] == null || rgba[ 2 ] == null ) {
18460		return [ null, null, null, rgba[ 3 ] ];
18461	}
18462	var r = rgba[ 0 ] / 255,
18463		g = rgba[ 1 ] / 255,
18464		b = rgba[ 2 ] / 255,
18465		a = rgba[ 3 ],
18466		max = Math.max( r, g, b ),
18467		min = Math.min( r, g, b ),
18468		diff = max - min,
18469		add = max + min,
18470		l = add * 0.5,
18471		h, s;
18472
18473	if ( min === max ) {
18474		h = 0;
18475	} else if ( r === max ) {
18476		h = ( 60 * ( g - b ) / diff ) + 360;
18477	} else if ( g === max ) {
18478		h = ( 60 * ( b - r ) / diff ) + 120;
18479	} else {
18480		h = ( 60 * ( r - g ) / diff ) + 240;
18481	}
18482
18483	// Chroma (diff) == 0 means greyscale which, by definition, saturation = 0%
18484	// otherwise, saturation is based on the ratio of chroma (diff) to lightness (add)
18485	if ( diff === 0 ) {
18486		s = 0;
18487	} else if ( l <= 0.5 ) {
18488		s = diff / add;
18489	} else {
18490		s = diff / ( 2 - add );
18491	}
18492	return [ Math.round( h ) % 360, s, l, a == null ? 1 : a ];
18493};
18494
18495spaces.hsla.from = function( hsla ) {
18496	if ( hsla[ 0 ] == null || hsla[ 1 ] == null || hsla[ 2 ] == null ) {
18497		return [ null, null, null, hsla[ 3 ] ];
18498	}
18499	var h = hsla[ 0 ] / 360,
18500		s = hsla[ 1 ],
18501		l = hsla[ 2 ],
18502		a = hsla[ 3 ],
18503		q = l <= 0.5 ? l * ( 1 + s ) : l + s - l * s,
18504		p = 2 * l - q;
18505
18506	return [
18507		Math.round( hue2rgb( p, q, h + ( 1 / 3 ) ) * 255 ),
18508		Math.round( hue2rgb( p, q, h ) * 255 ),
18509		Math.round( hue2rgb( p, q, h - ( 1 / 3 ) ) * 255 ),
18510		a
18511	];
18512};
18513
18514each( spaces, function( spaceName, space ) {
18515	var props = space.props,
18516		cache = space.cache,
18517		to = space.to,
18518		from = space.from;
18519
18520	// Makes rgba() and hsla()
18521	color.fn[ spaceName ] = function( value ) {
18522
18523		// Generate a cache for this space if it doesn't exist
18524		if ( to && !this[ cache ] ) {
18525			this[ cache ] = to( this._rgba );
18526		}
18527		if ( value === undefined ) {
18528			return this[ cache ].slice();
18529		}
18530
18531		var ret,
18532			type = jQuery.type( value ),
18533			arr = ( type === "array" || type === "object" ) ? value : arguments,
18534			local = this[ cache ].slice();
18535
18536		each( props, function( key, prop ) {
18537			var val = arr[ type === "object" ? key : prop.idx ];
18538			if ( val == null ) {
18539				val = local[ prop.idx ];
18540			}
18541			local[ prop.idx ] = clamp( val, prop );
18542		} );
18543
18544		if ( from ) {
18545			ret = color( from( local ) );
18546			ret[ cache ] = local;
18547			return ret;
18548		} else {
18549			return color( local );
18550		}
18551	};
18552
18553	// Makes red() green() blue() alpha() hue() saturation() lightness()
18554	each( props, function( key, prop ) {
18555
18556		// Alpha is included in more than one space
18557		if ( color.fn[ key ] ) {
18558			return;
18559		}
18560		color.fn[ key ] = function( value ) {
18561			var vtype = jQuery.type( value ),
18562				fn = ( key === "alpha" ? ( this._hsla ? "hsla" : "rgba" ) : spaceName ),
18563				local = this[ fn ](),
18564				cur = local[ prop.idx ],
18565				match;
18566
18567			if ( vtype === "undefined" ) {
18568				return cur;
18569			}
18570
18571			if ( vtype === "function" ) {
18572				value = value.call( this, cur );
18573				vtype = jQuery.type( value );
18574			}
18575			if ( value == null && prop.empty ) {
18576				return this;
18577			}
18578			if ( vtype === "string" ) {
18579				match = rplusequals.exec( value );
18580				if ( match ) {
18581					value = cur + parseFloat( match[ 2 ] ) * ( match[ 1 ] === "+" ? 1 : -1 );
18582				}
18583			}
18584			local[ prop.idx ] = value;
18585			return this[ fn ]( local );
18586		};
18587	} );
18588} );
18589
18590// Add cssHook and .fx.step function for each named hook.
18591// accept a space separated string of properties
18592color.hook = function( hook ) {
18593	var hooks = hook.split( " " );
18594	each( hooks, function( i, hook ) {
18595		jQuery.cssHooks[ hook ] = {
18596			set: function( elem, value ) {
18597				var parsed, curElem,
18598					backgroundColor = "";
18599
18600				if ( value !== "transparent" && ( jQuery.type( value ) !== "string" ||
18601						( parsed = stringParse( value ) ) ) ) {
18602					value = color( parsed || value );
18603					if ( !support.rgba && value._rgba[ 3 ] !== 1 ) {
18604						curElem = hook === "backgroundColor" ? elem.parentNode : elem;
18605						while (
18606							( backgroundColor === "" || backgroundColor === "transparent" ) &&
18607							curElem && curElem.style
18608						) {
18609							try {
18610								backgroundColor = jQuery.css( curElem, "backgroundColor" );
18611								curElem = curElem.parentNode;
18612							} catch ( e ) {
18613							}
18614						}
18615
18616						value = value.blend( backgroundColor && backgroundColor !== "transparent" ?
18617							backgroundColor :
18618							"_default" );
18619					}
18620
18621					value = value.toRgbaString();
18622				}
18623				try {
18624					elem.style[ hook ] = value;
18625				} catch ( e ) {
18626
18627					// Wrapped to prevent IE from throwing errors on "invalid" values like
18628					// 'auto' or 'inherit'
18629				}
18630			}
18631		};
18632		jQuery.fx.step[ hook ] = function( fx ) {
18633			if ( !fx.colorInit ) {
18634				fx.start = color( fx.elem, hook );
18635				fx.end = color( fx.end );
18636				fx.colorInit = true;
18637			}
18638			jQuery.cssHooks[ hook ].set( fx.elem, fx.start.transition( fx.end, fx.pos ) );
18639		};
18640	} );
18641
18642};
18643
18644color.hook( stepHooks );
18645
18646jQuery.cssHooks.borderColor = {
18647	expand: function( value ) {
18648		var expanded = {};
18649
18650		each( [ "Top", "Right", "Bottom", "Left" ], function( i, part ) {
18651			expanded[ "border" + part + "Color" ] = value;
18652		} );
18653		return expanded;
18654	}
18655};
18656
18657// Basic color names only.
18658// Usage of any of the other color names requires adding yourself or including
18659// jquery.color.svg-names.js.
18660colors = jQuery.Color.names = {
18661
18662	// 4.1. Basic color keywords
18663	aqua: "#00ffff",
18664	black: "#000000",
18665	blue: "#0000ff",
18666	fuchsia: "#ff00ff",
18667	gray: "#808080",
18668	green: "#008000",
18669	lime: "#00ff00",
18670	maroon: "#800000",
18671	navy: "#000080",
18672	olive: "#808000",
18673	purple: "#800080",
18674	red: "#ff0000",
18675	silver: "#c0c0c0",
18676	teal: "#008080",
18677	white: "#ffffff",
18678	yellow: "#ffff00",
18679
18680	// 4.2.3. "transparent" color keyword
18681	transparent: [ null, null, null, 0 ],
18682
18683	_default: "#ffffff"
18684};
18685
18686} )( jQuery );
18687
18688/******************************************************************************/
18689/****************************** CLASS ANIMATIONS ******************************/
18690/******************************************************************************/
18691( function() {
18692
18693var classAnimationActions = [ "add", "remove", "toggle" ],
18694	shorthandStyles = {
18695		border: 1,
18696		borderBottom: 1,
18697		borderColor: 1,
18698		borderLeft: 1,
18699		borderRight: 1,
18700		borderTop: 1,
18701		borderWidth: 1,
18702		margin: 1,
18703		padding: 1
18704	};
18705
18706$.each(
18707	[ "borderLeftStyle", "borderRightStyle", "borderBottomStyle", "borderTopStyle" ],
18708	function( _, prop ) {
18709		$.fx.step[ prop ] = function( fx ) {
18710			if ( fx.end !== "none" && !fx.setAttr || fx.pos === 1 && !fx.setAttr ) {
18711				jQuery.style( fx.elem, prop, fx.end );
18712				fx.setAttr = true;
18713			}
18714		};
18715	}
18716);
18717
18718function getElementStyles( elem ) {
18719	var key, len,
18720		style = elem.ownerDocument.defaultView ?
18721			elem.ownerDocument.defaultView.getComputedStyle( elem, null ) :
18722			elem.currentStyle,
18723		styles = {};
18724
18725	if ( style && style.length && style[ 0 ] && style[ style[ 0 ] ] ) {
18726		len = style.length;
18727		while ( len-- ) {
18728			key = style[ len ];
18729			if ( typeof style[ key ] === "string" ) {
18730				styles[ $.camelCase( key ) ] = style[ key ];
18731			}
18732		}
18733
18734	// Support: Opera, IE <9
18735	} else {
18736		for ( key in style ) {
18737			if ( typeof style[ key ] === "string" ) {
18738				styles[ key ] = style[ key ];
18739			}
18740		}
18741	}
18742
18743	return styles;
18744}
18745
18746function styleDifference( oldStyle, newStyle ) {
18747	var diff = {},
18748		name, value;
18749
18750	for ( name in newStyle ) {
18751		value = newStyle[ name ];
18752		if ( oldStyle[ name ] !== value ) {
18753			if ( !shorthandStyles[ name ] ) {
18754				if ( $.fx.step[ name ] || !isNaN( parseFloat( value ) ) ) {
18755					diff[ name ] = value;
18756				}
18757			}
18758		}
18759	}
18760
18761	return diff;
18762}
18763
18764// Support: jQuery <1.8
18765if ( !$.fn.addBack ) {
18766	$.fn.addBack = function( selector ) {
18767		return this.add( selector == null ?
18768			this.prevObject : this.prevObject.filter( selector )
18769		);
18770	};
18771}
18772
18773$.effects.animateClass = function( value, duration, easing, callback ) {
18774	var o = $.speed( duration, easing, callback );
18775
18776	return this.queue( function() {
18777		var animated = $( this ),
18778			baseClass = animated.attr( "class" ) || "",
18779			applyClassChange,
18780			allAnimations = o.children ? animated.find( "*" ).addBack() : animated;
18781
18782		// Map the animated objects to store the original styles.
18783		allAnimations = allAnimations.map( function() {
18784			var el = $( this );
18785			return {
18786				el: el,
18787				start: getElementStyles( this )
18788			};
18789		} );
18790
18791		// Apply class change
18792		applyClassChange = function() {
18793			$.each( classAnimationActions, function( i, action ) {
18794				if ( value[ action ] ) {
18795					animated[ action + "Class" ]( value[ action ] );
18796				}
18797			} );
18798		};
18799		applyClassChange();
18800
18801		// Map all animated objects again - calculate new styles and diff
18802		allAnimations = allAnimations.map( function() {
18803			this.end = getElementStyles( this.el[ 0 ] );
18804			this.diff = styleDifference( this.start, this.end );
18805			return this;
18806		} );
18807
18808		// Apply original class
18809		animated.attr( "class", baseClass );
18810
18811		// Map all animated objects again - this time collecting a promise
18812		allAnimations = allAnimations.map( function() {
18813			var styleInfo = this,
18814				dfd = $.Deferred(),
18815				opts = $.extend( {}, o, {
18816					queue: false,
18817					complete: function() {
18818						dfd.resolve( styleInfo );
18819					}
18820				} );
18821
18822			this.el.animate( this.diff, opts );
18823			return dfd.promise();
18824		} );
18825
18826		// Once all animations have completed:
18827		$.when.apply( $, allAnimations.get() ).done( function() {
18828
18829			// Set the final class
18830			applyClassChange();
18831
18832			// For each animated element,
18833			// clear all css properties that were animated
18834			$.each( arguments, function() {
18835				var el = this.el;
18836				$.each( this.diff, function( key ) {
18837					el.css( key, "" );
18838				} );
18839			} );
18840
18841			// This is guarnteed to be there if you use jQuery.speed()
18842			// it also handles dequeuing the next anim...
18843			o.complete.call( animated[ 0 ] );
18844		} );
18845	} );
18846};
18847
18848$.fn.extend( {
18849	addClass: ( function( orig ) {
18850		return function( classNames, speed, easing, callback ) {
18851			return speed ?
18852				$.effects.animateClass.call( this,
18853					{ add: classNames }, speed, easing, callback ) :
18854				orig.apply( this, arguments );
18855		};
18856	} )( $.fn.addClass ),
18857
18858	removeClass: ( function( orig ) {
18859		return function( classNames, speed, easing, callback ) {
18860			return arguments.length > 1 ?
18861				$.effects.animateClass.call( this,
18862					{ remove: classNames }, speed, easing, callback ) :
18863				orig.apply( this, arguments );
18864		};
18865	} )( $.fn.removeClass ),
18866
18867	toggleClass: ( function( orig ) {
18868		return function( classNames, force, speed, easing, callback ) {
18869			if ( typeof force === "boolean" || force === undefined ) {
18870				if ( !speed ) {
18871
18872					// Without speed parameter
18873					return orig.apply( this, arguments );
18874				} else {
18875					return $.effects.animateClass.call( this,
18876						( force ? { add: classNames } : { remove: classNames } ),
18877						speed, easing, callback );
18878				}
18879			} else {
18880
18881				// Without force parameter
18882				return $.effects.animateClass.call( this,
18883					{ toggle: classNames }, force, speed, easing );
18884			}
18885		};
18886	} )( $.fn.toggleClass ),
18887
18888	switchClass: function( remove, add, speed, easing, callback ) {
18889		return $.effects.animateClass.call( this, {
18890			add: add,
18891			remove: remove
18892		}, speed, easing, callback );
18893	}
18894} );
18895
18896} )();
18897
18898/******************************************************************************/
18899/*********************************** EFFECTS **********************************/
18900/******************************************************************************/
18901
18902( function() {
18903
18904if ( $.expr && $.expr.filters && $.expr.filters.animated ) {
18905	$.expr.filters.animated = ( function( orig ) {
18906		return function( elem ) {
18907			return !!$( elem ).data( dataSpaceAnimated ) || orig( elem );
18908		};
18909	} )( $.expr.filters.animated );
18910}
18911
18912if ( $.uiBackCompat !== false ) {
18913	$.extend( $.effects, {
18914
18915		// Saves a set of properties in a data storage
18916		save: function( element, set ) {
18917			var i = 0, length = set.length;
18918			for ( ; i < length; i++ ) {
18919				if ( set[ i ] !== null ) {
18920					element.data( dataSpace + set[ i ], element[ 0 ].style[ set[ i ] ] );
18921				}
18922			}
18923		},
18924
18925		// Restores a set of previously saved properties from a data storage
18926		restore: function( element, set ) {
18927			var val, i = 0, length = set.length;
18928			for ( ; i < length; i++ ) {
18929				if ( set[ i ] !== null ) {
18930					val = element.data( dataSpace + set[ i ] );
18931					element.css( set[ i ], val );
18932				}
18933			}
18934		},
18935
18936		setMode: function( el, mode ) {
18937			if ( mode === "toggle" ) {
18938				mode = el.is( ":hidden" ) ? "show" : "hide";
18939			}
18940			return mode;
18941		},
18942
18943		// Wraps the element around a wrapper that copies position properties
18944		createWrapper: function( element ) {
18945
18946			// If the element is already wrapped, return it
18947			if ( element.parent().is( ".ui-effects-wrapper" ) ) {
18948				return element.parent();
18949			}
18950
18951			// Wrap the element
18952			var props = {
18953					width: element.outerWidth( true ),
18954					height: element.outerHeight( true ),
18955					"float": element.css( "float" )
18956				},
18957				wrapper = $( "<div></div>" )
18958					.addClass( "ui-effects-wrapper" )
18959					.css( {
18960						fontSize: "100%",
18961						background: "transparent",
18962						border: "none",
18963						margin: 0,
18964						padding: 0
18965					} ),
18966
18967				// Store the size in case width/height are defined in % - Fixes #5245
18968				size = {
18969					width: element.width(),
18970					height: element.height()
18971				},
18972				active = document.activeElement;
18973
18974			// Support: Firefox
18975			// Firefox incorrectly exposes anonymous content
18976			// https://bugzilla.mozilla.org/show_bug.cgi?id=561664
18977			try {
18978				active.id;
18979			} catch ( e ) {
18980				active = document.body;
18981			}
18982
18983			element.wrap( wrapper );
18984
18985			// Fixes #7595 - Elements lose focus when wrapped.
18986			if ( element[ 0 ] === active || $.contains( element[ 0 ], active ) ) {
18987				$( active ).trigger( "focus" );
18988			}
18989
18990			// Hotfix for jQuery 1.4 since some change in wrap() seems to actually
18991			// lose the reference to the wrapped element
18992			wrapper = element.parent();
18993
18994			// Transfer positioning properties to the wrapper
18995			if ( element.css( "position" ) === "static" ) {
18996				wrapper.css( { position: "relative" } );
18997				element.css( { position: "relative" } );
18998			} else {
18999				$.extend( props, {
19000					position: element.css( "position" ),
19001					zIndex: element.css( "z-index" )
19002				} );
19003				$.each( [ "top", "left", "bottom", "right" ], function( i, pos ) {
19004					props[ pos ] = element.css( pos );
19005					if ( isNaN( parseInt( props[ pos ], 10 ) ) ) {
19006						props[ pos ] = "auto";
19007					}
19008				} );
19009				element.css( {
19010					position: "relative",
19011					top: 0,
19012					left: 0,
19013					right: "auto",
19014					bottom: "auto"
19015				} );
19016			}
19017			element.css( size );
19018
19019			return wrapper.css( props ).show();
19020		},
19021
19022		removeWrapper: function( element ) {
19023			var active = document.activeElement;
19024
19025			if ( element.parent().is( ".ui-effects-wrapper" ) ) {
19026				element.parent().replaceWith( element );
19027
19028				// Fixes #7595 - Elements lose focus when wrapped.
19029				if ( element[ 0 ] === active || $.contains( element[ 0 ], active ) ) {
19030					$( active ).trigger( "focus" );
19031				}
19032			}
19033
19034			return element;
19035		}
19036	} );
19037}
19038
19039$.extend( $.effects, {
19040	version: "1.12.1",
19041
19042	define: function( name, mode, effect ) {
19043		if ( !effect ) {
19044			effect = mode;
19045			mode = "effect";
19046		}
19047
19048		$.effects.effect[ name ] = effect;
19049		$.effects.effect[ name ].mode = mode;
19050
19051		return effect;
19052	},
19053
19054	scaledDimensions: function( element, percent, direction ) {
19055		if ( percent === 0 ) {
19056			return {
19057				height: 0,
19058				width: 0,
19059				outerHeight: 0,
19060				outerWidth: 0
19061			};
19062		}
19063
19064		var x = direction !== "horizontal" ? ( ( percent || 100 ) / 100 ) : 1,
19065			y = direction !== "vertical" ? ( ( percent || 100 ) / 100 ) : 1;
19066
19067		return {
19068			height: element.height() * y,
19069			width: element.width() * x,
19070			outerHeight: element.outerHeight() * y,
19071			outerWidth: element.outerWidth() * x
19072		};
19073
19074	},
19075
19076	clipToBox: function( animation ) {
19077		return {
19078			width: animation.clip.right - animation.clip.left,
19079			height: animation.clip.bottom - animation.clip.top,
19080			left: animation.clip.left,
19081			top: animation.clip.top
19082		};
19083	},
19084
19085	// Injects recently queued functions to be first in line (after "inprogress")
19086	unshift: function( element, queueLength, count ) {
19087		var queue = element.queue();
19088
19089		if ( queueLength > 1 ) {
19090			queue.splice.apply( queue,
19091				[ 1, 0 ].concat( queue.splice( queueLength, count ) ) );
19092		}
19093		element.dequeue();
19094	},
19095
19096	saveStyle: function( element ) {
19097		element.data( dataSpaceStyle, element[ 0 ].style.cssText );
19098	},
19099
19100	restoreStyle: function( element ) {
19101		element[ 0 ].style.cssText = element.data( dataSpaceStyle ) || "";
19102		element.removeData( dataSpaceStyle );
19103	},
19104
19105	mode: function( element, mode ) {
19106		var hidden = element.is( ":hidden" );
19107
19108		if ( mode === "toggle" ) {
19109			mode = hidden ? "show" : "hide";
19110		}
19111		if ( hidden ? mode === "hide" : mode === "show" ) {
19112			mode = "none";
19113		}
19114		return mode;
19115	},
19116
19117	// Translates a [top,left] array into a baseline value
19118	getBaseline: function( origin, original ) {
19119		var y, x;
19120
19121		switch ( origin[ 0 ] ) {
19122		case "top":
19123			y = 0;
19124			break;
19125		case "middle":
19126			y = 0.5;
19127			break;
19128		case "bottom":
19129			y = 1;
19130			break;
19131		default:
19132			y = origin[ 0 ] / original.height;
19133		}
19134
19135		switch ( origin[ 1 ] ) {
19136		case "left":
19137			x = 0;
19138			break;
19139		case "center":
19140			x = 0.5;
19141			break;
19142		case "right":
19143			x = 1;
19144			break;
19145		default:
19146			x = origin[ 1 ] / original.width;
19147		}
19148
19149		return {
19150			x: x,
19151			y: y
19152		};
19153	},
19154
19155	// Creates a placeholder element so that the original element can be made absolute
19156	createPlaceholder: function( element ) {
19157		var placeholder,
19158			cssPosition = element.css( "position" ),
19159			position = element.position();
19160
19161		// Lock in margins first to account for form elements, which
19162		// will change margin if you explicitly set height
19163		// see: http://jsfiddle.net/JZSMt/3/ https://bugs.webkit.org/show_bug.cgi?id=107380
19164		// Support: Safari
19165		element.css( {
19166			marginTop: element.css( "marginTop" ),
19167			marginBottom: element.css( "marginBottom" ),
19168			marginLeft: element.css( "marginLeft" ),
19169			marginRight: element.css( "marginRight" )
19170		} )
19171		.outerWidth( element.outerWidth() )
19172		.outerHeight( element.outerHeight() );
19173
19174		if ( /^(static|relative)/.test( cssPosition ) ) {
19175			cssPosition = "absolute";
19176
19177			placeholder = $( "<" + element[ 0 ].nodeName + ">" ).insertAfter( element ).css( {
19178
19179				// Convert inline to inline block to account for inline elements
19180				// that turn to inline block based on content (like img)
19181				display: /^(inline|ruby)/.test( element.css( "display" ) ) ?
19182					"inline-block" :
19183					"block",
19184				visibility: "hidden",
19185
19186				// Margins need to be set to account for margin collapse
19187				marginTop: element.css( "marginTop" ),
19188				marginBottom: element.css( "marginBottom" ),
19189				marginLeft: element.css( "marginLeft" ),
19190				marginRight: element.css( "marginRight" ),
19191				"float": element.css( "float" )
19192			} )
19193			.outerWidth( element.outerWidth() )
19194			.outerHeight( element.outerHeight() )
19195			.addClass( "ui-effects-placeholder" );
19196
19197			element.data( dataSpace + "placeholder", placeholder );
19198		}
19199
19200		element.css( {
19201			position: cssPosition,
19202			left: position.left,
19203			top: position.top
19204		} );
19205
19206		return placeholder;
19207	},
19208
19209	removePlaceholder: function( element ) {
19210		var dataKey = dataSpace + "placeholder",
19211				placeholder = element.data( dataKey );
19212
19213		if ( placeholder ) {
19214			placeholder.remove();
19215			element.removeData( dataKey );
19216		}
19217	},
19218
19219	// Removes a placeholder if it exists and restores
19220	// properties that were modified during placeholder creation
19221	cleanUp: function( element ) {
19222		$.effects.restoreStyle( element );
19223		$.effects.removePlaceholder( element );
19224	},
19225
19226	setTransition: function( element, list, factor, value ) {
19227		value = value || {};
19228		$.each( list, function( i, x ) {
19229			var unit = element.cssUnit( x );
19230			if ( unit[ 0 ] > 0 ) {
19231				value[ x ] = unit[ 0 ] * factor + unit[ 1 ];
19232			}
19233		} );
19234		return value;
19235	}
19236} );
19237
19238// Return an effect options object for the given parameters:
19239function _normalizeArguments( effect, options, speed, callback ) {
19240
19241	// Allow passing all options as the first parameter
19242	if ( $.isPlainObject( effect ) ) {
19243		options = effect;
19244		effect = effect.effect;
19245	}
19246
19247	// Convert to an object
19248	effect = { effect: effect };
19249
19250	// Catch (effect, null, ...)
19251	if ( options == null ) {
19252		options = {};
19253	}
19254
19255	// Catch (effect, callback)
19256	if ( $.isFunction( options ) ) {
19257		callback = options;
19258		speed = null;
19259		options = {};
19260	}
19261
19262	// Catch (effect, speed, ?)
19263	if ( typeof options === "number" || $.fx.speeds[ options ] ) {
19264		callback = speed;
19265		speed = options;
19266		options = {};
19267	}
19268
19269	// Catch (effect, options, callback)
19270	if ( $.isFunction( speed ) ) {
19271		callback = speed;
19272		speed = null;
19273	}
19274
19275	// Add options to effect
19276	if ( options ) {
19277		$.extend( effect, options );
19278	}
19279
19280	speed = speed || options.duration;
19281	effect.duration = $.fx.off ? 0 :
19282		typeof speed === "number" ? speed :
19283		speed in $.fx.speeds ? $.fx.speeds[ speed ] :
19284		$.fx.speeds._default;
19285
19286	effect.complete = callback || options.complete;
19287
19288	return effect;
19289}
19290
19291function standardAnimationOption( option ) {
19292
19293	// Valid standard speeds (nothing, number, named speed)
19294	if ( !option || typeof option === "number" || $.fx.speeds[ option ] ) {
19295		return true;
19296	}
19297
19298	// Invalid strings - treat as "normal" speed
19299	if ( typeof option === "string" && !$.effects.effect[ option ] ) {
19300		return true;
19301	}
19302
19303	// Complete callback
19304	if ( $.isFunction( option ) ) {
19305		return true;
19306	}
19307
19308	// Options hash (but not naming an effect)
19309	if ( typeof option === "object" && !option.effect ) {
19310		return true;
19311	}
19312
19313	// Didn't match any standard API
19314	return false;
19315}
19316
19317$.fn.extend( {
19318	effect: function( /* effect, options, speed, callback */ ) {
19319		var args = _normalizeArguments.apply( this, arguments ),
19320			effectMethod = $.effects.effect[ args.effect ],
19321			defaultMode = effectMethod.mode,
19322			queue = args.queue,
19323			queueName = queue || "fx",
19324			complete = args.complete,
19325			mode = args.mode,
19326			modes = [],
19327			prefilter = function( next ) {
19328				var el = $( this ),
19329					normalizedMode = $.effects.mode( el, mode ) || defaultMode;
19330
19331				// Sentinel for duck-punching the :animated psuedo-selector
19332				el.data( dataSpaceAnimated, true );
19333
19334				// Save effect mode for later use,
19335				// we can't just call $.effects.mode again later,
19336				// as the .show() below destroys the initial state
19337				modes.push( normalizedMode );
19338
19339				// See $.uiBackCompat inside of run() for removal of defaultMode in 1.13
19340				if ( defaultMode && ( normalizedMode === "show" ||
19341						( normalizedMode === defaultMode && normalizedMode === "hide" ) ) ) {
19342					el.show();
19343				}
19344
19345				if ( !defaultMode || normalizedMode !== "none" ) {
19346					$.effects.saveStyle( el );
19347				}
19348
19349				if ( $.isFunction( next ) ) {
19350					next();
19351				}
19352			};
19353
19354		if ( $.fx.off || !effectMethod ) {
19355
19356			// Delegate to the original method (e.g., .show()) if possible
19357			if ( mode ) {
19358				return this[ mode ]( args.duration, complete );
19359			} else {
19360				return this.each( function() {
19361					if ( complete ) {
19362						complete.call( this );
19363					}
19364				} );
19365			}
19366		}
19367
19368		function run( next ) {
19369			var elem = $( this );
19370
19371			function cleanup() {
19372				elem.removeData( dataSpaceAnimated );
19373
19374				$.effects.cleanUp( elem );
19375
19376				if ( args.mode === "hide" ) {
19377					elem.hide();
19378				}
19379
19380				done();
19381			}
19382
19383			function done() {
19384				if ( $.isFunction( complete ) ) {
19385					complete.call( elem[ 0 ] );
19386				}
19387
19388				if ( $.isFunction( next ) ) {
19389					next();
19390				}
19391			}
19392
19393			// Override mode option on a per element basis,
19394			// as toggle can be either show or hide depending on element state
19395			args.mode = modes.shift();
19396
19397			if ( $.uiBackCompat !== false && !defaultMode ) {
19398				if ( elem.is( ":hidden" ) ? mode === "hide" : mode === "show" ) {
19399
19400					// Call the core method to track "olddisplay" properly
19401					elem[ mode ]();
19402					done();
19403				} else {
19404					effectMethod.call( elem[ 0 ], args, done );
19405				}
19406			} else {
19407				if ( args.mode === "none" ) {
19408
19409					// Call the core method to track "olddisplay" properly
19410					elem[ mode ]();
19411					done();
19412				} else {
19413					effectMethod.call( elem[ 0 ], args, cleanup );
19414				}
19415			}
19416		}
19417
19418		// Run prefilter on all elements first to ensure that
19419		// any showing or hiding happens before placeholder creation,
19420		// which ensures that any layout changes are correctly captured.
19421		return queue === false ?
19422			this.each( prefilter ).each( run ) :
19423			this.queue( queueName, prefilter ).queue( queueName, run );
19424	},
19425
19426	show: ( function( orig ) {
19427		return function( option ) {
19428			if ( standardAnimationOption( option ) ) {
19429				return orig.apply( this, arguments );
19430			} else {
19431				var args = _normalizeArguments.apply( this, arguments );
19432				args.mode = "show";
19433				return this.effect.call( this, args );
19434			}
19435		};
19436	} )( $.fn.show ),
19437
19438	hide: ( function( orig ) {
19439		return function( option ) {
19440			if ( standardAnimationOption( option ) ) {
19441				return orig.apply( this, arguments );
19442			} else {
19443				var args = _normalizeArguments.apply( this, arguments );
19444				args.mode = "hide";
19445				return this.effect.call( this, args );
19446			}
19447		};
19448	} )( $.fn.hide ),
19449
19450	toggle: ( function( orig ) {
19451		return function( option ) {
19452			if ( standardAnimationOption( option ) || typeof option === "boolean" ) {
19453				return orig.apply( this, arguments );
19454			} else {
19455				var args = _normalizeArguments.apply( this, arguments );
19456				args.mode = "toggle";
19457				return this.effect.call( this, args );
19458			}
19459		};
19460	} )( $.fn.toggle ),
19461
19462	cssUnit: function( key ) {
19463		var style = this.css( key ),
19464			val = [];
19465
19466		$.each( [ "em", "px", "%", "pt" ], function( i, unit ) {
19467			if ( style.indexOf( unit ) > 0 ) {
19468				val = [ parseFloat( style ), unit ];
19469			}
19470		} );
19471		return val;
19472	},
19473
19474	cssClip: function( clipObj ) {
19475		if ( clipObj ) {
19476			return this.css( "clip", "rect(" + clipObj.top + "px " + clipObj.right + "px " +
19477				clipObj.bottom + "px " + clipObj.left + "px)" );
19478		}
19479		return parseClip( this.css( "clip" ), this );
19480	},
19481
19482	transfer: function( options, done ) {
19483		var element = $( this ),
19484			target = $( options.to ),
19485			targetFixed = target.css( "position" ) === "fixed",
19486			body = $( "body" ),
19487			fixTop = targetFixed ? body.scrollTop() : 0,
19488			fixLeft = targetFixed ? body.scrollLeft() : 0,
19489			endPosition = target.offset(),
19490			animation = {
19491				top: endPosition.top - fixTop,
19492				left: endPosition.left - fixLeft,
19493				height: target.innerHeight(),
19494				width: target.innerWidth()
19495			},
19496			startPosition = element.offset(),
19497			transfer = $( "<div class='ui-effects-transfer'></div>" )
19498				.appendTo( "body" )
19499				.addClass( options.className )
19500				.css( {
19501					top: startPosition.top - fixTop,
19502					left: startPosition.left - fixLeft,
19503					height: element.innerHeight(),
19504					width: element.innerWidth(),
19505					position: targetFixed ? "fixed" : "absolute"
19506				} )
19507				.animate( animation, options.duration, options.easing, function() {
19508					transfer.remove();
19509					if ( $.isFunction( done ) ) {
19510						done();
19511					}
19512				} );
19513	}
19514} );
19515
19516function parseClip( str, element ) {
19517		var outerWidth = element.outerWidth(),
19518			outerHeight = element.outerHeight(),
19519			clipRegex = /^rect\((-?\d*\.?\d*px|-?\d+%|auto),?\s*(-?\d*\.?\d*px|-?\d+%|auto),?\s*(-?\d*\.?\d*px|-?\d+%|auto),?\s*(-?\d*\.?\d*px|-?\d+%|auto)\)$/,
19520			values = clipRegex.exec( str ) || [ "", 0, outerWidth, outerHeight, 0 ];
19521
19522		return {
19523			top: parseFloat( values[ 1 ] ) || 0,
19524			right: values[ 2 ] === "auto" ? outerWidth : parseFloat( values[ 2 ] ),
19525			bottom: values[ 3 ] === "auto" ? outerHeight : parseFloat( values[ 3 ] ),
19526			left: parseFloat( values[ 4 ] ) || 0
19527		};
19528}
19529
19530$.fx.step.clip = function( fx ) {
19531	if ( !fx.clipInit ) {
19532		fx.start = $( fx.elem ).cssClip();
19533		if ( typeof fx.end === "string" ) {
19534			fx.end = parseClip( fx.end, fx.elem );
19535		}
19536		fx.clipInit = true;
19537	}
19538
19539	$( fx.elem ).cssClip( {
19540		top: fx.pos * ( fx.end.top - fx.start.top ) + fx.start.top,
19541		right: fx.pos * ( fx.end.right - fx.start.right ) + fx.start.right,
19542		bottom: fx.pos * ( fx.end.bottom - fx.start.bottom ) + fx.start.bottom,
19543		left: fx.pos * ( fx.end.left - fx.start.left ) + fx.start.left
19544	} );
19545};
19546
19547} )();
19548
19549/******************************************************************************/
19550/*********************************** EASING ***********************************/
19551/******************************************************************************/
19552
19553( function() {
19554
19555// Based on easing equations from Robert Penner (http://www.robertpenner.com/easing)
19556
19557var baseEasings = {};
19558
19559$.each( [ "Quad", "Cubic", "Quart", "Quint", "Expo" ], function( i, name ) {
19560	baseEasings[ name ] = function( p ) {
19561		return Math.pow( p, i + 2 );
19562	};
19563} );
19564
19565$.extend( baseEasings, {
19566	Sine: function( p ) {
19567		return 1 - Math.cos( p * Math.PI / 2 );
19568	},
19569	Circ: function( p ) {
19570		return 1 - Math.sqrt( 1 - p * p );
19571	},
19572	Elastic: function( p ) {
19573		return p === 0 || p === 1 ? p :
19574			-Math.pow( 2, 8 * ( p - 1 ) ) * Math.sin( ( ( p - 1 ) * 80 - 7.5 ) * Math.PI / 15 );
19575	},
19576	Back: function( p ) {
19577		return p * p * ( 3 * p - 2 );
19578	},
19579	Bounce: function( p ) {
19580		var pow2,
19581			bounce = 4;
19582
19583		while ( p < ( ( pow2 = Math.pow( 2, --bounce ) ) - 1 ) / 11 ) {}
19584		return 1 / Math.pow( 4, 3 - bounce ) - 7.5625 * Math.pow( ( pow2 * 3 - 2 ) / 22 - p, 2 );
19585	}
19586} );
19587
19588$.each( baseEasings, function( name, easeIn ) {
19589	$.easing[ "easeIn" + name ] = easeIn;
19590	$.easing[ "easeOut" + name ] = function( p ) {
19591		return 1 - easeIn( 1 - p );
19592	};
19593	$.easing[ "easeInOut" + name ] = function( p ) {
19594		return p < 0.5 ?
19595			easeIn( p * 2 ) / 2 :
19596			1 - easeIn( p * -2 + 2 ) / 2;
19597	};
19598} );
19599
19600} )();
19601
19602var effect = $.effects;
19603
19604
19605/*!
19606 * jQuery UI Effects Blind 1.12.1
19607 * http://jqueryui.com
19608 *
19609 * Copyright jQuery Foundation and other contributors
19610 * Released under the MIT license.
19611 * http://jquery.org/license
19612 */
19613
19614//>>label: Blind Effect
19615//>>group: Effects
19616//>>description: Blinds the element.
19617//>>docs: http://api.jqueryui.com/blind-effect/
19618//>>demos: http://jqueryui.com/effect/
19619
19620
19621
19622var effectsEffectBlind = $.effects.define( "blind", "hide", function( options, done ) {
19623	var map = {
19624			up: [ "bottom", "top" ],
19625			vertical: [ "bottom", "top" ],
19626			down: [ "top", "bottom" ],
19627			left: [ "right", "left" ],
19628			horizontal: [ "right", "left" ],
19629			right: [ "left", "right" ]
19630		},
19631		element = $( this ),
19632		direction = options.direction || "up",
19633		start = element.cssClip(),
19634		animate = { clip: $.extend( {}, start ) },
19635		placeholder = $.effects.createPlaceholder( element );
19636
19637	animate.clip[ map[ direction ][ 0 ] ] = animate.clip[ map[ direction ][ 1 ] ];
19638
19639	if ( options.mode === "show" ) {
19640		element.cssClip( animate.clip );
19641		if ( placeholder ) {
19642			placeholder.css( $.effects.clipToBox( animate ) );
19643		}
19644
19645		animate.clip = start;
19646	}
19647
19648	if ( placeholder ) {
19649		placeholder.animate( $.effects.clipToBox( animate ), options.duration, options.easing );
19650	}
19651
19652	element.animate( animate, {
19653		queue: false,
19654		duration: options.duration,
19655		easing: options.easing,
19656		complete: done
19657	} );
19658} );
19659
19660
19661/*!
19662 * jQuery UI Effects Bounce 1.12.1
19663 * http://jqueryui.com
19664 *
19665 * Copyright jQuery Foundation and other contributors
19666 * Released under the MIT license.
19667 * http://jquery.org/license
19668 */
19669
19670//>>label: Bounce Effect
19671//>>group: Effects
19672//>>description: Bounces an element horizontally or vertically n times.
19673//>>docs: http://api.jqueryui.com/bounce-effect/
19674//>>demos: http://jqueryui.com/effect/
19675
19676
19677
19678var effectsEffectBounce = $.effects.define( "bounce", function( options, done ) {
19679	var upAnim, downAnim, refValue,
19680		element = $( this ),
19681
19682		// Defaults:
19683		mode = options.mode,
19684		hide = mode === "hide",
19685		show = mode === "show",
19686		direction = options.direction || "up",
19687		distance = options.distance,
19688		times = options.times || 5,
19689
19690		// Number of internal animations
19691		anims = times * 2 + ( show || hide ? 1 : 0 ),
19692		speed = options.duration / anims,
19693		easing = options.easing,
19694
19695		// Utility:
19696		ref = ( direction === "up" || direction === "down" ) ? "top" : "left",
19697		motion = ( direction === "up" || direction === "left" ),
19698		i = 0,
19699
19700		queuelen = element.queue().length;
19701
19702	$.effects.createPlaceholder( element );
19703
19704	refValue = element.css( ref );
19705
19706	// Default distance for the BIGGEST bounce is the outer Distance / 3
19707	if ( !distance ) {
19708		distance = element[ ref === "top" ? "outerHeight" : "outerWidth" ]() / 3;
19709	}
19710
19711	if ( show ) {
19712		downAnim = { opacity: 1 };
19713		downAnim[ ref ] = refValue;
19714
19715		// If we are showing, force opacity 0 and set the initial position
19716		// then do the "first" animation
19717		element
19718			.css( "opacity", 0 )
19719			.css( ref, motion ? -distance * 2 : distance * 2 )
19720			.animate( downAnim, speed, easing );
19721	}
19722
19723	// Start at the smallest distance if we are hiding
19724	if ( hide ) {
19725		distance = distance / Math.pow( 2, times - 1 );
19726	}
19727
19728	downAnim = {};
19729	downAnim[ ref ] = refValue;
19730
19731	// Bounces up/down/left/right then back to 0 -- times * 2 animations happen here
19732	for ( ; i < times; i++ ) {
19733		upAnim = {};
19734		upAnim[ ref ] = ( motion ? "-=" : "+=" ) + distance;
19735
19736		element
19737			.animate( upAnim, speed, easing )
19738			.animate( downAnim, speed, easing );
19739
19740		distance = hide ? distance * 2 : distance / 2;
19741	}
19742
19743	// Last Bounce when Hiding
19744	if ( hide ) {
19745		upAnim = { opacity: 0 };
19746		upAnim[ ref ] = ( motion ? "-=" : "+=" ) + distance;
19747
19748		element.animate( upAnim, speed, easing );
19749	}
19750
19751	element.queue( done );
19752
19753	$.effects.unshift( element, queuelen, anims + 1 );
19754} );
19755
19756
19757/*!
19758 * jQuery UI Effects Clip 1.12.1
19759 * http://jqueryui.com
19760 *
19761 * Copyright jQuery Foundation and other contributors
19762 * Released under the MIT license.
19763 * http://jquery.org/license
19764 */
19765
19766//>>label: Clip Effect
19767//>>group: Effects
19768//>>description: Clips the element on and off like an old TV.
19769//>>docs: http://api.jqueryui.com/clip-effect/
19770//>>demos: http://jqueryui.com/effect/
19771
19772
19773
19774var effectsEffectClip = $.effects.define( "clip", "hide", function( options, done ) {
19775	var start,
19776		animate = {},
19777		element = $( this ),
19778		direction = options.direction || "vertical",
19779		both = direction === "both",
19780		horizontal = both || direction === "horizontal",
19781		vertical = both || direction === "vertical";
19782
19783	start = element.cssClip();
19784	animate.clip = {
19785		top: vertical ? ( start.bottom - start.top ) / 2 : start.top,
19786		right: horizontal ? ( start.right - start.left ) / 2 : start.right,
19787		bottom: vertical ? ( start.bottom - start.top ) / 2 : start.bottom,
19788		left: horizontal ? ( start.right - start.left ) / 2 : start.left
19789	};
19790
19791	$.effects.createPlaceholder( element );
19792
19793	if ( options.mode === "show" ) {
19794		element.cssClip( animate.clip );
19795		animate.clip = start;
19796	}
19797
19798	element.animate( animate, {
19799		queue: false,
19800		duration: options.duration,
19801		easing: options.easing,
19802		complete: done
19803	} );
19804
19805} );
19806
19807
19808/*!
19809 * jQuery UI Effects Drop 1.12.1
19810 * http://jqueryui.com
19811 *
19812 * Copyright jQuery Foundation and other contributors
19813 * Released under the MIT license.
19814 * http://jquery.org/license
19815 */
19816
19817//>>label: Drop Effect
19818//>>group: Effects
19819//>>description: Moves an element in one direction and hides it at the same time.
19820//>>docs: http://api.jqueryui.com/drop-effect/
19821//>>demos: http://jqueryui.com/effect/
19822
19823
19824
19825var effectsEffectDrop = $.effects.define( "drop", "hide", function( options, done ) {
19826
19827	var distance,
19828		element = $( this ),
19829		mode = options.mode,
19830		show = mode === "show",
19831		direction = options.direction || "left",
19832		ref = ( direction === "up" || direction === "down" ) ? "top" : "left",
19833		motion = ( direction === "up" || direction === "left" ) ? "-=" : "+=",
19834		oppositeMotion = ( motion === "+=" ) ? "-=" : "+=",
19835		animation = {
19836			opacity: 0
19837		};
19838
19839	$.effects.createPlaceholder( element );
19840
19841	distance = options.distance ||
19842		element[ ref === "top" ? "outerHeight" : "outerWidth" ]( true ) / 2;
19843
19844	animation[ ref ] = motion + distance;
19845
19846	if ( show ) {
19847		element.css( animation );
19848
19849		animation[ ref ] = oppositeMotion + distance;
19850		animation.opacity = 1;
19851	}
19852
19853	// Animate
19854	element.animate( animation, {
19855		queue: false,
19856		duration: options.duration,
19857		easing: options.easing,
19858		complete: done
19859	} );
19860} );
19861
19862
19863/*!
19864 * jQuery UI Effects Explode 1.12.1
19865 * http://jqueryui.com
19866 *
19867 * Copyright jQuery Foundation and other contributors
19868 * Released under the MIT license.
19869 * http://jquery.org/license
19870 */
19871
19872//>>label: Explode Effect
19873//>>group: Effects
19874// jscs:disable maximumLineLength
19875//>>description: Explodes an element in all directions into n pieces. Implodes an element to its original wholeness.
19876// jscs:enable maximumLineLength
19877//>>docs: http://api.jqueryui.com/explode-effect/
19878//>>demos: http://jqueryui.com/effect/
19879
19880
19881
19882var effectsEffectExplode = $.effects.define( "explode", "hide", function( options, done ) {
19883
19884	var i, j, left, top, mx, my,
19885		rows = options.pieces ? Math.round( Math.sqrt( options.pieces ) ) : 3,
19886		cells = rows,
19887		element = $( this ),
19888		mode = options.mode,
19889		show = mode === "show",
19890
19891		// Show and then visibility:hidden the element before calculating offset
19892		offset = element.show().css( "visibility", "hidden" ).offset(),
19893
19894		// Width and height of a piece
19895		width = Math.ceil( element.outerWidth() / cells ),
19896		height = Math.ceil( element.outerHeight() / rows ),
19897		pieces = [];
19898
19899	// Children animate complete:
19900	function childComplete() {
19901		pieces.push( this );
19902		if ( pieces.length === rows * cells ) {
19903			animComplete();
19904		}
19905	}
19906
19907	// Clone the element for each row and cell.
19908	for ( i = 0; i < rows; i++ ) { // ===>
19909		top = offset.top + i * height;
19910		my = i - ( rows - 1 ) / 2;
19911
19912		for ( j = 0; j < cells; j++ ) { // |||
19913			left = offset.left + j * width;
19914			mx = j - ( cells - 1 ) / 2;
19915
19916			// Create a clone of the now hidden main element that will be absolute positioned
19917			// within a wrapper div off the -left and -top equal to size of our pieces
19918			element
19919				.clone()
19920				.appendTo( "body" )
19921				.wrap( "<div></div>" )
19922				.css( {
19923					position: "absolute",
19924					visibility: "visible",
19925					left: -j * width,
19926					top: -i * height
19927				} )
19928
19929				// Select the wrapper - make it overflow: hidden and absolute positioned based on
19930				// where the original was located +left and +top equal to the size of pieces
19931				.parent()
19932					.addClass( "ui-effects-explode" )
19933					.css( {
19934						position: "absolute",
19935						overflow: "hidden",
19936						width: width,
19937						height: height,
19938						left: left + ( show ? mx * width : 0 ),
19939						top: top + ( show ? my * height : 0 ),
19940						opacity: show ? 0 : 1
19941					} )
19942					.animate( {
19943						left: left + ( show ? 0 : mx * width ),
19944						top: top + ( show ? 0 : my * height ),
19945						opacity: show ? 1 : 0
19946					}, options.duration || 500, options.easing, childComplete );
19947		}
19948	}
19949
19950	function animComplete() {
19951		element.css( {
19952			visibility: "visible"
19953		} );
19954		$( pieces ).remove();
19955		done();
19956	}
19957} );
19958
19959
19960/*!
19961 * jQuery UI Effects Fade 1.12.1
19962 * http://jqueryui.com
19963 *
19964 * Copyright jQuery Foundation and other contributors
19965 * Released under the MIT license.
19966 * http://jquery.org/license
19967 */
19968
19969//>>label: Fade Effect
19970//>>group: Effects
19971//>>description: Fades the element.
19972//>>docs: http://api.jqueryui.com/fade-effect/
19973//>>demos: http://jqueryui.com/effect/
19974
19975
19976
19977var effectsEffectFade = $.effects.define( "fade", "toggle", function( options, done ) {
19978	var show = options.mode === "show";
19979
19980	$( this )
19981		.css( "opacity", show ? 0 : 1 )
19982		.animate( {
19983			opacity: show ? 1 : 0
19984		}, {
19985			queue: false,
19986			duration: options.duration,
19987			easing: options.easing,
19988			complete: done
19989		} );
19990} );
19991
19992
19993/*!
19994 * jQuery UI Effects Fold 1.12.1
19995 * http://jqueryui.com
19996 *
19997 * Copyright jQuery Foundation and other contributors
19998 * Released under the MIT license.
19999 * http://jquery.org/license
20000 */
20001
20002//>>label: Fold Effect
20003//>>group: Effects
20004//>>description: Folds an element first horizontally and then vertically.
20005//>>docs: http://api.jqueryui.com/fold-effect/
20006//>>demos: http://jqueryui.com/effect/
20007
20008
20009
20010var effectsEffectFold = $.effects.define( "fold", "hide", function( options, done ) {
20011
20012	// Create element
20013	var element = $( this ),
20014		mode = options.mode,
20015		show = mode === "show",
20016		hide = mode === "hide",
20017		size = options.size || 15,
20018		percent = /([0-9]+)%/.exec( size ),
20019		horizFirst = !!options.horizFirst,
20020		ref = horizFirst ? [ "right", "bottom" ] : [ "bottom", "right" ],
20021		duration = options.duration / 2,
20022
20023		placeholder = $.effects.createPlaceholder( element ),
20024
20025		start = element.cssClip(),
20026		animation1 = { clip: $.extend( {}, start ) },
20027		animation2 = { clip: $.extend( {}, start ) },
20028
20029		distance = [ start[ ref[ 0 ] ], start[ ref[ 1 ] ] ],
20030
20031		queuelen = element.queue().length;
20032
20033	if ( percent ) {
20034		size = parseInt( percent[ 1 ], 10 ) / 100 * distance[ hide ? 0 : 1 ];
20035	}
20036	animation1.clip[ ref[ 0 ] ] = size;
20037	animation2.clip[ ref[ 0 ] ] = size;
20038	animation2.clip[ ref[ 1 ] ] = 0;
20039
20040	if ( show ) {
20041		element.cssClip( animation2.clip );
20042		if ( placeholder ) {
20043			placeholder.css( $.effects.clipToBox( animation2 ) );
20044		}
20045
20046		animation2.clip = start;
20047	}
20048
20049	// Animate
20050	element
20051		.queue( function( next ) {
20052			if ( placeholder ) {
20053				placeholder
20054					.animate( $.effects.clipToBox( animation1 ), duration, options.easing )
20055					.animate( $.effects.clipToBox( animation2 ), duration, options.easing );
20056			}
20057
20058			next();
20059		} )
20060		.animate( animation1, duration, options.easing )
20061		.animate( animation2, duration, options.easing )
20062		.queue( done );
20063
20064	$.effects.unshift( element, queuelen, 4 );
20065} );
20066
20067
20068/*!
20069 * jQuery UI Effects Highlight 1.12.1
20070 * http://jqueryui.com
20071 *
20072 * Copyright jQuery Foundation and other contributors
20073 * Released under the MIT license.
20074 * http://jquery.org/license
20075 */
20076
20077//>>label: Highlight Effect
20078//>>group: Effects
20079//>>description: Highlights the background of an element in a defined color for a custom duration.
20080//>>docs: http://api.jqueryui.com/highlight-effect/
20081//>>demos: http://jqueryui.com/effect/
20082
20083
20084
20085var effectsEffectHighlight = $.effects.define( "highlight", "show", function( options, done ) {
20086	var element = $( this ),
20087		animation = {
20088			backgroundColor: element.css( "backgroundColor" )
20089		};
20090
20091	if ( options.mode === "hide" ) {
20092		animation.opacity = 0;
20093	}
20094
20095	$.effects.saveStyle( element );
20096
20097	element
20098		.css( {
20099			backgroundImage: "none",
20100			backgroundColor: options.color || "#ffff99"
20101		} )
20102		.animate( animation, {
20103			queue: false,
20104			duration: options.duration,
20105			easing: options.easing,
20106			complete: done
20107		} );
20108} );
20109
20110
20111/*!
20112 * jQuery UI Effects Size 1.12.1
20113 * http://jqueryui.com
20114 *
20115 * Copyright jQuery Foundation and other contributors
20116 * Released under the MIT license.
20117 * http://jquery.org/license
20118 */
20119
20120//>>label: Size Effect
20121//>>group: Effects
20122//>>description: Resize an element to a specified width and height.
20123//>>docs: http://api.jqueryui.com/size-effect/
20124//>>demos: http://jqueryui.com/effect/
20125
20126
20127
20128var effectsEffectSize = $.effects.define( "size", function( options, done ) {
20129
20130	// Create element
20131	var baseline, factor, temp,
20132		element = $( this ),
20133
20134		// Copy for children
20135		cProps = [ "fontSize" ],
20136		vProps = [ "borderTopWidth", "borderBottomWidth", "paddingTop", "paddingBottom" ],
20137		hProps = [ "borderLeftWidth", "borderRightWidth", "paddingLeft", "paddingRight" ],
20138
20139		// Set options
20140		mode = options.mode,
20141		restore = mode !== "effect",
20142		scale = options.scale || "both",
20143		origin = options.origin || [ "middle", "center" ],
20144		position = element.css( "position" ),
20145		pos = element.position(),
20146		original = $.effects.scaledDimensions( element ),
20147		from = options.from || original,
20148		to = options.to || $.effects.scaledDimensions( element, 0 );
20149
20150	$.effects.createPlaceholder( element );
20151
20152	if ( mode === "show" ) {
20153		temp = from;
20154		from = to;
20155		to = temp;
20156	}
20157
20158	// Set scaling factor
20159	factor = {
20160		from: {
20161			y: from.height / original.height,
20162			x: from.width / original.width
20163		},
20164		to: {
20165			y: to.height / original.height,
20166			x: to.width / original.width
20167		}
20168	};
20169
20170	// Scale the css box
20171	if ( scale === "box" || scale === "both" ) {
20172
20173		// Vertical props scaling
20174		if ( factor.from.y !== factor.to.y ) {
20175			from = $.effects.setTransition( element, vProps, factor.from.y, from );
20176			to = $.effects.setTransition( element, vProps, factor.to.y, to );
20177		}
20178
20179		// Horizontal props scaling
20180		if ( factor.from.x !== factor.to.x ) {
20181			from = $.effects.setTransition( element, hProps, factor.from.x, from );
20182			to = $.effects.setTransition( element, hProps, factor.to.x, to );
20183		}
20184	}
20185
20186	// Scale the content
20187	if ( scale === "content" || scale === "both" ) {
20188
20189		// Vertical props scaling
20190		if ( factor.from.y !== factor.to.y ) {
20191			from = $.effects.setTransition( element, cProps, factor.from.y, from );
20192			to = $.effects.setTransition( element, cProps, factor.to.y, to );
20193		}
20194	}
20195
20196	// Adjust the position properties based on the provided origin points
20197	if ( origin ) {
20198		baseline = $.effects.getBaseline( origin, original );
20199		from.top = ( original.outerHeight - from.outerHeight ) * baseline.y + pos.top;
20200		from.left = ( original.outerWidth - from.outerWidth ) * baseline.x + pos.left;
20201		to.top = ( original.outerHeight - to.outerHeight ) * baseline.y + pos.top;
20202		to.left = ( original.outerWidth - to.outerWidth ) * baseline.x + pos.left;
20203	}
20204	element.css( from );
20205
20206	// Animate the children if desired
20207	if ( scale === "content" || scale === "both" ) {
20208
20209		vProps = vProps.concat( [ "marginTop", "marginBottom" ] ).concat( cProps );
20210		hProps = hProps.concat( [ "marginLeft", "marginRight" ] );
20211
20212		// Only animate children with width attributes specified
20213		// TODO: is this right? should we include anything with css width specified as well
20214		element.find( "*[width]" ).each( function() {
20215			var child = $( this ),
20216				childOriginal = $.effects.scaledDimensions( child ),
20217				childFrom = {
20218					height: childOriginal.height * factor.from.y,
20219					width: childOriginal.width * factor.from.x,
20220					outerHeight: childOriginal.outerHeight * factor.from.y,
20221					outerWidth: childOriginal.outerWidth * factor.from.x
20222				},
20223				childTo = {
20224					height: childOriginal.height * factor.to.y,
20225					width: childOriginal.width * factor.to.x,
20226					outerHeight: childOriginal.height * factor.to.y,
20227					outerWidth: childOriginal.width * factor.to.x
20228				};
20229
20230			// Vertical props scaling
20231			if ( factor.from.y !== factor.to.y ) {
20232				childFrom = $.effects.setTransition( child, vProps, factor.from.y, childFrom );
20233				childTo = $.effects.setTransition( child, vProps, factor.to.y, childTo );
20234			}
20235
20236			// Horizontal props scaling
20237			if ( factor.from.x !== factor.to.x ) {
20238				childFrom = $.effects.setTransition( child, hProps, factor.from.x, childFrom );
20239				childTo = $.effects.setTransition( child, hProps, factor.to.x, childTo );
20240			}
20241
20242			if ( restore ) {
20243				$.effects.saveStyle( child );
20244			}
20245
20246			// Animate children
20247			child.css( childFrom );
20248			child.animate( childTo, options.duration, options.easing, function() {
20249
20250				// Restore children
20251				if ( restore ) {
20252					$.effects.restoreStyle( child );
20253				}
20254			} );
20255		} );
20256	}
20257
20258	// Animate
20259	element.animate( to, {
20260		queue: false,
20261		duration: options.duration,
20262		easing: options.easing,
20263		complete: function() {
20264
20265			var offset = element.offset();
20266
20267			if ( to.opacity === 0 ) {
20268				element.css( "opacity", from.opacity );
20269			}
20270
20271			if ( !restore ) {
20272				element
20273					.css( "position", position === "static" ? "relative" : position )
20274					.offset( offset );
20275
20276				// Need to save style here so that automatic style restoration
20277				// doesn't restore to the original styles from before the animation.
20278				$.effects.saveStyle( element );
20279			}
20280
20281			done();
20282		}
20283	} );
20284
20285} );
20286
20287
20288/*!
20289 * jQuery UI Effects Scale 1.12.1
20290 * http://jqueryui.com
20291 *
20292 * Copyright jQuery Foundation and other contributors
20293 * Released under the MIT license.
20294 * http://jquery.org/license
20295 */
20296
20297//>>label: Scale Effect
20298//>>group: Effects
20299//>>description: Grows or shrinks an element and its content.
20300//>>docs: http://api.jqueryui.com/scale-effect/
20301//>>demos: http://jqueryui.com/effect/
20302
20303
20304
20305var effectsEffectScale = $.effects.define( "scale", function( options, done ) {
20306
20307	// Create element
20308	var el = $( this ),
20309		mode = options.mode,
20310		percent = parseInt( options.percent, 10 ) ||
20311			( parseInt( options.percent, 10 ) === 0 ? 0 : ( mode !== "effect" ? 0 : 100 ) ),
20312
20313		newOptions = $.extend( true, {
20314			from: $.effects.scaledDimensions( el ),
20315			to: $.effects.scaledDimensions( el, percent, options.direction || "both" ),
20316			origin: options.origin || [ "middle", "center" ]
20317		}, options );
20318
20319	// Fade option to support puff
20320	if ( options.fade ) {
20321		newOptions.from.opacity = 1;
20322		newOptions.to.opacity = 0;
20323	}
20324
20325	$.effects.effect.size.call( this, newOptions, done );
20326} );
20327
20328
20329/*!
20330 * jQuery UI Effects Puff 1.12.1
20331 * http://jqueryui.com
20332 *
20333 * Copyright jQuery Foundation and other contributors
20334 * Released under the MIT license.
20335 * http://jquery.org/license
20336 */
20337
20338//>>label: Puff Effect
20339//>>group: Effects
20340//>>description: Creates a puff effect by scaling the element up and hiding it at the same time.
20341//>>docs: http://api.jqueryui.com/puff-effect/
20342//>>demos: http://jqueryui.com/effect/
20343
20344
20345
20346var effectsEffectPuff = $.effects.define( "puff", "hide", function( options, done ) {
20347	var newOptions = $.extend( true, {}, options, {
20348		fade: true,
20349		percent: parseInt( options.percent, 10 ) || 150
20350	} );
20351
20352	$.effects.effect.scale.call( this, newOptions, done );
20353} );
20354
20355
20356/*!
20357 * jQuery UI Effects Pulsate 1.12.1
20358 * http://jqueryui.com
20359 *
20360 * Copyright jQuery Foundation and other contributors
20361 * Released under the MIT license.
20362 * http://jquery.org/license
20363 */
20364
20365//>>label: Pulsate Effect
20366//>>group: Effects
20367//>>description: Pulsates an element n times by changing the opacity to zero and back.
20368//>>docs: http://api.jqueryui.com/pulsate-effect/
20369//>>demos: http://jqueryui.com/effect/
20370
20371
20372
20373var effectsEffectPulsate = $.effects.define( "pulsate", "show", function( options, done ) {
20374	var element = $( this ),
20375		mode = options.mode,
20376		show = mode === "show",
20377		hide = mode === "hide",
20378		showhide = show || hide,
20379
20380		// Showing or hiding leaves off the "last" animation
20381		anims = ( ( options.times || 5 ) * 2 ) + ( showhide ? 1 : 0 ),
20382		duration = options.duration / anims,
20383		animateTo = 0,
20384		i = 1,
20385		queuelen = element.queue().length;
20386
20387	if ( show || !element.is( ":visible" ) ) {
20388		element.css( "opacity", 0 ).show();
20389		animateTo = 1;
20390	}
20391
20392	// Anims - 1 opacity "toggles"
20393	for ( ; i < anims; i++ ) {
20394		element.animate( { opacity: animateTo }, duration, options.easing );
20395		animateTo = 1 - animateTo;
20396	}
20397
20398	element.animate( { opacity: animateTo }, duration, options.easing );
20399
20400	element.queue( done );
20401
20402	$.effects.unshift( element, queuelen, anims + 1 );
20403} );
20404
20405
20406/*!
20407 * jQuery UI Effects Shake 1.12.1
20408 * http://jqueryui.com
20409 *
20410 * Copyright jQuery Foundation and other contributors
20411 * Released under the MIT license.
20412 * http://jquery.org/license
20413 */
20414
20415//>>label: Shake Effect
20416//>>group: Effects
20417//>>description: Shakes an element horizontally or vertically n times.
20418//>>docs: http://api.jqueryui.com/shake-effect/
20419//>>demos: http://jqueryui.com/effect/
20420
20421
20422
20423var effectsEffectShake = $.effects.define( "shake", function( options, done ) {
20424
20425	var i = 1,
20426		element = $( this ),
20427		direction = options.direction || "left",
20428		distance = options.distance || 20,
20429		times = options.times || 3,
20430		anims = times * 2 + 1,
20431		speed = Math.round( options.duration / anims ),
20432		ref = ( direction === "up" || direction === "down" ) ? "top" : "left",
20433		positiveMotion = ( direction === "up" || direction === "left" ),
20434		animation = {},
20435		animation1 = {},
20436		animation2 = {},
20437
20438		queuelen = element.queue().length;
20439
20440	$.effects.createPlaceholder( element );
20441
20442	// Animation
20443	animation[ ref ] = ( positiveMotion ? "-=" : "+=" ) + distance;
20444	animation1[ ref ] = ( positiveMotion ? "+=" : "-=" ) + distance * 2;
20445	animation2[ ref ] = ( positiveMotion ? "-=" : "+=" ) + distance * 2;
20446
20447	// Animate
20448	element.animate( animation, speed, options.easing );
20449
20450	// Shakes
20451	for ( ; i < times; i++ ) {
20452		element
20453			.animate( animation1, speed, options.easing )
20454			.animate( animation2, speed, options.easing );
20455	}
20456
20457	element
20458		.animate( animation1, speed, options.easing )
20459		.animate( animation, speed / 2, options.easing )
20460		.queue( done );
20461
20462	$.effects.unshift( element, queuelen, anims + 1 );
20463} );
20464
20465
20466/*!
20467 * jQuery UI Effects Slide 1.12.1
20468 * http://jqueryui.com
20469 *
20470 * Copyright jQuery Foundation and other contributors
20471 * Released under the MIT license.
20472 * http://jquery.org/license
20473 */
20474
20475//>>label: Slide Effect
20476//>>group: Effects
20477//>>description: Slides an element in and out of the viewport.
20478//>>docs: http://api.jqueryui.com/slide-effect/
20479//>>demos: http://jqueryui.com/effect/
20480
20481
20482
20483var effectsEffectSlide = $.effects.define( "slide", "show", function( options, done ) {
20484	var startClip, startRef,
20485		element = $( this ),
20486		map = {
20487			up: [ "bottom", "top" ],
20488			down: [ "top", "bottom" ],
20489			left: [ "right", "left" ],
20490			right: [ "left", "right" ]
20491		},
20492		mode = options.mode,
20493		direction = options.direction || "left",
20494		ref = ( direction === "up" || direction === "down" ) ? "top" : "left",
20495		positiveMotion = ( direction === "up" || direction === "left" ),
20496		distance = options.distance ||
20497			element[ ref === "top" ? "outerHeight" : "outerWidth" ]( true ),
20498		animation = {};
20499
20500	$.effects.createPlaceholder( element );
20501
20502	startClip = element.cssClip();
20503	startRef = element.position()[ ref ];
20504
20505	// Define hide animation
20506	animation[ ref ] = ( positiveMotion ? -1 : 1 ) * distance + startRef;
20507	animation.clip = element.cssClip();
20508	animation.clip[ map[ direction ][ 1 ] ] = animation.clip[ map[ direction ][ 0 ] ];
20509
20510	// Reverse the animation if we're showing
20511	if ( mode === "show" ) {
20512		element.cssClip( animation.clip );
20513		element.css( ref, animation[ ref ] );
20514		animation.clip = startClip;
20515		animation[ ref ] = startRef;
20516	}
20517
20518	// Actually animate
20519	element.animate( animation, {
20520		queue: false,
20521		duration: options.duration,
20522		easing: options.easing,
20523		complete: done
20524	} );
20525} );
20526
20527
20528/*!
20529 * jQuery UI Effects Transfer 1.12.1
20530 * http://jqueryui.com
20531 *
20532 * Copyright jQuery Foundation and other contributors
20533 * Released under the MIT license.
20534 * http://jquery.org/license
20535 */
20536
20537//>>label: Transfer Effect
20538//>>group: Effects
20539//>>description: Displays a transfer effect from one element to another.
20540//>>docs: http://api.jqueryui.com/transfer-effect/
20541//>>demos: http://jqueryui.com/effect/
20542
20543
20544
20545var effect;
20546if ( $.uiBackCompat !== false ) {
20547	effect = $.effects.define( "transfer", function( options, done ) {
20548		$( this ).transfer( options, done );
20549	} );
20550}
20551var effectsEffectTransfer = effect;
20552
20553
20554/*!
20555 * jQuery UI Focusable 1.12.1
20556 * http://jqueryui.com
20557 *
20558 * Copyright jQuery Foundation and other contributors
20559 * Released under the MIT license.
20560 * http://jquery.org/license
20561 */
20562
20563//>>label: :focusable Selector
20564//>>group: Core
20565//>>description: Selects elements which can be focused.
20566//>>docs: http://api.jqueryui.com/focusable-selector/
20567
20568
20569
20570// Selectors
20571$.ui.focusable = function( element, hasTabindex ) {
20572	var map, mapName, img, focusableIfVisible, fieldset,
20573		nodeName = element.nodeName.toLowerCase();
20574
20575	if ( "area" === nodeName ) {
20576		map = element.parentNode;
20577		mapName = map.name;
20578		if ( !element.href || !mapName || map.nodeName.toLowerCase() !== "map" ) {
20579			return false;
20580		}
20581		img = $( "img[usemap='#" + mapName + "']" );
20582		return img.length > 0 && img.is( ":visible" );
20583	}
20584
20585	if ( /^(input|select|textarea|button|object)$/.test( nodeName ) ) {
20586		focusableIfVisible = !element.disabled;
20587
20588		if ( focusableIfVisible ) {
20589
20590			// Form controls within a disabled fieldset are disabled.
20591			// However, controls within the fieldset's legend do not get disabled.
20592			// Since controls generally aren't placed inside legends, we skip
20593			// this portion of the check.
20594			fieldset = $( element ).closest( "fieldset" )[ 0 ];
20595			if ( fieldset ) {
20596				focusableIfVisible = !fieldset.disabled;
20597			}
20598		}
20599	} else if ( "a" === nodeName ) {
20600		focusableIfVisible = element.href || hasTabindex;
20601	} else {
20602		focusableIfVisible = hasTabindex;
20603	}
20604
20605	return focusableIfVisible && $( element ).is( ":visible" ) && visible( $( element ) );
20606};
20607
20608// Support: IE 8 only
20609// IE 8 doesn't resolve inherit to visible/hidden for computed values
20610function visible( element ) {
20611	var visibility = element.css( "visibility" );
20612	while ( visibility === "inherit" ) {
20613		element = element.parent();
20614		visibility = element.css( "visibility" );
20615	}
20616	return visibility !== "hidden";
20617}
20618
20619$.extend( $.expr[ ":" ], {
20620	focusable: function( element ) {
20621		return $.ui.focusable( element, $.attr( element, "tabindex" ) != null );
20622	}
20623} );
20624
20625var focusable = $.ui.focusable;
20626
20627
20628
20629
20630// Support: IE8 Only
20631// IE8 does not support the form attribute and when it is supplied. It overwrites the form prop
20632// with a string, so we need to find the proper form.
20633var form = $.fn.form = function() {
20634	return typeof this[ 0 ].form === "string" ? this.closest( "form" ) : $( this[ 0 ].form );
20635};
20636
20637
20638/*!
20639 * jQuery UI Form Reset Mixin 1.12.1
20640 * http://jqueryui.com
20641 *
20642 * Copyright jQuery Foundation and other contributors
20643 * Released under the MIT license.
20644 * http://jquery.org/license
20645 */
20646
20647//>>label: Form Reset Mixin
20648//>>group: Core
20649//>>description: Refresh input widgets when their form is reset
20650//>>docs: http://api.jqueryui.com/form-reset-mixin/
20651
20652
20653
20654var formResetMixin = $.ui.formResetMixin = {
20655	_formResetHandler: function() {
20656		var form = $( this );
20657
20658		// Wait for the form reset to actually happen before refreshing
20659		setTimeout( function() {
20660			var instances = form.data( "ui-form-reset-instances" );
20661			$.each( instances, function() {
20662				this.refresh();
20663			} );
20664		} );
20665	},
20666
20667	_bindFormResetHandler: function() {
20668		this.form = this.element.form();
20669		if ( !this.form.length ) {
20670			return;
20671		}
20672
20673		var instances = this.form.data( "ui-form-reset-instances" ) || [];
20674		if ( !instances.length ) {
20675
20676			// We don't use _on() here because we use a single event handler per form
20677			this.form.on( "reset.ui-form-reset", this._formResetHandler );
20678		}
20679		instances.push( this );
20680		this.form.data( "ui-form-reset-instances", instances );
20681	},
20682
20683	_unbindFormResetHandler: function() {
20684		if ( !this.form.length ) {
20685			return;
20686		}
20687
20688		var instances = this.form.data( "ui-form-reset-instances" );
20689		instances.splice( $.inArray( this, instances ), 1 );
20690		if ( instances.length ) {
20691			this.form.data( "ui-form-reset-instances", instances );
20692		} else {
20693			this.form
20694				.removeData( "ui-form-reset-instances" )
20695				.off( "reset.ui-form-reset" );
20696		}
20697	}
20698};
20699
20700
20701/*!
20702 * jQuery UI Support for jQuery core 1.7.x 1.12.1
20703 * http://jqueryui.com
20704 *
20705 * Copyright jQuery Foundation and other contributors
20706 * Released under the MIT license.
20707 * http://jquery.org/license
20708 *
20709 */
20710
20711//>>label: jQuery 1.7 Support
20712//>>group: Core
20713//>>description: Support version 1.7.x of jQuery core
20714
20715
20716
20717// Support: jQuery 1.7 only
20718// Not a great way to check versions, but since we only support 1.7+ and only
20719// need to detect <1.8, this is a simple check that should suffice. Checking
20720// for "1.7." would be a bit safer, but the version string is 1.7, not 1.7.0
20721// and we'll never reach 1.70.0 (if we do, we certainly won't be supporting
20722// 1.7 anymore). See #11197 for why we're not using feature detection.
20723if ( $.fn.jquery.substring( 0, 3 ) === "1.7" ) {
20724
20725	// Setters for .innerWidth(), .innerHeight(), .outerWidth(), .outerHeight()
20726	// Unlike jQuery Core 1.8+, these only support numeric values to set the
20727	// dimensions in pixels
20728	$.each( [ "Width", "Height" ], function( i, name ) {
20729		var side = name === "Width" ? [ "Left", "Right" ] : [ "Top", "Bottom" ],
20730			type = name.toLowerCase(),
20731			orig = {
20732				innerWidth: $.fn.innerWidth,
20733				innerHeight: $.fn.innerHeight,
20734				outerWidth: $.fn.outerWidth,
20735				outerHeight: $.fn.outerHeight
20736			};
20737
20738		function reduce( elem, size, border, margin ) {
20739			$.each( side, function() {
20740				size -= parseFloat( $.css( elem, "padding" + this ) ) || 0;
20741				if ( border ) {
20742					size -= parseFloat( $.css( elem, "border" + this + "Width" ) ) || 0;
20743				}
20744				if ( margin ) {
20745					size -= parseFloat( $.css( elem, "margin" + this ) ) || 0;
20746				}
20747			} );
20748			return size;
20749		}
20750
20751		$.fn[ "inner" + name ] = function( size ) {
20752			if ( size === undefined ) {
20753				return orig[ "inner" + name ].call( this );
20754			}
20755
20756			return this.each( function() {
20757				$( this ).css( type, reduce( this, size ) + "px" );
20758			} );
20759		};
20760
20761		$.fn[ "outer" + name ] = function( size, margin ) {
20762			if ( typeof size !== "number" ) {
20763				return orig[ "outer" + name ].call( this, size );
20764			}
20765
20766			return this.each( function() {
20767				$( this ).css( type, reduce( this, size, true, margin ) + "px" );
20768			} );
20769		};
20770	} );
20771
20772	$.fn.addBack = function( selector ) {
20773		return this.add( selector == null ?
20774			this.prevObject : this.prevObject.filter( selector )
20775		);
20776	};
20777}
20778
20779;
20780/*!
20781 * jQuery UI Keycode 1.12.1
20782 * http://jqueryui.com
20783 *
20784 * Copyright jQuery Foundation and other contributors
20785 * Released under the MIT license.
20786 * http://jquery.org/license
20787 */
20788
20789//>>label: Keycode
20790//>>group: Core
20791//>>description: Provide keycodes as keynames
20792//>>docs: http://api.jqueryui.com/jQuery.ui.keyCode/
20793
20794
20795var keycode = $.ui.keyCode = {
20796	BACKSPACE: 8,
20797	COMMA: 188,
20798	DELETE: 46,
20799	DOWN: 40,
20800	END: 35,
20801	ENTER: 13,
20802	ESCAPE: 27,
20803	HOME: 36,
20804	LEFT: 37,
20805	PAGE_DOWN: 34,
20806	PAGE_UP: 33,
20807	PERIOD: 190,
20808	RIGHT: 39,
20809	SPACE: 32,
20810	TAB: 9,
20811	UP: 38
20812};
20813
20814
20815
20816
20817// Internal use only
20818var escapeSelector = $.ui.escapeSelector = ( function() {
20819	var selectorEscape = /([!"#$%&'()*+,./:;<=>?@[\]^`{|}~])/g;
20820	return function( selector ) {
20821		return selector.replace( selectorEscape, "\\$1" );
20822	};
20823} )();
20824
20825
20826/*!
20827 * jQuery UI Labels 1.12.1
20828 * http://jqueryui.com
20829 *
20830 * Copyright jQuery Foundation and other contributors
20831 * Released under the MIT license.
20832 * http://jquery.org/license
20833 */
20834
20835//>>label: labels
20836//>>group: Core
20837//>>description: Find all the labels associated with a given input
20838//>>docs: http://api.jqueryui.com/labels/
20839
20840
20841
20842var labels = $.fn.labels = function() {
20843	var ancestor, selector, id, labels, ancestors;
20844
20845	// Check control.labels first
20846	if ( this[ 0 ].labels && this[ 0 ].labels.length ) {
20847		return this.pushStack( this[ 0 ].labels );
20848	}
20849
20850	// Support: IE <= 11, FF <= 37, Android <= 2.3 only
20851	// Above browsers do not support control.labels. Everything below is to support them
20852	// as well as document fragments. control.labels does not work on document fragments
20853	labels = this.eq( 0 ).parents( "label" );
20854
20855	// Look for the label based on the id
20856	id = this.attr( "id" );
20857	if ( id ) {
20858
20859		// We don't search against the document in case the element
20860		// is disconnected from the DOM
20861		ancestor = this.eq( 0 ).parents().last();
20862
20863		// Get a full set of top level ancestors
20864		ancestors = ancestor.add( ancestor.length ? ancestor.siblings() : this.siblings() );
20865
20866		// Create a selector for the label based on the id
20867		selector = "label[for='" + $.ui.escapeSelector( id ) + "']";
20868
20869		labels = labels.add( ancestors.find( selector ).addBack( selector ) );
20870
20871	}
20872
20873	// Return whatever we have found for labels
20874	return this.pushStack( labels );
20875};
20876
20877
20878/*!
20879 * jQuery UI Scroll Parent 1.12.1
20880 * http://jqueryui.com
20881 *
20882 * Copyright jQuery Foundation and other contributors
20883 * Released under the MIT license.
20884 * http://jquery.org/license
20885 */
20886
20887//>>label: scrollParent
20888//>>group: Core
20889//>>description: Get the closest ancestor element that is scrollable.
20890//>>docs: http://api.jqueryui.com/scrollParent/
20891
20892
20893
20894var scrollParent = $.fn.scrollParent = function( includeHidden ) {
20895	var position = this.css( "position" ),
20896		excludeStaticParent = position === "absolute",
20897		overflowRegex = includeHidden ? /(auto|scroll|hidden)/ : /(auto|scroll)/,
20898		scrollParent = this.parents().filter( function() {
20899			var parent = $( this );
20900			if ( excludeStaticParent && parent.css( "position" ) === "static" ) {
20901				return false;
20902			}
20903			return overflowRegex.test( parent.css( "overflow" ) + parent.css( "overflow-y" ) +
20904				parent.css( "overflow-x" ) );
20905		} ).eq( 0 );
20906
20907	return position === "fixed" || !scrollParent.length ?
20908		$( this[ 0 ].ownerDocument || document ) :
20909		scrollParent;
20910};
20911
20912
20913/*!
20914 * jQuery UI Tabbable 1.12.1
20915 * http://jqueryui.com
20916 *
20917 * Copyright jQuery Foundation and other contributors
20918 * Released under the MIT license.
20919 * http://jquery.org/license
20920 */
20921
20922//>>label: :tabbable Selector
20923//>>group: Core
20924//>>description: Selects elements which can be tabbed to.
20925//>>docs: http://api.jqueryui.com/tabbable-selector/
20926
20927
20928
20929var tabbable = $.extend( $.expr[ ":" ], {
20930	tabbable: function( element ) {
20931		var tabIndex = $.attr( element, "tabindex" ),
20932			hasTabindex = tabIndex != null;
20933		return ( !hasTabindex || tabIndex >= 0 ) && $.ui.focusable( element, hasTabindex );
20934	}
20935} );
20936
20937
20938/*!
20939 * jQuery UI Unique ID 1.12.1
20940 * http://jqueryui.com
20941 *
20942 * Copyright jQuery Foundation and other contributors
20943 * Released under the MIT license.
20944 * http://jquery.org/license
20945 */
20946
20947//>>label: uniqueId
20948//>>group: Core
20949//>>description: Functions to generate and remove uniqueId's
20950//>>docs: http://api.jqueryui.com/uniqueId/
20951
20952
20953
20954var uniqueId = $.fn.extend( {
20955	uniqueId: ( function() {
20956		var uuid = 0;
20957
20958		return function() {
20959			return this.each( function() {
20960				if ( !this.id ) {
20961					this.id = "ui-id-" + ( ++uuid );
20962				}
20963			} );
20964		};
20965	} )(),
20966
20967	removeUniqueId: function() {
20968		return this.each( function() {
20969			if ( /^ui-id-\d+$/.test( this.id ) ) {
20970				$( this ).removeAttr( "id" );
20971			}
20972		} );
20973	}
20974} );
20975
20976
20977/*!
20978 * jQuery UI Accordion 1.12.1
20979 * http://jqueryui.com
20980 *
20981 * Copyright jQuery Foundation and other contributors
20982 * Released under the MIT license.
20983 * http://jquery.org/license
20984 */
20985
20986//>>label: Accordion
20987//>>group: Widgets
20988// jscs:disable maximumLineLength
20989//>>description: Displays collapsible content panels for presenting information in a limited amount of space.
20990// jscs:enable maximumLineLength
20991//>>docs: http://api.jqueryui.com/accordion/
20992//>>demos: http://jqueryui.com/accordion/
20993//>>css.structure: ../../themes/base/core.css
20994//>>css.structure: ../../themes/base/accordion.css
20995//>>css.theme: ../../themes/base/theme.css
20996
20997
20998
20999var widgetsAccordion = $.widget( "ui.accordion", {
21000	version: "1.12.1",
21001	options: {
21002		active: 0,
21003		animate: {},
21004		classes: {
21005			"ui-accordion-header": "ui-corner-top",
21006			"ui-accordion-header-collapsed": "ui-corner-all",
21007			"ui-accordion-content": "ui-corner-bottom"
21008		},
21009		collapsible: false,
21010		event: "click",
21011		header: "> li > :first-child, > :not(li):even",
21012		heightStyle: "auto",
21013		icons: {
21014			activeHeader: "ui-icon-triangle-1-s",
21015			header: "ui-icon-triangle-1-e"
21016		},
21017
21018		// Callbacks
21019		activate: null,
21020		beforeActivate: null
21021	},
21022
21023	hideProps: {
21024		borderTopWidth: "hide",
21025		borderBottomWidth: "hide",
21026		paddingTop: "hide",
21027		paddingBottom: "hide",
21028		height: "hide"
21029	},
21030
21031	showProps: {
21032		borderTopWidth: "show",
21033		borderBottomWidth: "show",
21034		paddingTop: "show",
21035		paddingBottom: "show",
21036		height: "show"
21037	},
21038
21039	_create: function() {
21040		var options = this.options;
21041
21042		this.prevShow = this.prevHide = $();
21043		this._addClass( "ui-accordion", "ui-widget ui-helper-reset" );
21044		this.element.attr( "role", "tablist" );
21045
21046		// Don't allow collapsible: false and active: false / null
21047		if ( !options.collapsible && ( options.active === false || options.active == null ) ) {
21048			options.active = 0;
21049		}
21050
21051		this._processPanels();
21052
21053		// handle negative values
21054		if ( options.active < 0 ) {
21055			options.active += this.headers.length;
21056		}
21057		this._refresh();
21058	},
21059
21060	_getCreateEventData: function() {
21061		return {
21062			header: this.active,
21063			panel: !this.active.length ? $() : this.active.next()
21064		};
21065	},
21066
21067	_createIcons: function() {
21068		var icon, children,
21069			icons = this.options.icons;
21070
21071		if ( icons ) {
21072			icon = $( "<span>" );
21073			this._addClass( icon, "ui-accordion-header-icon", "ui-icon " + icons.header );
21074			icon.prependTo( this.headers );
21075			children = this.active.children( ".ui-accordion-header-icon" );
21076			this._removeClass( children, icons.header )
21077				._addClass( children, null, icons.activeHeader )
21078				._addClass( this.headers, "ui-accordion-icons" );
21079		}
21080	},
21081
21082	_destroyIcons: function() {
21083		this._removeClass( this.headers, "ui-accordion-icons" );
21084		this.headers.children( ".ui-accordion-header-icon" ).remove();
21085	},
21086
21087	_destroy: function() {
21088		var contents;
21089
21090		// Clean up main element
21091		this.element.removeAttr( "role" );
21092
21093		// Clean up headers
21094		this.headers
21095			.removeAttr( "role aria-expanded aria-selected aria-controls tabIndex" )
21096			.removeUniqueId();
21097
21098		this._destroyIcons();
21099
21100		// Clean up content panels
21101		contents = this.headers.next()
21102			.css( "display", "" )
21103			.removeAttr( "role aria-hidden aria-labelledby" )
21104			.removeUniqueId();
21105
21106		if ( this.options.heightStyle !== "content" ) {
21107			contents.css( "height", "" );
21108		}
21109	},
21110
21111	_setOption: function( key, value ) {
21112		if ( key === "active" ) {
21113
21114			// _activate() will handle invalid values and update this.options
21115			this._activate( value );
21116			return;
21117		}
21118
21119		if ( key === "event" ) {
21120			if ( this.options.event ) {
21121				this._off( this.headers, this.options.event );
21122			}
21123			this._setupEvents( value );
21124		}
21125
21126		this._super( key, value );
21127
21128		// Setting collapsible: false while collapsed; open first panel
21129		if ( key === "collapsible" && !value && this.options.active === false ) {
21130			this._activate( 0 );
21131		}
21132
21133		if ( key === "icons" ) {
21134			this._destroyIcons();
21135			if ( value ) {
21136				this._createIcons();
21137			}
21138		}
21139	},
21140
21141	_setOptionDisabled: function( value ) {
21142		this._super( value );
21143
21144		this.element.attr( "aria-disabled", value );
21145
21146		// Support: IE8 Only
21147		// #5332 / #6059 - opacity doesn't cascade to positioned elements in IE
21148		// so we need to add the disabled class to the headers and panels
21149		this._toggleClass( null, "ui-state-disabled", !!value );
21150		this._toggleClass( this.headers.add( this.headers.next() ), null, "ui-state-disabled",
21151			!!value );
21152	},
21153
21154	_keydown: function( event ) {
21155		if ( event.altKey || event.ctrlKey ) {
21156			return;
21157		}
21158
21159		var keyCode = $.ui.keyCode,
21160			length = this.headers.length,
21161			currentIndex = this.headers.index( event.target ),
21162			toFocus = false;
21163
21164		switch ( event.keyCode ) {
21165		case keyCode.RIGHT:
21166		case keyCode.DOWN:
21167			toFocus = this.headers[ ( currentIndex + 1 ) % length ];
21168			break;
21169		case keyCode.LEFT:
21170		case keyCode.UP:
21171			toFocus = this.headers[ ( currentIndex - 1 + length ) % length ];
21172			break;
21173		case keyCode.SPACE:
21174		case keyCode.ENTER:
21175			this._eventHandler( event );
21176			break;
21177		case keyCode.HOME:
21178			toFocus = this.headers[ 0 ];
21179			break;
21180		case keyCode.END:
21181			toFocus = this.headers[ length - 1 ];
21182			break;
21183		}
21184
21185		if ( toFocus ) {
21186			$( event.target ).attr( "tabIndex", -1 );
21187			$( toFocus ).attr( "tabIndex", 0 );
21188			$( toFocus ).trigger( "focus" );
21189			event.preventDefault();
21190		}
21191	},
21192
21193	_panelKeyDown: function( event ) {
21194		if ( event.keyCode === $.ui.keyCode.UP && event.ctrlKey ) {
21195			$( event.currentTarget ).prev().trigger( "focus" );
21196		}
21197	},
21198
21199	refresh: function() {
21200		var options = this.options;
21201		this._processPanels();
21202
21203		// Was collapsed or no panel
21204		if ( ( options.active === false && options.collapsible === true ) ||
21205				!this.headers.length ) {
21206			options.active = false;
21207			this.active = $();
21208
21209		// active false only when collapsible is true
21210		} else if ( options.active === false ) {
21211			this._activate( 0 );
21212
21213		// was active, but active panel is gone
21214		} else if ( this.active.length && !$.contains( this.element[ 0 ], this.active[ 0 ] ) ) {
21215
21216			// all remaining panel are disabled
21217			if ( this.headers.length === this.headers.find( ".ui-state-disabled" ).length ) {
21218				options.active = false;
21219				this.active = $();
21220
21221			// activate previous panel
21222			} else {
21223				this._activate( Math.max( 0, options.active - 1 ) );
21224			}
21225
21226		// was active, active panel still exists
21227		} else {
21228
21229			// make sure active index is correct
21230			options.active = this.headers.index( this.active );
21231		}
21232
21233		this._destroyIcons();
21234
21235		this._refresh();
21236	},
21237
21238	_processPanels: function() {
21239		var prevHeaders = this.headers,
21240			prevPanels = this.panels;
21241
21242		this.headers = this.element.find( this.options.header );
21243		this._addClass( this.headers, "ui-accordion-header ui-accordion-header-collapsed",
21244			"ui-state-default" );
21245
21246		this.panels = this.headers.next().filter( ":not(.ui-accordion-content-active)" ).hide();
21247		this._addClass( this.panels, "ui-accordion-content", "ui-helper-reset ui-widget-content" );
21248
21249		// Avoid memory leaks (#10056)
21250		if ( prevPanels ) {
21251			this._off( prevHeaders.not( this.headers ) );
21252			this._off( prevPanels.not( this.panels ) );
21253		}
21254	},
21255
21256	_refresh: function() {
21257		var maxHeight,
21258			options = this.options,
21259			heightStyle = options.heightStyle,
21260			parent = this.element.parent();
21261
21262		this.active = this._findActive( options.active );
21263		this._addClass( this.active, "ui-accordion-header-active", "ui-state-active" )
21264			._removeClass( this.active, "ui-accordion-header-collapsed" );
21265		this._addClass( this.active.next(), "ui-accordion-content-active" );
21266		this.active.next().show();
21267
21268		this.headers
21269			.attr( "role", "tab" )
21270			.each( function() {
21271				var header = $( this ),
21272					headerId = header.uniqueId().attr( "id" ),
21273					panel = header.next(),
21274					panelId = panel.uniqueId().attr( "id" );
21275				header.attr( "aria-controls", panelId );
21276				panel.attr( "aria-labelledby", headerId );
21277			} )
21278			.next()
21279				.attr( "role", "tabpanel" );
21280
21281		this.headers
21282			.not( this.active )
21283				.attr( {
21284					"aria-selected": "false",
21285					"aria-expanded": "false",
21286					tabIndex: -1
21287				} )
21288				.next()
21289					.attr( {
21290						"aria-hidden": "true"
21291					} )
21292					.hide();
21293
21294		// Make sure at least one header is in the tab order
21295		if ( !this.active.length ) {
21296			this.headers.eq( 0 ).attr( "tabIndex", 0 );
21297		} else {
21298			this.active.attr( {
21299				"aria-selected": "true",
21300				"aria-expanded": "true",
21301				tabIndex: 0
21302			} )
21303				.next()
21304					.attr( {
21305						"aria-hidden": "false"
21306					} );
21307		}
21308
21309		this._createIcons();
21310
21311		this._setupEvents( options.event );
21312
21313		if ( heightStyle === "fill" ) {
21314			maxHeight = parent.height();
21315			this.element.siblings( ":visible" ).each( function() {
21316				var elem = $( this ),
21317					position = elem.css( "position" );
21318
21319				if ( position === "absolute" || position === "fixed" ) {
21320					return;
21321				}
21322				maxHeight -= elem.outerHeight( true );
21323			} );
21324
21325			this.headers.each( function() {
21326				maxHeight -= $( this ).outerHeight( true );
21327			} );
21328
21329			this.headers.next()
21330				.each( function() {
21331					$( this ).height( Math.max( 0, maxHeight -
21332						$( this ).innerHeight() + $( this ).height() ) );
21333				} )
21334				.css( "overflow", "auto" );
21335		} else if ( heightStyle === "auto" ) {
21336			maxHeight = 0;
21337			this.headers.next()
21338				.each( function() {
21339					var isVisible = $( this ).is( ":visible" );
21340					if ( !isVisible ) {
21341						$( this ).show();
21342					}
21343					maxHeight = Math.max( maxHeight, $( this ).css( "height", "" ).height() );
21344					if ( !isVisible ) {
21345						$( this ).hide();
21346					}
21347				} )
21348				.height( maxHeight );
21349		}
21350	},
21351
21352	_activate: function( index ) {
21353		var active = this._findActive( index )[ 0 ];
21354
21355		// Trying to activate the already active panel
21356		if ( active === this.active[ 0 ] ) {
21357			return;
21358		}
21359
21360		// Trying to collapse, simulate a click on the currently active header
21361		active = active || this.active[ 0 ];
21362
21363		this._eventHandler( {
21364			target: active,
21365			currentTarget: active,
21366			preventDefault: $.noop
21367		} );
21368	},
21369
21370	_findActive: function( selector ) {
21371		return typeof selector === "number" ? this.headers.eq( selector ) : $();
21372	},
21373
21374	_setupEvents: function( event ) {
21375		var events = {
21376			keydown: "_keydown"
21377		};
21378		if ( event ) {
21379			$.each( event.split( " " ), function( index, eventName ) {
21380				events[ eventName ] = "_eventHandler";
21381			} );
21382		}
21383
21384		this._off( this.headers.add( this.headers.next() ) );
21385		this._on( this.headers, events );
21386		this._on( this.headers.next(), { keydown: "_panelKeyDown" } );
21387		this._hoverable( this.headers );
21388		this._focusable( this.headers );
21389	},
21390
21391	_eventHandler: function( event ) {
21392		var activeChildren, clickedChildren,
21393			options = this.options,
21394			active = this.active,
21395			clicked = $( event.currentTarget ),
21396			clickedIsActive = clicked[ 0 ] === active[ 0 ],
21397			collapsing = clickedIsActive && options.collapsible,
21398			toShow = collapsing ? $() : clicked.next(),
21399			toHide = active.next(),
21400			eventData = {
21401				oldHeader: active,
21402				oldPanel: toHide,
21403				newHeader: collapsing ? $() : clicked,
21404				newPanel: toShow
21405			};
21406
21407		event.preventDefault();
21408
21409		if (
21410
21411				// click on active header, but not collapsible
21412				( clickedIsActive && !options.collapsible ) ||
21413
21414				// allow canceling activation
21415				( this._trigger( "beforeActivate", event, eventData ) === false ) ) {
21416			return;
21417		}
21418
21419		options.active = collapsing ? false : this.headers.index( clicked );
21420
21421		// When the call to ._toggle() comes after the class changes
21422		// it causes a very odd bug in IE 8 (see #6720)
21423		this.active = clickedIsActive ? $() : clicked;
21424		this._toggle( eventData );
21425
21426		// Switch classes
21427		// corner classes on the previously active header stay after the animation
21428		this._removeClass( active, "ui-accordion-header-active", "ui-state-active" );
21429		if ( options.icons ) {
21430			activeChildren = active.children( ".ui-accordion-header-icon" );
21431			this._removeClass( activeChildren, null, options.icons.activeHeader )
21432				._addClass( activeChildren, null, options.icons.header );
21433		}
21434
21435		if ( !clickedIsActive ) {
21436			this._removeClass( clicked, "ui-accordion-header-collapsed" )
21437				._addClass( clicked, "ui-accordion-header-active", "ui-state-active" );
21438			if ( options.icons ) {
21439				clickedChildren = clicked.children( ".ui-accordion-header-icon" );
21440				this._removeClass( clickedChildren, null, options.icons.header )
21441					._addClass( clickedChildren, null, options.icons.activeHeader );
21442			}
21443
21444			this._addClass( clicked.next(), "ui-accordion-content-active" );
21445		}
21446	},
21447
21448	_toggle: function( data ) {
21449		var toShow = data.newPanel,
21450			toHide = this.prevShow.length ? this.prevShow : data.oldPanel;
21451
21452		// Handle activating a panel during the animation for another activation
21453		this.prevShow.add( this.prevHide ).stop( true, true );
21454		this.prevShow = toShow;
21455		this.prevHide = toHide;
21456
21457		if ( this.options.animate ) {
21458			this._animate( toShow, toHide, data );
21459		} else {
21460			toHide.hide();
21461			toShow.show();
21462			this._toggleComplete( data );
21463		}
21464
21465		toHide.attr( {
21466			"aria-hidden": "true"
21467		} );
21468		toHide.prev().attr( {
21469			"aria-selected": "false",
21470			"aria-expanded": "false"
21471		} );
21472
21473		// if we're switching panels, remove the old header from the tab order
21474		// if we're opening from collapsed state, remove the previous header from the tab order
21475		// if we're collapsing, then keep the collapsing header in the tab order
21476		if ( toShow.length && toHide.length ) {
21477			toHide.prev().attr( {
21478				"tabIndex": -1,
21479				"aria-expanded": "false"
21480			} );
21481		} else if ( toShow.length ) {
21482			this.headers.filter( function() {
21483				return parseInt( $( this ).attr( "tabIndex" ), 10 ) === 0;
21484			} )
21485				.attr( "tabIndex", -1 );
21486		}
21487
21488		toShow
21489			.attr( "aria-hidden", "false" )
21490			.prev()
21491				.attr( {
21492					"aria-selected": "true",
21493					"aria-expanded": "true",
21494					tabIndex: 0
21495				} );
21496	},
21497
21498	_animate: function( toShow, toHide, data ) {
21499		var total, easing, duration,
21500			that = this,
21501			adjust = 0,
21502			boxSizing = toShow.css( "box-sizing" ),
21503			down = toShow.length &&
21504				( !toHide.length || ( toShow.index() < toHide.index() ) ),
21505			animate = this.options.animate || {},
21506			options = down && animate.down || animate,
21507			complete = function() {
21508				that._toggleComplete( data );
21509			};
21510
21511		if ( typeof options === "number" ) {
21512			duration = options;
21513		}
21514		if ( typeof options === "string" ) {
21515			easing = options;
21516		}
21517
21518		// fall back from options to animation in case of partial down settings
21519		easing = easing || options.easing || animate.easing;
21520		duration = duration || options.duration || animate.duration;
21521
21522		if ( !toHide.length ) {
21523			return toShow.animate( this.showProps, duration, easing, complete );
21524		}
21525		if ( !toShow.length ) {
21526			return toHide.animate( this.hideProps, duration, easing, complete );
21527		}
21528
21529		total = toShow.show().outerHeight();
21530		toHide.animate( this.hideProps, {
21531			duration: duration,
21532			easing: easing,
21533			step: function( now, fx ) {
21534				fx.now = Math.round( now );
21535			}
21536		} );
21537		toShow
21538			.hide()
21539			.animate( this.showProps, {
21540				duration: duration,
21541				easing: easing,
21542				complete: complete,
21543				step: function( now, fx ) {
21544					fx.now = Math.round( now );
21545					if ( fx.prop !== "height" ) {
21546						if ( boxSizing === "content-box" ) {
21547							adjust += fx.now;
21548						}
21549					} else if ( that.options.heightStyle !== "content" ) {
21550						fx.now = Math.round( total - toHide.outerHeight() - adjust );
21551						adjust = 0;
21552					}
21553				}
21554			} );
21555	},
21556
21557	_toggleComplete: function( data ) {
21558		var toHide = data.oldPanel,
21559			prev = toHide.prev();
21560
21561		this._removeClass( toHide, "ui-accordion-content-active" );
21562		this._removeClass( prev, "ui-accordion-header-active" )
21563			._addClass( prev, "ui-accordion-header-collapsed" );
21564
21565		// Work around for rendering bug in IE (#5421)
21566		if ( toHide.length ) {
21567			toHide.parent()[ 0 ].className = toHide.parent()[ 0 ].className;
21568		}
21569		this._trigger( "activate", null, data );
21570	}
21571} );
21572
21573
21574
21575var safeActiveElement = $.ui.safeActiveElement = function( document ) {
21576	var activeElement;
21577
21578	// Support: IE 9 only
21579	// IE9 throws an "Unspecified error" accessing document.activeElement from an <iframe>
21580	try {
21581		activeElement = document.activeElement;
21582	} catch ( error ) {
21583		activeElement = document.body;
21584	}
21585
21586	// Support: IE 9 - 11 only
21587	// IE may return null instead of an element
21588	// Interestingly, this only seems to occur when NOT in an iframe
21589	if ( !activeElement ) {
21590		activeElement = document.body;
21591	}
21592
21593	// Support: IE 11 only
21594	// IE11 returns a seemingly empty object in some cases when accessing
21595	// document.activeElement from an <iframe>
21596	if ( !activeElement.nodeName ) {
21597		activeElement = document.body;
21598	}
21599
21600	return activeElement;
21601};
21602
21603
21604/*!
21605 * jQuery UI Menu 1.12.1
21606 * http://jqueryui.com
21607 *
21608 * Copyright jQuery Foundation and other contributors
21609 * Released under the MIT license.
21610 * http://jquery.org/license
21611 */
21612
21613//>>label: Menu
21614//>>group: Widgets
21615//>>description: Creates nestable menus.
21616//>>docs: http://api.jqueryui.com/menu/
21617//>>demos: http://jqueryui.com/menu/
21618//>>css.structure: ../../themes/base/core.css
21619//>>css.structure: ../../themes/base/menu.css
21620//>>css.theme: ../../themes/base/theme.css
21621
21622
21623
21624var widgetsMenu = $.widget( "ui.menu", {
21625	version: "1.12.1",
21626	defaultElement: "<ul>",
21627	delay: 300,
21628	options: {
21629		icons: {
21630			submenu: "ui-icon-caret-1-e"
21631		},
21632		items: "> *",
21633		menus: "ul",
21634		position: {
21635			my: "left top",
21636			at: "right top"
21637		},
21638		role: "menu",
21639
21640		// Callbacks
21641		blur: null,
21642		focus: null,
21643		select: null
21644	},
21645
21646	_create: function() {
21647		this.activeMenu = this.element;
21648
21649		// Flag used to prevent firing of the click handler
21650		// as the event bubbles up through nested menus
21651		this.mouseHandled = false;
21652		this.element
21653			.uniqueId()
21654			.attr( {
21655				role: this.options.role,
21656				tabIndex: 0
21657			} );
21658
21659		this._addClass( "ui-menu", "ui-widget ui-widget-content" );
21660		this._on( {
21661
21662			// Prevent focus from sticking to links inside menu after clicking
21663			// them (focus should always stay on UL during navigation).
21664			"mousedown .ui-menu-item": function( event ) {
21665				event.preventDefault();
21666			},
21667			"click .ui-menu-item": function( event ) {
21668				var target = $( event.target );
21669				var active = $( $.ui.safeActiveElement( this.document[ 0 ] ) );
21670				if ( !this.mouseHandled && target.not( ".ui-state-disabled" ).length ) {
21671					this.select( event );
21672
21673					// Only set the mouseHandled flag if the event will bubble, see #9469.
21674					if ( !event.isPropagationStopped() ) {
21675						this.mouseHandled = true;
21676					}
21677
21678					// Open submenu on click
21679					if ( target.has( ".ui-menu" ).length ) {
21680						this.expand( event );
21681					} else if ( !this.element.is( ":focus" ) &&
21682							active.closest( ".ui-menu" ).length ) {
21683
21684						// Redirect focus to the menu
21685						this.element.trigger( "focus", [ true ] );
21686
21687						// If the active item is on the top level, let it stay active.
21688						// Otherwise, blur the active item since it is no longer visible.
21689						if ( this.active && this.active.parents( ".ui-menu" ).length === 1 ) {
21690							clearTimeout( this.timer );
21691						}
21692					}
21693				}
21694			},
21695			"mouseenter .ui-menu-item": function( event ) {
21696
21697				// Ignore mouse events while typeahead is active, see #10458.
21698				// Prevents focusing the wrong item when typeahead causes a scroll while the mouse
21699				// is over an item in the menu
21700				if ( this.previousFilter ) {
21701					return;
21702				}
21703
21704				var actualTarget = $( event.target ).closest( ".ui-menu-item" ),
21705					target = $( event.currentTarget );
21706
21707				// Ignore bubbled events on parent items, see #11641
21708				if ( actualTarget[ 0 ] !== target[ 0 ] ) {
21709					return;
21710				}
21711
21712				// Remove ui-state-active class from siblings of the newly focused menu item
21713				// to avoid a jump caused by adjacent elements both having a class with a border
21714				this._removeClass( target.siblings().children( ".ui-state-active" ),
21715					null, "ui-state-active" );
21716				this.focus( event, target );
21717			},
21718			mouseleave: "collapseAll",
21719			"mouseleave .ui-menu": "collapseAll",
21720			focus: function( event, keepActiveItem ) {
21721
21722				// If there's already an active item, keep it active
21723				// If not, activate the first item
21724				var item = this.active || this.element.find( this.options.items ).eq( 0 );
21725
21726				if ( !keepActiveItem ) {
21727					this.focus( event, item );
21728				}
21729			},
21730			blur: function( event ) {
21731				this._delay( function() {
21732					var notContained = !$.contains(
21733						this.element[ 0 ],
21734						$.ui.safeActiveElement( this.document[ 0 ] )
21735					);
21736					if ( notContained ) {
21737						this.collapseAll( event );
21738					}
21739				} );
21740			},
21741			keydown: "_keydown"
21742		} );
21743
21744		this.refresh();
21745
21746		// Clicks outside of a menu collapse any open menus
21747		this._on( this.document, {
21748			click: function( event ) {
21749				if ( this._closeOnDocumentClick( event ) ) {
21750					this.collapseAll( event );
21751				}
21752
21753				// Reset the mouseHandled flag
21754				this.mouseHandled = false;
21755			}
21756		} );
21757	},
21758
21759	_destroy: function() {
21760		var items = this.element.find( ".ui-menu-item" )
21761				.removeAttr( "role aria-disabled" ),
21762			submenus = items.children( ".ui-menu-item-wrapper" )
21763				.removeUniqueId()
21764				.removeAttr( "tabIndex role aria-haspopup" );
21765
21766		// Destroy (sub)menus
21767		this.element
21768			.removeAttr( "aria-activedescendant" )
21769			.find( ".ui-menu" ).addBack()
21770				.removeAttr( "role aria-labelledby aria-expanded aria-hidden aria-disabled " +
21771					"tabIndex" )
21772				.removeUniqueId()
21773				.show();
21774
21775		submenus.children().each( function() {
21776			var elem = $( this );
21777			if ( elem.data( "ui-menu-submenu-caret" ) ) {
21778				elem.remove();
21779			}
21780		} );
21781	},
21782
21783	_keydown: function( event ) {
21784		var match, prev, character, skip,
21785			preventDefault = true;
21786
21787		switch ( event.keyCode ) {
21788		case $.ui.keyCode.PAGE_UP:
21789			this.previousPage( event );
21790			break;
21791		case $.ui.keyCode.PAGE_DOWN:
21792			this.nextPage( event );
21793			break;
21794		case $.ui.keyCode.HOME:
21795			this._move( "first", "first", event );
21796			break;
21797		case $.ui.keyCode.END:
21798			this._move( "last", "last", event );
21799			break;
21800		case $.ui.keyCode.UP:
21801			this.previous( event );
21802			break;
21803		case $.ui.keyCode.DOWN:
21804			this.next( event );
21805			break;
21806		case $.ui.keyCode.LEFT:
21807			this.collapse( event );
21808			break;
21809		case $.ui.keyCode.RIGHT:
21810			if ( this.active && !this.active.is( ".ui-state-disabled" ) ) {
21811				this.expand( event );
21812			}
21813			break;
21814		case $.ui.keyCode.ENTER:
21815		case $.ui.keyCode.SPACE:
21816			this._activate( event );
21817			break;
21818		case $.ui.keyCode.ESCAPE:
21819			this.collapse( event );
21820			break;
21821		default:
21822			preventDefault = false;
21823			prev = this.previousFilter || "";
21824			skip = false;
21825
21826			// Support number pad values
21827			character = event.keyCode >= 96 && event.keyCode <= 105 ?
21828				( event.keyCode - 96 ).toString() : String.fromCharCode( event.keyCode );
21829
21830			clearTimeout( this.filterTimer );
21831
21832			if ( character === prev ) {
21833				skip = true;
21834			} else {
21835				character = prev + character;
21836			}
21837
21838			match = this._filterMenuItems( character );
21839			match = skip && match.index( this.active.next() ) !== -1 ?
21840				this.active.nextAll( ".ui-menu-item" ) :
21841				match;
21842
21843			// If no matches on the current filter, reset to the last character pressed
21844			// to move down the menu to the first item that starts with that character
21845			if ( !match.length ) {
21846				character = String.fromCharCode( event.keyCode );
21847				match = this._filterMenuItems( character );
21848			}
21849
21850			if ( match.length ) {
21851				this.focus( event, match );
21852				this.previousFilter = character;
21853				this.filterTimer = this._delay( function() {
21854					delete this.previousFilter;
21855				}, 1000 );
21856			} else {
21857				delete this.previousFilter;
21858			}
21859		}
21860
21861		if ( preventDefault ) {
21862			event.preventDefault();
21863		}
21864	},
21865
21866	_activate: function( event ) {
21867		if ( this.active && !this.active.is( ".ui-state-disabled" ) ) {
21868			if ( this.active.children( "[aria-haspopup='true']" ).length ) {
21869				this.expand( event );
21870			} else {
21871				this.select( event );
21872			}
21873		}
21874	},
21875
21876	refresh: function() {
21877		var menus, items, newSubmenus, newItems, newWrappers,
21878			that = this,
21879			icon = this.options.icons.submenu,
21880			submenus = this.element.find( this.options.menus );
21881
21882		this._toggleClass( "ui-menu-icons", null, !!this.element.find( ".ui-icon" ).length );
21883
21884		// Initialize nested menus
21885		newSubmenus = submenus.filter( ":not(.ui-menu)" )
21886			.hide()
21887			.attr( {
21888				role: this.options.role,
21889				"aria-hidden": "true",
21890				"aria-expanded": "false"
21891			} )
21892			.each( function() {
21893				var menu = $( this ),
21894					item = menu.prev(),
21895					submenuCaret = $( "<span>" ).data( "ui-menu-submenu-caret", true );
21896
21897				that._addClass( submenuCaret, "ui-menu-icon", "ui-icon " + icon );
21898				item
21899					.attr( "aria-haspopup", "true" )
21900					.prepend( submenuCaret );
21901				menu.attr( "aria-labelledby", item.attr( "id" ) );
21902			} );
21903
21904		this._addClass( newSubmenus, "ui-menu", "ui-widget ui-widget-content ui-front" );
21905
21906		menus = submenus.add( this.element );
21907		items = menus.find( this.options.items );
21908
21909		// Initialize menu-items containing spaces and/or dashes only as dividers
21910		items.not( ".ui-menu-item" ).each( function() {
21911			var item = $( this );
21912			if ( that._isDivider( item ) ) {
21913				that._addClass( item, "ui-menu-divider", "ui-widget-content" );
21914			}
21915		} );
21916
21917		// Don't refresh list items that are already adapted
21918		newItems = items.not( ".ui-menu-item, .ui-menu-divider" );
21919		newWrappers = newItems.children()
21920			.not( ".ui-menu" )
21921				.uniqueId()
21922				.attr( {
21923					tabIndex: -1,
21924					role: this._itemRole()
21925				} );
21926		this._addClass( newItems, "ui-menu-item" )
21927			._addClass( newWrappers, "ui-menu-item-wrapper" );
21928
21929		// Add aria-disabled attribute to any disabled menu item
21930		items.filter( ".ui-state-disabled" ).attr( "aria-disabled", "true" );
21931
21932		// If the active item has been removed, blur the menu
21933		if ( this.active && !$.contains( this.element[ 0 ], this.active[ 0 ] ) ) {
21934			this.blur();
21935		}
21936	},
21937
21938	_itemRole: function() {
21939		return {
21940			menu: "menuitem",
21941			listbox: "option"
21942		}[ this.options.role ];
21943	},
21944
21945	_setOption: function( key, value ) {
21946		if ( key === "icons" ) {
21947			var icons = this.element.find( ".ui-menu-icon" );
21948			this._removeClass( icons, null, this.options.icons.submenu )
21949				._addClass( icons, null, value.submenu );
21950		}
21951		this._super( key, value );
21952	},
21953
21954	_setOptionDisabled: function( value ) {
21955		this._super( value );
21956
21957		this.element.attr( "aria-disabled", String( value ) );
21958		this._toggleClass( null, "ui-state-disabled", !!value );
21959	},
21960
21961	focus: function( event, item ) {
21962		var nested, focused, activeParent;
21963		this.blur( event, event && event.type === "focus" );
21964
21965		this._scrollIntoView( item );
21966
21967		this.active = item.first();
21968
21969		focused = this.active.children( ".ui-menu-item-wrapper" );
21970		this._addClass( focused, null, "ui-state-active" );
21971
21972		// Only update aria-activedescendant if there's a role
21973		// otherwise we assume focus is managed elsewhere
21974		if ( this.options.role ) {
21975			this.element.attr( "aria-activedescendant", focused.attr( "id" ) );
21976		}
21977
21978		// Highlight active parent menu item, if any
21979		activeParent = this.active
21980			.parent()
21981				.closest( ".ui-menu-item" )
21982					.children( ".ui-menu-item-wrapper" );
21983		this._addClass( activeParent, null, "ui-state-active" );
21984
21985		if ( event && event.type === "keydown" ) {
21986			this._close();
21987		} else {
21988			this.timer = this._delay( function() {
21989				this._close();
21990			}, this.delay );
21991		}
21992
21993		nested = item.children( ".ui-menu" );
21994		if ( nested.length && event && ( /^mouse/.test( event.type ) ) ) {
21995			this._startOpening( nested );
21996		}
21997		this.activeMenu = item.parent();
21998
21999		this._trigger( "focus", event, { item: item } );
22000	},
22001
22002	_scrollIntoView: function( item ) {
22003		var borderTop, paddingTop, offset, scroll, elementHeight, itemHeight;
22004		if ( this._hasScroll() ) {
22005			borderTop = parseFloat( $.css( this.activeMenu[ 0 ], "borderTopWidth" ) ) || 0;
22006			paddingTop = parseFloat( $.css( this.activeMenu[ 0 ], "paddingTop" ) ) || 0;
22007			offset = item.offset().top - this.activeMenu.offset().top - borderTop - paddingTop;
22008			scroll = this.activeMenu.scrollTop();
22009			elementHeight = this.activeMenu.height();
22010			itemHeight = item.outerHeight();
22011
22012			if ( offset < 0 ) {
22013				this.activeMenu.scrollTop( scroll + offset );
22014			} else if ( offset + itemHeight > elementHeight ) {
22015				this.activeMenu.scrollTop( scroll + offset - elementHeight + itemHeight );
22016			}
22017		}
22018	},
22019
22020	blur: function( event, fromFocus ) {
22021		if ( !fromFocus ) {
22022			clearTimeout( this.timer );
22023		}
22024
22025		if ( !this.active ) {
22026			return;
22027		}
22028
22029		this._removeClass( this.active.children( ".ui-menu-item-wrapper" ),
22030			null, "ui-state-active" );
22031
22032		this._trigger( "blur", event, { item: this.active } );
22033		this.active = null;
22034	},
22035
22036	_startOpening: function( submenu ) {
22037		clearTimeout( this.timer );
22038
22039		// Don't open if already open fixes a Firefox bug that caused a .5 pixel
22040		// shift in the submenu position when mousing over the caret icon
22041		if ( submenu.attr( "aria-hidden" ) !== "true" ) {
22042			return;
22043		}
22044
22045		this.timer = this._delay( function() {
22046			this._close();
22047			this._open( submenu );
22048		}, this.delay );
22049	},
22050
22051	_open: function( submenu ) {
22052		var position = $.extend( {
22053			of: this.active
22054		}, this.options.position );
22055
22056		clearTimeout( this.timer );
22057		this.element.find( ".ui-menu" ).not( submenu.parents( ".ui-menu" ) )
22058			.hide()
22059			.attr( "aria-hidden", "true" );
22060
22061		submenu
22062			.show()
22063			.removeAttr( "aria-hidden" )
22064			.attr( "aria-expanded", "true" )
22065			.position( position );
22066	},
22067
22068	collapseAll: function( event, all ) {
22069		clearTimeout( this.timer );
22070		this.timer = this._delay( function() {
22071
22072			// If we were passed an event, look for the submenu that contains the event
22073			var currentMenu = all ? this.element :
22074				$( event && event.target ).closest( this.element.find( ".ui-menu" ) );
22075
22076			// If we found no valid submenu ancestor, use the main menu to close all
22077			// sub menus anyway
22078			if ( !currentMenu.length ) {
22079				currentMenu = this.element;
22080			}
22081
22082			this._close( currentMenu );
22083
22084			this.blur( event );
22085
22086			// Work around active item staying active after menu is blurred
22087			this._removeClass( currentMenu.find( ".ui-state-active" ), null, "ui-state-active" );
22088
22089			this.activeMenu = currentMenu;
22090		}, this.delay );
22091	},
22092
22093	// With no arguments, closes the currently active menu - if nothing is active
22094	// it closes all menus.  If passed an argument, it will search for menus BELOW
22095	_close: function( startMenu ) {
22096		if ( !startMenu ) {
22097			startMenu = this.active ? this.active.parent() : this.element;
22098		}
22099
22100		startMenu.find( ".ui-menu" )
22101			.hide()
22102			.attr( "aria-hidden", "true" )
22103			.attr( "aria-expanded", "false" );
22104	},
22105
22106	_closeOnDocumentClick: function( event ) {
22107		return !$( event.target ).closest( ".ui-menu" ).length;
22108	},
22109
22110	_isDivider: function( item ) {
22111
22112		// Match hyphen, em dash, en dash
22113		return !/[^\-\u2014\u2013\s]/.test( item.text() );
22114	},
22115
22116	collapse: function( event ) {
22117		var newItem = this.active &&
22118			this.active.parent().closest( ".ui-menu-item", this.element );
22119		if ( newItem && newItem.length ) {
22120			this._close();
22121			this.focus( event, newItem );
22122		}
22123	},
22124
22125	expand: function( event ) {
22126		var newItem = this.active &&
22127			this.active
22128				.children( ".ui-menu " )
22129					.find( this.options.items )
22130						.first();
22131
22132		if ( newItem && newItem.length ) {
22133			this._open( newItem.parent() );
22134
22135			// Delay so Firefox will not hide activedescendant change in expanding submenu from AT
22136			this._delay( function() {
22137				this.focus( event, newItem );
22138			} );
22139		}
22140	},
22141
22142	next: function( event ) {
22143		this._move( "next", "first", event );
22144	},
22145
22146	previous: function( event ) {
22147		this._move( "prev", "last", event );
22148	},
22149
22150	isFirstItem: function() {
22151		return this.active && !this.active.prevAll( ".ui-menu-item" ).length;
22152	},
22153
22154	isLastItem: function() {
22155		return this.active && !this.active.nextAll( ".ui-menu-item" ).length;
22156	},
22157
22158	_move: function( direction, filter, event ) {
22159		var next;
22160		if ( this.active ) {
22161			if ( direction === "first" || direction === "last" ) {
22162				next = this.active
22163					[ direction === "first" ? "prevAll" : "nextAll" ]( ".ui-menu-item" )
22164					.eq( -1 );
22165			} else {
22166				next = this.active
22167					[ direction + "All" ]( ".ui-menu-item" )
22168					.eq( 0 );
22169			}
22170		}
22171		if ( !next || !next.length || !this.active ) {
22172			next = this.activeMenu.find( this.options.items )[ filter ]();
22173		}
22174
22175		this.focus( event, next );
22176	},
22177
22178	nextPage: function( event ) {
22179		var item, base, height;
22180
22181		if ( !this.active ) {
22182			this.next( event );
22183			return;
22184		}
22185		if ( this.isLastItem() ) {
22186			return;
22187		}
22188		if ( this._hasScroll() ) {
22189			base = this.active.offset().top;
22190			height = this.element.height();
22191			this.active.nextAll( ".ui-menu-item" ).each( function() {
22192				item = $( this );
22193				return item.offset().top - base - height < 0;
22194			} );
22195
22196			this.focus( event, item );
22197		} else {
22198			this.focus( event, this.activeMenu.find( this.options.items )
22199				[ !this.active ? "first" : "last" ]() );
22200		}
22201	},
22202
22203	previousPage: function( event ) {
22204		var item, base, height;
22205		if ( !this.active ) {
22206			this.next( event );
22207			return;
22208		}
22209		if ( this.isFirstItem() ) {
22210			return;
22211		}
22212		if ( this._hasScroll() ) {
22213			base = this.active.offset().top;
22214			height = this.element.height();
22215			this.active.prevAll( ".ui-menu-item" ).each( function() {
22216				item = $( this );
22217				return item.offset().top - base + height > 0;
22218			} );
22219
22220			this.focus( event, item );
22221		} else {
22222			this.focus( event, this.activeMenu.find( this.options.items ).first() );
22223		}
22224	},
22225
22226	_hasScroll: function() {
22227		return this.element.outerHeight() < this.element.prop( "scrollHeight" );
22228	},
22229
22230	select: function( event ) {
22231
22232		// TODO: It should never be possible to not have an active item at this
22233		// point, but the tests don't trigger mouseenter before click.
22234		this.active = this.active || $( event.target ).closest( ".ui-menu-item" );
22235		var ui = { item: this.active };
22236		if ( !this.active.has( ".ui-menu" ).length ) {
22237			this.collapseAll( event, true );
22238		}
22239		this._trigger( "select", event, ui );
22240	},
22241
22242	_filterMenuItems: function( character ) {
22243		var escapedCharacter = character.replace( /[\-\[\]{}()*+?.,\\\^$|#\s]/g, "\\$&" ),
22244			regex = new RegExp( "^" + escapedCharacter, "i" );
22245
22246		return this.activeMenu
22247			.find( this.options.items )
22248
22249				// Only match on items, not dividers or other content (#10571)
22250				.filter( ".ui-menu-item" )
22251					.filter( function() {
22252						return regex.test(
22253							$.trim( $( this ).children( ".ui-menu-item-wrapper" ).text() ) );
22254					} );
22255	}
22256} );
22257
22258
22259/*!
22260 * jQuery UI Autocomplete 1.12.1
22261 * http://jqueryui.com
22262 *
22263 * Copyright jQuery Foundation and other contributors
22264 * Released under the MIT license.
22265 * http://jquery.org/license
22266 */
22267
22268//>>label: Autocomplete
22269//>>group: Widgets
22270//>>description: Lists suggested words as the user is typing.
22271//>>docs: http://api.jqueryui.com/autocomplete/
22272//>>demos: http://jqueryui.com/autocomplete/
22273//>>css.structure: ../../themes/base/core.css
22274//>>css.structure: ../../themes/base/autocomplete.css
22275//>>css.theme: ../../themes/base/theme.css
22276
22277
22278
22279$.widget( "ui.autocomplete", {
22280	version: "1.12.1",
22281	defaultElement: "<input>",
22282	options: {
22283		appendTo: null,
22284		autoFocus: false,
22285		delay: 300,
22286		minLength: 1,
22287		position: {
22288			my: "left top",
22289			at: "left bottom",
22290			collision: "none"
22291		},
22292		source: null,
22293
22294		// Callbacks
22295		change: null,
22296		close: null,
22297		focus: null,
22298		open: null,
22299		response: null,
22300		search: null,
22301		select: null
22302	},
22303
22304	requestIndex: 0,
22305	pending: 0,
22306
22307	_create: function() {
22308
22309		// Some browsers only repeat keydown events, not keypress events,
22310		// so we use the suppressKeyPress flag to determine if we've already
22311		// handled the keydown event. #7269
22312		// Unfortunately the code for & in keypress is the same as the up arrow,
22313		// so we use the suppressKeyPressRepeat flag to avoid handling keypress
22314		// events when we know the keydown event was used to modify the
22315		// search term. #7799
22316		var suppressKeyPress, suppressKeyPressRepeat, suppressInput,
22317			nodeName = this.element[ 0 ].nodeName.toLowerCase(),
22318			isTextarea = nodeName === "textarea",
22319			isInput = nodeName === "input";
22320
22321		// Textareas are always multi-line
22322		// Inputs are always single-line, even if inside a contentEditable element
22323		// IE also treats inputs as contentEditable
22324		// All other element types are determined by whether or not they're contentEditable
22325		this.isMultiLine = isTextarea || !isInput && this._isContentEditable( this.element );
22326
22327		this.valueMethod = this.element[ isTextarea || isInput ? "val" : "text" ];
22328		this.isNewMenu = true;
22329
22330		this._addClass( "ui-autocomplete-input" );
22331		this.element.attr( "autocomplete", "off" );
22332
22333		this._on( this.element, {
22334			keydown: function( event ) {
22335				if ( this.element.prop( "readOnly" ) ) {
22336					suppressKeyPress = true;
22337					suppressInput = true;
22338					suppressKeyPressRepeat = true;
22339					return;
22340				}
22341
22342				suppressKeyPress = false;
22343				suppressInput = false;
22344				suppressKeyPressRepeat = false;
22345				var keyCode = $.ui.keyCode;
22346				switch ( event.keyCode ) {
22347				case keyCode.PAGE_UP:
22348					suppressKeyPress = true;
22349					this._move( "previousPage", event );
22350					break;
22351				case keyCode.PAGE_DOWN:
22352					suppressKeyPress = true;
22353					this._move( "nextPage", event );
22354					break;
22355				case keyCode.UP:
22356					suppressKeyPress = true;
22357					this._keyEvent( "previous", event );
22358					break;
22359				case keyCode.DOWN:
22360					suppressKeyPress = true;
22361					this._keyEvent( "next", event );
22362					break;
22363				case keyCode.ENTER:
22364
22365					// when menu is open and has focus
22366					if ( this.menu.active ) {
22367
22368						// #6055 - Opera still allows the keypress to occur
22369						// which causes forms to submit
22370						suppressKeyPress = true;
22371						event.preventDefault();
22372						this.menu.select( event );
22373					}
22374					break;
22375				case keyCode.TAB:
22376					if ( this.menu.active ) {
22377						this.menu.select( event );
22378					}
22379					break;
22380				case keyCode.ESCAPE:
22381					if ( this.menu.element.is( ":visible" ) ) {
22382						if ( !this.isMultiLine ) {
22383							this._value( this.term );
22384						}
22385						this.close( event );
22386
22387						// Different browsers have different default behavior for escape
22388						// Single press can mean undo or clear
22389						// Double press in IE means clear the whole form
22390						event.preventDefault();
22391					}
22392					break;
22393				default:
22394					suppressKeyPressRepeat = true;
22395
22396					// search timeout should be triggered before the input value is changed
22397					this._searchTimeout( event );
22398					break;
22399				}
22400			},
22401			keypress: function( event ) {
22402				if ( suppressKeyPress ) {
22403					suppressKeyPress = false;
22404					if ( !this.isMultiLine || this.menu.element.is( ":visible" ) ) {
22405						event.preventDefault();
22406					}
22407					return;
22408				}
22409				if ( suppressKeyPressRepeat ) {
22410					return;
22411				}
22412
22413				// Replicate some key handlers to allow them to repeat in Firefox and Opera
22414				var keyCode = $.ui.keyCode;
22415				switch ( event.keyCode ) {
22416				case keyCode.PAGE_UP:
22417					this._move( "previousPage", event );
22418					break;
22419				case keyCode.PAGE_DOWN:
22420					this._move( "nextPage", event );
22421					break;
22422				case keyCode.UP:
22423					this._keyEvent( "previous", event );
22424					break;
22425				case keyCode.DOWN:
22426					this._keyEvent( "next", event );
22427					break;
22428				}
22429			},
22430			input: function( event ) {
22431				if ( suppressInput ) {
22432					suppressInput = false;
22433					event.preventDefault();
22434					return;
22435				}
22436				this._searchTimeout( event );
22437			},
22438			focus: function() {
22439				this.selectedItem = null;
22440				this.previous = this._value();
22441			},
22442			blur: function( event ) {
22443				if ( this.cancelBlur ) {
22444					delete this.cancelBlur;
22445					return;
22446				}
22447
22448				clearTimeout( this.searching );
22449				this.close( event );
22450				this._change( event );
22451			}
22452		} );
22453
22454		this._initSource();
22455		this.menu = $( "<ul>" )
22456			.appendTo( this._appendTo() )
22457			.menu( {
22458
22459				// disable ARIA support, the live region takes care of that
22460				role: null
22461			} )
22462			.hide()
22463			.menu( "instance" );
22464
22465		this._addClass( this.menu.element, "ui-autocomplete", "ui-front" );
22466		this._on( this.menu.element, {
22467			mousedown: function( event ) {
22468
22469				// prevent moving focus out of the text field
22470				event.preventDefault();
22471
22472				// IE doesn't prevent moving focus even with event.preventDefault()
22473				// so we set a flag to know when we should ignore the blur event
22474				this.cancelBlur = true;
22475				this._delay( function() {
22476					delete this.cancelBlur;
22477
22478					// Support: IE 8 only
22479					// Right clicking a menu item or selecting text from the menu items will
22480					// result in focus moving out of the input. However, we've already received
22481					// and ignored the blur event because of the cancelBlur flag set above. So
22482					// we restore focus to ensure that the menu closes properly based on the user's
22483					// next actions.
22484					if ( this.element[ 0 ] !== $.ui.safeActiveElement( this.document[ 0 ] ) ) {
22485						this.element.trigger( "focus" );
22486					}
22487				} );
22488			},
22489			menufocus: function( event, ui ) {
22490				var label, item;
22491
22492				// support: Firefox
22493				// Prevent accidental activation of menu items in Firefox (#7024 #9118)
22494				if ( this.isNewMenu ) {
22495					this.isNewMenu = false;
22496					if ( event.originalEvent && /^mouse/.test( event.originalEvent.type ) ) {
22497						this.menu.blur();
22498
22499						this.document.one( "mousemove", function() {
22500							$( event.target ).trigger( event.originalEvent );
22501						} );
22502
22503						return;
22504					}
22505				}
22506
22507				item = ui.item.data( "ui-autocomplete-item" );
22508				if ( false !== this._trigger( "focus", event, { item: item } ) ) {
22509
22510					// use value to match what will end up in the input, if it was a key event
22511					if ( event.originalEvent && /^key/.test( event.originalEvent.type ) ) {
22512						this._value( item.value );
22513					}
22514				}
22515
22516				// Announce the value in the liveRegion
22517				label = ui.item.attr( "aria-label" ) || item.value;
22518				if ( label && $.trim( label ).length ) {
22519					this.liveRegion.children().hide();
22520					$( "<div>" ).text( label ).appendTo( this.liveRegion );
22521				}
22522			},
22523			menuselect: function( event, ui ) {
22524				var item = ui.item.data( "ui-autocomplete-item" ),
22525					previous = this.previous;
22526
22527				// Only trigger when focus was lost (click on menu)
22528				if ( this.element[ 0 ] !== $.ui.safeActiveElement( this.document[ 0 ] ) ) {
22529					this.element.trigger( "focus" );
22530					this.previous = previous;
22531
22532					// #6109 - IE triggers two focus events and the second
22533					// is asynchronous, so we need to reset the previous
22534					// term synchronously and asynchronously :-(
22535					this._delay( function() {
22536						this.previous = previous;
22537						this.selectedItem = item;
22538					} );
22539				}
22540
22541				if ( false !== this._trigger( "select", event, { item: item } ) ) {
22542					this._value( item.value );
22543				}
22544
22545				// reset the term after the select event
22546				// this allows custom select handling to work properly
22547				this.term = this._value();
22548
22549				this.close( event );
22550				this.selectedItem = item;
22551			}
22552		} );
22553
22554		this.liveRegion = $( "<div>", {
22555			role: "status",
22556			"aria-live": "assertive",
22557			"aria-relevant": "additions"
22558		} )
22559			.appendTo( this.document[ 0 ].body );
22560
22561		this._addClass( this.liveRegion, null, "ui-helper-hidden-accessible" );
22562
22563		// Turning off autocomplete prevents the browser from remembering the
22564		// value when navigating through history, so we re-enable autocomplete
22565		// if the page is unloaded before the widget is destroyed. #7790
22566		this._on( this.window, {
22567			beforeunload: function() {
22568				this.element.removeAttr( "autocomplete" );
22569			}
22570		} );
22571	},
22572
22573	_destroy: function() {
22574		clearTimeout( this.searching );
22575		this.element.removeAttr( "autocomplete" );
22576		this.menu.element.remove();
22577		this.liveRegion.remove();
22578	},
22579
22580	_setOption: function( key, value ) {
22581		this._super( key, value );
22582		if ( key === "source" ) {
22583			this._initSource();
22584		}
22585		if ( key === "appendTo" ) {
22586			this.menu.element.appendTo( this._appendTo() );
22587		}
22588		if ( key === "disabled" && value && this.xhr ) {
22589			this.xhr.abort();
22590		}
22591	},
22592
22593	_isEventTargetInWidget: function( event ) {
22594		var menuElement = this.menu.element[ 0 ];
22595
22596		return event.target === this.element[ 0 ] ||
22597			event.target === menuElement ||
22598			$.contains( menuElement, event.target );
22599	},
22600
22601	_closeOnClickOutside: function( event ) {
22602		if ( !this._isEventTargetInWidget( event ) ) {
22603			this.close();
22604		}
22605	},
22606
22607	_appendTo: function() {
22608		var element = this.options.appendTo;
22609
22610		if ( element ) {
22611			element = element.jquery || element.nodeType ?
22612				$( element ) :
22613				this.document.find( element ).eq( 0 );
22614		}
22615
22616		if ( !element || !element[ 0 ] ) {
22617			element = this.element.closest( ".ui-front, dialog" );
22618		}
22619
22620		if ( !element.length ) {
22621			element = this.document[ 0 ].body;
22622		}
22623
22624		return element;
22625	},
22626
22627	_initSource: function() {
22628		var array, url,
22629			that = this;
22630		if ( $.isArray( this.options.source ) ) {
22631			array = this.options.source;
22632			this.source = function( request, response ) {
22633				response( $.ui.autocomplete.filter( array, request.term ) );
22634			};
22635		} else if ( typeof this.options.source === "string" ) {
22636			url = this.options.source;
22637			this.source = function( request, response ) {
22638				if ( that.xhr ) {
22639					that.xhr.abort();
22640				}
22641				that.xhr = $.ajax( {
22642					url: url,
22643					data: request,
22644					dataType: "json",
22645					success: function( data ) {
22646						response( data );
22647					},
22648					error: function() {
22649						response( [] );
22650					}
22651				} );
22652			};
22653		} else {
22654			this.source = this.options.source;
22655		}
22656	},
22657
22658	_searchTimeout: function( event ) {
22659		clearTimeout( this.searching );
22660		this.searching = this._delay( function() {
22661
22662			// Search if the value has changed, or if the user retypes the same value (see #7434)
22663			var equalValues = this.term === this._value(),
22664				menuVisible = this.menu.element.is( ":visible" ),
22665				modifierKey = event.altKey || event.ctrlKey || event.metaKey || event.shiftKey;
22666
22667			if ( !equalValues || ( equalValues && !menuVisible && !modifierKey ) ) {
22668				this.selectedItem = null;
22669				this.search( null, event );
22670			}
22671		}, this.options.delay );
22672	},
22673
22674	search: function( value, event ) {
22675		value = value != null ? value : this._value();
22676
22677		// Always save the actual value, not the one passed as an argument
22678		this.term = this._value();
22679
22680		if ( value.length < this.options.minLength ) {
22681			return this.close( event );
22682		}
22683
22684		if ( this._trigger( "search", event ) === false ) {
22685			return;
22686		}
22687
22688		return this._search( value );
22689	},
22690
22691	_search: function( value ) {
22692		this.pending++;
22693		this._addClass( "ui-autocomplete-loading" );
22694		this.cancelSearch = false;
22695
22696		this.source( { term: value }, this._response() );
22697	},
22698
22699	_response: function() {
22700		var index = ++this.requestIndex;
22701
22702		return $.proxy( function( content ) {
22703			if ( index === this.requestIndex ) {
22704				this.__response( content );
22705			}
22706
22707			this.pending--;
22708			if ( !this.pending ) {
22709				this._removeClass( "ui-autocomplete-loading" );
22710			}
22711		}, this );
22712	},
22713
22714	__response: function( content ) {
22715		if ( content ) {
22716			content = this._normalize( content );
22717		}
22718		this._trigger( "response", null, { content: content } );
22719		if ( !this.options.disabled && content && content.length && !this.cancelSearch ) {
22720			this._suggest( content );
22721			this._trigger( "open" );
22722		} else {
22723
22724			// use ._close() instead of .close() so we don't cancel future searches
22725			this._close();
22726		}
22727	},
22728
22729	close: function( event ) {
22730		this.cancelSearch = true;
22731		this._close( event );
22732	},
22733
22734	_close: function( event ) {
22735
22736		// Remove the handler that closes the menu on outside clicks
22737		this._off( this.document, "mousedown" );
22738
22739		if ( this.menu.element.is( ":visible" ) ) {
22740			this.menu.element.hide();
22741			this.menu.blur();
22742			this.isNewMenu = true;
22743			this._trigger( "close", event );
22744		}
22745	},
22746
22747	_change: function( event ) {
22748		if ( this.previous !== this._value() ) {
22749			this._trigger( "change", event, { item: this.selectedItem } );
22750		}
22751	},
22752
22753	_normalize: function( items ) {
22754
22755		// assume all items have the right format when the first item is complete
22756		if ( items.length && items[ 0 ].label && items[ 0 ].value ) {
22757			return items;
22758		}
22759		return $.map( items, function( item ) {
22760			if ( typeof item === "string" ) {
22761				return {
22762					label: item,
22763					value: item
22764				};
22765			}
22766			return $.extend( {}, item, {
22767				label: item.label || item.value,
22768				value: item.value || item.label
22769			} );
22770		} );
22771	},
22772
22773	_suggest: function( items ) {
22774		var ul = this.menu.element.empty();
22775		this._renderMenu( ul, items );
22776		this.isNewMenu = true;
22777		this.menu.refresh();
22778
22779		// Size and position menu
22780		ul.show();
22781		this._resizeMenu();
22782		ul.position( $.extend( {
22783			of: this.element
22784		}, this.options.position ) );
22785
22786		if ( this.options.autoFocus ) {
22787			this.menu.next();
22788		}
22789
22790		// Listen for interactions outside of the widget (#6642)
22791		this._on( this.document, {
22792			mousedown: "_closeOnClickOutside"
22793		} );
22794	},
22795
22796	_resizeMenu: function() {
22797		var ul = this.menu.element;
22798		ul.outerWidth( Math.max(
22799
22800			// Firefox wraps long text (possibly a rounding bug)
22801			// so we add 1px to avoid the wrapping (#7513)
22802			ul.width( "" ).outerWidth() + 1,
22803			this.element.outerWidth()
22804		) );
22805	},
22806
22807	_renderMenu: function( ul, items ) {
22808		var that = this;
22809		$.each( items, function( index, item ) {
22810			that._renderItemData( ul, item );
22811		} );
22812	},
22813
22814	_renderItemData: function( ul, item ) {
22815		return this._renderItem( ul, item ).data( "ui-autocomplete-item", item );
22816	},
22817
22818	_renderItem: function( ul, item ) {
22819		return $( "<li>" )
22820			.append( $( "<div>" ).text( item.label ) )
22821			.appendTo( ul );
22822	},
22823
22824	_move: function( direction, event ) {
22825		if ( !this.menu.element.is( ":visible" ) ) {
22826			this.search( null, event );
22827			return;
22828		}
22829		if ( this.menu.isFirstItem() && /^previous/.test( direction ) ||
22830				this.menu.isLastItem() && /^next/.test( direction ) ) {
22831
22832			if ( !this.isMultiLine ) {
22833				this._value( this.term );
22834			}
22835
22836			this.menu.blur();
22837			return;
22838		}
22839		this.menu[ direction ]( event );
22840	},
22841
22842	widget: function() {
22843		return this.menu.element;
22844	},
22845
22846	_value: function() {
22847		return this.valueMethod.apply( this.element, arguments );
22848	},
22849
22850	_keyEvent: function( keyEvent, event ) {
22851		if ( !this.isMultiLine || this.menu.element.is( ":visible" ) ) {
22852			this._move( keyEvent, event );
22853
22854			// Prevents moving cursor to beginning/end of the text field in some browsers
22855			event.preventDefault();
22856		}
22857	},
22858
22859	// Support: Chrome <=50
22860	// We should be able to just use this.element.prop( "isContentEditable" )
22861	// but hidden elements always report false in Chrome.
22862	// https://code.google.com/p/chromium/issues/detail?id=313082
22863	_isContentEditable: function( element ) {
22864		if ( !element.length ) {
22865			return false;
22866		}
22867
22868		var editable = element.prop( "contentEditable" );
22869
22870		if ( editable === "inherit" ) {
22871		  return this._isContentEditable( element.parent() );
22872		}
22873
22874		return editable === "true";
22875	}
22876} );
22877
22878$.extend( $.ui.autocomplete, {
22879	escapeRegex: function( value ) {
22880		return value.replace( /[\-\[\]{}()*+?.,\\\^$|#\s]/g, "\\$&" );
22881	},
22882	filter: function( array, term ) {
22883		var matcher = new RegExp( $.ui.autocomplete.escapeRegex( term ), "i" );
22884		return $.grep( array, function( value ) {
22885			return matcher.test( value.label || value.value || value );
22886		} );
22887	}
22888} );
22889
22890// Live region extension, adding a `messages` option
22891// NOTE: This is an experimental API. We are still investigating
22892// a full solution for string manipulation and internationalization.
22893$.widget( "ui.autocomplete", $.ui.autocomplete, {
22894	options: {
22895		messages: {
22896			noResults: "No search results.",
22897			results: function( amount ) {
22898				return amount + ( amount > 1 ? " results are" : " result is" ) +
22899					" available, use up and down arrow keys to navigate.";
22900			}
22901		}
22902	},
22903
22904	__response: function( content ) {
22905		var message;
22906		this._superApply( arguments );
22907		if ( this.options.disabled || this.cancelSearch ) {
22908			return;
22909		}
22910		if ( content && content.length ) {
22911			message = this.options.messages.results( content.length );
22912		} else {
22913			message = this.options.messages.noResults;
22914		}
22915		this.liveRegion.children().hide();
22916		$( "<div>" ).text( message ).appendTo( this.liveRegion );
22917	}
22918} );
22919
22920var widgetsAutocomplete = $.ui.autocomplete;
22921
22922
22923/*!
22924 * jQuery UI Controlgroup 1.12.1
22925 * http://jqueryui.com
22926 *
22927 * Copyright jQuery Foundation and other contributors
22928 * Released under the MIT license.
22929 * http://jquery.org/license
22930 */
22931
22932//>>label: Controlgroup
22933//>>group: Widgets
22934//>>description: Visually groups form control widgets
22935//>>docs: http://api.jqueryui.com/controlgroup/
22936//>>demos: http://jqueryui.com/controlgroup/
22937//>>css.structure: ../../themes/base/core.css
22938//>>css.structure: ../../themes/base/controlgroup.css
22939//>>css.theme: ../../themes/base/theme.css
22940
22941
22942var controlgroupCornerRegex = /ui-corner-([a-z]){2,6}/g;
22943
22944var widgetsControlgroup = $.widget( "ui.controlgroup", {
22945	version: "1.12.1",
22946	defaultElement: "<div>",
22947	options: {
22948		direction: "horizontal",
22949		disabled: null,
22950		onlyVisible: true,
22951		items: {
22952			"button": "input[type=button], input[type=submit], input[type=reset], button, a",
22953			"controlgroupLabel": ".ui-controlgroup-label",
22954			"checkboxradio": "input[type='checkbox'], input[type='radio']",
22955			"selectmenu": "select",
22956			"spinner": ".ui-spinner-input"
22957		}
22958	},
22959
22960	_create: function() {
22961		this._enhance();
22962	},
22963
22964	// To support the enhanced option in jQuery Mobile, we isolate DOM manipulation
22965	_enhance: function() {
22966		this.element.attr( "role", "toolbar" );
22967		this.refresh();
22968	},
22969
22970	_destroy: function() {
22971		this._callChildMethod( "destroy" );
22972		this.childWidgets.removeData( "ui-controlgroup-data" );
22973		this.element.removeAttr( "role" );
22974		if ( this.options.items.controlgroupLabel ) {
22975			this.element
22976				.find( this.options.items.controlgroupLabel )
22977				.find( ".ui-controlgroup-label-contents" )
22978				.contents().unwrap();
22979		}
22980	},
22981
22982	_initWidgets: function() {
22983		var that = this,
22984			childWidgets = [];
22985
22986		// First we iterate over each of the items options
22987		$.each( this.options.items, function( widget, selector ) {
22988			var labels;
22989			var options = {};
22990
22991			// Make sure the widget has a selector set
22992			if ( !selector ) {
22993				return;
22994			}
22995
22996			if ( widget === "controlgroupLabel" ) {
22997				labels = that.element.find( selector );
22998				labels.each( function() {
22999					var element = $( this );
23000
23001					if ( element.children( ".ui-controlgroup-label-contents" ).length ) {
23002						return;
23003					}
23004					element.contents()
23005						.wrapAll( "<span class='ui-controlgroup-label-contents'></span>" );
23006				} );
23007				that._addClass( labels, null, "ui-widget ui-widget-content ui-state-default" );
23008				childWidgets = childWidgets.concat( labels.get() );
23009				return;
23010			}
23011
23012			// Make sure the widget actually exists
23013			if ( !$.fn[ widget ] ) {
23014				return;
23015			}
23016
23017			// We assume everything is in the middle to start because we can't determine
23018			// first / last elements until all enhancments are done.
23019			if ( that[ "_" + widget + "Options" ] ) {
23020				options = that[ "_" + widget + "Options" ]( "middle" );
23021			} else {
23022				options = { classes: {} };
23023			}
23024
23025			// Find instances of this widget inside controlgroup and init them
23026			that.element
23027				.find( selector )
23028				.each( function() {
23029					var element = $( this );
23030					var instance = element[ widget ]( "instance" );
23031
23032					// We need to clone the default options for this type of widget to avoid
23033					// polluting the variable options which has a wider scope than a single widget.
23034					var instanceOptions = $.widget.extend( {}, options );
23035
23036					// If the button is the child of a spinner ignore it
23037					// TODO: Find a more generic solution
23038					if ( widget === "button" && element.parent( ".ui-spinner" ).length ) {
23039						return;
23040					}
23041
23042					// Create the widget if it doesn't exist
23043					if ( !instance ) {
23044						instance = element[ widget ]()[ widget ]( "instance" );
23045					}
23046					if ( instance ) {
23047						instanceOptions.classes =
23048							that._resolveClassesValues( instanceOptions.classes, instance );
23049					}
23050					element[ widget ]( instanceOptions );
23051
23052					// Store an instance of the controlgroup to be able to reference
23053					// from the outermost element for changing options and refresh
23054					var widgetElement = element[ widget ]( "widget" );
23055					$.data( widgetElement[ 0 ], "ui-controlgroup-data",
23056						instance ? instance : element[ widget ]( "instance" ) );
23057
23058					childWidgets.push( widgetElement[ 0 ] );
23059				} );
23060		} );
23061
23062		this.childWidgets = $( $.unique( childWidgets ) );
23063		this._addClass( this.childWidgets, "ui-controlgroup-item" );
23064	},
23065
23066	_callChildMethod: function( method ) {
23067		this.childWidgets.each( function() {
23068			var element = $( this ),
23069				data = element.data( "ui-controlgroup-data" );
23070			if ( data && data[ method ] ) {
23071				data[ method ]();
23072			}
23073		} );
23074	},
23075
23076	_updateCornerClass: function( element, position ) {
23077		var remove = "ui-corner-top ui-corner-bottom ui-corner-left ui-corner-right ui-corner-all";
23078		var add = this._buildSimpleOptions( position, "label" ).classes.label;
23079
23080		this._removeClass( element, null, remove );
23081		this._addClass( element, null, add );
23082	},
23083
23084	_buildSimpleOptions: function( position, key ) {
23085		var direction = this.options.direction === "vertical";
23086		var result = {
23087			classes: {}
23088		};
23089		result.classes[ key ] = {
23090			"middle": "",
23091			"first": "ui-corner-" + ( direction ? "top" : "left" ),
23092			"last": "ui-corner-" + ( direction ? "bottom" : "right" ),
23093			"only": "ui-corner-all"
23094		}[ position ];
23095
23096		return result;
23097	},
23098
23099	_spinnerOptions: function( position ) {
23100		var options = this._buildSimpleOptions( position, "ui-spinner" );
23101
23102		options.classes[ "ui-spinner-up" ] = "";
23103		options.classes[ "ui-spinner-down" ] = "";
23104
23105		return options;
23106	},
23107
23108	_buttonOptions: function( position ) {
23109		return this._buildSimpleOptions( position, "ui-button" );
23110	},
23111
23112	_checkboxradioOptions: function( position ) {
23113		return this._buildSimpleOptions( position, "ui-checkboxradio-label" );
23114	},
23115
23116	_selectmenuOptions: function( position ) {
23117		var direction = this.options.direction === "vertical";
23118		return {
23119			width: direction ? "auto" : false,
23120			classes: {
23121				middle: {
23122					"ui-selectmenu-button-open": "",
23123					"ui-selectmenu-button-closed": ""
23124				},
23125				first: {
23126					"ui-selectmenu-button-open": "ui-corner-" + ( direction ? "top" : "tl" ),
23127					"ui-selectmenu-button-closed": "ui-corner-" + ( direction ? "top" : "left" )
23128				},
23129				last: {
23130					"ui-selectmenu-button-open": direction ? "" : "ui-corner-tr",
23131					"ui-selectmenu-button-closed": "ui-corner-" + ( direction ? "bottom" : "right" )
23132				},
23133				only: {
23134					"ui-selectmenu-button-open": "ui-corner-top",
23135					"ui-selectmenu-button-closed": "ui-corner-all"
23136				}
23137
23138			}[ position ]
23139		};
23140	},
23141
23142	_resolveClassesValues: function( classes, instance ) {
23143		var result = {};
23144		$.each( classes, function( key ) {
23145			var current = instance.options.classes[ key ] || "";
23146			current = $.trim( current.replace( controlgroupCornerRegex, "" ) );
23147			result[ key ] = ( current + " " + classes[ key ] ).replace( /\s+/g, " " );
23148		} );
23149		return result;
23150	},
23151
23152	_setOption: function( key, value ) {
23153		if ( key === "direction" ) {
23154			this._removeClass( "ui-controlgroup-" + this.options.direction );
23155		}
23156
23157		this._super( key, value );
23158		if ( key === "disabled" ) {
23159			this._callChildMethod( value ? "disable" : "enable" );
23160			return;
23161		}
23162
23163		this.refresh();
23164	},
23165
23166	refresh: function() {
23167		var children,
23168			that = this;
23169
23170		this._addClass( "ui-controlgroup ui-controlgroup-" + this.options.direction );
23171
23172		if ( this.options.direction === "horizontal" ) {
23173			this._addClass( null, "ui-helper-clearfix" );
23174		}
23175		this._initWidgets();
23176
23177		children = this.childWidgets;
23178
23179		// We filter here because we need to track all childWidgets not just the visible ones
23180		if ( this.options.onlyVisible ) {
23181			children = children.filter( ":visible" );
23182		}
23183
23184		if ( children.length ) {
23185
23186			// We do this last because we need to make sure all enhancment is done
23187			// before determining first and last
23188			$.each( [ "first", "last" ], function( index, value ) {
23189				var instance = children[ value ]().data( "ui-controlgroup-data" );
23190
23191				if ( instance && that[ "_" + instance.widgetName + "Options" ] ) {
23192					var options = that[ "_" + instance.widgetName + "Options" ](
23193						children.length === 1 ? "only" : value
23194					);
23195					options.classes = that._resolveClassesValues( options.classes, instance );
23196					instance.element[ instance.widgetName ]( options );
23197				} else {
23198					that._updateCornerClass( children[ value ](), value );
23199				}
23200			} );
23201
23202			// Finally call the refresh method on each of the child widgets.
23203			this._callChildMethod( "refresh" );
23204		}
23205	}
23206} );
23207
23208/*!
23209 * jQuery UI Checkboxradio 1.12.1
23210 * http://jqueryui.com
23211 *
23212 * Copyright jQuery Foundation and other contributors
23213 * Released under the MIT license.
23214 * http://jquery.org/license
23215 */
23216
23217//>>label: Checkboxradio
23218//>>group: Widgets
23219//>>description: Enhances a form with multiple themeable checkboxes or radio buttons.
23220//>>docs: http://api.jqueryui.com/checkboxradio/
23221//>>demos: http://jqueryui.com/checkboxradio/
23222//>>css.structure: ../../themes/base/core.css
23223//>>css.structure: ../../themes/base/button.css
23224//>>css.structure: ../../themes/base/checkboxradio.css
23225//>>css.theme: ../../themes/base/theme.css
23226
23227
23228
23229$.widget( "ui.checkboxradio", [ $.ui.formResetMixin, {
23230	version: "1.12.1",
23231	options: {
23232		disabled: null,
23233		label: null,
23234		icon: true,
23235		classes: {
23236			"ui-checkboxradio-label": "ui-corner-all",
23237			"ui-checkboxradio-icon": "ui-corner-all"
23238		}
23239	},
23240
23241	_getCreateOptions: function() {
23242		var disabled, labels;
23243		var that = this;
23244		var options = this._super() || {};
23245
23246		// We read the type here, because it makes more sense to throw a element type error first,
23247		// rather then the error for lack of a label. Often if its the wrong type, it
23248		// won't have a label (e.g. calling on a div, btn, etc)
23249		this._readType();
23250
23251		labels = this.element.labels();
23252
23253		// If there are multiple labels, use the last one
23254		this.label = $( labels[ labels.length - 1 ] );
23255		if ( !this.label.length ) {
23256			$.error( "No label found for checkboxradio widget" );
23257		}
23258
23259		this.originalLabel = "";
23260
23261		// We need to get the label text but this may also need to make sure it does not contain the
23262		// input itself.
23263		this.label.contents().not( this.element[ 0 ] ).each( function() {
23264
23265			// The label contents could be text, html, or a mix. We concat each element to get a
23266			// string representation of the label, without the input as part of it.
23267			that.originalLabel += this.nodeType === 3 ? $( this ).text() : this.outerHTML;
23268		} );
23269
23270		// Set the label option if we found label text
23271		if ( this.originalLabel ) {
23272			options.label = this.originalLabel;
23273		}
23274
23275		disabled = this.element[ 0 ].disabled;
23276		if ( disabled != null ) {
23277			options.disabled = disabled;
23278		}
23279		return options;
23280	},
23281
23282	_create: function() {
23283		var checked = this.element[ 0 ].checked;
23284
23285		this._bindFormResetHandler();
23286
23287		if ( this.options.disabled == null ) {
23288			this.options.disabled = this.element[ 0 ].disabled;
23289		}
23290
23291		this._setOption( "disabled", this.options.disabled );
23292		this._addClass( "ui-checkboxradio", "ui-helper-hidden-accessible" );
23293		this._addClass( this.label, "ui-checkboxradio-label", "ui-button ui-widget" );
23294
23295		if ( this.type === "radio" ) {
23296			this._addClass( this.label, "ui-checkboxradio-radio-label" );
23297		}
23298
23299		if ( this.options.label && this.options.label !== this.originalLabel ) {
23300			this._updateLabel();
23301		} else if ( this.originalLabel ) {
23302			this.options.label = this.originalLabel;
23303		}
23304
23305		this._enhance();
23306
23307		if ( checked ) {
23308			this._addClass( this.label, "ui-checkboxradio-checked", "ui-state-active" );
23309			if ( this.icon ) {
23310				this._addClass( this.icon, null, "ui-state-hover" );
23311			}
23312		}
23313
23314		this._on( {
23315			change: "_toggleClasses",
23316			focus: function() {
23317				this._addClass( this.label, null, "ui-state-focus ui-visual-focus" );
23318			},
23319			blur: function() {
23320				this._removeClass( this.label, null, "ui-state-focus ui-visual-focus" );
23321			}
23322		} );
23323	},
23324
23325	_readType: function() {
23326		var nodeName = this.element[ 0 ].nodeName.toLowerCase();
23327		this.type = this.element[ 0 ].type;
23328		if ( nodeName !== "input" || !/radio|checkbox/.test( this.type ) ) {
23329			$.error( "Can't create checkboxradio on element.nodeName=" + nodeName +
23330				" and element.type=" + this.type );
23331		}
23332	},
23333
23334	// Support jQuery Mobile enhanced option
23335	_enhance: function() {
23336		this._updateIcon( this.element[ 0 ].checked );
23337	},
23338
23339	widget: function() {
23340		return this.label;
23341	},
23342
23343	_getRadioGroup: function() {
23344		var group;
23345		var name = this.element[ 0 ].name;
23346		var nameSelector = "input[name='" + $.ui.escapeSelector( name ) + "']";
23347
23348		if ( !name ) {
23349			return $( [] );
23350		}
23351
23352		if ( this.form.length ) {
23353			group = $( this.form[ 0 ].elements ).filter( nameSelector );
23354		} else {
23355
23356			// Not inside a form, check all inputs that also are not inside a form
23357			group = $( nameSelector ).filter( function() {
23358				return $( this ).form().length === 0;
23359			} );
23360		}
23361
23362		return group.not( this.element );
23363	},
23364
23365	_toggleClasses: function() {
23366		var checked = this.element[ 0 ].checked;
23367		this._toggleClass( this.label, "ui-checkboxradio-checked", "ui-state-active", checked );
23368
23369		if ( this.options.icon && this.type === "checkbox" ) {
23370			this._toggleClass( this.icon, null, "ui-icon-check ui-state-checked", checked )
23371				._toggleClass( this.icon, null, "ui-icon-blank", !checked );
23372		}
23373
23374		if ( this.type === "radio" ) {
23375			this._getRadioGroup()
23376				.each( function() {
23377					var instance = $( this ).checkboxradio( "instance" );
23378
23379					if ( instance ) {
23380						instance._removeClass( instance.label,
23381							"ui-checkboxradio-checked", "ui-state-active" );
23382					}
23383				} );
23384		}
23385	},
23386
23387	_destroy: function() {
23388		this._unbindFormResetHandler();
23389
23390		if ( this.icon ) {
23391			this.icon.remove();
23392			this.iconSpace.remove();
23393		}
23394	},
23395
23396	_setOption: function( key, value ) {
23397
23398		// We don't allow the value to be set to nothing
23399		if ( key === "label" && !value ) {
23400			return;
23401		}
23402
23403		this._super( key, value );
23404
23405		if ( key === "disabled" ) {
23406			this._toggleClass( this.label, null, "ui-state-disabled", value );
23407			this.element[ 0 ].disabled = value;
23408
23409			// Don't refresh when setting disabled
23410			return;
23411		}
23412		this.refresh();
23413	},
23414
23415	_updateIcon: function( checked ) {
23416		var toAdd = "ui-icon ui-icon-background ";
23417
23418		if ( this.options.icon ) {
23419			if ( !this.icon ) {
23420				this.icon = $( "<span>" );
23421				this.iconSpace = $( "<span> </span>" );
23422				this._addClass( this.iconSpace, "ui-checkboxradio-icon-space" );
23423			}
23424
23425			if ( this.type === "checkbox" ) {
23426				toAdd += checked ? "ui-icon-check ui-state-checked" : "ui-icon-blank";
23427				this._removeClass( this.icon, null, checked ? "ui-icon-blank" : "ui-icon-check" );
23428			} else {
23429				toAdd += "ui-icon-blank";
23430			}
23431			this._addClass( this.icon, "ui-checkboxradio-icon", toAdd );
23432			if ( !checked ) {
23433				this._removeClass( this.icon, null, "ui-icon-check ui-state-checked" );
23434			}
23435			this.icon.prependTo( this.label ).after( this.iconSpace );
23436		} else if ( this.icon !== undefined ) {
23437			this.icon.remove();
23438			this.iconSpace.remove();
23439			delete this.icon;
23440		}
23441	},
23442
23443	_updateLabel: function() {
23444
23445		// Remove the contents of the label ( minus the icon, icon space, and input )
23446		var contents = this.label.contents().not( this.element[ 0 ] );
23447		if ( this.icon ) {
23448			contents = contents.not( this.icon[ 0 ] );
23449		}
23450		if ( this.iconSpace ) {
23451			contents = contents.not( this.iconSpace[ 0 ] );
23452		}
23453		contents.remove();
23454
23455		this.label.append( this.options.label );
23456	},
23457
23458	refresh: function() {
23459		var checked = this.element[ 0 ].checked,
23460			isDisabled = this.element[ 0 ].disabled;
23461
23462		this._updateIcon( checked );
23463		this._toggleClass( this.label, "ui-checkboxradio-checked", "ui-state-active", checked );
23464		if ( this.options.label !== null ) {
23465			this._updateLabel();
23466		}
23467
23468		if ( isDisabled !== this.options.disabled ) {
23469			this._setOptions( { "disabled": isDisabled } );
23470		}
23471	}
23472
23473} ] );
23474
23475var widgetsCheckboxradio = $.ui.checkboxradio;
23476
23477
23478/*!
23479 * jQuery UI Button 1.12.1
23480 * http://jqueryui.com
23481 *
23482 * Copyright jQuery Foundation and other contributors
23483 * Released under the MIT license.
23484 * http://jquery.org/license
23485 */
23486
23487//>>label: Button
23488//>>group: Widgets
23489//>>description: Enhances a form with themeable buttons.
23490//>>docs: http://api.jqueryui.com/button/
23491//>>demos: http://jqueryui.com/button/
23492//>>css.structure: ../../themes/base/core.css
23493//>>css.structure: ../../themes/base/button.css
23494//>>css.theme: ../../themes/base/theme.css
23495
23496
23497
23498$.widget( "ui.button", {
23499	version: "1.12.1",
23500	defaultElement: "<button>",
23501	options: {
23502		classes: {
23503			"ui-button": "ui-corner-all"
23504		},
23505		disabled: null,
23506		icon: null,
23507		iconPosition: "beginning",
23508		label: null,
23509		showLabel: true
23510	},
23511
23512	_getCreateOptions: function() {
23513		var disabled,
23514
23515			// This is to support cases like in jQuery Mobile where the base widget does have
23516			// an implementation of _getCreateOptions
23517			options = this._super() || {};
23518
23519		this.isInput = this.element.is( "input" );
23520
23521		disabled = this.element[ 0 ].disabled;
23522		if ( disabled != null ) {
23523			options.disabled = disabled;
23524		}
23525
23526		this.originalLabel = this.isInput ? this.element.val() : this.element.html();
23527		if ( this.originalLabel ) {
23528			options.label = this.originalLabel;
23529		}
23530
23531		return options;
23532	},
23533
23534	_create: function() {
23535		if ( !this.option.showLabel & !this.options.icon ) {
23536			this.options.showLabel = true;
23537		}
23538
23539		// We have to check the option again here even though we did in _getCreateOptions,
23540		// because null may have been passed on init which would override what was set in
23541		// _getCreateOptions
23542		if ( this.options.disabled == null ) {
23543			this.options.disabled = this.element[ 0 ].disabled || false;
23544		}
23545
23546		this.hasTitle = !!this.element.attr( "title" );
23547
23548		// Check to see if the label needs to be set or if its already correct
23549		if ( this.options.label && this.options.label !== this.originalLabel ) {
23550			if ( this.isInput ) {
23551				this.element.val( this.options.label );
23552			} else {
23553				this.element.html( this.options.label );
23554			}
23555		}
23556		this._addClass( "ui-button", "ui-widget" );
23557		this._setOption( "disabled", this.options.disabled );
23558		this._enhance();
23559
23560		if ( this.element.is( "a" ) ) {
23561			this._on( {
23562				"keyup": function( event ) {
23563					if ( event.keyCode === $.ui.keyCode.SPACE ) {
23564						event.preventDefault();
23565
23566						// Support: PhantomJS <= 1.9, IE 8 Only
23567						// If a native click is available use it so we actually cause navigation
23568						// otherwise just trigger a click event
23569						if ( this.element[ 0 ].click ) {
23570							this.element[ 0 ].click();
23571						} else {
23572							this.element.trigger( "click" );
23573						}
23574					}
23575				}
23576			} );
23577		}
23578	},
23579
23580	_enhance: function() {
23581		if ( !this.element.is( "button" ) ) {
23582			this.element.attr( "role", "button" );
23583		}
23584
23585		if ( this.options.icon ) {
23586			this._updateIcon( "icon", this.options.icon );
23587			this._updateTooltip();
23588		}
23589	},
23590
23591	_updateTooltip: function() {
23592		this.title = this.element.attr( "title" );
23593
23594		if ( !this.options.showLabel && !this.title ) {
23595			this.element.attr( "title", this.options.label );
23596		}
23597	},
23598
23599	_updateIcon: function( option, value ) {
23600		var icon = option !== "iconPosition",
23601			position = icon ? this.options.iconPosition : value,
23602			displayBlock = position === "top" || position === "bottom";
23603
23604		// Create icon
23605		if ( !this.icon ) {
23606			this.icon = $( "<span>" );
23607
23608			this._addClass( this.icon, "ui-button-icon", "ui-icon" );
23609
23610			if ( !this.options.showLabel ) {
23611				this._addClass( "ui-button-icon-only" );
23612			}
23613		} else if ( icon ) {
23614
23615			// If we are updating the icon remove the old icon class
23616			this._removeClass( this.icon, null, this.options.icon );
23617		}
23618
23619		// If we are updating the icon add the new icon class
23620		if ( icon ) {
23621			this._addClass( this.icon, null, value );
23622		}
23623
23624		this._attachIcon( position );
23625
23626		// If the icon is on top or bottom we need to add the ui-widget-icon-block class and remove
23627		// the iconSpace if there is one.
23628		if ( displayBlock ) {
23629			this._addClass( this.icon, null, "ui-widget-icon-block" );
23630			if ( this.iconSpace ) {
23631				this.iconSpace.remove();
23632			}
23633		} else {
23634
23635			// Position is beginning or end so remove the ui-widget-icon-block class and add the
23636			// space if it does not exist
23637			if ( !this.iconSpace ) {
23638				this.iconSpace = $( "<span> </span>" );
23639				this._addClass( this.iconSpace, "ui-button-icon-space" );
23640			}
23641			this._removeClass( this.icon, null, "ui-wiget-icon-block" );
23642			this._attachIconSpace( position );
23643		}
23644	},
23645
23646	_destroy: function() {
23647		this.element.removeAttr( "role" );
23648
23649		if ( this.icon ) {
23650			this.icon.remove();
23651		}
23652		if ( this.iconSpace ) {
23653			this.iconSpace.remove();
23654		}
23655		if ( !this.hasTitle ) {
23656			this.element.removeAttr( "title" );
23657		}
23658	},
23659
23660	_attachIconSpace: function( iconPosition ) {
23661		this.icon[ /^(?:end|bottom)/.test( iconPosition ) ? "before" : "after" ]( this.iconSpace );
23662	},
23663
23664	_attachIcon: function( iconPosition ) {
23665		this.element[ /^(?:end|bottom)/.test( iconPosition ) ? "append" : "prepend" ]( this.icon );
23666	},
23667
23668	_setOptions: function( options ) {
23669		var newShowLabel = options.showLabel === undefined ?
23670				this.options.showLabel :
23671				options.showLabel,
23672			newIcon = options.icon === undefined ? this.options.icon : options.icon;
23673
23674		if ( !newShowLabel && !newIcon ) {
23675			options.showLabel = true;
23676		}
23677		this._super( options );
23678	},
23679
23680	_setOption: function( key, value ) {
23681		if ( key === "icon" ) {
23682			if ( value ) {
23683				this._updateIcon( key, value );
23684			} else if ( this.icon ) {
23685				this.icon.remove();
23686				if ( this.iconSpace ) {
23687					this.iconSpace.remove();
23688				}
23689			}
23690		}
23691
23692		if ( key === "iconPosition" ) {
23693			this._updateIcon( key, value );
23694		}
23695
23696		// Make sure we can't end up with a button that has neither text nor icon
23697		if ( key === "showLabel" ) {
23698				this._toggleClass( "ui-button-icon-only", null, !value );
23699				this._updateTooltip();
23700		}
23701
23702		if ( key === "label" ) {
23703			if ( this.isInput ) {
23704				this.element.val( value );
23705			} else {
23706
23707				// If there is an icon, append it, else nothing then append the value
23708				// this avoids removal of the icon when setting label text
23709				this.element.html( value );
23710				if ( this.icon ) {
23711					this._attachIcon( this.options.iconPosition );
23712					this._attachIconSpace( this.options.iconPosition );
23713				}
23714			}
23715		}
23716
23717		this._super( key, value );
23718
23719		if ( key === "disabled" ) {
23720			this._toggleClass( null, "ui-state-disabled", value );
23721			this.element[ 0 ].disabled = value;
23722			if ( value ) {
23723				this.element.blur();
23724			}
23725		}
23726	},
23727
23728	refresh: function() {
23729
23730		// Make sure to only check disabled if its an element that supports this otherwise
23731		// check for the disabled class to determine state
23732		var isDisabled = this.element.is( "input, button" ) ?
23733			this.element[ 0 ].disabled : this.element.hasClass( "ui-button-disabled" );
23734
23735		if ( isDisabled !== this.options.disabled ) {
23736			this._setOptions( { disabled: isDisabled } );
23737		}
23738
23739		this._updateTooltip();
23740	}
23741} );
23742
23743// DEPRECATED
23744if ( $.uiBackCompat !== false ) {
23745
23746	// Text and Icons options
23747	$.widget( "ui.button", $.ui.button, {
23748		options: {
23749			text: true,
23750			icons: {
23751				primary: null,
23752				secondary: null
23753			}
23754		},
23755
23756		_create: function() {
23757			if ( this.options.showLabel && !this.options.text ) {
23758				this.options.showLabel = this.options.text;
23759			}
23760			if ( !this.options.showLabel && this.options.text ) {
23761				this.options.text = this.options.showLabel;
23762			}
23763			if ( !this.options.icon && ( this.options.icons.primary ||
23764					this.options.icons.secondary ) ) {
23765				if ( this.options.icons.primary ) {
23766					this.options.icon = this.options.icons.primary;
23767				} else {
23768					this.options.icon = this.options.icons.secondary;
23769					this.options.iconPosition = "end";
23770				}
23771			} else if ( this.options.icon ) {
23772				this.options.icons.primary = this.options.icon;
23773			}
23774			this._super();
23775		},
23776
23777		_setOption: function( key, value ) {
23778			if ( key === "text" ) {
23779				this._super( "showLabel", value );
23780				return;
23781			}
23782			if ( key === "showLabel" ) {
23783				this.options.text = value;
23784			}
23785			if ( key === "icon" ) {
23786				this.options.icons.primary = value;
23787			}
23788			if ( key === "icons" ) {
23789				if ( value.primary ) {
23790					this._super( "icon", value.primary );
23791					this._super( "iconPosition", "beginning" );
23792				} else if ( value.secondary ) {
23793					this._super( "icon", value.secondary );
23794					this._super( "iconPosition", "end" );
23795				}
23796			}
23797			this._superApply( arguments );
23798		}
23799	} );
23800
23801	$.fn.button = ( function( orig ) {
23802		return function() {
23803			if ( !this.length || ( this.length && this[ 0 ].tagName !== "INPUT" ) ||
23804					( this.length && this[ 0 ].tagName === "INPUT" && (
23805						this.attr( "type" ) !== "checkbox" && this.attr( "type" ) !== "radio"
23806					) ) ) {
23807				return orig.apply( this, arguments );
23808			}
23809			if ( !$.ui.checkboxradio ) {
23810				$.error( "Checkboxradio widget missing" );
23811			}
23812			if ( arguments.length === 0 ) {
23813				return this.checkboxradio( {
23814					"icon": false
23815				} );
23816			}
23817			return this.checkboxradio.apply( this, arguments );
23818		};
23819	} )( $.fn.button );
23820
23821	$.fn.buttonset = function() {
23822		if ( !$.ui.controlgroup ) {
23823			$.error( "Controlgroup widget missing" );
23824		}
23825		if ( arguments[ 0 ] === "option" && arguments[ 1 ] === "items" && arguments[ 2 ] ) {
23826			return this.controlgroup.apply( this,
23827				[ arguments[ 0 ], "items.button", arguments[ 2 ] ] );
23828		}
23829		if ( arguments[ 0 ] === "option" && arguments[ 1 ] === "items" ) {
23830			return this.controlgroup.apply( this, [ arguments[ 0 ], "items.button" ] );
23831		}
23832		if ( typeof arguments[ 0 ] === "object" && arguments[ 0 ].items ) {
23833			arguments[ 0 ].items = {
23834				button: arguments[ 0 ].items
23835			};
23836		}
23837		return this.controlgroup.apply( this, arguments );
23838	};
23839}
23840
23841var widgetsButton = $.ui.button;
23842
23843
23844// jscs:disable maximumLineLength
23845/* jscs:disable requireCamelCaseOrUpperCaseIdentifiers */
23846/*!
23847 * jQuery UI Datepicker 1.12.1
23848 * http://jqueryui.com
23849 *
23850 * Copyright jQuery Foundation and other contributors
23851 * Released under the MIT license.
23852 * http://jquery.org/license
23853 */
23854
23855//>>label: Datepicker
23856//>>group: Widgets
23857//>>description: Displays a calendar from an input or inline for selecting dates.
23858//>>docs: http://api.jqueryui.com/datepicker/
23859//>>demos: http://jqueryui.com/datepicker/
23860//>>css.structure: ../../themes/base/core.css
23861//>>css.structure: ../../themes/base/datepicker.css
23862//>>css.theme: ../../themes/base/theme.css
23863
23864
23865
23866$.extend( $.ui, { datepicker: { version: "1.12.1" } } );
23867
23868var datepicker_instActive;
23869
23870function datepicker_getZindex( elem ) {
23871	var position, value;
23872	while ( elem.length && elem[ 0 ] !== document ) {
23873
23874		// Ignore z-index if position is set to a value where z-index is ignored by the browser
23875		// This makes behavior of this function consistent across browsers
23876		// WebKit always returns auto if the element is positioned
23877		position = elem.css( "position" );
23878		if ( position === "absolute" || position === "relative" || position === "fixed" ) {
23879
23880			// IE returns 0 when zIndex is not specified
23881			// other browsers return a string
23882			// we ignore the case of nested elements with an explicit value of 0
23883			// <div style="z-index: -10;"><div style="z-index: 0;"></div></div>
23884			value = parseInt( elem.css( "zIndex" ), 10 );
23885			if ( !isNaN( value ) && value !== 0 ) {
23886				return value;
23887			}
23888		}
23889		elem = elem.parent();
23890	}
23891
23892	return 0;
23893}
23894/* Date picker manager.
23895   Use the singleton instance of this class, $.datepicker, to interact with the date picker.
23896   Settings for (groups of) date pickers are maintained in an instance object,
23897   allowing multiple different settings on the same page. */
23898
23899function Datepicker() {
23900	this._curInst = null; // The current instance in use
23901	this._keyEvent = false; // If the last event was a key event
23902	this._disabledInputs = []; // List of date picker inputs that have been disabled
23903	this._datepickerShowing = false; // True if the popup picker is showing , false if not
23904	this._inDialog = false; // True if showing within a "dialog", false if not
23905	this._mainDivId = "ui-datepicker-div"; // The ID of the main datepicker division
23906	this._inlineClass = "ui-datepicker-inline"; // The name of the inline marker class
23907	this._appendClass = "ui-datepicker-append"; // The name of the append marker class
23908	this._triggerClass = "ui-datepicker-trigger"; // The name of the trigger marker class
23909	this._dialogClass = "ui-datepicker-dialog"; // The name of the dialog marker class
23910	this._disableClass = "ui-datepicker-disabled"; // The name of the disabled covering marker class
23911	this._unselectableClass = "ui-datepicker-unselectable"; // The name of the unselectable cell marker class
23912	this._currentClass = "ui-datepicker-current-day"; // The name of the current day marker class
23913	this._dayOverClass = "ui-datepicker-days-cell-over"; // The name of the day hover marker class
23914	this.regional = []; // Available regional settings, indexed by language code
23915	this.regional[ "" ] = { // Default regional settings
23916		closeText: "Done", // Display text for close link
23917		prevText: "Prev", // Display text for previous month link
23918		nextText: "Next", // Display text for next month link
23919		currentText: "Today", // Display text for current month link
23920		monthNames: [ "January","February","March","April","May","June",
23921			"July","August","September","October","November","December" ], // Names of months for drop-down and formatting
23922		monthNamesShort: [ "Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec" ], // For formatting
23923		dayNames: [ "Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday" ], // For formatting
23924		dayNamesShort: [ "Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat" ], // For formatting
23925		dayNamesMin: [ "Su","Mo","Tu","We","Th","Fr","Sa" ], // Column headings for days starting at Sunday
23926		weekHeader: "Wk", // Column header for week of the year
23927		dateFormat: "mm/dd/yy", // See format options on parseDate
23928		firstDay: 0, // The first day of the week, Sun = 0, Mon = 1, ...
23929		isRTL: false, // True if right-to-left language, false if left-to-right
23930		showMonthAfterYear: false, // True if the year select precedes month, false for month then year
23931		yearSuffix: "" // Additional text to append to the year in the month headers
23932	};
23933	this._defaults = { // Global defaults for all the date picker instances
23934		showOn: "focus", // "focus" for popup on focus,
23935			// "button" for trigger button, or "both" for either
23936		showAnim: "fadeIn", // Name of jQuery animation for popup
23937		showOptions: {}, // Options for enhanced animations
23938		defaultDate: null, // Used when field is blank: actual date,
23939			// +/-number for offset from today, null for today
23940		appendText: "", // Display text following the input box, e.g. showing the format
23941		buttonText: "...", // Text for trigger button
23942		buttonImage: "", // URL for trigger button image
23943		buttonImageOnly: false, // True if the image appears alone, false if it appears on a button
23944		hideIfNoPrevNext: false, // True to hide next/previous month links
23945			// if not applicable, false to just disable them
23946		navigationAsDateFormat: false, // True if date formatting applied to prev/today/next links
23947		gotoCurrent: false, // True if today link goes back to current selection instead
23948		changeMonth: false, // True if month can be selected directly, false if only prev/next
23949		changeYear: false, // True if year can be selected directly, false if only prev/next
23950		yearRange: "c-10:c+10", // Range of years to display in drop-down,
23951			// either relative to today's year (-nn:+nn), relative to currently displayed year
23952			// (c-nn:c+nn), absolute (nnnn:nnnn), or a combination of the above (nnnn:-n)
23953		showOtherMonths: false, // True to show dates in other months, false to leave blank
23954		selectOtherMonths: false, // True to allow selection of dates in other months, false for unselectable
23955		showWeek: false, // True to show week of the year, false to not show it
23956		calculateWeek: this.iso8601Week, // How to calculate the week of the year,
23957			// takes a Date and returns the number of the week for it
23958		shortYearCutoff: "+10", // Short year values < this are in the current century,
23959			// > this are in the previous century,
23960			// string value starting with "+" for current year + value
23961		minDate: null, // The earliest selectable date, or null for no limit
23962		maxDate: null, // The latest selectable date, or null for no limit
23963		duration: "fast", // Duration of display/closure
23964		beforeShowDay: null, // Function that takes a date and returns an array with
23965			// [0] = true if selectable, false if not, [1] = custom CSS class name(s) or "",
23966			// [2] = cell title (optional), e.g. $.datepicker.noWeekends
23967		beforeShow: null, // Function that takes an input field and
23968			// returns a set of custom settings for the date picker
23969		onSelect: null, // Define a callback function when a date is selected
23970		onChangeMonthYear: null, // Define a callback function when the month or year is changed
23971		onClose: null, // Define a callback function when the datepicker is closed
23972		numberOfMonths: 1, // Number of months to show at a time
23973		showCurrentAtPos: 0, // The position in multipe months at which to show the current month (starting at 0)
23974		stepMonths: 1, // Number of months to step back/forward
23975		stepBigMonths: 12, // Number of months to step back/forward for the big links
23976		altField: "", // Selector for an alternate field to store selected dates into
23977		altFormat: "", // The date format to use for the alternate field
23978		constrainInput: true, // The input is constrained by the current date format
23979		showButtonPanel: false, // True to show button panel, false to not show it
23980		autoSize: false, // True to size the input for the date format, false to leave as is
23981		disabled: false // The initial disabled state
23982	};
23983	$.extend( this._defaults, this.regional[ "" ] );
23984	this.regional.en = $.extend( true, {}, this.regional[ "" ] );
23985	this.regional[ "en-US" ] = $.extend( true, {}, this.regional.en );
23986	this.dpDiv = datepicker_bindHover( $( "<div id='" + this._mainDivId + "' class='ui-datepicker ui-widget ui-widget-content ui-helper-clearfix ui-corner-all'></div>" ) );
23987}
23988
23989$.extend( Datepicker.prototype, {
23990	/* Class name added to elements to indicate already configured with a date picker. */
23991	markerClassName: "hasDatepicker",
23992
23993	//Keep track of the maximum number of rows displayed (see #7043)
23994	maxRows: 4,
23995
23996	// TODO rename to "widget" when switching to widget factory
23997	_widgetDatepicker: function() {
23998		return this.dpDiv;
23999	},
24000
24001	/* Override the default settings for all instances of the date picker.
24002	 * @param  settings  object - the new settings to use as defaults (anonymous object)
24003	 * @return the manager object
24004	 */
24005	setDefaults: function( settings ) {
24006		datepicker_extendRemove( this._defaults, settings || {} );
24007		return this;
24008	},
24009
24010	/* Attach the date picker to a jQuery selection.
24011	 * @param  target	element - the target input field or division or span
24012	 * @param  settings  object - the new settings to use for this date picker instance (anonymous)
24013	 */
24014	_attachDatepicker: function( target, settings ) {
24015		var nodeName, inline, inst;
24016		nodeName = target.nodeName.toLowerCase();
24017		inline = ( nodeName === "div" || nodeName === "span" );
24018		if ( !target.id ) {
24019			this.uuid += 1;
24020			target.id = "dp" + this.uuid;
24021		}
24022		inst = this._newInst( $( target ), inline );
24023		inst.settings = $.extend( {}, settings || {} );
24024		if ( nodeName === "input" ) {
24025			this._connectDatepicker( target, inst );
24026		} else if ( inline ) {
24027			this._inlineDatepicker( target, inst );
24028		}
24029	},
24030
24031	/* Create a new instance object. */
24032	_newInst: function( target, inline ) {
24033		var id = target[ 0 ].id.replace( /([^A-Za-z0-9_\-])/g, "\\\\$1" ); // escape jQuery meta chars
24034		return { id: id, input: target, // associated target
24035			selectedDay: 0, selectedMonth: 0, selectedYear: 0, // current selection
24036			drawMonth: 0, drawYear: 0, // month being drawn
24037			inline: inline, // is datepicker inline or not
24038			dpDiv: ( !inline ? this.dpDiv : // presentation div
24039			datepicker_bindHover( $( "<div class='" + this._inlineClass + " ui-datepicker ui-widget ui-widget-content ui-helper-clearfix ui-corner-all'></div>" ) ) ) };
24040	},
24041
24042	/* Attach the date picker to an input field. */
24043	_connectDatepicker: function( target, inst ) {
24044		var input = $( target );
24045		inst.append = $( [] );
24046		inst.trigger = $( [] );
24047		if ( input.hasClass( this.markerClassName ) ) {
24048			return;
24049		}
24050		this._attachments( input, inst );
24051		input.addClass( this.markerClassName ).on( "keydown", this._doKeyDown ).
24052			on( "keypress", this._doKeyPress ).on( "keyup", this._doKeyUp );
24053		this._autoSize( inst );
24054		$.data( target, "datepicker", inst );
24055
24056		//If disabled option is true, disable the datepicker once it has been attached to the input (see ticket #5665)
24057		if ( inst.settings.disabled ) {
24058			this._disableDatepicker( target );
24059		}
24060	},
24061
24062	/* Make attachments based on settings. */
24063	_attachments: function( input, inst ) {
24064		var showOn, buttonText, buttonImage,
24065			appendText = this._get( inst, "appendText" ),
24066			isRTL = this._get( inst, "isRTL" );
24067
24068		if ( inst.append ) {
24069			inst.append.remove();
24070		}
24071		if ( appendText ) {
24072			inst.append = $( "<span class='" + this._appendClass + "'>" + appendText + "</span>" );
24073			input[ isRTL ? "before" : "after" ]( inst.append );
24074		}
24075
24076		input.off( "focus", this._showDatepicker );
24077
24078		if ( inst.trigger ) {
24079			inst.trigger.remove();
24080		}
24081
24082		showOn = this._get( inst, "showOn" );
24083		if ( showOn === "focus" || showOn === "both" ) { // pop-up date picker when in the marked field
24084			input.on( "focus", this._showDatepicker );
24085		}
24086		if ( showOn === "button" || showOn === "both" ) { // pop-up date picker when button clicked
24087			buttonText = this._get( inst, "buttonText" );
24088			buttonImage = this._get( inst, "buttonImage" );
24089			inst.trigger = $( this._get( inst, "buttonImageOnly" ) ?
24090				$( "<img/>" ).addClass( this._triggerClass ).
24091					attr( { src: buttonImage, alt: buttonText, title: buttonText } ) :
24092				$( "<button type='button'></button>" ).addClass( this._triggerClass ).
24093					html( !buttonImage ? buttonText : $( "<img/>" ).attr(
24094					{ src:buttonImage, alt:buttonText, title:buttonText } ) ) );
24095			input[ isRTL ? "before" : "after" ]( inst.trigger );
24096			inst.trigger.on( "click", function() {
24097				if ( $.datepicker._datepickerShowing && $.datepicker._lastInput === input[ 0 ] ) {
24098					$.datepicker._hideDatepicker();
24099				} else if ( $.datepicker._datepickerShowing && $.datepicker._lastInput !== input[ 0 ] ) {
24100					$.datepicker._hideDatepicker();
24101					$.datepicker._showDatepicker( input[ 0 ] );
24102				} else {
24103					$.datepicker._showDatepicker( input[ 0 ] );
24104				}
24105				return false;
24106			} );
24107		}
24108	},
24109
24110	/* Apply the maximum length for the date format. */
24111	_autoSize: function( inst ) {
24112		if ( this._get( inst, "autoSize" ) && !inst.inline ) {
24113			var findMax, max, maxI, i,
24114				date = new Date( 2009, 12 - 1, 20 ), // Ensure double digits
24115				dateFormat = this._get( inst, "dateFormat" );
24116
24117			if ( dateFormat.match( /[DM]/ ) ) {
24118				findMax = function( names ) {
24119					max = 0;
24120					maxI = 0;
24121					for ( i = 0; i < names.length; i++ ) {
24122						if ( names[ i ].length > max ) {
24123							max = names[ i ].length;
24124							maxI = i;
24125						}
24126					}
24127					return maxI;
24128				};
24129				date.setMonth( findMax( this._get( inst, ( dateFormat.match( /MM/ ) ?
24130					"monthNames" : "monthNamesShort" ) ) ) );
24131				date.setDate( findMax( this._get( inst, ( dateFormat.match( /DD/ ) ?
24132					"dayNames" : "dayNamesShort" ) ) ) + 20 - date.getDay() );
24133			}
24134			inst.input.attr( "size", this._formatDate( inst, date ).length );
24135		}
24136	},
24137
24138	/* Attach an inline date picker to a div. */
24139	_inlineDatepicker: function( target, inst ) {
24140		var divSpan = $( target );
24141		if ( divSpan.hasClass( this.markerClassName ) ) {
24142			return;
24143		}
24144		divSpan.addClass( this.markerClassName ).append( inst.dpDiv );
24145		$.data( target, "datepicker", inst );
24146		this._setDate( inst, this._getDefaultDate( inst ), true );
24147		this._updateDatepicker( inst );
24148		this._updateAlternate( inst );
24149
24150		//If disabled option is true, disable the datepicker before showing it (see ticket #5665)
24151		if ( inst.settings.disabled ) {
24152			this._disableDatepicker( target );
24153		}
24154
24155		// Set display:block in place of inst.dpDiv.show() which won't work on disconnected elements
24156		// http://bugs.jqueryui.com/ticket/7552 - A Datepicker created on a detached div has zero height
24157		inst.dpDiv.css( "display", "block" );
24158	},
24159
24160	/* Pop-up the date picker in a "dialog" box.
24161	 * @param  input element - ignored
24162	 * @param  date	string or Date - the initial date to display
24163	 * @param  onSelect  function - the function to call when a date is selected
24164	 * @param  settings  object - update the dialog date picker instance's settings (anonymous object)
24165	 * @param  pos int[2] - coordinates for the dialog's position within the screen or
24166	 *					event - with x/y coordinates or
24167	 *					leave empty for default (screen centre)
24168	 * @return the manager object
24169	 */
24170	_dialogDatepicker: function( input, date, onSelect, settings, pos ) {
24171		var id, browserWidth, browserHeight, scrollX, scrollY,
24172			inst = this._dialogInst; // internal instance
24173
24174		if ( !inst ) {
24175			this.uuid += 1;
24176			id = "dp" + this.uuid;
24177			this._dialogInput = $( "<input type='text' id='" + id +
24178				"' style='position: absolute; top: -100px; width: 0px;'/>" );
24179			this._dialogInput.on( "keydown", this._doKeyDown );
24180			$( "body" ).append( this._dialogInput );
24181			inst = this._dialogInst = this._newInst( this._dialogInput, false );
24182			inst.settings = {};
24183			$.data( this._dialogInput[ 0 ], "datepicker", inst );
24184		}
24185		datepicker_extendRemove( inst.settings, settings || {} );
24186		date = ( date && date.constructor === Date ? this._formatDate( inst, date ) : date );
24187		this._dialogInput.val( date );
24188
24189		this._pos = ( pos ? ( pos.length ? pos : [ pos.pageX, pos.pageY ] ) : null );
24190		if ( !this._pos ) {
24191			browserWidth = document.documentElement.clientWidth;
24192			browserHeight = document.documentElement.clientHeight;
24193			scrollX = document.documentElement.scrollLeft || document.body.scrollLeft;
24194			scrollY = document.documentElement.scrollTop || document.body.scrollTop;
24195			this._pos = // should use actual width/height below
24196				[ ( browserWidth / 2 ) - 100 + scrollX, ( browserHeight / 2 ) - 150 + scrollY ];
24197		}
24198
24199		// Move input on screen for focus, but hidden behind dialog
24200		this._dialogInput.css( "left", ( this._pos[ 0 ] + 20 ) + "px" ).css( "top", this._pos[ 1 ] + "px" );
24201		inst.settings.onSelect = onSelect;
24202		this._inDialog = true;
24203		this.dpDiv.addClass( this._dialogClass );
24204		this._showDatepicker( this._dialogInput[ 0 ] );
24205		if ( $.blockUI ) {
24206			$.blockUI( this.dpDiv );
24207		}
24208		$.data( this._dialogInput[ 0 ], "datepicker", inst );
24209		return this;
24210	},
24211
24212	/* Detach a datepicker from its control.
24213	 * @param  target	element - the target input field or division or span
24214	 */
24215	_destroyDatepicker: function( target ) {
24216		var nodeName,
24217			$target = $( target ),
24218			inst = $.data( target, "datepicker" );
24219
24220		if ( !$target.hasClass( this.markerClassName ) ) {
24221			return;
24222		}
24223
24224		nodeName = target.nodeName.toLowerCase();
24225		$.removeData( target, "datepicker" );
24226		if ( nodeName === "input" ) {
24227			inst.append.remove();
24228			inst.trigger.remove();
24229			$target.removeClass( this.markerClassName ).
24230				off( "focus", this._showDatepicker ).
24231				off( "keydown", this._doKeyDown ).
24232				off( "keypress", this._doKeyPress ).
24233				off( "keyup", this._doKeyUp );
24234		} else if ( nodeName === "div" || nodeName === "span" ) {
24235			$target.removeClass( this.markerClassName ).empty();
24236		}
24237
24238		if ( datepicker_instActive === inst ) {
24239			datepicker_instActive = null;
24240		}
24241	},
24242
24243	/* Enable the date picker to a jQuery selection.
24244	 * @param  target	element - the target input field or division or span
24245	 */
24246	_enableDatepicker: function( target ) {
24247		var nodeName, inline,
24248			$target = $( target ),
24249			inst = $.data( target, "datepicker" );
24250
24251		if ( !$target.hasClass( this.markerClassName ) ) {
24252			return;
24253		}
24254
24255		nodeName = target.nodeName.toLowerCase();
24256		if ( nodeName === "input" ) {
24257			target.disabled = false;
24258			inst.trigger.filter( "button" ).
24259				each( function() { this.disabled = false; } ).end().
24260				filter( "img" ).css( { opacity: "1.0", cursor: "" } );
24261		} else if ( nodeName === "div" || nodeName === "span" ) {
24262			inline = $target.children( "." + this._inlineClass );
24263			inline.children().removeClass( "ui-state-disabled" );
24264			inline.find( "select.ui-datepicker-month, select.ui-datepicker-year" ).
24265				prop( "disabled", false );
24266		}
24267		this._disabledInputs = $.map( this._disabledInputs,
24268			function( value ) { return ( value === target ? null : value ); } ); // delete entry
24269	},
24270
24271	/* Disable the date picker to a jQuery selection.
24272	 * @param  target	element - the target input field or division or span
24273	 */
24274	_disableDatepicker: function( target ) {
24275		var nodeName, inline,
24276			$target = $( target ),
24277			inst = $.data( target, "datepicker" );
24278
24279		if ( !$target.hasClass( this.markerClassName ) ) {
24280			return;
24281		}
24282
24283		nodeName = target.nodeName.toLowerCase();
24284		if ( nodeName === "input" ) {
24285			target.disabled = true;
24286			inst.trigger.filter( "button" ).
24287				each( function() { this.disabled = true; } ).end().
24288				filter( "img" ).css( { opacity: "0.5", cursor: "default" } );
24289		} else if ( nodeName === "div" || nodeName === "span" ) {
24290			inline = $target.children( "." + this._inlineClass );
24291			inline.children().addClass( "ui-state-disabled" );
24292			inline.find( "select.ui-datepicker-month, select.ui-datepicker-year" ).
24293				prop( "disabled", true );
24294		}
24295		this._disabledInputs = $.map( this._disabledInputs,
24296			function( value ) { return ( value === target ? null : value ); } ); // delete entry
24297		this._disabledInputs[ this._disabledInputs.length ] = target;
24298	},
24299
24300	/* Is the first field in a jQuery collection disabled as a datepicker?
24301	 * @param  target	element - the target input field or division or span
24302	 * @return boolean - true if disabled, false if enabled
24303	 */
24304	_isDisabledDatepicker: function( target ) {
24305		if ( !target ) {
24306			return false;
24307		}
24308		for ( var i = 0; i < this._disabledInputs.length; i++ ) {
24309			if ( this._disabledInputs[ i ] === target ) {
24310				return true;
24311			}
24312		}
24313		return false;
24314	},
24315
24316	/* Retrieve the instance data for the target control.
24317	 * @param  target  element - the target input field or division or span
24318	 * @return  object - the associated instance data
24319	 * @throws  error if a jQuery problem getting data
24320	 */
24321	_getInst: function( target ) {
24322		try {
24323			return $.data( target, "datepicker" );
24324		}
24325		catch ( err ) {
24326			throw "Missing instance data for this datepicker";
24327		}
24328	},
24329
24330	/* Update or retrieve the settings for a date picker attached to an input field or division.
24331	 * @param  target  element - the target input field or division or span
24332	 * @param  name	object - the new settings to update or
24333	 *				string - the name of the setting to change or retrieve,
24334	 *				when retrieving also "all" for all instance settings or
24335	 *				"defaults" for all global defaults
24336	 * @param  value   any - the new value for the setting
24337	 *				(omit if above is an object or to retrieve a value)
24338	 */
24339	_optionDatepicker: function( target, name, value ) {
24340		var settings, date, minDate, maxDate,
24341			inst = this._getInst( target );
24342
24343		if ( arguments.length === 2 && typeof name === "string" ) {
24344			return ( name === "defaults" ? $.extend( {}, $.datepicker._defaults ) :
24345				( inst ? ( name === "all" ? $.extend( {}, inst.settings ) :
24346				this._get( inst, name ) ) : null ) );
24347		}
24348
24349		settings = name || {};
24350		if ( typeof name === "string" ) {
24351			settings = {};
24352			settings[ name ] = value;
24353		}
24354
24355		if ( inst ) {
24356			if ( this._curInst === inst ) {
24357				this._hideDatepicker();
24358			}
24359
24360			date = this._getDateDatepicker( target, true );
24361			minDate = this._getMinMaxDate( inst, "min" );
24362			maxDate = this._getMinMaxDate( inst, "max" );
24363			datepicker_extendRemove( inst.settings, settings );
24364
24365			// reformat the old minDate/maxDate values if dateFormat changes and a new minDate/maxDate isn't provided
24366			if ( minDate !== null && settings.dateFormat !== undefined && settings.minDate === undefined ) {
24367				inst.settings.minDate = this._formatDate( inst, minDate );
24368			}
24369			if ( maxDate !== null && settings.dateFormat !== undefined && settings.maxDate === undefined ) {
24370				inst.settings.maxDate = this._formatDate( inst, maxDate );
24371			}
24372			if ( "disabled" in settings ) {
24373				if ( settings.disabled ) {
24374					this._disableDatepicker( target );
24375				} else {
24376					this._enableDatepicker( target );
24377				}
24378			}
24379			this._attachments( $( target ), inst );
24380			this._autoSize( inst );
24381			this._setDate( inst, date );
24382			this._updateAlternate( inst );
24383			this._updateDatepicker( inst );
24384		}
24385	},
24386
24387	// Change method deprecated
24388	_changeDatepicker: function( target, name, value ) {
24389		this._optionDatepicker( target, name, value );
24390	},
24391
24392	/* Redraw the date picker attached to an input field or division.
24393	 * @param  target  element - the target input field or division or span
24394	 */
24395	_refreshDatepicker: function( target ) {
24396		var inst = this._getInst( target );
24397		if ( inst ) {
24398			this._updateDatepicker( inst );
24399		}
24400	},
24401
24402	/* Set the dates for a jQuery selection.
24403	 * @param  target element - the target input field or division or span
24404	 * @param  date	Date - the new date
24405	 */
24406	_setDateDatepicker: function( target, date ) {
24407		var inst = this._getInst( target );
24408		if ( inst ) {
24409			this._setDate( inst, date );
24410			this._updateDatepicker( inst );
24411			this._updateAlternate( inst );
24412		}
24413	},
24414
24415	/* Get the date(s) for the first entry in a jQuery selection.
24416	 * @param  target element - the target input field or division or span
24417	 * @param  noDefault boolean - true if no default date is to be used
24418	 * @return Date - the current date
24419	 */
24420	_getDateDatepicker: function( target, noDefault ) {
24421		var inst = this._getInst( target );
24422		if ( inst && !inst.inline ) {
24423			this._setDateFromField( inst, noDefault );
24424		}
24425		return ( inst ? this._getDate( inst ) : null );
24426	},
24427
24428	/* Handle keystrokes. */
24429	_doKeyDown: function( event ) {
24430		var onSelect, dateStr, sel,
24431			inst = $.datepicker._getInst( event.target ),
24432			handled = true,
24433			isRTL = inst.dpDiv.is( ".ui-datepicker-rtl" );
24434
24435		inst._keyEvent = true;
24436		if ( $.datepicker._datepickerShowing ) {
24437			switch ( event.keyCode ) {
24438				case 9: $.datepicker._hideDatepicker();
24439						handled = false;
24440						break; // hide on tab out
24441				case 13: sel = $( "td." + $.datepicker._dayOverClass + ":not(." +
24442									$.datepicker._currentClass + ")", inst.dpDiv );
24443						if ( sel[ 0 ] ) {
24444							$.datepicker._selectDay( event.target, inst.selectedMonth, inst.selectedYear, sel[ 0 ] );
24445						}
24446
24447						onSelect = $.datepicker._get( inst, "onSelect" );
24448						if ( onSelect ) {
24449							dateStr = $.datepicker._formatDate( inst );
24450
24451							// Trigger custom callback
24452							onSelect.apply( ( inst.input ? inst.input[ 0 ] : null ), [ dateStr, inst ] );
24453						} else {
24454							$.datepicker._hideDatepicker();
24455						}
24456
24457						return false; // don't submit the form
24458				case 27: $.datepicker._hideDatepicker();
24459						break; // hide on escape
24460				case 33: $.datepicker._adjustDate( event.target, ( event.ctrlKey ?
24461							-$.datepicker._get( inst, "stepBigMonths" ) :
24462							-$.datepicker._get( inst, "stepMonths" ) ), "M" );
24463						break; // previous month/year on page up/+ ctrl
24464				case 34: $.datepicker._adjustDate( event.target, ( event.ctrlKey ?
24465							+$.datepicker._get( inst, "stepBigMonths" ) :
24466							+$.datepicker._get( inst, "stepMonths" ) ), "M" );
24467						break; // next month/year on page down/+ ctrl
24468				case 35: if ( event.ctrlKey || event.metaKey ) {
24469							$.datepicker._clearDate( event.target );
24470						}
24471						handled = event.ctrlKey || event.metaKey;
24472						break; // clear on ctrl or command +end
24473				case 36: if ( event.ctrlKey || event.metaKey ) {
24474							$.datepicker._gotoToday( event.target );
24475						}
24476						handled = event.ctrlKey || event.metaKey;
24477						break; // current on ctrl or command +home
24478				case 37: if ( event.ctrlKey || event.metaKey ) {
24479							$.datepicker._adjustDate( event.target, ( isRTL ? +1 : -1 ), "D" );
24480						}
24481						handled = event.ctrlKey || event.metaKey;
24482
24483						// -1 day on ctrl or command +left
24484						if ( event.originalEvent.altKey ) {
24485							$.datepicker._adjustDate( event.target, ( event.ctrlKey ?
24486								-$.datepicker._get( inst, "stepBigMonths" ) :
24487								-$.datepicker._get( inst, "stepMonths" ) ), "M" );
24488						}
24489
24490						// next month/year on alt +left on Mac
24491						break;
24492				case 38: if ( event.ctrlKey || event.metaKey ) {
24493							$.datepicker._adjustDate( event.target, -7, "D" );
24494						}
24495						handled = event.ctrlKey || event.metaKey;
24496						break; // -1 week on ctrl or command +up
24497				case 39: if ( event.ctrlKey || event.metaKey ) {
24498							$.datepicker._adjustDate( event.target, ( isRTL ? -1 : +1 ), "D" );
24499						}
24500						handled = event.ctrlKey || event.metaKey;
24501
24502						// +1 day on ctrl or command +right
24503						if ( event.originalEvent.altKey ) {
24504							$.datepicker._adjustDate( event.target, ( event.ctrlKey ?
24505								+$.datepicker._get( inst, "stepBigMonths" ) :
24506								+$.datepicker._get( inst, "stepMonths" ) ), "M" );
24507						}
24508
24509						// next month/year on alt +right
24510						break;
24511				case 40: if ( event.ctrlKey || event.metaKey ) {
24512							$.datepicker._adjustDate( event.target, +7, "D" );
24513						}
24514						handled = event.ctrlKey || event.metaKey;
24515						break; // +1 week on ctrl or command +down
24516				default: handled = false;
24517			}
24518		} else if ( event.keyCode === 36 && event.ctrlKey ) { // display the date picker on ctrl+home
24519			$.datepicker._showDatepicker( this );
24520		} else {
24521			handled = false;
24522		}
24523
24524		if ( handled ) {
24525			event.preventDefault();
24526			event.stopPropagation();
24527		}
24528	},
24529
24530	/* Filter entered characters - based on date format. */
24531	_doKeyPress: function( event ) {
24532		var chars, chr,
24533			inst = $.datepicker._getInst( event.target );
24534
24535		if ( $.datepicker._get( inst, "constrainInput" ) ) {
24536			chars = $.datepicker._possibleChars( $.datepicker._get( inst, "dateFormat" ) );
24537			chr = String.fromCharCode( event.charCode == null ? event.keyCode : event.charCode );
24538			return event.ctrlKey || event.metaKey || ( chr < " " || !chars || chars.indexOf( chr ) > -1 );
24539		}
24540	},
24541
24542	/* Synchronise manual entry and field/alternate field. */
24543	_doKeyUp: function( event ) {
24544		var date,
24545			inst = $.datepicker._getInst( event.target );
24546
24547		if ( inst.input.val() !== inst.lastVal ) {
24548			try {
24549				date = $.datepicker.parseDate( $.datepicker._get( inst, "dateFormat" ),
24550					( inst.input ? inst.input.val() : null ),
24551					$.datepicker._getFormatConfig( inst ) );
24552
24553				if ( date ) { // only if valid
24554					$.datepicker._setDateFromField( inst );
24555					$.datepicker._updateAlternate( inst );
24556					$.datepicker._updateDatepicker( inst );
24557				}
24558			}
24559			catch ( err ) {
24560			}
24561		}
24562		return true;
24563	},
24564
24565	/* Pop-up the date picker for a given input field.
24566	 * If false returned from beforeShow event handler do not show.
24567	 * @param  input  element - the input field attached to the date picker or
24568	 *					event - if triggered by focus
24569	 */
24570	_showDatepicker: function( input ) {
24571		input = input.target || input;
24572		if ( input.nodeName.toLowerCase() !== "input" ) { // find from button/image trigger
24573			input = $( "input", input.parentNode )[ 0 ];
24574		}
24575
24576		if ( $.datepicker._isDisabledDatepicker( input ) || $.datepicker._lastInput === input ) { // already here
24577			return;
24578		}
24579
24580		var inst, beforeShow, beforeShowSettings, isFixed,
24581			offset, showAnim, duration;
24582
24583		inst = $.datepicker._getInst( input );
24584		if ( $.datepicker._curInst && $.datepicker._curInst !== inst ) {
24585			$.datepicker._curInst.dpDiv.stop( true, true );
24586			if ( inst && $.datepicker._datepickerShowing ) {
24587				$.datepicker._hideDatepicker( $.datepicker._curInst.input[ 0 ] );
24588			}
24589		}
24590
24591		beforeShow = $.datepicker._get( inst, "beforeShow" );
24592		beforeShowSettings = beforeShow ? beforeShow.apply( input, [ input, inst ] ) : {};
24593		if ( beforeShowSettings === false ) {
24594			return;
24595		}
24596		datepicker_extendRemove( inst.settings, beforeShowSettings );
24597
24598		inst.lastVal = null;
24599		$.datepicker._lastInput = input;
24600		$.datepicker._setDateFromField( inst );
24601
24602		if ( $.datepicker._inDialog ) { // hide cursor
24603			input.value = "";
24604		}
24605		if ( !$.datepicker._pos ) { // position below input
24606			$.datepicker._pos = $.datepicker._findPos( input );
24607			$.datepicker._pos[ 1 ] += input.offsetHeight; // add the height
24608		}
24609
24610		isFixed = false;
24611		$( input ).parents().each( function() {
24612			isFixed |= $( this ).css( "position" ) === "fixed";
24613			return !isFixed;
24614		} );
24615
24616		offset = { left: $.datepicker._pos[ 0 ], top: $.datepicker._pos[ 1 ] };
24617		$.datepicker._pos = null;
24618
24619		//to avoid flashes on Firefox
24620		inst.dpDiv.empty();
24621
24622		// determine sizing offscreen
24623		inst.dpDiv.css( { position: "absolute", display: "block", top: "-1000px" } );
24624		$.datepicker._updateDatepicker( inst );
24625
24626		// fix width for dynamic number of date pickers
24627		// and adjust position before showing
24628		offset = $.datepicker._checkOffset( inst, offset, isFixed );
24629		inst.dpDiv.css( { position: ( $.datepicker._inDialog && $.blockUI ?
24630			"static" : ( isFixed ? "fixed" : "absolute" ) ), display: "none",
24631			left: offset.left + "px", top: offset.top + "px" } );
24632
24633		if ( !inst.inline ) {
24634			showAnim = $.datepicker._get( inst, "showAnim" );
24635			duration = $.datepicker._get( inst, "duration" );
24636			inst.dpDiv.css( "z-index", datepicker_getZindex( $( input ) ) + 1 );
24637			$.datepicker._datepickerShowing = true;
24638
24639			if ( $.effects && $.effects.effect[ showAnim ] ) {
24640				inst.dpDiv.show( showAnim, $.datepicker._get( inst, "showOptions" ), duration );
24641			} else {
24642				inst.dpDiv[ showAnim || "show" ]( showAnim ? duration : null );
24643			}
24644
24645			if ( $.datepicker._shouldFocusInput( inst ) ) {
24646				inst.input.trigger( "focus" );
24647			}
24648
24649			$.datepicker._curInst = inst;
24650		}
24651	},
24652
24653	/* Generate the date picker content. */
24654	_updateDatepicker: function( inst ) {
24655		this.maxRows = 4; //Reset the max number of rows being displayed (see #7043)
24656		datepicker_instActive = inst; // for delegate hover events
24657		inst.dpDiv.empty().append( this._generateHTML( inst ) );
24658		this._attachHandlers( inst );
24659
24660		var origyearshtml,
24661			numMonths = this._getNumberOfMonths( inst ),
24662			cols = numMonths[ 1 ],
24663			width = 17,
24664			activeCell = inst.dpDiv.find( "." + this._dayOverClass + " a" );
24665
24666		if ( activeCell.length > 0 ) {
24667			datepicker_handleMouseover.apply( activeCell.get( 0 ) );
24668		}
24669
24670		inst.dpDiv.removeClass( "ui-datepicker-multi-2 ui-datepicker-multi-3 ui-datepicker-multi-4" ).width( "" );
24671		if ( cols > 1 ) {
24672			inst.dpDiv.addClass( "ui-datepicker-multi-" + cols ).css( "width", ( width * cols ) + "em" );
24673		}
24674		inst.dpDiv[ ( numMonths[ 0 ] !== 1 || numMonths[ 1 ] !== 1 ? "add" : "remove" ) +
24675			"Class" ]( "ui-datepicker-multi" );
24676		inst.dpDiv[ ( this._get( inst, "isRTL" ) ? "add" : "remove" ) +
24677			"Class" ]( "ui-datepicker-rtl" );
24678
24679		if ( inst === $.datepicker._curInst && $.datepicker._datepickerShowing && $.datepicker._shouldFocusInput( inst ) ) {
24680			inst.input.trigger( "focus" );
24681		}
24682
24683		// Deffered render of the years select (to avoid flashes on Firefox)
24684		if ( inst.yearshtml ) {
24685			origyearshtml = inst.yearshtml;
24686			setTimeout( function() {
24687
24688				//assure that inst.yearshtml didn't change.
24689				if ( origyearshtml === inst.yearshtml && inst.yearshtml ) {
24690					inst.dpDiv.find( "select.ui-datepicker-year:first" ).replaceWith( inst.yearshtml );
24691				}
24692				origyearshtml = inst.yearshtml = null;
24693			}, 0 );
24694		}
24695	},
24696
24697	// #6694 - don't focus the input if it's already focused
24698	// this breaks the change event in IE
24699	// Support: IE and jQuery <1.9
24700	_shouldFocusInput: function( inst ) {
24701		return inst.input && inst.input.is( ":visible" ) && !inst.input.is( ":disabled" ) && !inst.input.is( ":focus" );
24702	},
24703
24704	/* Check positioning to remain on screen. */
24705	_checkOffset: function( inst, offset, isFixed ) {
24706		var dpWidth = inst.dpDiv.outerWidth(),
24707			dpHeight = inst.dpDiv.outerHeight(),
24708			inputWidth = inst.input ? inst.input.outerWidth() : 0,
24709			inputHeight = inst.input ? inst.input.outerHeight() : 0,
24710			viewWidth = document.documentElement.clientWidth + ( isFixed ? 0 : $( document ).scrollLeft() ),
24711			viewHeight = document.documentElement.clientHeight + ( isFixed ? 0 : $( document ).scrollTop() );
24712
24713		offset.left -= ( this._get( inst, "isRTL" ) ? ( dpWidth - inputWidth ) : 0 );
24714		offset.left -= ( isFixed && offset.left === inst.input.offset().left ) ? $( document ).scrollLeft() : 0;
24715		offset.top -= ( isFixed && offset.top === ( inst.input.offset().top + inputHeight ) ) ? $( document ).scrollTop() : 0;
24716
24717		// Now check if datepicker is showing outside window viewport - move to a better place if so.
24718		offset.left -= Math.min( offset.left, ( offset.left + dpWidth > viewWidth && viewWidth > dpWidth ) ?
24719			Math.abs( offset.left + dpWidth - viewWidth ) : 0 );
24720		offset.top -= Math.min( offset.top, ( offset.top + dpHeight > viewHeight && viewHeight > dpHeight ) ?
24721			Math.abs( dpHeight + inputHeight ) : 0 );
24722
24723		return offset;
24724	},
24725
24726	/* Find an object's position on the screen. */
24727	_findPos: function( obj ) {
24728		var position,
24729			inst = this._getInst( obj ),
24730			isRTL = this._get( inst, "isRTL" );
24731
24732		while ( obj && ( obj.type === "hidden" || obj.nodeType !== 1 || $.expr.filters.hidden( obj ) ) ) {
24733			obj = obj[ isRTL ? "previousSibling" : "nextSibling" ];
24734		}
24735
24736		position = $( obj ).offset();
24737		return [ position.left, position.top ];
24738	},
24739
24740	/* Hide the date picker from view.
24741	 * @param  input  element - the input field attached to the date picker
24742	 */
24743	_hideDatepicker: function( input ) {
24744		var showAnim, duration, postProcess, onClose,
24745			inst = this._curInst;
24746
24747		if ( !inst || ( input && inst !== $.data( input, "datepicker" ) ) ) {
24748			return;
24749		}
24750
24751		if ( this._datepickerShowing ) {
24752			showAnim = this._get( inst, "showAnim" );
24753			duration = this._get( inst, "duration" );
24754			postProcess = function() {
24755				$.datepicker._tidyDialog( inst );
24756			};
24757
24758			// DEPRECATED: after BC for 1.8.x $.effects[ showAnim ] is not needed
24759			if ( $.effects && ( $.effects.effect[ showAnim ] || $.effects[ showAnim ] ) ) {
24760				inst.dpDiv.hide( showAnim, $.datepicker._get( inst, "showOptions" ), duration, postProcess );
24761			} else {
24762				inst.dpDiv[ ( showAnim === "slideDown" ? "slideUp" :
24763					( showAnim === "fadeIn" ? "fadeOut" : "hide" ) ) ]( ( showAnim ? duration : null ), postProcess );
24764			}
24765
24766			if ( !showAnim ) {
24767				postProcess();
24768			}
24769			this._datepickerShowing = false;
24770
24771			onClose = this._get( inst, "onClose" );
24772			if ( onClose ) {
24773				onClose.apply( ( inst.input ? inst.input[ 0 ] : null ), [ ( inst.input ? inst.input.val() : "" ), inst ] );
24774			}
24775
24776			this._lastInput = null;
24777			if ( this._inDialog ) {
24778				this._dialogInput.css( { position: "absolute", left: "0", top: "-100px" } );
24779				if ( $.blockUI ) {
24780					$.unblockUI();
24781					$( "body" ).append( this.dpDiv );
24782				}
24783			}
24784			this._inDialog = false;
24785		}
24786	},
24787
24788	/* Tidy up after a dialog display. */
24789	_tidyDialog: function( inst ) {
24790		inst.dpDiv.removeClass( this._dialogClass ).off( ".ui-datepicker-calendar" );
24791	},
24792
24793	/* Close date picker if clicked elsewhere. */
24794	_checkExternalClick: function( event ) {
24795		if ( !$.datepicker._curInst ) {
24796			return;
24797		}
24798
24799		var $target = $( event.target ),
24800			inst = $.datepicker._getInst( $target[ 0 ] );
24801
24802		if ( ( ( $target[ 0 ].id !== $.datepicker._mainDivId &&
24803				$target.parents( "#" + $.datepicker._mainDivId ).length === 0 &&
24804				!$target.hasClass( $.datepicker.markerClassName ) &&
24805				!$target.closest( "." + $.datepicker._triggerClass ).length &&
24806				$.datepicker._datepickerShowing && !( $.datepicker._inDialog && $.blockUI ) ) ) ||
24807			( $target.hasClass( $.datepicker.markerClassName ) && $.datepicker._curInst !== inst ) ) {
24808				$.datepicker._hideDatepicker();
24809		}
24810	},
24811
24812	/* Adjust one of the date sub-fields. */
24813	_adjustDate: function( id, offset, period ) {
24814		var target = $( id ),
24815			inst = this._getInst( target[ 0 ] );
24816
24817		if ( this._isDisabledDatepicker( target[ 0 ] ) ) {
24818			return;
24819		}
24820		this._adjustInstDate( inst, offset +
24821			( period === "M" ? this._get( inst, "showCurrentAtPos" ) : 0 ), // undo positioning
24822			period );
24823		this._updateDatepicker( inst );
24824	},
24825
24826	/* Action for current link. */
24827	_gotoToday: function( id ) {
24828		var date,
24829			target = $( id ),
24830			inst = this._getInst( target[ 0 ] );
24831
24832		if ( this._get( inst, "gotoCurrent" ) && inst.currentDay ) {
24833			inst.selectedDay = inst.currentDay;
24834			inst.drawMonth = inst.selectedMonth = inst.currentMonth;
24835			inst.drawYear = inst.selectedYear = inst.currentYear;
24836		} else {
24837			date = new Date();
24838			inst.selectedDay = date.getDate();
24839			inst.drawMonth = inst.selectedMonth = date.getMonth();
24840			inst.drawYear = inst.selectedYear = date.getFullYear();
24841		}
24842		this._notifyChange( inst );
24843		this._adjustDate( target );
24844	},
24845
24846	/* Action for selecting a new month/year. */
24847	_selectMonthYear: function( id, select, period ) {
24848		var target = $( id ),
24849			inst = this._getInst( target[ 0 ] );
24850
24851		inst[ "selected" + ( period === "M" ? "Month" : "Year" ) ] =
24852		inst[ "draw" + ( period === "M" ? "Month" : "Year" ) ] =
24853			parseInt( select.options[ select.selectedIndex ].value, 10 );
24854
24855		this._notifyChange( inst );
24856		this._adjustDate( target );
24857	},
24858
24859	/* Action for selecting a day. */
24860	_selectDay: function( id, month, year, td ) {
24861		var inst,
24862			target = $( id );
24863
24864		if ( $( td ).hasClass( this._unselectableClass ) || this._isDisabledDatepicker( target[ 0 ] ) ) {
24865			return;
24866		}
24867
24868		inst = this._getInst( target[ 0 ] );
24869		inst.selectedDay = inst.currentDay = $( "a", td ).html();
24870		inst.selectedMonth = inst.currentMonth = month;
24871		inst.selectedYear = inst.currentYear = year;
24872		this._selectDate( id, this._formatDate( inst,
24873			inst.currentDay, inst.currentMonth, inst.currentYear ) );
24874	},
24875
24876	/* Erase the input field and hide the date picker. */
24877	_clearDate: function( id ) {
24878		var target = $( id );
24879		this._selectDate( target, "" );
24880	},
24881
24882	/* Update the input field with the selected date. */
24883	_selectDate: function( id, dateStr ) {
24884		var onSelect,
24885			target = $( id ),
24886			inst = this._getInst( target[ 0 ] );
24887
24888		dateStr = ( dateStr != null ? dateStr : this._formatDate( inst ) );
24889		if ( inst.input ) {
24890			inst.input.val( dateStr );
24891		}
24892		this._updateAlternate( inst );
24893
24894		onSelect = this._get( inst, "onSelect" );
24895		if ( onSelect ) {
24896			onSelect.apply( ( inst.input ? inst.input[ 0 ] : null ), [ dateStr, inst ] );  // trigger custom callback
24897		} else if ( inst.input ) {
24898			inst.input.trigger( "change" ); // fire the change event
24899		}
24900
24901		if ( inst.inline ) {
24902			this._updateDatepicker( inst );
24903		} else {
24904			this._hideDatepicker();
24905			this._lastInput = inst.input[ 0 ];
24906			if ( typeof( inst.input[ 0 ] ) !== "object" ) {
24907				inst.input.trigger( "focus" ); // restore focus
24908			}
24909			this._lastInput = null;
24910		}
24911	},
24912
24913	/* Update any alternate field to synchronise with the main field. */
24914	_updateAlternate: function( inst ) {
24915		var altFormat, date, dateStr,
24916			altField = this._get( inst, "altField" );
24917
24918		if ( altField ) { // update alternate field too
24919			altFormat = this._get( inst, "altFormat" ) || this._get( inst, "dateFormat" );
24920			date = this._getDate( inst );
24921			dateStr = this.formatDate( altFormat, date, this._getFormatConfig( inst ) );
24922			$( altField ).val( dateStr );
24923		}
24924	},
24925
24926	/* Set as beforeShowDay function to prevent selection of weekends.
24927	 * @param  date  Date - the date to customise
24928	 * @return [boolean, string] - is this date selectable?, what is its CSS class?
24929	 */
24930	noWeekends: function( date ) {
24931		var day = date.getDay();
24932		return [ ( day > 0 && day < 6 ), "" ];
24933	},
24934
24935	/* Set as calculateWeek to determine the week of the year based on the ISO 8601 definition.
24936	 * @param  date  Date - the date to get the week for
24937	 * @return  number - the number of the week within the year that contains this date
24938	 */
24939	iso8601Week: function( date ) {
24940		var time,
24941			checkDate = new Date( date.getTime() );
24942
24943		// Find Thursday of this week starting on Monday
24944		checkDate.setDate( checkDate.getDate() + 4 - ( checkDate.getDay() || 7 ) );
24945
24946		time = checkDate.getTime();
24947		checkDate.setMonth( 0 ); // Compare with Jan 1
24948		checkDate.setDate( 1 );
24949		return Math.floor( Math.round( ( time - checkDate ) / 86400000 ) / 7 ) + 1;
24950	},
24951
24952	/* Parse a string value into a date object.
24953	 * See formatDate below for the possible formats.
24954	 *
24955	 * @param  format string - the expected format of the date
24956	 * @param  value string - the date in the above format
24957	 * @param  settings Object - attributes include:
24958	 *					shortYearCutoff  number - the cutoff year for determining the century (optional)
24959	 *					dayNamesShort	string[7] - abbreviated names of the days from Sunday (optional)
24960	 *					dayNames		string[7] - names of the days from Sunday (optional)
24961	 *					monthNamesShort string[12] - abbreviated names of the months (optional)
24962	 *					monthNames		string[12] - names of the months (optional)
24963	 * @return  Date - the extracted date value or null if value is blank
24964	 */
24965	parseDate: function( format, value, settings ) {
24966		if ( format == null || value == null ) {
24967			throw "Invalid arguments";
24968		}
24969
24970		value = ( typeof value === "object" ? value.toString() : value + "" );
24971		if ( value === "" ) {
24972			return null;
24973		}
24974
24975		var iFormat, dim, extra,
24976			iValue = 0,
24977			shortYearCutoffTemp = ( settings ? settings.shortYearCutoff : null ) || this._defaults.shortYearCutoff,
24978			shortYearCutoff = ( typeof shortYearCutoffTemp !== "string" ? shortYearCutoffTemp :
24979				new Date().getFullYear() % 100 + parseInt( shortYearCutoffTemp, 10 ) ),
24980			dayNamesShort = ( settings ? settings.dayNamesShort : null ) || this._defaults.dayNamesShort,
24981			dayNames = ( settings ? settings.dayNames : null ) || this._defaults.dayNames,
24982			monthNamesShort = ( settings ? settings.monthNamesShort : null ) || this._defaults.monthNamesShort,
24983			monthNames = ( settings ? settings.monthNames : null ) || this._defaults.monthNames,
24984			year = -1,
24985			month = -1,
24986			day = -1,
24987			doy = -1,
24988			literal = false,
24989			date,
24990
24991			// Check whether a format character is doubled
24992			lookAhead = function( match ) {
24993				var matches = ( iFormat + 1 < format.length && format.charAt( iFormat + 1 ) === match );
24994				if ( matches ) {
24995					iFormat++;
24996				}
24997				return matches;
24998			},
24999
25000			// Extract a number from the string value
25001			getNumber = function( match ) {
25002				var isDoubled = lookAhead( match ),
25003					size = ( match === "@" ? 14 : ( match === "!" ? 20 :
25004					( match === "y" && isDoubled ? 4 : ( match === "o" ? 3 : 2 ) ) ) ),
25005					minSize = ( match === "y" ? size : 1 ),
25006					digits = new RegExp( "^\\d{" + minSize + "," + size + "}" ),
25007					num = value.substring( iValue ).match( digits );
25008				if ( !num ) {
25009					throw "Missing number at position " + iValue;
25010				}
25011				iValue += num[ 0 ].length;
25012				return parseInt( num[ 0 ], 10 );
25013			},
25014
25015			// Extract a name from the string value and convert to an index
25016			getName = function( match, shortNames, longNames ) {
25017				var index = -1,
25018					names = $.map( lookAhead( match ) ? longNames : shortNames, function( v, k ) {
25019						return [ [ k, v ] ];
25020					} ).sort( function( a, b ) {
25021						return -( a[ 1 ].length - b[ 1 ].length );
25022					} );
25023
25024				$.each( names, function( i, pair ) {
25025					var name = pair[ 1 ];
25026					if ( value.substr( iValue, name.length ).toLowerCase() === name.toLowerCase() ) {
25027						index = pair[ 0 ];
25028						iValue += name.length;
25029						return false;
25030					}
25031				} );
25032				if ( index !== -1 ) {
25033					return index + 1;
25034				} else {
25035					throw "Unknown name at position " + iValue;
25036				}
25037			},
25038
25039			// Confirm that a literal character matches the string value
25040			checkLiteral = function() {
25041				if ( value.charAt( iValue ) !== format.charAt( iFormat ) ) {
25042					throw "Unexpected literal at position " + iValue;
25043				}
25044				iValue++;
25045			};
25046
25047		for ( iFormat = 0; iFormat < format.length; iFormat++ ) {
25048			if ( literal ) {
25049				if ( format.charAt( iFormat ) === "'" && !lookAhead( "'" ) ) {
25050					literal = false;
25051				} else {
25052					checkLiteral();
25053				}
25054			} else {
25055				switch ( format.charAt( iFormat ) ) {
25056					case "d":
25057						day = getNumber( "d" );
25058						break;
25059					case "D":
25060						getName( "D", dayNamesShort, dayNames );
25061						break;
25062					case "o":
25063						doy = getNumber( "o" );
25064						break;
25065					case "m":
25066						month = getNumber( "m" );
25067						break;
25068					case "M":
25069						month = getName( "M", monthNamesShort, monthNames );
25070						break;
25071					case "y":
25072						year = getNumber( "y" );
25073						break;
25074					case "@":
25075						date = new Date( getNumber( "@" ) );
25076						year = date.getFullYear();
25077						month = date.getMonth() + 1;
25078						day = date.getDate();
25079						break;
25080					case "!":
25081						date = new Date( ( getNumber( "!" ) - this._ticksTo1970 ) / 10000 );
25082						year = date.getFullYear();
25083						month = date.getMonth() + 1;
25084						day = date.getDate();
25085						break;
25086					case "'":
25087						if ( lookAhead( "'" ) ) {
25088							checkLiteral();
25089						} else {
25090							literal = true;
25091						}
25092						break;
25093					default:
25094						checkLiteral();
25095				}
25096			}
25097		}
25098
25099		if ( iValue < value.length ) {
25100			extra = value.substr( iValue );
25101			if ( !/^\s+/.test( extra ) ) {
25102				throw "Extra/unparsed characters found in date: " + extra;
25103			}
25104		}
25105
25106		if ( year === -1 ) {
25107			year = new Date().getFullYear();
25108		} else if ( year < 100 ) {
25109			year += new Date().getFullYear() - new Date().getFullYear() % 100 +
25110				( year <= shortYearCutoff ? 0 : -100 );
25111		}
25112
25113		if ( doy > -1 ) {
25114			month = 1;
25115			day = doy;
25116			do {
25117				dim = this._getDaysInMonth( year, month - 1 );
25118				if ( day <= dim ) {
25119					break;
25120				}
25121				month++;
25122				day -= dim;
25123			} while ( true );
25124		}
25125
25126		date = this._daylightSavingAdjust( new Date( year, month - 1, day ) );
25127		if ( date.getFullYear() !== year || date.getMonth() + 1 !== month || date.getDate() !== day ) {
25128			throw "Invalid date"; // E.g. 31/02/00
25129		}
25130		return date;
25131	},
25132
25133	/* Standard date formats. */
25134	ATOM: "yy-mm-dd", // RFC 3339 (ISO 8601)
25135	COOKIE: "D, dd M yy",
25136	ISO_8601: "yy-mm-dd",
25137	RFC_822: "D, d M y",
25138	RFC_850: "DD, dd-M-y",
25139	RFC_1036: "D, d M y",
25140	RFC_1123: "D, d M yy",
25141	RFC_2822: "D, d M yy",
25142	RSS: "D, d M y", // RFC 822
25143	TICKS: "!",
25144	TIMESTAMP: "@",
25145	W3C: "yy-mm-dd", // ISO 8601
25146
25147	_ticksTo1970: ( ( ( 1970 - 1 ) * 365 + Math.floor( 1970 / 4 ) - Math.floor( 1970 / 100 ) +
25148		Math.floor( 1970 / 400 ) ) * 24 * 60 * 60 * 10000000 ),
25149
25150	/* Format a date object into a string value.
25151	 * The format can be combinations of the following:
25152	 * d  - day of month (no leading zero)
25153	 * dd - day of month (two digit)
25154	 * o  - day of year (no leading zeros)
25155	 * oo - day of year (three digit)
25156	 * D  - day name short
25157	 * DD - day name long
25158	 * m  - month of year (no leading zero)
25159	 * mm - month of year (two digit)
25160	 * M  - month name short
25161	 * MM - month name long
25162	 * y  - year (two digit)
25163	 * yy - year (four digit)
25164	 * @ - Unix timestamp (ms since 01/01/1970)
25165	 * ! - Windows ticks (100ns since 01/01/0001)
25166	 * "..." - literal text
25167	 * '' - single quote
25168	 *
25169	 * @param  format string - the desired format of the date
25170	 * @param  date Date - the date value to format
25171	 * @param  settings Object - attributes include:
25172	 *					dayNamesShort	string[7] - abbreviated names of the days from Sunday (optional)
25173	 *					dayNames		string[7] - names of the days from Sunday (optional)
25174	 *					monthNamesShort string[12] - abbreviated names of the months (optional)
25175	 *					monthNames		string[12] - names of the months (optional)
25176	 * @return  string - the date in the above format
25177	 */
25178	formatDate: function( format, date, settings ) {
25179		if ( !date ) {
25180			return "";
25181		}
25182
25183		var iFormat,
25184			dayNamesShort = ( settings ? settings.dayNamesShort : null ) || this._defaults.dayNamesShort,
25185			dayNames = ( settings ? settings.dayNames : null ) || this._defaults.dayNames,
25186			monthNamesShort = ( settings ? settings.monthNamesShort : null ) || this._defaults.monthNamesShort,
25187			monthNames = ( settings ? settings.monthNames : null ) || this._defaults.monthNames,
25188
25189			// Check whether a format character is doubled
25190			lookAhead = function( match ) {
25191				var matches = ( iFormat + 1 < format.length && format.charAt( iFormat + 1 ) === match );
25192				if ( matches ) {
25193					iFormat++;
25194				}
25195				return matches;
25196			},
25197
25198			// Format a number, with leading zero if necessary
25199			formatNumber = function( match, value, len ) {
25200				var num = "" + value;
25201				if ( lookAhead( match ) ) {
25202					while ( num.length < len ) {
25203						num = "0" + num;
25204					}
25205				}
25206				return num;
25207			},
25208
25209			// Format a name, short or long as requested
25210			formatName = function( match, value, shortNames, longNames ) {
25211				return ( lookAhead( match ) ? longNames[ value ] : shortNames[ value ] );
25212			},
25213			output = "",
25214			literal = false;
25215
25216		if ( date ) {
25217			for ( iFormat = 0; iFormat < format.length; iFormat++ ) {
25218				if ( literal ) {
25219					if ( format.charAt( iFormat ) === "'" && !lookAhead( "'" ) ) {
25220						literal = false;
25221					} else {
25222						output += format.charAt( iFormat );
25223					}
25224				} else {
25225					switch ( format.charAt( iFormat ) ) {
25226						case "d":
25227							output += formatNumber( "d", date.getDate(), 2 );
25228							break;
25229						case "D":
25230							output += formatName( "D", date.getDay(), dayNamesShort, dayNames );
25231							break;
25232						case "o":
25233							output += formatNumber( "o",
25234								Math.round( ( new Date( date.getFullYear(), date.getMonth(), date.getDate() ).getTime() - new Date( date.getFullYear(), 0, 0 ).getTime() ) / 86400000 ), 3 );
25235							break;
25236						case "m":
25237							output += formatNumber( "m", date.getMonth() + 1, 2 );
25238							break;
25239						case "M":
25240							output += formatName( "M", date.getMonth(), monthNamesShort, monthNames );
25241							break;
25242						case "y":
25243							output += ( lookAhead( "y" ) ? date.getFullYear() :
25244								( date.getFullYear() % 100 < 10 ? "0" : "" ) + date.getFullYear() % 100 );
25245							break;
25246						case "@":
25247							output += date.getTime();
25248							break;
25249						case "!":
25250							output += date.getTime() * 10000 + this._ticksTo1970;
25251							break;
25252						case "'":
25253							if ( lookAhead( "'" ) ) {
25254								output += "'";
25255							} else {
25256								literal = true;
25257							}
25258							break;
25259						default:
25260							output += format.charAt( iFormat );
25261					}
25262				}
25263			}
25264		}
25265		return output;
25266	},
25267
25268	/* Extract all possible characters from the date format. */
25269	_possibleChars: function( format ) {
25270		var iFormat,
25271			chars = "",
25272			literal = false,
25273
25274			// Check whether a format character is doubled
25275			lookAhead = function( match ) {
25276				var matches = ( iFormat + 1 < format.length && format.charAt( iFormat + 1 ) === match );
25277				if ( matches ) {
25278					iFormat++;
25279				}
25280				return matches;
25281			};
25282
25283		for ( iFormat = 0; iFormat < format.length; iFormat++ ) {
25284			if ( literal ) {
25285				if ( format.charAt( iFormat ) === "'" && !lookAhead( "'" ) ) {
25286					literal = false;
25287				} else {
25288					chars += format.charAt( iFormat );
25289				}
25290			} else {
25291				switch ( format.charAt( iFormat ) ) {
25292					case "d": case "m": case "y": case "@":
25293						chars += "0123456789";
25294						break;
25295					case "D": case "M":
25296						return null; // Accept anything
25297					case "'":
25298						if ( lookAhead( "'" ) ) {
25299							chars += "'";
25300						} else {
25301							literal = true;
25302						}
25303						break;
25304					default:
25305						chars += format.charAt( iFormat );
25306				}
25307			}
25308		}
25309		return chars;
25310	},
25311
25312	/* Get a setting value, defaulting if necessary. */
25313	_get: function( inst, name ) {
25314		return inst.settings[ name ] !== undefined ?
25315			inst.settings[ name ] : this._defaults[ name ];
25316	},
25317
25318	/* Parse existing date and initialise date picker. */
25319	_setDateFromField: function( inst, noDefault ) {
25320		if ( inst.input.val() === inst.lastVal ) {
25321			return;
25322		}
25323
25324		var dateFormat = this._get( inst, "dateFormat" ),
25325			dates = inst.lastVal = inst.input ? inst.input.val() : null,
25326			defaultDate = this._getDefaultDate( inst ),
25327			date = defaultDate,
25328			settings = this._getFormatConfig( inst );
25329
25330		try {
25331			date = this.parseDate( dateFormat, dates, settings ) || defaultDate;
25332		} catch ( event ) {
25333			dates = ( noDefault ? "" : dates );
25334		}
25335		inst.selectedDay = date.getDate();
25336		inst.drawMonth = inst.selectedMonth = date.getMonth();
25337		inst.drawYear = inst.selectedYear = date.getFullYear();
25338		inst.currentDay = ( dates ? date.getDate() : 0 );
25339		inst.currentMonth = ( dates ? date.getMonth() : 0 );
25340		inst.currentYear = ( dates ? date.getFullYear() : 0 );
25341		this._adjustInstDate( inst );
25342	},
25343
25344	/* Retrieve the default date shown on opening. */
25345	_getDefaultDate: function( inst ) {
25346		return this._restrictMinMax( inst,
25347			this._determineDate( inst, this._get( inst, "defaultDate" ), new Date() ) );
25348	},
25349
25350	/* A date may be specified as an exact value or a relative one. */
25351	_determineDate: function( inst, date, defaultDate ) {
25352		var offsetNumeric = function( offset ) {
25353				var date = new Date();
25354				date.setDate( date.getDate() + offset );
25355				return date;
25356			},
25357			offsetString = function( offset ) {
25358				try {
25359					return $.datepicker.parseDate( $.datepicker._get( inst, "dateFormat" ),
25360						offset, $.datepicker._getFormatConfig( inst ) );
25361				}
25362				catch ( e ) {
25363
25364					// Ignore
25365				}
25366
25367				var date = ( offset.toLowerCase().match( /^c/ ) ?
25368					$.datepicker._getDate( inst ) : null ) || new Date(),
25369					year = date.getFullYear(),
25370					month = date.getMonth(),
25371					day = date.getDate(),
25372					pattern = /([+\-]?[0-9]+)\s*(d|D|w|W|m|M|y|Y)?/g,
25373					matches = pattern.exec( offset );
25374
25375				while ( matches ) {
25376					switch ( matches[ 2 ] || "d" ) {
25377						case "d" : case "D" :
25378							day += parseInt( matches[ 1 ], 10 ); break;
25379						case "w" : case "W" :
25380							day += parseInt( matches[ 1 ], 10 ) * 7; break;
25381						case "m" : case "M" :
25382							month += parseInt( matches[ 1 ], 10 );
25383							day = Math.min( day, $.datepicker._getDaysInMonth( year, month ) );
25384							break;
25385						case "y": case "Y" :
25386							year += parseInt( matches[ 1 ], 10 );
25387							day = Math.min( day, $.datepicker._getDaysInMonth( year, month ) );
25388							break;
25389					}
25390					matches = pattern.exec( offset );
25391				}
25392				return new Date( year, month, day );
25393			},
25394			newDate = ( date == null || date === "" ? defaultDate : ( typeof date === "string" ? offsetString( date ) :
25395				( typeof date === "number" ? ( isNaN( date ) ? defaultDate : offsetNumeric( date ) ) : new Date( date.getTime() ) ) ) );
25396
25397		newDate = ( newDate && newDate.toString() === "Invalid Date" ? defaultDate : newDate );
25398		if ( newDate ) {
25399			newDate.setHours( 0 );
25400			newDate.setMinutes( 0 );
25401			newDate.setSeconds( 0 );
25402			newDate.setMilliseconds( 0 );
25403		}
25404		return this._daylightSavingAdjust( newDate );
25405	},
25406
25407	/* Handle switch to/from daylight saving.
25408	 * Hours may be non-zero on daylight saving cut-over:
25409	 * > 12 when midnight changeover, but then cannot generate
25410	 * midnight datetime, so jump to 1AM, otherwise reset.
25411	 * @param  date  (Date) the date to check
25412	 * @return  (Date) the corrected date
25413	 */
25414	_daylightSavingAdjust: function( date ) {
25415		if ( !date ) {
25416			return null;
25417		}
25418		date.setHours( date.getHours() > 12 ? date.getHours() + 2 : 0 );
25419		return date;
25420	},
25421
25422	/* Set the date(s) directly. */
25423	_setDate: function( inst, date, noChange ) {
25424		var clear = !date,
25425			origMonth = inst.selectedMonth,
25426			origYear = inst.selectedYear,
25427			newDate = this._restrictMinMax( inst, this._determineDate( inst, date, new Date() ) );
25428
25429		inst.selectedDay = inst.currentDay = newDate.getDate();
25430		inst.drawMonth = inst.selectedMonth = inst.currentMonth = newDate.getMonth();
25431		inst.drawYear = inst.selectedYear = inst.currentYear = newDate.getFullYear();
25432		if ( ( origMonth !== inst.selectedMonth || origYear !== inst.selectedYear ) && !noChange ) {
25433			this._notifyChange( inst );
25434		}
25435		this._adjustInstDate( inst );
25436		if ( inst.input ) {
25437			inst.input.val( clear ? "" : this._formatDate( inst ) );
25438		}
25439	},
25440
25441	/* Retrieve the date(s) directly. */
25442	_getDate: function( inst ) {
25443		var startDate = ( !inst.currentYear || ( inst.input && inst.input.val() === "" ) ? null :
25444			this._daylightSavingAdjust( new Date(
25445			inst.currentYear, inst.currentMonth, inst.currentDay ) ) );
25446			return startDate;
25447	},
25448
25449	/* Attach the onxxx handlers.  These are declared statically so
25450	 * they work with static code transformers like Caja.
25451	 */
25452	_attachHandlers: function( inst ) {
25453		var stepMonths = this._get( inst, "stepMonths" ),
25454			id = "#" + inst.id.replace( /\\\\/g, "\\" );
25455		inst.dpDiv.find( "[data-handler]" ).map( function() {
25456			var handler = {
25457				prev: function() {
25458					$.datepicker._adjustDate( id, -stepMonths, "M" );
25459				},
25460				next: function() {
25461					$.datepicker._adjustDate( id, +stepMonths, "M" );
25462				},
25463				hide: function() {
25464					$.datepicker._hideDatepicker();
25465				},
25466				today: function() {
25467					$.datepicker._gotoToday( id );
25468				},
25469				selectDay: function() {
25470					$.datepicker._selectDay( id, +this.getAttribute( "data-month" ), +this.getAttribute( "data-year" ), this );
25471					return false;
25472				},
25473				selectMonth: function() {
25474					$.datepicker._selectMonthYear( id, this, "M" );
25475					return false;
25476				},
25477				selectYear: function() {
25478					$.datepicker._selectMonthYear( id, this, "Y" );
25479					return false;
25480				}
25481			};
25482			$( this ).on( this.getAttribute( "data-event" ), handler[ this.getAttribute( "data-handler" ) ] );
25483		} );
25484	},
25485
25486	/* Generate the HTML for the current state of the date picker. */
25487	_generateHTML: function( inst ) {
25488		var maxDraw, prevText, prev, nextText, next, currentText, gotoDate,
25489			controls, buttonPanel, firstDay, showWeek, dayNames, dayNamesMin,
25490			monthNames, monthNamesShort, beforeShowDay, showOtherMonths,
25491			selectOtherMonths, defaultDate, html, dow, row, group, col, selectedDate,
25492			cornerClass, calender, thead, day, daysInMonth, leadDays, curRows, numRows,
25493			printDate, dRow, tbody, daySettings, otherMonth, unselectable,
25494			tempDate = new Date(),
25495			today = this._daylightSavingAdjust(
25496				new Date( tempDate.getFullYear(), tempDate.getMonth(), tempDate.getDate() ) ), // clear time
25497			isRTL = this._get( inst, "isRTL" ),
25498			showButtonPanel = this._get( inst, "showButtonPanel" ),
25499			hideIfNoPrevNext = this._get( inst, "hideIfNoPrevNext" ),
25500			navigationAsDateFormat = this._get( inst, "navigationAsDateFormat" ),
25501			numMonths = this._getNumberOfMonths( inst ),
25502			showCurrentAtPos = this._get( inst, "showCurrentAtPos" ),
25503			stepMonths = this._get( inst, "stepMonths" ),
25504			isMultiMonth = ( numMonths[ 0 ] !== 1 || numMonths[ 1 ] !== 1 ),
25505			currentDate = this._daylightSavingAdjust( ( !inst.currentDay ? new Date( 9999, 9, 9 ) :
25506				new Date( inst.currentYear, inst.currentMonth, inst.currentDay ) ) ),
25507			minDate = this._getMinMaxDate( inst, "min" ),
25508			maxDate = this._getMinMaxDate( inst, "max" ),
25509			drawMonth = inst.drawMonth - showCurrentAtPos,
25510			drawYear = inst.drawYear;
25511
25512		if ( drawMonth < 0 ) {
25513			drawMonth += 12;
25514			drawYear--;
25515		}
25516		if ( maxDate ) {
25517			maxDraw = this._daylightSavingAdjust( new Date( maxDate.getFullYear(),
25518				maxDate.getMonth() - ( numMonths[ 0 ] * numMonths[ 1 ] ) + 1, maxDate.getDate() ) );
25519			maxDraw = ( minDate && maxDraw < minDate ? minDate : maxDraw );
25520			while ( this._daylightSavingAdjust( new Date( drawYear, drawMonth, 1 ) ) > maxDraw ) {
25521				drawMonth--;
25522				if ( drawMonth < 0 ) {
25523					drawMonth = 11;
25524					drawYear--;
25525				}
25526			}
25527		}
25528		inst.drawMonth = drawMonth;
25529		inst.drawYear = drawYear;
25530
25531		prevText = this._get( inst, "prevText" );
25532		prevText = ( !navigationAsDateFormat ? prevText : this.formatDate( prevText,
25533			this._daylightSavingAdjust( new Date( drawYear, drawMonth - stepMonths, 1 ) ),
25534			this._getFormatConfig( inst ) ) );
25535
25536		prev = ( this._canAdjustMonth( inst, -1, drawYear, drawMonth ) ?
25537			"<a class='ui-datepicker-prev ui-corner-all' data-handler='prev' data-event='click'" +
25538			" title='" + prevText + "'><span class='ui-icon ui-icon-circle-triangle-" + ( isRTL ? "e" : "w" ) + "'>" + prevText + "</span></a>" :
25539			( hideIfNoPrevNext ? "" : "<a class='ui-datepicker-prev ui-corner-all ui-state-disabled' title='" + prevText + "'><span class='ui-icon ui-icon-circle-triangle-" + ( isRTL ? "e" : "w" ) + "'>" + prevText + "</span></a>" ) );
25540
25541		nextText = this._get( inst, "nextText" );
25542		nextText = ( !navigationAsDateFormat ? nextText : this.formatDate( nextText,
25543			this._daylightSavingAdjust( new Date( drawYear, drawMonth + stepMonths, 1 ) ),
25544			this._getFormatConfig( inst ) ) );
25545
25546		next = ( this._canAdjustMonth( inst, +1, drawYear, drawMonth ) ?
25547			"<a class='ui-datepicker-next ui-corner-all' data-handler='next' data-event='click'" +
25548			" title='" + nextText + "'><span class='ui-icon ui-icon-circle-triangle-" + ( isRTL ? "w" : "e" ) + "'>" + nextText + "</span></a>" :
25549			( hideIfNoPrevNext ? "" : "<a class='ui-datepicker-next ui-corner-all ui-state-disabled' title='" + nextText + "'><span class='ui-icon ui-icon-circle-triangle-" + ( isRTL ? "w" : "e" ) + "'>" + nextText + "</span></a>" ) );
25550
25551		currentText = this._get( inst, "currentText" );
25552		gotoDate = ( this._get( inst, "gotoCurrent" ) && inst.currentDay ? currentDate : today );
25553		currentText = ( !navigationAsDateFormat ? currentText :
25554			this.formatDate( currentText, gotoDate, this._getFormatConfig( inst ) ) );
25555
25556		controls = ( !inst.inline ? "<button type='button' class='ui-datepicker-close ui-state-default ui-priority-primary ui-corner-all' data-handler='hide' data-event='click'>" +
25557			this._get( inst, "closeText" ) + "</button>" : "" );
25558
25559		buttonPanel = ( showButtonPanel ) ? "<div class='ui-datepicker-buttonpane ui-widget-content'>" + ( isRTL ? controls : "" ) +
25560			( this._isInRange( inst, gotoDate ) ? "<button type='button' class='ui-datepicker-current ui-state-default ui-priority-secondary ui-corner-all' data-handler='today' data-event='click'" +
25561			">" + currentText + "</button>" : "" ) + ( isRTL ? "" : controls ) + "</div>" : "";
25562
25563		firstDay = parseInt( this._get( inst, "firstDay" ), 10 );
25564		firstDay = ( isNaN( firstDay ) ? 0 : firstDay );
25565
25566		showWeek = this._get( inst, "showWeek" );
25567		dayNames = this._get( inst, "dayNames" );
25568		dayNamesMin = this._get( inst, "dayNamesMin" );
25569		monthNames = this._get( inst, "monthNames" );
25570		monthNamesShort = this._get( inst, "monthNamesShort" );
25571		beforeShowDay = this._get( inst, "beforeShowDay" );
25572		showOtherMonths = this._get( inst, "showOtherMonths" );
25573		selectOtherMonths = this._get( inst, "selectOtherMonths" );
25574		defaultDate = this._getDefaultDate( inst );
25575		html = "";
25576
25577		for ( row = 0; row < numMonths[ 0 ]; row++ ) {
25578			group = "";
25579			this.maxRows = 4;
25580			for ( col = 0; col < numMonths[ 1 ]; col++ ) {
25581				selectedDate = this._daylightSavingAdjust( new Date( drawYear, drawMonth, inst.selectedDay ) );
25582				cornerClass = " ui-corner-all";
25583				calender = "";
25584				if ( isMultiMonth ) {
25585					calender += "<div class='ui-datepicker-group";
25586					if ( numMonths[ 1 ] > 1 ) {
25587						switch ( col ) {
25588							case 0: calender += " ui-datepicker-group-first";
25589								cornerClass = " ui-corner-" + ( isRTL ? "right" : "left" ); break;
25590							case numMonths[ 1 ] - 1: calender += " ui-datepicker-group-last";
25591								cornerClass = " ui-corner-" + ( isRTL ? "left" : "right" ); break;
25592							default: calender += " ui-datepicker-group-middle"; cornerClass = ""; break;
25593						}
25594					}
25595					calender += "'>";
25596				}
25597				calender += "<div class='ui-datepicker-header ui-widget-header ui-helper-clearfix" + cornerClass + "'>" +
25598					( /all|left/.test( cornerClass ) && row === 0 ? ( isRTL ? next : prev ) : "" ) +
25599					( /all|right/.test( cornerClass ) && row === 0 ? ( isRTL ? prev : next ) : "" ) +
25600					this._generateMonthYearHeader( inst, drawMonth, drawYear, minDate, maxDate,
25601					row > 0 || col > 0, monthNames, monthNamesShort ) + // draw month headers
25602					"</div><table class='ui-datepicker-calendar'><thead>" +
25603					"<tr>";
25604				thead = ( showWeek ? "<th class='ui-datepicker-week-col'>" + this._get( inst, "weekHeader" ) + "</th>" : "" );
25605				for ( dow = 0; dow < 7; dow++ ) { // days of the week
25606					day = ( dow + firstDay ) % 7;
25607					thead += "<th scope='col'" + ( ( dow + firstDay + 6 ) % 7 >= 5 ? " class='ui-datepicker-week-end'" : "" ) + ">" +
25608						"<span title='" + dayNames[ day ] + "'>" + dayNamesMin[ day ] + "</span></th>";
25609				}
25610				calender += thead + "</tr></thead><tbody>";
25611				daysInMonth = this._getDaysInMonth( drawYear, drawMonth );
25612				if ( drawYear === inst.selectedYear && drawMonth === inst.selectedMonth ) {
25613					inst.selectedDay = Math.min( inst.selectedDay, daysInMonth );
25614				}
25615				leadDays = ( this._getFirstDayOfMonth( drawYear, drawMonth ) - firstDay + 7 ) % 7;
25616				curRows = Math.ceil( ( leadDays + daysInMonth ) / 7 ); // calculate the number of rows to generate
25617				numRows = ( isMultiMonth ? this.maxRows > curRows ? this.maxRows : curRows : curRows ); //If multiple months, use the higher number of rows (see #7043)
25618				this.maxRows = numRows;
25619				printDate = this._daylightSavingAdjust( new Date( drawYear, drawMonth, 1 - leadDays ) );
25620				for ( dRow = 0; dRow < numRows; dRow++ ) { // create date picker rows
25621					calender += "<tr>";
25622					tbody = ( !showWeek ? "" : "<td class='ui-datepicker-week-col'>" +
25623						this._get( inst, "calculateWeek" )( printDate ) + "</td>" );
25624					for ( dow = 0; dow < 7; dow++ ) { // create date picker days
25625						daySettings = ( beforeShowDay ?
25626							beforeShowDay.apply( ( inst.input ? inst.input[ 0 ] : null ), [ printDate ] ) : [ true, "" ] );
25627						otherMonth = ( printDate.getMonth() !== drawMonth );
25628						unselectable = ( otherMonth && !selectOtherMonths ) || !daySettings[ 0 ] ||
25629							( minDate && printDate < minDate ) || ( maxDate && printDate > maxDate );
25630						tbody += "<td class='" +
25631							( ( dow + firstDay + 6 ) % 7 >= 5 ? " ui-datepicker-week-end" : "" ) + // highlight weekends
25632							( otherMonth ? " ui-datepicker-other-month" : "" ) + // highlight days from other months
25633							( ( printDate.getTime() === selectedDate.getTime() && drawMonth === inst.selectedMonth && inst._keyEvent ) || // user pressed key
25634							( defaultDate.getTime() === printDate.getTime() && defaultDate.getTime() === selectedDate.getTime() ) ?
25635
25636							// or defaultDate is current printedDate and defaultDate is selectedDate
25637							" " + this._dayOverClass : "" ) + // highlight selected day
25638							( unselectable ? " " + this._unselectableClass + " ui-state-disabled" : "" ) +  // highlight unselectable days
25639							( otherMonth && !showOtherMonths ? "" : " " + daySettings[ 1 ] + // highlight custom dates
25640							( printDate.getTime() === currentDate.getTime() ? " " + this._currentClass : "" ) + // highlight selected day
25641							( printDate.getTime() === today.getTime() ? " ui-datepicker-today" : "" ) ) + "'" + // highlight today (if different)
25642							( ( !otherMonth || showOtherMonths ) && daySettings[ 2 ] ? " title='" + daySettings[ 2 ].replace( /'/g, "&#39;" ) + "'" : "" ) + // cell title
25643							( unselectable ? "" : " data-handler='selectDay' data-event='click' data-month='" + printDate.getMonth() + "' data-year='" + printDate.getFullYear() + "'" ) + ">" + // actions
25644							( otherMonth && !showOtherMonths ? "&#xa0;" : // display for other months
25645							( unselectable ? "<span class='ui-state-default'>" + printDate.getDate() + "</span>" : "<a class='ui-state-default" +
25646							( printDate.getTime() === today.getTime() ? " ui-state-highlight" : "" ) +
25647							( printDate.getTime() === currentDate.getTime() ? " ui-state-active" : "" ) + // highlight selected day
25648							( otherMonth ? " ui-priority-secondary" : "" ) + // distinguish dates from other months
25649							"' href='#'>" + printDate.getDate() + "</a>" ) ) + "</td>"; // display selectable date
25650						printDate.setDate( printDate.getDate() + 1 );
25651						printDate = this._daylightSavingAdjust( printDate );
25652					}
25653					calender += tbody + "</tr>";
25654				}
25655				drawMonth++;
25656				if ( drawMonth > 11 ) {
25657					drawMonth = 0;
25658					drawYear++;
25659				}
25660				calender += "</tbody></table>" + ( isMultiMonth ? "</div>" +
25661							( ( numMonths[ 0 ] > 0 && col === numMonths[ 1 ] - 1 ) ? "<div class='ui-datepicker-row-break'></div>" : "" ) : "" );
25662				group += calender;
25663			}
25664			html += group;
25665		}
25666		html += buttonPanel;
25667		inst._keyEvent = false;
25668		return html;
25669	},
25670
25671	/* Generate the month and year header. */
25672	_generateMonthYearHeader: function( inst, drawMonth, drawYear, minDate, maxDate,
25673			secondary, monthNames, monthNamesShort ) {
25674
25675		var inMinYear, inMaxYear, month, years, thisYear, determineYear, year, endYear,
25676			changeMonth = this._get( inst, "changeMonth" ),
25677			changeYear = this._get( inst, "changeYear" ),
25678			showMonthAfterYear = this._get( inst, "showMonthAfterYear" ),
25679			html = "<div class='ui-datepicker-title'>",
25680			monthHtml = "";
25681
25682		// Month selection
25683		if ( secondary || !changeMonth ) {
25684			monthHtml += "<span class='ui-datepicker-month'>" + monthNames[ drawMonth ] + "</span>";
25685		} else {
25686			inMinYear = ( minDate && minDate.getFullYear() === drawYear );
25687			inMaxYear = ( maxDate && maxDate.getFullYear() === drawYear );
25688			monthHtml += "<select class='ui-datepicker-month' data-handler='selectMonth' data-event='change'>";
25689			for ( month = 0; month < 12; month++ ) {
25690				if ( ( !inMinYear || month >= minDate.getMonth() ) && ( !inMaxYear || month <= maxDate.getMonth() ) ) {
25691					monthHtml += "<option value='" + month + "'" +
25692						( month === drawMonth ? " selected='selected'" : "" ) +
25693						">" + monthNamesShort[ month ] + "</option>";
25694				}
25695			}
25696			monthHtml += "</select>";
25697		}
25698
25699		if ( !showMonthAfterYear ) {
25700			html += monthHtml + ( secondary || !( changeMonth && changeYear ) ? "&#xa0;" : "" );
25701		}
25702
25703		// Year selection
25704		if ( !inst.yearshtml ) {
25705			inst.yearshtml = "";
25706			if ( secondary || !changeYear ) {
25707				html += "<span class='ui-datepicker-year'>" + drawYear + "</span>";
25708			} else {
25709
25710				// determine range of years to display
25711				years = this._get( inst, "yearRange" ).split( ":" );
25712				thisYear = new Date().getFullYear();
25713				determineYear = function( value ) {
25714					var year = ( value.match( /c[+\-].*/ ) ? drawYear + parseInt( value.substring( 1 ), 10 ) :
25715						( value.match( /[+\-].*/ ) ? thisYear + parseInt( value, 10 ) :
25716						parseInt( value, 10 ) ) );
25717					return ( isNaN( year ) ? thisYear : year );
25718				};
25719				year = determineYear( years[ 0 ] );
25720				endYear = Math.max( year, determineYear( years[ 1 ] || "" ) );
25721				year = ( minDate ? Math.max( year, minDate.getFullYear() ) : year );
25722				endYear = ( maxDate ? Math.min( endYear, maxDate.getFullYear() ) : endYear );
25723				inst.yearshtml += "<select class='ui-datepicker-year' data-handler='selectYear' data-event='change'>";
25724				for ( ; year <= endYear; year++ ) {
25725					inst.yearshtml += "<option value='" + year + "'" +
25726						( year === drawYear ? " selected='selected'" : "" ) +
25727						">" + year + "</option>";
25728				}
25729				inst.yearshtml += "</select>";
25730
25731				html += inst.yearshtml;
25732				inst.yearshtml = null;
25733			}
25734		}
25735
25736		html += this._get( inst, "yearSuffix" );
25737		if ( showMonthAfterYear ) {
25738			html += ( secondary || !( changeMonth && changeYear ) ? "&#xa0;" : "" ) + monthHtml;
25739		}
25740		html += "</div>"; // Close datepicker_header
25741		return html;
25742	},
25743
25744	/* Adjust one of the date sub-fields. */
25745	_adjustInstDate: function( inst, offset, period ) {
25746		var year = inst.selectedYear + ( period === "Y" ? offset : 0 ),
25747			month = inst.selectedMonth + ( period === "M" ? offset : 0 ),
25748			day = Math.min( inst.selectedDay, this._getDaysInMonth( year, month ) ) + ( period === "D" ? offset : 0 ),
25749			date = this._restrictMinMax( inst, this._daylightSavingAdjust( new Date( year, month, day ) ) );
25750
25751		inst.selectedDay = date.getDate();
25752		inst.drawMonth = inst.selectedMonth = date.getMonth();
25753		inst.drawYear = inst.selectedYear = date.getFullYear();
25754		if ( period === "M" || period === "Y" ) {
25755			this._notifyChange( inst );
25756		}
25757	},
25758
25759	/* Ensure a date is within any min/max bounds. */
25760	_restrictMinMax: function( inst, date ) {
25761		var minDate = this._getMinMaxDate( inst, "min" ),
25762			maxDate = this._getMinMaxDate( inst, "max" ),
25763			newDate = ( minDate && date < minDate ? minDate : date );
25764		return ( maxDate && newDate > maxDate ? maxDate : newDate );
25765	},
25766
25767	/* Notify change of month/year. */
25768	_notifyChange: function( inst ) {
25769		var onChange = this._get( inst, "onChangeMonthYear" );
25770		if ( onChange ) {
25771			onChange.apply( ( inst.input ? inst.input[ 0 ] : null ),
25772				[ inst.selectedYear, inst.selectedMonth + 1, inst ] );
25773		}
25774	},
25775
25776	/* Determine the number of months to show. */
25777	_getNumberOfMonths: function( inst ) {
25778		var numMonths = this._get( inst, "numberOfMonths" );
25779		return ( numMonths == null ? [ 1, 1 ] : ( typeof numMonths === "number" ? [ 1, numMonths ] : numMonths ) );
25780	},
25781
25782	/* Determine the current maximum date - ensure no time components are set. */
25783	_getMinMaxDate: function( inst, minMax ) {
25784		return this._determineDate( inst, this._get( inst, minMax + "Date" ), null );
25785	},
25786
25787	/* Find the number of days in a given month. */
25788	_getDaysInMonth: function( year, month ) {
25789		return 32 - this._daylightSavingAdjust( new Date( year, month, 32 ) ).getDate();
25790	},
25791
25792	/* Find the day of the week of the first of a month. */
25793	_getFirstDayOfMonth: function( year, month ) {
25794		return new Date( year, month, 1 ).getDay();
25795	},
25796
25797	/* Determines if we should allow a "next/prev" month display change. */
25798	_canAdjustMonth: function( inst, offset, curYear, curMonth ) {
25799		var numMonths = this._getNumberOfMonths( inst ),
25800			date = this._daylightSavingAdjust( new Date( curYear,
25801			curMonth + ( offset < 0 ? offset : numMonths[ 0 ] * numMonths[ 1 ] ), 1 ) );
25802
25803		if ( offset < 0 ) {
25804			date.setDate( this._getDaysInMonth( date.getFullYear(), date.getMonth() ) );
25805		}
25806		return this._isInRange( inst, date );
25807	},
25808
25809	/* Is the given date in the accepted range? */
25810	_isInRange: function( inst, date ) {
25811		var yearSplit, currentYear,
25812			minDate = this._getMinMaxDate( inst, "min" ),
25813			maxDate = this._getMinMaxDate( inst, "max" ),
25814			minYear = null,
25815			maxYear = null,
25816			years = this._get( inst, "yearRange" );
25817			if ( years ) {
25818				yearSplit = years.split( ":" );
25819				currentYear = new Date().getFullYear();
25820				minYear = parseInt( yearSplit[ 0 ], 10 );
25821				maxYear = parseInt( yearSplit[ 1 ], 10 );
25822				if ( yearSplit[ 0 ].match( /[+\-].*/ ) ) {
25823					minYear += currentYear;
25824				}
25825				if ( yearSplit[ 1 ].match( /[+\-].*/ ) ) {
25826					maxYear += currentYear;
25827				}
25828			}
25829
25830		return ( ( !minDate || date.getTime() >= minDate.getTime() ) &&
25831			( !maxDate || date.getTime() <= maxDate.getTime() ) &&
25832			( !minYear || date.getFullYear() >= minYear ) &&
25833			( !maxYear || date.getFullYear() <= maxYear ) );
25834	},
25835
25836	/* Provide the configuration settings for formatting/parsing. */
25837	_getFormatConfig: function( inst ) {
25838		var shortYearCutoff = this._get( inst, "shortYearCutoff" );
25839		shortYearCutoff = ( typeof shortYearCutoff !== "string" ? shortYearCutoff :
25840			new Date().getFullYear() % 100 + parseInt( shortYearCutoff, 10 ) );
25841		return { shortYearCutoff: shortYearCutoff,
25842			dayNamesShort: this._get( inst, "dayNamesShort" ), dayNames: this._get( inst, "dayNames" ),
25843			monthNamesShort: this._get( inst, "monthNamesShort" ), monthNames: this._get( inst, "monthNames" ) };
25844	},
25845
25846	/* Format the given date for display. */
25847	_formatDate: function( inst, day, month, year ) {
25848		if ( !day ) {
25849			inst.currentDay = inst.selectedDay;
25850			inst.currentMonth = inst.selectedMonth;
25851			inst.currentYear = inst.selectedYear;
25852		}
25853		var date = ( day ? ( typeof day === "object" ? day :
25854			this._daylightSavingAdjust( new Date( year, month, day ) ) ) :
25855			this._daylightSavingAdjust( new Date( inst.currentYear, inst.currentMonth, inst.currentDay ) ) );
25856		return this.formatDate( this._get( inst, "dateFormat" ), date, this._getFormatConfig( inst ) );
25857	}
25858} );
25859
25860/*
25861 * Bind hover events for datepicker elements.
25862 * Done via delegate so the binding only occurs once in the lifetime of the parent div.
25863 * Global datepicker_instActive, set by _updateDatepicker allows the handlers to find their way back to the active picker.
25864 */
25865function datepicker_bindHover( dpDiv ) {
25866	var selector = "button, .ui-datepicker-prev, .ui-datepicker-next, .ui-datepicker-calendar td a";
25867	return dpDiv.on( "mouseout", selector, function() {
25868			$( this ).removeClass( "ui-state-hover" );
25869			if ( this.className.indexOf( "ui-datepicker-prev" ) !== -1 ) {
25870				$( this ).removeClass( "ui-datepicker-prev-hover" );
25871			}
25872			if ( this.className.indexOf( "ui-datepicker-next" ) !== -1 ) {
25873				$( this ).removeClass( "ui-datepicker-next-hover" );
25874			}
25875		} )
25876		.on( "mouseover", selector, datepicker_handleMouseover );
25877}
25878
25879function datepicker_handleMouseover() {
25880	if ( !$.datepicker._isDisabledDatepicker( datepicker_instActive.inline ? datepicker_instActive.dpDiv.parent()[ 0 ] : datepicker_instActive.input[ 0 ] ) ) {
25881		$( this ).parents( ".ui-datepicker-calendar" ).find( "a" ).removeClass( "ui-state-hover" );
25882		$( this ).addClass( "ui-state-hover" );
25883		if ( this.className.indexOf( "ui-datepicker-prev" ) !== -1 ) {
25884			$( this ).addClass( "ui-datepicker-prev-hover" );
25885		}
25886		if ( this.className.indexOf( "ui-datepicker-next" ) !== -1 ) {
25887			$( this ).addClass( "ui-datepicker-next-hover" );
25888		}
25889	}
25890}
25891
25892/* jQuery extend now ignores nulls! */
25893function datepicker_extendRemove( target, props ) {
25894	$.extend( target, props );
25895	for ( var name in props ) {
25896		if ( props[ name ] == null ) {
25897			target[ name ] = props[ name ];
25898		}
25899	}
25900	return target;
25901}
25902
25903/* Invoke the datepicker functionality.
25904   @param  options  string - a command, optionally followed by additional parameters or
25905					Object - settings for attaching new datepicker functionality
25906   @return  jQuery object */
25907$.fn.datepicker = function( options ) {
25908
25909	/* Verify an empty collection wasn't passed - Fixes #6976 */
25910	if ( !this.length ) {
25911		return this;
25912	}
25913
25914	/* Initialise the date picker. */
25915	if ( !$.datepicker.initialized ) {
25916		$( document ).on( "mousedown", $.datepicker._checkExternalClick );
25917		$.datepicker.initialized = true;
25918	}
25919
25920	/* Append datepicker main container to body if not exist. */
25921	if ( $( "#" + $.datepicker._mainDivId ).length === 0 ) {
25922		$( "body" ).append( $.datepicker.dpDiv );
25923	}
25924
25925	var otherArgs = Array.prototype.slice.call( arguments, 1 );
25926	if ( typeof options === "string" && ( options === "isDisabled" || options === "getDate" || options === "widget" ) ) {
25927		return $.datepicker[ "_" + options + "Datepicker" ].
25928			apply( $.datepicker, [ this[ 0 ] ].concat( otherArgs ) );
25929	}
25930	if ( options === "option" && arguments.length === 2 && typeof arguments[ 1 ] === "string" ) {
25931		return $.datepicker[ "_" + options + "Datepicker" ].
25932			apply( $.datepicker, [ this[ 0 ] ].concat( otherArgs ) );
25933	}
25934	return this.each( function() {
25935		typeof options === "string" ?
25936			$.datepicker[ "_" + options + "Datepicker" ].
25937				apply( $.datepicker, [ this ].concat( otherArgs ) ) :
25938			$.datepicker._attachDatepicker( this, options );
25939	} );
25940};
25941
25942$.datepicker = new Datepicker(); // singleton instance
25943$.datepicker.initialized = false;
25944$.datepicker.uuid = new Date().getTime();
25945$.datepicker.version = "1.12.1";
25946
25947var widgetsDatepicker = $.datepicker;
25948
25949
25950
25951
25952// This file is deprecated
25953var ie = $.ui.ie = !!/msie [\w.]+/.exec( navigator.userAgent.toLowerCase() );
25954
25955/*!
25956 * jQuery UI Mouse 1.12.1
25957 * http://jqueryui.com
25958 *
25959 * Copyright jQuery Foundation and other contributors
25960 * Released under the MIT license.
25961 * http://jquery.org/license
25962 */
25963
25964//>>label: Mouse
25965//>>group: Widgets
25966//>>description: Abstracts mouse-based interactions to assist in creating certain widgets.
25967//>>docs: http://api.jqueryui.com/mouse/
25968
25969
25970
25971var mouseHandled = false;
25972$( document ).on( "mouseup", function() {
25973	mouseHandled = false;
25974} );
25975
25976var widgetsMouse = $.widget( "ui.mouse", {
25977	version: "1.12.1",
25978	options: {
25979		cancel: "input, textarea, button, select, option",
25980		distance: 1,
25981		delay: 0
25982	},
25983	_mouseInit: function() {
25984		var that = this;
25985
25986		this.element
25987			.on( "mousedown." + this.widgetName, function( event ) {
25988				return that._mouseDown( event );
25989			} )
25990			.on( "click." + this.widgetName, function( event ) {
25991				if ( true === $.data( event.target, that.widgetName + ".preventClickEvent" ) ) {
25992					$.removeData( event.target, that.widgetName + ".preventClickEvent" );
25993					event.stopImmediatePropagation();
25994					return false;
25995				}
25996			} );
25997
25998		this.started = false;
25999	},
26000
26001	// TODO: make sure destroying one instance of mouse doesn't mess with
26002	// other instances of mouse
26003	_mouseDestroy: function() {
26004		this.element.off( "." + this.widgetName );
26005		if ( this._mouseMoveDelegate ) {
26006			this.document
26007				.off( "mousemove." + this.widgetName, this._mouseMoveDelegate )
26008				.off( "mouseup." + this.widgetName, this._mouseUpDelegate );
26009		}
26010	},
26011
26012	_mouseDown: function( event ) {
26013
26014		// don't let more than one widget handle mouseStart
26015		if ( mouseHandled ) {
26016			return;
26017		}
26018
26019		this._mouseMoved = false;
26020
26021		// We may have missed mouseup (out of window)
26022		( this._mouseStarted && this._mouseUp( event ) );
26023
26024		this._mouseDownEvent = event;
26025
26026		var that = this,
26027			btnIsLeft = ( event.which === 1 ),
26028
26029			// event.target.nodeName works around a bug in IE 8 with
26030			// disabled inputs (#7620)
26031			elIsCancel = ( typeof this.options.cancel === "string" && event.target.nodeName ?
26032				$( event.target ).closest( this.options.cancel ).length : false );
26033		if ( !btnIsLeft || elIsCancel || !this._mouseCapture( event ) ) {
26034			return true;
26035		}
26036
26037		this.mouseDelayMet = !this.options.delay;
26038		if ( !this.mouseDelayMet ) {
26039			this._mouseDelayTimer = setTimeout( function() {
26040				that.mouseDelayMet = true;
26041			}, this.options.delay );
26042		}
26043
26044		if ( this._mouseDistanceMet( event ) && this._mouseDelayMet( event ) ) {
26045			this._mouseStarted = ( this._mouseStart( event ) !== false );
26046			if ( !this._mouseStarted ) {
26047				event.preventDefault();
26048				return true;
26049			}
26050		}
26051
26052		// Click event may never have fired (Gecko & Opera)
26053		if ( true === $.data( event.target, this.widgetName + ".preventClickEvent" ) ) {
26054			$.removeData( event.target, this.widgetName + ".preventClickEvent" );
26055		}
26056
26057		// These delegates are required to keep context
26058		this._mouseMoveDelegate = function( event ) {
26059			return that._mouseMove( event );
26060		};
26061		this._mouseUpDelegate = function( event ) {
26062			return that._mouseUp( event );
26063		};
26064
26065		this.document
26066			.on( "mousemove." + this.widgetName, this._mouseMoveDelegate )
26067			.on( "mouseup." + this.widgetName, this._mouseUpDelegate );
26068
26069		event.preventDefault();
26070
26071		mouseHandled = true;
26072		return true;
26073	},
26074
26075	_mouseMove: function( event ) {
26076
26077		// Only check for mouseups outside the document if you've moved inside the document
26078		// at least once. This prevents the firing of mouseup in the case of IE<9, which will
26079		// fire a mousemove event if content is placed under the cursor. See #7778
26080		// Support: IE <9
26081		if ( this._mouseMoved ) {
26082
26083			// IE mouseup check - mouseup happened when mouse was out of window
26084			if ( $.ui.ie && ( !document.documentMode || document.documentMode < 9 ) &&
26085					!event.button ) {
26086				return this._mouseUp( event );
26087
26088			// Iframe mouseup check - mouseup occurred in another document
26089			} else if ( !event.which ) {
26090
26091				// Support: Safari <=8 - 9
26092				// Safari sets which to 0 if you press any of the following keys
26093				// during a drag (#14461)
26094				if ( event.originalEvent.altKey || event.originalEvent.ctrlKey ||
26095						event.originalEvent.metaKey || event.originalEvent.shiftKey ) {
26096					this.ignoreMissingWhich = true;
26097				} else if ( !this.ignoreMissingWhich ) {
26098					return this._mouseUp( event );
26099				}
26100			}
26101		}
26102
26103		if ( event.which || event.button ) {
26104			this._mouseMoved = true;
26105		}
26106
26107		if ( this._mouseStarted ) {
26108			this._mouseDrag( event );
26109			return event.preventDefault();
26110		}
26111
26112		if ( this._mouseDistanceMet( event ) && this._mouseDelayMet( event ) ) {
26113			this._mouseStarted =
26114				( this._mouseStart( this._mouseDownEvent, event ) !== false );
26115			( this._mouseStarted ? this._mouseDrag( event ) : this._mouseUp( event ) );
26116		}
26117
26118		return !this._mouseStarted;
26119	},
26120
26121	_mouseUp: function( event ) {
26122		this.document
26123			.off( "mousemove." + this.widgetName, this._mouseMoveDelegate )
26124			.off( "mouseup." + this.widgetName, this._mouseUpDelegate );
26125
26126		if ( this._mouseStarted ) {
26127			this._mouseStarted = false;
26128
26129			if ( event.target === this._mouseDownEvent.target ) {
26130				$.data( event.target, this.widgetName + ".preventClickEvent", true );
26131			}
26132
26133			this._mouseStop( event );
26134		}
26135
26136		if ( this._mouseDelayTimer ) {
26137			clearTimeout( this._mouseDelayTimer );
26138			delete this._mouseDelayTimer;
26139		}
26140
26141		this.ignoreMissingWhich = false;
26142		mouseHandled = false;
26143		event.preventDefault();
26144	},
26145
26146	_mouseDistanceMet: function( event ) {
26147		return ( Math.max(
26148				Math.abs( this._mouseDownEvent.pageX - event.pageX ),
26149				Math.abs( this._mouseDownEvent.pageY - event.pageY )
26150			) >= this.options.distance
26151		);
26152	},
26153
26154	_mouseDelayMet: function( /* event */ ) {
26155		return this.mouseDelayMet;
26156	},
26157
26158	// These are placeholder methods, to be overriden by extending plugin
26159	_mouseStart: function( /* event */ ) {},
26160	_mouseDrag: function( /* event */ ) {},
26161	_mouseStop: function( /* event */ ) {},
26162	_mouseCapture: function( /* event */ ) { return true; }
26163} );
26164
26165
26166
26167
26168// $.ui.plugin is deprecated. Use $.widget() extensions instead.
26169var plugin = $.ui.plugin = {
26170	add: function( module, option, set ) {
26171		var i,
26172			proto = $.ui[ module ].prototype;
26173		for ( i in set ) {
26174			proto.plugins[ i ] = proto.plugins[ i ] || [];
26175			proto.plugins[ i ].push( [ option, set[ i ] ] );
26176		}
26177	},
26178	call: function( instance, name, args, allowDisconnected ) {
26179		var i,
26180			set = instance.plugins[ name ];
26181
26182		if ( !set ) {
26183			return;
26184		}
26185
26186		if ( !allowDisconnected && ( !instance.element[ 0 ].parentNode ||
26187				instance.element[ 0 ].parentNode.nodeType === 11 ) ) {
26188			return;
26189		}
26190
26191		for ( i = 0; i < set.length; i++ ) {
26192			if ( instance.options[ set[ i ][ 0 ] ] ) {
26193				set[ i ][ 1 ].apply( instance.element, args );
26194			}
26195		}
26196	}
26197};
26198
26199
26200
26201var safeBlur = $.ui.safeBlur = function( element ) {
26202
26203	// Support: IE9 - 10 only
26204	// If the <body> is blurred, IE will switch windows, see #9420
26205	if ( element && element.nodeName.toLowerCase() !== "body" ) {
26206		$( element ).trigger( "blur" );
26207	}
26208};
26209
26210
26211/*!
26212 * jQuery UI Draggable 1.12.1
26213 * http://jqueryui.com
26214 *
26215 * Copyright jQuery Foundation and other contributors
26216 * Released under the MIT license.
26217 * http://jquery.org/license
26218 */
26219
26220//>>label: Draggable
26221//>>group: Interactions
26222//>>description: Enables dragging functionality for any element.
26223//>>docs: http://api.jqueryui.com/draggable/
26224//>>demos: http://jqueryui.com/draggable/
26225//>>css.structure: ../../themes/base/draggable.css
26226
26227
26228
26229$.widget( "ui.draggable", $.ui.mouse, {
26230	version: "1.12.1",
26231	widgetEventPrefix: "drag",
26232	options: {
26233		addClasses: true,
26234		appendTo: "parent",
26235		axis: false,
26236		connectToSortable: false,
26237		containment: false,
26238		cursor: "auto",
26239		cursorAt: false,
26240		grid: false,
26241		handle: false,
26242		helper: "original",
26243		iframeFix: false,
26244		opacity: false,
26245		refreshPositions: false,
26246		revert: false,
26247		revertDuration: 500,
26248		scope: "default",
26249		scroll: true,
26250		scrollSensitivity: 20,
26251		scrollSpeed: 20,
26252		snap: false,
26253		snapMode: "both",
26254		snapTolerance: 20,
26255		stack: false,
26256		zIndex: false,
26257
26258		// Callbacks
26259		drag: null,
26260		start: null,
26261		stop: null
26262	},
26263	_create: function() {
26264
26265		if ( this.options.helper === "original" ) {
26266			this._setPositionRelative();
26267		}
26268		if ( this.options.addClasses ) {
26269			this._addClass( "ui-draggable" );
26270		}
26271		this._setHandleClassName();
26272
26273		this._mouseInit();
26274	},
26275
26276	_setOption: function( key, value ) {
26277		this._super( key, value );
26278		if ( key === "handle" ) {
26279			this._removeHandleClassName();
26280			this._setHandleClassName();
26281		}
26282	},
26283
26284	_destroy: function() {
26285		if ( ( this.helper || this.element ).is( ".ui-draggable-dragging" ) ) {
26286			this.destroyOnClear = true;
26287			return;
26288		}
26289		this._removeHandleClassName();
26290		this._mouseDestroy();
26291	},
26292
26293	_mouseCapture: function( event ) {
26294		var o = this.options;
26295
26296		// Among others, prevent a drag on a resizable-handle
26297		if ( this.helper || o.disabled ||
26298				$( event.target ).closest( ".ui-resizable-handle" ).length > 0 ) {
26299			return false;
26300		}
26301
26302		//Quit if we're not on a valid handle
26303		this.handle = this._getHandle( event );
26304		if ( !this.handle ) {
26305			return false;
26306		}
26307
26308		this._blurActiveElement( event );
26309
26310		this._blockFrames( o.iframeFix === true ? "iframe" : o.iframeFix );
26311
26312		return true;
26313
26314	},
26315
26316	_blockFrames: function( selector ) {
26317		this.iframeBlocks = this.document.find( selector ).map( function() {
26318			var iframe = $( this );
26319
26320			return $( "<div>" )
26321				.css( "position", "absolute" )
26322				.appendTo( iframe.parent() )
26323				.outerWidth( iframe.outerWidth() )
26324				.outerHeight( iframe.outerHeight() )
26325				.offset( iframe.offset() )[ 0 ];
26326		} );
26327	},
26328
26329	_unblockFrames: function() {
26330		if ( this.iframeBlocks ) {
26331			this.iframeBlocks.remove();
26332			delete this.iframeBlocks;
26333		}
26334	},
26335
26336	_blurActiveElement: function( event ) {
26337		var activeElement = $.ui.safeActiveElement( this.document[ 0 ] ),
26338			target = $( event.target );
26339
26340		// Don't blur if the event occurred on an element that is within
26341		// the currently focused element
26342		// See #10527, #12472
26343		if ( target.closest( activeElement ).length ) {
26344			return;
26345		}
26346
26347		// Blur any element that currently has focus, see #4261
26348		$.ui.safeBlur( activeElement );
26349	},
26350
26351	_mouseStart: function( event ) {
26352
26353		var o = this.options;
26354
26355		//Create and append the visible helper
26356		this.helper = this._createHelper( event );
26357
26358		this._addClass( this.helper, "ui-draggable-dragging" );
26359
26360		//Cache the helper size
26361		this._cacheHelperProportions();
26362
26363		//If ddmanager is used for droppables, set the global draggable
26364		if ( $.ui.ddmanager ) {
26365			$.ui.ddmanager.current = this;
26366		}
26367
26368		/*
26369		 * - Position generation -
26370		 * This block generates everything position related - it's the core of draggables.
26371		 */
26372
26373		//Cache the margins of the original element
26374		this._cacheMargins();
26375
26376		//Store the helper's css position
26377		this.cssPosition = this.helper.css( "position" );
26378		this.scrollParent = this.helper.scrollParent( true );
26379		this.offsetParent = this.helper.offsetParent();
26380		this.hasFixedAncestor = this.helper.parents().filter( function() {
26381				return $( this ).css( "position" ) === "fixed";
26382			} ).length > 0;
26383
26384		//The element's absolute position on the page minus margins
26385		this.positionAbs = this.element.offset();
26386		this._refreshOffsets( event );
26387
26388		//Generate the original position
26389		this.originalPosition = this.position = this._generatePosition( event, false );
26390		this.originalPageX = event.pageX;
26391		this.originalPageY = event.pageY;
26392
26393		//Adjust the mouse offset relative to the helper if "cursorAt" is supplied
26394		( o.cursorAt && this._adjustOffsetFromHelper( o.cursorAt ) );
26395
26396		//Set a containment if given in the options
26397		this._setContainment();
26398
26399		//Trigger event + callbacks
26400		if ( this._trigger( "start", event ) === false ) {
26401			this._clear();
26402			return false;
26403		}
26404
26405		//Recache the helper size
26406		this._cacheHelperProportions();
26407
26408		//Prepare the droppable offsets
26409		if ( $.ui.ddmanager && !o.dropBehaviour ) {
26410			$.ui.ddmanager.prepareOffsets( this, event );
26411		}
26412
26413		// Execute the drag once - this causes the helper not to be visible before getting its
26414		// correct position
26415		this._mouseDrag( event, true );
26416
26417		// If the ddmanager is used for droppables, inform the manager that dragging has started
26418		// (see #5003)
26419		if ( $.ui.ddmanager ) {
26420			$.ui.ddmanager.dragStart( this, event );
26421		}
26422
26423		return true;
26424	},
26425
26426	_refreshOffsets: function( event ) {
26427		this.offset = {
26428			top: this.positionAbs.top - this.margins.top,
26429			left: this.positionAbs.left - this.margins.left,
26430			scroll: false,
26431			parent: this._getParentOffset(),
26432			relative: this._getRelativeOffset()
26433		};
26434
26435		this.offset.click = {
26436			left: event.pageX - this.offset.left,
26437			top: event.pageY - this.offset.top
26438		};
26439	},
26440
26441	_mouseDrag: function( event, noPropagation ) {
26442
26443		// reset any necessary cached properties (see #5009)
26444		if ( this.hasFixedAncestor ) {
26445			this.offset.parent = this._getParentOffset();
26446		}
26447
26448		//Compute the helpers position
26449		this.position = this._generatePosition( event, true );
26450		this.positionAbs = this._convertPositionTo( "absolute" );
26451
26452		//Call plugins and callbacks and use the resulting position if something is returned
26453		if ( !noPropagation ) {
26454			var ui = this._uiHash();
26455			if ( this._trigger( "drag", event, ui ) === false ) {
26456				this._mouseUp( new $.Event( "mouseup", event ) );
26457				return false;
26458			}
26459			this.position = ui.position;
26460		}
26461
26462		this.helper[ 0 ].style.left = this.position.left + "px";
26463		this.helper[ 0 ].style.top = this.position.top + "px";
26464
26465		if ( $.ui.ddmanager ) {
26466			$.ui.ddmanager.drag( this, event );
26467		}
26468
26469		return false;
26470	},
26471
26472	_mouseStop: function( event ) {
26473
26474		//If we are using droppables, inform the manager about the drop
26475		var that = this,
26476			dropped = false;
26477		if ( $.ui.ddmanager && !this.options.dropBehaviour ) {
26478			dropped = $.ui.ddmanager.drop( this, event );
26479		}
26480
26481		//if a drop comes from outside (a sortable)
26482		if ( this.dropped ) {
26483			dropped = this.dropped;
26484			this.dropped = false;
26485		}
26486
26487		if ( ( this.options.revert === "invalid" && !dropped ) ||
26488				( this.options.revert === "valid" && dropped ) ||
26489				this.options.revert === true || ( $.isFunction( this.options.revert ) &&
26490				this.options.revert.call( this.element, dropped ) )
26491		) {
26492			$( this.helper ).animate(
26493				this.originalPosition,
26494				parseInt( this.options.revertDuration, 10 ),
26495				function() {
26496					if ( that._trigger( "stop", event ) !== false ) {
26497						that._clear();
26498					}
26499				}
26500			);
26501		} else {
26502			if ( this._trigger( "stop", event ) !== false ) {
26503				this._clear();
26504			}
26505		}
26506
26507		return false;
26508	},
26509
26510	_mouseUp: function( event ) {
26511		this._unblockFrames();
26512
26513		// If the ddmanager is used for droppables, inform the manager that dragging has stopped
26514		// (see #5003)
26515		if ( $.ui.ddmanager ) {
26516			$.ui.ddmanager.dragStop( this, event );
26517		}
26518
26519		// Only need to focus if the event occurred on the draggable itself, see #10527
26520		if ( this.handleElement.is( event.target ) ) {
26521
26522			// The interaction is over; whether or not the click resulted in a drag,
26523			// focus the element
26524			this.element.trigger( "focus" );
26525		}
26526
26527		return $.ui.mouse.prototype._mouseUp.call( this, event );
26528	},
26529
26530	cancel: function() {
26531
26532		if ( this.helper.is( ".ui-draggable-dragging" ) ) {
26533			this._mouseUp( new $.Event( "mouseup", { target: this.element[ 0 ] } ) );
26534		} else {
26535			this._clear();
26536		}
26537
26538		return this;
26539
26540	},
26541
26542	_getHandle: function( event ) {
26543		return this.options.handle ?
26544			!!$( event.target ).closest( this.element.find( this.options.handle ) ).length :
26545			true;
26546	},
26547
26548	_setHandleClassName: function() {
26549		this.handleElement = this.options.handle ?
26550			this.element.find( this.options.handle ) : this.element;
26551		this._addClass( this.handleElement, "ui-draggable-handle" );
26552	},
26553
26554	_removeHandleClassName: function() {
26555		this._removeClass( this.handleElement, "ui-draggable-handle" );
26556	},
26557
26558	_createHelper: function( event ) {
26559
26560		var o = this.options,
26561			helperIsFunction = $.isFunction( o.helper ),
26562			helper = helperIsFunction ?
26563				$( o.helper.apply( this.element[ 0 ], [ event ] ) ) :
26564				( o.helper === "clone" ?
26565					this.element.clone().removeAttr( "id" ) :
26566					this.element );
26567
26568		if ( !helper.parents( "body" ).length ) {
26569			helper.appendTo( ( o.appendTo === "parent" ?
26570				this.element[ 0 ].parentNode :
26571				o.appendTo ) );
26572		}
26573
26574		// Http://bugs.jqueryui.com/ticket/9446
26575		// a helper function can return the original element
26576		// which wouldn't have been set to relative in _create
26577		if ( helperIsFunction && helper[ 0 ] === this.element[ 0 ] ) {
26578			this._setPositionRelative();
26579		}
26580
26581		if ( helper[ 0 ] !== this.element[ 0 ] &&
26582				!( /(fixed|absolute)/ ).test( helper.css( "position" ) ) ) {
26583			helper.css( "position", "absolute" );
26584		}
26585
26586		return helper;
26587
26588	},
26589
26590	_setPositionRelative: function() {
26591		if ( !( /^(?:r|a|f)/ ).test( this.element.css( "position" ) ) ) {
26592			this.element[ 0 ].style.position = "relative";
26593		}
26594	},
26595
26596	_adjustOffsetFromHelper: function( obj ) {
26597		if ( typeof obj === "string" ) {
26598			obj = obj.split( " " );
26599		}
26600		if ( $.isArray( obj ) ) {
26601			obj = { left: +obj[ 0 ], top: +obj[ 1 ] || 0 };
26602		}
26603		if ( "left" in obj ) {
26604			this.offset.click.left = obj.left + this.margins.left;
26605		}
26606		if ( "right" in obj ) {
26607			this.offset.click.left = this.helperProportions.width - obj.right + this.margins.left;
26608		}
26609		if ( "top" in obj ) {
26610			this.offset.click.top = obj.top + this.margins.top;
26611		}
26612		if ( "bottom" in obj ) {
26613			this.offset.click.top = this.helperProportions.height - obj.bottom + this.margins.top;
26614		}
26615	},
26616
26617	_isRootNode: function( element ) {
26618		return ( /(html|body)/i ).test( element.tagName ) || element === this.document[ 0 ];
26619	},
26620
26621	_getParentOffset: function() {
26622
26623		//Get the offsetParent and cache its position
26624		var po = this.offsetParent.offset(),
26625			document = this.document[ 0 ];
26626
26627		// This is a special case where we need to modify a offset calculated on start, since the
26628		// following happened:
26629		// 1. The position of the helper is absolute, so it's position is calculated based on the
26630		// next positioned parent
26631		// 2. The actual offset parent is a child of the scroll parent, and the scroll parent isn't
26632		// the document, which means that the scroll is included in the initial calculation of the
26633		// offset of the parent, and never recalculated upon drag
26634		if ( this.cssPosition === "absolute" && this.scrollParent[ 0 ] !== document &&
26635				$.contains( this.scrollParent[ 0 ], this.offsetParent[ 0 ] ) ) {
26636			po.left += this.scrollParent.scrollLeft();
26637			po.top += this.scrollParent.scrollTop();
26638		}
26639
26640		if ( this._isRootNode( this.offsetParent[ 0 ] ) ) {
26641			po = { top: 0, left: 0 };
26642		}
26643
26644		return {
26645			top: po.top + ( parseInt( this.offsetParent.css( "borderTopWidth" ), 10 ) || 0 ),
26646			left: po.left + ( parseInt( this.offsetParent.css( "borderLeftWidth" ), 10 ) || 0 )
26647		};
26648
26649	},
26650
26651	_getRelativeOffset: function() {
26652		if ( this.cssPosition !== "relative" ) {
26653			return { top: 0, left: 0 };
26654		}
26655
26656		var p = this.element.position(),
26657			scrollIsRootNode = this._isRootNode( this.scrollParent[ 0 ] );
26658
26659		return {
26660			top: p.top - ( parseInt( this.helper.css( "top" ), 10 ) || 0 ) +
26661				( !scrollIsRootNode ? this.scrollParent.scrollTop() : 0 ),
26662			left: p.left - ( parseInt( this.helper.css( "left" ), 10 ) || 0 ) +
26663				( !scrollIsRootNode ? this.scrollParent.scrollLeft() : 0 )
26664		};
26665
26666	},
26667
26668	_cacheMargins: function() {
26669		this.margins = {
26670			left: ( parseInt( this.element.css( "marginLeft" ), 10 ) || 0 ),
26671			top: ( parseInt( this.element.css( "marginTop" ), 10 ) || 0 ),
26672			right: ( parseInt( this.element.css( "marginRight" ), 10 ) || 0 ),
26673			bottom: ( parseInt( this.element.css( "marginBottom" ), 10 ) || 0 )
26674		};
26675	},
26676
26677	_cacheHelperProportions: function() {
26678		this.helperProportions = {
26679			width: this.helper.outerWidth(),
26680			height: this.helper.outerHeight()
26681		};
26682	},
26683
26684	_setContainment: function() {
26685
26686		var isUserScrollable, c, ce,
26687			o = this.options,
26688			document = this.document[ 0 ];
26689
26690		this.relativeContainer = null;
26691
26692		if ( !o.containment ) {
26693			this.containment = null;
26694			return;
26695		}
26696
26697		if ( o.containment === "window" ) {
26698			this.containment = [
26699				$( window ).scrollLeft() - this.offset.relative.left - this.offset.parent.left,
26700				$( window ).scrollTop() - this.offset.relative.top - this.offset.parent.top,
26701				$( window ).scrollLeft() + $( window ).width() -
26702					this.helperProportions.width - this.margins.left,
26703				$( window ).scrollTop() +
26704					( $( window ).height() || document.body.parentNode.scrollHeight ) -
26705					this.helperProportions.height - this.margins.top
26706			];
26707			return;
26708		}
26709
26710		if ( o.containment === "document" ) {
26711			this.containment = [
26712				0,
26713				0,
26714				$( document ).width() - this.helperProportions.width - this.margins.left,
26715				( $( document ).height() || document.body.parentNode.scrollHeight ) -
26716					this.helperProportions.height - this.margins.top
26717			];
26718			return;
26719		}
26720
26721		if ( o.containment.constructor === Array ) {
26722			this.containment = o.containment;
26723			return;
26724		}
26725
26726		if ( o.containment === "parent" ) {
26727			o.containment = this.helper[ 0 ].parentNode;
26728		}
26729
26730		c = $( o.containment );
26731		ce = c[ 0 ];
26732
26733		if ( !ce ) {
26734			return;
26735		}
26736
26737		isUserScrollable = /(scroll|auto)/.test( c.css( "overflow" ) );
26738
26739		this.containment = [
26740			( parseInt( c.css( "borderLeftWidth" ), 10 ) || 0 ) +
26741				( parseInt( c.css( "paddingLeft" ), 10 ) || 0 ),
26742			( parseInt( c.css( "borderTopWidth" ), 10 ) || 0 ) +
26743				( parseInt( c.css( "paddingTop" ), 10 ) || 0 ),
26744			( isUserScrollable ? Math.max( ce.scrollWidth, ce.offsetWidth ) : ce.offsetWidth ) -
26745				( parseInt( c.css( "borderRightWidth" ), 10 ) || 0 ) -
26746				( parseInt( c.css( "paddingRight" ), 10 ) || 0 ) -
26747				this.helperProportions.width -
26748				this.margins.left -
26749				this.margins.right,
26750			( isUserScrollable ? Math.max( ce.scrollHeight, ce.offsetHeight ) : ce.offsetHeight ) -
26751				( parseInt( c.css( "borderBottomWidth" ), 10 ) || 0 ) -
26752				( parseInt( c.css( "paddingBottom" ), 10 ) || 0 ) -
26753				this.helperProportions.height -
26754				this.margins.top -
26755				this.margins.bottom
26756		];
26757		this.relativeContainer = c;
26758	},
26759
26760	_convertPositionTo: function( d, pos ) {
26761
26762		if ( !pos ) {
26763			pos = this.position;
26764		}
26765
26766		var mod = d === "absolute" ? 1 : -1,
26767			scrollIsRootNode = this._isRootNode( this.scrollParent[ 0 ] );
26768
26769		return {
26770			top: (
26771
26772				// The absolute mouse position
26773				pos.top	+
26774
26775				// Only for relative positioned nodes: Relative offset from element to offset parent
26776				this.offset.relative.top * mod +
26777
26778				// The offsetParent's offset without borders (offset + border)
26779				this.offset.parent.top * mod -
26780				( ( this.cssPosition === "fixed" ?
26781					-this.offset.scroll.top :
26782					( scrollIsRootNode ? 0 : this.offset.scroll.top ) ) * mod )
26783			),
26784			left: (
26785
26786				// The absolute mouse position
26787				pos.left +
26788
26789				// Only for relative positioned nodes: Relative offset from element to offset parent
26790				this.offset.relative.left * mod +
26791
26792				// The offsetParent's offset without borders (offset + border)
26793				this.offset.parent.left * mod	-
26794				( ( this.cssPosition === "fixed" ?
26795					-this.offset.scroll.left :
26796					( scrollIsRootNode ? 0 : this.offset.scroll.left ) ) * mod )
26797			)
26798		};
26799
26800	},
26801
26802	_generatePosition: function( event, constrainPosition ) {
26803
26804		var containment, co, top, left,
26805			o = this.options,
26806			scrollIsRootNode = this._isRootNode( this.scrollParent[ 0 ] ),
26807			pageX = event.pageX,
26808			pageY = event.pageY;
26809
26810		// Cache the scroll
26811		if ( !scrollIsRootNode || !this.offset.scroll ) {
26812			this.offset.scroll = {
26813				top: this.scrollParent.scrollTop(),
26814				left: this.scrollParent.scrollLeft()
26815			};
26816		}
26817
26818		/*
26819		 * - Position constraining -
26820		 * Constrain the position to a mix of grid, containment.
26821		 */
26822
26823		// If we are not dragging yet, we won't check for options
26824		if ( constrainPosition ) {
26825			if ( this.containment ) {
26826				if ( this.relativeContainer ) {
26827					co = this.relativeContainer.offset();
26828					containment = [
26829						this.containment[ 0 ] + co.left,
26830						this.containment[ 1 ] + co.top,
26831						this.containment[ 2 ] + co.left,
26832						this.containment[ 3 ] + co.top
26833					];
26834				} else {
26835					containment = this.containment;
26836				}
26837
26838				if ( event.pageX - this.offset.click.left < containment[ 0 ] ) {
26839					pageX = containment[ 0 ] + this.offset.click.left;
26840				}
26841				if ( event.pageY - this.offset.click.top < containment[ 1 ] ) {
26842					pageY = containment[ 1 ] + this.offset.click.top;
26843				}
26844				if ( event.pageX - this.offset.click.left > containment[ 2 ] ) {
26845					pageX = containment[ 2 ] + this.offset.click.left;
26846				}
26847				if ( event.pageY - this.offset.click.top > containment[ 3 ] ) {
26848					pageY = containment[ 3 ] + this.offset.click.top;
26849				}
26850			}
26851
26852			if ( o.grid ) {
26853
26854				//Check for grid elements set to 0 to prevent divide by 0 error causing invalid
26855				// argument errors in IE (see ticket #6950)
26856				top = o.grid[ 1 ] ? this.originalPageY + Math.round( ( pageY -
26857					this.originalPageY ) / o.grid[ 1 ] ) * o.grid[ 1 ] : this.originalPageY;
26858				pageY = containment ? ( ( top - this.offset.click.top >= containment[ 1 ] ||
26859					top - this.offset.click.top > containment[ 3 ] ) ?
26860						top :
26861						( ( top - this.offset.click.top >= containment[ 1 ] ) ?
26862							top - o.grid[ 1 ] : top + o.grid[ 1 ] ) ) : top;
26863
26864				left = o.grid[ 0 ] ? this.originalPageX +
26865					Math.round( ( pageX - this.originalPageX ) / o.grid[ 0 ] ) * o.grid[ 0 ] :
26866					this.originalPageX;
26867				pageX = containment ? ( ( left - this.offset.click.left >= containment[ 0 ] ||
26868					left - this.offset.click.left > containment[ 2 ] ) ?
26869						left :
26870						( ( left - this.offset.click.left >= containment[ 0 ] ) ?
26871							left - o.grid[ 0 ] : left + o.grid[ 0 ] ) ) : left;
26872			}
26873
26874			if ( o.axis === "y" ) {
26875				pageX = this.originalPageX;
26876			}
26877
26878			if ( o.axis === "x" ) {
26879				pageY = this.originalPageY;
26880			}
26881		}
26882
26883		return {
26884			top: (
26885
26886				// The absolute mouse position
26887				pageY -
26888
26889				// Click offset (relative to the element)
26890				this.offset.click.top -
26891
26892				// Only for relative positioned nodes: Relative offset from element to offset parent
26893				this.offset.relative.top -
26894
26895				// The offsetParent's offset without borders (offset + border)
26896				this.offset.parent.top +
26897				( this.cssPosition === "fixed" ?
26898					-this.offset.scroll.top :
26899					( scrollIsRootNode ? 0 : this.offset.scroll.top ) )
26900			),
26901			left: (
26902
26903				// The absolute mouse position
26904				pageX -
26905
26906				// Click offset (relative to the element)
26907				this.offset.click.left -
26908
26909				// Only for relative positioned nodes: Relative offset from element to offset parent
26910				this.offset.relative.left -
26911
26912				// The offsetParent's offset without borders (offset + border)
26913				this.offset.parent.left +
26914				( this.cssPosition === "fixed" ?
26915					-this.offset.scroll.left :
26916					( scrollIsRootNode ? 0 : this.offset.scroll.left ) )
26917			)
26918		};
26919
26920	},
26921
26922	_clear: function() {
26923		this._removeClass( this.helper, "ui-draggable-dragging" );
26924		if ( this.helper[ 0 ] !== this.element[ 0 ] && !this.cancelHelperRemoval ) {
26925			this.helper.remove();
26926		}
26927		this.helper = null;
26928		this.cancelHelperRemoval = false;
26929		if ( this.destroyOnClear ) {
26930			this.destroy();
26931		}
26932	},
26933
26934	// From now on bulk stuff - mainly helpers
26935
26936	_trigger: function( type, event, ui ) {
26937		ui = ui || this._uiHash();
26938		$.ui.plugin.call( this, type, [ event, ui, this ], true );
26939
26940		// Absolute position and offset (see #6884 ) have to be recalculated after plugins
26941		if ( /^(drag|start|stop)/.test( type ) ) {
26942			this.positionAbs = this._convertPositionTo( "absolute" );
26943			ui.offset = this.positionAbs;
26944		}
26945		return $.Widget.prototype._trigger.call( this, type, event, ui );
26946	},
26947
26948	plugins: {},
26949
26950	_uiHash: function() {
26951		return {
26952			helper: this.helper,
26953			position: this.position,
26954			originalPosition: this.originalPosition,
26955			offset: this.positionAbs
26956		};
26957	}
26958
26959} );
26960
26961$.ui.plugin.add( "draggable", "connectToSortable", {
26962	start: function( event, ui, draggable ) {
26963		var uiSortable = $.extend( {}, ui, {
26964			item: draggable.element
26965		} );
26966
26967		draggable.sortables = [];
26968		$( draggable.options.connectToSortable ).each( function() {
26969			var sortable = $( this ).sortable( "instance" );
26970
26971			if ( sortable && !sortable.options.disabled ) {
26972				draggable.sortables.push( sortable );
26973
26974				// RefreshPositions is called at drag start to refresh the containerCache
26975				// which is used in drag. This ensures it's initialized and synchronized
26976				// with any changes that might have happened on the page since initialization.
26977				sortable.refreshPositions();
26978				sortable._trigger( "activate", event, uiSortable );
26979			}
26980		} );
26981	},
26982	stop: function( event, ui, draggable ) {
26983		var uiSortable = $.extend( {}, ui, {
26984			item: draggable.element
26985		} );
26986
26987		draggable.cancelHelperRemoval = false;
26988
26989		$.each( draggable.sortables, function() {
26990			var sortable = this;
26991
26992			if ( sortable.isOver ) {
26993				sortable.isOver = 0;
26994
26995				// Allow this sortable to handle removing the helper
26996				draggable.cancelHelperRemoval = true;
26997				sortable.cancelHelperRemoval = false;
26998
26999				// Use _storedCSS To restore properties in the sortable,
27000				// as this also handles revert (#9675) since the draggable
27001				// may have modified them in unexpected ways (#8809)
27002				sortable._storedCSS = {
27003					position: sortable.placeholder.css( "position" ),
27004					top: sortable.placeholder.css( "top" ),
27005					left: sortable.placeholder.css( "left" )
27006				};
27007
27008				sortable._mouseStop( event );
27009
27010				// Once drag has ended, the sortable should return to using
27011				// its original helper, not the shared helper from draggable
27012				sortable.options.helper = sortable.options._helper;
27013			} else {
27014
27015				// Prevent this Sortable from removing the helper.
27016				// However, don't set the draggable to remove the helper
27017				// either as another connected Sortable may yet handle the removal.
27018				sortable.cancelHelperRemoval = true;
27019
27020				sortable._trigger( "deactivate", event, uiSortable );
27021			}
27022		} );
27023	},
27024	drag: function( event, ui, draggable ) {
27025		$.each( draggable.sortables, function() {
27026			var innermostIntersecting = false,
27027				sortable = this;
27028
27029			// Copy over variables that sortable's _intersectsWith uses
27030			sortable.positionAbs = draggable.positionAbs;
27031			sortable.helperProportions = draggable.helperProportions;
27032			sortable.offset.click = draggable.offset.click;
27033
27034			if ( sortable._intersectsWith( sortable.containerCache ) ) {
27035				innermostIntersecting = true;
27036
27037				$.each( draggable.sortables, function() {
27038
27039					// Copy over variables that sortable's _intersectsWith uses
27040					this.positionAbs = draggable.positionAbs;
27041					this.helperProportions = draggable.helperProportions;
27042					this.offset.click = draggable.offset.click;
27043
27044					if ( this !== sortable &&
27045							this._intersectsWith( this.containerCache ) &&
27046							$.contains( sortable.element[ 0 ], this.element[ 0 ] ) ) {
27047						innermostIntersecting = false;
27048					}
27049
27050					return innermostIntersecting;
27051				} );
27052			}
27053
27054			if ( innermostIntersecting ) {
27055
27056				// If it intersects, we use a little isOver variable and set it once,
27057				// so that the move-in stuff gets fired only once.
27058				if ( !sortable.isOver ) {
27059					sortable.isOver = 1;
27060
27061					// Store draggable's parent in case we need to reappend to it later.
27062					draggable._parent = ui.helper.parent();
27063
27064					sortable.currentItem = ui.helper
27065						.appendTo( sortable.element )
27066						.data( "ui-sortable-item", true );
27067
27068					// Store helper option to later restore it
27069					sortable.options._helper = sortable.options.helper;
27070
27071					sortable.options.helper = function() {
27072						return ui.helper[ 0 ];
27073					};
27074
27075					// Fire the start events of the sortable with our passed browser event,
27076					// and our own helper (so it doesn't create a new one)
27077					event.target = sortable.currentItem[ 0 ];
27078					sortable._mouseCapture( event, true );
27079					sortable._mouseStart( event, true, true );
27080
27081					// Because the browser event is way off the new appended portlet,
27082					// modify necessary variables to reflect the changes
27083					sortable.offset.click.top = draggable.offset.click.top;
27084					sortable.offset.click.left = draggable.offset.click.left;
27085					sortable.offset.parent.left -= draggable.offset.parent.left -
27086						sortable.offset.parent.left;
27087					sortable.offset.parent.top -= draggable.offset.parent.top -
27088						sortable.offset.parent.top;
27089
27090					draggable._trigger( "toSortable", event );
27091
27092					// Inform draggable that the helper is in a valid drop zone,
27093					// used solely in the revert option to handle "valid/invalid".
27094					draggable.dropped = sortable.element;
27095
27096					// Need to refreshPositions of all sortables in the case that
27097					// adding to one sortable changes the location of the other sortables (#9675)
27098					$.each( draggable.sortables, function() {
27099						this.refreshPositions();
27100					} );
27101
27102					// Hack so receive/update callbacks work (mostly)
27103					draggable.currentItem = draggable.element;
27104					sortable.fromOutside = draggable;
27105				}
27106
27107				if ( sortable.currentItem ) {
27108					sortable._mouseDrag( event );
27109
27110					// Copy the sortable's position because the draggable's can potentially reflect
27111					// a relative position, while sortable is always absolute, which the dragged
27112					// element has now become. (#8809)
27113					ui.position = sortable.position;
27114				}
27115			} else {
27116
27117				// If it doesn't intersect with the sortable, and it intersected before,
27118				// we fake the drag stop of the sortable, but make sure it doesn't remove
27119				// the helper by using cancelHelperRemoval.
27120				if ( sortable.isOver ) {
27121
27122					sortable.isOver = 0;
27123					sortable.cancelHelperRemoval = true;
27124
27125					// Calling sortable's mouseStop would trigger a revert,
27126					// so revert must be temporarily false until after mouseStop is called.
27127					sortable.options._revert = sortable.options.revert;
27128					sortable.options.revert = false;
27129
27130					sortable._trigger( "out", event, sortable._uiHash( sortable ) );
27131					sortable._mouseStop( event, true );
27132
27133					// Restore sortable behaviors that were modfied
27134					// when the draggable entered the sortable area (#9481)
27135					sortable.options.revert = sortable.options._revert;
27136					sortable.options.helper = sortable.options._helper;
27137
27138					if ( sortable.placeholder ) {
27139						sortable.placeholder.remove();
27140					}
27141
27142					// Restore and recalculate the draggable's offset considering the sortable
27143					// may have modified them in unexpected ways. (#8809, #10669)
27144					ui.helper.appendTo( draggable._parent );
27145					draggable._refreshOffsets( event );
27146					ui.position = draggable._generatePosition( event, true );
27147
27148					draggable._trigger( "fromSortable", event );
27149
27150					// Inform draggable that the helper is no longer in a valid drop zone
27151					draggable.dropped = false;
27152
27153					// Need to refreshPositions of all sortables just in case removing
27154					// from one sortable changes the location of other sortables (#9675)
27155					$.each( draggable.sortables, function() {
27156						this.refreshPositions();
27157					} );
27158				}
27159			}
27160		} );
27161	}
27162} );
27163
27164$.ui.plugin.add( "draggable", "cursor", {
27165	start: function( event, ui, instance ) {
27166		var t = $( "body" ),
27167			o = instance.options;
27168
27169		if ( t.css( "cursor" ) ) {
27170			o._cursor = t.css( "cursor" );
27171		}
27172		t.css( "cursor", o.cursor );
27173	},
27174	stop: function( event, ui, instance ) {
27175		var o = instance.options;
27176		if ( o._cursor ) {
27177			$( "body" ).css( "cursor", o._cursor );
27178		}
27179	}
27180} );
27181
27182$.ui.plugin.add( "draggable", "opacity", {
27183	start: function( event, ui, instance ) {
27184		var t = $( ui.helper ),
27185			o = instance.options;
27186		if ( t.css( "opacity" ) ) {
27187			o._opacity = t.css( "opacity" );
27188		}
27189		t.css( "opacity", o.opacity );
27190	},
27191	stop: function( event, ui, instance ) {
27192		var o = instance.options;
27193		if ( o._opacity ) {
27194			$( ui.helper ).css( "opacity", o._opacity );
27195		}
27196	}
27197} );
27198
27199$.ui.plugin.add( "draggable", "scroll", {
27200	start: function( event, ui, i ) {
27201		if ( !i.scrollParentNotHidden ) {
27202			i.scrollParentNotHidden = i.helper.scrollParent( false );
27203		}
27204
27205		if ( i.scrollParentNotHidden[ 0 ] !== i.document[ 0 ] &&
27206				i.scrollParentNotHidden[ 0 ].tagName !== "HTML" ) {
27207			i.overflowOffset = i.scrollParentNotHidden.offset();
27208		}
27209	},
27210	drag: function( event, ui, i  ) {
27211
27212		var o = i.options,
27213			scrolled = false,
27214			scrollParent = i.scrollParentNotHidden[ 0 ],
27215			document = i.document[ 0 ];
27216
27217		if ( scrollParent !== document && scrollParent.tagName !== "HTML" ) {
27218			if ( !o.axis || o.axis !== "x" ) {
27219				if ( ( i.overflowOffset.top + scrollParent.offsetHeight ) - event.pageY <
27220						o.scrollSensitivity ) {
27221					scrollParent.scrollTop = scrolled = scrollParent.scrollTop + o.scrollSpeed;
27222				} else if ( event.pageY - i.overflowOffset.top < o.scrollSensitivity ) {
27223					scrollParent.scrollTop = scrolled = scrollParent.scrollTop - o.scrollSpeed;
27224				}
27225			}
27226
27227			if ( !o.axis || o.axis !== "y" ) {
27228				if ( ( i.overflowOffset.left + scrollParent.offsetWidth ) - event.pageX <
27229						o.scrollSensitivity ) {
27230					scrollParent.scrollLeft = scrolled = scrollParent.scrollLeft + o.scrollSpeed;
27231				} else if ( event.pageX - i.overflowOffset.left < o.scrollSensitivity ) {
27232					scrollParent.scrollLeft = scrolled = scrollParent.scrollLeft - o.scrollSpeed;
27233				}
27234			}
27235
27236		} else {
27237
27238			if ( !o.axis || o.axis !== "x" ) {
27239				if ( event.pageY - $( document ).scrollTop() < o.scrollSensitivity ) {
27240					scrolled = $( document ).scrollTop( $( document ).scrollTop() - o.scrollSpeed );
27241				} else if ( $( window ).height() - ( event.pageY - $( document ).scrollTop() ) <
27242						o.scrollSensitivity ) {
27243					scrolled = $( document ).scrollTop( $( document ).scrollTop() + o.scrollSpeed );
27244				}
27245			}
27246
27247			if ( !o.axis || o.axis !== "y" ) {
27248				if ( event.pageX - $( document ).scrollLeft() < o.scrollSensitivity ) {
27249					scrolled = $( document ).scrollLeft(
27250						$( document ).scrollLeft() - o.scrollSpeed
27251					);
27252				} else if ( $( window ).width() - ( event.pageX - $( document ).scrollLeft() ) <
27253						o.scrollSensitivity ) {
27254					scrolled = $( document ).scrollLeft(
27255						$( document ).scrollLeft() + o.scrollSpeed
27256					);
27257				}
27258			}
27259
27260		}
27261
27262		if ( scrolled !== false && $.ui.ddmanager && !o.dropBehaviour ) {
27263			$.ui.ddmanager.prepareOffsets( i, event );
27264		}
27265
27266	}
27267} );
27268
27269$.ui.plugin.add( "draggable", "snap", {
27270	start: function( event, ui, i ) {
27271
27272		var o = i.options;
27273
27274		i.snapElements = [];
27275
27276		$( o.snap.constructor !== String ? ( o.snap.items || ":data(ui-draggable)" ) : o.snap )
27277			.each( function() {
27278				var $t = $( this ),
27279					$o = $t.offset();
27280				if ( this !== i.element[ 0 ] ) {
27281					i.snapElements.push( {
27282						item: this,
27283						width: $t.outerWidth(), height: $t.outerHeight(),
27284						top: $o.top, left: $o.left
27285					} );
27286				}
27287			} );
27288
27289	},
27290	drag: function( event, ui, inst ) {
27291
27292		var ts, bs, ls, rs, l, r, t, b, i, first,
27293			o = inst.options,
27294			d = o.snapTolerance,
27295			x1 = ui.offset.left, x2 = x1 + inst.helperProportions.width,
27296			y1 = ui.offset.top, y2 = y1 + inst.helperProportions.height;
27297
27298		for ( i = inst.snapElements.length - 1; i >= 0; i-- ) {
27299
27300			l = inst.snapElements[ i ].left - inst.margins.left;
27301			r = l + inst.snapElements[ i ].width;
27302			t = inst.snapElements[ i ].top - inst.margins.top;
27303			b = t + inst.snapElements[ i ].height;
27304
27305			if ( x2 < l - d || x1 > r + d || y2 < t - d || y1 > b + d ||
27306					!$.contains( inst.snapElements[ i ].item.ownerDocument,
27307					inst.snapElements[ i ].item ) ) {
27308				if ( inst.snapElements[ i ].snapping ) {
27309					( inst.options.snap.release &&
27310						inst.options.snap.release.call(
27311							inst.element,
27312							event,
27313							$.extend( inst._uiHash(), { snapItem: inst.snapElements[ i ].item } )
27314						) );
27315				}
27316				inst.snapElements[ i ].snapping = false;
27317				continue;
27318			}
27319
27320			if ( o.snapMode !== "inner" ) {
27321				ts = Math.abs( t - y2 ) <= d;
27322				bs = Math.abs( b - y1 ) <= d;
27323				ls = Math.abs( l - x2 ) <= d;
27324				rs = Math.abs( r - x1 ) <= d;
27325				if ( ts ) {
27326					ui.position.top = inst._convertPositionTo( "relative", {
27327						top: t - inst.helperProportions.height,
27328						left: 0
27329					} ).top;
27330				}
27331				if ( bs ) {
27332					ui.position.top = inst._convertPositionTo( "relative", {
27333						top: b,
27334						left: 0
27335					} ).top;
27336				}
27337				if ( ls ) {
27338					ui.position.left = inst._convertPositionTo( "relative", {
27339						top: 0,
27340						left: l - inst.helperProportions.width
27341					} ).left;
27342				}
27343				if ( rs ) {
27344					ui.position.left = inst._convertPositionTo( "relative", {
27345						top: 0,
27346						left: r
27347					} ).left;
27348				}
27349			}
27350
27351			first = ( ts || bs || ls || rs );
27352
27353			if ( o.snapMode !== "outer" ) {
27354				ts = Math.abs( t - y1 ) <= d;
27355				bs = Math.abs( b - y2 ) <= d;
27356				ls = Math.abs( l - x1 ) <= d;
27357				rs = Math.abs( r - x2 ) <= d;
27358				if ( ts ) {
27359					ui.position.top = inst._convertPositionTo( "relative", {
27360						top: t,
27361						left: 0
27362					} ).top;
27363				}
27364				if ( bs ) {
27365					ui.position.top = inst._convertPositionTo( "relative", {
27366						top: b - inst.helperProportions.height,
27367						left: 0
27368					} ).top;
27369				}
27370				if ( ls ) {
27371					ui.position.left = inst._convertPositionTo( "relative", {
27372						top: 0,
27373						left: l
27374					} ).left;
27375				}
27376				if ( rs ) {
27377					ui.position.left = inst._convertPositionTo( "relative", {
27378						top: 0,
27379						left: r - inst.helperProportions.width
27380					} ).left;
27381				}
27382			}
27383
27384			if ( !inst.snapElements[ i ].snapping && ( ts || bs || ls || rs || first ) ) {
27385				( inst.options.snap.snap &&
27386					inst.options.snap.snap.call(
27387						inst.element,
27388						event,
27389						$.extend( inst._uiHash(), {
27390							snapItem: inst.snapElements[ i ].item
27391						} ) ) );
27392			}
27393			inst.snapElements[ i ].snapping = ( ts || bs || ls || rs || first );
27394
27395		}
27396
27397	}
27398} );
27399
27400$.ui.plugin.add( "draggable", "stack", {
27401	start: function( event, ui, instance ) {
27402		var min,
27403			o = instance.options,
27404			group = $.makeArray( $( o.stack ) ).sort( function( a, b ) {
27405				return ( parseInt( $( a ).css( "zIndex" ), 10 ) || 0 ) -
27406					( parseInt( $( b ).css( "zIndex" ), 10 ) || 0 );
27407			} );
27408
27409		if ( !group.length ) { return; }
27410
27411		min = parseInt( $( group[ 0 ] ).css( "zIndex" ), 10 ) || 0;
27412		$( group ).each( function( i ) {
27413			$( this ).css( "zIndex", min + i );
27414		} );
27415		this.css( "zIndex", ( min + group.length ) );
27416	}
27417} );
27418
27419$.ui.plugin.add( "draggable", "zIndex", {
27420	start: function( event, ui, instance ) {
27421		var t = $( ui.helper ),
27422			o = instance.options;
27423
27424		if ( t.css( "zIndex" ) ) {
27425			o._zIndex = t.css( "zIndex" );
27426		}
27427		t.css( "zIndex", o.zIndex );
27428	},
27429	stop: function( event, ui, instance ) {
27430		var o = instance.options;
27431
27432		if ( o._zIndex ) {
27433			$( ui.helper ).css( "zIndex", o._zIndex );
27434		}
27435	}
27436} );
27437
27438var widgetsDraggable = $.ui.draggable;
27439
27440
27441/*!
27442 * jQuery UI Resizable 1.12.1
27443 * http://jqueryui.com
27444 *
27445 * Copyright jQuery Foundation and other contributors
27446 * Released under the MIT license.
27447 * http://jquery.org/license
27448 */
27449
27450//>>label: Resizable
27451//>>group: Interactions
27452//>>description: Enables resize functionality for any element.
27453//>>docs: http://api.jqueryui.com/resizable/
27454//>>demos: http://jqueryui.com/resizable/
27455//>>css.structure: ../../themes/base/core.css
27456//>>css.structure: ../../themes/base/resizable.css
27457//>>css.theme: ../../themes/base/theme.css
27458
27459
27460
27461$.widget( "ui.resizable", $.ui.mouse, {
27462	version: "1.12.1",
27463	widgetEventPrefix: "resize",
27464	options: {
27465		alsoResize: false,
27466		animate: false,
27467		animateDuration: "slow",
27468		animateEasing: "swing",
27469		aspectRatio: false,
27470		autoHide: false,
27471		classes: {
27472			"ui-resizable-se": "ui-icon ui-icon-gripsmall-diagonal-se"
27473		},
27474		containment: false,
27475		ghost: false,
27476		grid: false,
27477		handles: "e,s,se",
27478		helper: false,
27479		maxHeight: null,
27480		maxWidth: null,
27481		minHeight: 10,
27482		minWidth: 10,
27483
27484		// See #7960
27485		zIndex: 90,
27486
27487		// Callbacks
27488		resize: null,
27489		start: null,
27490		stop: null
27491	},
27492
27493	_num: function( value ) {
27494		return parseFloat( value ) || 0;
27495	},
27496
27497	_isNumber: function( value ) {
27498		return !isNaN( parseFloat( value ) );
27499	},
27500
27501	_hasScroll: function( el, a ) {
27502
27503		if ( $( el ).css( "overflow" ) === "hidden" ) {
27504			return false;
27505		}
27506
27507		var scroll = ( a && a === "left" ) ? "scrollLeft" : "scrollTop",
27508			has = false;
27509
27510		if ( el[ scroll ] > 0 ) {
27511			return true;
27512		}
27513
27514		// TODO: determine which cases actually cause this to happen
27515		// if the element doesn't have the scroll set, see if it's possible to
27516		// set the scroll
27517		el[ scroll ] = 1;
27518		has = ( el[ scroll ] > 0 );
27519		el[ scroll ] = 0;
27520		return has;
27521	},
27522
27523	_create: function() {
27524
27525		var margins,
27526			o = this.options,
27527			that = this;
27528		this._addClass( "ui-resizable" );
27529
27530		$.extend( this, {
27531			_aspectRatio: !!( o.aspectRatio ),
27532			aspectRatio: o.aspectRatio,
27533			originalElement: this.element,
27534			_proportionallyResizeElements: [],
27535			_helper: o.helper || o.ghost || o.animate ? o.helper || "ui-resizable-helper" : null
27536		} );
27537
27538		// Wrap the element if it cannot hold child nodes
27539		if ( this.element[ 0 ].nodeName.match( /^(canvas|textarea|input|select|button|img)$/i ) ) {
27540
27541			this.element.wrap(
27542				$( "<div class='ui-wrapper' style='overflow: hidden;'></div>" ).css( {
27543					position: this.element.css( "position" ),
27544					width: this.element.outerWidth(),
27545					height: this.element.outerHeight(),
27546					top: this.element.css( "top" ),
27547					left: this.element.css( "left" )
27548				} )
27549			);
27550
27551			this.element = this.element.parent().data(
27552				"ui-resizable", this.element.resizable( "instance" )
27553			);
27554
27555			this.elementIsWrapper = true;
27556
27557			margins = {
27558				marginTop: this.originalElement.css( "marginTop" ),
27559				marginRight: this.originalElement.css( "marginRight" ),
27560				marginBottom: this.originalElement.css( "marginBottom" ),
27561				marginLeft: this.originalElement.css( "marginLeft" )
27562			};
27563
27564			this.element.css( margins );
27565			this.originalElement.css( "margin", 0 );
27566
27567			// support: Safari
27568			// Prevent Safari textarea resize
27569			this.originalResizeStyle = this.originalElement.css( "resize" );
27570			this.originalElement.css( "resize", "none" );
27571
27572			this._proportionallyResizeElements.push( this.originalElement.css( {
27573				position: "static",
27574				zoom: 1,
27575				display: "block"
27576			} ) );
27577
27578			// Support: IE9
27579			// avoid IE jump (hard set the margin)
27580			this.originalElement.css( margins );
27581
27582			this._proportionallyResize();
27583		}
27584
27585		this._setupHandles();
27586
27587		if ( o.autoHide ) {
27588			$( this.element )
27589				.on( "mouseenter", function() {
27590					if ( o.disabled ) {
27591						return;
27592					}
27593					that._removeClass( "ui-resizable-autohide" );
27594					that._handles.show();
27595				} )
27596				.on( "mouseleave", function() {
27597					if ( o.disabled ) {
27598						return;
27599					}
27600					if ( !that.resizing ) {
27601						that._addClass( "ui-resizable-autohide" );
27602						that._handles.hide();
27603					}
27604				} );
27605		}
27606
27607		this._mouseInit();
27608	},
27609
27610	_destroy: function() {
27611
27612		this._mouseDestroy();
27613
27614		var wrapper,
27615			_destroy = function( exp ) {
27616				$( exp )
27617					.removeData( "resizable" )
27618					.removeData( "ui-resizable" )
27619					.off( ".resizable" )
27620					.find( ".ui-resizable-handle" )
27621						.remove();
27622			};
27623
27624		// TODO: Unwrap at same DOM position
27625		if ( this.elementIsWrapper ) {
27626			_destroy( this.element );
27627			wrapper = this.element;
27628			this.originalElement.css( {
27629				position: wrapper.css( "position" ),
27630				width: wrapper.outerWidth(),
27631				height: wrapper.outerHeight(),
27632				top: wrapper.css( "top" ),
27633				left: wrapper.css( "left" )
27634			} ).insertAfter( wrapper );
27635			wrapper.remove();
27636		}
27637
27638		this.originalElement.css( "resize", this.originalResizeStyle );
27639		_destroy( this.originalElement );
27640
27641		return this;
27642	},
27643
27644	_setOption: function( key, value ) {
27645		this._super( key, value );
27646
27647		switch ( key ) {
27648		case "handles":
27649			this._removeHandles();
27650			this._setupHandles();
27651			break;
27652		default:
27653			break;
27654		}
27655	},
27656
27657	_setupHandles: function() {
27658		var o = this.options, handle, i, n, hname, axis, that = this;
27659		this.handles = o.handles ||
27660			( !$( ".ui-resizable-handle", this.element ).length ?
27661				"e,s,se" : {
27662					n: ".ui-resizable-n",
27663					e: ".ui-resizable-e",
27664					s: ".ui-resizable-s",
27665					w: ".ui-resizable-w",
27666					se: ".ui-resizable-se",
27667					sw: ".ui-resizable-sw",
27668					ne: ".ui-resizable-ne",
27669					nw: ".ui-resizable-nw"
27670				} );
27671
27672		this._handles = $();
27673		if ( this.handles.constructor === String ) {
27674
27675			if ( this.handles === "all" ) {
27676				this.handles = "n,e,s,w,se,sw,ne,nw";
27677			}
27678
27679			n = this.handles.split( "," );
27680			this.handles = {};
27681
27682			for ( i = 0; i < n.length; i++ ) {
27683
27684				handle = $.trim( n[ i ] );
27685				hname = "ui-resizable-" + handle;
27686				axis = $( "<div>" );
27687				this._addClass( axis, "ui-resizable-handle " + hname );
27688
27689				axis.css( { zIndex: o.zIndex } );
27690
27691				this.handles[ handle ] = ".ui-resizable-" + handle;
27692				this.element.append( axis );
27693			}
27694
27695		}
27696
27697		this._renderAxis = function( target ) {
27698
27699			var i, axis, padPos, padWrapper;
27700
27701			target = target || this.element;
27702
27703			for ( i in this.handles ) {
27704
27705				if ( this.handles[ i ].constructor === String ) {
27706					this.handles[ i ] = this.element.children( this.handles[ i ] ).first().show();
27707				} else if ( this.handles[ i ].jquery || this.handles[ i ].nodeType ) {
27708					this.handles[ i ] = $( this.handles[ i ] );
27709					this._on( this.handles[ i ], { "mousedown": that._mouseDown } );
27710				}
27711
27712				if ( this.elementIsWrapper &&
27713						this.originalElement[ 0 ]
27714							.nodeName
27715							.match( /^(textarea|input|select|button)$/i ) ) {
27716					axis = $( this.handles[ i ], this.element );
27717
27718					padWrapper = /sw|ne|nw|se|n|s/.test( i ) ?
27719						axis.outerHeight() :
27720						axis.outerWidth();
27721
27722					padPos = [ "padding",
27723						/ne|nw|n/.test( i ) ? "Top" :
27724						/se|sw|s/.test( i ) ? "Bottom" :
27725						/^e$/.test( i ) ? "Right" : "Left" ].join( "" );
27726
27727					target.css( padPos, padWrapper );
27728
27729					this._proportionallyResize();
27730				}
27731
27732				this._handles = this._handles.add( this.handles[ i ] );
27733			}
27734		};
27735
27736		// TODO: make renderAxis a prototype function
27737		this._renderAxis( this.element );
27738
27739		this._handles = this._handles.add( this.element.find( ".ui-resizable-handle" ) );
27740		this._handles.disableSelection();
27741
27742		this._handles.on( "mouseover", function() {
27743			if ( !that.resizing ) {
27744				if ( this.className ) {
27745					axis = this.className.match( /ui-resizable-(se|sw|ne|nw|n|e|s|w)/i );
27746				}
27747				that.axis = axis && axis[ 1 ] ? axis[ 1 ] : "se";
27748			}
27749		} );
27750
27751		if ( o.autoHide ) {
27752			this._handles.hide();
27753			this._addClass( "ui-resizable-autohide" );
27754		}
27755	},
27756
27757	_removeHandles: function() {
27758		this._handles.remove();
27759	},
27760
27761	_mouseCapture: function( event ) {
27762		var i, handle,
27763			capture = false;
27764
27765		for ( i in this.handles ) {
27766			handle = $( this.handles[ i ] )[ 0 ];
27767			if ( handle === event.target || $.contains( handle, event.target ) ) {
27768				capture = true;
27769			}
27770		}
27771
27772		return !this.options.disabled && capture;
27773	},
27774
27775	_mouseStart: function( event ) {
27776
27777		var curleft, curtop, cursor,
27778			o = this.options,
27779			el = this.element;
27780
27781		this.resizing = true;
27782
27783		this._renderProxy();
27784
27785		curleft = this._num( this.helper.css( "left" ) );
27786		curtop = this._num( this.helper.css( "top" ) );
27787
27788		if ( o.containment ) {
27789			curleft += $( o.containment ).scrollLeft() || 0;
27790			curtop += $( o.containment ).scrollTop() || 0;
27791		}
27792
27793		this.offset = this.helper.offset();
27794		this.position = { left: curleft, top: curtop };
27795
27796		this.size = this._helper ? {
27797				width: this.helper.width(),
27798				height: this.helper.height()
27799			} : {
27800				width: el.width(),
27801				height: el.height()
27802			};
27803
27804		this.originalSize = this._helper ? {
27805				width: el.outerWidth(),
27806				height: el.outerHeight()
27807			} : {
27808				width: el.width(),
27809				height: el.height()
27810			};
27811
27812		this.sizeDiff = {
27813			width: el.outerWidth() - el.width(),
27814			height: el.outerHeight() - el.height()
27815		};
27816
27817		this.originalPosition = { left: curleft, top: curtop };
27818		this.originalMousePosition = { left: event.pageX, top: event.pageY };
27819
27820		this.aspectRatio = ( typeof o.aspectRatio === "number" ) ?
27821			o.aspectRatio :
27822			( ( this.originalSize.width / this.originalSize.height ) || 1 );
27823
27824		cursor = $( ".ui-resizable-" + this.axis ).css( "cursor" );
27825		$( "body" ).css( "cursor", cursor === "auto" ? this.axis + "-resize" : cursor );
27826
27827		this._addClass( "ui-resizable-resizing" );
27828		this._propagate( "start", event );
27829		return true;
27830	},
27831
27832	_mouseDrag: function( event ) {
27833
27834		var data, props,
27835			smp = this.originalMousePosition,
27836			a = this.axis,
27837			dx = ( event.pageX - smp.left ) || 0,
27838			dy = ( event.pageY - smp.top ) || 0,
27839			trigger = this._change[ a ];
27840
27841		this._updatePrevProperties();
27842
27843		if ( !trigger ) {
27844			return false;
27845		}
27846
27847		data = trigger.apply( this, [ event, dx, dy ] );
27848
27849		this._updateVirtualBoundaries( event.shiftKey );
27850		if ( this._aspectRatio || event.shiftKey ) {
27851			data = this._updateRatio( data, event );
27852		}
27853
27854		data = this._respectSize( data, event );
27855
27856		this._updateCache( data );
27857
27858		this._propagate( "resize", event );
27859
27860		props = this._applyChanges();
27861
27862		if ( !this._helper && this._proportionallyResizeElements.length ) {
27863			this._proportionallyResize();
27864		}
27865
27866		if ( !$.isEmptyObject( props ) ) {
27867			this._updatePrevProperties();
27868			this._trigger( "resize", event, this.ui() );
27869			this._applyChanges();
27870		}
27871
27872		return false;
27873	},
27874
27875	_mouseStop: function( event ) {
27876
27877		this.resizing = false;
27878		var pr, ista, soffseth, soffsetw, s, left, top,
27879			o = this.options, that = this;
27880
27881		if ( this._helper ) {
27882
27883			pr = this._proportionallyResizeElements;
27884			ista = pr.length && ( /textarea/i ).test( pr[ 0 ].nodeName );
27885			soffseth = ista && this._hasScroll( pr[ 0 ], "left" ) ? 0 : that.sizeDiff.height;
27886			soffsetw = ista ? 0 : that.sizeDiff.width;
27887
27888			s = {
27889				width: ( that.helper.width()  - soffsetw ),
27890				height: ( that.helper.height() - soffseth )
27891			};
27892			left = ( parseFloat( that.element.css( "left" ) ) +
27893				( that.position.left - that.originalPosition.left ) ) || null;
27894			top = ( parseFloat( that.element.css( "top" ) ) +
27895				( that.position.top - that.originalPosition.top ) ) || null;
27896
27897			if ( !o.animate ) {
27898				this.element.css( $.extend( s, { top: top, left: left } ) );
27899			}
27900
27901			that.helper.height( that.size.height );
27902			that.helper.width( that.size.width );
27903
27904			if ( this._helper && !o.animate ) {
27905				this._proportionallyResize();
27906			}
27907		}
27908
27909		$( "body" ).css( "cursor", "auto" );
27910
27911		this._removeClass( "ui-resizable-resizing" );
27912
27913		this._propagate( "stop", event );
27914
27915		if ( this._helper ) {
27916			this.helper.remove();
27917		}
27918
27919		return false;
27920
27921	},
27922
27923	_updatePrevProperties: function() {
27924		this.prevPosition = {
27925			top: this.position.top,
27926			left: this.position.left
27927		};
27928		this.prevSize = {
27929			width: this.size.width,
27930			height: this.size.height
27931		};
27932	},
27933
27934	_applyChanges: function() {
27935		var props = {};
27936
27937		if ( this.position.top !== this.prevPosition.top ) {
27938			props.top = this.position.top + "px";
27939		}
27940		if ( this.position.left !== this.prevPosition.left ) {
27941			props.left = this.position.left + "px";
27942		}
27943		if ( this.size.width !== this.prevSize.width ) {
27944			props.width = this.size.width + "px";
27945		}
27946		if ( this.size.height !== this.prevSize.height ) {
27947			props.height = this.size.height + "px";
27948		}
27949
27950		this.helper.css( props );
27951
27952		return props;
27953	},
27954
27955	_updateVirtualBoundaries: function( forceAspectRatio ) {
27956		var pMinWidth, pMaxWidth, pMinHeight, pMaxHeight, b,
27957			o = this.options;
27958
27959		b = {
27960			minWidth: this._isNumber( o.minWidth ) ? o.minWidth : 0,
27961			maxWidth: this._isNumber( o.maxWidth ) ? o.maxWidth : Infinity,
27962			minHeight: this._isNumber( o.minHeight ) ? o.minHeight : 0,
27963			maxHeight: this._isNumber( o.maxHeight ) ? o.maxHeight : Infinity
27964		};
27965
27966		if ( this._aspectRatio || forceAspectRatio ) {
27967			pMinWidth = b.minHeight * this.aspectRatio;
27968			pMinHeight = b.minWidth / this.aspectRatio;
27969			pMaxWidth = b.maxHeight * this.aspectRatio;
27970			pMaxHeight = b.maxWidth / this.aspectRatio;
27971
27972			if ( pMinWidth > b.minWidth ) {
27973				b.minWidth = pMinWidth;
27974			}
27975			if ( pMinHeight > b.minHeight ) {
27976				b.minHeight = pMinHeight;
27977			}
27978			if ( pMaxWidth < b.maxWidth ) {
27979				b.maxWidth = pMaxWidth;
27980			}
27981			if ( pMaxHeight < b.maxHeight ) {
27982				b.maxHeight = pMaxHeight;
27983			}
27984		}
27985		this._vBoundaries = b;
27986	},
27987
27988	_updateCache: function( data ) {
27989		this.offset = this.helper.offset();
27990		if ( this._isNumber( data.left ) ) {
27991			this.position.left = data.left;
27992		}
27993		if ( this._isNumber( data.top ) ) {
27994			this.position.top = data.top;
27995		}
27996		if ( this._isNumber( data.height ) ) {
27997			this.size.height = data.height;
27998		}
27999		if ( this._isNumber( data.width ) ) {
28000			this.size.width = data.width;
28001		}
28002	},
28003
28004	_updateRatio: function( data ) {
28005
28006		var cpos = this.position,
28007			csize = this.size,
28008			a = this.axis;
28009
28010		if ( this._isNumber( data.height ) ) {
28011			data.width = ( data.height * this.aspectRatio );
28012		} else if ( this._isNumber( data.width ) ) {
28013			data.height = ( data.width / this.aspectRatio );
28014		}
28015
28016		if ( a === "sw" ) {
28017			data.left = cpos.left + ( csize.width - data.width );
28018			data.top = null;
28019		}
28020		if ( a === "nw" ) {
28021			data.top = cpos.top + ( csize.height - data.height );
28022			data.left = cpos.left + ( csize.width - data.width );
28023		}
28024
28025		return data;
28026	},
28027
28028	_respectSize: function( data ) {
28029
28030		var o = this._vBoundaries,
28031			a = this.axis,
28032			ismaxw = this._isNumber( data.width ) && o.maxWidth && ( o.maxWidth < data.width ),
28033			ismaxh = this._isNumber( data.height ) && o.maxHeight && ( o.maxHeight < data.height ),
28034			isminw = this._isNumber( data.width ) && o.minWidth && ( o.minWidth > data.width ),
28035			isminh = this._isNumber( data.height ) && o.minHeight && ( o.minHeight > data.height ),
28036			dw = this.originalPosition.left + this.originalSize.width,
28037			dh = this.originalPosition.top + this.originalSize.height,
28038			cw = /sw|nw|w/.test( a ), ch = /nw|ne|n/.test( a );
28039		if ( isminw ) {
28040			data.width = o.minWidth;
28041		}
28042		if ( isminh ) {
28043			data.height = o.minHeight;
28044		}
28045		if ( ismaxw ) {
28046			data.width = o.maxWidth;
28047		}
28048		if ( ismaxh ) {
28049			data.height = o.maxHeight;
28050		}
28051
28052		if ( isminw && cw ) {
28053			data.left = dw - o.minWidth;
28054		}
28055		if ( ismaxw && cw ) {
28056			data.left = dw - o.maxWidth;
28057		}
28058		if ( isminh && ch ) {
28059			data.top = dh - o.minHeight;
28060		}
28061		if ( ismaxh && ch ) {
28062			data.top = dh - o.maxHeight;
28063		}
28064
28065		// Fixing jump error on top/left - bug #2330
28066		if ( !data.width && !data.height && !data.left && data.top ) {
28067			data.top = null;
28068		} else if ( !data.width && !data.height && !data.top && data.left ) {
28069			data.left = null;
28070		}
28071
28072		return data;
28073	},
28074
28075	_getPaddingPlusBorderDimensions: function( element ) {
28076		var i = 0,
28077			widths = [],
28078			borders = [
28079				element.css( "borderTopWidth" ),
28080				element.css( "borderRightWidth" ),
28081				element.css( "borderBottomWidth" ),
28082				element.css( "borderLeftWidth" )
28083			],
28084			paddings = [
28085				element.css( "paddingTop" ),
28086				element.css( "paddingRight" ),
28087				element.css( "paddingBottom" ),
28088				element.css( "paddingLeft" )
28089			];
28090
28091		for ( ; i < 4; i++ ) {
28092			widths[ i ] = ( parseFloat( borders[ i ] ) || 0 );
28093			widths[ i ] += ( parseFloat( paddings[ i ] ) || 0 );
28094		}
28095
28096		return {
28097			height: widths[ 0 ] + widths[ 2 ],
28098			width: widths[ 1 ] + widths[ 3 ]
28099		};
28100	},
28101
28102	_proportionallyResize: function() {
28103
28104		if ( !this._proportionallyResizeElements.length ) {
28105			return;
28106		}
28107
28108		var prel,
28109			i = 0,
28110			element = this.helper || this.element;
28111
28112		for ( ; i < this._proportionallyResizeElements.length; i++ ) {
28113
28114			prel = this._proportionallyResizeElements[ i ];
28115
28116			// TODO: Seems like a bug to cache this.outerDimensions
28117			// considering that we are in a loop.
28118			if ( !this.outerDimensions ) {
28119				this.outerDimensions = this._getPaddingPlusBorderDimensions( prel );
28120			}
28121
28122			prel.css( {
28123				height: ( element.height() - this.outerDimensions.height ) || 0,
28124				width: ( element.width() - this.outerDimensions.width ) || 0
28125			} );
28126
28127		}
28128
28129	},
28130
28131	_renderProxy: function() {
28132
28133		var el = this.element, o = this.options;
28134		this.elementOffset = el.offset();
28135
28136		if ( this._helper ) {
28137
28138			this.helper = this.helper || $( "<div style='overflow:hidden;'></div>" );
28139
28140			this._addClass( this.helper, this._helper );
28141			this.helper.css( {
28142				width: this.element.outerWidth(),
28143				height: this.element.outerHeight(),
28144				position: "absolute",
28145				left: this.elementOffset.left + "px",
28146				top: this.elementOffset.top + "px",
28147				zIndex: ++o.zIndex //TODO: Don't modify option
28148			} );
28149
28150			this.helper
28151				.appendTo( "body" )
28152				.disableSelection();
28153
28154		} else {
28155			this.helper = this.element;
28156		}
28157
28158	},
28159
28160	_change: {
28161		e: function( event, dx ) {
28162			return { width: this.originalSize.width + dx };
28163		},
28164		w: function( event, dx ) {
28165			var cs = this.originalSize, sp = this.originalPosition;
28166			return { left: sp.left + dx, width: cs.width - dx };
28167		},
28168		n: function( event, dx, dy ) {
28169			var cs = this.originalSize, sp = this.originalPosition;
28170			return { top: sp.top + dy, height: cs.height - dy };
28171		},
28172		s: function( event, dx, dy ) {
28173			return { height: this.originalSize.height + dy };
28174		},
28175		se: function( event, dx, dy ) {
28176			return $.extend( this._change.s.apply( this, arguments ),
28177				this._change.e.apply( this, [ event, dx, dy ] ) );
28178		},
28179		sw: function( event, dx, dy ) {
28180			return $.extend( this._change.s.apply( this, arguments ),
28181				this._change.w.apply( this, [ event, dx, dy ] ) );
28182		},
28183		ne: function( event, dx, dy ) {
28184			return $.extend( this._change.n.apply( this, arguments ),
28185				this._change.e.apply( this, [ event, dx, dy ] ) );
28186		},
28187		nw: function( event, dx, dy ) {
28188			return $.extend( this._change.n.apply( this, arguments ),
28189				this._change.w.apply( this, [ event, dx, dy ] ) );
28190		}
28191	},
28192
28193	_propagate: function( n, event ) {
28194		$.ui.plugin.call( this, n, [ event, this.ui() ] );
28195		( n !== "resize" && this._trigger( n, event, this.ui() ) );
28196	},
28197
28198	plugins: {},
28199
28200	ui: function() {
28201		return {
28202			originalElement: this.originalElement,
28203			element: this.element,
28204			helper: this.helper,
28205			position: this.position,
28206			size: this.size,
28207			originalSize: this.originalSize,
28208			originalPosition: this.originalPosition
28209		};
28210	}
28211
28212} );
28213
28214/*
28215 * Resizable Extensions
28216 */
28217
28218$.ui.plugin.add( "resizable", "animate", {
28219
28220	stop: function( event ) {
28221		var that = $( this ).resizable( "instance" ),
28222			o = that.options,
28223			pr = that._proportionallyResizeElements,
28224			ista = pr.length && ( /textarea/i ).test( pr[ 0 ].nodeName ),
28225			soffseth = ista && that._hasScroll( pr[ 0 ], "left" ) ? 0 : that.sizeDiff.height,
28226			soffsetw = ista ? 0 : that.sizeDiff.width,
28227			style = {
28228				width: ( that.size.width - soffsetw ),
28229				height: ( that.size.height - soffseth )
28230			},
28231			left = ( parseFloat( that.element.css( "left" ) ) +
28232				( that.position.left - that.originalPosition.left ) ) || null,
28233			top = ( parseFloat( that.element.css( "top" ) ) +
28234				( that.position.top - that.originalPosition.top ) ) || null;
28235
28236		that.element.animate(
28237			$.extend( style, top && left ? { top: top, left: left } : {} ), {
28238				duration: o.animateDuration,
28239				easing: o.animateEasing,
28240				step: function() {
28241
28242					var data = {
28243						width: parseFloat( that.element.css( "width" ) ),
28244						height: parseFloat( that.element.css( "height" ) ),
28245						top: parseFloat( that.element.css( "top" ) ),
28246						left: parseFloat( that.element.css( "left" ) )
28247					};
28248
28249					if ( pr && pr.length ) {
28250						$( pr[ 0 ] ).css( { width: data.width, height: data.height } );
28251					}
28252
28253					// Propagating resize, and updating values for each animation step
28254					that._updateCache( data );
28255					that._propagate( "resize", event );
28256
28257				}
28258			}
28259		);
28260	}
28261
28262} );
28263
28264$.ui.plugin.add( "resizable", "containment", {
28265
28266	start: function() {
28267		var element, p, co, ch, cw, width, height,
28268			that = $( this ).resizable( "instance" ),
28269			o = that.options,
28270			el = that.element,
28271			oc = o.containment,
28272			ce = ( oc instanceof $ ) ?
28273				oc.get( 0 ) :
28274				( /parent/.test( oc ) ) ? el.parent().get( 0 ) : oc;
28275
28276		if ( !ce ) {
28277			return;
28278		}
28279
28280		that.containerElement = $( ce );
28281
28282		if ( /document/.test( oc ) || oc === document ) {
28283			that.containerOffset = {
28284				left: 0,
28285				top: 0
28286			};
28287			that.containerPosition = {
28288				left: 0,
28289				top: 0
28290			};
28291
28292			that.parentData = {
28293				element: $( document ),
28294				left: 0,
28295				top: 0,
28296				width: $( document ).width(),
28297				height: $( document ).height() || document.body.parentNode.scrollHeight
28298			};
28299		} else {
28300			element = $( ce );
28301			p = [];
28302			$( [ "Top", "Right", "Left", "Bottom" ] ).each( function( i, name ) {
28303				p[ i ] = that._num( element.css( "padding" + name ) );
28304			} );
28305
28306			that.containerOffset = element.offset();
28307			that.containerPosition = element.position();
28308			that.containerSize = {
28309				height: ( element.innerHeight() - p[ 3 ] ),
28310				width: ( element.innerWidth() - p[ 1 ] )
28311			};
28312
28313			co = that.containerOffset;
28314			ch = that.containerSize.height;
28315			cw = that.containerSize.width;
28316			width = ( that._hasScroll ( ce, "left" ) ? ce.scrollWidth : cw );
28317			height = ( that._hasScroll ( ce ) ? ce.scrollHeight : ch ) ;
28318
28319			that.parentData = {
28320				element: ce,
28321				left: co.left,
28322				top: co.top,
28323				width: width,
28324				height: height
28325			};
28326		}
28327	},
28328
28329	resize: function( event ) {
28330		var woset, hoset, isParent, isOffsetRelative,
28331			that = $( this ).resizable( "instance" ),
28332			o = that.options,
28333			co = that.containerOffset,
28334			cp = that.position,
28335			pRatio = that._aspectRatio || event.shiftKey,
28336			cop = {
28337				top: 0,
28338				left: 0
28339			},
28340			ce = that.containerElement,
28341			continueResize = true;
28342
28343		if ( ce[ 0 ] !== document && ( /static/ ).test( ce.css( "position" ) ) ) {
28344			cop = co;
28345		}
28346
28347		if ( cp.left < ( that._helper ? co.left : 0 ) ) {
28348			that.size.width = that.size.width +
28349				( that._helper ?
28350					( that.position.left - co.left ) :
28351					( that.position.left - cop.left ) );
28352
28353			if ( pRatio ) {
28354				that.size.height = that.size.width / that.aspectRatio;
28355				continueResize = false;
28356			}
28357			that.position.left = o.helper ? co.left : 0;
28358		}
28359
28360		if ( cp.top < ( that._helper ? co.top : 0 ) ) {
28361			that.size.height = that.size.height +
28362				( that._helper ?
28363					( that.position.top - co.top ) :
28364					that.position.top );
28365
28366			if ( pRatio ) {
28367				that.size.width = that.size.height * that.aspectRatio;
28368				continueResize = false;
28369			}
28370			that.position.top = that._helper ? co.top : 0;
28371		}
28372
28373		isParent = that.containerElement.get( 0 ) === that.element.parent().get( 0 );
28374		isOffsetRelative = /relative|absolute/.test( that.containerElement.css( "position" ) );
28375
28376		if ( isParent && isOffsetRelative ) {
28377			that.offset.left = that.parentData.left + that.position.left;
28378			that.offset.top = that.parentData.top + that.position.top;
28379		} else {
28380			that.offset.left = that.element.offset().left;
28381			that.offset.top = that.element.offset().top;
28382		}
28383
28384		woset = Math.abs( that.sizeDiff.width +
28385			( that._helper ?
28386				that.offset.left - cop.left :
28387				( that.offset.left - co.left ) ) );
28388
28389		hoset = Math.abs( that.sizeDiff.height +
28390			( that._helper ?
28391				that.offset.top - cop.top :
28392				( that.offset.top - co.top ) ) );
28393
28394		if ( woset + that.size.width >= that.parentData.width ) {
28395			that.size.width = that.parentData.width - woset;
28396			if ( pRatio ) {
28397				that.size.height = that.size.width / that.aspectRatio;
28398				continueResize = false;
28399			}
28400		}
28401
28402		if ( hoset + that.size.height >= that.parentData.height ) {
28403			that.size.height = that.parentData.height - hoset;
28404			if ( pRatio ) {
28405				that.size.width = that.size.height * that.aspectRatio;
28406				continueResize = false;
28407			}
28408		}
28409
28410		if ( !continueResize ) {
28411			that.position.left = that.prevPosition.left;
28412			that.position.top = that.prevPosition.top;
28413			that.size.width = that.prevSize.width;
28414			that.size.height = that.prevSize.height;
28415		}
28416	},
28417
28418	stop: function() {
28419		var that = $( this ).resizable( "instance" ),
28420			o = that.options,
28421			co = that.containerOffset,
28422			cop = that.containerPosition,
28423			ce = that.containerElement,
28424			helper = $( that.helper ),
28425			ho = helper.offset(),
28426			w = helper.outerWidth() - that.sizeDiff.width,
28427			h = helper.outerHeight() - that.sizeDiff.height;
28428
28429		if ( that._helper && !o.animate && ( /relative/ ).test( ce.css( "position" ) ) ) {
28430			$( this ).css( {
28431				left: ho.left - cop.left - co.left,
28432				width: w,
28433				height: h
28434			} );
28435		}
28436
28437		if ( that._helper && !o.animate && ( /static/ ).test( ce.css( "position" ) ) ) {
28438			$( this ).css( {
28439				left: ho.left - cop.left - co.left,
28440				width: w,
28441				height: h
28442			} );
28443		}
28444	}
28445} );
28446
28447$.ui.plugin.add( "resizable", "alsoResize", {
28448
28449	start: function() {
28450		var that = $( this ).resizable( "instance" ),
28451			o = that.options;
28452
28453		$( o.alsoResize ).each( function() {
28454			var el = $( this );
28455			el.data( "ui-resizable-alsoresize", {
28456				width: parseFloat( el.width() ), height: parseFloat( el.height() ),
28457				left: parseFloat( el.css( "left" ) ), top: parseFloat( el.css( "top" ) )
28458			} );
28459		} );
28460	},
28461
28462	resize: function( event, ui ) {
28463		var that = $( this ).resizable( "instance" ),
28464			o = that.options,
28465			os = that.originalSize,
28466			op = that.originalPosition,
28467			delta = {
28468				height: ( that.size.height - os.height ) || 0,
28469				width: ( that.size.width - os.width ) || 0,
28470				top: ( that.position.top - op.top ) || 0,
28471				left: ( that.position.left - op.left ) || 0
28472			};
28473
28474			$( o.alsoResize ).each( function() {
28475				var el = $( this ), start = $( this ).data( "ui-resizable-alsoresize" ), style = {},
28476					css = el.parents( ui.originalElement[ 0 ] ).length ?
28477							[ "width", "height" ] :
28478							[ "width", "height", "top", "left" ];
28479
28480				$.each( css, function( i, prop ) {
28481					var sum = ( start[ prop ] || 0 ) + ( delta[ prop ] || 0 );
28482					if ( sum && sum >= 0 ) {
28483						style[ prop ] = sum || null;
28484					}
28485				} );
28486
28487				el.css( style );
28488			} );
28489	},
28490
28491	stop: function() {
28492		$( this ).removeData( "ui-resizable-alsoresize" );
28493	}
28494} );
28495
28496$.ui.plugin.add( "resizable", "ghost", {
28497
28498	start: function() {
28499
28500		var that = $( this ).resizable( "instance" ), cs = that.size;
28501
28502		that.ghost = that.originalElement.clone();
28503		that.ghost.css( {
28504			opacity: 0.25,
28505			display: "block",
28506			position: "relative",
28507			height: cs.height,
28508			width: cs.width,
28509			margin: 0,
28510			left: 0,
28511			top: 0
28512		} );
28513
28514		that._addClass( that.ghost, "ui-resizable-ghost" );
28515
28516		// DEPRECATED
28517		// TODO: remove after 1.12
28518		if ( $.uiBackCompat !== false && typeof that.options.ghost === "string" ) {
28519
28520			// Ghost option
28521			that.ghost.addClass( this.options.ghost );
28522		}
28523
28524		that.ghost.appendTo( that.helper );
28525
28526	},
28527
28528	resize: function() {
28529		var that = $( this ).resizable( "instance" );
28530		if ( that.ghost ) {
28531			that.ghost.css( {
28532				position: "relative",
28533				height: that.size.height,
28534				width: that.size.width
28535			} );
28536		}
28537	},
28538
28539	stop: function() {
28540		var that = $( this ).resizable( "instance" );
28541		if ( that.ghost && that.helper ) {
28542			that.helper.get( 0 ).removeChild( that.ghost.get( 0 ) );
28543		}
28544	}
28545
28546} );
28547
28548$.ui.plugin.add( "resizable", "grid", {
28549
28550	resize: function() {
28551		var outerDimensions,
28552			that = $( this ).resizable( "instance" ),
28553			o = that.options,
28554			cs = that.size,
28555			os = that.originalSize,
28556			op = that.originalPosition,
28557			a = that.axis,
28558			grid = typeof o.grid === "number" ? [ o.grid, o.grid ] : o.grid,
28559			gridX = ( grid[ 0 ] || 1 ),
28560			gridY = ( grid[ 1 ] || 1 ),
28561			ox = Math.round( ( cs.width - os.width ) / gridX ) * gridX,
28562			oy = Math.round( ( cs.height - os.height ) / gridY ) * gridY,
28563			newWidth = os.width + ox,
28564			newHeight = os.height + oy,
28565			isMaxWidth = o.maxWidth && ( o.maxWidth < newWidth ),
28566			isMaxHeight = o.maxHeight && ( o.maxHeight < newHeight ),
28567			isMinWidth = o.minWidth && ( o.minWidth > newWidth ),
28568			isMinHeight = o.minHeight && ( o.minHeight > newHeight );
28569
28570		o.grid = grid;
28571
28572		if ( isMinWidth ) {
28573			newWidth += gridX;
28574		}
28575		if ( isMinHeight ) {
28576			newHeight += gridY;
28577		}
28578		if ( isMaxWidth ) {
28579			newWidth -= gridX;
28580		}
28581		if ( isMaxHeight ) {
28582			newHeight -= gridY;
28583		}
28584
28585		if ( /^(se|s|e)$/.test( a ) ) {
28586			that.size.width = newWidth;
28587			that.size.height = newHeight;
28588		} else if ( /^(ne)$/.test( a ) ) {
28589			that.size.width = newWidth;
28590			that.size.height = newHeight;
28591			that.position.top = op.top - oy;
28592		} else if ( /^(sw)$/.test( a ) ) {
28593			that.size.width = newWidth;
28594			that.size.height = newHeight;
28595			that.position.left = op.left - ox;
28596		} else {
28597			if ( newHeight - gridY <= 0 || newWidth - gridX <= 0 ) {
28598				outerDimensions = that._getPaddingPlusBorderDimensions( this );
28599			}
28600
28601			if ( newHeight - gridY > 0 ) {
28602				that.size.height = newHeight;
28603				that.position.top = op.top - oy;
28604			} else {
28605				newHeight = gridY - outerDimensions.height;
28606				that.size.height = newHeight;
28607				that.position.top = op.top + os.height - newHeight;
28608			}
28609			if ( newWidth - gridX > 0 ) {
28610				that.size.width = newWidth;
28611				that.position.left = op.left - ox;
28612			} else {
28613				newWidth = gridX - outerDimensions.width;
28614				that.size.width = newWidth;
28615				that.position.left = op.left + os.width - newWidth;
28616			}
28617		}
28618	}
28619
28620} );
28621
28622var widgetsResizable = $.ui.resizable;
28623
28624
28625/*!
28626 * jQuery UI Dialog 1.12.1
28627 * http://jqueryui.com
28628 *
28629 * Copyright jQuery Foundation and other contributors
28630 * Released under the MIT license.
28631 * http://jquery.org/license
28632 */
28633
28634//>>label: Dialog
28635//>>group: Widgets
28636//>>description: Displays customizable dialog windows.
28637//>>docs: http://api.jqueryui.com/dialog/
28638//>>demos: http://jqueryui.com/dialog/
28639//>>css.structure: ../../themes/base/core.css
28640//>>css.structure: ../../themes/base/dialog.css
28641//>>css.theme: ../../themes/base/theme.css
28642
28643
28644
28645$.widget( "ui.dialog", {
28646	version: "1.12.1",
28647	options: {
28648		appendTo: "body",
28649		autoOpen: true,
28650		buttons: [],
28651		classes: {
28652			"ui-dialog": "ui-corner-all",
28653			"ui-dialog-titlebar": "ui-corner-all"
28654		},
28655		closeOnEscape: true,
28656		closeText: "Close",
28657		draggable: true,
28658		hide: null,
28659		height: "auto",
28660		maxHeight: null,
28661		maxWidth: null,
28662		minHeight: 150,
28663		minWidth: 150,
28664		modal: false,
28665		position: {
28666			my: "center",
28667			at: "center",
28668			of: window,
28669			collision: "fit",
28670
28671			// Ensure the titlebar is always visible
28672			using: function( pos ) {
28673				var topOffset = $( this ).css( pos ).offset().top;
28674				if ( topOffset < 0 ) {
28675					$( this ).css( "top", pos.top - topOffset );
28676				}
28677			}
28678		},
28679		resizable: true,
28680		show: null,
28681		title: null,
28682		width: 300,
28683
28684		// Callbacks
28685		beforeClose: null,
28686		close: null,
28687		drag: null,
28688		dragStart: null,
28689		dragStop: null,
28690		focus: null,
28691		open: null,
28692		resize: null,
28693		resizeStart: null,
28694		resizeStop: null
28695	},
28696
28697	sizeRelatedOptions: {
28698		buttons: true,
28699		height: true,
28700		maxHeight: true,
28701		maxWidth: true,
28702		minHeight: true,
28703		minWidth: true,
28704		width: true
28705	},
28706
28707	resizableRelatedOptions: {
28708		maxHeight: true,
28709		maxWidth: true,
28710		minHeight: true,
28711		minWidth: true
28712	},
28713
28714	_create: function() {
28715		this.originalCss = {
28716			display: this.element[ 0 ].style.display,
28717			width: this.element[ 0 ].style.width,
28718			minHeight: this.element[ 0 ].style.minHeight,
28719			maxHeight: this.element[ 0 ].style.maxHeight,
28720			height: this.element[ 0 ].style.height
28721		};
28722		this.originalPosition = {
28723			parent: this.element.parent(),
28724			index: this.element.parent().children().index( this.element )
28725		};
28726		this.originalTitle = this.element.attr( "title" );
28727		if ( this.options.title == null && this.originalTitle != null ) {
28728			this.options.title = this.originalTitle;
28729		}
28730
28731		// Dialogs can't be disabled
28732		if ( this.options.disabled ) {
28733			this.options.disabled = false;
28734		}
28735
28736		this._createWrapper();
28737
28738		this.element
28739			.show()
28740			.removeAttr( "title" )
28741			.appendTo( this.uiDialog );
28742
28743		this._addClass( "ui-dialog-content", "ui-widget-content" );
28744
28745		this._createTitlebar();
28746		this._createButtonPane();
28747
28748		if ( this.options.draggable && $.fn.draggable ) {
28749			this._makeDraggable();
28750		}
28751		if ( this.options.resizable && $.fn.resizable ) {
28752			this._makeResizable();
28753		}
28754
28755		this._isOpen = false;
28756
28757		this._trackFocus();
28758	},
28759
28760	_init: function() {
28761		if ( this.options.autoOpen ) {
28762			this.open();
28763		}
28764	},
28765
28766	_appendTo: function() {
28767		var element = this.options.appendTo;
28768		if ( element && ( element.jquery || element.nodeType ) ) {
28769			return $( element );
28770		}
28771		return this.document.find( element || "body" ).eq( 0 );
28772	},
28773
28774	_destroy: function() {
28775		var next,
28776			originalPosition = this.originalPosition;
28777
28778		this._untrackInstance();
28779		this._destroyOverlay();
28780
28781		this.element
28782			.removeUniqueId()
28783			.css( this.originalCss )
28784
28785			// Without detaching first, the following becomes really slow
28786			.detach();
28787
28788		this.uiDialog.remove();
28789
28790		if ( this.originalTitle ) {
28791			this.element.attr( "title", this.originalTitle );
28792		}
28793
28794		next = originalPosition.parent.children().eq( originalPosition.index );
28795
28796		// Don't try to place the dialog next to itself (#8613)
28797		if ( next.length && next[ 0 ] !== this.element[ 0 ] ) {
28798			next.before( this.element );
28799		} else {
28800			originalPosition.parent.append( this.element );
28801		}
28802	},
28803
28804	widget: function() {
28805		return this.uiDialog;
28806	},
28807
28808	disable: $.noop,
28809	enable: $.noop,
28810
28811	close: function( event ) {
28812		var that = this;
28813
28814		if ( !this._isOpen || this._trigger( "beforeClose", event ) === false ) {
28815			return;
28816		}
28817
28818		this._isOpen = false;
28819		this._focusedElement = null;
28820		this._destroyOverlay();
28821		this._untrackInstance();
28822
28823		if ( !this.opener.filter( ":focusable" ).trigger( "focus" ).length ) {
28824
28825			// Hiding a focused element doesn't trigger blur in WebKit
28826			// so in case we have nothing to focus on, explicitly blur the active element
28827			// https://bugs.webkit.org/show_bug.cgi?id=47182
28828			$.ui.safeBlur( $.ui.safeActiveElement( this.document[ 0 ] ) );
28829		}
28830
28831		this._hide( this.uiDialog, this.options.hide, function() {
28832			that._trigger( "close", event );
28833		} );
28834	},
28835
28836	isOpen: function() {
28837		return this._isOpen;
28838	},
28839
28840	moveToTop: function() {
28841		this._moveToTop();
28842	},
28843
28844	_moveToTop: function( event, silent ) {
28845		var moved = false,
28846			zIndices = this.uiDialog.siblings( ".ui-front:visible" ).map( function() {
28847				return +$( this ).css( "z-index" );
28848			} ).get(),
28849			zIndexMax = Math.max.apply( null, zIndices );
28850
28851		if ( zIndexMax >= +this.uiDialog.css( "z-index" ) ) {
28852			this.uiDialog.css( "z-index", zIndexMax + 1 );
28853			moved = true;
28854		}
28855
28856		if ( moved && !silent ) {
28857			this._trigger( "focus", event );
28858		}
28859		return moved;
28860	},
28861
28862	open: function() {
28863		var that = this;
28864		if ( this._isOpen ) {
28865			if ( this._moveToTop() ) {
28866				this._focusTabbable();
28867			}
28868			return;
28869		}
28870
28871		this._isOpen = true;
28872		this.opener = $( $.ui.safeActiveElement( this.document[ 0 ] ) );
28873
28874		this._size();
28875		this._position();
28876		this._createOverlay();
28877		this._moveToTop( null, true );
28878
28879		// Ensure the overlay is moved to the top with the dialog, but only when
28880		// opening. The overlay shouldn't move after the dialog is open so that
28881		// modeless dialogs opened after the modal dialog stack properly.
28882		if ( this.overlay ) {
28883			this.overlay.css( "z-index", this.uiDialog.css( "z-index" ) - 1 );
28884		}
28885
28886		this._show( this.uiDialog, this.options.show, function() {
28887			that._focusTabbable();
28888			that._trigger( "focus" );
28889		} );
28890
28891		// Track the dialog immediately upon openening in case a focus event
28892		// somehow occurs outside of the dialog before an element inside the
28893		// dialog is focused (#10152)
28894		this._makeFocusTarget();
28895
28896		this._trigger( "open" );
28897	},
28898
28899	_focusTabbable: function() {
28900
28901		// Set focus to the first match:
28902		// 1. An element that was focused previously
28903		// 2. First element inside the dialog matching [autofocus]
28904		// 3. Tabbable element inside the content element
28905		// 4. Tabbable element inside the buttonpane
28906		// 5. The close button
28907		// 6. The dialog itself
28908		var hasFocus = this._focusedElement;
28909		if ( !hasFocus ) {
28910			hasFocus = this.element.find( "[autofocus]" );
28911		}
28912		if ( !hasFocus.length ) {
28913			hasFocus = this.element.find( ":tabbable" );
28914		}
28915		if ( !hasFocus.length ) {
28916			hasFocus = this.uiDialogButtonPane.find( ":tabbable" );
28917		}
28918		if ( !hasFocus.length ) {
28919			hasFocus = this.uiDialogTitlebarClose.filter( ":tabbable" );
28920		}
28921		if ( !hasFocus.length ) {
28922			hasFocus = this.uiDialog;
28923		}
28924		hasFocus.eq( 0 ).trigger( "focus" );
28925	},
28926
28927	_keepFocus: function( event ) {
28928		function checkFocus() {
28929			var activeElement = $.ui.safeActiveElement( this.document[ 0 ] ),
28930				isActive = this.uiDialog[ 0 ] === activeElement ||
28931					$.contains( this.uiDialog[ 0 ], activeElement );
28932			if ( !isActive ) {
28933				this._focusTabbable();
28934			}
28935		}
28936		event.preventDefault();
28937		checkFocus.call( this );
28938
28939		// support: IE
28940		// IE <= 8 doesn't prevent moving focus even with event.preventDefault()
28941		// so we check again later
28942		this._delay( checkFocus );
28943	},
28944
28945	_createWrapper: function() {
28946		this.uiDialog = $( "<div>" )
28947			.hide()
28948			.attr( {
28949
28950				// Setting tabIndex makes the div focusable
28951				tabIndex: -1,
28952				role: "dialog"
28953			} )
28954			.appendTo( this._appendTo() );
28955
28956		this._addClass( this.uiDialog, "ui-dialog", "ui-widget ui-widget-content ui-front" );
28957		this._on( this.uiDialog, {
28958			keydown: function( event ) {
28959				if ( this.options.closeOnEscape && !event.isDefaultPrevented() && event.keyCode &&
28960						event.keyCode === $.ui.keyCode.ESCAPE ) {
28961					event.preventDefault();
28962					this.close( event );
28963					return;
28964				}
28965
28966				// Prevent tabbing out of dialogs
28967				if ( event.keyCode !== $.ui.keyCode.TAB || event.isDefaultPrevented() ) {
28968					return;
28969				}
28970				var tabbables = this.uiDialog.find( ":tabbable" ),
28971					first = tabbables.filter( ":first" ),
28972					last = tabbables.filter( ":last" );
28973
28974				if ( ( event.target === last[ 0 ] || event.target === this.uiDialog[ 0 ] ) &&
28975						!event.shiftKey ) {
28976					this._delay( function() {
28977						first.trigger( "focus" );
28978					} );
28979					event.preventDefault();
28980				} else if ( ( event.target === first[ 0 ] ||
28981						event.target === this.uiDialog[ 0 ] ) && event.shiftKey ) {
28982					this._delay( function() {
28983						last.trigger( "focus" );
28984					} );
28985					event.preventDefault();
28986				}
28987			},
28988			mousedown: function( event ) {
28989				if ( this._moveToTop( event ) ) {
28990					this._focusTabbable();
28991				}
28992			}
28993		} );
28994
28995		// We assume that any existing aria-describedby attribute means
28996		// that the dialog content is marked up properly
28997		// otherwise we brute force the content as the description
28998		if ( !this.element.find( "[aria-describedby]" ).length ) {
28999			this.uiDialog.attr( {
29000				"aria-describedby": this.element.uniqueId().attr( "id" )
29001			} );
29002		}
29003	},
29004
29005	_createTitlebar: function() {
29006		var uiDialogTitle;
29007
29008		this.uiDialogTitlebar = $( "<div>" );
29009		this._addClass( this.uiDialogTitlebar,
29010			"ui-dialog-titlebar", "ui-widget-header ui-helper-clearfix" );
29011		this._on( this.uiDialogTitlebar, {
29012			mousedown: function( event ) {
29013
29014				// Don't prevent click on close button (#8838)
29015				// Focusing a dialog that is partially scrolled out of view
29016				// causes the browser to scroll it into view, preventing the click event
29017				if ( !$( event.target ).closest( ".ui-dialog-titlebar-close" ) ) {
29018
29019					// Dialog isn't getting focus when dragging (#8063)
29020					this.uiDialog.trigger( "focus" );
29021				}
29022			}
29023		} );
29024
29025		// Support: IE
29026		// Use type="button" to prevent enter keypresses in textboxes from closing the
29027		// dialog in IE (#9312)
29028		this.uiDialogTitlebarClose = $( "<button type='button'></button>" )
29029			.button( {
29030				label: $( "<a>" ).text( this.options.closeText ).html(),
29031				icon: "ui-icon-closethick",
29032				showLabel: false
29033			} )
29034			.appendTo( this.uiDialogTitlebar );
29035
29036		this._addClass( this.uiDialogTitlebarClose, "ui-dialog-titlebar-close" );
29037		this._on( this.uiDialogTitlebarClose, {
29038			click: function( event ) {
29039				event.preventDefault();
29040				this.close( event );
29041			}
29042		} );
29043
29044		uiDialogTitle = $( "<span>" ).uniqueId().prependTo( this.uiDialogTitlebar );
29045		this._addClass( uiDialogTitle, "ui-dialog-title" );
29046		this._title( uiDialogTitle );
29047
29048		this.uiDialogTitlebar.prependTo( this.uiDialog );
29049
29050		this.uiDialog.attr( {
29051			"aria-labelledby": uiDialogTitle.attr( "id" )
29052		} );
29053	},
29054
29055	_title: function( title ) {
29056		if ( this.options.title ) {
29057			title.text( this.options.title );
29058		} else {
29059			title.html( "&#160;" );
29060		}
29061	},
29062
29063	_createButtonPane: function() {
29064		this.uiDialogButtonPane = $( "<div>" );
29065		this._addClass( this.uiDialogButtonPane, "ui-dialog-buttonpane",
29066			"ui-widget-content ui-helper-clearfix" );
29067
29068		this.uiButtonSet = $( "<div>" )
29069			.appendTo( this.uiDialogButtonPane );
29070		this._addClass( this.uiButtonSet, "ui-dialog-buttonset" );
29071
29072		this._createButtons();
29073	},
29074
29075	_createButtons: function() {
29076		var that = this,
29077			buttons = this.options.buttons;
29078
29079		// If we already have a button pane, remove it
29080		this.uiDialogButtonPane.remove();
29081		this.uiButtonSet.empty();
29082
29083		if ( $.isEmptyObject( buttons ) || ( $.isArray( buttons ) && !buttons.length ) ) {
29084			this._removeClass( this.uiDialog, "ui-dialog-buttons" );
29085			return;
29086		}
29087
29088		$.each( buttons, function( name, props ) {
29089			var click, buttonOptions;
29090			props = $.isFunction( props ) ?
29091				{ click: props, text: name } :
29092				props;
29093
29094			// Default to a non-submitting button
29095			props = $.extend( { type: "button" }, props );
29096
29097			// Change the context for the click callback to be the main element
29098			click = props.click;
29099			buttonOptions = {
29100				icon: props.icon,
29101				iconPosition: props.iconPosition,
29102				showLabel: props.showLabel,
29103
29104				// Deprecated options
29105				icons: props.icons,
29106				text: props.text
29107			};
29108
29109			delete props.click;
29110			delete props.icon;
29111			delete props.iconPosition;
29112			delete props.showLabel;
29113
29114			// Deprecated options
29115			delete props.icons;
29116			if ( typeof props.text === "boolean" ) {
29117				delete props.text;
29118			}
29119
29120			$( "<button></button>", props )
29121				.button( buttonOptions )
29122				.appendTo( that.uiButtonSet )
29123				.on( "click", function() {
29124					click.apply( that.element[ 0 ], arguments );
29125				} );
29126		} );
29127		this._addClass( this.uiDialog, "ui-dialog-buttons" );
29128		this.uiDialogButtonPane.appendTo( this.uiDialog );
29129	},
29130
29131	_makeDraggable: function() {
29132		var that = this,
29133			options = this.options;
29134
29135		function filteredUi( ui ) {
29136			return {
29137				position: ui.position,
29138				offset: ui.offset
29139			};
29140		}
29141
29142		this.uiDialog.draggable( {
29143			cancel: ".ui-dialog-content, .ui-dialog-titlebar-close",
29144			handle: ".ui-dialog-titlebar",
29145			containment: "document",
29146			start: function( event, ui ) {
29147				that._addClass( $( this ), "ui-dialog-dragging" );
29148				that._blockFrames();
29149				that._trigger( "dragStart", event, filteredUi( ui ) );
29150			},
29151			drag: function( event, ui ) {
29152				that._trigger( "drag", event, filteredUi( ui ) );
29153			},
29154			stop: function( event, ui ) {
29155				var left = ui.offset.left - that.document.scrollLeft(),
29156					top = ui.offset.top - that.document.scrollTop();
29157
29158				options.position = {
29159					my: "left top",
29160					at: "left" + ( left >= 0 ? "+" : "" ) + left + " " +
29161						"top" + ( top >= 0 ? "+" : "" ) + top,
29162					of: that.window
29163				};
29164				that._removeClass( $( this ), "ui-dialog-dragging" );
29165				that._unblockFrames();
29166				that._trigger( "dragStop", event, filteredUi( ui ) );
29167			}
29168		} );
29169	},
29170
29171	_makeResizable: function() {
29172		var that = this,
29173			options = this.options,
29174			handles = options.resizable,
29175
29176			// .ui-resizable has position: relative defined in the stylesheet
29177			// but dialogs have to use absolute or fixed positioning
29178			position = this.uiDialog.css( "position" ),
29179			resizeHandles = typeof handles === "string" ?
29180				handles :
29181				"n,e,s,w,se,sw,ne,nw";
29182
29183		function filteredUi( ui ) {
29184			return {
29185				originalPosition: ui.originalPosition,
29186				originalSize: ui.originalSize,
29187				position: ui.position,
29188				size: ui.size
29189			};
29190		}
29191
29192		this.uiDialog.resizable( {
29193			cancel: ".ui-dialog-content",
29194			containment: "document",
29195			alsoResize: this.element,
29196			maxWidth: options.maxWidth,
29197			maxHeight: options.maxHeight,
29198			minWidth: options.minWidth,
29199			minHeight: this._minHeight(),
29200			handles: resizeHandles,
29201			start: function( event, ui ) {
29202				that._addClass( $( this ), "ui-dialog-resizing" );
29203				that._blockFrames();
29204				that._trigger( "resizeStart", event, filteredUi( ui ) );
29205			},
29206			resize: function( event, ui ) {
29207				that._trigger( "resize", event, filteredUi( ui ) );
29208			},
29209			stop: function( event, ui ) {
29210				var offset = that.uiDialog.offset(),
29211					left = offset.left - that.document.scrollLeft(),
29212					top = offset.top - that.document.scrollTop();
29213
29214				options.height = that.uiDialog.height();
29215				options.width = that.uiDialog.width();
29216				options.position = {
29217					my: "left top",
29218					at: "left" + ( left >= 0 ? "+" : "" ) + left + " " +
29219						"top" + ( top >= 0 ? "+" : "" ) + top,
29220					of: that.window
29221				};
29222				that._removeClass( $( this ), "ui-dialog-resizing" );
29223				that._unblockFrames();
29224				that._trigger( "resizeStop", event, filteredUi( ui ) );
29225			}
29226		} )
29227			.css( "position", position );
29228	},
29229
29230	_trackFocus: function() {
29231		this._on( this.widget(), {
29232			focusin: function( event ) {
29233				this._makeFocusTarget();
29234				this._focusedElement = $( event.target );
29235			}
29236		} );
29237	},
29238
29239	_makeFocusTarget: function() {
29240		this._untrackInstance();
29241		this._trackingInstances().unshift( this );
29242	},
29243
29244	_untrackInstance: function() {
29245		var instances = this._trackingInstances(),
29246			exists = $.inArray( this, instances );
29247		if ( exists !== -1 ) {
29248			instances.splice( exists, 1 );
29249		}
29250	},
29251
29252	_trackingInstances: function() {
29253		var instances = this.document.data( "ui-dialog-instances" );
29254		if ( !instances ) {
29255			instances = [];
29256			this.document.data( "ui-dialog-instances", instances );
29257		}
29258		return instances;
29259	},
29260
29261	_minHeight: function() {
29262		var options = this.options;
29263
29264		return options.height === "auto" ?
29265			options.minHeight :
29266			Math.min( options.minHeight, options.height );
29267	},
29268
29269	_position: function() {
29270
29271		// Need to show the dialog to get the actual offset in the position plugin
29272		var isVisible = this.uiDialog.is( ":visible" );
29273		if ( !isVisible ) {
29274			this.uiDialog.show();
29275		}
29276		this.uiDialog.position( this.options.position );
29277		if ( !isVisible ) {
29278			this.uiDialog.hide();
29279		}
29280	},
29281
29282	_setOptions: function( options ) {
29283		var that = this,
29284			resize = false,
29285			resizableOptions = {};
29286
29287		$.each( options, function( key, value ) {
29288			that._setOption( key, value );
29289
29290			if ( key in that.sizeRelatedOptions ) {
29291				resize = true;
29292			}
29293			if ( key in that.resizableRelatedOptions ) {
29294				resizableOptions[ key ] = value;
29295			}
29296		} );
29297
29298		if ( resize ) {
29299			this._size();
29300			this._position();
29301		}
29302		if ( this.uiDialog.is( ":data(ui-resizable)" ) ) {
29303			this.uiDialog.resizable( "option", resizableOptions );
29304		}
29305	},
29306
29307	_setOption: function( key, value ) {
29308		var isDraggable, isResizable,
29309			uiDialog = this.uiDialog;
29310
29311		if ( key === "disabled" ) {
29312			return;
29313		}
29314
29315		this._super( key, value );
29316
29317		if ( key === "appendTo" ) {
29318			this.uiDialog.appendTo( this._appendTo() );
29319		}
29320
29321		if ( key === "buttons" ) {
29322			this._createButtons();
29323		}
29324
29325		if ( key === "closeText" ) {
29326			this.uiDialogTitlebarClose.button( {
29327
29328				// Ensure that we always pass a string
29329				label: $( "<a>" ).text( "" + this.options.closeText ).html()
29330			} );
29331		}
29332
29333		if ( key === "draggable" ) {
29334			isDraggable = uiDialog.is( ":data(ui-draggable)" );
29335			if ( isDraggable && !value ) {
29336				uiDialog.draggable( "destroy" );
29337			}
29338
29339			if ( !isDraggable && value ) {
29340				this._makeDraggable();
29341			}
29342		}
29343
29344		if ( key === "position" ) {
29345			this._position();
29346		}
29347
29348		if ( key === "resizable" ) {
29349
29350			// currently resizable, becoming non-resizable
29351			isResizable = uiDialog.is( ":data(ui-resizable)" );
29352			if ( isResizable && !value ) {
29353				uiDialog.resizable( "destroy" );
29354			}
29355
29356			// Currently resizable, changing handles
29357			if ( isResizable && typeof value === "string" ) {
29358				uiDialog.resizable( "option", "handles", value );
29359			}
29360
29361			// Currently non-resizable, becoming resizable
29362			if ( !isResizable && value !== false ) {
29363				this._makeResizable();
29364			}
29365		}
29366
29367		if ( key === "title" ) {
29368			this._title( this.uiDialogTitlebar.find( ".ui-dialog-title" ) );
29369		}
29370	},
29371
29372	_size: function() {
29373
29374		// If the user has resized the dialog, the .ui-dialog and .ui-dialog-content
29375		// divs will both have width and height set, so we need to reset them
29376		var nonContentHeight, minContentHeight, maxContentHeight,
29377			options = this.options;
29378
29379		// Reset content sizing
29380		this.element.show().css( {
29381			width: "auto",
29382			minHeight: 0,
29383			maxHeight: "none",
29384			height: 0
29385		} );
29386
29387		if ( options.minWidth > options.width ) {
29388			options.width = options.minWidth;
29389		}
29390
29391		// Reset wrapper sizing
29392		// determine the height of all the non-content elements
29393		nonContentHeight = this.uiDialog.css( {
29394			height: "auto",
29395			width: options.width
29396		} )
29397			.outerHeight();
29398		minContentHeight = Math.max( 0, options.minHeight - nonContentHeight );
29399		maxContentHeight = typeof options.maxHeight === "number" ?
29400			Math.max( 0, options.maxHeight - nonContentHeight ) :
29401			"none";
29402
29403		if ( options.height === "auto" ) {
29404			this.element.css( {
29405				minHeight: minContentHeight,
29406				maxHeight: maxContentHeight,
29407				height: "auto"
29408			} );
29409		} else {
29410			this.element.height( Math.max( 0, options.height - nonContentHeight ) );
29411		}
29412
29413		if ( this.uiDialog.is( ":data(ui-resizable)" ) ) {
29414			this.uiDialog.resizable( "option", "minHeight", this._minHeight() );
29415		}
29416	},
29417
29418	_blockFrames: function() {
29419		this.iframeBlocks = this.document.find( "iframe" ).map( function() {
29420			var iframe = $( this );
29421
29422			return $( "<div>" )
29423				.css( {
29424					position: "absolute",
29425					width: iframe.outerWidth(),
29426					height: iframe.outerHeight()
29427				} )
29428				.appendTo( iframe.parent() )
29429				.offset( iframe.offset() )[ 0 ];
29430		} );
29431	},
29432
29433	_unblockFrames: function() {
29434		if ( this.iframeBlocks ) {
29435			this.iframeBlocks.remove();
29436			delete this.iframeBlocks;
29437		}
29438	},
29439
29440	_allowInteraction: function( event ) {
29441		if ( $( event.target ).closest( ".ui-dialog" ).length ) {
29442			return true;
29443		}
29444
29445		// TODO: Remove hack when datepicker implements
29446		// the .ui-front logic (#8989)
29447		return !!$( event.target ).closest( ".ui-datepicker" ).length;
29448	},
29449
29450	_createOverlay: function() {
29451		if ( !this.options.modal ) {
29452			return;
29453		}
29454
29455		// We use a delay in case the overlay is created from an
29456		// event that we're going to be cancelling (#2804)
29457		var isOpening = true;
29458		this._delay( function() {
29459			isOpening = false;
29460		} );
29461
29462		if ( !this.document.data( "ui-dialog-overlays" ) ) {
29463
29464			// Prevent use of anchors and inputs
29465			// Using _on() for an event handler shared across many instances is
29466			// safe because the dialogs stack and must be closed in reverse order
29467			this._on( this.document, {
29468				focusin: function( event ) {
29469					if ( isOpening ) {
29470						return;
29471					}
29472
29473					if ( !this._allowInteraction( event ) ) {
29474						event.preventDefault();
29475						this._trackingInstances()[ 0 ]._focusTabbable();
29476					}
29477				}
29478			} );
29479		}
29480
29481		this.overlay = $( "<div>" )
29482			.appendTo( this._appendTo() );
29483
29484		this._addClass( this.overlay, null, "ui-widget-overlay ui-front" );
29485		this._on( this.overlay, {
29486			mousedown: "_keepFocus"
29487		} );
29488		this.document.data( "ui-dialog-overlays",
29489			( this.document.data( "ui-dialog-overlays" ) || 0 ) + 1 );
29490	},
29491
29492	_destroyOverlay: function() {
29493		if ( !this.options.modal ) {
29494			return;
29495		}
29496
29497		if ( this.overlay ) {
29498			var overlays = this.document.data( "ui-dialog-overlays" ) - 1;
29499
29500			if ( !overlays ) {
29501				this._off( this.document, "focusin" );
29502				this.document.removeData( "ui-dialog-overlays" );
29503			} else {
29504				this.document.data( "ui-dialog-overlays", overlays );
29505			}
29506
29507			this.overlay.remove();
29508			this.overlay = null;
29509		}
29510	}
29511} );
29512
29513// DEPRECATED
29514// TODO: switch return back to widget declaration at top of file when this is removed
29515if ( $.uiBackCompat !== false ) {
29516
29517	// Backcompat for dialogClass option
29518	$.widget( "ui.dialog", $.ui.dialog, {
29519		options: {
29520			dialogClass: ""
29521		},
29522		_createWrapper: function() {
29523			this._super();
29524			this.uiDialog.addClass( this.options.dialogClass );
29525		},
29526		_setOption: function( key, value ) {
29527			if ( key === "dialogClass" ) {
29528				this.uiDialog
29529					.removeClass( this.options.dialogClass )
29530					.addClass( value );
29531			}
29532			this._superApply( arguments );
29533		}
29534	} );
29535}
29536
29537var widgetsDialog = $.ui.dialog;
29538
29539
29540/*!
29541 * jQuery UI Droppable 1.12.1
29542 * http://jqueryui.com
29543 *
29544 * Copyright jQuery Foundation and other contributors
29545 * Released under the MIT license.
29546 * http://jquery.org/license
29547 */
29548
29549//>>label: Droppable
29550//>>group: Interactions
29551//>>description: Enables drop targets for draggable elements.
29552//>>docs: http://api.jqueryui.com/droppable/
29553//>>demos: http://jqueryui.com/droppable/
29554
29555
29556
29557$.widget( "ui.droppable", {
29558	version: "1.12.1",
29559	widgetEventPrefix: "drop",
29560	options: {
29561		accept: "*",
29562		addClasses: true,
29563		greedy: false,
29564		scope: "default",
29565		tolerance: "intersect",
29566
29567		// Callbacks
29568		activate: null,
29569		deactivate: null,
29570		drop: null,
29571		out: null,
29572		over: null
29573	},
29574	_create: function() {
29575
29576		var proportions,
29577			o = this.options,
29578			accept = o.accept;
29579
29580		this.isover = false;
29581		this.isout = true;
29582
29583		this.accept = $.isFunction( accept ) ? accept : function( d ) {
29584			return d.is( accept );
29585		};
29586
29587		this.proportions = function( /* valueToWrite */ ) {
29588			if ( arguments.length ) {
29589
29590				// Store the droppable's proportions
29591				proportions = arguments[ 0 ];
29592			} else {
29593
29594				// Retrieve or derive the droppable's proportions
29595				return proportions ?
29596					proportions :
29597					proportions = {
29598						width: this.element[ 0 ].offsetWidth,
29599						height: this.element[ 0 ].offsetHeight
29600					};
29601			}
29602		};
29603
29604		this._addToManager( o.scope );
29605
29606		o.addClasses && this._addClass( "ui-droppable" );
29607
29608	},
29609
29610	_addToManager: function( scope ) {
29611
29612		// Add the reference and positions to the manager
29613		$.ui.ddmanager.droppables[ scope ] = $.ui.ddmanager.droppables[ scope ] || [];
29614		$.ui.ddmanager.droppables[ scope ].push( this );
29615	},
29616
29617	_splice: function( drop ) {
29618		var i = 0;
29619		for ( ; i < drop.length; i++ ) {
29620			if ( drop[ i ] === this ) {
29621				drop.splice( i, 1 );
29622			}
29623		}
29624	},
29625
29626	_destroy: function() {
29627		var drop = $.ui.ddmanager.droppables[ this.options.scope ];
29628
29629		this._splice( drop );
29630	},
29631
29632	_setOption: function( key, value ) {
29633
29634		if ( key === "accept" ) {
29635			this.accept = $.isFunction( value ) ? value : function( d ) {
29636				return d.is( value );
29637			};
29638		} else if ( key === "scope" ) {
29639			var drop = $.ui.ddmanager.droppables[ this.options.scope ];
29640
29641			this._splice( drop );
29642			this._addToManager( value );
29643		}
29644
29645		this._super( key, value );
29646	},
29647
29648	_activate: function( event ) {
29649		var draggable = $.ui.ddmanager.current;
29650
29651		this._addActiveClass();
29652		if ( draggable ) {
29653			this._trigger( "activate", event, this.ui( draggable ) );
29654		}
29655	},
29656
29657	_deactivate: function( event ) {
29658		var draggable = $.ui.ddmanager.current;
29659
29660		this._removeActiveClass();
29661		if ( draggable ) {
29662			this._trigger( "deactivate", event, this.ui( draggable ) );
29663		}
29664	},
29665
29666	_over: function( event ) {
29667
29668		var draggable = $.ui.ddmanager.current;
29669
29670		// Bail if draggable and droppable are same element
29671		if ( !draggable || ( draggable.currentItem ||
29672				draggable.element )[ 0 ] === this.element[ 0 ] ) {
29673			return;
29674		}
29675
29676		if ( this.accept.call( this.element[ 0 ], ( draggable.currentItem ||
29677				draggable.element ) ) ) {
29678			this._addHoverClass();
29679			this._trigger( "over", event, this.ui( draggable ) );
29680		}
29681
29682	},
29683
29684	_out: function( event ) {
29685
29686		var draggable = $.ui.ddmanager.current;
29687
29688		// Bail if draggable and droppable are same element
29689		if ( !draggable || ( draggable.currentItem ||
29690				draggable.element )[ 0 ] === this.element[ 0 ] ) {
29691			return;
29692		}
29693
29694		if ( this.accept.call( this.element[ 0 ], ( draggable.currentItem ||
29695				draggable.element ) ) ) {
29696			this._removeHoverClass();
29697			this._trigger( "out", event, this.ui( draggable ) );
29698		}
29699
29700	},
29701
29702	_drop: function( event, custom ) {
29703
29704		var draggable = custom || $.ui.ddmanager.current,
29705			childrenIntersection = false;
29706
29707		// Bail if draggable and droppable are same element
29708		if ( !draggable || ( draggable.currentItem ||
29709				draggable.element )[ 0 ] === this.element[ 0 ] ) {
29710			return false;
29711		}
29712
29713		this.element
29714			.find( ":data(ui-droppable)" )
29715			.not( ".ui-draggable-dragging" )
29716			.each( function() {
29717				var inst = $( this ).droppable( "instance" );
29718				if (
29719					inst.options.greedy &&
29720					!inst.options.disabled &&
29721					inst.options.scope === draggable.options.scope &&
29722					inst.accept.call(
29723						inst.element[ 0 ], ( draggable.currentItem || draggable.element )
29724					) &&
29725					intersect(
29726						draggable,
29727						$.extend( inst, { offset: inst.element.offset() } ),
29728						inst.options.tolerance, event
29729					)
29730				) {
29731					childrenIntersection = true;
29732					return false; }
29733			} );
29734		if ( childrenIntersection ) {
29735			return false;
29736		}
29737
29738		if ( this.accept.call( this.element[ 0 ],
29739				( draggable.currentItem || draggable.element ) ) ) {
29740			this._removeActiveClass();
29741			this._removeHoverClass();
29742
29743			this._trigger( "drop", event, this.ui( draggable ) );
29744			return this.element;
29745		}
29746
29747		return false;
29748
29749	},
29750
29751	ui: function( c ) {
29752		return {
29753			draggable: ( c.currentItem || c.element ),
29754			helper: c.helper,
29755			position: c.position,
29756			offset: c.positionAbs
29757		};
29758	},
29759
29760	// Extension points just to make backcompat sane and avoid duplicating logic
29761	// TODO: Remove in 1.13 along with call to it below
29762	_addHoverClass: function() {
29763		this._addClass( "ui-droppable-hover" );
29764	},
29765
29766	_removeHoverClass: function() {
29767		this._removeClass( "ui-droppable-hover" );
29768	},
29769
29770	_addActiveClass: function() {
29771		this._addClass( "ui-droppable-active" );
29772	},
29773
29774	_removeActiveClass: function() {
29775		this._removeClass( "ui-droppable-active" );
29776	}
29777} );
29778
29779var intersect = $.ui.intersect = ( function() {
29780	function isOverAxis( x, reference, size ) {
29781		return ( x >= reference ) && ( x < ( reference + size ) );
29782	}
29783
29784	return function( draggable, droppable, toleranceMode, event ) {
29785
29786		if ( !droppable.offset ) {
29787			return false;
29788		}
29789
29790		var x1 = ( draggable.positionAbs ||
29791				draggable.position.absolute ).left + draggable.margins.left,
29792			y1 = ( draggable.positionAbs ||
29793				draggable.position.absolute ).top + draggable.margins.top,
29794			x2 = x1 + draggable.helperProportions.width,
29795			y2 = y1 + draggable.helperProportions.height,
29796			l = droppable.offset.left,
29797			t = droppable.offset.top,
29798			r = l + droppable.proportions().width,
29799			b = t + droppable.proportions().height;
29800
29801		switch ( toleranceMode ) {
29802		case "fit":
29803			return ( l <= x1 && x2 <= r && t <= y1 && y2 <= b );
29804		case "intersect":
29805			return ( l < x1 + ( draggable.helperProportions.width / 2 ) && // Right Half
29806				x2 - ( draggable.helperProportions.width / 2 ) < r && // Left Half
29807				t < y1 + ( draggable.helperProportions.height / 2 ) && // Bottom Half
29808				y2 - ( draggable.helperProportions.height / 2 ) < b ); // Top Half
29809		case "pointer":
29810			return isOverAxis( event.pageY, t, droppable.proportions().height ) &&
29811				isOverAxis( event.pageX, l, droppable.proportions().width );
29812		case "touch":
29813			return (
29814				( y1 >= t && y1 <= b ) || // Top edge touching
29815				( y2 >= t && y2 <= b ) || // Bottom edge touching
29816				( y1 < t && y2 > b ) // Surrounded vertically
29817			) && (
29818				( x1 >= l && x1 <= r ) || // Left edge touching
29819				( x2 >= l && x2 <= r ) || // Right edge touching
29820				( x1 < l && x2 > r ) // Surrounded horizontally
29821			);
29822		default:
29823			return false;
29824		}
29825	};
29826} )();
29827
29828/*
29829	This manager tracks offsets of draggables and droppables
29830*/
29831$.ui.ddmanager = {
29832	current: null,
29833	droppables: { "default": [] },
29834	prepareOffsets: function( t, event ) {
29835
29836		var i, j,
29837			m = $.ui.ddmanager.droppables[ t.options.scope ] || [],
29838			type = event ? event.type : null, // workaround for #2317
29839			list = ( t.currentItem || t.element ).find( ":data(ui-droppable)" ).addBack();
29840
29841		droppablesLoop: for ( i = 0; i < m.length; i++ ) {
29842
29843			// No disabled and non-accepted
29844			if ( m[ i ].options.disabled || ( t && !m[ i ].accept.call( m[ i ].element[ 0 ],
29845					( t.currentItem || t.element ) ) ) ) {
29846				continue;
29847			}
29848
29849			// Filter out elements in the current dragged item
29850			for ( j = 0; j < list.length; j++ ) {
29851				if ( list[ j ] === m[ i ].element[ 0 ] ) {
29852					m[ i ].proportions().height = 0;
29853					continue droppablesLoop;
29854				}
29855			}
29856
29857			m[ i ].visible = m[ i ].element.css( "display" ) !== "none";
29858			if ( !m[ i ].visible ) {
29859				continue;
29860			}
29861
29862			// Activate the droppable if used directly from draggables
29863			if ( type === "mousedown" ) {
29864				m[ i ]._activate.call( m[ i ], event );
29865			}
29866
29867			m[ i ].offset = m[ i ].element.offset();
29868			m[ i ].proportions( {
29869				width: m[ i ].element[ 0 ].offsetWidth,
29870				height: m[ i ].element[ 0 ].offsetHeight
29871			} );
29872
29873		}
29874
29875	},
29876	drop: function( draggable, event ) {
29877
29878		var dropped = false;
29879
29880		// Create a copy of the droppables in case the list changes during the drop (#9116)
29881		$.each( ( $.ui.ddmanager.droppables[ draggable.options.scope ] || [] ).slice(), function() {
29882
29883			if ( !this.options ) {
29884				return;
29885			}
29886			if ( !this.options.disabled && this.visible &&
29887					intersect( draggable, this, this.options.tolerance, event ) ) {
29888				dropped = this._drop.call( this, event ) || dropped;
29889			}
29890
29891			if ( !this.options.disabled && this.visible && this.accept.call( this.element[ 0 ],
29892					( draggable.currentItem || draggable.element ) ) ) {
29893				this.isout = true;
29894				this.isover = false;
29895				this._deactivate.call( this, event );
29896			}
29897
29898		} );
29899		return dropped;
29900
29901	},
29902	dragStart: function( draggable, event ) {
29903
29904		// Listen for scrolling so that if the dragging causes scrolling the position of the
29905		// droppables can be recalculated (see #5003)
29906		draggable.element.parentsUntil( "body" ).on( "scroll.droppable", function() {
29907			if ( !draggable.options.refreshPositions ) {
29908				$.ui.ddmanager.prepareOffsets( draggable, event );
29909			}
29910		} );
29911	},
29912	drag: function( draggable, event ) {
29913
29914		// If you have a highly dynamic page, you might try this option. It renders positions
29915		// every time you move the mouse.
29916		if ( draggable.options.refreshPositions ) {
29917			$.ui.ddmanager.prepareOffsets( draggable, event );
29918		}
29919
29920		// Run through all droppables and check their positions based on specific tolerance options
29921		$.each( $.ui.ddmanager.droppables[ draggable.options.scope ] || [], function() {
29922
29923			if ( this.options.disabled || this.greedyChild || !this.visible ) {
29924				return;
29925			}
29926
29927			var parentInstance, scope, parent,
29928				intersects = intersect( draggable, this, this.options.tolerance, event ),
29929				c = !intersects && this.isover ?
29930					"isout" :
29931					( intersects && !this.isover ? "isover" : null );
29932			if ( !c ) {
29933				return;
29934			}
29935
29936			if ( this.options.greedy ) {
29937
29938				// find droppable parents with same scope
29939				scope = this.options.scope;
29940				parent = this.element.parents( ":data(ui-droppable)" ).filter( function() {
29941					return $( this ).droppable( "instance" ).options.scope === scope;
29942				} );
29943
29944				if ( parent.length ) {
29945					parentInstance = $( parent[ 0 ] ).droppable( "instance" );
29946					parentInstance.greedyChild = ( c === "isover" );
29947				}
29948			}
29949
29950			// We just moved into a greedy child
29951			if ( parentInstance && c === "isover" ) {
29952				parentInstance.isover = false;
29953				parentInstance.isout = true;
29954				parentInstance._out.call( parentInstance, event );
29955			}
29956
29957			this[ c ] = true;
29958			this[ c === "isout" ? "isover" : "isout" ] = false;
29959			this[ c === "isover" ? "_over" : "_out" ].call( this, event );
29960
29961			// We just moved out of a greedy child
29962			if ( parentInstance && c === "isout" ) {
29963				parentInstance.isout = false;
29964				parentInstance.isover = true;
29965				parentInstance._over.call( parentInstance, event );
29966			}
29967		} );
29968
29969	},
29970	dragStop: function( draggable, event ) {
29971		draggable.element.parentsUntil( "body" ).off( "scroll.droppable" );
29972
29973		// Call prepareOffsets one final time since IE does not fire return scroll events when
29974		// overflow was caused by drag (see #5003)
29975		if ( !draggable.options.refreshPositions ) {
29976			$.ui.ddmanager.prepareOffsets( draggable, event );
29977		}
29978	}
29979};
29980
29981// DEPRECATED
29982// TODO: switch return back to widget declaration at top of file when this is removed
29983if ( $.uiBackCompat !== false ) {
29984
29985	// Backcompat for activeClass and hoverClass options
29986	$.widget( "ui.droppable", $.ui.droppable, {
29987		options: {
29988			hoverClass: false,
29989			activeClass: false
29990		},
29991		_addActiveClass: function() {
29992			this._super();
29993			if ( this.options.activeClass ) {
29994				this.element.addClass( this.options.activeClass );
29995			}
29996		},
29997		_removeActiveClass: function() {
29998			this._super();
29999			if ( this.options.activeClass ) {
30000				this.element.removeClass( this.options.activeClass );
30001			}
30002		},
30003		_addHoverClass: function() {
30004			this._super();
30005			if ( this.options.hoverClass ) {
30006				this.element.addClass( this.options.hoverClass );
30007			}
30008		},
30009		_removeHoverClass: function() {
30010			this._super();
30011			if ( this.options.hoverClass ) {
30012				this.element.removeClass( this.options.hoverClass );
30013			}
30014		}
30015	} );
30016}
30017
30018var widgetsDroppable = $.ui.droppable;
30019
30020
30021/*!
30022 * jQuery UI Progressbar 1.12.1
30023 * http://jqueryui.com
30024 *
30025 * Copyright jQuery Foundation and other contributors
30026 * Released under the MIT license.
30027 * http://jquery.org/license
30028 */
30029
30030//>>label: Progressbar
30031//>>group: Widgets
30032// jscs:disable maximumLineLength
30033//>>description: Displays a status indicator for loading state, standard percentage, and other progress indicators.
30034// jscs:enable maximumLineLength
30035//>>docs: http://api.jqueryui.com/progressbar/
30036//>>demos: http://jqueryui.com/progressbar/
30037//>>css.structure: ../../themes/base/core.css
30038//>>css.structure: ../../themes/base/progressbar.css
30039//>>css.theme: ../../themes/base/theme.css
30040
30041
30042
30043var widgetsProgressbar = $.widget( "ui.progressbar", {
30044	version: "1.12.1",
30045	options: {
30046		classes: {
30047			"ui-progressbar": "ui-corner-all",
30048			"ui-progressbar-value": "ui-corner-left",
30049			"ui-progressbar-complete": "ui-corner-right"
30050		},
30051		max: 100,
30052		value: 0,
30053
30054		change: null,
30055		complete: null
30056	},
30057
30058	min: 0,
30059
30060	_create: function() {
30061
30062		// Constrain initial value
30063		this.oldValue = this.options.value = this._constrainedValue();
30064
30065		this.element.attr( {
30066
30067			// Only set static values; aria-valuenow and aria-valuemax are
30068			// set inside _refreshValue()
30069			role: "progressbar",
30070			"aria-valuemin": this.min
30071		} );
30072		this._addClass( "ui-progressbar", "ui-widget ui-widget-content" );
30073
30074		this.valueDiv = $( "<div>" ).appendTo( this.element );
30075		this._addClass( this.valueDiv, "ui-progressbar-value", "ui-widget-header" );
30076		this._refreshValue();
30077	},
30078
30079	_destroy: function() {
30080		this.element.removeAttr( "role aria-valuemin aria-valuemax aria-valuenow" );
30081
30082		this.valueDiv.remove();
30083	},
30084
30085	value: function( newValue ) {
30086		if ( newValue === undefined ) {
30087			return this.options.value;
30088		}
30089
30090		this.options.value = this._constrainedValue( newValue );
30091		this._refreshValue();
30092	},
30093
30094	_constrainedValue: function( newValue ) {
30095		if ( newValue === undefined ) {
30096			newValue = this.options.value;
30097		}
30098
30099		this.indeterminate = newValue === false;
30100
30101		// Sanitize value
30102		if ( typeof newValue !== "number" ) {
30103			newValue = 0;
30104		}
30105
30106		return this.indeterminate ? false :
30107			Math.min( this.options.max, Math.max( this.min, newValue ) );
30108	},
30109
30110	_setOptions: function( options ) {
30111
30112		// Ensure "value" option is set after other values (like max)
30113		var value = options.value;
30114		delete options.value;
30115
30116		this._super( options );
30117
30118		this.options.value = this._constrainedValue( value );
30119		this._refreshValue();
30120	},
30121
30122	_setOption: function( key, value ) {
30123		if ( key === "max" ) {
30124
30125			// Don't allow a max less than min
30126			value = Math.max( this.min, value );
30127		}
30128		this._super( key, value );
30129	},
30130
30131	_setOptionDisabled: function( value ) {
30132		this._super( value );
30133
30134		this.element.attr( "aria-disabled", value );
30135		this._toggleClass( null, "ui-state-disabled", !!value );
30136	},
30137
30138	_percentage: function() {
30139		return this.indeterminate ?
30140			100 :
30141			100 * ( this.options.value - this.min ) / ( this.options.max - this.min );
30142	},
30143
30144	_refreshValue: function() {
30145		var value = this.options.value,
30146			percentage = this._percentage();
30147
30148		this.valueDiv
30149			.toggle( this.indeterminate || value > this.min )
30150			.width( percentage.toFixed( 0 ) + "%" );
30151
30152		this
30153			._toggleClass( this.valueDiv, "ui-progressbar-complete", null,
30154				value === this.options.max )
30155			._toggleClass( "ui-progressbar-indeterminate", null, this.indeterminate );
30156
30157		if ( this.indeterminate ) {
30158			this.element.removeAttr( "aria-valuenow" );
30159			if ( !this.overlayDiv ) {
30160				this.overlayDiv = $( "<div>" ).appendTo( this.valueDiv );
30161				this._addClass( this.overlayDiv, "ui-progressbar-overlay" );
30162			}
30163		} else {
30164			this.element.attr( {
30165				"aria-valuemax": this.options.max,
30166				"aria-valuenow": value
30167			} );
30168			if ( this.overlayDiv ) {
30169				this.overlayDiv.remove();
30170				this.overlayDiv = null;
30171			}
30172		}
30173
30174		if ( this.oldValue !== value ) {
30175			this.oldValue = value;
30176			this._trigger( "change" );
30177		}
30178		if ( value === this.options.max ) {
30179			this._trigger( "complete" );
30180		}
30181	}
30182} );
30183
30184
30185/*!
30186 * jQuery UI Selectable 1.12.1
30187 * http://jqueryui.com
30188 *
30189 * Copyright jQuery Foundation and other contributors
30190 * Released under the MIT license.
30191 * http://jquery.org/license
30192 */
30193
30194//>>label: Selectable
30195//>>group: Interactions
30196//>>description: Allows groups of elements to be selected with the mouse.
30197//>>docs: http://api.jqueryui.com/selectable/
30198//>>demos: http://jqueryui.com/selectable/
30199//>>css.structure: ../../themes/base/selectable.css
30200
30201
30202
30203var widgetsSelectable = $.widget( "ui.selectable", $.ui.mouse, {
30204	version: "1.12.1",
30205	options: {
30206		appendTo: "body",
30207		autoRefresh: true,
30208		distance: 0,
30209		filter: "*",
30210		tolerance: "touch",
30211
30212		// Callbacks
30213		selected: null,
30214		selecting: null,
30215		start: null,
30216		stop: null,
30217		unselected: null,
30218		unselecting: null
30219	},
30220	_create: function() {
30221		var that = this;
30222
30223		this._addClass( "ui-selectable" );
30224
30225		this.dragged = false;
30226
30227		// Cache selectee children based on filter
30228		this.refresh = function() {
30229			that.elementPos = $( that.element[ 0 ] ).offset();
30230			that.selectees = $( that.options.filter, that.element[ 0 ] );
30231			that._addClass( that.selectees, "ui-selectee" );
30232			that.selectees.each( function() {
30233				var $this = $( this ),
30234					selecteeOffset = $this.offset(),
30235					pos = {
30236						left: selecteeOffset.left - that.elementPos.left,
30237						top: selecteeOffset.top - that.elementPos.top
30238					};
30239				$.data( this, "selectable-item", {
30240					element: this,
30241					$element: $this,
30242					left: pos.left,
30243					top: pos.top,
30244					right: pos.left + $this.outerWidth(),
30245					bottom: pos.top + $this.outerHeight(),
30246					startselected: false,
30247					selected: $this.hasClass( "ui-selected" ),
30248					selecting: $this.hasClass( "ui-selecting" ),
30249					unselecting: $this.hasClass( "ui-unselecting" )
30250				} );
30251			} );
30252		};
30253		this.refresh();
30254
30255		this._mouseInit();
30256
30257		this.helper = $( "<div>" );
30258		this._addClass( this.helper, "ui-selectable-helper" );
30259	},
30260
30261	_destroy: function() {
30262		this.selectees.removeData( "selectable-item" );
30263		this._mouseDestroy();
30264	},
30265
30266	_mouseStart: function( event ) {
30267		var that = this,
30268			options = this.options;
30269
30270		this.opos = [ event.pageX, event.pageY ];
30271		this.elementPos = $( this.element[ 0 ] ).offset();
30272
30273		if ( this.options.disabled ) {
30274			return;
30275		}
30276
30277		this.selectees = $( options.filter, this.element[ 0 ] );
30278
30279		this._trigger( "start", event );
30280
30281		$( options.appendTo ).append( this.helper );
30282
30283		// position helper (lasso)
30284		this.helper.css( {
30285			"left": event.pageX,
30286			"top": event.pageY,
30287			"width": 0,
30288			"height": 0
30289		} );
30290
30291		if ( options.autoRefresh ) {
30292			this.refresh();
30293		}
30294
30295		this.selectees.filter( ".ui-selected" ).each( function() {
30296			var selectee = $.data( this, "selectable-item" );
30297			selectee.startselected = true;
30298			if ( !event.metaKey && !event.ctrlKey ) {
30299				that._removeClass( selectee.$element, "ui-selected" );
30300				selectee.selected = false;
30301				that._addClass( selectee.$element, "ui-unselecting" );
30302				selectee.unselecting = true;
30303
30304				// selectable UNSELECTING callback
30305				that._trigger( "unselecting", event, {
30306					unselecting: selectee.element
30307				} );
30308			}
30309		} );
30310
30311		$( event.target ).parents().addBack().each( function() {
30312			var doSelect,
30313				selectee = $.data( this, "selectable-item" );
30314			if ( selectee ) {
30315				doSelect = ( !event.metaKey && !event.ctrlKey ) ||
30316					!selectee.$element.hasClass( "ui-selected" );
30317				that._removeClass( selectee.$element, doSelect ? "ui-unselecting" : "ui-selected" )
30318					._addClass( selectee.$element, doSelect ? "ui-selecting" : "ui-unselecting" );
30319				selectee.unselecting = !doSelect;
30320				selectee.selecting = doSelect;
30321				selectee.selected = doSelect;
30322
30323				// selectable (UN)SELECTING callback
30324				if ( doSelect ) {
30325					that._trigger( "selecting", event, {
30326						selecting: selectee.element
30327					} );
30328				} else {
30329					that._trigger( "unselecting", event, {
30330						unselecting: selectee.element
30331					} );
30332				}
30333				return false;
30334			}
30335		} );
30336
30337	},
30338
30339	_mouseDrag: function( event ) {
30340
30341		this.dragged = true;
30342
30343		if ( this.options.disabled ) {
30344			return;
30345		}
30346
30347		var tmp,
30348			that = this,
30349			options = this.options,
30350			x1 = this.opos[ 0 ],
30351			y1 = this.opos[ 1 ],
30352			x2 = event.pageX,
30353			y2 = event.pageY;
30354
30355		if ( x1 > x2 ) { tmp = x2; x2 = x1; x1 = tmp; }
30356		if ( y1 > y2 ) { tmp = y2; y2 = y1; y1 = tmp; }
30357		this.helper.css( { left: x1, top: y1, width: x2 - x1, height: y2 - y1 } );
30358
30359		this.selectees.each( function() {
30360			var selectee = $.data( this, "selectable-item" ),
30361				hit = false,
30362				offset = {};
30363
30364			//prevent helper from being selected if appendTo: selectable
30365			if ( !selectee || selectee.element === that.element[ 0 ] ) {
30366				return;
30367			}
30368
30369			offset.left   = selectee.left   + that.elementPos.left;
30370			offset.right  = selectee.right  + that.elementPos.left;
30371			offset.top    = selectee.top    + that.elementPos.top;
30372			offset.bottom = selectee.bottom + that.elementPos.top;
30373
30374			if ( options.tolerance === "touch" ) {
30375				hit = ( !( offset.left > x2 || offset.right < x1 || offset.top > y2 ||
30376                    offset.bottom < y1 ) );
30377			} else if ( options.tolerance === "fit" ) {
30378				hit = ( offset.left > x1 && offset.right < x2 && offset.top > y1 &&
30379                    offset.bottom < y2 );
30380			}
30381
30382			if ( hit ) {
30383
30384				// SELECT
30385				if ( selectee.selected ) {
30386					that._removeClass( selectee.$element, "ui-selected" );
30387					selectee.selected = false;
30388				}
30389				if ( selectee.unselecting ) {
30390					that._removeClass( selectee.$element, "ui-unselecting" );
30391					selectee.unselecting = false;
30392				}
30393				if ( !selectee.selecting ) {
30394					that._addClass( selectee.$element, "ui-selecting" );
30395					selectee.selecting = true;
30396
30397					// selectable SELECTING callback
30398					that._trigger( "selecting", event, {
30399						selecting: selectee.element
30400					} );
30401				}
30402			} else {
30403
30404				// UNSELECT
30405				if ( selectee.selecting ) {
30406					if ( ( event.metaKey || event.ctrlKey ) && selectee.startselected ) {
30407						that._removeClass( selectee.$element, "ui-selecting" );
30408						selectee.selecting = false;
30409						that._addClass( selectee.$element, "ui-selected" );
30410						selectee.selected = true;
30411					} else {
30412						that._removeClass( selectee.$element, "ui-selecting" );
30413						selectee.selecting = false;
30414						if ( selectee.startselected ) {
30415							that._addClass( selectee.$element, "ui-unselecting" );
30416							selectee.unselecting = true;
30417						}
30418
30419						// selectable UNSELECTING callback
30420						that._trigger( "unselecting", event, {
30421							unselecting: selectee.element
30422						} );
30423					}
30424				}
30425				if ( selectee.selected ) {
30426					if ( !event.metaKey && !event.ctrlKey && !selectee.startselected ) {
30427						that._removeClass( selectee.$element, "ui-selected" );
30428						selectee.selected = false;
30429
30430						that._addClass( selectee.$element, "ui-unselecting" );
30431						selectee.unselecting = true;
30432
30433						// selectable UNSELECTING callback
30434						that._trigger( "unselecting", event, {
30435							unselecting: selectee.element
30436						} );
30437					}
30438				}
30439			}
30440		} );
30441
30442		return false;
30443	},
30444
30445	_mouseStop: function( event ) {
30446		var that = this;
30447
30448		this.dragged = false;
30449
30450		$( ".ui-unselecting", this.element[ 0 ] ).each( function() {
30451			var selectee = $.data( this, "selectable-item" );
30452			that._removeClass( selectee.$element, "ui-unselecting" );
30453			selectee.unselecting = false;
30454			selectee.startselected = false;
30455			that._trigger( "unselected", event, {
30456				unselected: selectee.element
30457			} );
30458		} );
30459		$( ".ui-selecting", this.element[ 0 ] ).each( function() {
30460			var selectee = $.data( this, "selectable-item" );
30461			that._removeClass( selectee.$element, "ui-selecting" )
30462				._addClass( selectee.$element, "ui-selected" );
30463			selectee.selecting = false;
30464			selectee.selected = true;
30465			selectee.startselected = true;
30466			that._trigger( "selected", event, {
30467				selected: selectee.element
30468			} );
30469		} );
30470		this._trigger( "stop", event );
30471
30472		this.helper.remove();
30473
30474		return false;
30475	}
30476
30477} );
30478
30479
30480/*!
30481 * jQuery UI Selectmenu 1.12.1
30482 * http://jqueryui.com
30483 *
30484 * Copyright jQuery Foundation and other contributors
30485 * Released under the MIT license.
30486 * http://jquery.org/license
30487 */
30488
30489//>>label: Selectmenu
30490//>>group: Widgets
30491// jscs:disable maximumLineLength
30492//>>description: Duplicates and extends the functionality of a native HTML select element, allowing it to be customizable in behavior and appearance far beyond the limitations of a native select.
30493// jscs:enable maximumLineLength
30494//>>docs: http://api.jqueryui.com/selectmenu/
30495//>>demos: http://jqueryui.com/selectmenu/
30496//>>css.structure: ../../themes/base/core.css
30497//>>css.structure: ../../themes/base/selectmenu.css, ../../themes/base/button.css
30498//>>css.theme: ../../themes/base/theme.css
30499
30500
30501
30502var widgetsSelectmenu = $.widget( "ui.selectmenu", [ $.ui.formResetMixin, {
30503	version: "1.12.1",
30504	defaultElement: "<select>",
30505	options: {
30506		appendTo: null,
30507		classes: {
30508			"ui-selectmenu-button-open": "ui-corner-top",
30509			"ui-selectmenu-button-closed": "ui-corner-all"
30510		},
30511		disabled: null,
30512		icons: {
30513			button: "ui-icon-triangle-1-s"
30514		},
30515		position: {
30516			my: "left top",
30517			at: "left bottom",
30518			collision: "none"
30519		},
30520		width: false,
30521
30522		// Callbacks
30523		change: null,
30524		close: null,
30525		focus: null,
30526		open: null,
30527		select: null
30528	},
30529
30530	_create: function() {
30531		var selectmenuId = this.element.uniqueId().attr( "id" );
30532		this.ids = {
30533			element: selectmenuId,
30534			button: selectmenuId + "-button",
30535			menu: selectmenuId + "-menu"
30536		};
30537
30538		this._drawButton();
30539		this._drawMenu();
30540		this._bindFormResetHandler();
30541
30542		this._rendered = false;
30543		this.menuItems = $();
30544	},
30545
30546	_drawButton: function() {
30547		var icon,
30548			that = this,
30549			item = this._parseOption(
30550				this.element.find( "option:selected" ),
30551				this.element[ 0 ].selectedIndex
30552			);
30553
30554		// Associate existing label with the new button
30555		this.labels = this.element.labels().attr( "for", this.ids.button );
30556		this._on( this.labels, {
30557			click: function( event ) {
30558				this.button.focus();
30559				event.preventDefault();
30560			}
30561		} );
30562
30563		// Hide original select element
30564		this.element.hide();
30565
30566		// Create button
30567		this.button = $( "<span>", {
30568			tabindex: this.options.disabled ? -1 : 0,
30569			id: this.ids.button,
30570			role: "combobox",
30571			"aria-expanded": "false",
30572			"aria-autocomplete": "list",
30573			"aria-owns": this.ids.menu,
30574			"aria-haspopup": "true",
30575			title: this.element.attr( "title" )
30576		} )
30577			.insertAfter( this.element );
30578
30579		this._addClass( this.button, "ui-selectmenu-button ui-selectmenu-button-closed",
30580			"ui-button ui-widget" );
30581
30582		icon = $( "<span>" ).appendTo( this.button );
30583		this._addClass( icon, "ui-selectmenu-icon", "ui-icon " + this.options.icons.button );
30584		this.buttonItem = this._renderButtonItem( item )
30585			.appendTo( this.button );
30586
30587		if ( this.options.width !== false ) {
30588			this._resizeButton();
30589		}
30590
30591		this._on( this.button, this._buttonEvents );
30592		this.button.one( "focusin", function() {
30593
30594			// Delay rendering the menu items until the button receives focus.
30595			// The menu may have already been rendered via a programmatic open.
30596			if ( !that._rendered ) {
30597				that._refreshMenu();
30598			}
30599		} );
30600	},
30601
30602	_drawMenu: function() {
30603		var that = this;
30604
30605		// Create menu
30606		this.menu = $( "<ul>", {
30607			"aria-hidden": "true",
30608			"aria-labelledby": this.ids.button,
30609			id: this.ids.menu
30610		} );
30611
30612		// Wrap menu
30613		this.menuWrap = $( "<div>" ).append( this.menu );
30614		this._addClass( this.menuWrap, "ui-selectmenu-menu", "ui-front" );
30615		this.menuWrap.appendTo( this._appendTo() );
30616
30617		// Initialize menu widget
30618		this.menuInstance = this.menu
30619			.menu( {
30620				classes: {
30621					"ui-menu": "ui-corner-bottom"
30622				},
30623				role: "listbox",
30624				select: function( event, ui ) {
30625					event.preventDefault();
30626
30627					// Support: IE8
30628					// If the item was selected via a click, the text selection
30629					// will be destroyed in IE
30630					that._setSelection();
30631
30632					that._select( ui.item.data( "ui-selectmenu-item" ), event );
30633				},
30634				focus: function( event, ui ) {
30635					var item = ui.item.data( "ui-selectmenu-item" );
30636
30637					// Prevent inital focus from firing and check if its a newly focused item
30638					if ( that.focusIndex != null && item.index !== that.focusIndex ) {
30639						that._trigger( "focus", event, { item: item } );
30640						if ( !that.isOpen ) {
30641							that._select( item, event );
30642						}
30643					}
30644					that.focusIndex = item.index;
30645
30646					that.button.attr( "aria-activedescendant",
30647						that.menuItems.eq( item.index ).attr( "id" ) );
30648				}
30649			} )
30650			.menu( "instance" );
30651
30652		// Don't close the menu on mouseleave
30653		this.menuInstance._off( this.menu, "mouseleave" );
30654
30655		// Cancel the menu's collapseAll on document click
30656		this.menuInstance._closeOnDocumentClick = function() {
30657			return false;
30658		};
30659
30660		// Selects often contain empty items, but never contain dividers
30661		this.menuInstance._isDivider = function() {
30662			return false;
30663		};
30664	},
30665
30666	refresh: function() {
30667		this._refreshMenu();
30668		this.buttonItem.replaceWith(
30669			this.buttonItem = this._renderButtonItem(
30670
30671				// Fall back to an empty object in case there are no options
30672				this._getSelectedItem().data( "ui-selectmenu-item" ) || {}
30673			)
30674		);
30675		if ( this.options.width === null ) {
30676			this._resizeButton();
30677		}
30678	},
30679
30680	_refreshMenu: function() {
30681		var item,
30682			options = this.element.find( "option" );
30683
30684		this.menu.empty();
30685
30686		this._parseOptions( options );
30687		this._renderMenu( this.menu, this.items );
30688
30689		this.menuInstance.refresh();
30690		this.menuItems = this.menu.find( "li" )
30691			.not( ".ui-selectmenu-optgroup" )
30692				.find( ".ui-menu-item-wrapper" );
30693
30694		this._rendered = true;
30695
30696		if ( !options.length ) {
30697			return;
30698		}
30699
30700		item = this._getSelectedItem();
30701
30702		// Update the menu to have the correct item focused
30703		this.menuInstance.focus( null, item );
30704		this._setAria( item.data( "ui-selectmenu-item" ) );
30705
30706		// Set disabled state
30707		this._setOption( "disabled", this.element.prop( "disabled" ) );
30708	},
30709
30710	open: function( event ) {
30711		if ( this.options.disabled ) {
30712			return;
30713		}
30714
30715		// If this is the first time the menu is being opened, render the items
30716		if ( !this._rendered ) {
30717			this._refreshMenu();
30718		} else {
30719
30720			// Menu clears focus on close, reset focus to selected item
30721			this._removeClass( this.menu.find( ".ui-state-active" ), null, "ui-state-active" );
30722			this.menuInstance.focus( null, this._getSelectedItem() );
30723		}
30724
30725		// If there are no options, don't open the menu
30726		if ( !this.menuItems.length ) {
30727			return;
30728		}
30729
30730		this.isOpen = true;
30731		this._toggleAttr();
30732		this._resizeMenu();
30733		this._position();
30734
30735		this._on( this.document, this._documentClick );
30736
30737		this._trigger( "open", event );
30738	},
30739
30740	_position: function() {
30741		this.menuWrap.position( $.extend( { of: this.button }, this.options.position ) );
30742	},
30743
30744	close: function( event ) {
30745		if ( !this.isOpen ) {
30746			return;
30747		}
30748
30749		this.isOpen = false;
30750		this._toggleAttr();
30751
30752		this.range = null;
30753		this._off( this.document );
30754
30755		this._trigger( "close", event );
30756	},
30757
30758	widget: function() {
30759		return this.button;
30760	},
30761
30762	menuWidget: function() {
30763		return this.menu;
30764	},
30765
30766	_renderButtonItem: function( item ) {
30767		var buttonItem = $( "<span>" );
30768
30769		this._setText( buttonItem, item.label );
30770		this._addClass( buttonItem, "ui-selectmenu-text" );
30771
30772		return buttonItem;
30773	},
30774
30775	_renderMenu: function( ul, items ) {
30776		var that = this,
30777			currentOptgroup = "";
30778
30779		$.each( items, function( index, item ) {
30780			var li;
30781
30782			if ( item.optgroup !== currentOptgroup ) {
30783				li = $( "<li>", {
30784					text: item.optgroup
30785				} );
30786				that._addClass( li, "ui-selectmenu-optgroup", "ui-menu-divider" +
30787					( item.element.parent( "optgroup" ).prop( "disabled" ) ?
30788						" ui-state-disabled" :
30789						"" ) );
30790
30791				li.appendTo( ul );
30792
30793				currentOptgroup = item.optgroup;
30794			}
30795
30796			that._renderItemData( ul, item );
30797		} );
30798	},
30799
30800	_renderItemData: function( ul, item ) {
30801		return this._renderItem( ul, item ).data( "ui-selectmenu-item", item );
30802	},
30803
30804	_renderItem: function( ul, item ) {
30805		var li = $( "<li>" ),
30806			wrapper = $( "<div>", {
30807				title: item.element.attr( "title" )
30808			} );
30809
30810		if ( item.disabled ) {
30811			this._addClass( li, null, "ui-state-disabled" );
30812		}
30813		this._setText( wrapper, item.label );
30814
30815		return li.append( wrapper ).appendTo( ul );
30816	},
30817
30818	_setText: function( element, value ) {
30819		if ( value ) {
30820			element.text( value );
30821		} else {
30822			element.html( "&#160;" );
30823		}
30824	},
30825
30826	_move: function( direction, event ) {
30827		var item, next,
30828			filter = ".ui-menu-item";
30829
30830		if ( this.isOpen ) {
30831			item = this.menuItems.eq( this.focusIndex ).parent( "li" );
30832		} else {
30833			item = this.menuItems.eq( this.element[ 0 ].selectedIndex ).parent( "li" );
30834			filter += ":not(.ui-state-disabled)";
30835		}
30836
30837		if ( direction === "first" || direction === "last" ) {
30838			next = item[ direction === "first" ? "prevAll" : "nextAll" ]( filter ).eq( -1 );
30839		} else {
30840			next = item[ direction + "All" ]( filter ).eq( 0 );
30841		}
30842
30843		if ( next.length ) {
30844			this.menuInstance.focus( event, next );
30845		}
30846	},
30847
30848	_getSelectedItem: function() {
30849		return this.menuItems.eq( this.element[ 0 ].selectedIndex ).parent( "li" );
30850	},
30851
30852	_toggle: function( event ) {
30853		this[ this.isOpen ? "close" : "open" ]( event );
30854	},
30855
30856	_setSelection: function() {
30857		var selection;
30858
30859		if ( !this.range ) {
30860			return;
30861		}
30862
30863		if ( window.getSelection ) {
30864			selection = window.getSelection();
30865			selection.removeAllRanges();
30866			selection.addRange( this.range );
30867
30868		// Support: IE8
30869		} else {
30870			this.range.select();
30871		}
30872
30873		// Support: IE
30874		// Setting the text selection kills the button focus in IE, but
30875		// restoring the focus doesn't kill the selection.
30876		this.button.focus();
30877	},
30878
30879	_documentClick: {
30880		mousedown: function( event ) {
30881			if ( !this.isOpen ) {
30882				return;
30883			}
30884
30885			if ( !$( event.target ).closest( ".ui-selectmenu-menu, #" +
30886					$.ui.escapeSelector( this.ids.button ) ).length ) {
30887				this.close( event );
30888			}
30889		}
30890	},
30891
30892	_buttonEvents: {
30893
30894		// Prevent text selection from being reset when interacting with the selectmenu (#10144)
30895		mousedown: function() {
30896			var selection;
30897
30898			if ( window.getSelection ) {
30899				selection = window.getSelection();
30900				if ( selection.rangeCount ) {
30901					this.range = selection.getRangeAt( 0 );
30902				}
30903
30904			// Support: IE8
30905			} else {
30906				this.range = document.selection.createRange();
30907			}
30908		},
30909
30910		click: function( event ) {
30911			this._setSelection();
30912			this._toggle( event );
30913		},
30914
30915		keydown: function( event ) {
30916			var preventDefault = true;
30917			switch ( event.keyCode ) {
30918			case $.ui.keyCode.TAB:
30919			case $.ui.keyCode.ESCAPE:
30920				this.close( event );
30921				preventDefault = false;
30922				break;
30923			case $.ui.keyCode.ENTER:
30924				if ( this.isOpen ) {
30925					this._selectFocusedItem( event );
30926				}
30927				break;
30928			case $.ui.keyCode.UP:
30929				if ( event.altKey ) {
30930					this._toggle( event );
30931				} else {
30932					this._move( "prev", event );
30933				}
30934				break;
30935			case $.ui.keyCode.DOWN:
30936				if ( event.altKey ) {
30937					this._toggle( event );
30938				} else {
30939					this._move( "next", event );
30940				}
30941				break;
30942			case $.ui.keyCode.SPACE:
30943				if ( this.isOpen ) {
30944					this._selectFocusedItem( event );
30945				} else {
30946					this._toggle( event );
30947				}
30948				break;
30949			case $.ui.keyCode.LEFT:
30950				this._move( "prev", event );
30951				break;
30952			case $.ui.keyCode.RIGHT:
30953				this._move( "next", event );
30954				break;
30955			case $.ui.keyCode.HOME:
30956			case $.ui.keyCode.PAGE_UP:
30957				this._move( "first", event );
30958				break;
30959			case $.ui.keyCode.END:
30960			case $.ui.keyCode.PAGE_DOWN:
30961				this._move( "last", event );
30962				break;
30963			default:
30964				this.menu.trigger( event );
30965				preventDefault = false;
30966			}
30967
30968			if ( preventDefault ) {
30969				event.preventDefault();
30970			}
30971		}
30972	},
30973
30974	_selectFocusedItem: function( event ) {
30975		var item = this.menuItems.eq( this.focusIndex ).parent( "li" );
30976		if ( !item.hasClass( "ui-state-disabled" ) ) {
30977			this._select( item.data( "ui-selectmenu-item" ), event );
30978		}
30979	},
30980
30981	_select: function( item, event ) {
30982		var oldIndex = this.element[ 0 ].selectedIndex;
30983
30984		// Change native select element
30985		this.element[ 0 ].selectedIndex = item.index;
30986		this.buttonItem.replaceWith( this.buttonItem = this._renderButtonItem( item ) );
30987		this._setAria( item );
30988		this._trigger( "select", event, { item: item } );
30989
30990		if ( item.index !== oldIndex ) {
30991			this._trigger( "change", event, { item: item } );
30992		}
30993
30994		this.close( event );
30995	},
30996
30997	_setAria: function( item ) {
30998		var id = this.menuItems.eq( item.index ).attr( "id" );
30999
31000		this.button.attr( {
31001			"aria-labelledby": id,
31002			"aria-activedescendant": id
31003		} );
31004		this.menu.attr( "aria-activedescendant", id );
31005	},
31006
31007	_setOption: function( key, value ) {
31008		if ( key === "icons" ) {
31009			var icon = this.button.find( "span.ui-icon" );
31010			this._removeClass( icon, null, this.options.icons.button )
31011				._addClass( icon, null, value.button );
31012		}
31013
31014		this._super( key, value );
31015
31016		if ( key === "appendTo" ) {
31017			this.menuWrap.appendTo( this._appendTo() );
31018		}
31019
31020		if ( key === "width" ) {
31021			this._resizeButton();
31022		}
31023	},
31024
31025	_setOptionDisabled: function( value ) {
31026		this._super( value );
31027
31028		this.menuInstance.option( "disabled", value );
31029		this.button.attr( "aria-disabled", value );
31030		this._toggleClass( this.button, null, "ui-state-disabled", value );
31031
31032		this.element.prop( "disabled", value );
31033		if ( value ) {
31034			this.button.attr( "tabindex", -1 );
31035			this.close();
31036		} else {
31037			this.button.attr( "tabindex", 0 );
31038		}
31039	},
31040
31041	_appendTo: function() {
31042		var element = this.options.appendTo;
31043
31044		if ( element ) {
31045			element = element.jquery || element.nodeType ?
31046				$( element ) :
31047				this.document.find( element ).eq( 0 );
31048		}
31049
31050		if ( !element || !element[ 0 ] ) {
31051			element = this.element.closest( ".ui-front, dialog" );
31052		}
31053
31054		if ( !element.length ) {
31055			element = this.document[ 0 ].body;
31056		}
31057
31058		return element;
31059	},
31060
31061	_toggleAttr: function() {
31062		this.button.attr( "aria-expanded", this.isOpen );
31063
31064		// We can't use two _toggleClass() calls here, because we need to make sure
31065		// we always remove classes first and add them second, otherwise if both classes have the
31066		// same theme class, it will be removed after we add it.
31067		this._removeClass( this.button, "ui-selectmenu-button-" +
31068			( this.isOpen ? "closed" : "open" ) )
31069			._addClass( this.button, "ui-selectmenu-button-" +
31070				( this.isOpen ? "open" : "closed" ) )
31071			._toggleClass( this.menuWrap, "ui-selectmenu-open", null, this.isOpen );
31072
31073		this.menu.attr( "aria-hidden", !this.isOpen );
31074	},
31075
31076	_resizeButton: function() {
31077		var width = this.options.width;
31078
31079		// For `width: false`, just remove inline style and stop
31080		if ( width === false ) {
31081			this.button.css( "width", "" );
31082			return;
31083		}
31084
31085		// For `width: null`, match the width of the original element
31086		if ( width === null ) {
31087			width = this.element.show().outerWidth();
31088			this.element.hide();
31089		}
31090
31091		this.button.outerWidth( width );
31092	},
31093
31094	_resizeMenu: function() {
31095		this.menu.outerWidth( Math.max(
31096			this.button.outerWidth(),
31097
31098			// Support: IE10
31099			// IE10 wraps long text (possibly a rounding bug)
31100			// so we add 1px to avoid the wrapping
31101			this.menu.width( "" ).outerWidth() + 1
31102		) );
31103	},
31104
31105	_getCreateOptions: function() {
31106		var options = this._super();
31107
31108		options.disabled = this.element.prop( "disabled" );
31109
31110		return options;
31111	},
31112
31113	_parseOptions: function( options ) {
31114		var that = this,
31115			data = [];
31116		options.each( function( index, item ) {
31117			data.push( that._parseOption( $( item ), index ) );
31118		} );
31119		this.items = data;
31120	},
31121
31122	_parseOption: function( option, index ) {
31123		var optgroup = option.parent( "optgroup" );
31124
31125		return {
31126			element: option,
31127			index: index,
31128			value: option.val(),
31129			label: option.text(),
31130			optgroup: optgroup.attr( "label" ) || "",
31131			disabled: optgroup.prop( "disabled" ) || option.prop( "disabled" )
31132		};
31133	},
31134
31135	_destroy: function() {
31136		this._unbindFormResetHandler();
31137		this.menuWrap.remove();
31138		this.button.remove();
31139		this.element.show();
31140		this.element.removeUniqueId();
31141		this.labels.attr( "for", this.ids.element );
31142	}
31143} ] );
31144
31145
31146/*!
31147 * jQuery UI Slider 1.12.1
31148 * http://jqueryui.com
31149 *
31150 * Copyright jQuery Foundation and other contributors
31151 * Released under the MIT license.
31152 * http://jquery.org/license
31153 */
31154
31155//>>label: Slider
31156//>>group: Widgets
31157//>>description: Displays a flexible slider with ranges and accessibility via keyboard.
31158//>>docs: http://api.jqueryui.com/slider/
31159//>>demos: http://jqueryui.com/slider/
31160//>>css.structure: ../../themes/base/core.css
31161//>>css.structure: ../../themes/base/slider.css
31162//>>css.theme: ../../themes/base/theme.css
31163
31164
31165
31166var widgetsSlider = $.widget( "ui.slider", $.ui.mouse, {
31167	version: "1.12.1",
31168	widgetEventPrefix: "slide",
31169
31170	options: {
31171		animate: false,
31172		classes: {
31173			"ui-slider": "ui-corner-all",
31174			"ui-slider-handle": "ui-corner-all",
31175
31176			// Note: ui-widget-header isn't the most fittingly semantic framework class for this
31177			// element, but worked best visually with a variety of themes
31178			"ui-slider-range": "ui-corner-all ui-widget-header"
31179		},
31180		distance: 0,
31181		max: 100,
31182		min: 0,
31183		orientation: "horizontal",
31184		range: false,
31185		step: 1,
31186		value: 0,
31187		values: null,
31188
31189		// Callbacks
31190		change: null,
31191		slide: null,
31192		start: null,
31193		stop: null
31194	},
31195
31196	// Number of pages in a slider
31197	// (how many times can you page up/down to go through the whole range)
31198	numPages: 5,
31199
31200	_create: function() {
31201		this._keySliding = false;
31202		this._mouseSliding = false;
31203		this._animateOff = true;
31204		this._handleIndex = null;
31205		this._detectOrientation();
31206		this._mouseInit();
31207		this._calculateNewMax();
31208
31209		this._addClass( "ui-slider ui-slider-" + this.orientation,
31210			"ui-widget ui-widget-content" );
31211
31212		this._refresh();
31213
31214		this._animateOff = false;
31215	},
31216
31217	_refresh: function() {
31218		this._createRange();
31219		this._createHandles();
31220		this._setupEvents();
31221		this._refreshValue();
31222	},
31223
31224	_createHandles: function() {
31225		var i, handleCount,
31226			options = this.options,
31227			existingHandles = this.element.find( ".ui-slider-handle" ),
31228			handle = "<span tabindex='0'></span>",
31229			handles = [];
31230
31231		handleCount = ( options.values && options.values.length ) || 1;
31232
31233		if ( existingHandles.length > handleCount ) {
31234			existingHandles.slice( handleCount ).remove();
31235			existingHandles = existingHandles.slice( 0, handleCount );
31236		}
31237
31238		for ( i = existingHandles.length; i < handleCount; i++ ) {
31239			handles.push( handle );
31240		}
31241
31242		this.handles = existingHandles.add( $( handles.join( "" ) ).appendTo( this.element ) );
31243
31244		this._addClass( this.handles, "ui-slider-handle", "ui-state-default" );
31245
31246		this.handle = this.handles.eq( 0 );
31247
31248		this.handles.each( function( i ) {
31249			$( this )
31250				.data( "ui-slider-handle-index", i )
31251				.attr( "tabIndex", 0 );
31252		} );
31253	},
31254
31255	_createRange: function() {
31256		var options = this.options;
31257
31258		if ( options.range ) {
31259			if ( options.range === true ) {
31260				if ( !options.values ) {
31261					options.values = [ this._valueMin(), this._valueMin() ];
31262				} else if ( options.values.length && options.values.length !== 2 ) {
31263					options.values = [ options.values[ 0 ], options.values[ 0 ] ];
31264				} else if ( $.isArray( options.values ) ) {
31265					options.values = options.values.slice( 0 );
31266				}
31267			}
31268
31269			if ( !this.range || !this.range.length ) {
31270				this.range = $( "<div>" )
31271					.appendTo( this.element );
31272
31273				this._addClass( this.range, "ui-slider-range" );
31274			} else {
31275				this._removeClass( this.range, "ui-slider-range-min ui-slider-range-max" );
31276
31277				// Handle range switching from true to min/max
31278				this.range.css( {
31279					"left": "",
31280					"bottom": ""
31281				} );
31282			}
31283			if ( options.range === "min" || options.range === "max" ) {
31284				this._addClass( this.range, "ui-slider-range-" + options.range );
31285			}
31286		} else {
31287			if ( this.range ) {
31288				this.range.remove();
31289			}
31290			this.range = null;
31291		}
31292	},
31293
31294	_setupEvents: function() {
31295		this._off( this.handles );
31296		this._on( this.handles, this._handleEvents );
31297		this._hoverable( this.handles );
31298		this._focusable( this.handles );
31299	},
31300
31301	_destroy: function() {
31302		this.handles.remove();
31303		if ( this.range ) {
31304			this.range.remove();
31305		}
31306
31307		this._mouseDestroy();
31308	},
31309
31310	_mouseCapture: function( event ) {
31311		var position, normValue, distance, closestHandle, index, allowed, offset, mouseOverHandle,
31312			that = this,
31313			o = this.options;
31314
31315		if ( o.disabled ) {
31316			return false;
31317		}
31318
31319		this.elementSize = {
31320			width: this.element.outerWidth(),
31321			height: this.element.outerHeight()
31322		};
31323		this.elementOffset = this.element.offset();
31324
31325		position = { x: event.pageX, y: event.pageY };
31326		normValue = this._normValueFromMouse( position );
31327		distance = this._valueMax() - this._valueMin() + 1;
31328		this.handles.each( function( i ) {
31329			var thisDistance = Math.abs( normValue - that.values( i ) );
31330			if ( ( distance > thisDistance ) ||
31331				( distance === thisDistance &&
31332					( i === that._lastChangedValue || that.values( i ) === o.min ) ) ) {
31333				distance = thisDistance;
31334				closestHandle = $( this );
31335				index = i;
31336			}
31337		} );
31338
31339		allowed = this._start( event, index );
31340		if ( allowed === false ) {
31341			return false;
31342		}
31343		this._mouseSliding = true;
31344
31345		this._handleIndex = index;
31346
31347		this._addClass( closestHandle, null, "ui-state-active" );
31348		closestHandle.trigger( "focus" );
31349
31350		offset = closestHandle.offset();
31351		mouseOverHandle = !$( event.target ).parents().addBack().is( ".ui-slider-handle" );
31352		this._clickOffset = mouseOverHandle ? { left: 0, top: 0 } : {
31353			left: event.pageX - offset.left - ( closestHandle.width() / 2 ),
31354			top: event.pageY - offset.top -
31355				( closestHandle.height() / 2 ) -
31356				( parseInt( closestHandle.css( "borderTopWidth" ), 10 ) || 0 ) -
31357				( parseInt( closestHandle.css( "borderBottomWidth" ), 10 ) || 0 ) +
31358				( parseInt( closestHandle.css( "marginTop" ), 10 ) || 0 )
31359		};
31360
31361		if ( !this.handles.hasClass( "ui-state-hover" ) ) {
31362			this._slide( event, index, normValue );
31363		}
31364		this._animateOff = true;
31365		return true;
31366	},
31367
31368	_mouseStart: function() {
31369		return true;
31370	},
31371
31372	_mouseDrag: function( event ) {
31373		var position = { x: event.pageX, y: event.pageY },
31374			normValue = this._normValueFromMouse( position );
31375
31376		this._slide( event, this._handleIndex, normValue );
31377
31378		return false;
31379	},
31380
31381	_mouseStop: function( event ) {
31382		this._removeClass( this.handles, null, "ui-state-active" );
31383		this._mouseSliding = false;
31384
31385		this._stop( event, this._handleIndex );
31386		this._change( event, this._handleIndex );
31387
31388		this._handleIndex = null;
31389		this._clickOffset = null;
31390		this._animateOff = false;
31391
31392		return false;
31393	},
31394
31395	_detectOrientation: function() {
31396		this.orientation = ( this.options.orientation === "vertical" ) ? "vertical" : "horizontal";
31397	},
31398
31399	_normValueFromMouse: function( position ) {
31400		var pixelTotal,
31401			pixelMouse,
31402			percentMouse,
31403			valueTotal,
31404			valueMouse;
31405
31406		if ( this.orientation === "horizontal" ) {
31407			pixelTotal = this.elementSize.width;
31408			pixelMouse = position.x - this.elementOffset.left -
31409				( this._clickOffset ? this._clickOffset.left : 0 );
31410		} else {
31411			pixelTotal = this.elementSize.height;
31412			pixelMouse = position.y - this.elementOffset.top -
31413				( this._clickOffset ? this._clickOffset.top : 0 );
31414		}
31415
31416		percentMouse = ( pixelMouse / pixelTotal );
31417		if ( percentMouse > 1 ) {
31418			percentMouse = 1;
31419		}
31420		if ( percentMouse < 0 ) {
31421			percentMouse = 0;
31422		}
31423		if ( this.orientation === "vertical" ) {
31424			percentMouse = 1 - percentMouse;
31425		}
31426
31427		valueTotal = this._valueMax() - this._valueMin();
31428		valueMouse = this._valueMin() + percentMouse * valueTotal;
31429
31430		return this._trimAlignValue( valueMouse );
31431	},
31432
31433	_uiHash: function( index, value, values ) {
31434		var uiHash = {
31435			handle: this.handles[ index ],
31436			handleIndex: index,
31437			value: value !== undefined ? value : this.value()
31438		};
31439
31440		if ( this._hasMultipleValues() ) {
31441			uiHash.value = value !== undefined ? value : this.values( index );
31442			uiHash.values = values || this.values();
31443		}
31444
31445		return uiHash;
31446	},
31447
31448	_hasMultipleValues: function() {
31449		return this.options.values && this.options.values.length;
31450	},
31451
31452	_start: function( event, index ) {
31453		return this._trigger( "start", event, this._uiHash( index ) );
31454	},
31455
31456	_slide: function( event, index, newVal ) {
31457		var allowed, otherVal,
31458			currentValue = this.value(),
31459			newValues = this.values();
31460
31461		if ( this._hasMultipleValues() ) {
31462			otherVal = this.values( index ? 0 : 1 );
31463			currentValue = this.values( index );
31464
31465			if ( this.options.values.length === 2 && this.options.range === true ) {
31466				newVal =  index === 0 ? Math.min( otherVal, newVal ) : Math.max( otherVal, newVal );
31467			}
31468
31469			newValues[ index ] = newVal;
31470		}
31471
31472		if ( newVal === currentValue ) {
31473			return;
31474		}
31475
31476		allowed = this._trigger( "slide", event, this._uiHash( index, newVal, newValues ) );
31477
31478		// A slide can be canceled by returning false from the slide callback
31479		if ( allowed === false ) {
31480			return;
31481		}
31482
31483		if ( this._hasMultipleValues() ) {
31484			this.values( index, newVal );
31485		} else {
31486			this.value( newVal );
31487		}
31488	},
31489
31490	_stop: function( event, index ) {
31491		this._trigger( "stop", event, this._uiHash( index ) );
31492	},
31493
31494	_change: function( event, index ) {
31495		if ( !this._keySliding && !this._mouseSliding ) {
31496
31497			//store the last changed value index for reference when handles overlap
31498			this._lastChangedValue = index;
31499			this._trigger( "change", event, this._uiHash( index ) );
31500		}
31501	},
31502
31503	value: function( newValue ) {
31504		if ( arguments.length ) {
31505			this.options.value = this._trimAlignValue( newValue );
31506			this._refreshValue();
31507			this._change( null, 0 );
31508			return;
31509		}
31510
31511		return this._value();
31512	},
31513
31514	values: function( index, newValue ) {
31515		var vals,
31516			newValues,
31517			i;
31518
31519		if ( arguments.length > 1 ) {
31520			this.options.values[ index ] = this._trimAlignValue( newValue );
31521			this._refreshValue();
31522			this._change( null, index );
31523			return;
31524		}
31525
31526		if ( arguments.length ) {
31527			if ( $.isArray( arguments[ 0 ] ) ) {
31528				vals = this.options.values;
31529				newValues = arguments[ 0 ];
31530				for ( i = 0; i < vals.length; i += 1 ) {
31531					vals[ i ] = this._trimAlignValue( newValues[ i ] );
31532					this._change( null, i );
31533				}
31534				this._refreshValue();
31535			} else {
31536				if ( this._hasMultipleValues() ) {
31537					return this._values( index );
31538				} else {
31539					return this.value();
31540				}
31541			}
31542		} else {
31543			return this._values();
31544		}
31545	},
31546
31547	_setOption: function( key, value ) {
31548		var i,
31549			valsLength = 0;
31550
31551		if ( key === "range" && this.options.range === true ) {
31552			if ( value === "min" ) {
31553				this.options.value = this._values( 0 );
31554				this.options.values = null;
31555			} else if ( value === "max" ) {
31556				this.options.value = this._values( this.options.values.length - 1 );
31557				this.options.values = null;
31558			}
31559		}
31560
31561		if ( $.isArray( this.options.values ) ) {
31562			valsLength = this.options.values.length;
31563		}
31564
31565		this._super( key, value );
31566
31567		switch ( key ) {
31568			case "orientation":
31569				this._detectOrientation();
31570				this._removeClass( "ui-slider-horizontal ui-slider-vertical" )
31571					._addClass( "ui-slider-" + this.orientation );
31572				this._refreshValue();
31573				if ( this.options.range ) {
31574					this._refreshRange( value );
31575				}
31576
31577				// Reset positioning from previous orientation
31578				this.handles.css( value === "horizontal" ? "bottom" : "left", "" );
31579				break;
31580			case "value":
31581				this._animateOff = true;
31582				this._refreshValue();
31583				this._change( null, 0 );
31584				this._animateOff = false;
31585				break;
31586			case "values":
31587				this._animateOff = true;
31588				this._refreshValue();
31589
31590				// Start from the last handle to prevent unreachable handles (#9046)
31591				for ( i = valsLength - 1; i >= 0; i-- ) {
31592					this._change( null, i );
31593				}
31594				this._animateOff = false;
31595				break;
31596			case "step":
31597			case "min":
31598			case "max":
31599				this._animateOff = true;
31600				this._calculateNewMax();
31601				this._refreshValue();
31602				this._animateOff = false;
31603				break;
31604			case "range":
31605				this._animateOff = true;
31606				this._refresh();
31607				this._animateOff = false;
31608				break;
31609		}
31610	},
31611
31612	_setOptionDisabled: function( value ) {
31613		this._super( value );
31614
31615		this._toggleClass( null, "ui-state-disabled", !!value );
31616	},
31617
31618	//internal value getter
31619	// _value() returns value trimmed by min and max, aligned by step
31620	_value: function() {
31621		var val = this.options.value;
31622		val = this._trimAlignValue( val );
31623
31624		return val;
31625	},
31626
31627	//internal values getter
31628	// _values() returns array of values trimmed by min and max, aligned by step
31629	// _values( index ) returns single value trimmed by min and max, aligned by step
31630	_values: function( index ) {
31631		var val,
31632			vals,
31633			i;
31634
31635		if ( arguments.length ) {
31636			val = this.options.values[ index ];
31637			val = this._trimAlignValue( val );
31638
31639			return val;
31640		} else if ( this._hasMultipleValues() ) {
31641
31642			// .slice() creates a copy of the array
31643			// this copy gets trimmed by min and max and then returned
31644			vals = this.options.values.slice();
31645			for ( i = 0; i < vals.length; i += 1 ) {
31646				vals[ i ] = this._trimAlignValue( vals[ i ] );
31647			}
31648
31649			return vals;
31650		} else {
31651			return [];
31652		}
31653	},
31654
31655	// Returns the step-aligned value that val is closest to, between (inclusive) min and max
31656	_trimAlignValue: function( val ) {
31657		if ( val <= this._valueMin() ) {
31658			return this._valueMin();
31659		}
31660		if ( val >= this._valueMax() ) {
31661			return this._valueMax();
31662		}
31663		var step = ( this.options.step > 0 ) ? this.options.step : 1,
31664			valModStep = ( val - this._valueMin() ) % step,
31665			alignValue = val - valModStep;
31666
31667		if ( Math.abs( valModStep ) * 2 >= step ) {
31668			alignValue += ( valModStep > 0 ) ? step : ( -step );
31669		}
31670
31671		// Since JavaScript has problems with large floats, round
31672		// the final value to 5 digits after the decimal point (see #4124)
31673		return parseFloat( alignValue.toFixed( 5 ) );
31674	},
31675
31676	_calculateNewMax: function() {
31677		var max = this.options.max,
31678			min = this._valueMin(),
31679			step = this.options.step,
31680			aboveMin = Math.round( ( max - min ) / step ) * step;
31681		max = aboveMin + min;
31682		if ( max > this.options.max ) {
31683
31684			//If max is not divisible by step, rounding off may increase its value
31685			max -= step;
31686		}
31687		this.max = parseFloat( max.toFixed( this._precision() ) );
31688	},
31689
31690	_precision: function() {
31691		var precision = this._precisionOf( this.options.step );
31692		if ( this.options.min !== null ) {
31693			precision = Math.max( precision, this._precisionOf( this.options.min ) );
31694		}
31695		return precision;
31696	},
31697
31698	_precisionOf: function( num ) {
31699		var str = num.toString(),
31700			decimal = str.indexOf( "." );
31701		return decimal === -1 ? 0 : str.length - decimal - 1;
31702	},
31703
31704	_valueMin: function() {
31705		return this.options.min;
31706	},
31707
31708	_valueMax: function() {
31709		return this.max;
31710	},
31711
31712	_refreshRange: function( orientation ) {
31713		if ( orientation === "vertical" ) {
31714			this.range.css( { "width": "", "left": "" } );
31715		}
31716		if ( orientation === "horizontal" ) {
31717			this.range.css( { "height": "", "bottom": "" } );
31718		}
31719	},
31720
31721	_refreshValue: function() {
31722		var lastValPercent, valPercent, value, valueMin, valueMax,
31723			oRange = this.options.range,
31724			o = this.options,
31725			that = this,
31726			animate = ( !this._animateOff ) ? o.animate : false,
31727			_set = {};
31728
31729		if ( this._hasMultipleValues() ) {
31730			this.handles.each( function( i ) {
31731				valPercent = ( that.values( i ) - that._valueMin() ) / ( that._valueMax() -
31732					that._valueMin() ) * 100;
31733				_set[ that.orientation === "horizontal" ? "left" : "bottom" ] = valPercent + "%";
31734				$( this ).stop( 1, 1 )[ animate ? "animate" : "css" ]( _set, o.animate );
31735				if ( that.options.range === true ) {
31736					if ( that.orientation === "horizontal" ) {
31737						if ( i === 0 ) {
31738							that.range.stop( 1, 1 )[ animate ? "animate" : "css" ]( {
31739								left: valPercent + "%"
31740							}, o.animate );
31741						}
31742						if ( i === 1 ) {
31743							that.range[ animate ? "animate" : "css" ]( {
31744								width: ( valPercent - lastValPercent ) + "%"
31745							}, {
31746								queue: false,
31747								duration: o.animate
31748							} );
31749						}
31750					} else {
31751						if ( i === 0 ) {
31752							that.range.stop( 1, 1 )[ animate ? "animate" : "css" ]( {
31753								bottom: ( valPercent ) + "%"
31754							}, o.animate );
31755						}
31756						if ( i === 1 ) {
31757							that.range[ animate ? "animate" : "css" ]( {
31758								height: ( valPercent - lastValPercent ) + "%"
31759							}, {
31760								queue: false,
31761								duration: o.animate
31762							} );
31763						}
31764					}
31765				}
31766				lastValPercent = valPercent;
31767			} );
31768		} else {
31769			value = this.value();
31770			valueMin = this._valueMin();
31771			valueMax = this._valueMax();
31772			valPercent = ( valueMax !== valueMin ) ?
31773					( value - valueMin ) / ( valueMax - valueMin ) * 100 :
31774					0;
31775			_set[ this.orientation === "horizontal" ? "left" : "bottom" ] = valPercent + "%";
31776			this.handle.stop( 1, 1 )[ animate ? "animate" : "css" ]( _set, o.animate );
31777
31778			if ( oRange === "min" && this.orientation === "horizontal" ) {
31779				this.range.stop( 1, 1 )[ animate ? "animate" : "css" ]( {
31780					width: valPercent + "%"
31781				}, o.animate );
31782			}
31783			if ( oRange === "max" && this.orientation === "horizontal" ) {
31784				this.range.stop( 1, 1 )[ animate ? "animate" : "css" ]( {
31785					width: ( 100 - valPercent ) + "%"
31786				}, o.animate );
31787			}
31788			if ( oRange === "min" && this.orientation === "vertical" ) {
31789				this.range.stop( 1, 1 )[ animate ? "animate" : "css" ]( {
31790					height: valPercent + "%"
31791				}, o.animate );
31792			}
31793			if ( oRange === "max" && this.orientation === "vertical" ) {
31794				this.range.stop( 1, 1 )[ animate ? "animate" : "css" ]( {
31795					height: ( 100 - valPercent ) + "%"
31796				}, o.animate );
31797			}
31798		}
31799	},
31800
31801	_handleEvents: {
31802		keydown: function( event ) {
31803			var allowed, curVal, newVal, step,
31804				index = $( event.target ).data( "ui-slider-handle-index" );
31805
31806			switch ( event.keyCode ) {
31807				case $.ui.keyCode.HOME:
31808				case $.ui.keyCode.END:
31809				case $.ui.keyCode.PAGE_UP:
31810				case $.ui.keyCode.PAGE_DOWN:
31811				case $.ui.keyCode.UP:
31812				case $.ui.keyCode.RIGHT:
31813				case $.ui.keyCode.DOWN:
31814				case $.ui.keyCode.LEFT:
31815					event.preventDefault();
31816					if ( !this._keySliding ) {
31817						this._keySliding = true;
31818						this._addClass( $( event.target ), null, "ui-state-active" );
31819						allowed = this._start( event, index );
31820						if ( allowed === false ) {
31821							return;
31822						}
31823					}
31824					break;
31825			}
31826
31827			step = this.options.step;
31828			if ( this._hasMultipleValues() ) {
31829				curVal = newVal = this.values( index );
31830			} else {
31831				curVal = newVal = this.value();
31832			}
31833
31834			switch ( event.keyCode ) {
31835				case $.ui.keyCode.HOME:
31836					newVal = this._valueMin();
31837					break;
31838				case $.ui.keyCode.END:
31839					newVal = this._valueMax();
31840					break;
31841				case $.ui.keyCode.PAGE_UP:
31842					newVal = this._trimAlignValue(
31843						curVal + ( ( this._valueMax() - this._valueMin() ) / this.numPages )
31844					);
31845					break;
31846				case $.ui.keyCode.PAGE_DOWN:
31847					newVal = this._trimAlignValue(
31848						curVal - ( ( this._valueMax() - this._valueMin() ) / this.numPages ) );
31849					break;
31850				case $.ui.keyCode.UP:
31851				case $.ui.keyCode.RIGHT:
31852					if ( curVal === this._valueMax() ) {
31853						return;
31854					}
31855					newVal = this._trimAlignValue( curVal + step );
31856					break;
31857				case $.ui.keyCode.DOWN:
31858				case $.ui.keyCode.LEFT:
31859					if ( curVal === this._valueMin() ) {
31860						return;
31861					}
31862					newVal = this._trimAlignValue( curVal - step );
31863					break;
31864			}
31865
31866			this._slide( event, index, newVal );
31867		},
31868		keyup: function( event ) {
31869			var index = $( event.target ).data( "ui-slider-handle-index" );
31870
31871			if ( this._keySliding ) {
31872				this._keySliding = false;
31873				this._stop( event, index );
31874				this._change( event, index );
31875				this._removeClass( $( event.target ), null, "ui-state-active" );
31876			}
31877		}
31878	}
31879} );
31880
31881
31882/*!
31883 * jQuery UI Sortable 1.12.1
31884 * http://jqueryui.com
31885 *
31886 * Copyright jQuery Foundation and other contributors
31887 * Released under the MIT license.
31888 * http://jquery.org/license
31889 */
31890
31891//>>label: Sortable
31892//>>group: Interactions
31893//>>description: Enables items in a list to be sorted using the mouse.
31894//>>docs: http://api.jqueryui.com/sortable/
31895//>>demos: http://jqueryui.com/sortable/
31896//>>css.structure: ../../themes/base/sortable.css
31897
31898
31899
31900var widgetsSortable = $.widget( "ui.sortable", $.ui.mouse, {
31901	version: "1.12.1",
31902	widgetEventPrefix: "sort",
31903	ready: false,
31904	options: {
31905		appendTo: "parent",
31906		axis: false,
31907		connectWith: false,
31908		containment: false,
31909		cursor: "auto",
31910		cursorAt: false,
31911		dropOnEmpty: true,
31912		forcePlaceholderSize: false,
31913		forceHelperSize: false,
31914		grid: false,
31915		handle: false,
31916		helper: "original",
31917		items: "> *",
31918		opacity: false,
31919		placeholder: false,
31920		revert: false,
31921		scroll: true,
31922		scrollSensitivity: 20,
31923		scrollSpeed: 20,
31924		scope: "default",
31925		tolerance: "intersect",
31926		zIndex: 1000,
31927
31928		// Callbacks
31929		activate: null,
31930		beforeStop: null,
31931		change: null,
31932		deactivate: null,
31933		out: null,
31934		over: null,
31935		receive: null,
31936		remove: null,
31937		sort: null,
31938		start: null,
31939		stop: null,
31940		update: null
31941	},
31942
31943	_isOverAxis: function( x, reference, size ) {
31944		return ( x >= reference ) && ( x < ( reference + size ) );
31945	},
31946
31947	_isFloating: function( item ) {
31948		return ( /left|right/ ).test( item.css( "float" ) ) ||
31949			( /inline|table-cell/ ).test( item.css( "display" ) );
31950	},
31951
31952	_create: function() {
31953		this.containerCache = {};
31954		this._addClass( "ui-sortable" );
31955
31956		//Get the items
31957		this.refresh();
31958
31959		//Let's determine the parent's offset
31960		this.offset = this.element.offset();
31961
31962		//Initialize mouse events for interaction
31963		this._mouseInit();
31964
31965		this._setHandleClassName();
31966
31967		//We're ready to go
31968		this.ready = true;
31969
31970	},
31971
31972	_setOption: function( key, value ) {
31973		this._super( key, value );
31974
31975		if ( key === "handle" ) {
31976			this._setHandleClassName();
31977		}
31978	},
31979
31980	_setHandleClassName: function() {
31981		var that = this;
31982		this._removeClass( this.element.find( ".ui-sortable-handle" ), "ui-sortable-handle" );
31983		$.each( this.items, function() {
31984			that._addClass(
31985				this.instance.options.handle ?
31986					this.item.find( this.instance.options.handle ) :
31987					this.item,
31988				"ui-sortable-handle"
31989			);
31990		} );
31991	},
31992
31993	_destroy: function() {
31994		this._mouseDestroy();
31995
31996		for ( var i = this.items.length - 1; i >= 0; i-- ) {
31997			this.items[ i ].item.removeData( this.widgetName + "-item" );
31998		}
31999
32000		return this;
32001	},
32002
32003	_mouseCapture: function( event, overrideHandle ) {
32004		var currentItem = null,
32005			validHandle = false,
32006			that = this;
32007
32008		if ( this.reverting ) {
32009			return false;
32010		}
32011
32012		if ( this.options.disabled || this.options.type === "static" ) {
32013			return false;
32014		}
32015
32016		//We have to refresh the items data once first
32017		this._refreshItems( event );
32018
32019		//Find out if the clicked node (or one of its parents) is a actual item in this.items
32020		$( event.target ).parents().each( function() {
32021			if ( $.data( this, that.widgetName + "-item" ) === that ) {
32022				currentItem = $( this );
32023				return false;
32024			}
32025		} );
32026		if ( $.data( event.target, that.widgetName + "-item" ) === that ) {
32027			currentItem = $( event.target );
32028		}
32029
32030		if ( !currentItem ) {
32031			return false;
32032		}
32033		if ( this.options.handle && !overrideHandle ) {
32034			$( this.options.handle, currentItem ).find( "*" ).addBack().each( function() {
32035				if ( this === event.target ) {
32036					validHandle = true;
32037				}
32038			} );
32039			if ( !validHandle ) {
32040				return false;
32041			}
32042		}
32043
32044		this.currentItem = currentItem;
32045		this._removeCurrentsFromItems();
32046		return true;
32047
32048	},
32049
32050	_mouseStart: function( event, overrideHandle, noActivation ) {
32051
32052		var i, body,
32053			o = this.options;
32054
32055		this.currentContainer = this;
32056
32057		//We only need to call refreshPositions, because the refreshItems call has been moved to
32058		// mouseCapture
32059		this.refreshPositions();
32060
32061		//Create and append the visible helper
32062		this.helper = this._createHelper( event );
32063
32064		//Cache the helper size
32065		this._cacheHelperProportions();
32066
32067		/*
32068		 * - Position generation -
32069		 * This block generates everything position related - it's the core of draggables.
32070		 */
32071
32072		//Cache the margins of the original element
32073		this._cacheMargins();
32074
32075		//Get the next scrolling parent
32076		this.scrollParent = this.helper.scrollParent();
32077
32078		//The element's absolute position on the page minus margins
32079		this.offset = this.currentItem.offset();
32080		this.offset = {
32081			top: this.offset.top - this.margins.top,
32082			left: this.offset.left - this.margins.left
32083		};
32084
32085		$.extend( this.offset, {
32086			click: { //Where the click happened, relative to the element
32087				left: event.pageX - this.offset.left,
32088				top: event.pageY - this.offset.top
32089			},
32090			parent: this._getParentOffset(),
32091
32092			// This is a relative to absolute position minus the actual position calculation -
32093			// only used for relative positioned helper
32094			relative: this._getRelativeOffset()
32095		} );
32096
32097		// Only after we got the offset, we can change the helper's position to absolute
32098		// TODO: Still need to figure out a way to make relative sorting possible
32099		this.helper.css( "position", "absolute" );
32100		this.cssPosition = this.helper.css( "position" );
32101
32102		//Generate the original position
32103		this.originalPosition = this._generatePosition( event );
32104		this.originalPageX = event.pageX;
32105		this.originalPageY = event.pageY;
32106
32107		//Adjust the mouse offset relative to the helper if "cursorAt" is supplied
32108		( o.cursorAt && this._adjustOffsetFromHelper( o.cursorAt ) );
32109
32110		//Cache the former DOM position
32111		this.domPosition = {
32112			prev: this.currentItem.prev()[ 0 ],
32113			parent: this.currentItem.parent()[ 0 ]
32114		};
32115
32116		// If the helper is not the original, hide the original so it's not playing any role during
32117		// the drag, won't cause anything bad this way
32118		if ( this.helper[ 0 ] !== this.currentItem[ 0 ] ) {
32119			this.currentItem.hide();
32120		}
32121
32122		//Create the placeholder
32123		this._createPlaceholder();
32124
32125		//Set a containment if given in the options
32126		if ( o.containment ) {
32127			this._setContainment();
32128		}
32129
32130		if ( o.cursor && o.cursor !== "auto" ) { // cursor option
32131			body = this.document.find( "body" );
32132
32133			// Support: IE
32134			this.storedCursor = body.css( "cursor" );
32135			body.css( "cursor", o.cursor );
32136
32137			this.storedStylesheet =
32138				$( "<style>*{ cursor: " + o.cursor + " !important; }</style>" ).appendTo( body );
32139		}
32140
32141		if ( o.opacity ) { // opacity option
32142			if ( this.helper.css( "opacity" ) ) {
32143				this._storedOpacity = this.helper.css( "opacity" );
32144			}
32145			this.helper.css( "opacity", o.opacity );
32146		}
32147
32148		if ( o.zIndex ) { // zIndex option
32149			if ( this.helper.css( "zIndex" ) ) {
32150				this._storedZIndex = this.helper.css( "zIndex" );
32151			}
32152			this.helper.css( "zIndex", o.zIndex );
32153		}
32154
32155		//Prepare scrolling
32156		if ( this.scrollParent[ 0 ] !== this.document[ 0 ] &&
32157				this.scrollParent[ 0 ].tagName !== "HTML" ) {
32158			this.overflowOffset = this.scrollParent.offset();
32159		}
32160
32161		//Call callbacks
32162		this._trigger( "start", event, this._uiHash() );
32163
32164		//Recache the helper size
32165		if ( !this._preserveHelperProportions ) {
32166			this._cacheHelperProportions();
32167		}
32168
32169		//Post "activate" events to possible containers
32170		if ( !noActivation ) {
32171			for ( i = this.containers.length - 1; i >= 0; i-- ) {
32172				this.containers[ i ]._trigger( "activate", event, this._uiHash( this ) );
32173			}
32174		}
32175
32176		//Prepare possible droppables
32177		if ( $.ui.ddmanager ) {
32178			$.ui.ddmanager.current = this;
32179		}
32180
32181		if ( $.ui.ddmanager && !o.dropBehaviour ) {
32182			$.ui.ddmanager.prepareOffsets( this, event );
32183		}
32184
32185		this.dragging = true;
32186
32187		this._addClass( this.helper, "ui-sortable-helper" );
32188
32189		// Execute the drag once - this causes the helper not to be visiblebefore getting its
32190		// correct position
32191		this._mouseDrag( event );
32192		return true;
32193
32194	},
32195
32196	_mouseDrag: function( event ) {
32197		var i, item, itemElement, intersection,
32198			o = this.options,
32199			scrolled = false;
32200
32201		//Compute the helpers position
32202		this.position = this._generatePosition( event );
32203		this.positionAbs = this._convertPositionTo( "absolute" );
32204
32205		if ( !this.lastPositionAbs ) {
32206			this.lastPositionAbs = this.positionAbs;
32207		}
32208
32209		//Do scrolling
32210		if ( this.options.scroll ) {
32211			if ( this.scrollParent[ 0 ] !== this.document[ 0 ] &&
32212					this.scrollParent[ 0 ].tagName !== "HTML" ) {
32213
32214				if ( ( this.overflowOffset.top + this.scrollParent[ 0 ].offsetHeight ) -
32215						event.pageY < o.scrollSensitivity ) {
32216					this.scrollParent[ 0 ].scrollTop =
32217						scrolled = this.scrollParent[ 0 ].scrollTop + o.scrollSpeed;
32218				} else if ( event.pageY - this.overflowOffset.top < o.scrollSensitivity ) {
32219					this.scrollParent[ 0 ].scrollTop =
32220						scrolled = this.scrollParent[ 0 ].scrollTop - o.scrollSpeed;
32221				}
32222
32223				if ( ( this.overflowOffset.left + this.scrollParent[ 0 ].offsetWidth ) -
32224						event.pageX < o.scrollSensitivity ) {
32225					this.scrollParent[ 0 ].scrollLeft = scrolled =
32226						this.scrollParent[ 0 ].scrollLeft + o.scrollSpeed;
32227				} else if ( event.pageX - this.overflowOffset.left < o.scrollSensitivity ) {
32228					this.scrollParent[ 0 ].scrollLeft = scrolled =
32229						this.scrollParent[ 0 ].scrollLeft - o.scrollSpeed;
32230				}
32231
32232			} else {
32233
32234				if ( event.pageY - this.document.scrollTop() < o.scrollSensitivity ) {
32235					scrolled = this.document.scrollTop( this.document.scrollTop() - o.scrollSpeed );
32236				} else if ( this.window.height() - ( event.pageY - this.document.scrollTop() ) <
32237						o.scrollSensitivity ) {
32238					scrolled = this.document.scrollTop( this.document.scrollTop() + o.scrollSpeed );
32239				}
32240
32241				if ( event.pageX - this.document.scrollLeft() < o.scrollSensitivity ) {
32242					scrolled = this.document.scrollLeft(
32243						this.document.scrollLeft() - o.scrollSpeed
32244					);
32245				} else if ( this.window.width() - ( event.pageX - this.document.scrollLeft() ) <
32246						o.scrollSensitivity ) {
32247					scrolled = this.document.scrollLeft(
32248						this.document.scrollLeft() + o.scrollSpeed
32249					);
32250				}
32251
32252			}
32253
32254			if ( scrolled !== false && $.ui.ddmanager && !o.dropBehaviour ) {
32255				$.ui.ddmanager.prepareOffsets( this, event );
32256			}
32257		}
32258
32259		//Regenerate the absolute position used for position checks
32260		this.positionAbs = this._convertPositionTo( "absolute" );
32261
32262		//Set the helper position
32263		if ( !this.options.axis || this.options.axis !== "y" ) {
32264			this.helper[ 0 ].style.left = this.position.left + "px";
32265		}
32266		if ( !this.options.axis || this.options.axis !== "x" ) {
32267			this.helper[ 0 ].style.top = this.position.top + "px";
32268		}
32269
32270		//Rearrange
32271		for ( i = this.items.length - 1; i >= 0; i-- ) {
32272
32273			//Cache variables and intersection, continue if no intersection
32274			item = this.items[ i ];
32275			itemElement = item.item[ 0 ];
32276			intersection = this._intersectsWithPointer( item );
32277			if ( !intersection ) {
32278				continue;
32279			}
32280
32281			// Only put the placeholder inside the current Container, skip all
32282			// items from other containers. This works because when moving
32283			// an item from one container to another the
32284			// currentContainer is switched before the placeholder is moved.
32285			//
32286			// Without this, moving items in "sub-sortables" can cause
32287			// the placeholder to jitter between the outer and inner container.
32288			if ( item.instance !== this.currentContainer ) {
32289				continue;
32290			}
32291
32292			// Cannot intersect with itself
32293			// no useless actions that have been done before
32294			// no action if the item moved is the parent of the item checked
32295			if ( itemElement !== this.currentItem[ 0 ] &&
32296				this.placeholder[ intersection === 1 ? "next" : "prev" ]()[ 0 ] !== itemElement &&
32297				!$.contains( this.placeholder[ 0 ], itemElement ) &&
32298				( this.options.type === "semi-dynamic" ?
32299					!$.contains( this.element[ 0 ], itemElement ) :
32300					true
32301				)
32302			) {
32303
32304				this.direction = intersection === 1 ? "down" : "up";
32305
32306				if ( this.options.tolerance === "pointer" || this._intersectsWithSides( item ) ) {
32307					this._rearrange( event, item );
32308				} else {
32309					break;
32310				}
32311
32312				this._trigger( "change", event, this._uiHash() );
32313				break;
32314			}
32315		}
32316
32317		//Post events to containers
32318		this._contactContainers( event );
32319
32320		//Interconnect with droppables
32321		if ( $.ui.ddmanager ) {
32322			$.ui.ddmanager.drag( this, event );
32323		}
32324
32325		//Call callbacks
32326		this._trigger( "sort", event, this._uiHash() );
32327
32328		this.lastPositionAbs = this.positionAbs;
32329		return false;
32330
32331	},
32332
32333	_mouseStop: function( event, noPropagation ) {
32334
32335		if ( !event ) {
32336			return;
32337		}
32338
32339		//If we are using droppables, inform the manager about the drop
32340		if ( $.ui.ddmanager && !this.options.dropBehaviour ) {
32341			$.ui.ddmanager.drop( this, event );
32342		}
32343
32344		if ( this.options.revert ) {
32345			var that = this,
32346				cur = this.placeholder.offset(),
32347				axis = this.options.axis,
32348				animation = {};
32349
32350			if ( !axis || axis === "x" ) {
32351				animation.left = cur.left - this.offset.parent.left - this.margins.left +
32352					( this.offsetParent[ 0 ] === this.document[ 0 ].body ?
32353						0 :
32354						this.offsetParent[ 0 ].scrollLeft
32355					);
32356			}
32357			if ( !axis || axis === "y" ) {
32358				animation.top = cur.top - this.offset.parent.top - this.margins.top +
32359					( this.offsetParent[ 0 ] === this.document[ 0 ].body ?
32360						0 :
32361						this.offsetParent[ 0 ].scrollTop
32362					);
32363			}
32364			this.reverting = true;
32365			$( this.helper ).animate(
32366				animation,
32367				parseInt( this.options.revert, 10 ) || 500,
32368				function() {
32369					that._clear( event );
32370				}
32371			);
32372		} else {
32373			this._clear( event, noPropagation );
32374		}
32375
32376		return false;
32377
32378	},
32379
32380	cancel: function() {
32381
32382		if ( this.dragging ) {
32383
32384			this._mouseUp( new $.Event( "mouseup", { target: null } ) );
32385
32386			if ( this.options.helper === "original" ) {
32387				this.currentItem.css( this._storedCSS );
32388				this._removeClass( this.currentItem, "ui-sortable-helper" );
32389			} else {
32390				this.currentItem.show();
32391			}
32392
32393			//Post deactivating events to containers
32394			for ( var i = this.containers.length - 1; i >= 0; i-- ) {
32395				this.containers[ i ]._trigger( "deactivate", null, this._uiHash( this ) );
32396				if ( this.containers[ i ].containerCache.over ) {
32397					this.containers[ i ]._trigger( "out", null, this._uiHash( this ) );
32398					this.containers[ i ].containerCache.over = 0;
32399				}
32400			}
32401
32402		}
32403
32404		if ( this.placeholder ) {
32405
32406			//$(this.placeholder[0]).remove(); would have been the jQuery way - unfortunately,
32407			// it unbinds ALL events from the original node!
32408			if ( this.placeholder[ 0 ].parentNode ) {
32409				this.placeholder[ 0 ].parentNode.removeChild( this.placeholder[ 0 ] );
32410			}
32411			if ( this.options.helper !== "original" && this.helper &&
32412					this.helper[ 0 ].parentNode ) {
32413				this.helper.remove();
32414			}
32415
32416			$.extend( this, {
32417				helper: null,
32418				dragging: false,
32419				reverting: false,
32420				_noFinalSort: null
32421			} );
32422
32423			if ( this.domPosition.prev ) {
32424				$( this.domPosition.prev ).after( this.currentItem );
32425			} else {
32426				$( this.domPosition.parent ).prepend( this.currentItem );
32427			}
32428		}
32429
32430		return this;
32431
32432	},
32433
32434	serialize: function( o ) {
32435
32436		var items = this._getItemsAsjQuery( o && o.connected ),
32437			str = [];
32438		o = o || {};
32439
32440		$( items ).each( function() {
32441			var res = ( $( o.item || this ).attr( o.attribute || "id" ) || "" )
32442				.match( o.expression || ( /(.+)[\-=_](.+)/ ) );
32443			if ( res ) {
32444				str.push(
32445					( o.key || res[ 1 ] + "[]" ) +
32446					"=" + ( o.key && o.expression ? res[ 1 ] : res[ 2 ] ) );
32447			}
32448		} );
32449
32450		if ( !str.length && o.key ) {
32451			str.push( o.key + "=" );
32452		}
32453
32454		return str.join( "&" );
32455
32456	},
32457
32458	toArray: function( o ) {
32459
32460		var items = this._getItemsAsjQuery( o && o.connected ),
32461			ret = [];
32462
32463		o = o || {};
32464
32465		items.each( function() {
32466			ret.push( $( o.item || this ).attr( o.attribute || "id" ) || "" );
32467		} );
32468		return ret;
32469
32470	},
32471
32472	/* Be careful with the following core functions */
32473	_intersectsWith: function( item ) {
32474
32475		var x1 = this.positionAbs.left,
32476			x2 = x1 + this.helperProportions.width,
32477			y1 = this.positionAbs.top,
32478			y2 = y1 + this.helperProportions.height,
32479			l = item.left,
32480			r = l + item.width,
32481			t = item.top,
32482			b = t + item.height,
32483			dyClick = this.offset.click.top,
32484			dxClick = this.offset.click.left,
32485			isOverElementHeight = ( this.options.axis === "x" ) || ( ( y1 + dyClick ) > t &&
32486				( y1 + dyClick ) < b ),
32487			isOverElementWidth = ( this.options.axis === "y" ) || ( ( x1 + dxClick ) > l &&
32488				( x1 + dxClick ) < r ),
32489			isOverElement = isOverElementHeight && isOverElementWidth;
32490
32491		if ( this.options.tolerance === "pointer" ||
32492			this.options.forcePointerForContainers ||
32493			( this.options.tolerance !== "pointer" &&
32494				this.helperProportions[ this.floating ? "width" : "height" ] >
32495				item[ this.floating ? "width" : "height" ] )
32496		) {
32497			return isOverElement;
32498		} else {
32499
32500			return ( l < x1 + ( this.helperProportions.width / 2 ) && // Right Half
32501				x2 - ( this.helperProportions.width / 2 ) < r && // Left Half
32502				t < y1 + ( this.helperProportions.height / 2 ) && // Bottom Half
32503				y2 - ( this.helperProportions.height / 2 ) < b ); // Top Half
32504
32505		}
32506	},
32507
32508	_intersectsWithPointer: function( item ) {
32509		var verticalDirection, horizontalDirection,
32510			isOverElementHeight = ( this.options.axis === "x" ) ||
32511				this._isOverAxis(
32512					this.positionAbs.top + this.offset.click.top, item.top, item.height ),
32513			isOverElementWidth = ( this.options.axis === "y" ) ||
32514				this._isOverAxis(
32515					this.positionAbs.left + this.offset.click.left, item.left, item.width ),
32516			isOverElement = isOverElementHeight && isOverElementWidth;
32517
32518		if ( !isOverElement ) {
32519			return false;
32520		}
32521
32522		verticalDirection = this._getDragVerticalDirection();
32523		horizontalDirection = this._getDragHorizontalDirection();
32524
32525		return this.floating ?
32526			( ( horizontalDirection === "right" || verticalDirection === "down" ) ? 2 : 1 )
32527			: ( verticalDirection && ( verticalDirection === "down" ? 2 : 1 ) );
32528
32529	},
32530
32531	_intersectsWithSides: function( item ) {
32532
32533		var isOverBottomHalf = this._isOverAxis( this.positionAbs.top +
32534				this.offset.click.top, item.top + ( item.height / 2 ), item.height ),
32535			isOverRightHalf = this._isOverAxis( this.positionAbs.left +
32536				this.offset.click.left, item.left + ( item.width / 2 ), item.width ),
32537			verticalDirection = this._getDragVerticalDirection(),
32538			horizontalDirection = this._getDragHorizontalDirection();
32539
32540		if ( this.floating && horizontalDirection ) {
32541			return ( ( horizontalDirection === "right" && isOverRightHalf ) ||
32542				( horizontalDirection === "left" && !isOverRightHalf ) );
32543		} else {
32544			return verticalDirection && ( ( verticalDirection === "down" && isOverBottomHalf ) ||
32545				( verticalDirection === "up" && !isOverBottomHalf ) );
32546		}
32547
32548	},
32549
32550	_getDragVerticalDirection: function() {
32551		var delta = this.positionAbs.top - this.lastPositionAbs.top;
32552		return delta !== 0 && ( delta > 0 ? "down" : "up" );
32553	},
32554
32555	_getDragHorizontalDirection: function() {
32556		var delta = this.positionAbs.left - this.lastPositionAbs.left;
32557		return delta !== 0 && ( delta > 0 ? "right" : "left" );
32558	},
32559
32560	refresh: function( event ) {
32561		this._refreshItems( event );
32562		this._setHandleClassName();
32563		this.refreshPositions();
32564		return this;
32565	},
32566
32567	_connectWith: function() {
32568		var options = this.options;
32569		return options.connectWith.constructor === String ?
32570			[ options.connectWith ] :
32571			options.connectWith;
32572	},
32573
32574	_getItemsAsjQuery: function( connected ) {
32575
32576		var i, j, cur, inst,
32577			items = [],
32578			queries = [],
32579			connectWith = this._connectWith();
32580
32581		if ( connectWith && connected ) {
32582			for ( i = connectWith.length - 1; i >= 0; i-- ) {
32583				cur = $( connectWith[ i ], this.document[ 0 ] );
32584				for ( j = cur.length - 1; j >= 0; j-- ) {
32585					inst = $.data( cur[ j ], this.widgetFullName );
32586					if ( inst && inst !== this && !inst.options.disabled ) {
32587						queries.push( [ $.isFunction( inst.options.items ) ?
32588							inst.options.items.call( inst.element ) :
32589							$( inst.options.items, inst.element )
32590								.not( ".ui-sortable-helper" )
32591								.not( ".ui-sortable-placeholder" ), inst ] );
32592					}
32593				}
32594			}
32595		}
32596
32597		queries.push( [ $.isFunction( this.options.items ) ?
32598			this.options.items
32599				.call( this.element, null, { options: this.options, item: this.currentItem } ) :
32600			$( this.options.items, this.element )
32601				.not( ".ui-sortable-helper" )
32602				.not( ".ui-sortable-placeholder" ), this ] );
32603
32604		function addItems() {
32605			items.push( this );
32606		}
32607		for ( i = queries.length - 1; i >= 0; i-- ) {
32608			queries[ i ][ 0 ].each( addItems );
32609		}
32610
32611		return $( items );
32612
32613	},
32614
32615	_removeCurrentsFromItems: function() {
32616
32617		var list = this.currentItem.find( ":data(" + this.widgetName + "-item)" );
32618
32619		this.items = $.grep( this.items, function( item ) {
32620			for ( var j = 0; j < list.length; j++ ) {
32621				if ( list[ j ] === item.item[ 0 ] ) {
32622					return false;
32623				}
32624			}
32625			return true;
32626		} );
32627
32628	},
32629
32630	_refreshItems: function( event ) {
32631
32632		this.items = [];
32633		this.containers = [ this ];
32634
32635		var i, j, cur, inst, targetData, _queries, item, queriesLength,
32636			items = this.items,
32637			queries = [ [ $.isFunction( this.options.items ) ?
32638				this.options.items.call( this.element[ 0 ], event, { item: this.currentItem } ) :
32639				$( this.options.items, this.element ), this ] ],
32640			connectWith = this._connectWith();
32641
32642		//Shouldn't be run the first time through due to massive slow-down
32643		if ( connectWith && this.ready ) {
32644			for ( i = connectWith.length - 1; i >= 0; i-- ) {
32645				cur = $( connectWith[ i ], this.document[ 0 ] );
32646				for ( j = cur.length - 1; j >= 0; j-- ) {
32647					inst = $.data( cur[ j ], this.widgetFullName );
32648					if ( inst && inst !== this && !inst.options.disabled ) {
32649						queries.push( [ $.isFunction( inst.options.items ) ?
32650							inst.options.items
32651								.call( inst.element[ 0 ], event, { item: this.currentItem } ) :
32652							$( inst.options.items, inst.element ), inst ] );
32653						this.containers.push( inst );
32654					}
32655				}
32656			}
32657		}
32658
32659		for ( i = queries.length - 1; i >= 0; i-- ) {
32660			targetData = queries[ i ][ 1 ];
32661			_queries = queries[ i ][ 0 ];
32662
32663			for ( j = 0, queriesLength = _queries.length; j < queriesLength; j++ ) {
32664				item = $( _queries[ j ] );
32665
32666				// Data for target checking (mouse manager)
32667				item.data( this.widgetName + "-item", targetData );
32668
32669				items.push( {
32670					item: item,
32671					instance: targetData,
32672					width: 0, height: 0,
32673					left: 0, top: 0
32674				} );
32675			}
32676		}
32677
32678	},
32679
32680	refreshPositions: function( fast ) {
32681
32682		// Determine whether items are being displayed horizontally
32683		this.floating = this.items.length ?
32684			this.options.axis === "x" || this._isFloating( this.items[ 0 ].item ) :
32685			false;
32686
32687		//This has to be redone because due to the item being moved out/into the offsetParent,
32688		// the offsetParent's position will change
32689		if ( this.offsetParent && this.helper ) {
32690			this.offset.parent = this._getParentOffset();
32691		}
32692
32693		var i, item, t, p;
32694
32695		for ( i = this.items.length - 1; i >= 0; i-- ) {
32696			item = this.items[ i ];
32697
32698			//We ignore calculating positions of all connected containers when we're not over them
32699			if ( item.instance !== this.currentContainer && this.currentContainer &&
32700					item.item[ 0 ] !== this.currentItem[ 0 ] ) {
32701				continue;
32702			}
32703
32704			t = this.options.toleranceElement ?
32705				$( this.options.toleranceElement, item.item ) :
32706				item.item;
32707
32708			if ( !fast ) {
32709				item.width = t.outerWidth();
32710				item.height = t.outerHeight();
32711			}
32712
32713			p = t.offset();
32714			item.left = p.left;
32715			item.top = p.top;
32716		}
32717
32718		if ( this.options.custom && this.options.custom.refreshContainers ) {
32719			this.options.custom.refreshContainers.call( this );
32720		} else {
32721			for ( i = this.containers.length - 1; i >= 0; i-- ) {
32722				p = this.containers[ i ].element.offset();
32723				this.containers[ i ].containerCache.left = p.left;
32724				this.containers[ i ].containerCache.top = p.top;
32725				this.containers[ i ].containerCache.width =
32726					this.containers[ i ].element.outerWidth();
32727				this.containers[ i ].containerCache.height =
32728					this.containers[ i ].element.outerHeight();
32729			}
32730		}
32731
32732		return this;
32733	},
32734
32735	_createPlaceholder: function( that ) {
32736		that = that || this;
32737		var className,
32738			o = that.options;
32739
32740		if ( !o.placeholder || o.placeholder.constructor === String ) {
32741			className = o.placeholder;
32742			o.placeholder = {
32743				element: function() {
32744
32745					var nodeName = that.currentItem[ 0 ].nodeName.toLowerCase(),
32746						element = $( "<" + nodeName + ">", that.document[ 0 ] );
32747
32748						that._addClass( element, "ui-sortable-placeholder",
32749								className || that.currentItem[ 0 ].className )
32750							._removeClass( element, "ui-sortable-helper" );
32751
32752					if ( nodeName === "tbody" ) {
32753						that._createTrPlaceholder(
32754							that.currentItem.find( "tr" ).eq( 0 ),
32755							$( "<tr>", that.document[ 0 ] ).appendTo( element )
32756						);
32757					} else if ( nodeName === "tr" ) {
32758						that._createTrPlaceholder( that.currentItem, element );
32759					} else if ( nodeName === "img" ) {
32760						element.attr( "src", that.currentItem.attr( "src" ) );
32761					}
32762
32763					if ( !className ) {
32764						element.css( "visibility", "hidden" );
32765					}
32766
32767					return element;
32768				},
32769				update: function( container, p ) {
32770
32771					// 1. If a className is set as 'placeholder option, we don't force sizes -
32772					// the class is responsible for that
32773					// 2. The option 'forcePlaceholderSize can be enabled to force it even if a
32774					// class name is specified
32775					if ( className && !o.forcePlaceholderSize ) {
32776						return;
32777					}
32778
32779					//If the element doesn't have a actual height by itself (without styles coming
32780					// from a stylesheet), it receives the inline height from the dragged item
32781					if ( !p.height() ) {
32782						p.height(
32783							that.currentItem.innerHeight() -
32784							parseInt( that.currentItem.css( "paddingTop" ) || 0, 10 ) -
32785							parseInt( that.currentItem.css( "paddingBottom" ) || 0, 10 ) );
32786					}
32787					if ( !p.width() ) {
32788						p.width(
32789							that.currentItem.innerWidth() -
32790							parseInt( that.currentItem.css( "paddingLeft" ) || 0, 10 ) -
32791							parseInt( that.currentItem.css( "paddingRight" ) || 0, 10 ) );
32792					}
32793				}
32794			};
32795		}
32796
32797		//Create the placeholder
32798		that.placeholder = $( o.placeholder.element.call( that.element, that.currentItem ) );
32799
32800		//Append it after the actual current item
32801		that.currentItem.after( that.placeholder );
32802
32803		//Update the size of the placeholder (TODO: Logic to fuzzy, see line 316/317)
32804		o.placeholder.update( that, that.placeholder );
32805
32806	},
32807
32808	_createTrPlaceholder: function( sourceTr, targetTr ) {
32809		var that = this;
32810
32811		sourceTr.children().each( function() {
32812			$( "<td>&#160;</td>", that.document[ 0 ] )
32813				.attr( "colspan", $( this ).attr( "colspan" ) || 1 )
32814				.appendTo( targetTr );
32815		} );
32816	},
32817
32818	_contactContainers: function( event ) {
32819		var i, j, dist, itemWithLeastDistance, posProperty, sizeProperty, cur, nearBottom,
32820			floating, axis,
32821			innermostContainer = null,
32822			innermostIndex = null;
32823
32824		// Get innermost container that intersects with item
32825		for ( i = this.containers.length - 1; i >= 0; i-- ) {
32826
32827			// Never consider a container that's located within the item itself
32828			if ( $.contains( this.currentItem[ 0 ], this.containers[ i ].element[ 0 ] ) ) {
32829				continue;
32830			}
32831
32832			if ( this._intersectsWith( this.containers[ i ].containerCache ) ) {
32833
32834				// If we've already found a container and it's more "inner" than this, then continue
32835				if ( innermostContainer &&
32836						$.contains(
32837							this.containers[ i ].element[ 0 ],
32838							innermostContainer.element[ 0 ] ) ) {
32839					continue;
32840				}
32841
32842				innermostContainer = this.containers[ i ];
32843				innermostIndex = i;
32844
32845			} else {
32846
32847				// container doesn't intersect. trigger "out" event if necessary
32848				if ( this.containers[ i ].containerCache.over ) {
32849					this.containers[ i ]._trigger( "out", event, this._uiHash( this ) );
32850					this.containers[ i ].containerCache.over = 0;
32851				}
32852			}
32853
32854		}
32855
32856		// If no intersecting containers found, return
32857		if ( !innermostContainer ) {
32858			return;
32859		}
32860
32861		// Move the item into the container if it's not there already
32862		if ( this.containers.length === 1 ) {
32863			if ( !this.containers[ innermostIndex ].containerCache.over ) {
32864				this.containers[ innermostIndex ]._trigger( "over", event, this._uiHash( this ) );
32865				this.containers[ innermostIndex ].containerCache.over = 1;
32866			}
32867		} else {
32868
32869			// When entering a new container, we will find the item with the least distance and
32870			// append our item near it
32871			dist = 10000;
32872			itemWithLeastDistance = null;
32873			floating = innermostContainer.floating || this._isFloating( this.currentItem );
32874			posProperty = floating ? "left" : "top";
32875			sizeProperty = floating ? "width" : "height";
32876			axis = floating ? "pageX" : "pageY";
32877
32878			for ( j = this.items.length - 1; j >= 0; j-- ) {
32879				if ( !$.contains(
32880						this.containers[ innermostIndex ].element[ 0 ], this.items[ j ].item[ 0 ] )
32881				) {
32882					continue;
32883				}
32884				if ( this.items[ j ].item[ 0 ] === this.currentItem[ 0 ] ) {
32885					continue;
32886				}
32887
32888				cur = this.items[ j ].item.offset()[ posProperty ];
32889				nearBottom = false;
32890				if ( event[ axis ] - cur > this.items[ j ][ sizeProperty ] / 2 ) {
32891					nearBottom = true;
32892				}
32893
32894				if ( Math.abs( event[ axis ] - cur ) < dist ) {
32895					dist = Math.abs( event[ axis ] - cur );
32896					itemWithLeastDistance = this.items[ j ];
32897					this.direction = nearBottom ? "up" : "down";
32898				}
32899			}
32900
32901			//Check if dropOnEmpty is enabled
32902			if ( !itemWithLeastDistance && !this.options.dropOnEmpty ) {
32903				return;
32904			}
32905
32906			if ( this.currentContainer === this.containers[ innermostIndex ] ) {
32907				if ( !this.currentContainer.containerCache.over ) {
32908					this.containers[ innermostIndex ]._trigger( "over", event, this._uiHash() );
32909					this.currentContainer.containerCache.over = 1;
32910				}
32911				return;
32912			}
32913
32914			itemWithLeastDistance ?
32915				this._rearrange( event, itemWithLeastDistance, null, true ) :
32916				this._rearrange( event, null, this.containers[ innermostIndex ].element, true );
32917			this._trigger( "change", event, this._uiHash() );
32918			this.containers[ innermostIndex ]._trigger( "change", event, this._uiHash( this ) );
32919			this.currentContainer = this.containers[ innermostIndex ];
32920
32921			//Update the placeholder
32922			this.options.placeholder.update( this.currentContainer, this.placeholder );
32923
32924			this.containers[ innermostIndex ]._trigger( "over", event, this._uiHash( this ) );
32925			this.containers[ innermostIndex ].containerCache.over = 1;
32926		}
32927
32928	},
32929
32930	_createHelper: function( event ) {
32931
32932		var o = this.options,
32933			helper = $.isFunction( o.helper ) ?
32934				$( o.helper.apply( this.element[ 0 ], [ event, this.currentItem ] ) ) :
32935				( o.helper === "clone" ? this.currentItem.clone() : this.currentItem );
32936
32937		//Add the helper to the DOM if that didn't happen already
32938		if ( !helper.parents( "body" ).length ) {
32939			$( o.appendTo !== "parent" ?
32940				o.appendTo :
32941				this.currentItem[ 0 ].parentNode )[ 0 ].appendChild( helper[ 0 ] );
32942		}
32943
32944		if ( helper[ 0 ] === this.currentItem[ 0 ] ) {
32945			this._storedCSS = {
32946				width: this.currentItem[ 0 ].style.width,
32947				height: this.currentItem[ 0 ].style.height,
32948				position: this.currentItem.css( "position" ),
32949				top: this.currentItem.css( "top" ),
32950				left: this.currentItem.css( "left" )
32951			};
32952		}
32953
32954		if ( !helper[ 0 ].style.width || o.forceHelperSize ) {
32955			helper.width( this.currentItem.width() );
32956		}
32957		if ( !helper[ 0 ].style.height || o.forceHelperSize ) {
32958			helper.height( this.currentItem.height() );
32959		}
32960
32961		return helper;
32962
32963	},
32964
32965	_adjustOffsetFromHelper: function( obj ) {
32966		if ( typeof obj === "string" ) {
32967			obj = obj.split( " " );
32968		}
32969		if ( $.isArray( obj ) ) {
32970			obj = { left: +obj[ 0 ], top: +obj[ 1 ] || 0 };
32971		}
32972		if ( "left" in obj ) {
32973			this.offset.click.left = obj.left + this.margins.left;
32974		}
32975		if ( "right" in obj ) {
32976			this.offset.click.left = this.helperProportions.width - obj.right + this.margins.left;
32977		}
32978		if ( "top" in obj ) {
32979			this.offset.click.top = obj.top + this.margins.top;
32980		}
32981		if ( "bottom" in obj ) {
32982			this.offset.click.top = this.helperProportions.height - obj.bottom + this.margins.top;
32983		}
32984	},
32985
32986	_getParentOffset: function() {
32987
32988		//Get the offsetParent and cache its position
32989		this.offsetParent = this.helper.offsetParent();
32990		var po = this.offsetParent.offset();
32991
32992		// This is a special case where we need to modify a offset calculated on start, since the
32993		// following happened:
32994		// 1. The position of the helper is absolute, so it's position is calculated based on the
32995		// next positioned parent
32996		// 2. The actual offset parent is a child of the scroll parent, and the scroll parent isn't
32997		// the document, which means that the scroll is included in the initial calculation of the
32998		// offset of the parent, and never recalculated upon drag
32999		if ( this.cssPosition === "absolute" && this.scrollParent[ 0 ] !== this.document[ 0 ] &&
33000				$.contains( this.scrollParent[ 0 ], this.offsetParent[ 0 ] ) ) {
33001			po.left += this.scrollParent.scrollLeft();
33002			po.top += this.scrollParent.scrollTop();
33003		}
33004
33005		// This needs to be actually done for all browsers, since pageX/pageY includes this
33006		// information with an ugly IE fix
33007		if ( this.offsetParent[ 0 ] === this.document[ 0 ].body ||
33008				( this.offsetParent[ 0 ].tagName &&
33009				this.offsetParent[ 0 ].tagName.toLowerCase() === "html" && $.ui.ie ) ) {
33010			po = { top: 0, left: 0 };
33011		}
33012
33013		return {
33014			top: po.top + ( parseInt( this.offsetParent.css( "borderTopWidth" ), 10 ) || 0 ),
33015			left: po.left + ( parseInt( this.offsetParent.css( "borderLeftWidth" ), 10 ) || 0 )
33016		};
33017
33018	},
33019
33020	_getRelativeOffset: function() {
33021
33022		if ( this.cssPosition === "relative" ) {
33023			var p = this.currentItem.position();
33024			return {
33025				top: p.top - ( parseInt( this.helper.css( "top" ), 10 ) || 0 ) +
33026					this.scrollParent.scrollTop(),
33027				left: p.left - ( parseInt( this.helper.css( "left" ), 10 ) || 0 ) +
33028					this.scrollParent.scrollLeft()
33029			};
33030		} else {
33031			return { top: 0, left: 0 };
33032		}
33033
33034	},
33035
33036	_cacheMargins: function() {
33037		this.margins = {
33038			left: ( parseInt( this.currentItem.css( "marginLeft" ), 10 ) || 0 ),
33039			top: ( parseInt( this.currentItem.css( "marginTop" ), 10 ) || 0 )
33040		};
33041	},
33042
33043	_cacheHelperProportions: function() {
33044		this.helperProportions = {
33045			width: this.helper.outerWidth(),
33046			height: this.helper.outerHeight()
33047		};
33048	},
33049
33050	_setContainment: function() {
33051
33052		var ce, co, over,
33053			o = this.options;
33054		if ( o.containment === "parent" ) {
33055			o.containment = this.helper[ 0 ].parentNode;
33056		}
33057		if ( o.containment === "document" || o.containment === "window" ) {
33058			this.containment = [
33059				0 - this.offset.relative.left - this.offset.parent.left,
33060				0 - this.offset.relative.top - this.offset.parent.top,
33061				o.containment === "document" ?
33062					this.document.width() :
33063					this.window.width() - this.helperProportions.width - this.margins.left,
33064				( o.containment === "document" ?
33065					( this.document.height() || document.body.parentNode.scrollHeight ) :
33066					this.window.height() || this.document[ 0 ].body.parentNode.scrollHeight
33067				) - this.helperProportions.height - this.margins.top
33068			];
33069		}
33070
33071		if ( !( /^(document|window|parent)$/ ).test( o.containment ) ) {
33072			ce = $( o.containment )[ 0 ];
33073			co = $( o.containment ).offset();
33074			over = ( $( ce ).css( "overflow" ) !== "hidden" );
33075
33076			this.containment = [
33077				co.left + ( parseInt( $( ce ).css( "borderLeftWidth" ), 10 ) || 0 ) +
33078					( parseInt( $( ce ).css( "paddingLeft" ), 10 ) || 0 ) - this.margins.left,
33079				co.top + ( parseInt( $( ce ).css( "borderTopWidth" ), 10 ) || 0 ) +
33080					( parseInt( $( ce ).css( "paddingTop" ), 10 ) || 0 ) - this.margins.top,
33081				co.left + ( over ? Math.max( ce.scrollWidth, ce.offsetWidth ) : ce.offsetWidth ) -
33082					( parseInt( $( ce ).css( "borderLeftWidth" ), 10 ) || 0 ) -
33083					( parseInt( $( ce ).css( "paddingRight" ), 10 ) || 0 ) -
33084					this.helperProportions.width - this.margins.left,
33085				co.top + ( over ? Math.max( ce.scrollHeight, ce.offsetHeight ) : ce.offsetHeight ) -
33086					( parseInt( $( ce ).css( "borderTopWidth" ), 10 ) || 0 ) -
33087					( parseInt( $( ce ).css( "paddingBottom" ), 10 ) || 0 ) -
33088					this.helperProportions.height - this.margins.top
33089			];
33090		}
33091
33092	},
33093
33094	_convertPositionTo: function( d, pos ) {
33095
33096		if ( !pos ) {
33097			pos = this.position;
33098		}
33099		var mod = d === "absolute" ? 1 : -1,
33100			scroll = this.cssPosition === "absolute" &&
33101				!( this.scrollParent[ 0 ] !== this.document[ 0 ] &&
33102				$.contains( this.scrollParent[ 0 ], this.offsetParent[ 0 ] ) ) ?
33103					this.offsetParent :
33104					this.scrollParent,
33105			scrollIsRootNode = ( /(html|body)/i ).test( scroll[ 0 ].tagName );
33106
33107		return {
33108			top: (
33109
33110				// The absolute mouse position
33111				pos.top	+
33112
33113				// Only for relative positioned nodes: Relative offset from element to offset parent
33114				this.offset.relative.top * mod +
33115
33116				// The offsetParent's offset without borders (offset + border)
33117				this.offset.parent.top * mod -
33118				( ( this.cssPosition === "fixed" ?
33119					-this.scrollParent.scrollTop() :
33120					( scrollIsRootNode ? 0 : scroll.scrollTop() ) ) * mod )
33121			),
33122			left: (
33123
33124				// The absolute mouse position
33125				pos.left +
33126
33127				// Only for relative positioned nodes: Relative offset from element to offset parent
33128				this.offset.relative.left * mod +
33129
33130				// The offsetParent's offset without borders (offset + border)
33131				this.offset.parent.left * mod	-
33132				( ( this.cssPosition === "fixed" ?
33133					-this.scrollParent.scrollLeft() : scrollIsRootNode ? 0 :
33134					scroll.scrollLeft() ) * mod )
33135			)
33136		};
33137
33138	},
33139
33140	_generatePosition: function( event ) {
33141
33142		var top, left,
33143			o = this.options,
33144			pageX = event.pageX,
33145			pageY = event.pageY,
33146			scroll = this.cssPosition === "absolute" &&
33147				!( this.scrollParent[ 0 ] !== this.document[ 0 ] &&
33148				$.contains( this.scrollParent[ 0 ], this.offsetParent[ 0 ] ) ) ?
33149					this.offsetParent :
33150					this.scrollParent,
33151				scrollIsRootNode = ( /(html|body)/i ).test( scroll[ 0 ].tagName );
33152
33153		// This is another very weird special case that only happens for relative elements:
33154		// 1. If the css position is relative
33155		// 2. and the scroll parent is the document or similar to the offset parent
33156		// we have to refresh the relative offset during the scroll so there are no jumps
33157		if ( this.cssPosition === "relative" && !( this.scrollParent[ 0 ] !== this.document[ 0 ] &&
33158				this.scrollParent[ 0 ] !== this.offsetParent[ 0 ] ) ) {
33159			this.offset.relative = this._getRelativeOffset();
33160		}
33161
33162		/*
33163		 * - Position constraining -
33164		 * Constrain the position to a mix of grid, containment.
33165		 */
33166
33167		if ( this.originalPosition ) { //If we are not dragging yet, we won't check for options
33168
33169			if ( this.containment ) {
33170				if ( event.pageX - this.offset.click.left < this.containment[ 0 ] ) {
33171					pageX = this.containment[ 0 ] + this.offset.click.left;
33172				}
33173				if ( event.pageY - this.offset.click.top < this.containment[ 1 ] ) {
33174					pageY = this.containment[ 1 ] + this.offset.click.top;
33175				}
33176				if ( event.pageX - this.offset.click.left > this.containment[ 2 ] ) {
33177					pageX = this.containment[ 2 ] + this.offset.click.left;
33178				}
33179				if ( event.pageY - this.offset.click.top > this.containment[ 3 ] ) {
33180					pageY = this.containment[ 3 ] + this.offset.click.top;
33181				}
33182			}
33183
33184			if ( o.grid ) {
33185				top = this.originalPageY + Math.round( ( pageY - this.originalPageY ) /
33186					o.grid[ 1 ] ) * o.grid[ 1 ];
33187				pageY = this.containment ?
33188					( ( top - this.offset.click.top >= this.containment[ 1 ] &&
33189						top - this.offset.click.top <= this.containment[ 3 ] ) ?
33190							top :
33191							( ( top - this.offset.click.top >= this.containment[ 1 ] ) ?
33192								top - o.grid[ 1 ] : top + o.grid[ 1 ] ) ) :
33193								top;
33194
33195				left = this.originalPageX + Math.round( ( pageX - this.originalPageX ) /
33196					o.grid[ 0 ] ) * o.grid[ 0 ];
33197				pageX = this.containment ?
33198					( ( left - this.offset.click.left >= this.containment[ 0 ] &&
33199						left - this.offset.click.left <= this.containment[ 2 ] ) ?
33200							left :
33201							( ( left - this.offset.click.left >= this.containment[ 0 ] ) ?
33202								left - o.grid[ 0 ] : left + o.grid[ 0 ] ) ) :
33203								left;
33204			}
33205
33206		}
33207
33208		return {
33209			top: (
33210
33211				// The absolute mouse position
33212				pageY -
33213
33214				// Click offset (relative to the element)
33215				this.offset.click.top -
33216
33217				// Only for relative positioned nodes: Relative offset from element to offset parent
33218				this.offset.relative.top -
33219
33220				// The offsetParent's offset without borders (offset + border)
33221				this.offset.parent.top +
33222				( ( this.cssPosition === "fixed" ?
33223					-this.scrollParent.scrollTop() :
33224					( scrollIsRootNode ? 0 : scroll.scrollTop() ) ) )
33225			),
33226			left: (
33227
33228				// The absolute mouse position
33229				pageX -
33230
33231				// Click offset (relative to the element)
33232				this.offset.click.left -
33233
33234				// Only for relative positioned nodes: Relative offset from element to offset parent
33235				this.offset.relative.left -
33236
33237				// The offsetParent's offset without borders (offset + border)
33238				this.offset.parent.left +
33239				( ( this.cssPosition === "fixed" ?
33240					-this.scrollParent.scrollLeft() :
33241					scrollIsRootNode ? 0 : scroll.scrollLeft() ) )
33242			)
33243		};
33244
33245	},
33246
33247	_rearrange: function( event, i, a, hardRefresh ) {
33248
33249		a ? a[ 0 ].appendChild( this.placeholder[ 0 ] ) :
33250			i.item[ 0 ].parentNode.insertBefore( this.placeholder[ 0 ],
33251				( this.direction === "down" ? i.item[ 0 ] : i.item[ 0 ].nextSibling ) );
33252
33253		//Various things done here to improve the performance:
33254		// 1. we create a setTimeout, that calls refreshPositions
33255		// 2. on the instance, we have a counter variable, that get's higher after every append
33256		// 3. on the local scope, we copy the counter variable, and check in the timeout,
33257		// if it's still the same
33258		// 4. this lets only the last addition to the timeout stack through
33259		this.counter = this.counter ? ++this.counter : 1;
33260		var counter = this.counter;
33261
33262		this._delay( function() {
33263			if ( counter === this.counter ) {
33264
33265				//Precompute after each DOM insertion, NOT on mousemove
33266				this.refreshPositions( !hardRefresh );
33267			}
33268		} );
33269
33270	},
33271
33272	_clear: function( event, noPropagation ) {
33273
33274		this.reverting = false;
33275
33276		// We delay all events that have to be triggered to after the point where the placeholder
33277		// has been removed and everything else normalized again
33278		var i,
33279			delayedTriggers = [];
33280
33281		// We first have to update the dom position of the actual currentItem
33282		// Note: don't do it if the current item is already removed (by a user), or it gets
33283		// reappended (see #4088)
33284		if ( !this._noFinalSort && this.currentItem.parent().length ) {
33285			this.placeholder.before( this.currentItem );
33286		}
33287		this._noFinalSort = null;
33288
33289		if ( this.helper[ 0 ] === this.currentItem[ 0 ] ) {
33290			for ( i in this._storedCSS ) {
33291				if ( this._storedCSS[ i ] === "auto" || this._storedCSS[ i ] === "static" ) {
33292					this._storedCSS[ i ] = "";
33293				}
33294			}
33295			this.currentItem.css( this._storedCSS );
33296			this._removeClass( this.currentItem, "ui-sortable-helper" );
33297		} else {
33298			this.currentItem.show();
33299		}
33300
33301		if ( this.fromOutside && !noPropagation ) {
33302			delayedTriggers.push( function( event ) {
33303				this._trigger( "receive", event, this._uiHash( this.fromOutside ) );
33304			} );
33305		}
33306		if ( ( this.fromOutside ||
33307				this.domPosition.prev !==
33308				this.currentItem.prev().not( ".ui-sortable-helper" )[ 0 ] ||
33309				this.domPosition.parent !== this.currentItem.parent()[ 0 ] ) && !noPropagation ) {
33310
33311			// Trigger update callback if the DOM position has changed
33312			delayedTriggers.push( function( event ) {
33313				this._trigger( "update", event, this._uiHash() );
33314			} );
33315		}
33316
33317		// Check if the items Container has Changed and trigger appropriate
33318		// events.
33319		if ( this !== this.currentContainer ) {
33320			if ( !noPropagation ) {
33321				delayedTriggers.push( function( event ) {
33322					this._trigger( "remove", event, this._uiHash() );
33323				} );
33324				delayedTriggers.push( ( function( c ) {
33325					return function( event ) {
33326						c._trigger( "receive", event, this._uiHash( this ) );
33327					};
33328				} ).call( this, this.currentContainer ) );
33329				delayedTriggers.push( ( function( c ) {
33330					return function( event ) {
33331						c._trigger( "update", event, this._uiHash( this ) );
33332					};
33333				} ).call( this, this.currentContainer ) );
33334			}
33335		}
33336
33337		//Post events to containers
33338		function delayEvent( type, instance, container ) {
33339			return function( event ) {
33340				container._trigger( type, event, instance._uiHash( instance ) );
33341			};
33342		}
33343		for ( i = this.containers.length - 1; i >= 0; i-- ) {
33344			if ( !noPropagation ) {
33345				delayedTriggers.push( delayEvent( "deactivate", this, this.containers[ i ] ) );
33346			}
33347			if ( this.containers[ i ].containerCache.over ) {
33348				delayedTriggers.push( delayEvent( "out", this, this.containers[ i ] ) );
33349				this.containers[ i ].containerCache.over = 0;
33350			}
33351		}
33352
33353		//Do what was originally in plugins
33354		if ( this.storedCursor ) {
33355			this.document.find( "body" ).css( "cursor", this.storedCursor );
33356			this.storedStylesheet.remove();
33357		}
33358		if ( this._storedOpacity ) {
33359			this.helper.css( "opacity", this._storedOpacity );
33360		}
33361		if ( this._storedZIndex ) {
33362			this.helper.css( "zIndex", this._storedZIndex === "auto" ? "" : this._storedZIndex );
33363		}
33364
33365		this.dragging = false;
33366
33367		if ( !noPropagation ) {
33368			this._trigger( "beforeStop", event, this._uiHash() );
33369		}
33370
33371		//$(this.placeholder[0]).remove(); would have been the jQuery way - unfortunately,
33372		// it unbinds ALL events from the original node!
33373		this.placeholder[ 0 ].parentNode.removeChild( this.placeholder[ 0 ] );
33374
33375		if ( !this.cancelHelperRemoval ) {
33376			if ( this.helper[ 0 ] !== this.currentItem[ 0 ] ) {
33377				this.helper.remove();
33378			}
33379			this.helper = null;
33380		}
33381
33382		if ( !noPropagation ) {
33383			for ( i = 0; i < delayedTriggers.length; i++ ) {
33384
33385				// Trigger all delayed events
33386				delayedTriggers[ i ].call( this, event );
33387			}
33388			this._trigger( "stop", event, this._uiHash() );
33389		}
33390
33391		this.fromOutside = false;
33392		return !this.cancelHelperRemoval;
33393
33394	},
33395
33396	_trigger: function() {
33397		if ( $.Widget.prototype._trigger.apply( this, arguments ) === false ) {
33398			this.cancel();
33399		}
33400	},
33401
33402	_uiHash: function( _inst ) {
33403		var inst = _inst || this;
33404		return {
33405			helper: inst.helper,
33406			placeholder: inst.placeholder || $( [] ),
33407			position: inst.position,
33408			originalPosition: inst.originalPosition,
33409			offset: inst.positionAbs,
33410			item: inst.currentItem,
33411			sender: _inst ? _inst.element : null
33412		};
33413	}
33414
33415} );
33416
33417
33418/*!
33419 * jQuery UI Spinner 1.12.1
33420 * http://jqueryui.com
33421 *
33422 * Copyright jQuery Foundation and other contributors
33423 * Released under the MIT license.
33424 * http://jquery.org/license
33425 */
33426
33427//>>label: Spinner
33428//>>group: Widgets
33429//>>description: Displays buttons to easily input numbers via the keyboard or mouse.
33430//>>docs: http://api.jqueryui.com/spinner/
33431//>>demos: http://jqueryui.com/spinner/
33432//>>css.structure: ../../themes/base/core.css
33433//>>css.structure: ../../themes/base/spinner.css
33434//>>css.theme: ../../themes/base/theme.css
33435
33436
33437
33438function spinnerModifer( fn ) {
33439	return function() {
33440		var previous = this.element.val();
33441		fn.apply( this, arguments );
33442		this._refresh();
33443		if ( previous !== this.element.val() ) {
33444			this._trigger( "change" );
33445		}
33446	};
33447}
33448
33449$.widget( "ui.spinner", {
33450	version: "1.12.1",
33451	defaultElement: "<input>",
33452	widgetEventPrefix: "spin",
33453	options: {
33454		classes: {
33455			"ui-spinner": "ui-corner-all",
33456			"ui-spinner-down": "ui-corner-br",
33457			"ui-spinner-up": "ui-corner-tr"
33458		},
33459		culture: null,
33460		icons: {
33461			down: "ui-icon-triangle-1-s",
33462			up: "ui-icon-triangle-1-n"
33463		},
33464		incremental: true,
33465		max: null,
33466		min: null,
33467		numberFormat: null,
33468		page: 10,
33469		step: 1,
33470
33471		change: null,
33472		spin: null,
33473		start: null,
33474		stop: null
33475	},
33476
33477	_create: function() {
33478
33479		// handle string values that need to be parsed
33480		this._setOption( "max", this.options.max );
33481		this._setOption( "min", this.options.min );
33482		this._setOption( "step", this.options.step );
33483
33484		// Only format if there is a value, prevents the field from being marked
33485		// as invalid in Firefox, see #9573.
33486		if ( this.value() !== "" ) {
33487
33488			// Format the value, but don't constrain.
33489			this._value( this.element.val(), true );
33490		}
33491
33492		this._draw();
33493		this._on( this._events );
33494		this._refresh();
33495
33496		// Turning off autocomplete prevents the browser from remembering the
33497		// value when navigating through history, so we re-enable autocomplete
33498		// if the page is unloaded before the widget is destroyed. #7790
33499		this._on( this.window, {
33500			beforeunload: function() {
33501				this.element.removeAttr( "autocomplete" );
33502			}
33503		} );
33504	},
33505
33506	_getCreateOptions: function() {
33507		var options = this._super();
33508		var element = this.element;
33509
33510		$.each( [ "min", "max", "step" ], function( i, option ) {
33511			var value = element.attr( option );
33512			if ( value != null && value.length ) {
33513				options[ option ] = value;
33514			}
33515		} );
33516
33517		return options;
33518	},
33519
33520	_events: {
33521		keydown: function( event ) {
33522			if ( this._start( event ) && this._keydown( event ) ) {
33523				event.preventDefault();
33524			}
33525		},
33526		keyup: "_stop",
33527		focus: function() {
33528			this.previous = this.element.val();
33529		},
33530		blur: function( event ) {
33531			if ( this.cancelBlur ) {
33532				delete this.cancelBlur;
33533				return;
33534			}
33535
33536			this._stop();
33537			this._refresh();
33538			if ( this.previous !== this.element.val() ) {
33539				this._trigger( "change", event );
33540			}
33541		},
33542		mousewheel: function( event, delta ) {
33543			if ( !delta ) {
33544				return;
33545			}
33546			if ( !this.spinning && !this._start( event ) ) {
33547				return false;
33548			}
33549
33550			this._spin( ( delta > 0 ? 1 : -1 ) * this.options.step, event );
33551			clearTimeout( this.mousewheelTimer );
33552			this.mousewheelTimer = this._delay( function() {
33553				if ( this.spinning ) {
33554					this._stop( event );
33555				}
33556			}, 100 );
33557			event.preventDefault();
33558		},
33559		"mousedown .ui-spinner-button": function( event ) {
33560			var previous;
33561
33562			// We never want the buttons to have focus; whenever the user is
33563			// interacting with the spinner, the focus should be on the input.
33564			// If the input is focused then this.previous is properly set from
33565			// when the input first received focus. If the input is not focused
33566			// then we need to set this.previous based on the value before spinning.
33567			previous = this.element[ 0 ] === $.ui.safeActiveElement( this.document[ 0 ] ) ?
33568				this.previous : this.element.val();
33569			function checkFocus() {
33570				var isActive = this.element[ 0 ] === $.ui.safeActiveElement( this.document[ 0 ] );
33571				if ( !isActive ) {
33572					this.element.trigger( "focus" );
33573					this.previous = previous;
33574
33575					// support: IE
33576					// IE sets focus asynchronously, so we need to check if focus
33577					// moved off of the input because the user clicked on the button.
33578					this._delay( function() {
33579						this.previous = previous;
33580					} );
33581				}
33582			}
33583
33584			// Ensure focus is on (or stays on) the text field
33585			event.preventDefault();
33586			checkFocus.call( this );
33587
33588			// Support: IE
33589			// IE doesn't prevent moving focus even with event.preventDefault()
33590			// so we set a flag to know when we should ignore the blur event
33591			// and check (again) if focus moved off of the input.
33592			this.cancelBlur = true;
33593			this._delay( function() {
33594				delete this.cancelBlur;
33595				checkFocus.call( this );
33596			} );
33597
33598			if ( this._start( event ) === false ) {
33599				return;
33600			}
33601
33602			this._repeat( null, $( event.currentTarget )
33603				.hasClass( "ui-spinner-up" ) ? 1 : -1, event );
33604		},
33605		"mouseup .ui-spinner-button": "_stop",
33606		"mouseenter .ui-spinner-button": function( event ) {
33607
33608			// button will add ui-state-active if mouse was down while mouseleave and kept down
33609			if ( !$( event.currentTarget ).hasClass( "ui-state-active" ) ) {
33610				return;
33611			}
33612
33613			if ( this._start( event ) === false ) {
33614				return false;
33615			}
33616			this._repeat( null, $( event.currentTarget )
33617				.hasClass( "ui-spinner-up" ) ? 1 : -1, event );
33618		},
33619
33620		// TODO: do we really want to consider this a stop?
33621		// shouldn't we just stop the repeater and wait until mouseup before
33622		// we trigger the stop event?
33623		"mouseleave .ui-spinner-button": "_stop"
33624	},
33625
33626	// Support mobile enhanced option and make backcompat more sane
33627	_enhance: function() {
33628		this.uiSpinner = this.element
33629			.attr( "autocomplete", "off" )
33630			.wrap( "<span>" )
33631			.parent()
33632
33633				// Add buttons
33634				.append(
33635					"<a></a><a></a>"
33636				);
33637	},
33638
33639	_draw: function() {
33640		this._enhance();
33641
33642		this._addClass( this.uiSpinner, "ui-spinner", "ui-widget ui-widget-content" );
33643		this._addClass( "ui-spinner-input" );
33644
33645		this.element.attr( "role", "spinbutton" );
33646
33647		// Button bindings
33648		this.buttons = this.uiSpinner.children( "a" )
33649			.attr( "tabIndex", -1 )
33650			.attr( "aria-hidden", true )
33651			.button( {
33652				classes: {
33653					"ui-button": ""
33654				}
33655			} );
33656
33657		// TODO: Right now button does not support classes this is already updated in button PR
33658		this._removeClass( this.buttons, "ui-corner-all" );
33659
33660		this._addClass( this.buttons.first(), "ui-spinner-button ui-spinner-up" );
33661		this._addClass( this.buttons.last(), "ui-spinner-button ui-spinner-down" );
33662		this.buttons.first().button( {
33663			"icon": this.options.icons.up,
33664			"showLabel": false
33665		} );
33666		this.buttons.last().button( {
33667			"icon": this.options.icons.down,
33668			"showLabel": false
33669		} );
33670
33671		// IE 6 doesn't understand height: 50% for the buttons
33672		// unless the wrapper has an explicit height
33673		if ( this.buttons.height() > Math.ceil( this.uiSpinner.height() * 0.5 ) &&
33674				this.uiSpinner.height() > 0 ) {
33675			this.uiSpinner.height( this.uiSpinner.height() );
33676		}
33677	},
33678
33679	_keydown: function( event ) {
33680		var options = this.options,
33681			keyCode = $.ui.keyCode;
33682
33683		switch ( event.keyCode ) {
33684		case keyCode.UP:
33685			this._repeat( null, 1, event );
33686			return true;
33687		case keyCode.DOWN:
33688			this._repeat( null, -1, event );
33689			return true;
33690		case keyCode.PAGE_UP:
33691			this._repeat( null, options.page, event );
33692			return true;
33693		case keyCode.PAGE_DOWN:
33694			this._repeat( null, -options.page, event );
33695			return true;
33696		}
33697
33698		return false;
33699	},
33700
33701	_start: function( event ) {
33702		if ( !this.spinning && this._trigger( "start", event ) === false ) {
33703			return false;
33704		}
33705
33706		if ( !this.counter ) {
33707			this.counter = 1;
33708		}
33709		this.spinning = true;
33710		return true;
33711	},
33712
33713	_repeat: function( i, steps, event ) {
33714		i = i || 500;
33715
33716		clearTimeout( this.timer );
33717		this.timer = this._delay( function() {
33718			this._repeat( 40, steps, event );
33719		}, i );
33720
33721		this._spin( steps * this.options.step, event );
33722	},
33723
33724	_spin: function( step, event ) {
33725		var value = this.value() || 0;
33726
33727		if ( !this.counter ) {
33728			this.counter = 1;
33729		}
33730
33731		value = this._adjustValue( value + step * this._increment( this.counter ) );
33732
33733		if ( !this.spinning || this._trigger( "spin", event, { value: value } ) !== false ) {
33734			this._value( value );
33735			this.counter++;
33736		}
33737	},
33738
33739	_increment: function( i ) {
33740		var incremental = this.options.incremental;
33741
33742		if ( incremental ) {
33743			return $.isFunction( incremental ) ?
33744				incremental( i ) :
33745				Math.floor( i * i * i / 50000 - i * i / 500 + 17 * i / 200 + 1 );
33746		}
33747
33748		return 1;
33749	},
33750
33751	_precision: function() {
33752		var precision = this._precisionOf( this.options.step );
33753		if ( this.options.min !== null ) {
33754			precision = Math.max( precision, this._precisionOf( this.options.min ) );
33755		}
33756		return precision;
33757	},
33758
33759	_precisionOf: function( num ) {
33760		var str = num.toString(),
33761			decimal = str.indexOf( "." );
33762		return decimal === -1 ? 0 : str.length - decimal - 1;
33763	},
33764
33765	_adjustValue: function( value ) {
33766		var base, aboveMin,
33767			options = this.options;
33768
33769		// Make sure we're at a valid step
33770		// - find out where we are relative to the base (min or 0)
33771		base = options.min !== null ? options.min : 0;
33772		aboveMin = value - base;
33773
33774		// - round to the nearest step
33775		aboveMin = Math.round( aboveMin / options.step ) * options.step;
33776
33777		// - rounding is based on 0, so adjust back to our base
33778		value = base + aboveMin;
33779
33780		// Fix precision from bad JS floating point math
33781		value = parseFloat( value.toFixed( this._precision() ) );
33782
33783		// Clamp the value
33784		if ( options.max !== null && value > options.max ) {
33785			return options.max;
33786		}
33787		if ( options.min !== null && value < options.min ) {
33788			return options.min;
33789		}
33790
33791		return value;
33792	},
33793
33794	_stop: function( event ) {
33795		if ( !this.spinning ) {
33796			return;
33797		}
33798
33799		clearTimeout( this.timer );
33800		clearTimeout( this.mousewheelTimer );
33801		this.counter = 0;
33802		this.spinning = false;
33803		this._trigger( "stop", event );
33804	},
33805
33806	_setOption: function( key, value ) {
33807		var prevValue, first, last;
33808
33809		if ( key === "culture" || key === "numberFormat" ) {
33810			prevValue = this._parse( this.element.val() );
33811			this.options[ key ] = value;
33812			this.element.val( this._format( prevValue ) );
33813			return;
33814		}
33815
33816		if ( key === "max" || key === "min" || key === "step" ) {
33817			if ( typeof value === "string" ) {
33818				value = this._parse( value );
33819			}
33820		}
33821		if ( key === "icons" ) {
33822			first = this.buttons.first().find( ".ui-icon" );
33823			this._removeClass( first, null, this.options.icons.up );
33824			this._addClass( first, null, value.up );
33825			last = this.buttons.last().find( ".ui-icon" );
33826			this._removeClass( last, null, this.options.icons.down );
33827			this._addClass( last, null, value.down );
33828		}
33829
33830		this._super( key, value );
33831	},
33832
33833	_setOptionDisabled: function( value ) {
33834		this._super( value );
33835
33836		this._toggleClass( this.uiSpinner, null, "ui-state-disabled", !!value );
33837		this.element.prop( "disabled", !!value );
33838		this.buttons.button( value ? "disable" : "enable" );
33839	},
33840
33841	_setOptions: spinnerModifer( function( options ) {
33842		this._super( options );
33843	} ),
33844
33845	_parse: function( val ) {
33846		if ( typeof val === "string" && val !== "" ) {
33847			val = window.Globalize && this.options.numberFormat ?
33848				Globalize.parseFloat( val, 10, this.options.culture ) : +val;
33849		}
33850		return val === "" || isNaN( val ) ? null : val;
33851	},
33852
33853	_format: function( value ) {
33854		if ( value === "" ) {
33855			return "";
33856		}
33857		return window.Globalize && this.options.numberFormat ?
33858			Globalize.format( value, this.options.numberFormat, this.options.culture ) :
33859			value;
33860	},
33861
33862	_refresh: function() {
33863		this.element.attr( {
33864			"aria-valuemin": this.options.min,
33865			"aria-valuemax": this.options.max,
33866
33867			// TODO: what should we do with values that can't be parsed?
33868			"aria-valuenow": this._parse( this.element.val() )
33869		} );
33870	},
33871
33872	isValid: function() {
33873		var value = this.value();
33874
33875		// Null is invalid
33876		if ( value === null ) {
33877			return false;
33878		}
33879
33880		// If value gets adjusted, it's invalid
33881		return value === this._adjustValue( value );
33882	},
33883
33884	// Update the value without triggering change
33885	_value: function( value, allowAny ) {
33886		var parsed;
33887		if ( value !== "" ) {
33888			parsed = this._parse( value );
33889			if ( parsed !== null ) {
33890				if ( !allowAny ) {
33891					parsed = this._adjustValue( parsed );
33892				}
33893				value = this._format( parsed );
33894			}
33895		}
33896		this.element.val( value );
33897		this._refresh();
33898	},
33899
33900	_destroy: function() {
33901		this.element
33902			.prop( "disabled", false )
33903			.removeAttr( "autocomplete role aria-valuemin aria-valuemax aria-valuenow" );
33904
33905		this.uiSpinner.replaceWith( this.element );
33906	},
33907
33908	stepUp: spinnerModifer( function( steps ) {
33909		this._stepUp( steps );
33910	} ),
33911	_stepUp: function( steps ) {
33912		if ( this._start() ) {
33913			this._spin( ( steps || 1 ) * this.options.step );
33914			this._stop();
33915		}
33916	},
33917
33918	stepDown: spinnerModifer( function( steps ) {
33919		this._stepDown( steps );
33920	} ),
33921	_stepDown: function( steps ) {
33922		if ( this._start() ) {
33923			this._spin( ( steps || 1 ) * -this.options.step );
33924			this._stop();
33925		}
33926	},
33927
33928	pageUp: spinnerModifer( function( pages ) {
33929		this._stepUp( ( pages || 1 ) * this.options.page );
33930	} ),
33931
33932	pageDown: spinnerModifer( function( pages ) {
33933		this._stepDown( ( pages || 1 ) * this.options.page );
33934	} ),
33935
33936	value: function( newVal ) {
33937		if ( !arguments.length ) {
33938			return this._parse( this.element.val() );
33939		}
33940		spinnerModifer( this._value ).call( this, newVal );
33941	},
33942
33943	widget: function() {
33944		return this.uiSpinner;
33945	}
33946} );
33947
33948// DEPRECATED
33949// TODO: switch return back to widget declaration at top of file when this is removed
33950if ( $.uiBackCompat !== false ) {
33951
33952	// Backcompat for spinner html extension points
33953	$.widget( "ui.spinner", $.ui.spinner, {
33954		_enhance: function() {
33955			this.uiSpinner = this.element
33956				.attr( "autocomplete", "off" )
33957				.wrap( this._uiSpinnerHtml() )
33958				.parent()
33959
33960					// Add buttons
33961					.append( this._buttonHtml() );
33962		},
33963		_uiSpinnerHtml: function() {
33964			return "<span>";
33965		},
33966
33967		_buttonHtml: function() {
33968			return "<a></a><a></a>";
33969		}
33970	} );
33971}
33972
33973var widgetsSpinner = $.ui.spinner;
33974
33975
33976/*!
33977 * jQuery UI Tabs 1.12.1
33978 * http://jqueryui.com
33979 *
33980 * Copyright jQuery Foundation and other contributors
33981 * Released under the MIT license.
33982 * http://jquery.org/license
33983 */
33984
33985//>>label: Tabs
33986//>>group: Widgets
33987//>>description: Transforms a set of container elements into a tab structure.
33988//>>docs: http://api.jqueryui.com/tabs/
33989//>>demos: http://jqueryui.com/tabs/
33990//>>css.structure: ../../themes/base/core.css
33991//>>css.structure: ../../themes/base/tabs.css
33992//>>css.theme: ../../themes/base/theme.css
33993
33994
33995
33996$.widget( "ui.tabs", {
33997	version: "1.12.1",
33998	delay: 300,
33999	options: {
34000		active: null,
34001		classes: {
34002			"ui-tabs": "ui-corner-all",
34003			"ui-tabs-nav": "ui-corner-all",
34004			"ui-tabs-panel": "ui-corner-bottom",
34005			"ui-tabs-tab": "ui-corner-top"
34006		},
34007		collapsible: false,
34008		event: "click",
34009		heightStyle: "content",
34010		hide: null,
34011		show: null,
34012
34013		// Callbacks
34014		activate: null,
34015		beforeActivate: null,
34016		beforeLoad: null,
34017		load: null
34018	},
34019
34020	_isLocal: ( function() {
34021		var rhash = /#.*$/;
34022
34023		return function( anchor ) {
34024			var anchorUrl, locationUrl;
34025
34026			anchorUrl = anchor.href.replace( rhash, "" );
34027			locationUrl = location.href.replace( rhash, "" );
34028
34029			// Decoding may throw an error if the URL isn't UTF-8 (#9518)
34030			try {
34031				anchorUrl = decodeURIComponent( anchorUrl );
34032			} catch ( error ) {}
34033			try {
34034				locationUrl = decodeURIComponent( locationUrl );
34035			} catch ( error ) {}
34036
34037			return anchor.hash.length > 1 && anchorUrl === locationUrl;
34038		};
34039	} )(),
34040
34041	_create: function() {
34042		var that = this,
34043			options = this.options;
34044
34045		this.running = false;
34046
34047		this._addClass( "ui-tabs", "ui-widget ui-widget-content" );
34048		this._toggleClass( "ui-tabs-collapsible", null, options.collapsible );
34049
34050		this._processTabs();
34051		options.active = this._initialActive();
34052
34053		// Take disabling tabs via class attribute from HTML
34054		// into account and update option properly.
34055		if ( $.isArray( options.disabled ) ) {
34056			options.disabled = $.unique( options.disabled.concat(
34057				$.map( this.tabs.filter( ".ui-state-disabled" ), function( li ) {
34058					return that.tabs.index( li );
34059				} )
34060			) ).sort();
34061		}
34062
34063		// Check for length avoids error when initializing empty list
34064		if ( this.options.active !== false && this.anchors.length ) {
34065			this.active = this._findActive( options.active );
34066		} else {
34067			this.active = $();
34068		}
34069
34070		this._refresh();
34071
34072		if ( this.active.length ) {
34073			this.load( options.active );
34074		}
34075	},
34076
34077	_initialActive: function() {
34078		var active = this.options.active,
34079			collapsible = this.options.collapsible,
34080			locationHash = location.hash.substring( 1 );
34081
34082		if ( active === null ) {
34083
34084			// check the fragment identifier in the URL
34085			if ( locationHash ) {
34086				this.tabs.each( function( i, tab ) {
34087					if ( $( tab ).attr( "aria-controls" ) === locationHash ) {
34088						active = i;
34089						return false;
34090					}
34091				} );
34092			}
34093
34094			// Check for a tab marked active via a class
34095			if ( active === null ) {
34096				active = this.tabs.index( this.tabs.filter( ".ui-tabs-active" ) );
34097			}
34098
34099			// No active tab, set to false
34100			if ( active === null || active === -1 ) {
34101				active = this.tabs.length ? 0 : false;
34102			}
34103		}
34104
34105		// Handle numbers: negative, out of range
34106		if ( active !== false ) {
34107			active = this.tabs.index( this.tabs.eq( active ) );
34108			if ( active === -1 ) {
34109				active = collapsible ? false : 0;
34110			}
34111		}
34112
34113		// Don't allow collapsible: false and active: false
34114		if ( !collapsible && active === false && this.anchors.length ) {
34115			active = 0;
34116		}
34117
34118		return active;
34119	},
34120
34121	_getCreateEventData: function() {
34122		return {
34123			tab: this.active,
34124			panel: !this.active.length ? $() : this._getPanelForTab( this.active )
34125		};
34126	},
34127
34128	_tabKeydown: function( event ) {
34129		var focusedTab = $( $.ui.safeActiveElement( this.document[ 0 ] ) ).closest( "li" ),
34130			selectedIndex = this.tabs.index( focusedTab ),
34131			goingForward = true;
34132
34133		if ( this._handlePageNav( event ) ) {
34134			return;
34135		}
34136
34137		switch ( event.keyCode ) {
34138		case $.ui.keyCode.RIGHT:
34139		case $.ui.keyCode.DOWN:
34140			selectedIndex++;
34141			break;
34142		case $.ui.keyCode.UP:
34143		case $.ui.keyCode.LEFT:
34144			goingForward = false;
34145			selectedIndex--;
34146			break;
34147		case $.ui.keyCode.END:
34148			selectedIndex = this.anchors.length - 1;
34149			break;
34150		case $.ui.keyCode.HOME:
34151			selectedIndex = 0;
34152			break;
34153		case $.ui.keyCode.SPACE:
34154
34155			// Activate only, no collapsing
34156			event.preventDefault();
34157			clearTimeout( this.activating );
34158			this._activate( selectedIndex );
34159			return;
34160		case $.ui.keyCode.ENTER:
34161
34162			// Toggle (cancel delayed activation, allow collapsing)
34163			event.preventDefault();
34164			clearTimeout( this.activating );
34165
34166			// Determine if we should collapse or activate
34167			this._activate( selectedIndex === this.options.active ? false : selectedIndex );
34168			return;
34169		default:
34170			return;
34171		}
34172
34173		// Focus the appropriate tab, based on which key was pressed
34174		event.preventDefault();
34175		clearTimeout( this.activating );
34176		selectedIndex = this._focusNextTab( selectedIndex, goingForward );
34177
34178		// Navigating with control/command key will prevent automatic activation
34179		if ( !event.ctrlKey && !event.metaKey ) {
34180
34181			// Update aria-selected immediately so that AT think the tab is already selected.
34182			// Otherwise AT may confuse the user by stating that they need to activate the tab,
34183			// but the tab will already be activated by the time the announcement finishes.
34184			focusedTab.attr( "aria-selected", "false" );
34185			this.tabs.eq( selectedIndex ).attr( "aria-selected", "true" );
34186
34187			this.activating = this._delay( function() {
34188				this.option( "active", selectedIndex );
34189			}, this.delay );
34190		}
34191	},
34192
34193	_panelKeydown: function( event ) {
34194		if ( this._handlePageNav( event ) ) {
34195			return;
34196		}
34197
34198		// Ctrl+up moves focus to the current tab
34199		if ( event.ctrlKey && event.keyCode === $.ui.keyCode.UP ) {
34200			event.preventDefault();
34201			this.active.trigger( "focus" );
34202		}
34203	},
34204
34205	// Alt+page up/down moves focus to the previous/next tab (and activates)
34206	_handlePageNav: function( event ) {
34207		if ( event.altKey && event.keyCode === $.ui.keyCode.PAGE_UP ) {
34208			this._activate( this._focusNextTab( this.options.active - 1, false ) );
34209			return true;
34210		}
34211		if ( event.altKey && event.keyCode === $.ui.keyCode.PAGE_DOWN ) {
34212			this._activate( this._focusNextTab( this.options.active + 1, true ) );
34213			return true;
34214		}
34215	},
34216
34217	_findNextTab: function( index, goingForward ) {
34218		var lastTabIndex = this.tabs.length - 1;
34219
34220		function constrain() {
34221			if ( index > lastTabIndex ) {
34222				index = 0;
34223			}
34224			if ( index < 0 ) {
34225				index = lastTabIndex;
34226			}
34227			return index;
34228		}
34229
34230		while ( $.inArray( constrain(), this.options.disabled ) !== -1 ) {
34231			index = goingForward ? index + 1 : index - 1;
34232		}
34233
34234		return index;
34235	},
34236
34237	_focusNextTab: function( index, goingForward ) {
34238		index = this._findNextTab( index, goingForward );
34239		this.tabs.eq( index ).trigger( "focus" );
34240		return index;
34241	},
34242
34243	_setOption: function( key, value ) {
34244		if ( key === "active" ) {
34245
34246			// _activate() will handle invalid values and update this.options
34247			this._activate( value );
34248			return;
34249		}
34250
34251		this._super( key, value );
34252
34253		if ( key === "collapsible" ) {
34254			this._toggleClass( "ui-tabs-collapsible", null, value );
34255
34256			// Setting collapsible: false while collapsed; open first panel
34257			if ( !value && this.options.active === false ) {
34258				this._activate( 0 );
34259			}
34260		}
34261
34262		if ( key === "event" ) {
34263			this._setupEvents( value );
34264		}
34265
34266		if ( key === "heightStyle" ) {
34267			this._setupHeightStyle( value );
34268		}
34269	},
34270
34271	_sanitizeSelector: function( hash ) {
34272		return hash ? hash.replace( /[!"$%&'()*+,.\/:;<=>?@\[\]\^`{|}~]/g, "\\$&" ) : "";
34273	},
34274
34275	refresh: function() {
34276		var options = this.options,
34277			lis = this.tablist.children( ":has(a[href])" );
34278
34279		// Get disabled tabs from class attribute from HTML
34280		// this will get converted to a boolean if needed in _refresh()
34281		options.disabled = $.map( lis.filter( ".ui-state-disabled" ), function( tab ) {
34282			return lis.index( tab );
34283		} );
34284
34285		this._processTabs();
34286
34287		// Was collapsed or no tabs
34288		if ( options.active === false || !this.anchors.length ) {
34289			options.active = false;
34290			this.active = $();
34291
34292		// was active, but active tab is gone
34293		} else if ( this.active.length && !$.contains( this.tablist[ 0 ], this.active[ 0 ] ) ) {
34294
34295			// all remaining tabs are disabled
34296			if ( this.tabs.length === options.disabled.length ) {
34297				options.active = false;
34298				this.active = $();
34299
34300			// activate previous tab
34301			} else {
34302				this._activate( this._findNextTab( Math.max( 0, options.active - 1 ), false ) );
34303			}
34304
34305		// was active, active tab still exists
34306		} else {
34307
34308			// make sure active index is correct
34309			options.active = this.tabs.index( this.active );
34310		}
34311
34312		this._refresh();
34313	},
34314
34315	_refresh: function() {
34316		this._setOptionDisabled( this.options.disabled );
34317		this._setupEvents( this.options.event );
34318		this._setupHeightStyle( this.options.heightStyle );
34319
34320		this.tabs.not( this.active ).attr( {
34321			"aria-selected": "false",
34322			"aria-expanded": "false",
34323			tabIndex: -1
34324		} );
34325		this.panels.not( this._getPanelForTab( this.active ) )
34326			.hide()
34327			.attr( {
34328				"aria-hidden": "true"
34329			} );
34330
34331		// Make sure one tab is in the tab order
34332		if ( !this.active.length ) {
34333			this.tabs.eq( 0 ).attr( "tabIndex", 0 );
34334		} else {
34335			this.active
34336				.attr( {
34337					"aria-selected": "true",
34338					"aria-expanded": "true",
34339					tabIndex: 0
34340				} );
34341			this._addClass( this.active, "ui-tabs-active", "ui-state-active" );
34342			this._getPanelForTab( this.active )
34343				.show()
34344				.attr( {
34345					"aria-hidden": "false"
34346				} );
34347		}
34348	},
34349
34350	_processTabs: function() {
34351		var that = this,
34352			prevTabs = this.tabs,
34353			prevAnchors = this.anchors,
34354			prevPanels = this.panels;
34355
34356		this.tablist = this._getList().attr( "role", "tablist" );
34357		this._addClass( this.tablist, "ui-tabs-nav",
34358			"ui-helper-reset ui-helper-clearfix ui-widget-header" );
34359
34360		// Prevent users from focusing disabled tabs via click
34361		this.tablist
34362			.on( "mousedown" + this.eventNamespace, "> li", function( event ) {
34363				if ( $( this ).is( ".ui-state-disabled" ) ) {
34364					event.preventDefault();
34365				}
34366			} )
34367
34368			// Support: IE <9
34369			// Preventing the default action in mousedown doesn't prevent IE
34370			// from focusing the element, so if the anchor gets focused, blur.
34371			// We don't have to worry about focusing the previously focused
34372			// element since clicking on a non-focusable element should focus
34373			// the body anyway.
34374			.on( "focus" + this.eventNamespace, ".ui-tabs-anchor", function() {
34375				if ( $( this ).closest( "li" ).is( ".ui-state-disabled" ) ) {
34376					this.blur();
34377				}
34378			} );
34379
34380		this.tabs = this.tablist.find( "> li:has(a[href])" )
34381			.attr( {
34382				role: "tab",
34383				tabIndex: -1
34384			} );
34385		this._addClass( this.tabs, "ui-tabs-tab", "ui-state-default" );
34386
34387		this.anchors = this.tabs.map( function() {
34388			return $( "a", this )[ 0 ];
34389		} )
34390			.attr( {
34391				role: "presentation",
34392				tabIndex: -1
34393			} );
34394		this._addClass( this.anchors, "ui-tabs-anchor" );
34395
34396		this.panels = $();
34397
34398		this.anchors.each( function( i, anchor ) {
34399			var selector, panel, panelId,
34400				anchorId = $( anchor ).uniqueId().attr( "id" ),
34401				tab = $( anchor ).closest( "li" ),
34402				originalAriaControls = tab.attr( "aria-controls" );
34403
34404			// Inline tab
34405			if ( that._isLocal( anchor ) ) {
34406				selector = anchor.hash;
34407				panelId = selector.substring( 1 );
34408				panel = that.element.find( that._sanitizeSelector( selector ) );
34409
34410			// remote tab
34411			} else {
34412
34413				// If the tab doesn't already have aria-controls,
34414				// generate an id by using a throw-away element
34415				panelId = tab.attr( "aria-controls" ) || $( {} ).uniqueId()[ 0 ].id;
34416				selector = "#" + panelId;
34417				panel = that.element.find( selector );
34418				if ( !panel.length ) {
34419					panel = that._createPanel( panelId );
34420					panel.insertAfter( that.panels[ i - 1 ] || that.tablist );
34421				}
34422				panel.attr( "aria-live", "polite" );
34423			}
34424
34425			if ( panel.length ) {
34426				that.panels = that.panels.add( panel );
34427			}
34428			if ( originalAriaControls ) {
34429				tab.data( "ui-tabs-aria-controls", originalAriaControls );
34430			}
34431			tab.attr( {
34432				"aria-controls": panelId,
34433				"aria-labelledby": anchorId
34434			} );
34435			panel.attr( "aria-labelledby", anchorId );
34436		} );
34437
34438		this.panels.attr( "role", "tabpanel" );
34439		this._addClass( this.panels, "ui-tabs-panel", "ui-widget-content" );
34440
34441		// Avoid memory leaks (#10056)
34442		if ( prevTabs ) {
34443			this._off( prevTabs.not( this.tabs ) );
34444			this._off( prevAnchors.not( this.anchors ) );
34445			this._off( prevPanels.not( this.panels ) );
34446		}
34447	},
34448
34449	// Allow overriding how to find the list for rare usage scenarios (#7715)
34450	_getList: function() {
34451		return this.tablist || this.element.find( "ol, ul" ).eq( 0 );
34452	},
34453
34454	_createPanel: function( id ) {
34455		return $( "<div>" )
34456			.attr( "id", id )
34457			.data( "ui-tabs-destroy", true );
34458	},
34459
34460	_setOptionDisabled: function( disabled ) {
34461		var currentItem, li, i;
34462
34463		if ( $.isArray( disabled ) ) {
34464			if ( !disabled.length ) {
34465				disabled = false;
34466			} else if ( disabled.length === this.anchors.length ) {
34467				disabled = true;
34468			}
34469		}
34470
34471		// Disable tabs
34472		for ( i = 0; ( li = this.tabs[ i ] ); i++ ) {
34473			currentItem = $( li );
34474			if ( disabled === true || $.inArray( i, disabled ) !== -1 ) {
34475				currentItem.attr( "aria-disabled", "true" );
34476				this._addClass( currentItem, null, "ui-state-disabled" );
34477			} else {
34478				currentItem.removeAttr( "aria-disabled" );
34479				this._removeClass( currentItem, null, "ui-state-disabled" );
34480			}
34481		}
34482
34483		this.options.disabled = disabled;
34484
34485		this._toggleClass( this.widget(), this.widgetFullName + "-disabled", null,
34486			disabled === true );
34487	},
34488
34489	_setupEvents: function( event ) {
34490		var events = {};
34491		if ( event ) {
34492			$.each( event.split( " " ), function( index, eventName ) {
34493				events[ eventName ] = "_eventHandler";
34494			} );
34495		}
34496
34497		this._off( this.anchors.add( this.tabs ).add( this.panels ) );
34498
34499		// Always prevent the default action, even when disabled
34500		this._on( true, this.anchors, {
34501			click: function( event ) {
34502				event.preventDefault();
34503			}
34504		} );
34505		this._on( this.anchors, events );
34506		this._on( this.tabs, { keydown: "_tabKeydown" } );
34507		this._on( this.panels, { keydown: "_panelKeydown" } );
34508
34509		this._focusable( this.tabs );
34510		this._hoverable( this.tabs );
34511	},
34512
34513	_setupHeightStyle: function( heightStyle ) {
34514		var maxHeight,
34515			parent = this.element.parent();
34516
34517		if ( heightStyle === "fill" ) {
34518			maxHeight = parent.height();
34519			maxHeight -= this.element.outerHeight() - this.element.height();
34520
34521			this.element.siblings( ":visible" ).each( function() {
34522				var elem = $( this ),
34523					position = elem.css( "position" );
34524
34525				if ( position === "absolute" || position === "fixed" ) {
34526					return;
34527				}
34528				maxHeight -= elem.outerHeight( true );
34529			} );
34530
34531			this.element.children().not( this.panels ).each( function() {
34532				maxHeight -= $( this ).outerHeight( true );
34533			} );
34534
34535			this.panels.each( function() {
34536				$( this ).height( Math.max( 0, maxHeight -
34537					$( this ).innerHeight() + $( this ).height() ) );
34538			} )
34539				.css( "overflow", "auto" );
34540		} else if ( heightStyle === "auto" ) {
34541			maxHeight = 0;
34542			this.panels.each( function() {
34543				maxHeight = Math.max( maxHeight, $( this ).height( "" ).height() );
34544			} ).height( maxHeight );
34545		}
34546	},
34547
34548	_eventHandler: function( event ) {
34549		var options = this.options,
34550			active = this.active,
34551			anchor = $( event.currentTarget ),
34552			tab = anchor.closest( "li" ),
34553			clickedIsActive = tab[ 0 ] === active[ 0 ],
34554			collapsing = clickedIsActive && options.collapsible,
34555			toShow = collapsing ? $() : this._getPanelForTab( tab ),
34556			toHide = !active.length ? $() : this._getPanelForTab( active ),
34557			eventData = {
34558				oldTab: active,
34559				oldPanel: toHide,
34560				newTab: collapsing ? $() : tab,
34561				newPanel: toShow
34562			};
34563
34564		event.preventDefault();
34565
34566		if ( tab.hasClass( "ui-state-disabled" ) ||
34567
34568				// tab is already loading
34569				tab.hasClass( "ui-tabs-loading" ) ||
34570
34571				// can't switch durning an animation
34572				this.running ||
34573
34574				// click on active header, but not collapsible
34575				( clickedIsActive && !options.collapsible ) ||
34576
34577				// allow canceling activation
34578				( this._trigger( "beforeActivate", event, eventData ) === false ) ) {
34579			return;
34580		}
34581
34582		options.active = collapsing ? false : this.tabs.index( tab );
34583
34584		this.active = clickedIsActive ? $() : tab;
34585		if ( this.xhr ) {
34586			this.xhr.abort();
34587		}
34588
34589		if ( !toHide.length && !toShow.length ) {
34590			$.error( "jQuery UI Tabs: Mismatching fragment identifier." );
34591		}
34592
34593		if ( toShow.length ) {
34594			this.load( this.tabs.index( tab ), event );
34595		}
34596		this._toggle( event, eventData );
34597	},
34598
34599	// Handles show/hide for selecting tabs
34600	_toggle: function( event, eventData ) {
34601		var that = this,
34602			toShow = eventData.newPanel,
34603			toHide = eventData.oldPanel;
34604
34605		this.running = true;
34606
34607		function complete() {
34608			that.running = false;
34609			that._trigger( "activate", event, eventData );
34610		}
34611
34612		function show() {
34613			that._addClass( eventData.newTab.closest( "li" ), "ui-tabs-active", "ui-state-active" );
34614
34615			if ( toShow.length && that.options.show ) {
34616				that._show( toShow, that.options.show, complete );
34617			} else {
34618				toShow.show();
34619				complete();
34620			}
34621		}
34622
34623		// Start out by hiding, then showing, then completing
34624		if ( toHide.length && this.options.hide ) {
34625			this._hide( toHide, this.options.hide, function() {
34626				that._removeClass( eventData.oldTab.closest( "li" ),
34627					"ui-tabs-active", "ui-state-active" );
34628				show();
34629			} );
34630		} else {
34631			this._removeClass( eventData.oldTab.closest( "li" ),
34632				"ui-tabs-active", "ui-state-active" );
34633			toHide.hide();
34634			show();
34635		}
34636
34637		toHide.attr( "aria-hidden", "true" );
34638		eventData.oldTab.attr( {
34639			"aria-selected": "false",
34640			"aria-expanded": "false"
34641		} );
34642
34643		// If we're switching tabs, remove the old tab from the tab order.
34644		// If we're opening from collapsed state, remove the previous tab from the tab order.
34645		// If we're collapsing, then keep the collapsing tab in the tab order.
34646		if ( toShow.length && toHide.length ) {
34647			eventData.oldTab.attr( "tabIndex", -1 );
34648		} else if ( toShow.length ) {
34649			this.tabs.filter( function() {
34650				return $( this ).attr( "tabIndex" ) === 0;
34651			} )
34652				.attr( "tabIndex", -1 );
34653		}
34654
34655		toShow.attr( "aria-hidden", "false" );
34656		eventData.newTab.attr( {
34657			"aria-selected": "true",
34658			"aria-expanded": "true",
34659			tabIndex: 0
34660		} );
34661	},
34662
34663	_activate: function( index ) {
34664		var anchor,
34665			active = this._findActive( index );
34666
34667		// Trying to activate the already active panel
34668		if ( active[ 0 ] === this.active[ 0 ] ) {
34669			return;
34670		}
34671
34672		// Trying to collapse, simulate a click on the current active header
34673		if ( !active.length ) {
34674			active = this.active;
34675		}
34676
34677		anchor = active.find( ".ui-tabs-anchor" )[ 0 ];
34678		this._eventHandler( {
34679			target: anchor,
34680			currentTarget: anchor,
34681			preventDefault: $.noop
34682		} );
34683	},
34684
34685	_findActive: function( index ) {
34686		return index === false ? $() : this.tabs.eq( index );
34687	},
34688
34689	_getIndex: function( index ) {
34690
34691		// meta-function to give users option to provide a href string instead of a numerical index.
34692		if ( typeof index === "string" ) {
34693			index = this.anchors.index( this.anchors.filter( "[href$='" +
34694				$.ui.escapeSelector( index ) + "']" ) );
34695		}
34696
34697		return index;
34698	},
34699
34700	_destroy: function() {
34701		if ( this.xhr ) {
34702			this.xhr.abort();
34703		}
34704
34705		this.tablist
34706			.removeAttr( "role" )
34707			.off( this.eventNamespace );
34708
34709		this.anchors
34710			.removeAttr( "role tabIndex" )
34711			.removeUniqueId();
34712
34713		this.tabs.add( this.panels ).each( function() {
34714			if ( $.data( this, "ui-tabs-destroy" ) ) {
34715				$( this ).remove();
34716			} else {
34717				$( this ).removeAttr( "role tabIndex " +
34718					"aria-live aria-busy aria-selected aria-labelledby aria-hidden aria-expanded" );
34719			}
34720		} );
34721
34722		this.tabs.each( function() {
34723			var li = $( this ),
34724				prev = li.data( "ui-tabs-aria-controls" );
34725			if ( prev ) {
34726				li
34727					.attr( "aria-controls", prev )
34728					.removeData( "ui-tabs-aria-controls" );
34729			} else {
34730				li.removeAttr( "aria-controls" );
34731			}
34732		} );
34733
34734		this.panels.show();
34735
34736		if ( this.options.heightStyle !== "content" ) {
34737			this.panels.css( "height", "" );
34738		}
34739	},
34740
34741	enable: function( index ) {
34742		var disabled = this.options.disabled;
34743		if ( disabled === false ) {
34744			return;
34745		}
34746
34747		if ( index === undefined ) {
34748			disabled = false;
34749		} else {
34750			index = this._getIndex( index );
34751			if ( $.isArray( disabled ) ) {
34752				disabled = $.map( disabled, function( num ) {
34753					return num !== index ? num : null;
34754				} );
34755			} else {
34756				disabled = $.map( this.tabs, function( li, num ) {
34757					return num !== index ? num : null;
34758				} );
34759			}
34760		}
34761		this._setOptionDisabled( disabled );
34762	},
34763
34764	disable: function( index ) {
34765		var disabled = this.options.disabled;
34766		if ( disabled === true ) {
34767			return;
34768		}
34769
34770		if ( index === undefined ) {
34771			disabled = true;
34772		} else {
34773			index = this._getIndex( index );
34774			if ( $.inArray( index, disabled ) !== -1 ) {
34775				return;
34776			}
34777			if ( $.isArray( disabled ) ) {
34778				disabled = $.merge( [ index ], disabled ).sort();
34779			} else {
34780				disabled = [ index ];
34781			}
34782		}
34783		this._setOptionDisabled( disabled );
34784	},
34785
34786	load: function( index, event ) {
34787		index = this._getIndex( index );
34788		var that = this,
34789			tab = this.tabs.eq( index ),
34790			anchor = tab.find( ".ui-tabs-anchor" ),
34791			panel = this._getPanelForTab( tab ),
34792			eventData = {
34793				tab: tab,
34794				panel: panel
34795			},
34796			complete = function( jqXHR, status ) {
34797				if ( status === "abort" ) {
34798					that.panels.stop( false, true );
34799				}
34800
34801				that._removeClass( tab, "ui-tabs-loading" );
34802				panel.removeAttr( "aria-busy" );
34803
34804				if ( jqXHR === that.xhr ) {
34805					delete that.xhr;
34806				}
34807			};
34808
34809		// Not remote
34810		if ( this._isLocal( anchor[ 0 ] ) ) {
34811			return;
34812		}
34813
34814		this.xhr = $.ajax( this._ajaxSettings( anchor, event, eventData ) );
34815
34816		// Support: jQuery <1.8
34817		// jQuery <1.8 returns false if the request is canceled in beforeSend,
34818		// but as of 1.8, $.ajax() always returns a jqXHR object.
34819		if ( this.xhr && this.xhr.statusText !== "canceled" ) {
34820			this._addClass( tab, "ui-tabs-loading" );
34821			panel.attr( "aria-busy", "true" );
34822
34823			this.xhr
34824				.done( function( response, status, jqXHR ) {
34825
34826					// support: jQuery <1.8
34827					// http://bugs.jquery.com/ticket/11778
34828					setTimeout( function() {
34829						panel.html( response );
34830						that._trigger( "load", event, eventData );
34831
34832						complete( jqXHR, status );
34833					}, 1 );
34834				} )
34835				.fail( function( jqXHR, status ) {
34836
34837					// support: jQuery <1.8
34838					// http://bugs.jquery.com/ticket/11778
34839					setTimeout( function() {
34840						complete( jqXHR, status );
34841					}, 1 );
34842				} );
34843		}
34844	},
34845
34846	_ajaxSettings: function( anchor, event, eventData ) {
34847		var that = this;
34848		return {
34849
34850			// Support: IE <11 only
34851			// Strip any hash that exists to prevent errors with the Ajax request
34852			url: anchor.attr( "href" ).replace( /#.*$/, "" ),
34853			beforeSend: function( jqXHR, settings ) {
34854				return that._trigger( "beforeLoad", event,
34855					$.extend( { jqXHR: jqXHR, ajaxSettings: settings }, eventData ) );
34856			}
34857		};
34858	},
34859
34860	_getPanelForTab: function( tab ) {
34861		var id = $( tab ).attr( "aria-controls" );
34862		return this.element.find( this._sanitizeSelector( "#" + id ) );
34863	}
34864} );
34865
34866// DEPRECATED
34867// TODO: Switch return back to widget declaration at top of file when this is removed
34868if ( $.uiBackCompat !== false ) {
34869
34870	// Backcompat for ui-tab class (now ui-tabs-tab)
34871	$.widget( "ui.tabs", $.ui.tabs, {
34872		_processTabs: function() {
34873			this._superApply( arguments );
34874			this._addClass( this.tabs, "ui-tab" );
34875		}
34876	} );
34877}
34878
34879var widgetsTabs = $.ui.tabs;
34880
34881
34882/*!
34883 * jQuery UI Tooltip 1.12.1
34884 * http://jqueryui.com
34885 *
34886 * Copyright jQuery Foundation and other contributors
34887 * Released under the MIT license.
34888 * http://jquery.org/license
34889 */
34890
34891//>>label: Tooltip
34892//>>group: Widgets
34893//>>description: Shows additional information for any element on hover or focus.
34894//>>docs: http://api.jqueryui.com/tooltip/
34895//>>demos: http://jqueryui.com/tooltip/
34896//>>css.structure: ../../themes/base/core.css
34897//>>css.structure: ../../themes/base/tooltip.css
34898//>>css.theme: ../../themes/base/theme.css
34899
34900
34901
34902$.widget( "ui.tooltip", {
34903	version: "1.12.1",
34904	options: {
34905		classes: {
34906			"ui-tooltip": "ui-corner-all ui-widget-shadow"
34907		},
34908		content: function() {
34909
34910			// support: IE<9, Opera in jQuery <1.7
34911			// .text() can't accept undefined, so coerce to a string
34912			var title = $( this ).attr( "title" ) || "";
34913
34914			// Escape title, since we're going from an attribute to raw HTML
34915			return $( "<a>" ).text( title ).html();
34916		},
34917		hide: true,
34918
34919		// Disabled elements have inconsistent behavior across browsers (#8661)
34920		items: "[title]:not([disabled])",
34921		position: {
34922			my: "left top+15",
34923			at: "left bottom",
34924			collision: "flipfit flip"
34925		},
34926		show: true,
34927		track: false,
34928
34929		// Callbacks
34930		close: null,
34931		open: null
34932	},
34933
34934	_addDescribedBy: function( elem, id ) {
34935		var describedby = ( elem.attr( "aria-describedby" ) || "" ).split( /\s+/ );
34936		describedby.push( id );
34937		elem
34938			.data( "ui-tooltip-id", id )
34939			.attr( "aria-describedby", $.trim( describedby.join( " " ) ) );
34940	},
34941
34942	_removeDescribedBy: function( elem ) {
34943		var id = elem.data( "ui-tooltip-id" ),
34944			describedby = ( elem.attr( "aria-describedby" ) || "" ).split( /\s+/ ),
34945			index = $.inArray( id, describedby );
34946
34947		if ( index !== -1 ) {
34948			describedby.splice( index, 1 );
34949		}
34950
34951		elem.removeData( "ui-tooltip-id" );
34952		describedby = $.trim( describedby.join( " " ) );
34953		if ( describedby ) {
34954			elem.attr( "aria-describedby", describedby );
34955		} else {
34956			elem.removeAttr( "aria-describedby" );
34957		}
34958	},
34959
34960	_create: function() {
34961		this._on( {
34962			mouseover: "open",
34963			focusin: "open"
34964		} );
34965
34966		// IDs of generated tooltips, needed for destroy
34967		this.tooltips = {};
34968
34969		// IDs of parent tooltips where we removed the title attribute
34970		this.parents = {};
34971
34972		// Append the aria-live region so tooltips announce correctly
34973		this.liveRegion = $( "<div>" )
34974			.attr( {
34975				role: "log",
34976				"aria-live": "assertive",
34977				"aria-relevant": "additions"
34978			} )
34979			.appendTo( this.document[ 0 ].body );
34980		this._addClass( this.liveRegion, null, "ui-helper-hidden-accessible" );
34981
34982		this.disabledTitles = $( [] );
34983	},
34984
34985	_setOption: function( key, value ) {
34986		var that = this;
34987
34988		this._super( key, value );
34989
34990		if ( key === "content" ) {
34991			$.each( this.tooltips, function( id, tooltipData ) {
34992				that._updateContent( tooltipData.element );
34993			} );
34994		}
34995	},
34996
34997	_setOptionDisabled: function( value ) {
34998		this[ value ? "_disable" : "_enable" ]();
34999	},
35000
35001	_disable: function() {
35002		var that = this;
35003
35004		// Close open tooltips
35005		$.each( this.tooltips, function( id, tooltipData ) {
35006			var event = $.Event( "blur" );
35007			event.target = event.currentTarget = tooltipData.element[ 0 ];
35008			that.close( event, true );
35009		} );
35010
35011		// Remove title attributes to prevent native tooltips
35012		this.disabledTitles = this.disabledTitles.add(
35013			this.element.find( this.options.items ).addBack()
35014				.filter( function() {
35015					var element = $( this );
35016					if ( element.is( "[title]" ) ) {
35017						return element
35018							.data( "ui-tooltip-title", element.attr( "title" ) )
35019							.removeAttr( "title" );
35020					}
35021				} )
35022		);
35023	},
35024
35025	_enable: function() {
35026
35027		// restore title attributes
35028		this.disabledTitles.each( function() {
35029			var element = $( this );
35030			if ( element.data( "ui-tooltip-title" ) ) {
35031				element.attr( "title", element.data( "ui-tooltip-title" ) );
35032			}
35033		} );
35034		this.disabledTitles = $( [] );
35035	},
35036
35037	open: function( event ) {
35038		var that = this,
35039			target = $( event ? event.target : this.element )
35040
35041				// we need closest here due to mouseover bubbling,
35042				// but always pointing at the same event target
35043				.closest( this.options.items );
35044
35045		// No element to show a tooltip for or the tooltip is already open
35046		if ( !target.length || target.data( "ui-tooltip-id" ) ) {
35047			return;
35048		}
35049
35050		if ( target.attr( "title" ) ) {
35051			target.data( "ui-tooltip-title", target.attr( "title" ) );
35052		}
35053
35054		target.data( "ui-tooltip-open", true );
35055
35056		// Kill parent tooltips, custom or native, for hover
35057		if ( event && event.type === "mouseover" ) {
35058			target.parents().each( function() {
35059				var parent = $( this ),
35060					blurEvent;
35061				if ( parent.data( "ui-tooltip-open" ) ) {
35062					blurEvent = $.Event( "blur" );
35063					blurEvent.target = blurEvent.currentTarget = this;
35064					that.close( blurEvent, true );
35065				}
35066				if ( parent.attr( "title" ) ) {
35067					parent.uniqueId();
35068					that.parents[ this.id ] = {
35069						element: this,
35070						title: parent.attr( "title" )
35071					};
35072					parent.attr( "title", "" );
35073				}
35074			} );
35075		}
35076
35077		this._registerCloseHandlers( event, target );
35078		this._updateContent( target, event );
35079	},
35080
35081	_updateContent: function( target, event ) {
35082		var content,
35083			contentOption = this.options.content,
35084			that = this,
35085			eventType = event ? event.type : null;
35086
35087		if ( typeof contentOption === "string" || contentOption.nodeType ||
35088				contentOption.jquery ) {
35089			return this._open( event, target, contentOption );
35090		}
35091
35092		content = contentOption.call( target[ 0 ], function( response ) {
35093
35094			// IE may instantly serve a cached response for ajax requests
35095			// delay this call to _open so the other call to _open runs first
35096			that._delay( function() {
35097
35098				// Ignore async response if tooltip was closed already
35099				if ( !target.data( "ui-tooltip-open" ) ) {
35100					return;
35101				}
35102
35103				// JQuery creates a special event for focusin when it doesn't
35104				// exist natively. To improve performance, the native event
35105				// object is reused and the type is changed. Therefore, we can't
35106				// rely on the type being correct after the event finished
35107				// bubbling, so we set it back to the previous value. (#8740)
35108				if ( event ) {
35109					event.type = eventType;
35110				}
35111				this._open( event, target, response );
35112			} );
35113		} );
35114		if ( content ) {
35115			this._open( event, target, content );
35116		}
35117	},
35118
35119	_open: function( event, target, content ) {
35120		var tooltipData, tooltip, delayedShow, a11yContent,
35121			positionOption = $.extend( {}, this.options.position );
35122
35123		if ( !content ) {
35124			return;
35125		}
35126
35127		// Content can be updated multiple times. If the tooltip already
35128		// exists, then just update the content and bail.
35129		tooltipData = this._find( target );
35130		if ( tooltipData ) {
35131			tooltipData.tooltip.find( ".ui-tooltip-content" ).html( content );
35132			return;
35133		}
35134
35135		// If we have a title, clear it to prevent the native tooltip
35136		// we have to check first to avoid defining a title if none exists
35137		// (we don't want to cause an element to start matching [title])
35138		//
35139		// We use removeAttr only for key events, to allow IE to export the correct
35140		// accessible attributes. For mouse events, set to empty string to avoid
35141		// native tooltip showing up (happens only when removing inside mouseover).
35142		if ( target.is( "[title]" ) ) {
35143			if ( event && event.type === "mouseover" ) {
35144				target.attr( "title", "" );
35145			} else {
35146				target.removeAttr( "title" );
35147			}
35148		}
35149
35150		tooltipData = this._tooltip( target );
35151		tooltip = tooltipData.tooltip;
35152		this._addDescribedBy( target, tooltip.attr( "id" ) );
35153		tooltip.find( ".ui-tooltip-content" ).html( content );
35154
35155		// Support: Voiceover on OS X, JAWS on IE <= 9
35156		// JAWS announces deletions even when aria-relevant="additions"
35157		// Voiceover will sometimes re-read the entire log region's contents from the beginning
35158		this.liveRegion.children().hide();
35159		a11yContent = $( "<div>" ).html( tooltip.find( ".ui-tooltip-content" ).html() );
35160		a11yContent.removeAttr( "name" ).find( "[name]" ).removeAttr( "name" );
35161		a11yContent.removeAttr( "id" ).find( "[id]" ).removeAttr( "id" );
35162		a11yContent.appendTo( this.liveRegion );
35163
35164		function position( event ) {
35165			positionOption.of = event;
35166			if ( tooltip.is( ":hidden" ) ) {
35167				return;
35168			}
35169			tooltip.position( positionOption );
35170		}
35171		if ( this.options.track && event && /^mouse/.test( event.type ) ) {
35172			this._on( this.document, {
35173				mousemove: position
35174			} );
35175
35176			// trigger once to override element-relative positioning
35177			position( event );
35178		} else {
35179			tooltip.position( $.extend( {
35180				of: target
35181			}, this.options.position ) );
35182		}
35183
35184		tooltip.hide();
35185
35186		this._show( tooltip, this.options.show );
35187
35188		// Handle tracking tooltips that are shown with a delay (#8644). As soon
35189		// as the tooltip is visible, position the tooltip using the most recent
35190		// event.
35191		// Adds the check to add the timers only when both delay and track options are set (#14682)
35192		if ( this.options.track && this.options.show && this.options.show.delay ) {
35193			delayedShow = this.delayedShow = setInterval( function() {
35194				if ( tooltip.is( ":visible" ) ) {
35195					position( positionOption.of );
35196					clearInterval( delayedShow );
35197				}
35198			}, $.fx.interval );
35199		}
35200
35201		this._trigger( "open", event, { tooltip: tooltip } );
35202	},
35203
35204	_registerCloseHandlers: function( event, target ) {
35205		var events = {
35206			keyup: function( event ) {
35207				if ( event.keyCode === $.ui.keyCode.ESCAPE ) {
35208					var fakeEvent = $.Event( event );
35209					fakeEvent.currentTarget = target[ 0 ];
35210					this.close( fakeEvent, true );
35211				}
35212			}
35213		};
35214
35215		// Only bind remove handler for delegated targets. Non-delegated
35216		// tooltips will handle this in destroy.
35217		if ( target[ 0 ] !== this.element[ 0 ] ) {
35218			events.remove = function() {
35219				this._removeTooltip( this._find( target ).tooltip );
35220			};
35221		}
35222
35223		if ( !event || event.type === "mouseover" ) {
35224			events.mouseleave = "close";
35225		}
35226		if ( !event || event.type === "focusin" ) {
35227			events.focusout = "close";
35228		}
35229		this._on( true, target, events );
35230	},
35231
35232	close: function( event ) {
35233		var tooltip,
35234			that = this,
35235			target = $( event ? event.currentTarget : this.element ),
35236			tooltipData = this._find( target );
35237
35238		// The tooltip may already be closed
35239		if ( !tooltipData ) {
35240
35241			// We set ui-tooltip-open immediately upon open (in open()), but only set the
35242			// additional data once there's actually content to show (in _open()). So even if the
35243			// tooltip doesn't have full data, we always remove ui-tooltip-open in case we're in
35244			// the period between open() and _open().
35245			target.removeData( "ui-tooltip-open" );
35246			return;
35247		}
35248
35249		tooltip = tooltipData.tooltip;
35250
35251		// Disabling closes the tooltip, so we need to track when we're closing
35252		// to avoid an infinite loop in case the tooltip becomes disabled on close
35253		if ( tooltipData.closing ) {
35254			return;
35255		}
35256
35257		// Clear the interval for delayed tracking tooltips
35258		clearInterval( this.delayedShow );
35259
35260		// Only set title if we had one before (see comment in _open())
35261		// If the title attribute has changed since open(), don't restore
35262		if ( target.data( "ui-tooltip-title" ) && !target.attr( "title" ) ) {
35263			target.attr( "title", target.data( "ui-tooltip-title" ) );
35264		}
35265
35266		this._removeDescribedBy( target );
35267
35268		tooltipData.hiding = true;
35269		tooltip.stop( true );
35270		this._hide( tooltip, this.options.hide, function() {
35271			that._removeTooltip( $( this ) );
35272		} );
35273
35274		target.removeData( "ui-tooltip-open" );
35275		this._off( target, "mouseleave focusout keyup" );
35276
35277		// Remove 'remove' binding only on delegated targets
35278		if ( target[ 0 ] !== this.element[ 0 ] ) {
35279			this._off( target, "remove" );
35280		}
35281		this._off( this.document, "mousemove" );
35282
35283		if ( event && event.type === "mouseleave" ) {
35284			$.each( this.parents, function( id, parent ) {
35285				$( parent.element ).attr( "title", parent.title );
35286				delete that.parents[ id ];
35287			} );
35288		}
35289
35290		tooltipData.closing = true;
35291		this._trigger( "close", event, { tooltip: tooltip } );
35292		if ( !tooltipData.hiding ) {
35293			tooltipData.closing = false;
35294		}
35295	},
35296
35297	_tooltip: function( element ) {
35298		var tooltip = $( "<div>" ).attr( "role", "tooltip" ),
35299			content = $( "<div>" ).appendTo( tooltip ),
35300			id = tooltip.uniqueId().attr( "id" );
35301
35302		this._addClass( content, "ui-tooltip-content" );
35303		this._addClass( tooltip, "ui-tooltip", "ui-widget ui-widget-content" );
35304
35305		tooltip.appendTo( this._appendTo( element ) );
35306
35307		return this.tooltips[ id ] = {
35308			element: element,
35309			tooltip: tooltip
35310		};
35311	},
35312
35313	_find: function( target ) {
35314		var id = target.data( "ui-tooltip-id" );
35315		return id ? this.tooltips[ id ] : null;
35316	},
35317
35318	_removeTooltip: function( tooltip ) {
35319		tooltip.remove();
35320		delete this.tooltips[ tooltip.attr( "id" ) ];
35321	},
35322
35323	_appendTo: function( target ) {
35324		var element = target.closest( ".ui-front, dialog" );
35325
35326		if ( !element.length ) {
35327			element = this.document[ 0 ].body;
35328		}
35329
35330		return element;
35331	},
35332
35333	_destroy: function() {
35334		var that = this;
35335
35336		// Close open tooltips
35337		$.each( this.tooltips, function( id, tooltipData ) {
35338
35339			// Delegate to close method to handle common cleanup
35340			var event = $.Event( "blur" ),
35341				element = tooltipData.element;
35342			event.target = event.currentTarget = element[ 0 ];
35343			that.close( event, true );
35344
35345			// Remove immediately; destroying an open tooltip doesn't use the
35346			// hide animation
35347			$( "#" + id ).remove();
35348
35349			// Restore the title
35350			if ( element.data( "ui-tooltip-title" ) ) {
35351
35352				// If the title attribute has changed since open(), don't restore
35353				if ( !element.attr( "title" ) ) {
35354					element.attr( "title", element.data( "ui-tooltip-title" ) );
35355				}
35356				element.removeData( "ui-tooltip-title" );
35357			}
35358		} );
35359		this.liveRegion.remove();
35360	}
35361} );
35362
35363// DEPRECATED
35364// TODO: Switch return back to widget declaration at top of file when this is removed
35365if ( $.uiBackCompat !== false ) {
35366
35367	// Backcompat for tooltipClass option
35368	$.widget( "ui.tooltip", $.ui.tooltip, {
35369		options: {
35370			tooltipClass: null
35371		},
35372		_tooltip: function() {
35373			var tooltipData = this._superApply( arguments );
35374			if ( this.options.tooltipClass ) {
35375				tooltipData.tooltip.addClass( this.options.tooltipClass );
35376			}
35377			return tooltipData;
35378		}
35379	} );
35380}
35381
35382var widgetsTooltip = $.ui.tooltip;
35383
35384
35385
35386
35387}));
35387
35388/*!
35389 * Datepicker for Bootstrap v1.6.4 (https://github.com/eternicode/bootstrap-datepicker)
35390 *
35391 * Copyright 2012 Stefan Petre
35392 * Improvements by Andrew Rowls
35393 * Licensed under the Apache License v2.0 (http://www.apache.org/licenses/LICENSE-2.0)
35394 */
35395!function(a){"function"==typeof define&&define.amd?define(["jquery"],a):a("object"==typeof exports?require("jquery"):jQuery)}(function(a,b){function c(){return new Date(Date.UTC.apply(Date,arguments))}function d(){var a=new Date;return c(a.getFullYear(),a.getMonth(),a.getDate())}function e(a,b){return a.getUTCFullYear()===b.getUTCFullYear()&&a.getUTCMonth()===b.getUTCMonth()&&a.getUTCDate()===b.getUTCDate()}function f(a){return function(){return this[a].apply(this,arguments)}}
vendor: 16,384 bytes, line 35395
35395function g(a){return a&&!isNaN(a.getTime())}function h(b,c){function d(a,b){return b.toLowerCase()}var e,f=a(b).data(),g={},h=new RegExp("^"+c.toLowerCase()+"([A-Z])");c=new RegExp("^"+c.toLowerCase());for(var i in f)c.test(i)&&(e=i.replace(h,d),g[e]=f[i]);return g}function i(b){var c={};if(q[b]||(b=b.split("-")[0],q[b])){var d=q[b];return a.each(p,function(a,b){b in d&&(c[b]=d[b])}),c}}var j=function(){var b={get:function(a){return this.slice(a)[0]},contains:function(a){for(var b=a&&a.valueOf(),c=0,d=this.length;d>c;c++)if(this[c].valueOf()===b)return c;return-1},remove:function(a){this.splice(a,1)},replace:function(b){b&&(a.isArray(b)||(b=[b]),this.clear(),this.push.apply(this,b))},clear:function(){this.length=0},copy:function(){var a=new j;return a.replace(this),a}};return function(){var c=[];return c.push.apply(c,arguments),a.extend(c,b),c}}(),k=function(b,c){a(b).data("datepicker",this),this._process_options(c),this.dates=new j,this.viewDate=this.o.defaultViewDate,this.focusDate=null,this.element=a(b),this.isInput=this.element.is("input"),this.inputField=this.isInput?this.element:this.element.find("input"),this.component=this.element.hasClass("date")?this.element.find(".add-on, .input-group-addon, .btn"):!1,this.hasInput=this.component&&this.inputField.length,this.component&&0===this.component.length&&(this.component=!1),this.isInline=!this.component&&this.element.is("div"),this.picker=a(r.template),this._check_template(this.o.templates.leftArrow)&&this.picker.find(".prev").html(this.o.templates.leftArrow),this._check_template(this.o.templates.rightArrow)&&this.picker.find(".next").html(this.o.templates.rightArrow),this._buildEvents(),this._attachEvents(),this.isInline?this.picker.addClass("datepicker-inline").appendTo(this.element):this.picker.addClass("datepicker-dropdown dropdown-menu"),this.o.rtl&&this.picker.addClass("datepicker-rtl"),this.viewMode=this.o.startView,this.o.calendarWeeks&&this.picker.find("thead .datepicker-title, tfoot .today, tfoot .clear").attr("colspan",function(a,b){return parseInt(b)+1}),this._allow_update=!1,this.setStartDate(this._o.startDate),this.setEndDate(this._o.endDate),this.setDaysOfWeekDisabled(this.o.daysOfWeekDisabled),this.setDaysOfWeekHighlighted(this.o.daysOfWeekHighlighted),this.setDatesDisabled(this.o.datesDisabled),this.fillDow(),this.fillMonths(),this._allow_update=!0,this.update(),this.showMode(),this.isInline&&this.show()};k.prototype={constructor:k,_resolveViewName:function(a,c){return 0===a||"days"===a||"month"===a?0:1===a||"months"===a||"year"===a?1:2===a||"years"===a||"decade"===a?2:3===a||"decades"===a||"century"===a?3:4===a||"centuries"===a||"millennium"===a?4:c===b?!1:c},_check_template:function(c){try{if(c===b||""===c)return!1;if((c.match(/[<>]/g)||[]).length<=0)return!0;var d=a(c);return d.length>0}catch(e){return!1}},_process_options:function(b){this._o=a.extend({},this._o,b);var e=this.o=a.extend({},this._o),f=e.language;q[f]||(f=f.split("-")[0],q[f]||(f=o.language)),e.language=f,e.startView=this._resolveViewName(e.startView,0),e.minViewMode=this._resolveViewName(e.minViewMode,0),e.maxViewMode=this._resolveViewName(e.maxViewMode,4),e.startView=Math.min(e.startView,e.maxViewMode),e.startView=Math.max(e.startView,e.minViewMode),e.multidate!==!0&&(e.multidate=Number(e.multidate)||!1,e.multidate!==!1&&(e.multidate=Math.max(0,e.multidate))),e.multidateSeparator=String(e.multidateSeparator),e.weekStart%=7,e.weekEnd=(e.weekStart+6)%7;var g=r.parseFormat(e.format);e.startDate!==-(1/0)&&(e.startDate?e.startDate instanceof Date?e.startDate=this._local_to_utc(this._zero_time(e.startDate)):e.startDate=r.parseDate(e.startDate,g,e.language,e.assumeNearbyYear):e.startDate=-(1/0)),e.endDate!==1/0&&(e.endDate?e.endDate instanceof Date?e.endDate=this._local_to_utc(this._zero_time(e.endDate)):e.endDate=r.parseDate(e.endDate,g,e.language,e.assumeNearbyYear):e.endDate=1/0),e.daysOfWeekDisabled=e.daysOfWeekDisabled||[],a.isArray(e.daysOfWeekDisabled)||(e.daysOfWeekDisabled=e.daysOfWeekDisabled.split(/[,\s]*/)),e.daysOfWeekDisabled=a.map(e.daysOfWeekDisabled,function(a){return parseInt(a,10)}),e.daysOfWeekHighlighted=e.daysOfWeekHighlighted||[],a.isArray(e.daysOfWeekHighlighted)||(e.daysOfWeekHighlighted=e.daysOfWeekHighlighted.split(/[,\s]*/)),e.daysOfWeekHighlighted=a.map(e.daysOfWeekHighlighted,function(a){return parseInt(a,10)}),e.datesDisabled=e.datesDisabled||[],a.isArray(e.datesDisabled)||(e.datesDisabled=[e.datesDisabled]),e.datesDisabled=a.map(e.datesDisabled,function(a){return r.parseDate(a,g,e.language,e.assumeNearbyYear)});var h=String(e.orientation).toLowerCase().split(/\s+/g),i=e.orientation.toLowerCase();if(h=a.grep(h,function(a){return/^auto|left|right|top|bottom$/.test(a)}),e.orientation={x:"auto",y:"auto"},i&&"auto"!==i)if(1===h.length)switch(h[0]){case"top":case"bottom":e.orientation.y=h[0];break;case"left":case"right":e.orientation.x=h[0]}else i=a.grep(h,function(a){return/^left|right$/.test(a)}),e.orientation.x=i[0]||"auto",i=a.grep(h,function(a){return/^top|bottom$/.test(a)}),e.orientation.y=i[0]||"auto";else;if(e.defaultViewDate){var j=e.defaultViewDate.year||(new Date).getFullYear(),k=e.defaultViewDate.month||0,l=e.defaultViewDate.day||1;e.defaultViewDate=c(j,k,l)}else e.defaultViewDate=d()},_events:[],_secondaryEvents:[],_applyEvents:function(a){for(var c,d,e,f=0;f<a.length;f++)c=a[f][0],2===a[f].length?(d=b,e=a[f][1]):3===a[f].length&&(d=a[f][1],e=a[f][2]),c.on(e,d)},_unapplyEvents:function(a){for(var c,d,e,f=0;f<a.length;f++)c=a[f][0],2===a[f].length?(e=b,d=a[f][1]):3===a[f].length&&(e=a[f][1],d=a[f][2]),c.off(d,e)},_buildEvents:function(){var b={keyup:a.proxy(function(b){-1===a.inArray(b.keyCode,[27,37,39,38,40,32,13,9])&&this.update()},this),keydown:a.proxy(this.keydown,this),paste:a.proxy(this.paste,this)};this.o.showOnFocus===!0&&(b.focus=a.proxy(this.show,this)),this.isInput?this._events=[[this.element,b]]:this.component&&this.hasInput?this._events=[[this.inputField,b],[this.component,{click:a.proxy(this.show,this)}]]:this._events=[[this.element,{click:a.proxy(this.show,this),keydown:a.proxy(this.keydown,this)}]],this._events.push([this.element,"*",{blur:a.proxy(function(a){this._focused_from=a.target},this)}],[this.element,{blur:a.proxy(function(a){this._focused_from=a.target},this)}]),this.o.immediateUpdates&&this._events.push([this.element,{"changeYear changeMonth":a.proxy(function(a){this.update(a.date)},this)}]),this._secondaryEvents=[[this.picker,{click:a.proxy(this.click,this)}],[a(window),{resize:a.proxy(this.place,this)}],[a(document),{mousedown:a.proxy(function(a){this.element.is(a.target)||this.element.find(a.target).length||this.picker.is(a.target)||this.picker.find(a.target).length||this.isInline||this.hide()},this)}]]},_attachEvents:function(){this._detachEvents(),this._applyEvents(this._events)},_detachEvents:function(){this._unapplyEvents(this._events)},_attachSecondaryEvents:function(){this._detachSecondaryEvents(),this._applyEvents(this._secondaryEvents)},_detachSecondaryEvents:function(){this._unapplyEvents(this._secondaryEvents)},_trigger:function(b,c){var d=c||this.dates.get(-1),e=this._utc_to_local(d);this.element.trigger({type:b,date:e,dates:a.map(this.dates,this._utc_to_local),format:a.proxy(function(a,b){0===arguments.length?(a=this.dates.length-1,b=this.o.format):"string"==typeof a&&(b=a,a=this.dates.length-1),b=b||this.o.format;var c=this.dates.get(a);return r.formatDate(c,b,this.o.language)},this)})},show:function(){return this.inputField.prop("disabled")||this.inputField.prop("readonly")&&this.o.enableOnReadonly===!1?void 0:(this.isInline||this.picker.appendTo(this.o.container),this.place(),this.picker.show(),this._attachSecondaryEvents(),this._trigger("show"),(window.navigator.msMaxTouchPoints||"ontouchstart"in document)&&this.o.disableTouchKeyboard&&a(this.element).blur(),this)},hide:function(){return this.isInline||!this.picker.is(":visible")?this:(this.focusDate=null,this.picker.hide().detach(),this._detachSecondaryEvents(),this.viewMode=this.o.startView,this.showMode(),this.o.forceParse&&this.inputField.val()&&this.setValue(),this._trigger("hide"),this)},destroy:function(){return this.hide(),this._detachEvents(),this._detachSecondaryEvents(),this.picker.remove(),delete this.element.data().datepicker,this.isInput||delete this.element.data().date,this},paste:function(b){var c;if(b.originalEvent.clipboardData&&b.originalEvent.clipboardData.types&&-1!==a.inArray("text/plain",b.originalEvent.clipboardData.types))c=b.originalEvent.clipboardData.getData("text/plain");else{if(!window.clipboardData)return;c=window.clipboardData.getData("Text")}this.setDate(c),this.update(),b.preventDefault()},_utc_to_local:function(a){return a&&new Date(a.getTime()+6e4*a.getTimezoneOffset())},_local_to_utc:function(a){return a&&new Date(a.getTime()-6e4*a.getTimezoneOffset())},_zero_time:function(a){return a&&new Date(a.getFullYear(),a.getMonth(),a.getDate())},_zero_utc_time:function(a){return a&&new Date(Date.UTC(a.getUTCFullYear(),a.getUTCMonth(),a.getUTCDate()))},getDates:function(){return a.map(this.dates,this._utc_to_local)},getUTCDates:function(){return a.map(this.dates,function(a){return new Date(a)})},getDate:function(){return this._utc_to_local(this.getUTCDate())},getUTCDate:function(){var a=this.dates.get(-1);return"undefined"!=typeof a?new Date(a):null},clearDates:function(){this.inputField&&this.inputField.val(""),this.update(),this._trigger("changeDate"),this.o.autoclose&&this.hide()},setDates:function(){var b=a.isArray(arguments[0])?arguments[0]:arguments;return this.update.apply(this,b),this._trigger("changeDate"),this.setValue(),this},setUTCDates:function(){var b=a.isArray(arguments[0])?arguments[0]:arguments;return this.update.apply(this,a.map(b,this._utc_to_local)),this._trigger("changeDate"),this.setValue(),this},setDate:f("setDates"),setUTCDate:f("setUTCDates"),remove:f("destroy"),setValue:function(){var a=this.getFormattedDate();return this.inputField.val(a),this},getFormattedDate:function(c){c===b&&(c=this.o.format);var d=this.o.language;return a.map(this.dates,function(a){return r.formatDate(a,c,d)}).join(this.o.multidateSeparator)},getStartDate:function(){return this.o.startDate},setStartDate:function(a){return this._process_options({startDate:a}),this.update(),this.updateNavArrows(),this},getEndDate:function(){return this.o.endDate},setEndDate:function(a){return this._process_options({endDate:a}),this.update(),this.updateNavArrows(),this},setDaysOfWeekDisabled:function(a){return this._process_options({daysOfWeekDisabled:a}),this.update(),this.updateNavArrows(),this},setDaysOfWeekHighlighted:function(a){return this._process_options({daysOfWeekHighlighted:a}),this.update(),this},setDatesDisabled:function(a){this._process_options({datesDisabled:a}),this.update(),this.updateNavArrows()},place:function(){if(this.isInline)return this;var b=this.picker.outerWidth(),c=this.picker.outerHeight(),d=10,e=a(this.o.container),f=e.width(),g="body"===this.o.container?a(document).scrollTop():e.scrollTop(),h=e.offset(),i=[];this.element.parents().each(function(){var b=a(this).css("z-index");"auto"!==b&&0!==b&&i.push(parseInt(b))});var j=Math.max.apply(Math,i)+this.o.zIndexOffset,k=this.component?this.component.parent().offset():this.element.offset(),l=this.component?this.component.outerHeight(!0):this.element.outerHeight(!1),m=this.component?this.component.outerWidth(!0):this.element.outerWidth(!1),n=k.left-h.left,o=k.top-h.top;"body"!==this.o.container&&(o+=g),this.picker.removeClass("datepicker-orient-top datepicker-orient-bottom datepicker-orient-right datepicker-orient-left"),"auto"!==this.o.orientation.x?(this.picker.addClass("datepicker-orient-"+this.o.orientation.x),"right"===this.o.orientation.x&&(n-=b-m)):k.left<0?(this.picker.addClass("datepicker-orient-left"),n-=k.left-d):n+b>f?(this.picker.addClass("datepicker-orient-right"),n+=m-b):this.picker.addClass("datepicker-orient-left");var p,q=this.o.orientation.y;if("auto"===q&&(p=-g+o-c,q=0>p?"bottom":"top"),this.picker.addClass("datepicker-orient-"+q),"top"===q?o-=c+parseInt(this.picker.css("padding-top")):o+=l,this.o.rtl){var r=f-(n+m);this.picker.css({top:o,right:r,zIndex:j})}else this.picker.css({top:o,left:n,zIndex:j});return this},_allow_update:!0,update:function(){if(!this._allow_update)return this;var b=this.dates.copy(),c=[],d=!1;return arguments.length?(a.each(arguments,a.proxy(function(a,b){b instanceof Date&&(b=this._local_to_utc(b)),c.push(b)},this)),d=!0):(c=this.isInput?this.element.val():this.element.data("date")||this.inputField.val(),c=c&&this.o.multidate?c.split(this.o.multidateSeparator):[c],delete this.element.data().date),c=a.map(c,a.proxy(function(a){return r.parseDate(a,this.o.format,this.o.language,this.o.assumeNearbyYear)},this)),c=a.grep(c,a.proxy(function(a){return!this.dateWithinRange(a)||!a},this),!0),this.dates.replace(c),this.dates.length?this.viewDate=new Date(this.dates.get(-1)):this.viewDate<this.o.startDate?this.viewDate=new Date(this.o.startDate):this.viewDate>this.o.endDate?this.viewDate=new Date(this.o.endDate):this.viewDate=this.o.defaultViewDate,d?this.setValue():c.length&&String(b)!==String(this.dates)&&this._trigger("changeDate"),!this.dates.length&&b.length&&this._trigger("clearDate"),this.fill(),this.element.change(),this},fillDow:function(){var b=this.o.weekStart,c="<tr>";for(this.o.calendarWeeks&&(this.picker.find(".datepicker-days .datepicker-switch").attr("colspan",function(a,b){return parseInt(b)+1}),c+='<th class="cw">&#160;</th>');b<this.o.weekStart+7;)c+='<th class="dow',a.inArray(b,this.o.daysOfWeekDisabled)>-1&&(c+=" disabled"),c+='">'+q[this.o.language].daysMin[b++%7]+"</th>";c+="</tr>",this.picker.find(".datepicker-days thead").append(c)},fillMonths:function(){for(var a=this._utc_to_local(this.viewDate),b="",c=0;12>c;){var d=a&&a.getMonth()===c?" focused":"";b+='<span class="month'+d+'">'+q[this.o.language].monthsShort[c++]+"</span>"}this.picker.find(".datepicker-months td").html(b)},setRange:function(b){b&&b.length?this.range=a.map(b,function(a){return a.valueOf()}):delete this.range,this.fill()},getClassNames:function(b){var c=[],d=this.viewDate.getUTCFullYear(),e=this.viewDate.getUTCMonth(),f=new Date;return b.getUTCFullYear()<d||b.getUTCFullYear()===d&&b.getUTCMonth()<e?c.push("old"):(b.getUTCFullYear()>d||b.getUTCFullYear()===d&&b.getUTCMonth()>e)&&c.push("new"),this.focusDate&&b.valueOf()===this.focusDate.valueOf()&&c.push("focused"),this.o.todayHighlight&&b.getUTCFullYear()===f.getFullYear()&&b.getUTCMonth()===f.getMonth()&&b.getUTCDate()===f.getDate()&&c.push("today"),-1!==this.dates.contains(b)&&c.push("active"),this.dateWithinRange(b)||c.push("disabled"),this.dateIsDisabled(b)&&c.push("disabled","disabled-date"),-1!==a.inArray(b.getUTCDay(),this.o.daysOfWeekHighlighted)&&c.push("highlighted"),this.range&&(b>this.range[0]&&b<this.range[this.range.length-1]&&c.push("range"),-1!==a.inArray(b.valueOf(),this.range)&&c.push("selected"),b.valueOf()===this.range[0]&&c.push("range-start"),b.valueOf()===this.range[this.range.length-1]&&c.push("range-end")),c},_fill_yearsView:function(c,d,e,f,g,h,i,j){var k,l,m,n,o,p,q,r,s,t,u;for(k="",l=this.picker.find(c),m=parseInt(g/e,10)*e,o=parseInt(h/f,10)*f,p=parseInt(i/f,10)*f,n=a.map(this.dates,function(a){return parseInt(a.getUTCFullYear()/f,10)*f}),l.find(".datepicker-switch").text(m+"-"+(m+9*f)),q=m-f,r=-1;11>r;r+=1)s=[d],t=null,-1===r?s.push("old"):10===r&&s.push("new"),-1!==a.inArray(q,n)&&s.push("active"),(o>q||q>p)&&s.push("disabled"),q===this.viewDate.getFullYear()&&s.push("focused"),j!==a.noop&&(u=j(new Date(q,0,1)),u===b?u={}:"boolean"==typeof u?u={enabled:u}:"string"==typeof u&&(u={classes:u}),u.enabled===!1&&s.push("disabled"),u.classes&&(s=s.concat(u.classes.split(/\s+/))),u.tooltip&&(t=u.tooltip)),k+='<span class="'+s.join(" ")+'"'+(t?' title="'+t+'"':"")+">"+q+"</span>",q+=f;l.find("td").html(k)},fill:function(){var d,e,f=new Date(this.viewDate),g=f.getUTCFullYear(),h=f.getUTCMonth(),i=this.o.startDate!==-(1/0)?this.o.startDate.getUTCFullYear():-(1/0),j=this.o.startDate!==-(1/0)?this.o.startDate.getUTCMonth():-(1/0),k=this.o.endDate!==1/0?this.o.endDate.getUTCFullYear():1/0,l=this.o.endDate!==1/0?this.o.endDate.getUTCMonth():1/0,m=q[this.o.language].today||q.en.today||"",n=q[this.o.language].clear||q.en.clear||"",o=q[this.o.language].titleFormat||q.en.titleFormat;if(!isNaN(g)&&!isNaN(h)){this.picker.find(".datepic
35395ker-days .datepicker-switch").text(r.formatDate(f,o,this.o.language)),this.picker.find("tfoot .today").text(m).toggle(this.o.todayBtn!==!1),this.picker.find("tfoot .clear").text(n).toggle(this.o.clearBtn!==!1),this.picker.find("thead .datepicker-title").text(this.o.title).toggle(""!==this.o.title),this.updateNavArrows(),this.fillMonths();var p=c(g,h-1,28),s=r.getDaysInMonth(p.getUTCFullYear(),p.getUTCMonth());p.setUTCDate(s),p.setUTCDate(s-(p.getUTCDay()-this.o.weekStart+7)%7);var t=new Date(p);p.getUTCFullYear()<100&&t.setUTCFullYear(p.getUTCFullYear()),t.setUTCDate(t.getUTCDate()+42),t=t.valueOf();for(var u,v=[];p.valueOf()<t;){if(p.getUTCDay()===this.o.weekStart&&(v.push("<tr>"),this.o.calendarWeeks)){var w=new Date(+p+(this.o.weekStart-p.getUTCDay()-7)%7*864e5),x=new Date(Number(w)+(11-w.getUTCDay())%7*864e5),y=new Date(Number(y=c(x.getUTCFullYear(),0,1))+(11-y.getUTCDay())%7*864e5),z=(x-y)/864e5/7+1;v.push('<td class="cw">'+z+"</td>")}u=this.getClassNames(p),u.push("day"),this.o.beforeShowDay!==a.noop&&(e=this.o.beforeShowDay(this._utc_to_local(p)),e===b?e={}:"boolean"==typeof e?e={enabled:e}:"string"==typeof e&&(e={classes:e}),e.enabled===!1&&u.push("disabled"),e.classes&&(u=u.concat(e.classes.split(/\s+/))),e.tooltip&&(d=e.tooltip)),u=a.isFunction(a.uniqueSort)?a.uniqueSort(u):a.unique(u),v.push('<td class="'+u.join(" ")+'"'+(d?' title="'+d+'"':"")+">"+p.getUTCDate()+"</td>"),d=null,p.getUTCDay()===this.o.weekEnd&&v.push("</tr>"),p.setUTCDate(p.getUTCDate()+1)}this.picker.find(".datepicker-days tbody").empty().append(v.join(""));var A=q[this.o.language].monthsTitle||q.en.monthsTitle||"Months",B=this.picker.find(".datepicker-months").find(".datepicker-switch").text(this.o.maxViewMode<2?A:g).end().find("span").removeClass("active");if(a.each(this.dates,function(a,b){b.getUTCFullYear()===g&&B.eq(b.getUTCMonth()).addClass("active")}),(i>g||g>k)&&B.addClass("disabled"),g===i&&B.slice(0,j).addClass("disabled"),g===k&&B.slice(l+1).addClass("disabled"),this.o.beforeShowMonth!==a.noop){var C=this;a.each(B,function(c,d){var e=new Date(g,c,1),f=C.o.beforeShowMonth(e);f===b?f={}:"boolean"==typeof f?f={enabled:f}:"string"==typeof f&&(f={classes:f}),f.enabled!==!1||a(d).hasClass("disabled")||a(d).addClass("disabled"),f.classes&&a(d).addClass(f.classes),f.tooltip&&a(d).prop("title",f.tooltip)})}this._fill_yearsView(".datepicker-years","year",10,1,g,i,k,this.o.beforeShowYear),this._fill_yearsView(".datepicker-decades","decade",100,10,g,i,k,this.o.beforeShowDecade),this._fill_yearsView(".datepicker-centuries","century",1e3,100,g,i,k,this.o.beforeShowCentury)}},updateNavArrows:function(){if(this._allow_update){var a=new Date(this.viewDate),b=a.getUTCFullYear(),c=a.getUTCMonth();switch(this.viewMode){case 0:this.o.startDate!==-(1/0)&&b<=this.o.startDate.getUTCFullYear()&&c<=this.o.startDate.getUTCMonth()?this.picker.find(".prev").css({visibility:"hidden"}):this.picker.find(".prev").css({visibility:"visible"}),this.o.endDate!==1/0&&b>=this.o.endDate.getUTCFullYear()&&c>=this.o.endDate.getUTCMonth()?this.picker.find(".next").css({visibility:"hidden"}):this.picker.find(".next").css({visibility:"visible"});break;case 1:case 2:case 3:case 4:this.o.startDate!==-(1/0)&&b<=this.o.startDate.getUTCFullYear()||this.o.maxViewMode<2?this.picker.find(".prev").css({visibility:"hidden"}):this.picker.find(".prev").css({visibility:"visible"}),this.o.endDate!==1/0&&b>=this.o.endDate.getUTCFullYear()||this.o.maxViewMode<2?this.picker.find(".next").css({visibility:"hidden"}):this.picker.find(".next").css({visibility:"visible"})}}},click:function(b){b.preventDefault(),b.stopPropagation();var e,f,g,h,i,j,k;e=a(b.target),e.hasClass("datepicker-switch")&&this.showMode(1);var l=e.closest(".prev, .next");l.length>0&&(f=r.modes[this.viewMode].navStep*(l.hasClass("prev")?-1:1),0===this.viewMode?(this.viewDate=this.moveMonth(this.viewDate,f),this._trigger("changeMonth",this.viewDate)):(this.viewDate=this.moveYear(this.viewDate,f),1===this.viewMode&&this._trigger("changeYear",this.viewDate)),this.fill()),e.hasClass("today")&&!e.hasClass("day")&&(this.showMode(-2),this._setDate(d(),"linked"===this.o.todayBtn?null:"view")),e.hasClass("clear")&&this.clearDates(),e.hasClass("disabled")||(e.hasClass("day")&&(g=parseInt(e.text(),10)||1,h=this.viewDate.getUTCFullYear(),i=this.viewDate.getUTCMonth(),e.hasClass("old")&&(0===i?(i=11,h-=1,j=!0,k=!0):(i-=1,j=!0)),e.hasClass("new")&&(11===i?(i=0,h+=1,j=!0,k=!0):(i+=1,j=!0)),this._setDate(c(h,i,g)),k&&this._trigger("changeYear",this.viewDate),j&&this._trigger("changeMonth",this.viewDate)),e.hasClass("month")&&(this.viewDate.setUTCDate(1),g=1,i=e.parent().find("span").index(e),h=this.viewDate.getUTCFullYear(),this.viewDate.setUTCMonth(i),this._trigger("changeMonth",this.viewDate),1===this.o.minViewMode?(this._setDate(c(h,i,g)),this.showMode()):this.showMode(-1),this.fill()),(e.hasClass("year")||e.hasClass("decade")||e.hasClass("century"))&&(this.viewDate.setUTCDate(1),g=1,i=0,h=parseInt(e.text(),10)||0,this.viewDate.setUTCFullYear(h),e.hasClass("year")&&(this._trigger("changeYear",this.viewDate),2===this.o.minViewMode&&this._setDate(c(h,i,g))),e.hasClass("decade")&&(this._trigger("changeDecade",this.viewDate),3===this.o.minViewMode&&this._setDate(c(h,i,g))),e.hasClass("century")&&(this._trigger("changeCentury",this.viewDate),4
35395===this.o.minViewMode&&this._setDate(c(h,i,g))),this.showMode(-1),this.fill())),this.picker.is(":visible")&&this._focused_from&&a(this._focused_from).focus(),delete this._focused_from},_toggle_multidate:function(a){var b=this.dates.contains(a);if(a||this.dates.clear(),-1!==b?(this.o.multidate===!0||this.o.multidate>1||this.o.toggleActive)&&this.dates.remove(b):this.o.multidate===!1?(this.dates.clear(),this.dates.push(a)):this.dates.push(a),"number"==typeof this.o.multidate)for(;this.dates.length>this.o.multidate;)this.dates.remove(0)},_setDate:function(a,b){b&&"date"!==b||this._toggle_multidate(a&&new Date(a)),b&&"view"!==b||(this.viewDate=a&&new Date(a)),this.fill(),this.setValue(),b&&"view"===b||this._trigger("changeDate"),this.inputField&&this.inputField.change(),!this.o.autoclose||b&&"date"!==b||this.hide()},moveDay:function(a,b){var c=new Date(a);return c.setUTCDate(a.getUTCDate()+b),c},moveWeek:function(a,b){return this.moveDay(a,7*b)},moveMonth:function(a,b){if(!g(a))return this.o.defaultViewDate;if(!b)return a;var c,d,e=new Date(a.valueOf()),f=e.getUTCDate(),h=e.getUTCMonth(),i=Math.abs(b);if(b=b>0?1:-1,1===i)d=-1===b?function(){return e.getUTCMonth()===h}:function(){return e.getUTCMonth()!==c},c=h+b,e.setUTCMonth(c),(0>c||c>11)&&(c=(c+12)%12);else{for(var j=0;i>j;j++)e=this.moveMonth(e,b);c=e.getUTCMonth(),e.setUTCDate(f),d=function(){return c!==e.getUTCMonth()}}for(;d();)e.setUTCDate(--f),e.setUTCMonth(c);return e},moveYear:function(a,b){return this.moveMonth(a,12*b)},moveAvailableDate:function(a,b,c){do{if(a=this[c](a,b),!this.dateWithinRange(a))return!1;c="moveDay"}while(this.dateIsDisabled(a));return a},weekOfDateIsDisabled:function(b){return-1!==a.inArray(b.getUTCDay(),this.o.daysOfWeekDisabled)},dateIsDisabled:function(b){return this.weekOfDateIsDisabled(b)||a.grep(this.o.datesDisabled,function(a){return e(b,a)}).length>0},dateWithinRange:function(a){return a>=this.o.startDate&&a<=this.o.endDate},keydown:function(a){if(!this.picker.is(":visible"))return void((40===a.keyCode||27===a.keyCode)&&(this.show(),a.stopPropagation()));var b,c,d=!1,e=this.focusDate||this.viewDate;switch(a.keyCode){case 27:this.focusDate?(this.focusDate=null,this.viewDate=this.dates.get(-1)||this.viewDate,this.fill()):this.hide(),a.preventDefault(),a.stopPropagation();break;case 37:case 38:case 39:case 40:if(!this.o.keyboardNavigation||7===this.o.daysOfWeekDisabled.length)break;b=37===a.keyCode||38===a.keyCode?-1:1,0===this.viewMode?a.ctrlKey?(c=this.moveAvailableDate(e,b,"moveYear"),c&&this._trigger("changeYear",this.viewDate)):a.shiftKey?(c=this.moveAvailableDate(e,b,"moveMonth"),c&&this._trigger("changeMonth",this.viewDate)):37===a.keyCode||39===a.keyCode?c=this.moveAvailableDate(e,b,"moveDay"):this.weekOfDateIsDisabled(e)||(c=this.moveAvailableDate(e,b,"moveWeek")):1===this.viewMode?((38===a.keyCode||40===a.keyCode)&&(b=4*b),c=this.moveAvailableDate(e,b,"moveMonth")):2===this.viewMode&&((38===a.keyCode||40===a.keyCode)&&(b=4*b),c=this.moveAvailableDate(e,b,"moveYear")),c&&(this.focusDate=this.viewDate=c,this.setValue(),this.fill(),a.preventDefault());break;case 13:if(!this.o.forceParse)break;e=this.focusDate||this.dates.get(-1)||this.viewDate,this.o.keyboardNavigation&&(this._toggle_multidate(e),d=!0),this.focusDate=null,this.viewDate=this.dates.get(-1)||this.viewDate,this.setValue(),this.fill(),this.picker.is(":visible")&&(a.preventDefault(),a.stopPropagation(),this.o.autoclose&&this.hide());break;case 9:this.focusDate=null,this.viewDate=this.dates.get(-1)||this.viewDate,this.fill(),this.hide()}d&&(this.dates.length?this._trigger("changeDate"):this._trigger("clearDate"),this.inputField&&this.inputField.change())},showMode:function(a){a&&(this.viewMode=Math.max(this.o.minViewMode,Math.min(this.o.maxViewMode,this.viewMode+a))),this.picker.children("div").hide().filter(".datepicker-"+r.modes[this.viewMode].clsName).show(),this.updateNavArrows()}};var l=function(b,c){a(b).data("datepicker",this),this.element=a(b),this.inputs=a.map(c.inputs,function(a){return a.jquery?a[0]:a}),delete c.inputs,n.call(a(this.inputs),c).on("changeDate",a.proxy(this.dateUpdated,this)),this.pickers=a.map(this.inputs,function(b){return a(b).data("datepicker")}),this.updateDates()};l.prototype={updateDates:function(){this.dates=a.map(this.pickers,function(a){return a.getUTCDate()}),this.updateRanges()},updateRanges:function(){var b=a.map(this.dates,function(a){return a.valueOf()});a.each(this.pickers,function(a,c){c.setRange(b)})},dateUpdated:function(b){if(!this.updating){this.updating=!0;var c=a(b.target).data("datepicker");if("undefined"!=typeof c){var d=c.getUTCDate(),e=a.inArray(b.target,this.inputs),f=e-1,g=e+1,h=this.inputs.length;if(-1!==e){if(a.each(this.pickers,function(a,b){b.getUTCDate()||b.setUTCDate(d)}),d<this.dates[f])for(;f>=0&&d<this.dates[f];)this.pickers[f--].setUTCDate(d);else if(d>this.dates[g])for(;h>g&&d>this.dates[g];)this.pickers[g++].setUTCDate(d);this.updateDates(),delete this.updating}}}},remove:function(){a.map(this.pickers,function(a){a.remove()}),delete this.element.data().datepicker}};var m=a.fn.datepicker,n=function(c){var d=Array.apply(null,arguments);d.shift();var e;if(this.each(function(){var b=a(this),f=b.data("datepicker"),g="object"==typeof c&&c;if(!f){var j=h(this,"date"),m=a.extend({},o,j,g),n=i(m.language),p=a.extend({},o,n,j,g);b.hasClass("input-daterange")||p.inputs?(a.extend(p,{inputs:p.inputs||b.find("input").toArray()}),f=new l(this,p)):f=new k(this,p),b.data("datepicker",f)}"string"==typeof c&&"function"==typeof f[c]&&(e=f[c].apply(f,d))}),e===b||e instanceof k||e instanceof l)return this;if(this.length>1)throw new Error("Using only allowed for the collection of a single element ("+c+" function)");return e};a.fn.datepicker=n;var o=a.fn.datepicker.defaults={assumeNearbyYear:!1,autoclose:!1,beforeShowDay:a.noop,beforeShowMonth:a.noop,beforeShowYear:a.noop,beforeShowDecade:a.noop,beforeShowCentury:a.noop,calendarWeeks:!1,clearBtn:!1,toggleActive:!1,daysOfWeekDisabled:[],daysOfWeekHighlighted:[],datesDisabled:[],endDate:1/0,forceParse:!0,format:"mm/dd/yyyy",keyboardNavigation:!0,language:"en",minViewMode:0,maxViewMode:4,multidate:!1,multidateSeparator:",",orientation:"auto",rtl:!1,startDate:-(1/0),startView:0,todayBtn:!1,todayHighlight:!1,weekStart:0,disableTouchKeyboard:!1,enableOnReadonly:!0,showOnFocus:!0,zIndexOffset:10,container:"body",immediateUpdates:!1,title:"",templates:{leftArrow:"&laquo;",rightArrow:"&raquo;"}},p=a.fn.datepicker.locale_opts=["format","rtl","weekStart"];a.fn.datepicker.Constructor=k;var q=a.fn.datepicker.dates={en:{days:["Sunday","Monday","Tuesday","Wednesday","Thursday","Frid
35395ay","Saturday"],daysShort:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],daysMin:["Su","Mo","Tu","We","Th","Fr","Sa"],months:["January","February","March","April","May","June","July","August","September","October","November","December"],monthsShort:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],today:"Today",clear:"Clear",titleFormat:"MM yyyy"}},r={modes:[{clsName:"days",navFnc:"Month",navStep:1},{clsName:"months",navFnc:"FullYear",navStep:1},{clsName:"years",navFnc:"FullYear",navStep:10},{clsName:"decades",navFnc:"FullDecade",navStep:100},{clsName:"centuries",navFnc:"FullCentury",navStep:1e3}],isLeapYear:function(a){return a%4===0&&a%100!==0||a%400===0},getDaysInMonth:function(a,b){return[31,r.isLeapYear(a)?29:28,31,30,31,30,31,31,30,31,30,31][b]},validParts:/dd?|DD?|mm?|MM?|yy(?:yy)?/g,nonpunctuation:/[^ -\/:-@\u5e74\u6708\u65e5\[-`{-~\t\n\r]+/g,parseFormat:function(a){if("function"==typeof a.toValue&&"function"==typeof a.toDisplay)return a;var b=a.replace(this.validParts,"\x00").split("\x00"),c=a.match(this.validParts);if(!b||!b.length||!c||0===c.length)throw new Error("Invalid date format.");return{separators:b,parts:c}},parseDate:function(e,f,g,h){function i(a,b){return b===!0&&(b=10),100>a&&(a+=2e3,a>(new Date).getFullYear()+b&&(a-=100)),a}function j(){var a=this.slice(0,s[n].length),b=s[n].slice(0,a.length);return a.toLowerCase()===b.toLowerCase()}if(!e)return b;if(e instanceof Date)return e;if("string"==typeof f&&(f=r.parseFormat(f)),f.toValue)return f.toValue(e,f,g);var l,m,n,o,p=/([\-+]\d+)([dmwy])/,s=e.match(/([\-+]\d+)([dmwy])/g),t={d:"moveDay",m:"moveMonth",w:"moveWeek",y:"moveYear"},u={yesterday:"-1d",today:"+0d",tomorrow:"+1d"};if(/^[\-+]\d+[dmwy]([\s,]+[\-+]\d+[dmwy])*$/.test(e)){for(e=new Date,n=0;n<s.length;n++)l=p.exec(s[n]),m=parseInt(l[1]),o=t[l[2]],e=k.prototype[o](e,m);return c(e.getUTCFullYear(),e.getUTCMonth(),e.getUTCDate())}if("undefined"!=typeof u[e]&&(e=u[e],s=e.match(/([\-+]\d+)([dmwy])/g),/^[\-+]\d+[dmwy]([\s,]+[\-+]\d+[dmwy])*$/.test(e))){for(e=new Date,n=0;n<s.length;n++)l=p.exec(s[n]),m=parseInt(l[1]),o=t[l[2]],e=k.prototype[o](e,m);return c(e.getUTCFullYear(),e.getUTCMonth(),e.getUTCDate())}s=e&&e.match(this.nonpunctuation)||[],e=new Date;var v,w,x={},y=["yyyy","yy","M","MM","m","mm","d","dd"],z={yyyy:function(a,b){return a.setUTCFullYear(h?i(b,h):b)},yy:function(a,b){return a.setUTCFullYear(h?i(b,h):b)},m:function(a,b){if(isNaN(a))return a;for(b-=1;0>b;)b+=12;for(b%=12,a.setUTCMonth(b);a.getUTCMonth()!==b;)a.setUTCDate(a.getUTCDate()-1);return a},d:function(a,b){return a.setUTCDate(b)}};z.M=z.MM=z.mm=z.m,z.dd=z.d,e=d();var A=f.parts.slice();if(s.length!==A.length&&(A=a(A).filter(function(b,c){return-1!==a.inArray(c,y)}).toArray()),s.length===A.length){var B;for(n=0,B=A.length;B>n;n++){if(v=parseInt(s[n],10),l=A[n],isNaN(v))switch(l){case"MM":w=a(q[g].months).filter(j),v=a.inArray(w[0],q[g].months)+1;break;case"M":w=a(q[g].monthsShort).filter(j),v=a.inArray(w[0],q[g].monthsShort)+1}x[l]=v}var C,D;for(n=0;n<y.length;n++)D=y[n],D in x&&!isNaN(x[D])&&(C=new Date(e),z[D](C,x[D]),isNaN(C)||(e=C))}return e},formatDate:function(b,c,d){if(!b)return"";if("string"==typeof c&&(c=r.parseFormat(c)),
35396c.toDisplay)return c.toDisplay(b,c,d);var e={d:b.getUTCDate(),D:q[d].daysShort[b.getUTCDay()],DD:q[d].days[b.getUTCDay()],m:b.getUTCMonth()+1,M:q[d].monthsShort[b.getUTCMonth()],MM:q[d].months[b.getUTCMonth()],yy:b.getUTCFullYear().toString().substring(2),yyyy:b.getUTCFullYear()};e.dd=(e.d<10?"0":"")+e.d,e.mm=(e.m<10?"0":"")+e.m,b=[];for(var f=a.extend([],c.separators),g=0,h=c.parts.length;h>=g;g++)f.length&&b.push(f.shift()),b.push(e[c.parts[g]]);return b.join("")},headTemplate:'<thead><tr><th colspan="7" class="datepicker-title"></th></tr><tr><th class="prev">&laquo;</th><th colspan="5" class="datepicker-switch"></th><th class="next">&raquo;</th></tr></thead>',contTemplate:'<tbody><tr><td colspan="7"></td></tr></tbody>',footTemplate:'<tfoot><tr><th colspan="7" class="today"></th></tr><tr><th colspan="7" class="clear"></th></tr></tfoot>'};r.template='<div class="datepicker"><div class="datepicker-days"><table class="table-condensed">'+r.headTemplate+"<tbody></tbody>"+r.footTemplate+'</table></div><div class="datepicker-months"><table class="table-condensed">'+r.headTemplate+r.contTemplate+r.footTemplate+'</table></div><div class="datepicker-years"><table class="table-condensed">'+r.headTemplate+r.contTemplate+r.footTemplate+'</table></div><div class="datepicker-decades"><table class="table-condensed">'+r.headTemplate+r.contTemplate+r.footTemplate+'</table></div><div class="datepicker-centuries"><table class="table-condensed">'+r.headTemplate+r.contTemplate+r.footTemplate+"</table></div></div>",a.fn.datepicker.DPGlobal=r,a.fn.datepicker.noConflict=function(){return a.fn.datepicker=m,this},a.fn.datepicker.version="1.6.4",a(document).on("focus.datepicker.data-api click.datepicker.data-api",'[data-provide="datepicker"]',function(b){var c=a(this);c.data("datepicker")||(b.preventDefault(),n.call(c,"show"))}),a(function(){n.call(a('[data-provide="datepicker-inline"]'))})});
35397!function(a){a.fn.datepicker.dates.da={days:["søndag","mandag","tirsdag","onsdag","torsdag","fredag","lørdag"],daysShort:["søn","man","tir","ons","tor","fre","lør"],daysMin:["sø","ma","ti","on","to","fr","lø"],months:["januar","februar","marts","april","maj","juni","juli","august","september","oktober","november","december"],monthsShort:["jan","feb","mar","apr","maj","jun","jul","aug","sep","okt","nov","dec"],today:"I Dag",clear:"Nulstil"}}(jQuery);
35398!function(t,e){"use strict";"undefined"!=typeof module&&module.exports?module.exports=e(require("jquery")):"function"==typeof define&&define.amd?define(["jquery"],function(t){return e(t)}
35398):e(t.jQuery)}(this,function(t){"use strict";var e=function(s,i){this.$element=t(s),this.options=t.extend({},e.defaults,i),this.matcher=this.options.matcher||this.matcher,this.sorter=this.options.sorter||this.sorter,this.select=this.options.select||this.select,this.autoSelect="boolean"!=typeof this.options.autoSelect||this.options.autoSelect,this.highlighter=this.options.highlighter||this.highlighter,this.render=this.options.render||this.render,this.updater=this.options.updater||this.updater,this.displayText=this.options.displayText||this.displayText,this.itemLink=this.options.itemLink||this.itemLink,this.itemTitle=this.options.itemTitle||this.itemTitle,this.followLinkOnSelect=this.options.followLinkOnSelect||this.followLinkOnSelect,this.source=this.options.source,this.delay=this.options.delay,this.theme=this.options.theme&&this.options.themes&&this.options.themes[this.options.theme]||e.defaults.themes[e.defaults.theme],this.$menu=t(this.options.menu||this.theme.menu),this.$appendTo=this.options.appendTo?t(this.options.appendTo):null,this.fitToElement="boolean"==typeof this.options.fitToElement&&this.options.fitToElement,this.shown=!1,this.listen(),this.showHintOnFocus=("boolean"==typeof this.options.showHintOnFocus||"all"===this.options.showHintOnFocus)&&this.options.showHintOnFocus,this.afterSelect=this.options.afterSelect,this.after
35398EmptySelect=this.options.afterEmptySelect,this.addItem=!1,this.value=this.$element.val()||this.$element.text(),this.keyPressed=!1,this.focused=this.$element.is(":focus"),this.changeInputOnSelect=this.options.changeInputOnSelect||this.changeInputOnSelect,this.changeInputOnMove=this.options.changeInputOnMove||this.changeInputOnMove,this.openLinkInNewTab=this.options.openLinkInNewTab||this.openLinkInNewTab,this.selectOnBlur=this.options.selectOnBlur||this.selectOnBlur,this.showCategoryHeader=this.options.showCategoryHeader||this.showCategoryHeader};e.prototype={constructor:e,setDefault:function(t){if(this.$element.data("active",t),this.autoSelect||t){var e=this.updater(t);e||(e=""),this.$element.val(this.displayText(e)||e).text(this.displayText(e)||e).change(),this.afterSelect(e)}return this.hide()},select:function(){var t=this.$menu.find(".active").data("value");if(this.$element.data("active",t),this.autoSelect||t){var e=this.updater(t);e||(e=""),this.changeInputOnSelect&&this.$element.val(this.displayText(e)||e).text(this.displayText(e)||e).change(),this.followLinkOnSelect&&this.itemLink(t)?(this.openLinkInNewTab?window.open(this.itemLink(t),"_blank"):document.location=this.itemLink(t),this.afterSelect(e)):this.followLinkOnSelect&&!this.itemLink(t)?this.after
35398EmptySelect(e):this.afterSelect(e)}else this.afterEmptySelect();return this.hide()},updater:function(t){return t},setSource:function(t){this.source=t},show:function(){var e,s=t.extend({},this.$element.position(),{height:this.$element[0].offsetHeight}),i="function"==typeof this.options.scrollHeight?this.options.scrollHeight.call():this.options.scrollHeight;if(this.shown?e=this.$menu:this.$appendTo?(e=this.$menu.appendTo(this.$appendTo),this.hasSameParent=this.$appendTo.is(this.$element.parent())):(e=this.$menu.insertAfter(this.$element),this.hasSameParent=!0),!this.hasSameParent){e.css("position","fixed");var o=this.$element.offset();s.top=o.top,s.left=o.left}var n=t(e).parent().hasClass("dropup")?"auto":s.top+s.height+i,h=t(e).hasClass("dropdown-menu-right")?"auto":s.left;return e.css({top:n,left:h}).show(),!0===this.options.fitToElement&&e.css("width",this.$element.outerWidth()+"px"),this.shown=!0,this},hide:function(){return this.$menu.hide(),this.shown=!1,this},lookup:function(e){if(this.query=null!=e?e:this.$element.val(),this.query.length<this.options.minLength&&!this.options.showHintOnFocus)return this.shown?this.hide():this;var s=t.proxy(function(){t.isFunction(this.source)&&3===this.source.length?this.source(this.query,t.proxy(this.process,this),t.proxy(this.process,this)):t.isFunction(this.source)?this.source(this.query,t.proxy(this.process,this)):this.source&&this.process(this.source)},this);clearTimeout(this.lookupWorker),this.lookupWorker=setTimeout(s,this.delay)},process:function(e){var s=this;return e=t.grep(e,function(t){return s.matcher(t)}),(e=this.sorter(e)).length||this.options.addItem?(e.length>0?this.$element.data("active",e[0]):this.$element.data("active",null),"all"!=this.options.items&&(e=e.slice(0,this.options.items)),this.options.addItem&&e.push(this.options.addItem),this.render(e).show()):this.shown?this.hide():this},matcher:function(t){return~this.displayText(t).toLowerCase().indexOf(this.query.toLowerCase())},sorter:function(t){for(var e,s=[],i=[],o=[];e=t.shift();){var n=this.displayText(e);n.toLowerCase().indexOf(this.query.toLowerCase())?~n.indexOf(this.query)?i.push(e):o.push(e):s.push(e)}return s.concat(i,o)},highlighter:function(t){var e=this.query;if(""===e)return t;var s,i=t.match(/(>)([^<]*)(<)/g),o=[],n=[];if(i&&i.length)for(s=0;s<i.length;++s)i[s].length>2&&o.push(i[s]);else(o=[]).push(t);e=e.replace(/[\(\)\/\.\*\+\?\[\]]/g,function(t){return"\\"+t});var h,a=new RegExp(e,"g");for(s=0;s<o.length;++s)(h=o[s].match(a))&&h.length>0&&n.push(o[s]);for(s=0;s<n.length;++s)t=t.replace(n[s],n[s].replace(a,"<strong>$&</strong>"));return t},render:function(e){var s=this,i=this,o=!1,n=[],h=s.options.separator;return t.each(e,function(t,s){t>0&&s[h]!==e[t-1][h]&&n.push({__type:"divider"}),this.showCategoryHeader&&(!s[h]||0!==t&&s[h]===e[t-1][h]||n.push({__type:"category",name:s[h]})),n.push(s)}),e=t(n).map(function(e,n){if("category"==(n.__type||!1))return t(s.options.headerHtml||s.theme.headerHtml).text(n.name)[0];if("divider"==(n.__type||!1))return t(s.options.headerDivider||s.theme.headerDivider)[0];var h=i.displayText(n);return(e=t(s.options.item||s.theme.item).data("value",n)).find(s.options.itemContentSelector||s.theme.itemContentSelector).addBack(s.options.itemContentSelector||s.theme.itemContentSelector).html(s.highlighter(h,n)),s.options.followLinkOnSelect&&e.find("a").attr("href",i.itemLink(n)),e.find("a").attr("title",i.itemTitle(n)),h==i.$element.val()&&(e.addClass("active"),i.$element.data("active",n),o=!0),e[0]}),this.autoSelect&&!o&&(e.filter(":not(.dropdown-header)").first().addClass("active"),this.$element.data("active",e.first().data("value"))),this.$menu.html(e),this},displayText:function(t){return void 0!==t&&void 0!==t.name?t.name:t},itemLink:function(t){return null},itemTitle:function(t){return null},next:function(e){var s=this.$menu.find(".active").removeClass("active").next();for(s.length||(s=t(this.$menu.find(t(this.options.item||this.theme.item).prop("tagName"))[0]));s.hasClass("divider")||s.hasClass("dropdown-header");)s=s.next();s.addClass("active");var i=this.updater(s.data("value"));this.changeInputOnMove&&this.$element.val(this.displayText(i)||i)},prev:function(e){var s=this.$menu.find(".active").removeClass("active").prev();for(s.length||(s=this.$menu.find(t(this.options.item||this.theme.item).prop("tagName")).last(
35398));s.hasClass("divider")||s.hasClass("dropdown-header");)s=s.prev();s.addClass("active");var i=this.updater(s.data("value"));this.changeInputOnMove&&this.$element.val(this.displayText(i)||i)},listen:function(){this.$element.on("focus.bootstrap3Typeahead",t.proxy(this.focus,this)).on("blur.bootstrap3Typeahead",t.proxy(this.blur,this)).on("keypress.bootstrap3Typeahead",t.proxy(this.keypress,this)).on("propertychange.bootstrap3Typeahead input.bootstrap3Typeahead",t.proxy(this.input,this)).on("keyup.bootstrap3Typeahead",t.proxy(this.keyup,this)),this.eventSupported("keydown")&&this.$element.on("keydown.bootstrap3Typeahead",t.proxy(this.keydown,this));var e=t(this.options.item||this.theme.item).prop("tagName");"ontouchstart"in document.documentElement?this.$menu.on("touchstart",e,t.proxy(this.touchstart,this)).on("touchend",e,t.proxy(this.click,this)):this.$menu.on("click",t.proxy(this.click,this)).on("mouseenter",e,t.proxy(this.mouseenter,this)).on("mouseleave",e,t.proxy(this.mouseleave,this)).on("mousedown",t.proxy(this.mousedown,this))},destroy:function(){this.$element.data("typeahead",null),this.$element.data("active",null),this.$element.unbind("focus.bootstrap3Typeahead").unbind("blur.bootstrap3Typeahead").unbind("keypress.bootstrap3Typeahead").unbind("propertychange.bootstrap3Typeahead input.bootstrap3Typeahead").unbind("keyup.bootstrap3Typeahead"),this.eventSupported("keydown")&&this.$element.unbind("keydown.bootstrap3-typeahead"),this.$menu.remove(),this.destroyed=!0},eventSupported:function(t){var e=t in this.$element;return e||(this.$element.setAttribute(t,"return;"),e="function"==typeof this.$element[t]),e},move:function(t){if(this.shown)switch(t.keyCode){case 9:case 13:case 27:t.preventDefault();break;case 38:if(t.shiftKey)return;t.preventDefault(),this.prev();break;case 40:if(t.shiftKey)return;t.preventDefault(),this.next()}},keydown:function(e){17!==e.keyCode&&(this.keyPressed=!0,this.suppressKeyPressRepeat=~t.inArray(e.keyCode,[40,38,9,13,27]),this.shown||40!=e.keyCode?this.move(e):this.lookup())},keypress:function(t){this.suppressKeyPressRepeat||this.move(t)},input:function(t){var e=this.$element.val()||this.$element.text();this.value!==e&&(this.value=e,this.lookup())},keyup:function(t){if(!this.destroyed)switch(t.keyCode){case 40:case 38:case 16:case 17:case 18:break;case 9:if(!this.shown||this.showHintOnFocus&&!this.keyPressed)return;this.select();break;case 13:if(!this.shown)return;this.select();break;case 27:if(!this.shown)return;this.hide()}},focus:function(t){this.focused||(this.focused=!0,this.keyPressed=!1,this.options.showHintOnFocus&&!0!==this.skipShowHintOnFocus&&("all"===this.options.showHintOnFocus?this.lookup(""):this.lookup())),this.skipShowHintOnFocus&&(this.skipShowHintOnFocus=!1)},blur:function(t){this.mousedover||this.mouseddown||!this.shown?this.mouseddown&&(this.skipShowHintOnFocus=!0,this.mouseddown=!1):(this.selectOnBlur&&this.select(),this.hide(),this.focused=!1,this.keyPressed=!1)},click:function(t){t.preventDefault(),this.skipShowHintOnFocus=!0,this.select(),this.$element.focus(),this.hide()},mouseenter:function(e){this.mousedover=!0,this.$menu.find(".active").removeClass("active"),t(e.currentTarget).addClass("active")},mouseleave:function(t){this.mousedover=!1,!this.focused&&this.shown&&this.hide()},mousedown:function(t){this.mouseddown=!0,this.$menu.one("mouseup",function(t){this.mouseddown=!1}.bind(this))},touchstart:function(e){e.preventDefault(),this.$menu.find(".active").removeClass("active"),t(e.currentTarget).addClass("active")},touchend:function(t){t.preventDefault(),this.select(),this.$element.focus()}};var s=t.fn.typeahead;t.fn.typeahead=function(s){var i=arguments;return"string"==typeof s&&"getActive"==s?this.data("active"):this.each(function(){var o=t(this),n=o.data("typeahead"),h="object"==typeof s&&s;n||o.data("typeahead",n=new e(this,h)),"string"==typeof s&&n[s]&&(i.length>1?n[s].apply(n,Array.prototype.slice.call(i,1)):n[s]())})},e.defaults={source:[],items:8,minLength:1,scrollHeight:0,autoSelect:!0,afterSelect:t.noop,afterEmptySelect:t.noop,addItem:!1,followLinkOnSelect:!1,delay:0,separator:"category",changeInputOnSelect:!0,changeInputOnMove:!0,openLinkInNewTab:!1,selectOnBlur:!0,showCategoryHeader:!0,theme:"bootstrap3",themes:{bootstrap3:{menu:'
vendor: 3,721 bytes, lines 35398-35402
35398<ul class="typeahead dropdown-menu" role="listbox"></ul>',item:'<li><a class="dropdown-item" href="#" role="option"></a></li>',itemContentSelector:"a",headerHtml:'<li class="dropdown-header"></li>',headerDivider:'<li class="divider" role="separator"></li>'},bootstrap4:{menu:'<div class="typeahead dropdown-menu" role="listbox"></div>',item:'<button class="dropdown-item" role="option"></button>',itemContentSelector:".dropdown-item",headerHtml:'<h6 class="dropdown-header"></h6>',headerDivider:'<div class="dropdown-divider"></div>'}}},t.fn.typeahead.Constructor=e,t.fn.typeahead.noConflict=function(){return t.fn.typeahead=s,this},t(document).on("focus.typeahead.data-api",'[data-provide="typeahead"]',function(e){var s=t(this);s.data("typeahead")||s.typeahead(s.data())})});
35399/*  jQuery Nice Select - v1.0
35400    https://github.com/hernansartorio/jquery-nice-select
35401    Made by Hernán Sartorio  */
35402!function(e){e.fn.niceSelect=function(t){function s(t){t.after(e("<div></div>").addClass("nice-select").addClass(t.attr("class")||"").addClass(t.attr("disabled")?"disabled":"").attr("tabindex",t.attr("disabled")?null:"0").html('<span class="current"></span><ul class="list"></ul>'));var s=t.next(),n=t.find("option"),i=t.find("option:selected");s.find(".current").html(i.data("display")||i.text()),n.each(function(t){var n=e(this),i=n.data("display");s.find("ul").append(e("<li></li>").attr("data-value",n.val()).attr("data-display",i||null).addClass("option"+(n.is(":selected")?" selected":"")+(n.is(":disabled")?" disabled":"")).html(n.text()))})}if("string"==typeof t)return"update"==t?this.each(function(){var t=e(this),n=e(this).next(".nice-select"),i=n.hasClass("open");n.length&&(n.remove(),s(t),i&&t.next().trigger("click"))}):"destroy"==t?(this.each(function(){var t=e(this),s=e(this).next(".nice-select");s.length&&(s.remove(),t.css("display",""))}),0==e(".nice-select").length&&e(document).off(".nice_select")):console.log('Method "'+t+'" does not exist.'),this;this.hide(),this.each(function(){var t=e(this);t.next().hasClass("nice-select")||s(t)}),e(document).off(".nice_select"),e(document).on("click.nice_select",".nice-select",function(t){var s=e(this);e(".nice-select").not(s).removeClass("open"),s.toggleClass("open"),s.hasClass("open")?(s.find(".option"),s.find(".focus").removeClass("focus"),s.find(".selected").addClass("focus")):s.focus()}),e(document).on("click.nice_select",function(t){0===e(t.target).closest(".nice-select").length&&e(".nice-select").removeClass("open").find(".option")}),e(document).on("click.nice_select",".nice-select .option:not(.disabled)",function(t){var s=e(this),n=s.closest(".nice-select");n.find(".selected").removeClass("selected"),s.addClass("selected");var i=s.data("display")||s.text();n.find(".current").text(i),n.prev("select").val(s.data("value")).trigger("change")}),e(document).on("keydown.nice_select",".nice-select",function(t){var s=e(this),n=e(s.find(".focus")||s.find(".list .option.selected"));if(32==t.keyCode||13==t.keyCode)return s.hasClass("open")?n.trigger("click"):s.trigger("click"),!1;if(40==t.keyCode){if(s.hasClass("open")){var i=n.nextAll(".option:not(.disabled)").first();i.length>0&&(s.find(".focus").removeClass("focus"),i.addClass("focus"))}else s.trigger("click");return!1}if(38==t.keyCode){if(s.hasClass("open")){var l=n.prevAll(".option:not(.disabled)").first();l.length>0&&(s.find(".focus").removeClass("focus"),l.addClass("focus"))}else s.trigger("click");return!1}if(27==t.keyCode)s.hasClass("open")&&s.trigger("click");else if(9==t.keyCode&&s.hasClass("open"))return!1});var n=document.createElement("a").style;return n.cssText="pointer-events:auto","auto"!==n.pointerEvents&&e("html").addClass("no-csspointerevents"),this}}(jQuery);
vendor: 25,965 bytes, lines 35403-36243
35403;(function () {
35404	'use strict';
35405
35406	/**
35407	 * @preserve FastClick: polyfill to remove click delays on browsers with touch UIs.
35408	 *
35409	 * @codingstandard ftlabs-jsv2
35410	 * @copyright The Financial Times Limited [All Rights Reserved]
35411	 * @license MIT License (see LICENSE.txt)
35412	 */
35413
35414	/*jslint browser:true, node:true*/
35415	/*global define, Event, Node*/
35416
35417
35418	/**
35419	 * Instantiate fast-clicking listeners on the specified layer.
35420	 *
35421	 * @constructor
35422	 * @param {Element} layer The layer to listen on
35423	 * @param {Object} [options={}] The options to override the defaults
35424	 */
35425	function FastClick(layer, options) {
35426		var oldOnClick;
35427
35428		options = options || {};
35429
35430		/**
35431		 * Whether a click is currently being tracked.
35432		 *
35433		 * @type boolean
35434		 */
35435		this.trackingClick = false;
35436
35437
35438		/**
35439		 * Timestamp for when click tracking started.
35440		 *
35441		 * @type number
35442		 */
35443		this.trackingClickStart = 0;
35444
35445
35446		/**
35447		 * The element being tracked for a click.
35448		 *
35449		 * @type EventTarget
35450		 */
35451		this.targetElement = null;
35452
35453
35454		/**
35455		 * X-coordinate of touch start event.
35456		 *
35457		 * @type number
35458		 */
35459		this.touchStartX = 0;
35460
35461
35462		/**
35463		 * Y-coordinate of touch start event.
35464		 *
35465		 * @type number
35466		 */
35467		this.touchStartY = 0;
35468
35469
35470		/**
35471		 * ID of the last touch, retrieved from Touch.identifier.
35472		 *
35473		 * @type number
35474		 */
35475		this.lastTouchIdentifier = 0;
35476
35477
35478		/**
35479		 * Touchmove boundary, beyond which a click will be cancelled.
35480		 *
35481		 * @type number
35482		 */
35483		this.touchBoundary = options.touchBoundary || 10;
35484
35485
35486		/**
35487		 * The FastClick layer.
35488		 *
35489		 * @type Element
35490		 */
35491		this.layer = layer;
35492
35493		/**
35494		 * The minimum time between tap(touchstart and touchend) events
35495		 *
35496		 * @type number
35497		 */
35498		this.tapDelay = options.tapDelay || 200;
35499
35500		/**
35501		 * The maximum time for a tap
35502		 *
35503		 * @type number
35504		 */
35505		this.tapTimeout = options.tapTimeout || 700;
35506
35507		if (FastClick.notNeeded(layer)) {
35508			return;
35509		}
35510
35511		// Some old versions of Android don't have Function.prototype.bind
35512		function bind(method, context) {
35513			return function() { return method.apply(context, arguments); };
35514		}
35515
35516
35517		var methods = ['onMouse', 'onClick', 'onTouchStart', 'onTouchMove', 'onTouchEnd', 'onTouchCancel'];
35518		var context = this;
35519		for (var i = 0, l = methods.length; i < l; i++) {
35520			context[methods[i]] = bind(context[methods[i]], context);
35521		}
35522
35523		// Set up event handlers as required
35524		if (deviceIsAndroid) {
35525			layer.addEventListener('mouseover', this.onMouse, true);
35526			layer.addEventListener('mousedown', this.onMouse, true);
35527			layer.addEventListener('mouseup', this.onMouse, true);
35528		}
35529
35530		layer.addEventListener('click', this.onClick, true);
35531		layer.addEventListener('touchstart', this.onTouchStart, false);
35532		layer.addEventListener('touchmove', this.onTouchMove, false);
35533		layer.addEventListener('touchend', this.onTouchEnd, false);
35534		layer.addEventListener('touchcancel', this.onTouchCancel, false);
35535
35536		// Hack is required for browsers that don't support Event#stopImmediatePropagation (e.g. Android 2)
35537		// which is how FastClick normally stops click events bubbling to callbacks registered on the FastClick
35538		// layer when they are cancelled.
35539		if (!Event.prototype.stopImmediatePropagation) {
35540			layer.removeEventListener = function(type, callback, capture) {
35541				var rmv = Node.prototype.removeEventListener;
35542				if (type === 'click') {
35543					rmv.call(layer, type, callback.hijacked || callback, capture);
35544				} else {
35545					rmv.call(layer, type, callback, capture);
35546				}
35547			};
35548
35549			layer.addEventListener = function(type, callback, capture) {
35550				var adv = Node.prototype.addEventListener;
35551				if (type === 'click') {
35552					adv.call(layer, type, callback.hijacked || (callback.hijacked = function(event) {
35553						if (!event.propagationStopped) {
35554							callback(event);
35555						}
35556					}), capture);
35557				} else {
35558					adv.call(layer, type, callback, capture);
35559				}
35560			};
35561		}
35562
35563		// If a handler is already declared in the element's onclick attribute, it will be fired before
35564		// FastClick's onClick handler. Fix this by pulling out the user-defined handler function and
35565		// adding it as listener.
35566		if (typeof layer.onclick === 'function') {
35567
35568			// Android browser on at least 3.2 requires a new reference to the function in layer.onclick
35569			// - the old one won't work if passed to addEventListener directly.
35570			oldOnClick = layer.onclick;
35571			layer.addEventListener('click', function(event) {
35572				oldOnClick(event);
35573			}, false);
35574			layer.onclick = null;
35575		}
35576	}
35577
35578	/**
35579	* Windows Phone 8.1 fakes user agent string to look like Android and iPhone.
35580	*
35581	* @type boolean
35582	*/
35583	var deviceIsWindowsPhone = navigator.userAgent.indexOf("Windows Phone") >= 0;
35584
35585	/**
35586	 * Android requires exceptions.
35587	 *
35588	 * @type boolean
35589	 */
35590	var deviceIsAndroid = navigator.userAgent.indexOf('Android') > 0 && !deviceIsWindowsPhone;
35591
35592
35593	/**
35594	 * iOS requires exceptions.
35595	 *
35596	 * @type boolean
35597	 */
35598	var deviceIsIOS = /iP(ad|hone|od)/.test(navigator.userAgent) && !deviceIsWindowsPhone;
35599
35600
35601	/**
35602	 * iOS 4 requires an exception for select elements.
35603	 *
35604	 * @type boolean
35605	 */
35606	var deviceIsIOS4 = deviceIsIOS && (/OS 4_\d(_\d)?/).test(navigator.userAgent);
35607
35608
35609	/**
35610	 * iOS 6.0-7.* requires the target element to be manually derived
35611	 *
35612	 * @type boolean
35613	 */
35614	var deviceIsIOSWithBadTarget = deviceIsIOS && (/OS [6-7]_\d/).test(navigator.userAgent);
35615
35616	/**
35617	 * BlackBerry requires exceptions.
35618	 *
35619	 * @type boolean
35620	 */
35621	var deviceIsBlackBerry10 = navigator.userAgent.indexOf('BB10') > 0;
35622
35623	/**
35624	 * Determine whether a given element requires a native click.
35625	 *
35626	 * @param {EventTarget|Element} target Target DOM element
35627	 * @returns {boolean} Returns true if the element needs a native click
35628	 */
35629	FastClick.prototype.needsClick = function(target) {
35630		switch (target.nodeName.toLowerCase()) {
35631
35632		// Don't send a synthetic click to disabled inputs (issue #62)
35633		case 'button':
35634		case 'select':
35635		case 'textarea':
35636			if (target.disabled) {
35637				return true;
35638			}
35639
35640			break;
35641		case 'input':
35642
35643			// File inputs need real clicks on iOS 6 due to a browser bug (issue #68)
35644			if ((deviceIsIOS && target.type === 'file') || target.disabled) {
35645				return true;
35646			}
35647
35648			break;
35649		case 'label':
35650		case 'iframe': // iOS8 homescreen apps can prevent events bubbling into frames
35651		case 'video':
35652			return true;
35653		}
35654
35655		return (/\bneedsclick\b/).test(target.className);
35656	};
35657
35658
35659	/**
35660	 * Determine whether a given element requires a call to focus to simulate click into element.
35661	 *
35662	 * @param {EventTarget|Element} target Target DOM element
35663	 * @returns {boolean} Returns true if the element requires a call to focus to simulate native click.
35664	 */
35665	FastClick.prototype.needsFocus = function(target) {
35666		switch (target.nodeName.toLowerCase()) {
35667		case 'textarea':
35668			return true;
35669		case 'select':
35670			return !deviceIsAndroid;
35671		case 'input':
35672			switch (target.type) {
35673			case 'button':
35674			case 'checkbox':
35675			case 'file':
35676			case 'image':
35677			case 'radio':
35678			case 'submit':
35679				return false;
35680			}
35681
35682			// No point in attempting to focus disabled inputs
35683			return !target.disabled && !target.readOnly;
35684		default:
35685			return (/\bneedsfocus\b/).test(target.className);
35686		}
35687	};
35688
35689
35690	/**
35691	 * Send a click event to the specified element.
35692	 *
35693	 * @param {EventTarget|Element} targetElement
35694	 * @param {Event} event
35695	 */
35696	FastClick.prototype.sendClick = function(targetElement, event) {
35697		var clickEvent, touch;
35698
35699		// On some Android devices activeElement needs to be blurred otherwise the synthetic click will have no effect (#24)
35700		if (document.activeElement && document.activeElement !== targetElement) {
35701			document.activeElement.blur();
35702		}
35703
35704		touch = event.changedTouches[0];
35705
35706		// Synthesise a click event, with an extra attribute so it can be tracked
35707		clickEvent = document.createEvent('MouseEvents');
35708		clickEvent.initMouseEvent(this.determineEventType(targetElement), true, true, window, 1, touch.screenX, touch.screenY, touch.clientX, touch.clientY, false, false, false, false, 0, null);
35709		clickEvent.forwardedTouchEvent = true;
35710		targetElement.dispatchEvent(clickEvent);
35711	};
35712
35713	FastClick.prototype.determineEventType = function(targetElement) {
35714
35715		//Issue #159: Android Chrome Select Box does not open with a synthetic click event
35716		if (deviceIsAndroid && targetElement.tagName.toLowerCase() === 'select') {
35717			return 'mousedown';
35718		}
35719
35720		return 'click';
35721	};
35722
35723
35724	/**
35725	 * @param {EventTarget|Element} targetElement
35726	 */
35727	FastClick.prototype.focus = function(targetElement) {
35728		var length;
35729
35730		// Issue #160: on iOS 7, some input elements (e.g. date datetime month) throw a vague TypeError on setSelectionRange. These elements don't have an integer value for the selectionStart and selectionEnd properties, but unfortunately that can't be used for detection because accessing the properties also throws a TypeError. Just check the type instead. Filed as Apple bug #15122724.
35731		if (deviceIsIOS && targetElement.setSelectionRange && targetElement.type.indexOf('date') !== 0 && targetElement.type !== 'time' && targetElement.type !== 'month') {
35732			length = targetElement.value.length;
35733			targetElement.setSelectionRange(length, length);
35734		} else {
35735			targetElement.focus();
35736		}
35737	};
35738
35739
35740	/**
35741	 * Check whether the given target element is a child of a scrollable layer and if so, set a flag on it.
35742	 *
35743	 * @param {EventTarget|Element} targetElement
35744	 */
35745	FastClick.prototype.updateScrollParent = function(targetElement) {
35746		var scrollParent, parentElement;
35747
35748		scrollParent = targetElement.fastClickScrollParent;
35749
35750		// Attempt to discover whether the target element is contained within a scrollable layer. Re-check if the
35751		// target element was moved to another parent.
35752		if (!scrollParent || !scrollParent.contains(targetElement)) {
35753			parentElement = targetElement;
35754			do {
35755				if (parentElement.scrollHeight > parentElement.offsetHeight) {
35756					scrollParent = parentElement;
35757					targetElement.fastClickScrollParent = parentElement;
35758					break;
35759				}
35760
35761				parentElement = parentElement.parentElement;
35762			} while (parentElement);
35763		}
35764
35765		// Always update the scroll top tracker if possible.
35766		if (scrollParent) {
35767			scrollParent.fastClickLastScrollTop = scrollParent.scrollTop;
35768		}
35769	};
35770
35771
35772	/**
35773	 * @param {EventTarget} targetElement
35774	 * @returns {Element|EventTarget}
35775	 */
35776	FastClick.prototype.getTargetElementFromEventTarget = function(eventTarget) {
35777
35778		// On some older browsers (notably Safari on iOS 4.1 - see issue #56) the event target may be a text node.
35779		if (eventTarget.nodeType === Node.TEXT_NODE) {
35780			return eventTarget.parentNode;
35781		}
35782
35783		return eventTarget;
35784	};
35785
35786
35787	/**
35788	 * On touch start, record the position and scroll offset.
35789	 *
35790	 * @param {Event} event
35791	 * @returns {boolean}
35792	 */
35793	FastClick.prototype.onTouchStart = function(event) {
35794		var targetElement, touch, selection;
35795
35796		// Ignore multiple touches, otherwise pinch-to-zoom is prevented if both fingers are on the FastClick element (issue #111).
35797		if (event.targetTouches.length > 1) {
35798			return true;
35799		}
35800
35801		targetElement = this.getTargetElementFromEventTarget(event.target);
35802		touch = event.targetTouches[0];
35803
35804		if (deviceIsIOS) {
35805
35806			// Only trusted events will deselect text on iOS (issue #49)
35807			selection = window.getSelection();
35808			if (selection.rangeCount && !selection.isCollapsed) {
35809				return true;
35810			}
35811
35812			if (!deviceIsIOS4) {
35813
35814				// Weird things happen on iOS when an alert or confirm dialog is opened from a click event callback (issue #23):
35815				// when the user next taps anywhere else on the page, new touchstart and touchend events are dispatched
35816				// with the same identifier as the touch event that previously triggered the click that triggered the alert.
35817				// Sadly, there is an issue on iOS 4 that causes some normal touch events to have the same identifier as an
35818				// immediately preceeding touch event (issue #52), so this fix is unavailable on that platform.
35819				// Issue 120: touch.identifier is 0 when Chrome dev tools 'Emulate touch events' is set with an iOS device UA string,
35820				// which causes all touch events to be ignored. As this block only applies to iOS, and iOS identifiers are always long,
35821				// random integers, it's safe to to continue if the identifier is 0 here.
35822				if (touch.identifier && touch.identifier === this.lastTouchIdentifier) {
35823					event.preventDefault();
35824					return false;
35825				}
35826
35827				this.lastTouchIdentifier = touch.identifier;
35828
35829				// If the target element is a child of a scrollable layer (using -webkit-overflow-scrolling: touch) and:
35830				// 1) the user does a fling scroll on the scrollable layer
35831				// 2) the user stops the fling scroll with another tap
35832				// then the event.target of the last 'touchend' event will be the element that was under the user's finger
35833				// when the fling scroll was started, causing FastClick to send a click event to that layer - unless a check
35834				// is made to ensure that a parent layer was not scrolled before sending a synthetic click (issue #42).
35835				this.updateScrollParent(targetElement);
35836			}
35837		}
35838
35839		this.trackingClick = true;
35840		this.trackingClickStart = event.timeStamp;
35841		this.targetElement = targetElement;
35842
35843		this.touchStartX = touch.pageX;
35844		this.touchStartY = touch.pageY;
35845
35846		// Prevent phantom clicks on fast double-tap (issue #36)
35847		if ((event.timeStamp - this.lastClickTime) < this.tapDelay) {
35848			event.preventDefault();
35849		}
35850
35851		return true;
35852	};
35853
35854
35855	/**
35856	 * Based on a touchmove event object, check whether the touch has moved past a boundary since it started.
35857	 *
35858	 * @param {Event} event
35859	 * @returns {boolean}
35860	 */
35861	FastClick.prototype.touchHasMoved = function(event) {
35862		var touch = event.changedTouches[0], boundary = this.touchBoundary;
35863
35864		if (Math.abs(touch.pageX - this.touchStartX) > boundary || Math.abs(touch.pageY - this.touchStartY) > boundary) {
35865			return true;
35866		}
35867
35868		return false;
35869	};
35870
35871
35872	/**
35873	 * Update the last position.
35874	 *
35875	 * @param {Event} event
35876	 * @returns {boolean}
35877	 */
35878	FastClick.prototype.onTouchMove = function(event) {
35879		if (!this.trackingClick) {
35880			return true;
35881		}
35882
35883		// If the touch has moved, cancel the click tracking
35884		if (this.targetElement !== this.getTargetElementFromEventTarget(event.target) || this.touchHasMoved(event)) {
35885			this.trackingClick = false;
35886			this.targetElement = null;
35887		}
35888
35889		return true;
35890	};
35891
35892
35893	/**
35894	 * Attempt to find the labelled control for the given label element.
35895	 *
35896	 * @param {EventTarget|HTMLLabelElement} labelElement
35897	 * @returns {Element|null}
35898	 */
35899	FastClick.prototype.findControl = function(labelElement) {
35900
35901		// Fast path for newer browsers supporting the HTML5 control attribute
35902		if (labelElement.control !== undefined) {
35903			return labelElement.control;
35904		}
35905
35906		// All browsers under test that support touch events also support the HTML5 htmlFor attribute
35907		if (labelElement.htmlFor) {
35908			return document.getElementById(labelElement.htmlFor);
35909		}
35910
35911		// If no for attribute exists, attempt to retrieve the first labellable descendant element
35912		// the list of which is defined here: http://www.w3.org/TR/html5/forms.html#category-label
35913		return labelElement.querySelector('button, input:not([type=hidden]), keygen, meter, output, progress, select, textarea');
35914	};
35915
35916
35917	/**
35918	 * On touch end, determine whether to send a click event at once.
35919	 *
35920	 * @param {Event} event
35921	 * @returns {boolean}
35922	 */
35923	FastClick.prototype.onTouchEnd = function(event) {
35924		var forElement, trackingClickStart, targetTagName, scrollParent, touch, targetElement = this.targetElement;
35925
35926		if (!this.trackingClick) {
35927			return true;
35928		}
35929
35930		// Prevent phantom clicks on fast double-tap (issue #36)
35931		if ((event.timeStamp - this.lastClickTime) < this.tapDelay) {
35932			this.cancelNextClick = true;
35933			return true;
35934		}
35935
35936		if ((event.timeStamp - this.trackingClickStart) > this.tapTimeout) {
35937			return true;
35938		}
35939
35940		// Reset to prevent wrong click cancel on input (issue #156).
35941		this.cancelNextClick = false;
35942
35943		this.lastClickTime = event.timeStamp;
35944
35945		trackingClickStart = this.trackingClickStart;
35946		this.trackingClick = false;
35947		this.trackingClickStart = 0;
35948
35949		// On some iOS devices, the targetElement supplied with the event is invalid if the layer
35950		// is performing a transition or scroll, and has to be re-detected manually. Note that
35951		// for this to function correctly, it must be called *after* the event target is checked!
35952		// See issue #57; also filed as rdar://13048589 .
35953		if (deviceIsIOSWithBadTarget) {
35954			touch = event.changedTouches[0];
35955
35956			// In certain cases arguments of elementFromPoint can be negative, so prevent setting targetElement to null
35957			targetElement = document.elementFromPoint(touch.pageX - window.pageXOffset, touch.pageY - window.pageYOffset) || targetElement;
35958			targetElement.fastClickScrollParent = this.targetElement.fastClickScrollParent;
35959		}
35960
35961		targetTagName = targetElement.tagName.toLowerCase();
35962		if (targetTagName === 'label') {
35963			forElement = this.findControl(targetElement);
35964			if (forElement) {
35965				this.focus(targetElement);
35966				if (deviceIsAndroid) {
35967					return false;
35968				}
35969
35970				targetElement = forElement;
35971			}
35972		} else if (this.needsFocus(targetElement)) {
35973
35974			// Case 1: If the touch started a while ago (best guess is 100ms based on tests for issue #36) then focus will be triggered anyway. Return early and unset the target element reference so that the subsequent click will be allowed through.
35975			// Case 2: Without this exception for input elements tapped when the document is contained in an iframe, then any inputted text won't be visible even though the value attribute is updated as the user types (issue #37).
35976			if ((event.timeStamp - trackingClickStart) > 100 || (deviceIsIOS && window.top !== window && targetTagName === 'input')) {
35977				this.targetElement = null;
35978				return false;
35979			}
35980
35981			this.focus(targetElement);
35982			this.sendClick(targetElement, event);
35983
35984			// Select elements need the event to go through on iOS 4, otherwise the selector menu won't open.
35985			// Also this breaks opening selects when VoiceOver is active on iOS6, iOS7 (and possibly others)
35986			if (!deviceIsIOS || targetTagName !== 'select') {
35987				this.targetElement = null;
35988				event.preventDefault();
35989			}
35990
35991			return false;
35992		}
35993
35994		if (deviceIsIOS && !deviceIsIOS4) {
35995
35996			// Don't send a synthetic click event if the target element is contained within a parent layer that was scrolled
35997			// and this tap is being used to stop the scrolling (usually initiated by a fling - issue #42).
35998			scrollParent = targetElement.fastClickScrollParent;
35999			if (scrollParent && scrollParent.fastClickLastScrollTop !== scrollParent.scrollTop) {
36000				return true;
36001			}
36002		}
36003
36004		// Prevent the actual click from going though - unless the target node is marked as requiring
36005		// real clicks or if it is in the whitelist in which case only non-programmatic clicks are permitted.
36006		if (!this.needsClick(targetElement)) {
36007			event.preventDefault();
36008			this.sendClick(targetElement, event);
36009		}
36010
36011		return false;
36012	};
36013
36014
36015	/**
36016	 * On touch cancel, stop tracking the click.
36017	 *
36018	 * @returns {void}
36019	 */
36020	FastClick.prototype.onTouchCancel = function() {
36021		this.trackingClick = false;
36022		this.targetElement = null;
36023	};
36024
36025
36026	/**
36027	 * Determine mouse events which should be permitted.
36028	 *
36029	 * @param {Event} event
36030	 * @returns {boolean}
36031	 */
36032	FastClick.prototype.onMouse = function(event) {
36033
36034		// If a target element was never set (because a touch event was never fired) allow the event
36035		if (!this.targetElement) {
36036			return true;
36037		}
36038
36039		if (event.forwardedTouchEvent) {
36040			return true;
36041		}
36042
36043		// Programmatically generated events targeting a specific element should be permitted
36044		if (!event.cancelable) {
36045			return true;
36046		}
36047
36048		// Derive and check the target element to see whether the mouse event needs to be permitted;
36049		// unless explicitly enabled, prevent non-touch click events from triggering actions,
36050		// to prevent ghost/doubleclicks.
36051		if (!this.needsClick(this.targetElement) || this.cancelNextClick) {
36052
36053			// Prevent any user-added listeners declared on FastClick element from being fired.
36054			if (event.stopImmediatePropagation) {
36055				event.stopImmediatePropagation();
36056			} else {
36057
36058				// Part of the hack for browsers that don't support Event#stopImmediatePropagation (e.g. Android 2)
36059				event.propagationStopped = true;
36060			}
36061
36062			// Cancel the event
36063			event.stopPropagation();
36064			event.preventDefault();
36065
36066			return false;
36067		}
36068
36069		// If the mouse event is permitted, return true for the action to go through.
36070		return true;
36071	};
36072
36073
36074	/**
36075	 * On actual clicks, determine whether this is a touch-generated click, a click action occurring
36076	 * naturally after a delay after a touch (which needs to be cancelled to avoid duplication), or
36077	 * an actual click which should be permitted.
36078	 *
36079	 * @param {Event} event
36080	 * @returns {boolean}
36081	 */
36082	FastClick.prototype.onClick = function(event) {
36083		var permitted;
36084
36085		// It's possible for another FastClick-like library delivered with third-party code to fire a click event before FastClick does (issue #44). In that case, set the click-tracking flag back to false and return early. This will cause onTouchEnd to return early.
36086		if (this.trackingClick) {
36087			this.targetElement = null;
36088			this.trackingClick = false;
36089			return true;
36090		}
36091
36092		// Very odd behaviour on iOS (issue #18): if a submit element is present inside a form and the user hits enter in the iOS simulator or clicks the Go button on the pop-up OS keyboard the a kind of 'fake' click event will be triggered with the submit-type input element as the target.
36093		if (event.target.type === 'submit' && event.detail === 0) {
36094			return true;
36095		}
36096
36097		permitted = this.onMouse(event);
36098
36099		// Only unset targetElement if the click is not permitted. This will ensure that the check for !targetElement in onMouse fails and the browser's click doesn't go through.
36100		if (!permitted) {
36101			this.targetElement = null;
36102		}
36103
36104		// If clicks are permitted, return true for the action to go through.
36105		return permitted;
36106	};
36107
36108
36109	/**
36110	 * Remove all FastClick's event listeners.
36111	 *
36112	 * @returns {void}
36113	 */
36114	FastClick.prototype.destroy = function() {
36115		var layer = this.layer;
36116
36117		if (deviceIsAndroid) {
36118			layer.removeEventListener('mouseover', this.onMouse, true);
36119			layer.removeEventListener('mousedown', this.onMouse, true);
36120			layer.removeEventListener('mouseup', this.onMouse, true);
36121		}
36122
36123		layer.removeEventListener('click', this.onClick, true);
36124		layer.removeEventListener('touchstart', this.onTouchStart, false);
36125		layer.removeEventListener('touchmove', this.onTouchMove, false);
36126		layer.removeEventListener('touchend', this.onTouchEnd, false);
36127		layer.removeEventListener('touchcancel', this.onTouchCancel, false);
36128	};
36129
36130
36131	/**
36132	 * Check whether FastClick is needed.
36133	 *
36134	 * @param {Element} layer The layer to listen on
36135	 */
36136	FastClick.notNeeded = function(layer) {
36137		var metaViewport;
36138		var chromeVersion;
36139		var blackberryVersion;
36140		var firefoxVersion;
36141
36142		// Devices that don't support touch don't need FastClick
36143		if (typeof window.ontouchstart === 'undefined') {
36144			return true;
36145		}
36146
36147		// Chrome version - zero for other browsers
36148		chromeVersion = +(/Chrome\/([0-9]+)/.exec(navigator.userAgent) || [,0])[1];
36149
36150		if (chromeVersion) {
36151
36152			if (deviceIsAndroid) {
36153				metaViewport = document.querySelector('meta[name=viewport]');
36154
36155				if (metaViewport) {
36156					// Chrome on Android with user-scalable="no" doesn't need FastClick (issue #89)
36157					if (metaViewport.content.indexOf('user-scalable=no') !== -1) {
36158						return true;
36159					}
36160					// Chrome 32 and above with width=device-width or less don't need FastClick
36161					if (chromeVersion > 31 && document.documentElement.scrollWidth <= window.outerWidth) {
36162						return true;
36163					}
36164				}
36165
36166			// Chrome desktop doesn't need FastClick (issue #15)
36167			} else {
36168				return true;
36169			}
36170		}
36171
36172		if (deviceIsBlackBerry10) {
36173			blackberryVersion = navigator.userAgent.match(/Version\/([0-9]*)\.([0-9]*)/);
36174
36175			// BlackBerry 10.3+ does not require Fastclick library.
36176			// https://github.com/ftlabs/fastclick/issues/251
36177			if (blackberryVersion[1] >= 10 && blackberryVersion[2] >= 3) {
36178				metaViewport = document.querySelector('meta[name=viewport]');
36179
36180				if (metaViewport) {
36181					// user-scalable=no eliminates click delay.
36182					if (metaViewport.content.indexOf('user-scalable=no') !== -1) {
36183						return true;
36184					}
36185					// width=device-width (or less than device-width) eliminates click delay.
36186					if (document.documentElement.scrollWidth <= window.outerWidth) {
36187						return true;
36188					}
36189				}
36190			}
36191		}
36192
36193		// IE10 with -ms-touch-action: none or manipulation, which disables double-tap-to-zoom (issue #97)
36194		if (layer.style.msTouchAction === 'none' || layer.style.touchAction === 'manipulation') {
36195			return true;
36196		}
36197
36198		// Firefox version - zero for other browsers
36199		firefoxVersion = +(/Firefox\/([0-9]+)/.exec(navigator.userAgent) || [,0])[1];
36200
36201		if (firefoxVersion >= 27) {
36202			// Firefox 27+ does not have tap delay if the content is not zoomable - https://bugzilla.mozilla.org/show_bug.cgi?id=922896
36203
36204			metaViewport = document.querySelector('meta[name=viewport]');
36205			if (metaViewport && (metaViewport.content.indexOf('user-scalable=no') !== -1 || document.documentElement.scrollWidth <= window.outerWidth)) {
36206				return true;
36207			}
36208		}
36209
36210		// IE11: prefixed -ms-touch-action is no longer supported and it's recomended to use non-prefixed version
36211		// http://msdn.microsoft.com/en-us/library/windows/apps/Hh767313.aspx
36212		if (layer.style.touchAction === 'none' || layer.style.touchAction === 'manipulation') {
36213			return true;
36214		}
36215
36216		return false;
36217	};
36218
36219
36220	/**
36221	 * Factory method for creating a FastClick object
36222	 *
36223	 * @param {Element} layer The layer to listen on
36224	 * @param {Object} [options={}] The options to override the defaults
36225	 */
36226	FastClick.attach = function(layer, options) {
36227		return new FastClick(layer, options);
36228	};
36229
36230
36231	if (typeof define === 'function' && typeof define.amd === 'object' && define.amd) {
36232
36233		// AMD. Register as an anonymous module.
36234		define(function() {
36235			return FastClick;
36236		});
36237	} else if (typeof module !== 'undefined' && module.exports) {
36238		module.exports = FastClick.attach;
36239		module.exports.FastClick = FastClick;
36240	} else {
36241		window.FastClick = FastClick;
36242	}
36243}());
vendor: 3,962 bytes, lines 36244-36246
36244
36245/* http://prismjs.com/download.html?themes=prism&languages=markup+css+clike+javascript+scss */
36246var _self="undefined"!=typeof window?window:"undefined"!=typeof WorkerGlobalScope&&self instanceof WorkerGlobalScope?self:{},Prism=function(){var e=/\blang(?:uage)?-(?!\*)(\w+)\b/i,t=_self.Prism={util:{encode:function(e){return e instanceof n?new n(e.type,t.util.encode(e.content),e.alias):"Array"===t.util.type(e)?e.map(t.util.encode):e.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/\u00a0/g," ")},type:function(e){return Object.prototype.toString.call(e).match(/\[object (\w+)\]/)[1]},clone:function(e){var n=t.util.type(e);switch(n){case"Object":var a={};for(var r in e)e.hasOwnProperty(r)&&(a[r]=t.util.clone(e[r]));return a;case"Array":return e.map&&e.map(function(e){return t.util.clone(e)})}return e}},languages:{extend:function(e,n){var a=t.util.clone(t.languages[e]);for(var r in n)a[r]=n[r];return a},insertBefore:function(e,n,a,r){r=r||t.languages;var i=r[e];if(2==arguments.length){a=arguments[1];for(var l in a)a.hasOwnProperty(l)&&(i[l]=a[l]);return i}var o={};for(var s in i)if(i.hasOwnProperty(s)){if(s==n)for(var l in a)a.hasOwnProperty(l)&&(o[l]=a[l]);o[s]=i[s]}return t.languages.DFS(t.languages,function(t,n){n===r[e]&&t!=e&&(this[t]=o)}),r[e]=o},DFS:function(e,n,a){for(var r in e)e.hasOwnProperty(r)&&(n.call(e,r,e[r],a||r),"Object"===t.util.type(e[r])?t.languages.DFS(e[r],n):"Array"===t.util.type(e[r])&&t.languages.DFS(e[r],n,r))}},plugins:{},highlightAll:function(e,n){for(var a,r=document.querySelectorAll('code[class*="language-"], [class*="language-"] code, code[class*="lang-"], [class*="lang-"] code'),i=0;a=r[i++];)t.highlightElement(a,e===!0,n)},highlightElement:function(a,r,i){for(var l,o,s=a;s&&!e.test(s.className);)s=s.parentNode;s&&(l=(s.className.match(e)||[,""])[1],o=t.languages[l]),a.className=a.className.replace(e,"").replace(/\s+/g," ")+" language-"+l,s=a.parentNode,/pre/i.test(s.nodeName)&&(s.className=s.className.replace(e,"").replace(/\s+/g," ")+" language-"+l);var u=a.textContent,g={element:a,language:l,grammar:o,code:u};if(!u||!o)return t.hooks.run("complete",g),void 0;if(t.hooks.run("before-highlight",g),r&&_self.Worker){var c=new Worker(t.filename);c.onmessage=function(e){g.highlightedCode=n.stringify(JSON.parse(e.data),l),t.hooks.run("before-insert",g),g.element.innerHTML=g.highlightedCode,i&&i.call(g.element),t.hooks.run("after-highlight",g),t.hooks.run("complete",g)},c.postMessage(JSON.stringify({language:g.language,code:g.code,immediateClose:!0}))}else g.highlightedCode=t.highlight(g.code,g.grammar,g.language),t.hooks.run("before-insert",g),g.element.innerHTML=g.highlightedCode,i&&i.call(a),t.hooks.run("after-highlight",g),t.hooks.run("complete",g)},highlight:function(e,a,r){var i=t.tokenize(e,a);return n.stringify(t.util.encode(i),r)},tokenize:function(e,n){var a=t.Token,r=[e],i=n.rest;if(i){for(var l in i)n[l]=i[l];delete n.rest}e:for(var l in n)if(n.hasOwnProperty(l)&&n[l]){var o=n[l];o="Array"===t.util.type(o)?o:[o];for(var s=0;s<o.length;++s){var u=o[s],g=u.inside,c=!!u.lookbehind,f=0,h=u.alias;u=u.pattern||u;for(var p=0;p<r.length;p++){var d=r[p];if(r.length>e.length)break e;if(!(d instanceof a)){u.lastIndex=0;var m=u.exec(d);if(m){c&&(f=m[1].length);var y=m.index-1+f,m=m[0].slice(f),v=m.length,k=y+v,b=d.slice(0,y+1),w=d.slice(k+1),N=[p,1];b&&N.push(b);var O=new a(l,g?t.tokenize(m,g):m,h);N.push(O),w&&N.push(w),Array.prototype.splice.apply(r,N)}}}}}return r},hooks:{all:{},add:function(e,n){var a=t.hooks.all;a[e]=a[e]||[],a[e].push(n)},run:function(e,n){var a=t.hooks.all[e];if(a&&a.length)for(var r,i=0;r=a[i++];)r(n)}}},n=t.Token=function(e,t,n){this.type=e,this.content=t,this.alias=n};if(n.stringify=function(e,a,r){if("string"==typeof e)return e;if("Array"===t.util.type(e))return e.map(function(t){return n.stringify(t,a,e)}).join("");var i={type:e.type,content:n.stringify(e.content,a,r),tag:"span",classes:["token",e.type],attributes:{},language:a,parent:r};
36246if("comment"==i.type&&(i.attributes.spellcheck="true"),e.alias){var l="Array"===t.util.type(e.alias)?e.alias:[e.alias];Array.prototype.push.apply(i.classes,l)}t.hooks.run("wrap",i);var o="";for(var s in i.attributes)o+=(o?" ":"")+s+'="'+(i.attributes[s]||"")+'"';return"<"+i.tag+' class="'+i.classes.join(" ")+'" '+o+">"+i.content+"</"+i.tag+">"},!_self.document)return _self.addEventListener?(_self.addEventListener("message",function(e){var n=JSON.parse(e.data),a=n.language,r=n.code,i=n.immediateClose;_self.postMessage(JSON.stringify(t.util.encode(t.tokenize(r,t.languages[a])))),i&&_self.close()},!1),_self.Prism):_self.Prism;var a=document.getElementsByTagName("script");return a=a[a.length-1],a&&(t.filename=a.src,document.addEventListener&&!a.hasAttribute("data-manual")&&document.addEventListener("DOMContentLoaded",t.highlightAll)),_self.Prism}();"undefined"!=typeof module&&module.exports&&(module.exports=Prism),"undefined"!=typeof global&&(global.Prism=Prism);
36247Prism.languages.markup={comment:/<!--[\w\W]*?-->/,prolog:/<\?[\w\W]+?\?>/,doctype:/<!DOCTYPE[\w\W]+?>/,cdata:/<!\[CDATA\[[\w\W]*?]]>/i,tag:{pattern:/<\/?[^\s>\/=.]+(?:\s+[^\s>\/=]+(?:=(?:("|')(?:\\\1|\\?(?!\1)[\w\W])*\1|[^\s'">=]+))?)*\s*\/?>/i,inside:{tag:{pattern:/^<\/?[^\s>\/]+/i,inside:{punctuation:/^<\/?/,namespace:/^[^\s>\/:]+:/}},"attr-value":{pattern:/=(?:('|")[\w\W]*?(\1)|[^\s>]+)/i,inside:{punctuation:/[=>"']/}},punctuation:/\/?>/,"attr-name":{pattern:/[^\s>\/]+/,inside:{namespace:/^[^\s>\/:]+:/}}}},entity:/&#?[\da-z]{1,8};/i},Prism.hooks.add("wrap",function(a){"entity"===a.type&&(a.attributes.title=a.content.replace(/&amp;/,"&"))}),Prism.languages.xml=Prism.languages.markup,Prism.languages.html=Prism.languages.markup,Prism.languages.mathml=Prism.languages.markup,Prism.languages.svg=Prism.languages.markup;
36248Prism.languages.css={comment:/\/\*[\w\W]*?\*\//,atrule:{pattern:/@[\w-]+?.*?(;|(?=\s*\{))/i,inside:{rule:/@[\w-]+/}},url:/url\((?:(["'])(\\(?:\r\n|[\w\W])|(?!\1)[^\\\r\n])*\1|.*?)\)/i,selector:/[^\{\}\s][^\{\};]*?(?=\s*\{)/,string:/("|')(\\(?:\r\n|[\w\W])|(?!\1)[^\\\r\n])*\1/,property:/(\b|\B)[\w-]+(?=\s*:)/i,important:/\B!important\b/i,"function":/[-a-z0-9]+(?=\()/i,punctuation:/[(){};:]/},Prism.languages.css.atrule.inside.rest=Prism.util.clone(Prism.languages.css),Prism.languages.markup&&(Prism.languages.insertBefore("markup","tag",{style:{pattern:/<style[\w\W]*?>[\w\W]*?<\/style>/i,inside:{tag:{pattern:/<style[\w\W]*?>|<\/style>/i,inside:Prism.languages.markup.tag.inside},rest:Prism.languages.css},alias:"language-css"}}),Prism.languages.insertBefore("inside","attr-value",{"style-attr":{pattern:/\s*style=("|').*?\1/i,inside:{"attr-name":{pattern:/^\s*style/i,inside:Prism.languages.markup.tag.inside},punctuation:/^\s*=\s*['"]|['"]\s*$/,"attr-value":{pattern:/.+/i,inside:Prism.languages.css}},alias:"language-css"}},Prism.languages.markup.tag));
36249Prism.languages.clike={comment:[{pattern:/(^|[^\\])\/\*[\w\W]*?\*\//,lookbehind:!0},{pattern:/(^|[^\\:])\/\/.*/,lookbehind:!0}],string:/("|')(\\(?:\r\n|[\s\S])|(?!\1)[^\\\r\n])*\1/,"class-name":{pattern:/((?:\b(?:class|interface|extends|implements|trait|instanceof|new)\s+)|(?:catch\s+\())[a-z0-9_\.\\]+/i,lookbehind:!0,inside:{punctuation:/(\.|\\)/}},keyword:/\b(if|else|while|do|for|return|in|instanceof|function|new|try|throw|catch|finally|null|break|continue)\b/,"boolean":/\b(true|false)\b/,"function":/[a-z0-9_]+(?=\()/i,number:/\b-?(?:0x[\da-f]+|\d*\.?\d+(?:e[+-]?\d+)?)\b/i,operator:/--?|\+\+?|!=?=?|<=?|>=?|==?=?|&&?|\|\|?|\?|\*|\/|~|\^|%/,punctuation:/[{}[\];(),.:]/};
36250Prism.languages.javascript=Prism.languages.extend("clike",{keyword:/\b(as|async|await|break|case|catch|class|const|continue|debugger|default|delete|do|else|enum|export|extends|false|finally|for|from|function|get|if|implements|import|in|instanceof|interface|let|new|null|of|package|private|protected|public|return|set|static|super|switch|this|throw|true|try|typeof|var|void|while|with|yield)\b/,number:/\b-?(0x[\dA-Fa-f]+|0b[01]+|0o[0-7]+|\d*\.?\d+([Ee][+-]?\d+)?|NaN|Infinity)\b/,"function":/[_$a-zA-Z\xA0-\uFFFF][_$a-zA-Z0-9\xA0-\uFFFF]*(?=\()/i}),Prism.languages.insertBefore("javascript","keyword",{regex:{pattern:/(^|[^/])\/(?!\/)(\[.+?]|\\.|[^/\\\r\n])+\/[gimyu]{0,5}(?=\s*($|[\r\n,.;})]))/,lookbehind:!0}}),Prism.languages.insertBefore("javascript","class-name",{"template-string":{pattern:/`(?:\\`|\\?[^`])*`/,inside:{interpolation:{pattern:/\$\{[^}]+\}/,inside:{"interpolation-punctuation":{pattern:/^\$\{|\}$/,alias:"punctuation"},rest:Prism.languages.javascript}},string:/[\s\S]+/}}}),Prism.languages.markup&&Prism.languages.insertBefore("markup","tag",{script:{pattern:/<script[\w\W]*?>[\w\W]*?<\/script>/i,inside:{tag:{pattern:/<script[\w\W]*?>|<\/script>/i,inside:Prism.languages.markup.tag.inside},rest:Prism.languages.javascript},alias:"language-javascript"}}),Prism.languages.js=Prism.languages.javascript;
36251Prism.languages.scss=Prism.languages.extend("css",{comment:{pattern:/(^|[^\\])(?:\/\*[\w\W]*?\*\/|\/\/.*)/,lookbehind:!0},atrule:{pattern:/@[\w-]+(?:\([^()]+\)|[^(])*?(?=\s+[{;])/,inside:{rule:/@[\w-]+/}},url:/(?:[-a-z]+-)*url(?=\()/i,selector:{pattern:/(?=\S)[^@;\{\}\(\)]?([^@;\{\}\(\)]|&|#\{\$[-_\w]+\})+(?=\s*\{(\}|\s|[^\}]+(:|\{)[^\}]+))/m,inside:{placeholder:/%[-_\w]+/}}}),Prism.languages.insertBefore("scss","atrule",{keyword:[/@(?:if|else(?: if)?|for|each|while|import|extend|debug|warn|mixin|include|function|return|content)/i,{pattern:/( +)(?:from|through)(?= )/,lookbehind:!0}]}),Prism.languages.insertBefore("scss","property",{variable:/\$[-_\w]+|#\{\$[-_\w]+\}/}),Prism.languages.insertBefore("scss","function",{placeholder:{pattern:/%[-_\w]+/,alias:"selector"},statement:/\B!(?:default|optional)\b/i,"boolean":/\b(?:true|false)\b/,"null":/\bnull\b/,operator:{pattern:/(\s)(?:[-+*\/%]|[=!]=|<=?|>=?|and|or|not)(?=\s)/,lookbehind:!0}}),Prism.languages.scss.atrule.inside.rest=Prism.util.clone(Prism.languages.scss);
36252(function($,d){$.each(readyQ,function(i,f){$(f)});$.each(bindReadyQ,function(i,f){$(d).bind("ready",f)})})(jQuery,document);
36253
36254$(function() {
36255
36256var dateOptions={
36257		numberOfMonths:1,
36258		defaultDate: jQuery('.bookingForm .Ankomst_datepicker').data('start'),
36259		dateFormat: "d/MM/yy",	
36260	},
36261	arriveOptions={
36262	},
36263	departOptions={
36264		defaultDate: jQuery('.bookingForm .Afrejse_datepicker').data('start'),
36265	},
36266	getDate=function(e,scope){
36267		var scope=scope||'',
36268			$this=jQuery(e,scope),
36269			date=false,
36270			dateText=$this.val();
36271		try{
36272			/*date=jQuery.datepicker.parseDate(
36273				$this.datepicker("option","dateFormat"),
36274				dateText
36275			);*/
36276			date=$this.datepicker('getDate');
36277		} catch ( err ) {
36278			date=false;
36279			console.error('Unable to comprehend date',err,e,scope);
36280		}
36281		
36282		return date;		
36283	},
36284	zPad= function (e){if(e<10){return"0"+e}return e},
36285	updateDate=function(prefix,scope){
36286		var scope=scope||jQuery(".bookingForm"),
36287			dateText=jQuery("."+prefix+"_datepicker",scope).val();
36288		try{
36289			dateText=dateText.split('/');
36290			$('.'+prefix+'_day', scope).text(dateText[0]);
36291			$('.'+prefix+'_month', scope).text(dateText[1]);
36292			$('.'+prefix+'_year', scope).text(dateText[2]);			
36293		} catch ( err ) {
36294		}
36295	},
36296	addDays= function(date, days) {
36297		var result = new Date(date);
36298		result.setDate(result.getDate() + days);
36299		return result;
36300	},
36301	getHumanDate = function(e){
36302		var d=getDate('.'+e+'_datepicker',this);
36303		return d.getFullYear()+'-'+zPad(d.getMonth()+1)+'-'+zPad(d.getDate());	
36304	},
36305	getNights = function (){
36306		return Math.round( ( getDate('.Afrejse_datepicker',this) - getDate('.Ankomst_datepicker',this) ) /86400000 );	
36307	},
36308	getUrlVal= function(name,defaultValue){
36309		var skipAmp=skipAmp||false,val=this.find('*[name="'+name+'"]').val(),defaultValue=defaultValue||'';
36310		if ( val == '' || val == undefined ) {
36311			return defaultValue;
36312		}
36313		return name+'/'+encodeURIComponent(val)+'/';
36314	}	
36315	;
36316	
36317
36318
36319
36320
36321if (window.matchMedia('(min-width: 992px)').matches) {
36322	
36323	arriveOptions['beforeShow'] = function(input,inst){
36324		var offset = $(input).offset();
36325		var height = $(input).height();
36326			window.setTimeout(function () {
36327					$(inst.dpDiv).css({ top: (offset.top - 96) + 'px', left:(offset.left - 420) + 'px' });
36328			}, 1);
36329	};
36330	departOptions['beforeShow'] = function(input,inst){
36331		var offset = $(input).offset();
36332		var height = $(input).height();
36333			window.setTimeout(function () {
36334					$(inst.dpDiv).css({ top: (offset.top - 96) + 'px', left:(offset.left - 575) + 'px' });					
36335			}, 1);			
36336	};
36337
36338	
36339} 
36340	var testdate = new Date();
36341	$(".bookingForm .Ankomst_datepicker").datepicker('setDate', testdate);
36342
36343
36344	arriveOptions=jQuery.extend({},dateOptions,arriveOptions);
36345	$(".bookingForm .Ankomst_datepicker")
36346		.datepicker( arriveOptions )
36347		.datepicker( "setDate", testdate )
36348		.datepicker( "option", "minDate", testdate )
36349		.on( "change", function() {
36350			var 
36351				$arrival=$(this),
36352				arrivalDate=getDate( $arrival, $(this).parents('.bookingForm') ),
36353				$departure=$arrival.parents('.bookingForm').find('.Afrejse_datepicker'),
36354				departureDate=getDate( $departure, $(this).parents('.bookingForm')) 
36355			;
36356
36357			
36358
36359			if ( arrivalDate >= departureDate ) {				
36360				$departure.datepicker( "setDate", addDays( arrivalDate, 2 ) );
36361			}
36362			
36363			updateDate('Ankomst', $(this).parents('.bookingForm') );
36364			updateDate('Afrejse', $(this).parents('.bookingForm') );
36365        })		
36366	;
36367
36368	departOptions=jQuery.extend({},dateOptions,departOptions);
36369	$(".bookingForm .Afrejse_datepicker")
36370		.datepicker( departOptions )
36371		.datepicker( "setDate", departOptions.defaultDate )	
36372		.datepicker( "option", "minDate", departOptions.defaultDate )	
36373		.on( "change", function() {
36374			var 
36375				$departure=$(this),
36376				departureDate=getDate( $departure, $(this).parents('.bookingForm')),
36377				$arrival=$departure.parents('.bookingForm').find('.Ankomst_datepicker'),
36378				arrivalDate=getDate( $arrival, $(this).parents('.bookingForm') )
36379
36380			;
36381
36382			if ( arrivalDate >= departureDate ) {				
36383				$arrival.datepicker( "setDate", addDays( departureDate, -2 ) );
36384			}
36385			
36386			updateDate('Ankomst', $(this).parents('.bookingForm') );
36387			updateDate('Afrejse', $(this).parents('.bookingForm') );				
36388		})		
36389		;
36390	
36391	var region='da';
36392	if ( jQuery('html').attr('lang') !== undefined ){
36393		region=jQuery('html').attr('lang');		
36394	}
36395	
36396	if ( $.datepicker.regional[ region ] === undefined ) {
36397		$.getScript('/typo3conf/ext/idefa_hotelbooking/templates/i18n/datepicker-'+region+'.js')
36398			.always(function(){ //less code then doine indiviual .done/.fail as datepicker ignores the call with undefined.
36399				$( ".datepicker" ).datepicker( $.datepicker.regional[ region ] );
36400				//fixes a bug where the date isn't updated to regional even using 'refresh' :|
36401				var scope=jQuery(".bookingForm"),prefix='Ankomst';				
36402				jQuery("."+prefix+"_datepicker",scope).datepicker('setDate',jQuery("."+prefix+"_datepicker",scope).datepicker('getDate'));
36403				updateDate(prefix);
36404				prefix='Afrejse';
36405				jQuery("."+prefix+"_datepicker",scope).datepicker('setDate',jQuery("."+prefix+"_datepicker",scope).datepicker('getDate'));				
36406				updateDate(prefix);
36407			})
36408		;
36409	}else{
36410		$( ".datepicker" ).datepicker( $.datepicker.regional[ region ] );
36411		var scope=jQuery(".bookingForm"),prefix='Ankomst';				
36412		jQuery("."+prefix+"_datepicker",scope).datepicker('setDate',jQuery("."+prefix+"_datepicker",scope).datepicker('getDate'));
36413		updateDate(prefix);
36414		prefix='Afrejse';
36415		jQuery("."+prefix+"_datepicker",scope).datepicker('setDate',jQuery("."+prefix+"_datepicker",scope).datepicker('getDate'));				
36416		updateDate(prefix);
36417	}
36418
36419	//
36420	
36421	$(".Ankomstbtn").on("click", function(){		
36422		$( ".Ankomst_datepicker", $(this).parents('.bookingForm') ).focus();
36423	});
36424
36425	$(".bookingForm .Afrejsebtn").on("click", function(){
36426		$( ".Afrejse_datepicker", $(this).parents('.bookingForm') ).focus();
36427	});
36428
36429	
36430	$(".bookingForm .btn-send").on( "click", function(e){
36431		var $bookForm=jQuery(e.target).parents('form');
36432		$bookForm.urlVal=getUrlVal;
36433		$bookForm.getDate=getHumanDate;
36434		$bookForm.getNights=getNights;
36435		window.open(
36436			$bookForm.attr('action') + '' 
36437				+ $bookForm.urlVal('chain')
36438				+ $bookForm.urlVal('hotel')
36439				+ $bookForm.urlVal('lang','da-DK')
36440				+ 'arrival/'+$bookForm.getDate('Ankomst')
36441				+ '/nights/'+ $bookForm.getNights()
36442				+ '/?referrer='+ encodeURIComponent($bookForm.find('*[name="referer"]').val())
36443			);
36444	});
36445
36446
36447
36448
36449	
36450
36451});
36452
36453//[email protected]:
36454jQuery(document).ready(function($) {
36455
36456	/*
36457	 Hvad er det meningen at dette skal gøre?
36458	var containerPosition = jQuery(".navbar .container").position(),
36459		containerLeft = containerPosition.left;
36460	jQuery(".container.booking_top")
36461		.attr("style", "left: " + containerLeft + "px;");
36462	*/
36463
36464	var windowWidth = jQuery(window).width();
36465
36466	if( windowWidth < 751 ){
36467
36468		var isPresent = jQuery("#main-home-wrapper").has('.booking_top').length;
36469
36470		if (isPresent > 0) { return ; }
36471
36472		var newHtml = jQuery(".navbar-header .frame .tx-idefahotelbooking-pi4");
36473		jQuery(newHtml).prependTo("#main-home-wrapper");
36474	}else{
36475		jQuery("#main-home-wrapper .booking_top").remove();
36476	}
36477
36478
36479	var count = 1;
36480	jQuery("#main-home-wrapper .tx-idefahotelbooking-pi4 .booking_top").each(function(index, el) {
36481		if(count > 1)
36482		{
36483			jQuery(this).remove();
36484		}
36485		count++;
36486	});
36487
36488
36489	jQuery(".navbar-header .booking_container .booking_dropdown_btn")
36490		.unbind('click')
36491		.click(
36492			function(event) {
36493
36494				var isVisible = jQuery(this).parent().find("section").is(":visible");
36495				if ( isVisible ) {
36496					jQuery(this).parent().find("section").slideUp();
36497				}else{
36498					jQuery(this).parent().find("section").slideDown();
36499				}
36500			}
36501		)
36502	;
36503
36504	jQuery("#main-home-wrapper .booking_top .booking_dropdown_btn")
36505		.unbind('click')
36506		.click(
36507			function(event) {
36508				var isVisible2 = jQuery(this).parent().find("section").is(":visible");
36509				if ( isVisible2 ) {
36510					jQuery(this).parent().find("section").slideUp();
36511				}else{
36512					jQuery(this).parent().find("section").slideDown();
36513				}
36514			}
36515		)
36516	;
36517
36518		jQuery(".book-collapse .booking_dropdown_btn")
36519		.unbind('click')
36520		.click(
36521			function(event) {
36522				var isVisible_3 = jQuery(this).parent().find("section").is(":visible");
36523				if ( isVisible_3 ) {
36524					jQuery(this).parent().find("section").slideUp();
36525				}else{
36526					jQuery(this).parent().find("section").slideDown();
36527				}
36528			}
36529		)
36530	;
36531
36532
36533	jQuery(window)
36534		.resize(
36535			function(event) {
36536			
36537				/* Act on the event */
36538				var windowWidth = jQuery(window).width();
36539			   //console.log(windowWidth);
36540				if( windowWidth < 751 ){
36541
36542					var isPresent = jQuery("#main-home-wrapper").has('.booking_top').length;
36543					//console.log(isPresent);
36544					if (isPresent > 0) { return ; }
36545
36546					//console.log("LESS");
36547					var newHtml = jQuery(".navbar-header .frame .tx-idefahotelbooking-pi4").html();
36548					jQuery("#main-home-wrapper").prepend(newHtml);
36549				}else{
36550					//console.log("MORE");
36551					jQuery("#main-home-wrapper .booking_top").remove();
36552				}
36553			}
36554		)
36555		.trigger('resize')
36556	;
36557
36558	
36559
36560});
36561
36562(function($) {
36563    function urlExists(url, callback){
36564        $.ajax({
36565          type: 'HEAD',
36566          url: url,
36567          success: function(){
36568            callback(true);
36569          },
36570          error: function() {
36571            callback(false);
36572          }
36573        });
36574      }
36575      
36576    //http://cdn.idefa.dk/doc/pack.php?script=js/instagram/jquery.instagram.3.2.js
36577    $.getScript('//cdn.idefahost.dk/min/_=eJzLKtbPzCsuSUwvSszVzyosTS2q1IML6BnrGellFQMAAy4NYg',
36578        function(){
36579        
36580            jQuery(".instagram_gallery").each(function(index, el) {
36581                var $this=jQuery(this),$wrapper=$(this).parents('.instagram_wrapper');
36582              
36583                var header_id = '';
36584                var header_tag = '';
36585                var header_access_token = '';
36586
36587                var slider_auto_rotate = '';
36588                var slider_speed = '';
36589                var slider_on_off = '';
36590                var slider_item = '';
36591
36592                header_id = $wrapper.find('.header_id').text();
36593                header_tag = $wrapper.find('.header_tag').text();
36594                header_access_token = $wrapper.find('.header_access_token').text();
36595                header_count = $wrapper.find('.header_count').text();
36596
36597                slider_auto_rotate = $wrapper.find('.slider_auto_rotate').text();
36598                slider_speed = $wrapper.find('.slider_speed').text();
36599                slider_item = $wrapper.find('.slider_item').text();
36600                slider_on_off = $wrapper.find('.slider_on_off').text();
36601                
36602                if (slider_on_off) {
36603                    ;
36604                    $(this).instagram_gallery({
36605                        id: header_id,
36606                        tag: header_tag,
36607                        access_token: header_access_token,
36608                        count: header_count,
36609                        template: '<div class="item "><a rel="instagram-photos" class="captionlink" data-caption="" target="_blank"><img class="previewurl"/></a><a rel="instagram-photos" class="captionlink" data-caption="" target="_blank"><div class="vm-overlay"></div></a></div>',
36610                        on_complete: function(a,b,c) {
36611                          
36612                            if ( $this.hasClass('jimmit') ){ return; } //This line is only needed to showcase the Jimit version
36613                           
36614                            
36615
36616                            $this.find('img.previewurl').one('load',function(event){
36617                                jQuery(this).addClass('loaded');
36618                                
36619                                urlExists($this.find('img.previewurl').attr("src"), function(exists){
36620                                 console.log(exists);
36621                                  });
36622
36623                                if ($this.find('img.previewurl.loaded').length >= 1){
36624                                    //Now all images are loaded and we can safely start the carousel
36625                                    //$this.trigger('destroy.owl.carousel'); //destroy the old non working placeholder
36626                                    $this.addClass('owl-carousel');
36627                                    $carousel=$this;
36628                                 
36629                                    $this
36630                                        .owlCarousel({
36631                                            items: $this.data("items"),
36632                                            slideBy: 1,
36633                                            loop: true,
36634                                            center: false,
36635                                            mouseDrag: false,
36636                                            dots: false,
36637                                            nav: true,
36638                                            navText: ['<span class="fa fa-angle-left"></span>','<span class="fa fa-angle-right"></span>'],
36639                                            //Autoplay
36640                                            autoplay : $this.data("autoplay"),
36641                                            stopOnHover : false,
36642                                            slideSpeed : $this.data("slide-speed"),
36643                                            smartSpeed : $this.data("slide-speed"),
36644                                            autoplayTimeout : $this.data("slide-speed"),
36645                                            dotsSpeed: 400,
36646                                            smartSpeed: 300,
36647                                            rtl: false
36648                                        });
36649                                }else{
36650                                    
36651                                }
36652                            });
36653                        },
36654                    });
36655                }else{
36656                    //console.debug('footer?',$this.parents('footer').length);
36657                    var $template='<li id="photo-" class="photo"><div class="thumbnail-class"><a rel="instagram-photos" class="captionlink" data-caption="" target="_blank"><figure class="responsive" data-media="90x90" data-media480="150x150" data-media768="240x240" data-media992="90x90" data-media1200="112x112"><img/>
vendor: 4,914 bytes, lines 36657-36712
36657</figure></a><div class="caption"><p><a href="#" target="_blank" class="captionlink"><span class="captiontext"></span></a></p></div></div></li>';
36658                    if ( $this.parents('footer').length != 1 ){
36659                        $template='<li id="photo-" class="photo"><div class="thumbnail-class"><a rel="instagram-photos" class="captionlink" data-caption="" target="_blank"><figure class="responsive" ';
36660                        $template+='data-media="480x480" data-media480="768x768" data-media768="150x150" data-media992="90x90" data-media1200="112x112"';
36661                        $template+='><img/></figure></a><div class="caption"><p><a href="#" target="_blank" class="captionlink"><span class="captiontext"></span></a></p></div></div></li>';
36662                    }
36663                    $this.instagram_gallery({
36664                        id: header_id,
36665                        tag: header_tag,
36666                        access_token: header_access_token,
36667                        count: header_count,
36668                        squarecrop:true,
36669                        avatar_size:'112x112',
36670                        //image_size:'112x112',
36671                    //    template: '<li id="photo-" class="photo"><div class="thumbnail-class"><a rel="instagram-photos" class="captionlink" data-caption="" target="_blank"><img class="previewurl"/></a><div class="caption"><p><a href="#" target="_blank" class="captionlink"><span class="captiontext"></span></a></p></div></div></li>',
36672                        template: $template,
36673                        dataCaptionTemplate: '<a target="_blank" class="instagramurl"><table><tr><td> </td><td><b class="from_full_name"></b><br/>@<span class="from_username"></span></td></tr><tr><td colspan="2"><span class="captiontext"></span></td></tr></table></a>',
36674                        on_complete: function() {
36675                            $this.find('figure.responsive').picture({ignorePixelRatio:true})
36676                        },
36677                    });
36678                }
36679            });
36680        });
36681
36682       
36683})(jQuery);
36684/*<li id="photo-" class="photo">
36685    <div class="thumbnail-class">
36686        <a rel="instagram-photos" class="captionlink" data-caption="" target="_blank">
36687            <figure class="responsive"
36688                data-media="90x90"
36689                data-media480="150x150"
36690                data-media768="240x240"
36691                data-media1200="112x112">
36692                <img/>
36693            </figure>
36694        </a>
36695        <div class="caption">
36696            <p>
36697                <a href="#" target="_blank" class="captionlink">
36698                    <span class="captiontext"></span>
36699                </a>
36700            </p>
36701        </div>
36702    </div>
36703</li>*/
36704
36705
36706/*
36707 HTML5 Shiv v3.7.0 | @afarkas @jdalton @jon_neal @rem | MIT/GPL2 Licensed
36708*/
36709(function(l,f){function m(){var a=e.elements;return"string"==typeof a?a.split(" "):a}function i(a){var b=n[a[o]];b||(b={},h++,a[o]=h,n[h]=b);return b}function p(a,b,c){b||(b=f);if(g)return b.createElement(a);c||(c=i(b));b=c.cache[a]?c.cache[a].cloneNode():r.test(a)?(c.cache[a]=c.createElem(a)).cloneNode():c.createElem(a);return b.canHaveChildren&&!s.test(a)?c.frag.appendChild(b):b}function t(a,b){if(!b.cache)b.cache={},b.createElem=a.createElement,b.createFrag=a.createDocumentFragment,b.frag=b.createFrag();
36710a.createElement=function(c){return!e.shivMethods?b.createElem(c):p(c,a,b)};a.createDocumentFragment=Function("h,f","return function(){var n=f.cloneNode(),c=n.createElement;h.shivMethods&&("+m().join().replace(/[\w\-]+/g,function(a){b.createElem(a);b.frag.createElement(a);return'c("'+a+'")'})+");return n}")(e,b.frag)}function q(a){a||(a=f);var b=i(a);if(e.shivCSS&&!j&&!b.hasCSS){var c,d=a;c=d.createElement("p");d=d.getElementsByTagName("head")[0]||d.documentElement;c.innerHTML="x<style>article,aside,dialog,figcaption,figure,footer,header,hgroup,main,nav,section{display:block}mark{background:#FF0;color:#000}template{display:none}</style>";
36711c=d.insertBefore(c.lastChild,d.firstChild);b.hasCSS=!!c}g||t(a,b);return a}var k=l.html5||{},s=/^<|^(?:button|map|select|textarea|object|iframe|option|optgroup)$/i,r=/^(?:a|b|code|div|fieldset|h1|h2|h3|h4|h5|h6|i|label|li|ol|p|q|span|strong|style|table|tbody|td|th|tr|ul)$/i,j,o="_html5shiv",h=0,n={},g;(function(){try{var a=f.createElement("a");a.innerHTML="<xyz></xyz>";j="hidden"in a;var b;if(!(b=1==a.childNodes.length)){f.createElement("a");var c=f.createDocumentFragment();b="undefined"==typeof c.cloneNode||
36712"undefined"==typeof c.createDocumentFragment||"undefined"==typeof c.createElement}g=b}catch(d){g=j=!0}})();var e={elements:k.elements||"abbr article aside audio bdi canvas data datalist details dialog figcaption figure footer header hgroup main mark meter nav output progress section summary template time video",version:"3.7.0",shivCSS:!1!==k.shivCSS,supportsUnknownElements:g,shivMethods:!1!==k.shivMethods,t
36712ype:"default",shivDocument:q,createElement:p,createDocumentFragment:function(a,b){a||(a=f);
36713if(g)return a.createDocumentFragment();for(var b=b||i(a),c=b.frag.cloneNode(),d=0,e=m(),h=e.length;d<h;d++)c.createElement(e[d]);return c}};l.html5=e;q(f)})(this,document);
36714
36715/* Modified from original 2.04 to support iframes by Morten Haggren [email protected]
36716 * compressed by http://jscompress.com/
36717 * */
36718(function(a){function M(){if(e>=0){L();e=g=h=-1;a(t).hide();a(s).stop().fadeOut(c.overlayFadeDuration,E)}return false}function L(){p.onload=null;p.src=q.src=r.src=f;a([t,u,z]).stop(true);a([w,x,u,y]).hide()}function K(){if(g>=0)a(w).show();if(h>=0)a(x).show();a(z).css("marginTop",-z.offsetHeight).animate({marginTop:0},c.captionAnimationDuration);y.style.visibility=""}function J(){a(t).removeClass("lbLoading");a(u).css({backgroundImage:"url("+f+")",visibility:"hidden",display:""});a(v).width(p.width);a([v,w,x]).height(p.height);a(A).html(d[e][1]||"");a(B).html((d.length>1&&c.counterText||"").replace(/{x}/,e+1).replace(/{y}/,d.length));if(g>=0)q.src=d[g][0];if(h>=0)r.src=d[h][0];k=u.offsetWidth;l=u.offsetHeight;var b=Math.max(0,j-l/2);if(t.offsetHeight!=l){a(t).animate({height:l,top:b},c.resizeDuration,c.resizeEasing)}if(t.offsetWidth!=k){a(t).animate({width:k,marginLeft:-k/2},c.resizeDuration,c.resizeEasing)}a(t).queue(function(){a(y).css({width:k,top:b+l,marginLeft:-k/2,visibility:"hidden",display:""});a(u).css({display:"none",visibility:"",opacity:""}).fadeIn(c.imageFadeDuration,K)})}function I(b){if(b>=0){e=b;f=d[e][0];g=(e||(c.loop?d.length:0))-1;h=(e+1)%d.length||(c.loop?0:-1);t.className="";a(t).addClass("lbLoading");if(!(f.slice(-4)in C)){a(t).addClass("iframe");var i=f.split("|");f="data:image/gif;base64,R0lGODlhAQABAIAAAP///wAAACH5BAEAAAAALAAAAAABAAEAAAICRAEAOw==";L();if(i[1]==undefined){p={width:c.defaultIframeWidth,height:c.defaultIframeHeight}}else{var j=i[1].split("x");p={width:j[0],height:j[1]}}var k=/^(?:http)s?\:\/\/([^\/]+)\//.exec(i[0]);if(k!=null&&k[1]&&k[1]!=location.host){a(t).addClass("external "+k[1].replace(/\./g,"_"))}a(u).addClass("iframe").find("iframe").attr("src",i[0]).unbind("load").bind("load",J)}else{L();p=new Image;p.onload=J;p.src=f}}return false}function H(){return I(h)}function G(){return I(g)}function F(b){var d=b.keyCode,e=a.inArray;return e(d,c.closeKeys)>=0?M():e(d,c.nextKeys)>=0?H():e(d,c.previousKeys)>=0?G():false}function E(c){if(c){a("object").add(m?"select":"embed").each(function(a,b){n[a]=[b,b.style.visibility];b.style.visibility="hidden"})}else{a.each(n,function(a,b){b[0].style.visibility=b[1]});n=[];jQuery("#lbImage iframe").unbind("load").attr("src","about:blank")}var d=c?"bind":"unbind";b[d]("scroll resize",D);a(document)[d]("keydown",F)}function D(){var c=b.scrollLeft(),d=b.width();a([t,y]).css("left",c+d/2);if(i)a(s).css({left:c,top:b.scrollTop(),width:d,height:b.height()})}var b=a(window),c,d,e=-1,f,g,h,i,j,k,l,m=!window.XMLHttpRequest,n=[],o=document.documentElement,p={},q=new Image,r=new Image,s,t,u,v,w,x,y,z,A,B;var C={jpeg:1,".jpg":1,".gif":1,".png":1};a(function(){a("body").append(a([s=a('<div id="lbOverlay" />')[0],t=a('<div id="lbCenter" />')[0],y=a('<div id="lbBottomContainer" />')[0]]).css("display","none"));u=a('<div id="lbImage" />').appendTo(t).append(v=a('<div style="position: relative;" />').append([w=a('<a id="lbPrevLink" href="#" aria-label="Forrige" />').click(G)[0],x=a('<a id="lbNextLink" href="#" aria-label="Næste" />').click(H)[0],a('<iframe scrolling="no" frameborder="0" allowtransparency="true"></iframe>')[0]])[0])[0];z=a('<div id="lbBottom" />').appendTo(y).append([a('<a id="lbCloseLink" href="#" aria-label="Luk" />').add(s).click(M)[0],A=a('<div id="lbCaption" />')[0],B=a('<div id="lbNumber" />')[0],a('<div style="clear: both;" />')[0]])[0]});a.slimbox=function(e,f,g){c=a.extend({loop:false,overlayOpacity:.8,overlayFadeDuration:400,resizeDuration:400,resizeEasing:"swing",initialWidth:250,initialHeight:250,defaultIframeWidth:800,defaultIframeHeight:640,imageFadeDuration:400,captionAnimationDuration:400,counterText:"Image {x} of {y}",closeKeys:[27,88,67],previousKeys:[37,80],nextKeys:[39,78]},g);if(typeof e=="string"){e=[[e,f]];f=0}j=b.scrollTop()+b.height()/2;k=c.initialWidth;l=c.initialHeight;a(t).css({top:Math.max(0,j-l/2),width:k,height:l,marginLeft:-k/2}).show();i=m||s.currentStyle&&s.currentStyle.position!="fixed";if(i)s.style.position="absolute";a(s).css("opacity",c.overlayOpacity).fadeIn(c.overlayFadeDuration);D();E(1);d=e;c.loop=c.loop&&d.length>1;return I(f)};a.fn.slimbox=function(b,c,d){c=c||function(a){return[a.href,a.title]};d=d||function(){return true};var e=this;return e.unbind("click").click(function(){var f=this,g=0,h,i=0,j;h=a.grep(e,function(a,b){return d.call(f,a,b)});for(j=h.length;i<j;++i){if(h[i]==f)g=i;h[i]=c(h[i],i)}return a.slimbox(h,g,b)})}})(jQuery)
36719/*!
36720 * Retina.js v1.3.0
36721 *
36722 * Copyright 2014 Imulus, LLC
36723 * Released under the MIT license
36724 *
36725 * Retina.js is an open source script that makes it easy to serve
36726 * high-resolution images to devices with retina displays.
36727 */
36728!function(){function t(){}function e(t){return r.retinaImageSuffix+t}function i(t,i){if(this.path=t||"",void 0!==i&&null!==i)this.at_2x_path=i,this.perform_check=!1;else{if(void 0!==document.createElement){var a=document.createElement("a");a.href=this.path,a.pathname=a.pathname.replace(h,e),this.at_2x_path=a.href}else{var n=this.path.split("?");n[0]=n[0].replace(h,e),this.at_2x_path=n.join("?")}this.perform_check=!0}}function a(t){this.el=t,this.path=new i(this.el.getAttribute("src"),this.el.getAttribute("data-at2x"));var e=this;this.path.check_2x_variant(function(t){t&&e.swap()})}var n="undefined"==typeof exports?window:exports,r={retinaImageSuffix:"@2x",check_mime_type:!0,img_tag_selector:"img[data-at2x]",force_original_dimensions:!0};t.configure=function(t){null===t&&(t={});for(var e in t)t.hasOwnProperty(e)&&(r[e]=t[e])},t.init=function(t){null===t&&(t=n),t.addEventListener("load",function(){var t,e,i=document.querySelectorAll(r.img_tag_selector),n=i.length,h=[];for(t=0;n>t;t+=1)e=i[t],e.getAttributeNode("data-no-retina")||e.src&&h.push(new a(e))})},t.isRetina=function(){var t="(-webkit-min-device-pixel-ratio: 1.5), (min--moz-device-pixel-ratio: 1.5), (-o-min-device-pixel-ratio: 3/2), (min-resolution: 1.5dppx)";return n.devicePixelRatio>1?!0:n.matchMedia&&n.matchMedia(t).matches?!0:!1};var h=/\.[\w\?=]+$/;n.RetinaImagePath=i,i.confirmed_paths=[],i.prototype.is_external=function(){return!(!this.path.match(/^https?\:/i)||this.path.match("//"+document.domain))},i.prototype.check_2x_variant=function(t){var e,a=this;return this.perform_check||void 0===this.at_2x_path||null===this.at_2x_path?this.at_2x_path in i.confirmed_paths?t(!0):this.is_external()?t(!1):(e=new XMLHttpRequest,e.open("HEAD",this.at_2x_path),e.onreadystatechange=function(){if(4!==e.readyState)return t(!1);if(e.status>=200&&e.status<=399){if(r.check_mime_type){var n=e.getResponseHeader("Content-Type");if(null===n||!n.match(/^image/i))return t(!1)}return i.confirmed_paths.push(a.at_2x_path),t(!0)}return t(!1)},void e.send()):t(!0)},n.RetinaImage=a,a.prototype.swap=function(t){function e(){i.el.complete?(r.force_original_dimensions&&(0==i.el.offsetWidth&&0==i.el.offsetHeight?(i.el.setAttribute("width",i.el.naturalWi
36728dth),i.el.setAttribute("height",i.el.naturalHeight)):(i.el.setAttribute("class","barcelona-retina"),i.el.setAttribute("width",i.el.offsetWidth),i.el.setAttribute("height",i.el.offsetHeight))),i.el.setAttribute("src",t)):setTimeout(e,5)}void 0===t&&(t=this.path.at_2x_path);var i=this;e()},t.isRetina()&&t.init(n)}();
36729/**
36730 * jQuery Picture
36731 * http://jquerypicture.com
36732 * http://github.com/Abban/jQuery-Picture
36733 *
36734 * May 2012
36735 *
36736 * @version 0.9
36737 * @author Abban Dunne http://abandon.ie
36738 * @license MIT
36739 *
36740 * jQuery Picture is a plugin to add support for responsive images to your layouts.
36741 * It supports both figure elements with some custom data attributes and the new
36742 * proposed picture format. This plugin will be made redundant when the format is
36743 * approved and implemented by browsers. Lets hope that happens soon. In the meantime
36744 * this plugin will be kept up to date with latest developments.
36745 *
36746 */(function(e){e.fn.picture=function(t){var n={container:null,ignorePixelRatio:!1,useLarger:!1,insertElement:">a",inlineDimensions:!1},r=e.extend({},n,t);this.each(function(){function a(o){if(o){if(s.get(0).tagName.toLowerCase()=="figure"){var a=s.data();e.each(a,function(e){var n;n=e.replace(/[^\d.]/g,"");n&&t.push(parseInt(n))})}else s.find("source").each(function(){var n,r;n=e(this).attr("media");if(n){r=n.replace(/[^\d.]/g,"");t.push(parseInt(r))}});t.sort(function(e,t){return e-t})}var c=0;r.container==null?n=e(window).width()*u:n=e(r.container).width()*u;e.each(t,function(e,t){parseInt(n)>=parseInt(t)&&parseInt(c)<=parseInt(t)&&(c=t)});if(r.useLarger){idx=t.indexOf(c);idx<t.length-1&&(c=t[idx+1])}if(i!==c){i=c;s.get(0).tagName.toLowerCase()=="figure"?l():f()}}function f(){var t=new Object;s.find("source").each(function(){var n,r,i;n=e(this).attr("media");r=e(this).attr("src");n?i=n.replace(/[^\d.]/g,""):i=0;t[i]=r});if(s.find("img").length==0){var n='<img src="'+t[i]+'"';s.attr("style")&&(n+=' style="'+s.attr("style")+'"');s.attr("alt")&&(n+=' alt="'+s.attr("alt")+'"');n+=">";e(r.insertElement,s).length==0?s.append(n):e(r.insertElement,s).append(n)}else s.find("img").attr("src",t[i]);r.inlineDimensions&&e("<img/>").attr("src",e("img",s).attr("src")).load(function(){e("img",s).attr("height",this.height);e("img",s).attr("width",this.width)})}function l(){var t=new Object,n=s.data();e.each(n,function(e,n){var r;r=e.replace(/[^\d.]/g,"");r||(r=0);t[r]=n});if(s.find("img").length==0){var o='<img src="'+t[i]+'"';s.attr("style")&&(o+=' style="'+s.attr("style")+'"');s.attr("title")&&(o+=' alt="'+s.attr("title")+'"');o+=">";e(r.insertElement,s).length==0?s.append(o):e(r.insertElement,s).append(o)}else e("img",s).attr("src",t[i]);r.inlineDimensions&&e("<img/>").attr("src",e("img",s).attr("src")).load(function(){e("img",s).attr("height",this.height);e("img",s).attr("width",this.width)})}var t=new Array,n,i,s,o,u=1;!r.ignorePixelRatio&&window.devicePixelRatio!==undefined&&(u=window.devicePixelRatio);s=e(this);s.find("noscript").remove();a(!0);o=!1;e(window).resize(function(){o!==!1&&clearTimeout(o);o=setTimeout(a,200)})})}
36747 $('figure.responsive').picture({ignorePixelRatio:true});
36748})(jQuery);
36749
36750!function(a,b,c,d){function e(b,c){this.settings=null,this.options=a.extend({},e.Defaults,c),this.$element=a(b),this._handlers={},this._plugins={},this._supress={},this._current=null,this._speed=null,this._coordinates=[],this._breakpoint=null,this._width=null,this._items=[],this._clones=[],this._mergers=[],this._widths=[],this._invalidated={},this._pipe=[],this._drag={time:null,target:null,pointer:null,stage:{start:null,current:null},direction:null},this._states={current:{},tags:{initializing:["busy"],animating:["busy"],dragging:["interacting"]}},a.each(["onResize","onThrottledResize"],a.proxy(function(b,c){this._handlers[c]=a.proxy(this[c],this)},this)),a.each(e.Plugins,a.proxy(function(a,b){this._plugins[a.charAt(0).toLowerCase()+a.slice(1)]=new b(this)},this)),a.each(e.Workers,a.proxy(function(b,c){this._pipe.push({filter:c.filter,run:a.proxy(c.run,this)})},this)),this.setup(),this.initialize()}e.Defaults={items:3,loop:!1,center:!1,rewind:!1,mouseDrag:!0,touchDrag:!0,pullDrag:!0,freeDrag:!1,margin:0,stagePadding:0,merge:!1,mergeFit:!0,autoWidth:!1,startPosition:0,rtl:!1,smartSpeed:250,fluidSpeed:!1,dragEndSpeed:!1,responsive:{},responsiveRefreshRate:200,responsiveBaseElement:b,fallbackEasing:"swing",info:!1,nestedItemSelector:!1,itemElement:"div",stageElement:"div",refreshClass:"owl-refresh",loadedClass:"owl-loaded",loadingClass:"owl-loading",rtlClass:"owl-rtl",responsiveClass:"owl-responsive",dragClass:"owl-drag",itemClass:"owl-item",stageClass:"owl-stage",stageOuterClass:"owl-stage-outer",grabClass:"owl-grab"},e.Width={Default:"default",Inner:"inner",Outer:"outer"},e.Type={Event:"event",State:"state"},e.Plugins={},e.Workers=[{filter:["width","settings"],run:function(){this._width=this.$element.width()}},{filter:["width","items","settings"],run:function(a){a.current=this._items&&this._items[this.relative(this._current)]}},{filter:["items","settings"],run:function(){this.$stage.children(".cloned").remove()}},{filter:["width","items","settings"],run:function(a){var b=this.settings.margin||"",c=!this.settings.autoWidth,d=this.settings.rtl,e={width:"auto","margin-left":d?b:"","margin-right":d?"":b};!c&&this.$stage.children().css(e),a.css=e}},{filter:["width","items","settings"],run:function(a){var b=(this.width()/this.settings.items).toFixed(3)-this.settings.margin,c=null,d=this._items.length,e=!this.settings.autoWidth,f=[];for(a.items={merge:!1,width:b};d--;)c=this._mergers[d],c=this.settings.mergeFit&&Math.min(c,this.settings.items)||c,a.items.merge=c>1||a.items.merge,f[d]=e?b*c:this._items[d].width();this._widths=f}},{filter:["items","settings"],run:function(){var b=[],c=this._items,d=this.settings,e=Math.max(2*d.items,4),f=2*Math.ceil(c.length/2),g=d.loop&&c.length?d.rewind?e:Math.max(e,f):0,h="",i="";for(g/=2;g--;)b.push(this.normalize(b.length/2,!0)),h+=c[b[b.length-1]][0].outerHTML,b.push(this.normalize(c.length-1-(b.length-1)/2,!0)),i=c[b[b.length-1]][0].outerHTML+i;this._clones=b,a(h).addClass("cloned").appendTo(this.$stage),a(i).addClass("cloned").prependTo(this.$stage)}},{filter:["width","items","settings"],run:function(){for(var a=this.settings.rtl?1:-1,b=this._clones.length+this._items.length,c=-1,d=0,e=0,f=[];++c<b;)d=f[c-1]||0,e=this._widths[this.relative(c)]+this.settings.margin,f.push(d+e*a);this._coordinates=f}},{filter:["width","items","settings"],run:function(){var a=this.settings.stagePadding,b=this._coordinates,c={width:Math.ceil(Math.abs(b[b.length-1]))+2*a,"padding-left":a||"","padding-right":a||""};this.$stage.css(c)}},{filter:["width","items","settings"],run:function(a){var b=this._coordinates.length,c=!this.settings.autoWidth,d=this.$stage.children();if(c&&a.items.merge)for(;b--;)a.css.width=this._widths[this.relative(b)],d.eq(b).css(a.css);else c&&(a.css.width=a.items.width,d.css(a.css))}},{filter:["items"],run:function(){this._coordinates.length<1&&this.$stage.removeAttr("style")}},{filter:["width","items","settings"],run:function(a){a.current=a.current?this.$stage.children().index(a.current):0,a.current=Math.max(this.minimum(),Math.min(this.maximum(),a.current)),this.reset(a.current)}},{filter:["position"],run:function(){this.animate(this.coordinates(this._current))}},{filter:["width","position","items","settings"],run:function(){var a,b,c,d,e=this.settings.rtl?1:-1,f=2*this.settings.stagePadding,g=this.coordinates(this.current())+f,h=g+this.width()*e,i=[];for(c=0,d=this._coordinates.length;d>c;c++)a=this._coordinates[c-1]||0,b=Math.abs(this._coordinates[c])+f*e,(this.op(a,"<=",g)&&this.op(a,">",h)||this.op(b,"<",g)&&this.op(b,">",h))&&i.push(c);this.$stage.children(".active").removeClass("active"),this.$stage.children(":eq("+i.join("), :eq(")+")").addClass("active"),this.settings.center&&(this.$stage.children(".center").removeClass("center"),this.$stage.children().eq(this.current()).addClass("center"))}}],e.prototype.initialize=function(){if(this.enter("initializing"),this.trigger("initialize"),this.$element.toggleClass(this.settings.rtlClass,this.settings.rtl),this.settings.autoWidth&&!this.is("pre-loading")){var b,c,e;b=this.$element.find("img"),c=this.settings.nestedItemSelector?"."+this.settings.nestedItemSelector:d,e=this.$element.children(c).width(),b.length&&0>=e&&this.preloadAutoWidthImages(b)}this.$element.addClass(this.options.loadingClass),this.$stage=a("<"+this.settings.stageElement+' class="'+this.settings.stageClass+'"/>').wrap('<div class="'+this.settings.stageOuterClass+'"/>'),this.$element.append(this.$stage.parent()),this.replace(this.$element.children().not(this.$stage.parent())),this.$element.is(":visible")?this.refresh():this.invalidate("width"),this.$element.removeClass(this.options.loadingClass).addClass(this.options.loadedClass),this.registerEventHandlers(),this.leave("initializing"),this.trigger("initialized")},e.prototype.setup=function(){var b=this.viewport(),c=this.options.responsive,d=-1,e=null;c?(a.each(c,function(a){b>=a&&a>
vendor: 5,241 bytes, line 36750
36750d&&(d=Number(a))}),e=a.extend({},this.options,c[d]),delete e.responsive,e.responsiveClass&&this.$element.attr("class",this.$element.attr("class").replace(new RegExp("("+this.options.responsiveClass+"-)\\S+\\s","g"),"$1"+d))):e=a.extend({},this.options),(null===this.settings||this._breakpoint!==d)&&(this.trigger("change",{property:{name:"settings",value:e}}),this._breakpoint=d,this.settings=e,this.invalidate("settings"),this.trigger("changed",{property:{name:"settings",value:this.settings}}))},e.prototype.optionsLogic=function(){this.settings.autoWidth&&(this.settings.stagePadding=!1,this.settings.merge=!1)},e.prototype.prepare=function(b){var c=this.trigger("prepare",{content:b});return c.data||(c.data=a("<"+this.settings.itemElement+"/>").addClass(this.options.itemClass).append(b)),this.trigger("prepared",{content:c.data}),c.data},e.prototype.update=function(){for(var b=0,c=this._pipe.length,d=a.proxy(function(a){return this[a]},this._invalidated),e={};c>b;)(this._invalidated.all||a.grep(this._pipe[b].filter,d).length>0)&&this._pipe[b].run(e),b++;this._invalidated={},!this.is("valid")&&this.enter("valid")},e.prototype.width=function(a){switch(a=a||e.Width.Default){case e.Width.Inner:case e.Width.Outer:return this._width;default:return this._width-2*this.settings.stagePadding+this.settings.margin}},e.prototype.refresh=function(){this.enter("refreshing"),this.trigger("refresh"),this.setup(),this.optionsLogic(),this.$element.addClass(this.options.refreshClass),this.update(),this.$element.removeClass(this.options.refreshClass),this.leave("refreshing"),this.trigger("refreshed")},e.prototype.onThrottledResize=function(){b.clearTimeout(this.resizeTimer),this.resizeTimer=b.setTimeout(this._handlers.onResize,this.settings.responsiveRefreshRate)},e.prototype.onResize=function(){return this._items.length?this._width===this.$element.width()?!1:this.$element.is(":visible")?(this.enter("resizing"),this.trigger("resize").isDefaultPrevented()?(this.leave("resizing"),!1):(this.invalidate("width"),this.refresh(),this.leave("resizing"),void this.trigger("resized"))):!1:!1},e.prototype.registerEventHandlers=function(){a.support.transition&&this.$stage.on(a.support.transition.end+".owl.core",a.proxy(this.onTransitionEnd,this)),this.settings.responsive!==!1&&this.on(b,"resize",this._handlers.onThrottledResize),this.settings.mouseDrag&&(this.$element.addClass(this.options.dragClass),this.$stage.on("mousedown.owl.core",a.proxy(this.onDragStart,this)),this.$stage.on("dragstart.owl.core selectstart.owl.core",function(){return!1})),this.settings.touchDrag&&(this.$stage.on("touchstart.owl.core",a.proxy(this.onDragStart,this)),this.$stage.on("touchcancel.owl.core",a.proxy(this.onDragEnd,this)))},e.prototype.onDragStart=function(b){var d=null;3!==b.which&&(a.support.transform?(d=this.$stage.css("transform").replace(/.*\(|\)| /g,"").split(","),d={x:d[16===d.length?12:4],y:d[16===d.length?13:5]}):(d=this.$stage.position(),d={x:this.settings.rtl?d.left+this.$stage.width()-this.width()+this.settings.margin:d.left,y:d.top}),this.is("animating")&&(a.support.transform?this.animate(d.x):this.$stage.stop(),this.invalidate("position")),this.$element.toggleClass(this.options.grabClass,"mousedown"===b.type),this.speed(0),this._drag.time=(new Date).getTime(),this._drag.target=a(b.target),this._drag.stage.start=d,this._drag.stage.current=d,this._drag.pointer=this.pointer(b),a(c).on("mouseup.owl.core touchend.owl.core",a.proxy(this.onDragEnd,this)),a(c).one("mousemove.owl.core touchmove.owl.core",a.proxy(function(b){var d=this.difference(this._drag.pointer,this.pointer(b));a(c).on("mousemove.owl.core touchmove.owl.core",a.proxy(this.onDragMove,this)),Math.abs(d.x)<Math.abs(d.y)&&this.is("valid")||(b.preventDefault(),this.enter("dragging"),this.trigger("drag"))},this)))},e.prototype.onDragMove=function(a){var b=null,c=null,d=null,e=this.difference(this._drag.pointer,this.pointer(a)),f=this.difference(this._drag.stage.start,e);this.is("dragging")&&(a.preventDefault(),this.settings.loop?(b=this.coordinates(this.minimum()),c=this.coordinates(this.maximum()+1)-b,f.x=((f.x-b)%c+c)%c+b):(b=this.coordinates(this.settings.rtl?this.maximum():this.minimum()),c=this.coordinates(this.settings.rtl?this.minimum():this.maximum()),d=this.settings.pullDrag?-1*e.x/5:0,f.x=Math.max(Math.min(f.x,b+d),c+d)),this._drag.stage.current=f,this.animate(f.x))},e.prototype.onDragEnd=function(b){var d=this.difference(this._drag.pointer,this.pointer(b)),e=this._drag.stage.current,f=d.x>0^this.settings.rtl?"left":"right";a(c).off(".owl.core"),this.$element.removeClass(this.options.grabClass),(0!==d.x&&this.is("dragging")||!this.is("valid"))&&(this.speed(this.settings.dragEndSpeed||this.settings.smartSpeed),this.current(this.closest(e.x,0!==d.x?f:this._drag.direction)),this.invalidate("position"),this.update(),this._drag.direction=f,(Math.abs(d.x)>3||(new Date).getTime()-this._drag.time>300)&&this._drag.target.one("click.owl.core",function(){return!1})),this.is("dragging")&&(this.leave("dragging"),this.trigger("dragged"))},e.prototype.closest=function(b,c){var d=-1,e=30,f=this.width(),g=this.coordinates();return this.settings.freeDrag||a.each(g,a.proxy(function(a,h){return b>h-e&&h+e>b?d=a:this.op(b,"<",h)&&this.op(b,">
36750",g[a+1]||h-f)&&(d="left"===c?a+1:a),-1===d},this)),this.settings.loop||(this.op(b,">",g[this.minimum()])?d=b=this.minimum():this.op(b,"<",g[this.maximum()])&&(d=b=this.maximum())),d},e.prototype.animate=function(b){var c=this.speed()>0;this.is("animating")&&this.onTransitionEnd(),c&&(this.enter("animating"),this.trigger("translate")),a.support.transform3d&&a.support.transition?this.$stage.css({transform:"translate3d("+b+"px,0px,0px)",transition:this.speed()/1e3+"s"}):c?this.$stage.animate({left:b+"px"},this.speed(),this.settings.fallbackEasing,a.proxy(this.onTransitionEnd,this)):this.$stage.css({left:b+"px"})},e.prototype.is=function(a){return this._states.current[a]&&this._states.current[a]>0},e.prototype.current=function(a){if(a===d)return this._current;if(0===this._items.length)return d;if(a=this.normalize(a),this._current!==a){var b=this.trigger("change",{property:{name:"position",value:a}});b.data!==d&&(a=this.normalize(b.data)),this._current=a,this.invalidate("position"),this.trigger("changed",{property:{name:"position",value:this._current}})}return this._current},e.prototype.invalidate=function(b){return"string"===a.type(b)&&(this._invalidated[b]=!0,this.is("valid")&&this.leave("valid")),a.map(this._invalidated,function(a,b){return b})},e.prototype.reset=function(a){a=this.normalize(a),a!==d&&(this._speed=0,this._current=a,this.suppress(["translate","translated"]),this.animate(this.coordinates(a)),this.release(["translate","translated"]))},e.prototype.normalize=function(b,c){var e=this._items.length,f=c?0:this._clones.length;return!a.isNumeric(b)||1>e?b=d:(0>b||b>=e+f)&&(b=((b-f/2)%e+e)%e+f/2),b},e.prototype.relative=function(a){return a-=this._clones.length/2,this.normalize(a,!0)},e.prototype.maximum=function(a){var b,c=this.settings,d=this._coordinates.length,e=Math.abs(this._coordinates[d-1])-this._width,f=-1;if(c.loop)d=this._clones.length/2+this._items.length-1;else if(c.autoWidth||c.merge)for(;d-f>1;)Math.abs(this._coordinates[b=d+f>>1])<e?f=b:d=b;else d=c.center?this._items.length-1:this._items.length-c.items;return a&&(d-=this._clones.length/2),Math.max(d,0)},e.prototype.minimum=function(a){return a?0:this._clones.length/2},e.prototype.items=function(a){return a===d?this._items.slice():(a=this.normalize(a,!0),this._items[a])},e.prototype.mergers=function(a){return a===d?this._mergers.slice():(a=this.normalize(a,!0),this._mergers[a])},e.prototype.clones=function(b){var c=this._clones.length/2,e=c+this._items.length,f=function(a){return a%2===0?e+a/2:c-(a+1)/2};return b===d?a.map(this._clones,function(a,b){return f(b)}):a.map(this._clones,function(a,c){return a===b?f(c):null})},e.prototype.speed=function(a){return a!==d&&(this._speed=a),this._speed},e.prototype.coordinates=function(b){var c=null;return b===d?a.map(this._coordinates,a.proxy(function(a,b){return this.coordinates(b)},this)):(this.settings.center?(c=this._coordinates[b],c+=(this.width()-c+(this._coordinates[b-1]||0))/2*(this.settings.rtl?-1:1)):c=this._coordinates[b-1]||0,c)},e.prototype.duration=function(a,b,c){return Math.min(Math.max(Math.abs(b-a),1),6)*Math.abs(c||this.settings.smartSpeed)},e.prototype.to=function(a,b){var c=this.current(),d=null,e=a-this.relative(c),f=(e>0)-(0>e),g=this._items.length,h=this.minimum(),i=this.maximum();this.settings.loop?(!this.settings.rewind&&Math.abs(e)>g/2&&(e+=-1*f*g),a=c+e,d=((a-h)%g+g)%g+h,d!==a&&i>=d-e&&d-e>0&&(c=d-e,a=d,this.reset(c))):this.settings.rewind?(i+=1,a=(a%i+i)%i):a=Math.max(h,Math.min(i,a)),this.speed(this.duration(c,a,b)),this.current(a),this.$element.is(":visible")&&this.update()},e.prototype.next=function(a){a=a||!1,this.to(this.relative(this.current())+1,a)},e.prototype.prev=function(a){a=a||!1,this.to(this.relative(this.current())-1,a)},e.prototype.onTransitionEnd=function(a){return a!==d&&(a.stopPropagation(),(a.target||a.srcElement||a.originalTarget)!==this.$stage.get(0))?!1:(this.leave("animating"),void this.trigger("translated"))},e.prototype.viewport=function(){var d;if(this.options.responsiveBaseElement!==b)d=a(this.options.responsiveBaseElement).width();else if(b.innerWidth)d=b.innerWidth;else{if(!c.documentElement||!c.documentElement.clientWidth)throw"Can not detect viewport width.";d=c.documentElement.clientWidth}return d},e.prototype.replace=function(b){this.$stage.empty(),this._items=[],b&&(b=b instanceof jQuery?b:a(b)),this.settings.nestedItemSelector&&(b=b.find("."+this.settings.nestedItemSelector)),b.filter(function(){return 1===this.nodeType}).each(a.proxy(function(a,b){b=this.prepare(b),this.$stage.append(b),this._items.push(b),this._mergers.push(1*b.find("[data-merge]").andSelf("[data-merge]").attr("data-merge")||1)},this)),this.reset(a.isNumeric(this.settings.startPosition)?this.settings.startPosition:0),this.invalidate("items")},e.prototype.add=function(b,c){var e=this.relative(this._current);c=c===d?this._items.length:this.normalize(c,!0),b=b instanceof jQuery?b:a(b),this.trigger("add",{content:b,position:c}),b=this.prepare(b),0===this._items.length||c===this._items.length?(0===this._items.length&&this.$stage.append(b),0!==this._items.length&&this._items[c-1].after(b),this._items.push(b),this._mergers.push(1*b.find("[data-merge]").andSelf("[data-merge]").attr("data-merge")||1)):(this._items[c].before(b),this._items.splice(c,0,b),this._mergers.splice(c,0,1*b.find("[data-merge]").andSelf("[data-merge]").attr("data-merge")||1)),this._items[e]&&this.reset(this._items[e].index()),this.invalidate("items"),this.trigger("added",{content:b,position:c})},e.prototype.remove=function(a){a=this.normalize(a,!0),a!==d&&(this.trigger("remove",{content:this._items[a],position:a}),this._items[a].remove(),this._items.splice(a,1),this._mergers.splice(a,1),this.invalidate("items"),this.trigger("removed",{content:null,position:a}))},e.prototype.preloadAutoWidthImages=function(b){b.each(a.proxy(function(b,c){this.enter("pre-loading"),c=a(c),a(new Image).one("load",a.proxy(function(a){c.attr("src",a.target.src),c.css("opacity",1),this.leave("pre-loading"),!this.is("pre-loading")&&!this.is("initializing")&&this.refresh()}
vendor: 3,685 bytes, line 36750
36750,this)).attr("src",c.attr("src")||c.attr("data-src")||c.attr("data-src-retina"))},this))},e.prototype.destroy=function(){this.$element.off(".owl.core"),this.$stage.off(".owl.core"),a(c).off(".owl.core"),this.settings.responsive!==!1&&(b.clearTimeout(this.resizeTimer),this.off(b,"resize",this._handlers.onThrottledResize));for(var d in this._plugins)this._plugins[d].destroy();this.$stage.children(".cloned").remove(),this.$stage.unwrap(),this.$stage.children().contents().unwrap(),this.$stage.children().unwrap(),this.$element.removeClass(this.options.refreshClass).removeClass(this.options.loadingClass).removeClass(this.options.loadedClass).removeClass(this.options.rtlClass).removeClass(this.options.dragClass).removeClass(this.options.grabClass).attr("class",this.$element.attr("class").replace(new RegExp(this.options.responsiveClass+"-\\S+\\s","g"),"")).removeData("owl.carousel")},e.prototype.op=function(a,b,c){var d=this.settings.rtl;switch(b){case"<":return d?a>c:c>a;case">":return d?c>a:a>c;case">=":return d?c>=a:a>=c;case"<=":return d?a>=c:c>=a}},e.prototype.on=function(a,b,c,d){a.addEventListener?a.addEventListener(b,c,d):a.attachEvent&&a.attachEvent("on"+b,c)},e.prototype.off=function(a,b,c,d){a.removeEventListener?a.removeEventListener(b,c,d):a.detachEvent&&a.detachEvent("on"+b,c)},e.prototype.trigger=function(b,c,d,f,g){var h={item:{count:this._items.length,index:this.current()}},i=a.camelCase(a.grep(["on",b,d],function(a){return a}).join("-").toLowerCase()),j=a.Event([b,"owl",d||"carousel"].join(".").toLowerCase(),a.extend({relatedTarget:this},h,c));return this._supress[b]||(a.each(this._plugins,function(a,b){b.onTrigger&&b.onTrigger(j)}),this.register({type:e.Type.Event,name:b}),this.$element.trigger(j),this.settings&&"function"==typeof this.settings[i]&&this.settings[i].call(this,j)),j},e.prototype.enter=function(b){a.each([b].concat(this._states.tags[b]||[]),a.proxy(function(a,b){this._states.current[b]===d&&(this._states.current[b]=0),this._states.current[b]++},this))},e.prototype.leave=function(b){a.each([b].concat(this._states.tags[b]||[]),a.proxy(function(a,b){this._states.current[b]--},this))},e.prototype.register=function(b){if(b.type===e.Type.Event){if(a.event.special[b.name]||(a.event.special[b.name]={}),!a.event.special[b.name].owl){var c=a.event.special[b.name]._default;a.event.special[b.name]._default=function(a){return!c||!c.apply||a.namespace&&-1!==a.namespace.indexOf("owl")?a.namespace&&a.namespace.indexOf("owl")>-1:c.apply(this,arguments)},a.event.special[b.name].owl=!0}}else b.type===e.Type.State&&(this._states.tags[b.name]?this._states.tags[b.name]=this._states.tags[b.name].concat(b.tags):this._states.tags[b.name]=b.tags,this._states.tags[b.name]=a.grep(this._states.tags[b.name],a.proxy(function(c,d){return a.inArray(c,this._states.tags[b.name])===d},this)))},e.prototype.suppress=function(b){a.each(b,a.proxy(function(a,b){this._supress[b]=!0},this))},e.prototype.release=function(b){a.each(b,a.proxy(function(a,b){delete this._supress[b]},this))},e.prototype.pointer=function(a){var c={x:null,y:null};return a=a.originalEvent||a||b.event,a=a.touches&&a.touches.length?a.touches[0]:a.changedTouches&&a.changedTouches.length?a.changedTouches[0]:a,a.pageX?(c.x=a.pageX,c.y=a.pageY):(c.x=a.clientX,c.y=a.clientY),c},e.prototype.difference=function(a,b){return{x:a.x-b.x,y:a.y-b.y}},a.fn.owlCarousel=function(b){var c=Array.prototype.slice.call(arguments,1);return this.each(function(){var d=a(this),f=d.data("owl.carousel");f||(f=new e(this,"object"==typeof b&&b),d.data("owl.carousel",f),a.each(["next","prev","to","destroy","refresh","replace","add","remove"],function(b,c){f.register({type:e.Type.Event,name:c}
vendor: 18,033 bytes, lines 36750-36751
36750),f.$element.on(c+".owl.carousel.core",a.proxy(function(a){a.namespace&&a.relatedTarget!==this&&(this.suppress([c]),f[c].apply(this,[].slice.call(arguments,1)),this.release([c]))},f))})),"string"==typeof b&&"_"!==b.charAt(0)&&f[b].apply(f,c)})},a.fn.owlCarousel.Constructor=e}(window.Zepto||window.jQuery,window,document),function(a,b,c,d){var e=function(b){this._core=b,this._interval=null,this._visible=null,this._handlers={"initialized.owl.carousel":a.proxy(function(a){a.namespace&&this._core.settings.autoRefresh&&this.watch()},this)},this._core.options=a.extend({},e.Defaults,this._core.options),this._core.$element.on(this._handlers)};e.Defaults={autoRefresh:!0,autoRefreshInterval:500},e.prototype.watch=function(){this._interval||(this._visible=this._core.$element.is(":visible"),this._interval=b.setInterval(a.proxy(this.refresh,this),this._core.settings.autoRefreshInterval))},e.prototype.refresh=function(){this._core.$element.is(":visible")!==this._visible&&(this._visible=!this._visible,this._core.$element.toggleClass("owl-hidden",!this._visible),this._visible&&this._core.invalidate("width")&&this._core.refresh())},e.prototype.destroy=function(){var a,c;b.clearInterval(this._interval);for(a in this._handlers)this._core.$element.off(a,this._handlers[a]);for(c in Object.getOwnPropertyNames(this))"function"!=typeof this[c]&&(this[c]=null)},a.fn.owlCarousel.Constructor.Plugins.AutoRefresh=e}(window.Zepto||window.jQuery,window,document),function(a,b,c,d){var e=function(b){this._core=b,this._loaded=[],this._handlers={"initialized.owl.carousel change.owl.carousel":a.proxy(function(b){if(b.namespace&&this._core.settings&&this._core.settings.lazyLoad&&(b.property&&"position"==b.property.name||"initialized"==b.type))for(var c=this._core.settings,d=c.center&&Math.ceil(c.items/2)||c.items,e=c.center&&-1*d||0,f=(b.property&&b.property.value||this._core.current())+e,g=this._core.clones().length,h=a.proxy(function(a,b){this.load(b)},this);e++<d;)this.load(g/2+this._core.relative(f)),g&&a.each(this._core.clones(this._core.relative(f)),h),f++},this)},this._core.options=a.extend({},e.Defaults,this._core.options),this._core.$element.on(this._handlers)};e.Defaults={lazyLoad:!1},e.prototype.load=function(c){var d=this._core.$stage.children().eq(c),e=d&&d.find(".owl-lazy");!e||a.inArray(d.get(0),this._loaded)>-1||(e.each(a.proxy(function(c,d){var e,f=a(d),g=b.devicePixelRatio>1&&f.attr("data-src-retina")||f.attr("data-src");this._core.trigger("load",{element:f,url:g},"lazy"),f.is("img")?f.one("load.owl.lazy",a.proxy(function(){f.css("opacity",1),this._core.trigger("loaded",{element:f,url:g},"lazy")},this)).attr("src",g):(e=new Image,e.onload=a.proxy(function(){f.css({"background-image":"url("+g+")",opacity:"1"}),this._core.trigger("loaded",{element:f,url:g},"lazy")},this),e.src=g)},this)),this._loaded.push(d.get(0)))},e.prototype.destroy=function(){var a,b;for(a in this.handlers)this._core.$element.off(a,this.handlers[a]);for(b in Object.getOwnPropertyNames(this))"function"!=typeof this[b]&&(this[b]=null)},a.fn.owlCarousel.Constructor.Plugins.Lazy=e}(window.Zepto||window.jQuery,window,document),function(a,b,c,d){var e=function(b){this._core=b,this._handlers={"initialized.owl.carousel refreshed.owl.carousel":a.proxy(function(a){a.namespace&&this._core.settings.autoHeight&&this.update()},this),"changed.owl.carousel":a.proxy(function(a){a.namespace&&this._core.settings.autoHeight&&"position"==a.property.name&&this.update()},this),"loaded.owl.lazy":a.proxy(function(a){a.namespace&&this._core.settings.autoHeight&&a.element.closest("."+this._core.settings.itemClass).index()===this._core.current()&&this.update()},this)},this._core.options=a.extend({},e.Defaults,this._core.options),this._core.$element.on(this._handlers)};e.Defaults={autoHeight:!1,autoHeightClass:"owl-height"},e.prototype.update=function(){var b=this._core._current,c=b+this._core.settings.items,d=this._core.$stage.children().toArray().slice(b,c);heights=[],maxheight=0,a.each(d,function(b,c){heights.push(a(c).height())}),maxheight=Math.max.apply(null,heights),this._core.$stage.parent().height(maxheight).addClass(this._core.settings.autoHeightClass)},e.prototype.destroy=function(){var a,b;for(a in this._handlers)this._core.$element.off(a,this._handlers[a]);for(b in Object.getOwnPropertyNames(this))"function"!=typeof this[b]&&(this[b]=null)},a.fn.owlCarousel.Constructor.Plugins.AutoHeight=e}(window.Zepto||window.jQuery,window,document),function(a,b,c,d){var e=function(b){this._core=b,this._videos={},this._playing=null,this._handlers={"initialized.owl.carousel":a.proxy(function(a){a.namespace&&this._core.register({type:"state",name:"playing",tags:["interacting"]})},this),"resize.owl.carousel":a.proxy(function(a){a.namespace&&this._core.settings.video&&this.isInFullScreen()&&a.preventDefault()},this),"refreshed.owl.carousel":a.proxy(function(a){a.namespace&&this._core.is("resizing")&&this._core.$stage.find(".cloned .owl-video-frame").remove()},this),"changed.owl.carousel":a.proxy(function(a){a.namespace&&"position"===a.property.name&&this._playing&&this.stop()},this),"prepared.owl.carousel":a.proxy(function(b){if(b.namespace){var c=a(b.content).find(".owl-video");c.length&&(c.css("display","none"),this.fetch(c,a(b.content)))}},this)},this._core.options=a.extend({},e.Defaults,this._core.options),this._core.$element.on(this._handlers),this._core.$element.on("click.owl.video",".owl-video-play-icon",a.proxy(function(a){this.play(a)},this))};e.Defaults={video:!1,videoHeight:!1,videoWidth:!1},e.prototype.fetch=function(a,b){var c=a.attr("data-vimeo-id")?"vimeo":"youtube",d=a.attr("data-vimeo-id")||a.attr("data-youtube-id"),e=a.attr("data-width")||this._core.settings.videoWidth,f=a.attr("data-height")||this._core.settings.videoHeight,g=a.attr("href");if(!g)throw new Error("Missing video URL.");if(d=g.match(/(http:|https:|)\/\/(player.|www.)?(vimeo\.com|youtu(be\.com|\.be|be\.googleapis\.com))\/(video\/|embed\/|watch\?v=|v\/)?([A-Za-z0-9._%-]*)(\&\S+)?/),d[3].indexOf("youtu")>-1)c="youtube";else{if(!(d[3].indexOf("vimeo")>-1))throw new Error("Video URL not supported.");c="vimeo"}d=d[6],this._videos[g]={type:c,id:d,width:e,height:f},b.attr("data-video",g),this.thumbnail(a,this._videos[g])},e.prototype.thumbnail=function(b,c){var d,e,f,g=c.width&&c.height?'style="width:'+c.width+"px;height:"+c.height+'px;"':"",h=b.find("img"),i="src",j="",k=this._core.settings,l=function(a){e='<div class="owl-video-play-icon"></div>',d=k.lazyLoad?'<div class="owl-video-tn '+j+'" '+i+'="'+a+'"></div>':'<div class="owl-video-tn" style="opacity:1;background-image:url('+a+')"></div>',b.after(d),b.after(e)};return b.wrap('<div class="owl-video-wrapper"'+g+"></div>"),this._core.settings.lazyLoad&&(i="data-src",j="owl-lazy"),h.length?(l(h.attr(i)),h.remove(),!1):void("youtube"===c.type?(f="http://img.youtube.com/vi/"+c.id+"/hqdefault.jpg",l(f)):"vimeo"===c.type&&a.ajax({type:"GET",url:"http://vimeo.com/api/v2/video/"+c.id+".json",jsonp:"callback",dataType:"jsonp",success:function(a){f=a[0].thumbnail_large,l(f)}}))},e.prototype.stop=function(){this._core.trigger("stop",null,"video"),this._playing.find(".owl-video-frame").remove(),this._playing.removeClass("owl-video-playing"),this._playing=null,this._core.leave("playing"),this._core.trigger("stopped",null,"video")},e.prototype.play=function(b){var c,d=a(b.target),e=d.closest("."+this._core.settings.itemClass),f=this._videos[e.attr("data-video")],g=f.width||"100%",h=f.height||this._core.$stage.height();this._playing||(this._core.enter("playing"),this._core.trigger("play",null,"video"),e=this._core.items(this._core.relative(e.index())),this._core.reset(e.index()),"youtube"===f.type?c='<iframe width="'+g+'" height="'+h+'" src="http://www.youtube.com/embed/'+f.id+"?autoplay=1&v="+f.id+'" frameborder="0" allowfullscreen></iframe>':"vimeo"===f.type&&(c='<iframe src="http://player.vimeo.com/video/'+f.id+'?autoplay=1" width="'+g+'" height="'+h+'" frameborder="0" webkitallowfullscreen mozallowfullscreen allowfullscreen></iframe>'),a('<div class="owl-video-frame">'+c+"</div>").insertAfter(e.find(".owl-video")),this._playing=e.addClass("owl-video-playing"))},e.prototype.isInFullScreen=function(){var b=c.fullscreenElement||c.mozFullScreenElement||c.webkitFullscreenElement;return b&&a(b).parent().hasClass("owl-video-frame")},e.prototype.destroy=function(){var a,b;this._core.$element.off("click.owl.video");for(a in this._handlers)this._core.$element.off(a,this._handlers[a]);for(b in Object.getOwnPropertyNames(this))"function"!=typeof this[b]&&(this[b]=null)},a.fn.owlCarousel.Constructor.Plugins.Video=e}(window.Zepto||window.jQuery,window,document),function(a,b,c,d){var e=function(b){this.core=b,this.core.options=a.extend({},e.Defaults,this.core.options),this.swapping=!0,this.previous=d,this.next=d,this.handlers={"change.owl.carousel":a.proxy(function(a){a.namespace&&"position"==a.property.name&&(this.previous=this.core.current(),this.next=a.property.value)},this),"drag.owl.carousel dragged.owl.carousel translated.owl.carousel":a.proxy(function(a){a.namespace&&(this.swapping="translated"==a.type)},this),"translate.owl.carousel":a.proxy(function(a){a.namespace&&this.swapping&&(this.core.options.animateOut||this.core.options.animateIn)&&this.swap()},this)},this.core.$element.on(this.handlers)};e.Defaults={animateOut:!1,animateIn:!1},e.prototype.swap=function(){if(1===this.core.settings.items&&a.support.animation&&a.support.transition){this.core.speed(0);var b,c=a.proxy(this.clear,this),d=this.core.$stage.children().eq(this.previous),e=this.core.$stage.children().eq(this.next),f=this.core.settings.animateIn,g=this.core.settings.animateOut;this.core.current()!==this.previous&&(g&&(b=this.core.coordinates(this.previous)-this.core.coordinates(this.next),d.one(a.support.animation.end,c).css({left:b+"px"}).addClass("animated owl-animated-out").addClass(g)),f&&e.one(a.support.animation.end,c).addClass("animated owl-animated-in").addClass(f))}},e.prototype.clear=function(b){a(b.target).css({left:""}).removeClass("animated owl-animated-out owl-animated-in").removeClass(this.core.settings.animateIn).removeClass(this.core.settings.animateOut),this.core.onTransitionEnd()},e.prototype.destroy=function(){var a,b;for(a in this.handlers)this.core.$element.off(a,this.handlers[a]);for(b in Object.getOwnPropertyNames(this))"function"!=typeof this[b]&&(this[b]=null)},a.fn.owlCarousel.Constructor.Plugins.Animate=e}(window.Zepto||window.jQuery,window,document),function(a,b,c,d){var e=function(b){this._core=b,this._interval=null,this._paused=!1,this._handlers={"changed.owl.carousel":a.proxy(function(a){a.namespace&&"settings"===a.property.name&&(this._core.settings.autoplay?this.play():this.stop())},this),"initialized.owl.carousel":a.proxy(function(a){a.namespace&&this._core.settings.autoplay&&this.play()},this),"play.owl.autoplay":a.proxy(function(a,b,c){a.namespace&&this.play(b,c)},this),"stop.owl.autoplay":a.proxy(function(a){a.namespace&&this.stop()},this),"mouseover.owl.autoplay":a.proxy(function(){this._core.settings.autoplayHoverPause&&this._core.is("rotating")&&this.pause()},this),"mouseleave.owl.autoplay":a.proxy(function(){
36751this._core.settings.autoplayHoverPause&&this._core.is("rotating")&&this.play()},this)},this._core.$element.on(this._handlers),this._core.options=a.extend({},e.Defaults,this._core.options)};e.Defaults={autoplay:!1,autoplayTimeout:5e3,autoplayHoverPause:!1,autoplaySpeed:!1},e.prototype.play=function(d,e){this._paused=!1,this._core.is("rotating")||(this._core.enter("rotating"),this._interval=b.setInterval(a.proxy(function(){this._paused||this._core.is("busy")||this._core.is("interacting")||c.hidden||this._core.next(e||this._core.settings.autoplaySpeed)},this),d||this._core.settings.autoplayTimeout))},e.prototype.stop=function(){this._core.is("rotating")&&(b.clearInterval(this._interval),this._core.leave("rotating"))},e.prototype.pause=function(){this._core.is("rotating")&&(this._paused=!0)},e.prototype.destroy=function(){var a,b;this.stop();for(a in this._handlers)this._core.$element.off(a,this._handlers[a]);for(b in Object.getOwnPropertyNames(this))"function"!=typeof this[b]&&(this[b]=null)},a.fn.owlCarousel.Constructor.Plugins.autoplay=e}(window.Zepto||window.jQuery,window,document),function(a,b,c,d){"use strict";var e=function(b){this._core=b,this._initialized=!1,this._pages=[],this._controls={},this._templates=[],this.$element=this._core.$element,this._overrides={next:this._core.next,prev:this._core.prev,to:this._core.to},this._handlers={"prepared.owl.carousel":a.proxy(function(b){b.namespace&&this._core.settings.dotsData&&this._templates.push('<div class="'+this._core.settings.dotClass+'">'+a(b.content).find("[data-dot]").andSelf("[data-dot]").attr("data-dot")+"</div>")},this),"added.owl.carousel":a.proxy(function(a){a.namespace&&this._core.settings.dotsData&&this._templates.splice(a.position,0,this._templates.pop())},this),"remove.owl.carousel":a.proxy(function(a){a.namespace&&this._core.settings.dotsData&&this._templates.splice(a.position,1)},this),"changed.owl.carousel":a.proxy(function(a){a.namespace&&"position"==a.property.name&&this.draw()},this),"initialized.owl.carousel":a.proxy(function(a){a.namespace&&!this._initialized&&(this._core.trigger("initialize",null,"navigation"),this.initialize(),this.update(),this.draw(),this._initialized=!0,this._core.trigger("initialized",null,"navigation"))},this),"refreshed.owl.carousel":a.proxy(function(a){a.namespace&&this._initialized&&(this._core.trigger("refresh",null,"navigation"),this.update(),this.draw(),this._core.trigger("refreshed",null,"navigation"))},this)},this._core.options=a.extend({},e.Defaults,this._core.options),this.$element.on(this._handlers)};e.Defaults={nav:!1,navText:["prev","next"],navSpeed:!1,navElement:"div",navContainer:!1,navContainerClass:"owl-nav",navClass:["owl-prev","owl-next"],slideBy:1,dotClass:"owl-dot",dotsClass:"owl-dots",dots:!0,dotsEach:!1,dotsData:!1,dotsSpeed:!1,dotsContainer:!1},e.prototype.initialize=function(){var b,c=this._core.settings;this._controls.$relative=(c.navContainer?a(c.navContainer):a("<div>").addClass(c.navContainerClass).appendTo(this.$element)).addClass("disabled"),this._controls.$previous=a("<"+c.navElement+">").addClass(c.navClass[0]).html(c.navText[0]).prependTo(this._controls.$relative).on("click",a.proxy(function(a){this.prev(c.navSpeed)},this)),this._controls.$next=a("<"+c.navElement+">").addClass(c.navClass[1]).html(c.navText[1]).appendTo(this._controls.$relative).on("click",a.proxy(function(a){this.next(c.navSpeed)},this)),c.dotsData||(this._templates=[a("<div>").addClass(c.dotClass).append(a("<span>")).prop("outerHTML")]),this._controls.$absolute=(c.dotsContainer?a(c.dotsContainer):a("<div>").addClass(c.dotsClass).appendTo(this.$element)).addClass("disabled"),this._controls.$absolute.on("click","div",a.proxy(function(b){var d=a(b.target).parent().is(this._controls.$absolute)?a(b.target).index():a(b.target).parent().index();b.preventDefault(),this.to(d,c.dotsSpeed)},this));for(b in this._overrides)this._core[b]=a.proxy(this[b],this)},e.prototype.destroy=function(){var a,b,c,d;for(a in this._handlers)this.$element.off(a,this._handlers[a]);for(b in this._controls)this._controls[b].remove();for(d in this.overides)this._core[d]=this._overrides[d];for(c in Object.getOwnPropertyNames(this))"function"!=typeof this[c]&&(this[c]=null)},e.prototype.update=function(){var a,b,c,d=this._core.clones().length/2,e=d+this._core.items().length,f=this._core.maximum(!0),g=this._core.settings,h=g.center||g.autoWidth||g.dotsData?1:g.dotsEach||g.items;if("page"!==g.slideBy&&(g.slideBy=Math.min(g.slideBy,g.items)),g.dots||"page"==g.slideBy)for(this._pages=[],a=d,b=0,c=0;e>a;a++){if(b>=h||0===b){if(this._pages.push({start:Math.min(f,a-d),end:a-d+h-1}),Math.min(f,a-d)===f)break;b=0,++c}b+=this._core.mergers(this._core.relative(a))}},e.prototype.draw=function(){var b,c=this._core.settings,d=this._core.items().length<=c.items,e=this._core.relative(this._core.current()),f=c.loop||c.rewind;this._controls.$relative.toggleClass("disabled",!c.nav||d),c.nav&&(this._controls.$previous.toggleClass("disabled",!f&&e<=this._core.minimum(!0)),this._controls.$next.toggleClass("disabled",!f&&e>=this._core.maximum(!0))),this._controls.$absolute.toggleClass("disabled",!c.dots||d),c.dots&&(b=this._pages.length-this._controls.$absolute.children().length,c.dotsData&&0!==b?this._controls.$absolute.html(this._templates.join("")):b>0?this._controls.$absolute.append(new Array(b+1).join(this._templates[0])):0>b&&this._controls.$absolute.children().slice(b).remove(),this._controls.$absolute.find(".active").removeClass("active"),this._controls.$absolute.children().eq(a.inArray(this.current(),this._pages)).addClass("active"))},e.prototype.onTrigger=function(b){var c=this._core.settings;b.page={index:a.inArray(this.current(),this._pages),count:this._pages.length,size:c&&(c.center||c.autoWidth||c.dotsData?1:c.dotsEach||c.items)}},e.prototype.current=function(){var b=this._core.relative(this._core.current());return a.grep(this._pages,a.proxy(function(a,c){return a.start<=b&&a.end>=b},this)).pop()},e.prototype.getPosition=function(b){var c,d,e=this._core.settings;return"page"==e.slideBy?(c=a.inArray(this.current(),this._pages),d=this._pages.length,b?++c:--c,c=this._pages[(c%d+d)%d].start):(c=this._core.relative(this._core.current()),d=this._core.items().length,b?c+=e.slideBy:c-=e.slideBy),c},e.prototype.next=function(b){a.proxy(this._overrides.to,this._core)(this.getPosition(!0),b)},e.prototype.prev=function(b){a.proxy(this._overrides.to,this._core)(this.getPosition(!1),b)},e.prototype.to=function(b,c,d){var e;d?a.proxy(this._overrides.to,this._core)(b,c):(e=this._pages.length,a.proxy(this._overrides.to,this._core)(this._pages[(b%e+e)%e].start,c))},a.fn.owlCarousel.Constructor.Plugins.Navigation=e}(window.Zepto||window.jQuery,window,document),function(a,b,c,d){"use strict";var e=function(c){this._core=c,this._hashes={},this.$element=this._core.$element,this._handlers={"initialized.owl.carousel":
36751a.proxy(function(c){c.namespace&&"URLHash"===this._core.settings.startPosition&&a(b).trigger("hashchange.owl.navigation")},this),"prepared.owl.carousel":a.proxy(function(b){if(b.namespace){var c=a(b.content).find("[data-hash]").andSelf("[data-hash]").attr("data-hash");if(!c)return;this._hashes[c]=b.content}},this),"changed.owl.carousel":a.proxy(function(c){if(c.namespace&&"position"===c.property.name){var d=this._core.items(this._core.relative(this._core.current())),e=a.map(this._hashes,function(a,b){return a===d?b:null}).join();if(!e||b.location.hash.slice(1)===e)return;b.location.hash=e}},this)},this._core.options=a.extend({},e.Defaults,this._core.options),this.$element.on(this._handlers),a(b).on("hashchange.owl.navigation",a.proxy(function(a){var c=b.location.hash.substring(1),e=this._core.$stage.children(),f=this._hashes[c]&&e.index(this._hashes[c]);f!==d&&f!==this._core.current()&&this._core.to(this._core.relative(f),!1,!0)},this))};e.Defaults={URLhashListener:!1},e.prototype.destroy=function(){var c,d;a(b).off("hashchange.owl.navigation");for(c in this._handlers)this._core.$element.off(c,this._handlers[c]);for(d in Object.getOwnPropertyNames(this))"function"!=typeof this[d]&&(this[d]=null)},a.fn.owlCarousel.Constructor.Plugins.Hash=e}(window.Zepto||window.jQuery,window,document),function(a,b,c,d){function e(b,c){var e=!1,f=b.charAt(0).toUpperCase()+b.slice(1);return a.each((b+" "+h.join(f+" ")+f).split(" "),function(a,b){return g[b]!==d?(e=c?b:!0,!1):void 0}),e}function f(a){return e(a,!0)}var g=a("<support>").get(0).style,h="Webkit Moz O ms".split(" "),i={transition:{end:{WebkitTransition:"webkitTransitionEnd",MozTransition:"transitionend",OTransition:"oTransitionEnd",transition:"transitionend"}},animation:{end:{WebkitAnimation:"webkitAnimationEnd",MozAnimation:"animationend",OAnimation:"oAnimationEnd",animation:"animationend"}}},j={csstransforms:function(){return!!e("transform")},csstransforms3d:function(){return!!e("perspective")},csstransitions:function(){return!!e("transition")},cssanimations:function(){return!!e("animation")}};j.csstransitions()&&(a.support.transition=new String(f("transition")),a.support.transition.end=i.transition.end[a.support.transition]),j.cssanimations()&&(a.support.animation=new String(f("animation")),a.support.animation.end=i.animation.end[a.support.animation]),j.csstransforms()&&(a.support.transform=new String(f("transform")),a.support.transform3d=j.csstransforms3d())}(window.Zepto||window.jQuery,window,document);
36752/* 
36753 * Boxer v3.3.0 - 2015-04-04 
36754 * A jQuery plugin for displaying images, videos or content in a modal overlay. Part of the Formstone Library. 
36755 * http://classic.formstone.it/boxer/ 
36756 * 
36757 * Copyright 2015 Ben Plum; MIT Licensed 
36758 */
36759var download_full_image_link;
36760var download_image_text;
36761var download_image_counter;
36762! function(a, b) {
36763    "use strict";
36764
36765    function c(b) {
36766        return L.formatter = j, I = a("body"), G = F(), H = G !== !1, H || (G = "transitionend.boxer"), a(this).on("click.boxer", a.extend({}, L, b || {}), d)
36767    }
36768
36769    function d(c) {    	
36770        if ($(this).find('.full-image-path').length > 0) {
36771        	download_full_image_link = $(this).find('.full-image-path');
36772        	download_full_image_link = download_full_image_link[0]['innerHTML'];
36773            download_full_image_link = $.trim(download_full_image_link);
36774            download_image_text = $(this).find('.download-image-text');
36775            download_image_text = download_image_text[0]['innerHTML'];
36776            download_image_text = $.trim(download_image_text);
36777        }
36778        if ("undefined" == typeof J.$boxer) {
36779            var d = a(this),
36780                f = c.data.$object,
36781                g = d[0].href ? d[0].href || "" : "",
36782                i = d[0].hash ? d[0].hash || "" : "",
36783                j = g.toLowerCase().split(".").pop().split(/\#|\?/),
36784                l = j[0],
36785                m = d.data("boxer-type") || "",
36786                o = "image" === m || a.inArray(l, c.data.extensions) > -1 || "data:image" === g.substr(0, 10),
36787                p = g.indexOf("youtube.com/embed") > -1 || g.indexOf("player.vimeo.com/video") > -1,
36788                w = "url" === m || !o && !p && "http" === g.substr(0, 4) && !i,
36789                x = "element" === m || !o && !p && !w && "#" === i.substr(0, 1),
36790                y = "undefined" != typeof f;
36791            if (x && (g = i), a("#boxer").length > 1 || !(o || p || w || x || y)) return;
36792            if (C(c), J = a.extend({}, {
36793                    $window: a(b),
36794                    $body: a("body"),
36795                    $target: d,
36796                    $object: f,
36797                    visible: !1,
36798                    resizeTimer: null,
36799                    touchTimer: null,
36800                    gallery: {
36801                        active: !1
36802                    },
36803                    isMobile: K || c.data.mobile,
36804                    isAnimating: !0,
36805                    oldContentHeight: 0,
36806                    oldContentWidth: 0
36807                }, c.data), J.margin *= 2, J.type = o ? "image" : p ? "video" : "element", o || p) {
36808                var z = J.$target.data("gallery") || J.$target.attr("rel");
36809                "undefined" != typeof z && z !== !1 && (J.gallery.active = !0, J.gallery.id = z, J.gallery.$items = a("a[data-gallery= " + J.gallery.id + "], a[rel= " + J.gallery.id + "]"), J.gallery.index = J.gallery.$items.index(J.$target), J.gallery.total = J.gallery.$items.length - 1)
36810            }
36811            var A = "";
36812            if (J.isMobile || (A += '<div id="boxer-overlay" class="' + J.customClass + '"></div>'), A += '<div id="boxer" class="loading animating ' + J.customClass, J.fixed && (A += " fixed"), J.isMobile && (A += " mobile"), w && (A += " iframe"), (x || y) && (A += " inline"), A += '">', A += '<span class="boxer-close">' + J.labels.close + "</span>", A += '<span class="boxer-loading"></span>', A += '<div class="boxer-container">', A += '<div class="boxer-content">', (o || p) && (A += '<div class="boxer-meta">', J.gallery.active ? (A += '<div class="boxer-control previous">' + J.labels.previous + "</div>", A += '<div class="boxer-control next">' + J.labels.next + "</div>", A += '<p class="boxer-position"', J.gallery.total < 1 && (A += ' style="display: none;"'), A += ">", A += '<span class="current">' + (J.gallery.index + 1) + "</span> " + J.labels.count + ' <span class="total">' + (J.gallery.total + 1) + "</span>", A += "</p>", A += '<div class="boxer-caption gallery">') : A += '<div class="boxer-caption">', A += J.formatter.apply(J.$body, [J.$target]), A += "</div></div>"), A += "</div></div></div>", J.$body.append(A), J.$overlay = a("#boxer-overlay"), J.$boxer = a("#boxer"), J.$container = J.$boxer.find(".boxer-container"), J.$content = J.$boxer.find(".boxer-content"), J.$meta = J.$boxer.find(".boxer-meta"), J.$position = J.$boxer.find(".boxer-position"), J.$caption = J.$boxer.find(".boxer-caption"), J.$controls = J.$boxer.find(".boxer-control"), J.paddingVertical = J.isMobile ? J.$boxer.find(".boxer-close").outerHeight() / 2 : parseInt(J.$boxer.css("paddingTop"), 10) + parseInt(J.$boxer.css("paddingBottom"), 10), J.paddingHorizontal = J.isMobile ? 0 : parseInt(J.$boxer.css("paddingLeft"), 10) + parseInt(J.$boxer.css("paddingRight"), 10), J.contentHeight = J.$boxer.outerHeight() - J.paddingVertical, J.contentWidth = J.$boxer.outerWidth() - J.paddingHorizontal, J.controlHeight = J.$controls.outerHeight(), h(), J.gallery.active && r(), J.$window.on("resize.boxer", M.resize).on("keydown.boxer", s), J.$body.on("touchstart.boxer click.boxer", "#boxer-overlay, #boxer .boxer-close", e).on("touchmove.boxer", C), J.gallery.active && J.$boxer.on("touchstart.boxer click.boxer", ".boxer-control", q), J.$boxer.on(G, function(b) {
36813                    C(b), a(b.target).is(J.$boxer) && (J.$boxer.off(G), o ? k(g) : p ? n(g) : w ? u(g) : x ? t(g) : y ? v(J.$object) : a.error("BOXER: '" + g + "' is not valid."))
36814                }), I.addClass("boxer-open"), H || J.$boxer.trigger(G), y) return J.$boxer
36815        }
36816
36817        if ($(this).find('.full-image-path').length > 0) {
36818            $('.boxer-meta').append('<div class="download btn-default pull-right" style="margin-top: -45px;"><a href="'+download_full_image_link+'" download>'+download_image_text+'</a></div>');
36819        }
36820    }
36821
36822    function e(b) {
36823        C(b), "undefined" != typeof J.$boxer && (J.$boxer.on(G, function(b) {
36824            C(b), a(b.target).is(J.$boxer) && (J.$boxer.off(G), J.$overlay.remove(), J.$boxer.remove(), J = {})
36825        }).addClass("animating"), I.removeClass("boxer-open"), H || J.$boxer.trigger(G), E(J.resizeTimer), J.$window.off("resize.boxer").off("keydown.boxer"), J.$body.off(".boxer").removeClass("boxer-open"), J.gallery.active && J.$boxer.off(".boxer"), J.isMobile && "image" === J.type && J.gallery.active && J.$container.off(".boxer"), J.$window.trigger("close.boxer"))
36826    }
36827
36828    function f() {
36829        {
36830            var b = i();
36831            J.isMobile ? 0 : J.duration
36832        }
36833        J.isMobile || J.$controls.css({
36834            marginTop: (J.contentHeight - J.controlHeight - J.metaHeight) / 2
36835        }), !J.visible && J.isMobile && J.gallery.active && J.$content.on("touchstart.boxer", ".boxer-image", y), (J.isMobile || J.fixed) && J.$body.addClass("boxer-open"), J.$boxer.on(G, function(b) {
36836            C(b), a(b.target).is(J.$boxer) && (J.$boxer.off(G), J.$container.on(G, function(b) {
36837                C(b), a(b.target).is(J.$container) && (J.$container.off(G), J.$boxer.removeClass("animating"), J.isAnimating = !1)
36838            }), J.$boxer.removeClass("loading"), H || J.$content.trigger(G), J.visible = !0, J.callback.apply(J.$boxer), J.$window.trigger("open.boxer"), J.gallery.active && p())
36839        }), J.isMobile || J.$boxer.css({
36840            height: J.contentHeight + J.paddingVertical,
36841            width: J.contentWidth + J.paddingHorizontal,
36842            top: J.fixed ? 0 : b.top
36843        });
36844        var c = J.oldContentHeight !== J.contentHeight || J.oldContentWidth !== J.contentWidth;
36845        !J.isMobile && H && c || J.$boxer.trigger(G), J.oldContentHeight = J.contentHeight, J.oldContentWidth = J.contentWidth
36846    }
36847
36848    function g() {
36849        if (J.visible && !J.isMobile) {
36850            var a = i();
36851            J.$controls.css({
36852                marginTop: (J.contentHeight - J.controlHeight - J.metaHeight) / 2
36853            }), J.$boxer.css({
36854                height: J.contentHeight + J.paddingVertical,
36855                width: J.contentWidth + J.paddingHorizontal,
36856                top: J.fixed ? 0 : a.top
36857            })
36858        }
36859    }
36860
36861    function h() {
36862        var a = i();
36863        J.$boxer.css({
36864            top: J.fixed ? 0 : a.top
36865        })
36866    }
36867
36868    function i() {
36869        if (J.isMobile) return {
36870            left: 0,
36871            top: 0
36872        };
36873        var a = {
36874            left: (J.$window.width() - J.contentWidth - J.paddingHorizontal) / 2,
36875            top: J.top <= 0 ? (J.$window.height() - J.contentHeight - J.paddingVertical) / 2 : J.top
36876        };
36877        return J.fixed !== !0 && (a.top += J.$window.scrollTop()), a
36878    }
36879
36880    function j(a) {
36881        var b = a.attr("title");
36882        return void 0 !== b && "" !== b.trim() ? '<p class="caption">' + b.trim() + "</p>" : ""
36883    }
36884
36885    function k(b) {
36886        J.$image = a("<img />"), J.$image.load(function() {
36887            J.$image.off("load, error");
36888            var a = B(J.$image);
36889            J.naturalHeight = a.naturalHeight, J.naturalWidth = a.naturalWidth, J.retina && (J.naturalHeight /= 2, J.naturalWidth /= 2), J.$content.prepend(J.$image), "" === J.$caption.html() ? J.$caption.hide() : J.$caption.show(), l(), f()
36890        }).error(x).attr("src", b).addClass("boxer-image"), (J.$image[0].complete || 4 === J.$image[0].readyState) && J.$image.trigger("load")
36891    }
36892
36893    function l() {
36894        var a = 0;
36895        for (J.windowHeight = J.viewportHeight = J.$window.height() - J.paddingVertical, J.windowWidth = J.viewportWidth = J.$window.width() - J.paddingHorizontal, J.contentHeight = 1 / 0, J.contentWidth = 1 / 0, J.imageMarginTop = 0, J.imageMarginLeft = 0; J.contentHeight > J.viewportHeight && 2 > a;) J.imageHeight = 0 === a ? J.naturalHeight : J.$image.outerHeight(), J.imageWidth = 0 === a ? J.naturalWidth : J.$image.outerWidth(), J.metaHeight = 0 === a ? 0 : J.metaHeight, 0 === a && (J.ratioHorizontal = J.imageHeight / J.imageWidth, J.ratioVertical = J.imageWidth / J.imageHeight, J.isWide = J.imageWidth > J.imageHeight), J.imageHeight < J.minHeight && (J.minHeight = J.imageHeight), J.imageWidth < J.minWidth && (J.minWidth = J.imageWidth), J.isMobile ? (J.$meta.css({
36896            width: J.windowWidth
36897        }), J.metaHeight = J.$meta.outerHeight(!0), J.contentHeight = J.viewportHeight - J.paddingVertical, J.contentWidth = J.viewportWidth - J.paddingHorizontal, m(), J.imageMarginTop = (J.contentHeight - J.targetImageHeight - J.metaHeight) / 2, J.imageMarginLeft = (J.contentWidth - J.targetImageWidth) / 2) : (0 === a && (J.viewportHeight -= J.margin + J.paddingVertical, J.viewportWidth -= J.margin + J.paddingHorizontal), J.viewportHeight -= J.metaHeight, m(), J.contentHeight = J.targetImageHeight, J.contentWidth = J.targetImageWidth), J.$meta.css({
36898            width: J.contentWidth
36899        }), J.$image.css({
36900            height: J.targetImageHeight,
36901            width: J.targetImageWidth,
36902            marginTop: J.imageMarginTop,
36903            marginLeft: J.imageMarginLeft
36904        }), J.isMobile || (J.metaHeight = J.$meta.outerHeight(!0), J.contentHeight += J.metaHeight), a++
36905    }
36906
36907    function m() {
36908        var a = J.isMobile ? J.contentHeight - J.metaHeight : J.viewportHeight,
36909            b = J.isMobile ? J.contentWidth : J.viewportWidth;
36910        J.isWide ? (J.targetImageWidth = b, J.targetImageHeight = J.targetImageWidth * J.ratioHorizontal, J.targetImageHeight > a && (J.targetImageHeight = a, J.targetImageWidth = J.targetImageHeight * J.ratioVertical)) : (J.targetImageHeight = a, J.targetImageWidth = J.targetImageHeight * J.ratioVertical, J.targetImageWidth > b && (J.targetImageWidth = b, J.targetImageHeight = J.targetImageWidth * J.ratioHorizontal)), (J.targetImageWidth > J.imageWidth || J.targetImageHeight > J.imageHeight) && (J.targetImageHeight = J.imageHeight, J.targetImageWidth = J.imageWidth), (J.targetImageWidth < J.minWidth || J.targetImageHeight < J.minHeight) && (J.targetImageWidth < J.minWidth ? (J.targetImageWidth = J.minWidth, J.targetImageHeight = J.targetImageWidth * J.ratioHorizontal) : (J.targetImageHeight = J.minHeight, J.targetImageWidth = J.targetImageHeight * J.ratioVertical))
36911    }
36912
36913    function n(b) {
36914        J.$videoWrapper = a('<div class="boxer-video-wrapper" />'), J.$video = a('<iframe class="boxer-video" seamless="seamless" />'), J.$video.attr("src", b).addClass("boxer-video").prependTo(J.$videoWrapper), J.$content.prepend(J.$videoWrapper), o(), f()
36915    }
36916
36917    function o() {
36918        J.windowHeight = J.viewportHeight = J.contentHeight = J.$window.height() - J.paddingVertical, J.windowWidth = J.viewportWidth = J.contentWidth = J.$window.width() - J.paddingHorizontal, J.videoMarginTop = 0, J.videoMarginLeft = 0, J.isMobile ? (J.$meta.css({
36919            width: J.windowWidth
36920        }), J.metaHeight = J.$meta.outerHeight(!0), J.viewportHeight -= J.metaHeight, J.targetVideoWidth = J.viewportWidth, J.targetVideoHeight = J.targetVideoWidth * J.videoRatio, J.targetVideoHeight > J.viewportHeight && (J.targetVideoHeight = J.viewportHeight, J.targetVideoWidth = J.targetVideoHeight / J.videoRatio), J.videoMarginTop = (J.viewportHe
36920ight - J.targetVideoHeight) / 2, J.videoMarginLeft = (J.viewportWidth - J.targetVideoWidth) / 2) : (J.viewportHeight = J.windowHeight - J.margin, J.viewportWidth = J.windowWidth - J.margin, J.targetVideoWidth = J.videoWidth > J.viewportWidth ? J.viewportWidth : J.videoWidth, J.targetVideoWidth < J.minWidth && (J.targetVideoWidth = J.minWidth), J.targetVideoHeight = J.targetVideoWidth * J.videoRatio, J.contentHeight = J.targetVideoHeight, J.contentWidth = J.targetVideoWidth), J.$meta.css({
36921            width: J.contentWidth
36922        }), J.$videoWrapper.css({
36923            height: J.targetVideoHeight,
36924            width: J.targetVideoWidth,
36925            marginTop: J.videoMarginTop,
36926            marginLeft: J.videoMarginLeft
36927        }), J.isMobile || (J.metaHeight = J.$meta.outerHeight(!0), J.contentHeight = J.targetVideoHeight + J.metaHeight)
36928    }
36929
36930    function p(b) {
36931        var c = "";
36932        J.gallery.index > 0 && (c = J.gallery.$items.eq(J.gallery.index - 1).attr("href"), c.indexOf("youtube.com/embed") < 0 && c.indexOf("player.vimeo.com/video") < 0 && a('<img src="' + c + '">')), J.gallery.index < J.gallery.total && (c = J.gallery.$items.eq(J.gallery.index + 1).attr("href"), c.indexOf("youtube.com/embed") < 0 && c.indexOf("player.vimeo.com/video") < 0 && a('<img src="' + c + '">'))        
36933        download_image_counter = J.gallery.index + 1;
36934        //console.log('download_image_counter' + download_image_counter);
36935        if ($('.gallery-item').find('.full-image-path').length > 0) {
36936            console.log('test next clicked');
36937            download_full_image_link = $('.full-image-path.image-index-'+download_image_counter).html();
36938            //download_full_image_link = download_full_image_link[0]['innerHTML'];
36939            //download_full_image_link = $.trim(download_full_image_link);
36940            //console.log('download_full_image_link' + download_full_image_link);
36941            download_image_text = $('.download-image-text.image-index-'+download_image_counter).html();      
36942            //download_image_text = $.trim(download_image_text);        
36943            //console.log('download_image_text' + download_image_text);        
36944            //download_image_text = download_image_text[0]['innerHTML'];
36945            $('.download.btn-default').html('<a href="'+download_full_image_link+'" download>'+download_image_text+'</a>');
36946        } 
36947    }
36948
36949    function q(b) {
36950        C(b);
36951        var c = a(this);
36952        J.isAnimating || c.hasClass("disabled") || (J.isAnimating = !0, J.gallery.index += c.hasClass("next") ? 1 : -1, J.gallery.index > J.gallery.total && (J.gallery.index = J.gallery.total), J.gallery.index < 0 && (J.gallery.index = 0), J.$container.on(G, function(b) {
36953            if (C(b), a(b.target).is(J.$container)) {
36954                J.$container.off(G), "undefined" != typeof J.$image && J.$image.remove(), "undefined" != typeof J.$videoWrapper && J.$videoWrapper.remove(), J.$target = J.gallery.$items.eq(J.gallery.index), J.$caption.html(J.formatter.apply(J.$body, [J.$target])), J.$position.find(".current").html(J.gallery.index + 1);
36955                var c = J.$target.attr("href"),
36956                    d = c.indexOf("youtube.com/embed") > -1 || c.indexOf("player.vimeo.com/video") > -1;
36957                d ? n(c) : k(c), r()
36958            }
36959        }), J.$boxer.addClass("loading animating"), H || J.$content.trigger(G))
36960    }
36961
36962    function r() {
36963        J.$controls.removeClass("disabled"), 0 === J.gallery.index && J.$controls.filter(".previous").addClass("disabled"), J.gallery.index === J.gallery.total && J.$controls.filter(".next").addClass("disabled")
36964    }
36965
36966    function s(a) {
36967        !J.gallery.active || 37 !== a.keyCode && 39 !== a.keyCode ? 27 === a.keyCode && J.$boxer.find(".boxer-close").trigger("click") : (C(a), J.$controls.filter(37 === a.keyCode ? ".previous" : ".next").trigger("click"))
36968    }
36969
36970    function t(b) {
36971        var c = a(b).find(">:first-child").clone();
36972        v(c)
36973    }
36974
36975    function u(b) {
36976        b += b.indexOf("?") > -1 ? "&" + L.requestKey + "=true" : "?" + L.requestKey + "=true";
36977        var c = a('<iframe class="boxer-iframe" src="' + b + '" />');
36978        v(c)
36979    }
36980
36981    function v(a) {
36982        J.$content.append(a), w(a), f()
36983    }
36984
36985    function w(a) {
36986        J.windowHeight = J.$window.height() - J.paddingVertical, J.windowWidth = J.$window.width() - J.paddingHorizontal, J.objectHeight = a.outerHeight(!0), J.objectWidth = a.outerWidth(!0), J.targetHeight = J.targetHeight || J.$target.data("boxer-height"), J.targetWidth = J.targetWidth || J.$target.data("boxer-width"), J.maxHeight = J.windowHeight < 0 ? L.minHeight : J.windowHeight, J.isIframe = a.is("iframe"), J.objectMarginTop = 0, J.objectMarginLeft = 0, J.isMobile || (J.windowHeight -= J.margin, J.windowWidth -= J.margin), J.contentHeight = void 0 !== J.targetHeight ? J.targetHeight : J.isIframe || J.isMobile ? J.windowHeight : J.objectHeight, J.contentWidth = void 0 !== J.targetWidth ? J.targetWidth : J.isIframe || J.isMobile ? J.windowWidth : J.objectWidth, (J.isIframe || J.isObject) && J.isMobile ? (J.contentHeight = J.windowHeight, J.contentWidth = J.windowWidth) : J.isObject && (J.contentHeight = J.contentHeight > J.windowHeight ? J.windowHeight : J.contentHeight, J.contentWidth = J.contentWidth > J.windowWidth ? J.windowWidth : J.contentWidth)
36987    }
36988
36989    function x(b) {
36990        var c = a('<div class="boxer-error"><p>Error Loading Resource</p></div>');
36991        J.type = "element", J.$meta.remove(), J.$image.off("load, error"), v(c)
36992    }
36993
36994    function y(a) {
36995        if (C(a), E(J.touchTimer), !J.isAnimating) {
36996            var b = "undefined" != typeof a.originalEvent.targetTouches ? a.originalEvent.targetTouches[0] : null;
36997            J.xStart = b ? b.pageX : a.clientX, J.leftPosition = 0, J.touchMax = 1 / 0, J.touchMin = -(1 / 0), J.edge = .25 * J.contentWidth, 0 === J.gallery.index && (J.touchMax = 0), J.gallery.index === J.gallery.total && (J.touchMin = 0), J.$boxer.on("touchmove.boxer", z).one("touchend.boxer", A)
36998        }
36999    }
37000
37001    function z(a) {
37002        var b = "undefined" != typeof a.originalEvent.targetTouches ? a.originalEvent.targetTouches[0] : null;
37003        J.delta = J.xStart - (b ? b.pageX : a.clientX), J.delta > 20 && C(a), J.canSwipe = !0;
37004        var c = -J.delta;
37005        c < J.touchMin && (c = J.touchMin, J.canSwipe = !1), c > J.touchMax && (c = J.touchMax, J.canSwipe = !1), J.$image.css({
37006            transform: "translate3D(" + c + "px,0,0)"
37007        }), J.touchTimer = D(J.touchTimer, 300, function() {
37008            A(a)
37009        })
37010    }
37011
37012    function A(a) {
37013        C(a), E(J.touchTimer), J.$boxer.off("touchmove.boxer touchend.boxer"), J.delta && (J.$boxer.addClass("animated"), J.swipe = !1, J.canSwipe && (J.delta > J.edge || J.delta < -J.edge) ? (J.swipe = !0, J.$image.css(J.delta <= J.leftPosition ? {
37014            transform: "translate3D(" + J.contentWidth + "px,0,0)"
37015        } : {
37016            transform: "translate3D(" + -J.contentWidth + "px,0,0)"
37017        })) : J.$image.css({
37018            transform: "translate3D(0,0,0)"
37019        }), J.swipe && J.$controls.filter(J.delta <= J.leftPosition ? ".previous" : ".next").trigger("click"), D(J.resetTimer, J.duration, function() {
37020            J.$boxer.removeClass("animated")
37021        }))
37022    }
37023
37024    function B(a) {
37025        var b = a[0],
37026            c = new Image;
37027        return "undefined" != typeof b.naturalHeight ? {
37028            naturalHeight: b.naturalHeight,
37029            naturalWidth: b.naturalWidth
37030        } : "img" === b.tagName.toLowerCase() ? (c.src = b.src, {
37031            naturalHeight: c.height,
37032            naturalWidth: c.width
37033        }) : !1
37034    }
37035
37036    function C(a) {
37037        a.preventDefault && (a.stopPropagation(), a.preventDefault())
37038    }
37039
37040    function D(a, b, c) {
37041        return E(a), setTimeout(c, b)
37042    }
37043
37044    function E(a) {
37045        a && (clearTimeout(a), a = null)
37046    }
37047
37048    function F() {
37049        var a = {
37050                WebkitTransition: "webkitTransitionEnd",
37051                MozTransition: "transitionend",
37052                OTransition: "oTransitionEnd",
37053                transition: "transitionend"
37054            },
37055            b = document.createElement("div");
37056        for (var c in a)
37057            if (a.hasOwnProperty(c) && c in b.style) return a[c];
37058        return !1
37059    }
37060    var G, H, I = null,
37061        J = {},
37062        K = /Android|webOS|iPhone|iPad|iPod|BlackBerry/i.test(b.navigator.userAgent || b.navigator.vendor || b.opera),
37063        L = {
37064            callback: a.noop,
37065            customClass: "",
37066            extensions: ["jpg", "sjpg", "jpeg", "png", "gif"],
37067            fixed: !1,
37068            formatter: a.noop,
37069            labels: {
37070                close: "Close",
37071                count: "of",
37072                next: "Next",
37073                previous: "Previous"
37074            },
37075            margin: 50,
37076            minHeight: 100,
37077            minWidth: 100,
37078            mobile: !1,
37079            opacity: .75,
37080            retina: !1,
37081            requestKey: "boxer",
37082            top: 0,
37083            videoRatio: .5625,
37084            videoWidth: 600
37085        },
37086        M = {
37087            close: function() {            	
37088                "undefined" != typeof J.$boxer && (J.$boxer.off(".boxer"), J.$overlay.trigger("click"))
37089            },
37090            defaults: function(b) {            	
37091                return L = a.extend(L, b || {}), "object" == typeof this ? a(this) : !1
37092            },
37093            destroy: function() {
37094                return a(this).off(".boxer")
37095            },
37096            resize: function(b) {
37097                return "undefined" != typeof J.$boxer && ("object" != typeof b && (J.targetHeight = arguments[0], J.targetWidth = arguments[1]), "element" === J.type ? w(J.$content.find(">:first-child")) : "image" === J.type ? l() : "video" === J.type && o(), g()), a(this)
37098            }
37099        };
37100    a.fn.boxer = function(a) {
37101        return M[a] ? M[a].apply(this, Array.prototype.slice.call(arguments, 1)) : "object" != typeof a && a ? this : c.apply(this, arguments)
37102    }, a.boxer = function(c, e) {
37103        return M[c] ? M[c].apply(b, Array.prototype.slice.call(arguments, 1)) : c instanceof a ? d.apply(b, [{
37104            data: a.extend({
37105                $object: c
37106            }, L, e || {})
37107        }]) : void 0
37108    }
37109}(jQuery, window);
37110/**
37111 * jquery.slimmenu.js
37112 * http://adnantopal.github.io/slimmenu/
37113 * Author: @adnantopal
37114 * Copyright 2013-2015, Adnan Topal (adnan.co)
37115 * Licensed under the MIT license.
37116 */
37117(function ($, window, document, undefined) {
37118    "use strict";
37119
37120    var pluginName = 'slimmenu',
37121        oldWindowWidth = 0,
37122        defaults = {
37123            resizeWidth: '767',
37124            initiallyVisible: false,
37125            collapserTitle: 'Main Menu',
37126            animSpeed: 'medium',
37127            easingEffect: null,
37128            indentChildren: false,
37129            childrenIndenter: '&nbsp;&nbsp;',
37130            expandIcon: '<i><span class="fa fa-caret-right"></span></i>',
37131            collapseIcon: '<i><span class="fa fa-caret-down"></span></i>'
37132        };
37133
37134    function Plugin(element, options) {
37135        this.element = element;
37136        this.$elem = $(this.element);
37137        this.options = $.extend(defaults, options);
37138        this.init();
37139    }
37140
37141    Plugin.prototype = {
37142
37143        init: function () {
37144            var $window = $(window),
37145                options = this.options,
37146                $menu = this.$elem,
37147                $collapser = '<div class="menu-collapser-1">' + options.collapserTitle + '<div class="collapse-button"><span class="icon-bar"></span><span class="icon-bar"></span><span class="icon-bar"></span></div></div>',
37148                $menuCollapser;
37149
37150            //$menu.before($collapser);
37151            //$menuCollapser = $menu.prev('.menu-collapser-1');
37152            //$('.navbar-header').append($collapser);
37153            $menuCollapser = $('.navbar-header .menu-collapser-1');
37154
37155            $menu.on('click', '.sub-toggle', function (e) {
37156                e.preventDefault();
37157                e.stopPropagation();
37158
37159                var $parentLi = $(this).closest('li');
37160
37161                if ($(this).hasClass('expanded')) {
37162                    $(this).removeClass('expanded').html(options.expandIcon);
37163                    $parentLi.find('>
37163ul').slideUp(options.animSpeed, options.easingEffect);
37164                } else {
37165                    $(this).addClass('expanded').html(options.collapseIcon);
37166                    $parentLi.find('>ul').slideDown(options.animSpeed, options.easingEffect);
37167                }
37168            });
37169
37170            $menuCollapser.on('click', '.navbar-toggle', function (e) {
37171                e.preventDefault();
37172                $menu.slideToggle(options.animSpeed, options.easingEffect);
37173            });
37174
37175            this.resizeMenu();
37176            $window.on('resize', this.resizeMenu.bind(this));
37177            $window.trigger('resize');
37178        },
37179
37180        resizeMenu: function () {
37181            var self = this,
37182                $window = $(window),
37183                windowWidth = $window.width(),
37184                $options = this.options,
37185                $menu = $(this.element),
37186                $menuCollapser = $('body').find('.menu-collapser-1');
37187
37188            if (window['innerWidth'] !== undefined) {
37189                if (window['innerWidth'] > windowWidth) {
37190                    windowWidth = window['innerWidth'];
37191                }
37192            }
37193
37194            if (windowWidth != oldWindowWidth) {
37195                oldWindowWidth = windowWidth;
37196
37197                $menu.find('li').each(function () {
37198                    if ($(this).has('ul').length) {
37199                        if ($(this).addClass('has-submenu').has('.sub-toggle').length) {
37200                            $(this).children('.sub-toggle').html($options.expandIcon);
37201                        } else {
37202                            $(this).addClass('has-submenu').append('<span class="sub-toggle">' + $options.expandIcon + '</span>');
37203                        }
37204                    }
37205
37206                    $(this).children('ul').hide().end().find('.sub-toggle').removeClass('expanded').html($options.expandIcon);
37207                });
37208
37209                if ($options.resizeWidth >= windowWidth) {
37210                    if ($options.indentChildren) {
37211                        $menu.find('ul').each(function () {
37212                            var $depth = $(this).parents('ul').length;
37213                            if (!$(this).children('li').children('a').has('i').length) {
37214                                $(this).children('li').children('a').prepend(self.indent($depth, $options));
37215                            }
37216                        });
37217                    }
37218
37219                    $menu.addClass('collapsed').find('li').has('ul').off('mouseenter mouseleave');
37220                    $menuCollapser.show();
37221
37222                    if (!$options.initiallyVisible) {
37223                        $menu.hide();
37224                    }
37225                } else {
37226                    $menu.find('li').has('ul')
37227                        .on('mouseenter', function () {
37228                            $(this).find('>ul').stop().slideDown($options.animSpeed, $options.easingEffect);
37229                        })
37230                        .on('mouseleave', function () {
37231                            $(this).find('>ul').stop().slideUp($options.animSpeed, $options.easingEffect);
37232                        });
37233
37234                    $menu.find('li > a > i').remove();
37235                    $menu.removeClass('collapsed').show();
37236                    $menuCollapser.hide();
37237                }
37238            }
37239        },
37240
37241        indent: function (num, options) {
37242            var i = 0,
37243                $indent = '';
37244            for (; i < num; i++) {
37245                $indent += options.childrenIndenter;
37246            }
37247            return '<i>' + $indent + '</i> ';
37248        }
37249    };
37250
37251    $.fn[pluginName] = function (options) {
37252        return this.each(function () {
37253            if (!$.data(this, 'plugin_' + pluginName)) {
37254                $.data(this, 'plugin_' + pluginName,
37255                    new Plugin(this, options));
37256            }
37257        });
37258    };
37259
37260}(jQuery, window, document));
37261/*! Copyright (c) 2013 Brandon Aaron (http://brandon.aaron.sh)
37262 * Licensed under the MIT License (LICENSE.txt).
37263 *
37264 * Version: 3.1.11
37265 *
37266 * Requires: jQuery 1.2.2+
37267 */
37268
37269(function (factory) {
37270    if ( typeof define === 'function' && define.amd ) {
37271        // AMD. Register as an anonymous module.
37272        define(['jquery'], factory);
37273    } else if (typeof exports === 'object') {
37274        // Node/CommonJS style for Browserify
37275        module.exports = factory;
37276    } else {
37277        // Browser globals
37278        factory(jQuery);
37279    }
37280}(function ($) {
37281
37282    var toFix  = ['wheel', 'mousewheel', 'DOMMouseScroll', 'MozMousePixelScroll'],
37283        toBind = ( 'onwheel' in document || document.documentMode >= 9 ) ?
37284                    ['wheel'] : ['mousewheel', 'DomMouseScroll', 'MozMousePixelScroll'],
37285        slice  = Array.prototype.slice,
vendor: 6,375 bytes, lines 37286-37458
37286        nullLowestDeltaTimeout, lowestDelta;
37287
37288    if ( $.event.fixHooks ) {
37289        for ( var i = toFix.length; i; ) {
37290            $.event.fixHooks[ toFix[--i] ] = $.event.mouseHooks;
37291        }
37292    }
37293
37294    var special = $.event.special.mousewheel = {
37295        version: '3.1.11',
37296
37297        setup: function() {
37298            if ( this.addEventListener ) {
37299                for ( var i = toBind.length; i; ) {
37300                    this.addEventListener( toBind[--i], handler, false );
37301                }
37302            } else {
37303                this.onmousewheel = handler;
37304            }
37305            // Store the line height and page height for this particular element
37306            $.data(this, 'mousewheel-line-height', special.getLineHeight(this));
37307            $.data(this, 'mousewheel-page-height', special.getPageHeight(this));
37308        },
37309
37310        teardown: function() {
37311            if ( this.removeEventListener ) {
37312                for ( var i = toBind.length; i; ) {
37313                    this.removeEventListener( toBind[--i], handler, false );
37314                }
37315            } else {
37316                this.onmousewheel = null;
37317            }
37318            // Clean up the data we added to the element
37319            $.removeData(this, 'mousewheel-line-height');
37320            $.removeData(this, 'mousewheel-page-height');
37321        },
37322
37323        getLineHeight: function(elem) {
37324            var $parent = $(elem)['offsetParent' in $.fn ? 'offsetParent' : 'parent']();
37325            if (!$parent.length) {
37326                $parent = $('body');
37327            }
37328            return parseInt($parent.css('fontSize'), 10);
37329        },
37330
37331        getPageHeight: function(elem) {
37332            return $(elem).height();
37333        },
37334
37335        settings: {
37336            adjustOldDeltas: true, // see shouldAdjustOldDeltas() below
37337            normalizeOffset: true  // calls getBoundingClientRect for each event
37338        }
37339    };
37340
37341    $.fn.extend({
37342        mousewheel: function(fn) {
37343            return fn ? this.bind('mousewheel', fn) : this.trigger('mousewheel');
37344        },
37345
37346        unmousewheel: function(fn) {
37347            return this.unbind('mousewheel', fn);
37348        }
37349    });
37350
37351
37352    function handler(event) {
37353        var orgEvent   = event || window.event,
37354            args       = slice.call(arguments, 1),
37355            delta      = 0,
37356            deltaX     = 0,
37357            deltaY     = 0,
37358            absDelta   = 0,
37359            offsetX    = 0,
37360            offsetY    = 0;
37361        event = $.event.fix(orgEvent);
37362        event.type = 'mousewheel';
37363
37364        // Old school scrollwheel delta
37365        if ( 'detail'      in orgEvent ) { deltaY = orgEvent.detail * -1;      }
37366        if ( 'wheelDelta'  in orgEvent ) { deltaY = orgEvent.wheelDelta;       }
37367        if ( 'wheelDeltaY' in orgEvent ) { deltaY = orgEvent.wheelDeltaY;      }
37368        if ( 'wheelDeltaX' in orgEvent ) { deltaX = orgEvent.wheelDeltaX * -1; }
37369
37370        // Firefox < 17 horizontal scrolling related to DOMMouseScroll event
37371        if ( 'axis' in orgEvent && orgEvent.axis === orgEvent.HORIZONTAL_AXIS ) {
37372            deltaX = deltaY * -1;
37373            deltaY = 0;
37374        }
37375
37376        // Set delta to be deltaY or deltaX if deltaY is 0 for backwards compatabilitiy
37377        delta = deltaY === 0 ? deltaX : deltaY;
37378
37379        // New school wheel delta (wheel event)
37380        if ( 'deltaY' in orgEvent ) {
37381            deltaY = orgEvent.deltaY * -1;
37382            delta  = deltaY;
37383        }
37384        if ( 'deltaX' in orgEvent ) {
37385            deltaX = orgEvent.deltaX;
37386            if ( deltaY === 0 ) { delta  = deltaX * -1; }
37387        }
37388
37389        // No change actually happened, no reason to go any further
37390        if ( deltaY === 0 && deltaX === 0 ) { return; }
37391
37392        // Need to convert lines and pages to pixels if we aren't already in pixels
37393        // There are three delta modes:
37394        //   * deltaMode 0 is by pixels, nothing to do
37395        //   * deltaMode 1 is by lines
37396        //   * deltaMode 2 is by pages
37397        if ( orgEvent.deltaMode === 1 ) {
37398            var lineHeight = $.data(this, 'mousewheel-line-height');
37399            delta  *= lineHeight;
37400            deltaY *= lineHeight;
37401            deltaX *= lineHeight;
37402        } else if ( orgEvent.deltaMode === 2 ) {
37403            var pageHeight = $.data(this, 'mousewheel-page-height');
37404            delta  *= pageHeight;
37405            deltaY *= pageHeight;
37406            deltaX *= pageHeight;
37407        }
37408
37409        // Store lowest absolute delta to normalize the delta values
37410        absDelta = Math.max( Math.abs(deltaY), Math.abs(deltaX) );
37411
37412        if ( !lowestDelta || absDelta < lowestDelta ) {
37413            lowestDelta = absDelta;
37414
37415            // Adjust older deltas if necessary
37416            if ( shouldAdjustOldDeltas(orgEvent, absDelta) ) {
37417                lowestDelta /= 40;
37418            }
37419        }
37420
37421        // Adjust older deltas if necessary
37422        if ( shouldAdjustOldDeltas(orgEvent, absDelta) ) {
37423            // Divide all the things by 40!
37424            delta  /= 40;
37425            deltaX /= 40;
37426            deltaY /= 40;
37427        }
37428
37429        // Get a whole, normalized value for the deltas
37430        delta  = Math[ delta  >= 1 ? 'floor' : 'ceil' ](delta  / lowestDelta);
37431        deltaX = Math[ deltaX >= 1 ? 'floor' : 'ceil' ](deltaX / lowestDelta);
37432        deltaY = Math[ deltaY >= 1 ? 'floor' : 'ceil' ](deltaY / lowestDelta);
37433
37434        // Normalise offsetX and offsetY properties
37435        if ( special.settings.normalizeOffset && this.getBoundingClientRect ) {
37436            var boundingRect = this.getBoundingClientRect();
37437            offsetX = event.clientX - boundingRect.left;
37438            offsetY = event.clientY - boundingRect.top;
37439        }
37440
37441        // Add information to the event object
37442        event.deltaX = deltaX;
37443        event.deltaY = deltaY;
37444        event.deltaFactor = lowestDelta;
37445        event.offsetX = offsetX;
37446        event.offsetY = offsetY;
37447        // Go ahead and set deltaMode to 0 since we converted to pixels
37448        // Although this is a little odd since we overwrite the deltaX/Y
37449        // properties with normalized deltas.
37450        event.deltaMode = 0;
37451
37452        // Add event and delta to the front of the arguments
37453        args.unshift(event, delta, deltaX, deltaY);
37454
37455        // Clearout lowestDelta after sometime to better
37456        // handle multiple device types that give different
37457        // a different lowestDelta
37458        // Ex: trackpad = 3 and mouse wheel = 120
vendor: 7,809 bytes, lines 37459-37529
37459        if (nullLowestDeltaTimeout) { clearTimeout(nullLowestDeltaTimeout); }
37460        nullLowestDeltaTimeout = setTimeout(nullLowestDelta, 200);
37461
37462        return ($.event.dispatch || $.event.handle).apply(this, args);
37463    }
37464
37465    function nullLowestDelta() {
37466        lowestDelta = null;
37467    }
37468
37469    function shouldAdjustOldDeltas(orgEvent, absDelta) {
37470        // If this is an older event and the delta is divisable by 120,
37471        // then we are assuming that the browser is treating this as an
37472        // older mouse wheel event and that we should divide the deltas
37473        // by 40 to try and get a more usable deltaFactor.
37474        // Side note, this actually impacts the reported scroll distance
37475        // in older browsers and can cause scrolling to be slower than native.
37476        // Turn this off by setting $.event.special.mousewheel.settings.adjustOldDeltas to false.
37477        return special.settings.adjustOldDeltas && orgEvent.type === 'mousewheel' && absDelta % 120 === 0;
37478    }
37479
37480}));
37481
37482/*
37483 * jQuery Easing v1.3 - http://gsgd.co.uk/sandbox/jquery/easing/
37484 *
37485 * Uses the built in easing capabilities added In jQuery 1.1
37486 * to offer multiple easing options
37487 *
37488 * TERMS OF USE - EASING EQUATIONS
37489 * 
37490 * Open source under the BSD License. 
37491 * 
37492 * Copyright © 2001 Robert Penner
37493 * All rights reserved.
37494 *
37495 * TERMS OF USE - jQuery Easing
37496 * 
37497 * Open source under the BSD License. 
37498 * 
37499 * Copyright © 2008 George McGinley Smith
37500 * All rights reserved.
37501 *
37502 * Redistribution and use in source and binary forms, with or without modification, 
37503 * are permitted provided that the following conditions are met:
37504 * 
37505 * Redistributions of source code must retain the above copyright notice, this list of 
37506 * conditions and the following disclaimer.
37507 * Redistributions in binary form must reproduce the above copyright notice, this list 
37508 * of conditions and the following disclaimer in the documentation and/or other materials 
37509 * provided with the distribution.
37510 * 
37511 * Neither the name of the author nor the names of contributors may be used to endorse 
37512 * or promote products derived from this software without specific prior written permission.
37513 * 
37514 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY 
37515 * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
37516 * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
37517 *  COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
37518 *  EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
37519 *  GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED 
37520 * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
37521 *  NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED 
37522 * OF THE POSSIBILITY OF SUCH DAMAGE. 
37523 *
37524*/
37525jQuery.easing.jswing=jQuery.easing.swing;jQuery.extend(jQuery.easing,{def:"easeOutQuad",swing:function(e,f,a,h,g){return jQuery.easing[jQuery.easing.def](e,f,a,h,g)},easeInQuad:function(e,f,a,h,g){return h*(f/=g)*f+a},easeOutQuad:function(e,f,a,h,g){return -h*(f/=g)*(f-2)+a},easeInOutQuad:function(e,f,a,h,g){if((f/=g/2)<1){return h/2*f*f+a}return -h/2*((--f)*(f-2)-1)+a},easeInCubic:function(e,f,a,h,g){return h*(f/=g)*f*f+a},easeOutCubic:function(e,f,a,h,g){return h*((f=f/g-1)*f*f+1)+a},easeInOutCubic:function(e,f,a,h,g){if((f/=g/2)<1){return h/2*f*f*f+a}return h/2*((f-=2)*f*f+2)+a},easeInQuart:function(e,f,a,h,g){return h*(f/=g)*f*f*f+a},easeOutQuart:function(e,f,a,h,g){return -h*((f=f/g-1)*f*f*f-1)+a},easeInOutQuart:function(e,f,a,h,g){if((f/=g/2)<1){return h/2*f*f*f*f+a}return -h/2*((f-=2)*f*f*f-2)+a},easeInQuint:function(e,f,a,h,g){return h*(f/=g)*f*f*f*f+a},easeOutQuint:function(e,f,a,h,g){return h*((f=f/g-1)*f*f*f*f+1)+a},easeInOutQuint:function(e,f,a,h,g){if((f/=g/2)<1){return h/2*f*f*f*f*f+a}return h/2*((f-=2)*f*f*f*f+2)+a},easeInSine:function(e,f,a,h,g){return -h*Math.cos(f/g*(Math.PI/2))+h+a},easeOutSine:function(e,f,a,h,g){return h*Math.sin(f/g*(Math.PI/2))+a},easeInOutSine:function(e,f,a,h,g){return -h/2*(Math.cos(Math.PI*f/g)-1)+a},easeInExpo:function(e,f,a,h,g){return(f==0)?a:h*Math.pow(2,10*(f/g-1))+a},easeOutExpo:function(e,f,a,h,g){return(f==g)?a+h:h*(-Math.pow(2,-10*f/g)+1)+a},easeInOutExpo:function(e,f,a,h,g){if(f==0){return a}if(f==g){return a+h}if((f/=g/2)<1){return h/2*Math.pow(2,10*(f-1))+a}return h/2*(-Math.pow(2,-10*--f)+2)+a},easeInCirc:function(e,f,a,h,g){return -h*(Math.sqrt(1-(f/=g)*f)-1)+a},easeOutCirc:function(e,f,a,h,g){return h*Math.sqrt(1-(f=f/g-1)*f)+a},easeInOutCirc:function(e,f,a,h,g){if((f/=g/2)<1){return -h/2*(Math.sqrt(1-f*f)-1)+a}return h/2*(Math.sqrt(1-(f-=2)*f)+1)+a},easeInElastic:function(f,h,e,l,k){var i=1.70158;var j=0;var g=l;if(h==0){return e}if((h/=k)==1){return e+l}if(!j){j=k*0.3}if(g<Math.abs(l)){g=l;var i=j/4}else{var i=j/(2*Math.PI)*Math.asin(l/g)}return -(g*Math.pow(2,10*(h-=1))*Math.sin((h*k-i)*(2*Math.PI)/j))+e},easeOutElastic:function(f,h,e,l,k){var i=1.70158;var j=0;var g=l;if(h==0){return e}if((h/=k)==1){return e+l}if(!j){j=k*0.3}if(g<Math.abs(l)){g=l;var i=j/4}else{var i=j/(2*Math.PI)*Math.asin(l/g)}return g*Math.pow(2,-10*h)*Math.sin((h*k-i)*(2*Math.PI)/j)+l+e},easeInOutElastic:function(f,h,e,l,k){var i=1.70158;var j=0;var g=l;if(h==0){return e}if((h/=k/2)==2){return e+l}if(!j){j=k*(0.3*1.5)}if(g<Math.abs(l)){g=l;var i=j/4}else{var i=j/(2*Math.PI)*Math.asin(l/g)}if(h<1){return -0.5*(g*Math.pow(2,10*(h-=1))*Math.sin((h*k-i)*(2*Math.PI)/j))+e}return g*Math.pow(2,-10*(h-=1))*Math.sin((h*k-i)*(2*Math.PI)/j)*0.5+l+e},easeInBack:function(e,f,a,i,h,g){if(g==undefined){g=1.70158}return i*(f/=h)*f*((g+1)*f-g)+a},easeOutBack:function(e,f,a,i,h,g){if(g==undefined){g=1.70158}return i*((f=f/h-1)*f*((g+1)*f+g)+1)+a},easeInOutBack:function(e,f,a,i,h,g){if(g==undefined){g=1.70158}if((f/=h/2)<1){return i/2*(f*f*(((g*=(1.525))+1)*f-g))+a}return i/2*((f-=2)*f*(((g*=(1.525))+1)*f+g)+2)+a},easeInBounce:function(e,f,a,h,g){return h-jQuery.easing.easeOutBounce(e,g-f,0,h,g)+a},easeOutBounce:function(e,f,a,h,g){if((f/=g)<(1/2.75)){return h*(7.5625*f*f)+a}else{if(f<(2/2.75)){return h*(7.5625*(f-=(1.5/2.75))*f+0.75)+a}else{if(f<(2.5/2.75)){return h*(7.5625*(f-=(2.25/2.75))*f+0.9375)+a}else{return h*(7.5625*(f-=(2.625/2.75))*f+0.984375)+a}}}},easeInOutBounce:function(e,f,a,h,g){if(f<g/2){return jQuery.easing.easeInBounce(e,f*2,0,h,g)*0.5+a}return jQuery.easing.easeOutBounce(e,f*2-g,0,h,g)*0.5+h*0.5+a}});
37526
37527
37528/*! device.js 0.2.7 */
37529(function(){var a,b,c,d,e,f,g,h,i,j;b=window.device,a={},window.device=a,d=window.document.documentElement,j=window.navigator.userAgent.toLowerCase(),a.ios=function(){return a.iphone()||a.ipod()||a.ipad()},a.iphone=function(){return!a.windows()&&e("iphone")},a.ipod=function(){return e("ipod")},a.ipad=function(){return e("ipad")},a.android=function(){return!a.windows()&&e("android")},a.androidPhone=function(){return a.android()&&e("mobile")},a.androidTablet=function(){return a.android()&&!e("mobile")},a.blackberry=function(){return e("blackberry")||e("bb10")||e("rim")},a.blackberryPhone=function(){return a.blackberry()&&!e("tablet")},a.blackberryTablet=function(){return a.blackberry()&&e("tablet")},a.windows=function(){return e("windows")},a.windowsPhone=function(){return a.windows()&&e("phone")},a.windowsTablet=function(){return a.windows()&&e("touch")&&!a.windowsPhone()},a.fxos=function(){return(e("(mobile;")||e("(tablet;"))&&e("; rv:")},a.fxosPhone=function(){return a.fxos()&&e("mobile")},a.fxosTablet=function(){return a.fxos()&&e("tablet")},a.meego=function(){return e("meego")},a.cordova=function(){return window.cordova&&"file:"===location.protocol},a.nodeWebkit=function(){return"object"==typeof window.process}
37529,a.mobile=function(){return a.androidPhone()||a.iphone()||a.ipod()||a.windowsPhone()||a.blackberryPhone()||a.fxosPhone()||a.meego()},a.tablet=function(){return a.ipad()||a.androidTablet()||a.blackberryTablet()||a.windowsTablet()||a.fxosTablet()},a.desktop=function(){return!a.tablet()&&!a.mobile()},a.television=function(){var a;for(television=["googletv","viera","smarttv","internet.tv","netcast","nettv","appletv","boxee","kylo","roku","dlnadoc","roku","pov_tv","hbbtv","ce-html"],a=0;a<television.length;){if(e(television[a]))return!0;a++}return!1},a.portrait=function(){return window.innerHeight/window.innerWidth>1},a.landscape=function(){return window.innerHeight/window.innerWidth<1},a.noConflict=function(){return window.device=b,this},e=function(a){return-1!==j.indexOf(a)},g=function(a){var b;return b=new RegExp(a,"i"),d.className.match(b)},c=function(a){var b=null;g(a)||(b=d.className.replace(/^\s+|\s+$/g,""),d.className=b+" "+a)},i=function(a){g(a)&&(d.className=d.className.replace(" "+a,""))},a.ios()?a.ipad()?c("ios ipad tablet"):a.iphone()?c("ios iphone mobile"):a.ipod()&&c("ios ipod mobile"):a.android()?c(a.androidTablet()?"android tablet":"android mobile"):a.blackberry()?c(a.blackberryTablet()?"blackberry tablet":"blackberry mobile"):a.windows()?c(a.windowsTablet()?"windows tablet":a.windowsPhone()?"windows mobile":"desktop"):a.fxos()?c(a.fxosTablet()?"fxos tablet":"fxos mobile"):a.meego()?c("meego mobile"):a.nodeWebkit()?c("node-webkit"):a.television()?c("television"):a.desktop()&&c("desktop"),a.cordova()&&c("cordova"),f=function(){a.landscape()?(i("portrait"),c("landscape")):(i("landscape"),c("portrait"))},h=Object.prototype.hasOwnProperty.call(window,"onorientationchange")?"orientationchange":"resize",window.addEventListener?window.addEventListener(h,f,!1):window.attachEvent?window.attachEvent(h,f):window[h]=f,f(),"function"==typeof define&&"object"==typeof define.amd&&define.amd?define(function(){return a}):"undefined"!=typeof module&&module.exports?module.exports=a:window.device=a}).call(this);
37530/*
37531 * jQuery unwrapUntil plugin
37532 * 
37533 * The MIT License
37534 * 
37535 * Copyright (c) 2012 James Allardice
37536 * 
37537 * Permission is hereby granted, free of charge, to any person obtaining a copy
37538 * of this software and associated documentation files (the "Software"), to deal
37539 * in the Software without restriction, including without limitation the rights
37540 * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
37541 * copies of the Software, and to permit persons to whom the Software is
37542 * furnished to do so, subject to the following conditions:
37543 * 
37544 * The above copyright notice and this permission notice shall be included in
37545 * all copies or substantial portions of the Software.
37546 * 
37547 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
37548 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
37549 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
37550 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
37551 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
37552 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
37553 * THE SOFTWARE.
37554 */
37555(function($) {
37556	$.fn.unwrapUntil = function() {
37557		var arg = arguments[0],
37558			type = typeof arguments[0];
37559		if(type === "number") {
37560			//Argument is a number, remove that number of ancestor elements
37561			$.each(this, function() {
37562				var $this = $(this);
37563				for(var i = 0; i < arg; i++) {
37564					$this.unwrap();
37565				}
37566			});
37567		}
37568		else if(type === "string") {
37569			//Argument is a selector string, remove ancestor elements until the parent matches the selector
37570			$.each(this, function() {
37571				var $this = $(this);
37572				if($this.closest(arg).length > 0) {
37573					while($this.parent(arg).length === 0) {
37574						$this.unwrap();
37575					}
37576				}
37577			});
37578		}
37579		else if(type === "object") {
37580			//Argument is an object, remove ancestor elements until the parent is equal to that object
37581			$.each(this, function() {
37582				var $this = $(this);
37583				if($this.closest(arg).length > 0) {
37584					while($this.parent()[0] !== arg[0]) {
37585						$this.unwrap();
37586					}
37587				}
37588			});
37589		}
37590		return this;
37591	};
37592})(jQuery);
37593$(document).ready(function(){
37594
37595if ($('#fullpage').length > 0) {
37596
37597	/** INITIAL SETUP **/
37598	var ninjaScroll = {
37599
37600		// Modify these parameters
37601		minWidth	: 319, // Change to minimum window width that this plugin will apply to.
37602		speed		: 900, // Change to desired scroll speed
37603		easing		: 'easeInOutCubic', // Change to desired easing type ( visit http://easings.net/ )
37604		// End: Modify these parameters
37605		
37606		winH 		: $(window).height(),
37607		winW		: $(window).width(),
37608		winRatio	: this.winW / this.winH,
37609		sectionQty	: $('.ss-window').length,
37610		linkQty		: $('.ss-link').length,
37611		hasNav		: true,
37612		done		: true,
37613		next		: 0,
37614		offTop		: 0,
37615		linkIndex	: 0,
37616		scrollCheck	: 0,
37617		landscape	: '',
37618		portrait	: '',
37619		href		: ''
37620		
37621	};
37622
37623	if (ninjaScroll.winRatio > 1) {
37624		ninjaScroll.landscape = true;
37625		ninjaScroll.portrait = false;
37626	}	
37627	else {
37628		ninjaScroll.landscape = false;
37629		ninjaScroll.portrait = true;
37630	}
37631
37632	$('html,body').animate({
37633
37634		scrollTop: 0
37635
37636	},100);
37637
37638
37639	if ( ninjaScroll.sectionQty == ninjaScroll.linkQty ) {
37640
37641		ninjaScroll.hasNav = true;
37642		
37643	}
37644
37645
37646
37647	/** WINDOW SIZING FUNCTIONS **/
37648	if (ninjaScroll.winW > ninjaScroll.minWidth) { // If device is not a touch-device, and if the width of the window is big enough
37649		
37650		// FUNCTION: Make each SS-Window the height of the browser window
37651		ninjaScroll.fullPage = function() {
37652			
37653			ninjaScroll.winH = $(window).height();
37654			ninjaScroll.winW = $(window).width();
37655			ninjaScroll.winRatio = ninjaScroll.winW / ninjaScroll.winH;
37656			
37657			if (ninjaScroll.winRatio > 1) {
37658				ninjaScroll.landscape = true;
37659				ninjaScroll.portrait = false;
37660			}	
37661			else {
37662				ninjaScroll.landscape = false;
37663				ninjaScroll.portrait = true;
37664			}
37665			
37666			$('.ss-window').each(function(){
37667				if (!$(this).hasClass('footer')) {
37668
37669					if (!$(this).hasClass('navbar')) {
37670						$(this).height(ninjaScroll.winH);
37671						$(this).children(ninjaScroll.winH);
37672					}
37673				}
37674			
37675			});
37676			
37677			// Adding these classes to the body may assist you with various styling changes you want to make via CSS.
37678			if (ninjaScroll.portrait) {
37679				$('body').addClass('portrait').removeClass('landscape');
37680			}
37681			else {
37682				$('body').addClass('landscape').removeClass('portrait');
37683			}
37684			
37685		}
37686		
37687		// Run Function on document ready.
37688		ninjaScroll.fullPage();
37689
37690		// Run Function on window resize.
37691		$(window).resize(function(){
37692
37693			ninjaScroll.fullPage();
37694
37695		});
37696
37697		$(".leftarrow").on('click',function(e) {
37698			if(ninjaScroll.done) {
37699
37700				ninjaScroll.done = false;
37701
37702			if (e.which == 1) {
37703			    	/*console.log("if");*/
37704			    	ninjaScroll.next = ninjaScroll.next - 1;
37705					if (ninjaScroll.next < 0) {
37706						ninjaScroll.next = 0;
37707					}
37708				}
37709				ninjaScroll.offTop = $('.ss-window').eq(ninjaScroll.next).offset().top;
37710				
37711				$('body,html').animate({
37712				
37713					scrollTop: ninjaScroll.offTop
37714					
37715					}, ninjaScroll.speed, ninjaScroll.easing, function(){
37716						ninjaScroll.done = true;
37717						
37718						if (ninjaScroll.hasNav) {
37719						
37720							$('.ss-window video').each(function() {
37721							    $(this).get(0).pause();
37722							});
37723							$('.ss-window iframe').each(function() {
37724								$(this)[0].contentWindow.postMessage('{"event":"command","func":"' + 'pauseVideo' + '","args":""}', '*');
37725							});
37726							$('.ss-window').removeClass('current');
37727							$('.ss-window').eq(ninjaScroll.next).addClass('current');
37728							$('.ss-window').eq(ninjaScroll.next).find('.post-amination').removeClass('hidden');
37729							$('.ss-window').eq(ninjaScroll.next).find('.post-amination').addClass('visible animated');
37730							if ($('.ss-window').eq(ninjaScroll.next).find('video').length > 0) {
37731								$('.ss-window').eq(ninjaScroll.next).find('video').get(0).play();
37732							}
37733							if ($('.ss-window').eq(ninjaScroll.next).find('iframe').length > 0) {
37734								$('.ss-window').eq(ninjaScroll.next).find('iframe')[0].contentWindow.postMessage('{"event":"command","func":"' + 'playVideo' + '","args":""}', '*');
37735							}
37736							$('.ss-link').removeClass('current');
37737							$('.ss-link').eq(ninjaScroll.next).addClass('current');
37738
37739							var idofcurrent =  $('.ss-window').eq(ninjaScroll.next).attr('id');
37740
37741							var currentUrl = window.location.href;
37742							var hash = window.location.hash;
37743							if(currentUrl.length){
37744					            //getting the anchor link in the URL and deleting the `#`
37745					            var anchorsParts =  currentUrl.replace(hash, '#'+idofcurrent);
37746					            history.pushState(null, '', anchorsParts);
37747					        }
37748							/*if ($('.ss-window').eq(ninjaScroll.next).find('iframe').length > 0) {
37749								var symbol = $('.ss-window').eq(ninjaScroll.next).find('iframe')[0].src.indexOf("?") > -1 ? "&" : "?";
37750							  	$('.ss-window').eq(ninjaScroll.next).find('iframe')[0].src += symbol + "autoplay=1";
37751							}*/
37752						}
37753						
37754				});
37755				e.preventDefault();
37756			}
37757		});
37758
37759		$(".rightarrow").on('click',function(e) {
37760			if(ninjaScroll.done) {
37761
37762				ninjaScroll.done = false;			
37763			/*ninjaScroll.done = false;*/
37764			
37765			    if (e.which == 1) {
37766			    	ninjaScroll.next = ninjaScroll.next + 1;
37767					if (ninjaScroll.next == ninjaScroll.sectionQty) {
37768						ninjaScroll.next = ninjaScroll.sectionQty - 1;
37769					}
37770			    }
37771			    ninjaScroll.offTop = $('.ss-window').eq(ninjaScroll.next).offset().top;
37772				
37773				$('body,html').animate({
37774				
37775					scrollTop: ninjaScroll.offTop
37776					
37777					}, ninjaScroll.speed, ninjaScroll.easing, function(){
37778						ninjaScroll.done = true;
37779						
37780						if (ninjaScroll.hasNav) {
37781						
37782							$('.ss-window video').each(function() {
37783							    $(this).get(0).pause();
37784							});
37785							$('.ss-window iframe').each(function() {
37786								$(this)[0].contentWindow.postMessage('{"event":"command","func":"' + 'pauseVideo' + '","args":""}', '*');
37787							});
37788							$('.ss-window').removeClass('current');
37789							$('.ss-window').eq(ninjaScroll.next).addClass('current');
37790							$('.ss-window').eq(ninjaScroll.next).find('.post-amination').removeClass('hidden');
37791							$('.ss-window').eq(ninjaScroll.next).find('.post-amination').addClass('visible animated');
37792							if ($('.ss-window').eq(ninjaScroll.next).find('video').length > 0) {
37793								$('.ss-window').eq(ninjaScroll.next).find('video').get(0).play();
37794							}
37795							if ($('.ss-window').eq(ninjaScroll.next).find('iframe').length > 0) {
37796								$('.ss-window').eq(ninjaScroll.next).find('iframe')[0].contentWindow.postMessage('{"event":"command","func":"' + 'playVideo' + '","args":""}', '*');
37797							}
37798							$('.ss-link').removeClass('current');
37799							$('.ss-link').eq(ninjaScroll.next).addClass('current');
37800
37801							var idofcurrent =  $('.ss-window').eq(ninjaScroll.next).attr('id');
37802
37803							var currentUrl = window.location.href;
37804							var hash = window.location.hash;
37805							if(currentUrl.length){
37806					            //getting the anchor link in the URL and deleting the `#`
37807					            var anchorsParts =  currentUrl.replace(hash, '#'+idofcurrent);
37808					            history.pushState(null, '', anchorsParts);
37809					        }
37810							/*if ($('.ss-window').eq(ninjaScroll.next).find('iframe').length > 0) {
37811								var symbol = $('.ss-window').eq(ninjaScroll.next).find('iframe')[0].src.indexOf("?") > -1 ? "&" : "?";
37812							  	$('.ss-window').eq(ninjaScroll.next).find('iframe')[0].src += symbol + "autoplay=1";
37813							}*/
37814						}
37815						
37816				});
37817				e.preventDefault();
37818			}
37819		});
37820
37821	}
37822
37823
37824	$('.ss-window video').each(function() {
37825	    $(this).get(0).pause();
37826	});
37827	setTimeout(function(){ 
37828		$('.ss-window iframe').each(function() {
37829			$(this)[0].contentWindow.postMessage('{"event":"command","func":"' + 'stopVideo' + '","args":""}', '*');
37830		});
37831	}, 2000);
37832
37833	var geturl = getAnchorsURL();
37834	setTimeout(function(){ 
37835		if (geturl['urldata']) {
37836			$('.'+geturl['urldata']).click();
37837		}
37838	}, 2000);
37839
37840	/** SNAP SCROLLING **/
37841	if (!is_touch_device() && (ninjaScroll.winW > ninjaScroll.minWidth)) { // If device is not a touch-device, and if the width of the window is big enough
37842		
37843		
37844		$('body').mousewheel(function(event,delta){
37845			
37846			if(ninjaScroll.done) {
37847				
37848				ninjaScroll.done = false;
37849			
37850				if (delta < 0) {
37851				
37852					ninjaScroll.next = ninjaScroll.next + 1;
37853					if (ninjaScroll.next == ninjaScroll.sectionQty) {
37854						ninjaScroll.next = ninjaScroll.sectionQty - 1;
37855					}
37856				
37857				}
37858				else {
37859					
37860					ninjaScroll.next = ninjaScroll.next - 1;
37861					if (ninjaScroll.next < 0) {
37862						ninjaScroll.next = 0;
37863					}				
37864					
37865				}
37866				
37867				ninjaScroll.offTop = $('.ss-window').eq(ninjaScroll.next).offset().top;
37868				
37869				$('body,html').animate({
37870				
37871					scrollTop: ninjaScroll.offTop
37872					
37873					}, ninjaScroll.speed, ninjaScroll.easing, function(){
37874						ninjaScroll.done = true;
37875						
37876						if (ninjaScroll.hasNav) {
37877						
37878							$('.ss-window video').each(function() {
37879							    $(this).get(0).pause();
37880							});
37881							$('.ss-window iframe').each(function() {
37882								$(this)[0].contentWindow.postMessage('{"event":"command","func":"' + 'pauseVideo' + '","args":""}', '*');
37883							});
37884							$('.ss-window').removeClass('current');
37885							$('.ss-window').eq(ninjaScroll.next).addClass('current');
37886							$('.ss-window').eq(ninjaScroll.next).find('.post-amination').removeClass('hidden');
37887							$('.ss-window').eq(ninjaScroll.next).find('.post-amination').addClass('visible animated');
37888							if ($('.ss-window').eq(ninjaScroll.next).find('video').length > 0) {
37889								$('.ss-window').eq(ninjaScroll.next).find('video').get(0).play();
37890							}
37891							if ($('.ss-window').eq(ninjaScroll.next).find('iframe').length > 0) {
37892								$('.ss-window').eq(ninjaScroll.next).find('iframe')[0].contentWindow.postMessage('{"event":"command","func":"' + 'playVideo' + '","args":""}', '*');
37893							}
37894							$('.ss-link').removeClass('current');
37895							$('.ss-link').eq(ninjaScroll.next).addClass('current');
37896
37897							var idofcurrent =  $('.ss-window').eq(ninjaScroll.next).attr('id');
37898
37899							var currentUrl = window.location.href;
37900							var hash = window.location.hash;
37901							if(currentUrl.length){
37902					            //getting the anchor link in the URL and deleting the `#`
37903					            var anchorsParts =  currentUrl.replace(hash, '#'+idofcurrent);
37904					            history.pushState(null, '', anchorsParts);
37905					        }
37906							/*if ($('.ss-window').eq(ninjaScroll.next).find('iframe').length > 0) {
37907								var symbol = $('.ss-window').eq(ninjaScroll.next).find('iframe')[0].src.indexOf("?") > -1 ? "&" : "?";
37908							  	$('.ss-window').eq(ninjaScroll.next).find('iframe')[0].src += symbol + "autoplay=1";
37909							}*/
37910						}
37911						
37912				});
37913				
37914			}
37915			
37916			event.preventDefault();
37917
37918		});
37919
37920		$(".leftarrow").on('click',function(e) {
37921			if(ninjaScroll.done) {
37922
37923				ninjaScroll.done = false;
37924
37925				/*ninjaScroll.done = false;*/
37926			    if (e.which == 1) {
37927			    	/*console.log("if");*/
37928			    	ninjaScroll.next = ninjaScroll.next - 1;
37929					if (ninjaScroll.next < 0) {
37930						ninjaScroll.next = 0;
37931					}
37932				}
37933				ninjaScroll.offTop = $('.ss-window').eq(ninjaScroll.next).offset().top;
37934				
37935				$('body,html').animate({
37936				
37937					scrollTop: ninjaScroll.offTop
37938					
37939					}, ninjaScroll.speed, ninjaScroll.easing, function(){
37940						ninjaScroll.done = true;
37941						
37942						if (ninjaScroll.hasNav) {
37943						
37944							$('.ss-window video').each(function() {
37945							    $(this).get(0).pause();
37946							});
37947							$('.ss-window iframe').each(function() {
37948								$(this)[0].contentWindow.postMessage('{"event":"command","func":"' + 'pauseVideo' + '","args":""}', '*');
37949							});
37950							$('.ss-window').removeClass('current');
37951							$('.ss-window').eq(ninjaScroll.next).addClass('current');
37952							$('.ss-window').eq(ninjaScroll.next).find('.post-amination').removeClass('hidden');
37953							$('.ss-window').eq(ninjaScroll.next).find('.post-amination').addClass('visible animated');
37954							if ($('.ss-window').eq(ninjaScroll.next).find('video').length > 0) {
37955								$('.ss-window').eq(ninjaScroll.next).find('video').get(0).play();
37956							}
37957							if ($('.ss-window').eq(ninjaScroll.next).find('iframe').length > 0) {
37958								$('.ss-window').eq(ninjaScroll.next).find('iframe')[0].contentWindow.postMessage('{"event":"command","func":"' + 'playVideo' + '","args":""}', '*');
37959							}
37960							$('.ss-link').removeClass('current');
37961							$('.ss-link').eq(ninjaScroll.next).addClass('current');
37962
37963							var idofcurrent =  $('.ss-window').eq(ninjaScroll.next).attr('id');
37964
37965							var currentUrl = window.location.href;
37966							var hash = window.location.hash;
37967							if(currentUrl.length){
37968					            //getting the anchor link in the URL and deleting the `#`
37969					            var anchorsParts =  currentUrl.replace(hash, '#'+idofcurrent);
37970					            history.pushState(null, '', anchorsParts);
37971					        }
37972							/*if ($('.ss-window').eq(ninjaScroll.next).find('iframe').length > 0) {
37973								var symbol = $('.ss-window').eq(ninjaScroll.next).find('iframe')[0].src.indexOf("?") > -1 ? "&" : "?";
37974							  	$('.ss-window').eq(ninjaScroll.next).find('iframe')[0].src += symbol + "autoplay=1";
37975							}*/
37976						}
37977						
37978				});
37979				e.preventDefault();
37980			}
37981		});
37982
37983		$(".rightarrow").on('click',function(e) {
37984			if(ninjaScroll.done) {
37985
37986				ninjaScroll.done = false;
37987			/*ninjaScroll.done = false;*/
37988			
37989			    if (e.which == 1) {
37990			    	ninjaScroll.next = ninjaScroll.next + 1;
37991					if (ninjaScroll.next == ninjaScroll.sectionQty) {
37992						ninjaScroll.next = ninjaScroll.sectionQty - 1;
37993					}
37994			    }
37995			    ninjaScroll.offTop = $('.ss-window').eq(ninjaScroll.next).offset().top;
37996				
37997				$('body,html').animate({
37998				
37999					scrollTop: ninjaScroll.offTop
38000					
38001					}, ninjaScroll.speed, ninjaScroll.easing, function(){
38002						ninjaScroll.done = true;
38003						
38004						if (ninjaScroll.hasNav) {
38005						
38006							$('.ss-window video').each(function() {
38007							    $(this).get(0).pause();
38008							});
38009							$('.ss-window iframe').each(function() {
38010								$(this)[0].contentWindow.postMessage('{"event":"command","func":"' + 'pauseVideo' + '","args":""}', '*');
38011							});
38012							$('.ss-window').removeClass('current');
38013							$('.ss-window').eq(ninjaScroll.next).addClass('current');
38014							$('.ss-window').eq(ninjaScroll.next).find('.post-amination').removeClass('hidden');
38015							$('.ss-window').eq(ninjaScroll.next).find('.post-amination').addClass('visible animated');
38016							if ($('.ss-window').eq(ninjaScroll.next).find('video').length > 0) {
38017								$('.ss-window').eq(ninjaScroll.next).find('video').get(0).play();
38018							}
38019							if ($('.ss-window').eq(ninjaScroll.next).find('iframe').length > 0) {
38020								$('.ss-window').eq(ninjaScroll.next).find('iframe')[0].contentWindow.postMessage('{"event":"command","func":"' + 'playVideo' + '","args":""}', '*');
38021							}
38022							$('.ss-link').removeClass('current');
38023							$('.ss-link').eq(ninjaScroll.next).addClass('current');
38024
38025							var idofcurrent =  $('.ss-window').eq(ninjaScroll.next).attr('id');
38026
38027							var currentUrl = window.location.href;
38028							var hash = window.location.hash;
38029							if(currentUrl.length){
38030					            //getting the anchor link in the URL and deleting the `#`
38031					            var anchorsParts =  currentUrl.replace(hash, '#'+idofcurrent);
38032					            history.pushState(null, '', anchorsParts);
38033					        }
38034							/*if ($('.ss-window').eq(ninjaScroll.next).find('iframe').length > 0) {
38035								var symbol = $('.ss-window').eq(ninjaScroll.next).find('iframe')[0].src.indexOf("?") > -1 ? "&" : "?";
38036							  	$('.ss-window').eq(ninjaScroll.next).find('iframe')[0].src += symbol + "autoplay=1";
38037							}*/
38038						}
38039						
38040				});
38041				e.preventDefault();
38042			}
38043		});
38044
38045		$(document).keydown(function(e) {
38046
38047			if(ninjaScroll.done) {
38048
38049				ninjaScroll.done = false;
38050
38051			    if (e.which == 38) {
38052			    	ninjaScroll.next = ninjaScroll.next - 1;
38053					if (ninjaScroll.next < 0) {
38054						ninjaScroll.next = 0;
38055					}
38056			    }
38057			    if (e.which == 40) {
38058			    	ninjaScroll.next = ninjaScroll.next + 1;
38059					if (ninjaScroll.next == ninjaScroll.sectionQty) {
38060						ninjaScroll.next = ninjaScroll.sectionQty - 1;
38061					}
38062			    }
38063			    
38064
38065		    	ninjaScroll.offTop = $('.ss-window').eq(ninjaScroll.next).offset().top;
38066				
38067				$('body,html').animate({
38068				
38069					scrollTop: ninjaScroll.offTop
38070					
38071					}, ninjaScroll.speed, ninjaScroll.easing, function(){
38072						ninjaScroll.done = true;
38073						
38074						if (ninjaScroll.hasNav) {
38075						
38076							$('.ss-window video').each(function() {
38077							    $(this).get(0).pause();
38078							});
38079							$('.ss-window iframe').each(function() {
38080								$(this)[0].contentWindow.postMessage('{"event":"command","func":"' + 'pauseVideo' + '","args":""}', '*');
38081							});
38082							$('.ss-window').removeClass('current');
38083							$('.ss-window').eq(ninjaScroll.next).addClass('current');
38084							$('.ss-window').eq(ninjaScroll.next).find('.post-amination').removeClass('hidden');
38085							$('.ss-window').eq(ninjaScroll.next).find('.post-amination').addClass('visible animated');
38086							if ($('.ss-window').eq(ninjaScroll.next).find('video').length > 0) {
38087								$('.ss-window').eq(ninjaScroll.next).find('video').get(0).play();
38088							}
38089							if ($('.ss-window').eq(ninjaScroll.next).find('iframe').length > 0) {
38090								$('.ss-window').eq(ninjaScroll.next).find('iframe')[0].contentWindow.postMessage('{"event":"command","func":"' + 'playVideo' + '","args":""}', '*');
38091							}
38092							$('.ss-link').removeClass('current');
38093							$('.ss-link').eq(ninjaScroll.next).addClass('current');
38094
38095							var idofcurrent =  $('.ss-window').eq(ninjaScroll.next).attr('id');
38096
38097							var currentUrl = window.location.href;
38098							var hash = window.location.hash;
38099							if(currentUrl.length){
38100					            //getting the anchor link in the URL and deleting the `#`
38101					            var anchorsParts =  currentUrl.replace(hash, '#'+idofcurrent);
38102					            history.pushState(null, '', anchorsParts);
38103					        }
38104							/*if ($('.ss-window').eq(ninjaScroll.next).find('iframe').length > 0) {
38105								var symbol = $('.ss-window').eq(ninjaScroll.next).find('iframe')[0].src.indexOf("?") > -1 ? "&" : "?";
38106							  	$('.ss-window').eq(ninjaScroll.next).find('iframe')[0].src += symbol + "autoplay=1";
38107							}*/
38108						}
38109						
38110				});
38111			}
38112
38113		    e.preventDefault(); // prevent the default action (scroll / move caret)
38114		});
38115
38116		// NAV CLICKS
38117		var i = 0;
38118		$('.ss-window').each(function(){
38119		
38120			$(this).attr('data-index', i);
38121			i += 1;
38122		
38123		});
38124
38125		//$('footer.footer').attr('data-index', i);
38126
38127		$('a.ss-link').click(function(event){
38128
38129			event.preventDefault();
38130
38131			if (ninjaScroll.done) {
38132			
38133				ninjaScroll.done = false;
38134				ninjaScroll.href = $(this).attr('href');
38135				ninjaScroll.next = parseFloat( $(ninjaScroll.href).attr('data-index') );
38136				
38137				
38138				
38139				$('html, body').animate({
38140
38141					scrollTop: $(ninjaScroll.href).offset().top
38142
38143				}, ninjaScroll.speed, ninjaScroll.easing, function(){
38144					ninjaScroll.done = true;
38145					
38146					if (ninjaScroll.hasNav) {
38147						
38148						$('.ss-window video').each(function() {
38149						    $(this).get(0).pause();
38150						});
38151						$('.ss-window iframe').each(function() {
38152							$(this)[0].contentWindow.postMessage('{"event":"command","func":"' + 'pauseVideo' + '","args":""}', '*');
38153						});
38154						$('.ss-window').removeClass('current');
38155						$('.ss-window').eq(ninjaScroll.next).addClass('current');
38156						$('.ss-window').eq(ninjaScroll.next).find('.post-amination').removeClass('hidden');
38157						$('.ss-window').eq(ninjaScroll.next).find('.post-amination').addClass('visible animated');
38158						if ($('.ss-window').eq(ninjaScroll.next).find('video').length > 0) {
38159							$('.ss-window').eq(ninjaScroll.next).find('video').get(0).play();
38160						}
38161						if ($('.ss-window').eq(ninjaScroll.next).find('iframe').length > 0) {
38162							$('.ss-window').eq(ninjaScroll.next).find('iframe')[0].contentWindow.postMessage('{"event":"command","func":"' + 'playVideo' + '","args":""}', '*');
38163						}
38164						$('.ss-link').removeClass('current');
38165						$('.ss-link').eq(ninjaScroll.next).addClass('current');
38166						
38167						var idofcurrent =  $('.ss-window').eq(ninjaScroll.next).attr('id');
38168
38169						var currentUrl = window.location.href;
38170						var hash = window.location.hash;
38171						if(currentUrl.length){
38172				            //getting the anchor link in the URL and deleting the `#`
38173				            var anchorsParts =  currentUrl.replace(hash, '#'+idofcurrent);
38174				            history.pushState(null, '', anchorsParts);
38175				        }
38176					}
38177						
38178				});
38179			
38180			}
38181
38182		});
38183		
38184	}
38185	else {
38186
38187		// NAV CLICKS
38188		var i = 0;
38189		$('.ss-window').each(function(){
38190		
38191			$(this).attr('data-index', i);
38192			i += 1;
38193		
38194		});
38195		// NAV CLICKS
38196		$('a.ss-link').click(function(event){
38197
38198			event.preventDefault();
38199
38200			if (ninjaScroll.done) {
38201			
38202				ninjaScroll.done = false;
38203				ninjaScroll.href = $(this).attr('href');
38204				ninjaScroll.next = parseFloat( $(ninjaScroll.href).attr('data-index') );
38205				
38206				
38207				
38208				$('html, body').animate({
38209
38210					scrollTop: $(ninjaScroll.href).offset().top
38211
38212				}, ninjaScroll.speed, ninjaScroll.easing, function(){
38213					ninjaScroll.done = true;
38214					
38215					if (ninjaScroll.hasNav) {
38216						
38217						$('.ss-window video').each(function() {
38218						    $(this).get(0).pause();
38219						});
38220						$('.ss-window iframe').each(function() {
38221							$(this)[0].contentWindow.postMessage('{"event":"command","func":"' + 'pauseVideo' + '","args":""}', '*');
38222						});
38223						$('.ss-window').removeClass('current');
38224						$('.ss-window').eq(ninjaScroll.next).addClass('current');
38225						$('.ss-window').eq(ninjaScroll.next).find('.post-amination').removeClass('hidden');
38226						$('.ss-window').eq(ninjaScroll.next).find('.post-amination').addClass('visible animated');
38227						if ($('.ss-window').eq(ninjaScroll.next).find('video').length > 0) {
38228							$('.ss-window').eq(ninjaScroll.next).find('video').get(0).play();
38229						}
38230						if ($('.ss-window').eq(ninjaScroll.next).find('iframe').length > 0) {
38231							$('.ss-window').eq(ninjaScroll.next).find('iframe')[0].contentWindow.postMessage('{"event":"command","func":"' + 'playVideo' + '","args":""}', '*');
38232						}
38233						$('.ss-link').removeClass('current');
38234						$('.ss-link').eq(ninjaScroll.next).addClass('current');
38235						
38236						var idofcurrent =  $('.ss-window').eq(ninjaScroll.next).attr('id');
38237
38238						var currentUrl = window.location.href;
38239						var hash = window.location.hash;
38240						if(currentUrl.length){
38241				            //getting the anchor link in the URL and deleting the `#`
38242				            var anchorsParts =  currentUrl.replace(hash, '#'+idofcurrent);
38243				            history.pushState(null, '', anchorsParts);
38244				        }
38245					}
38246						
38247				});
38248			
38249			}
38250
38251		});
38252
38253	}
38254
38255	if (is_touch_device()){
38256    	$('.post-amination').removeClass('hidden');
38257	}
38258
38259	function is_touch_device() {
38260	 return (('ontouchstart' in window)
38261	      || (navigator.MaxTouchPoints > 0)
38262	      || (navigator.msMaxTouchPoints > 0));
38263	}
38264
38265	function getAnchorsURL(){
38266        var section;
38267        var slide;
38268        var hash = window.location.hash;
38269
38270        if(hash.length){
38271            //getting the anchor link in the URL and deleting the `#`
38272            var anchorsParts =  hash.replace('#', '').split('/');
38273
38274            //using / for visual reasons and not as a section/slide separator #2803
38275            var isFunkyAnchor = hash.indexOf('#/') > -1;
38276
38277            section = isFunkyAnchor ? '/' + anchorsParts[1] : decodeURIComponent(anchorsParts[0]);
38278
38279        }
38280
38281        return {
38282            urldata: section,
38283        }
38284    }
38285}
38286
38287
38288});
38289
38290/*!
38291 * jQuery lockfixed plugin
38292 * http://www.directlyrics.com/code/lockfixed/
38293 *
38294 * Copyright 2012-2015 Yvo Schaap
38295 * Released under the MIT license
38296 * http://www.directlyrics.com/code/lockfixed/license.txt
38297 *
38298 * Date: Sun March 30 2015 12:00:01 GMT
38299 */
38300!function(t){t.extend({lockfixed:function(e,o){if(o&&o.offset?("function"!=typeof o.offset.bottom&&(o.offset.bottom=parseInt(o.offset.bottom,10)),"function"!=typeof o.offset.top&&(o.offset.top=parseInt(o.offset.top,10))):o.offset={bottom:100,top:0},o&&o.stuck_class||(o.stuck_class="is_stuck"),o&&"undefined"!=typeof o.screen_limit||(o.screen_limit=767),e&&e.offset()){var s=e.css("position"),i=parseInt(e.css("marginTop"),10),n=e.css("top"),a=e.offset().top,f=!1;(o.forcemargin===!0||navigator.userAgent.match(/\bMSIE (4|5|6)\./)||navigator.userAgent.match(/\bOS ([0-9])_/)||navigator.userAgent.match(/\bAndroid ([0-9])\./i))&&(a-=100),e.wrap("<div class='navbar-wrapper' style='height:"+e.outerHeight()+"px;display:"+e.css("display")+"'></div>"),t(window).bind("DOMContentLoaded load scroll resize orientationchange lockfixed:pageupdate",e,function(){if(t(window).width()<o.screen_limit)return e.removeAttr("style"),e.parents(".navbar-wrapper").removeAttr("style"),void e.removeClass(o.stuck_class);if(!f||!document.activeElement||"INPUT"!==document.activeElement.nodeName){var r="function"==typeof o.offset.top?o.offset.top():o.offset.top,p="function"==typeof o.offset.bottom?o.offset.bottom():o.offset.bottom,c=0,d=e.outerHeight(),m=e.parent().innerWidth()-parseInt(e.css("marginLeft"),10)-parseInt(e.css("marginRight"),10),l=t(document).height()-p,u=t(window).scrollTop();"fixed"===e.css("position")||f||(a=e.offset().top,n=e.css("top")),u>=a-(i?i:0)-r?(c=u+d+i+r>l?u+d+i+r-l:0,f?e.css({marginTop:parseInt(u-a-c,10)+2*r+"px"}):e.css({position:"fixed",top:r-c+"px",width:m+"px"}).addClass(o.stuck_class)):e.css({position:s,top:n,width:m+"px",marginTop:(i&&!f?i:0)+"px"}).removeClass(o.stuck_class),e.parents(".navbar-wrapper").css("height",e.outerHeight())}})}}})}(jQuery);
38301
38302/*!
38303 * Theia Sticky Sidebar v1.2.2
38304 * https://github.com/WeCodePixels/theia-sticky-sidebar
38305 *
38306 * Glues your website's sidebars, making them permanently visible while scrolling.
38307 *
38308 * Copyright 2013-2014 WeCodePixels and other contributors
38309 * Released under the MIT license
38310 */
38311!function(i){i.fn.theiaStickySidebar=function(t){var o={containerSelector:"",additionalMarginTop:0,additionalMarginBottom:0,updateSidebarHeight:!0,minWidth:0};t=i.extend(o,t),t.additionalMarginTop=parseInt(t.additionalMarginTop)||0,t.additionalMarginBottom=parseInt(t.additionalMarginBottom)||0,i("head").append(i('<style>.theiaStickySidebar:after {content: ""; display: table; clear: both;}</style>')),this.each(function(){function o(){e.fixedScrollTop=0,e.sidebar.css({"min-height":"1px"}),e.stickySidebar.css({position:"static",width:""})}function a(t){var o=t.height();return t.children().each(function(){o=Math.max(o,i(this).height())}),o}var e={};e.sidebar=i(this),e.options=t||{},e.container=i(e.options.containerSelector),0==e.container.size()&&(e.container=e.sidebar.parent()),e.sidebar.parents().css("-webkit-transform","none"),e.sidebar.css({position:"relative",overflow:"visible","-webkit-box-sizing":"border-box","-moz-box-sizing":"border-box","box-sizing":"border-box"}),e.stickySidebar=e.sidebar.find(".theiaStickySidebar"),0==e.stickySidebar.length&&(e.sidebar.find("script").remove(),e.stickySidebar=i("<div>").addClass("theiaStickySidebar").append(e.sidebar.children()),e.sidebar.append(e.stickySidebar)),e.marginTop=parseInt(e.sidebar.css("margin-top")),e.marginBottom=parseInt(e.sidebar.css("margin-bottom")),e.paddingTop=parseInt(e.sidebar.css("padding-top")),e.paddingBottom=parseInt(e.sidebar.css("padding-bottom"));var d=e.stickySidebar.offset().top,r=e.stickySidebar.outerHeight();e.stickySidebar.css("padding-top",1),e.stickySidebar.css("padding-bottom",1),d-=e.stickySidebar.offset().top,r=e.stickySidebar.outerHeight()-r-d,0==d?(e.stickySidebar.css("padding-top",0),e.stickySidebarPaddingTop=0):e.stickySidebarPaddingTop=1,0==r?(e.stickySidebar.css("padding-bottom",0),e.stickySidebarPaddingBottom=0):e.stickySidebarPaddingBottom=1,e.previousScrollTop=null,e.fixedScrollTop=0,o(),e.onScroll=function(e){if(e.stickySidebar.is(":visible")){if(i("body").width()<e.options.minWidth)return void o();if(e.sidebar.outerWidth(!0)+50>e.container.width())return void o();var d=i(document).scrollTop(),r="static";if(d>=e.container.offset().top+(e.paddingTop+e.marginTop-e.options.additionalMarginTop)){var s,n=e.paddingTop+e.marginTop+t.additionalMarginTop,c=e.paddingBottom+e.marginBottom+t.additionalMarginBottom,p=e.container.offset().top,b=e.container.offset().top+a(e.container),g=0+t.additionalMarginTop,l=e.stickySidebar.outerHeight()+n+c<i(window).height();s=l?g+e.stickySidebar.outerHeight():i(window).height()-e.marginBottom-e.paddingBottom-t.additionalMarginBottom;var f=p-d+e.paddingTop+e.marginTop,S=b-d-e.paddingBottom-e.marginBottom,h=e.stickySidebar.offset().top-d,m=e.previousScrollTop-d;"fixed"==e.stickySidebar.css("position")&&(h+=m),h=m>0?Math.min(h,g):Math.max(h,s-e.stickySidebar.outerHeight()),h=Math.max(h,f),h=Math.min(h,S-e.stickySidebar.outerHeight());var y=e.container.height()==e.stickySidebar.outerHeight();r=(y||h!=g)&&(y||h!=s-e.stickySidebar.outerHeight())?d+h-e.sidebar.offset().top-e.paddingTop<=t.additionalMarginTop?"static":"absolute":"fixed"}if("fixed"==r)e.stickySidebar.css({position:"fixed",width:e.sidebar.width(),top:h,left:e.sidebar.offset().left+parseInt(e.sidebar.css("padding-left"))+parseInt(e.sidebar.css("border-left"))});else if("absolute"==r){var k={};"absolute"!=e.stickySidebar.css("position")&&(k.position="absolute",k.top=d+h-e.sidebar.offset().top-e.stickySidebarPaddingTop-e.stickySidebarPaddingBottom),k.width=e.sidebar.width(),k.left="",e.stickySidebar.css(k)}else"static"==r&&o();"static"!=r&&1==e.options.updateSidebarHeight&&e.sidebar.css({"min-height":e.stickySidebar.outerHeight()+e.stickySidebar.offset().top-e.sidebar.offset().top+e.paddingBottom}),e.previousScrollTop=d}},e.onScroll(e),i(document).scroll(function(i){return function(){i.onScroll(i)}}(e)),i(window).resize(function(i){return function(){i.stickySidebar.css({position:"static"}),i.onScroll(i)}}(e))})}}(jQuery);
38312
38313/*! Backstretch - v2.0.4 - 2013-06-19
38314 * http://srobbin.com/jquery-plugins/backstretch/
38315 * Copyright (c) 2013 Scott Robbin; Licensed MIT */
38316!function(t,i,e){t.fn.backstretch=function(n,s){return(n===e||0===n.length)&&t.error("No images were supplied for Backstretch"),0===t(i).scrollTop()&&i.scrollTo(0,0),this.each(function(){var i=t(this),e=i.data("backstretch");if(e){if("string"==typeof n&&"function"==typeof e[n])return void e[n](s);s=t.extend(e.options,s),e.destroy(!0)}e=new r(this,n,s),i.data("backstretch",e)})},t.backstretch=function(i,e){return t("body").backstretch(i,e).data("backstretch")},t.expr[":"].backstretch=function(i){return t(i).data("backstretch")!==e},t.fn.backstretch.defaults={centeredX:!0,centeredY:!0,duration:5e3,fade:0};var n={left:0,top:0,overflow:"hidden",margin:0,padding:0,height:"100%",width:"100%",zIndex:-999999},s={position:"absolute",display:"none",margin:0,padding:0,border:"none",width:"auto",height:"auto",maxHeight:"none",maxWidth:"none",zIndex:-999999},r=function(e,s,r){this.options=t.extend({},t.fn.backstretch.defaults,r||{}),this.images=t.isArray(s)?s:[s],t.each(this.images,function(){t("<img />")[0].src=this}),this.isBody=e===document.body,this.$container=t(e),this.$root=this.isBody?t(a?i:document):this.$container,e=this.$container.children(".backstretch").first(),this.$wrap=e.length?e:t('<div class="backstretch"></div>').css(n).appendTo(this.$container),this.isBody||(e=this.$container.css("position"),s=this.$container.css("zIndex"),this.$container.css({position:"static"===e?"relative":e,zIndex:"auto"===s?0:s,background:"none"}),this.$wrap.css({zIndex:-999998})),this.$wrap.css({position:this.isBody&&a?"fixed":"absolute"}),this.index=0,this.show(this.index),t(i).on("resize.backstretch",t.proxy(this.resize,this)).on("orientationchange.backstretch",t.proxy(function(){this.isBody&&0===i.pageYOffset&&(i.scrollTo(0,1),this.resize())},this))};r.prototype={resize:function(){try{var t,e={left:0,top:0},n=this.isBody?this.$root.width():this.$root.innerWidth(),s=n,r=this.isBody?i.innerHeight?i.innerHeight:this.$root.height():this.$root.innerHe
38316ight(),a=s/this.$img.data("ratio");a>=r?(t=(a-r)/2,this.options.centeredY&&(e.top="-"+t+"px")):(a=r,s=a*this.$img.data("ratio"),t=(s-n)/2,this.options.centeredX&&(e.left="-"+t+"px")),this.$wrap.css({width:n,height:r}).find("img:not(.deleteable)").css({width:s,height:a}).css(e)}catch(o){}return this},show:function(i){if(!(Math.abs(i)>this.images.length-1)){var e=this,n=e.$wrap.find("img").addClass("deleteable"),r={relatedTarget:e.$container[0]};return e.$container.trigger(t.Event("backstretch.before",r),[e,i]),this.index=i,clearInterval(e.interval),e.$img=t("<img />").css(s).bind("load",function(s){var a=this.width||t(s.target).width();s=this.height||t(s.target).height(),t(this).data("ratio",a/s),t(this).fadeIn(e.options.speed||e.options.fade,function(){n.remove(),e.paused||e.cycle(),t(["after","show"]).each(function(){e.$container.trigger(t.Event("backstretch."+this,r),[e,i])})}),e.resize()}).appendTo(e.$wrap),e.$img.attr("src",e.images[i]),e}},next:function(){return this.show(this.index<this.images.length-1?this.index+1:0)},prev:function(){return this.show(0===this.index?this.images.length-1:this.index-1)},pause:function(){return this.paused=!0,this},resume:function(){return this.paused=!1,this.next(),this},cycle:function(){return 1<this.images.length&&(clearInterval(this.interval),this.interval=setInterval(t.proxy(function(){this.paused||this.next()},this),this.options.duration)),this},destroy:function(e){t(i).off("resize.backstretch orientationchange.backstretch"),clearInterval(this.interval),e||this.$wrap.remove(),this.$container.removeData("backstretch")}};var a,o=navigator.userAgent,h=navigator.platform,c=o.match(/AppleWebKit\/([0-9]+)/),c=!!c&&c[1],d=o.match(/Fennec\/([0-9]+)/),d=!!d&&d[1],p=o.match(/Opera Mobi\/([0-9]+)/),f=!!p&&p[1],u=o.match(/MSIE ([0-9]+)/),u=!!u&&u[1];a=!((-1<h.indexOf("iPhone")||-1<h.indexOf("iPad")||-1<h.indexOf("iPod"))&&c&&534>c||i.operamini&&"[object OperaMini]"==={}.toString.call(i.operamini)||p&&7458>f||-1<o.indexOf("Android")&&c&&533>c||d&&6>d||"palmGetResource"in i&&c&&534>c||-1<o.indexOf("MeeGo")&&-1<o.indexOf("NokiaBrowser/8.5.0")||u&&6>=u)}(jQuery,window);
38317
38318// Copyright (c) 2012 Florian H., https://github.com/js-coder https://github.com/js-coder/cookie.js cookie.js is released under the MIT/X11 license.
38319!function(e,t){var n=function(){return n.get.apply(n,arguments)},r=n.utils={isArray:Array.isArray||function(e){return Object.prototype.toString.call(e)==="[object Array]"},isPlainObject:function(e){return!!e&&Object.prototype.toString.call(e)==="[object Object]"},toArray:function(e){return Array.prototype.slice.call(e)},getKeys:Object.keys||function(e){var t=[],n="";for(n in e)e.hasOwnProperty(n)&&t.push(n);return t},escape:function(e){return String(e).replace(/[,;"\\=\s%]/g,function(e){return encodeURIComponent(e)})},retrieve:function(e,t){return e==null?t:e}};n.defaults={},n.expiresMultiplier=86400,n.set=function(n,i,s){if(r.isPlainObject(n))for(var o in n)n.hasOwnProperty(o)&&this.set(o,n[o],i);else{s=r.isPlainObject(s)?s:{expires:s};var u=s.expires!==t?s.expires:this.defaults.expires||"",a=typeof u;a==="string"&&u!==""?u=new Date(u):a==="number"&&(u=new Date(+(new Date)+1e3*this.expiresMultiplier*u)),u!==""&&"toGMTString"in u&&(u=";expires="+u.toGMTString());var f=s.path||this.defaults.path;f=f?";path="+f:"";var l=s.domain||this.defaults.domain;l=l?";domain="+l:"";var c=s.secure||this.defaults.secure?";secure":"";e.cookie=r.escape(n)+"="+r.escape(i)+u+f+l+c}return this},n.remove=function(e){e=r.isArray(e)?e:r.toArray(arguments);for(var t=0,n=e.length;t<n;t++)this.set(e[t],"",-1);return this},n.empty=function(){return this.remove(r.getKeys(this.all()))}
38319,n.get=function(e,n){n=n||t;var i=this.all();if(r.isArray(e)){var s={};for(var o=0,u=e.length;o<u;o++){var a=e[o];s[a]=r.retrieve(i[a],n)}return s}return r.retrieve(i[e],n)},n.all=function(){if(e.cookie==="")return{};var t=e.cookie.split("; "),n={};for(var r=0,i=t.length;r<i;r++){var s=t[r].split("=");n[decodeURIComponent(s[0])]=decodeURIComponent(s[1])}return n},n.enabled=function(){if(navigator.cookieEnabled)return!0;var e=n.set("_","_").get("_")==="_";return n.remove("_"),e},typeof define=="function"&&define.amd?define(function(){return n}):typeof exports!="undefined"?exports.cookie=n:window.cookie=n}(document);
38320
38321/*!
38322 * FitVids 1.1
38323 *
38324 * Copyright 2013, Chris Coyier - http://css-tricks.com + Dave Rupert - http://daverupert.com
38325 * Credit to Thierry Koblentz - http://www.alistapart.com/articles/creating-intrinsic-ratios-for-video/
38326 * Released under the WTFPL license - http://sam.zoy.org/wtfpl/
38327 */
38328!function(t){"use strict";t.fn.fitVids=function(e){var i={customSelector:null,ignore:null};if(!document.getElementById("fit-vids-style")){var r=document.head||document.getElementsByTagName("head")[0],a=".fluid-width-video-wrapper{width:100%;position:relative;padding:0;}.fluid-width-video-wrapper iframe,.fluid-width-video-wrapper object,.fluid-width-video-wrapper embed {position:absolute;top:0;left:0;width:100%;height:100%;}",d=document.createElement("div");d.innerHTML='<p>x</p><style id="fit-vids-style">'+a+"</style>",r.appendChild(d.childNodes[1])}return e&&t.extend(i,e),this.each(function(){var e=['iframe[src*="player.vimeo.com"]','iframe[src*="youtube.com"]','iframe[src*="youtube-nocookie.com"]','iframe[src*="kickstarter.com"][src*="video.html"]',"object","embed"];i.customSelector&&e.push(i.customSelector);var r=".fitvidsignore";i.ignore&&(r=r+", "+i.ignore);var a=t(this).find(e.join(","));a=a.not("object object"),a=a.not(r),a.each(function(e){var i=t(this);if(!(i.parents(r).length>0||"embed"===this.tagName.toLowerCase()&&i.parent("object").length||i.parent(".fluid-width-video-wrapper").length)){i.css("height")||i.css("width")||!isNaN(i.attr("height"))&&!isNaN(i.attr("width"))||(i.attr("height",9),i.attr("width",16));var a="object"===this.tagName.toLowerCase()||i.attr("height")&&!isNaN(parseInt(i.attr("height"),10))?parseInt(i.attr("height"),10):i.height(),d=isNaN(parseInt(i.attr("width"),10))?i.width():parseInt(i.attr("width"),10),o=a/d;if(!i.attr("id")){var h="fitvid"+e;i.attr("id",h)}i.wrap('<div class="fluid-width-video-wrapper"></div>').parent(".fluid-width-video-wrapper").css("padding-top",100*o+"%"),i.removeAttr("height").removeAttr("width")}})})}}(window.jQuery||window.Zepto);
38329
38330/**
38331 * Javascript-Equal-Height-Responsive-Rows
38332 * https://github.com/Sam152/Javascript-Equal-Height-Responsive-Rows
38333 */
38334!function(i){"use strict";i.fn.equalHeight=function(){var t=[];return i.each(this,function(e,n){var r,s=i(n),a="border-box"===s.css("box-sizing")||"border-box"===s.css("-moz-box-sizing");r=a?s.innerHeight():s.height(),t.push(r)}),this.css("height",Math.max.apply(window,t)+"px"),this},i.fn.equalHeightGrid=function(t){var e=this.filter(":visible");e.css("height","auto");for(var n=0;n<e.length;n++)if(n%t===0){for(var r=i(e[n]),s=1;t>s;s++)r=r.add(e[n+s]);r.equalHeight()}return this},i.fn.detectGridColumns=function(){var t=0,e=0,n=this.filter(":visible");return n.each(function(n,r){var s=i(r).offset().top;return 0!==t&&s!==t?!1:(e++,void(t=s))}),e};var t=0;i.fn.responsiveEqualHeightGrid=function(){function e(){var i=n.detectGridColumns();n.equalHeightGrid(i)}var n=this,r=".grids_"+t;return n.data("grids-event-namespace",r),i(window).bind("resize"+r+" load"+r,e),e(),t++,this},i.fn.responsiveEqualHeightGridDestroy=function(){var t=this;return t.css("height","auto"),i(window).unbind(t.data("grids-event-namespace")),this}}(window.jQuery);
38335
38336jQuery(document).ready(function($) {
38337    "use strict";
38338
38339    var _conf = typeof wyyParams == 'object' ? wyyParams : {},
38340        _b = $('body'),
38341        _col_resp = [
38342            '.sidebar-widget .posts-box-sidebar .col',
38343            '.footer-widget .posts-box-sidebar .col',
38344            '.posts-box-6 .col',
38345            '.posts-box-8 .col',
38346            '.posts-box-9 .col'
38347        ],
38348        _detect = {
38349            isMobile: _b.hasClass('wyy-device-mobile'),
38350            isTablet: _b.hasClass('wyy-device-tablet')
38351        },
38352        _el = {
38353            root: $('html, body'),
38354            navbar: $('.navbar'),
38355            navbar_sticky: $('.navbar-sticky'),
38356            navbar_nav: $('.navbar-nav'),
38357            wp_bar: $('#wpadminbar'),
38358            main: $('#main'),
38359            footer: $('.footer'),
38360            par_wrapper: $('.wyy-parallax-wrapper'),
38361            par_inner: $('.wyy-parallax-inner'),
38362            fimg_sp: $('.fimg-sp'),
38363            fimg_fp: $('.fimg-fp'),
38364            fimg_fs: $('.fimg-fs')
38365        };
38366
38367    window.requestAnimFrame = (function() {
38368        return window.requestAnimationFrame    ||
38369            window.webkitRequestAnimationFrame ||
38370            window.mozRequestAnimationFrame    ||
38371            window.oRequestAnimationFrame      ||
38372            window.msRequestAnimationFrame     ||
38373            function( callback ){
38374                window.setTimeout(callback, 1000 / 60);
38375            };
38376    })();
38377
38378    /*
38379     * Main menu add caret icons
38380     */
38381    _el.navbar_nav.find('li').each(function() {
38382        var ww = $(window).width();
38383        if(ww < 768){
38384            var t = $(this);            
38385            if(t.hasClass('menu-item-has-children') && !t.hasClass('menu-item-mega-menu')) {
38386                t.children('.menu-item-has-children > a').after($('<span>').addClass('fa fa-caret-right')).after($('<span>').addClass('fa fa-caret-down'));
38387                t.children('.menu-item-has-children span').wrapAll('<a href="#" class="menu-item-has-children caret-outer"></a>');
38388            }
38389        }else{
38390            var t = $(this);
38391            if(t.hasClass('menu-item-has-children') && !t.hasClass('menu-item-mega-menu')) {
38392                t.children('a').append($('<span>').addClass('fa fa-caret-right')).append($('<span>').addClass('fa fa-caret-down'));
38393            }
38394        }
38395    });
38396
38397    /*
38398     * Mobile nav menu
38399     */
38400    _b.on('click', '.navbar-nav li a.caret-outer', function(e) {
38401
38402        var t = $(this),
38403            li = t.parent();
38404
38405        if(!_el.navbar.find('.navbar-toggle').is(':hidden')
38406            && li.hasClass('menu-item-has-children')
38407            && !li.hasClass('menu-item-mega-menu')) {
38408
38409            e.preventDefault();
38410
38411            if(!li.hasClass('wyy-tap')) {
38412                li.addClass('wyy-tap').children('.sub-menu').show();
38413            } else {
38414                li.removeClass('wyy-tap').find('.sub-menu').hide();
38415            }
38416
38417        }
38418
38419    });
38420
38421    /*
38422     * Sticky Navbar
38423     */
38424    if(_el.navbar.length && _el.navbar.hasClass('navbar-sticky')) {
38425
38426        $.lockfixed(_el.navbar, {
38427            offset: {
38428                top: function () {
38429                    var el_wpbar_offset = ( _el.wp_bar.length && _el.wp_bar.css('position') == 'fixed' ) ? _el.wp_bar.height() : 0,
38430                        el_navbar_offset = _el.navbar.find('.navbar-toggle').is(':hidden') ? ( _el.navbar.children('.container').innerHeight() - _el.navbar.find('.navbar-collapse').outerHeight() ) : 0;
38431                    return -1 * ( el_navbar_offset - el_wpbar_offset );
38432                },
38433                bottom: function () {
38434                    return _el.navbar.find('.navbar-toggle').is(':hidden') ? _el.footer.height() : 0;
38435                }
38436            },
38437            stuck_class: 'navbar-stuck',
38438            screen_limit: 0
38439        });
38440
38441    }
38442
38443    $(window).load(function() {
38444
38445        /*
38446         * Sticky Sidebar
38447         */
38448        $('.sidebar-sticky').theiaStickySidebar({
38449            containerSelector: '.row-primary',
38450            additionalMarginTop: ( _el.wp_bar.length && _el.navbar.length ) ? 100 : 68,
38451            additionalMarginBottom: 0,
38452            minWidth: 977
38453        });
38454
38455        /*
38456         * Responsive Equal Height
38457         */
38458        for( var i in _col_resp ) {
38459            $(_col_resp[i]).responsiveEqualHeightGrid();
38460        }
38461
38462    });
38463
38464    /*
38465     * Featured Video fix
38466     */
38467    $('.fimg-media-video').fitVids().find('.post-meta').css('visibility','visible');
38468
38469    /*
38470     * Post sharing buttons
38471     */
38472    _b.on('click', '.post-sharing ul li a', function(e) {
38473
38474        e.preventDefault();
38475
38476        var href = $(this).attr('href'),
38477            title = $(this).attr('title');
38478
38479        window.open(href, title, 'width=600,height=300');
38480
38481    });
38482
38483    /*
38484     * Activate Boxer Lightbox
38485     */
38486    $('.boxer').boxer({
38487        fixed: true
38488    });
38489
38490    $('.gal-img').each(function() {
38491
38492        var s = $(this),
38493            t = s.attr('title'),
38494            p = s.parents('a'),
38495            pc = p.parents('.gallery-icon'),
38496            g = s.data('gallery');
38497
38498        s.removeAttr('data-gallery');
38499
38500        pc.click(function(){
38501            $(this).find('a').trigger('click');
38502        });
38503
38504        p.attr({'title':t,'data-gallery':g}).boxer({
38505            fixed: true
38506        });
38507
38508    });
38509
38510    $('.post-content a').each(function() {
38511
38512        var childImg = $(this).children('img');
38513
38514        if ( childImg.length > 0 ) {
38515
38516            var hrefExt = $(this).attr('href').split('.').pop(),
38517                captionText = $(this).siblings('.wp-caption-text');
38518
38519            if ( ['jpg','jpeg','png','bmp','gif'].indexOf(hrefExt) != -1 ) {
38520
38521                var elGal = $(this).parents('.gallery'),
38522                    imgTitle = childImg.attr('title');
38523
38524                if (elGal.length > 0) {
38525                    $(this).attr('data-gallery', elGal.attr('id'));
38526                }
38527
38528                if ( captionText.length > 0 ) {
38529                    $(this).attr('title', captionText.text());
38530                } else if ( typeof imgTitle != 'undefined' ) {
38531                    $(this).attr('title', imgTitle);
38532                }
38533
38534                $(this).boxer({
38535                    fixed: true
38536                });
38537
38538            }
38539
38540        }
38541
38542    });
38543
38544    /*
38545     * Post Vote
38546     */
38547    $('.btn-vote').on('click', function(e) {
38548
38549        e.preventDefault();
38550
38551        var btn = $(this),
38552            type = btn.data('wyy-type'),
38553            vote_type = btn.data('wyy-vote-type'),
38554            vote_id = vote_type == 'post' ? _conf.post_id : btn.data('wyy-id'),
38555            unique_id = vote_type +'_'+ vote_id,
38556            wyy_cookie_key = 'wyy_voted_'+ ( vote_type == 'post' ? 'posts' : 'comments' ),
38557            nonce = btn.data('wyy-nonce'),
38558            voted_data = {};
38559
38560        try {
38561            voted_data = $.parseJSON(cookie.get( wyy_cookie_key )) || {};
38562        } catch (e) {}
38563
38564        if(unique_id == null || typeof voted_data[unique_id] != 'undefined' || typeof type == 'undefined' || ['up','down'].indexOf(type) == -1) {
38565            return voted_data;
38566        }
38567
38568        $.ajax({
38569            type: 'post',
38570            dataType: 'json',
38571            url: _conf.ajaxurl,
38572            data: {
38573                action: 'wyy_vote',
38574                wyy_nonce: nonce,
38575                id: vote_id,
38576                type: type,
38577                vote_type: vote_type
38578            },
38579            success: function(r){
38580
38581                if(typeof r != 'object') {
38582                    var vp = btn.parents('.'+ vote_type +'-vote'),
38583                        el = vp.find('.vote-login'),
38584                        cl = vote_type == 'post' ? ' col col-sm-12' : '';
38585                    if ( vote_type == 'comment' && el.length == 0 ) {
38586                        vp = vp.siblings('.comment-vote');
38587                        el = vp.find('.vote-login');
38588                    }
38589                    if (el.length == 0) {
38590                        el = $('<div>').addClass('vote-login'+ cl);
38591                        vp.prepend(el);
38592                    }
38593                    el.text(_conf.i18n.login_to_vote);
38594                    return;
38595                }
38596
38597                if(r.status) {
38598
38599                    var elVal = vote_type == 'post' ? $('.post_vote_' + type + '_val') : btn.find('.vote-num'),
38600                        voteVal = r['vote_' + type];
38601
38602                    if (elVal.length > 0 && typeof voteVal != 'undefined') {
38603                        elVal.text(voteVal);
38604                    }
38605
38606                    btn.addClass('btn-voted');
38607
38608                    var k = '.'+ vote_type +'-vote',
38609                        p = btn.parents(k);
38610                    p.add(p.siblings(k)).addClass(vote_type +'-vote-disabled').find('.btn-vote').off('click');;
38611
38612                    if (cookie.enabled()) {
38613                        voted_data[unique_id] = type;
38614                        var cookie_params = {};
38615                        cookie_params[wyy_cookie_key] = JSON.stringify(voted_data);
38616                        cookie.set(cookie_params, {expires: 30});
38617                    }
38618
38619                }
38620
38621            }
38622        });
38623
38624    });
38625
38626    /*
38627     * Owl Carousel
38628     */
38629    var owlEvent = function() {
38630        var $carousel = $(this);
38631        var t = $(this),
38632            c = t.data('controls'),
38633            owlParams = {
38634                items: 1,
38635                slideBy: 1,
38636                loop: true,
38637                center: true,
38638                mouseDrag: false,
38639                dots: true,
38640                nav: false,
38641                navText: ['<span class="fa fa-angle-left"></span>','<span class="fa fa-angle-right"></span>'],
38642                autoplay: false,
38643                autoplayHoverPause: true,
38644                autoplayTimeout: $carousel.data('slide-speed'),
38645                dotsSpeed: 400,
38646                smartSpeed: 300,
38647                rtl: false
38648            }, i;
38649
38650        for(i in owlParams){
38651            var z = i;
38652            if ( i == 'slideBy' ) {
38653                z = 'slideby';
38654            }
38655            var d = t.data(z);
38656            if(typeof d != 'undefined'){
38657                owlParams[i] = d;
38658            }
38659        }
38660
38661        owlParams.responsive = {0:{items:1}};
38662
38663        var bp = t.data('breakpoint');
38664        if ( typeof bp != 'undefined' ) {
38665            var bpx = bp.split(','),
38666                j;
38667            for(j in bpx){
38668                var kx = bpx[j].split(':');
38669                if(kx.length == 2) {
38670                    owlParams.responsive[kx[0]] = {items: parseInt(kx[1])};
38671                }
38672            }
38673        } else {
38674            owlParams.responsive[560] = {items:owlParams.items};
38675        }
38676
38677        if(typeof c != 'undefined') {
38678            var cp = t.find(c+' li').length == 0 ? _b : t;
38679            cp.on('click', c+ ' li', function (e) {
38680                e.preventDefault();
38681                var j = $(this).index(),
38682                    d = j == 0 ? 'next' : 'prev';
38683                t.trigger(d + '.owl.carousel');
38684            });
38685        }
38686
38687        t.owlCarousel(owlParams);
38688
38689        t.on('resized.owl.carousel', function(e) {
38690            $(e.target).find('.fp-box').each(function() {
38691                var bg = $(this).data('bg');
38692                if(typeof bg != 'undefined') {
38693                    $(this).backstretch(bg);
38694                }
38695            });
38696        });
38697
38698    };
38699
38700    $('.owl-carousel').each(owlEvent);
38701
38702    /*
38703     * Minimize button group on small screens
38704     */
38705    var toggle_btn_group = function(e) {
38706
38707        var t = $(this),
38708            p = t.parents('.btn-group'),
38709            b = t.siblings('.btn:not(.active)'),
38710            ch = typeof p.data('closed-height') == 'undefined' ? p.outerHeight() : p.data('closed-height'), // closed height
38711            oh = typeof p.data('opened-height') == 'undefined' ? ch + b.outerHeight() * b.length - 1 : p.data('opened-height');
38712
38713        p.data('closed-height', ch);
38714        p.data('opened-height', oh);
38715
38716        var current_status = p.data('current-status');
38717        if(typeof current_status == 'undefined') {
38718            current_status = 'closed';
38719        }
38720
38721        var new_status = current_status == 'closed' ? 'opened' : 'closed';
38722        p.data('current-status', new_status);
38723
38724        p.css({
38725            '-webkit-transition': 'height 0.2s',
38726            '-moz-transition': 'height 0.2s',
38727            '-ms-transition': 'height 0.2s',
38728            '-o-transition': 'height 0.2s',
38729            'transition': 'height 0.2s'
38730        });
38731
38732        p.css('height', p.data(new_status+'-height'));
38733
38734    };
38735
38736    /*
38737     * Organize Tab Shortcut
38738     */
38739    $('.wyy-sc-tab').each(function() {
38740
38741        var t = $(this),
38742            el_bg = t.find('.box-header'),
38743            el_con = t.find('.tab-content');
38744
38745        if(el_bg.length == 0) {
38746            el_bg = $('<div>').addClass('box-header').html($('<div>').addClass('btn-group btn-group-items-'+ el_con.length).attr('role','group'));
38747            t.prepend(el_bg);
38748        }
38749
38750        el_con.each(function(){
38751            var el_btn = $(this).find('.btn:first-child');
38752            el_bg.find('.btn-group').append(el_btn);
38753        });
38754
38755        el_bg = el_bg.find('.btn-group');
38756        el_bg.find('.btn:first-child').addClass('active');
38757        el_bg.append($('<button>').addClass('btn-toggle').html($('<span>').addClass('fa fa-navicon')));
38758        t.show();
38759
38760    });
38761
38762    _b.on('click', '.wyy-sc-tab .btn-group .btn', function(e) {
38763
38764        e.preventDefault();
38765
38766        var self = this,
38767            t = $(self),
38768            c = t.data('controls');
38769
38770        if(typeof c != 'undefined') {
38771            $('.tab-content'+c).show().siblings('.tab-content').hide();
38772            t.addClass('active').siblings('.btn').removeClass('active');
38773        }
38774
38775        if( ! t.siblings('.btn-toggle').is(':hidden') ) {
38776            toggle_btn_group.call(self, e);
38777        }
38778
38779    });
38780
38781    /*
38782     * Module Tabs
38783     */
38784    _b.on('click', '.btn-group .btn-toggle', toggle_btn_group);
38785
38786    _b.on('click', '.posts-box .btn-group .btn', function(e) { // controlled 072015
38787
38788        e.preventDefault();
38789
38790        var self = this,
38791            elBtn = $(self),
38792            parent = elBtn.parents( '.posts-box' ),
38793            type = parent.data('wyy-type');
38794
38795        if(elBtn.hasClass('active')) {
38796
38797            if( ! elBtn.siblings('.btn-toggle').is(':hidden') ) {
38798                toggle_btn_group.call(self, e);
38799            }
38800
38801            return;
38802        }
38803
38804        if(typeof type != 'undefined' && /^t[0-9]_[0-9]+$/.test(type)){
38805
38806            var t = type.split('_'),
38807                ajaxData = {
38808                    action: 'wyy_pb',
38809                    wyy_tab: t[0],
38810                    wyy_module: t[1],
38811                    wyy_page_id: _conf.post_id,
38812                    wyy_item_id: elBtn.data('wyy-catid') || elBtn.index()
38813                },
38814                pn = parent.data('wyy-post-not');
38815
38816            if ( typeof pn != 'undefined' ) {
38817                ajaxData.wyy_post_not = pn;
38818            }
38819
38820            elBtn.addClass('active').siblings('.btn').removeClass('active');
38821
38822            if( ! elBtn.siblings('.btn-toggle').is(':hidden') ) {
38823                toggle_btn_group.call(self, e);
38824            }
38825
38826            var elLoaderName = 'loader-overlay',
38827                wrapper = parent.find('.posts-wrapper'),
38828                elLoader = wrapper.find('.'+ elLoaderName);
38829
38830            if(elLoader.length == 0) {
38831
38832                var conWrap = $('<div>').addClass('preload-wrap pos-cc'),
38833                    con = $('<div>').addClass(elLoaderName).append(conWrap).hide(),
38834                    rots = [null, 90, 180, 270],
38835                    i, rot;
38836
38837                for( i in rots ) {
38838                    rot = rots[i] != null ? ' rot-'+ rots[i] : '';
38839                    conWrap.append($('<div>').addClass('preload'+ rot)
38840                        .append($('<div>').addClass('ln-anim-8')));
38841                }
38842
38843                wrapper.prepend(con.fadeIn(200));
38844
38845            } else if (elLoader.is(':hidden')) {
38846
38847                elLoader.fadeIn(200);
38848
38849            }
38850
38851            $.ajax({
38852                type: 'post',
38853                dataType: 'html',
38854                url: _conf.ajaxurl,
38855                data: ajaxData,
38856                success: function(r) {
38857
38858                    if ( [0, '0', ''].indexOf(r) != -1 ) {
38859                        return;
38860                    }
38861
38862                    wrapper.children().not('.'+ elLoaderName).fadeOut(200);
38863                    wrapper.html(r).children().hide();
38864                    wrapper.children().fadeIn(200, function() {
38865                        wrapper.children('.owl-carousel').each(owlEvent);
38866                    });
38867
38868                    setTimeout(function(){
38869                        var i;
38870                        for(i in _col_resp) {
38871                            wrapper.children('.col').responsiveEqualHeightGrid();
38872                        }
38873                    }, 200);
38874
38875                }
38876            });
38877
38878        }
38879
38880    });
38881
38882    /*
38883     * Search modal
38884     */
38885    var searchForm = $('.search-form-full'),
38886        searchFormClose = searchForm.find('.wyy-sc-close');
38887
38888    $('.btn-search').click(function(e) {
38889        e.preventDefault();
38890        searchForm.fadeIn(50);
38891    });
38892
38893    var closeSearchForm = function() {
38894        searchForm.fadeOut(50);
38895    };
38896
38897    searchForm.add(searchFormClose).click(function() {
38898        closeSearchForm();
38899    });
38900
38901    searchForm.find('.search-form-inner').click(function(e) {
38902        e.stopPropagation();
38903    });
38904
38905    /*
38906     * Window key & resize events
38907     */
38908    $(window).keyup(function(e) {
38909
38910        if(e.which == 27) {
38911            closeSearchForm();
38912        }
38913
38914    });
38915
38916    /*
38917     * Theme customizer
38918     */
38919    _b.on('click', '#live-customizer .lc-toggle-btn', function() {
38920
38921        var t = $(this),
38922            p = t.parents('#live-customizer');
38923
38924        p.toggleClass('open');
38925
38926    });
38927
38928    _b.on('click', '#live-customizer .lc-opt', function() {
38929
38930        var t = $(this),
38931            p = t.parents('.lc-section'),
38932            v = t.data('value'),
38933            o = p.data('option'),
38934            el_navbar = $('.navbar'),
38935            el_footer = $('.footer');
38936
38937        t.parents('li').addClass('active').siblings('li').removeClass('active');
38938
38939        if(o == 'layout') {
38940            var el_bg_holder = _b.find('#page-wrapper').add('.navbar');
38941            if(v == 'boxed') {
38942                _b.addClass('boxed-layout');
38943                el_bg_holder.css('background-color', 'transparent');
38944            } else if(v == 'full') {
38945                _b.removeClass('boxed-layout').removeClass('boxed-layout-bg');
38946                el_bg_holder.css('background-color', 'white');
38947            }
38948        } else if(o == 'color_scheme_nav_menu') {
38949            el_navbar.removeClass('navbar-'+ (v == 'dark' ? 'light' : 'dark')).addClass('navbar-'+v);
38950        } else if(o == 'color_scheme_mega_menu') {
38951            el_navbar.removeClass('mega-menu-'+ (v == 'dark' ? 'light' : 'dark')).addClass('mega-menu-'+v);
38952        } else if(o == 'color_scheme_footer') {
38953            el_footer.removeClass('footer-'+ (v == 'dark' ? 'light' : 'dark')).addClass('footer-'+v);
38954        }
38955
38956    });
38957
38958    var wyyTicking = false,
38959        wyyScrollTop = 0;
38960
38961    function wyyOnResize() {
38962        wyyUpdateElements('resize');
38963    }
38964
38965    function wyyOnScroll() {
38966
38967        if(!wyyTicking) {
38968            wyyTicking = true;
38969            requestAnimFrame(wyyUpdateElements);
38970            wyyScrollTop = window.pageYOffset;
38971        }
38972
38973    }
38974
38975    function wyyUpdateElements(ev) {
38976
38977        var wyyWinHg = window.innerHeight,
38978            wyyWinWd = window.innerWidth,
38979            wyyWpBarHg = _el.wp_bar.length ? (wyyWinWd <= 782 ? 46 : 32) : 0;
38980
38981        if(ev == 'resize' && wyyWinHg >= 560) {
38982            _el.par_wrapper.css('height', wyyWinHg);
38983        }
38984
38985        if(wyyWinWd > 782 && wyyScrollTop < wyyWinHg && (_el.fimg_sp.length || _el.fimg_fp.length)) {
38986
38987            var yPos = Math.round( wyyScrollTop / 2 * 100 ) / 100;
38988
38989            wyyPrefix(_el.par_inner.find('img'), 'transform', 'translate3d(0, '+ 
vendor: 8,557 bytes, lines 38989-39041
38989yPos +'px, 0)');
38990
38991        }
38992
38993        if(_el.fimg_fp.length || _el.fimg_fs.length) {
38994
38995            var wyyFimgHg = _el.par_wrapper.outerHeight() - _el.navbar.height() - wyyWpBarHg;
38996        
38997            if(_el.fimg_fp.length) {
38998                _el.fimg_fp.find('.fimg-inner').css('height', wyyFimgHg);
38999            }
39000
39001            if(_el.fimg_fs.length) {
39002                _el.fimg_fs.find('.fimg-inner').css('height', wyyFimgHg);
39003            }
39004
39005        }
39006
39007        wyyTicking = false;
39008
39009    }
39010
39011    function wyyPrefix(obj, prop, value) {
39012        var prefs = ['webkit', 'moz', 'o', 'ms', ''];
39013        for (var pref in prefs) {
39014            obj.css('-'+ prefs[pref] +'-'+ prop, value);
39015        }
39016    }
39017
39018    (function() {
39019
39020        wyyUpdateElements('resize');
39021        _el.fimg_fp.find('.fimg-inner').show();
39022        _el.fimg_fs.find('.fimg-inner').show();
39023
39024    })();
39025
39026    window.addEventListener('resize', wyyOnResize, false);
39027    window.addEventListener('scroll', wyyOnScroll, false);
39028
39029    /*_el.root.on('mousewheel DOMMouseScroll', function() {
39030        _el.root.stop();
39031    });*/
39032
39033});
39034// Generated by CoffeeScript 1.6.2
39035/*
39036jQuery Waypoints - v2.0.3
39037Copyright (c) 2011-2013 Caleb Troughton
39038Dual licensed under the MIT license and GPL license.
39039https://github.com/imakewebthings/jquery-waypoints/blob/master/licenses.txt
39040*/
39041(function(){var t=[].indexOf||function(t){for(var e=0,n=this.length;e<n;e++){if(e in this&&this[e]===t)return e}return-1},e=[].slice;(function(t,e){if(typeof define==="function"&&define.amd){return define("waypoints",["jquery"],function(n){return e(n,t)})}else{return e(t.jQuery,t)}})(this,function(n,r){var i,o,l,s,f,u,a,c,h,d,p,y,v,w,g,m;i=n(r);c=t.call(r,"ontouchstart")>=0;s={horizontal:{},vertical:{}};f=1;a={};u="waypoints-context-id";p="resize.waypoints";y="scroll.waypoints";v=1;w="waypoints-waypoint-ids";g="waypoint";m="waypoints";o=function(){function t(t){var e=this;this.$element=t;this.element=t[0];this.didResize=false;this.didScroll=false;this.id="context"+f++;this.oldScroll={x:t.scrollLeft(),y:t.scrollTop()};this.waypoints={horizontal:{},vertical:{}};t.data(u,this.id);a[this.id]=this;t.bind(y,function(){var t;if(!(e.didScroll||c)){e.didScroll=true;t=function(){e.doScroll();return e.didScroll=false};return r.setTimeout(t,n[m].settings.scrollThrottle)}});t.bind(p,function(){var t;if(!e.didResize){e.didResize=true;t=function(){n[m]("refresh");return e.didResize=false};return r.setTimeout(t,n[m].settings.resizeThrottle)}})}t.prototype.doScroll=function(){var t,e=this;t={horizontal:{newScroll:this.$element.scrollLeft(),oldScroll:this.oldScroll.x,forward:"right",backward:"left"},vertical:{newScroll:this.$element.scrollTop(),oldScroll:this.oldScroll.y,forward:"down",backward:"up"}};if(c&&(!t.vertical.oldScroll||!t.vertical.newScroll)){n[m]("refresh")}n.each(t,function(t,r){var i,o,l;l=[];o=r.newScroll>r.oldScroll;i=o?r.forward:r.backward;n.each(e.waypoints[t],function(t,e){var n,i;if(r.oldScroll<(n=e.offset)&&n<=r.newScroll){return l.push(e)}else if(r.newScroll<(i=e.offset)&&i<=r.oldScroll){return l.push(e)}});l.sort(function(t,e){return t.offset-e.offset});if(!o){l.reverse()}return n.each(l,function(t,e){if(e.options.continuous||t===l.length-1){return e.trigger([i])}})});return this.oldScroll={x:t.horizontal.newScroll,y:t.vertical.newScroll}};t.prototype.refresh=function(){var t,e,r,i=this;r=n.isWindow(this.element);e=this.$element.offset();this.doScroll();t={horizontal:{contextOffset:r?0:e.left,contextScroll:r?0:this.oldScroll.x,contextDimension:this.$element.width(),oldScroll:this.oldScroll.x,forward:"right",backward:"left",offsetProp:"left"},vertical:{contextOffset:r?0:e.top,contextScroll:r?0:this.oldScroll.y,contextDimension:r?n[m]("viewportHeight"):this.$element.height(),oldScroll:this.oldScroll.y,forward:"down",backward:"up",offsetProp:"top"}};return n.each(t,function(t,e){return n.each(i.waypoints[t],function(t,r){var i,o,l,s,f;i=r.options.offset;l=r.offset;o=n.isWindow(r.element)?0:r.$element.offset()[e.offsetProp];if(n.isFunction(i)){i=i.apply(r.element)}else if(typeof i==="string"){i=parseFloat(i);if(r.options.offset.indexOf("%")>-1){i=Math.ceil(e.contextDimension*i/100)}}r.offset=o-e.contextOffset+e.contextScroll-i;if(r.options.onlyOnScroll&&l!=null||!r.enabled){return}if(l!==null&&l<(s=e.oldScroll)&&s<=r.offset){return r.trigger([e.backward])}else if(l!==null&&l>(f=e.oldScroll)&&f>=r.offset){return r.trigger([e.forward])}else if(l===null&&e.oldScroll>=r.offset){return r.trigger([e.forward])}})})};t.prototype.checkEmpty=function(){if(n.isEmptyObject(this.waypoints.horizontal)&&n.isEmptyObject(this.waypoints.vertical)){this.$element.unbind([p,y].join(" "));return delete a[this.id]}};return t}();l=function(){function t(t,e,r){var i,o;r=n.extend({},n.fn[g].defaults,r);if(r.offset==="bottom-in-view"){r.offset=function(){var t;t=n[m]("viewportHeight");if(!n.isWindow(e.element)){t=e.$element.height()}return t-n(this).outerHeight()}}this.$element=t;this.element=t[0];this.axis=r.horizontal?"horizontal":"vertical";this.callback=r.handler;this.context=e;this.enabled=r.enabled;this.id="waypoints"+v++;this.offset=null;this.options=r;e.waypoints[this.axis][this.id]=this;s[this.axis][this.id]=this;i=(o=t.data(w))!=null?o:[];i.push(this.id);t.data(w,i)}t.prototype.trigger=function(t){if(!this.enabled){return}if(this.callback!=null){this.callback.apply(this.element,t)}if(this.options.triggerOnce){return this.destroy()}};t.prototype.disable=function(){return this.enabled=false};t.prototype.enable=function(){this.context.refresh();return this.enabled=true};t.prototype.destroy=function(){delete s[this.axis][this.id];delete this.context.waypoints[this.axis][this.id];return this.context.checkEmpty()};t.getWaypointsByElement=function(t){var e,r;r=n(t).data(w);if(!r){return[]}e=n.extend({},s.horizontal,s.vertical);return n.map(r,function(t){return e[t]})};return t}();d={init:function(t,e){var r;if(e==null){e={}}if((r=e.handler)==null){e.handler=t}this.each(function(){var t,r,i,s;t=n(this);i=(s=e.context)!=null?s:n.fn[g].defaults.context;if(!n.isWindow(i)){i=t.closest(i)}i=n(i);r=a[i.data(u)];if(!r){r=new o(i)}return new l(t,r,e)});n[m]("refresh");return this},disable:function(){return d._invoke(this,"disable")},enable:function(){return d._invoke(this,"enable")},destroy:function(){return d._invoke(this,"destroy")},prev:function(t,e){return d._traverse.call(this,t,e,function(t,e,n){if(e>0){return t.push(n[e-1])}})},next:function(t,e){return d._traverse.call(this,t,e,function(t,e,n){if(e<n.length-1){return t.push(n[e+1])}})},_traverse:function(t,e,i){var o,l;if(t==null){t="vertical"}if(e==null){e=r}l=h.aggregate(e);o=[];this.each(function(){var e;e=n.inArray(this,l[t]);return i(o,e,l[t])});return this.pushStack(o)},_invoke:function(t,e){t.each(function(){var t;t=l.getWaypointsByElement(this);return n.each(t,function(t,n){n[e]();return true})});return this}};n.fn[g]=function(){var t,r;r=arguments[0],t=2<=arguments.length?e.call(arguments,1):[];if(d[r]){return d[r].apply(this,t)}else if(n.isFunction(r)){return d.init.apply(this,arguments)}else if(n.isPlainObject(r)){return d.init.apply(this,[null,r])}else if(!r){return n.error("jQuery Waypoints needs a callback function or handler option.")}else{return n.error("The "+r+" method does not exist in jQuery Waypoints.")}};n.fn[g].defaults={context:r,continuous:true,enabled:true,horizontal:false,offset:0,triggerOnce:false};h={refresh:function(){return n.each(a,function(t,e){return e.refresh()})},viewportHeight:function(){var t;return(t=r.innerHeight)!=null?t:i.height()},aggregate:function(t){var e,r,i;e=s;if(t){e=(i=a[n(t).data(u)])!=null?i.waypoints:void 0}if(!e){return[]}r={horizontal:[],vertical:[]};n.each(r,function(t,i){n.each(e[t],function(t,e){return i.push(e)});i.sort(function(t,e){return t.offset-e.offset});r[t]=n.map(i,function(t){return t.element});return r[t]=n.unique(r[t])});return r},above:function(t){if(t==null){t=r}return h._filter(t,"vertical",function(t,e){return e.offset<=t.oldScroll.y})},below:function(t){if(t==null){t=r}return h._filter(t,"vertical",function(t,e){return e.offset>t.oldScroll.y})},left:function(t){if(t==null){t=r}return h._filter(t,"horizontal",function(t,e){return e.offset<=t.oldScroll.x})},right:function(t){if(t==null){t=r}return h._filter(t,"horizontal",function(t,e){return e.offset>t.oldScroll.x})},enable:function(){return h._invoke("enable")},disable:function(){return h._invoke("disable")},destroy:function(){return h._invoke("destroy")},extendFn:function(t,e){return d[t]=e},_invoke:function(t){var e;e=n.extend({},s.vertical,s.horizontal);
39041return n.each(e,function(e,n){n[t]();return true})},_filter:function(t,e,r){var i,o;i=a[n(t).data(u)];if(!i){return[]}o=[];n.each(i.waypoints[e],function(t,e){if(r(i,e)){return o.push(e)}});o.sort(function(t,e){return t.offset-e.offset});return n.map(o,function(t){return t.element})}};n[m]=function(){var t,n;n=arguments[0],t=2<=arguments.length?e.call(arguments,1):[];if(h[n]){return h[n].apply(null,t)}else{return h.aggregate.call(null,n)}};n[m].settings={resizeThrottle:100,scrollThrottle:30};return i.load(function(){return n[m]("refresh")})})}).call(this);
39042/*!
39043 * The Final Countdown for jQuery v2.1.0 (http://hilios.github.io/jQuery.countdown/)
39044 * Copyright (c) 2015 Edson Hilios
39045 * 
39046 * Permission is hereby granted, free of charge, to any person obtaining a copy of
39047 * this software and associated documentation files (the "Software"), to deal in
39048 * the Software without restriction, including without limitation the rights to
39049 * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
39050 * the Software, and to permit persons to whom the Software is furnished to do so,
39051 * subject to the following conditions:
39052 * 
39053 * The above copyright notice and this permission notice shall be included in all
39054 * copies or substantial portions of the Software.
39055 * 
39056 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
39057 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
39058 * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
39059 * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
39060 * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
39061 * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
39062 */
39063!function(a){"use strict";"function"==typeof define&&define.amd?define(["jquery"],a):a(jQuery)}(function(a){"use strict";function b(a){if(a instanceof Date)return a;
39063if(String(a).match(g))return String(a).match(/^[0-9]*$/)&&(a=Number(a)),String(a).match(/\-/)&&(a=String(a).replace(/\-/g,"/")),new Date(a);throw new Error("Couldn't cast `"+a+"` to a date object.")}function c(a){var b=a.toString().replace(/([.?*+^$[\]\\(){}|-])/g,"\\$1");return new RegExp(b)}function d(a){return function(b){var d=b.match(/%(-|!)?[A-Z]{1}(:[^;]+;)?/gi);if(d)for(var f=0,g=d.length;g>f;++f){var h=d[f].match(/%(-|!)?([a-zA-Z]{1})(:[^;]+;)?/),j=c(h[0]),k=h[1]||"",l=h[3]||"",m=null;h=h[2],i.hasOwnProperty(h)&&(m=i[h],m=Number(a[m])),null!==m&&("!"===k&&(m=e(l,m)),""===k&&10>m&&(m="0"+m.toString()),b=b.replace(j,m.toString()))}return b=b.replace(/%%/,"%")}}function e(a,b){var c="s",d="";return a&&(a=a.replace(/(:|;|\s)/gi,"").split(/\,/),1===a.length?c=a[0]:(d=a[0],c=a[1])),1===Math.abs(b)?d:c}var f=[],g=[],h={precision:100,elapse:!1};g.push(/^[0-9]*$/.source),g.push(/([0-9]{1,2}\/){2}[0-9]{4}( [0-9]{1,2}(:[0-9]{2}){2})?/.source),g.push(/[0-9]{4}([\/\-][0-9]{1,2}){2}( [0-9]{1,2}(:[0-9]{2}){2})?/.source),g=new RegExp(g.join("|"));var i={Y:"years",m:"months",n:"daysToMonth",w:"weeks",d:"daysToWeek",D:"totalDays",H:"hours",M:"minutes",S:"seconds"},j=function(b,c,d){this.el=b,this.$el=a(b),this.interval=null,this.offset={},this.options=a.extend({},h),this.instanceNumber=f.length,f.push(this),this.$el.data("countdown-instance",this.instanceNumber),d&&("function"==typeof d?(this.$el.on("update.countdown",d),this.$el.on("stoped.countdown",d),this.$el.on("finish.countdown",d)):this.options=a.extend({},h,d)),this.setFinalDate(c),this.start()};a.extend(j.prototype,{start:function(){null!==this.interval&&clearInterval(this.interval);var a=this;this.update(),this.interval=setInterval(function(){a.update.call(a)},this.options.precision)},stop:function(){clearInterval(this.interval),this.interval=null,this.dispatchEvent("stoped")},toggle:function(){this.interval?this.stop():this.start()},pause:function(){this.stop()},resume:function(){this.start()},remove:function(){this.stop.call(this),f[this.instanceNumber]=null,delete this.$el.data().countdownInstance},setFinalDate:function(a){this.finalDate=b(a)},update:function(){if(0===this.$el.closest("html").length)return void this.remove();var b,c=void 0!==a._data(this.el,"events"),d=new Date;b=this.finalDate.getTime()-d.getTime(),b=Math.ceil(b/1e3),b=!this.options.elapse&&0>b?0:Math.abs(b),this.totalSecsLeft!==b&&c&&(this.totalSecsLeft=b,this.elapsed=d>=this.finalDate,this.offset={seconds:this.totalSecsLeft%60,minutes:Math.floor(this.totalSecsLeft/60)%60,hours:Math.floor(this.totalSecsLeft/60/60)%24,days:Math.floor(this.totalSecsLeft/60/60/24)%7,daysToWeek:Math.floor(this.totalSecsLeft/60/60/24)%7,daysToMonth:Math.floor(this.totalSecsLeft/60/60/24%30.4368),totalDays:Math.floor(this.totalSecsLeft/60/60/24),weeks:Math.floor(this.totalSecsLeft/60/60/24/7),months:Math.floor(this.totalSecsLeft/60/60/24/30.4368),years:Math.abs(this.finalDate.getFullYear()-d.getFullYear())},this.options.elapse||0!==this.totalSecsLeft?this.dispatchEvent("update"):(this.stop(),this.dispatchEvent("finish")))},dispatchEvent:function(b){var c=a.Event(b+".countdown");c.finalDate=this.finalDate,c.elapsed=this.elapsed,c.offset=a.extend({},this.offset),c.strftime=d(this.offset),this.$el.trigger(c)}}),a.fn.countdown=function(){var b=Array.prototype.slice.call(arguments,0);return this.each(function(){var c=a(this).data("countdown-instance");if(void 0!==c){var d=f[c],e=b[0];j.prototype.hasOwnProperty(e)?d[e].apply(d,b.slice(1)):null===String(e).match(/^[$A-Z_][0-9A-Z_$]*$/i)?(d.setFinalDate.call(d,e),d.start()):a.error("Method %s does not exist on jQuery.countdown".replace(/\%s/gi,e))}else new j(this,b[0],b[1])})}});
39064jQuery(document).ready(function($) {
39065    //Read more effect
39066    jQuery(".a1").parent().append("<span class='read_more' style='cursor: pointer; text-decoration: underline; display; block; position: absolute; bottom: 0; right: 0; width: 30px; height: 30px;'><span class='glyphicon glyphicon-chevron-down'></span></span>");
39067
39068    jQuery(".read_more").click(function(event) {
39069        var isVisible = jQuery(this).parent().find(".a2").is(":visible");
39070        if (!isVisible) {
39071            jQuery(this).parent().find(".a2").slideDown();
39072            jQuery(this).html("<span class='glyphicon glyphicon-chevron-up'></span>");
39073        } else {
39074            jQuery(this).parent().find(".a2").slideUp();
39075            jQuery(this).html("<span class='glyphicon glyphicon-chevron-down'></span>");
39076        }
39077    });
39078});
39079/*!
39080* jquery.counterup.js 1.0
39081*
39082* Copyright 2013, Benjamin Intal http://gambit.ph @bfintal
39083* Released under the GPL v2 License
39084*
39085* Date: Nov 26, 2013
39086*/(function(e){"use strict";e.fn.counterUp=function(t){var n=e.extend({time:400,delay:10},t);return this.each(function(){var t=e(this),r=n,i=function(){var e=[],n=r.time/r.delay,i=t.text(),s=/[0-9]+,[0-9]+/.test(i);i=i.replace(/,/g,"");var o=/^[0-9]+$/.test(i),u=/^[0-9]+\.[0-9]+$/.test(i),a=u?(i.split(".")[1]||[]).length:0;for(var f=n;f>=1;f--){var l=parseInt(i/n*f);u&&(l=parseFloat(i/n*f).toFixed(a));if(s)while(/(\d+)(\d{3})/.test(l.toString()))l=l.toString().replace(/(\d+)(\d{3})/,"$1,$2");e.unshift(l)}t.data("counterup-nums",e);t.text("0");var c=function(){t.text(t.data("counterup-nums").shift());if(t.data("counterup-nums").length)setTimeout(t.data("counterup-func"),r.delay);else{delete t.data("counterup-nums");t.data("counterup-nums",null);t.data("counterup-func",null)}};t.data("counterup-func",c);setTimeout(t.data("counterup-func"),r.delay)};t.waypoint(i,{offset:"100%",triggerOnce:!0})})}})(jQuery);
39087/*
39088 * SmartMenus jQuery v1.0.1+
39089 * http://www.smartmenus.org/
39090 *
39091 * Copyright Vasil Dinkov, Vadikom Web Ltd.
39092 * http://vadikom.com/
39093 *
39094 * Released under the MIT license:
39095 * http://www.opensource.org/licenses/MIT
39096 */
39097
39098(function(factory) {
39099	if (typeof define === 'function' && define.amd) {
39100		// AMD
39101		define(['jquery'], factory);
39102	} else if (typeof module === 'object' && typeof module.exports === 'object') {
39103		// CommonJS
39104		module.exports = factory(require('jquery'));
39105	} else {
39106		// Global jQuery
39107		factory(jQuery);
39108	}
39109} (function($) {
39110
39111	var menuTrees = [],
39112		IE = !!window.createPopup, // detect it for the iframe shim
39113		mouse = false, // optimize for touch by default - we will detect for mouse input
39114		touchEvents = 'ontouchstart' in window, // we use this just to choose between toucn and pointer events, not for touch screen detection
39115		mouseDetectionEnabled = false,
39116		requestAnimationFrame = window.requestAnimationFrame || function(callback) { return setTimeout(callback, 1000 / 60); },
39117		cancelAnimationFrame = window.cancelAnimationFrame || function(id) { clearTimeout(id); };
39118
39119	// Handle detection for mouse input (i.e. desktop browsers, tablets with a mouse, etc.)
39120	function initMouseDetection(disable) {
39121		var eNS = '.smartmenus_mouse';
39122		if (!mouseDetectionEnabled && !disable) {
39123			// if we get two consecutive mousemoves within 2 pixels from each other and within 300ms, we assume a real mouse/cursor is present
39124			// in practice, this seems like impossible to trick unintentianally with a real mouse and a pretty safe detection on touch devices (even with older browsers that do not support touch events)
39125			var firstTime = true,
39126				lastMove = null;
39127			$(document).bind(getEventsNS([
39128				['mousemove', function(e) {
39129					var thisMove = { x: e.pageX, y: e.pageY, timeStamp: new Date().getTime() };
39130					if (lastMove) {
39131						var deltaX = Math.abs(lastMove.x - thisMove.x),
39132							deltaY = Math.abs(lastMove.y - thisMove.y);
39133	 					if ((deltaX > 0 || deltaY > 0) && deltaX <= 2 && deltaY <= 2 && thisMove.timeStamp - lastMove.timeStamp <= 300) {
39134							mouse = true;
39135							// if this is the first check after page load, check if we are not over some item by chance and call the mouseenter handler if yes
39136							if (firstTime) {
39137								var $a = $(e.target).closest('a');
39138								if ($a.is('a')) {
39139									$.each(menuTrees, function() {
39140										if ($.contains(this.$root[0], $a[0])) {
39141											this.itemEnter({ currentTarget: $a[0] });
39142											return false;
39143										}
39144									});
39145								}
39146								firstTime = false;
39147							}
39148						}
39149					}
39150					lastMove = thisMove;
39151				}],
39152				[touchEvents ? 'touchstart' : 'pointerover pointermove pointerout MSPointerOver MSPointerMove MSPointerOut', function(e) {
39153					if (isTouchEvent(e.originalEvent)) {
39154						mouse = false;
39155					}
39156				}]
39157			], eNS));
39158			mouseDetectionEnabled = true;
39159		} else if (mouseDetectionEnabled && disable) {
39160			$(document).unbind(eNS);
39161			mouseDetectionEnabled = false;
39162		}
39163	}
39164
39165	function isTouchEvent(e) {
39166		return !/^(4|mouse)$/.test(e.pointerType);
39167	}
39168
39169	// returns a jQuery bind() ready object
39170	function getEventsNS(defArr, eNS) {
39171		if (!eNS) {
39172			eNS = '';
39173		}
39174		var obj = {};
39175		$.each(defArr, function(index, value) {
39176			obj[value[0].split(' ').join(eNS + ' ') + eNS] = value[1];
39177		});
39178		return obj;
39179	}
39180
39181	$.SmartMenus = function(elm, options) {
39182		this.$root = $(elm);
39183		this.opts = options;
39184		this.rootId = ''; // internal
39185		this.accessIdPrefix = '';
39186		this.$subArrow = null;
39187		this.activatedItems = []; // stores last activated A's for each level
39188		this.visibleSubMenus = []; // stores visible sub menus UL's (might be in no particular order)
39189		this.showTimeout = 0;
39190		this.hideTimeout = 0;
39191		this.scrollTimeout = 0;
39192		this.clickActivated = false;
39193		this.focusActivated = false;
39194		this.zIndexInc = 0;
39195		this.idInc = 0;
39196		this.$firstLink = null; // we'll use these for some tests
39197		this.$firstSub = null; // at runtime so we'll cache them
39198		this.disabled = false;
39199		this.$disableOverlay = null;
39200		this.$touchScrollingSub = null;
39201		this.cssTransforms3d = 'perspective' in elm.style || 'webkitPerspective' in elm.style;
39202		this.wasCollapsible = false;
39203		this.init();
39204	};
39205
39206	$.extend($.SmartMenus, {
39207		hideAll: function() {
39208			$.each(menuTrees, function() {
39209				this.menuHideAll();
39210			});
39211		},
39212		destroy: function() {
39213			while (menuTrees.length) {
39214				menuTrees[0].destroy();
39215			}
39216			initMouseDetection(true);
39217		},
39218		prototype: {
39219			init: function(refresh) {
39220				var self = this;
39221
39222				if (!refresh) {
39223					menuTrees.push(this);
39224
39225					this.rootId = (new Date().getTime() + Math.random() + '').replace(/\D/g, '');
39226					this.accessIdPrefix = 'sm-' + this.rootId + '-';
39227
39228					if (this.$root.hasClass('sm-rtl')) {
39229						this.opts.rightToLeftSubMenus = true;
39230					}
39231
39232					// init root (main menu)
39233					var eNS = '.smartmenus';
39234					this.$root
39235						.data('smartmenus', this)
39236						.attr('data-smartmenus-id', this.rootId)
39237						.dataSM('level', 1)
39238						.bind(getEventsNS([
39239							['mouseover focusin', $.proxy(this.rootOver, this)],
39240							['mouseout focusout', $.proxy(this.rootOut, this)],
39241							['keydown', $.proxy(this.rootKeyDown, this)]
39242						], eNS))
39243						.delegate('a', getEventsNS([
39244							['mouseenter', $.proxy(this.itemEnter, this)],
39245							['mouseleave', $.proxy(this.itemLeave, this)],
39246							['mousedown', $.proxy(this.itemDown, this)],
39247							['focus', $.proxy(this.itemFocus, this)],
39248							['blur', $.proxy(this.itemBlur, this)],
39249							['click', $.proxy(this.itemClick, this)]
39250						], eNS));
39251
39252					// hide menus on tap or click outside the root UL
39253					eNS += this.rootId;
39254					if (this.opts.hideOnClick) {
39255						$(document).bind(getEventsNS([
39256							['touchstart', $.proxy(this.docTouchStart, this)],
39257							['touchmove', $.proxy(this.docTouchMove, this)],
39258							['touchend', $.proxy(this.docTouchEnd, this)],
39259							// for Opera Mobile < 11.5, webOS browser, etc. we'll check click too
39260							['click', $.proxy(this.docClick, this)]
39261						], eNS));
39262					}
39263					// hide sub menus on resize
39264					$(window).bind(getEventsNS([['resize orientationchange', $.proxy(this.winResize, this)]], eNS));
39265
39266					if (this.opts.subIndicators) {
39267						this.$subArrow = $('<span/>').addClass('sub-arrow');
39268						if (this.opts.subIndicatorsText) {
39269							this.$subArrow.html(this.opts.subIndicatorsText);
39270						}
39271					}
39272
39273					// make sure mouse detection is enabled
39274					initMouseDetection();
39275				}
39276
39277				// init sub menus
39278				this.$firstSub = this.$root.find('ul').each(function() { self.menuInit($(this)); }).eq(0);
39279
39280				this.$firstLink = this.$root.find('a').eq(0);
39281
39282				// find current item
39283				if (this.opts.markCurrentItem) {
39284					var reDefaultDoc = /(index|default)\.[^#\?\/]*/i,
39285						reHash = /#.*/,
39286						locHref = window.location.href.replace(reDefaultDoc, ''),
39287						locHrefNoHash = locHref.replace(reHash, '');
39288					this.$root.find('a').each(function() {
39289						var href = this.href.replace(reDefaultDoc, ''),
39290							$this = $(this);
39291						if (href == locHref || href == locHrefNoHash) {
39292							$this.addClass('current');
39293							if (self.opts.markCurrentTree) {
39294								$this.parentsUntil('[data-smartmenus-id]', 'ul').each(function() {
39295									$(this).dataSM('parent-a').addClass('current');
39296								});
39297							}
39298						}
39299					});
39300				}
39301
39302				// save initial state
39303				this.wasCollapsible = this.isCollapsible();
39304			},
39305			destroy: function(refresh) {
39306				if (!refresh) {
39307					var eNS = '.smartmenus';
39308					this.$root
39309						.removeData('smartmenus')
39310						.removeAttr('data-smartmenus-id')
39311						.removeDataSM('level')
39312						.unbind(eNS)
39313						.undelegate(eNS);
39314					eNS += this.rootId;
39315					$(document).unbind(eNS);
39316					$(window).unbind(eNS);
39317					if (this.opts.subIndicators) {
39318						this.$subArrow = null;
39319					}
39320				}
39321				this.menuHideAll();
39322				var self = this;
39323				this.$root.find('ul').each(function() {
39324						var $this = $(this);
39325						if ($this.dataSM('scroll-arrows')) {
39326							$this.dataSM('scroll-arrows').remove();
39327						}
39328						if ($this.dataSM('shown-before')) {
39329							if (self.opts.subMenusMinWidth || self.opts.subMenusMaxWidth) {
39330								$this.css({ width: '', minWidth: '', maxWidth: '' }).removeClass('sm-nowrap');
39331							}
39332							if ($this.dataSM('scroll-arrows')) {
39333								$this.dataSM('scroll-arrows').remove();
39334							}
39335							$this.css({ zIndex: '', top: '', left: '', marginLeft: '', marginTop: '', display: '' });
39336						}
39337						if (($this.attr('id') || '').indexOf(self.accessIdPrefix) == 0) {
39338							$this.removeAttr('id');
39339						}
39340					})
39341					.removeDataSM('in-mega')
39342					.removeDataSM('shown-before')
39343					.removeDataSM('ie-shim')
39344					.removeDataSM('scroll-arrows')
39345					.removeDataSM('parent-a')
39346					.removeDataSM('level')
39347					.removeDataSM('beforefirstshowfired')
39348					.removeAttr('role')
39349					.removeAttr('aria-hidden')
39350					.removeAttr('aria-labelledby')
39351					.removeAttr('aria-expanded');
39352				this.$root.find('a.has-submenu').each(function() {
39353						var $this = $(this);
39354						if ($this.attr('id').indexOf(self.accessIdPrefix) == 0) {
39355							$this.removeAttr('id');
39356						}
39357					})
39358					.removeClass('has-submenu')
39359					.removeDataSM('sub')
39360					.removeAttr('aria-haspopup')
39361					.removeAttr('aria-controls')
39362					.removeAttr('aria-expanded')
39363					.closest('li').removeDataSM('sub');
39364				if (this.opts.subIndicators) {
39365					this.$root.find('span.sub-arrow').remove();
39366				}
39367				if (this.opts.markCurrentItem) {
39368					this.$root.find('a.current').removeClass('current');
39369				}
39370				if (!refresh) {
39371					this.$root = null;
39372					this.$firstLink = null;
39373					this.$firstSub = null;
39374					if (this.$disableOverlay) {
39375						this.$disableOverlay.remove();
39376						this.$disableOverlay = null;
39377					}
39378					menuTrees.splice($.inArray(this, menuTrees), 1);
39379				}
39380			},
39381			disable: function(noOverlay) {
39382				if (!this.disabled) {
39383					this.menuHideAll();
39384					// display overlay over the menu to prevent interaction
39385					if (!noOverlay && !this.opts.isPopup && this.$root.is(':visible')) {
39386						var pos = this.$root.offset();
39387						this.$disableOverlay = $('<div class="sm-jquery-disable-overlay"/>').css({
39388							position: 'absolute',
39389							top: pos.top,
39390							left: pos.left,
39391							width: this.$root.outerWidth(),
39392							height: this.$root.outerHeight(),
39393							zIndex: this.getStartZIndex(true),
39394							opacity: 0
39395						}).appendTo(document.body);
39396					}
39397					this.disabled = true;
39398				}
39399			},
39400			docClick: function(e) {
39401				if (this.$touchScrollingSub) {
39402					this.$touchScrollingSub = null;
39403					return;
39404				}
39405				// hide on any click outside the menu or on a menu link
39406				if (this.visibleSubMenus.length && !$.contains(this.$root[0], e.target) || $(e.target).closest('a').length) {
39407					this.menuHideAll();
39408				}
39409			},
39410			docTouchEnd: function(e) {
39411				if (!this.lastTouch) {
39412					return;
39413				}
39414				if (this.visibleSubMenus.length && (this.lastTouch.x2 === undefined || this.lastTouch.x1 == this.lastTouch.x2) && (this.lastTouch.y2 === undefined || this.lastTouch.y1 == this.lastTouch.y2) && (!this.lastTouch.target || !$.contains(this.$root[0], this.lastTouch.target))) {
39415					if (this.hideTimeout) {
39416						clearTimeout(this.hideTimeout);
39417						this.hideTimeout = 0;
39418					}
39419					// hide with a delay to prevent triggering accidental unwanted click on some page element
39420					var self = this;
39421					this.hideTimeout = setTimeout(function() { self.menuHideAll(); }, 350);
39422				}
39423				this.lastTouch = null;
39424			},
39425			docTouchMove: function(e) {
39426				if (!this.lastTouch) {
39427					return;
39428				}
39429				var touchPoint = e.originalEvent.touches[0];
39430				this.lastTouch.x2 = touchPoint.pageX;
39431				this.lastTouch.y2 = touchPoint.pageY;
39432			},
39433			docTouchStart: function(e) {
39434				var touchPoint = e.originalEvent.touches[0];
39435				this.lastTouch = { x1: touchPoint.pageX, y1: touchPoint.pageY, target: touchPoint.target };
39436			},
39437			enable: function() {
39438				if (this.disabled) {
39439					if (this.$disableOverlay) {
39440						this.$disableOverlay.remove();
39441						this.$disableOverlay = null;
39442					}
39443					this.disabled = false;
39444				}
39445			},
39446			getClosestMenu: function(elm) {
39447				var $closestMenu = $(elm).closest('ul');
39448				while ($closestMenu.dataSM('in-mega')) {
39449					$closestMenu = $closestMenu.parent().closest('ul');
39450				}
39451				return $closestMenu[0] || null;
39452			},
39453			getHeight: function($elm) {
39454				return this.getOffset($elm, true);
39455			},
39456			// returns precise width/height float values
39457			getOffset: function($elm, height) {
39458				var old;
39459				if ($elm.css('display') == 'none') {
39460					old = { position: $elm[0].style.position, visibility: $elm[0].style.visibility };
39461					$elm.css({ position: 'absolute', visibility: 'hidden' }).show();
39462				}
39463				var box = $elm[0].getBoundingClientRect && $elm[0].getBoundingClientRect(),
39464					val = box && (height ? box.height || box.bottom - box.top : box.width || box.right - box.left);
39465				if (!val && val !== 0) {
39466					val = height ? $elm[0].offsetHeight : $elm[0].offsetWidth;
39467				}
39468				if (old) {
39469					$elm.hide().css(old);
39470				}
39471				return val;
39472			},
39473			getStartZIndex: function(root) {
39474				var zIndex = parseInt(this[root ? '$root' : '$firstSub'].css('z-index'));
39475				if (!root && isNaN(zIndex)) {
39476					zIndex = parseInt(this.$root.css('z-index'));
39477				}
39478				return !isNaN(zIndex) ? zIndex : 1;
39479			},
39480			getTouchPoint: function(e) {
39481				return e.touches && e.touches[0] || e.changedTouches && e.changedTouches[0] || e;
39482			},
39483			getViewport: function(height) {
39484				var name = height ? 'Height' : 'Width',
39485					val = document.documentElement['client' + name],
39486					val2 = window['inner' + name];
39487				if (val2) {
39488					val = Math.min(val, val2);
39489				}
39490				return val;
39491			},
39492			getViewportHeight: function() {
39493				return this.getViewport(true);
39494			},
39495			getViewportWidth: function() {
39496				return this.getViewport();
39497			},
39498			getWidth: function($elm) {
39499				return this.getOffset($elm);
39500			},
39501			handleEvents: function() {
39502				return !this.disabled && this.isCSSOn();
39503			},
39504			handleItemEvents: function($a) {
39505				return this.handleEvents() && !this.isLinkInMegaMenu($a);
39506			},
39507			isCollapsible: function() {
39508				return this.$firstSub.css('position') == 'static';
39509			},
39510			isCSSOn: function() {
39511				return this.$firstLink.css('display') != 'inline';
39512			},
39513			isFixed: function() {
39514				var isFixed = this.$root.css('position') == 'fixed';
39515				if (!isFixed) {
39516					this.$root.parentsUntil('body').each(function() {
39517						if ($(this).css('position') == 'fixed') {
39518							isFixed = true;
39519							return false;
39520						}
39521					});
39522				}
39523				return isFixed;
39524			},
39525			isLinkInMegaMenu: function($a) {
39526				return $(this.getClosestMenu($a[0])).hasClass('mega-menu');
39527			},
39528			isTouchMode: function() {
39529				return !mouse || this.opts.noMouseOver || this.isCollapsible();
39530			},
39531			itemActivate: function($a, focus) {
39532				var $ul = $a.closest('ul'),
39533					level = $ul.dataSM('level');
39534				// if for some reason the parent item is not activated (e.g. this is an API call to activate the item), activate all parent items first
39535				if (level > 1 && (!this.activatedItems[level - 2] || this.activatedItems[level - 2][0] != $ul.dataSM('parent-a')[0])) {
39536					var self = this;
39537					$($ul.parentsUntil('[data-smartmenus-id]', 'ul').get().reverse()).add($ul).each(function() {
39538						self.itemActivate($(this).dataSM('parent-a'));
39539					});
39540				}
39541				// hide any visible deeper level sub menus
39542				if (!this.isCollapsible() || focus) {
39543					this.menuHideSubMenus(!this.activatedItems[level - 1] || this.activatedItems[level - 1][0] != $a[0] ? level - 1 : level);
39544				}
39545				// save new active item for this level
39546				this.activatedItems[level - 1] = $a;
39547				if (this.$root.triggerHandler('activate.smapi', $a[0]) === false) {
39548					return;
39549				}
39550				// show the sub menu if this item has one
39551				var $sub = $a.dataSM('sub');
39552				if ($sub && (this.isTouchMode() || (!this.opts.showOnClick || this.clickActivated))) {
39553					this.menuShow($sub);
39554				}
39555			},
39556			itemBlur: function(e) {
39557				var $a = $(e.currentTarget);
39558				if (!this.handleItemEvents($a)) {
39559					return;
39560				}
39561				this.$root.triggerHandler('blur.smapi', $a[0]);
39562			},
39563			itemClick: function(e) {
39564				var $a = $(e.currentTarget);
39565				if (!this.handleItemEvents($a)) {
39566					return;
39567				}
39568				if (this.$touchScrollingSub && this.$touchScrollingSub[0] == $a.closest('ul')[0]) {
39569					this.$touchScrollingSub = null;
39570					e.stopPropagation();
39571					return false;
39572				}
39573				if (this.$root.triggerHandler('click.smapi', $a[0]) === false) {
39574					return false;
39575				}
39576				var subArrowClicked = $(e.target).is('span.sub-arrow'),
39577					$sub = $a.dataSM('sub'),
39578					firstLevelSub = $sub ? $sub.dataSM('level') == 2 : false;
39579				// if the sub is not visible
39580				if ($sub && !$sub.is(':visible')) {
39581					if (this.opts.showOnClick && firstLevelSub) {
39582						this.clickActivated = true;
39583					}
39584					// try to activate the item and show the sub
39585					this.itemActivate($a);
39586					// if "itemActivate" showed the sub, prevent the click so that the link is not loaded
39587					// if it couldn't show it, then the sub menus are disabled with an !important declaration (e.g. via mobile styles) so let the link get loaded
39588					if ($sub.is(':visible')) {
39589						this.focusActivated = true;
39590						return false;
39591					}
39592				} else if (this.isCollapsible() && subArrowClicked) {
39593					this.itemActivate($a);
39594					this.menuHide($sub);
39595					return false;
39596				}
39597				if (this.opts.showOnClick && firstLevelSub || $a.hasClass('disabled') || this.$root.triggerHandler('select.smapi', $a[0]) === false) {
39598					return false;
39599				}
39600			},
39601			itemDown: function(e) {
39602				var $a = $(e.currentTarget);
39603				if (!this.handleItemEvents($a)) {
39604					return;
39605				}
39606				$a.dataSM('mousedown', true);
39607			},
39608			itemEnter: function(e) {
39609				var $a = $(e.currentTarget);
39610				if (!this.handleItemEvents($a)) {
39611					return;
39612				}
39613				if (!this.isTouchMode()) {
39614					if (this.showTimeout) {
39615						clearTimeout(this.showTimeout);
39616						this.showTimeout = 0;
39617					}
39618					var self = this;
39619					this.showTimeout = setTimeout(function() { self.itemActivate($a); }, this.opts.showOnClick && $a.closest('ul').dataSM('level') == 1 ? 1 : this.opts.showTimeout);
39620				}
39621				this.$root.triggerHandler('mouseenter.smapi', $a[0]);
39622			},
39623			itemFocus: function(e) {
39624				var $a = $(e.currentTarget);
39625				if (!this.handleItemEvents($a)) {
39626					return;
39627				}
39628				// fix (the mousedown check): in some browsers a tap/click produces consecutive focus + click events so we don't need to activate the item on focus
39629				if (this.focusActivated && (!this.isTouchMode() || !$a.dataSM('mousedown')) && (!this.activatedItems.length || this.activatedItems[this.activatedItems.length - 1][0] != $a[0])) {
39630					this.itemActivate($a, true);
39631				}
39632				this.$root.triggerHandler('focus.smapi', $a[0]);
39633			},
39634			itemLeave: function(e) {
39635				var $a = $(e.currentTarget);
39636				if (!this.handleItemEvents($a)) {
39637					return;
39638				}
39639				if (!this.isTouchMode()) {
39640					$a[0].blur();
39641					if (this.showTimeout) {
39642						clearTimeout(this.showTimeout);
39643						this.showTimeout = 0;
39644					}
39645				}
39646				$a.removeDataSM('mousedown');
39647				this.$root.triggerHandler('mouseleave.smapi', $a[0]);
39648			},
39649			menuHide: function($sub) {
39650				if (this.$root.triggerHandler('beforehide.smapi', $sub[0]) === false) {
39651					return;
39652				}
39653				$sub.stop(true, true);
39654				if ($sub.css('display') != 'none') {
39655					var complete = function() {
39656						// unset z-index
39657						$sub.css('z-index', '');
39658					};
39659					// if sub is collapsible (mobile view)
39660					if (this.isCollapsible()) {
39661						if (this.opts.collapsibleHideFunction) {
39662							this.opts.collapsibleHideFunction.call(this, $sub, complete);
39663						} else {
39664							$sub.hide(this.opts.collapsibleHideDuration, complete);
39665						}
39666					} else {
39667						if (this.opts.hideFunction) {
39668							this.opts.hideFunction.call(this, $sub, complete);
39669						} else {
39670							$sub.hide(this.opts.hideDuration, complete);
39671						}
39672					}
39673					// remove IE iframe shim
39674					if ($sub.dataSM('ie-shim')) {
39675						$sub.dataSM('ie-shim').remove().css({ '-webkit-transform': '', transform: '' });
39676					}
39677					// deactivate scrolling if it is activated for this sub
39678					if ($sub.dataSM('scroll')) {
39679						this.menuScrollStop($sub);
39680						$sub.css({ 'touch-action': '', '-ms-touch-action': '', '-webkit-transform': '', transform: '' })
39681							.unbind('.smartmenus_scroll').removeDataSM('scroll').dataSM('scroll-arrows').hide();
39682					}
39683					// unhighlight parent item + accessibility
39684					$sub.dataSM('parent-a').removeClass('highlighted').attr('aria-expanded', 'false');
39685					$sub.attr({
39686						'aria-expanded': 'false',
39687						'aria-hidden': 'true'
39688					});
39689					var level = $sub.dataSM('level');
39690					this.activatedItems.splice(level - 1, 1);
39691					this.visibleSubMenus.splice($.inArray($sub, this.visibleSubMenus), 1);
39692					this.$root.triggerHandler('hide.smapi', $sub[0]);
39693				}
39694			},
39695			menuHideAll: function() {
39696				if (this.showTimeout) {
39697					clearTimeout(this.showTimeout);
39698					this.showTimeout = 0;
39699				}
39700				// hide all subs
39701				// if it's a popup, this.visibleSubMenus[0] is the root UL
39702				var level = this.opts.isPopup ? 1 : 0;
39703				for (var i = this.visibleSubMenus.length - 1; i >= level; i--) {
39704					this.menuHide(this.visibleSubMenus[i]);
39705				}
39706				// hide root if it's popup
39707				if (this.opts.isPopup) {
39708					this.$root.stop(true, true);
39709					if (this.$root.is(':visible')) {
39710						if (this.opts.hideFunction) {
39711							this.opts.hideFunction.call(this, this.$root);
39712						} else {
39713							this.$root.hide(this.opts.hideDuration);
39714						}
39715						// remove IE iframe shim
39716						if (this.$root.dataSM('ie-shim')) {
39717							this.$root.dataSM('ie-shim').remove();
39718						}
39719					}
39720				}
39721				this.activatedItems = [];
39722				this.visibleSubMenus = [];
39723				this.clickActivated = false;
39724				this.focusActivated = false;
39725				// reset z-index increment
39726				this.zIndexInc = 0;
39727				this.$root.triggerHandler('hideAll.smapi');
39728			},
39729			menuHideSubMenus: function(level) {
39730				for (var i = this.activatedItems.length - 1; i >= level; i--) {
39731					var $sub = this.activatedItems[i].dataSM('sub');
39732					if ($sub) {
39733						this.menuHide($sub);
39734					}
39735				}
39736			},
39737			menuIframeShim: function($ul) {
39738				// create iframe shim for the menu
39739				if (IE && this.opts.overlapControlsInIE && !$ul.dataSM('ie-shim')) {
39740					$ul.dataSM('ie-shim', $('<iframe/>').attr({ src: 'javascript:0', tabindex: -9 })
39741						.css({ position: 'absolute', top: 'auto', left: '0', opacity: 0, border: '0' })
39742					);
39743				}
39744			},
39745			menuInit: function($ul) {
39746				if (!$ul.dataSM('in-mega')) {
39747					// mark UL's in mega drop downs (if any) so we can neglect them
39748					if ($ul.hasClass('mega-menu')) {
39749						$ul.find('ul').dataSM('in-mega', true);
39750					}
39751					// get level (much faster than, for example, using parentsUntil)
39752					var level = 2,
39753						par = $ul[0];
39754					while ((par = par.parentNode.parentNode) != this.$root[0]) {
39755						level++;
39756					}
39757					// cache stuff for quick access
39758					var $a = $ul.prevAll('a').eq(-1);
39759					// if the link is nested (e.g. in a heading)
39760					if (!$a.length) {
39761						$a = $ul.prevAll().find('a').eq(-1);
39762					}
39763					$a.addClass('has-submenu').dataSM('sub', $ul);
39764					$ul.dataSM('parent-a', $a)
39765						.dataSM('level', level)
39766						.parent().dataSM('sub', $ul);
39767					// accessibility
39768					var aId = $a.attr('id') || this.accessIdPrefix + (++this.idInc),
39769						ulId = $ul.attr('id') || this.accessIdPrefix + (++this.idInc);
39770					$a.attr({
39771						id: aId,
39772						'aria-haspopup': 'true',
39773						'aria-controls': ulId,
39774						'aria-expanded': 'false'
39775					});
39776					$ul.attr({
39777						id: ulId,
39778						'role': 'group',
39779						'aria-hidden': 'true',
39780						'aria-labelledby': aId,
39781						'aria-expanded': 'false'
39782					});
39783					// add sub indicator to parent item
39784					if (this.opts.subIndicators) {
39785						$a[this.opts.subIndicatorsPos](this.$subArrow.clone());
39786					}
39787				}
39788			},
39789			menuPosition: function($sub) {
39790				var $a = $sub.dataSM('parent-a'),
39791					$li = $a.closest('li'),
39792					$ul = $li.parent(),
39793					level = $sub.dataSM('level'),
39794					subW = this.getWidth($sub),
39795					subH = this.getHeight($sub),
39796					itemOffset = $a.offset(),
39797					itemX = itemOffset.left,
39798					itemY = itemOffset.top,
39799					itemW = this.getWidth($a),
39800					itemH = this.getHeight($a),
39801					$win = $(window),
39802					winX = $win.scrollLeft(),
39803					winY = $win.scrollTop(),
39804					winW = this.getViewportWidth(),
39805					winH = this.getViewportHeight(),
39806					horizontalParent = $ul.parent().is('[data-sm-horizontal-sub]') || level == 2 && !$ul.hasClass('sm-vertical'),
39807					rightToLeft = this.opts.rightToLeftSubMenus && !$li.is('[data-sm-reverse]') || !this.opts.rightToLeftSubMenus && $li.is('[data-sm-reverse]'),
39808					subOffsetX = level == 2 ? this.opts.mainMenuSubOffsetX : this.opts.subMenusSubOffsetX,
39809					subOffsetY = level == 2 ? this.opts.mainMenuSubOffsetY : this.opts.subMenusSubOffsetY,
39810					x, y;
39811				if (horizontalParent) {
39812					x = rightToLeft ? itemW - subW - subOffsetX : subOffsetX;
39813					y = this.opts.bottomToTopSubMenus ? -subH - subOffsetY : itemH + subOffsetY;
39814				} else {
39815					x = rightToLeft ? subOffsetX - subW : itemW - subOffsetX;
39816					y = this.opts.bottomToTopSubMenus ? itemH - subOffsetY - subH : subOffsetY;
39817				}
39818				if (this.opts.keepInViewport) {
39819					var absX = itemX + x,
39820						absY = itemY + y;
39821					if (rightToLeft && absX < winX) {
39822						x = horizontalParent ? winX - absX + x : itemW - subOffsetX;
39823					} else if (!rightToLeft && absX + subW > winX + winW) {
39824						x = horizontalParent ? winX + winW - subW - absX + x : subOffsetX - subW;
39825					}
39826					if (!horizontalParent) {
39827						if (subH < winH && absY + subH > winY + winH) {
39828							y += winY + winH - subH - absY;
39829						} else if (subH >= winH || absY < winY) {
39830							y += winY - absY;
39831						}
39832					}
39833					// do we need scrolling?
39834					// 0.49 used for better precision when dealing with float values
39835					if (horizontalParent && (absY + subH > winY + winH + 0.49 || absY < winY) || !horizontalParent && subH > winH + 0.49) {
39836						var self = this;
39837						if (!$sub.dataSM('scroll-arrows')) {
39838							$sub.dataSM('scroll-arrows', $([$('<span class="scroll-up"><span class="scroll-up-arrow"></span></span>')[0], $('<span class="scroll-down"><span class="scroll-down-arrow"></span></span>')[0]])
39839								.bind({
39840									mouseenter: function() {
39841										$sub.dataSM('scroll').up = $(this).hasClass('scroll-up');
39842										self.menuScroll($sub);
39843									},
39844									mouseleave: function(e) {
39845										self.menuScrollStop($sub);
39846										self.menuScrollOut($sub, e);
39847									},
39848									'mousewheel DOMMouseScroll': function(e) { e.preventDefault(); }
39849								})
39850								.insertAfter($sub)
39851							);
39852						}
39853						// bind scroll events and save scroll data for this sub
39854						var eNS = '.smartmenus_scroll';
39855						$sub.dataSM('scroll', {
39856								y: this.cssTransforms3d ? 0 : y - itemH,
39857								step: 1,
39858								// cache stuff for faster recalcs later
39859								itemH: itemH,
39860								subH: subH,
39861								arrowDownH: this.getHeight($sub.dataSM('scroll-arrows').eq(1))
39862							})
39863							.bind(getEventsNS([
39864								['mouseover', function(e) { self.menuScrollOver($sub, e); }],
39865								['mouseout', function(e) { self.menuScrollOut($sub, e); }],
39866								['mousewheel DOMMouseScroll', function(e) { self.menuScrollMousewheel($sub, e); }]
39867							], eNS))
39868							.dataSM('scroll-arrows').css({ top: 'auto', left: '0', marginLeft: x + (parseInt($sub.css('border-left-width')) || 0), width: subW - (parseInt($sub.css('border-left-width')) || 0) - (parseInt($sub.css('border-right-width')) || 0), zIndex: $sub.css('z-index') })
39869								.eq(horizontalParent && this.opts.bottomToTopSubMenus ? 0 : 1).show();
39870						// when a menu tree is fixed positioned we allow scrolling via touch too
39871						// since there is no other way to access such long sub menus if no mouse is present
39872						if (this.isFixed()) {
39873							$sub.css({ 'touch-action': 'none', '-ms-touch-action': 'none' })
39874								.bind(getEventsNS([
39875									[touchEvents ? 'touchstart touchmove touchend' : 'pointerdown pointermove pointerup MSPointerDown MSPointerMove MSPointerUp', function(e) {
39876										self.menuScrollTouch($sub, e);
39877									}]
39878								], eNS));
39879						}
39880					}
39881				}
39882				$sub.css({ top: 'auto', left: '0', marginLeft: x, marginTop: y - itemH });
39883				// IE iframe shim
39884				this.menuIframeShim($sub);
39885				if ($sub.dataSM('ie-shim')) {
39886					$sub.dataSM('ie-shim').css({ zIndex: $sub.css('z-index'), width: subW, height: subH, marginLeft: x, marginTop: y - itemH });
39887				}
39888			},
39889			menuScroll: function($sub, once, step) {
39890				var data = $sub.dataSM('scroll'),
39891					$arrows = $sub.dataSM('scroll-arrows'),
39892					end = data.up ? data.upEnd : data.downEnd,
39893					diff;
39894				if (!once && data.momentum) {
39895					data.momentum *= 0.92;
39896					diff = data.momentum;
39897					if (diff < 0.5) {
39898						this.menuScrollStop($sub);
39899						return;
39900					}
39901				} else {
39902					diff = step || (once || !this.opts.scrollAccelerate ? this.opts.scrollStep : Math.floor(data.step));
39903				}
39904				// hide any visible deeper level sub menus
39905				var level = $sub.dataSM('level');
39906				if (this.activatedItems[level - 1] && this.activatedItems[level - 1].dataSM('sub') && this.activatedItems[level - 1].dataSM('sub').is(':visible')) {
39907					this.menuHideSubMenus(level - 1);
39908				}
39909				data.y = data.up && end <= data.y || !data.up && end >= data.y ? data.y : (Math.abs(end - data.y) > diff ? data.y + (data.up ? diff : -diff) : end);
39910				$sub.add($sub.dataSM('ie-shim')).css(this.cssTransforms3d ? { '-webkit-transform': 'translate3d(0, ' + data.y + 'px, 0)', transform: 'translate3d(0, ' + data.y + 'px, 0)' } : { marginTop: data.y });
39911				// show opposite arrow if appropriate
39912				if (mouse && (data.up && data.y > data.downEnd || !data.up && data.y < data.upEnd)) {
39913					$arrows.eq(data.up ? 1 : 0).show();
39914				}
39915				// if we've reached the end
39916				if (data.y == end) {
39917					if (mouse) {
39918						$arrows.eq(data.up ? 0 : 1).hide();
39919					}
39920					this.menuScrollStop($sub);
39921				} else if (!once) {
39922					if (this.opts.scrollAccelerate && data.step < this.opts.scrollStep) {
39923						data.step += 0.2;
39924					}
39925					var self = this;
39926					this.scrollTimeout = requestAnimationFrame(function() { self.menuScroll($sub); });
39927				}
39928			},
39929			menuScrollMousewheel: function($sub, e) {
39930				if (this.getClosestMenu(e.target) == $sub[0]) {
39931					e = e.originalEvent;
39932					var up = (e.wheelDelta || -e.detail) > 0;
39933					if ($sub.dataSM('scroll-arrows').eq(up ? 0 : 1).is(':visible')) {
39934						$sub.dataSM('scroll').up = up;
39935						this.menuScroll($sub, true);
39936					}
39937				}
39938				e.preventDefault();
39939			},
39940			menuScrollOut: function($sub, e) {
39941				if (mouse) {
39942					if (!/^scroll-(up|down)/.test((e.relatedTarget || '').className) && ($sub[0] != e.relatedTarget && !$.contains($sub[0], e.relatedTarget) || this.getClosestMenu(e.relatedTarget) != $sub[0])) {
39943						$sub.dataSM('scroll-arrows').css('visibility', 'hidden');
39944					}
39945				}
39946			},
39947			menuScrollOver: function($sub, e) {
39948				if (mouse) {
39949					if (!/^scroll-(up|down)/.test(e.target.className) && this.getClosestMenu(e.target) == $sub[0]) {
39950						this.menuScrollRefreshData($sub);
39951						var data = $sub.dataSM('scroll'),
39952							upEnd = $(window).scrollTop() - $sub.dataSM('parent-a').offset().top - data.itemH;
39953						$sub.dataSM('scroll-arrows').eq(0).css('margin-top', upEnd).end()
39954							.eq(1).css('margin-top', upEnd + this.getViewportHeight() - data.arrowDownH).end()
39955							.css('visibility', 'visible');
39956					}
39957				}
39958			},
39959			menuScrollRefreshData: function($sub) {
39960				var data = $sub.dataSM('scroll'),
39961					upEnd = $(window).scrollTop() - $sub.dataSM('parent-a').offset().top - data.itemH;
39962				if (this.cssTransforms3d) {
39963					upEnd = -(parseFloat($sub.css('margin-top')) - upEnd);
39964				}
39965				$.extend(data, {
39966					upEnd: upEnd,
39967					downEnd: upEnd + this.getViewportHeight() - data.subH
39968				});
39969			},
39970			menuScrollStop: function($sub) {
39971				if (this.scrollTimeout) {
39972					cancelAnimationFrame(this.scrollTimeout);
39973					this.scrollTimeout = 0;
39974					$sub.dataSM('scroll').step = 1;
39975					return true;
39976				}
39977			},
39978			menuScrollTouch: function($sub, e) {
39979				e = e.originalEvent;
39980				if (isTouchEvent(e)) {
39981					var touchPoint = this.getTouchPoint(e);
39982					// neglect event if we touched a visible deeper level sub menu
39983					if (this.getClosestMenu(touchPoint.target) == $sub[0]) {
39984						var data = $sub.dataSM('scroll');
39985						if (/(start|down)$/i.test(e.type)) {
39986							if (this.menuScrollStop($sub)) {
39987								// if we were scrolling, just stop and don't activate any link on the first touch
39988								e.preventDefault();
39989								this.$touchScrollingSub = $sub;
39990							} else {
39991								this.$touchScrollingSub = null;
39992							}
39993							// update scroll data since the user might have zoomed, etc.
39994							this.menuScrollRefreshData($sub);
39995							// extend it with the touch properties
39996							$.extend(data, {
39997								touchStartY: touchPoint.pageY,
39998								touchStartTime: e.timeStamp
39999							});
40000						} else if (/move$/i.test(e.type)) {
40001							var prevY = data.touchY !== undefined ? data.touchY : data.touchStartY;
40002							if (prevY !== undefined && prevY != touchPoint.pageY) {
40003								this.$touchScrollingSub = $sub;
40004								var up = prevY < touchPoint.pageY;
40005								// changed direction? reset...
40006								if (data.up !== undefined && data.up != up) {
40007									$.extend(data, {
40008										touchStartY: touchPoint.pageY,
40009										touchStartTime: e.timeStamp
40010									});
40011								}
40012								$.extend(data, {
40013									up: up,
40014									touchY: touchPoint.pageY
40015								});
40016								this.menuScroll($sub, true, Math.abs(touchPoint.pageY - prevY));
40017							}
40018							e.preventDefault();
40019						} else { // touchend/pointerup
40020							if (data.touchY !== undefined) {
40021								if (data.momentum = Math.pow(Math.abs(touchPoint.pageY - data.touchStartY) / (e.timeStamp - data.touchStartTime), 2) * 15) {
40022									this.menuScrollStop($sub);
40023									this.menuScroll($sub);
40024									e.preventDefault();
40025								}
40026								delete data.touchY;
40027							}
40028						}
40029					}
40030				}
40031			},
40032			menuShow: function($sub) {
40033				if (!$sub.dataSM('beforefirstshowfired')) {
40034					$sub.dataSM('beforefirstshowfired', true);
40035					if (this.$root.triggerHandler('beforefirstshow.smapi', $sub[0]) === false) {
40036						return;
40037					}
40038				}
40039				if (this.$root.triggerHandler('beforeshow.smapi', $sub[0]) === false) {
40040					return;
40041				}
40042				$sub.dataSM('shown-before', true)
40043					.stop(true, true);
40044				if (!$sub.is(':visible')) {
40045					// highlight parent item
40046					var $a = $sub.dataSM('parent-a');
40047					if (this.opts.keepHighlighted || this.isCollapsible()) {
40048						$a.addClass('highlighted');
40049					}
40050					if (this.isCollapsible()) {
40051						$sub.removeClass('sm-nowrap').css({ zIndex: '', width: 'auto', minWidth: '', maxWidth: '', top: '', left: '', marginLeft: '', marginTop: '' });
40052					} else {
40053						// set z-index
40054						$sub.css('z-index', this.zIndexInc = (this.zIndexInc || this.get
40054StartZIndex()) + 1);
40055						// min/max-width fix - no way to rely purely on CSS as all UL's are nested
40056						if (this.opts.subMenusMinWidth || this.opts.subMenusMaxWidth) {
40057							$sub.css({ width: 'auto', minWidth: '', maxWidth: '' }).addClass('sm-nowrap');
40058							if (this.opts.subMenusMinWidth) {
40059							 	$sub.css('min-width', this.opts.subMenusMinWidth);
40060							}
40061							if (this.opts.subMenusMaxWidth) {
40062							 	var noMaxWidth = this.getWidth($sub);
40063							 	$sub.css('max-width', this.opts.subMenusMaxWidth);
40064								if (noMaxWidth > this.getWidth($sub)) {
40065									$sub.removeClass('sm-nowrap').css('width', this.opts.subMenusMaxWidth);
40066								}
40067							}
40068						}
40069						this.menuPosition($sub);
40070						// insert IE iframe shim
40071						if ($sub.dataSM('ie-shim')) {
40072							$sub.dataSM('ie-shim').insertBefore($sub);
40073						}
40074					}
40075					var complete = function() {
40076						// fix: "overflow: hidden;" is not reset on animation complete in jQuery < 1.9.0 in Chrome when global "box-sizing: border-box;" is used
40077						$sub.css('overflow', '');
40078					};
40079					// if sub is collapsible (mobile view)
40080					if (this.isCollapsible()) {
40081						if (this.opts.collapsibleShowFunction) {
40082							this.opts.collapsibleShowFunction.call(this, $sub, complete);
40083						} else {
40084							$sub.show(this.opts.collapsibleShowDuration, complete);
40085						}
40086					} else {
40087						if (this.opts.showFunction) {
40088							this.opts.showFunction.call(this, $sub, complete);
40089						} else {
40090							$sub.show(this.opts.showDuration, complete);
40091						}
40092					}
40093					// accessibility
40094					$a.attr('aria-expanded', 'true');
40095					$sub.attr({
40096						'aria-expanded': 'true',
40097						'aria-hidden': 'false'
40098					});
40099					// store sub menu in visible array
40100					this.visibleSubMenus.push($sub);
40101					this.$root.triggerHandler('show.smapi', $sub[0]);
40102				}
40103			},
40104			popupHide: function(noHideTimeout) {
40105				if (this.hideTimeout) {
40106					clearTimeout(this.hideTimeout);
40107					this.hideTimeout = 0;
40108				}
40109				var self = this;
40110				this.hideTimeout = setTimeout(function() {
40111					self.menuHideAll();
40112				}, noHideTimeout ? 1 : this.opts.hideTimeout);
40113			},
40114			popupShow: function(left, top) {
40115				if (!this.opts.isPopup) {
40116					alert('SmartMenus jQuery Error:\n\nIf you want to show this menu via the "popupShow" method, set the isPopup:true option.');
40117					return;
40118				}
40119				if (this.hideTimeout) {
40120					clearTimeout(this.hideTimeout);
40121					this.hideTimeout = 0;
40122				}
40123				this.$root.dataSM('shown-before', true)
40124					.stop(true, true);
40125				if (!this.$root.is(':visible')) {
40126					this.$root.css({ left: left, top: top });
40127					// IE iframe shim
40128					this.menuIframeShim(this.$root);
40129					if (this.$root.dataSM('ie-shim')) {
40130						this.$root.dataSM('ie-shim').css({ zIndex: this.$root.css('z-index'), width: this.getWidth(this.$root), height: this.getHeight(this.$root), left: left, top: top }).insertBefore(this.$root);
40131					}
40132					// show menu
40133					var self = this,
40134						complete = function() {
40135							self.$root.css('overflow', '');
40136						};
40137					if (this.opts.showFunction) {
40138						this.opts.showFunction.call(this, this.$root, complete);
40139					} else {
40140						this.$root.show(this.opts.showDuration, complete);
40141					}
40142					this.visibleSubMenus[0] = this.$root;
40143				}
40144			},
40145			refresh: function() {
40146				this.destroy(true);
40147				this.init(true);
40148			},
40149			rootKeyDown: function(e) {
40150				if (!this.handleEvents()) {
40151					return;
40152				}
40153				switch (e.keyCode) {
40154					case 27: // reset on Esc
40155						var $activeTopItem = this.activatedItems[0];
40156						if ($activeTopItem) {
40157							this.menuHideAll();
40158							$activeTopItem[0].focus();
40159							var $sub = $activeTopItem.dataSM('sub');
40160							if ($sub) {
40161								this.menuHide($sub);
40162							}
40163						}
40164						break;
40165					case 32: // activate item's sub on Space
40166						var $target = $(e.target);
40167						if ($target.is('a') && this.handleItemEvents($target)) {
40168							var $sub = $target.dataSM('sub');
40169							if ($sub && !$sub.is(':visible')) {
40170								this.itemClick({ currentTarget: e.target });
40171								e.preventDefault();
40172							}
40173						}
40174						break;
40175				}
40176			},
40177			rootOut: function(e) {
40178				if (!this.handleEvents() || this.isTouchMode() || e.target == this.$root[0]) {
40179					return;
40180				}
40181				if (this.hideTimeout) {
40182					clearTimeout(this.hideTimeout);
40183					this.hideTimeout = 0;
40184				}
40185				if (!this.opts.showOnClick || !this.opts.hideOnClick) {
40186					var self = this;
40187					this.hideTimeout = setTimeout(function() { self.menuHideAll(); }, this.opts.hideTimeout);
40188				}
40189			},
40190			rootOver: function(e) {
40191				if (!this.handleEvents() || this.isTouchMode() || e.target == this.$root[0]) {
40192					return;
40193				}
40194				if (this.hideTimeout) {
40195					clearTimeout(this.hideTimeout);
40196					this.hideTimeout = 0;
40197				}
40198			},
40199			winResize: function(e) {
40200				if (!this.handleEvents()) {
40201					// we still need to resize the disable overlay if it's visible
40202					if (this.$disableOverlay) {
40203						var pos = this.$root.offset();
40204	 					this.$disableOverlay.css({
40205							top: pos.top,
40206							left: pos.left,
40207							width: this.$root.outerWidth(),
40208							height: this.$root.outerHeight()
40209						});
40210					}
40211					return;
40212				}
40213				// hide sub menus on resize - on mobile do it only on orientation change
40214				if (!('onorientationchange' in window) || e.type == 'orientationchange') {
40215					var isCollapsible = this.isCollapsible();
40216					// if it was collapsible before resize and still is, don't do it
40217					if (!(this.wasCollapsible && isCollapsible)) { 
40218						if (this.activatedItems.length) {
40219							this.activatedItems[this.activatedItems.length - 1][0].blur();
40220						}
40221						this.menuHideAll();
40222					}
40223					this.wasCollapsible = isCollapsible;
40224				}
40225			}
40226		}
40227	});
40228
40229	$.fn.dataSM = function(key, val) {
40230		if (val) {
40231			return this.data(key + '_smartmenus', val);
40232		}
40233		return this.data(key + '_smartmenus');
40234	};
40235
40236	$.fn.removeDataSM = function(key) {
40237		return this.removeData(key + '_smartmenus');
40238	};
40239
40240	$.fn.smartmenus = function(options) {
40241		if (typeof options == 'string') {
40242			var args = arguments,
40243				method = options;
40244			Array.prototype.shift.call(args);
40245			return this.each(function() {
40246				var smartmenus = $(this).data('smartmenus');
40247				if (smartmenus && smartmenus[method]) {
40248					smartmenus[method].apply(smartmenus, args);
40249				}
40250			});
40251		}
40252		return this.each(function() {
40253			// [data-sm-options] attribute on the root UL
40254			var dataOpts = $(this).data('sm-options') || null;
40255			if (dataOpts) {
40256				try {
40257					dataOpts = eval('(' + dataOpts + ')');
40258				} catch(e) {
40259					dataOpts = null;
40260					alert('ERROR\n\nSmartMenus jQuery init:\nInvalid "data-sm-options" attribute value syntax.');
40261				};
40262			}
40263			new $.SmartMenus(this, $.extend({}, $.fn.smartmenus.defaults, options, dataOpts));
40264		});
40265	};
40266
40267	// default settings
40268	$.fn.smartmenus.defaults = {
40269		isPopup:		false,		// is this a popup menu (can be shown via the popupShow/popupHide methods) or a permanent menu bar
40270		mainMenuSubOffsetX:	0,		// pixels offset from default position
40271		mainMenuSubOffsetY:	0,		// pixels offset from default position
40272		subMenusSubOffsetX:	0,		// pixels offset from default position
40273		subMenusSubOffsetY:	0,		// pixels offset from default position
40274		subMenusMinWidth:	'10em',		// min-width for the sub menus (any CSS unit) - if set, the fixed width set in CSS will be ignored
40275		subMenusMaxWidth:	'20em',		// max-width for the sub menus (any CSS unit) - if set, the fixed width set in CSS will be ignored
40276		subIndicators: 		true,		// create sub menu indicators - creates a SPAN and inserts it in the A
40277		subIndicatorsPos: 	'prepend',	// position of the SPAN relative to the menu item content ('prepend', 'append')
40278		subIndicatorsText:	'+',		// [optionally] add text in the SPAN (e.g. '+') (you may want to check the CSS for the sub indicators too)
40279		scrollStep: 		30,		// pixels step when scrolling long sub menus that do not fit in the viewport height
40280		scrollAccelerate:	true,		// accelerate scrolling or use a fixed step
40281		showTimeout:		250,		// timeout before showing the sub menus
40282		hideTimeout:		500,		// timeout before hiding the sub menus
40283		showDuration:		0,		// duration for show animation - set to 0 for no animation - matters only if showFunction:null
40284		showFunction:		null,		// custom function to use when showing a sub menu (the default is the jQuery 'show')
40285							// don't forget to call complete() at the end of whatever you do
40286							// e.g.: function($ul, complete) { $ul.fadeIn(250, complete); }
40287		hideDuration:		0,		// duration for hide animation - set to 0 for no animation - matters only if hideFunction:null
40288		hideFunction:		function($ul, complete) { $ul.fadeOut(200, complete); },	// custom function to use when hiding a sub menu (the default is the jQuery 'hide')
40289							// don't forget to call complete() at the end of whatever you do
40290							// e.g.: function($ul, complete) { $ul.fadeOut(250, complete); }
40291		collapsibleShowDuration:0,		// duration for show animation for collapsible sub menus - matters only if collapsibleShowFunction:null
40292		collapsibleShowFunction:function($ul, complete) { $ul.slideDown(200, complete); },	// custom function to use when showing a collapsible sub menu
40293							// (i.e. when mobile styles are used to make the sub menus collapsible)
40294		collapsibleHideDuration:0,		// duration for hide animation for collapsible sub menus - matters only if c
40294ollapsibleHideFunction:null
40295		collapsibleHideFunction:function($ul, complete) { $ul.slideUp(200, complete); },	// custom function to use when hiding a collapsible sub menu
40296							// (i.e. when mobile styles are used to make the sub menus collapsible)
40297		showOnClick:		false,		// show the first-level sub menus onclick instead of onmouseover (i.e. mimic desktop app menus) (matters only for mouse input)
40298		hideOnClick:		true,		// hide the sub menus on click/tap anywhere on the page
40299		noMouseOver:		false,		// disable sub menus activation onmouseover (i.e. behave like in touch mode - use just mouse clicks) (matters only for mouse input)
40300		keepInViewport:		true,		// reposition the sub menus if needed to make sure they always appear inside the viewport
40301		keepHighlighted:	true,		// keep all ancestor items of the current sub menu highlighted (adds the 'highlighted' class to the A's)
40302		markCurrentItem:	false,		// automatically add the 'current' class to the A element of the item linking to the current URL
40303		markCurrentTree:	true,		// add the 'current' class also to the A elements of all ancestor items of the current item
40304		rightToLeftSubMenus:	false,		// right to left display of the sub menus (check the CSS for the sub indicators' position)
40305		bottomToTopSubMenus:	false,		// bottom to top display of the sub menus
40306		overlapControlsInIE:	true		// make sure sub menus appear on top of special OS controls in IE (i.e. SELECT, OBJECT, EMBED, etc.)
40307	};
40308
40309	return $;
40310}));
40311/*
40312 * SmartMenus jQuery Bootstrap Addon - v0.3.1+
40313 * http://www.smartmenus.org/
40314 *
40315 * Copyright Vasil Dinkov, Vadikom Web Ltd.
40316 * http://vadikom.com/
40317 *
40318 * Released under the MIT license:
40319 * http://www.opensource.org/licenses/MIT
40320 */
40321
40322(function(factory) {
40323	if (typeof define === 'function' && define.amd) {
40324		// AMD
40325		define(['jquery', 'smartmenus'], factory);
40326	} else if (typeof module === 'object' && typeof module.exports === 'object') {
40327		// CommonJS
40328		module.exports = factory(require('jquery'));
40329	} else {
40330		// Global jQuery
40331		factory(jQuery);
40332	}
40333} (function($) {
40334
40335	$.extend($.SmartMenus.Bootstrap = {}, {
40336		keydownFix: false,
40337		init: function() {
40338			// init all navbars that don't have the "data-sm-skip" attribute set
40339			var $navbars = $('ul.navbar-nav:not([data-sm-skip])');
40340			$navbars.each(function() {
40341				var $this = $(this),
40342					obj = $this.data('smartmenus');
40343				// if this navbar is not initialized
40344				if (!obj) {
40345					$this.smartmenus({
40346
40347							// these are some good default options that should work for all
40348							// you can, of course, tweak these as you like
40349							subMenusSubOffsetX: 2,
40350							subMenusSubOffsetY: -6,
40351							subIndicators: false,
40352							collapsibleShowFunction: null,
40353							collapsibleHideFunction: null,
40354							rightToLeftSubMenus: $this.hasClass('navbar-right'),
40355							bottomToTopSubMenus: $this.closest('.navbar').hasClass('navbar-fixed-bottom')
40356						})
40357						.bind({
40358							// set/unset proper Bootstrap classes for some menu elements
40359							'show.smapi': function(e, menu) {
40360								var $menu = $(menu),
40361									$scrollArrows = $menu.dataSM('scroll-arrows');
40362								if ($scrollArrows) {
40363									// they inherit border-color from body, so we can use its background-color too
40364									$scrollArrows.css('background-color', $(document.body).css('background-color'));
40365								}
40366								$menu.parent().addClass('open');
40367							},
40368							'hide.smapi': function(e, menu) {
40369								$(menu).parent().removeClass('open');
40370							}
40371						});
40372
40373					function onInit() {
40374						// set Bootstrap's "active" class to SmartMenus "current" items (should someone decide to enable markCurrentItem: true)
40375						$this.find('a.current').parent().addClass('active');
40376						// remove any Bootstrap required attributes that might cause conflicting issues with the SmartMenus script
40377						$this.find('a.has-submenu').each(function() {
40378							var $this = $(this);
40379							if ($this.is('[data-toggle="dropdown"]')) {
40380								$this.dataSM('bs-data-toggle-dropdown', true).removeAttr('data-toggle');
40381							}
40382							if ($this.is('[role="button"]')) {
40383								$this.dataSM('bs-role-button', true).removeAttr('role');
40384							}
40385						});
40386					}
40387
40388					onInit();
40389
40390					function onBeforeDestroy() {
40391						$this.find('a.current').parent().removeClass('active');
40392						$this.find('a.has-submenu').each(function() {
40393							var $this = $(this);
40394							if ($this.dataSM('bs-data-toggle-dropdown')) {
40395								$this.attr('data-toggle', 'dropdown').removeDataSM('bs-data-toggle-dropdown');
40396							}
40397							if ($this.dataSM('bs-role-button')) {
40398								$this.attr('role', 'button').removeDataSM('bs-role-button');
40399							}
40400						});
40401					}
40402
40403					obj = $this.data('smartmenus');
40404
40405					// custom "isCollapsible" method for Bootstrap
40406					obj.isCollapsible = function() {
40407						return !/^(left|right)$/.test(this.$firstLink.parent().css('float')) && this.$root.css('display') == 'block';
40408					};
40409
40410					// custom "refresh" method for Bootstrap
40411					obj.refresh = function() {
40412						$.SmartMenus.prototype.refresh.call(this);
40413						onInit();
40414						// update collapsible detection
40415						detectCollapsible(true);
40416					};
40417
40418					// custom "destroy" method for Bootstrap
40419					obj.destroy = function(refresh) {
40420						onBeforeDestroy();
40421						$.SmartMenus.prototype.destroy.call(this, refresh);
40422					};
40423
40424					// keep Bootstrap's default behavior for parent items when the "data-sm-skip-collapsible-behavior" attribute is set to the ul.navbar-nav
40425					// i.e. use the whole item area just as a sub menu toggle and don't customize the carets
40426					if ($this.is('[data-sm-skip-collapsible-behavior]')) {
40427						$this.bind({
40428							// click the parent item to toggle the sub menus (and reset deeper levels and other branches on click)
40429							'click.smapi': function(e, item) {
40430								if (obj.isCollapsible()) {
40431									var $item = $(item),
40432										$sub = $item.parent().dataSM('sub');
40433									if ($sub && $sub.dataSM('shown-before') && $sub.is(':visible')) {
40434										obj.itemActivate($item);
40435										obj.menuHide($sub);
40436										return false;
40437									}
40438								}
40439							}
40440						});
40441					}
40442
40443					// onresize detect when the navbar becomes collapsible and add it the "sm-collapsible" class
40444					var winW;
40445					function detectCollapsible(force) {
40446						var newW = obj.getViewportWidth();
40447						if (newW != winW || force) {
40448							var $carets = $this.find('.caret');
40449							if (obj.isCollapsible()) {
40450								$this.addClass('sm-collapsible');
40451								// set "navbar-toggle" class to carets (so they look like a button) if the "data-sm-skip-collapsible-behavior" attribute is not set to the ul.navbar-nav
40452								if (!$this.is('[data-sm-skip-collapsible-behavior]')) {
40453									$carets.addClass('navbar-toggle sub-arrow');
40454								}
40455							} else {
40456								$this.removeClass('sm-collapsible');
40457								if (!$this.is('[data-sm-skip-collapsible-behavior]')) {
40458									$carets.removeClass('navbar-toggle sub-arrow');
40459								}
40460							}
40461							winW = newW;
40462						}
40463					}
40464					detectCollapsible();
40465					$(window).bind('resize.smartmenus' + obj.rootId, detectCollapsible);
40466				}
40467			});
40468			// keydown fix for Bootstrap 3.3.5+ conflict
40469			if ($navbars.length && !$.SmartMenus.Bootstrap.keydownFix) {
40470				// unhook BS keydown handler for all dropdowns
40471				$(document).off('keydown.bs.dropdown.data-api', '.dropdown-menu');
40472				// restore BS keydown handler for dropdowns that are not inside SmartMenus navbars
40473				if ($.fn.dropdown && $.fn.dropdown.Constructor) {
40474					$(document).on('keydown.bs.dropdown.data-api', '.dropdown-menu:not([id^="sm-"])', $.fn.dropdown.Constructor.prototype.keydown);
40475				}
40476				$.SmartMenus.Bootstrap.keydownFix = true;
40477			}
40478		}
40479	});
40480
40481	// init ondomready
40482	$($.SmartMenus.Bootstrap.init);
40483
40484	return $;
40485}));
40486
40487/*
40488 * YoutubeBackground - A wrapper for the Youtube API - Great for fullscreen background videos or just regular videos.
40489 *
40490 * Licensed under the MIT license:
40491 *   http://www.opensource.org/licenses/mit-license.php
40492 *
40493 *
40494 * Version:  1.0.5
40495 *
40496 */
40497
40498// Chain of Responsibility pattern. Creates base class that can be overridden.
40499if (typeof Object.create !== "function") {
40500  Object.create = function(obj) {
40501    function F() {}
40502    F.prototype = obj;
40503    return new F();
40504  };
40505}
40506
40507(function($, window, document) {
40508 
40509  var
40510    loadAPI = function loadAPI(callback) {
40511
40512      // Load Youtube API
40513      var tag = document.createElement('script'),
40514      head = document.getElementsByTagName('head')[0];
40515      
40516      if(window.location.origin == 'file://') {
40517        tag.src = 'http://www.youtube.com/iframe_api';
40518      } else {
40519        tag.src = '//www.youtube.com/iframe_api';
40520      }
40521      
40522      head.appendChild(tag);
40523
40524      // Clean up Tags.
40525      head = null;
40526      tag = null;
40527
40528      iframeIsReady(callback);
40529    },
40530    iframeIsReady = function iframeIsReady(callback) {
40531      // Listen for Gobal YT player callback
40532      if (typeof YT === 'undefined' && typeof window.loadingPlayer === 'undefined') {
40533        // Prevents Ready Event from being called twice
40534        window.loadingPlayer = true;
40535
40536        
40537        // Creates deferred so, other players know when to wait.
40538        window.dfd = $.Deferred();
40539        window.onYouTubeIframeAPIReady = function() {
40540          window.onYouTubeIframeAPIReady = null;
40541          window.dfd.resolve( "done" );
40542          callback();
40543        };
40544      } else if (typeof YT === 'object')  {
40545        callback();
40546      } else {
40547        window.dfd.done(function( name ) {
40548          callback();
40549        });
40550      }
40551    };
40552
40553  // YTPlayer Object
40554  YTPlayer = {
40555    player: null,
40556
40557    // Defaults
40558    defaults: {
40559      ratio: 16 / 9,
40560      videoId: 'LSmgKRx5pBo',
40561      mute: true,
40562      repeat: true,
40563      width: $(window).width(),
40564      playButtonClass: 'YTPlayer-play',
40565      pauseButtonClass: 'YTPlayer-pause',
40566      muteButtonClass: 'YTPlayer-mute',
40567      volumeUpClass: 'YTPlayer-volume-up',
40568      volumeDownClass: 'YTPlayer-volume-down',
40569      start: 0,
40570      pauseOnScroll: false,
40571      fitToBackground: true,
40572      playerVars: {
40573        rel:0,
40574        iv_load_policy: 3,
40575        modestbranding: 1,
40576        autoplay: 1,
40577        controls: 0,
40578        showinfo: 0,
40579        wmode: 'opaque',
40580        branding: 0,
40581        autohide: 0
40582      },
40583      events: null
40584    },
40585
40586    /**
40587     * @function init
40588     * Intializes YTPlayer object
40589     */
40590    init: function init(node, userOptions) {
40591      var self = this;
40592
40593      self.userOptions = userOptions;
40594
40595      self.$body = $('body'),
40596      self.$node = $(node),
40597      self.$window = $(window);
40598
40599      // Setup event defaults with the reference to this
40600      self.defaults.events = {
40601        'onReady': function(e) {
40602          self.onPlayerReady(e);
40603
40604          // setup up pause on scroll
40605          if (self.options.pauseOnScroll) {
40606            self.pauseOnScroll();
40607          }
40608
40609          // Callback for when finished
40610          if (typeof self.options.callback == 'function') {
40611            self.options.callback.call(this);
40612          }
40613        },
40614        'onStateChange': function(e) {
40615          if (e.data === 1) {
40616
40617            self.$node.find('img').fadeOut(400);
40618            self.$node.addClass('loaded');
40619          } else if (e.data === 0 && self.options.repeat) { // video ended and repeat option is set true
40620            self.player.seekTo(self.options.start);
40621          }
40622        }
40623      }
40624
40625
40626      self.options = $.extend(true, {}, self.defaults, self.userOptions);
40627      self.options.height = Math.ceil(self.options.width / self.options.ratio);
40628      self.ID = (new Date()).getTime();
40629      self.holderID = 'YTPlayer-ID-' + self.ID;
40630
40631      if (self.options.fitToBackground) {
40632        self.createBackgroundVideo();
40633      } else {
40634        self.createContainerVideo();
40635      }
40636      // Listen for Resize Event
40637      self.$window.on('resize.YTplayer' + self.ID, function() {
40638        self.resize(self);
40639      });
40640
40641      loadAPI(self.onYouTubeIframeAPIReady.bind(self));
40642
40643      self.resize(self);
40644
40645      return self;
40646    },
40647
40648
40649    /**
40650     * @function pauseOnScroll
40651     * Adds window events to pause video on scroll.
40652     */
40653    pauseOnScroll: function pauseOnScroll() {
40654      var self = this;
40655      /*self.$window.on('scroll.YTplayer' + self.ID, function() {
40656        var state = self.player.getPlayerState();
40657        if (state === 1) {
40658          self.player.pauseVideo();
40659        }
40660      });
40661      self.$window.scrollStopped(function(){
40662        var state = self.player.getPlayerState();
40663        if (state === 2) {
40664          self.player.playVideo();
40665        }
40666      });*/
40667    },
40668    /**
40669     * @function createContainerVideo
40670     * Adds HTML for video in a container
40671     */
40672    createContainerVideo: function createContainerVideo() {
40673      var self = this;
40674
40675      /*jshint multistr: true */
40676      var $YTPlayerString = $('<div id="ytplayer-container' + self.ID + '" >\
40677                                    <div id="' + self.holderID + '" class="ytplayer-player-inline"></div> \
40678                                    </div> \
40679                                    <div id="ytplayer-shield" class="ytplayer-shield"></div>');
40680
40681      self.$node.append($YTPlayerString);
40682      self.$YTPlayerString = $YTPlayerString;
40683      $YTPlayerString = null;
40684    },
40685
40686    /**
40687     * @function createBackgroundVideo
40688     * Adds HTML for video background
40689     */
40690    createBackgroundVideo: function createBackgroundVideo() {
40691      /*jshint multistr: true */
40692    
40693      var self = this,
40694        $YTPlayerString = $('<div id="ytplayer-container' + self.ID + '" class="ytplayer-container background">\
40695                                    <div id="' + self.holderID + '" class="ytplayer-player"></div>\
40696                                    </div>\
40697                                    <div id="ytplayer-shield" class="ytplayer-shield"></div>');
40698
40699      self.$node.append($YTPlayerString);
40700      self.$YTPlayerString = $YTPlayerString;
40701      $YTPlayerString = null;
40702    },
40703
40704    /**
40705     * @function resize
40706     * Resize event to change video size
40707     */
40708    resize: function resize(self) {
40709      //var self = this;
40710      var container = $(window);
40711
40712      if (!self.options.fitToBackground) {
40713        container = self.$node;
40714      }
40715
40716      var width = container.width(),
40717        pWidth, // player width, to be defined
40718        height = container.height(),
40719        pHeight, // player height, tbd
40720        $YTPlayerPlayer = $('#' + self.holderID);
40721
40722      // when screen aspect ratio differs from video, video must center and underlay one dimension
40723      if (width / self.options.ratio < height) {
40724        pWidth = Math.ceil(height * self.options.ratio); // get new player width
40725        $YTPlayerPlayer.width(pWidth).height(height).css({
40726          left: (width - pWidth) / 2,
40727          top: 0
40728        }); // player width is greater, offset left; reset top
40729      } else { // new video width < window width (gap to right)
40730        pHeight = Math.ceil(width / self.options.ratio); // get new player height
40731        $YTPlayerPlayer.width(width).height(pHeight).css({
40732          left: 0,
40733          top: (height - pHeight) / 2
40734        }); // player height is greater, offset top; reset left
40735      }
40736
40737      $YTPlayerPlayer = null;
40738      container = null;
40739    },
40740
40741    /**
40742     * @function onYouTubeIframeAPIReady
40743     * @ params {object} YTPlayer object for access to options
40744     * Youtube API calls this function when the player is ready.
40745     */
40746    onYouTubeIframeAPIReady: function onYouTubeIframeAPIReady() {
40747      var self = this;
40748      self.player = new window.YT.Player(self.holderID, self.options);  
40749    },
40750
40751    /**
40752     * @function onPlayerReady
40753     * @ params {event} window event from youtube player
40754     */
40755    onPlayerReady: function onPlayerReady(e) {
40756      if (this.options.mute) {
40757        e.target.mute();
40758      }
40759      e.target.playVideo();
40760    },
40761
40762    /**
40763     * @function getPlayer
40764     * returns youtube player
40765     */
40766    getPlayer: function getPlayer() {
40767      return this.player;
40768    },
40769
40770    /**
40771     * @function destroy
40772     * destroys all!
40773     */
40774    destroy: function destroy() {
40775      var self = this;
40776
40777      self.$node
40778        .removeData('yt-init')
40779        .removeData('ytPlayer')
40780        .removeClass('loaded');
40781
40782      self.$YTPlayerString.remove();
40783
40784      $(window).off('resize.YTplayer' + self.ID);
40785      $(window).off('scroll.YTplayer' + self.ID);
40786      self.$body = null;
40787      self.$node = null;
40788      self.$YTPlayerString = null;
40789      self.player.destroy();
40790      self.player = null;
40791    }
40792  };
40793
40794  // Scroll Stopped event.
40795  $.fn.scrollStopped = function(callback) {
40796    var $this = $(this), self = this;
40797    $this.scroll(function(){
40798      if ($this.data('scrollTimeout')) {
40799        clearTimeout($this.data('scrollTimeout'));
40800      }
40801      $this.data('scrollTimeout', setTimeout(callback,250,self));
40802    });
40803  };
40804
40805  // Create plugin
40806  $.fn.YTPlayer = function(options) {
40807
40808    return this.each(function() {
40809      var el = this;
40810
40811      $(el).data("yt-init", true);
40812      var player = Object.create(YTPlayer);
40813      player.init(el, options);
40814      $.data(el, "ytPlayer", player);
40815    });
40816  };
40817
40818})(jQuery, window, document);
40819
40820$(document).ready(function(){
40821
40822	
40823
40824	//TAB TOGGLE
40825	jQuery(".nav-tabs .btn-toggle").click(function(event) {
40826		jQuery(this).parent().find(".nav-tabs").slideToggle();
40827	});
40828
40829
40830	//tx_fe_login
40831	jQuery(".tx-felogin-pi1 input[type=submit]").addClass('btn btn-success');
40832
40833
40834	//Best western booking
40835	jQuery("#collapse_btn").click(function(event) {
40836		/* Act on the event */
40837
40838		var isVisible = jQuery(".booking_holder").is(":visible");
40839		if(isVisible)
40840		{
40841			jQuery(".booking_holder").slideUp();
40842		}else{
40843			jQuery(".booking_holder").slideDown();
40844		}
40845	});
40846
40847
40848	jQuery(".rooms_btn").click(function(event) {
40849		/* Act on the event */
40850		var isVisible = jQuery(".rooms_container").is(":visible");
40851		if(isVisible)
40852		{
40853			jQuery(".rooms_container").slideUp();
40854		}else{
40855			jQuery(".rooms_container").slideDown();
40856		}
40857	});
40858
40859
40860	//Techhotel booking kort
40861	var isTechotelSmall = jQuery(".top_booking_form .bookingFormKort").parent().length;
40862
40863	if(isTechotelSmall != 0)
40864	{
40865
40866		var obj = jQuery(".navbar-header");
40867		obj.append(jQuery(".top_booking_form .bookingFormKort").parent());
40868
40869		var deleted = false;
40870		jQuery(".navbar-header .tx-idefahotelbooking-pi1, #main-home-wrapper .tx-idefahotelbooking-pi1").each(function(index, el) {
40871			if(deleted == false)
40872			{
40873				jQuery(this).remove();
40874				deleted = true;
40875			}
40876		});
40877
40878		jQuery(".navbar-header .tx-idefahotelbooking-pi1 h1, #main-home-wrapper .tx-idefahotelbooking-pi1 h1").addClass('show_booking');
40879
40880		//Settings arrival day
40881		jQuery("#arrivalDay").change(function(event) {
40882
40883			var arrDayValue = jQuery(".arrivalDay option:selected").val();
40884			jQuery("#arrivalDayPretty").text(arrDayValue);
40885			var arrMonthValue = jQuery(".arrivalMonth option:selected").text();
40886			jQuery("#arrivalMonthPretty").text(arrMonthValue.substring(0, 3).toLowerCase());
40887			var arrYearValue = jQuery(".arrivalYear option:selected").val();
40888			jQuery("#arrivalYearPretty").text(arrYearValue);
40889		});
40890
40891		var arrDayValue = jQuery(".arrivalDay option:selected").val();
40892		var arrMonthValue = jQuery(".arrivalMonth option:selected").text();
40893		var arrYearValue = jQuery(".arrivalYear option:selected").val();
40894		jQuery("#arrivalDayPretty").text(arrDayValue);
40895		jQuery("#arrivalMonthPretty").text(arrMonthValue.substring(0, 3).toLowerCase());
40896
40897
40898		jQuery("#arrivalYearPretty").text(arrYearValue);
40899
40900		var depDayValue = jQuery(".departureDay option:selected").val();
40901		var depMonthValue = jQuery(".departureMonth option:selected").text();
40902		var depYearValue = jQuery(".departureYear option:selected").val();
40903
40904		jQuery("#depDayPretty").text(depDayValue);
40905		jQuery("#depMonthPretty").text(depMonthValue.substring(0, 3).toLowerCase());
40906		jQuery("#depYearPretty").text(depYearValue);
40907
40908		jQuery(window).scroll(function(event) {
40909
40910			var smallNavbar = jQuery(".navbar-stuck").is(":visible");
40911			var cur_win_width = jQuery(window).width();
40912			if(smallNavbar)
40913			{
40914				if(cur_win_width > 768)
40915				{
40916					jQuery(".navbar-header .tx-idefahotelbooking-pi1 .bookingFormKort form, #main-home-wrapper .tx-idefahotelbooking-pi1 .bookingFormKort form, .navbar-wrapper .tx-idefahotelbooking-pi1 .bookingFormKort form").hide();
40917				}
40918
40919			}
40920		});
40921
40922	}
40923
40924	jQuery(".navbar-header .tx-idefahotelbooking-pi1 .bookingFormKort h1, #main-home-wrapper .tx-idefahotelbooking-pi1 .bookingFormKort h1, .tx-idefahotelbooking-pi1 .bookingFormKort h1").click(function(event) {
40925
40926		if(jQuery(".navbar-header .tx-idefahotelbooking-pi1 .bookingFormKort form, #main-home-wrapper .tx-idefahotelbooking-pi1 .bookingFormKort form, .tx-idefahotelbooking-pi1 .bookingFormKort form").is(":visible"))
40927		{
40928			jQuery(".navbar-header .tx-idefahotelbooking-pi1 .bookingFormKort form, #main-home-wrapper .tx-idefahotelbooking-pi1 .bookingFormKort form, .tx-idefahotelbooking-pi1 .bookingFormKort form").slideUp();
40929		}else {
40930			jQuery(".navbar-header .tx-idefahotelbooking-pi1 .bookingFormKort form, #main-home-wrapper .tx-idefahotelbooking-pi1 .bookingFormKort form, .tx-idefahotelbooking-pi1 .bookingFormKort form").slideDown();
40931		}
40932
40933	});
40934
40935	var windowSize = jQuery(window).width();
40936
40937	if(windowSize <= 768)
40938	{
40939		var mainhome = jQuery("#main-home-wrapper").length;
40940	
40941		if(mainhome != 0)
40942		{
40943			jQuery(".navbar-header .tx-idefahotelbooking-pi1").prependTo("#main-home-wrapper");
40944		}else{
40945			jQuery(".navbar-header .tx-idefahotelbooking-pi1").prependTo("#page-wrapper");
40946		}
40947		
40948	}
40949
40950	//Techhotel booking aflang
40951	var isTechhotel = jQuery('.top_booking_form .bookingFormAflang').parent().length;
40952
40953	if(isTechhotel != 0){
40954		$("#navbar #menu-main-navigation-menu").append("<li class='collapse_booking'><span class='glyphicon glyphicon-calendar' aria-hidden='true'></span></li>");
40955		var obj = jQuery("nav.navbar .container:first-child");
40956		obj.append(jQuery(".top_booking_form .bookingFormAflang").parent());
40957		jQuery(".navbar-header").append('<span class="glyphicon glyphicon-calendar" id="mobile_booking_btn" aria-hidden="true"></span>');
40958		var deleted = false;
40959		jQuery("nav.navbar .container:first-child .tx-idefahotelbooking-pi1").each(function(index, el) {
40960			if(deleted == false)
40961			{
40962				jQuery(this).remove();
40963				deleted = true;
40964			}
40965		});
40966		jQuery("nav.navbar .tx-idefahotelbooking-pi1").fadeIn();
40967
40968		var bookingIsVisible = jQuery("nav.navbar .tx-idefahotelbooking-pi1").is(":visible");
40969		if(bookingIsVisible)
40970		{
40971			jQuery(".navbar-header").attr("style", "margin-bottom: 0 !important;");
40972
40973		}
40974
40975		jQuery(".collapse_booking").attr("style", "width: 58px; height: 49px;");
40976
40977		jQuery("nav.navbar .tx-idefahotelbooking-pi1 .dp-applied img").attr("src", "/typo3conf/ext/idefa_hotelbooking/templates/barcelona_booking/calimg.png");
40978		jQuery("nav.navbar .tx-idefahotelbooking-pi1 .dp-applied").fadeIn();
40979		jQuery("nav.navbar .tx-idefahotelbooking-pi1 .dp-applied").attr("style", "display: block;");
40980
40981		var currentScroll = jQuery(document).scrollTop();
40982
40983		if(currentScroll > 319)
40984		{
40985			jQuery("nav.navbar .tx-idefahotelbooking-pi1").hide();
40986			jQuery(".collapse_booking").show();
40987
40988		}else
40989		{
40990			jQuery("nav.navbar .tx-idefahotelbooking-pi1").show();
40991			jQuery(".collapse_booking").hide();
40992		}
40993
40994
40995		$(window).scroll(function(event) {
40996
40997			var currentScroll = jQuery(document).scrollTop();
40998
40999			if(currentScroll >  290)
41000			{
41001				jQuery("nav.navbar .tx-idefahotelbooking-pi1").hide();
41002				jQuery(".collapse_booking").show();
41003			}else
41004			{
41005				jQuery("nav.navbar .tx-idefahotelbooking-pi1").show();
41006				jQuery(".collapse_booking").hide();
41007			}
41008		});
41009
41010
41011		//Techhotel slider function
41012		jQuery(".collapse_booking").click(function(event) {
41013			/* Act on the event */
41014			var isBookingVisible = jQuery("nav.navbar .tx-idefahotelbooking-pi1").is(":visible");
41015
41016			if(!isBookingVisible)
41017			{
41018				jQuery("nav.navbar .tx-idefahotelbooking-pi1").slideDown();
41019			}else{
41020				jQuery("nav.navbar .tx-idefahotelbooking-pi1").slideUp();
41021			}
41022		});
41023
41024		jQuery("#mobile_booking_btn").click(function(event) {
41025		/* Act on the event */
41026		var isBookingVisible = jQuery("nav.navbar .tx-idefahotelbooking-pi1").is(":visible");
41027
41028		if(!isBookingVisible)
41029		{
41030			jQuery("nav.navbar .tx-idefahotelbooking-pi1").slideDown();
41031		}else{
41032			jQuery("nav.navbar .tx-idefahotelbooking-pi1").slideUp();
41033		}
41034		});
41035
41036		var windowWidth = jQuery(window).width();
41037		if(windowWidth <= 768)
41038		{
41039			jQuery("nav.navbar .tx-idefahotelbooking-pi1").attr("style", "display: none;");
41040		}else{
41041			jQuery("nav.navbar .tx-idefahotelbooking-pi1").attr("style", "display: block;");
41042		}
41043
41044		jQuery(window).resize(function(event) {
41045			if(windowWidth <= 768)
41046			{
41047			jQuery("nav.navbar .tx-idefahotelbooking-pi1").attr("style", "display: none;");
41048			}else{
41049				jQuery("nav.navbar .tx-idefahotelbooking-pi1").attr("style", "display: block;");
41050			}
41051		});
41052
41053	}
41054
41055
41056	//HotelBooking top
41057	var isEvolution = jQuery(".tx-idefahotelbooking-pi4").length;
41058	if(isEvolution != 0)
41059	{
41060
41061		$("#navbar #menu-main-navigation-menu").append("<li class='collapse_booking'></li>");
41062		var fixedNavbarState = $("nav.navbar").hasClass('navbar-stuck');
41063
41064		if(fixedNavbarState == true)
41065		{
41066			jQuery("#ui-datepicker-div").css("position", "fixed");
41067			jQuery("#ui-datepicker-div").css("top", "100px !important");
41068
41069			$(".collapse_booking").attr("style", "display: block;");
41070		}else
41071		{
41072			$(".collapse_booking").attr("style", "display: none;");
41073		}
41074
41075		$(".book-collapse").appendTo(".collapse_booking");
41076
41077		$(window).scroll(function(event) {
41078			var fixedNavbarState = $("nav.navbar").hasClass('navbar-stuck');
41079			if(fixedNavbarState == true)
41080			{
41081				jQuery("#ui-datepicker-div").css("position", "fixed");
41082				jQuery("#ui-datepicker-div").css("top", "100px !important");
41083				$(".collapse_booking").attr("style", "display: block;");
41084			}else
41085			{
41086				$(".collapse_booking").attr("style", "display: none;");
41087			}
41088		});
41089	}
41090
41091		//Convert formlabels to placeholder
41092		$("form .csc-form-element-textline").each(function(index, el) {
41093
41094			var labelText = $.trim($(this).find("label").text());
41095			$(this).find("label").remove();
41096
41097			$(this).find("input").attr("placeholder", labelText);
41098
41099		});
41100
41101		$("form .csc-form-element-textarea").each(function(index, el) {
41102
41103			var labelText = $.trim($(this).find("label").text());
41104			$(this).find("label").remove();
41105
41106			$(this).find("textarea").attr("placeholder", labelText);
41107
41108		});
41109
41110
41111		$('figure.responsive').picture({ignorePixelRatio:true});
41112		$(".fimg-wrapper.fimg-fw.container").parent('div').addClass('fimg-wrapper fimg-fw');
41113		$(".tab-custom").on('click',function(){
41114			var this_id = $(this).attr('id');
41115			$(".box-header").find('.btn').removeClass('active');
41116			$('.btn-group').find('#'+this_id).addClass('active');
41117			$('.posts-box').find('.posts-wrapper').addClass('hide');
41118			$('.posts-box').find('#content-'+this_id).removeClass('hide');
41119		});
41120	// Sub menu
41121
41122	setTimeout(function(){
41123		$(".ie #sidebar .sidebar-inner .image-center.image-above .col-md-12").css("height","auto");
41124	}, 3000);
41125
41126	$('#navbar ul > li .sub-menu').parent().contents().filter(function(){
41127		return this.nodeType == 3 && $.trim(this.nodeValue).length;
41128	}).wrap('<a href="#"></a>');
41129
41130	//$("#navbar ul > li .sub-menu li .sub-menu").parent().find('a:first').append("<span class='fa fa-caret-right'></span><span class='fa fa-caret-down'></span>");
41131	if ($(window).width() <= 767) {
41132		var _tabCount = 0;
41133		$(".tab-6.tab-v2 .nav.nav-tabs li , .tab-6.tab-v2 .btn-toggle , .tab-3.tab-v1 .nav.nav-tabs li , .tab-3.tab-v1 .btn-toggle, .tab-3.tab-v2 .nav.nav-tabs li , .tab-3.tab-v2 .btn-toggle , .tab-3.tab-v1 .nav.nav-tabs li , .tab-3.tab-v1 .btn-toggle").on('click' , function(e){
41134			e.preventDefault();
41135			setTimeout(function(){
41136				if(_tabCount == 0){
41137					_tabCount = 1;
41138					$(".tab-6.tab-v2 .nav.nav-tabs li:not(.active) , .tab-6.tab-v1 .nav.nav-tabs li:not(.active) , .tab-3.tab-v2 .nav.nav-tabs li:not(.active) , .tab-3.tab-v1 .nav.nav-tabs li:not(.active)").slideDown(300);
41139					//$(".tab-3.tab-v1 .nav.nav-tabs li:not(.active)").slideDown(300);
41140					// console.log("show");
41141				} else {
41142					_tabCount = 0;
41143					// console.log("hide");
41144					$(".tab-6.tab-v2 .nav.nav-tabs li:not(.active) , .tab-6.tab-v1 .nav.nav-tabs li:not(.active) , .tab-3.tab-v2 .nav.nav-tabs li:not(.active) , .tab-3.tab-v1 .nav.nav-tabs li:not(.active)").slideUp(300);
41145					//$(".tab-3.tab-v1 .nav.nav-tabs li:not(.active)").slideUp(300);
41146					return false;
41147				}
41148			}, 300);
41149		});
41150	}
41151
41152	/*var datetime= [];
41153	var datetimeid= [];*/
41154	/*var days_label = jQuery('.navbar-bn.visible-lg.visible-md .datatime.day').text();
41155	var hours_label = jQuery('.navbar-bn.visible-lg.visible-md .datatime.hours').text();
41156	var min_label = jQuery('.navbar-bn.visible-lg.visible-md .datatime.min').text();
41157	var sec_label = jQuery('.navbar-bn.visible-lg.visible-md .datatime.sec').text();
41158	if (days_label == '' || days_label == 'unidentified' ){
41159		days_label='days';
41160	}
41161	if (hours_label == '' || hours_label == 'unidentified' ){
41162		hours_label='hours';
41163	}
41164	if (min_label == '' || min_label == 'unidentified' ){
41165		min_label='minutes';
41166	}
41167	if (sec_label == '' || sec_label == 'unidentified' ){
41168		sec_label='seconds';
41169	}*/
41170	/*$(".countdown .datetime").each(function(index, el) {
41171		datetime.push($(this).text());
41172	});
41173	$(".countdown #clock").each(function(index, el) {
41174		datetimeid.push($(this).attr('class'));
41175	});
41176	for (var i = 0; i <= (datetime.length - 1); i++) {
41177		$("."+datetimeid[i]).countdown(datetime[i], function(event) {
41178			$(this).html(
41179				event.strftime('<ul><li class="days">%D<div>'+days_label+'</div></li> <li class="hours">%H<div>'+hours_label+'</div></li><li class="minutes">%M<div>'+min_label+'</div></li><li class="seconds">%S<div>'+sec_label+'</div></li></ul>')
41180				);
41181				event.strftime('<ul><li class="days">%D<div>days</div></li> <li class="hours">%H<div>hours</div></li><li class="minutes">%M<div>minutes</div></li><li class="seconds">%S<div>second</div></li></ul>')
41182				);
41183		});
41184	}*/
41185
41186	/*var datetime = $(".countdown .datetime").text();
41187	console.log(datetime);
41188    $("#clock").countdown(datetime, function(event) {
41189        $(this).html(
41190            event.strftime('<ul><li class="days">%D</li> <li class="hours">%H</li><li class="minutes">%M</li><li class="seconds">%S</li></ul>')
41191        );
41192    });*/
41193
41194	// Language menu dropdown
41195	$(".tx-srlanguagemenu.tx-srlanguagemenu-flags").on("click", function(){
41196		$(this).find(".language-outer").toggle();
41197	});
41198	$(".tx-srlanguagemenu.tx-srlanguagemenu-flags").find(".tx-srlanguagemenu-flag-unlinked").removeClass();
41199	// Language menu dropdown
41200
41201	// Parellex Buttom Smooth Scrolling.
41202	var $topMenuAfstand=100;
41203	$(".parellex-image a[href*='#c']").on('click', function(e) {
41204
41205		var myString = jQuery('#'+(jQuery(this).attr('href').split('#')[1])).selector;
41206		console.log(myString);
41207
41208		//console.debug('test',e);
41209		/*$('html, body').animate({ scrollTop: jQuery('#'+(jQuery(this).attr('href').split('#')[1])).offset().top-$topMenuAfstand }, 600);*/
41210		if($(myString).length > 0){			
41211			//console.debug('test',e);
41212			if (navigator.userAgent.match(/(iPod|iPhone|iPad)/)) {           
41213			}else{
41214				e.preventDefault();
41215						$('html, body').animate({
41216							scrollTop: $(myString).offset().top - $topMenuAfstand
41217						}, 600);
41218			}
41219
41220			//$('html, body').animate({ scrollTop: jQuery('#'+(jQuery(this).attr('href').split('#')[1])).offset().top-$topMenuAfstand }, 600);
41221		}else{
41222			window.location.href = $(this).attr('href');
41223		}
41224	});
41225
41226});
41227
41228
41229function myFunction() {
41230    if((navigator.userAgent.indexOf("MSIE") != -1 ) || (!!document.documentMode == true )) //IF IE > 10
41231    {
41232    	$("body").addClass('ie');
41233    }
41234}
41235
41236$(document).ready(function () {
41237
41238	//DEBUGGER CRAP
41239	var hasDebugger = $(".extbase-debugger").is(":visible");
41240	if(hasDebugger){
41241		$(".navbar-logo").css("height", "90px");
41242	}
41243	//COOKIEBOT BLOCKED ELEMENTS
41244	//This checks if cookie bot has blocked any elements on a page, and adds markup to tell the user
41245	
41246
41247
41248	$(".container.single-container").before($('.tt_news_move_block').detach());
41249
41250	var imageurl = '';
41251	imageurl = $('.news-single-item .news-image-wrapper').find('img:first').attr("src");
41252	if (imageurl != undefined) {
41253		$('.news-single-item .news-image-wrapper').find('a:first').remove();
41254		$('.tt_news_move_block .backstretch').find('img').attr('src', imageurl);
41255	} else {
41256		$('.tt_news_move_block').css('display', 'none');
41257	}
41258	jQuery(".instagram_gallery").each(function (index, el) {
41259
41260		var insta_data_id = '';
41261		insta_data_id = $(this).parent().parent().find('.insta_data_id').text();
41262		if (insta_data_id != '' && insta_data_id != undefined) {
41263			$('.two-grid-owl-slider' + insta_data_id).owlCarousel({
41264				loop: true,
41265				autoWidth: true,
41266				autoHeight: true,
41267				items: 4,
41268				autoplay: true,
41269				autoplayTimeout: 1000,
41270				autoplayHoverPause: true
41271			});
41272		}
41273	});
41274
41275	deviceWidth = $(window).width();
41276	deviceHeight = $(window).height();
41277
41278	/*if (deviceWidth < deviceHeight) {*/
41279	if (deviceWidth < 767) {		
41280		deviceHeight = deviceHeight - 190;
41281		/*$('.fimg-wrapper.parellex-image').css('height', deviceHeight + 'px');*/
41282	}
41283	if (deviceHeight > 947) {
41284		if (deviceHeight < 1601) {
41285			/*deviceHeight = deviceHeight - 200;*/
41286		}else{
41287			deviceHeight = deviceHeight - 100;
41288		}
41289		//$('.fimg-wrapper.fimg-fp.container-fluid.parellex-image').css('height', deviceHeight + 'px');
41290		//var calculateheightofimage = $('.fimg-wrapper.parellex-image .wyy-parallax-inner img').height();
41291		//console.log('height:'+calculateheightofimage);
41292		//console.log('device height:'+deviceHeight);
41293		//deviceHeight = deviceHeight-300;
41294	}
41295	/* modalbox call to action button color patch */
41296	var modalboxcontent = $('[data-toggle="modal"]');
41297	var modalboxid;
41298	if (modalboxcontent['length'] > 1) {
41299		for (var i = 0; i <= modalboxcontent['length'] - 1; i++) {
41300			modalboxid = modalboxcontent[i]['parentElement'];
41301			modalboxid = $(modalboxid).attr('id');
41302			$('#' + modalboxid + ' > a.mkdf-btn').css('background-color', $('#' + modalboxid + ' div.background-color').text());
41303			$('#' + modalboxid + ' > a.mkdf-btn').css('border-color', $('#' + modalboxid + ' div.border-color').text());
41304		}
41305	} else {
41306		if (modalboxcontent['0']) {
41307			modalboxid = modalboxcontent['0']['parentElement'];
41308			modalboxid = $(modalboxid).attr('id');
41309			$('#' + modalboxid + ' > a.mkdf-btn').css('background-color', $('#' + modalboxid + ' div.background-color').text());
41310			$('#' + modalboxid + ' > a.mkdf-btn').css('border-color', $('#' + modalboxid + ' div.border-color').text());
41311		}
41312	}
41313	/* modalbox call to action button color patch */
41314
41315	/* Search box lable and placeholder patch */
41316	var current_lang = $('html').attr('lang');
41317	var noeditsearch = $('#noeditsearch').length;
41318	if (noeditsearch < 1) {
41319
41320
41321		if (current_lang === 'da') {
41322			$("#indexedsearch .search-form-inner .wyy-sc-close .wyy-text").text('Luk');
41323			$("#indexedsearch .search-form-inner .input-group #inputText").attr('placeholder', 'SØG...');
41324			$("#indexedsearch .search-form-inner .input-group .input-group-btn .button.btn-search-text").attr('value', 'SØG');
41325		}
41326		if (current_lang === 'en') {
41327			$("#indexedsearch .search-form-inner .wyy-sc-close .wyy-text").text('Close');
41328			$("#indexedsearch .search-form-inner .input-group #inputText").attr('placeholder', 'Search...');
41329			$("#indexedsearch .search-form-inner .input-group .input-group-btn .button.btn-search-text").attr('value', 'Search');
41330		}
41331		if (current_lang === 'de') {
41332			$("#indexedsearch .search-form-inner .wyy-sc-close .wyy-text").text('Schlieβen');
41333			$("#indexedsearch .search-form-inner .input-group #inputText").attr('placeholder', 'Suchen...');
41334			$("#indexedsearch .search-form-inner .input-group .input-group-btn .button.btn-search-text").attr('value', 'Suchen');
41335		}
41336	}
41337
41338	setTimeout(function(){ 
41339		$(".wyy-youtube-wrapper").each(function( index ) {
41340			var _yvideo = $(this).parents().width();
41341			var _itemvideo = $(this).parents('.owl-stage-outer').height();
41342			$(this).parent().css('min-height', _itemvideo-1.6);
41343			$(this).parent().addClass('y-video');
41344		  	$(this).css('min-height', (_yvideo*11/16)-9);
41345		});
41346	}, 1000);
41347	/* Search box lable and placeholder patch */
41348
41349	$(".news-single-item").each(function() {
41350		var _newsLink = $(this).find('span.btn a').text();
41351		_newsLink = _newsLink.replace("&lt;-", "");
41352		//$(this).find('span.btn a').text(_newsLink.replace("&gt;", ">"));
41353		$(this).find('span.btn a').text(_newsLink);
41354	});
41355
41356	if ($('#one-parallax.parallax').length > 0) {
41357		$("#one-parallax").each(function( index ) {
41358		  	var _parallaxImg = $(this).find('figure img').attr('src');
41359		  	$(this).css('background-image', 'url('+_parallaxImg+')');
41360		});
41361	}
41362});
41363
41364$(function () {
41365	// Tablet Landscape display mobile menu patch...
41366	mobilemenu();
41367
41368});
41369$(window).on("orientationchange", function () {
41370	// Tablet Landscape display mobile menu patch...
41371	console.log('orientationchange !!!');
41372	setTimeout(function () {
41373		mobilemenu();
41374	}, 2000);
41375});
41376function mobilemenu() {
41377	// Tablet Landscape display mobile menu patch...
41378	if ($("html").hasClass("tablet")) {
41379		setTimeout(function () {
41380			$('.slimmenu').slimmenu(
41381				{
41382					resizeWidth: '1366',
41383					collapserTitle: '',
41384					indentChildren: true,
41385					easingEffect: null,
41386					animSpeed: 'fast',
41387					childrenIndenter: '&raquo;'
41388				});
41389		}, 1000);
41390		$(".desktop-menu").css('display', 'none');
41391		$(".slimmenu").removeClass('mobile-menu');
41392		$(".menu-collapser-1 .navbar-toggle").css('display', 'block');
41393		$(".navbar-top").css('display', 'none');
41394		$(".mobile-language-menu").css('display', 'block');
41395		$(".navbar-header .navbar-logo").css('bottom', '0');
41396		$("#navbar .navbar-nav").css('padding-left', '0px');
41397		$(".container > .navbar-header").css('min-height', '60px');
41398		$(".navbar > .container").css('padding-top', '5px');
41399		$(".has-nav-menu .container > .navbar-header").css('margin-bottom', '0');
41400		$(".navbar-nav > li > .sub-menu > li .sub-menu").css('padding', '0');
41401		setTimeout(function () {
41402			$(".navbar-nav > li > .sub-menu, .navbar-nav > li > .sub-menu li > ul, .navbar-nav > li > .mega-menu").css('visibility', 'visible');
41403			$(".navbar-nav > li > .sub-menu, .navbar-nav > li > .sub-menu li > ul, .navbar-nav > li > .mega-menu").css('opacity', '1');
41404		}, 2000);
41405	} else {
41406		$('.slimmenu').slimmenu(
41407			{
41408				resizeWidth: '991',
41409				collapserTitle: '',
41410				indentChildren: true,
41411				easingEffect: null,
41412				animSpeed: 'fast',
41413				childrenIndenter: '&raquo;'
41414			});
41415	}
41416}
41417
41418//<!-- SmartMenus jQuery init -->
41419$(function () {
41420	$('#menu-main-navigation-menu').smartmenus({
41421		mainMenuSubOffsetX: -1,
41422		mainMenuSubOffsetY: 4,
41423		subMenusSubOffsetX: 6,
41424		subMenusSubOffsetY: -6
41425	});
41426	//$('#menu-main-navigation-menu').find('sub-arrow').val('');
41427});
41428
41429
41430if ($('#fullpage').length > 0) {
41431	$('html').addClass('fullpagejs');
41432}
41433
41434$(window).load(function() {
41435	jQuery(".owlwithpaginationtext").each(function(index, el) {
41436	
41437	    $(this).find('.paginationowl-carousel').addClass('owl-carousel');
41438	    var _autoplay = parseInt($(this).find('.slider_auto_rotate').text());
41439	    var _speed = parseInt($(this).find('.slider_speed').text());
41440	    $(this).find('.paginationowl-carousel').owlCarousel({
41441	        items: 1,
41442	                slideBy: 1,
41443	                loop: true,
41444	                center: false,
41445	                mouseDrag: false,
41446	                dots: true,
41447	                nav: false,
41448	                autoplay : _autoplay,
41449	                stopOnHover : false,
41450	                dotsSpeed: 400,
41451	                smartSpeed: 300,
41452	                autoplayTimeout: _speed,
41453	                rtl: false,
41454	                autoHeight: true,
41455	                onChange : callback
41456	            });
41457	  });
41458	function callback(event) {
41459	    setTimeout(function(){  
41460		    $(event.currentTarget).parent().find('.owl-custom-pagination').find('a').removeClass('active');
41461		    var _ActiveItem = $(event.currentTarget).find('.owl-item.active .item').attr('data-item');
41462			if(_ActiveItem){
41463				$(event.currentTarget).parent().find('.owl-custom-pagination').find('a:nth-child('+_ActiveItem+')').addClass('active');
41464			}
41465		}, 200);
41466	}
41467	jQuery(".owl-custom-pagination .paginationtitle").click(function(e) {
41468		$(this).parent().find('.paginationtitle').removeClass('active');
41469		$(this).addClass('active');
41470	  	jQuery(this).parents('.posts-box-carousel').find('.owl-dots .owl-dot:nth-child('+jQuery(this).attr('data-dot')+')').click();
41471	});
41472});
41473$(document).ready(function () {
41474
41475    $("#amount").keypress(function (e) {
41476        //if the letter is not digit then display error and don't type anything
41477        if (e.which != 8 && e.which != 0 && (e.which < 48 || e.which > 57)) {
41478           //display error message
41479           $(".amount-error").html("Kun tal er tilladt").show().fadeOut("slow");
41480         
41481                  return false;
41482       }
41483      });
41484
41485
41486      
41487
41488     
41489});
41490$(document).ready(function () {
41491    $('.guide-image').each(function (index, element) {
41492     
41493    });
41494});
41495function ShowCookieBlock(){
41496    var cookieblockmsg = $(".cookie-blocked");
41497    $.each(cookieblockmsg, function (i, e) { 
41498        console.log($(e));
41499         $(e).remove();
41500    });
41501    var cookieblocked_element = '<div class="cookie-blocked">Indhold er blevet blokeret da du ikke har tilladt alle cookies.<br> <a href="javascript: Cookiebot.renew()">Klik her for at ændre tilladelser</a>  og opdater herefter din browser</div>';
41502    var cookieblocked = $('[data-cookieblock-src*="http"]');
41503    
41504    $.each(cookieblocked, function (i, e) {
41505
41506        $(e).after(cookieblocked_element);
41507    });
41508}
41509
41510function BlockIframe(){
41511    var cookieblockmsg = $(".cookieconsent-optin-marketing");
41512
41513  
41514    var cookieblocked_element = '<div class="cookie-blocked">Indhold er blevet blokeret da du ikke har tilladt alle cookies.<br> <a href="javascript: Cookiebot.renew()">Klik her for at ændre tilladelser</a> og opdater herefter din browser</div>';
41515    var cookieblocked = $('[data-cookieblock-src*="http"]');
41516    $.each(cookieblocked, function (i, e) {
41517        
41518        $(e).after(cookieblocked_element);
41519    });
41520
41521    $.each(cookieblockmsg, function (i, e) { 
41522 
41523        $(e).remove();
41524   });
41525}
41526
41527function ShowCookieBlockParallex(){
41528    //Parallex checking
41529
41530    var paralaxes = $(".videowrapper");
41531    var cookieblocked_element = '<div class="cookie-blocked" style="position: absolute; top: 0; left: 0; z-index: 9999; width: 100% !important; max-width: none;">Indhold er blevet blokeret da du ikke har tilladt alle cookies.<br> <a href="javascript: Cookiebot.renew()">Klik her for at ændre tilladelser</a>  og opdater herefter din browser</div>';
41532    $.each(paralaxes, function (i, e) {
41533        var ytcontainer = $(e).find(".ytplayer-container");
41534        if(ytcontainer.length < 1){
41535            $("body").prepend(cookieblocked_element);
41536            $("body").addClass("missing-cookie");
41537        }
41538    });
41539}
41540
41541window.addEventListener('CookiebotOnAccept', function (e) {
41542    BlockIframe();
41543
41544    
41545  
41546  }, false);
41547
41548  window.addEventListener('CookiebotOnDecline', function (e) {
41549    BlockIframe();
41550
41551    
41552  
41553}, false);
41554
41555$(document).ready(function () {
41556
41557
41558      window.addEventListener('CookiebotOnAccept', function (e) {
41559        BlockIframe();
41560        ShowCookieBlock();
41561        
41562      
41563      }, false);
41564
41565      window.addEventListener('CookiebotOnDecline', function (e) {
41566        BlockIframe();
41567        ShowCookieBlock();
41568        
41569      
41570    }, false);
41571
41572
41573});
41574
41575$(window).load(function () {
41576 
41577    window.addEventListener('CookiebotOnDecline', function (e) {
41578        ShowCookieBlockParallex();
41579        BlockIframe();
41580    }, false);
41581});
41582
41583$(document).ready(function () {
41584
41585  navigator.sayswho= (function(){
41586    var ua= navigator.userAgent;
41587    var tem; 
41588    var M= ua.match(/(opera|chrome|safari|firefox|msie|trident(?=\/))\/?\s*(\d+)/i) || [];
41589    if(/trident/i.test(M[1])){
41590        tem=  /\brv[ :]+(\d+)/g.exec(ua) || [];
41591        return 'IE '+(tem[1] || '');
41592    }
41593    if(M[1]=== 'Chrome'){
41594        tem= ua.match(/\b(OPR|Edge)\/(\d+)/);
41595        if(tem!= null) return tem.slice(1).join(' ').replace('OPR', 'Opera');
41596    }
41597    M= M[2]? [M[1], M[2]]: [navigator.appName, navigator.appVersion, '-?'];
41598    if((tem= ua.match(/version\/(\d+)/i))!= null) M.splice(1, 1, tem[1]);
41599    return M.join(' ');
41600})();
41601
41602
41603
41604if (navigator.sayswho.indexOf("MSIE") >= 0){
41605  $(".wpcf7").each(function (index, element) {
41606    // element == this
41607    $(this).find("form").remove();
41608    $(this).append("<h3>Din browser understøtter ikke formularer</h3>"); 
41609  });
41610}
41611  
41612  // $(".wpcf7 form .csc-form-element-submit").prepend('<div id="html_element"></div>');
41613
41614
41615  // $(".wpcf7 form .csc-form-element-submit input").click(function (e) { 
41616
41617      
41618  //     var response = grecaptcha.getResponse();
41619
41620  //     if(response.length > 0){
41621      
41622  //     }else{
41623  //       e.preventDefault();
41624  //       alert("Please verify that your human");
41625  //     }
41626
41627  // });
41628
41629
41630  var showLabels = $("#showLabels").val();
41631  if(showLabels == 1){
41632
41633    $(".newsLabel").each(function (index, element) {
41634        var thisLabel = $.trim($(this).text()).length;
41635        if(Number(thisLabel) > 0){
41636     
41637          $(".newsLabel").css("display", "inline-block");
41638        }
41639    });
41640   
41641  }
41642
41643  var payofftext = $.trim($(".payoff-text").text());
41644
41645  if(payofftext.length < 1){
41646    $(".dh-payoff-text").addClass("payoff-imageonly");
41647  }
41648  var roomCount = $(".room.row").length;
41649
41650  if(roomCount > 1){
41651      var roomChooseHeadline = $.trim($("#room_items .arrow-subtitle").text());
41652    if(roomChooseHeadline === "Vælg værelse"){
41653      $("#room_items .arrow-subtitle").append(" 1");
41654      $(".addToBasket ").text("Vælg næste værelse");
41655      $(".multiroom-current").text("1");
41656      
41657    }
41658    $(".multiroom-total").text(roomCount);
41659  }
41660
41661
41662
41663  $(document).on("click", function (e) {
41664    if(e.target['id'] === 'multiroombtn'){
41665       $(".modal-backdrop").remove();
41666      $("body").removeClass("modal-open");
41667    }
41668
41669  });
41670
41671
41672  $("#addroom").click(function (e) { 
41673    
41674    var hasMoreRooms = $("#roommodal .room.row").length;
41675    if(hasMoreRooms > 1){
41676      $("#roommodal .room.row h5").remove();
41677      $("#roommodal .room.row").each(function (index, element) {
41678        // element == this
41679        $(this).prepend("<h5>Værelse "+ (index + 1) +"</h5>");
41680      });
41681    }
41682    
41683  });
41684  
41685    
41686    //SETTING MENU TO CENTER
41687    // var menuWidth = 0;
41688    // $("#menu-main-navigation-menu li").each(function (index, element) {
41689    //     // element == this
41690    //     var elementWidth = $(this).width();
41691    //     menuWidth += elementWidth;
41692    // });
41693
41694    // $("#menu-main-navigation-menu").css("width", menuWidth + 2);
41695    $(".nobackground").each(function (index, element) {
41696		// element == this
41697		var textColor = $(this).css("color");
41698		$(this).find("a").css("color", textColor);
41699        $(this).find("li").css("color", textColor);
41700        $(this).find("h1").css("color", textColor);
41701        $(this).find("h2").css("color", textColor);
41702        $(this).find("h3").css("color", textColor);
41703        $(this).find("p").css("color", textColor);
41704        $(this).find("h4").css("color", textColor);
41705  });
41706  var allCategories = [];
41707  $(".news-category").each(function (index, element) {
41708    // element == this
41709    var categories = $(this).val().split(",");
41710   
41711    categories.shift();
41712    categories.shift();
41713    
41714    $.each(categories, function(index, cat){
41715      var hasCategory = $.inArray($.trim(cat), allCategories);
41716      if(hasCategory < 0){
41717        allCategories.push($.trim(cat));
41718      }
41719    });
41720
41721   
41722  });
41723  if(allCategories.length > 0){
41724    $("#newstype").append('<option value="none">Alle</option>');
41725
41726    $.each(allCategories, function(index, cat){
41727      $("#newstype").append('<option value="'+$.trim(cat)+'">'+$.trim(cat)+'</option>');
41728    });
41729
41730 
41731  }
41732
41733
41734  $( "#newstype" ).change(function() {
41735    var category = $(this).children("option:selected").val();
41736    if(category === "none"){
41737      $(".custom-news-list .opholdskort").show();
41738    }else{
41739      $(".news-category").each(function (index, element) {
41740        // element == this
41741        var trimmedCats = [];
41742        var categories = $(element).val().split(",");
41743        categories.shift();
41744        categories.shift();
41745        $.each(categories, function(index, notrimcat){
41746          trimmedCats.push($.trim(notrimcat));
41747
41748        });
41749      
41750        
41751        if(trimmedCats.length > 0){
41752          
41753          var hasCategory = $.inArray(category, trimmedCats);
41754         
41755          if(hasCategory < 0){
41756            $(element).closest(".opholdskort").hide();
41757          }else{
41758            $(element).closest(".opholdskort").show();
41759          }
41760        }else{
41761          $(element).closest(".opholdskort").hide();
41762        }
41763        
41764      });
41765    }
41766   
41767
41768
41769
41770  });
41771});

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.