PageSourceSearch

https://www.clydebankprogrammesonline.co.uk/sites/default/files/js/js_69cddfcfc32af05f2986fe4f4f4e40b7.js

js clydebankprogrammesonline.co.uk collected 2026-10-06 13:14:41 UTC 490,893 bytes, 11,225 lines download raw bytes

1/*
2 * jQuery JavaScript Library v1.3.2
3 * https://jquery.com/
4 *
5 * Copyright (c) 2009 John Resig
6 * Dual licensed under the MIT and GPL licenses.
7 * https://docs.jquery.com/License
8 *
9 * Date: 2009-02-19 17:34:21 -0500 (Thu, 19 Feb 2009)
10 * Revision: 6246
11 */
12(function(){var l=this,g,y=l.jQuery,p=l.$,o=l.jQuery=l.$=function(E,F){return new o.fn.init(E,F)},D=/^[^<]*(<(.|\s)+>)[^>]*$|^#([\w-]+)$/,f=/^.[^:#\[\.,]*$/;o.fn=o.prototype={init:function(E,H){E=E||document;if(E.nodeType){this[0]=E;this.length=1;this.context=E;return this}if(typeof E==="string"){var G=D.exec(E);if(G&&(G[1]||!H)){if(G[1]){E=o.clean([G[1]],H)}else{var I=document.getElementById(G[3]);if(I&&I.id!=G[3]){return o().find(E)}var F=o(I||[]);F.context=document;F.selector=E;return F}}else{return o(H).find(E)}}else{if(o.isFunction(E)){return o(document).ready(E)}}if(E.selector&&E.context){this.selector=E.selector;this.context=E.context}return this.setArray(o.isArray(E)?E:o.makeArray(E))},selector:"",jquery:"1.3.2",size:function(){return this.length},get:function(E){return E===g?Array.prototype.slice.call(this):this[E]},pushStack:function(F,H,E){var G=o(F);G.prevObject=this;G.context=this.context;if(H==="find"){G.selector=this.selector+(this.selector?" ":"")+E}else{if(H){G.selector=this.selector+"."+H+"("+E+")"}}return G},setArray:function(E){this.length=0;Array.prototype.push.apply(this,E);return this},each:function(F,E){return o.each(this,F,E)},index:function(E){return o.inArray(E&&E.jquery?E[0]:E,this)},attr:function(F,H,G){var E=F;if(typeof F==="string"){if(H===g){return this[0]&&o[G||"attr"](this[0],F)}else{E={};E[F]=H}}return this.each(function(I){for(F in E){o.attr(G?this.style:this,F,o.prop(this,E[F],G,I,F))}})}
12,css:function(E,F){if((E=="width"||E=="height")&&parseFloat(F)<0){F=g}return this.attr(E,F,"curCSS")},text:function(F){if(typeof F!=="object"&&F!=null){return this.empty().append((this[0]&&this[0].ownerDocument||document).createTextNode(F))}var E="";o.each(F||this,function(){o.each(this.childNodes,function(){if(this.nodeType!=8){E+=this.nodeType!=1?this.nodeValue:o.fn.text([this])}})});return E},wrapAll:function(E){if(this[0]){var F=o(E,this[0].ownerDocument).clone();if(this[0].parentNode){F.insertBefore(this[0])}F.map(function(){var G=this;while(G.firstChild){G=G.firstChild}return G}).append(this)}return this},wrapInner:function(E){return this.each(function(){o(this).contents().wrapAll(E)})},wrap:function(E){return this.each(function(){o(this).wrapAll(E)})},append:function(){return this.domManip(arguments,true,function(E){if(this.nodeType==1){this.appendChild(E)}})},prepend:function(){return this.domManip(arguments,true,function(E){if(this.nodeType==1){this.insertBefore(E,this.firstChild)}})},before:function(){return this.domManip(arguments,false,function(E){this.parentNode.insertBefore(E,this)})},after:function(){return this.domManip(arguments,false,function(E){this.parentNode.insertBefore(E,this.nextSibling)})},end:function(){return this.prevObject||o([])},push:[].push,sort:[].sort,splice:[].splice,find:function(E){if(this.length===1){var F=this.pushStack([],"find",E);F.length=0;o.find(E,this[0],F);return F}else{return this.pushStack(o.unique(o.map(this,function(G){return o.find(E,G)})),"find",E)}},clone:function(G){var E=this.map(function(){if(!o.support.noCloneEvent&&!o.isXMLDoc(this)){var I=this.outerHTML;if(!I){var J=this.ownerDocument.createElement("div");J.appendChild(this.cloneNode(true));I=J.innerHTML}return o.clean([I.replace(/ jQuery\d+="(?:\d+|null)"/g,"").replace(/^\s*/,"")])[0]}else{return this.cloneNode(true)}});if(G===true){var H=this.find("*").andSelf(),F=0;E.find("*").andSelf().each(function(){if(this.nodeName!==H[F].nodeName){return}var I=o.data(H[F],"events");for(var K in I){for(var J in I[K]){o.event.add(this,K,I[K][J],I[K][J].data)}}F++})}return E},filter:function(E){return this.pushStack(o.isFunction(E)&&o.grep(this,function(G,F){return E.call(G,F)})||o.multiFilter(E,o.grep(this,function(F){return F.nodeType===1})),"filter",E)},closest:function(E){var G=o.expr.match.POS.test(E)?o(E):null,F=0;return this.map(function(){var H=this;while(H&&H.ownerDocument){if(G?G.index(H)>-1:o(H).is(E)){o.data(H,"closest",F);return H}H=H.parentNode;F++}})},not:function(E){if(typeof E==="string"){if(f.test(E)){return this.pushStack(o.multiFilter(E,this,true),"not",E)}else{E=o.multiFilter(E,this)}}var F=E.length&&E[E.length-1]!==g&&!E.nodeType;return this.filter(function(){return F?o.inArray(this,E)<0:this!=E})},add:function(E){return this.pushStack(o.unique(o.merge(this.get(),typeof E==="string"?o(E):o.makeArray(E))))},is:function(E){return !!E&&o.multiFilter(E,this).length>0},hasClass:function(E){return !!E&&this.is("."+E)},val:function(K){if(K===g){var E=this[0];if(E){if(o.nodeName(E,"option")){return(E.attributes.value||{}).specified?E.value:E.text}if(o.nodeName(E,"select")){var I=E.selectedIndex,L=[],M=E.options,H=E.type=="select-one";if(I<0){return null}for(var F=H?I:0,J=H?I+1:M.length;F<J;F++){var G=M[F];if(G.selected){K=o(G).val();if(H){return K}L.push(K)}}return L}return(E.value||"").replace(/\r/g,"")}return g}if(typeof K==="number"){K+=""}return this.each(function(){if(this.nodeType!=1){return}if(o.isArray(K)&&/radio|checkbox/.test(this.type)){this.checked=(o.inArray(this.value,K)>=0||o.inArray(this.name,K)>=0)}else{if(o.nodeName(this,"select")){var N=o.makeArray(K);o("option",this).each(function(){this.selected=(o.inArray(this.value,N)>=0||o.inArray(this.text,N)>=0)});if(!N.length){this.selectedIndex=-1}}else{this.value=K}}})},html:function(E){return E===g?(this[0]?this[0].innerHTML.replace(/ jQuery\d+="(?:\d+|null)"/g,""):null):this.empty().append(E)},replaceWith:function(E){return this.after(E).remove()},eq:function(E){return this.slice(E,+E+1)},slice:function(){return this.pushStack(Array.prototype.slice.apply(this,arguments),"slice",Array.prototype.slice.call(arguments).join(","))},map:function(E){return this.pushStack(o.map(this,function(G,F){return E.call(G,F,G)}))},andSelf:function(){return this.add(this.prevObject)},domManip:function(J,M,L){if(this[0]){var I=(this[0].ownerDocument||this[0]).createDocumentFragment(),F=o.clean(J,(this[0].ownerDocument||this[0]),I),H=I.firstChild;if(H){for(var G=0,E=this.length;G<E;G++){L.call(K(this[G],H),this.length>1||G>0?I.cloneNode(true):I)}}if(F){o.each(F,z)}}return this;function K(N,O){return M&&o.nodeName(N,"table")&&o.nodeName(O,"tr")?(N.getElementsByTagName("tbody")[0]||N.appendChild(N.ownerDocument.createElement("tbody"))):N}}};o.fn.init.prototype=o.fn;function z(E,F){if(F.src){o.ajax({url:F.src,async:false,dataType:"script"})}else{o.globalEval(F.text||F.textContent||F.innerHTML||"")}if(F.parentNode){F.parentNode.removeChild(F)}}function e(){return +new Date}o.extend=o.fn.extend=function(){var J=arguments[0]||{},H=1,I=arguments.length,E=false,G;if(typeof J==="boolean"){E=J;J=arguments[1]||{};H=2}if(typeof J!=="object"&&!o.isFunction(J)){J={}}if(I==H){J=this;--H}for(;H<I;H++){if((G=arguments[H])!=null){for(var F in G){var K=J[F],L=G[F];if(J===L){continue}if(E&&L&&typeof L==="object"&&!L.nodeType){J[F]=o.extend(E,K||(L.length!=null?[]:{}),L)}else{if(L!==g){J[F]=L}}}}}return J};var b=/z-?index|font-?weight|opacity|zoom|line-?height/i,q=document.defaultView||{},s=Object.prototype.toString;o.extend({noConflict:function(E){l.$=p;if(E){l.jQuery=y}return o},isFunction:function(E){return s.call(E)==="[object Function]"},isArray:function(E){return s.call(E)==="[object Array]"},isXMLDoc:function(E){return E.nodeType===9&&E.documentElement.nodeName!=="HTML"||!!E.ownerDocument&&o.isXMLDoc(E.ownerDocument)},globalEval:function(G){if(G&&/\S/.test(G)){var F=document.getElementsByTagName("head")[0]||document.documentElement,E=document.createElement("script");E.type="text/javascript";if(o.support.scriptEval){E.appendChild(document.createTextNode(G))}else{E.text=G}F.insertBefore(E,F.firstChild);F.removeChild(E)}},nodeName:function(F,E){return F.nodeName&&F.nodeName.toUpperCase()==E.toUpperCase()},each:function(G,K,F){var E,H=0,I=G.length;if(F){if(I===g){for(E in G){if(K.apply(G[E],F)===false){break}}}else{for(;H<I;){if(K.apply(G[H++],F)===false){break}}}}else{if(I===g){for(E in G){if(K.call(G[E],E,G[E])===false){break}}}else{for(var J=G[0];H<I&&K.call(J,H,J)!==false;J=G[++H]){}}}return G},prop:function(H,I,G,F,E){if(o.isFunction(I)){I=I.call(H,F)}return typeof I==="number"&&G=="curCSS"&&!b.test(E)?I+"px":I},className:{add:function(E,F){o.each((F||"").split(/\s+/),function(G,H){if(E.nodeType==1&&!o.className.has(E.className,H)){E.className+=(E.className?" ":"")+H}})}
12,remove:function(E,F){if(E.nodeType==1){E.className=F!==g?o.grep(E.className.split(/\s+/),function(G){return !o.className.has(F,G)}).join(" "):""}},has:function(F,E){return F&&o.inArray(E,(F.className||F).toString().split(/\s+/))>-1}},swap:function(H,G,I){var E={};for(var F in G){E[F]=H.style[F];H.style[F]=G[F]}I.call(H);for(var F in G){H.style[F]=E[F]}},css:function(H,F,J,E){if(F=="width"||F=="height"){var L,G={position:"absolute",visibility:"hidden",display:"block"},K=F=="width"?["Left","Right"]:["Top","Bottom"];function I(){L=F=="width"?H.offsetWidth:H.offsetHeight;if(E==="border"){return}o.each(K,function(){if(!E){L-=parseFloat(o.curCSS(H,"padding"+this,true))||0}if(E==="margin"){L+=parseFloat(o.curCSS(H,"margin"+this,true))||0}else{L-=parseFloat(o.curCSS(H,"border"+this+"Width",true))||0}})}if(H.offsetWidth!==0){I()}else{o.swap(H,G,I)}return Math.max(0,Math.round(L))}return o.curCSS(H,F,J)},curCSS:function(I,F,G){var L,E=I.style;if(F=="opacity"&&!o.support.opacity){L=o.attr(E,"opacity");return L==""?"1":L}if(F.match(/float/i)){F=w}if(!G&&E&&E[F]){L=E[F]}else{if(q.getComputedStyle){if(F.match(/float/i)){F="float"}F=F.replace(/([A-Z])/g,"-$1").toLowerCase();var M=q.getComputedStyle(I,null);if(M){L=M.getPropertyValue(F)}if(F=="opacity"&&L==""){L="1"}}else{if(I.currentStyle){var J=F.replace(/\-(\w)/g,function(N,O){return O.toUpperCase()});L=I.currentStyle[F]||I.currentStyle[J];if(!/^\d+(px)?$/i.test(L)&&/^\d/.test(L)){var H=E.left,K=I.runtimeStyle.left;I.runtimeStyle.left=I.currentStyle.left;E.left=L||0;L=E.pixelLeft+"px";E.left=H;I.runtimeStyle.left=K}}}}return L},clean:function(F,K,I){K=K||document;if(typeof K.createElement==="undefined"){K=K.ownerDocument||K[0]&&K[0].ownerDocument||document}if(!I&&F.length===1&&typeof F[0]==="string"){var H=/^<(\w+)\s*\/?>$/.exec(F[0]);if(H){return[K.createElement(H[1])]}}var G=[],E=[],L=K.createElement("div");o.each(F,function(P,S){if(typeof S==="number"){S+=""}if(!S){return}if(typeof S==="string"){S=S.replace(/(<(\w+)[^>]*?)\/>/g,function(U,V,T){return T.match(/^(abbr|br|col|img|input|link|meta|param|hr|area|embed)$/i)?U:V+"></"+T+">"});var O=S.replace(/^\s+/,"").substring(0,10).toLowerCase();var Q=!O.indexOf("<opt")&&[1,"<select multiple='multiple'>","</select>"]||!O.indexOf("<leg")&&[1,"<fieldset>","</fieldset>"]||O.match(/^<(thead|tbody|tfoot|colg|cap)/)&&[1,"<table>","</table>"]||!O.indexOf("<tr")&&[2,"<table><tbody>","</tbody></table>"]||(!O.indexOf("<td")||!O.indexOf("<th"))&&[3,"<table><tbody><tr>","</tr></tbody></table>"]||!O.indexOf("<col")&&[2,"<table><tbody></tbody><colgroup>","</colgroup></table>"]||!o.support.htmlSerialize&&[1,"div<div>","</div>"]||[0,"",""];L.innerHTML=Q[1]+S+Q[2];while(Q[0]--){L=L.lastChild}if(!o.support.tbody){var R=/<tbody/i.test(S),N=!O.indexOf("<table")&&!R?L.firstChild&&L.firstChild.childNodes:Q[1]=="<table>"&&!R?L.childNodes:[];for(var M=N.length-1;M>=0;--M){if(o.nodeName(N[M],"tbody")&&!N[M].childNodes.length){N[M].parentNode.removeChild(N[M])}}}if(!o.support.leadingWhitespace&&/^\s/.test(S)){L.insertBefore(K.createTextNode(S.match(/^\s*/)[0]),L.firstChild)}S=o.makeArray(L.childNodes)}if(S.nodeType){G.push(S)}else{G=o.merge(G,S)}});if(I){for(var J=0;G[J];J++){if(o.nodeName(G[J],"script")&&(!G[J].type||G[J].type.toLowerCase()==="text/javascript")){E.push(G[J].parentNode?G[J].parentNode.removeChild(G[J]):G[J])}else{if(G[J].nodeType===1){G.splice.apply(G,[J+1,0].concat(o.makeArray(G[J].getElementsByTagName("script"))))}I.appendChild(G[J])}}return E}return G},attr:function(J,G,K){if(!J||J.nodeType==3||J.nodeType==8){return g}var H=!o.isXMLDoc(J),L=K!==g;G=H&&o.props[G]||G;if(J.tagName){var F=/href|src|style/.test(G);if(G=="selected"&&J.parentNode){J.parentNode.selectedIndex}if(G in J&&H&&!F){if(L){if(G=="type"&&o.nodeName(J,"input")&&J.parentNode){throw"type property can't be changed"}J[G]=K}if(o.nodeName(J,"form")&&J.getAttributeNode(G)){return J.getAttributeNode(G).nodeValue}if(G=="tabIndex"){var I=J.getAttributeNode("tabIndex");return I&&I.specified?I.value:J.nodeName.match(/(button|input|object|select|textarea)/i)?0:J.nodeName.match(/^(a|area)$/i)&&J.href?
120:g}return J[G]}if(!o.support.style&&H&&G=="style"){return o.attr(J.style,"cssText",K)}if(L){J.setAttribute(G,""+K)}var E=!o.support.hrefNormalized&&H&&F?J.getAttribute(G,2):J.getAttribute(G);return E===null?g:E}if(!o.support.opacity&&G=="opacity"){if(L){J.zoom=1;J.filter=(J.filter||"").replace(/alpha\([^)]*\)/,"")+(parseInt(K)+""=="NaN"?"":"alpha(opacity="+K*100+")")}return J.filter&&J.filter.indexOf("opacity=")>=0?(parseFloat(J.filter.match(/opacity=([^)]*)/)[1])/100)+"":""}G=G.replace(/-([a-z])/ig,function(M,N){return N.toUpperCase()});if(L){J[G]=K}return J[G]},trim:function(E){return(E||"").replace(/^\s+|\s+$/g,"")},makeArray:function(G){var E=[];if(G!=null){var F=G.length;if(F==null||typeof G==="string"||o.isFunction(G)||G.setInterval){E[0]=G}else{while(F){E[--F]=G[F]}}}return E},inArray:function(G,H){for(var E=0,F=H.length;E<F;E++){if(H[E]===G){return E}}return -1},merge:function(H,E){var F=0,G,I=H.length;if(!o.support.getAll){while((G=E[F++])!=null){if(G.nodeType!=8){H[I++]=G}}}else{while((G=E[F++])!=null){H[I++]=G}}return H},unique:function(K){var F=[],E={};try{for(var G=0,H=K.length;G<H;G++){var J=o.data(K[G]);if(!E[J]){E[J]=true;F.push(K[G])}}}catch(I){F=K}return F},grep:function(F,J,E){var G=[];for(var H=0,I=F.length;H<I;H++){if(!E!=!J(F[H],H)){G.push(F[H])}}return G},map:function(E,J){var F=[];for(var G=0,H=E.length;G<H;G++){var I=J(E[G],G);if(I!=null){F[F.length]=I}}return F.concat.apply([],F)}});var C=navigator.userAgent.toLowerCase();o.browser={version:(C.match(/.+(?:rv|it|ra|ie)[\/: ]([\d.]+)/)||[0,"0"])[1],safari:/webkit/.test(C),opera:/opera/.test(C),msie:/msie/.test(C)&&!/opera/.test(C),mozilla:/mozilla/.test(C)&&!/(compatible|webkit)/.test(C)};o.each({parent:function(E){return E.parentNode},parents:function(E){return o.dir(E,"parentNode")},next:function(E){return o.nth(E,2,"nextSibling")},prev:function(E){return o.nth(E,2,"previousSibling")},nextAll:function(E){return o.dir(E,"nextSibling")},prevAll:function(E){return o.dir(E,"previousSibling")},siblings:function(E){return o.sibling(E.parentNode.firstChild,E)},children:function(E){return o.sibling(E.firstChild)},contents:function(E){return o.nodeName(E,"iframe")?E.contentDocument||E.contentWindow.document:o.makeArray(E.childNodes)}},function(E,F){o.fn[E]=function(G){var H=o.map(this,F);if(G&&typeof G=="string"){H=o.multiFilter(G,H)}return this.pushStack(o.unique(H),E,G)}});o.each({appendTo:"append",prependTo:"prepend",insertBefore:"before",insertAfter:"after",replaceAll:"replaceWith"},function(E,F){o.fn[E]=function(G){var J=[],L=o(G);for(var K=0,H=L.length;K<H;K++){var I=(K>0?this.clone(true):this).get();o.fn[F].apply(o(L[K]),I);J=J.concat(I)}return this.pushStack(J,E,G)}});o.each({removeAttr:function(E){o.attr(this,E,"");if(this.nodeType==1){this.removeAttribute(E)}},addClass:function(E){o.className.add(this,E)},removeClass:function(E){o.className.remove(this,E)},toggleClass:function(F,E){if(typeof E!=="boolean"){E=!o.className.has(this,F)}o.className[E?"add":"remove"](this,F)},remove:function(E){if(!E||o.filter(E,[this]).length){o("*",this).add([this]).each(function(){o.event.remove(this);o.removeData(this)});if(this.parentNode){this.parentNode.removeChild(this)}}},empty:function(){o(this).children().remove();while(this.firstChild){this.removeChild(this.firstChild)}}},function(E,F){o.fn[E]=function(){return this.each(F,arguments)}});function j(E,F){return E[0]&&parseInt(o.curCSS(E[0],F,true),10)||0}var h="jQuery"+e(),v=0,A={};o.extend({cache:{},data:function(F,E,G){F=F==l?A:F;var H=F[h];if(!H){H=F[h]=++v}if(E&&!o.cache[H]){o.cache[H]={}}if(G!==g){o.cache[H][E]=G}return E?o.cache[H][E]:H},removeData:function(F,E){F=F==l?A:F;var H=F[h];
12if(E){if(o.cache[H]){delete o.cache[H][E];E="";for(E in o.cache[H]){break}if(!E){o.removeData(F)}}}else{try{delete F[h]}catch(G){if(F.removeAttribute){F.removeAttribute(h)}}delete o.cache[H]}},queue:function(F,E,H){if(F){E=(E||"fx")+"queue";var G=o.data(F,E);if(!G||o.isArray(H)){G=o.data(F,E,o.makeArray(H))}else{if(H){G.push(H)}}}return G},dequeue:function(H,G){var E=o.queue(H,G),F=E.shift();if(!G||G==="fx"){F=E[0]}if(F!==g){F.call(H)}}});o.fn.extend({data:function(E,G){var H=E.split(".");H[1]=H[1]?"."+H[1]:"";if(G===g){var F=this.triggerHandler("getData"+H[1]+"!",[H[0]]);if(F===g&&this.length){F=o.data(this[0],E)}return F===g&&H[1]?this.data(H[0]):F}else{return this.trigger("setData"+H[1]+"!",[H[0],G]).each(function(){o.data(this,E,G)})}},removeData:function(E){return this.each(function(){o.removeData(this,E)})},queue:function(E,F){if(typeof E!=="string"){F=E;E="fx"}if(F===g){return o.queue(this[0],E)}return this.each(function(){var G=o.queue(this,E,F);if(E=="fx"&&G.length==1){G[0].call(this)}})},dequeue:function(E){return this.each(function(){o.dequeue(this,E)})}});
13/*
14 * Sizzle CSS Selector Engine - v0.9.3
15 *  Copyright 2009, The Dojo Foundation
16 *  Released under the MIT, BSD, and GPL Licenses.
17 *  More information: https://sizzlejs.com/
18 */
19(function(){var R=/((?:\((?:\([^()]+\)|[^()]+)+\)|\[(?:\[[^[\]]*\]|['"][^'"]*['"]|[^[\]'"]+)+\]|\\.|[^ >+~,(\[\\]+)+|[>+~])(\s*,\s*)?/g,L=0,H=Object.prototype.toString;var F=function(Y,U,ab,ac){ab=ab||[];U=U||document;if(U.nodeType!==1&&U.nodeType!==9){return[]}if(!Y||typeof Y!=="string"){return ab}var Z=[],W,af,ai,T,ad,V,X=true;R.lastIndex=0;while((W=R.exec(Y))!==null){Z.push(W[1]);if(W[2]){V=RegExp.rightContext;break}}if(Z.length>1&&M.exec(Y)){if(Z.length===2&&I.relative[Z[0]]){af=J(Z[0]+Z[1],U)}else{af=I.relative[Z[0]]?[U]:F(Z.shift(),U);while(Z.length){Y=Z.shift();if(I.relative[Y]){Y+=Z.shift()}af=J(Y,af)}}}else{var ae=ac?{expr:Z.pop(),set:E(ac)}:F.find(Z.pop(),Z.length===1&&U.parentNode?U.parentNode:U,Q(U));af=F.filter(ae.expr,ae.set);if(Z.length>0){ai=E(af)}else{X=false}while(Z.length){var ah=Z.pop(),ag=ah;if(!I.relative[ah]){ah=""}else{ag=Z.pop()}if(ag==null){ag=U}I.relative[ah](ai,ag,Q(U))}}if(!ai){ai=af}if(!ai){throw"Syntax error, unrecognized expression: "+(ah||Y)}if(H.call(ai)==="[object Array]"){if(!X){ab.push.apply(ab,ai)}else{if(U.nodeType===1){for(var aa=0;ai[aa]!=null;aa++){if(ai[aa]&&(ai[aa]===true||ai[aa].nodeType===1&&K(U,ai[aa]))){ab.push(af[aa])}}}else{for(var aa=0;ai[aa]!=null;aa++){if(ai[aa]&&ai[aa].nodeType===1){ab.push(af[aa])}}}}}else{E(ai,ab)}if(V){F(V,U,ab,ac);if(G){hasDuplicate=false;ab.sort(G);if(hasDuplicate){for(var aa=1;aa<ab.length;aa++){if(ab[aa]===ab[aa-1]){ab.splice(aa--,1)}}}}}return ab};F.matches=function(T,U){return F(T,null,null,U)};F.find=function(aa,T,ab){var Z,X;if(!aa){return[]}for(var W=0,V=I.order.length;W<V;W++){var Y=I.order[W],X;if((X=I.match[Y].exec(aa))){var U=RegExp.leftContext;if(U.substr(U.length-1)!=="\\"){X[1]=(X[1]||"").replace(/\\/g,"");Z=I.find[Y](X,T,ab);if(Z!=null){aa=aa.replace(I.match[Y],"");break}}}}if(!Z){Z=T.getElementsByTagName("*")}return{set:Z,expr:aa}};F.filter=function(ad,ac,ag,W){var V=ad,ai=[],aa=ac,Y,T,Z=ac&&ac[0]&&Q(ac[0]);while(ad&&ac.length){for(var ab in I.filter){if((Y=I.match[ab].exec(ad))!=null){var U=I.filter[ab],ah,af;T=false;if(aa==ai){ai=[]}if(I.preFilter[ab]){Y=I.preFilter[ab](Y,aa,ag,ai,W,Z);if(!Y){T=ah=true}else{if(Y===true){continue}}}if(Y){for(var X=0;(af=aa[X])!=null;X++){if(af){ah=U(af,Y,X,aa);var ae=W^!!ah;if(ag&&ah!=null){if(ae){T=true}else{aa[X]=false}}else{if(ae){ai.push(af);T=true}}}}}if(ah!==g){if(!ag){aa=ai}ad=ad.replace(I.match[ab],"");if(!T){return[]}break}}}if(ad==V){if(T==null){throw"Syntax error, unrecognized expression: "+ad}else{break}}V=ad}return aa};var I=F.selectors={order:["ID","NAME","TAG"],match:{ID:/#((?:[\w\u00c0-\uFFFF_-]|\\.)+)/,CLASS:/\.((?:[\w\u00c0-\uFFFF_-]|\\.)+)/,NAME:/\[name=['"]*((?:[\w\u00c0-\uFFFF_-]|\\.)+)['"]*\]/,ATTR:/\[\s*((?:[\w\u00c0-\uFFFF_-]|\\.)+)\s*(?:(\S?=)\s*(['"]*)(.*?)\3|)\s*\]/,TAG:/^((?:[\w\u00c0-\uFFFF\*_-]|\\.)+)/,CHILD:/:(only|nth|last|first)-child(?:\((even|odd|[\dn+-]*)\))?/,POS:/:(nth|eq|gt|lt|first|last|even|odd)(?:\((\d*)\))?(?=[^-]|$)/,PSEUDO:/:((?:[\w\u00c0-\uFFFF_-]|\\.)+)(?:\((['"]*)((?:\([^\)]+\)|[^\2\(\)]*
19)+)\2\))?/},attrMap:{"class":"className","for":"htmlFor"},attrHandle:{href:function(T){return T.getAttribute("href")}},relative:{"+":function(aa,T,Z){var X=typeof T==="string",ab=X&&!/\W/.test(T),Y=X&&!ab;if(ab&&!Z){T=T.toUpperCase()}for(var W=0,V=aa.length,U;W<V;W++){if((U=aa[W])){while((U=U.previousSibling)&&U.nodeType!==1){}aa[W]=Y||U&&U.nodeName===T?U||false:U===T}}if(Y){F.filter(T,aa,true)}},">":function(Z,U,aa){var X=typeof U==="string";if(X&&!/\W/.test(U)){U=aa?U:U.toUpperCase();for(var V=0,T=Z.length;V<T;V++){var Y=Z[V];if(Y){var W=Y.parentNode;Z[V]=W.nodeName===U?W:false}}}else{for(var V=0,T=Z.length;V<T;V++){var Y=Z[V];if(Y){Z[V]=X?Y.parentNode:Y.parentNode===U}}if(X){F.filter(U,Z,true)}}},"":function(W,U,Y){var V=L++,T=S;if(!U.match(/\W/)){var X=U=Y?U:U.toUpperCase();T=P}T("parentNode",U,V,W,X,Y)},"~":function(W,U,Y){var V=L++,T=S;if(typeof U==="string"&&!U.match(/\W/)){var X=U=Y?U:U.toUpperCase();T=P}T("previousSibling",U,V,W,X,Y)}},find:{ID:function(U,V,W){if(typeof V.getElementById!=="undefined"&&!W){var T=V.getElementById(U[1]);return T?[T]:[]}},NAME:function(V,Y,Z){if(typeof Y.getElementsByName!=="undefined"){var U=[],X=Y.getElementsByName(V[1]);for(var W=0,T=X.length;W<T;W++){if(X[W].getAttribute("name")===V[1]){U.push(X[W])}}return U.length===0?null:U}},TAG:function(T,U){return U.getElementsByTagName(T[1])}},preFilter:{CLASS:function(W,U,V,T,Z,aa){W=" "+W[1].replace(/\\/g,"")+" ";if(aa){return W}for(var X=0,Y;(Y=U[X])!=null;X++){if(Y){if(Z^(Y.className&&(" "+Y.className+" ").indexOf(W)>=0)){if(!V){T.push(Y)}}else{if(V){U[X]=false}}}}return false},ID:function(T){return T[1].replace(/\\/g,"")},TAG:function(U,T){for(var V=0;T[V]===false;V++){}return T[V]&&Q(T[V])?U[1]:U[1].toUpperCase()},CHILD:function(T){if(T[1]=="nth"){var U=/(-?)(\d*)n((?:\+|-)?\d*)/.exec(T[2]=="even"&&"2n"||T[2]=="odd"&&"2n+1"||!/\D/.test(T[2])&&"0n+"+T[2]||T[2]);T[2]=(U[1]+(U[2]||1))-0;T[3]=U[3]-0}T[0]=L++;return T},ATTR:function(X,U,V,T,Y,Z){var W=X[1].replace(/\\/g,"");if(!Z&&I.attrMap[W]){X[1]=I.attrMap[W]}if(X[2]==="~="){X[4]=" "+X[4]+" "}return X},PSEUDO:function(X,U,V,T,Y){if(X[1]==="not"){if(X[3].match(R).length>1||/^\w/.test(X[3])){X[3]=F(X[3],null,null,U)}else{var W=F.filter(X[3],U,V,true^Y);if(!V){T.push.apply(T,W)}return false}}else{if(I.match.POS.test(X[0])||I.match.CHILD.test(X[0])){return true}}return X},POS:function(T){T.unshift(true);return T}},filters:{enabled:function(T){return T.disabled===false&&T.type!=="hidden"},disabled:function(T){return T.disabled===true},checked:function(T){return T.checked===true},selected:function(T){T.parentNode.selectedIndex;return T.selected===true},parent:function(T){return !!T.firstChild},empty:function(T){return !T.firstChild},has:function(V,U,T){return !!F(T[3],V).length},header:function(T){return/h\d/i.test(T.nodeName)},text:function(T){return"text"===T.type},radio:function(T){return"radio"===T.type},checkbox:function(T){return"checkbox"===T.type},file:function(T){return"file"===T.type},password:function(T){return"password"===T.type},submit:function(T){return"submit"===T.type},image:function(T){return"image"===T.type},reset:function(T){return"reset"===T.type},button:function(T){return"button"===T.type||T.nodeName.toUpperCase()==="BUTTON"},input:function(T){return/input|select|textarea|button/i.test(T.nodeName)}},setFilters:{first:function(U,T){return T===0},last:function(V,U,T,W){return U===W.length-1},even:function(U,T){return T%2===0},odd:function(U,T){return T%2===1},lt:function(V,U,T){return U<T[3]-0},gt:function(V,U,T){return U>T[3]-0},nth:function(V,U,T){return T[3]-0==U},eq:function(V,U,T){return T[3]-0==U}},filter:{PSEUDO:function(Z,V,W,aa){var U=V[1],X=I.filters[U];if(X){return X(Z,W,V,aa)}else{if(U==="contains"){return(Z.textContent||Z.innerText||"").indexOf(V[3])>=0}else{if(U==="not"){var Y=V[3];for(var W=0,T=Y.length;W<T;W++){if(Y[W]===Z){return false}}return true}}}},CHILD:function(T,W){var Z=W[1],U=T;switch(Z){case"only":case"first":while(U=U.previousSibling){if(U.nodeType===1){return false}}if(Z=="first"){return true}U=T;case"last":while(U=U.nextSibling){if(U.nodeType===1){return false}}return true;case"nth":var V=W[2],ac=W[3];if(V==1&&ac==0){return true}var Y=W[0],ab=T.parentNode;if(ab&&(ab.sizcache!==Y||!T.nodeIndex)){var X=0;for(U=ab.firstChild;U;U=U.nextSibling){if(U.nodeType===1){U.nodeIndex=++X}}ab.sizcache=Y}var aa=T.nodeIndex-ac;if(V==0){return aa==0}else{return(aa%V==0&&aa/V>=0)}}},ID:function(U,T){return U.nodeType===1&&U.getAttribute("id")===T},TAG:function(U,T){return(T==="*"&&U.nodeType===1)||U.nodeName===T},CLASS:function(U,T){return(" "+(U.className||U.getAttribute("class"))+" ").indexOf(T)>-1},ATTR:function(Y,W){var V=W[1],T=I.attrHandle[V]?I.attrHandle[V](Y):Y[V]!=null?Y[V]:Y.getAttribute(V),Z=T+"",X=W[2],U=W[4];return T==null?X==="!=":X==="="?Z===U:X==="*="?Z.indexOf(U)>=0:X==="~="?(" "+Z+" ").indexOf(U)>=0:!U?Z&&T!==false:X==="!="?Z!=U:X==="^="?Z.indexOf(U)===0:X==="$="?Z.substr(Z.length-U.length)===U:X==="|="?Z===U||Z.substr(0,U.length+1)===U+"-":false},POS:function(X,U,V,Y){var T=U[2],W=I.setFilters[T];if(W){return W(X,V,U,Y)}}}};var M=I.match.POS;for(var O in I.match){I.match[O]=RegExp(I.match[O].source+/(?![^\[]*\])(?![^\(]*\))/.source)}var E=function(U,T){U=Array.prototype.slice.call(U);if(T){T.push.apply(T,U);return T}return U};try{Array.prototype.slice.call(document.documentElement.childNodes)}catch(N){E=function(X,W){var U=W||[];if(H.call(X)==="[object Array]"){Array.prototype.push.apply(U,X)}else{if(typeof X.length==="number"){for(var V=0,T=X.length;V<T;V++){U.push(X[V])}}else{for(var V=0;X[V];V++){U.push(X[V])}}}return U}}var G;if(document.documentElement.compareDocumentPosition){G=function(U,T){var V=U.compareDocumentPosition(T)&4?-1:U===T?0:1;if(V===0){hasDuplicate=true}return V}}else{if("sourceIndex" in document.documentElement){G=function(U,T){var V=U.sourceIndex-T.sourceIndex;if(V===0){hasDuplicate=true}return V}}else{if(document.createRange){G=function(W,U){var V=W.ownerDocument.createRange(),T=U.ownerDocument.createRange();V.selectNode(W);V.collapse(true);T.selectNode(U);T.collapse(true);var X=V.compareBoundaryPoints(Range.START_TO_END,T);if(X===0){hasDuplicate=true}return X}}}}(function(){var U=document.createElement("form"),V="script"+(new Date).getTime();U.innerHTML="<input name='"+V+"'/>";var T=document.documentElement;T.insertBefore(U,T.firstChild);if(!!document.getElementById(V)){I.find.ID=function(X,Y,Z){if(typeof Y.getElementById!=="undefined"&&!Z){var W=Y.getElementById(X[1]);return W?W.id===X[1]||typeof W.getAttributeNode!=="undefined"&&W.getAttributeNode("id").nodeValue===X[1]?[W]:g:[]}};I.filter.ID=function(Y,W){var X=typeof Y.getAttributeNode!=="undefined"&&Y.getAttributeNode("id");return Y.nodeType===1&&X&&X.nodeValue===W}}T.removeChild(U)})();(function(){var T=document.createElement("div");T.appendChild(document.createComment(""));if(T.getElementsByTagName("*").length>0){I.find.TAG=function(U,Y){var X=Y.getElementsByTagName(U[1]);if(U[1]==="*"){var W=[];for(var V=0;X[V];V++){if(X[V].nodeType===1){W.push(X[V])}}X=W}return X}}T.innerHTML="<a href='#'></a>";if(T.firstChild&&typeof T.firstChild.getAttribute!=="undefined"&&T.firstChild.getAttribute("href")!=="#"){I.attrHandle.href=function(U){return U.getAttribute("href",2)}}})();if(document.querySelectorAll){(function(){var T=F,U=document.createElement("div");U.innerHTML="<p class='TEST'></p>";if(U.querySelectorAll&&U.querySelectorAll(".TEST").length===0){return}F=function(Y,X,V,W){X=X||document;if(!W&&X.nodeType===9&&!Q(X)){try{return E(X.querySelectorAll(Y),V)}catch(Z){}}return T(Y,X,V,W)};F.find=T.find;F.filter=T.filter;F.selectors=T.selectors;F.matches=T.matches})()}if(document.getElementsByClassName&&document.documentElement.getElementsByClassName){(function(){var T=document.createElement("div");T.innerHTML="<div class='test e'></div><div class='test'></div>";if(T.getElementsByClassName("e").length===0){return}T.lastChild.className="e";if(T.getElementsByClassName("e").length===1){return}I.order.splice(1,0,"CLASS");I.find.CLASS=function(U,V,W){if(typeof V.getElementsByClassName!=="undefined"&&!W){return V.getElementsByClassName(U[1])}}})()}function P(U,Z,Y,ad,aa,ac){var ab=U=="previousSibling"&&!ac;for(var W=0,V=ad.length;W<V;W++){var T=ad[W];if(T){if(ab&&T.nodeType===1){T.sizcache=Y;T.sizset=W}T=T[U];var X=false;while(T){if(T.sizcache===Y){X=ad[T.sizset];break}if(T.nodeType===1&&!ac){T.sizcache=Y;T.sizset=W}if(T.nodeName===Z){X=T;break}T=T[U]}ad[W]=X}}}function S(U,Z,Y,ad,aa,ac){var ab=U=="previousSibling"&&!ac;for(var W=0,V=ad.length;W<V;W++){var T=ad[W];if(T){if(ab&&T.nodeType===1){T.sizcache=Y;T.sizset=W}T=T[U];var X=false;while(T){if(T.sizcache===Y){X=ad[T.sizset];break}if(T.nodeType===1){if(!ac){T.sizcache=Y;T.sizset=W}
19if(typeof Z!=="string"){if(T===Z){X=true;break}}else{if(F.filter(Z,[T]).length>0){X=T;break}}}T=T[U]}ad[W]=X}}}var K=document.compareDocumentPosition?function(U,T){return U.compareDocumentPosition(T)&16}:function(U,T){return U!==T&&(U.contains?U.contains(T):true)};var Q=function(T){return T.nodeType===9&&T.documentElement.nodeName!=="HTML"||!!T.ownerDocument&&Q(T.ownerDocument)};var J=function(T,aa){var W=[],X="",Y,V=aa.nodeType?[aa]:aa;while((Y=I.match.PSEUDO.exec(T))){X+=Y[0];T=T.replace(I.match.PSEUDO,"")}T=I.relative[T]?T+"*":T;for(var Z=0,U=V.length;Z<U;Z++){F(T,V[Z],W)}return F.filter(X,W)};o.find=F;o.filter=F.filter;o.expr=F.selectors;o.expr[":"]=o.expr.filters;F.selectors.filters.hidden=function(T){return T.offsetWidth===0||T.offsetHeight===0};F.selectors.filters.visible=function(T){return T.offsetWidth>0||T.offsetHeight>0};F.selectors.filters.animated=function(T){return o.grep(o.timers,function(U){return T===U.elem}).length};o.multiFilter=function(V,T,U){if(U){V=":not("+V+")"}return F.matches(V,T)};o.dir=function(V,U){var T=[],W=V[U];while(W&&W!=document){if(W.nodeType==1){T.push(W)}W=W[U]}return T};o.nth=function(X,T,V,W){T=T||1;var U=0;for(;X;X=X[V]){if(X.nodeType==1&&++U==T){break}}return X};o.sibling=function(V,U){var T=[];for(;V;V=V.nextSibling){if(V.nodeType==1&&V!=U){T.push(V)}}return T};return;l.Sizzle=F})();o.event={add:function(I,F,H,K){if(I.nodeType==3||I.nodeType==8){return}if(I.setInterval&&I!=l){I=l}if(!H.guid){H.guid=this.guid++}if(K!==g){var G=H;H=this.proxy(G);H.data=K}var E=o.data(I,"events")||o.data(I,"events",{}),J=o.data(I,"handle")||o.data(I,"handle",function(){return typeof o!=="undefined"&&!o.event.triggered?o.event.handle.apply(arguments.callee.elem,arguments):g});J.elem=I;o.each(F.split(/\s+/),function(M,N){var O=N.split(".");N=O.shift();H.type=O.slice().sort().join(".");var L=E[N];if(o.event.specialAll[N]){o.event.specialAll[N].setup.call(I,K,O)}if(!L){L=E[N]={};if(!o.event.special[N]||o.event.special[N].setup.call(I,K,O)===false){if(I.addEventListener){I.addEventListener(N,J,false)}else{if(I.attachEvent){I.attachEvent("on"+N,J)}}}}L[H.guid]=H;o.event.global[N]=true});I=null},guid:1,global:{},remove:function(K,H,J){if(K.nodeType==3||K.nodeType==8){return}var G=o.data(K,"events"),F,E;if(G){if(H===g||(typeof H==="string"&&H.charAt(0)==".")){for(var I in G){this.remove(K,I+(H||""))}}else{if(H.type){J=H.handler;H=H.type}o.each(H.split(/\s+/),function(M,O){var Q=O.split(".");O=Q.shift();var N=RegExp("(^|\\.)"+Q.slice().sort().join(".*\\.")+"(\\.|$)");if(G[O]){if(J){delete G[O][J.guid]}else{for(var P in G[O]){if(N.test(G[O][P].type)){delete G[O][P]}}}if(o.event.specialAll[O]){o.event.specialAll[O].teardown.call(K,Q)}for(F in G[O]){break}if(!F){if(!o.event.special[O]||o.event.special[O].teardown.call(K,Q)===false){if(K.removeEventListener){K.removeEventListener(O,o.data(K,"handle"),false)}else{if(K.detachEvent){K.detachEvent("on"+O,o.data(K,"handle"))}}}F=null;delete G[O]}}})}for(F in G){break}if(!F){var L=o.data(K,"handle");if(L){L.elem=null}o.removeData(K,"events");o.removeData(K,"handle")}}},trigger:function(I,K,H,E){var G=I.type||I;if(!E){I=typeof I==="object"?I[h]?I:o.extend(o.Event(G),I):o.Event(G);if(G.indexOf("!")>=0){I.type=G=G.slice(0,-1);I.exclusive=true}if(!H){I.stopPropagation();if(this.global[G]){o.each(o.cache,function(){if(this.events&&this.events[G]){o.event.trigger(I,K,this.handle.elem)}})}}if(!H||H.nodeType==3||H.nodeType==8){return g}I.result=g;I.target=H;K=o.makeArray(K);K.unshift(I)}I.currentTarget=H;var J=o.data(H,"handle");if(J){J.apply(H,K)}if((!H[G]||(o.nodeName(H,"a")&&G=="click"))&&H["on"+G]&&H["on"+G].apply(H,K)===false){I.result=false}if(!E&&H[G]&&!I.isDefaultPrevented()&&!(o.nodeName(H,"a")&&G=="click")){this.triggered=true;try{H[G]()}catch(L){}}this.triggered=false;if(!I.isPropagationStopped()){var F=H.parentNode||H.ownerDocument;if(F){o.event.trigger(I,K,F,true)}}},handle:function(K){var J,E;K=arguments[0]=o.event.fix(K||l.event);K.currentTarget=this;var L=K.type.split(".");K.type=L.shift();J=!L.length&&!K.exclusive;var I=RegExp("(^|\\.)"+L.slice().sort().join(".*\\.")+"(\\.|$)");E=(o.data(this,"events")||{})[K.type];for(var G in E){var H=E[G];if(J||I.test(H.type)){K.handler=H;K.data=H.data;var F=H.apply(this,arguments);if(F!==g){K.result=F;if(F===false){K.preventDefault();K.stopPropagation()}}if(K.isImmediatePropagationStopped()){break}}}},props:"altKey attrChange attrName bubbles button cancelable charCo
19de clientX clientY ctrlKey currentTarget data detail eventPhase fromElement handler keyCode metaKey newValue originalTarget pageX pageY prevValue relatedNode relatedTarget screenX screenY shiftKey srcElement target toElement view wheelDelta which".split(" "),fix:function(H){if(H[h]){return H}var F=H;H=o.Event(F);for(var G=this.props.length,J;G;){J=this.props[--G];H[J]=F[J]}if(!H.target){H.target=H.srcElement||document}if(H.target.nodeType==3){H.target=H.target.parentNode}if(!H.relatedTarget&&H.fromElement){H.relatedTarget=H.fromElement==H.target?H.toElement:H.fromElement}if(H.pageX==null&&H.clientX!=null){var I=document.documentElement,E=document.body;H.pageX=H.clientX+(I&&I.scrollLeft||E&&E.scrollLeft||0)-(I.clientLeft||0);H.pageY=H.clientY+(I&&I.scrollTop||E&&E.scrollTop||0)-(I.clientTop||0)}if(!H.which&&((H.charCode||H.charCode===0)?H.charCode:H.keyCode)){H.which=H.charCode||H.keyCode}if(!H.metaKey&&H.ctrlKey){H.metaKey=H.ctrlKey}if(!H.which&&H.button){H.which=(H.button&1?1:(H.button&2?3:(H.button&4?2:0)))}return H},proxy:function(F,E){E=E||function(){return F.apply(this,arguments)};E.guid=F.guid=F.guid||E.guid||this.guid++;return E},special:{ready:{setup:B,teardown:function(){}}},specialAll:{live:{setup:function(E,F){o.event.add(this,F[0],c)},teardown:function(G){if(G.length){var E=0,F=RegExp("(^|\\.)"+G[0]+"(\\.|$)");o.each((o.data(this,"events").live||{}),function(){if(F.test(this.type)){E++}});if(E<1){o.event.remove(this,G[0],c)}}}}}};o.Event=function(E){if(!this.preventDefault){return new o.Event(E)}if(E&&E.type){this.originalEvent=E;this.type=E.type}else{this.type=E}this.timeStamp=e();this[h]=true};function k(){return false}function u(){return true}o.Event.prototype={preventDefault:function(){this.isDefaultPrevented=u;var E=this.originalEvent;if(!E){return}if(E.preventDefault){E.preventDefault()}E.returnValue=false},stopPropagation:function(){this.isPropagationStopped=u;var E=this.originalEvent;if(!E){return}if(E.stopPropagation){E.stopPropagation()}E.cancelBubble=true},stopImmediatePropagation:function(){this.isImmediatePropagationStopped=u;this.stopPropagation()},isDefaultPrevented:k,isPropagationStopped:k,isImmediatePropagationStopped:k};var a=function(F){var E=F.relatedTarget;while(E&&E!=this){try{E=E.parentNode}catch(G){E=this}}if(E!=this){F.type=F.data;o.event.handle.apply(this,arguments)}};o.each({mouseover:"mouseenter",mouseout:"mouseleave"},function(F,E){o.event.special[E]={setup:function(){o.event.add(this,F,a,E)},teardown:function(){o.event.remove(this,F,a)}}});o.fn.extend({bind:function(F,G,E){return F=="unload"?this.one(F,G,E):this.each(function(){o.event.add(this,F,E||G,E&&G)})},one:function(G,H,F){var E=o.event.proxy(F||H,function(I){o(this).unbind(I,E);return(F||H).apply(this,arguments)});return this.each(function(){o.event.add(this,G,E,F&&H)})},unbind:function(F,E){return this.each(function(){o.event.remove(this,F,E)})},trigger:function(E,F){return this.each(function(){o.event.trigger(E,F,this)})},triggerHandler:function(E,G){if(this[0]){var F=o.Event(E);F.preventDefault();F.stopPropagation();o.event.trigger(F,G,this[0]);return F.result}},toggle:function(G){var E=arguments,F=1;while(F<E.length){o.event.proxy(G,E[F++])}return this.click(o.event.proxy(G,function(H){this.lastToggle=(this.lastToggle||0)%F;H.preventDefault();return E[this.lastToggle++].apply(this,arguments)||false}))},hover:function(E,F){return this.mouseenter(E).mouseleave(F)},ready:function(E){B();if(o.isReady){E.call(document,o)}else{o.readyList.push(E)}return this},live:function(G,F){var E=o.event.proxy(F);E.guid+=this.selector+G;o(document).bind(i(G,this.selector),this.selector,E);return this},die:function(F,E){o(document).unbind(i(F,this.selector),E?{guid:E.guid+this.selector+F}:null);return this}});function c(H){var E=RegExp("(^|\\.)"+H.type+"(\\.|$)"),G=true,F=[];o.each(o.data(this,"events").live||[],function(I,J){if(E.test(J.type)){var K=o(H.target).closest(J.data)[0];if(K){F.push({elem:K,fn:J})}}});F.sort(function(J,I){return o.data(J.elem,"closest")-o.data(I.elem,"closest")});o.each(F,function(){if(this.fn.call(this.elem,H,this.fn.data)===false){return(G=false)}});return G}function i(F,E){return["live",F,E.replace(/\./g,"`").replace(/ /g,"|")].join(".")}o.extend({isReady:false,readyList:[],ready:function(){if(!o.isReady){o.isReady=true;if(o.readyList){o.each(o.readyList,function(){this.call(document,o)});o.readyList=null}o(document).triggerHandler("ready")}}});var x=false;function B(){if(x){return}x=true;if(document.addEventListener){document.addEventListener("DOMContentLoaded",function(){document.removeEventListener("DOMContentLoaded",arguments.callee,false);o.ready()},false)}else{if(document.attachEvent){document.attachEvent("onreadystatechange",function(){if(document.readyState==="complete"){document.detachEvent("onreadystatechange",arguments.callee);o.ready()}});if(document.documentElement.doScroll&&l==l.top){(function(){if(o.isReady){return}try{document.documentElement.doScroll("left")}catch(E){setTimeout(arguments.callee,0);return}o.ready()})()}}}o.event.add(l,"load",o.ready)}
19o.each(("blur,focus,load,resize,scroll,unload,click,dblclick,mousedown,mouseup,mousemove,mouseover,mouseout,mouseenter,mouseleave,change,select,submit,keydown,keypress,keyup,error").split(","),function(F,E){o.fn[E]=function(G){return G?this.bind(E,G):this.trigger(E)}});o(l).bind("unload",function(){for(var E in o.cache){if(E!=1&&o.cache[E].handle){o.event.remove(o.cache[E].handle.elem)}}});(function(){o.support={};var F=document.documentElement,G=document.createElement("script"),K=document.createElement("div"),J="script"+(new Date).getTime();K.style.display="none";K.innerHTML='   <link/><table></table><a href="/a" style="color:red;float:left;opacity:.5;">a</a><select><option>text</option></select><object><param/></object>';var H=K.getElementsByTagName("*"),E=K.getElementsByTagName("a")[0];if(!H||!H.length||!E){return}o.support={leadingWhitespace:K.firstChild.nodeType==3,tbody:!K.getElementsByTagName("tbody").length,objectAll:!!K.getElementsByTagName("object")[0].getElementsByTagName("*").length,htmlSerialize:!!K.getElementsByTagName("link").length,style:/red/.test(E.getAttribute("style")),hrefNormalized:E.getAttribute("href")==="/a",opacity:E.style.opacity==="0.5",cssFloat:!!E.style.cssFloat,scriptEval:false,noCloneEvent:true,boxModel:null};G.type="text/javascript";try{G.appendChild(document.createTextNode("window."+J+"=1;"))}catch(I){}F.insertBefore(G,F.firstChild);if(l[J]){o.support.scriptEval=true;delete l[J]}F.removeChild(G);if(K.attachEvent&&K.fireEvent){K.attachEvent("onclick",function(){o.support.noCloneEvent=false;K.detachEvent("onclick",arguments.callee)});K.cloneNode(true).fireEvent("onclick")}o(function(){var L=document.createElement("div");L.style.width=L.style.paddingLeft="1px";document.body.appendChild(L);o.boxModel=o.support.boxModel=L.offsetWidth===2;document.body.removeChild(L).style.display="none"})})();var w=o.support.cssFloat?"cssFloat":"styleFloat";o.props={"for":"htmlFor","class":"className","float":w,cssFloat:w,styleFloat:w,readonly:"readOnly",maxlength:"maxLength",cellspacing:"cellSpacing",rowspan:"rowSpan",tabindex:"tabIndex"};o.fn.extend({_load:o.fn.load,load:function(G,J,K){if(typeof G!=="string"){return this._load(G)}var I=G.indexOf(" ");if(I>=0){var E=G.slice(I,G.length);G=G.slice(0,I)}var H="GET";if(J){if(o.isFunction(J)){K=J;J=null}else{if(typeof J==="object"){J=o.param(J);H="POST"}}}var F=this;o.ajax({url:G,type:H,dataType:"html",data:J,complete:function(M,L){if(L=="success"||L=="notmodified"){F.html(E?o("<div/>").append(M.responseText.replace(/<script(.|\s)*?\/script>/g,"")).find(E):M.responseText)}if(K){F.each(K,[M.responseText,L,M])}}});return this},serialize:function(){return o.param(this.serializeArray())},serializeArray:function(){return this.map(function(){return this.elements?o.makeArray(this.elements):this}).filter(function(){return this.name&&!this.disabled&&(this.checked||/select|textarea/i.test(this.nodeName)||/text|hidden|password|search/i.test(this.type))}).map(function(E,F){var G=o(this).val();return G==null?null:o.isArray(G)?o.map(G,function(I,H){return{name:F.name,value:I}}):{name:F.name,value:G}}).get()}});o.each("ajaxStart,ajaxStop,ajaxComplete,ajaxError,ajaxSuccess,ajaxSend".split(","),function(E,F){o.fn[F]=function(G){return this.bind(F,G)}});var r=e();o.extend({get:function(E,G,H,F){if(o.isFunction(G)){H=G;G=null}return o.ajax({type:"GET",url:E,data:G,success:H,dataType:F})},getScript:function(E,F){return o.get(E,null,F,"script")},getJSON:function(E,F,G){return o.get(E,F,G,"json")},post:function(E,G,H,F){if(o.isFunction(G)){H=G;G={}}return o.ajax({type:"POST",url:E,data:G,success:H,dataType:F})},ajaxSetup:function(E){o.extend(o.ajaxSettings,E)},ajaxSettings:{url:location.href,global:true,type:"GET",contentType:"application/x-www-form-urlencoded",processData:true,async:true,xhr:function(){return l.ActiveXObject?new ActiveXObject("Microsoft.XMLHTTP"):new XMLHttpRequest()},accepts:{xml:"application/xml, text/xml",html:"text/html",script:"text/javascript, application/javascript",json:"application/json, text/javascript",text:"text/plain",_default:"*/*"}},lastModified:{},ajax:function(M){M=o.extend(true,M,o.extend(true,{},o.ajaxSettings,M));var W,F=/=\?(&|$)/g,R,V,G=M.type.toUpperCase();
19if(M.data&&M.processData&&typeof M.data!=="string"){M.data=o.param(M.data)}if(M.dataType=="jsonp"){if(G=="GET"){if(!M.url.match(F)){M.url+=(M.url.match(/\?/)?"&":"?")+(M.jsonp||"callback")+"=?"}}else{if(!M.data||!M.data.match(F)){M.data=(M.data?M.data+"&":"")+(M.jsonp||"callback")+"=?"}}M.dataType="json"}if(M.dataType=="json"&&(M.data&&M.data.match(F)||M.url.match(F))){W="jsonp"+r++;if(M.data){M.data=(M.data+"").replace(F,"="+W+"$1")}M.url=M.url.replace(F,"="+W+"$1");M.dataType="script";l[W]=function(X){V=X;I();L();l[W]=g;try{delete l[W]}catch(Y){}if(H){H.removeChild(T)}}}if(M.dataType=="script"&&M.cache==null){M.cache=false}if(M.cache===false&&G=="GET"){var E=e();var U=M.url.replace(/(\?|&)_=.*?(&|$)/,"$1_="+E+"$2");M.url=U+((U==M.url)?(M.url.match(/\?/)?"&":"?")+"_="+E:"")}if(M.data&&G=="GET"){M.url+=(M.url.match(/\?/)?"&":"?")+M.data;M.data=null}if(M.global&&!o.active++){o.event.trigger("ajaxStart")}var Q=/^(\w+:)?\/\/([^\/?#]+)/.exec(M.url);if(M.dataType=="script"&&G=="GET"&&Q&&(Q[1]&&Q[1]!=location.protocol||Q[2]!=location.host)){var H=document.getElementsByTagName("head")[0];var T=document.createElement("script");T.src=M.url;if(M.scriptCharset){T.charset=M.scriptCharset}if(!W){var O=false;T.onload=T.onreadystatechange=function(){if(!O&&(!this.readyState||this.readyState=="loaded"||this.readyState=="complete")){O=true;I();L();T.onload=T.onreadystatechange=null;H.removeChild(T)}}}H.appendChild(T);return g}var K=false;var J=M.xhr();if(M.username){J.open(G,M.url,M.async,M.username,M.password)}else{J.open(G,M.url,M.async)}try{if(M.data){J.setRequestHeader("Content-Type",M.contentType)}if(M.ifModified){J.setRequestHeader("If-Modified-Since",o.lastModified[M.url]||"Thu, 01 Jan 1970 00:00:00 GMT")}J.setRequestHeader("X-Requested-With","XMLHttpRequest");J.setRequestHeader("Accept",M.dataType&&M.accepts[M.dataType]?M.accepts[M.dataType]+", */*":M.accepts._default)}catch(S){}if(M.beforeSend&&M.beforeSend(J,M)===false){if(M.global&&!--o.active){o.event.trigger("ajaxStop")}J.abort();return false}if(M.global){o.event.trigger("ajaxSend",[J,M])}var N=function(X){if(J.readyState==0){if(P){clearInterval(P);P=null;if(M.global&&!--o.active){o.event.trigger("ajaxStop")}}}else{if(!K&&J&&(J.readyState==4||X=="timeout")){K=true;if(P){clearInterval(P);P=null}R=X=="timeout"?"timeout":!o.httpSuccess(J)?"error":M.ifModified&&o.httpNotModified(J,M.url)?"notmodified":"success";if(R=="success"){try{V=o.httpData(J,M.dataType,M)}catch(Z){R="parsererror"}}if(R=="success"){var Y;try{Y=J.getResponseHeader("Last-Modified")}catch(Z){}if(M.ifModified&&Y){o.lastModified[M.url]=Y}if(!W){I()}}else{o.handleError(M,J,R)}L();if(X){J.abort()}if(M.async){J=null}}}};if(M.async){var P=setInterval(N,13);if(M.timeout>0){setTimeout(function(){if(J&&!K){N("timeout")}},M.timeout)}}try{J.send(M.data)}catch(S){o.handleError(M,J,null,S)}if(!M.async){N()}function I(){if(M.success){M.success(V,R)}if(M.global){o.event.trigger("ajaxSuccess",[J,M])}}function L(){if(M.complete){M.complete(J,R)}if(M.global){o.event.trigger("ajaxComplete",[J,M])}if(M.global&&!--o.active){o.event.trigger("ajaxStop")}}return J},handleError:function(F,H,E,G){if(F.error){F.error(H,E,G)}if(F.global){o.event.trigger("ajaxError",[H,F,G])}},active:0,httpSuccess:function(F){try{return !F.status&&location.protocol=="file:"||(F.status>=200&&F.status<300)||F.status==304||F.status==1223}catch(E){}return false},httpNotModified:function(G,E){try{var H=G.getResponseHeader("Last-Modified");return G.status==304||H==o.lastModified[E]}catch(F){}return false},httpData:function(J,H,G){var F=J.getResponseHeader("content-type"),E=H=="xml"||!H&&F&&F.indexOf("xml")>=0,I=E?J.responseXML:J.responseText;if(E&&I.documentElement.tagName=="parsererror"){throw"parsererror"}if(G&&G.dataFilter){I=G.dataFilter(I,H)}if(typeof I==="string"){if(H=="script"){o.globalEval(I)}if(H=="json"){I=l["eval"]("("+I+")")}}return I},param:function(E){var G=[];function H(I,J){G[G.length]=encodeURIComponent(I)+"="+encodeURIComponent(J)}if(o.isArray(E)||E.jquery){o.each(E,function(){H(this.name,this.value)})}else{for(var F in E){if(o.isArray(E[F])){o.each(E[F],function(){H(F,this)})}else{H(F,o.isFunction(E[F])?E[F]():E[F])}}}return G.join("&").replace(/%20/g,"+")}});var m={},n,d=[["height","marginTop","marginBottom","paddingTop","paddingBottom"],["width","marginLeft","marginRight","paddingLeft","paddingRight"],["o
19pacity"]];function t(F,E){var G={};o.each(d.concat.apply([],d.slice(0,E)),function(){G[this]=F});return G}o.fn.extend({show:function(J,L){if(J){return this.animate(t("show",3),J,L)}else{for(var H=0,F=this.length;H<F;H++){var E=o.data(this[H],"olddisplay");this[H].style.display=E||"";if(o.css(this[H],"display")==="none"){var G=this[H].tagName,K;if(m[G]){K=m[G]}else{var I=o("<"+G+" />").appendTo("body");K=I.css("display");if(K==="none"){K="block"}I.remove();m[G]=K}o.data(this[H],"olddisplay",K)}}for(var H=0,F=this.length;H<F;H++){this[H].style.display=o.data(this[H],"olddisplay")||""}return this}},hide:function(H,I){if(H){return this.animate(t("hide",3),H,I)}else{for(var G=0,F=this.length;G<F;G++){var E=o.data(this[G],"olddisplay");if(!E&&E!=="none"){o.data(this[G],"olddisplay",o.css(this[G],"display"))}}for(var G=0,F=this.length;G<F;G++){this[G].style.display="none"}return this}},_toggle:o.fn.toggle,toggle:function(G,F){var E=typeof G==="boolean";return o.isFunction(G)&&o.isFunction(F)?this._toggle.apply(this,arguments):G==null||E?this.each(function(){var H=E?G:o(this).is(":hidden");o(this)[H?"show":"hide"]()}):this.animate(t("toggle",3),G,F)},fadeTo:function(E,G,F){return this.animate({opacity:G},E,F)},animate:function(I,F,H,G){var E=o.speed(F,H,G);return this[E.queue===false?"each":"queue"](function(){var K=o.extend({},E),M,L=this.nodeType==1&&o(this).is(":hidden"),J=this;for(M in I){if(I[M]=="hide"&&L||I[M]=="show"&&!L){return K.complete.call(this)}if((M=="height"||M=="width")&&this.style){K.display=o.css(this,"display");K.overflow=this.style.overflow}}if(K.overflow!=null){this.style.overflow="hidden"}K.curAnim=o.extend({},I);o.each(I,function(O,S){var R=new o.fx(J,K,O);if(/toggle|show|hide/.test(S)){R[S=="toggle"?L?"show":"hide":S](I)}else{var Q=S.toString().match(/^([+-]=)?([\d+-.]+)(.*)$/),T=R.cur(true)||0;if(Q){var N=parseFloat(Q[2]),P=Q[3]||"px";if(P!="px"){J.style[O]=(N||1)+P;T=((N||1)/R.cur(true))*T;J.style[O]=T+P}if(Q[1]){N=((Q[1]=="-="?-1:1)*N)+T}R.custom(T,N,P)}else{R.custom(T,S,"")}}});return true})},stop:function(F,E){var G=o.timers;if(F){this.queue([])}this.each(function(){for(var H=G.length-1;H>=0;H--){if(G[H].elem==this){if(E){G[H](true)}G.splice(H,1)}}});if(!E){this.dequeue()}return this}});o.each({slideDown:t("show",1),slideUp:t("hide",1),slideToggle:t("toggle",1),fadeIn:{opacity:"show"},fadeOut:{opacity:"hide"}},function(E,F){o.fn[E]=function(G,H){return this.animate(F,G,H)}});o.extend({speed:function(G,H,F){var E=typeof G==="object"?G:{complete:F||!F&&H||o.isFunction(G)&&G,duration:G,easing:F&&H||H&&!o.isFunction(H)&&H};E.duration=o.fx.off?0:typeof E.duration==="number"?E.duration:o.fx.speeds[E.duration]||o.fx.speeds._default;E.old=E.complete;E.complete=function(){if(E.queue!==false){o(this).dequeue()}if(o.isFunction(E.old)){E.old.call(this)}};return E},easing:{linear:function(G,H,E,F){return E+F*G},swing:function(G,H,E,F){return((-Math.cos(G*Math.PI)/2)+0.5)*F+E}},timers:[],fx:function(F,E,G){this.options=E;this.elem=F;this.prop=G;if(!E.orig){E.orig={}}}});o.fx.prototype={update:function(){if(this.options.step){this.options.step.call(this.elem,this.now,this)}(o.fx.step[this.prop]||o.fx.step._default)(this);if((this.prop=="height"||this.prop=="width")&&this.elem.style){this.elem.style.display="block"}},cur:function(F){if(this.elem[this.prop]!=null&&(!this.elem.style||this.elem.style[this.prop]==null)){return this.elem[this.prop]}var E=parseFloat(o.css(this.elem,this.prop,F));return E&&E>-10000?E:parseFloat(o.curCSS(this.elem,this.prop))||0},custom:function(I,H,G){this.startTime=e();this.start=I;this.end=H;this.unit=G||this.unit||"px";this.now=this.start;this.pos=this.state=0;var E=this;function F(J){return E.step(J)}F.elem=this.elem;if(F()&&o.timers.push(F)&&!n){n=setInterval(function(){var K=o.timers;for(var J=0;J<K.length;J++){if(!K[J]()){K.splice(J--,1)}}if(!K.length){clearInterval(n);n=g}},13)}},show:function(){this.options.orig[this.prop]=o.attr(this.elem.style,this.prop);this.options.show=true;this.custom(this.prop=="width"||this.prop=="height"?1:0,this.cur());o(this.elem).show()},hide:function(){this.options.orig[this.prop]=o.attr(this.elem.style,this.prop);this.options.hide=true;this.custom(this.cur(),0)},step:function(H){var G=e();if(H||G>=this.options.duration+this.startTime){this.now=this.end;this.pos=this.state=1;this.update();this.options.curAnim[this.prop]=true;var E=true;for(var F in this.options.curAnim){if(this.options.curAnim[F]!==true){E=false}}if(E){if(this.options.display!=null){this.elem.style.overflow=this.options.overflow;this.elem.style.display=this.options.display;
19if(o.css(this.elem,"display")=="none"){this.elem.style.display="block"}}if(this.options.hide){o(this.elem).hide()}if(this.options.hide||this.options.show){for(var I in this.options.curAnim){o.attr(this.elem.style,I,this.options.orig[I])}}this.options.complete.call(this.elem)}return false}else{var J=G-this.startTime;this.state=J/this.options.duration;this.pos=o.easing[this.options.easing||(o.easing.swing?"swing":"linear")](this.state,J,0,1,this.options.duration);this.now=this.start+((this.end-this.start)*this.pos);this.update()}return true}};o.extend(o.fx,{speeds:{slow:600,fast:200,_default:400},step:{opacity:function(E){o.attr(E.elem.style,"opacity",E.now)},_default:function(E){if(E.elem.style&&E.elem.style[E.prop]!=null){E.elem.style[E.prop]=E.now+E.unit}else{E.elem[E.prop]=E.now}}}});if(document.documentElement.getBoundingClientRect){o.fn.offset=function(){if(!this[0]){return{top:0,left:0}}if(this[0]===this[0].ownerDocument.body){return o.offset.bodyOffset(this[0])}var G=this[0].getBoundingClientRect(),J=this[0].ownerDocument,F=J.body,E=J.documentElement,L=E.clientTop||F.clientTop||0,K=E.
19clientLeft||F.clientLeft||0,I=G.top+(self.pageYOffset||o.boxModel&&E.scrollTop||F.scrollTop)-L,H=G.left+(self.pageXOffset||o.boxModel&&E.scrollLeft||F.scrollLeft)-K;return{top:I,left:H}}}else{o.fn.offset=function(){if(!this[0]){return{top:0,left:0}}if(this[0]===this[0].ownerDocument.body){return o.offset.bodyOffset(this[0])}o.offset.initialized||o.offset.initialize();var J=this[0],G=J.offsetParent,F=J,O=J.ownerDocument,M,H=O.documentElement,K=O.body,L=O.defaultView,E=L.getComputedStyle(J,null),N=J.offsetTop,I=J.offsetLeft;while((J=J.parentNode)&&J!==K&&J!==H){M=L.getComputedStyle(J,null);N-=J.scrollTop,I-=J.scrollLeft;if(J===G){N+=J.offsetTop,I+=J.offsetLeft;if(o.offset.doesNotAddBorder&&!(o.offset.doesAddBorderForTableAndCells&&/^t(able|d|h)$/i.test(J.tagName))){N+=parseInt(M.borderTopWidth,10)||0,I+=parseInt(M.borderLeftWidth,10)||0}F=G,G=J.offsetParent}if(o.offset.subtractsBorderForOverflowNotVisible&&M.overflow!=="visible"){N+=parseInt(M.borderTopWidth,10)||0,I+=parseInt(M.borderLeftWidth,10)||0}E=M}if(E.position==="relative"||E.position==="static"){N+=K.offsetTop,I+=K.offsetLeft}if(E.position==="fixed"){N+=Math.max(H.scrollTop,K.scrollTop),I+=Math.max(H.scrollLeft,K.scrollLeft)}return{top:N,left:I}}}o.offset={initialize:function(){if(this.initialized){return}var L=document.body,F=document.createElement("div"),H,G,N,I,M,E,J=L.style.marginTop,K='<div style="position:absolute;top:0;left:0;margin:0;border:5px solid #000;padding:0;width:1px;height:1px;"><div></div></div><table style="position:absolute;top:0;left:0;margin:0;border:5px solid #000;padding:0;width:1px;height:1px;" cellpadding="0" cellspacing="0"><tr><td></td></tr></table>';M={position:"absolute",top:0,left:0,margin:0,border:0,width:"1px",height:"1px",visibility:"hidden"};for(E in M){F.style[E]=M[E]}F.innerHTML=K;L.insertBefore(F,L.firstChild);H=F.firstChild,G=H.firstChild,I=H.nextSibling.firstChild.firstChild;this.doesNotAddBorder=(G.offsetTop!==5);this.doesAddBorderForTableAndCells=(I.offsetTop===5);H.style.overflow="hidden",H.style.position="relative";this.subtractsBorderForOverflowNotVisible=(G.offsetTop===-5);L.style.marginTop="1px";this.doesNotIncludeMarginInBodyOffset=(L.offsetTop===0);L.style.marginTop=J;L.removeChild(F);this.initialized=true},bodyOffset:function(E){o.offset.initialized||o.offset.initialize();var G=E.offsetTop,F=E.offsetLeft;if(o.offset.doesNotIncludeMarginInBodyOffset){G+=parseInt(o.curCSS(E,"marginTop",true),10)||0,F+=parseInt(o.curCSS(E,"marginLeft",true),10)||0}return{top:G,left:F}}};o.fn.extend({position:function(){var I=0,H=0,F;if(this[0]){var G=this.offsetParent(),J=this.offset(),E=/^body|html$/i.test(G[0].tagName)?{top:0,left:0}:G.offset();J.top-=j(this,"marginTop");J.left-=j(this,"marginLeft");E.top+=j(G,"borderTopWidth");E.left+=j(G,"borderLeftWidth");F={top:J.top-E.top,left:J.left-E.left}}return F},offsetParent:function(){var E=this[0].offsetParent||document.body;while(E&&(!/^body|html$/i.test(E.tagName)&&o.css(E,"position")=="static")){E=E.offsetParent}return o(E)}});o.each(["Left","Top"],function(F,E){var G="scroll"+E;o.fn[G]=function(H){if(!this[0]){return null}return H!==g?this.each(function(){this==l||this==document?l.scrollTo(!F?H:o(l).scrollLeft(),F?H:o(l).scrollTop()):this[G]=H}):this[0]==l||this[0]==document?self[F?"pageYOffset":"pageXOffset"]||o.boxModel&&document.documentElement[G]||document.body[G]:this[0][G]}});o.each(["Height","Width"],function(I,G){var E=I?"Left":"Top",H=I?"Right":"Bottom",F=G.toLowerCase();o.fn["inner"+G]=function(){return this[0]?o.css(this[0],F,false,"padding"):null};o.fn["outer"+G]=function(K){return this[0]?o.css(this[0],F,false,K?"margin":"border"):null};var J=G.toLowerCase();o.fn[J]=function(K){return this[0]==l?document.compatMode=="CSS1Compat"&&document.documentElement["client"+G]||document.body["client"+G]:this[0]==document?Math.max(document.documentElement["client"+G],document.body["scroll"+G],document.documentElement["scroll"+G],document.body["offset"+G],document.documentElement["offset"+G]):K===g?(this.length?o.css(this[0],J):null):this.css(J,typeof K==="string"?K:K+"px")}})})();;
20
21/**
22 * Override jQuery.fn.init to guard against XSS attacks.
23 *
24 * See https://bugs.jquery.com/ticket/9521
25 */
26(function () {
27  var jquery_init = jQuery.fn.init;
28  jQuery.fn.init = function (selector, context, rootjQuery) {
29    // If the string contains a "#" before a "<", treat it as invali
29d HTML.
30    if (selector && typeof selector === 'string') {
31      var hash_position = selector.indexOf('#');
32      if (hash_position >= 0) {
33        var bracket_position = selector.indexOf('<');
34        if (bracket_position > hash_position) {
35          throw 'Syntax error, unrecognized expression: ' + selector;
36        }
37      }
38    }
39    return jquery_init.call(this, selector, context, rootjQuery);
40  };
41  jQuery.fn.init.prototype = jquery_init.prototype;
42})();
43
44var Drupal = Drupal || { 'settings': {}, 'behaviors': {}, 'themes': {}, 'locale': {} };
45
46/**
47 * Set the variable that indicates if JavaScript behaviors should be applied
48 */
49Drupal.jsEnabled = document.getElementsByTagName && document.createElement && document.createTextNode && document.documentElement && document.getElementById;
50
51/**
52 * Attach all registered behaviors to a page element.
53 *
54 * Behaviors are event-triggered actions that attach to page elements, enhancing
55 * default non-Javascript UIs. Behaviors are registered in the Drupal.behaviors
56 * object as follows:
57 * @code
58 *    Drupal.behaviors.behaviorName = function () {
59 *      ...
60 *    };
61 * @endcode
62 *
63 * Drupal.attachBehaviors is added below to the jQuery ready event and so
64 * runs on initial page load. Developers implementing AHAH/AJAX in their
65 * solutions should also call this function after new page content has been
66 * loaded, feeding in an element to be processed, in order to attach all
67 * behaviors to the new content.
68 *
69 * Behaviors should use a class in the form behaviorName-processed to ensure
70 * the behavior is attached only once to a given element. (Doing so enables
71 * the reprocessing of given elements, which may be needed on occasion despite
72 * the ability to limit behavior attachment to a particular element.)
73 *
74 * @param context
75 *   An element to attach behaviors to. If none is given, the document element
76 *   is used.
77 */
78Drupal.attachBehaviors = function(context) {
79  context = context || document;
80  if (Drupal.jsEnabled) {
81    // Execute all of them.
82    jQuery.each(Drupal.behaviors, function() {
83      this(context);
84    });
85  }
86};
87
88/**
89 * Encode special characters in a plain-text string for display as HTML.
90 */
91Drupal.checkPlain = function(str) {
92  str = String(str);
93  var replace = { '&': '&amp;', '"': '&quot;', '<': '&lt;', '>': '&gt;' };
94  for (var character in replace) {
95    var regex = new RegExp(character, 'g');
96    str = str.replace(regex, replace[character]);
97  }
98  return str;
99};
100
101/**
102 * Translate strings to the page language or a given language.
103 *
104 * See the documentation of the server-side t() function for further details.
105 *
106 * @param str
107 *   A string containing the English string to translate.
108 * @param args
109 *   An object of replacements pairs to make after translation. Incidences
110 *   of any key in this array are replaced with the corresponding value.
111 *   Based on the first character of the key, the value is escaped and/or themed:
112 *    - !variable: inserted as is
113 *    - @variable: escape plain text to HTML (Drupal.checkPlain)
114 *    - %variable: escape text and theme as a placeholder for user-submitted
115 *      content (checkPlain + Drupal.theme('placeholder'))
116 * @return
117 *   The translated string.
118 */
119Drupal.t = function(str, args) {
120  // Fetch the localized version of the string.
121  if (Drupal.locale.strings && Drupal.locale.strings[str]) {
122    str = Drupal.locale.strings[str];
123  }
124
125  if (args) {
126    // Transform arguments before inserting them
127    for (var key in args) {
128      switch (key.charAt(0)) {
129        // Escaped only
130        case '@':
131          args[key] = Drupal.checkPlain(args[key]);
132        break;
133        // Pass-through
134        case '!':
135          break;
136        // Escaped and placeholder
137        case '%':
138        default:
139          args[key] = Drupal.theme('placeholder', args[key]);
140          break;
141      }
142      str = str.replace(key, args[key]);
143    }
144  }
145  return str;
146};
147
148/**
149 * Format a string containing a count of items.
150 *
151 * This function ensures that the string is pluralized correctly. Since Drupal.t() is
152 * called by this function, make sure not to pass already-localized strings to it.
153 *
154 * See the documentation of the server-side format_plural() function for further details.
155 *
156 * @param count
157 *   The item count to display.
158 * @param singular
159 *   The string for the singular case. Please make sure it is clear this is
160 *   singular, to ease translation (e.g. use "1 new comment" instead of "1 new").
161 *   Do not use @count in the singular string.
162 * @param plural
163 *   The string for the plural case. Please make sure it is clear this is plural,
164 *   to ease translation. Use @count in place of the item count, as in "@count
165 *   new comments".
166 * @param args
167 *   An object of replacements pairs to make after translation. Incidences
168 *   of any key in this array are replaced with the corresponding value.
169 *   Based on the first character of the key, the value is escaped and/or themed:
170 *    - !variable: inserted as is
171 *    - @variable: escape plain text to HTML (Drupal.checkPlain)
172 *    - %variable: escape text and theme as a placeholder for user-submitted
173 *      content (checkPlain + Drupal.theme('placeholder'))
174 *   Note that you do not need to include @count in this array.
175 *   This replacement is done automatically for the plural case.
176 * @return
177 *   A translated string.
178 */
179Drupal.formatPlural = function(count, singular, plural, args) {
180  var args = args || {};
181  args['@count'] = count;
182  // Determine the index of the plural form.
183  var index = Drupal.locale.pluralFormula ? Drupal.locale.pluralFormula(args['@count']) : ((args['@count'] == 1) ? 0 : 1);
184
185  if (index == 0) {
186    return Drupal.t(singular, args);
187  }
188  else if (index == 1) {
189    return Drupal.t(plural, args);
190  }
191  else {
192    args['@count['+ index +']'] = args['@count'];
193    delete args['@count'];
194    return Drupal.t(plural.replace('@count', '@count['+ index +']'), args);
195  }
196};
197
198/**
199 * Generate the themed representation of a Drupal object.
200 *
201 * All requests for themed output must go through this function. It examines
202 * the request and routes it to the appropriate theme function. If the current
203 * theme does not provide an override function, the generic theme function is
204 * called.
205 *
206 * For example, to retrieve the HTML that is output by theme_placeholder(text),
207 * call Drupal.theme('placeholder', text).
208 *
209 * @param func
210 *   The name of the theme function to call.
211 * @param ...
212 *   Additional arguments to pass along to the theme function.
213 * @return
214 *   Any data the theme function returns. This could be a plain HTML string,
215 *   but also a complex object.
216 */
217Drupal.theme = function(func) {
218  for (var i = 1, args = []; i < arguments.length; i++) {
219    args.push(arguments[i]);
220  }
221
222  return (Drupal.theme[func] || Drupal.theme.prototype[func]).apply(this, args);
223};
224
225/**
226 * Parse a JSON response.
227 *
228 * The result is either the JSON object, or an object with 'status' 0 and 'data' an error message.
229 */
230Drupal.parseJson = function (data) {
231  if ((data.substring(0, 1) != '{') && (data.substring(0, 1) != '[')) {
232    return { status: 0, data: data.length ? data : Drupal.t('Unspecified error') };
233  }
234  return eval('(' + data + ');');
235};
236
237/**
238 * Freeze the current body height (as minimum height). Used to prevent
239 * unnecessary upwards scrolling when doing DOM manipulations.
240 */
241Drupal.freezeHeight = function () {
242  Drupal.unfreezeHeight();
243  var div = document.createElement('div');
244  $(div).css({
245    position: 'absolute',
246    top: '0px',
247    left: '0px',
248    width: '1px',
249    height: $('body').css('height')
250  }).attr('id', 'freeze-height');
251  $('body').append(div);
252};
253
254/**
255 * Unfreeze the body height
256 */
257Drupal.unfreezeHeight = function () {
258  $('#freeze-height').remove();
259};
260
261/**
262 * Wrapper around encodeURIComponent() which avoids Apache quirks (equivalent of
263 * drupal_urlencode() in PHP). This function should only be used on paths, not
264 * on query string arguments.
265 */
266Drupal.encodeURIComponent = function (item, uri) {
267  uri = uri || location.href;
268  item = encodeURIComponent(item).replace(/%2F/g, '/');
269  return (uri.indexOf('?q=') != -1) ? item : item.replace(/%26/g, '%2526').replace(/%23/g, '%2523').replace(/\/\//g, '/%252F');
270};
271
272/**
273 * Get the text selection in a textarea.
274 */
275Drupal.getSelection = function (element) {
276  if (typeof(element.selectionStart) != 'number' && document.selection) {
277    // The current selection
278    var range1 = document.selection.createRange();
279    var range2 = range1.duplicate();
280    // Select all text.
281    range2.moveToElementText(element);
282    // Now move 'dummy' end point to end point of original range.
283    range2.setEndPoint('EndToEnd', range1);
284    // Now we can calculate start and end points.
285    var start = range2.text.length - range1.text.length;
286    var end = start + range1.text.length;
287    return { 'start': start, 'end': end };
288  }
289  return { 'start': element.selectionStart, 'end': element.selectionEnd };
290};
291
292/**
293 * Build an error message from ahah response.
294 */
295Drupal.ahahError = function(xmlhttp, uri) {
296  if (xmlhttp.status == 200) {
297    if (jQuery.trim($(xmlhttp.responseText).text())) {
298      var message = Drupal.t("An error occurred. \n@uri\n@text", {'@uri': uri, '@text': xmlhttp.responseText });
299    }
300    else {
301      var message = Drupal.t("An error occurred. \n@uri\n(no information available).", {'@uri': uri, '@text': xmlhttp.responseText });
302    }
303  }
304  else {
305    var message = Drupal.t("An HTTP error @status occurred. \n@uri", {'@uri': uri, '@status': xmlhttp.status });
306  }
307  return message;
308}
309
310// Global Killswitch on the <html> element
311if (Drupal.jsEnabled) {
312  // Global Killswitch on the <html> element
313  $(document.documentElement).addClass('js');
314  // 'js enabled' cookie
315  document.cookie = 'has_js=1; path=/';
316  // Attach all behaviors.
317  $(document).ready(function() {
318    Drupal.attachBehaviors(this);
319  });
320}
321
322/**
323 * The default themes.
324 */
325Drupal.theme.prototype = {
326
327  /**
328   * Formats text for emphasized display in a placeholder inside a sentence.
329   *
330   * @param str
331   *   The text to format (plain-text).
332   * @return
333   *   The formatted text (html).
334   */
335  placeholder: function(str) {
336    return '<em>' + Drupal.checkPlain(str) + '</em>';
337  }
338};
339;
340// $Id: dhtml_menu.js,v 1.18.2.10 2009/01/12 10:13:30 arancaytar Exp $
341
342/**
343 * @file dhtml_menu.js
344 * The Javascript code for DHTML Menu
345 */
346 
347Drupal.dhtmlMenu = {};
348
349/**
350 * Initialize the module's JS functions
351 */
352Drupal.behaviors.dhtmlMenu = function() {
353  // Do not run this function more than once.
354  if (Drupal.dhtmlMenu.init) {
355    return;
356  }
357  else {
358    Drupal.dhtmlMenu.init = true;
359  }
360
361  // Get the settings.
362  var effects = Drupal.settings.dhtmlMenu;
363
364  $('.collapsed').removeClass('expanded');
365
366  // Get cookie
367  if (!effects.siblings) {
368    var cookie = Drupal.dhtmlMenu.cookieGet();
369    for (var i in cookie) {
370      // If the cookie was not applied to the HTML code yet, do so now.
371      var li = $('#dhtml_menu-' + cookie[i]).parents('li:first');
372      if ($(li).hasClass('collapsed')) {
373        Drupal.dhtmlMenu.toggleMenu(li);
374      }
375    }
376  }
377
378  /* Add jQuery effects and listeners to all menu items.
379   * The ~ (sibling) selector is unidirectional and selects 
380   * only the latter element, so we must use siblings() to get 
381   * back to the link element.
382   */
383   $('ul.menu li.dhtml-menu:not(.leaf,.no-dhtml)').each(function() {
384    var li = this;
385    if (effects.clone) {
386      var ul = $(li).find('ul:first');
387      if (ul.length) {
388        $(li).find('a:first').clone().prependTo(ul).wrap('<li class="leaf fake-leaf"></li>');
389      }
390    }
391
392    if (effects.doubleclick) {
393      $(li).find('a:first').dblclick(function(e) {
394        window.location = this.href;
395      });
396    }
397
398    $(li).find('a:first').click(function(e) {
399      Drupal.dhtmlMenu.toggleMenu($(li));
400      return false;
401    });
402  });
403}
404
405/**
406 * Toggles the menu's state between open and closed.
407 *
408 * @param li
409 *   Object. The <li> element that will be expanded or collapsed.
410 */
411Drupal.dhtmlMenu.toggleMenu = function(li) {
412  var effects = Drupal.settings.dhtmlMenu;
413
414  // If the menu is expanded, collapse it.
415  if($(li).hasClass('expanded')) {
416    if (effects.slide) {
417      $(li).find('ul:first').animate({height: 'hide', opacity: 'hide'}, '1000');
418    }
419    else $(li).find('ul:first').css('display', 'none');
420
421    // If children are closed automatically, find and close them now.
422    if (effects.children) {
423      if (effects.slide) {
424        $(li).find('li.expanded').find('ul:first').animate({height: 'hide', opacity: 'hide'}, '1000');
425      }
426      else $(li).find('li.expanded').find('ul:first').css('display', 'none');
427
428      $(li).find('li.expanded').removeClass('expanded').addClass('collapsed')
429    }
430
431    $(li).removeClass('expanded').addClass('collapsed');
432  }
433
434  // Otherwise, expand it.
435  else {
436    if (effects.slide) {
437      $(li).find('ul:first').animate({height: 'show', opacity: 'show'}, '1000');
438    }
439    else $(li).find('ul:first').css('display', 'block');
440    $(li).removeClass('collapsed').addClass('expanded');
441
442    // If the siblings effect is on, close all sibling menus.
443    if (effects.siblings) {
444      var id = $(li).find('a:first').attr('id');
445
446      // Siblings are all open menus that are neither parents nor children of this menu.
447      $(li).find('li').addClass('own-children-temp');
448	  
449      // If the relativity option is on, select only the siblings that have the same parent
450      if (effects.relativity) {
451        var siblings = $(li).parent().find('li.expanded').not('.own-children-temp').not(':has(#' + id + ')');
452      }
453      // Otherwise, select all menus of the same level
454      else {
455        var siblings = $('ul.menu li.expanded').not('.own-children-temp').not(':has(#' + id + ')');
456      }
457
458      // If children should not get closed automatically...
459      if (!effects.children) {
460        // Remove items that are currently hidden from view (do not close these).
461        $('li.collapsed li.expanded').addClass('sibling-children-temp');
462        // Only close the top-most open sibling, not its children.
463        $(siblings).find('li.expanded').addClass('sibling-children-temp');
464        siblings = $(siblings).not('.sibling-children-temp');
465      }
466
467      $('.own-children-temp, .sibling-children-temp').removeClass('own-children-temp').removeClass('sibling-children-temp');
468
469      if (effects.slide) {
470        $(siblings).find('ul:first').animate({height: 'hide', opacity: 'hide'}, '1000');
471      }
472      else $(siblings).find('ul:first').css('display', 'none');
473
474      $(siblings).removeClass('expanded').addClass('collapsed');
475    }
476  }
477
478  // Save the current state of the menus in the cookie.
479  Drupal.dhtmlMenu.cookieSet();
480}
481
482/**
483 * Reads the dhtml_menu cookie.
484 */
485Drupal.dhtmlMenu.cookieGet = function() {
486  var c = /dhtml_menu=(.*?)(;|$)/.exec(document.cookie);
487  if (c) {
488    return c[1];
489  }
490  else return '';
491}
492
493/**
494 * Saves the dhtml_menu cooki.
495 */
496Drupal.dhtmlMenu.cookieSet = function() {
497  var expanded = new Array();
498  $('li.expanded').each(function() {
499    expanded.push($(this).find('a:first').attr('id').substr(5));
500  });
501  document.cookie = 'dhtml_menu=' + expanded.join(',') + ';path=/';
502}
503
504;
505/*
506 * Shadowbox.js, version 3.0.3
507 * https://shadowbox-js.com/
508 *
509 * Copyright 2007-2010, Michael J. I. Jackson
510 * Date: 2011-02-23 22:09:45 +0000
511 */
512(function(au,k){var Q={version:"3.0.3"};var J=navigator.userAgent.toLowerCase();if(J.indexOf("windows")>-1||J.indexOf("win32")>-1){Q.isWindows=true}else{if(J.indexOf("macintosh")>-1||J.indexOf("mac os x")>-1){Q.isMac=true}else{if(J.indexOf("linux")>-1){Q.isLinux=true}}}Q.isIE=J.indexOf("msie")>-1;Q.isIE6=J.indexOf("msie 6")>-1;Q.isIE7=J.indexOf("msie 7")>-1;Q.isGecko=J.indexOf("gecko")>-1&&J.indexOf("safari")==-1;Q.isWebKit=J.indexOf("applewebkit/")>-1;var ab=/#(.+)$/,af=/^(light|shadow)box\[(.*?)\]/i,az=/\s*([a-z_]*?)\s*=\s*(.+)\s*/,f=/[0-9a-z]+$/i,aD=/(.+\/)shadowbox\.js/i;var A=false,a=false,l={},z=0,R,ap;Q.current=-1;Q.dimensions=null;Q.ease=function(K){return 1+Math.pow(K-1,3)};Q.errorInfo={fla:{name:"Flash",url:"https://www.adobe.com/products/flashplayer/"},qt:{name:"QuickTime",url:"https://www.apple.com/quicktime/download/"},wmp:{name:"Windows Media Player",url:"https://www.microsoft.com/windows/windowsmedia/"},f4m:{name:"Flip4Mac",url:"https://www.flip4mac.com/wmv_download.htm"}};Q.gallery=[];Q.onReady=aj;Q.path=null;Q.player=null;Q.playerId="sb-player";Q.options={animate:true,animateFade:true,autoplayMovies:true,continuous:false,enableKeys:true,flashParams:{bgcolor:"#000000",allowfullscreen:true},flashVars:{},flashVersion:"9.0.115",handleOversize:"resize",handleUnsupported:"link",onChange:aj,onClose:aj,onFinish:aj,onOpen:aj,showMovieControls:true,skipSetup:false,slideshowDelay:0,viewportPadding:20};Q.getCurrent=function(){return Q.current>-1?Q.gallery[Q.current]:null};Q.hasNext=function(){return Q.gallery.length>1&&(Q.current!=Q.gallery.length-1||Q.options.continuous)};Q.isOpen=function(){return A};Q.isPaused=function(){return ap=="pause"};Q.applyOptions=function(K){l=aC({},Q.options);aC(Q.options,K)};Q.revertOptions=function(){aC(Q.options,l)};Q.init=function(aG,aJ){if(a){return}a=true;if(Q.skin.options){aC(Q.options,Q.skin.options)}if(aG){aC(Q.options,aG)}if(!Q.path){var aI,S=document.getElementsByTagName("script");for(var aH=0,K=S.length;aH<K;++aH){aI=aD.exec(S[aH].src);if(aI){Q.path=aI[1];break}}}if(aJ){Q.onReady=aJ}P()};Q.open=function(S){if(A){return}var K=Q.makeGallery(S);Q.gallery=K[0];Q.current=K[1];S=Q.getCurrent();if(S==null){return}Q.applyOptions(S.options||{});G();if(Q.gallery.length){S=Q.getCurrent();if(Q.options.onOpen(S)===false){return}A=true;Q.skin.onOpen(S,c)}};Q.close=function(){if(!A){return}A=false;if(Q.player){Q.player.remove();Q.player=null}if(typeof ap=="number"){clearTimeout(ap);ap=null}z=0;aq(false);Q.options.onClose(Q.getCurrent());Q.skin.onClose();Q.revertOptions()};Q.play=function(){if(!Q.hasNext()){return}if(!z){z=Q.options.slideshowDelay*1000}if(z){R=aw();ap=setTimeout(function(){z=R=0;Q.next()},z);if(Q.skin.onPlay){Q.skin.onPlay()}}};Q.pause=function(){if(typeof ap!="number"){return}z=Math.max(0,z-(aw()-R));if(z){clearTimeout(ap);ap="pause";if(Q.skin.onPause){Q.skin.onPause()}}};Q.change=function(K){if(!(K in Q.gallery)){if(Q.options.continuous){K=(K<0?Q.gallery.length+K:0);if(!(K in Q.gallery)){return}}else{return}}Q.current=K;if(typeof ap=="number"){clearTimeout(ap);ap=null;z=R=0}Q.options.onChange(Q.getCurrent());c(true)};Q.next=function(){Q.change(Q.current+1)};Q.previous=function(){Q.change(Q.current-1)};Q.setDimensions=function(aS,aJ,aQ,aR,aI,K,aO,aL){var aN=aS,aH=aJ;var aM=2*aO+aI;if(aS+aM>aQ){aS=aQ-aM}var aG=2*aO+K;if(aJ+aG>aR){aJ=aR-aG}var S=(aN-aS)/aN,aP=(aH-aJ)/aH,aK=(S>0||aP>0);if(aL&&aK){if(S>aP){aJ=Math.round((aH/aN)*aS)}else{if(aP>S){aS=Math.round((aN/aH)*aJ)}}}Q.dimensions={height:aS+aI,width:aJ+K,innerHeight:aS,innerWidth:aJ,top:Math.floor((aQ-(aS+aM))/2+aO),left:Math.floor((aR-(aJ+aG))/2+aO),oversized:aK};return Q.dimensions};Q.makeGallery=function(aI){var K=[],aH=-1;if(typeof aI=="string"){aI=[aI]}if(typeof aI.length=="number"){aF(aI,function(aK,aL){if(aL.content){K[aK]=aL}else{K[aK]={content:aL}}});aH=0}else{if(aI.tagName){var S=Q.getCache(aI);aI=S?S:Q.makeObject(aI)}if(aI.gallery){K=[];var aJ;for(var aG in Q.cache){aJ=Q.cache[aG];if(aJ.gallery&&aJ.gallery==aI.gallery){if(aH==-1&&aJ.content==aI.content){aH=K.length}K.push(aJ)}}if(aH==-1){K.unshift(aI);aH=0}}else{K=[aI];aH=0}}aF(K,function(aK,aL){K[aK]=aC({},aL)});return[K,aH]};Q.makeObject=function(aH,aG){var aI={content:aH.href,title:aH.getAttribute("title")||"",link:aH};if(aG){aG=aC({},aG);aF(["player","title","height","width","gallery"],function(aJ,aK){if(typeof aG[aK]!="undefined"){aI[aK]=aG[aK];delete aG[aK]}});aI.options=aG}else{aI.options={}}if(!aI.player){aI.player=Q.getPlayer(aI.content)}var K=aH.getAttribute("rel");if(K){var S=K.match(af);if(S){aI.gallery=escape(S[2])}aF(K.split(";"),function(aJ,aK){S=aK.match(az);if(S){aI[S[1]]=S[2]}})}return aI};Q.getPlayer=function(aG){if(aG.indexOf("#")>-1&&aG.indexOf(document.location.href)==0){return"inline"}var aH=aG.indexOf("?");if(aH>-1){aG=aG.substring(0,aH)}var S,K=aG.match(f);if(K){S=K[0].toLowerCase()}if(S){if(Q.img&&Q.img.ext.indexOf(S)>-1){return"img"}if(Q.swf&&Q.swf.ext.indexOf(S)>-1){return"swf"}if(Q.flv&&Q.flv.ext.indexOf(S)>-1){return"flv"}if(Q.qt&&Q.qt.ext.indexOf(S)>-1){if(Q.wmp&&Q.wmp.ext.indexOf(S)>-1){return"qtwmp"}else{return"qt"}}if(Q.wmp&&Q.wmp.ext.indexOf(S)>-1){return"wmp"}}return"iframe"};function G(){var aH=Q.errorInfo,aI=Q.plugins,aK,aL,aO,aG,aN,S,aM,K;for(var aJ=0;aJ<Q.gallery.length;++aJ){aK=Q.gallery[aJ];aL=false;aO=null;switch(aK.player){case"flv":case"swf":if(!aI.fla){aO="fla"}break;case"qt":if(!aI.qt){aO="qt"}break;
512case"wmp":if(Q.isMac){if(aI.qt&&aI.f4m){aK.player="qt"}else{aO="qtf4m"}}else{if(!aI.wmp){aO="wmp"}}break;case"qtwmp":if(aI.qt){aK.player="qt"}else{if(aI.wmp){aK.player="wmp"}else{aO="qtwmp"}}break}if(aO){if(Q.options.handleUnsupported=="link"){switch(aO){case"qtf4m":aN="shared";S=[aH.qt.url,aH.qt.name,aH.f4m.url,aH.f4m.name];break;case"qtwmp":aN="either";S=[aH.qt.url,aH.qt.name,aH.wmp.url,aH.wmp.name];break;default:aN="single";S=[aH[aO].url,aH[aO].name]}aK.player="html";aK.content='<div class="sb-message">'+s(Q.lang.errors[aN],S)+"</div>"}else{aL=true}}else{if(aK.player=="inline"){aG=ab.exec(aK.content);if(aG){aM=ad(aG[1]);if(aM){aK.content=aM.innerHTML}else{aL=true}}else{aL=true}}else{if(aK.player=="swf"||aK.player=="flv"){K=(aK.options&&aK.options.flashVersion)||Q.options.flashVersion;if(Q.flash&&!Q.flash.hasFlashPlayerVersion(K)){aK.width=310;aK.height=177}}}}if(aL){Q.gallery.splice(aJ,1);if(aJ<Q.current){--Q.current}else{if(aJ==Q.current){Q.current=aJ>0?aJ-1:aJ}}--aJ}}}function aq(K){if(!Q.options.enableKeys){return}(K?F:M)(document,"keydown",an)}function an(aG){if(aG.metaKey||aG.shiftKey||aG.altKey||aG.ctrlKey){return}var S=v(aG),K;switch(S){case 81:case 88:case 27:K=Q.close;break;case 37:K=Q.previous;break;case 39:K=Q.next;break;case 32:K=typeof ap=="number"?Q.pause:Q.play;break}if(K){n(aG);K()}}function c(aK){aq(false);var aJ=Q.getCurrent();var aG=(aJ.player=="inline"?"html":aJ.player);if(typeof Q[aG]!="function"){throw"unknown player "+aG}if(aK){Q.player.remove();Q.revertOptions();Q.applyOptions(aJ.options||{})}Q.player=new Q[aG](aJ,Q.playerId);if(Q.gallery.length>1){var aH=Q.gallery[Q.current+1]||Q.gallery[0];if(aH.player=="img"){var S=new Image();S.src=aH.content}var aI=Q.gallery[Q.current-1]||Q.gallery[Q.gallery.length-1];if(aI.player=="img"){var K=new Image();K.src=aI.content}}Q.skin.onLoad(aK,W)}function W(){if(!A){return}if(typeof Q.player.ready!="undefined"){var K=setInterval(function(){if(A){if(Q.player.ready){clearInterval(K);K=null;Q.skin.onReady(e)}}else{clearInterval(K);K=null}},10)}else{Q.skin.onReady(e)}}function e(){if(!A){return}Q.player.append(Q.skin.body,Q.dimensions);Q.skin.onShow(I)}function I(){if(!A){return}if(Q.player.onLoad){Q.player.onLoad()}Q.options.onFinish(Q.getCurrent());if(!Q.isPaused()){Q.play()}aq(true)}if(!Array.prototype.indexOf){Array.prototype.indexOf=function(S,aG){var K=this.length>>>0;aG=aG||0;if(aG<0){aG+=K}for(;aG<K;++aG){if(aG in this&&this[aG]===S){return aG}}return -1}}function aw(){return(new Date).getTime()}function aC(K,aG){for(var S in aG){K[S]=aG[S]}return K}function aF(aH,aI){var S=0,K=aH.length;for(var aG=aH[0];S<K&&aI.call(aG,S,aG)!==false;aG=aH[++S]){}}function s(S,K){return S.replace(/\{(\w+?)\}/g,function(aG,aH){return K[aH]})}function aj(){}function ad(K){return document.getElementById(K)}function C(K){K.parentNode.removeChild(K)}var h=true,x=true;function d(){var K=document.body,S=document.createElement("div");h=typeof S.style.opacity==="string";S.style.position="fixed";S.style.margin=0;S.style.top="20px";K.appendChild(S,K.firstChild);x=S.offsetTop==20;K.removeChild(S)}Q.getStyle=(function(){var K=/opacity=([^)]*)/,S=document.defaultView&&document.defaultView.getComputedStyle;return function(aJ,aI){var aH;if(!h&&aI=="opacity"&&aJ.currentStyle){aH=K.test(aJ.currentStyle.filter||"")?(parseFloat(RegExp.$1)/100)+"":"";return aH===""?"1":aH}if(S){var aG=S(aJ,null);if(aG){aH=aG[aI]}if(aI=="opacity"&&aH==""){aH="1"}}else{aH=aJ.currentStyle[aI]}return aH}})();Q.appendHTML=function(aG,S){if(aG.insertAdjacentHTML){aG.insertAdjacentHTML("BeforeEnd",S)}else{if(aG.lastChild){var K=aG.ownerDocument.createRange();K.setStartAfter(aG.lastChild);var aH=K.createContextualFragment(S);aG.appendChild(aH)}else{aG.innerHTML=S}}};Q.getWindowSize=function(K){if(document.compatMode==="CSS1Compat"){return document.documentElement["client"+K]}return document.body["client"+K]};Q.setOpacity=function(aG,K){var S=aG.style;if(h){S.opacity=(K==1?"":K)}else{S.zoom=1;if(K==1){if(typeof S.filter=="string"&&(/alpha/i).test(S.filter)){S.filter=S.filter.replace(/\s*[\w\.]*alpha\([^\)]*\);?/gi,"")}}else{S.filter=(S.filter||"").replace(/\s*[\w\.]*alpha\([^\)]*\)/gi,"")+" alph
512a(opacity="+(K*100)+")"}}};Q.clearOpacity=function(K){Q.setOpacity(K,1)};function o(K){return K.target}function V(K){return[K.pageX,K.pageY]}function n(K){K.preventDefault()}function v(K){return K.keyCode}function F(aG,S,K){jQuery(aG).bind(S,K)}function M(aG,S,K){jQuery(aG).unbind(S,K)}jQuery.fn.shadowbox=function(K){return this.each(function(){var aG=jQuery(this);var aH=jQuery.extend({},K||{},jQuery.metadata?aG.metadata():jQuery.meta?aG.data():{});var S=this.className||"";aH.width=parseInt((S.match(/w:(\d+)/)||[])[1])||aH.width;aH.height=parseInt((S.match(/h:(\d+)/)||[])[1])||aH.height;Shadowbox.setup(aG,aH)})};var y=false,al;if(document.addEventListener){al=function(){document.removeEventListener("DOMContentLoaded",al,false);Q.load()}}else{if(document.attachEvent){al=function(){if(document.readyState==="complete"){document.detachEvent("onreadystatechange",al);Q.load()}}}}function g(){if(y){return}try{document.documentElement.doScroll("left")}catch(K){setTimeout(g,1);return}Q.load()}function P(){if(document.readyState==="complete"){return Q.load()}if(document.addEventListener){document.addEventListener("DOMContentLoaded",al,false);au.addEventListener("load",Q.load,false)}else{if(document.attachEvent){document.attachEvent("onreadystatechange",al);au.attachEvent("onload",Q.load);var K=false;try{K=au.frameElement===null}catch(S){}if(document.documentElement.doScroll&&K){g()}}}}Q.load=function(){if(y){return}if(!document.body){return setTimeout(Q.load,13)}y=true;d();Q.onReady();if(!Q.options.skipSetup){Q.setup()}Q.skin.init()};Q.plugins={};if(navigator.plugins&&navigator.plugins.length){var w=[];aF(navigator.plugins,function(K,S){w.push(S.name)});w=w.join(",");var ai=w.indexOf("Flip4Mac")>-1;Q.plugins={fla:w.indexOf("Shockwave Flash")>-1,qt:w.indexOf("QuickTime")>-1,wmp:!ai&&w.indexOf("Windows Media")>-1,f4m:ai}}else{var p=function(K){var S;try{S=new ActiveXObject(K)}catch(aG){}return !!S};Q.plugins={fla:p("ShockwaveFlash.ShockwaveFlash"),qt:p("QuickTime.QuickTime"),wmp:p("wmplayer.ocx"),f4m:false}}var X=/^(light|shadow)box/i,am="shadowboxCacheKey",b=1;Q.cache={};Q.select=function(S){var aG=[];if(!S){var K;aF(document.getElementsByTagName("a"),function(aJ,aK){K=aK.getAttribute("rel");if(K&&X.test(K)){aG.push(aK)}})}else{var aI=S.length;if(aI){if(typeof S=="string"){if(Q.find){aG=Q.find(S)}}else{if(aI==2&&typeof S[0]=="string"&&S[1].nodeType){if(Q.find){aG=Q.find(S[0],S[1])}}else{for(var aH=0;aH<aI;++aH){aG[aH]=S[aH]}}}}else{aG.push(S)}}return aG};Q.setup=function(K,S){aF(Q.select(K),function(aG,aH){Q.addCache(aH,S)})};Q.teardown=function(K){aF(Q.select(K),function(S,aG){Q.removeCache(aG)})};Q.addCache=function(aG,K){var S=aG[am];if(S==k){S=b++;aG[am]=S;F(aG,"click",u)}Q.cache[S]=Q.makeObject(aG,K)};Q.removeCache=function(K){M(K,"click",u);delete Q.cache[K[am]];K[am]=null};Q.getCache=function(S){var K=S[am];return(K in Q.cache&&Q.cache[K])};Q.clearCache=function(){for(var K in Q.cache){Q.removeCache(Q.cache[K].link)}Q.cache={}};function u(K){Q.open(this);if(Q.gallery.length){n(K)}}
513/*
514 * Sizzle CSS Selector Engine - v1.0
515 *  Copyright 2009, The Dojo Foundation
516 *  Released under the MIT, BSD, and GPL Licenses.
517 *  More information: https://sizzlejs.com/
518 *
519 * Modified for inclusion in Shadowbox.js
520 */
521Q.find=(function(){var aP=/((?:\((?:\([^()]+\)|[^()]+)+\)|\[(?:\[[^[\]]*\]|['"][^'"]*['"]|[^[\]'"]+)+\]|\\.|[^ >+~,(\[\\]+)+|[>+~])(\s*,\s*)?((?:.|\r|\n)*)/g,aQ=0,aS=Object.prototype.toString,aK=false,aJ=true;[0,0].sort(function(){aJ=false;return 0});var aG=function(a1,aW,a4,a5){a4=a4||[];var a7=aW=aW||document;if(aW.nodeType!==1&&aW.nodeType!==9){return[]}if(!a1||typeof a1!=="string"){return a4}var a2=[],aY,a9,bc,aX,a0=true,aZ=aH(aW),a6=a1;while((aP.exec(""),aY=aP.exec(a6))!==null){a6=aY[3];a2.push(aY[1]);if(aY[2]){aX=aY[3];break}}if(a2.length>1&&aL.exec(a1)){if(a2.length===2&&aM.relative[a2[0]]){a9=aT(a2[0]+a2[1],aW)}else{a9=aM.relative[a2[0]]?[aW]:aG(a2.shift(),aW);while(a2.length){a1=a2.shift();if(aM.relative[a1]){a1+=a2.shift()}a9=aT(a1,a9)}}}else{if(!a5&&a2.length>1&&aW.nodeType===9&&!aZ&&aM.match.ID.test(a2[0])&&!aM.match.ID.test(a2[a2.length-1])){var a8=aG.find(a2.shift(),aW,aZ);aW=a8.expr?aG.filter(a8.expr,a8.set)[0]:a8.set[0]}
521if(aW){var a8=a5?{expr:a2.pop(),set:aO(a5)}:aG.find(a2.pop(),a2.length===1&&(a2[0]==="~"||a2[0]==="+")&&aW.parentNode?aW.parentNode:aW,aZ);a9=a8.expr?aG.filter(a8.expr,a8.set):a8.set;if(a2.length>0){bc=aO(a9)}else{a0=false}while(a2.length){var bb=a2.pop(),ba=bb;if(!aM.relative[bb]){bb=""}else{ba=a2.pop()}if(ba==null){ba=aW}aM.relative[bb](bc,ba,aZ)}}else{bc=a2=[]}}if(!bc){bc=a9}if(!bc){throw"Syntax error, unrecognized expression: "+(bb||a1)}if(aS.call(bc)==="[object Array]"){if(!a0){a4.push.apply(a4,bc)}else{if(aW&&aW.nodeType===1){for(var a3=0;bc[a3]!=null;a3++){if(bc[a3]&&(bc[a3]===true||bc[a3].nodeType===1&&aN(aW,bc[a3]))){a4.push(a9[a3])}}}else{for(var a3=0;bc[a3]!=null;a3++){if(bc[a3]&&bc[a3].nodeType===1){a4.push(a9[a3])}}}}}else{aO(bc,a4)}if(aX){aG(aX,a7,a4,a5);aG.uniqueSort(a4)}return a4};aG.uniqueSort=function(aX){if(aR){aK=aJ;aX.sort(aR);if(aK){for(var aW=1;aW<aX.length;aW++){if(aX[aW]===aX[aW-1]){aX.splice(aW--,1)}}}}return aX};aG.matches=function(aW,aX){return aG(aW,null,null,aX)};aG.find=function(a3,aW,a4){var a2,a0;if(!a3){return[]}for(var aZ=0,aY=aM.order.length;aZ<aY;aZ++){var a1=aM.order[aZ],a0;if((a0=aM.leftMatch[a1].exec(a3))){var aX=a0[1];a0.splice(1,1);if(aX.substr(aX.length-1)!=="\\"){a0[1]=(a0[1]||"").replace(/\\/g,"");a2=aM.find[a1](a0,aW,a4);if(a2!=null){a3=a3.replace(aM.match[a1],"");break}}}}if(!a2){a2=aW.getElementsByTagName("*")}return{set:a2,expr:a3}};aG.filter=function(a6,a5,a9,aZ){var aY=a6,bb=[],a3=a5,a1,aW,a2=a5&&a5[0]&&aH(a5[0]);while(a6&&a5.length){for(var a4 in aM.filter){if((a1=aM.match[a4].exec(a6))!=null){var aX=aM.filter[a4],ba,a8;aW=false;if(a3===bb){bb=[]}if(aM.preFilter[a4]){a1=aM.preFilter[a4](a1,a3,a9,bb,aZ,a2);if(!a1){aW=ba=true}else{if(a1===true){continue}}}if(a1){for(var a0=0;
521(a8=a3[a0])!=null;a0++){if(a8){ba=aX(a8,a1,a0,a3);var a7=aZ^!!ba;if(a9&&ba!=null){if(a7){aW=true}else{a3[a0]=false}}else{if(a7){bb.push(a8);aW=true}}}}}if(ba!==k){if(!a9){a3=bb}a6=a6.replace(aM.match[a4],"");if(!aW){return[]}break}}}if(a6===aY){if(aW==null){throw"Syntax error, unrecognized expression: "+a6}else{break}}aY=a6}return a3};var aM=aG.selectors={order:["ID","NAME","TAG"],match:{ID:/#((?:[\w\u00c0-\uFFFF-]|\\.)+)/,CLASS:/\.((?:[\w\u00c0-\uFFFF-]|\\.)+)/,NAME:/\[name=['"]*((?:[\w\u00c0-\uFFFF-]|\\.)+)['"]*\]/,ATTR:/\[\s*((?:[\w\u00c0-\uFFFF-]|\\.)+)\s*(?:(\S?=)\s*(['"]*)(.*?)\3|)\s*\]/,TAG:/^((?:[\w\u00c0-\uFFFF\*-]|\\.)+)/,CHILD:/:(only|nth|last|first)-child(?:\((even|odd|[\dn+-]*)\))?/,POS:/:(nth|eq|gt|lt|first|last|even|odd)(?:\((\d*)\))?(?=[^-]|$)/,PSEUDO:/:((?:[\w\u00c0-\uFFFF-]|\\.)+)(?:\((['"]*)((?:\([^\)]+\)|[^\2\(\)]*)+)\2\))?/},leftMatch:{},attrMap:{"class":"className","for":"htmlFor"},attrHandle:{href:function(aW){return aW.getAttribute("href")}},relative:{"+":function(a2,aX){var aZ=typeof aX==="string",a1=aZ&&!/\W/.test(aX),a3=aZ&&!a1;if(a1){aX=aX.toLowerCase()}for(var aY=0,aW=a2.length,a0;aY<aW;aY++){if((a0=a2[aY])){while((a0=a0.previousSibling)&&a0.nodeType!==1){}a2[aY]=a3||a0&&a0.nodeName.toLowerCase()===aX?a0||false:a0===aX}}if(a3){aG.filter(aX,a2,true)}},">":function(a2,aX){var a0=typeof aX==="string";if(a0&&!/\W/.test(aX)){aX=aX.toLowerCase();for(var aY=0,aW=a2.length;aY<aW;aY++){var a1=a2[aY];if(a1){var aZ=a1.parentNode;a2[aY]=aZ.nodeName.toLowerCase()===aX?aZ:false}}}else{for(var aY=0,aW=a2.length;aY<aW;aY++){var a1=a2[aY];if(a1){a2[aY]=a0?a1.parentNode:a1.parentNode===aX}}if(a0){aG.filter(aX,a2,true)}}},"":function(aZ,aX,a1){var aY=aQ++,aW=aU;if(typeof aX==="string"&&!/\W/.test(aX)){var a0=aX=aX.toLowerCase();aW=K}aW("parentNode",aX,aY,aZ,a0,a1)},"~":function(aZ,aX,a1){var aY=aQ++,aW=aU;if(typeof aX==="string"&&!/\W/.test(aX)){var a0=aX=aX.toLowerCase();aW=K}aW("previousSibling",aX,aY,aZ,a0,a1)}},find:{ID:function(aX,aY,aZ){if(typeof aY.getElementById!=="undefined"&&!aZ){var aW=aY.getElementById(aX[1]);return aW?[aW]:[]}},NAME:function(aY,a1){if(typeof a1.getElementsByName!=="undefined"){var aX=[],a0=a1.getElementsByName(aY[1]);for(var aZ=0,aW=a0.length;aZ<aW;aZ++){if(a0[aZ].getAttribute("name")===aY[1]){aX.push(a0[aZ])}}return aX.length===0?null:aX}},TAG:function(aW,aX){return aX.getElementsByTagName(aW[1])}},preFilter:{CLASS:function(aZ,aX,aY,aW,a2,a3){aZ=" "+aZ[1].replace(/\\/g,"")+" ";if(a3){return aZ}for(var a0=0,a1;(a1=aX[a0])!=null;a0++){if(a1){if(a2^(a1.className&&(" "+a1.className+" ").replace(/[\t\n]/g," ").indexOf(aZ)>=0)){if(!aY){aW.push(a1)}}else{if(aY){aX[a0]=false}}}}return false},ID:function(aW){return aW[1].replace(/\\/g,"")},TAG:function(aX,aW){return aX[1].toLowerCase()},CHILD:function(aW){if(aW[1]==="nth"){var aX=/(-?)(\d*)n((?:\+|-)?\d*)/.exec(aW[2]==="even"&&"2n"||aW[2]==="odd"&&"2n+1"||!/\D/.test(aW[2])&&"0n+"+aW[2]||aW[2]);aW[2]=(aX[1]+(aX[2]||1))-0;aW[3]=aX[3]-0}aW[0]=aQ++;return aW},ATTR:function(a0,aX,aY,aW,a1,a2){var aZ=a0[1].replace(/\\/g,"");if(!a2&&aM.attrMap[aZ]){a0[1]=aM.attrMap[aZ]}if(a0[2]==="~="){a0[4]=" "+a0[4]+" "}return a0},PSEUDO:function(a0,aX,aY,aW,a1){if(a0[1]==="not"){if((aP.exec(a0[3])||"").length>1||/^\w/.test(a0[3])){a0[3]=aG(a0[3],null,null,aX)}else{var aZ=aG.filter(a0[3],aX,aY,true^a1);if(!aY){aW.push.apply(aW,aZ)}return false}}else{if(aM.match.POS.test(a0[0])||aM.match.CHILD.test(a0[0])){return true}}return a0},POS:function(aW){aW.unshift(true);return aW}},filters:{enabled:function(aW){return aW.disabled===false&&aW.type!=="hidden"},disabled:function(aW){return aW.disabled===true},checked:function(aW){return aW.checked===true},selected:function(aW){aW.parentNode.selectedIndex;return aW.selected===true},parent:function(aW){return !!aW.firstChild},empty:function(aW){return !aW.firstChild},has:function(aY,aX,aW){return !!aG(aW[3],aY).length},header:function(aW){return/h\d/i.test(aW.nodeName)},text:function(aW){return"text"===aW.type},radio:function(aW){return"radio"===aW.type},checkbox:function(aW){return"checkbox"===aW.type},file:function(aW){return"file"===aW.type},password:function(aW){return"password"===aW.type},submit:function(aW){return"submit"===aW.type},image:function(aW){return"image"===aW.type},reset:function(aW){return"reset"===aW.type},button:function(aW){return"button"===aW.type||aW.nodeName.toLowerCase()==="button"},input:function(aW){return/input|select|textarea|button/i.test(aW.nodeName)}},setFilters:{first:function(aX,aW){return aW===0},last:function(aY,aX,aW,aZ){return aX===aZ.length-1},even:function(aX,aW){return aW%2===0},odd:function(aX,aW){return aW%2===1},lt:function(aY,aX,aW){return aX<aW[3]-0},gt:function(aY,aX,aW){return aX>aW[3]-0},nth:function(aY,aX,aW){return aW[3]-0===aX},eq:function(aY,aX,aW){return aW[3]-0===aX}},filter:{PSEUDO:function(a2,aY,aZ,a3){var aX=aY[1],a0=aM.filters[aX];if(a0){return a0(a2,aZ,aY,a3)}else{if(aX==="contains"){return(a2.textContent||a2.innerText||S([a2])||"").indexOf(aY[3])>=0}else{if(aX==="not"){var a1=aY[3];for(var aZ=0,aW=a1.length;aZ<aW;aZ++){if(a1[aZ]===a2){return false}}return true}else{throw"Syntax error, unrecognized expression: "+aX}}}},CHILD:function(aW,aZ){var a2=aZ[1],aX=aW;switch(a2){case"only":case"first":while((aX=aX.previousSibling)){if(aX.nodeType===1){return false}}if(a2==="first"){return true}aX=aW;case"last":while((aX=aX.nextSibling)){if(aX.nodeType===1){return false}}return true;case"nth":var aY=aZ[2],a5=aZ[3];if(aY===1&&a5===0){return true}var a1=aZ[0],a4=aW.parentNode;if(a4&&(a4.sizcache!==a1||!aW.nodeIndex)){var a0=0;for(aX=a4.firstChild;aX;aX=aX.nextSibling){if(aX.nodeType===1){aX.nodeIndex=++a0}}a4.sizcache=a1}var a3=aW.nodeIndex-a5;if(aY===0){return a3===0}else{return(a3%aY===0&&a3/aY>=0)}}},ID:function(aX,aW){return aX.nodeType===1&&aX.getAttribute("id")===aW},TAG:function(aX,aW){return(aW==="*"&&aX.nodeType===1)||aX.nodeName.toLowerCase()===aW}
521,CLASS:function(aX,aW){return(" "+(aX.className||aX.getAttribute("class"))+" ").indexOf(aW)>-1},ATTR:function(a1,aZ){var aY=aZ[1],aW=aM.attrHandle[aY]?aM.attrHandle[aY](a1):a1[aY]!=null?a1[aY]:a1.getAttribute(aY),a2=aW+"",a0=aZ[2],aX=aZ[4];return aW==null?a0==="!=":a0==="="?a2===aX:a0==="*="?a2.indexOf(aX)>=0:a0==="~="?(" "+a2+" ").indexOf(aX)>=0:!aX?a2&&aW!==false:a0==="!="?a2!==aX:a0==="^="?a2.indexOf(aX)===0:a0==="$="?a2.substr(a2.length-aX.length)===aX:a0==="|="?a2===aX||a2.substr(0,aX.length+1)===aX+"-":false},POS:function(a0,aX,aY,a1){var aW=aX[2],aZ=aM.setFilters[aW];if(aZ){return aZ(a0,aY,aX,a1)}}}};var aL=aM.match.POS;for(var aI in aM.match){aM.match[aI]=new RegExp(aM.match[aI].source+/(?![^\[]*\])(?![^\(]*\))/.source);aM.leftMatch[aI]=new RegExp(/(^(?:.|\r|\n)*?)/.source+aM.match[aI].source)}var aO=function(aX,aW){aX=Array.prototype.slice.call(aX,0);if(aW){aW.push.apply(aW,aX);return aW}return aX};try{Array.prototype.slice.call(document.documentElement.childNodes,0)}catch(aV){aO=function(a0,aZ){var aX=aZ||[];if(aS.call(a0)==="[object Array]"){Array.prototype.push.apply(aX,a0)}else{if(typeof a0.length==="number"){for(var aY=0,aW=a0.length;aY<aW;aY++){aX.push(a0[aY])}}else{for(var aY=0;a0[aY];aY++){aX.push(a0[aY])}}}return aX}}var aR;if(document.documentElement.compareDocumentPosition){aR=function(aX,aW){if(!aX.compareDocumentPosition||!aW.compareDocumentPosition){if(aX==aW){aK=true}return aX.compareDocumentPosition?-1:1}var aY=aX.compareDocumentPosition(aW)&4?-1:aX===aW?0:1;if(aY===0){aK=true}return aY}}else{if("sourceIndex" in document.documentElement){aR=function(aX,aW){if(!aX.sourceIndex||!aW.sourceIndex){if(aX==aW){aK=true}return aX.sourceIndex?-1:1}var aY=aX.sourceIndex-aW.sourceIndex;if(aY===0){aK=true}return aY}}else{if(document.createRange){aR=function(aZ,aX){if(!aZ.ownerDocument||!aX.ownerDocument){if(aZ==aX){aK=true}return aZ.ownerDocument?-1:1}var aY=aZ.ownerDocument.createRange(),aW=aX.ownerDocument.createRange();aY.setStart(aZ,0);aY.setEnd(aZ,0);aW.setStart(aX,0);aW.setEnd(aX,0);var a0=aY.compareBoundaryPoints(Range.START_TO_END,aW);if(a0===0){aK=true}return a0}}}}function S(aW){var aX="",aZ;for(var aY=0;aW[aY];aY++){aZ=aW[aY];if(aZ.nodeType===3||aZ.nodeType===4){aX+=aZ.nodeValue}else{if(aZ.nodeType!==8){aX+=S(aZ.childNodes)}}}return aX}(function(){var aX=document.createElement("div"),aY="script"+(new Date).getTime();aX.innerHTML="<a name='"+aY+"'/>";var aW=document.documentElement;aW.insertBefore(aX,aW.firstChild);if(document.getElementById(aY)){aM.find.ID=function(a0,a1,a2){if(typeof a1.getElementById!=="undefined"&&!a2){var aZ=a1.getElementById(a0[1]);return aZ?aZ.id===a0[1]||typeof aZ.getAttributeNode!=="undefined"&&aZ.getAttributeNode("id").nodeValue===a0[1]?[aZ]:k:[]}};aM.filter.ID=function(a1,aZ){var a0=typeof a1.getAttributeNode!=="undefined"&&a1.getAttributeNode("id");return a1.nodeType===1&&a0&&a0.nodeValue===aZ}}aW.removeChild(aX);aW=aX=null})();(function(){var aW=document.createElement("div");aW.appendChild(document.createComment(""));if(aW.getElementsByTagName("*").length>0){aM.find.TAG=function(aX,a1){var a0=a1.getElementsByTagName(aX[1]);if(aX[1]==="*"){var aZ=[];for(var aY=0;a0[aY];aY++){if(a0[aY].nodeType===1){aZ.push(a0[aY])}}a0=aZ}return a0}}aW.innerHTML="<a href='#'></a>";if(aW.firstChild&&typeof aW.firstChild.getAttribute!=="undefined"&&aW.firstChild.getAttribute("href")!=="#"){aM.attrHandle.href=function(aX){return aX.getAttribute("href",2)}}aW=null})();if(document.querySelectorAll){(function(){var aW=aG,aY=document.createElement("div");aY.innerHTML="<p class='TEST'></p>";if(aY.querySelectorAll&&aY.querySelectorAll(".TEST").length===0){return}aG=function(a2,a1,aZ,a0){a1=a1||document;if(!a0&&a1.nodeType===9&&!aH(a1)){try{return aO(a1.querySelectorAll(a2),aZ)}catch(a3){}}return aW(a2,a1,aZ,a0)};for(var aX in aW){aG[aX]=aW[aX]}aY=null})()}(function(){var aW=document.createElement("div");aW.innerHTML="<div class='test e'></div><div class='test'></div>";if(!aW.getElementsByClassName||aW.getElementsByClassName("e").length===0){return}aW.lastChild.className="e";if(aW.getElementsByClassName("e").length===1){return}aM.order.splice(1,0,"CLASS");aM.find.CLASS=function(aX,aY,aZ){if(typeof aY.getElementsByClassName!=="undefined"&&!aZ){return aY.getElementsByClassName(aX[1])}};aW=null})();function K(aX,a2,a1,a5,a3,a4){for(var aZ=0,aY=a5.length;aZ<aY;aZ++){var aW=a5[aZ];if(aW){aW=aW[aX];var a0=false;while(aW){if(aW.sizcache===a1){a0=a5[aW.sizset];break}
521if(aW.nodeType===1&&!a4){aW.sizcache=a1;aW.sizset=aZ}if(aW.nodeName.toLowerCase()===a2){a0=aW;break}aW=aW[aX]}a5[aZ]=a0}}}function aU(aX,a2,a1,a5,a3,a4){for(var aZ=0,aY=a5.length;aZ<aY;aZ++){var aW=a5[aZ];if(aW){aW=aW[aX];var a0=false;while(aW){if(aW.sizcache===a1){a0=a5[aW.sizset];break}if(aW.nodeType===1){if(!a4){aW.sizcache=a1;aW.sizset=aZ}if(typeof a2!=="string"){if(aW===a2){a0=true;break}}else{if(aG.filter(a2,[aW]).length>0){a0=aW;break}}}aW=aW[aX]}a5[aZ]=a0}}}var aN=document.compareDocumentPosition?function(aX,aW){return aX.compareDocumentPosition(aW)&16}:function(aX,aW){return aX!==aW&&(aX.contains?aX.contains(aW):true)};var aH=function(aW){var aX=(aW?aW.ownerDocument||aW:0).documentElement;return aX?aX.nodeName!=="HTML":false};var aT=function(aW,a3){var aZ=[],a0="",a1,aY=a3.nodeType?[a3]:a3;while((a1=aM.match.PSEUDO.exec(aW))){a0+=a1[0];aW=aW.replace(aM.match.PSEUDO,"")}aW=aM.relative[aW]?aW+"*":aW;for(var a2=0,aX=aY.length;a2<aX;a2++){aG(aW,aY[a2],aZ)}return aG.filter(a0,aZ)};return aG})();Q.lang={code:"en",of:"of",loading:"loading",cancel:"Cancel",next:"Next",previous:"Previous",play:"Play",pause:"Pause",close:"Close",errors:{single:'You must install the <a href="{0}">{1}</a> browser plugin to view this content.',shared:'You must install both the <a href="{0}">{1}</a> and <a href="{2}">{3}</a> browser plugins to view this content.',either:'You must install either the <a href="{0}">{1}</a> or the <a href="{2}">{3}</a> browser plugin to view this content.'}};var D,at="sb-drag-proxy",E,j,ag;function ax(){E={x:0,y:0,startX:null,startY:null}}function aA(){var K=Q.dimensions;aC(j.style,{height:K.innerHeight+"px",width:K.innerWidth+"px"})}function O(){ax();var K=["position:absolute","cursor:"+(Q.isGecko?"-moz-grab":"move"),"background-color:"+(Q.isIE?"#fff;filter:alpha(opacity=0)":"transparent")].join(";");Q.appendHTML(Q.skin.body,'<div id="'+at+'" style="'+K+'"></div>');j=ad(at);aA();F(j,"mousedown",L)}function B(){if(j){M(j,"mousedown",L);C(j);j=null}ag=null}function L(S){n(S);var K=V(S);E.startX=K[0];E.startY=K[1];ag=ad(Q.player.id);F(document,"mousemove",H);F(document,"mouseup",i);if(Q.isGecko){j.style.cursor="-moz-grabbing"}}function H(aI){var K=Q.player,aJ=Q.dimensions,aH=V(aI);var aG=aH[0]-E.startX;E.startX+=aG;E.x=Math.max(Math.min(0,E.x+aG),aJ.innerWidth-K.width);var S=aH[1]-E.startY;E.startY+=S;E.y=Math.max(Math.min(0,E.y+S),aJ.innerHeight-K.height);aC(ag.style,{left:E.x+"px",top:E.y+"px"})}function i(){M(document,"mousemove",H);M(document,"mouseup",i);if(Q.isGecko){j.style.cursor="-moz-grab"}}Q.img=function(S,aG){this.obj=S;this.id=aG;this.ready=false;var K=this;D=new Image();D.onload=function(){K.height=S.height?parseInt(S.height,10):D.height;K.width=S.width?parseInt(S.width,10):D.width;K.ready=true;D.onload=null;D=null};D.src=S.content};Q.img.ext=["bmp","gif","jpg","jpeg","png"];Q.img.prototype={append:function(S,aI){var aG=document.createElement("img");aG.id=this.id;aG.src=this.obj.content;aG.style.position="absolute";var K,aH;if(aI.oversized&&Q.options.handleOversize=="resize"){K=aI.innerHeight;aH=aI.innerWidth}else{K=this.height;aH=this.width}aG.setAttribute("height",K);aG.setAttribute("width",aH);S.appendChild(aG)},remove:function(){var K=ad(this.id);if(K){C(K)}B();if(D){D.onload=null;D=null}},onLoad:function(){var K=Q.dimensions;if(K.oversized&&Q.options.handleOversize=="drag"){O()}},onWindowResize:function(){var aH=Q.dimensions;switch(Q.options.handleOversize){case"resize":var K=ad(this.id);K.height=aH.innerHeight;K.width=aH.innerWidth;break;case"drag":if(ag){var aG=parseInt(Q.getStyle(ag,"top")),S=parseInt(Q.getStyle(ag,"left"));if(aG+this.height<aH.innerHeight){ag.style.top=aH.innerHeight-this.height+"px"}if(S+this.width<aH.innerWidth){ag.style.left=aH.innerWidth-this.width+"px"}aA()}break}}};Q.iframe=function(S,aG){this.obj=S;this.id=aG;var K=ad("sb-overlay");this.height=S.height?parseInt(S.height,10):K.offsetHeight;this.width=S.width?parseInt(S.width,10):K.offsetWidth};Q.iframe.prototype={append:function(K,aG){var S='<iframe id="'+this.id+'" name="'+this.id+'" height="100%" width="100%" frameborder="0" marginwidth="0" marginheight="0" style="visibility:hidden" onload="this.style.visibility=\'visible\'" scrolling="auto"';if(Q.isIE){S+=' allowtransparency="true"';if(Q.isIE6){S+=" src=\"javascript:false;document.write('');\""}}S+="></iframe>";K.innerHTML=S},remove:function(){var K=ad(this.id);if(K){C(K);if(Q.isGecko){delete au.frames[this.id]}}},onLoad:function(){var K=Q.isIE?ad(this.id).contentWindow:au.frames[this.id];K.location.href=this.obj.content}};Q.html=function(K,S){this.obj=K;this.id=S;this.height=K.height?parseInt(K.height,10):300;this.width=K.width?parseInt(K.width,10):500};Q.html.prototype={append:function(K,S){var aG=document.createElement("div");aG.id=this.id;aG.className="html";aG.innerHTML=this.obj.content;K.appendChild(aG)},remove:function(){var K=ad(this.id);if(K){C(K)}}};var ao=false,Y=[],q=["sb-nav-close","sb-nav-next","sb-nav-play","sb-nav-pause","sb-nav-previous"],aa,ae,Z,m=true;function N(aG,aQ,aN,aL,aR){var K=(aQ=="opacity"),aM=K?Q.setOpacity:function(aS,aT){aS.style[aQ]=""+aT+"px"};if(aL==0||(!K&&!Q.options.animate)||(K&&!Q.options.animateFade)){aM(aG,aN);if(aR){aR()}return}var aO=parseFloat(Q.getStyle(aG,aQ))||0;var aP=aN-aO;if(aP==0){if(aR){aR()}return}aL*=1000;var aH=aw(),aK=Q.ease,aJ=aH+aL,aI;var S=setInterval(function(){aI=aw();if(aI>=aJ){clearInterval(S);S=null;aM(aG,aN);if(aR){aR()}}else{aM(aG,aO+aK((aI-aH)/aL)*aP)}},10)}function aB(){aa.style.height=Q.getWindowSize("Height")+"px";aa.style.width=Q.getWindowSize("Width")+"px"}function aE(){aa.style.top=document.documentElement.scrollTop+"px";aa.style.left=document.documentElement.scrollLeft+"px"}function ay(K){if(K){aF(Y,function(S,aG){aG[0].style.visibility=aG[1]||""})}else{Y=[];aF(Q.options.troubleElements,function(aG,S){aF(document.getElementsByTagName(S),function(aH,aI){Y.push([aI,aI.style.visibility]);aI.style.visibility="hidden"})})}}function r(aG,K){var S=ad("sb-nav-"+aG);if(S){S.style.display=K?"":"none"}}function ah(K,aJ){var aI=ad("sb-loading"),aG=Q.getCurrent().player,aH=(aG=="img"||aG=="html");if(K){Q.setOpacity(aI,0);aI.style.display="block";var S=function(){Q.clearOpacity(aI);if(aJ){aJ()}};if(aH){N(aI,"opacity",1,Q.options.fadeDuration,S)}else{S()}}else{var S=function(){aI.style.display="none";Q.clearOpacity(aI);if(aJ){aJ()}};if(aH){N(aI,"opacity",0,Q.options.fadeDuration,S)}else{S()}}}function t(aO){var aJ=Q.getCurrent();ad("sb-title-inner").innerHTML=aJ.title||"";var aP,aL,S,aQ,aM;if(Q.options.displayNav){aP=true;var aN=Q.gallery.length;if(aN>1){if(Q.options.continuous){aL=aM=true}else{aL=(aN-1)>Q.current;aM=Q.current>0}}if(Q.options.slideshowDelay>0&&Q.hasNext()){aQ=!Q.isPaused();S=!aQ}}else{aP=aL=S=aQ=aM=false}r("close",aP);r("next",aL);r("play",S);r("pause",aQ);r("previous",aM);var K="";if(Q.options.displayCounter&&Q.gallery.length>1){var aN=Q.gallery.length;if(Q.options.counterType=="skip"){var aI=0,aH=aN,aG=parseInt(Q.options.counterLimit)||0;
521if(aG<aN&&aG>2){var aK=Math.floor(aG/2);aI=Q.current-aK;if(aI<0){aI+=aN}aH=Q.current+(aG-aK);if(aH>aN){aH-=aN}}while(aI!=aH){if(aI==aN){aI=0}K+='<a onclick="Shadowbox.change('+aI+');"';if(aI==Q.current){K+=' class="sb-counter-current"'}K+=">"+(++aI)+"</a>"}}else{K=[Q.current+1,Q.lang.of,aN].join(" ")}}ad("sb-counter").innerHTML=K;aO()}function U(aH){var K=ad("sb-title-inner"),aG=ad("sb-info-inner"),S=0.35;K.style.visibility=aG.style.visibility="";if(K.innerHTML!=""){N(K,"marginTop",0,S)}N(aG,"marginTop",0,S,aH)}function av(aG,aM){var aK=ad("sb-title"),K=ad("sb-info"),aH=aK.offsetHeight,aI=K.offsetHeight,aJ=ad("sb-title-inner"),aL=ad("sb-info-inner"),S=(aG?0.35:0);N(aJ,"marginTop",aH,S);N(aL,"marginTop",aI*-1,S,function(){aJ.style.visibility=aL.style.visibility="hidden";aM()})}function ac(K,aH,S,aJ){var aI=ad("sb-wrapper-inner"),aG=(S?Q.options.resizeDuration:0);N(Z,"top",aH,aG);N(aI,"height",K,aG,aJ)}function ar(K,aH,S,aI){var aG=(S?Q.options.resizeDuration:0);N(Z,"left",aH,aG);N(Z,"width",K,aG,aI)}function ak(aM,aG){var aI=ad("sb-body-inner"),aM=parseInt(aM),aG=parseInt(aG),S=Z.offsetHeight-aI.offsetHeight,K=Z.offsetWidth-aI.offsetWidth,aK=ae.offsetHeight,aL=ae.offsetWidth,aJ=parseInt(Q.options.viewportPadding)||20,aH=(Q.player&&Q.options.handleOversize!="drag");return Q.setDimensions(aM,aG,aK,aL,S,K,aJ,aH)}var T={};T.markup='<div id="sb-container"><div id="sb-overlay"></div><div id="sb-wrapper"><div id="sb-title"><div id="sb-title-inner"></div></div><div id="sb-wrapper-inner"><div id="sb-body"><div id="sb-body-inner"></div><div id="sb-loading"><div id="sb-loading-inner"><span>{loading}</span></div></div></div></div><div id="sb-info"><div id="sb-info-inner"><div id="sb-counter"></div><div id="sb-nav"><a id="sb-nav-close" title="{close}" onclick="Shadowbox.close()"></a><a id="sb-nav-next" title="{next}" onclick="Shadowbox.next()"></a><a id="sb-nav-play" title="{play}" onclick="Shadowbox.play()"></a><a id="sb-nav-pause" title="{pause}" onclick="Shadowbox.pause()"></a><a id="sb-nav-previous" title="{previous}" onclick="Shadowbox.previous()"></a></div></div></div></div></div>';T.options={animSequence:"sync",counterLimit:10,counterType:"default",displayCounter:true,displayNav:true,fadeDuration:0.35,initialHeight:160,initialWidth:320,modal:false,overlayColor:"#000",overlayOpacity:0.5,resizeDuration:0.35,showOverlay:true,troubleElements:["select","object","embed","canvas"]};T.init=function(){Q.appendHTML(document.body,s(T.markup,Q.lang));T.body=ad("sb-body-inner");aa=ad("sb-container");ae=ad("sb-overlay");Z=ad("sb-wrapper");if(!x){aa.style.position="absolute"}if(!h){var aG,K,S=/url\("(.*\.png)"\)/;aF(q,function(aI,aJ){aG=ad(aJ);if(aG){K=Q.getStyle(aG,"backgroundImage").match(S);if(K){aG.style.backgroundImage="none";aG.style.filter="progid:DXImageTransform.Microsoft.AlphaImageLoader(enabled=true,src="+K[1]+",sizingMethod=scale);"}}})}var aH;F(au,"resize",function(){if(aH){clearTimeout(aH);aH=null}if(A){aH=setTimeout(T.onWindowResize,10)}})};T.onOpen=function(K,aG){m=false;aa.style.display="block";aB();var S=ak(Q.options.initialHeight,Q.options.initialWidth);ac(S.innerHeight,S.top);ar(S.width,S.left);if(Q.options.showOverlay){ae.style.backgroundColor=Q.options.overlayColor;Q.setOpacity(ae,0);if(!Q.options.modal){F(ae,"click",Q.close)}ao=true}if(!x){aE();F(au,"scroll",aE)}ay();aa.style.visibility="visible";if(ao){N(ae,"opacity",Q.options.overlayOpacity,Q.options.fadeDuration,aG)}else{aG()}};T.onLoad=function(S,K){ah(true);while(T.body.firstChild){C(T.body.firstChild)}av(S,function(){if(!A){return}if(!S){Z.style.visibility="visible"}t(K)})};T.onReady=function(aH){if(!A){return}var S=Q.player,aG=ak(S.height,S.width);var K=function(){U(aH)};switch(Q.options.animSequence){case"hw":ac(aG.innerHeight,aG.top,true,function(){ar(aG.width,aG.left,true,K)});break;case"wh":ar(aG.width,aG.left,true,function(){ac(aG.innerHeight,aG.top,true,K)});break;default:ar(aG.width,aG.left,true);ac(aG.innerHeight,aG.top,true,K)}};T.onShow=function(K){ah(false,K);m=true};T.onClose=function(){if(!x){M(au,"scroll",aE)}M(ae,"click",Q.close);Z.style.visibility="hidden";var K=function(){aa.style.visibility="hidden";aa.style.display="none";ay(true)};if(ao){N(ae,"opacity",0,Q.options.fadeDuration,K)}else{K()}};T.onPlay=function(){r("play",false);r("pause",true)};T.onPause=function(){r("pause",false);r("play",true)};T.onWindowResize=function(){if(!m){return}aB();var K=Q.player,S=ak(K.height,K.width);ar(S.width,S.left);ac(S.innerHeight,S.top);if(K.onWindowResize){K.onWindowResize()}};Q.skin=T;au.Shadowbox=Q})(window);;
522// $Id: shadowbox_auto.js,v 1.1.4.4.2.4.2.1 2010/04/03 05:53:55 nicholasalipaz Exp $
523
524Drupal.behaviors.shadowbox = function (context) {
525  var settings = Drupal.settings.shadowbox;
526  if (settings.auto_enable_all_images == 1) {
527    $("a[href$='jpg'], a[href$='png'], a[href$='gif'], a[href$='jpeg'], a[href$='bmp'], a[href$='JPG'], a[href$='PNG'], a[href$='GIF'], a[href$='JPEG'], a[href$='BMP']").each(function() {
528      if (settings.auto_gallery == 1) {
529        $(this).attr('rel', 'shadowbox[gallery]');
530      }
531      else {
532        $(this).attr('rel', 'shadowbox');
533      };
534    });
535  };
536  Shadowbox.setup();
537};
538;
539// $Id: extlink.js,v 1.4.2.12 2010/05/26 01:25:56 quicksketch Exp $
540(function ($) {
541
542function extlinkAttach(context) {
543  // Strip the host name down, removing ports, subdomains, or www.
544  var pattern = /^(([^\/:]+?\.)*)([^\.:]{4,})((\.[a-z]{1,4})*)(:[0-9]{1,5})?$/;
545  var host = window.location.host.replace(pattern, '$3$4');
546  var subdomain = window.location.host.replace(pattern, '$1');
547
548  // Determine what subdomains are considered internal.
549  if (Drupal.settings.extlink.extSubdomains) {
550    var subdomains = "([^/]*\\.)?";
551  }
552  else if (subdomain == 'www.' || subdomain == '') {
553    var subdomains = "(www\\.)?";
554  }
555  else {
556    var subdomains = subdomain.replace(".", "\\.");
557  }
558
559  // Build regular expressions that define an internal link.
560  var internal_link = new RegExp("^https?://" + subdomains + host, "i");
561
562  // Extra internal link matching.
563  var extInclude = false;
564  if (Drupal.settings.extlink.extInclude) {
565    extInclude = new RegExp(Drupal.settings.extlink.extInclude.replace(/\\/, '\\'));
566  }
567
568  // Extra external link matching.
569  var extExclude = false;
570  if (Drupal.settings.extlink.extExclude) {
571    extExclude = new RegExp(Drupal.settings.extlink.extExclude.replace(/\\/, '\\'));
572  }
573
574  // Find all links which are NOT internal and begin with http (as opposed
575  // to ftp://, javascript:, etc. other kinds of links.
576  // When operating on the 'this' variable, the host has been appended to
577  // all links by the browser, even local ones.
578  // In jQuery 1.1 and higher, we'd use a filter method here, but it is not
579  // available in jQuery 1.0 (Drupal 5 default).
580  var external_links = new Array();
581  var mailto_links = new Array();
582  $("a:not(." + Drupal.settings.extlink.extClass + ", ." + Drupal.settings.extlink.mailtoClass + ")", context).each(function(el) {
583    try {
584      var url = this.href.toLowerCase();
585      if (url.indexOf('http') == 0 && (!url.match(internal_link) || (extInclude && url.match(extInclude))) && !(extExclude && url.match(extExclude))) {
586        external_links.push(this);
587      }
588      else if (url.indexOf('mailto:') == 0) {
589        mailto_links.push(this);
590      }
591    }
592    // IE7 throws errors often when dealing with irregular links, such as:
593    // <a href="node/10"></a> Empty tags.
594    // <a href="https://user:[email protected]">example</a> User:pass syntax.
595    catch(error) {
596      return false;
597    }
598  });
599
600  if (Drupal.settings.extlink.extClass) {
601    // Apply the "ext" class to all links not containing images.
602    if (parseFloat($().jquery) < 1.2) {
603      $(external_links).not('[img]').addClass(Drupal.settings.extlink.extClass).each(function() { if ($(this).css('display') == 'inline') $(this).after('<span class=' + Drupal.settings.extlink.extClass + '></span>'); });
604    }
605    else {
606      $(external_links).not($(external_links).find('img').parents('a')).addClass(Drupal.settings.extlink.extClass).each(function() { if ($(this).css('display') == 'inline') $(this).after('<span class=' + Drupal.settings.extlink.extClass + '></span>'); });
607    }
608  }
609
610  if (Drupal.settings.extlink.mailtoClass) {
611    // Apply the "mailto" class to all mailto links not containing images.
612    if (parseFloat($().jquery) < 1.2) {
613      $(mailto_links).not('[img]').addClass(Drupal.settings.extlink.mailtoClass).each(function() { if ($(this).css('display') == 'inline') $(this).after('<span class=' + Drupal.settings.extlink.mailtoClass + '></span>'); });
614    }
615    else {
616      $(mailto_links).not($(mailto_links).find('img').parents('a')).addClass(Drupal.settings.extlink.mailtoClass).each(function() { if ($(this).css('display') == 'inline') $(this).after('<span class=' + Drupal.settings.extlink.mailtoClass + '></span>'); });
617    }
618  }
619
620  if (Drupal.settings.extlink.extTarget) {
621    // Apply the target attribute to all links.
622    $(external_links).attr('target', Drupal.settings.extlink.extTarget);
623  }
624
625  if (Drupal.settings.extlink.extAlert) {
626    // Add pop-up click-through dialog.
627    $(external_links).click(function(e) {
628     return confirm(Drupal.settings.extlink.extAlertText);
629    });
630  }
631
632  // Work around for Internet Explorer box model problems.
633  if (($.support && !($.support.boxModel === undefined) && !$.support.boxModel) || ($.browser.msie && parseInt($.browser.version) <= 7)) {
634    $('span.ext, span.mailto').css('display', 'inline-block');
635  }
636}
637
638Drupal.behaviors.extlink = function(context) {
639  extlinkAttach(context);
640}
641
642})(jQuery);
643;
644/*!
645 * Modernizr JavaScript library 1.5
646 * https://www.modernizr.com/
647 *
648 * Copyright (c) 2009-2010 Faruk Ates - https://farukat.es/
649 * Dual-licensed under the BSD and MIT licenses.
650 * https://www.modernizr.com/license/
651 *
652 * Featuring major contributions by
653 * Paul Irish  - https://paulirish.com
654 */
655 window.Modernizr=function(i,e,I){function C(a,b){for(var c in a)if(m[a[c]]!==I&&(!b||b(a[c],D)))return true}function r(a,b){var c=a.charAt(0).toUpperCase()+a.substr(1);return!!C([a,"Webkit"+c,"Moz"+c,"O"+c,"ms"+c,"Khtml"+c],b)}function P(){j[E]=function(a){for(var b=0,c=a.length;b<c;b++)J[a[b]]=!!(a[b]in n);return J}("autocomplete autofocus list placeholder max min multiple pattern required step".split(" "));j[Q]=function(a){for(var b=0,c,h=a.length;b<h;b++){n.setAttribute("type",a[b]);
655if(c=n.type!==
656 "text"){n.value=K;/tel|search/.test(n.type)||(c=/url|email/.test(n.type)?n.checkValidity&&n.checkValidity()===false:n.value!=K)}L[a[b]]=!!c}return L}("search tel url email datetime date month week time datetime-local number range color".split(" "))}var j={},s=e.documentElement,D=e.createElement("modernizr"),m=D.style,n=e.createElement("input"),E="input",Q=E+"types",K=":)",M=Object.prototype.toString,y=" -o- -moz- -ms- -webkit- -khtml- ".split(" "),d={},L={},J={},N=[],u=function(){var a={select:"input",
657 change:"input",submit:"form",reset:"form",error:"img",load:"img",abort:"img"},b={};return function(c,h){var t=arguments.length==1;if(t&&b[c])return b[c];h=h||document.createElement(a[c]||"div");c="on"+c;var g=c in h;if(!g&&h.setAttribute){h.setAttribute(c,"return;");g=typeof h[c]=="function"}h=null;return t?(b[c]=g):g}}(),F={}.hasOwnProperty,O;O=typeof F!=="undefined"&&typeof F.call!=="undefined"?function(a,b){return F.call(a,b)}:function(a,b){return b in a&&typeof a.constructor.prototype[b]==="undefined"};
658 d.canvas=function(){return!!e.createElement("canvas").getContext};d.canvastext=function(){return!!(d.canvas()&&typeof e.createElement("canvas").getContext("2d").fillText=="function")};d.geolocation=function(){return!!navigator.geolocation};d.crosswindowmessaging=function(){return!!i.postMessage};d.websqldatabase=function(){var a=!!i.openDatabase;if(a)try{a=!!openDatabase("testdb","1.0","html5 test db",2E5)}catch(b){a=false}return a};d.indexedDB=function(){return!!i.indexedDB};d.hashchange=function(){return u("hashchange",
659 i)&&(document.documentMode===I||document.documentMode>7)};d.historymanagement=function(){return!!(i.history&&history.pushState)};d.draganddrop=function(){return u("drag")&&u("dragstart")&&u("dragenter")&&u("dragover")&&u("dragleave")&&u("dragend")&&u("drop")};d.websockets=function(){return"WebSocket"in i};d.rgba=function(){m.cssText="background-color:rgba(150,255,150,.5)";return(""+m.backgroundColor).indexOf("rgba")!==-1};d.hsla=function(){m.cssText="background-color:hsla(120,40%,100%,.5)";return(""+
660 m.backgroundColor).indexOf("rgba")!==-1};d.multiplebgs=function(){m.cssText="background:url(//:),url(//:),red url(//:)";return/(url\s*\(.*?){3}/.test(m.background)};d.backgroundsize=function(){return r("backgroundSize")};d.borderimage=function(){return r("borderImage")};d.borderradius=function(){return r("borderRadius","",function(a){return(""+a).indexOf("orderRadius")!==-1})};d.boxshadow=function(){return r("boxShadow")};d.opacity=function(){var a=y.join("opacity:.5;")+"";m.cssText=a;return(""+m.opacity).indexOf("0.5")!==
661 -1};d.cssanimations=function(){return r("animationName")};d.csscolumns=function(){return r("columnCount")};d.cssgradients=function(){var a=("background-image:"+y.join("gradient(linear,left top,right bottom,from(#9f9),to(white));background-image:")+y.join("linear-gradient(left top,#9f9, white);background-image:")).slice(0,-17);m.cssText=a;return(""+m.backgroundImage).indexOf("gradient")!==-1};d.cssreflections=function(){return r("boxReflect")};d.csstransforms=function(){return!!C(["transformProperty",
662 "WebkitTransform","MozTransform","OTransform","msTransform"])};d.csstransforms3d=function(){var a=!!C(["perspectiveProperty","WebkitPerspective","MozPerspective","OPerspective","msPerspective"]);if(a){var b=document.createElement("style"),c=e.createElement("div");b.textContent="@media ("+y.join("transform-3d),(")+"modernizr){#modernizr{height:3px}}";e.getElementsByTagName("head")[0].appendChild(b);c.id="modernizr";s.appendChild(c);a=c.offsetHeight===3;b.parentNode.removeChild(b);c.parentNode.removeChild(c)}return a};
663 d.csstransitions=function(){return r("transitionProperty")};d.fontface=function(){var a;if(/*@cc_on@if(@_jscript_version>=5)!@end@*/0)a=true;else{var b=e.createElement("style"),c=e.createElement("span"),h,t=false,g=e.body,o,w;b.textContent="@font-face{font-family:testfont;src:url('data:font/ttf;base64,AAEAAAAMAIAAAwBAT1MvMliohmwAAADMAAAAVmNtYXCp5qrBAAABJAAAANhjdnQgACICiAAAAfwAAAAEZ2FzcP//AAMAAAIAAAAACGdseWYv5OZoAAACCAAAANxoZWFk69bnvwAAAuQAAAA2aGhlYQUJAt8AAAMcAAAAJGhtdHgGDgC4AAADQAAAABRsb2NhAIQAwgAAA1QAAAAMbWF4cABVANgAAANgAAAAIG5hbWUgXduAAAADgAAABPVwb3N03NkzmgAACHgAAAA4AAECBAEsAAUAAAKZAswAAACPApkCzAAAAesAMwEJAAACAAMDAAAAAAAAgAACbwAAAAoAAAAAAAAAAFBmRWQAAAAgqS8DM/8zAFwDMwDNAAAABQAAAAAAAAAAAAMAAAADAAAAHAABAAAAAABGAAMAAQAAAK4ABAAqAAAABgAEAAEAAgAuqQD//wAAAC6pAP///9ZXAwAAAAAAAAACAAAABgBoAAAAAAAvAAEAAAAAAAAAAAAAAAAAAAABAAIAAAAAAAAAAgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABAAEACoAAAAGAAQAAQACAC6pAP//AAAALqkA////1lcDAAAAAAAAAAIAAAAiAogAAAAB//8AAgACACIAAAEyAqoAAwAHAC6xAQAvPLIHBADtMrEGBdw8sgMCAO0yALEDAC88sgUEAO0ysgcGAfw8sgECAO0yMxEhESczESMiARDuzMwCqv1WIgJmAAACAFUAAAIRAc0ADwAfAAATFRQWOwEyNj0BNCYrASIGARQGKwEiJj0BNDY7ATIWFX8aIvAiGhoi8CIaAZIoN/43KCg3/jcoAWD0JB4eJPQkHh7++EY2NkbVRjY2RgAAAAABAEH/+QCdAEEACQAANjQ2MzIWFAYjIkEeEA8fHw8QDxwWFhwWAAAAAQAAAAIAAIuYbWpfDzz1AAsEAAAAAADFn9IuAAAAAMWf0i797/8zA4gDMwAAAAgAAgAAAAAAAAABAAADM/8zAFwDx/3v/98DiAABAAAAAAAAAAAAAAAAAAAABQF2ACIAAAAAAVUAAAJmAFUA3QBBAAAAKgAqACoAWgBuAAEAAAAFAFAABwBUAAQAAgAAAAEAAQAAAEAALgADAAMAAAAQAMYAAQAAAAAAAACLAAAAAQAAAAAAAQAhAIsAAQAAAAAAAgAFAKwAAQAAAAAAAwBDALEAAQAAAAAABAAnAPQAAQAAAAAABQAKARsAAQAAAAAABgAmASUAAQAAAAAADgAaAUsAAwABBAkAAAEWAWUAAwABBAkAAQBCAnsAAwABBAkAAgAKAr0AAwABBAkAAwCGAscAAwABBAkABABOA00AAwABBAkABQAUA5sAAwABBAkABgBMA68AAwABBAkADgA0A/tDb3B5cmlnaHQgMjAwOSBieSBEYW5pZWwgSm9obnNvbi4gIFJlbGVhc2VkIHVuZGVyIHRoZSB0ZXJtcyBvZiB0aGUgT3BlbiBGb250IExpY2Vuc2UuIEtheWFoIExpIGdseXBocyBhcmUgcmVsZWFzZWQgdW5kZXIgdGhlIEdQTCB2ZXJzaW9uIDMuYmFlYzJhOTJiZmZlNTAzMiAtIHN1YnNldCBvZiBKdXJhTGlnaHRiYWVjMmE5MmJmZmU1MDMyIC0gc3Vic2V0IG9mIEZvbnRGb3JnZSAyLjAgOiBKdXJhIExpZ2h0IDogMjMtMS0yMDA5YmFlYzJhOTJiZmZlNTAzMiAtIHN1YnNldCBvZiBKdXJhIExpZ2h0VmVyc2lvbiA
663yIGJhZWMyYTkyYmZmZTUwMzIgLSBzdWJzZXQgb2YgSnVyYUxpZ2h0aHR0cDovL3NjcmlwdHMuc2lsLm9yZy9PRkwAQwBvAHAAeQByAGkAZwBoAHQAIAAyADAAMAA5ACAAYgB5ACAARABhAG4AaQBlAGwAIABKAG8AaABuAHMAbwBuAC4AIAAgAFIAZQBsAGUAYQBzAGUAZAAgAHUAbgBkAGUAcgAgAHQAaABlACAAdABlAHIAbQBzACAAbwBmACAAdABoAGUAIABPAHAAZQBuACAARgBvAG4AdAAgAEwAaQBjAGUAbgBzAGUALgAgAEsAYQB5AGEAaAAgAEwAaQAgAGcAbAB5AHAAaABzACAAYQByAGUAIAByAGUAbABlAGEAcwBlAGQAIAB1AG4AZABlAHIAIAB0AGgAZQAgAEcAUABMACAAdgBlAHIAcwBpAG8AbgAgADMALgBiAGEAZQBjADIAYQA5ADIAYgBmAGYAZQA1ADAAMwAyACAALQAgAHMAdQBiAHMAZQB0ACAAbwBmACAASgB1AHIAYQBMAGkAZwBoAHQAYgBhAGUAYwAyAGEAOQAyAGIAZgBmAGUANQAwADMAMgAgAC0AIABzAHUAYgBzAGUAdAAgAG8AZgAgAEYAbwBuAHQARgBvAHIAZwBlACAAMgAuADAAIAA6ACAASgB1AHIAYQAgAEwAaQBnAGgAdAAgADoAIAAyADMALQAxAC0AMgAwADAAOQBiAGEAZQBjADIAYQA5ADIAYgBmAGYAZQA1ADAAMwAyACAALQAgAHMAdQBiAHMAZQB0ACAAbwBmACAASgB1AHIAYQAgAEwAaQBnAGgAdABWAGUAcgBzAGkAbwBuACAAMgAgAGIAYQBlAGMAMgBhADkAMgBiAGYAZgBlADUAMAAzADIAIAAtACAAcwB1AGIAcwBlAHQAIABvAGYAIABKAHUAcgBhAEwAaQBnAGgAdABoAHQAdABwADoALwAvAHMAYwByAGkAcAB0AHMALgBzAGkAbAAuAG8AcgBnAC8ATwBGAEwAAAAAAgAAAAAAAP+BADMAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAAAAQACAQIAEQt6ZXJva2F5YWhsaQ==')}";
664 e.getElementsByTagName("head")[0].appendChild(b);c.setAttribute("style","font:99px _,arial,helvetica;position:absolute;visibility:hidden");if(!g){g=s.appendChild(e.createElement("fontface"));t=true}c.innerHTML="........";c.id="fonttest";g.appendChild(c);h=c.offsetWidth*c.offsetHeight;c.style.font="99px testfont,_,arial,helvetica";a=h!==c.offsetWidth*c.offsetHeight;var v=function(){if(g.parentNode){a=j.fontface=h!==c.offsetWidth*c.offsetHeight;s.className=s.className.replace(/(no-)?fontface\b/,"")+
665 (a?" ":" no-")+"fontface"}};setTimeout(v,75);setTimeout(v,150);addEventListener("load",function(){v();(w=true)&&o&&o(a);setTimeout(function(){t||(g=c);g.parentNode.removeChild(g);b.parentNode.removeChild(b)},50)},false)}j._fontfaceready=function(p){w||a?p(a):(o=p)};return a||h!==c.offsetWidth};d.video=function(){var a=e.createElement("video"),b=!!a.canPlayType;if(b){b=new Boolean(b);b.ogg=a.canPlayType('video/ogg; codecs="theora"');b.h264=a.canPlayType('video/mp4; codecs="avc1.42E01E"');b.webm=a.canPlayType('video/webm; codecs="vp8, vorbis"')}return b};
666 d.audio=function(){var a=e.createElement("audio"),b=!!a.canPlayType;if(b){b=new Boolean(b);b.ogg=a.canPlayType('audio/ogg; codecs="vorbis"');b.mp3=a.canPlayType("audio/mpeg;");b.wav=a.canPlayType('audio/wav; codecs="1"');b.m4a=a.canPlayType("audio/x-m4a;")||a.canPlayType("audio/aac;")}return b};d.localStorage=function(){return"localStorage"in i&&i.localStorage!==null};d.sessionStorage=function(){try{return"sessionStorage"in i&&i.sessionStorage!==null}catch(a){return false}};d.webworkers=function(){return!!i.Worker};
667 d.applicationCache=function(){var a=i.applicationCache;return!!(a&&typeof a.status!="undefined"&&typeof a.update=="function"&&typeof a.swapCache=="function")};d.svg=function(){return!!e.createElementNS&&!!e.createElementNS("https://www.w3.org/2000/svg","svg").createSVGRect};d.smil=function(){return!!e.createElementNS&&/SVG/.test(M.call(e.createElementNS("https://www.w3.org/2000/svg","animate")))};d.svgclippaths=function(){return!!e.createElementNS&&/SVG/.test(M.call(e.createElementNS("https://www.w3.org/2000/svg",
668 "clipPath")))};for(var z in d)if(O(d,z))N.push(((j[z.toLowerCase()]=d[z]())?"":"no-")+z.toLowerCase());j[E]||P();j.addTest=function(a,b){a=a.toLowerCase();if(!j[a]){b=!!b();s.className+=" "+(b?"":"no-")+a;j[a]=b;return j}};m.cssText="";D=n=null;(function(){var a=e.createElement("div");a.innerHTML="<elem></elem>";return a.childNodes.length!==1})()&&function(a,b){function c(f,k){if(o[f])o[f].styleSheet.cssText+=k;else{var l=t[G],q=b[A]("style");q.media=f;l.insertBefore(q,l[G]);o[f]=q;c(f,k)}}function h(f,
669 k){for(var l=new RegExp("\\b("+w+")\\b(?!.*[;}])","gi"),q=function(B){return".iepp_"+B},x=-1;++x<f.length;){k=f[x].media||k;h(f[x].imports,k);c(k,f[x].cssText.replace(l,q))}}for(var t=b.documentElement,g=b.createDocumentFragment(),o={},w="abbr|article|aside|audio|canvas|command|datalist|details|figure|figcaption|footer|header|hgroup|keygen|mark|meter|nav|output|progress|section|source|summary|time|video",v=w.split("|"),p=[],H=-1,G="firstChild",A="createElement";++H<v.length;){b[A](v[H]);g[A](v[H])}g=
670 g.appendChild(b[A]("div"));a.attachEvent("onbeforeprint",function(){for(var f,k=b.getElementsByTagName("*"),l,q,x=new RegExp("^"+w+"$","i"),B=-1;++B<k.length;
670)if((f=k[B])&&(q=f.nodeName.match(x))){l=new RegExp("^\\s*<"+q+"(.*)\\/"+q+">\\s*$","i");g.innerHTML=f.outerHTML.replace(/\r|\n/g," ").replace(l,f.currentStyle.display=="block"?"<div$1/div>":"<span$1/span>");l=g.childNodes[0];l.className+=" iepp_"+q;l=p[p.length]=[f,l];f.parentNode.replaceChild(l[1],l[0])}h(b.styleSheets,"all")});a.attachEvent("onafterprint",
671 function(){for(var f=-1,k;++f<p.length;)p[f][1].parentNode.replaceChild(p[f][0],p[f][1]);for(k in o)t[G].removeChild(o[k]);o={};p=[]})}(this,e);j._enableHTML5=true;j._version="1.5";s.className=s.className.replace(/\bno-js\b/,"")+" js";s.className+=" "+N.join(" ");return j}(this,this.document);;
672/*
673 * jQuery UI 1.7.3
674 *
675 * Copyright (c) 2009 AUTHORS.txt (https://jqueryui.com/about)
676 * Dual licensed under the MIT (MIT-LICENSE.txt)
677 * and GPL (GPL-LICENSE.txt) licenses.
678 *
679 * https://docs.jquery.com/UI
680 */
681;jQuery.ui || (function($) {
682
683var _remove = $.fn.remove,
684	isFF2 = $.browser.mozilla && (parseFloat($.browser.version) < 1.9);
685
686//Helper functions and ui object
687$.ui = {
688	version: "1.7.3",
689
690	// $.ui.plugin is deprecated.  Use the proxy pattern instead.
691	plugin: {
692		add: function(module, option, set) {
693			var proto = $.ui[module].prototype;
694			for(var i in set) {
695				proto.plugins[i] = proto.plugins[i] || [];
696				proto.plugins[i].push([option, set[i]]);
697			}
698		},
699		call: function(instance, name, args) {
700			var set = instance.plugins[name];
701			if(!set || !instance.element[0].parentNode) { return; }
702
703			for (var i = 0; i < set.length; i++) {
704				if (instance.options[set[i][0]]) {
705					set[i][1].apply(instance.element, args);
706				}
707			}
708		}
709	},
710
711	contains: function(a, b) {
712		return document.compareDocumentPosition
713			? a.compareDocumentPosition(b) & 16
714			: a !== b && a.contains(b);
715	},
716
717	hasScroll: function(el, a) {
718
719		//If overflow is hidden, the element might have extra content, but the user wants to hide it
720		if ($(el).css('overflow') == 'hidden') { return false; }
721
722		var scroll = (a && a == 'left') ? 'scrollLeft' : 'scrollTop',
723			has = false;
724
725		if (el[scroll] > 0) { return true; }
726
727		// TODO: determine which cases actually cause this to happen
728		// if the element doesn't have the scroll set, see if it's possible to
729		// set the scroll
730		el[scroll] = 1;
731		has = (el[scroll] > 0);
732		el[scroll] = 0;
733		return has;
734	},
735
736	isOverAxis: function(x, reference, size) {
737		//Determines when x coordinate is over "b" element axis
738		return (x > reference) && (x < (reference + size));
739	},
740
741	isOver: function(y, x, top, left, height, width) {
742		//Determines when x, y coordinates is over "b" element
743		return $.ui.isOverAxis(y, top, height) && $.ui.isOverAxis(x, left, width);
744	},
745
746	keyCode: {
747		BACKSPACE: 8,
748		CAPS_LOCK: 20,
749		COMMA: 188,
750		CONTROL: 17,
751		DELETE: 46,
752		DOWN: 40,
753		END: 35,
754		ENTER: 13,
755		ESCAPE: 27,
756		HOME: 36,
757		INSERT: 45,
758		LEFT: 37,
759		NUMPAD_ADD: 107,
760		NUMPAD_DECIMAL: 110,
761		NUMPAD_DIVIDE: 111,
762		NUMPAD_ENTER: 108,
763		NUMPAD_MULTIPLY: 106,
764		NUMPAD_SUBTRACT: 109,
765		PAGE_DOWN: 34,
766		PAGE_UP: 33,
767		PERIOD: 190,
768		RIGHT: 39,
769		SHIFT: 16,
770		SPACE: 32,
771		TAB: 9,
772		UP: 38
773	}
774};
775
776// WAI-ARIA normalization
777if (isFF2) {
778	var attr = $.attr,
779		removeAttr = $.fn.removeAttr,
780		ariaNS = "https://www.w3.org/2005/07/aaa",
781		ariaState = /^aria-/,
782		ariaRole = /^wairole:/;
783
784	$.attr = function(elem, name, value) {
785		var set = value !== undefined;
786
787		return (name == 'role'
788			? (set
789				? attr.call(this, elem, name, "wairole:" + value)
790				: (attr.apply(this, arguments) || "").replace(ariaRole, ""))
791			: (ariaState.test(name)
792				? (set
793					? elem.setAttributeNS(ariaNS,
794						name.replace(ariaState, "aaa:"), value)
795					: attr.call(this, elem, name.replace(ariaState, "aaa:")))
796				: attr.apply(this, arguments)));
797	};
798
799	$.fn.removeAttr = function(name) {
800		return (ariaState.test(name)
801			? this.each(function() {
802				this.removeAttributeNS(ariaNS, name.replace(ariaState, ""));
803			}) : removeAttr.call(this, name));
804	};
805}
806
807//jQuery plugins
808$.fn.extend({
809	remove: function(selector, keepData) {
810		return this.each(function() {
811			if ( !keepData ) {
812				if ( !selector || $.filter( selector, [ this ] ).length ) {
813					$( "*", this ).add( this ).each(function() {
814						$( this ).triggerHandler( "remove" );
815					});
816				}
817			}
818			return _remove.call( $(this), selector, keepData );
819		});
820	},
821
822	enableSelection: function() {
823		return this
824			.attr('unselectable', 'off')
825			.css('MozUserSelect', '')
826			.unbind('selectstart.ui');
827	},
828
829	disableSelection: function() {
830		return this
831			.attr('unselectable', 'on')
832			.css('MozUserSelect', 'none')
833			.bind('selectstart.ui', function() { return false; });
834	},
835
836	scrollParent: function() {
837		var scrollParent;
838		if(($.browser.msie && (/(static|relative)/).test(this.css('position'))) || (/absolute/).test(this.css('position'))) {
839			scrollParent = this.parents().filter(function() {
840				return (/(relative|absolute|fixed)/).test($.curCSS(this,'position',1)) && (/(auto|scroll)/).test($.curCSS(this,'overflow',1)+$.curCSS(this,'overflow-y',1)+$.curCSS(this,'overflow-x',1));
841			}).eq(0);
842		} else {
843			scrollParent = this.parents().filter(function() {
844				return (/(auto|scroll)/).test($.curCSS(this,'overflow',1)+$.curCSS(this,'overflow-y',1)+$.curCSS(this,'overflow-x',1));
845			}).eq(0);
846		}
847
848		return (/fixed/).test(this.css('position')) || !scrollParent.length ? $(document) : scrollParent;
849	}
850});
851
852
853//Additional selectors
854$.extend($.expr[':'], {
855	data: function(elem, i, match) {
856		return !!$.data(elem, match[3]);
857	},
858
859	focusable: function(element) {
860		var nodeName = element.nodeName.toLowerCase(),
861			tabIndex = $.attr(element, 'tabindex');
862		return (/input|select|textarea|button|object/.test(nodeName)
863			? !element.disabled
864			: 'a' == nodeName || 'area' == nodeName
865				? element.href || !isNaN(tabIndex)
866				: !isNaN(tabIndex))
867			// the element and all of its ancestors must be visible
868			// the browser may report that the area is hidden
869			&& !$(element)['area' == nodeName ? 'parents' : 'closest'](':hidden').length;
870	},
871
872	tabbable: function(element) {
873		var tabIndex = $.attr(element, 'tabindex');
874		return (isNaN(tabIndex) || tabIndex >= 0) && $(element).is(':focusable');
875	}
876});
877
878
879// $.widget is a factory to create jQuery plugins
880// taking some boilerplate code out of the plugin code
881function getter(namespace, plugin, method, args) {
882	function getMethods(type) {
883		var methods = $[namespace][plugin][type] || [];
884		return (typeof methods == 'string' ? methods.split(/,?\s+/) : methods);
885	}
886
887	var methods = getMethods('getter');
888	if (args.length == 1 && typeof args[0] == 'string') {
889		methods = methods.concat(getMethods('getterSetter'));
890	}
891	return ($.inArray(method, methods) != -1);
892}
893
894$.widget = function(name, prototype) {
895	var namespace = name.split(".")[0];
896	name = name.split(".")[1];
897
898	// create plugin method
899	$.fn[name] = function(options) {
900		var isMethodCall = (typeof options == 'string'),
901			args = Array.prototype.slice.call(arguments, 1);
902
903		// prevent calls to internal methods
904		if (isMethodCall && options.substring(0, 1) == '_') {
905			return this;
906		}
907
908		// handle getter methods
909		if (isMethodCall && getter(namespace, name, options, args)) {
910			var instance = $.data(this[0], name);
911			return (instance ? instance[options].apply(instance, args)
912				: undefined);
913		}
914
915		// handle initialization and non-getter methods
916		return this.each(function() {
917			var instance = $.data(this, name);
918
919			// constructor
920			(!instance && !isMethodCall &&
921				$.data(this, name, new $[namespace][name](this, options))._init());
922
923			// method call
924			(instance && isMethodCall && $.isFunction(instance[options]) &&
925				instance[options].apply(instance, args));
926		});
927	};
928
929	// create widget constructor
930	$[namespace] = $[namespace] || {};
931	$[namespace][name] = function(element, options) {
932		var self = this;
933
934		this.namespace = namespace;
935		this.widgetName = name;
936		this.widgetEventPrefix = $[namespace][name].eventPrefix || name;
937		this.widgetBaseClass = namespace + '-' + name;
938
939		this.options = $.extend({},
940			$.widget.defaults,
941			$[namespace][name].defaults,
942			$.metadata && $.metadata.get(element)[name],
943			options);
944
945		this.element = $(element)
946			.bind('setData.' + name, function(event, key, value) {
947				if (event.target == element) {
948					return self._setData(key, value);
949				}
950			})
951			.bind('getData.' + name, function(event, key) {
952				if (event.target == element) {
953					return self._getData(key);
954				}
955			})
956			.bind('remove', function() {
957				return self.destroy();
958			});
959	};
960
961	// add widget prototype
962	$[namespace][name].prototype = $.extend({}, $.widget.prototype, prototype);
963
964	// TODO: merge getter and getterSetter properties from widget prototype
965	// and plugin prototype
966	$[namespace][name].getterSetter = 'option';
967};
968
969$.widget.prototype = {
970	_init: function() {},
971	destroy: function() {
972		this.element.removeData(this.widgetName)
973			.removeClass(this.widgetBaseClass + '-disabled' + ' ' + this.namespace + '-state-disabled')
974			.removeAttr('aria-disabled');
975	},
976
977	option: function(key, value) {
978		var options = key,
979			self = this;
980
981		if (typeof key == "string") {
982			if (value === undefined) {
983				return this._getData(key);
984			}
985			options = {};
986			options[key] = value;
987		}
988
989		$.each(options, function(key, value) {
990			self._setData(key, value);
991		});
992	},
993	_getData: function(key) {
994		return this.options[key];
995	},
996	_setData: function(key, value) {
997		this.options[key] = value;
998
999		if (key == 'disabled') {
1000			this.element
1001				[value ? 'addClass' : 'removeClass'](
1002					this.widgetBaseClass + '-disabled' + ' ' +
1003					this.namespace + '-state-disabled')
1004				.attr("aria-disabled", value);
1005		}
1006	},
1007
1008	enable: function() {
1009		this._setData('disabled', false);
1010	},
1011	disable: function() {
1012		this._setData('disabled', true);
1013	},
1014
1015	_trigger: function(type, event, data) {
1016		var callback = this.options[type],
1017			eventName = (type == this.widgetEventPrefix
1018				? type : this.widgetEventPrefix + type);
1019
1020		event = $.Event(event);
1021		event.type = eventName;
1022
1023		// copy original event properties over to the new event
1024		// this would happen if we could call $.event.fix instead of $.Event
1025		// but we don't have a way to force an event to be fixed multiple times
1026		if (event.originalEvent) {
1027			for (var i = $.event.props.length, prop; i;) {
1028				prop = $.event.props[--i];
1029				event[prop] = event.originalEvent[prop];
1030			}
1031		}
1032
1033		this.element.trigger(event, data);
1034
1035		return !($.isFunction(callback) && callback.call(this.element[0], event, data) === false
1036			|| event.isDefaultPrevented());
1037	}
1038};
1039
1040$.widget.defaults = {
1041	disabled: false
1042};
1043
1044
1045/** Mouse Interaction Plugin **/
1046
1047$.ui.mouse = {
1048	_mouseInit: function() {
1049		var self = this;
1050
1051		this.element
1052			.bind('mousedown.'+this.widgetName, function(event) {
1053				return self._mouseDown(event);
1054			})
1055			.bind('click.'+this.widgetName, function(event) {
1056				if(self._preventClickEvent) {
1057					self._preventClickEvent = false;
1058					event.stopImmediatePropagation();
1059					return false;
1060				}
1061			});
1062
1063		// Prevent text selection in IE
1064		if ($.browser.msie) {
1065			this._mouseUnselectable = this.element.attr('unselectable');
1066			this.element.attr('unselectable', 'on');
1067		}
1068
1069		this.started = false;
1070	},
1071
1072	// TODO: make sure destroying one instance of mouse doesn't mess with
1073	// other instances of mouse
1074	_mouseDestroy: function() {
1075		this.element.unbind('.'+this.widgetName);
1076
1077		// Restore text selection in IE
1078		($.browser.msie
1079			&& this.element.attr('unselectable', this._mouseUnselectable));
1080	},
1081
1082	_mouseDown: function(event) {
1083		// don't let more than one widget handle mouseStart
1084		// TODO: figure out why we have to use originalEvent
1085		event.originalEvent = event.originalEvent || {};
1086		if (event.originalEvent.mouseHandled) { return; }
1087
1088		// we may have missed mouseup (out of window)
1089		(this._mouseStarted && this._mouseUp(event));
1090
1091		this._mouseDownEvent = event;
1092
1093		var self = this,
1094			btnIsLeft = (event.which == 1),
1095			elIsCancel = (typeof this.options.cancel == "string" ? $(event.target).parents().add(event.target).filter(this.options.cancel).length : false);
1096		if (!btnIsLeft || elIsCancel || !this._mouseCapture(event)) {
1097			return true;
1098		}
1099
1100		this.mouseDelayMet = !this.options.delay;
1101		if (!this.mouseDelayMet) {
1102			this._mouseDelayTimer = setTimeout(function() {
1103				self.mouseDelayMet = true;
1104			}, this.options.delay);
1105		}
1106
1107		if (this._mouseDistanceMet(event) && this._mouseDelayMet(event)) {
1108			this._mouseStarted = (this._mouseStart(event) !== false);
1109			if (!this._mouseStarted) {
1110				event.preventDefault();
1111				return true;
1112			}
1113		}
1114
1115		// these delegates are required to keep context
1116		this._mouseMoveDelegate = function(event) {
1117			return self._mouseMove(event);
1118		};
1119		this._mouseUpDelegate = function(event) {
1120			return self._mouseUp(event);
1121		};
1122		$(document)
1123			.bind('mousemove.'+this.widgetName, this._mouseMoveDelegate)
1124			.bind('mouseup.'+this.widgetName, this._mouseUpDelegate);
1125
1126		// preventDefault() is used to prevent the selection of text here -
1127		// however, in Safari, this causes select boxes not to be selectable
1128		// anymore, so this fix is needed
1129		($.browser.safari || event.preventDefault());
1130
1131		event.originalEvent.mouseHandled = true;
1132		return true;
1133	},
1134
1135	_mouseMove: function(event) {
1136		// IE mouseup check - mouseup happened when mouse was out of window
1137		if ($.browser.msie && !event.button) {
1138			return this._mouseUp(event);
1139		}
1140
1141		if (this._mouseStarted) {
1142			this._mouseDrag(event);
1143			return event.preventDefault();
1144		}
1145
1146		if (this._mouseDistanceMet(event) && this._mouseDelayMet(event)) {
1147			this._mouseStarted =
1148				(this._mouseStart(this._mouseDownEvent, event) !== false);
1149			(this._mouseStarted ? this._mouseDrag(event) : this._mouseUp(event));
1150		}
1151
1152		return !this._mouseStarted;
1153	},
1154
1155	_mouseUp: function(event) {
1156		$(document)
1157			.unbind('mousemove.'+this.widgetName, this._mouseMoveDelegate)
1158			.unbind('mouseup.'+this.widgetName, this._mouseUpDelegate);
1159
1160		if (this._mouseStarted) {
1161			this._mouseStarted = false;
1162			this._preventClickEvent = (event.target == this._mouseDownEvent.target);
1163			this._mouseStop(event);
1164		}
1165
1166		return false;
1167	},
1168
1169	_mouseDistanceMet: function(event) {
1170		return (Math.max(
1171				Math.abs(this._mouseDownEvent.pageX - event.pageX),
1172				Math.abs(this._mouseDownEvent.pageY - event.pageY)
1173			) >= this.options.distance
1174		);
1175	},
1176
1177	_mouseDelayMet: function(event) {
1178		return this.mouseDelayMet;
1179	},
1180
1181	// These are placeholder methods, to be overriden by extending plugin
1182	_mouseStart: function(event) {},
1183	_mouseDrag: function(event) {},
1184	_mouseStop: function(event) {},
1185	_mouseCapture: function(event) { return true; }
1186};
1187
1188$.ui.mouse.defaults = {
1189	cancel: null,
1190	distance: 1,
1191	delay: 0
1192};
1193
1194})(jQuery);
1195/*
1196 * jQuery UI Draggable 1.7.3
1197 *
1198 * Copyright (c) 2009 AUTHORS.txt (https://jqueryui.com/about)
1199 * Dual licensed under the MIT (MIT-LICENSE.txt)
1200 * and GPL (GPL-LICENSE.txt) licenses.
1201 *
1202 * https://docs.jquery.com/UI/Draggables
1203 *
1204 * Depends:
1205 *	ui.core.js
1206 */
1207(function($) {
1208
1209$.widget("ui.draggable", $.extend({}, $.ui.mouse, {
1210
1211	_init: function() {
1212
1213		if (this.options.helper == 'original' && !(/^(?:r|a|f)/).test(this.element.css("position")))
1214			this.element[0].style.position = 'relative';
1215
1216		(this.options.addClasses && this.element.addClass("ui-draggable"));
1217		(this.options.disabled && this.element.addClass("ui-draggable-disabled"));
1218
1219		this._mouseInit();
1220
1221	},
1222
1223	destroy: function() {
1224		if(!this.element.data('draggable')) return;
1225		this.element
1226			.removeData("draggable")
1227			.unbind(".draggable")
1228			.removeClass("ui-draggable"
1229				+ " ui-draggable-dragging"
1230				+ " ui-draggable-disabled");
1231		this._mouseDestroy();
1232	},
1233
1234	_mouseCapture: function(event) {
1235
1236		var o = this.options;
1237
1238		if (this.helper || o.disabled || $(event.target).is('.ui-resizable-handle'))
1239			return false;
1240
1241		//Quit if we're not on a valid handle
1242		this.handle = this._getHandle(event);
1243		if (!this.handle)
1244			return false;
1245
1246		return true;
1247
1248	},
1249
1250	_mouseStart: function(event) {
1251
1252		var o = this.options;
1253
1254		//Create and append the visible helper
1255		this.helper = this._createHelper(event);
1256
1257		//Cache the helper size
1258		this._cacheHelperProportions();
1259
1260		//If ddmanager is used for droppables, set the global draggable
1261		if($.ui.ddmanager)
1262			$.ui.ddmanager.current = this;
1263
1264		/*
1265		 * - Position generation -
1266		 * This block generates everything position related - it's the core of draggables.
1267		 */
1268
1269		//Cache the margins of the original element
1270		this._cacheMargins();
1271
1272		//Store the helper's css position
1273		this.cssPosition = this.helper.css("position");
1274		this.scrollParent = this.helper.scrollParent();
1275
1276		//The element's absolute position on the page minus margins
1277		this.offset = this.element.offset();
1278		this.offset = {
1279			top: this.offset.top - this.margins.top,
1280			left: this.offset.left - this.margins.left
1281		};
1282
1283		$.extend(this.offset, {
1284			click: { //Where the click happened, relative to the element
1285				left: event.pageX - this.offset.left,
1286				top: event.pageY - this.offset.top
1287			},
1288			parent: this._getParentOffset(),
1289			relative: this._getRelativeOffset() //This is a relative to absolute position minus the actual position calculation - only used for relative positioned helper
1290		});
1291
1292		//Generate the original position
1293		this.originalPosition = this._generatePosition(event);
1294		this.originalPageX = event.pageX;
1295		this.originalPageY = event.pageY;
1296
1297		//Adjust the mouse offset relative to the helper if 'cursorAt' is supplied
1298		if(o.cursorAt)
1299			this._adjustOffsetFromHelper(o.cursorAt);
1300
1301		//Set a containment if given in the options
1302		if(o.containment)
1303			this._setContainment();
1304
1305		//Call plugins and callbacks
1306		this._trigger("start", event);
1307
1308		//Recache the helper size
1309		this._cacheHelperProportions();
1310
1311		//Prepare the droppable offsets
1312		if ($.ui.ddmanager && !o.dropBehaviour)
1313			$.ui.ddmanager.prepareOffsets(this, event);
1314
1315		this.helper.addClass("ui-draggable-dragging");
1316		this._mouseDrag(event, true); //Execute the drag once - this causes the helper not to be visible before getting its correct position
1317		return true;
1318	},
1319
1320	_mouseDrag: function(event, noPropagation) {
1321
1322		//Compute the helpers position
1323		this.position = this._generatePosition(event);
1324		this.positionAbs = this._convertPositionTo("absolute");
1325
1326		//Call plugins and callbacks and use the resulting position if something is returned
1327		if (!noPropagation) {
1328			var ui = this._uiHash();
1329			this._trigger('drag', event, ui);
1330			this.position = ui.position;
1331		}
1332
1333		if(!this.options.axis || this.options.axis != "y") this.helper[0].style.left = this.position.left+'px';
1334		if(!this.options.axis || this.options.axis != "x") this.helper[0].style.top = this.position.top+'px';
1335		if($.ui.ddmanager) $.ui.ddmanager.drag(this, event);
1336
1337		return false;
1338	},
1339
1340	_mouseStop: function(event) {
1341
1342		//If we are using droppables, inform the manager about the drop
1343		var dropped = false;
1344		if ($.ui.ddmanager && !this.options.dropBehaviour)
1345			dropped = $.ui.ddmanager.drop(this, event);
1346
1347		//if a drop comes from outside (a sortable)
1348		if(this.dropped) {
1349			dropped = this.dropped;
1350			this.dropped = false;
1351		}
1352
1353		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))) {
1354			var self = this;
1355			$(this.helper).animate(this.originalPosition, parseInt(this.options.revertDuration, 10), function() {
1356				self._trigger("stop", event);
1357				self._clear();
1358			});
1359		} else {
1360			this._trigger("stop", event);
1361			this._clear();
1362		}
1363
1364		return false;
1365	},
1366
1367	_getHandle: function(event) {
1368
1369		var handle = !this.options.handle || !$(this.options.handle, this.element).length ? true : false;
1370		$(this.options.handle, this.element)
1371			.find("*")
1372			.andSelf()
1373			.each(function() {
1374				if(this == event.target) handle = true;
1375			});
1376
1377		return handle;
1378
1379	},
1380
1381	_createHelper: function(event) {
1382
1383		var o = this.options;
1384		var helper = $.isFunction(o.helper) ? $(o.helper.apply(this.element[0], [event])) : (o.helper == 'clone' ? this.element.clone() : this.element);
1385
1386		if(!helper.parents('body').length)
1387			helper.appendTo((o.appendTo == 'parent' ? this.element[0].parentNode : o.appendTo));
1388
1389		if(helper[0] != this.element[0] && !(/(fixed|absolute)/).test(helper.css("position")))
1390			helper.css("position", "absolute");
1391
1392		return helper;
1393
1394	},
1395
1396	_adjustOffsetFromHelper: function(obj) {
1397		if(obj.left != undefined) this.offset.click.left = obj.left + this.margins.left;
1398		if(obj.right != undefined) this.offset.click.left = this.helperProportions.width - obj.right + this.margins.left;
1399		if(obj.top != undefined) this.offset.click.top = obj.top + this.margins.top;
1400		if(obj.bottom != undefined) this.offset.click.top = this.helperProportions.height - obj.bottom + this.margins.top;
1401	},
1402
1403	_getParentOffset: function() {
1404
1405		//Get the offsetParent and cache its position
1406		this.offsetParent = this.helper.offsetParent();
1407		var po = this.offsetParent.offset();
1408
1409		// This is a special case where we need to modify a offset calculated on start, since the following happened:
1410		// 1. The position of the helper is absolute, so it's position is calculated based on the next positioned parent
1411		// 2. The actual offset parent is a child of the scroll parent, and the scroll parent isn't the document, which means that
1412		//    the scroll is included in the initial calculation of the offset of the parent, and never recalculated upon drag
1413		if(this.cssPosition == 'absolute' && this.scrollParent[0] != document && $.ui.contains(this.scrollParent[0], this.offsetParent[0])) {
1414			po.left += this.scrollParent.scrollLeft();
1415			po.top += this.scrollParent.scrollTop();
1416		}
1417
1418		if((this.offsetParent[0] == document.body) //This needs to be actually done for all browsers, since pageX/pageY includes this information
1419		|| (this.offsetParent[0].tagName && this.offsetParent[0].tagName.toLowerCase() == 'html' && $.browser.msie)) //Ugly IE fix
1420			po = { top: 0, left: 0 };
1421
1422		return {
1423			top: po.top + (parseInt(this.offsetParent.css("borderTopWidth"),10) || 0),
1424			left: po.left + (parseInt(this.offsetParent.css("borderLeftWidth"),10) || 0)
1425		};
1426
1427	},
1428
1429	_getRelativeOffset: function() {
1430
1431		if(this.cssPosition == "relative") {
1432			var p = this.element.position();
1433			return {
1434				top: p.top - (parseInt(this.helper.css("top"),10) || 0) + this.scrollParent.scrollTop(),
1435				left: p.left - (parseInt(this.helper.css("left"),10) || 0) + this.scrollParent.scrollLeft()
1436			};
1437		} else {
1438			return { top: 0, left: 0 };
1439		}
1440
1441	},
1442
1443	_cacheMargins: function() {
1444		this.margins = {
1445			left: (parseInt(this.element.css("marginLeft"),10) || 0),
1446			top: (parseInt(this.element.css("marginTop"),10) || 0)
1447		};
1448	},
1449
1450	_cacheHelperProportions: function() {
1451		this.helperProportions = {
1452			width: this.helper.outerWidth(),
1453			height: this.helper.outerHeight()
1454		};
1455	},
1456
1457	_setContainment: function() {
1458
1459		var o = this.options;
1460		if(o.containment == 'parent') o.containment = this.helper[0].parentNode;
1461		if(o.containment == 'document' || o.containment == 'window') this.containment = [
1462			0 - this.offset.relative.left - this.offset.parent.left,
1463			0 - this.offset.relative.top - this.offset.parent.top,
1464			$(o.containment == 'document' ? document : window).width() - this.helperProportions.width - this.margins.left,
1465			($(o.containment == 'document' ? document : window).height() || document.body.parentNode.scrollHeight) - this.helperProportions.height - this.margins.top
1466		];
1467
1468		if(!(/^(document|window|parent)$/).test(o.containment) && o.containment.constructor != Array) {
1469			var ce = $(o.containment)[0]; if(!ce) return;
1470			var co = $(o.containment).offset();
1471			var over = ($(ce).css("overflow") != 'hidden');
1472
1473			this.containment = [
1474				co.left + (parseInt($(ce).css("borderLeftWidth"),10) || 0) + (parseInt($(ce).css("paddingLeft"),10) || 0) - this.margins.left,
1475				co.top + (parseInt($(ce).css("borderTopWidth"),10) || 0) + (parseInt($(ce).css("paddingTop"),10) || 0) - this.margins.top,
1476				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,
1477				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
1478			];
1479		} else if(o.containment.constructor == Array) {
1480			this.containment = o.containment;
1481		}
1482
1483	},
1484
1485	_convertPositionTo: function(d, pos) {
1486
1487		if(!pos) pos = this.position;
1488		var mod = d == "absolute" ? 1 : -1;
1489		var o = this.options, scroll = this.cssPosition == 'absolute' && !(this.scrollParent[0] != document && $.ui.contains(this.scrollParent[0], this.offsetParent[0])) ? this.offsetParent : this.scrollParent, scrollIsRootNode = (/(html|body)/i).test(scroll[0].tagName);
1490
1491		return {
1492			top: (
1493				pos.top																	// The absolute mouse position
1494				+ this.offset.relative.top * mod										// Only for relative positioned nodes: Relative offset from element to offset parent
1495				+ this.offset.parent.top * mod											// The offsetParent's offset without borders (offset + border)
1496				- ($.browser.safari && this.cssPosition == 'fixed' ? 0 : ( this.cssPosition == 'fixed' ? -this.scrollParent.scrollTop() : ( scrollIsRootNode ? 0 : scroll.scrollTop() ) ) * mod)
1497			),
1498			left: (
1499				pos.left																// The absolute mouse position
1500				+ this.offset.relative.left * mod										// Only for relative positioned nodes: Relative offset from element to offset parent
1501				+ this.offset.parent.left * mod											// The offsetParent's offset without borders (offset + border)
1502				- ($.browser.safari && this.cssPosition == 'fixed' ? 0 : ( this.cssPosition == 'fixed' ? -this.scrollParent.scrollLeft() : scrollIsRootNode ? 0 : scroll.scrollLeft() ) * mod)
1503			)
1504		};
1505
1506	},
1507
1508	_generatePosition: function(event) {
1509
1510		var o = this.options, scroll = this.cssPosition == 'absolute' && !(this.scrollParent[0] != document && $.ui.contains(this.scrollParent[0], this.offsetParent[0])) ? this.offsetParent : this.scrollParent, scrollIsRootNode = (/(html|body)/i).test(scroll[0].tagName);
1511
1512		// This is another very weird special case that only happens for relative elements:
1513		// 1. If the css position is relative
1514		// 2. and the scroll parent is the document or similar to the offset parent
1515		// we have to refresh the relative offset during the scroll so there are no jumps
1516		if(this.cssPosition == 'relative' && !(this.scrollParent[0] != document && this.scrollParent[0] != this.offsetParent[0])) {
1517			this.offset.relative = this._getRelativeOffset();
1518		}
1519
1520		var pageX = event.pageX;
1521		var pageY = event.pageY;
1522
1523		/*
1524		 * - Position constraining -
1525		 * Constrain the position to a mix of grid, containment.
1526		 */
1527
1528		if(this.originalPosition) { //If we are not dragging yet, we won't check for options
1529
1530			if(this.containment) {
1531				if(event.pageX - this.offset.click.left < this.containment[0]) pageX = this.containment[0] + this.offset.click.left;
1532				if(event.pageY - this.offset.click.top < this.containment[1]) pageY = this.containment[1] + this.offset.click.top;
1533				if(event.pageX - this.offset.click.left > this.containment[2]) pageX = this.containment[2] + this.offset.click.left;
1534				if(event.pageY - this.offset.click.top > this.containment[3]) pageY = this.containment[3] + this.offset.click.top;
1535			}
1536
1537			if(o.grid) {
1538				var top = this.originalPageY + Math.round((pageY - this.originalPageY) / o.grid[1]) * o.grid[1];
1539				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;
1540
1541				var left = this.originalPageX + Math.round((pageX - this.originalPageX) / o.grid[0]) * o.grid[0];
1542				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;
1543			}
1544
1545		}
1546
1547		return {
1548			top: (
1549				pageY																// The absolute mouse position
1550				- this.offset.click.top													// Click offset (relative to the element)
1551				- this.offset.relative.top												// Only for relative positioned nodes: Relative offset from element to offset parent
1552				- this.offset.parent.top												// The offsetParent's offset without borders (offset + border)
1553				+ ($.browser.safari && this.cssPosition == 'fixed' ? 0 : ( this.cssPosition == 'fixed' ? -this.scrollParent.scrollTop() : ( scrollIsRootNode ? 0 : scroll.scrollTop() ) ))
1554			),
1555			left: (
1556				pageX																// The absolute mouse position
1557				- this.offset.click.left												// Click offset (relative to the element)
1558				- this.offset.relative.left												// Only for relative positioned nodes: Relative offset from element to offset parent
1559				- this.offset.parent.left												// The offsetParent's offset without borders (offset + border)
1560				+ ($.browser.safari && this.cssPosition == 'fixed' ? 0 : ( this.cssPosition == 'fixed' ? -this.scrollParent.scrollLeft() : scrollIsRootNode ? 0 : scroll.scrollLeft() ))
1561			)
1562		};
1563
1564	},
1565
1566	_clear: function() {
1567		this.helper.removeClass("ui-draggable-dragging");
1568		if(this.helper[0] != this.element[0] && !this.cancelHelperRemoval) this.helper.remove();
1569		//if($.ui.ddmanager) $.ui.ddmanager.current = null;
1570		this.helper = null;
1571		this.cancelHelperRemoval = false;
1572	},
1573
1574	// From now on bulk stuff - mainly helpers
1575
1576	_trigger: function(type, event, ui) {
1577		ui = ui || this._uiHash();
1578		$.ui.plugin.call(this, type, [event, ui]);
1579		if(type == "drag") this.positionAbs = this._convertPositionTo("absolute"); //The absolute position has to be recalculated after plugins
1580		return $.widget.prototype._trigger.call(this, type, event, ui);
1581	},
1582
1583	plugins: {},
1584
1585	_uiHash: function(event) {
1586		return {
1587			helper: this.helper,
1588			position: this.position,
1589			absolutePosition: this.positionAbs, //deprecated
1590			offset: this.positionAbs
1591		};
1592	}
1593
1594}));
1595
1596$.extend($.ui.draggable, {
1597	version: "1.7.3",
1598	eventPrefix: "drag",
1599	defaults: {
1600		addClasses: true,
1601		appendTo: "parent",
1602		axis: false,
1603		cancel: ":input,option",
1604		connectToSortable: false,
1605		containment: false,
1606		cursor: "auto",
1607		cursorAt: false,
1608		delay: 0,
1609		distance: 1,
1610		grid: false,
1611		handle: false,
1612		helper: "original",
1613		iframeFix: false,
1614		opacity: false,
1615		refreshPositions: false,
1616		revert: false,
1617		revertDuration: 500,
1618		scope: "default",
1619		scroll: true,
1620		scrollSensitivity: 20,
1621		scrollSpeed: 20,
1622		snap: false,
1623		snapMode: "both",
1624		snapTolerance: 20,
1625		stack: false,
1626		zIndex: false
1627	}
1628});
1629
1630$.ui.plugin.add("draggable", "connectToSortable", {
1631	start: function(event, ui) {
1632
1633		var inst = $(this).data("draggable"), o = inst.options,
1634			uiSortable = $.extend({}, ui, { item: inst.element });
1635		inst.sortables = [];
1636		$(o.connectToSortable).each(function() {
1637			var sortable = $.data(this, 'sortable');
1638			if (sortable && !sortable.options.disabled) {
1639				inst.sortables.push({
1640					instance: sortable,
1641					shouldRevert: sortable.options.revert
1642				});
1643				sortable._refreshItems();	//Do a one-time refresh at start to refresh the containerCache
1644				sortable._trigger("activate", event, uiSortable);
1645			}
1646		});
1647
1648	},
1649	stop: function(event, ui) {
1650
1651		//If we are still over the sortable, we fake the stop event of the sortable, but also remove helper
1652		var inst = $(this).data("draggable"),
1653			uiSortable = $.extend({}, ui, { item: inst.element });
1654
1655		$.each(inst.sortables, function() {
1656			if(this.instance.isOver) {
1657
1658				this.instance.isOver = 0;
1659
1660				inst.cancelHelperRemoval = true; //Don't remove the helper in the draggable instance
1661				this.instance.cancelHelperRemoval = false; //Remove it in the sortable instance (so sortable plugins like revert still work)
1662
1663				//The sortable revert is supported, and we have to set a temporary dropped variable on the draggable to support revert: 'valid/invalid'
1664				if(this.shouldRevert) this.instance.options.revert = true;
1665
1666				//Trigger the stop of the sortable
1667				this.instance._mouseStop(event);
1668
1669				this.instance.options.helper = this.instance.options._helper;
1670
1671				//If the helper has been the original item, restore properties in the sortable
1672				if(inst.options.helper == 'original')
1673					this.instance.currentItem.css({ top: 'auto', left: 'auto' });
1674
1675			} else {
1676				this.instance.cancelHelperRemoval = false; //Remove the helper in the sortable instance
1677				this.instance._trigger("deactivate", event, uiSortable);
1678			}
1679
1680		});
1681
1682	},
1683	drag: function(event, ui) {
1684
1685		var inst = $(this).data("draggable"), self = this;
1686
1687		var checkPos = function(o) {
1688			var dyClick = this.offset.click.top, dxClick = this.offset.click.left;
1689			var helperTop = this.positionAbs.top, helperLeft = this.positionAbs.left;
1690			var itemHeight = o.height, itemWidth = o.width;
1691			var itemTop = o.top, itemLeft = o.left;
1692
1693			return $.ui.isOver(helperTop + dyClick, helperLeft + dxClick, itemTop, itemLeft, itemHeight, itemWidth);
1694		};
1695
1696		$.each(inst.sortables, function(i) {
1697			
1698			//Copy over some variables to allow calling the sortable's native _intersectsWith
1699			this.instance.positionAbs = inst.positionAbs;
1700			this.instance.helperProportions = inst.helperProportions;
1701			this.instance.offset.click = inst.offset.click;
1702			
1703			if(this.instance._intersectsWith(this.instance.containerCache)) {
1704
1705				//If it intersects, we use a little isOver variable and set it once, so our move-in stuff gets fired only once
1706				if(!this.instance.isOver) {
1707
1708					this.instance.isOver = 1;
1709					//Now we fake the start of dragging for the sortable instance,
1710					//by cloning the list group item, appending it to the sortable and using it as inst.currentItem
1711					//We can then fire the start event of the sortable with our passed browser event, and our own helper (so it doesn't create a new one)
1712					this.instance.currentItem = $(self).clone().appendTo(this.instance.element).data("sortable-item", true);
1713					this.instance.options._helper = this.instance.options.helper; //Store helper option to later restore it
1714					this.instance.options.helper = function() { return ui.helper[0]; };
1715
1716					event.target = this.instance.currentItem[0];
1717					this.instance._mouseCapture(event, true);
1718					this.instance._mouseStart(event, true, true);
1719
1720					//Because the browser event is way off the new appended portlet, we modify a couple of variables to reflect the changes
1721					this.instance.offset.click.top = inst.offset.click.top;
1722					this.instance.offset.click.left = inst.offset.click.left;
1723					this.instance.offset.parent.left -= inst.offset.parent.left - this.instance.offset.parent.left;
1724					this.instance.offset.parent.top -= inst.offset.parent.top - this.instance.offset.parent.top;
1725
1726					inst._trigger("toSortable", event);
1727					inst.dropped = this.instance.element; //draggable revert needs that
1728					//hack so receive/update callbacks work (mostly)
1729					inst.currentItem = inst.element;
1730					this.instance.fromOutside = inst;
1731
1732				}
1733
1734				//Provided we did all the previous steps, we can fire the drag event of the sortable on every draggable drag, when it intersects with the sortable
1735				if(this.instance.currentItem) this.instance._mouseDrag(event);
1736
1737			} else {
1738
1739				//If it doesn't intersect with the sortable, and it intersected before,
1740				//we fake the drag stop of the sortable, but make sure it doesn't remove the helper by using cancelHelperRemoval
1741				if(this.instance.isOver) {
1742
1743					this.instance.isOver = 0;
1744					this.instance.cancelHelperRemoval = true;
1745					
1746					//Prevent reverting on this forced stop
1747					this.instance.options.revert = false;
1748					
1749					// The out event needs to be triggered independently
1750					this.instance._trigger('out', event, this.instance._uiHash(this.instance));
1751					
1752					this.instance._mouseStop(event, true);
1753					this.instance.options.helper = this.instance.options._helper;
1754
1755					//Now we remove our currentItem, the list group clone again, and the placeholder, and animate the helper back to it's original size
1756					this.instance.currentItem.remove();
1757					if(this.instance.placeholder) this.instance.placeholder.remove();
1758
1759					inst._trigger("fromSortable", event);
1760					inst.dropped = false; //draggable revert needs that
1761				}
1762
1763			};
1764
1765		});
1766
1767	}
1768});
1769
1770$.ui.plugin.add("draggable", "cursor", {
1771	start: function(event, ui) {
1772		var t = $('body'), o = $(this).data('draggable').options;
1773		if (t.css("cursor")) o._cursor = t.css("cursor");
1774		t.css("cursor", o.cursor);
1775	},
1776	stop: function(event, ui) {
1777		var o = $(this).data('draggable').options;
1778		if (o._cursor) $('body').css("cursor", o._cursor);
1779	}
1780});
1781
1782$.ui.plugin.add("draggable", "iframeFix", {
1783	start: function(event, ui) {
1784		var o = $(this).data('draggable').options;
1785		$(o.iframeFix === true ? "iframe" : o.iframeFix).each(function() {
1786			$('<div class="ui-draggable-iframeFix" style="background: #fff;"></div>')
1787			.css({
1788				width: this.offsetWidth+"px", height: this.offsetHeight+"px",
1789				position: "absolute", opacity: "0.001", zIndex: 1000
1790			})
1791			.css($(this).offset())
1792			.appendTo("body");
1793		});
1794	},
1795	stop: function(event, ui) {
1796		$("div.ui-draggable-iframeFix").each(function() { this.parentNode.removeChild(this); }); //Remove frame helpers
1797	}
1798});
1799
1800$.ui.plugin.add("draggable", "opacity", {
1801	start: function(event, ui) {
1802		var t = $(ui.helper), o = $(this).data('draggable').options;
1803		if(t.css("opacity")) o._opacity = t.css("opacity");
1804		t.css('opacity', o.opacity);
1805	},
1806	stop: function(event, ui) {
1807		var o = $(this).data('draggable').options;
1808		if(o._opacity) $(ui.helper).css('opacity', o._opacity);
1809	}
1810});
1811
1812$.ui.plugin.add("draggable", "scroll", {
1813	start: function(event, ui) {
1814		var i = $(this).data("draggable");
1815		if(i.scrollParent[0] != document && i.scrollParent[0].tagName != 'HTML') i.overflowOffset = i.scrollParent.offset();
1816	},
1817	drag: function(event, ui) {
1818
1819		var i = $(this).data("draggable"), o = i.options, scrolled = false;
1820
1821		if(i.scrollParent[0] != document && i.scrollParent[0].tagName != 'HTML') {
1822
1823			if(!o.axis || o.axis != 'x') {
1824				if((i.overflowOffset.top + i.scrollParent[0].offsetHeight) - event.pageY < o.scrollSensitivity)
1825					i.scrollParent[0].scrollTop = scrolled = i.scrollParent[0].scrollTop + o.scrollSpeed;
1826				else if(event.pageY - i.overflowOffset.top < o.scrollSensitivity)
1827					i.scrollParent[0].scrollTop = scrolled = i.scrollParent[0].scrollTop - o.scrollSpeed;
1828			}
1829
1830			if(!o.axis || o.axis != 'y') {
1831				if((i.overflowOffset.left + i.scrollParent[0].offsetWidth) - event.pageX < o.scrollSensitivity)
1832					i.scrollParent[0].scrollLeft = scrolled = i.scrollParent[0].scrollLeft + o.scrollSpeed;
1833				else if(event.pageX - i.overflowOffset.left < o.scrollSensitivity)
1834					i.scrollParent[0].scrollLeft = scrolled = i.scrollParent[0].scrollLeft - o.scrollSpeed;
1835			}
1836
1837		} else {
1838
1839			if(!o.axis || o.axis != 'x') {
1840				if(event.pageY - $(document).scrollTop() < o.scrollSensitivity)
1841					scrolled = $(document).scrollTop($(document).scrollTop() - o.scrollSpeed);
1842				else if($(window).height() - (event.pageY - $(document).scrollTop()) < o.scrollSensitivity)
1843					scrolled = $(document).scrollTop($(document).scrollTop() + o.scrollSpeed);
1844			}
1845
1846			if(!o.axis || o.axis != 'y') {
1847				if(event.pageX - $(document).scrollLeft() < o.scrollSensitivity)
1848					scrolled = $(document).scrollLeft($(document).scrollLeft() - o.scrollSpeed);
1849				else if($(window).width() - (event.pageX - $(document).scrollLeft()) < o.scrollSensitivity)
1850					scrolled = $(document).scrollLeft($(document).scrollLeft() + o.scrollSpeed);
1851			}
1852
1853		}
1854
1855		if(scrolled !== false && $.ui.ddmanager && !o.dropBehaviour)
1856			$.ui.ddmanager.prepareOffsets(i, event);
1857
1858	}
1859});
1860
1861$.ui.plugin.add("draggable", "snap", {
1862	start: function(event, ui) {
1863
1864		var i = $(this).data("draggable"), o = i.options;
1865		i.snapElements = [];
1866
1867		$(o.snap.constructor != String ? ( o.snap.items || ':data(draggable)' ) : o.snap).each(function() {
1868			var $t = $(this); var $o = $t.offset();
1869			if(this != i.element[0]) i.snapElements.push({
1870				item: this,
1871				width: $t.outerWidth(), height: $t.outerHeight(),
1872				top: $o.top, left: $o.left
1873			});
1874		});
1875
1876	},
1877	drag: function(event, ui) {
1878
1879		var inst = $(this).data("draggable"), o = inst.options;
1880		var d = o.snapTolerance;
1881
1882		var x1 = ui.offset.left, x2 = x1 + inst.helperProportions.width,
1883			y1 = ui.offset.top, y2 = y1 + inst.helperProportions.height;
1884
1885		for (var i = inst.snapElements.length - 1; i >= 0; i--){
1886
1887			var l = inst.snapElements[i].left, r = l + inst.snapElements[i].width,
1888				t = inst.snapElements[i].top, b = t + inst.snapElements[i].height;
1889
1890			//Yes, I know, this is insane ;)
1891			if(!((l-d < x1 && x1 < r+d && t-d < y1 && y1 < b+d) || (l-d < x1 && x1 < r+d && t-d < y2 && y2 < b+d) || (l-d < x2 && x2 < r+d && t-d < y1 && y1 < b+d) || (l-d < x2 && x2 < r+d && t-d < y2 && y2 < b+d))) {
1892				if(inst.snapElements[i].snapping) (inst.options.snap.release && inst.options.snap.release.call(inst.element, event, $.extend(inst._uiHash(), { snapItem: inst.snapElements[i].item })));
1893				inst.snapElements[i].snapping = false;
1894				continue;
1895			}
1896
1897			if(o.snapMode != 'inner') {
1898				var ts = Math.abs(t - y2) <= d;
1899				var bs = Math.abs(b - y1) <= d;
1900				var ls = Math.abs(l - x2) <= d;
1901				var rs = Math.abs(r - x1) <= d;
1902				if(ts) ui.position.top = inst._convertPositionTo("relative", { top: t - inst.helperProportions.height, left: 0 }).top - inst.margins.top;
1903				if(bs) ui.position.top = inst._convertPositionTo("relative", { top: b, left: 0 }).top - inst.margins.top;
1904				if(ls) ui.position.left = inst._convertPositionTo("relative", { top: 0, left: l - inst.helperProportions.width }).left - inst.margins.left;
1905				if(rs) ui.position.left = inst._convertPositionTo("relative", { top: 0, left: r }).left - inst.margins.left;
1906			}
1907
1908			var first = (ts || bs || ls || rs);
1909
1910			if(o.snapMode != 'outer') {
1911				var ts = Math.abs(t - y1) <= d;
1912				var bs = Math.abs(b - y2) <= d;
1913				var ls = Math.abs(l - x1) <= d;
1914				var rs = Math.abs(r - x2) <= d;
1915				if(ts) ui.position.top = inst._convertPositionTo("relative", { top: t, left: 0 }).top - inst.margins.top;
1916				if(bs) ui.position.top = inst._convertPositionTo("relative", { top: b - inst.helperProportions.height, left: 0 }).top - inst.margins.top;
1917				if(ls) ui.position.left = inst._convertPositionTo("relative", { top: 0, left: l }).left - inst.margins.left;
1918				if(rs) ui.position.left = inst._convertPositionTo("relative", { top: 0, left: r - inst.helperProportions.width }).left - inst.margins.left;
1919			}
1920
1921			if(!inst.snapElements[i].snapping && (ts || bs || ls || rs || first))
1922				(inst.options.snap.snap && inst.options.snap.snap.call(inst.element, event, $.extend(inst._uiHash(), { snapItem: inst.snapElements[i].item })));
1923			inst.snapElements[i].snapping = (ts || bs || ls || rs || first);
1924
1925		};
1926
1927	}
1928});
1929
1930$.ui.plugin.add("draggable", "stack", {
1931	start: function(event, ui) {
1932
1933		var o = $(this).data("draggable").options;
1934
1935		var group = $.makeArray($(o.stack.group)).sort(function(a,b) {
1936			return (parseInt($(a).css("zIndex"),10) || o.stack.min) - (parseInt($(b).css("zIndex"),10) || o.stack.min);
1937		});
1938
1939		$(group).each(function(i) {
1940			this.style.zIndex = o.stack.min + i;
1941		});
1942
1943		this[0].style.zIndex = o.stack.min + group.length;
1944
1945	}
1946});
1947
1948$.ui.plugin.add("draggable", "zIndex", {
1949	start: function(event, ui) {
1950		var t = $(ui.helper), o = $(this).data("draggable").options;
1951		if(t.css("zIndex")) o._zIndex = t.css("zIndex");
1952		t.css('zIndex', o.zIndex);
1953	},
1954	stop: function(event, ui) {
1955		var o = $(this).data("draggable").options;
1956		if(o._zIndex) $(ui.helper).css('zIndex', o._zIndex);
1957	}
1958});
1959
1960})(jQuery);
1961/*
1962 * jQuery UI Droppable 1.7.3
1963 *
1964 * Copyright (c) 2009 AUTHORS.txt (https://jqueryui.com/about)
1965 * Dual licensed under the MIT (MIT-LICENSE.txt)
1966 * and GPL (GPL-LICENSE.txt) licenses.
1967 *
1968 * https://docs.jquery.com/UI/Droppables
1969 *
1970 * Depends:
1971 *	ui.core.js
1972 *	ui.draggable.js
1973 */
1974(function($) {
1975
1976$.widget("ui.droppable", {
1977
1978	_init: function() {
1979
1980		var o = this.options, accept = o.accept;
1981		this.isover = 0; this.isout = 1;
1982
1983		this.options.accept = this.options.accept && $.isFunction(this.options.accept) ? this.options.accept : function(d) {
1984			return d.is(accept);
1985		};
1986
1987		//Store the droppable's proportions
1988		this.proportions = { width: this.element[0].offsetWidth, height: this.element[0].offsetHeight };
1989
1990		// Add the reference and positions to the manager
1991		$.ui.ddmanager.droppables[this.options.scope] = $.ui.ddmanager.droppables[this.options.scope] || [];
1992		$.ui.ddmanager.droppables[this.options.scope].push(this);
1993
1994		(this.options.addClasses && this.element.addClass("ui-droppable"));
1995
1996	},
1997
1998	destroy: function() {
1999		var drop = $.ui.ddmanager.droppables[this.options.scope];
2000		for ( var i = 0; i < drop.length; i++ )
2001			if ( drop[i] == this )
2002				drop.splice(i, 1);
2003
2004		this.element
2005			.removeClass("ui-droppable ui-droppable-disabled")
2006			.removeData("droppable")
2007			.unbind(".droppable");
2008	},
2009
2010	_setData: function(key, value) {
2011
2012		if(key == 'accept') {
2013			this.options.accept = value && $.isFunction(value) ? value : function(d) {
2014				return d.is(value);
2015			};
2016		} else {
2017			$.widget.prototype._setData.apply(this, arguments);
2018		}
2019
2020	},
2021
2022	_activate: function(event) {
2023		var draggable = $.ui.ddmanager.current;
2024		if(this.options.activeClass) this.element.addClass(this.options.activeClass);
2025		(draggable && this._trigger('activate', event, this.ui(draggable)));
2026	},
2027
2028	_deactivate: function(event) {
2029		var draggable = $.ui.ddmanager.current;
2030		if(this.options.activeClass) this.element.removeClass(this.options.activeClass);
2031		(draggable && this._trigger('deactivate', event, this.ui(draggable)));
2032	},
2033
2034	_over: function(event) {
2035
2036		var draggable = $.ui.ddmanager.current;
2037		if (!draggable || (draggable.currentItem || draggable.element)[0] == this.element[0]) return; // Bail if draggable and droppable are same element
2038
2039		if (this.options.accept.call(this.element[0],(draggable.currentItem || draggable.element))) {
2040			if(this.options.hoverClass) this.element.addClass(this.options.hoverClass);
2041			this._trigger('over', event, this.ui(draggable));
2042		}
2043
2044	},
2045
2046	_out: function(event) {
2047
2048		var draggable = $.ui.ddmanager.current;
2049		if (!draggable || (draggable.currentItem || draggable.element)[0] == this.element[0]) return; // Bail if draggable and droppable are same element
2050
2051		if (this.options.accept.call(this.element[0],(draggable.currentItem || draggable.element))) {
2052			if(this.options.hoverClass) this.element.removeClass(this.options.hoverClass);
2053			this._trigger('out', event, this.ui(draggable));
2054		}
2055
2056	},
2057
2058	_drop: function(event,custom
2058) {
2059
2060		var draggable = custom || $.ui.ddmanager.current;
2061		if (!draggable || (draggable.currentItem || draggable.element)[0] == this.element[0]) return false; // Bail if draggable and droppable are same element
2062
2063		var childrenIntersection = false;
2064		this.element.find(":data(droppable)").not(".ui-draggable-dragging").each(function() {
2065			var inst = $.data(this, 'droppable');
2066			if(inst.options.greedy && $.ui.intersect(draggable, $.extend(inst, { offset: inst.element.offset() }), inst.options.tolerance)) {
2067				childrenIntersection = true; return false;
2068			}
2069		});
2070		if(childrenIntersection) return false;
2071
2072		if(this.options.accept.call(this.element[0],(draggable.currentItem || draggable.element))) {
2073			if(this.options.activeClass) this.element.removeClass(this.options.activeClass);
2074			if(this.options.hoverClass) this.element.removeClass(this.options.hoverClass);
2075			this._trigger('drop', event, this.ui(draggable));
2076			return this.element;
2077		}
2078
2079		return false;
2080
2081	},
2082
2083	ui: function(c) {
2084		return {
2085			draggable: (c.currentItem || c.element),
2086			helper: c.helper,
2087			position: c.position,
2088			absolutePosition: c.positionAbs, //deprecated
2089			offset: c.positionAbs
2090		};
2091	}
2092
2093});
2094
2095$.extend($.ui.droppable, {
2096	version: "1.7.3",
2097	eventPrefix: 'drop',
2098	defaults: {
2099		accept: '*',
2100		activeClass: false,
2101		addClasses: true,
2102		greedy: false,
2103		hoverClass: false,
2104		scope: 'default',
2105		tolerance: 'intersect'
2106	}
2107});
2108
2109$.ui.intersect = function(draggable, droppable, toleranceMode) {
2110
2111	if (!droppable.offset) return false;
2112
2113	var x1 = (draggable.positionAbs || draggable.position.absolute).left, x2 = x1 + draggable.helperProportions.width,
2114		y1 = (draggable.positionAbs || draggable.position.absolute).top, y2 = y1 + draggable.helperProportions.height;
2115	var l = droppable.offset.left, r = l + droppable.proportions.width,
2116		t = droppable.offset.top, b = t + droppable.proportions.height;
2117
2118	switch (toleranceMode) {
2119		case 'fit':
2120			return (l < x1 && x2 < r
2121				&& t < y1 && y2 < b);
2122			break;
2123		case 'intersect':
2124			return (l < x1 + (draggable.helperProportions.width / 2) // Right Half
2125				&& x2 - (draggable.helperProportions.width / 2) < r // Left Half
2126				&& t < y1 + (draggable.helperProportions.height / 2) // Bottom Half
2127				&& y2 - (draggable.helperProportions.height / 2) < b ); // Top Half
2128			break;
2129		case 'pointer':
2130			var draggableLeft = ((draggable.positionAbs || draggable.position.absolute).left + (draggable.clickOffset || draggable.offset.click).left),
2131				draggableTop = ((draggable.positionAbs || draggable.position.absolute).top + (draggable.clickOffset || draggable.offset.click).top),
2132				isOver = $.ui.isOver(draggableTop, draggableLeft, t, l, droppable.proportions.height, droppable.proportions.width);
2133			return isOver;
2134			break;
2135		case 'touch':
2136			return (
2137					(y1 >= t && y1 <= b) ||	// Top edge touching
2138					(y2 >= t && y2 <= b) ||	// Bottom edge touching
2139					(y1 < t && y2 > b)		// Surrounded vertically
2140				) && (
2141					(x1 >= l && x1 <= r) ||	// Left edge touching
2142					(x2 >= l && x2 <= r) ||	// Right edge touching
2143					(x1 < l && x2 > r)		// Surrounded horizontally
2144				);
2145			break;
2146		default:
2147			return false;
2148			break;
2149		}
2150
2151};
2152
2153/*
2154	This manager tracks offsets of draggables and droppables
2155*/
2156$.ui.ddmanager = {
2157	current: null,
2158	droppables: { 'default': [] },
2159	prepareOffsets: function(t, event) {
2160
2161		var m = $.ui.ddmanager.droppables[t.options.scope];
2162		var type = event ? event.type : null; // workaround for #2317
2163		var list = (t.currentItem || t.element).find(":data(droppable)").andSelf();
2164
2165		droppablesLoop: for (var i = 0; i < m.length; i++) {
2166
2167			if(m[i].options.disabled || (t && !m[i].options.accept.call(m[i].element[0],(t.currentItem || t.element)))) continue;	//No disabled and non-accepted
2168			for (var j=0; j < list.length; j++) { if(list[j] == m[i].element[0]) { m[i].proportions.height = 0; continue droppablesLoop; } }; //Filter out elements in the current dragged item
2169			m[i].visible = m[i].element.css("display") != "none"; if(!m[i].visible) continue; 									//If the element is not visible, continue
2170
2171			m[i].offset = m[i].element.offset();
2172			m[i].proportions = { width: m[i].element[0].offsetWidth, height: m[i].element[0].offsetHeight };
2173
2174			if(type == "mousedown") m[i]._activate.call(m[i], event); //Activate the droppable if used directly from draggables
2175
2176		}
2177
2178	},
2179	drop: function(draggable, event) {
2180
2181		var dropped = false;
2182		$.each($.ui.ddmanager.droppables[draggable.options.scope], function() {
2183
2184			if(!this.options) return;
2185			if (!this.options.disabled && this.visible && $.ui.intersect(draggable, this, this.options.tolerance))
2186				dropped = this._drop.call(this, event);
2187
2188			if (!this.options.disabled && this.visible && this.options.accept.call(this.element[0],(draggable.currentItem || draggable.element))) {
2189				this.isout = 1; this.isover = 0;
2190				this._deactivate.call(this, event);
2191			}
2192
2193		});
2194		return dropped;
2195
2196	},
2197	drag: function(draggable, event) {
2198
2199		//If you have a highly dynamic page, you might try this option. It renders positions every time you move the mouse.
2200		if(draggable.options.refreshPositions) $.ui.ddmanager.prepareOffsets(draggable, event);
2201
2202		//Run through all droppables and check their positions based on specific tolerance options
2203
2204		$.each($.ui.ddmanager.droppables[draggable.options.scope], function() {
2205
2206			if(this.options.disabled || this.greedyChild || !this.visible) return;
2207			var intersects = $.ui.intersect(draggable, this, this.options.tolerance);
2208
2209			var c = !intersects && this.isover == 1 ? 'isout' : (intersects && this.isover == 0 ? 'isover' : null);
2210			if(!c) return;
2211
2212			var parentInstance;
2213			if (this.options.greedy) {
2214				var parent = this.element.parents(':data(droppable):eq(0)');
2215				if (parent.length) {
2216					parentInstance = $.data(parent[0], 'droppable');
2217					parentInstance.greedyChild = (c == 'isover' ? 1 : 0);
2218				}
2219			}
2220
2221			// we just moved into a greedy child
2222			if (parentInstance && c == 'isover') {
2223				parentInstance['isover'] = 0;
2224				parentInstance['isout'] = 1;
2225				parentInstance._out.call(parentInstance, event);
2226			}
2227
2228			this[c] = 1; this[c == 'isout' ? 'isover' : 'isout'] = 0;
2229			this[c == "isover" ? "_over" : "_out"].call(this, event);
2230
2231			// we just moved out of a greedy child
2232			if (parentInstance && c == 'isout') {
2233				parentInstance['isout'] = 0;
2234				parentInstance['isover'] = 1;
2235				parentInstance._over.call(parentInstance, event);
2236			}
2237		});
2238
2239	}
2240};
2241
2242})(jQuery);
2243/*
2244 * jQuery UI Resizable 1.7.3
2245 *
2246 * Copyright (c) 2009 AUTHORS.txt (https://jqueryui.com/about)
2247 * Dual licensed under the MIT (MIT-LICENSE.txt)
2248 * and GPL (GPL-LICENSE.txt) licenses.
2249 *
2250 * https://docs.jquery.com/UI/Resizables
2251 *
2252 * Depends:
2253 *	ui.core.js
2254 */
2255(function($) {
2256
2257$.widget("ui.resizable", $.extend({}, $.ui.mouse, {
2258
2259	_init: function() {
2260
2261		var self = this, o = this.options;
2262		this.element.addClass("ui-resizable");
2263
2264		$.extend(this, {
2265			_aspectRatio: !!(o.aspectRatio),
2266			aspectRatio: o.aspectRatio,
2267			originalElement: this.element,
2268			_proportionallyResizeElements: [],
2269			_helper: o.helper || o.ghost || o.animate ? o.helper || 'ui-resizable-helper' : null
2270		});
2271
2272		//Wrap the element if it cannot hold child nodes
2273		if(this.element[0].nodeName.match(/canvas|textarea|input|select|button|img/i)) {
2274
2275			//Opera fix for relative positioning
2276			if (/relative/.test(this.element.css('position')) && $.browser.opera)
2277				this.element.css({ position: 'relative', top: 'auto', left: 'auto' });
2278
2279			//Create a wrapper element and set the wrapper to the new current internal element
2280			this.element.wrap(
2281				$('<div class="ui-wrapper" style="overflow: hidden;"></div>').css({
2282					position: this.element.css('position'),
2283					width: this.element.outerWidth(),
2284					height: this.element.outerHeight(),
2285					top: this.element.css('top'),
2286					left: this.element.css('left')
2287				})
2288			);
2289
2290			//Overwrite the original this.element
2291			this.element = this.element.parent().data(
2292				"resizable", this.element.data('resizable')
2293			);
2294
2295			this.elementIsWrapper = true;
2296
2297			//Move margins to the wrapper
2298			this.element.css({ marginLeft: this.originalElement.css("marginLeft"), marginTop: this.originalElement.css("marginTop"), marginRight: this.originalElement.css("marginRight"), marginBottom: this.originalElement.css("marginBottom") });
2299			this.originalElement.css({ marginLeft: 0, marginTop: 0, marginRight: 0, marginBottom: 0});
2300
2301			//Prevent Safari textarea resize
2302			this.originalResizeStyle = this.originalElement.css('resize');
2303			this.originalElement.css('resize', 'none');
2304
2305			//Push the actual element to our proportionallyResize internal array
2306			this._proportionallyResizeElements.push(this.originalElement.css({ position: 'static', zoom: 1, display: 'block' }));
2307
2308			// avoid IE jump (hard set the margin)
2309			this.originalElement.css({ margin: this.originalElement.css('margin') });
2310
2311			// fix handlers offset
2312			this._proportionallyResize();
2313
2314		}
2315
2316		this.handles = o.handles || (!$('.ui-resizable-handle', this.element).length ? "e,s,se" : { n: '.ui-resizable-n', e: '.ui-resizable-e', s: '.ui-resizable-s', w: '.ui-resizable-w', se: '.ui-resizable-se', sw: '.ui-resizable-sw', ne: '.ui-resizable-ne', nw: '.ui-resizable-nw' });
2317		if(this.handles.constructor == String) {
2318
2319			if(this.handles == 'all') this.handles = 'n,e,s,w,se,sw,ne,nw';
2320			var n = this.handles.split(","); this.handles = {};
2321
2322			for(var i = 0; i < n.length; i++) {
2323
2324				var handle = $.trim(n[i]), hname = 'ui-resizable-'+handle;
2325				var axis = $('<div class="ui-resizable-handle ' + hname + '"></div>');
2326
2327				// increase zIndex of sw, se, ne, nw axis
2328				//TODO : this modifies original option
2329				if(/sw|se|ne|nw/.test(handle)) axis.css({ zIndex: ++o.zIndex });
2330
2331				//TODO : What's going on here?
2332				if ('se' == handle) {
2333					axis.addClass('ui-icon ui-icon-gripsmall-diagonal-se');
2334				};
2335
2336				//Insert into internal handles object and append to element
2337				this.handles[handle] = '.ui-resizable-'+handle;
2338				this.element.append(axis);
2339			}
2340
2341		}
2342
2343		this._renderAxis = function(target) {
2344
2345			target = target || this.element;
2346
2347			for(var i in this.handles) {
2348
2349				if(this.handles[i].constructor == String)
2350					this.handles[i] = $(this.handles[i], this.element).show();
2351
2352				//Apply pad to wrapper element, needed to fix axis position (textarea, inputs, scrolls)
2353				if (this.elementIsWrapper && this.originalElement[0].nodeName.match(/textarea|input|select|button/i)) {
2354
2355					var axis = $(this.handles[i], this.element), padWrapper = 0;
2356
2357					//Checking the correct pad and border
2358					padWrapper = /sw|ne|nw|se|n|s/.test(i) ? axis.outerHeight() : axis.outerWidth();
2359
2360					//The padding type i have to apply...
2361					var padPos = [ 'padding',
2362						/ne|nw|n/.test(i) ? 'Top' :
2363						/se|sw|s/.test(i) ? 'Bottom' :
2364						/^e$/.test(i) ? 'Right' : 'Left' ].join("");
2365
2366					target.css(padPos, padWrapper);
2367
2368					this._proportionallyResize();
2369
2370				}
2371
2372				//TODO: What's that good for? There's not anything to be executed left
2373				if(!$(this.handles[i]).length)
2374					continue;
2375
2376			}
2377		};
2378
2379		//TODO: make renderAxis a prototype function
2380		this._renderAxis(this.element);
2381
2382		this._handles = $('.ui-resizable-handle', this.element)
2383			.disableSelection();
2384
2385		//Matching axis name
2386		this._handles.mouseover(function() {
2387			if (!self.resizing) {
2388				if (this.className)
2389					var axis = this.className.match(/ui-resizable-(se|sw|ne|nw|n|e|s|w)/i);
2390				//Axis, default = se
2391				self.axis = axis && axis[1] ? axis[1] : 'se';
2392			}
2393		});
2394
2395		//If we want to auto hide the elements
2396		if (o.autoHide) {
2397			this._handles.hide();
2398			$(this.element)
2399				.addClass("ui-resizable-autohide")
2400				.hover(function() {
2401					$(this).removeClass("ui-resizable-autohide");
2402					self._handles.show();
2403				},
2404				function(){
2405					if (!self.resizing) {
2406						$(this).addClass("ui-resizable-autohide");
2407						self._handles.hide();
2408					}
2409				});
2410		}
2411
2412		//Initialize the mouse interaction
2413		this._mouseInit();
2414
2415	},
2416
2417	destroy: function() {
2418
2419		this._mouseDestroy();
2420
2421		var _destroy = function(exp) {
2422			$(exp).removeClass("ui-resizable ui-resizable-disabled ui-resizable-resizing")
2423				.removeData("resizable").unbind(".resizable").find('.ui-resizable-handle').remove();
2424		};
2425
2426		//TODO: Unwrap at same DOM position
2427		if (this.elementIsWrapper) {
2428			_destroy(this.element);
2429			var wrapper = this.element;
2430			wrapper.parent().append(
2431				this.originalElement.css({
2432					position: wrapper.css('position'),
2433					width: wrapper.outerWidth(),
2434					height: wrapper.outerHeight(),
2435					top: wrapper.css('top'),
2436					left: wrapper.css('left')
2437				})
2438			).end().remove();
2439		}
2440
2441		this.originalElement.css('resize', this.originalResizeStyle);
2442		_destroy(this.originalElement);
2443
2444	},
2445
2446	_mouseCapture: function(event) {
2447
2448		var handle = false;
2449		for(var i in this.handles) {
2450			if($(this.handles[i])[0] == event.target) handle = true;
2451		}
2452
2453		return this.options.disabled || !!handle;
2454
2455	},
2456
2457	_mouseStart: function(event) {
2458
2459		var o = this.options, iniPos = this.element.position(), el = this.element;
2460
2461		this.resizing = true;
2462		this.documentScroll = { top: $(document).scrollTop(), left: $(document).scrollLeft() };
2463
2464		// bugfix for https://dev.jquery.com/ticket/1749
2465		if (el.is('.ui-draggable') || (/absolute/).test(el.css('position'))) {
2466			el.css({ position: 'absolute', top: iniPos.top, left: iniPos.left });
2467		}
2468
2469		//Opera fixing relative position
2470		if ($.browser.opera && (/relative/).test(el.css('position')))
2471			el.css({ position: 'relative', top: 'auto', left: 'auto' });
2472
2473		this._renderProxy();
2474
2475		var curleft = num(this.helper.css('left')), curtop = num(this.helper.css('top'));
2476
2477		if (o.containment) {
2478			curleft += $(o.containment).scrollLeft() || 0;
2479			curtop += $(o.containment).scrollTop() || 0;
2480		}
2481
2482		//Store needed variables
2483		this.offset = this.helper.offset();
2484		this.position = { left: curleft, top: curtop };
2485		this.size = this._helper ? { width: el.outerWidth(), height: el.outerHeight() } : { width: el.width(), height: el.height() };
2486		this.originalSize = this._helper ? { width: el.outerWidth(), height: el.outerHeight() } : { width: el.width(), height: el.height() };
2487		this.originalPosition = { left: curleft, top: curtop };
2488		this.sizeDiff = { width: el.outerWidth() - el.width(), height: el.outerHeight() - el.height() };
2489		this.originalMousePosition = { left: event.pageX, top: event.pageY };
2490
2491		//Aspect Ratio
2492		this.aspectRatio = (typeof o.aspectRatio == 'number') ? o.aspectRatio : ((this.originalSize.width / this.originalSize.height) || 1);
2493
2494	    var cursor = $('.ui-resizable-' + this.axis).css('cursor');
2495	    $('body').css('cursor', cursor == 'auto' ? this.axis + '-resize' : cursor);
2496
2497		el.addClass("ui-resizable-resizing");
2498		this._propagate("start", event);
2499		return true;
2500	},
2501
2502	_mouseDrag: function(event) {
2503
2504		//Increase performance, avoid regex
2505		var el = this.helper, o = this.options, props = {},
2506			self = this, smp = this.originalMousePosition, a = this.axis;
2507
2508		var dx = (event.pageX-smp.left)||0, dy = (event.pageY-smp.top)||0;
2509		var trigger = this._change[a];
2510		if (!trigger) return false;
2511
2512		// Calculate the attrs that will be change
2513		var data = trigger.apply(this, [event, dx, dy]), ie6 = $.browser.msie && $.browser.version < 7, csdif = this.sizeDiff;
2514
2515		if (this._aspectRatio || event.shiftKey)
2516			data = this._updateRatio(data, event);
2517
2518		data = this._respectSize(data, event);
2519
2520		// plugins callbacks need to be called first
2521		this._propagate("resize", event);
2522
2523		el.css({
2524			top: this.position.top + "px", left: this.position.left + "px",
2525			width: this.size.width + "px", height: this.size.height + "px"
2526		});
2527
2528		if (!this._helper && this._proportionallyResizeElements.length)
2529			this._proportionallyResize();
2530
2531		this._updateCache(data);
2532
2533		// calling the user callback at the end
2534		this._trigger('resize', event, this.ui());
2535
2536		return false;
2537	},
2538
2539	_mouseStop: function(event) {
2540
2541		this.resizing = false;
2542		var o = this.options, self = this;
2543
2544		if(this._helper) {
2545			var pr = this._proportionallyResizeElements, ista = pr.length && (/textarea/i).test(pr[0].nodeName),
2546						soffseth = ista && $.ui.hasScroll(pr[0], 'left') /* TODO - jump height */ ? 0 : self.sizeDiff.height,
2547							soffsetw = ista ? 0 : self.sizeDiff.width;
2548
2549			var s = { width: (self.size.width - soffsetw), height: (self.size.height - soffseth) },
2550				left = (parseInt(self.element.css('left'), 10) + (self.position.left - self.originalPosition.left)) || null,
2551				top = (parseInt(self.element.css('top'), 10) + (self.position.top - self.originalPosition.top)) || null;
2552
2553			if (!o.animate)
2554				this.element.css($.extend(s, { top: top, left: left }));
2555
2556			self.helper.height(self.size.height);
2557			self.helper.width(self.size.width);
2558
2559			if (this._helper && !o.animate) this._proportionallyResize();
2560		}
2561
2562		$('body').css('cursor', 'auto');
2563
2564		this.element.removeClass("ui-resizable-resizing");
2565
2566		this._propagate("stop", event);
2567
2568		if (this._helper) this.helper.remove();
2569		return false;
2570
2571	},
2572
2573	_updateCache: function(data) {
2574		var o = this.options;
2575		this.offset = this.helper.offset();
2576		if (isNumber(data.left)) this.position.left = data.left;
2577		if (isNumber(data.top)) this.position.top = data.top;
2578		if (isNumber(data.height)) this.size.height = data.height;
2579		if (isNumber(data.width)) this.size.width = data.width;
2580	},
2581
2582	_updateRatio: function(data, event) {
2583
2584		var o = this.options, cpos = this.position, csize = this.size, a = this.axis;
2585
2586		if (data.height) data.width = (csize.height * this.aspectRatio);
2587		else if (data.width) data.height = (csize.width / this.aspectRatio);
2588
2589		if (a == 'sw') {
2590			data.left = cpos.left + (csize.width - data.width);
2591			data.top = null;
2592		}
2593		if (a == 'nw') {
2594			data.top = cpos.top + (csize.height - data.height);
2595			data.left = cpos.left + (csize.width - data.width);
2596		}
2597
2598		return data;
2599	},
2600
2601	_respectSize: function(data, event) {
2602
2603		var el = this.helper, o = this.options, pRatio = this._aspectRatio || event.shiftKey, a = this.axis,
2604				ismaxw = isNumber(data.width) && o.maxWidth && (o.maxWidth < data.width), ismaxh = isNumber(data.height) && o.maxHeight && (o.maxHeight < data.height),
2605					isminw = isNumber(data.width) && o.minWidth && (o.minWidth > data.width), isminh = isNumber(data.height) && o.minHeight && (o.minHeight > data.height);
2606
2607		if (isminw) data.width = o.minWidth;
2608		if (isminh) data.height = o.minHeight;
2609		if (ismaxw) data.width = o.maxWidth;
2610		if (ismaxh) data.height = o.maxHeight;
2611
2612		var dw = this.originalPosition.left + this.originalSize.width, dh = this.position.top + this.size.height;
2613		var cw = /sw|nw|w/.test(a), ch = /nw|ne|n/.test(a);
2614
2615		if (isminw && cw) data.left = dw - o.minWidth;
2616		if (ismaxw && cw) data.left = dw - o.maxWidth;
2617		if (isminh && ch)	data.top = dh - o.minHeight;
2618		if (ismaxh && ch)	data.top = dh - o.maxHeight;
2619
2620		// fixing jump error on top/left - bug #2330
2621		var isNotwh = !data.width && !data.height;
2622		if (isNotwh && !data.left && data.top) data.top = null;
2623		else if (isNotwh && !data.top && data.left) data.left = null;
2624
2625		return data;
2626	},
2627
2628	_proportionallyResize: function() {
2629
2630		var o = this.options;
2631		if (!this._proportionallyResizeElements.length) return;
2632		var element = this.helper || this.element;
2633
2634		for (var i=0; i < this._proportionallyResizeElements.length; i++) {
2635
2636			var prel = this._proportionallyResizeElements[i];
2637
2638			if (!this.borderDif) {
2639				var b = [prel.css('borderTopWidth'), prel.css('borderRightWidth'), prel.css('borderBottomWidth'), prel.css('borderLeftWidth')],
2640					p = [prel.css('paddingTop'), prel.css('paddingRight'), prel.css('paddingBottom'), prel.css('paddingLeft')];
2641
2642				this.borderDif = $.map(b, function(v, i) {
2643					var border = parseInt(v,10)||0, padding = parseInt(p[i],10)||0;
2644					return border + padding;
2645				});
2646			}
2647
2648			if ($.browser.msie && !(!($(element).is(':hidden') || $(element).parents(':hidden').length)))
2649				continue;
2650
2651			prel.css({
2652				height: (element.height() - this.borderDif[0] - this.borderDif[2]) || 0,
2653				width: (element.width() - this.borderDif[1] - this.borderDif[3]) || 0
2654			});
2655
2656		};
2657
2658	},
2659
2660	_renderProxy: function() {
2661
2662		var el = this.element, o = this.options;
2663		this.elementOffset = el.offset();
2664
2665		if(this._helper) {
2666
2667			this.helper = this.helper || $('<div style="overflow:hidden;"></div>');
2668
2669			// fix ie6 offset TODO: This seems broken
2670			var ie6 = $.browser.msie && $.browser.version < 7, ie6offset = (ie6 ? 1 : 0),
2671			pxyoffset = ( ie6 ? 2 : -1 );
2672
2673			this.helper.addClass(this._helper).css({
2674				width: this.element.outerWidth() + pxyoffset,
2675				height: this.element.outerHeight() + pxyoffset,
2676				position: 'absolute',
2677				left: this.elementOffset.left - ie6offset +'px',
2678				top: this.elementOffset.top - ie6offset +'px',
2679				zIndex: ++o.zIndex //TODO: Don't modify option
2680			});
2681
2682			this.helper
2683				.appendTo("body")
2684				.disableSelection();
2685
2686		} else {
2687			this.helper = this.element;
2688		}
2689
2690	},
2691
2692	_change: {
2693		e: function(event, dx, dy) {
2694			return { width: this.originalSize.width + dx };
2695		},
2696		w: function(event, dx, dy) {
2697			var o = this.options, cs = this.originalSize, sp = this.originalPosition;
2698			return { left: sp.left + dx, width: cs.width - dx };
2699		},
2700		n: function(event, dx, dy) {
2701			var o = this.options, cs = this.originalSize, sp = this.originalPosition;
2702			return { top: sp.top + dy, height: cs.height - dy };
2703		},
2704		s: function(event, dx, dy) {
2705			return { height: this.originalSize.height + dy };
2706		},
2707		se: function(event, dx, dy) {
2708			return $.extend(this._change.s.apply(this, arguments), this._change.e.apply(this, [event, dx, dy]));
2709		},
2710		sw: function(event, dx, dy) {
2711			return $.extend(this._change.s.apply(this, arguments), this._change.w.apply(this, [event, dx, dy]));
2712		},
2713		ne: function(event, dx, dy) {
2714			return $.extend(this._change.n.apply(this, arguments), this._change.e.apply(this, [event, dx, dy]));
2715		},
2716		nw: function(event, dx, dy) {
2717			return $.extend(this._change.n.apply(this, arguments), this._change.w.apply(this, [event, dx, dy]));
2718		}
2719	},
2720
2721	_propagate: function(n, event) {
2722		$.ui.plugin.call(this, n, [event, this.ui()]);
2723		(n != "resize" && this._trigger(n, event, this.ui()));
2724	},
2725
2726	plugins: {},
2727
2728	ui: function() {
2729		return {
2730			originalElement: this.originalElement,
2731			element: this.element,
2732			helper: this.helper,
2733			position: this.position,
2734			size: this.size,
2735			originalSize: this.originalSize,
2736			originalPosition: this.originalPosition
2737		};
2738	}
2739
2740}));
2741
2742$.extend($.ui.resizable, {
2743	version: "1.7.3",
2744	eventPrefix: "resize",
2745	defaults: {
2746		alsoResize: false,
2747		animate: false,
2748		animateDuration: "slow",
2749		animateEasing: "swing",
2750		aspectRatio: false,
2751		autoHide: false,
2752		cancel: ":input,option",
2753		containment: false,
2754		delay: 0,
2755		distance: 1,
2756		ghost: false,
2757		grid: false,
2758		handles: "e,s,se",
2759		helper: false,
2760		maxHeight: null,
2761		maxWidth: null,
2762		minHeight: 10,
2763		minWidth: 10,
2764		zIndex: 1000
2765	}
2766});
2767
2768/*
2769 * Resizable Extensions
2770 */
2771
2772$.ui.plugin.add("resizable", "alsoResize", {
2773
2774	start: function(event, ui) {
2775
2776		var self = $(this).data("resizable"), o = self.options;
2777
2778		_store = function(exp) {
2779			$(exp).each(function() {
2780				$(this).data("resizable-alsoresize", {
2781					width: parseInt($(this).width(), 10), height: parseInt($(this).height(), 10),
2782					left: parseInt($(this).css('left'), 10), top: parseInt($(this).css('top'), 10)
2783				});
2784			});
2785		};
2786
2787		if (typeof(o.alsoResize) == 'object' && !o.alsoResize.parentNode) {
2788			if (o.alsoResize.length) { o.alsoResize = o.alsoResize[0];	_store(o.alsoResize); }
2789			else { $.each(o.alsoResize, function(exp, c) { _store(exp); }); }
2790		}else{
2791			_store(o.alsoResize);
2792		}
2793	},
2794
2795	resize: function(event, ui){
2796		var self = $(this).data("resizable"), o = self.options, os = self.originalSize, op = self.originalPosition;
2797
2798		var delta = {
2799			height: (self.size.height - os.height) || 0, width: (self.size.width - os.width) || 0,
2800			top: (self.position.top - op.top) || 0, left: (self.position.left - op.left) || 0
2801		},
2802
2803		_alsoResize = function(exp, c) {
2804			$(exp).each(function() {
2805				var el = $(this), start = $(this).data("resizable-alsoresize"), style = {}, css = c && c.length ? c : ['width', 'height', 'top', 'left'];
2806
2807				$.each(css || ['width', 'height', 'top', 'left'], function(i, prop) {
2808					var sum = (start[prop]||0) + (delta[prop]||0);
2809					if (sum && sum >= 0)
2810						style[prop] = sum || null;
2811				});
2812
2813				//Opera fixing relative position
2814				if (/relative/.test(el.css('position')) && $.browser.opera) {
2815					self._revertToRelativePosition = true;
2816					el.css({ position: 'absolute', top: 'auto', left: 'auto' });
2817				}
2818
2819				el.css(style);
2820			});
2821		};
2822
2823		if (typeof(o.alsoResize) == 'object' && !o.alsoResize.nodeType) {
2824			$.each(o.alsoResize, function(exp, c) { _alsoResize(exp, c); });
2825		}else{
2826			_alsoResize(o.alsoResize);
2827		}
2828	},
2829
2830	stop: function(event, ui){
2831		var self = $(this).data("resizable");
2832
2833		//Opera fixing relative position
2834		if (self._revertToRelativePosition && $.browser.opera) {
2835			self._revertToRelativePosition = false;
2836			el.css({ position: 'relative' });
2837		}
2838
2839		$(this).removeData("resizable-alsoresize-start");
2840	}
2841});
2842
2843$.ui.plugin.add("resizable", "animate", {
2844
2845	stop: function(event, ui) {
2846		var self = $(this).data("resizable"), o = self.options;
2847
2848		var pr = self._proportionallyResizeElements, ista = pr.length && (/textarea/i).test(pr[0].nodeName),
2849					soffseth = ista && $.ui.hasScroll(pr[0], 'left') /* TODO - jump height */ ? 0 : self.sizeDiff.height,
2850						soffsetw = ista ? 0 : self.sizeDiff.width;
2851
2852		var style = { width: (self.size.width - soffsetw), height: (self.size.height - soffseth) },
2853					left = (parseInt(self.element.css('left'), 10) + (self.position.left - self.originalPosition.left)) || null,
2854						top = (parseInt(self.element.css('top'), 10) + (self.position.top - self.originalPosition.top)) || null;
2855
2856		self.element.animate(
2857			$.extend(style, top && left ? { top: top, left: left } : {}), {
2858				duration: o.animateDuration,
2859				easing: o.animateEasing,
2860				step: function() {
2861
2862					var data = {
2863						width: parseInt(self.element.css('width'), 10),
2864						height: parseInt(self.element.css('height'), 10),
2865						top: parseInt(self.element.css('top'), 10),
2866						left: parseInt(self.element.css('left'), 10)
2867					};
2868
2869					if (pr && pr.length) $(pr[0]).css({ width: data.width, height: data.height });
2870
2871					// propagating resize, and updating values for each animation step
2872					self._updateCache(data);
2873					self._propagate("resize", event);
2874
2875				}
2876			}
2877		);
2878	}
2879
2880});
2881
2882$.ui.plugin.add("resizable", "containment", {
2883
2884	start: function(event, ui) {
2885		var self = $(this).data("resizable"), o = self.options, el = self.element;
2886		var oc = o.containment,	ce = (oc instanceof $) ? oc.get(0) : (/parent/.test(oc)) ? el.parent().get(0) : oc;
2887		if (!ce) return;
2888
2889		self.containerElement = $(ce);
2890
2891		if (/document/.test(oc) || oc == document) {
2892			self.containerOffset = { left: 0, top: 0 };
2893			self.containerPosition = { left: 0, top: 0 };
2894
2895			self.parentData = {
2896				element: $(document), left: 0, top: 0,
2897				width: $(document).width(), height: $(document).height() || document.body.parentNode.scrollHeight
2898			};
2899		}
2900
2901		// i'm a node, so compute top, left, right, bottom
2902		else {
2903			var element = $(ce), p = [];
2904			$([ "Top", "Right", "Left", "Bottom" ]).each(function(i, name) { p[i] = num(element.css("padding" + name)); });
2905
2906			self.containerOffset = element.offset();
2907			self.containerPosition = element.position();
2908			self.containerSize = { height: (element.innerHeight() - p[3]), width: (element.innerWidth() - p[1]) };
2909
2910			var co = self.containerOffset, ch = self.containerSize.height,	cw = self.containerSize.width,
2911						width = ($.ui.hasScroll(ce, "left") ? ce.scrollWidth : cw ), height = ($.ui.hasScroll(ce) ? ce.scrollHeight : ch);
2912
2913			self.parentData = {
2914				element: ce, left: co.left, top: co.top, width: width, height: height
2915			};
2916		}
2917	},
2918
2919	resize: function(event, ui) {
2920		var self = $(this).data("resizable"), o = self.options,
2921				ps = self.containerSize, co = self.containerOffset, cs = self.size, cp = self.position,
2922				pRatio = self._aspectRatio || event.shiftKey, cop = { top:0, left:0 }, ce = self.containerElement;
2923
2924		if (ce[0] != document && (/static/).test(ce.css('position'))) cop = co;
2925
2926		if (cp.left < (self._helper ? co.left : 0)) {
2927			self.size.width = self.size.width + (self._helper ? (self.position.left - co.left) : (self.position.left - cop.left));
2928			if (pRatio) self.size.height = self.size.width / o.aspectRatio;
2929			self.position.left = o.helper ? co.left : 0;
2930		}
2931
2932		if (cp.top < (self._helper ? co.top : 0)) {
2933			self.size.height = self.size.height + (self._helper ? (self.position.top - co.top) : self.position.top);
2934			if (pRatio) self.size.width = self.size.height * o.aspectRatio;
2935			self.position.top = self._helper ? co.top : 0;
2936		}
2937
2938		self.offset.left = self.parentData.left+self.position.left;
2939		self.offset.top = self.parentData.top+self.position.top;
2940
2941		var woset = Math.abs( (self._helper ? self.offset.left - cop.left : (self.offset.left - cop.left)) + self.sizeDiff.width ),
2942					hoset = Math.abs( (self._helper ? self.offset.top - cop.top : (self.offset.top - co.top)) + self.sizeDiff.height );
2943
2944		var isParent = self.containerElement.get(0) == self.element.parent().get(0),
2945		    isOffsetRelative = /relative|absolute/.test(self.containerElement.css('position'));
2946
2947		if(isParent && isOffsetRelative) woset -= self.parentData.left;
2948
2949		if (woset + self.size.width >= self.parentData.width) {
2950			self.size.width = self.parentData.width - woset;
2951			if (pRatio) self.size.height = self.size.width / self.aspectRatio;
2952		}
2953
2954		if (hoset + self.size.height >= self.parentData.height) {
2955			self.size.height = self.parentData.height - hoset;
2956			if (pRatio) self.size.width = self.size.height * self.aspectRatio;
2957		}
2958	},
2959
2960	stop: function(event, ui){
2961		var self = $(this).data("resizable"), o = self.options, cp = self.position,
2962				co = self.containerOffset, cop = self.containerPosition, ce = self.containerElement;
2963
2964		var helper = $(self.helper), ho = helper.offset(), w = helper.outerWidth() - self.sizeDiff.width, h = helper.outerHeight() - self.sizeDiff.height;
2965
2966		if (self._helper && !o.animate && (/relative/).test(ce.css('position')))
2967			$(this).css({ left: ho.left - cop.left - co.left, width: w, height: h });
2968
2969		if (self._helper && !o.animate && (/static/).test(ce.css('position')))
2970			$(this).css({ left: ho.left - cop.left - co.left, width: w, height: h });
2971
2972	}
2973});
2974
2975$.ui.plugin.add("resizable", "ghost", {
2976
2977	start: function(event, ui) {
2978
2979		var self = $(this).data("resizable"), o = self.options, cs = self.size;
2980
2981		self.ghost = self.originalElement.clone();
2982		self.ghost
2983			.css({ opacity: .25, display: 'block', position: 'relative', height: cs.height, width: cs.width, margin: 0, left: 0, top: 0 })
2984			.addClass('ui-resizable-ghost')
2985			.addClass(typeof o.ghost == 'string' ? o.ghost : '');
2986
2987		self.ghost.appendTo(self.helper);
2988
2989	},
2990
2991	resize: function(event, ui){
2992		var self = $(this).data("resizable"), o = self.options;
2993		if (self.ghost) self.ghost.css({ position: 'relative', height: self.size.height, width: self.size.width });
2994	},
2995
2996	stop: function(event, ui){
2997		var self = $(this).data("resizable"), o = self.options;
2998		if (self.ghost && self.helper) self.helper.get(0).removeChild(self.ghost.get(0));
2999	}
3000
3001});
3002
3003$.ui.plugin.add("resizable", "grid", {
3004
3005	resize: function(event, ui) {
3006		var self = $(this).data("resizable"), o = self.options, cs = self.size, os = self.originalSize, op = self.originalPosition, a = self.axis, ratio = o._aspectRatio || event.shiftKey;
3007		o.grid = typeof o.grid == "number" ? [o.grid, o.grid] : o.grid;
3008		var ox = Math.round((cs.width - os.width) / (o.grid[0]||1)) * (o.grid[0]||1), oy = Math.round((cs.height - os.height) / (o.grid[1]||1)) * (o.grid[1]||1);
3009
3010		if (/^(se|s|e)$/.test(a)) {
3011			self.size.width = os.width + ox;
3012			self.size.height = os.height + oy;
3013		}
3014		else if (/^(ne)$/.test(a)) {
3015			self.size.width = os.width + ox;
3016			self.size.height = os.height + oy;
3017			self.position.top = op.top - oy;
3018		}
3019		else if (/^(sw)$/.test(a)) {
3020			self.size.width = os.width + ox;
3021			self.size.height = os.height + oy;
3022			self.position.left = op.left - ox;
3023		}
3024		else {
3025			self.size.width = os.width + ox;
3026			self.size.height = os.height + oy;
3027			self.position.top = op.top - oy;
3028			self.position.left = op.left - ox;
3029		}
3030	}
3031
3032});
3033
3034var num = function(v) {
3035	return parseInt(v, 10) || 0;
3036};
3037
3038var isNumber = function(value) {
3039	return !isNaN(parseInt(value, 10));
3040};
3041
3042})(jQuery);
3043/*
3044 * jQuery UI Selectable 1.7.3
3045 *
3046 * Copyright (c) 2009 AUTHORS.txt (https://jqueryui.com/about)
3047 * Dual licensed under the MIT (MIT-LICENSE.txt)
3048 * and GPL (GPL-LICENSE.txt) licenses.
3049 *
3050 * https://docs.jquery.com/UI/Selectables
3051 *
3052 * Depends:
3053 *	ui.core.js
3054 */
3055(function($) {
3056
3057$.widget("ui.selectable", $.extend({}, $.ui.mouse, {
3058
3059	_init: function() {
3060		var self = this;
3061
3062		this.element.addClass("ui-selectable");
3063
3064		this.dragged = false;
3065
3066		// cache selectee children based on filter
3067		var selectees;
3068		this.refresh = function() {
3069			selectees = $(self.options.filter, self.element[0]);
3070			selectees.each(function() {
3071				var $this = $(this);
3072				var pos = $this.offset();
3073				$.data(this, "selectable-item", {
3074					element: this,
3075					$element: $this,
3076					left: pos.left,
3077					top: pos.top,
3078					right: pos.left + $this.outerWidth(),
3079					bottom: pos.top + $this.outerHeight(),
3080					startselected: false,
3081					selected: $this.hasClass('ui-selected'),
3082					selecting: $this.hasClass('ui-selecting'),
3083					unselecting: $this.hasClass('ui-unselecting')
3084				});
3085			});
3086		};
3087		this.refresh();
3088
3089		this.selectees = selectees.addClass("ui-selectee");
3090
3091		this._mouseInit();
3092
3093		this.helper = $(document.createElement('div'))
3094			.css({border:'1px dotted black'})
3095			.addClass("ui-selectable-helper");
3096	},
3097
3098	destroy: function() {
3099		this.element
3100			.removeClass("ui-selectable ui-selectable-disabled")
3101			.removeData("selectable")
3102			.unbind(".selectable");
3103		this._mouseDestroy();
3104	},
3105
3106	_mouseStart: function(event) {
3107		var self = this;
3108
3109		this.opos = [event.pageX, event.pageY];
3110
3111		if (this.options.disabled)
3112			return;
3113
3114		var options = this.options;
3115
3116		this.selectees = $(options.filter, this.element[0]);
3117
3118		this._trigger("start", event);
3119
3120		$(options.appendTo).append(this.helper);
3121		// position helper (lasso)
3122		this.helper.css({
3123			"z-index": 100,
3124			"position": "absolute",
3125			"left": event.clientX,
3126			"top": event.clientY,
3127			"width": 0,
3128			"height": 0
3129		});
3130
3131		if (options.autoRefresh) {
3132			this.refresh();
3133		}
3134
3135		this.selectees.filter('.ui-selected').each(function() {
3136			var selectee = $.data(this, "selectable-item");
3137			selectee.startselected = true;
3138			if (!event.metaKey) {
3139				selectee.$element.removeClass('ui-selected');
3140				selectee.selected = false;
3141				selectee.$element.addClass('ui-unselecting');
3142				selectee.unselecting = true;
3143				// selectable UNSELECTING callback
3144				self._trigger("unselecting", event, {
3145					unselecting: selectee.element
3146				});
3147			}
3148		});
3149
3150		$(event.target).parents().andSelf().each(function() {
3151			var selectee = $.data(this, "selectable-item");
3152			if (selectee) {
3153				selectee.$element.removeClass("ui-unselecting").addClass('ui-selecting');
3154				selectee.unselecting = false;
3155				selectee.selecting = true;
3156				selectee.selected = true;
3157				// selectable SELECTING callback
3158				self._trigger("selecting", event, {
3159					selecting: selectee.element
3160				});
3161				return false;
3162			}
3163		});
3164
3165	},
3166
3167	_mouseDrag: function(event) {
3168		var self = this;
3169		this.dragged = true;
3170
3171		if (this.options.disabled)
3172			return;
3173
3174		var options = this.options;
3175
3176		var x1 = this.opos[0], y1 = this.opos[1], x2 = event.pageX, y2 = event.pageY;
3177		if (x1 > x2) { var tmp = x2; x2 = x1; x1 = tmp; }
3178		if (y1 > y2) { var tmp = y2; y2 = y1; y1 = tmp; }
3179		this.helper.css({left: x1, top: y1, width: x2-x1, height: y2-y1});
3180
3181		this.selectees.each(function() {
3182			var selectee = $.data(this, "selectable-item");
3183			//prevent helper from being selected if appendTo: selectable
3184			if (!selectee || selectee.element == self.element[0])
3185				return;
3186			var hit = false;
3187			if (options.tolerance == 'touch') {
3188				hit = ( !(selectee.left > x2 || selectee.right < x1 || selectee.top > y2 || selectee.bottom < y1) );
3189			} else if (options.tolerance == 'fit') {
3190				hit = (selectee.left > x1 && selectee.right < x2 && selectee.top > y1 && selectee.bottom < y2);
3191			}
3192
3193			if (hit) {
3194				// SELECT
3195				if (selectee.selected) {
3196					selectee.$element.removeClass('ui-selected');
3197					selectee.selected = false;
3198				}
3199				if (selectee.unselecting) {
3200					selectee.$element.removeClass('ui-unselecting');
3201					selectee.unselecting = false;
3202				}
3203				if (!selectee.selecting) {
3204					selectee.$element.addClass('ui-selecting');
3205					selectee.selecting = true;
3206					// selectable SELECTING callback
3207					self._trigger("selecting", event, {
3208						selecting: selectee.element
3209					});
3210				}
3211			} else {
3212				// UNSELECT
3213				if (selectee.selecting) {
3214					if (event.metaKey && selectee.startselected) {
3215						selectee.$element.removeClass('ui-selecting');
3216						selectee.selecting = false;
3217						selectee.$element.addClass('ui-selected');
3218						selectee.selected = true;
3219					} else {
3220						selectee.$element.removeClass('ui-selecting');
3221						selectee.selecting = false;
3222						if (selectee.startselected) {
3223							selectee.$element.addClass('ui-unselecting');
3224							selectee.unselecting = true;
3225						}
3226						// selectable UNSELECTING callback
3227						self._trigger("unselecting", event, {
3228							unselecting: selectee.element
3229						});
3230					}
3231				}
3232				if (selectee.selected) {
3233					if (!event.metaKey && !selectee.startselected) {
3234						selectee.$element.removeClass('ui-selected');
3235						selectee.selected = false;
3236
3237						selectee.$element.addClass('ui-unselecting');
3238						selectee.unselecting = true;
3239						// selectable UNSELECTING callback
3240						self._trigger("unselecting", event, {
3241							unselecting: selectee.element
3242						});
3243					}
3244				}
3245			}
3246		});
3247
3248		return false;
3249	},
3250
3251	_mouseStop: function(event) {
3252		var self = this;
3253
3254		this.dragged = false;
3255
3256		var options = this.options;
3257
3258		$('.ui-unselecting', this.element[0]).each(function() {
3259			var selectee = $.data(this, "selectable-item");
3260			selectee.$element.removeClass('ui-unselecting');
3261			selectee.unselecting = false;
3262			selectee.startselected = false;
3263			self._trigger("unselected", event, {
3264				unselected: selectee.element
3265			});
3266		});
3267		$('.ui-selecting', this.element[0]).each(function() {
3268			var selectee = $.data(this, "selectable-item");
3269			selectee.$element.removeClass('ui-selecting').addClass('ui-selected');
3270			selectee.selecting = false;
3271			selectee.selected = true;
3272			selectee.startselected = true;
3273			self._trigger("selected", event, {
3274				selected: selectee.element
3275			});
3276		});
3277		this._trigger("stop", event);
3278
3279		this.helper.remove();
3280
3281		return false;
3282	}
3283
3284}));
3285
3286$.extend($.ui.selectable, {
3287	version: "1.7.3",
3288	defaults: {
3289		appendTo: 'body',
3290		autoRefresh: true,
3291		cancel: ":input,option",
3292		delay: 0,
3293		distance: 0,
3294		filter: '*',
3295		tolerance: 'touch'
3296	}
3297});
3298
3299})(jQuery);
3300/*
3301 * jQuery UI Sortable 1.7.3
3302 *
3303 * Copyright (c) 2009 AUTHORS.txt (https://jqueryui.com/about)
3304 * Dual licensed under the MIT (MIT-LICENSE.txt)
3305 * and GPL (GPL-LICENSE.txt) licenses.
3306 *
3307 * https://docs.jquery.com/UI/Sortables
3308 *
3309 * Depends:
3310 *	ui.core.js
3311 */
3312(function($) {
3313
3314$.widget("ui.sortable", $.extend({}, $.ui.mouse, {
3315	_init: function() {
3316
3317		var o = this.options;
3318		this.containerCache = {};
3319		this.element.addClass("ui-sortable");
3320
3321		//Get the items
3322		this.refresh();
3323
3324		//Let's determine if the items are floating
3325		this.floating = this.items.length ? (/left|right/).test(this.items[0].item.css('float')) : false;
3326
3327		//Let's determine the parent's offset
3328		this.offset = this.element.offset();
3329
3330		//Initialize mouse events for interaction
3331		this._mouseInit();
3332
3333	},
3334
3335	destroy: function() {
3336		this.element
3337			.removeClass("ui-sortable ui-sortable-disabled")
3338			.removeData("sortable")
3339			.unbind(".sortable");
3340		this._mouseDestroy();
3341
3342		for ( var i = this.items.length - 1; i >= 0; i-- )
3343			this.items[i].item.removeData("sortable-item");
3344	},
3345
3346	_mouseCapture: function(event, overrideHandle) {
3347
3348		if (this.reverting) {
3349			return false;
3350		}
3351
3352		if(this.options.disabled || this.options.type == 'static') return false;
3353
3354		//We have to refresh the items data once first
3355		this._refreshItems(event);
3356
3357		//Find out if the clicked node (or one of its parents) is a actual item in this.items
3358		var currentItem = null, self = this, nodes = $(event.target).parents().each(function() {
3359			if($.data(this, 'sortable-item') == self) {
3360				currentItem = $(this);
3361				return false;
3362			}
3363		});
3364		if($.data(event.target, 'sortable-item') == self) currentItem = $(event.target);
3365
3366		if(!currentItem) return false;
3367		if(this.options.handle && !overrideHandle) {
3368			var validHandle = false;
3369
3370			$(this.options.handle, currentItem).find("*").andSelf().each(function() { if(this == event.target) validHandle = true; });
3371			if(!validHandle) return false;
3372		}
3373
3374		this.currentItem = currentItem;
3375		this._removeCurrentsFromItems();
3376		return true;
3377
3378	},
3379
3380	_mouseStart: function(event, overrideHandle, noActivation) {
3381
3382		var o = this.options, self = this;
3383		this.currentContainer = this;
3384
3385		//We only need to call refreshPositions, because the refreshItems call has been moved to mouseCapture
3386		this.refreshPositions();
3387
3388		//Create and append the visible helper
3389		this.helper = this._createHelper(event);
3390
3391		//Cache the helper size
3392		this._cacheHelperProportions();
3393
3394		/*
3395		 * - Position generation -
3396		 * This block generates everything position related - it's the core of draggables.
3397		 */
3398
3399		//Cache the margins of the original element
3400		this._cacheMargins();
3401
3402		//Get the next scrolling parent
3403		this.scrollParent = this.helper.scrollParent();
3404
3405		//The element's absolute position on the page minus margins
3406		this.offset = this.currentItem.offset();
3407		this.offset = {
3408			top: this.offset.top - this.margins.top,
3409			left: this.offset.left - this.margins.left
3410		};
3411
3412		// Only after we got the offset, we can change the helper's position to absolute
3413		// TODO: Still need to figure out a way to make relative sorting possible
3414		this.helper.css("position", "absolute");
3415		this.cssPosition = this.helper.css("position");
3416
3417		$.extend(this.offset, {
3418			click: { //Where the click happened, relative to the element
3419				left: event.pageX - this.offset.left,
3420				top: event.pageY - this.offset.top
3421			},
3422			parent: this._getParentOffset(),
3423			relative: this._getRelativeOffset() //This is a relative to absolute position minus the actual position calculation - only used for relative positioned helper
3424		});
3425
3426		//Generate the original position
3427		this.originalPosition = this._generatePosition(event);
3428		this.originalPageX = event.pageX;
3429		this.originalPageY = event.pageY;
3430
3431		//Adjust the mouse offset relative to the helper if 'cursorAt' is supplied
3432		if(o.cursorAt)
3433			this._adjustOffsetFromHelper(o.cursorAt);
3434
3435		//Cache the former DOM position
3436		this.domPosition = { prev: this.currentItem.prev()[0], parent: this.currentItem.parent()[0] };
3437
3438		//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
3439		if(this.helper[0] != this.currentItem[0]) {
3440			this.currentItem.hide();
3441		}
3442
3443		//Create the placeholder
3444		this._createPlaceholder();
3445
3446		//Set a containment if given in the options
3447		if(o.containment)
3448			this._setContainment();
3449
3450		if(o.cursor) { // cursor option
3451			if ($('body').css("cursor")) this._storedCursor = $('body').css("cursor");
3452			$('body').css("cursor", o.cursor);
3453		}
3454
3455		if(o.opacity) { // opacity option
3456			if (this.helper.css("opacity")) this._storedOpacity = this.helper.css("opacity");
3457			this.helper.css("opacity", o.opacity);
3458		}
3459
3460		if(o.zIndex) { // zIndex option
3461			if (this.helper.css("zIndex")) this._storedZIndex = this.helper.css("zIndex");
3462			this.helper.css("zIndex", o.zIndex);
3463		}
3464
3465		//Prepare scrolling
3466		if(this.scrollParent[0] != document && this.scrollParent[0].tagName != 'HTML')
3467			this.overflowOffset = this.scrollParent.offset();
3468
3469		//Call callbacks
3470		this._trigger("start", event, this._uiHash());
3471
3472		//Recache the helper size
3473		if(!this._preserveHelperProportions)
3474			this._cacheHelperProportions();
3475
3476
3477		//Post 'activate' events to possible containers
3478		if(!noActivation) {
3479			 for (var i = this.containers.length - 1; i >= 0; i--) { this.containers[i]._trigger("activate", event, self._uiHash(this)); }
3480		}
3481
3482		//Prepare possible droppables
3483		if($.ui.ddmanager)
3484			$.ui.ddmanager.current = this;
3485
3486		if ($.ui.ddmanager && !o.dropBehaviour)
3487			$.ui.ddmanager.prepareOffsets(this, event);
3488
3489		this.dragging = true;
3490
3491		this.helper.addClass("ui-sortable-helper");
3492		this._mouseDrag(event); //Execute the drag once - this causes the helper not to be visible before getting its correct position
3493		return true;
3494
3495	},
3496
3497	_mouseDrag: function(event) {
3498
3499		//Compute the helpers position
3500		this.position = this._generatePosition(event);
3501		this.positionAbs = this._convertPositionTo("absolute");
3502
3503		if (!this.lastPositionAbs) {
3504			this.lastPositionAbs = this.positionAbs;
3505		}
3506
3507		//Do scrolling
3508		if(this.options.scroll) {
3509			var o = this.options, scrolled = false;
3510			if(this.scrollParent[0] != document && this.scrollParent[0].tagName != 'HTML') {
3511
3512				if((this.overflowOffset.top + this.scrollParent[0].offsetHeight) - event.pageY < o.scrollSensitivity)
3513					this.scrollParent[0].scrollTop = scrolled = this.scrollParent[0].scrollTop + o.scrollSpeed;
3514				else if(event.pageY - this.overflowOffset.top < o.scrollSensitivity)
3515					this.scrollParent[0].scrollTop = scrolled = this.scrollParent[0].scrollTop - o.scrollSpeed;
3516
3517				if((this.overflowOffset.left + this.scrollParent[0].offsetWidth) - event.pageX < o.scrollSensitivity)
3518					this.scrollParent[0].scrollLeft = scrolled = this.scrollParent[0].scrollLeft + o.scrollSpeed;
3519				else if(event.pageX - this.overflowOffset.left < o.scrollSensitivity)
3520					this.scrollParent[0].scrollLeft = scrolled = this.scrollParent[0].scrollLeft - o.scrollSpeed;
3521
3522			} else {
3523
3524				if(event.pageY - $(document).scrollTop() < o.scrollSensitivity)
3525					scrolled = $(document).scrollTop($(document).scrollTop() - o.scrollSpeed);
3526				else if($(window).height() - (event.pageY - $(document).scrollTop()) < o.scrollSensitivity)
3527					scrolled = $(document).scrollTop($(document).scrollTop() + o.scrollSpeed);
3528
3529				if(event.pageX - $(document).scrollLeft() < o.scrollSensitivity)
3530					scrolled = $(document).scrollLeft($(document).scrollLeft() - o.scrollSpeed);
3531				else if($(window).width() - (event.pageX - $(document).scrollLeft()) < o.scrollSensitivity)
3532					scrolled = $(document).scrollLeft($(document).scrollLeft() + o.scrollSpeed);
3533
3534			}
3535
3536			if(scrolled !== false && $.ui.ddmanager && !o.dropBehaviour)
3537				$.ui.ddmanager.prepareOffsets(this, event);
3538		}
3539
3540		//Regenerate the absolute position used for position checks
3541		this.positionAbs = this._convertPositionTo("absolute");
3542
3543		//Set the helper position
3544		if(!this.options.axis || this.options.axis != "y") this.helper[0].style.left = this.position.left+'px';
3545		if(!this.options.axis || this.options.axis != "x") this.helper[0].style.top = this.position.top+'px';
3546
3547		//Rearrange
3548		for (var i = this.items.length - 1; i >= 0; i--) {
3549
3550			//Cache variables and intersection, continue if no intersection
3551			var item = this.items[i], itemElement = item.item[0], intersection = this._intersectsWithPointer(item);
3552			if (!intersection) continue;
3553
3554			if(itemElement != this.currentItem[0] //cannot intersect with itself
3555				&&	this.placeholder[intersection == 1 ? "next" : "prev"]()[0] != itemElement //no useless actions that have been done before
3556				&&	!$.ui.contains(this.placeholder[0], itemElement) //no action if the item moved is the parent of the item checked
3557				&& (this.options.type == 'semi-dynamic' ? !$.ui.contains(this.element[0], itemElement) : true)
3558			) {
3559
3560				this.direction = intersection == 1 ? "down" : "up";
3561
3562				if (this.options.tolerance == "pointer" || this._intersectsWithSides(item)) {
3563					this._rearrange(event, item);
3564				} else {
3565					break;
3566				}
3567
3568				this._trigger("change", event, this._uiHash());
3569				break;
3570			}
3571		}
3572
3573		//Post events to containers
3574		this._contactContainers(event);
3575
3576		//Interconnect with droppables
3577		if($.ui.ddmanager) $.ui.ddmanager.drag(this, event);
3578
3579		//Call callbacks
3580		this._trigger('sort', event, this._uiHash());
3581
3582		this.lastPositionAbs = this.positionAbs;
3583		return false;
3584
3585	},
3586
3587	_mouseStop: function(event, noPropagation) {
3588
3589		if(!event) return;
3590
3591		//If we are using droppables, inform the manager about the drop
3592		if ($.ui.ddmanager && !this.options.dropBehaviour)
3593			$.ui.ddmanager.drop(this, event);
3594
3595		if(this.options.revert) {
3596			var self = this;
3597			var cur = self.placeholder.offset();
3598
3599			self.reverting = true;
3600
3601			$(this.helper).animate({
3602				left: cur.left - this.offset.parent.left - self.margins.left + (this.offsetParent[0] == document.body ? 0 : this.offsetParent[0].scrollLeft),
3603				top: cur.top - this.offset.parent.top - self.margins.top + (this.offsetParent[0] == document.body ? 0 : this.offsetParent[0].scrollTop)
3604			}, parseInt(this.options.revert, 10) || 500, function() {
3605				self._clear(event);
3606			});
3607		} else {
3608			this._clear(event, noPropagation);
3609		}
3610
3611		return false;
3612
3613	},
3614
3615	cancel: function() {
3616
3617		var self = this;
3618
3619		if(this.dragging) {
3620
3621			this._mouseUp();
3622
3623			if(this.options.helper == "original")
3624				this.currentItem.css(this._storedCSS).removeClass("ui-sortable-helper");
3625			else
3626				this.currentItem.show();
3627
3628			//Post deactivating events to containers
3629			for (var i = this.containers.length - 1; i >= 0; i--){
3630				this.containers[i]._trigger("deactivate", null, self._uiHash(this));
3631				if(this.containers[i].containerCache.over) {
3632					this.containers[i]._trigger("out", null, self._uiHash(this));
3633					this.containers[i].containerCache.over = 0;
3634				}
3635			}
3636
3637		}
3638
3639		//$(this.placeholder[0]).remove(); would have been the jQuery way - unfortunately, it unbinds ALL events from the original node!
3640		if(this.placeholder[0].parentNode) this.placeholder[0].parentNode.removeChild(this.placeholder[0]);
3641		if(this.options.helper != "original" && this.helper && this.helper[0].parentNode) this.helper.remove();
3642
3643		$.extend(this, {
3644			helper: null,
3645			dragging: false,
3646			reverting: false,
3647			_noFinalSort: null
3648		});
3649
3650		if(this.domPosition.prev) {
3651			$(this.domPosition.prev).after(this.currentItem);
3652		} else {
3653			$(this.domPosition.parent).prepend(this.currentItem);
3654		}
3655
3656		return true;
3657
3658	},
3659
3660	serialize: function(o) {
3661
3662		var items = this._getItemsAsjQuery(o && o.connected);
3663		var str = []; o = o || {};
3664
3665		$(items).each(function() {
3666			var res = ($(o.item || this).attr(o.attribute || 'id') || '').match(o.expression || (/(.+)[-=_](.+)/));
3667			if(res) str.push((o.key || res[1]+'[]')+'='+(o.key && o.expression ? res[1] : res[2]));
3668		});
3669
3670		return str.join('&');
3671
3672	},
3673
3674	toArray: function(o) {
3675
3676		var items = this._getItemsAsjQuery(o && o.connected);
3677		var ret = []; o = o || {};
3678
3679		items.each(function() { ret.push($(o.item || this).attr(o.attribute || 'id') || ''); });
3680		return ret;
3681
3682	},
3683
3684	/* Be careful with the following core functions */
3685	_intersectsWith: function(item) {
3686
3687		var x1 = this.positionAbs.left,
3688			x2 = x1 + this.helperProportions.width,
3689			y1 = this.positionAbs.top,
3690			y2 = y1 + this.helperProportions.height;
3691
3692		var l = item.left,
3693			r = l + item.width,
3694			t = item.top,
3695			b = t + item.height;
3696
3697		var dyClick = this.offset.click.top,
3698			dxClick = this.offset.click.left;
3699
3700		var isOverElement = (y1 + dyClick) > t && (y1 + dyClick) < b && (x1 + dxClick) > l && (x1 + dxClick) < r;
3701
3702		if(	   this.options.tolerance == "pointer"
3703			|| this.options.forcePointerForContainers
3704			|| (this.options.tolerance != "pointer" && this.helperProportions[this.floating ? 'width' : 'height'] > item[this.floating ? 'width' : 'height'])
3705		) {
3706			return isOverElement;
3707		} else {
3708
3709			return (l < x1 + (this.helperProportions.width / 2) // Right Half
3710				&& x2 - (this.helperProportions.width / 2) < r // Left Half
3711				&& t < y1 + (this.helperProportions.height / 2) // Bottom Half
3712				&& y2 - (this.helperProportions.height / 2) < b ); // Top Half
3713
3714		}
3715	},
3716
3717	_intersectsWithPointer: function(item) {
3718
3719		var isOverElementHeight = $.ui.isOverAxis(this.positionAbs.top + this.offset.click.top, item.top, item.height),
3720			isOverElementWidth = $.ui.isOverAxis(this.positionAbs.left + this.offset.click.left, item.left, item.width),
3721			isOverElement = isOverElementHeight && isOverElementWidth,
3722			verticalDirection = this._getDragVerticalDirection(),
3723			horizontalDirection = this._getDragHorizontalDirection();
3724
3725		if (!isOverElement)
3726			return false;
3727
3728		return this.floating ?
3729			( ((horizontalDirection && horizontalDirection == "right") || verticalDirection == "down") ? 2 : 1 )
3730			: ( verticalDirection && (verticalDirection == "down" ? 2 : 1) );
3731
3732	},
3733
3734	_intersectsWithSides: function(item) {
3735
3736		var isOverBottomHalf = $.ui.isOverAxis(this.positionAbs.top + this.offset.click.top, item.top + (item.height/2), item.height),
3737			isOverRightHalf = $.ui.isOverAxis(this.positionAbs.left + this.offset.click.left, item.left + (item.width/2), item.width),
3738			verticalDirection = this._getDragVerticalDirection(),
3739			horizontalDirection = this._getDragHorizontalDirection();
3740
3741		if (this.floating && horizontalDirection) {
3742			return ((horizontalDirection == "right" && isOverRightHalf) || (horizontalDirection == "left" && !isOverRightHalf));
3743		} else {
3744			return verticalDirection && ((verticalDirection == "down" && isOverBottomHalf) || (verticalDirection == "up" && !isOverBottomHalf));
3745		}
3746
3747	},
3748
3749	_getDragVerticalDirection: function() {
3750		var delta = this.positionAbs.top - this.lastPositionAbs.top;
3751		return delta != 0 && (delta > 0 ? "down" : "up");
3752	},
3753
3754	_getDragHorizontalDirection: function() {
3755		var delta = this.positionAbs.left - this.lastPositionAbs.left;
3756		return delta != 0 && (delta > 0 ? "right" : "left");
3757	},
3758
3759	refresh: function(event) {
3760		this._refreshItems(event);
3761		this.refreshPositions();
3762	},
3763
3764	_connectWith: function() {
3765		var options = this.options;
3766		return options.connectWith.constructor == String
3767			? [options.connectWith]
3768			: options.connectWith;
3769	},
3770	
3771	_getItemsAsjQuery: function(connected) {
3772
3773		var self = this;
3774		var items = [];
3775		var queries = [];
3776		var connectWith = this._connectWith();
3777
3778		if(connectWith && connected) {
3779			for (var i = connectWith.length - 1; i >= 0; i--){
3780				var cur = $(connectWith[i]);
3781				for (var j = cur.length - 1; j >= 0; j--){
3782					var inst = $.data(cur[j], 'sortable');
3783					if(inst && inst != this && !inst.options.disabled) {
3784						queries.push([$.isFunction(inst.options.items) ? inst.options.items.call(inst.element) : $(inst.options.items, inst.element).not(".ui-sortable-helper"), inst]);
3785					}
3786				};
3787			};
3788		}
3789
3790		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"), this]);
3791
3792		for (var i = queries.length - 1; i >= 0; i--){
3793			queries[i][0].each(function() {
3794				items.push(this);
3795			});
3796		};
3797
3798		return $(items);
3799
3800	},
3801
3802	_removeCurrentsFromItems: function() {
3803
3804		var list = this.currentItem.find(":data(sortable-item)");
3805
3806		for (var i=0; i < this.items.length; i++) {
3807
3808			for (var j=0; j < list.length; j++) {
3809				if(list[j] == this.items[i].item[0])
3810					this.items.splice(i,1);
3811			};
3812
3813		};
3814
3815	},
3816
3817	_refreshItems: function(event) {
3818
3819		this.items = [];
3820		this.containers = [this];
3821		var items = this.items;
3822		var self = this;
3823		var queries = [[$.isFunction(this.options.items) ? this.options.items.call(this.element[0], event, { item: this.currentItem }) : $(this.options.items, this.element), this]];
3824		var connectWith = this._connectWith();
3825
3826		if(connectWith) {
3827			for (var i = connectWith.length - 1; i >= 0; i--){
3828				var cur = $(connectWith[i]);
3829				for (var j = cur.length - 1; j >= 0; j--){
3830					var inst = $.data(cur[j], 'sortable');
3831					if(inst && inst != this && !inst.options.disabled) {
3832						queries.push([$.isFunction(inst.options.items) ? inst.options.items.call(inst.element[0], event, { item: this.currentItem }) : $(inst.options.items, inst.element), inst]);
3833						this.containers.push(inst);
3834					}
3835				};
3836			};
3837		}
3838
3839		for (var i = queries.length - 1; i >= 0; i--) {
3840			var targetData = queries[i][1];
3841			var _queries = queries[i][0];
3842
3843			for (var j=0, queriesLength = _queries.length; j < queriesLength; j++) {
3844				var item = $(_queries[j]);
3845
3846				item.data('sortable-item', targetData); // Data for target checking (mouse manager)
3847
3848				items.push({
3849					item: item,
3850					instance: targetData,
3851					width: 0, height: 0,
3852					left: 0, top: 0
3853				});
3854			};
3855		};
3856
3857	},
3858
3859	refreshPositions: function(fast) {
3860
3861		//This has to be redone because due to the item being moved out/into the offsetParent, the offsetParent's position will change
3862		if(this.offsetParent && this.helper) {
3863			this.offset.parent = this._getParentOffset();
3864		}
3865
3866		for (var i = this.items.length - 1; i >= 0; i--){
3867			var item = this.items[i];
3868
3869			//We ignore calculating positions of all connected containers when we're not over them
3870			if(item.instance != this.currentContainer && this.currentContainer && item.item[0] != this.currentItem[0])
3871				continue;
3872
3873			var t = this.options.toleranceElement ? $(this.options.toleranceElement, item.item) : item.item;
3874
3875			if (!fast) {
3876				item.width = t.outerWidth();
3877				item.height = t.outerHeight();
3878			}
3879
3880			var p = t.offset();
3881			item.left = p.left;
3882			item.top = p.top;
3883		};
3884
3885		if(this.options.custom && this.options.custom.refreshContainers
3885) {
3886			this.options.custom.refreshContainers.call(this);
3887		} else {
3888			for (var i = this.containers.length - 1; i >= 0; i--){
3889				var p = this.containers[i].element.offset();
3890				this.containers[i].containerCache.left = p.left;
3891				this.containers[i].containerCache.top = p.top;
3892				this.containers[i].containerCache.width	= this.containers[i].element.outerWidth();
3893				this.containers[i].containerCache.height = this.containers[i].element.outerHeight();
3894			};
3895		}
3896
3897	},
3898
3899	_createPlaceholder: function(that) {
3900
3901		var self = that || this, o = self.options;
3902
3903		if(!o.placeholder || o.placeholder.constructor == String) {
3904			var className = o.placeholder;
3905			o.placeholder = {
3906				element: function() {
3907
3908					var el = $(document.createElement(self.currentItem[0].nodeName))
3909						.addClass(className || self.currentItem[0].className+" ui-sortable-placeholder")
3910						.removeClass("ui-sortable-helper")[0];
3911
3912					if(!className)
3913						el.style.visibility = "hidden";
3914
3915					return el;
3916				},
3917				update: function(container, p) {
3918
3919					// 1. If a className is set as 'placeholder option, we don't force sizes - the class is responsible for that
3920					// 2. The option 'forcePlaceholderSize can be enabled to force it even if a class name is specified
3921					if(className && !o.forcePlaceholderSize) return;
3922
3923					//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
3924					if(!p.height()) { p.height(self.currentItem.innerHeight() - parseInt(self.currentItem.css('paddingTop')||0, 10) - parseInt(self.currentItem.css('paddingBottom')||0, 10)); };
3925					if(!p.width()) { p.width(self.currentItem.innerWidth() - parseInt(self.currentItem.css('paddingLeft')||0, 10) - parseInt(self.currentItem.css('paddingRight')||0, 10)); };
3926				}
3927			};
3928		}
3929
3930		//Create the placeholder
3931		self.placeholder = $(o.placeholder.element.call(self.element, self.currentItem));
3932
3933		//Append it after the actual current item
3934		self.currentItem.after(self.placeholder);
3935
3936		//Update the size of the placeholder (TODO: Logic to fuzzy, see line 316/317)
3937		o.placeholder.update(self, self.placeholder);
3938
3939	},
3940
3941	_contactContainers: function(event) {
3942		for (var i = this.containers.length - 1; i >= 0; i--){
3943
3944			if(this._intersectsWith(this.containers[i].containerCache)) {
3945				if(!this.containers[i].containerCache.over) {
3946
3947					if(this.currentContainer != this.containers[i]) {
3948
3949						//When entering a new container, we will find the item with the least distance and append our item near it
3950						var dist = 10000; var itemWithLeastDistance = null; var base = this.positionAbs[this.containers[i].floating ? 'left' : 'top'];
3951						for (var j = this.items.length - 1; j >= 0; j--) {
3952							if(!$.ui.contains(this.containers[i].element[0], this.items[j].item[0])) continue;
3953							var cur = this.items[j][this.containers[i].floating ? 'left' : 'top'];
3954							if(Math.abs(cur - base) < dist) {
3955								dist = Math.abs(cur - base); itemWithLeastDistance = this.items[j];
3956							}
3957						}
3958
3959						if(!itemWithLeastDistance && !this.options.dropOnEmpty) //Check if dropOnEmpty is enabled
3960							continue;
3961
3962						this.currentContainer = this.containers[i];
3963						itemWithLeastDistance ? this._rearrange(event, itemWithLeastDistance, null, true) : this._rearrange(event, null, this.containers[i].element, true);
3964						this._trigger("change", event, this._uiHash());
3965						this.containers[i]._trigger("change", event, this._uiHash(this));
3966
3967						//Update the placeholder
3968						this.options.placeholder.update(this.currentContainer, this.placeholder);
3969
3970					}
3971
3972					this.containers[i]._trigger("over", event, this._uiHash(this));
3973					this.containers[i].containerCache.over = 1;
3974				}
3975			} else {
3976				if(this.containers[i].containerCache.over) {
3977					this.containers[i]._trigger("out", event, this._uiHash(this));
3978					this.containers[i].containerCache.over = 0;
3979				}
3980			}
3981
3982		};
3983	},
3984
3985	_createHelper: function(event) {
3986
3987		var o = this.options;
3988		var helper = $.isFunction(o.helper) ? $(o.helper.apply(this.element[0], [event, this.currentItem])) : (o.helper == 'clone' ? this.currentItem.clone() : this.currentItem);
3989
3990		if(!helper.parents('body').length) //Add the helper to the DOM if that didn't happen already
3991			$(o.appendTo != 'parent' ? o.appendTo : this.currentItem[0].parentNode)[0].appendChild(helper[0]);
3992
3993		if(helper[0] == this.currentItem[0])
3994			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") };
3995
3996		if(helper[0].style.width == '' || o.forceHelperSize) helper.width(this.currentItem.width());
3997		if(helper[0].style.height == '' || o.forceHelperSize) helper.height(this.currentItem.height());
3998
3999		return helper;
4000
4001	},
4002
4003	_adjustOffsetFromHelper: function(obj) {
4004		if(obj.left != undefined) this.offset.click.left = obj.left + this.margins.left;
4005		if(obj.right != undefined) this.offset.click.left = this.helperProportions.width - obj.right + this.margins.left;
4006		if(obj.top != undefined) this.offset.click.top = obj.top + this.margins.top;
4007		if(obj.bottom != undefined) this.offset.click.top = this.helperProportions.height - obj.bottom + this.margins.top;
4008	},
4009
4010	_getParentOffset: function() {
4011
4012
4013		//Get the offsetParent and cache its position
4014		this.offsetParent = this.helper.offsetParent();
4015		var po = this.offsetParent.offset();
4016
4017		// This is a special case where we need to modify a offset calculated on start, since the following happened:
4018		// 1. The position of the helper is absolute, so it's position is calculated based on the next positioned parent
4019		// 2. The actual offset parent is a child of the scroll parent, and the scroll parent isn't the document, which means that
4020		//    the scroll is included in the initial calculation of the offset of the parent, and never recalculated upon drag
4021		if(this.cssPosition == 'absolute' && this.scrollParent[0] != document && $.ui.contains(this.scrollParent[0], this.offsetParent[0])) {
4022			po.left += this.scrollParent.scrollLeft();
4023			po.top += this.scrollParent.scrollTop();
4024		}
4025
4026		if((this.offsetParent[0] == document.body) //This needs to be actually done for all browsers, since pageX/pageY includes this information
4027		|| (this.offsetParent[0].tagName && this.offsetParent[0].tagName.toLowerCase() == 'html' && $.browser.msie)) //Ugly IE fix
4028			po = { top: 0, left: 0 };
4029
4030		return {
4031			top: po.top + (parseInt(this.offsetParent.css("borderTopWidth"),
403110) || 0),
4032			left: po.left + (parseInt(this.offsetParent.css("borderLeftWidth"),10) || 0)
4033		};
4034
4035	},
4036
4037	_getRelativeOffset: function() {
4038
4039		if(this.cssPosition == "relative") {
4040			var p = this.currentItem.position();
4041			return {
4042				top: p.top - (parseInt(this.helper.css("top"),10) || 0) + this.scrollParent.scrollTop(),
4043				left: p.left - (parseInt(this.helper.css("left"),10) || 0) + this.scrollParent.scrollLeft()
4044			};
4045		} else {
4046			return { top: 0, left: 0 };
4047		}
4048
4049	},
4050
4051	_cacheMargins: function() {
4052		this.margins = {
4053			left: (parseInt(this.currentItem.css("marginLeft"),10) || 0),
4054			top: (parseInt(this.currentItem.css("marginTop"),10) || 0)
4055		};
4056	},
4057
4058	_cacheHelperProportions: function() {
4059		this.helperProportions = {
4060			width: this.helper.outerWidth(),
4061			height: this.helper.outerHeight()
4062		};
4063	},
4064
4065	_setContainment: function() {
4066
4067		var o = this.options;
4068		if(o.containment == 'parent') o.containment = this.helper[0].parentNode;
4069		if(o.containment == 'document' || o.containment == 'window') this.containment = [
4070			0 - this.offset.relative.left - this.offset.parent.left,
4071			0 - this.offset.relative.top - this.offset.parent.top,
4072			$(o.containment == 'document' ? document : window).width() - this.helperProportions.width - this.margins.left,
4073			($(o.containment == 'document' ? document : window).height() || document.body.parentNode.scrollHeight) - this.helperProportions.height - this.margins.top
4074		];
4075
4076		if(!(/^(document|window|parent)$/).test(o.containment)) {
4077			var ce = $(o.containment)[0];
4078			var co = $(o.containment).offset();
4079			var over = ($(ce).css("overflow") != 'hidden');
4080
4081			this.containment = [
4082				co.left + (parseInt($(ce).css("borderLeftWidth"),10) || 0) + (parseInt($(ce).css("paddingLeft"),10) || 0) - this.margins.left,
4083				co.top + (parseInt($(ce).css("borderTopWidth"),10) || 0) + (parseInt($(ce).css("paddingTop"),10) || 0) - this.margins.top,
4084				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,
4085				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
4086			];
4087		}
4088
4089	},
4090
4091	_convertPositionTo: function(d, pos) {
4092
4093		if(!pos) pos = this.position;
4094		var mod = d == "absolute" ? 1 : -1;
4095		var o = this.options, scroll = this.cssPosition == 'absolute' && !(this.scrollParent[0] != document && $.ui.contains(this.scrollParent[0], this.offsetParent[0])) ? this.offsetParent : this.scrollParent, scrollIsRootNode = (/(html|body)/i).test(scroll[0].tagName);
4096
4097		return {
4098			top: (
4099				pos.top																	// The absolute mouse position
4100				+ this.offset.relative.top * mod										// Only for relative positioned nodes: Relative offset from element to offset parent
4101				+ this.offset.parent.top * mod											// The offsetParent's offset without borders (offset + border)
4102				- ($.browser.safari && this.cssPosition == 'fixed' ? 0 : ( this.cssPosition == 'fixed' ? -this.scrollParent.scrollTop() : ( scrollIsRootNode ? 0 : scroll.scrollTop() ) ) * mod)
4103			),
4104			left: (
4105				pos.left																// The absolute mouse position
4106				+ this.offset.relative.left * mod										// Only for relative positioned nodes: Relative offset from element to offset parent
4107				+ this.offset.parent.left * mod											// The offsetParent's offset without borders (offset + border)
4108				- ($.browser.safari && this.cssPosition == 'fixed' ? 0 : ( this.cssPosition == 'fixed' ? -this.scrollParent.scrollLeft() : scrollIsRootNode ? 0 : scroll.scrollLeft() ) * mod)
4109			)
4110		};
4111
4112	},
4113
4114	_generatePosition: function(event) {
4115
4116		var o = this.options, scroll = this.cssPosition == 'absolute' && !(this.scrollParent[0] != document && $.ui.contains(this.scrollParent[0], this.offsetParent[0])) ? this.offsetParent : this.scrollParent, scrollIsRootNode = (/(html|body)/i).test(scroll[0].tagName);
4117
4118		// This is another very weird special case that only happens for relative elements:
4119		// 1. If the css position is relative
4120		// 2. and the scroll parent is the document or similar to the offset parent
4121		// we have to refresh the relative offset during the scroll so there are no jumps
4122		if(this.cssPosition == 'relative' && !(this.scrollParent[0] != document && this.scrollParent[0] != this.offsetParent[0])) {
4123			this.offset.relative = this._getRelativeOffset();
4124		}
4125
4126		var pageX = event.pageX;
4127		var pageY = event.pageY;
4128
4129		/*
4130		 * - Position constraining -
4131		 * Constrain the position to a mix of grid, containment.
4132		 */
4133
4134		if(this.originalPosition) { //If we are not dragging yet, we won't check for options
4135
4136			if(this.containment) {
4137				if(event.pageX - this.offset.click.left < this.containment[0]) pageX = this.containment[0] + this.offset.click.left;
4138				if(event.pageY - this.offset.click.top < this.containment[1]) pageY = this.containment[1] + this.offset.click.top;
4139				if(event.pageX - this.offset.click.left > this.containment[2]) pageX = this.containment[2] + this.offset.click.left;
4140				if(event.pageY - this.offset.click.top > this.containment[3]) pageY = this.containment[3] + this.offset.click.top;
4141			}
4142
4143			if(o.grid) {
4144				var top = this.originalPageY + Math.round((pageY - this.originalPageY) / o.grid[1]) * o.grid[1];
4145				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;
4146
4147				var left = this.originalPageX + Math.round((pageX - this.originalPageX) / o.grid[0]) * o.grid[0];
4148				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;
4149			}
4150
4151		}
4152
4153		return {
4154			top: (
4155				pageY																// The absolute mouse position
4156				- this.offset.click.top													// Click offset (relative to the element)
4157				- this.offset.relative.top												// Only for relative positioned nodes: Relative offset from element to offset parent
4158				- this.offset.parent.top												// The offsetParent's offset without borders (offset + border)
4159				+ ($.browser.safari && this.cssPosition == 'fixed' ? 0 : ( this.cssPosition == 'fixed' ? -this.scrollParent.scrollTop() : ( scrollIsRootNode ? 0 : scroll.scrollTop() ) ))
4160			),
4161			left: (
4162				pageX																// The absolute mouse position
4163				- this.offset.click.left												// Click offset (relative to the element)
4164				- this.offset.relative.left												// Only for relative positioned nodes: Relative offset from element to offset parent
4165				- this.offset.parent.left												// The offsetParent's offset without borders (offset + border)
4166				+ ($.browser.safari && this.cssPosition == 'fixed' ? 0 : ( this.cssPosition == 'fixed' ? -this.scrollParent.scrollLeft() : scrollIsRootNode ? 0 : scroll.scrollLeft() ))
4167			)
4168		};
4169
4170	},
4171
4172	_rearrange: function(event, i, a, hardRefresh) {
4173
4174		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));
4175
4176		//Various things done here to improve the performance:
4177		// 1. we create a setTimeout, that calls refreshPositions
4178		// 2. on the instance, we have a counter variable, that get's higher after every append
4179		// 3. on the local scope, we copy the counter variable, and check in the timeout, if it's still the same
4180		// 4. this lets only the last addition to the timeout stack through
4181		this.counter = this.counter ? ++this.counter : 1;
4182		var self = this, counter = this.counter;
4183
4184		window.setTimeout(function() {
4185			if(counter == self.counter) self.refreshPositions(!hardRefresh); //Precompute after each DOM insertion, NOT on mousemove
4186		},0);
4187
4188	},
4189
4190	_clear: function(event, noPropagation) {
4191
4192		this.reverting = false;
4193		// We delay all events that have to be triggered to after the point where the placeholder has been removed and
4194		// everything else normalized again
4195		var delayedTriggers = [], self = this;
4196
4197		// We first have to update the dom position of the actual currentItem
4198		// Note: don't do it if the current item is already removed (by a user), or it gets reappended (see #4088)
4199		if(!this._noFinalSort && this.currentItem[0].parentNode) this.placeholder.before(this.currentItem);
4200		this._noFinalSort = null;
4201
4202		if(this.helper[0] == this.currentItem[0]) {
4203			for(var i in this._storedCSS) {
4204				if(this._storedCSS[i] == 'auto' || this._storedCSS[i] == 'static') this._storedCSS[i] = '';
4205			}
4206			this.currentItem.css(this._storedCSS).removeClass("ui-sortable-helper");
4207		} else {
4208			this.currentItem.show();
4209		}
4210
4211		if(this.fromOutside && !noPropagation) delayedTriggers.push(function(event) { this._trigger("receive", event, this._uiHash(this.fromOutside)); });
4212		if((this.fromOutside || this.domPosition.prev != this.currentItem.prev().not(".ui-sortable-helper")[0] || this.domPosition.parent != this.currentItem.parent()[0]) && !noPropagation) delayedTriggers.push(function(event) { this._trigger("update", event, this._uiHash()); }); //Trigger update callback if the DOM position has changed
4213		if(!$.ui.contains(this.element[0], this.currentItem[0])) { //Node was moved out of the current element
4214			if(!noPropagation) delayedTriggers.push(function(event) { this._trigger("remove", event, this._uiHash()); });
4215			for (var i = this.containers.length - 1; i >= 0; i--){
4216				if($.ui.contains(this.containers[i].element[0], this.currentItem[0]) && !noPropagation) {
4217					delayedTriggers.push((function(c) { return function(event) { c._trigger("receive", event, this._uiHash(this)); };  }).call(this, this.containers[i]));
4218					delayedTriggers.push((function(c) { return function(event) { c._trigger("update", event, this._uiHash(this));  }; }).call(this, this.containers[i]));
4219				}
4220			};
4221		};
4222
4223		//Post events to containers
4224		for (var i = this.containers.length - 1; i >= 0; i--){
4225			if(!noPropagation) delayedTriggers.push((function(c) { return function(event) { c._trigger("deactivate", event, this._uiHash(this)); };  }).call(this, this.containers[i]));
4226			if(this.containers[i].containerCache.over) {
4227				delayedTriggers.push((function(c) { return function(event) { c._trigger("out", event, this._uiHash(this)); };  }).call(this, this.containers[i]));
4228				this.containers[i].containerCache.over = 0;
4229			}
4230		}
4231
4232		//Do what was originally in plugins
4233		if(this._storedCursor) $('body').css("cursor", this._storedCursor); //Reset cursor
4234		if(this._storedOpacity) this.helper.css("opacity", this._storedOpacity); //Reset cursor
4235		if(this._storedZIndex) this.helper.css("zIndex", this._storedZIndex == 'auto' ? '' : this._storedZIndex); //Reset z-index
4236
4237		this.dragging = false;
4238		if(this.cancelHelperRemoval) {
4239			if(!noPropagation) {
4240				this._trigger("beforeStop", event, this._uiHash());
4241				for (var i=0; i < delayedTriggers.length; i++) { delayedTriggers[i].call(this, event); }; //Trigger all delayed events
4242				this._trigger("stop", event, this._uiHash());
4243			}
4244			return false;
4245		}
4246
4247		if(!noPropagation) this._trigger("beforeStop", event, this._uiHash());
4248
4249		//$(this.placeholder[0]).remove(); would have been the jQuery way - unfortunately, it unbinds ALL events from the original node!
4250		this.placeholder[0].parentNode.removeChild(this.placeholder[0]);
4251
4252		if(this.helper[0] != this.currentItem[0]) this.helper.remove(); this.helper = null;
4253
4254		if(!noPropagation) {
4255			for (var i=0; i < delayedTriggers.length; i++) { delayedTriggers[i].call(this, event); }; //Trigger all delayed events
4256			this._trigger("stop", event, this._uiHash());
4257		}
4258
4259		this.fromOutside = false;
4260		return true;
4261
4262	},
4263
4264	_trigger: function() {
4265		if ($.widget.prototype._trigger.apply(this, arguments) === false) {
4266			this.cancel();
4267		}
4268	},
4269
4270	_uiHash: function(inst) {
4271		var self = inst || this;
4272		return {
4273			helper: self.helper,
4274			placeholder: self.placeholder || $([]),
4275			position: self.position,
4276			absolutePosition: self.positionAbs, //deprecated
4277			offset: self.positionAbs,
4278			item: self.currentItem,
4279			sender: inst ? inst.element : null
4280		};
4281	}
4282
4283}));
4284
4285$.extend($.ui.sortable, {
4286	getter: "serialize toArray",
4287	version: "1.7.3",
4288	eventPrefix: "sort",
4289	defaults: {
4290		appendTo: "parent",
4291		axis: false,
4292		cancel: ":input,option",
4293		connectWith: false,
4294		containment: false,
4295		cursor: 'auto',
4296		cursorAt: false,
4297		delay: 0,
4298		distance: 1,
4299		dropOnEmpty: true,
4300		forcePlaceholderSize: false,
4301		forceHelperSize: false,
4302		grid: false,
4303		handle: false,
4304		helper: "original",
4305		items: '> *',
4306		opacity: false,
4307		placeholder: false,
4308		revert: false,
4309		scroll: true,
4310		scrollSensitivity: 20,
4311		scrollSpeed: 20,
4312		scope: "default",
4313		tolerance: "intersect",
4314		zIndex: 1000
4315	}
4316});
4317
4318})(jQuery);
4319/*
4320 * jQuery UI Accordion 1.7.3
4321 *
4322 * Copyright (c) 2009 AUTHORS.txt (https://jqueryui.com/about)
4323 * Dual licensed under the MIT (MIT-LICENSE.txt)
4324 * and GPL (GPL-LICENSE.txt) licenses.
4325 *
4326 * https://docs.jquery.com/UI/Accordion
4327 *
4328 * Depends:
4329 *	ui.core.js
4330 */
4331(function($) {
4332
4333$.widget("ui.accordion", {
4334
4335	_init: function() {
4336
4337		var o = this.options, self = this;
4338		this.running = 0;
4339
4340		// if the user set the alwaysOpen option on init
4341		// then we need to set the collapsible option
4342		// if they set both on init, collapsible will take priority
4343		if (o.collapsible == $.ui.accordion.defaults.collapsible &&
4344			o.alwaysOpen != $.ui.accordion.defaults.alwaysOpen) {
4345			o.collapsible = !o.alwaysOpen;
4346		}
4347
4348		if ( o.navigation ) {
4349			var current = this.element.find("a").filter(o.navigationFilter);
4350			if ( current.length ) {
4351				if ( current.filter(o.header).length ) {
4352					this.active = current;
4353				} else {
4354					this.active = current.parent().parent().prev();
4355					current.addClass("ui-accordion-content-active");
4356				}
4357			}
4358		}
4359
4360		this.element.addClass("ui-accordion ui-widget ui-helper-reset");
4361		
4362		// in lack of child-selectors in CSS we need to mark top-LIs in a UL-accordion for some IE-fix
4363		if (this.element[0].nodeName == "UL") {
4364			this.element.children("li").addClass("ui-accordion-li-fix");
4365		}
4366
4367		this.headers = this.element.find(o.header).addClass("ui-accordion-header ui-helper-reset ui-state-default ui-corner-all")
4368			.bind("mouseenter.accordion", function(){ $(this).addClass('ui-state-hover'); })
4369			.bind("mouseleave.accordion", function(){ $(this).removeClass('ui-state-hover'); })
4370			.bind("focus.accordion", function(){ $(this).addClass('ui-state-focus'); })
4371			.bind("blur.accordion", function(){ $(this).removeClass('ui-state-focus'); });
4372
4373		this.headers
4374			.next()
4375				.addClass("ui-accordion-content ui-helper-reset ui-widget-content ui-corner-bottom");
4376
4377		this.active = this._findActive(this.active || o.active).toggleClass("ui-state-default").toggleClass("ui-state-active").toggleClass("ui-corner-all").toggleClass("ui-corner-top");
4378		this.active.next().addClass('ui-accordion-content-active');
4379
4380		//Append icon elements
4381		$("<span/>").addClass("ui-icon " + o.icons.header).prependTo(this.headers);
4382		this.active.find(".ui-icon").toggleClass(o.icons.header).toggleClass(o.icons.headerSelected);
4383
4384		// IE7-/Win - Extra vertical space in lists fixed
4385		if ($.browser.msie) {
4386			this.element.find('a').css('zoom', '1');
4387		}
4388
4389		this.resize();
4390
4391		//ARIA
4392		this.element.attr('role','tablist');
4393
4394		this.headers
4395			.attr('role','tab')
4396			.bind('keydown', function(event) { return self._keydown(event); })
4397			.next()
4398			.attr('role','tabpanel');
4399
4400		this.headers
4401			.not(this.active || "")
4402			.attr('aria-expanded','false')
4403			.attr("tabIndex", "-1")
4404			.next()
4405			.hide();
4406
4407		// make sure at least one header is in the tab order
4408		if (!this.active.length) {
4409			this.headers.eq(0).attr('tabIndex','0');
4410		} else {
4411			this.active
4412				.attr('aria-expanded','true')
4413				.attr('tabIndex', '0');
4414		}
4415
4416		// only need links in taborder for Safari
4417		if (!$.browser.safari)
4418			this.headers.find('a').attr('tabIndex','-1');
4419
4420		if (o.event) {
4421			this.headers.bind((o.event) + ".accordion", function(event) { return self._clickHandler.call(self, event, this); });
4422		}
4423
4424	},
4425
4426	destroy: function() {
4427		var o = this.options;
4428
4429		this.element
4430			.removeClass("ui-accordion ui-widget ui-helper-reset")
4431			.removeAttr("role")
4432			.unbind('.accordion')
4433			.removeData('accordion');
4434
4435		this.headers
4436			.unbind(".accordion")
4437			.removeClass("ui-accordion-header ui-helper-reset ui-state-default ui-corner-all ui-state-active ui-corner-top")
4438			.removeAttr("role").removeAttr("aria-expanded").removeAttr("tabindex");
4439
4440		this.headers.find("a").removeAttr("tabindex");
4441		this.headers.children(".ui-icon").remove();
4442		var contents = this.headers.next().css("display", "").removeAttr("role").removeClass("ui-helper-reset ui-widget-content ui-corner-bottom ui-accordion-content ui-accordion-content-active");
4443		if (o.autoHeight || o.fillHeight) {
4444			contents.css("height", "");
4445		}
4446	},
4447	
4448	_setData: function(key, value) {
4449		if(key == 'alwaysOpen') { key = 'collapsible'; value = !value; }
4450		$.widget.prototype._setData.apply(this, arguments);	
4451	},
4452
4453	_keydown: function(event) {
4454
4455		var o = this.options, keyCode = $.ui.keyCode;
4456
4457		if (o.disabled || event.altKey || event.ctrlKey)
4458			return;
4459
4460		var length = this.headers.length;
4461		var currentIndex = this.headers.index(event.target);
4462		var toFocus = false;
4463
4464		switch(event.keyCode) {
4465			case keyCode.RIGHT:
4466			case keyCode.DOWN:
4467				toFocus = this.headers[(currentIndex + 1) % length];
4468				break;
4469			case keyCode.LEFT:
4470			case keyCode.UP:
4471				toFocus = this.headers[(currentIndex - 1 + length) % length];
4472				break;
4473			case keyCode.SPACE:
4474			case keyCode.ENTER:
4475				return this._clickHandler({ target: event.target }, event.target);
4476		}
4477
4478		if (toFocus) {
4479			$(event.target).attr('tabIndex','-1');
4480			$(toFocus).attr('tabIndex','0');
4481			toFocus.focus();
4482			return false;
4483		}
4484
4485		return true;
4486
4487	},
4488
4489	resize: function() {
4490
4491		var o = this.options, maxHeight;
4492
4493		if (o.fillSpace) {
4494			
4495			if($.browser.msie) { var defOverflow = this.element.parent().css('overflow'); this.element.parent().css('overflow', 'hidden'); }
4496			maxHeight = this.element.parent().height();
4497			if($.browser.msie) { this.element.parent().css('overflow', defOverflow); }
4498	
4499			this.headers.each(function() {
4500				maxHeight -= $(this).outerHeight();
4501			});
4502
4503			var maxPadding = 0;
4504			this.headers.next().each(function() {
4505				maxPadding = Math.max(maxPadding, $(this).innerHeight() - $(this).height());
4506			}).height(Math.max(0, maxHeight - maxPadding))
4507			.css('overflow', 'auto');
4508
4509		} else if ( o.autoHeight ) {
4510			maxHeight = 0;
4511			this.headers.next().each(function() {
4512				maxHeight = Math.max(maxHeight, $(this).outerHeight());
4513			}).height(maxHeight);
4514		}
4515
4516	},
4517
4518	activate: function(index) {
4519		// call clickHandler with custom event
4520		var active = this._findActive(index)[0];
4521		this._clickHandler({ target: active }, active);
4522	},
4523
4524	_findActive: function(selector) {
4525		return selector
4526			? typeof selector == "number"
4527				? this.headers.filter(":eq(" + selector + ")")
4528				: this.headers.not(this.headers.not(selector))
4529			: selector === false
4530				? $([])
4531				: this.headers.filter(":eq(0)");
4532	},
4533
4534	_clickHandler: function(event, target) {
4535
4536		var o = this.options;
4537		if (o.disabled) return false;
4538
4539		// called only when using activate(false) to close all parts programmatically
4540		if (!event.target && o.collapsible) {
4541			this.active.removeClass("ui-state-active ui-corner-top").addClass("ui-state-default ui-corner-all")
4542				.find(".ui-icon").removeClass(o.icons.headerSelected).addClass(o.icons.header);
4543			this.active.next().addClass('ui-accordion-content-active');
4544			var toHide = this.active.next(),
4545				data = {
4546					options: o,
4547					newHeader: $([]),
4548					oldHeader: o.active,
4549					newContent: $([]),
4550					oldContent: toHide
4551				},
4552				toShow = (this.active = $([]));
4553			this._toggle(toShow, toHide, data);
4554			return false;
4555		}
4556
4557		// get the click target
4558		var clicked = $(event.currentTarget || target);
4559		var clickedIsActive = clicked[0] == this.active[0];
4560
4561		// if animations are still active, or the active header is the target, ignore click
4562		if (this.running || (!o.collapsible && clickedIsActive)) {
4563			return false;
4564		}
4565
4566		// switch classes
4567		this.active.removeClass("ui-state-active ui-corner-top").addClass("ui-state-default ui-corner-all")
4568			.find(".ui-icon").removeClass(o.icons.headerSelected).addClass(o.icons.header);
4569		this.active.next().addClass('ui-accordion-content-active');
4570		if (!clickedIsActive) {
4571			clicked.removeClass("ui-state-default ui-corner-all").addClass("ui-state-active ui-corner-top")
4572				.find(".ui-icon").removeClass(o.icons.header).addClass(o.icons.headerSelected);
4573			clicked.next().addClass('ui-accordion-content-active');
4574		}
4575
4576		// find elements to show and hide
4577		var toShow = clicked.next(),
4578			toHide = this.active.next(),
4579			data = {
4580				options: o,
4581				newHeader: clickedIsActive && o.collapsible ? $([]) : clicked,
4582				oldHeader: this.active,
4583				newContent: clickedIsActive && o.collapsible ? $([]) : toShow.find('> *'),
4584				oldContent: toHide.find('> *')
4585			},
4586			down = this.headers.index( this.active[0] ) > this.headers.index( clicked[0] );
4587
4588		this.active = clickedIsActive ? $([]) : clicked;
4589		this._toggle(toShow, toHide, data, clickedIsActive, down);
4590
4591		return false;
4592
4593	},
4594
4595	_toggle: function(toShow, toHide, data, clickedIsActive, down) {
4596
4597		var o = this.options, self = this;
4598
4599		this.toShow = toShow;
4600		this.toHide = toHide;
4601		this.data = data;
4602
4603		var complete = function() { if(!self) return; return self._completed.apply(self, arguments); };
4604
4605		// trigger changestart event
4606		this._trigger("changestart", null, this.data);
4607
4608		// count elements to animate
4609		this.running = toHide.size() === 0 ? toShow.size() : toHide.size();
4610
4611		if (o.animated) {
4612
4613			var animOptions = {};
4614
4615			if ( o.collapsible && clickedIsActive ) {
4616				animOptions = {
4617					toShow: $([]),
4618					toHide: toHide,
4619					complete: complete,
4620					down: down,
4621					autoHeight: o.autoHeight || o.fillSpace
4622				};
4623			} else {
4624				animOptions = {
4625					toShow: toShow,
4626					toHide: toHide,
4627					complete: complete,
4628					down: down,
4629					autoHeight: o.autoHeight || o.fillSpace
4630				};
4631			}
4632
4633			if (!o.proxied) {
4634				o.proxied = o.animated;
4635			}
4636
4637			if (!o.proxiedDuration) {
4638				o.proxiedDuration = o.duration;
4639			}
4640
4641			o.animated = $.isFunction(o.proxied) ?
4642				o.proxied(animOptions) : o.proxied;
4643
4644			o.duration = $.isFunction(o.proxiedDuration) ?
4645				o.proxiedDuration(animOptions) : o.proxiedDuration;
4646
4647			var animations = $.ui.accordion.animations,
4648				duration = o.duration,
4649				easing = o.animated;
4650
4651			if (!animations[easing]) {
4652				animations[easing] = function(options) {
4653					this.slide(options, {
4654						easing: easing,
4655						duration: duration || 700
4656					});
4657				};
4658			}
4659
4660			animations[easing](animOptions);
4661
4662		} else {
4663
4664			if (o.collapsible && clickedIsActive) {
4665				toShow.toggle();
4666			} else {
4667				toHide.hide();
4668				toShow.show();
4669			}
4670
4671			complete(true);
4672
4673		}
4674
4675		toHide.prev().attr('aria-expanded','false').attr("tabIndex", "-1").blur();
4676		toShow.prev().attr('aria-expanded','true').attr("tabIndex", "0").focus();
4677
4678	},
4679
4680	_completed: function(cancel) {
4681
4682		var o = this.options;
4683
4684		this.running = cancel ? 0 : --this.running;
4685		if (this.running) return;
4686
4687		if (o.clearStyle) {
4688			this.toShow.add(this.toHide).css({
4689				height: "",
4690				overflow: ""
4691			});
4692		}
4693
4694		this._trigger('change', null, this.data);
4695	}
4696
4697});
4698
4699
4700$.extend($.ui.accordion, {
4701	version: "1.7.3",
4702	defaults: {
4703		active: null,
4704		alwaysOpen: true, //deprecated, use collapsible
4705		animated: 'slide',
4706		autoHeight: true,
4707		clearStyle: false,
4708		collapsible: false,
4709		event: "click",
4710		fillSpace: false,
4711		header: "> li > :first-child,> :not(li):even",
4712		icons: {
4713			header: "ui-icon-triangle-1-e",
4714			headerSelected: "ui-icon-triangle-1-s"
4715		},
4716		navigation: false,
4717		navigationFilter: function() {
4718			return this.href.toLowerCase() == location.href.toLowerCase();
4719		}
4720	},
4721	animations: {
4722		slide: function(options, additions) {
4723			options = $.extend({
4724				easing: "swing",
4725				duration: 300
4726			}, options, additions);
4727			if ( !options.toHide.size() ) {
4728				options.toShow.animate({height: "show"}, options);
4729				return;
4730			}
4731			if ( !options.toShow.size() ) {
4732				options.toHide.animate({height: "hide"}, options);
4733				return;
4734			}
4735			var overflow = options.toShow.css('overflow'),
4736				percentDone,
4737				showProps = {},
4738				hideProps = {},
4739				fxAttrs = [ "height", "paddingTop", "paddingBottom" ],
4740				originalWidth;
4741			// fix width before calculating height of hidden element
4742			var s = options.toShow;
4743			originalWidth = s[0].style.width;
4744			s.width( parseInt(s.parent().width(),10) - parseInt(s.css("paddingLeft"),10) - parseInt(s.css("paddingRight"),10) - (parseInt(s.css("borderLeftWidth"),10) || 0) - (parseInt(s.css("borderRightWidth"),10) || 0) );
4745			
4746			$.each(fxAttrs, function(i, prop) {
4747				hideProps[prop] = 'hide';
4748				
4749				var parts = ('' + $.css(options.toShow[0], prop)).match(/^([\d+-.]+)(.*)$/);
4750				showProps[prop] = {
4751					value: parts[1],
4752					unit: parts[2] || 'px'
4753				};
4754			});
4755			options.toShow.css({ height: 0, overflow: 'hidden' }).show();
4756			options.toHide.filter(":hidden").each(options.complete).end().filter(":visible").animate(hideProps,{
4757				step: function(now, settings) {
4758					// only calculate the percent when animating height
4759					// IE gets very inconsistent results when animating elements
4760					// with small values, which is common for padding
4761					if (settings.prop == 'height') {
4762						percentDone = (settings.now - settings.start) / (settings.end - settings.start);
4763					}
4764					
4765					options.toShow[0].style[settings.prop] =
4766						(percentDone * showProps[settings.prop].value) + showProps[settings.prop].unit;
4767				},
4768				duration: options.duration,
4769				easing: options.easing,
4770				complete: function() {
4771					if ( !options.autoHeight ) {
4772						options.toShow.css("height", "");
4773					}
4774					options.toShow.css("width", originalWidth);
4775					options.toShow.css({overflow: overflow});
4776					options.complete();
4777				}
4778			});
4779		},
4780		bounceslide: function(options) {
4781			this.slide(options, {
4782				easing: options.down ? "easeOutBounce" : "swing",
4783				duration: options.down ? 1000 : 200
4784			});
4785		},
4786		easeslide: function(options) {
4787			this.slide(options, {
4788				easing: "easeinout",
4789				duration: 700
4790			});
4791		}
4792	}
4793});
4794
4795})(jQuery);
4796/*
4797 * jQuery UI Dialog 1.7.3
4798 *
4799 * Copyright (c) 2009 AUTHORS.txt (https://jqueryui.com/about)
4800 * Dual licensed under the MIT (MIT-LICENSE.txt)
4801 * and GPL (GPL-LICENSE.txt) licenses.
4802 *
4803 * https://docs.jquery.com/UI/Dialog
4804 *
4805 * Depends:
4806 *	ui.core.js
4807 *	ui.draggable.js
4808 *	ui.resizable.js
4809 */
4810(function($) {
4811
4812var setDataSwitch = {
4813		dragStart: "start.draggable",
4814		drag: "drag.draggable",
4815		dragStop: "stop.draggable",
4816		maxHeight: "maxHeight.resizable",
4817		minHeight: "minHeight.resizable",
4818		maxWidth: "maxWidth.resizable",
4819		minWidth: "minWidth.resizable",
4820		resizeStart: "start.resizable",
4821		resize: "drag.resizable",
4822		resizeStop: "stop.resizable"
4823	},
4824	
4825	uiDialogClasses =
4826		'ui-dialog ' +
4827		'ui-widget ' +
4828		'ui-widget-content ' +
4829		'ui-corner-all ';
4830
4831$.widget("ui.dialog", {
4832
4833	_init: function() {
4834		this.originalTitle = this.element.attr('title');
4835
4836		var self = this,
4837			options = this.options,
4838
4839			title = options.title || this.originalTitle || '&nbsp;',
4840			titleId = $.ui.dialog.getTitleId(this.element),
4841
4842			uiDialog = (this.uiDialog = $('<div/>'))
4843				.appendTo(document.body)
4844				.hide()
4845				.addClass(uiDialogClasses + options.dialogClass)
4846				.css({
4847					position: 'absolute',
4848					overflow: 'hidden',
4849					zIndex: options.zIndex
4850				})
4851				// setting tabIndex makes the div focusable
4852				// setting outline to 0 prevents a border on focus in Mozilla
4853				.attr('tabIndex', -1).css('outline', 0).keydown(function(event) {
4854					(options.closeOnEscape && event.keyCode
4855						&& event.keyCode == $.ui.keyCode.ESCAPE && self.close(event));
4856				})
4857				.attr({
4858					role: 'dialog',
4859					'aria-labelledby': titleId
4860				})
4861				.mousedown(function(event) {
4862					self.moveToTop(false, event);
4863				}),
4864
4865			uiDialogContent = this.element
4866				.show()
4867				.removeAttr('title')
4868				.addClass(
4869					'ui-dialog-content ' +
4870					'ui-widget-content')
4871				.appendTo(uiDialog),
4872
4873			uiDialogTitlebar = (this.uiDialogTitlebar = $('<div></div>'))
4874				.addClass(
4875					'ui-dialog-titlebar ' +
4876					'ui-widget-header ' +
4877					'ui-corner-all ' +
4878					'ui-helper-clearfix'
4879				)
4880				.prependTo(uiDialog),
4881
4882			uiDialogTitlebarClose = $('<a href="#"/>')
4883				.addClass(
4884					'ui-dialog-titlebar-close ' +
4885					'ui-corner-all'
4886				)
4887				.attr('role', 'button')
4888				.hover(
4889					function() {
4890						uiDialogTitlebarClose.addClass('ui-state-hover');
4891					},
4892					function() {
4893						uiDialogTitlebarClose.removeClass('ui-state-hover');
4894					}
4895				)
4896				.focus(function() {
4897					uiDialogTitlebarClose.addClass('ui-state-focus');
4898				})
4899				.blur(function() {
4900					uiDialogTitlebarClose.removeClass('ui-state-focus');
4901				})
4902				.mousedown(function(ev) {
4903					ev.stopPropagation();
4904				})
4905				.click(function(event) {
4906					self.close(event);
4907					return false;
4908				})
4909				.appendTo(uiDialogTitlebar),
4910
4911			uiDialogTitlebarCloseText = (this.uiDialogTitlebarCloseText = $('<span/>'))
4912				.addClass(
4913					'ui-icon ' +
4914					'ui-icon-closethick'
4915				)
4916				.text(options.closeText)
4917				.appendTo(uiDialogTitlebarClose),
4918
4919			uiDialogTitle = $('<span/>')
4920				.addClass('ui-dialog-title')
4921				.attr('id', titleId)
4922				.html(title)
4923				.prependTo(uiDialogTitlebar);
4924
4925		uiDialogTitlebar.find("*").add(uiDialogTitlebar).disableSelection();
4926
4927		(options.draggable && $.fn.draggable && this._makeDraggable());
4928		(options.resizable && $.fn.resizable && this._makeResizable());
4929
4930		this._createButtons(options.buttons);
4931		this._isOpen = false;
4932
4933		(options.bgiframe && $.fn.bgiframe && uiDialog.bgiframe());
4934		(options.autoOpen && this.open());
4935		
4936	},
4937
4938	destroy: function() {
4939		(this.overlay && this.overlay.destroy());
4940		this.uiDialog.hide();
4941		this.element
4942			.unbind('.dialog')
4943			.removeData('dialog')
4944			.removeClass('ui-dialog-content ui-widget-content')
4945			.hide().appendTo('body');
4946		this.uiDialog.remove();
4947
4948		(this.originalTitle && this.element.attr('title', this.originalTitle));
4949	},
4950
4951	close: function(event) {
4952		var self = this;
4953		
4954		if (false === self._trigger('beforeclose', event)) {
4955			return;
4956		}
4957
4958		(self.overlay && self.overlay.destroy());
4959		self.uiDialog.unbind('keypress.ui-dialog');
4960
4961		(self.options.hide
4962			? self.uiDialog.hide(self.options.hide, function() {
4963				self._trigger('close', event);
4964			})
4965			: self.uiDialog.hide() && self._trigger('close', event));
4966
4967		$.ui.dialog.overlay.resize();
4968
4969		self._isOpen = false;
4970		
4971		// adjust the maxZ to allow other modal dialogs to continue to work (see #4309)
4972		if (self.options.modal) {
4973			var maxZ = 0;
4974			$('.ui-dialog').each(function() {
4975				if (this != self.uiDialog[0]) {
4976					maxZ = Math.max(maxZ, $(this).css('z-index'));
4977				}
4978			});
4979			$.ui.dialog.maxZ = maxZ;
4980		}
4981	},
4982
4983	isOpen: function() {
4984		return this._isOpen;
4985	},
4986
4987	// the force parameter allows us to move modal dialogs to their correct
4988	// position on open
4989	moveToTop: function(force, event) {
4990
4991		if ((this.options.modal && !force)
4992			|| (!this.options.stack && !this.options.modal)) {
4993			return this._trigger('focus', event);
4994		}
4995		
4996		if (this.options.zIndex > $.ui.dialog.maxZ) {
4997			$.ui.dialog.maxZ = this.options.zIndex;
4998		}
4999		(this.overlay && this.overlay.$el.css('z-index', $.ui.dialog.overlay.maxZ = ++$.ui.dialog.maxZ));
5000
5001		//Save and then restore scroll since Opera 9.5+ resets when parent z-Index is changed.
5002		//  https://ui.jquery.com/bugs/ticket/3193
5003		var saveScroll = { scrollTop: this.element.attr('scrollTop'), scrollLeft: this.element.attr('scrollLeft') };
5004		this.uiDialog.css('z-index', ++$.ui.dialog.maxZ);
5005		this.element.attr(saveScroll);
5006		this._trigger('focus', event);
5007	},
5008
5009	open: function() {
5010		if (this._isOpen) { return; }
5011
5012		var options = this.options,
5013			uiDialog = this.uiDialog;
5014
5015		this.overlay = options.modal ? new $.ui.dialog.overlay(this) : null;
5016		(uiDialog.next().length && uiDialog.appendTo('body'));
5017		this._size();
5018		this._position(options.position);
5019		uiDialog.show(options.show);
5020		this.moveToTop(true);
5021
5022		// prevent tabbing out of modal dialogs
5023		(options.modal && uiDialog.bind('keypress.ui-dialog', function(event) {
5024			if (event.keyCode != $.ui.keyCode.TAB) {
5025				return;
5026			}
5027
5028			var tabbables = $(':tabbable', this),
5029				first = tabbables.filter(':first')[0],
5030				last  = tabbables.filter(':last')[0];
5031
5032			if (event.target == last && !event.shiftKey) {
5033				setTimeout(function() {
5034					first.focus();
5035				}, 1);
5036			} else if (event.target == first && event.shiftKey) {
5037				setTimeout(function() {
5038					last.focus();
5039				}, 1);
5040			}
5041		}));
5042
5043		// set focus to the first tabbable element in the content area or the first button
5044		// if there are no tabbable elements, set focus on the dialog itself
5045		$([])
5046			.add(uiDialog.find('.ui-dialog-content :tabbable:first'))
5047			.add(uiDialog.find('.ui-dialog-buttonpane :tabbable:first'))
5048			.add(uiDialog)
5049			.filter(':first')
5050			.focus();
5051
5052		this._trigger('open');
5053		this._isOpen = true;
5054	},
5055
5056	_createButtons: function(buttons) {
5057		var self = this,
5058			hasButtons = false,
5059			uiDialogButtonPane = $('<div></div>')
5060				.addClass(
5061					'ui-dialog-buttonpane ' +
5062					'ui-widget-content ' +
5063					'ui-helper-clearfix'
5064				);
5065
5066		// if we already have a button pane, remove it
5067		this.uiDialog.find('.ui-dialog-buttonpane').remove();
5068
5069		(typeof buttons == 'object' && buttons !== null &&
5070			$.each(buttons, function() { return !(hasButtons = true); }));
5071		if (hasButtons) {
5072			$.each(buttons, function(name, fn) {
5073				$('<button type="button"></button>')
5074					.addClass(
5075						'ui-state-default ' +
5076						'ui-corner-all'
5077					)
5078					.text(name)
5079					.click(function() { fn.apply(self.element[0], arguments); })
5080					.hover(
5081						function() {
5082							$(this).addClass('ui-state-hover');
5083						},
5084						function() {
5085							$(this).removeClass('ui-state-hover');
5086						}
5087					)
5088					.focus(function() {
5089						$(this).addClass('ui-state-focus');
5090					})
5091					.blur(function() {
5092						$(this).removeClass('ui-state-focus');
5093					})
5094					.appendTo(uiDialogButtonPane);
5095			});
5096			uiDialogButtonPane.appendTo(this.uiDialog);
5097		}
5098	},
5099
5100	_makeDraggable: function() {
5101		var self = this,
5102			options = this.options,
5103			heightBeforeDrag;
5104
5105		this.uiDialog.draggable({
5106			cancel: '.ui-dialog-content',
5107			handle: '.ui-dialog-titlebar',
5108			containment: 'document',
5109			start: function() {
5110				heightBeforeDrag = options.height;
5111				$(this).height($(this).height()).addClass("ui-dialog-dragging");
5112				(options.dragStart && options.dragStart.apply(self.element[0], arguments));
5113			},
5114			drag: function() {
5115				(options.drag && options.drag.apply(self.element[0], arguments));
5116			},
5117			stop: function() {
5118				$(this).removeClass("ui-dialog-dragging").height(heightBeforeDrag);
5119				(options.dragStop && options.dragStop.apply(self.element[0], arguments));
5120				$.ui.dialog.overlay.resize();
5121			}
5122		});
5123	},
5124
5125	_makeResizable: function(handles) {
5126		handles = (handles === undefined ? this.options.resizable : handles);
5127		var self = this,
5128			options = this.options,
5129			resizeHandles = typeof handles == 'string'
5130				? handles
5131				: 'n,e,s,w,se,sw,ne,nw';
5132
5133		this.uiDialog.resizable({
5134			cancel: '.ui-dialog-content',
5135			alsoResize: this.element,
5136			maxWidth: options.maxWidth,
5137			maxHeight: options.maxHeight,
5138			minWidth: options.minWidth,
5139			minHeight: options.minHeight,
5140			start: function() {
5141				$(this).addClass("ui-dialog-resizing");
5142				(options.resizeStart && options.resizeStart.apply(self.element[0], arguments));
5143			},
5144			resize: function() {
5145				(options.resize && options.resize.apply(self.element[0], arguments));
5146			},
5147			handles: resizeHandles,
5148			stop: function() {
5149				$(this).removeClass("ui-dialog-resizing");
5150				options.height = $(this).height();
5151				options.width = $(this).width();
5152				(options.resizeStop && options.resizeStop.apply(self.element[0], arguments));
5153				$.ui.dialog.overlay.resize();
5154			}
5155		})
5156		.find('.ui-resizable-se').addClass('ui-icon ui-icon-grip-diagonal-se');
5157	},
5158
5159	_position: function(pos) {
5160		var wnd = $(window), doc = $(document),
5161			pTop = doc.scrollTop(), pLeft = doc.scrollLeft(),
5162			minTop = pTop;
5163
5164		if ($.inArray(pos, ['center','top','right','bottom','left']) >= 0) {
5165			pos = [
5166				pos == 'right' || pos == 'left' ? pos : 'center',
5167				pos == 'top' || pos == 'bottom' ? pos : 'middle'
5168			];
5169		}
5170		if (pos.constructor != Array) {
5171			pos = ['center', 'middle'];
5172		}
5173		if (pos[0].constructor == Number) {
5174			pLeft += pos[0];
5175		} else {
5176			switch (pos[0]) {
5177				case 'left':
5178					pLeft += 0;
5179					break;
5180				case 'right':
5181					pLeft += wnd.width() - this.uiDialog.outerWidth();
5182					break;
5183				default:
5184				case 'center':
5185					pLeft += (wnd.width() - this.uiDialog.outerWidth()) / 2;
5186			}
5187		}
5188		if (pos[1].constructor == Number) {
5189			pTop += pos[1];
5190		} else {
5191			switch (pos[1]) {
5192				case 'top':
5193					pTop += 0;
5194					break;
5195				case 'bottom':
5196					pTop += wnd.height() - this.uiDialog.outerHeight();
5197					break;
5198				default:
5199				case 'middle':
5200					pTop += (wnd.height() - this.uiDialog.outerHeight()) / 2;
5201			}
5202		}
5203
5204		// prevent the dialog from being too high (make sure the titlebar
5205		// is accessible)
5206		pTop = Math.max(pTop, minTop);
5207		this.uiDialog.css({top: pTop, left: pLeft});
5208	},
5209
5210	_setData: function(key, value){
5211		(setDataSwitch[key] && this.uiDialog.data(setDataSwitch[key], value));
5212		switch (key) {
5213			case "buttons":
5214				this._createButtons(value);
5215				break;
5216			case "closeText":
5217				this.uiDialogTitlebarCloseText.text(value);
5218				break;
5219			case "dialogClass":
5220				this.uiDialog
5221					.removeClass(this.options.dialogClass)
5222					.addClass(uiDialogClasses + value);
5223				break;
5224			case "draggable":
5225				(value
5226					? this._makeDraggable()
5227					: this.uiDialog.draggable('destroy'));
5228				break;
5229			case "height":
5230				this.uiDialog.height(value);
5231				break;
5232			case "position":
5233				this._position(value);
5234				break;
5235			case "resizable":
5236				var uiDialog = this.uiDialog,
5237					isResizable = this.uiDialog.is(':data(resizable)');
5238
5239				// currently resizable, becoming non-resizable
5240				(isResizable && !value && uiDialog.resizable('destroy'));
5241
5242				// currently resizable, changing handles
5243				(isResizable && typeof value == 'string' &&
5244					uiDialog.resizable('option', 'handles', value));
5245
5246				// currently non-resizable, becoming resizable
5247				(isResizable || this._makeResizable(value));
5248				break;
5249			case "title":
5250				$(".ui-dialog-title", this.uiDialogTitlebar).html(value || '&nbsp;');
5251				break;
5252			case "width":
5253				this.uiDialog.width(value);
5254				break;
5255		}
5256
5257		$.widget.prototype._setData.apply(this, arguments);
5258	},
5259
5260	_size: function() {
5261		/* If the user has resized the dialog, the .ui-dialog and .ui-dialog-content
5262		 * divs will both have width and height set, so we need to reset them
5263		 */
5264		var options = this.options;
5265
5266		// reset content sizing
5267		this.element.css({
5268			height: 0,
5269			minHeight: 0,
5270			width: 'auto'
5271		});
5272
5273		// reset wrapper sizing
5274		// determine the height of all the non-content elements
5275		var nonContentHeight = this.uiDialog.css({
5276				height: 'auto',
5277				width: options.width
5278			})
5279			.height();
5280
5281		this.element
5282			.css({
5283				minHeight: Math.max(options.minHeight - nonContentHeight, 0),
5284				height: options.height == 'auto'
5285					? 'auto'
5286					: Math.max(options.height - nonContentHeight, 0)
5287			});
5288	}
5289});
5290
5291$.extend($.ui.dialog, {
5292	version: "1.7.3",
5293	defaults: {
5294		autoOpen: true,
5295		bgiframe: false,
5296		buttons: {},
5297		closeOnEscape: true,
5298		closeText: 'close',
5299		dialogClass: '',
5300		draggable: true,
5301		hide: null,
5302		height: 'auto',
5303		maxHeight: false,
5304		maxWidth: false,
5305		minHeight: 150,
5306		minWidth: 150,
5307		modal: false,
5308		position: 'center',
5309		resizable: true,
5310		show: null,
5311		stack: true,
5312		title: '',
5313		width: 300,
5314		zIndex: 1000
5315	},
5316
5317	getter: 'isOpen',
5318
5319	uuid: 0,
5320	maxZ: 0,
5321
5322	getTitleId: function($el) {
5323		return 'ui-dialog-title-' + ($el.attr('id') || ++this.uuid);
5324	},
5325
5326	overlay: function(dialog) {
5327		this.$el = $.ui.dialog.overlay.create(dialog);
5328	}
5329});
5330
5331$.extend($.ui.dialog.overlay, {
5332	instances: [],
5333	maxZ: 0,
5334	events: $.map('focus,mousedown,mouseup,keydown,keypress,click'.split(','),
5335		function(event) { return event + '.dialog-overlay'; }).join(' '),
5336	create: function(dialog) {
5337		if (this.instances.length === 0) {
5338			// prevent use of anchors and inputs
5339			// we use a setTimeout in case the overlay is created from an
5340			// event that we're going to be cancelling (see #2804)
5341			setTimeout(function() {
5342				// handle $(el).dialog().dialog('close') (see #4065)
5343				if ($.ui.dialog.overlay.instances.length) {
5344					$(document).bind($.ui.dialog.overlay.events, function(event) {
5345						var dialogZ = $(event.target).parents('.ui-dialog').css('zIndex') || 0;
5346						return (dialogZ > $.ui.dialog.overlay.maxZ);
5347					});
5348				}
5349			}, 1);
5350
5351			// allow closing by pressing the escape key
5352			$(document).bind('keydown.dialog-overlay', function(event) {
5353				(dialog.options.closeOnEscape && event.keyCode
5354						&& event.keyCode == $.ui.keyCode.ESCAPE && dialog.close(event));
5355			});
5356
5357			// handle window resize
5358			$(window).bind('resize.dialog-overlay', $.ui.dialog.overlay.resize);
5359		}
5360
5361		var $el = $('<div></div>').appendTo(document.body)
5362			.addClass('ui-widget-overlay').css({
5363				width: this.width(),
5364				height: this.height()
5365			});
5366
5367		(dialog.options.bgiframe && $.fn.bgiframe && $el.bgiframe());
5368
5369		this.instances.push($el);
5370		return $el;
5371	},
5372
5373	destroy: function($el) {
5374		this.instances.splice($.inArray(this.instances, $el), 1);
5375
5376		if (this.instances.length === 0) {
5377			$([document, window]).unbind('.dialog-overlay');
5378		}
5379
5380		$el.remove();
5381		
5382		// adjust the maxZ to allow other modal dialogs to continue to work (see #4309)
5383		var maxZ = 0;
5384		$.each(this.instances, function() {
5385			maxZ = Math.max(maxZ, this.css('z-index'));
5386		});
5387		this.maxZ = maxZ;
5388	},
5389
5390	height: function() {
5391		// handle IE 6
5392		if ($.browser.msie && $.browser.version < 7) {
5393			var scrollHeight = Math.max(
5394				document.documentElement.scrollHeight,
5395				document.body.scrollHeight
5396			);
5397			var offsetHeight = Math.max(
5398				document.documentElement.offsetHeight,
5399				document.body.offsetHeight
5400			);
5401
5402			if (scrollHeight < offsetHeight) {
5403				return $(window).height() + 'px';
5404			} else {
5405				return scrollHeight + 'px';
5406			}
5407		// handle "good" browsers
5408		} else {
5409			return $(document).height() + 'px';
5410		}
5411	},
5412
5413	width: function() {
5414		// handle IE 6
5415		if ($.browser.msie && $.browser.version < 7) {
5416			var scrollWidth = Math.max(
5417				document.documentElement.scrollWidth,
5418				document.body.scrollWidth
5419			);
5420			var offsetWidth = Math.max(
5421				document.documentElement.offsetWidth,
5422				document.body.offsetWidth
5423			);
5424
5425			if (scrollWidth < offsetWidth) {
5426				return $(window).width() + 'px';
5427			} else {
5428				return scrollWidth + 'px';
5429			}
5430		// handle "good" browsers
5431		} else {
5432			return $(document).width() + 'px';
5433		}
5434	},
5435
5436	resize: function() {
5437		/* If the dialog is draggable and the user drags it past the
5438		 * right edge of the window, the document becomes wider so we
5439		 * need to stretch the overlay. If the user then drags the
5440		 * dialog back to the left, the document will become narrower,
5441		 * so we need to shrink the overlay to the appropriate size.
5442		 * This is handled by shrinking the overlay before setting it
5443		 * to the full document size.
5444		 */
5445		var $overlays = $([]);
5446		$.each($.ui.dialog.overlay.instances, function() {
5447			$overlays = $overlays.add(this);
5448		});
5449
5450		$overlays.css({
5451			width: 0,
5452			height: 0
5453		}).css({
5454			width: $.ui.dialog.overlay.width(),
5455			height: $.ui.dialog.overlay.height()
5456		});
5457	}
5458});
5459
5460$.extend($.ui.dialog.overlay.prototype, {
5461	destroy: function() {
5462		$.ui.dialog.overlay.destroy(this.$el);
5463	}
5464});
5465
5466})(jQuery);
5467/*
5468 * jQuery UI Slider 1.7.3
5469 *
5470 * Copyright (c) 2009 AUTHORS.txt (https://jqueryui.com/about)
5471 * Dual licensed under the MIT (MIT-LICENSE.txt)
5472 * and GPL (GPL-LICENSE.txt) licenses.
5473 *
5474 * https://docs.jquery.com/UI/Slider
5475 *
5476 * Depends:
5477 *	ui.core.js
5478 */
5479
5480(function($) {
5481
5482$.widget("ui.slider", $.extend({}, $.ui.mouse, {
5483
5484	_init: function() {
5485
5486		var self = this, o = this.options;
5487		this._keySliding = false;
5488		this._handleIndex = null;
5489		this._detectOrientation();
5490		this._mouseInit();
5491
5492		this.element
5493			.addClass("ui-slider"
5494				+ " ui-slider-" + this.orientation
5495				+ " ui-widget"
5496				+ " ui-widget-content"
5497				+ " ui-corner-all");
5498
5499		this.range = $([]);
5500
5501		if (o.range) {
5502
5503			if (o.range === true) {
5504				this.range = $('<div></div>');
5505				if (!o.values) o.values = [this._valueMin(), this._valueMin()];
5506				if (o.values.length && o.values.length != 2) {
5507					o.values = [o.values[0], o.values[0]];
5508				}
5509			} else {
5510				this.range = $('<div></div>');
5511			}
5512
5513			this.range
5514				.appendTo(this.element)
5515				.addClass("ui-slider-range");
5516
5517			if (o.range == "min" || o.range == "max") {
5518				this.range.addClass("ui-slider-range-" + o.range);
5519			}
5520
5521			// note: this isn't the most fittingly semantic framework class for this element,
5522			// but worked best visually with a variety of themes
5523			this.range.addClass("ui-widget-header");
5524
5525		}
5526
5527		if ($(".ui-slider-handle", this.element).length == 0)
5528			$('<a href="#"></a>')
5529				.appendTo(this.element)
5530				.addClass("ui-slider-handle");
5531
5532		if (o.values && o.values.length) {
5533			while ($(".ui-slider-handle", this.element).length < o.values.length)
5534				$('<a href="#"></a>')
5535					.appendTo(this.element)
5536					.addClass("ui-slider-handle");
5537		}
5538
5539		this.handles = $(".ui-slider-handle", this.element)
5540			.addClass("ui-state-default"
5541				+ " ui-corner-all");
5542
5543		this.handle = this.handles.eq(0);
5544
5545		this.handles.add(this.range).filter("a")
5546			.click(function(event) {
5547				event.preventDefault();
5548			})
5549			.hover(function() {
5550				if (!o.disabled) {
5551					$(this).addClass('ui-state-hover');
5552				}
5553			}, function() {
5554				$(this).removeClass('ui-state-hover');
5555			})
5556			.focus(function() {
5557				if (!o.disabled) {
5558					$(".ui-slider .ui-state-focus").removeClass('ui-state-focus'); $(this).addClass('ui-state-focus');
5559				} else {
5560					$(this).blur();
5561				}
5562			})
5563			.blur(function() {
5564				$(this).removeClass('ui-state-focus');
5565			});
5566
5567		this.handles.each(function(i) {
5568			$(this).data("index.ui-slider-handle", i);
5569		});
5570
5571		this.handles.keydown(function(event) {
5572
5573			var ret = true;
5574
5575			var index = $(this).data("index.ui-slider-handle");
5576
5577			if (self.options.disabled)
5578				return;
5579
5580			switch (event.keyCode) {
5581				case $.ui.keyCode.HOME:
5582				case $.ui.keyCode.END:
5583				case $.ui.keyCode.UP:
5584				case $.ui.keyCode.RIGHT:
5585				case $.ui.keyCode.DOWN:
5586				case $.ui.keyCode.LEFT:
5587					ret = false;
5588					if (!self._keySliding) {
5589						self._keySliding = true;
5590						$(this).addClass("ui-state-active");
5591						self._start(event, index);
5592					}
5593					break;
5594			}
5595
5596			var curVal, newVal, step = self._step();
5597			if (self.options.values && self.options.values.length) {
5598				curVal = newVal = self.values(index);
5599			} else {
5600				curVal = newVal = self.value();
5601			}
5602
5603			switch (event.keyCode) {
5604				case $.ui.keyCode.HOME:
5605					newVal = self._valueMin();
5606					break;
5607				case $.ui.keyCode.END:
5608					newVal = self._valueMax();
5609					break;
5610				case $.ui.keyCode.UP:
5611				case $.ui.keyCode.RIGHT:
5612					if(curVal == self._valueMax()) return;
5613					newVal = curVal + step;
5614					break;
5615				case $.ui.keyCode.DOWN:
5616				case $.ui.keyCode.LEFT:
5617					if(curVal == self._valueMin()) return;
5618					newVal = curVal - step;
5619					break;
5620			}
5621
5622			self._slide(event, index, newVal);
5623
5624			return ret;
5625
5626		}).keyup(function(event) {
5627
5628			var index = $(this).data("index.ui-slider-handle");
5629
5630			if (self._keySliding) {
5631				self._stop(event, index);
5632				self._change(event, index);
5633				self._keySliding = false;
5634				$(this).removeClass("ui-state-active");
5635			}
5636
5637		});
5638
5639		this._refreshValue();
5640
5641	},
5642
5643	destroy: function() {
5644
5645		this.handles.remove();
5646		this.range.remove();
5647
5648		this.element
5649			.removeClass("ui-slider"
5650				+ " ui-slider-horizontal"
5651				+ " ui-slider-vertical"
5652				+ " ui-slider-disabled"
5653				+ " ui-widget"
5654				+ " ui-widget-content"
5655				+ " ui-corner-all")
5656			.removeData("slider")
5657			.unbind(".slider");
5658
5659		this._mouseDestroy();
5660
5661	},
5662
5663	_mouseCapture: function(event) {
5664
5665		var o = this.options;
5666
5667		if (o.disabled)
5668			return false;
5669
5670		this.elementSize = {
5671			width: this.element.outerWidth(),
5672			height: this.element.outerHeight()
5673		};
5674		this.elementOffset = this.element.offset();
5675
5676		var position = { x: event.pageX, y: event.pageY };
5677		var normValue = this._normValueFromMouse(position);
5678
5679		var distance = this._valueMax() - this._valueMin() + 1, closestHandle;
5680		var self = this, index;
5681		this.handles.each(function(i) {
5682			var thisDistance = Math.abs(normValue - self.values(i));
5683			if (distance > thisDistance) {
5684				distance = thisDistance;
5685				closestHandle = $(this);
5686				index = i;
5687			}
5688		});
5689
5690		// workaround for bug #3736 (if both handles of a range are at 0,
5691		// the first is always used as the one with least distance,
5692		// and moving it is obviously prevented by preventing negative ranges)
5693		if(o.range == true && this.values(1) == o.min) {
5694			closestHandle = $(this.handles[++index]);
5695		}
5696
5697		this._start(event, index);
5698
5699		self._handleIndex = index;
5700
5701		closestHandle
5702			.addClass("ui-state-active")
5703			.focus();
5704		
5705		var offset = closestHandle.offset();
5706		var mouseOverHandle = !$(event.target).parents().andSelf().is('.ui-slider-handle');
5707		this._clickOffset = mouseOverHandle ? { left: 0, top: 0 } : {
5708			left: event.pageX - offset.left - (closestHandle.width() / 2),
5709			top: event.pageY - offset.top
5710				- (closestHandle.height() / 2)
5711				- (parseInt(closestHandle.css('borderTopWidth'),10) || 0)
5712				- (parseInt(closestHandle.css('borderBottomWidth'),10) || 0)
5713				+ (parseInt(closestHandle.css('marginTop'),10) || 0)
5714		};
5715
5716		normValue = this._normValueFromMouse(position);
5717		this._slide(event, index, normValue);
5718		return true;
5719
5720	},
5721
5722	_mouseStart: function(event) {
5723		return true;
5724	},
5725
5726	_mouseDrag: function(event) {
5727
5728		var position = { x: event.pageX, y: event.pageY };
5729		var normValue = this._normValueFromMouse(position);
5730		
5731		this._slide(event, this._handleIndex, normValue);
5732
5733		return false;
5734
5735	},
5736
5737	_mouseStop: function(event) {
5738
5739		this.handles.removeClass("ui-state-active");
5740		this._stop(event, this._handleIndex);
5741		this._change(event, this._handleIndex);
5742		this._handleIndex = null;
5743		this._clickOffset = null;
5744
5745		return false;
5746
5747	},
5748	
5749	_detectOrientation: function() {
5750		this.orientation = this.options.orientation == 'vertical' ? 'vertical' : 'horizontal';
5751	},
5752
5753	_normValueFromMouse: function(position) {
5754
5755		var pixelTotal, pixelMouse;
5756		if ('horizontal' == this.orientation) {
5757			pixelTotal = this.elementSize.width;
5758			pixelMouse = position.x - this.elementOffset.left - (this._clickOffset ? this._clickOffset.left : 0);
5759		} else {
5760			pixelTotal = this.elementSize.height;
5761			pixelMouse = position.y - this.elementOffset.top - (this._clickOffset ? this._clickOffset.top : 0);
5762		}
5763
5764		var percentMouse = (pixelMouse / pixelTotal);
5765		if (percentMouse > 1) percentMouse = 1;
5766		if (percentMouse < 0) percentMouse = 0;
5767		if ('vertical' == this.orientation)
5768			percentMouse = 1 - percentMouse;
5769
5770		var valueTotal = this._valueMax() - this._valueMin(),
5771			valueMouse = percentMouse * valueTotal,
5772			valueMouseModStep = valueMouse % this.options.step,
5773			normValue = this._valueMin() + valueMouse - valueMouseModStep;
5774
5775		if (valueMouseModStep > (this.options.step / 2))
5776			normValue += this.options.step;
5777
5778		// Since JavaScript has problems with large floats, round
5779		// the final value to 5 digits after the decimal point (see #4124)
5780		return parseFloat(normValue.toFixed(5));
5781
5782	},
5783
5784	_start: function(event, index) {
5785		var uiHash = {
5786			handle: this.handles[index],
5787			value: this.value()
5788		};
5789		if (this.options.values && this.options.values.length) {
5790			uiHash.value = this.values(index);
5791			uiHash.values = this.values();
5792		}
5793		this._trigger("start", event, uiHash);
5794	},
5795
5796	_slide: function(event, index, newVal) {
5797
5798		var handle = this.handles[index];
5799
5800		if (this.options.values && this.options.values.length) {
5801
5802			var otherVal = this.values(index ? 0 : 1);
5803
5804			if ((this.options.values.length == 2 && this.options.range === true) && 
5805				((index == 0 && newVal > otherVal) || (index == 1 && newVal < otherVal))){
5806 				newVal = otherVal;
5807			}
5808
5809			if (newVal != this.values(index)) {
5810				var newValues = this.values();
5811				newValues[index] = newVal;
5812				// A slide can be canceled by returning false from the slide callback
5813				var allowed = this._trigger("slide", event, {
5814					handle: this.handles[index],
5815					value: newVal,
5816					values: newValues
5817				});
5818				var otherVal = this.values(index ? 0 : 1);
5819				if (allowed !== false) {
5820					this.values(index, newVal, ( event.type == 'mousedown' && this.options.animate ), true);
5821				}
5822			}
5823
5824		} else {
5825
5826			if (newVal != this.value()) {
5827				// A slide can be canceled by returning false from the slide callback
5828				var allowed = this._trigger("slide", event, {
5829					handle: this.handles[index],
5830					value: newVal
5831				});
5832				if (allowed !== false) {
5833					this._setData('value', newVal, ( event.type == 'mousedown' && this.options.animate ));
5834				}
5835					
5836			}
5837
5838		}
5839
5840	},
5841
5842	_stop: function(event, index) {
5843		var uiHash = {
5844			handle: this.handles[index],
5845			value: this.value()
5846		};
5847		if (this.options.values && this.options.values.length) {
5848			uiHash.value = this.values(index);
5849			uiHash.values = this.values();
5850		}
5851		this._trigger("stop", event, uiHash);
5852	},
5853
5854	_change: function(event, index) {
5855		var uiHash = {
5856			handle: this.handles[index],
5857			value: this.value()
5858		};
5859		if (this.options.values && this.options.values.length) {
5860			uiHash.value = this.values(index);
5861			uiHash.values = this.values();
5862		}
5863		this._trigger("change", event, uiHash);
5864	},
5865
5866	value: function(newValue) {
5867
5868		if (arguments.length) {
5869			this._setData("value", newValue);
5870			this._change(null, 0);
5871		}
5872
5873		return this._value();
5874
5875	},
5876
5877	values: function(index, newValue, animated, noPropagation) {
5878
5879		if (arguments.length > 1) {
5880			this.options.values[index] = newValue;
5881			this._refreshValue(animated);
5882			if(!noPropagation) this._change(null, index);
5883		}
5884
5885		if (arguments.length) {
5886			if (this.options.values && this.options.values.length) {
5887				return this._values(index);
5888			} else {
5889				return this.value();
5890			}
5891		} else {
5892			return this._values();
5893		}
5894
5895	},
5896
5897	_setData: function(key, value, animated) {
5898
5899		$.widget.prototype._setData.apply(this, arguments);
5900
5901		switch (key) {
5902			case 'disabled':
5903				if (value) {
5904					this.handles.filter(".ui-state-focus").blur();
5905					this.handles.removeClass("ui-state-hover");
5906					this.handles.attr("disabled", "disabled");
5907				} else {
5908					this.handles.removeAttr("disabled");
5909				}
5910			case 'orientation':
5911
5912				this._detectOrientation();
5913				
5914				this.element
5915					.removeClass("ui-slider-horizontal ui-slider-vertical")
5916					.addClass("ui-slider-" + this.orientation);
5917				this._refreshValue(animated);
5918				break;
5919			case 'value':
5920				this._refreshValue(animated);
5921				break;
5922		}
5923
5924	},
5925
5926	_step: function() {
5927		var step = this.options.step;
5928		return step;
5929	},
5930
5931	_value: function() {
5932
5933		var val = this.options.value;
5934		if (val < this._valueMin()) val = this._valueMin();
5935		if (val > this._valueMax()) val = this._valueMax();
5936
5937		return val;
5938
5939	},
5940
5941	_values: function(index) {
5942
5943		if (arguments.length) {
5944			var val = this.options.values[index];
5945			if (val < this._valueMin()) val = this._valueMin();
5946			if (val > this._valueMax()) val = this._valueMax();
5947
5948			return val;
5949		} else {
5950			return this.options.values;
5951		}
5952
5953	},
5954
5955	_valueMin: function() {
5956		var valueMin = this.options.min;
5957		return valueMin;
5958	},
5959
5960	_valueMax: function() {
5961		var valueMax = this.options.max;
5962		return valueMax;
5963	},
5964
5965	_refreshValue: function(animate) {
5966
5967		var oRange = this.options.range, o = this.options, self = this;
5968
5969		if (this.options.values && this.options.values.length) {
5970			var vp0, vp1;
5971			this.handles.each(function(i, j) {
5972				var valPercent = (self.values(i) - self._valueMin()) / (self._valueMax() - self._valueMin()) * 100;
5973				var _set = {}; _set[self.orientation == 'horizontal' ? 'left' : 'bottom'] = valPercent + '%';
5974				$(this).stop(1,1)[animate ? 'animate' : 'css'](_set, o.animate);
5975				if (self.options.range === true) {
5976					if (self.orientation == 'horizontal') {
5977						(i == 0) && self.range.stop(1,1)[animate ? 'animate' : 'css']({ left: valPercent + '%' }, o.animate);
5978						(i == 1) && self.range[animate ? 'animate' : 'css']({ width: (valPercent - lastValPercent) + '%' }, { queue: false, duration: o.animate });
5979					} else {
5980						(i == 0) && self.range.stop(1,1)[animate ? 'animate' : 'css']({ bottom: (valPercent) + '%' }, o.animate);
5981						(i == 1) && self.range[animate ? 'animate' : 'css']({ height: (valPercent - lastValPercent) + '%' }, { queue: false, duration: o.animate });
5982					}
5983				}
5984				lastValPercent = valPercent;
5985			});
5986		} else {
5987			var value = this.value(),
5988				valueMin = this._valueMin(),
5989				valueMax = this._valueMax(),
5990				valPercent = valueMax != valueMin
5991					? (value - valueMin) / (valueMax - valueMin) * 100
5992					: 0;
5993			var _set = {}; _set[self.orientation == 'horizontal' ? 'left' : 'bottom'] = valPercent + '%';
5994			this.handle.stop(1,1)[animate ? 'animate' : 'css'](_set, o.animate);
5995
5996			(oRange == "min") && (this.orientation == "horizontal") && this.range.stop(1,1)[animate ? 'animate' : 'css']({ width: valPercent + '%' }, o.animate);
5997			(oRange == "max") && (this.orientation == "horizontal") && this.range[animate ? 'animate' : 'css']({ width: (100 - valPercent) + '%' }, { queue: false, duration: o.animate });
5998			(oRange == "min") && (this.orientation == "vertical") && this.range.stop(1,
59981)[animate ? 'animate' : 'css']({ height: valPercent + '%' }, o.animate);
5999			(oRange == "max") && (this.orientation == "vertical") && this.range[animate ? 'animate' : 'css']({ height: (100 - valPercent) + '%' }, { queue: false, duration: o.animate });
6000		}
6001
6002	}
6003	
6004}));
6005
6006$.extend($.ui.slider, {
6007	getter: "value values",
6008	version: "1.7.3",
6009	eventPrefix: "slide",
6010	defaults: {
6011		animate: false,
6012		delay: 0,
6013		distance: 0,
6014		max: 100,
6015		min: 0,
6016		orientation: 'horizontal',
6017		range: false,
6018		step: 1,
6019		value: 0,
6020		values: null
6021	}
6022});
6023
6024})(jQuery);
6025/*
6026 * jQuery UI Tabs 1.7.3
6027 *
6028 * Copyright (c) 2009 AUTHORS.txt (https://jqueryui.com/about)
6029 * Dual licensed under the MIT (MIT-LICENSE.txt)
6030 * and GPL (GPL-LICENSE.txt) licenses.
6031 *
6032 * https://docs.jquery.com/UI/Tabs
6033 *
6034 * Depends:
6035 *	ui.core.js
6036 */
6037(function($) {
6038
6039var tabId = 0,
6040	listId = 0;
6041
6042$.widget("ui.tabs", {
6043
6044	_init: function() {
6045		if (this.options.deselectable !== undefined) {
6046			this.options.collapsible = this.options.deselectable;
6047		}
6048		this._tabify(true);
6049	},
6050
6051	_setData: function(key, value) {
6052		if (key == 'selected') {
6053			if (this.options.collapsible && value == this.options.selected) {
6054				return;
6055			}
6056			this.select(value);
6057		}
6058		else {
6059			this.options[key] = value;
6060			if (key == 'deselectable') {
6061				this.options.collapsible = value;
6062			}
6063			this._tabify();
6064		}
6065	},
6066
6067	_tabId: function(a) {
6068		return a.title && a.title.replace(/\s/g, '_').replace(/[^A-Za-z0-9\-_:\.]/g, '') ||
6069			this.options.idPrefix + (++tabId);
6070	},
6071
6072	_sanitizeSelector: function(hash) {
6073		return hash.replace(/:/g, '\\:'); // we need this because an id may contain a ":"
6074	},
6075
6076	_cookie: function() {
6077		var cookie = this.cookie || (this.cookie = this.options.cookie.name || 'ui-tabs-' + (++listId));
6078		return $.cookie.apply(null, [cookie].concat($.makeArray(arguments)));
6079	},
6080
6081	_ui: function(tab, panel) {
6082		return {
6083			tab: tab,
6084			panel: panel,
6085			index: this.anchors.index(tab)
6086		};
6087	},
6088
6089	_cleanup: function() {
6090		// restore all former loading tabs labels
6091		this.lis.filter('.ui-state-processing').removeClass('ui-state-processing')
6092				.find('span:data(label.tabs)')
6093				.each(function() {
6094					var el = $(this);
6095					el.html(el.data('label.tabs')).removeData('label.tabs');
6096				});
6097	},
6098
6099	_tabify: function(init) {
6100
6101		this.list = this.element.children('ul:first');
6102		this.lis = $('li:has(a[href])', this.list);
6103		this.anchors = this.lis.map(function() { return $('a', this)[0]; });
6104		this.panels = $([]);
6105
6106		var self = this, o = this.options;
6107
6108		var fragmentId = /^#.+/; // Safari 2 reports '#' for an empty hash
6109		this.anchors.each(function(i, a) {
6110			var href = $(a).attr('href');
6111
6112			// For dynamically created HTML that contains a hash as href IE < 8 expands
6113			// such href to the full page url with hash and then misinterprets tab as ajax.
6114			// Same consideration applies for an added tab with a fragment identifier
6115			// since a[href=#fragment-identifier] does unexpectedly not match.
6116			// Thus normalize href attribute...
6117			var hrefBase = href.split('#')[0], baseEl;
6118			if (hrefBase && (hrefBase === location.toString().split('#')[0] ||
6119					(baseEl = $('base')[0]) && hrefBase === baseEl.href)) {
6120				href = a.hash;
6121				a.href = href;
6122			}
6123
6124			// inline tab
6125			if (fragmentId.test(href)) {
6126				self.panels = self.panels.add(self._sanitizeSelector(href));
6127			}
6128
6129			// remote tab
6130			else if (href != '#') { // prevent loading the page itself if href is just "#"
6131				$.data(a, 'href.tabs', href);
6131 // required for restore on destroy
6132
6133				// TODO until #3808 is fixed strip fragment identifier from url
6134				// (IE fails to load from such url)
6135				$.data(a, 'load.tabs', href.replace(/#.*$/, '')); // mutable data
6136
6137				var id = self._tabId(a);
6138				a.href = '#' + id;
6139				var $panel = $('#' + id);
6140				if (!$panel.length) {
6141					$panel = $(o.panelTemplate).attr('id', id).addClass('ui-tabs-panel ui-widget-content ui-corner-bottom')
6142						.insertAfter(self.panels[i - 1] || self.list);
6143					$panel.data('destroy.tabs', true);
6144				}
6145				self.panels = self.panels.add($panel);
6146			}
6147
6148			// invalid tab href
6149			else {
6150				o.disabled.push(i);
6151			}
6152		});
6153
6154		// initialization from scratch
6155		if (init) {
6156
6157			// attach necessary classes for styling
6158			this.element.addClass('ui-tabs ui-widget ui-widget-content ui-corner-all');
6159			this.list.addClass('ui-tabs-nav ui-helper-reset ui-helper-clearfix ui-widget-header ui-corner-all');
6160			this.lis.addClass('ui-state-default ui-corner-top');
6161			this.panels.addClass('ui-tabs-panel ui-widget-content ui-corner-bottom');
6162
6163			// Selected tab
6164			// use "selected" option or try to retrieve:
6165			// 1. from fragment identifier in url
6166			// 2. from cookie
6167			// 3. from selected class attribute on <li>
6168			if (o.selected === undefined) {
6169				if (location.hash) {
6170					this.anchors.each(function(i, a) {
6171						if (a.hash == location.hash) {
6172							o.selected = i;
6173							return false; // break
6174						}
6175					});
6176				}
6177				if (typeof o.selected != 'number' && o.cookie) {
6178					o.selected = parseInt(self._cookie(), 10);
6179				}
6180				if (typeof o.selected != 'number' && this.lis.filter('.ui-tabs-selected').length) {
6181					o.selected = this.lis.index(this.lis.filter('.ui-tabs-selected'));
6182				}
6183				o.selected = o.selected || 0;
6184			}
6185			else if (o.selected === null) { // usage of null is deprecated, TODO remove in next release
6186				o.selected = -1;
6187			}
6188
6189			// sanity check - default to first tab...
6190			o.selected = ((o.selected >= 0 && this.anchors[o.selected]) || o.selected < 0) ? o.selected : 0;
6191
6192			// Take disabling tabs via class attribute from HTML
6193			// into account and update option properly.
6194			// A selected tab cannot become disabled.
6195			o.disabled = $.unique(o.disabled.concat(
6196				$.map(this.lis.filter('.ui-state-disabled'),
6197					function(n, i) { return self.lis.index(n); } )
6198			)).sort();
6199
6200			if ($.inArray(o.selected, o.disabled) != -1) {
6201				o.disabled.splice($.inArray(o.selected, o.disabled), 1);
6202			}
6203
6204			// highlight selected tab
6205			this.panels.addClass('ui-tabs-hide');
6206			this.lis.removeClass('ui-tabs-selected ui-state-active');
6207			if (o.selected >= 0 && this.anchors.length) { // check for length avoids error when initializing empty list
6208				this.panels.eq(o.selected).removeClass('ui-tabs-hide');
6209				this.lis.eq(o.selected).addClass('ui-tabs-selected ui-state-active');
6210
6211				// seems to be expected behavior that the show callback is fired
6212				self.element.queue("tabs", function() {
6213					self._trigger('show', null, self._ui(self.anchors[o.selected], self.panels[o.selected]));
6214				});
6215				
6216				this.load(o.selected);
6217			}
6218
6219			// clean up to avoid memory leaks in certain versions of IE 6
6220			$(window).bind('unload', function() {
6221				self.lis.add(self.anchors).unbind('.tabs');
6222				self.lis = self.anchors = self.panels = null;
6223			});
6224
6225		}
6226		// update selected after add/remove
6227		else {
6228			o.selected = this.lis.index(this.lis.filter('.ui-tabs-selected'));
6229		}
6230
6231		// update collapsible
6232		this.element[o.collapsible ? 'addClass' : 'removeClass']('ui-tabs-collapsible');
6233
6234		// set or update cookie after init and add/remove respectively
6235		if (o.cookie) {
6236			this._cookie(o.selected, o.cookie);
6237		}
6238
6239		// disable tabs
6240		for (var i = 0, li; (li = this.lis[i]); i++) {
6241			$(li)[$.inArray(i, o.disabled) != -1 &&
6242				!$(li).hasClass('ui-tabs-selected') ? 'addClass' : 'removeClass']('ui-state-disabled');
6243		}
6244
6245		// reset cache if switching from cached to not cached
6246		if (o.cache === false) {
6247			this.anchors.removeData('cache.tabs');
6248		}
6249
6250		// remove all handlers before, tabify may run on existing tabs after add or option change
6251		this.lis.add(this.anchors).unbind('.tabs');
6252
6253		if (o.event != 'mouseover') {
6254			var addState = function(state, el) {
6255				if (el.is(':not(.ui-state-disabled)')) {
6256					el.addClass('ui-state-' + state);
6257				}
6258			};
6259			var removeState = function(state, el) {
6260				el.removeClass('ui-state-' + state);
6261			};
6262			this.lis.bind('mouseover.tabs', function() {
6263				addState('hover', $(this));
6264			});
6265			this.lis.bind('mouseout.tabs', function() {
6266				removeState('hover', $(this));
6267			});
6268			this.anchors.bind('focus.tabs', function() {
6269				addState('focus', $(this).closest('li'));
6270			});
6271			this.anchors.bind('blur.tabs', function() {
6272				removeState('focus', $(this).closest('li'));
6273			});
6274		}
6275
6276		// set up animations
6277		var hideFx, showFx;
6278		if (o.fx) {
6279			if ($.isArray(o.fx)) {
6280				hideFx = o.fx[0];
6281				showFx = o.fx[1];
6282			}
6283			else {
6284				hideFx = showFx = o.fx;
6285			}
6286		}
6287
6288		// Reset certain styles left over from animation
6289		// and prevent IE's ClearType bug...
6290		function resetStyle($el, fx) {
6291			$el.css({ display: '' });
6292			if ($.browser.msie && fx.opacity) {
6293				$el[0].style.removeAttribute('filter');
6294			}
6295		}
6296
6297		// Show a tab...
6298		var showTab = showFx ?
6299			function(clicked, $show) {
6300				$(clicked).closest('li').removeClass('ui-state-default').addClass('ui-tabs-selected ui-state-active');
6301				$show.hide().removeClass('ui-tabs-hide') // avoid flicker that way
6302					.animate(showFx, showFx.duration || 'normal', function() {
6303						resetStyle($show, showFx);
6304						self._trigger('show', null, self._ui(clicked, $show[0]));
6305					});
6306			} :
6307			function(clicked, $show) {
6308				$(clicked).closest('li').removeClass('ui-state-default').addClass('ui-tabs-selected ui-state-active');
6309				$show.removeClass('ui-tabs-hide');
6310				self._trigger('show', null, self._ui(clicked, $show[0]));
6311			};
6312
6313		// Hide a tab, $show is optional...
6314		var hideTab = hideFx ?
6315			function(clicked, $hide) {
6316				$hide.animate(hideFx, hideFx.duration || 'normal', function() {
6317					self.lis.removeClass('ui-tabs-selected ui-state-active').addClass('ui-state-default');
6318					$hide.addClass('ui-tabs-hide');
6319					resetStyle($hide, hideFx);
6320					self.element.dequeue("tabs");
6321				});
6322			} :
6323			function(clicked, $hide, $show) {
6324				self.lis.removeClass('ui-tabs-selected ui-state-active').addClass('ui-state-default');
6325				$hide.addClass('ui-tabs-hide');
6326				self.element.dequeue("tabs");
6327			};
6328
6329		// attach tab event handler, unbind to avoid duplicates from former tabifying...
6330		this.anchors.bind(o.event + '.tabs', function() {
6331			var el = this, $li = $(this).closest('li'), $hide = self.panels.filter(':not(.ui-tabs-hide)'),
6332					$show = $(self._sanitizeSelector(this.hash));
6333
6334			// If tab is already selected and not collapsible or tab disabled or
6335			// or is already loading or click callback returns false stop here.
6336			// Check if click handler returns false last so that it is not executed
6337			// for a disabled or loading tab!
6338			if (($li.hasClass('ui-tabs-selected') && !o.collapsible) ||
6339				$li.hasClass('ui-state-disabled') ||
6340				$li.hasClass('ui-state-processing') ||
6341				self._trigger('select', null, self._ui(this, $show[0])) === false) {
6342				this.blur();
6343				return false;
6344			}
6345
6346			o.selected = self.anchors.index(this);
6347
6348			self.abort();
6349
6350			// if tab may be closed
6351			if (o.collapsible) {
6352				if ($li.hasClass('ui-tabs-selected')) {
6353					o.selected = -1;
6354
6355					if (o.cookie) {
6356						self._cookie(o.selected, o.cookie);
6357					}
6358
6359					self.element.queue("tabs", function() {
6360						hideTab(el, $hide);
6361					}).dequeue("tabs");
6362					
6363					this.blur();
6364					return false;
6365				}
6366				else if (!$hide.length) {
6367					if (o.cookie) {
6368						self._cookie(o.selected, o.cookie);
6369					}
6370					
6371					self.element.queue("tabs", function() {
6372						showTab(el, $show);
6373					});
6374
6375					self.load(self.anchors.index(this)); // TODO make passing in node possible, see also https://dev.jqueryui.com/ticket/3171
6376					
6377					this.blur();
6378					return false;
6379				}
6380			}
6381
6382			if (o.cookie) {
6383				self._cookie(o.selected, o.cookie);
6384			}
6385
6386			// show new tab
6387			if ($show.length) {
6388				if ($hide.length) {
6389					self.element.queue("tabs", function() {
6390						hideTab(el, $hide);
6391					});
6392				}
6393				self.element.queue("tabs", function() {
6394					showTab(el, $show);
6395				});
6396				
6397				self.load(self.anchors.index(this));
6398			}
6399			else {
6400				throw 'jQuery UI Tabs: Mismatching fragment identifier.';
6401			}
6402
6403			// Prevent IE from keeping other link focussed when using the back button
6404			// and remove dotted border from clicked link. This is controlled via CSS
6405			// in modern browsers; blur() removes focus from address bar in Firefox
6406			// which can become a usability and annoying problem with tabs('rotate').
6407			if ($.browser.msie) {
6408				this.blur();
6409			}
6410
6411		});
6412
6413		// disable click in any case
6414		this.anchors.bind('click.tabs', function(){return false;});
6415
6416	},
6417
6418	destroy: function() {
6419		var o = this.options;
6420
6421		this.abort();
6422		
6423		this.element.unbind('.tabs')
6424			.removeClass('ui-tabs ui-widget ui-widget-content ui-corner-all ui-tabs-collapsible')
6425			.removeData('tabs');
6426
6427		this.list.removeClass('ui-tabs-nav ui-helper-reset ui-helper-clearfix ui-widget-header ui-corner-all');
6428
6429		this.anchors.each(function() {
6430			var href = $.data(this, 'href.tabs');
6431			if (href) {
6432				this.href = href;
6433			}
6434			var $this = $(this).unbind('.tabs');
6435			$.each(['href', 'load', 'cache'], function(i, prefix) {
6436				$this.removeData(prefix + '.tabs');
6437			});
6438		});
6439
6440		this.lis.unbind('.tabs').add(this.panels).each(function() {
6441			if ($.data(this, 'destroy.tabs')) {
6442				$(this).remove();
6443			}
6444			else {
6445				$(this).removeClass([
6446					'ui-state-default',
6447					'ui-corner-top',
6448					'ui-tabs-selected',
6449					'ui-state-active',
6450					'ui-state-hover',
6451					'ui-state-focus',
6452					'ui-state-disabled',
6453					'ui-tabs-panel',
6454					'ui-widget-content',
6455					'ui-corner-bottom',
6456					'ui-tabs-hide'
6457				].join(' '));
6458			}
6459		});
6460
6461		if (o.cookie) {
6462			this._cookie(null, o.cookie);
6463		}
6464	},
6465
6466	add: function(url, label, index) {
6467		if (index === undefined) {
6468			index = this.anchors.length; // append by default
6469		}
6470
6471		var self = this, o = this.options,
6472			$li = $(o.tabTemplate.replace(/#\{href\}/g, url).replace(/#\{label\}/g, label)),
6473			id = !url.indexOf('#') ? url.replace('#', '') : this._tabId($('a', $li)[0]);
6474
6475		$li.addClass('ui-state-default ui-corner-top').data('destroy.tabs', true);
6476
6477		// try to find an existing element before creating a new one
6478		var $panel = $('#' + id);
6479		if (!$panel.length) {
6480			$panel = $(o.panelTemplate).attr('id', id).data('destroy.tabs', true);
6481		}
6482		$panel.addClass('ui-tabs-panel ui-widget-content ui-corner-bottom ui-tabs-hide');
6483
6484		if (index >= this.lis.length) {
6485			$li.appendTo(this.list);
6486			$panel.appendTo(this.list[0].parentNode);
6487		}
6488		else {
6489			$li.insertBefore(this.lis[index]);
6490			$panel.insertBefore(this.panels[index]);
6491		}
6492
6493		o.disabled = $.map(o.disabled,
6494			function(n, i) { return n >= index ? ++n : n; });
6495
6496		this._tabify();
6497
6498		if (this.anchors.length == 1) { // after tabify
6499			$li.addClass('ui-tabs-selected ui-state-active');
6500			$panel.removeClass('ui-tabs-hide');
6501			this.element.queue("tabs", function() {
6502				self._trigger('show', null, self._ui(self.anchors[0], self.panels[0]));
6503			});
6504				
6505			this.load(0);
6506		}
6507
6508		// callback
6509		this._trigger('add', null, this._ui(this.anchors[index], this.panels[index]));
6510	},
6511
6512	remove: function(index) {
6513		var o = this.options, $li = this.lis.eq(index).remove(),
6514			$panel = this.panels.eq(index).remove();
6515
6516		// If selected tab was removed focus tab to the right or
6517		// in case the last tab was removed the tab to the left.
6518		if ($li.hasClass('ui-tabs-selected') && this.anchors.length > 1) {
6519			this.select(index + (index + 1 < this.anchors.length ? 1 : -1));
6520		}
6521
6522		o.disabled = $.map($.grep(o.disabled, function(n, i) { return n != index; }),
6523			function(n, i) { return n >= index ? --n : n; });
6524
6525		this._tabify();
6526
6527		// callback
6528		this._trigger('remove', null, this._ui($li.find('a')[0], $panel[0]));
6529	},
6530
6531	enable: function(index) {
6532		var o = this.options;
6533		if ($.inArray(index, o.disabled) == -1) {
6534			return;
6535		}
6536
6537		this.lis.eq(index).removeClass('ui-state-disabled');
6538		o.disabled = $.grep(o.disabled, function(n, i) { return n != index; });
6539
6540		// callback
6541		this._trigger('enable', null, this._ui(this.anchors[index], this.panels[index]));
6542	},
6543
6544	disable: function(index) {
6545		var self = this, o = this.options;
6546		if (index != o.selected) { // cannot disable already selected tab
6547			this.lis.eq(index).addClass('ui-state-disabled');
6548
6549			o.disabled.push(index);
6550			o.disabled.sort();
6551
6552			// callback
6553			this._trigger('disable', null, this._ui(this.anchors[index], this.panels[index]));
6554		}
6555	},
6556
6557	select: function(index) {
6558		if (typeof index == 'string') {
6559			index = this.anchors.index(this.anchors.filter('[href$=' + index + ']'));
6560		}
6561		else if (index === null) { // usage of null is deprecated, TODO remove in next release
6562			index = -1;
6563		}
6564		if (index == -1 && this.options.collapsible) {
6565			index = this.options.selected;
6566		}
6567
6568		this.anchors.eq(index).trigger(this.options.event + '.tabs');
6569	},
6570
6571	load: function(index) {
6572		var self = this, o = this.options, a = this.anchors.eq(index)[0], url = $.data(a, 'load.tabs');
6573
6574		this.abort();
6575
6576		// not remote or from cache
6577		if (!url || this.element.queue("tabs").length !== 0 && $.data(a, 'cache.tabs')) {
6578			this.element.dequeue("tabs");
6579			return;
6580		}
6581
6582		// load remote from here on
6583		this.lis.eq(index).addClass('ui-state-processing');
6584
6585		if (o.spinner) {
6586			var span = $('span', a);
6587			span.data('label.tabs', span.html()).html(o.spinner);
6588		}
6589
6590		this.xhr = $.ajax($.extend({}, o.ajaxOptions, {
6591			url: url,
6592			success: function(r, s) {
6593				$(self._sanitizeSelector(a.hash)).html(r);
6594
6595				// take care of tab labels
6596				self._cleanup();
6597
6598				if (o.cache) {
6599					$.data(a, 'cache.tabs', true); // if loaded once do not load them again
6600				}
6601
6602				// callbacks
6603				self._trigger('load', null, self._ui(self.anchors[index], self.panels[index]));
6604				try {
6605					o.ajaxOptions.success(r, s);
6606				}
6607				catch (e) {}
6608
6609				// last, so that load event is fired before show...
6610				self.element.dequeue("tabs");
6611			}
6612		}));
6613	},
6614
6615	abort: function() {
6616		// stop possibly running animations
6617		this.element.queue([]);
6618		this.panels.stop(false, true);
6619
6620		// terminate pending requests from other tabs
6621		if (this.xhr) {
6622			this.xhr.abort();
6623			delete this.xhr;
6624		}
6625
6626		// take care of tab labels
6627		this._cleanup();
6628
6629	},
6630
6631	url: function(index, url) {
6632		this.anchors.eq(index).removeData('cache.tabs').data('load.tabs', url);
6633	},
6634
6635	length: function() {
6636		return this.anchors.length;
6637	}
6638
6639});
6640
6641$.extend($.ui.tabs, {
6642	version: '1.7.3',
6643	getter: 'length',
6644	defaults: {
6645		ajaxOptions: null,
6646		cache: false,
6647		cookie: null, // e.g. { expires: 7, path: '/', domain: 'jquery.com', secure: true }
6648		collapsible: false,
6649		disabled: [],
6650		event: 'click',
6651		fx: null, // e.g. { height: 'toggle', opacity: 'toggle', duration: 200 }
6652		idPrefix: 'ui-tabs-',
6653		panelTemplate: '<div></div>',
6654		spinner: '<em>Loading&#8230;</em>',
6655		tabTemplate: '<li><a href="#{href}"><span>#{label}</span></a></li>'
6656	}
6657});
6658
6659/*
6660 * Tabs Extensions
6661 */
6662
6663/*
6664 * Rotate
6665 */
6666$.extend($.ui.tabs.prototype, {
6667	rotation: null,
6668	rotate: function(ms, continuing) {
6669
6670		var self = this, o = this.options;
6671		
6672		var rotate = self._rotate || (self._rotate = function(e) {
6673			clearTimeout(self.rotation);
6674			self.rotation = setTimeout(function() {
6675				var t = o.selected;
6676				self.select( ++t < self.anchors.length ? t : 0 );
6677			}, ms);
6678			
6679			if (e) {
6680				e.stopPropagation();
6681			}
6682		});
6683		
6684		var stop = self._unrotate || (self._unrotate = !continuing ?
6685			function(e) {
6686				if (e.clientX) { // in case of a true click
6687					self.rotate(null);
6688				}
6689			} :
6690			function(e) {
6691				t = o.selected;
6692				rotate();
6693			});
6694
6695		// start rotation
6696		if (ms) {
6697			this.element.bind('tabsshow', rotate);
6698			this.anchors.bind(o.event + '.tabs', stop);
6699			rotate();
6700		}
6701		// stop rotation
6702		else {
6703			clearTimeout(self.rotation);
6704			this.element.unbind('tabsshow', rotate);
6705			this.anchors.unbind(o.event + '.tabs', stop);
6706			delete this._rotate;
6707			delete this._unrotate;
6708		}
6709	}
6710});
6711
6712})(jQuery);
6713/*
6714 * jQuery UI Datepicker 1.7.3
6715 *
6716 * Copyright (c) 2009 AUTHORS.txt (https://jqueryui.com/about)
6717 * Dual licensed under the MIT (MIT-LICENSE.txt)
6718 * and GPL (GPL-LICENSE.txt) licenses.
6719 *
6720 * https://docs.jquery.com/UI/Datepicker
6721 *
6722 * Depends:
6723 *	ui.core.js
6724 */
6725
6726(function($) { // hide the namespace
6727
6728$.extend($.ui, { datepicker: { version: "1.7.3" } });
6729
6730var PROP_NAME = 'datepicker';
6731
6732/* Date picker manager.
6733   Use the singleton instance of this class, $.datepicker, to interact with the date picker.
6734   Settings for (groups of) date pickers are maintained in an instance object,
6735   allowing multiple different settings on the same page. */
6736
6737function Datepicker() {
6738	this.debug = false; // Change this to true to start debugging
6739	this._curInst = null; // The current instance in use
6740	this._keyEvent = false; // If the last event was a key event
6741	this._disabledInputs = []; // List of date picker inputs that have been disabled
6742	this._datepickerShowing = false; // True if the popup picker is showing , false if not
6743	this._inDialog = false; // True if showing within a "dialog", false if not
6744	this._mainDivId = 'ui-datepicker-div'; // The ID of the main datepicker division
6745	this._inlineClass = 'ui-datepicker-inline'; // The name of the inline marker class
6746	this._appendClass = 'ui-datepicker-append'; // The name of the append marker class
6747	this._triggerClass = 'ui-datepicker-trigger'; // The name of the trigger marker class
6748	this._dialogClass = 'ui-datepicker-dialog'; // The name of the dialog marker class
6749	this._disableClass = 'ui-datepicker-disabled'; // The name of the disabled covering marker class
6750	this._unselectableClass = 'ui-datepicker-unselectable'; // The name of the unselectable cell marker class
6751	this._currentClass = 'ui-datepicker-current-day'; // The name of the current day marker class
6752	this._dayOverClass = 'ui-datepicker-days-cell-over'; // The name of the day hover marker class
6753	this.regional = []; // Available regional settings, indexed by language code
6754	this.regional[''] = { // Default regional settings
6755		closeText: 'Done', // Display text for close link
6756		prevText: 'Prev', // Display text for previous month link
6757		nextText: 'Next', // Display text for next month link
6758		currentText: 'Today', // Display text for current month link
6759		monthNames: ['January','February','March','April','May','June',
6760			'July','August','September','October','November','December'], // Names of months for drop-down and formatting
6761		monthNamesShort: ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec'], // For formatting
6762		dayNames: ['Sunday', 'Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday'], // For formatting
6763		dayNamesShort: ['Sun', 'Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat'], // For formatting
6764		dayNamesMin: ['Su','Mo','Tu','We','Th','Fr','Sa'], // Column headings for days starting at Sunday
6765		dateFormat: 'mm/dd/yy', // See format options on parseDate
6766		firstDay: 0, // The first day of the week, Sun = 0, Mon = 1, ...
6767		isRTL: false // True if right-to-left language, false if left-to-right
6768	};
6769	this._defaults = { // Global defaults for all the date picker instances
6770		showOn: 'focus', // 'focus' for popup on focus,
6771			// 'button' for trigger button, or 'both' for either
6772		showAnim: 'show', // Name of jQuery animation for popup
6773		showOptions: {}, // Options for enhanced animations
6774		defaultDate: null, // Used when field is blank: actual date,
6775			// +/-number for offset from today, null for today
6776		appendText: '', // Display text following the input box, e.g. showing the format
6777		buttonText: '...', // Text for trigger button
6778		buttonImage: '', // URL for trigger button image
6779		buttonImageOnly: false, // True if the image appears alone, false if it appears on a button
6780		hideIfNoPrevNext: false, // True to hide next/previous month links
6781			// if not applicable, false to just disable them
6782		navigationAsDateFormat: false, // True if date formatting applied to prev/today/next links
6783		gotoCurrent: false, // True if today link goes back to current selection instead
6784		changeMonth: false, // True if month can be selected directly, false if only prev/next
6785		changeYear: false, // True if year can be selected directly, false if only prev/next
6786		showMonthAfterYear: false, // True if the year select precedes month, false for month then year
6787		yearRange: '-10:+10', // Range of years to display in drop-down,
6788			// either relative to current year (-nn:+nn) or absolute (nnnn:nnnn)
6789		showOtherMonths: false, // True to show dates in other months, false to leave blank
6790		calculateWeek: this.iso8601Week, // How to calculate the week of the year,
6791			// takes a Date and returns the number of the week for it
6792		shortYearCutoff: '+10', // Short year values < this are in the current century,
6793			// > this are in the previous century,
6794			// string value starting with '+' for current year + value
6795		minDate: null, // The earliest selectable date, or null for no limit
6796		maxDate: null, // The latest selectable date, or null for no limit
6797		duration: 'normal', // Duration of display/closure
6798		beforeShowDay: null, // Function that takes a date and returns an array with
6799			// [0] = true if selectable, false if not, [1] = custom CSS class name(s) or '',
6800			// [2] = cell title (optional), e.g. $.datepicker.noWeekends
6801		beforeShow: null, // Function that takes an input field and
6802			// returns a set of custom settings for the date picker
6803		onSelect: null, // Define a callback function when a date is selected
6804		onChangeMonthYear: null, // Define a callback function when the month or year is changed
6805		onClose: null, // Define a callback function when the datepicker is closed
6806		numberOfMonths: 1, // Number of months to show at a time
6807		showCurrentAtPos: 0, // The position in multipe months at which to show the current month (starting at 0)
6808		stepMonths: 1, // Number of months to step back/forward
6809		stepBigMonths: 12, // Number of months to step back/forward for the big links
6810		altField: '', // Selector for an alternate field to store selected dates into
6811		altFormat: '', // The date format to use for the alternate field
6812		constrainInput: true, // The input is constrained by the current date format
6813		showButtonPanel: false // True to show button panel, false to not show it
6814	};
6815	$.extend(this._defaults, this.regional['']);
6816	this.dpDiv = $('<div id="' + this._mainDivId + '" class="ui-datepicker ui-widget ui-widget-content ui-helper-clearfix ui-corner-all ui-helper-hidden-accessible"></div>');
6817}
6818
6819$.extend(Datepicker.prototype, {
6820	/* Class name added to elements to indicate already configured with a date picker. */
6821	markerClassName: 'hasDatepicker',
6822
6823	/* Debug logging (if enabled). */
6824	log: function () {
6825		if (this.debug)
6826			console.log.apply('', arguments);
6827	},
6828
6829	/* Override the default settings for all instances of the date picker.
6830	   @param  settings  object - the new settings to use as defaults (anonymous object)
6831	   @return the manager object */
6832	setDefaults: function(settings) {
6833		extendRemove(this._defaults, settings || {});
6834		return this;
6835	},
6836
6837	/* Attach the date picker to a jQuery selection.
6838	   @param  target    element - the target input field or division or span
6839	   @param  settings  object - the new settings to use for this date picker instance (anonymous) */
6840	_attachDatepicker: function(target, settings) {
6841		// check for settings on the control itself - in namespace 'date:'
6842		var inlineSettings = null;
6843		for (var attrName in this._defaults) {
6844			var attrValue = target.getAttribute('date:' + attrName);
6845			if (attrValue) {
6846				inlineSettings = inlineSettings || {};
6847				try {
6848					inlineSettings[attrName] = eval(attrValue);
6849				} catch (err) {
6850					inlineSettings[attrName] = attrValue;
6851				}
6852			}
6853		}
6854		var nodeName = target.nodeName.toLowerCase();
6855		var inline = (nodeName == 'div' || nodeName == 'span');
6856		if (!target.id)
6857			target.id = 'dp' + (++this.uuid);
6858		var inst = this._newInst($(target), inline);
6859		inst.settings = $.extend({}, settings || {}, inlineSettings || {});
6860		if (nodeName == 'input') {
6861			this._connectDatepicker(target, inst);
6862		} else if (inline) {
6863			this._inlineDatepicker(target, inst);
6864		}
6865	},
6866
6867	/* Create a new instance object. */
6868	_newInst: function(target, inline) {
6869		var id = target[0].id.replace(/([:\[\]\.])/g, '\\\\$1'); // escape jQuery meta chars
6870		return {id: id, input: target, // associated target
6871			selectedDay: 0, selectedMonth: 0, selectedYear: 0, // current selection
6872			drawMonth: 0, drawYear: 0, // month being drawn
6873			inline: inline, // is datepicker inline or not
6874			dpDiv: (!inline ? this.dpDiv : // presentation div
6875			$('<div class="' + this._inlineClass + ' ui-datepicker ui-widget ui-widget-content ui-helper-clearfix ui-corner-all"></div>'))};
6876	},
6877
6878	/* Attach the date picker to an input field. */
6879	_connectDatepicker: function(target, inst) {
6880		var input = $(target);
6881		inst.append = $([]);
6882		inst.trigger = $([]);
6883		if (input.hasClass(this.markerClassName))
6884			return;
6885		var appendText = this._get(inst, 'appendText');
6886		var isRTL = this._get(inst, 'isRTL');
6887		if (appendText) {
6888			inst.append = $('<span class="' + this._appendClass + '">' + appendText + '</span>');
6889			input[isRTL ? 'before' : 'after'](inst.append);
6890		}
6891		var showOn = this._get(inst, 'showOn');
6892		if (showOn == 'focus' || showOn == 'both') // pop-up date picker when in the marked field
6893			input.focus(this._showDatepicker);
6894		if (showOn == 'button' || showOn == 'both') { // pop-up date picker when button clicked
6895			var buttonText = this._get(inst, 'buttonText');
6896			var buttonImage = this._get(inst, 'buttonImage');
6897			inst.trigger = $(this._get(inst, 'buttonImageOnly') ?
6898				$('<img/>').addClass(this._triggerClass).
6899					attr({ src: buttonImage, alt: buttonText, title: buttonText }) :
6900				$('<button type="button"></button>').addClass(this._triggerClass).
6901					html(buttonImage == '' ? buttonText : $('<img/>').attr(
6902					{ src:buttonImage, alt:buttonText, title:buttonText })));
6903			input[isRTL ? 'before' : 'after'](inst.trigger);
6904			inst.trigger.click(function() {
6905				if ($.datepicker._datepickerShowing && $.datepicker._lastInput == target)
6906					$.datepicker._hideDatepicker();
6907				else
6908					$.datepicker._showDatepicker(target);
6909				return false;
6910			});
6911		}
6912		input.addClass(this.markerClassName).keydown(this._doKeyDown).keypress(this._doKeyPress).
6913			bind("setData.datepicker", function(event, key, value) {
6914				inst.settings[key] = value;
6915			}).bind("getData.datepicker", function(event, key) {
6916				return this._get(inst, key);
6917			});
6918		$.data(target, PROP_NAME, inst);
6919	},
6920
6921	/* Attach an inline date picker to a div. */
6922	_inlineDatepicker: function(target, inst) {
6923		var divSpan = $(target);
6924		if (divSpan.hasClass(this.markerClassName))
6925			return;
6926		divSpan.addClass(this.markerClassName).append(inst.dpDiv).
6927			bind("setData.datepicker", function(event, key, value){
6928				inst.settings[key] = value;
6929			}).bind("getData.datepicker", function(event, key){
6930				return this._get(inst, key);
6931			});
6932		$.data(target, PROP_NAME, inst);
6933		this._setDate(inst, this._getDefaultDate(inst));
6934		this._updateDatepicker(inst);
6935		this._updateAlternate(inst);
6936	},
6937
6938	/* Pop-up the date picker in a "dialog" box.
6939	   @param  input     element - ignored
6940	   @param  dateText  string - the initial date to display (in the current format)
6941	   @param  onSelect  function - the function(dateText) to call when a date is selected
6942	   @param  settings  object - update the dialog date picker instance's settings (anonymous object)
6943	   @param  pos       int[2] - coordinates for the dialog's position within the screen or
6944	                     event - with x/y coordinates or
6945	                     leave empty for default (screen centre)
6946	   @return the manager object */
6947	_dialogDatepicker: function(input, dateText, onSelect, settings, pos) {
6948		var inst = this._dialogInst; // internal instance
6949		if (!inst) {
6950			var id = 'dp' + (++this.uuid);
6951			this._dialogInput = $('<input type="text" id="' + id +
6952				'" size="1" style="position: absolute; top: -100px;"/>');
6953			this._dialogInput.keydown(this._doKeyDown);
6954			$('body').append(this._dialogInput);
6955			inst = this._dialogInst = this._newInst(this._dialogInput, false);
6956			inst.settings = {};
6957			$.data(this._dialogInput[0], PROP_NAME, inst);
6958		}
6959		extendRemove(inst.settings, settings || {});
6960		this._dialogInput.val(dateText);
6961
6962		this._pos = (pos ? (pos.length ? pos : [pos.pageX, pos.pageY]) : null);
6963		if (!this._pos) {
6964			var browserWidth = window.innerWidth || document.documentElement.clientWidth ||	document.body.clientWidth;
6965			var browserHeight = window.innerHeight || document.documentElement.clientHeight || document.body.clientHeight;
6966			var scrollX = document.documentElement.scrollLeft || document.body.scrollLeft;
6967			var scrollY = document.documentElement.scrollTop || document.body.scrollTop;
6968			this._pos = // should use actual width/height below
6969				[(browserWidth / 2) - 100 + scrollX, (browserHeight / 2) - 150 + scrollY];
6970		}
6971
6972		// move input on screen for focus, but hidden behind dialog
6973		this._dialogInput.css('left', this._pos[0] + 'px').css('top', this._pos[1] + 'px');
6974		inst.settings.onSelect = onSelect;
6975		this._inDialog = true;
6976		this.dpDiv.addClass(this._dialogClass);
6977		this._showDatepicker(this._dialogInput[0]);
6978		if ($.blockUI)
6979			$.blockUI(this.dpDiv);
6980		$.data(this._dialogInput[0], PROP_NAME, inst);
6981		return this;
6982	},
6983
6984	/* Detach a datepicker from its control.
6985	   @param  target    element - the target input field or division or span */
6986	_destroyDatepicker: function(target) {
6987		var $target = $(target);
6988		var inst = $.data(target, PROP_NAME);
6989		if (!$target.hasClass(this.markerClassName)) {
6990			return;
6991		}
6992		var nodeName = target.nodeName.toLowerCase();
6993		$.removeData(target, PROP_NAME);
6994		if (nodeName == 'input') {
6995			inst.append.remove();
6996			inst.trigger.remove();
6997			$target.removeClass(this.markerClassName).
6998				unbind('focus', this._showDatepicker).
6999				unbind('keydown', this._doKeyDown).
7000				unbind('keypress', this._doKeyPress);
7001		} else if (nodeName == 'div' || nodeName == 'span')
7002			$target.removeClass(this.markerClassName).empty();
7003	},
7004
7005	/* Enable the date picker to a jQuery selection.
7006	   @param  target    element - the target input field or division or span */
7007	_enableDatepicker: function(target) {
7008		var $target = $(target);
7009		var inst = $.data(target, PROP_NAME);
7010		if (!$target.hasClass(this.markerClassName)) {
7011			return;
7012		}
7013		var nodeName = target.nodeName.toLowerCase();
7014		if (nodeName == 'input') {
7015			target.disabled = false;
7016			inst.trigger.filter('button').
7017				each(function() { this.disabled = false; }).end().
7018				filter('img').css({opacity: '1.0', cursor: ''});
7019		}
7020		else if (nodeName == 'div' || nodeName == 'span') {
7021			var inline = $target.children('.' + this._inlineClass);
7022			inline.children().removeClass('ui-state-disabled');
7023		}
7024		this._disabledInputs = $.map(this._disabledInputs,
7025			function(value) { return (value == target ? null : value); }); // delete entry
7026	},
7027
7028	/* Disable the date picker to a jQuery selection.
7029	   @param  target    element - the target input field or division or span */
7030	_disableDatepicker: function(target) {
7031		var $target = $(target);
7032		var inst = $.data(target, PROP_NAME);
7033		if (!$target.hasClass(this.markerClassName)) {
7034			return;
7035		}
7036		var nodeName = target.nodeName.toLowerCase();
7037		if (nodeName == 'input') {
7038			target.disabled = true;
7039			inst.trigger.filter('button').
7040				each(function() { this.disabled = true; }).end().
7041				filter('img').css({opacity: '0.5', cursor: 'default'});
7042		}
7043		else if (nodeName == 'div' || nodeName == 'span') {
7044			var inline = $target.children('.' + this._inlineClass);
7045			inline.children().addClass('ui-state-disabled');
7046		}
7047		this._disabledInputs = $.map(this._disabledInputs,
7048			function(value) { return (value == target ? null : value); }); // delete entry
7049		this._disabledInputs[this._disabledInputs.length] = target;
7050	},
7051
7052	/* Is the first field in a jQuery collection disabled as a datepicker?
7053	   @param  target    element - the target input field or division or span
7054	   @return boolean - true if disabled, false if enabled */
7055	_isDisabledDatepicker: function(target) {
7056		if (!target) {
7057			return false;
7058		}
7059		for (var i = 0; i < this._disabledInputs.length; i++) {
7060			if (this._disabledInputs[i] == target)
7061				return true;
7062		}
7063		return false;
7064	},
7065
7066	/* Retrieve the instance data for the target control.
7067	   @param  target  element - the target input field or division or span
7068	   @return  object - the associated instance data
7069	   @throws  error if a jQuery problem getting data */
7070	_getInst: function(target) {
7071		try {
7072			return $.data(target, PROP_NAME);
7073		}
7074		catch (err) {
7075			throw 'Missing instance data for this datepicker';
7076		}
7077	},
7078
7079	/* Update or retrieve the settings for a date picker attached to an input field or division.
7080	   @param  target  element - the target input field or division or span
7081	   @param  name    object - the new settings to update or
7082	                   string - the name of the setting to change or retrieve,
7083	                   when retrieving also 'all' for all instance settings or
7084	                   'defaults' for all global defaults
7085	   @param  value   any - the new value for the setting
7086	                   (omit if above is an object or to retrieve a value) */
7087	_optionDatepicker: function(target, name, value) {
7088		var inst = this._getInst(target);
7089		if (arguments.length == 2 && typeof name == 'string') {
7090			return (name == 'defaults' ? $.extend({}, $.datepicker._defaults) :
7091				(inst ? (name == 'all' ? $.extend({}, inst.settings) :
7092				this._get(inst, name)) : null));
7093		}
7094		var settings = name || {};
7095		if (typeof name == 'string') {
7096			settings = {};
7097			settings[name] = value;
7098		}
7099		if (inst) {
7100			if (this._curInst == inst) {
7101				this._hideDatepicker(null);
7102			}
7103			var date = this._getDateDatepicker(target);
7104			extendRemove(inst.settings, settings);
7105			this._setDateDatepicker(target, date);
7106			this._updateDatepicker(inst);
7107		}
7108	},
7109
7110	// change method deprecated
7111	_changeDatepicker: function(target, name, value) {
7112		this._optionDatepicker(target, name, value);
7113	},
7114
7115	/* Redraw the date picker attached to an input field or division.
7116	   @param  target  element - the target input field or division or span */
7117	_refreshDatepicker: function(target) {
7118		var inst = this._getInst(target);
7119		if (inst) {
7120			this._updateDatepicker(inst);
7121		}
7122	},
7123
7124	/* Set the dates for a jQuery selection.
7125	   @param  target   element - the target input field or division or span
7126	   @param  date     Date - the new date
7127	   @param  endDate  Date - the new end date for a range (optional) */
7128	_setDateDatepicker: function(target, date, endDate) {
7129		var inst = this._getInst(target);
7130		if (inst) {
7131			this._setDate(inst, date, endDate);
7132			this._updateDatepicker(inst);
7133			this._updateAlternate(inst);
7134		}
7135	},
7136
7137	/* Get the date(s) for the first entry in a jQuery selection.
7138	   @param  target  element - the target input field or division or span
7139	   @return Date - the current date or
7140	           Date[2] - the current dates for a range */
7141	_getDateDatepicker: function(target) {
7142		var inst = this._getInst(target);
7143		if (inst && !inst.inline)
7144			this._setDateFromField(inst);
7145		return (inst ? this._getDate(inst) : null);
7146	},
7147
7148	/* Handle keystrokes. */
7149	_doKeyDown: function(event) {
7150		var inst = $.datepicker._getInst(event.target);
7151		var handled = true;
7152		var isRTL = inst.dpDiv.is('.ui-datepicker-rtl');
7153		inst._keyEvent = true;
7154		if ($.datepicker._datepickerShowing)
7155			switch (event.keyCode) {
7156				case 9:  $.datepicker._hideDatepicker(null, '');
7157						break; // hide on tab out
7158				case 13: var sel = $('td.' + $.datepicker._dayOverClass +
7159							', td.' + $.datepicker._currentClass, inst.dpDiv);
7160						if (sel[0])
7161							$.datepicker._selectDay(event.target, inst.selectedMonth, inst.selectedYear, sel[0]);
7162						else
7163							$.datepicker._hideDatepicker(null, $.datepicker._get(inst, 'duration'));
7164						return false; // don't submit the form
7165						break; // select the value on enter
7166				case 27: $.datepicker._hideDatepicker(null, $.datepicker._get(inst, 'duration'));
7167						break; // hide on escape
7168				case 33: $.datepicker._adjustDate(event.target, (event.ctrlKey ?
7169							-$.datepicker._get(inst, 'stepBigMonths') :
7170							-$.datepicker._get(inst, 'stepMonths')), 'M');
7171						break; // previous month/year on page up/+ ctrl
7172				case 34: $.datepicker._adjustDate(event.target, (event.ctrlKey ?
7173							+$.datepicker._get(inst, 'stepBigMonths') :
7174							+$.datepicker._get(inst, 'stepMonths')), 'M');
7175						break; // next month/year on page down/+ ctrl
7176				case 35: if (event.ctrlKey || event.metaKey) $.datepicker._clearDate(event.target);
7177						handled = event.ctrlKey || event.metaKey;
7178						break; // clear on ctrl or command +end
7179				case 36: if (event.ctrlKey || event.metaKey) $.datepicker._gotoToday(event.target);
7180						handled = event.ctrlKey || event.metaKey;
7181						break; // current on ctrl or command +home
7182				case 37: if (event.ctrlKey || event.metaKey) $.datepicker._adjustDate(event.target, (isRTL ? +1 : -1), 'D');
7183						handled = event.ctrlKey || event.metaKey;
7184						// -1 day on ctrl or command +left
7185						if (event.originalEvent.altKey) $.datepicker._adjustDate(event.target, (event.ctrlKey ?
7186									-$.datepicker._get(inst, 'stepBigMonths') :
7187									-$.datepicker._get(inst, 'stepMonths')), 'M');
7188						// next month/year on alt +left on Mac
7189						break;
7190				case 38: if (event.ctrlKey || event.metaKey) $.datepicker._adjustDate(event.target, -7, 'D');
7191						handled = event.ctrlKey || event.metaKey;
7192						break; // -1 week on ctrl or command +up
7193				case 39: if (event.ctrlKey || event.metaKey) $.datepicker._adjustDate(event.target, (isRTL ? -1 : +1), 'D');
7194						handled = event.ctrlKey || event.metaKey;
7195						// +1 day on ctrl or command +right
7196						if (event.originalEvent.altKey) $.datepicker._adjustDate(event.target, (event.ctrlKey ?
7197									+$.datepicker._get(inst, 'stepBigMonths') :
7198									+$.datepicker._get(inst, 'stepMonths')), 'M');
7199						// next month/year on alt +right
7200						break;
7201				case 40: if (event.ctrlKey || event.metaKey) $.datepicker._adjustDate(event.target, +7, 'D');
7202						handled = event.ctrlKey || event.metaKey;
7203						break; // +1 week on ctrl or command +down
7204				default: handled = false;
7205			}
7206		else if (event.keyCode == 36 && event.ctrlKey) // display the date picker on ctrl+home
7207			$.datepicker._showDatepicker(this);
7208		else {
7209			handled = false;
7210		}
7211		if (handled) {
7212			event.preventDefault();
7213			event.stopPropagation();
7214		}
7215	},
7216
7217	/* Filter entered characters - based on date format. */
7218	_doKeyPress: function(event) {
7219		var inst = $.datepicker._getInst(event.target);
7220		if ($.datepicker._get(inst, 'constrainInput')) {
7221			var chars = $.datepicker._possibleChars($.datepicker._get(inst, 'dateFormat'));
7222			var chr = String.fromCharCode(event.charCode == undefined ? event.keyCode : event.charCode);
7223			return event.ctrlKey || (chr < ' ' || !chars || chars.indexOf(chr) > -1);
7224		}
7225	},
7226
7227	/* Pop-up the date picker for a given input field.
7228	   @param  input  element - the input field attached to the date picker or
7229	                  event - if triggered by focus */
7230	_showDatepicker: function(input) {
7231		input = input.target || input;
7232		if (input.nodeName.toLowerCase() != 'input') // find from button/image trigger
7233			input = $('input', input.parentNode)[0];
7234		if ($.datepicker._isDisabledDatepicker(input) || $.datepicker._lastInput == input) // already here
7235			return;
7236		var inst = $.datepicker._getInst(input);
7237		var beforeShow = $.datepicker._get(inst, 'beforeShow');
7238		extendRemove(inst.settings, (beforeShow ? beforeShow.apply(input, [input, inst]) : {}));
7239		$.datepicker._hideDatepicker(null, '');
7240		$.datepicker._lastInput = input;
7241		$.datepicker._setDateFromField(inst);
7242		if ($.datepicker._inDialog) // hide cursor
7243			input.value = '';
7244		if (!$.datepicker._pos) { // position below input
7245			$.datepicker._pos = $.datepicker._findPos(input);
7246			$.datepicker._pos[1] += input.offsetHeight; // add the height
7247		}
7248		var isFixed = false;
7249		$(input).parents().each(function() {
7250			isFixed |= $(this).css('position') == 'fixed';
7251			return !isFixed;
7252		});
7253		if (isFixed && $.browser.opera) { // correction for Opera when fixed and scrolled
7254			$.datepicker._pos[0] -= document.documentElement.scrollLeft;
7255			$.datepicker._pos[1] -= document.documentElement.scrollTop;
7256		}
7257		var offset = {left: $.datepicker._pos[0], top: $.datepicker._pos[1]};
7258		$.datepicker._pos = null;
7259		inst.rangeStart = null;
7260		// determine sizing offscreen
7261		inst.dpDiv.css({position: 'absolute', display: 'block', top: '-1000px'});
7262		$.datepicker._updateDatepicker(inst);
7263		// fix width for dynamic number of date pickers
7264		// and adjust position before showing
7265		offset = $.datepicker._checkOffset(inst, offset, isFixed);
7266		inst.dpDiv.css({position: ($.datepicker._inDialog && $.blockUI ?
7267			'static' : (isFixed ? 'fixed' : 'absolute')), display: 'none',
7268			left: offset.left + 'px', top: offset.top + 'px'});
7269		if (!inst.inline) {
7270			var showAnim = $.datepicker._get(inst, 'showAnim') || 'show';
7271			var duration = $.datepicker._get(inst, 'duration');
7272			var postProcess = function() {
7273				$.datepicker._datepickerShowing = true;
7274				if ($.browser.msie && parseInt($.browser.version,10) < 7) // fix IE < 7 select problems
7275					$('iframe.ui-datepicker-cover').css({width: inst.dpDiv.width() + 4,
7276						height: inst.dpDiv.height() + 4});
7277			};
7278			if ($.effects && $.effects[showAnim])
7279				inst.dpDiv.show(showAnim, $.datepicker._get(inst, 'showOptions'), duration, postProcess);
7280			else
7281				inst.dpDiv[showAnim](duration, postProcess);
7282			if (duration == '')
7283				postProcess();
7284			if (inst.input[0].type != 'hidden')
7285				inst.input[0].focus();
7286			$.datepicker._curInst = inst;
7287		}
7288	},
7289
7290	/* Generate the date picker content. */
7291	_updateDatepicker: function(inst) {
7292		var dims = {width: inst.dpDiv.width() + 4,
7293			height: inst.dpDiv.height() + 4};
7294		var self = this;
7295		inst.dpDiv.empty().append(this._generateHTML(inst))
7296			.find('iframe.ui-datepicker-cover').
7297				css({width: dims.width, height: dims.height})
7298			.end()
7299			.find('button, .ui-datepicker-prev, .ui-datepicker-next, .ui-datepicker-calendar td a')
7300				.bind('mouseout', function(){
7301					$(this).removeClass('ui-state-hover');
7302					if(this.className.indexOf('ui-datepicker-prev') != -1) $(this).removeClass('ui-datepicker-prev-hover');
7303					if(this.className.indexOf('ui-datepicker-next') != -1) $(this).removeClass('ui-datepicker-next-hover');
7304				})
7305				.bind('mouseover', function(){
7306					if (!self._isDisabledDatepicker( inst.inline ? inst.dpDiv.parent()[0] : inst.input[0])) {
7307						$(this).parents('.ui-datepicker-calendar').find('a').removeClass('ui-state-hover');
7308						$(this).addClass('ui-state-hover');
7309						if(this.className.indexOf('ui-datepicker-prev') != -1) $(this).addClass('ui-datepicker-prev-hover');
7310						if(this.className.indexOf('ui-datepicker-next') != -1) $(this).addClass('ui-datepicker-next-hover');
7311					}
7312				})
7313			.end()
7314			.find('.' + this._dayOverClass + ' a')
7315				.trigger('mouseover')
7316			.end();
7317		var numMonths = this._getNumberOfMonths(inst);
7318		var cols = numMonths[1];
7319		var width = 17;
7320		if (cols > 1) {
7321			inst.dpDiv.addClass('ui-datepicker-multi-' + cols).css('width', (width * cols) + 'em');
7322		} else {
7323			inst.dpDiv.removeClass('ui-datepicker-multi-2 ui-datepicker-multi-3 ui-datepicker-multi-4').width('');
7324		}
7325		inst.dpDiv[(numMonths[0] != 1 || numMonths[1] != 1 ? 'add' : 'remove') +
7326			'Class']('ui-datepicker-multi');
7327		inst.dpDiv[(this._get(inst, 'isRTL') ? 'add' : 'remove') +
7328			'Class']('ui-datepicker-rtl');
7329		if (inst.input && inst.input[0].type != 'hidden' && inst == $.datepicker._curInst)
7330			$(inst.input[0]).focus();
7331	},
7332
7333	/* Check positioning to remain on screen. */
7334	_checkOffset: function(inst, offset, isFixed) {
7335		var dpWidth = inst.dpDiv.outerWidth();
7336		var dpHeight = inst.dpDiv.outerHeight();
7337		var inputWidth = inst.input ? inst.input.outerWidth() : 0;
7338		var inputHeight = inst.input ? inst.input.outerHeight() : 0;
7339		var viewWidth = (window.innerWidth || document.documentElement.clientWidth || document.body.clientWidth) + $(document).scrollLeft();
7340		var viewHeight = (window.innerHeight || document.documentElement.clientHeight || document.body.clientHeight) + $(document).scrollTop();
7341
7342		offset.left -= (this._get(inst, 'isRTL') ? (dpWidth - inputWidth) : 0);
7343		offset.left -= (isFixed && offset.left == inst.input.offset().left) ? $(document).scrollLeft() : 0;
7344		offset.top -= (isFixed && offset.top == (inst.input.offset().top + inputHeight)) ? $(document).scrollTop() : 0;
7345
7346		// now check if datepicker is showing outside window viewport - move to a better place if so.
7347		offset.left -= (offset.left + dpWidth > viewWidth && viewWidth > dpWidth) ? Math.abs(offset.left + dpWidth - viewWidth) : 0;
7348		offset.top -= (offset.top + dpHeight > viewHeight && viewHeight > dpHeight) ? Math.abs(offset.top + dpHeight + inputHeight*2 - viewHeight) : 0;
7349
7350		return offset;
7351	},
7352
7353	/* Find an object's position on the screen. */
7354	_findPos: function(obj) {
7355        while (obj && (obj.type == 'hidden' || obj.nodeType != 1)) {
7356            obj = obj.nextSibling;
7357        }
7358        var position = $(obj).offset();
7359	    return [position.left, position.top];
7360	},
7361
7362	/* Hide the date picker from view.
7363	   @param  input  element - the input field attached to the date picker
7364	   @param  duration  string - the duration over which to close the date picker */
7365	_hideDatepicker: function(input, duration) {
7366		var inst = this._curInst;
7367		if (!inst || (input && inst != $.data(input, PROP_NAME)))
7368			return;
7369		if (inst.stayOpen)
7370			this._selectDate('#' + inst.id, this._formatDate(inst,
7371				inst.currentDay, inst.currentMonth, inst.currentYear));
7372		inst.stayOpen = false;
7373		if (this._datepickerShowing) {
7374			duration = (duration != null ? duration : this._get(inst, 'duration'));
7375			var showAnim = this._get(inst, 'showAnim');
7376			var postProcess = function() {
7377				$.datepicker._tidyDialog(inst);
7378			};
7379			if (duration != '' && $.effects && $.effects[showAnim])
7380				inst.dpDiv.hide(showAnim, $.datepicker._get(inst, 'showOptions'),
7381					duration, postProcess);
7382			else
7383				inst.dpDiv[(duration == '' ? 'hide' : (showAnim == 'slideDown' ? 'slideUp' :
7384					(showAnim == 'fadeIn' ? 'fadeOut' : 'hide')))](duration, postProcess);
7385			if (duration == '')
7386				this._tidyDialog(inst);
7387			var onClose = this._get(inst, 'onClose');
7388			if (onClose)
7389				onClose.apply((inst.input ? inst.input[0] : null),
7390					[(inst.input ? inst.input.val() : ''), inst]);  // trigger custom callback
7391			this._datepickerShowing = false;
7392			this._lastInput = null;
7393			if (this._inDialog) {
7394				this._dialogInput.css({ position: 'absolute', left: '0', top: '-100px' });
7395				if ($.blockUI) {
7396					$.unblockUI();
7397					$('body').append(this.dpDiv);
7398				}
7399			}
7400			this._inDialog = false;
7401		}
7402		this._curInst = null;
7403	},
7404
7405	/* Tidy up after a dialog display. */
7406	_tidyDialog: function(inst) {
7407		inst.dpDiv.removeClass(this._dialogClass).unbind('.ui-datepicker-calendar');
7408	},
7409
7410	/* Close date picker if clicked elsewhere. */
7411	_checkExternalClick: function(event) {
7412		if (!$.datepicker._curInst)
7413			return;
7414		var $target = $(event.target);
7415		if (($target.parents('#' + $.datepicker._mainDivId).length == 0) &&
7416				!$target.hasClass($.datepicker.markerClassName) &&
7417				!$target.hasClass($.datepicker._triggerClass) &&
7418				$.datepicker._datepickerShowing && !($.datepicker._inDialog && $.blockUI))
7419			$.datepicker._hideDatepicker(null, '');
7420	},
7421
7422	/* Adjust one of the date sub-fields. */
7423	_adjustDate: function(id, offset, period) {
7424		var target = $(id);
7425		var inst = this._getInst(target[0]);
7426		if (this._isDisabledDatepicker(target[0])) {
7427			return;
7428		}
7429		this._adjustInstDate(inst, offset +
7430			(period == 'M' ? this._get(inst, 'showCurrentAtPos') : 0), // undo positioning
7431			period);
7432		this._updateDatepicker(inst);
7433	},
7434
7435	/* Action for current link. */
7436	_gotoToday: function(id) {
7437		var target = $(id);
7438		var inst = this._getInst(target[0]);
7439		if (this._get(inst, 'gotoCurrent') && inst.currentDay) {
7440			inst.selectedDay = inst.currentDay;
7441			inst.drawMonth = inst.selectedMonth = inst.currentMonth;
7442			inst.drawYear = inst.selectedYear = inst.currentYear;
7443		}
7444		else {
7445		var date = new Date();
7446		inst.selectedDay = date.getDate();
7447		inst.drawMonth = inst.selectedMonth = date.getMonth();
7448		inst.drawYear = inst.selectedYear = date.getFullYear();
7449		}
7450		this._notifyChange(inst);
7451		this._adjustDate(target);
7452	},
7453
7454	/* Action for selecting a new month/year. */
7455	_selectMonthYear: function(id, select, period) {
7456		var target = $(id);
7457		var inst = this._getInst(target[0]);
7458		inst._selectingMonthYear = false;
7459		inst['selected' + (period == 'M' ? 'Month' : 'Year')] =
7460		inst['draw' + (period == 'M' ? 'Month' : 'Year')] =
7461			parseInt(select.options[select.selectedIndex].value,10);
7462		this._notifyChange(inst);
7463		this._adjustDate(target);
7464	},
7465
7466	/* Restore input focus after not changing month/year. */
7467	_clickMonthYear: function(id) {
7468		var target = $(id);
7469		var inst = this._getInst(target[0]);
7470		if (inst.input && inst._selectingMonthYear && !$.browser.msie)
7471			inst.input[0].focus();
7472		inst._selectingMonthYear = !inst._selectingMonthYear;
7473	},
7474
7475	/* Action for selecting a day. */
7476	_selectDay: function(id, month, year, td) {
7477		var target = $(id);
7478		if ($(td).hasClass(this._unselectableClass) || this._isDisabledDatepicker(target[0])) {
7479			return;
7480		}
7481		var inst = this._getInst(target[0]);
7482		inst.selectedDay = inst.currentDay = $('a', td).html();
7483		inst.selectedMonth = inst.currentMonth = month;
7484		inst.selectedYear = inst.currentYear = year;
7485		if (inst.stayOpen) {
7486			inst.endDay = inst.endMonth = inst.endYear = null;
7487		}
7488		this._selectDate(id, this._formatDate(inst,
7489			inst.currentDay, inst.currentMonth, inst.currentYear));
7490		if (inst.stayOpen) {
7491			inst.rangeStart = this._daylightSavingAdjust(
7492				new Date(inst.currentYear, inst.currentMonth, inst.currentDay));
7493			this._updateDatepicker(inst);
7494		}
7495	},
7496
7497	/* Erase the input field and hide the date picker. */
7498	_clearDate: function(id) {
7499		var target = $(id);
7500		var inst = this._getInst(target[0]);
7501		inst.stayOpen = false;
7502		inst.endDay = inst.endMonth = inst.endYear = inst.rangeStart = null;
7503		this._selectDate(target, '');
7504	},
7505
7506	/* Update the input field with the selected date. */
7507	_selectDate: function(id, dateStr) {
7508		var target = $(id);
7509		var inst = this._getInst(target[0]);
7510		dateStr = (dateStr != null ? dateStr : this._formatDate(inst));
7511		if (inst.input)
7512			inst.input.val(dateStr);
7513		this._updateAlternate(inst);
7514		var onSelect = this._get(inst, 'onSelect');
7515		if (onSelect)
7516			onSelect.apply((inst.input ? inst.input[0] : null), [dateStr, inst]);  // trigger custom callback
7517		else if (inst.input)
7518			inst.input.trigger('change'); // fire the change event
7519		if (inst.inline)
7520			this._updateDatepicker(inst);
7521		else if (!inst.stayOpen) {
7522			this._hideDatepicker(null, this._get(inst, 'duration'));
7523			this._lastInput = inst.input[0];
7524			if (typeof(inst.input[0]) != 'object')
7525				inst.input[0].focus(); // restore focus
7526			this._lastInput = null;
7527		}
7528	},
7529
7530	/* Update any alternate field to synchronise with the main field. */
7531	_updateAlternate: function(inst) {
7532		var altField = this._get(inst, 'altField');
7533		if (altField) { // update alternate field too
7534			var altFormat = this._get(inst, 'altFormat') || this._get(inst, 'dateFormat');
7535			var date = this._getDate(inst);
7536			dateStr = this.formatDate(altFormat, date, this._getFormatConfig(inst));
7537			$(altField).each(function() { $(this).val(dateStr); });
7538		}
7539	},
7540
7541	/* Set as beforeShowDay function to prevent selection of weekends.
7542	   @param  date  Date - the date to customise
7543	   @return [boolean, string] - is this date selectable?, what is its CSS class? */
7544	noWeekends: function(date) {
7545		var day = date.getDay();
7546		return [(day > 0 && day < 6), ''];
7547	},
7548
7549	/* Set as calculateWeek to determine the week of the year based on the ISO 8601 definition.
7550	   @param  date  Date - the date to get the week for
7551	   @return  number - the number of the week within the year that contains this date */
7552	iso8601Week: function(date) {
7553		var checkDate = new Date(date.getFullYear(), date.getMonth(), date.getDate());
7554		var firstMon = new Date(checkDate.getFullYear(), 1 - 1, 4); // First week always contains 4 Jan
7555		var firstDay = firstMon.getDay() || 7; // Day of week: Mon = 1, ..., Sun = 7
7556		firstMon.setDate(firstMon.getDate() + 1 - firstDay); // Preceding Monday
7557		if (firstDay < 4 && checkDate < firstMon) { // Adjust first three days in year if necessary
7558			checkDate.setDate(checkDate.getDate() - 3); // Generate for previous year
7559			return $.datepicker.iso8601Week(checkDate);
7560		} else if (checkDate > new Date(checkDate.getFullYear(), 12 - 1, 28)) { // Check last three days in year
7561			firstDay = new Date(checkDate.getFullYear() + 1, 1 - 1, 4).getDay() || 7;
7562			if (firstDay >
7562 4 && (checkDate.getDay() || 7) < firstDay - 3) { // Adjust if necessary
7563				return 1;
7564			}
7565		}
7566		return Math.floor(((checkDate - firstMon) / 86400000) / 7) + 1; // Weeks to given date
7567	},
7568
7569	/* Parse a string value into a date object.
7570	   See formatDate below for the possible formats.
7571
7572	   @param  format    string - the expected format of the date
7573	   @param  value     string - the date in the above format
7574	   @param  settings  Object - attributes include:
7575	                     shortYearCutoff  number - the cutoff year for determining the century (optional)
7576	                     dayNamesShort    string[7] - abbreviated names of the days from Sunday (optional)
7577	                     dayNames         string[7] - names of the days from Sunday (optional)
7578	                     monthNamesShort  string[12] - abbreviated names of the months (optional)
7579	                     monthNames       string[12] - names of the months (optional)
7580	   @return  Date - the extracted date value or null if value is blank */
7581	parseDate: function (format, value, settings) {
7582		if (format == null || value == null)
7583			throw 'Invalid arguments';
7584		value = (typeof value == 'object' ? value.toString() : value + '');
7585		if (value == '')
7586			return null;
7587		var shortYearCutoff = (settings ? settings.shortYearCutoff : null) || this._defaults.shortYearCutoff;
7588		var dayNamesShort = (settings ? settings.dayNamesShort : null) || this._defaults.dayNamesShort;
7589		var dayNames = (settings ? settings.dayNames : null) || this._defaults.dayNames;
7590		var monthNamesShort = (settings ? settings.monthNamesShort : null) || this._defaults.monthNamesShort;
7591		var monthNames = (settings ? settings.monthNames : null) || this._defaults.monthNames;
7592		var year = -1;
7593		var month = -1;
7594		var day = -1;
7595		var doy = -1;
7596		var literal = false;
7597		// Check whether a format character is doubled
7598		var lookAhead = function(match) {
7599			var matches = (iFormat + 1 < format.length && format.charAt(iFormat + 1) == match);
7600			if (matches)
7601				iFormat++;
7602			return matches;
7603		};
7604		// Extract a number from the string value
7605		var getNumber = function(match) {
7606			lookAhead(match);
7607			var origSize = (match == '@' ? 14 : (match == 'y' ? 4 : (match == 'o' ? 3 : 2)));
7608			var size = origSize;
7609			var num = 0;
7610			while (size > 0 && iValue < value.length &&
7611					value.charAt(iValue) >= '0' && value.charAt(iValue) <= '9') {
7612				num = num * 10 + parseInt(value.charAt(iValue++),10);
7613				size--;
7614			}
7615			if (size == origSize)
7616				throw 'Missing number at position ' + iValue;
7617			return num;
7618		};
7619		// Extract a name from the string value and convert to an index
7620		var getName = function(match, shortNames, longNames) {
7621			var names = (lookAhead(match) ? longNames : shortNames);
7622			var size = 0;
7623			for (var j = 0; j < names.length; j++)
7624				size = Math.max(size, names[j].length);
7625			var name = '';
7626			var iInit = iValue;
7627			while (size > 0 && iValue < value.length) {
7628				name += value.charAt(iValue++);
7629				for (var i = 0; i < names.length; i++)
7630					if (name == names[i])
7631						return i + 1;
7632				size--;
7633			}
7634			throw 'Unknown name at position ' + iInit;
7635		};
7636		// Confirm that a literal character matches the string value
7637		var checkLiteral = function() {
7638			if (value.charAt(iValue) != format.charAt(iFormat))
7639				throw 'Unexpected literal at position ' + iValue;
7640			iValue++;
7641		};
7642		var iValue = 0;
7643		for (var iFormat = 0; iFormat < format.length; iFormat++) {
7644			if (literal)
7645				if (format.charAt(iFormat) == "'" && !lookAhead("'"))
7646					literal = false;
7647				else
7648					checkLiteral();
7649			else
7650				switch (format.charAt(iFormat)) {
7651					case 'd':
7652						day = getNumber('d');
7653						break;
7654					case 'D':
7655						getName('D', dayNamesShort, dayNames);
7656						break;
7657					case 'o':
7658						doy = getNumber('o');
7659						break;
7660					case 'm':
7661						month = getNumber('m');
7662						break;
7663					case 'M':
7664						month = getName('M', monthNamesShort, monthNames);
7665						break;
7666					case 'y':
7667						year = getNumber('y');
7668						break;
7669					case '@':
7670						var date = new Date(getNumber('@'));
7671						year = date.getFullYear();
7672						month = date.getMonth() + 1;
7673						day = date.getDate();
7674						break;
7675					case "'":
7676						if (lookAhead("'"))
7677							checkLiteral();
7678						else
7679							literal = true;
7680						break;
7681					default:
7682						checkLiteral();
7683				}
7684		}
7685		if (year == -1)
7686			year = new Date().getFullYear();
7687		else if (year < 100)
7688			year += new Date().getFullYear() - new Date().getFullYear() % 100 +
7689				(year <= shortYearCutoff ? 0 : -100);
7690		if (doy > -1) {
7691			month = 1;
7692			day = doy;
7693			do {
7694				var dim = this._getDaysInMonth(year, month - 1);
7695				if (day <= dim)
7696					break;
7697				month++;
7698				day -= dim;
7699			} while (true);
7700		}
7701		var date = this._daylightSavingAdjust(new Date(year, month - 1, day));
7702		if (date.getFullYear() != year || date.getMonth() + 1 != month || date.getDate() != day)
7703			throw 'Invalid date'; // E.g. 31/02/*
7704		return date;
7705	},
7706
7707	/* Standard date formats. */
7708	ATOM: 'yy-mm-dd', // RFC 3339 (ISO 8601)
7709	COOKIE: 'D, dd M yy',
7710	ISO_8601: 'yy-mm-dd',
7711	RFC_822: 'D, d M y',
7712	RFC_850: 'DD, dd-M-y',
7713	RFC_1036: 'D, d M y',
7714	RFC_1123: 'D, d M yy',
7715	RFC_2822: 'D, d M yy',
7716	RSS: 'D, d M y', // RFC 822
7717	TIMESTAMP: '@',
7718	W3C: 'yy-mm-dd', // ISO 8601
7719
7720	/* Format a date object into a string value.
7721	   The format can be combinations of the following:
7722	   d  - day of month (no leading zero)
7723	   dd - day of month (two digit)
7724	   o  - day of year (no leading zeros)
7725	   oo - day of year (three digit)
7726	   D  - day name short
7727	   DD - day name long
7728	   m  - month of year (no leading zero)
7729	   mm - month of year (two digit)
7730	   M  - month name short
7731	   MM - month name long
7732	   y  - year (two digit)
7733	   yy - year (four digit)
7734	   @ - Unix timestamp (ms since 01/01/1970)
7735	   '...' - literal text
7736	   '' - single quote
7737
7738	   @param  format    string - the desired format of the date
7739	   @param  date      Date - the date value to format
7740	   @param  settings  Object - attributes include:
7741	                     dayNamesShort    string[7] - abbreviated names of the days from Sunday (optional)
7742	                     dayNames         string[7] - names of the days from Sunday (optional)
7743	                     monthNamesShort  string[12] - abbreviated names of the months (optional)
7744	                     monthNames       string[12] - names of the months (optional)
7745	   @return  string - the date in the above format */
7746	formatDate: function (format, date, settings) {
7747		if (!date)
7748			return '';
7749		var dayNamesShort = (settings ? settings.dayNamesShort : null) || this._defaults.dayNamesShort;
7750		var dayNames = (settings ? settings.dayNames : null) || this._defaults.dayNames;
7751		var monthNamesShort = (settings ? settings.monthNamesShort : null) || this._defaults.monthNamesShort;
7752		var monthNames = (settings ? settings.monthNames : null) || this._defaults.monthNames;
7753		// Check whether a format character is doubled
7754		var lookAhead = function(match) {
7755			var matches = (iFormat + 1 < format.length && format.charAt(iFormat + 1) == match);
7756			if (matches)
7757				iFormat++;
7758			return matches;
7759		};
7760		// Format a number, with leading zero if necessary
7761		var formatNumber = function(match, value, len) {
7762			var num = '' + value;
7763			if (lookAhead(match))
7764				while (num.length < len)
7765					num = '0' + num;
7766			return num;
7767		};
7768		// Format a name, short or long as requested
7769		var formatName = function(match, value, shortNames, longNames) {
7770			return (lookAhead(match) ? longNames[value] : shortNames[value]);
7771		};
7772		var output = '';
7773		var literal = false;
7774		if (date)
7775			for (var iFormat = 0; iFormat < format.length; iFormat++) {
7776				if (literal)
7777					if (format.charAt(iFormat) == "'" && !lookAhead("'"))
7778						literal = false;
7779					else
7780						output += format.charAt(iFormat);
7781				else
7782					switch (format.charAt(iFormat)) {
7783						case 'd':
7784							output += formatNumber('d', date.getDate(), 2);
7785							break;
7786						case 'D':
7787							output += formatName('D', date.getDay(), dayNamesShort, dayNames);
7788							break;
7789						case 'o':
7790							var doy = date.getDate();
7791							for (var m = date.getMonth() - 1; m >= 0; m--)
7792								doy += this._getDaysInMonth(date.getFullYear(), m);
7793							output += formatNumber('o', doy, 3);
7794							break;
7795						case 'm':
7796							output += formatNumber('m', date.getMonth() + 1, 2);
7797							break;
7798						case 'M':
7799							output += formatName('M', date.getMonth(), monthNamesShort, monthNames);
7800							break;
7801						case 'y':
7802							output += (lookAhead('y') ? date.getFullYear() :
7803								(date.getYear() % 100 < 10 ? '0' : '') + date.getYear() % 100);
7804							break;
7805						case '@':
7806							output += date.getTime();
7807							break;
7808						case "'":
7809							if (lookAhead("'"))
7810								output += "'";
7811							else
7812								literal = true;
7813							break;
7814						default:
7815							output += format.charAt(iFormat);
7816					}
7817			}
7818		return output;
7819	},
7820
7821	/* Extract all possible characters from the date format. */
7822	_possibleChars: function (format) {
7823		var chars = '';
7824		var literal = false;
7825		for (var iFormat = 0; iFormat < format.length; iFormat++)
7826			if (literal)
7827				if (format.charAt(iFormat) == "'" && !lookAhead("'"))
7828					literal = false;
7829				else
7830					chars += format.charAt(iFormat);
7831			else
7832				switch (format.charAt(iFormat)) {
7833					case 'd': case 'm': case 'y': case '@':
7834						chars += '0123456789';
7835						break;
7836					case 'D': case 'M':
7837						return null; // Accept anything
7838					case "'":
7839						if (lookAhead("'"))
7840							chars += "'";
7841						else
7842							literal = true;
7843						break;
7844					default:
7845						chars += format.charAt(iFormat);
7846				}
7847		return chars;
7848	},
7849
7850	/* Get a setting value, defaulting if necessary. */
7851	_get: function(inst, name) {
7852		return inst.settings[name] !== undefined ?
7853			inst.settings[name] : this._defaults[name];
7854	},
7855
7856	/* Parse existing date and initialise date picker. */
7857	_setDateFromField: function(inst) {
7858		var dateFormat = this._get(inst, 'dateFormat');
7859		var dates = inst.input ? inst.input.val() : null;
7860		inst.endDay = inst.endMonth = inst.endYear = null;
7861		var date = defaultDate = this._getDefaultDate(inst);
7862		var settings = this._getFormatConfig(inst);
7863		try {
7864			date = this.parseDate(dateFormat, dates, settings) || defaultDate;
7865		} catch (event) {
7866			this.log(event);
7867			date = defaultDate;
7868		}
7869		inst.selectedDay = date.getDate();
7870		inst.drawMonth = inst.selectedMonth = date.getMonth();
7871		inst.drawYear = inst.selectedYear = date.getFullYear();
7872		inst.currentDay = (dates ? date.getDate() : 0);
7873		inst.currentMonth = (dates ? date.getMonth() : 0);
7874		inst.currentYear = (dates ? date.getFullYear() : 0);
7875		this._adjustInstDate(inst);
7876	},
7877
7878	/* Retrieve the default date shown on opening. */
7879	_getDefaultDate: function(inst) {
7880		var date = this._determineDate(this._get(inst, 'defaultDate'), new Date());
7881		var minDate = this._getMinMaxDate(inst, 'min', true);
7882		var maxDate = this._getMinMaxDate(inst, 'max');
7883		date = (minDate && date < minDate ? minDate : date);
7884		date = (maxDate && date > maxDate ? maxDate : date);
7885		return date;
7886	},
7887
7888	/* A date may be specified as an exact value or a relative one. */
7889	_determineDate: function(date, defaultDate) {
7890		var offsetNumeric = function(offset) {
7891			var date = new Date();
7892			date.setDate(date.getDate() + offset);
7893			return date;
7894		};
7895		var offsetString = function(offset, getDaysInMonth) {
7896			var date = new Date();
7897			var year = date.getFullYear();
7898			var month = date.getMonth();
7899			var day = date.getDate();
7900			var pattern = /([+-]?[0-9]+)\s*(d|D|w|W|m|M|y|Y)?/g;
7901			var matches = pattern.exec(offset);
7902			while (matches) {
7903				switch (matches[2] || 'd') {
7904					case 'd' : case 'D' :
7905						day += parseInt(matches[1],10); break;
7906					case 'w' : case 'W' :
7907						day += parseInt(matches[1],10) * 7; break;
7908					case 'm' : case 'M' :
7909						month += parseInt(matches[1],10);
7910						day = Math.min(day, getDaysInMonth(year, month));
7911						break;
7912					case 'y': case 'Y' :
7913						year += parseInt(matches[1],10);
7914						day = Math.min(day, getDaysInMonth(year, month));
7915						break;
7916				}
7917				matches = pattern.exec(offset);
7918			}
7919			return new Date(year, month, day);
7920		};
7921		date = (date == null ? defaultDate :
7922			(typeof date == 'string' ? offsetString(date, this._getDaysInMonth) :
7923			(typeof date == 'number' ? (isNaN(date) ? defaultDate : offsetNumeric(date)) : date)));
7924		date = (date && date.toString() == 'Invalid Date' ? defaultDate : date);
7925		if (date) {
7926			date.setHours(0);
7927			date.setMinutes(0);
7928			date.setSeconds(0);
7929			date.setMilliseconds(0);
7930		}
7931		return this._daylightSavingAdjust(date);
7932	},
7933
7934	/* Handle switch to/from daylight saving.
7935	   Hours may be non-zero on daylight saving cut-over:
7936	   > 12 when midnight changeover, but then cannot generate
7937	   midnight datetime, so jump to 1AM, otherwise reset.
7938	   @param  date  (Date) the date to check
7939	   @return  (Date) the corrected date */
7940	_daylightSavingAdjust: function(date) {
7941		if (!date) return null;
7942		date.setHours(date.getHours() > 12 ? date.getHours() + 2 : 0);
7943		return date;
7944	},
7945
7946	/* Set the date(s) directly. */
7947	_setDate: function(inst, date, endDate) {
7948		var clear = !(date);
7949		var origMonth = inst.selectedMonth;
7950		var origYear = inst.selectedYear;
7951		date = this._determineDate(date, new Date());
7952		inst.selectedDay = inst.currentDay = date.getDate();
7953		inst.drawMonth = inst.selectedMonth = inst.currentMonth = date.getMonth();
7954		inst.drawYear = inst.selectedYear = inst.currentYear = date.getFullYear();
7955		if (origMonth != inst.selectedMonth || origYear != inst.selectedYear)
7956			this._notifyChange(inst);
7957		this._adjustInstDate(inst);
7958		if (inst.input) {
7959			inst.input.val(clear ? '' : this._formatDate(inst));
7960		}
7961	},
7962
7963	/* Retrieve the date(s) directly. */
7964	_getDate: function(inst) {
7965		var startDate = (!inst.currentYear || (inst.input && inst.input.val() == '') ? null :
7966			this._daylightSavingAdjust(new Date(
7967			inst.currentYear, inst.currentMonth, inst.currentDay)));
7968			return startDate;
7969	},
7970
7971	/* Generate the HTML for the current state of the date picker. */
7972	_generateHTML: function(inst) {
7973		var today = new Date();
7974		today = this._daylightSavingAdjust(
7975			new Date(today.getFullYear(), today.getMonth(), today.getDate())); // clear time
7976		var isRTL = this._get(inst, 'isRTL');
7977		var showButtonPanel = this._get(inst, 'showButtonPanel');
7978		var hideIfNoPrevNext = this._get(inst, 'hideIfNoPrevNext');
7979		var navigationAsDateFormat = this._get(inst, 'navigationAsDateFormat');
7980		var numMonths = this._getNumberOfMonths(inst);
7981		var showCurrentAtPos = this._get(inst, 'showCurrentAtPos');
7982		var stepMonths = this._get(inst, 'stepMonths');
7983		var stepBigMonths = this._get(inst, 'stepBigMonths');
7984		var isMultiMonth = (numMonths[0] != 1 || numMonths[1] != 1);
7985		var currentDate = this._daylightSavingAdjust((!inst.currentDay ? new Date(9999, 9, 9) :
7986			new Date(inst.currentYear, inst.currentMonth, inst.currentDay)));
7987		var minDate = this._getMinMaxDate(inst, 'min', true);
7988		var maxDate = this._getMinMaxDate(inst, 'max');
7989		var drawMonth = inst.drawMonth - showCurrentAtPos;
7990		var drawYear = inst.drawYear;
7991		if (drawMonth < 0) {
7992			drawMonth += 12;
7993			drawYear--;
7994		}
7995		if (maxDate) {
7996			var maxDraw = this._daylightSavingAdjust(new Date(maxDate.getFullYear(),
7997				maxDate.getMonth() - numMonths[1] + 1, maxDate.getDate()));
7998			maxDraw = (minDate && maxDraw < minDate ? minDate : maxDraw);
7999			while (this._daylightSavingAdjust(new Date(drawYear, drawMonth, 1)) > maxDraw) {
8000				drawMonth--;
8001				if (drawMonth < 0) {
8002					drawMonth = 11;
8003					drawYear--;
8004				}
8005			}
8006		}
8007		inst.drawMonth = drawMonth;
8008		inst.drawYear = drawYear;
8009		var prevText = this._get(inst, 'prevText');
8010		prevText = (!navigationAsDateFormat ? prevText : this.formatDate(prevText,
8011			this._daylightSavingAdjust(new Date(drawYear, drawMonth - stepMonths, 1)),
8012			this._getFormatConfig(inst)));
8013		var prev = (this._canAdjustMonth(inst, -1, drawYear, drawMonth) ?
8014			'<a class="ui-datepicker-prev ui-corner-all" onclick="DP_jQuery.datepicker._adjustDate(\'#' + inst.id + '\', -' + stepMonths + ', \'M\');"' +
8015			' title="' + prevText + '"><span class="ui-icon ui-icon-circle-triangle-' + ( isRTL ? 'e' : 'w') + '">' + prevText + '</span></a>' :
8016			(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>'));
8017		var nextText = this._get(inst, 'nextText');
8018		nextText = (!navigationAsDateFormat ? nextText : this.formatDate(nextText,
8019			this._daylightSavingAdjust(new Date(drawYear, drawMonth + stepMonths, 1)),
8020			this._getFormatConfig(inst)));
8021		var next = (this._canAdjustMonth(inst, +1, drawYear, drawMonth) ?
8022			'<a class="ui-datepicker-next ui-corner-all" onclick="DP_jQuery.datepicker._adjustDate(\'#' + inst.id + '\', +' + stepMonths + ', \'M\');"' +
8023			' title="' + nextText + '"><span class="ui-icon ui-icon-circle-triangle-' + ( isRTL ? 'w' : 'e') + '">' + nextText + '</span></a>' :
8024			(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>'));
8025		var currentText = this._get(inst, 'currentText');
8026		var gotoDate = (this._get(inst, 'gotoCurrent') && inst.currentDay ? currentDate : today);
8027		currentText = (!navigationAsDateFormat ? currentText :
8028			this.formatDate(currentText, gotoDate, this._getFormatConfig(inst)));
8029		var controls = (!inst.inline ? '<button type="button" class="ui-datepicker-close ui-state-default ui-priority-primary ui-corner-all" onclick="DP_jQuery.datepicker._hideDatepicker();">' + this._get(inst, 'closeText') + '</button>' : '');
8030		var buttonPanel = (showButtonPanel) ? '<div class="ui-datepicker-buttonpane ui-widget-content">' + (isRTL ? controls : '') +
8031			(this._isInRange(inst, gotoDate) ? '<button type="button" class="ui-datepicker-current ui-state-default ui-priority-secondary ui-corner-all" onclick="DP_jQuery.datepicker._gotoToday(\'#' + inst.id + '\');"' +
8032			'>' + currentText + '</button>' : '') + (isRTL ? '' : controls) + '</div>' : '';
8033		var firstDay = parseInt(this._get(inst, 'firstDay'),10);
8034		firstDay = (isNaN(firstDay) ? 0 : firstDay);
8035		var dayNames = this._get(inst, 'dayNames');
8036		var dayNamesShort = this._get(inst, 'dayNamesShort');
8037		var dayNamesMin = this._get(inst, 'dayNamesMin');
8038		var monthNames = this._get(inst, 'monthNames');
8039		var monthNamesShort = this._get(inst, 'monthNamesShort');
8040		var beforeShowDay = this._get(inst, 'beforeShowDay');
8041		var showOtherMonths = this._get(inst, 'showOtherMonths');
8042		var calculateWeek = this._get(inst, 'calculateWeek') || this.iso8601Week;
8043		var endDate = inst.endDay ? this._daylightSavingAdjust(
8044			new Date(inst.endYear, inst.endMonth, inst.endDay)) : currentDate;
8045		var defaultDate = this._getDefaultDate(inst);
8046		var html = '';
8047		for (var row = 0; row < numMonths[0]; row++) {
8048			var group = '';
8049			for (var col = 0; col < numMonths[1]; col++) {
8050				var selectedDate = this._daylightSavingAdjust(new Date(drawYear, drawMonth, inst.selectedDay));
8051				var cornerClass = ' ui-corner-all';
8052				var calender = '';
8053				if (isMultiMonth) {
8054					calender += '<div class="ui-datepicker-group ui-datepicker-group-';
8055					switch (col) {
8056						case 0: calender += 'first'; cornerClass = ' ui-corner-' + (isRTL ? 'right' : 'left'); break;
8057						case numMonths[1]-1: calender += 'last'; cornerClass = ' ui-corner-' + (isRTL ? 'left' : 'right'); break;
8058						default: calender += 'middle'; cornerClass = ''; break;
8059					}
8060					calender += '">';
8061				}
8062				calender += '<div class="ui-datepicker-header ui-widget-header ui-helper-clearfix' + cornerClass + '">' +
8063					(/all|left/.test(cornerClass) && row == 0 ? (isRTL ? next : prev) : '') +
8064					(/all|right/.test(cornerClass) && row == 0 ? (isRTL ? prev : next) : '') +
8065					this._generateMonthYearHeader(inst, drawMonth, drawYear, minDate, maxDate,
8066					selectedDate, row > 0 || col > 0, monthNames, monthNamesShort) + // draw month headers
8067					'</div><table class="ui-datepicker-calendar"><thead>' +
8068					'<tr>';
8069				var thead = '';
8070				for (var dow = 0; dow < 7; dow++) { // days of the week
8071					var day = (dow + firstDay) % 7;
8072					thead += '<th' + ((dow + firstDay + 6) % 7 >= 5 ? ' class="ui-datepicker-week-end"' : '') + '>
8072' +
8073						'<span title="' + dayNames[day] + '">' + dayNamesMin[day] + '</span></th>';
8074				}
8075				calender += thead + '</tr></thead><tbody>';
8076				var daysInMonth = this._getDaysInMonth(drawYear, drawMonth);
8077				if (drawYear == inst.selectedYear && drawMonth == inst.selectedMonth)
8078					inst.selectedDay = Math.min(inst.selectedDay, daysInMonth);
8079				var leadDays = (this._getFirstDayOfMonth(drawYear, drawMonth) - firstDay + 7) % 7;
8080				var numRows = (isMultiMonth ? 6 : Math.ceil((leadDays + daysInMonth) / 7)); // calculate the number of rows to generate
8081				var printDate = this._daylightSavingAdjust(new Date(drawYear, drawMonth, 1 - leadDays));
8082				for (var dRow = 0; dRow < numRows; dRow++) { // create date picker rows
8083					calender += '<tr>';
8084					var tbody = '';
8085					for (var dow = 0; dow < 7; dow++) { // create date picker days
8086						var daySettings = (beforeShowDay ?
8087							beforeShowDay.apply((inst.input ? inst.input[0] : null), [printDate]) : [true, '']);
8088						var otherMonth = (printDate.getMonth() != drawMonth);
8089						var unselectable = otherMonth || !daySettings[0] ||
8090							(minDate && printDate < minDate) || (maxDate && printDate > maxDate);
8091						tbody += '<td class="' +
8092							((dow + firstDay + 6) % 7 >= 5 ? ' ui-datepicker-week-end' : '') + // highlight weekends
8093							(otherMonth ? ' ui-datepicker-other-month' : '') + // highlight days from other months
8094							((printDate.getTime() == selectedDate.getTime() && drawMonth == inst.selectedMonth && inst._keyEvent) || // user pressed key
8095							(defaultDate.getTime() == printDate.getTime() && defaultDate.getTime() == selectedDate.getTime()) ?
8096							// or defaultDate is current printedDate and defaultDate is selectedDate
8097							' ' + this._dayOverClass : '') + // highlight selected day
8098							(unselectable ? ' ' + this._unselectableClass + ' ui-state-disabled': '') +  // highlight unselectable days
8099							(otherMonth && !showOtherMonths ? '' : ' ' + daySettings[1] + // highlight custom dates
8100							(printDate.getTime() >= currentDate.getTime() && printDate.getTime() <= endDate.getTime() ? // in current range
8101							' ' + this._currentClass : '') + // highlight selected day
8102							(printDate.getTime() == today.getTime() ? ' ui-datepicker-today' : '')) + '"' + // highlight today (if different)
8103							((!otherMonth || showOtherMonths) && daySettings[2] ? ' title="' + daySettings[2] + '"' : '') + // cell title
8104							(unselectable ? '' : ' onclick="DP_jQuery.datepicker._selectDay(\'#' +
8105							inst.id + '\',' + drawMonth + ',' + drawYear + ', this);return false;"') + '>' + // actions
8106							(otherMonth ? (showOtherMonths ? printDate.getDate() : '&#xa0;') : // display for other months
8107							(unselectable ? '<span class="ui-state-default">' + printDate.getDate() + '</span>' : '<a class="ui-state-default' +
8108							(printDate.getTime() == today.getTime() ? ' ui-state-highlight' : '') +
8109							(printDate.getTime() >= currentDate.getTime() && printDate.getTime() <= endDate.getTime() ? // in current range
8110							' ui-state-active' : '') + // highlight selected day
8111							'" href="#">' + printDate.getDate() + '</a>')) + '</td>'; // display for this month
8112						printDate.setDate(printDate.getDate() + 1);
8113						printDate = this._daylightSavingAdjust(printDate);
8114					}
8115					calender += tbody + '</tr>';
8116				}
8117				drawMonth++;
8118				if (drawMonth > 11) {
8119					drawMonth = 0;
8120					drawYear++;
8121				}
8122				calender += '</tbody></table>' + (isMultiMonth ? '</div>' + 
8123							((numMonths[0] > 0 && col == numMonths[1]-1) ? '<div class="ui-datepicker-row-break"></div>' : '') : '');
8124				group += calender;
8125			}
8126			html += group;
8127		}
8128		html += buttonPanel + ($.browser.msie && parseInt($.browser.version,10) < 7 && !inst.inline ?
8129			'<iframe src="javascript:false;" class="ui-datepicker-cover" frameborder="0"></iframe>' : '');
8130		inst._keyEvent = false;
8131		return html;
8132	},
8133
8134	/* Generate the month and year header. */
8135	_generateMonthYearHeader: function(inst, drawMonth, drawYear, minDate, maxDate,
8136			selectedDate, secondary, monthNames, monthNamesShort) {
8137		minDate = (inst.rangeStart && minDate && selectedDate < minDate ? selectedDate : minDate);
8138		var changeMonth = this._get(inst, 'changeMonth');
8139		var changeYear = this._get(inst, 'changeYear');
8140		var showMonthAfterYear = this._get(inst, 'showMonthAfterYear');
8141		var html = '<div class="ui-datepicker-title">';
8142		var monthHtml = '';
8143		// month selection
8144		if (secondary || !changeMonth)
8145			monthHtml += '<span class="ui-datepicker-month">' + monthNames[drawMonth] + '</span> ';
8146		else {
8147			var inMinYear = (minDate && minDate.getFullYear() == drawYear);
8148			var inMaxYear = (maxDate && maxDate.getFullYear() == drawYear);
8149			monthHtml += '<select class="ui-datepicker-month" ' +
8150				'onchange="DP_jQuery.datepicker._selectMonthYear(\'#' + inst.id + '\', this, \'M\');" ' +
8151				'onclick="DP_jQuery.datepicker._clickMonthYear(\'#' + inst.id + '\');"' +
8152			 	'>';
8153			for (var month = 0; month < 12; month++) {
8154				if ((!inMinYear || month >= minDate.getMonth()) &&
8155						(!inMaxYear || month <= maxDate.getMonth()))
8156					monthHtml += '<option value="' + month + '"' +
8157						(month == drawMonth ? ' selected="selected"' : '') +
8158						'>' + monthNamesShort[month] + '</option>';
8159			}
8160			monthHtml += '</select>';
8161		}
8162		if (!showMonthAfterYear)
8163			html += monthHtml + ((secondary || changeMonth || changeYear) && (!(changeMonth && changeYear)) ? '&#xa0;' : '');
8164		// year selection
8165		if (secondary || !changeYear)
8166			html += '<span class="ui-datepicker-year">' + drawYear + '</span>';
8167		else {
8168			// determine range of years to display
8169			var years = this._get(inst, 'yearRange').split(':');
8170			var year = 0;
8171			var endYear = 0;
8172			if (years.length != 2) {
8173				year = drawYear - 10;
8174				endYear = drawYear + 10;
8175			} else if (years[0].charAt(0) == '+' || years[0].charAt(0) == '-') {
8176				year = drawYear + parseInt(years[0], 10);
8177				endYear = drawYear + parseInt(years[1], 10);
8178			} else {
8179				year = parseInt(years[0], 10);
8180				endYear = parseInt(years[1], 10);
8181			}
8182			year = (minDate ? Math.max(year, minDate.getFullYear()) : year);
8183			endYear = (maxDate ? Math.min(endYear, maxDate.getFullYear()) : endYear);
8184			html += '<select class="ui-datepicker-year" ' +
8185				'onchange="DP_jQuery.datepicker._selectMonthYear(\'#' + inst.id + '\', this, \'Y\');" ' +
8186				'onclick="DP_jQuery.datepicker._clickMonthYear(\'#' + inst.id + '\');"' +
8187				'>';
8188			for (; year <= endYear; year++) {
8189				html += '<option value="' + year + '"' +
8190					(year == drawYear ? ' selected="selected"' : '') +
8191					'>' + year + '</option>';
8192			}
8193			html += '</select>';
8194		}
8195		if (showMonthAfterYear)
8196			html += (secondary || changeMonth || changeYear ? '&#xa0;' : '') + monthHtml;
8197		html += '</div>'; // Close datepicker_header
8198		return html;
8199	},
8200
8201	/* Adjust one of the date sub-fields. */
8202	_adjustInstDate: function(inst, offset, period) {
8203		var year = inst.drawYear + (period == 'Y' ? offset : 0);
8204		var month = inst.drawMonth + (period == 'M' ? offset : 0);
8205		var day = Math.min(inst.selectedDay, this._getDaysInMonth(year, month)) +
8206			(period == 'D' ? offset : 0);
8207		var date = this._daylightSavingAdjust(new Date(year, month, day));
8208		// ensure it is within the bounds set
8209		var minDate = this._getMinMaxDate(inst, 'min', true);
8210		var maxDate = this._getMinMaxDate(inst, 'max');
8211		date = (minDate && date < minDate ? minDate : date);
8212		date = (maxDate && date > maxDate ? maxDate : date);
8213		inst.selectedDay = date.getDate();
8214		inst.drawMonth = inst.selectedMonth = date.getMonth();
8215		inst.drawYear = inst.selectedYear = date.getFullYear();
8216		if (period == 'M' || period == 'Y')
8217			this._notifyChange(inst);
8218	},
8219
8220	/* Notify change of month/year. */
8221	_notifyChange: function(inst) {
8222		var onChange = this._get(inst, 'onChangeMonthYear');
8223		if (onChange)
8224			onChange.apply((inst.input ? inst.input[0] : null),
8225				[inst.selectedYear, inst.selectedMonth + 1, inst]);
8226	},
8227
8228	/* Determine the number of months to show. */
8229	_getNumberOfMonths: function(inst) {
8230		var numMonths = this._get(inst, 'numberOfMonths');
8231		return (numMonths == null ? [1, 1] : (typeof numMonths == 'number' ? [1, numMonths] : numMonths));
8232	},
8233
8234	/* Determine the current maximum date - ensure no time components are set - may be overridden for a range. */
8235	_getMinMaxDate: function(inst, minMax, checkRange) {
8236		var date = this._determineDate(this._get(inst, minMax + 'Date'), null);
8237		return (!checkRange || !inst.rangeStart ? date :
8238			(!date || inst.rangeStart > date ? inst.rangeStart : date));
8239	},
8240
8241	/* Find the number of days in a given month. */
8242	_getDaysInMonth: function(year, month) {
8243		return 32 - new Date(year, month, 32).getDate();
8244	},
8245
8246	/* Find the day of the week of the first of a month. */
8247	_getFirstDayOfMonth: function(year, month) {
8248		return new Date(year, month, 1).getDay();
8249	},
8250
8251	/* Determines if we should allow a "next/prev" month display change. */
8252	_canAdjustMonth: function(inst, offset, curYear, curMonth) {
8253		var numMonths = this._getNumberOfMonths(inst);
8254		var date = this._daylightSavingAdjust(new Date(
8255			curYear, curMonth + (offset < 0 ? offset : numMonths[1]), 1));
8256		if (offset < 0)
8257			date.setDate(this._getDaysInMonth(date.getFullYear(), date.getMonth()));
8258		return this._isInRange(inst, date);
8259	},
8260
8261	/* Is the given date in the accepted range? */
8262	_isInRange: function(inst, date) {
8263		// during range selection, use minimum of selected date and range start
8264		var newMinDate = (!inst.rangeStart ? null : this._daylightSavingAdjust(
8265			new Date(inst.selectedYear, inst.selectedMonth, inst.selectedDay)));
8266		newMinDate = (newMinDate && inst.rangeStart < newMinDate ? inst.rangeStart : newMinDate);
8267		var minDate = newMinDate || this._getMinMaxDate(inst, 'min');
8268		var maxDate = this._getMinMaxDate(inst, 'max');
8269		return ((!minDate || date >= minDate) && (!maxDate || date <= maxDate));
8270	},
8271
8272	/* Provide the configuration settings for formatting/parsing. */
8273	_getFormatConfig: function(inst) {
8274		var shortYearCutoff = this._get(inst, 'shortYearCutoff');
8275		shortYearCutoff = (typeof shortYearCutoff != 'string' ? shortYearCutoff :
8276			new Date().getFullYear() % 100 + parseInt(shortYearCutoff, 10));
8277		return {shortYearCutoff: shortYearCutoff,
8278			dayNamesShort: this._get(inst, 'dayNamesShort'), dayNames: this._get(inst, 'dayNames'),
8279			monthNamesShort: this._get(inst, 'monthNamesShort'), monthNames: this._get(inst, 'monthNames')};
8280	},
8281
8282	/* Format the given date for display. */
8283	_formatDate: function(inst, day, month, year) {
8284		if (!day) {
8285			inst.currentDay = inst.selectedDay;
8286			inst.currentMonth = inst.selectedMonth;
8287			inst.currentYear = inst.selectedYear;
8288		}
8289		var date = (day ? (typeof day == 'object' ? day :
8290			this._daylightSavingAdjust(new Date(year, month, day))) :
8291			this._daylightSavingAdjust(new Date(inst.currentYear, inst.currentMonth, inst.currentDay)));
8292		return this.formatDate(this._get(inst, 'dateFormat'), date, this._getFormatConfig(inst));
8293	}
8294});
8295
8296/* jQuery extend now ignores nulls! */
8297function extendRemove(target, props) {
8298	$.extend(target, props);
8299	for (var name in props)
8300		if (props[name] == null || props[name] == undefined)
8301			target[name] = props[name];
8302	return target;
8303};
8304
8305/* Determine whether an object is an array. */
8306function isArray(a) {
8307	return (a && (($.browser.safari && typeof a == 'object' && a.length) ||
8308		(a.constructor && a.constructor.toString().match(/\Array\(\)/))));
8309};
8310
8311/* Invoke the datepicker functionality.
8312   @param  options  string - a command, optionally followed by additional parameters or
8313                    Object - settings for attaching new datepicker functionality
8314   @return  jQuery object */
8315$.fn.datepicker = function(options){
8316
8317	/* Initialise the date picker. */
8318	if (!$.datepicker.initialized) {
8319		$(document).mousedown($.datepicker._checkExternalClick).
8320			find('body').append($.datepicker.dpDiv);
8321		$.datepicker.initialized = true;
8322	}
8323
8324	var otherArgs = Array.prototype.slice.call(arguments, 1);
8325	if (typeof options == 'string' && (options == 'isDisabled' || options == 'getDate'))
8326		return $.datepicker['_' + options + 'Datepicker'].
8327			apply($.datepicker, [this[0]].concat(otherArgs));
8328	if (options == 'option' && arguments.length == 2 && typeof arguments[1] == 'string')
8329		return $.datepicker['_' + options + 'Datepicker'].
8330			apply($.datepicker, [this[0]].concat(otherArgs));
8331	return this.each(function() {
8332		typeof options == 'string' ?
8333			$.datepicker['_' + options + 'Datepicker'].
8334				apply($.datepicker, [this].concat(otherArgs)) :
8335			$.datepicker._attachDatepicker(this, options);
8336	});
8337};
8338
8339$.datepicker = new Datepicker(); // singleton instance
8340$.datepicker.initialized = false;
8341$.datepicker.uuid = new Date().getTime();
8342$.datepicker.version = "1.7.3";
8343
8344// Workaround for #4055
8345// Add another global to avoid noConflict issues with inline event handlers
8346window.DP_jQuery = $;
8347
8348})(jQuery);
8349/*
8350 * jQuery UI Progressbar 1.7.3
8351 *
8352 * Copyright (c) 2009 AUTHORS.txt (https://jqueryui.com/about)
8353 * Dual licensed under the MIT (MIT-LICENSE.txt)
8354 * and GPL (GPL-LICENSE.txt) licenses.
8355 *
8356 * https://docs.jquery.com/UI/Progressbar
8357 *
8358 * Depends:
8359 *   ui.core.js
8360 */
8361(function($) {
8362
8363$.widget("ui.progressbar", {
8364
8365	_init: function() {
8366
8367		this.element
8368			.addClass("ui-progressbar"
8369				+ " ui-widget"
8370				+ " ui-widget-content"
8371				+ " ui-corner-all")
8372			.attr({
8373				role: "progressbar",
8374				"aria-valuemin": this._valueMin(),
8375				"aria-valuemax": this._valueMax(),
8376				"aria-valuenow": this._value()
8377			});
8378
8379		this.valueDiv = $('<div class="ui-progressbar-value ui-widget-header ui-corner-left"></div>').appendTo(this.element);
8380
8381		this._refreshValue();
8382
8383	},
8384
8385	destroy: function() {
8386
8387		this.element
8388			.removeClass("ui-progressbar"
8389				+ " ui-widget"
8390				+ " ui-widget-content"
8391				+ " ui-corner-all")
8392			.removeAttr("role")
8393			.removeAttr("aria-valuemin")
8394			.removeAttr("aria-valuemax")
8395			.removeAttr("aria-valuenow")
8396			.removeData("progressbar")
8397			.unbind(".progressbar");
8398
8399		this.valueDiv.remove();
8400
8401		$.widget.prototype.destroy.apply(this, arguments);
8402
8403	},
8404
8405	value: function(newValue) {
8406		if (newValue === undefined) {
8407			return this._value();
8408		}
8409		
8410		this._setData('value', newValue);
8411		return this;
8412	},
8413
8414	_setData: function(key, value) {
8415
8416		switch (key) {
8417			case 'value':
8418				this.options.value = value;
8419				this._refreshValue();
8420				this._trigger('change', null, {});
8421				break;
8422		}
8423
8424		$.widget.prototype._setData.apply(this, arguments);
8425
8426	},
8427
8428	_value: function() {
8429
8430		var val = this.options.value;
8431		if (val < this._valueMin()) val = this._valueMin();
8432		if (val > this._valueMax()) val = this._valueMax();
8433
8434		return val;
8435
8436	},
8437
8438	_valueMin: function() {
8439		var valueMin = 0;
8440		return valueMin;
8441	},
8442
8443	_valueMax: function() {
8444		var valueMax = 100;
8445		return valueMax;
8446	},
8447
8448	_refreshValue: function() {
8449		var value = this.value();
8450		this.valueDiv[value == this._valueMax() ? 'addClass' : 'removeClass']("ui-corner-right");
8451		this.valueDiv.width(value + '%');
8452		this.element.attr("aria-valuenow", value);
8453	}
8454
8455});
8456
8457$.extend($.ui.progressbar, {
8458	version: "1.7.3",
8459	defaults: {
8460		value: 0
8461	}
8462});
8463
8464})(jQuery);
8465/*
8466 * jQuery UI Effects 1.7.3
8467 *
8468 * Copyright (c) 2009 AUTHORS.txt (https://jqueryui.com/about)
8469 * Dual licensed under the MIT (MIT-LICENSE.txt)
8470 * and GPL (GPL-LICENSE.txt) licenses.
8471 *
8472 * https://docs.jquery.com/UI/Effects/
8473 */
8474;jQuery.effects || (function($) {
8475
8476$.effects = {
8477	version: "1.7.3",
8478
8479	// Saves a set of properties in a data storage
8480	save: function(element, set) {
8481		for(var i=0; i < set.length; i++) {
8482			if(set[i] !== null) element.data("ec.storage."+set[i], element[0].style[set[i]]);
8483		}
8484	},
8485
8486	// Restores a set of previously saved properties from a data storage
8487	restore: function(element, set) {
8488		for(var i=0; i < set.length; i++) {
8489			if(set[i] !== null) element.css(set[i], element.data("ec.storage."+set[i]));
8490		}
8491	},
8492
8493	setMode: function(el, mode) {
8494		if (mode == 'toggle') mode = el.is(':hidden') ? 'show' : 'hide'; // Set for toggle
8495		return mode;
8496	},
8497
8498	getBaseline: function(origin, original) { // Translates a [top,left] array into a baseline value
8499		// this should be a little more flexible in the future to handle a string & hash
8500		var y, x;
8501		switch (origin[0]) {
8502			case 'top': y = 0; break;
8503			case 'middle': y = 0.5; break;
8504			case 'bottom': y = 1; break;
8505			default: y = origin[0] / original.height;
8506		};
8507		switch (origin[1]) {
8508			case 'left': x = 0; break;
8509			case 'center': x = 0.5; break;
8510			case 'right': x = 1; break;
8511			default: x = origin[1] / original.width;
8512		};
8513		return {x: x, y: y};
8514	},
8515
8516	// Wraps the element around a wrapper that copies position properties
8517	createWrapper: function(element) {
8518
8519		//if the element is already wrapped, return it
8520		if (element.parent().is('.ui-effects-wrapper'))
8521			return element.parent();
8522
8523		//Cache width,height and float properties of the element, and create a wrapper around it
8524		var props = { width: element.outerWidth(true), height: element.outerHeight(true), 'float': element.css('float') };
8525		element.wrap('<div class="ui-effects-wrapper" style="font-size:100%;background:transparent;border:none;margin:0;padding:0"></div>');
8526		var wrapper = element.parent();
8527
8528		//Transfer the positioning of the element to the wrapper
8529		if (element.css('position') == 'static') {
8530			wrapper.css({ position: 'relative' });
8531			element.css({ position: 'relative'} );
8532		} else {
8533			var top = element.css('top'); if(isNaN(parseInt(top,10))) top = 'auto';
8534			var left = element.css('left'); if(isNaN(parseInt(left,10))) left = 'auto';
8535			wrapper.css({ position: element.css('position'), top: top, left: left, zIndex: element.css('z-index') }).show();
8536			element.css({position: 'relative', top: 0, left: 0 });
8537		}
8538
8539		wrapper.css(props);
8540		return wrapper;
8541	},
8542
8543	removeWrapper: function(element) {
8544		if (element.parent().is('.ui-effects-wrapper'))
8545			return element.parent().replaceWith(element);
8546		return element;
8547	},
8548
8549	setTransition: function(element, list, factor, value) {
8550		value = value || {};
8551		$.each(list, function(i, x){
8552			unit = element.cssUnit(x);
8553			if (unit[0] > 0) value[x] = unit[0] * factor + unit[1];
8554		});
8555		return value;
8556	},
8557
8558	//Base function to animate from one class to another in a seamless transition
8559	animateClass: function(value, duration, easing, callback) {
8560
8561		var cb = (typeof easing == "function" ? easing : (callback ? callback : null));
8562		var ea = (typeof easing == "string" ? easing : null);
8563
8564		return this.each(function() {
8565
8566			var offset = {}; var that = $(this); var oldStyleAttr = that.attr("style") || '';
8567			if(typeof oldStyleAttr == 'object') oldStyleAttr = oldStyleAttr["cssText"]; /* Stupidly in IE, style is a object.. */
8568			if(value.toggle) { that.hasClass(value.toggle) ? value.remove = value.toggle : value.add = value.toggle; }
8569
8570			//Let's get a style offset
8571			var oldStyle = $.extend({}, (document.defaultView ? document.defaultView.getComputedStyle(this,null) : this.currentStyle));
8572			if(value.add) that.addClass(value.add); if(value.remove) that.removeClass(value.remove);
8573			var newStyle = $.extend({}, (document.defaultView ? document.defaultView.getComputedStyle(this,null) : this.currentStyle));
8574			if(value.add) that.removeClass(value.add); if(value.remove) that.addClass(value.remove);
8575
8576			// The main function to form the object for animation
8577			for(var n in newStyle) {
8578				if( typeof newStyle[n] != "function" && newStyle[n] /* No functions and null properties */
8579				&& n.indexOf("Moz") == -1 && n.indexOf("length") == -1 /* No mozilla spezific render properties. */
8580				&& newStyle[n] != oldStyle[n] /* Only values that have changed are used for the animation */
8581				&& (n.match(/color/i) || (!n.match(/color/i) && !isNaN(parseInt(newStyle[n],10)))) /* Only things that can be parsed to integers or colors */
8582				&& (oldStyle.position != "static" || (oldStyle.position == "static" && !n.match(/left|top|bottom|right/))) /* No need for positions when dealing with static positions */
8583				) offset[n] = newStyle[n];
8584			}
8585
8586			that.animate(offset, duration, ea, function() { // Animate the newly constructed offset object
8587				// Change style attribute back to original. For stupid IE, we need to clear the damn object.
8588				if(typeof $(this).attr("style") == 'object') { $(this).attr("style")["cssText"] = ""; $(this).attr("style")["cssText"] = oldStyleAttr; } else $(this).attr("style", oldStyleAttr);
8589				if(value.add) $(this).addClass(value.add); if(value.remove) $(this).removeClass(value.remove);
8590				if(cb) cb.apply(this, arguments);
8591			});
8592
8593		});
8594	}
8595};
8596
8597
8598function _normalizeArguments(a, m) {
8599
8600	var o = a[1] && a[1].constructor == Object ? a[1] : {}; if(m) o.mode = m;
8601	var speed = a[1] && a[1].constructor != Object ? a[1] : (o.duration ? o.duration : a[2]); //either comes from options.duration or the secon/third argument
8602		speed = $.fx.off ? 0 : typeof speed === "number" ? speed : $.fx.speeds[speed] || $.fx.speeds._default;
8603	var callback = o.callback || ( $.isFunction(a[1]) && a[1] ) || ( $.isFunction(a[2]) && a[2] ) || ( $.isFunction(a[3]) && a[3] );
8604
8605	return [a[0], o, speed, callback];
8606	
8607}
8608
8609//Extend the methods of jQuery
8610$.fn.extend({
8611
8612	//Save old methods
8613	_show: $.fn.show,
8614	_hide: $.fn.hide,
8615	__toggle: $.fn.toggle,
8616	_addClass: $.fn.addClass,
8617	_removeClass: $.fn.removeClass,
8618	_toggleClass: $.fn.toggleClass,
8619
8620	// New effect methods
8621	effect: function(fx, options, speed, callback) {
8622		return $.effects[fx] ? $.effects[fx].call(this, {method: fx, options: options || {}, duration: speed, callback: callback }) : null;
8623	},
8624
8625	show: function() {
8626		if(!arguments[0] || (arguments[0].constructor == Number || (/(slow|normal|fast)/).test(arguments[0])))
8627			return this._show.apply(this, arguments);
8628		else {
8629			return this.effect.apply(this, _normalizeArguments(arguments, 'show'));
8630		}
8631	},
8632
8633	hide: function() {
8634		if(!arguments[0] || (arguments[0].constructor == Number || (/(slow|normal|fast)/).test(arguments[0])))
8635			return this._hide.apply(this, arguments);
8636		else {
8637			return this.effect.apply(this, _normalizeArguments(arguments, 'hide'));
8638		}
8639	},
8640
8641	toggle: function(){
8642		if(!arguments[0] ||
8643			(arguments[0].constructor == Number || (/(slow|normal|fast)/).test(arguments[0])) ||
8644			($.isFunction(arguments[0]) || typeof arguments[0] == 'boolean')) {
8645			return this.__toggle.apply(this, arguments);
8646		} else {
8647			return this.effect.apply(this, _normalizeArguments(arguments, 'toggle'));
8648		}
8649	},
8650
8651	addClass: function(classNames, speed, easing, callback) {
8652		return speed ? $.effects.animateClass.apply(this, [{ add: classNames },speed,easing,callback]) : this._addClass(classNames);
8653	},
8654	removeClass: function(classNames,speed,easing,callback) {
8655		return speed ? $.effects.animateClass.apply(this, [{ remove: classNames },speed,easing,callback]) : this._removeClass(classNames);
8656	},
8657	toggleClass: function(classNames,speed,easing,callback) {
8658		return ( (typeof speed !== "boolean") && speed ) ? $.effects.animateClass.apply(this, [{ toggle: classNames },speed,easing,callback]) : this._toggleClass(classNames, speed);
8659	},
8660	morph: function(remove,add,speed,easing,callback) {
8661		return $.effects.animateClass.apply(this, [{ add: add, remove: remove },speed,easing,callback]);
8662	},
8663	switchClass: function() {
8664		return this.morph.apply(this, arguments);
8665	},
8666
8667	// helper functions
8668	cssUnit: function(key) {
8669		var style = this.css(key), val = [];
8670		$.each( ['em','px','%','pt'], function(i, unit){
8671			if(style.indexOf(unit) > 0)
8672				val = [parseFloat(style), unit];
8673		});
8674		return val;
8675	}
8676});
8677
8678/*
8679 * jQuery Color Animations
8680 * Copyright 2007 John Resig
8681 * Released under the MIT and GPL licenses.
8682 */
8683
8684// We override the animation for all of these color styles
8685$.each(['backgroundColor', 'borderBottomColor', 'borderLeftColor', 'borderRightColor', 'borderTopColor', 'color', 'outlineColor'], function(i,attr){
8686		$.fx.step[attr] = function(fx) {
8687				if ( fx.state == 0 ) {
8688						fx.start = getColor( fx.elem, attr );
8689						fx.end = getRGB( fx.end );
8690				}
8691
8692				fx.elem.style[attr] = "rgb(" + [
8693						Math.max(Math.min( parseInt((fx.pos * (fx.end[0] - fx.start[0])) + fx.start[0],10), 255), 0),
8694						Math.max(Math.min( parseInt((fx.pos * (fx.end[1] - fx.start[1])) + fx.start[1],10), 255), 0),
8695						Math.max(Math.min( parseInt((fx.pos * (fx.end[2] - fx.start[2])) + fx.start[2],10), 255), 0)
8696				].join(",") + ")";
8697			};
8698});
8699
8700// Color Conversion functions from highlightFade
8701// By Blair Mitchelmore
8702// https://jquery.offput.ca/highlightFade/
8703
8704// Parse strings looking for color tuples [255,255,255]
8705function getRGB(color) {
8706		var result;
8707
8708		// Check if we're already dealing with an array of colors
8709		if ( color && color.constructor == Array && color.length == 3 )
8710				return color;
8711
8712		// Look for rgb(num,num,num)
8713		if (result = /rgb\(\s*([0-9]{1,3})\s*,\s*([0-9]{1,3})\s*,\s*([0-9]{1,3})\s*\)/.exec(color))
8714				return [parseInt(result[1],10), parseInt(result[2],10), parseInt(result[3],10)];
8715
8716		// Look for rgb(num%,num%,num%)
8717		if (result = /rgb\(\s*([0-9]+(?:\.[0-9]+)?)\%\s*,\s*([0-9]+(?:\.[0-9]+)?)\%\s*,\s*([0-9]+(?:\.[0-9]+)?)\%\s*\)/.exec(color))
8718				return [parseFloat(result[1])*2.55, parseFloat(result[2])*2.55, parseFloat(result[3])*2.55];
8719
8720		// Look for #a0b1c2
8721		if (result = /#([a-fA-F0-9]{2})([a-fA-F0-9]{2})([a-fA-F0-9]{2})/.exec(color))
8722				return [parseInt(result[1],16), parseInt(result[2],16), parseInt(result[3],16)];
8723
8724		// Look for #fff
8725		if (result = /#([a-fA-F0-9])([a-fA-F0-9])([a-fA-F0-9])/.exec(color))
8726				return [parseInt(result[1]+result[1],16), parseInt(result[2]+result[2],16), parseInt(result[3]+result[3],16)];
8727
8728		// Look for rgba(0, 0, 0, 0) == transparent in Safari 3
8729		if (result = /rgba\(0, 0, 0, 0\)/.exec(color))
8730				return colors['transparent'];
8731
8732		// Otherwise, we're most likely dealing with a named color
8733		return colors[$.trim(color).toLowerCase()];
8734}
8735
8736function getColor(elem, attr) {
8737		var color;
8738
8739		do {
8740				color = $.curCSS(elem, attr);
8741
8742				// Keep going until we find an element that has color, or we hit the body
8743				if ( color != '' && color != 'transparent' || $.nodeName(elem, "body") )
8744						break;
8745
8746				attr = "backgroundColor";
8747		} while ( elem = elem.parentNode );
8748
8749		return getRGB(color);
8750};
8751
8752// Some named colors to work with
8753// From Interface by Stefan Petre
8754// https://interface.eyecon.ro/
8755
8756var colors = {
8757	aqua:[0,255,255],
8758	azure:[240,255,255],
8759	beige:[245,245,220],
8760	black:[0,0,0],
8761	blue:[0,0,255],
8762	brown:[165,42,42],
8763	cyan:[0,255,255],
8764	darkblue:[0,0,139],
8765	darkcyan:[0,139,139],
8766	darkgrey:[169,169,169],
8767	darkgreen:[0,100,0],
8768	darkkhaki:[189,183,107],
8769	darkmagenta:[139,0,139],
8770	darkolivegreen:[85,107,47],
8771	darkorange:[255,140,0],
8772	darkorchid:[153,50,204],
8773	darkred:[139,0,0],
8774	darksalmon:[233,150,122],
8775	darkviolet:[148,0,211],
8776	fuchsia:[255,0,255],
8777	gold:[255,215,0],
8778	green:[0,128,0],
8779	indigo:[75,0,130],
8780	khaki:[240,230,140],
8781	lightblue:[173,216,230],
8782	lightcyan:[224,255,255],
8783	lightgreen:[144,238,144],
8784	lightgrey:[211,211,211],
8785	lightpink:[255,182,193],
8786	lightyellow:[255,255,224],
8787	lime:[0,255,0],
8788	magenta:[255,0,255],
8789	maroon:[128,0,0],
8790	navy:[0,0,128],
8791	olive:[128,128,0],
8792	orange:[255,165,0],
8793	pink:[255,192,203],
8794	purple:[128,0,128],
8795	violet:[128,0,128],
8796	red:[255,0,0],
8797	silver:[192,192,192],
8798	white:[255,255,255],
8799	yellow:[255,255,0],
vendor: 8,512 bytes, lines 8800-9019
8800	transparent: [255,255,255]
8801};
8802
8803/*
8804 * jQuery Easing v1.3 - https://gsgd.co.uk/sandbox/jquery/easing/
8805 *
8806 * Uses the built in easing capabilities added In jQuery 1.1
8807 * to offer multiple easing options
8808 *
8809 * TERMS OF USE - jQuery Easing
8810 *
8811 * Open source under the BSD License.
8812 *
8813 * Copyright 2008 George McGinley Smith
8814 * All rights reserved.
8815 *
8816 * Redistribution and use in source and binary forms, with or without modification,
8817 * are permitted provided that the following conditions are met:
8818 *
8819 * Redistributions of source code must retain the above copyright notice, this list of
8820 * conditions and the following disclaimer.
8821 * Redistributions in binary form must reproduce the above copyright notice, this list
8822 * of conditions and the following disclaimer in the documentation and/or other materials
8823 * provided with the distribution.
8824 *
8825 * Neither the name of the author nor the names of contributors may be used to endorse
8826 * or promote products derived from this software without specific prior written permission.
8827 *
8828 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY
8829 * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
8830 * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
8831 * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
8832 * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
8833 * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
8834 * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
8835 * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
8836 * OF THE POSSIBILITY OF SUCH DAMAGE.
8837 *
8838*/
8839
8840// t: current time, b: begInnIng value, c: change In value, d: duration
8841$.easing.jswing = $.easing.swing;
8842
8843$.extend($.easing,
8844{
8845	def: 'easeOutQuad',
8846	swing: function (x, t, b, c, d) {
8847		//alert($.easing.default);
8848		return $.easing[$.easing.def](x, t, b, c, d);
8849	},
8850	easeInQuad: function (x, t, b, c, d) {
8851		return c*(t/=d)*t + b;
8852	},
8853	easeOutQuad: function (x, t, b, c, d) {
8854		return -c *(t/=d)*(t-2) + b;
8855	},
8856	easeInOutQuad: function (x, t, b, c, d) {
8857		if ((t/=d/2) < 1) return c/2*t*t + b;
8858		return -c/2 * ((--t)*(t-2) - 1) + b;
8859	},
8860	easeInCubic: function (x, t, b, c, d) {
8861		return c*(t/=d)*t*t + b;
8862	},
8863	easeOutCubic: function (x, t, b, c, d) {
8864		return c*((t=t/d-1)*t*t + 1) + b;
8865	},
8866	easeInOutCubic: function (x, t, b, c, d) {
8867		if ((t/=d/2) < 1) return c/2*t*t*t + b;
8868		return c/2*((t-=2)*t*t + 2) + b;
8869	},
8870	easeInQuart: function (x, t, b, c, d) {
8871		return c*(t/=d)*t*t*t + b;
8872	},
8873	easeOutQuart: function (x, t, b, c, d) {
8874		return -c * ((t=t/d-1)*t*t*t - 1) + b;
8875	},
8876	easeInOutQuart: function (x, t, b, c, d) {
8877		if ((t/=d/2) < 1) return c/2*t*t*t*t + b;
8878		return -c/2 * ((t-=2)*t*t*t - 2) + b;
8879	},
8880	easeInQuint: function (x, t, b, c, d) {
8881		return c*(t/=d)*t*t*t*t + b;
8882	},
8883	easeOutQuint: function (x, t, b, c, d) {
8884		return c*((t=t/d-1)*t*t*t*t + 1) + b;
8885	},
8886	easeInOutQuint: function (x, t, b, c, d) {
8887		if ((t/=d/2) < 1) return c/2*t*t*t*t*t + b;
8888		return c/2*((t-=2)*t*t*t*t + 2) + b;
8889	},
8890	easeInSine: function (x, t, b, c, d) {
8891		return -c * Math.cos(t/d * (Math.PI/2)) + c + b;
8892	},
8893	easeOutSine: function (x, t, b, c, d) {
8894		return c * Math.sin(t/d * (Math.PI/2)) + b;
8895	},
8896	easeInOutSine: function (x, t, b, c, d) {
8897		return -c/2 * (Math.cos(Math.PI*t/d) - 1) + b;
8898	},
8899	easeInExpo: function (x, t, b, c, d) {
8900		return (t==0) ? b : c * Math.pow(2, 10 * (t/d - 1)) + b;
8901	},
8902	easeOutExpo: function (x, t, b, c, d) {
8903		return (t==d) ? b+c : c * (-Math.pow(2, -10 * t/d) + 1) + b;
8904	},
8905	easeInOutExpo: function (x, t, b, c, d) {
8906		if (t==0) return b;
8907		if (t==d) return b+c;
8908		if ((t/=d/2) < 1) return c/2 * Math.pow(2, 10 * (t - 1)) + b;
8909		return c/2 * (-Math.pow(2, -10 * --t) + 2) + b;
8910	},
8911	easeInCirc: function (x, t, b, c, d) {
8912		return -c * (Math.sqrt(1 - (t/=d)*t) - 1) + b;
8913	},
8914	easeOutCirc: function (x, t, b, c, d) {
8915		return c * Math.sqrt(1 - (t=t/d-1)*t) + b;
8916	},
8917	easeInOutCirc: function (x, t, b, c, d) {
8918		if ((t/=d/2) < 1) return -c/2 * (Math.sqrt(1 - t*t) - 1) + b;
8919		return c/2 * (Math.sqrt(1 - (t-=2)*t) + 1) + b;
8920	},
8921	easeInElastic: function (x, t, b, c, d) {
8922		var s=1.70158;var p=0;var a=c;
8923		if (t==0) return b;  if ((t/=d)==1) return b+c;  if (!p) p=d*.3;
8924		if (a < Math.abs(c)) { a=c; var s=p/4; }
8925		else var s = p/(2*Math.PI) * Math.asin (c/a);
8926		return -(a*Math.pow(2,10*(t-=1)) * Math.sin( (t*d-s)*(2*Math.PI)/p )) + b;
8927	},
8928	easeOutElastic: function (x, t, b, c, d) {
8929		var s=1.70158;var p=0;var a=c;
8930		if (t==0) return b;  if ((t/=d)==1) return b+c;  if (!p) p=d*.3;
8931		if (a < Math.abs(c)) { a=c; var s=p/4; }
8932		else var s = p/(2*Math.PI) * Math.asin (c/a);
8933		return a*Math.pow(2,-10*t) * Math.sin( (t*d-s)*(2*Math.PI)/p ) + c + b;
8934	},
8935	easeInOutElastic: function (x, t, b, c, d) {
8936		var s=1.70158;var p=0;var a=c;
8937		if (t==0) return b;  if ((t/=d/2)==2) return b+c;  if (!p) p=d*(.3*1.5);
8938		if (a < Math.abs(c)) { a=c; var s=p/4; }
8939		else var s = p/(2*Math.PI) * Math.asin (c/a);
8940		if (t < 1) return -.5*(a*Math.pow(2,10*(t-=1)) * Math.sin( (t*d-s)*(2*Math.PI)/p )) + b;
8941		return a*Math.pow(2,-10*(t-=1)) * Math.sin( (t*d-s)*(2*Math.PI)/p )*.5 + c + b;
8942	},
8943	easeInBack: function (x, t, b, c, d, s) {
8944		if (s == undefined) s = 1.70158;
8945		return c*(t/=d)*t*((s+1)*t - s) + b;
8946	},
8947	easeOutBack: function (x, t, b, c, d, s) {
8948		if (s == undefined) s = 1.70158;
8949		return c*((t=t/d-1)*t*((s+1)*t + s) + 1) + b;
8950	},
8951	easeInOutBack: function (x, t, b, c, d, s) {
8952		if (s == undefined) s = 1.70158;
8953		if ((t/=d/2) < 1) return c/2*(t*t*(((s*=(1.525))+1)*t - s)) + b;
8954		return c/2*((t-=2)*t*(((s*=(1.525))+1)*t + s) + 2) + b;
8955	},
8956	easeInBounce: function (x, t, b, c, d) {
8957		return c - $.easing.easeOutBounce (x, d-t, 0, c, d) + b;
8958	},
8959	easeOutBounce: function (x, t, b, c, d) {
8960		if ((t/=d) < (1/2.75)) {
8961			return c*(7.5625*t*t) + b;
8962		} else if (t < (2/2.75)) {
8963			return c*(7.5625*(t-=(1.5/2.75))*t + .75) + b;
8964		} else if (t < (2.5/2.75)) {
8965			return c*(7.5625*(t-=(2.25/2.75))*t + .9375) + b;
8966		} else {
8967			return c*(7.5625*(t-=(2.625/2.75))*t + .984375) + b;
8968		}
8969	},
8970	easeInOutBounce: function (x, t, b, c, d) {
8971		if (t < d/2) return $.easing.easeInBounce (x, t*2, 0, c, d) * .5 + b;
8972		return $.easing.easeOutBounce (x, t*2-d, 0, c, d) * .5 + c*.5 + b;
8973	}
8974});
8975
8976/*
8977 *
8978 * TERMS OF USE - EASING EQUATIONS
8979 *
8980 * Open source under the BSD License.
8981 *
8982 * Copyright 2001 Robert Penner
8983 * All rights reserved.
8984 *
8985 * Redistribution and use in source and binary forms, with or without modification,
8986 * are permitted provided that the following conditions are met:
8987 *
8988 * Redistributions of source code must retain the above copyright notice, this list of
8989 * conditions and the following disclaimer.
8990 * Redistributions in binary form must reproduce the above copyright notice, this list
8991 * of conditions and the following disclaimer in the documentation and/or other materials
8992 * provided with the distribution.
8993 *
8994 * Neither the name of the author nor the names of contributors may be used to endorse
8995 * or promote products derived from this software without specific prior written permission.
8996 *
8997 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY
8998 * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
8999 * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
9000 * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
9001 * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
9002 * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
9003 * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
9004 * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
9005 * OF THE POSSIBILITY OF SUCH DAMAGE.
9006 *
9007 */
9008
9009})(jQuery);
9010/*
9011 * jQuery UI Effects Blind 1.7.3
9012 *
9013 * Copyright (c) 2009 AUTHORS.txt (https://jqueryui.com/about)
9014 * Dual licensed under the MIT (MIT-LICENSE.txt)
9015 * and GPL (GPL-LICENSE.txt) licenses.
9016 *
9017 * https://docs.jquery.com/UI/Effects/Blind
9018 *
9019 * Depends:
9020 *	effects.core.js
9021 */
9022(function($) {
9023
9024$.effects.blind = function(o) {
9025
9026	return this.queue(function() {
9027
9028		// Create element
9029		var el = $(this), props = ['position','top','left'];
9030
9031		// Set options
9032		var mode = $.effects.setMode(el, o.options.mode || 'hide'); // Set Mode
9033		var direction = o.options.direction || 'vertical'; // Default direction
9034
9035		// Adjust
9036		$.effects.save(el, props); el.show(); // Save & Show
9037		var wrapper = $.effects.createWrapper(el).css({overflow:'hidden'}); // Create Wrapper
9038		var ref = (direction == 'vertical') ? 'height' : 'width';
9039		var distance = (direction == 'vertical') ? wrapper.height() : wrapper.width();
9040		if(mode == 'show') wrapper.css(ref, 0); // Shift
9041
9042		// Animation
9043		var animation = {};
9044		animation[ref] = mode == 'show' ? distance : 0;
9045
9046		// Animate
9047		wrapper.animate(animation, o.duration, o.options.easing, function() {
9048			if(mode == 'hide') el.hide(); // Hide
9049			$.effects.restore(el, props); $.effects.removeWrapper(el); // Restore
9050			if(o.callback) o.callback.apply(el[0], arguments); // Callback
9051			el.dequeue();
9052		});
9053
9054	});
9055
9056};
9057
9058})(jQuery);
9059/*
9060 * jQuery UI Effects Bounce 1.7.3
9061 *
9062 * Copyright (c) 2009 AUTHORS.txt (https://jqueryui.com/about)
9063 * Dual licensed under the MIT (MIT-LICENSE.txt)
9064 * and GPL (GPL-LICENSE.txt) licenses.
9065 *
9066 * https://docs.jquery.com/UI/Effects/Bounce
9067 *
9068 * Depends:
9069 *	effects.core.js
9070 */
9071(function($) {
9072
9073$.effects.bounce = function(o) {
9074
9075	return this.queue(function() {
9076
9077		// Create element
9078		var el = $(this), props = ['position','top','left'];
9079
9080		// Set options
9081		var mode = $.effects.setMode(el, o.options.mode || 'effect'); // Set Mode
9082		var direction = o.options.direction || 'up'; // Default direction
9083		var distance = o.options.distance || 20; // Default distance
9084		var times = o.options.times || 5; // Default # of times
9085		var speed = o.duration || 250; // Default speed per bounce
9086		if (/show|hide/.test(mode)) props.push('opacity'); // Avoid touching opacity to prevent clearType and PNG issues in IE
9087
9088		// Adjust
9089		$.effects.save(el, props); el.show(); // Save & Show
9090		$.effects.createWrapper(el); // Create Wrapper
9091		var ref = (direction == 'up' || direction == 'down') ? 'top' : 'left';
9092		var motion = (direction == 'up' || direction == 'left') ? 'pos' : 'neg';
9093		var distance = o.options.distance || (ref == 'top' ? el.outerHeight({margin:true}) / 3 : el.outerWidth({margin:true}) / 3);
9094		if (mode == 'show') el.css('opacity', 0).css(ref, motion == 'pos' ? -distance : distance); // Shift
9095		if (mode == 'hide') distance = distance / (times * 2);
9096		if (mode != 'hide') times--;
9097
9098		// Animate
9099		if (mode == 'show') { // Show Bounce
9100			var animation = {opacity: 1};
9101			animation[ref] = (motion == 'pos' ? '+=' : '-=') + distance;
9102			el.animate(animation, speed / 2, o.options.easing);
9103			distance = distance / 2;
9104			times--;
9105		};
9106		for (var i = 0; i < times; i++) { // Bounces
9107			var animation1 = {}, animation2 = {};
9108			animation1[ref] = (motion == 'pos' ? '-=' : '+=') + distance;
9109			animation2[ref] = (motion == 'pos' ? '+=' : '-=') + distance;
9110			el.animate(animation1, speed / 2, o.options.easing).animate(animation2, speed / 2, o.options.easing);
9111			distance = (mode == 'hide') ? distance * 2 : distance / 2;
9112		};
9113		if (mode == 'hide') { // Last Bounce
9114			var animation = {opacity: 0};
9115			animation[ref] = (motion == 'pos' ? '-=' : '+=')  + distance;
9116			el.animate(animation, speed / 2, o.options.easing, function(){
9117				el.hide(); // Hide
9118				$.effects.restore(el, props); $.effects.removeWrapper(el); // Restore
9119				if(o.callback) o.callback.apply(this, arguments); // Callback
9120			});
9121		} else {
9122			var animation1 = {}, animation2 = {};
9123			animation1[ref] = (motion == 'pos' ? '-=' : '+=') + distance;
9124			animation2[ref] = (motion == 'pos' ? '+=' : '-=') + distance;
9125			el.animate(animation1, speed / 2, o.options.easing).animate(animation2, speed / 2, o.options.easing, function(){
9126				$.effects.restore(el, props); $.effects.removeWrapper(el); // Restore
9127				if(o.callback) o.callback.apply(this, arguments); // Callback
9128			});
9129		};
9130		el.queue('fx', function() { el.dequeue(); });
9131		el.dequeue();
9132	});
9133
9134};
9135
9136})(jQuery);
9137/*
9138 * jQuery UI Effects Clip 1.7.3
9139 *
9140 * Copyright (c) 2009 AUTHORS.txt (https://jqueryui.com/about)
9141 * Dual licensed under the MIT (MIT-LICENSE.txt)
9142 * and GPL (GPL-LICENSE.txt) licenses.
9143 *
9144 * https://docs.jquery.com/UI/Effects/Clip
9145 *
9146 * Depends:
9147 *	effects.core.js
9148 */
9149(function($) {
9150
9151$.effects.clip = function(o) {
9152
9153	return this.queue(function() {
9154
9155		// Create element
9156		var el = $(this), props = ['position','top','left','height','width'];
9157
9158		// Set options
9159		var mode = $.effects.setMode(el, o.options.mode || 'hide'); // Set Mode
9160		var direction = o.options.direction || 'vertical'; // Default direction
9161
9162		// Adjust
9163		$.effects.save(el, props); el.show(); // Save & Show
9164		var wrapper = $.effects.createWrapper(el).css({overflow:'hidden'}); // Create Wrapper
9165		var animate = el[0].tagName == 'IMG' ? wrapper : el;
9166		var ref = {
9167			size: (direction == 'vertical') ? 'height' : 'width',
9168			position: (direction == 'vertical') ? 'top' : 'left'
9169		};
9170		var distance = (direction == 'vertical') ? animate.height() : animate.width();
9171		if(mode == 'show') { animate.css(ref.size, 0); animate.css(ref.position, distance / 2); } // Shift
9172
9173		// Animation
9174		var animation = {};
9175		animation[ref.size] = mode == 'show' ? distance : 0;
9176		animation[ref.position] = mode == 'show' ? 0 : distance / 2;
9177
9178		// Animate
9179		animate.animate(animation, { queue: false, duration: o.duration, easing: o.options.easing, complete: function() {
9180			if(mode == 'hide') el.hide(); // Hide
9181			$.effects.restore(el, props); $.effects.removeWrapper(el); // Restore
9182			if(o.callback) o.callback.apply(el[0], arguments); // Callback
9183			el.dequeue();
9184		}});
9185
9186	});
9187
9188};
9189
9190})(jQuery);
9191/*
9192 * jQuery UI Effects Drop 1.7.3
9193 *
9194 * Copyright (c) 2009 AUTHORS.txt (https://jqueryui.com/about)
9195 * Dual licensed under the MIT (MIT-LICENSE.txt)
9196 * and GPL (GPL-LICENSE.txt) licenses.
9197 *
9198 * https://docs.jquery.com/UI/Effects/Drop
9199 *
9200 * Depends:
9201 *	effects.core.js
9202 */
9203(function($) {
9204
9205$.effects.drop = function(o) {
9206
9207	return this.queue(function() {
9208
9209		// Create element
9210		var el = $(this), props = ['position','top','left','opacity'];
9211
9212		// Set options
9213		var mode = $.effects.setMode(el, o.options.mode || 'hide'); // Set Mode
9214		var direction = o.options.direction || 'left'; // Default Direction
9215
9216		// Adjust
9217		$.effects.save(el, props); el.show(); // Save & Show
9218		$.effects.createWrapper(el); // Create Wrapper
9219		var ref = (direction == 'up' || direction == 'down') ? 'top' : 'left';
9220		var motion = (direction == 'up' || direction == 'left') ? 'pos' : 'neg';
9221		var distance = o.options.distance || (ref == 'top' ? el.outerHeight({margin:true}) / 2 : el.outerWidth({margin:true}) / 2);
9222		if (mode == 'show') el.css('opacity', 0).css(ref, motion == 'pos' ? -distance : distance); // Shift
9223
9224		// Animation
9225		var animation = {opacity: mode == 'show' ? 1 : 0};
9226		animation[ref] = (mode == 'show' ? (motion == 'pos' ? '+=' : '-=') : (motion == 'pos' ? '-=' : '+=')) + distance;
9227
9228		// Animate
9229		el.animate(animation, { queue: false, duration: o.duration, easing: o.options.easing, complete: function() {
9230			if(mode == 'hide') el.hide(); // Hide
9231			$.effects.restore(el, props); $.effects.removeWrapper(el); // Restore
9232			if(o.callback) o.callback.apply(this, arguments); // Callback
9233			el.dequeue();
9234		}});
9235
9236	});
9237
9238};
9239
9240})(jQuery);
9241/*
9242 * jQuery UI Effects Explode 1.7.3
9243 *
9244 * Copyright (c) 2009 AUTHORS.txt (https://jqueryui.com/about)
9245 * Dual licensed under the MIT (MIT-LICENSE.txt)
9246 * and GPL (GPL-LICENSE.txt) licenses.
9247 *
9248 * https://docs.jquery.com/UI/Effects/Explode
9249 *
9250 * Depends:
9251 *	effects.core.js
9252 */
9253(function($) {
9254
9255$.effects.explode = function(o) {
9256
9257	return this.queue(function() {
9258
9259	var rows = o.options.pieces ? Math.round(Math.sqrt(o.options.pieces)) : 3;
9260	var cells = o.options.pieces ? Math.round(Math.sqrt(o.options.pieces)) : 3;
9261
9262	o.options.mode = o.options.mode == 'toggle' ? ($(this).is(':visible') ? 'hide' : 'show') : o.options.mode;
9263	var el = $(this).show().css('visibility', 'hidden');
9264	var offset = el.offset();
9265
9266	//Substract the margins - not fixing the problem yet.
9267	offset.top -= parseInt(el.css("marginTop"),10) || 0;
9268	offset.left -= parseInt(el.css("marginLeft"),10) || 0;
9269
9270	var width = el.outerWidth(true);
9271	var height = el.outerHeight(true);
9272
9273	for(var i=0;i<rows;i++) { // =
9274		for(var j=0;j<cells;j++) { // ||
9275			el
9276				.clone()
9277				.appendTo('body')
9278				.wrap('<div></div>')
9279				.css({
9280					position: 'absolute',
9281					visibility: 'visible',
9282					left: -j*(width/cells),
9283					top: -i*(height/rows)
9284				})
9285				.parent()
9286				.addClass('ui-effects-explode')
9287				.css({
9288					position: 'absolute',
9289					overflow: 'hidden',
9290					width: width/cells,
9291					height: height/rows,
9292					left: offset.left + j*(width/cells) + (o.options.mode == 'show' ? (j-Math.floor(cells/2))*(width/cells) : 0),
9293					top: offset.top + i*(height/rows) + (o.options.mode == 'show' ? (i-Math.floor(rows/2))*(height/rows) : 0),
9294					opacity: o.options.mode == 'show' ? 0 : 1
9295				}).animate({
9296					left: offset.left + j*(width/cells) + (o.options.mode == 'show' ? 0 : (j-Math.floor(cells/2))*(width/cells)),
9297					top: offset.top + i*(height/rows) + (o.options.mode == 'show' ? 0 : (i-Math.floor(rows/2))*(height/rows)),
9298					opacity: o.options.mode == 'show' ? 1 : 0
9299				}, o.duration || 500);
9300		}
9301	}
9302
9303	// Set a timeout, to call the callback approx. when the other animations have finished
9304	setTimeout(function() {
9305
9306		o.options.mode == 'show' ? el.css({ visibility: 'visible' }) : el.css({ visibility: 'visible' }).hide();
9307				if(o.callback) o.callback.apply(el[0]); // Callback
9308				el.dequeue();
9309
9310				$('div.ui-effects-explode').remove();
9311
9312	}, o.duration || 500);
9313
9314
9315	});
9316
9317};
9318
9319})(jQuery);
9320/*
9321 * jQuery UI Effects Fold 1.7.3
9322 *
9323 * Copyright (c) 2009 AUTHORS.txt (https://jqueryui.com/about)
9324 * Dual licensed under the MIT (MIT-LICENSE.txt)
9325 * and GPL (GPL-LICENSE.txt) licenses.
9326 *
9327 * https://docs.jquery.com/UI/Effects/Fold
9328 *
9329 * Depends:
9330 *	effects.core.js
9331 */
9332(function($) {
9333
9334$.effects.fold = function(o) {
9335
9336	return this.queue(function() {
9337
9338		// Create element
9339		var el = $(this), props = ['position','top','left'];
9340
9341		// Set options
9342		var mode = $.effects.setMode(el, o.options.mode || 'hide'); // Set Mode
9343		var size = o.options.size || 15; // Default fold size
9344		var horizFirst = !(!o.options.horizFirst); // Ensure a boolean value
9345		var duration = o.duration ? o.duration / 2 : $.fx.speeds._default / 2;
9346
9347		// Adjust
9348		$.effects.save(el, props); el.show(); // Save & Show
9349		var wrapper = $.effects.createWrapper(el).css({overflow:'hidden'}); // Create Wrapper
9350		var widthFirst = ((mode == 'show') != horizFirst);
9351		var ref = widthFirst ? ['width', 'height'] : ['height', 'width'];
9352		var distance = widthFirst ? [wrapper.width(), wrapper.height()] : [wrapper.height(), wrapper.width()];
9353		var percent = /([0-9]+)%/.exec(size);
9354		if(percent) size = parseInt(percent[1],10) / 100 * distance[mode == 'hide' ? 0 : 1];
9355		if(mode == 'show') wrapper.css(horizFirst ? {height: 0, width: size} : {height: size, width: 0}); // Shift
9356
9357		// Animation
9358		var animation1 = {}, animation2 = {};
9359		animation1[ref[0]] = mode == 'show' ? distance[0] : size;
9360		animation2[ref[1]] = mode == 'show' ? distance[1] : 0;
9361
9362		// Animate
9363		wrapper.animate(animation1, duration, o.options.easing)
9364		.animate(animation2, duration, o.options.easing, function() {
9365			if(mode == 'hide') el.hide(); // Hide
9366			$.effects.restore(el, props); $.effects.removeWrapper(el); // Restore
9367			if(o.callback) o.callback.apply(el[0], arguments); // Callback
9368			el.dequeue();
9369		});
9370
9371	});
9372
9373};
9374
9375})(jQuery);
9376/*
9377 * jQuery UI Effects Highlight 1.7.3
9378 *
9379 * Copyright (c) 2009 AUTHORS.txt (https://jqueryui.com/about)
9380 * Dual licensed under the MIT (MIT-LICENSE.txt)
9381 * and GPL (GPL-LICENSE.txt) licenses.
9382 *
9383 * https://docs.jquery.com/UI/Effects/Highlight
9384 *
9385 * Depends:
9386 *	effects.core.js
9387 */
9388(function($) {
9389
9390$.effects.highlight = function(o) {
9391
9392	return this.queue(function() {
9393
9394		// Create element
9395		var el = $(this), props = ['backgroundImage','backgroundColor','opacity'];
9396
9397		// Set options
9398		var mode = $.effects.setMode(el, o.options.mode || 'show'); // Set Mode
9399		var color = o.options.color || "#ffff99"; // Default highlight color
9400		var oldColor = el.css("backgroundColor");
9401
9402		// Adjust
9403		$.effects.save(el, props); el.show(); // Save & Show
9404		el.css({backgroundImage: 'none', backgroundColor: color}); // Shift
9405
9406		// Animation
9407		var animation = {backgroundColor: oldColor };
9408		if (mode == "hide") animation['opacity'] = 0;
9409
9410		// Animate
9411		el.animate(animation, { queue: false, duration: o.duration, easing: o.options.easing, complete: function() {
9412			if(mode == "hide") el.hide();
9413			$.effects.restore(el, props);
9414		if (mode == "show" && $.browser.msie) this.style.removeAttribute('filter');
9415			if(o.callback) o.callback.apply(this, arguments);
9416			el.dequeue();
9417		}});
9418
9419	});
9420
9421};
9422
9423})(jQuery);
9424/*
9425 * jQuery UI Effects Pulsate 1.7.3
9426 *
9427 * Copyright (c) 2009 AUTHORS.txt (https://jqueryui.com/about)
9428 * Dual licensed under the MIT (MIT-LICENSE.txt)
9429 * and GPL (GPL-LICENSE.txt) licenses.
9430 *
9431 * https://docs.jquery.com/UI/Effects/Pulsate
9432 *
9433 * Depends:
9434 *	effects.core.js
9435 */
9436(function($) {
9437
9438$.effects.pulsate = function(o) {
9439
9440	return this.queue(function() {
9441
9442		// Create element
9443		var el = $(this);
9444
9445		// Set options
9446		var mode = $.effects.setMode(el, o.options.mode || 'show'); // Set Mode
9447		var times = o.options.times || 5; // Default # of times
9448		var duration = o.duration ? o.duration / 2 : $.fx.speeds._default / 2;
9449
9450		// Adjust
9451		if (mode == 'hide') times--;
9452		if (el.is(':hidden')) { // Show fadeIn
9453			el.css('opacity', 0);
9454			el.show(); // Show
9455			el.animate({opacity: 1}, duration, o.options.easing);
9456			times = times-2;
9457		}
9458
9459		// Animate
9460		for (var i = 0; i < times; i++) { // Pulsate
9461			el.animate({opacity: 0}, duration, o.options.easing).animate({opacity: 1}, duration, o.options.easing);
9462		};
9463		if (mode == 'hide') { // Last Pulse
9464			el.animate({opacity: 0}, duration, o.options.easing, function(){
9465				el.hide(); // Hide
9466				if(o.callback) o.callback.apply(this, arguments); // Callback
9467			});
9468		} else {
9469			el.animate({opacity: 0}, duration, o.options.easing).animate({opacity: 1}, duration, o.options.easing, function(){
9470				if(o.callback) o.callback.apply(this, arguments); // Callback
9471			});
9472		};
9473		el.queue('fx', function() { el.dequeue(); });
9474		el.dequeue();
9475	});
9476
9477};
9478
9479})(jQuery);
9480/*
9481 * jQuery UI Effects Scale 1.7.3
9482 *
9483 * Copyright (c) 2009 AUTHORS.txt (https://jqueryui.com/about)
9484 * Dual licensed under the MIT (MIT-LICENSE.txt)
9485 * and GPL (GPL-LICENSE.txt) licenses.
9486 *
9487 * https://docs.jquery.com/UI/Effects/Scale
9488 *
9489 * Depends:
9490 *	effects.core.js
9491 */
9492(function($) {
9493
9494$.effects.puff = function(o) {
9495
9496	return this.queue(function() {
9497
9498		// Create element
9499		var el = $(this);
9500
9501		// Set options
9502		var options = $.extend(true, {}, o.options);
9503		var mode = $.effects.setMode(el, o.options.mode || 'hide'); // Set Mode
9504		var percent = parseInt(o.options.percent,10) || 150; // Set default puff percent
9505		options.fade = true; // It's not a puff if it doesn't fade! :)
9506		var original = {height: el.height(), width: el.width()}; // Save original
9507
9508		// Adjust
9509		var factor = percent / 100;
9510		el.from = (mode == 'hide') ? original : {height: original.height * factor, width: original.width * factor};
9511
9512		// Animation
9513		options.from = el.from;
9514		options.percent = (mode == 'hide') ? percent : 100;
9515		options.mode = mode;
9516
9517		// Animate
9518		el.effect('scale', options, o.duration, o.callback);
9519		el.dequeue();
9520	});
9521
9522};
9523
9524$.effects.scale = function(o) {
9525
9526	return this.queue(function() {
9527
9528		// Create element
9529		var el = $(this);
9530
9531		// Set options
9532		var options = $.extend(true, {}, o.options);
9533		var mode = $.effects.setMode(el, o.options.mode || 'effect'); // Set Mode
9534		var percent = parseInt(o.options.percent,10) || (parseInt(o.options.percent,10) == 0 ? 0 : (mode == 'hide' ? 0 : 100)); // Set default scaling percent
9535		var direction = o.options.direction || 'both'; // Set default axis
9536		var origin = o.options.origin; // The origin of the scaling
9537		if (mode != 'effect') { // Set default origin and restore for show/hide
9538			options.origin = origin || ['middle','center'];
9539			options.restore = true;
9540		}
9541		var original = {height: el.height(), width: el.width()}; // Save original
9542		el.from = o.options.from || (mode == 'show' ? {height: 0, width: 0} : original); // Default from state
9543
9544		// Adjust
9545		var factor = { // Set scaling factor
9546			y: direction != 'horizontal' ? (percent / 100) : 1,
9547			x: direction != 'vertical' ? (percent / 100) : 1
9548		};
9549		el.to = {height: original.height * factor.y, width: original.width * factor.x}; // Set to state
9550
9551		if (o.options.fade) { // Fade option to support puff
9552			if (mode == 'show') {el.from.opacity = 0; el.to.opacity = 1;};
9553			if (mode == 'hide') {el.from.opacity = 1; el.to.opacity = 0;};
9554		};
9555
9556		// Animation
9557		options.from = el.from; options.to = el.to; options.mode = mode;
9558
9559		// Animate
9560		el.effect('size', options, o.duration, o.callback);
9561		el.dequeue();
9562	});
9563
9564};
9565
9566$.effects.size = function(o) {
9567
9568	return this.queue(function() {
9569
9570		// Create element
9571		var el = $(this), props = ['position','top','left','width','height','overflow','opacity'];
9572		var props1 = ['position','top','left','overflow','opacity']; // Always restore
9573		var props2 = ['width','height','overflow']; // Copy for children
9574		var cProps = ['fontSize'];
9575		var vProps = ['borderTopWidth', 'borderBottomWidth', 'paddingTop', 'paddingBottom'];
9576		var hProps = ['borderLeftWidth', 'borderRightWidth', 'paddingLeft', 'paddingRight'];
9577
9578		// Set options
9579		var mode = $.effects.setMode(el, o.options.mode || 'effect'); // Set Mode
9580		var restore = o.options.restore || false; // Default restore
9581		var scale = o.options.scale || 'both'; // Default scale mode
9582		var origin = o.options.origin; // The origin of the sizing
9583		var original = {height: el.height(), width: el.width()}; // Save original
9584		el.from = o.options.from || original; // Default from state
9585		el.to = o.options.to || original; // Default to state
9586		// Adjust
9587		if (origin) { // Calculate baseline shifts
9588			var baseline = $.effects.getBaseline(origin, original);
9589			el.from.top = (original.height - el.from.height) * baseline.y;
9590			el.from.left = (original.width - el.from.width) * baseline.x;
9591			el.to.top = (original.height - el.to.height) * baseline.y;
9592			el.to.left = (original.width - el.to.width) * baseline.x;
9593		};
9594		var factor = { // Set scaling factor
9595			from: {y: el.from.height / original.height, x: el.from.width / original.width},
9596			to: {y: el.to.height / original.height, x: el.to.width / original.width}
9597		};
9598		if (scale == 'box' || scale == 'both') { // Scale the css box
9599			if (factor.from.y != factor.to.y) { // Vertical props scaling
9600				props = props.concat(vProps);
9601				el.from = $.effects.setTransition(el, vProps, factor.from.y, el.from);
9602				el.to = $.effects.setTransition(el, vProps, factor.to.y, el.to);
9603			};
9604			if (factor.from.x != factor.to.x) { // Horizontal props scaling
9605				props = props.concat(hProps);
9606				el.from = $.effects.setTransition(el, hProps, factor.from.x, el.from);
9607				el.to = $.effects.setTransition(el, hProps, factor.to.x, el.to);
9608			};
9609		};
9610		if (scale == 'content' || scale == 'both') { // Scale the content
9611			if (factor.from.y != factor.to.y) { // Vertical props scaling
9612				props = props.concat(cProps);
9613				el.from = $.effects.setTransition(el, cProps, factor.from.y, el.from);
9614				el.to = $.effects.setTransition(el, cProps, factor.to.y, el.to);
9615			};
9616		};
9617		$.effects.save(el, restore ? props : props1); el.show(); // Save & Show
9618		$.effects.createWrapper(el); // Create Wrapper
9619		el.css('overflow','hidden').css(el.from); // Shift
9620
9621		// Animate
9622		if (scale == 'content' || scale == 'both') { // Scale the children
9623			vProps = vProps.concat(['marginTop','marginBottom']).concat(cProps); // Add margins/font-size
9624			hProps = hProps.concat(['marginLeft','marginRight']); // Add margins
9625			props2 = props.concat(vProps).concat(hProps); // Concat
9626			el.find("*[width]").each(function(){
9627				child = $(this);
9628				if (restore) $.effects.save(child, props2);
9629				var c_original = {height: child.height(), width: child.width()}; // Save original
9630				child.from = {height: c_original.height * factor.from.y, width: c_original.width * factor.from.x};
9631				child.to = {height: c_original.height * factor.to.y, width: c_original.width * factor.to.x};
9632				if (factor.from.y != factor.to.y) { // Vertical props scaling
9633					child.from = $.effects.setTransition(child, vProps, factor.from.y, child.from);
9634					child.to = $.effects.setTransition(child, vProps, factor.to.y, child.to);
9635				};
9636				if (factor.from.x != factor.to.x) { // Horizontal props scaling
9637					child.from = $.effects.setTransition(child, hProps, factor.from.x, child.from);
9638					child.to = $.effects.setTransition(child, hProps, factor.to.x, child.to);
9639				};
9640				child.css(child.from); // Shift children
9641				child.animate(child.to, o.duration, o.options.easing, function(){
9642					if (restore) $.effects.restore(child, props2); // Restore children
9643				}); // Animate children
9644			});
9645		};
9646
9647		// Animate
9648		el.animate(el.to, { queue: false, duration: o.duration, easing: o.options.easing, complete: function() {
9649			if(mode == 'hide') el.hide(); // Hide
9650			$.effects.restore(el, restore ? props : props1); $.effects.removeWrapper(el); // Restore
9651			if(o.callback) o.callback.apply(this, arguments); // Callback
9652			el.dequeue();
9653		}});
9654
9655	});
9656
9657};
9658
9659})(jQuery);
9660/*
9661 * jQuery UI Effects Shake 1.7.3
9662 *
9663 * Copyright (c) 2009 AUTHORS.txt (https://jqueryui.com/about)
9664 * Dual licensed under the MIT (MIT-LICENSE.txt)
9665 * and GPL (GPL-LICENSE.txt) licenses.
9666 *
9667 * https://docs.jquery.com/UI/Effects/Shake
9668 *
9669 * Depends:
9670 *	effects.core.js
9671 */
9672(function($) {
9673
9674$.effects.shake = function(o) {
9675
9676	return this.queue(function() {
9677
9678		// Create element
9679		var el = $(this), props = ['position','top','left'];
9680
9681		// Set options
9682		var mode = $.effects.setMode(el, o.options.mode || 'effect'); // Set Mode
9683		var direction = o.options.direction || 'left'; // Default direction
9684		var distance = o.options.distance || 20; // Default distance
9685		var times = o.options.times || 3; // Default # of times
9686		var speed = o.duration || o.options.duration || 140; // Default speed per shake
9687
9688		// Adjust
9689		$.effects.save(el, props); el.show(); // Save & Show
9690		$.effects.createWrapper(el); // Create Wrapper
9691		var ref = (direction == 'up' || direction == 'down') ? 'top' : 'left';
9692		var motion = (direction == 'up' || direction == 'left') ? 'pos' : 'neg';
9693
9694		// Animation
9695		var animation = {}, animation1 = {}, animation2 = {};
9696		animation[ref] = (motion == 'pos' ? '-=' : '+=')  + distance;
9697		animation1[ref] = (motion == 'pos' ? '+=' : '-=')  + distance * 2;
9698		animation2[ref] = (motion == 'pos' ? '-=' : '+=')  + distance * 2;
9699
9700		// Animate
9701		el.animate(animation, speed, o.options.easing);
9702		for (var i = 1; i < times; i++) { // Shakes
9703			el.animate(animation1, speed, o.options.easing).animate(animation2, speed, o.options.easing);
9704		};
9705		el.animate(animation1, speed, o.options.easing).
9706		animate(animation, speed / 2, o.options.easing, function(){ // Last shake
9707			$.effects.restore(el, props); $.effects.removeWrapper(el); // Restore
9708			if(o.callback) o.callback.apply(this, arguments); // Callback
9709		});
9710		el.queue('fx', function() { el.dequeue(); });
9711		el.dequeue();
9712	});
9713
9714};
9715
9716})(jQuery);
9717/*
9718 * jQuery UI Effects Slide 1.7.3
9719 *
9720 * Copyright (c) 2009 AUTHORS.txt (https://jqueryui.com/about)
9721 * Dual licensed under the MIT (MIT-LICENSE.txt)
9722 * and GPL (GPL-LICENSE.txt) licenses.
9723 *
9724 * https://docs.jquery.com/UI/Effects/Slide
9725 *
9726 * Depends:
9727 *	effects.core.js
9728 */
9729(function($) {
9730
9731$.effects.slide = function(o) {
9732
9733	return this.queue(function() {
9734
9735		// Create element
9736		var el = $(this), props = ['position','top','left'];
9737
9738		// Set options
9739		var mode = $.effects.setMode(el, o.options.mode || 'show'); // Set Mode
9740		var direction = o.options.direction || 'left'; // Default Direction
9741
9742		// Adjust
9743		$.effects.save(el, props); el.show(); // Save & Show
9744		$.effects.createWrapper(el).css({overflow:'hidden'}); // Create Wrapper
9745		var ref = (direction == 'up' || direction == 'down') ? 'top' : 'left';
9746		var motion = (direction == 'up' || direction == 'left') ? 'pos' : 'neg';
9747		var distance = o.options.distance || (ref == 'top' ? el.outerHeight({margin:true}) : el.outerWidth({margin:true}));
9748		if (mode == 'show') el.css(ref, motion == 'pos' ? -distance : distance); // Shift
9749
9750		// Animation
9751		var animation = {};
9752		animation[ref] = (mode == 'show' ? (motion == 'pos' ? '+=' : '-=') : (motion == 'pos' ? '-=' : '+=')) + distance;
9753
9754		// Animate
9755		el.animate(animation, { queue: false, duration: o.duration, easing: o.options.easing, complete: function() {
9756			if(mode == 'hide') el.hide(); // Hide
9757			$.effects.restore(el, props); $.effects.removeWrapper(el); // Restore
9758			if(o.callback) o.callback.apply(this, arguments); // Callback
9759			el.dequeue();
9760		}});
9761
9762	});
9763
9764};
9765
9766})(jQuery);
9767/*
9768 * jQuery UI Effects Transfer 1.7.3
9769 *
9770 * Copyright (c) 2009 AUTHORS.txt (https://jqueryui.com/about)
9771 * Dual licensed under the MIT (MIT-LICENSE.txt)
9772 * and GPL (GPL-LICENSE.txt) licenses.
9773 *
9774 * https://docs.jquery.com/UI/Effects/Transfer
9775 *
9776 * Depends:
9777 *	effects.core.js
9778 */
9779(function($) {
9780
9781$.effects.transfer = function(o) {
9782	return this.queue(function() {
9783		var elem = $(this),
9784			target = $(o.options.to),
9785			endPosition = target.offset(),
9786			animation = {
9787				top: endPosition.top,
9788				left: endPosition.left,
9789				height: target.innerHeight(),
9790				width: target.innerWidth()
9791			},
9792			startPosition = elem.offset(),
9793			transfer = $('<div class="ui-effects-transfer"></div>')
9794				.appendTo(document.body)
9795				.addClass(o.options.className)
9796				.css({
9797					top: startPosition.top,
9798					left: startPosition.left,
9799					height: elem.innerHeight(),
9800					width: elem.innerWidth(),
9801					position: 'absolute'
9802				})
9803				.animate(animation, o.duration, o.options.easing, function() {
9804					transfer.remove();
9805					(o.callback && o.callback.apply(elem[0], arguments));
9806					elem.dequeue();
9807				});
9808	});
9809};
9810
9811})(jQuery);
9812;
9813//This file tells the cpanel to remain open on different form submissions. A cookie is set with a different variable on each form. The cookie is also binned when the close (collapse cpanel) button is clicked.
9814
9815//cookie functions https://www.quirksmode.org/js/cookies.html
9816function createCookie(name,value,days) {
9817	if (days) {
9818		var date = new Date();
9819		date.setTime(date.getTime()+(days*24*60*60*1000));
9820		var expires = "; expires="+date.toGMTString();
9821	} else var expires = "";
9822	document.cookie = name+"="+value+expires+"; path=/";
9823}
9824function readCookie(name) {
9825	var nameEQ = name + "=";
9826	var ca = document.cookie.split(';');
9827	for(var i=0;i < ca.length;i++) {
9828		var c = ca[i];
9829		while (c.charAt(0)==' ') c = c.substring(1,c.length);
9830		if (c.indexOf(nameEQ) == 0) return c.substring(nameEQ.length,c.length);
9831	}
9832	return null;
9833}
9834function eraseCookie(name) {
9835	createCookie(name,"",-1);
9836}
9837//cookie functions
9838
9839$(function() {
9840	
9841	$('.high_contrast_off').click(function(){
9842		var $this = $(this);
9843		if ($this.is('.high_contrast_on')) {
9844			$("body").removeClass('contraston');
9845			$this.html("High Contrast");
9846			$this.removeClass('high_contrast_on');
9847			$this.addClass('high_contrast_off');
9848			eraseCookie('highcontrast');
9849		} else {
9850			$("body").addClass('contraston');
9851			$this.html("High Contrast");
9852			$this.removeClass('high_contrast_off');
9853			$this.addClass('high_contrast_on');
9854			createCookie('highcontrast', 'highcontraston', 365);
9855		}
9856		return false;
9857	});
9858	
9859	$(".high_contrast_on").click(function() {
9860		$("body").removeClass('contraston');
9861		$(".high_contrast_on").html("High Contrast");
9862		eraseCookie('highcontrast');
9863		$this.removeClass('high_contrast_on');
9864		$this.addClass('high_contrast_off');
9865		return false;
9866	});
9867
9868	$(document).ready(function(){
9869		
9870		var myCookie = readCookie('highcontrast');
9871		if (myCookie == 'highcontraston') {
9872			$("body").addClass('contraston');
9873			$(".high_contrast_off").html("Turn High Contrast Off");
9874			$('.high_contrast_off').addClass('high_contrast_on');
9875			$('.high_contrast_on').removeClass('high_contrast_off');
9876		}
9877		
9878	});
9879	
9880});
9881
9882
9883
9884$(function() {
9885	
9886	$('.textonly_off').click(function(){
9887		var $this = $(this);
9888		if ($this.is('.textonly_on')) {
9889			$("body").removeClass('textonlyon');
9890			$this.html("Turn Text Only On");
9891			$this.removeClass('textonly_on');
9892			$this.addClass('textonly_off');
9893			eraseCookie('textonly');
9894		} else {
9895			$("body").addClass('textonlyon');
9896			$this.html("Turn Text Only Off");
9897			$this.removeClass('textonly_off');
9898			$this.addClass('textonly_on');
9899			createCookie('textonly', 'textonlyon', 365);
9900		}
9901		return false;
9902	});
9903	
9904	$(".textonly_on").click(function() {
9905		$("body").removeClass('textonlyon');
9906		$(".textonly_on").html("Turn Text Only On");
9907		eraseCookie('textonly');
9908		$this.removeClass('textonly_on');
9909		$this.addClass('textonly_off');
9910		return false;
9911	});
9912
9913	$(document).ready(function(){
9914		
9915		var myCookie = readCookie('textonly');
9916		if (myCookie == 'textonlyon') {
9917			$("body").addClass('textonlyon');
9918			$(".textonly_off").html("Turn Text Only Off");
9919			$('.textonly_off').addClass('textonly_on');
9920			$('.textonly_on').removeClass('textonly_off');
9921		}
9922		
9923	});
9924	
9925});
9926
9927$(document).ready(function(){
9928
9929	var increaseclicks = 0;
9930	var decreaseclicks = 0;
9931	var fontUnit = 'px'; // Change this depending on wether the stylesheet sizes html text in pixels or ems.
9932	var interval = 1; // This will change too, based on the unit you're using. Remember that 1 em usually = whatever your base font size is.
9933	var bodyFontSize = '16';
9934	var originalFontSize = readCookie('fontsize');
9935	
9936	
9937	
9938	// THIS IS WHAT WAS MISSING.
9939	// If the cookie has no value, or doesn't exist. For some reason, the font-size was going massive ~1413px
9940	// Make a check for the font size, otherwise, take it from the stylesheet.
9941	if(originalFontSize == null) {
9942		originalFontSize = '16';
9943	}
9944	// If, for some reason it's massive still, bring it down to 20 (our max).
9945	if(originalFontSize > 20) {
9946		originalFontSize = '20';
9947	}
9948	
9949	var myVar = originalFontSize;
9950	
9951	$('html').css({'font-size': myVar+fontUnit});
9952	
9953	
9954	
9955	
9956
9957	// Reset Font-Size.
9958	$(".normalFont").click(function(){
9959	
9960		$('html').css('font-size', bodyFontSize+fontUnit);
9961	
9962		increaseclicks = 0;
9963	
9964		decreaseclicks = 0;
9965		
9966		eraseCookie('fontsize');
9967		
9968		createCookie('fontsize', '16', 365);
9969		
9970		return false;
9971	
9972	});
9973
9974	// Increase Font Size
9975	$(".increaseFont").click(function(){
9976		
9977		var currentFontSize = $('html').css('font-size');
9978		
9979		var currentFontSizeNum = parseFloat(currentFontSize, 10);
9980		
9981		// use styles for tags. {IE6 fix} (because tag font size do not change on IE6)
9982		var newFontSize = currentFontSizeNum + interval;
9983		
9984		if (increaseclicks < 5) {
9985			
9986			$('html').css({'font-size': newFontSize+fontUnit});
9987			
9988			increaseclicks++;
9989			
9990			decreaseclicks--;
9991		
9992		}
9993		
9994		eraseCookie('fontsize');
9995		
9996		newFontSize = newFontSize.toString();
9997		
9998		createCookie('fontsize', newFontSize, 365);
9999		
10000		return false;
10001	
10002	});
10003
10004// Decrease Font Size
10005	$(".decreaseFont").click(function(){
10006		
10007		var currentFontSize = $('html').css('font-size');
10008		
10009		var currentFontSizeNum = parseFloat(currentFontSize, 10);
10010		
10011		var newFontSize = currentFontSizeNum - interval;
10012		
10013		if (decreaseclicks <5) {
10014			
10015			$('html').css({'font-size': newFontSize+fontUnit});
10016			decreaseclicks++;
10017			increaseclicks--;
10018		}
10019		
10020		eraseCookie('fontsize');
10021		
10022		newFontSize = newFontSize.toString();
10023		
10024		createCookie('fontsize', newFontSize, 365);
10025		
10026		return false;
10027	
10028	});
10029
10030});;
10031/*!
10032 * jQuery Cycle Plugin (core logic only)
10033 * Examples and documentation at: https://jquery.malsup.com/cycle/
10034 * Copyright (c) 2007-2009 M. Alsup
10035 * Version: 2.65 (07-APR-2009)
10036 * Dual licensed under the MIT and GPL licenses:
10037 * https://www.opensource.org/licenses/mit-license.php
10038 * https://www.gnu.org/licenses/gpl.html
10039 * Requires: jQuery v1.2.6 or later
10040 *
10041 * Originally based on the work of:
10042 *	1) Matt Oakes
10043 *	2) Torsten Baldes (https://medienfreunde.com/lab/innerfade/)
10044 *	3) Benjamin Sterling (https://www.benjaminsterling.com/experiments/jqShuffle/)
10045 */
10046;(function($) {
10047
10048var ver = '2.65';
10049
10050// if $.support is not defined (pre jQuery 1.3) add what I need
10051if ($.support == undefined) {
10052	$.support = {
10053		opacity: !($.browser.msie)
10054	};
10055}
10056
10057function log() {
10058	if (window.console && window.console.log)
10059		window.console.log('[cycle] ' + Array.prototype.join.call(arguments,' '));
10060	//$('body').append('<div>'+Array.prototype.join.call(arguments,' ')+'</div>');
10061};
10062
10063// the options arg can be...
10064//   a number  - indicates an immediate transition should occur to the given slide index
10065//   a string  - 'stop', 'pause', 'resume', or the name of a transition effect (ie, 'fade', 'zoom', etc)
10066//   an object - properties to control the slideshow
10067//
10068// the arg2 arg can be...
10069//   the name of an fx (only used in conjunction with a numeric value for 'options')
10070//   the value true (only used in conjunction with a options == 'resume') and indicates
10071//     that the resume should occur immediately (not wait for next timeout)
10072
10073$.fn.cycle = function(options, arg2) {
10074	var o = { s: this.selector, c: this.context };
10075
10076    // in 1.3+ we can fix mistakes with the ready state
10077	if (this.length == 0 && options != 'stop') {
10078        if (!$.isReady && o.s) {
10079            log('DOM not ready, queuing slideshow')
10080            $(function() {
10081                $(o.s,o.c).cycle(options,arg2);
10082            });
10083            return this;
10084        }
10085		// is your DOM ready?  https://docs.jquery.com/Tutorials:Introducing_$(document).ready()
10086		log('terminating; zero elements found by selector' + ($.isReady ? '' : ' (DOM not ready)'));
10087		return this;
10088	}
10089
10090    // iterate the matched nodeset
10091	return this.each(function() {
10092        options = handleArguments(this, options, arg2);
10093        if (options === false)
10094            return;
10095
10096		// stop existing slideshow for this container (if there is one)
10097		if (this.cycleTimeout)
10098            clearTimeout(this.cycleTimeout);
10099		this.cycleTimeout = this.cyclePause = 0;
10100
10101		var $cont = $(this);
10102		var $slides = options.slideExpr ? $(options.slideExpr, this) : $cont.children();
10103		var els = $slides.get();
10104		if (els.length < 2) {
10105			log('terminating; too few slides: ' + els.length);
10106			return;
10107		}
10108
10109        var opts = buildOptions($cont, $slides, els, options, o);
10110        if (opts === false)
10111            return;
10112
10113        // if it's an auto slideshow, kick it off
10114		if (opts.timeout || opts.continuous)
10115			this.cycleTimeout = setTimeout(function(){go(els,opts,0,!opts.rev)},
10116				opts.continuous ? 10 : opts.timeout + (opts.delay||0));
10117	});
10118};
10119
10120// process the args that were passed to the plugin fn
10121function handleArguments(cont, options, arg2) {
10122	if (cont.cycleStop == undefined)
10123		cont.cycleStop = 0;
10124	if (options === undefined || options === null)
10125		options = {};
10126	if (options.constructor == String) {
10127		switch(options) {
10128		case 'stop':
10129			cont.cycleStop++; // callbacks look for change
10130			if (cont.cycleTimeout)
10131                clearTimeout(cont.cycleTimeout);
10132			cont.cycleTimeout = 0;
10133			$(cont).removeData('cycle.opts');
10134			return false;
10135		case 'pause':
10136			cont.cyclePause = 1;
10137			return false;
10138		case 'resume':
10139			cont.cyclePause = 0;
10140			if (arg2 === true) { // resume now!
10141				options = $(cont).data('cycle.opts');
10142				if (!options) {
10143					log('options not found, can not resume');
10144					return false;
10145				}
10146				if (cont.cycleTimeout) {
10147					clearTimeout(cont.cycleTimeout);
10148					cont.cycleTimeout = 0;
10149				}
10150				go(options.elements, options, 1, 1);
10151			}
10152			return false;
10153		default:
10154			options = { fx: options };
10155		};
10156	}
10157	else if (options.constructor == Number) {
10158		// go to the requested slide
10159		var num = options;
10160		options = $(cont).data('cycle.opts');
10161		if (!options) {
10162			log('options not found, can not advance slide');
10163			return false;
10164		}
10165		if (num < 0 || num >= options.elements.length) {
10166			log('invalid slide index: ' + num);
10167			return false;
10168		}
10169		options.nextSlide = num;
10170		if (cont.cycleTimeout) {
10171			clearTimeout(cont.cycleTimeout);
10172			cont.cycleTimeout = 0;
10173		}
10174        if (typeof arg2 == 'string')
10175            options.oneTimeFx = arg2;
10176		go(options.elements, options, 1, num >= options.currSlide);
10177		return false;
10178	}
10179    return options;
10180};
10181
10182function removeFilter(el, opts) {
10183	if (!$.support.opacity && opts.cleartype && el.style.filter) {
10184		try { el.style.removeAttribute('filter'); }
10185		catch(smother) {} // handle old opera versions
10186	}
10187};
10188
10189// one-time initialization
10190function buildOptions($cont, $slides, els, options, o) {
10191	// support metadata plugin (v1.0 and v2.0)
10192	var opts = $.extend({}, $.fn.cycle.defaults, options || {}, $.metadata ? $cont.metadata() : $.meta ? $cont.data() : {});
10193	if (opts.autostop)
10194		opts.countdown = opts.autostopCount || els.length;
10195
10196    var cont = $cont[0];
10197	$cont.data('cycle.opts', opts);
10198	opts.$cont = $cont;
10199	opts.stopCount = cont.cycleStop;
10200	opts.elements = els;
10201	opts.before = opts.before ? [opts.before] : [];
10202	opts.after = opts.after ? [opts.after] : [];
10203	opts.after.unshift(function(){ opts.busy=0; });
10204
10205    // push some after callbacks
10206	if (!$.support.opacity && opts.cleartype)
10207		opts.after.push(function() { removeFilter(this, opts); });
10208	if (opts.continuous)
10209		opts.after.push(function() { go(els,opts,0,!opts.rev); });
10210
10211    saveOriginalOpts(opts);
10212
10213	// clearType corrections
10214	if (!$.support.opacity && opts.cleartype && !opts.cleartypeNoBg)
10215		clearTypeFix($slides);
10216
10217    // container requires non-static position so that slides can be position within
10218	if ($cont.css('position') == 'static')
10219		$cont.css('position', 'relative');
10220	if (opts.width)
10221		$cont.width(opts.width);
10222	if (opts.height && opts.height != 'auto')
10223		$cont.height(opts.height);
10224
10225	if (opts.startingSlide)
10226        opts.startingSlide = parseInt(opts.startingSlide);
10227
10228    // if random, mix up the slide array
10229	if (opts.random) {
10230		opts.randomMap = [];
10231		for (var i = 0; i < els.length; i++)
10232			opts.randomMap.push(i);
10233		opts.randomMap.sort(function(a,b) {return Math.random() - 0.5;});
10234		opts.randomIndex = 0;
10235		opts.startingSlide = opts.randomMap[0];
10236	}
10237	else if (opts.startingSlide >= els.length)
10238		opts.startingSlide = 0; // catch bogus input
10239	opts.currSlide = opts.startingSlide = opts.startingSlide || 0;
10240	var first = opts.startingSlide;
10241
10242    // set position and zIndex on all the slides
10243	$slides.css({position: 'absolute', top:0, left:0}).hide().each(function(i) {
10244		var z = first ? i >= first ? els.length - (i-first) : first-i : els.length-i;
10245		$(this).css('z-index', z)
10246	});
10247
10248    // make sure first slide is visible
10249	$(els[first]).css('opacity',1).show(); // opacity bit needed to handle restart use case
10250	removeFilter(els[first], opts);
10251
10252    // stretch slides
10253	if (opts.fit && opts.width)
10254		$slides.width(opts.width);
10255	if (opts.fit && opts.height && opts.height != 'auto')
10256		$slides.height(opts.height);
10257
10258    // stretch container
10259	var reshape = opts.containerResize && !$cont.innerHeight();
10260	if (reshape) { // do this only if container has no size https://tinyurl.com/da2oa9
10261		var maxw = 0, maxh = 0;
10262		for(var i=0; i < els.length; i++) {
10263			var $e = $(els[i]), e = $e[0], w = $e.outerWidth(), h = $e.outerHeight();
10264            if (!w) w = e.offsetWidth;
10265            if (!h) h = e.offsetHeight;
10266			maxw = w > maxw ? w : maxw;
10267			maxh = h > maxh ? h : maxh;
10268		}
10269        if (maxw > 0 && maxh > 0)
10270		    $cont.css({width:maxw+'px',height:maxh+'px'});
10271	}
10272
10273	if (opts.pause)
10274		$cont.hover(function(){this.cyclePause++;},function(){this.cyclePause--;});
10275
10276    if (supportMultiTransitions(opts) === false)
10277		return false;
10278
10279	// run transition init fn
10280	if (!opts.multiFx) {
10281		var init = $.fn.cycle.transitions[opts.fx];
10282		if ($.isFunction(init))
10283			init($cont, $slides, opts);
10284		else if (opts.fx != 'custom' && !opts.multiFx) {
10285			log('unknown transition: ' + opts.fx,'; slideshow terminating');
10286			return false;
10287		}
10288	}
10289
10290	// apparently a lot of people use image slideshows without height/width attributes on the images.
10291	// Cycle 2.50+ requires the sizing info for every slide; this block tries to deal with that.
10292	var requeue = false;
10293	options.requeueAttempts = options.requeueAttempts || 0;
10294	$slides.each(function() {
10295        // try to get height/width of each slide
10296		var $el = $(this);
10297	    this.cycleH = (opts.fit && opts.height) ? opts.height : $el.height();
10298		this.cycleW = (opts.fit && opts.width) ? opts.width : $el.width();
10299
10300		if ( $el.is('img') ) {
10301			// sigh..  sniffing, hacking, shrugging...
10302			var loadingIE    = ($.browser.msie  && this.cycleW == 28 && this.cycleH == 30 && !this.complete);
10303			var loadingOp    = ($.browser.opera && this.cycleW == 42 && this.cycleH == 19 && !this.complete);
10304			var loadingOther = (this.cycleH == 0 && this.cycleW == 0 && !this.complete);
10305
10306			// don't requeue for images that are still loading but have a valid size
10307			if (loadingIE || loadingOp || loadingOther) {
10308				if (o.s && opts.requeueOnImageNotLoaded && ++options.requeueAttempts < 100) { // track retry count so we don't loop forever
10309					log(options.requeueAttempts,' - img slide not loaded, requeuing slideshow: ', this.src, this.cycleW, this.cycleH);
10310					setTimeout(function() {$(o.s,o.c).cycle(options)}, opts.requeueTimeout);
10311					requeue = true;
10312					return false; // break each loop
10313				}
10314				else {
10315					log('could not determine size of image: '+this.src, this.cycleW, this.cycleH);
10316				}
10317			}
10318		}
10319		return true;
10320	});
10321
10322	if (requeue)
10323		return false;
10324
10325	opts.cssBefore = opts.cssBefore || {};
10326	opts.animIn = opts.animIn || {};
10327	opts.animOut = opts.animOut || {};
10328
10329	$slides.not(':eq('+first+')').css(opts.cssBefore);
10330	if (opts.cssFirst)
10331		$($slides[first]).css(opts.cssFirst);
10332
10333	if (opts.timeout) {
10334		opts.timeout = parseInt(opts.timeout);
10335		// ensure that timeout and speed settings are sane
10336		if (opts.speed.constructor == String)
10337			opts.speed = $.fx.speeds[opts.speed] || parseInt(opts.speed);
10338		if (!opts.sync)
10339			opts.speed = opts.speed / 2;
10340		while((opts.timeout - opts.speed) < 250) // sanitize timeout
10341			opts.timeout += opts.speed;
10342	}
10343	if (opts.easing)
10344		opts.easeIn = opts.easeOut = opts.easing;
10345	if (!opts.speedIn)
10346		opts.speedIn = opts.speed;
10347	if (!opts.speedOut)
10348		opts.speedOut = opts.speed;
10349
10350	opts.slideCount = els.length;
10351	opts.currSlide = opts.lastSlide = first;
10352	if (opts.random) {
10353		opts.nextSlide = opts.currSlide;
10354		if (++opts.randomIndex == els.length)
10355			opts.randomIndex = 0;
10356		opts.nextSlide = opts.randomMap[opts.randomIndex];
10357	}
10358	else
10359		opts.nextSlide = opts.startingSlide >= (els.length-1) ? 0 : opts.startingSlide+1;
10360
10361	// fire artificial events
10362	var e0 = $slides[first];
10363	if (opts.before.length)
10364		opts.before[0].apply(e0, [e0, e0, opts, true]);
10365	if (opts.after.length > 1)
10366		opts.after[1].apply(e0, [e0, e0, opts, true]);
10367
10368	if (opts.next)
10369		$(opts.next).click(function(){return advance(opts,opts.rev?-1:1)});
10370	if (opts.prev)
10371		$(opts.prev).click(function(){return advance(opts,opts.rev?1:-1)});
10372	if (opts.pager)
10373		buildPager(els,opts);
10374
10375    exposeAddSlide(opts, els);
10376
10377    return opts;
10378};
10379
10380// save off original opts so we can restore after clearing state
10381function saveOriginalOpts(opts) {
10382    opts.original = { before: [], after: [] };
10383    opts.original.cssBefore = $.extend({}, opts.cssBefore);
10384    opts.original.cssAfter  = $.extend({}, opts.cssAfter);
10385    opts.original.animIn    = $.extend({}, opts.animIn);
10386    opts.original.animOut   = $.extend({}, opts.animOut);
10387	$.each(opts.before, function() { opts.original.before.push(this); });
10388	$.each(opts.after,  function() { opts.original.after.push(this); });
10389};
10390
10391function supportMultiTransitions(opts) {
10392    var txs = $.fn.cycle.transitions;
10393	// look for multiple effects
10394	if (opts.fx.indexOf(',') > 0) {
10395		opts.multiFx = true;
10396		opts.fxs = opts.fx.replace(/\s*/g,'').split(',');
10397		// discard any bogus effect names
10398		for (var i=0; i < opts.fxs.length; i++) {
10399			var fx = opts.fxs[i];
10400			var tx = txs[fx];
10401			if (!tx || !txs.hasOwnProperty(fx) || !$.isFunction(tx)) {
10402				log('discarding unknown transition: ',fx);
10403				opts.fxs.splice(i,1);
10404				i--;
10405			}
10406		}
10407		// if we have an empty list then we threw everything away!
10408		if (!opts.fxs.length) {
10409			log('No valid transitions named; slideshow terminating.');
10410			return false;
10411		}
10412	}
10413	else if (opts.fx == 'all') {  // auto-gen the list of transitions
10414		opts.multiFx = true;
10415		opts.fxs = [];
10416		for (p in txs) {
10417			var tx = txs[p];
10418			if (txs.hasOwnProperty(p) && $.isFunction(tx))
10419				opts.fxs.push(p);
10420		}
10421	}
10422	if (opts.multiFx && opts.randomizeEffects) {
10423		// munge the fxs array to make effect selection random
10424		var r1 = Math.floor(Math.random() * 20) + 30;
10425		for (var i = 0; i < r1; i++) {
10426			var r2 = Math.floor(Math.random() * opts.fxs.length);
10427			opts.fxs.push(opts.fxs.splice(r2,1)[0]);
10428		}
10429		log('randomized fx sequence: ',opts.fxs);
10430	}
10431	return true;
10432};
10433
10434// provide a mechanism for adding slides after the slideshow has started
10435function exposeAddSlide(opts, els) {
10436	opts.addSlide = function(newSlide, prepend) {
10437		var $s = $(newSlide), s = $s[0];
10438		if (!opts.autostopCount)
10439			opts.countdown++;
10440		els[prepend?'unshift':'push'](s);
10441		if (opts.els)
10442			opts.els[prepend?'unshift':'push'](s); // shuffle needs this
10443		opts.slideCount = els.length;
10444
10445		$s.css('position','absolute');
10446		$s[prepend?'prependTo':'appendTo'](opts.$cont);
10447
10448		if (prepend) {
10449			opts.currSlide++;
10450			opts.nextSlide++;
10451		}
10452
10453		if (!$.support.opacity && opts.cleartype && !opts.cleartypeNoBg)
10454			clearTypeFix($s);
10455
10456		if (opts.fit && opts.width)
10457			$s.width(opts.width);
10458		if (opts.fit && opts.height && opts.height != 'auto')
10459			$slides.height(opts.height);
10460		s.cycleH = (opts.fit && opts.height) ? opts.height : $s.height();
10461		s.cycleW = (opts.fit && opts.width) ? opts.width : $s.width();
10462
10463		$s.css(opts.cssBefore);
10464
10465		if (opts.pager)
10466			$.fn.cycle.createPagerAnchor(els.length-1, s, $(opts.pager), els, opts);
10467
10468		if ($.isFunction(opts.onAddSlide))
10469			opts.onAddSlide($s);
10470		else
10471			$s.hide(); // default behavior
10472	};
10473}
10474
10475// reset internal state; we do this on every pass in order to support multiple effects
10476$.fn.cycle.resetState = function(opts, fx) {
10477    fx = fx || opts.fx;
10478	opts.before = []; opts.after = [];
10479	opts.cssBefore = $.extend({}, opts.original.cssBefore);
10480	opts.cssAfter  = $.extend({}, opts.original.cssAfter);
10481	opts.animIn    = $.extend({}, opts.original.animIn);
10482	opts.animOut   = $.extend({}, opts.original.animOut);
10483	opts.fxFn = null;
10484	$.each(opts.original.before, function() { opts.before.push(this); });
10485	$.each(opts.original.after,  function() { opts.after.push(this); });
10486
10487	// re-init
10488	var init = $.fn.cycle.transitions[fx];
10489	if ($.isFunction(init))
10490		init(opts.$cont, $(opts.elements), opts);
10491};
10492
10493// this is the main engine fn, it handles the timeouts, callbacks and slide index mgmt
10494function go(els, opts, manual, fwd) {
10495    // opts.busy is true if we're in the middle of an animation
10496	if (manual && opts.busy && opts.manualTrump) {
10497        // let manual transitions requests trump active ones
10498		$(els).stop(true,true);
10499		opts.busy = false;
10500	}
10501    // don't begin another timeout-based transition if there is one active
10502	if (opts.busy)
10503        return;
10504
10505	var p = opts.$cont[0], curr = els[opts.currSlide], next = els[opts.nextSlide];
10506
10507    // stop cycling if we have an outstanding stop request
10508	if (p.cycleStop != opts.stopCount || p.cycleTimeout === 0 && !manual)
10509		return;
10510
10511    // check to see if we should stop cycling based on autostop options
10512	if (!manual && !p.cyclePause &&
10513		((opts.autostop && (--opts.countdown <= 0)) ||
10514		(opts.nowrap && !opts.random && opts.nextSlide < opts.currSlide))) {
10515		if (opts.end)
10516			opts.end(opts);
10517		return;
10518	}
10519
10520    // if slideshow is paused, only transition on a manual trigger
10521	if (manual || !p.cyclePause) {
10522        var fx = opts.fx;
10523		// keep trying to get the slide size if we don't have it yet
10524		curr.cycleH = curr.cycleH || $(curr).height();
10525		curr.cycleW = curr.cycleW || $(curr).width();
10526		next.cycleH = next.cycleH || $(next).height();
10527		next.cycleW = next.cycleW || $(next).width();
10528
10529		// support multiple transition types
10530		if (opts.multiFx) {
10531			if (opts.lastFx == undefined || ++opts.lastFx >= opts.fxs.length)
10532				opts.lastFx = 0;
10533			fx = opts.fxs[opts.lastFx];
10534			opts.currFx = fx;
10535		}
10536
10537        // one-time fx overrides apply to:  $('div').cycle(3,'zoom');
10538        if (opts.oneTimeFx) {
10539            fx = opts.oneTimeFx;
10540            opts.oneTimeFx = null;
10541        }
10542
10543        $.fn.cycle.resetState(opts, fx);
10544
10545        // run the before callbacks
10546		if (opts.before.length)
10547			$.each(opts.before, function(i,o) {
10548				if (p.cycleStop != opts.stopCount) return;
10549				o.apply(next, [curr, next, opts, fwd]);
10550			});
10551
10552        // stage the after callacks
10553		var after = function() {
10554			$.each(opts.after, function(i,o) {
10555				if (p.cycleStop != opts.stopCount) return;
10556				o.apply(next, [curr, next, opts, fwd]);
10557			});
10558		};
10559
10560		if (opts.nextSlide != opts.currSlide) {
10561            // get ready to perform the transition
10562			opts.busy = 1;
10563			if (opts.fxFn) // fx function provided?
10564				opts.fxFn(curr, next, opts, after, fwd);
10565			else if ($.isFunction($.fn.cycle[opts.fx])) // fx plugin ?
10566				$.fn.cycle[opts.fx](curr, next, opts, after);
10567			else
10568				$.fn.cycle.custom(curr, next, opts, after, manual && opts.fastOnEvent);
10569		}
10570
10571        // calculate the next slide
10572		opts.lastSlide = opts.currSlide;
10573		if (opts.random) {
10574			opts.currSlide = opts.nextSlide;
10575			if (++opts.randomIndex == els.length)
10576				opts.randomIndex = 0;
10577			opts.nextSlide = opts.randomMap[opts.randomIndex];
10578		}
10579		else { // sequence
10580			var roll = (opts.nextSlide + 1) == els.length;
10581			opts.nextSlide = roll ? 0 : opts.nextSlide+1;
10582			opts.currSlide = roll ? els.length-1 : opts.nextSlide-1;
10583		}
10584
10585		if (opts.pager)
10586			$.fn.cycle.updateActivePagerLink(opts.pager, opts.currSlide);
10587	}
10588
10589    // stage the next transtion
10590    var ms = 0;
10591	if (opts.timeout && !opts.continuous)
10592        ms = getTimeout(curr, next, opts, fwd);
10593    else if (opts.continuous && p.cyclePause) // continuous shows work off an after callback, not this timer logic
10594        ms = 10;
10595    if (ms > 0)
10596        p.cycleTimeout = setTimeout(function(){ go(els, opts, 0, !opts.rev) }, ms);
10597};
10598
10599// invoked after transition
10600$.fn.cycle.updateActivePagerLink = function(pager, currSlide) {
10601	$(pager).find('a').removeClass('activeSlide').filter('a:eq('+currSlide+')').addClass('activeSlide');
10602};
10603
10604// calculate timeout value for current transition
10605function getTimeout(curr, next, opts, fwd) {
10606	if (opts.timeoutFn) {
10607        // call user provided calc fn
10608		var t = opts.timeoutFn(curr,next,opts,fwd);
10609		if (t !== false)
10610			return t;
10611	}
10612	return opts.timeout;
10613};
10614
10615// expose next/prev function, caller must pass in state
10616$.fn.cycle.next = function(opts) { advance(opts, opts.rev?-1:1); };
10617$.fn.cycle.prev = function(opts) { advance(opts, opts.rev?1:-1);};
10618
10619// advance slide forward or back
10620function advance(opts, val) {
10621    var els = opts.elements;
10622	var p = opts.$cont[0], timeout = p.cycleTimeout;
10623	if (timeout) {
10624		clearTimeout(timeout);
10625		p.cycleTimeout = 0;
10626	}
10627	if (opts.random && val < 0) {
10628		// move back to the previously display slide
10629		opts.randomIndex--;
10630		if (--opts.randomIndex == -2)
10631			opts.randomIndex = els.length-2;
10632		else if (opts.randomIndex == -1)
10633			opts.randomIndex = els.length-1;
10634		opts.nextSlide = opts.randomMap[opts.randomIndex];
10635	}
10636	else if (opts.random) {
10637		if (++opts.randomIndex == els.length)
10638			opts.randomIndex = 0;
10639		opts.nextSlide = opts.randomMap[opts.randomIndex];
10640	}
10641	else {
10642		opts.nextSlide = opts.currSlide + val;
10643		if (opts.nextSlide < 0) {
10644			if (opts.nowrap) return false;
10645			opts.nextSlide = els.length - 1;
10646		}
10647		else if (opts.nextSlide >= els.length) {
10648			if (opts.nowrap) return false;
10649			opts.nextSlide = 0;
10650		}
10651	}
10652
10653	if ($.isFunction(opts.prevNextClick))
10654		opts.prevNextClick(val > 0, opts.nextSlide, els[opts.nextSlide]);
10655	go(els, opts, 1, val>=0);
10656	return false;
10657};
10658
10659function buildPager(els, opts) {
10660	var $p = $(opts.pager);
10661	$.each(els, function(i,o) {
10662		$.fn.cycle.createPagerAnchor(i,o,$p,els,opts);
10663	});
10664   $.fn.cycle.updateActivePagerLink(opts.pager, opts.startingSlide);
10665};
10666
10667$.fn.cycle.createPagerAnchor = function(i, el, $p, els, opts) {
10668	var a = ($.isFunction(opts.pagerAnchorBuilder))
10669		? opts.pagerAnchorBuilder(i,el)
10670		: '<a href="#">'+(i+1)+'</a>';
10671	if (!a)
10672		return;
10673	var $a = $(a);
10674	// don't reparent if anchor is in the dom
10675	if ($a.parents('body').length == 0) {
10676		var arr = [];
10677		if ($p.length > 1) {
10678			$p.each(function() {
10679				var $clone = $a.clone(true);
10680				$(this).append($clone);
10681				arr.push($clone);
10682			});
10683			$a = $(arr);
10684		}
10685		else {
10686			$a.appendTo($p);
10687		}
10688	}
10689
10690	$a.bind(opts.pagerEvent, function() {
10691		opts.nextSlide = i;
10692		var p = opts.$cont[0], timeout = p.cycleTimeout;
10693		if (timeout) {
10694			clearTimeout(timeout);
10695			p.cycleTimeout = 0;
10696		}
10697		if ($.isFunction(opts.pagerClick))
10698			opts.pagerClick(opts.nextSlide, els[opts.nextSlide]);
10699		go(els,opts,1,opts.currSlide < i); // trigger the trans
10700		return false;
10701	});
10702	if (opts.pauseOnPagerHover)
10703		$a.hover(function() { opts.$cont[0].cyclePause++; }, function() { opts.$cont[0].cyclePause--; } );
10704};
10705
10706// helper fn to calculate the number of slides between the current and the next
10707$.fn.cycle.hopsFromLast = function(opts, fwd) {
10708	var hops, l = opts.lastSlide, c = opts.currSlide;
10709	if (fwd)
10710		hops = c > l ? c - l : opts.slideCount - l;
10711	else
10712		hops = c < l ? l - c : l + opts.slideCount - c;
10713	return hops;
10714};
10715
10716// fix clearType problems in ie6 by setting an explicit bg color
10717// (otherwise text slides look horrible during a fade transition)
10718function clearTypeFix($slides) {
10719	function hex(s) {
10720		s = parseInt(s).toString(16);
10721		return s.length < 2 ? '0'+s : s;
10722	};
10723	function getBg(e) {
10724		for ( ; e && e.nodeName.toLowerCase() != 'html'; e = e.parentNode) {
10725			var v = $.css(e,'background-color');
10726			if (v.indexOf('rgb') >= 0 ) {
10727				var rgb = v.match(/\d+/g);
10728				return '#'+ hex(rgb[0]) + hex(rgb[1]) + hex(rgb[2]);
10729			}
10730			if (v && v != 'transparent')
10731				return v;
10732		}
10733		return '#ffffff';
10734	};
10735	$slides.each(function() { $(this).css('background-color', getBg(this)); });
10736};
10737
10738// reset common props before the next transition
10739$.fn.cycle.commonReset = function(curr,next,opts,w,h,rev) {
10740	$(opts.elements).not(curr).hide();
10741	opts.cssBefore.opacity = 1;
10742	opts.cssBefore.display = 'block';
10743	if (w !== false && next.cycleW > 0)
10744		opts.cssBefore.width = next.cycleW;
10745	if (h !== false && next.cycleH > 0)
10746		opts.cssBefore.height = next.cycleH;
10747	opts.cssAfter = opts.cssAfter || {};
10748	opts.cssAfter.display = 'none';
10749	$(curr).css('zIndex',opts.slideCount + (rev === true ? 1 : 0));
10750	$(next).css('zIndex',opts.slideCount + (rev === true ? 0 : 1));
10751};
10752
10753// the actual fn for effecting a transition
10754$.fn.cycle.custom = function(curr, next, opts, cb, speedOverride) {
10755	var $l = $(curr), $n = $(next);
10756	var speedIn = opts.speedIn, speedOut = opts.speedOut, easeIn = opts.easeIn, easeOut = opts.easeOut;
10757	$n.css(opts.cssBefore);
10758	if (speedOverride) {
10759		if (typeof speedOverride == 'number')
10760			speedIn = speedOut = speedOverride;
10761		else
10762			speedIn = speedOut = 1;
10763		easeIn = easeOut = null;
10764	}
10765	var fn = function() {$n.animate(opts.animIn, speedIn, easeIn, cb)};
10766	$l.animate(opts.animOut, speedOut, easeOut, function() {
10767		if (opts.cssAfter) $l.css(opts.cssAfter);
10768		if (!opts.sync) fn();
10769	});
10770	if (opts.sync) fn();
10771};
10772
10773// transition definitions - only fade is defined here, transition pack defines the rest
10774$.fn.cycle.transitions = {
10775	fade: function($cont, $slides, opts) {
10776		$slides.not(':eq('+opts.currSlide+')').css('opacity',0);
10777		opts.before.push(function(curr,next,opts) {
10778			$.fn.cycle.commonReset(curr,next,opts);
10779			opts.cssBefore.opacity = 0;
10780		});
10781		opts.animIn	   = { opacity: 1 };
10782		opts.animOut   = { opacity: 0 };
10783		opts.cssBefore = { top: 0, left: 0 };
10784	}
10785};
10786
10787$.fn.cycle.ver = function() { return ver; };
10788
10789// override these globally if you like (they are all optional)
10790$.fn.cycle.defaults = {
10791	fx:			  'fade', // name of transition effect (or comma separated names, ex: fade,scrollUp,shuffle)
10792	timeout:	   4000,  // milliseconds between slide transitions (0 to disable auto advance)
10793	timeoutFn:     null,  // callback for determining per-slide timeout value:  function(currSlideElement, nextSlideElement, options, forwardFlag)
10794	continuous:	   0,	  // true to start next transition immediately after current one completes
10795	speed:		   1000,  // speed of the transition (any valid fx speed value)
10796	speedIn:	   null,  // speed of the 'in' transition
10797	speedOut:	   null,  // speed of the 'out' transition
10798	next:		   null,  // selector for element to use as click trigger for next slide
10799	prev:		   null,  // selector for element to use as click trigger for previous slide
10800	prevNextClick: null,  // callback fn for prev/next clicks:	function(isNext, zeroBasedSlideIndex, slideElement)
10801	pager:		   null,  // selector for element to use as pager container
10802	pagerClick:	   null,  // callback fn for pager clicks:	function(zeroBasedSlideIndex, slideElement)
10803	pagerEvent:	  'click', // name of event which drives the pager navigation
10804	pagerAnchorBuilder: null, // callback fn for building anchor links:  function(index, DOMelement)
10805	before:		   null,  // transition callback (scope set to element to be shown):     function(currSlideElement, nextSlideElement, options, forwardFlag)
10806	after:		   null,  // transition callback (scope set to element that was shown):  function(currSlideElement, nextSlideElement, options, forwardFlag)
10807	end:		   null,  // callback invoked when the slideshow terminates (use with autostop or nowrap options): function(options)
10808	easing:		   null,  // easing method for both in and out transitions
10809	easeIn:		   null,  // easing for "in" transition
10810	easeOut:	   null,  // easing for "out" transition
10811	shuffle:	   null,  // coords for shuffle animation, ex: { top:15, left: 200 }
10812	animIn:		   null,  // properties that define how the slide animates in
10813	animOut:	   null,  // properties that define how the slide animates out
10814	cssBefore:	   null,  // properties that define the initial state of the slide before transitioning in
10815	cssAfter:	   null,  // properties that defined the state of the slide after transitioning out
10816	fxFn:		   null,  // function used to control the transition: function(currSlideElement, nextSlideElement, options, afterCalback, forwardFlag)
10817	height:		  'auto', // container height
10818	startingSlide: 0,	  // zero-based index of the first slide to be displayed
10819	sync:		   1,	  // true if in/out transitions should occur simultaneously
10820	random:		   0,	  // true for random, false for sequence (not applicable to shuffle fx)
10821	fit:		   0,	  // force slides to fit container
10822	containerResize: 1,	  // resize container to fit largest slide
10823	pause:		   0,	  // true to enable "pause on hover"
10824	pauseOnPagerHover: 0, // true to pause when hovering over pager link
10825	autostop:	   0,	  // true to end slideshow after X transitions (where X == slide count)
10826	autostopCount: 0,	  // number of transitions (optionally used with autostop to define X)
10827	delay:		   0,	  // additional delay (in ms) for first transition (hint: can be negative)
10828	slideExpr:	   null,  // expression for selecting slides (if something other than all children is required)
10829	cleartype:	   !$.support.opacity,  // true if clearType corrections should be applied (for IE)
10830	nowrap:		   0,	  // true to prevent slideshow from wrapping
10831	fastOnEvent:   0,	  // force fast transitions when triggered manually (via pager or prev/next); value == time in ms
10832	randomizeEffects: 1,  // valid when multiple effects are used; true to make the effect sequence random
10833	rev:           0,     // causes animations to transition in reverse
10834	manualTrump:   true,  // causes manual transition to stop an active transition instead of being ignored
10835	requeueOnImageNotLoaded: true, // requeue the slideshow if any image slides are not yet loaded
10836	requeueTimeout: 250   // ms delay for requeue
10837};
10838
10839})(jQuery);
10840;
10841$(document).ready(function(){
10842
10843 /*homepage slideshow*/
10844 $('#slideshow .view-content').cycle({
10845  timeout: 7000, 
10846  speed: 2000, 
10847  height: '290px',
10848  pager: '#paginate'
10849 });
10850 
10851 /*submit the jump menu*/
10852 $(".block-jump select").change(function(){
10853  this.form.submit();
10854 });
10855
10856 $(".block-jump .form-submit").hide();
10857 
10858 
10859 /*search field text*/
10860 if ($(".block-search .form-text").val() == '') {
10861  $(".block-search .form-text").val("Keyword search");
10862 }
10863 
10864 $(".block-search .form-text").click(function(){
10865   $(this).val('');
10866 });
10867 
10868 $(".block-search .form-text").blur(function(){
10869  if ($(".block-search .form-text").val() == '') {
10870   $(this).val("Keyword search");
10871  }
10872 });
10873 
10874});;
10875/**
10876 * jQuery.ScrollTo
10877 * Copyright (c) 2007-2009 Ariel Flesler - aflesler(at)gmail(dot)com | https://flesler.blogspot.com
10878 * Dual licensed under MIT and GPL.
10879 * Date: 3/9/2009
10880 *
10881 * @projectDescription Easy element scrolling using jQuery.
10882 * https://flesler.blogspot.com/2007/10/jqueryscrollto.html
10883 * Works with jQuery +1.2.6. Tested on FF 2/3, IE 6/7, Opera 9.5/6, Safari 3, Chrome 1 on WinXP.
10884 *
10885 * @author Ariel Flesler
10886 * @version 1.4.1
10887 *
10888 * @id jQuery.scrollTo
10889 * @id jQuery.fn.scrollTo
10890 * @param {String, Number, DOMElement, jQuery, Object} target Where to scroll the matched elements.
10891 *	  The different options for target are:
10892 *		- A number position (will be applied to all axes).
10893 *		- A string position ('44', '100px', '+=90', etc ) will be applied to all axes
10894 *		- A jQuery/DOM element ( logically, child of the element to scroll )
10895 *		- A string selector, that will be relative to the element to scroll ( 'li:eq(2)', etc )
10896 *		- A hash { top:x, left:y }, x and y can be any kind of number/string like above.
10897 * @param {Number} duration The OVERALL length of the animation, this argument can be the settings object instead.
10898 * @param {Object,Function} settings Optional set of settings or the onAfter callback.
10899 *	 @option {String} axis Which axis must be scrolled, use 'x', 'y', 'xy' or 'yx'.
10900 *	 @option {Number} duration The OVERALL length of the animation.
10901 *	 @option {String} easing The easing method for the animation.
10902 *	 @option {Boolean} margin If true, the margin of the target element will be deducted from the final position.
10903 *	 @option {Object, Number} offset Add/deduct from the end position. One number for both axes or { top:x, left:y }.
10904 *	 @option {Object, Number}
10904 over Add/deduct the height/width multiplied by 'over', can be { top:x, left:y } when using both axes.
10905 *	 @option {Boolean} queue If true, and both axis are given, the 2nd axis will only be animated after the first one ends.
10906 *	 @option {Function} onAfter Function to be called after the scrolling ends. 
10907 *	 @option {Function} onAfterFirst If queuing is activated, this function will be called after the first scrolling ends.
10908 * @return {jQuery} Returns the same jQuery object, for chaining.
10909 *
10910 * @desc Scroll to a fixed position
10911 * @example $('div').scrollTo( 340 );
10912 *
10913 * @desc Scroll relatively to the actual position
10914 * @example $('div').scrollTo( '+=340px', { axis:'y' } );
10915 *
10916 * @dec Scroll using a selector (relative to the scrolled element)
10917 * @example $('div').scrollTo( 'p.paragraph:eq(2)', 500, { easing:'swing', queue:true, axis:'xy' } );
10918 *
10919 * @ Scroll to a DOM element (same for jQuery object)
10920 * @example var second_child = document.getElementById('container').firstChild.nextSibling;
10921 *			$('#container').scrollTo( second_child, { duration:500, axis:'x', onAfter:function(){
10922 *				alert('scrolled!!');																   
10923 *			}});
10924 *
10925 * @desc Scroll on both axes, to different values
10926 * @example $('div').scrollTo( { top: 300, left:'+=200' }, { axis:'xy', offset:-20 } );
10927 */
10928;(function( $ ){
10929	
10930	var $scrollTo = $.scrollTo = function( target, duration, settings ){
10931		$(window).scrollTo( target, duration, settings );
10932	};
10933
10934	$scrollTo.defaults = {
10935		axis:'xy',
10936		duration: parseFloat($.fn.jquery) >= 1.3 ? 0 : 1
10937	};
10938
10939	// Returns the element that needs to be animated to scroll the window.
10940	// Kept for backwards compatibility (specially for localScroll & serialScroll)
10941	$scrollTo.window = function( scope ){
10942		return $(window).scrollable();
10943	};
10944
10945	// Hack, hack, hack... stay away!
10946	// Returns the real elements to scroll (supports window/iframes, documents and regular nodes)
10947	$.fn.scrollable = function(){
10948		return this.map(function(){
10949			var elem = this,
10950				isWin = !elem.nodeName || $.inArray( elem.nodeName.toLowerCase(), ['iframe','#document','html','body'] ) != -1;
10951
10952				if( !isWin )
10953					return elem;
10954
10955			var doc = (elem.contentWindow || elem).document || elem.ownerDocument || elem;
10956			
10957			return $.browser.safari || doc.compatMode == 'BackCompat' ?
10958				doc.body : 
10959				doc.documentElement;
10960		});
10961	};
10962
10963	$.fn.scrollTo = function( target, duration, settings ){
10964		if( typeof duration == 'object' ){
10965			settings = duration;
10966			duration = 0;
10967		}
10968		if( typeof settings == 'function' )
10969			settings = { onAfter:settings };
10970			
10971		if( target == 'max' )
10972			target = 9e9;
10973			
10974		settings = $.extend( {}, $scrollTo.defaults, settings );
10975		// Speed is still recognized for backwards compatibility
10976		duration = duration || settings.speed || settings.duration;
10977		// Make sure the settings are given right
10978		settings.queue = settings.queue && settings.axis.length > 1;
10979		
10980		if( settings.queue )
10981			// Let's keep the overall duration
10982			duration /= 2;
10983		settings.offset = both( settings.offset );
10984		settings.over = both( settings.over );
10985
10986		return this.scrollable().each(function(){
10987			var elem = this,
10988				$elem = $(elem),
10989				targ = target, toff, attr = {},
10990				win = $elem.is('html,body');
10991
10992			switch( typeof targ ){
10993				// A number will pass the regex
10994				case 'number':
10995				case 'string':
10996					if( /^([+-]=)?\d+(\.\d+)?(px)?$/.test(targ) ){
10997						targ = both( targ );
10998						// We are done
10999						break;
11000					}
11001					// Relative selector, no break!
11002					targ = $(targ,this);
11003				case 'object':
11004					// DOMElement / jQuery
11005					if( targ.is || targ.style )
11006						// Get the real position of the target 
11007						toff = (targ = $(targ)).offset();
11008			}
11009			$.each( settings.axis.split(''), function( i, axis ){
11010				var Pos	= axis == 'x' ? 'Left' : 'Top',
11011					pos = Pos.toLowerCase(),
11012					key = 'scroll' + Pos,
11013					old = elem[key],
11014					Dim = axis == 'x' ? 'Width' : 'Height';
11015
11016				if( toff ){// jQuery / DOMElement
11017					attr[key] = toff[pos] + ( win ? 0 : old - $elem.offset()[pos] );
11018
11019					// If it's a dom element, reduce the margin
11020					if( settings.margin ){
11021						attr[key] -= parseInt(targ.css('margin'+Pos)) || 0;
11022						attr[key] -= parseInt(targ.css('border'+Pos+'Width')) || 0;
11023					}
11024					
11025					attr[key] += settings.offset[pos] || 0;
11026					
11027					if( settings.over[pos] )
11028						// Scroll to a fraction of its width/height
11029						attr[key] += targ[Dim.toLowerCase()]() * settings.over[pos];
11030				}else
11031					attr[key] = targ[pos];
11032
11033				// Number or 'number'
11034				if( /^\d+$/.test(attr[key]) )
11035					// Check the limits
11036					attr[key] = attr[key] <= 0 ? 0 : Math.min( attr[key], max(Dim) );
11037
11038				// Queueing axes
11039				if( !i && settings.queue ){
11040					// Don't waste time animating, if there's no need.
11041					if( old != attr[key] )
11042						// Intermediate animation
11043						animate( settings.onAfterFirst );
11044					// Don't animate this axis again in the next iteration.
11045					delete attr[key];
11046				}
11047			});
11048
11049			animate( settings.onAfter );			
11050
11051			function animate( callback ){
11052				$elem.animate( attr, duration, settings.easing, callback && function(){
11053					callback.call(this, target, settings);
11054				});
11055			};
11056
11057			// Max scrolling position, works on quirks mode
11058			// It only fails (not too badly) on IE, quirks mode.
11059			function max( Dim ){
11060				var scroll = 'scroll'+Dim;
11061				
11062				if( !win )
11063					return elem[scroll];
11064				
11065				var size = 'client' + Dim,
11066					html = elem.ownerDocument.documentElement,
11067					body = elem.ownerDocument.body;
11068
11069				return Math.max( html[scroll], body[scroll] ) 
11070					 - Math.min( html[size]  , body[size]   );
11071					
11072			};
11073
11074		}).end();
11075	};
11076
11077	function both( val ){
11078		return typeof val == 'object' ? val : { top:val, left:val };
11079	};
11080
11081})( jQuery );;
11082/**
11083 * ScrollView - jQuery plugin 0.1
11084 *
11085 * This plugin supplies contents view by grab and drag scroll.
11086 *
11087 * Copyright (c) 2009 Toshimitsu Takahashi
11088 *
11089 * Released under the MIT license.
11090 *
11091 * == Usage =======================
11092 *   // apply to block element.
11093 *   $("#map").scrollview();
11094 *   
11095 *   // with setting grab and drag icon urls.
11096 *   //   grab: the cursor when mouse button is up.
11097 *   //   grabbing: the cursor when mouse button is down.
11098 *   //
11099 *   $("#map".scrollview({
11100 *     grab : "images/openhand.cur",
11101 *     grabbing : "images/closedhand.cur"
11102 *   });
11103 * ================================
11104 */
11105(function() {
11106    function ScrollView(){ this.initialize.apply(this, arguments) }
11107    ScrollView.prototype = {
11108        initialize: function(container, config){
11109                // setting cursor.
11110                var gecko = navigator.userAgent.indexOf("Gecko/") != -1;
11111                var opera = navigator.userAgent.indexOf("Opera/") != -1;
11112                var mac = navigator.userAgent.indexOf("Mac OS") != -1;
11113                if (opera) {
11114                    this.grab = "default";
11115                    this.grabbing = "move";
11116                } else if (!(mac && gecko) && config) {
11117                    if (config.grab) {
11118                       this.grab = "url(\"" + config.grab + "\"),default";
11119                    }
11120                    if (config.grabbing) {
11121                       this.grabbing = "url(" + config.grabbing + "),move";
11122                    }
11123                } else if (gecko) {
11124                    this.grab = "-moz-grab";
11125                    this.grabbing = "-moz-grabbing";
11126                } else {
11127                    this.grab = "default";
11128                    this.grabbing = "move";
11129                }
11130                
11131                // Get container and image.
11132                this.m = $(container);
11133                this.i = this.m.children().css("cursor", this.grab);
11134                
11135                this.isgrabbing = false;
11136                
11137                // Set mouse events.
11138                var self = this;
11139                this.i.mousedown(function(e){
11140                        self.startgrab();
11141                        this.xp = e.pageX;
11142                        this.yp = e.pageY;
11143                        return false;
11144                }).mousemove(function(e){
11145                        if (!self.isgrabbing) return true;
11146                        self.scrollTo(this.xp - e.pageX, this.yp - e.pageY);
11147                        this.xp = e.pageX;
11148                        this.yp = e.pageY;
11149                        return false;
11150                })
11151                .mouseout(function(){ self.stopgrab() })
11152                .mouseup(function(){ self.stopgrab() })
11153                .dblclick(function(){
11154                        var _m = self.m;
11155                        var off = _m.offset();
11156                        var dx = this.xp - off.left - _m.width() / 2;
11157                        if (dx < 0) {
11158                                dx = "+=" + dx + "px";
11159                        } else {
11160                                dx = "-=" + -dx + "px";
11161                        }
11162                        var dy = this.yp - off.top - _m.height() / 2;
11163                        if (dy < 0) {
11164                                dy = "+=" + dy + "px";
11165                        } else {
11166                                dy = "-=" + -dy + "px";
11167                        }
11168                        _m.animate({ scrollLeft:  dx, scrollTop: dy },
11169                                "normal", "swing");
11170                });
11171                
11172                this.centering();
11173        },
11174        centering: function(){
11175                var _m = this.m;
11176                var w = this.i.width() - _m.width();
11177                var h = this.i.height() - _m.height();
11178                _m.scrollLeft(w / 2).scrollTop(h / 2);
11179        },
11180        startgrab: function(){
11181                this.isgrabbing = true;
11182                this.i.css("cursor", this.grabbing);
11183        },
11184        stopgrab: function(){
11185                this.isgrabbing = false;
11186                this.i.css("cursor", this.grab);
11187        },
11188        scrollTo: function(dx, dy){
11189                var _m = this.m;
11190                var x = _m.scrollLeft() + dx;
11191                var y = _m.scrollTop() + dy;
11192                _m.scrollLeft(x).scrollTop(y);
11193        }
11194    };
11195    
11196    jQuery.fn.scrollview = function(config){
11197        return this.each(function(){
11198            new ScrollView(this, config);
11199        });
11200    };
11201})(jQuery);
11202;
11203$(function () {
11204			$(document).ready(function(){
11205	$("#mainsection.forum.numeric #forum thead th:first-child, #mainsection.forum.numeric #forum tbody tr td:first-child").addClass('first');
11206	$("#mainsection.forum.numeric #forum thead th:nth-child(2)").addClass('second');
11207});
11208			
11209	if ($.browser.msie && $.browser.version < 7) return;
11210	
11211	$('#test')
11212		.removeClass('highlight')
11213		.find('a')
11214		.append('<span class="hover" />').each(function () {
11215				var $span = $('> span.hover', this).css('opacity', 0);
11216				$(this).hover(function () {
11217					// on hover
11218					$span.stop().fadeTo(450, 1);
11219				}, function () {
11220					// off hover
11221					$span.stop().fadeTo(450, 0);
11222				});
11223		});
11224
11225});;

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.