!function(c,d){"object"==typeof module&&"object"==typeof module.exports?module.exports=c.document?d(c,!0):function(b){if(!b.document){throw new Error("jQuery requires a window with a document")}return d(b)}:d(c)}("undefined"!=typeof window?window:this,function(a,b){var c=[],d=a.document,e=c.slice,f=c.concat,g=c.push,h=c.indexOf,i={},j=i.toString,k=i.hasOwnProperty,l={},m="1.12.4",n=function(a,b){return new n.fn.init(a,b)},o=/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,p=/^-ms-/,q=/-([\da-z])/gi,r=function(a,b){return b.toUpperCase()};n.fn=n.prototype={jquery:m,constructor:n,selector:"",length:0,toArray:function(){return e.call(this)},get:function(a){return null!=a?0>a?this[a+this.length]:this[a]:e.call(this)},pushStack:function(a){var b=n.merge(this.constructor(),a);return b.prevObject=this,b.context=this.context,b},each:function(a){return n.each(this,a)},map:function(a){return this.pushStack(n.map(this,function(b,c){return a.call(b,c,b)}))},slice:function(){return this.pushStack(e.apply(this,arguments))},first:function(){return this.eq(0)},last:function(){return this.eq(-1)},eq:function(a){var b=this.length,c=+a+(0>a?b:0);return this.pushStack(c>=0&&b>c?[this[c]]:[])},end:function(){return this.prevObject||this.constructor()},push:g,sort:c.sort,splice:c.splice},n.extend=n.fn.extend=function(){var a,b,c,d,e,f,g=arguments[0]||{},h=1,i=arguments.length,j=!1;for("boolean"==typeof g&&(j=g,g=arguments[h]||{},h++),"object"==typeof g||n.isFunction(g)||(g={}),h===i&&(g=this,h--);i>h;h++){if(null!=(e=arguments[h])){for(d in e){a=g[d],c=e[d],g!==c&&(j&&c&&(n.isPlainObject(c)||(b=n.isArray(c)))?(b?(b=!1,f=a&&n.isArray(a)?a:[]):f=a&&n.isPlainObject(a)?a:{},g[d]=n.extend(j,f,c)):void 0!==c&&(g[d]=c))}}}return g},n.extend({expando:"jQuery"+(m+Math.random()).replace(/\D/g,""),isReady:!0,error:function(a){throw new Error(a)},noop:function(){},isFunction:function(a){return"function"===n.type(a)},isArray:Array.isArray||function(a){return"array"===n.type(a)},isWindow:function(a){return null!=a&&a==a.window},isNumeric:function(a){var b=a&&a.toString();return !n.isArray(a)&&b-parseFloat(b)+1>=0},isEmptyObject:function(a){var b;for(b in a){return !1}return !0},isPlainObject:function(a){var b;if(!a||"object"!==n.type(a)||a.nodeType||n.isWindow(a)){return !1}try{if(a.constructor&&!k.call(a,"constructor")&&!k.call(a.constructor.prototype,"isPrototypeOf")){return !1}}catch(c){return !1}if(!l.ownFirst){for(b in a){return k.call(a,b)}}for(b in a){}return void 0===b||k.call(a,b)},type:function(a){return null==a?a+"":"object"==typeof a||"function"==typeof a?i[j.call(a)]||"object":typeof a},globalEval:function(b){b&&n.trim(b)&&(a.execScript||function(b){a.eval.call(a,b)})(b)},camelCase:function(a){return a.replace(p,"ms-").replace(q,r)},nodeName:function(a,b){return a.nodeName&&a.nodeName.toLowerCase()===b.toLowerCase()},each:function(a,b){var c,d=0;if(s(a)){for(c=a.length;c>d;d++){if(b.call(a[d],d,a[d])===!1){break}}}else{for(d in a){if(b.call(a[d],d,a[d])===!1){break}}}return a},trim:function(a){return null==a?"":(a+"").replace(o,"")},makeArray:function(a,b){var c=b||[];return null!=a&&(s(Object(a))?n.merge(c,"string"==typeof a?[a]:a):g.call(c,a)),c},inArray:function(a,b,c){var d;if(b){if(h){return h.call(b,a,c)}for(d=b.length,c=c?0>c?Math.max(0,d+c):c:0;d>c;c++){if(c in b&&b[c]===a){return c}}}return -1},merge:function(a,b){var c=+b.length,d=0,e=a.length;while(c>d){a[e++]=b[d++]}if(c!==c){while(void 0!==b[d]){a[e++]=b[d++]}}return a.length=e,a},grep:function(a,b,c){for(var d,e=[],f=0,g=a.length,h=!c;g>f;f++){d=!b(a[f],f),d!==h&&e.push(a[f])}return e},map:function(a,b,c){var d,e,g=0,h=[];if(s(a)){for(d=a.length;d>g;g++){e=b(a[g],g,c),null!=e&&h.push(e)}}else{for(g in a){e=b(a[g],g,c),null!=e&&h.push(e)}}return f.apply([],h)},guid:1,proxy:function(a,b){var c,d,f;return"string"==typeof b&&(f=a[b],b=a,a=f),n.isFunction(a)?(c=e.call(arguments,2),d=function(){return a.apply(b||this,c.concat(e.call(arguments)))},d.guid=a.guid=a.guid||n.guid++,d):void 0},now:function(){return +new Date},support:l}),"function"==typeof Symbol&&(n.fn[Symbol.iterator]=c[Symbol.iterator]),n.each("Boolean Number String Function Array Date RegExp Object Error Symbol".split(" "),function(a,b){i["[object "+b+"]"]=b.toLowerCase()});function s(a){var b=!!a&&"length" in a&&a.length,c=n.type(a);return"function"===c||n.isWindow(a)?!1:"array"===c||0===b||"number"==typeof b&&b>0&&b-1 in a}var t=function(a){var b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u="sizzle"+1*new Date,v=a.document,w=0,x=0,y=ga(),z=ga(),A=ga(),B=function(a,b){return a===b&&(l=!0),0},C=1<<31,D={}.hasOwnProperty,E=[],F=E.pop,G=E.push,H=E.push,I=E.slice,J=function(a,b){for(var c=0,d=a.length;d>c;c++){if(a[c]===b){return c}}return -1},K="checked|selected|async|autofocus|autoplay|controls|defer|disabled|hidden|ismap|loop|multiple|open|readonly|required|scoped",L="[\\x20\\t\\r\\n\\f]",M="(?:\\\\.|[\\w-]|[^\\x00-\\xa0])+",N="\\["+L+"*("+M+")(?:"+L+"*([*^$|!~]?=)"+L+"*(?:'((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\"|("+M+"))|)"+L+"*\\]",O=":("+M+")(?:\\((('((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\")|((?:\\\\.|[^\\\\()[\\]]|"+N+")*)|.*)\\)|)",P=new RegExp(L+"+","g"),Q=new RegExp("^"+L+"+|((?:^|[^\\\\])(?:\\\\.)*)"+L+"+$","g"),R=new RegExp("^"+L+"*,"+L+"*"),S=new RegExp("^"+L+"*([>+~]|"+L+")"+L+"*"),T=new RegExp("="+L+"*([^\\]'\"]*?)"+L+"*\\]","g"),U=new RegExp(O),V=new RegExp("^"+M+"$"),W={ID:new RegExp("^#("+M+")"),CLASS:new RegExp("^\\.("+M+")"),TAG:new RegExp("^("+M+"|[*])"),ATTR:new RegExp("^"+N),PSEUDO:new RegExp("^"+O),CHILD:new RegExp("^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\("+L+"*(even|odd|(([+-]|)(\\d*)n|)"+L+"*(?:([+-]|)"+L+"*(\\d+)|))"+L+"*\\)|)","i"),bool:new RegExp("^(?:"+K+")$","i"),needsContext:new RegExp("^"+L+"*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\("+L+"*((?:-\\d)?\\d*)"+L+"*\\)|)(?=[^-]|$)","i")},X=/^(?:input|select|textarea|button)$/i,Y=/^h\d$/i,Z=/^[^{]+\{\s*\[native \w/,$=/^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/,_=/[+~]/,aa=/'|\\/g,ba=new RegExp("\\\\([\\da-f]{1,6}"+L+"?|("+L+")|.)","ig"),ca=function(a,b,c){var d="0x"+b-65536;return d!==d||c?b:0>d?String.fromCharCode(d+65536):String.fromCharCode(d>>10|55296,1023&d|56320)},da=function(){m()};try{H.apply(E=I.call(v.childNodes),v.childNodes),E[v.childNodes.length].nodeType}catch(ea){H={apply:E.length?function(a,b){G.apply(a,I.call(b))}:function(a,b){var c=a.length,d=0;while(a[c++]=b[d++]){}a.length=c-1}}}function fa(a,b,d,e){var f,h,j,k,l,o,r,s,w=b&&b.ownerDocument,x=b?b.nodeType:9;if(d=d||[],"string"!=typeof a||!a||1!==x&&9!==x&&11!==x){return d}if(!e&&((b?b.ownerDocument||b:v)!==n&&m(b),b=b||n,p)){if(11!==x&&(o=$.exec(a))){if(f=o[1]){if(9===x){if(!(j=b.getElementById(f))){return d}if(j.id===f){return d.push(j),d}}else{if(w&&(j=w.getElementById(f))&&t(b,j)&&j.id===f){return d.push(j),d}}}else{if(o[2]){return H.apply(d,b.getElementsByTagName(a)),d}if((f=o[3])&&c.getElementsByClassName&&b.getElementsByClassName){return H.apply(d,b.getElementsByClassName(f)),d}}}if(c.qsa&&!A[a+" "]&&(!q||!q.test(a))){if(1!==x){w=b,s=a}else{if("object"!==b.nodeName.toLowerCase()){(k=b.getAttribute("id"))?k=k.replace(aa,"\\$&"):b.setAttribute("id",k=u),r=g(a),h=r.length,l=V.test(k)?"#"+k:"[id='"+k+"']";while(h--){r[h]=l+" "+qa(r[h])}s=r.join(","),w=_.test(a)&&oa(b.parentNode)||b}}if(s){try{return H.apply(d,w.querySelectorAll(s)),d}catch(y){}finally{k===u&&b.removeAttribute("id")}}}}return i(a.replace(Q,"$1"),b,d,e)}function ga(){var a=[];function b(c,e){return a.push(c+" ")>d.cacheLength&&delete b[a.shift()],b[c+" "]=e}return b}function ha(a){return a[u]=!0,a}function ia(a){var b=n.createElement("div");try{return !!a(b)}catch(c){return !1}finally{b.parentNode&&b.parentNode.removeChild(b),b=null}}function ja(a,b){var c=a.split("|"),e=c.length;while(e--){d.attrHandle[c[e]]=b}}function ka(a,b){var c=b&&a,d=c&&1===a.nodeType&&1===b.nodeType&&(~b.sourceIndex||C)-(~a.sourceIndex||C);if(d){return d}if(c){while(c=c.nextSibling){if(c===b){return -1}}}return a?1:-1}function la(a){return function(b){var c=b.nodeName.toLowerCase();return"input"===c&&b.type===a}}function ma(a){return function(b){var c=b.nodeName.toLowerCase();return("input"===c||"button"===c)&&b.type===a}}function na(a){return ha(function(b){return b=+b,ha(function(c,d){var e,f=a([],c.length,b),g=f.length;while(g--){c[e=f[g]]&&(c[e]=!(d[e]=c[e]))}})})}function oa(a){return a&&"undefined"!=typeof a.getElementsByTagName&&a}c=fa.support={},f=fa.isXML=function(a){var b=a&&(a.ownerDocument||a).documentElement;return b?"HTML"!==b.nodeName:!1},m=fa.setDocument=function(a){var b,e,g=a?a.ownerDocument||a:v;return g!==n&&9===g.nodeType&&g.documentElement?(n=g,o=n.documentElement,p=!f(n),(e=n.defaultView)&&e.top!==e&&(e.addEventListener?e.addEventListener("unload",da,!1):e.attachEvent&&e.attachEvent("onunload",da)),c.attributes=ia(function(a){return a.className="i",!a.getAttribute("className")}),c.getElementsByTagName=ia(function(a){return a.appendChild(n.createComment("")),!a.getElementsByTagName("*").length}),c.getElementsByClassName=Z.test(n.getElementsByClassName),c.getById=ia(function(a){return o.appendChild(a).id=u,!n.getElementsByName||!n.getElementsByName(u).length}),c.getById?(d.find.ID=function(a,b){if("undefined"!=typeof b.getElementById&&p){var c=b.getElementById(a);return c?[c]:[]}},d.filter.ID=function(a){var b=a.replace(ba,ca);return function(a){return a.getAttribute("id")===b}}):(delete d.find.ID,d.filter.ID=function(a){var b=a.replace(ba,ca);return function(a){var c="undefined"!=typeof a.getAttributeNode&&a.getAttributeNode("id");return c&&c.value===b}}),d.find.TAG=c.getElementsByTagName?function(a,b){return"undefined"!=typeof b.getElementsByTagName?b.getElementsByTagName(a):c.qsa?b.querySelectorAll(a):void 0}:function(a,b){var c,d=[],e=0,f=b.getElementsByTagName(a);if("*"===a){while(c=f[e++]){1===c.nodeType&&d.push(c)}return d}return f},d.find.CLASS=c.getElementsByClassName&&function(a,b){return"undefined"!=typeof b.getElementsByClassName&&p?b.getElementsByClassName(a):void 0},r=[],q=[],(c.qsa=Z.test(n.querySelectorAll))&&(ia(function(a){o.appendChild(a).innerHTML="<a id='"+u+"'></a><select id='"+u+"-\r\\' msallowcapture=''><option selected=''></option></select>",a.querySelectorAll("[msallowcapture^='']").length&&q.push("[*^$]="+L+"*(?:''|\"\")"),a.querySelectorAll("[selected]").length||q.push("\\["+L+"*(?:value|"+K+")"),a.querySelectorAll("[id~="+u+"-]").length||q.push("~="),a.querySelectorAll(":checked").length||q.push(":checked"),a.querySelectorAll("a#"+u+"+*").length||q.push(".#.+[+~]")}),ia(function(a){var b=n.createElement("input");b.setAttribute("type","hidden"),a.appendChild(b).setAttribute("name","D"),a.querySelectorAll("[name=d]").length&&q.push("name"+L+"*[*^$|!~]?="),a.querySelectorAll(":enabled").length||q.push(":enabled",":disabled"),a.querySelectorAll("*,:x"),q.push(",.*:")})),(c.matchesSelector=Z.test(s=o.matches||o.webkitMatchesSelector||o.mozMatchesSelector||o.oMatchesSelector||o.msMatchesSelector))&&ia(function(a){c.disconnectedMatch=s.call(a,"div"),s.call(a,"[s!='']:x"),r.push("!=",O)}),q=q.length&&new RegExp(q.join("|")),r=r.length&&new RegExp(r.join("|")),b=Z.test(o.compareDocumentPosition),t=b||Z.test(o.contains)?function(a,b){var c=9===a.nodeType?a.documentElement:a,d=b&&b.parentNode;return a===d||!(!d||1!==d.nodeType||!(c.contains?c.contains(d):a.compareDocumentPosition&&16&a.compareDocumentPosition(d)))}:function(a,b){if(b){while(b=b.parentNode){if(b===a){return !0}}}return !1},B=b?function(a,b){if(a===b){return l=!0,0}var d=!a.compareDocumentPosition-!b.compareDocumentPosition;return d?d:(d=(a.ownerDocument||a)===(b.ownerDocument||b)?a.compareDocumentPosition(b):1,1&d||!c.sortDetached&&b.compareDocumentPosition(a)===d?a===n||a.ownerDocument===v&&t(v,a)?-1:b===n||b.ownerDocument===v&&t(v,b)?1:k?J(k,a)-J(k,b):0:4&d?-1:1)}:function(a,b){if(a===b){return l=!0,0}var c,d=0,e=a.parentNode,f=b.parentNode,g=[a],h=[b];if(!e||!f){return a===n?-1:b===n?1:e?-1:f?1:k?J(k,a)-J(k,b):0}if(e===f){return ka(a,b)}c=a;while(c=c.parentNode){g.unshift(c)}c=b;while(c=c.parentNode){h.unshift(c)}while(g[d]===h[d]){d++}return d?ka(g[d],h[d]):g[d]===v?-1:h[d]===v?1:0},n):n},fa.matches=function(a,b){return fa(a,null,null,b)},fa.matchesSelector=function(a,b){if((a.ownerDocument||a)!==n&&m(a),b=b.replace(T,"='$1']"),c.matchesSelector&&p&&!A[b+" "]&&(!r||!r.test(b))&&(!q||!q.test(b))){try{var d=s.call(a,b);if(d||c.disconnectedMatch||a.document&&11!==a.document.nodeType){return d}}catch(e){}}return fa(b,n,null,[a]).length>0},fa.contains=function(a,b){return(a.ownerDocument||a)!==n&&m(a),t(a,b)},fa.attr=function(a,b){(a.ownerDocument||a)!==n&&m(a);var e=d.attrHandle[b.toLowerCase()],f=e&&D.call(d.attrHandle,b.toLowerCase())?e(a,b,!p):void 0;return void 0!==f?f:c.attributes||!p?a.getAttribute(b):(f=a.getAttributeNode(b))&&f.specified?f.value:null},fa.error=function(a){throw new Error("Syntax error, unrecognized expression: "+a)},fa.uniqueSort=function(a){var b,d=[],e=0,f=0;if(l=!c.detectDuplicates,k=!c.sortStable&&a.slice(0),a.sort(B),l){while(b=a[f++]){b===a[f]&&(e=d.push(f))}while(e--){a.splice(d[e],1)}}return k=null,a},e=fa.getText=function(a){var b,c="",d=0,f=a.nodeType;if(f){if(1===f||9===f||11===f){if("string"==typeof a.textContent){return a.textContent}for(a=a.firstChild;a;a=a.nextSibling){c+=e(a)}}else{if(3===f||4===f){return a.nodeValue}}}else{while(b=a[d++]){c+=e(b)}}return c},d=fa.selectors={cacheLength:50,createPseudo:ha,match:W,attrHandle:{},find:{},relative:{">":{dir:"parentNode",first:!0}," ":{dir:"parentNode"},"+":{dir:"previousSibling",first:!0},"~":{dir:"previousSibling"}},preFilter:{ATTR:function(a){return a[1]=a[1].replace(ba,ca),a[3]=(a[3]||a[4]||a[5]||"").replace(ba,ca),"~="===a[2]&&(a[3]=" "+a[3]+" "),a.slice(0,4)},CHILD:function(a){return a[1]=a[1].toLowerCase(),"nth"===a[1].slice(0,3)?(a[3]||fa.error(a[0]),a[4]=+(a[4]?a[5]+(a[6]||1):2*("even"===a[3]||"odd"===a[3])),a[5]=+(a[7]+a[8]||"odd"===a[3])):a[3]&&fa.error(a[0]),a},PSEUDO:function(a){var b,c=!a[6]&&a[2];return W.CHILD.test(a[0])?null:(a[3]?a[2]=a[4]||a[5]||"":c&&U.test(c)&&(b=g(c,!0))&&(b=c.indexOf(")",c.length-b)-c.length)&&(a[0]=a[0].slice(0,b),a[2]=c.slice(0,b)),a.slice(0,3))}},filter:{TAG:function(a){var b=a.replace(ba,ca).toLowerCase();return"*"===a?function(){return !0}:function(a){return a.nodeName&&a.nodeName.toLowerCase()===b}},CLASS:function(a){var b=y[a+" "];return b||(b=new RegExp("(^|"+L+")"+a+"("+L+"|$)"))&&y(a,function(a){return b.test("string"==typeof a.className&&a.className||"undefined"!=typeof a.getAttribute&&a.getAttribute("class")||"")})},ATTR:function(a,b,c){return function(d){var e=fa.attr(d,a);return null==e?"!="===b:b?(e+="","="===b?e===c:"!="===b?e!==c:"^="===b?c&&0===e.indexOf(c):"*="===b?c&&e.indexOf(c)>-1:"$="===b?c&&e.slice(-c.length)===c:"~="===b?(" "+e.replace(P," ")+" ").indexOf(c)>-1:"|="===b?e===c||e.slice(0,c.length+1)===c+"-":!1):!0}},CHILD:function(a,b,c,d,e){var f="nth"!==a.slice(0,3),g="last"!==a.slice(-4),h="of-type"===b;return 1===d&&0===e?function(a){return !!a.parentNode}:function(b,c,i){var j,k,l,m,n,o,p=f!==g?"nextSibling":"previousSibling",q=b.parentNode,r=h&&b.nodeName.toLowerCase(),s=!i&&!h,t=!1;if(q){if(f){while(p){m=b;while(m=m[p]){if(h?m.nodeName.toLowerCase()===r:1===m.nodeType){return !1}}o=p="only"===a&&!o&&"nextSibling"}return !0}if(o=[g?q.firstChild:q.lastChild],g&&s){m=q,l=m[u]||(m[u]={}),k=l[m.uniqueID]||(l[m.uniqueID]={}),j=k[a]||[],n=j[0]===w&&j[1],t=n&&j[2],m=n&&q.childNodes[n];while(m=++n&&m&&m[p]||(t=n=0)||o.pop()){if(1===m.nodeType&&++t&&m===b){k[a]=[w,n,t];break}}}else{if(s&&(m=b,l=m[u]||(m[u]={}),k=l[m.uniqueID]||(l[m.uniqueID]={}),j=k[a]||[],n=j[0]===w&&j[1],t=n),t===!1){while(m=++n&&m&&m[p]||(t=n=0)||o.pop()){if((h?m.nodeName.toLowerCase()===r:1===m.nodeType)&&++t&&(s&&(l=m[u]||(m[u]={}),k=l[m.uniqueID]||(l[m.uniqueID]={}),k[a]=[w,t]),m===b)){break}}}}return t-=e,t===d||t%d===0&&t/d>=0}}},PSEUDO:function(a,b){var c,e=d.pseudos[a]||d.setFilters[a.toLowerCase()]||fa.error("unsupported pseudo: "+a);return e[u]?e(b):e.length>1?(c=[a,a,"",b],d.setFilters.hasOwnProperty(a.toLowerCase())?ha(function(a,c){var d,f=e(a,b),g=f.length;while(g--){d=J(a,f[g]),a[d]=!(c[d]=f[g])}}):function(a){return e(a,0,c)}):e}},pseudos:{not:ha(function(a){var b=[],c=[],d=h(a.replace(Q,"$1"));return d[u]?ha(function(a,b,c,e){var f,g=d(a,null,e,[]),h=a.length;while(h--){(f=g[h])&&(a[h]=!(b[h]=f))}}):function(a,e,f){return b[0]=a,d(b,null,f,c),b[0]=null,!c.pop()}}),has:ha(function(a){return function(b){return fa(a,b).length>0}}),contains:ha(function(a){return a=a.replace(ba,ca),function(b){return(b.textContent||b.innerText||e(b)).indexOf(a)>-1}}),lang:ha(function(a){return V.test(a||"")||fa.error("unsupported lang: "+a),a=a.replace(ba,ca).toLowerCase(),function(b){var c;do{if(c=p?b.lang:b.getAttribute("xml:lang")||b.getAttribute("lang")){return c=c.toLowerCase(),c===a||0===c.indexOf(a+"-")}}while((b=b.parentNode)&&1===b.nodeType);return !1}}),target:function(b){var c=a.location&&a.location.hash;return c&&c.slice(1)===b.id},root:function(a){return a===o},focus:function(a){return a===n.activeElement&&(!n.hasFocus||n.hasFocus())&&!!(a.type||a.href||~a.tabIndex)},enabled:function(a){return a.disabled===!1},disabled:function(a){return a.disabled===!0},checked:function(a){var b=a.nodeName.toLowerCase();return"input"===b&&!!a.checked||"option"===b&&!!a.selected},selected:function(a){return a.parentNode&&a.parentNode.selectedIndex,a.selected===!0},empty:function(a){for(a=a.firstChild;a;a=a.nextSibling){if(a.nodeType<6){return !1}}return !0},parent:function(a){return !d.pseudos.empty(a)},header:function(a){return Y.test(a.nodeName)},input:function(a){return X.test(a.nodeName)},button:function(a){var b=a.nodeName.toLowerCase();return"input"===b&&"button"===a.type||"button"===b},text:function(a){var b;return"input"===a.nodeName.toLowerCase()&&"text"===a.type&&(null==(b=a.getAttribute("type"))||"text"===b.toLowerCase())},first:na(function(){return[0]}),last:na(function(a,b){return[b-1]}),eq:na(function(a,b,c){return[0>c?c+b:c]}),even:na(function(a,b){for(var c=0;b>c;c+=2){a.push(c)}return a}),odd:na(function(a,b){for(var c=1;b>c;c+=2){a.push(c)}return a}),lt:na(function(a,b,c){for(var d=0>c?c+b:c;--d>=0;){a.push(d)}return a}),gt:na(function(a,b,c){for(var d=0>c?c+b:c;++d<b;){a.push(d)}return a})}},d.pseudos.nth=d.pseudos.eq;for(b in {radio:!0,checkbox:!0,file:!0,password:!0,image:!0}){d.pseudos[b]=la(b)}for(b in {submit:!0,reset:!0}){d.pseudos[b]=ma(b)}function pa(){}pa.prototype=d.filters=d.pseudos,d.setFilters=new pa,g=fa.tokenize=function(a,b){var c,e,f,g,h,i,j,k=z[a+" "];if(k){return b?0:k.slice(0)}h=a,i=[],j=d.preFilter;while(h){c&&!(e=R.exec(h))||(e&&(h=h.slice(e[0].length)||h),i.push(f=[])),c=!1,(e=S.exec(h))&&(c=e.shift(),f.push({value:c,type:e[0].replace(Q," ")}),h=h.slice(c.length));for(g in d.filter){!(e=W[g].exec(h))||j[g]&&!(e=j[g](e))||(c=e.shift(),f.push({value:c,type:g,matches:e}),h=h.slice(c.length))}if(!c){break}}return b?h.length:h?fa.error(a):z(a,i).slice(0)};function qa(a){for(var b=0,c=a.length,d="";c>b;b++){d+=a[b].value}return d}function ra(a,b,c){var d=b.dir,e=c&&"parentNode"===d,f=x++;return b.first?function(b,c,f){while(b=b[d]){if(1===b.nodeType||e){return a(b,c,f)}}}:function(b,c,g){var h,i,j,k=[w,f];if(g){while(b=b[d]){if((1===b.nodeType||e)&&a(b,c,g)){return !0}}}else{while(b=b[d]){if(1===b.nodeType||e){if(j=b[u]||(b[u]={}),i=j[b.uniqueID]||(j[b.uniqueID]={}),(h=i[d])&&h[0]===w&&h[1]===f){return k[2]=h[2]}if(i[d]=k,k[2]=a(b,c,g)){return !0}}}}}}function sa(a){return a.length>1?function(b,c,d){var e=a.length;while(e--){if(!a[e](b,c,d)){return !1}}return !0}:a[0]}function ta(a,b,c){for(var d=0,e=b.length;e>d;d++){fa(a,b[d],c)}return c}function ua(a,b,c,d,e){for(var f,g=[],h=0,i=a.length,j=null!=b;i>h;h++){(f=a[h])&&(c&&!c(f,d,e)||(g.push(f),j&&b.push(h)))}return g}function va(a,b,c,d,e,f){return d&&!d[u]&&(d=va(d)),e&&!e[u]&&(e=va(e,f)),ha(function(f,g,h,i){var j,k,l,m=[],n=[],o=g.length,p=f||ta(b||"*",h.nodeType?[h]:h,[]),q=!a||!f&&b?p:ua(p,m,a,h,i),r=c?e||(f?a:o||d)?[]:g:q;if(c&&c(q,r,h,i),d){j=ua(r,n),d(j,[],h,i),k=j.length;while(k--){(l=j[k])&&(r[n[k]]=!(q[n[k]]=l))}}if(f){if(e||a){if(e){j=[],k=r.length;while(k--){(l=r[k])&&j.push(q[k]=l)}e(null,r=[],j,i)}k=r.length;while(k--){(l=r[k])&&(j=e?J(f,l):m[k])>-1&&(f[j]=!(g[j]=l))}}}else{r=ua(r===g?r.splice(o,r.length):r),e?e(null,g,r,i):H.apply(g,r)}})}function wa(a){for(var b,c,e,f=a.length,g=d.relative[a[0].type],h=g||d.relative[" "],i=g?1:0,k=ra(function(a){return a===b},h,!0),l=ra(function(a){return J(b,a)>-1},h,!0),m=[function(a,c,d){var e=!g&&(d||c!==j)||((b=c).nodeType?k(a,c,d):l(a,c,d));return b=null,e}];f>i;i++){if(c=d.relative[a[i].type]){m=[ra(sa(m),c)]}else{if(c=d.filter[a[i].type].apply(null,a[i].matches),c[u]){for(e=++i;f>e;e++){if(d.relative[a[e].type]){break}}return va(i>1&&sa(m),i>1&&qa(a.slice(0,i-1).concat({value:" "===a[i-2].type?"*":""})).replace(Q,"$1"),c,e>i&&wa(a.slice(i,e)),f>e&&wa(a=a.slice(e)),f>e&&qa(a))}m.push(c)}}return sa(m)}function xa(a,b){var c=b.length>0,e=a.length>0,f=function(f,g,h,i,k){var l,o,q,r=0,s="0",t=f&&[],u=[],v=j,x=f||e&&d.find.TAG("*",k),y=w+=null==v?1:Math.random()||0.1,z=x.length;for(k&&(j=g===n||g||k);s!==z&&null!=(l=x[s]);s++){if(e&&l){o=0,g||l.ownerDocument===n||(m(l),h=!p);while(q=a[o++]){if(q(l,g||n,h)){i.push(l);break}}k&&(w=y)}c&&((l=!q&&l)&&r--,f&&t.push(l))}if(r+=s,c&&s!==r){o=0;while(q=b[o++]){q(t,u,g,h)}if(f){if(r>0){while(s--){t[s]||u[s]||(u[s]=F.call(i))}}u=ua(u)}H.apply(i,u),k&&!f&&u.length>0&&r+b.length>1&&fa.uniqueSort(i)}return k&&(w=y,j=v),t};return c?ha(f):f}return h=fa.compile=function(a,b){var c,d=[],e=[],f=A[a+" "];if(!f){b||(b=g(a)),c=b.length;while(c--){f=wa(b[c]),f[u]?d.push(f):e.push(f)}f=A(a,xa(e,d)),f.selector=a}return f},i=fa.select=function(a,b,e,f){var i,j,k,l,m,n="function"==typeof a&&a,o=!f&&g(a=n.selector||a);if(e=e||[],1===o.length){if(j=o[0]=o[0].slice(0),j.length>2&&"ID"===(k=j[0]).type&&c.getById&&9===b.nodeType&&p&&d.relative[j[1].type]){if(b=(d.find.ID(k.matches[0].replace(ba,ca),b)||[])[0],!b){return e}n&&(b=b.parentNode),a=a.slice(j.shift().value.length)}i=W.needsContext.test(a)?0:j.length;while(i--){if(k=j[i],d.relative[l=k.type]){break}if((m=d.find[l])&&(f=m(k.matches[0].replace(ba,ca),_.test(j[0].type)&&oa(b.parentNode)||b))){if(j.splice(i,1),a=f.length&&qa(j),!a){return H.apply(e,f),e}break}}}return(n||h(a,o))(f,b,!p,e,!b||_.test(a)&&oa(b.parentNode)||b),e},c.sortStable=u.split("").sort(B).join("")===u,c.detectDuplicates=!!l,m(),c.sortDetached=ia(function(a){return 1&a.compareDocumentPosition(n.createElement("div"))}),ia(function(a){return a.innerHTML="<a href='#'></a>","#"===a.firstChild.getAttribute("href")})||ja("type|href|height|width",function(a,b,c){return c?void 0:a.getAttribute(b,"type"===b.toLowerCase()?1:2)}),c.attributes&&ia(function(a){return a.innerHTML="<input/>",a.firstChild.setAttribute("value",""),""===a.firstChild.getAttribute("value")})||ja("value",function(a,b,c){return c||"input"!==a.nodeName.toLowerCase()?void 0:a.defaultValue}),ia(function(a){return null==a.getAttribute("disabled")})||ja(K,function(a,b,c){var d;return c?void 0:a[b]===!0?b.toLowerCase():(d=a.getAttributeNode(b))&&d.specified?d.value:null}),fa}(a);n.find=t,n.expr=t.selectors,n.expr[":"]=n.expr.pseudos,n.uniqueSort=n.unique=t.uniqueSort,n.text=t.getText,n.isXMLDoc=t.isXML,n.contains=t.contains;var u=function(a,b,c){var d=[],e=void 0!==c;while((a=a[b])&&9!==a.nodeType){if(1===a.nodeType){if(e&&n(a).is(c)){break}d.push(a)}}return d},v=function(a,b){for(var c=[];a;a=a.nextSibling){1===a.nodeType&&a!==b&&c.push(a)}return c},w=n.expr.match.needsContext,x=/^<([\w-]+)\s*\/?>(?:<\/\1>|)$/,y=/^.[^:#\[\.,]*$/;function z(a,b,c){if(n.isFunction(b)){return n.grep(a,function(a,d){return !!b.call(a,d,a)!==c})}if(b.nodeType){return n.grep(a,function(a){return a===b!==c})}if("string"==typeof b){if(y.test(b)){return n.filter(b,a,c)}b=n.filter(b,a)}return n.grep(a,function(a){return n.inArray(a,b)>-1!==c})}n.filter=function(a,b,c){var d=b[0];return c&&(a=":not("+a+")"),1===b.length&&1===d.nodeType?n.find.matchesSelector(d,a)?[d]:[]:n.find.matches(a,n.grep(b,function(a){return 1===a.nodeType}))},n.fn.extend({find:function(a){var b,c=[],d=this,e=d.length;if("string"!=typeof a){return this.pushStack(n(a).filter(function(){for(b=0;e>b;b++){if(n.contains(d[b],this)){return !0}}}))}for(b=0;e>b;b++){n.find(a,d[b],c)}return c=this.pushStack(e>1?n.unique(c):c),c.selector=this.selector?this.selector+" "+a:a,c},filter:function(a){return this.pushStack(z(this,a||[],!1))},not:function(a){return this.pushStack(z(this,a||[],!0))},is:function(a){return !!z(this,"string"==typeof a&&w.test(a)?n(a):a||[],!1).length}});var A,B=/^(?:\s*(<[\w\W]+>)[^>]*|#([\w-]*))$/,C=n.fn.init=function(a,b,c){var e,f;if(!a){return this}if(c=c||A,"string"==typeof a){if(e="<"===a.charAt(0)&&">"===a.charAt(a.length-1)&&a.length>=3?[null,a,null]:B.exec(a),!e||!e[1]&&b){return !b||b.jquery?(b||c).find(a):this.constructor(b).find(a)}if(e[1]){if(b=b instanceof n?b[0]:b,n.merge(this,n.parseHTML(e[1],b&&b.nodeType?b.ownerDocument||b:d,!0)),x.test(e[1])&&n.isPlainObject(b)){for(e in b){n.isFunction(this[e])?this[e](b[e]):this.attr(e,b[e])}}return this}if(f=d.getElementById(e[2]),f&&f.parentNode){if(f.id!==e[2]){return A.find(a)}this.length=1,this[0]=f}return this.context=d,this.selector=a,this}return a.nodeType?(this.context=this[0]=a,this.length=1,this):n.isFunction(a)?"undefined"!=typeof c.ready?c.ready(a):a(n):(void 0!==a.selector&&(this.selector=a.selector,this.context=a.context),n.makeArray(a,this))};C.prototype=n.fn,A=n(d);var D=/^(?:parents|prev(?:Until|All))/,E={children:!0,contents:!0,next:!0,prev:!0};n.fn.extend({has:function(a){var b,c=n(a,this),d=c.length;return this.filter(function(){for(b=0;d>b;b++){if(n.contains(this,c[b])){return !0}}})},closest:function(a,b){for(var c,d=0,e=this.length,f=[],g=w.test(a)||"string"!=typeof a?n(a,b||this.context):0;e>d;d++){for(c=this[d];c&&c!==b;c=c.parentNode){if(c.nodeType<11&&(g?g.index(c)>-1:1===c.nodeType&&n.find.matchesSelector(c,a))){f.push(c);break}}}return this.pushStack(f.length>1?n.uniqueSort(f):f)},index:function(a){return a?"string"==typeof a?n.inArray(this[0],n(a)):n.inArray(a.jquery?a[0]:a,this):this[0]&&this[0].parentNode?this.first().prevAll().length:-1},add:function(a,b){return this.pushStack(n.uniqueSort(n.merge(this.get(),n(a,b))))},addBack:function(a){return this.add(null==a?this.prevObject:this.prevObject.filter(a))}});function F(a,b){do{a=a[b]}while(a&&1!==a.nodeType);return a}n.each({parent:function(a){var b=a.parentNode;return b&&11!==b.nodeType?b:null},parents:function(a){return u(a,"parentNode")},parentsUntil:function(a,b,c){return u(a,"parentNode",c)},next:function(a){return F(a,"nextSibling")},prev:function(a){return F(a,"previousSibling")},nextAll:function(a){return u(a,"nextSibling")},prevAll:function(a){return u(a,"previousSibling")},nextUntil:function(a,b,c){return u(a,"nextSibling",c)},prevUntil:function(a,b,c){return u(a,"previousSibling",c)},siblings:function(a){return v((a.parentNode||{}).firstChild,a)},children:function(a){return v(a.firstChild)},contents:function(a){return n.nodeName(a,"iframe")?a.contentDocument||a.contentWindow.document:n.merge([],a.childNodes)}},function(a,b){n.fn[a]=function(c,d){var e=n.map(this,b,c);return"Until"!==a.slice(-5)&&(d=c),d&&"string"==typeof d&&(e=n.filter(d,e)),this.length>1&&(E[a]||(e=n.uniqueSort(e)),D.test(a)&&(e=e.reverse())),this.pushStack(e)}});var G=/\S+/g;function H(a){var b={};return n.each(a.match(G)||[],function(a,c){b[c]=!0}),b}n.Callbacks=function(a){a="string"==typeof a?H(a):n.extend({},a);var b,c,d,e,f=[],g=[],h=-1,i=function(){for(e=a.once,d=b=!0;g.length;h=-1){c=g.shift();while(++h<f.length){f[h].apply(c[0],c[1])===!1&&a.stopOnFalse&&(h=f.length,c=!1)}}a.memory||(c=!1),b=!1,e&&(f=c?[]:"")},j={add:function(){return f&&(c&&!b&&(h=f.length-1,g.push(c)),function d(b){n.each(b,function(b,c){n.isFunction(c)?a.unique&&j.has(c)||f.push(c):c&&c.length&&"string"!==n.type(c)&&d(c)})}(arguments),c&&!b&&i()),this},remove:function(){return n.each(arguments,function(a,b){var c;while((c=n.inArray(b,f,c))>-1){f.splice(c,1),h>=c&&h--}}),this},has:function(a){return a?n.inArray(a,f)>-1:f.length>0},empty:function(){return f&&(f=[]),this},disable:function(){return e=g=[],f=c="",this},disabled:function(){return !f},lock:function(){return e=!0,c||j.disable(),this},locked:function(){return !!e},fireWith:function(a,c){return e||(c=c||[],c=[a,c.slice?c.slice():c],g.push(c),b||i()),this},fire:function(){return j.fireWith(this,arguments),this},fired:function(){return !!d}};return j},n.extend({Deferred:function(a){var b=[["resolve","done",n.Callbacks("once memory"),"resolved"],["reject","fail",n.Callbacks("once memory"),"rejected"],["notify","progress",n.Callbacks("memory")]],c="pending",d={state:function(){return c},always:function(){return e.done(arguments).fail(arguments),this},then:function(){var a=arguments;return n.Deferred(function(c){n.each(b,function(b,f){var g=n.isFunction(a[b])&&a[b];e[f[1]](function(){var a=g&&g.apply(this,arguments);a&&n.isFunction(a.promise)?a.promise().progress(c.notify).done(c.resolve).fail(c.reject):c[f[0]+"With"](this===d?c.promise():this,g?[a]:arguments)})}),a=null}).promise()},promise:function(a){return null!=a?n.extend(a,d):d}},e={};return d.pipe=d.then,n.each(b,function(a,f){var g=f[2],h=f[3];d[f[1]]=g.add,h&&g.add(function(){c=h},b[1^a][2].disable,b[2][2].lock),e[f[0]]=function(){return e[f[0]+"With"](this===e?d:this,arguments),this},e[f[0]+"With"]=g.fireWith}),d.promise(e),a&&a.call(e,e),e},when:function(a){var b=0,c=e.call(arguments),d=c.length,f=1!==d||a&&n.isFunction(a.promise)?d:0,g=1===f?a:n.Deferred(),h=function(a,b,c){return function(d){b[a]=this,c[a]=arguments.length>1?e.call(arguments):d,c===i?g.notifyWith(b,c):--f||g.resolveWith(b,c)}},i,j,k;if(d>1){for(i=new Array(d),j=new Array(d),k=new Array(d);d>b;b++){c[b]&&n.isFunction(c[b].promise)?c[b].promise().progress(h(b,j,i)).done(h(b,k,c)).fail(g.reject):--f}}return f||g.resolveWith(k,c),g.promise()}});var I;n.fn.ready=function(a){return n.ready.promise().done(a),this},n.extend({isReady:!1,readyWait:1,holdReady:function(a){a?n.readyWait++:n.ready(!0)},ready:function(a){(a===!0?--n.readyWait:n.isReady)||(n.isReady=!0,a!==!0&&--n.readyWait>0||(I.resolveWith(d,[n]),n.fn.triggerHandler&&(n(d).triggerHandler("ready"),n(d).off("ready"))))}});function J(){d.addEventListener?(d.removeEventListener("DOMContentLoaded",K),a.removeEventListener("load",K)):(d.detachEvent("onreadystatechange",K),a.detachEvent("onload",K))}function K(){(d.addEventListener||"load"===a.event.type||"complete"===d.readyState)&&(J(),n.ready())}n.ready.promise=function(b){if(!I){if(I=n.Deferred(),"complete"===d.readyState||"loading"!==d.readyState&&!d.documentElement.doScroll){a.setTimeout(n.ready)}else{if(d.addEventListener){d.addEventListener("DOMContentLoaded",K),a.addEventListener("load",K)}else{d.attachEvent("onreadystatechange",K),a.attachEvent("onload",K);var c=!1;try{c=null==a.frameElement&&d.documentElement}catch(e){}c&&c.doScroll&&!function f(){if(!n.isReady){try{c.doScroll("left")}catch(b){return a.setTimeout(f,50)}J(),n.ready()}}()}}}return I.promise(b)},n.ready.promise();var L;for(L in n(l)){break}l.ownFirst="0"===L,l.inlineBlockNeedsLayout=!1,n(function(){var a,b,c,e;c=d.getElementsByTagName("body")[0],c&&c.style&&(b=d.createElement("div"),e=d.createElement("div"),e.style.cssText="position:absolute;border:0;width:0;height:0;top:0;left:-9999px",c.appendChild(e).appendChild(b),"undefined"!=typeof b.style.zoom&&(b.style.cssText="display:inline;margin:0;border:0;padding:1px;width:1px;zoom:1",l.inlineBlockNeedsLayout=a=3===b.offsetWidth,a&&(c.style.zoom=1)),c.removeChild(e))}),function(){var a=d.createElement("div");l.deleteExpando=!0;try{delete a.test}catch(b){l.deleteExpando=!1}a=null}();var M=function(a){var b=n.noData[(a.nodeName+" ").toLowerCase()],c=+a.nodeType||1;return 1!==c&&9!==c?!1:!b||b!==!0&&a.getAttribute("classid")===b},N=/^(?:\{[\w\W]*\}|\[[\w\W]*\])$/,O=/([A-Z])/g;function P(a,b,c){if(void 0===c&&1===a.nodeType){var d="data-"+b.replace(O,"-$1").toLowerCase();if(c=a.getAttribute(d),"string"==typeof c){try{c="true"===c?!0:"false"===c?!1:"null"===c?null:+c+""===c?+c:N.test(c)?n.parseJSON(c):c}catch(e){}n.data(a,b,c)}else{c=void 0}}return c}function Q(a){var b;for(b in a){if(("data"!==b||!n.isEmptyObject(a[b]))&&"toJSON"!==b){return !1}}return !0}function R(a,b,d,e){if(M(a)){var f,g,h=n.expando,i=a.nodeType,j=i?n.cache:a,k=i?a[h]:a[h]&&h;if(k&&j[k]&&(e||j[k].data)||void 0!==d||"string"!=typeof b){return k||(k=i?a[h]=c.pop()||n.guid++:h),j[k]||(j[k]=i?{}:{toJSON:n.noop}),"object"!=typeof b&&"function"!=typeof b||(e?j[k]=n.extend(j[k],b):j[k].data=n.extend(j[k].data,b)),g=j[k],e||(g.data||(g.data={}),g=g.data),void 0!==d&&(g[n.camelCase(b)]=d),"string"==typeof b?(f=g[b],null==f&&(f=g[n.camelCase(b)])):f=g,f}}}function S(a,b,c){if(M(a)){var d,e,f=a.nodeType,g=f?n.cache:a,h=f?a[n.expando]:n.expando;if(g[h]){if(b&&(d=c?g[h]:g[h].data)){n.isArray(b)?b=b.concat(n.map(b,n.camelCase)):b in d?b=[b]:(b=n.camelCase(b),b=b in d?[b]:b.split(" ")),e=b.length;while(e--){delete d[b[e]]}if(c?!Q(d):!n.isEmptyObject(d)){return}}(c||(delete g[h].data,Q(g[h])))&&(f?n.cleanData([a],!0):l.deleteExpando||g!=g.window?delete g[h]:g[h]=void 0)}}}n.extend({cache:{},noData:{"applet ":!0,"embed ":!0,"object ":"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"},hasData:function(a){return a=a.nodeType?n.cache[a[n.expando]]:a[n.expando],!!a&&!Q(a)},data:function(a,b,c){return R(a,b,c)},removeData:function(a,b){return S(a,b)},_data:function(a,b,c){return R(a,b,c,!0)},_removeData:function(a,b){return S(a,b,!0)}}),n.fn.extend({data:function(a,b){var c,d,e,f=this[0],g=f&&f.attributes;if(void 0===a){if(this.length&&(e=n.data(f),1===f.nodeType&&!n._data(f,"parsedAttrs"))){c=g.length;while(c--){g[c]&&(d=g[c].name,0===d.indexOf("data-")&&(d=n.camelCase(d.slice(5)),P(f,d,e[d])))}n._data(f,"parsedAttrs",!0)}return e}return"object"==typeof a?this.each(function(){n.data(this,a)}):arguments.length>1?this.each(function(){n.data(this,a,b)}):f?P(f,a,n.data(f,a)):void 0},removeData:function(a){return this.each(function(){n.removeData(this,a)})}}),n.extend({queue:function(a,b,c){var d;return a?(b=(b||"fx")+"queue",d=n._data(a,b),c&&(!d||n.isArray(c)?d=n._data(a,b,n.makeArray(c)):d.push(c)),d||[]):void 0},dequeue:function(a,b){b=b||"fx";var c=n.queue(a,b),d=c.length,e=c.shift(),f=n._queueHooks(a,b),g=function(){n.dequeue(a,b)};"inprogress"===e&&(e=c.shift(),d--),e&&("fx"===b&&c.unshift("inprogress"),delete f.stop,e.call(a,g,f)),!d&&f&&f.empty.fire()},_queueHooks:function(a,b){var c=b+"queueHooks";return n._data(a,c)||n._data(a,c,{empty:n.Callbacks("once memory").add(function(){n._removeData(a,b+"queue"),n._removeData(a,c)})})}}),n.fn.extend({queue:function(a,b){var c=2;return"string"!=typeof a&&(b=a,a="fx",c--),arguments.length<c?n.queue(this[0],a):void 0===b?this:this.each(function(){var c=n.queue(this,a,b);n._queueHooks(this,a),"fx"===a&&"inprogress"!==c[0]&&n.dequeue(this,a)})},dequeue:function(a){return this.each(function(){n.dequeue(this,a)})},clearQueue:function(a){return this.queue(a||"fx",[])},promise:function(a,b){var c,d=1,e=n.Deferred(),f=this,g=this.length,h=function(){--d||e.resolveWith(f,[f])};"string"!=typeof a&&(b=a,a=void 0),a=a||"fx";while(g--){c=n._data(f[g],a+"queueHooks"),c&&c.empty&&(d++,c.empty.add(h))}return h(),e.promise(b)}}),function(){var a;l.shrinkWrapBlocks=function(){if(null!=a){return a}a=!1;var b,c,e;return c=d.getElementsByTagName("body")[0],c&&c.style?(b=d.createElement("div"),e=d.createElement("div"),e.style.cssText="position:absolute;border:0;width:0;height:0;top:0;left:-9999px",c.appendChild(e).appendChild(b),"undefined"!=typeof b.style.zoom&&(b.style.cssText="-webkit-box-sizing:content-box;-moz-box-sizing:content-box;box-sizing:content-box;display:block;margin:0;border:0;padding:1px;width:1px;zoom:1",b.appendChild(d.createElement("div")).style.width="5px",a=3!==b.offsetWidth),c.removeChild(e),a):void 0}}();var T=/[+-]?(?:\d*\.|)\d+(?:[eE][+-]?\d+|)/.source,U=new RegExp("^(?:([+-])=|)("+T+")([a-z%]*)$","i"),V=["Top","Right","Bottom","Left"],W=function(a,b){return a=b||a,"none"===n.css(a,"display")||!n.contains(a.ownerDocument,a)};function X(a,b,c,d){var e,f=1,g=20,h=d?function(){return d.cur()}:function(){return n.css(a,b,"")},i=h(),j=c&&c[3]||(n.cssNumber[b]?"":"px"),k=(n.cssNumber[b]||"px"!==j&&+i)&&U.exec(n.css(a,b));if(k&&k[3]!==j){j=j||k[3],c=c||[],k=+i||1;do{f=f||".5",k/=f,n.style(a,b,k+j)}while(f!==(f=h()/i)&&1!==f&&--g)}return c&&(k=+k||+i||0,e=c[1]?k+(c[1]+1)*c[2]:+c[2],d&&(d.unit=j,d.start=k,d.end=e)),e}var Y=function(a,b,c,d,e,f,g){var h=0,i=a.length,j=null==c;if("object"===n.type(c)){e=!0;for(h in c){Y(a,b,h,c[h],!0,f,g)}}else{if(void 0!==d&&(e=!0,n.isFunction(d)||(g=!0),j&&(g?(b.call(a,d),b=null):(j=b,b=function(a,b,c){return j.call(n(a),c)})),b)){for(;i>h;h++){b(a[h],c,g?d:d.call(a[h],h,b(a[h],c)))}}}return e?a:j?b.call(a):i?b(a[0],c):f},Z=/^(?:checkbox|radio)$/i,$=/<([\w:-]+)/,_=/^$|\/(?:java|ecma)script/i,aa=/^\s+/,ba="abbr|article|aside|audio|bdi|canvas|data|datalist|details|dialog|figcaption|figure|footer|header|hgroup|main|mark|meter|nav|output|picture|progress|section|summary|template|time|video";function ca(a){var b=ba.split("|"),c=a.createDocumentFragment();if(c.createElement){while(b.length){c.createElement(b.pop())}}return c}!function(){var a=d.createElement("div"),b=d.createDocumentFragment(),c=d.createElement("input");a.innerHTML="  <link/><table></table><a href='/a'>a</a><input type='checkbox'/>",l.leadingWhitespace=3===a.firstChild.nodeType,l.tbody=!a.getElementsByTagName("tbody").length,l.htmlSerialize=!!a.getElementsByTagName("link").length,l.html5Clone="<:nav></:nav>"!==d.createElement("nav").cloneNode(!0).outerHTML,c.type="checkbox",c.checked=!0,b.appendChild(c),l.appendChecked=c.checked,a.innerHTML="<textarea>x</textarea>",l.noCloneChecked=!!a.cloneNode(!0).lastChild.defaultValue,b.appendChild(a),c=d.createElement("input"),c.setAttribute("type","radio"),c.setAttribute("checked","checked"),c.setAttribute("name","t"),a.appendChild(c),l.checkClone=a.cloneNode(!0).cloneNode(!0).lastChild.checked,l.noCloneEvent=!!a.addEventListener,a[n.expando]=1,l.attributes=!a.getAttribute(n.expando)}();var da={option:[1,"<select multiple='multiple'>","</select>"],legend:[1,"<fieldset>","</fieldset>"],area:[1,"<map>","</map>"],param:[1,"<object>","</object>"],thead:[1,"<table>","</table>"],tr:[2,"<table><tbody>","</tbody></table>"],col:[2,"<table><tbody></tbody><colgroup>","</colgroup></table>"],td:[3,"<table><tbody><tr>","</tr></tbody></table>"],_default:l.htmlSerialize?[0,"",""]:[1,"X<div>","</div>"]};da.optgroup=da.option,da.tbody=da.tfoot=da.colgroup=da.caption=da.thead,da.th=da.td;function ea(a,b){var c,d,e=0,f="undefined"!=typeof a.getElementsByTagName?a.getElementsByTagName(b||"*"):"undefined"!=typeof a.querySelectorAll?a.querySelectorAll(b||"*"):void 0;if(!f){for(f=[],c=a.childNodes||a;null!=(d=c[e]);e++){!b||n.nodeName(d,b)?f.push(d):n.merge(f,ea(d,b))}}return void 0===b||b&&n.nodeName(a,b)?n.merge([a],f):f}function fa(a,b){for(var c,d=0;null!=(c=a[d]);d++){n._data(c,"globalEval",!b||n._data(b[d],"globalEval"))}}var ga=/<|&#?\w+;/,ha=/<tbody/i;function ia(a){Z.test(a.type)&&(a.defaultChecked=a.checked)}function ja(a,b,c,d,e){for(var f,g,h,i,j,k,m,o=a.length,p=ca(b),q=[],r=0;o>r;r++){if(g=a[r],g||0===g){if("object"===n.type(g)){n.merge(q,g.nodeType?[g]:g)}else{if(ga.test(g)){i=i||p.appendChild(b.createElement("div")),j=($.exec(g)||["",""])[1].toLowerCase(),m=da[j]||da._default,i.innerHTML=m[1]+n.htmlPrefilter(g)+m[2],f=m[0];while(f--){i=i.lastChild}if(!l.leadingWhitespace&&aa.test(g)&&q.push(b.createTextNode(aa.exec(g)[0])),!l.tbody){g="table"!==j||ha.test(g)?"<table>"!==m[1]||ha.test(g)?0:i:i.firstChild,f=g&&g.childNodes.length;while(f--){n.nodeName(k=g.childNodes[f],"tbody")&&!k.childNodes.length&&g.removeChild(k)}}n.merge(q,i.childNodes),i.textContent="";while(i.firstChild){i.removeChild(i.firstChild)}i=p.lastChild}else{q.push(b.createTextNode(g))}}}}i&&p.removeChild(i),l.appendChecked||n.grep(ea(q,"input"),ia),r=0;while(g=q[r++]){if(d&&n.inArray(g,d)>-1){e&&e.push(g)}else{if(h=n.contains(g.ownerDocument,g),i=ea(p.appendChild(g),"script"),h&&fa(i),c){f=0;while(g=i[f++]){_.test(g.type||"")&&c.push(g)}}}}return i=null,p}!function(){var b,c,e=d.createElement("div");for(b in {submit:!0,change:!0,focusin:!0}){c="on"+b,(l[b]=c in a)||(e.setAttribute(c,"t"),l[b]=e.attributes[c].expando===!1)}e=null}();var ka=/^(?:input|select|textarea)$/i,la=/^key/,ma=/^(?:mouse|pointer|contextmenu|drag|drop)|click/,na=/^(?:focusinfocus|focusoutblur)$/,oa=/^([^.]*)(?:\.(.+)|)/;function pa(){return !0}function qa(){return !1}function ra(){try{return d.activeElement}catch(a){}}function sa(a,b,c,d,e,f){var g,h;if("object"==typeof b){"string"!=typeof c&&(d=d||c,c=void 0);for(h in b){sa(a,h,c,d,b[h],f)}return a}if(null==d&&null==e?(e=c,d=c=void 0):null==e&&("string"==typeof c?(e=d,d=void 0):(e=d,d=c,c=void 0)),e===!1){e=qa}else{if(!e){return a}}return 1===f&&(g=e,e=function(a){return n().off(a),g.apply(this,arguments)},e.guid=g.guid||(g.guid=n.guid++)),a.each(function(){n.event.add(this,b,e,d,c)})}n.event={global:{},add:function(a,b,c,d,e){var f,g,h,i,j,k,l,m,o,p,q,r=n._data(a);if(r){c.handler&&(i=c,c=i.handler,e=i.selector),c.guid||(c.guid=n.guid++),(g=r.events)||(g=r.events={}),(k=r.handle)||(k=r.handle=function(a){return"undefined"==typeof n||a&&n.event.triggered===a.type?void 0:n.event.dispatch.apply(k.elem,arguments)},k.elem=a),b=(b||"").match(G)||[""],h=b.length;while(h--){f=oa.exec(b[h])||[],o=q=f[1],p=(f[2]||"").split(".").sort(),o&&(j=n.event.special[o]||{},o=(e?j.delegateType:j.bindType)||o,j=n.event.special[o]||{},l=n.extend({type:o,origType:q,data:d,handler:c,guid:c.guid,selector:e,needsContext:e&&n.expr.match.needsContext.test(e),namespace:p.join(".")},i),(m=g[o])||(m=g[o]=[],m.delegateCount=0,j.setup&&j.setup.call(a,d,p,k)!==!1||(a.addEventListener?a.addEventListener(o,k,!1):a.attachEvent&&a.attachEvent("on"+o,k))),j.add&&(j.add.call(a,l),l.handler.guid||(l.handler.guid=c.guid)),e?m.splice(m.delegateCount++,0,l):m.push(l),n.event.global[o]=!0)}a=null}},remove:function(a,b,c,d,e){var f,g,h,i,j,k,l,m,o,p,q,r=n.hasData(a)&&n._data(a);if(r&&(k=r.events)){b=(b||"").match(G)||[""],j=b.length;while(j--){if(h=oa.exec(b[j])||[],o=q=h[1],p=(h[2]||"").split(".").sort(),o){l=n.event.special[o]||{},o=(d?l.delegateType:l.bindType)||o,m=k[o]||[],h=h[2]&&new RegExp("(^|\\.)"+p.join("\\.(?:.*\\.|)")+"(\\.|$)"),i=f=m.length;while(f--){g=m[f],!e&&q!==g.origType||c&&c.guid!==g.guid||h&&!h.test(g.namespace)||d&&d!==g.selector&&("**"!==d||!g.selector)||(m.splice(f,1),g.selector&&m.delegateCount--,l.remove&&l.remove.call(a,g))}i&&!m.length&&(l.teardown&&l.teardown.call(a,p,r.handle)!==!1||n.removeEvent(a,o,r.handle),delete k[o])}else{for(o in k){n.event.remove(a,o+b[j],c,d,!0)}}}n.isEmptyObject(k)&&(delete r.handle,n._removeData(a,"events"))}},trigger:function(b,c,e,f){var g,h,i,j,l,m,o,p=[e||d],q=k.call(b,"type")?b.type:b,r=k.call(b,"namespace")?b.namespace.split("."):[];if(i=m=e=e||d,3!==e.nodeType&&8!==e.nodeType&&!na.test(q+n.event.triggered)&&(q.indexOf(".")>-1&&(r=q.split("."),q=r.shift(),r.sort()),h=q.indexOf(":")<0&&"on"+q,b=b[n.expando]?b:new n.Event(q,"object"==typeof b&&b),b.isTrigger=f?2:3,b.namespace=r.join("."),b.rnamespace=b.namespace?new RegExp("(^|\\.)"+r.join("\\.(?:.*\\.|)")+"(\\.|$)"):null,b.result=void 0,b.target||(b.target=e),c=null==c?[b]:n.makeArray(c,[b]),l=n.event.special[q]||{},f||!l.trigger||l.trigger.apply(e,c)!==!1)){if(!f&&!l.noBubble&&!n.isWindow(e)){for(j=l.delegateType||q,na.test(j+q)||(i=i.parentNode);i;i=i.parentNode){p.push(i),m=i}m===(e.ownerDocument||d)&&p.push(m.defaultView||m.parentWindow||a)}o=0;while((i=p[o++])&&!b.isPropagationStopped()){b.type=o>1?j:l.bindType||q,g=(n._data(i,"events")||{})[b.type]&&n._data(i,"handle"),g&&g.apply(i,c),g=h&&i[h],g&&g.apply&&M(i)&&(b.result=g.apply(i,c),b.result===!1&&b.preventDefault())}if(b.type=q,!f&&!b.isDefaultPrevented()&&(!l._default||l._default.apply(p.pop(),c)===!1)&&M(e)&&h&&e[q]&&!n.isWindow(e)){m=e[h],m&&(e[h]=null),n.event.triggered=q;try{e[q]()}catch(s){}n.event.triggered=void 0,m&&(e[h]=m)}return b.result}},dispatch:function(a){a=n.event.fix(a);var b,c,d,f,g,h=[],i=e.call(arguments),j=(n._data(this,"events")||{})[a.type]||[],k=n.event.special[a.type]||{};if(i[0]=a,a.delegateTarget=this,!k.preDispatch||k.preDispatch.call(this,a)!==!1){h=n.event.handlers.call(this,a,j),b=0;while((f=h[b++])&&!a.isPropagationStopped()){a.currentTarget=f.elem,c=0;while((g=f.handlers[c++])&&!a.isImmediatePropagationStopped()){a.rnamespace&&!a.rnamespace.test(g.namespace)||(a.handleObj=g,a.data=g.data,d=((n.event.special[g.origType]||{}).handle||g.handler).apply(f.elem,i),void 0!==d&&(a.result=d)===!1&&(a.preventDefault(),a.stopPropagation()))}}return k.postDispatch&&k.postDispatch.call(this,a),a.result}},handlers:function(a,b){var c,d,e,f,g=[],h=b.delegateCount,i=a.target;if(h&&i.nodeType&&("click"!==a.type||isNaN(a.button)||a.button<1)){for(;i!=this;i=i.parentNode||this){if(1===i.nodeType&&(i.disabled!==!0||"click"!==a.type)){for(d=[],c=0;h>c;c++){f=b[c],e=f.selector+" ",void 0===d[e]&&(d[e]=f.needsContext?n(e,this).index(i)>-1:n.find(e,this,null,[i]).length),d[e]&&d.push(f)}d.length&&g.push({elem:i,handlers:d})}}}return h<b.length&&g.push({elem:this,handlers:b.slice(h)}),g},fix:function(a){if(a[n.expando]){return a}var b,c,e,f=a.type,g=a,h=this.fixHooks[f];h||(this.fixHooks[f]=h=ma.test(f)?this.mouseHooks:la.test(f)?this.keyHooks:{}),e=h.props?this.props.concat(h.props):this.props,a=new n.Event(g),b=e.length;while(b--){c=e[b],a[c]=g[c]}return a.target||(a.target=g.srcElement||d),3===a.target.nodeType&&(a.target=a.target.parentNode),a.metaKey=!!a.metaKey,h.filter?h.filter(a,g):a},props:"altKey bubbles cancelable ctrlKey currentTarget detail eventPhase metaKey relatedTarget shiftKey target timeStamp view which".split(" "),fixHooks:{},keyHooks:{props:"char charCode key keyCode".split(" "),filter:function(a,b){return null==a.which&&(a.which=null!=b.charCode?b.charCode:b.keyCode),a}},mouseHooks:{props:"button buttons clientX clientY fromElement offsetX offsetY pageX pageY screenX screenY toElement".split(" "),filter:function(a,b){var c,e,f,g=b.button,h=b.fromElement;return null==a.pageX&&null!=b.clientX&&(e=a.target.ownerDocument||d,f=e.documentElement,c=e.body,a.pageX=b.clientX+(f&&f.scrollLeft||c&&c.scrollLeft||0)-(f&&f.clientLeft||c&&c.clientLeft||0),a.pageY=b.clientY+(f&&f.scrollTop||c&&c.scrollTop||0)-(f&&f.clientTop||c&&c.clientTop||0)),!a.relatedTarget&&h&&(a.relatedTarget=h===a.target?b.toElement:h),a.which||void 0===g||(a.which=1&g?1:2&g?3:4&g?2:0),a}},special:{load:{noBubble:!0},focus:{trigger:function(){if(this!==ra()&&this.focus){try{return this.focus(),!1}catch(a){}}},delegateType:"focusin"},blur:{trigger:function(){return this===ra()&&this.blur?(this.blur(),!1):void 0},delegateType:"focusout"},click:{trigger:function(){return n.nodeName(this,"input")&&"checkbox"===this.type&&this.click?(this.click(),!1):void 0},_default:function(a){return n.nodeName(a.target,"a")}},beforeunload:{postDispatch:function(a){void 0!==a.result&&a.originalEvent&&(a.originalEvent.returnValue=a.result)}}},simulate:function(a,b,c){var d=n.extend(new n.Event,c,{type:a,isSimulated:!0});n.event.trigger(d,null,b),d.isDefaultPrevented()&&c.preventDefault()}},n.removeEvent=d.removeEventListener?function(a,b,c){a.removeEventListener&&a.removeEventListener(b,c)}:function(a,b,c){var d="on"+b;a.detachEvent&&("undefined"==typeof a[d]&&(a[d]=null),a.detachEvent(d,c))},n.Event=function(a,b){return this instanceof n.Event?(a&&a.type?(this.originalEvent=a,this.type=a.type,this.isDefaultPrevented=a.defaultPrevented||void 0===a.defaultPrevented&&a.returnValue===!1?pa:qa):this.type=a,b&&n.extend(this,b),this.timeStamp=a&&a.timeStamp||n.now(),void (this[n.expando]=!0)):new n.Event(a,b)},n.Event.prototype={constructor:n.Event,isDefaultPrevented:qa,isPropagationStopped:qa,isImmediatePropagationStopped:qa,preventDefault:function(){var a=this.originalEvent;this.isDefaultPrevented=pa,a&&(a.preventDefault?a.preventDefault():a.returnValue=!1)},stopPropagation:function(){var a=this.originalEvent;this.isPropagationStopped=pa,a&&!this.isSimulated&&(a.stopPropagation&&a.stopPropagation(),a.cancelBubble=!0)},stopImmediatePropagation:function(){var a=this.originalEvent;this.isImmediatePropagationStopped=pa,a&&a.stopImmediatePropagation&&a.stopImmediatePropagation(),this.stopPropagation()}},n.each({mouseenter:"mouseover",mouseleave:"mouseout",pointerenter:"pointerover",pointerleave:"pointerout"},function(a,b){n.event.special[a]={delegateType:b,bindType:b,handle:function(a){var c,d=this,e=a.relatedTarget,f=a.handleObj;return e&&(e===d||n.contains(d,e))||(a.type=f.origType,c=f.handler.apply(this,arguments),a.type=b),c}}}),l.submit||(n.event.special.submit={setup:function(){return n.nodeName(this,"form")?!1:void n.event.add(this,"click._submit keypress._submit",function(a){var b=a.target,c=n.nodeName(b,"input")||n.nodeName(b,"button")?n.prop(b,"form"):void 0;c&&!n._data(c,"submit")&&(n.event.add(c,"submit._submit",function(a){a._submitBubble=!0}),n._data(c,"submit",!0))})},postDispatch:function(a){a._submitBubble&&(delete a._submitBubble,this.parentNode&&!a.isTrigger&&n.event.simulate("submit",this.parentNode,a))},teardown:function(){return n.nodeName(this,"form")?!1:void n.event.remove(this,"._submit")}}),l.change||(n.event.special.change={setup:function(){return ka.test(this.nodeName)?("checkbox"!==this.type&&"radio"!==this.type||(n.event.add(this,"propertychange._change",function(a){"checked"===a.originalEvent.propertyName&&(this._justChanged=!0)}),n.event.add(this,"click._change",function(a){this._justChanged&&!a.isTrigger&&(this._justChanged=!1),n.event.simulate("change",this,a)})),!1):void n.event.add(this,"beforeactivate._change",function(a){var b=a.target;ka.test(b.nodeName)&&!n._data(b,"change")&&(n.event.add(b,"change._change",function(a){!this.parentNode||a.isSimulated||a.isTrigger||n.event.simulate("change",this.parentNode,a)}),n._data(b,"change",!0))})},handle:function(a){var b=a.target;return this!==b||a.isSimulated||a.isTrigger||"radio"!==b.type&&"checkbox"!==b.type?a.handleObj.handler.apply(this,arguments):void 0},teardown:function(){return n.event.remove(this,"._change"),!ka.test(this.nodeName)}}),l.focusin||n.each({focus:"focusin",blur:"focusout"},function(a,b){var c=function(a){n.event.simulate(b,a.target,n.event.fix(a))};n.event.special[b]={setup:function(){var d=this.ownerDocument||this,e=n._data(d,b);e||d.addEventListener(a,c,!0),n._data(d,b,(e||0)+1)},teardown:function(){var d=this.ownerDocument||this,e=n._data(d,b)-1;e?n._data(d,b,e):(d.removeEventListener(a,c,!0),n._removeData(d,b))}}}),n.fn.extend({on:function(a,b,c,d){return sa(this,a,b,c,d)},one:function(a,b,c,d){return sa(this,a,b,c,d,1)},off:function(a,b,c){var d,e;if(a&&a.preventDefault&&a.handleObj){return d=a.handleObj,n(a.delegateTarget).off(d.namespace?d.origType+"."+d.namespace:d.origType,d.selector,d.handler),this}if("object"==typeof a){for(e in a){this.off(e,b,a[e])}return this}return b!==!1&&"function"!=typeof b||(c=b,b=void 0),c===!1&&(c=qa),this.each(function(){n.event.remove(this,a,c,b)})},trigger:function(a,b){return this.each(function(){n.event.trigger(a,b,this)})},triggerHandler:function(a,b){var c=this[0];return c?n.event.trigger(a,b,c,!0):void 0}});var ta=/ jQuery\d+="(?:null|\d+)"/g,ua=new RegExp("<(?:"+ba+")[\\s/>]","i"),va=/<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:-]+)[^>]*)\/>/gi,wa=/<script|<style|<link/i,xa=/checked\s*(?:[^=]|=\s*.checked.)/i,ya=/^true\/(.*)/,za=/^\s*<!(?:\[CDATA\[|--)|(?:\]\]|--)>\s*$/g,Aa=ca(d),Ba=Aa.appendChild(d.createElement("div"));function Ca(a,b){return n.nodeName(a,"table")&&n.nodeName(11!==b.nodeType?b:b.firstChild,"tr")?a.getElementsByTagName("tbody")[0]||a.appendChild(a.ownerDocument.createElement("tbody")):a}function Da(a){return a.type=(null!==n.find.attr(a,"type"))+"/"+a.type,a}function Ea(a){var b=ya.exec(a.type);return b?a.type=b[1]:a.removeAttribute("type"),a}function Fa(a,b){if(1===b.nodeType&&n.hasData(a)){var c,d,e,f=n._data(a),g=n._data(b,f),h=f.events;if(h){delete g.handle,g.events={};for(c in h){for(d=0,e=h[c].length;e>d;d++){n.event.add(b,c,h[c][d])}}}g.data&&(g.data=n.extend({},g.data))}}function Ga(a,b){var c,d,e;if(1===b.nodeType){if(c=b.nodeName.toLowerCase(),!l.noCloneEvent&&b[n.expando]){e=n._data(b);for(d in e.events){n.removeEvent(b,d,e.handle)}b.removeAttribute(n.expando)}"script"===c&&b.text!==a.text?(Da(b).text=a.text,Ea(b)):"object"===c?(b.parentNode&&(b.outerHTML=a.outerHTML),l.html5Clone&&a.innerHTML&&!n.trim(b.innerHTML)&&(b.innerHTML=a.innerHTML)):"input"===c&&Z.test(a.type)?(b.defaultChecked=b.checked=a.checked,b.value!==a.value&&(b.value=a.value)):"option"===c?b.defaultSelected=b.selected=a.defaultSelected:"input"!==c&&"textarea"!==c||(b.defaultValue=a.defaultValue)}}function Ha(a,b,c,d){b=f.apply([],b);var e,g,h,i,j,k,m=0,o=a.length,p=o-1,q=b[0],r=n.isFunction(q);if(r||o>1&&"string"==typeof q&&!l.checkClone&&xa.test(q)){return a.each(function(e){var f=a.eq(e);r&&(b[0]=q.call(this,e,f.html())),Ha(f,b,c,d)})}if(o&&(k=ja(b,a[0].ownerDocument,!1,a,d),e=k.firstChild,1===k.childNodes.length&&(k=e),e||d)){for(i=n.map(ea(k,"script"),Da),h=i.length;o>m;m++){g=k,m!==p&&(g=n.clone(g,!0,!0),h&&n.merge(i,ea(g,"script"))),c.call(a[m],g,m)}if(h){for(j=i[i.length-1].ownerDocument,n.map(i,Ea),m=0;h>m;m++){g=i[m],_.test(g.type||"")&&!n._data(g,"globalEval")&&n.contains(j,g)&&(g.src?n._evalUrl&&n._evalUrl(g.src):n.globalEval((g.text||g.textContent||g.innerHTML||"").replace(za,"")))}}k=e=null}return a}function Ia(a,b,c){for(var d,e=b?n.filter(b,a):a,f=0;null!=(d=e[f]);f++){c||1!==d.nodeType||n.cleanData(ea(d)),d.parentNode&&(c&&n.contains(d.ownerDocument,d)&&fa(ea(d,"script")),d.parentNode.removeChild(d))}return a}n.extend({htmlPrefilter:function(a){return a.replace(va,"<$1></$2>")},clone:function(a,b,c){var d,e,f,g,h,i=n.contains(a.ownerDocument,a);if(l.html5Clone||n.isXMLDoc(a)||!ua.test("<"+a.nodeName+">")?f=a.cloneNode(!0):(Ba.innerHTML=a.outerHTML,Ba.removeChild(f=Ba.firstChild)),!(l.noCloneEvent&&l.noCloneChecked||1!==a.nodeType&&11!==a.nodeType||n.isXMLDoc(a))){for(d=ea(f),h=ea(a),g=0;null!=(e=h[g]);++g){d[g]&&Ga(e,d[g])}}if(b){if(c){for(h=h||ea(a),d=d||ea(f),g=0;null!=(e=h[g]);g++){Fa(e,d[g])}}else{Fa(a,f)}}return d=ea(f,"script"),d.length>0&&fa(d,!i&&ea(a,"script")),d=h=e=null,f},cleanData:function(a,b){for(var d,e,f,g,h=0,i=n.expando,j=n.cache,k=l.attributes,m=n.event.special;null!=(d=a[h]);h++){if((b||M(d))&&(f=d[i],g=f&&j[f])){if(g.events){for(e in g.events){m[e]?n.event.remove(d,e):n.removeEvent(d,e,g.handle)}}j[f]&&(delete j[f],k||"undefined"==typeof d.removeAttribute?d[i]=void 0:d.removeAttribute(i),c.push(f))}}}}),n.fn.extend({domManip:Ha,detach:function(a){return Ia(this,a,!0)},remove:function(a){return Ia(this,a)},text:function(a){return Y(this,function(a){return void 0===a?n.text(this):this.empty().append((this[0]&&this[0].ownerDocument||d).createTextNode(a))},null,a,arguments.length)},append:function(){return Ha(this,arguments,function(a){if(1===this.nodeType||11===this.nodeType||9===this.nodeType){var b=Ca(this,a);b.appendChild(a)}})},prepend:function(){return Ha(this,arguments,function(a){if(1===this.nodeType||11===this.nodeType||9===this.nodeType){var b=Ca(this,a);b.insertBefore(a,b.firstChild)}})},before:function(){return Ha(this,arguments,function(a){this.parentNode&&this.parentNode.insertBefore(a,this)})},after:function(){return Ha(this,arguments,function(a){this.parentNode&&this.parentNode.insertBefore(a,this.nextSibling)})},empty:function(){for(var a,b=0;null!=(a=this[b]);b++){1===a.nodeType&&n.cleanData(ea(a,!1));while(a.firstChild){a.removeChild(a.firstChild)}a.options&&n.nodeName(a,"select")&&(a.options.length=0)}return this},clone:function(a,b){return a=null==a?!1:a,b=null==b?a:b,this.map(function(){return n.clone(this,a,b)})},html:function(a){return Y(this,function(a){var b=this[0]||{},c=0,d=this.length;if(void 0===a){return 1===b.nodeType?b.innerHTML.replace(ta,""):void 0}if("string"==typeof a&&!wa.test(a)&&(l.htmlSerialize||!ua.test(a))&&(l.leadingWhitespace||!aa.test(a))&&!da[($.exec(a)||["",""])[1].toLowerCase()]){a=n.htmlPrefilter(a);try{for(;d>c;c++){b=this[c]||{},1===b.nodeType&&(n.cleanData(ea(b,!1)),b.innerHTML=a)}b=0}catch(e){}}b&&this.empty().append(a)},null,a,arguments.length)},replaceWith:function(){var a=[];return Ha(this,arguments,function(b){var c=this.parentNode;n.inArray(this,a)<0&&(n.cleanData(ea(this)),c&&c.replaceChild(b,this))},a)}}),n.each({appendTo:"append",prependTo:"prepend",insertBefore:"before",insertAfter:"after",replaceAll:"replaceWith"},function(a,b){n.fn[a]=function(a){for(var c,d=0,e=[],f=n(a),h=f.length-1;h>=d;d++){c=d===h?this:this.clone(!0),n(f[d])[b](c),g.apply(e,c.get())}return this.pushStack(e)}});var Ja,Ka={HTML:"block",BODY:"block"};function La(a,b){var c=n(b.createElement(a)).appendTo(b.body),d=n.css(c[0],"display");return c.detach(),d}function Ma(a){var b=d,c=Ka[a];return c||(c=La(a,b),"none"!==c&&c||(Ja=(Ja||n("<iframe frameborder='0' width='0' height='0'/>")).appendTo(b.documentElement),b=(Ja[0].contentWindow||Ja[0].contentDocument).document,b.write(),b.close(),c=La(a,b),Ja.detach()),Ka[a]=c),c}var Na=/^margin/,Oa=new RegExp("^("+T+")(?!px)[a-z%]+$","i"),Pa=function(a,b,c,d){var e,f,g={};for(f in b){g[f]=a.style[f],a.style[f]=b[f]}e=c.apply(a,d||[]);for(f in b){a.style[f]=g[f]}return e},Qa=d.documentElement;!function(){var b,c,e,f,g,h,i=d.createElement("div"),j=d.createElement("div");if(j.style){j.style.cssText="float:left;opacity:.5",l.opacity="0.5"===j.style.opacity,l.cssFloat=!!j.style.cssFloat,j.style.backgroundClip="content-box",j.cloneNode(!0).style.backgroundClip="",l.clearCloneStyle="content-box"===j.style.backgroundClip,i=d.createElement("div"),i.style.cssText="border:0;width:8px;height:0;top:0;left:-9999px;padding:0;margin-top:1px;position:absolute",j.innerHTML="",i.appendChild(j),l.boxSizing=""===j.style.boxSizing||""===j.style.MozBoxSizing||""===j.style.WebkitBoxSizing,n.extend(l,{reliableHiddenOffsets:function(){return null==b&&k(),f},boxSizingReliable:function(){return null==b&&k(),e},pixelMarginRight:function(){return null==b&&k(),c},pixelPosition:function(){return null==b&&k(),b},reliableMarginRight:function(){return null==b&&k(),g},reliableMarginLeft:function(){return null==b&&k(),h}});function k(){var k,l,m=d.documentElement;m.appendChild(i),j.style.cssText="-webkit-box-sizing:border-box;box-sizing:border-box;position:relative;display:block;margin:auto;border:1px;padding:1px;top:1%;width:50%",b=e=h=!1,c=g=!0,a.getComputedStyle&&(l=a.getComputedStyle(j),b="1%"!==(l||{}).top,h="2px"===(l||{}).marginLeft,e="4px"===(l||{width:"4px"}).width,j.style.marginRight="50%",c="4px"===(l||{marginRight:"4px"}).marginRight,k=j.appendChild(d.createElement("div")),k.style.cssText=j.style.cssText="-webkit-box-sizing:content-box;-moz-box-sizing:content-box;box-sizing:content-box;display:block;margin:0;border:0;padding:0",k.style.marginRight=k.style.width="0",j.style.width="1px",g=!parseFloat((a.getComputedStyle(k)||{}).marginRight),j.removeChild(k)),j.style.display="none",f=0===j.getClientRects().length,f&&(j.style.display="",j.innerHTML="<table><tr><td></td><td>t</td></tr></table>",j.childNodes[0].style.borderCollapse="separate",k=j.getElementsByTagName("td"),k[0].style.cssText="margin:0;border:0;padding:0;display:none",f=0===k[0].offsetHeight,f&&(k[0].style.display="",k[1].style.display="none",f=0===k[0].offsetHeight)),m.removeChild(i)}}}();var Ra,Sa,Ta=/^(top|right|bottom|left)$/;a.getComputedStyle?(Ra=function(b){var c=b.ownerDocument.defaultView;return c&&c.opener||(c=a),c.getComputedStyle(b)},Sa=function(a,b,c){var d,e,f,g,h=a.style;return c=c||Ra(a),g=c?c.getPropertyValue(b)||c[b]:void 0,""!==g&&void 0!==g||n.contains(a.ownerDocument,a)||(g=n.style(a,b)),c&&!l.pixelMarginRight()&&Oa.test(g)&&Na.test(b)&&(d=h.width,e=h.minWidth,f=h.maxWidth,h.minWidth=h.maxWidth=h.width=g,g=c.width,h.width=d,h.minWidth=e,h.maxWidth=f),void 0===g?g:g+""}):Qa.currentStyle&&(Ra=function(a){return a.currentStyle},Sa=function(a,b,c){var d,e,f,g,h=a.style;return c=c||Ra(a),g=c?c[b]:void 0,null==g&&h&&h[b]&&(g=h[b]),Oa.test(g)&&!Ta.test(b)&&(d=h.left,e=a.runtimeStyle,f=e&&e.left,f&&(e.left=a.currentStyle.left),h.left="fontSize"===b?"1em":g,g=h.pixelLeft+"px",h.left=d,f&&(e.left=f)),void 0===g?g:g+""||"auto"});function Ua(a,b){return{get:function(){return a()?void delete this.get:(this.get=b).apply(this,arguments)}}}var Va=/alpha\([^)]*\)/i,Wa=/opacity\s*=\s*([^)]*)/i,Xa=/^(none|table(?!-c[ea]).+)/,Ya=new RegExp("^("+T+")(.*)$","i"),Za={position:"absolute",visibility:"hidden",display:"block"},$a={letterSpacing:"0",fontWeight:"400"},_a=["Webkit","O","Moz","ms"],ab=d.createElement("div").style;function bb(a){if(a in ab){return a}var b=a.charAt(0).toUpperCase()+a.slice(1),c=_a.length;while(c--){if(a=_a[c]+b,a in ab){return a}}}function cb(a,b){for(var c,d,e,f=[],g=0,h=a.length;h>g;g++){d=a[g],d.style&&(f[g]=n._data(d,"olddisplay"),c=d.style.display,b?(f[g]||"none"!==c||(d.style.display=""),""===d.style.display&&W(d)&&(f[g]=n._data(d,"olddisplay",Ma(d.nodeName)))):(e=W(d),(c&&"none"!==c||!e)&&n._data(d,"olddisplay",e?c:n.css(d,"display"))))}for(g=0;h>g;g++){d=a[g],d.style&&(b&&"none"!==d.style.display&&""!==d.style.display||(d.style.display=b?f[g]||"":"none"))}return a}function db(a,b,c){var d=Ya.exec(b);return d?Math.max(0,d[1]-(c||0))+(d[2]||"px"):b}function eb(a,b,c,d,e){for(var f=c===(d?"border":"content")?4:"width"===b?1:0,g=0;4>f;f+=2){"margin"===c&&(g+=n.css(a,c+V[f],!0,e)),d?("content"===c&&(g-=n.css(a,"padding"+V[f],!0,e)),"margin"!==c&&(g-=n.css(a,"border"+V[f]+"Width",!0,e))):(g+=n.css(a,"padding"+V[f],!0,e),"padding"!==c&&(g+=n.css(a,"border"+V[f]+"Width",!0,e)))}return g}function fb(a,b,c){var d=!0,e="width"===b?a.offsetWidth:a.offsetHeight,f=Ra(a),g=l.boxSizing&&"border-box"===n.css(a,"boxSizing",!1,f);if(0>=e||null==e){if(e=Sa(a,b,f),(0>e||null==e)&&(e=a.style[b]),Oa.test(e)){return e}d=g&&(l.boxSizingReliable()||e===a.style[b]),e=parseFloat(e)||0}return e+eb(a,b,c||(g?"border":"content"),d,f)+"px"}n.extend({cssHooks:{opacity:{get:function(a,b){if(b){var c=Sa(a,"opacity");return""===c?"1":c}}}},cssNumber:{animationIterationCount:!0,columnCount:!0,fillOpacity:!0,flexGrow:!0,flexShrink:!0,fontWeight:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,widows:!0,zIndex:!0,zoom:!0},cssProps:{"float":l.cssFloat?"cssFloat":"styleFloat"},style:function(a,b,c,d){if(a&&3!==a.nodeType&&8!==a.nodeType&&a.style){var e,f,g,h=n.camelCase(b),i=a.style;if(b=n.cssProps[h]||(n.cssProps[h]=bb(h)||h),g=n.cssHooks[b]||n.cssHooks[h],void 0===c){return g&&"get" in g&&void 0!==(e=g.get(a,!1,d))?e:i[b]}if(f=typeof c,"string"===f&&(e=U.exec(c))&&e[1]&&(c=X(a,b,e),f="number"),null!=c&&c===c&&("number"===f&&(c+=e&&e[3]||(n.cssNumber[h]?"":"px")),l.clearCloneStyle||""!==c||0!==b.indexOf("background")||(i[b]="inherit"),!(g&&"set" in g&&void 0===(c=g.set(a,c,d))))){try{i[b]=c}catch(j){}}}},css:function(a,b,c,d){var e,f,g,h=n.camelCase(b);return b=n.cssProps[h]||(n.cssProps[h]=bb(h)||h),g=n.cssHooks[b]||n.cssHooks[h],g&&"get" in g&&(f=g.get(a,!0,c)),void 0===f&&(f=Sa(a,b,d)),"normal"===f&&b in $a&&(f=$a[b]),""===c||c?(e=parseFloat(f),c===!0||isFinite(e)?e||0:f):f}}),n.each(["height","width"],function(a,b){n.cssHooks[b]={get:function(a,c,d){return c?Xa.test(n.css(a,"display"))&&0===a.offsetWidth?Pa(a,Za,function(){return fb(a,b,d)}):fb(a,b,d):void 0},set:function(a,c,d){var e=d&&Ra(a);return db(a,c,d?eb(a,b,d,l.boxSizing&&"border-box"===n.css(a,"boxSizing",!1,e),e):0)}}}),l.opacity||(n.cssHooks.opacity={get:function(a,b){return Wa.test((b&&a.currentStyle?a.currentStyle.filter:a.style.filter)||"")?0.01*parseFloat(RegExp.$1)+"":b?"1":""},set:function(a,b){var c=a.style,d=a.currentStyle,e=n.isNumeric(b)?"alpha(opacity="+100*b+")":"",f=d&&d.filter||c.filter||"";c.zoom=1,(b>=1||""===b)&&""===n.trim(f.replace(Va,""))&&c.removeAttribute&&(c.removeAttribute("filter"),""===b||d&&!d.filter)||(c.filter=Va.test(f)?f.replace(Va,e):f+" "+e)}}),n.cssHooks.marginRight=Ua(l.reliableMarginRight,function(a,b){return b?Pa(a,{display:"inline-block"},Sa,[a,"marginRight"]):void 0}),n.cssHooks.marginLeft=Ua(l.reliableMarginLeft,function(a,b){return b?(parseFloat(Sa(a,"marginLeft"))||(n.contains(a.ownerDocument,a)?a.getBoundingClientRect().left-Pa(a,{marginLeft:0},function(){return a.getBoundingClientRect().left}):0))+"px":void 0}),n.each({margin:"",padding:"",border:"Width"},function(a,b){n.cssHooks[a+b]={expand:function(c){for(var d=0,e={},f="string"==typeof c?c.split(" "):[c];4>d;d++){e[a+V[d]+b]=f[d]||f[d-2]||f[0]}return e}},Na.test(a)||(n.cssHooks[a+b].set=db)}),n.fn.extend({css:function(a,b){return Y(this,function(a,b,c){var d,e,f={},g=0;if(n.isArray(b)){for(d=Ra(a),e=b.length;e>g;g++){f[b[g]]=n.css(a,b[g],!1,d)}return f}return void 0!==c?n.style(a,b,c):n.css(a,b)},a,b,arguments.length>1)},show:function(){return cb(this,!0)},hide:function(){return cb(this)},toggle:function(a){return"boolean"==typeof a?a?this.show():this.hide():this.each(function(){W(this)?n(this).show():n(this).hide()})}});function gb(a,b,c,d,e){return new gb.prototype.init(a,b,c,d,e)}n.Tween=gb,gb.prototype={constructor:gb,init:function(a,b,c,d,e,f){this.elem=a,this.prop=c,this.easing=e||n.easing._default,this.options=b,this.start=this.now=this.cur(),this.end=d,this.unit=f||(n.cssNumber[c]?"":"px")},cur:function(){var a=gb.propHooks[this.prop];return a&&a.get?a.get(this):gb.propHooks._default.get(this)},run:function(a){var b,c=gb.propHooks[this.prop];return this.options.duration?this.pos=b=n.easing[this.easing](a,this.options.duration*a,0,1,this.options.duration):this.pos=b=a,this.now=(this.end-this.start)*b+this.start,this.options.step&&this.options.step.call(this.elem,this.now,this),c&&c.set?c.set(this):gb.propHooks._default.set(this),this}},gb.prototype.init.prototype=gb.prototype,gb.propHooks={_default:{get:function(a){var b;return 1!==a.elem.nodeType||null!=a.elem[a.prop]&&null==a.elem.style[a.prop]?a.elem[a.prop]:(b=n.css(a.elem,a.prop,""),b&&"auto"!==b?b:0)},set:function(a){n.fx.step[a.prop]?n.fx.step[a.prop](a):1!==a.elem.nodeType||null==a.elem.style[n.cssProps[a.prop]]&&!n.cssHooks[a.prop]?a.elem[a.prop]=a.now:n.style(a.elem,a.prop,a.now+a.unit)}}},gb.propHooks.scrollTop=gb.propHooks.scrollLeft={set:function(a){a.elem.nodeType&&a.elem.parentNode&&(a.elem[a.prop]=a.now)}},n.easing={linear:function(a){return a},swing:function(a){return 0.5-Math.cos(a*Math.PI)/2},_default:"swing"},n.fx=gb.prototype.init,n.fx.step={};var hb,ib,jb=/^(?:toggle|show|hide)$/,kb=/queueHooks$/;function lb(){return a.setTimeout(function(){hb=void 0}),hb=n.now()}function mb(a,b){var c,d={height:a},e=0;for(b=b?1:0;4>e;e+=2-b){c=V[e],d["margin"+c]=d["padding"+c]=a}return b&&(d.opacity=d.width=a),d}function nb(a,b,c){for(var d,e=(qb.tweeners[b]||[]).concat(qb.tweeners["*"]),f=0,g=e.length;g>f;f++){if(d=e[f].call(c,b,a)){return d}}}function ob(a,b,c){var d,e,f,g,h,i,j,k,m=this,o={},p=a.style,q=a.nodeType&&W(a),r=n._data(a,"fxshow");c.queue||(h=n._queueHooks(a,"fx"),null==h.unqueued&&(h.unqueued=0,i=h.empty.fire,h.empty.fire=function(){h.unqueued||i()}),h.unqueued++,m.always(function(){m.always(function(){h.unqueued--,n.queue(a,"fx").length||h.empty.fire()})})),1===a.nodeType&&("height" in b||"width" in b)&&(c.overflow=[p.overflow,p.overflowX,p.overflowY],j=n.css(a,"display"),k="none"===j?n._data(a,"olddisplay")||Ma(a.nodeName):j,"inline"===k&&"none"===n.css(a,"float")&&(l.inlineBlockNeedsLayout&&"inline"!==Ma(a.nodeName)?p.zoom=1:p.display="inline-block")),c.overflow&&(p.overflow="hidden",l.shrinkWrapBlocks()||m.always(function(){p.overflow=c.overflow[0],p.overflowX=c.overflow[1],p.overflowY=c.overflow[2]}));for(d in b){if(e=b[d],jb.exec(e)){if(delete b[d],f=f||"toggle"===e,e===(q?"hide":"show")){if("show"!==e||!r||void 0===r[d]){continue}q=!0}o[d]=r&&r[d]||n.style(a,d)}else{j=void 0}}if(n.isEmptyObject(o)){"inline"===("none"===j?Ma(a.nodeName):j)&&(p.display=j)}else{r?"hidden" in r&&(q=r.hidden):r=n._data(a,"fxshow",{}),f&&(r.hidden=!q),q?n(a).show():m.done(function(){n(a).hide()}),m.done(function(){var b;n._removeData(a,"fxshow");for(b in o){n.style(a,b,o[b])}});for(d in o){g=nb(q?r[d]:0,d,m),d in r||(r[d]=g.start,q&&(g.end=g.start,g.start="width"===d||"height"===d?1:0))}}}function pb(a,b){var c,d,e,f,g;for(c in a){if(d=n.camelCase(c),e=b[d],f=a[c],n.isArray(f)&&(e=f[1],f=a[c]=f[0]),c!==d&&(a[d]=f,delete a[c]),g=n.cssHooks[d],g&&"expand" in g){f=g.expand(f),delete a[d];for(c in f){c in a||(a[c]=f[c],b[c]=e)}}else{b[d]=e}}}function qb(a,b,c){var d,e,f=0,g=qb.prefilters.length,h=n.Deferred().always(function(){delete i.elem}),i=function(){if(e){return !1}for(var b=hb||lb(),c=Math.max(0,j.startTime+j.duration-b),d=c/j.duration||0,f=1-d,g=0,i=j.tweens.length;i>g;g++){j.tweens[g].run(f)}return h.notifyWith(a,[j,f,c]),1>f&&i?c:(h.resolveWith(a,[j]),!1)},j=h.promise({elem:a,props:n.extend({},b),opts:n.extend(!0,{specialEasing:{},easing:n.easing._default},c),originalProperties:b,originalOptions:c,startTime:hb||lb(),duration:c.duration,tweens:[],createTween:function(b,c){var d=n.Tween(a,j.opts,b,c,j.opts.specialEasing[b]||j.opts.easing);return j.tweens.push(d),d},stop:function(b){var c=0,d=b?j.tweens.length:0;if(e){return this}for(e=!0;d>c;c++){j.tweens[c].run(1)}return b?(h.notifyWith(a,[j,1,0]),h.resolveWith(a,[j,b])):h.rejectWith(a,[j,b]),this}}),k=j.props;for(pb(k,j.opts.specialEasing);g>f;f++){if(d=qb.prefilters[f].call(j,a,k,j.opts)){return n.isFunction(d.stop)&&(n._queueHooks(j.elem,j.opts.queue).stop=n.proxy(d.stop,d)),d}}return n.map(k,nb,j),n.isFunction(j.opts.start)&&j.opts.start.call(a,j),n.fx.timer(n.extend(i,{elem:a,anim:j,queue:j.opts.queue})),j.progress(j.opts.progress).done(j.opts.done,j.opts.complete).fail(j.opts.fail).always(j.opts.always)}n.Animation=n.extend(qb,{tweeners:{"*":[function(a,b){var c=this.createTween(a,b);return X(c.elem,a,U.exec(b),c),c}]},tweener:function(a,b){n.isFunction(a)?(b=a,a=["*"]):a=a.match(G);for(var c,d=0,e=a.length;e>d;d++){c=a[d],qb.tweeners[c]=qb.tweeners[c]||[],qb.tweeners[c].unshift(b)}},prefilters:[ob],prefilter:function(a,b){b?qb.prefilters.unshift(a):qb.prefilters.push(a)}}),n.speed=function(a,b,c){var d=a&&"object"==typeof a?n.extend({},a):{complete:c||!c&&b||n.isFunction(a)&&a,duration:a,easing:c&&b||b&&!n.isFunction(b)&&b};return d.duration=n.fx.off?0:"number"==typeof d.duration?d.duration:d.duration in n.fx.speeds?n.fx.speeds[d.duration]:n.fx.speeds._default,null!=d.queue&&d.queue!==!0||(d.queue="fx"),d.old=d.complete,d.complete=function(){n.isFunction(d.old)&&d.old.call(this),d.queue&&n.dequeue(this,d.queue)},d},n.fn.extend({fadeTo:function(a,b,c,d){return this.filter(W).css("opacity",0).show().end().animate({opacity:b},a,c,d)},animate:function(a,b,c,d){var e=n.isEmptyObject(a),f=n.speed(b,c,d),g=function(){var b=qb(this,n.extend({},a),f);(e||n._data(this,"finish"))&&b.stop(!0)};return g.finish=g,e||f.queue===!1?this.each(g):this.queue(f.queue,g)},stop:function(a,b,c){var d=function(a){var b=a.stop;delete a.stop,b(c)};return"string"!=typeof a&&(c=b,b=a,a=void 0),b&&a!==!1&&this.queue(a||"fx",[]),this.each(function(){var b=!0,e=null!=a&&a+"queueHooks",f=n.timers,g=n._data(this);if(e){g[e]&&g[e].stop&&d(g[e])}else{for(e in g){g[e]&&g[e].stop&&kb.test(e)&&d(g[e])}}for(e=f.length;e--;){f[e].elem!==this||null!=a&&f[e].queue!==a||(f[e].anim.stop(c),b=!1,f.splice(e,1))}!b&&c||n.dequeue(this,a)})},finish:function(a){return a!==!1&&(a=a||"fx"),this.each(function(){var b,c=n._data(this),d=c[a+"queue"],e=c[a+"queueHooks"],f=n.timers,g=d?d.length:0;for(c.finish=!0,n.queue(this,a,[]),e&&e.stop&&e.stop.call(this,!0),b=f.length;b--;){f[b].elem===this&&f[b].queue===a&&(f[b].anim.stop(!0),f.splice(b,1))}for(b=0;g>b;b++){d[b]&&d[b].finish&&d[b].finish.call(this)}delete c.finish})}}),n.each(["toggle","show","hide"],function(a,b){var c=n.fn[b];n.fn[b]=function(a,d,e){return null==a||"boolean"==typeof a?c.apply(this,arguments):this.animate(mb(b,!0),a,d,e)}}),n.each({slideDown:mb("show"),slideUp:mb("hide"),slideToggle:mb("toggle"),fadeIn:{opacity:"show"},fadeOut:{opacity:"hide"},fadeToggle:{opacity:"toggle"}},function(a,b){n.fn[a]=function(a,c,d){return this.animate(b,a,c,d)}}),n.timers=[],n.fx.tick=function(){var a,b=n.timers,c=0;for(hb=n.now();c<b.length;c++){a=b[c],a()||b[c]!==a||b.splice(c--,1)}b.length||n.fx.stop(),hb=void 0},n.fx.timer=function(a){n.timers.push(a),a()?n.fx.start():n.timers.pop()},n.fx.interval=13,n.fx.start=function(){ib||(ib=a.setInterval(n.fx.tick,n.fx.interval))},n.fx.stop=function(){a.clearInterval(ib),ib=null},n.fx.speeds={slow:600,fast:200,_default:400},n.fn.delay=function(b,c){return b=n.fx?n.fx.speeds[b]||b:b,c=c||"fx",this.queue(c,function(c,d){var e=a.setTimeout(c,b);d.stop=function(){a.clearTimeout(e)}})},function(){var a,b=d.createElement("input"),c=d.createElement("div"),e=d.createElement("select"),f=e.appendChild(d.createElement("option"));c=d.createElement("div"),c.setAttribute("className","t"),c.innerHTML="  <link/><table></table><a href='/a'>a</a><input type='checkbox'/>",a=c.getElementsByTagName("a")[0],b.setAttribute("type","checkbox"),c.appendChild(b),a=c.getElementsByTagName("a")[0],a.style.cssText="top:1px",l.getSetAttribute="t"!==c.className,l.style=/top/.test(a.getAttribute("style")),l.hrefNormalized="/a"===a.getAttribute("href"),l.checkOn=!!b.value,l.optSelected=f.selected,l.enctype=!!d.createElement("form").enctype,e.disabled=!0,l.optDisabled=!f.disabled,b=d.createElement("input"),b.setAttribute("value",""),l.input=""===b.getAttribute("value"),b.value="t",b.setAttribute("type","radio"),l.radioValue="t"===b.value}();var rb=/\r/g,sb=/[\x20\t\r\n\f]+/g;n.fn.extend({val:function(a){var b,c,d,e=this[0];if(arguments.length){return d=n.isFunction(a),this.each(function(c){var e;1===this.nodeType&&(e=d?a.call(this,c,n(this).val()):a,null==e?e="":"number"==typeof e?e+="":n.isArray(e)&&(e=n.map(e,function(a){return null==a?"":a+""})),b=n.valHooks[this.type]||n.valHooks[this.nodeName.toLowerCase()],b&&"set" in b&&void 0!==b.set(this,e,"value")||(this.value=e))})}if(e){return b=n.valHooks[e.type]||n.valHooks[e.nodeName.toLowerCase()],b&&"get" in b&&void 0!==(c=b.get(e,"value"))?c:(c=e.value,"string"==typeof c?c.replace(rb,""):null==c?"":c)}}}),n.extend({valHooks:{option:{get:function(a){var b=n.find.attr(a,"value");return null!=b?b:n.trim(n.text(a)).replace(sb," ")}},select:{get:function(a){for(var b,c,d=a.options,e=a.selectedIndex,f="select-one"===a.type||0>e,g=f?null:[],h=f?e+1:d.length,i=0>e?h:f?e:0;h>i;i++){if(c=d[i],(c.selected||i===e)&&(l.optDisabled?!c.disabled:null===c.getAttribute("disabled"))&&(!c.parentNode.disabled||!n.nodeName(c.parentNode,"optgroup"))){if(b=n(c).val(),f){return b}g.push(b)}}return g},set:function(a,b){var c,d,e=a.options,f=n.makeArray(b),g=e.length;while(g--){if(d=e[g],n.inArray(n.valHooks.option.get(d),f)>-1){try{d.selected=c=!0}catch(h){d.scrollHeight}}else{d.selected=!1}}return c||(a.selectedIndex=-1),e}}}}),n.each(["radio","checkbox"],function(){n.valHooks[this]={set:function(a,b){return n.isArray(b)?a.checked=n.inArray(n(a).val(),b)>-1:void 0}},l.checkOn||(n.valHooks[this].get=function(a){return null===a.getAttribute("value")?"on":a.value})});var tb,ub,vb=n.expr.attrHandle,wb=/^(?:checked|selected)$/i,xb=l.getSetAttribute,yb=l.input;n.fn.extend({attr:function(a,b){return Y(this,n.attr,a,b,arguments.length>1)},removeAttr:function(a){return this.each(function(){n.removeAttr(this,a)})}}),n.extend({attr:function(a,b,c){var d,e,f=a.nodeType;if(3!==f&&8!==f&&2!==f){return"undefined"==typeof a.getAttribute?n.prop(a,b,c):(1===f&&n.isXMLDoc(a)||(b=b.toLowerCase(),e=n.attrHooks[b]||(n.expr.match.bool.test(b)?ub:tb)),void 0!==c?null===c?void n.removeAttr(a,b):e&&"set" in e&&void 0!==(d=e.set(a,c,b))?d:(a.setAttribute(b,c+""),c):e&&"get" in e&&null!==(d=e.get(a,b))?d:(d=n.find.attr(a,b),null==d?void 0:d))}},attrHooks:{type:{set:function(a,b){if(!l.radioValue&&"radio"===b&&n.nodeName(a,"input")){var c=a.value;return a.setAttribute("type",b),c&&(a.value=c),b}}}},removeAttr:function(a,b){var c,d,e=0,f=b&&b.match(G);if(f&&1===a.nodeType){while(c=f[e++]){d=n.propFix[c]||c,n.expr.match.bool.test(c)?yb&&xb||!wb.test(c)?a[d]=!1:a[n.camelCase("default-"+c)]=a[d]=!1:n.attr(a,c,""),a.removeAttribute(xb?c:d)}}}}),ub={set:function(a,b,c){return b===!1?n.removeAttr(a,c):yb&&xb||!wb.test(c)?a.setAttribute(!xb&&n.propFix[c]||c,c):a[n.camelCase("default-"+c)]=a[c]=!0,c}},n.each(n.expr.match.bool.source.match(/\w+/g),function(a,b){var c=vb[b]||n.find.attr;yb&&xb||!wb.test(b)?vb[b]=function(a,b,d){var e,f;return d||(f=vb[b],vb[b]=e,e=null!=c(a,b,d)?b.toLowerCase():null,vb[b]=f),e}:vb[b]=function(a,b,c){return c?void 0:a[n.camelCase("default-"+b)]?b.toLowerCase():null}}),yb&&xb||(n.attrHooks.value={set:function(a,b,c){return n.nodeName(a,"input")?void (a.defaultValue=b):tb&&tb.set(a,b,c)}}),xb||(tb={set:function(a,b,c){var d=a.getAttributeNode(c);return d||a.setAttributeNode(d=a.ownerDocument.createAttribute(c)),d.value=b+="","value"===c||b===a.getAttribute(c)?b:void 0}},vb.id=vb.name=vb.coords=function(a,b,c){var d;return c?void 0:(d=a.getAttributeNode(b))&&""!==d.value?d.value:null},n.valHooks.button={get:function(a,b){var c=a.getAttributeNode(b);return c&&c.specified?c.value:void 0},set:tb.set},n.attrHooks.contenteditable={set:function(a,b,c){tb.set(a,""===b?!1:b,c)}},n.each(["width","height"],function(a,b){n.attrHooks[b]={set:function(a,c){return""===c?(a.setAttribute(b,"auto"),c):void 0}}})),l.style||(n.attrHooks.style={get:function(a){return a.style.cssText||void 0},set:function(a,b){return a.style.cssText=b+""}});var zb=/^(?:input|select|textarea|button|object)$/i,Ab=/^(?:a|area)$/i;n.fn.extend({prop:function(a,b){return Y(this,n.prop,a,b,arguments.length>1)},removeProp:function(a){return a=n.propFix[a]||a,this.each(function(){try{this[a]=void 0,delete this[a]}catch(b){}})}}),n.extend({prop:function(a,b,c){var d,e,f=a.nodeType;if(3!==f&&8!==f&&2!==f){return 1===f&&n.isXMLDoc(a)||(b=n.propFix[b]||b,e=n.propHooks[b]),void 0!==c?e&&"set" in e&&void 0!==(d=e.set(a,c,b))?d:a[b]=c:e&&"get" in e&&null!==(d=e.get(a,b))?d:a[b]}},propHooks:{tabIndex:{get:function(a){var b=n.find.attr(a,"tabindex");return b?parseInt(b,10):zb.test(a.nodeName)||Ab.test(a.nodeName)&&a.href?0:-1}}},propFix:{"for":"htmlFor","class":"className"}}),l.hrefNormalized||n.each(["href","src"],function(a,b){n.propHooks[b]={get:function(a){return a.getAttribute(b,4)}}}),l.optSelected||(n.propHooks.selected={get:function(a){var b=a.parentNode;return b&&(b.selectedIndex,b.parentNode&&b.parentNode.selectedIndex),null},set:function(a){var b=a.parentNode;b&&(b.selectedIndex,b.parentNode&&b.parentNode.selectedIndex)}}),n.each(["tabIndex","readOnly","maxLength","cellSpacing","cellPadding","rowSpan","colSpan","useMap","frameBorder","contentEditable"],function(){n.propFix[this.toLowerCase()]=this}),l.enctype||(n.propFix.enctype="encoding");var Bb=/[\t\r\n\f]/g;function Cb(a){return n.attr(a,"class")||""}n.fn.extend({addClass:function(a){var b,c,d,e,f,g,h,i=0;if(n.isFunction(a)){return this.each(function(b){n(this).addClass(a.call(this,b,Cb(this)))})}if("string"==typeof a&&a){b=a.match(G)||[];while(c=this[i++]){if(e=Cb(c),d=1===c.nodeType&&(" "+e+" ").replace(Bb," ")){g=0;while(f=b[g++]){d.indexOf(" "+f+" ")<0&&(d+=f+" ")}h=n.trim(d),e!==h&&n.attr(c,"class",h)}}}return this},removeClass:function(a){var b,c,d,e,f,g,h,i=0;if(n.isFunction(a)){return this.each(function(b){n(this).removeClass(a.call(this,b,Cb(this)))})}if(!arguments.length){return this.attr("class","")}if("string"==typeof a&&a){b=a.match(G)||[];while(c=this[i++]){if(e=Cb(c),d=1===c.nodeType&&(" "+e+" ").replace(Bb," ")){g=0;while(f=b[g++]){while(d.indexOf(" "+f+" ")>-1){d=d.replace(" "+f+" "," ")}}h=n.trim(d),e!==h&&n.attr(c,"class",h)}}}return this},toggleClass:function(a,b){var c=typeof a;return"boolean"==typeof b&&"string"===c?b?this.addClass(a):this.removeClass(a):n.isFunction(a)?this.each(function(c){n(this).toggleClass(a.call(this,c,Cb(this),b),b)}):this.each(function(){var b,d,e,f;if("string"===c){d=0,e=n(this),f=a.match(G)||[];while(b=f[d++]){e.hasClass(b)?e.removeClass(b):e.addClass(b)}}else{void 0!==a&&"boolean"!==c||(b=Cb(this),b&&n._data(this,"__className__",b),n.attr(this,"class",b||a===!1?"":n._data(this,"__className__")||""))}})},hasClass:function(a){var b,c,d=0;b=" "+a+" ";while(c=this[d++]){if(1===c.nodeType&&(" "+Cb(c)+" ").replace(Bb," ").indexOf(b)>-1){return !0}}return !1}}),n.each("blur focus focusin focusout load resize scroll unload click dblclick mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave change select submit keydown keypress keyup error contextmenu".split(" "),function(a,b){n.fn[b]=function(a,c){return arguments.length>0?this.on(b,null,a,c):this.trigger(b)}}),n.fn.extend({hover:function(a,b){return this.mouseenter(a).mouseleave(b||a)}});var Db=a.location,Eb=n.now(),Fb=/\?/,Gb=/(,)|(\[|{)|(}|])|"(?:[^"\\\r\n]|\\["\\\/bfnrt]|\\u[\da-fA-F]{4})*"\s*:?|true|false|null|-?(?!0\d)\d+(?:\.\d+|)(?:[eE][+-]?\d+|)/g;n.parseJSON=function(b){if(a.JSON&&a.JSON.parse){return a.JSON.parse(b+"")}var c,d=null,e=n.trim(b+"");return e&&!n.trim(e.replace(Gb,function(a,b,e,f){return c&&b&&(d=0),0===d?a:(c=e||b,d+=!f-!e,"")}))?Function("return "+e)():n.error("Invalid JSON: "+b)},n.parseXML=function(b){var c,d;if(!b||"string"!=typeof b){return null}try{a.DOMParser?(d=new a.DOMParser,c=d.parseFromString(b,"text/xml")):(c=new a.ActiveXObject("Microsoft.XMLDOM"),c.async="false",c.loadXML(b))}catch(e){c=void 0}return c&&c.documentElement&&!c.getElementsByTagName("parsererror").length||n.error("Invalid XML: "+b),c};var Hb=/#.*$/,Ib=/([?&])_=[^&]*/,Jb=/^(.*?):[ \t]*([^\r\n]*)\r?$/gm,Kb=/^(?:about|app|app-storage|.+-extension|file|res|widget):$/,Lb=/^(?:GET|HEAD)$/,Mb=/^\/\//,Nb=/^([\w.+-]+:)(?:\/\/(?:[^\/?#]*@|)([^\/?#:]*)(?::(\d+)|)|)/,Ob={},Pb={},Qb="*/".concat("*"),Rb=Db.href,Sb=Nb.exec(Rb.toLowerCase())||[];function Tb(a){return function(b,c){"string"!=typeof b&&(c=b,b="*");var d,e=0,f=b.toLowerCase().match(G)||[];if(n.isFunction(c)){while(d=f[e++]){"+"===d.charAt(0)?(d=d.slice(1)||"*",(a[d]=a[d]||[]).unshift(c)):(a[d]=a[d]||[]).push(c)}}}}function Ub(a,b,c,d){var e={},f=a===Pb;function g(h){var i;return e[h]=!0,n.each(a[h]||[],function(a,h){var j=h(b,c,d);return"string"!=typeof j||f||e[j]?f?!(i=j):void 0:(b.dataTypes.unshift(j),g(j),!1)}),i}return g(b.dataTypes[0])||!e["*"]&&g("*")}function Vb(a,b){var c,d,e=n.ajaxSettings.flatOptions||{};for(d in b){void 0!==b[d]&&((e[d]?a:c||(c={}))[d]=b[d])}return c&&n.extend(!0,a,c),a}function Wb(a,b,c){var d,e,f,g,h=a.contents,i=a.dataTypes;while("*"===i[0]){i.shift(),void 0===e&&(e=a.mimeType||b.getResponseHeader("Content-Type"))}if(e){for(g in h){if(h[g]&&h[g].test(e)){i.unshift(g);break}}}if(i[0] in c){f=i[0]}else{for(g in c){if(!i[0]||a.converters[g+" "+i[0]]){f=g;break}d||(d=g)}f=f||d}return f?(f!==i[0]&&i.unshift(f),c[f]):void 0}function Xb(a,b,c,d){var e,f,g,h,i,j={},k=a.dataTypes.slice();if(k[1]){for(g in a.converters){j[g.toLowerCase()]=a.converters[g]}}f=k.shift();while(f){if(a.responseFields[f]&&(c[a.responseFields[f]]=b),!i&&d&&a.dataFilter&&(b=a.dataFilter(b,a.dataType)),i=f,f=k.shift()){if("*"===f){f=i}else{if("*"!==i&&i!==f){if(g=j[i+" "+f]||j["* "+f],!g){for(e in j){if(h=e.split(" "),h[1]===f&&(g=j[i+" "+h[0]]||j["* "+h[0]])){g===!0?g=j[e]:j[e]!==!0&&(f=h[0],k.unshift(h[1]));break}}}if(g!==!0){if(g&&a["throws"]){b=g(b)}else{try{b=g(b)}catch(l){return{state:"parsererror",error:g?l:"No conversion from "+i+" to "+f}}}}}}}}return{state:"success",data:b}}n.extend({active:0,lastModified:{},etag:{},ajaxSettings:{url:Rb,type:"GET",isLocal:Kb.test(Sb[1]),global:!0,processData:!0,async:!0,contentType:"application/x-www-form-urlencoded; charset=UTF-8",accepts:{"*":Qb,text:"text/plain",html:"text/html",xml:"application/xml, text/xml",json:"application/json, text/javascript"},contents:{xml:/\bxml\b/,html:/\bhtml/,json:/\bjson\b/},responseFields:{xml:"responseXML",text:"responseText",json:"responseJSON"},converters:{"* text":String,"text html":!0,"text json":n.parseJSON,"text xml":n.parseXML},flatOptions:{url:!0,context:!0}},ajaxSetup:function(a,b){return b?Vb(Vb(a,n.ajaxSettings),b):Vb(n.ajaxSettings,a)},ajaxPrefilter:Tb(Ob),ajaxTransport:Tb(Pb),ajax:function(b,c){"object"==typeof b&&(c=b,b=void 0),c=c||{};var d,e,f,g,h,i,j,k,l=n.ajaxSetup({},c),m=l.context||l,o=l.context&&(m.nodeType||m.jquery)?n(m):n.event,p=n.Deferred(),q=n.Callbacks("once memory"),r=l.statusCode||{},s={},t={},u=0,v="canceled",w={readyState:0,getResponseHeader:function(a){var b;if(2===u){if(!k){k={};while(b=Jb.exec(g)){k[b[1].toLowerCase()]=b[2]}}b=k[a.toLowerCase()]}return null==b?null:b},getAllResponseHeaders:function(){return 2===u?g:null},setRequestHeader:function(a,b){var c=a.toLowerCase();return u||(a=t[c]=t[c]||a,s[a]=b),this},overrideMimeType:function(a){return u||(l.mimeType=a),this},statusCode:function(a){var b;if(a){if(2>u){for(b in a){r[b]=[r[b],a[b]]}}else{w.always(a[w.status])}}return this},abort:function(a){var b=a||v;return j&&j.abort(b),y(0,b),this}};if(p.promise(w).complete=q.add,w.success=w.done,w.error=w.fail,l.url=((b||l.url||Rb)+"").replace(Hb,"").replace(Mb,Sb[1]+"//"),l.type=c.method||c.type||l.method||l.type,l.dataTypes=n.trim(l.dataType||"*").toLowerCase().match(G)||[""],null==l.crossDomain&&(d=Nb.exec(l.url.toLowerCase()),l.crossDomain=!(!d||d[1]===Sb[1]&&d[2]===Sb[2]&&(d[3]||("http:"===d[1]?"80":"443"))===(Sb[3]||("http:"===Sb[1]?"80":"443")))),l.data&&l.processData&&"string"!=typeof l.data&&(l.data=n.param(l.data,l.traditional)),Ub(Ob,l,c,w),2===u){return w}i=n.event&&l.global,i&&0===n.active++&&n.event.trigger("ajaxStart"),l.type=l.type.toUpperCase(),l.hasContent=!Lb.test(l.type),f=l.url,l.hasContent||(l.data&&(f=l.url+=(Fb.test(f)?"&":"?")+l.data,delete l.data),l.cache===!1&&(l.url=Ib.test(f)?f.replace(Ib,"$1_="+Eb++):f+(Fb.test(f)?"&":"?")+"_="+Eb++)),l.ifModified&&(n.lastModified[f]&&w.setRequestHeader("If-Modified-Since",n.lastModified[f]),n.etag[f]&&w.setRequestHeader("If-None-Match",n.etag[f])),(l.data&&l.hasContent&&l.contentType!==!1||c.contentType)&&w.setRequestHeader("Content-Type",l.contentType),w.setRequestHeader("Accept",l.dataTypes[0]&&l.accepts[l.dataTypes[0]]?l.accepts[l.dataTypes[0]]+("*"!==l.dataTypes[0]?", "+Qb+"; q=0.01":""):l.accepts["*"]);for(e in l.headers){w.setRequestHeader(e,l.headers[e])}if(l.beforeSend&&(l.beforeSend.call(m,w,l)===!1||2===u)){return w.abort()}v="abort";for(e in {success:1,error:1,complete:1}){w[e](l[e])}if(j=Ub(Pb,l,c,w)){if(w.readyState=1,i&&o.trigger("ajaxSend",[w,l]),2===u){return w}l.async&&l.timeout>0&&(h=a.setTimeout(function(){w.abort("timeout")},l.timeout));try{u=1,j.send(s,y)}catch(x){if(!(2>u)){throw x}y(-1,x)}}else{y(-1,"No Transport")}function y(b,c,d,e){var k,s,t,v,x,y=c;2!==u&&(u=2,h&&a.clearTimeout(h),j=void 0,g=e||"",w.readyState=b>0?4:0,k=b>=200&&300>b||304===b,d&&(v=Wb(l,w,d)),v=Xb(l,v,w,k),k?(l.ifModified&&(x=w.getResponseHeader("Last-Modified"),x&&(n.lastModified[f]=x),x=w.getResponseHeader("etag"),x&&(n.etag[f]=x)),204===b||"HEAD"===l.type?y="nocontent":304===b?y="notmodified":(y=v.state,s=v.data,t=v.error,k=!t)):(t=y,!b&&y||(y="error",0>b&&(b=0))),w.status=b,w.statusText=(c||y)+"",k?p.resolveWith(m,[s,y,w]):p.rejectWith(m,[w,y,t]),w.statusCode(r),r=void 0,i&&o.trigger(k?"ajaxSuccess":"ajaxError",[w,l,k?s:t]),q.fireWith(m,[w,y]),i&&(o.trigger("ajaxComplete",[w,l]),--n.active||n.event.trigger("ajaxStop")))}return w},getJSON:function(a,b,c){return n.get(a,b,c,"json")},getScript:function(a,b){return n.get(a,void 0,b,"script")}}),n.each(["get","post"],function(a,b){n[b]=function(a,c,d,e){return n.isFunction(c)&&(e=e||d,d=c,c=void 0),n.ajax(n.extend({url:a,type:b,dataType:e,data:c,success:d},n.isPlainObject(a)&&a))}}),n._evalUrl=function(a){return n.ajax({url:a,type:"GET",dataType:"script",cache:!0,async:!1,global:!1,"throws":!0})},n.fn.extend({wrapAll:function(a){if(n.isFunction(a)){return this.each(function(b){n(this).wrapAll(a.call(this,b))})}if(this[0]){var b=n(a,this[0].ownerDocument).eq(0).clone(!0);this[0].parentNode&&b.insertBefore(this[0]),b.map(function(){var a=this;while(a.firstChild&&1===a.firstChild.nodeType){a=a.firstChild}return a}).append(this)}return this},wrapInner:function(a){return n.isFunction(a)?this.each(function(b){n(this).wrapInner(a.call(this,b))}):this.each(function(){var b=n(this),c=b.contents();c.length?c.wrapAll(a):b.append(a)})},wrap:function(a){var b=n.isFunction(a);return this.each(function(c){n(this).wrapAll(b?a.call(this,c):a)})},unwrap:function(){return this.parent().each(function(){n.nodeName(this,"body")||n(this).replaceWith(this.childNodes)}).end()}});function Yb(a){return a.style&&a.style.display||n.css(a,"display")}function Zb(a){if(!n.contains(a.ownerDocument||d,a)){return !0}while(a&&1===a.nodeType){if("none"===Yb(a)||"hidden"===a.type){return !0}a=a.parentNode}return !1}n.expr.filters.hidden=function(a){return l.reliableHiddenOffsets()?a.offsetWidth<=0&&a.offsetHeight<=0&&!a.getClientRects().length:Zb(a)},n.expr.filters.visible=function(a){return !n.expr.filters.hidden(a)};var $b=/%20/g,_b=/\[\]$/,ac=/\r?\n/g,bc=/^(?:submit|button|image|reset|file)$/i,cc=/^(?:input|select|textarea|keygen)/i;function dc(a,b,c,d){var e;if(n.isArray(b)){n.each(b,function(b,e){c||_b.test(a)?d(a,e):dc(a+"["+("object"==typeof e&&null!=e?b:"")+"]",e,c,d)})}else{if(c||"object"!==n.type(b)){d(a,b)}else{for(e in b){dc(a+"["+e+"]",b[e],c,d)}}}}n.param=function(a,b){var c,d=[],e=function(a,b){b=n.isFunction(b)?b():null==b?"":b,d[d.length]=encodeURIComponent(a)+"="+encodeURIComponent(b)};if(void 0===b&&(b=n.ajaxSettings&&n.ajaxSettings.traditional),n.isArray(a)||a.jquery&&!n.isPlainObject(a)){n.each(a,function(){e(this.name,this.value)})}else{for(c in a){dc(c,a[c],b,e)}}return d.join("&").replace($b,"+")},n.fn.extend({serialize:function(){return n.param(this.serializeArray())},serializeArray:function(){return this.map(function(){var a=n.prop(this,"elements");return a?n.makeArray(a):this}).filter(function(){var a=this.type;return this.name&&!n(this).is(":disabled")&&cc.test(this.nodeName)&&!bc.test(a)&&(this.checked||!Z.test(a))}).map(function(a,b){var c=n(this).val();return null==c?null:n.isArray(c)?n.map(c,function(a){return{name:b.name,value:a.replace(ac,"\r\n")}}):{name:b.name,value:c.replace(ac,"\r\n")}}).get()}}),n.ajaxSettings.xhr=void 0!==a.ActiveXObject?function(){return this.isLocal?ic():d.documentMode>8?hc():/^(get|post|head|put|delete|options)$/i.test(this.type)&&hc()||ic()}:hc;var ec=0,fc={},gc=n.ajaxSettings.xhr();a.attachEvent&&a.attachEvent("onunload",function(){for(var a in fc){fc[a](void 0,!0)}}),l.cors=!!gc&&"withCredentials" in gc,gc=l.ajax=!!gc,gc&&n.ajaxTransport(function(b){if(!b.crossDomain||l.cors){var c;return{send:function(d,e){var f,g=b.xhr(),h=++ec;if(g.open(b.type,b.url,b.async,b.username,b.password),b.xhrFields){for(f in b.xhrFields){g[f]=b.xhrFields[f]}}b.mimeType&&g.overrideMimeType&&g.overrideMimeType(b.mimeType),b.crossDomain||d["X-Requested-With"]||(d["X-Requested-With"]="XMLHttpRequest");for(f in d){void 0!==d[f]&&g.setRequestHeader(f,d[f]+"")}g.send(b.hasContent&&b.data||null),c=function(a,d){var f,i,j;if(c&&(d||4===g.readyState)){if(delete fc[h],c=void 0,g.onreadystatechange=n.noop,d){4!==g.readyState&&g.abort()}else{j={},f=g.status,"string"==typeof g.responseText&&(j.text=g.responseText);try{i=g.statusText}catch(k){i=""}f||!b.isLocal||b.crossDomain?1223===f&&(f=204):f=j.text?200:404}}j&&e(f,i,j,g.getAllResponseHeaders())},b.async?4===g.readyState?a.setTimeout(c):g.onreadystatechange=fc[h]=c:c()},abort:function(){c&&c(void 0,!0)}}}});function hc(){try{return new a.XMLHttpRequest}catch(b){}}function ic(){try{return new a.ActiveXObject("Microsoft.XMLHTTP")}catch(b){}}n.ajaxSetup({accepts:{script:"text/javascript, application/javascript, application/ecmascript, application/x-ecmascript"},contents:{script:/\b(?:java|ecma)script\b/},converters:{"text script":function(a){return n.globalEval(a),a}}}),n.ajaxPrefilter("script",function(a){void 0===a.cache&&(a.cache=!1),a.crossDomain&&(a.type="GET",a.global=!1)}),n.ajaxTransport("script",function(a){if(a.crossDomain){var b,c=d.head||n("head")[0]||d.documentElement;return{send:function(e,f){b=d.createElement("script"),b.async=!0,a.scriptCharset&&(b.charset=a.scriptCharset),b.src=a.url,b.onload=b.onreadystatechange=function(a,c){(c||!b.readyState||/loaded|complete/.test(b.readyState))&&(b.onload=b.onreadystatechange=null,b.parentNode&&b.parentNode.removeChild(b),b=null,c||f(200,"success"))},c.insertBefore(b,c.firstChild)},abort:function(){b&&b.onload(void 0,!0)}}}});var jc=[],kc=/(=)\?(?=&|$)|\?\?/;n.ajaxSetup({jsonp:"callback",jsonpCallback:function(){var a=jc.pop()||n.expando+"_"+Eb++;return this[a]=!0,a}}),n.ajaxPrefilter("json jsonp",function(b,c,d){var e,f,g,h=b.jsonp!==!1&&(kc.test(b.url)?"url":"string"==typeof b.data&&0===(b.contentType||"").indexOf("application/x-www-form-urlencoded")&&kc.test(b.data)&&"data");return h||"jsonp"===b.dataTypes[0]?(e=b.jsonpCallback=n.isFunction(b.jsonpCallback)?b.jsonpCallback():b.jsonpCallback,h?b[h]=b[h].replace(kc,"$1"+e):b.jsonp!==!1&&(b.url+=(Fb.test(b.url)?"&":"?")+b.jsonp+"="+e),b.converters["script json"]=function(){return g||n.error(e+" was not called"),g[0]},b.dataTypes[0]="json",f=a[e],a[e]=function(){g=arguments},d.always(function(){void 0===f?n(a).removeProp(e):a[e]=f,b[e]&&(b.jsonpCallback=c.jsonpCallback,jc.push(e)),g&&n.isFunction(f)&&f(g[0]),g=f=void 0}),"script"):void 0}),n.parseHTML=function(a,b,c){if(!a||"string"!=typeof a){return null}"boolean"==typeof b&&(c=b,b=!1),b=b||d;var e=x.exec(a),f=!c&&[];return e?[b.createElement(e[1])]:(e=ja([a],b,f),f&&f.length&&n(f).remove(),n.merge([],e.childNodes))};var lc=n.fn.load;n.fn.load=function(a,b,c){if("string"!=typeof a&&lc){return lc.apply(this,arguments)}var d,e,f,g=this,h=a.indexOf(" ");return h>-1&&(d=n.trim(a.slice(h,a.length)),a=a.slice(0,h)),n.isFunction(b)?(c=b,b=void 0):b&&"object"==typeof b&&(e="POST"),g.length>0&&n.ajax({url:a,type:e||"GET",dataType:"html",data:b}).done(function(a){f=arguments,g.html(d?n("<div>").append(n.parseHTML(a)).find(d):a)}).always(c&&function(a,b){g.each(function(){c.apply(this,f||[a.responseText,b,a])})}),this},n.each(["ajaxStart","ajaxStop","ajaxComplete","ajaxError","ajaxSuccess","ajaxSend"],function(a,b){n.fn[b]=function(a){return this.on(b,a)}}),n.expr.filters.animated=function(a){return n.grep(n.timers,function(b){return a===b.elem}).length};function mc(a){return n.isWindow(a)?a:9===a.nodeType?a.defaultView||a.parentWindow:!1}n.offset={setOffset:function(a,b,c){var d,e,f,g,h,i,j,k=n.css(a,"position"),l=n(a),m={};"static"===k&&(a.style.position="relative"),h=l.offset(),f=n.css(a,"top"),i=n.css(a,"left"),j=("absolute"===k||"fixed"===k)&&n.inArray("auto",[f,i])>-1,j?(d=l.position(),g=d.top,e=d.left):(g=parseFloat(f)||0,e=parseFloat(i)||0),n.isFunction(b)&&(b=b.call(a,c,n.extend({},h))),null!=b.top&&(m.top=b.top-h.top+g),null!=b.left&&(m.left=b.left-h.left+e),"using" in b?b.using.call(a,m):l.css(m)}},n.fn.extend({offset:function(a){if(arguments.length){return void 0===a?this:this.each(function(b){n.offset.setOffset(this,a,b)})}var b,c,d={top:0,left:0},e=this[0],f=e&&e.ownerDocument;if(f){return b=f.documentElement,n.contains(b,e)?("undefined"!=typeof e.getBoundingClientRect&&(d=e.getBoundingClientRect()),c=mc(f),{top:d.top+(c.pageYOffset||b.scrollTop)-(b.clientTop||0),left:d.left+(c.pageXOffset||b.scrollLeft)-(b.clientLeft||0)}):d}},position:function(){if(this[0]){var a,b,c={top:0,left:0},d=this[0];return"fixed"===n.css(d,"position")?b=d.getBoundingClientRect():(a=this.offsetParent(),b=this.offset(),n.nodeName(a[0],"html")||(c=a.offset()),c.top+=n.css(a[0],"borderTopWidth",!0),c.left+=n.css(a[0],"borderLeftWidth",!0)),{top:b.top-c.top-n.css(d,"marginTop",!0),left:b.left-c.left-n.css(d,"marginLeft",!0)}}},offsetParent:function(){return this.map(function(){var a=this.offsetParent;while(a&&!n.nodeName(a,"html")&&"static"===n.css(a,"position")){a=a.offsetParent}return a||Qa})}}),n.each({scrollLeft:"pageXOffset",scrollTop:"pageYOffset"},function(a,b){var c=/Y/.test(b);n.fn[a]=function(d){return Y(this,function(a,d,e){var f=mc(a);return void 0===e?f?b in f?f[b]:f.document.documentElement[d]:a[d]:void (f?f.scrollTo(c?n(f).scrollLeft():e,c?e:n(f).scrollTop()):a[d]=e)},a,d,arguments.length,null)}}),n.each(["top","left"],function(a,b){n.cssHooks[b]=Ua(l.pixelPosition,function(a,c){return c?(c=Sa(a,b),Oa.test(c)?n(a).position()[b]+"px":c):void 0})}),n.each({Height:"height",Width:"width"},function(a,b){n.each({padding:"inner"+a,content:b,"":"outer"+a},function(c,d){n.fn[d]=function(d,e){var f=arguments.length&&(c||"boolean"!=typeof d),g=c||(d===!0||e===!0?"margin":"border");return Y(this,function(b,c,d){var e;return n.isWindow(b)?b.document.documentElement["client"+a]:9===b.nodeType?(e=b.documentElement,Math.max(b.body["scroll"+a],e["scroll"+a],b.body["offset"+a],e["offset"+a],e["client"+a])):void 0===d?n.css(b,c,g):n.style(b,c,d,g)},b,f?d:void 0,f,null)}})}),n.fn.extend({bind:function(a,b,c){return this.on(a,null,b,c)},unbind:function(a,b){return this.off(a,null,b)},delegate:function(a,b,c,d){return this.on(b,a,c,d)},undelegate:function(a,b,c){return 1===arguments.length?this.off(a,"**"):this.off(b,a||"**",c)}}),n.fn.size=function(){return this.length},n.fn.andSelf=n.fn.addBack,"function"==typeof define&&define.amd&&define("jquery",[],function(){return n});var nc=a.jQuery,oc=a.$;return n.noConflict=function(b){return a.$===n&&(a.$=oc),b&&a.jQuery===n&&(a.jQuery=nc),n},b||(a.jQuery=a.$=n),n});!function(a,d){if("object"==typeof exports&&"object"==typeof module){module.exports=d(require("jQuery"))}else{if("function"==typeof define&&define.amd){define(["jQuery"],d)}else{var c=d("object"==typeof exports?require("jQuery"):a.jQuery);for(var b in c){("object"==typeof exports?exports:a)[b]=c[b]}}}}(this,function(a){return function(b){function d(e){if(c[e]){return c[e].exports}var f=c[e]={exports:{},id:e,loaded:!1};return b[e].call(f.exports,f,f.exports,d),f.loaded=!0,f.exports}var c={};return d.m=b,d.c=c,d.p="",d(0)}([function(b,d,c){b.exports=c(1)},function(b,d,c){(function(f){function i(k){return k&&k.__esModule?k:{"default":k}}var g="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(k){return typeof k}:function(k){return k&&"function"==typeof Symbol&&k.constructor===Symbol?"symbol":typeof k},h=c(3),j=i(h);f.ajaxTransport("+*",function(m,k,l){if(m.crossDomain&&(document.addEventListener||document.querySelector)&&!window.atob&&window.XDomainRequest){var e=function(){var u=new XDomainRequest,t=m.type.toUpperCase(),w=m.contentType||k.contentType,o=m.url.substring(0,m.url.indexOf(":")).toUpperCase(),q=m.url,r=k.data||{},v=function(p,n){return{send:function(s,x){x(-1,j["default"].get(p,n))},abort:f.noop}};return u?k.forceMethod||-1!==f.inArray(t,["GET","POST"])?-1===f.inArray(o,["HTTP","HTTPS"])?{v:v(3,o)}:o!==location.protocol.substring(0,location.protocol.indexOf(":")).toUpperCase()?{v:v(4)}:(k.forceMethod&&("HEAD"===t&&(t="GET",q+=(-1===m.url.indexOf("?")?"?":"&")+"__method="+t),-1!==f.inArray(t,["PUT","DELETE","PATCH"])&&(t="POST",f.isPlainObject(r)?r.__method=t:"string"==typeof r&&(r+=(r.length?"&":"")+"__method="+t))),k.forceContentType&&("GET"===t&&(q+=(-1===m.url.indexOf("?")?"?":"&")+"__contentType="+encodeURIComponent(w)),"POST"===t&&(f.isPlainObject(r)?r.__contentType=w:"string"==typeof r&&(r+=(r.length?"&":"")+f.param({__contentType:w})))),m.timeout&&(u.timeout=m.timeout),u.onprogress=f.noop,{v:{send:function(p,n){u.onload=function(){var y={},z=null;switch(m.dataType){case"json":try{y.json=f.parseJSON(u.responseText)}catch(x){z=x.message}break;case"xml":try{y.xml=f.parseXML(u.responseText)}catch(x){z=x.message}break;case"text":y.text=u.responseText;break;case"html":y.html=u.responseText}if(z){return n(500,j["default"].get(6,z))}var A=["Content-Type: "+u.contentType,"Content-Length: "+u.responseText.length];n(200,"OK",y,A.join("\r\n"))},u.onerror=function(){n(500,j["default"].get(7))},u.ontimeout=function(){n(500,j["default"].get(8))},k.__test===!0&&(l.__method=t,l.__uri=q),u.open(t,q),setTimeout(function(){u.send("POST"===t?"string"==typeof r?r:f.isPlainObject(r)?f.param(r):null:null)},0)},abort:function(){u.abort()}}}):{v:v(2,t)}:{v:v(1)}}();if("object"===("undefined"==typeof e?"undefined":g(e))){return e.v}}})}).call(d,c(2))},function(c,b){c.exports=a},function(b,c){b.exports={get:function(d,g){var f={0:"Unknown Error",1:"No Transport",2:g+" Method Not Allowed",3:g+" Scheme Not Supported",4:"URI source and target scheme must be the same",5:"No Data",6:"Bad Data: "+g,7:"Network Error",8:"Timeout"};return f[d in f?d:0]}}}])});/*
* Bootstrap v3.3.6 (http://getbootstrap.com)
* Copyright 2011-2015 Twitter, Inc.
* Licensed under the MIT license
*/
if("undefined"==typeof jQuery){throw new Error("Bootstrap's JavaScript requires jQuery")}+function(c){var d=c.fn.jquery.split(" ")[0].split(".");if(d[0]<2&&d[1]<9||1==d[0]&&9==d[1]&&d[2]<1||d[0]>2){throw new Error("Bootstrap's JavaScript requires jQuery version 1.9.1 or higher, but lower than version 3")}}(jQuery),+function(c){function d(){var e=document.createElement("bootstrap"),f={WebkitTransition:"webkitTransitionEnd",MozTransition:"transitionend",OTransition:"oTransitionEnd otransitionend",transition:"transitionend"};for(var g in f){if(void 0!==e.style[g]){return{end:f[g]}}}return !1}c.fn.emulateTransitionEnd=function(a){var f=!1,g=this;c(this).one("bsTransitionEnd",function(){f=!0});var h=function(){f||c(g).trigger(c.support.transition.end)};return setTimeout(h,a),this},c(function(){c.support.transition=d(),c.support.transition&&(c.event.special.bsTransitionEnd={bindType:c.support.transition.end,delegateType:c.support.transition.end,handle:function(a){return c(a.target).is(this)?a.handleObj.handler.apply(this,arguments):void 0}})})}(jQuery),+function(f){function g(a){return this.each(function(){var b=f(this),d=b.data("bs.alert");d||b.data("bs.alert",d=new i(this)),"string"==typeof a&&d[a].call(b)})}var h='[data-dismiss="alert"]',i=function(a){f(a).on("click",h,this.close)};i.VERSION="3.3.6",i.TRANSITION_DURATION=150,i.prototype.close=function(a){function d(){m.detach().trigger("closed.bs.alert").remove()}var k=f(this),l=k.attr("data-target");l||(l=k.attr("href"),l=l&&l.replace(/.*(?=#[^\s]*$)/,""));var m=f(l);a&&a.preventDefault(),m.length||(m=k.closest(".alert")),m.trigger(a=f.Event("close.bs.alert")),a.isDefaultPrevented()||(m.removeClass("in"),f.support.transition&&m.hasClass("fade")?m.one("bsTransitionEnd",d).emulateTransitionEnd(i.TRANSITION_DURATION):d())};var j=f.fn.alert;f.fn.alert=g,f.fn.alert.Constructor=i,f.fn.alert.noConflict=function(){return f.fn.alert=j,this},f(document).on("click.bs.alert.data-api",h,i.prototype.close)}(jQuery),+function(e){function f(a){return this.each(function(){var b=e(this),c=b.data("bs.button"),i="object"==typeof a&&a;c||b.data("bs.button",c=new g(this,i)),"toggle"==a?c.toggle():a&&c.setState(a)})}var g=function(a,c){this.$element=e(a),this.options=e.extend({},g.DEFAULTS,c),this.isLoading=!1};g.VERSION="3.3.6",g.DEFAULTS={loadingText:"loading..."},g.prototype.setState=function(a){var i="disabled",j=this.$element,k=j.is("input")?"val":"html",l=j.data();a+="Text",null==l.resetText&&j.data("resetText",j[k]()),setTimeout(e.proxy(function(){j[k](null==l[a]?this.options[a]:l[a]),"loadingText"==a?(this.isLoading=!0,j.addClass(i).attr(i,i)):this.isLoading&&(this.isLoading=!1,j.removeClass(i).removeAttr(i))},this),0)},g.prototype.toggle=function(){var d=!0,i=this.$element.closest('[data-toggle="buttons"]');if(i.length){var j=this.$element.find("input");"radio"==j.prop("type")?(j.prop("checked")&&(d=!1),i.find(".active").removeClass("active"),this.$element.addClass("active")):"checkbox"==j.prop("type")&&(j.prop("checked")!==this.$element.hasClass("active")&&(d=!1),this.$element.toggleClass("active")),j.prop("checked",this.$element.hasClass("active")),d&&j.trigger("change")}else{this.$element.attr("aria-pressed",!this.$element.hasClass("active")),this.$element.toggleClass("active")}};var h=e.fn.button;e.fn.button=f,e.fn.button.Constructor=g,e.fn.button.noConflict=function(){return e.fn.button=h,this},e(document).on("click.bs.button.data-api",'[data-toggle^="button"]',function(a){var b=e(a.target);b.hasClass("btn")||(b=b.closest(".btn")),f.call(b,"toggle"),e(a.target).is('input[type="radio"]')||e(a.target).is('input[type="checkbox"]')||a.preventDefault()}).on("focus.bs.button.data-api blur.bs.button.data-api",'[data-toggle^="button"]',function(a){e(a.target).closest(".btn").toggleClass("focus",/^focus(in)?$/.test(a.type))})}(jQuery),+function(f){function g(a){return this.each(function(){var b=f(this),c=b.data("bs.carousel"),k=f.extend({},h.DEFAULTS,b.data(),"object"==typeof a&&a),l="string"==typeof a?a:k.slide;c||b.data("bs.carousel",c=new h(this,k)),"number"==typeof a?c.to(a):l?c[l]():k.interval&&c.pause().cycle()})}var h=function(a,d){this.$element=f(a),this.$indicators=this.$element.find(".carousel-indicators"),this.options=d,this.paused=null,this.sliding=null,this.interval=null,this.$active=null,this.$items=null,this.options.keyboard&&this.$element.on("keydown.bs.carousel",f.proxy(this.keydown,this)),"hover"==this.options.pause&&!("ontouchstart" in document.documentElement)&&this.$element.on("mouseenter.bs.carousel",f.proxy(this.pause,this)).on("mouseleave.bs.carousel",f.proxy(this.cycle,this))};h.VERSION="3.3.6",h.TRANSITION_DURATION=600,h.DEFAULTS={interval:5000,pause:"hover",wrap:!0,keyboard:!0},h.prototype.keydown=function(b){if(!/input|textarea/i.test(b.target.tagName)){switch(b.which){case 37:this.prev();break;case 39:this.next();break;default:return}b.preventDefault()}},h.prototype.cycle=function(a){return a||(this.paused=!1),this.interval&&clearInterval(this.interval),this.options.interval&&!this.paused&&(this.interval=setInterval(f.proxy(this.next,this),this.options.interval)),this},h.prototype.getItemIndex=function(b){return this.$items=b.parent().children(".item"),this.$items.index(b||this.$active)},h.prototype.getItemForDirection=function(k,l){var m=this.getItemIndex(l),n="prev"==k&&0===m||"next"==k&&m==this.$items.length-1;if(n&&!this.options.wrap){return l}var o="prev"==k?-1:1,p=(m+o)%this.$items.length;return this.$items.eq(p)},h.prototype.to=function(d){var e=this,k=this.getItemIndex(this.$active=this.$element.find(".item.active"));return d>this.$items.length-1||0>d?void 0:this.sliding?this.$element.one("slid.bs.carousel",function(){e.to(d)}):k==d?this.pause().cycle():this.slide(d>k?"next":"prev",this.$items.eq(d))},h.prototype.pause=function(a){return a||(this.paused=!0),this.$element.find(".next, .prev").length&&f.support.transition&&(this.$element.trigger(f.support.transition.end),this.cycle(!0)),this.interval=clearInterval(this.interval),this},h.prototype.next=function(){return this.sliding?void 0:this.slide("next")},h.prototype.prev=function(){return this.sliding?void 0:this.slide("prev")},h.prototype.slide=function(a,c){var n=this.$element.find(".item.active"),o=c||this.getItemForDirection(a,n),p=this.interval,q="next"==a?"left":"right",r=this;if(o.hasClass("active")){return this.sliding=!1}var s=o[0],t=f.Event("slide.bs.carousel",{relatedTarget:s,direction:q});if(this.$element.trigger(t),!t.isDefaultPrevented()){if(this.sliding=!0,p&&this.pause(),this.$indicators.length){this.$indicators.find(".active").removeClass("active");var u=f(this.$indicators.children()[this.getItemIndex(o)]);u&&u.addClass("active")}var v=f.Event("slid.bs.carousel",{relatedTarget:s,direction:q});return f.support.transition&&this.$element.hasClass("slide")?(o.addClass(a),o[0].offsetWidth,n.addClass(q),o.addClass(q),n.one("bsTransitionEnd",function(){o.removeClass([a,q].join(" ")).addClass("active"),n.removeClass(["active",q].join(" ")),r.sliding=!1,setTimeout(function(){r.$element.trigger(v)},0)}).emulateTransitionEnd(h.TRANSITION_DURATION)):(n.removeClass("active"),o.addClass("active"),this.sliding=!1,this.$element.trigger(v)),p&&this.cycle(),this}};var i=f.fn.carousel;f.fn.carousel=g,f.fn.carousel.Constructor=h,f.fn.carousel.noConflict=function(){return f.fn.carousel=i,this};var j=function(a){var b,k=f(this),l=f(k.attr("data-target")||(b=k.attr("href"))&&b.replace(/.*(?=#[^\s]+$)/,""));if(l.hasClass("carousel")){var m=f.extend({},l.data(),k.data()),n=k.attr("data-slide-to");n&&(m.interval=!1),g.call(l,m),n&&l.data("bs.carousel").to(n),a.preventDefault()}};f(document).on("click.bs.carousel.data-api","[data-slide]",j).on("click.bs.carousel.data-api","[data-slide-to]",j),f(window).on("load",function(){f('[data-ride="carousel"]').each(function(){var a=f(this);g.call(a,a.data())})})}(jQuery),+function(f){function g(a){var e,k=a.attr("data-target")||(e=a.attr("href"))&&e.replace(/.*(?=#[^\s]+$)/,"");return f(k)}function h(a){return this.each(function(){var b=f(this),d=b.data("bs.collapse"),k=f.extend({},i.DEFAULTS,b.data(),"object"==typeof a&&a);!d&&k.toggle&&/show|hide/.test(a)&&(k.toggle=!1),d||b.data("bs.collapse",d=new i(this,k)),"string"==typeof a&&d[a]()})}var i=function(a,d){this.$element=f(a),this.options=f.extend({},i.DEFAULTS,d),this.$trigger=f('[data-toggle="collapse"][href="#'+a.id+'"],[data-toggle="collapse"][data-target="#'+a.id+'"]'),this.transitioning=null,this.options.parent?this.$parent=this.getParent():this.addAriaAndCollapsedClass(this.$element,this.$trigger),this.options.toggle&&this.toggle()};i.VERSION="3.3.6",i.TRANSITION_DURATION=350,i.DEFAULTS={toggle:!0},i.prototype.dimension=function(){var b=this.$element.hasClass("width");return b?"width":"height"},i.prototype.show=function(){if(!this.transitioning&&!this.$element.hasClass("in")){var a,c=this.$parent&&this.$parent.children(".panel").children(".in, .collapsing");if(!(c&&c.length&&(a=c.data("bs.collapse"),a&&a.transitioning))){var d=f.Event("show.bs.collapse");if(this.$element.trigger(d),!d.isDefaultPrevented()){c&&c.length&&(h.call(c,"hide"),a||c.data("bs.collapse",null));var k=this.dimension();this.$element.removeClass("collapse").addClass("collapsing")[k](0).attr("aria-expanded",!0),this.$trigger.removeClass("collapsed").attr("aria-expanded",!0),this.transitioning=1;var l=function(){this.$element.removeClass("collapsing").addClass("collapse in")[k](""),this.transitioning=0,this.$element.trigger("shown.bs.collapse")};if(!f.support.transition){return l.call(this)}var m=f.camelCase(["scroll",k].join("-"));this.$element.one("bsTransitionEnd",f.proxy(l,this)).emulateTransitionEnd(i.TRANSITION_DURATION)[k](this.$element[0][m])}}}},i.prototype.hide=function(){if(!this.transitioning&&this.$element.hasClass("in")){var a=f.Event("hide.bs.collapse");if(this.$element.trigger(a),!a.isDefaultPrevented()){var d=this.dimension();this.$element[d](this.$element[d]())[0].offsetHeight,this.$element.addClass("collapsing").removeClass("collapse in").attr("aria-expanded",!1),this.$trigger.addClass("collapsed").attr("aria-expanded",!1),this.transitioning=1;var k=function(){this.transitioning=0,this.$element.removeClass("collapsing").addClass("collapse").trigger("hidden.bs.collapse")};return f.support.transition?void this.$element[d](0).one("bsTransitionEnd",f.proxy(k,this)).emulateTransitionEnd(i.TRANSITION_DURATION):k.call(this)}}},i.prototype.toggle=function(){this[this.$element.hasClass("in")?"hide":"show"]()},i.prototype.getParent=function(){return f(this.options.parent).find('[data-toggle="collapse"][data-parent="'+this.options.parent+'"]').each(f.proxy(function(a,b){var k=f(b);this.addAriaAndCollapsedClass(g(k),k)},this)).end()},i.prototype.addAriaAndCollapsedClass=function(d,e){var k=d.hasClass("in");d.attr("aria-expanded",k),e.toggleClass("collapsed",!k).attr("aria-expanded",k)};var j=f.fn.collapse;f.fn.collapse=h,f.fn.collapse.Constructor=i,f.fn.collapse.noConflict=function(){return f.fn.collapse=j,this},f(document).on("click.bs.collapse.data-api",'[data-toggle="collapse"]',function(a){var b=f(this);b.attr("data-target")||a.preventDefault();var c=g(b),k=c.data("bs.collapse"),l=k?"toggle":b.data();h.call(c,l)})}(jQuery),+function(i){function j(a){var e=a.attr("data-target");e||(e=a.attr("href"),e=e&&/#[A-Za-z]/.test(e)&&e.replace(/.*(?=#[^\s]*$)/,""));var f=e&&i(e);return f&&f.length?f:a.parent()}function k(a){a&&3===a.which||(i(m).remove(),i(n).each(function(){var b=i(this),c=j(b),g={relatedTarget:this};c.hasClass("open")&&(a&&"click"==a.type&&/input|textarea/i.test(a.target.tagName)&&i.contains(c[0],a.target)||(c.trigger(a=i.Event("hide.bs.dropdown",g)),a.isDefaultPrevented()||(b.attr("aria-expanded","false"),c.removeClass("open").trigger(i.Event("hidden.bs.dropdown",g)))))}))}function l(a){return this.each(function(){var b=i(this),e=b.data("bs.dropdown");e||b.data("bs.dropdown",e=new o(this)),"string"==typeof a&&e[a].call(b)})}var m=".dropdown-backdrop",n='[data-toggle="dropdown"]',o=function(a){i(a).on("click.bs.dropdown",this.toggle)};o.VERSION="3.3.6",o.prototype.toggle=function(a){var b=i(this);if(!b.is(".disabled, :disabled")){var c=j(b),q=c.hasClass("open");if(k(),!q){"ontouchstart" in document.documentElement&&!c.closest(".navbar-nav").length&&i(document.createElement("div")).addClass("dropdown-backdrop").insertAfter(i(this)).on("click",k);var r={relatedTarget:this};if(c.trigger(a=i.Event("show.bs.dropdown",r)),a.isDefaultPrevented()){return}b.trigger("focus").attr("aria-expanded","true"),c.toggleClass("open").trigger(i.Event("shown.bs.dropdown",r))}return !1}},o.prototype.keydown=function(a){if(/(38|40|27|32)/.test(a.which)&&!/input|textarea/i.test(a.target.tagName)){var b=i(this);if(a.preventDefault(),a.stopPropagation(),!b.is(".disabled, :disabled")){var f=j(b),q=f.hasClass("open");if(!q&&27!=a.which||q&&27==a.which){return 27==a.which&&f.find(n).trigger("focus"),b.trigger("click")}var r=" li:not(.disabled):visible a",s=f.find(".dropdown-menu"+r);if(s.length){var t=s.index(a.target);38==a.which&&t>0&&t--,40==a.which&&t<s.length-1&&t++,~t||(t=0),s.eq(t).trigger("focus")}}}};var p=i.fn.dropdown;i.fn.dropdown=l,i.fn.dropdown.Constructor=o,i.fn.dropdown.noConflict=function(){return i.fn.dropdown=p,this},i(document).on("click.bs.dropdown.data-api",k).on("click.bs.dropdown.data-api",".dropdown form",function(b){b.stopPropagation()}).on("click.bs.dropdown.data-api",n,o.prototype.toggle).on("keydown.bs.dropdown.data-api",n,o.prototype.keydown).on("keydown.bs.dropdown.data-api",".dropdown-menu",o.prototype.keydown)}(jQuery),+function(e){function f(a,c){return this.each(function(){var b=e(this),d=b.data("bs.modal"),i=e.extend({},g.DEFAULTS,b.data(),"object"==typeof a&&a);d||b.data("bs.modal",d=new g(this,i)),"string"==typeof a?d[a](c):i.show&&d.show(c)})}var g=function(a,d){this.options=d,this.$body=e(document.body),this.$element=e(a),this.$dialog=this.$element.find(".modal-dialog"),this.$backdrop=null,this.isShown=null,this.originalBodyPad=null,this.scrollbarWidth=0,this.ignoreBackdropClick=!1,this.options.remote&&this.$element.find(".modal-content").load(this.options.remote,e.proxy(function(){this.$element.trigger("loaded.bs.modal")},this))};g.VERSION="3.3.6",g.TRANSITION_DURATION=300,g.BACKDROP_TRANSITION_DURATION=150,g.DEFAULTS={backdrop:!0,keyboard:!0,show:!0},g.prototype.toggle=function(b){return this.isShown?this.hide():this.show(b)},g.prototype.show=function(a){var c=this,i=e.Event("show.bs.modal",{relatedTarget:a});this.$element.trigger(i),this.isShown||i.isDefaultPrevented()||(this.isShown=!0,this.checkScrollbar(),this.setScrollbar(),this.$body.addClass("modal-open"),this.escape(),this.resize(),this.$element.on("click.dismiss.bs.modal",'[data-dismiss="modal"]',e.proxy(this.hide,this)),this.$dialog.on("mousedown.dismiss.bs.modal",function(){c.$element.one("mouseup.dismiss.bs.modal",function(d){e(d.target).is(c.$element)&&(c.ignoreBackdropClick=!0)})}),this.backdrop(function(){var b=e.support.transition&&c.$element.hasClass("fade");c.$element.parent().length||c.$element.appendTo(c.$body),c.$element.show().scrollTop(0),c.adjustDialog(),b&&c.$element[0].offsetWidth,c.$element.addClass("in"),c.enforceFocus();var d=e.Event("shown.bs.modal",{relatedTarget:a});b?c.$dialog.one("bsTransitionEnd",function(){c.$element.trigger("focus").trigger(d)}).emulateTransitionEnd(g.TRANSITION_DURATION):c.$element.trigger("focus").trigger(d)}))},g.prototype.hide=function(a){a&&a.preventDefault(),a=e.Event("hide.bs.modal"),this.$element.trigger(a),this.isShown&&!a.isDefaultPrevented()&&(this.isShown=!1,this.escape(),this.resize(),e(document).off("focusin.bs.modal"),this.$element.removeClass("in").off("click.dismiss.bs.modal").off("mouseup.dismiss.bs.modal"),this.$dialog.off("mousedown.dismiss.bs.modal"),e.support.transition&&this.$element.hasClass("fade")?this.$element.one("bsTransitionEnd",e.proxy(this.hideModal,this)).emulateTransitionEnd(g.TRANSITION_DURATION):this.hideModal())},g.prototype.enforceFocus=function(){e(document).off("focusin.bs.modal").on("focusin.bs.modal",e.proxy(function(b){this.$element[0]===b.target||this.$element.has(b.target).length||this.$element.trigger("focus")},this))},g.prototype.escape=function(){this.isShown&&this.options.keyboard?this.$element.on("keydown.dismiss.bs.modal",e.proxy(function(b){27==b.which&&this.hide()},this)):this.isShown||this.$element.off("keydown.dismiss.bs.modal")},g.prototype.resize=function(){this.isShown?e(window).on("resize.bs.modal",e.proxy(this.handleUpdate,this)):e(window).off("resize.bs.modal")},g.prototype.hideModal=function(){var b=this;this.$element.hide(),this.backdrop(function(){b.$body.removeClass("modal-open"),b.resetAdjustments(),b.resetScrollbar(),b.$element.trigger("hidden.bs.modal")})},g.prototype.removeBackdrop=function(){this.$backdrop&&this.$backdrop.remove(),this.$backdrop=null},g.prototype.backdrop=function(a){var c=this,i=this.$element.hasClass("fade")?"fade":"";if(this.isShown&&this.options.backdrop){var j=e.support.transition&&i;if(this.$backdrop=e(document.createElement("div")).addClass("modal-backdrop "+i).appendTo(this.$body),this.$element.on("click.dismiss.bs.modal",e.proxy(function(b){return this.ignoreBackdropClick?void (this.ignoreBackdropClick=!1):void (b.target===b.currentTarget&&("static"==this.options.backdrop?this.$element[0].focus():this.hide()))},this)),j&&this.$backdrop[0].offsetWidth,this.$backdrop.addClass("in"),!a){return}j?this.$backdrop.one("bsTransitionEnd",a).emulateTransitionEnd(g.BACKDROP_TRANSITION_DURATION):a()}else{if(!this.isShown&&this.$backdrop){this.$backdrop.removeClass("in");var k=function(){c.removeBackdrop(),a&&a()};e.support.transition&&this.$element.hasClass("fade")?this.$backdrop.one("bsTransitionEnd",k).emulateTransitionEnd(g.BACKDROP_TRANSITION_DURATION):k()}else{a&&a()}}},g.prototype.handleUpdate=function(){this.adjustDialog()},g.prototype.adjustDialog=function(){var b=this.$element[0].scrollHeight>document.documentElement.clientHeight;this.$element.css({paddingLeft:!this.bodyIsOverflowing&&b?this.scrollbarWidth:"",paddingRight:this.bodyIsOverflowing&&!b?this.scrollbarWidth:""})},g.prototype.resetAdjustments=function(){this.$element.css({paddingLeft:"",paddingRight:""})},g.prototype.checkScrollbar=function(){var c=window.innerWidth;if(!c){var d=document.documentElement.getBoundingClientRect();c=d.right-Math.abs(d.left)}this.bodyIsOverflowing=document.body.clientWidth<c,this.scrollbarWidth=this.measureScrollbar()},g.prototype.setScrollbar=function(){var b=parseInt(this.$body.css("padding-right")||0,10);this.originalBodyPad=document.body.style.paddingRight||"",this.bodyIsOverflowing&&this.$body.css("padding-right",b+this.scrollbarWidth)},g.prototype.resetScrollbar=function(){this.$body.css("padding-right",this.originalBodyPad)},g.prototype.measureScrollbar=function(){var c=document.createElement("div");c.className="modal-scrollbar-measure",this.$body.append(c);var d=c.offsetWidth-c.clientWidth;return this.$body[0].removeChild(c),d};var h=e.fn.modal;e.fn.modal=f,e.fn.modal.Constructor=g,e.fn.modal.noConflict=function(){return e.fn.modal=h,this},e(document).on("click.bs.modal.data-api",'[data-toggle="modal"]',function(a){var b=e(this),i=b.attr("href"),j=e(b.attr("data-target")||i&&i.replace(/.*(?=#[^\s]+$)/,"")),k=j.data("bs.modal")?"toggle":e.extend({remote:!/#/.test(i)&&i},j.data(),b.data());b.is("a")&&a.preventDefault(),j.one("show.bs.modal",function(c){c.isDefaultPrevented()||j.one("hidden.bs.modal",function(){b.is(":visible")&&b.trigger("focus")})}),f.call(j,k,this)})}(jQuery),+function(e){function f(a){return this.each(function(){var b=e(this),c=b.data("bs.tooltip"),i="object"==typeof a&&a;(c||!/destroy|hide/.test(a))&&(c||b.data("bs.tooltip",c=new g(this,i)),"string"==typeof a&&c[a]())})}var g=function(c,d){this.type=null,this.options=null,this.enabled=null,this.timeout=null,this.hoverState=null,this.$element=null,this.inState=null,this.init("tooltip",c,d)};g.VERSION="3.3.6",g.TRANSITION_DURATION=150,g.DEFAULTS={animation:!0,placement:"top",selector:!1,template:'<div class="tooltip" role="tooltip"><div class="tooltip-arrow"></div><div class="tooltip-inner"></div></div>',trigger:"hover focus",title:"",delay:0,html:!1,container:!1,viewport:{selector:"body",padding:0}},g.prototype.init=function(a,j,k){if(this.enabled=!0,this.type=a,this.$element=e(j),this.options=this.getOptions(k),this.$viewport=this.options.viewport&&e(e.isFunction(this.options.viewport)?this.options.viewport.call(this,this.$element):this.options.viewport.selector||this.options.viewport),this.inState={click:!1,hover:!1,focus:!1},this.$element[0] instanceof document.constructor&&!this.options.selector){throw new Error("`selector` option must be specified when initializing "+this.type+" on the window.document object!")}for(var l=this.options.trigger.split(" "),m=l.length;m--;){var n=l[m];if("click"==n){this.$element.on("click."+this.type,this.options.selector,e.proxy(this.toggle,this))}else{if("manual"!=n){var o="hover"==n?"mouseenter":"focusin",p="hover"==n?"mouseleave":"focusout";this.$element.on(o+"."+this.type,this.options.selector,e.proxy(this.enter,this)),this.$element.on(p+"."+this.type,this.options.selector,e.proxy(this.leave,this))}}}this.options.selector?this._options=e.extend({},this.options,{trigger:"manual",selector:""}):this.fixTitle()},g.prototype.getDefaults=function(){return g.DEFAULTS},g.prototype.getOptions=function(a){return a=e.extend({},this.getDefaults(),this.$element.data(),a),a.delay&&"number"==typeof a.delay&&(a.delay={show:a.delay,hide:a.delay}),a},g.prototype.getDelegateOptions=function(){var a={},d=this.getDefaults();return this._options&&e.each(this._options,function(b,c){d[b]!=c&&(a[b]=c)}),a},g.prototype.enter=function(a){var d=a instanceof this.constructor?a:e(a.currentTarget).data("bs."+this.type);return d||(d=new this.constructor(a.currentTarget,this.getDelegateOptions()),e(a.currentTarget).data("bs."+this.type,d)),a instanceof e.Event&&(d.inState["focusin"==a.type?"focus":"hover"]=!0),d.tip().hasClass("in")||"in"==d.hoverState?void (d.hoverState="in"):(clearTimeout(d.timeout),d.hoverState="in",d.options.delay&&d.options.delay.show?void (d.timeout=setTimeout(function(){"in"==d.hoverState&&d.show()},d.options.delay.show)):d.show())},g.prototype.isInStateTrue=function(){for(var b in this.inState){if(this.inState[b]){return !0}}return !1},g.prototype.leave=function(a){var d=a instanceof this.constructor?a:e(a.currentTarget).data("bs."+this.type);return d||(d=new this.constructor(a.currentTarget,this.getDelegateOptions()),e(a.currentTarget).data("bs."+this.type,d)),a instanceof e.Event&&(d.inState["focusout"==a.type?"focus":"hover"]=!1),d.isInStateTrue()?void 0:(clearTimeout(d.timeout),d.hoverState="out",d.options.delay&&d.options.delay.hide?void (d.timeout=setTimeout(function(){"out"==d.hoverState&&d.hide()},d.options.delay.hide)):d.hide())},g.prototype.show=function(){var a=e.Event("show.bs."+this.type);if(this.hasContent()&&this.enabled){this.$element.trigger(a);var c=e.contains(this.$element[0].ownerDocument.documentElement,this.$element[0]);if(a.isDefaultPrevented()||!c){return}var r=this,s=this.tip(),t=this.getUID(this.type);this.setContent(),s.attr("id",t),this.$element.attr("aria-describedby",t),this.options.animation&&s.addClass("fade");var u="function"==typeof this.options.placement?this.options.placement.call(this,s[0],this.$element[0]):this.options.placement,v=/\s?auto?\s?/i,w=v.test(u);w&&(u=u.replace(v,"")||"top"),s.detach().css({top:0,left:0,display:"block"}).addClass(u).data("bs."+this.type,this),this.options.container?s.appendTo(this.options.container):s.insertAfter(this.$element),this.$element.trigger("inserted.bs."+this.type);var x=this.getPosition(),y=s[0].offsetWidth,z=s[0].offsetHeight;if(w){var A=u,B=this.getPosition(this.$viewport);u="bottom"==u&&x.bottom+z>B.bottom?"top":"top"==u&&x.top-z<B.top?"bottom":"right"==u&&x.right+y>B.width?"left":"left"==u&&x.left-y<B.left?"right":u,s.removeClass(A).addClass(u)}var C=this.getCalculatedOffset(u,x,y,z);this.applyPlacement(C,u);var D=function(){var b=r.hoverState;r.$element.trigger("shown.bs."+r.type),r.hoverState=null,"out"==b&&r.leave(r)};e.support.transition&&this.$tip.hasClass("fade")?s.one("bsTransitionEnd",D).emulateTransitionEnd(g.TRANSITION_DURATION):D()}},g.prototype.applyPlacement=function(a,o){var p=this.tip(),q=p[0].offsetWidth,r=p[0].offsetHeight,s=parseInt(p.css("margin-top"),10),t=parseInt(p.css("margin-left"),10);isNaN(s)&&(s=0),isNaN(t)&&(t=0),a.top+=s,a.left+=t,e.offset.setOffset(p[0],e.extend({using:function(b){p.css({top:Math.round(b.top),left:Math.round(b.left)})}},a),0),p.addClass("in");var u=p[0].offsetWidth,v=p[0].offsetHeight;"top"==o&&v!=r&&(a.top=a.top+r-v);var w=this.getViewportAdjustedDelta(o,a,u,v);w.left?a.left+=w.left:a.top+=w.top;var x=/top|bottom/.test(o),y=x?2*w.left-q+u:2*w.top-r+v,z=x?"offsetWidth":"offsetHeight";p.offset(a),this.replaceArrow(y,p[0][z],x)},g.prototype.replaceArrow=function(d,i,j){this.arrow().css(j?"left":"top",50*(1-d/i)+"%").css(j?"top":"left","")},g.prototype.setContent=function(){var c=this.tip(),d=this.getTitle();c.find(".tooltip-inner")[this.options.html?"html":"text"](d),c.removeClass("fade in top bottom left right")},g.prototype.hide=function(a){function c(){"in"!=i.hoverState&&j.detach(),i.$element.removeAttr("aria-describedby").trigger("hidden.bs."+i.type),a&&a()}var i=this,j=e(this.$tip),k=e.Event("hide.bs."+this.type);return this.$element.trigger(k),k.isDefaultPrevented()?void 0:(j.removeClass("in"),e.support.transition&&j.hasClass("fade")?j.one("bsTransitionEnd",c).emulateTransitionEnd(g.TRANSITION_DURATION):c(),this.hoverState=null,this)},g.prototype.fixTitle=function(){var b=this.$element;(b.attr("title")||"string"!=typeof b.attr("data-original-title"))&&b.attr("data-original-title",b.attr("title")||"").attr("title","")},g.prototype.hasContent=function(){return this.getTitle()},g.prototype.getPosition=function(a){a=a||this.$element;var i=a[0],j="BODY"==i.tagName,k=i.getBoundingClientRect();null==k.width&&(k=e.extend({},k,{width:k.right-k.left,height:k.bottom-k.top}));var l=j?{top:0,left:0}:a.offset(),m={scroll:j?document.documentElement.scrollTop||document.body.scrollTop:a.scrollTop()},n=j?{width:e(window).width(),height:e(window).height()}:null;return e.extend({},k,m,n,l)},g.prototype.getCalculatedOffset=function(i,j,k,l){return"bottom"==i?{top:j.top+j.height,left:j.left+j.width/2-k/2}:"top"==i?{top:j.top-l,left:j.left+j.width/2-k/2}:"left"==i?{top:j.top+j.height/2-l/2,left:j.left-k}:{top:j.top+j.height/2-l/2,left:j.left+j.width}},g.prototype.getViewportAdjustedDelta=function(l,m,n,o){var p={top:0,left:0};if(!this.$viewport){return p}var q=this.options.viewport&&this.options.viewport.padding||0,r=this.getPosition(this.$viewport);if(/right|left/.test(l)){var s=m.top-q-r.scroll,t=m.top+q-r.scroll+o;s<r.top?p.top=r.top-s:t>r.top+r.height&&(p.top=r.top+r.height-t)}else{var u=m.left-q,v=m.left+q+n;u<r.left?p.left=r.left-u:v>r.right&&(p.left=r.left+r.width-v)}return p},g.prototype.getTitle=function(){var d,i=this.$element,j=this.options;return d=i.attr("data-original-title")||("function"==typeof j.title?j.title.call(i[0]):j.title)},g.prototype.getUID=function(b){do{b+=~~(1000000*Math.random())}while(document.getElementById(b));return b},g.prototype.tip=function(){if(!this.$tip&&(this.$tip=e(this.options.template),1!=this.$tip.length)){throw new Error(this.type+" `template` option must consist of exactly 1 top-level element!")}return this.$tip},g.prototype.arrow=function(){return this.$arrow=this.$arrow||this.tip().find(".tooltip-arrow")},g.prototype.enable=function(){this.enabled=!0},g.prototype.disable=function(){this.enabled=!1},g.prototype.toggleEnabled=function(){this.enabled=!this.enabled},g.prototype.toggle=function(a){var d=this;a&&(d=e(a.currentTarget).data("bs."+this.type),d||(d=new this.constructor(a.currentTarget,this.getDelegateOptions()),e(a.currentTarget).data("bs."+this.type,d))),a?(d.inState.click=!d.inState.click,d.isInStateTrue()?d.enter(d):d.leave(d)):d.tip().hasClass("in")?d.leave(d):d.enter(d)},g.prototype.destroy=function(){var b=this;clearTimeout(this.timeout),this.hide(function(){b.$element.off("."+b.type).removeData("bs."+b.type),b.$tip&&b.$tip.detach(),b.$tip=null,b.$arrow=null,b.$viewport=null})};var h=e.fn.tooltip;e.fn.tooltip=f,e.fn.tooltip.Constructor=g,e.fn.tooltip.noConflict=function(){return e.fn.tooltip=h,this}}(jQuery),+function(e){function f(a){return this.each(function(){var b=e(this),c=b.data("bs.popover"),i="object"==typeof a&&a;(c||!/destroy|hide/.test(a))&&(c||b.data("bs.popover",c=new g(this,i)),"string"==typeof a&&c[a]())})}var g=function(c,d){this.init("popover",c,d)};if(!e.fn.tooltip){throw new Error("Popover requires tooltip.js")}g.VERSION="3.3.6",g.DEFAULTS=e.extend({},e.fn.tooltip.Constructor.DEFAULTS,{placement:"right",trigger:"click",content:"",template:'<div class="popover" role="tooltip"><div class="arrow"></div><h3 class="popover-title"></h3><div class="popover-content"></div></div>'}),g.prototype=e.extend({},e.fn.tooltip.Constructor.prototype),g.prototype.constructor=g,g.prototype.getDefaults=function(){return g.DEFAULTS},g.prototype.setContent=function(){var d=this.tip(),i=this.getTitle(),j=this.getContent();d.find(".popover-title")[this.options.html?"html":"text"](i),d.find(".popover-content").children().detach().end()[this.options.html?"string"==typeof j?"html":"append":"text"](j),d.removeClass("fade top bottom left right in"),d.find(".popover-title").html()||d.find(".popover-title").hide()},g.prototype.hasContent=function(){return this.getTitle()||this.getContent()},g.prototype.getContent=function(){var c=this.$element,d=this.options;return c.attr("data-content")||("function"==typeof d.content?d.content.call(c[0]):d.content)},g.prototype.arrow=function(){return this.$arrow=this.$arrow||this.tip().find(".arrow")};var h=e.fn.popover;e.fn.popover=f,e.fn.popover.Constructor=g,e.fn.popover.noConflict=function(){return e.fn.popover=h,this}}(jQuery),+function(e){function f(a,b){this.$body=e(document.body),this.$scrollElement=e(e(a).is(document.body)?window:a),this.options=e.extend({},f.DEFAULTS,b),this.selector=(this.options.target||"")+" .nav li > a",this.offsets=[],this.targets=[],this.activeTarget=null,this.scrollHeight=0,this.$scrollElement.on("scroll.bs.scrollspy",e.proxy(this.process,this)),this.refresh(),this.process()}function g(a){return this.each(function(){var b=e(this),c=b.data("bs.scrollspy"),i="object"==typeof a&&a;c||b.data("bs.scrollspy",c=new f(this,i)),"string"==typeof a&&c[a]()})}f.VERSION="3.3.6",f.DEFAULTS={offset:10},f.prototype.getScrollHeight=function(){return this.$scrollElement[0].scrollHeight||Math.max(this.$body[0].scrollHeight,document.documentElement.scrollHeight)},f.prototype.refresh=function(){var a=this,i="offset",j=0;this.offsets=[],this.targets=[],this.scrollHeight=this.getScrollHeight(),e.isWindow(this.$scrollElement[0])||(i="position",j=this.$scrollElement.scrollTop()),this.$body.find(this.selector).map(function(){var c=e(this),d=c.data("target")||c.attr("href"),k=/^#./.test(d)&&e(d);return k&&k.length&&k.is(":visible")&&[[k[i]().top+j,d]]||null}).sort(function(c,d){return c[0]-d[0]}).each(function(){a.offsets.push(this[0]),a.targets.push(this[1])})},f.prototype.process=function(){var i,j=this.$scrollElement.scrollTop()+this.options.offset,k=this.getScrollHeight(),l=this.options.offset+k-this.$scrollElement.height(),m=this.offsets,n=this.targets,o=this.activeTarget;if(this.scrollHeight!=k&&this.refresh(),j>=l){return o!=(i=n[n.length-1])&&this.activate(i)}if(o&&j<m[0]){return this.activeTarget=null,this.clear()}for(i=m.length;i--;){o!=n[i]&&j>=m[i]&&(void 0===m[i+1]||j<m[i+1])&&this.activate(n[i])}},f.prototype.activate=function(a){this.activeTarget=a,this.clear();var i=this.selector+'[data-target="'+a+'"],'+this.selector+'[href="'+a+'"]',j=e(i).parents("li").addClass("active");j.parent(".dropdown-menu").length&&(j=j.closest("li.dropdown").addClass("active")),j.trigger("activate.bs.scrollspy")},f.prototype.clear=function(){e(this.selector).parentsUntil(this.options.target,".active").removeClass("active")};var h=e.fn.scrollspy;e.fn.scrollspy=g,e.fn.scrollspy.Constructor=f,e.fn.scrollspy.noConflict=function(){return e.fn.scrollspy=h,this},e(window).on("load.bs.scrollspy.data-api",function(){e('[data-spy="scroll"]').each(function(){var a=e(this);g.call(a,a.data())})})}(jQuery),+function(f){function g(a){return this.each(function(){var b=f(this),c=b.data("bs.tab");c||b.data("bs.tab",c=new h(this)),"string"==typeof a&&c[a]()})}var h=function(a){this.element=f(a)};h.VERSION="3.3.6",h.TRANSITION_DURATION=150,h.prototype.show=function(){var a=this.element,k=a.closest("ul:not(.dropdown-menu)"),l=a.data("target");if(l||(l=a.attr("href"),l=l&&l.replace(/.*(?=#[^\s]*$)/,"")),!a.parent("li").hasClass("active")){var m=k.find(".active:last a"),n=f.Event("hide.bs.tab",{relatedTarget:a[0]}),o=f.Event("show.bs.tab",{relatedTarget:m[0]});if(m.trigger(n),a.trigger(o),!o.isDefaultPrevented()&&!n.isDefaultPrevented()){var p=f(l);this.activate(a.closest("li"),k),this.activate(p,p.parent(),function(){m.trigger({type:"hidden.bs.tab",relatedTarget:a[0]}),a.trigger({type:"shown.bs.tab",relatedTarget:m[0]})})}}},h.prototype.activate=function(a,c,k){function l(){m.removeClass("active").find("> .dropdown-menu > .active").removeClass("active").end().find('[data-toggle="tab"]').attr("aria-expanded",!1),a.addClass("active").find('[data-toggle="tab"]').attr("aria-expanded",!0),n?(a[0].offsetWidth,a.addClass("in")):a.removeClass("fade"),a.parent(".dropdown-menu").length&&a.closest("li.dropdown").addClass("active").end().find('[data-toggle="tab"]').attr("aria-expanded",!0),k&&k()}var m=c.find("> .active"),n=k&&f.support.transition&&(m.length&&m.hasClass("fade")||!!c.find("> .fade").length);m.length&&n?m.one("bsTransitionEnd",l).emulateTransitionEnd(h.TRANSITION_DURATION):l(),m.removeClass("in")};var i=f.fn.tab;f.fn.tab=g,f.fn.tab.Constructor=h,f.fn.tab.noConflict=function(){return f.fn.tab=i,this};var j=function(a){a.preventDefault(),g.call(f(this),"show")};f(document).on("click.bs.tab.data-api",'[data-toggle="tab"]',j).on("click.bs.tab.data-api",'[data-toggle="pill"]',j)}(jQuery),+function(e){function f(a){return this.each(function(){var b=e(this),c=b.data("bs.affix"),i="object"==typeof a&&a;c||b.data("bs.affix",c=new g(this,i)),"string"==typeof a&&c[a]()})}var g=function(a,c){this.options=e.extend({},g.DEFAULTS,c),this.$target=e(this.options.target).on("scroll.bs.affix.data-api",e.proxy(this.checkPosition,this)).on("click.bs.affix.data-api",e.proxy(this.checkPositionWithEventLoop,this)),this.$element=e(a),this.affixed=null,this.unpin=null,this.pinnedOffset=null,this.checkPosition()};g.VERSION="3.3.6",g.RESET="affix affix-top affix-bottom",g.DEFAULTS={offset:0,target:window},g.prototype.getState=function(k,l,m,n){var o=this.$target.scrollTop(),p=this.$element.offset(),q=this.$target.height();if(null!=m&&"top"==this.affixed){return m>o?"top":!1}if("bottom"==this.affixed){return null!=m?o+this.unpin<=p.top?!1:"bottom":k-n>=o+q?!1:"bottom"}var r=null==this.affixed,s=r?o:p.top,t=r?q:l;return null!=m&&m>=o?"top":null!=n&&s+t>=k-n?"bottom":!1},g.prototype.getPinnedOffset=function(){if(this.pinnedOffset){return this.pinnedOffset}this.$element.removeClass(g.RESET).addClass("affix");var c=this.$target.scrollTop(),d=this.$element.offset();return this.pinnedOffset=d.top-c},g.prototype.checkPositionWithEventLoop=function(){setTimeout(e.proxy(this.checkPosition,this),1)},g.prototype.checkPosition=function(){if(this.$element.is(":visible")){var a=this.$element.height(),c=this.options.offset,k=c.top,l=c.bottom,m=Math.max(e(document).height(),e(document.body).height());"object"!=typeof c&&(l=k=c),"function"==typeof k&&(k=c.top(this.$element)),"function"==typeof l&&(l=c.bottom(this.$element));var n=this.getState(m,a,k,l);if(this.affixed!=n){null!=this.unpin&&this.$element.css("top","");var o="affix"+(n?"-"+n:""),p=e.Event(o+".bs.affix");if(this.$element.trigger(p),p.isDefaultPrevented()){return}this.affixed=n,this.unpin="bottom"==n?this.getPinnedOffset():null,this.$element.removeClass(g.RESET).addClass(o).trigger(o.replace("affix","affixed")+".bs.affix")}"bottom"==n&&this.$element.offset({top:m-a-l})}};var h=e.fn.affix;e.fn.affix=f,e.fn.affix.Constructor=g,e.fn.affix.noConflict=function(){return e.fn.affix=h,this},e(window).on("load",function(){e('[data-spy="affix"]').each(function(){var a=e(this),b=a.data();b.offset=b.offset||{},null!=b.offsetBottom&&(b.offset.bottom=b.offsetBottom),null!=b.offsetTop&&(b.offset.top=b.offsetTop),f.call(a,b)})})}(jQuery);/* jQuery UI - v1.12.1 - 2017-01-08
* http://jqueryui.com
* Includes: widget.js, position.js, data.js, disable-selection.js, focusable.js, form-reset-mixin.js, jquery-1-7.js, keycode.js, labels.js, scroll-parent.js, tabbable.js, unique-id.js, widgets/draggable.js, widgets/droppable.js, widgets/resizable.js, widgets/selectable.js, widgets/sortable.js, widgets/accordion.js, widgets/autocomplete.js, widgets/button.js, widgets/checkboxradio.js, widgets/controlgroup.js, widgets/datepicker.js, widgets/dialog.js, widgets/menu.js, widgets/mouse.js, widgets/progressbar.js, widgets/selectmenu.js, widgets/slider.js, widgets/spinner.js, widgets/tabs.js, widgets/tooltip.js, effect.js, effects/effect-blind.js, effects/effect-bounce.js, effects/effect-clip.js, effects/effect-drop.js, effects/effect-explode.js, effects/effect-fade.js, effects/effect-fold.js, effects/effect-highlight.js, effects/effect-puff.js, effects/effect-pulsate.js, effects/effect-scale.js, effects/effect-shake.js, effects/effect-size.js, effects/effect-slide.js, effects/effect-transfer.js
* Copyright jQuery Foundation and other contributors; Licensed MIT */
(function(a){"function"==typeof define&&define.amd?define(["jquery"],a):a(jQuery)})(function(I){function w(c){for(var a=c.css("visibility");"inherit"===a;){c=c.parent(),a=c.css("visibility")}return"hidden"!==a}function A(d){for(var a,c;d.length&&d[0]!==document;){if(a=d.css("position"),("absolute"===a||"relative"===a||"fixed"===a)&&(c=parseInt(d.css("zIndex"),10),!isNaN(c)&&0!==c)){return c}d=d.parent()}return 0}function H(){this._curInst=null,this._keyEvent=!1,this._disabledInputs=[],this._datepickerShowing=!1,this._inDialog=!1,this._mainDivId="ui-datepicker-div",this._inlineClass="ui-datepicker-inline",this._appendClass="ui-datepicker-append",this._triggerClass="ui-datepicker-trigger",this._dialogClass="ui-datepicker-dialog",this._disableClass="ui-datepicker-disabled",this._unselectableClass="ui-datepicker-unselectable",this._currentClass="ui-datepicker-current-day",this._dayOverClass="ui-datepicker-days-cell-over",this.regional=[],this.regional[""]={closeText:"Done",prevText:"Prev",nextText:"Next",currentText:"Today",monthNames:["January","February","March","April","May","June","July","August","September","October","November","December"],monthNamesShort:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],dayNames:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],dayNamesShort:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],dayNamesMin:["Su","Mo","Tu","We","Th","Fr","Sa"],weekHeader:"Wk",dateFormat:"mm/dd/yy",firstDay:0,isRTL:!1,showMonthAfterYear:!1,yearSuffix:""},this._defaults={showOn:"focus",showAnim:"fadeIn",showOptions:{},defaultDate:null,appendText:"",buttonText:"...",buttonImage:"",buttonImageOnly:!1,hideIfNoPrevNext:!1,navigationAsDateFormat:!1,gotoCurrent:!1,changeMonth:!1,changeYear:!1,yearRange:"c-10:c+10",showOtherMonths:!1,selectOtherMonths:!1,showWeek:!1,calculateWeek:this.iso8601Week,shortYearCutoff:"+10",minDate:null,maxDate:null,duration:"fast",beforeShowDay:null,beforeShow:null,onSelect:null,onChangeMonthYear:null,onClose:null,numberOfMonths:1,showCurrentAtPos:0,stepMonths:1,stepBigMonths:12,altField:"",altFormat:"",constrainInput:!0,showButtonPanel:!1,autoSize:!1,disabled:!1},I.extend(this._defaults,this.regional[""]),this.regional.en=I.extend(!0,{},this.regional[""]),this.regional["en-US"]=I.extend(!0,{},this.regional.en),this.dpDiv=D(I("<div id='"+this._mainDivId+"' class='ui-datepicker ui-widget ui-widget-content ui-helper-clearfix ui-corner-all'></div>"))}function D(a){var c="button, .ui-datepicker-prev, .ui-datepicker-next, .ui-datepicker-calendar td a";return a.on("mouseout",c,function(){I(this).removeClass("ui-state-hover"),-1!==this.className.indexOf("ui-datepicker-prev")&&I(this).removeClass("ui-datepicker-prev-hover"),-1!==this.className.indexOf("ui-datepicker-next")&&I(this).removeClass("ui-datepicker-next-hover")}).on("mouseover",c,E)}function E(){I.datepicker._isDisabledDatepicker(F.inline?F.dpDiv.parent()[0]:F.input[0])||(I(this).parents(".ui-datepicker-calendar").find("a").removeClass("ui-state-hover"),I(this).addClass("ui-state-hover"),-1!==this.className.indexOf("ui-datepicker-prev")&&I(this).addClass("ui-datepicker-prev-hover"),-1!==this.className.indexOf("ui-datepicker-next")&&I(this).addClass("ui-datepicker-next-hover"))}function j(a,c){I.extend(a,c);for(var d in c){null==c[d]&&(a[d]=c[d])}return a}function G(a){return function(){var c=this.element.val();a.apply(this,arguments),this._refresh(),c!==this.element.val()&&this._trigger("change")}}I.ui=I.ui||{},I.ui.version="1.12.1";var z=0,B=Array.prototype.slice;I.cleanData=function(a){return function(d){var g,e,f;for(f=0;null!=(e=d[f]);f++){try{g=I._data(e,"events"),g&&g.remove&&I(e).triggerHandler("remove")}catch(c){}}a(d)}}(I.cleanData),I.widget=function(d,g,v){var p,t,c,u={},f=d.split(".")[0];d=d.split(".")[1];var m=f+"-"+d;return v||(v=g,g=I.Widget),I.isArray(v)&&(v=I.extend.apply(null,[{}].concat(v))),I.expr[":"][m.toLowerCase()]=function(a){return !!I.data(a,m)},I[f]=I[f]||{},p=I[f][d],t=I[f][d]=function(h,a){return this._createWidget?(arguments.length&&this._createWidget(h,a),void 0):new t(h,a)},I.extend(t,p,{version:v.version,_proto:I.extend({},v),_childConstructors:[]}),c=new g,c.options=I.widget.extend({},c.options),I.each(v,function(a,h){return I.isFunction(h)?(u[a]=function(){function i(){return g.prototype[a].apply(this,arguments)}function e(l){return g.prototype[a].apply(this,l)}return function(){var l,n=this._super,r=this._superApply;return this._super=i,this._superApply=e,l=h.apply(this,arguments),this._super=n,this._superApply=r,l}}(),void 0):(u[a]=h,void 0)}),t.prototype=I.widget.extend(c,{widgetEventPrefix:p?c.widgetEventPrefix||d:d},u,{constructor:t,namespace:f,widgetName:d,widgetFullName:m}),p?(I.each(p._childConstructors,function(a,h){var l=h.prototype;I.widget(l.namespace+"."+l.widgetName,t,h._proto)}),delete p._childConstructors):g._childConstructors.push(t),I.widget.bridge(d,t),t},I.widget.extend=function(d){for(var f,l,g=B.call(arguments,1),h=0,c=g.length;c>h;h++){for(f in g[h]){l=g[h][f],g[h].hasOwnProperty(f)&&void 0!==l&&(d[f]=I.isPlainObject(l)?I.isPlainObject(d[f])?I.widget.extend({},d[f],l):I.widget.extend({},l):l)}}return d},I.widget.bridge=function(a,c){var d=c.prototype.widgetFullName||a;I.fn[a]=function(f){var g="string"==typeof f,e=B.call(arguments,1),h=this;return g?this.length||"instance"!==f?this.each(function(){var l,m=I.data(this,d);return"instance"===f?(h=m,!1):m?I.isFunction(m[f])&&"_"!==f.charAt(0)?(l=m[f].apply(m,e),l!==m&&void 0!==l?(h=l&&l.jquery?h.pushStack(l.get()):l,!1):void 0):I.error("no such method '"+f+"' for "+a+" widget instance"):I.error("cannot call methods on "+a+" prior to initialization; attempted to call method '"+f+"'")}):h=void 0:(e.length&&(f=I.widget.extend.apply(null,[f].concat(e))),this.each(function(){var i=I.data(this,d);i?(i.option(f||{}),i._init&&i._init()):I.data(this,d,new c(f,this))})),h}},I.Widget=function(){},I.Widget._childConstructors=[],I.Widget.prototype={widgetName:"widget",widgetEventPrefix:"",defaultElement:"<div>",options:{classes:{},disabled:!1,create:null},_createWidget:function(a,c){c=I(c||this.defaultElement||this)[0],this.element=I(c),this.uuid=z++,this.eventNamespace="."+this.widgetName+this.uuid,this.bindings=I(),this.hoverable=I(),this.focusable=I(),this.classesElementLookup={},c!==this&&(I.data(c,this.widgetFullName,this),this._on(!0,this.element,{remove:function(d){d.target===c&&this.destroy()}}),this.document=I(c.style?c.ownerDocument:c.document||c),this.window=I(this.document[0].defaultView||this.document[0].parentWindow)),this.options=I.widget.extend({},this.options,this._getCreateOptions(),a),this._create(),this.options.disabled&&this._setOptionDisabled(this.options.disabled),this._trigger("create",null,this._getCreateEventData()),this._init()},_getCreateOptions:function(){return{}},_getCreateEventData:I.noop,_create:I.noop,_init:I.noop,destroy:function(){var a=this;this._destroy(),I.each(this.classesElementLookup,function(d,c){a._removeClass(c,d)}),this.element.off(this.eventNamespace).removeData(this.widgetFullName),this.widget().off(this.eventNamespace).removeAttr("aria-disabled"),this.bindings.off(this.eventNamespace)},_destroy:I.noop,widget:function(){return this.element},option:function(d,f){var l,g,h,c=d;if(0===arguments.length){return I.widget.extend({},this.options)}if("string"==typeof d){if(c={},l=d.split("."),d=l.shift(),l.length){for(g=c[d]=I.widget.extend({},this.options[d]),h=0;l.length-1>h;h++){g[l[h]]=g[l[h]]||{},g=g[l[h]]}if(d=l.pop(),1===arguments.length){return void 0===g[d]?null:g[d]}g[d]=f}else{if(1===arguments.length){return void 0===this.options[d]?null:this.options[d]}c[d]=f}}return this._setOptions(c),this},_setOptions:function(c){var a;for(a in c){this._setOption(a,c[a])}return this},_setOption:function(c,a){return"classes"===c&&this._setOptionClasses(a),this.options[c]=a,"disabled"===c&&this._setOptionDisabled(a),this},_setOptionClasses:function(a){var c,f,d;for(c in a){d=this.classesElementLookup[c],a[c]!==this.options.classes[c]&&d&&d.length&&(f=I(d.get()),this._removeClass(d,c),f.addClass(this._classes({element:f,keys:c,classes:a,add:!0})))}},_setOptionDisabled:function(a){this._toggleClass(this.widget(),this.widgetFullName+"-disabled",null,!!a),a&&(this._removeClass(this.hoverable,null,"ui-state-hover"),this._removeClass(this.focusable,null,"ui-state-focus"))},enable:function(){return this._setOptions({disabled:!1})},disable:function(){return this._setOptions({disabled:!0})},_classes:function(a){function c(g,h){var e,l;for(l=0;g.length>l;l++){e=d.classesElementLookup[g[l]]||I(),e=a.add?I(I.unique(e.get().concat(a.element.get()))):I(e.not(a.element).get()),d.classesElementLookup[g[l]]=e,f.push(g[l]),h&&a.classes[g[l]]&&f.push(a.classes[g[l]])}}var f=[],d=this;return a=I.extend({element:this.element,classes:this.options.classes||{}},a),this._on(a.element,{remove:"_untrackClassesElement"}),a.keys&&c(a.keys.match(/\S+/g)||[],!0),a.extra&&c(a.extra.match(/\S+/g)||[]),f.join(" ")},_untrackClassesElement:function(a){var c=this;I.each(c.classesElementLookup,function(e,d){-1!==I.inArray(a.target,d)&&(c.classesElementLookup[e]=I(d.not(a.target).get()))})},_removeClass:function(d,a,c){return this._toggleClass(d,a,c,!1)},_addClass:function(d,a,c){return this._toggleClass(d,a,c,!0)},_toggleClass:function(h,a,c,g){g="boolean"==typeof g?g:c;var d="string"==typeof h||null===h,f={extra:d?a:c,keys:d?h:a,element:d?this.element:h,add:g};return f.element.toggleClass(this._classes(f),g),this},_on:function(a,c,g){var d,f=this;"boolean"!=typeof a&&(g=c,c=a,a=!1),g?(c=d=I(c),this.bindings=this.bindings.add(c)):(g=c,c=this.element,d=this.widget()),I.each(g,function(p,e){function o(){return a||f.options.disabled!==!0&&!I(this).hasClass("ui-state-disabled")?("string"==typeof e?f[e]:e).apply(f,arguments):void 0}"string"!=typeof e&&(o.guid=e.guid=e.guid||o.guid||I.guid++);var m=p.match(/^([\w:-]*)\s*(.*)$/),n=m[1]+f.eventNamespace,i=m[2];i?d.on(n,i,o):c.on(n,o)})},_off:function(a,c){c=(c||"").split(" ").join(this.eventNamespace+" ")+this.eventNamespace,a.off(c).off(c),this.bindings=I(this.bindings.not(a).get()),this.focusable=I(this.focusable.not(a).get()),this.hoverable=I(this.hoverable.not(a).get())},_delay:function(f,a){function c(){return("string"==typeof f?d[f]:f).apply(d,arguments)}var d=this;return setTimeout(c,a||0)},_hoverable:function(a){this.hoverable=this.hoverable.add(a),this._on(a,{mouseenter:function(c){this._addClass(I(c.currentTarget),null,"ui-state-hover")},mouseleave:function(c){this._removeClass(I(c.currentTarget),null,"ui-state-hover")}})},_focusable:function(a){this.focusable=this.focusable.add(a),this._on(a,{focusin:function(c){this._addClass(I(c.currentTarget),null,"ui-state-focus")},focusout:function(c){this._removeClass(I(c.currentTarget),null,"ui-state-focus")}})},_trigger:function(d,f,l){var g,h,c=this.options[d];if(l=l||{},f=I.Event(f),f.type=(d===this.widgetEventPrefix?d:this.widgetEventPrefix+d).toLowerCase(),f.target=this.element[0],h=f.originalEvent){for(g in h){g in f||(f[g]=h[g])}}return this.element.trigger(f,l),!(I.isFunction(c)&&c.apply(this.element[0],[f].concat(l))===!1||f.isDefaultPrevented())}},I.each({show:"fadeIn",hide:"fadeOut"},function(a,c){I.Widget.prototype["_"+a]=function(h,e,f){"string"==typeof e&&(e={effect:e});var d,g=e?e===!0||"number"==typeof e?c:e.effect||c:a;e=e||{},"number"==typeof e&&(e={duration:e}),d=!I.isEmptyObject(e),e.complete=f,e.delay&&h.delay(e.delay),d&&I.effects&&I.effects.effect[g]?h[a](e):g!==a&&h[g]?h[g](e.duration,e.easing,f):h.queue(function(l){I(this)[a](),f&&f.call(h[0]),l()})}}),I.widget,function(){function p(d,a,c){return[parseFloat(d[0])*(Q.test(d[0])?a/100:1),parseFloat(d[1])*(Q.test(d[1])?c/100:1)]}function v(a,c){return parseInt(I.css(a,c),10)||0}function P(a){var c=a[0];return 9===c.nodeType?{width:a.width(),height:a.height(),offset:{top:0,left:0}}:I.isWindow(c)?{width:a.width(),height:a.height(),offset:{top:a.scrollTop(),left:a.scrollLeft()}}:c.preventDefault?{width:0,height:0,offset:{top:c.pageY,left:c.pageX}}:{width:a.outerWidth(),height:a.outerHeight(),offset:a.offset()}}var M,N=Math.max,f=Math.abs,O=/left|center|right/,t=/top|center|bottom/,L=/[\+\-]\d+(\.[\d]+)?%?/,g=/^\w+/,Q=/%$/,m=I.fn.position;I.position={scrollbarWidth:function(){if(void 0!==M){return M}var a,c,h=I("<div style='display:block;position:absolute;width:50px;height:50px;overflow:hidden;'><div style='height:100px;width:auto;'></div></div>"),d=h.children()[0];return I("body").append(h),a=d.offsetWidth,h.css("overflow","scroll"),c=d.offsetWidth,a===c&&(c=h[0].clientWidth),h.remove(),M=a-c},getScrollInfo:function(a){var c=a.isWindow||a.isDocument?"":a.element.css("overflow-x"),l=a.isWindow||a.isDocument?"":a.element.css("overflow-y"),d="scroll"===c||"auto"===c&&a.width<a.element[0].scrollWidth,h="scroll"===l||"auto"===l&&a.height<a.element[0].scrollHeight;return{width:h?I.position.scrollbarWidth():0,height:d?I.position.scrollbarWidth():0}},getWithinInfo:function(a){var c=I(a||window),l=I.isWindow(c[0]),d=!!c[0]&&9===c[0].nodeType,h=!l&&!d;return{element:c,isWindow:l,isDocument:d,offset:h?I(a).offset():{left:0,top:0},scrollLeft:c.scrollLeft(),scrollTop:c.scrollTop(),width:c.outerWidth(),height:c.outerHeight()}}},I.fn.position=function(l){if(!l||!l.of){return m.apply(this,arguments)}l=I.extend({},l);var r,o,d,e,i,a,s=I(l.of),c=I.position.getWithinInfo(l.within),S=I.position.getScrollInfo(c),R=(l.collision||"flip").split(" "),h={};return a=P(s),s[0].preventDefault&&(l.at="left top"),o=a.width,d=a.height,e=a.offset,i=I.extend({},e),I.each(["my","at"],function(){var T,n,u=(l[this]||"").split(" ");1===u.length&&(u=O.test(u[0])?u.concat(["center"]):t.test(u[0])?["center"].concat(u):["center","center"]),u[0]=O.test(u[0])?u[0]:"center",u[1]=t.test(u[1])?u[1]:"center",T=L.exec(u[0]),n=L.exec(u[1]),h[this]=[T?T[0]:0,n?n[0]:0],l[this]=[g.exec(u[0])[0],g.exec(u[1])[0]]}),1===R.length&&(R[1]=R[0]),"right"===l.at[0]?i.left+=o:"center"===l.at[0]&&(i.left+=o/2),"bottom"===l.at[1]?i.top+=d:"center"===l.at[1]&&(i.top+=d/2),r=p(h.at,o,d),i.left+=r[0],i.top+=r[1],this.each(function(){var aa,Z,W=I(this),Y=W.outerWidth(),u=W.outerHeight(),U=v(this,"marginLeft"),n=v(this,"marginTop"),ab=Y+U+v(this,"marginRight")+S.width,T=u+n+v(this,"marginBottom")+S.height,V=I.extend({},i),X=p(h.my,W.outerWidth(),W.outerHeight());"right"===l.my[0]?V.left-=Y:"center"===l.my[0]&&(V.left-=Y/2),"bottom"===l.my[1]?V.top-=u:"center"===l.my[1]&&(V.top-=u/2),V.left+=X[0],V.top+=X[1],aa={marginLeft:U,marginTop:n},I.each(["left","top"],function(ac,ad){I.ui.position[R[ac]]&&I.ui.position[R[ac]][ad](V,{targetWidth:o,targetHeight:d,elemWidth:Y,elemHeight:u,collisionPosition:aa,collisionWidth:ab,collisionHeight:T,offset:[r[0]+X[0],r[1]+X[1]],my:l.my,at:l.at,within:c,elem:W})}),l.using&&(Z=function(ag){var ac=e.left-V.left,ad=ac+o-Y,af=e.top-V.top,ae=af+d-u,ah={target:{element:s,left:e.left,top:e.top,width:o,height:d},element:{element:W,left:V.left,top:V.top,width:Y,height:u},horizontal:0>ad?"left":ac>0?"right":"center",vertical:0>ae?"top":af>0?"bottom":"middle"};Y>o&&o>f(ac+ad)&&(ah.horizontal="center"),u>d&&d>f(af+ae)&&(ah.vertical="middle"),ah.important=N(f(ac),f(ad))>N(f(af),f(ae))?"horizontal":"vertical",l.using.call(this,ag,ah)}),W.offset(I.extend(V,{using:Z}))})},I.ui.position={fit:{left:function(V,d){var u,U=d.within,S=U.isWindow?U.scrollLeft:U.offset.left,c=U.width,T=V.left-d.collisionPosition.marginLeft,o=S-T,R=T+d.collisionWidth-c-S;d.collisionWidth>c?o>0&&0>=R?(u=V.left+o+d.collisionWidth-c-S,V.left+=o-u):V.left=R>0&&0>=o?S:o>R?S+c-d.collisionWidth:S:o>0?V.left+=o:R>0?V.left-=R:V.left=N(V.left-T,V.left)},top:function(V,d){var u,U=d.within,S=U.isWindow?U.scrollTop:U.offset.top,c=d.within.height,T=V.top-d.collisionPosition.marginTop,o=S-T,R=T+d.collisionHeight-c-S;d.collisionHeight>c?o>0&&0>=R?(u=V.top+o+d.collisionHeight-c-S,V.top+=o-u):V.top=R>0&&0>=o?S:o>R?S+c-d.collisionHeight:S:o>0?V.top+=o:R>0?V.top-=R:V.top=N(V.top-T,V.top)}},flip:{left:function(ac,S){var V,ab,X=S.within,Y=X.offset.left+X.scrollLeft,aa=X.width,U=X.isWindow?X.scrollLeft:X.offset.left,W=ac.left-S.collisionPosition.marginLeft,a=W-U,ad=W+S.collisionWidth-aa-U,R="left"===S.my[0]?-S.elemWidth:"right"===S.my[0]?S.elemWidth:0,Z="left"===S.at[0]?S.targetWidth:"right"===S.at[0]?-S.targetWidth:0,T=-2*S.offset[0];0>a?(V=ac.left+R+Z+T+S.collisionWidth-aa-Y,(0>V||f(a)>V)&&(ac.left+=R+Z+T)):ad>0&&(ab=ac.left-S.collisionPosition.marginLeft+R+Z+T-U,(ab>0||ad>f(ab))&&(ac.left+=R+Z+T))},top:function(ad,S){var W,ac,Y=S.within,Z=Y.offset.top+Y.scrollTop,ab=Y.height,V=Y.isWindow?Y.scrollTop:Y.offset.top,X=ad.top-S.collisionPosition.marginTop,a=X-V,ae=X+S.collisionHeight-ab-V,R="top"===S.my[1],aa=R?-S.elemHeight:"bottom"===S.my[1]?S.elemHeight:0,T="top"===S.at[1]?S.targetHeight:"bottom"===S.at[1]?-S.targetHeight:0,U=-2*S.offset[1];0>a?(ac=ad.top+aa+T+U+S.collisionHeight-ab-Z,(0>ac||f(a)>ac)&&(ad.top+=aa+T+U)):ae>0&&(W=ad.top-S.collisionPosition.marginTop+aa+T+U-V,(W>0||ae>f(W))&&(ad.top+=aa+T+U))}},flipfit:{left:function(){I.ui.position.flip.left.apply(this,arguments),I.ui.position.fit.left.apply(this,arguments)},top:function(){I.ui.position.flip.top.apply(this,arguments),I.ui.position.fit.top.apply(this,arguments)}}}}(),I.ui.position,I.extend(I.expr[":"],{data:I.expr.createPseudo?I.expr.createPseudo(function(a){return function(c){return !!I.data(c,a)}}):function(a,c,d){return !!I.data(a,d[3])}}),I.fn.extend({disableSelection:function(){var a="onselectstart" in document.createElement("div")?"selectstart":"mousedown";return function(){return this.on(a+".ui-disableSelection",function(c){c.preventDefault()})}}(),enableSelection:function(){return this.off(".ui-disableSelection")}}),I.ui.focusable=function(e,t){var g,m,c,p,d,f=e.nodeName.toLowerCase();return"area"===f?(g=e.parentNode,m=g.name,e.href&&m&&"map"===g.nodeName.toLowerCase()?(c=I("img[usemap='#"+m+"']"),c.length>0&&c.is(":visible")):!1):(/^(input|select|textarea|button|object)$/.test(f)?(p=!e.disabled,p&&(d=I(e).closest("fieldset")[0],d&&(p=!d.disabled))):p="a"===f?e.href||t:t,p&&I(e).is(":visible")&&w(I(e)))},I.extend(I.expr[":"],{focusable:function(a){return I.ui.focusable(a,null!=I.attr(a,"tabindex"))}}),I.ui.focusable,I.fn.form=function(){return"string"==typeof this[0].form?this.closest("form"):I(this[0].form)},I.ui.formResetMixin={_formResetHandler:function(){var a=I(this);setTimeout(function(){var c=a.data("ui-form-reset-instances");I.each(c,function(){this.refresh()})})},_bindFormResetHandler:function(){if(this.form=this.element.form(),this.form.length){var a=this.form.data("ui-form-reset-instances")||[];a.length||this.form.on("reset.ui-form-reset",this._formResetHandler),a.push(this),this.form.data("ui-form-reset-instances",a)}},_unbindFormResetHandler:function(){if(this.form.length){var a=this.form.data("ui-form-reset-instances");a.splice(I.inArray(this,a),1),a.length?this.form.data("ui-form-reset-instances",a):this.form.removeData("ui-form-reset-instances").off("reset.ui-form-reset")}}},"1.7"===I.fn.jquery.substring(0,3)&&(I.each(["Width","Height"],function(d,f){function l(a,m,p,n){return I.each(g,function(){m-=parseFloat(I.css(a,"padding"+this))||0,p&&(m-=parseFloat(I.css(a,"border"+this+"Width"))||0),n&&(m-=parseFloat(I.css(a,"margin"+this))||0)}),m}var g="Width"===f?["Left","Right"]:["Top","Bottom"],h=f.toLowerCase(),c={innerWidth:I.fn.innerWidth,innerHeight:I.fn.innerHeight,outerWidth:I.fn.outerWidth,outerHeight:I.fn.outerHeight};I.fn["inner"+f]=function(a){return void 0===a?c["inner"+f].call(this):this.each(function(){I(this).css(h,l(this,a)+"px")})},I.fn["outer"+f]=function(a,i){return"number"!=typeof a?c["outer"+f].call(this,a):this.each(function(){I(this).css(h,l(this,a,!0,i)+"px")})}}),I.fn.addBack=function(a){return this.add(null==a?this.prevObject:this.prevObject.filter(a))}),I.ui.keyCode={BACKSPACE:8,COMMA:188,DELETE:46,DOWN:40,END:35,ENTER:13,ESCAPE:27,HOME:36,LEFT:37,PAGE_DOWN:34,PAGE_UP:33,PERIOD:190,RIGHT:39,SPACE:32,TAB:9,UP:38},I.ui.escapeSelector=function(){var a=/([!"#$%&'()*+,./:;<=>?@[\]^`{|}~])/g;return function(c){return c.replace(a,"\\$1")}}(),I.fn.labels=function(){var a,c,g,d,f;return this[0].labels&&this[0].labels.length?this.pushStack(this[0].labels):(d=this.eq(0).parents("label"),g=this.attr("id"),g&&(a=this.eq(0).parents().last(),f=a.add(a.length?a.siblings():this.siblings()),c="label[for='"+I.ui.escapeSelector(g)+"']",d=d.add(f.find(c).addBack(c))),this.pushStack(d))},I.fn.scrollParent=function(a){var c=this.css("position"),g="absolute"===c,d=a?/(auto|scroll|hidden)/:/(auto|scroll)/,f=this.parents().filter(function(){var h=I(this);return g&&"static"===h.css("position")?!1:d.test(h.css("overflow")+h.css("overflow-y")+h.css("overflow-x"))}).eq(0);return"fixed"!==c&&f.length?f:I(this[0].ownerDocument||document)},I.extend(I.expr[":"],{tabbable:function(a){var c=I.attr(a,"tabindex"),d=null!=c;return(!d||c>=0)&&I.ui.focusable(a,d)}}),I.fn.extend({uniqueId:function(){var a=0;return function(){return this.each(function(){this.id||(this.id="ui-id-"+ ++a)})}}(),removeUniqueId:function(){return this.each(function(){/^ui-id-\d+$/.test(this.id)&&I(this).removeAttr("id")})}}),I.ui.ie=!!/msie [\w.]+/.exec(navigator.userAgent.toLowerCase());var k=!1;I(document).on("mouseup",function(){k=!1}),I.widget("ui.mouse",{version:"1.12.1",options:{cancel:"input, textarea, button, select, option",distance:1,delay:0},_mouseInit:function(){var a=this;this.element.on("mousedown."+this.widgetName,function(c){return a._mouseDown(c)}).on("click."+this.widgetName,function(c){return !0===I.data(c.target,a.widgetName+".preventClickEvent")?(I.removeData(c.target,a.widgetName+".preventClickEvent"),c.stopImmediatePropagation(),!1):void 0}),this.started=!1},_mouseDestroy:function(){this.element.off("."+this.widgetName),this._mouseMoveDelegate&&this.document.off("mousemove."+this.widgetName,this._mouseMoveDelegate).off("mouseup."+this.widgetName,this._mouseUpDelegate)},_mouseDown:function(a){if(!k){this._mouseMoved=!1,this._mouseStarted&&this._mouseUp(a),this._mouseDownEvent=a;var c=this,f=1===a.which,d="string"==typeof this.options.cancel&&a.target.nodeName?I(a.target).closest(this.options.cancel).length:!1;return f&&!d&&this._mouseCapture(a)?(this.mouseDelayMet=!this.options.delay,this.mouseDelayMet||(this._mouseDelayTimer=setTimeout(function(){c.mouseDelayMet=!0},this.options.delay)),this._mouseDistanceMet(a)&&this._mouseDelayMet(a)&&(this._mouseStarted=this._mouseStart(a)!==!1,!this._mouseStarted)?(a.preventDefault(),!0):(!0===I.data(a.target,this.widgetName+".preventClickEvent")&&I.removeData(a.target,this.widgetName+".preventClickEvent"),this._mouseMoveDelegate=function(e){return c._mouseMove(e)},this._mouseUpDelegate=function(e){return c._mouseUp(e)},this.document.on("mousemove."+this.widgetName,this._mouseMoveDelegate).on("mouseup."+this.widgetName,this._mouseUpDelegate),a.preventDefault(),k=!0,!0)):!0}},_mouseMove:function(a){if(this._mouseMoved){if(I.ui.ie&&(!document.documentMode||9>document.documentMode)&&!a.button){return this._mouseUp(a)}if(!a.which){if(a.originalEvent.altKey||a.originalEvent.ctrlKey||a.originalEvent.metaKey||a.originalEvent.shiftKey){this.ignoreMissingWhich=!0}else{if(!this.ignoreMissingWhich){return this._mouseUp(a)}}}}return(a.which||a.button)&&(this._mouseMoved=!0),this._mouseStarted?(this._mouseDrag(a),a.preventDefault()):(this._mouseDistanceMet(a)&&this._mouseDelayMet(a)&&(this._mouseStarted=this._mouseStart(this._mouseDownEvent,a)!==!1,this._mouseStarted?this._mouseDrag(a):this._mouseUp(a)),!this._mouseStarted)},_mouseUp:function(a){this.document.off("mousemove."+this.widgetName,this._mouseMoveDelegate).off("mouseup."+this.widgetName,this._mouseUpDelegate),this._mouseStarted&&(this._mouseStarted=!1,a.target===this._mouseDownEvent.target&&I.data(a.target,this.widgetName+".preventClickEvent",!0),this._mouseStop(a)),this._mouseDelayTimer&&(clearTimeout(this._mouseDelayTimer),delete this._mouseDelayTimer),this.ignoreMissingWhich=!1,k=!1,a.preventDefault()},_mouseDistanceMet:function(a){return Math.max(Math.abs(this._mouseDownEvent.pageX-a.pageX),Math.abs(this._mouseDownEvent.pageY-a.pageY))>=this.options.distance},_mouseDelayMet:function(){return this.mouseDelayMet},_mouseStart:function(){},_mouseDrag:function(){},_mouseStop:function(){},_mouseCapture:function(){return !0}}),I.ui.plugin={add:function(a,c,g){var d,f=I.ui[a].prototype;for(d in g){f.plugins[d]=f.plugins[d]||[],f.plugins[d].push([c,g[d]])}},call:function(h,a,c,g){var d,f=h.plugins[a];if(f&&(g||h.element[0].parentNode&&11!==h.element[0].parentNode.nodeType)){for(d=0;f.length>d;d++){h.options[f[d][0]]&&f[d][1].apply(h.element,c)}}}},I.ui.safeActiveElement=function(d){var a;try{a=d.activeElement}catch(c){a=d.body}return a||(a=d.body),a.nodeName||(a=d.body),a},I.ui.safeBlur=function(a){a&&"body"!==a.nodeName.toLowerCase()&&I(a).trigger("blur")},I.widget("ui.draggable",I.ui.mouse,{version:"1.12.1",widgetEventPrefix:"drag",options:{addClasses:!0,appendTo:"parent",axis:!1,connectToSortable:!1,containment:!1,cursor:"auto",cursorAt:!1,grid:!1,handle:!1,helper:"original",iframeFix:!1,opacity:!1,refreshPositions:!1,revert:!1,revertDuration:500,scope:"default",scroll:!0,scrollSensitivity:20,scrollSpeed:20,snap:!1,snapMode:"both",snapTolerance:20,stack:!1,zIndex:!1,drag:null,start:null,stop:null},_create:function(){"original"===this.options.helper&&this._setPositionRelative(),this.options.addClasses&&this._addClass("ui-draggable"),this._setHandleClassName(),this._mouseInit()},_setOption:function(c,a){this._super(c,a),"handle"===c&&(this._removeHandleClassName(),this._setHandleClassName())},_destroy:function(){return(this.helper||this.element).is(".ui-draggable-dragging")?(this.destroyOnClear=!0,void 0):(this._removeHandleClassName(),this._mouseDestroy(),void 0)},_mouseCapture:function(a){var c=this.options;return this.helper||c.disabled||I(a.target).closest(".ui-resizable-handle").length>0?!1:(this.handle=this._getHandle(a),this.handle?(this._blurActiveElement(a),this._blockFrames(c.iframeFix===!0?"iframe":c.iframeFix),!0):!1)},_blockFrames:function(a){this.iframeBlocks=this.document.find(a).map(function(){var c=I(this);return I("<div>").css("position","absolute").appendTo(c.parent()).outerWidth(c.outerWidth()).outerHeight(c.outerHeight()).offset(c.offset())[0]})},_unblockFrames:function(){this.iframeBlocks&&(this.iframeBlocks.remove(),delete this.iframeBlocks)},_blurActiveElement:function(a){var c=I.ui.safeActiveElement(this.document[0]),d=I(a.target);d.closest(c).length||I.ui.safeBlur(c)},_mouseStart:function(a){var c=this.options;return this.helper=this._createHelper(a),this._addClass(this.helper,"ui-draggable-dragging"),this._cacheHelperProportions(),I.ui.ddmanager&&(I.ui.ddmanager.current=this),this._cacheMargins(),this.cssPosition=this.helper.css("position"),this.scrollParent=this.helper.scrollParent(!0),this.offsetParent=this.helper.offsetParent(),this.hasFixedAncestor=this.helper.parents().filter(function(){return"fixed"===I(this).css("position")}).length>0,this.positionAbs=this.element.offset(),this._refreshOffsets(a),this.originalPosition=this.position=this._generatePosition(a,!1),this.originalPageX=a.pageX,this.originalPageY=a.pageY,c.cursorAt&&this._adjustOffsetFromHelper(c.cursorAt),this._setContainment(),this._trigger("start",a)===!1?(this._clear(),!1):(this._cacheHelperProportions(),I.ui.ddmanager&&!c.dropBehaviour&&I.ui.ddmanager.prepareOffsets(this,a),this._mouseDrag(a,!0),I.ui.ddmanager&&I.ui.ddmanager.dragStart(this,a),!0)},_refreshOffsets:function(a){this.offset={top:this.positionAbs.top-this.margins.top,left:this.positionAbs.left-this.margins.left,scroll:!1,parent:this._getParentOffset(),relative:this._getRelativeOffset()},this.offset.click={left:a.pageX-this.offset.left,top:a.pageY-this.offset.top}},_mouseDrag:function(a,c){if(this.hasFixedAncestor&&(this.offset.parent=this._getParentOffset()),this.position=this._generatePosition(a,!0),this.positionAbs=this._convertPositionTo("absolute"),!c){var d=this._uiHash();if(this._trigger("drag",a,d)===!1){return this._mouseUp(new I.Event("mouseup",a)),!1}this.position=d.position}return this.helper[0].style.left=this.position.left+"px",this.helper[0].style.top=this.position.top+"px",I.ui.ddmanager&&I.ui.ddmanager.drag(this,a),!1},_mouseStop:function(a){var c=this,d=!1;return I.ui.ddmanager&&!this.options.dropBehaviour&&(d=I.ui.ddmanager.drop(this,a)),this.dropped&&(d=this.dropped,this.dropped=!1),"invalid"===this.options.revert&&!d||"valid"===this.options.revert&&d||this.options.revert===!0||I.isFunction(this.options.revert)&&this.options.revert.call(this.element,d)?I(this.helper).animate(this.originalPosition,parseInt(this.options.revertDuration,10),function(){c._trigger("stop",a)!==!1&&c._clear()}):this._trigger("stop",a)!==!1&&this._clear(),!1},_mouseUp:function(a){return this._unblockFrames(),I.ui.ddmanager&&I.ui.ddmanager.dragStop(this,a),this.handleElement.is(a.target)&&this.element.trigger("focus"),I.ui.mouse.prototype._mouseUp.call(this,a)},cancel:function(){return this.helper.is(".ui-draggable-dragging")?this._mouseUp(new I.Event("mouseup",{target:this.element[0]})):this._clear(),this},_getHandle:function(a){return this.options.handle?!!I(a.target).closest(this.element.find(this.options.handle)).length:!0},_setHandleClassName:function(){this.handleElement=this.options.handle?this.element.find(this.options.handle):this.element,this._addClass(this.handleElement,"ui-draggable-handle")},_removeHandleClassName:function(){this._removeClass(this.handleElement,"ui-draggable-handle")},_createHelper:function(a){var c=this.options,f=I.isFunction(c.helper),d=f?I(c.helper.apply(this.element[0],[a])):"clone"===c.helper?this.element.clone().removeAttr("id"):this.element;return d.parents("body").length||d.appendTo("parent"===c.appendTo?this.element[0].parentNode:c.appendTo),f&&d[0]===this.element[0]&&this._setPositionRelative(),d[0]===this.element[0]||/(fixed|absolute)/.test(d.css("position"))||d.css("position","absolute"),d},_setPositionRelative:function(){/^(?:r|a|f)/.test(this.element.css("position"))||(this.element[0].style.position="relative")},_adjustOffsetFromHelper:function(a){"string"==typeof a&&(a=a.split(" ")),I.isArray(a)&&(a={left:+a[0],top:+a[1]||0}),"left" in a&&(this.offset.click.left=a.left+this.margins.left),"right" in a&&(this.offset.click.left=this.helperProportions.width-a.right+this.margins.left),"top" in a&&(this.offset.click.top=a.top+this.margins.top),"bottom" in a&&(this.offset.click.top=this.helperProportions.height-a.bottom+this.margins.top)},_isRootNode:function(a){return/(html|body)/i.test(a.tagName)||a===this.document[0]},_getParentOffset:function(){var a=this.offsetParent.offset(),c=this.document[0];return"absolute"===this.cssPosition&&this.scrollParent[0]!==c&&I.contains(this.scrollParent[0],this.offsetParent[0])&&(a.left+=this.scrollParent.scrollLeft(),a.top+=this.scrollParent.scrollTop()),this._isRootNode(this.offsetParent[0])&&(a={top:0,left:0}),{top:a.top+(parseInt(this.offsetParent.css("borderTopWidth"),10)||0),left:a.left+(parseInt(this.offsetParent.css("borderLeftWidth"),10)||0)}},_getRelativeOffset:function(){if("relative"!==this.cssPosition){return{top:0,left:0}}var c=this.element.position(),a=this._isRootNode(this.scrollParent[0]);return{top:c.top-(parseInt(this.helper.css("top"),10)||0)+(a?0:this.scrollParent.scrollTop()),left:c.left-(parseInt(this.helper.css("left"),10)||0)+(a?0:this.scrollParent.scrollLeft())}},_cacheMargins:function(){this.margins={left:parseInt(this.element.css("marginLeft"),10)||0,top:parseInt(this.element.css("marginTop"),10)||0,right:parseInt(this.element.css("marginRight"),10)||0,bottom:parseInt(this.element.css("marginBottom"),10)||0}},_cacheHelperProportions:function(){this.helperProportions={width:this.helper.outerWidth(),height:this.helper.outerHeight()}},_setContainment:function(){var a,c,g,d=this.options,f=this.document[0];return this.relativeContainer=null,d.containment?"window"===d.containment?(this.containment=[I(window).scrollLeft()-this.offset.relative.left-this.offset.parent.left,I(window).scrollTop()-this.offset.relative.top-this.offset.parent.top,I(window).scrollLeft()+I(window).width()-this.helperProportions.width-this.margins.left,I(window).scrollTop()+(I(window).height()||f.body.parentNode.scrollHeight)-this.helperProportions.height-this.margins.top],void 0):"document"===d.containment?(this.containment=[0,0,I(f).width()-this.helperProportions.width-this.margins.left,(I(f).height()||f.body.parentNode.scrollHeight)-this.helperProportions.height-this.margins.top],void 0):d.containment.constructor===Array?(this.containment=d.containment,void 0):("parent"===d.containment&&(d.containment=this.helper[0].parentNode),c=I(d.containment),g=c[0],g&&(a=/(scroll|auto)/.test(c.css("overflow")),this.containment=[(parseInt(c.css("borderLeftWidth"),10)||0)+(parseInt(c.css("paddingLeft"),10)||0),(parseInt(c.css("borderTopWidth"),10)||0)+(parseInt(c.css("paddingTop"),10)||0),(a?Math.max(g.scrollWidth,g.offsetWidth):g.offsetWidth)-(parseInt(c.css("borderRightWidth"),10)||0)-(parseInt(c.css("paddingRight"),10)||0)-this.helperProportions.width-this.margins.left-this.margins.right,(a?Math.max(g.scrollHeight,g.offsetHeight):g.offsetHeight)-(parseInt(c.css("borderBottomWidth"),10)||0)-(parseInt(c.css("paddingBottom"),10)||0)-this.helperProportions.height-this.margins.top-this.margins.bottom],this.relativeContainer=c),void 0):(this.containment=null,void 0)},_convertPositionTo:function(f,a){a||(a=this.position);var c="absolute"===f?1:-1,d=this._isRootNode(this.scrollParent[0]);return{top:a.top+this.offset.relative.top*c+this.offset.parent.top*c-("fixed"===this.cssPosition?-this.offset.scroll.top:d?0:this.offset.scroll.top)*c,left:a.left+this.offset.relative.left*c+this.offset.parent.left*c-("fixed"===this.cssPosition?-this.offset.scroll.left:d?0:this.offset.scroll.left)*c}},_generatePosition:function(M,d){var g,L,p,u,c=this.options,v=this._isRootNode(this.scrollParent[0]),f=M.pageX,m=M.pageY;return v&&this.offset.scroll||(this.offset.scroll={top:this.scrollParent.scrollTop(),left:this.scrollParent.scrollLeft()}),d&&(this.containment&&(this.relativeContainer?(L=this.relativeContainer.offset(),g=[this.containment[0]+L.left,this.containment[1]+L.top,this.containment[2]+L.left,this.containment[3]+L.top]):g=this.containment,M.pageX-this.offset.click.left<g[0]&&(f=g[0]+this.offset.click.left),M.pageY-this.offset.click.top<g[1]&&(m=g[1]+this.offset.click.top),M.pageX-this.offset.click.left>g[2]&&(f=g[2]+this.offset.click.left),M.pageY-this.offset.click.top>g[3]&&(m=g[3]+this.offset.click.top)),c.grid&&(p=c.grid[1]?this.originalPageY+Math.round((m-this.originalPageY)/c.grid[1])*c.grid[1]:this.originalPageY,m=g?p-this.offset.click.top>=g[1]||p-this.offset.click.top>g[3]?p:p-this.offset.click.top>=g[1]?p-c.grid[1]:p+c.grid[1]:p,u=c.grid[0]?this.originalPageX+Math.round((f-this.originalPageX)/c.grid[0])*c.grid[0]:this.originalPageX,f=g?u-this.offset.click.left>=g[0]||u-this.offset.click.left>g[2]?u:u-this.offset.click.left>=g[0]?u-c.grid[0]:u+c.grid[0]:u),"y"===c.axis&&(f=this.originalPageX),"x"===c.axis&&(m=this.originalPageY)),{top:m-this.offset.click.top-this.offset.relative.top-this.offset.parent.top+("fixed"===this.cssPosition?-this.offset.scroll.top:v?0:this.offset.scroll.top),left:f-this.offset.click.left-this.offset.relative.left-this.offset.parent.left+("fixed"===this.cssPosition?-this.offset.scroll.left:v?0:this.offset.scroll.left)}},_clear:function(){this._removeClass(this.helper,"ui-draggable-dragging"),this.helper[0]===this.element[0]||this.cancelHelperRemoval||this.helper.remove(),this.helper=null,this.cancelHelperRemoval=!1,this.destroyOnClear&&this.destroy()},_trigger:function(a,c,d){return d=d||this._uiHash(),I.ui.plugin.call(this,a,[c,d,this],!0),/^(drag|start|stop)/.test(a)&&(this.positionAbs=this._convertPositionTo("absolute"),d.offset=this.positionAbs),I.Widget.prototype._trigger.call(this,a,c,d)},plugins:{},_uiHash:function(){return{helper:this.helper,position:this.position,originalPosition:this.originalPosition,offset:this.positionAbs}}}),I.ui.plugin.add("draggable","connectToSortable",{start:function(a,c,f){var d=I.extend({},c,{item:f.element});f.sortables=[],I(f.options.connectToSortable).each(function(){var e=I(this).sortable("instance");e&&!e.options.disabled&&(f.sortables.push(e),e.refreshPositions(),e._trigger("activate",a,d))})},stop:function(a,c,f){var d=I.extend({},c,{item:f.element});f.cancelHelperRemoval=!1,I.each(f.sortables,function(){var e=this;e.isOver?(e.isOver=0,f.cancelHelperRemoval=!0,e.cancelHelperRemoval=!1,e._storedCSS={position:e.placeholder.css("position"),top:e.placeholder.css("top"),left:e.placeholder.css("left")},e._mouseStop(a),e.options.helper=e.options._helper):(e.cancelHelperRemoval=!0,e._trigger("deactivate",a,d))})},drag:function(a,c,d){I.each(d.sortables,function(){var e=!1,f=this;f.positionAbs=d.positionAbs,f.helperProportions=d.helperProportions,f.offset.click=d.offset.click,f._intersectsWith(f.containerCache)&&(e=!0,I.each(d.sortables,function(){return this.positionAbs=d.positionAbs,this.helperProportions=d.helperProportions,this.offset.click=d.offset.click,this!==f&&this._intersectsWith(this.containerCache)&&I.contains(f.element[0],this.element[0])&&(e=!1),e})),e?(f.isOver||(f.isOver=1,d._parent=c.helper.parent(),f.currentItem=c.helper.appendTo(f.element).data("ui-sortable-item",!0),f.options._helper=f.options.helper,f.options.helper=function(){return c.helper[0]},a.target=f.currentItem[0],f._mouseCapture(a,!0),f._mouseStart(a,!0,!0),f.offset.click.top=d.offset.click.top,f.offset.click.left=d.offset.click.left,f.offset.parent.left-=d.offset.parent.left-f.offset.parent.left,f.offset.parent.top-=d.offset.parent.top-f.offset.parent.top,d._trigger("toSortable",a),d.dropped=f.element,I.each(d.sortables,function(){this.refreshPositions()}),d.currentItem=d.element,f.fromOutside=d),f.currentItem&&(f._mouseDrag(a),c.position=f.position)):f.isOver&&(f.isOver=0,f.cancelHelperRemoval=!0,f.options._revert=f.options.revert,f.options.revert=!1,f._trigger("out",a,f._uiHash(f)),f._mouseStop(a,!0),f.options.revert=f.options._revert,f.options.helper=f.options._helper,f.placeholder&&f.placeholder.remove(),c.helper.appendTo(d._parent),d._refreshOffsets(a),c.position=d._generatePosition(a,!0),d._trigger("fromSortable",a),d.dropped=!1,I.each(d.sortables,function(){this.refreshPositions()}))})}}),I.ui.plugin.add("draggable","cursor",{start:function(a,c,g){var d=I("body"),f=g.options;d.css("cursor")&&(f._cursor=d.css("cursor")),d.css("cursor",f.cursor)},stop:function(a,c,f){var d=f.options;d._cursor&&I("body").css("cursor",d._cursor)}}),I.ui.plugin.add("draggable","opacity",{start:function(a,c,g){var d=I(c.helper),f=g.options;d.css("opacity")&&(f._opacity=d.css("opacity")),d.css("opacity",f.opacity)},stop:function(a,c,f){var d=f.options;d._opacity&&I(c.helper).css("opacity",d._opacity)}}),I.ui.plugin.add("draggable","scroll",{start:function(d,a,c){c.scrollParentNotHidden||(c.scrollParentNotHidden=c.helper.scrollParent(!1)),c.scrollParentNotHidden[0]!==c.document[0]&&"HTML"!==c.scrollParentNotHidden[0].tagName&&(c.overflowOffset=c.scrollParentNotHidden.offset())},drag:function(d,f,m){var g=m.options,h=!1,c=m.scrollParentNotHidden[0],l=m.document[0];c!==l&&"HTML"!==c.tagName?(g.axis&&"x"===g.axis||(m.overflowOffset.top+c.offsetHeight-d.pageY<g.scrollSensitivity?c.scrollTop=h=c.scrollTop+g.scrollSpeed:d.pageY-m.overflowOffset.top<g.scrollSensitivity&&(c.scrollTop=h=c.scrollTop-g.scrollSpeed)),g.axis&&"y"===g.axis||(m.overflowOffset.left+c.offsetWidth-d.pageX<g.scrollSensitivity?c.scrollLeft=h=c.scrollLeft+g.scrollSpeed:d.pageX-m.overflowOffset.left<g.scrollSensitivity&&(c.scrollLeft=h=c.scrollLeft-g.scrollSpeed))):(g.axis&&"x"===g.axis||(d.pageY-I(l).scrollTop()<g.scrollSensitivity?h=I(l).scrollTop(I(l).scrollTop()-g.scrollSpeed):I(window).height()-(d.pageY-I(l).scrollTop())<g.scrollSensitivity&&(h=I(l).scrollTop(I(l).scrollTop()+g.scrollSpeed))),g.axis&&"y"===g.axis||(d.pageX-I(l).scrollLeft()<g.scrollSensitivity?h=I(l).scrollLeft(I(l).scrollLeft()-g.scrollSpeed):I(window).width()-(d.pageX-I(l).scrollLeft())<g.scrollSensitivity&&(h=I(l).scrollLeft(I(l).scrollLeft()+g.scrollSpeed)))),h!==!1&&I.ui.ddmanager&&!g.dropBehaviour&&I.ui.ddmanager.prepareOffsets(m,d)}}),I.ui.plugin.add("draggable","snap",{start:function(a,c,f){var d=f.options;f.snapElements=[],I(d.snap.constructor!==String?d.snap.items||":data(ui-draggable)":d.snap).each(function(){var g=I(this),h=g.offset();this!==f.element[0]&&f.snapElements.push({item:this,width:g.outerWidth(),height:g.outerHeight(),top:h.top,left:h.left})})},drag:function(P,T,aa){var W,X,L,Z,S,U,N,ab,O,Y,Q=aa.options,R=Q.snapTolerance,V=T.offset.left,t=V+aa.helperProportions.width,ac=T.offset.top,M=ac+aa.helperProportions.height;for(O=aa.snapElements.length-1;O>=0;O--){S=aa.snapElements[O].left-aa.margins.left,U=S+aa.snapElements[O].width,N=aa.snapElements[O].top-aa.margins.top,ab=N+aa.snapElements[O].height,S-R>t||V>U+R||N-R>M||ac>ab+R||!I.contains(aa.snapElements[O].item.ownerDocument,aa.snapElements[O].item)?(aa.snapElements[O].snapping&&aa.options.snap.release&&aa.options.snap.release.call(aa.element,P,I.extend(aa._uiHash(),{snapItem:aa.snapElements[O].item})),aa.snapElements[O].snapping=!1):("inner"!==Q.snapMode&&(W=R>=Math.abs(N-M),X=R>=Math.abs(ab-ac),L=R>=Math.abs(S-t),Z=R>=Math.abs(U-V),W&&(T.position.top=aa._convertPositionTo("relative",{top:N-aa.helperProportions.height,left:0}).top),X&&(T.position.top=aa._convertPositionTo("relative",{top:ab,left:0}).top),L&&(T.position.left=aa._convertPositionTo("relative",{top:0,left:S-aa.helperProportions.width}).left),Z&&(T.position.left=aa._convertPositionTo("relative",{top:0,left:U}).left)),Y=W||X||L||Z,"outer"!==Q.snapMode&&(W=R>=Math.abs(N-ac),X=R>=Math.abs(ab-M),L=R>=Math.abs(S-V),Z=R>=Math.abs(U-t),W&&(T.position.top=aa._convertPositionTo("relative",{top:N,left:0}).top),X&&(T.position.top=aa._convertPositionTo("relative",{top:ab-aa.helperProportions.height,left:0}).top),L&&(T.position.left=aa._convertPositionTo("relative",{top:0,left:S}).left),Z&&(T.position.left=aa._convertPositionTo("relative",{top:0,left:U-aa.helperProportions.width}).left)),!aa.snapElements[O].snapping&&(W||X||L||Z||Y)&&aa.options.snap.snap&&aa.options.snap.snap.call(aa.element,P,I.extend(aa._uiHash(),{snapItem:aa.snapElements[O].item})),aa.snapElements[O].snapping=W||X||L||Z||Y)}}}),I.ui.plugin.add("draggable","stack",{start:function(d,f,l){var g,h=l.options,c=I.makeArray(I(h.stack)).sort(function(a,m){return(parseInt(I(a).css("zIndex"),10)||0)-(parseInt(I(m).css("zIndex"),10)||0)});c.length&&(g=parseInt(I(c[0]).css("zIndex"),10)||0,I(c).each(function(a){I(this).css("zIndex",g+a)}),this.css("zIndex",g+c.length))}}),I.ui.plugin.add("draggable","zIndex",{start:function(a,c,g){var d=I(c.helper),f=g.options;d.css("zIndex")&&(f._zIndex=d.css("zIndex")),d.css("zIndex",f.zIndex)},stop:function(a,c,f){var d=f.options;d._zIndex&&I(c.helper).css("zIndex",d._zIndex)}}),I.ui.draggable,I.widget("ui.droppable",{version:"1.12.1",widgetEventPrefix:"drop",options:{accept:"*",addClasses:!0,greedy:!1,scope:"default",tolerance:"intersect",activate:null,deactivate:null,drop:null,out:null,over:null},_create:function(){var a,c=this.options,d=c.accept;this.isover=!1,this.isout=!0,this.accept=I.isFunction(d)?d:function(e){return e.is(d)},this.proportions=function(){return arguments.length?(a=arguments[0],void 0):a?a:a={width:this.element[0].offsetWidth,height:this.element[0].offsetHeight}},this._addToManager(c.scope),c.addClasses&&this._addClass("ui-droppable")},_addToManager:function(a){I.ui.ddmanager.droppables[a]=I.ui.ddmanager.droppables[a]||[],I.ui.ddmanager.droppables[a].push(this)},_splice:function(c){for(var a=0;c.length>a;a++){c[a]===this&&c.splice(a,1)}},_destroy:function(){var a=I.ui.ddmanager.droppables[this.options.scope];this._splice(a)},_setOption:function(a,c){if("accept"===a){this.accept=I.isFunction(c)?c:function(e){return e.is(c)}}else{if("scope"===a){var d=I.ui.ddmanager.droppables[this.options.scope];this._splice(d),this._addToManager(c)}}this._super(a,c)},_activate:function(a){var c=I.ui.ddmanager.current;this._addActiveClass(),c&&this._trigger("activate",a,this.ui(c))},_deactivate:function(a){var c=I.ui.ddmanager.current;this._removeActiveClass(),c&&this._trigger("deactivate",a,this.ui(c))},_over:function(a){var c=I.ui.ddmanager.current;c&&(c.currentItem||c.element)[0]!==this.element[0]&&this.accept.call(this.element[0],c.currentItem||c.element)&&(this._addHoverClass(),this._trigger("over",a,this.ui(c)))},_out:function(a){var c=I.ui.ddmanager.current;c&&(c.currentItem||c.element)[0]!==this.element[0]&&this.accept.call(this.element[0],c.currentItem||c.element)&&(this._removeHoverClass(),this._trigger("out",a,this.ui(c)))},_drop:function(a,c){var f=c||I.ui.ddmanager.current,d=!1;return f&&(f.currentItem||f.element)[0]!==this.element[0]?(this.element.find(":data(ui-droppable)").not(".ui-draggable-dragging").each(function(){var e=I(this).droppable("instance");return e.options.greedy&&!e.options.disabled&&e.options.scope===f.options.scope&&e.accept.call(e.element[0],f.currentItem||f.element)&&J(f,I.extend(e,{offset:e.element.offset()}),e.options.tolerance,a)?(d=!0,!1):void 0}),d?!1:this.accept.call(this.element[0],f.currentItem||f.element)?(this._removeActiveClass(),this._removeHoverClass(),this._trigger("drop",a,this.ui(f)),this.element):!1):!1},ui:function(a){return{draggable:a.currentItem||a.element,helper:a.helper,position:a.position,offset:a.positionAbs}},_addHoverClass:function(){this._addClass("ui-droppable-hover")},_removeHoverClass:function(){this._removeClass("ui-droppable-hover")},_addActiveClass:function(){this._addClass("ui-droppable-active")},_removeActiveClass:function(){this._removeClass("ui-droppable-active")}});var J=I.ui.intersect=function(){function a(f,c,d){return f>=c&&c+d>f}return function(p,v,P,M){if(!v.offset){return !1}var N=(p.positionAbs||p.position.absolute).left+p.margins.left,f=(p.positionAbs||p.position.absolute).top+p.margins.top,O=N+p.helperProportions.width,t=f+p.helperProportions.height,L=v.offset.left,g=v.offset.top,Q=L+v.proportions().width,m=g+v.proportions().height;switch(P){case"fit":return N>=L&&Q>=O&&f>=g&&m>=t;case"intersect":return N+p.helperProportions.width/2>L&&Q>O-p.helperProportions.width/2&&f+p.helperProportions.height/2>g&&m>t-p.helperProportions.height/2;case"pointer":return a(M.pageY,g,v.proportions().height)&&a(M.pageX,L,v.proportions().width);case"touch":return(f>=g&&m>=f||t>=g&&m>=t||g>f&&t>m)&&(N>=L&&Q>=N||O>=L&&Q>=O||L>N&&O>Q);default:return !1}}}();I.ui.ddmanager={current:null,droppables:{"default":[]},prepareOffsets:function(d,f){var m,g,h=I.ui.ddmanager.droppables[d.options.scope]||[],c=f?f.type:null,l=(d.currentItem||d.element).find(":data(ui-droppable)").addBack();I:for(m=0;h.length>m;m++){if(!(h[m].options.disabled||d&&!h[m].accept.call(h[m].element[0],d.currentItem||d.element))){for(g=0;l.length>g;g++){if(l[g]===h[m].element[0]){h[m].proportions().height=0;continue I}}h[m].visible="none"!==h[m].element.css("display"),h[m].visible&&("mousedown"===c&&h[m]._activate.call(h[m],f),h[m].offset=h[m].element.offset(),h[m].proportions({width:h[m].element[0].offsetWidth,height:h[m].element[0].offsetHeight}))}}},drop:function(a,c){var d=!1;return I.each((I.ui.ddmanager.droppables[a.options.scope]||[]).slice(),function(){this.options&&(!this.options.disabled&&this.visible&&J(a,this,this.options.tolerance,c)&&(d=this._drop.call(this,c)||d),!this.options.disabled&&this.visible&&this.accept.call(this.element[0],a.currentItem||a.element)&&(this.isout=!0,this.isover=!1,this._deactivate.call(this,c)))}),d},dragStart:function(a,c){a.element.parentsUntil("body").on("scroll.droppable",function(){a.options.refreshPositions||I.ui.ddmanager.prepareOffsets(a,c)})},drag:function(a,c){a.options.refreshPositions&&I.ui.ddmanager.prepareOffsets(a,c),I.each(I.ui.ddmanager.droppables[a.options.scope]||[],function(){if(!this.options.disabled&&!this.greedyChild&&this.visible){var h,e,f,d=J(a,this,this.options.tolerance,c),g=!d&&this.isover?"isout":d&&!this.isover?"isover":null;g&&(this.options.greedy&&(e=this.options.scope,f=this.element.parents(":data(ui-droppable)").filter(function(){return I(this).droppable("instance").options.scope===e}),f.length&&(h=I(f[0]).droppable("instance"),h.greedyChild="isover"===g)),h&&"isover"===g&&(h.isover=!1,h.isout=!0,h._out.call(h,c)),this[g]=!0,this["isout"===g?"isover":"isout"]=!1,this["isover"===g?"_over":"_out"].call(this,c),h&&"isout"===g&&(h.isout=!1,h.isover=!0,h._over.call(h,c)))}})},dragStop:function(a,c){a.element.parentsUntil("body").off("scroll.droppable"),a.options.refreshPositions||I.ui.ddmanager.prepareOffsets(a,c)}},I.uiBackCompat!==!1&&I.widget("ui.droppable",I.ui.droppable,{options:{hoverClass:!1,activeClass:!1},_addActiveClass:function(){this._super(),this.options.activeClass&&this.element.addClass(this.options.activeClass)},_removeActiveClass:function(){this._super(),this.options.activeClass&&this.element.removeClass(this.options.activeClass)},_addHoverClass:function(){this._super(),this.options.hoverClass&&this.element.addClass(this.options.hoverClass)},_removeHoverClass:function(){this._super(),this.options.hoverClass&&this.element.removeClass(this.options.hoverClass)}}),I.ui.droppable,I.widget("ui.resizable",I.ui.mouse,{version:"1.12.1",widgetEventPrefix:"resize",options:{alsoResize:!1,animate:!1,animateDuration:"slow",animateEasing:"swing",aspectRatio:!1,autoHide:!1,classes:{"ui-resizable-se":"ui-icon ui-icon-gripsmall-diagonal-se"},containment:!1,ghost:!1,grid:!1,handles:"e,s,se",helper:!1,maxHeight:null,maxWidth:null,minHeight:10,minWidth:10,zIndex:90,resize:null,start:null,stop:null},_num:function(a){return parseFloat(a)||0},_isNumber:function(a){return !isNaN(parseFloat(a))},_hasScroll:function(a,c){if("hidden"===I(a).css("overflow")){return !1}var f=c&&"left"===c?"scrollLeft":"scrollTop",d=!1;return a[f]>0?!0:(a[f]=1,d=a[f]>0,a[f]=0,d)},_create:function(){var a,c=this.options,d=this;this._addClass("ui-resizable"),I.extend(this,{_aspectRatio:!!c.aspectRatio,aspectRatio:c.aspectRatio,originalElement:this.element,_proportionallyResizeElements:[],_helper:c.helper||c.ghost||c.animate?c.helper||"ui-resizable-helper":null}),this.element[0].nodeName.match(/^(canvas|textarea|input|select|button|img)$/i)&&(this.element.wrap(I("<div class='ui-wrapper' style='overflow: hidden;'></div>").css({position:this.element.css("position"),width:this.element.outerWidth(),height:this.element.outerHeight(),top:this.element.css("top"),left:this.element.css("left")})),this.element=this.element.parent().data("ui-resizable",this.element.resizable("instance")),this.elementIsWrapper=!0,a={marginTop:this.originalElement.css("marginTop"),marginRight:this.originalElement.css("marginRight"),marginBottom:this.originalElement.css("marginBottom"),marginLeft:this.originalElement.css("marginLeft")},this.element.css(a),this.originalElement.css("margin",0),this.originalResizeStyle=this.originalElement.css("resize"),this.originalElement.css("resize","none"),this._proportionallyResizeElements.push(this.originalElement.css({position:"static",zoom:1,display:"block"})),this.originalElement.css(a),this._proportionallyResize()),this._setupHandles(),c.autoHide&&I(this.element).on("mouseenter",function(){c.disabled||(d._removeClass("ui-resizable-autohide"),d._handles.show())}).on("mouseleave",function(){c.disabled||d.resizing||(d._addClass("ui-resizable-autohide"),d._handles.hide())}),this._mouseInit()},_destroy:function(){this._mouseDestroy();var a,c=function(d){I(d).removeData("resizable").removeData("ui-resizable").off(".resizable").find(".ui-resizable-handle").remove()};return this.elementIsWrapper&&(c(this.element),a=this.element,this.originalElement.css({position:a.css("position"),width:a.outerWidth(),height:a.outerHeight(),top:a.css("top"),left:a.css("left")}).insertAfter(a),a.remove()),this.originalElement.css("resize",this.originalResizeStyle),c(this.originalElement),this},_setOption:function(c,a){switch(this._super(c,a),c){case"handles":this._removeHandles(),this._setupHandles();break;default:}},_setupHandles:function(){var d,f,m,g,h,c=this.options,l=this;if(this.handles=c.handles||(I(".ui-resizable-handle",this.element).length?{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"}:"e,s,se"),this._handles=I(),this.handles.constructor===String){for("all"===this.handles&&(this.handles="n,e,s,w,se,sw,ne,nw"),m=this.handles.split(","),this.handles={},f=0;m.length>f;f++){d=I.trim(m[f]),g="ui-resizable-"+d,h=I("<div>"),this._addClass(h,"ui-resizable-handle "+g),h.css({zIndex:c.zIndex}),this.handles[d]=".ui-resizable-"+d,this.element.append(h)}}this._renderAxis=function(a){var p,u,r,t;a=a||this.element;for(p in this.handles){this.handles[p].constructor===String?this.handles[p]=this.element.children(this.handles[p]).first().show():(this.handles[p].jquery||this.handles[p].nodeType)&&(this.handles[p]=I(this.handles[p]),this._on(this.handles[p],{mousedown:l._mouseDown})),this.elementIsWrapper&&this.originalElement[0].nodeName.match(/^(textarea|input|select|button)$/i)&&(u=I(this.handles[p],this.element),t=/sw|ne|nw|se|n|s/.test(p)?u.outerHeight():u.outerWidth(),r=["padding",/ne|nw|n/.test(p)?"Top":/se|sw|s/.test(p)?"Bottom":/^e$/.test(p)?"Right":"Left"].join(""),a.css(r,t),this._proportionallyResize()),this._handles=this._handles.add(this.handles[p])}},this._renderAxis(this.element),this._handles=this._handles.add(this.element.find(".ui-resizable-handle")),this._handles.disableSelection(),this._handles.on("mouseover",function(){l.resizing||(this.className&&(h=this.className.match(/ui-resizable-(se|sw|ne|nw|n|e|s|w)/i)),l.axis=h&&h[1]?h[1]:"se")}),c.autoHide&&(this._handles.hide(),this._addClass("ui-resizable-autohide"))},_removeHandles:function(){this._handles.remove()},_mouseCapture:function(a){var c,f,d=!1;for(c in this.handles){f=I(this.handles[c])[0],(f===a.target||I.contains(f,a.target))&&(d=!0)}return !this.options.disabled&&d},_mouseStart:function(d){var f,l,g,h=this.options,c=this.element;return this.resizing=!0,this._renderProxy(),f=this._num(this.helper.css("left")),l=this._num(this.helper.css("top")),h.containment&&(f+=I(h.containment).scrollLeft()||0,l+=I(h.containment).scrollTop()||0),this.offset=this.helper.offset(),this.position={left:f,top:l},this.size=this._helper?{width:this.helper.width(),height:this.helper.height()}:{width:c.width(),height:c.height()},this.originalSize=this._helper?{width:c.outerWidth(),height:c.outerHeight()}:{width:c.width(),height:c.height()},this.sizeDiff={width:c.outerWidth()-c.width(),height:c.outerHeight()-c.height()},this.originalPosition={left:f,top:l},this.originalMousePosition={left:d.pageX,top:d.pageY},this.aspectRatio="number"==typeof h.aspectRatio?h.aspectRatio:this.originalSize.width/this.originalSize.height||1,g=I(".ui-resizable-"+this.axis).css("cursor"),I("body").css("cursor","auto"===g?this.axis+"-resize":g),this._addClass("ui-resizable-resizing"),this._propagate("start",d),!0},_mouseDrag:function(d){var g,t,l=this.originalMousePosition,m=this.axis,c=d.pageX-l.left||0,p=d.pageY-l.top||0,f=this._change[m];return this._updatePrevProperties(),f?(g=f.apply(this,[d,c,p]),this._updateVirtualBoundaries(d.shiftKey),(this._aspectRatio||d.shiftKey)&&(g=this._updateRatio(g,d)),g=this._respectSize(g,d),this._updateCache(g),this._propagate("resize",d),t=this._applyChanges(),!this._helper&&this._proportionallyResizeElements.length&&this._proportionallyResize(),I.isEmptyObject(t)||(this._updatePrevProperties(),this._trigger("resize",d,this.ui()),this._applyChanges()),!1):!1},_mouseStop:function(g){this.resizing=!1;var p,M,u,v,d,L,m,t=this.options,f=this;return this._helper&&(p=this._proportionallyResizeElements,M=p.length&&/textarea/i.test(p[0].nodeName),u=M&&this._hasScroll(p[0],"left")?0:f.sizeDiff.height,v=M?0:f.sizeDiff.width,d={width:f.helper.width()-v,height:f.helper.height()-u},L=parseFloat(f.element.css("left"))+(f.position.left-f.originalPosition.left)||null,m=parseFloat(f.element.css("top"))+(f.position.top-f.originalPosition.top)||null,t.animate||this.element.css(I.extend(d,{top:m,left:L})),f.helper.height(f.size.height),f.helper.width(f.size.width),this._helper&&!t.animate&&this._proportionallyResize()),I("body").css("cursor","auto"),this._removeClass("ui-resizable-resizing"),this._propagate("stop",g),this._helper&&this.helper.remove(),!1},_updatePrevProperties:function(){this.prevPosition={top:this.position.top,left:this.position.left},this.prevSize={width:this.size.width,height:this.size.height}},_applyChanges:function(){var a={};return this.position.top!==this.prevPosition.top&&(a.top=this.position.top+"px"),this.position.left!==this.prevPosition.left&&(a.left=this.position.left+"px"),this.size.width!==this.prevSize.width&&(a.width=this.size.width+"px"),this.size.height!==this.prevSize.height&&(a.height=this.size.height+"px"),this.helper.css(a),a},_updateVirtualBoundaries:function(m){var d,f,l,g,h,c=this.options;h={minWidth:this._isNumber(c.minWidth)?c.minWidth:0,maxWidth:this._isNumber(c.maxWidth)?c.maxWidth:1/0,minHeight:this._isNumber(c.minHeight)?c.minHeight:0,maxHeight:this._isNumber(c.maxHeight)?c.maxHeight:1/0},(this._aspectRatio||m)&&(d=h.minHeight*this.aspectRatio,l=h.minWidth/this.aspectRatio,f=h.maxHeight*this.aspectRatio,g=h.maxWidth/this.aspectRatio,d>h.minWidth&&(h.minWidth=d),l>h.minHeight&&(h.minHeight=l),h.maxWidth>f&&(h.maxWidth=f),h.maxHeight>g&&(h.maxHeight=g)),this._vBoundaries=h},_updateCache:function(a){this.offset=this.helper.offset(),this._isNumber(a.left)&&(this.position.left=a.left),this._isNumber(a.top)&&(this.position.top=a.top),this._isNumber(a.height)&&(this.size.height=a.height),this._isNumber(a.width)&&(this.size.width=a.width)},_updateRatio:function(f){var a=this.position,c=this.size,d=this.axis;return this._isNumber(f.height)?f.width=f.height*this.aspectRatio:this._isNumber(f.width)&&(f.height=f.width/this.aspectRatio),"sw"===d&&(f.left=a.left+(c.width-f.width),f.top=null),"nw"===d&&(f.top=a.top+(c.height-f.height),f.left=a.left+(c.width-f.width)),f},_respectSize:function(O){var g=this._vBoundaries,p=this.axis,N=this._isNumber(O.width)&&g.maxWidth&&g.maxWidth<O.width,v=this._isNumber(O.height)&&g.maxHeight&&g.maxHeight<O.height,L=this._isNumber(O.width)&&g.minWidth&&g.minWidth>O.width,d=this._isNumber(O.height)&&g.minHeight&&g.minHeight>O.height,M=this.originalPosition.left+this.originalSize.width,m=this.originalPosition.top+this.originalSize.height,u=/sw|nw|w/.test(p),f=/nw|ne|n/.test(p);return L&&(O.width=g.minWidth),d&&(O.height=g.minHeight),N&&(O.width=g.maxWidth),v&&(O.height=g.maxHeight),L&&u&&(O.left=M-g.minWidth),N&&u&&(O.left=M-g.maxWidth),d&&f&&(O.top=m-g.minHeight),v&&f&&(O.top=m-g.maxHeight),O.width||O.height||O.left||!O.top?O.width||O.height||O.top||!O.left||(O.left=null):O.top=null,O},_getPaddingPlusBorderDimensions:function(g){for(var a=0,c=[],f=[g.css("borderTopWidth"),g.css("borderRightWidth"),g.css("borderBottomWidth"),g.css("borderLeftWidth")],d=[g.css("paddingTop"),g.css("paddingRight"),g.css("paddingBottom"),g.css("paddingLeft")];4>a;a++){c[a]=parseFloat(f[a])||0,c[a]+=parseFloat(d[a])||0}return{height:c[0]+c[2],width:c[1]+c[3]}},_proportionallyResize:function(){if(this._proportionallyResizeElements.length){for(var d,a=0,c=this.helper||this.element;this._proportionallyResizeElements.length>a;a++){d=this._proportionallyResizeElements[a],this.outerDimensions||(this.outerDimensions=this._getPaddingPlusBorderDimensions(d)),d.css({height:c.height()-this.outerDimensions.height||0,width:c.width()-this.outerDimensions.width||0})}}},_renderProxy:function(){var a=this.element,c=this.options;this.elementOffset=a.offset(),this._helper?(this.helper=this.helper||I("<div style='overflow:hidden;'></div>"),this._addClass(this.helper,this._helper),this.helper.css({width:this.element.outerWidth(),height:this.element.outerHeight(),position:"absolute",left:this.elementOffset.left+"px",top:this.elementOffset.top+"px",zIndex:++c.zIndex}),this.helper.appendTo("body").disableSelection()):this.helper=this.element},_change:{e:function(c,a){return{width:this.originalSize.width+a}},w:function(f,a){var c=this.originalSize,d=this.originalPosition;return{left:d.left+a,width:c.width-a}},n:function(g,a,c){var f=this.originalSize,d=this.originalPosition;return{top:d.top+c,height:f.height-c}},s:function(d,a,c){return{height:this.originalSize.height+c}},se:function(a,c,d){return I.extend(this._change.s.apply(this,arguments),this._change.e.apply(this,[a,c,d]))},sw:function(a,c,d){return I.extend(this._change.s.apply(this,arguments),this._change.w.apply(this,[a,c,d]))},ne:function(a,c,d){return I.extend(this._change.n.apply(this,arguments),this._change.e.apply(this,[a,c,d]))},nw:function(a,c,d){return I.extend(this._change.n.apply(this,arguments),this._change.w.apply(this,[a,c,d]))}},_propagate:function(a,c){I.ui.plugin.call(this,a,[c,this.ui()]),"resize"!==a&&this._trigger(a,c,this.ui())},plugins:{},ui:function(){return{originalElement:this.originalElement,element:this.element,helper:this.helper,position:this.position,size:this.size,originalSize:this.originalSize,originalPosition:this.originalPosition}}}),I.ui.plugin.add("resizable","animate",{stop:function(g){var p=I(this).resizable("instance"),M=p.options,u=p._proportionallyResizeElements,v=u.length&&/textarea/i.test(u[0].nodeName),d=v&&p._hasScroll(u[0],"left")?0:p.sizeDiff.height,L=v?0:p.sizeDiff.width,m={width:p.size.width-L,height:p.size.height-d},t=parseFloat(p.element.css("left"))+(p.position.left-p.originalPosition.left)||null,f=parseFloat(p.element.css("top"))+(p.position.top-p.originalPosition.top)||null;p.element.animate(I.extend(m,f&&t?{top:f,left:t}:{}),{duration:M.animateDuration,easing:M.animateEasing,step:function(){var a={width:parseFloat(p.element.css("width")),height:parseFloat(p.element.css("height")),top:parseFloat(p.element.css("top")),left:parseFloat(p.element.css("left"))};u&&u.length&&I(u[0]).css({width:a.width,height:a.height}),p._updateCache(a),p._propagate("resize",g)}})}}),I.ui.plugin.add("resizable","containment",{start:function(){var p,v,P,M,N,f,O,t=I(this).resizable("instance"),L=t.options,g=t.element,Q=L.containment,m=Q instanceof I?Q.get(0):/parent/.test(Q)?g.parent().get(0):Q;m&&(t.containerElement=I(m),/document/.test(Q)||Q===document?(t.containerOffset={left:0,top:0},t.containerPosition={left:0,top:0},t.parentData={element:I(document),left:0,top:0,width:I(document).width(),height:I(document).height()||document.body.parentNode.scrollHeight}):(p=I(m),v=[],I(["Top","Right","Left","Bottom"]).each(function(c,a){v[c]=t._num(p.css("padding"+a))}),t.containerOffset=p.offset(),t.containerPosition=p.position(),t.containerSize={height:p.innerHeight()-v[3],width:p.innerWidth()-v[1]},P=t.containerOffset,M=t.containerSize.height,N=t.containerSize.width,f=t._hasScroll(m,"left")?m.scrollWidth:N,O=t._hasScroll(m)?m.scrollHeight:M,t.parentData={element:m,left:P.left,top:P.top,width:f,height:O}))},resize:function(t){var L,R,N,O,f=I(this).resizable("instance"),Q=f.options,v=f.containerOffset,M=f.position,g=f._aspectRatio||t.shiftKey,S={top:0,left:0},m=f.containerElement,P=!0;m[0]!==document&&/static/.test(m.css("position"))&&(S=v),M.left<(f._helper?v.left:0)&&(f.size.width=f.size.width+(f._helper?f.position.left-v.left:f.position.left-S.left),g&&(f.size.height=f.size.width/f.aspectRatio,P=!1),f.position.left=Q.helper?v.left:0),M.top<(f._helper?v.top:0)&&(f.size.height=f.size.height+(f._helper?f.position.top-v.top:f.position.top),g&&(f.size.width=f.size.height*f.aspectRatio,P=!1),f.position.top=f._helper?v.top:0),N=f.containerElement.get(0)===f.element.parent().get(0),O=/relative|absolute/.test(f.containerElement.css("position")),N&&O?(f.offset.left=f.parentData.left+f.position.left,f.offset.top=f.parentData.top+f.position.top):(f.offset.left=f.element.offset().left,f.offset.top=f.element.offset().top),L=Math.abs(f.sizeDiff.width+(f._helper?f.offset.left-S.left:f.offset.left-v.left)),R=Math.abs(f.sizeDiff.height+(f._helper?f.offset.top-S.top:f.offset.top-v.top)),L+f.size.width>=f.parentData.width&&(f.size.width=f.parentData.width-L,g&&(f.size.height=f.size.width/f.aspectRatio,P=!1)),R+f.size.height>=f.parentData.height&&(f.size.height=f.parentData.height-R,g&&(f.size.width=f.size.height*f.aspectRatio,P=!1)),P||(f.position.left=f.prevPosition.left,f.position.top=f.prevPosition.top,f.size.width=f.prevSize.width,f.size.height=f.prevSize.height)},stop:function(){var d=I(this).resizable("instance"),g=d.options,v=d.containerOffset,p=d.containerPosition,t=d.containerElement,c=I(d.helper),u=c.offset(),f=c.outerWidth()-d.sizeDiff.width,m=c.outerHeight()-d.sizeDiff.height;d._helper&&!g.animate&&/relative/.test(t.css("position"))&&I(this).css({left:u.left-p.left-v.left,width:f,height:m}),d._helper&&!g.animate&&/static/.test(t.css("position"))&&I(this).css({left:u.left-p.left-v.left,width:f,height:m})}}),I.ui.plugin.add("resizable","alsoResize",{start:function(){var a=I(this).resizable("instance"),c=a.options;I(c.alsoResize).each(function(){var d=I(this);d.data("ui-resizable-alsoresize",{width:parseFloat(d.width()),height:parseFloat(d.height()),left:parseFloat(d.css("left")),top:parseFloat(d.css("top"))})})},resize:function(d,f){var m=I(this).resizable("instance"),g=m.options,h=m.originalSize,c=m.originalPosition,l={height:m.size.height-h.height||0,width:m.size.width-h.width||0,top:m.position.top-c.top||0,left:m.position.left-c.left||0};I(g.alsoResize).each(function(){var a=I(this),r=I(this).data("ui-resizable-alsoresize"),i={},p=a.parents(f.originalElement[0]).length?["width","height"]:["width","height","top","left"];I.each(p,function(s,n){var o=(r[n]||0)+(l[n]||0);o&&o>=0&&(i[n]=o||null)}),a.css(i)})},stop:function(){I(this).removeData("ui-resizable-alsoresize")}}),I.ui.plugin.add("resizable","ghost",{start:function(){var a=I(this).resizable("instance"),c=a.size;a.ghost=a.originalElement.clone(),a.ghost.css({opacity:0.25,display:"block",position:"relative",height:c.height,width:c.width,margin:0,left:0,top:0}),a._addClass(a.ghost,"ui-resizable-ghost"),I.uiBackCompat!==!1&&"string"==typeof a.options.ghost&&a.ghost.addClass(this.options.ghost),a.ghost.appendTo(a.helper)},resize:function(){var a=I(this).resizable("instance");a.ghost&&a.ghost.css({position:"relative",height:a.size.height,width:a.size.width})},stop:function(){var a=I(this).resizable("instance");a.ghost&&a.helper&&a.helper.get(0).removeChild(a.ghost.get(0))}}),I.ui.plugin.add("resizable","grid",{resize:function(){var O,S=I(this).resizable("instance"),Z=S.options,V=S.size,W=S.originalSize,L=S.originalPosition,Y=S.axis,R="number"==typeof Z.grid?[Z.grid,Z.grid]:Z.grid,T=R[0]||1,M=R[1]||1,aa=Math.round((V.width-W.width)/T)*T,N=Math.round((V.height-W.height)/M)*M,X=W.width+aa,P=W.height+N,Q=Z.maxWidth&&X>Z.maxWidth,U=Z.maxHeight&&P>Z.maxHeight,t=Z.minWidth&&Z.minWidth>X,ab=Z.minHeight&&Z.minHeight>P;Z.grid=R,t&&(X+=T),ab&&(P+=M),Q&&(X-=T),U&&(P-=M),/^(se|s|e)$/.test(Y)?(S.size.width=X,S.size.height=P):/^(ne)$/.test(Y)?(S.size.width=X,S.size.height=P,S.position.top=L.top-N):/^(sw)$/.test(Y)?(S.size.width=X,S.size.height=P,S.position.left=L.left-aa):((0>=P-M||0>=X-T)&&(O=S._getPaddingPlusBorderDimensions(this)),P-M>0?(S.size.height=P,S.position.top=L.top-N):(P=M-O.height,S.size.height=P,S.position.top=L.top+W.height-P),X-T>0?(S.size.width=X,S.position.left=L.left-aa):(X=T-O.width,S.size.width=X,S.position.left=L.left+W.width-X))}}),I.ui.resizable,I.widget("ui.selectable",I.ui.mouse,{version:"1.12.1",options:{appendTo:"body",autoRefresh:!0,distance:0,filter:"*",tolerance:"touch",selected:null,selecting:null,start:null,stop:null,unselected:null,unselecting:null},_create:function(){var a=this;this._addClass("ui-selectable"),this.dragged=!1,this.refresh=function(){a.elementPos=I(a.element[0]).offset(),a.selectees=I(a.options.filter,a.element[0]),a._addClass(a.selectees,"ui-selectee"),a.selectees.each(function(){var c=I(this),e=c.offset(),d={left:e.left-a.elementPos.left,top:e.top-a.elementPos.top};I.data(this,"selectable-item",{element:this,$element:c,left:d.left,top:d.top,right:d.left+c.outerWidth(),bottom:d.top+c.outerHeight(),startselected:!1,selected:c.hasClass("ui-selected"),selecting:c.hasClass("ui-selecting"),unselecting:c.hasClass("ui-unselecting")})})},this.refresh(),this._mouseInit(),this.helper=I("<div>"),this._addClass(this.helper,"ui-selectable-helper")},_destroy:function(){this.selectees.removeData("selectable-item"),this._mouseDestroy()},_mouseStart:function(a){var c=this,d=this.options;this.opos=[a.pageX,a.pageY],this.elementPos=I(this.element[0]).offset(),this.options.disabled||(this.selectees=I(d.filter,this.element[0]),this._trigger("start",a),I(d.appendTo).append(this.helper),this.helper.css({left:a.pageX,top:a.pageY,width:0,height:0}),d.autoRefresh&&this.refresh(),this.selectees.filter(".ui-selected").each(function(){var e=I.data(this,"selectable-item");e.startselected=!0,a.metaKey||a.ctrlKey||(c._removeClass(e.$element,"ui-selected"),e.selected=!1,c._addClass(e.$element,"ui-unselecting"),e.unselecting=!0,c._trigger("unselecting",a,{unselecting:e.element}))}),I(a.target).parents().addBack().each(function(){var f,e=I.data(this,"selectable-item");return e?(f=!a.metaKey&&!a.ctrlKey||!e.$element.hasClass("ui-selected"),c._removeClass(e.$element,f?"ui-unselecting":"ui-selected")._addClass(e.$element,f?"ui-selecting":"ui-unselecting"),e.unselecting=!f,e.selecting=f,e.selected=f,f?c._trigger("selecting",a,{selecting:e.element}):c._trigger("unselecting",a,{unselecting:e.element}),!1):void 0}))},_mouseDrag:function(d){if(this.dragged=!0,!this.options.disabled){var g,t=this,l=this.options,m=this.opos[0],c=this.opos[1],p=d.pageX,f=d.pageY;return m>p&&(g=p,p=m,m=g),c>f&&(g=f,f=c,c=g),this.helper.css({left:m,top:c,width:p-m,height:f-c}),this.selectees.each(function(){var e=I.data(this,"selectable-item"),h=!1,a={};e&&e.element!==t.element[0]&&(a.left=e.left+t.elementPos.left,a.right=e.right+t.elementPos.left,a.top=e.top+t.elementPos.top,a.bottom=e.bottom+t.elementPos.top,"touch"===l.tolerance?h=!(a.left>p||m>a.right||a.top>f||c>a.bottom):"fit"===l.tolerance&&(h=a.left>m&&p>a.right&&a.top>c&&f>a.bottom),h?(e.selected&&(t._removeClass(e.$element,"ui-selected"),e.selected=!1),e.unselecting&&(t._removeClass(e.$element,"ui-unselecting"),e.unselecting=!1),e.selecting||(t._addClass(e.$element,"ui-selecting"),e.selecting=!0,t._trigger("selecting",d,{selecting:e.element}))):(e.selecting&&((d.metaKey||d.ctrlKey)&&e.startselected?(t._removeClass(e.$element,"ui-selecting"),e.selecting=!1,t._addClass(e.$element,"ui-selected"),e.selected=!0):(t._removeClass(e.$element,"ui-selecting"),e.selecting=!1,e.startselected&&(t._addClass(e.$element,"ui-unselecting"),e.unselecting=!0),t._trigger("unselecting",d,{unselecting:e.element}))),e.selected&&(d.metaKey||d.ctrlKey||e.startselected||(t._removeClass(e.$element,"ui-selected"),e.selected=!1,t._addClass(e.$element,"ui-unselecting"),e.unselecting=!0,t._trigger("unselecting",d,{unselecting:e.element})))))}),!1}},_mouseStop:function(a){var c=this;return this.dragged=!1,I(".ui-unselecting",this.element[0]).each(function(){var d=I.data(this,"selectable-item");c._removeClass(d.$element,"ui-unselecting"),d.unselecting=!1,d.startselected=!1,c._trigger("unselected",a,{unselected:d.element})}),I(".ui-selecting",this.element[0]).each(function(){var d=I.data(this,"selectable-item");c._removeClass(d.$element,"ui-selecting")._addClass(d.$element,"ui-selected"),d.selecting=!1,d.selected=!0,d.startselected=!0,c._trigger("selected",a,{selected:d.element})}),this._trigger("stop",a),this.helper.remove(),!1}}),I.widget("ui.sortable",I.ui.mouse,{version:"1.12.1",widgetEventPrefix:"sort",ready:!1,options:{appendTo:"parent",axis:!1,connectWith:!1,containment:!1,cursor:"auto",cursorAt:!1,dropOnEmpty:!0,forcePlaceholderSize:!1,forceHelperSize:!1,grid:!1,handle:!1,helper:"original",items:"> *",opacity:!1,placeholder:!1,revert:!1,scroll:!0,scrollSensitivity:20,scrollSpeed:20,scope:"default",tolerance:"intersect",zIndex:1000,activate:null,beforeStop:null,change:null,deactivate:null,out:null,over:null,receive:null,remove:null,sort:null,start:null,stop:null,update:null},_isOverAxis:function(d,a,c){return d>=a&&a+c>d},_isFloating:function(a){return/left|right/.test(a.css("float"))||/inline|table-cell/.test(a.css("display"))},_create:function(){this.containerCache={},this._addClass("ui-sortable"),this.refresh(),this.offset=this.element.offset(),this._mouseInit(),this._setHandleClassName(),this.ready=!0},_setOption:function(c,a){this._super(c,a),"handle"===c&&this._setHandleClassName()},_setHandleClassName:function(){var a=this;this._removeClass(this.element.find(".ui-sortable-handle"),"ui-sortable-handle"),I.each(this.items,function(){a._addClass(this.instance.options.handle?this.item.find(this.instance.options.handle):this.item,"ui-sortable-handle")})},_destroy:function(){this._mouseDestroy();for(var a=this.items.length-1;a>=0;a--){this.items[a].item.removeData(this.widgetName+"-item")}return this},_mouseCapture:function(a,c){var g=null,d=!1,f=this;return this.reverting?!1:this.options.disabled||"static"===this.options.type?!1:(this._refreshItems(a),I(a.target).parents().each(function(){return I.data(this,f.widgetName+"-item")===f?(g=I(this),!1):void 0}),I.data(a.target,f.widgetName+"-item")===f&&(g=I(a.target)),g?!this.options.handle||c||(I(this.options.handle,g).find("*").addBack().each(function(){this===a.target&&(d=!0)}),d)?(this.currentItem=g,this._removeCurrentsFromItems(),!0):!1:!1)},_mouseStart:function(d,f,l){var g,h,c=this.options;if(this.currentContainer=this,this.refreshPositions(),this.helper=this._createHelper(d),this._cacheHelperProportions(),this._cacheMargins(),this.scrollParent=this.helper.scrollParent(),this.offset=this.currentItem.offset(),this.offset={top:this.offset.top-this.margins.top,left:this.offset.left-this.margins.left},I.extend(this.offset,{click:{left:d.pageX-this.offset.left,top:d.pageY-this.offset.top},parent:this._getParentOffset(),relative:this._getRelativeOffset()}),this.helper.css("position","absolute"),this.cssPosition=this.helper.css("position"),this.originalPosition=this._generatePosition(d),this.originalPageX=d.pageX,this.originalPageY=d.pageY,c.cursorAt&&this._adjustOffsetFromHelper(c.cursorAt),this.domPosition={prev:this.currentItem.prev()[0],parent:this.currentItem.parent()[0]},this.helper[0]!==this.currentItem[0]&&this.currentItem.hide(),this._createPlaceholder(),c.containment&&this._setContainment(),c.cursor&&"auto"!==c.cursor&&(h=this.document.find("body"),this.storedCursor=h.css("cursor"),h.css("cursor",c.cursor),this.storedStylesheet=I("<style>*{ cursor: "+c.cursor+" !important; }</style>").appendTo(h)),c.opacity&&(this.helper.css("opacity")&&(this._storedOpacity=this.helper.css("opacity")),this.helper.css("opacity",c.opacity)),c.zIndex&&(this.helper.css("zIndex")&&(this._storedZIndex=this.helper.css("zIndex")),this.helper.css("zIndex",c.zIndex)),this.scrollParent[0]!==this.document[0]&&"HTML"!==this.scrollParent[0].tagName&&(this.overflowOffset=this.scrollParent.offset()),this._trigger("start",d,this._uiHash()),this._preserveHelperProportions||this._cacheHelperProportions(),!l){for(g=this.containers.length-1;g>=0;g--){this.containers[g]._trigger("activate",d,this._uiHash(this))}}return I.ui.ddmanager&&(I.ui.ddmanager.current=this),I.ui.ddmanager&&!c.dropBehaviour&&I.ui.ddmanager.prepareOffsets(this,d),this.dragging=!0,this._addClass(this.helper,"ui-sortable-helper"),this._mouseDrag(d),!0},_mouseDrag:function(d){var f,m,g,h,c=this.options,l=!1;for(this.position=this._generatePosition(d),this.positionAbs=this._convertPositionTo("absolute"),this.lastPositionAbs||(this.lastPositionAbs=this.positionAbs),this.options.scroll&&(this.scrollParent[0]!==this.document[0]&&"HTML"!==this.scrollParent[0].tagName?(this.overflowOffset.top+this.scrollParent[0].offsetHeight-d.pageY<c.scrollSensitivity?this.scrollParent[0].scrollTop=l=this.scrollParent[0].scrollTop+c.scrollSpeed:d.pageY-this.overflowOffset.top<c.scrollSensitivity&&(this.scrollParent[0].scrollTop=l=this.scrollParent[0].scrollTop-c.scrollSpeed),this.overflowOffset.left+this.scrollParent[0].offsetWidth-d.pageX<c.scrollSensitivity?this.scrollParent[0].scrollLeft=l=this.scrollParent[0].scrollLeft+c.scrollSpeed:d.pageX-this.overflowOffset.left<c.scrollSensitivity&&(this.scrollParent[0].scrollLeft=l=this.scrollParent[0].scrollLeft-c.scrollSpeed)):(d.pageY-this.document.scrollTop()<c.scrollSensitivity?l=this.document.scrollTop(this.document.scrollTop()-c.scrollSpeed):this.window.height()-(d.pageY-this.document.scrollTop())<c.scrollSensitivity&&(l=this.document.scrollTop(this.document.scrollTop()+c.scrollSpeed)),d.pageX-this.document.scrollLeft()<c.scrollSensitivity?l=this.document.scrollLeft(this.document.scrollLeft()-c.scrollSpeed):this.window.width()-(d.pageX-this.document.scrollLeft())<c.scrollSensitivity&&(l=this.document.scrollLeft(this.document.scrollLeft()+c.scrollSpeed))),l!==!1&&I.ui.ddmanager&&!c.dropBehaviour&&I.ui.ddmanager.prepareOffsets(this,d)),this.positionAbs=this._convertPositionTo("absolute"),this.options.axis&&"y"===this.options.axis||(this.helper[0].style.left=this.position.left+"px"),this.options.axis&&"x"===this.options.axis||(this.helper[0].style.top=this.position.top+"px"),f=this.items.length-1;f>=0;f--){if(m=this.items[f],g=m.item[0],h=this._intersectsWithPointer(m),h&&m.instance===this.currentContainer&&g!==this.currentItem[0]&&this.placeholder[1===h?"next":"prev"]()[0]!==g&&!I.contains(this.placeholder[0],g)&&("semi-dynamic"===this.options.type?!I.contains(this.element[0],g):!0)){if(this.direction=1===h?"down":"up","pointer"!==this.options.tolerance&&!this._intersectsWithSides(m)){break}this._rearrange(d,m),this._trigger("change",d,this._uiHash());break}}return this._contactContainers(d),I.ui.ddmanager&&I.ui.ddmanager.drag(this,d),this._trigger("sort",d,this._uiHash()),this.lastPositionAbs=this.positionAbs,!1},_mouseStop:function(d,f){if(d){if(I.ui.ddmanager&&!this.options.dropBehaviour&&I.ui.ddmanager.drop(this,d),this.options.revert){var l=this,g=this.placeholder.offset(),h=this.options.axis,c={};h&&"x"!==h||(c.left=g.left-this.offset.parent.left-this.margins.left+(this.offsetParent[0]===this.document[0].body?0:this.offsetParent[0].scrollLeft)),h&&"y"!==h||(c.top=g.top-this.offset.parent.top-this.margins.top+(this.offsetParent[0]===this.document[0].body?0:this.offsetParent[0].scrollTop)),this.reverting=!0,I(this.helper).animate(c,parseInt(this.options.revert,10)||500,function(){l._clear(d)})}else{this._clear(d,f)}return !1}},cancel:function(){if(this.dragging){this._mouseUp(new I.Event("mouseup",{target:null})),"original"===this.options.helper?(this.currentItem.css(this._storedCSS),this._removeClass(this.currentItem,"ui-sortable-helper")):this.currentItem.show();for(var a=this.containers.length-1;a>=0;a--){this.containers[a]._trigger("deactivate",null,this._uiHash(this)),this.containers[a].containerCache.over&&(this.containers[a]._trigger("out",null,this._uiHash(this)),this.containers[a].containerCache.over=0)}}return this.placeholder&&(this.placeholder[0].parentNode&&this.placeholder[0].parentNode.removeChild(this.placeholder[0]),"original"!==this.options.helper&&this.helper&&this.helper[0].parentNode&&this.helper.remove(),I.extend(this,{helper:null,dragging:!1,reverting:!1,_noFinalSort:null}),this.domPosition.prev?I(this.domPosition.prev).after(this.currentItem):I(this.domPosition.parent).prepend(this.currentItem)),this},serialize:function(a){var c=this._getItemsAsjQuery(a&&a.connected),d=[];return a=a||{},I(c).each(function(){var e=(I(a.item||this).attr(a.attribute||"id")||"").match(a.expression||/(.+)[\-=_](.+)/);e&&d.push((a.key||e[1]+"[]")+"="+(a.key&&a.expression?e[1]:e[2]))}),!d.length&&a.key&&d.push(a.key+"="),d.join("&")},toArray:function(a){var c=this._getItemsAsjQuery(a&&a.connected),d=[];return a=a||{},c.each(function(){d.push(I(a.item||this).attr(a.attribute||"id")||"")}),d},_intersectsWith:function(T){var v=this.positionAbs.left,M=v+this.helperProportions.width,S=this.positionAbs.top,O=S+this.helperProportions.height,P=T.left,f=P+T.width,R=T.top,L=R+T.height,N=this.offset.click.top,g=this.offset.click.left,U="x"===this.options.axis||S+N>R&&L>S+N,m="y"===this.options.axis||v+g>P&&f>v+g,Q=U&&m;return"pointer"===this.options.tolerance||this.options.forcePointerForContainers||"pointer"!==this.options.tolerance&&this.helperProportions[this.floating?"width":"height"]>T[this.floating?"width":"height"]?Q:v+this.helperProportions.width/2>P&&f>M-this.helperProportions.width/2&&S+this.helperProportions.height/2>R&&L>O-this.helperProportions.height/2},_intersectsWithPointer:function(h){var a,c,g="x"===this.options.axis||this._isOverAxis(this.positionAbs.top+this.offset.click.top,h.top,h.height),d="y"===this.options.axis||this._isOverAxis(this.positionAbs.left+this.offset.click.left,h.left,h.width),f=g&&d;return f?(a=this._getDragVerticalDirection(),c=this._getDragHorizontalDirection(),this.floating?"right"===c||"down"===a?2:1:a&&("down"===a?2:1)):!1},_intersectsWithSides:function(g){var a=this._isOverAxis(this.positionAbs.top+this.offset.click.top,g.top+g.height/2,g.height),c=this._isOverAxis(this.positionAbs.left+this.offset.click.left,g.left+g.width/2,g.width),f=this._getDragVerticalDirection(),d=this._getDragHorizontalDirection();return this.floating&&d?"right"===d&&c||"left"===d&&!c:f&&("down"===f&&a||"up"===f&&!a)},_getDragVerticalDirection:function(){var a=this.positionAbs.top-this.lastPositionAbs.top;return 0!==a&&(a>0?"down":"up")},_getDragHorizontalDirection:function(){var a=this.positionAbs.left-this.lastPositionAbs.left;return 0!==a&&(a>0?"right":"left")},refresh:function(a){return this._refreshItems(a),this._setHandleClassName(),this.refreshPositions(),this},_connectWith:function(){var a=this.options;return a.connectWith.constructor===String?[a.connectWith]:a.connectWith},_getItemsAsjQuery:function(d){function g(){u.push(this)}var v,p,t,c,u=[],f=[],m=this._connectWith();if(m&&d){for(v=m.length-1;v>=0;v--){for(t=I(m[v],this.document[0]),p=t.length-1;p>=0;p--){c=I.data(t[p],this.widgetFullName),c&&c!==this&&!c.options.disabled&&f.push([I.isFunction(c.options.items)?c.options.items.call(c.element):I(c.options.items,c.element).not(".ui-sortable-helper").not(".ui-sortable-placeholder"),c])}}}for(f.push([I.isFunction(this.options.items)?this.options.items.call(this.element,null,{options:this.options,item:this.currentItem}):I(this.options.items,this.element).not(".ui-sortable-helper").not(".ui-sortable-placeholder"),this]),v=f.length-1;v>=0;v--){f[v][0].each(g)}return I(u)},_removeCurrentsFromItems:function(){var a=this.currentItem.find(":data("+this.widgetName+"-item)");this.items=I.grep(this.items,function(d){for(var c=0;a.length>c;c++){if(a[c]===d.item[0]){return !1}}return !0})},_refreshItems:function(p){this.items=[],this.containers=[this];var v,P,M,N,f,O,t,L,g=this.items,Q=[[I.isFunction(this.options.items)?this.options.items.call(this.element[0],p,{item:this.currentItem}):I(this.options.items,this.element),this]],m=this._connectWith();if(m&&this.ready){for(v=m.length-1;v>=0;v--){for(M=I(m[v],this.document[0]),P=M.length-1;P>=0;P--){N=I.data(M[P],this.widgetFullName),N&&N!==this&&!N.options.disabled&&(Q.push([I.isFunction(N.options.items)?N.options.items.call(N.element[0],p,{item:this.currentItem}):I(N.options.items,N.element),N]),this.containers.push(N))}}}for(v=Q.length-1;v>=0;v--){for(f=Q[v][1],O=Q[v][0],P=0,L=O.length;L>P;P++){t=I(O[P]),t.data(this.widgetName+"-item",f),g.push({item:t,instance:f,width:0,height:0,left:0,top:0})}}},refreshPositions:function(a){this.floating=this.items.length?"x"===this.options.axis||this._isFloating(this.items[0].item):!1,this.offsetParent&&this.helper&&(this.offset.parent=this._getParentOffset());var c,g,d,f;for(c=this.items.length-1;c>=0;c--){g=this.items[c],g.instance!==this.currentContainer&&this.currentContainer&&g.item[0]!==this.currentItem[0]||(d=this.options.toleranceElement?I(this.options.toleranceElement,g.item):g.item,a||(g.width=d.outerWidth(),g.height=d.outerHeight()),f=d.offset(),g.left=f.left,g.top=f.top)}if(this.options.custom&&this.options.custom.refreshContainers){this.options.custom.refreshContainers.call(this)}else{for(c=this.containers.length-1;c>=0;c--){f=this.containers[c].element.offset(),this.containers[c].containerCache.left=f.left,this.containers[c].containerCache.top=f.top,this.containers[c].containerCache.width=this.containers[c].element.outerWidth(),this.containers[c].containerCache.height=this.containers[c].element.outerHeight()}}return this},_createPlaceholder:function(a){a=a||this;var c,d=a.options;d.placeholder&&d.placeholder.constructor!==String||(c=d.placeholder,d.placeholder={element:function(){var f=a.currentItem[0].nodeName.toLowerCase(),e=I("<"+f+">",a.document[0]);return a._addClass(e,"ui-sortable-placeholder",c||a.currentItem[0].className)._removeClass(e,"ui-sortable-helper"),"tbody"===f?a._createTrPlaceholder(a.currentItem.find("tr").eq(0),I("<tr>",a.document[0]).appendTo(e)):"tr"===f?a._createTrPlaceholder(a.currentItem,e):"img"===f&&e.attr("src",a.currentItem.attr("src")),c||e.css("visibility","hidden"),e},update:function(f,e){(!c||d.forcePlaceholderSize)&&(e.height()||e.height(a.currentItem.innerHeight()-parseInt(a.currentItem.css("paddingTop")||0,10)-parseInt(a.currentItem.css("paddingBottom")||0,10)),e.width()||e.width(a.currentItem.innerWidth()-parseInt(a.currentItem.css("paddingLeft")||0,10)-parseInt(a.currentItem.css("paddingRight")||0,10)))}}),a.placeholder=I(d.placeholder.element.call(a.element,a.currentItem)),a.currentItem.after(a.placeholder),d.placeholder.update(a,a.placeholder)},_createTrPlaceholder:function(a,c){var d=this;a.children().each(function(){I("<td>&#160;</td>",d.document[0]).attr("colspan",I(this).attr("colspan")||1).appendTo(c)})},_contactContainers:function(t){var L,R,N,O,f,Q,v,M,g,S,m=null,P=null;for(L=this.containers.length-1;L>=0;L--){if(!I.contains(this.currentItem[0],this.containers[L].element[0])){if(this._intersectsWith(this.containers[L].containerCache)){if(m&&I.contains(this.containers[L].element[0],m.element[0])){continue}m=this.containers[L],P=L}else{this.containers[L].containerCache.over&&(this.containers[L]._trigger("out",t,this._uiHash(this)),this.containers[L].containerCache.over=0)}}}if(m){if(1===this.containers.length){this.containers[P].containerCache.over||(this.containers[P]._trigger("over",t,this._uiHash(this)),this.containers[P].containerCache.over=1)}else{for(N=10000,O=null,g=m.floating||this._isFloating(this.currentItem),f=g?"left":"top",Q=g?"width":"height",S=g?"pageX":"pageY",R=this.items.length-1;R>=0;R--){I.contains(this.containers[P].element[0],this.items[R].item[0])&&this.items[R].item[0]!==this.currentItem[0]&&(v=this.items[R].item.offset()[f],M=!1,t[S]-v>this.items[R][Q]/2&&(M=!0),N>Math.abs(t[S]-v)&&(N=Math.abs(t[S]-v),O=this.items[R],this.direction=M?"up":"down"))}if(!O&&!this.options.dropOnEmpty){return}if(this.currentContainer===this.containers[P]){return this.currentContainer.containerCache.over||(this.containers[P]._trigger("over",t,this._uiHash()),this.currentContainer.containerCache.over=1),void 0}O?this._rearrange(t,O,null,!0):this._rearrange(t,null,this.containers[P].element,!0),this._trigger("change",t,this._uiHash()),this.containers[P]._trigger("change",t,this._uiHash(this)),this.currentContainer=this.containers[P],this.options.placeholder.update(this.currentContainer,this.placeholder),this.containers[P]._trigger("over",t,this._uiHash(this)),this.containers[P].containerCache.over=1}}},_createHelper:function(a){var c=this.options,d=I.isFunction(c.helper)?I(c.helper.apply(this.element[0],[a,this.currentItem])):"clone"===c.helper?this.currentItem.clone():this.currentItem;return d.parents("body").length||I("parent"!==c.appendTo?c.appendTo:this.currentItem[0].parentNode)[0].appendChild(d[0]),d[0]===this.currentItem[0]&&(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")}),(!d[0].style.width||c.forceHelperSize)&&d.width(this.currentItem.width()),(!d[0].style.height||c.forceHelperSize)&&d.height(this.currentItem.height()),d},_adjustOffsetFromHelper:function(a){"string"==typeof a&&(a=a.split(" ")),I.isArray(a)&&(a={left:+a[0],top:+a[1]||0}),"left" in a&&(this.offset.click.left=a.left+this.margins.left),"right" in a&&(this.offset.click.left=this.helperProportions.width-a.right+this.margins.left),"top" in a&&(this.offset.click.top=a.top+this.margins.top),"bottom" in a&&(this.offset.click.top=this.helperProportions.height-a.bottom+this.margins.top)},_getParentOffset:function(){this.offsetParent=this.helper.offsetParent();var a=this.offsetParent.offset();return"absolute"===this.cssPosition&&this.scrollParent[0]!==this.document[0]&&I.contains(this.scrollParent[0],this.offsetParent[0])&&(a.left+=this.scrollParent.scrollLeft(),a.top+=this.scrollParent.scrollTop()),(this.offsetParent[0]===this.document[0].body||this.offsetParent[0].tagName&&"html"===this.offsetParent[0].tagName.toLowerCase()&&I.ui.ie)&&(a={top:0,left:0}),{top:a.top+(parseInt(this.offsetParent.css("borderTopWidth"),10)||0),left:a.left+(parseInt(this.offsetParent.css("borderLeftWidth"),10)||0)}},_getRelativeOffset:function(){if("relative"===this.cssPosition){var a=this.currentItem.position();return{top:a.top-(parseInt(this.helper.css("top"),10)||0)+this.scrollParent.scrollTop(),left:a.left-(parseInt(this.helper.css("left"),10)||0)+this.scrollParent.scrollLeft()}}return{top:0,left:0}},_cacheMargins:function(){this.margins={left:parseInt(this.currentItem.css("marginLeft"),10)||0,top:parseInt(this.currentItem.css("marginTop"),10)||0}},_cacheHelperProportions:function(){this.helperProportions={width:this.helper.outerWidth(),height:this.helper.outerHeight()}},_setContainment:function(){var a,c,f,d=this.options;"parent"===d.containment&&(d.containment=this.helper[0].parentNode),("document"===d.containment||"window"===d.containment)&&(this.containment=[0-this.offset.relative.left-this.offset.parent.left,0-this.offset.relative.top-this.offset.parent.top,"document"===d.containment?this.document.width():this.window.width()-this.helperProportions.width-this.margins.left,("document"===d.containment?this.document.height()||document.body.parentNode.scrollHeight:this.window.height()||this.document[0].body.parentNode.scrollHeight)-this.helperProportions.height-this.margins.top]),/^(document|window|parent)$/.test(d.containment)||(a=I(d.containment)[0],c=I(d.containment).offset(),f="hidden"!==I(a).css("overflow"),this.containment=[c.left+(parseInt(I(a).css("borderLeftWidth"),10)||0)+(parseInt(I(a).css("paddingLeft"),10)||0)-this.margins.left,c.top+(parseInt(I(a).css("borderTopWidth"),10)||0)+(parseInt(I(a).css("paddingTop"),10)||0)-this.margins.top,c.left+(f?Math.max(a.scrollWidth,a.offsetWidth):a.offsetWidth)-(parseInt(I(a).css("borderLeftWidth"),10)||0)-(parseInt(I(a).css("paddingRight"),10)||0)-this.helperProportions.width-this.margins.left,c.top+(f?Math.max(a.scrollHeight,a.offsetHeight):a.offsetHeight)-(parseInt(I(a).css("borderTopWidth"),10)||0)-(parseInt(I(a).css("paddingBottom"),10)||0)-this.helperProportions.height-this.margins.top])},_convertPositionTo:function(a,c){c||(c=this.position);var g="absolute"===a?1:-1,d="absolute"!==this.cssPosition||this.scrollParent[0]!==this.document[0]&&I.contains(this.scrollParent[0],this.offsetParent[0])?this.scrollParent:this.offsetParent,f=/(html|body)/i.test(d[0].tagName);return{top:c.top+this.offset.relative.top*g+this.offset.parent.top*g-("fixed"===this.cssPosition?-this.scrollParent.scrollTop():f?0:d.scrollTop())*g,left:c.left+this.offset.relative.left*g+this.offset.parent.left*g-("fixed"===this.cssPosition?-this.scrollParent.scrollLeft():f?0:d.scrollLeft())*g}},_generatePosition:function(d){var g,t,l=this.options,m=d.pageX,c=d.pageY,p="absolute"!==this.cssPosition||this.scrollParent[0]!==this.document[0]&&I.contains(this.scrollParent[0],this.offsetParent[0])?this.scrollParent:this.offsetParent,f=/(html|body)/i.test(p[0].tagName);return"relative"!==this.cssPosition||this.scrollParent[0]!==this.document[0]&&this.scrollParent[0]!==this.offsetParent[0]||(this.offset.relative=this._getRelativeOffset()),this.originalPosition&&(this.containment&&(d.pageX-this.offset.click.left<this.containment[0]&&(m=this.containment[0]+this.offset.click.left),d.pageY-this.offset.click.top<this.containment[1]&&(c=this.containment[1]+this.offset.click.top),d.pageX-this.offset.click.left>this.containment[2]&&(m=this.containment[2]+this.offset.click.left),d.pageY-this.offset.click.top>this.containment[3]&&(c=this.containment[3]+this.offset.click.top)),l.grid&&(g=this.originalPageY+Math.round((c-this.originalPageY)/l.grid[1])*l.grid[1],c=this.containment?g-this.offset.click.top>=this.containment[1]&&g-this.offset.click.top<=this.containment[3]?g:g-this.offset.click.top>=this.containment[1]?g-l.grid[1]:g+l.grid[1]:g,t=this.originalPageX+Math.round((m-this.originalPageX)/l.grid[0])*l.grid[0],m=this.containment?t-this.offset.click.left>=this.containment[0]&&t-this.offset.click.left<=this.containment[2]?t:t-this.offset.click.left>=this.containment[0]?t-l.grid[0]:t+l.grid[0]:t)),{top:c-this.offset.click.top-this.offset.relative.top-this.offset.parent.top+("fixed"===this.cssPosition?-this.scrollParent.scrollTop():f?0:p.scrollTop()),left:m-this.offset.click.left-this.offset.relative.left-this.offset.parent.left+("fixed"===this.cssPosition?-this.scrollParent.scrollLeft():f?0:p.scrollLeft())}},_rearrange:function(g,a,c,f){c?c[0].appendChild(this.placeholder[0]):a.item[0].parentNode.insertBefore(this.placeholder[0],"down"===this.direction?a.item[0]:a.item[0].nextSibling),this.counter=this.counter?++this.counter:1;var d=this.counter;this._delay(function(){d===this.counter&&this.refreshPositions(!f)})},_clear:function(g,a){function c(m,h,l){return function(e){l._trigger(m,e,h._uiHash(h))}}this.reverting=!1;var f,d=[];if(!this._noFinalSort&&this.currentItem.parent().length&&this.placeholder.before(this.currentItem),this._noFinalSort=null,this.helper[0]===this.currentItem[0]){for(f in this._storedCSS){("auto"===this._storedCSS[f]||"static"===this._storedCSS[f])&&(this._storedCSS[f]="")}this.currentItem.css(this._storedCSS),this._removeClass(this.currentItem,"ui-sortable-helper")}else{this.currentItem.show()}for(this.fromOutside&&!a&&d.push(function(e){this._trigger("receive",e,this._uiHash(this.fromOutside))}),!this.fromOutside&&this.domPosition.prev===this.currentItem.prev().not(".ui-sortable-helper")[0]&&this.domPosition.parent===this.currentItem.parent()[0]||a||d.push(function(e){this._trigger("update",e,this._uiHash())}),this!==this.currentContainer&&(a||(d.push(function(e){this._trigger("remove",e,this._uiHash())}),d.push(function(e){return function(h){e._trigger("receive",h,this._uiHash(this))}}.call(this,this.currentContainer)),d.push(function(e){return function(h){e._trigger("update",h,this._uiHash(this))}}.call(this,this.currentContainer)))),f=this.containers.length-1;f>=0;f--){a||d.push(c("deactivate",this,this.containers[f])),this.containers[f].containerCache.over&&(d.push(c("out",this,this.containers[f])),this.containers[f].containerCache.over=0)}if(this.storedCursor&&(this.document.find("body").css("cursor",this.storedCursor),this.storedStylesheet.remove()),this._storedOpacity&&this.helper.css("opacity",this._storedOpacity),this._storedZIndex&&this.helper.css("zIndex","auto"===this._storedZIndex?"":this._storedZIndex),this.dragging=!1,a||this._trigger("beforeStop",g,this._uiHash()),this.placeholder[0].parentNode.removeChild(this.placeholder[0]),this.cancelHelperRemoval||(this.helper[0]!==this.currentItem[0]&&this.helper.remove(),this.helper=null),!a){for(f=0;d.length>f;f++){d[f].call(this,g)}this._trigger("stop",g,this._uiHash())}return this.fromOutside=!1,!this.cancelHelperRemoval},_trigger:function(){I.Widget.prototype._trigger.apply(this,arguments)===!1&&this.cancel()},_uiHash:function(a){var c=a||this;return{helper:c.helper,placeholder:c.placeholder||I([]),position:c.position,originalPosition:c.originalPosition,offset:c.positionAbs,item:c.currentItem,sender:a?a.element:null}}}),I.widget("ui.accordion",{version:"1.12.1",options:{active:0,animate:{},classes:{"ui-accordion-header":"ui-corner-top","ui-accordion-header-collapsed":"ui-corner-all","ui-accordion-content":"ui-corner-bottom"},collapsible:!1,event:"click",header:"> li > :first-child, > :not(li):even",heightStyle:"auto",icons:{activeHeader:"ui-icon-triangle-1-s",header:"ui-icon-triangle-1-e"},activate:null,beforeActivate:null},hideProps:{borderTopWidth:"hide",borderBottomWidth:"hide",paddingTop:"hide",paddingBottom:"hide",height:"hide"},showProps:{borderTopWidth:"show",borderBottomWidth:"show",paddingTop:"show",paddingBottom:"show",height:"show"},_create:function(){var a=this.options;this.prevShow=this.prevHide=I(),this._addClass("ui-accordion","ui-widget ui-helper-reset"),this.element.attr("role","tablist"),a.collapsible||a.active!==!1&&null!=a.active||(a.active=0),this._processPanels(),0>a.active&&(a.active+=this.headers.length),this._refresh()},_getCreateEventData:function(){return{header:this.active,panel:this.active.length?this.active.next():I()}},_createIcons:function(){var a,c,d=this.options.icons;d&&(a=I("<span>"),this._addClass(a,"ui-accordion-header-icon","ui-icon "+d.header),a.prependTo(this.headers),c=this.active.children(".ui-accordion-header-icon"),this._removeClass(c,d.header)._addClass(c,null,d.activeHeader)._addClass(this.headers,"ui-accordion-icons"))},_destroyIcons:function(){this._removeClass(this.headers,"ui-accordion-icons"),this.headers.children(".ui-accordion-header-icon").remove()},_destroy:function(){var a;this.element.removeAttr("role"),this.headers.removeAttr("role aria-expanded aria-selected aria-controls tabIndex").removeUniqueId(),this._destroyIcons(),a=this.headers.next().css("display","").removeAttr("role aria-hidden aria-labelledby").removeUniqueId(),"content"!==this.options.heightStyle&&a.css("height","")},_setOption:function(c,a){return"active"===c?(this._activate(a),void 0):("event"===c&&(this.options.event&&this._off(this.headers,this.options.event),this._setupEvents(a)),this._super(c,a),"collapsible"!==c||a||this.options.active!==!1||this._activate(0),"icons"===c&&(this._destroyIcons(),a&&this._createIcons()),void 0)},_setOptionDisabled:function(a){this._super(a),this.element.attr("aria-disabled",a),this._toggleClass(null,"ui-state-disabled",!!a),this._toggleClass(this.headers.add(this.headers.next()),null,"ui-state-disabled",!!a)},_keydown:function(a){if(!a.altKey&&!a.ctrlKey){var c=I.ui.keyCode,g=this.headers.length,d=this.headers.index(a.target),f=!1;switch(a.keyCode){case c.RIGHT:case c.DOWN:f=this.headers[(d+1)%g];break;case c.LEFT:case c.UP:f=this.headers[(d-1+g)%g];break;case c.SPACE:case c.ENTER:this._eventHandler(a);break;case c.HOME:f=this.headers[0];break;case c.END:f=this.headers[g-1]}f&&(I(a.target).attr("tabIndex",-1),I(f).attr("tabIndex",0),I(f).trigger("focus"),a.preventDefault())}},_panelKeyDown:function(a){a.keyCode===I.ui.keyCode.UP&&a.ctrlKey&&I(a.currentTarget).prev().trigger("focus")},refresh:function(){var a=this.options;this._processPanels(),a.active===!1&&a.collapsible===!0||!this.headers.length?(a.active=!1,this.active=I()):a.active===!1?this._activate(0):this.active.length&&!I.contains(this.element[0],this.active[0])?this.headers.length===this.headers.find(".ui-state-disabled").length?(a.active=!1,this.active=I()):this._activate(Math.max(0,a.active-1)):a.active=this.headers.index(this.active),this._destroyIcons(),this._refresh()},_processPanels:function(){var c=this.headers,a=this.panels;this.headers=this.element.find(this.options.header),this._addClass(this.headers,"ui-accordion-header ui-accordion-header-collapsed","ui-state-default"),this.panels=this.headers.next().filter(":not(.ui-accordion-content-active)").hide(),this._addClass(this.panels,"ui-accordion-content","ui-helper-reset ui-widget-content"),a&&(this._off(c.not(this.headers)),this._off(a.not(this.panels)))},_refresh:function(){var a,c=this.options,f=c.heightStyle,d=this.element.parent();this.active=this._findActive(c.active),this._addClass(this.active,"ui-accordion-header-active","ui-state-active")._removeClass(this.active,"ui-accordion-header-collapsed"),this._addClass(this.active.next(),"ui-accordion-content-active"),this.active.next().show(),this.headers.attr("role","tab").each(function(){var g=I(this),h=g.uniqueId().attr("id"),m=g.next(),l=m.uniqueId().attr("id");g.attr("aria-controls",l),m.attr("aria-labelledby",h)}).next().attr("role","tabpanel"),this.headers.not(this.active).attr({"aria-selected":"false","aria-expanded":"false",tabIndex:-1}).next().attr({"aria-hidden":"true"}).hide(),this.active.length?this.active.attr({"aria-selected":"true","aria-expanded":"true",tabIndex:0}).next().attr({"aria-hidden":"false"}):this.headers.eq(0).attr("tabIndex",0),this._createIcons(),this._setupEvents(c.event),"fill"===f?(a=d.height(),this.element.siblings(":visible").each(function(){var e=I(this),g=e.css("position");"absolute"!==g&&"fixed"!==g&&(a-=e.outerHeight(!0))}),this.headers.each(function(){a-=I(this).outerHeight(!0)}),this.headers.next().each(function(){I(this).height(Math.max(0,a-I(this).innerHeight()+I(this).height()))}).css("overflow","auto")):"auto"===f&&(a=0,this.headers.next().each(function(){var e=I(this).is(":visible");e||I(this).show(),a=Math.max(a,I(this).css("height","").height()),e||I(this).hide()}).height(a))},_activate:function(a){var c=this._findActive(a)[0];c!==this.active[0]&&(c=c||this.active[0],this._eventHandler({target:c,currentTarget:c,preventDefault:I.noop}))},_findActive:function(a){return"number"==typeof a?this.headers.eq(a):I()},_setupEvents:function(a){var c={keydown:"_keydown"};a&&I.each(a.split(" "),function(f,d){c[d]="_eventHandler"}),this._off(this.headers.add(this.headers.next())),this._on(this.headers,c),this._on(this.headers.next(),{keydown:"_panelKeyDown"}),this._hoverable(this.headers),this._focusable(this.headers)},_eventHandler:function(g){var p,N,v=this.options,L=this.active,d=I(g.currentTarget),M=d[0]===L[0],m=M&&v.collapsible,t=m?I():d.next(),f=L.next(),O={oldHeader:L,oldPanel:f,newHeader:m?I():d,newPanel:t};g.preventDefault(),M&&!v.collapsible||this._trigger("beforeActivate",g,O)===!1||(v.active=m?!1:this.headers.index(d),this.active=M?I():d,this._toggle(O),this._removeClass(L,"ui-accordion-header-active","ui-state-active"),v.icons&&(p=L.children(".ui-accordion-header-icon"),this._removeClass(p,null,v.icons.activeHeader)._addClass(p,null,v.icons.header)),M||(this._removeClass(d,"ui-accordion-header-collapsed")._addClass(d,"ui-accordion-header-active","ui-state-active"),v.icons&&(N=d.children(".ui-accordion-header-icon"),this._removeClass(N,null,v.icons.header)._addClass(N,null,v.icons.activeHeader)),this._addClass(d.next(),"ui-accordion-content-active")))},_toggle:function(a){var c=a.newPanel,d=this.prevShow.length?this.prevShow:a.oldPanel;this.prevShow.add(this.prevHide).stop(!0,!0),this.prevShow=c,this.prevHide=d,this.options.animate?this._animate(c,d,a):(d.hide(),c.show(),this._toggleComplete(a)),d.attr({"aria-hidden":"true"}),d.prev().attr({"aria-selected":"false","aria-expanded":"false"}),c.length&&d.length?d.prev().attr({tabIndex:-1,"aria-expanded":"false"}):c.length&&this.headers.filter(function(){return 0===parseInt(I(this).attr("tabIndex"),10)}).attr("tabIndex",-1),c.attr("aria-hidden","false").prev().attr({"aria-selected":"true","aria-expanded":"true",tabIndex:0})},_animate:function(R,p,L){var Q,N,O,f=this,P=0,v=R.css("box-sizing"),M=R.length&&(!p.length||R.index()<p.index()),g=this.options.animate||{},S=M&&g.down||g,m=function(){f._toggleComplete(L)};return"number"==typeof S&&(O=S),"string"==typeof S&&(N=S),N=N||S.easing||g.easing,O=O||S.duration||g.duration,p.length?R.length?(Q=R.show().outerHeight(),p.animate(this.hideProps,{duration:O,easing:N,step:function(c,a){a.now=Math.round(c)}}),R.hide().animate(this.showProps,{duration:O,easing:N,complete:m,step:function(c,a){a.now=Math.round(c),"height"!==a.prop?"content-box"===v&&(P+=a.now):"content"!==f.options.heightStyle&&(a.now=Math.round(Q-p.outerHeight()-P),P=0)}}),void 0):p.animate(this.hideProps,O,N,m):R.animate(this.showProps,O,N,m)},_toggleComplete:function(d){var a=d.oldPanel,c=a.prev();this._removeClass(a,"ui-accordion-content-active"),this._removeClass(c,"ui-accordion-header-active")._addClass(c,"ui-accordion-header-collapsed"),a.length&&(a.parent()[0].className=a.parent()[0].className),this._trigger("activate",null,d)}}),I.widget("ui.menu",{version:"1.12.1",defaultElement:"<ul>",delay:300,options:{icons:{submenu:"ui-icon-caret-1-e"},items:"> *",menus:"ul",position:{my:"left top",at:"right top"},role:"menu",blur:null,focus:null,select:null},_create:function(){this.activeMenu=this.element,this.mouseHandled=!1,this.element.uniqueId().attr({role:this.options.role,tabIndex:0}),this._addClass("ui-menu","ui-widget ui-widget-content"),this._on({"mousedown .ui-menu-item":function(a){a.preventDefault()},"click .ui-menu-item":function(a){var c=I(a.target),d=I(I.ui.safeActiveElement(this.document[0]));!this.mouseHandled&&c.not(".ui-state-disabled").length&&(this.select(a),a.isPropagationStopped()||(this.mouseHandled=!0),c.has(".ui-menu").length?this.expand(a):!this.element.is(":focus")&&d.closest(".ui-menu").length&&(this.element.trigger("focus",[!0]),this.active&&1===this.active.parents(".ui-menu").length&&clearTimeout(this.timer)))},"mouseenter .ui-menu-item":function(a){if(!this.previousFilter){var c=I(a.target).closest(".ui-menu-item"),d=I(a.currentTarget);c[0]===d[0]&&(this._removeClass(d.siblings().children(".ui-state-active"),null,"ui-state-active"),this.focus(a,d))}},mouseleave:"collapseAll","mouseleave .ui-menu":"collapseAll",focus:function(d,a){var c=this.active||this.element.find(this.options.items).eq(0);a||this.focus(d,c)},blur:function(a){this._delay(function(){var c=!I.contains(this.element[0],I.ui.safeActiveElement(this.document[0]));c&&this.collapseAll(a)})},keydown:"_keydown"}),this.refresh(),this._on(this.document,{click:function(a){this._closeOnDocumentClick(a)&&this.collapseAll(a),this.mouseHandled=!1}})},_destroy:function(){var a=this.element.find(".ui-menu-item").removeAttr("role aria-disabled"),c=a.children(".ui-menu-item-wrapper").removeUniqueId().removeAttr("tabIndex role aria-haspopup");this.element.removeAttr("aria-activedescendant").find(".ui-menu").addBack().removeAttr("role aria-labelledby aria-expanded aria-hidden aria-disabled tabIndex").removeUniqueId().show(),c.children().each(function(){var d=I(this);d.data("ui-menu-submenu-caret")&&d.remove()})},_keydown:function(d){var f,l,g,h,c=!0;switch(d.keyCode){case I.ui.keyCode.PAGE_UP:this.previousPage(d);break;case I.ui.keyCode.PAGE_DOWN:this.nextPage(d);break;case I.ui.keyCode.HOME:this._move("first","first",d);break;case I.ui.keyCode.END:this._move("last","last",d);break;case I.ui.keyCode.UP:this.previous(d);break;case I.ui.keyCode.DOWN:this.next(d);break;case I.ui.keyCode.LEFT:this.collapse(d);break;case I.ui.keyCode.RIGHT:this.active&&!this.active.is(".ui-state-disabled")&&this.expand(d);break;case I.ui.keyCode.ENTER:case I.ui.keyCode.SPACE:this._activate(d);break;case I.ui.keyCode.ESCAPE:this.collapse(d);break;default:c=!1,l=this.previousFilter||"",h=!1,g=d.keyCode>=96&&105>=d.keyCode?""+(d.keyCode-96):String.fromCharCode(d.keyCode),clearTimeout(this.filterTimer),g===l?h=!0:g=l+g,f=this._filterMenuItems(g),f=h&&-1!==f.index(this.active.next())?this.active.nextAll(".ui-menu-item"):f,f.length||(g=String.fromCharCode(d.keyCode),f=this._filterMenuItems(g)),f.length?(this.focus(d,f),this.previousFilter=g,this.filterTimer=this._delay(function(){delete this.previousFilter},1000)):delete this.previousFilter}c&&d.preventDefault()},_activate:function(a){this.active&&!this.active.is(".ui-state-disabled")&&(this.active.children("[aria-haspopup='true']").length?this.expand(a):this.select(a))},refresh:function(){var d,g,t,l,m,c=this,p=this.options.icons.submenu,f=this.element.find(this.options.menus);this._toggleClass("ui-menu-icons",null,!!this.element.find(".ui-icon").length),t=f.filter(":not(.ui-menu)").hide().attr({role:this.options.role,"aria-hidden":"true","aria-expanded":"false"}).each(function(){var a=I(this),h=a.prev(),n=I("<span>").data("ui-menu-submenu-caret",!0);c._addClass(n,"ui-menu-icon","ui-icon "+p),h.attr("aria-haspopup","true").prepend(n),a.attr("aria-labelledby",h.attr("id"))}),this._addClass(t,"ui-menu","ui-widget ui-widget-content ui-front"),d=f.add(this.element),g=d.find(this.options.items),g.not(".ui-menu-item").each(function(){var a=I(this);c._isDivider(a)&&c._addClass(a,"ui-menu-divider","ui-widget-content")}),l=g.not(".ui-menu-item, .ui-menu-divider"),m=l.children().not(".ui-menu").uniqueId().attr({tabIndex:-1,role:this._itemRole()}),this._addClass(l,"ui-menu-item")._addClass(m,"ui-menu-item-wrapper"),g.filter(".ui-state-disabled").attr("aria-disabled","true"),this.active&&!I.contains(this.element[0],this.active[0])&&this.blur()},_itemRole:function(){return{menu:"menuitem",listbox:"option"}[this.options.role]},_setOption:function(d,a){if("icons"===d){var c=this.element.find(".ui-menu-icon");this._removeClass(c,null,this.options.icons.submenu)._addClass(c,null,a.submenu)}this._super(d,a)},_setOptionDisabled:function(a){this._super(a),this.element.attr("aria-disabled",a+""),this._toggleClass(null,"ui-state-disabled",!!a)},focus:function(g,a){var c,f,d;this.blur(g,g&&"focus"===g.type),this._scrollIntoView(a),this.active=a.first(),f=this.active.children(".ui-menu-item-wrapper"),this._addClass(f,null,"ui-state-active"),this.options.role&&this.element.attr("aria-activedescendant",f.attr("id")),d=this.active.parent().closest(".ui-menu-item").children(".ui-menu-item-wrapper"),this._addClass(d,null,"ui-state-active"),g&&"keydown"===g.type?this._close():this.timer=this._delay(function(){this._close()},this.delay),c=a.children(".ui-menu"),c.length&&g&&/^mouse/.test(g.type)&&this._startOpening(c),this.activeMenu=a.parent(),this._trigger("focus",g,{item:a})},_scrollIntoView:function(d){var f,m,g,h,c,l;this._hasScroll()&&(f=parseFloat(I.css(this.activeMenu[0],"borderTopWidth"))||0,m=parseFloat(I.css(this.activeMenu[0],"paddingTop"))||0,g=d.offset().top-this.activeMenu.offset().top-f-m,h=this.activeMenu.scrollTop(),c=this.activeMenu.height(),l=d.outerHeight(),0>g?this.activeMenu.scrollTop(h+g):g+l>c&&this.activeMenu.scrollTop(h+g-c+l))},blur:function(c,a){a||clearTimeout(this.timer),this.active&&(this._removeClass(this.active.children(".ui-menu-item-wrapper"),null,"ui-state-active"),this._trigger("blur",c,{item:this.active}),this.active=null)},_startOpening:function(a){clearTimeout(this.timer),"true"===a.attr("aria-hidden")&&(this.timer=this._delay(function(){this._close(),this._open(a)},this.delay))},_open:function(a){var c=I.extend({of:this.active},this.options.position);clearTimeout(this.timer),this.element.find(".ui-menu").not(a.parents(".ui-menu")).hide().attr("aria-hidden","true"),a.show().removeAttr("aria-hidden").attr("aria-expanded","true").position(c)},collapseAll:function(a,c){clearTimeout(this.timer),this.timer=this._delay(function(){var d=c?this.element:I(a&&a.target).closest(this.element.find(".ui-menu"));d.length||(d=this.element),this._close(d),this.blur(a),this._removeClass(d.find(".ui-state-active"),null,"ui-state-active"),this.activeMenu=d},this.delay)},_close:function(a){a||(a=this.active?this.active.parent():this.element),a.find(".ui-menu").hide().attr("aria-hidden","true").attr("aria-expanded","false")},_closeOnDocumentClick:function(a){return !I(a.target).closest(".ui-menu").length},_isDivider:function(a){return !/[^\-\u2014\u2013\s]/.test(a.text())},collapse:function(c){var a=this.active&&this.active.parent().closest(".ui-menu-item",this.element);a&&a.length&&(this._close(),this.focus(c,a))},expand:function(c){var a=this.active&&this.active.children(".ui-menu ").find(this.options.items).first();a&&a.length&&(this._open(a.parent()),this._delay(function(){this.focus(c,a)}))},next:function(a){this._move("next","first",a)},previous:function(a){this._move("prev","last",a)},isFirstItem:function(){return this.active&&!this.active.prevAll(".ui-menu-item").length},isLastItem:function(){return this.active&&!this.active.nextAll(".ui-menu-item").length},_move:function(f,a,c){var d;this.active&&(d="first"===f||"last"===f?this.active["first"===f?"prevAll":"nextAll"](".ui-menu-item").eq(-1):this.active[f+"All"](".ui-menu-item").eq(0)),d&&d.length&&this.active||(d=this.activeMenu.find(this.options.items)[a]()),this.focus(c,d)},nextPage:function(a){var c,f,d;return this.active?(this.isLastItem()||(this._hasScroll()?(f=this.active.offset().top,d=this.element.height(),this.active.nextAll(".ui-menu-item").each(function(){return c=I(this),0>c.offset().top-f-d}),this.focus(a,c)):this.focus(a,this.activeMenu.find(this.options.items)[this.active?"last":"first"]())),void 0):(this.next(a),void 0)},previousPage:function(a){var c,f,d;return this.active?(this.isFirstItem()||(this._hasScroll()?(f=this.active.offset().top,d=this.element.height(),this.active.prevAll(".ui-menu-item").each(function(){return c=I(this),c.offset().top-f+d>0}),this.focus(a,c)):this.focus(a,this.activeMenu.find(this.options.items).first())),void 0):(this.next(a),void 0)},_hasScroll:function(){return this.element.outerHeight()<this.element.prop("scrollHeight")},select:function(a){this.active=this.active||I(a.target).closest(".ui-menu-item");var c={item:this.active};this.active.has(".ui-menu").length||this.collapseAll(a,!0),this._trigger("select",a,c)},_filterMenuItems:function(a){var c=a.replace(/[\-\[\]{}()*+?.,\\\^$|#\s]/g,"\\$&"),d=RegExp("^"+c,"i");return this.activeMenu.find(this.options.items).filter(".ui-menu-item").filter(function(){return d.test(I.trim(I(this).children(".ui-menu-item-wrapper").text()))})}}),I.widget("ui.autocomplete",{version:"1.12.1",defaultElement:"<input>",options:{appendTo:null,autoFocus:!1,delay:300,minLength:1,position:{my:"left top",at:"left bottom",collision:"none"},source:null,change:null,close:null,focus:null,open:null,response:null,search:null,select:null},requestIndex:0,pending:0,_create:function(){var d,f,l,g=this.element[0].nodeName.toLowerCase(),h="textarea"===g,c="input"===g;this.isMultiLine=h||!c&&this._isContentEditable(this.element),this.valueMethod=this.element[h||c?"val":"text"],this.isNewMenu=!0,this._addClass("ui-autocomplete-input"),this.element.attr("autocomplete","off"),this._on(this.element,{keydown:function(a){if(this.element.prop("readOnly")){return d=!0,l=!0,f=!0,void 0}d=!1,l=!1,f=!1;var e=I.ui.keyCode;switch(a.keyCode){case e.PAGE_UP:d=!0,this._move("previousPage",a);break;case e.PAGE_DOWN:d=!0,this._move("nextPage",a);break;case e.UP:d=!0,this._keyEvent("previous",a);break;case e.DOWN:d=!0,this._keyEvent("next",a);break;case e.ENTER:this.menu.active&&(d=!0,a.preventDefault(),this.menu.select(a));break;case e.TAB:this.menu.active&&this.menu.select(a);break;case e.ESCAPE:this.menu.element.is(":visible")&&(this.isMultiLine||this._value(this.term),this.close(a),a.preventDefault());break;default:f=!0,this._searchTimeout(a)}},keypress:function(e){if(d){return d=!1,(!this.isMultiLine||this.menu.element.is(":visible"))&&e.preventDefault(),void 0}if(!f){var a=I.ui.keyCode;switch(e.keyCode){case a.PAGE_UP:this._move("previousPage",e);break;case a.PAGE_DOWN:this._move("nextPage",e);break;case a.UP:this._keyEvent("previous",e);break;case a.DOWN:this._keyEvent("next",e)}}},input:function(a){return l?(l=!1,a.preventDefault(),void 0):(this._searchTimeout(a),void 0)},focus:function(){this.selectedItem=null,this.previous=this._value()},blur:function(a){return this.cancelBlur?(delete this.cancelBlur,void 0):(clearTimeout(this.searching),this.close(a),this._change(a),void 0)}}),this._initSource(),this.menu=I("<ul>").appendTo(this._appendTo()).menu({role:null}).hide().menu("instance"),this._addClass(this.menu.element,"ui-autocomplete","ui-front"),this._on(this.menu.element,{mousedown:function(a){a.preventDefault(),this.cancelBlur=!0,this._delay(function(){delete this.cancelBlur,this.element[0]!==I.ui.safeActiveElement(this.document[0])&&this.element.trigger("focus")})},menufocus:function(a,m){var p,o;return this.isNewMenu&&(this.isNewMenu=!1,a.originalEvent&&/^mouse/.test(a.originalEvent.type))?(this.menu.blur(),this.document.one("mousemove",function(){I(a.target).trigger(a.originalEvent)}),void 0):(o=m.item.data("ui-autocomplete-item"),!1!==this._trigger("focus",a,{item:o})&&a.originalEvent&&/^key/.test(a.originalEvent.type)&&this._value(o.value),p=m.item.attr("aria-label")||o.value,p&&I.trim(p).length&&(this.liveRegion.children().hide(),I("<div>").text(p).appendTo(this.liveRegion)),void 0)},menuselect:function(a,m){var p=m.item.data("ui-autocomplete-item"),o=this.previous;this.element[0]!==I.ui.safeActiveElement(this.document[0])&&(this.element.trigger("focus"),this.previous=o,this._delay(function(){this.previous=o,this.selectedItem=p})),!1!==this._trigger("select",a,{item:p})&&this._value(p.value),this.term=this._value(),this.close(a),this.selectedItem=p}}),this.liveRegion=I("<div>",{role:"status","aria-live":"assertive","aria-relevant":"additions"}).appendTo(this.document[0].body),this._addClass(this.liveRegion,null,"ui-helper-hidden-accessible"),this._on(this.window,{beforeunload:function(){this.element.removeAttr("autocomplete")}})},_destroy:function(){clearTimeout(this.searching),this.element.removeAttr("autocomplete"),this.menu.element.remove(),this.liveRegion.remove()},_setOption:function(c,a){this._super(c,a),"source"===c&&this._initSource(),"appendTo"===c&&this.menu.element.appendTo(this._appendTo()),"disabled"===c&&a&&this.xhr&&this.xhr.abort()},_isEventTargetInWidget:function(a){var c=this.menu.element[0];return a.target===this.element[0]||a.target===c||I.contains(c,a.target)},_closeOnClickOutside:function(a){this._isEventTargetInWidget(a)||this.close()},_appendTo:function(){var a=this.options.appendTo;return a&&(a=a.jquery||a.nodeType?I(a):this.document.find(a).eq(0)),a&&a[0]||(a=this.element.closest(".ui-front, dialog")),a.length||(a=this.document[0].body),a},_initSource:function(){var a,c,d=this;I.isArray(this.options.source)?(a=this.options.source,this.source=function(e,f){f(I.ui.autocomplete.filter(a,e.term))}):"string"==typeof this.options.source?(c=this.options.source,this.source=function(f,g){d.xhr&&d.xhr.abort(),d.xhr=I.ajax({url:c,data:f,dataType:"json",success:function(e){g(e)},error:function(){g([])}})}):this.source=this.options.source},_searchTimeout:function(a){clearTimeout(this.searching),this.searching=this._delay(function(){var c=this.term===this._value(),d=this.menu.element.is(":visible"),f=a.altKey||a.ctrlKey||a.metaKey||a.shiftKey;(!c||c&&!d&&!f)&&(this.selectedItem=null,this.search(null,a))},this.options.delay)},search:function(c,a){return c=null!=c?c:this._value(),this.term=this._value(),c.length<this.options.minLength?this.close(a):this._trigger("search",a)!==!1?this._search(c):void 0},_search:function(a){this.pending++,this._addClass("ui-autocomplete-loading"),this.cancelSearch=!1,this.source({term:a},this._response())},_response:function(){var a=++this.requestIndex;return I.proxy(function(c){a===this.requestIndex&&this.__response(c),this.pending--,this.pending||this._removeClass("ui-autocomplete-loading")},this)},__response:function(a){a&&(a=this._normalize(a)),this._trigger("response",null,{content:a}),!this.options.disabled&&a&&a.length&&!this.cancelSearch?(this._suggest(a),this._trigger("open")):this._close()},close:function(a){this.cancelSearch=!0,this._close(a)},_close:function(a){this._off(this.document,"mousedown"),this.menu.element.is(":visible")&&(this.menu.element.hide(),this.menu.blur(),this.isNewMenu=!0,this._trigger("close",a))},_change:function(a){this.previous!==this._value()&&this._trigger("change",a,{item:this.selectedItem})},_normalize:function(a){return a.length&&a[0].label&&a[0].value?a:I.map(a,function(c){return"string"==typeof c?{label:c,value:c}:I.extend({},c,{label:c.label||c.value,value:c.value||c.label})})},_suggest:function(a){var c=this.menu.element.empty();this._renderMenu(c,a),this.isNewMenu=!0,this.menu.refresh(),c.show(),this._resizeMenu(),c.position(I.extend({of:this.element},this.options.position)),this.options.autoFocus&&this.menu.next(),this._on(this.document,{mousedown:"_closeOnClickOutside"})},_resizeMenu:function(){var a=this.menu.element;a.outerWidth(Math.max(a.width("").outerWidth()+1,this.element.outerWidth()))},_renderMenu:function(a,c){var d=this;I.each(c,function(f,e){d._renderItemData(a,e)})},_renderItemData:function(c,a){return this._renderItem(c,a).data("ui-autocomplete-item",a)},_renderItem:function(a,c){return I("<li>").append(I("<div>").text(c.label)).appendTo(a)},_move:function(c,a){return this.menu.element.is(":visible")?this.menu.isFirstItem()&&/^previous/.test(c)||this.menu.isLastItem()&&/^next/.test(c)?(this.isMultiLine||this._value(this.term),this.menu.blur(),void 0):(this.menu[c](a),void 0):(this.search(null,a),void 0)},widget:function(){return this.menu.element},_value:function(){return this.valueMethod.apply(this.element,arguments)},_keyEvent:function(c,a){(!this.isMultiLine||this.menu.element.is(":visible"))&&(this._move(c,a),a.preventDefault())},_isContentEditable:function(c){if(!c.length){return !1}var a=c.prop("contentEditable");return"inherit"===a?this._isContentEditable(c.parent()):"true"===a}}),I.extend(I.ui.autocomplete,{escapeRegex:function(a){return a.replace(/[\-\[\]{}()*+?.,\\\^$|#\s]/g,"\\$&")},filter:function(a,c){var d=RegExp(I.ui.autocomplete.escapeRegex(c),"i");return I.grep(a,function(e){return d.test(e.label||e.value||e)})}}),I.widget("ui.autocomplete",I.ui.autocomplete,{options:{messages:{noResults:"No search results.",results:function(a){return a+(a>1?" results are":" result is")+" available, use up and down arrow keys to navigate."}}},__response:function(a){var c;this._superApply(arguments),this.options.disabled||this.cancelSearch||(c=a&&a.length?this.options.messages.results(a.length):this.options.messages.noResults,this.liveRegion.children().hide(),I("<div>").text(c).appendTo(this.liveRegion))}}),I.ui.autocomplete;var q=/ui-corner-([a-z]){2,6}/g;I.widget("ui.controlgroup",{version:"1.12.1",defaultElement:"<div>",options:{direction:"horizontal",disabled:null,onlyVisible:!0,items:{button:"input[type=button], input[type=submit], input[type=reset], button, a",controlgroupLabel:".ui-controlgroup-label",checkboxradio:"input[type='checkbox'], input[type='radio']",selectmenu:"select",spinner:".ui-spinner-input"}},_create:function(){this._enhance()},_enhance:function(){this.element.attr("role","toolbar"),this.refresh()},_destroy:function(){this._callChildMethod("destroy"),this.childWidgets.removeData("ui-controlgroup-data"),this.element.removeAttr("role"),this.options.items.controlgroupLabel&&this.element.find(this.options.items.controlgroupLabel).find(".ui-controlgroup-label-contents").contents().unwrap()},_initWidgets:function(){var a=this,c=[];I.each(this.options.items,function(g,e){var f,d={};return e?"controlgroupLabel"===g?(f=a.element.find(e),f.each(function(){var h=I(this);h.children(".ui-controlgroup-label-contents").length||h.contents().wrapAll("<span class='ui-controlgroup-label-contents'></span>")}),a._addClass(f,null,"ui-widget ui-widget-content ui-state-default"),c=c.concat(f.get()),void 0):(I.fn[g]&&(d=a["_"+g+"Options"]?a["_"+g+"Options"]("middle"):{classes:{}},a.element.find(e).each(function(){var l=I(this),m=l[g]("instance"),p=I.widget.extend({},d);if("button"!==g||!l.parent(".ui-spinner").length){m||(m=l[g]()[g]("instance")),m&&(p.classes=a._resolveClassesValues(p.classes,m)),l[g](p);var i=l[g]("widget");I.data(i[0],"ui-controlgroup-data",m?m:l[g]("instance")),c.push(i[0])}})),void 0):void 0}),this.childWidgets=I(I.unique(c)),this._addClass(this.childWidgets,"ui-controlgroup-item")},_callChildMethod:function(a){this.childWidgets.each(function(){var c=I(this),d=c.data("ui-controlgroup-data");d&&d[a]&&d[a]()})},_updateCornerClass:function(f,a){var c="ui-corner-top ui-corner-bottom ui-corner-left ui-corner-right ui-corner-all",d=this._buildSimpleOptions(a,"label").classes.label;this._removeClass(f,null,c),this._addClass(f,null,d)},_buildSimpleOptions:function(f,a){var c="vertical"===this.options.direction,d={classes:{}};return d.classes[a]={middle:"",first:"ui-corner-"+(c?"top":"left"),last:"ui-corner-"+(c?"bottom":"right"),only:"ui-corner-all"}[f],d},_spinnerOptions:function(c){var a=this._buildSimpleOptions(c,"ui-spinner");return a.classes["ui-spinner-up"]="",a.classes["ui-spinner-down"]="",a},_buttonOptions:function(a){return this._buildSimpleOptions(a,"ui-button")},_checkboxradioOptions:function(a){return this._buildSimpleOptions(a,"ui-checkboxradio-label")},_selectmenuOptions:function(c){var a="vertical"===this.options.direction;return{width:a?"auto":!1,classes:{middle:{"ui-selectmenu-button-open":"","ui-selectmenu-button-closed":""},first:{"ui-selectmenu-button-open":"ui-corner-"+(a?"top":"tl"),"ui-selectmenu-button-closed":"ui-corner-"+(a?"top":"left")},last:{"ui-selectmenu-button-open":a?"":"ui-corner-tr","ui-selectmenu-button-closed":"ui-corner-"+(a?"bottom":"right")},only:{"ui-selectmenu-button-open":"ui-corner-top","ui-selectmenu-button-closed":"ui-corner-all"}}[c]}},_resolveClassesValues:function(a,c){var d={};return I.each(a,function(e){var f=c.options.classes[e]||"";f=I.trim(f.replace(q,"")),d[e]=(f+" "+a[e]).replace(/\s+/g," ")}),d},_setOption:function(c,a){return"direction"===c&&this._removeClass("ui-controlgroup-"+this.options.direction),this._super(c,a),"disabled"===c?(this._callChildMethod(a?"disable":"enable"),void 0):(this.refresh(),void 0)},refresh:function(){var a,c=this;this._addClass("ui-controlgroup ui-controlgroup-"+this.options.direction),"horizontal"===this.options.direction&&this._addClass(null,"ui-helper-clearfix"),this._initWidgets(),a=this.childWidgets,this.options.onlyVisible&&(a=a.filter(":visible")),a.length&&(I.each(["first","last"],function(g,f){var d=a[f]().data("ui-controlgroup-data");if(d&&c["_"+d.widgetName+"Options"]){var e=c["_"+d.widgetName+"Options"](1===a.length?"only":f);e.classes=c._resolveClassesValues(e.classes,d),d.element[d.widgetName](e)}else{c._updateCornerClass(a[f](),f)}}),this._callChildMethod("refresh"))}}),I.widget("ui.checkboxradio",[I.ui.formResetMixin,{version:"1.12.1",options:{disabled:null,label:null,icon:!0,classes:{"ui-checkboxradio-label":"ui-corner-all","ui-checkboxradio-icon":"ui-corner-all"}},_getCreateOptions:function(){var a,c,f=this,d=this._super()||{};return this._readType(),c=this.element.labels(),this.label=I(c[c.length-1]),this.label.length||I.error("No label found for checkboxradio widget"),this.originalLabel="",this.label.contents().not(this.element[0]).each(function(){f.originalLabel+=3===this.nodeType?I(this).text():this.outerHTML}),this.originalLabel&&(d.label=this.originalLabel),a=this.element[0].disabled,null!=a&&(d.disabled=a),d},_create:function(){var a=this.element[0].checked;this._bindFormResetHandler(),null==this.options.disabled&&(this.options.disabled=this.element[0].disabled),this._setOption("disabled",this.options.disabled),this._addClass("ui-checkboxradio","ui-helper-hidden-accessible"),this._addClass(this.label,"ui-checkboxradio-label","ui-button ui-widget"),"radio"===this.type&&this._addClass(this.label,"ui-checkboxradio-radio-label"),this.options.label&&this.options.label!==this.originalLabel?this._updateLabel():this.originalLabel&&(this.options.label=this.originalLabel),this._enhance(),a&&(this._addClass(this.label,"ui-checkboxradio-checked","ui-state-active"),this.icon&&this._addClass(this.icon,null,"ui-state-hover")),this._on({change:"_toggleClasses",focus:function(){this._addClass(this.label,null,"ui-state-focus ui-visual-focus")},blur:function(){this._removeClass(this.label,null,"ui-state-focus ui-visual-focus")}})},_readType:function(){var a=this.element[0].nodeName.toLowerCase();this.type=this.element[0].type,"input"===a&&/radio|checkbox/.test(this.type)||I.error("Can't create checkboxradio on element.nodeName="+a+" and element.type="+this.type)},_enhance:function(){this._updateIcon(this.element[0].checked)},widget:function(){return this.label},_getRadioGroup:function(){var a,c=this.element[0].name,d="input[name='"+I.ui.escapeSelector(c)+"']";return c?(a=this.form.length?I(this.form[0].elements).filter(d):I(d).filter(function(){return 0===I(this).form().length}),a.not(this.element)):I([])},_toggleClasses:function(){var a=this.element[0].checked;this._toggleClass(this.label,"ui-checkboxradio-checked","ui-state-active",a),this.options.icon&&"checkbox"===this.type&&this._toggleClass(this.icon,null,"ui-icon-check ui-state-checked",a)._toggleClass(this.icon,null,"ui-icon-blank",!a),"radio"===this.type&&this._getRadioGroup().each(function(){var c=I(this).checkboxradio("instance");c&&c._removeClass(c.label,"ui-checkboxradio-checked","ui-state-active")})},_destroy:function(){this._unbindFormResetHandler(),this.icon&&(this.icon.remove(),this.iconSpace.remove())},_setOption:function(c,a){return"label"!==c||a?(this._super(c,a),"disabled"===c?(this._toggleClass(this.label,null,"ui-state-disabled",a),this.element[0].disabled=a,void 0):(this.refresh(),void 0)):void 0},_updateIcon:function(a){var c="ui-icon ui-icon-background ";this.options.icon?(this.icon||(this.icon=I("<span>"),this.iconSpace=I("<span> </span>"),this._addClass(this.iconSpace,"ui-checkboxradio-icon-space")),"checkbox"===this.type?(c+=a?"ui-icon-check ui-state-checked":"ui-icon-blank",this._removeClass(this.icon,null,a?"ui-icon-blank":"ui-icon-check")):c+="ui-icon-blank",this._addClass(this.icon,"ui-checkboxradio-icon",c),a||this._removeClass(this.icon,null,"ui-icon-check ui-state-checked"),this.icon.prependTo(this.label).after(this.iconSpace)):void 0!==this.icon&&(this.icon.remove(),this.iconSpace.remove(),delete this.icon)},_updateLabel:function(){var a=this.label.contents().not(this.element[0]);this.icon&&(a=a.not(this.icon[0])),this.iconSpace&&(a=a.not(this.iconSpace[0])),a.remove(),this.label.append(this.options.label)},refresh:function(){var c=this.element[0].checked,a=this.element[0].disabled;this._updateIcon(c),this._toggleClass(this.label,"ui-checkboxradio-checked","ui-state-active",c),null!==this.options.label&&this._updateLabel(),a!==this.options.disabled&&this._setOptions({disabled:a})}}]),I.ui.checkboxradio,I.widget("ui.button",{version:"1.12.1",defaultElement:"<button>",options:{classes:{"ui-button":"ui-corner-all"},disabled:null,icon:null,iconPosition:"beginning",label:null,showLabel:!0},_getCreateOptions:function(){var c,a=this._super()||{};return this.isInput=this.element.is("input"),c=this.element[0].disabled,null!=c&&(a.disabled=c),this.originalLabel=this.isInput?this.element.val():this.element.html(),this.originalLabel&&(a.label=this.originalLabel),a},_create:function(){!this.option.showLabel&!this.options.icon&&(this.options.showLabel=!0),null==this.options.disabled&&(this.options.disabled=this.element[0].disabled||!1),this.hasTitle=!!this.element.attr("title"),this.options.label&&this.options.label!==this.originalLabel&&(this.isInput?this.element.val(this.options.label):this.element.html(this.options.label)),this._addClass("ui-button","ui-widget"),this._setOption("disabled",this.options.disabled),this._enhance(),this.element.is("a")&&this._on({keyup:function(a){a.keyCode===I.ui.keyCode.SPACE&&(a.preventDefault(),this.element[0].click?this.element[0].click():this.element.trigger("click"))}})},_enhance:function(){this.element.is("button")||this.element.attr("role","button"),this.options.icon&&(this._updateIcon("icon",this.options.icon),this._updateTooltip())},_updateTooltip:function(){this.title=this.element.attr("title"),this.options.showLabel||this.title||this.element.attr("title",this.options.label)},_updateIcon:function(a,c){var g="iconPosition"!==a,d=g?this.options.iconPosition:c,f="top"===d||"bottom"===d;this.icon?g&&this._removeClass(this.icon,null,this.options.icon):(this.icon=I("<span>"),this._addClass(this.icon,"ui-button-icon","ui-icon"),this.options.showLabel||this._addClass("ui-button-icon-only")),g&&this._addClass(this.icon,null,c),this._attachIcon(d),f?(this._addClass(this.icon,null,"ui-widget-icon-block"),this.iconSpace&&this.iconSpace.remove()):(this.iconSpace||(this.iconSpace=I("<span> </span>"),this._addClass(this.iconSpace,"ui-button-icon-space")),this._removeClass(this.icon,null,"ui-wiget-icon-block"),this._attachIconSpace(d))},_destroy:function(){this.element.removeAttr("role"),this.icon&&this.icon.remove(),this.iconSpace&&this.iconSpace.remove(),this.hasTitle||this.element.removeAttr("title")},_attachIconSpace:function(a){this.icon[/^(?:end|bottom)/.test(a)?"before":"after"](this.iconSpace)},_attachIcon:function(a){this.element[/^(?:end|bottom)/.test(a)?"append":"prepend"](this.icon)},_setOptions:function(d){var a=void 0===d.showLabel?this.options.showLabel:d.showLabel,c=void 0===d.icon?this.options.icon:d.icon;a||c||(d.showLabel=!0),this._super(d)},_setOption:function(c,a){"icon"===c&&(a?this._updateIcon(c,a):this.icon&&(this.icon.remove(),this.iconSpace&&this.iconSpace.remove())),"iconPosition"===c&&this._updateIcon(c,a),"showLabel"===c&&(this._toggleClass("ui-button-icon-only",null,!a),this._updateTooltip()),"label"===c&&(this.isInput?this.element.val(a):(this.element.html(a),this.icon&&(this._attachIcon(this.options.iconPosition),this._attachIconSpace(this.options.iconPosition)))),this._super(c,a),"disabled"===c&&(this._toggleClass(null,"ui-state-disabled",a),this.element[0].disabled=a,a&&this.element.blur())},refresh:function(){var a=this.element.is("input, button")?this.element[0].disabled:this.element.hasClass("ui-button-disabled");a!==this.options.disabled&&this._setOptions({disabled:a}),this._updateTooltip()}}),I.uiBackCompat!==!1&&(I.widget("ui.button",I.ui.button,{options:{text:!0,icons:{primary:null,secondary:null}},_create:function(){this.options.showLabel&&!this.options.text&&(this.options.showLabel=this.options.text),!this.options.showLabel&&this.options.text&&(this.options.text=this.options.showLabel),this.options.icon||!this.options.icons.primary&&!this.options.icons.secondary?this.options.icon&&(this.options.icons.primary=this.options.icon):this.options.icons.primary?this.options.icon=this.options.icons.primary:(this.options.icon=this.options.icons.secondary,this.options.iconPosition="end"),this._super()},_setOption:function(c,a){return"text"===c?(this._super("showLabel",a),void 0):("showLabel"===c&&(this.options.text=a),"icon"===c&&(this.options.icons.primary=a),"icons"===c&&(a.primary?(this._super("icon",a.primary),this._super("iconPosition","beginning")):a.secondary&&(this._super("icon",a.secondary),this._super("iconPosition","end"))),this._superApply(arguments),void 0)}}),I.fn.button=function(a){return function(){return !this.length||this.length&&"INPUT"!==this[0].tagName||this.length&&"INPUT"===this[0].tagName&&"checkbox"!==this.attr("type")&&"radio"!==this.attr("type")?a.apply(this,arguments):(I.ui.checkboxradio||I.error("Checkboxradio widget missing"),0===arguments.length?this.checkboxradio({icon:!1}):this.checkboxradio.apply(this,arguments))}}(I.fn.button),I.fn.buttonset=function(){return I.ui.controlgroup||I.error("Controlgroup widget missing"),"option"===arguments[0]&&"items"===arguments[1]&&arguments[2]?this.controlgroup.apply(this,[arguments[0],"items.button",arguments[2]]):"option"===arguments[0]&&"items"===arguments[1]?this.controlgroup.apply(this,[arguments[0],"items.button"]):("object"==typeof arguments[0]&&arguments[0].items&&(arguments[0].items={button:arguments[0].items}),this.controlgroup.apply(this,arguments))}),I.ui.button,I.extend(I.ui,{datepicker:{version:"1.12.1"}});var F;I.extend(H.prototype,{markerClassName:"hasDatepicker",maxRows:4,_widgetDatepicker:function(){return this.dpDiv},setDefaults:function(a){return j(this._defaults,a||{}),this},_attachDatepicker:function(a,c){var g,d,f;g=a.nodeName.toLowerCase(),d="div"===g||"span"===g,a.id||(this.uuid+=1,a.id="dp"+this.uuid),f=this._newInst(I(a),d),f.settings=I.extend({},c||{}),"input"===g?this._connectDatepicker(a,f):d&&this._inlineDatepicker(a,f)},_newInst:function(a,c){var d=a[0].id.replace(/([^A-Za-z0-9_\-])/g,"\\\\$1");return{id:d,input:a,selectedDay:0,selectedMonth:0,selectedYear:0,drawMonth:0,drawYear:0,inline:c,dpDiv:c?D(I("<div class='"+this._inlineClass+" ui-datepicker ui-widget ui-widget-content ui-helper-clearfix ui-corner-all'></div>")):this.dpDiv}},_connectDatepicker:function(a,c){var d=I(a);c.append=I([]),c.trigger=I([]),d.hasClass(this.markerClassName)||(this._attachments(d,c),d.addClass(this.markerClassName).on("keydown",this._doKeyDown).on("keypress",this._doKeyPress).on("keyup",this._doKeyUp),this._autoSize(c),I.data(a,"datepicker",c),c.settings.disabled&&this._disableDatepicker(a))},_attachments:function(d,f){var m,g,h,c=this._get(f,"appendText"),l=this._get(f,"isRTL");f.append&&f.append.remove(),c&&(f.append=I("<span class='"+this._appendClass+"'>"+c+"</span>"),d[l?"before":"after"](f.append)),d.off("focus",this._showDatepicker),f.trigger&&f.trigger.remove(),m=this._get(f,"showOn"),("focus"===m||"both"===m)&&d.on("focus",this._showDatepicker),("button"===m||"both"===m)&&(g=this._get(f,"buttonText"),h=this._get(f,"buttonImage"),f.trigger=I(this._get(f,"buttonImageOnly")?I("<img/>").addClass(this._triggerClass).attr({src:h,alt:g,title:g}):I("<button type='button'></button>").addClass(this._triggerClass).html(h?I("<img/>").attr({src:h,alt:g,title:g}):g)),d[l?"before":"after"](f.trigger),f.trigger.on("click",function(){return I.datepicker._datepickerShowing&&I.datepicker._lastInput===d[0]?I.datepicker._hideDatepicker():I.datepicker._datepickerShowing&&I.datepicker._lastInput!==d[0]?(I.datepicker._hideDatepicker(),I.datepicker._showDatepicker(d[0])):I.datepicker._showDatepicker(d[0]),!1}))},_autoSize:function(m){if(this._get(m,"autoSize")&&!m.inline){var d,f,l,g,h=new Date(2009,11,20),c=this._get(m,"dateFormat");c.match(/[DM]/)&&(d=function(a){for(f=0,l=0,g=0;a.length>g;g++){a[g].length>f&&(f=a[g].length,l=g)}return l},h.setMonth(d(this._get(m,c.match(/MM/)?"monthNames":"monthNamesShort"))),h.setDate(d(this._get(m,c.match(/DD/)?"dayNames":"dayNamesShort"))+20-h.getDay())),m.input.attr("size",this._formatDate(m,h).length)}},_inlineDatepicker:function(a,c){var d=I(a);d.hasClass(this.markerClassName)||(d.addClass(this.markerClassName).append(c.dpDiv),I.data(a,"datepicker",c),this._setDate(c,this._getDefaultDate(c),!0),this._updateDatepicker(c),this._updateAlternate(c),c.settings.disabled&&this._disableDatepicker(a),c.dpDiv.css("display","block"))},_dialogDatepicker:function(g,p,N,v,L){var M,m,t,a,O,f=this._dialogInst;return f||(this.uuid+=1,M="dp"+this.uuid,this._dialogInput=I("<input type='text' id='"+M+"' style='position: absolute; top: -100px; width: 0px;'/>"),this._dialogInput.on("keydown",this._doKeyDown),I("body").append(this._dialogInput),f=this._dialogInst=this._newInst(this._dialogInput,!1),f.settings={},I.data(this._dialogInput[0],"datepicker",f)),j(f.settings,v||{}),p=p&&p.constructor===Date?this._formatDate(f,p):p,this._dialogInput.val(p),this._pos=L?L.length?L:[L.pageX,L.pageY]:null,this._pos||(m=document.documentElement.clientWidth,t=document.documentElement.clientHeight,a=document.documentElement.scrollLeft||document.body.scrollLeft,O=document.documentElement.scrollTop||document.body.scrollTop,this._pos=[m/2-100+a,t/2-150+O]),this._dialogInput.css("left",this._pos[0]+20+"px").css("top",this._pos[1]+"px"),f.settings.onSelect=N,this._inDialog=!0,this.dpDiv.addClass(this._dialogClass),this._showDatepicker(this._dialogInput[0]),I.blockUI&&I.blockUI(this.dpDiv),I.data(this._dialogInput[0],"datepicker",f),this},_destroyDatepicker:function(a){var c,f=I(a),d=I.data(a,"datepicker");f.hasClass(this.markerClassName)&&(c=a.nodeName.toLowerCase(),I.removeData(a,"datepicker"),"input"===c?(d.append.remove(),d.trigger.remove(),f.removeClass(this.markerClassName).off("focus",this._showDatepicker).off("keydown",this._doKeyDown).off("keypress",this._doKeyPress).off("keyup",this._doKeyUp)):("div"===c||"span"===c)&&f.removeClass(this.markerClassName).empty(),F===d&&(F=null))},_enableDatepicker:function(a){var c,g,d=I(a),f=I.data(a,"datepicker");d.hasClass(this.markerClassName)&&(c=a.nodeName.toLowerCase(),"input"===c?(a.disabled=!1,f.trigger.filter("button").each(function(){this.disabled=!1}).end().filter("img").css({opacity:"1.0",cursor:""})):("div"===c||"span"===c)&&(g=d.children("."+this._inlineClass),g.children().removeClass("ui-state-disabled"),g.find("select.ui-datepicker-month, select.ui-datepicker-year").prop("disabled",!1)),this._disabledInputs=I.map(this._disabledInputs,function(e){return e===a?null:e}))},_disableDatepicker:function(a){var c,g,d=I(a),f=I.data(a,"datepicker");d.hasClass(this.markerClassName)&&(c=a.nodeName.toLowerCase(),"input"===c?(a.disabled=!0,f.trigger.filter("button").each(function(){this.disabled=!0}).end().filter("img").css({opacity:"0.5",cursor:"default"})):("div"===c||"span"===c)&&(g=d.children("."+this._inlineClass),g.children().addClass("ui-state-disabled"),g.find("select.ui-datepicker-month, select.ui-datepicker-year").prop("disabled",!0)),this._disabledInputs=I.map(this._disabledInputs,function(e){return e===a?null:e}),this._disabledInputs[this._disabledInputs.length]=a)},_isDisabledDatepicker:function(c){if(!c){return !1}for(var a=0;this._disabledInputs.length>a;a++){if(this._disabledInputs[a]===c){return !0}}return !1},_getInst:function(a){try{return I.data(a,"datepicker")}catch(c){throw"Missing instance data for this datepicker"}},_optionDatepicker:function(a,d,t){var g,m,p,c,f=this._getInst(a);return 2===arguments.length&&"string"==typeof d?"defaults"===d?I.extend({},I.datepicker._defaults):f?"all"===d?I.extend({},f.settings):this._get(f,d):null:(g=d||{},"string"==typeof d&&(g={},g[d]=t),f&&(this._curInst===f&&this._hideDatepicker(),m=this._getDateDatepicker(a,!0),p=this._getMinMaxDate(f,"min"),c=this._getMinMaxDate(f,"max"),j(f.settings,g),null!==p&&void 0!==g.dateFormat&&void 0===g.minDate&&(f.settings.minDate=this._formatDate(f,p)),null!==c&&void 0!==g.dateFormat&&void 0===g.maxDate&&(f.settings.maxDate=this._formatDate(f,c)),"disabled" in g&&(g.disabled?this._disableDatepicker(a):this._enableDatepicker(a)),this._attachments(I(a),f),this._autoSize(f),this._setDate(f,m),this._updateAlternate(f),this._updateDatepicker(f)),void 0)},_changeDatepicker:function(d,a,c){this._optionDatepicker(d,a,c)},_refreshDatepicker:function(c){var a=this._getInst(c);a&&this._updateDatepicker(a)},_setDateDatepicker:function(d,a){var c=this._getInst(d);c&&(this._setDate(c,a),this._updateDatepicker(c),this._updateAlternate(c))},_getDateDatepicker:function(d,a){var c=this._getInst(d);return c&&!c.inline&&this._setDateFromField(c,a),c?this._getDate(c):null},_doKeyDown:function(d){var f,m,g,h=I.datepicker._getInst(d.target),c=!0,l=h.dpDiv.is(".ui-datepicker-rtl");if(h._keyEvent=!0,I.datepicker._datepickerShowing){switch(d.keyCode){case 9:I.datepicker._hideDatepicker(),c=!1;break;case 13:return g=I("td."+I.datepicker._dayOverClass+":not(."+I.datepicker._currentClass+")",h.dpDiv),g[0]&&I.datepicker._selectDay(d.target,h.selectedMonth,h.selectedYear,g[0]),f=I.datepicker._get(h,"onSelect"),f?(m=I.datepicker._formatDate(h),f.apply(h.input?h.input[0]:null,[m,h])):I.datepicker._hideDatepicker(),!1;case 27:I.datepicker._hideDatepicker();break;case 33:I.datepicker._adjustDate(d.target,d.ctrlKey?-I.datepicker._get(h,"stepBigMonths"):-I.datepicker._get(h,"stepMonths"),"M");break;case 34:I.datepicker._adjustDate(d.target,d.ctrlKey?+I.datepicker._get(h,"stepBigMonths"):+I.datepicker._get(h,"stepMonths"),"M");break;case 35:(d.ctrlKey||d.metaKey)&&I.datepicker._clearDate(d.target),c=d.ctrlKey||d.metaKey;break;case 36:(d.ctrlKey||d.metaKey)&&I.datepicker._gotoToday(d.target),c=d.ctrlKey||d.metaKey;break;case 37:(d.ctrlKey||d.metaKey)&&I.datepicker._adjustDate(d.target,l?1:-1,"D"),c=d.ctrlKey||d.metaKey,d.originalEvent.altKey&&I.datepicker._adjustDate(d.target,d.ctrlKey?-I.datepicker._get(h,"stepBigMonths"):-I.datepicker._get(h,"stepMonths"),"M");break;case 38:(d.ctrlKey||d.metaKey)&&I.datepicker._adjustDate(d.target,-7,"D"),c=d.ctrlKey||d.metaKey;break;case 39:(d.ctrlKey||d.metaKey)&&I.datepicker._adjustDate(d.target,l?-1:1,"D"),c=d.ctrlKey||d.metaKey,d.originalEvent.altKey&&I.datepicker._adjustDate(d.target,d.ctrlKey?+I.datepicker._get(h,"stepBigMonths"):+I.datepicker._get(h,"stepMonths"),"M");break;case 40:(d.ctrlKey||d.metaKey)&&I.datepicker._adjustDate(d.target,7,"D"),c=d.ctrlKey||d.metaKey;break;default:c=!1}}else{36===d.keyCode&&d.ctrlKey?I.datepicker._showDatepicker(this):c=!1}c&&(d.preventDefault(),d.stopPropagation())},_doKeyPress:function(a){var c,f,d=I.datepicker._getInst(a.target);return I.datepicker._get(d,"constrainInput")?(c=I.datepicker._possibleChars(I.datepicker._get(d,"dateFormat")),f=String.fromCharCode(null==a.charCode?a.keyCode:a.charCode),a.ctrlKey||a.metaKey||" ">f||!c||c.indexOf(f)>-1):void 0},_doKeyUp:function(a){var c,f=I.datepicker._getInst(a.target);if(f.input.val()!==f.lastVal){try{c=I.datepicker.parseDate(I.datepicker._get(f,"dateFormat"),f.input?f.input.val():null,I.datepicker._getFormatConfig(f)),c&&(I.datepicker._setDateFromField(f),I.datepicker._updateAlternate(f),I.datepicker._updateDatepicker(f))}catch(d){}}return !0},_showDatepicker:function(d){if(d=d.target||d,"input"!==d.nodeName.toLowerCase()&&(d=I("input",d.parentNode)[0]),!I.datepicker._isDisabledDatepicker(d)&&I.datepicker._lastInput!==d){var t,i,m,p,f,g,a;t=I.datepicker._getInst(d),I.datepicker._curInst&&I.datepicker._curInst!==t&&(I.datepicker._curInst.dpDiv.stop(!0,!0),t&&I.datepicker._datepickerShowing&&I.datepicker._hideDatepicker(I.datepicker._curInst.input[0])),i=I.datepicker._get(t,"beforeShow"),m=i?i.apply(d,[d,t]):{},m!==!1&&(j(t.settings,m),t.lastVal=null,I.datepicker._lastInput=d,I.datepicker._setDateFromField(t),I.datepicker._inDialog&&(d.value=""),I.datepicker._pos||(I.datepicker._pos=I.datepicker._findPos(d),I.datepicker._pos[1]+=d.offsetHeight),p=!1,I(d).parents().each(function(){return p|="fixed"===I(this).css("position"),!p}),f={left:I.datepicker._pos[0],top:I.datepicker._pos[1]},I.datepicker._pos=null,t.dpDiv.empty(),t.dpDiv.css({position:"absolute",display:"block",top:"-1000px"}),I.datepicker._updateDatepicker(t),f=I.datepicker._checkOffset(t,f,p),t.dpDiv.css({position:I.datepicker._inDialog&&I.blockUI?"static":p?"fixed":"absolute",display:"none",left:f.left+"px",top:f.top+"px"}),t.inline||(g=I.datepicker._get(t,"showAnim"),a=I.datepicker._get(t,"duration"),t.dpDiv.css("z-index",A(I(d))+1),I.datepicker._datepickerShowing=!0,I.effects&&I.effects.effect[g]?t.dpDiv.show(g,I.datepicker._get(t,"showOptions"),a):t.dpDiv[g||"show"](g?a:null),I.datepicker._shouldFocusInput(t)&&t.input.trigger("focus"),I.datepicker._curInst=t))}},_updateDatepicker:function(d){this.maxRows=4,F=d,d.dpDiv.empty().append(this._generateHTML(d)),this._attachHandlers(d);var f,l=this._getNumberOfMonths(d),g=l[1],c=17,h=d.dpDiv.find("."+this._dayOverClass+" a");h.length>0&&E.apply(h.get(0)),d.dpDiv.removeClass("ui-datepicker-multi-2 ui-datepicker-multi-3 ui-datepicker-multi-4").width(""),g>1&&d.dpDiv.addClass("ui-datepicker-multi-"+g).css("width",c*g+"em"),d.dpDiv[(1!==l[0]||1!==l[1]?"add":"remove")+"Class"]("ui-datepicker-multi"),d.dpDiv[(this._get(d,"isRTL")?"add":"remove")+"Class"]("ui-datepicker-rtl"),d===I.datepicker._curInst&&I.datepicker._datepickerShowing&&I.datepicker._shouldFocusInput(d)&&d.input.trigger("focus"),d.yearshtml&&(f=d.yearshtml,setTimeout(function(){f===d.yearshtml&&d.yearshtml&&d.dpDiv.find("select.ui-datepicker-year:first").replaceWith(d.yearshtml),f=d.yearshtml=null},0))},_shouldFocusInput:function(a){return a.input&&a.input.is(":visible")&&!a.input.is(":disabled")&&!a.input.is(":focus")},_checkOffset:function(d,g,v){var p=d.dpDiv.outerWidth(),t=d.dpDiv.outerHeight(),c=d.input?d.input.outerWidth():0,u=d.input?d.input.outerHeight():0,f=document.documentElement.clientWidth+(v?0:I(document).scrollLeft()),m=document.documentElement.clientHeight+(v?0:I(document).scrollTop());return g.left-=this._get(d,"isRTL")?p-c:0,g.left-=v&&g.left===d.input.offset().left?I(document).scrollLeft():0,g.top-=v&&g.top===d.input.offset().top+u?I(document).scrollTop():0,g.left-=Math.min(g.left,g.left+p>f&&f>p?Math.abs(g.left+p-f):0),g.top-=Math.min(g.top,g.top+t>m&&m>t?Math.abs(t+u):0),g},_findPos:function(a){for(var c,f=this._getInst(a),d=this._get(f,"isRTL");a&&("hidden"===a.type||1!==a.nodeType||I.expr.filters.hidden(a));){a=a[d?"previousSibling":"nextSibling"]}return c=I(a).offset(),[c.left,c.top]},_hideDatepicker:function(d){var f,l,g,h,c=this._curInst;!c||d&&c!==I.data(d,"datepicker")||this._datepickerShowing&&(f=this._get(c,"showAnim"),l=this._get(c,"duration"),g=function(){I.datepicker._tidyDialog(c)},I.effects&&(I.effects.effect[f]||I.effects[f])?c.dpDiv.hide(f,I.datepicker._get(c,"showOptions"),l,g):c.dpDiv["slideDown"===f?"slideUp":"fadeIn"===f?"fadeOut":"hide"](f?l:null,g),f||g(),this._datepickerShowing=!1,h=this._get(c,"onClose"),h&&h.apply(c.input?c.input[0]:null,[c.input?c.input.val():"",c]),this._lastInput=null,this._inDialog&&(this._dialogInput.css({position:"absolute",left:"0",top:"-100px"}),I.blockUI&&(I.unblockUI(),I("body").append(this.dpDiv))),this._inDialog=!1)},_tidyDialog:function(a){a.dpDiv.removeClass(this._dialogClass).off(".ui-datepicker-calendar")},_checkExternalClick:function(a){if(I.datepicker._curInst){var c=I(a.target),d=I.datepicker._getInst(c[0]);(c[0].id!==I.datepicker._mainDivId&&0===c.parents("#"+I.datepicker._mainDivId).length&&!c.hasClass(I.datepicker.markerClassName)&&!c.closest("."+I.datepicker._triggerClass).length&&I.datepicker._datepickerShowing&&(!I.datepicker._inDialog||!I.blockUI)||c.hasClass(I.datepicker.markerClassName)&&I.datepicker._curInst!==d)&&I.datepicker._hideDatepicker()}},_adjustDate:function(a,c,g){var d=I(a),f=this._getInst(d[0]);this._isDisabledDatepicker(d[0])||(this._adjustInstDate(f,c+("M"===g?this._get(f,"showCurrentAtPos"):0),g),this._updateDatepicker(f))},_gotoToday:function(a){var c,f=I(a),d=this._getInst(f[0]);this._get(d,"gotoCurrent")&&d.currentDay?(d.selectedDay=d.currentDay,d.drawMonth=d.selectedMonth=d.currentMonth,d.drawYear=d.selectedYear=d.currentYear):(c=new Date,d.selectedDay=c.getDate(),d.drawMonth=d.selectedMonth=c.getMonth(),d.drawYear=d.selectedYear=c.getFullYear()),this._notifyChange(d),this._adjustDate(f)},_selectMonthYear:function(a,c,g){var d=I(a),f=this._getInst(d[0]);f["selected"+("M"===g?"Month":"Year")]=f["draw"+("M"===g?"Month":"Year")]=parseInt(c.options[c.selectedIndex].value,10),this._notifyChange(f),this._adjustDate(d)},_selectDay:function(d,f,l,g){var h,c=I(d);I(g).hasClass(this._unselectableClass)||this._isDisabledDatepicker(c[0])||(h=this._getInst(c[0]),h.selectedDay=h.currentDay=I("a",g).html(),h.selectedMonth=h.currentMonth=f,h.selectedYear=h.currentYear=l,this._selectDate(d,this._formatDate(h,h.currentDay,h.currentMonth,h.currentYear)))},_clearDate:function(a){var c=I(a);this._selectDate(c,"")},_selectDate:function(a,c){var g,d=I(a),f=this._getInst(d[0]);c=null!=c?c:this._formatDate(f),f.input&&f.input.val(c),this._updateAlternate(f),g=this._get(f,"onSelect"),g?g.apply(f.input?f.input[0]:null,[c,f]):f.input&&f.input.trigger("change"),f.inline?this._updateDatepicker(f):(this._hideDatepicker(),this._lastInput=f.input[0],"object"!=typeof f.input[0]&&f.input.trigger("focus"),this._lastInput=null)},_updateAlternate:function(a){var c,g,d,f=this._get(a,"altField");f&&(c=this._get(a,"altFormat")||this._get(a,"dateFormat"),g=this._getDate(a),d=this.formatDate(c,g,this._getFormatConfig(a)),I(f).val(d))},noWeekends:function(c){var a=c.getDay();return[a>0&&6>a,""]},iso8601Week:function(d){var a,c=new Date(d.getTime());return c.setDate(c.getDate()+4-(c.getDay()||7)),a=c.getTime(),c.setMonth(0),c.setDate(1),Math.floor(Math.round((a-c)/86400000)/7)+1},parseDate:function(P,T,ab){if(null==P||null==T){throw"Invalid arguments"}if(T="object"==typeof T?""+T:T+"",""===T){return null}var X,Y,L,aa,S=0,V=(ab?ab.shortYearCutoff:null)||this._defaults.shortYearCutoff,N="string"!=typeof V?V:(new Date).getFullYear()%100+parseInt(V,10),ac=(ab?ab.dayNamesShort:null)||this._defaults.dayNamesShort,O=(ab?ab.dayNames:null)||this._defaults.dayNames,Z=(ab?ab.monthNamesShort:null)||this._defaults.monthNamesShort,Q=(ab?ab.monthNames:null)||this._defaults.monthNames,R=-1,W=-1,t=-1,ad=-1,M=!1,ag=function(c){var a=P.length>X+1&&P.charAt(X+1)===c;return a&&X++,a},ae=function(i){var d=ag(i),h="@"===i?14:"!"===i?20:"y"===i&&d?4:"o"===i?3:2,f="y"===i?h:1,g=RegExp("^\\d{"+f+","+h+"}"),c=T.substring(S).match(g);if(!c){throw"Missing number at position "+S}return S+=c[0].length,parseInt(c[0],10)},U=function(d,h,f){var g=-1,c=I.map(ag(d)?f:h,function(i,a){return[[a,i]]}).sort(function(i,a){return -(i[1].length-a[1].length)});if(I.each(c,function(l,a){var i=a[1];return T.substr(S,i.length).toLowerCase()===i.toLowerCase()?(g=a[0],S+=i.length,!1):void 0}),-1!==g){return g+1}throw"Unknown name at position "+S},af=function(){if(T.charAt(S)!==P.charAt(X)){throw"Unexpected literal at position "+S}S++};for(X=0;P.length>X;X++){if(M){"'"!==P.charAt(X)||ag("'")?af():M=!1}else{switch(P.charAt(X)){case"d":t=ae("d");break;case"D":U("D",ac,O);break;case"o":ad=ae("o");break;case"m":W=ae("m");break;case"M":W=U("M",Z,Q);break;case"y":R=ae("y");break;case"@":aa=new Date(ae("@")),R=aa.getFullYear(),W=aa.getMonth()+1,t=aa.getDate();break;case"!":aa=new Date((ae("!")-this._ticksTo1970)/10000),R=aa.getFullYear(),W=aa.getMonth()+1,t=aa.getDate();break;case"'":ag("'")?af():M=!0;break;default:af()}}}if(T.length>S&&(L=T.substr(S),!/^\s+/.test(L))){throw"Extra/unparsed characters found in date: "+L}if(-1===R?R=(new Date).getFullYear():100>R&&(R+=(new Date).getFullYear()-(new Date).getFullYear()%100+(N>=R?0:-100)),ad>-1){for(W=1,t=ad;;){if(Y=this._getDaysInMonth(R,W-1),Y>=t){break}W++,t-=Y}}if(aa=this._daylightSavingAdjust(new Date(R,W-1,t)),aa.getFullYear()!==R||aa.getMonth()+1!==W||aa.getDate()!==t){throw"Invalid date"}return aa},ATOM:"yy-mm-dd",COOKIE:"D, dd M yy",ISO_8601:"yy-mm-dd",RFC_822:"D, d M y",RFC_850:"DD, dd-M-y",RFC_1036:"D, d M y",RFC_1123:"D, d M yy",RFC_2822:"D, d M yy",RSS:"D, d M y",TICKS:"!",TIMESTAMP:"@",W3C:"yy-mm-dd",_ticksTo1970:10000000*60*60*24*(718685+Math.floor(492.5)-Math.floor(19.7)+Math.floor(4.925)),formatDate:function(R,p,L){if(!p){return""}var Q,N=(L?L.dayNamesShort:null)||this._defaults.dayNamesShort,O=(L?L.dayNames:null)||this._defaults.dayNames,f=(L?L.monthNamesShort:null)||this._defaults.monthNamesShort,P=(L?L.monthNames:null)||this._defaults.monthNames,v=function(a){var c=R.length>Q+1&&R.charAt(Q+1)===a;return c&&Q++,c},M=function(h,a,c){var d=""+a;if(v(h)){for(;c>d.length;){d="0"+d}}return d},g=function(h,a,c,d){return v(h)?d[a]:c[a]},S="",m=!1;if(p){for(Q=0;R.length>Q;Q++){if(m){"'"!==R.charAt(Q)||v("'")?S+=R.charAt(Q):m=!1}else{switch(R.charAt(Q)){case"d":S+=M("d",p.getDate(),2);break;case"D":S+=g("D",p.getDay(),N,O);break;case"o":S+=M("o",Math.round((new Date(p.getFullYear(),p.getMonth(),p.getDate()).getTime()-new Date(p.getFullYear(),0,0).getTime())/86400000),3);break;case"m":S+=M("m",p.getMonth()+1,2);break;case"M":S+=g("M",p.getMonth(),f,P);break;case"y":S+=v("y")?p.getFullYear():(10>p.getFullYear()%100?"0":"")+p.getFullYear()%100;break;case"@":S+=p.getTime();break;case"!":S+=10000*p.getTime()+this._ticksTo1970;break;case"'":v("'")?S+="'":m=!0;break;default:S+=R.charAt(Q)}}}}return S},_possibleChars:function(g){var a,c="",f=!1,d=function(e){var h=g.length>a+1&&g.charAt(a+1)===e;return h&&a++,h};for(a=0;g.length>a;a++){if(f){"'"!==g.charAt(a)||d("'")?c+=g.charAt(a):f=!1}else{switch(g.charAt(a)){case"d":case"m":case"y":case"@":c+="0123456789";break;case"D":case"M":return null;case"'":d("'")?c+="'":f=!0;break;default:c+=g.charAt(a)}}}return c},_get:function(c,a){return void 0!==c.settings[a]?c.settings[a]:this._defaults[a]},_setDateFromField:function(p,d){if(p.input.val()!==p.lastVal){var f=this._get(p,"dateFormat"),m=p.lastVal=p.input?p.input.val():null,g=this._getDefaultDate(p),h=g,c=this._getFormatConfig(p);try{h=this.parseDate(f,m,c)||g}catch(l){m=d?"":m}p.selectedDay=h.getDate(),p.drawMonth=p.selectedMonth=h.getMonth(),p.drawYear=p.selectedYear=h.getFullYear(),p.currentDay=m?h.getDate():0,p.currentMonth=m?h.getMonth():0,p.currentYear=m?h.getFullYear():0,this._adjustInstDate(p)}},_getDefaultDate:function(a){return this._restrictMinMax(a,this._determineDate(a,this._get(a,"defaultDate"),new Date))},_determineDate:function(d,f,l){var g=function(i){var a=new Date;return a.setDate(a.getDate()+i),a},h=function(p){try{return I.datepicker.parseDate(I.datepicker._get(d,"dateFormat"),p,I.datepicker._getFormatConfig(d))}catch(M){}for(var u=(p.toLowerCase().match(/^c/)?I.datepicker._getDate(d):null)||new Date,v=u.getFullYear(),e=u.getMonth(),L=u.getDate(),m=/([+\-]?[0-9]+)\s*(d|D|w|W|m|M|y|Y)?/g,t=m.exec(p);t;){switch(t[2]||"d"){case"d":case"D":L+=parseInt(t[1],10);break;case"w":case"W":L+=7*parseInt(t[1],10);break;case"m":case"M":e+=parseInt(t[1],10),L=Math.min(L,I.datepicker._getDaysInMonth(v,e));break;case"y":case"Y":v+=parseInt(t[1],10),L=Math.min(L,I.datepicker._getDaysInMonth(v,e))}t=m.exec(p)}return new Date(v,e,L)},c=null==f||""===f?l:"string"==typeof f?h(f):"number"==typeof f?isNaN(f)?l:g(f):new Date(f.getTime());return c=c&&"Invalid Date"==""+c?l:c,c&&(c.setHours(0),c.setMinutes(0),c.setSeconds(0),c.setMilliseconds(0)),this._daylightSavingAdjust(c)},_daylightSavingAdjust:function(a){return a?(a.setHours(a.getHours()>12?a.getHours()+2:0),a):null},_setDate:function(m,d,f){var l=!d,g=m.selectedMonth,h=m.selectedYear,c=this._restrictMinMax(m,this._determineDate(m,d,new Date));m.selectedDay=m.currentDay=c.getDate(),m.drawMonth=m.selectedMonth=m.currentMonth=c.getMonth(),m.drawYear=m.selectedYear=m.currentYear=c.getFullYear(),g===m.selectedMonth&&h===m.selectedYear||f||this._notifyChange(m),this._adjustInstDate(m),m.input&&m.input.val(l?"":this._formatDate(m))},_getDate:function(c){var a=!c.currentYear||c.input&&""===c.input.val()?null:this._daylightSavingAdjust(new Date(c.currentYear,c.currentMonth,c.currentDay));return a},_attachHandlers:function(a){var c=this._get(a,"stepMonths"),d="#"+a.id.replace(/\\\\/g,"\\");a.dpDiv.find("[data-handler]").map(function(){var f={prev:function(){I.datepicker._adjustDate(d,-c,"M")},next:function(){I.datepicker._adjustDate(d,+c,"M")},hide:function(){I.datepicker._hideDatepicker()},today:function(){I.datepicker._gotoToday(d)},selectDay:function(){return I.datepicker._selectDay(d,+this.getAttribute("data-month"),+this.getAttribute("data-year"),this),!1},selectMonth:function(){return I.datepicker._selectMonthYear(d,this,"M"),!1},selectYear:function(){return I.datepicker._selectMonthYear(d,this,"Y"),!1}};I(this).on(this.getAttribute("data-event"),f[this.getAttribute("data-handler")])})},_generateHTML:function(aP){var ak,at,aN,aD,aF,ac,aL,aq,az,ag,aS,ai,aH,am,ao,aB,ab,aU,ae,a0,aW,ax,aY,ah,aj,au,aQ,aI,aC,aO,ar,a2,aG,ad,aE,aX,al,an,aA,aM=new Date,af=this._daylightSavingAdjust(new Date(aM.getFullYear(),aM.getMonth(),aM.getDate())),a1=this._get(aP,"isRTL"),av=this._get(aP,"showButtonPanel"),aJ=this._get(aP,"hideIfNoPrevNext"),ay=this._get(aP,"navigationAsDateFormat"),aT=this._getNumberOfMonths(aP),aV=this._get(aP,"showCurrentAtPos"),aa=this._get(aP,"stepMonths"),aZ=1!==aT[0]||1!==aT[1],ap=this._daylightSavingAdjust(aP.currentDay?new Date(aP.currentYear,aP.currentMonth,aP.currentDay):new Date(9999,9,9)),aK=this._getMinMaxDate(aP,"min"),aw=this._getMinMaxDate(aP,"max"),a3=aP.drawMonth-aV,aR=aP.drawYear;if(0>a3&&(a3+=12,aR--),aw){for(ak=this._daylightSavingAdjust(new Date(aw.getFullYear(),aw.getMonth()-aT[0]*aT[1]+1,aw.getDate())),ak=aK&&aK>ak?aK:ak;this._daylightSavingAdjust(new Date(aR,a3,1))>ak;){a3--,0>a3&&(a3=11,aR--)}}for(aP.drawMonth=a3,aP.drawYear=aR,at=this._get(aP,"prevText"),at=ay?this.formatDate(at,this._daylightSavingAdjust(new Date(aR,a3-aa,1)),this._getFormatConfig(aP)):at,aN=this._canAdjustMonth(aP,-1,aR,a3)?"<a class='ui-datepicker-prev ui-corner-all' data-handler='prev' data-event='click' title='"+at+"'><span class='ui-icon ui-icon-circle-triangle-"+(a1?"e":"w")+"'>"+at+"</span></a>":aJ?"":"<a class='ui-datepicker-prev ui-corner-all ui-state-disabled' title='"+at+"'><span class='ui-icon ui-icon-circle-triangle-"+(a1?"e":"w")+"'>"+at+"</span></a>",aD=this._get(aP,"nextText"),aD=ay?this.formatDate(aD,this._daylightSavingAdjust(new Date(aR,a3+aa,1)),this._getFormatConfig(aP)):aD,aF=this._canAdjustMonth(aP,1,aR,a3)?"<a class='ui-datepicker-next ui-corner-all' data-handler='next' data-event='click' title='"+aD+"'><span class='ui-icon ui-icon-circle-triangle-"+(a1?"w":"e")+"'>"+aD+"</span></a>":aJ?"":"<a class='ui-datepicker-next ui-corner-all ui-state-disabled' title='"+aD+"'><span class='ui-icon ui-icon-circle-triangle-"+(a1?"w":"e")+"'>"+aD+"</span></a>",ac=this._get(aP,"currentText"),aL=this._get(aP,"gotoCurrent")&&aP.currentDay?ap:af,ac=ay?this.formatDate(ac,aL,this._getFormatConfig(aP)):ac,aq=aP.inline?"":"<button type='button' class='ui-datepicker-close ui-state-default ui-priority-primary ui-corner-all' data-handler='hide' data-event='click'>"+this._get(aP,"closeText")+"</button>",az=av?"<div class='ui-datepicker-buttonpane ui-widget-content'>"+(a1?aq:"")+(this._isInRange(aP,aL)?"<button type='button' class='ui-datepicker-current ui-state-default ui-priority-secondary ui-corner-all' data-handler='today' data-event='click'>"+ac+"</button>":"")+(a1?"":aq)+"</div>":"",ag=parseInt(this._get(aP,"firstDay"),10),ag=isNaN(ag)?0:ag,aS=this._get(aP,"showWeek"),ai=this._get(aP,"dayNames"),aH=this._get(aP,"dayNamesMin"),am=this._get(aP,"monthNames"),ao=this._get(aP,"monthNamesShort"),aB=this._get(aP,"beforeShowDay"),ab=this._get(aP,"showOtherMonths"),aU=this._get(aP,"selectOtherMonths"),ae=this._getDefaultDate(aP),a0="",ax=0;aT[0]>ax;ax++){for(aY="",this.maxRows=4,ah=0;aT[1]>ah;ah++){if(aj=this._daylightSavingAdjust(new Date(aR,a3,aP.selectedDay)),au=" ui-corner-all",aQ="",aZ){if(aQ+="<div class='ui-datepicker-group",aT[1]>1){switch(ah){case 0:aQ+=" ui-datepicker-group-first",au=" ui-corner-"+(a1?"right":"left");break;case aT[1]-1:aQ+=" ui-datepicker-group-last",au=" ui-corner-"+(a1?"left":"right");break;default:aQ+=" ui-datepicker-group-middle",au=""}}aQ+="'>"}for(aQ+="<div class='ui-datepicker-header ui-widget-header ui-helper-clearfix"+au+"'>"+(/all|left/.test(au)&&0===ax?a1?aF:aN:"")+(/all|right/.test(au)&&0===ax?a1?aN:aF:"")+this._generateMonthYearHeader(aP,a3,aR,aK,aw,ax>0||ah>0,am,ao)+"</div><table class='ui-datepicker-calendar'><thead><tr>",aI=aS?"<th class='ui-datepicker-week-col'>"+this._get(aP,"weekHeader")+"</th>":"",aW=0;7>aW;aW++){aC=(aW+ag)%7,aI+="<th scope='col'"+((aW+ag+6)%7>=5?" class='ui-datepicker-week-end'":"")+"><span title='"+ai[aC]+"'>"+aH[aC]+"</span></th>"}for(aQ+=aI+"</tr></thead><tbody>",aO=this._getDaysInMonth(aR,a3),aR===aP.selectedYear&&a3===aP.selectedMonth&&(aP.selectedDay=Math.min(aP.selectedDay,aO)),ar=(this._getFirstDayOfMonth(aR,a3)-ag+7)%7,a2=Math.ceil((ar+aO)/7),aG=aZ?this.maxRows>a2?this.maxRows:a2:a2,this.maxRows=aG,ad=this._daylightSavingAdjust(new Date(aR,a3,1-ar)),aE=0;aG>aE;aE++){for(aQ+="<tr>",aX=aS?"<td class='ui-datepicker-week-col'>"+this._get(aP,"calculateWeek")(ad)+"</td>":"",aW=0;7>aW;aW++){al=aB?aB.apply(aP.input?aP.input[0]:null,[ad]):[!0,""],an=ad.getMonth()!==a3,aA=an&&!aU||!al[0]||aK&&aK>ad||aw&&ad>aw,aX+="<td class='"+((aW+ag+6)%7>=5?" ui-datepicker-week-end":"")+(an?" ui-datepicker-other-month":"")+(ad.getTime()===aj.getTime()&&a3===aP.selectedMonth&&aP._keyEvent||ae.getTime()===ad.getTime()&&ae.getTime()===aj.getTime()?" "+this._dayOverClass:"")+(aA?" "+this._unselectableClass+" ui-state-disabled":"")+(an&&!ab?"":" "+al[1]+(ad.getTime()===ap.getTime()?" "+this._currentClass:"")+(ad.getTime()===af.getTime()?" ui-datepicker-today":""))+"'"+(an&&!ab||!al[2]?"":" title='"+al[2].replace(/'/g,"&#39;")+"'")+(aA?"":" data-handler='selectDay' data-event='click' data-month='"+ad.getMonth()+"' data-year='"+ad.getFullYear()+"'")+">"+(an&&!ab?"&#xa0;":aA?"<span class='ui-state-default'>"+ad.getDate()+"</span>":"<a class='ui-state-default"+(ad.getTime()===af.getTime()?" ui-state-highlight":"")+(ad.getTime()===ap.getTime()?" ui-state-active":"")+(an?" ui-priority-secondary":"")+"' href='#'>"+ad.getDate()+"</a>")+"</td>",ad.setDate(ad.getDate()+1),ad=this._daylightSavingAdjust(ad)}aQ+=aX+"</tr>"}a3++,a3>11&&(a3=0,aR++),aQ+="</tbody></table>"+(aZ?"</div>"+(aT[0]>0&&ah===aT[1]-1?"<div class='ui-datepicker-row-break'></div>":""):""),aY+=aQ}a0+=aY}return a0+=az,aP._keyEvent=!1,a0},_generateMonthYearHeader:function(ac,Q,U,ab,X,Y,M,aa){var T,V,O,ad,P,Z,R,S,W=this._get(ac,"changeMonth"),L=this._get(ac,"changeYear"),ae=this._get(ac,"showMonthAfterYear"),N="<div class='ui-datepicker-title'>",af="";if(Y||!W){af+="<span class='ui-datepicker-month'>"+M[Q]+"</span>"}else{for(T=ab&&ab.getFullYear()===U,V=X&&X.getFullYear()===U,af+="<select class='ui-datepicker-month' data-handler='selectMonth' data-event='change'>",O=0;12>O;O++){(!T||O>=ab.getMonth())&&(!V||X.getMonth()>=O)&&(af+="<option value='"+O+"'"+(O===Q?" selected='selected'":"")+">"+aa[O]+"</option>")}af+="</select>"}if(ae||(N+=af+(!Y&&W&&L?"":"&#xa0;")),!ac.yearshtml){if(ac.yearshtml="",Y||!L){N+="<span class='ui-datepicker-year'>"+U+"</span>"}else{for(ad=this._get(ac,"yearRange").split(":"),P=(new Date).getFullYear(),Z=function(c){var a=c.match(/c[+\-].*/)?U+parseInt(c.substring(1),10):c.match(/[+\-].*/)?P+parseInt(c,10):parseInt(c,10);return isNaN(a)?P:a},R=Z(ad[0]),S=Math.max(R,Z(ad[1]||"")),R=ab?Math.max(R,ab.getFullYear()):R,S=X?Math.min(S,X.getFullYear()):S,ac.yearshtml+="<select class='ui-datepicker-year' data-handler='selectYear' data-event='change'>";S>=R;R++){ac.yearshtml+="<option value='"+R+"'"+(R===U?" selected='selected'":"")+">"+R+"</option>"}ac.yearshtml+="</select>",N+=ac.yearshtml,ac.yearshtml=null}}return N+=this._get(ac,"yearSuffix"),ae&&(N+=(!Y&&W&&L?"":"&#xa0;")+af),N+="</div>"},_adjustInstDate:function(m,d,f){var l=m.selectedYear+("Y"===f?d:0),g=m.selectedMonth+("M"===f?d:0),h=Math.min(m.selectedDay,this._getDaysInMonth(l,g))+("D"===f?d:0),c=this._restrictMinMax(m,this._daylightSavingAdjust(new Date(l,g,h)));m.selectedDay=c.getDate(),m.drawMonth=m.selectedMonth=c.getMonth(),m.drawYear=m.selectedYear=c.getFullYear(),("M"===f||"Y"===f)&&this._notifyChange(m)},_restrictMinMax:function(g,a){var c=this._getMinMaxDate(g,"min"),f=this._getMinMaxDate(g,"max"),d=c&&c>a?c:a;return f&&d>f?f:d},_notifyChange:function(c){var a=this._get(c,"onChangeMonthYear");a&&a.apply(c.input?c.input[0]:null,[c.selectedYear,c.selectedMonth+1,c])},_getNumberOfMonths:function(c){var a=this._get(c,"numberOfMonths");return null==a?[1,1]:"number"==typeof a?[1,a]:a},_getMinMaxDate:function(c,a){return this._determineDate(c,this._get(c,a+"Date"),null)},_getDaysInMonth:function(c,a){return 32-this._daylightSavingAdjust(new Date(c,a,32)).getDate()},_getFirstDayOfMonth:function(c,a){return new Date(c,a,1).getDay()},_canAdjustMonth:function(h,a,c,g){var d=this._getNumberOfMonths(h),f=this._daylightSavingAdjust(new Date(c,g+(0>a?a:d[0]*d[1]),1));return 0>a&&f.setDate(this._getDaysInMonth(f.getFullYear(),f.getMonth())),this._isInRange(h,f)},_isInRange:function(v,d){var g,u,l=this._getMinMaxDate(v,"min"),m=this._getMinMaxDate(v,"max"),c=null,p=null,f=this._get(v,"yearRange");return f&&(g=f.split(":"),u=(new Date).getFullYear(),c=parseInt(g[0],10),p=parseInt(g[1],10),g[0].match(/[+\-].*/)&&(c+=u),g[1].match(/[+\-].*/)&&(p+=u)),(!l||d.getTime()>=l.getTime())&&(!m||d.getTime()<=m.getTime())&&(!c||d.getFullYear()>=c)&&(!p||p>=d.getFullYear())},_getFormatConfig:function(c){var a=this._get(c,"shortYearCutoff");return a="string"!=typeof a?a:(new Date).getFullYear()%100+parseInt(a,10),{shortYearCutoff:a,dayNamesShort:this._get(c,"dayNamesShort"),dayNames:this._get(c,"dayNames"),monthNamesShort:this._get(c,"monthNamesShort"),monthNames:this._get(c,"monthNames")}},_formatDate:function(g,a,c,f){a||(g.currentDay=g.selectedDay,g.currentMonth=g.selectedMonth,g.currentYear=g.selectedYear);var d=a?"object"==typeof a?a:this._daylightSavingAdjust(new Date(f,c,a)):this._daylightSavingAdjust(new Date(g.currentYear,g.currentMonth,g.currentDay));return this.formatDate(this._get(g,"dateFormat"),d,this._getFormatConfig(g))}}),I.fn.datepicker=function(a){if(!this.length){return this}I.datepicker.initialized||(I(document).on("mousedown",I.datepicker._checkExternalClick),I.datepicker.initialized=!0),0===I("#"+I.datepicker._mainDivId).length&&I("body").append(I.datepicker.dpDiv);var c=Array.prototype.slice.call(arguments,1);return"string"!=typeof a||"isDisabled"!==a&&"getDate"!==a&&"widget"!==a?"option"===a&&2===arguments.length&&"string"==typeof arguments[1]?I.datepicker["_"+a+"Datepicker"].apply(I.datepicker,[this[0]].concat(c)):this.each(function(){"string"==typeof a?I.datepicker["_"+a+"Datepicker"].apply(I.datepicker,[this].concat(c)):I.datepicker._attachDatepicker(this,a)}):I.datepicker["_"+a+"Datepicker"].apply(I.datepicker,[this[0]].concat(c))},I.datepicker=new H,I.datepicker.initialized=!1,I.datepicker.uuid=(new Date).getTime(),I.datepicker.version="1.12.1",I.datepicker,I.widget("ui.dialog",{version:"1.12.1",options:{appendTo:"body",autoOpen:!0,buttons:[],classes:{"ui-dialog":"ui-corner-all","ui-dialog-titlebar":"ui-corner-all"},closeOnEscape:!0,closeText:"Close",draggable:!0,hide:null,height:"auto",maxHeight:null,maxWidth:null,minHeight:150,minWidth:150,modal:!1,position:{my:"center",at:"center",of:window,collision:"fit",using:function(a){var c=I(this).css(a).offset().top;0>c&&I(this).css("top",a.top-c)}},resizable:!0,show:null,title:null,width:300,beforeClose:null,close:null,drag:null,dragStart:null,dragStop:null,focus:null,open:null,resize:null,resizeStart:null,resizeStop:null},sizeRelatedOptions:{buttons:!0,height:!0,maxHeight:!0,maxWidth:!0,minHeight:!0,minWidth:!0,width:!0},resizableRelatedOptions:{maxHeight:!0,maxWidth:!0,minHeight:!0,minWidth:!0},_create:function(){this.originalCss={display:this.element[0].style.display,width:this.element[0].style.width,minHeight:this.element[0].style.minHeight,maxHeight:this.element[0].style.maxHeight,height:this.element[0].style.height},this.originalPosition={parent:this.element.parent(),index:this.element.parent().children().index(this.element)},this.originalTitle=this.element.attr("title"),null==this.options.title&&null!=this.originalTitle&&(this.options.title=this.originalTitle),this.options.disabled&&(this.options.disabled=!1),this._createWrapper(),this.element.show().removeAttr("title").appendTo(this.uiDialog),this._addClass("ui-dialog-content","ui-widget-content"),this._createTitlebar(),this._createButtonPane(),this.options.draggable&&I.fn.draggable&&this._makeDraggable(),this.options.resizable&&I.fn.resizable&&this._makeResizable(),this._isOpen=!1,this._trackFocus()},_init:function(){this.options.autoOpen&&this.open()},_appendTo:function(){var a=this.options.appendTo;return a&&(a.jquery||a.nodeType)?I(a):this.document.find(a||"body").eq(0)},_destroy:function(){var c,a=this.originalPosition;this._untrackInstance(),this._destroyOverlay(),this.element.removeUniqueId().css(this.originalCss).detach(),this.uiDialog.remove(),this.originalTitle&&this.element.attr("title",this.originalTitle),c=a.parent.children().eq(a.index),c.length&&c[0]!==this.element[0]?c.before(this.element):a.parent.append(this.element)},widget:function(){return this.uiDialog},disable:I.noop,enable:I.noop,close:function(a){var c=this;this._isOpen&&this._trigger("beforeClose",a)!==!1&&(this._isOpen=!1,this._focusedElement=null,this._destroyOverlay(),this._untrackInstance(),this.opener.filter(":focusable").trigger("focus").length||I.ui.safeBlur(I.ui.safeActiveElement(this.document[0])),this._hide(this.uiDialog,this.options.hide,function(){c._trigger("close",a)}))},isOpen:function(){return this._isOpen},moveToTop:function(){this._moveToTop()},_moveToTop:function(a,c){var g=!1,d=this.uiDialog.siblings(".ui-front:visible").map(function(){return +I(this).css("z-index")}).get(),f=Math.max.apply(null,d);return f>=+this.uiDialog.css("z-index")&&(this.uiDialog.css("z-index",f+1),g=!0),g&&!c&&this._trigger("focus",a),g},open:function(){var a=this;return this._isOpen?(this._moveToTop()&&this._focusTabbable(),void 0):(this._isOpen=!0,this.opener=I(I.ui.safeActiveElement(this.document[0])),this._size(),this._position(),this._createOverlay(),this._moveToTop(null,!0),this.overlay&&this.overlay.css("z-index",this.uiDialog.css("z-index")-1),this._show(this.uiDialog,this.options.show,function(){a._focusTabbable(),a._trigger("focus")}),this._makeFocusTarget(),this._trigger("open"),void 0)},_focusTabbable:function(){var a=this._focusedElement;a||(a=this.element.find("[autofocus]")),a.length||(a=this.element.find(":tabbable")),a.length||(a=this.uiDialogButtonPane.find(":tabbable")),a.length||(a=this.uiDialogTitlebarClose.filter(":tabbable")),a.length||(a=this.uiDialog),a.eq(0).trigger("focus")},_keepFocus:function(a){function c(){var d=I.ui.safeActiveElement(this.document[0]),f=this.uiDialog[0]===d||I.contains(this.uiDialog[0],d);f||this._focusTabbable()}a.preventDefault(),c.call(this),this._delay(c)},_createWrapper:function(){this.uiDialog=I("<div>").hide().attr({tabIndex:-1,role:"dialog"}).appendTo(this._appendTo()),this._addClass(this.uiDialog,"ui-dialog","ui-widget ui-widget-content ui-front"),this._on(this.uiDialog,{keydown:function(a){if(this.options.closeOnEscape&&!a.isDefaultPrevented()&&a.keyCode&&a.keyCode===I.ui.keyCode.ESCAPE){return a.preventDefault(),this.close(a),void 0}if(a.keyCode===I.ui.keyCode.TAB&&!a.isDefaultPrevented()){var c=this.uiDialog.find(":tabbable"),f=c.filter(":first"),d=c.filter(":last");a.target!==d[0]&&a.target!==this.uiDialog[0]||a.shiftKey?a.target!==f[0]&&a.target!==this.uiDialog[0]||!a.shiftKey||(this._delay(function(){d.trigger("focus")}),a.preventDefault()):(this._delay(function(){f.trigger("focus")}),a.preventDefault())}},mousedown:function(a){this._moveToTop(a)&&this._focusTabbable()}}),this.element.find("[aria-describedby]").length||this.uiDialog.attr({"aria-describedby":this.element.uniqueId().attr("id")})},_createTitlebar:function(){var a;this.uiDialogTitlebar=I("<div>"),this._addClass(this.uiDialogTitlebar,"ui-dialog-titlebar","ui-widget-header ui-helper-clearfix"),this._on(this.uiDialogTitlebar,{mousedown:function(c){I(c.target).closest(".ui-dialog-titlebar-close")||this.uiDialog.trigger("focus")}}),this.uiDialogTitlebarClose=I("<button type='button'></button>").button({label:I("<a>").text(this.options.closeText).html(),icon:"ui-icon-closethick",showLabel:!1}).appendTo(this.uiDialogTitlebar),this._addClass(this.uiDialogTitlebarClose,"ui-dialog-titlebar-close"),this._on(this.uiDialogTitlebarClose,{click:function(c){c.preventDefault(),this.close(c)}}),a=I("<span>").uniqueId().prependTo(this.uiDialogTitlebar),this._addClass(a,"ui-dialog-title"),this._title(a),this.uiDialogTitlebar.prependTo(this.uiDialog),this.uiDialog.attr({"aria-labelledby":a.attr("id")})},_title:function(a){this.options.title?a.text(this.options.title):a.html("&#160;")},_createButtonPane:function(){this.uiDialogButtonPane=I("<div>"),this._addClass(this.uiDialogButtonPane,"ui-dialog-buttonpane","ui-widget-content ui-helper-clearfix"),this.uiButtonSet=I("<div>").appendTo(this.uiDialogButtonPane),this._addClass(this.uiButtonSet,"ui-dialog-buttonset"),this._createButtons()},_createButtons:function(){var a=this,c=this.options.buttons;return this.uiDialogButtonPane.remove(),this.uiButtonSet.empty(),I.isEmptyObject(c)||I.isArray(c)&&!c.length?(this._removeClass(this.uiDialog,"ui-dialog-buttons"),void 0):(I.each(c,function(d,g){var e,f;g=I.isFunction(g)?{click:g,text:d}:g,g=I.extend({type:"button"},g),e=g.click,f={icon:g.icon,iconPosition:g.iconPosition,showLabel:g.showLabel,icons:g.icons,text:g.text},delete g.click,delete g.icon,delete g.iconPosition,delete g.showLabel,delete g.icons,"boolean"==typeof g.text&&delete g.text,I("<button></button>",g).button(f).appendTo(a.uiButtonSet).on("click",function(){e.apply(a.element[0],arguments)})}),this._addClass(this.uiDialog,"ui-dialog-buttons"),this.uiDialogButtonPane.appendTo(this.uiDialog),void 0)},_makeDraggable:function(){function a(e){return{position:e.position,offset:e.offset}}var c=this,d=this.options;this.uiDialog.draggable({cancel:".ui-dialog-content, .ui-dialog-titlebar-close",handle:".ui-dialog-titlebar",containment:"document",start:function(f,e){c._addClass(I(this),"ui-dialog-dragging"),c._blockFrames(),c._trigger("dragStart",f,a(e))},drag:function(f,e){c._trigger("drag",f,a(e))},stop:function(f,g){var e=g.offset.left-c.document.scrollLeft(),h=g.offset.top-c.document.scrollTop();d.position={my:"left top",at:"left"+(e>=0?"+":"")+e+" top"+(h>=0?"+":"")+h,of:c.window},c._removeClass(I(this),"ui-dialog-dragging"),c._unblockFrames(),c._trigger("dragStop",f,a(g))}})},_makeResizable:function(){function d(a){return{originalPosition:a.originalPosition,originalSize:a.originalSize,position:a.position,size:a.size}}var f=this,l=this.options,g=l.resizable,h=this.uiDialog.css("position"),c="string"==typeof g?g:"n,e,s,w,se,sw,ne,nw";this.uiDialog.resizable({cancel:".ui-dialog-content",containment:"document",alsoResize:this.element,maxWidth:l.maxWidth,maxHeight:l.maxHeight,minWidth:l.minWidth,minHeight:this._minHeight(),handles:c,start:function(e,a){f._addClass(I(this),"ui-dialog-resizing"),f._blockFrames(),f._trigger("resizeStart",e,d(a))},resize:function(e,a){f._trigger("resize",e,d(a))},stop:function(m,p){var e=f.uiDialog.offset(),s=e.left-f.document.scrollLeft(),i=e.top-f.document.scrollTop();l.height=f.uiDialog.height(),l.width=f.uiDialog.width(),l.position={my:"left top",at:"left"+(s>=0?"+":"")+s+" top"+(i>=0?"+":"")+i,of:f.window},f._removeClass(I(this),"ui-dialog-resizing"),f._unblockFrames(),f._trigger("resizeStop",m,d(p))}}).css("position",h)},_trackFocus:function(){this._on(this.widget(),{focusin:function(a){this._makeFocusTarget(),this._focusedElement=I(a.target)}})},_makeFocusTarget:function(){this._untrackInstance(),this._trackingInstances().unshift(this)},_untrackInstance:function(){var a=this._trackingInstances(),c=I.inArray(this,a);-1!==c&&a.splice(c,1)},_trackingInstances:function(){var a=this.document.data("ui-dialog-instances");return a||(a=[],this.document.data("ui-dialog-instances",a)),a},_minHeight:function(){var a=this.options;return"auto"===a.height?a.minHeight:Math.min(a.minHeight,a.height)},_position:function(){var a=this.uiDialog.is(":visible");a||this.uiDialog.show(),this.uiDialog.position(this.options.position),a||this.uiDialog.hide()},_setOptions:function(a){var c=this,f=!1,d={};I.each(a,function(h,g){c._setOption(h,g),h in c.sizeRelatedOptions&&(f=!0),h in c.resizableRelatedOptions&&(d[h]=g)}),f&&(this._size(),this._position()),this.uiDialog.is(":data(ui-resizable)")&&this.uiDialog.resizable("option",d)},_setOption:function(a,c){var g,d,f=this.uiDialog;"disabled"!==a&&(this._super(a,c),"appendTo"===a&&this.uiDialog.appendTo(this._appendTo()),"buttons"===a&&this._createButtons(),"closeText"===a&&this.uiDialogTitlebarClose.button({label:I("<a>").text(""+this.options.closeText).html()}),"draggable"===a&&(g=f.is(":data(ui-draggable)"),g&&!c&&f.draggable("destroy"),!g&&c&&this._makeDraggable()),"position"===a&&this._position(),"resizable"===a&&(d=f.is(":data(ui-resizable)"),d&&!c&&f.resizable("destroy"),d&&"string"==typeof c&&f.resizable("option","handles",c),d||c===!1||this._makeResizable()),"title"===a&&this._title(this.uiDialogTitlebar.find(".ui-dialog-title")))},_size:function(){var f,a,c,d=this.options;this.element.show().css({width:"auto",minHeight:0,maxHeight:"none",height:0}),d.minWidth>d.width&&(d.width=d.minWidth),f=this.uiDialog.css({height:"auto",width:d.width}).outerHeight(),a=Math.max(0,d.minHeight-f),c="number"==typeof d.maxHeight?Math.max(0,d.maxHeight-f):"none","auto"===d.height?this.element.css({minHeight:a,maxHeight:c,height:"auto"}):this.element.height(Math.max(0,d.height-f)),this.uiDialog.is(":data(ui-resizable)")&&this.uiDialog.resizable("option","minHeight",this._minHeight())},_blockFrames:function(){this.iframeBlocks=this.document.find("iframe").map(function(){var a=I(this);return I("<div>").css({position:"absolute",width:a.outerWidth(),height:a.outerHeight()}).appendTo(a.parent()).offset(a.offset())[0]})},_unblockFrames:function(){this.iframeBlocks&&(this.iframeBlocks.remove(),delete this.iframeBlocks)},_allowInteraction:function(a){return I(a.target).closest(".ui-dialog").length?!0:!!I(a.target).closest(".ui-datepicker").length},_createOverlay:function(){if(this.options.modal){var a=!0;this._delay(function(){a=!1}),this.document.data("ui-dialog-overlays")||this._on(this.document,{focusin:function(c){a||this._allowInteraction(c)||(c.preventDefault(),this._trackingInstances()[0]._focusTabbable())}}),this.overlay=I("<div>").appendTo(this._appendTo()),this._addClass(this.overlay,null,"ui-widget-overlay ui-front"),this._on(this.overlay,{mousedown:"_keepFocus"}),this.document.data("ui-dialog-overlays",(this.document.data("ui-dialog-overlays")||0)+1)}},_destroyOverlay:function(){if(this.options.modal&&this.overlay){var a=this.document.data("ui-dialog-overlays")-1;a?this.document.data("ui-dialog-overlays",a):(this._off(this.document,"focusin"),this.document.removeData("ui-dialog-overlays")),this.overlay.remove(),this.overlay=null}}}),I.uiBackCompat!==!1&&I.widget("ui.dialog",I.ui.dialog,{options:{dialogClass:""},_createWrapper:function(){this._super(),this.uiDialog.addClass(this.options.dialogClass)},_setOption:function(c,a){"dialogClass"===c&&this.uiDialog.removeClass(this.options.dialogClass).addClass(a),this._superApply(arguments)}}),I.ui.dialog,I.widget("ui.progressbar",{version:"1.12.1",options:{classes:{"ui-progressbar":"ui-corner-all","ui-progressbar-value":"ui-corner-left","ui-progressbar-complete":"ui-corner-right"},max:100,value:0,change:null,complete:null},min:0,_create:function(){this.oldValue=this.options.value=this._constrainedValue(),this.element.attr({role:"progressbar","aria-valuemin":this.min}),this._addClass("ui-progressbar","ui-widget ui-widget-content"),this.valueDiv=I("<div>").appendTo(this.element),this._addClass(this.valueDiv,"ui-progressbar-value","ui-widget-header"),this._refreshValue()},_destroy:function(){this.element.removeAttr("role aria-valuemin aria-valuemax aria-valuenow"),this.valueDiv.remove()},value:function(a){return void 0===a?this.options.value:(this.options.value=this._constrainedValue(a),this._refreshValue(),void 0)},_constrainedValue:function(a){return void 0===a&&(a=this.options.value),this.indeterminate=a===!1,"number"!=typeof a&&(a=0),this.indeterminate?!1:Math.min(this.options.max,Math.max(this.min,a))},_setOptions:function(c){var a=c.value;delete c.value,this._super(c),this.options.value=this._constrainedValue(a),this._refreshValue()},_setOption:function(c,a){"max"===c&&(a=Math.max(this.min,a)),this._super(c,a)},_setOptionDisabled:function(a){this._super(a),this.element.attr("aria-disabled",a),this._toggleClass(null,"ui-state-disabled",!!a)},_percentage:function(){return this.indeterminate?100:100*(this.options.value-this.min)/(this.options.max-this.min)},_refreshValue:function(){var a=this.options.value,c=this._percentage();this.valueDiv.toggle(this.indeterminate||a>this.min).width(c.toFixed(0)+"%"),this._toggleClass(this.valueDiv,"ui-progressbar-complete",null,a===this.options.max)._toggleClass("ui-progressbar-indeterminate",null,this.indeterminate),this.indeterminate?(this.element.removeAttr("aria-valuenow"),this.overlayDiv||(this.overlayDiv=I("<div>").appendTo(this.valueDiv),this._addClass(this.overlayDiv,"ui-progressbar-overlay"))):(this.element.attr({"aria-valuemax":this.options.max,"aria-valuenow":a}),this.overlayDiv&&(this.overlayDiv.remove(),this.overlayDiv=null)),this.oldValue!==a&&(this.oldValue=a,this._trigger("change")),a===this.options.max&&this._trigger("complete")}}),I.widget("ui.selectmenu",[I.ui.formResetMixin,{version:"1.12.1",defaultElement:"<select>",options:{appendTo:null,classes:{"ui-selectmenu-button-open":"ui-corner-top","ui-selectmenu-button-closed":"ui-corner-all"},disabled:null,icons:{button:"ui-icon-triangle-1-s"},position:{my:"left top",at:"left bottom",collision:"none"},width:!1,change:null,close:null,focus:null,open:null,select:null},_create:function(){var a=this.element.uniqueId().attr("id");this.ids={element:a,button:a+"-button",menu:a+"-menu"},this._drawButton(),this._drawMenu(),this._bindFormResetHandler(),this._rendered=!1,this.menuItems=I()},_drawButton:function(){var a,c=this,d=this._parseOption(this.element.find("option:selected"),this.element[0].selectedIndex);this.labels=this.element.labels().attr("for",this.ids.button),this._on(this.labels,{click:function(e){this.button.focus(),e.preventDefault()}}),this.element.hide(),this.button=I("<span>",{tabindex:this.options.disabled?-1:0,id:this.ids.button,role:"combobox","aria-expanded":"false","aria-autocomplete":"list","aria-owns":this.ids.menu,"aria-haspopup":"true",title:this.element.attr("title")}).insertAfter(this.element),this._addClass(this.button,"ui-selectmenu-button ui-selectmenu-button-closed","ui-button ui-widget"),a=I("<span>").appendTo(this.button),this._addClass(a,"ui-selectmenu-icon","ui-icon "+this.options.icons.button),this.buttonItem=this._renderButtonItem(d).appendTo(this.button),this.options.width!==!1&&this._resizeButton(),this._on(this.button,this._buttonEvents),this.button.one("focusin",function(){c._rendered||c._refreshMenu()})},_drawMenu:function(){var a=this;this.menu=I("<ul>",{"aria-hidden":"true","aria-labelledby":this.ids.button,id:this.ids.menu}),this.menuWrap=I("<div>").append(this.menu),this._addClass(this.menuWrap,"ui-selectmenu-menu","ui-front"),this.menuWrap.appendTo(this._appendTo()),this.menuInstance=this.menu.menu({classes:{"ui-menu":"ui-corner-bottom"},role:"listbox",select:function(d,c){d.preventDefault(),a._setSelection(),a._select(c.item.data("ui-selectmenu-item"),d)},focus:function(e,c){var d=c.item.data("ui-selectmenu-item");null!=a.focusIndex&&d.index!==a.focusIndex&&(a._trigger("focus",e,{item:d}),a.isOpen||a._select(d,e)),a.focusIndex=d.index,a.button.attr("aria-activedescendant",a.menuItems.eq(d.index).attr("id"))}}).menu("instance"),this.menuInstance._off(this.menu,"mouseleave"),this.menuInstance._closeOnDocumentClick=function(){return !1},this.menuInstance._isDivider=function(){return !1}},refresh:function(){this._refreshMenu(),this.buttonItem.replaceWith(this.buttonItem=this._renderButtonItem(this._getSelectedItem().data("ui-selectmenu-item")||{})),null===this.options.width&&this._resizeButton()},_refreshMenu:function(){var c,a=this.element.find("option");this.menu.empty(),this._parseOptions(a),this._renderMenu(this.menu,this.items),this.menuInstance.refresh(),this.menuItems=this.menu.find("li").not(".ui-selectmenu-optgroup").find(".ui-menu-item-wrapper"),this._rendered=!0,a.length&&(c=this._getSelectedItem(),this.menuInstance.focus(null,c),this._setAria(c.data("ui-selectmenu-item")),this._setOption("disabled",this.element.prop("disabled")))},open:function(a){this.options.disabled||(this._rendered?(this._removeClass(this.menu.find(".ui-state-active"),null,"ui-state-active"),this.menuInstance.focus(null,this._getSelectedItem())):this._refreshMenu(),this.menuItems.length&&(this.isOpen=!0,this._toggleAttr(),this._resizeMenu(),this._position(),this._on(this.document,this._documentClick),this._trigger("open",a)))},_position:function(){this.menuWrap.position(I.extend({of:this.button},this.options.position))},close:function(a){this.isOpen&&(this.isOpen=!1,this._toggleAttr(),this.range=null,this._off(this.document),this._trigger("close",a))},widget:function(){return this.button},menuWidget:function(){return this.menu},_renderButtonItem:function(a){var c=I("<span>");return this._setText(c,a.label),this._addClass(c,"ui-selectmenu-text"),c},_renderMenu:function(a,c){var f=this,d="";I.each(c,function(g,h){var e;h.optgroup!==d&&(e=I("<li>",{text:h.optgroup}),f._addClass(e,"ui-selectmenu-optgroup","ui-menu-divider"+(h.element.parent("optgroup").prop("disabled")?" ui-state-disabled":"")),e.appendTo(a),d=h.optgroup),f._renderItemData(a,h)})},_renderItemData:function(c,a){return this._renderItem(c,a).data("ui-selectmenu-item",a)},_renderItem:function(a,c){var f=I("<li>"),d=I("<div>",{title:c.element.attr("title")});return c.disabled&&this._addClass(f,null,"ui-state-disabled"),this._setText(d,c.label),f.append(d).appendTo(a)},_setText:function(c,a){a?c.text(a):c.html("&#160;")},_move:function(g,a){var c,f,d=".ui-menu-item";this.isOpen?c=this.menuItems.eq(this.focusIndex).parent("li"):(c=this.menuItems.eq(this.element[0].selectedIndex).parent("li"),d+=":not(.ui-state-disabled)"),f="first"===g||"last"===g?c["first"===g?"prevAll":"nextAll"](d).eq(-1):c[g+"All"](d).eq(0),f.length&&this.menuInstance.focus(a,f)},_getSelectedItem:function(){return this.menuItems.eq(this.element[0].selectedIndex).parent("li")},_toggle:function(a){this[this.isOpen?"close":"open"](a)},_setSelection:function(){var a;this.range&&(window.getSelection?(a=window.getSelection(),a.removeAllRanges(),a.addRange(this.range)):this.range.select(),this.button.focus())},_documentClick:{mousedown:function(a){this.isOpen&&(I(a.target).closest(".ui-selectmenu-menu, #"+I.ui.escapeSelector(this.ids.button)).length||this.close(a))}},_buttonEvents:{mousedown:function(){var a;window.getSelection?(a=window.getSelection(),a.rangeCount&&(this.range=a.getRangeAt(0))):this.range=document.selection.createRange()},click:function(a){this._setSelection(),this._toggle(a)},keydown:function(a){var c=!0;switch(a.keyCode){case I.ui.keyCode.TAB:case I.ui.keyCode.ESCAPE:this.close(a),c=!1;break;case I.ui.keyCode.ENTER:this.isOpen&&this._selectFocusedItem(a);break;case I.ui.keyCode.UP:a.altKey?this._toggle(a):this._move("prev",a);break;case I.ui.keyCode.DOWN:a.altKey?this._toggle(a):this._move("next",a);break;case I.ui.keyCode.SPACE:this.isOpen?this._selectFocusedItem(a):this._toggle(a);break;case I.ui.keyCode.LEFT:this._move("prev",a);break;case I.ui.keyCode.RIGHT:this._move("next",a);break;case I.ui.keyCode.HOME:case I.ui.keyCode.PAGE_UP:this._move("first",a);break;case I.ui.keyCode.END:case I.ui.keyCode.PAGE_DOWN:this._move("last",a);break;default:this.menu.trigger(a),c=!1}c&&a.preventDefault()}},_selectFocusedItem:function(c){var a=this.menuItems.eq(this.focusIndex).parent("li");a.hasClass("ui-state-disabled")||this._select(a.data("ui-selectmenu-item"),c)},_select:function(d,a){var c=this.element[0].selectedIndex;this.element[0].selectedIndex=d.index,this.buttonItem.replaceWith(this.buttonItem=this._renderButtonItem(d)),this._setAria(d),this._trigger("select",a,{item:d}),d.index!==c&&this._trigger("change",a,{item:d}),this.close(a)},_setAria:function(c){var a=this.menuItems.eq(c.index).attr("id");this.button.attr({"aria-labelledby":a,"aria-activedescendant":a}),this.menu.attr("aria-activedescendant",a)},_setOption:function(d,a){if("icons"===d){var c=this.button.find("span.ui-icon");this._removeClass(c,null,this.options.icons.button)._addClass(c,null,a.button)}this._super(d,a),"appendTo"===d&&this.menuWrap.appendTo(this._appendTo()),"width"===d&&this._resizeButton()},_setOptionDisabled:function(a){this._super(a),this.menuInstance.option("disabled",a),this.button.attr("aria-disabled",a),this._toggleClass(this.button,null,"ui-state-disabled",a),this.element.prop("disabled",a),a?(this.button.attr("tabindex",-1),this.close()):this.button.attr("tabindex",0)},_appendTo:function(){var a=this.options.appendTo;return a&&(a=a.jquery||a.nodeType?I(a):this.document.find(a).eq(0)),a&&a[0]||(a=this.element.closest(".ui-front, dialog")),a.length||(a=this.document[0].body),a},_toggleAttr:function(){this.button.attr("aria-expanded",this.isOpen),this._removeClass(this.button,"ui-selectmenu-button-"+(this.isOpen?"closed":"open"))._addClass(this.button,"ui-selectmenu-button-"+(this.isOpen?"open":"closed"))._toggleClass(this.menuWrap,"ui-selectmenu-open",null,this.isOpen),this.menu.attr("aria-hidden",!this.isOpen)},_resizeButton:function(){var a=this.options.width;return a===!1?(this.button.css("width",""),void 0):(null===a&&(a=this.element.show().outerWidth(),this.element.hide()),this.button.outerWidth(a),void 0)},_resizeMenu:function(){this.menu.outerWidth(Math.max(this.button.outerWidth(),this.menu.width("").outerWidth()+1))},_getCreateOptions:function(){var a=this._super();return a.disabled=this.element.prop("disabled"),a},_parseOptions:function(a){var c=this,d=[];a.each(function(f,g){d.push(c._parseOption(I(g),f))}),this.items=d},_parseOption:function(d,a){var c=d.parent("optgroup");return{element:d,index:a,value:d.val(),label:d.text(),optgroup:c.attr("label")||"",disabled:c.prop("disabled")||d.prop("disabled")}},_destroy:function(){this._unbindFormResetHandler(),this.menuWrap.remove(),this.button.remove(),this.element.show(),this.element.removeUniqueId(),this.labels.attr("for",this.ids.element)}}]),I.widget("ui.slider",I.ui.mouse,{version:"1.12.1",widgetEventPrefix:"slide",options:{animate:!1,classes:{"ui-slider":"ui-corner-all","ui-slider-handle":"ui-corner-all","ui-slider-range":"ui-corner-all ui-widget-header"},distance:0,max:100,min:0,orientation:"horizontal",range:!1,step:1,value:0,values:null,change:null,slide:null,start:null,stop:null},numPages:5,_create:function(){this._keySliding=!1,this._mouseSliding=!1,this._animateOff=!0,this._handleIndex=null,this._detectOrientation(),this._mouseInit(),this._calculateNewMax(),this._addClass("ui-slider ui-slider-"+this.orientation,"ui-widget ui-widget-content"),this._refresh(),this._animateOff=!1},_refresh:function(){this._createRange(),this._createHandles(),this._setupEvents(),this._refreshValue()},_createHandles:function(){var d,f,l=this.options,g=this.element.find(".ui-slider-handle"),h="<span tabindex='0'></span>",c=[];for(f=l.values&&l.values.length||1,g.length>f&&(g.slice(f).remove(),g=g.slice(0,f)),d=g.length;f>d;d++){c.push(h)}this.handles=g.add(I(c.join("")).appendTo(this.element)),this._addClass(this.handles,"ui-slider-handle","ui-state-default"),this.handle=this.handles.eq(0),this.handles.each(function(a){I(this).data("ui-slider-handle-index",a).attr("tabIndex",0)})},_createRange:function(){var a=this.options;a.range?(a.range===!0&&(a.values?a.values.length&&2!==a.values.length?a.values=[a.values[0],a.values[0]]:I.isArray(a.values)&&(a.values=a.values.slice(0)):a.values=[this._valueMin(),this._valueMin()]),this.range&&this.range.length?(this._removeClass(this.range,"ui-slider-range-min ui-slider-range-max"),this.range.css({left:"",bottom:""})):(this.range=I("<div>").appendTo(this.element),this._addClass(this.range,"ui-slider-range")),("min"===a.range||"max"===a.range)&&this._addClass(this.range,"ui-slider-range-"+a.range)):(this.range&&this.range.remove(),this.range=null)},_setupEvents:function(){this._off(this.handles),this._on(this.handles,this._handleEvents),this._hoverable(this.handles),this._focusable(this.handles)},_destroy:function(){this.handles.remove(),this.range&&this.range.remove(),this._mouseDestroy()},_mouseCapture:function(g){var p,N,v,L,d,M,m,t,f=this,O=this.options;return O.disabled?!1:(this.elementSize={width:this.element.outerWidth(),height:this.element.outerHeight()},this.elementOffset=this.element.offset(),p={x:g.pageX,y:g.pageY},N=this._normValueFromMouse(p),v=this._valueMax()-this._valueMin()+1,this.handles.each(function(a){var c=Math.abs(N-f.values(a));(v>c||v===c&&(a===f._lastChangedValue||f.values(a)===O.min))&&(v=c,L=I(this),d=a)}),M=this._start(g,d),M===!1?!1:(this._mouseSliding=!0,this._handleIndex=d,this._addClass(L,null,"ui-state-active"),L.trigger("focus"),m=L.offset(),t=!I(g.target).parents().addBack().is(".ui-slider-handle"),this._clickOffset=t?{left:0,top:0}:{left:g.pageX-m.left-L.width()/2,top:g.pageY-m.top-L.height()/2-(parseInt(L.css("borderTopWidth"),10)||0)-(parseInt(L.css("borderBottomWidth"),10)||0)+(parseInt(L.css("marginTop"),10)||0)},this.handles.hasClass("ui-state-hover")||this._slide(g,d,N),this._animateOff=!0,!0))},_mouseStart:function(){return !0},_mouseDrag:function(d){var a={x:d.pageX,y:d.pageY},c=this._normValueFromMouse(a);return this._slide(d,this._handleIndex,c),!1},_mouseStop:function(a){return this._removeClass(this.handles,null,"ui-state-active"),this._mouseSliding=!1,this._stop(a,this._handleIndex),this._change(a,this._handleIndex),this._handleIndex=null,this._clickOffset=null,this._animateOff=!1,!1},_detectOrientation:function(){this.orientation="vertical"===this.options.orientation?"vertical":"horizontal"},_normValueFromMouse:function(h){var a,c,g,d,f;return"horizontal"===this.orientation?(a=this.elementSize.width,c=h.x-this.elementOffset.left-(this._clickOffset?this._clickOffset.left:0)):(a=this.elementSize.height,c=h.y-this.elementOffset.top-(this._clickOffset?this._clickOffset.top:0)),g=c/a,g>1&&(g=1),0>g&&(g=0),"vertical"===this.orientation&&(g=1-g),d=this._valueMax()-this._valueMin(),f=this._valueMin()+g*d,this._trimAlignValue(f)},_uiHash:function(f,a,c){var d={handle:this.handles[f],handleIndex:f,value:void 0!==a?a:this.value()};return this._hasMultipleValues()&&(d.value=void 0!==a?a:this.values(f),d.values=c||this.values()),d},_hasMultipleValues:function(){return this.options.values&&this.options.values.length},_start:function(c,a){return this._trigger("start",c,this._uiHash(a))},_slide:function(m,d,f){var l,g,h=this.value(),c=this.values();this._hasMultipleValues()&&(g=this.values(d?0:1),h=this.values(d),2===this.options.values.length&&this.options.range===!0&&(f=0===d?Math.min(g,f):Math.max(g,f)),c[d]=f),f!==h&&(l=this._trigger("slide",m,this._uiHash(d,f,c)),l!==!1&&(this._hasMultipleValues()?this.values(d,f):this.value(f)))},_stop:function(c,a){this._trigger("stop",c,this._uiHash(a))},_change:function(c,a){this._keySliding||this._mouseSliding||(this._lastChangedValue=a,this._trigger("change",c,this._uiHash(a)))},value:function(a){return arguments.length?(this.options.value=this._trimAlignValue(a),this._refreshValue(),this._change(null,0),void 0):this._value()},values:function(a,c){var g,d,f;if(arguments.length>1){return this.options.values[a]=this._trimAlignValue(c),this._refreshValue(),this._change(null,a),void 0}if(!arguments.length){return this._values()}if(!I.isArray(arguments[0])){return this._hasMultipleValues()?this._values(a):this.value()}for(g=this.options.values,d=arguments[0],f=0;g.length>f;f+=1){g[f]=this._trimAlignValue(d[f]),this._change(null,f)}this._refreshValue()},_setOption:function(a,c){var f,d=0;switch("range"===a&&this.options.range===!0&&("min"===c?(this.options.value=this._values(0),this.options.values=null):"max"===c&&(this.options.value=this._values(this.options.values.length-1),this.options.values=null)),I.isArray(this.options.values)&&(d=this.options.values.length),this._super(a,c),a){case"orientation":this._detectOrientation(),this._removeClass("ui-slider-horizontal ui-slider-vertical")._addClass("ui-slider-"+this.orientation),this._refreshValue(),this.options.range&&this._refreshRange(c),this.handles.css("horizontal"===c?"bottom":"left","");break;case"value":this._animateOff=!0,this._refreshValue(),this._change(null,0),this._animateOff=!1;break;case"values":for(this._animateOff=!0,this._refreshValue(),f=d-1;f>=0;f--){this._change(null,f)}this._animateOff=!1;break;case"step":case"min":case"max":this._animateOff=!0,this._calculateNewMax(),this._refreshValue(),this._animateOff=!1;break;case"range":this._animateOff=!0,this._refresh(),this._animateOff=!1}},_setOptionDisabled:function(a){this._super(a),this._toggleClass(null,"ui-state-disabled",!!a)},_value:function(){var a=this.options.value;return a=this._trimAlignValue(a)},_values:function(f){var a,c,d;if(arguments.length){return a=this.options.values[f],a=this._trimAlignValue(a)}if(this._hasMultipleValues()){for(c=this.options.values.slice(),d=0;c.length>d;d+=1){c[d]=this._trimAlignValue(c[d])}return c}return[]},_trimAlignValue:function(f){if(this._valueMin()>=f){return this._valueMin()}if(f>=this._valueMax()){return this._valueMax()}var a=this.options.step>0?this.options.step:1,c=(f-this._valueMin())%a,d=f-c;return 2*Math.abs(c)>=a&&(d+=c>0?a:-a),parseFloat(d.toFixed(5))},_calculateNewMax:function(){var f=this.options.max,a=this._valueMin(),c=this.options.step,d=Math.round((f-a)/c)*c;f=d+a,f>this.options.max&&(f-=c),this.max=parseFloat(f.toFixed(this._precision()))},_precision:function(){var a=this._precisionOf(this.options.step);return null!==this.options.min&&(a=Math.max(a,this._precisionOf(this.options.min))),a},_precisionOf:function(d){var a=""+d,c=a.indexOf(".");return -1===c?0:a.length-c-1},_valueMin:function(){return this.options.min},_valueMax:function(){return this.max},_refreshRange:function(a){"vertical"===a&&this.range.css({width:"",left:""}),"horizontal"===a&&this.range.css({height:"",bottom:""})},_refreshValue:function(){var g,p,M,u,v,d=this.options.range,L=this.options,m=this,t=this._animateOff?!1:L.animate,f={};this._hasMultipleValues()?this.handles.each(function(a){p=100*((m.values(a)-m._valueMin())/(m._valueMax()-m._valueMin())),f["horizontal"===m.orientation?"left":"bottom"]=p+"%",I(this).stop(1,1)[t?"animate":"css"](f,L.animate),m.options.range===!0&&("horizontal"===m.orientation?(0===a&&m.range.stop(1,1)[t?"animate":"css"]({left:p+"%"},L.animate),1===a&&m.range[t?"animate":"css"]({width:p-g+"%"},{queue:!1,duration:L.animate})):(0===a&&m.range.stop(1,1)[t?"animate":"css"]({bottom:p+"%"},L.animate),1===a&&m.range[t?"animate":"css"]({height:p-g+"%"},{queue:!1,duration:L.animate}))),g=p}):(M=this.value(),u=this._valueMin(),v=this._valueMax(),p=v!==u?100*((M-u)/(v-u)):0,f["horizontal"===this.orientation?"left":"bottom"]=p+"%",this.handle.stop(1,1)[t?"animate":"css"](f,L.animate),"min"===d&&"horizontal"===this.orientation&&this.range.stop(1,1)[t?"animate":"css"]({width:p+"%"},L.animate),"max"===d&&"horizontal"===this.orientation&&this.range.stop(1,1)[t?"animate":"css"]({width:100-p+"%"},L.animate),"min"===d&&"vertical"===this.orientation&&this.range.stop(1,1)[t?"animate":"css"]({height:p+"%"},L.animate),"max"===d&&"vertical"===this.orientation&&this.range.stop(1,1)[t?"animate":"css"]({height:100-p+"%"},L.animate))},_handleEvents:{keydown:function(d){var f,l,g,h,c=I(d.target).data("ui-slider-handle-index");switch(d.keyCode){case I.ui.keyCode.HOME:case I.ui.keyCode.END:case I.ui.keyCode.PAGE_UP:case I.ui.keyCode.PAGE_DOWN:case I.ui.keyCode.UP:case I.ui.keyCode.RIGHT:case I.ui.keyCode.DOWN:case I.ui.keyCode.LEFT:if(d.preventDefault(),!this._keySliding&&(this._keySliding=!0,this._addClass(I(d.target),null,"ui-state-active"),f=this._start(d,c),f===!1)){return}}switch(h=this.options.step,l=g=this._hasMultipleValues()?this.values(c):this.value(),d.keyCode){case I.ui.keyCode.HOME:g=this._valueMin();break;case I.ui.keyCode.END:g=this._valueMax();break;case I.ui.keyCode.PAGE_UP:g=this._trimAlignValue(l+(this._valueMax()-this._valueMin())/this.numPages);break;case I.ui.keyCode.PAGE_DOWN:g=this._trimAlignValue(l-(this._valueMax()-this._valueMin())/this.numPages);break;case I.ui.keyCode.UP:case I.ui.keyCode.RIGHT:if(l===this._valueMax()){return}g=this._trimAlignValue(l+h);break;case I.ui.keyCode.DOWN:case I.ui.keyCode.LEFT:if(l===this._valueMin()){return}g=this._trimAlignValue(l-h)}this._slide(d,c,g)},keyup:function(a){var c=I(a.target).data("ui-slider-handle-index");this._keySliding&&(this._keySliding=!1,this._stop(a,c),this._change(a,c),this._removeClass(I(a.target),null,"ui-state-active"))}}}),I.widget("ui.spinner",{version:"1.12.1",defaultElement:"<input>",widgetEventPrefix:"spin",options:{classes:{"ui-spinner":"ui-corner-all","ui-spinner-down":"ui-corner-br","ui-spinner-up":"ui-corner-tr"},culture:null,icons:{down:"ui-icon-triangle-1-s",up:"ui-icon-triangle-1-n"},incremental:!0,max:null,min:null,numberFormat:null,page:10,step:1,change:null,spin:null,start:null,stop:null},_create:function(){this._setOption("max",this.options.max),this._setOption("min",this.options.min),this._setOption("step",this.options.step),""!==this.value()&&this._value(this.element.val(),!0),this._draw(),this._on(this._events),this._refresh(),this._on(this.window,{beforeunload:function(){this.element.removeAttr("autocomplete")}})},_getCreateOptions:function(){var a=this._super(),c=this.element;return I.each(["min","max","step"],function(f,e){var d=c.attr(e);null!=d&&d.length&&(a[e]=d)}),a},_events:{keydown:function(a){this._start(a)&&this._keydown(a)&&a.preventDefault()},keyup:"_stop",focus:function(){this.previous=this.element.val()},blur:function(a){return this.cancelBlur?(delete this.cancelBlur,void 0):(this._stop(),this._refresh(),this.previous!==this.element.val()&&this._trigger("change",a),void 0)},mousewheel:function(c,a){if(a){if(!this.spinning&&!this._start(c)){return !1}this._spin((a>0?1:-1)*this.options.step,c),clearTimeout(this.mousewheelTimer),this.mousewheelTimer=this._delay(function(){this.spinning&&this._stop(c)},100),c.preventDefault()}},"mousedown .ui-spinner-button":function(a){function c(){var f=this.element[0]===I.ui.safeActiveElement(this.document[0]);f||(this.element.trigger("focus"),this.previous=d,this._delay(function(){this.previous=d}))}var d;d=this.element[0]===I.ui.safeActiveElement(this.document[0])?this.previous:this.element.val(),a.preventDefault(),c.call(this),this.cancelBlur=!0,this._delay(function(){delete this.cancelBlur,c.call(this)}),this._start(a)!==!1&&this._repeat(null,I(a.currentTarget).hasClass("ui-spinner-up")?1:-1,a)},"mouseup .ui-spinner-button":"_stop","mouseenter .ui-spinner-button":function(a){return I(a.currentTarget).hasClass("ui-state-active")?this._start(a)===!1?!1:(this._repeat(null,I(a.currentTarget).hasClass("ui-spinner-up")?1:-1,a),void 0):void 0},"mouseleave .ui-spinner-button":"_stop"},_enhance:function(){this.uiSpinner=this.element.attr("autocomplete","off").wrap("<span>").parent().append("<a></a><a></a>")},_draw:function(){this._enhance(),this._addClass(this.uiSpinner,"ui-spinner","ui-widget ui-widget-content"),this._addClass("ui-spinner-input"),this.element.attr("role","spinbutton"),this.buttons=this.uiSpinner.children("a").attr("tabIndex",-1).attr("aria-hidden",!0).button({classes:{"ui-button":""}}),this._removeClass(this.buttons,"ui-corner-all"),this._addClass(this.buttons.first(),"ui-spinner-button ui-spinner-up"),this._addClass(this.buttons.last(),"ui-spinner-button ui-spinner-down"),this.buttons.first().button({icon:this.options.icons.up,showLabel:!1}),this.buttons.last().button({icon:this.options.icons.down,showLabel:!1}),this.buttons.height()>Math.ceil(0.5*this.uiSpinner.height())&&this.uiSpinner.height()>0&&this.uiSpinner.height(this.uiSpinner.height())},_keydown:function(a){var c=this.options,d=I.ui.keyCode;switch(a.keyCode){case d.UP:return this._repeat(null,1,a),!0;case d.DOWN:return this._repeat(null,-1,a),!0;case d.PAGE_UP:return this._repeat(null,c.page,a),!0;case d.PAGE_DOWN:return this._repeat(null,-c.page,a),!0}return !1},_start:function(a){return this.spinning||this._trigger("start",a)!==!1?(this.counter||(this.counter=1),this.spinning=!0,!0):!1},_repeat:function(d,a,c){d=d||500,clearTimeout(this.timer),this.timer=this._delay(function(){this._repeat(40,a,c)},d),this._spin(a*this.options.step,c)},_spin:function(d,a){var c=this.value()||0;this.counter||(this.counter=1),c=this._adjustValue(c+d*this._increment(this.counter)),this.spinning&&this._trigger("spin",a,{value:c})===!1||(this._value(c),this.counter++)},_increment:function(a){var c=this.options.incremental;return c?I.isFunction(c)?c(a):Math.floor(a*a*a/50000-a*a/500+17*a/200+1):1},_precision:function(){var a=this._precisionOf(this.options.step);return null!==this.options.min&&(a=Math.max(a,this._precisionOf(this.options.min))),a},_precisionOf:function(d){var a=""+d,c=a.indexOf(".");return -1===c?0:a.length-c-1},_adjustValue:function(f){var a,c,d=this.options;return a=null!==d.min?d.min:0,c=f-a,c=Math.round(c/d.step)*d.step,f=a+c,f=parseFloat(f.toFixed(this._precision())),null!==d.max&&f>d.max?d.max:null!==d.min&&d.min>f?d.min:f},_stop:function(a){this.spinning&&(clearTimeout(this.timer),clearTimeout(this.mousewheelTimer),this.counter=0,this.spinning=!1,this._trigger("stop",a))},_setOption:function(g,a){var c,f,d;return"culture"===g||"numberFormat"===g?(c=this._parse(this.element.val()),this.options[g]=a,this.element.val(this._format(c)),void 0):(("max"===g||"min"===g||"step"===g)&&"string"==typeof a&&(a=this._parse(a)),"icons"===g&&(f=this.buttons.first().find(".ui-icon"),this._removeClass(f,null,this.options.icons.up),this._addClass(f,null,a.up),d=this.buttons.last().find(".ui-icon"),this._removeClass(d,null,this.options.icons.down),this._addClass(d,null,a.down)),this._super(g,a),void 0)},_setOptionDisabled:function(a){this._super(a),this._toggleClass(this.uiSpinner,null,"ui-state-disabled",!!a),this.element.prop("disabled",!!a),this.buttons.button(a?"disable":"enable")},_setOptions:G(function(a){this._super(a)}),_parse:function(a){return"string"==typeof a&&""!==a&&(a=window.Globalize&&this.options.numberFormat?Globalize.parseFloat(a,10,this.options.culture):+a),""===a||isNaN(a)?null:a},_format:function(a){return""===a?"":window.Globalize&&this.options.numberFormat?Globalize.format(a,this.options.numberFormat,this.options.culture):a},_refresh:function(){this.element.attr({"aria-valuemin":this.options.min,"aria-valuemax":this.options.max,"aria-valuenow":this._parse(this.element.val())})},isValid:function(){var a=this.value();return null===a?!1:a===this._adjustValue(a)},_value:function(d,a){var c;""!==d&&(c=this._parse(d),null!==c&&(a||(c=this._adjustValue(c)),d=this._format(c))),this.element.val(d),this._refresh()},_destroy:function(){this.element.prop("disabled",!1).removeAttr("autocomplete role aria-valuemin aria-valuemax aria-valuenow"),this.uiSpinner.replaceWith(this.element)},stepUp:G(function(a){this._stepUp(a)}),_stepUp:function(a){this._start()&&(this._spin((a||1)*this.options.step),this._stop())},stepDown:G(function(a){this._stepDown(a)}),_stepDown:function(a){this._start()&&(this._spin((a||1)*-this.options.step),this._stop())},pageUp:G(function(a){this._stepUp((a||1)*this.options.page)}),pageDown:G(function(a){this._stepDown((a||1)*this.options.page)}),value:function(a){return arguments.length?(G(this._value).call(this,a),void 0):this._parse(this.element.val())},widget:function(){return this.uiSpinner}}),I.uiBackCompat!==!1&&I.widget("ui.spinner",I.ui.spinner,{_enhance:function(){this.uiSpinner=this.element.attr("autocomplete","off").wrap(this._uiSpinnerHtml()).parent().append(this._buttonHtml())},_uiSpinnerHtml:function(){return"<span>"},_buttonHtml:function(){return"<a></a><a></a>"}}),I.ui.spinner,I.widget("ui.tabs",{version:"1.12.1",delay:300,options:{active:null,classes:{"ui-tabs":"ui-corner-all","ui-tabs-nav":"ui-corner-all","ui-tabs-panel":"ui-corner-bottom","ui-tabs-tab":"ui-corner-top"},collapsible:!1,event:"click",heightStyle:"content",hide:null,show:null,activate:null,beforeActivate:null,beforeLoad:null,load:null},_isLocal:function(){var a=/#.*$/;return function(c){var d,g;d=c.href.replace(a,""),g=location.href.replace(a,"");try{d=decodeURIComponent(d)}catch(f){}try{g=decodeURIComponent(g)}catch(f){}return c.hash.length>1&&d===g}}(),_create:function(){var a=this,c=this.options;this.running=!1,this._addClass("ui-tabs","ui-widget ui-widget-content"),this._toggleClass("ui-tabs-collapsible",null,c.collapsible),this._processTabs(),c.active=this._initialActive(),I.isArray(c.disabled)&&(c.disabled=I.unique(c.disabled.concat(I.map(this.tabs.filter(".ui-state-disabled"),function(d){return a.tabs.index(d)}))).sort()),this.active=this.options.active!==!1&&this.anchors.length?this._findActive(c.active):I(),this._refresh(),this.active.length&&this.load(c.active)},_initialActive:function(){var a=this.options.active,c=this.options.collapsible,d=location.hash.substring(1);return null===a&&(d&&this.tabs.each(function(e,f){return I(f).attr("aria-controls")===d?(a=e,!1):void 0}),null===a&&(a=this.tabs.index(this.tabs.filter(".ui-tabs-active"))),(null===a||-1===a)&&(a=this.tabs.length?0:!1)),a!==!1&&(a=this.tabs.index(this.tabs.eq(a)),-1===a&&(a=c?!1:0)),!c&&a===!1&&this.anchors.length&&(a=0),a},_getCreateEventData:function(){return{tab:this.active,panel:this.active.length?this._getPanelForTab(this.active):I()}},_tabKeydown:function(a){var c=I(I.ui.safeActiveElement(this.document[0])).closest("li"),f=this.tabs.index(c),d=!0;if(!this._handlePageNav(a)){switch(a.keyCode){case I.ui.keyCode.RIGHT:case I.ui.keyCode.DOWN:f++;break;case I.ui.keyCode.UP:case I.ui.keyCode.LEFT:d=!1,f--;break;case I.ui.keyCode.END:f=this.anchors.length-1;break;case I.ui.keyCode.HOME:f=0;break;case I.ui.keyCode.SPACE:return a.preventDefault(),clearTimeout(this.activating),this._activate(f),void 0;case I.ui.keyCode.ENTER:return a.preventDefault(),clearTimeout(this.activating),this._activate(f===this.options.active?!1:f),void 0;default:return}a.preventDefault(),clearTimeout(this.activating),f=this._focusNextTab(f,d),a.ctrlKey||a.metaKey||(c.attr("aria-selected","false"),this.tabs.eq(f).attr("aria-selected","true"),this.activating=this._delay(function(){this.option("active",f)},this.delay))}},_panelKeydown:function(a){this._handlePageNav(a)||a.ctrlKey&&a.keyCode===I.ui.keyCode.UP&&(a.preventDefault(),this.active.trigger("focus"))},_handlePageNav:function(a){return a.altKey&&a.keyCode===I.ui.keyCode.PAGE_UP?(this._activate(this._focusNextTab(this.options.active-1,!1)),!0):a.altKey&&a.keyCode===I.ui.keyCode.PAGE_DOWN?(this._activate(this._focusNextTab(this.options.active+1,!0)),!0):void 0},_findNextTab:function(a,c){function f(){return a>d&&(a=0),0>a&&(a=d),a}for(var d=this.tabs.length-1;-1!==I.inArray(f(),this.options.disabled);){a=c?a+1:a-1}return a},_focusNextTab:function(c,a){return c=this._findNextTab(c,a),this.tabs.eq(c).trigger("focus"),c},_setOption:function(c,a){return"active"===c?(this._activate(a),void 0):(this._super(c,a),"collapsible"===c&&(this._toggleClass("ui-tabs-collapsible",null,a),a||this.options.active!==!1||this._activate(0)),"event"===c&&this._setupEvents(a),"heightStyle"===c&&this._setupHeightStyle(a),void 0)},_sanitizeSelector:function(a){return a?a.replace(/[!"$%&'()*+,.\/:;<=>?@\[\]\^`{|}~]/g,"\\$&"):""},refresh:function(){var a=this.options,c=this.tablist.children(":has(a[href])");a.disabled=I.map(c.filter(".ui-state-disabled"),function(d){return c.index(d)}),this._processTabs(),a.active!==!1&&this.anchors.length?this.active.length&&!I.contains(this.tablist[0],this.active[0])?this.tabs.length===a.disabled.length?(a.active=!1,this.active=I()):this._activate(this._findNextTab(Math.max(0,a.active-1),!1)):a.active=this.tabs.index(this.active):(a.active=!1,this.active=I()),this._refresh()},_refresh:function(){this._setOptionDisabled(this.options.disabled),this._setupEvents(this.options.event),this._setupHeightStyle(this.options.heightStyle),this.tabs.not(this.active).attr({"aria-selected":"false","aria-expanded":"false",tabIndex:-1}),this.panels.not(this._getPanelForTab(this.active)).hide().attr({"aria-hidden":"true"}),this.active.length?(this.active.attr({"aria-selected":"true","aria-expanded":"true",tabIndex:0}),this._addClass(this.active,"ui-tabs-active","ui-state-active"),this._getPanelForTab(this.active).show().attr({"aria-hidden":"false"})):this.tabs.eq(0).attr("tabIndex",0)},_processTabs:function(){var a=this,c=this.tabs,f=this.anchors,d=this.panels;this.tablist=this._getList().attr("role","tablist"),this._addClass(this.tablist,"ui-tabs-nav","ui-helper-reset ui-helper-clearfix ui-widget-header"),this.tablist.on("mousedown"+this.eventNamespace,"> li",function(g){I(this).is(".ui-state-disabled")&&g.preventDefault()}).on("focus"+this.eventNamespace,".ui-tabs-anchor",function(){I(this).closest("li").is(".ui-state-disabled")&&this.blur()}),this.tabs=this.tablist.find("> li:has(a[href])").attr({role:"tab",tabIndex:-1}),this._addClass(this.tabs,"ui-tabs-tab","ui-state-default"),this.anchors=this.tabs.map(function(){return I("a",this)[0]}).attr({role:"presentation",tabIndex:-1}),this._addClass(this.anchors,"ui-tabs-anchor"),this.panels=I(),this.anchors.each(function(m,L){var t,u,e,v=I(L).uniqueId().attr("id"),g=I(L).closest("li"),p=g.attr("aria-controls");a._isLocal(L)?(t=L.hash,e=t.substring(1),u=a.element.find(a._sanitizeSelector(t))):(e=g.attr("aria-controls")||I({}).uniqueId()[0].id,t="#"+e,u=a.element.find(t),u.length||(u=a._createPanel(e),u.insertAfter(a.panels[m-1]||a.tablist)),u.attr("aria-live","polite")),u.length&&(a.panels=a.panels.add(u)),p&&g.data("ui-tabs-aria-controls",p),g.attr({"aria-controls":e,"aria-labelledby":v}),u.attr("aria-labelledby",v)}),this.panels.attr("role","tabpanel"),this._addClass(this.panels,"ui-tabs-panel","ui-widget-content"),c&&(this._off(c.not(this.tabs)),this._off(f.not(this.anchors)),this._off(d.not(this.panels)))},_getList:function(){return this.tablist||this.element.find("ol, ul").eq(0)},_createPanel:function(a){return I("<div>").attr("id",a).data("ui-tabs-destroy",!0)},_setOptionDisabled:function(a){var c,f,d;for(I.isArray(a)&&(a.length?a.length===this.anchors.length&&(a=!0):a=!1),d=0;f=this.tabs[d];d++){c=I(f),a===!0||-1!==I.inArray(d,a)?(c.attr("aria-disabled","true"),this._addClass(c,null,"ui-state-disabled")):(c.removeAttr("aria-disabled"),this._removeClass(c,null,"ui-state-disabled"))}this.options.disabled=a,this._toggleClass(this.widget(),this.widgetFullName+"-disabled",null,a===!0)},_setupEvents:function(a){var c={};a&&I.each(a.split(" "),function(f,d){c[d]="_eventHandler"}),this._off(this.anchors.add(this.tabs).add(this.panels)),this._on(!0,this.anchors,{click:function(d){d.preventDefault()}}),this._on(this.anchors,c),this._on(this.tabs,{keydown:"_tabKeydown"}),this._on(this.panels,{keydown:"_panelKeydown"}),this._focusable(this.tabs),this._hoverable(this.tabs)},_setupHeightStyle:function(a){var c,d=this.element.parent();"fill"===a?(c=d.height(),c-=this.element.outerHeight()-this.element.height(),this.element.siblings(":visible").each(function(){var f=I(this),g=f.css("position");"absolute"!==g&&"fixed"!==g&&(c-=f.outerHeight(!0))}),this.element.children().not(this.panels).each(function(){c-=I(this).outerHeight(!0)}),this.panels.each(function(){I(this).height(Math.max(0,c-I(this).innerHeight()+I(this).height()))}).css("overflow","auto")):"auto"===a&&(c=0,this.panels.each(function(){c=Math.max(c,I(this).height("").height())}).height(c))},_eventHandler:function(g){var p=this.options,M=this.active,u=I(g.currentTarget),v=u.closest("li"),d=v[0]===M[0],L=d&&p.collapsible,m=L?I():this._getPanelForTab(v),t=M.length?this._getPanelForTab(M):I(),f={oldTab:M,oldPanel:t,newTab:L?I():v,newPanel:m};g.preventDefault(),v.hasClass("ui-state-disabled")||v.hasClass("ui-tabs-loading")||this.running||d&&!p.collapsible||this._trigger("beforeActivate",g,f)===!1||(p.active=L?!1:this.tabs.index(v),this.active=d?I():v,this.xhr&&this.xhr.abort(),t.length||m.length||I.error("jQuery UI Tabs: Mismatching fragment identifier."),m.length&&this.load(this.tabs.index(v),g),this._toggle(g,f))},_toggle:function(d,f){function m(){h.running=!1,h._trigger("activate",d,f)}function g(){h._addClass(f.newTab.closest("li"),"ui-tabs-active","ui-state-active"),c.length&&h.options.show?h._show(c,h.options.show,m):(c.show(),m())}var h=this,c=f.newPanel,l=f.oldPanel;this.running=!0,l.length&&this.options.hide?this._hide(l,this.options.hide,function(){h._removeClass(f.oldTab.closest("li"),"ui-tabs-active","ui-state-active"),g()}):(this._removeClass(f.oldTab.closest("li"),"ui-tabs-active","ui-state-active"),l.hide(),g()),l.attr("aria-hidden","true"),f.oldTab.attr({"aria-selected":"false","aria-expanded":"false"}),c.length&&l.length?f.oldTab.attr("tabIndex",-1):c.length&&this.tabs.filter(function(){return 0===I(this).attr("tabIndex")}).attr("tabIndex",-1),c.attr("aria-hidden","false"),f.newTab.attr({"aria-selected":"true","aria-expanded":"true",tabIndex:0})},_activate:function(a){var c,d=this._findActive(a);d[0]!==this.active[0]&&(d.length||(d=this.active),c=d.find(".ui-tabs-anchor")[0],this._eventHandler({target:c,currentTarget:c,preventDefault:I.noop}))},_findActive:function(a){return a===!1?I():this.tabs.eq(a)},_getIndex:function(a){return"string"==typeof a&&(a=this.anchors.index(this.anchors.filter("[href$='"+I.ui.escapeSelector(a)+"']"))),a},_destroy:function(){this.xhr&&this.xhr.abort(),this.tablist.removeAttr("role").off(this.eventNamespace),this.anchors.removeAttr("role tabIndex").removeUniqueId(),this.tabs.add(this.panels).each(function(){I.data(this,"ui-tabs-destroy")?I(this).remove():I(this).removeAttr("role tabIndex aria-live aria-busy aria-selected aria-labelledby aria-hidden aria-expanded")}),this.tabs.each(function(){var a=I(this),c=a.data("ui-tabs-aria-controls");c?a.attr("aria-controls",c).removeData("ui-tabs-aria-controls"):a.removeAttr("aria-controls")}),this.panels.show(),"content"!==this.options.heightStyle&&this.panels.css("height","")},enable:function(a){var c=this.options.disabled;c!==!1&&(void 0===a?c=!1:(a=this._getIndex(a),c=I.isArray(c)?I.map(c,function(d){return d!==a?d:null}):I.map(this.tabs,function(e,d){return d!==a?d:null})),this._setOptionDisabled(c))},disable:function(a){var c=this.options.disabled;if(c!==!0){if(void 0===a){c=!0}else{if(a=this._getIndex(a),-1!==I.inArray(a,c)){return}c=I.isArray(c)?I.merge([a],c).sort():[a]}this._setOptionDisabled(c)}},load:function(d,g){d=this._getIndex(d);var t=this,l=this.tabs.eq(d),m=l.find(".ui-tabs-anchor"),c=this._getPanelForTab(l),p={tab:l,panel:c},f=function(h,a){"abort"===a&&t.panels.stop(!1,!0),t._removeClass(l,"ui-tabs-loading"),c.removeAttr("aria-busy"),h===t.xhr&&delete t.xhr};this._isLocal(m[0])||(this.xhr=I.ajax(this._ajaxSettings(m,g,p)),this.xhr&&"canceled"!==this.xhr.statusText&&(this._addClass(l,"ui-tabs-loading"),c.attr("aria-busy","true"),this.xhr.done(function(i,a,h){setTimeout(function(){c.html(i),t._trigger("load",g,p),f(h,a)},1)}).fail(function(h,a){setTimeout(function(){f(h,a)},1)})))},_ajaxSettings:function(a,c,f){var d=this;return{url:a.attr("href").replace(/#.*$/,""),beforeSend:function(g,h){return d._trigger("beforeLoad",c,I.extend({jqXHR:g,ajaxSettings:h},f))}}},_getPanelForTab:function(a){var c=I(a).attr("aria-controls");return this.element.find(this._sanitizeSelector("#"+c))}}),I.uiBackCompat!==!1&&I.widget("ui.tabs",I.ui.tabs,{_processTabs:function(){this._superApply(arguments),this._addClass(this.tabs,"ui-tab")}}),I.ui.tabs,I.widget("ui.tooltip",{version:"1.12.1",options:{classes:{"ui-tooltip":"ui-corner-all ui-widget-shadow"},content:function(){var a=I(this).attr("title")||"";return I("<a>").text(a).html()},hide:!0,items:"[title]:not([disabled])",position:{my:"left top+15",at:"left bottom",collision:"flipfit flip"},show:!0,track:!1,close:null,open:null},_addDescribedBy:function(a,c){var d=(a.attr("aria-describedby")||"").split(/\s+/);d.push(c),a.data("ui-tooltip-id",c).attr("aria-describedby",I.trim(d.join(" ")))},_removeDescribedBy:function(a){var c=a.data("ui-tooltip-id"),f=(a.attr("aria-describedby")||"").split(/\s+/),d=I.inArray(c,f);-1!==d&&f.splice(d,1),a.removeData("ui-tooltip-id"),f=I.trim(f.join(" ")),f?a.attr("aria-describedby",f):a.removeAttr("aria-describedby")},_create:function(){this._on({mouseover:"open",focusin:"open"}),this.tooltips={},this.parents={},this.liveRegion=I("<div>").attr({role:"log","aria-live":"assertive","aria-relevant":"additions"}).appendTo(this.document[0].body),this._addClass(this.liveRegion,null,"ui-helper-hidden-accessible"),this.disabledTitles=I([])},_setOption:function(a,c){var d=this;this._super(a,c),"content"===a&&I.each(this.tooltips,function(g,f){d._updateContent(f.element)})},_setOptionDisabled:function(a){this[a?"_disable":"_enable"]()},_disable:function(){var a=this;I.each(this.tooltips,function(c,e){var d=I.Event("blur");d.target=d.currentTarget=e.element[0],a.close(d,!0)}),this.disabledTitles=this.disabledTitles.add(this.element.find(this.options.items).addBack().filter(function(){var c=I(this);return c.is("[title]")?c.data("ui-tooltip-title",c.attr("title")).removeAttr("title"):void 0}))},_enable:function(){this.disabledTitles.each(function(){var a=I(this);a.data("ui-tooltip-title")&&a.attr("title",a.data("ui-tooltip-title"))}),this.disabledTitles=I([])},open:function(a){var c=this,d=I(a?a.target:this.element).closest(this.options.items);d.length&&!d.data("ui-tooltip-id")&&(d.attr("title")&&d.data("ui-tooltip-title",d.attr("title")),d.data("ui-tooltip-open",!0),a&&"mouseover"===a.type&&d.parents().each(function(){var f,g=I(this);g.data("ui-tooltip-open")&&(f=I.Event("blur"),f.target=f.currentTarget=this,c.close(f,!0)),g.attr("title")&&(g.uniqueId(),c.parents[this.id]={element:this,title:g.attr("title")},g.attr("title",""))}),this._registerCloseHandlers(a,d),this._updateContent(d,a))},_updateContent:function(h,a){var c,g=this.options.content,d=this,f=a?a.type:null;return"string"==typeof g||g.nodeType||g.jquery?this._open(a,h,g):(c=g.call(h[0],function(e){d._delay(function(){h.data("ui-tooltip-open")&&(a&&(a.type=f),this._open(a,h,e))})}),c&&this._open(a,h,c),void 0)},_open:function(d,g,v){function p(a){m.of=a,c.is(":hidden")||c.position(m)}var t,c,u,f,m=I.extend({},this.options.position);if(v){if(t=this._find(g)){return t.tooltip.find(".ui-tooltip-content").html(v),void 0}g.is("[title]")&&(d&&"mouseover"===d.type?g.attr("title",""):g.removeAttr("title")),t=this._tooltip(g),c=t.tooltip,this._addDescribedBy(g,c.attr("id")),c.find(".ui-tooltip-content").html(v),this.liveRegion.children().hide(),f=I("<div>").html(c.find(".ui-tooltip-content").html()),f.removeAttr("name").find("[name]").removeAttr("name"),f.removeAttr("id").find("[id]").removeAttr("id"),f.appendTo(this.liveRegion),this.options.track&&d&&/^mouse/.test(d.type)?(this._on(this.document,{mousemove:p}),p(d)):c.position(I.extend({of:g},this.options.position)),c.hide(),this._show(c,this.options.show),this.options.track&&this.options.show&&this.options.show.delay&&(u=this.delayedShow=setInterval(function(){c.is(":visible")&&(p(m.of),clearInterval(u))},I.fx.interval)),this._trigger("open",d,{tooltip:c})}},_registerCloseHandlers:function(a,c){var d={keyup:function(f){if(f.keyCode===I.ui.keyCode.ESCAPE){var g=I.Event(f);g.currentTarget=c[0],this.close(g,!0)}}};c[0]!==this.element[0]&&(d.remove=function(){this._removeTooltip(this._find(c).tooltip)}),a&&"mouseover"!==a.type||(d.mouseleave="close"),a&&"focusin"!==a.type||(d.focusout="close"),this._on(!0,c,d)},close:function(a){var c,g=this,d=I(a?a.currentTarget:this.element),f=this._find(d);return f?(c=f.tooltip,f.closing||(clearInterval(this.delayedShow),d.data("ui-tooltip-title")&&!d.attr("title")&&d.attr("title",d.data("ui-tooltip-title")),this._removeDescribedBy(d),f.hiding=!0,c.stop(!0),this._hide(c,this.options.hide,function(){g._removeTooltip(I(this))}),d.removeData("ui-tooltip-open"),this._off(d,"mouseleave focusout keyup"),d[0]!==this.element[0]&&this._off(d,"remove"),this._off(this.document,"mousemove"),a&&"mouseleave"===a.type&&I.each(this.parents,function(h,l){I(l.element).attr("title",l.title),delete g.parents[h]}),f.closing=!0,this._trigger("close",a,{tooltip:c}),f.hiding||(f.closing=!1)),void 0):(d.removeData("ui-tooltip-open"),void 0)},_tooltip:function(a){var c=I("<div>").attr("role","tooltip"),f=I("<div>").appendTo(c),d=c.uniqueId().attr("id");return this._addClass(f,"ui-tooltip-content"),this._addClass(c,"ui-tooltip","ui-widget ui-widget-content"),c.appendTo(this._appendTo(a)),this.tooltips[d]={element:a,tooltip:c}},_find:function(c){var a=c.data("ui-tooltip-id");return a?this.tooltips[a]:null},_removeTooltip:function(a){a.remove(),delete this.tooltips[a.attr("id")]},_appendTo:function(c){var a=c.closest(".ui-front, dialog");return a.length||(a=this.document[0].body),a},_destroy:function(){var a=this;I.each(this.tooltips,function(c,f){var d=I.Event("blur"),e=f.element;d.target=d.currentTarget=e[0],a.close(d,!0),I("#"+c).remove(),e.data("ui-tooltip-title")&&(e.attr("title")||e.attr("title",e.data("ui-tooltip-title")),e.removeData("ui-tooltip-title"))}),this.liveRegion.remove()}}),I.uiBackCompat!==!1&&I.widget("ui.tooltip",I.ui.tooltip,{options:{tooltipClass:null},_tooltip:function(){var a=this._superApply(arguments);return this.options.tooltipClass&&a.tooltip.addClass(this.options.tooltipClass),a}}),I.ui.tooltip;var x="ui-effects-",y="ui-effects-style",C="ui-effects-animated",b=I;I.effects={effect:{}},function(V,L){function O(f,a,c){var d=W[a.type]||{};return null==f?c||!a.def?null:a.def:(f=d.floor?~~f:parseFloat(f),isNaN(f)?a.def:d.mod?(f+d.mod)%d.mod:0>f?0:f>d.max?d.max:f)}function U(a){var d=P(),c=d._rgba=[];return a=a.toLowerCase(),M(N,function(s,n){var e,p=n.re.exec(a),f=p&&n.parse(p),i=n.space||"rgba";return f?(e=d[i](f),d[m[i].cache]=e[m[i].cache],c=d._rgba=e._rgba,!1):L}),c.length?("0,0,0,0"===c.join()&&V.extend(c,R.transparent),d):R[a]}function Q(d,a,c){return c=(c+1)%1,1>6*c?d+6*(a-d)*c:1>2*c?a:2>3*c?d+6*(a-d)*(2/3-c):d}var R,g="backgroundColor borderBottomColor borderLeftColor borderRightColor borderTopColor color columnRuleColor outlineColor textDecorationColor textEmphasisColor",T=/^([\-+])=\s*(\d+\.?\d*)/,N=[{re:/rgba?\(\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d{1,3})\s*(?:,\s*(\d?(?:\.\d+)?)\s*)?\)/,parse:function(a){return[a[1],a[2],a[3],a[4]]}},{re:/rgba?\(\s*(\d+(?:\.\d+)?)\%\s*,\s*(\d+(?:\.\d+)?)\%\s*,\s*(\d+(?:\.\d+)?)\%\s*(?:,\s*(\d?(?:\.\d+)?)\s*)?\)/,parse:function(a){return[2.55*a[1],2.55*a[2],2.55*a[3],a[4]]}},{re:/#([a-f0-9]{2})([a-f0-9]{2})([a-f0-9]{2})/,parse:function(a){return[parseInt(a[1],16),parseInt(a[2],16),parseInt(a[3],16)]}},{re:/#([a-f0-9])([a-f0-9])([a-f0-9])/,parse:function(a){return[parseInt(a[1]+a[1],16),parseInt(a[2]+a[2],16),parseInt(a[3]+a[3],16)]}},{re:/hsla?\(\s*(\d+(?:\.\d+)?)\s*,\s*(\d+(?:\.\d+)?)\%\s*,\s*(\d+(?:\.\d+)?)\%\s*(?:,\s*(\d?(?:\.\d+)?)\s*)?\)/,space:"hsla",parse:function(a){return[a[1],a[2]/100,a[3]/100,a[4]]}}],P=V.Color=function(a,c,f,d){return new V.Color.fn.parse(a,c,f,d)},m={rgba:{props:{red:{idx:0,type:"byte"},green:{idx:1,type:"byte"},blue:{idx:2,type:"byte"}}},hsla:{props:{hue:{idx:0,type:"degrees"},saturation:{idx:1,type:"percent"},lightness:{idx:2,type:"percent"}}}},W={"byte":{floor:!0,max:255},percent:{max:1},degrees:{mod:360,floor:!0}},v=P.support={},S=V("<p>")[0],M=V.each;S.style.cssText="background-color:rgba(1,1,1,.5)",v.rgba=S.style.backgroundColor.indexOf("rgba")>-1,M(m,function(c,a){a.cache="_"+c,a.props.alpha={idx:3,type:"percent",def:1}}),P.fn=V.extend(P.prototype,{parse:function(i,c,o,f){if(i===L){return this._rgba=[null,null,null,null],this}(i.jquery||i.nodeType)&&(i=V(i).css(c),c=L);var s=this,e=V.type(i),l=this._rgba=[];return c!==L&&(i=[i,c,o,f],e="array"),"string"===e?this.parse(U(i)||R._default):"array"===e?(M(m.rgba.props,function(d,a){l[a.idx]=O(i[a.idx],a)}),this):"object"===e?(i instanceof P?M(m,function(d,a){i[a.cache]&&(s[a.cache]=i[a.cache].slice())}):M(m,function(a,h){var d=h.cache;M(h.props,function(p,n){if(!s[d]&&h.to){if("alpha"===p||null==i[p]){return}s[d]=h.to(s._rgba)}s[d][n.idx]=O(i[p],n,!0)}),s[d]&&0>V.inArray(null,s[d].slice(0,3))&&(s[d][3]=1,h.from&&(s._rgba=h.from(s[d])))}),this):L},is:function(e){var a=P(e),d=!0,c=this;return M(m,function(l,h){var f,i=a[h.cache];return i&&(f=c[h.cache]||h.to&&h.to(c._rgba)||[],M(h.props,function(o,n){return null!=i[n.idx]?d=i[n.idx]===f[n.idx]:L})),d}),d},_space:function(){var c=[],a=this;return M(m,function(d,e){a[e.cache]&&c.push(d)}),c.pop()},transition:function(X,d){var u=P(X),i=u._space(),l=m[i],c=0===this.alpha()?P("transparent"):this,p=c[l.cache]||l.to(c._rgba),f=p.slice();return u=u[l.cache],M(l.props,function(Z,s){var Y=s.idx,e=p[Y],r=u[Y],h=W[s.type]||{};null!==r&&(null===e?f[Y]=r:(h.mod&&(r-e>h.mod/2?e+=h.mod:e-r>h.mod/2&&(e-=h.mod)),f[Y]=O((r-e)*d+e,s)))}),this[i](f)},blend:function(a){if(1===this._rgba[3]){return this}var c=this._rgba.slice(),f=c.pop(),d=P(a)._rgba;return P(V.map(c,function(i,h){return(1-f)*d[h]+f*i}))},toRgbaString:function(){var a="rgba(",c=V.map(this._rgba,function(f,d){return null==f?d>2?1:0:f});return 1===c[3]&&(c.pop(),a="rgb("),a+c.join()+")"},toHslaString:function(){var a="hsla(",c=V.map(this.hsla(),function(f,d){return null==f&&(f=d>2?1:0),d&&3>d&&(f=Math.round(100*f)+"%"),f});return 1===c[3]&&(c.pop(),a="hsl("),a+c.join()+")"},toHexString:function(a){var c=this._rgba.slice(),d=c.pop();return a&&c.push(~~(255*d)),"#"+V.map(c,function(e){return e=(e||0).toString(16),1===e.length?"0"+e:e}).join("")},toString:function(){return 0===this._rgba[3]?"transparent":this.toRgbaString()}}),P.fn.parse.prototype=P.fn,m.hsla.to=function(ae){if(null==ae[0]||null==ae[1]||null==ae[2]){return[null,null,null,ae[3]]}var p,Y,ad=ae[0]/255,aa=ae[1]/255,ab=ae[2]/255,d=ae[3],ac=Math.max(ad,aa,ab),X=Math.min(ad,aa,ab),Z=ac-X,f=ac+X,af=0.5*f;return p=X===ac?0:ad===ac?60*(aa-ab)/Z+360:aa===ac?60*(ab-ad)/Z+120:60*(ad-aa)/Z+240,Y=0===Z?0:0.5>=af?Z/f:Z/(2-f),[Math.round(p)%360,Y,af,null==d?1:d]},m.hsla.from=function(p){if(null==p[0]||null==p[1]||null==p[2]){return[null,null,null,p[3]]}var d=p[0]/360,f=p[1],n=p[2],h=p[3],c=0.5>=n?n*(1+f):n+f-n*f,l=2*n-c;return[Math.round(255*Q(l,c,d+1/3)),Math.round(255*Q(l,c,d)),Math.round(255*Q(l,c,d-1/3)),h]},M(m,function(p,i){var l=i.props,d=i.cache,f=i.to,e=i.from;P.fn[p]=function(o){if(f&&!this[d]&&(this[d]=f(this._rgba)),o===L){return this[d].slice()}var c,h=V.type(o),t="array"===h||"object"===h?o:arguments,a=this[d].slice();return M(l,function(u,n){var r=t["object"===h?u:n.idx];null==r&&(r=a[n.idx]),a[n.idx]=O(r,n)}),e?(c=P(e(a)),c[d]=a,c):P(a)},M(l,function(a,c){P.fn[a]||(P.fn[a]=function(X){var Y,r=V.type(X),t="alpha"===a?this._hsla?"hsla":"rgba":p,u=this[t](),s=u[c.idx];return"undefined"===r?s:("function"===r&&(X=X.call(this,s),r=V.type(X)),null==X&&c.empty?this:("string"===r&&(Y=T.exec(X),Y&&(X=s+parseFloat(Y[2])*("+"===Y[1]?1:-1))),u[c.idx]=X,this[t](u)))})})}),P.hook=function(a){var c=a.split(" ");M(c,function(d,f){V.cssHooks[f]={set:function(l,s){var t,i,u="";if("transparent"!==s&&("string"!==V.type(s)||(t=U(s)))){if(s=P(t||s),!v.rgba&&1!==s._rgba[3]){for(i="backgroundColor"===f?l.parentNode:l;(""===u||"transparent"===u)&&i&&i.style;){try{u=V.css(i,"backgroundColor"),i=i.parentNode}catch(p){}}s=s.blend(u&&"transparent"!==u?u:"_default")}s=s.toRgbaString()}try{l.style[f]=s}catch(p){}}},V.fx.step[f]=function(h){h.colorInit||(h.start=P(h.elem,f),h.end=P(h.end),h.colorInit=!0),V.cssHooks[f].set(h.elem,h.start.transition(h.end,h.pos))}})},P.hook(g),V.cssHooks.borderColor={expand:function(c){var a={};return M(["Top","Right","Bottom","Left"],function(d,e){a["border"+e+"Color"]=c}),a}},R=V.Color.names={aqua:"#00ffff",black:"#000000",blue:"#0000ff",fuchsia:"#ff00ff",gray:"#808080",green:"#008000",lime:"#00ff00",maroon:"#800000",navy:"#000080",olive:"#808000",purple:"#800080",red:"#ff0000",silver:"#c0c0c0",teal:"#008080",white:"#ffffff",yellow:"#ffff00",transparent:[null,null,null,0],_default:"#ffffff"}}(b),function(){function a(g){var h,p,l=g.ownerDocument.defaultView?g.ownerDocument.defaultView.getComputedStyle(g,null):g.currentStyle,m={};if(l&&l.length&&l[0]&&l[l[0]]){for(p=l.length;p--;){h=l[p],"string"==typeof l[h]&&(m[I.camelCase(h)]=l[h])}}else{for(h in l){"string"==typeof l[h]&&(m[h]=l[h])}}return m}function c(h,l){var n,m,g={};for(n in l){m=l[n],h[n]!==m&&(d[n]||(I.fx.step[n]||!isNaN(parseFloat(m)))&&(g[n]=m))}return g}var f=["add","remove","toggle"],d={border:1,borderBottom:1,borderColor:1,borderLeft:1,borderRight:1,borderTop:1,borderWidth:1,margin:1,padding:1};I.each(["borderLeftStyle","borderRightStyle","borderBottomStyle","borderTopStyle"],function(g,h){I.fx.step[h]=function(e){("none"!==e.end&&!e.setAttr||1===e.pos&&!e.setAttr)&&(b.style(e.elem,h,e.end),e.setAttr=!0)}}),I.fn.addBack||(I.fn.addBack=function(e){return this.add(null==e?this.prevObject:this.prevObject.filter(e))}),I.effects.animateClass=function(i,l,e,m){var g=I.speed(l,e,m);return this.queue(function(){var p,h=I(this),s=h.attr("class")||"",n=g.children?h.find("*").addBack():h;n=n.map(function(){var o=I(this);return{el:o,start:a(this)}}),p=function(){I.each(f,function(r,o){i[o]&&h[o+"Class"](i[o])})},p(),n=n.map(function(){return this.end=a(this.el[0]),this.diff=c(this.start,this.end),this}),h.attr("class",s),n=n.map(function(){var o=this,r=I.Deferred(),t=I.extend({},g,{queue:!1,complete:function(){r.resolve(o)}});return this.el.animate(this.diff,t),r.promise()}),I.when.apply(I,n.get()).done(function(){p(),I.each(arguments,function(){var o=this.el;I.each(this.diff,function(r){o.css(r,"")})}),g.complete.call(h[0])})})},I.fn.extend({addClass:function(g){return function(e,m,h,l){return m?I.effects.animateClass.call(this,{add:e},m,h,l):g.apply(this,arguments)}}(I.fn.addClass),removeClass:function(g){return function(e,m,h,l){return arguments.length>1?I.effects.animateClass.call(this,{remove:e},m,h,l):g.apply(this,arguments)}}(I.fn.removeClass),toggleClass:function(g){return function(h,p,l,m,e){return"boolean"==typeof p||void 0===p?l?I.effects.animateClass.call(this,p?{add:h}:{remove:h},l,m,e):g.apply(this,arguments):I.effects.animateClass.call(this,{toggle:h},p,l,m)}}(I.fn.toggleClass),switchClass:function(g,h,p,l,m){return I.effects.animateClass.call(this,{add:h,remove:g},p,l,m)}})}(),function(){function a(f,g,l,h){return I.isPlainObject(f)&&(g=f,f=f.effect),f={effect:f},null==g&&(g={}),I.isFunction(g)&&(h=g,l=null,g={}),("number"==typeof g||I.fx.speeds[g])&&(h=l,l=g,g={}),I.isFunction(l)&&(h=l,l=null),g&&I.extend(f,g),l=l||g.duration,f.duration=I.fx.off?0:"number"==typeof l?l:l in I.fx.speeds?I.fx.speeds[l]:I.fx.speeds._default,f.complete=h||g.complete,f}function c(f){return !f||"number"==typeof f||I.fx.speeds[f]?!0:"string"!=typeof f||I.effects.effect[f]?I.isFunction(f)?!0:"object"!=typeof f||f.effect?!1:!0:!0}function d(p,f){var g=f.outerWidth(),m=f.outerHeight(),h=/^rect\((-?\d*\.?\d*px|-?\d+%|auto),?\s*(-?\d*\.?\d*px|-?\d+%|auto),?\s*(-?\d*\.?\d*px|-?\d+%|auto),?\s*(-?\d*\.?\d*px|-?\d+%|auto)\)$/,l=h.exec(p)||["",0,g,m,0];return{top:parseFloat(l[1])||0,right:"auto"===l[2]?g:parseFloat(l[2]),bottom:"auto"===l[3]?m:parseFloat(l[3]),left:parseFloat(l[4])||0}}I.expr&&I.expr.filters&&I.expr.filters.animated&&(I.expr.filters.animated=function(f){return function(e){return !!I(e).data(C)||f(e)}}(I.expr.filters.animated)),I.uiBackCompat!==!1&&I.extend(I.effects,{save:function(l,f){for(var g=0,h=f.length;h>g;g++){null!==f[g]&&l.data(x+f[g],l[0].style[f[g]])}},restore:function(m,f){for(var g,l=0,h=f.length;h>l;l++){null!==f[l]&&(g=m.data(x+f[l]),m.css(f[l],g))}},setMode:function(g,f){return"toggle"===f&&(f=g.is(":hidden")?"show":"hide"),f},createWrapper:function(g){if(g.parent().is(".ui-effects-wrapper")){return g.parent()}var h={width:g.outerWidth(!0),height:g.outerHeight(!0),"float":g.css("float")},p=I("<div></div>").addClass("ui-effects-wrapper").css({fontSize:"100%",background:"transparent",border:"none",margin:0,padding:0}),l={width:g.width(),height:g.height()},m=document.activeElement;try{m.id}catch(f){m=document.body}return g.wrap(p),(g[0]===m||I.contains(g[0],m))&&I(m).trigger("focus"),p=g.parent(),"static"===g.css("position")?(p.css({position:"relative"}),g.css({position:"relative"})):(I.extend(h,{position:g.css("position"),zIndex:g.css("z-index")}),I.each(["top","left","bottom","right"],function(i,e){h[e]=g.css(e),isNaN(parseInt(h[e],10))&&(h[e]="auto")}),g.css({position:"relative",top:0,left:0,right:"auto",bottom:"auto"})),g.css(l),p.css(h).show()},removeWrapper:function(f){var g=document.activeElement;return f.parent().is(".ui-effects-wrapper")&&(f.parent().replaceWith(f),(f[0]===g||I.contains(f[0],g))&&I(g).trigger("focus")),f}}),I.extend(I.effects,{version:"1.12.1",define:function(f,g,h){return h||(h=g,g="effect"),I.effects.effect[f]=h,I.effects.effect[f].mode=g,h},scaledDimensions:function(m,f,g){if(0===f){return{height:0,width:0,outerHeight:0,outerWidth:0}}var l="horizontal"!==g?(f||100)/100:1,h="vertical"!==g?(f||100)/100:1;return{height:m.height()*h,width:m.width()*l,outerHeight:m.outerHeight()*h,outerWidth:m.outerWidth()*l}},clipToBox:function(e){return{width:e.clip.right-e.clip.left,height:e.clip.bottom-e.clip.top,left:e.clip.left,top:e.clip.top}},unshift:function(l,f,g){var h=l.queue();f>1&&h.splice.apply(h,[1,0].concat(h.splice(f,g))),l.dequeue()},saveStyle:function(e){e.data(y,e[0].style.cssText)},restoreStyle:function(e){e[0].style.cssText=e.data(y)||"",e.removeData(y)},mode:function(h,f){var g=h.is(":hidden");return"toggle"===f&&(f=g?"show":"hide"),(g?"hide"===f:"show"===f)&&(f="none"),f},getBaseline:function(l,f){var g,h;switch(l[0]){case"top":g=0;break;case"middle":g=0.5;break;case"bottom":g=1;break;default:g=l[0]/f.height}switch(l[1]){case"left":h=0;break;case"center":h=0.5;break;case"right":h=1;break;default:h=l[1]/f.width}return{x:h,y:g}},createPlaceholder:function(f){var g,l=f.css("position"),h=f.position();return f.css({marginTop:f.css("marginTop"),marginBottom:f.css("marginBottom"),marginLeft:f.css("marginLeft"),marginRight:f.css("marginRight")}).outerWidth(f.outerWidth()).outerHeight(f.outerHeight()),/^(static|relative)/.test(l)&&(l="absolute",g=I("<"+f[0].nodeName+">").insertAfter(f).css({display:/^(inline|ruby)/.test(f.css("display"))?"inline-block":"block",visibility:"hidden",marginTop:f.css("marginTop"),marginBottom:f.css("marginBottom"),marginLeft:f.css("marginLeft"),marginRight:f.css("marginRight"),"float":f.css("float")}).outerWidth(f.outerWidth()).outerHeight(f.outerHeight()).addClass("ui-effects-placeholder"),f.data(x+"placeholder",g)),f.css({position:l,left:h.left,top:h.top}),g},removePlaceholder:function(h){var f=x+"placeholder",g=h.data(f);g&&(g.remove(),h.removeData(f))},cleanUp:function(f){I.effects.restoreStyle(f),I.effects.removePlaceholder(f)},setTransition:function(f,g,l,h){return h=h||{},I.each(g,function(n,e){var m=f.cssUnit(e);m[0]>0&&(h[e]=m[0]*l+m[1])}),h}}),I.fn.extend({effect:function(){function m(l){function n(){o.removeData(C),I.effects.cleanUp(o),"hide"===M.mode&&o.hide(),h()}function h(){I.isFunction(g)&&g.call(o[0]),I.isFunction(l)&&l()}var o=I(this);M.mode=f.shift(),I.uiBackCompat===!1||v?"none"===M.mode?(o[p](),h()):t.call(o[0],M,n):(o.is(":hidden")?"hide"===p:"show"===p)?(o[p](),h()):t.call(o[0],M,h)}var M=a.apply(this,arguments),t=I.effects.effect[M.effect],v=t.mode,e=M.queue,L=e||"fx",g=M.complete,p=M.mode,f=[],N=function(h){var l=I(this),n=I.effects.mode(l,p)||v;l.data(C,!0),f.push(n),v&&("show"===n||n===v&&"hide"===n)&&l.show(),v&&"none"===n||I.effects.saveStyle(l),I.isFunction(h)&&h()};return I.fx.off||!t?p?this[p](M.duration,g):this.each(function(){g&&g.call(this)}):e===!1?this.each(N).each(m):this.queue(L,N).queue(L,m)},show:function(e){return function(g){if(c(g)){return e.apply(this,arguments)}var f=a.apply(this,arguments);return f.mode="show",this.effect.call(this,f)}}(I.fn.show),hide:function(e){return function(g){if(c(g)){return e.apply(this,arguments)}var f=a.apply(this,arguments);return f.mode="hide",this.effect.call(this,f)}}(I.fn.hide),toggle:function(e){return function(g){if(c(g)||"boolean"==typeof g){return e.apply(this,arguments)}var f=a.apply(this,arguments);return f.mode="toggle",this.effect.call(this,f)}}(I.fn.toggle),cssUnit:function(f){var g=this.css(f),h=[];return I.each(["em","px","%","pt"],function(l,i){g.indexOf(i)>0&&(h=[parseFloat(g),i])}),h},cssClip:function(e){return e?this.css("clip","rect("+e.top+"px "+e.right+"px "+e.bottom+"px "+e.left+"px)"):d(this.css("clip"),this)},transfer:function(p,v){var P=I(this),M=I(p.to),N="fixed"===M.css("position"),f=I("body"),O=N?f.scrollTop():0,t=N?f.scrollLeft():0,L=M.offset(),g={top:L.top-O,left:L.left-t,height:M.innerHeight(),width:M.innerWidth()},Q=P.offset(),m=I("<div class='ui-effects-transfer'></div>").appendTo("body").addClass(p.className).css({top:Q.top-O,left:Q.left-t,height:P.innerHeight(),width:P.innerWidth(),position:N?"fixed":"absolute"}).animate(g,p.duration,p.easing,function(){m.remove(),I.isFunction(v)&&v()})}}),I.fx.step.clip=function(f){f.clipInit||(f.start=I(f.elem).cssClip(),"string"==typeof f.end&&(f.end=d(f.end,f.elem)),f.clipInit=!0),I(f.elem).cssClip({top:f.pos*(f.end.top-f.start.top)+f.start.top,right:f.pos*(f.end.right-f.start.right)+f.start.right,bottom:f.pos*(f.end.bottom-f.start.bottom)+f.start.bottom,left:f.pos*(f.end.left-f.start.left)+f.start.left})}}(),function(){var a={};I.each(["Quad","Cubic","Quart","Quint","Expo"],function(d,c){a[c]=function(f){return Math.pow(f,d+2)}}),I.extend(a,{Sine:function(c){return 1-Math.cos(c*Math.PI/2)},Circ:function(c){return 1-Math.sqrt(1-c*c)},Elastic:function(c){return 0===c||1===c?c:-Math.pow(2,8*(c-1))*Math.sin((80*(c-1)-7.5)*Math.PI/15)},Back:function(c){return c*c*(3*c-2)},Bounce:function(f){for(var c,d=4;((c=Math.pow(2,--d))-1)/11>f;){}return 1/Math.pow(4,3-d)-7.5625*Math.pow((3*c-2)/22-f,2)}}),I.each(a,function(c,d){I.easing["easeIn"+c]=d,I.easing["easeOut"+c]=function(e){return 1-d(1-e)},I.easing["easeInOut"+c]=function(e){return 0.5>e?d(2*e)/2:1-d(-2*e+2)/2}})}();var K=I.effects;I.effects.define("blind","hide",function(d,g){var t={up:["bottom","top"],vertical:["bottom","top"],down:["top","bottom"],left:["right","left"],horizontal:["right","left"],right:["left","right"]},l=I(this),m=d.direction||"up",c=l.cssClip(),p={clip:I.extend({},c)},f=I.effects.createPlaceholder(l);p.clip[t[m][0]]=p.clip[t[m][1]],"show"===d.mode&&(l.cssClip(p.clip),f&&f.css(I.effects.clipToBox(p)),p.clip=c),f&&f.animate(I.effects.clipToBox(p),d.duration,d.easing),l.animate(p,{queue:!1,duration:d.duration,easing:d.easing,complete:g})}),I.effects.define("bounce",function(P,T){var aa,W,X,L=I(this),Z=P.mode,S="hide"===Z,U="show"===Z,N=P.direction||"up",ab=P.distance,O=P.times||5,Y=2*O+(U||S?1:0),Q=P.duration/Y,R=P.easing,V="up"===N||"down"===N?"top":"left",t="up"===N||"left"===N,ac=0,M=L.queue().length;for(I.effects.createPlaceholder(L),X=L.css(V),ab||(ab=L["top"===V?"outerHeight":"outerWidth"]()/3),U&&(W={opacity:1},W[V]=X,L.css("opacity",0).css(V,t?2*-ab:2*ab).animate(W,Q,R)),S&&(ab/=Math.pow(2,O-1)),W={},W[V]=X;O>ac;ac++){aa={},aa[V]=(t?"-=":"+=")+ab,L.animate(aa,Q,R).animate(W,Q,R),ab=S?2*ab:ab/2}S&&(aa={opacity:0},aa[V]=(t?"-=":"+=")+ab,L.animate(aa,Q,R)),L.queue(T),I.effects.unshift(L,M,Y+1)}),I.effects.define("clip","hide",function(d,g){var v,p={},t=I(this),c=d.direction||"vertical",u="both"===c,f=u||"horizontal"===c,m=u||"vertical"===c;v=t.cssClip(),p.clip={top:m?(v.bottom-v.top)/2:v.top,right:f?(v.right-v.left)/2:v.right,bottom:m?(v.bottom-v.top)/2:v.bottom,left:f?(v.right-v.left)/2:v.left},I.effects.createPlaceholder(t),"show"===d.mode&&(t.cssClip(p.clip),p.clip=v),t.animate(p,{queue:!1,duration:d.duration,easing:d.easing,complete:g})}),I.effects.define("drop","hide",function(g,p){var N,v=I(this),L=g.mode,d="show"===L,M=g.direction||"left",m="up"===M||"down"===M?"top":"left",t="up"===M||"left"===M?"-=":"+=",f="+="===t?"-=":"+=",O={opacity:0};I.effects.createPlaceholder(v),N=g.distance||v["top"===m?"outerHeight":"outerWidth"](!0)/2,O[m]=t+N,d&&(v.css(O),O[m]=f+N,O.opacity=1),v.animate(O,{queue:!1,duration:g.duration,easing:g.easing,complete:p})}),I.effects.define("explode","hide",function(P,T){function aa(){M.push(this),M.length===ab*O&&W()}function W(){Y.css({visibility:"visible"}),I(M).remove(),T()}var X,L,Z,S,U,N,ab=P.pieces?Math.round(Math.sqrt(P.pieces)):3,O=ab,Y=I(this),Q=P.mode,R="show"===Q,V=Y.show().css("visibility","hidden").offset(),t=Math.ceil(Y.outerWidth()/O),ac=Math.ceil(Y.outerHeight()/ab),M=[];for(X=0;ab>X;X++){for(S=V.top+X*ac,N=X-(ab-1)/2,L=0;O>L;L++){Z=V.left+L*t,U=L-(O-1)/2,Y.clone().appendTo("body").wrap("<div></div>").css({position:"absolute",visibility:"visible",left:-L*t,top:-X*ac}).parent().addClass("ui-effects-explode").css({position:"absolute",overflow:"hidden",width:t,height:ac,left:Z+(R?U*t:0),top:S+(R?N*ac:0),opacity:R?0:1}).animate({left:Z+(R?0:U*t),top:S+(R?0:N*ac),opacity:R?1:0},P.duration||500,P.easing,aa)}}}),I.effects.define("fade","toggle",function(a,c){var d="show"===a.mode;I(this).css("opacity",d?0:1).animate({opacity:d?1:0},{queue:!1,duration:a.duration,easing:a.easing,complete:c})}),I.effects.define("fold","hide",function(N,R){var Y=I(this),U=N.mode,V="show"===U,v="hide"===U,X=N.size||15,Q=/([0-9]+)%/.exec(X),S=!!N.horizFirst,L=S?["right","bottom"]:["bottom","right"],Z=N.duration/2,M=I.effects.createPlaceholder(Y),W=Y.cssClip(),O={clip:I.extend({},W)},P={clip:I.extend({},W)},T=[W[L[0]],W[L[1]]],t=Y.queue().length;Q&&(X=parseInt(Q[1],10)/100*T[v?0:1]),O.clip[L[0]]=X,P.clip[L[0]]=X,P.clip[L[1]]=0,V&&(Y.cssClip(P.clip),M&&M.css(I.effects.clipToBox(P)),P.clip=W),Y.queue(function(a){M&&M.animate(I.effects.clipToBox(O),Z,N.easing).animate(I.effects.clipToBox(P),Z,N.easing),a()}).animate(O,Z,N.easing).animate(P,Z,N.easing).queue(R),I.effects.unshift(Y,t,4)}),I.effects.define("highlight","show",function(a,c){var f=I(this),d={backgroundColor:f.css("backgroundColor")};"hide"===a.mode&&(d.opacity=0),I.effects.saveStyle(f),f.css({backgroundImage:"none",backgroundColor:a.color||"#ffff99"}).animate(d,{queue:!1,duration:a.duration,easing:a.easing,complete:c})}),I.effects.define("size",function(O,S){var Z,V,W,L=I(this),Y=["fontSize"],R=["borderTopWidth","borderBottomWidth","paddingTop","paddingBottom"],T=["borderLeftWidth","borderRightWidth","paddingLeft","paddingRight"],M=O.mode,aa="effect"!==M,N=O.scale||"both",X=O.origin||["middle","center"],P=L.css("position"),Q=L.position(),U=I.effects.scaledDimensions(L),t=O.from||U,ab=O.to||I.effects.scaledDimensions(L,0);I.effects.createPlaceholder(L),"show"===M&&(W=t,t=ab,ab=W),V={from:{y:t.height/U.height,x:t.width/U.width},to:{y:ab.height/U.height,x:ab.width/U.width}},("box"===N||"both"===N)&&(V.from.y!==V.to.y&&(t=I.effects.setTransition(L,R,V.from.y,t),ab=I.effects.setTransition(L,R,V.to.y,ab)),V.from.x!==V.to.x&&(t=I.effects.setTransition(L,T,V.from.x,t),ab=I.effects.setTransition(L,T,V.to.x,ab))),("content"===N||"both"===N)&&V.from.y!==V.to.y&&(t=I.effects.setTransition(L,Y,V.from.y,t),ab=I.effects.setTransition(L,Y,V.to.y,ab)),X&&(Z=I.effects.getBaseline(X,U),t.top=(U.outerHeight-t.outerHeight)*Z.y+Q.top,t.left=(U.outerWidth-t.outerWidth)*Z.x+Q.left,ab.top=(U.outerHeight-ab.outerHeight)*Z.y+Q.top,ab.left=(U.outerWidth-ab.outerWidth)*Z.x+Q.left),L.css(t),("content"===N||"both"===N)&&(R=R.concat(["marginTop","marginBottom"]).concat(Y),T=T.concat(["marginLeft","marginRight"]),L.find("*[width]").each(function(){var d=I(this),f=I.effects.scaledDimensions(d),e={height:f.height*V.from.y,width:f.width*V.from.x,outerHeight:f.outerHeight*V.from.y,outerWidth:f.outerWidth*V.from.x},c={height:f.height*V.to.y,width:f.width*V.to.x,outerHeight:f.height*V.to.y,outerWidth:f.width*V.to.x};V.from.y!==V.to.y&&(e=I.effects.setTransition(d,R,V.from.y,e),c=I.effects.setTransition(d,R,V.to.y,c)),V.from.x!==V.to.x&&(e=I.effects.setTransition(d,T,V.from.x,e),c=I.effects.setTransition(d,T,V.to.x,c)),aa&&I.effects.saveStyle(d),d.css(e),d.animate(c,O.duration,O.easing,function(){aa&&I.effects.restoreStyle(d)})})),L.animate(ab,{queue:!1,duration:O.duration,easing:O.easing,complete:function(){var a=L.offset();0===ab.opacity&&L.css("opacity",t.opacity),aa||(L.css("position","static"===P?"relative":P).offset(a),I.effects.saveStyle(L)),S()}})}),I.effects.define("scale",function(d,f){var l=I(this),g=d.mode,h=parseInt(d.percent,10)||(0===parseInt(d.percent,10)?0:"effect"!==g?0:100),c=I.extend(!0,{from:I.effects.scaledDimensions(l),to:I.effects.scaledDimensions(l,h,d.direction||"both"),origin:d.origin||["middle","center"]},d);d.fade&&(c.from.opacity=1,c.to.opacity=0),I.effects.effect.size.call(this,c,f)}),I.effects.define("puff","hide",function(a,c){var d=I.extend(!0,{},a,{fade:!0,percent:parseInt(a.percent,10)||150});I.effects.effect.scale.call(this,d,c)}),I.effects.define("pulsate","show",function(p,v){var P=I(this),M=p.mode,N="show"===M,f="hide"===M,O=N||f,t=2*(p.times||5)+(O?1:0),L=p.duration/t,g=0,Q=1,m=P.queue().length;for((N||!P.is(":visible"))&&(P.css("opacity",0).show(),g=1);t>Q;Q++){P.animate({opacity:g},L,p.easing),g=1-g}P.animate({opacity:g},L,p.easing),P.queue(v),I.effects.unshift(P,m,t+1)}),I.effects.define("shake",function(L,P){var V=1,R=I(this),S=L.direction||"left",m=L.distance||20,U=L.times||3,O=2*U+1,Q=Math.round(L.duration/O),t="up"===S||"down"===S?"top":"left",W="up"===S||"left"===S,v={},T={},M={},N=R.queue().length;for(I.effects.createPlaceholder(R),v[t]=(W?"-=":"+=")+m,T[t]=(W?"+=":"-=")+2*m,M[t]=(W?"-=":"+=")+2*m,R.animate(v,Q,L.easing);U>V;V++){R.animate(T,Q,L.easing).animate(M,Q,L.easing)}R.animate(T,Q,L.easing).animate(v,Q/2,L.easing).queue(P),I.effects.unshift(R,N,O+1)}),I.effects.define("slide","show",function(p,v){var P,M,N=I(this),f={up:["bottom","top"],down:["top","bottom"],left:["right","left"],right:["left","right"]},O=p.mode,t=p.direction||"left",L="up"===t||"down"===t?"top":"left",g="up"===t||"left"===t,Q=p.distance||N["top"===L?"outerHeight":"outerWidth"](!0),m={};I.effects.createPlaceholder(N),P=N.cssClip(),M=N.position()[L],m[L]=(g?-1:1)*Q+M,m.clip=N.cssClip(),m.clip[f[t][1]]=m.clip[f[t][0]],"show"===O&&(N.cssClip(m.clip),N.css(L,m[L]),m.clip=P,m[L]=M),N.animate(m,{queue:!1,duration:p.duration,easing:p.easing,complete:v})});var K;I.uiBackCompat!==!1&&(K=I.effects.define("transfer",function(a,c){I(this).transfer(a,c)}))});(function(a){var c=true;var b=function(g,l){var n=a.extend({},a.fn.nivoSlider.defaults,l);c=!a("html").hasClass("no-webp");var u={currentSlide:0,currentImage:"",totalSlides:0,running:false,paused:false,stop:false,controlNavEl:false};var p=a(g);p.data("nivo:vars",u).addClass("nivoSlider");var j=p.children();a("div.slider.nivoSlider a > img").each(function(w,y){var x=a(y);if(c&&x.attr("data-srcwebp")!=""){x.attr("src",x.attr("data-srcwebp"))}else{x.attr("src",x.attr("data-srcpng"))}});j.each(function(){var i=a(this);var x="";if(!i.is("img")){if(i.is("a")){i.addClass("nivo-imageLink");x=i}i=i.find("img:first")}var w=(w===0)?i.attr("width"):i.width(),v=(v===0)?i.attr("height"):i.height();if(x!==""){x.css("display","none")}i.css("display","none");u.totalSlides++});var r=function(){p.children("img").width(p.width());q.attr("src",u.currentImage.attr("src"));q.stop().height("auto");a(".nivo-slice").remove();a(".nivo-box").remove();if(a("#slider").height()>a("#tmnivoslider").height()){a("#tmnivoslider").height(a("#slider").height()).css("max-height","auto")}};if(n.randomStart){n.startSlide=Math.floor(Math.random()*u.totalSlides)}if(n.startSlide>0){if(n.startSlide>=u.totalSlides){n.startSlide=u.totalSlides-1}u.currentSlide=n.startSlide}if(a(j[u.currentSlide]).is("img")){u.currentImage=a(j[u.currentSlide])}else{u.currentImage=a(j[u.currentSlide]).find("img:first")}if(a(j[u.currentSlide]).is("a")){a(j[u.currentSlide]).css("display","block")}var q=a("<img/>").addClass("nivo-main-image");q.attr("alt",u.currentImage.attr("alt"));q.attr("src",u.currentImage.attr("src")).show();p.append(q);a(window).resize(function(){r()});p.append(a('<div class="nivo-caption"></div>'));var m=function(v){var i=a(".nivo-caption",p);if(u.currentImage.attr("title")!=""&&u.currentImage.attr("title")!=undefined){var w=u.currentImage.attr("title");if(w.substr(0,1)=="#"){w=a(w).html()}if(i.css("display")=="block"){setTimeout(function(){i.html(w)},v.animSpeed)}else{i.html(w);i.stop().fadeIn(v.animSpeed)}}else{i.stop().fadeOut(v.animSpeed)}};m(n);var s=0;if(!n.manualAdvance&&j.length>1){s=setInterval(function(){k(p,j,n,false)},n.pauseTime)}if(n.directionNav){p.append('<div class="nivo-directionNav"><a class="nivo-prevNav">'+n.prevText+'</a><a class="nivo-nextNav">'+n.nextText+"</a></div>");a("a.nivo-prevNav").click(function(){if(n.queue==true&&u.running){return false}clearInterval(s);s="";u.currentSlide-=2;k(p,j,n,"prev");u.running=false;r()});a("a.nivo-nextNav").click(function(){if(n.queue==true&&u.running){return false}clearInterval(s);s="";k(p,j,n,"next");u.running=false;r()})}if(n.controlNav){u.controlNavEl=a('<div class="nivo-controlNav"></div>');p.after(u.controlNavEl);for(var h=0;h<j.length;h++){if(n.controlNavThumbs){u.controlNavEl.addClass("nivo-thumbs-enabled");var d=j.eq(h);if(!d.is("img")){d=d.find("img:first")}if(d.attr("data-thumb")){u.controlNavEl.append('<a href="#" class="nivo-control" rel="'+h+'"><img src="'+d.attr("data-thumb")+'" alt="" /></a>')}}else{u.controlNavEl.append('<a href="#" class="nivo-control" rel="'+h+'">'+(h+1)+"</a>")}}a("a:eq("+u.currentSlide+")",u.controlNavEl).addClass("active");a("a",u.controlNavEl).bind("click",function(){if(a(this).hasClass("active")){return false}clearInterval(s);s="";q.attr("src",u.currentImage.attr("src"));u.currentSlide=a(this).attr("rel")-1;k(p,j,n,"control");u.running=false;r()})}if(n.pauseOnHover){p.hover(function(){u.paused=true;clearInterval(s);s=""},function(){u.paused=false;if(s===""&&!n.manualAdvance){s=setInterval(function(){k(p,j,n,false)},n.pauseTime)}})}p.bind("nivo:animFinished",function(){q.attr("src",u.currentImage.attr("src"));u.running=false;a(j).each(function(){if(a(this).is("a")){a(this).css("display","none")}});if(a(j[u.currentSlide]).is("a")){a(j[u.currentSlide]).css("display","block")}if(s===""&&!u.paused&&!n.manualAdvance){s=setInterval(function(){k(p,j,n,false)},n.pauseTime)}n.afterChange.call(this)});var f=function(z,w,A){if(a(A.currentImage).parent().is("a")){a(A.currentImage).parent().parent().find("a.nivo-imageLink").css("display","none");a(A.currentImage).parent().css("display","block")}a('img[src="'+A.currentImage.attr("src")+'"]',z).not(".nivo-main-image,.nivo-control img").width(z.width()).css("visibility","hidden").show();a('img[src="'+A.currentImage.attr("src")+'"]',z).css({display:"none"});var x=(a('img[src="'+A.currentImage.attr("src")+'"]',z).not(".nivo-main-image,.nivo-control img").parent().is("a"))?a('img[src="'+A.currentImage.attr("src")+'"]',z).not(".nivo-main-image,.nivo-control img").parent().height():a('img[src="'+A.currentImage.attr("src")+'"]',z).not(".nivo-main-image,.nivo-control img").height();for(var v=0;v<w.slices;v++){var y=Math.round(z.width()/w.slices);if(v===w.slices-1){z.append(a('<div class="nivo-slice" name="'+v+'"><img src="'+A.currentImage.attr("src")+'" style="position:absolute; width:'+z.width()+"px; height:auto; display:block !important; top:0; left:-"+((y+(v*y))-y)+'px;" /></div>').css({left:(y*v)+"px",width:(z.width()-(y*v))+"px",height:x+"px",opacity:"0",overflow:"hidden"}))}else{z.append(a('<div class="nivo-slice" name="'+v+'"><img src="'+A.currentImage.attr("src")+'" style="position:absolute; width:'+z.width()+"px; height:auto; display:block !important; top:0; left:-"+((y+(v*y))-y)+'px;" /></div>').css({left:(y*v)+"px",width:y+"px",height:x+"px",opacity:"0",overflow:"hidden"}))}}a(".nivo-slice",z).height(x);q.stop().animate({height:a(A.currentImage).height()},{duration:w.animSpeed,queue:w.queue});r()};var e=function(z,y,A){if(a(A.currentImage).parent().is("a")){a(A.currentImage).parent().css("display","block")}a('img[src="'+A.currentImage.attr("src")+'"]',z).not(".nivo-main-image,.nivo-control img").width(z.width()).css("visibility","hidden").show();var v=Math.round(z.width()/y.boxCols),i=Math.round(a('img[src="'+A.currentImage.attr("src")+'"]',z).not(".nivo-main-image,.nivo-control img").height()/y.boxRows);for(var x=0;x<y.boxRows;x++){for(var w=0;w<y.boxCols;w++){if(w===y.boxCols-1){z.append(a('<div class="nivo-box" name="'+w+'" rel="'+x+'"><img src="'+A.currentImage.attr("src")+'" style="position:absolute; width:'+z.width()+"px; height:auto; display:block; top:-"+(i*x)+"px; left:-"+(v*w)+'px;" /></div>').css({opacity:0,left:(v*w)+"px",top:(i*x)+"px",width:(z.width()-(v*w))+"px"}));a('.nivo-box[name="'+w+'"]',z).height(a('.nivo-box[name="'+w+'"] img',z).height()+"px")}else{z.append(a('<div class="nivo-box" name="'+w+'" rel="'+x+'"><img src="'+A.currentImage.attr("src")+'" style="position:absolute; width:'+z.width()+"px; height:auto; display:block; top:-"+(i*x)+"px; left:-"+(v*w)+'px;" /></div>').css({opacity:0,left:(v*w)+"px",top:(i*x)+"px",width:v+"px"}));a('.nivo-box[name="'+w+'"]',z).height(a('.nivo-box[name="'+w+'"] img',z).height()+"px")}}}q.stop().animate({height:a(A.currentImage).height()},{duration:y.animSpeed,queue:y.queue})};var k=function(L,E,J,F){var P=L.data("nivo:vars");if(P&&(P.currentSlide===P.totalSlides-1)){J.lastSlide.call(this)}if((!P||P.stop)&&!F){return false}J.beforeChange.call(this,J);if(/267.png$/.test(a(".nivo-main-image").attr("src"))){J.pauseTime=6000}else{J.pauseTime=4000}if(!F){q.attr("src",P.currentImage.attr("src"))}else{if(F==="prev"){q.attr("src",P.currentImage.attr("src"))}if(F==="next"){q.attr("src",P.currentImage.attr("src"))}}P.currentSlide++;if(P.currentSlide===P.totalSlides){P.currentSlide=0;J.slideshowEnd.call(this)}if(P.currentSlide<0){P.currentSlide=(P.totalSlides-1)}if(a(E[P.currentSlide]).is("img")){P.currentImage=a(E[P.currentSlide])}else{P.currentImage=a(E[P.currentSlide]).find("img:first")}if(J.controlNav){a("a",P.controlNavEl).removeClass("active");a("a:eq("+P.currentSlide+")",P.controlNavEl).addClass("active")}m(J);a(".nivo-slice",L).remove();a(".nivo-box",L).remove();var B=J.effect,w="";if(J.effect==="random"){w=new Array("sliceDownRight","sliceDownLeft","sliceUpRight","sliceUpLeft","sliceUpDown","sliceUpDownLeft","fold","fade","boxRandom","boxRain","boxRainReverse","boxRainGrow","boxRainGrowReverse");B=w[Math.floor(Math.random()*(w.length+1))];if(B===undefined){B="fade"}}if(J.effect.indexOf(",")!==-1){w=J.effect.split(",");B=w[Math.floor(Math.random()*(w.length))];if(B===undefined){B="fade"}}if(P.currentImage.attr("data-transition")){B=P.currentImage.attr("data-transition")}P.running=true;var M=0,D=0,K="",C="",N="",y="";if(B==="sliceDown"||B==="sliceDownRight"||B==="sliceDownLeft"){f(L,J,P);M=0;D=0;K=a(".nivo-slice",L);if(B==="sliceDownLeft"){K=a(".nivo-slice",L)._reverse()}K.each(function(){var i=a(this);i.css({top:"0px"});if(D===J.slices-1){setTimeout(function(){i.animate({opacity:"1.0"},{duration:J.animSpeed,queue:J.queue},"",function(){L.trigger("nivo:animFinished")})},(100+M))}else{setTimeout(function(){i.animate({opacity:"1.0"},{duration:J.animSpeed,queue:J.queue})},(100+M))}M+=50;D++})}else{if(B==="sliceUp"||B==="sliceUpRight"||B==="sliceUpLeft"){f(L,J,P);M=0;D=0;K=a(".nivo-slice",L);if(B==="sliceUpLeft"){K=a(".nivo-slice",L)._reverse()}K.each(function(){var i=a(this);i.css({bottom:"0px"});if(D===J.slices-1){setTimeout(function(){i.animate({opacity:"1.0"},{duration:J.animSpeed,queue:J.queue},"",function(){L.trigger("nivo:animFinished")})},(100+M))}else{setTimeout(function(){i.animate({opacity:"1.0"},{duration:J.animSpeed,queue:J.queue})},(100+M))}M+=50;D++})}else{if(B==="sliceUpDown"||B==="sliceUpDownRight"||B==="sliceUpDownLeft"){f(L,J,P);M=0;D=0;var O=0;K=a(".nivo-slice",L);if(B==="sliceUpDownLeft"){K=a(".nivo-slice",L)._reverse()}K.each(function(){var i=a(this);if(D===0){i.css("top","0px");D++}else{i.css("bottom","0px");D=0}if(O===J.slices-1){setTimeout(function(){i.animate({opacity:"1.0"},{duration:J.animSpeed,queue:J.queue},"",function(){L.trigger("nivo:animFinished")})},(100+M))}else{setTimeout(function(){i.animate({opacity:"1.0"},{duration:J.animSpeed,queue:J.queue})},(100+M))}M+=50;O++})}else{if(B==="fold"){f(L,J,P);M=0;D=0;a(".nivo-slice",L).each(function(){var v=a(this);var i=v.width();v.css({top:"0px",width:"0px"});if(D===J.slices-1){setTimeout(function(){v.animate({width:i,opacity:"1.0"},{duration:J.animSpeed,queue:J.queue},"",function(){L.trigger("nivo:animFinished")})},(100+M))}else{setTimeout(function(){v.animate({width:i,opacity:"1.0"},{duration:J.animSpeed,queue:J.queue})},(100+M))}M+=50;D++})}else{if(B==="fade"){f(L,J,P);C=a(".nivo-slice:first",L);C.css({width:L.width()+"px"});C.animate({opacity:"1.0"},{duration:(J.animSpeed*2),queue:J.queue},"",function(){L.trigger("nivo:animFinished")})}else{if(B==="slideInRight"){f(L,J,P);C=a(".nivo-slice:first",L);C.css({width:"0px",opacity:"1"});C.animate({width:L.width()+"px"},{duration:(J.animSpeed*2),queue:J.queue},"",function(){L.trigger("nivo:animFinished")})}else{if(B==="slideInLeft"){f(L,J,P);C=a(".nivo-slice:first",L);C.css({width:"0px",opacity:"1",left:"",right:"0px"});C.animate({width:L.width()+"px"},{duration:(J.animSpeed*2),queue:J.queue},"",function(){C.css({left:"0px",right:""});L.trigger("nivo:animFinished")})}else{if(B==="boxRandom"){e(L,J,P);N=J.boxCols*J.boxRows;D=0;M=0;y=o(a(".nivo-box",L));y.each(function(){var i=a(this);if(D===N-1){setTimeout(function(){i.animate({opacity:"1"},{duration:J.animSpeed,queue:J.queue},"",function(){L.trigger("nivo:animFinished")})},(100+M))}else{setTimeout(function(){i.animate({opacity:"1"},{duration:J.animSpeed,queue:J.queue})},(100+M))}M+=20;D++})}else{if(B==="boxRain"||B==="boxRainReverse"||B==="boxRainGrow"||B==="boxRainGrowReverse"){e(L,J,P);N=J.boxCols*J.boxRows;D=0;M=0;var H=0;var z=0;var x=[];x[H]=[];y=a(".nivo-box",L);if(B==="boxRainReverse"||B==="boxRainGrowReverse"){y=a(".nivo-box",L)._reverse()}y.each(function(){x[H][z]=a(this);z++;if(z===J.boxCols){H++;z=0;x[H]=[]}});for(var A=0;A<(J.boxCols*2);A++){var G=A;for(var I=0;I<J.boxRows;I++){if(G>=0&&G<J.boxCols){(function(T,Q,U,S,V){var v=a(x[T][Q]);var W=v.width();var R=v.height();if(B==="boxRainGrow"||B==="boxRainGrowReverse"){v.width(0).height(0)}if(S===V-1){setTimeout(function(){v.animate({opacity:"1",width:W,height:R},{duration:J.animSpeed/1.3,queue:J.queue},"",function(){L.trigger("nivo:animFinished")})},(100+U))}else{setTimeout(function(){v.animate({opacity:"1",width:W,height:R},{duration:J.animSpeed/1.3,queue:J.queue})},(100+U))}})(I,G,M,D,N);D++}G--}M+=100}}}}}}}}}}};var o=function(v){for(var y,z,w=v.length;w;y=parseInt(Math.random()*w,10),z=v[--w],v[w]=v[y],v[y]=z){}return v};var t=function(i){if(this.console&&typeof console.log!=="undefined"){console.log(i)}};this.stop=function(){if(!a(g).data("nivo:vars").stop){a(g).data("nivo:vars").stop=true;t("Stop Slider")}};this.start=function(){if(a(g).data("nivo:vars").stop){a(g).data("nivo:vars").stop=false;t("Start Slider")}};n.afterLoad.call(this);return this};a.fn.nivoSlider=function(d){return this.each(function(f,h){var e=a(this);if(e.data("nivoslider")){return e.data("nivoslider")}var g=new b(this,d);Global.sliderObject=g;e.data("nivoslider",g)})};a.fn.nivoSlider.defaults={effect:"random",slices:15,boxCols:8,boxRows:4,queue:true,animSpeed:500,pauseTime:6000,startSlide:0,directionNav:true,controlNav:true,controlNavThumbs:false,pauseOnHover:true,manualAdvance:false,prevText:"Prev",nextText:"Next",randomStart:false,beforeChange:function(){},afterChange:function(){},slideshowEnd:function(){},lastSlide:function(){},afterLoad:function(){}};a.fn._reverse=[].reverse})(jQuery);(function(a){var T,E,K,U,J,v,u,Q,H,I,M=0,N={},L=[],x=0,y={},w=[],s=null,B=new Image(),C=/\.(jpg|gif|png|bmp|jpeg)(.*)?$/i,P=/[^\.]\.(swf)\s*$/i,G,F=1,R=0,S="",O,z,t=false,A=a.extend(a("<div/>")[0],{prop:0}),D=navigator.userAgent.match(/msie [6]/i)&&!window.XMLHttpRequest,b=function(){E.hide();B.onerror=B.onload=null;if(s){s.abort()}T.empty()},e=function(){if(false===N.onError(L,M,N)){E.hide();t=false;return}N.titleShow=false;N.width="auto";N.height="auto";T.html('<p id="fancybox-error">The requested content cannot be loaded.<br />Please try again later.</p>');n()},r=function(){var X=L[M],W,ab,aa,Z,V,Y;b();N=a.extend({},a.fn.fancybox.defaults,(typeof a(X).data("fancybox")=="undefined"?N:a(X).data("fancybox")));Y=N.onStart(L,M,N);if(Y===false){t=false;return}else{if(typeof Y=="object"){N=a.extend(N,Y)}}aa=N.title||(X.nodeName?a(X).attr("title"):X.title)||"";if(X.nodeName&&!N.orig){N.orig=a(X).children("img:first").length?a(X).children("img:first"):a(X)}if(aa===""&&N.orig&&N.titleFromAlt){aa=N.orig.attr("alt")}W=N.href||(X.nodeName?a(X).attr("href"):X.href)||null;if((/^(?:javascript)/i).test(W)||W=="#"){W=null}if(N.type){ab=N.type;if(!W){W=N.content}}else{if(N.content){ab="html"}else{if(W){if(W.match(C)){ab="image"}else{if(W.match(P)){ab="swf"}else{if(a(X).hasClass("iframe")){ab="iframe"}else{if(W.indexOf("#")===0){ab="inline"}else{ab="ajax"}}}}}}}if(!ab){e();return}if(ab=="inline"){X=W.substr(W.indexOf("#"));ab=a(X).length>0?"inline":"ajax"}N.type=ab;N.href=W;N.title=aa;if(N.autoDimensions){if(N.type=="html"||N.type=="inline"||N.type=="ajax"){N.width="auto";N.height="auto"}else{N.autoDimensions=false}}if(N.modal){N.overlayShow=true;N.hideOnOverlayClick=false;N.hideOnContentClick=false;N.enableEscapeButton=false;N.showCloseButton=false}N.padding=parseInt(N.padding,10);N.margin=parseInt(N.margin,10);T.css("padding",(N.padding+N.margin));a(".fancybox-inline-tmp").unbind("fancybox-cancel").bind("fancybox-change",function(){a(this).replaceWith(v.children())});switch(ab){case"html":T.html(N.content);n();break;case"inline":if(a(X).parent().is("#fancybox-content")===true){t=false;return}a('<div class="fancybox-inline-tmp" />').hide().insertBefore(a(X)).bind("fancybox-cleanup",function(){a(this).replaceWith(v.children())}).bind("fancybox-cancel",function(){a(this).replaceWith(T.children())});a(X).appendTo(T);n();break;case"image":t=false;a.fancybox.showActivity();B=new Image();B.onerror=function(){e()};B.onload=function(){t=true;B.onerror=B.onload=null;m()};B.src=W;break;case"swf":N.scrolling="no";Z='<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" width="'+N.width+'" height="'+N.height+'"><param name="movie" value="'+W+'"></param>';V="";a.each(N.swf,function(ac,ad){Z+='<param name="'+ac+'" value="'+ad+'"></param>';V+=" "+ac+'="'+ad+'"'});Z+='<embed src="'+W+'" type="application/x-shockwave-flash" width="'+N.width+'" height="'+N.height+'"'+V+"></embed></object>";T.html(Z);n();break;case"ajax":t=false;a.fancybox.showActivity();N.ajax.win=N.ajax.success;s=a.ajax(a.extend({},N.ajax,{url:W,data:N.ajax.data||{},error:function(ae,ad,ac){if(ae.status>0){e()}},success:function(ac,ae,af){var ad=typeof af=="object"?af:s;if(ad.status==200){if(typeof N.ajax.win=="function"){Y=N.ajax.win(W,ac,ae,af);if(Y===false){E.hide();return}else{if(typeof Y=="string"||typeof Y=="object"){ac=Y}}}T.html(ac);n()}}}));break;case"iframe":q();break}},n=function(){var W=N.width,V=N.height;if(W.toString().indexOf("%")>-1){W=parseInt((a(window).width()-(N.margin*2))*parseFloat(W)/100,10)+"px"}else{W=W=="auto"?"auto":W+"px"}if(V.toString().indexOf("%")>-1){V=parseInt((a(window).height()-(N.margin*2))*parseFloat(V)/100,10)+"px"}else{V=V=="auto"?"auto":V+"px"}T.wrapInner('<div style="width:'+W+";height:"+V+";overflow: "+(N.scrolling=="auto"?"auto":(N.scrolling=="yes"?"scroll":"hidden"))+';position:relative;"></div>');N.width=T.width();N.height=T.height();q()},m=function(){N.width=B.width;N.height=B.height;a("<img />").attr({id:"fancybox-img",src:B.src,alt:N.title}).appendTo(T);q()},q=function(){var W,V;E.hide();if(U.is(":visible")&&false===y.onCleanup(w,x,y)){a.event.trigger("fancybox-cancel");t=false;return}t=true;a(v.add(K)).unbind();a(window).unbind("resize.fb scroll.fb");a(document).unbind("keydown.fb");if(U.is(":visible")&&y.titlePosition!=="outside"){U.css("height",U.height())}w=L;x=M;y=N;if(y.overlayShow){K.css({"background-color":y.overlayColor,opacity:y.overlayOpacity,cursor:y.hideOnOverlayClick?"pointer":"auto",height:a(document).height()});if(!K.is(":visible")){if(D){a("select:not(#fancybox-tmp select)").filter(function(){return this.style.visibility!=="hidden"}).css({visibility:"hidden"}).one("fancybox-cleanup",function(){this.style.visibility="inherit"})}K.show()}}else{K.hide()}z=k();o();if(U.is(":visible")){a(u.add(H).add(I)).hide();W=U.position(),O={top:W.top,left:W.left,width:U.width(),height:U.height()};V=(O.width==z.width&&O.height==z.height);v.fadeTo(y.changeFade,0.3,function(){var X=function(){v.html(T.contents()).fadeTo(y.changeFade,1,f)};a.event.trigger("fancybox-change");v.empty().removeAttr("filter").css({"border-width":y.padding,width:z.width-y.padding*2,height:N.autoDimensions?"auto":z.height-R-y.padding*2});if(V){X()}else{A.prop=0;a(A).animate({prop:1},{duration:y.changeSpeed,easing:y.easingChange,step:d,complete:X})}});return}U.removeAttr("style");v.css("border-width",y.padding);if(y.transitionIn=="elastic"){O=j();v.html(T.contents());U.show();if(y.opacity){z.opacity=0}A.prop=0;a(A).animate({prop:1},{duration:y.speedIn,easing:y.easingIn,step:d,complete:f});return}if(y.titlePosition=="inside"&&R>0){Q.show()}v.css({width:z.width-y.padding*2,height:N.autoDimensions?"auto":z.height-R-y.padding*2}).html(T.contents());U.css(z).fadeIn(y.transitionIn=="none"?0:y.speedIn,f)},g=function(V){if(V&&V.length){if(y.titlePosition=="float"){return'<table id="fancybox-title-float-wrap" cellpadding="0" cellspacing="0"><tr><td id="fancybox-title-float-left"></td><td id="fancybox-title-float-main">'+V+'</td><td id="fancybox-title-float-right"></td></tr></table>'}return'<div id="fancybox-title-'+y.titlePosition+'">'+V+"</div>"}return false},o=function(){S=y.title||"";R=0;Q.empty().removeAttr("style").removeClass();if(y.titleShow===false){Q.hide();return}S=a.isFunction(y.titleFormat)?y.titleFormat(S,w,x,y):g(S);if(!S||S===""){Q.hide();return}Q.addClass("fancybox-title-"+y.titlePosition).html(S).appendTo("body").show();switch(y.titlePosition){case"inside":Q.css({width:z.width-(y.padding*2),marginLeft:y.padding,marginRight:y.padding});R=Q.outerHeight(true);Q.appendTo(J);z.height+=R;break;case"over":Q.css({marginLeft:y.padding,width:z.width-(y.padding*2),bottom:y.padding}).appendTo(J);break;case"float":Q.css("left",parseInt((Q.width()-z.width-40)/2,10)*-1).appendTo(U);break;default:Q.css({width:z.width-(y.padding*2),paddingLeft:y.padding,paddingRight:y.padding}).appendTo(U);break}Q.hide()},p=function(){if(y.enableEscapeButton||y.enableKeyboardNav){a(document).bind("keydown.fb",function(V){if(V.keyCode==27&&y.enableEscapeButton){V.preventDefault();a.fancybox.close()}else{if((V.keyCode==37||V.keyCode==39)&&y.enableKeyboardNav&&V.target.tagName!=="INPUT"&&V.target.tagName!=="TEXTAREA"&&V.target.tagName!=="SELECT"){V.preventDefault();a.fancybox[V.keyCode==37?"prev":"next"]()}}})}if(!y.showNavArrows){H.hide();I.hide();return}if((y.cyclic&&w.length>1)||x!==0){H.show()}if((y.cyclic&&w.length>1)||x!=(w.length-1)){I.show()}},f=function(){if(!a.support.opacity){v.get(0).style.removeAttribute("filter");U.get(0).style.removeAttribute("filter")}if(N.autoDimensions){v.css("height","auto")}U.css("height","auto");if(S&&S.length){Q.show()}if(y.showCloseButton){u.show()}p();if(y.hideOnContentClick){v.bind("click",a.fancybox.close)}if(y.hideOnOverlayClick){K.bind("click",a.fancybox.close)}a(window).bind("resize.fb",a.fancybox.resize);if(y.centerOnScroll){a(window).bind("scroll.fb",a.fancybox.center)}if(y.type=="iframe"){a('<iframe id="fancybox-frame" name="fancybox-frame'+new Date().getTime()+'" frameborder="0" hspace="0" '+(navigator.userAgent.match(/msie [6]/i)?'allowtransparency="true""':"")+' scrolling="'+N.scrolling+'" src="'+y.href+'"></iframe>').appendTo(v)}U.show();t=false;a.fancybox.center();y.onComplete(w,x,y);l()},l=function(){var V,W;if((w.length-1)>x){V=w[x+1].href;if(typeof V!=="undefined"&&V.match(C)){W=new Image();W.src=V}}if(x>0){V=w[x-1].href;if(typeof V!=="undefined"&&V.match(C)){W=new Image();W.src=V}}},d=function(W){var V={width:parseInt(O.width+(z.width-O.width)*W,10),height:parseInt(O.height+(z.height-O.height)*W,10),top:parseInt(O.top+(z.top-O.top)*W,10),left:parseInt(O.left+(z.left-O.left)*W,10)};if(typeof z.opacity!=="undefined"){V.opacity=W<0.5?0.5:W}U.css(V);v.css({width:V.width-y.padding*2,height:V.height-(R*W)-y.padding*2})},i=function(){return[a(window).width()-(y.margin*2),a(window).height()-(y.margin*2),a(document).scrollLeft()+y.margin,a(document).scrollTop()+y.margin]},k=function(){var Z=i(),Y={},X=y.autoScale,V=y.padding*2,W;if(y.width.toString().indexOf("%")>-1){Y.width=parseInt((Z[0]*parseFloat(y.width))/100,10)}else{Y.width=y.width+V}if(y.height.toString().indexOf("%")>-1){Y.height=parseInt((Z[1]*parseFloat(y.height))/100,10)}else{Y.height=y.height+V}if(X&&(Y.width>Z[0]||Y.height>Z[1])){if(N.type=="image"||N.type=="swf"){W=(y.width)/(y.height);if((Y.width)>Z[0]){Y.width=Z[0];Y.height=parseInt(((Y.width-V)/W)+V,10)}if((Y.height)>Z[1]){Y.height=Z[1];Y.width=parseInt(((Y.height-V)*W)+V,10)}}else{Y.width=Math.min(Y.width,Z[0]);Y.height=Math.min(Y.height,Z[1])}}Y.top=parseInt(Math.max(Z[3]-20,Z[3]+((Z[1]-Y.height-40)*0.5)),10);Y.left=parseInt(Math.max(Z[2]-20,Z[2]+((Z[0]-Y.width-40)*0.5)),10);return Y},h=function(V){var W=V.offset();W.top+=parseInt(V.css("paddingTop"),10)||0;W.left+=parseInt(V.css("paddingLeft"),10)||0;W.top+=parseInt(V.css("border-top-width"),10)||0;W.left+=parseInt(V.css("border-left-width"),10)||0;W.width=V.width();W.height=V.height();return W},j=function(){var W=N.orig?a(N.orig):false,V={},X,Y;if(W&&W.length){X=h(W);V={width:X.width+(y.padding*2),height:X.height+(y.padding*2),top:X.top-y.padding-20,left:X.left-y.padding-20}}else{Y=i();V={width:y.padding*2,height:y.padding*2,top:parseInt(Y[3]+Y[1]*0.5,10),left:parseInt(Y[2]+Y[0]*0.5,10)}}return V},c=function(){if(!E.is(":visible")){clearInterval(G);return}a("div",E).css("top",(F*-40)+"px");F=(F+1)%12};a.fn.fancybox=function(V){if(!a(this).length){return this}a(this).data("fancybox",a.extend({},V,(a.metadata?a(this).metadata():{}))).unbind("click.fb").bind("click.fb",function(W){W.preventDefault();if(t){return}t=true;a(this).blur();L=[];M=0;var X=a(this).attr("rel")||"";if(!X||X==""||X==="nofollow"){L.push(this)}else{L=a("a[rel="+X+"], area[rel="+X+"]");M=L.index(this)}r();return});return this};a.fancybox=function(X){var Y;if(t){return}t=true;Y=typeof arguments[1]!=="undefined"?arguments[1]:{};L=[];M=parseInt(Y.index,10)||0;if(a.isArray(X)){for(var V=0,W=X.length;V<W;V++){if(typeof X[V]=="object"){a(X[V]).data("fancybox",a.extend({},Y,X[V]))}else{X[V]=a({}).data("fancybox",a.extend({content:X[V]},Y))}}L=jQuery.merge(L,X)}else{if(typeof X=="object"){a(X).data("fancybox",a.extend({},Y,X))}else{X=a({}).data("fancybox",a.extend({content:X},Y))}L.push(X)}if(M>L.length||M<0){M=0}r()};a.fancybox.showActivity=function(){clearInterval(G);E.show();G=setInterval(c,66)};a.fancybox.hideActivity=function(){E.hide()};a.fancybox.next=function(){return a.fancybox.pos(x+1)};a.fancybox.prev=function(){return a.fancybox.pos(x-1)};a.fancybox.pos=function(V){if(t){return}V=parseInt(V);L=w;if(V>-1&&V<w.length){M=V;r()}else{if(y.cyclic&&w.length>1){M=V>=w.length?0:w.length-1;r()}}return};a.fancybox.cancel=function(){if(t){return}t=true;a.event.trigger("fancybox-cancel");b();N.onCancel(L,M,N);t=false};a.fancybox.close=function(){if(t||U.is(":hidden")){return}t=true;if(y&&false===y.onCleanup(w,x,y)){t=false;return}b();a(u.add(H).add(I)).hide();a(v.add(K)).unbind();a(window).unbind("resize.fb scroll.fb");a(document).unbind("keydown.fb");v.find("iframe").attr("src",D&&/^https/i.test(window.location.href||"")?"javascript:void(false)":"about:blank");if(y.titlePosition!=="inside"){Q.empty()}U.stop();function V(){K.fadeOut("fast");Q.empty().hide();U.hide();a.event.trigger("fancybox-cleanup");v.empty();y.onClosed(w,x,y);w=N=[];x=M=0;y=N={};t=false}if(y.transitionOut=="elastic"){O=j();var W=U.position();z={top:W.top,left:W.left,width:U.width(),height:U.height()};if(y.opacity){z.opacity=1}Q.empty().hide();A.prop=1;a(A).animate({prop:0},{duration:y.speedOut,easing:y.easingOut,step:d,complete:V})}else{U.fadeOut(y.transitionOut=="none"?0:y.speedOut,V)}};a.fancybox.resize=function(){if(K.is(":visible")){K.css("height",a(document).height())}a.fancybox.center(true)};a.fancybox.center=function(){var W,V;if(t){return}V=arguments[0]===true?1:0;W=i();if(!V&&(U.width()>W[0]||U.height()>W[1])){return}U.stop().animate({top:parseInt(Math.max(W[3]-20,W[3]+((W[1]-v.height()-40)*0.5)-y.padding)),left:parseInt(Math.max(W[2]-20,W[2]+((W[0]-v.width()-40)*0.5)-y.padding))},typeof arguments[0]=="number"?arguments[0]:200)};a.fancybox.init=function(){if(a("#fancybox-wrap").length){return}a("body").append(T=a('<div id="fancybox-tmp"></div>'),E=a('<div id="fancybox-loading"><div></div></div>'),K=a('<div id="fancybox-overlay"></div>'),U=a('<div id="fancybox-wrap"></div>'));J=a('<div id="fancybox-outer"></div>').append('<div class="fancybox-bg" id="fancybox-bg-n"></div><div class="fancybox-bg" id="fancybox-bg-ne"></div><div class="fancybox-bg" id="fancybox-bg-e"></div><div class="fancybox-bg" id="fancybox-bg-se"></div><div class="fancybox-bg" id="fancybox-bg-s"></div><div class="fancybox-bg" id="fancybox-bg-sw"></div><div class="fancybox-bg" id="fancybox-bg-w"></div><div class="fancybox-bg" id="fancybox-bg-nw"></div>').appendTo(U);J.append(v=a('<div id="fancybox-content"></div>'),u=a('<a id="fancybox-close"></a>'),Q=a('<div id="fancybox-title"></div>'),H=a('<a href="javascript:;" id="fancybox-left"><span class="fancy-ico" id="fancybox-left-ico"></span></a>'),I=a('<a href="javascript:;" id="fancybox-right"><span class="fancy-ico" id="fancybox-right-ico"></span></a>'));u.click(a.fancybox.close);E.click(a.fancybox.cancel);H.click(function(V){V.preventDefault();a.fancybox.prev()});I.click(function(V){V.preventDefault();a.fancybox.next()});if(a.fn.mousewheel){U.bind("mousewheel.fb",function(W,V){if(t){W.preventDefault()}else{if(a(W.target).get(0).clientHeight==0||a(W.target).get(0).scrollHeight===a(W.target).get(0).clientHeight){W.preventDefault();a.fancybox[V>0?"prev":"next"]()}}})}if(!a.support.opacity){U.addClass("fancybox-ie")}if(D){E.addClass("fancybox-ie6");U.addClass("fancybox-ie6");a('<iframe id="fancybox-hide-sel-frame" src="'+(/^https/i.test(window.location.href||"")?"javascript:void(false)":"about:blank")+'" scrolling="no" border="0" frameborder="0" tabindex="-1"></iframe>').prependTo(J)}};a.fn.fancybox.defaults={padding:10,margin:40,opacity:false,modal:false,cyclic:false,scrolling:"auto",width:560,height:340,autoScale:true,autoDimensions:true,centerOnScroll:false,ajax:{},swf:{wmode:"transparent"},hideOnOverlayClick:true,hideOnContentClick:false,overlayShow:true,overlayOpacity:0.7,overlayColor:"#777",titleShow:true,titlePosition:"float",titleFormat:null,titleFromAlt:false,transitionIn:"fade",transitionOut:"fade",speedIn:300,speedOut:300,changeSpeed:300,changeFade:"fast",easingIn:"swing",easingOut:"swing",showCloseButton:true,showNavArrows:true,enableEscapeButton:true,enableKeyboardNav:true,onStart:function(){},onCancel:function(){},onComplete:function(){},onCleanup:function(){},onClosed:function(){},onError:function(){}};a(document).ready(function(){a.fancybox.init()})})(jQuery);!function(a,b){"function"==typeof define&&define.amd?define(function(){return b(a)}):"object"==typeof module&&module.exports?module.exports=b(a):a.ss=b(a)}("undefined"!=typeof window?window:this,function(j){var A,z=j.ss||{},v=/^\s+/,m=/\s+$/,w=/[xy]/g,y=/.*(\/|\\)/,b=/.*[.]/,B=/[\t\r\n]/g,q=Object.prototype.toString.call(j.HTMLElement).indexOf("Constructor")>0,g=-1!==navigator.userAgent.indexOf("MSIE 7"),f=document.createElement("input");f.type="file",A="multiple" in f&&"undefined"!=typeof File&&"undefined"!=typeof(new XMLHttpRequest).upload,z.obj2string=function(a,p){var d=[];for(var c in a){if(a.hasOwnProperty(c)){var h=p?p+"["+c+"]":c,l=a[c];d.push("object"==typeof l?z.obj2string(l,h):encodeURIComponent(h)+"="+encodeURIComponent(l))}}return d.join("&")},z.extendObj=function(a,d){for(var c in d){d.hasOwnProperty(c)&&(a[c]=d[c])}},z.addEvent=function(a,d,c){return a.addEventListener?a.addEventListener(d,c,!1):a.attachEvent("on"+d,c),function(){z.removeEvent(a,d,c)}},z.removeEvent=document.removeEventListener?function(a,d,c){a.removeEventListener&&a.removeEventListener(d,c,!1)}:function(a,h,d){var c="on"+h;"undefined"==typeof a[c]&&(a[c]=null),a.detachEvent(c,d)},z.newXHR=function(){if("undefined"!=typeof XMLHttpRequest){return new j.XMLHttpRequest}if(j.ActiveXObject){try{return new j.ActiveXObject("Microsoft.XMLHTTP")}catch(a){return !1}}},z.encodeUTF8=function(a){return unescape(encodeURIComponent(a))},z.getIFrame=function(){var a,c=z.getUID();return g?a=document.createElement('<iframe src="javascript:false;" name="'+c+'">'):(a=document.createElement("iframe"),a.src="javascript:false;",a.name=c),a.style.display="none",a.id=c,a},z.getForm=function(a){var d=document.createElement("form");d.encoding="multipart/form-data",d.enctype="multipart/form-data",d.style.display="none";for(var c in a){a.hasOwnProperty(c)&&(d[c]=a[c])}return d},z.getHidden=function(a,d){var c=document.createElement("input");return c.type="hidden",c.name=a,c.value=d,c},z.parseJSON=function(h){if(!h){return !1}if(h=z.trim(h+""),j.JSON&&j.JSON.parse){try{return j.JSON.parse(h+"")}catch(c){return !1}}var a,d=/(,)|(\[|{)|(}|])|"(?:[^"\\\r\n]|\\["\\\/bfnrt]|\\u[\da-fA-F]{4})*"\s*:?|true|false|null|-?(?!0\d)\d+(?:\.\d+|)(?:[eE][+-]?\d+|)/g,e=null;return h&&!z.trim(h.replace(d,function(i,p,o,l){return a&&p&&(e=0),0===e?i:(a=o||p,e+=!l-!o,"")}))?Function("return "+h)():!1},z.getBox=function(h){var e,c,a=0,d=0;if(h.getBoundingClientRect){e=h.getBoundingClientRect(),c=document.documentElement,a=e.top+(j.pageYOffset||c.scrollTop)-(c.clientTop||0),d=e.left+(j.pageXOffset||c.scrollLeft)-(c.clientLeft||0)}else{do{d+=h.offsetLeft,a+=h.offsetTop}while(h=h.offsetParent)}return{top:Math.round(a),left:Math.round(d)}},z.addStyles=function(a,d){for(var c in d){d.hasOwnProperty(c)&&(a.style[c]=d[c])}},z.copyLayout=function(a,d){var c=z.getBox(a);z.addStyles(d,{position:"absolute",left:c.left+"px",top:c.top+"px",width:a.offsetWidth+"px",height:a.offsetHeight+"px"})},z.getUID=function(){return"axxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(w,function(a){var d=16*Math.random()|0,c="x"==a?d:3&d|8;return c.toString(16)})};var x="".trim;z.trim=x&&!x.call("\ufeff ")?function(a){return null===a?"":x.call(a)}:function(a){return null===a?"":a.toString().replace(v,"").replace(m,"")};var k=[];return z.indexOf=k.indexOf?function(a,c){return a.indexOf(c)}:function(a,h){for(var d=0,c=a.length;c>d;d++){if(a[d]===h){return d}}return -1},z.arrayDelete=function(a,d){var c=z.indexOf(a,d);c>-1&&a.splice(c,1)},z.getFilename=function(a){return a.replace(y,"")},z.getExt=function(a){return -1!==a.indexOf(".")?a.replace(b,""):""},z.isVisible=function(a){return a?1!==a.nodeType||a==document.body?(a=null,!0):a.parentNode&&(a.offsetWidth>0||a.offsetHeight>0||"none"!=z.getStyle(a,"display").toLowerCase())?z.isVisible(a.parentNode):(a=null,!1):!1},z.getStyle=function(d,c){if(j.getComputedStyle){var a=d.ownerDocument.defaultView.getComputedStyle(d,null);return a.getPropertyValue(c)}return d.currentStyle&&d.currentStyle[c]?d.currentStyle[c]:void 0},z.getFormObj=function(d){for(var u,l=d.elements,h=["button","submit","image","reset"],p={},s=0,c=l.length;c>s;s++){if(u={},l[s].name&&!l[s].disabled&&-1===z.indexOf(h,l[s].type)){if(("checkbox"==l[s].type||"radio"==l[s].type)&&!l[s].checked){continue}u[l[s].name]=z.val(l[s]),z.extendObj(p,u)}}return p},z.val=function(d){if(d){if("SELECT"==d.nodeName.toUpperCase()){for(var D,C=d.options,l=d.selectedIndex,h="select-one"===d.type||0>l,p=h?null:[],u=0,c=C.length;c>u;u++){if((C[u].selected||u===l)&&!C[u].disabled){if(D=C[u].value?C[u].value:C[u].text,h){return D}p.push(D)}}return p}return d.value}},z.hasClass=function(a,c){return a&&c?(" "+a.className+" ").replace(B," ").indexOf(" "+c+" ")>=0:!1},z.addClass=function(a,c){return a&&c?void (z.hasClass(a,c)||(a.className+=" "+c)):!1},z.removeClass=function(){var a={};return function(d,c){return d&&c?(a[c]||(a[c]=new RegExp("(?:^|\\s)"+c+"(?!\\S)")),void (d.className=d.className.replace(a[c],""))):!1}}(),z.purge=function(a){var l,d,c,h=a.attributes;if(h){for(l=h.length-1;l>=0;l-=1){c=h[l].name,"function"==typeof a[c]&&(a[c]=null)}}if(h=a.childNodes){for(d=h.length,l=0;d>l;l+=1){z.purge(a.childNodes[l])}}},z.remove=function(a){a&&a.parentNode&&(z.purge(a),a.parentNode.removeChild(a)),a=null},z.verifyElem=function(a){return"undefined"!=typeof jQuery&&a instanceof jQuery?a=a[0]:"string"==typeof a&&("#"==a.charAt(0)&&(a=a.substr(1)),a=document.getElementById(a)),a&&1===a.nodeType?("A"==a.nodeName.toUpperCase()&&(a.style.cursor="pointer",z.addEvent(a,"click",function(c){c&&c.preventDefault?c.preventDefault():j.event&&(j.event.returnValue=!1)})),a):!1},z._options={},z.uploadSetup=function(a){z.extendObj(z._options,a)},z.SimpleUpload=function(a){if(this._opts={button:"",url:"",dropzone:"",dragClass:"",form:"",overrideSubmit:!0,cors:!1,withCredentials:!1,progressUrl:!1,sessionProgressUrl:!1,nginxProgressUrl:!1,multiple:!1,maxUploads:3,queue:!0,checkProgressInterval:500,keyParamName:"APC_UPLOAD_PROGRESS",sessionProgressName:"PHP_SESSION_UPLOAD_PROGRESS",nginxProgressHeader:"X-Progress-ID",customProgressHeaders:{},corsInputName:"XHR_CORS_TARGETORIGIN",allowedExtensions:[],accept:"",maxSize:!1,name:"",data:{},noParams:!0,autoSubmit:!0,multipart:!0,method:"POST",responseType:"",debug:!1,hoverClass:"",focusClass:"",disabledClass:"",customHeaders:{},encodeHeaders:!0,autoCalibrate:!0,onBlankSubmit:function(){},onAbort:function(){},onChange:function(){},onSubmit:function(){},onProgress:function(){},onUpdateFileSize:function(){},onComplete:function(){},onExtError:function(){},onSizeError:function(){},onError:function(){},startXHR:function(){},endXHR:function(){},startNonXHR:function(){},endNonXHR:function(){}},z.extendObj(this._opts,z._options),z.extendObj(this._opts,a),this._queue=[],this._active=0,this._disabled=!1,this._maxFails=10,this._progKeys={},this._sizeFlags={},this._btns=[],this.addButton(this._opts.button),delete this._opts.button,this._opts.button=a=null,this._opts.multiple===!1&&(this._opts.maxUploads=1),""!==this._opts.dropzone&&this.addDZ(this._opts.dropzone),""===this._opts.dropzone&&this._btns.length<1){throw new Error("Invalid upload button. Make sure the element you're passing exists.")}""!==this._opts.form&&this.setForm(this._opts.form),this._createInput(),this._manDisabled=!1,this.enable(!0)},z.SimpleUpload.prototype={destroy:function(){for(var a=this._btns.length;a--;){this._btns[a].off&&this._btns[a].off(),z.removeClass(this._btns[a],this._opts.hoverClass),z.removeClass(this._btns[a],this._opts.focusClass),z.removeClass(this._btns[a],this._opts.disabledClass),this._btns[a].disabled=!1}this._killInput(),this._destroy=!0},log:function(a){this._opts&&this._opts.debug&&j.console&&j.console.log&&j.console.log("[Uploader] "+a)},setData:function(a){this._opts.data=a},setOptions:function(a){z.extendObj(this._opts,a)},addButton:function(a){var h;if(a instanceof Array){for(var d=0,c=a.length;c>d;d++){h=z.verifyElem(a[d]),h!==!1?this._btns.push(this.rerouteClicks(h)):this.log("Button with array index "+d+" is invalid")}}else{h=z.verifyElem(a),h!==!1&&this._btns.push(this.rerouteClicks(h))}},addDZ:function(a){A&&(a=z.verifyElem(a),a?this.addDropZone(a):this.log("Invalid or nonexistent element passed for drop zone"))},setProgressBar:function(a){this._progBar=z.verifyElem(a)},setPctBox:function(a){this._pctBox=z.verifyElem(a)},setFileSizeBox:function(a){this._sizeBox=z.verifyElem(a)},setProgressContainer:function(a){this._progBox=z.verifyElem(a)},setAbortBtn:function(a,c){this._abortBtn=z.verifyElem(a),this._removeAbort=!1,c&&(this._removeAbort=!0)},setForm:function(c){if(this._form=z.verifyElem(c),this._form&&"FORM"==this._form.nodeName.toUpperCase()){var a=this;this._opts.autoSubmit=!1,this._opts.overrideSubmit&&(z.addEvent(this._form,"submit",function(d){d.preventDefault?d.preventDefault():j.event&&(j.event.returnValue=!1),a._validateForm()&&a.submit()}),this._form.submit=function(){a._validateForm()&&a.submit()})}else{this.log("Invalid or nonexistent element passed for form")}},getQueueSize:function(){return this._queue.length},removeCurrent:function(a){if(a){for(var c=this._queue.length;c--;){if(this._queue[c].id===a){this._queue.splice(c,1);break}}}else{this._queue.splice(0,1)}this._cycleQueue()},clearQueue:function(){this._queue.length=0},disable:function(a){var d,c=this._btns.length;for(this._manDisabled=a&&this._manDisabled!==!0?!1:!0,this._disabled=!0;c--;){d=this._btns[c].nodeName.toUpperCase(),("INPUT"==d||"BUTTON"==d)&&(this._btns[c].disabled=!0),""!==this._opts.disabledClass&&z.addClass(this._btns[c],this._opts.disabledClass)}this._input&&this._input.parentNode&&(this._input.parentNode.style.visibility="hidden")},enable:function(a){if(a||(this._manDisabled=!1),this._manDisabled!==!0){var c=this._btns.length;for(this._disabled=!1;c--;){z.removeClass(this._btns[c],this._opts.disabledClass),this._btns[c].disabled=!1}}},updatePosition:function(a){a=a?a:this._btns[0],a&&this._input&&this._input.parentNode&&z.copyLayout(a,this._input.parentNode),a=null},rerouteClicks:function(d){var c=this;if(d.off=z.addEvent(d,"mouseover",function(){c._disabled||(c._input||c._createInput(),c._overBtn=d,z.copyLayout(d,c._input.parentNode),c._input.parentNode.style.visibility="visible")}),c._opts.autoCalibrate&&!z.isVisible(d)){c.log("Upload button not visible");var a=function(){z.isVisible(d)?(c.log("Upload button now visible"),j.setTimeout(function(){c.updatePosition(d),1===c._btns.length&&(c._input.parentNode.style.visibility="hidden")},200)):j.setTimeout(a,500)};j.setTimeout(a,500)}return d},submit:function(a,c){if(!c&&this._queue.length<1){return void this._opts.onBlankSubmit.call(this)}if(!(this._disabled||this._active>=this._opts.maxUploads||this._queue.length<1)&&this._checkFile(this._queue[0])){if(!1===this._opts.onSubmit.call(this,this._queue[0].name,this._queue[0].ext,this._queue[0].btn,this._queue[0].size)){return void this.removeCurrent(this._queue[0].id)}this._active++,(this._opts.multiple===!1||this._opts.queue===!1&&this._active>=this._opts.maxUploads)&&this.disable(!0),this._initUpload(this._queue[0])}}},z.IframeUpload={_detachEvents:{},_detach:function(a){this._detachEvents[a]&&(this._detachEvents[a](),delete this._detachEvents[a])},_getHost:function(a){var c=document.createElement("a");return c.href=a,c.hostname?c.hostname.toLowerCase():a},_addFiles:function(a){var d=z.getFilename(a.value),c=z.getExt(d);return !1===this._opts.onChange.call(this,d,c,this._overBtn,void 0,a)?!1:(this._queue.push({id:z.getUID(),file:a,name:d,ext:c,btn:this._overBtn,size:null}),!0)},_uploadIframe:function(O,K,H,L,N,s,P){var I,D,C,M=this,G=this._opts,E=z.getUID(),e=z.getIFrame(),J=!1,F=!1;if(D=G.noParams===!0?G.url:G.nginxProgressUrl?D+(D.indexOf("?")>-1?"&":"?")+encodeURIComponent(G.nginxProgressHeader)+"="+encodeURIComponent(E):G.url,I=z.getForm({action:D,target:e.name,method:G.method}),G.onProgress.call(this,0),N&&(N.innerHTML="0%"),L&&(L.style.width="0%"),G.cors){var Q=z.getUID();M._detachEvents[Q]=z.addEvent(j,"message",function(a){return M._getHost(a.origin)!=M._getHost(G.url)?void M.log("Non-matching origin: "+a.origin):(J=!0,M._detach(Q),G.endNonXHR.call(M,O.name,O.btn),void M._finish(O,"","",a.data,H,K,N,s,P))})}M._detachEvents[e.id]=z.addEvent(e,"load",function(){M._detach(e.id),G.sessionProgressUrl?I.appendChild(z.getHidden(G.sessionProgressName,E)):G.progressUrl&&I.appendChild(z.getHidden(G.keyParamName,E)),M._form&&z.extendObj(G.data,z.getFormObj(M._form));for(var a in G.data){G.data.hasOwnProperty(a)&&I.appendChild(z.getHidden(a,G.data[a]))}G.cors&&I.appendChild(z.getHidden(G.corsInputName,j.location.href)),I.appendChild(O.file),M._detachEvents[O.id]=z.addEvent(e,"load",function(){if(e&&e.parentNode&&!F){if(M._detach(O.id),F=!0,delete M._progKeys[E],delete M._sizeFlags[E],s&&z.removeEvent(s,"click",C),G.cors){j.setTimeout(function(){z.remove(e),J||M._errorFinish(O,"","",!1,"error",K,H,N,s,P),O=G=E=e=H=K=N=s=P=null},600)}else{try{var i=e.contentDocument?e.contentDocument:e.contentWindow.document,h=i.body.innerHTML;z.remove(e),e=null,G.endNonXHR.call(M,O.name,O.btn),M._finish(O,"","",h,H,K,N,s,P)}catch(c){M._errorFinish(O,"",c.message,!1,"error",K,H,N,s,P)}O=G=E=H=K=N=null}}}),s&&(C=function(){if(z.removeEvent(s,"click",C),delete M._progKeys[E],delete M._sizeFlags[E],e){F=!0,M._detach(O.id);try{e.contentWindow.document.execCommand&&e.contentWindow.document.execCommand("Stop")}catch(c){}try{e.src="javascript".concat(":false;")}catch(c){}j.setTimeout(function(){z.remove(e),e=null},1)}M.log("Upload aborted"),G.onAbort.call(M,O.name,O.btn,O.size),M._last(H,K,N,s,P)},z.addEvent(s,"click",C)),M.log("Commencing upload using iframe"),I.submit(),j.setTimeout(function(){z.remove(I),I=null,M.removeCurrent(O.id)},1),M._hasProgUrl&&(M._progKeys[E]=1,j.setTimeout(function(){M._getProg(E,L,H,N,1),L=H=N=null},600))}),document.body.appendChild(I),document.body.appendChild(e)},_getProg:function(N,J,G,K,M){var s,O,H,D=this,C=this._opts,L=(new Date).getTime();if(N){if(C.nginxProgressUrl?O=C.nginxProgressUrl+"?"+encodeURIComponent(C.nginxProgressHeader)+"="+encodeURIComponent(N)+"&_="+L:C.sessionProgressUrl?O=C.sessionProgressUrl:C.progressUrl&&(O=C.progressUrl+"?progresskey="+encodeURIComponent(N)+"&_="+L),H=function(){var n,l,d,c,a;try{if(H&&(C.cors||4===s.readyState)){H=void 0,s.onreadystatechange=function(){};try{a=s.statusText,c=s.status}catch(i){a="",c=""}if(C.cors||c>=200&&300>c){if(n=z.parseJSON(s.responseText),n===!1){return void D.log("Error parsing progress response (expecting JSON)")}if(C.nginxProgressUrl){if("uploading"==n.state){l=parseInt(n.size,10),l>0&&(d=Math.round(parseInt(n.received,10)/l*100),l=Math.round(l/1024))}else{if("done"==n.state){d=100}else{if("error"==n.state){return void D.log("Error requesting upload progress: "+n.status)}}}}else{(C.sessionProgressUrl||C.progressUrl)&&n.success===!0&&(l=parseInt(n.size,10),d=parseInt(n.pct,10))}if(d&&(K&&(K.innerHTML=d+"%"),J&&(J.style.width=d+"%"),C.onProgress.call(D,d)),l&&!D._sizeFlags[N]&&(G&&(G.innerHTML=l+"K"),D._sizeFlags[N]=1,C.onUpdateFileSize.call(D,l)),!d&&!l&&M>=D._maxFails){return M++,void D.log("Failed progress request limit reached. Count: "+M)}100>d&&D._progKeys[N]&&j.setTimeout(function(){D._getProg(N,J,G,K,M),N=J=G=K=M=null},C.checkProgressInterval)}else{delete D._progKeys[N],D.log("Error requesting upload progress: "+c+" "+a)}s=l=d=c=a=n=null}}catch(i){D.log("Error requesting upload progress: "+i.message)}},C.cors&&!C.sessionProgressUrl){if(!j.XDomainRequest){return}s=new j.XDomainRequest,s.open("GET",O,!0),s.onprogress=s.ontimeout=function(){},s.onload=H,s.onerror=function(){delete D._progKeys[N],N=null,D.log("Error requesting upload progress")}}else{var F,E=C.sessionProgressUrl?"POST":"GET",e={};s=z.newXHR(),s.onreadystatechange=H,s.open(E,O,!0),C.sessionProgressUrl&&(F=encodeURIComponent(C.sessionProgressName)+"="+encodeURIComponent(N),e["Content-Type"]="application/x-www-form-urlencoded"),C.nginxProgressUrl&&(e[C.nginxProgressHeader]=N),e["X-Requested-With"]="XMLHttpRequest",e.Accept="application/json, text/javascript, */*; q=0.01",z.extendObj(e,C.customProgressHeaders);for(var I in e){e.hasOwnProperty(I)&&(C.encodeHeaders?s.setRequestHeader(I,z.encodeUTF8(e[I]+"")):s.setRequestHeader(I,e[I]+""))}s.send(C.sessionProgressUrl&&F||null)}}},_initUpload:function(a){return !1===this._opts.startNonXHR.call(this,a.name,a.btn)?(this._disabled&&this.enable(!0),void this._active--):(this._hasProgUrl=this._opts.progressUrl||this._opts.sessionProgressUrl||this._opts.nginxProgressUrl?!0:!1,this._uploadIframe(a,this._progBox,this._sizeBox,this._progBar,this._pctBox,this._abortBtn,this._removeAbort),void (a=this._progBox=this._sizeBox=this._progBar=this._pctBox=this._abortBtn=this._removeAbort=null))}},z.XhrUpload={_addFiles:function(a){var p,d,c,h,l=a.length;for(this._opts.multiple||(l=1),h=0;l>h;h++){if(p=z.getFilename(a[h].name),d=z.getExt(p),c=Math.round(a[h].size/1024),!1===this._opts.onChange.call(this,p,d,this._overBtn,c,a[h])){return !1}this._queue.push({id:z.getUID(),file:a[h],name:p,ext:d,btn:this._overBtn,size:c})}return !0},_uploadXhr:function(G,R,N,K,O,Q,C,S,L,F){var E,P,J=this,H=this._opts,s=z.newXHR();O&&(O.innerHTML=G.size+"K"),S&&(S.innerHTML="0%"),Q&&(Q.style.width="0%"),E=function(e,c){var a;try{if(E&&(c||4===s.readyState)){if(E=void 0,s.onreadystatechange=function(){},c){4!==s.readyState&&s.abort(),H.onAbort.call(J,G.name,G.btn,G.size),J._last(O,C,S,L,F)}else{L&&z.removeEvent(L,"click",P);try{a=s.statusText}catch(d){a=""}s.status>=200&&s.status<300?(H.endXHR.call(J,G.name,G.size,G.btn),J._finish(G,s.status,a,s.responseText,O,C,S,L,F)):J._errorFinish(G,s.status,a,s.responseText,"error",C,O,S,L,F)}}}catch(d){c||J._errorFinish(G,-1,d.message,!1,"error",C,O,S,L,F)}},L&&(P=function(){z.removeEvent(L,"click",P),E&&E(void 0,!0)},z.addEvent(L,"click",P)),s.onreadystatechange=E,s.open(H.method.toUpperCase(),R,!0),s.withCredentials=!!H.withCredentials,z.extendObj(K,H.customHeaders);for(var M in K){K.hasOwnProperty(M)&&(H.encodeHeaders?s.setRequestHeader(M,z.encodeUTF8(K[M]+"")):s.setRequestHeader(M,K[M]+""))}if(z.addEvent(s.upload,"progress",function(a){if(a.lengthComputable){var c=Math.round(a.loaded/a.total*100);H.onProgress.call(J,c),S&&(S.innerHTML=c+"%"),Q&&(Q.style.width=c+"%")}}),H.onProgress.call(this,0),H.multipart===!0){var I=new FormData,T=!1;for(var D in N){N.hasOwnProperty(D)&&(D!==H.name||H.noParams!==!0||J._form||(T=!0),I.append(D,N[D]))}T||I.append(H.name,G.file),this.log("Commencing upload using multipart form"),s.send(I)}else{this.log("Commencing upload using binary stream"),s.send(G.file)}this.removeCurrent(G.id)},_initUpload:function(a){var h,d={},c={};return !1===this._opts.startXHR.call(this,a.name,a.size,a.btn)?(this._disabled&&this.enable(!0),void this._active--):(c["X-Requested-With"]="XMLHttpRequest",c["X-File-Name"]=a.name,"json"==this._opts.responseType.toLowerCase()&&(c.Accept="application/json, text/javascript, */*; q=0.01"),this._opts.multipart||(c["Content-Type"]="application/octet-stream"),this._form&&z.extendObj(d,z.getFormObj(this._form)),z.extendObj(d,this._opts.data),h=this._opts.noParams===!0?this._opts.url:this._opts.url+(this._opts.url.indexOf("?")>-1?"&":"?")+z.obj2string(d),this._uploadXhr(a,h,d,c,this._sizeBox,this._progBar,this._progBox,this._pctBox,this._abortBtn,this._removeAbort),void (this._sizeBox=this._progBar=this._progBox=this._pctBox=this._abortBtn=this._removeAbort=null))}},z.DragAndDrop={_dragFileCheck:function(a){if(a.dataTransfer.types){for(var c=0;c<a.dataTransfer.types.length;c++){if("Files"==a.dataTransfer.types[c]){return !0}}}return !1},addDropZone:function(a){var d=this,c=[];z.addStyles(a,{zIndex:16777271}),a.ondragenter=function(h){return h.stopPropagation(),h.preventDefault(),d._dragFileCheck(h)?(0===c.length&&z.addClass(this,d._opts.dragClass),-1===z.indexOf(c,h.target)&&c.push(h.target),!1):!1},a.ondragover=function(h){return h.stopPropagation(),h.preventDefault(),d._dragFileCheck(h)&&(h.dataTransfer.dropEffect="copy"),!1},a.ondragend=function(){return z.removeClass(this,d._opts.dragClass),!1},a.ondragleave=function(h){return z.arrayDelete(c,h.target),0===c.length&&z.removeClass(this,d._opts.dragClass),!1},a.ondrop=function(h){h.stopPropagation(),h.preventDefault(),z.arrayDelete(c,h.target),0===c.length&&z.removeClass(this,d._opts.dragClass),d._dragFileCheck(h)&&!1!==d._addFiles(h.dataTransfer.files)&&d._cycleQueue()}}},z.extendObj(z.SimpleUpload.prototype,{_createInput:function(){var a=this,c=document.createElement("div");this._input=document.createElement("input"),this._input.type="file",this._input.name=this._opts.name,A&&!q&&this._opts.multiple&&(this._input.multiple=!0),"accept" in this._input&&""!==this._opts.accept&&(this._input.accept=this._opts.accept),z.addStyles(c,{display:"block",position:"absolute",overflow:"hidden",margin:0,padding:0,opacity:0,direction:"ltr",zIndex:16777270}),"0"!==c.style.opacity&&(c.style.filter="alpha(opacity=0)"),z.addStyles(this._input,{position:"absolute",right:0,margin:0,padding:0,fontSize:"480px",fontFamily:"sans-serif",cursor:"pointer",height:"100%",zIndex:16777270}),this._input.turnOff=z.addEvent(this._input,"change",function(){a._input&&""!==a._input.value&&!1!==a._addFiles(A?a._input.files:a._input)&&(z.removeClass(a._overBtn,a._opts.hoverClass),z.removeClass(a._overBtn,a._opts.focusClass),a._killInput(),a._createInput(),a._opts.autoSubmit&&a.submit())}),""!==a._opts.hoverClass&&(c.mouseOverOff=z.addEvent(c,"mouseover",function(){z.addClass(a._overBtn,a._opts.hoverClass)})),c.mouseOutOff=z.addEvent(c,"mouseout",function(){a._input.parentNode.style.visibility="hidden",""!==a._opts.hoverClass&&(z.removeClass(a._overBtn,a._opts.hoverClass),z.removeClass(a._overBtn,a._opts.focusClass))}),""!==a._opts.focusClass&&(this._input.focusOff=z.addEvent(this._input,"focus",function(){z.addClass(a._overBtn,a._opts.focusClass)}),this._input.blurOff=z.addEvent(this._input,"blur",function(){z.removeClass(a._overBtn,a._opts.focusClass)})),c.appendChild(this._input),document.body.appendChild(c),c=null},_last:function(a,p,d,c,h){if(a&&(a.innerHTML=""),d&&(d.innerHTML=""),c&&h&&z.remove(c),p&&z.remove(p),this._active--,a=p=d=c=h=null,this._disabled&&this.enable(!0),this._destroy&&0===this._queue.length&&0===this._active){for(var l in this){this.hasOwnProperty(l)&&delete this[l]}}else{this._cycleQueue()}},_errorFinish:function(d,G,F,C,h,D,E,c,H,p){this.log("Upload failed: "+G+" "+F),this._opts.onError.call(this,d.name,h,G,F,C,d.btn,d.size),this._last(E,D,c,H,p),d=G=F=C=h=E=D=c=H=p=null},_finish:function(d,E,s,h,C,D,c,F,p){return this.log("Server response: "+h),"json"==this._opts.responseType.toLowerCase()&&(h=z.parseJSON(h),h===!1)?void this._errorFinish(d,E,s,!1,"parseerror",D,C,F,p):(this._opts.onComplete.call(this,d.name,h,d.btn,d.size),this._last(C,D,c,F,p),void (d=E=s=h=C=D=c=F=p=null))},_checkFile:function(a){var d=!1,c=this._opts.allowedExtensions.length;if(c>0){for(;c--;){if(this._opts.allowedExtensions[c].toLowerCase()==a.ext.toLowerCase()){d=!0;break}}if(!d){return this.removeCurrent(a.id),this.log("File extension not permitted"),this._opts.onExtError.call(this,a.name,a.ext),!1}}return a.size&&this._opts.maxSize!==!1&&a.size>this._opts.maxSize?(this.removeCurrent(a.id),this.log(a.name+" exceeds "+this._opts.maxSize+"K limit"),this._opts.onSizeError.call(this,a.name,a.size),!1):(a=null,!0)},_killInput:function(){this._input&&(this._input.turnOff&&this._input.turnOff(),this._input.focusOff&&this._input.focusOff(),this._input.blurOff&&this._input.blurOff(),this._input.parentNode.mouseOverOff&&this._input.parentNode.mouseOverOff(),z.remove(this._input.parentNode),delete this._input,this._input=null)},_cycleQueue:function(){this._queue.length>0&&this._opts.autoSubmit&&this.submit(void 0,!0)},_validateForm:function(){return this._form.checkValidity&&!this._form.checkValidity()?!1:!0}}),A?z.extendObj(z.SimpleUpload.prototype,z.XhrUpload):z.extendObj(z.SimpleUpload.prototype,z.IframeUpload),z.extendObj(z.SimpleUpload.prototype,z.DragAndDrop),z});(function defineMustache(b,a){if(typeof exports==="object"&&exports&&typeof exports.nodeName!=="string"){a(exports)}else{if(typeof define==="function"&&define.amd){define(["exports"],a)}else{b.Mustache={};a(b.Mustache)}}})(this,function mustacheFactory(q){var t=Object.prototype.toString;var l=Array.isArray||function m(Q){return t.call(Q)==="[object Array]"};function n(Q){return typeof Q==="function"}function M(Q){return l(Q)?"array":typeof Q}function j(Q){return Q.replace(/[\-\[\]{}()*+?.,\\\^$|#\s]/g,"\\$&")}function k(Q,R){return Q!=null&&typeof Q==="object"&&R in Q}var y=RegExp.prototype.test;function K(Q,R){return y.call(Q,R)}var s=/\S/;function o(Q){return !K(s,Q)}var e={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;","/":"&#x2F;","`":"&#x60;","=":"&#x3D;"};function i(R){return String(R).replace(/[&<>"'`=\/]/g,function Q(S){return e[S]})}var O=/\s*/;var H=/\s+/;var g=/\s*=/;var c=/\s*\}/;var J=/#|\^|\/|>|\{|&|=|!/;function v(af,ae){if(!af){return[]}var aa=[];var ah=[];var ab=[];var U=false;var W=false;function ad(){if(U&&!W){while(ab.length){delete ah[ab.pop()]}}else{ab=[]}U=false;W=false}var X,S,R;function T(al){if(typeof al==="string"){al=al.split(H,2)}if(!l(al)||al.length!==2){throw new Error("Invalid tags: "+al)}X=new RegExp(j(al[0])+"\\s*");S=new RegExp("\\s*"+j(al[1]));R=new RegExp("\\s*"+j("}"+al[1]))}T(ae||q.tags);var Z=new F(af);var ac,ai,aj,Q,ag,Y;while(!Z.eos()){ac=Z.pos;aj=Z.scanUntil(X);if(aj){for(var V=0,ak=aj.length;V<ak;++V){Q=aj.charAt(V);if(o(Q)){ab.push(ah.length)}else{W=true}ah.push(["text",Q,ac,ac+1]);ac+=1;if(Q==="\n"){ad()}}}if(!Z.scan(X)){break}U=true;ai=Z.scan(J)||"name";Z.scan(O);if(ai==="="){aj=Z.scanUntil(g);Z.scan(g);Z.scanUntil(S)}else{if(ai==="{"){aj=Z.scanUntil(R);Z.scan(c);Z.scanUntil(S);ai="&"}else{aj=Z.scanUntil(S)}}if(!Z.scan(S)){throw new Error("Unclosed tag at "+Z.pos)}ag=[ai,aj,ac,Z.pos];ah.push(ag);if(ai==="#"||ai==="^"){aa.push(ag)}else{if(ai==="/"){Y=aa.pop();if(!Y){throw new Error('Unopened section "'+aj+'" at '+ac)}if(Y[1]!==aj){throw new Error('Unclosed section "'+Y[1]+'" at '+ac)}}else{if(ai==="name"||ai==="{"||ai==="&"){W=true}else{if(ai==="="){T(aj)}}}}}Y=aa.pop();if(Y){throw new Error('Unclosed section "'+Y[1]+'" at '+Z.pos)}return r(I(ah))}function I(V){var T=[];var U,R;for(var Q=0,S=V.length;Q<S;++Q){U=V[Q];if(U){if(U[0]==="text"&&R&&R[0]==="text"){R[1]+=U[1];R[3]=U[3]}else{T.push(U);R=U}}}return T}function r(X){var S=[];var Q=S;var V=[];var W,U;for(var R=0,T=X.length;R<T;++R){W=X[R];switch(W[0]){case"#":case"^":Q.push(W);V.push(W);Q=W[4]=[];break;case"/":U=V.pop();U[5]=W[2];Q=V.length>0?V[V.length-1][4]:S;break;default:Q.push(W)}}return S}function F(Q){this.string=Q;this.tail=Q;this.pos=0}F.prototype.eos=function f(){return this.tail===""};F.prototype.scan=function E(R){var Q=this.tail.match(R);if(!Q||Q.index!==0){return""}var S=Q[0];this.tail=this.tail.substring(S.length);this.pos+=S.length;return S};F.prototype.scanUntil=function G(S){var Q=this.tail.search(S),R;switch(Q){case -1:R=this.tail;this.tail="";break;case 0:R="";break;default:R=this.tail.substring(0,Q);this.tail=this.tail.substring(Q)}this.pos+=R.length;return R};function b(R,Q){this.view=R;this.cache={".":this.view};this.parent=Q}b.prototype.push=function w(Q){return new b(Q,this)};b.prototype.lookup=function p(U){var Q=this.cache;var W;if(Q.hasOwnProperty(U)){W=Q[U]}else{var R=this,V,S,T=false;while(R){if(U.indexOf(".")>0){W=R.view;V=U.split(".");S=0;while(W!=null&&S<V.length){if(S===V.length-1){T=k(W,V[S])}W=W[V[S++]]}}else{W=R.view[U];T=k(R.view,U)}if(T){break}R=R.parent}Q[U]=W}if(n(W)){W=W.call(this.view)}return W};function P(){this.cache={}}P.prototype.clearCache=function a(){this.cache={}};P.prototype.parse=function u(S,R){var Q=this.cache;var T=Q[S];if(T==null){T=Q[S]=v(S,R)}return T};P.prototype.render=function z(S,U,R){var T=this.parse(S);var Q=U instanceof b?U:new b(U);return this.renderTokens(T,Q,R,S)};P.prototype.renderTokens=function D(Y,R,V,U){var Q="";var X,W,Z;for(var S=0,T=Y.length;S<T;++S){Z=undefined;X=Y[S];W=X[0];if(W==="#"){Z=this.renderSection(X,R,V,U)}else{if(W==="^"){Z=this.renderInverted(X,R,V,U)}else{if(W===">"){Z=this.renderPartial(X,R,V,U)}else{if(W==="&"){Z=this.unescapedValue(X,R)}else{if(W==="name"){Z=this.escapedValue(X,R)}else{if(W==="text"){Z=this.rawValue(X)}}}}}}if(Z!==undefined){Q+=Z}}return Q};P.prototype.renderSection=function C(X,R,U,T){var V=this;var Q="";var Y=R.lookup(X[1]);function W(aa){return V.render(aa,R,U)}if(!Y){return}if(l(Y)){for(var S=0,Z=Y.length;S<Z;++S){Q+=this.renderTokens(X[4],R.push(Y[S]),U,T)}}else{if(typeof Y==="object"||typeof Y==="string"||typeof Y==="number"){Q+=this.renderTokens(X[4],R.push(Y),U,T)}else{if(n(Y)){if(typeof T!=="string"){throw new Error("Cannot use higher-order sections without the original template")}Y=Y.call(R.view,T.slice(X[3],X[5]),W);if(Y!=null){Q+=Y}}else{Q+=this.renderTokens(X[4],R,U,T)}}}return Q};P.prototype.renderInverted=function A(T,Q,S,R){var U=Q.lookup(T[1]);if(!U||l(U)&&U.length===0){return this.renderTokens(T[4],Q,S,R)}};P.prototype.renderPartial=function B(S,Q,R){if(!R){return}var T=n(R)?R(S[1]):R[S[1]];if(T!=null){return this.renderTokens(this.parse(T),Q,R,T)}};P.prototype.unescapedValue=function N(R,Q){var S=Q.lookup(R[1]);if(S!=null){return S}};P.prototype.escapedValue=function h(R,Q){var S=Q.lookup(R[1]);if(S!=null){return q.escape(S)}};P.prototype.rawValue=function x(Q){return Q[1]};q.name="mustache.js";q.version="2.2.1";q.tags=["{{","}}"];var d=new P;q.clearCache=function a(){return d.clearCache()};q.parse=function u(R,Q){return d.parse(R,Q)};q.render=function z(R,S,Q){if(typeof R!=="string"){throw new TypeError('Invalid template! Template should be a "string" but "'+M(R)+'" was given as the first argument for mustache#render(template, view, partials)')}return d.render(R,S,Q)};q.to_html=function L(T,U,Q,S){var R=q.render(T,U,Q);if(n(S)){S(R)}else{return R}};q.escape=i;q.Scanner=F;q.Context=b;q.Writer=P});(function(e,d){if("function"===typeof define&&define.amd){define(["mustache"],function(a){d(a)})}else{if("undefined"!==typeof exports){var f=require("mustache");d(f)}else{d(e.Mustache)}}})(this,function(a){a.Formatters={};a.Context.prototype.parseParam=function(b){var d;d=/^[\'\"](.*)[\'\"]$/g;return d.test(b)?b.replace(d,"$1"):/^[+-]?\d+$/g.test(b)?parseInt(b,10):/^[+-]?\d*\.\d+$/g.test(b)?parseFloat(b):this._lookup(b)};a.Context.prototype.applyFilter=function(b,h){var k,i,j,l=[b];k=/\:\s*([\'][^\']*[\']|[\"][^\"]*[\"]|[^\:]+)\s*/g;i=/^\s*([^\:]+)/g.exec(h);for(j=$.trim(i[1]);i=k.exec(h);){l.push(this.parseParam($.trim(i[1])))}return a.Formatters.hasOwnProperty(j)?(h=a.Formatters[j],h.apply(h,l)):b};a.Context.prototype._lookup=a.Context.prototype.lookup;a.Context.prototype.lookup=function(e){var g,f,h;h=e.split("|");f=$.trim(h.shift());f=this._lookup(f);e=0;for(g=h.length;e<g;++e){f=this.applyFilter(f,h[e])}return f}});!function(a){"function"==typeof define&&define.amd?define(["jquery"],a):"object"==typeof module&&module.exports?module.exports=a(require("jquery")):a(jQuery)}(function(b){var a=function(){function c(){var D=this,L=function(){var d=["br-wrapper"];""!==D.options.theme&&d.push("br-theme-"+D.options.theme),D.$elem.wrap(b("<div />",{"class":d.join(" ")}))},H=function(){D.$elem.unwrap()},q=function(d){return b.isNumeric(d)&&(d=Math.floor(d)),b('option[value="'+d+'"]',D.$elem)},Q=function(){var d=D.options.initialRating;return d?q(d):b("option:selected",D.$elem)},M=function(){var d=D.$elem.find('option[value="'+D.options.emptyValue+'"]');return !d.length&&D.options.allowEmpty?(d=b("<option />",{value:D.options.emptyValue}),d.prependTo(D.$elem)):d},J=function(e){var d=D.$elem.data("barrating");return"undefined"!=typeof e?d[e]:d},W=function(e,d){null!==d&&"object"==typeof d?D.$elem.data("barrating",d):D.$elem.data("barrating")[e]=d},Z=function(){var m=Q(),j=M(),g=m.val(),e=m.data("html")?m.data("html"):m.text(),h=null!==D.options.allowEmpty?D.options.allowEmpty:!!j.length,o=j.length?j.val():null,f=j.length?j.text():null;W(null,{userOptions:D.options,ratingValue:g,ratingText:e,originalRatingValue:g,originalRatingText:e,allowEmpty:h,emptyRatingValue:o,emptyRatingText:f,readOnly:D.options.readonly,ratingMade:!1})},B=function(){D.$elem.removeData("barrating")},z=function(){return J("ratingText")},E=function(){return J("ratingValue")},F=function(){var d=b("<div />",{"class":"br-widget"});return D.$elem.find("option").each(function(){var f,e,h,g;f=b(this).val(),f!==J("emptyRatingValue")&&(e=b(this).text(),h=b(this).data("html"),h&&(e=h),g=b("<a />",{href:"#","data-rating-value":f,"data-rating-text":e,html:D.options.showValues?e:""}),d.append(g))}),D.options.showSelectedRating&&d.append(b("<div />",{text:"","class":"br-current-rating"})),D.options.reverse&&d.addClass("br-reverse"),D.options.readonly&&d.addClass("br-readonly"),d},P=function(){return J("userOptions").reverse?"nextAll":"prevAll"},G=function(d){q(d).prop("selected",!0),D.$elem.change()},K=function(){b("option",D.$elem).prop("selected",function(){return this.defaultSelected}),D.$elem.change()},aa=function(d){d=d?d:z(),d==J("emptyRatingText")&&(d=""),D.options.showSelectedRating&&D.$elem.parent().find(".br-current-rating").text(d)},ae=function(d){return Math.round(Math.floor(10*d)/10%1*100)},t=function(){D.$widget.find("a").removeClass(function(f,d){return(d.match(/(^|\s)br-\S+/g)||[]).join(" ")})},ac=function(){var f,e,d=D.$widget.find('a[data-rating-value="'+E()+'"]'),h=J("userOptions").initialRating,g=b.isNumeric(E())?E():0,j=ae(h);if(t(),d.addClass("br-selected br-current")[P()]().addClass("br-selected"),!J("ratingMade")&&b.isNumeric(h)){if(g>=h||!j){return}f=D.$widget.find("a"),e=d.length?d[J("userOptions").reverse?"prev":"next"]():f[J("userOptions").reverse?"last":"first"](),e.addClass("br-fractional"),e.addClass("br-fractional-"+j)}},k=function(d){return J("allowEmpty")&&J("userOptions").deselectable?E()==d.attr("data-rating-value"):!1},ad=function(d){d.on("click.barrating",function(g){var f,e,j=b(this),h=J("userOptions");return g.preventDefault(),f=j.attr("data-rating-value"),e=j.attr("data-rating-text"),k(j)&&(f=J("emptyRatingValue"),e=J("emptyRatingText")),W("ratingValue",f),W("ratingText",e),W("ratingMade",!0),G(f),aa(e),ac(),h.onSelect.call(D,E(),z(),g),!1})},U=function(d){d.on("mouseenter.barrating",function(){var f=b(this);t(),f.addClass("br-active")[P()]().addClass("br-active"),aa(f.attr("data-rating-text"))})},ab=function(d){D.$widget.on("mouseleave.barrating blur.barrating",function(){aa(),ac()})},N=function(d){d.on("touchstart.barrating",function(f){f.preventDefault(),f.stopPropagation(),b(this).click()})},A=function(d){d.on("click.barrating",function(e){e.preventDefault()})},X=function(d){ad(d),D.options.hoverState&&(U(d),ab(d))},Y=function(d){d.off(".barrating")},I=function(e){var d=D.$widget.find("a");N&&N(d),e?(Y(d),A(d)):X(d)};this.show=function(){J()||(L(),Z(),D.$widget=F(),D.$widget.insertAfter(D.$elem),ac(),aa(),I(D.options.readonly),D.$elem.hide())},this.readonly=function(d){"boolean"==typeof d&&J("readOnly")!=d&&(I(d),W("readOnly",d),D.$widget.toggleClass("br-readonly"))},this.set=function(e){var d=J("userOptions");D.$elem.find('option[value="'+e+'"]').val()&&(W("ratingValue",e),W("ratingText",D.$elem.find('option[value="'+e+'"]').text()),W("ratingMade",!0),G(E()),aa(z()),ac(),d.silent||d.onSelect.call(this,E(),z()))},this.clear=function(){var d=J("userOptions");W("ratingValue",J("originalRatingValue")),W("ratingText",J("originalRatingText")),W("ratingMade",!1),K(),aa(z()),ac(),d.onClear.call(this,E(),z())},this.destroy=function(){var f=E(),e=z(),d=J("userOptions");Y(D.$widget.find("a")),D.$widget.remove(),B(),H(),D.$elem.show(),d.onDestroy.call(this,f,e)}}return c.prototype.init=function(d,f){return this.$elem=b(f),this.options=b.extend({},b.fn.barrating.defaults,d),this.options},c}();b.fn.barrating=function(d,c){return this.each(function(){var e=new a;if(b(this).is("select")||b.error("Sorry, this plugin only works with select fields."),e.hasOwnProperty(d)){if(e.init(c,this),"show"===d){return e.show(c)}if(e.$elem.data("barrating")){return e.$widget=b(this).next(".br-widget"),e[d](c)}}else{if("object"==typeof d||!d){return c=d,e.init(c,this),e.show()}b.error("Method "+d+" does not exist on jQuery.barrating")}})},b.fn.barrating.defaults={theme:"",initialRating:null,allowEmpty:null,emptyValue:"",showValues:!1,showSelectedRating:!0,deselectable:!0,reverse:!1,readonly:!1,fastClicks:!0,hoverState:!0,silent:!1,onSelect:function(f,c,d){},onClear:function(d,c){},onDestroy:function(d,c){}},b.fn.barrating.BarRating=a});/*
 * Lazy Load - jQuery plugin for lazy loading images
 *
 * Copyright (c) 2007-2015 Mika Tuupola
 *
 * Licensed under the MIT license:
 *   http://www.opensource.org/licenses/mit-license.php
 *
 * Project home:
 *   http://www.appelsiini.net/projects/lazyload
 *
 * Version:  1.9.7
 *
 */
(function(a,e,c,d){var b=a(e);a.fn.lazyload=function(h){var g=this;var f;var i={threshold:0,failure_limit:0,event:"scroll",effect:"show",container:e,data_attribute:"original",skip_invisible:false,appear:null,load:null,placeholder:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsQAAA7EAZUrDhsAAAANSURBVBhXYzh8+PB/AAffA0nNPuCLAAAAAElFTkSuQmCC"};function j(){var k=0;g.each(function(){var l=a(this);if(i.skip_invisible&&!l.is(":visible")){return}if(a.abovethetop(this,i)||a.leftofbegin(this,i)){}else{if(!a.belowthefold(this,i)&&!a.rightoffold(this,i)){l.trigger("appear");k=0}else{if(++k>i.failure_limit){return false}}}})}if(h){if(d!==h.failurelimit){h.failure_limit=h.failurelimit;delete h.failurelimit}if(d!==h.effectspeed){h.effect_speed=h.effectspeed;delete h.effectspeed}a.extend(i,h)}f=(i.container===d||i.container===e)?b:a(i.container);if(0===i.event.indexOf("scroll")){f.on(i.event,function(){return j()})}this.each(function(){var l=this;var k=a(l);l.loaded=false;if(k.attr("src")===d||k.attr("src")===false){if(k.is("img")){k.attr("src",i.placeholder)}}k.one("appear",function(){if(!this.loaded){if(i.appear){var m=g.length;i.appear.call(l,m,i)}a("<img />").one("load",function(){var o=k.attr("data-"+i.data_attribute);k.hide();if(k.is("img")){k.attr("src",o)}else{k.css("background-image","url('"+o+"')")}k[i.effect](i.effect_speed);l.loaded=true;var p=a.grep(g,function(q){return !q.loaded});g=a(p);if(i.load){var n=g.length;i.load.call(l,n,i)}}).attr("src",k.attr("data-"+i.data_attribute))}});if(0!==i.event.indexOf("scroll")){k.on(i.event,function(){if(!l.loaded){k.trigger("appear")}})}});b.on("resize",function(){j()});if((/(?:iphone|ipod|ipad).*os 5/gi).test(navigator.appVersion)){b.on("pageshow",function(k){if(k.originalEvent&&k.originalEvent.persisted){g.each(function(){a(this).trigger("appear")})}})}a(c).ready(function(){j()});return this};a.belowthefold=function(f,h){var g;if(h.container===d||h.container===e){g=(e.innerHeight?e.innerHeight:b.height())+b.scrollTop()}else{g=a(h.container).offset().top+a(h.container).height()}return g<=a(f).offset().top-h.threshold};a.rightoffold=function(f,h){var g;if(h.container===d||h.container===e){g=b.width()+b.scrollLeft()}else{g=a(h.container).offset().left+a(h.container).width()}return g<=a(f).offset().left-h.threshold};a.abovethetop=function(f,h){var g;if(h.container===d||h.container===e){g=b.scrollTop()}else{g=a(h.container).offset().top}return g>=a(f).offset().top+h.threshold+a(f).height()};a.leftofbegin=function(f,h){var g;if(h.container===d||h.container===e){g=b.scrollLeft()}else{g=a(h.container).offset().left}return g>=a(f).offset().left+h.threshold+a(f).width()};a.inviewport=function(f,g){return !a.rightoffold(f,g)&&!a.leftofbegin(f,g)&&!a.belowthefold(f,g)&&!a.abovethetop(f,g)};a.extend(a.expr[":"],{"below-the-fold":function(f){return a.belowthefold(f,{threshold:0})},"above-the-top":function(f){return !a.belowthefold(f,{threshold:0})},"right-of-screen":function(f){return a.rightoffold(f,{threshold:0})},"left-of-screen":function(f){return !a.rightoffold(f,{threshold:0})},"in-viewport":function(f){return a.inviewport(f,{threshold:0})},"above-the-fold":function(f){return !a.belowthefold(f,{threshold:0})},"right-of-fold":function(f){return a.rightoffold(f,{threshold:0})},"left-of-fold":function(f){return !a.rightoffold(f,{threshold:0})}})})(jQuery,window,document);var BootstrapUtility={AssignSize:function(a,c,b){jQuery(a).each(function(){var e=jQuery(a).attr("class").split(" ");var f="";for(var d=0;d<e.length;d++){if(f!=""){f+=" "}if(e[d].indexOf(c)==0){f+=(c+b)}else{f+=e[d]}}jQuery(a).attr("class",f)})}};var Hook={Ajax:[],DoneInitial:false,DebuggingEnabled:true,Initialize:function(){Hook.Ajax.push({ajaxName:"GetCartTotal",url:"/Ajax/GetCartTotal.ashx",data:[{name:"TotalType",value:"ALL"}],type:"POST",executor:"UC_Cart.CartCharges",skipInitial:true});Hook.Ajax.push({ajaxName:"ViewCart",url:"/Ajax/ViewCart.ashx",type:"POST",executor:"UC_Cart.ViewCart"});jQuery(Hook.Ajax).each(function(){if(typeof this.type=="undefined"){this.type="GET"}if(typeof this.dataType=="undefined"){this.dataType="json"}if(typeof this.executed=="undefined"){this.executed=false}if(typeof this.pool=="undefined"){this.pool=[]}if(typeof this.log=="undefined"){this.log=[]}if(typeof this.executor=="undefined"){this.executor=null}if(typeof this.index=="undefined"){this.index=null}if(typeof this.skipInitial=="undefined"){this.skipInitial=false}})},Get:function(a){var c=null;for(var b=0;b<Hook.Ajax.length;b++){if(Hook.Ajax[b].ajaxName==a){c=Hook.Ajax[b];break}}return c},Add:function(e){var b=Hook.Get(e.ajaxName);if(b!=null&&typeof b!="undefined"){b.executed=false;var d=null;var a=false;var c=false;jQuery(b.pool).each(function(){if(this.ajaxName==e.ajaxName&&this.caller==e.caller){d=this}});if(d==null){b.pool.push({ajaxName:e.ajaxName,caller:e.caller,beforeSend:e.beforeSend,success:e.success,complete:e.complete,error:e.error,index:e.index|0});a=true}else{d.ajaxName=e.ajaxName;d.caller=e.caller;d.beforeSend=e.beforeSend;d.success=e.success;d.complete=e.complete;d.error=e.error;d.index=e.index|0}if(e.execute){c=true}else{if(Hook.DoneInitial&&b.executor==e.caller){c=true}}if(c){Hook.Execute(e.ajaxName)}}},Execute:function(b,c){if(b==""||b==null||typeof b=="undefined"){Hook.DoneInitial=true;jQuery(Hook.Ajax).each(function(){var d=this;if(!d.executed&&!d.skipInitial&&jQuery(d.pool).filter(function(){return(this.caller==d.executor)}).length>0){Hook.Call(d,c);d.executed=true}})}else{var a=Hook.Get(b);if(a!=null&&typeof a!="undefined"){Hook.Call(a,c);a.executed=true}}},Call:function(a,c){if(Hook.DebuggingEnabled){a.log.push({ajax:a,posted_dt:new Date()})}if(typeof a.data=="undefined"){a.data=[]}var b=a.data.slice(0);jQuery.each(c,function(d){b.push({name:d,value:this})});jQuery.ajax({url:a.url,type:a.type,data:b,dataType:a.dataType,beforeSend:function(){jQuery(a.pool).sort(function(d,e){return d.index-e.index}).each(function(){if(this.beforeSend!=null&&typeof this.beforeSend!="undefined"){this.beforeSend()}})},success:function(d){jQuery(a.pool).sort(function(e,f){return e.index-f.index}).each(function(){if(this.success!=null&&typeof this.success!="undefined"){this.success(d)}})},complete:function(){jQuery(a.pool).sort(function(d,e){return d.index-e.index}).each(function(){if(this.complete!=null&&typeof this.complete!="undefined"){this.complete()}})},error:function(){jQuery(a.pool).sort(function(d,e){return d.index-e.index}).each(function(){if(this.error!=null&&typeof this.error!="undefined"){this.error()}})}})}};Hook.Initialize();(function(a){var q={key:"seamless",windowID:"seamless",baseElement:null,styleSelector:"",elementClasses:"",template:"",templateError:"",allowed:[{name:"",path:[],exact:false}],targets:[{selector:"",eventName:""}],params:{NM:"1"},onLoad:function(u,v){},beforeSend:function(u,v){},success:function(u,v){},eventHandlerList:[],contentList:[{id:"",href:"",name:""}],lastIndex:0,backToTopSpeed:500};var n=function(v){if(q.onLoad!=null){var u=e(window.location.pathname);if(u==null){q.onLoad(v,"")}else{q.onLoad(v,u.name)}}};var c=function(){jQuery("body,html").animate({scrollTop:0},q.backToTopSpeed)};var i=function(u,v){if(!jQuery(u).hasClass(q.key)){if(v){jQuery(u).addClass(q.elementClasses);jQuery(u).addClass("slo")}jQuery(u).addClass(q.key)}};var t=function(u,v){if(jQuery(u).hasClass("sloa")){if(v){jQuery(u).addClass("active")}else{jQuery(u).removeClass("active")}}else{if(v){jQuery(u).addClass("forceshow")}else{jQuery(u).removeClass("forceshow")}}};var k=function(){if(q.styleSelector!=""){var u=jQuery("<style/>");u.text("div."+q.key+":not(.active):not(.forceshow) { display:none; }");jQuery(q.styleSelector).append(u)}};var h=function(){var u=q.lastIndex;while(true){u++;if(sessionStorage.getItem(q.windowID+u.toString())==null){break}}q.lastIndex=u;return q.windowID+":"+u.toString()};var e=function(w){var x=null;for(var u=0;u<q.allowed.length;u++){for(var v=0;v<q.allowed[u].path.length;v++){if((!q.allowed[u].exact&&r(q.allowed[u].path[v],w.toLowerCase()))||w.toLowerCase()==q.allowed[u].path[v]){x=q.allowed[u];u=q.allowed.length;break}}}return x};var m=function(v,w,y,z){var x=(z==null?h():z);var u=function(){jQuery.ajax({url:w,data:q.params,method:"POST",beforeSend:function(){q.beforeSend(v,y)},error:function(E,D,C){var B=E.getResponseHeader("Location");if(B!=null&&B!=w){window.location.href=B}else{if(z==null){var A={id:x,href:w.toLowerCase(),name:y};q.contentList.push(A);window.history.pushState(A.id,null,w)}if(q.templateError==null||q.templateError==""){jQuery(v).html("<center><p>Error loading page</p><p><button class='retry'>Retry</button></center>");jQuery(v).closest("div.slo").each(function(){o(this);jQuery(this).find("button.retry").attr("slo-id",x)})}else{v.load(q.templateError,function(){o(this);jQuery(this).find("button.retry").attr("slo-id",x)})}}},success:function(B){if(z==null){var A={id:x,href:w.toLowerCase(),name:y};q.contentList.push(A);window.history.pushState(A.id,null,w)}jQuery(v).html(B);sessionStorage.setItem(x,B);q.success(v,y);o(v)},complete:function(){}})};if(q.template==null&&q.template==""){_func()}else{jQuery(v).load(q.template,u)}};var f=function(v){var u=null;for(var w in q.contentList){if(q.contentList[w].href==v.toLowerCase()){u=q.contentList[w];break}}return u};var g=function(v){var u=null;for(var w in q.contentList){if(q.contentList[w].id==v){u=q.contentList[w];break}}return u};var l=function(x,y){var w=q.baseElement;var z=jQuery("<div/>");var u=jQuery(w).parent().find("> div."+q.key+".active");var v=f(x);if(v!=null&&sessionStorage.getItem(v.id)!=null){if(u.is(".slo")){u.remove()}else{u.removeClass("active")}window.history.pushState(v.id,null,v.href);d(v.id)}else{i(z,true);w.before(z);if(u.is(".slo")){u.remove()}else{u.removeClass("active")}z.addClass("active");m(z,x,y)}};var d=function(v){jQuery(q.baseElement).parent().find("div."+q.key+".active").removeClass("active");if(v==null){jQuery(q.baseElement).parent().find("div."+q.key+":not(.slo)").addClass("active")}else{var u=jQuery("<div/>");u.addClass(q.elementClasses);u.addClass(q.key);u.addClass("slo");u.addClass("active");u.html(sessionStorage.getItem(v));jQuery(q.baseElement).before(u)}q.beforeSend(this,name);jQuery(q.baseElement).parent().find("div."+q.key+".active").each(function(){q.success(this,name);o(this)})};var p=function(v){var w=jQuery(v).closest("div.slo");var u=g(jQuery(v).attr("slo-id"));if(u!=null){m(w,u.href,u.name,u.id)}};var s=function(){c();if(jQuery(this).hasClass("retry")){p(this)}else{var v=jQuery(this).attr("href");var u=e(v);if(u!=null){event.preventDefault();l(v,u.name)}}};var b=function(z,w,u){var y=true;for(var x in q.eventHandlerList){if(q.eventHandlerList[x].selector==z&&q.eventHandlerList[x].eventName==w){y=false;break}}if(y){q.eventHandlerList.push({selector:z,eventName:w})}var A="sloe_"+w;var v=(u==null?jQuery(z+":not(."+A+")"):jQuery(u).find(z+":not(."+A+")"));v.addClass(A);v.bind(w+"."+q.key,s)};var o=function(u){for(var v in q.eventHandlerList){b(q.eventHandlerList[v].selector,q.eventHandlerList[v].eventName,u)}b("button.retry","click",u)};var j=function(){jQuery(window).on("popstate",function(u){if(u.originalEvent.state!=null&&r(q.windowID+":",u.originalEvent.state)){d(u.originalEvent.state)}else{if(u.originalEvent.state==null){d()}}})};var r=function(w,u){var v=new RegExp("^"+w);return v.test(u)};a.fn.seamless=function(y,x){if(typeof y=="string"){switch(y.toLowerCase()){case"hide":i(this);t(this,false);break;case"show":i(this);t(this,true);break;case"repaint":o(this);break;case"load":n(this);break;case"open":var u=e(x);if(u==null){l(x)}else{l(x,u.name)}break;case"debugger":;break}}else{if(y instanceof Object){q.windowID=q.key+new Date().getTime();q.baseElement=this;q.elementClasses=jQuery(this).attr("class");q.params=y.params;if(y.styleSelector!=null){q.styleSelector=y.styleSelector}q.allowed=new Array();for(var w in y.allowed){var u={name:y.allowed[w].name,path:(y.allowed[w].path==null?new Array("/"+y.allowed[w].name):y.allowed[w].path),exact:(y.allowed[w].exact==null?0:y.allowed[w].exact)};for(var z in u.path){u.path[z]=u.path[z].toLowerCase()}q.allowed.push(u)}q.success=y.success;q.beforeSend=y.beforeSend;if(y.onLoad!=null){q.onLoad=y.onLoad}q.template=y.template;q.templateError=y.templateError;if(y.backToTopSpeed!=null){q.backToTopSpeed=y.backToTopSpeed}q.contentList=new Array();jQuery(this).addClass("active");jQuery(this).addClass(q.key);n(this);k();j();for(var v=0;v<y.targets.length;v++){b(y.targets[v].selector,y.targets[v].eventName)}}else{throw new Error("Seamless requires Object as parameter to initialize")}}return this}}(jQuery));var Utility={urlencode:function(a){if(a==undefined){return""}if(a.toUpperCase().indexOf("/")>0){return encodeURIComponent(a).toUpperCase().replace(/%/g,"~")}return encodeURIComponent(a).toUpperCase()}};var _klaviyo=function(){var i=false;var d=function(){i=typeof _learnq==="object";if(i&&typeof _learnq.push(["_getIdentifiers"]).$exchange_id==="undefined"){if(Global.settings.utm_email!=""&&typeof _learnq.identify==="function"){_learnq.identify({"$email":Global.settings.utm_email,"$idss_header":Cookie.Get("ss.ih")})}else{i=false}}};var e=function(j){d();if(!i){return}_learnq.push(["track","Login",j])};var b=function(j){};var h=function(j){};var a=function(j){d();if(!i){return}_learnq.push(["track","Added To Favourite",{item_no:j}])};var f=function(j){d();if(!i){return}_learnq.push(["track","Removed from Favourite",{item_no:j}])};var c=function(j){d();if(!i){return}_learnq.push(["track","Deleted item from cart",{item_no:j}])};var g=function(j){d();if(!i){return}_learnq.push(["track","Search",{keyword:j}])};return{init:d,login:e,campaign:b,viewedItem:h,addedToFavouriteItem:a,removedToFavouriteItem:f,deletedItem:c,search:g}}();var gtm={NotActive:function(){return typeof dataLayer=="undefined"},SubmitItemList:function(d,b){if(gtm.NotActive()){return}var a={products:[]};var c=gtm.GetLoadTypeName(b);$.each(d,function(e,g){var f={};f.item_id=g.item_no;if(g.item_name_strip!=undefined&&g.item_name_strip!=""){f.item_name=g.item_name_strip}else{f.item_name=g.item_gen_desc}f.item_brand=g.brand;f.item_list_id=b;f.item_list_name=c;f.price=$.trim(g.price.replace("AUD",""));f.qty=1;f.item_variant=(g.variant_name!=undefined?g.variant_name:"");gtm.ParseCategory(f,g.item_category);a.products.push(f)});dataLayer.push({ecommerce:null});dataLayer.push({event:"view_item_list",ecommerce:{item_list_id:b,item_list_name:c,items:a.products}})},FormatItem:function(c){if(gtm.NotActive()){return}var a={};var b=gtm.GetLoadTypeFromUrl();a.item_id=c.item_no;if(c.item_name_strip!=undefined&&c.item_name_strip!=""){a.item_name=c.item_name_strip}else{a.item_name=c.item_gen_desc}a.item_brand=c.brand;a.item_list_id=b;a.item_list_name=gtm.GetLoadTypeName(b);a.price=$.trim(c.price.toString().replace("AUD",""));a.qty=1;a.item_variant=(c.variant_name!=undefined?c.variant_name:"");gtm.ParseCategory(a,c.item_category);return a},SubmitViewItem:function(b){if(gtm.NotActive()){return}var a=[];a.push(b);dataLayer.push({ecommerce:null});dataLayer.push({event:"view_item",ecommerce:{currency:"AUD",value:b.price,items:a}})},ParseCategory:function(c,b){c.cat_1="";c.cat_2="";c.cat_3="";c.cat_4="";c.cat_5="";var a=b.split(";");$.each(a,function(d,f){var e=(parseInt(d)+1);c["item_category"+(e==1?"":e)]=$.trim(f)})},GetLoadTypeName:function(a){var b="";switch(a.toLowerCase()){case"search":b="Search";break;case"targeteditems":b="Targeted Items";break;case"favouriteitems":b="Favourite Items";break;case"category":b="Category";break;case"boughtbyothers":b="Bought by Others";break;case"subitem":b="Subitem";break;case"toppercategory":b="Top per Category";break;case"campaign":b="Campaign";break;case"promotions":b="Promotions";break;case"itemrank":b="Item Rank";break;case"bucketofgoods":b="Bucket of Goods";break;case"specials":b="Specials";break;case"featureditems":b="Featured items";break;default:b=a;break}return b},GetLoadTypeFromUrl:function(){var b=new RegExp("\\/list=(.+)","gm");var a=b.exec(location.pathname);if(a==null){return""}if(a.length>0){if(a[0]!=""){return a[0].replace("/list=","")}else{return""}}},Items:function(b,c,d,a){if(gtm.NotActive()){return}$.ajax({url:"/WebServices/Product.asmx/GA4Item",method:"POST",data:[{name:"item_no",value:b},{name:"line_id",value:c},{name:"listfrom",value:d},{name:"action",value:a}],dataType:"JSON",success:function(e){if(e.SUCCESS&&e.items!=undefined){var f=0;$.each(e.items,function(g,h){f=f+((h.price*h.qty)+h.discount)});dataLayer.push({ecommerce:null});dataLayer.push({event:a,ecommerce:{currency:"AUD",value:f,items:e.items}})}}})},ApplyPromo:function(b,a){if(gtm.NotActive()){return}$.get("/WebServices/Cart.asmx/CheckAppliedPromo",function(c){if(c.SUCCESS&&c.MSG=="APPLIED"){$.ajax({url:"/WebServices/Product.asmx/GA4Item",method:"POST",data:[{name:"item_no",value:""},{name:"line_id",value:""},{name:"listfrom",value:"cartlist"},{name:"action",value:"select_promotion"}],dataType:"JSON",success:function(d){if(d.SUCCESS&&d.items!=undefined){dataLayer.push({ecommerce:null});dataLayer.push({event:"select_promotion",ecommerce:{promotion_id:b,promotion_name:c.CAMP_DESC,items:d.items}})}if(typeof a==="function"){a()}}})}else{if(typeof a==="function"){a()}}})},TargetName:function(b){var a=$(b).text();if(a==""||a==undefined){a=$(b).attr("title")}if(a==""||a==undefined){a=$(b).attr("alt")}return a},InitClickEvent:function(){if(gtm.NotActive()){return}$("body").delegate("a.track","click",function(b){var c=$(this).attr("data-label");var a=$(this).attr("data-category");if(c==undefined||a==undefined){return}gtm.ClickEvent(a,c)});$("div.footer-new a").click(function(a){var b=gtm.TargetName(a.target);gtm.ClickEvent("Footer",b)});$("div.mobile-submenu a").click(function(a){var b=gtm.TargetName(a.target);gtm.ClickEvent("Mobile submenu",b)});$("div.mobile-submenu a").click(function(a){var b=gtm.TargetName(a.target);gtm.ClickEvent("Mobile submenu",b)});$("div.mobile-push-menu").delegate("a","click",function(a){var b=gtm.TargetName(a.target);gtm.ClickEvent("Mobile push menu",b)});$("#ctl00_cph_body_UC_Blueprint1_mainNavbar a").off("click").on("click",function(a){gtm.ClickEvent("Main Menu",$(a.target).text())});$("div.footer-new a").off("click").on("click",function(a){gtm.ClickEvent("Footer Menu",$(a.target).text())});$("#ctl00_cph_body_UC_Blueprint1_uc_menu_account_ul_menu a").off("click").on("click",function(a){var b=$(a.target).attr("href");gtm.ClickEvent("Account Menu",(b!=undefined?b:"").toLowerCase().replace("/account/",""))});$("div.mail-opt-out input[type=checkbox]").off("click").on("click",function(a){if($(a.target).attr("name")=="chkJoinMail"){gtm.ClickEvent("mail list",($(a.target).is(":checked")?"Sub":"Unsub"))}if($(a.target).attr("name")=="chkJoinEmail"){gtm.ClickEvent("email list",($(a.target).is(":checked")?"Sub":"Unsub"))}});$("#ctl00_cph_body_UC_Blueprint1_uc_categories_ul_tree").delegate("a","click",function(a){var b=$(a.target).attr("title");gtm.ClickEvent("Category",b)});$("div.product-range-container ul.main-subcategories").delegate("a","click",function(a){var b=$(a.target).attr("title");gtm.ClickEvent("Category",b)})},ClickEvent:function(a,b){if(b==""||b==undefined){return}dataLayer.push({ecommerce:null});dataLayer.push({event:"click",event_category:a+" Click",event_label:b})},SliderClickEvent:function(){if(gtm.NotActive()){return}$("div.slider.nivoSlider > a").click(function(c){var a=$(this);var d=a.find("img").attr("src").replace("https://file2.livingstone.com.au/images/slider/actual/","").replace(".png","");if(d.length>10){d=d.replace("https://file2.livingstone.com.au/images/webp/slider/","").replace(".webp","")}var b=a.attr("data-name");if(b==""||b==undefined){b=Global.cat_id+"_"+d}dataLayer.push({ecommerce:null});dataLayer.push({event:"banner_click",event_category:"Banner",event_label:"Banner Clicked",banner_id:d,banner_name:b})})},CategoryClickEvent:function(){if(gtm.NotActive()){return}$("nav.preload-categories").delegate("a","click",function(a){var b=$(a.target).attr("title");gtm.ClickEvent("Category",b)})},FormSubmission:function(b,a,c){if(gtm.NotActive()){return}dataLayer.push({ecommerce:null});dataLayer.push({event:"form_submission",form_id:b,form_element:a,form_text:c})}};var ga4={NotActive:function(){return typeof gtag=="undefined"},SubmitItemList:function(d,b){if(ga4.NotActive()){return}var a={products:[]};var c=ga4.GetLoadTypeName(b);$.each(d,function(e,g){var f={};f.item_id=g.item_no;if(g.item_name_strip!=undefined&&g.item_name_strip!=""){f.item_name=g.item_name_strip}else{f.item_name=g.item_gen_desc}f.item_brand=g.brand;f.item_list_id=b;f.item_list_name=c;f.price=$.trim(g.price.replace("AUD",""));f.qty=1;f.item_variant=(g.variant_name!=undefined?g.variant_name:"");ga4.ParseCategory(f,g.item_category);a.products.push(f)});gtag("event","view_item_list",{item_list_id:b,item_list_name:c,items:a.products});gtm.SubmitItemList(d,b)},FormatItem:function(c){if(ga4.NotActive()){return}var a={};var b=ga4.GetLoadTypeFromUrl();a.item_id=c.item_no;if(c.item_name_strip!=undefined&&c.item_name_strip!=""){a.item_name=c.item_name_strip}else{a.item_name=c.item_gen_desc}a.item_brand=c.brand;a.item_list_id=b;a.item_list_name=ga4.GetLoadTypeName(b);a.price=$.trim(c.price.toString().replace("AUD",""));a.qty=1;a.item_variant=(c.variant_name!=undefined?c.variant_name:"");ga4.ParseCategory(a,c.item_category);return a},SubmitViewItem:function(b){if(ga4.NotActive()){return}var a=[];a.push(b);gtag("event","view_item",{currency:"AUD",value:b.price,items:a});gtm.SubmitViewItem(b)},ParseCategory:function(c,b){c.cat_1="";c.cat_2="";c.cat_3="";c.cat_4="";c.cat_5="";var a=b.split(";");$.each(a,function(d,f){var e=(parseInt(d)+1);c["item_category"+(e==1?"":e)]=$.trim(f)})},GetLoadTypeName:function(a){var b="";switch(a.toLowerCase()){case"search":b="Search";break;case"targeteditems":b="Targeted Items";break;case"favouriteitems":b="Favourite Items";break;case"category":b="Category";break;case"boughtbyothers":b="Bought by Others";break;case"subitem":b="Subitem";break;case"toppercategory":b="Top per Category";break;case"campaign":b="Campaign";break;case"promotions":b="Promotions";break;case"itemrank":b="Item Rank";break;case"bucketofgoods":b="Bucket of Goods";break;case"specials":b="Specials";break;case"featureditems":b="Featured items";break;default:b=a;break}return b},GetLoadTypeFromUrl:function(){var b=new RegExp("\\/list=(.+)","gm");var a=b.exec(location.pathname);if(a==null){return""}if(a.length>0){if(a[0]!=""){return a[0].replace("/list=","")}else{return""}}},Items:function(b,c,d,a){if(!ga4.NotActive()){$.ajax({url:"/WebServices/Product.asmx/GA4Item",method:"POST",data:[{name:"item_no",value:b},{name:"line_id",value:c},{name:"listfrom",value:d},{name:"action",value:a}],dataType:"JSON",success:function(e){if(e.SUCCESS&&e.items!=undefined){var f=0;$.each(e.items,function(g,h){f=f+((h.price*h.qty)+h.discount)});gtag("event",a,{currency:"AUD",value:f,items:e.items})}}})}gtm.Items(b,c,d,a)},ApplyPromo:function(b,a){gtm.ApplyPromo(b,null);if(ga4.NotActive()){return}$.get("/WebServices/Cart.asmx/CheckAppliedPromo",function(c){if(c.SUCCESS&&c.MSG=="APPLIED"){$.ajax({url:"/WebServices/Product.asmx/GA4Item",method:"POST",data:[{name:"item_no",value:""},{name:"line_id",value:""},{name:"listfrom",value:"cartlist"},{name:"action",value:"select_promotion"}],dataType:"JSON",success:function(d){if(d.SUCCESS&&d.items!=undefined){gtag("event","select_promotion",{promotion_id:b,promotion_name:c.CAMP_DESC,items:d.items})}if(typeof a==="function"){a()}}})}else{if(typeof a==="function"){a()}}})},InitClickEvent:function(){if(ga4.NotActive()){return}$("body").delegate("a.track","click",function(b){var c=$(this).attr("data-label");var a=$(this).attr("data-category");if(c==undefined||a==undefined){return}ga4.ClickEvent(a,c)});$("#ctl00_cph_body_UC_Blueprint1_mainNavbar a").off("click").on("click",function(a){ga4.ClickEvent("Main Menu",$(a.target).text())});$("div.footer-new a").off("click").on("click",function(a){ga4.ClickEvent("Footer Menu",$(a.target).text())});$("#ctl00_cph_body_UC_Blueprint1_uc_menu_account_ul_menu a").off("click").on("click",function(a){var b=$(a.target).attr("href");ga4.ClickEvent("Account Menu",(b!=undefined?b:"").toLowerCase().replace("/account/",""))});$("div.mail-opt-out input[type=checkbox]").off("click").on("click",function(a){if($(a.target).attr("name")=="chkJoinMail"){ga4.ClickEvent("mail list",($(a.target).is(":checked")?"Sub":"Unsub"))}if($(a.target).attr("name")=="chkJoinEmail"){ga4.ClickEvent("email list",($(a.target).is(":checked")?"Sub":"Unsub"))}});$("#ctl00_cph_body_UC_Blueprint1_div-category").delegate("a","click",function(a){var b=$(a.target).attr("title");ga4.ClickEvent("Category",b)});$("div.product-range-container ul.main-subcategories").delegate("a","click",function(a){var b=$(a.target).attr("title");ga4.ClickEvent("Category",b)})},ClickEvent:function(a,b){if(b==""||b==undefined){return}if(ga4.NotActive()){gtag("event","click",{event_category:a+" Click",event_label:b})}gtm.ClickEvent(a,b)},SliderClickEvent:function(){if(ga4.NotActive()){return}$("div.slider.nivoSlider > a").click(function(c){var a=$(this);var d=a.find("img").attr("src").replace("https://file2.livingstone.com.au/images/slider/actual/","").replace(".png","");if(d.length>10){d=d.replace("https://file2.livingstone.com.au/images/webp/slider/","").replace(".webp","")}var b=a.attr("data-name");if(b==""||b==undefined){b=Global.cat_id+"_"+d}if(!ga4.NotActive()){gtag("event","banner_click",{event_category:"Banner",event_label:"Banner Clicked",banner_id:d,banner_name:b})}if(!gtm.NotActive()){dataLayer.push({ecommerce:null});dataLayer.push({event:"banner_click",event_category:"Banner",event_label:"Banner Clicked",banner_id:d,banner_name:b})}})},CategoryClickEvent:function(){if(ga4.NotActive()){return}$("nav.preload-categories").delegate("a","click",function(a){var b=$(a.target).attr("title");ga4.ClickEvent("Category",b)})},FormSubmission:function(b,a,c){if(!ga4.NotActive()){gtag("event","form_submission",{form_id:b,form_element:a,form_text:c})}if(!gtm.NotActive()){dataLayer.push({ecommerce:null});dataLayer.push({event:"form_submission",form_id:b,form_element:a,form_text:c})}}};function SendTrackno(){var b=$("#ctl00_content_txtOrderNo").val();var a=$("#ctl00_content_txtcusNo").val();var d=$("#ctl00_content_txtOrderNo").val();var c="/WebServices/ajax.aspx/SendTrackno";$(document).ready(function(){$.ajax({type:"POST",url:c,data:"{'quoteno':'"+d+"', 'cusno' : '"+a+"', 'orderno' : '"+b+"'}",contentType:"application/json; charset=utf-8",dataType:"json",success:function(e){$("#stepBanner1").hide();$("#stepBanner2").hide();$("#stepBanner3").hide();$("#stepBanner4").hide();$("#stepBanner5").hide();if(e.d[0]=="1"){$("#stepBanner1").show()}else{if(e.d[0]=="2"){$("#stepBanner2").show()}else{if(e.d[0]=="3"){$("#stepBanner3").show()}else{if(e.d[0]=="4"){$("#stepBanner4").show()}else{if(e.d[0]=="5"){$("#stepBanner5").show()}else{alert("Please make sure the Quote no. / Order no. match customer no. Thanks.")}}}}}}})})}$.support.cors=true;var Slider={resize:function(){}};var ProductList={renderComplete:function(){},detailsLoaded:function(a){},topItemsAfterLoad:function(a,b){if($(a).hasClass("featureditems")==false){return}if($(a).find("ul.product > li").length==0&&b!=false){$(".featureditems-header").hide();return}if($("a.menu-top-items").length>0){return}$("ul[id$=uc_menu_ul_menu]").append('<li class=""><a href="#" class="menu-top-items">TOP ITEMS</a></li>');$("a.menu-top-items").click(function(){$("html").animate({scrollTop:$(".featureditems-header").offset().top},800)})}};var Pages={loaded:function(a){}};var SinglePage={beforeSend:function(a){jQuery(".navbar-collapse").collapse("hide");jQuery("#cart-container").hide();jQuery(".modal").modal("hide");jQuery("body,html").animate({scrollTop:0},800)},complete:function(a){if(a.indexOf("/home")>-1||a.indexOf("/ViewBS/Home.aspx")>-1){$("div.slider.main-slider").show()}else{$("div.slider.main-slider").hide()}},completed:function(){if(Global.settings.cartType=="punchout"){$("a.set-post-code").unbind("click.setPostCode").bind("click.setPostCode",function(a){a.preventDefault();Global.showPostCodeForm()});if(Global.settings.postCode!=undefined&&Global.settings.postCode!=""){$("a.set-post-code").html("(Post Code: "+Global.settings.postCode+")")}if(Global.settings.postCode==""){Global.showPostCodeForm()}$("a.set-post-code").show()}else{$("a.set-post-code").remove()}$("a.checkout-button").attr("href",Global.CheckoutURL)}};var Cookie={Set:function(a,b,e){Cookie.Delete(a);var c=new Date();c.setTime(c.getTime()+(e*24*60*60*1000));var f="expires="+c.toUTCString();document.cookie=a+"="+b+";"+f+";domain="+(location.hostname.indexOf(".livingstone.com.au")>0?".livingstone.com.au":location.hostname)+";path=/"},Get:function(d){var f=d+"=";var b=document.cookie.split(";");for(var e=0;e<b.length;e++){var a=b[e];while(a.charAt(0)==" "){a=a.substring(1)}if(a.indexOf(f)==0){return a.substring(f.length,a.length)}}return""},Delete:function(a){var b=new Date();b.setTime(b.getTime()+(-365*24*60*60*1000));var c="expires="+b.toUTCString();document.cookie=a+"=; "+c+";domain="+(location.hostname.indexOf(".livingstone.com.au")>0?".livingstone.com.au":location.hostname)+";path=/"}};var Global={cat_id:0,punchoutCheckoutLabel:"Checkout",showMaximumBenefit:false,singlePage:false,searchVersion:"v3",CheckoutURL:"/OneCheckout",itemLeadTimeEnabled:false,singlePageInterceptorEnabled:true,categoryHeaderText:"Categories",categoryHeaderStyle:"categoryHeader",preloadCategories:false,bootStrapWebsite:false,ContentContainer:null,allowedChangeAddress:true,templateURL:"https://file2.livingstone.com.au/HTML/Template_190718_01_P_240815_2.htm?v=1",cartBodyTemplate:"#uc_cart-summary-cart-body",highlightEnabled:false,storeName:"",customerMaintenanceEmail:"",FlashDealEnabled:false,pricesMask:function(a){if(a==3){return["Hot","Prices","Login <b>NOW</b>"]}if(a==2){return["Hot Prices","Login <b>NOW</b>"]}return["Hot Prices</br>Login <b>NOW</b>"]},AddEventTypingFinish_timers:null,AddEventTypingFinish:function(b,d,c,a){if(Global.AddEventTypingFinish_timers==null){Global.AddEventTypingFinish_timers=new Array()}jQuery(d).unbind("keydown."+b).bind("keydown."+b,function(){if(typeof Global.AddEventTypingFinish_timers[b]!="undefined"||Global.AddEventTypingFinish_timers[b]!=null){clearTimeout(Global.AddEventTypingFinish_timers[b])}});jQuery(d).unbind("keyup."+b).bind("keyup."+b,function(){if(typeof Global.AddEventTypingFinish_timers[b]!="undefined"||Global.AddEventTypingFinish_timers[b]!=null){clearTimeout(Global.AddEventTypingFinish_timers[b])}Global.AddEventTypingFinish_timers[b]=setTimeout(function(){a(d)},c)})},nivoSlider:{effect:"fade",slices:10,queue:false,animSpeed:600,pauseTime:5000,startSlide:0,directionNav:false,directionNavHide:false,controlNav:true,controlNavThumbs:false,controlNavThumbsFromRel:false,controlNavThumbsSearch:".jpg",controlNavThumbsReplace:"_thumb.jpg",keyboardNav:true,pauseOnHover:true,manualAdvance:false,captionOpacity:1,maxHeight:"300px",beforeChange:function(){},afterChange:function(){},slideshowEnd:function(){}},SearchConfig:{useNewSearch:false,minLength:1,delay:500,completedCallback:null,doSearch:function(a){MasterPage.SubmitSearchSL(jQuery(a).find(".search_query").val())}},Chat:{blinkTitleDelay:1500},errorHandler:function(d,e,f){if(this.console&&typeof console.log!=="undefined"){}},afterLoad:function(){jQuery(document).ajaxError(Global.errorHandler);window.onbeforeunload=function(){jQuery(jQuery.ajaxPool).each(function(){if(typeof this.abort==="function"){this.abort()}})}},initAjax:function(){jQuery.ajaxPool=[];jQuery(document).ajaxStart(function(b){jQuery.ajaxPool.push(b)});var a=location.search;if(a.indexOf("?")==0){a=a.substring(1,a.length)}jQuery.ajaxSetup({data:a})},showCategories:function(){jQuery("[id$=btn-category]").show();jQuery("div.right-categories").removeClass().addClass("col-xs-12 col-sm-4 col-md-3 right-categories").show();jQuery("div.main-content").removeClass().addClass("col-xs-12 col-sm-8 col-md-9 margin-top main-content");jQuery("div.left-pane").addClass("col-xs-12 col-sm-4 col-md-3 left-pane").show();jQuery("div.right-pane").removeClass().addClass("col-xs-12 col-sm-8 col-md-9 right-pane content")},categoryQueue:[],categoryClickCallback:function(){if(Global.categoryQueue.length<=0){return}Global.categoryQueue.reverse();var a=Global.categoryQueue.pop();if(typeof a=="function"){a()}},categoryClicker:function(){if($("a[data-category]").length>0){$("a[data-category]").unbind("click.catClicker").bind("click.catClicker",function(a){a.preventDefault();var b=$(this).attr("data-category");if(b==""){return}var d=b.split("/");var c="/category";$("nav.preload-categories div.category-menu").remove();Global.categoryQueue=[];$(d).each(function(e,g){c+="/"+g;var f=c;Global.categoryQueue.push(function(){$('nav.preload-categories ul li a[href="'+f+'"]').click();console.log(f)})});location.hash=c;Global.categoryClickCallback()})}},fullWidthPages:["/search","/dashboard","/authentication","/catalogues","/terms","/sample"],fullWidthEnableOn:function(a){a=a||Global.fullWidthPages;$("div.left-pane").addClass("col-xs-12 col-sm-4 col-md-3 left-pane").show();$.each(a,function(b,e){var d=e.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&");var c=new RegExp(d,"i");if(c.test(location.href.toLowerCase())||location.pathname.toLowerCase().startsWith(e)){$("div.right-pane").removeClass().addClass("col-xs-12 col-sm-12 col-md-12 right-pane content");$("div.left-pane").hide()}})},getPageName:function(){var a=location.href.replace(location.origin,"");if(a.indexOf("/#")==0){a=a.substring(2,a.length-2)}if(a.indexOf("/")==0){a=a.substring(1,a.length-1)}var b="";if(a.indexOf("/")>0){a=a.substring(0,a.indexOf("/"))}else{if(a=="/"){a=""}}b=a.toLowerCase();if(b==""){b="home"}return b},toggleVisibility:function(){jQuery("[data-visibleonpage]").each(function(){var a=jQuery(this).attr("data-visibleonpage").split(",").filter(function(b){return b!=""});if(a.includes(Global.getPageName())){jQuery(this).show()}else{jQuery(this).hide()}});jQuery("[id$=ViewSlides] iframe[src*=youtube]").each(function(){if($(this).is(":visible")){this.contentWindow.postMessage(JSON.stringify({event:"command",func:"startVideo",args:""}),"*")}else{this.contentWindow.postMessage(JSON.stringify({event:"command",func:"pauseVideo",args:""}),"*")}})},adjustElementHeight:function(b,d,f){var e=0;var a=d|0;b.height("auto");for(var c=0;c<b.length;c++){var g=$(b[c]).height();if(g>e){e=g}}if(!isNaN(parseInt(f)&&f>e)){e=f}$(b).height(e+a)},seamlessEnable:false,productHeader:{specials:"Specials",campaign:"Campaign",topperCategory:"Top Selling Products for this Category",search:"Search",webonlySpecials:"Web Only Specials",newProducts:"New Products",monthlySpecials:"Monthly Specials",top10:"Top 10"},IP:"",getCurrentIP:function(){jQuery.ajax({url:"/Handler/Info.ashx?type=json&key=remote_addr",dataType:"json",async:false,success:function(a){jQuery(a.Server).each(function(b,c){if(c.Key=="REMOTE_ADDR"){Global.IP=c.Value}})}})},LoadGenericModal:function(e,d,c){var a=$(e);var b=typeof c==="function";if($("#"+d).length>0){if(b){c()}}else{if(jQuery("#genericModal").length<=0){Global.LoadTemplate("#generic-modal-template",function(f){a.append(f);if(d!==undefined){$(e+" #genericModal").attr("id",d)}if(b){c()}})}else{if(d!==undefined){$(e+" #genericModal").attr("id",d)}if(b){c()}}}},loadTemplateAjax:null,LoadTemplate:function(d,a,b){var c="";var f="";if(d.indexOf("#")==0){f=Global.templateURL;if(window.localStorage){var e=window.localStorage.getItem(Global.templateURL);if(e){c=jQuery(e).filter(d).html();if(b){Product.template=c}if(typeof a==="function"){a(c)}return}}}else{f="https://file.livingstone.com.au/Template/Custom/"+d;if(window.localStorage){c=window.localStorage.getItem(d);if(c){if(typeof a==="function"){a(c)}return}}}Global.loadTemplateAjax=$.ajax({url:f,dataType:"text",beforeSend:function(){},success:function(g){if(d.indexOf("#")==0){if(window.localStorage){window.localStorage.setItem(Global.templateURL,g)}c=jQuery(g).filter(d).html()}else{if(window.localStorage){window.localStorage.setItem(d,g)}c=g}if(b){Product.template=c}if(typeof a==="function"){a(c)}},error:function(){if(/http(s)?\:\/\/file\.livingstone\.com\.au/.test(Global.templateURL)){Global.templateURL=Global.templateURL.replace(/http(s)?\:\/\/file\.livingstone\.com\.au/gi,"");Global.LoadTemplate(d,a)}},complete:function(){Global.loadTemplateAjax=null}})},LivPushMenuGetSelectedCategory:function(){var a=Global.preloadCategories?"#hid_catid_parent":"#hid_catid";var b=jQuery("div.content "+a).val();var d=(b==Global.cat_id?0:b);if(window.location.href.lastIndexOf("#")>0&&d==0){var c=window.location.href.substring(window.location.href.lastIndexOf("#Cat-ID")+7,window.location.href.length);if(isNaN(parseInt(c))==false){d=c}}return d},CreateOrderStepsNumbering:function(){jQuery("ul.order_steps li label").remove();jQuery("ul.order_steps li").each(function(a,b){$(this).prepend("<label>"+(a+1)+"</label>")})},parseUrl:function(e,c){var d=new RegExp(c,"gm");var b=null;var a=[];while((b=d.exec(e))!==null){if(b.length>0){a.push(b[0])}}return a},ShowLoadingUI:function(b,d,a){var e='<div class="loading-container"><div class="loading"></div><p class="message" style="text-align:center">'+b+"</p></div>";var c=a.toLowerCase();$(d+" div.loading-container").remove();if(c=="insertbefore"||c=="insertafter"){$(e)[a](d)}else{$(d)[a](e)}},LoadSessionSettings:function(){var a={};$.ajax({url:"/WebServices/Account.asmx/GetSettings",dataType:"JSON",type:"GET",async:false,beforeSend:function(){},success:function(b){a=b;if(typeof a.mustacheTemplate!="undefined"){a.mustacheTemplate=a.mustacheTemplate.replace("\\\\ctxm7\\html\\","")}Global.storeName=b.storeName;Global.customerMaintenanceEmail=b.customerMaintenanceEmail;if(b.checkoutUrl!=""&&b.CatID=="0"){Global.CheckoutURL=b.checkoutUrl}if(a.messages!=undefined&&a.messages.length>0){$.each(a.messages,function(c,d){$("body").prepend('<p style="'+d.style+'">'+d.msg+"<p>");console.log(d)})}}});return a},IsAllowedChangedAddressInPayment:function(){var a=false;$.ajax({url:"/WebServices/Account.asmx/AllowChangeAddressInPayment",dataType:"JSON",type:"POST",async:false,beforeSend:function(){},success:function(b){a=b.ALLOWED},error:function(){}});return a},CheckWebVersion:function(){return;$.ajax({url:"/Handler/info.ashx?type=json",dataType:"json",success:function(b){var c=0;if(b.Cookies){for(var a=0;a<b.Cookies.length;a++){if(b.Cookies[a].Key=="ss.ih"){c=a;break}}}if(Cookie.Get("webVersion")!=b.AppSettings[0].Value){Cookie.Set("webVersion",b.AppSettings[0].Value,7)}else{if(b.Cookies!=undefined&&b.Cookies.length>0&&Cookie.Get("webSSIH")!=b.Cookies[c].Value){Cookie.Set("webSSIH",b.Cookies[c].Value,7)}}}})},ShowContest:function(){if(!Global.settings.hideContestBanner){setTimeout(function(){$("body").append('<div id="contest" class="hidden-xs" style="display:none;"><button type="button" class="close" data-dismiss="alert" aria-label="Close"><span aria-hidden="true">Close</span></button><img src="https://file.livingstone.com.au/Images/IMG/WEBCONTEST_20171027.jpg" /></div>');$("#contest").fadeIn(500);$("#contest button").click(function(){$.ajax({url:"/WebServices/Session.asmx/SetSessionValue?name=hide_contest_banner&value=true",dataType:"json",method:"GET",complete:function(){$("#contest").fadeOut(500)}})})},1000)}},timerOfSomeoneBought:null,ShowSomeoneBought:function(){if(!Global.settings.hideSomeoneBought){setTimeout(function(){$.ajax({url:"/WebServices/Product.asmx/GetSomeoneBought",dataType:"json",method:"GET",async:true,success:function(a){if(a.SUCCESS&&a.DATA!=undefined){$("#someone-bought").remove();$.get(Global.templateURL,function(c){var b=$(c).filter("#someone-bought").html();$("body").append(Mustache.to_html(b,a));$("#someone-bought button").click(function(){clearTimeout(Global.timerOfSomeoneBought);$("#someone-bought").off("mouseleave");$("#someone-bought").fadeOut(500);$.ajax({url:"/WebServices/Session.asmx/SetSessionValue?name=hide_someone_bought&value=true",dataType:"json",method:"GET",complete:function(){$("#someone-bought").remove()}})});$("#someone-bought").mouseover(function(){clearTimeout(Global.timerOfSomeoneBought)}).mouseleave(function(){Global.timerOfSomeoneBought=Global.runSomeoneBought()});$("#someone-bought div.item:first").addClass("active");$("#someone-bought").addClass("hidden-xs").fadeIn(500,function(){setTimeout(function(){Global.timerOfSomeoneBought=Global.runSomeoneBought()},10000)})})}}})},1000)}},runSomeoneBought:function(){$("#someone-bought").fadeOut(500,function(){setTimeout(function(){var a=$("#someone-bought div.item.active").removeClass("active").next("div.item");if(a.length>0){a.addClass("active");$("#someone-bought").fadeIn(500,function(){Global.timerOfSomeoneBought=setTimeout(function(){Global.runSomeoneBought()},10000)})}},3000)})},isEmailValid:function(a){return/^\w+([-+.']\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*$/i.test(a)},OpenGenericLoginModal:function(b,a,c){if(typeof b=="undefined"||b==""){b=function(){location.href="/"}}Global.LoadGenericModal("body","popup-login",function(){var d=$("#popup-login");d.find("h4.modal-title").html("Please Login");var e=c||"#PopUpLoginForm";Global.LoadTemplate(e,function(g){d.find("div.modal-body").html(g);jQuery(d).find("#btnretrievepassword").unbind("click.Global_OpenGenericLoginModal1").bind("click.OpenGenericLoginModal1",function(){jQuery.ajax({url:"/WebServices/Account.asmx/ForgotPassword",data:[{name:"email",value:jQuery(d).find("#txtemailpassword").val()}],type:"POST",dataType:"json",beforeSend:function(){jQuery(d).find("#btnretrievepassword").val("Checking");jQuery(d).find(".message-list .alert").remove()},complete:function(){jQuery(d).find("#btnretrievepassword").val("Retrieve Password")},success:function(h){if(h.SUCCESS){jQuery(d).find(".message-list").append("<p class='alert alert-success'>"+h.MESSAGE+"</p>");jQuery(d).find(".input-group").css("display","none")}else{jQuery(d).find(".message-list").append("<p class='alert alert-danger'>"+h.MESSAGE+"</p>")}},error:function(){jQuery(d).find(".message-list").append("<p class='alert alert-danger'>General Error</p>")}})});jQuery(d).find(".forgotPasswordLink").unbind("click.Global_OpenGenericLoginModal2").bind("click.Global_OpenGenericLoginModal2",function(h){h.preventDefault();jQuery(d).find("#frmforgotpassword").css("display","block")});if(typeof a=="function"){a(d)}var f="<strong>What is a Promo No. / Campaign Code?</strong><p>A Promo No. / Campaign Code is a code used for a specific campaign where the applicable promotional prices for an item are referred to - such as discounts or savings, bulk deals and the like. Promo No. / Campaign Codes have a specific validity period. Items included in the promotion but outside validity is subject to regular price. </p><strong>How/Where to get a Promo No. / Campaign Code?</strong><p>Promo No. / Campaign codes are indicated in most "+Global.storeName+"'s marketing materials such as monthly specials, brochures and catalogues. You can check on Monthly Specials, Brochure or Catalogues Page to check on the latest promotions. Key in the campaign code when logging-in to view the discounted prices of the items included in the promotion. <br/><br/><br/><a class=catalogueLink href='/Catalogues' target='_blank'>Catalogue, Brochure and Monthly Special</a></p>";jQuery("a#whatIsCampCode").popover({title:"Click link to close",content:f,placement:"bottom",html:true});jQuery("a#whatIsCampCode").click(function(h){h.preventDefault();$(this).popover("show")});d.find("#btnFunction").show().html("Login").removeClass("btn-primary").addClass("btn btn-success").unbind("click.login").bind("click.login",function(){d.find("div.modal-body p.alert").remove();var i=d.find("#txtEmail").val();var j=d.find("#txtPassword").val();var h=d.find("#txtcampcode").val();if(i==""){d.find("div.modal-body").prepend('<p class="alert alert-danger">User name is required</p>');return}if(j==""){d.find("div.modal-body").prepend('<p class="alert alert-danger">Password is required</p>');return}$.ajax({url:"/Handler/GenericMethodCall.ashx",data:[{name:"username",value:i},{name:"password",value:j},{name:"campcode",value:h},{name:"method_name",value:"ajax-login"}],type:"POST",dataType:"json",beforeSend:function(){d.find("div.loading-container").remove();Global.ShowLoadingUI("Signing you in, Please wait.",d.find("div.modal-body").selector,"prepend");d.find("div.login-content").hide()},success:function(k){$("div.loading-container").hide();if(k.ERROR&&k.LIST.length>0){d.find("div.login-content").show();d.find("div.modal-body").prepend('<p class="alert alert-danger">'+k.LIST[0]+"</p>")}if(k.SUCCESS){d.find("div.modal-body").prepend('<p class="alert alert-success">Reloading. Please wait.</p>');b()}},error:function(){d.find("div.modal-body").prepend('<p class="alert alert-danger">Sign-in Failed. Please try again later.</p>')}})});setTimeout(function(){d.modal("show")},500)})})},setUpRejectComment:function(){var a=$("button.submit-reject-comment");if(a.length<=0){return}a.click(function(){var c=$("textarea.comment-box");var b=$("div[id$=_divRejectedDetails]");b.find("p.alert").remove();if($.trim(c.val())==""){b.prepend('<p class="alert alert-danger">Your comment is required.</p>');return}$.ajax({url:"/WebServices/Account.asmx/RejectWebOrder",data:'{ "comment" : "'+c.val()+'" }',method:"POST",beforeSend:function(){b.prepend('<p class="alert alert-success">Processing. Please wait...</p>');b.find("div.reject-comment-control-group").fadeOut()},success:function(d){b.find("p.alert").remove();if(d.SUCCESS){b.prepend('<p class="alert alert-success">This web order ('+d.ORD_NO+") has been rejected.<br/>Notification has been sent to "+d.BUYER_EMAIL+"</p>")}else{b.find("div.reject-comment-control-group").fadeIn();b.prepend('<p class="alert alert-danger">'+d.MESSAGE+"</p>")}}})})},showMessage:function(){$('img[src="https://file.livingstone.com.au/images/slider/actual/353.png"]').attr("src","https://file.livingstone.com.au/images/slider/actual/XMAS-2017.gif");$.ajax({url:"/WebServices/Session.asmx/GetSessionByName?name=hide_xmas_message",dataType:"json",method:"GET",success:function(a){if(a.SUCCESS&&a.DATA.Value==false){$("body").prepend('<p class="xmas-message" style="display:none; background-color: red; padding:7px; font-size:1.1em; font-weight: bold; color: #fff; text-align: center;">We will be closed from Saturday 23 December 2017 until Monday 1 January 2018. Place your orders as soon as possible for timely delivery before Christmas. <a href="#">[x]</a></p>');$("p.xmas-message").fadeIn(500);$("p.xmas-message > a").click(function(b){b.preventDefault();$.ajax({url:"/WebServices/Session.asmx/SetSessionValue?name=hide_xmas_message&value=true",dataType:"json",method:"GET",complete:function(){$("p.xmas-message").fadeOut(300)}})})}}})},showPostCodeForm:function(){if(Global.settings.cartType=="punchout"){Global.LoadGenericModal("body","PostCodeForm",function(){var a=$("#PostCodeForm");a.find("modal-dialog").css({width:"350px"});a.find("h4.modal-title").html("Delivery Post Code");a.find("div.modal-body").html('<div class="form-group"><lable>Set your delivery post code for accurate Freight charge</lable><input type="text" class="form-control" placeholder="Post Code" id="txtPostCode"></div>');a.find("#btnFunction").html("Set Post Code").show().unbind("click.submitPostCode").bind("click.submitPostCode",function(){var b=a.find("#txtPostCode").val();a.find("div.modal-body p.alert").remove();if(isNaN(parseInt(b))){a.find("div.modal-body").prepend('<p class="alert alert-danger">Post Code should be numeric.</p>');return}a.find("div.form-group").hide();Global.setPostCode(b,function(c){a.find("div.modal-body p.alert").remove();if(c.SUCCESS){UC_Cart.CartCharges();a.find("div.modal-body").prepend('<p class="alert alert-success">Post Code successfully set.</p>');a.find("#btnFunction").hide();$("a.set-post-code").html("(Post Code: "+b+")");Global.settings.postCode=b}else{a.find("div.modal-body").prepend('<p class="alert alert-danger">'+c.MESSAGE+"</p>");a.find("div.form-group").show()}})});a.modal("show")})}},setPostCode:function(b,a){$.ajax({url:"/WebServices/Session.asmx/SetSessionValue?name=post_code&value="+b,dataType:"json",method:"GET",success:function(c){if(typeof a==="function"){a(c)}}})},ShowCardForm:function(){Global.LoadGenericModal("body","divCreditCard",function(){var a=$("#divCreditCard");a.find("h4.modal-title").html("Credit Card Form");a.find("#btnFunction").html("Proceed").show();a.find("div.modal-body").html('<form class="form credit-card-form"><div class="form-group row"><div class="col-xs-12 col-sm-9"><label for="txtCreditCard">Credit Card Number</label><input class="form-control" id="txtCreditCard" type="text"></div><div class="col-xs-12 col-sm-3"><label for="txtCVV">CVV</label><input class="form-control" id="txtCVV" type="password"></div></div><div class="form-group row"><div class="col-xs-6 col-sm-3"><label for="dboMonth">Expiry Date:</label><select id="cboMonth" class="form-control"></select></div><div class="col-xs-6 col-sm-5"><label for="dboMonth" style="color:#fff">Expiry Date:</label><select id="cboYear" class="form-control"></select></div></div></form>');var b="";for(var c=1;c<=12;c++){b+="<option>"+c+"</option>"}a.find("#cboMonth").html(b);var b="";for(var c=(new Date()).getFullYear();c<=((new Date()).getFullYear()+10);c++){b+="<option>"+c+"</option>"}a.find("#cboYear").html(b);a.modal("show")})},ValidateCreditCard:function(c,b,d,a){var e=[];var h=[];var g=[];var f=[];var j="";var i=new Date();c=c.replace(/[\s\-]/g,"");if(typeof c=="undefined"||c==null){c=""}if(typeof b=="undefined"||b==null){b=""}if(typeof d=="undefined"||d==null){d=""}if(typeof a=="undefined"||a==null){a=""}if(c.match(/[^0-9]/g)){h.push("Credit card is unknown")}else{if(c.length==16&&((parseInt(c.substring(0,2))>=51&&parseInt(c.substring(0,2))<=55)||(parseInt(c.substring(0,2))>=22&&parseInt(c.substring(0,2))<=27))){j="MASTERCARD"}else{if(c.substring(0,1)=="4"&&(c.length==13||c.length==16||c.length==19)){j="VISA"}else{if(c.length==15&&(c.substring(0,2)=="34"||c.substring(0,2)=="37")){j="AMEX"}else{if(c.length==14&&(c.substring(0,2)=="30"||c.substring(0,2)=="36"||c.substring(0,2)=="38")){j="DINERSCLUB"}else{if(c.length>=16&&c.length<=19&&((parseInt(c.substring(0,3))>=300&&parseInt(c.substring(0,3))<=305)||(c.substring(0,2)=="38"||c.substring(0,2)=="39")||c.substring(0,4)=="3095")){j="DINERSCLUB"}}}}}if(j==""){h.push("Credit card is unknown")}if(j=="AMEX"&&a.length!=4){f.push("AMEX requires 4-digit CVV")}if(i.getFullYear()>parseInt(d)||(i.getFullYear()==parseInt(d)&&i.getMonth()>parseInt(b))){h.push("Card is expired")}}if(h.length>0){e.push(h[0])}if(g.length>0){e.push(g[0])}if(f.length>0){e.push(f[0])}return e},GetRecaptchaResponse:function(){var b="";if(typeof(grecaptcha)!="undefined"){b=grecaptcha.getResponse();if(b==""){for(var a=0;a<___grecaptcha_cfg.count;a++){b=grecaptcha.getResponse(a);if(b!=""){break}}}}if(b.length==0){alert("Captcha verification failed");return""}return b},ForgotPassword:function(){var a=$(this);jQuery.ajax({url:"/WebServices/Account.asmx/ForgotPassword",data:[{name:"email",value:$("input[name=txtEmail]").val()}],type:"POST",dataType:"json",beforeSend:function(){$(a).val("Checking");$("p.alert").remove()},complete:function(){$(a).val("Retrieve Password")},success:function(b){if(b.SUCCESS){$("<p class='alert alert-success'>"+b.MESSAGE+"</p>").insertBefore("div.form-group.email");$("div[id$=divForgotPassword]").find("div.form-group").hide()}else{$("<p class='alert alert-danger'>"+b.MESSAGE+"</p>").insertBefore("div.form-group.email")}},error:function(){$("<p class='alert alert-danger'>General Error</p>").insertBefore("div.form-group.email")}})}};var FlashMessage={DefDuration:3000,CustomDivStyle:"",ShowMessage:function(e,f,c){var b=c|FlashMessage.DefDuration;var d=f.toUpperCase()=="WARNING"?"":f.toUpperCase();$("body").prepend('<div style="'+FlashMessage.CustomDivStyle+'" class="alert alert-'+f.toLowerCase()+' alert-dismissible flash-message" role="alert"><button type="button" class="close" data-dismiss="alert" aria-label="Close"><span aria-hidden="true">&times;</span></button><strong>'+d.toUpperCase()+"</strong> "+e+"</div>");var a=$("body .flash-message");a.on("closed.bs.alert",function(){a.remove()});a.fadeIn();setTimeout(function(){a.fadeOut(function(){a.remove()})},b)}};var MustacheExtension={RegisterCustomFunction:function(){if(typeof(Mustache)!=="undefined"){Mustache.Formatters={date:function(b){var a;if(/^\/Date\(/.test(b)){a=new Date(parseInt(b.replace("/Date(","")))}else{a=new Date(b)}return(a.getDate()+"/"+(a.getMonth()+1)+"/"+a.getFullYear())},dateTime:function(b){var a;if(/^\/Date\(/.test(b)){a=new Date(parseInt(b.replace("/Date(","")))}else{a=new Date(b);if(isNaN(a)){a=new Date(b.replace("-","/"))}}return(a.getDate()+"/"+(a.getMonth()+1)+"/"+a.getFullYear()+" "+a.getHours()+":"+a.getMinutes())},displayLoginText:function(b){var a=/\/authentication/i;if(a.test(b)){return"Login To View"}return"Download"},catalogueResponse:function(a){if(a=="ACCESS_NOT_ALLOWED"){return"Your account does not belong to this market."}return"Your account does not belong to this market. Please <a href='"+a+"'>click here</a> to redirect to correct market."},displayPrice:function(a){if(isNaN(parseFloat(a))){return a}if(parseFloat(a)==0&&Global.settings.loggedType!="customer"){return"Login for Trade Prices"}return"AUD "+parseFloat(a).toFixed(2)},displayCartPrice:function(a){if(isNaN(parseFloat(a))){return a}if(parseFloat(a)==0){return"--"}return"AUD "+parseFloat(a).toFixed(2)},urlencode:function(a){return Utility.urlencode(a)},removeSpecialChar:function(a){return a.replace(".","").replace(" ","").replace(/\//g,"__SLASH__")},toFixed2:function(a){return parseFloat(a).toFixed(2)},renameImage:function(d){if(d==null||d==""){return""}var a=/(\.png|\.jpg)/.exec(d)[0];var b=d.replace(a,"");var c=b+"-L"+a;return c}}}}};jQuery(document).ready(function(){Global.initAjax();Global.settings=Global.LoadSessionSettings();MustacheExtension.RegisterCustomFunction();Global.LoadGenericModal("body");jQuery("#cart-container").hide();if($("body").width()<=425){$("div[id$=div-category]").attr("class","collapse").attr("style","height: 0px;")}if(/ApproveOrder.+token.+approve/i.test(location.href)){Global.setUpRejectComment()}if($("div.emailSubscriptionContainer.mini").length>0){$("input[name=email]").keyup(function(){if($(this).val().length>3){$("div.emailSubscriptionMini.recaptcha").show()}else{$("div.emailSubscriptionMini.recaptcha").hide()}})}$("form[name=SubscribeForm]").submit(function(a){$("input[name=grResponse]").val(Global.GetRecaptchaResponse())});$("head").append('<link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Source+Sans+Pro" /><link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Oswald" />')});var CatalogueView={Render:function(b){var a=jQuery("[id$=catalogue-container]");if(a.length<=0){return}jQuery.ajax({url:"/WebServices/Catalogue.asmx/GetCatalogue",dataType:"json",type:"GET",async:true,contentType:"application/json; charset=utf-8",beforeSend:function(c,d){a.append('<div class="loading"></div>')},success:function(d){var c=$.parseJSON(d.d);$.each(c.catalogue,function(f,g){var e=g.type;$.each(g.list,function(h,i){if(i.header==""&&e=="MonthlySpecials"){i.type="MonthlySpecials"}else{i.type=i.header}$.each(i.files,function(j,k){if(k.file_path.indexOf("/Authentication")>-1){k.loginRequired=true}})})});$.get(Global.templateURL,function(g){var f=$(g).filter("#catalogue-template").html();a.html(Mustache.to_html(f,c));$("ul.nav.nav-pills li:first-child").addClass("active");$("div.tab-content div:first-child").addClass("active");var e=["search","dashboard","authentication","catalogues"];Global.fullWidthEnableOn(e);Global.adjustElementHeight($("ul.file-list li"),30,343);$('ul.catalogue-tab li a[data-toggle="tab"]').on("shown.bs.tab",function(h){Global.adjustElementHeight($("ul.file-list li"),30,343)});if(location.href.indexOf("/Catalogues")>0&&location.hash!=""){$("ul.catalogue-tab").find('a[href="'+location.hash+'"]').click()}if(location.href.toLowerCase().indexOf("/catalogues/catalogues")>0||location.href.toLowerCase().indexOf("/catalogues/brochures")>0){$("ul.catalogue-tab").find('a[href="#Others"]').click()}if(typeof Catalogue!=="undefined"&&typeof Catalogue.Loaded==="function"){Catalogue.Loaded()}if(typeof b==="function"){b()}},"text")},complete:function(){a.find(".loading").remove()}})},ShowRevision:function(b,a,c){$(".modal-title").html(b);$("#frame-latestnews-modal").attr("src","/ViewBS/CMS.aspx?type=LATESTNEWS&keyword="+a+"&reference="+c);$("#frame-revision-modal").attr("src","/ViewBS/CMS.aspx?type=AMENDMENTS&keyword="+a+"&reference="+c);$("#revisionModal").modal("show")}};var ProductView={ProductTemplateName:"product-template",CustomFormatting:function(a){},Render:function(a,b,c){if(b==undefined||b==null){return}c=c||"";if(typeof a==="undefined"){a=$("[id$=product-container]");b=jQuery("[id$=_hidProductNo]").val();if(a.length<=0){return}}else{if(!$("div.featured-product").hasClass("featured-product")&&jQuery(a).attr("id")!="generic-container"){a=jQuery(a).closest("#generic-container")}}$(a).parent().find("h4.modal-title").html(b.toUpperCase());return jQuery.ajax({url:"/WebServices/Product.asmx/GetProductById",data:{id:b,promo_code:c,page:1},dataType:"json",type:"GET",async:true,contentType:"application/json; charset=utf-8",error:function(){jQuery(a).html("Error loading item<br><a href='#' onclick='Product.ProductModalView(\""+b+"\")'>Tap to retry</a>")},success:function(d){var e=$.parseJSON(d.d);ProductView.InjectPages(e);Global.LoadTemplate("#"+ProductView.ProductTemplateName,function(g){ProductView.Format(e);ProductView.CustomFormatting(e);a.empty();a.html(Mustache.to_html(g,e));ProductView.PriceHighlighter($("#txtQty"),".item-info");ProductView.InitializeGUI();var f=ga4.FormatItem(e.Product);if($(a).find("div.item-variation-option").length>0){ProductView.LoadItemVariation(b,"",$(a).find("div.item-variation-option"),function(){var h=[];$("div.item-variation-option div.item-option ul li.selected").each(function(j,k){h.push($(k).find("a").html())});f.item_variant=h.join(";");ga4.SubmitViewItem(f)})}else{ga4.SubmitViewItem(f)}ProductList.detailsLoaded(a);Star();if(c!=""){$(a).find("select.productRef option[value="+b+"]").attr("data-promo",c)}$(a).find(".item-image-tile").lazyload();$(a).find(".item-image-tile").on("mouseenter",function(){jQuery(this).closest(".image-selector").find(".image-selected").removeClass("image-selected");jQuery(this).addClass("image-selected");var h=jQuery(this).attr("data-original");jQuery(a).find("div.image-box img").attr("src",h)});if($(a).parent().find("h4.modal-title").length==0&&typeof e.bundle=="undefined"){ProductView.GetItemBundle("div.item-bundle",b);$("div.row.no-bundle").hide()}_klaviyo.viewedItem(e.Product);ProductView.RenderComplete()},"text")}})},LoadItemVariation:function(c,b,a,d){$.ajax({url:"/WebServices/Product.asmx/LoadItemVariation",data:'{ "item_no" : "'+c+'", "filters" : "'+b+'" }',method:"POST",dataType:"JSON",success:function(g){var f={};f.options=[];var e=[];if(g.SUCCESS){$.each(g.DATA.options,function(h,j){if($.inArray(j.attribute,e)<0){e.push(j.attribute)}});$.each(e,function(j,k){var h=ProductView.GetChildItemVariation(e[j],g.DATA.options);f.options.push({attr_name:e[j],index:(j+1),attr_list:h})})}Global.LoadTemplate("#ItemVariationSection",function(i){var h=Mustache.to_html(i,f);a.empty().append(h);if(typeof d==="function"){d()}a.find("div.item-option ul li a").off("click.optionClick").on("click.optionClick",function(k){k.preventDefault();var j=$(this);j.parent().siblings("li").removeClass("selected");j.parent().addClass("selected");var l=[];a.find("div.item-option ul li.selected a").each(function(m,n){l.push($(n).attr("data-name")+":"+$(n).attr("data-value"))});ProductView.FilterItemVariation(c,l.join(";"),j.attr("data-name")+":"+j.attr("data-value"))})})}})},FilterItemVariation:function(b,a,c){$.ajax({url:"/WebServices/Product.asmx/LoadItemVariation",data:'{ "item_no" : "'+b+'", "filters" : "'+a+'", "option_clicked" : "'+c+'" }',method:"POST",dataType:"JSON",success:function(d){if(d.DATA.item_matched!=undefined&&d.DATA.item_matched.length>0){location.href=d.DATA.item_matched[0].url}else{alert("item variation not found")}}})},GetChildItemVariation:function(c,b){var a=[];$.each(b,function(d,e){if(e.attribute==c){a.push({attr_value:e.attr_value,selected:e.selected,enabled:e.enabled})}});return a},RenderComplete:function(){},Format:function(e){if(e.ERROR){return}if(e.isVisitorSinglePrice||(e.Product.view_as_single_price&&e.priceLoginRequired&&e.isLoggedIn)){e.priceLoginRequired=false;e.isThreeTierEnabled=false}if(e.priceLoginRequired&&(e.option_button=="SET_AFFINITY"||e.option_button=="TRADE_PRICE")){var c=e.Prices.length;if(c==3){var b=Global.pricesMask(3);for(var d=0;d<c;d++){e.Prices[d].comment=b[d]}}if(c==2){var b=Global.pricesMask(2);for(var d=0;d<c;d++){e.Prices[d].comment=b[d]}}if(c==1){e.Prices[0].comment=Global.pricesMask(1)}}e.few_left=false;e.available_now=false;e.out_of_stock=false;if(e.with_stock==false){e.few_left=true}else{e.available_now=true}e.showaddtocart=true;if(e.Product.visibility_mode=="FORCE_OUT_OF_STOCK"){e.out_of_stock=true;e.showaddtocart=false;e.few_left=false;e.available_now=false}if(e.Product.visibility_mode=="POA"){e.poa=true;e.showaddtocart=false}if(e.option_button=="TRADE_PRICE"&&e.priceLoginRequired){e.option_button_trade_price=true}if(e.option_button=="SET_AFFINITY"&&e.priceLoginRequired){e.option_button_set_affinity=true;e.showaddtocart=false}if(e.priceLoginRequired&&e.option_button==undefined){e.option_button_trade_price=true}if(e.isVisitorSinglePrice){e.option_button_special_bulk_price=true;e.option_button_trade_price=false}if(typeof e.bundle!="undefined"){for(var a=0;e.bundle.Items.length>a;a++){e.bundle.Items[a].first=a==0}}if(e.Product!=undefined&&e.Product.HTML_detailed_description!=undefined&&e.Product.HTML_detailed_description!=""){e.Product.use_data_cleansed=true}else{e.Product.use_data_cleansed=false}},InitializeGUI:function(){$("#rating").barrating({theme:"css-stars",initialRating:1,showSelectedRating:true});$(".btnQtyMinus").click(function(){var a=$(this).attr("data-request-id").replace("btnQtyMinus_","");var b=$("[data-request-id=txtQty_"+a+"]");if(isNaN(parseInt(b.val()))){b.val("1");$("[data-request-id=txtQty_"+a+"]").trigger("change");return}if((parseInt(b.val())-1)<=0){b.val("1");return}b.val(parseInt(b.val())-1);$("[data-request-id=txtQty_"+a+"]").trigger("change")});$(".btnQtyPlus").click(function(){var a=$(this).attr("data-request-id").replace("btnQtyPlus_","");var b=$("[data-request-id=txtQty_"+a+"]");if(isNaN(parseInt(b.val()))){b.val("1");$("[data-request-id=txtQty_"+a+"]").trigger("change");return}b.val(parseInt(b.val())+1);$("[data-request-id=txtQty_"+a+"]").trigger("change")});$("#btnPost").click(function(){if(ProductView.ValidateComment()){ProductView.PostComment()}});$("#btnAddComment").click(function(){$(".comment-form").slideToggle()});$.fn.notexists=function(a){return this.length==0};$("select.productRef").unbind("change.productRef").bind("change.productRef",function(){if($("#generic-container .row").notexists()||jQuery(this).closest(".row").parent().attr("id")!="generic-container"){var a=window.location.origin+"/Product/id/"+jQuery(this).val()+"/";if(a){window.location=a}return false}else{Product.ProductModalView(jQuery(this).val(),"")}});$("#review ul.pagination li a").click(function(a){a.preventDefault();$("#review ul.pagination li.active").removeClass("active");var b=$(this);jQuery.ajax({url:"/WebServices/Product.asmx/GetProductComments",data:{id:jQuery("[id$=_hidProductNo]").val(),page:b.html()},dataType:"json",type:"GET",async:false,contentType:"application/json; charset=utf-8",success:function(e){var d=$.parseJSON(e.d);var c=$("ul.comments");c.empty();Global.LoadTemplate("#comments-template",function(f){c.html(Mustache.to_html(f,d))});b.parent().addClass("active")}})});$(".msds-download").off("click.msds-download").on("click.msds-download",function(b){if($(this).hasClass("msds-download-verificaiton")||$(this).attr("target")=="_blank"){return}var a=$(this);b.preventDefault();$(this).append("<span class='msds-download-verification' style='padding-left:3px;'>(Verifying...)</span>");$.ajax({url:"/WebServices/Product.asmx/CheckForPurchase",data:{item_no:$(a).attr("data-itemno")},type:"GET",dataType:"json",success:function(c){if(c.ord_no!==undefined){$(a).attr("target","_blank");$(a).attr("href","https://file.livingstone.com.au/MSDS/"+$(a).attr("data-itemno")+".pdf");window.open($(a).attr("href"),"_blank")}else{alert("Please purchase this item first to download the MSDS.")}},complete:function(){$(a).find(".msds-download-verification").remove()}})})},ValidateComment:function(){var b=true;var c=$("span.txtSubject");var a=$("span.txtBody");c.hide();a.hide();if($("#txtSubject").val()==""){c.html("Title is required").show();b=false}if($("#txtBody").val()==""){a.html("Description is required").show();b=false}return b},CreateComment:function(){var b=($("#rating option:selected").val()==undefined)?"5":$("#rating option:selected").val();var a='{ "subject" : "'+$("#txtSubject").val()+'", "body" : "'+$("#txtBody").val()+'", "item" : "'+$("#hidItemNo").val()+'", "rating" : "'+b+'" }';return a},InjectPages:function(b){if(typeof b.CommentPages=="object"){if(typeof b.CommentPages.Pages=="undefined"){b.CommentPages.Pages=[];for(var a=1;a<=b.CommentPages.TotalPages;a++){b.CommentPages.Pages.push({idx:a,active:(b.CommentPages.CurrentPage==a)})}}}if(typeof b.Product=="object"){b.Product.requestId=$.now()}},PostComment:function(){var a=ProductView.CreateComment();jQuery.ajax({url:"/WebServices/Product.asmx/PostComment",data:a,dataType:"json",type:"POST",async:true,processData:false,beforeSend:function(){},success:function(b){var c=($.parseJSON(b));if(c.SUCCESS&&c.MSG=="COMMENT_SAVED"){$(".comment-form").empty().append("<p class='alert alert-success'>Your review was successfully saved. The administrator will check your review.</p>")}else{if(c.ERROR){ErrorHelper.Show($(".comment-form"),c.ERR_MSG+":<br/>"+c.ERR_DESC,ErrorHelper.TYPE.ERROR)}else{ErrorHelper.Show($(".comment-form"),"Oops, something went wrong. Please contact webmaster.",ErrorHelper.TYPE.ERROR)}}},error:function(b){ErrorHelper.Show($(".comment-form"),"Oops, something went wrong. Please contact webmaster.",ErrorHelper.TYPE.ERROR)}})},PriceHighlighter:function(c,b,a){jQuery(c).change(function(){ProductView.PriceHighlighterFunc(this,b);if(typeof a==="function"){a(this)}})},PriceHighlighterFunc:function(b,e){var d=0;var f=$(b).val();var h=$(b).closest(e).find(".item-three-prices").find("tr");$(h).removeClass("price-hightlight");if(!isNaN(f)&&f!=""&&parseInt(f)>0){for(var c=0;c<h.length;c++){var g=$(h[c]).attr("data-qty");if(g!==undefined){g=parseFloat(g);if(f>=g){d=c}}}$(h[d]).addClass("price-hightlight");var a=$(".savings .price .amount");if(a.length>0){var j=$(h[d]).find(".item-three-price").html();a.html(j)}}},GetItemBundle:function(b,c){if($(".item-info .price").text()=="Please call Livingstone to purchase this item."){return}var a=$(b);if(a.length>0){if(c!=undefined&&c!=""){$.ajax({url:"/WebServices/Product.asmx/GetItemBundle?id="+c,dataType:"json",method:"GET",success:function(d){if(d.SUCCESS&&d.PRODUCTS.length>1){var e=0;$.each(d.PRODUCTS,function(j,l){var h=0;var f=false;for(var g=0;g<d.BUNDLE.length;g++){if(d.PRODUCTS[j].item_no==d.BUNDLE[g].item_no){h=g;f=true;break}}if(typeof d.PRODUCTS[h]!=="undefined"){d.PRODUCTS[h].total_qty=0;d.PRODUCTS[h].item_exists=false}if(f){d.PRODUCTS[j].total_qty=d.BUNDLE[h].total_qty;d.PRODUCTS[j].item_exists=d.BUNDLE[h].item_exists}});$.each(d.PRODUCTS,function(f,g){if(d.PRODUCTS[f].item_exists==false){e+=g.price}if(d.IS_LOGIN_REQUIRED){g.price=0}});Global.LoadTemplate("#template-fbt",function(g){var f=Mustache.to_html(g,d);a.append(f).closest(".row").show();var h="Login for Trade Prices";if(!d.IS_LOGIN_REQUIRED){h="AU $"+e.toFixed(2);$("div.item-bundle ul.other-details span.AddToCart").show()}$("div.item-bundle ul.other-details span.total").html(h);$("ul.other-details span.AddToCart").click(function(){$("div.item-bundle [name=chkItem]:checked").each(function(i,l){var j=$(l).attr("data-item");var k="R";if($(l).attr("data-location")!=undefined&&$(l).attr("data-location")!=""){k=$(l).attr("data-location")}UC_Cart.InsertCart("img_"+Mustache.Formatters.removeSpecialChar(j),j,1,"",k)});$('<p class="alert alert-success">Item(s) selected added to cart</p>').insertBefore("div.item-bundle ul.images")});$("div.item-bundle [name=chkItem]").change(function(){e=0;var i=$(this).attr("data-item");i=Mustache.Formatters.removeSpecialChar(i);if(!$(this).is(":checked")){$("div.item-bundle ul.images li#li_"+i).addClass("out")}else{$("div.item-bundle ul.images li#li_"+i).removeClass("out")}$("div.item-bundle [name=chkItem]:checked").each(function(k,l){e+=parseFloat($(l).attr("data-value"))});var j="Login for Trade Prices";if(!d.IS_LOGIN_REQUIRED){j="AU $"+e.toFixed(2)}$("div.item-bundle ul.other-details span.total").html(j);if(e>1&&!d.IS_LOGIN_REQUIRED){$("div.item-bundle ul.other-details span.AddToCart").show()}else{$("div.item-bundle ul.other-details span.AddToCart").hide()}});$("div.item-bundle li button.quick-view").click(function(j){var i=$(this);Product.ProductModalView(i.attr("data-item"),i.attr("data-promo"))});$("div.item-bundle a.quick-view").click(function(j){j.preventDefault();var i=$(this);Product.ProductModalView(i.attr("data-item"),i.attr("data-promo"))})})}}})}}}};var ErrorHelper={TYPE:{WARNING:"alert alert-warning",ERROR:"alert alert-danger"},Show:function(b,d,a){var c=$(b).find("p.alert");a=a||ErrorHelper.TYPE.WARNING;if(c.length>0){c.remove()}$(b).prepend("<p class='"+a+"'>"+d+"</p>")}};var Star=function(){$("[data-rating]").each(function(b,f){var d=$(f);var c=d.attr("data-rating");var e="";d.empty();for(var a=1;a<=5;a++){e=e+"<i class='"+(a<=c?"on":"off")+"'>&#9733;</i>"}d.html(e)});$(".user .bar-rating").each(function(a,d){var c=$(d);var e=parseFloat(c.attr("data-vote"));var f=parseFloat(c.attr("data-vote-total"));var b=parseFloat(e/f)*100;if(b>0){c.html('<b class="content-bar" style="width: '+b+'%;"></b>')}})};var StateData={Get:function(d,c){var e=null;if(jQuery("form#state input#"+d).length==0){jQuery("form#state").append("<input type='hidden' id='"+d+"' name='"+d+"' />")}var b=jQuery("form#state input#"+d).val();var a=null;if(b!=""&&typeof b!="undefined"){a=JSON.parse(b)}else{a=[]}if(typeof c=="undefined"||c==""){e=a}else{jQuery(a).each(function(){if(this.key==c){e=this.value;return false}});if(e==null||typeof e=="undefined"){e=""}}return e},Set:function(d,c,e){var b=StateData.Get(d);var a=false;jQuery(b).each(function(){if(this.key==c){this.value=e;a=true}});if(!a){b.push({key:c,value:e})}jQuery("form#state input#"+d).val(JSON.stringify(b))}};var LightSlider={Activate:function(){if(typeof ItemScroll!="undefined"&&typeof ItemScroll.beforeLoad=="function"){ItemScroll.beforeLoad()}$("#lightSlider, #lightSlider2").each(function(a,b){if($(b).find("li.lslide").length>0){return}$(b).lightSlider({item:5,autoWidth:false,slideMove:5,slideMargin:10,addClass:"col-xs-12",mode:"slide",useCSS:true,cssEasing:"ease",easing:"linear",speed:400,auto:false,loop:false,slideEndAnimation:true,pause:2000,keyPress:false,controls:true,prevHtml:'<span class="glyphicon glyphicon-chevron-left" aria-hidden="true"></span>',nextHtml:'<span class="glyphicon glyphicon-chevron-right" aria-hidden="true"></span>',rtl:false,adaptiveHeight:false,vertical:false,verticalHeight:500,vThumbWidth:100,thumbItem:10,pager:true,gallery:false,galleryMargin:5,thumbMargin:5,currentPagerPosition:"middle",enableTouch:true,enableDrag:true,freeMove:true,swipeThreshold:40,responsive:[{breakpoint:800,settings:{item:3,slideMove:1,slideMargin:6}},{breakpoint:480,settings:{item:2,slideMove:1}}],onBeforeStart:function(c){},onSliderLoad:function(c){},onBeforeSlide:function(c){},onAfterSlide:function(c){},onBeforeNextSlide:function(c){},onBeforePrevSlide:function(c){}})})}};var produdctImageSlider=function(){var e=0;var a=0;var d;var b=function(){console.log("init");if($("div.image-selector img.item-image-tile").length<=1){return}console.log("okay");e=$("div.image-selector img.item-image-tile").length;c();$("div.image-selector img.item-image-tile").off("click.stopSlider").on("click.stopSlider",function(){clearInterval(d)});$("div.image-selector img.item-image-tile").each(function(f,h){var g=$(h).attr("data-original");if(g==undefined){return}$(h).attr("data-original",g.replace("180x180","300x300"))});$("div.image-box").prepend('<p style="float:right"><a href="#" class="btn btn-danger product-slider-button" data-function="stop" style="padding-top:2px;padding-bottom:2px">Stop Slide Show</a></p>');$("a.product-slider-button").off("click.productSlider").on("click.productSlider",function(f){f.preventDefault();if($(this).attr("data-function")=="stop"){clearInterval(d);$(this).text("Play Slide Show");$(this).attr("data-function","play");$(this).removeClass("btn-danger").addClass("btn-success")}else{c();$(this).text("Stop Slide Show");$(this).attr("data-function","stop");$(this).removeClass("btn-success").addClass("btn-danger")}})};var c=function(){d=setInterval(function(){var f=$($("div.image-selector img.item-image-tile")[a]).attr("data-original");if(f==undefined){a+=1;return}$($("div.image-selector img.item-image-tile")[a]).trigger("mouseenter");a+=1;if(a>=e){a=0}},3000)};return{init:b}}();var mailOption=function(){var b=function(){$.ajax({url:"/WebServices/Account.asmx/LoadMailOption",method:"GET",success:function(d){if(d.SUCCESS){$("div.mail-opt-out").find("input[name=chkJoinMail]").prop("checked",d.join_mailing==1);$("div.mail-opt-out").find("input[name=chkJoinEmail]").prop("checked",d.join_email==1)}a()}})};var a=function(){$("div.mail-opt-out").find("input[name=chkJoinMail], input[name=chkJoinEmail]").change(function(){if(Global.settings.loggedType=="not_log_in"){return}c()})};var c=function(){$.ajax({url:"/WebServices/Account.asmx/SaveMailOption",method:"POST",data:'{ "join_mailing": "'+$("div.mail-opt-out").find("input[name=chkJoinMail]").is(":checked")+'", "join_email": "'+$("div.mail-opt-out").find("input[name=chkJoinEmail]").is(":checked")+'" }',beforeSend:function(){$("div.mail-opt-out").find("p.alert").remove()},success:function(d){if(d.SUCCESS){$("div.mail-opt-out").append('<p class="alert alert-success">Saved</p>')}else{$("div.mail-opt-out").append('<p class="alert alert-success">'+d.MESSAGE+"</p>")}}})};return{init:b}}();$(document).ready(function(){if(location.hash.indexOf("#",0)>-1){location.href=location.hash.replace("#","")}if(Global.cat_id=="0"||Global.showMaximumBenefit){$("#header_logo > img").attr("src","https://file2.livingstone.com.au/Images/Logo/FortyYears/"+Global.cat_id+".gif")}$("img.lazy-image").lazyload();if($("div.featured-product").length>0){ProductView.Render($("div.featured-product"),"COVID-19TST","")}if($("div.mail-opt-out").length>0){mailOption.init()}if($("div.emailSubscriptionContainer").length>0){if($("div.emailSubscriptionMini.recaptcha").length>0){$("div.emailSubscriptionContainer").find("input.email").focus(0,function(){if(typeof grecaptcha==="undefined"){$("div.emailSubscriptionMini.recaptcha").append('<script src="https://www.google.com/recaptcha/api.js"></script>')}})}}if(Global.settings.cartType=="punchout"){$("a.set-post-code").unbind("click.setPostCode").bind("click.setPostCode",function(a){a.preventDefault();Global.showPostCodeForm()});if(Global.settings.postCode!=undefined&&Global.settings.postCode!=""){$("a.set-post-code").html("(Post Code: "+Global.settings.postCode+")")}if(Global.settings.postCode==""){Global.showPostCodeForm()}$("a.set-post-code").show()}ga4.InitClickEvent();if($("#ctl00_cph_body_UC_Blueprint1_bank-details-section").length>0){$("#ctl00_cph_body_UC_Blueprint1_bank-details-section").attr("id","bank-details-section");if((new Date())>=(new Date("Mar 01 2024"))){$("div.bank-details-section").hide()}}$("div.chat-placeholder").on("mouseenter",function(){var a=$(this);$("body").append('<script id="ze-snippet" src="https://static.zdassets.com/ekr/snippet.js?key=31e5fa13-0315-4843-b62f-246d2ef29b95"> </script><script> !function(e,t){if(!window.outbound){for(var n=window.outbound=[],o=["identify","track","handlePush","registerApnsToken","registerGcmToken","disableApnsToken","disableGcmToken"],r=0;r<o.length;r++){var i=o[r];n[i]=function(e){return function(){var t=Array.prototype.slice.call(arguments);return t.unshift(e),n.push(t),n}}(i)}if(!e.getElementById("outbound-js")){var s=e.createElement("script");s.type="text/javascript",s.id="outbound-js",s.async=!0,s.src="https://cdn.outbound.io/"+t+".js";var u=e.getElementsByTagName("script")[0];u.parentNode.insertBefore(s,u)}}}(document,"PUBLIC_KEY"); </script>');a.remove();$.ajax({url:"/WebServices/Session.asmx/SetSessionValue?name=chat_activated&value=true",success:function(){}})})});window.addEventListener("load",function(){if(window.location.href.indexOf("/ViewBS/OneCheckout.aspx")!=-1){var b=jQuery(".payment-success").find("#ctl00_cph_body_UC_Blueprint1_lblAmount")[0].innerText.replace(/[^0-9.]/g,"");var a=window.location.href.split("&ord_no=")[1];if(!a){a=$("#ctl00_cph_body_UC_Blueprint1_lblOrderNo").text()}if(typeof gtag!==undefined){gtag("event","conversion",{send_to:"AW-11333774074/VifBCMmvrvMYEPrVrpwq",value:b,currency:"AUD",transaction_id:a})}}});document.addEventListener("click",function(a){if(a.target.closest('[href*="tel:1300548289"]')){if(typeof gtag!==undefined){gtag("event","conversion",{send_to:"AW-11333774074/22cFCNKvrvMYEPrVrpwq"})}}if(a.target.closest("#btn_cart,#btnAddToCart")){if(typeof gtag!==undefined){gtag("event","conversion",{send_to:"AW-11333774074/PT62CMyvrvMYEPrVrpwq"})}}},{capture:true});function isIE(){var b=!!document.documentMode;var a=!b&&!!window.StyleMedia;return b||a}Global.singlePage=false;if(location.hash!=""){Global.singlePage=true}Global.showMaximumBenefit=false;Global.bootStrapWebsite=true;Global.nivoSlider.directionNav=true;Global.nivoSlider.controlNav=false;Global.nivoSlider.effect="slideInRight";Global.SearchConfig.useNewSearch=true;Global.productHeader.specials="Featured Items";Global.seamlessEnable=false;Global.nivoSlider.afterChange=function(){Slider.resize()};Global.cat_id=2223113;Global.preloadCategories=true;Global.ContentContainer=jQuery("div.right-pane");Global.afterLoad=function(){Global.fullWidthEnableOn();jQuery(".products .PageHeader ul").show();Slider.resize();jQuery(window).resize(function(){if(jQuery("body").width()>991){var b=jQuery("div[id$='div-category']");if(!b.hasClass("in")&&typeof $(b).collapse!=="undefined"){$(b).collapse("show")}}Slider.resize()});var a=Global.LivPushMenuGetSelectedCategory();if(jQuery("nav.preload-categories").length>0){jQuery("nav.preload-categories").livPushMenu({preload:true,version:"20230614-001",slideDirection:"ltr",slideSpeed:200,backText:"Back",initialSelected:a,doneLoadFile:function(){$("nav.preload-categories li.no_child").livAjaxPage(null,1)}})}else{jQuery("[id$=_div-category] ul.tree").livPushMenu({slideDirection:"ltr",slideSpeed:200,backText:"Back",initialSelected:a})}Global.CreateOrderStepsNumbering();jQuery(document).ready(function(){var c=jQuery('iframe[id$="_iframe_pages"]');var b=c.contents().find("body").height();var e=c.height();if(b>e){jQuery(c).css({width:"100%","border-style":"none"});var d=b+100;jQuery(c).height(d)}});CatalogueView.Render();ProductView.Render()};var Slider={resize:function(){var a=$("#slider .nivo-main-image");if(a.length>0){$("#tmnivoslider").css("max-height",a[0].height)}}};var routerManager=function(a,B,o,y,x,z){var j;var i;var d;var k=B;var m=false;var h=o;var c=null;var b=null;var f=y;var e=x;var g=z;var l={onLoadingView:function(F){a(F.selector).empty().html('<div><div class="loading"></div><p style="text-align:center">Loading. Please wait</p></div>')},onErrorLoadingView:function(G,F){a(G.selector).empty().html("Error loading view. Please try again.");E(F)}};var E=function(F){if(m==true&&typeof console==="object"&&typeof console.log==="function"){console.log(F)}};var s=function(){return window.location.href.substr(window.location.href.indexOf("#")+1)};var p=function(F){return F.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&")};var r=function(){j=window.location.protocol;i=window.location.host;d=j+"//"+i;return d};var v=function(){return location.href.indexOf("#")==-1};var t=function(F,I){if(F==null){return""}var J="";var G=F.split("\n");for(var H=0;H<G.length;H++){if(/https:\/\//.test(G[H])){G[H]=G[H].replace("https:","https;")}var K=G[H].split(":");if(K.length==2&&K[0].toLowerCase()==I.toLowerCase()){J=K[1];break}}return J};var w=function(K,H,G,J,F){if(c!=null&&typeof c.abort==="function"){c.abort();c=null}if(typeof e==="function"){e(H)}if(typeof K!=="undefined"){var I="";jQuery(F).each(function(){if(I==""){I+="?"}else{I+="&"}I+=(this.Key+"="+this.Value)});var L=(K.url==""?H:K.url)+I;if(K.url!="undefined"&&a.trim(L)!=""&&K.selector!="undefined"&&a.trim(K.selector)!=""){c=a.ajax({url:L,type:"POST",data:[{name:"NM",value:"1"}],beforeSend:function(){l.onLoadingView(K)},complete:function(O){var M=O.getAllResponseHeaders();var N=a.trim(t(M,"Liv-Action"));var P=N.split(",");N=a.trim(P[P.length-1]);if(N!=""&&/^redirect-/.test(N)){location.href=N.replace("redirect-","").replace("https;//","https://")}},success:function(M){a(K.selector).empty().html(M);Global.toggleVisibility();if(typeof K.pattern!=="undefined"){n(H,J,G,Global.parseUrl(H,K.pattern))}else{n(H,J,G)}c=null;u(jQuery("div.content"),null)},error:function(M){l.onErrorLoadingView(K,M)}})}}else{n(H,J,G)}};var n=function(H,J,G,I){if(typeof G==="function"){E("hashValue="+H+", route="+J);var F=b!=null?b.attr("data-hash"):"";if(typeof F!=="undefined"&&F!=""){H+="#"+F}G(H,I);if(typeof f==="function"){f(H)}if(typeof g==="function"){g(H)}if(typeof ga==="function"){if(Global.cat_id!=0){ga("send","pageview",H)}if(J=="/Searchv2"){var K=H.match(/Searchv2\/Keyword\=([^\/]*)\//);if(K!=null&&K.length>1){ga("global.send","pageview","/ViewBS/Search.aspx?q="+encodeURI(K[1]))}}else{ga("global.send","pageview",H)}}}else{E("handler not found")}};var D=function(){window.onhashchange=A};var C=function(G){var J;for(var H=0;H<k.length;H++){if(Array.isArray(k[H].route)){for(var F=0;F<k[H].route.length;F++){var I=new RegExp("^"+p(k[H].route[F]),"i");if(I.test(G)){J=k[H];break}}}else{var I=new RegExp("^"+p(k[H].route),"i");if(I.test(G)){J=k[H];break}}}return J};var A=function(){var F=s();if(!(/^\//g.test(F))){return}var G=C(F);if(location.href.indexOf("#")==-1||location.href.indexOf("#")==location.href.length-1){return}else{if(typeof(G)!=="undefined"&&location.pathname!=="/"){location.href="/#"+F;return}}if(typeof(G)!=="undefined"&&/^\/Searchv2/i.test(F)){w(G.view,F,G.handler,G.route,RouteDataParser.Searchv2(F))}else{if(typeof(G)!=="undefined"){w(G.view,F,G.handler,G.route,null)}else{w(h.view,F,h.handler,h.route,null)}}};var q=function(H,I){if(typeof H.except==="undefined"){return false}var F=false;if(I=="/Authentication/?Back=%2f%23%2fCatalogues%2fMonthlySpecials"){console.log(I)}for(var G=0;G<H.except.length;G++){if(I.toLowerCase().indexOf(H.except[G].url.toLowerCase())>-1||(H.except[G].startsWith==true&&I.toLowerCase().startsWith(H.except[G].url.toLowerCase()))){F=true;break}}return F};var u=function(F,J){E("LivAjaxPage initializing.");var I=false;if(typeof J!=typeof undefined){a.extend(l,J)}E(l);var H=a.now();a.each(k,function(L,M){if(typeof M.callManually==="undefined"||M.callManually==false){var K=F.find("a[href]").filter(function(){var O=new RegExp("^\\"+M.route,"i");var N=a(this).attr("href");return O.test(a(this).attr("href"))&&a(this).attr("data-seamless")==undefined});K.each(function(){var N=a(this);if(N.attr("data-seamless")==undefined){if(!q(M,N.attr("href"))){I=true;if(N.attr("href").indexOf("#")>=0){var O=N.attr("href").indexOf("#");var P=N.attr("href").substr(O+1);var Q=N.attr("href").substr(0,O);N.attr("data-hash",P);N.attr("href",Q)}N.attr("data-seamless","1");N.click(function(R){if(Global.singlePageInterceptorEnabled){b=a(this);R.preventDefault();var S=("#"+a(this).attr("href"));if(S==location.hash){window.onhashchange()}else{location.href=S}}})}}})}});var G=a.now();E("completed in "+(G-H)+"ms");if(I){if("onhashchange" in window){r()}else{E("Your browser doesn't support onhashchange")}}E("LivAjaxPage initializing. DONE.")};a.fn.livAjaxPage=function(H,F){u(a(this),H);if(typeof F==="undefined"){D()}var G="";if(location.hash==""&&v()){}else{if(F!=1){window.onhashchange()}}}};jQuery.fn.isVisibleVertical=function(e){var f=false;if(e==null){e=0}if(typeof(jQuery(this).offset())!="undefined"){var c=jQuery(this).offset().top;var d=jQuery(window).height();var a=jQuery(window).scrollTop();var b=(a+d);f=(c<=b&&b>=a)}return f};jQuery.fn.livInfinite=function(g){var e=jQuery(this.selector);if(e.length==0){return}g.initialLoading=g.initialLoading==null?false:g.initialLoading;g.offset=0;var f=1;var d=false;var b=false;var c=function(i){var h="div.products";if($("div.products[data-load=true]").length>=1){e=$("div.products[data-load=true]");h="div.products[data-load=true]"}if(i==false&&g.loadType!="bucketofgoods"){return}var m=$(h+" #hid_pagemax").val();var n=$(h+" #hid_products_perpage").val();if(typeof f=="undefined"){f=$(h+" #hid_page").val()}if(isNaN(n)){n=15}if(!isNaN(f)&&parseInt(f)==1&&g.loadType!="bucketofgoods"&&$(h+" ul li").length>n){$(h+":not(.bucketofgoods) ul").empty()}var k=null;var j=false;if(jQuery(e).find("li").last().length>0){k=jQuery(e).find("li").last()[0]}else{k=e;j=true}if(b){if(m>0&&m>=f){b=false}}if(!d&&!b&&(jQuery(k).isVisibleVertical(g.offset)||j)){var l=[{name:"page",value:f}];jQuery.ajax({url:g.url,cache:false,data:g.getParams==null?l:g.getParams(),dataType:g.dataType==null?"json":g.type,type:g.type==null?"POST":g.type,beforeSend:function(){d=true;g.beforeSend()},complete:function(){d=false;g.complete();$("div.products[data-load=true]").attr("data-load","")},success:function(o){jQuery(e).append(o.value);f=o.page;b=(o.end===true);g.success(o);ga4.SubmitItemList(o.products,g.loadType);$("div.products[data-load=true]").attr("data-load","")},error:function(){b=true;g.error();$("div.products[data-load=true]").attr("data-load","")}})}};jQuery(window).unbind("scroll.livInfinite").bind("scroll.livInfinite",function(){c(true)});if(g.initialLoading){jQuery(document).ready(function(){var h=true;if($("div.products[data-load=true]").length==1){h=false}c(h)})}var a={Reload:function(){b=false;c()}};return a};function spinWait(b,a){if(!b()){setTimeout(function(){spinWait(b,a)},50)}else{if(a){a()}}};var MasterPage={Initialize:function(){jQuery("div.columns > div.center").seamless({styleSelector:"style#extras",allowed:[{name:"404"},{name:"Account"},{name:"Authentication"},{name:"Campaign"},{name:"Catalogues"},{name:"Category"},{name:"Contact"},{name:"Dashboard"},{name:"MailList"},{name:"Order"},{name:"Pages"},{name:"Product"},{name:"Promo"},{name:"Search"},{name:"Sitemap"},{name:"Survey"},{name:"Thread"},{name:"WebOnlySpecials"},{name:"Home",path:["/","/View/Home.aspx"],exact:true}],params:{NM:"1"},targets:[{selector:"a",eventName:"click"}],onLoad:function(a,b){if(Global.cat_id==0){if(b=="Home"){jQuery("div.subwebsite-container").seamless("show")}else{jQuery("div.subwebsite-container").seamless("hide")}}},beforeSend:function(a,b){jQuery("div.wrapper2 > div").attr("class","")},success:function(a,b){if(Global.cat_id==0){if(b=="Home"){jQuery("div.subwebsite-container").seamless("show")}else{jQuery("div.subwebsite-container").seamless("hide")}}UC_Menu.SetActiveMenu();if(b=="Search"){jQuery("div.columns > div.sidemenu").css("display","none")}else{jQuery("div.columns > div.sidemenu").css("display","")}jQuery("div.wrapper2 > div").attr("class",b);Product.Load(a);if(b=="Order"){UC_Cart.CheckReload()}},template:"/View/Loading.html"})},Highlight:function(){switch(jQuery("input[name=search_query]").attr("data-highlight-colorstate")){case"1":jQuery("input[name=search_query]").css({"border-color":"rgb(255, 200, 100)"});jQuery("input[name=search_query]").parent().css({"box-shadow":"0px 0px 25px rgb(255, 200, 100)"});jQuery("input[name=search_query]").attr("data-highlight-colorstate","2");break;case"2":jQuery("input[name=search_query]").css({"border-color":"rgb(0, 0, 165)"});jQuery("input[name=search_query]").parent().css({"box-shadow":"0px 0px 25px rgb(0, 0, 165)"});jQuery("input[name=search_query]").attr("data-highlight-colorstate","3");break;default:jQuery("input[name=search_query]").css({"border-color":"red"});jQuery("input[name=search_query]").parent().css({"box-shadow":"0px 0px 25px red"});jQuery("input[name=search_query]").attr("data-highlight-colorstate","1");break}setTimeout(function(){MasterPage.Highlight()},3000)},Visibility:function(){if(jQuery(this).scrollTop()>100){jQuery("#back-top").fadeIn()}else{jQuery("#back-top").fadeOut()}},BacktoTopClick:function(){jQuery("body,html").animate({scrollTop:0},800);return false},InitializeSearch:function(){jQuery("input.search_query").autocomplete({source:"/Ajax/SearchProduct.ashx",dataType:"json",minLength:$("#hid_search_minchar").val(),select:function(a,b){if(jQuery(this).attr("id")=="search_query_top"){window.location.href="/Product/id/"+jQuery.trim(b.item.id)}}})},SearchSuggestionAjax:null,InitializeSearch3:function(){jQuery("input[name=search_query]").autocomplete({source:function(a,b){MasterPage.SearchSuggestionAjax=jQuery.ajax({type:"GET",contentType:"application/json; charset=utf-8",url:"/WebServices/Product.asmx/SearchWords",dataType:"json",data:{term:JSON.stringify(a.term)},success:function(c){b(MasterPage.FormatDataAutoComplete(jQuery.parseJSON(c.d)));$("input[name=search_query]").removeClass("search-keyword-loading")},error:function(){$("input[name=search_query]").removeClass("search-keyword-loading")}})},minLength:1,search:function(a,b){$(this).addClass("search-keyword-loading")},select:function(a,b){if(b.item.label.toLowerCase()=="enter more keywords to narrow down your search results"){a.preventDefault()}else{$('input[id$="_search_query_top"]').val(b.item.label);jQuery("form[id$='masterSearchForm']").submit()}},open:function(b,c){var a=$("ul.ui-autocomplete li:last-child");if(a.text().toLowerCase()=="enter more keywords to narrow down your search results"){a.html('<div style="color: red; font-style:italic;">'+a.text()+"</div>")}}})},FormatDataAutoComplete:function(a){var b=[];if(a.length==20){a[19]="enter more keywords to narrow down your search results"}for(x=0;x<a.length;x++){b.push({label:a[x],desc:a[x]})}return b},InitializeDropDownSearchSlider:function(){var a=jQuery("input#search-slider-box").autocomplete({source:function(b,c){jQuery.ajax({type:"GET",contentType:"application/json; charset=utf-8",url:"/WebServices/Product.asmx/SearchWords",dataType:"json",data:{term:JSON.stringify(b.term)},success:function(d){c(MasterPage.FormatDataAutoComplete(jQuery.parseJSON(d.d)));$("input#search-slider-box").removeClass("search-keyword-loading")},error:function(){$("input#search-slider-box").removeClass("search-keyword-loading")}})},minLength:1,search:function(b,c){$(this).addClass("search-keyword-loading")},select:function(b,c){if(c.item.label.toLowerCase()=="enter more keywords to narrow down your search results"){b.preventDefault()}else{MasterPage.SubmitSearch("input#search-slider-box")}},open:function(c,d){var b=$("ul.ui-autocomplete li:last-child");if(b.text().toLowerCase()=="enter more keywords to narrow down your search results"){b.html('<div style="color: red; font-style:italic;">'+b.text()+"</div>")}}})},SubmitSearch:function(a){if(Global.singlePage){MasterPage.SearchSuggestionHide();window.location.hash=MasterPage.GetSearchLink(a)}else{window.location.href=MasterPage.GetSearchLink(a)}},SearchSuggestionHide:function(){if(MasterPage.SearchSuggestionAjax!==null&&typeof MasterPage.SearchSuggestionAjax.abort==="function"){MasterPage.SearchSuggestionAjax.abort()}jQuery("input[name=search_query]").autocomplete("close")},GetSearchLink:function(d){var b="";var e="/Searchv2/";var a="All";if(!jQuery(d).is("input[type=text]")){if(jQuery("[name$=txt_search_query_detailed]").val()!=""){a="Keyword="+jQuery("[name$=txt_search_query_detailed]").val().trim().replace(/ /g,"+")}}else{if(jQuery(d).val()!=""){a="Keyword="+jQuery(d).val().trim().replace(/ /g,"+")}}_klaviyo.search(jQuery(d).val());a=a.replace("/","~2f");e+=(a+"/Relevance/");jQuery("div.filter-list").each(function(){if(jQuery(this).find("input[type=checkbox]:checked").length>0){var f="";var g=true;jQuery(this).find("input[type=checkbox]:checked").each(function(){if(!g){f=f+","}else{g=false}f+=jQuery(this).val()});e=(e+jQuery(this).attr("data-filtername")+"="+f)+"/"}});var c=new Array();jQuery(d).closest("div.filter-selection").each(function(){if(jQuery(d).attr("data-filtervalue")==""||typeof jQuery(d).attr("data-filtervalue")==typeof undefined){c=jQuery(this).attr("data-filtername");return}else{if(typeof jQuery(d).attr("data-filtervalue")!=typeof undefined){c.push(jQuery(this).attr("data-filtername"));e=e+jQuery(this).attr("data-filtername")+"="+jQuery(d).attr("data-filtervalue")+"/"}}});jQuery("div.filter-selection").each(function(){if(jQuery(this).attr("data-filtervalue")!=""){if(typeof jQuery(this).attr("data-filtervalue")!=typeof undefined&&jQuery(this).attr("data-filtervalue")!=""&&!c.includes(jQuery(this).attr("data-filtername"))){e=e+jQuery(this).attr("data-filtername")+"="+jQuery(this).find("span.selected").attr("data-filtervalue")+"/"}}});return e},SubmitSearchAX:function(g){jQuery("div.products ul.product > li").remove();var a=jQuery("form.form_search").find("input[id$=search_query_detailed]").val();var b=1;var f="Keyword";var c=jQuery("form.form_search").find("input[id$=txt_price_from]").val();var d=jQuery("form.form_search").find("input[id$=txt_price_to]").val();var e=0;$("[name=search_query]").val(a);jQuery("div.products").find("#hid_keyword").val(a);jQuery("div.products").find("#hid_page").val(b);jQuery("div.products").find("#hid_search_type").val(f);jQuery("div.products").find("#hid_price_from").val(c);jQuery("div.products").find("#hid_price_to").val(d);jQuery("div.products").find("#hid_products_total").val(e);_klaviyo.search(a);if(typeof Product.LastLivInfinite=="undefined"||Product.LastLivInfinite==null){Product.SubmitSearch(g)}else{Product.LastLivInfinite.Reload()}},SubmitSearchSL:function(a){if(Global.seamlessEnable){jQuery("div.columns > div.center").seamless("open","/Search/All/Keyword/"+encodeURIComponent(a)+"/Price=0-0/match-DESC/true")}else{MasterPage.SubmitSearch()}},WarnUserSession:function(){setInterval(function(){MasterPage.ConfirmUserSession()},1410*60000)},ConfirmUserSession:function(a){jQuery("#master-confirm").dialog({resizable:false,title:"Session Detection",height:160,modal:true,buttons:{Yes:function(){document.location.href="/Authentication/Logout/";jQuery(this).dialog("close")},No:function(){location.reload()}}})}};jQuery(document).ready(function(){if(Global.seamlessEnable){MasterPage.Initialize()}jQuery("#back-top").hide();jQuery(window).scroll(MasterPage.Visibility);jQuery("#back-top a").click(MasterPage.BacktoTopClick);MasterPage.WarnUserSession();MasterPage.InitializeSearch3();jQuery(window).scroll(function(){if(jQuery(window).scrollTop()+jQuery(window).height()==jQuery(document).height()){if(!jQuery("footer .container").hasClass("animated")){jQuery("footer .container").animate({scrollLeft:50},500,function(){jQuery("footer .container").animate({scrollLeft:-50},500);jQuery("footer .container").addClass("animated")})}}});if(Global.highlightEnabled){MasterPage.Highlight()}});jQuery(document).ready(function(){var b=Global.parseUrl(location.pathname,"/Search/(.+?)/(.+?)/(.+?)/(.+?)/(.+?)");if(b!=null&&b.length>=4){var a=b[3].replace("+"," ");$("[id$=txt_search_query_detailed]").val(a);$("#hid_keyword").val(a);$("[name=search_query]").val(a);var c=b[4].replace("Price=","").split("-");$("#hid_price_from").val(c[0]);$("#hid_price_to").val(c[1]);$("[id$=txt_price_from]").val(c[0]);$("[id$=txt_price_to]").val(c[1])}jQuery("form[id$='masterSearchForm']").submit(function(d){d.preventDefault();MasterPage.SubmitSearch("input[id$='search_query_top']")});jQuery("[class$=form_search]").submit(function(d){d.preventDefault();MasterPage.SubmitSearchAX()})});var Category={GetViewEq:function(a){var b="";switch(a){case"product_view_list":b="list";break;case"product_view_grid":default:b="grid";break}return b},ProductViewClick:function(){jQuery(this).closest("ul").find("li").each(function(a,b){if(jQuery(b).hasClass("current")){jQuery(b).removeClass("current");jQuery("div.products ul.product").removeClass(Category.GetViewEq(b.id))}});jQuery(this).addClass("current");jQuery("div.products ul.product").addClass(Category.GetViewEq(this.id))},GetTargetedCategories:function(a,b){if($(a).lenght<=0){return}$.ajax({url:"/WebServices/Category.asmx/GetTargetedCategories",data:{keyword:b},method:"POST",dataType:"JSON",beforeSend:function(){},success:function(c){if(c.SUCCESS){$.each(c.CATEGORIES,function(d,e){$(a).append('<li class="col-xs-12 col-sm-3"><a href="'+e.url+'" title="'+e.category_name+'"><img src="'+e.image_url+'" alt="'+e.category_name+'"><span>'+e.category_name+"</span></a></li>")})}}})}};$(document).ready(function(){if($("div.target-categories").length>0){Category.GetTargetedCategories("div.target-categories ul.category-list",$("input[name=tckeyword]").val())}});$(document).ready(function(){Customer.GetPersonalInformation();Customer.GetShippingAddress();Customer.GetBillingAddress();Customer.InitRegister();$("input[id$=btnChangePassword]").click(Customer.ChangePassword);$("input[id$=btn_update_address_account]").click(Customer.UpdateAddress);$("[data-next=submit]").click(Checkout.submit);$("input[id$=btn_update_personal]").click(Customer.UpdatePersonal);jQuery("div#authenticationDialog").dialog({autoOpen:false,modal:true,closeOnEscape:false,open:function(c,d){jQuery(".ui-dialog-titlebar-close",d.dialog|d).hide()},buttons:{Okay:function(c){location.href="/Home/"}}});jQuery("[id$=btnModalClose]").click(function(){location.href="/"});var b=0;var a=0;$("a.popper").hover(function(c){var d="#"+($(this).attr("data-popbox"));$(d).show();b=$(this).outerWidth();a=($(d).outerHeight()/2)},function(){var c="#"+($(this).attr("data-popbox"));if(!($("a.popper").hasClass("show"))){$(c).hide()}});$("a.popper").click(function(c){var d="#"+($(this).attr("data-popbox"));if(!($(this).hasClass("show"))){$(d).show()}$(this).toggleClass("show")})});var Automation={AutoCopy:function(){jQuery("input[data-auto]").each(function(){jQuery(this).change(function(){jQuery(this).attr("data-auto","0")});var b=jQuery(this).closest("form");var d=jQuery(this).attr("name");var c=jQuery(this).attr("data-auto-format");var a=new Array();if(typeof c!=="undefined"){a=c.split(" ")}jQuery(a).each(function(){var e=jQuery(b).find("input[name="+this+"]").attr("data-auto-target");if(typeof e!="undefined"){jQuery(b).find("input[name="+this+"]").attr("data-auto-target",e+" "+d)}else{jQuery(b).find("input[name="+this+"]").attr("data-auto-target",d)}jQuery(b).find("input[name="+this+"]").change(function(){var g=jQuery(this).attr("data-auto-target").split(" ");var f="";jQuery(a).each(function(){if(f!=""){f+=" "}f+=jQuery(b).find("input[name="+this+"]").val()});jQuery(g).each(function(){jQuery(b).find("input[name="+this+"]").val(f)})})})})}};var Customer={InitRegister:function(){if(document.location.hash=="#/Authentication/Register/"){jQuery(".login").each(function(){var b=jQuery(this).closest("[data-registeronly]");if(b.length==0||b.attr("data-registeronly").toLowerCase()!="true"){jQuery(this).removeAttr("style")}else{jQuery(b).css("background-color","white");BootstrapUtility.AssignSize(jQuery(b).find(".register"),"col-sm-",12);BootstrapUtility.AssignSize(jQuery(b).find(".register"),"col-md-",12)}});jQuery(".register").removeAttr("style")}else{jQuery("[id$=divLogin] .login").css("display","block")}if($("form[name=form_apply] div.gender-field").length==1){if(location.pathname=="/free-care-pack"){$("input.btnApply").val("JOIN NOW & GET MY PACK");$("h1.PageHeader_small").remove();$("h1.loginhdr").html("Unlock Your Free Personal Care Pack - Exclusive Offer for Education Australia Readers")}else{$("form[name=form_apply] div.gender-field").remove()}}jQuery("[name=PasswordConfirm], [name=Password]").unbind("change.PasswordConfirm").bind("change.PasswordConfirm",function(){var c=jQuery(this).closest("form").find("[name=PasswordConfirm]");var b=jQuery(this).closest("form").find("[name=Password]");if(jQuery(b).val()!=jQuery(c).val()){if(!jQuery(c).closest(".form-group").hasClass("has-error")){jQuery(c).closest(".form-group").addClass("has-error");jQuery(c).after("<span class='help-block'>Password did not match.</span>")}}else{if(jQuery(c).closest(".form-group").hasClass("has-error")){jQuery(c).closest(".form-group").removeClass("has-error");jQuery(c).closest("form").find("span.help-block").remove()}}});Country.GetCountries("[id$=ddl_ship_to_country], [id$=ddl_bill_to_country], select[name=ShipCountry], select[name=BillCountry]");Industry.LoadOption("[id$=ddl_industry]");jQuery(".studentCollege").hide();jQuery("#uploadResult").hide();jQuery("#ddl_industry").change(function(){Industry.UpdateStudentFormLabel()});jQuery("#studentIndustry").change(function(){if(jQuery("#studentIndustry").is(":checked")){jQuery(".studentCollege").show();jQuery("#uploadResult").show()}else{jQuery(".studentCollege").hide();jQuery("#uploadResult").hide()}});jQuery("div.register .form-group.address input").keyup(Customer.RestrictPOBOX);jQuery("#isSameAsShippingAddress").change(function(){if(jQuery("#isSameAsShippingAddress").is(":checked")){jQuery(".BillingAddress").hide()}else{jQuery(".BillingAddress").show()}});if(typeof ss!=="undefined"&&jQuery("#btnUpload").length>0){var a=new ss.SimpleUpload({button:"btnUpload",url:"/handler/GenericMethodCall.ashx?method_name=file-upload",name:"file",allowedExtensions:["JPG","PNG"],maxSize:1024,responseType:"text/plain",onExtError:function(c,b){jQuery(".uploadStatus").html("Invalid file type it should be JPG or PNG.")},onSizeError:function(b,c){jQuery(".uploadStatus").html("File size should be less than 1MB")},onError:function(b,h,f,g,c,i,e){if(c!=undefined&&c!=""){var d=jQuery.parseJSON(c);if(d.message){jQuery(".uploadStatus").html(d.message)}else{jQuery(".uploadStatus").html("Upload failed")}}},onSubmit:function(c,b){jQuery(".uploadStatus").html("Uploading...")},onComplete:function(b,d){if(d!=undefined&&d!=""){var e=jQuery.parseJSON(d);var c=e.message||"";if(e.success){jQuery(".uploadStatus").html(c)}else{jQuery(".uploadStatus").html("Upload failed. "+c)}}}})}$("[id$=ddl_ship_to_country]").change(State.GetState).change();$("[id$=ddl_bill_to_country]").change(State.GetState).change();$("select.country").change(State.GetState).change();$("input[id$=chk_copy_shipping]").change(Shipping.CopyShippingToBill);$("input[id$=btn_register]").click(Customer.Register);$("input[id$=btn_apply]").click(Customer.Apply);Customer.InitCampCode();if(Global.cat_id=="2209391"&&(location.hash.toLowerCase()=="#/authentication/register/"||location.pathname.toLowerCase()=="/authentication/register/")){$("#ddl_industry").parent().hide();$("p.other-option-note").hide();$("div.student-checkbox").hide();$("input[name=NatureOfBusiness]").parent().hide()}Automation.AutoCopy()},InitCampCode:function(){var a="<strong>What is a Promo No. / Campaign Code?</strong><p>A Promo No. / Campaign Code is a code used for a specific campaign where the applicable promotional prices for an item are referred to - such as discounts or savings, bulk deals and the like. Promo No. / Campaign Codes have a specific validity period. Items included in the promotion but outside validity is subject to regular price. </p><strong>How/Where to get a Promo No. / Campaign Code?</strong><p>Promo No. / Campaign codes are indicated in most "+Global.storeName+"'s marketing materials such as monthly specials, brochures and catalogues. You can check on Monthly Specials, Brochure or Catalogues Page to check on the latest promotions. Key in the campaign code when logging-in to view the discounted prices of the items included in the promotion. <br/><br/><br/><a class=catalogueLink href='/Catalogues' target='_blank'>Catalogue, Brochure and Monthly Special</a></p>";jQuery("a#whatIsCampCode").popover({title:"Click link to close",content:a,placement:"bottom",html:true});jQuery("a#whatIsCampCode").click(function(b){b.preventDefault();$(this).popover("show")})},ValidatePersonalInformation:function(b){var c;var a="";var d=true;var e;if(b){e=[{name:"first_name",value:$("[id$=txt_first_name]").val()},{name:"last_name",value:$("[id$=txt_last_name]").val()},{name:"company",value:$("[id$=txt_company]").val()},{name:"abn",value:$("[id$=txt_abn]").val()},{name:"email",value:$("[id$=txt_email]").val()},{name:"main_phone",value:$("[id$=txt_main_phone]").val()},{name:"mobile_phone",value:$("[id$=txt_mobile_phone]").val()},{name:"user_pwd_new",value:$("[id$=txt_user_pwd_new]").val()},{name:"user_pwd_new_confirm",value:$("[id$=txt_user_pwd_new_confirm]").val()},{name:"user_pwd_current",value:$("[id$=txt_user_pwd_current]").val()},{name:"isPersonalInformationUpdate",value:true}]}else{e=[{name:"first_name",value:$("[id$=txt_first_name]").val()},{name:"last_name",value:$("[id$=txt_last_name]").val()},{name:"company",value:$("[id$=txt_company]").val()},{name:"abn",value:$("[id$=txt_abn]").val()},{name:"email",value:$("[id$=txt_email]").val()},{name:"main_phone",value:$("[id$=txt_main_phone]").val()},{name:"mobile_phone",value:$("[id$=txt_mobile_phone]").val()},{name:"user_pwd_new",value:$("[id$=txt_user_pwd_new]").val()},{name:"user_pwd_new_confirm",value:$("[id$=txt_user_pwd_new_confirm]").val()},{name:"isPersonalInformationUpdate",value:false},{name:"hidPage",value:$("#hidPage").val()}]}jQuery.ajax({url:"/Ajax/ValidatePersonalInformation.ashx",data:e,dataType:"json",type:"POST",async:false,success:function(g){if(!g.success){for(var f=0;f<g.errors.length;f++){a+="<li class='alert alert-danger'>"+g.errors[f]+"</li>"}d=false}},error:function(){d=false}});c=[{name:"success",value:d},{name:"errors",value:a}];return c},ValidateShippingAddress:function(c){var d;var a="";var g=true;var b=null;if(typeof c=="undefined"||c==null){b=jQuery("#address-form")}else{b=jQuery(c)}var f=jQuery(b).find(".state").val();if(f==""||typeof f=="undefined"){f=jQuery(b).find(".state").val()}if(f==undefined){f=jQuery(b).find("[id$=ddl_ship_to_state]").val()}var e=(jQuery(b).find(".firstname").val()!=undefined?jQuery(b).find(".firstname").val():"")+" "+(jQuery(b).find(".lastname").val()!=undefined?jQuery(b).find(".lastname").val():"");var h=[{name:"ship_to_firstname",value:jQuery(b).find(".firstname").val()!=undefined?jQuery(b).find(".firstname").val():""},{name:"ship_to_lastname",value:jQuery(b).find(".lastname").val()!=undefined?jQuery(b).find(".lastname").val():""},{name:"ship_to_email",value:jQuery(b).find(".email").val()!=undefined?jQuery(b).find(".email").val():""},{name:"ship_to_phone",value:jQuery(b).find(".phone").val()!=undefined?jQuery(b).find(".phone").val():""},{name:"ship_to_name",value:jQuery(b).find("[id$=txt_ship_to_name]").val()!=undefined?jQuery(b).find("[id$=txt_ship_to_name]").val():e},{name:"ship_to_company",value:jQuery(b).find(".company").val()!=undefined?jQuery(b).find(".company").val():jQuery(b).find("[id$=txt_ship_to_company]").val()},{name:"ship_to_address",value:jQuery(b).find(".address").val()!=undefined?jQuery(b).find(".address").val():jQuery(b).find("[id$=txt_ship_to_address]").val()},{name:"ship_to_address2",value:jQuery(b).find("[id$=txt_ship_to_address2]").val()!=undefined?jQuery(b).find("[id$=txt_ship_to_address2]").val():""},{name:"ship_to_zip_code",value:jQuery(b).find(".postcode").val()!=undefined?jQuery(b).find(".postcode").val():jQuery(b).find("[id$=txt_ship_to_zip_code]").val()},{name:"ship_to_city",value:jQuery(b).find(".city").val()!=undefined?jQuery(b).find(".city").val():jQuery(b).find("[id$=txt_ship_to_city]").val()},{name:"ship_to_country",value:jQuery(b).find("select.country").val()!=undefined?jQuery(b).find("select.country").val():jQuery(b).find("[id$=ddl_ship_to_country]").val()},{name:"ship_to_state",value:f}];jQuery.ajax({url:"/Ajax/ValidateShippingAddress.ashx",data:h,dataType:"json",type:"POST",async:false,success:function(j){if(!j.success){for(var i=0;i<j.errors.length;i++){a+="<li>"+j.errors[i]+"</li>"}g=false}},error:function(){g=false}});d=[{name:"success",value:g},{name:"errors",value:a}];return d},ValidateBillingAddress:function(){var b;var a="";var c=true;var d;if($("[id$=chk_copy_shipping]").is(":checked")){d=[{name:"bill_to_name",value:$("[id$=txt_ship_to_name]").val()},{name:"bill_to_address",value:$("[id$=txt_ship_to_address]").val()},{name:"bill_to_address2",value:$("[id$=txt_ship_to_address2]").val()},{name:"bill_to_zip_code",value:$("[id$=txt_ship_to_zip_code]").val()},{name:"bill_to_city",value:$("[id$=txt_ship_to_city]").val()},{name:"bill_to_country",value:$("[id$=ddl_ship_to_country]").val()},{name:"bill_to_state",value:$("[id$=ddl_ship_to_state]").val()},{name:"sameAsShippingAddress",value:true}]}else{d=[{name:"bill_to_name",value:$("[id$=txt_bill_to_name]").val()},{name:"bill_to_address",value:$("[id$=txt_bill_to_address]").val()},{name:"bill_to_address2",value:$("[id$=txt_bill_to_address2]").val()},{name:"bill_to_zip_code",value:$("[id$=txt_bill_to_zip_code]").val()},{name:"bill_to_city",value:$("[id$=txt_bill_to_city]").val()},{name:"bill_to_country",value:$("[id$=ddl_bill_to_country]").val()},{name:"bill_to_state",value:$("[id$=ddl_bill_to_state]").val()},{name:"sameAsShippingAddress",value:false}]}jQuery.ajax({url:"/Ajax/ValidateBillingAddress.ashx",data:d,dataType:"json",type:"POST",async:false,success:function(f){if(!f.success){for(var e=0;e<f.errors.length;e++){a+="<li>"+f.errors[e]+"</li>"}c=false}},error:function(){c=false}});b=[{name:"success",value:c},{name:"errors",value:a}];return b},GetPersonalInformation:function(){if($("#txt_first_name").length>0){jQuery.ajax({url:"/Ajax/GetPersonalInformation.ashx",dataType:"json",type:"POST",async:false,success:function(a){$("[id$=txt_first_name]").val(a.first_name);$("[id$=txt_last_name]").val(a.last_name);$("[id$=txt_company]").val(a.company);$("[id$=txt_abn]").val(a.abn);$("[id$=txt_email]").val(a.email);$("[id$=txt_main_phone]").val(a.main_phone);$("[id$=txt_mobile_phone]").val(a.mobile_phone)}})}},GetShippingAddress:function(){if($("#txt_ship_to_name").length>0){jQuery.ajax({url:"/Ajax/GetShippingAddress.ashx",dataType:"json",type:"POST",success:function(a){$("[id$=txt_ship_to_name]").val(a.ship_to_name);$("[id$=txt_ship_to_company]").val(a.ship_to_company);$("[id$=txt_ship_to_address]").val(a.ship_to_address);$("[id$=txt_ship_to_address2]").val(a.ship_to_address2);$("[id$=txt_ship_to_zip_code]").val(a.ship_to_zip_code);$("[id$=txt_ship_to_city]").val(a.ship_to_city);if(a.delivery_instructions&&$("[id$=txt_delivery_instruction]").length>0){$("[id$=txt_delivery_instruction]").val(a.delivery_instructions)}$("[id$=ddl_ship_to_country] option[value="+(a.ship_to_country=="Australia"||a.ship_to_country=="AU"?"AU":"-")+"]").attr("selected","selected");$("[id$=ddl_ship_to_country]").change();$("[id$=ddl_ship_to_state] option[value="+a.ship_to_state+"]").attr("selected","selected");if(a.same_as==true){$("#chk_copy_shipping").attr("checked","checked");$("#chk_copy_shipping").trigger("change")}}})}},GetBillingAddress:function(){if($("#txt_bill_to_name").length>0){jQuery.ajax({url:"/Ajax/GetBillingAddress.ashx",dataType:"json",type:"POST",success:function(a){$("[id$=txt_bill_to_name]").val(a.bill_to_name);$("[id$=txt_bill_to_address]").val(a.bill_to_address);$("[id$=txt_bill_to_address2]").val(a.bill_to_address2);$("[id$=txt_bill_to_zip_code]").val(a.bill_to_zip_code);$("[id$=txt_bill_to_city]").val(a.bill_to_city);$("[id$=ddl_bill_to_country] option[value="+(a.bill_to_country=="Australia"||a.bill_to_country=="AU"?"AU":"-")+"]").attr("selected","selected");$("[id$=ddl_bill_to_country]").change();$("[id$=ddl_bill_to_state] option[value="+a.bill_to_state+"]").attr("selected","selected")}})}},InsertPersonalInformation:function(){var b;var c=true;var a="";var d=[{name:"first_name",value:$("[id$=txt_first_name]").val()},{name:"last_name",value:$("[id$=txt_last_name]").val()},{name:"company",value:$("[id$=txt_company]").val()},{name:"abn",value:$("[id$=txt_abn]").val()},{name:"email",value:$("[id$=txt_email]").val()},{name:"main_phone",value:$("[id$=txt_main_phone]").val()},{name:"mobile_phone",value:$("[id$=txt_mobile_phone]").val()},{name:"user_pwd_new",value:$("[id$=txt_user_pwd_new]").val()},{name:"user_pwd_new_confirm",value:$("[id$=txt_user_pwd_new_confirm]").val()}];jQuery.ajax({url:"/Ajax/InsertPersonalInformation.ashx",data:d,dataType:"json",type:"POST",async:false,success:function(e){if(e.success){a=e.Customer_Id}else{c=false}},error:function(){c=false}});b=[{name:"success",value:c},{name:"Customer_Id",value:a}];return b},UpdateShippingAddress:function(a){var c;var d=true;var b;var e=[{name:"ship_to_name",value:$("[id$=txt_ship_to_name]").val()},{name:"ship_to_company",value:$("[id$=txt_ship_to_company]").val()},{name:"ship_to_address",value:$("[id$=txt_ship_to_address]").val()},{name:"ship_to_address2",value:$("[id$=txt_ship_to_address2]").val()},{name:"ship_to_zip_code",value:$("[id$=txt_ship_to_zip_code]").val()},{name:"ship_to_city",value:$("[id$=txt_ship_to_city]").val()},{name:"ship_to_country",value:$("[id$=ddl_ship_to_country]").val()},{name:"ship_to_state",value:$("[id$=ddl_ship_to_state]").val()},{name:"Customer_Id",value:a}];jQuery.ajax({url:"/Ajax/UpdateShippingAddress.ashx",data:e,dataType:"json",type:"POST",async:false,success:function(f){if(!f.success){d=false}b=f.isSameDetails},error:function(){d=false}});c=[{name:"success",value:d},{name:"isSameDetails",value:b}];return c},UpdateBillingAddress:function(a){var c;var d=true;var b;var e;if($("#chk_copy_shipping").is(":checked")){e=[{name:"bill_to_name",value:$("[id$=txt_ship_to_name]").val()},{name:"bill_to_address",value:$("[id$=txt_ship_to_address]").val()},{name:"bill_to_address2",value:$("[id$=txt_ship_to_address2]").val()},{name:"bill_to_zip_code",value:$("[id$=txt_ship_to_zip_code]").val()},{name:"bill_to_city",value:$("[id$=txt_ship_to_city]").val()},{name:"bill_to_country",value:$("[id$=ddl_ship_to_country]").val()},{name:"bill_to_state",value:$("[id$=ddl_ship_to_state]").val()},{name:"Customer_Id",value:a}]}else{e=[{name:"bill_to_name",value:$("[id$=txt_bill_to_name]").val()},{name:"bill_to_address",value:$("[id$=txt_bill_to_address]").val()},{name:"bill_to_address2",value:$("[id$=txt_bill_to_address2]").val()},{name:"bill_to_zip_code",value:$("[id$=txt_bill_to_zip_code]").val()},{name:"bill_to_city",value:$("[id$=txt_bill_to_city]").val()},{name:"bill_to_country",value:$("[id$=ddl_bill_to_country]").val()},{name:"bill_to_state",value:$("[id$=ddl_bill_to_state]").val()},{name:"Customer_Id",value:a}]}jQuery.ajax({url:"/Ajax/UpdateBillingAddress.ashx",data:e,dataType:"json",type:"POST",async:false,success:function(f){if(!f.success){d=false}b=f.isSameDetails},error:function(){d=false}});c=[{name:"success",value:d},{name:"isSameDetails",value:b}];return c},SaveGuestPersonalInformation:function(){var a=[{name:"first_name",value:$("[id$=txt_first_name]").val()},{name:"last_name",value:$("[id$=txt_last_name]").val()},{name:"company",value:$("[id$=txt_company]").val()},{name:"abn",value:$("[id$=txt_abn]").val()},{name:"email",value:$("[id$=txt_email]").val()},{name:"main_phone",value:$("[id$=txt_main_phone]").val()},{name:"mobile_phone",value:$("[id$=txt_mobile_phone]").val()},{name:"SameAs",value:$("#chk_copy_shipping").is(":checked")},{name:"method_name",value:"save-guest-pi"}];var b=true;jQuery.ajax({url:"/Handler/GenericMethodCall.ashx",data:a,dataType:"json",type:"POST",async:false,success:function(c){if(!c.success){b=true}}});return[{name:"success",value:b},{name:"isSameDetails",value:true}]},SaveGuestShippingAddress:function(){var a=[{name:"ship_to_name",value:$("[id$=txt_ship_to_name]").val()},{name:"ship_to_company",value:$("[id$=txt_ship_to_company]").val()},{name:"ship_to_address",value:$("[id$=txt_ship_to_address]").val()},{name:"ship_to_address2",value:$("[id$=txt_ship_to_address2]").val()},{name:"ship_to_zip_code",value:$("[id$=txt_ship_to_zip_code]").val()},{name:"ship_to_city",value:$("[id$=txt_ship_to_city]").val()},{name:"ship_to_country",value:$("[id$=ddl_ship_to_country]").val()},{name:"ship_to_state",value:$("[id$=ddl_ship_to_state]").val()},{name:"method_name",value:"save-guest-sa"}];var b=true;jQuery.ajax({url:"/Handler/GenericMethodCall.ashx",data:a,dataType:"json",type:"POST",async:false,success:function(c){if(!c.success){b=false}}});return[{name:"success",value:b},{name:"isSameDetails",value:true}]},SaveGuestBillingAddress:function(){var a;if($("#chk_copy_shipping").is(":checked")){a=[{name:"bill_to_name",value:$("[id$=txt_ship_to_name]").val()},{name:"bill_to_address",value:$("[id$=txt_ship_to_address]").val()},{name:"bill_to_address2",value:$("[id$=txt_ship_to_address2]").val()},{name:"bill_to_zip_code",value:$("[id$=txt_ship_to_zip_code]").val()},{name:"bill_to_city",value:$("[id$=txt_ship_to_city]").val()},{name:"bill_to_country",value:$("[id$=ddl_ship_to_country]").val()},{name:"bill_to_state",value:$("[id$=ddl_ship_to_state]").val()},{name:"method_name",value:"save-guest-bi"}]}else{a=[{name:"bill_to_name",value:$("[id$=txt_bill_to_name]").val()},{name:"bill_to_address",value:$("[id$=txt_bill_to_address]").val()},{name:"bill_to_address2",value:$("[id$=txt_bill_to_address2]").val()},{name:"bill_to_zip_code",value:$("[id$=txt_bill_to_zip_code]").val()},{name:"bill_to_city",value:$("[id$=txt_bill_to_city]").val()},{name:"bill_to_country",value:$("[id$=ddl_bill_to_country]").val()},{name:"bill_to_state",value:$("[id$=ddl_bill_to_state]").val()},{name:"method_name",value:"save-guest-bi"}]}var b=true;jQuery.ajax({url:"/Handler/GenericMethodCall.ashx",data:a,dataType:"json",type:"POST",async:false,success:function(c){if(!c.success){b=true}}});return[{name:"success",value:b},{name:"isSameDetails",value:true}]},UpdatePersonalInformation:function(){var b;var c=true;var a;var d=[{name:"first_name",value:$("[id$=txt_first_name]").val()},{name:"last_name",value:$("[id$=txt_last_name]").val()},{name:"company",value:$("[id$=txt_company]").val()},{name:"abn",value:$("[id$=txt_abn]").val()},{name:"email",value:$("[id$=txt_email]").val()},{name:"main_phone",value:$("[id$=txt_main_phone]").val()},{name:"mobile_phone",value:$("[id$=txt_mobile_phone]").val()},{name:"user_pwd_current",value:$("[id$=txt_user_pwd_current]").val()},{name:"user_pwd_new",value:$("[id$=txt_user_pwd_new]").val()},{name:"user_pwd_new_confirm",value:$("[id$=txt_user_pwd_new_confirm]").val()}];jQuery.ajax({url:"/Ajax/UpdatePersonalInformation.ashx",data:d,dataType:"json",type:"POST",async:false,success:function(e){if(!e.success){c=false}a=e.isSameDetails},error:function(){c=false}});b=[{name:"success",value:c},{name:"isSameDetails",value:a}];return b},SendEmail:function(a){var b=[{name:"emailType",value:a}];jQuery.ajax({url:"/Ajax/SendEmail.ashx",data:b,type:"POST",async:false})},Register:function(){$(this).attr("disabled","disabled");var a=true;var e="";var f="";var d="";var h=Customer.ValidatePersonalInformation(false);if(!h[0].value){a=false;e=h[1].value}var i=Customer.ValidateShippingAddress();if(!i[0].value){a=false;f=i[1].value}var g=Customer.ValidateBillingAddress();if(!g[0].value){a=false;d=g[1].value}var b;var c;if(a){c=Customer.InsertPersonalInformation();if(c[0].value){b=c[1].value;Customer.SendEmail("register")}else{a=false}}if(a&&!userApp){Customer.UpdateShippingAddress(b);Customer.UpdateBillingAddress(b)}if(a){location.href="/Authentication/"}else{if(e==""&&f==""&&d==""){$(".olResPersonal").empty().append("<li>An error occurred.</li>");$(".olResShippingAddress").empty();$(".olResBillingAddress").empty()}else{$(".olResPersonal").empty().append(e);$(".olResShippingAddress").empty().append(f);$(".olResBillingAddress").empty().append(d)}$(".olResPersonal").addClass("colorError");$(".olResShippingAddress").addClass("colorError");$(".olResBillingAddress").addClass("colorError");$(window).scrollTop($(".olResPersonal").offset().top-20)}$(this).removeAttr("disabled")},UpdateAddress:function(f){var b=false;if(($(f.target).attr("id").indexOf("btn_update_address_account")>-1)||$(f.target).attr("data-step")=="2"){b=true}else{var h=location.pathname;h=h.substring(1).slice(0,-1);var g=h.split("/");if(g[0]=="Order"&&g[1]=="2"){b=true}}if(b){var c=true;var k="";var i="";var j="";var p=true;var a=$("#hidPage");var d=a.length>0&&a.val().toUpperCase()=="ORDER";if(d){p=Customer.ValidatePersonalInformation(false);if(!p[0].value){c=false;j=p[1].value}}else{p=true}var q=Customer.ValidateShippingAddress();if(!q[0].value){c=false;k=q[1].value}var o=Customer.ValidateBillingAddress();if(!o[0].value){c=false;i=o[1].value}var m;var n;var l;if(d&&p&&c){m=Customer.SaveGuestPersonalInformation();if(!m[0].value){c=false}}if(c){if(d){n=Customer.SaveGuestShippingAddress()}else{n=Customer.UpdateShippingAddress(null)}if(!n[0].value){c=false}}if(c){if(d){l=Customer.SaveGuestBillingAddress()}else{l=Customer.UpdateBillingAddress(null)}if(!l[0].value){c=false}}if(c){if(d){$(".olResPersonal").empty().append("<li class='alert alert-success'>Guest details successful saved.</li>");$(".olResShippingAddress").empty();$(".olResBillingAddress").empty()}else{if(!n[1].value||!l[1].value){Customer.SendEmail("updateaddress")}if($(f.target).attr("id").indexOf("btn_update_address_account")>-1){$(".olResShippingAddress").empty().append("<li class='alert alert-success'>You have successfully updated your addresses. Thank you.</li>");$(".olResBillingAddress").empty();$(".olResShippingAddress").removeClass("colorError").addClass("colorSuccess");$(window).scrollTop($(".olResShippingAddress").offset().top-20)}}return true}else{if(d){if(j==""&&k==""&&i==""){$(".olResPersonal").empty().append("<li>Internal server error occurred.</li>");$(".olResShippingAddress").empty();$(".olResBillingAddress").empty()}else{$(".olResPersonal").empty().append(j);$(".olResShippingAddress").empty().append(k);$(".olResBillingAddress").empty().append(i)}}else{if(k==""&&i==""){$(".olResShippingAddress").empty().append("<li>An error occurred.</li>");$(".olResBillingAddress").empty()}else{$(".olResShippingAddress").empty().append(k);$(".olResBillingAddress").empty().append(i)}}$(".olResShippingAddress").removeClass("colorSuccess").addClass("colorError");$(".olResBillingAddress").removeClass("colorSuccess").addClass("colorError");$(".olResShippingAddress li").addClass("alert alert-danger");$(".olResBillingAddress li").addClass("alert alert-danger");$(window).scrollTop($(".olResShippingAddress").offset().top-20);return false}}},UpdatePersonal:function(){var a=true;var b="";var d=Customer.ValidatePersonalInformation(true);if(!d[0].value){a=false;b=d[1].value}var c;if(a){c=Customer.UpdatePersonalInformation();if(!c[0].value){a=false}}if(a){if(!c[1].value){Customer.SendEmail("updatepersonalinfo")}$(".olResPersonal").empty().append("<div class='alert alert-success' role='alert'>You have successfully updated your personal information. Thank you.<li>");$(window).scrollTop($(".olResPersonal").offset().top-20)}else{if(b==""){$(".olResPersonal").empty().append("<div class='alert alert-danger' role='alert'>An error occurred.<li>")}else{$(".olResPersonal").empty().append(b)}$(window).scrollTop($(".olResPersonal").offset().top-20)}},Apply:function(){jQuery("[name=form_apply] .error-list li").remove();if(jQuery(".register .alert-danger:visible").length>0){jQuery("html, body").animate({scrollTop:(jQuery(".register .alert-danger:visible").first().offset().top-20)+"px"},"fast");jQuery(".register .alert-danger:visible").first().parent().find("input").focus();return}if(jQuery("form[name=form_apply] .has-error").length>0){jQuery("html, body").animate({scrollTop:(jQuery("form[name=form_apply] .has-error").first().offset().top-20)+"px"},"fast");jQuery("form[name=form_apply] .has-error").first().parent().find("input").focus();return}var b=jQuery("form#form_apply").serializeArray();if(b.length<1){b=jQuery("[name=form_apply]").serializeArray()}var a=Global.GetRecaptchaResponse();if(a.length==0){return}b.push({name:"RegisterType",value:jQuery("[name=form_apply]").attr("data-registertype")});b.push({name:"GR-Response",value:a});jQuery.ajax({url:"/Ajax/AccountApply.ashx",data:b,dataType:"json",type:"POST",async:false,beforeSend:function(c,d){$("[name=form_apply]").hide();Global.ShowLoadingUI("Registering. Please wait...","[name=form_apply]","insertBefore")},success:function(k){$("div.loading-container").hide();if(k.success){Global.LoadGenericModal("body","register-dialog",function(){$("#register-dialog .modal-title").html("Registration Submitted");$("#register-dialog #generic-container").html(k.message);$("#register-dialog").modal("show");var i=[];var l=[];$("input.required, select").each(function(m,n){i.push($(n).attr("name"));l.push($(n).val())});ga4.FormSubmission("Register Online",i.join(";"),l.join(";"));if(typeof gtag!==undefined){gtag("event","conversion",{send_to:"AW-11333774074/DLm6CM-vrvMYEPrVrpwq"})}if(k.redirect_to!=undefined&&k.redirect_to!=""){$("#register-dialog #generic-container").html(k.message+"<br/><br/>You will be redirect to "+k.redirect_to+" in 10 seconds");setTimeout(function(){location=k.redirect_to},10000)}})}else{if(jQuery("[name=form_apply]").attr("data-registertype")=="2"){$("[name=form_apply]").show();var d=jQuery.merge([],k.personalInformation);jQuery.merge(d,k.shippingAddress);if(d){var f="";var g=0;for(var e=0;e<d.length;e++){if(d[e]=="EMAIL_IS_BLOCKED"){f="Your email is blocked. Please contact us for assistance.";break}else{if(g==0){f+=d[e]}else{if(g<3){f+=(", "+d[e])}else{f+=(" and "+(d.length-g)+" other issues");break}}g++}}jQuery("[name=form_apply] .error-list").append("<li class='alert alert-danger'>"+f+"</li>");$("html,body").animate({scrollTop:$("[name=form_apply]").offset().top},300)}}else{$("[name=form_apply]").show();var h=$(".olResPersonal");h.empty();if(k.personalInformation){h.css({color:"red",marginTop:"10px"});for(var e=0;e<k.personalInformation.length;e++){if(k.personalInformation[e]=="EMAIL_IS_BLOCKED"){h.append("<li>Your email is blocked. Please contact us for assistance.</li>")}else{h.append("<li>"+k.personalInformation[e]+"</li>")}}}var j=$(".olResShippingAddress");j.empty();if(k.shippingAddress){j.css({color:"red",marginTop:"10px"});for(var e=0;e<k.shippingAddress.length;e++){j.append("<li>"+k.shippingAddress[e]+"</li>")}}var c=$(".olResBillingAddress");c.empty();if(k.billingAddress){c.css({color:"red",marginTop:"10px"});for(var e=0;e<k.billingAddress.length;e++){c.append("<li>"+k.billingAddress[e]+"</li>")}}if(k.personalInformation&&k.personalInformation.length>0&&$(".olResPersonal").length>0){$("html,body").animate({scrollTop:$(".olResPersonal").offset().top},300)}else{if(k.shippingAddress&&k.shippingAddress.length>0&&$(".olResShippingAddress").length>0){$("html,body").animate({scrollTop:$(".olResShippingAddress").offset().top},300)}else{if(k.billingAddress&&k.billingAddress.length>0&&$(".olResBillingAddress").length>0){$("html,body").animate({scrollTop:$(".olResBillingAddress").offset().top},300)}else{$("html,body").animate({scrollTop:$("[name=form_apply]").offset().top},300)}}}}}},error:function(d,e,c){alert("Error: "+e+". Please try to refresh your browser then try again.")}})},ChangePassword:function(){var a=$("ul.error-list");var c=$("[name=txtCurrentPassword]").val().trim();var d=$("[name=txtNewPassword]").val().trim();var b=$("[name=txtConfirmPassword]").val().trim();a.empty();if(c==""){a.append('<li class="alert alert-danger">Current Password is required</li>')}if(d==""){a.append('<li class="alert alert-danger">New Password is required</li>')}if(b==""){a.append('<li class="alert alert-danger">Confirm Password is required</li>')}if(b!=d){a.append('<li class="alert alert-danger">New Password and Confirm Password are not matched</li>')}if(a.html()!=""){return}$.ajax({url:"/WebServices/Account.asmx/ChangePassword",data:JSON.stringify({currentPassword:c,newPassword:d,confirmPassword:b}),dataType:"json",type:"POST",async:true,beforeSend:function(){Global.ShowLoadingUI("Saving Password. Please wait...","[id$=_divChangePassword]","insertBefore");$("div.change-password-controls").hide()},success:function(f){$("div.loading-container").hide();a.empty();if(f.SUCCESS){a.append('<li class="alert alert-success">You have successfully changed your password. You may now use your new password in your next login</li>')}else{console.log(f);if(f.MESSAGE=="VALIDATION_FAILED"&&f.ERROR.length>0){for(var e=0;e<f.ERROR.length;e++){a.append('<li class="alert alert-danger">'+f.ERROR[e]+"</li>")}}else{if(f.MESSAGE=="CONFIRMATION_FAILED"){a.append('<li class="alert alert-danger">New Password and Confirm Password are not matched</li>')}else{if(f.MESSAGE=="DATA_REQUIRED"){a.append('<li class="alert alert-danger">Invalid operation. No parameter</li>')}else{if(f.MESSAGE=="INVALID_CUSTOMER"){a.append('<li class="alert alert-danger">Invalid Customer. Please try to login.</li>')}else{a.append('<li class="alert alert-danger">Error Saving Password. Please try to refresh your browser</li>')}}}}$("div.change-password-controls").show()}},error:function(){$("div.loading-container").hide();a.append('<li class="alert alert-danger">Error Saving Password. Please try to refresh your browser</li>');$("div.change-password-controls").show()}})},RestrictPOBOX:function(){if(jQuery(this).parent().find("p.lineerrorinfo").length==0){jQuery(this).before("<p class='alert alert-danger lineerrorinfo' style='display:none;'></p>")}if(jQuery(this).val().search(/(\sPOB[^a-z]+)|((P[\.\s]*O[\.\s]*)\s*BOX)/i)>-1){jQuery(this).parent().find("p.lineerrorinfo").css("display","block");jQuery(this).parent().find("p.lineerrorinfo").text("Delivery to P.O. Box is not allowed!");return false}else{jQuery(this).parent().find("p.lineerrorinfo").css("display","none")}}};var State={GetState:function(a){if(typeof a!=="undefined"){a=this}var b="#"+(this.id).replace("country","state");if($(b).length>0){$(b).find("option").remove().end().append("<option value=''>-</option>");var c=[{name:"country",value:$(this).val()}];jQuery.ajax({url:"/Ajax/GetStates.ashx",data:c,dataType:"json",type:"POST",async:false,success:function(e){for(var d=0;d<e.length;d++){$(b).append("<option value='"+e[d].code+"'>"+e[d].name+"</option>")}}})}},GetState2:function(a,b){jQuery(b).find("option").remove();var c=[{name:"country",value:jQuery(a).val()}];jQuery.ajax({url:"/Ajax/GetStates.ashx",data:c,dataType:"json",type:"POST",async:false,success:function(e){for(var d=0;d<e.length;d++){jQuery(b).append("<option value='"+e[d].code+"'>"+e[d].name+"</option>")}}})}};var Shipping={CopyShippingToBill:function(){if($("#chk_copy_shipping").is(":checked")){$(".BillingAddress").hide()}else{$(".BillingAddress").show()}}};var Country={GetCountries:function(a){if(/\/Checkout/i.test(location.href)){$(a).find("option").remove().end().append('<option value="AU" selected>Australia</option>')}else{if($(a).length>0){$(a).find("option").remove().end().append("<option value=''>-</option>");jQuery.ajax({url:"https://file2.livingstone.com.au/JSON/Countries.json",dataType:"json",async:false,success:function(c){for(var b=0;b<c.length;b++){$(a).append("<option value='"+c[b].code+"'>"+c[b].name+"</option>")}}})}}}};var Industry={LoadOption:function(a,d,c){if($(a+" option").length>0){return}if($(a).length>0){$(a).find("option").remove().end();var b=d?"industry-remove-it":"industry";jQuery.ajax({url:"/Ajax/GetOptions.ashx",data:[{name:"source",value:b}],dataType:"json",type:"POST",async:false,success:function(g){for(var f=0;f<g.length;f++){var e="<option value='"+g[f].code+"'";if(g[f].selected==true){e+=" selected='selected'"}e+=">"+g[f].name+"</option>";$(a).append(e)}},complete:function(){if(!c){Industry.UpdateStudentFormLabel()}}})}},LoadLivNewIndustries:function(a,b){jQuery.ajax({url:"/Ajax/GetOptions.ashx",data:[{name:"source",value:"liv-new-industries"}],dataType:"json",type:"POST",async:false,beforeSend:function(){if(typeof a==="function"){a()}},success:function(c){if(typeof b==="function"){b(c)}},error:function(){}})},UpdateStudentFormLabel:function(){var b=jQuery("#ddl_industry option:selected").html()||"";var a="Are you a student from "+(Global.bootStrapWebsite?"":"<br/>")+b+" industry?";jQuery("span.studentIndustry").html(a);jQuery("label.studentIndustry").html(a)}};var Checkout={submit:function(){var b=false;if($("#chk_copy_shipping").is(":checked")){$("[id$=txt_bill_to_name]").val($("[id$=txt_ship_to_name]").val());$("[id$=txt_bill_to_address]").val($("[id$=txt_ship_to_address]").val());$("[id$=txt_bill_to_address2]").val($("[id$=txt_ship_to_address2]").val());$("[id$=txt_bill_to_zip_code]").val($("[id$=txt_ship_to_zip_code]").val());$("[id$=txt_bill_to_city]").val($("[id$=txt_ship_to_city]").val());$("[id$=ddl_bill_to_country]").val($("[id$=ddl_ship_to_country]").val());$("[id$=ddl_bill_to_country]").trigger("change");$("[id$=ddl_bill_to_state]").val($("[id$=ddl_ship_to_state]").val())}$(".validation-errors ul").remove();var a=Checkout.validate();if(typeof(a)=="object"&&(a.personal.length>0||a.shipping.length>0||a.billing.length>0)){Checkout.displayErrors(".validation-errors.personal",a.personal);Checkout.displayErrors(".validation-errors.shipping",a.shipping);Checkout.displayErrors(".validation-errors.billing",a.billing)}else{a=Checkout.saveGuest();if(a.success){b=true}else{Checkout.displayErrors(".validation-errors.personal",[a.error_message]);b=false}}return b},saveGuest:function(){var a;$.ajax({url:"/Handler/GenericMethodCall.ashx",type:"POST",dataType:"json",async:false,data:[{name:"first_name",value:$("[id$=txt_first_name]").val()},{name:"last_name",value:$("[id$=txt_last_name]").val()},{name:"company",value:$("[id$=txt_company]").val()},{name:"abn",value:$("[id$=txt_abn]").val()},{name:"email",value:$("[id$=txt_email]").val()},{name:"main_phone",value:$("[id$=txt_main_phone]").val()},{name:"ship_to_name",value:$("[id$=txt_ship_to_name]").val()},{name:"ship_to_company",value:$("[id$=txt_ship_to_company]").val()},{name:"ship_to_address",value:$("[id$=txt_ship_to_address]").val()},{name:"ship_to_address2",value:$("[id$=txt_ship_to_address2]").val()},{name:"ship_to_zip_code",value:$("[id$=txt_ship_to_zip_code]").val()},{name:"ship_to_city",value:$("[id$=txt_ship_to_city]").val()},{name:"ship_to_country",value:$("[id$=ddl_ship_to_country]").val()},{name:"ship_to_state",value:$("[id$=ddl_ship_to_state]").val()},{name:"bill_to_name",value:$("[id$=txt_bill_to_name]").val()},{name:"bill_to_address",value:$("[id$=txt_bill_to_address]").val()},{name:"bill_to_address2",value:$("[id$=txt_bill_to_address2]").val()},{name:"bill_to_zip_code",value:$("[id$=txt_bill_to_zip_code]").val()},{name:"bill_to_city",value:$("[id$=txt_bill_to_city]").val()},{name:"bill_to_country",value:$("[id$=ddl_bill_to_country]").val()},{name:"bill_to_state",value:$("[id$=ddl_bill_to_state]").val()},{name:"delivery_instructions",value:$("[id$=txt_delivery_instruction]").val()},{name:"SameAs",value:$("#chk_copy_shipping").is(":checked")},{name:"method_name",value:"save-guest-information"}],success:function(b){a=b}});return a},validate:function(){var a;$.ajax({url:"/Handler/GenericMethodCall.ashx",type:"POST",dataType:"json",async:false,data:[{name:"first_name",value:$("[id$=txt_first_name]").val()},{name:"last_name",value:$("[id$=txt_last_name]").val()},{name:"company",value:$("[id$=txt_company]").val()},{name:"abn",value:$("[id$=txt_abn]").val()},{name:"email",value:$("[id$=txt_email]").val()},{name:"main_phone",value:$("[id$=txt_main_phone]").val()},{name:"ship_to_name",value:$("[id$=txt_ship_to_name]").val()},{name:"ship_to_company",value:$("[id$=txt_ship_to_company]").val()},{name:"ship_to_address",value:$("[id$=txt_ship_to_address]").val()},{name:"ship_to_address2",value:$("[id$=txt_ship_to_address2]").val()},{name:"ship_to_zip_code",value:$("[id$=txt_ship_to_zip_code]").val()},{name:"ship_to_city",value:$("[id$=txt_ship_to_city]").val()},{name:"ship_to_country",value:$("[id$=ddl_ship_to_country]").val()},{name:"ship_to_state",value:$("[id$=ddl_ship_to_state]").val()},{name:"bill_to_name",value:$("[id$=txt_bill_to_name]").val()},{name:"bill_to_address",value:$("[id$=txt_bill_to_address]").val()},{name:"bill_to_address2",value:$("[id$=txt_bill_to_address2]").val()},{name:"bill_to_zip_code",value:$("[id$=txt_bill_to_zip_code]").val()},{name:"bill_to_city",value:$("[id$=txt_bill_to_city]").val()},{name:"bill_to_country",value:$("[id$=ddl_bill_to_country]").val()},{name:"bill_to_state",value:$("[id$=ddl_bill_to_state]").val()},{name:"SameAs",value:$("#chk_copy_shipping").is(":checked")},{name:"method_name",value:"validate-guest-information"}],success:function(b){a=b}});return a},displayErrors:function(a,b){if(b.length<=0){return}var d="<ul>";for(var c=0;c<b.length;c++){d=d+"<li>"+b[c]+"</li>"}d=d+"</ul>";$(a).append(d)}};var Account={GetAddressses:function(a){if(typeof a=="undefined"||a=="1"){a="true"}else{a="false"}jQuery.ajax({url:"/WebServices/Account.asmx/GetAddresses",data:'{ "set_addresses": "'+a+'", "page": "account" }',type:"POST",success:function(b){if(b.SUCCESS){$("div.delivery-address table tr:not(.header)").remove();$("div.billing-address table tr:not(.header)").remove();Global.LoadTemplate("#account-delivery",function(c){$("div.delivery-address table").append(Mustache.to_html(c,b.Addresses))});Global.LoadTemplate("#account-billing",function(c){$("div.billing-address table").append(Mustache.to_html(c,b.Addresses))});if(Global.allowedChangeAddress){$("div.manage-addresses table tr button.edit").click(Account.LoadEdit);$("div.manage-addresses table tr button.delete").click(Account.InitDeleteAddress)}else{$("div.manage-addresses table tr button.edit").hide();$("div.manage-addresses table tr button.delete").hide()}}else{$("div.delivery-address table").append('<tr class="danger"><td colspan="5">Loading Failed. Please try to refresh your browser.<td></tr>');$("div.billing-address table").append('<tr class="danger"><td colspan="4">Loading Failed. Please try to refresh your browser.<td></tr>')}},beforeSend:function(){$("div.delivery-address table tr:not(.header)").remove();$("div.billing-address table tr:not(.header)").remove();$("div.delivery-address table").append('<tr><td colspan="5"><div class="loading"></div></td></tr>');$("div.billing-address table").append('<tr><td colspan="4"><div class="loading"></div></td></tr>')},error:function(){$("div.delivery-address table").append('<tr class="danger"><td colspan="5">Loading Failed. Please try to refresh your browser.<td></tr>');$("div.billing-address table").append('<tr class="danger"><td colspan="4">Loading Failed. Please try to refresh your browser.<td></tr>')}})},LoadOrderHistory:function(a){a=a==undefined?1:a;var b=1;$.ajax({url:"/WebServices/Account.asmx/GetOrderHistory?page="+a,dataType:"json",type:"GET",async:true,beforeSend:function(){$(".divOrderPagination label.page").html("");$("div.divOrderHistory tbody.divOrderHistoryTableBody").html("");Global.ShowLoadingUI("Loading. Please wait.","[id$=divOrderHistory]","append")},success:function(c){$("div.loading-container").hide();if(c.SUCCESS){a=c.PAGE;b=c.PAGE_TOTAL;Global.LoadTemplate("#account-order",function(d){$("div.divOrderHistory tbody.divOrderHistoryTableBody").html(Mustache.to_html(d,c))});$(".divOrderPagination label.page").html(c.PAGE+" to "+c.PAGE_TOTAL);$(".divOrderPagination [id$=btnOrderPrevious]").unbind("click.OrderHistoryPrev").bind("click.OrderHistoryPrev",function(){Account.LoadOrderHistory(a-1)});$(".divOrderPagination [id$=btnOrderNext]").unbind("click.OrderHistoryNext").bind("click.OrderHistoryNext",function(){Account.LoadOrderHistory(a+1)})}else{$("div.divOrderHistory tbody.divOrderHistoryTableBody").html("");$("[id$=divOrderHistory]").append(c.MESSAGE)}},error:function(){$("div.divOrderHistory tbody.divOrderHistoryTableBody").html("");$("[id$=divOrderHistory]").append("Internal Server Error, Please try again later.")}})},InitProductListingEdit:function(a,b){if(jQuery("#quick-productlisting-view .modal-footer #btnSave").length==0){jQuery("#quick-productlisting-view .modal-footer").prepend("<button id='btnSave' class='btn btn-primary'>Save</button>");jQuery("#quick-productlisting-view .modal-footer #btnSave").click(function(){jQuery.ajax({url:"/WebServices/Product.asmx/SaveProductListingInfo?"+jQuery("#quick-productlisting-view form").serialize(),dataType:"json",type:"GET",async:true,beforeSend:function(){},success:function(c){if(c.SUCCESS){alert("Thank you for the data update, we will be in touch with you after a few hours once the data has been validated.");jQuery("#quick-productlisting-view").modal("hide");Account.LoadProductListing()}},complete:function(){},error:function(){}})})}jQuery.ajax({url:"/WebServices/Product.asmx/GetProductListingInfo?item_no="+a+"&vend_itemno="+b,dataType:"json",type:"GET",async:true,beforeSend:function(){},success:function(c){Global.LoadTemplate("#account-product-listing",function(d){jQuery("#quick-productlisting-view #generic-container").html(Mustache.to_html(d,c))})},complete:function(){},error:function(){}})},LoadProductListing:function(a){a=a==undefined?1:a;var b=1;$.ajax({url:"/WebServices/Product.asmx/GetProductListing?page="+a,dataType:"json",type:"GET",async:true,beforeSend:function(){jQuery(".divProductListingTableBody").html("");Global.ShowLoadingUI("Loading. Please wait.",".divProductListingTableBody","append")},success:function(c){jQuery("[id$=divProductListing] .divProductListingPagination").show();jQuery("[id$=divProductListing] .divProductListingPagination label.page").html("&nbsp;( Page #"+a+" )&nbsp;");jQuery("[id$=divProductListing] [id$=divProductListingPrev]").unbind("click.btnPageListingPrevious").bind("click.btnPageListingPrevious",function(){Account.LoadProductListing(a-1)});jQuery("[id$=divProductListing] [id$=divProductListingNext]").unbind("click.btnPageListingNext").bind("click.btnPageListingNext",function(){Account.LoadProductListing(a+1)});jQuery(c.DATA).each(function(){var d=jQuery("<tr/>");jQuery(d).attr("data-livitemno",this.item_no);jQuery(d).attr("data-venditemno",this.vend_itemno);jQuery(d).append("<td>"+this.item_no+"</td>");jQuery(d).append("<td>"+this.vend_itemno+"</td>");jQuery(d).append("<td>"+this.itm_gen_desc+"</td>");jQuery(d).append("<td>"+this.brand+"</td>");jQuery(d).append("<td><button class='btn btn-success edit'>Edit</button></td>");jQuery(".divProductListingTableBody").append(d)});jQuery(".divProductListingTableBody button.edit").click(function(f){f.preventDefault();var d=jQuery(this);var g=d.closest("tr").attr("data-livitemno");var h=d.closest("tr").attr("data-venditemno");Global.LoadGenericModal("body","quick-productlisting-view",function(){Account.InitProductListingEdit(g,h);jQuery("#quick-productlisting-view").modal("show")})})},complete:function(){$(".divProductListingTableBody div.loading-container").hide()},error:function(){var c=jQuery("<tr/>");jQuery(c).append("<td colspan=3>ERROR</td>");jQuery(".divProductListingTableBody").append(c)}})},GetOrderDetails:function(a){$("#aReorder").attr("href","javascript:Account.Reorder("+a+")");xdata=[{name:"Ord_No",value:a}];jQuery.ajax({url:"/Ajax/GetOrderDetails.ashx",data:xdata,dataType:"json",type:"POST",success:function(b){if(Global.bootStrapWebsite){Account.BuildOrderDetailsBS(b)}else{Account.BuildOrderDetails(b)}}})},BuildOrderDetailsBS:function(a){if($.trim(a.Response)=="A"){a.Response="Paid"}else{a.Response="Unpaid"}a.Type=Account.PaymentType(a.Type);Global.LoadGenericModal("body","genericModal",function(){Global.LoadTemplate("#order-details-template",function(b){if($("#genericModal div.modal-dialog").hasClass("modal-lg")==false){$("#genericModal div.modal-dialog").addClass("modal-lg")}$("#generic-container").html(Mustache.to_html(b,a));$("#myModalLabel").html("Order Details");$("#btnFunction").off("click");$("#btnFunction").attr("onclick","javascript:Account.Reorder("+a.Ord_No+")");$("#btnFunction").html("Reorder");$("#btnFunction").show();$("#genericModal").modal("show")})})},PaymentType:function(b){var a="";switch(jQuery.trim(b.toLowerCase())){case"payp":a="PayPal";break;case"card":a="Credit Card";break;case"acct-cc":a="Credit Card";break;case"acct":a="Account";break;default:a=jQuery.trim(b.Type);break}return a},BuildOrderDetails:function(e){$("#orderDate").html(e.Order_Dt);$("#orderNo").html(e.Ord_No);$("#carrier").html(e.WebSite);var c;switch(jQuery.trim(e.Response.toLowerCase())){case"a":c="Payment Accepted";break;default:c="";break}$("#paymentType").html(Account.PaymentType(e.Type));$("#paymentDate").html(e.paymentDate);if(c!="Payment Accepted"){$("#aReorder").hide()}$("#paymentStatus").html(c);$("#totalProducts").html(e.SubTotal);$("#totalShipping").html(e.Delivery_Amt);$("#totalAmount").html(e.Total_Amt);$("#invoiceAttentionTo").html(e.Cus_Name);$("#invoiceAddress").html(e.Bill_To_Address);$("#invoicePostCode").html(e.Bill_To_PostCode);$("#invoiceCity").html(e.Bill_To_City);$("#invoiceState").html(e.Bill_To_State);$("#invoiceCountry").html(e.Bill_To_Country);if(e.Bill_To_Address_2==""){$("#invoiceAddress2").hide()}else{$("#invoiceAddress2").html(e.Bill_To_Address_2)}$("#deliveryAttentionTo").html(e.Ship_To_Name);$("#deliveryAddress").html(e.Ship_To_Address);if(e.Ship_To_Address_2==""){$("#deliveryAddress2").hide()}else{$("#deliveryAddress2").html(e.Ship_To_Address_2)}$("#deliveryPostCode").html(e.Ship_To_PostCode);$("#deliveryCity").html(e.Ship_To_City);$("#deliveryState").html(e.Ship_To_State);$("#deliveryCountry").html(e.Ship_To_Country);$("#tbodyItems").empty();var b="";if(e.Items.length>0){for(var d=0;d<e.Items.length;d++){b+="<tr>";b+="<td>"+e.Items[d].item_no+"</td>";b+="<td>"+e.Items[d].item_desc+"</td>";b+="<td>"+e.Items[d].quantity+"</td>";b+="<td class='bold black right'>"+e.Items[d].price+"</td>";b+="<td class='bold black right'>"+e.Items[d].total_price+"</td>";b+="</tr>"}}else{b="<tr><td colspan='5'>No items displayed, the order may have been ordered from another website</td></tr>"}$("#tbodyItems").append(b);$("#divOrderDetails").css("display","block");var a=$("#divOrderDetails").offset();if(a!==undefined){$(window).scrollTop(a.top-20)}},Reorder:function(a){$(this).prop("disabled",true);alert(a);xdata=[{name:"Ord_No",value:a}];jQuery.ajax({url:"/Ajax/Reorder.ashx",data:xdata,dataType:"json",type:"POST",async:false});location.href="/OneCheckout"},LoadReorderItems:function(){jQuery.ajax({url:"/WebServices/Account.asmx/GetReorderItems",dataType:"json",type:"POST",beforeSend:function(){$("[id$=divReorderItems] div.reorder-container").empty();Global.ShowLoadingUI("Loading. Please wait.","[id$=divReorderItems] div.reorder-container","append")},success:function(b){$("div.loading-container").remove();$("button.reorder-items-view-summary").removeAttr("disabled");$("button.reorder-items-submit").removeAttr("disabled");if(b.SUCCESS){for(var a=0;a<b.ORDER.length;a++){if(b.ORDER[a].tax_sched=="110"){b.ORDER[a].tax_sched="Inc. GST"}else{if(b.ORDER[a].tax_sched=="100"){b.ORDER[a].tax_sched="GST Free"}else{b.ORDER[a].tax_sched="Exc. GST"}}}Global.LoadTemplate("#reorder-item-template",function(c){$("[id$=divReorderItems] div.reorder-container").empty().html(Mustache.to_html(c,b));ProductView.PriceHighlighter("input.txtNewQty","tr.product-row",function(e){var d=$(e);var f=d.attr("data-item");var h=d.attr("data-row");var g=d.val();var i=0;if(!isNaN(g)&&g!=""&&parseInt(g)>0){UC_Cart.GetPrice(f,g,function(j){if(j.SUCCESS&&j.TOTAL_PRICE){jQuery("#subtotal_"+h).html("AU $"+j.TOTAL_PRICE)}$("table.reorder-items td.reorder-subtotal").each(function(k,m){var l=$(m).html().replace("AU $","");if(!isNaN(l)&&l!=""){i+=parseFloat(l)}});$("#reorder-total").html("AU $"+i.toFixed(2));jQuery("#product_"+h).addClass("selected")})}else{jQuery("#product_"+h).html("").removeClass("selected");$("table.reorder-items td.reorder-subtotal").each(function(j,l){var k=$(l).html().replace("AU $","");if(!isNaN(k)&&k!=""){i+=parseFloat(k)}});$("#reorder-total").html("AU $"+i.toFixed(2))}});$("button.reorder-items-view-summary").unbind("click.ReorderViewSummary").bind("click.ReorderViewSummary",function(){var d=$(this);if(d.html()=="View Summary"){$("table.reorder-items tr.product-row:not(.selected)").hide();d.html("Show all Summary")}else{$("table.reorder-items tr.product-row").show();d.html("View Summary")}});$("button.reorder-items-submit").unbind("click.ReorderSubmit").bind("click.ReorderSubmit",function(){$("table.reorder-items").hide();$("button.reorder-items-view-summary").attr("disabled","true");$("button.reorder-items-submit").attr("disabled","true");Global.ShowLoadingUI("Adding item(s) in your shopping cart. Please wait.","[id$=divReorderItems] div.container","append");var d=[];$("table.reorder-items tr.product-row.selected input.txtNewQty").each(function(f,g){var e=$(g);d.push({item_no:e.attr("data-item"),qty:e.val()})});UC_Cart.InsertCartList(d,function(e){if(e.total_failed!=undefined&&e.total_failed==0){FlashMessage.ShowMessage("Items successfully added to your shopping cart.","success",3000)}else{if(e.total_failed!=undefined){FlashMessage.ShowMessage(e.total_failed.toString()+" items failed to be inserted.","danger",3000)}else{FlashMessage.ShowMessage(e.total_failed.toString()+" items failed to be inserted.","danger",3000)}}$("div.loading-container").remove();$("button.reorder-items-view-summary").removeAttr("disabled");$("button.reorder-items-submit").removeAttr("disabled");$("table.reorder-items").show();UC_Cart.ViewCart()})})})}else{$("[id$=divReorderItems] div.reorder-container").append("<p>"+b.MESSAGE+"</p>");$("button.reorder-items-view-summary").attr("disabled","true");$("button.reorder-items-submit").attr("disabled","true")}},error:function(){$("[id$=divReorderItems] div.reorder-container").append("<p>"+response.MESSAGE+"</p>");$("button.reorder-items-view-summary").attr("disabled","true");$("button.reorder-items-submit").attr("disabled","true")}})},LoadPreviousCarts:function(a){jQuery.ajax({url:"/Handler/GenericMethodCall.ashx?method_name=load-customer-cart&page="+a,type:"GET",dataType:"json",cache:false,beforeSend:function(){jQuery("div.account-previous-carts").empty().append('<p class="alert alert-warning">Loading. Please wait</p>')},success:function(b){Global.LoadTemplate("#account-previous-cart",function(c){jQuery("div.account-previous-carts").empty().append(Mustache.to_html(c,b))});jQuery("p.carts-pagination").html("page "+a+" of "+b.MAX_PAGE);jQuery("a.quick-view-cart").click(function(d){d.preventDefault();var c=$(this);var f=c.attr("data-cart-no");$(this).html("Loading");if(f!=undefined||f!=""){Global.LoadGenericModal("body","quick-cart-view",function(){UC_Cart.LoadPreviousCart("#quick-cart-view #generic-container",f,function(){jQuery("#quick-cart-view").modal("show");c.html("View Cart")})})}})}})},LoadChat:function(a){jQuery.ajax({url:"/Handler/GenericMethodCall.ashx?method_name=load-chat&page="+a,type:"GET",dataType:"json",cache:false,beforeSend:function(){jQuery("div.account-chat").empty().append('<p class="alert alert-warning">Loading. Please wait</p>')},success:function(b){Global.LoadTemplate("#account-chat",function(c){jQuery("div.account-chat").empty().append(Mustache.to_html(c,b))});if(b.SUCCESS){jQuery("p.carts-pagination").html("page "+a+" of "+b.MAX_PAGE);jQuery("a.quick-view-chat").click(function(c){window.open("/ViewBS/Report.aspx?reportname=chat&paramcount=2&param1="+jQuery(this).attr("data-chatroom-id")+"&param2="+jQuery(this).attr("data-chatroom-name"),"_blank")});jQuery("a.quick-print-chat").click(function(c){window.open("/ViewBS/Report.aspx?reportname=chat&NM=1&IS=1&AP=1&paramcount=2&param1="+jQuery(this).attr("data-chatroom-id")+"&param2="+jQuery(this).attr("data-chatroom-name"),"_blank")})}else{if(b.MESSAGE=="NO_PREVIOUS_CHAT"){$("div.account-chat table tbody").html('<tr><td colspan="4" align="center">No previous chat</td></tr>')}else{$("div.account-chat table tbody").html('<tr><td colspan="4" align="center">'+b.MESSAGE+"</td></tr>")}}},error:function(){jQuery("div.account-chat").empty().append('<p class="alert alert-danger">Internal Server Error. Please try again later</p>')}})},PreviousCartsPaging:function(b){b=(b==undefined?"":b);var a=jQuery("input[id=cart-page]");var c=1;if(a.length<=0){jQuery("[id$=divPreviousCarts]").append('<input type="hidden" value="1" id="cart-page" />')}else{c=a.val()}if(!isNaN(parseInt(c))){if(b.toUpperCase()=="NEXT"){c=parseInt(c)+1}else{if(b.toUpperCase()=="BACK"){c=parseInt(c)-1}else{c=1}}}else{c=1}if(c<=0){c=1}a.val(c);Account.LoadPreviousCarts(c)},ChatPaging:function(b){b=(b==undefined?"":b);var a=jQuery("input[id=chat-page]");var c=1;if(a.length<=0){jQuery("[id$=divPreviousCarts]").append('<input type="hidden" value="1" id="cart-page" />')}else{c=$cartPage.val()}if(!isNaN(parseInt(c))){if(b.toUpperCase()=="NEXT"){c=parseInt(c)+1}else{if(b.toUpperCase()=="BACK"){c=parseInt(c)-1}else{c=1}}}else{c=1}if(c<=0){c=1}a.val(c);Account.LoadChat(c)},FormAddress:function(c,a,d){$("#address-form").remove();$("#address-delete-form").remove();var b;if(typeof c==="object"&&c!=null){b=c;a=c.type}if(b==null||b==undefined){b=a.toLowerCase()=="delivery"?Account.CreateDeliveryForm():Account.CreateBillingForm()}Global.LoadGenericModal("body","address-form",function(){$("#address-form .modal-title").html(a+" Address");Global.LoadTemplate("#account-form-address",function(f){$("#address-form #generic-container").html(Mustache.to_html(f,b))});var e=b.fn.country;Country.GetCountries("[id$="+e+"]");$("[id$="+e+"]").change(State.GetState).change();if(b.country!=""||b.country==null||b.country==undefined){$("[id$="+e+"]").val(b.country);$("[id$="+e+"]").trigger("change")}if(b.state!=""||b.state==null||b.state==undefined){$("[id$="+e.replace("country","state")+"]").val(b.state)}if(Global.allowedChangeAddress){$("#address-form #btnFunction").html("Save").show().unbind("click.saveAddress").bind("click.saveAddress",function(){var f;if(a.toLowerCase()=="delivery"){f=Customer.ValidateShippingAddress()}else{f=Customer.ValidateBillingAddress()}if(!f[0].value){$("ul.error-list").empty().append(f[1].value);$("ul.error-list li").addClass("alert alert-danger")}else{Account.SaveAddress(b,d)}});$("#address-form").modal("show")}else{$("#btnFunction").hide()}})},LoadEdit:function(){var a=$(this);if(a.attr("data-row")==undefined||a.attr("data-type")==undefined){alert("Error Loading Edit Form. Please refresh your browser");return}var b=JSON.stringify({id:a.attr("data-row"),type:a.attr("data-type")});$.ajax({url:"/WebServices/Account.asmx/GetAddress",data:b,dataType:"json",type:"POST",beforeSend:function(){},success:function(d){if(d.SUCCESS){var e=d.Address.address_type.toLowerCase();var c=(e=="delivery"?Account.CreateDeliveryForm():Account.CreateBillingForm());c.name=d.Address.name;c.company=d.Address.company;c.address=d.Address.address;c.address_2=d.Address.address_2;c.post_code=d.Address.post_code;c.city=d.Address.city;c.country=d.Address.country;c.state=d.Address.state;c.type=e;c.setdefault=d.Address.default_address;c.id=d.Address.id_address;Account.FormAddress(c,null)}else{if(d.MESSAGE=="INVALID_CUSTOMER"){alert("Invalid customer. Please try to login.")}else{if(d.MESSAGE=="NO_ADDRESS_FOUND"){alert("Address does not exists")}else{alert("Failed to load address. Please try to refresh your browser")}}}},error:function(){alert("Failed to Load Data. Please try to refresh your browser.")}})},InitDeleteAddress:function(){$("#address-form").remove();$("#address-delete-form").remove();var a=$(this);var b=a.attr("data-row");var c=a.attr("data-type");if(b==undefined||c==undefined){alert("Error Loading Edit Form. Please refresh your browser");return}Global.LoadGenericModal("body","address-delete-form",function(){var f={id:b,type:c};var e=$("#address-delete-form #generic-container");var d=$("#address-delete-form #btnFunction");$("#address-delete-form .modal-title").html("Delete "+c+" address");$("#address-delete-form").modal("show");$.ajax({url:"/WebServices/Account.asmx/GetAddress",data:JSON.stringify(f),dataType:"json",type:"POST",beforeSend:function(){e.empty().append('<div class="loading-container"><div class="loading"></div><p style="text-align:center">Loading Address. Please wait</p></div>')},success:function(i){if(i.SUCCESS){var g=i.Address;var h='<div class="message"><p><b>Are you sure? you want to delete this '+c+" address</b></p>";h+="<p>"+g.address+" "+g.address_2+" "+g.city+" "+g.state+" "+g.post_code+" "+g.country+"</p></div>";e.empty().append(h);if(Global.allowedChangeAddress){d.html("Delete").show();d.unbind("click.deleteAddress").bind("click.deleteAddress",function(){Account.DeleteAddress(e,d,b,c)})}else{d.html("Delete").hide()}}else{if(i.MESSAGE=="INVALID_CUSTOMER"){alert("Invalid customer. Please try to login.")}else{if(i.MESSAGE=="NO_ADDRESS_FOUND"){alert("Address does not exists")}else{alert("Failed to load address. Please try to refresh your browser")}}}},error:function(){alert("Failed to load address. Please try to refresh your browser")}})})},DeleteAddress:function(b,a,e,f){if(e==undefined||e==null||f==undefined||f==null){alert("Invalid Parameters. Please try to refresh your browser and try again");return}var d='{ "id": "'+e+'", "type": "'+f+'" }';var c=b.find("div.message");$.ajax({url:"/WebServices/Account.asmx/DeleteAddress",data:d,dataType:"json",type:"POST",beforeSend:function(){c.hide();b.append('<div class="loading-container"><div class="loading"></div><p style="text-align:center">Deleting Address. Please wait</p></div>');a.hide()},success:function(g){b.find(".loading-container").remove();if(g.SUCCESS){b.append('<p class="alert alert-success">Address Successfully deleted.</p>');Account.GetAddressses()}else{if(g.MESSAGE=="DELETE_NOT_ALLOWED"){b.append('<p class="alert alert-danger">Address cannot be deleted. You only have 1 address in '+f+" address</p>");b.append("<p><b>Please try to Add new "+f+" address. Then try to delete again.</b></p>")}else{b.append('<p class="alert alert-danger">Failed to delete address. Please try to refresh your browser and try again</p>')}}},error:function(){b.find(".loading-container").remove();b.append('<p class="alert alert-danger">Failed to delete address. Please try to refresh your browser and try again</p>')}})},SaveAddress:function(b,c){if(b.fn==null){b.fn=(b.type.toLowerCase()=="delivery"?Account.CreateDeliveryForm().fn:Account.CreateBillingForm().fn)}b.name=$("#"+b.fn.name).val();b.company=$("#"+b.fn.company).val();b.address=$("#"+b.fn.address).val();b.address_2=$("#"+b.fn.address_2).val();b.post_code=$("#"+b.fn.post_code).val();b.city=$("#"+b.fn.city).val();b.country=$("#"+b.fn.country).val();b.state=$("#"+b.fn.state).val();b.setdefault=$("#setdefault").is(":checked");b.id=$("#id").val();b.fn=null;var a=JSON.stringify(b);$.ajax({url:"/WebServices/Account.asmx/SaveAddress_old",data:a,type:"POST",dataType:"json",async:true,beforeSend:function(){$("ul.error-list").empty();$("#generic-container .loading-container").remove();$("#generic-container").prepend('<div class="loading-container"><div class="loading"></div><p style="text-align:center">Saving Address. Please wait</p></div>');$("#address-form-container").hide();$("#btnFunction").hide();$("#btnClose").hide()},success:function(d){$("#generic-container .loading-container").remove();$("#btnClose").show();if(d.SUCCESS){$("ul.error-list").empty().append('<li class="alert alert-success">Address successfully saved.</li>');if(typeof c==="function"){c()}else{Account.GetAddressses()}}else{if(d.MESSAGE=="INVALID_CUSTOMER"){$("ul.error-list").empty().append('<li class="alert alert-danger">Invalid Customer. Please try to login again.</li>')}else{if(d.MESSAGE=="INCOMPLETE_DATA"){$("ul.error-list").empty().append('<li class="alert alert-danger">Incomplete Data. Please fill up all the required fields with (*).</li>')}else{$("ul.error-list").empty().append('<li class="alert alert-danger">Error saving address. Please try again.</li>')}}$("#address-form-container").show();$("#btnFunction").show()}},error:function(){$("#generic-container .loading-container").remove();$("ul.error-list").empty().append('<li class="alert alert-danger">Error saving address. Please try again.</li>');$("#address-form-container").show();$("#btnFunction").show();$("#btnClose").show()}})},SaveAddress2:function(e,l,g,f,i,h,j,d){var k=jQuery(e).find(".address-list option:selected");var a=jQuery(k).attr("data-company");if(a==""){a=jQuery(k).attr("data-first_name")+" "+jQuery(k).attr("data-last_name")}var b=[{name:"first_name",value:jQuery(k).attr("data-first_name")},{name:"last_name",value:jQuery(k).attr("data-last_name")},{name:"phone",value:jQuery(k).attr("data-phone")},{name:"email",value:jQuery(k).attr("data-email")},{name:"company",value:jQuery(k).attr("data-company")},{name:"address",value:jQuery(k).attr("data-address")},{name:"address_2",value:jQuery(k).attr("data-address_2")},{name:"post_code",value:jQuery(k).attr("data-post_code")},{name:"city",value:jQuery(k).attr("data-city")},{name:"country",value:jQuery(k).attr("data-country")},{name:"state",value:jQuery(k).attr("data-state")},{name:"same",value:i},{name:"setdefault",value:jQuery(k).attr("data-default_address")},{name:"po",value:g},{name:"notes",value:f},{name:"type",value:l},{name:"postcodeonly",value:h},{name:"id",value:jQuery(k).val()}];var c=JSON.stringify(b);jQuery.ajax({url:"/WebServices/Account.asmx/SaveAddress",data:b,type:"POST",dataType:"json",async:true,beforeSend:function(){jQuery(e).find("ul.error-list").empty();jQuery(e).find("#generic-container .loading-container").remove();jQuery(e).find("#generic-container").prepend('<div class="loading-container"><div class="loading"></div><p style="text-align:center">Saving Address. Please wait</p></div>');jQuery(e).find("#address-form-container").hide();jQuery(e).find("#btnFunction").hide();jQuery(e).find("#btnClose").hide()},success:function(m){jQuery(e).find("#generic-container .loading-container").remove();jQuery(e).find("#btnClose").show();if(m.SUCCESS){jQuery(e).find("ul.error-list").empty().append('<li class="alert alert-success">Address successfully saved.</li>');if(typeof j==="function"){j()}else{Account.GetAddressses()}}else{if(typeof j==="function"){j()}if(m.MESSAGE=="INVALID_CUSTOMER"){jQuery(e).find("ul.error-list").empty().append('<li class="alert alert-danger">Invalid Customer. Please try to login again.</li>')}else{if(m.MESSAGE=="INCOMPLETE_DATA"){jQuery(e).find("ul.error-list").empty().append('<li class="alert alert-danger">Incomplete Data. Please fill up all the required fields with (*).</li>')}else{jQuery(e).find("ul.error-list").empty().append('<li class="alert alert-danger">Error saving address. Please try again.</li>')}}jQuery(e).find("#address-form-container").show();jQuery(e).find("#btnFunction").show()}},error:function(){if(typeof d==="function"){d()}jQuery(e).find("#generic-container .loading-container").remove();jQuery(e).find("ul.error-list").empty().append('<li class="alert alert-danger">Error saving address. Please try again.</li>');jQuery(e).find("#address-form-container").show();jQuery(e).find("#btnFunction").show();jQuery(e).find("#btnClose").show()}})},CreateDeliveryForm:function(){return{name:"",company:"",address:"",address_2:"",post_code:"",city:"",country:"",state:"",type:"Delivery",setdefault:false,id:"",show_company:true,fn:{name:"txt_ship_to_name",company:"txt_ship_to_company",address:"txt_ship_to_address",address_2:"txt_ship_to_address2",post_code:"txt_ship_to_zip_code",city:"txt_ship_to_city",country:"ddl_ship_to_country",state:"ddl_ship_to_state",setdefault:"setdefault",type:"type",id:"id"}}},CreateBillingForm:function(){return{name:"",address:"",company:"",address_2:"",post_code:"",city:"",country:"",state:"",setdefault:false,type:"Billing",id:"",show_company:false,fn:{name:"txt_bill_to_name",address:"txt_bill_to_address",address_2:"txt_bill_to_address2",post_code:"txt_bill_to_zip_code",city:"txt_bill_to_city",country:"ddl_bill_to_country",state:"ddl_bill_to_state",setdefault:"setdefault",type:"type",id:"id"}}},InsertHistoryItemsToCart:function(g,a){var b=jQuery(g).parent().find("[name=itemno]").val();var f=jQuery(g).parent().find("[name=quantity]");var d=f.val();var c=jQuery(g).parent().find("[name=minqty]").val();if(c>0&&(c>d)){alert("item '"+b+"', qty should be greater than "+c+" minimum");f.removeClass("alert-success");f.addClass("alert-danger")}else{UC_Cart.UpdateCart(d,b);f.removeClass("alert-alert");f.addClass("alert-success")}},LoadHistoryTemplate:function(a){a=a||1;$.ajax({url:"/WebServices/Account.asmx/GetHistoryTemplate",data:'{ "page": "'+a+'" }',dataType:"json",type:"POST",async:true,beforeSend:function(){$("div.divHistoryItemsPagination").hide();$("[id$=divListHistoryTemplateTableBody]").html("");Global.ShowLoadingUI("Loading History Template. Please wait...","[id$=divListHistoryTemplate]","append")},complete:function(c){c=c.responseJSON;$("div.loading-container").hide();$("div.divHistoryItemsPagination").show();if(c.SUCCESS){$("div.divHistoryItemsPagination").show();$("[id$=lblHistoryTemplateBatch]").html(a);$("[id$=lblHistoryTemplatePageTotal]").html(c.TOTALPAGE);$("[id$=maxpage]").val(c.TOTALPAGE);for(var b=0;b<c.PRODUCTS.length;b++){if($.trim(c.PRODUCTS[b].tax_sched)=="110"){c.PRODUCTS[b].tax_sched="Inc. GST"}else{if($.trim(c.PRODUCTS[b].tax_sched)=="100"){c.PRODUCTS[b].tax_sched="GST Free"}else{c.PRODUCTS[b].tax_sched="Exc. GST"}}}Global.LoadTemplate("#account-load-history-template",function(d){$("[id$=divListHistoryTemplateTableBody]").html(Mustache.to_html(d,c))});ProductView.PriceHighlighter("input[name=quantity]","tr.product_row")}else{if(c.MESSAGE=="INVALID_CUSTOMER"){$("[id$=divListHistoryTemplateTableBody]").html('<tr><td colspan="6">Invalid Customer. Please try to login or refresh your browser</td></tr>')}else{$("[id$=divListHistoryTemplateTableBody]").html('<tr class="danger"><td colspan="6">Error Loading History template. Please try to login or refresh your browser</td></tr>')}}},error:function(){$("[id$=divListHistoryTemplateTableBody]").html('<tr class="danger"><td colspan="6">Error Loading History template. Please try to login or refresh your browser</td></tr>')}})},ShowAffinity:function(a){a.preventDefault();Global.LoadGenericModal("body","set-affinity",function(){$("#set-affinity .modal-title").html("Choose your Industry");$("#set-affinity .modal-body").html('<select style="width: 100%;padding:8px;font-size:1.2em;" id="ddlIndustryList"></select>');Industry.LoadLivNewIndustries(null,function(d){$("#set-affinity .modal-body").html("");var c=Math.round(d.INDUSTRIES.length/2);d.col=[];for(var b=0;b<c;b++){d.col.push(d.INDUSTRIES[b])}Global.LoadTemplate("#account-show-affinity",function(e){$("#set-affinity .modal-body").append(Mustache.to_html(e,d))});d.col=[];for(var b=c;b<d.INDUSTRIES.length;b++){d.col.push(d.INDUSTRIES[b])}Global.LoadTemplate("#account-show-affinity",function(e){$("#set-affinity .modal-body").append(Mustache.to_html(e,d))});$("ul.livnew-industries li a").click(function(g){g.preventDefault();var f=$(this);$("ul.livnew-industries li").removeClass("selected");f.parent().addClass("selected")});$("#set-affinity #btnFunction").html("Set Industry");$("#set-affinity #btnFunction").unbind("click.setAffinity").bind("click.setAffinity",function(){if($("ul.livnew-industries li.selected").length<=0){$("#set-affinity .modal-body").prepend('<p class="alert alert-danger">Please selected your industry</p>');return}$("#set-affinity .modal-body .alert").remove();var e=$("ul.livnew-industries li.selected:first");var f=e.attr("data-code");var g=e.attr("data-label");$.ajax({url:"/WebServices/Account.asmx/SetAffinity",data:[{name:"affinityCode",value:f},{name:"affinityName",value:g}],method:"POST",dataType:"JSON",async:false,beforeSend:function(){$("[id$=ddlIndustryList]").hide();$("#set-affinity #btnFunction").hide();Global.ShowLoadingUI("Processing. Please wait.","#set-affinity .modal-body","prepend")},success:function(h){$("div.loading-container").remove();if(h.SUCCESS){$("#set-affinity .modal-body").html("");Global.ShowLoadingUI("Done. Reload page. Please wait.","#set-affinity .modal-body","prepend");location.reload()}else{$("#set-affinity .modal-body").prepend('<p class="alert alert-danger">'+h.MESSAGE+"</p>");$("[id$=ddlIndustryList]").show();$("#set-affinity #btnFunction").show()}},error:function(){$("div.loading-container").remove();$("#set-affinity .modal-body").prepend('<p class="alert alert-danger">Internal server error. Please reload page</p>')}})});$("#set-affinity #btnFunction").show();$("#set-affinity").modal("show")})})},PromoFormAddress:function(b,c){var a={};if(typeof b==="object"&&b!=null){a=b}a.fn={name:"txt_bill_to_name",email:"txt_email",address:"txt_bill_to_address",address_2:"txt_bill_to_address2",post_code:"txt_bill_to_zip_code",city:"txt_bill_to_city",country:"ddl_bill_to_country",state:"ddl_bill_to_state"};Global.LoadGenericModal("body","promo-address-form",function(){$("#promo-address-form .modal-title").html("Cash Rebate Address Promo");Global.LoadTemplate("#account-promo-form-address-template",function(e){$("#promo-address-form #generic-container").html(Mustache.to_html(e,a))});var d=a.fn.country;Country.GetCountries("[id$="+d+"]");$("[id$="+d+"]").change(State.GetState).change();if(a.country!=""||a.country==null||a.country==undefined){$("[id$="+d+"]").val(a.country);$("[id$="+d+"]").trigger("change")}if(a.state!=""||a.state==null||a.state==undefined){$("[id$="+d.replace("country","state")+"]").val(a.state)}$("#promo-address-form #btnFunction").html("Join the Promo").show().unbind("click.saveAddress").bind("click.saveAddress",function(){a.fn={name:"txt_bill_to_name",email:"txt_email",address:"txt_bill_to_address",address_2:"txt_bill_to_address2",post_code:"txt_bill_to_zip_code",city:"txt_bill_to_city",country:"ddl_bill_to_country",state:"ddl_bill_to_state"};Account.PromoSaveAddress(a,function(){$("ul.error-list").empty().append('<li class="alert alert-success">You are successfully joined in Livingstone Cash Rebate Promo. Thank you for joining</li>');$("#cart-container p.cash-rebate-promo").remove()})});$("#promo-address-form").modal("show")})},PromoSaveAddress:function(b,c){b.name=$("#"+b.fn.name).val();b.email=$("#"+b.fn.email).val();b.address=$("#"+b.fn.address).val();b.address_2=$("#"+b.fn.address_2).val();b.post_code=$("#"+b.fn.post_code).val();b.city=$("#"+b.fn.city).val();b.country=$("#"+b.fn.country).val();b.state=$("#"+b.fn.state).val();b.fn=null;var a=JSON.stringify(b);$.ajax({url:"/WebServices/Account.asmx/PromoSaveAddress",data:a,type:"POST",dataType:"json",async:true,beforeSend:function(){$("ul.error-list").empty();$("#generic-container .loading-container").remove();$("#generic-container").prepend('<div class="loading-container"><div class="loading"></div><p style="text-align:center">Saving Address. Please wait</p></div>');$("#promo-cash-rebate-form").hide();$("#btnFunction").hide();$("#btnClose").hide()},success:function(e){$("#generic-container .loading-container").remove();$("#btnClose").show();if(e.SUCCESS){if(typeof c==="function"){c()}}else{if(e.MESSAGE=="INVALID_CUSTOMER"){$("ul.error-list").empty().append('<li class="alert alert-danger">Invalid Customer. Please try to login again.</li>')}else{if(e.MESSAGE=="VALIDATION_FAILED"){var d="";$.each(e.ERRORS,function(f,g){d+='<li class="alert alert-danger">'+g+"</li>"});$("ul.error-list").empty().append(d)}else{$("ul.error-list").empty().append('<li class="alert alert-danger">Error saving address. Please try again.</li>')}}$("#promo-cash-rebate-form").show();$("#btnFunction").show()}},error:function(){$("#generic-container .loading-container").remove();$("#promo-cash-rebate-form").show();$("ul.error-list").empty().append('<li class="alert alert-danger">Error saving address. Please try again.</li>');$("#address-form-container").show();$("#btnFunction").show();$("#btnClose").show()}})},PromoGetAddress:function(a){a.preventDefault();jQuery("#cart-container").hide();$.ajax({url:"/WebServices/Account.asmx/GetAddress",data:JSON.stringify({type:"delivery"}),dataType:"json",type:"POST",beforeSend:function(){},success:function(c){if(c.SUCCESS){var b={};b.name=c.Address.name;b.address=c.Address.address;b.address_2=c.Address.address_2;b.post_code=c.Address.post_code;b.city=c.Address.city;b.country=c.Address.country;b.state=c.Address.state;b.email=c.Email;Account.PromoFormAddress(b,null)}else{if(c.MESSAGE=="INVALID_CUSTOMER"){alert("Invalid customer. Please try to login.")}else{if(c.MESSAGE=="NO_ADDRESS_FOUND"){alert("Address does not exists")}else{alert("Failed to load address. Please try to refresh your browser")}}}},error:function(){alert("Failed to Load Data. Please try to refresh your browser.")}})},LoadAccountInfo:function(){if(jQuery("table[id$=accountinfo]").length>0){jQuery.ajax({url:"/Ajax/GetFormattedAccountInfo.ashx",dataType:"json",success:function(a){jQuery(a).each(function(b,c){jQuery("table[id*=accountinfo] tr td."+c.Key).html(c.Value)})}})}},LoadSubscriptions:function(){jQuery.ajax({url:"/WebServices/Email.asmx/GetSubscriptions",dataType:"json",success:function(a){if(a.success&&typeof a.subscription!==typeof undefined){if(a.subscription.cartreminder_enabled){jQuery("[id$=chkCartReminder]").attr("checked","checked")}else{if(typeof jQuery("[id$=chkCartReminder]").attr("checked")===typeof undefined){jQuery("[id$=chkCartReminder]").removeAttr("checked")}}if(a.subscription.newsletter_enabled){jQuery("[id$=chkWebPromo]").attr("checked","checked")}else{if(typeof jQuery("[id$=chkWebPromo]").attr("checked")===typeof undefined){jQuery("[id$=chkWebPromo]").removeAttr("checked")}}jQuery("div.subscriptions-controls").css("display","block")}else{if(a.success){jQuery("div.subscriptions-controls").css("display","block")}else{jQuery("[id$=divSubscriptions] ul.error-list").append("<li class='alert alert-danger'>Failed Loading Subscription Info.</li>");jQuery("div.subscriptions-controls").css("display","none")}}},error:function(){jQuery("[id$=divSubscriptions] ul.error-list").append("<li class='alert alert-danger'>Error Loading Subscription Info.</li>");jQuery("div.subscriptions-controls").css("display","none")},complete:function(){jQuery("[id$=divSubscriptions] div.loading").css("display","none")}})},LoadGoldSilver:function(){jQuery.ajax({url:"/WebServices/Account.asmx/GetGoldSilver",dataType:"json",success:function(a){Global.LoadTemplate("#GoldSilver",function(b){;jQuery("[id$=divGoldSilver]").html(Mustache.to_html(b,a))})},error:function(){jQuery("[id$=divGoldSilver] ul.error-list").append("<li class='alert alert-danger'>Error Promo Info.</li>")},complete:function(){jQuery("[id$=divGoldSilver] div.loading").css("display","none")}})},SaveSubscriptions:function(){var a={cartreminder_enabled:jQuery("[id$=chkCartReminder]").is(":checked")?"1":"0",newsletter_enabled:jQuery("[id$=chkWebPromo]").is(":checked")?"1":"0"};jQuery.ajax({url:"/WebServices/Email.asmx/SaveSubscriptions",dataType:"json",data:a,beforeSend:function(){jQuery("[id$=divSubscriptions] div.loading").css("display","block");jQuery("[id$=divSubscriptions] ul.error-list li").remove();jQuery("[id$=chkCartReminder]").attr("disabled","disabled");jQuery("[id$=chkWebPromo]").attr("disabled","disabled");jQuery("[id$=btnApplySubscriptions]").attr("disabled","disabled")},success:function(b){if(b.success){jQuery("[id$=divSubscriptions] ul.error-list").append("<li class='alert alert-success'>Saving Successful!</li>")}else{jQuery("[id$=divSubscriptions] ul.error-list").append("<li class='alert alert-danger'>"+b.message+"</li>")}},error:function(){jQuery("[id$=divSubscriptions] ul.error-list").append("<li class='alert alert-danger'>Error Saving Subscription Info.</li>")},complete:function(){jQuery("[id$=divSubscriptions] div.loading").css("display","none");jQuery("[id$=chkCartReminder]").removeAttr("disabled");jQuery("[id$=chkWebPromo]").removeAttr("disabled");jQuery("[id$=btnApplySubscriptions]").removeAttr("disabled")}})},LoadRequestNegoPriceModal:function(){Global.LoadGenericModal("body","request-nego-price",function(){$("#request-nego-price .modal-title").html("Request Negotiation Price");$("#request-nego-price").modal("show");Account.ShowRequestNegoPriceForm("#request-nego-price")})},ShowRequestNegoPriceForm:function(b){var a=$(b);$.ajax({url:"/WebServices/Account.asmx/IsAllowedToNegotiatePrice",method:"get",dataType:"json",beforeSend:function(){a.find(".modal-body").empty();Global.ShowLoadingUI("Checking customer",a.selector+" .modal-body","append")},success:function(c){a.find(".modal-body").empty();if(c.SUCCESS){Account.LoadNegotiationUIAndEvents(a)}else{a.find(".modal-body").append('<p class="alert alert-danger">'+c.MESSAGE+"</p>");if(c.MESSAGE=="LOGIN_REQUIRED"){a.find(".modal-body").append('<p><a class="login-link" href="#">Click here</a> to login</p>').find("a.login-link").click(function(d){d.preventDefault();a.modal("hide");if(Global.singlePage){location.hash="/Authentication"}else{location.href="/Authentication"}})}}}})},LoadNegotiationUIAndEvents:function(a){a.find(".modal-body").append('<div class="form-inline" style="margin-bottom: 8px"><p class="alert alert-danger warning" style="display:none"></p><div class="form-group"><label for="item_no">Item No.</label><input type="text" class="form-control" name="item_no" id="item_no" placeholder="Item No."></div><div class="form-group"><label for="qty">Qty</label><input type="email" class="form-control" name="qty" id="qty" placeholder="Qty"></div><button class="btn btn-default add-item">Add</button></div><table class="table item-nego-list"><thead><tr><th>Item No.</th><th>Description</th><th>Qty</th><th>Action</th></tr></thead><tbody></tbody></table>');a.find("#btnFunction").removeClass("btn-primary").addClass("btn-success").html("Send Request").show();var b=a.find("#item_no");var c=a.find("#qty");var d=a.find("p.warning");b.focus();a.find("button.add-item").click(function(){d.hide();if($.trim(b.val())==""||$.trim(c.val())==""){d.html("Item No. and Qty are required").show();return}if(isNaN(parseInt(c.val()))){d.html("Invalid Qty. Should be numeric").show();return}$.ajax({url:"/WebServices/Product.asmx/GetItemName?id="+b.val(),method:"GET",dataType:"json",beforeSend:function(){b.prop("readonly",true);c.prop("readonly",true)},complete:function(){b.prop("readonly",false);c.prop("readonly",false)},success:function(e){if(e.SUCCESS){a.find("table.item-nego-list tbody").append('<tr data-item="'+b.val()+'" data-qty="'+c.val()+'"><td>'+b.val()+"</td><td>"+e.DESCRIPTION+"</td><td>"+c.val()+'</td><td><button class="btn btn-default delete">Delete</button></td></tr>');b.val("");c.val("");a.find("table.item-nego-list tbody tr button.delete").unbind("click.Delete").bind("click.Delete",function(){$(this).closest("tr").remove()})}else{if(e.MESSAGE=="ITEM_NOT_FOUND"){d.html("Item not found. Please check Item No.").show()}else{d.html(e.MESSAGE).show()}}b.focus()}})});a.find("#btnFunction").click(function(){if(a.find("table.item-nego-list tbody tr").length<=0){alert("You do not have items. Please add items and try again");return}var e="<nego>";a.find("table.item-nego-list tbody tr").each(function(f,g){e+='<item id="'+$(g).attr("data-item")+'" qty="'+$(g).attr("data-qty")+'" />'});e+="</nego>";$.ajax({url:"/WebServices/Account.asmx/SaveNegoItems",data:e,method:"POST",dataType:"json",beforeSend:function(){a.find("#btnFunction").hide();a.find("div.form-inline").hide();a.find("table.item-nego-list").hide();Global.ShowLoadingUI("Saving request",a.find(".modal-body").selector,"append")},success:function(f){$("div.loading-container").remove();if(f.SUCCESS){a.find(".modal-body").empty().append('<p class="alert alert-success">Your request successfully saved.<br/>You will receive an email about your request within 24hrs.</p>')}else{a.find("div.form-inline").show();a.find("table.item-nego-list").show();d.html(f.MESSAGE).show();a.find("#btnFunction").show()}}})})},LoadOrdersInvoices:function(c){c=c==undefined?1:c;$("div.divOrderPagination").attr("data-page",c);var d=1;var a=$("div.divOrdersInvoices");var b=$("#chkIncludePOD").is(":checked")?"&include_pod=true":"";$.ajax({url:"/WebServices/Account.asmx/GetOrdersInvoices?page="+c+b,dataType:"json",type:"GET",async:true,beforeSend:function(){a.find(".divOrderPagination").hide();a.find(".divOrderPagination label.page").html("");a.find("tbody.divOrdersInvoicesTableBody").html("");Global.ShowLoadingUI("Loading. Please wait. This may take a while.","[id$=divOrdersInvoices]","append")},complete:function(){if($("div.include-pod-option").length==0){$("div.divOrderPagination").append('<div class="include-pod-option"><input type="checkbox" id="chkIncludePOD">Include Prood of delivery (POD)<br/><span>It may affect loading the invoices</span></div>');$("#chkIncludePOD").change(function(){if($(this).is(":checked")){Account.LoadOrdersInvoices(isNaN(parseInt($("div.divOrderPagination").attr("data-page")))?1:parseInt($("div.divOrderPagination").attr("data-page")))}})}},success:function(e){$("div.loading-container").hide();if(e.SUCCESS){a.find(".divOrderPagination").show();c=e.PAGE;d=e.PAGE_TOTAL;$.each(e.DATA,function(f,g){this.Link=function(){var i="";var h=this.invoices.split(" ");$.each(h,function(j,k){if($.trim(k)!=""){i=i+'<a href="/WebServices/Account.asmx/DownloadInvoice?invoice='+k+'" class="inv-link">'+k+"</a>"}});return i}});Global.LoadTemplate("#account-load-orders-invoices-pod",function(f){a.find("tbody.divOrdersInvoicesTableBody").html(Mustache.to_html(f,e))});a.find(".divOrderPagination label.page").html(e.CURRENT_PAGE+" to "+e.TOTAL_PAGE);a.find("[id$=btnOrderInvPrevious]").unbind("click.OrderInvoicePrev").bind("click.OrderInvoicePrev",function(){Account.LoadOrdersInvoices(e.CURRENT_PAGE-1)});a.find("[id$=btnOrderInvNext]").unbind("click.OrderInvoiceNext").bind("click.OrderInvoiceNext",function(){Account.LoadOrdersInvoices(e.CURRENT_PAGE+1)})}else{a.find("tbody.divOrdersInvoicesTableBody").html("");a.append(e.MESSAGE)}},error:function(){a.find("tbody.divOrdersInvoicesTableBody").html("");a.append("Internal Server Error, Please try again later.")}})},GetTransactionDetails:function(){var a=$("div.credit-card");$.ajax({url:"/WebServices/Account.asmx/GetTransactionDetails",dataType:"JSON",method:"GET",beforeSend:function(){$("div.container div.left-pane").hide();$("div.container div.right-pane").removeClass("col-md-9").addClass("col-xs-12 col-sm-12 col-md-12")},success:function(b){$("p.loading-notification").remove();if(b.SUCCESS){;a.find("[name=txtCardHolderName]").val(b.customer_name);a.find("[name=txtCustomerName]").val(b.customer_name);a.find("[name=txtEmail]").val(b.email);a.find("[name=txtAddress]").val(b.address);a.find("[name=txtCity]").val(b.city);a.find("[name=txtState]").val(b.state);a.find("[name=txtPostCode]").val(b.post_code);a.find("[name=txtCountry]").val(b.country);a.find("[name=txtPhone]").val(b.phone);a.find("div.transaction-charges p.amount.subtotal").html(b.cart_subtotal);a.find("div.transaction-charges p.amount.freight").html(b.cart_freight);a.find("div.transaction-charges p.amount.surcharge").html(b.card_surcharge);a.find("div.transaction-charges p.amount.total").html("<b>"+b.cart_total+"</b>");if(Global.settings.ShowGR&&$("div.g-recaptcha").length==0){$('<div class="g-recaptcha" data-sitekey="6LdC_7gUAAAAAHJEABL2MFpQfPTm5Myr0B6A27aE"></div>').insertBefore("button.btn.btn-success.confirm-continue");$('<script src="https://www.google.com/recaptcha/api.js"></script>').insertAfter("button.btn.btn-success.confirm-continue")}$("[name=txtCardNumber]").blur(function(){$.ajax({url:"/WebServices/Account.asmx/GetCreditCardSurcharge",data:{cardNumber:$(this).val()},dataType:"JSON",method:"POST",success:function(c){if(c.SUCCESS){a.find("div.transaction-charges p.amount.subtotal").html(c.total_cart);a.find("div.transaction-charges p.amount.surcharge").html(c.surcharge);a.find("div.transaction-charges p.amount.freight").html(c.freight);a.find("div.transaction-charges p.amount.total").html("<b>"+c.total+"</b>");if(parseFloat(c.card_surcharge)>0){a.find("div.payment-details").prepend('<p class="alert alert-warning credit-card-surcharge">'+c.card_type+" additional surcharge of "+c.card_surcharge+"</p>")}}},beforeSend:function(){a.find("p.credit-card-surcharge").remove()}})});a.find("button.confirm-continue").click(function(){$("div.card-details input.form-control").removeClass("alert-danger").removeClass("alert-success");a.find("div.card-details input.form-control").each(function(g,h){var f=$(h);if($.trim(f.val())==""){f.addClass("alert-danger")}else{f.addClass("alert-success")}});$("div.customer-details input.form-control").removeClass("alert-danger").removeClass("alert-success");a.find("div.customer-details input.form-control").each(function(g,h){var f=$(h);if($.trim(f.val())==""){f.addClass("alert-danger")}else{f.addClass("alert-success")}});if($.trim(a.find("[name=txtEmail]").val())!=""){if(!Global.isEmailValid($.trim(a.find("[name=txtEmail]").val()))){a.find("[name=txtEmail]").addClass("alert-danger")}else{a.find("[name=txtEmail]").addClass("alert-success")}}if($.trim(a.find("[name=txtEmail]").val())!=""){if(!Global.isEmailValid($.trim(a.find("[name=txtEmail]").val()))){a.find("[name=txtEmail]").addClass("alert-danger")}else{a.find("[name=txtEmail]").addClass("alert-success")}}var c=$.trim(a.find("[name=txtCardNumber]").val());if(c!=""){if(!/\d{14,}/g.test(c.replace(/[\s-\/]/g,""))){a.find("[name=txtCardNumber]").addClass("alert-danger")}else{a.find("[name=txtCardNumber]").addClass("alert-success")}}var d=$.trim(a.find("[name=txtCVV]").val());if(d!=""){if(!/^[\d]+$/g.test(d.replace(/[\s-\/]/g,""))){a.find("[name=txtCVV]").addClass("alert-danger")}else{a.find("[name=txtCVV]").addClass("alert-success")}}if(a.find("input.form-control.alert-danger").length==0){var e="";if($("div.g-recaptcha").length>0){e=grecaptcha.getResponse()}$.ajax({url:"/WebServices/Account.asmx/ProcessCard",data:[{name:"CardNumber",value:$("[name=txtCardNumber]").val()},{name:"CVV",value:$("[name=txtCVV]").val()},{name:"CardHolderName",value:$("[name=txtCardHolderName]").val()},{name:"ExpiryDate",value:$("[name=txtExpiryDate]").val()},{name:"ExpiryYear",value:$("[name=txtExpiryYear]").val()},{name:"CustomerName",value:$("[name=txtCustomerName]").val()},{name:"Email",value:$("[name=txtEmail]").val()},{name:"Address",value:$("[name=txtAddress]").val()},{name:"City",value:$("[name=txtCity]").val()},{name:"State",value:$("[name=txtState]").val()},{name:"PostCode",value:$("[name=txtPostCode]").val()},{name:"Country",value:$("[name=txtCountry]").val()},{name:"Phone",value:$("[name=txtPhone]").val()},{name:"grResponse",value:e}],method:"POST",beforeSend:function(){$("div.transaction-charges").hide();$("div.payment-details").hide();$("div.credit-card-button").hide();Global.ShowLoadingUI("Processing Credit Card. Please wait. <br/><b>Please do not refresh.</b>","div.credit-card","prepend")},success:function(f){if(f.SUCCESS){Global.ShowLoadingUI("Done Processing. Redirecting please wait. <br/><b>Please do not refresh.</b>","div.credit-card","prepend");location.href=f.url}else{$("div.transaction-charges").show();$("div.payment-details").show();$("div.credit-card-button").show();a.find("div.payment-details").prepend('<p class="alert alert-danger">'+f.MESSAGE+"</p>");if(f.COUNTER!=undefined&&f.COUNTER>=2&&$("div.g-recaptcha").length==0){$('<div class="g-recaptcha" data-sitekey="6LdC_7gUAAAAAHJEABL2MFpQfPTm5Myr0B6A27aE"></div>').insertBefore("button.btn.btn-success.confirm-continue");$('<script src="https://www.google.com/recaptcha/api.js"></script>').insertAfter("button.btn.btn-success.confirm-continue")}}},complete:function(){$("div.loading-container").remove()}})}});$("div.transaction-charges").show();$("div.payment-details").show();$("button.confirm-continue").show()}else{$("div.transaction-charges").hide();$("div.payment-details").hide();$("div.credit-card-button").hide();if(b.MESSAGE=="DATA_VERIFICATION_FAILED"){$("div.credit-card").prepend('<p class="alert alert-danger">Data Verification Failed. Please try again. <a href="/Order/4" class="btn btn-warning">Back to Step 4</a></p>')}else{$("div.credit-card").prepend('<p class="alert alert-danger">'+b.MESSAGE+'. <a href="/Order/4" class="btn btn-warning">Back to Step 4</a></p>')}}}})},GetUnpaidInvoices:function(a){a=a||"1";$.ajax({url:"/WebServices/Account.asmx/GetUnpaidOrders?page="+a,method:"GET",beforeSend:function(){Global.ShowLoadingUI("Loading. Please wait","table.unpaid-orders","insertAfter");$("ul.pagination").empty();$("tbody.divUnpaidOrdersTableBody").empty()},complete:function(){$("div.loading-container").remove()},success:function(d){var e='{{#ORDERS}}<tr><td>{{customer_ref}}</td><td>{{quote_no}}</td><td>{{quote_dt}}</td><td>{{order_amt}}</td><td>{{inv_no}}</td><td>{{inv_amt}}</td><td>{{balance}}</td><td><input type="checkbox" data-invoice="{{inv_no}}" data-balance="{{balance}}"/></td></tr>{{/ORDERS}}';if(d.SUCCESS){var c=Mustache.to_html(e,d);$("tbody.divUnpaidOrdersTableBody").html(c);if(d.PAGE!=undefined&&d.PAGE.page_total>0){for(var b=1;b<=d.PAGE.page_total;b++){$("ul.pagination").append("<li"+(d.PAGE.page_current==b?' class="active"':"")+'><a href="#" data-id="'+b+'">'+b+"</a></li>")}$("ul.pagination li a").click(function(f){f.preventDefault();var g=$(this).attr("data-id");Account.GetUnpaidInvoices(g)})}$("tbody.divInvoiceListTableBody tr").each(function(f,h){console.log("reselecting");var g=$(h).attr("data-invoice");$("input[data-invoice="+g+"]").prop("checked",true)});$("button.pay-now").unbind("click.payNow").bind("click.payNow",function(){$("p.alert").remove();var g=[];var f=$("tbody.divInvoiceListTableBody tr");if(f.length==0){$('<p class="alert alert-danger">List is empty, please select invoice to pay.</p>').insertAfter("table.invoice-list")}else{f.each(function(i,k){var j=$(k).attr("data-invoice");var h=$(k).attr("data-balance");g.push('<inv i="'+j+'" b="'+h+'"/>')});$.ajax({url:"/WebServices/Account.asmx/PostInvoicesToBePaid",data:g.concat().toString(),method:"POST",beforeSend:function(){$("p.alert").remove();Global.ShowLoadingUI("Saving. Please wait","table.unpaid-orders","insertBefore");$("table.unpaid-orders").hide();$("ul.pagination").hide();$("button.pay-now").prop("disabled","disabled").hide()},success:function(h){$("div.loading-container").remove();if(h.SUCCESS){Global.ShowLoadingUI("Transferring to payment portal. Please wait","table.unpaid-orders","insertBefore");location.href="/ViewBS/PaymentPortal.aspx?token="+h.TOKEN}else{$('<p class="alert alert-danger">'+h.MESSAGE+"</p>").insertBefore("table.unpaid-orders");$("table.unpaid-orders").show();$("ul.pagination").show();$("button.pay-now").prop("disabled","").show()}}})}});$("tbody.divUnpaidOrdersTableBody tr td input[type=checkbox]").change(function(){console.log("selected");var h=$(this).is(":checked");var g=$(this).attr("data-invoice");var f=$(this).attr("data-balance");if(h){Account.InvoiceAddToBePaid(g,f)}else{Account.InvoiceRemoveToBePaid(g,f)}Account.InvoiceRecomputeTotal()})}else{$("tbody.divUnpaidOrdersTableBody").html('<tr class="danger"><td colspan="8">'+d.MESSAGE+"</td></tr>")}}})},InvoiceAddToBePaid:function(c,b){$("p.alert").remove();var a=$("tbody.divInvoiceListTableBody tr[data-invoice="+c+"]");if(a.length==0){$("tbody.divInvoiceListTableBody").append('<tr data-invoice="'+c+'" data-balance="'+b+'"><td>'+c+"</td><td>"+parseFloat(b).toFixed(2)+"</td></tr>")}else{$('<p class="alert alert-danger">Invoice #'+c+" already exists in the to be paid list</p>").insertAfter("table.invoice-list")}},InvoiceRemoveToBePaid:function(c,b){$("p.alert").remove();var a=$("tbody.divInvoiceListTableBody tr[data-invoice="+c+"]");if(a.length>=1){a.remove();$('<p class="alert alert-success">Invoice #'+c+" removed from the list</p>").insertAfter("table.invoice-list")}},InvoiceRecomputeTotal:function(){console.log("recompute");var a=0;$("tbody.divInvoiceListTableBody tr").each(function(c,d){var b=$(d).attr("data-balance");if(!isNaN(b)){a+=parseFloat(b)}});$("b.tobepaid-total").html(a.toFixed(2))}};var Employee={Update:function(){var a=jQuery("#btnUpdate");var b=jQuery("#EmployeeForm").serializeArray();jQuery("#result").empty().css("color","red");b.push({name:"id",value:jQuery("#hid_id").val()});b.push({name:"action",value:"update"});jQuery.ajax({url:"/Ajax/EmployeeService.ashx",data:b,dataType:"json",type:"POST",async:false,beforeSend:function(){a.prop("disabled",true)},error:function(){a.prop("disabled",false)},success:function(c){Employee.DisplayResult(c);a.prop("disabled",false)}})},DisplayResult:function(b){jQuery(".olResPersonal").empty();jQuery(".olResShippingAddress").empty();jQuery(".olResBillingAddress").empty();if(b.success){location.href="/Account/Employee/ChangesSubmitted"}else{if(b.error){if(b.personalInfoErrors){for(var a=0;a<b.personalInfoErrors.length;a++){jQuery(".olResPersonal").append("<li>"+b.personalInfoErrors[a]+"</li>")}}if(b.shippingErrors){for(var a=0;a<b.shippingErrors.length;a++){jQuery(".olResShippingAddress").append("<li>"+b.shippingErrors[a].replace("Shipping Address - ","")+"</li>")}}if(b.billingErrors){for(var a=0;a<b.billingErrors.length;a++){jQuery(".olResBillingAddress").append("<li>"+b.billingErrors[a].replace("Billing Address - ","")+"</li>")}}}}},GetEmployee:function(){var a={id:jQuery("#hid_id").val()};jQuery.ajax({url:"/Ajax/EmployeeService.ashx",data:a,dataType:"json",type:"POST",async:false,success:function(b){if(b.employee){Employee.SetEmployee(b.employee)}else{jQuery("#hid_id").val("-1")}}})},SetEmployee:function(a){jQuery("#FirstName").val(a.First_Name);jQuery("#LastName").val(a.Last_Name);jQuery("#Department").val(a.Department);jQuery("#PhoneNo").val(a.Phone);jQuery("#FaxNo").val(a.Fax);jQuery("#Email").val(a.Email);jQuery("#WorkStatus").val(a.work_status);jQuery("#ShipAttn").val(a.Ship_to_name);jQuery("#ShipCompany").val(a.Ship_to_company);jQuery("#ShipAddr_1").val(a.Ship_to_address);jQuery("#ShipSuburb").val(a.Ship_to_city);jQuery("#ShipZip").val(a.Ship_to_PostCode);jQuery("#ShipState").val(a.Ship_to_state);jQuery("#ShipCountry").val(a.Ship_to_country);jQuery("#BillAttn").val(a.Bill_to_Name);jQuery("#BillAddr_1").val(a.Bill_to_address);jQuery("#BillSuburb").val(a.Bill_to_city);jQuery("#BillZip").val(a.Bill_to_PostCode);jQuery("#BillState").val(a.Bill_to_state);jQuery("#BillCountry").val(a.Bill_to_country)}};var customReporting=function(){var b=function(){$("input[name=dtStartDate]").datepicker({dateFormat:"dd/mm/yy",numberOfMonths:2});$("input[name=dtEndDate]").datepicker({dateFormat:"dd/mm/yy",numberOfMonths:2});a(true)};_bindEvent=function(){$("button.download-report").click(function(d){d.preventDefault();a(false)});$("ul.report-menu li a").click(function(){$("ul.report-menu li a").removeClass("selected");$(this).addClass("selected");$("input[name=hidReportType]").val($(this).attr("data-report"))})};var a=function(d){$.ajax({url:"/WebServices/Account.asmx/DownloadCustomReport",data:$("div.report-filter form").serializeArray(),method:"POST",dataType:d?"json":"text",beforeSend:function(){Global.ShowLoadingUI("Generating report","div.report-filter","append")},complete:function(){$("div.loading-container").remove()},success:function(g){var e=g;if(e.available!=undefined&&e.available.length>0){$("ul.report-menu").empty();$.each(e.available,function(h,j){$("ul.report-menu").append('<li><a href="#" data-report="'+j.report_name+'" class="'+(j.selected?"selected":"")+'">'+j.report_label+"</a></li>")});$("input[name=hidReportType]").val($("ul.report-menu li a.selected").attr("data-report"));_bindEvent()}if(!d&&$("input[name=hidReportType]").val()!=""){var f=$("input[name=hidReportType]").val()+".xls";c(e,f)}}})};var c=function(f,g){var d=document.createElement("a");$("body").append(d);d.style="display: none";var e=new Blob([f],{type:"octet/stream"});var h=window.URL.createObjectURL(e);d.href=h;d.download=g;d.click();window.URL.revokeObjectURL(h)};return{init:b}}();jQuery(document).ready(function(){Account.LoadAccountInfo();if(jQuery("div.account-previous-carts").length>0){Account.PreviousCartsPaging();jQuery("button.previous-carts-back").click(function(){Account.PreviousCartsPaging("BACK")});jQuery("button.previous-carts-next").click(function(){Account.PreviousCartsPaging("NEXT")})}if(jQuery("div.account-chat").length>0){Account.ChatPaging();jQuery("button.previous-chat").click(function(){Account.ChatPaging("BACK")});jQuery("button.previous-chat").click(function(){Account.ChatPaging("NEXT")})}if(jQuery("[id$=divAddresses]").length>0){if(Global.allowedChangeAddress){jQuery("[id$=btnNewDeliveryAddress]").click(function(){Account.FormAddress(null,"Delivery")});jQuery("[id$=btnNewBillingAddress]").click(function(){Account.FormAddress(null,"Billing")});jQuery("p.address-security").hide()}else{jQuery("[id$=btnNewDeliveryAddress]").hide();jQuery("[id$=btnNewBillingAddress]").hide();jQuery("p.address-security").show()}Account.GetAddressses()}if(jQuery("[id$=divListHistoryTemplate]").length>0){Account.LoadHistoryTemplate();$("[name=btnHistoryTemplatePrevious]").click(function(){var c=$("[id$=page]");var d=1;if(isNaN(parseInt(c.val()))){d=1}else{d=parseInt(c.val())}d-=1;if(d<1){d=1}c.val(d);Account.LoadHistoryTemplate(d)});$("[name=btnHistoryTemplateNext]").click(function(){var d=$("[id$=page]");var c=$("[id$=maxpage]");var f=1;var e=1;if(isNaN(parseInt(d.val()))){f=1}else{f=parseInt(d.val())}if(isNaN(parseInt(c.val()))){e=1}else{e=parseInt(c.val())}f+=1;if(f>e){f=e}d.val(f);Account.LoadHistoryTemplate(f)})}if(jQuery("[id$=divOrderHistory]").length>0){Account.LoadOrderHistory(1)}if(jQuery("[id$=divReorderItems]").length>0){Account.LoadReorderItems()}if(jQuery("[id$=divOrdersInvoices]").length>0){Account.LoadOrdersInvoices(1)}if(jQuery("[id$=divSubscriptions]").length>0){Account.LoadSubscriptions();jQuery("[id$=btnApplySubscriptions]").bind("click",Account.SaveSubscriptions)}if(jQuery("[id$=divGoldSilver]").length>0){Account.LoadGoldSilver()}if(jQuery("[id$=divProductListing]").length>0){Account.LoadProductListing()}if(jQuery("[id$=divUnpaidOrders]").length>0){Account.GetUnpaidInvoices()}if($("div.credit-card").length>0){Account.GetTransactionDetails()}if($("a[href$=negoprice]").length>0){$("a[href$=negoprice]").bind("click",Account.LoadRequestNegoPriceModal)}if($("[id$=divCustomReport]").length>0){customReporting.init()}var a=function(e,f){var c=document.createElement("a");$("body").append(c);c.style="display: none";var d=new Blob([e],{type:"octet/stream"});var g=window.URL.createObjectURL(d);c.href=g;c.download=f;c.click();window.URL.revokeObjectURL(g)};if($("button.upload-web-accounts").length>0){$("button.upload-web-accounts").attr("id","btnUploadWebAccount");var b=new ss.SimpleUpload({button:"btnUploadWebAccount",url:"/handler/GenericMethodCall.ashx?method_name=file-upload-webaccount",name:"file",allowedExtensions:["XLSX","XLS"],maxSize:1024,responseType:"application/json",onExtError:function(d,c){alert("Invalid file type it should be XLSX/XLS.")},onSizeError:function(c,d){alert("File size should be less than 1MB")},onError:function(c,i,g,h,d,j,f){if(d!=undefined&&d!=""){var e=jQuery.parseJSON(d);if(e.message){alert(e.message)}else{alert("Upload failed")}}},onComplete:function(d,f){if(f!=undefined&&f!=""){if(/\{(.)+\}/.test(f)){var g=jQuery.parseJSON(f);alert(g.MESSAGE)}else{var c=new Date();var e=c.getFullYear()+"-"+c.getMonth()+"-"+c.getDay()+" "+c.getHours()+"-"+c.getMinutes()+"-"+c.getSeconds();a(f,"result_"+e+".xls")}}}})}});var quote=function(){var a=function(){_loadAddress()};var b=function(e){jQuery.ajax({url:"/WebServices/Account.asmx/GetAddresses",data:'{ "set_addresses": "false", "page": "order" }',type:"POST",success:function(f){if(typeof e==="function"){e(f)}}})};var d=function(){var e=$("form.form-quote").serializeArray();$.ajax({url:"/WebServices/Quote.asmx/CreateOrUpdate",data:e,method:"POST",beforeSend:function(){$("#QuoteDetails").find("p.alert").remove();Global.ShowLoadingUI("Processing...","form.form-quote","insertBefore");$("form.form-quote").hide();$("#btnFunction").hide();$("#btnPrintQuote").hide()},success:function(f){$("div.loading-container").remove();$('<p class="alert alert-'+(f.SUCCESS?"success":"danger")+'">'+f.MESSAGE+"</p>").insertBefore("form.form-quote");if(f.SUCCESS){$("#btnFunction").html("Update Quote")}$("form.form-quote").show();$("#btnFunction").show();$("#btnPrintQuote").show()}})};var c=function(){Global.LoadGenericModal("body","QuoteDetails",function(){Global.LoadTemplate("#web-quote-form",function(e){b(function(f){var g={};g.delivery=f.Addresses.delivery;g.billing=f.Addresses.billing;g.po_number=f.PO;g.delivery_instruction=f.NOTES;g.promo_code=f.CAMP_CODE;var h=Mustache.to_html(e,g);$("#QuoteDetails").find(".modal-title").html("Create Quote");$("#QuoteDetails").find("div.modal-body").html(h);if(f.ID_DELIVERY>0){$("#QuoteDetails select#delivery_address").val(f.ID_DELIVERY)}if(f.ID_BILLING>0){$("#QuoteDetails select#billing_address").val(f.ID_BILLING)}$("#cart-container").hide();if($("#btnPrintQuote").length==0){$('<a id="btnPrintQuote" class="btn btn-warning" href="/WebServices/Quote.asmx/Print" target="_blank">Print Quote</a>').insertAfter("#btnFunction")}if(f.QUOTE_CREATED){$("#btnFunction").html("Update Quote").show().off("click").on("click",d);$("#btnPrintQuote").show()}else{$("#btnFunction").html("Create Quote").show().off("click").on("click",d);$("#btnPrintQuote").hide()}$("#QuoteDetails").modal("show")})})})};return{syncCart:d,setupUI:c}}();var UC_Cart={OverCreditLimit:false,AddDiscount:function(){},CheckCampCodeWarning:function(a){$.get("/WebServices/Cart.asmx/CheckDiscountWarning",function(b){if(b.SUCCESS){if(b.MESSAGE!="NO_DATA"){if(typeof a==="function"){a(b.MESSAGE)}}}})},CartReviewCharges:function(){Hook.Add({ajaxName:"GetCartTotal",caller:"UC_Cart.CartReviewCharges",beforeSend:function(){$(".cart-amount-info.discount").hide();$(".cart-amount-info.cartsavings").hide()},success:function(b){if(!b.MESSAGE){if(b.Discount!=""){$(".cart-amount-info.discount").show();$(".cart-amount-info > span.discount").text("("+b.Discount+")")}$(".cart-amount-info > .total").text(b.GrandTotal);$(".cart-amount-info > .tax").text(b.Tax);$(".cart-amount-info > .shipping").text(b.Freight.Charge)}var a="Checkout via "+b.PaymentMode;if(Global.settings.accCreditNoValidation&&b.PaymentMode=="ACCOUNT CREDIT"){a="Place Order"}$("#btnCheckout").html(a).unbind("click.Checkout").bind("click.Checkout",function(){if(Global.settings.accCreditNoValidation&&b.PaymentMode=="ACCOUNT CREDIT"){location.href="/ViewBS/Order.aspx?payment=ACCT"}else{$.ajax({url:"/WebServices/Cart.asmx/RunCampaignRulesByCart",type:"GET",dataType:"json",beforeSend:function(){$("#btnCheckout").html("Validating...")},success:function(c){if(c.SUCCESS){$("#btnCheckout").addClass("loading-side");if(b.PaymentMode=="PAYPAL"){location="/ViewBS/Order.aspx?payment=PayPal";$("#btnCheckout").html("Waiting for PayPal...")}else{if(b.PaymentMode=="CREDIT CARD"){location="/ViewBS/Order.aspx?payment=MW";$("#btnCheckout").html("Waiting for Merchant Warrior...")}else{if(b.PaymentMode=="QUOTEONLY"){location="/ViewBS/Order.aspx?payment=QUOTEONLY"}else{$("#livingstone_payment").on("shown.bs.modal",function(){$.ajax({url:"/WebServices/Account.asmx/GetAccountNo",dataType:"JSON",method:"GET",success:function(d){$("#livingstone_payment #cus_no").val(d.ACCOUNT)}})});$("#livingstone_payment").modal("show")}}}}else{UC_Cart.ShowAlert(c)}},error:function(){$("#btnCheckout").html("Checkout via "+b.PaymentMode);if($("#btnCheckout").hasClass("loading-side")){$("#btnCheckout").removeClass("loading-side")}}})}})}});Hook.Execute("GetCartTotal")},BuildCartReviewHtmlBS:function(j){console.log("BuildCartReviewHtmlBS");var a=$("div.cart-review-container ul.cart-content");var f=0;if(a.length<=0){return}a.find("li").remove();if(j.length>0){var i="";var k=0;for(var g=0;g<j.length;g++){if(g==0){i="<dl id='CartProducts' class='products'>"}var b=j[g]["qty_on_hand"]<=j[g].stock_minavailable;if(b){k+=1}var e="";if(/B1T1$/i.test(j[g].sourcefrom)){e='<b style="color: red"> (Buy 1 Get 1)</b>'}else{if(/BUNDLE$/i.test(j[g].sourcefrom)){e='<b style="color: red"> (Bundle Item)</b>'}else{if(/BMGM/i.test(j[g].sourcefrom)){e='<b style="color: red"> (Buy More Get More)</b>'}else{e=""}}}var h=j[g].item_name;var c=Utility.urlencode(j[g].item_no);var d="";d+='<li id="orderLine_'+j[g].id_cart_lin+'">';d+='<span class="price">'+((j[g].is_login_required=="true"&&j[g].is_visitor_singleprice_enabled==false)?"Upon Login":j[g].total_price)+"</span>";d+='<img src="'+location.protocol+"//file.livingstone.com.au/images/product/90x90/"+c+'.png" alt="'+h+'" />';d+='<span class="item-name"><a href="/Product/id/'+c+'">'+h+"</a></span>";d+='<span class="item-no">Item no: '+j[g].item_no+e+"</span>";d+='<span class="qty">Quantity: '+j[g].quantity+(b?" below stock":"")+"</span>";d+="</li>";f+=j[g].quantity;a.append(d);console.log("cart line")}}},ViewCartReview:function(a){Hook.Add({ajaxName:"ViewCart",caller:"UC_Cart.ViewCartReview",success:function(b){console.log("ViewCartReview");UC_Cart.BuildCartReviewHtmlBS(b);if(typeof a==="function"){a()}},complete:function(){UC_Cart.CartReviewCharges()}})},UpdateCart2:function(e,b,a,c,d){d=d||"";if(c.indexOf("promo:")<0){c="box-id:"+c}var g=[{name:"Item_List",value:b.replace(/__SLASH__/g,"/")},{name:"qty",value:e},{name:"oldqty",value:$("#quantity_"+a).attr("value")},{name:"id_cart_lin",value:a},{name:"idfrom",value:c},{name:"location",value:d}];var f=e;if(a==0){g[2].value=0}if(f<=0){g[2].value=0;UC_Cart.DeleteCart(a)}else{jQuery.ajax({url:"/Ajax/InsertCart.ashx",data:g,dataType:"json",type:"POST",beforeSend:function(j,h){jQuery(".cart-total-items").html("<img src='/Image/loading.gif' style='height: 22px;margin: -4px;'>");$("#cart_block #loading").css("display","block");var i=UC_Cart.CheckMinQty(b,f,a,"");if(i==false){j.abort()}},complete:function(){$("#cart_block #loading").css("display","none");UC_Cart.ViewCart()},async:true,success:function(i){if(i.PROMPT){confirm(i.PROMPT_MSG)}else{if(i.ERROR){if(i.ERR_MSG=="UNAVAILABLE_ITEM"){alert("Item unavailable can not be added to shopping cart.")}else{alert("Error: "+i.ERR_MSG)}}else{if(i.SUCCESS!=undefined&&i.SUCCESS==false){UC_Cart.ShowAlert(i);$("#quantity_"+a).val($("#quantity_"+a).attr("value"))}else{for(var h=0;h<i.length;h++){$("#quantity_"+i[h].id_cart_lin).attr("value",i[h].quantity);$("#quantity_"+i[h].id_cart_lin).val(i[h].quantity);if(i[h].is_login_required=="true"&&i[h].is_visitor_singleprice_enabled==false){$("#product_price_"+i[h].id_cart_lin).text("Upon Login");$("#total_product_price_"+i[h].id_cart_lin).text("Upon Login")}else{$("#product_price_"+i[h].id_cart_lin).text(i[h].price);$("#total_product_price_"+i[h].id_cart_lin).text(i[h].total_price)}}UC_Cart.AddedItemNotification(b,i.item_name||b);UC_Cart.ApplyDiscount();if(!(typeof quote==="undefined")){quote.syncCart()}}}}}})}},ShowAlert:function(a){if(a.MESSAGE=="MAX_QTY_EXCEEDED"){alert("You have reached maximum qty allowed. The campaign code only allowed to order max qty of "+a.max_qty+". If you want to order more, please make another order. Action cancelled");if(a.item_no){alert("Please check Qty of Item no. "+a.item_no)}}else{if(a.MESSAGE=="MIN_QTY_REQUIRED"){alert("The campaign code has minimum qty of "+a.min_qty+". Action cancelled");if(a.item_no){alert("Please check Qty of Item no. "+a.item_no)}}else{if(a.MESSAGE=="AVAILABLE_QTY_NOT_ENOUGH"){if(a.available_qty){alert("Sorry. Only "+a.available_qty+" stock left. Action cancelled")}else{alert("Sorry. Stock on hand is not enough")}}else{alert(a.MESSAGE+". Action cancelled")}}}},UpdateCart:function(b,e,f,d,a,g){f=f||"0";d=d||"";a=a||"add_to_current";g=g||"";if(f.indexOf("promo:")<0&&f.indexOf("(BUNDLE)")<0){f="box-id:"+f}var h=[{name:"Item_List",value:e.replace(/__SLASH__/g,"/")},{name:"qty",value:b},{name:"idfrom",value:f},{name:"action",value:a},{name:"location",value:g}];if(d!=undefined||d!=null){if(d!=""){h.push({name:"oldqty",value:$("#quantity_"+d).attr("value")})}else{h.push({name:"oldqty",value:"0"})}}var c="";jQuery.ajax({url:"/Ajax/InsertCart.ashx",data:h,dataType:"json",type:"POST",beforeSend:function(j){jQuery(".cart-total-items").html("<img src='/Image/loading.gif' style='height: 22px;margin: -4px;'>");$("#cart_block #loading").css("display","block");var i=UC_Cart.CheckMinQty(e,b,"",f);if(i==false){j.abort()}else{$("#cart_block_shipping_cost").text("computing...");$("#cart_block_total").text("computing...")}},complete:function(){$("#cart_block #loading").css("display","none");UC_Cart.ViewCart()},async:true,success:function(j){if(j.PROMPT){confirm(j.PROMPT_MSG)}else{if(j.ERROR){if(j.ERR_MSG=="UNAVAILABLE_ITEM"){alert("Item unavailable can not be added to shopping cart.")}else{alert("Error: "+j.ERR_MSG)}}else{if(j.SUCCESS!=undefined&&j.SUCCESS==false){UC_Cart.ShowAlert(j)}else{for(var i=0;i<j.length;i++){if(j[i].quantity<=0){c=j[i].id_cart_lin}$("#quantity"+j[i].id_cart_lin).text(j[i].quantity);$("#quantity_"+j[i].id_cart_lin).val(j[i].quantity);if(j[i].is_login_required=="true"&&j[i].is_visitor_singleprice_enabled==false){$("#product_price_"+j[i].id_cart_lin).text("Upon Login");$("#total_product_price_"+j[i].id_cart_lin).text("Upon Login")}else{$("#product_price_"+j[i].id_cart_lin).text(j[i].price);$("#total_product_price_"+j[i].id_cart_lin).text(j[i].total_price)}}if(a=="add"){UC_Cart.AddedItemNotification(e,j.item_name||e);ga4.Items(e,d,"cartlist","add_to_cart")}UC_Cart.ApplyDiscount();if(!(typeof quote==="undefined")){quote.syncCart()}if(c!=""){UC_Cart.DeleteCart(c)}}}}}})},UpdateReload:function(a,c){var b=[{name:"ReloadCode",value:a},{name:"Response",value:c}];jQuery.ajax({url:"/Ajax/UpdateReload.ashx",data:b,type:"POST",async:true,complete:function(){},success:function(){UC_Cart.ViewCart()}})},ConfirmDialog:function(a){$("#dialog-confirm").dialog({resizable:false,title:"Cart Reload",height:160,modal:true,buttons:{Yes:function(){UC_Cart.UpdateReload(a,"Yes");xTrigger=1;$(this).dialog("close")},No:function(){UC_Cart.UpdateReload(a,"No");xTrigger=1;$(this).dialog("close")}},close:function(){if(xTrigger!=1){UC_Cart.UpdateReload(a,"No");xTrigger=1}}})},CheckReload:function(){Hook.Add({ajaxName:"ViewCart",caller:"UC_Cart.CheckReload",beforeSend:function(){if(window.loaded){jQuery.ajax({url:"/Ajax/CheckLog.ashx",dataType:"json",type:"POST",async:true,success:function(a){if(a!=""){UC_Cart.ConfirmDialog(a)}}})}}})},FormatSavedCart:function(d){if(!d.SUCCESS){return}for(var c=0;c<d.CART.xlist_cartlin.length;c++){if(!d.CART.xlist_cartlin[c].is_logged_in&&d.CART.xlist_cartlin[c].is_login_required==true){var a;var b=d.CART.xlist_cartlin[c].prices.length;a=Global.pricesMask(b);for(var e=0;e<b;e++){d.CART.xlist_cartlin[c].prices[e].Value='<a href="/Authentication/">'+a[e]+"</a>"}d.CART.xlist_cartlin[c].total_price="Login to view price"}d.CART.xlist_cartlin[c].bundle=(d.CART.xlist_cartlin[c].item_ref.indexOf("(BUNDLE)")>=0)}},GetPrice:function(b,c,a){jQuery.ajax({url:"/Handler/GenericMethodCall.ashx?method_name=get-price&item="+b+"&qty="+c,dataType:"json",method:"POST",beforeSend:function(){},success:function(d){if(typeof a==="function"){a(d)}}})},LoadPreviousCart:function(c,b,e){c=(c==undefined?"#previous-cart":c);b=(b==undefined?"":("&cart="+b));var d=typeof e==="function";var a=$(c);jQuery.ajax({url:"/Handler/GenericMethodCall.ashx?method_name=load-cart"+b,type:"GET",success:function(f){a.empty();if(f.SUCCESS&&f.MESSAGE=="CART_LOADED"){if(f.CART.xlist_cartlin.length>0){Global.LoadTemplate("#cart-manager-template",function(h){UC_Cart.FormatSavedCart(f);var g=Mustache.to_html(h,f.CART);jQuery("#quick-cart-view .modal-title").html("Cart Manager");if(!jQuery("#quick-cart-view .modal-dialog").hasClass("modal-lg")){jQuery("#quick-cart-view .modal-dialog").addClass("modal-lg")}a.empty().append(g);$("span.subitems").click(function(){Product.LoadSubItem($(this).attr("data-item"),$(this))});jQuery(".previous-cart .txtQty").each(function(i,j){ProductView.PriceHighlighterFunc(j,"tr.product-row")});ProductView.PriceHighlighter(jQuery("table.previous-cart").find(".txtQty"),"tr.product-row",function(j){var i=jQuery(j);var k=i.attr("name").replace("quantity_","");var l=i.val();jQuery("#subtotal_"+i.attr("id").replace("quantity_","")).html("loading");UC_Cart.GetPrice(k,l,function(m){if(m.SUCCESS&&m.TOTAL_PRICE){jQuery("#subtotal_"+i.attr("id").replace("quantity_","")).html("AU $"+m.TOTAL_PRICE)}})});if(d){e()}})}else{a.html('<p class="alert alert-warning">Cart is empty</p>')}}else{a.html('<p class="alert alert-warning">'+f.MESSAGE+"</p>")}}})},InitializeCartSummary:function(){jQuery("#btn_addcart").on("click",function(){if(jQuery("#txt_itemnonew").val()==""){alert("Please enter atleast one (1) item number.")}var b=jQuery("#txt_itemnonew").val().split(/[\s\r\n;,]/);UC_Cart.InsertCartList(b)});jQuery("#btn_addcart_mobile").on("click",function(){if(jQuery("#txt_itemnonew").val()==""){alert("Please enter atleast one (1) item number.")}var b=jQuery("#txt_itemnonew_mobile").val().split(/[\s\r\n;,]/);UC_Cart.InsertCartList(b)});$("#btnApplyCampCode").on("click",function(){var b=jQuery("input[name=camp_code]").val();jQuery("tr.camp_code div.alert").remove();if(b==""){$("<div class='alert alert-warning' role='alert'>Campaign / promo code is required</div>").insertAfter("#btnApplyCampCode")}else{jQuery.ajax({url:"/WebServices/Cart.asmx/ApplyPromoCode",type:"POST",dataType:"json",data:[{name:"promocode",value:b}],success:function(c){if(c.errors.length>0){jQuery(c.errors).each(function(){$("<div class='alert alert-danger' role='alert'>"+this+"</div>").insertAfter("#btnApplyCampCode")})}else{_klaviyo.campaign(b);ga4.ApplyPromo(b,function(){Hook.Execute("ViewCart");location.reload()})}},error:function(){$("<div class='alert alert-danger'>Failed to apply the promo code, please try again later.</div>").insertAfter("#btnApplyCampCode")}})}});if(jQuery("#btn_importcart").length>0){var a=new ss.SimpleUpload({button:"btn_importcart",url:"/handler/GenericMethodCall.ashx?method_name=file-upload-cart&clear=1",name:"file",allowedExtensions:["XLSX"],maxSize:1024,responseType:"application/json",onExtError:function(c,b){alert("Invalid file type it should be XLSX.")},onSizeError:function(b,c){alert("File size should be less than 1MB")},onError:function(b,h,f,g,c,i,e){if(c!=undefined&&c!=""){var d=jQuery.parseJSON(c);if(d.message){alert(d.message)}else{alert("Upload failed")}}},onComplete:function(b,d){UC_Cart.ViewCart(true);if(d!=undefined&&d!=""){var e=jQuery.parseJSON(d);var c=e.message||"";if(e.total_failed>0){alert(e.total_failed.toString()+" items failed to be inserted.")}if(e.message){alert(e.message)}}}})}jQuery("#btn_formatcart").fancybox()},InsertCartList:function(e,g,a,b){var f={total:e.length};var c=0;for(var d=0;d<e.length;d++){if(typeof e[d]==="string"&&jQuery.trim(e[d])!=""){f["item_no_"+d.toString()]=e[d];f["qty_"+d.toString()]=1;c++}else{if(typeof e[d]==="object"&&typeof e[d].item_no!="undefined"&&typeof e[d].qty!="undefined"){f["item_no_"+d.toString()]=e[d].item_no;f["qty_"+d.toString()]=e[d].qty;c++}else{if(typeof e[d]==="object"&&typeof e[d].item_no!="undefined"){f["item_no_"+d.toString()]=e[d].item_no;f["qty_"+d.toString()]=1;c++}}}}if(c>0){f.total=c;jQuery.ajax({url:"/WebServices/Cart.asmx/BatchInsert",type:"GET",data:f,contentType:"application/json; charset=utf-8",dataType:"json",success:function(i){if(i!=undefined&&i!=""){var j=jQuery.parseJSON(i.d);console.log(j);var h=j.message||"";if(typeof g==="function"){g(j)}else{if(j.total_failed>0){alert(j.total_failed.toString()+" items failed to be inserted.")}if(j.restricted_items!=undefined&&j.restricted_items!=""){alert(j.restricted_msg+"\n"+j.restricted_items)}}}if(typeof g!=="function"){jQuery("#txt_itemnonew").val("");jQuery("#txt_itemnonew_mobile").val("");UC_Cart.ViewCart(true)}},beforeSend:function(){if(typeof a==="function"){a()}},complete:function(){if(typeof b==="function"){b()}},error:function(h){FlashMessage.ShowMessage("Error inserting items. Please contact developer.","danger",5000)}})}},AskForEmail:function(){$("#modal-email-form .modal-body").empty();$("#modal-email-form #myModalLabel").html("Enter email to save Cart");$("#modal-email-form .modal-body").html('<div class="form-group"><p class="alert alert-danger error" style="display:none;"></p><label for="control-label">Email Address</label><input type="text" id="txtEmail" class="form-control"></div>');$("#modal-email-form .modal-footer #btnFunction").html("Save").show().click(function(){var a=$("#modal-email-form .modal-body #txtEmail").val();if(a==""){$("#modal-email-form .modal-body .error").show().html("Email address is required")}else{var b=[{name:"email",value:a},{name:"action",value:"VALIDATE_EMAIL"},{name:"method_name",value:"save-cart"}];jQuery("#txtsend").val("");jQuery.ajax({url:"/Handler/GenericMethodCall.ashx",data:b,dataType:"json",type:"POST",async:false,success:function(c){if(c.SUCCESS){UC_Cart.SaveCart()}else{if(c.MESSAGE){$("#modal-email-form .modal-body .error").show().html(c.MESSAGE)}else{$("#modal-email-form .modal-body .error").show().html("Please enter valid email address")}}}})}})},InsertHistoryItemsToCart:function(g,a){var b=jQuery(g).parent().find("[name=itemno]").val();var f=jQuery(g).parent().find("[name=quantity]");var d=f.val();var c=jQuery(g).parent().find("[name=minqty]").val();if(c>0&&(c>d)){alert("item '"+b+"', qty should be greater than "+c+" minimum");f.removeClass("alert-success");f.addClass("alert-danger")}else{UC_Cart.UpdateCart(d,b);f.removeClass("alert-alert");f.addClass("alert-success")}},DeleteCart:function(a,c){var b=[{name:"LinCartID",value:a},{name:"ItemNo",value:c}];jQuery.ajax({url:"/Ajax/DeleteCart.ashx",data:b,type:"POST",beforeSend:function(){jQuery(".cart-total-items").html("<img src='/Image/loading.gif' style='height: 22px;margin: -4px;'>");$("#cart_block #loading").css("display","block");ga4.Items("",a,"cartlist","remove_from_cart")},complete:function(){$("#cart_block #loading").css("display","none")},async:true,success:function(){if(Global.bootStrapWebsite){UC_Cart.ViewCart(true);UC_Cart.ApplyDiscount();if(c!=""){_klaviyo.deletedItem(c)}if(!(typeof quote==="undefined")){quote.syncCart()}}else{$("#cart_block_product_"+a).remove();$("#cart_block_combination_"+a).remove();$("#product_"+a).remove();if(!$("#unavailable").length){$("#ShowUnavailableLegend").css("display","none")}if(($("#CartProducts").length>0&&$("#CartProducts").text()=="")||$("#ProductItems").text()==""){UC_Cart.CheckCart();if($("[id$=btn_next]").length||$("[id$=btn_previous]").length){window.location.replace("/View/Order.aspx")}}}}})},CheckMinQty:function(d,e,c,a){var b=[{name:"item_no",value:d},{name:"qty",value:e},{name:"oldqty",value:$("#quantity"+c).text()},{name:"idcartlin",value:c},{name:"boxid",value:a}];var f=false;jQuery.ajax({url:"/Ajax/VerifyMinQty.ashx",data:b,dataType:"json",type:"POST",async:false,success:function(g){if(g.no_min_qty){f=true}else{if(g.success){f=true}else{alert(g.error);$("#quantity_"+c).val(b[2].value);f=false}}}});return f},flyToElement:function(c,e,a){if(jQuery(c).length==0||jQuery(e).length==0){return}var h=jQuery(this);var b=3;var d=jQuery(c).clone();jQuery(d).css("visibility","visible");jQuery(d).css({position:"absolute",top:jQuery(c).offset().top+"px",left:jQuery(c).offset().left+"px",opacity:1,"z-index":1000});jQuery("body").append(jQuery(d));var f=jQuery(e).offset().left+(jQuery(e).width()/2)-(jQuery(c).width()/b)/2;var g=jQuery(e).offset().top+(jQuery(e).height()/2)-(jQuery(c).height()/b)/2;jQuery(d).animate({opacity:0.4,left:f,top:g,width:jQuery(c).width()/b,height:jQuery(c).height()/b},1000,function(){jQuery(e).fadeOut("fast",function(){jQuery(e).fadeIn("fast",function(){jQuery(d).fadeOut("fast",function(){jQuery(d).remove();if(a!=null){a.apply(h)}})})})})},CartVisibleToggle:function(a,d,c,b){$(a).click(function(f){f.preventDefault();$(d).slideToggle();if($(this).text()==c){$(this).text(b)}else{$(this).text(c)}})},pauseRefresh:false,ViewCart:function(a){UC_Cart.SummaryCart();Hook.Add({execute:a&&!UC_Cart.pauseRefresh,ajaxName:"ViewCart",caller:"UC_Cart.ViewCart",beforeSend:function(){if(Global.bootStrapWebsite){var b=$("#cart-container ul.cart-content");b.find("li").remove();b.append('<li class="msg-cart-empty">loading</li>');jQuery(".cart-total-items").html("<img src='/Image/loading.gif' style='height: 22px;margin: -4px;'>");$(".cart-amount-info.autohide").hide();jQuery(".cart-total-qty").text("Loading...");jQuery(".cart-total-amt").text("Loading...");jQuery(".cart-total-items-detailed").text("Loading...");jQuery(".cart-total-qty-mini").text("...")}else{$("#cart_block_no_products").css("display","none");$("#cart_block #loading").css("display","block")}},complete:function(){$("#cart_block #loading").css("display","none");Hook.Execute("GetCartTotal")},success:function(b){UC_Cart.BuildCartHtmlBS(b);$("a.gift-item").unbind("click.ReplaceGift").bind("click.ReplaceGift",function(){UC_Cart.GetGiftItemList()});if(b.length==0){$("button.btn-make-quote").hide()}else{$("button.btn-make-quote").show()}if(!Global.settings.termsAccount){$("#mini-upload-po").remove()}}})},UploadPO:function(){if($("#btnUploadPO").length==0){return}var a=new ss.SimpleUpload({button:"btnUploadPO",url:"/handler/GenericMethodCall.ashx?method_name=file-upload-po",name:"file",allowedExtensions:["XLS","XLSX","DOC","DOCX","PDF","JPG","JPEG","PNG"],maxSize:1024,responseType:"application/json",onExtError:function(c,b){$("ul.error-list").empty().append('<li class="alert alert-danger">Invalid file type. '+b+" is not supported</li>")},onSizeError:function(b,c){$("ul.error-list").empty().append('<li class="alert alert-danger">File size should be less than 1MB</li>')},onError:function(b,h,f,g,c,i,e){if(c!=undefined&&c!=""){var d=jQuery.parseJSON(c);if(d.message){$("ul.error-list").empty().append('<li class="alert alert-danger">'+d.message+"</li>")}else{$("ul.error-list").empty().append('<li class="alert alert-danger">Upload failed. Please try again</li>')}}},onComplete:function(b,c){if(c!=undefined&&c!=""){var d=jQuery.parseJSON(c);if(d.message=="file_saved"){$("ul.error-list").empty().append('<li class="alert alert-success">PO successfully attached</li>');$("#btnUploadPO").hide()}else{if(d.message=="no_selected_industry"){$("ul.error-list").empty().append('<li class="alert alert-danger">No industry selected. Please <a href="#" class="btn btn-warning" onclick="Account.ShowAffinity(event)">Set Your Industry</a></li>')}else{$("ul.error-list").empty().append('<li class="alert alert-danger">'+d.message+"</li>")}}}}})},ShowUploadPOForm:function(a){a.preventDefault();Global.LoadGenericModal("body","upload-po-form",function(){$("#cart-container").hide();var b={};b.fn={email:"txtEmail",phone:"txtPhone",note:"txtNote"};jQuery.ajax({url:"/Ajax/GetPersonalInformation.ashx",dataType:"json",type:"POST",success:function(c){if(c.email!=undefined){b.email=c.email;b.phone=c.main_phone;b.note="";$("#upload-po-form .modal-title").html("Upload PO Form");Global.LoadTemplate("#uc_cart-upload-po-form",function(d){$("#upload-po-form .modal-body").empty().append(Mustache.to_html(d,b))});if(c.affinity=="blank"){$("#upload-form-container").prepend('<p><a href="#" class="btn btn-warning" onclick="Account.ShowAffinity(event)">Set Your Industry First</a></p>')}UC_Cart.UploadPO();$("#btnFunction").html("Submit PO").show().unbind("click.UploadPO").bind("click.UploadPO",function(){$.ajax({url:"/handler/GenericMethodCall.ashx",data:[{name:"email",value:$("[id$="+b.fn.email+"]").val()},{name:"phone",value:$("[id$="+b.fn.phone+"]").val()},{name:"note",value:$("[id$="+b.fn.note+"]").val()},{name:"method_name",value:"submit-po"}],dataType:"json",type:"POST",beforeSend:function(){$("#upload-form-container").hide();Global.ShowLoadingUI("Processing. Please wait...","#upload-po-form .modal-body","prepend")},success:function(e){$("div.loading-container").remove();if(e.SUCCESS){$("ul.error-list").empty().append('<li class="alert alert-success">PO submitted to Order Entry Team. Thank You</li>');$("#btnFunction").hide()}else{if(e.ERRORS){var d="";$.each(e.ERRORS,function(f,g){d+='<li class="alert alert-danger">'+g+"</li>"});$("ul.error-list").empty().append(d)}else{$("ul.error-list").empty().append('<li class="alert alert-danger">'+e.MESSAGE+"</li>")}$("#upload-form-container").show()}},error:function(){$("#upload-form-container").show()}})});$("#upload-po-form").modal("show")}else{alert("Please log-in first.")}}})})},SaveCart:function(){Global.LoadGenericModal("body","modal-email-form",function(){jQuery.ajax({url:"/Handler/GenericMethodCall.ashx?method_name=save-cart",dataType:"json",method:"GET",beforeSend:function(){$("#modal-email-form #myModalLabel").html("Saving Cart");$("#modal-email-form .modal-body").empty().append("<p>Loading please wait...<p>");$("#modal-email-form").modal("show")},success:function(a){if(a.SUCCESS&&a.MESSAGE=="CART_SAVED"){$("#modal-email-form #myModalLabel").html("Cart Saved");$("#modal-email-form .modal-body").empty().append("<p>We have sent you an email to retrieve your Cart at "+a.EMAIL+"<p>");$("#modal-email-form .modal-footer #btnFunction").hide();$("#modal-email-form").modal("show")}else{if(a.SUCCESS==false&&a.MESSAGE=="NO_EMAIL"){UC_Cart.AskForEmail()}else{$("#modal-email-form #myModalLabel").html(a.MESSAGE);$("#modal-email-form .modal-body").empty().append(a.ERROR_MESSAGE);$("#modal-email-form").modal("show")}}}})})},InsertCartVariant:function(b,f,e){var a=$("#"+b);var c=a.find("div a div").attr("id");var d=a.find("select.item-variant").val();var g=a.find("input.txtQty").val();UC_Cart.InsertCart(c,d,g,f,e)},InsertCartNew:function(b,f,a,e,c){var d=[];d.push({name:"type",value:f});d.push({name:"code",value:a});d.push({name:"qty",value:e});d.push({name:"location",value:c});jQuery.ajax({url:"/WebServices/Cart.asmx/Insert",type:"GET",data:d,success:function(g){if(typeof successCallback!=="function"){jQuery("#txt_itemnonew").val("");UC_Cart.ViewCart(true)}},error:function(g){FlashMessage.ShowMessage("Error inserting items. Please contact developer.","danger",5000)}})},InsertCart:function(a,b,e,g,d){var c="ItemList";if(event!=undefined&&event.target!=undefined){c=$(event.target).attr("data-listfrom")}var f="";d=d||"";if(typeof b==="object"){g=$(b).attr("data-promo");if($(b).attr("data-location")!=undefined){d=$(b).attr("data-location")}b=$(b).val()}if(e==""){e=1}if(isNaN(parseFloat(e))){alert('Invalid quantity "'+e+'"');return}if(g!=undefined){f=g}if(f==""){f="0"}else{if(f!="(BUNDLE)"){if(f.indexOf("promo:")<0){f="box-id:"+f}}}jQuery("#cart_block").css("display","block");if(Global.bootStrapWebsite){UC_Cart.flyToElement("#"+a,".cart-button")}else{if(jQuery("#cart_block").length==0){UC_Cart.flyToElement("#"+a,"#header_cart")}else{UC_Cart.flyToElement("#"+a,"#cart_block")}}var h=[{name:"Item_List",value:b.replace(/__SLASH__/g,"/")},{name:"qty",value:e},{name:"idfrom",value:f},{name:"location",value:d}];jQuery.ajax({url:"/Ajax/InsertCart.ashx",data:h,dataType:"json",type:"POST",beforeSend:function(){jQuery(".cart-total-items").html("<img src='/Image/loading.gif' style='height: 22px;margin: -4px;'>");if(Global.bootStrapWebsite){$(".cart-amount-info > .shipping").text("computing...");$(".cart-amount-info > .tax").text("computing...");$(".cart-amount-info > .total").text("computing...");jQuery(".cart-total-qty-mini").text("...")}else{$("#cart_block_no_products").css("display","none");$("#cart_block #loading").css("display","block");$("#cart_block_shipping_cost").text("computing...");$("#cart_block_total").text("computing...")}},complete:function(){$("#cart_block #loading").css("display","none")},async:true,error:function(i,j,k){},success:function(n){if(n.PROMPT){if(confirm(n.PROMPT_MSG)){this.data+="&confirm=1";jQuery.ajax(this)}else{UC_Cart.ViewCart()}}else{if(n.ERROR){if(n.ERR_MSG=="UNAVAILABLE_ITEM"){alert("Item unavailable can not be added to shopping cart.")}else{alert("Error: "+n.ERR_MSG)}UC_Cart.ViewCart()}else{if(n.SUCCESS!=undefined&&n.SUCCESS==false){UC_Cart.ViewCart();UC_Cart.ShowAlert(n)}else{if(Global.bootStrapWebsite){var i=b;$.each(n,function(o,p){if(p.item_no==b){i=p.item_name}});ga4.Items(b,"",c,"add_to_cart");UC_Cart.AddedItemNotification(b,i);UC_Cart.ViewCart();UC_Cart.ApplyDiscount();if(!(typeof quote==="undefined")){quote.syncCart()}}else{if(n.length>0){var m="";for(var k=0;k<n.length;k++){if(!$("#cart_block_product_"+n[k]["id_cart_lin"]).length){if(k==0&&!$("#CartProducts").length){m="<dl id='CartProducts' class='products'>"}var l=n[k].item_name;var j=Utility.urlencode(n[k].item_no);m+="<dt id='cart_block_product_"+n[k].id_cart_lin+"' style='display: block;'>";m+="<span class='quantity-formated'><span id='quantity"+n[k].id_cart_lin+"' class='quantity'>"+n[k].quantity+"</span>x</span>";m+="<a id='"+n[k].item_no+"' href='/Product/id/"+j+"' title='"+l.substring(0,10)+"...'>"+l.substring(0,10)+"...</a>";m+="<span class='remove_link'><label style='cursor:pointer;' class='ajax_cart_block_remove_link' title='remove this product from my cart' onclick='UC_Cart.DeleteCart("+n[k].id_cart_lin+", "+xItemNo+")'>&nbsp;</label></span>";if(n[k].is_login_required=="true"){m+="<span id='prc"+n[k].id_cart_lin+"' class='price'>Upon Login</span>"}else{m+="<span id='prc"+n[k].id_cart_lin+"' class='price'>"+n[k].total_price+"</span>"}m+="</dt>";m+="<dd id='cart_block_combination_"+n[k].id_cart_lin+"'>";m+="<a href='/Product/id/"+j+"' title='Product detail'>"+n[k].item_no+"</a>";m+="</dd>";if(k==(n.length-1)&&!$("#CartProducts").length){m+="</dl>"}}else{$("#quantity"+n[k].id_cart_lin).text(n[k].quantity);if(n[k].is_login_required=="true"){$("#prc"+n[k].id_cart_lin).text("Upon Login")}else{$("#prc"+n[k].id_cart_lin).text(n[k].total_price)}}}if(!$("#CartProducts").length){$("#cart_block_list").prepend(m)}else{$("#CartProducts").prepend(m)}}else{$("#cart_block_no_products").css("display","block")}}}}}}})},SummaryCart:function(){Hook.Add({ajaxName:"ViewCart",caller:"UC_Cart.SummaryCart",beforeSend:function(){jQuery("#order-detail-content #loading").css("display","block")},success:function(a){if(jQuery("#cart_summary").length>0){$("#ProductItems").remove();Global.LoadTemplate(Global.cartBodyTemplate,function(b){$("#cart_summary").append(Mustache.to_html(b,UC_Cart.SummaryCart_RefractorData(a)));$("#cart_summary").show()})}},complete:function(){jQuery("#order-detail-content #loading").css("display","none");if(jQuery("#cart_summary tbody tr").length==0){if(jQuery("[id$=_divCartSummary] .cart-summary-button").text()=="Show Cart Summary"){jQuery("[id$=_divCartSummary] .cart-summary-button").click()}}}})},AssignFreightInfo:function(b,d,a){var c="";jQuery(b).each(function(){var e="";e+=("<th>"+this.Message+"</th>");if(this.AmountCharge<0){e+=("<td class='negative'>"+this.AmountCharge+"</td>")}else{e+=("<td>"+this.AmountCharge+"</td>")}if(this.Message=="Base Freight"){e="<thead>"+e+"</thead>"}else{e="<tbody>"+e+"</tbody>"}c+=e});if(c!=""){c="<div class='panel panel-default panel-hovertoggle' style='position:  absolute;z-index: 999;bottom: 26px;right: 0px;width: max-content;margin-bottom: unset;'><div class='panel-heading'>Freight Info</div><div class='panel-body'><table class='table table-condensed' style='margin-bottom: unset;'>"+c;+"</table></div></div>";jQuery(d).css("position","relative");if(!jQuery(d).hasClass("hovertoggle")){jQuery(d).addClass("hovertoggle")}jQuery(d).append('<i href="#" style="font-size: 12px; margin-left:5px;">(See details)</i>');jQuery(d).append(c)}},CartCharges:function(){Hook.Add({ajaxName:"GetCartTotal",caller:"UC_Cart.CartCharges",beforeSend:function(){$(".TotalTax").text("Loading");$(".total_no_tax").text("Loading");$(".GrandTotal").text("Loading");$(".totalprice").text("Loading");$(".totalfreight").text("Loading");$("[id$=uc_ordersteps_lbl_total]").text("Loading");$(".cpwarning").hide();$(".cartsavings").hide()},success:function(d){if(!d.MESSAGE){if($("input[name=camp_code").length>0&&d.CampDetails!=undefined){$("input[name=camp_code").val(d.CampDetails.CampCode)}if(d.Tax.toLowerCase()=="upon login"){if($(".cart-amount-info > span.tax").parent().css("display")=="none"){$(".cart-amount-info > span.tax").parent().css("display","block")}else{$(".cart-amount-info > span.tax").parent().css("display","none")}}$(".cart-amount-info > span.tax").text(d.Tax);if(d.Tax.toLowerCase()=="upon login"){if($(".cart-amount-info > span.shipping").parent().css("display")=="none"){$(".cart-amount-info > span.shipping").parent().css("display","block")}else{$(".cart-amount-info > span.shipping").parent().css("display","none")}}$(".cart-amount-info > span.shipping").text(d.Freight.Charge);jQuery(".cart-amount-info-sub").remove();UC_Cart.AssignFreightInfo(d.Freight.FreightHeaderList,".cart-amount-info > span.shipping",function(e){jQuery(e).addClass("cart-amount-info");jQuery(e).addClass("autohide");jQuery(e).addClass("shipping");jQuery(e).addClass("cart-amount-info-sub")});if(typeof d.Savings!="undefined"&&typeof d.Savings.product!="undefined"){$(".cartsavings").show();var a="";if(d.membership==="GOLD1Y"){$(".cartsavings").css("color","#99854D");$(".cartsavings .description").text("GOLD MEMBER SAVINGS");a="{total} ({product} + {shipping}) <a href='#' data-toggle='popover' data-trigger='hover' data-content='Total (Products & Shipping)'>?</a>"}else{if(d.membership==="SILV1Y"){$(".cartsavings").css("color","#8a8a8a");$(".cartsavings .description").text("SILVER MEMBER SAVINGS");a="{total} <a href='#' data-toggle='popover' data-trigger='hover' data-content='From Shipping Fee'>?</a>"}}$(".cartsavings .amount").html(a.replace("{total}",d.Savings.total).replace("{product}",d.Savings.productRaw).replace("{shipping}",d.Savings.shippingRaw));$('[data-toggle="popover"]').popover({placement:"top"})}if(d.Tax.toLowerCase()=="upon login"){if($(".TotalTax").parent().css("display")=="none"){$(".TotalTax").parent().css("display","block")}else{$(".TotalTax").parent().css("display","none")}}$(".TotalTax").text(d.Tax);if(d.Tax.toLowerCase()=="upon login"){if($(".total_no_tax").parent().css("display")=="none"){$(".total_no_tax").parent().css("display","block")}else{$(".total_no_tax").parent().css("display","none")}}$(".total_no_tax").text(d.UnitPrice);if(d.IsVisitorSinglePriceEnabled){d.IsLoginRequired=false}if(d.InsuranceCheck){if(!d.IsLoginRequired){$(".shipping_protection").text(d.InsuranceFee)}else{if(d.IsLoggedIn){$(".shipping_protection").text(d.InsuranceFee)}else{$(".shipping_protection").text("Upon Login")}}}else{if(!d.IsLoginRequired){$(".shipping_protection").text("AUD 0.00")}else{$(".shipping_protection").text(d.IsLoggedIn?"AUD 0.00":"Upon Login")}}if($("tr.cart_shipping_protection_details").length>0&&d.InsuranceCheck!=undefined){var b=d.InsuranceCheck;if($("tr.cart_shipping_protection_details td.large-device").is(":visible")){$($("tr.cart_shipping_protection_details td.large-device").find("div.insurance-wrapper")).find("input[type=radio][value="+b+"]").prop("checked",true)}else{$($("tr.cart_shipping_protection_details td.mobile-device").find("div.insurance-wrapper")).find("input[type=radio][value="+b+"]").prop("checked",true)}$("label.lblInsuranceFee").text("1.5%");$("tr.cart_shipping_protection_details div.insurance-wrapper").find("input[type=radio]").off("change.insurance").on("change.insurance",function(){var f=$("tr.cart_shipping_protection_details td.large-device").is(":visible")?"large":"mobile";var e=$($("tr.cart_shipping_protection_details td."+f+"-device").find("div.insurance-wrapper")).find("input[type=radio]:checked").val();$.get("/WebServices/Session.asmx/SetSessionValue?name=avail_insurance_protection&value="+e,function(){location.reload()})})}if(!d.IsLoginRequired){$(".cart-amount-info > .total").text(d.GrandTotal);$(".GrandTotal").text(d.GrandTotal)}else{if(d.IsLoggedIn){$(".cart-amount-info > .total").text(d.GrandTotal);$(".GrandTotal").text(d.GrandTotal)}else{$(".cart-amount-info > .total").text("Upon Login");$(".GrandTotal").text("Upon Login")}}$("[id$=uc_ordersteps_lbl_total]").text(d.GrandTotal);if(d.Price.toLowerCase()=="upon login"){if($(".totalprice").parent().css("display")=="none"){$(".totalprice").parent().css("display","block")}else{$(".totalprice").parent().css("display","none")}}$(".totalprice").text(d.Price);if(d.Freight.Charge.toLowerCase()=="upon login"){if($(".totalfreight").parent().css("display")=="none"){$(".totalfreight").parent().css("display","block")}else{$(".totalfreight").parent().css("display","none")}}$(".totalfreight").text(d.Freight.Charge);if(d.CampDetails&&d.CampDetails.CampCode!=undefined&&d.CampDetails.CampCode!=""){$(".cart-amount-info > span.camp-code").text(d.CampDetails.CampCode).append('<i href="#" data-toggle="popover" data-trigger="hover" data-html="true" data-placement="top" data-title="Campaign Code" data-content="<b>'+d.CampDetails.Description+"</b><br/>Expiry Date: "+d.CampDetails.EndDate+'" style="font-size: 12px; margin-left:5px;">(See details)</i>');var c=$("#cart-container div.cart-amount-info.discount span.amount").attr("data-content");if(c!=""){$(".cart-amount-info .camp-code.amount i").attr("data-content",c)}}else{$(".cart-amount-info.campaign").hide()}}else{$(".TotalTax").text("AUD 0.00");$(".total_no_tax").text("AUD 0.00");$(".GrandTotal").text("AUD 0.00");$("[id$=uc_ordersteps_lbl_total]").text("AUD 0.00");$(".totalprice").text("AUD 0.00");$(".totalfreight").text("AUD 0.00")}if(d.Freight&&d.Freight.Message){$(".cpwarning").text(d.Freight.Message).addClass("alert alert-warning").show()}$('.cart-amount-info i[data-toggle="popover"]').popover();if(d.CreditLimitStatus!=undefined){UC_Cart.ShowCreditLimit(d.CreditLimitStatus)}if($("tbody#ProductItems").find("tr:visible").length>0){if(typeof CartFunction!=="undefined"&&typeof CartFunction.initComment==="function"){CartFunction.initComment()}}}})},ApplyDiscount:function(){jQuery.ajax({url:"/Handler/GenericMethodCall.ashx?method_name=apply-discount",beforeSend:function(){},success:function(a){if(a.show){$("#cart-container div.cart-amount-info.discount span.amount").text("AUD ("+a.discount+")").attr("data-content",a.message);$("#cart-container div.cart-amount-info.discount span.description").empty().append("<a data-toggle='collapse' data-target='#breakdown-table'>Discount</a>");$("#cart-container div.cart-amount-info.discount #breakdown-table").remove();$("#cart-container div.cart-amount-info.discount").append(a.breakdown).show();var b=jQuery("tr.cart_total_discount span.price");if(b.length>0){$("tr.cart_total_discount").show();b.text("AUD ("+a.discount+")")}}}})},SummaryCart_RefractorData:function(b){var c={items:[]};for(var f=0;f<b.length;f++){var d="";var e="";if(/-B1T1$/i.test(b[f].sourcefrom)){e="(Buy 1 Get 1)"}else{if(/-BUNDLE$/i.test(b[f].sourcefrom)){e="(Bundle Item)"}else{if(/-FREE/i.test(b[f].sourcefrom)){e="(Free Item)"}else{if(/-BMGM/i.test(b[f].sourcefrom)){e="(Buy More Get More)"}else{if(/-GIFT/i.test(b[f].sourcefrom)){e='<a style="color: red; padding: 3px 7px; background-color:red;color:#fff;border-radius:3px;" class="gift-item" href="#">Gift</a>'}}}}}if(/^\(WEBCC\)/.test(b[f].item_ref)){d=b[f].item_ref.replace("(WEBCC) ","promo:")}else{d=b[f].id_webonlyspecialsbox}var a=!(parseInt(b[f].actual_qoh)==0&&parseInt(Global.settings.NoStockDeliveryLeadTime)>0);c.items.push({id_cart_lin:b[f].id_cart_lin,allow_modify:b[f].allow_modify&&b[f].singlepurchase_groupname=="",allow_delete:true,item_no:b[f].item_no,protocol:location.protocol,item_name:b[f].item_name,webonlyspecials:b[f].id_webonlyspecialsbox!="",chemical:b[f].chemical,itemref:b[f].item_ref,itemref_formatted:d,prodavailable:b[f].qty_on_hand>b[f].stock_minavailable,loginrequired:(b[f].is_login_required=="true"&&b[f].is_visitor_singleprice_enabled==false),price:b[f].price,quantity:b[f].quantity,total_price:b[f].total_price,webonlyspecials_carticon:b[f].webonlyspecials_carticon,showwosCartIcon:b[f].webonlyspecials_carticon!=""&&b[f].id_webonlyspecialsbox!="",promo:e,location:b[f].location,available:a,deliveryleadtime:Global.settings.NoStockDeliveryLeadTime,actualquantity:b[f].actual_qoh,prodpartavailble:(parseInt(b[f].actual_qoh)<parseInt(b[f].quantity))&&!(parseInt(b[f].actual_qoh)==0)})}return c},BuildCartHtmlBS:function(s){var g=$("#cart-container ul.cart-content");var o=0;g.find("li").remove();if($("#mini-cart-checkout").length<=0){if($("#tagAccountInfo").attr("integrationoptions")=="cXML"){$("#cart-container").append('<a href="/Order" class="btn btn-success track" data-category="Cart" data-label="Checkout" id="mini-cart-checkout" style="display: inline-block;">Check Out</a>')}else{if(Global.cat_id==2169040||Global.cat_id==2169018){$("#cart-container").append('<a href="/Order" class="btn btn-success track" data-category="Cart" data-label="Checkout" id="mini-cart-checkout" style="display: inline-block;">Check Out</a>')}else{if(Global.settings.loggedType=="customer"){$("#cart-container").append('<a href="'+Global.CheckoutURL+'" class="btn btn-success track" data-category="Cart" data-label="Checkout" id="mini-cart-checkout" style="display: inline-block;">Check Out</a>')}else{$("#cart-container").append('<a href="/OneCheckout/" class="btn btn-success track" data-category="Cart" data-label="Checkout" id="mini-cart-checkout" style="display: inline-block;">Check Out</a>')}}}if(typeof $("#cart-container").livAjaxPage=="function"){$("#cart-container").livAjaxPage(null,1)}$("#mini-cart-checkout").click(function(u){$("#cart-container").slideUp()})}if($("#mini-edit-cart").length<=0){$("#cart-container").append('<a href="/ViewBS/EditCart.aspx" class="btn btn-warning track" data-category="Cart" data-label="Edit cart" id="mini-edit-cart" style="display: inline-block;">Edit Cart</a>')}if($("#mini-upload-po").length<=0&&Global.settings.cartType=="normal"&&Global.settings.loggedType=="customer"){if(Global.settings.termsAccount){$("#cart-container").append('<a href="#" onclick="UC_Cart.ShowUploadPOForm(event)" class="btn btn-default track" data-category="Cart" data-label="Upload PO" id="mini-upload-po" style="display: inline-block; float:right">Upload PO</a>');$("#mini-upload-po").attr("data-toggle","popover").attr("data-trigger","hover").attr("data-html","true").attr("data-title","Upload PO").attr("data-content","<b>Send us your order form</b> in PDF, Word, Excel, or any other familiar format, then sit back and <b>relax as we process your order</b>!")}if($("button.btn-make-quote").length==0){$("#cart-container h3").append('<button class="btn btn-success btn-sm btn-make-quote track" data-category="Cart" data-label="Create quote" style="float:right">Create Quote</button>');if(Global.settings.quoteCreated){$("button.btn-make-quote").html("Update Quote")}$("button.btn-make-quote").off("click.MakeQuote").on("click.MakeQuote",function(){if(!(typeof quote==="undefined")){quote.setupUI()}})}}if($("#mini-save-cart").length<=0){$("#cart-container").append('<a href="#" class="btn btn-default track" data-category="Cart" data-label="Save cart" id="mini-save-cart" style="display: inline-block; float:right">Save Cart</a>');$("#mini-save-cart").click(function(u){u.preventDefault();$("#cart-container").slideUp();UC_Cart.SaveCart()})}if(s.length>0){var r="";var t=0;var h=false;var i=false;var a=false;for(var p=0;p<s.length;p++){a=false;if(p==0){r="<dl id='CartProducts' class='products'>"}var k=s[p]["qty_on_hand"]<=s[p].stock_minavailable;var n="";if(/-B1T1$/i.test(s[p].sourcefrom)){n='<b style="color: red"> (Buy 1 Get 1)</b>'}else{if(/-BUNDLE$/i.test(s[p].sourcefrom)){n='<b style="color: red"> (Bundle Item)</b>';a=true}else{if(/-FREE$/i.test(s[p].sourcefrom)){n='<b style="color: red"> (Free Item)</b>'}else{if(/-GIFT$/i.test(s[p].sourcefrom)){n=' <a style="color:red;padding:1px 5px;background-color:red;color:#fff;border-radius:3px;" class="gift-item" href="#">Gift</a>'}else{n="";a=true}}}}if(k){t+=1}var q=s[p].item_name;var j="";if(s[p].item_ref=="(BUNDLE)"){j="UC_Cart.DeleteCart("+s[p].id_cart_lin+", '"+s[p].sourcefrom+"')"}else{j="UC_Cart.DeleteCart("+s[p].id_cart_lin+", '"+s[p].item_no+"')"}var l=Utility.urlencode(s[p].item_no);var m="";m+='<li id="orderLine_'+s[p].id_cart_lin+'">';m+='<span class="price">'+((s[p].is_login_required=="true"&&s[p].is_visitor_singleprice_enabled==false)?"Upon Login":s[p].total_price)+"</span>";if(s[p].item_ref.indexOf("(BUNDLE)")>=0){m+='<img src="'+location.protocol+"//file.livingstone.com.au/images/bundle/90x90/"+l+'.png" alt="'+q+'" />';m+='<span class="item-name"><a href="/Bundle/">'+q+"</a></span>"}else{m+='<img src="'+location.protocol+"//file.livingstone.com.au/images/product/90x90/"+l+'.png" alt="'+q+'" />';m+='<span class="item-name"><a href="/Product/id/'+l+'">'+q+"</a></span>"}if(s[p].item_ref.indexOf("(BUNDLE)")>=0){m+='<span class="item-no">Bundle Code: '+s[p].item_no+(s[p].chemical==true?" **":"")+n+"</span>"}else{m+='<span class="item-no">Item no: '+s[p].item_no+(s[p].chemical==true?" **":"")+n+"</span>"}m+='<span class="qty">Quantity: '+s[p].quantity+(k?" below stock":"")+"</span>";if(s[p].chemical==true&&h==false){h=true}if(s[p].dangerous==true&&i==false){i=true}if(a){m+='<a class="remove-item" href="#" title="remove this item from my shopping cart" onclick="'+j+'"></a>'}if(s[p].item_ref.indexOf("(BUNDLE)")>=0){var b="";b+='<div class="cart-breakdown">';b+="<h3>Bundle Breakdown</h3>";b+="<ul>";var e=4;var d=0;for(var c in s[p].breakdown){if(d+1>e){break}b+='<li title="'+s[p].breakdown[c]+'">'+s[p].breakdown[c]+"</li>";d++}var f="";if(d+1>e){f="+"+(s[p].breakdown.length-d)+" More Items"}b+='<li class="more-items">'+f+"</li>";b+="</ul></div>";m+=b}m+="</li>";o+=s[p].quantity;g.append(m)}if(typeof Global.cartExtraNote=="function"){Global.cartExtraNote(h,i)}jQuery(".cart-total-items").text(o);if(o==1){jQuery(".cart-total-items-detailed").text("1 item")}else{jQuery(".cart-total-items-detailed").text(o+" items")}if(o>99){jQuery(".cart-total-qty-mini").text("99+")}else{jQuery(".cart-total-qty-mini").text(o)}jQuery(".cart-total-qty-mini").show();$(".cart-amount-info").show();$("#cart-container div.cart-amount-info.discount").hide();$("a#mini-cart-checkout").show();$("a#mini-save-cart").show();$("a#mini-cart-checkout").text("Check Out")}else{g.append('<li class="msg-empty-cart">your shopping cart is empty</li>');$(".cart-amount-info.autohide").hide();$("a#mini-cart-checkout").attr("data-toggle","popover").attr("data-trigger","hover").attr("data-html","true").attr("data-title","Quick Order").attr("data-label","quick order").attr("data-content","<b>Know "+Global.storeName+" item numbers?</b> Got a list of item numbers to order? Just click the quick order.").attr("href","/ViewBS/EditCart.aspx").text("Quick Order");$("a#mini-save-cart").hide();$(".cart-total-items").html("0");$(".cart-total-items-detailed").html("Empty");jQuery(".cart-total-qty-mini").hide()}$("[data-toggle=popover]").popover({placement:"bottom"})},AddedItemNotification:function(c,b){c=Mustache.Formatters.removeSpecialChar(c);$("div.notification-box").fadeOut(500).remove();var a=Global.CheckoutURL;if(Global.settings.cartType=="punchout"){a="/Order"}var e={item_no:c,item_name:b,checkoutlink:a};Global.LoadTemplate("#UCCartAddedItemNotification",function(f){$("body").prepend(Mustache.to_html(f,e));if(UC_Cart.OverCreditLimit){$("div.notification-container div.notification-box a.btn-success").addClass("disabled")}});var d=setTimeout(function(){$("body").unbind("click.cartNotification");$("div.notification-box").fadeOut(500).remove()},3000);$("body").unbind("click.cartNotification").bind("click.cartNotification",function(){clearTimeout(d);$("body").unbind("click.cartNotification");$("div.notification-box").fadeOut(500).remove()});$("div.notification-box").mouseenter(function(){clearTimeout(d)}).mouseleave(function(){d=setTimeout(function(){$("body").unbind("click.cartNotification");$("div.notification-box").fadeOut(500).remove()},3000)})},GetGiftItemList:function(){$.ajax({url:"/WebServices/Cart.asmx/GetGiftItemList",type:"GET",dataType:"json",success:function(a){if(a.ITEMS!=undefined&&a.ITEMS.length>0){Global.LoadGenericModal("body","gift-item-list",function(){Global.LoadTemplate("#GiftItemList",function(d){var c=Mustache.to_html(d,a);var b=$("#gift-item-list");b.find("h4.modal-title").html("Replace Gift Item");b.find("#generic-container").html(c);b.find("#btnFunction").html("Replace Gift").unbind("click.ReplaceGift").bind("click.ReplaceGift",function(){var e=$("input[name=gift]:checked").val();$.ajax({url:"/WebServices/Cart.asmx/ReplaceGiftItem?item_no="+e,type:"GET",dataType:"json",beforeSend:function(){b.find("#generic-container").find("p.alert").remove();b.find("#generic-container").hide();b.find("#btnFunction").html("Processing...").prop("disabled",true)},success:function(g){b.find("#btnFunction").html("Replace Gift").prop("disabled",false);b.find("#generic-container").show();if(g.SUCCESS){var f=Mustache.to_html(d,g);b.find("#generic-container").html(f);UC_Cart.ViewCart()}else{b.find("#generic-container").prepend('<p class="alert alert-danger">'+g.MESSAGE+"</p>")}}})}).show();$("#cart-container").slideUp();$("#gift-item-list").modal("show")})})}else{if(a.SUCCESS==false){alert(a.MESSAGE)}}}})},ShowCreditLimit:function(a){if($("div.credit-limit-container").length==0){$("#cart-container").append('<div class="credit-limit-container"></div>')}$("div.credit-limit-container").empty().append("<table><tr><td>Credit Limit: <b>$"+a.credit_limit.toFixed(2)+"</b></td><td>Current Total: <b>$"+a.current_cart_total.toFixed(2)+"</b></td><td>Previous Orders: <b>$"+a.previous_orders.toFixed(2)+"</b></td></tr></table>");$("p.over-credit-limit").remove();if(a.status=="over-limit"){UC_Cart.OverCreditLimit=true;$("#order-detail-content").prepend('<p class="over-credit-limit alert alert-danger">Your shopping cart total over the your current credit limit</p>');$('<p class="over-credit-limit alert alert-danger">Your shopping cart total over the your current credit limit</p>').insertBefore("div.order-details");$("a.checkout-button").addClass("disabled");$("a#mini-cart-checkout").addClass("disabled");$("input.btn-checkout").attr("disabled",true);$("#btn_next").attr("disabled",true)}else{UC_Cart.OverCreditLimit=false;$("a.checkout-button").removeClass("disabled");$("a#mini-cart-checkout").removeClass("disabled");$("input.btn-checkout").attr("disabled",false);$("#btn_next").attr("disabled",false)}}};jQuery(document).ready(function(){UC_Cart.CheckReload();UC_Cart.InitializeCartSummary();UC_Cart.ViewCart();UC_Cart.CartCharges();if(jQuery("#previous-cart").length>0){UC_Cart.LoadPreviousCart()}jQuery("a[id$='mycart'], a.cart-button").attr("href","").on("click",function(a){a.preventDefault();jQuery("#cart-container").show()});jQuery("#cart-container .close").on("click",function(){jQuery("#cart-container").hide()});jQuery("#cart-container").mouseenter(function(){UC_Cart.pauseRefresh=true}).mouseleave(function(){UC_Cart.pauseRefresh=false});UC_Cart.CartVisibleToggle("[id$=_divCartSummary] .cart-summary-button","[id$=_uc_cart_summary_summary]","Show Cart Summary","Hide Cart Summary");UC_Cart.CartVisibleToggle("[id$=_divCurrentCart] .cart-summary-button","div.current-cart","Show Current Cart","Hide Current Cart")});var UC_Categories={Grower_Click:function(){if(jQuery(this).closest("li").hasClass("closed")){jQuery(this).closest("li").removeClass("closed");jQuery(this).closest("li").addClass("opened")}else{jQuery(this).closest("li").removeClass("opened");jQuery(this).closest("li").addClass("closed")}},SelectCategoryByCatId:function(a){if(jQuery.trim(a)==""){return}if($("div.columns").parent().attr("class")=="Search"){$("ul.tree li#"+a).removeClass("closed").addClass("opened")}jQuery("ul.tree li#"+a).addClass("selected");var b=jQuery("ul.tree li#"+a).parent().closest("li");while(b.length>0){b.removeClass("closed");b.addClass("opened");b=b.parent().closest("li")}},LoadCategoriesFrom:function(a,c){var b="";jQuery(a).each(function(d,e){b+='<li class="closed" id="'+e.cat_id+'"><span class="grower"></span><a href="/'+e.cat_url+'">'+e.cat_name+"</a>";if(e.Children!=null){b+=UC_Categories.CreateSubCategoriesUI(e.Children)}b+="</li>"});jQuery(c).append(b)},CreateSubCategoriesUI:function(a){var b="<ul>";jQuery(a).each(function(c,d){b+='<li class="opened"><span class="grower"></span><a href="/'+d.cat_url+'">'+d.cat_name+"</a>";if(d.Children!=null){b+=UC_Categories.CreateSubCategoriesUI(d.Children)}b+="</li>"});b+="</ul>";return b}};jQuery(document).ready(function(){jQuery("div.categories span.grower").click(UC_Categories.Grower_Click);UC_Categories.SelectCategoryByCatId(jQuery("div.hidden input[id$=hid_catid]").val())});var Product={SearchParameters:[],template:"",templateNew:"",templateList:[],Load:function(a){var c=(a==null?jQuery("div.products"):jQuery(a).find("div.products")).filter(function(){return !jQuery(this).is("div.row.products")&&jQuery(this).is(":visible")});var b=$(c).find("ul.product").length>0;if(!b&&c!==undefined&&jQuery(c).find("[data-id$=hid_template]").val()!=""){Product.LoadNew();return}Global.LoadTemplate("#product-list",function(d){Product.template=d;Product.RenderListTemplate(c,d)});if($("[data-id$=hid_template]").length>0){Product.LoadNew(a)}},LoadNew:function(a){var b=null;if(a==null||typeof a=="undefined"){b=jQuery("div.products:visible")}else{b=jQuery(a).find("div.products:visible")}var c=jQuery(b).find("[data-id$=hid_template]").val()||"#product-list";Global.LoadTemplate(c,function(d){Product.templateList[c]=d;Product.RenderListTemplate(b,d)})},RenderListTemplate:function(a,b){a.each(function(f,e){if($(e).find("li.lslide").length>0){return}Product.ShowProducts(e);var d=$(e).find("[data-id$=hid_keyword]").val();if($(e).find("[data-id$=hid_product_supplied]").val()=="True"){$(e).find("[data-id$=hid_page]").val(2);$(e).find("[data-id$=div_sort]").show();if($(e).find("[data-id$=hid_products_total]").length){var c=parseInt($(e).find("[data-id$=hid_products_total]").val());if(c==1){resultMsg="result has been found."}else{resultMsg="results have been found."}}}else{if(StateData.Get("productlist_search","page-"+d)!=""){$(e).find("[data-id$=hid_page]").val(StateData.Get("productlist_search","page-"+d))}else{$(e).find("[data-id$=hid_page]").val(1)}}})},LoadBundle:function(){if(jQuery("[id$=bundle_list]").length>0){jQuery.ajax({url:"/WebServices/Product.asmx/GetBundleList",type:"GET",contentType:"application/json; charset=utf-8",dataType:"json",success:function(b){var c=JSON.parse(b.d);if(c.List!=null){for(var a in c.List){if(c.List[a].Items!=null){c.List[a].Items[0].first=true}}}Global.LoadTemplate("#bundle",function(e){var d=Mustache.to_html(e,c);jQuery("[id$=bundle_list]").html(d)})},error:function(b,c,a){FlashMessage.ShowMessage(c,"danger",5000)}})}},SortChange:function(){var e=$("select[name=sel_sort] option:selected").val().split(":");var h=$("[data-id$=hid_load_type]").val();var g=$("[data-id$=hid_keyword]").val();var f=$("[data-id$=hid_catid]").val().length?$("[data-id$=hid_catid]").val():"All";var k=$("[data-id$=hid_page]").val();var i=e[0];var j=e[1];if(h=="Category"){window.location.href="/"+h+"/id/"+f+"/"+k+"/"+i+"-"+j}else{var c="";if($(".rad_brand input:radio").is(":checked")){c="Brand"}else{c="Keyword"}var a=$("[data-id$=hid_price_from]").length?$("[data-id$=hid_price_from]").val():"";var b=$("[data-id$=hid_price_to]").length?$("[data-id$=hid_price_to]").val():"";var d="/"+h+"/"+f+"/"+c+"/"+g+"/Price="+a+"-"+b+"/"+i+"-"+j;if(Global.SearchConfig.useNewSearch==true){d=d+"/true"}window.location.href=d}},GetViewEq:function(a){var b="";switch(a){case"product_view_list":b="list";break;case"product_view_grid":default:b="grid";break}Product.SetSessionViewMode(b);return b},ProductViewClick:function(){$(this).closest("ul").find("li").each(function(a,b){if($(b).hasClass("current")){$(b).removeClass("current");$("div.products ul.product").removeClass(Product.GetViewEq(b.id));if((b.id)=="product_view_grid"){$(".itemPrice_grid").addClass("itemPrice_list");$(".itemPrice_grid").removeClass("itemPrice_grid")}if((b.id)=="product_view_list"){$(".itemPrice_list").addClass("itemPrice_grid");$(".itemPrice_list").removeClass("itemPrice_list")}}});$(this).addClass("current");$("div.products ul.product").addClass(Product.GetViewEq(this.id))},SetSessionViewMode:function(b){var a=[{name:"session_name",value:"viewmode"},{name:"session_value",value:b},];$.ajax({url:"/Ajax/SetSession.ashx",data:a,cache:false,type:"POST",async:true})},TopChange:function(){$("[data-id$=hid_page]").val(1);Product.SortChange()},CreateSavingsBox:function(a){if(isNaN(parseFloat(a.old_price))){return""}if(a.price.replace("AU $","")>=a.old_price){return""}var b='<div class="savings"><span class="price"><b class="amount">{{price}}</b></span><br/><span class="old">AU ${{old_price}}</span></div>';return Mustache.to_html(b,a)},BuildProductListMustache:function(b,a){if(!(typeof a==="object"&&a.products!=undefined)){return}var d=(Global.preloadCategories?"[data-id$=hid_catid_parent]":"[data-id$=hid_catid]");var c=jQuery(b).find(d).val()||"";jQuery(b).find("p#no-item-found").remove();var e=jQuery(b).find("[data-id$=hid_load_type]").val();if(jQuery(b).find("[data-id$=hid_template]").length>0){var g=jQuery(b).find("[data-id$=hid_template]").val()||"#product-list";var f=Mustache.to_html(Product.templateList[g],Product.FormatData(a,c,e));jQuery(b).append(f)}else{var f=Mustache.to_html(Product.template,Product.FormatData(a,c,e));jQuery(b).find("ul[data-id$=ul_productsInfinite]").append(f);if(jQuery(b).find("ul[data-id$=ul_productsInfinite]").is(":visible")==false){jQuery(b).find("ul[data-id$=ul_productsInfinite]").show()}}jQuery(b).find("img").lazyload();if($("ul.product li.singleprice").length>0&&$("ul.product li.threetierprice").length>0){$("ul.product li.singleprice").removeClass("singleprice").addClass("threetierprice")}if(a.camp_codes!=undefined&&a.camp_codes.warning){if($("p.camp-code-warning").length<=0){$(b).prepend('<p class="alert alert-warning camp-code-warning">Do you want to replace your current campaign code <b>'+a.camp_codes.old_camp_code+"</b> with this <b>"+a.camp_codes.new_camp_code+'</b>?<br/><b>Note: </b>Your current prices in your shopping cart may change <button class="btn btn-success proceed" data-code="'+a.camp_codes.new_camp_code+'">Yes, Proceed</button> <button class="btn btn-warning cancel">Cancel</button></p>');$("p.camp-code-warning button.proceed").click(function(){var h=$(this).attr("data-code");$.ajax({url:"/WebServices/Cart.asmx/ReplaceCampCode",data:'{ "camp_code" : "'+h+'" }',dataType:"JSON",method:"POST",beforeSend:function(){$("p.camp-code-warning").hide();$("p.failed").remove();FlashMessage.ShowMessage("Loading. Please wait.","warning",3000)},success:function(i){$("div.loading-container").hide();if(i.SUCCESS){FlashMessage.ShowMessage("New campaign code sucessfully set. Reloading Please wait.","success",3000);location.reload(true)}else{$("p.camp-code-warning").show();$(b).prepend('<p class="alert alert-danger failed">'+i.MESSAGE+". Please try to refresh your browser</p>")}},error:function(){$("div.loading-container").hide();$("p.camp-code-warning").show();FlashMessage.ShowMessage("Failed to send the campaign code. Please try to refresh your browser","danger",5000)}})});$("p.camp-code-warning button.cancel").click(function(){$("p.camp-code-warning").hide()})}}if(Global.SearchConfig.useNewSearch!=true){jQuery(b).find(".searchCategory > .tree").show()}jQuery(b).find("[data-id$=hid_page]").val(parseInt(jQuery(b).find("[data-id$=hid_page]").val())+1);if(typeof jQuery('[data-toggle="popover"]').popover!=="undefined"){jQuery('[data-toggle="popover"]').popover({placement:"top"})}},FormatData:function(u,d,n){var i=new Array();i.products=new Array();for(ctr=0;ctr<u.products.length;ctr++){if(!u.products[ctr]){continue}var y=new Array();var h=Product.GetLength(u.products[ctr].prices);var g;var w=0;if(u.products[ctr].sticker_name.toUpperCase()=="FTU"){if(h==3){g=["Enquire now","for Special First","Time User Pricing!"]}if(h==2){g=["Enquire now","for Special First"]}if(h==1){f=["Enquire now for <strong>FTU</strong> Price!"]}}else{g=Global.pricesMask(h)}for(var l in u.products[ctr].prices){var f="";if(u.products[ctr].is_login_required==true){if(u.products[ctr].option_button!="HIDE"&&!u.products[ctr].is_logged_in){f=g[w]}}y.push({qty:l,price:u.products[ctr].prices[l],comment:f});w++}var F="";if(u.products[ctr].tax_sched=="110"){F="Inc. GST"}else{if(u.products[ctr].tax_sched=="100"){F="GST Free"}else{F="Exc. GST"}}var j=false;if(isNaN(parseFloat(u.products[ctr].old_price))==false&&u.products[ctr].price.replace("AU $","")<u.products[ctr].old_price){j=true}var D=false;var G=false;var a=false;var o=false;var s=false;var q=false;var r=false;var p=false;var c=false;var E=false;var k=false;var B=false;var z="";var t=false;var v=false;var C=false;var A=false;if(u.products[ctr].item_stock==false){k=true}else{c=true}if(u.products[ctr].option_button=="TRADE_PRICE"&&!u.products[ctr].is_logged_in){s=true}if(u.products[ctr].option_button=="SET_AFFINITY"&&!u.products[ctr].is_logged_in){q=true}if(u.products[ctr].option_button=="HIDE"&&!u.products[ctr].is_logged_in){p=true}if(u.products[ctr].is_visitor_singleprice_enabled&&!u.products[ctr].is_logged_in){r=true;s=false;u.products[ctr].view_as_single_price=true}if(!u.products[ctr].is_logged_in&&q==false&&p==false){o=true}if(Global.cat_id=="2170361"&&u.products[ctr].is_login_required&&u.products[ctr].is_logged_in==false){s=true}if(u.products[ctr].is_threetier_enabled){G=true}else{D=true;if(s){y=new Array();y.push({qty:1,price:u.products[ctr].prices[0],comment:Global.pricesMask(1)})}}if(u.products[ctr].view_as_single_price==true&&u.products[ctr].is_login_required==true&&u.products[ctr].is_logged_in){G=false;D=true;if(/\d+off/i.test(u.products[ctr].sticker_name)){B=true}}if(u.products[ctr].status.toLowerCase()=="available"){a=true}if(u.products[ctr].status.toLowerCase()=="still available"){E=true;k=false;a=true}if(q){a=false}var b=false;if(u.products[ctr].visibility_mode=="FORCE_OUT_OF_STOCK"&&u.products[ctr].has_subitems){b=true}if(u.products[ctr].visibility_mode=="FORCE_OUT_OF_STOCK"){t=true;a=true;k=false;c=false}if(u.products[ctr].visibility_mode=="POA"){v=true;a=false}var H="";if(d==Global.cat_id||d=="0"){H="/"+(n!=undefined&&n!=""?"/list="+n:"")}else{H=(n!=undefined&&n!=""?"/list="+n:"")+"#Cat-ID"+d}if(Global.cat_id=="43540"){o=false}if(u.products[ctr].price_source=="GOLD1Y"){z="Gold Member"}else{if(u.products[ctr].price_source=="SILV1Y"){z="Silver Member"}}var e;if(u.item_variants!=undefined&&u.item_variants.length>0){e=Product.GetChildItems(u.item_variants,u.products[ctr].item_no);if(e.length==0){e=null}}var m=u.products[ctr].item_name_strip;if(m==""){m=u.products[ctr].item_gen_desc_limit}if(m==""){m=u.products[ctr].item_gen_desc}if(u.products[ctr].primary_description!=undefined&&u.products[ctr].primary_description!=""){C=true}if(u.products[ctr].discount_percentage!=undefined&&isNaN(u.products[ctr].discount_percentage)==false&&parseFloat(u.products[ctr].discount_percentage)>0){A=true}i.products.push({singleprice:D,threetierprice:G,discounted:j,dangerous:u.products[ctr].dangerous,sticker_name:u.products[ctr].sticker_name,favourite:u.products[ctr].favourite,price:u.products[ctr].price,old_price:u.products[ctr].old_price,prices:y,addtocart:a,promo_camp_code:u.products[ctr].promo_camp_code,alternativebutton:b,loginbutton:o,login_required:u.products[ctr].is_login_required&&u.products[ctr].is_logged_in==false,option_button_trade_price:s,option_button_set_affinity:q,option_button_hide:p,option_button_special_bulk_price:r,item_no:u.products[ctr].item_no,url_product:"/Product/id/"+Utility.urlencode(u.products[ctr].item_no)+"/"+(u.products[ctr].urlfriendly+H).replace("//","/"),status_lower:u.products[ctr].status_lower,status:u.products[ctr].status,item_gen_desc_limit:Global.cat_id==43540?u.products[ctr].item_gen_desc:u.products[ctr].item_gen_desc_limit,tax_sched:F,item_unit:u.products[ctr].item_unit,item_name_strip:m,available_now:c,few_left:k,out_of_stock:t,still_available:E,show_price_before_discount:B,withsidepanel:false,customized:u.products[ctr].displaytype!="DEFAULT",custom1:u.products[ctr].displaytype=="CUSTOM1",promoname:z,has_variant:e!=null,item_variants:e,total_variants:(e!=null?e.length:0),promopricing:u.products[ctr].promopricing,location:u.products[ctr].location,bundle_item:u.products[ctr].bundle_item,therapeuticwarning:u.products[ctr].location=="Y%X"&&jQuery.trim(u.products[ctr].price_source)=="TQO",poa:v,variant_name:u.products[ctr].variant_name,cluster_code:u.products[ctr].cluster_code,primary_description:u.products[ctr].primary_description,secondary_description:u.products[ctr].secondary_description,group_description:(u.products[ctr].group_description!=""?u.products[ctr].group_description:u.products[ctr].item_gen_desc_limit),group_img_location:u.products[ctr].group_img_location,has_group_img:u.products[ctr].group_img_location!="",show_primary_desc:C,show_discount:A,old_price:u.products[ctr].tax_sched=="110"?u.products[ctr].old_price*1.1:u.products[ctr].old_price,discount_percentage:u.products[ctr].discount_percentage,listfrom:n});if(u.camp_codes!==undefined){i.camp_codes=u.camp_codes}i.products[ctr][u.products[ctr].item_no]=true}return i},GetChildItems:function(c,a){var b=[];var d=Product.GetParentVariant(c,a);$.each(c,function(f,i){if(i.parent_itemno==d){var g=[];if(i.size!=""&&typeof i.size!=="undefined"){g.push(i.size)}if(i.color!=""&&typeof i.color!=="undefined"){g.push(i.color)}if(i.count!=""&&typeof i.count!=="undefined"){g.push(i.count)}if(i.other!=""&&typeof i.other!=="undefined"){g.push(i.other)}var h=g.join(", ");var e={parent_itemno:i.parent_itemno,child_itemno:i.child_itemno,text:h,selected:(a==i.child_itemno)};b.push(e)}});return b},GetParentVariant:function(b,a){var c="";$.each(b,function(d,e){if(e.child_itemno==a){c=e.parent_itemno}});return c},GetLength:function(c){var a=0;for(var b in c){if(c.hasOwnProperty(b)){++a}}return a},BuildProductListBS:function(b,a){Product.BuildProductListMustache(b,a)},BuildProductList:function(b,a){var d=(Global.preloadCategories?"[data-id$=hid_catid_parent]":"[data-id$=hid_catid]");var c=$(b).find(d).val()|"";if(c==Global.cat_id||c=="0"){c="/"}else{c="#Cat-ID"+c}$(b).find("p#no-item-found").remove();if(a.products.length){var h="";for(var g=0;g<a.products.length;g++){var f="";if(a.products[g].tax_sched=="110"){f="(Inc. GST)"}else{if(a.products[g].tax_sched=="100"){f="(GST Free)"}else{f="(Exc. GST)"}}if(a.products[g].promo_camp_code!=""){a.products[g].promo_camp_code="promo:"+a.products[g].promo_camp_code}h+="<li class='ajax_block_product bordercolor"+(a.products[g].is_logged_in==false&&a.products[g].is_threetier_enabled==false?" compact":"")+"'>";h+="    <div class='background'>";h+="        <a href='/Product/id/"+a.products[g].item_no+c+"' data-item='"+a.products[g].item_no+"' class='product-link'>";h+="            <img src='https://file.livingstone.com.au/images/product/180x180/"+a.products[g].item_no+".png' id='img_"+a.products[g].item_no+"'/>";h+="        </a>";if(a.products[g].sticker_name!=""){h+="<img src='https://file.livingstone.com.au/images/promotions-icon/"+a.products[0].sticker_name+".png' class='promo "+a.products[0].sticker_name+"' />"}h+="        <div class='center_block'>";h+="            <div class='product_flags'>";h+="                <span class='"+a.products[g].status_lower+"bordercolor'>"+a.products[g].item_no+" | "+a.products[g].status+"</span>";h+="            </div>";h+="            <p class='product_desc'>";h+="                <a href='/Product/id/"+a.products[g].item_no+c+"' data-item='"+a.products[g].item_no+"' class='product-link' title='"+a.products[g].item_gen_desc_limit+"'>"+a.products[g].item_gen_desc_limit+"</a>";h+="            </p>";h+="            "+(a.products[g].dangerous=="1"?"<span class='dangerous-goods-label' style='display: block;'>May cost additional freight</span>":"");h+="        </div>";h+="        <div id='itemPrice' class='right_block bordercolor itemPrice_grid' runat='server'>";if(a.products[g].is_login_required=="true"){h+="           <span class='price'>Login for Trade Prices</span>"}else{if(a.products[g].is_logged_in==true){h+="<table class='item-three-prices' name='prices_"+a.products[g].item_no+"'><tr><td>Qty</td><td>Prices "+f+"</td></tr>";for(var e in a.products[g].prices){if(a.products[g].prices.hasOwnProperty(e)){h+="<tr data-qty='"+e+"'><td>"+e+"+</td><td class='item-three-price'> AU $"+a.products[g].prices[e].toFixed(2)+"</td></tr>"}}h+="</table>";h+="<div class='item-qty-and-unit'>";h+="  <input type='text' class='txtQty' name='txtQty_"+a.products[g].item_no+"' value='1' />";h+="  <label class='item-unit'>"+a.products[g].item_unit+"</label>";h+="</div>";if(a.products[g].status.toLowerCase()=="available"){h+="            <div id='add_to_cart'><span class='addItem' id='btn_cart' onclick=\"UC_Cart.InsertCart('img_"+a.products[g].item_no+"', '"+a.products[g].item_no+"', jQuery('[name=txtQty_"+a.products[g].item_no+"]').val())\" style='cursor:pointer'>+ Add to cart</span>"+(a.products[g].dangerous=="1"?"<span class='dangerous-goods'></span>":"")+"</div>"}}else{if(a.products[g].is_threetier_enabled==true){h+="<table class='item-three-prices' name='prices_"+a.products[g].item_no+"'><tr><td>Qty</td><td>Prices "+f+"</td></tr>";for(var e in a.products[g].prices){if(a.products[g].prices.hasOwnProperty(e)){h+="<tr data-qty='"+e+"'><td>"+e+"+</td><td class='item-three-price'> AU $"+a.products[g].prices[e].toFixed(2)+"</td></tr>"}}h+="</table>";h+="<div class='item-qty-and-unit'>";h+="  <input type='text' class='txtQty' name='txtQty_"+a.products[g].item_no+"' value='1' />";h+="  <label class='item-unit'>"+a.products[g].item_unit+"</label>";h+="</div>";if(a.products[g].status.toLowerCase()=="available"){if(a.products[g].sticker_name!=""&&a.products[g].promo_camp_code!=""){h+="            <div id='add_to_cart'><span class='addItem' id='btn_cart' onclick=\"UC_Cart.InsertCart('img_"+a.products[g].item_no+"', '"+a.products[g].item_no+"', jQuery('[name=txtQty_"+a.products[g].item_no+"]').val(), '"+a.products[g].promo_camp_code+"')\" style='cursor:pointer'>+ Add to cart</span>"+(a.products[g].dangerous=="1"?"<span class='dangerous-goods'></span>":"")+"</div>"}else{h+="            <div id='add_to_cart'><span class='addItem' id='btn_cart' onclick=\"UC_Cart.InsertCart('img_"+a.products[g].item_no+"', '"+a.products[g].item_no+"', jQuery('[name=txtQty_"+a.products[g].item_no+"]').val())\" style='cursor:pointer'>+ Add to cart</span>"+(a.products[g].dangerous=="1"?"<span class='dangerous-goods'></span>":"")+"</div>"}}}else{h+="           <span class='price'>"+a.products[g].price+"</span>";if(a.products[g].status.toLowerCase()=="available"){if(a.products[g].sticker_name!=""&&a.products[g].promo_camp_code!=""){h+="            <div id='add_to_cart'><span class='addItem' id='btn_cart' onclick=\"UC_Cart.InsertCart('img_"+a.products[g].item_no+"', '"+a.products[g].item_no+"', 1, '"+a.products[g].promo_camp_code+"')\" style='cursor:pointer'>+ Add to cart</span>"+(a.products[g].dangerous=="1"?"<span class='dangerous-goods'></span>":"")+"</div>"}else{h+="            <div id='add_to_cart'><span class='addItem' id='btn_cart' onclick=\"UC_Cart.InsertCart('img_"+a.products[g].item_no+"', '"+a.products[g].item_no+"', 1)\" style='cursor:pointer'>+ Add to cart</span>"+(a.products[g].dangerous=="1"?"<span class='dangerous-goods'></span>":"")+"</div>"}}}}if(a.products[g].is_logged_in==false){h+="           <span class='tradePrice'><a href='/Authentication'>Login for Trade Prices</a></span>"}}if(a.products[g].isSale){h+="            <span class='list_sale'>SALE!</span>"}h+="        </div>";h+="    </div>";h+="</li>"}$(b).find("ul.product").append(h);if(Global.SearchConfig.useNewSearch!=true){$(b).find(".searchCategory > .tree").show()}$(b).find("[data-id$=hid_page]").val(parseInt($(b).find("[data-id$=hid_page]").val())+1)}},LastLivInfinite:null,ShowProducts:function(a,h){if(h!=null){jQuery("form.searchbox input.search_query").val(h);jQuery(a).find("[data-id$=hid_keyword]").val(h);jQuery(a).find("[data-id$=hid_page]").val("1");jQuery(a).find("[data-id$=hid_orderby]").val("match");jQuery(a).find("[data-id$=hid_orderway]").val("DESC");jQuery(a).find("[data-id$=hid_price_from]").val("0");jQuery(a).find("[data-id$=hid_price_to]").val("0");jQuery(a).find("[data-id$=hid_load_type]").val("Search");jQuery(a).find("[id*=ul_productsInfinite] > li").remove();var i="/Search/";i+=("All/");i+=(jQuery(a).find("[data-id$=hid_search_type]").val()+"/");i+=(jQuery(a).find("[data-id$=hid_keyword]").val()+"/");i+=("Price=");i+=(jQuery(a).find("[data-id$=hid_price_from]").val()+"-");i+=(jQuery(a).find("[data-id$=hid_price_to]").val()+"/");i+=(jQuery(a).find("[data-id$=hid_orderby]").val()+"-");i+=(jQuery(a).find("[data-id$=hid_orderway]").val()+"/");if(Global.SearchConfig.useNewSearch==true){i+=("true/")}}if($(a).find("[data-id$=hid_load_type]").length){var c=true;var b=true;var j;switch($(a).find("[data-id$=hid_load_type]").val().toLowerCase()){case"top10":$(a).find(".li_product_title").text(Global.productHeader.top10);break;case"monthlyspecials":$(a).find(".li_product_title").text(Global.productHeader.monthlySpecials);break;case"new":$(a).find(".li_product_title").text(Global.productHeader.newProducts);break;case"webonlyspecials":$(a).find(".li_product_title").text(Global.productHeader.webonlySpecials);break;case"search":c=true;break;case"toppercategory":$(a).find(".li_product_title").text(Global.productHeader.topperCategory);$(a).find("[data-id$=hid_visible_sort]").val("False");break;case"specials":$(a).find(".li_product_title").text(Global.productHeader.specials);break;case"promotions":$(a).find(".li_product_title").text($(a).find("[data-id$=hid_header]").val());break;case"campaign":$(a).find(".li_product_title").text($(a).find("[data-id$=hid_keyword]").val().length==0?Global.productHeader.campaign:"Campaign Code: "+$(a).find("[data-id$=hid_keyword]").val());break}if($(a).find("p.header_warning").text()!=""&&$(a).find("[data-id$=hid_visible_warning]").val().toLowerCase()=="true"){$(a).find("p.header_warning").show()}if(c){var g=false;if(jQuery(a).find("ul.product li").length==0&&Global.searchVersion!=="v3"){var d=$(a).find("[data-id$=hid_keyword]").val().toLowerCase();if(StateData.Get("productlist_search","list-"+d)!=""&&$(a).find("[data-id$=hid_load_type]").val().toLowerCase()=="search"&&StateData.Get("productlist_search","keyword-"+d)=="1"){var f=JSON.parse(StateData.Get("productlist_search","list-"+d));Product.BuildProductListUI(a,f);g=true}}if(!g){var e=$(a).find("[data-id$=hid_load_type]").val().toLowerCase();Product.LastLivInfinite=$(a).find("[data-id$=ul_productsInfinite]").livInfinite({url:"/Ajax/GetProducts.ashx",cache:false,contentType:"application/json; charset=utf-8",dataType:"json",getParams:function(){var k=$(a).find("select[name=sel_sort] option:selected").val();if(typeof k=="undefined"){k=""}k=k.split(":");var o;switch(e){case"search":var l=$(a).find("[data-id$=hid_keyword]").val();l=l.replace("~2f","/");var m="search";if(Global.searchVersion!=undefined){m=m+"_"+Global.searchVersion}o=[{name:"cat_id",value:$(a).find("[data-id$=hid_catid]").val()},{name:"search_type",value:$(a).find("[data-id$=hid_search_type]").val()},{name:"load_type",value:m},{name:"keyword",value:l},{name:"page_current",value:$(a).find("[data-id$=hid_page]").val()},{name:"hash",value:$(a).find("[data-id$=hid_searchv2_hash]").val()},{name:"filters",value:decodeURIComponent(location.search.replace("?",""))}];break;case"targeteditems":var l=$(a).find("[data-id$=hid_keyword]").val();l=l.replace("~2f","/");o=[{name:"load_type",value:$(a).find("[data-id$=hid_load_type]").val()},{name:"keyword",value:l},{name:"page_current",value:$(a).find("[data-id$=hid_page]").val()},{name:"filters",value:decodeURIComponent(location.search.replace("?",""))}];break;case"favouriteitems":o=[{name:"cat_id",value:$(a).find("[data-id$=hid_catid]").val()},{name:"load_type",value:$(a).find("[data-id$=hid_load_type]").val()},{name:"page_current",value:$(a).find("[data-id$=hid_page]").val()}];break;case"category":o=[{name:"load_type",value:$(a).find("[data-id$=hid_load_type]").val()},{name:"cat_id",value:$(a).find("[data-id$=hid_catid]").val()},{name:"order_by",value:k[0]},{name:"order_way",value:k[1]},{name:"page_current",value:$(a).find("[data-id$=hid_page]").val()},{name:"filters",value:decodeURIComponent(location.search.replace("?",""))}];break;case"boughtbyothers":o=[{name:"load_type",value:$(a).find("[data-id$=hid_load_type]").val()},{name:"item_no",value:$(a).find("[data-id$=hid_item_no]").val()}];break;case"subitem":o=[{name:"load_type",value:$(a).find("[data-id$=hid_load_type]").val()},{name:"item_no",value:$(a).find("[data-id$=hid_item_no]").val()}];break;case"toppercategory":o=[{name:"load_type",value:$(a).find("[data-id$=hid_load_type]").val()},{name:"cat_id",value:$(a).find("[data-id$=hid_catid]").val()}];break;case"campaign":o=[{name:"load_type",value:$(a).find("[data-id$=hid_load_type]").val()},{name:"keyword",value:$(a).find("[data-id$=hid_keyword]").val()},{name:"page_current",value:$(a).find("[data-id$=hid_page]").val()}];break;case"promotions":o=[{name:"load_type",value:$(a).find("[data-id$=hid_load_type]").val()},{name:"keyword",value:$(a).find("[data-id$=hid_keyword]").val()},{name:"page_current",value:$(a).find("[data-id$=hid_page]").val()}];break;case"itemrank":o=[{name:"load_type",value:$(a).find("[data-id$=hid_load_type]").val()},{name:"keyword",value:$(a).find("[data-id$=hid_keyword]").val()},{name:"page_current",value:$(a).find("[data-id$=hid_page]").val()}];break;case"bucketofgoods":var n=$(a).find("[data-id$=hid_keyword]").val();if(typeof BOGCustom==="undefined"&&$("ul[id$=BucketCategories] li a[data-category]").length==0&&!n.indexOf("category_type:")>=0&&!n.indexOf("search:")>=0){if($("[data-id$=hid_catid]").length>0&&$("[data-id$=hid_catid_parent]").val()!="0"){n="category_type:"+$("[data-id$=hid_catid]").val()+";search:"+n}else{n="category_type:ALL;search:"+n}}o=[{name:"load_type",value:$(a).find("[data-id$=hid_load_type]").val()},{name:"keyword",value:n},{name:"loading_type",value:$(a).find("[data-id$=hid_loading_type]").val()},{name:"products_perpage",value:$(a).find("[data-id$=hid_products_perpage]").val()},{name:"page_current",value:$(a).find("[data-id$=hid_page]").val()}];break;case"specials":default:o=[{name:"load_type",value:$(a).find("[data-id$=hid_load_type]").val()},{name:"page_current",value:$(a).find("[data-id$=hid_page]").val()}];break}return o},initialLoading:b,loadType:e,beforeSend:function(){$(a).find("[data-id$=div_loading]").show();$(a).find("nav.bucket-pagination").remove()},success:function(n){var l=jQuery(a).find("[data-id$=hid_keyword]").val();if(StateData.Get("productlist_search","list-"+l)!=""&&jQuery(a).find("[data-id$=hid_load_type]").val().toLowerCase()=="search"&&StateData.Get("productlist_search","keyword-"+l)=="1"&&$(a).find("[data-id$=ul_productsInfinite] li").length>0){var m=JSON.parse(StateData.Get("productlist_search","list-"+l));Product.BuildProductListUI(a,n);m.products=jQuery.merge(m.products,n.products);StateData.Set("productlist_search","list-"+l,JSON.stringify(m));StateData.Set("productlist_search","page-"+l,jQuery(a).find("[data-id$=hid_page]").val());StateData.Set("productlist_search","keyword-"+l,"1")}else{if(jQuery(a).find("[data-id$=hid_load_type]").val().toLowerCase()=="search"){StateData.Set("productlist_search","list-"+l,JSON.stringify(n));StateData.Set("productlist_search","page-"+l,jQuery(a).find("[data-id$=hid_page]").val());StateData.Set("productlist_search","keyword-"+l,"1");Product.BuildProductListUI(a,n)}else{Product.BuildProductListUI(a,n)}}var k=$("input[data-id=Search_hid_keyword]").val();if(k!=undefined&&k.toLowerCase().indexOf("collection")>=0){$.getJSON("/WebServices/Media.asmx/GetContent?name=Collection&id="+k,function(o){if(o.CONTENT.length>0){$('<div class="collection-content"></div>').insertAfter($("div.products.search").find("h1.PageHeader"));$.each(o.CONTENT,function(p,q){$("div.collection-content").append(q)})}})}},error:function(){$(a).find("p.header_warning").text("Error")},complete:function(){var l="";$(a).find("[data-id$=div_loading]").hide();$(a).find(".PageHeader ul").show();if($(a).find("[data-id$=ul_productsInfinite] li").length==0&&$(a).find("div[id^=item]").length==0){switch($(a).find("[data-id$=hid_load_type]").val().toLowerCase()){case"search":$(a).find(".li_product_title").text('Search result for "'+decodeURI($(a).find("[data-id$=hid_keyword]").val()).replace("Collection-","").replace('"',"").replace('"',"")+'"');l="No results found, Try different or more general keywords";if(typeof UC_Chat!=="undefined"){UC_Chat.OfferCustomerHelp("NO_ITEM_FOUND")}break;case"category":$(a).find("[data-id$=hid_load_type]").val("TopPerCategory");Product.ShowProducts(a);break;case"toppercategory":if($(a).find("[data-id$=hid_has_categories]").val().toLowerCase()=="true"){l=""}else{$(a).find(".li_product_title").text($(a).find("[data-id$=hid_header]").val());l="No product for this category"}break;case"promotions":l="No item found in this promotions";break;default:$(a).find("[data-id$=ul_productsInfinite]").hide();break}}else{switch($(a).find("[data-id$=hid_load_type]").val().toLowerCase()){case"search":var k=decodeURI($(a).find("[data-id$=hid_keyword]").val()).replace("Collection-","").replace('"',"").replace('"',"");$("head title").text($("head title").text().replace("Search Result",k));$(a).find(".li_product_title").text('Search result for "'+k+'"');break;case"category":case"toppercategory":if($(a).find("[data-id$=hid_has_categories]").val().toLowerCase()=="false"){$(a).find(".li_product_title").text($(a).find("[data-id$=hid_header]").val());$(a).find("[data-id$=hid_visible_header]").val("True")}break}if($("div.products.scrollable").length>0){$("div.products.scrollable").itemSlider()}}if($(a).find("[data-id$=ul_productsInfinite] li").length>0&&$(a).find("[data-id$=hid_visible_sort]").val().toLowerCase()=="true"){$(a).find("[data-id$=div_sort]").show()}if(l!=""&&$(a).find("[data-id$=hid_visible_warning]").val().toLowerCase()=="true"){$(a).find("p.header_warning").text(l);$(a).find("p.header_warning").show()}else{$(a).find("p.header_warning").hide()}if($(a).find("[data-id$=hid_show_product_header]").val().toLowerCase()=="true"&&$(a).find("[data-id$=hid_visible_header]").val().toLowerCase()=="true"){$(a).find(".li_product_title").show()}else{$(a).find(".li_product_title").hide()}$(".background .subitems").unbind("click.subitems").bind("click.subitems",function(){Product.LoadSubItem($(this).attr("data-item"),$(this))});Product.BindCategoryClickEvent();$(a).find("h2.li_product_title").show();if(LightSlider){LightSlider.Activate()}}})}}}},BuildProductListUI:function(b,h){var e=$(b).find("[data-id$=hid_load_type]").val().toLowerCase();if(jQuery("[data-id$=hid_bs]").length>0&&jQuery("[data-id$=hid_bs]").val()=="true"){Product.BuildProductListBS(b,h)}else{Product.BuildProductList(b,h)}ProductView.PriceHighlighter($(b).find(".txtQty"),".itemPrice_grid");ProductList.renderComplete(b);$(b).find("select.item-variant").attr("data-load-from",e);$(b).find("select.item-variant").off("change").on("change",function(){var i=$(this);d(i,i.attr("data-load-from"))});$(b).find("div.variant-list > span").off("click").on("click",function(){var j=$(this);var i=j.parent().parent();i.hide();var k=j.attr("data-value");i.parent().find("div.background select.item-variant").val(k).trigger("change")});var d=function(j,l){var m=false;var k=j.val();var i=j.closest("li");if(i.length==0){i=j.closest("div[id^=item_]");m=true}var o;var n;var p;if(l=="search"&&Global.searchVersion!=undefined){o="search_"+Global.searchVersion;n="search_exact:"+k}if(l=="category"){n="search_exact:"+k}p=[{name:"load_type",value:o||l},{name:"keyword",value:(l=="bucketofgoods"?"search_exact:":"")+(n||k)}];$.ajax({url:"/Ajax/GetProducts.ashx",data:p,method:"POST",beforeSend:function(){if(m==false){i.find("p.product_desc").html("Loading. Please wait.")}else{i.find("strong.item-name").html("Loading. Please wait.")}},success:function(q){Global.LoadTemplate("#product-list",function(t){var v=$(i).closest("div.row.products").find("[data-id$=hid_template]").val()||"#product-list";var u=Product.templateList[v];if(m&&u!=""){t=u}var s=Mustache.to_html(t,Product.FormatData(q,Global.cat_id,l));$(s).insertAfter(i);var w=Mustache.Formatters.removeSpecialChar(k);var r=$("div.products."+l.toLowerCase()+" ul[data-id$=ul_productsInfinite]").find("li#item_"+w);if(m){r=$("div.products."+l.toLowerCase()+" ul[data-id$=ul_productsInfinite]").find("div[data-item="+w+"]")}r.find("div.grouped-details").remove();r.find("select.item-variant").attr("data-load-from",l);r.find("select.item-variant").off("change").on("change",function(){var y=$(this);d(y,y.attr("data-load-from"))});r.find("a.favourite, .favourite-button").click(function(y){y.preventDefault();Product.AddToFavourite($(this))});ProductList.renderComplete(s,false);i.remove();$("div.products img").lazyload()})}})};$(b).find("a.favourite, .favourite-button").click(function(i){i.preventDefault();Product.AddToFavourite($(this))});switch(e){case"bucketofgoods":var a=$("ul[id$=BucketCategories]");a.empty();if(typeof BOGCustom!=="undefined"&&typeof BOGCustom.renderCategories!=="undefined"){BOGCustom.renderCategories(h.bucket_categories)}else{$.each(h.bucket_categories,function(i,j){a.append('<li role="presentation" '+(j.active==1?'class="active"':"")+'><a href="#" style="background-color:'+j.tab_color+";color:"+j.font_color+'" data-category="'+j.category_type+'">'+j.category_type.replace("Supplies","")+' <span class="badge">'+j.total_items+"</span></a></li>")})}if(typeof h.result_info!="undefined"){$("#hid_pagemax").val(h.result_info.total_page);Global.LoadTemplate("#BucketOfGoodsPaginationTemplate",function(l){h.result_info.pages=[];for(var j=1;j<=h.result_info.total_page;j++){h.result_info.pages.push({page:j,active:j==h.result_info.current_page})}$("div.products.bucketofgoods nav.bucket-pagination").remove();var k=Mustache.to_html(l,h.result_info);$(k).insertAfter("div.products.bucketofgoods ul[data-id$=ul_productsInfinite]");$("div.products.bucketofgoods nav.bucket-pagination ul li").click(function(i){i.preventDefault();$("[data-id=bucketofgoods_hid_page]").val($(this).attr("data-page"));$("div.products.bucketofgoods ul[data-id$=ul_productsInfinite] li").remove();$("div.products.bucketofgoods ul[data-id$=ul_productsInfinite] > div").remove();Product.Load("div.products.bucketofgoods");$("html, body").animate({scrollTop:($("div.products.bucketofgoods ul[data-id$=ul_productsInfinite]").offset().top-200)},1000)})})}$("#txtBucketSearch").off("keydown.submitBG").on("keydown.submitBG",function(i){if(i.which==13){$("[id$=btnBucketSubmitSearch]").click()}});$("[id$=btnBucketSubmitSearch]").off("click.searchBOG").on("click.searchBOG",function(){var i=$("[id$=txtBucketSearch]").val();if(i==""){i="category_type:ALL"}else{i="category_type:ALL;search:"+i}$("div.products.bucketofgoods ul[data-id$=ul_productsInfinite]").show().parent().parent().find("[data-id$=hid_keyword]").val(i);$("div.products.bucketofgoods ul[data-id$=ul_productsInfinite] li").remove();$("div.products.bucketofgoods ul[data-id$=ul_productsInfinite] > div").remove();$("div.products.bucketofgoods ul[data-id$=ul_productsInfinite]").parent().parent().find("[data-id$=hid_page]").val("1");$("div.products.bucketofgoods ul[data-id$=ul_productsInfinite]").parent().parent().attr("data-load","true");Product.Load("div.products.bucketofgoods")});a.find("li a").click(function(i){i.preventDefault();$("[id$=txtBucketSearch]").val("");var j="";j=(j==""?"category_type:"+$(this).attr("data-category"):j+";category_type:"+$(this).attr("data-category"));$("div.products.bucketofgoods ul[data-id$=ul_productsInfinite]").show().parent().parent().find("[data-id$=hid_keyword]").val(j);$("div.products.bucketofgoods ul[data-id$=ul_productsInfinite] li").remove();$("div.products.bucketofgoods ul[data-id$=ul_productsInfinite] > div").remove();$("div.products.bucketofgoods ul[data-id$=ul_productsInfinite]").parent().parent().find("[data-id$=hid_page]").val(1);$("div.products.bucketofgoods ul[data-id$=ul_productsInfinite]").parent().parent().attr("data-load","true");Product.Load("div.products.bucketofgoods");if(typeof BOGSubHeader!=="undefined"){BOGSubHeader.show($(this).attr("data-category"))}});if($("span.favourite-items > input[type=checkbox]").length>0){$("span.favourite-items > input[type=checkbox]").unbind("change.favItemsOnly").bind("change.favItemsOnly",function(){$("[id$=txtBucketSearch]").val("");var i="";i=(i==""?"category_type:"+$(this).attr("data-category"):i+";category_type:"+$(this).attr("data-category"));if($(this).is(":checked")){i="favourite_only:true"}$("div.products.bucketofgoods ul[data-id$=ul_productsInfinite]").show().parent().paren().find("[data-id$=hid_keyword]").val(i);$("div.products.bucketofgoods ul[data-id$=ul_productsInfinite] li").remove();$("div.products.bucketofgoods ul[data-id$=ul_productsInfinite] > div").remove();$("div.products.bucketofgoods ul[data-id$=ul_productsInfinite]").parent().parent().find("[data-id$=hid_page]").val(1);$("div.products.bucketofgoods ul[data-id$=ul_productsInfinite]").parent().parent().attr("data-load","true");Product.Load()})}break;case"search":case"category":var g="";if(h.products_total==1){g="result has been found."}else{g="results have been found."}var f=parseInt($(b).find("[data-id$=hid_page]").val());if(typeof UC_Chat!=="undefined"&&e=="search"&&f>2){UC_Chat.OfferCustomerHelp("LOAD_NEXT_PAGE")}if(typeof BOGCustom!=="undefined"&&typeof BOGCustom.normalCategoryPageLoaded!=="undefined"){BOGCustom.normalCategoryPageLoaded()}break;case"boughtbyothers":if(typeof h==="object"&&h.products!=undefined&&h.products.length){if(h.hasItemInRecentHistory){$(b).find(".li_product_title").text("Customers who bought your recent history also bought:")}else{$(b).find(".li_product_title").text("Customers also bought")}}break;case"subitem":if(typeof h==="object"&&h.products!=undefined&&h.products.length){$(b).find(".li_product_title").text("Products Similar To This One")}else{$(b).hide()}break;case"favouriteitems":$(b).find(".li_product_title").text("Favourite Items");break}if(h.Filters){var c=RouteDataParser.Searchv2(jQuery("[data-id$=hid_searchv2_hash]").val());jQuery(".form_search .filter").remove();jQuery(h.Filters).each(function(){if(this.type=="LIST"){Global.LoadTemplate("#uc_products-template-list",function(i){jQuery("[id$=srhKeywords]").after(Mustache.to_html(i,this))})}else{if(this.type=="SELECTION"){Global.LoadTemplate("#uc_products-template-selection",function(i){jQuery("[id$=srhKeywords]").after(Mustache.to_html(i,this))})}}});jQuery(".form_search .filter-list input[type=checkbox]").change(function(){MasterPage.SubmitSearch(this)});jQuery(".form_search .filter-selection a").click(function(){MasterPage.SubmitSearch(this);return false})}if(Global.searchVersion=="v3"&&h.new_filters){if(typeof searchFilters=="undefined"){$.getScript("https://file2.livingstone.com.au/scripts/searchfilter.js",function(){searchFilters.init(h)})}else{searchFilters.init(h)}}},BindCategoryClickEvent:function(){if(Global.bootStrapWebsite){jQuery("ul[id$='_uc_categorySearch_ul_tree'] span.grower").off("click",UC_Categories.Grower_Click).on("click",UC_Categories.Grower_Click)}else{jQuery("div.searchCategory span.grower").off("click",UC_Categories.Grower_Click).on("click",UC_Categories.Grower_Click)}},LoadSubItem:function(a,b){jQuery.ajax({url:"/Ajax/GetProducts.ashx",cache:false,dataType:"json",type:"POST",data:[{name:"load_type",value:"subitem"},{name:"item_no",value:a}],beforeSend:function(){b.html("Loading...")},complete:function(){b.html("View Alternative")},success:function(c){Global.LoadTemplate("#genericModal",function(f){var e=$("#generic-container");e.empty().append('<ul id="ul_productsInfinite" class="product grid"></ul>');var d=Mustache.to_html(Product.template,Product.FormatData(c));e.find("ul.product").append(d);e.find("ul.product li").removeClass("col-xs-12 col-sm-6 col-md-4 col-lg-3").addClass("col-xs-12 col-sm-6 col-md-4 col-lg-4");ProductView.PriceHighlighter(jQuery(e).find(".txtQty"),".itemPrice_grid");ProductList.renderComplete(e);$("#genericModal").modal("show")})}})},InitializeAutocomplete:function(){},AddToFavourite:function(a){var b=a.closest("[data-item]").attr("data-item");var c=a.closest("div.products")[0].className.replace("products ","");$.ajax({url:"/WebServices/Product.asmx/AddToFavourite?id="+b,type:"GET",contentType:"application/json; charset=utf-8",dataType:"json",success:function(e){var f=$.parseJSON(e.d);if(f.SUCCESS){var d=a.is(":button");if(f.MESSAGE=="ADDED"){ga4.Items(b,"",c,"add_to_wishlist");_klaviyo.addedToFavouriteItem(b);if(d==true){FlashMessage.ShowMessage("Item successully added to wishlist","success");a.closest(".col-sm-12").find(".glyphicon-heart").addClass("favourite");a.closest(".col-sm-12").find(".wishlist-caption").text("Remove from wishlist")}else{FlashMessage.ShowMessage("Item successully added to Favourite","success");if(a.is(".favourite-button")){a.addClass("favourite")}else{a.addClass("active")}}}else{_klaviyo.removedToFavouriteItem(b);if(d==true){FlashMessage.ShowMessage("Item successully removed from wishlist","success");a.closest(".col-sm-12").find(".glyphicon-heart").removeClass("favourite");a.closest(".col-sm-12").find(".wishlist-caption").text("Add to wishlist")}else{FlashMessage.ShowMessage("Item successully removed to Favourite.","success");if(a.is(".favourite-button")){a.removeClass("favourite")}else{a.removeClass("active")}}}}else{if(f.ERR_MSG=="ITEM_NOT_FOUND"){FlashMessage.ShowMessage("Item number cannot be found.","warning",5000)}else{if(f.ERR_MSG=="LOGIN_REQUIRED"){FlashMessage.ShowMessage("Cannot add to Favourite. Login is required.","warning")}else{FlashMessage.ShowMessage("Internal server error. Please try again later","danger")}}}},error:function(d){FlashMessage.ShowMessage("Error saving to favourite. Please contact developer.","danger",5000)}})},ProductModalRequest:null,ProductModalClosed:function(){if(Product.ProductModalRequest!=null&&typeof Product.ProductModalRequest.abort==="function"){Product.ProductModalRequest.abort();Product.ProductModalRequest=null}},ProductModalView:function(b,c){if(b==undefined||b==null){return}c=c||"";var a=$("#genericModal");if(a.length>0){a.find("#myModalLabel").html(b);a.find(".modal-dialog").addClass("modal-lg");a.find("#generic-container").html("Loading. Please wait.");a.modal("show")}else{Global.LoadGenericModal("body","genericModal",function(){a=$("#genericModal");a.find("#myModalLabel").html(b);a.find(".modal-dialog").addClass("modal-lg");a.find("#generic-container").html("Loading. Please wait.");a.modal("show")})}a.off("hidden.bs.modal",Product.ProductModalClosed()).on("hidden.bs.modal",Product.ProductModalClosed());Product.ProductModalRequest=ProductView.Render(a.find("#generic-container"),b,c)},InitializeImageSelector:function(){jQuery("div.image-selector").each(function(){var a=jQuery(this).attr("data-target")})}};(function(a){a.fn.itemSlider=function(b){settings=a.extend({},a.fn.itemSlider.settings);settings.$container=a(this);settings.$parent=settings.$container.parent();settings.totalItems=settings.$container.find("ul.product li").length;settings.scrollWidth=settings.$container.get(0).scrollWidth;settings.itemWidth=(settings.$parent.find("ul.product li:first-child").width()+10);settings.scrollWidthPerPage=Math.floor(settings.scrollWidth/settings.itemWidth);settings.totalItemsWidth=settings.itemWidth*settings.totalItems+(settings.totalItems*10);settings.endReached=false;a.fn.itemSlider.addButtonNav(settings);a.fn.itemSlider.setListiners(settings)};a.fn.itemSlider.settings={$container:null,$parent:null,currentPage:0,totalItems:0,scrollWidth:0,scrollWidthPerPage:0,itemWidth:0,totalItemsWidth:0};a.fn.itemSlider.setListiners=function(b){b.$parent.each(function(c,d){a(d).find("a.nav.prev").off("click.previous").on("click.previous",function(f){f.preventDefault();a.fn.itemSlider.movePrev(a(d),b)});a(d).find("a.nav.next").off("click.next").on("click.next",function(f){f.preventDefault();a.fn.itemSlider.moveNext(a(d),b)})})};a.fn.itemSlider.addButtonNav=function(b){b.$parent.each(function(c,d){if(a(d).find("a.nav.prev").length==0){a('<a href="#" class="nav prev"><span class="glyphicon glyphicon-chevron-left" aria-hidden="true"></span></a>').insertBefore(a(d).find("div.wrapper ul.product"))}if(a(d).find("a.nav.next").length==0){a('<a href="#" class="nav next"><span class="glyphicon glyphicon-chevron-right" aria-hidden="true"></span></a>').insertAfter(a(d).find("div.wrapper ul.product"))}})};a.fn.itemSlider.movePrev=function(b,d){d.currentPage-=1;if(d.currentPage<0){d.currentPage=0}var c=d.currentPage*(d.scrollWidthPerPage*(d.itemWidth+10));b.find("div.wrapper").animate({scrollLeft:c+"px"},500,function(){b.find("img").lazyload()})};a.fn.itemSlider.moveNext=function(b,d){d.currentPage+=1;var c=d.currentPage*(d.scrollWidthPerPage*(d.itemWidth+10));if(c>=d.totalItemsWidth){d.currentPage=0;c=d.currentPage*d.itemWidth}b.find("div.wrapper").animate({scrollLeft:c+"px"},500,function(){b.find("img").lazyload()})}})(jQuery);$(document).ready(function(){$("div.product_sort ul.product_view li").click(Product.ProductViewClick);$("select[name=sel_sort]").change(Product.SortChange);Product.InitializeAutocomplete();Product.Load();$("form.searchbox").submit(function(a){a.preventDefault();MasterPage.SubmitSearchSL(jQuery(this).find(".search_query").val())});if($(".item-not-found").length>0){$("#primary_block").remove();$(".item-not-found").empty().html("<h2>Product Not Found</h2><p>Sorry! This Product is currently not available.</p>")}$("body").delegate("button.view-details, .btn-quickview, button.view-details-bundle","click",function(b){b.preventDefault();var a=$(this).closest("[data-item]");Product.ProductModalView(a.attr("data-item"),a.attr("data-promo"))});$("body").delegate("button.view-details, .btn-product-add","click",function(a){var b=jQuery(this).closest("[data-item]");var c=parseInt(jQuery(b).find(".txtQty").val());if(isNaN(c)){c=1}c=c+1;jQuery(b).find(".txtQty").val(c)});$("body").delegate("button.view-details, .btn-product-minus","click",function(a){var b=jQuery(this).closest("[data-item]");var c=parseInt(jQuery(b).find(".txtQty").val());if(isNaN(c)){c=1}if(c>1){c=c-1}jQuery(b).find(".txtQty").val(c)});$("body").on("click","div.container-product .favourite-button",function(a){a.preventDefault();Product.AddToFavourite($(this))});Product.LoadBundle();$("div.products").each(function(a,b){$(b).attr("class",$(b).attr("class").toLowerCase())})});var RouteDataParser={Searchv2:function(b){var c=new Array();var a=b.split("/");for(ctr=2;ctr<a.length;ctr++){if(ctr==2){if(a[ctr].toLowerCase().indexOf("keyword=")==0){c.push({name:"Keyword",value:a[ctr].substring(8).trim().replace(/\+/g," ")})}else{c.push({name:"Keyword",value:""})}}}return c}};var routes=[{route:"/Searchv2",view:{url:"/ViewBS/Search.aspx",pattern:"(/[^/]+)",selector:Global.ContentContainer.selector},handler:function(a,d){$("[class$=form_search]").unbind("submit").submit(function(f){f.preventDefault();window.location.hash=MasterPage.GetSearchLink("[data-id$=txt_search_query_detailed]")});$("[data-id$=hid_searchv2_hash]").val(a);Product.SearchParameters=[];for(ctr=1;ctr<d.length;ctr++){if(d[ctr].indexOf("=")>=0){var b=d[ctr].substr(1,d[ctr].indexOf("=")-1);var e=d[ctr].substr(d[ctr].indexOf("=")+1,d[ctr].length-d[ctr].indexOf("=")-1);switch(b.toLowerCase()){case"keyword":var c=e.replace(/[+]/g," ");c=c.replace("~2f","/");$("[data-id$=txt_search_query_detailed]").val(c);$("[data-id$=hid_keyword]").val(c);$("[name=search_query]").val(c);break;default:Product.SearchParameters.push({key:b,value:e});break}}}Global.fullWidthEnableOn();$(".main-slider").attr("style","");Product.Load()}},{route:["/","","/home"],view:{url:"/ViewBS/Home.aspx",selector:Global.ContentContainer.selector},handler:function(a){if(Global.nivoSlider!=null){jQuery("#slider").nivoSlider(Global.nivoSlider)}Global.showCategories();Product.Load();if(Global.cat_id==0||Global.cat_id==2554){$(".row .slider").attr("style","display:block !important;")}if(Global.cat_id==90501){$("div.slider-and-search").show()}}},{route:"/Catalogues",view:{url:"/Catalogues",selector:Global.ContentContainer.selector},handler:function(a){CatalogueView.Render(function(){if(/Catalogues\/Catalogues$/i.test(a)){$('ul.catalogue-tab a[href="#Catalogues"]').tab("show")}if(/Brochures$/i.test(a)){$('ul.catalogue-tab a[href="#Brochures"]').tab("show")}if(/MonthlySpecials/i.test(a)){$('ul.catalogue-tab a[href="#MonthlySpecials"]').tab("show")}})}},{route:"/Category",view:{url:"",selector:Global.ContentContainer.selector},handler:function(a){Global.showCategories();Product.Load()}},{route:"/Promo/",view:{url:"",selector:Global.ContentContainer.selector},handler:function(a){Global.showCategories();Product.Load()}},{route:"/Campaign",view:{url:"/ViewBS/Campaign.aspx",selector:Global.ContentContainer.selector},handler:function(a){Global.showCategories();Product.Load()}},{route:"/Contact",view:{url:"",selector:Global.ContentContainer.selector},handler:function(a){Global.showCategories();CustomerMessage.GetContactDetails()}},{route:"/MailList",view:{url:"",selector:Global.ContentContainer.selector},handler:function(a){Global.showCategories()}},{route:"/Search",view:{url:"",pattern:"/Search/(.+?)/(.+?)/(.+?)/(.+?)/(.+?)",selector:Global.ContentContainer.selector},handler:function(a,c){$("[class$=form_search]").unbind("submit").submit(function(f){f.preventDefault();window.location.hash=MasterPage.GetSearchLink("[data-id$=txt_search_query_detailed]")});if(c.length>=4){var b=c[3].replace(/[+]/g," ");$("[data-id$=txt_search_query_detailed]").val(b);$("[data-id$=hid_keyword]").val(b);$("[name=search_query]").val(b);var d=c[4].replace("Price=","").split("-");$("[data-id$=hid_price_from]").val(d[0]);$("[data-id$=hid_price_to]").val(d[1]);$("[data-id$=txt_price_from]").val(d[0]);$("[data-id$=txt_price_to]").val(d[1])}Global.fullWidthEnableOn();$(".main-slider").attr("style","");Product.Load()}},{route:"/Authentication",view:{url:"/Authentication",selector:Global.ContentContainer.selector},handler:function(a){Global.fullWidthEnableOn();Customer.InitRegister();$("#aspnetForm").submit(function(b){b.preventDefault();$.ajax({url:"/Handler/GenericMethodCall.ashx",data:[{name:"username",value:$("[id$=txt_user_name]").val()},{name:"password",value:$("[id$=txt_password]").val()},{name:"campcode",value:$("[id$=txt_campaign_code]").val()},{name:"method_name",value:"ajax-login"}],type:"POST",dataType:"json",beforeSend:function(){if($("div.loading-container").length<=0){$('<div class="loading-container"><div class="loading"></div><p class="message" style="text-align:center">Signing you in. Please wait</p></div>').insertBefore(".logincontent")}else{$("div.loading-container").show()}$(".logincontent").hide();$("#aspnetForm .errors .error-list").empty()},success:function(c){$("div.loading-container").hide();$(".logincontent").show();if(c.ERROR&&c.LIST.length>0){$("#aspnetForm .errors .error-list").append('<li class="alert alert-danger">'+c.LIST[0]+"</li>")}if(c.SUCCESS){if(c.URL!=""){location.href=c.URL}else{location.href="/"}}},error:function(){$("#aspnetForm .errors .error-list").append('<li class="alert alert-danger">Sign-in Failed. Please try again later.</li>')}})})},except:[{url:"/Authentication/logout"},{url:"/Authentication/ForgotPassword/"},{url:"/Authentication?back=%2FOneCheckout"},{url:"/Authentication/?Back=",startsWith:true}]},{callManually:true,route:"/Product",view:{url:"",selector:Global.ContentContainer.selector},handler:function(a){Global.showCategories();Product.Load()}},{route:"/Order",view:{url:"",selector:Global.ContentContainer.selector},handler:function(a){if(a=="/Order"){$("a.set-post-code").html("(Post Code: "+Global.settings.postCode+")");$.ajax({url:"/WebServices/CustomerCheckout.asmx/AllowedStep",data:'{ "step": "2" }',dataType:"json",type:"POST",async:false,success:function(b){if(!b.allowed){location.href="/ViewBS/Checkout.aspx"}}})}Global.showCategories();customerCheckout(jQuery);UC_Cart.InitializeCartSummary();UC_Cart.ViewCart()}},{route:"/Pages",view:{url:"",selector:Global.ContentContainer.selector},handler:function(c){if(c.indexOf("#")>-1){var b=c.substr(c.indexOf("#")+1);var a=$("#"+b);if(a.length>0){$("html, body").animate({scrollTop:a.offset().top},300)}}Global.fullWidthEnableOn();if(Pages!=undefined&&typeof Pages.loaded==="function"){Pages.loaded(c)}}}];jQuery(document).ready(function(){jQuery("#slider").nivoSlider(Global.nivoSlider);$.fn.livAjaxPage=function(f,e){};Global.afterLoad();ga4.SliderClickEvent();if(/\/EditCart/.test(location.href)){$("div.header-center").append("<h1 class='header'>Edit Cart</h1>")}if(/OneCheckout/.test(location.href)){jQuery("div#chatbox").css("display","none")}else{jQuery("div#chatbox").css("display","block")}if(Global.singlePage){routerManager(jQuery,routes,{route:"",view:{url:"",selector:Global.ContentContainer.selector},handler:function(e){jQuery("#slider").nivoSlider(Global.nivoSlider);CatalogueView.Render();Product.Load()}},SinglePage.complete,SinglePage.beforeSend,SinglePage.completed);$("#mini-cart-checkout").click(function(f){$("#cart-container").slideUp()})}if(location.pathname.toLowerCase().indexOf("/product/id/")>=0){ProductView.InitializeGUI();var b=$("div.item-bundle ul.other-details").attr("data-show-price")=="yes";var c=0;$("div.item-bundle [name=chkItem]:checked").each(function(e,f){c+=parseFloat($(f).attr("data-value"))});if(b){$("div.item-bundle ul.other-details span.total").html(c)}else{$("div.item-bundle ul.other-details span.total").html("Login for Trade Pricing")}$("ul.other-details button.AddToCart").click(function(){$("div.item-bundle [name=chkItem]:checked").each(function(e,g){var f=$(g).attr("data-item");UC_Cart.InsertCart("img_"+Mustache.Formatters.removeSpecialChar(f),f,1,"","R")});$('<p class="alert alert-success">Item(s) selected added to cart</p>').insertBefore("div.item-bundle ul.images")});$("div.item-bundle [name=chkItem]").change(function(){c=0;var e=$(this).attr("data-item");e=Mustache.Formatters.removeSpecialChar(e);if(!$(this).is(":checked")){$("div.item-bundle ul.images li#li_"+e).addClass("out")}else{$("div.item-bundle ul.images li#li_"+e).removeClass("out")}$("div.item-bundle [name=chkItem]:checked").each(function(g,h){c+=parseFloat($(h).attr("data-value"))});var f="Login for Trade Pricing";if(b){f="AU $"+c.toFixed(2)}$("div.item-bundle ul.other-details span.total").html(f)});$("div.item-bundle li button.quick-view").click(function(g){var f=$(this);Product.ProductModalView(f.attr("data-item"),f.attr("data-promo"))});$("div.item-bundle a.quick-view").click(function(g){g.preventDefault();var f=$(this);Product.ProductModalView(f.attr("data-item"),f.attr("data-promo"))});$("img.item-image-tile").on("mouseenter",function(){jQuery(this).closest(".image-selector").find(".image-selected").removeClass("image-selected");jQuery(this).addClass("image-selected");var e=jQuery(this).attr("data-original");$("div.image-box img").attr("src",e);$("div.image-box img").attr("data-imagezoom",e)});if($("div.item-variation-option").length){$("div.item-variation-option").find("div.item-option ul li a").off("click.optionClick").on("click.optionClick",function(g){g.preventDefault();var f=$(this);f.parent().siblings("li").removeClass("selected");f.parent().addClass("selected");var h=[];$("div.item-variation-option").find("div.item-option ul li.selected a").each(function(e,j){h.push($(j).attr("data-name")+":"+$(j).attr("data-value"))});ProductView.FilterItemVariation($("#hidItemNo").val(),h.join(";"),f.attr("data-name")+":"+f.attr("data-value"))})}}$("body").livAjaxPage();if(/\/Searchv2\//.test(location.href)){var d=location.href.replace(/.+\/Searchv2\//gi,"/Searchv2/");$("[class^=form_search]").unbind("submit").submit(function(f){f.preventDefault();window.location.hash=MasterPage.GetSearchLink("[id$=txt_search_query_detailed]")});$("#hid_searchv2_hash").val(d);var a=RouteDataParser.Searchv2(d);$.each(a,function(e,g){if(g.name=="Keyword"){var f=g.value.replace(/[+]/g," ");f=f.replace("~2f","/");$("[id$=txt_search_query_detailed]").val(f);$("[data-id$=hid_keyword]").val(f)}})}$("#tmnivoslider").css("max-height",Global.nivoSlider.maxHeight)});(function(a){var l="FILE";var t=[];var b=[];var c=[];var f=0;var m={version:"20170101",source:"FILE",slideDirection:"rtl",slideSpeed:400,backText:"Return",createHeader:true,initialSelected:0,headerClass:"hidden-xs hidden-sm",};var d="https://file.livingstone.com.au/json/categories/";var e="/WebServices/Category.asmx/GetPartialCategories";var g={dataType:"json",beforeSend:function(){jQuery(b).each(function(y,z){jQuery(z).parent().find("p.json-error").remove();jQuery(z).parent().prepend('<p class="alert alert-warning json-loading">Loading. Please wait.</p>')})},complete:function(){jQuery(b).each(function(y,z){jQuery(z).parent().find("p.json-loading").remove()})},error:function(){jQuery(b).each(function(y,z){jQuery(z).parent().prepend('<p class="alert alert-danger json-error">Failed retrieving category file.<br/><a href="#" onclick="location.reload(true)" class="btn btn-warning">Click here to refresh</a></p>')})}};var h=function(z){var A=i(z);var y=null;jQuery(b).each(function(B,C){if(A==C){y=B;return false}});return y};var i=function(z){if(jQuery(z).prop("tagName")=="NAV"&&jQuery(z).hasClass("preload-categories")){return jQuery(z)[0]}else{var y=jQuery(z).closest("nav.preload-categories");if(y.length>0){return y[0]}else{return jQuery("nav.preload-categories")}}};var j=function(z){var A=h(z);var y=null;if(A>=0){y=c[A]}return y};var k=function(y,z){a.extend(m,z);l=m.source;jQuery(y).each(function(){b.push(this)});if(m.preload){v(function(){jQuery(b).each(function(A,B){c[A]=a(B).find("ul").closest("nav").parent()});a(b).delegate("li:not(.no_child) a","click",function(A){A.preventDefault();a(this).siblings("span.grower").trigger("click")});a(b).find("li.closed span.grower").click(function(){var D=i(this);var C=h(this);var A=a(this);var B=a(this).parent().attr("id");q(B,function(E){s(A,E);if(typeof m.doneLoadFile==="function"){m.doneLoadFile()}ga4.CategoryClickEvent()})});w(m.initialSelected)})}else{jQuery(b).each(function(A,B){c[A]=a(B).parent()});a(b).find("li.no_child span.grower").remove();a(b).delegate("li:not(.no_child) a","click",function(A){A.preventDefault();a(this).siblings("span.grower").trigger("click")});a(b).find("li.closed span.grower").on("click",function(A){s(a(this))})}};var v=function(y){if(l==="FILE"){g.url=d+Global.cat_id+".json?_"+m.version}else{g.url=e;g.data='{ "cat_id" : "'+Global.cat_id+'"}';g.type="POST"}g.success=function(z){Global.LoadTemplate("#template-liv-push-menu",function(B){var A='<h4 class="'+Global.categoryHeaderStyle+" "+m.headerClass+'">'+Global.categoryHeaderText+"</h4>"+B;jQuery(b).each(function(){jQuery(this).append(Mustache.to_html(A,z))})});if(typeof y==="function"){y()}if(typeof m.doneLoadFile==="function"){m.doneLoadFile()}ga4.CategoryClickEvent()};a.ajax(g)};var q=function(z,y){if(l==="FILE"){g.url=d+z+".json?_"+m.version}else{g.url=e;g.data='{ "cat_id" : "'+z+'"}';g.type="POST"}g.success=function(A){Global.LoadTemplate("#template-liv-push-menu",function(B){if(typeof y==="function"){y(Mustache.to_html(B,A))}})};a.ajax(g)};var w=function(B){var z=location.pathname.replace("/category/","");var y=z.split("/");var A="/category";a.each(y,function(C,D){if(C<(y.length-1)){setTimeout(function(){A=A+"/"+D;var E=a("nav.preload-categories").find('a[href="'+A+'"]').siblings("span.grower");var F=a("nav.preload-categories").find('a[href="'+A+'"]').parent("li").attr("id");if(typeof F!=="undefined"){q(F,function(G){s(E,G)})}},C*500)}})};var p=function(B){var C=[];var z=B;while(true){var z=parseInt(jQuery("ul.tree.dynamized #"+z).parent().closest("li").attr("id"));if(isNaN(z)==false){C.push(z)}else{break}}var A=0;var y=0;while(true){y+=1;A=C.pop();if(A!=undefined){jQuery("ul.tree.dynamized li#"+A+" > span.grower").trigger("click")}else{break}if(y>50){break}}};var o=function(z,B){var A=B||a(this).parent().parent();var C=A.width();var y={};if(m.slideDirection==="ltr"){y={left:"+="+(C+15)+"px"}}else{y={left:"-="+(C+15)+"px"}}A.animate(y,m.slideSpeed,function(){var D="#"+t.pop();a(D).remove();if(t.length>0){var E=t[t.length-1];n(this,a("#"+E).height())}else{n(this)}})};var u=function(A){var y=a(this);var z=y.siblings("ul").attr("data-parent");if(z!=Global.cat_id){q(z,function(B){s(null,B,"pre-selected","#"+y.parent().attr("id"));o(A,y.parent());if(typeof m.doneLoadFile==="function"){m.doneLoadFile()}ga4.CategoryClickEvent()})}else{o(A,y.parent())}};var s=function(z,y,C,D){var B;if(y!=undefined){B=y}else{if(z!=null){B=z.siblings("ul").clone(true,true)}}f+=1;if(D===undefined){jQuery(i(z)).prepend("<div class='category-menu' id='menu-"+f+"'><button id='menu-a-"+f+"'>"+m.backText+"</button>")}else{a("<div class='category-menu' id='menu-"+f+"'><button id='menu-a-"+f+"'>"+m.backText+"</button>").insertAfter(D)}t.push("menu-"+f);if(C=="pre-selected"){a("button#menu-a-"+f).on("click",u)}else{a("button#menu-a-"+f).on("click",o)}var A=0;jQuery(c).each(function(F,H){var G=a(H).find("div#menu-"+f);var E=G.width();if(m.createHeader===true&&z!=null){r(G,z)}if(m.slideDirection==="ltr"){A=(E*-1)-15}else{A=E+15}G.css({"z-index":f*10,left:A}).append(B);G.find("li span.grower").click(function(){var I=a(this);var J=a(this).parent().attr("id");q(J,function(K){s(I,K);if(typeof m.doneLoadFile==="function"){m.doneLoadFile()}ga4.CategoryClickEvent()})});if(m.slideDirection==="ltr"){G.animate({left:"+="+(E+15)+"px"},m.slideSpeed)}else{G.animate({left:"-="+(E+15)+"px"},m.slideSpeed)}n(b[F],G.height())})};var r=function(B,y){var z=a(y).siblings("a").text();var A=a(y).siblings("a").attr("href");if(A==undefined||A==""){B.append("<h4 class='menu-header'>"+z+"</h4>")}else{B.append("<h4 class='menu-header'><a href='"+A+"'>"+z+"</a></h4>")}};var n=function(y,z){var A=h(y);z=z||0;if(z==0){a(j(y)).css("height","");a(i(y)).css("height","")}else{a(j(y)).height(z);a(i(y)).height(z)}};a.fn.livPushMenu=function(y){k(a(this),y)}})(jQuery);(function(a){var b;var f;var h;var i={target:"",destination:"",showMenuButtonLocationSelector1:"",showMenuButtonJQueryFunction1:"",showMenuButtonLocationSelector2:"",showMenuButtonJQueryFunction2:"",showMenuButtonLocationSelector3:"",showMenuButtonJQueryFunction3:"",};var e=function(j,k){a.extend(i,k);f=j.selector;b=j;b.prepend('<button type="button" class="close" style="display:none;">x</button>');b.removeClass("opened").addClass("closed");d();c();g();a(window).resize(function(){clearTimeout(h);h=setTimeout(function(){g()},250)})};var g=function(){var j=a(window).width();if(j<768&&a(i.target+" "+f).length>0){a(i.target+" "+f).prependTo(i.destination);a(f+" button.close").show();a("#btnCategories").show();return}if(j>=768&&a(i.destination+" "+f).length>0){a(i.destination+" "+f).prependTo(i.target);a(f+" button.close").hide();a("#btnCategories").hide()}};var d=function(){var j='<button class="btn btn-default" id="btnCategories" style="display:none;">Product Categories</button>';if(i.showMenuButtonLocationSelector1!=""&&a(i.showMenuButtonLocationSelector1).length>0){a(i.showMenuButtonLocationSelector1)[i.showMenuButtonJQueryFunction1](j)}else{if(i.showMenuButtonLocationSelector2!=""&&a(i.showMenuButtonLocationSelector2).length>0){a(i.showMenuButtonLocationSelector2)[i.showMenuButtonJQueryFunction2](j)}else{if(i.showMenuButtonLocationSelector3!=""&&a(i.showMenuButtonLocationSelector3).length>0){a(i.showMenuButtonLocationSelector3)[i.showMenuButtonJQueryFunction3](j)}else{throw"Can not find the location of Show Menu Button"}}}a("#btnCategories").click(function(){if(b.is("opened")){b.removeClass("opened").addClass("closed")}else{b.removeClass("closed").addClass("opened")}})};var c=function(){a(f+" button.close").click(function(){var j=a(i.destination+" > "+f);if(j.is(".opened")){j.removeClass("opened").addClass("closed")}else{j.removeClass("closed").addClass("opened")}})};a.fn.livSlideMenu=function(j){if(a(this).length>0){e(a(this),j)}}})(jQuery);jQuery(window).load(function(){Hook.Execute();window.loaded=true;if($("#tmnivoslider").length>0&&Global.showMaximumBenefit){$("div#slider div.nivo-caption").remove()}});