Guest User

Shitfuck

a guest
Oct 16th, 2016
133
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. (function(e,i){var E,be,c=typeof i,si=e.location,n=e.document,oe=n.documentElement,ii=e.jQuery,ti=e.$,j={},b=[],K='1.10.2',ue=b.concat,X=b.push,p=b.slice,Ne=b.indexOf,li=j.toString,w=j.hasOwnProperty,U=K.trim,t=function(e,i){return new t.fn.init(e,i,be)},I=/[+-]?(?:\d*\.|)\d+(?:[eE][+-]?\d+|)/.source,l=/\S+/g,ei=/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,Zt=/^(?:\s*(<[\w\W]+>)[^>]*|#([\w-]*))$/,Ce=/^<(\w+)\s*\/?>(?:<\/\1>|)$/,Xt=/^[\],:{}\s]*$/,Ut=/(?:^|:|,)(?:\s*\[)+/g,Yt=/\\(?:["\\\/bfnrt]|u[\da-fA-F]{4})/g,qt=/"[^"\\\r\n]*"|true|false|null|-?(?:\d+\.|)\d+(?:[eE][+-]?\d+|)/g,Qt=/^-ms-/,Jt=/-([\da-z])/gi,Gt=function(e,t){return t.toUpperCase()},f=function(e){if(n.addEventListener||e.type==='load'||n.readyState==='complete'){de();t.ready()}},de=function(){if(n.addEventListener){n.removeEventListener('DOMContentLoaded',f,!1);e.removeEventListener('load',f,!1)}else{n.detachEvent('onreadystatechange',f);e.detachEvent('onload',f)}};t.fn=t.prototype={jquery:K,constructor:t,init:function(e,s,r){var o,a;if(!e){return this};if(typeof e==='string'){if(e.charAt(0)==='<'&&e.charAt(e.length- 1)==='>'&&e.length>=3){o=[null,e,null]}else{o=Zt.exec(e)};if(o&&(o[1]||!s)){if(o[1]){s=s instanceof t?s[0]:s;t.merge(this,t.parseHTML(o[1],s&&s.nodeType?s.ownerDocument||s:n,!0));if(Ce.test(o[1])&&t.isPlainObject(s)){for(o in s){if(t.isFunction(this[o])){this[o](s[o])}else{this.attr(o,s[o])}}};return this}else{a=n.getElementById(o[2]);if(a&&a.parentNode){if(a.id!==o[2]){return r.find(e)};this.length=1;this[0]=a};this.context=n;this.selector=e;return this}}else if(!s||s.jquery){return(s||r).find(e)}else{return this.constructor(s).find(e)}}else if(e.nodeType){this.context=this[0]=e;this.length=1;return this}else if(t.isFunction(e)){return r.ready(e)};if(e.selector!==i){this.selector=e.selector;this.context=e.context};return t.makeArray(e,this)},selector:'',length:0,toArray:function(){return p.call(this)},get:function(e){return e==null?this.toArray():(e<0?this[this.length+ e]:this[e])},pushStack:function(e){var i=t.merge(this.constructor(),e);i.prevObject=this;i.context=this.context;return i},each:function(e,i){return t.each(this,e,i)},ready:function(e){t.ready.promise().done(e);return this},slice:function(){return this.pushStack(p.apply(this,arguments))},first:function(){return this.eq(0)},last:function(){return this.eq(-1)},eq:function(e){var i=this.length,t=+e+(e<0?i:0);return this.pushStack(t>=0&&t<i?[this[t]]:[])},map:function(e){return this.pushStack(t.map(this,function(t,i){return e.call(t,i,t)}))},end:function(){return this.prevObject||this.constructor(null)},push:X,sort:[].sort,splice:[].splice};t.fn.init.prototype=t.fn;t.extend=t.fn.extend=function(){var s,u,n,o,l,c,e=arguments[0]||{},r=1,f=arguments.length,a=!1;if(typeof e==='boolean'){a=e;e=arguments[1]||{};r=2};if(typeof e!=='object'&&!t.isFunction(e)){e={}};if(f===r){e=this;--r};for(;r<f;r++){if((l=arguments[r])!=null){for(o in l){s=e[o];n=l[o];if(e===n){continue};if(a&&n&&(t.isPlainObject(n)||(u=t.isArray(n)))){if(u){u=!1;c=s&&t.isArray(s)?s:[]}else{c=s&&t.isPlainObject(s)?s:{}};e[o]=t.extend(a,c,n)}else if(n!==i){e[o]=n}}}};return e};t.extend({expando:'jQuery'+(K+ Math.random()).replace(/\D/g,''),noConflict:function(i){if(e.$===t){e.$=ti};if(i&&e.jQuery===t){e.jQuery=ii};return t},isReady:!1,readyWait:1,holdReady:function(e){if(e){t.readyWait++}else{t.ready(!0)}},ready:function(e){if(e===!0?--t.readyWait:t.isReady){return};if(!n.body){return setTimeout(t.ready)};t.isReady=!0;if(e!==!0&&--t.readyWait>0){return};E.resolveWith(n,[t]);if(t.fn.trigger){t(n).trigger('ready').off('ready')}},isFunction:function(e){return t.type(e)==='function'},isArray:Array.isArray||function(e){return t.type(e)==='array'},isWindow:function(e){return e!=null&&e==e.window},isNumeric:function(e){return!isNaN(parseFloat(e))&&isFinite(e)},type:function(e){if(e==null){return String(e)};return typeof e==='object'||typeof e==='function'?j[li.call(e)]||'object':typeof e},isPlainObject:function(e){var s;if(!e||t.type(e)!=='object'||e.nodeType||t.isWindow(e)){return!1};try{if(e.constructor&&!w.call(e,'constructor')&&!w.call(e.constructor.prototype,'isPrototypeOf')){return!1}}catch(n){return!1};if(t.support.ownLast){for(s in e){return w.call(e,s)}};for(s in e){};return s===i||w.call(e,s)},isEmptyObject:function(e){var t;for(t in e){return!1};return!0},error:function(e){throw new Error(e);},parseHTML:function(e,i,s){if(!e||typeof e!=='string'){return null};if(typeof i==='boolean'){s=i;i=!1};i=i||n;var r=Ce.exec(e),o=!s&&[];if(r){return[i.createElement(r[1])]};r=t.buildFragment([e],i,o);if(o){t(o).remove()};return t.merge([],r.childNodes)},parseJSON:function(i){if(e.JSON&&e.JSON.parse){return e.JSON.parse(i)};if(i===null){return i};if(typeof i==='string'){i=t.trim(i);if(i){if(Xt.test(i.replace(Yt,'@').replace(qt,']').replace(Ut,''))){return(new Function('return '+ i))()}}};t.error('Invalid JSON: '+ i)},parseXML:function(n){var r,o;if(!n||typeof n!=='string'){return null};try{if(e.DOMParser){o=new DOMParser();r=o.parseFromString(n,'text/xml')}else{r=new ActiveXObject('Microsoft.XMLDOM');r.async='false';r.loadXML(n)}}catch(s){r=i};if(!r||!r.documentElement||r.getElementsByTagName('parsererror').length){t.error('Invalid XML: '+ n)};return r},noop:function(){},globalEval:function(i){if(i&&t.trim(i)){(e.execScript||function(t){e['eval'].call(e,t)})(i)}},camelCase:function(e){return e.replace(Qt,'ms-').replace(Jt,Gt)},nodeName:function(e,t){return e.nodeName&&e.nodeName.toLowerCase()===t.toLowerCase()},each:function(e,t,i){var s,n=0,o=e.length,r=Q(e);if(i){if(r){for(;n<o;n++){s=t.apply(e[n],i);if(s===!1){break}}}else{for(n in e){s=t.apply(e[n],i);if(s===!1){break}}}}else{if(r){for(;n<o;n++){s=t.call(e[n],n,e[n]);if(s===!1){break}}}else{for(n in e){s=t.call(e[n],n,e[n]);if(s===!1){break}}}};return e},trim:U&&!U.call('\uFEFF\xA0')?function(e){return e==null?'':U.call(e)}:function(e){return e==null?'':(e+'').replace(ei,'')},makeArray:function(e,i){var n=i||[];if(e!=null){if(Q(Object(e))){t.merge(n,typeof e==='string'?[e]:e)}else{X.call(n,e)}};return n},inArray:function(e,t,i){var n;if(t){if(Ne){return Ne.call(t,e,i)};n=t.length;i=i?i<0?Math.max(0,n+ i):i:0;for(;i<n;i++){if(i in t&&t[i]===e){return i}}};return-1},merge:function(e,t){var r=t.length,s=e.length,n=0;if(typeof r==='number'){for(;n<r;n++){e[s++]=t[n]}}else{while(t[n]!==i){e[s++]=t[n++]}};e.length=s;return e},grep:function(e,t,i){var s,r=[],n=0,o=e.length;i=!!i;for(;n<o;n++){s=!!t(e[n],n);if(i!==s){r.push(e[n])}};return r},map:function(e,t,i){var s,n=0,a=e.length,o=Q(e),r=[];if(o){for(;n<a;n++){s=t(e[n],n,i);if(s!=null){r[r.length]=s}}}else{for(n in e){s=t(e[n],n,i);if(s!=null){r[r.length]=s}}};return ue.apply([],r)},guid:1,proxy:function(e,n){var o,s,r;if(typeof n==='string'){r=e[n];n=e;e=r};if(!t.isFunction(e)){return i};o=p.call(arguments,2);s=function(){return e.apply(n||this,o.concat(p.call(arguments)))};s.guid=e.guid=e.guid||t.guid++;return s},access:function(e,n,s,r,o,c,l){var a=0,f=e.length,u=s==null;if(t.type(s)==='object'){o=!0;for(a in s){t.access(e,n,a,s[a],!0,c,l)}}else if(r!==i){o=!0;if(!t.isFunction(r)){l=!0};if(u){if(l){n.call(e,r);n=null}else{u=n;n=function(e,i,n){return u.call(t(e),n)}}};if(n){for(;a<f;a++){n(e[a],s,l?r:r.call(e[a],a,n(e[a],s)))}}};return o?e:u?n.call(e):f?n(e[0],s):c},now:function(){return(new Date()).getTime()},swap:function(e,t,i,n){var o,s,r={};for(s in t){r[s]=e.style[s];e.style[s]=t[s]};o=i.apply(e,n||[]);for(s in t){e.style[s]=r[s]};return o}});t.ready.promise=function(i){if(!E){E=t.Deferred();if(n.readyState==='complete'){setTimeout(t.ready)}else if(n.addEventListener){n.addEventListener('DOMContentLoaded',f,!1);e.addEventListener('load',f,!1)}else{n.attachEvent('onreadystatechange',f);e.attachEvent('onload',f);var r=!1;try{r=e.frameElement==null&&n.documentElement}catch(s){};if(r&&r.doScroll){(function o(){if(!t.isReady){try{r.doScroll('left')}catch(e){return setTimeout(o,50)};de();t.ready()}})()}}};return E.promise(i)};t.each('Boolean Number String Function Array Date RegExp Object Error'.split(' '),function(e,t){j['[object '+ t+']']=t.toLowerCase()});function Q(e){var i=e.length,n=t.type(e);if(t.isWindow(e)){return!1};if(e.nodeType===1&&i){return!0};return n==='array'||n!=='function'&&(i===0||typeof i==='number'&&i>0&&(i- 1)in e)};be=t(n);(function(e,i){var j,a,W,s,H,te,U,F,k,x,c,p,d,u,S,O,N,l='sizzle'+-(new Date()),m=e.document,g=0,me=0,ce=X(),ee=X(),re=X(),D=!1,Y=function(e,t){if(e===t){D=!0;return 0};return 0},A=typeof i,ne=1<<31,ye=({}).hasOwnProperty,v=[],be=v.pop,ve=v.push,b=v.push,se=v.slice,C=v.indexOf||function(e){var t=0,i=this.length;for(;t<i;t++){if(this[t]===e){return t}};return-1},V='checked|selected|async|autofocus|autoplay|controls|defer|disabled|hidden|ismap|loop|multiple|open|readonly|required|scoped',o='[\\x20\\t\\r\\n\\f]',P='(?:\\\\.|[\\w-]|[^\\x00-\\xa0])+',le=P.replace('w','w#'),ae='\\['+ o+'*('+ P+')'+ o+'*(?:([*^$|!~]?=)'+ o+'*(?:([\'"])((?:\\\\.|[^\\\\])*?)\\3|('+ le+')|)|)'+ o+'*\\]',G=':('+ P+')(?:\\((([\'"])((?:\\\\.|[^\\\\])*?)\\3|((?:\\\\.|[^\\\\()[\\]]|'+ ae.replace(3,8)+')*)|.*)\\)|)',L=new RegExp('^'+ o+'+|((?:^|[^\\\\])(?:\\\\.)*)'+ o+'+$','g'),ge=new RegExp('^'+ o+'*,'+ o+'*'),we=new RegExp('^'+ o+'*([>+~]|'+ o+')'+ o+'*'),K=new RegExp(o+'*[+~]'),xe=new RegExp('='+ o+'*([^\\]\'"]*)'+ o+'*\\]','g'),De=new RegExp(G),Se=new RegExp('^'+ le+'$'),M={'ID':new RegExp('^#('+ P+')'),'CLASS':new RegExp('^\\.('+ P+')'),'TAG':new RegExp('^('+ P.replace('w','w*')+')'),'ATTR':new RegExp('^'+ ae),'PSEUDO':new RegExp('^'+ G),'CHILD':new RegExp('^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\('+ o+'*(even|odd|(([+-]|)(\\d*)n|)'+ o+'*(?:([+-]|)'+ o+'*(\\d+)|))'+ o+'*\\)|)','i'),'bool':new RegExp('^(?:'+ V+')$','i'),'needsContext':new RegExp('^'+ o+'*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\('+ o+'*((?:-\\d)?\\d*)'+ o+'*\\)|)(?=[^-]|$)','i')},Q=/^[^{]+\{\s*\[native \w/,pe=/^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/,Te=/^(?:input|select|textarea|button)$/i,ke=/^h\d$/i,Ce=/'|\\/g,y=new RegExp('\\\\([\\da-f]{1,6}'+ o+'?|('+ o+')|.)','ig'),w=function(e,t,i){var n='0x'+ t- 0x10000;return n!==n||i?t:n<0?String.fromCharCode(n+ 0x10000):String.fromCharCode(n>>10|0xD800,n&0x3FF|0xDC00)};try{b.apply((v=se.call(m.childNodes)),m.childNodes);v[m.childNodes.length].nodeType}catch(n){b={apply:v.length?function(e,t){ve.apply(e,se.call(t))}:function(e,t){var i=e.length,n=0;while((e[i++]=t[n++])){};e.length=i- 1}}};function r(e,t,i,n){var w,r,o,p,y,h,v,f,k,g;if((t?t.ownerDocument||t:m)!==c){x(t)};t=t||c;i=i||[];if(!e||typeof e!=='string'){return i};if((p=t.nodeType)!==1&&p!==9){return[]};if(d&&!n){if((w=pe.exec(e))){if((o=w[1])){if(p===9){r=t.getElementById(o);if(r&&r.parentNode){if(r.id===o){i.push(r);return i}}else{return i}}else{if(t.ownerDocument&&(r=t.ownerDocument.getElementById(o))&&N(t,r)&&r.id===o){i.push(r);return i}}}else if(w[2]){b.apply(i,t.getElementsByTagName(e));return i}else if((o=w[3])&&a.getElementsByClassName&&t.getElementsByClassName){b.apply(i,t.getElementsByClassName(o));return i}};if(a.qsa&&(!u||!u.test(e))){f=v=l;k=t;g=p===9&&e;if(p===1&&t.nodeName.toLowerCase()!=='object'){h=E(e);if((v=t.getAttribute('id'))){f=v.replace(Ce,'\\$&')}else{t.setAttribute('id',f)};f='[id=\''+ f+'\'] ';y=h.length;while(y--){h[y]=f+ I(h[y])};k=K.test(e)&&t.parentNode||t;g=h.join(',')};if(g){try{b.apply(i,k.querySelectorAll(g));return i}catch(s){}finally{if(!v){t.removeAttribute('id')}}}}};return fe(e.replace(L,'$1'),t,i,n)};function X(){var t=[];function e(i,n){if(t.push(i+=' ')>s.cacheLength){delete e[t.shift()]};return(e[i]=n)};return e};function h(e){e[l]=!0;return e};function f(e){var i=c.createElement('div');try{return!!e(i)}catch(t){return!1}finally{if(i.parentNode){i.parentNode.removeChild(i)};i=null}};function q(e,t){var n=e.split('|'),i=e.length;while(i--){s.attrHandle[n[i]]=t}};function ie(e,t){var i=t&&e,n=i&&e.nodeType===1&&t.nodeType===1&&(~t.sourceIndex||ne)-(~e.sourceIndex||ne);if(n){return n};if(i){while((i=i.nextSibling)){if(i===t){return-1}}};return e?1:-1};function Pe(e){return function(t){var i=t.nodeName.toLowerCase();return i==='input'&&t.type===e}};function ue(e){return function(t){var i=t.nodeName.toLowerCase();return(i==='input'||i==='button')&&t.type===e}};function T(e){return h(function(t){t=+t;return h(function(i,n){var s,o=e([],i.length,t),r=o.length;while(r--){if(i[(s=o[r])]){i[s]=!(n[s]=i[s])}}})})};te=r.isXML=function(e){var t=e&&(e.ownerDocument||e).documentElement;return t?t.nodeName!=='HTML':!1};a=r.support={};x=r.setDocument=function(e){var t=e?e.ownerDocument||e:m,i=t.defaultView;if(t===c||t.nodeType!==9||!t.documentElement){return c};c=t;p=t.documentElement;d=!te(t);if(i&&i.attachEvent&&i!==i.top){i.attachEvent('onbeforeunload',function(){x()})};a.attributes=f(function(e){e.className='i';return!e.getAttribute('className')});a.getElementsByTagName=f(function(e){e.appendChild(t.createComment(''));return!e.getElementsByTagName('*').length});a.getElementsByClassName=f(function(e){e.innerHTML='<div class=\'a\'></div><div class=\'a i\'></div>';e.firstChild.className='i';return e.getElementsByClassName('i').length===2});a.getById=f(function(e){p.appendChild(e).id=l;return!t.getElementsByName||!t.getElementsByName(l).length});if(a.getById){s.find['ID']=function(e,t){if(typeof t.getElementById!==A&&d){var i=t.getElementById(e);return i&&i.parentNode?[i]:[]}};s.filter['ID']=function(e){var t=e.replace(y,w);return function(e){return e.getAttribute('id')===t}}}else{delete s.find['ID'];s.filter['ID']=function(e){var t=e.replace(y,w);return function(e){var i=typeof e.getAttributeNode!==A&&e.getAttributeNode('id');return i&&i.value===t}}};s.find['TAG']=a.getElementsByTagName?function(e,t){if(typeof t.getElementsByTagName!==A){return t.getElementsByTagName(e)}}:function(e,t){var i,n=[],r=0,s=t.getElementsByTagName(e);if(e==='*'){while((i=s[r++])){if(i.nodeType===1){n.push(i)}};return n};return s};s.find['CLASS']=a.getElementsByClassName&&function(e,t){if(typeof t.getElementsByClassName!==A&&d){return t.getElementsByClassName(e)}};S=[];u=[];if((a.qsa=Q.test(t.querySelectorAll))){f(function(e){e.innerHTML='<select><option selected=\'\'></option></select>';if(!e.querySelectorAll('[selected]').length){u.push('\\['+ o+'*(?:value|'+ V+')')};if(!e.querySelectorAll(':checked').length){u.push(':checked')}});f(function(e){var i=t.createElement('input');i.setAttribute('type','hidden');e.appendChild(i).setAttribute('t','');if(e.querySelectorAll('[t^=\'\']').length){u.push('[*^$]='+ o+'*(?:\'\'|"")')};if(!e.querySelectorAll(':enabled').length){u.push(':enabled',':disabled')};e.querySelectorAll('*,:x');u.push(',.*:')})};if((a.matchesSelector=Q.test((O=p.webkitMatchesSelector||p.mozMatchesSelector||p.oMatchesSelector||p.msMatchesSelector)))){f(function(e){a.disconnectedMatch=O.call(e,'div');O.call(e,'[s!=\'\']:x');S.push('!=',G)})};u=u.length&&new RegExp(u.join('|'));S=S.length&&new RegExp(S.join('|'));N=Q.test(p.contains)||p.compareDocumentPosition?function(e,t){var n=e.nodeType===9?e.documentElement:e,i=t&&t.parentNode;return e===i||!!(i&&i.nodeType===1&&(n.contains?n.contains(i):e.compareDocumentPosition&&e.compareDocumentPosition(i)&16))}:function(e,t){if(t){while((t=t.parentNode)){if(t===e){return!0}}};return!1};Y=p.compareDocumentPosition?function(e,i){if(e===i){D=!0;return 0};var n=i.compareDocumentPosition&&e.compareDocumentPosition&&e.compareDocumentPosition(i);if(n){if(n&1||(!a.sortDetached&&i.compareDocumentPosition(e)===n)){if(e===t||N(m,e)){return-1};if(i===t||N(m,i)){return 1};return k?(C.call(k,e)- C.call(k,i)):0};return n&4?-1:1};return e.compareDocumentPosition?-1:1}:function(e,i){var s,n=0,l=e.parentNode,a=i.parentNode,o=[e],r=[i];if(e===i){D=!0;return 0}else if(!l||!a){return e===t?-1:i===t?1:l?-1:a?1:k?(C.call(k,e)- C.call(k,i)):0}else if(l===a){return ie(e,i)};s=e;while((s=s.parentNode)){o.unshift(s)};s=i;while((s=s.parentNode)){r.unshift(s)}
  2. while(o[n]===r[n]){n++};return n?ie(o[n],r[n]):o[n]===m?-1:r[n]===m?1:0};return t};r.matches=function(e,t){return r(e,null,null,t)};r.matchesSelector=function(e,t){if((e.ownerDocument||e)!==c){x(e)};t=t.replace(xe,'=\'$1\']');if(a.matchesSelector&&d&&(!S||!S.test(t))&&(!u||!u.test(t))){try{var n=O.call(e,t);if(n||a.disconnectedMatch||e.document&&e.document.nodeType!==11){return n}}catch(i){}};return r(t,c,null,[e]).length>0};r.contains=function(e,t){if((e.ownerDocument||e)!==c){x(e)};return N(e,t)};r.attr=function(e,t){if((e.ownerDocument||e)!==c){x(e)};var r=s.attrHandle[t.toLowerCase()],n=r&&ye.call(s.attrHandle,t.toLowerCase())?r(e,t,!d):i;return n===i?a.attributes||!d?e.getAttribute(t):(n=e.getAttributeNode(t))&&n.specified?n.value:null:n};r.error=function(e){throw new Error('Syntax error, unrecognized expression: '+ e);};r.uniqueSort=function(e){var s,n=[],i=0,t=0;D=!a.detectDuplicates;k=!a.sortStable&&e.slice(0);e.sort(Y);if(D){while((s=e[t++])){if(s===e[t]){i=n.push(t)}}
  3. while(i--){e.splice(n[i],1)}};return e};H=r.getText=function(e){var n,i='',s=0,t=e.nodeType;if(!t){for(;(n=e[s]);s++){i+=H(n)}}else if(t===1||t===9||t===11){if(typeof e.textContent==='string'){return e.textContent}else{for(e=e.firstChild;e;e=e.nextSibling){i+=H(e)}}}else if(t===3||t===4){return e.nodeValue};return i};s=r.selectors={cacheLength:50,createPseudo:h,match:M,attrHandle:{},find:{},relative:{'>':{dir:'parentNode',first:!0},' ':{dir:'parentNode'},'+':{dir:'previousSibling',first:!0},'~':{dir:'previousSibling'}},preFilter:{'ATTR':function(e){e[1]=e[1].replace(y,w);e[3]=(e[4]||e[5]||'').replace(y,w);if(e[2]==='~='){e[3]=' '+ e[3]+' '};return e.slice(0,4)},'CHILD':function(e){e[1]=e[1].toLowerCase();if(e[1].slice(0,3)==='nth'){if(!e[3]){r.error(e[0])};e[4]=+(e[4]?e[5]+(e[6]||1):2*(e[3]==='even'||e[3]==='odd'));e[5]=+((e[7]+ e[8])||e[3]==='odd')}else if(e[3]){r.error(e[0])};return e},'PSEUDO':function(e){var n,t=!e[5]&&e[2];if(M['CHILD'].test(e[0])){return null};if(e[3]&&e[4]!==i){e[2]=e[4]}else if(t&&De.test(t)&&(n=E(t,!0))&&(n=t.indexOf(')',t.length- n)- t.length)){e[0]=e[0].slice(0,n);e[2]=t.slice(0,n)};return e.slice(0,3)}},filter:{'TAG':function(e){var t=e.replace(y,w).toLowerCase();return e==='*'?function(){return!0}:function(e){return e.nodeName&&e.nodeName.toLowerCase()===t}},'CLASS':function(e){var t=ce[e+' '];return t||(t=new RegExp('(^|'+ o+')'+ e+'('+ o+'|$)'))&&ce(e,function(e){return t.test(typeof e.className==='string'&&e.className||typeof e.getAttribute!==A&&e.getAttribute('class')||'')})},'ATTR':function(e,t,i){return function(n){var s=r.attr(n,e);if(s==null){return t==='!='};if(!t){return!0};s+='';return t==='='?s===i:t==='!='?s!==i:t==='^='?i&&s.indexOf(i)===0:t==='*='?i&&s.indexOf(i)>-1:t==='$='?i&&s.slice(-i.length)===i:t==='~='?(' '+ s+' ').indexOf(i)>-1:t==='|='?s===i||s.slice(0,i.length+ 1)===i+'-':!1}},'CHILD':function(e,t,i,n,s){var a=e.slice(0,3)!=='nth',o=e.slice(-4)!=='last',r=t==='of-type';return n===1&&s===0?function(e){return!!e.parentNode}:function(t,i,c){var d,b,u,f,h,v,m=a!==o?'nextSibling':'previousSibling',p=t.parentNode,w=r&&t.nodeName.toLowerCase(),y=!c&&!r;if(p){if(a){while(m){u=t;while((u=u[m])){if(r?u.nodeName.toLowerCase()===w:u.nodeType===1){return!1}};v=m=e==='only'&&!v&&'nextSibling'};return!0};v=[o?p.firstChild:p.lastChild];if(o&&y){b=p[l]||(p[l]={});d=b[e]||[];h=d[0]===g&&d[1];f=d[0]===g&&d[2];u=h&&p.childNodes[h];while((u=++h&&u&&u[m]||(f=h=0)||v.pop())){if(u.nodeType===1&&++f&&u===t){b[e]=[g,h,f];break}}}else if(y&&(d=(t[l]||(t[l]={}))[e])&&d[0]===g){f=d[1]}else{while((u=++h&&u&&u[m]||(f=h=0)||v.pop())){if((r?u.nodeName.toLowerCase()===w:u.nodeType===1)&&++f){if(y){(u[l]||(u[l]={}))[e]=[g,f]};if(u===t){break}}}};f-=s;return f===n||(f%n===0&&f/n>=0)}}},'PSEUDO':function(e,t){var n,i=s.pseudos[e]||s.setFilters[e.toLowerCase()]||r.error('unsupported pseudo: '+ e);if(i[l]){return i(t)};if(i.length>1){n=[e,e,'',t];return s.setFilters.hasOwnProperty(e.toLowerCase())?h(function(e,n){var r,o=i(e,t),s=o.length;while(s--){r=C.call(e,o[s]);e[r]=!(n[r]=o[s])}}):function(e){return i(e,0,n)}};return i}},pseudos:{'not':h(function(e){var i=[],n=[],t=U(e.replace(L,'$1'));return t[l]?h(function(e,i,n,s){var o,a=t(e,null,s,[]),r=e.length;while(r--){if((o=a[r])){e[r]=!(i[r]=o)}}}):function(e,s,r){i[0]=e;t(i,null,r,n);return!n.pop()}}),'has':h(function(e){return function(t){return r(e,t).length>0}}),'contains':h(function(e){return function(t){return(t.textContent||t.innerText||H(t)).indexOf(e)>-1}}),'lang':h(function(e){if(!Se.test(e||'')){r.error('unsupported lang: '+ e)};e=e.replace(y,w).toLowerCase();return function(t){var i;do{if((i=d?t.lang:t.getAttribute('xml:lang')||t.getAttribute('lang'))){i=i.toLowerCase();return i===e||i.indexOf(e+'-')===0}}while((t=t.parentNode)&&t.nodeType===1);return!1}}),'target':function(t){var i=e.location&&e.location.hash;return i&&i.slice(1)===t.id},'root':function(e){return e===p},'focus':function(e){return e===c.activeElement&&(!c.hasFocus||c.hasFocus())&&!!(e.type||e.href||~e.tabIndex)},'enabled':function(e){return e.disabled===!1},'disabled':function(e){return e.disabled===!0},'checked':function(e){var t=e.nodeName.toLowerCase();return(t==='input'&&!!e.checked)||(t==='option'&&!!e.selected)},'selected':function(e){if(e.parentNode){e.parentNode.selectedIndex};return e.selected===!0},'empty':function(e){for(e=e.firstChild;e;e=e.nextSibling){if(e.nodeName>'@'||e.nodeType===3||e.nodeType===4){return!1}};return!0},'parent':function(e){return!s.pseudos['empty'](e)},'header':function(e){return ke.test(e.nodeName)},'input':function(e){return Te.test(e.nodeName)},'button':function(e){var t=e.nodeName.toLowerCase();return t==='input'&&e.type==='button'||t==='button'},'text':function(e){var t;return e.nodeName.toLowerCase()==='input'&&e.type==='text'&&((t=e.getAttribute('type'))==null||t.toLowerCase()===e.type)},'first':T(function(){return[0]}),'last':T(function(e,t){return[t- 1]}),'eq':T(function(e,t,i){return[i<0?i+ t:i]}),'even':T(function(e,t){var i=0;for(;i<t;i+=2){e.push(i)};return e}),'odd':T(function(e,t){var i=1;for(;i<t;i+=2){e.push(i)};return e}),'lt':T(function(e,t,i){var n=i<0?i+ t:i;for(;--n>=0;){e.push(n)};return e}),'gt':T(function(e,t,i){var n=i<0?i+ t:i;for(;++n<t;){e.push(n)};return e})}};s.pseudos['nth']=s.pseudos['eq'];for(j in{radio:!0,checkbox:!0,file:!0,password:!0,image:!0}){s.pseudos[j]=Pe(j)};for(j in{submit:!0,reset:!0}){s.pseudos[j]=ue(j)};function oe(){};oe.prototype=s.filters=s.pseudos;s.setFilters=new oe();function E(e,t){var o,n,c,a,i,u,l,f=ee[e+' '];if(f){return t?0:f.slice(0)};i=e;u=[];l=s.preFilter;while(i){if(!o||(n=ge.exec(i))){if(n){i=i.slice(n[0].length)||i};u.push(c=[])};o=!1;if((n=we.exec(i))){o=n.shift();c.push({value:o,type:n[0].replace(L,' ')});i=i.slice(o.length)};for(a in s.filter){if((n=M[a].exec(i))&&(!l[a]||(n=l[a](n)))){o=n.shift();c.push({value:o,type:a,matches:n});i=i.slice(o.length)}};if(!o){break}};return t?i.length:i?r.error(e):ee(e,u).slice(0)};function I(e){var t=0,n=e.length,i='';for(;t<n;t++){i+=e[t].value};return i};function R(e,t,i){var n=t.dir,s=i&&n==='parentNode',r=me++;return t.first?function(t,i,r){while((t=t[n])){if(t.nodeType===1||s){return e(t,i,r)}}}:function(t,i,o){var u,a,c,f=g+' '+ r;if(o){while((t=t[n])){if(t.nodeType===1||s){if(e(t,i,o)){return!0}}}}else{while((t=t[n])){if(t.nodeType===1||s){c=t[l]||(t[l]={});if((a=c[n])&&a[0]===f){if((u=a[1])===!0||u===W){return u===!0}}else{a=c[n]=[f];a[1]=e(t,i,o)||W;if(a[1]===!0){return!0}}}}}}};function B(e){return e.length>1?function(t,i,n){var s=e.length;while(s--){if(!e[s](t,i,n)){return!1}};return!0}:e[0]};function z(e,t,i,n,s){var o,a=[],r=0,c=e.length,l=t!=null;for(;r<c;r++){if((o=e[r])){if(!i||i(o,n,s)){a.push(o);if(l){t.push(r)}}}};return a};function J(e,t,i,n,s,r){if(n&&!n[l]){n=J(n)};if(s&&!s[l]){s=J(s,r)};return h(function(r,o,a,l){var f,u,h,m=[],p=[],v=o.length,g=r||he(t||'*',a.nodeType?[a]:a,[]),d=e&&(r||!t)?z(g,m,e,a,l):g,c=i?s||(r?e:v||n)?[]:o:d;if(i){i(d,c,a,l)};if(n){f=z(c,p);n(f,[],a,l);u=f.length;while(u--){if((h=f[u])){c[p[u]]=!(d[p[u]]=h)}}};if(r){if(s||e){if(s){f=[];u=c.length;while(u--){if((h=c[u])){f.push((d[u]=h))}};s(null,(c=[]),f,l)};u=c.length;while(u--){if((h=c[u])&&(f=s?C.call(r,h):m[u])>-1){r[f]=!(o[f]=h)}}}}else{c=z(c===o?c.splice(v,c.length):c);if(s){s(null,o,c,l)}else{b.apply(o,c)}}})};function Z(e){var c,n,i,o=e.length,a=s.relative[e[0].type],u=a||s.relative[' '],t=a?1:0,f=R(function(e){return e===c},u,!0),h=R(function(e){return C.call(c,e)>-1},u,!0),r=[function(e,t,i){return(!a&&(i||t!==F))||((c=t).nodeType?f(e,t,i):h(e,t,i))}];for(;t<o;t++){if((n=s.relative[e[t].type])){r=[R(B(r),n)]}else{n=s.filter[e[t].type].apply(null,e[t].matches);if(n[l]){i=++t;for(;i<o;i++){if(s.relative[e[i].type]){break}};return J(t>1&&B(r),t>1&&I(e.slice(0,t- 1).concat({value:e[t- 2].type===' '?'*':''})).replace(L,'$1'),n,t<i&&Z(e.slice(t,i)),i<o&&Z((e=e.slice(i))),i<o&&I(e))};r.push(n)}};return B(r)};function de(e,t){var o=0,i=t.length>0,a=e.length>0,n=function(n,l,u,f,h){var p,w,y,m=[],v=0,d='0',k=n&&[],x=h!=null,T=F,S=n||a&&s.find['TAG']('*',h&&l.parentNode||l),C=(g+=T==null?1:Math.random()||0.1);if(x){F=l!==c&&l;W=o};for(;(p=S[d])!=null;d++){if(a&&p){w=0;while((y=e[w++])){if(y(p,l,u)){f.push(p);break}};if(x){g=C;W=++o}};if(i){if((p=!y&&p)){v--};if(n){k.push(p)}}};v+=d;if(i&&d!==v){w=0;while((y=t[w++])){y(k,m,l,u)};if(n){if(v>0){while(d--){if(!(k[d]||m[d])){m[d]=be.call(f)}}};m=z(m)};b.apply(f,m);if(x&&!n&&m.length>0&&(v+ t.length)>1){r.uniqueSort(f)}};if(x){g=C;F=T};return k};return i?h(n):n};U=r.compile=function(e,t){var n,s=[],r=[],i=re[e+' '];if(!i){if(!t){t=E(e)};n=t.length;while(n--){i=Z(t[n]);if(i[l]){s.push(i)}else{r.push(i)}};i=re(e,de(r,s))};return i};function he(e,t,i){var n=0,s=t.length;for(;n<s;n++){r(e,t[n],i)};return i};function fe(e,t,i,n){var c,r,o,u,f,l=E(e);if(!n){if(l.length===1){r=l[0]=l[0].slice(0);if(r.length>2&&(o=r[0]).type==='ID'&&a.getById&&t.nodeType===9&&d&&s.relative[r[1].type]){t=(s.find['ID'](o.matches[0].replace(y,w),t)||[])[0];if(!t){return i};e=e.slice(r.shift().value.length)};c=M['needsContext'].test(e)?0:r.length;while(c--){o=r[c];if(s.relative[(u=o.type)]){break};if((f=s.find[u])){if((n=f(o.matches[0].replace(y,w),K.test(r[0].type)&&t.parentNode||t))){r.splice(c,1);e=n.length&&I(r);if(!e){b.apply(i,n);return i};break}}}}};U(e,l)(n,t,!d,i,K.test(e));return i};a.sortStable=l.split('').sort(Y).join('')===l;a.detectDuplicates=D;x();a.sortDetached=f(function(e){return e.compareDocumentPosition(c.createElement('div'))&1});if(!f(function(e){e.innerHTML='<a href=\'#\'></a>';return e.firstChild.getAttribute('href')==='#'})){q('type|href|height|width',function(e,t,i){if(!i){return e.getAttribute(t,t.toLowerCase()==='type'?1:2)}})};if(!a.attributes||!f(function(e){e.innerHTML='<input/>';e.firstChild.setAttribute('value','');return e.firstChild.getAttribute('value')===''})){q('value',function(e,t,i){if(!i&&e.nodeName.toLowerCase()==='input'){return e.defaultValue}})};if(!f(function(e){return e.getAttribute('disabled')==null})){q(V,function(e,t,i){var n;if(!i){return(n=e.getAttributeNode(t))&&n.specified?n.value:e[t]===!0?t.toLowerCase():null}})};t.find=r;t.expr=r.selectors;t.expr[':']=t.expr.pseudos;t.unique=r.uniqueSort;t.text=r.getText;t.isXMLDoc=r.isXML;t.contains=r.contains})(e);var pe={};function ui(e){var i=pe[e]={};t.each(e.match(l)||[],function(e,t){i[t]=!0});return i};t.Callbacks=function(e){e=typeof e==='string'?(pe[e]||ui(e)):t.extend({},e);var l,r,f,a,o,h,n=[],s=!e.once&&[],u=function(t){r=e.memory&&t;f=!0;o=h||0;h=0;a=n.length;l=!0;for(;n&&o<a;o++){if(n[o].apply(t[0],t[1])===!1&&e.stopOnFalse){r=!1;break}};l=!1;if(n){if(s){if(s.length){u(s.shift())}}else if(r){n=[]}else{c.disable()}}},c={add:function(){if(n){var i=n.length;(function s(i){t.each(i,function(i,r){var o=t.type(r);if(o==='function'){if(!e.unique||!c.has(r)){n.push(r)}}else if(r&&r.length&&o!=='string'){s(r)}})})(arguments);if(l){a=n.length}else if(r){h=i;u(r)}};return this},remove:function(){if(n){t.each(arguments,function(e,i){var s;while((s=t.inArray(i,n,s))>-1){n.splice(s,1);if(l){if(s<=a){a--};if(s<=o){o--}}}})};return this},has:function(e){return e?t.inArray(e,n)>-1:!!(n&&n.length)},empty:function(){n=[];a=0;return this},disable:function(){n=s=r=i;return this},disabled:function(){return!n},lock:function(){s=i;if(!r){c.disable()};return this},locked:function(){return!s},fireWith:function(e,t){if(n&&(!f||s)){t=t||[];t=[e,t.slice?t.slice():t];if(l){s.push(t)}else{u(t)}};return this},fire:function(){c.fireWith(this,arguments);return this},fired:function(){return!!f}};return c};t.extend({Deferred:function(e){var s=[['resolve','done',t.Callbacks('once memory'),'resolved'],['reject','fail',t.Callbacks('once memory'),'rejected'],['notify','progress',t.Callbacks('memory')]],r='pending',n={state:function(){return r},always:function(){i.done(arguments).fail(arguments);return this},then:function(){var e=arguments;return t.Deferred(function(r){t.each(s,function(s,o){var l=o[0],a=t.isFunction(e[s])&&e[s];i[o[1]](function(){var e=a&&a.apply(this,arguments);if(e&&t.isFunction(e.promise)){e.promise().done(r.resolve).fail(r.reject).progress(r.notify)}else{r[l+'With'](this===n?r.promise():this,a?[e]:arguments)}})});e=null}).promise()},promise:function(e){return e!=null?t.extend(e,n):n}},i={};n.pipe=n.then;t.each(s,function(e,t){var o=t[2],a=t[3];n[t[1]]=o.add;if(a){o.add(function(){r=a},s[e^1][2].disable,s[2][2].lock)};i[t[0]]=function(){i[t[0]+'With'](this===i?n:this,arguments);return this};i[t[0]+'With']=o.fireWith});n.promise(i);if(e){e.call(i,i)};return i},when:function(e){var i=0,s=p.call(arguments),n=s.length,o=n!==1||(e&&t.isFunction(e.promise))?n:0,r=o===1?e:t.Deferred(),c=function(e,t,i){return function(n){t[e]=this;i[e]=arguments.length>1?p.call(arguments):n;if(i===l){r.notifyWith(t,i)}else if(!(--o)){r.resolveWith(t,i)}}},l,u,a;if(n>1){l=new Array(n);u=new Array(n);a=new Array(n);for(;i<n;i++){if(s[i]&&t.isFunction(s[i].promise)){s[i].promise().done(c(i,a,s)).fail(r.reject).progress(c(i,u,l))}else{--o}}};if(!o){r.resolveWith(a,s)};return r.promise()}});t.support=(function(i){var p,a,o,f,u,h,d,m,l,r=n.createElement('div');r.setAttribute('className','t');r.innerHTML='  <link/><table></table><a href=\'/a\'>a</a><input type=\'checkbox\'/>';p=r.getElementsByTagName('*')||[];a=r.getElementsByTagName('a')[0];if(!a||!a.style||!p.length){return i};f=n.createElement('select');h=f.appendChild(n.createElement('option'));o=r.getElementsByTagName('input')[0];a.style.cssText='top:1px;float:left;opacity:.5';i.getSetAttribute=r.className!=='t';i.leadingWhitespace=r.firstChild.nodeType===3;i.tbody=!r.getElementsByTagName('tbody').length;i.htmlSerialize=!!r.getElementsByTagName('link').length;i.style=/top/.test(a.getAttribute('style'));i.hrefNormalized=a.getAttribute('href')==='/a';i.opacity=/^0.5/.test(a.style.opacity);i.cssFloat=!!a.style.cssFloat;i.checkOn=!!o.value;i.optSelected=h.selected;i.enctype=!!n.createElement('form').enctype;i.html5Clone=n.createElement('nav').cloneNode(!0).outerHTML!=='<:nav></:nav>';i.inlineBlockNeedsLayout=!1;i.shrinkWrapBlocks=!1;i.pixelPosition=!1;i.deleteExpando=!0;i.noCloneEvent=!0;i.reliableMarginRight=!0;i.boxSizingReliable=!0;o.checked=!0;i.noCloneChecked=o.cloneNode(!0).checked;f.disabled=!0;i.optDisabled=!h.disabled;try{delete r.test}catch(s){i.deleteExpando=!1};o=n.createElement('input');o.setAttribute('value','');i.input=o.getAttribute('value')==='';o.value='t';o.setAttribute('type','radio');i.radioValue=o.value==='t';o.setAttribute('checked','t');o.setAttribute('name','t');u=n.createDocumentFragment();u.appendChild(o);i.appendChecked=o.checked;i.checkClone=u.cloneNode(!0).cloneNode(!0).lastChild.checked;if(r.attachEvent){r.attachEvent('onclick',function(){i.noCloneEvent=!1});r.cloneNode(!0).click()};for(l in{submit:!0,change:!0,focusin:!0}){r.setAttribute(d='on'+ l,'t');i[l+'Bubbles']=d in e||r.attributes[d].expando===!1};r.style.backgroundClip='content-box';r.cloneNode(!0).style.backgroundClip='';i.clearCloneStyle=r.style.backgroundClip==='content-box';for(l in t(i)){break};i.ownLast=l!=='0';t(function(){var l,o,s,u='padding:0;margin:0;border:0;display:block;box-sizing:content-box;-moz-box-sizing:content-box;-webkit-box-sizing:content-box;',a=n.getElementsByTagName('body')[0];if(!a){return};l=n.createElement('div');l.style.cssText='border:0;width:0;height:0;position:absolute;top:0;left:-9999px;margin-top:1px';a.appendChild(l).appendChild(r);r.innerHTML='<table><tr><td></td><td>t</td></tr></table>';s=r.getElementsByTagName('td');s[0].style.cssText='padding:0;margin:0;border:0;display:none';m=(s[0].offsetHeight===0);s[0].style.display='';s[1].style.display='none';i.reliableHiddenOffsets=m&&(s[0].offsetHeight===0);r.innerHTML='';r.style.cssText='box-sizing:border-box;-moz-box-sizing:border-box;-webkit-box-sizing:border-box;padding:1px;border:1px;display:block;width:4px;margin-top:1%;position:absolute;top:1%;';t.swap(a,a.style.zoom!=null?{zoom:1}:{},function(){i.boxSizing=r.offsetWidth===4});if(e.getComputedStyle){i.pixelPosition=(e.getComputedStyle(r,null)||{}).top!=='1%';i.boxSizingReliable=(e.getComputedStyle(r,null)||{width:'4px'}).width==='4px';o=r.appendChild(n.createElement('div'));o.style.cssText=r.style.cssText=u;o.style.marginRight=o.style.width='0';r.style.width='1px';i.reliableMarginRight=!parseFloat((e.getComputedStyle(o,null)||{}).marginRight)};if(typeof r.style.zoom!==c){r.innerHTML='';r.style.cssText=u+'width:1px;padding:1px;display:inline;zoom:1';i.inlineBlockNeedsLayout=(r.offsetWidth===3);r.style.display='block';r.innerHTML='<div></div>';r.firstChild.style.width='5px';i.shrinkWrapBlocks=(r.offsetWidth!==3);if(i.inlineBlockNeedsLayout){a.style.zoom=1}};a.removeChild(l);l=r=s=o=null});p=f=u=h=a=o=null;return i})({});var Dt=/(?:\{[\s\S]*\}|\[[\s\S]*\])$/,Rt=/([A-Z])/g;function me(e,n,s,r){if(!t.acceptData(e)){return};var c,a,u=t.expando,f=e.nodeType,l=f?t.cache:e,o=f?e[u]:e[u]&&u;if((!o||!l[o]||(!r&&!l[o].data))&&s===i&&typeof n==='string'){return};if(!o){if(f){o=e[u]=b.pop()||t.guid++}else{o=u}};if(!l[o]){l[o]=f?{}:{toJSON:t.noop}};if(typeof n==='object'||typeof n==='function'){if(r){l[o]=t.extend(l[o],n)}else{l[o].data=t.extend(l[o].data,n)}};a=l[o];if(!r){if(!a.data){a.data={}};a=a.data};if(s!==i){a[t.camelCase(n)]=s};if(typeof n==='string'){c=a[n];if(c==null){c=a[t.camelCase(n)]}}else{c=a};return c};function ve(e,i,n){if(!t.acceptData(e)){return};var o,a,l=e.nodeType,s=l?t.cache:e,r=l?e[t.expando]:t.expando;if(!s[r]){return};if(i){o=n?s[r]:s[r].data;if(o){if(!t.isArray(i)){if(i in o){i=[i]}else{i=t.camelCase(i);if(i in o){i=[i]}else{i=i.split(' ')}}}else{i=i.concat(t.map(i,t.camelCase))};a=i.length;while(a--){delete o[i[a]]};if(n?!J(o):!t.isEmptyObject(o)){return}}};if(!n){delete s[r].data;if(!J(s[r])){return}};if(l){t.cleanData([e],!0)}else if(t.support.deleteExpando||s!=s.window){delete s[r]}else{s[r]=null}};t.extend({cache:{},noData:{'applet':!0,'embed':!0,'object':'clsid:D27CDB6E-AE6D-11cf-96B8-444553540000'},hasData:function(e){e=e.nodeType?t.cache[e[t.expando]]:e[t.expando];return!!e&&!J(e)},data:function(e,t,i){return me(e,t,i)},removeData:function(e,t){return ve(e,t)},i$:function(e,t,i){return me(e,t,i,!0)},he$:function(e,t){return ve(e,t,!0)},acceptData:function(e){if(e.nodeType&&e.nodeType!==1&&e.nodeType!==9){return!1};var i=e.nodeName&&t.noData[e.nodeName.toLowerCase()];return!i||i!==!0&&e.getAttribute('classid')===i}});t.fn.extend({data:function(e,n){var o,r,l=null,a=0,s=this[0];if(e===i){if(this.length){l=t.data(s);if(s.nodeType===1&&!t.i$(s,'parsedAttrs')){o=s.attributes;for(;a<o.length;a++){r=o[a].name;if(r.indexOf('data-')===0){r=t.camelCase(r.slice(5));ce(s,r,l[r])}};t.i$(s,'parsedAttrs',!0)}};return l};if(typeof e==='object'){return this.each(function(){t.data(this,e)})};return arguments.length>1?this.each(function(){t.data(this,e,n)}):s?ce(s,e,t.data(s,e)):null},removeData:function(e){return this.each(function(){t.removeData(this,e)})}});function ce(e,n,s){if(s===i&&e.nodeType===1){var o='data-'+ n.replace(Rt,'-$1').toLowerCase();s=e.getAttribute(o);if(typeof s==='string'){try{s=s==='true'?!0:s==='false'?!1:s==='null'?null:+s+''===s?+s:Dt.test(s)?t.parseJSON(s):s}catch(r){};t.data(e,n,s)}else{s=i}};return s};function J(e){var i;for(i in e){if(i==='data'&&t.isEmptyObject(e[i])){continue};if(i!=='toJSON'){return!1}};return!0};t.extend({queue:function(e,i,n){var s;if(e){i=(i||'fx')+'queue';s=t.i$(e,i);if(n){if(!s||t.isArray(n)){s=t.i$(e,i,t.makeArray(n))}else{s.push(n)}};return s||[]}},dequeue:function(e,i){i=i||'fx';var s=t.queue(e,i),o=s.length,n=s.shift(),r=t.We$(e,i),a=function(){t.dequeue(e,i)};if(n==='inprogress'){n=s.shift();o--};if(n){if(i==='fx'){s.unshift('inprogress')};delete r.stop;n.call(e,a,r)};if(!o&&r){r.empty.fire()}},We$:function(e,i){var n=i+'queueHooks';return t.i$(e,n)||t.i$(e,n,{empty:t.Callbacks('once memory').add(function(){t.he$(e,i+'queue');t.he$(e,n)})})}});t.fn.extend({queue:function(e,n){var s=2;if(typeof e!=='string'){n=e;e='fx';s--};if(arguments.length<s){return t.queue(this[0],e)};return n===i?this:this.each(function(){var i=t.queue(this,e,n);t.We$(this,e);if(e==='fx'&&i[0]!=='inprogress'){t.dequeue(this,e)}})},dequeue:function(e){return this.each(function(){t.dequeue(this,e)})},delay:function(e,i){e=t.fx?t.fx.speeds[e]||e:e;i=i||'fx';return this.queue(i,function(t,i){var n=setTimeout(t,e);i.stop=function(){clearTimeout(n)}})},clearQueue:function(e){return this.queue(e||'fx',[])},promise:function(e,n){var s,l=1,c=t.Deferred(),r=this,a=this.length,o=function(){if(!(--l)){c.resolveWith(r,[r])}};if(typeof e!=='string'){n=e;e=i};e=e||'fx';while(a--){s=t.i$(r[a],e+'queueHooks');if(s&&s.empty){l++;s.empty.add(o)}};o();return c.promise(n)}});var y,Ze,R=/[\t\r\n\f]/g,wt=/\r/g,Tt=/^(?:input|select|textarea|button|object)$/i,St=/^(?:a|area)$/i,Z=/^(?:checked|selected)$/i,h=t.support.getSetAttribute,N=t.support.input;t.fn.extend({attr:function(e,i){return t.access(this,t.attr,e,i,arguments.length>1)},removeAttr:function(e){return this.each(function(){t.removeAttr(this,e)})},prop:function(e,i){return t.access(this,t.prop,e,i,arguments.length>1)},removeProp:function(e){e=t.propFix[e]||e;return this.each(function(){try{this[e]=i;delete this[e]}catch(t){}})},addClass:function(e){var a,i,n,r,o,s=0,u=this.length,c=typeof e==='string'&&e;if(t.isFunction(e)){return this.each(function(i){t(this).addClass(e.call(this,i,this.className))})};if(c){a=(e||'').match(l)||[];for(;s<u;s++){i=this[s];n=i.nodeType===1&&(i.className?(' '+ i.className+' ').replace(R,' '):' ');if(n){o=0;while((r=a[o++])){if(n.indexOf(' '+ r+' ')<0){n+=r+' '}};i.className=t.trim(n)}}};return this},removeClass:function(e){var a,n,i,r,o,s=0,u=this.length,c=arguments.length===0||typeof e==='string'&&e;if(t.isFunction(e)){return this.each(function(i){t(this).removeClass(e.call(this,i,this.className))})};if(c){a=(e||'').match(l)||[];for(;s<u;s++){n=this[s];i=n.nodeType===1&&(n.className?(' '+ n.className+' ').replace(R,' '):'');if(i){o=0;while((r=a[o++])){while(i.indexOf(' '+ r+' ')>=0){i=i.replace(' '+ r+' ',' ')}};n.className=e?t.trim(i):''}}};return this},toggleClass:function(e,i){var n=typeof e;if(typeof i==='boolean'&&n==='string'){return i?this.addClass(e):this.removeClass(e)};if(t.isFunction(e)){return this.each(function(n){t(this).toggleClass(e.call(this,n,this.className,i),i)})};return this.each(function(){if(n==='string'){var i,o=0,s=t(this),r=e.match(l)||[];while((i=r[o++])){if(s.hasClass(i)){s.removeClass(i)}else{s.addClass(i)}}}else if(n===c||n==='boolean'){if(this.className){t.i$(this,'__className__',this.className)};this.className=this.className||e===!1?'':t.i$(this,'__className__')||''}})},hasClass:function(e){var n=' '+ e+' ',t=0,i=this.length;for(;t<i;t++){if(this[t].nodeType===1&&(' '+ this[t].className+' ').replace(R,' ').indexOf(n)>=0){return!0}};return!1},val:function(e){var s,n,o,r=this[0];if(!arguments.length){if(r){n=t.valHooks[r.type]||t.valHooks[r.nodeName.toLowerCase()];if(n&&'get'in n&&(s=n.get(r,'value'))!==i){return s};s=r.value;return typeof s==='string'?s.replace(wt,''):s==null?'':s};return};o=t.isFunction(e);return this.each(function(s){var r;if(this.nodeType!==1){return};if(o){r=e.call(this,s,t(this).val())}else{r=e};if(r==null){r=''}else if(typeof r==='number'){r+=''}else if(t.isArray(r)){r=t.map(r,function(e){return e==null?'':e+''})};n=t.valHooks[this.type]||t.valHooks[this.nodeName.toLowerCase()];if(!n||!('set'in n)||n.set(this,r,'value')===i){this.value=r}})}});t.extend({valHooks:{option:{get:function(e){var i=t.find.attr(e,'value');return i!=null?i:e.text}},select:{get:function(e){var o,i,c=e.options,n=e.selectedIndex,r=e.type==='select-one'||n<0,l=r?null:[],a=r?n+ 1:c.length,s=n<0?a:r?n:0;for(;s<a;s++){i=c[s];if((i.selected||s===n)&&(t.support.optDisabled?!i.disabled:i.getAttribute('disabled')===null)&&(!i.parentNode.disabled||!t.nodeName(i.parentNode,'optgroup'))){o=t(i).val();if(r){return o};l.push(o)}};return l},set:function(e,i){var a,n,o=e.options,r=t.makeArray(i),s=o.length;while(s--){n=o[s];if((n.selected=t.inArray(t(n).val(),r)>=0)){a=!0}};if(!a){e.selectedIndex=-1};return r}}},attr:function(e,n,s){var r,o,a=e.nodeType;if(!e||a===3||a===8||a===2){return};if(typeof e.getAttribute===c){return t.prop(e,n,s)};if(a!==1||!t.isXMLDoc(e)){n=n.toLowerCase();r=t.attrHooks[n]||(t.expr.match.bool.test(n)?Ze:y)};if(s!==i){if(s===null){t.removeAttr(e,n)}else if(r&&'set'in r&&(o=r.set(e,s,n))!==i){return o}else{e.setAttribute(n,s+'');return s}}else if(r&&'get'in r&&(o=r.get(e,n))!==null){return o}else{o=t.find.attr(e,n);return o==null?i:o}},removeAttr:function(e,i){var n,s,o=0,r=i&&i.match(l);if(r&&e.nodeType===1){while((n=r[o++])){s=t.propFix[n]||n;if(t.expr.match.bool.test(n)){if(N&&h||!Z.test(n)){e[s]=!1}else{e[t.camelCase('default-'+ n)]=e[s]=!1}}else{t.attr(e,n,'')};e.removeAttribute(h?n:s)}}},attrHooks:{type:{set:function(e,i){if(!t.support.radioValue&&i==='radio'&&t.nodeName(e,'input')){var n=e.value;e.setAttribute('type',i);if(n){e.value=n};return i}}}},propFix:{'for':'htmlFor','class':'className'},prop:function(e,n,s){var a,r,l,o=e.nodeType;if(!e||o===3||o===8||o===2){return};l=o!==1||!t.isXMLDoc(e);if(l){n=t.propFix[n]||n;r=t.propHooks[n]};if(s!==i){return r&&'set'in r&&(a=r.set(e,s,n))!==i?a:(e[n]=s)}else{return r&&'get'in r&&(a=r.get(e,n))!==null?a:e[n]}},propHooks:{tabIndex:{get:function(e){var i=t.find.attr(e,'tabindex');return i?parseInt(i,10):Tt.test(e.nodeName)||St.test(e.nodeName)&&e.href?0:-1}}}});Ze={set:function(e,i,n){if(i===!1){t.removeAttr(e,n)}else if(N&&h||!Z.test(n)){e.setAttribute(!h&&t.propFix[n]||n,n)}else{e[t.camelCase('default-'+ n)]=e[n]=!0};return n}};t.each(t.expr.match.bool.source.match(/\w+/g),function(e,n){var s=t.expr.attrHandle[n]||t.find.attr;t.expr.attrHandle[n]=N&&h||!Z.test(n)?function(e,n,r){var a=t.expr.attrHandle[n],o=r?i:(t.expr.attrHandle[n]=i)!=s(e,n,r)?n.toLowerCase():null;t.expr.attrHandle[n]=a;return o}:function(e,n,s){return s?i:e[t.camelCase('default-'+ n)]?n.toLowerCase():null}});if(!N||!h){t.attrHooks.value={set:function(e,i,n){if(t.nodeName(e,'input')){e.defaultValue=i}else{return y&&y.set(e,i,n)}}}};if(!h){y={set:function(e,t,n){var s=e.getAttributeNode(n);if(!s){e.setAttributeNode((s=e.ownerDocument.createAttribute(n)))};s.value=t+='';return n==='value'||t===e.getAttribute(n)?t:i}};t.expr.attrHandle.id=t.expr.attrHandle.name=t.expr.attrHandle.coords=function(e,t,n){var s;return n?i:(s=e.getAttributeNode(t))&&s.value!==''?s.value:null};t.valHooks.button={get:function(e,t){var n=e.getAttributeNode(t);return n&&n.specified?n.value:i},set:y.set};t.attrHooks.contenteditable={set:function(e,t,i){y.set(e,t===''?!1:t,i)}};t.each(['width','height'],function(e,i){t.attrHooks[i]={set:function(e,t){if(t===''){e.setAttribute(i,'auto');return t}}}})};if(!t.support.hrefNormalized){t.each(['href','src'],function(e,i){t.propHooks[i]={get:function(e){return e.getAttribute(i,4)}}})};if(!t.support.style){t.attrHooks.style={get:function(e){return e.style.cssText||i},set:function(e,t){return(e.style.cssText=t+'')}}};if(!t.support.optSelected){t.propHooks.selected={get:function(e){var t=e.parentNode;if(t){t.selectedIndex;if(t.parentNode){t.parentNode.selectedIndex}};return null}}};t.each(['tabIndex','readOnly','maxLength','cellSpacing','cellPadding','rowSpan','colSpan','useMap','frameBorder','contentEditable'],function(){t.propFix[this.toLowerCase()]=this});if(!t.support.enctype){t.propFix.enctype='encoding'};t.each(['radio','checkbox'],function(){t.valHooks[this]={set:function(e,i){if(t.isArray(i)){return(e.checked=t.inArray(t(e).val(),i)>=0)}}};if(!t.support.checkOn){t.valHooks[this].get=function(e){return e.getAttribute('value')===null?'on':e.value}}});var B=/^(?:input|select|textarea)$/i,Nt=/^key/,Ct=/^(?:mouse|contextmenu)|click/,nt=/^(?:focusinfocus|focusoutblur)$/,st=/^([^.]*)(?:\.(.+)|)$/;function O(){return!0};function T(){return!1};function Se(){try{return n.activeElement}catch(e){}};t.event={global:{},add:function(e,n,s,r,o){var v,g,y,m,u,f,d,h,a,b,w,p=t.i$(e);if(!p){return};if(s.handler){m=s;s=m.handler;o=m.selector};if(!s.guid){s.guid=t.guid++};if(!(g=p.events)){g=p.events={}};if(!(f=p.handle)){f=p.handle=function(e){return typeof t!==c&&(!e||t.event.triggered!==e.type)?t.event.dispatch.apply(f.elem,arguments):i};f.elem=e};n=(n||'').match(l)||[''];y=n.length;while(y--){v=st.exec(n[y])||[];a=w=v[1];b=(v[2]||'').split('.').sort();if(!a){continue};u=t.event.special[a]||{};a=(o?u.delegateType:u.bindType)||a;u=t.event.special[a]||{};d=t.extend({type:a,origType:w,data:r,handler:s,guid:s.guid,selector:o,needsContext:o&&t.expr.match.needsContext.test(o),namespace:b.join('.')},m);if(!(h=g[a])){h=g[a]=[];h.delegateCount=0;if(!u.setup||u.setup.call(e,r,b,f)===!1){if(e.addEventListener){e.addEventListener(a,f,!1)}else if(e.attachEvent){e.attachEvent('on'+ a,f)}}};if(u.add){u.add.call(e,d);if(!d.handler.guid){d.handler.guid=s.guid}};if(o){h.splice(h.delegateCount++,0,d)}else{h.push(d)};t.event.global[a]=!0};e=null},remove:function(e,i,n,s,r){var m,a,u,v,p,d,c,f,o,g,b,h=t.hasData(e)&&t.i$(e);if(!h||!(d=h.events)){return};i=(i||'').match(l)||[''];p=i.length;while(p--){u=st.exec(i[p])||[];o=b=u[1];g=(u[2]||'').split('.').sort();if(!o){for(o in d){t.event.remove(e,o+ i[p],n,s,!0)};continue};c=t.event.special[o]||{};o=(s?c.delegateType:c.bindType)||o;f=d[o]||[];u=u[2]&&new RegExp('(^|\\.)'+ g.join('\\.(?:.*\\.|)')+'(\\.|$)');v=m=f.length;while(m--){a=f[m];if((r||b===a.origType)&&(!n||n.guid===a.guid)&&(!u||u.test(a.namespace))&&(!s||s===a.selector||s==='**'&&a.selector)){f.splice(m,1);if(a.selector){f.delegateCount--};if(c.remove){c.remove.call(e,a)}}};if(v&&!f.length){if(!c.teardown||c.teardown.call(e,g,h.handle)===!1){t.removeEvent(e,o,h.handle)};delete d[o]}};if(t.isEmptyObject(d)){delete h.handle;t.he$(e,'events')}},trigger:function(s,r,o,a){var d,p,u,v,h,f,b,g=[o||n],c=w.call(s,'type')?s.type:s,m=w.call(s,'namespace')?s.namespace.split('.'):[];u=f=o=o||n;if(o.nodeType===3||o.nodeType===8){return};if(nt.test(c+ t.event.triggered)){return};if(c.indexOf('.')>=0){m=c.split('.');c=m.shift();m.sort()};p=c.indexOf(':')<0&&'on'+ c;s=s[t.expando]?s:new t.Event(c,typeof s==='object'&&s);s.isTrigger=a?2:3;s.namespace=m.join('.');s.namespace_re=s.namespace?new RegExp('(^|\\.)'+ m.join('\\.(?:.*\\.|)')+'(\\.|$)'):null;s.result=i;if(!s.target){s.target=o};r=r==null?[s]:t.makeArray(r,[s]);h=t.event.special[c]||{};if(!a&&h.trigger&&h.trigger.apply(o,r)===!1){return};if(!a&&!h.noBubble&&!t.isWindow(o)){v=h.delegateType||c;if(!nt.test(v+ c)){u=u.parentNode};for(;u;u=u.parentNode){g.push(u);f=u};if(f===(o.ownerDocument||n)){g.push(f.defaultView||f.parentWindow||e)}};b=0;while((u=g[b++])&&!s.isPropagationStopped()){s.type=b>1?v:h.bindType||c;d=(t.i$(u,'events')||{})[s.type]&&t.i$(u,'handle');if(d){d.apply(u,r)};d=p&&u[p];if(d&&t.acceptData(u)&&d.apply&&d.apply(u,r)===!1){s.preventDefault()}};s.type=c;if(!a&&!s.isDefaultPrevented()){if((!h.x$||h.x$.apply(g.pop(),r)===!1)&&t.acceptData(o)){if(p&&o[c]&&!t.isWindow(o)){f=o[p];if(f){o[p]=null};t.event.triggered=c;try{o[c]()}catch(l){};t.event.triggered=i;if(f){o[p]=f}}}};return s.result},dispatch:function(e){e=t.event.fix(e);var a,o,n,r,u,c=[],l=p.call(arguments),f=(t.i$(this,'events')||{})[e.type]||[],s=t.event.special[e.type]||{};l[0]=e;e.delegateTarget=this;if(s.preDispatch&&s.preDispatch.call(this,e)===!1){return};c=t.event.handlers.call(this,e,f);a=0;while((r=c[a++])&&!e.isPropagationStopped()){e.currentTarget=r.elem;u=0;while((n=r.handlers[u++])&&!e.isImmediatePropagationStopped()){if(!e.namespace_re||e.namespace_re.test(n.namespace)){e.handleObj=n;e.data=n.data;o=((t.event.special[n.origType]||{}).handle||n.handler).apply(r.elem,l);if(o!==i){if((e.result=o)===!1){e.preventDefault();e.stopPropagation()}}}}};if(s.postDispatch){s.postDispatch.call(this,e)};return e.result},handlers:function(e,n){var o,c,r,l,u=[],a=n.delegateCount,s=e.target;if(a&&s.nodeType&&(!e.button||e.type!=='click')){for(;s!=this;s=s.parentNode||this){if(s.nodeType===1&&(s.disabled!==!0||e.type!=='click')){r=[];for(l=0;l<a;l++){c=n[l];o=c.selector+' ';if(r[o]===i){r[o]=c.needsContext?t(o,this).index(s)>=0:t.find(o,this,null,[s]).length};if(r[o]){r.push(c)}};if(r.length){u.push({elem:s,handlers:r})}}}};if(a<n.length){u.push({elem:this,handlers:n.slice(a)})};return u},fix:function(e){if(e[t.expando]){return e};var a,l,o,s=e.type,r=e,i=this.fixHooks[s];if(!i){this.fixHooks[s]=i=Ct.test(s)?this.mouseHooks:Nt.test(s)?this.keyHooks:{}};o=i.props?this.props.concat(i.props):this.props;e=new t.Event(r);a=o.length;while(a--){l=o[a];e[l]=r[l]};if(!e.target){e.target=r.srcElement||n};if(e.target.nodeType===3){e.target=e.target.parentNode};e.metaKey=!!e.metaKey;return i.filter?i.filter(e,r):e},props:'altKey bubbles cancelable ctrlKey currentTarget eventPhase metaKey relatedTarget shiftKey target timeStamp view which'.split(' '),fixHooks:{},keyHooks:{props:'char charCode key keyCode'.split(' '),filter:function(e,t){if(e.which==null){e.which=t.charCode!=null?t.charCode:t.keyCode};return e}},mouseHooks:{props:'button buttons clientX clientY fromElement offsetX offsetY pageX pageY screenX screenY toElement'.split(' '),filter:function(e,t){var r,l,s,o=t.button,a=t.fromElement;if(e.pageX==null&&t.clientX!=null){l=e.target.ownerDocument||n;s=l.documentElement;r=l.body;e.pageX=t.clientX+(s&&s.scrollLeft||r&&r.scrollLeft||0)-(s&&s.clientLeft||r&&r.clientLeft||0);e.pageY=t.clientY+(s&&s.scrollTop||r&&r.scrollTop||0)-(s&&s.clientTop||r&&r.clientTop||0)};if(!e.relatedTarget&&a){e.relatedTarget=a===e.target?t.toElement:a};if(!e.which&&o!==i){e.which=(o&1?1:(o&2?3:(o&4?2:0)))};return e}},special:{load:{noBubble:!0},focus:{trigger:function(){if(this!==Se()&&this.focus){try{this.focus();return!1}catch(e){}}},delegateType:'focusin'},blur:{trigger:function(){if(this===Se()&&this.blur){this.blur();return!1}},delegateType:'focusout'},click:{trigger:function(){if(t.nodeName(this,'input')&&this.type==='checkbox'&&this.click){this.click();return!1}},x$:function(e){return t.nodeName(e.target,'a')}},beforeunload:{postDispatch:function(e){if(e.result!==i){e.originalEvent.returnValue=e.result}}}},simulate:function(e,i,n,s){var r=t.extend(new t.Event(),n,{type:e,isSimulated:!0,originalEvent:{}});if(s){t.event.trigger(r,null,i)}else{t.event.dispatch.call(i,r)};if(r.isDefaultPrevented()){n.preventDefault()}}};t.removeEvent=n.removeEventListener?function(e,t,i){if(e.removeEventListener){e.removeEventListener(t,i,!1)}}:function(e,t,i){var n='on'+ t;if(e.detachEvent){if(typeof e[n]===c){e[n]=null};e.detachEvent(n,i)}};t.Event=function(e,i){if(!(this instanceof t.Event)){return new t.Event(e,i)};if(e&&e.type){this.originalEvent=e;this.type=e.type;this.isDefaultPrevented=(e.defaultPrevented||e.returnValue===!1||e.getPreventDefault&&e.getPreventDefault())?O:T}else{this.type=e};if(i){t.extend(this,i)};this.timeStamp=e&&e.timeStamp||t.now();this[t.expando]=!0};t.Event.prototype={isDefaultPrevented:T,isPropagationStopped:T,isImmediatePropagationStopped:T,preventDefault:function(){var e=this.originalEvent;this.isDefaultPrevented=O;if(!e){return};if(e.preventDefault){e.preventDefault()}else{e.returnValue=!1}},stopPropagation:function(){var e=this.originalEvent;this.isPropagationStopped=O;if(!e){return};if(e.stopPropagation){e.stopPropagation()};e.cancelBubble=!0},stopImmediatePropagation:function(){this.isImmediatePropagationStopped=O;this.stopPropagation()}};t.each({mouseenter:'mouseover',mouseleave:'mouseout'},function(e,i){t.event.special[e]={delegateType:i,bindType:i,handle:function(e){var o,r=this,n=e.relatedTarget,s=e.handleObj;if(!n||(n!==r&&!t.contains(r,n))){e.type=s.origType;o=s.handler.apply(this,arguments);e.type=i};return o}}});if(!t.support.submitBubbles){t.event.special.submit={setup:function(){if(t.nodeName(this,'form')){return!1};t.event.add(this,'click._submit keypress._submit',function(e){var s=e.target,n=t.nodeName(s,'input')||t.nodeName(s,'button')?s.form:i;if(n&&!t.i$(n,'submitBubbles')){t.event.add(n,'submit._submit',function(e){e.wt$=!0});t.i$(n,'submitBubbles',!0)}})},postDispatch:function(e){if(e.wt$){delete e.wt$;if(this.parentNode&&!e.isTrigger){t.event.simulate('submit',this.parentNode,e,!0)}}},teardown:function(){if(t.nodeName(this,'form')){return!1};t.event.remove(this,'._submit')}}};if(!t.support.changeBubbles){t.event.special.change={setup:function(){if(B.test(this.nodeName)){if(this.type==='checkbox'||this.type==='radio'){t.event.add(this,'propertychange._change',function(e){if(e.originalEvent.propertyName==='checked'){this.xt$=!0}});t.event.add(this,'click._change',function(e){if(this.xt$&&!e.isTrigger){this.xt$=!1};t.event.simulate('change',this,e,!0)})};return!1};t.event.add(this,'beforeactivate._change',function(e){var i=e.target;if(B.test(i.nodeName)&&!t.i$(i,'changeBubbles')){t.event.add(i,'change._change',function(e){if(this.parentNode&&!e.isSimulated&&!e.isTrigger){t.event.simulate('change',this.parentNode,e,!0)}});t.i$(i,'changeBubbles',!0)}})},handle:function(e){var t=e.target;if(this!==t||e.isSimulated||e.isTrigger||(t.type!=='radio'&&t.type!=='checkbox')){return e.handleObj.handler.apply(this,arguments)}},teardown:function(){t.event.remove(this,'._change');return!B.test(this.nodeName)}}};if(!t.support.focusinBubbles){t.each({focus:'focusin',blur:'focusout'},function(e,i){var r=0,s=function(e){t.event.simulate(i,e.target,t.event.fix(e),!0)};t.event.special[i]={setup:function(){if(r++===0){n.addEventListener(e,s,!0)}},teardown:function(){if(--r===0){n.removeEventListener(e,s,!0)}}}})};t.fn.extend({on:function(e,n,s,r,o){var l,a;if(typeof e==='object'){if(typeof n!=='string'){s=s||n;n=i};for(l in e){this.on(l,n,s,e[l],o)};return this};if(s==null&&r==null){r=n;s=n=i}else if(r==null){if(typeof n==='string'){r=s;s=i}else{r=s;s=n;n=i}};if(r===!1){r=T}else if(!r){return this};if(o===1){a=r;r=function(e){t().off(e);return a.apply(this,arguments)};r.guid=a.guid||(a.guid=t.guid++)};return this.each(function(){t.event.add(this,e,r,s,n)})},one:function(e,t,i,n){return this.on(e,t,i,n,1)},off:function(e,n,s){var r,o;if(e&&e.preventDefault&&e.handleObj){r=e.handleObj;t(e.delegateTarget).off(r.namespace?r.origType+'.'+ r.namespace:r.origType,r.selector,r.handler);return this};if(typeof e==='object'){for(o in e){this.off(o,n,e[o])};return this};if(n===!1||typeof n==='function'){s=n;n=i};if(s===!1){s=T};return this.each(function(){t.event.remove(this,e,s,n)})},trigger:function(e,i){return this.each(function(){t.event.trigger(e,i,this)})},triggerHandler:function(e,i){var n=this[0];if(n){return t.event.trigger(e,i,n,!0)}}});var Wt=/^.[^:#\[\.,]*$/,Ft=/^(?:parents|prev(?:Until|All))/,Ke=t.expr.match.needsContext,At={children:!0,contents:!0,next:!0,prev:!0};t.fn.extend({find:function(e){var i,n=[],r=this,s=r.length;if(typeof e!=='string'){return this.pushStack(t(e).filter(function(){for(i=0;i<s;i++){if(t.contains(r[i],this)){return!0}}}))};for(i=0;i<s;i++){t.find(e,r[i],n)};n=this.pushStack(s>1?t.unique(n):n);n.selector=this.selector?this.selector+' '+ e:e;return n},has:function(e){var i,n=t(e,this),s=n.length;return this.filter(function(){for(i=0;i<s;i++){if(t.contains(this,n[i])){return!0}}})},not:function(e){return this.pushStack(V(this,e||[],!0))},filter:function(e){return this.pushStack(V(this,e||[],!1))},is:function(e){return!!V(this,typeof e==='string'&&Ke.test(e)?t(e):e||[],!1).length},closest:function(e,i){var n,r=0,a=this.length,s=[],o=Ke.test(e)||typeof e!=='string'?t(e,i||this.context):0;for(;r<a;r++){for(n=this[r];n&&n!==i;n=n.parentNode){if(n.nodeType<11&&(o?o.index(n)>-1:n.nodeType===1&&t.find.matchesSelector(n,e))){n=s.push(n);break}}};return this.pushStack(s.length>1?t.unique(s):s)},index:function(e){if(!e){return(this[0]&&this[0].parentNode)?this.first().prevAll().length:-1};if(typeof e==='string'){return t.inArray(this[0],t(e))};return t.inArray(e.jquery?e[0]:e,this)},add:function(e,i){var s=typeof e==='string'?t(e,i):t.makeArray(e&&e.nodeType?[e]:e),n=t.merge(this.get(),s);return this.pushStack(t.unique(n))},addBack:function(e){return this.add(e==null?this.prevObject:this.prevObject.filter(e))}});function Me(e,t){do{e=e[t]}while(e&&e.nodeType!==1);return e};t.each({parent:function(e){var t=e.parentNode;return t&&t.nodeType!==11?t:null},parents:function(e){return t.dir(e,'parentNode')},parentsUntil:function(e,i,n){return t.dir(e,'parentNode',n)},next:function(e){return Me(e,'nextSibling')},prev:function(e){return Me(e,'previousSibling')},nextAll:function(e){return t.dir(e,'nextSibling')},prevAll:function(e){return t.dir(e,'previousSibling')},nextUntil:function(e,i,n){return t.dir(e,'nextSibling',n)},prevUntil:function(e,i,n){return t.dir(e,'previousSibling',n)},siblings:function(e){return t.sibling((e.parentNode||{}).firstChild,e)},children:function(e){return t.sibling(e.firstChild)},contents:function(e){return t.nodeName(e,'iframe')?e.contentDocument||e.contentWindow.document:t.merge([],e.childNodes)}},function(e,i){t.fn[e]=function(n,s){var r=t.map(this,i,n);if(e.slice(-5)!=='Until'){s=n};if(s&&typeof s==='string'){r=t.filter(s,r)};if(this.length>1){if(!At[e]){r=t.unique(r)};if(Ft.test(e)){r=r.reverse()}};return this.pushStack(r)}});t.extend({filter:function(e,i,n){var s=i[0];if(n){e=':not('+ e+')'};return i.length===1&&s.nodeType===1?t.find.matchesSelector(s,e)?[s]:[]:t.find.matches(e,t.grep(i,function(e){return e.nodeType===1}))},dir:function(e,n,s){var o=[],r=e[n];while(r&&r.nodeType!==9&&(s===i||r.nodeType!==1||!t(r).is(s))){if(r.nodeType===1){o.push(r)};r=r[n]};return o},sibling:function(e,t){var i=[];for(;e;e=e.nextSibling){if(e.nodeType===1&&e!==t){i.push(e)}};return i}});function V(e,i,n){if(t.isFunction(i)){return t.grep(e,function(e,t){return!!i.call(e,t,e)!==n})};if(i.nodeType){return t.grep(e,function(e){return(e===i)!==n})};if(typeof i==='string'){if(Wt.test(i)){return t.filter(i,e,n)};i=t.filter(i,e)};return t.grep(e,function(e){return(t.inArray(e,i)>=0)!==n})};function Te(e){var i=Ye.split('|'),t=e.createDocumentFragment();if(t.createElement){while(i.length){t.createElement(i.pop())}};return t};var Ye='abbr|article|aside|audio|bdi|canvas|data|datalist|details|figcaption|figure|footer|header|hgroup|mark|meter|nav|output|progress|section|summary|time|video',ai=/ jQuery\d+="(?:null|\d+)"/g,Ue=new RegExp('<(?:'+ Ye+')[\\s/>]','i'),Y=/^\s+/,Xe=/<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:]+)[^>]*)\/>/gi,Qe=/<([\w:]+)/,Je=/<tbody/i,Lt=/<|&#?\w+;/,Mt=/<(?:script|style|link)/i,H=/^(?:checkbox|radio)$/i,It=/checked\s*(?:[^=]|=\s*.checked.)/i,ze=/^$|\/(?:java|ecma)script/i,Et=/^true\/(.*)/,zt=/^\s*<!(?:\[CDATA\[|--)|(?:\]\]|--)>\s*$/g,a={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>'],x$:t.support.htmlSerialize?[0,'','']:[1,'X<div>','</div>']},Ot=Te(n),W=Ot.appendChild(n.createElement('div'));a.optgroup=a.option;a.tbody=a.tfoot=a.colgroup=a.caption=a.thead;a.th=a.td;t.fn.extend({text:function(e){return t.access(this,function(e){return e===i?t.text(this):this.empty().append((this[0]&&this[0].ownerDocument||n).createTextNode(e))},null,e,arguments.length)},append:function(){return this.domManip(arguments,function(e){if(this.nodeType===1||this.nodeType===11||this.nodeType===9){var t=xe(this,e);t.appendChild(e)}})},prepend:function(){return this.domManip(arguments,function(e){if(this.nodeType===1||this.nodeType===11||this.nodeType===9){var t=xe(this,e);t.insertBefore(e,t.firstChild)}})},before:function(){return this.domManip(arguments,function(e){if(this.parentNode){this.parentNode.insertBefore(e,this)}})},after:function(){return this.domManip(arguments,function(e){if(this.parentNode){this.parentNode.insertBefore(e,this.nextSibling)}})},remove:function(e,i){var n,o=e?t.filter(e,this):this,s=0;for(;(n=o[s])!=null;s++){if(!i&&n.nodeType===1){t.cleanData(r(n))};if(n.parentNode){if(i&&t.contains(n.ownerDocument,n)){q(r(n,'script'))};n.parentNode.removeChild(n)}};return this},empty:function(){var e,i=0;for(;(e=this[i])!=null;i++){if(e.nodeType===1){t.cleanData(r(e,!1))}
  4. while(e.firstChild){e.removeChild(e.firstChild)};if(e.options&&t.nodeName(e,'select')){e.options.length=0}};return this},clone:function(e,i){e=e==null?!1:e;i=i==null?e:i;return this.map(function(){return t.clone(this,e,i)})},html:function(e){return t.access(this,function(e){var s=this[0]||{},o=0,l=this.length;if(e===i){return s.nodeType===1?s.innerHTML.replace(ai,''):i};if(typeof e==='string'&&!Mt.test(e)&&(t.support.htmlSerialize||!Ue.test(e))&&(t.support.leadingWhitespace||!Y.test(e))&&!a[(Qe.exec(e)||['',''])[1].toLowerCase()]){e=e.replace(Xe,'<$1></$2>');try{for(;o<l;o++){s=this[o]||{};if(s.nodeType===1){t.cleanData(r(s,!1));s.innerHTML=e}};s=0}catch(n){}};if(s){this.empty().append(e)}},null,e,arguments.length)},replaceWith:function(){var i=t.map(this,function(e){return[e.nextSibling,e.parentNode]}),e=0;this.domManip(arguments,function(n){var s=i[e++],r=i[e++];if(r){if(s&&s.parentNode!==r){s=this.nextSibling};t(this).remove();r.insertBefore(n,s)}},!0);return e?this:this.remove()},detach:function(e){return this.remove(e,!0)},domManip:function(e,i,n){e=ue.apply([],e);var h,s,u,a,p,l,o=0,c=this.length,m=this,g=c- 1,f=e[0],d=t.isFunction(f);if(d||!(c<=1||typeof f!=='string'||t.support.checkClone||!It.test(f))){return this.each(function(t){var s=m.eq(t);if(d){e[0]=f.call(this,t,s.html())};s.domManip(e,i,n)})};if(c){l=t.buildFragment(e,this[0].ownerDocument,!1,!n&&this);h=l.firstChild;if(l.childNodes.length===1){l=h};if(h){a=t.map(r(l,'script'),ke);u=a.length;for(;o<c;o++){s=l;if(o!==g){s=t.clone(s,!0,!0);if(u){t.merge(a,r(s,'script'))}};i.call(this[o],s,o)};if(u){p=a[a.length- 1].ownerDocument;t.map(a,De);for(o=0;o<u;o++){s=a[o];if(ze.test(s.type||'')&&!t.i$(s,'globalEval')&&t.contains(p,s)){if(s.src){t.li$(s.src)}else{t.globalEval((s.text||s.textContent||s.innerHTML||'').replace(zt,''))}}}};l=h=null}};return this}});function xe(e,i){return t.nodeName(e,'table')&&t.nodeName(i.nodeType===1?i:i.firstChild,'tr')?e.getElementsByTagName('tbody')[0]||e.appendChild(e.ownerDocument.createElement('tbody')):e};function ke(e){e.type=(t.find.attr(e,'type')!==null)+'/'+ e.type;return e};function De(e){var t=Et.exec(e.type);if(t){e.type=t[1]}else{e.removeAttribute('type')};return e};function q(e,i){var s,n=0;for(;(s=e[n])!=null;n++){t.i$(s,'globalEval',!i||t.i$(i[n],'globalEval'))}};function ye(e,i){if(i.nodeType!==1||!t.hasData(e)){return};var o,r,a,l=t.i$(e),n=t.i$(i,l),s=l.events;if(s){delete n.handle;n.events={};for(o in s){for(r=0,a=s[o].length;r<a;r++){t.event.add(i,o,s[o][r])}}};if(n.data){n.data=t.extend({},n.data)}};function ct(e,i){var n,r,s;if(i.nodeType!==1){return};n=i.nodeName.toLowerCase();if(!t.support.noCloneEvent&&i[t.expando]){s=t.i$(i);for(r in s.events){t.removeEvent(i,r,s.handle)};i.removeAttribute(t.expando)};if(n==='script'&&i.text!==e.text){ke(i).text=e.text;De(i)}else if(n==='object'){if(i.parentNode){i.outerHTML=e.outerHTML};if(t.support.html5Clone&&(e.innerHTML&&!t.trim(i.innerHTML))){i.innerHTML=e.innerHTML}}else if(n==='input'&&H.test(e.type)){i.defaultChecked=i.checked=e.checked;if(i.value!==e.value){i.value=e.value}}else if(n==='option'){i.defaultSelected=i.selected=e.defaultSelected}else if(n==='input'||n==='textarea'){i.defaultValue=e.defaultValue}};t.each({appendTo:'append',prependTo:'prepend',insertBefore:'before',insertAfter:'after',replaceAll:'replaceWith'},function(e,i){t.fn[e]=function(e){var s,n=0,o=[],a=t(e),r=a.length- 1;for(;n<=r;n++){s=n===r?this:this.clone(!0);t(a[n])[i](s);X.apply(o,s.get())};return this.pushStack(o)}});function r(e,n){var a,o,l=0,s=typeof e.getElementsByTagName!==c?e.getElementsByTagName(n||'*'):typeof e.querySelectorAll!==c?e.querySelectorAll(n||'*'):i;if(!s){for(s=[],a=e.childNodes||e;(o=a[l])!=null;l++){if(!n||t.nodeName(o,n)){s.push(o)}else{t.merge(s,r(o,n))}}};return n===i||n&&t.nodeName(e,n)?t.merge([e],s):s};function dt(e){if(H.test(e.type)){e.defaultChecked=e.checked}};t.extend({clone:function(e,i,n){var s,c,a,o,l,u=t.contains(e.ownerDocument,e);if(t.support.html5Clone||t.isXMLDoc(e)||!Ue.test('<'+ e.nodeName+'>')){a=e.cloneNode(!0)}else{W.innerHTML=e.outerHTML;W.removeChild(a=W.firstChild)};if((!t.support.noCloneEvent||!t.support.noCloneChecked)&&(e.nodeType===1||e.nodeType===11)&&!t.isXMLDoc(e)){s=r(a);l=r(e);for(o=0;(c=l[o])!=null;++o){if(s[o]){ct(c,s[o])}}};if(i){if(n){l=l||r(e);s=s||r(a);for(o=0;(c=l[o])!=null;o++){ye(c,s[o])}}else{ye(e,a)}};s=r(a,'script');if(s.length>0){q(s,!u&&r(e,'script'))};s=l=c=null;return a},buildFragment:function(e,i,n,s){var c,o,g,l,p,m,d,v=e.length,h=Te(i),u=[],f=0;for(;f<v;f++){o=e[f];if(o||o===0){if(t.type(o)==='object'){t.merge(u,o.nodeType?[o]:o)}else if(!Lt.test(o)){u.push(i.createTextNode(o))}else{l=l||h.appendChild(i.createElement('div'));p=(Qe.exec(o)||['',''])[1].toLowerCase();d=a[p]||a.x$;l.innerHTML=d[1]+ o.replace(Xe,'<$1></$2>')+ d[2];c=d[0];while(c--){l=l.lastChild};if(!t.support.leadingWhitespace&&Y.test(o)){u.push(i.createTextNode(Y.exec(o)[0]))};if(!t.support.tbody){o=p==='table'&&!Je.test(o)?l.firstChild:d[1]==='<table>'&&!Je.test(o)?l:0;c=o&&o.childNodes.length;while(c--){if(t.nodeName((m=o.childNodes[c]),'tbody')&&!m.childNodes.length){o.removeChild(m)}}};t.merge(u,l.childNodes);l.textContent='';while(l.firstChild){l.removeChild(l.firstChild)};l=h.lastChild}}};if(l){h.removeChild(l)};if(!t.support.appendChecked){t.grep(r(u,'input'),dt)};f=0;while((o=u[f++])){if(s&&t.inArray(o,s)!==-1){continue};g=t.contains(o.ownerDocument,o);l=r(h.appendChild(o),'script');if(g){q(l)};if(n){c=0;while((o=l[c++])){if(ze.test(o.type||'')){n.push(o)}}}};l=null;return h},cleanData:function(e,i){var n,o,s,r,u=0,a=t.expando,l=t.cache,h=t.support.deleteExpando,f=t.event.special;for(;(n=e[u])!=null;u++){if(i||t.acceptData(n)){s=n[a];r=s&&l[s];if(r){if(r.events){for(o in r.events){if(f[o]){t.event.remove(n,o)}else{t.removeEvent(n,o,r.handle)}}};if(l[s]){delete l[s];if(h){delete n[a]}else if(typeof n.removeAttribute!==c){n.removeAttribute(a)}else{n[a]=null};b.push(s)}}}}},li$:function(e){return t.ajax({url:e,type:'GET',dataType:'script',async:!1,global:!1,'throws':!0})}});t.fn.extend({wrapAll:function(e){if(t.isFunction(e)){return this.each(function(i){t(this).wrapAll(e.call(this,i))})};if(this[0]){var i=t(e,this[0].ownerDocument).eq(0).clone(!0);if(this[0].parentNode){i.insertBefore(this[0])};i.map(function(){var e=this;while(e.firstChild&&e.firstChild.nodeType===1){e=e.firstChild};return e}).append(this)};return this},wrapInner:function(e){if(t.isFunction(e)){return this.each(function(i){t(this).wrapInner(e.call(this,i))})};return this.each(function(){var n=t(this),i=n.contents();if(i.length){i.wrapAll(e)}else{n.append(e)}})},wrap:function(e){var i=t.isFunction(e);return this.each(function(n){t(this).wrapAll(i?e.call(this,n):e)})},unwrap:function(){return this.parent().each(function(){if(!t.nodeName(this,'body')){t(this).replaceWith(this.childNodes)}}).end()}});var D,d,m,ie=/alpha\([^)]*\)/i,Bt=/opacity\s*=\s*([^)]*)/,Pt=/^(top|right|bottom|left)$/,jt=/^(none|table(?!-c[ea]).+)/,tt=/^margin/,xt=new RegExp('^('+ I+')(.*)$','i'),A=new RegExp('^('+ I+')(?!px)[a-z%]+$','i'),kt=new RegExp('^([+-])=('+ I+')','i'),ot={BODY:'block'},Ht={position:'absolute',visibility:'hidden',display:'block'},Fe={letterSpacing:0,fontWeight:400},v=['Top','Right','Bottom','Left'],Be=['Webkit','O','Moz','ms'];function le(e,t){if(t in e){return t};var n=t.charAt(0).toUpperCase()+ t.slice(1),s=t,i=Be.length;while(i--){t=Be[i]+ n;if(t in e){return t}};return s};function S(e,i){e=i||e;return t.css(e,'display')==='none'||!t.contains(e.ownerDocument,e)};function he(e,i){var r,n,a,o=[],s=0,l=e.length;for(;s<l;s++){n=e[s];if(!n.style){continue};o[s]=t.i$(n,'olddisplay');r=n.style.display;if(i){if(!o[s]&&r==='none'){n.style.display=''};if(n.style.display===''&&S(n)){o[s]=t.i$(n,'olddisplay',He(n.nodeName))}}else{if(!o[s]){a=S(n);if(r&&r!=='none'||!a){t.i$(n,'olddisplay',a?r:t.css(n,'display'))}}}};for(s=0;s<l;s++){n=e[s];if(!n.style){continue};if(!i||n.style.display==='none'||n.style.display===''){n.style.display=i?o[s]||'':'none'}};return e};t.fn.extend({css:function(e,n){return t.access(this,function(e,n,s){var a,l,o={},r=0;if(t.isArray(n)){l=d(e);a=n.length;for(;r<a;r++){o[n[r]]=t.css(e,n[r],!1,l)};return o};return s!==i?t.style(e,n,s):t.css(e,n)},e,n,arguments.length>1)},show:function(){return he(this,!0)},hide:function(){return he(this)},toggle:function(e){if(typeof e==='boolean'){return e?this.show():this.hide()};return this.each(function(){if(S(this)){t(this).show()}else{t(this).hide()}})}});t.extend({cssHooks:{opacity:{get:function(e,t){if(t){var i=m(e,'opacity');return i===''?'1':i}}}},cssNumber:{'columnCount':!0,'fillOpacity':!0,'fontWeight':!0,'lineHeight':!0,'opacity':!0,'order':!0,'orphans':!0,'widows':!0,'zIndex':!0,'zoom':!0},cssProps:{'float':t.support.cssFloat?'cssFloat':'styleFloat'},style:function(e,n,s,r){if(!e||e.nodeType===3||e.nodeType===8||!e.style){return};var c,u,a,l=t.camelCase(n),f=e.style;n=t.cssProps[l]||(t.cssProps[l]=le(f,l));a=t.cssHooks[n]||t.cssHooks[l];if(s!==i){u=typeof s;if(u==='string'&&(c=kt.exec(s))){s=(c[1]+ 1)*c[2]+ parseFloat(t.css(e,n));u='number'};if(s==null||u==='number'&&isNaN(s)){return};if(u==='number'&&!t.cssNumber[l]){s+='px'};if(!t.support.clearCloneStyle&&s===''&&n.indexOf('background')===0){f[n]='inherit'};if(!a||!('set'in a)||(s=a.set(e,s,r))!==i){try{f[n]=s}catch(o){}}}else{if(a&&'get'in a&&(c=a.get(e,!1,r))!==i){return c};return f[n]}},css:function(e,n,s,r){var c,o,l,a=t.camelCase(n);n=t.cssProps[a]||(t.cssProps[a]=le(e.style,a));l=t.cssHooks[n]||t.cssHooks[a];if(l&&'get'in l){o=l.get(e,!0,s)};if(o===i){o=m(e,n,r)};if(o==='normal'&&n in Fe){o=Fe[n]};if(s===''||s){c=parseFloat(o);return s===!0||t.isNumeric(c)?c||0:o};return o}});if(e.getComputedStyle){d=function(t){return e.getComputedStyle(t,null)};m=function(e,n,s){var c,l,u,a=s||d(e),o=a?a.getPropertyValue(n)||a[n]:i,r=e.style;if(a){if(o===''&&!t.contains(e.ownerDocument,e)){o=t.style(e,n)};if(A.test(o)&&tt.test(n)){c=r.width;l=r.minWidth;u=r.maxWidth;r.minWidth=r.maxWidth=r.width=o;o=a.width;r.width=c;r.minWidth=l;r.maxWidth=u}};return o}}else if(n.documentElement.currentStyle){d=function(e){return e.currentStyle};m=function(e,t,n){var l,o,a,c=n||d(e),s=c?c[t]:i,r=e.style;if(s==null&&r&&r[t]){s=r[t]};if(A.test(s)&&!Pt.test(t)){l=r.left;o=e.runtimeStyle;a=o&&o.left;if(a){o.left=e.currentStyle.left};r.left=t==='fontSize'?'1em':s;s=r.pixelLeft+'px';r.left=l;if(a){o.left=a}};return s===''?'auto':s}};function ge(e,t,i){var n=xt.exec(t);return n?Math.max(0,n[1]-(i||0))+(n[2]||'px'):t};function Le(e,i,n,s,r){var o=n===(s?'border':'content')?4:i==='width'?1:0,a=0;for(;o<4;o+=2){if(n==='margin'){a+=t.css(e,n+ v[o],!0,r)};if(s){if(n==='content'){a-=t.css(e,'padding'+ v[o],!0,r)};if(n!=='margin'){a-=t.css(e,'border'+ v[o]+'Width',!0,r)}}else{a+=t.css(e,'padding'+ v[o],!0,r);if(n!=='padding'){a+=t.css(e,'border'+ v[o]+'Width',!0,r)}}};return a};function Ae(e,i,n){var a=!0,s=i==='width'?e.offsetWidth:e.offsetHeight,r=d(e),o=t.support.boxSizing&&t.css(e,'boxSizing',!1,r)==='border-box';if(s<=0||s==null){s=m(e,i,r);if(s<0||s==null){s=e.style[i]};if(A.test(s)){return s};a=o&&(t.support.boxSizingReliable||s===e.style[i]);s=parseFloat(s)||0};return(s+ Le(e,i,n||(o?'border':'content'),a,r))+'px'};function He(e){var s=n,i=ot[e];if(!i){i=it(e,s);if(i==='none'||!i){D=(D||t('<iframe frameborder=\'0\' width=\'0\' height=\'0\'/>').css('cssText','display:block !important')).appendTo(s.documentElement);s=(D[0].contentWindow||D[0].contentDocument).document;s.write('<!doctype html><html><body>');s.close();i=it(e,s);D.detach()};ot[e]=i};return i};function it(e,i){var n=t(i.createElement(e)).appendTo(i.body),s=t.css(n[0],'display');n.remove();return s};t.each(['height','width'],function(e,i){t.cssHooks[i]={get:function(e,n,s){if(n){return e.offsetWidth===0&&jt.test(t.css(e,'display'))?t.swap(e,Ht,function(){return Ae(e,i,s)}):Ae(e,i,s)}},set:function(e,n,s){var r=s&&d(e);return ge(e,n,s?Le(e,i,s,t.support.boxSizing&&t.css(e,'boxSizing',!1,r)==='border-box',r):0)}}});if(!t.support.opacity){t.cssHooks.opacity={get:function(e,t){return Bt.test((t&&e.currentStyle?e.currentStyle.filter:e.style.filter)||'')?(0.01*parseFloat(RegExp.$1))+'':t?'1':''},set:function(e,i){var n=e.style,s=e.currentStyle,o=t.isNumeric(i)?'alpha(opacity='+ i*100+')':'',r=s&&s.filter||n.filter||'';n.zoom=1;if((i>=1||i==='')&&t.trim(r.replace(ie,''))===''&&n.removeAttribute){n.removeAttribute('filter');if(i===''||s&&!s.filter){return}};n.filter=ie.test(r)?r.replace(ie,o):r+' '+ o}}};t(function(){if(!t.support.reliableMarginRight){t.cssHooks.marginRight={get:function(e,i){if(i){return t.swap(e,{'display':'inline-block'},m,[e,'marginRight'])}}}};if(!t.support.pixelPosition&&t.fn.position){t.each(['top','left'],function(e,i){t.cssHooks[i]={get:function(e,n){if(n){n=m(e,i);return A.test(n)?t(e).position()[i]+'px':n}}}})}});if(t.expr&&t.expr.filters){t.expr.filters.hidden=function(e){return e.offsetWidth<=0&&e.offsetHeight<=0||(!t.support.reliableHiddenOffsets&&((e.style&&e.style.display)||t.css(e,'display'))==='none')};t.expr.filters.visible=function(e){return!t.expr.filters.hidden(e)}};t.each({margin:'',padding:'',border:'Width'},function(e,i){t.cssHooks[e+ i]={expand:function(t){var n=0,r={},s=typeof t==='string'?t.split(' '):[t];for(;n<4;n++){r[e+ v[n]+ i]=s[n]||s[n- 2]||s[0]};return r}};if(!tt.test(e)){t.cssHooks[e+ i].set=ge}});var ci=/%20/g,oi=/\[\]$/,fe=/\r?\n/g,ri=/^(?:submit|button|image|reset|file)$/i,ni=/^(?:input|select|textarea|keygen)/i;t.fn.extend({serialize:function(){return t.param(this.serializeArray())},serializeArray:function(){return this.map(function(){var e=t.prop(this,'elements');return e?t.makeArray(e):this}).filter(function(){var e=this.type;return this.name&&!t(this).is(':disabled')&&ni.test(this.nodeName)&&!ri.test(e)&&(this.checked||!H.test(e))}).map(function(e,i){var n=t(this).val();return n==null?null:t.isArray(n)?t.map(n,function(e){return{name:i.name,value:e.replace(fe,'\r\n')}}):{name:i.name,value:n.replace(fe,'\r\n')}}).get()}});t.param=function(e,n){var r,s=[],o=function(e,i){i=t.isFunction(i)?i():(i==null?'':i);s[s.length]=encodeURIComponent(e)+'='+ encodeURIComponent(i)};if(n===i){n=t.ajaxSettings&&t.ajaxSettings.traditional};if(t.isArray(e)||(e.jquery&&!t.isPlainObject(e))){t.each(e,function(){o(this.name,this.value)})}else{for(r in e){G(r,e[r],n,o)}};return s.join('&').replace(ci,'+')};function G(e,i,n,s){var r;if(t.isArray(i)){t.each(i,function(t,i){if(n||oi.test(e)){s(e,i)}else{G(e+'['+(typeof i==='object'?t:'')+']',i,n,s)}})}else if(!n&&t.type(i)==='object'){for(r in i){G(e+'['+ r+']',i[r],n,s)}}else{s(e,i)}};t.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(e,i){t.fn[i]=function(e,t){return arguments.length>0?this.on(i,null,e,t):this.trigger(i)}});t.fn.extend({hover:function(e,t){return this.mouseenter(e).mouseleave(t||e)},bind:function(e,t,i){return this.on(e,null,t,i)},unbind:function(e,t){return this.off(e,null,t)},delegate:function(e,t,i,n){return this.on(t,e,i,n)},undelegate:function(e,t,i){return arguments.length===1?this.off(e,'**'):this.off(t,e||'**',i)}});var g,u,ee=t.now(),se=/\?/,at=/#.*$/,je=/([?&])_=[^&]*/,ft=/^(.*?):[ \t]*([^\r\n]*)\r?$/mg,Kt=/^(?:about|app|app-storage|.+-extension|file|res|widget):$/,Vt=/^(?:GET|HEAD)$/,yt=/^\/\//,Pe=/^([\w.+-]+:)(?:\/\/([^\/?#:]*)(?::(\d+)|)|)/,Ie=t.fn.load,Ee={},re={},we='*/'.concat('*');try{u=si.href}catch(s){u=n.createElement('a');u.href='';u=u.href};g=Pe.exec(u.toLowerCase())||[];function et(e){return function(i,n){if(typeof i!=='string'){n=i;i='*'};var s,o=0,r=i.toLowerCase().match(l)||[];if(t.isFunction(n)){while((s=r[o++])){if(s[0]==='+'){s=s.slice(1)||'*';(e[s]=e[s]||[]).unshift(n)}else{(e[s]=e[s]||[]).push(n)}}}}};function Ge(e,i,n,s){var r={},a=(e===re);function o(l){var c;r[l]=!0;t.each(e[l]||[],function(e,t){var l=t(i,n,s);if(typeof l==='string'&&!a&&!r[l]){i.dataTypes.unshift(l);o(l);return!1}else if(a){return!(c=l)}});return c};return o(i.dataTypes[0])||!r['*']&&o('*')};function F(e,n){var r,s,o=t.ajaxSettings.flatOptions||{};for(s in n){if(n[s]!==i){(o[s]?e:(r||(r={})))[s]=n[s]}};if(r){t.extend(!0,e,r)};return e};t.fn.load=function(e,n,s){if(typeof e!=='string'&&Ie){return Ie.apply(this,arguments)};var a,l,c,o=this,r=e.indexOf(' ');if(r>=0){a=e.slice(r,e.length);e=e.slice(0,r)};if(t.isFunction(n)){s=n;n=i}else if(n&&typeof n==='object'){c='POST'};if(o.length>0){t.ajax({url:e,type:c,dataType:'html',data:n}).done(function(e){l=arguments;o.html(a?t('<div>').append(t.parseHTML(e)).find(a):e)}).complete(s&&function(e,t){o.each(s,l||[e.responseText,t,e])})};return this};t.each(['ajaxStart','ajaxStop','ajaxComplete','ajaxError','ajaxSuccess','ajaxSend'],function(e,i){t.fn[i]=function(e){return this.on(i,e)}});t.extend({active:0,lastModified:{},etag:{},ajaxSettings:{url:u,type:'GET',isLocal:Kt.test(g[1]),global:!0,processData:!0,async:!0,contentType:'application/x-www-form-urlencoded; charset=UTF-8',accepts:{'*':we,text:'text/plain',html:'text/html',xml:'application/xml, text/xml',json:'application/json, text/javascript'},contents:{xml:/xml/,html:/html/,json:/json/},responseFields:{xml:'responseXML',text:'responseText',json:'responseJSON'},converters:{'* text':String,'text html':!0,'text json':t.parseJSON,'text xml':t.parseXML},flatOptions:{url:!0,context:!0}},ajaxSetup:function(e,i){return i?F(F(e,t.ajaxSettings),i):F(t.ajaxSettings,e)},ajaxPrefilter:et(Ee),ajaxTransport:et(re),ajax:function(e,n){if(typeof e==='object'){n=e;e=i};n=n||{};var d,p,a,k,w,m,h,y,s=t.ajaxSetup({},n),f=s.context||s,x=s.context&&(f.nodeType||f.jquery)?t(f):t.event,C=t.Deferred(),P=t.Callbacks('once memory'),b=s.statusCode||{},T={},S={},c=0,D='canceled',o={readyState:0,getResponseHeader:function(e){var t;if(c===2){if(!y){y={};while((t=ft.exec(k))){y[t[1].toLowerCase()]=t[2]}};t=y[e.toLowerCase()]};return t==null?null:t},getAllResponseHeaders:function(){return c===2?k:null},setRequestHeader:function(e,t){var i=e.toLowerCase();if(!c){e=S[i]=S[i]||e;T[e]=t};return this},overrideMimeType:function(e){if(!c){s.mimeType=e};return this},statusCode:function(e){var t;if(e){if(c<2){for(t in e){b[t]=[b[t],e[t]]}}else{o.always(e[o.status])}};return this},abort:function(e){var t=e||D;if(h){h.abort(t)};v(0,t);return this}};C.promise(o).complete=P.add;o.success=o.done;o.error=o.fail;s.url=((e||s.url||u)+'').replace(at,'').replace(yt,g[1]+'//');s.type=n.method||n.type||s.method||s.type;s.dataTypes=t.trim(s.dataType||'*').toLowerCase().match(l)||[''];if(s.crossDomain==null){d=Pe.exec(s.url.toLowerCase());s.crossDomain=!!(d&&(d[1]!==g[1]||d[2]!==g[2]||(d[3]||(d[1]==='http:'?'80':'443'))!==(g[3]||(g[1]==='http:'?'80':'443'))))};if(s.data&&s.processData&&typeof s.data!=='string'){s.data=t.param(s.data,s.traditional)};Ge(Ee,s,n,o);if(c===2){return o};m=s.global;if(m&&t.active++===0){t.event.trigger('ajaxStart')};s.type=s.type.toUpperCase();s.hasContent=!Vt.test(s.type);a=s.url;if(!s.hasContent){if(s.data){a=(s.url+=(se.test(a)?'&':'?')+ s.data);delete s.data};if(s.cache===!1){s.url=je.test(a)?a.replace(je,'$1_='+ ee++):a+(se.test(a)?'&':'?')+'_='+ ee++}};if(s.ifModified){if(t.lastModified[a]){o.setRequestHeader('If-Modified-Since',t.lastModified[a])};if(t.etag[a]){o.setRequestHeader('If-None-Match',t.etag[a])}};if(s.data&&s.hasContent&&s.contentType!==!1||n.contentType){o.setRequestHeader('Content-Type',s.contentType)};o.setRequestHeader('Accept',s.dataTypes[0]&&s.accepts[s.dataTypes[0]]?s.accepts[s.dataTypes[0]]+(s.dataTypes[0]!=='*'?', '+ we+'; q=0.01':''):s.accepts['*']);for(p in s.headers){o.setRequestHeader(p,s.headers[p])};if(s.beforeSend&&(s.beforeSend.call(f,o,s)===!1||c===2)){return o.abort()};D='abort';for(p in{success:1,error:1,complete:1}){o[p](s[p])};h=Ge(re,s,n,o);if(!h){v(-1,'No Transport')}else{o.readyState=1;if(m){x.trigger('ajaxSend',[o,s])};if(s.async&&s.timeout>0){w=setTimeout(function(){o.abort('timeout')},s.timeout)};try{c=1;h.send(T,v)}catch(r){if(c<2){v(-1,r)}else{throw r;}}};function v(e,n,r,l){var d,y,v,g,p,u=n;if(c===2){return};c=2;if(w){clearTimeout(w)};h=i;k=l||'';o.readyState=e>0?4:0;d=e>=200&&e<300||e===304;if(r){g=gt(s,o,r)};g=lt(s,g,o,d);if(d){if(s.ifModified){p=o.getResponseHeader('Last-Modified');if(p){t.lastModified[a]=p};p=o.getResponseHeader('etag');if(p){t.etag[a]=p}};if(e===204||s.type==='HEAD'){u='nocontent'}else if(e===304){u='notmodified'}else{u=g.state;y=g.data;v=g.error;d=!v}}else{v=u;if(e||!u){u='error';if(e<0){e=0}}};o.status=e;o.statusText=(n||u)+'';if(d){C.resolveWith(f,[y,u,o])}else{C.rejectWith(f,[o,u,v])};o.statusCode(b);b=i;if(m){x.trigger(d?'ajaxSuccess':'ajaxError',[o,s,d?y:v])};P.fireWith(f,[o,u]);if(m){x.trigger('ajaxComplete',[o,s]);if(!(--t.active)){t.event.trigger('ajaxStop')}}};return o},getJSON:function(e,i,n){return t.get(e,i,n,'json')},getScript:function(e,n){return t.get(e,i,n,'script')}});t.each(['get','post'],function(e,n){t[n]=function(e,s,r,o){if(t.isFunction(s)){o=o||r;r=s;s=i};return t.ajax({url:e,type:n,dataType:o,data:s,success:r})}});function gt(e,t,n){var l,a,r,o,c=e.contents,s=e.dataTypes;while(s[0]==='*'){s.shift();if(a===i){a=e.mimeType||t.getResponseHeader('Content-Type')}};if(a){for(o in c){if(c[o]&&c[o].test(a)){s.unshift(o);break}}};if(s[0]in n){r=s[0]}else{for(o in n){if(!s[0]||e.converters[o+' '+ s[0]]){r=o;break};if(!l){l=o}};r=r||l};if(r){if(r!==s[0]){s.unshift(r)};return n[r]}};function lt(e,t,i,n){var u,r,o,c,l,a={},f=e.dataTypes.slice();if(f[1]){for(o in e.converters){a[o.toLowerCase()]=e.converters[o]}};r=f.shift();while(r){if(e.responseFields[r]){i[e.responseFields[r]]=t};if(!l&&n&&e.dataFilter){t=e.dataFilter(t,e.dataType)};l=r;r=f.shift();if(r){if(r==='*'){r=l}else if(l!=='*'&&l!==r){o=a[l+' '+ r]||a['* '+ r];if(!o){for(u in a){c=u.split(' ');if(c[1]===r){o=a[l+' '+ c[0]]||a['* '+ c[0]];if(o){if(o===!0){o=a[u]}else if(a[u]!==!0){r=c[0];f.unshift(c[1])};break}}}};if(o!==!0){if(o&&e['throws']){t=o(t)}else{try{t=o(t)}catch(s){return{state:'parsererror',error:o?s:'No conversion from '+ l+' to '+ r}}}}}}};return{state:'success',data:t}};t.ajaxSetup({accepts:{script:'text/javascript, application/javascript, application/ecmascript, application/x-ecmascript'},contents:{script:/(?:java|ecma)script/},converters:{'text script':function(e){t.globalEval(e);return e}}});t.ajaxPrefilter('script',function(e){if(e.cache===i){e.cache=!1};if(e.crossDomain){e.type='GET';e.global=!1}});t.ajaxTransport('script',function(e){if(e.crossDomain){var s,r=n.head||t('head')[0]||n.documentElement;return{send:function(t,i){s=n.createElement('script');s.async=!0;if(e.scriptCharset){s.charset=e.scriptCharset};s.src=e.url;s.onload=s.onreadystatechange=function(e,t){if(t||!s.readyState||/loaded|complete/.test(s.readyState)){s.onload=s.onreadystatechange=null;if(s.parentNode){s.parentNode.removeChild(s)};s=null;if(!t){i(200,'success')}}};r.insertBefore(s,r.firstChild)},abort:function(){if(s){s.onload(i,!0)}}}}});var ae=[],te=/(=)\?(?=&|$)|\?\?/;t.ajaxSetup({jsonp:'callback',jsonpCallback:function(){var e=ae.pop()||(t.expando+'_'+(ee++));this[e]=!0;return e}});t.ajaxPrefilter('json jsonp',function(n,s,r){var o,l,a,c=n.jsonp!==!1&&(te.test(n.url)?'url':typeof n.data==='string'&&!(n.contentType||'').indexOf('application/x-www-form-urlencoded')&&te.test(n.data)&&'data');if(c||n.dataTypes[0]==='jsonp'){o=n.jsonpCallback=t.isFunction(n.jsonpCallback)?n.jsonpCallback():n.jsonpCallback;if(c){n[c]=n[c].replace(te,'$1'+ o)}else if(n.jsonp!==!1){n.url+=(se.test(n.url)?'&':'?')+ n.jsonp+'='+ o};n.converters['script json']=function(){if(!a){t.error(o+' was not called')};return a[0]};n.dataTypes[0]='json';l=e[o];e[o]=function(){a=arguments};r.always(function(){e[o]=l;if(n[o]){n.jsonpCallback=s.jsonpCallback;ae.push(o)};if(a&&t.isFunction(l)){l(a[0])};a=l=i});return'script'}});var C,x,ut=0,ne=e.ActiveXObject&&function(){var e;for(e in C){C[e](i,!0)}};function rt(){try{return new e.XMLHttpRequest()}catch(t){}};function mt(){try{return new e.ActiveXObject('Microsoft.XMLHTTP')}catch(t){}};t.ajaxSettings.xhr=e.ActiveXObject?function(){return!this.isLocal&&rt()||mt()}:rt;x=t.ajaxSettings.xhr();t.support.cors=!!x&&('withCredentials'in x);x=t.support.ajax=!!x;if(x){t.ajaxTransport(function(n){if(!n.crossDomain||t.support.cors){var s;return{send:function(r,o){var u,c,l=n.xhr();if(n.username){l.open(n.type,n.url,n.async,n.username,n.password)}else{l.open(n.type,n.url,n.async)};if(n.xhrFields){for(c in n.xhrFields){l[c]=n.xhrFields[c]}};if(n.mimeType&&l.overrideMimeType){l.overrideMimeType(n.mimeType)};if(!n.crossDomain&&!r['X-Requested-With']){r['X-Requested-With']='XMLHttpRequest'};try{for(c in r){l.setRequestHeader(c,r[c])}}catch(a){};l.send((n.hasContent&&n.data)||null);s=function(e,r){var c,d,h,f;try{if(s&&(r||l.readyState===4)){s=i;if(u){l.onreadystatechange=t.noop;if(ne){delete C[u]}};if(r){if(l.readyState!==4){l.abort()}}else{f={};c=l.status;d=l.getAllResponseHeaders();if(typeof l.responseText==='string'){f.text=l.responseText};try{h=l.statusText}catch(a){h=''};if(!c&&n.isLocal&&!n.crossDomain){c=f.text?200:404}else if(c===1223){c=204}}}}catch(a){if(!r){o(-1,a)}};if(f){o(c,h,f,d)}};if(!n.async){s()}else if(l.readyState===4){setTimeout(s)}else{u=++ut;if(ne){if(!C){C={};t(e).unload(ne)};C[u]=s};l.onreadystatechange=s}},abort:function(){if(s){s(i,!0)}}}}})};var k,z,ht=/^(?:toggle|show|hide)$/,Oe=new RegExp('^(?:([+-])=|)('+ I+')([a-z%]*)$','i'),pt=/queueHooks$/,M=[bt],P={'*':[function(e,i){var r=this.createTween(e,i),l=r.cur(),s=Oe.exec(i),o=s&&s[3]||(t.cssNumber[e]?'':'px'),n=(t.cssNumber[e]||o!=='px'&&+l)&&Oe.exec(t.css(r.elem,e)),a=1,c=20;if(n&&n[3]!==o){o=o||n[3];s=s||[];n=+l||1;do{a=a||'.5';n=n/a;t.style(r.elem,e,n+ o)}while(a!==(a=r.cur()/ l) && a !== 1 && --c);
  5. };if(s){n=r.start=+n||+l||0;r.unit=o;r.end=s[1]?n+(s[1]+ 1)*s[2]:+s[2]};return r}]};function Ve(){setTimeout(function(){k=i});return(k=t.now())};function Re(e,t,i){var s,r=(P[t]||[]).concat(P['*']),n=0,o=r.length;for(;n<o;n++){if((s=r[n].call(i,t,e))){return s}}};function We(e,i,n){var l,c,a=0,f=M.length,r=t.Deferred().always(function(){delete u.elem}),u=function(){if(c){return!1};var l=k||Ve(),i=Math.max(0,s.startTime+ s.duration- l),a=i/s.duration||0,t=1- a,n=0,o=s.tweens.length;for(;n<o;n++){s.tweens[n].run(t)};r.notifyWith(e,[s,t,i]);if(t<1&&o){return i}else{r.resolveWith(e,[s]);return!1}},s=r.promise({elem:e,props:t.extend({},i),opts:t.extend(!0,{specialEasing:{}},n),originalProperties:i,originalOptions:n,startTime:k||Ve(),duration:n.duration,tweens:[],createTween:function(i,n){var r=t.Tween(e,s.opts,i,n,s.opts.specialEasing[i]||s.opts.easing);s.tweens.push(r);return r},stop:function(t){var i=0,n=t?s.tweens.length:0;if(c){return this};c=!0;for(;i<n;i++){s.tweens[i].run(1)};if(t){r.resolveWith(e,[s,t])}else{r.rejectWith(e,[s,t])};return this}}),o=s.props;vt(o,s.opts.specialEasing);for(;a<f;a++){l=M[a].call(s,e,o,s.opts);if(l){return l}};t.map(o,Re,s);if(t.isFunction(s.opts.start)){s.opts.start.call(e,s)};t.fx.timer(t.extend(u,{elem:e,anim:s,queue:s.opts.queue}));return s.progress(s.opts.progress).done(s.opts.done,s.opts.complete).fail(s.opts.fail).always(s.opts.always)};function vt(e,i){var n,r,a,s,o;for(n in e){r=t.camelCase(n);a=i[r];s=e[n];if(t.isArray(s)){a=s[1];s=e[n]=s[0]};if(n!==r){e[r]=s;delete e[n]};o=t.cssHooks[r];if(o&&'expand'in o){s=o.expand(s);delete e[r];for(n in s){if(!(n in e)){e[n]=s[n];i[n]=a}}}else{i[r]=a}}};t.Animation=t.extend(We,{tweener:function(e,i){if(t.isFunction(e)){i=e;e=['*']}else{e=e.split(' ')};var n,s=0,r=e.length;for(;s<r;s++){n=e[s];P[n]=P[n]||[];P[n].unshift(i)}},prefilter:function(e,t){if(t){M.unshift(e)}else{M.push(e)}}});function bt(e,i,n){var s,h,d,f,a,p,c=this,u={},o=e.style,l=e.nodeType&&S(e),r=t.i$(e,'fxshow');if(!n.queue){a=t.We$(e,'fx');if(a.unqueued==null){a.unqueued=0;p=a.empty.fire;a.empty.fire=function(){if(!a.unqueued){p()}}};a.unqueued++;c.always(function(){c.always(function(){a.unqueued--;if(!t.queue(e,'fx').length){a.empty.fire()}})})};if(e.nodeType===1&&('height'in i||'width'in i)){n.overflow=[o.overflow,o.overflowX,o.overflowY];if(t.css(e,'display')==='inline'&&t.css(e,'float')==='none'){if(!t.support.inlineBlockNeedsLayout||He(e.nodeName)==='inline'){o.display='inline-block'}else{o.zoom=1}}};if(n.overflow){o.overflow='hidden';if(!t.support.shrinkWrapBlocks){c.always(function(){o.overflow=n.overflow[0];o.overflowX=n.overflow[1];o.overflowY=n.overflow[2]})}};for(s in i){h=i[s];if(ht.exec(h)){delete i[s];d=d||h==='toggle';if(h===(l?'hide':'show')){continue};u[s]=r&&r[s]||t.style(e,s)}};if(!t.isEmptyObject(u)){if(r){if('hidden'in r){l=r.hidden}}else{r=t.i$(e,'fxshow',{})};if(d){r.hidden=!l};if(l){t(e).show()}else{c.done(function(){t(e).hide()})};c.done(function(){var i;t.he$(e,'fxshow');for(i in u){t.style(e,i,u[i])}});for(s in u){f=Re(l?r[s]:0,s,c);if(!(s in r)){r[s]=f.start;if(l){f.end=f.start;f.start=s==='width'||s==='height'?1:0}}}}};function o(e,t,i,n,s){return new o.prototype.init(e,t,i,n,s)};t.Tween=o;o.prototype={constructor:o,init:function(e,i,n,s,r,o){this.elem=e;this.prop=n;this.easing=r||'swing';this.options=i;this.start=this.now=this.cur();this.end=s;this.unit=o||(t.cssNumber[n]?'':'px')},cur:function(){var e=o.propHooks[this.prop];return e&&e.get?e.get(this):o.propHooks.x$.get(this)},run:function(e){var n,i=o.propHooks[this.prop];if(this.options.duration){this.pos=n=t.easing[this.easing](e,this.options.duration*e,0,1,this.options.duration)}else{this.pos=n=e};this.now=(this.end- this.start)*n+ this.start;if(this.options.step){this.options.step.call(this.elem,this.now,this)};if(i&&i.set){i.set(this)}else{o.propHooks.x$.set(this)};return this}};o.prototype.init.prototype=o.prototype;o.propHooks={x$:{get:function(e){var i;if(e.elem[e.prop]!=null&&(!e.elem.style||e.elem.style[e.prop]==null)){return e.elem[e.prop]};i=t.css(e.elem,e.prop,'');return!i||i==='auto'?0:i},set:function(e){if(t.fx.step[e.prop]){t.fx.step[e.prop](e)}else if(e.elem.style&&(e.elem.style[t.cssProps[e.prop]]!=null||t.cssHooks[e.prop])){t.style(e.elem,e.prop,e.now+ e.unit)}else{e.elem[e.prop]=e.now}}}};o.propHooks.scrollTop=o.propHooks.scrollLeft={set:function(e){if(e.elem.nodeType&&e.elem.parentNode){e.elem[e.prop]=e.now}}};t.each(['toggle','show','hide'],function(e,i){var n=t.fn[i];t.fn[i]=function(e,t,s){return e==null||typeof e==='boolean'?n.apply(this,arguments):this.animate(L(i,!0),e,t,s)}});t.fn.extend({fadeTo:function(e,t,i,n){return this.filter(S).css('opacity',0).show().end().animate({opacity:t},e,i,n)},animate:function(e,i,n,s){var a=t.isEmptyObject(e),o=t.speed(i,n,s),r=function(){var i=We(this,t.extend({},e),o);if(a||t.i$(this,'finish')){i.stop(!0)}};r.finish=r;return a||o.queue===!1?this.each(r):this.queue(o.queue,r)},stop:function(e,n,s){var r=function(e){var t=e.stop;delete e.stop;t(s)};if(typeof e!=='string'){s=n;n=e;e=i};if(n&&e!==!1){this.queue(e||'fx',[])};return this.each(function(){var a=!0,i=e!=null&&e+'queueHooks',o=t.timers,n=t.i$(this);if(i){if(n[i]&&n[i].stop){r(n[i])}}else{for(i in n){if(n[i]&&n[i].stop&&pt.test(i)){r(n[i])}}};for(i=o.length;i--;){if(o[i].elem===this&&(e==null||o[i].queue===e)){o[i].anim.stop(s);a=!1;o.splice(i,1)}};if(a||!s){t.dequeue(this,e)}})},finish:function(e){if(e!==!1){e=e||'fx'};return this.each(function(){var i,r=t.i$(this),s=r[e+'queue'],o=r[e+'queueHooks'],n=t.timers,a=s?s.length:0;r.finish=!0;t.queue(this,e,[]);if(o&&o.stop){o.stop.call(this,!0)};for(i=n.length;i--;){if(n[i].elem===this&&n[i].queue===e){n[i].anim.stop(!0);n.splice(i,1)}};for(i=0;i<a;i++){if(s[i]&&s[i].finish){s[i].finish.call(this)}};delete r.finish})}});function L(e,t){var s,i={height:e},n=0;t=t?1:0;for(;n<4;n+=2- t){s=v[n];i['margin'+ s]=i['padding'+ s]=e};if(t){i.opacity=i.width=e};return i};t.each({slideDown:L('show'),slideUp:L('hide'),slideToggle:L('toggle'),fadeIn:{opacity:'show'},fadeOut:{opacity:'hide'},fadeToggle:{opacity:'toggle'}},function(e,i){t.fn[e]=function(e,t,n){return this.animate(i,e,t,n)}});t.speed=function(e,i,n){var s=e&&typeof e==='object'?t.extend({},e):{complete:n||!n&&i||t.isFunction(e)&&e,duration:e,easing:n&&i||i&&!t.isFunction(i)&&i};s.duration=t.fx.off?0:typeof s.duration==='number'?s.duration:s.duration in t.fx.speeds?t.fx.speeds[s.duration]:t.fx.speeds.x$;if(s.queue==null||s.queue===!0){s.queue='fx'};s.old=s.complete;s.complete=function(){if(t.isFunction(s.old)){s.old.call(this)};if(s.queue){t.dequeue(this,s.queue)}};return s};t.easing={linear:function(e){return e},swing:function(e){return 0.5- Math.cos(e*Math.PI)/ 2
  6. }};t.timers=[];t.fx=o.prototype.init;t.fx.tick=function(){var s,n=t.timers,e=0;k=t.now();for(;e<n.length;e++){s=n[e];if(!s()&&n[e]===s){n.splice(e--,1)}};if(!n.length){t.fx.stop()};k=i};t.fx.timer=function(e){if(e()&&t.timers.push(e)){t.fx.start()}};t.fx.interval=13;t.fx.start=function(){if(!z){z=setInterval(t.fx.tick,t.fx.interval)}};t.fx.stop=function(){clearInterval(z);z=null};t.fx.speeds={slow:600,fast:200,x$:400};t.fx.step={};if(t.expr&&t.expr.filters){t.expr.filters.animated=function(e){return t.grep(t.timers,function(t){return e===t.elem}).length}};t.fn.offset=function(e){if(arguments.length){return e===i?this:this.each(function(i){t.offset.setOffset(this,e,i)})};var n,a,r={top:0,left:0},s=this[0],o=s&&s.ownerDocument;if(!o){return};n=o.documentElement;if(!t.contains(n,s)){return r};if(typeof s.getBoundingClientRect!==c){r=s.getBoundingClientRect()};a=qe(o);return{top:r.top+(a.pageYOffset||n.scrollTop)-(n.clientTop||0),left:r.left+(a.pageXOffset||n.scrollLeft)-(n.clientLeft||0)}};t.offset={setOffset:function(e,i,n){var u=t.css(e,'position');if(u==='static'){e.style.position='relative'};var l=t(e),a=l.offset(),h=t.css(e,'top'),f=t.css(e,'left'),d=(u==='absolute'||u==='fixed')&&t.inArray('auto',[h,f])>-1,s={},o={},c,r;if(d){o=l.position();c=o.top;r=o.left}else{c=parseFloat(h)||0;r=parseFloat(f)||0};if(t.isFunction(i)){i=i.call(e,n,a)};if(i.top!=null){s.top=(i.top- a.top)+ c};if(i.left!=null){s.left=(i.left- a.left)+ r};if('using'in i){i.using.call(e,s)}else{l.css(s)}}};t.fn.extend({position:function(){if(!this[0]){return};var i,s,e={top:0,left:0},n=this[0];if(t.css(n,'position')==='fixed'){s=n.getBoundingClientRect()}else{i=this.offsetParent();s=this.offset();if(!t.nodeName(i[0],'html')){e=i.offset()};e.top+=t.css(i[0],'borderTopWidth',!0);e.left+=t.css(i[0],'borderLeftWidth',!0)};return{top:s.top- e.top- t.css(n,'marginTop',!0),left:s.left- e.left- t.css(n,'marginLeft',!0)}},offsetParent:function(){return this.map(function(){var e=this.offsetParent||oe;while(e&&(!t.nodeName(e,'html')&&t.css(e,'position')==='static')){e=e.offsetParent};return e||oe})}});t.each({scrollLeft:'pageXOffset',scrollTop:'pageYOffset'},function(e,n){var s=/Y/.test(n);t.fn[e]=function(r){return t.access(this,function(e,r,o){var a=qe(e);if(o===i){return a?(n in a)?a[n]:a.document.documentElement[r]:e[r]};if(a){a.scrollTo(!s?o:t(a).scrollLeft(),s?o:t(a).scrollTop())}else{e[r]=o}},e,r,arguments.length,null)}});function qe(e){return t.isWindow(e)?e:e.nodeType===9?e.defaultView||e.parentWindow:!1};t.each({Height:'height',Width:'width'},function(e,n){t.each({padding:'inner'+ e,content:n,'':'outer'+ e},function(s,r){t.fn[r]=function(r,o){var l=arguments.length&&(s||typeof r!=='boolean'),a=s||(r===!0||o===!0?'margin':'border');return t.access(this,function(n,s,r){var o;if(t.isWindow(n)){return n.document.documentElement['client'+ e]};if(n.nodeType===9){o=n.documentElement;return Math.max(n.body['scroll'+ e],o['scroll'+ e],n.body['offset'+ e],o['offset'+ e],o['client'+ e])};return r===i?t.css(n,s,a):t.style(n,s,r,a)},n,l?r:i,l,null)}})});t.fn.size=function(){return this.length};t.fn.andSelf=t.fn.addBack;if(typeof module==='object'&&module&&typeof module.exports==='object'){module.exports=t}else{e.jQuery=e.$=t;if(typeof define==='function'&&define.amd){define('jquery',[],function(){return t})}}})(window);(function(e,t,i){var a={};e.migrateWarnings=[];if(!e.migrateMute&&t.console&&t.console.log){t.console.log('JQMIGRATE: Logging is active')};if(e.migrateTrace===i){e.migrateTrace=!0};e.migrateReset=function(){a={};e.migrateWarnings.length=0};function n(i){var n=t.console;if(!a[i]){a[i]=!0;e.migrateWarnings.push(i);if(n&&n.warn&&!e.migrateMute){n.warn('JQMIGRATE: '+ i);if(e.migrateTrace&&n.trace){n.trace()}}}};function l(t,i,s,r){if(Object.defineProperty){try{Object.defineProperty(t,i,{configurable:!0,enumerable:!0,get:function(){n(r);return s},set:function(e){n(r);s=e}});return}catch(o){}};e.Wi$=!0;t[i]=s};if(document.compatMode==='BackCompat'){n('jQuery is not compatible with Quirks Mode')};var o=e('<input/>',{size:1}).attr('size')&&e.attrFn,u=e.attr,x=e.attrHooks.value&&e.attrHooks.value.get||function(){return null},y=e.attrHooks.value&&e.attrHooks.value.set||function(){return i},w=/^(?:input|button)$/i,v=/^[238]$/,k=/^(?:autofocus|autoplay|async|checked|controls|defer|disabled|hidden|loop|multiple|open|readonly|required|scoped|selected)$/i,b=/^(?:checked|selected)$/i;l(e,'attrFn',o||{},'jQuery.attrFn is deprecated');e.attr=function(t,s,r,a){var l=s.toLowerCase(),c=t&&t.nodeType;if(a){if(u.length<4){n('jQuery.fn.attr( props, pass ) is deprecated')};if(t&&!v.test(c)&&(o?s in attrFn:e.isFunction(e.fn[s]))){return e(t)[s](r)}};if(s==='type'&&r!==i&&w.test(t.nodeName)&&t.parentNode){n('Can\'t change the \'type\' of an input or button in IE 6/7/8')};if(!e.attrHooks[l]&&k.test(l)){e.attrHooks[l]={get:function(t,n){var r,s=e.prop(t,n);return s===!0||typeof s!=='boolean'&&(r=t.getAttributeNode(n))&&r.nodeValue!==!1?n.toLowerCase():i},set:function(t,i,n){var s;if(i===!1){e.removeAttr(t,n)}else{s=e.propFix[n]||n;if(s in t){t[s]=!0};t.setAttribute(n,n.toLowerCase())};return n}};if(b.test(l)){n('jQuery.fn.attr(\''+ l+'\') may use property instead of attribute')}};return u.call(e,t,s,r)};e.attrHooks.value={get:function(e,t){var i=(e.nodeName||'').toLowerCase();if(i==='button'){return x.apply(this,arguments)};if(i!=='input'&&i!=='option'){n('jQuery.fn.attr(\'value\') no longer gets properties')};return t in e?e.value:null},set:function(e,t){var i=(e.nodeName||'').toLowerCase();if(i==='button'){return y.apply(this,arguments)};if(i!=='input'&&i!=='option'){n('jQuery.fn.attr(\'value\', val) no longer sets properties')};e.value=t}};var r,s,f=e.fn.init,N=e.parseJSON,E=/^([^<]*)(<[\w\W]+>)([^>]*)$/;e.fn.init=function(t,i,s){var r;if(t&&typeof t==='string'&&!e.isPlainObject(i)&&(r=E.exec(e.trim(t)))&&r[0]){if(t.charAt(0)!=='<'){n('$(html) HTML strings must start with \'<\' character')};if(r[3]){n('$(html) HTML text after last tag is ignored')};if(r[0].charAt(0)==='#'){n('HTML string cannot start with a \'#\' character');e.error('JQMIGRATE: Invalid selector string (XSS)')};if(i&&i.context){i=i.context};if(e.parseHTML){return f.call(this,e.parseHTML(r[2],i,!0),i,s)}};return f.apply(this,arguments)};e.fn.init.prototype=e.fn;e.parseJSON=function(e){if(!e&&e!==null){n('jQuery.parseJSON requires a valid JSON string');return null};return N.apply(this,arguments)};e.uaMatch=function(e){e=e.toLowerCase();var t=/(chrome)[ \/]([\w.]+)/.exec(e)||/(webkit)[ \/]([\w.]+)/.exec(e)||/(opera)(?:.*version|)[ \/]([\w.]+)/.exec(e)||/(msie) ([\w.]+)/.exec(e)||e.indexOf('compatible')<0&&/(mozilla)(?:.*? rv:([\w.]+)|)/.exec(e)||[];return{browser:t[1]||'',version:t[2]||'0'}};if(!e.browser){r=e.uaMatch(navigator.userAgent);s={};if(r.browser){s[r.browser]=!0;s.version=r.version};if(s.chrome){s.webkit=!0}else if(s.webkit){s.safari=!0};e.browser=s};l(e,'browser',e.browser,'jQuery.browser is deprecated');e.sub=function(){function t(e,i){return new t.fn.init(e,i)};e.extend(!0,t,this);t.superclass=this;t.fn=t.prototype=this();t.fn.constructor=t;t.sub=this.sub;t.fn.init=function(n,s){if(s&&s instanceof e&&!(s instanceof t)){s=t(s)};return e.fn.init.call(this,n,s,i)};t.fn.init.prototype=t.fn;var i=t(document);n('jQuery.sub() is deprecated');return t};e.ajaxSetup({converters:{'text json':e.parseJSON}});var C=e.fn.data;e.fn.data=function(t){var o,s,r=this[0];if(r&&t==='events'&&arguments.length===1){o=e.data(r,t);s=e.i$(r,t);if((o===i||o===s)&&s!==i){n('Use of jQuery.fn.data(\'events\') is deprecated');return s}};return C.apply(this,arguments)};var j=/\/(java|ecma)script/i,A=e.fn.andSelf||e.fn.addBack;e.fn.andSelf=function(){n('jQuery.fn.andSelf() replaced by jQuery.fn.addBack()');return A.apply(this,arguments)};if(!e.clean){e.clean=function(t,i,s,r){i=i||document;i=!i.nodeType&&i[0]||i;i=i.ownerDocument||i;n('jQuery.clean() is deprecated');var l,o,c,u,a=[];e.merge(a,e.buildFragment(t,i).childNodes);if(s){c=function(e){if(!e.type||j.test(e.type)){return r?r.push(e.parentNode?e.parentNode.removeChild(e):e):s.appendChild(e)}};for(l=0;(o=a[l])!=null;l++){if(!(e.nodeName(o,'script')&&c(o))){s.appendChild(o);if(typeof o.getElementsByTagName!=='undefined'){u=e.grep(e.merge([],o.getElementsByTagName('script')),c);a.splice.apply(a,[l+ 1,0].concat(u));l+=u.length}}}};return a}};var D=e.event.add,S=e.event.remove,T=e.event.trigger,P=e.fn.toggle,p=e.fn.live,d=e.fn.die,g='ajaxStart|ajaxStop|ajaxSend|ajaxComplete|ajaxError|ajaxSuccess',m=new RegExp('\\b(?:'+ g+')\\b'),h=/(?:^|\s)hover(\.\S+|)\b/,c=function(t){if(typeof(t)!=='string'||e.event.special.hover){return t};if(h.test(t)){n('\'hover\' pseudo-event is deprecated, use \'mouseenter mouseleave\'')};return t&&t.replace(h,'mouseenter$1 mouseleave$1')};if(e.event.props&&e.event.props[0]!=='attrChange'){e.event.props.unshift('attrChange','attrName','relatedNode','srcElement')};if(e.event.dispatch){l(e.event,'handle',e.event.dispatch,'jQuery.event.handle is undocumented and deprecated')};e.event.add=function(e,t,i,s,r){if(e!==document&&m.test(t)){n('AJAX events should be attached to document: '+ t)};D.call(this,e,c(t||''),i,s,r)};e.event.remove=function(e,t,i,n,s){S.call(this,e,c(t)||'',i,n,s)};e.fn.error=function(){var e=Array.prototype.slice.call(arguments,0);n('jQuery.fn.error() is deprecated');e.splice(0,0,'error');if(arguments.length){return this.bind.apply(this,e)};this.triggerHandler.apply(this,e);return this};e.fn.toggle=function(t,i){if(!e.isFunction(t)||!e.isFunction(i)){return P.apply(this,arguments)};n('jQuery.fn.toggle(handler, handler...) is deprecated');var r=arguments,a=t.guid||e.guid++,s=0,o=function(i){var n=(e.i$(this,'lastToggle'+ t.guid)||0)%s;e.i$(this,'lastToggle'+ t.guid,n+ 1);i.preventDefault();return r[n].apply(this,arguments)||!1};o.guid=a;while(s<r.length){r[s++].guid=a};return this.click(o)};e.fn.live=function(t,i,s){n('jQuery.fn.live() is deprecated');if(p){return p.apply(this,arguments)};e(this.context).on(t,this.selector,i,s);return this};e.fn.die=function(t,i){n('jQuery.fn.die() is deprecated');if(d){return d.apply(this,arguments)};e(this.context).off(t,this.selector||'**',i);return this};e.event.trigger=function(e,t,i,s){if(!i&&!m.test(e)){n('Global events are undocumented and deprecated')};return T.call(this,e,t,i||document,s)};e.each(g.split('|'),function(t,i){e.event.special[i]={setup:function(){var t=this;if(t!==document){e.event.add(document,i+'.'+ e.guid,function(){e.event.trigger(i,null,t,!0)});e.i$(this,i,e.guid++)};return!1},teardown:function(){if(this!==document){e.event.remove(document,i+'.'+ e.i$(this,i))};return!1}}})})(jQuery,window);(function(e){'use strict';if(typeof define==='function'&&define.amd){define(['jquery'],e)}else{e((typeof(jQuery)!='undefined')?jQuery:window.Zepto)}}(function(e){'use strict';var i={};i.fileapi=e('<input type=\'file\'/>').get(0).files!==undefined;i.formdata=window.FormData!==undefined;var r=!!e.fn.prop;e.fn.attr2=function(){if(!r){return this.attr.apply(this,arguments)};var e=this.prop.apply(this,arguments);if((e&&e.jquery)||typeof e==='string'){return e};return this.attr.apply(this,arguments)};e.fn.ajaxSubmit=function(n){if(!this.length){t('ajaxSubmit: skipping submit process - no element selected');return this};var o,v,a,s=this;if(typeof n=='function'){n={success:n}}else if(n===undefined){n={}};o=n.type||this.attr2('method');v=n.url||this.attr2('action');a=(typeof v==='string')?e.trim(v):'';a=a||window.location.href||'';if(a){a=(a.match(/^([^#]+)/)||[])[1]};n=e.extend(!0,{url:a,success:e.ajaxSettings.success,type:o||e.ajaxSettings.type,iframeSrc:/^https/i.test(window.location.href||'')?'javascript:false':'about:blank'},n);var d={};this.trigger('form-pre-serialize',[this,n,d]);if(d.veto){t('ajaxSubmit: submit vetoed via form-pre-serialize trigger');return this};if(n.beforeSerialize&&n.beforeSerialize(this,n)===!1){t('ajaxSubmit: submit aborted via beforeSerialize callback');return this};var p=n.traditional;if(p===undefined){p=e.ajaxSettings.traditional};var h=[],m,l=this.formToArray(n.semantic,h);if(n.data){n.extraData=n.data;m=e.param(n.data,p)};if(n.beforeSubmit&&n.beforeSubmit(l,this,n)===!1){t('ajaxSubmit: submit aborted via beforeSubmit callback');return this};this.trigger('form-submit-validate',[l,this,n,d]);if(d.veto){t('ajaxSubmit: submit vetoed via form-submit-validate trigger');return this};var u=e.param(l,p);if(m){u=(u?(u+'&'+ m):m)};if(n.type.toUpperCase()=='GET'){n.url+=(n.url.indexOf('?')>=0?'&':'?')+ u;n.data=null}else{n.data=u};var c=[];if(n.resetForm){c.push(function(){s.resetForm()})};if(n.clearForm){c.push(function(){s.clearForm(n.includeHidden)})};if(!n.dataType&&n.target){var S=n.success||function(){};c.push(function(t){var i=n.replaceTarget?'replaceWith':'html';e(n.target)[i](t).each(S,arguments)})}else if(n.success){c.push(n.success)};n.success=function(e,t,i){var o=n.context||this;for(var r=0,a=c.length;r<a;r++){c[r].apply(o,[e,t,i||s,s])}};if(n.error){var D=n.error;n.error=function(e,t,i){var r=n.context||this;D.apply(r,[e,t,i,s])}};if(n.complete){var j=n.complete;n.complete=function(e,t){var i=n.context||this;j.apply(i,[e,t,s])}};var P=e('input[type=file]:enabled',this).filter(function(){return e(this).val()!==''}),x=P.length>0,y='multipart/form-data',w=(s.attr('enctype')==y||s.attr('encoding')==y),b=i.fileapi&&i.formdata;t('fileAPI :'+ b);var N=(x||w)&&!b,f;if(n.iframe!==!1&&(n.iframe||N)){if(n.closeKeepAlive){e.get(n.closeKeepAlive,function(){f=k(l)})}else{f=k(l)}}else if((x||w)&&b){f=T(l)}else{f=e.ajax(n)};s.removeData('jqxhr').data('jqxhr',f);for(var g=0;g<h.length;g++){h[g]=null};this.trigger('form-submit-notify',[this,n]);return this;function C(t){var s=e.param(t,n.traditional).split('&'),a=s.length,o=[],i,r;for(i=0;i<a;i++){s[i]=s[i].replace(/\+/g,' ');r=s[i].split('=');o.push([decodeURIComponent(r[0]),decodeURIComponent(r[1])])};return o};function T(t){var a=new FormData();for(var i=0;i<t.length;i++){a.append(t[i].name,t[i].value)};if(n.extraData){var r=C(n.extraData);for(i=0;i<r.length;i++){if(r[i]){a.append(r[i][0],r[i][1])}}};n.data=null;var s=e.extend(!0,{},e.ajaxSettings,n,{contentType:!1,processData:!1,cache:!1,type:o||'POST'});if(n.uploadProgress){s.xhr=function(){var t=e.ajaxSettings.xhr();if(t.upload){t.upload.addEventListener('progress',function(e){var i=0,s=e.loaded||e.position,t=e.total;if(e.lengthComputable){i=Math.ceil(s/t*100)};n.uploadProgress(e,s,t,i)},!1)};return t}};s.data=null;var l=s.beforeSend;s.beforeSend=function(e,t){if(n.formData){t.data=n.formData}else{t.data=a};if(l){l.call(this,e,t)}};return e.ajax(s)};function k(i){var u=s[0],C,x,a,m,w,d,f,l,b,g,k,y,p=e.Deferred();p.abort=function(e){l.abort(e)};if(i){for(x=0;x<h.length;x++){C=e(h[x]);if(r){C.prop('disabled',!1)}else{C.removeAttr('disabled')}}};a=e.extend(!0,{},e.ajaxSettings,n);a.context=a.context||a;w='jqFormIO'+(new Date().getTime());if(a.iframeTarget){d=e(a.iframeTarget);g=d.attr2('name');if(!g){d.attr2('name',w)}else{w=g}}else{d=e('<iframe name="'+ w+'" src="'+ a.iframeSrc+'" />');d.css({position:'absolute',top:'-1000px',left:'-1000px'})};f=d[0];l={aborted:0,responseText:null,responseXML:null,status:0,statusText:'n/a',getAllResponseHeaders:function(){},getResponseHeader:function(){},setRequestHeader:function(){},abort:function(i){var s=(i==='timeout'?'timeout':'aborted');t('aborting upload... '+ s);this.aborted=1;try{if(f.contentWindow.document.execCommand){f.contentWindow.document.execCommand('Stop')}}catch(n){};d.attr('src',a.iframeSrc);l.error=s;if(a.error){a.error.call(a.context,l,s,i)};if(m){e.event.trigger('ajaxError',[l,a,s])};if(a.complete){a.complete.call(a.context,l,s)}}};m=a.global;if(m&&0===e.active++){e.event.trigger('ajaxStart')};if(m){e.event.trigger('ajaxSend',[l,a])};if(a.beforeSend&&a.beforeSend.call(a.context,l,a)===!1){if(a.global){e.active--};p.reject();return p};if(l.aborted){p.reject();return p};b=u.clk;if(b){g=b.name;if(g&&!b.disabled){a.extraData=a.extraData||{};a.extraData[g]=b.value;if(b.type=='image'){a.extraData[g+'.x']=u.clk_x;a.extraData[g+'.y']=u.clk_y}}};var j=1,T=2;function N(e){var n=null;try{if(e.contentWindow){n=e.contentWindow.document}}catch(i){t('cannot get iframe.contentWindow document: '+ i)};if(n){return n};try{n=e.contentDocument?e.contentDocument:e.document}catch(i){t('cannot get iframe.contentDocument: '+ i);n=e.document};return n};var E=e('meta[name=csrf-token]').attr('content'),A=e('meta[name=csrf-param]').attr('content');if(A&&E){a.extraData=a.extraData||{};a.extraData[A]=E};function D(){var h=s.attr2('target'),c=s.attr2('action'),g='multipart/form-data',m=s.attr('enctype')||s.attr('encoding')||g;u.setAttribute('target',w);if(!o||/post/i.test(o)){u.setAttribute('method','POST')};if(c!=a.url){u.setAttribute('action',a.url)};if(!a.skipEncodingOverride&&(!o||/post/i.test(o))){s.attr({encoding:'multipart/form-data',enctype:'multipart/form-data'})};if(a.timeout){y=setTimeout(function(){k=!0;v(j)},a.timeout)};function l(){try{var i=N(f).readyState;t('state = '+ i);if(i&&i.toLowerCase()=='uninitialized'){setTimeout(l,50)}}catch(e){t('Server abort: ',e,' (',e.name,')');v(T);if(y){clearTimeout(y)};y=undefined}};var r=[];try{if(a.extraData){for(var n in a.extraData){if(a.extraData.hasOwnProperty(n)){if(e.isPlainObject(a.extraData[n])&&a.extraData[n].hasOwnProperty('name')&&a.extraData[n].hasOwnProperty('value')){r.push(e('<input type="hidden" name="'+ a.extraData[n].name+'">').val(a.extraData[n].value).appendTo(u)[0])}else{r.push(e('<input type="hidden" name="'+ n+'">').val(a.extraData[n]).appendTo(u)[0])}}}};if(!a.iframeTarget){d.appendTo('body')};if(f.attachEvent){f.attachEvent('onload',v)}else{f.addEventListener('load',v,!1)};setTimeout(l,15);try{u.submit()}catch(i){var p=document.createElement('form').submit;p.apply(u)}}finally{u.setAttribute('action',c);u.setAttribute('enctype',m);if(h){u.setAttribute('target',h)}else{s.removeAttr('target')};e(r).remove()}};if(a.forceSync){D()}else{setTimeout(D,10)};var S,c,M=50,P;function v(i){if(l.aborted||P){return};c=N(f);if(!c){t('cannot access response document');i=T};if(i===j&&l){l.abort('timeout');p.reject(l,'timeout');return}else if(i==T&&l){l.abort('server abort');p.reject(l,'error','server abort');return};if(!c||c.location.href==a.iframeSrc){if(!k){return}};if(f.detachEvent){f.detachEvent('onload',v)}else{f.removeEventListener('load',v,!1)};var s='success',r;try{if(k){throw'timeout';};var w=a.dataType=='xml'||c.XMLDocument||e.isXMLDoc(c);t('isXml='+ w);if(!w&&window.opera&&(c.body===null||!c.body.innerHTML)){if(--M){t('requeing onLoad callback, DOM not available');setTimeout(v,250);return}};var o=c.body?c.body:c.documentElement;l.responseText=o?o.innerHTML:null;l.responseXML=c.XMLDocument?c.XMLDocument:c;if(w){a.dataType='xml'};l.getResponseHeader=function(e){var t={'content-type':a.dataType};return t[e.toLowerCase()]};if(o){l.status=Number(o.getAttribute('status'))||l.status;l.statusText=o.getAttribute('statusText')||l.statusText};var b=(a.dataType||'').toLowerCase(),x=/(json|script|text)/.test(b);if(x||a.textarea){var u=c.getElementsByTagName('textarea')[0];if(u){l.responseText=u.value;l.status=Number(u.getAttribute('status'))||l.status;l.statusText=u.getAttribute('statusText')||l.statusText}else if(x){var h=c.getElementsByTagName('pre')[0],g=c.getElementsByTagName('body')[0];if(h){l.responseText=h.textContent?h.textContent:h.innerText}else if(g){l.responseText=g.textContent?g.textContent:g.innerText}}}else if(b=='xml'&&!l.responseXML&&l.responseText){l.responseXML=I(l.responseText)};try{S=L(l,b,a)}catch(n){s='parsererror';l.error=r=(n||s)}}catch(n){t('error caught: ',n);s='error';l.error=r=(n||s)};if(l.aborted){t('upload aborted');s=null};if(l.status){s=(l.status>=200&&l.status<300||l.status===304)?'success':'error'};if(s==='success'){if(a.success){a.success.call(a.context,S,'success',l)};p.resolve(l.responseText,'success',l);if(m){e.event.trigger('ajaxSuccess',[l,a])}}else if(s){if(r===undefined){r=l.statusText};if(a.error){a.error.call(a.context,l,s,r)};p.reject(l,'error',r);if(m){e.event.trigger('ajaxError',[l,a,r])}};if(m){e.event.trigger('ajaxComplete',[l,a])};if(m&&!--e.active){e.event.trigger('ajaxStop')};if(a.complete){a.complete.call(a.context,l,s)};P=!0;if(a.timeout){clearTimeout(y)};setTimeout(function(){if(!a.iframeTarget){d.remove()}else{d.attr('src',a.iframeSrc)};l.responseXML=null},100)};var I=e.parseXML||function(e,t){if(window.ActiveXObject){t=new ActiveXObject('Microsoft.XMLDOM');t.async='false';t.loadXML(e)}else{t=(new DOMParser()).parseFromString(e,'text/xml')};return(t&&t.documentElement&&t.documentElement.nodeName!='parsererror')?t:null},z=e.parseJSON||function(e){return window['eval']('('+ e+')')},L=function(t,i,n){var r=t.getResponseHeader('content-type')||'',o=i==='xml'||!i&&r.indexOf('xml')>=0,s=o?t.responseXML:t.responseText;if(o&&s.documentElement.nodeName==='parsererror'){if(e.error){e.error('parsererror')}};if(n&&n.dataFilter){s=n.dataFilter(s,i)};if(typeof s==='string'){if(i==='json'||!i&&r.indexOf('json')>=0){s=z(s)}else if(i==='script'||!i&&r.indexOf('javascript')>=0){e.globalEval(s)}};return s};return p}};e.fn.ajaxForm=function(i){i=i||{};i.delegation=i.delegation&&e.isFunction(e.fn.on);if(!i.delegation&&this.length===0){var r={s:this.selector,c:this.context};if(!e.isReady&&r.s){t('DOM not ready, queuing ajaxForm');e(function(){e(r.s,r.c).ajaxForm(i)});return this};t('terminating; zero elements found by selector'+(e.isReady?'':' (DOM not ready)'));return this};if(i.delegation){e(document).off('submit.form-plugin',this.selector,n).off('click.form-plugin',this.selector,s).on('submit.form-plugin',this.selector,i,n).on('click.form-plugin',this.selector,i,s);return this};return this.ajaxFormUnbind().bind('submit.form-plugin',i,n).bind('click.form-plugin',i,s)};function n(t){var i=t.data;if(!t.isDefaultPrevented()){t.preventDefault();e(t.target).ajaxSubmit(i)}};function s(t){var n=t.target,s=e(n);if(!(s.is('[type=submit],[type=image]'))){var r=s.closest('[type=submit]');if(r.length===0){return};n=r[0]};var i=this;i.clk=n;if(n.type=='image'){if(t.offsetX!==undefined){i.clk_x=t.offsetX;i.clk_y=t.offsetY}else if(typeof e.fn.offset=='function'){var o=s.offset();i.clk_x=t.pageX- o.left;i.clk_y=t.pageY- o.top}else{i.clk_x=t.pageX- n.offsetLeft;i.clk_y=t.pageY- n.offsetTop}};setTimeout(function(){i.clk=i.clk_x=i.clk_y=null},100)};e.fn.ajaxFormUnbind=function(){return this.unbind('submit.form-plugin click.form-plugin')};e.fn.formToArray=function(t,n){var o=[];if(this.length===0){return o};var a=this[0],b=this.attr('id'),l=t?a.getElementsByTagName('*'):a.elements,d;if(l&&!/MSIE [678]/.test(navigator.userAgent)){l=e(l).get()};if(b){d=e(':input[form='+ b+']').get();if(d.length){l=(l||[]).concat(d)}};if(!l||!l.length){return o};var f,u,r,c,s,g,v;for(f=0,g=l.length;f<g;f++){s=l[f];r=s.name;if(!r||s.disabled){continue};if(t&&a.clk&&s.type=='image'){if(a.clk==s){o.push({name:r,value:e(s).val(),type:s.type});o.push({name:r+'.x',value:a.clk_x},{name:r+'.y',value:a.clk_y})};continue};c=e.fieldValue(s,!0);if(c&&c.constructor==Array){if(n){n.push(s)};for(u=0,v=c.length;u<v;u++){o.push({name:r,value:c[u]})}}else if(i.fileapi&&s.type=='file'){if(n){n.push(s)};var p=s.files;if(p.length){for(u=0;u<p.length;u++){o.push({name:r,value:p[u],type:s.type})}}else{o.push({name:r,value:'',type:s.type})}}else if(c!==null&&typeof c!='undefined'){if(n){n.push(s)};o.push({name:r,value:c,type:s.type,required:s.required})}};if(!t&&a.clk){var m=e(a.clk),h=m[0];r=h.name;if(r&&!h.disabled&&h.type=='image'){o.push({name:r,value:m.val()});o.push({name:r+'.x',value:a.clk_x},{name:r+'.y',value:a.clk_y})}};return o};e.fn.formSerialize=function(t){return e.param(this.formToArray(t))};e.fn.fieldSerialize=function(t){var i=[];this.each(function(){var r=this.name;if(!r){return};var n=e.fieldValue(this,t);if(n&&n.constructor==Array){for(var s=0,o=n.length;s<o;s++){i.push({name:r,value:n[s]})}}else if(n!==null&&typeof n!='undefined'){i.push({name:this.name,value:n})}});return e.param(i)};e.fn.fieldValue=function(t){for(var s=[],n=0,r=this.length;n<r;n++){var o=this[n],i=e.fieldValue(o,t);if(i===null||typeof i=='undefined'||(i.constructor==Array&&!i.length)){continue};if(i.constructor==Array){e.merge(s,i)}else{s.push(i)}};return s};e.fieldValue=function(t,i){var d=t.name,s=t.type,c=t.tagName.toLowerCase();if(i===undefined){i=!0};if(i&&(!d||t.disabled||s=='reset'||s=='button'||(s=='checkbox'||s=='radio')&&!t.checked||(s=='submit'||s=='image')&&t.form&&t.form.clk!=t||c=='select'&&t.selectedIndex==-1)){return null};if(c=='select'){var l=t.selectedIndex;if(l<0){return null};var f=[],u=t.options,o=(s=='select-one'),h=(o?l+ 1:u.length);for(var a=(o?l:0);a<h;a++){var n=u[a];if(n.selected){var r=n.value;if(!r){r=(n.attributes&&n.attributes.value&&!(n.attributes.value.specified))?n.text:n.value};if(o){return r};f.push(r)}};return f};return e(t).val()};e.fn.clearForm=function(t){return this.each(function(){e('input,select,textarea',this).clearFields(t)})};e.fn.clearFields=e.fn.clearInputs=function(t){var i=/^(?:color|date|datetime|email|month|number|password|range|search|tel|text|time|url|week)$/i;return this.each(function(){var n=this.type,s=this.tagName.toLowerCase();if(i.test(n)||s=='textarea'){this.value=''}else if(n=='checkbox'||n=='radio'){this.checked=!1}else if(s=='select'){this.selectedIndex=-1}else if(n=='file'){if(/MSIE/.test(navigator.userAgent)){e(this).replaceWith(e(this).clone(!0))}else{e(this).val('')}}else if(t){if((t===!0&&/hidden/.test(n))||(typeof t=='string'&&e(this).is(t))){this.value=''}}})};e.fn.resetForm=function(){return this.each(function(){if(typeof this.reset=='function'||(typeof this.reset=='object'&&!this.reset.nodeType)){this.reset()}})};e.fn.enable=function(e){if(e===undefined){e=!0};return this.each(function(){this.disabled=!e})};e.fn.selected=function(t){if(t===undefined){t=!0};return this.each(function(){var n=this.type;if(n=='checkbox'||n=='radio'){this.checked=t}else if(this.tagName.toLowerCase()=='option'){var i=e(this).parent('select');if(t&&i[0]&&i[0].type=='select-one'){i.find('option').selected(!1)};this.selected=t}})};e.fn.ajaxSubmit.debug=!1;function t(){if(!e.fn.ajaxSubmit.debug){return};var t='[jquery.form] '+ Array.prototype.join.call(arguments,'');if(window.console&&window.console.log){window.console.log(t)}else if(window.opera&&window.opera.postError){window.opera.postError(t)}}}));jQuery.cookie=function(e,t,i){if(typeof t!='undefined'){i=i||{};if(t===null){t='';i.expires=-1};var r='';if(i.expires&&(typeof i.expires=='number'||i.expires.toUTCString)){var n;if(typeof i.expires=='number'){n=new Date();n.setTime(n.getTime()+(i.expires*24*60*60*1000))}else{n=i.expires};r='; expires='+ n.toUTCString()};var f=i.path?'; path='+(i.path):'',u=i.domain?'; domain='+(i.domain):'',c=i.secure?'; secure':'';document.cookie=[e,'=',encodeURIComponent(t),r,f,u,c].join('')}else{var l=null;if(document.cookie&&document.cookie!=''){var o=document.cookie.split(';');for(var s=0;s<o.length;s++){var a=jQuery.trim(o[s]);if(a.substring(0,e.length+ 1)==(e+'=')){l=decodeURIComponent(a.substring(e.length+ 1));break}}};return l}};(function(e,t,i){'use strict';e.map(['localStorage','sessionStorage'],function(n){var r={cookiePrefix:'fallback:'+ n+':',cookieOptions:{path:'/',domain:i.domain,expires:('localStorage'===n)?{expires:365}:undefined}};try{e.support[n]=n in t&&t[n]!==null}catch(s){e.support[n]=!1};e[n]=function(s,o){var a=e.extend({},r,e[n].options);this.getItem=function(i){var r=function(i){return JSON.parse(e.support[n]?t[n].getItem(i):e.cookie(a.cookiePrefix+ i))};if(typeof i==='string')return r(i);var o=[],s=i.length;while(s--)o[s]=r(i[s]);return o};this.setItem=function(i,s){s=JSON.stringify(s);return e.support[n]?t[n].setItem(i,s):e.cookie(a.cookiePrefix+ i,s,a.cookieOptions)};this.removeItem=function(i){return e.support[n]?t[n].removeItem(i):e.cookie(a.cookiePrefix+ i,null,e.extend(a.cookieOptions,{expires:-1}))};this.clear=function(){if(e.support[n]){return t[n].clear()}else{var r=new RegExp('^'+ a.cookiePrefix,''),s=e.extend(a.cookieOptions,{expires:-1});if(i.cookie&&i.cookie!==''){e.map(i.cookie.split(';'),function(t){if(r.test(t=e.trim(t))){e.cookie(t.substr(0,t.indexOf('=')),null,s)}})}}};if(typeof s!=='undefined'){return typeof o!=='undefined'?(o===null?this.removeItem(s):this.setItem(s,o)):this.getItem(s)};return this};e[n].options=r})}(jQuery,window,document));$.fn.customFileInput=function(){return $(this).each(function(){var e=$(this).addClass('customfile-input').mouseover(function(){t.addClass('customfile-hover')}).mouseout(function(){t.removeClass('customfile-hover')}).focus(function(){t.addClass('customfile-focus');e.data('val',e.val())}).blur(function(){t.removeClass('customfile-focus');$(this).trigger('checkChange')}).bind('disable',function(){e.prop('disabled',!0);t.addClass('customfile-disabled')}).bind('enable',function(){e.prop('disabled',!1);t.removeClass('customfile-disabled')}).bind('checkChange',function(){if(e.val()&&e.val()!=e.data('val')){e.trigger('change')}}).bind('change',function(){var t=$(this).val().split(/\\/).pop(),e='customfile-ext-'+ t.split('.').pop().toLowerCase();i.text(t).removeClass(i.data('fileExt')||'').addClass(e).data('fileExt',e).addClass('customfile-feedback-populated');n.html('<span>Change</span>')}).click(function(){e.data('val',e.val());setTimeout(function(){e.trigger('checkChange')},100)}),t=$('<div class="customfile"></div>'),i=$('<span class="customfile-feedback" aria-hidden="true">No file selected...</span>').appendTo(t),n=$('<span class="customfile-button siteButton bigButton" aria-hidden="true"><span>Browse</span></span>').appendTo(t);if(e.is('[disabled]')){e.trigger('disable')};t.mousemove(function(i){e.css({'left':i.pageX- t.offset().left- e.outerWidth()+ 20,'top':i.pageY- t.offset().top- 10})}).insertAfter(e);e.appendTo(t)})};(function(e){e.fn.showPassword=function(t,i){var n=e(this);e.fn.showPassword.checker=function(t,i){e('input[id="'+ t+'"]').click(function(){if(e(this).attr('checked')){e('input.'+ i).val(n.val()).attr('id',n.attr('id')).attr('name',n.attr('name'));e('input.'+ i).css('display','inline');n.css('display','none').removeAttr('id').removeAttr('name')}else{n.val(e('input.'+ i).val()).attr('id',e('input.'+ i).attr('id')).attr('name',e('input.'+ i).attr('name'));n.css('display','inline');e('input.'+ i).css('display','none').removeAttr('id').removeAttr('name')}})};return this.each(function(){var s={classname:'nobr block font11px lightgrey',name:'password-input',text:' Show password'};var o='spcb_'+ parseInt(Math.random()*1000),r=o.replace('spcb_','spin_');if(n.attr('class')!==''){var a=r+' '+ n.attr('class')}else{var a=r};if(typeof t=='object'){e.extend(s,t)};if(typeof i=='object'){e.extend(s,i)};var c=s.name;if(s.classname==''){theclass=''}else{theclass=' class="'+ s.classname+'"'};e(this).before('<input type="text" value="" class="'+ a+'" style="display: none;" />');var l='<label'+ theclass+'><input type="checkbox" id="'+ o+'" name="'+ c+'" value="sp" />'+ s.text+'</label>';if(t=='object'||typeof t=='undefined'){e(this).after(l)}else{e(t).html(l)};e.fn.showPassword.checker(o,r);return this})}})(jQuery);jQuery.notification=(function(e,t){var i=(function(){if(t.Notification&&t.Notification.permissionLevel)return t.Notification;var n=t.webkitNotifications;if(!n)return(function(){var t={};t.permissionLevel=function(){return'unsupported'};t.requestPermission=e.noop;return t}());var s=['granted','default','denied'],i=function(t,s){s=s||{};if(!t){return};var r=n.createNotification(s.iconUrl||'',t,s.body||'');r.titleDir=s.titleDir||'auto';r.body=s.body||'';r.bodyDir=s.bodyDir||'auto';r.tag=s.tag||'';r.replaceId=s.tag||'';r.iconUrl=s.iconUrl||'';r.onclick=s.onclick||e.noop;r.onshow=s.onshow||e.noop;r.onerror=s.onerror||e.noop;r.onclose=s.onclose||e.noop;if(i.permissionLevel()==='granted'){r.show()};return r};i.permissionLevel=function(){return i.permission=s[n.checkPermission()]};i.permissionLevel();i.requestPermission=function(s){if(i.permissionLevel()!=='default'){s();return};e(document).one('click',function(){if(n.requestPermission.length){n.requestPermission(function(){i.permissionLevel();s()});return};n.requestPermission();var e=t.setInterval(function(){var n=i.permissionLevel();if(n!=='default'){t.clearInterval(e);s()}},200)})};return i}()),n=function(t){var n=e.Deferred();if(!i.prototype){n.reject('unsupported');return n.promise()};if(typeof t==='string'){t={title:t}};t=t||{};t.autoclose=typeof t.autoclose==='undefined'?!0:t.autoclose;t.timeout=t.timeout||Infinity;i.requestPermission(function(){if((i.permission||i.permissionLevel())!=='granted'){n.reject(i.permissionLevel());return};var e=new i(t.title,t);if(isFinite(t.timeout)){e.addEventListener('show',function(){setTimeout(function(){e.cancel()},t.timeout)},!1)};if(t.autoclose){e.addEventListener('click',function(){e.cancel()},!1)};n.resolve(e)});return n.promise()};n.permissionLevel=i.permissionLevel;n.requestPermission=i.requestPermission;return n}(jQuery,window));this.vtip=function(){this.xOffset=-10;this.yOffset=10;$('.vtip').unbind().hover(function(e){var t=$(this).next('.vtipContentjs').size()?$(this).next('.vtipContentjs').html():this.title;this.t=this.title;this.title='';$('body').append('<div id="vtip"><img id="vtipArrow" />'+ t+'</div>');$('div#vtip').css({top:e.pageY+ yOffset,left:e.pageX+ xOffset}).fadeIn('fast')},function(){this.title=this.t;$('div#vtip').fadeOut('slow').remove()})};jQuery(document).ready(function(e){vtip()});(function(e,t){var s=0,r=/^ui-id-\d+$/;e.ui=e.ui||{};e.extend(e.ui,{version:'1.10.3',keyCode:{BACKSPACE:8,COMMA:188,DELETE:46,DOWN:40,END:35,ENTER:13,ESCAPE:27,HOME:36,LEFT:37,NUMPAD_ADD:107,NUMPAD_DECIMAL:110,NUMPAD_DIVIDE:111,NUMPAD_ENTER:108,NUMPAD_MULTIPLY:106,NUMPAD_SUBTRACT:109,PAGE_DOWN:34,PAGE_UP:33,PERIOD:190,RIGHT:39,SPACE:32,TAB:9,UP:38}});e.fn.extend({focus:(function(t){return function(i,n){return typeof i==='number'?this.each(function(){var t=this;setTimeout(function(){e(t).focus();if(n){n.call(t)}},i)}):t.apply(this,arguments)}})(e.fn.focus),scrollParent:function(){var t;if((e.ui.ie&&(/(static|relative)/).test(this.css('position')))||(/absolute/).test(this.css('position'))){t=this.parents().filter(function(){return(/(relative|absolute|fixed)/).test(e.css(this,'position'))&&(/(auto|scroll)/).test(e.css(this,'overflow')+ e.css(this,'overflow-y')+ e.css(this,'overflow-x'))}).eq(0)}else{t=this.parents().filter(function(){return(/(auto|scroll)/).test(e.css(this,'overflow')+ e.css(this,'overflow-y')+ e.css(this,'overflow-x'))}).eq(0)};return(/fixed/).test(this.css('position'))||!t.length?e(document):t},zIndex:function(i){if(i!==t){return this.css('zIndex',i)};if(this.length){var n=e(this[0]),r,s;while(n.length&&n[0]!==document){r=n.css('position');if(r==='absolute'||r==='relative'||r==='fixed'){s=parseInt(n.css('zIndex'),10);if(!isNaN(s)&&s!==0){return s}};n=n.parent()}};return 0},uniqueId:function(){return this.each(function(){if(!this.id){this.id='ui-id-'+(++s)}})},removeUniqueId:function(){return this.each(function(){if(r.test(this.id)){e(this).removeAttr('id')}})}});function n(t,n){var o,a,r,s=t.nodeName.toLowerCase();if('area'===s){o=t.parentNode;a=o.name;if(!t.href||!a||o.nodeName.toLowerCase()!=='map'){return!1};r=e('img[usemap=#'+ a+']')[0];return!!r&&i(r)};return(/input|select|textarea|button|object/.test(s)?!t.disabled:'a'===s?t.href||n:n)&&i(t)};function i(t){return e.expr.filters.visible(t)&&!e(t).parents().addBack().filter(function(){return e.css(this,'visibility')==='hidden'}).length};e.extend(e.expr[':'],{data:e.expr.createPseudo?e.expr.createPseudo(function(t){return function(i){return!!e.data(i,t)}}):function(t,i,n){return!!e.data(t,n[3])},focusable:function(t){return n(t,!isNaN(e.attr(t,'tabindex')))},tabbable:function(t){var s=e.attr(t,'tabindex'),i=isNaN(s);return(i||s>=0)&&n(t,!i)}});if(!e('<a>').outerWidth(1).jquery){e.each(['Width','Height'],function(i,n){var a=n==='Width'?['Left','Right']:['Top','Bottom'],o=n.toLowerCase(),s={innerWidth:e.fn.innerWidth,innerHeight:e.fn.innerHeight,outerWidth:e.fn.outerWidth,outerHeight:e.fn.outerHeight};function r(t,i,n,s){e.each(a,function(){i-=parseFloat(e.css(t,'padding'+ this))||0;if(n){i-=parseFloat(e.css(t,'border'+ this+'Width'))||0};if(s){i-=parseFloat(e.css(t,'margin'+ this))||0}});return i};e.fn['inner'+ n]=function(i){if(i===t){return s['inner'+ n].call(this)};return this.each(function(){e(this).css(o,r(this,i)+'px')})};e.fn['outer'+ n]=function(t,i){if(typeof t!=='number'){return s['outer'+ n].call(this,t)};return this.each(function(){e(this).css(o,r(this,t,!0,i)+'px')})}})};if(!e.fn.addBack){e.fn.addBack=function(e){return this.add(e==null?this.prevObject:this.prevObject.filter(e))}};if(e('<a>').data('a-b','a').removeData('a-b').data('a-b')){e.fn.removeData=(function(t){return function(i){if(arguments.length){return t.call(this,e.camelCase(i))}else{return t.call(this)}}})(e.fn.removeData)};e.ui.ie=!!/msie [\w.]+/.exec(navigator.userAgent.toLowerCase());e.support.selectstart='onselectstart'in document.createElement('div');e.fn.extend({disableSelection:function(){return this.bind((e.support.selectstart?'selectstart':'mousedown')+'.ui-disableSelection',function(e){e.preventDefault()})},enableSelection:function(){return this.unbind('.ui-disableSelection')}});e.extend(e.ui,{plugin:{add:function(t,i,n){var s,r=e.ui[t].prototype;for(s in n){r.plugins[s]=r.plugins[s]||[];r.plugins[s].push([i,n[s]])}},call:function(e,t,i){var n,s=e.plugins[t];if(!s||!e.element[0].parentNode||e.element[0].parentNode.nodeType===11){return};for(n=0;n<s.length;n++){if(e.options[s[n][0]]){s[n][1].apply(e.element,i)}}}},hasScroll:function(t,i){if(e(t).css('overflow')==='hidden'){return!1};var n=(i&&i==='left')?'scrollLeft':'scrollTop',s=!1;if(t[n]>0){return!0};t[n]=1;s=(t[n]>0);t[n]=0;return s}})})(jQuery);(function(e,t){var s=0,i=Array.prototype.slice,n=e.cleanData;e.cleanData=function(t){for(var s=0,r;(r=t[s])!=null;s++){try{e(r).triggerHandler('remove')}catch(i){}};n(t)};e.widget=function(t,i,n){var l,o,s,a,c={},r=t.split('.')[0];t=t.split('.')[1];l=r+'-'+ t;if(!n){n=i;i=e.Widget};e.expr[':'][l.toLowerCase()]=function(t){return!!e.data(t,l)};e[r]=e[r]||{};o=e[r][t];s=e[r][t]=function(e,t){if(!this.Dt$){return new s(e,t)};if(arguments.length){this.Dt$(e,t)}};e.extend(s,o,{version:n.version,Di$:e.extend({},n),ee$:[]});a=new i();a.options=e.widget.extend({},a.options);e.each(n,function(t,n){if(!e.isFunction(n)){c[t]=n;return};c[t]=(function(){var s=function(){return i.prototype[t].apply(this,arguments)},e=function(e){return i.prototype[t].apply(this,e)};return function(){var r=this.ie$,i=this.xe$,t;this.ie$=s;this.xe$=e;t=n.apply(this,arguments);this.ie$=r;this.xe$=i;return t}})()});s.prototype=e.widget.extend(a,{widgetEventPrefix:o?a.widgetEventPrefix:t},c,{constructor:s,namespace:r,widgetName:t,widgetFullName:l});if(o){e.each(o.ee$,function(t,i){var n=i.prototype;e.widget(n.namespace+'.'+ n.widgetName,s,i.Di$)});delete o.ee$}else{i.ee$.push(s)};e.widget.bridge(t,s)};e.widget.extend=function(n){var a=i.call(arguments,1),o=0,l=a.length,s,r;for(;o<l;o++){for(s in a[o]){r=a[o][s];if(a[o].hasOwnProperty(s)&&r!==t){if(e.isPlainObject(r)){n[s]=e.isPlainObject(n[s])?e.widget.extend({},n[s],r):e.widget.extend({},r)}else{n[s]=r}}}};return n};e.widget.bridge=function(n,s){var r=s.prototype.widgetFullName||n;e.fn[n]=function(o){var c=typeof o==='string',a=i.call(arguments,1),l=this;o=!c&&a.length?e.widget.extend.apply(null,[o].concat(a)):o;if(c){this.each(function(){var i,s=e.data(this,r);if(!s){return e.error('cannot call methods on '+ n+' prior to initialization; attempted to call method \''+ o+'\'')};if(!e.isFunction(s[o])||o.charAt(0)==='_'){return e.error('no such method \''+ o+'\' for '+ n+' widget instance')};i=s[o].apply(s,a);if(i!==s&&i!==t){l=i&&i.jquery?l.pushStack(i.get()):i;return!1}})}else{this.each(function(){var t=e.data(this,r);if(t){t.option(o||{}).Ct$()}else{e.data(this,r,new s(o,this))}})};return l}};e.Widget=function(){};e.Widget.ee$=[];e.Widget.prototype={widgetName:'widget',widgetEventPrefix:'',defaultElement:'<div>',options:{disabled:!1,create:null},Dt$:function(t,i){i=e(i||this.defaultElement||this)[0];this.element=e(i);this.uuid=s++;this.eventNamespace='.'+ this.widgetName+ this.uuid;this.options=e.widget.extend({},this.options,this.ui$(),t);this.bindings=e();this.hoverable=e();this.focusable=e();if(i!==this){e.data(i,this.widgetFullName,this);this.T$(!0,this.element,{remove:function(e){if(e.target===i){this.destroy()}}});this.document=e(i.style?i.ownerDocument:i.document||i);this.window=e(this.document[0].defaultView||this.document[0].parentWindow)};this.E$();this.t$('create',null,this.ci$());this.Ct$()},ui$:e.noop,ci$:e.noop,E$:e.noop,Ct$:e.noop,destroy:function(){this.I$();this.element.unbind(this.eventNamespace).removeData(this.widgetName).removeData(this.widgetFullName).removeData(e.camelCase(this.widgetFullName));this.widget().unbind(this.eventNamespace).removeAttr('aria-disabled').removeClass(this.widgetFullName+'-disabled ui-state-disabled');this.bindings.unbind(this.eventNamespace);this.hoverable.removeClass('ui-state-hover');this.focusable.removeClass('ui-state-focus')},I$:e.noop,widget:function(){return this.element},option:function(i,n){var a=i,s,r,o;if(arguments.length===0){return e.widget.extend({},this.options)};if(typeof i==='string'){a={};s=i.split('.');i=s.shift();if(s.length){r=a[i]=e.widget.extend({},this.options[i]);for(o=0;o<s.length- 1;o++){r[s[o]]=r[s[o]]||{};r=r[s[o]]};i=s.pop();if(n===t){return r[i]===t?null:r[i]};r[i]=n}else{if(n===t){return this.options[i]===t?null:this.options[i]};a[i]=n}};this.Si$(a);return this},Si$:function(e){var t;for(t in e){this.k$(t,e[t])};return this},k$:function(e,t){this.options[e]=t;if(e==='disabled'){this.widget().toggleClass(this.widgetFullName+'-disabled ui-state-disabled',!!t).attr('aria-disabled',t);this.hoverable.removeClass('ui-state-hover');this.focusable.removeClass('ui-state-focus')};return this},enable:function(){return this.k$('disabled',!1)},disable:function(){return this.k$('disabled',!0)},T$:function(t,i,n){var r,s=this;if(typeof t!=='boolean'){n=i;i=t;t=!1};if(!n){n=i;i=this.element;r=this.widget()}else{i=r=e(i);this.bindings=this.bindings.add(i)};e.each(n,function(n,o){function a(){if(!t&&(s.options.disabled===!0||e(this).hasClass('ui-state-disabled'))){return};return(typeof o==='string'?s[o]:o).apply(s,arguments)};if(typeof o!=='string'){a.guid=o.guid=o.guid||a.guid||e.guid++};var c=n.match(/^(\w+)\s*(.*)$/),u=c[1]+ s.eventNamespace,l=c[2];if(l){r.delegate(l,u,a)}else{i.bind(u,a)}})},Ni$:function(e,t){t=(t||'').split(' ').join(this.eventNamespace+' ')+ this.eventNamespace;e.unbind(t).undelegate(t)},f$:function(e,t){function n(){return(typeof e==='string'?i[e]:e).apply(i,arguments)};var i=this;return setTimeout(n,t||0)},Ei$:function(t){this.hoverable=this.hoverable.add(t);this.T$(t,{mouseenter:function(t){e(t.currentTarget).addClass('ui-state-hover')},mouseleave:function(t){e(t.currentTarget).removeClass('ui-state-hover')}})},Ai$:function(t){this.focusable=this.focusable.add(t);this.T$(t,{focusin:function(t){e(t.currentTarget).addClass('ui-state-focus')},focusout:function(t){e(t.currentTarget).removeClass('ui-state-focus')}})},t$:function(t,i,n){var s,r,o=this.options[t];n=n||{};i=e.Event(i);i.type=(t===this.widgetEventPrefix?t:this.widgetEventPrefix+ t).toLowerCase();i.target=this.element[0];r=i.originalEvent;if(r){for(s in r){if(!(s in i)){i[s]=r[s]}}};this.element.trigger(i,n);return!(e.isFunction(o)&&o.apply(this.element[0],[i].concat(n))===!1||i.isDefaultPrevented())}};e.each({show:'fadeIn',hide:'fadeOut'},function(t,i){e.Widget.prototype['_'+ t]=function(n,s,r){if(typeof s==='string'){s={effect:s}};var a,o=!s?t:s===!0||typeof s==='number'?i:s.effect||i;s=s||{};if(typeof s==='number'){s={duration:s}};a=!e.isEmptyObject(s);s.complete=r;if(s.delay){n.delay(s.delay)};if(a&&e.effects&&e.effects.effect[o]){n[t](s)}else if(o!==t&&n[o]){n[o](s.duration,s.easing,r)}else{n.queue(function(i){e(this)[t]();if(r){r.call(n[0])};i()})}}})})(jQuery);(function(e,t){var i=!1;e(document).mouseup(function(){i=!1});e.widget('ui.mouse',{version:'1.10.3',options:{cancel:'input,textarea,button,select,option',distance:1,delay:0},U$:function(){var t=this;this.element.bind('mousedown.'+ this.widgetName,function(e){return t.ti$(e)}).bind('click.'+ this.widgetName,function(i){if(!0===e.data(i.target,t.widgetName+'.preventClickEvent')){e.removeData(i.target,t.widgetName+'.preventClickEvent');i.stopImmediatePropagation();return!1}});this.started=!1},le$:function(){this.element.unbind('.'+ this.widgetName);if(this.oe$){e(document).unbind('mousemove.'+ this.widgetName,this.oe$).unbind('mouseup.'+ this.widgetName,this.we$)}},ti$:function(t){if(i){return}(this.N$&&this.y$(t));this.se$=t;var n=this,r=(t.which===1),s=(typeof this.options.cancel==='string'&&t.target.nodeName?e(t.target).closest(this.options.cancel).length:!1);if(!r||s||!this.X$(t)){return!0};this.mouseDelayMet=!this.options.delay;if(!this.mouseDelayMet){this.Fi$=setTimeout(function(){n.mouseDelayMet=!0},this.options.delay)};if(this.St$(t)&&this.Tt$(t)){this.N$=(this.O$(t)!==!1);if(!this.N$){t.preventDefault();return!0}};if(!0===e.data(t.target,this.widgetName+'.preventClickEvent')){e.removeData(t.target,this.widgetName+'.preventClickEvent')};this.oe$=function(e){return n.ii$(e)};this.we$=function(e){return n.y$(e)};e(document).bind('mousemove.'+ this.widgetName,this.oe$).bind('mouseup.'+ this.widgetName,this.we$);t.preventDefault();i=!0;return!0},ii$:function(t){if(e.ui.ie&&(!document.documentMode||document.documentMode<9)&&!t.button){return this.y$(t)};if(this.N$){this.C$(t);return t.preventDefault()};if(this.St$(t)&&this.Tt$(t)){this.N$=(this.O$(this.se$,t)!==!1);(this.N$?this.C$(t):this.y$(t))};return!this.N$},y$:function(t){e(document).unbind('mousemove.'+ this.widgetName,this.oe$).unbind('mouseup.'+ this.widgetName,this.we$);if(this.N$){this.N$=!1;if(t.target===this.se$.target){e.data(t.target,this.widgetName+'.preventClickEvent',!0)};this.z$(t)};return!1},St$:function(e){return(Math.max(Math.abs(this.se$.pageX- e.pageX),Math.abs(this.se$.pageY- e.pageY))>=this.options.distance)},Tt$:function(){return this.mouseDelayMet},O$:function(){},C$:function(){},z$:function(){},X$:function(){return!0}})})(jQuery);(function(e,t){e.ui=e.ui||{};var r,n=Math.max,i=Math.abs,u=Math.round,h=/left|center|right/,c=/top|center|bottom/,f=/[\+\-]\d+(\.[\d]+)?%?/,l=/^\w+/,o=/%$/,p=e.fn.position;function a(e,t,i){return[parseFloat(e[0])*(o.test(e[0])?t/100:1),parseFloat(e[1])*(o.test(e[1])?i/100:1)]};function s(t,i){return parseInt(e.css(t,i),10)||0};function d(t){var i=t[0];if(i.nodeType===9){return{width:t.width(),height:t.height(),offset:{top:0,left:0}}};if(e.isWindow(i)){return{width:t.width(),height:t.height(),offset:{top:t.scrollTop(),left:t.scrollLeft()}}};if(i.preventDefault){return{width:0,height:0,offset:{top:i.pageY,left:i.pageX}}};return{width:t.outerWidth(),height:t.outerHeight(),offset:t.offset()}};e.position={scrollbarWidth:function(){if(r!==t){return r};var s,n,i=e('<div style=\'display:block;width:50px;height:50px;overflow:hidden;\'><div style=\'height:100px;width:auto;\'></div></div>'),o=i.children()[0];e('body').append(i);s=o.offsetWidth;i.css('overflow','scroll');n=o.offsetWidth;if(s===n){n=i[0].clientWidth};i.remove();return(r=s- n)},getScrollInfo:function(t){var n=t.isWindow?'':t.element.css('overflow-x'),i=t.isWindow?'':t.element.css('overflow-y'),r=n==='scroll'||(n==='auto'&&t.width<t.element[0].scrollWidth),s=i==='scroll'||(i==='auto'&&t.height<t.element[0].scrollHeight);return{width:s?e.position.scrollbarWidth():0,height:r?e.position.scrollbarWidth():0}},getWithinInfo:function(t){var i=e(t||window),n=e.isWindow(i[0]);return{element:i,isWindow:n,offset:i.offset()||{left:0,top:0},scrollLeft:i.scrollLeft(),scrollTop:i.scrollTop(),width:n?i.width():i.outerWidth(),height:n?i.height():i.outerHeight()}}};e.fn.position=function(t){if(!t||!t.of){return p.apply(this,arguments)};t=e.extend({},t);var b,r,o,g,m,y,x=e(t.of),k=e.position.getWithinInfo(t.within),C=e.position.getScrollInfo(k),v=(t.collision||'flip').split(' '),w={};y=d(x);if(x[0].preventDefault){t.at='left top'};r=y.width;o=y.height;g=y.offset;m=e.extend({},g);e.each(['my','at'],function(){var e=(t[this]||'').split(' '),n,i;if(e.length===1){e=h.test(e[0])?e.concat(['center']):c.test(e[0])?['center'].concat(e):['center','center']};e[0]=h.test(e[0])?e[0]:'center';e[1]=c.test(e[1])?e[1]:'center';n=f.exec(e[0]);i=f.exec(e[1]);w[this]=[n?n[0]:0,i?i[0]:0];t[this]=[l.exec(e[0])[0],l.exec(e[1])[0]]});if(v.length===1){v[1]=v[0]};if(t.at[0]==='right'){m.left+=r}else if(t.at[0]==='center'){m.left+=r/2};if(t.at[1]==='bottom'){m.top+=o}else if(t.at[1]==='center'){m.top+=o/2};b=a(w.at,r,o);m.left+=b[0];m.top+=b[1];return this.each(function(){var S,T,h=e(this),f=h.outerWidth(),c=h.outerHeight(),y=s(this,'marginLeft'),p=s(this,'marginTop'),P=f+ y+ s(this,'marginRight')+ C.width,D=c+ p+ s(this,'marginBottom')+ C.height,l=e.extend({},m),d=a(w.my,h.outerWidth(),h.outerHeight());if(t.my[0]==='right'){l.left-=f}else if(t.my[0]==='center'){l.left-=f/2};if(t.my[1]==='bottom'){l.top-=c}else if(t.my[1]==='center'){l.top-=c/2};l.left+=d[0];l.top+=d[1];if(!e.support.offsetFractions){l.left=u(l.left);l.top=u(l.top)};S={marginLeft:y,marginTop:p};e.each(['left','top'],function(i,n){if(e.ui.position[v[i]]){e.ui.position[v[i]][n](l,{targetWidth:r,targetHeight:o,elemWidth:f,elemHeight:c,collisionPosition:S,collisionWidth:P,collisionHeight:D,offset:[b[0]+ d[0],b[1]+ d[1]],my:t.my,at:t.at,within:k,elem:h})}});if(t.using){T=function(e){var u=g.left- l.left,d=u+ r- f,a=g.top- l.top,p=a+ o- c,s={target:{element:x,left:g.left,top:g.top,width:r,height:o},element:{element:h,left:l.left,top:l.top,width:f,height:c},horizontal:d<0?'left':u>0?'right':'center',vertical:p<0?'top':a>0?'bottom':'middle'};if(r<f&&i(u+ d)<r){s.horizontal='center'};if(o<c&&i(a+ p)<o){s.vertical='middle'};if(n(i(u),i(d))>n(i(a),i(p))){s.important='horizontal'}else{s.important='vertical'};t.using.call(this,e,s)}};h.offset(e.extend(l,{using:T}))})};e.ui.position={fit:{left:function(e,t){var a=t.within,s=a.isWindow?a.scrollLeft:a.offset.left,o=a.width,l=e.left- t.collisionPosition.marginLeft,i=s- l,r=l+ t.collisionWidth- o- s,c;if(t.collisionWidth>o){if(i>0&&r<=0){c=e.left+ i+ t.collisionWidth- o- s;e.left+=i- c}else if(r>0&&i<=0){e.left=s}else{if(i>r){e.left=s+ o- t.collisionWidth}else{e.left=s}}}else if(i>0){e.left+=i}else if(r>0){e.left-=r}else{e.left=n(e.left- l,e.left)}},top:function(e,t){var l=t.within,s=l.isWindow?l.scrollTop:l.offset.top,o=t.within.height,a=e.top- t.collisionPosition.marginTop,i=s- a,r=a+ t.collisionHeight- o- s,c;if(t.collisionHeight>o){if(i>0&&r<=0){c=e.top+ i+ t.collisionHeight- o- s;e.top+=i- c}else if(r>0&&i<=0){e.top=s}else{if(i>r){e.top=s+ o- t.collisionHeight}else{e.top=s}}}else if(i>0){e.top+=i}else if(r>0){e.top-=r}else{e.top=n(e.top- a,e.top)}}},flip:{left:function(e,t){var n=t.within,p=n.offset.left+ n.scrollLeft,f=n.width,c=n.isWindow?n.scrollLeft:n.offset.left,u=e.left- t.collisionPosition.marginLeft,h=u- c,d=u+ t.collisionWidth- f- c,r=t.my[0]==='left'?-t.elemWidth:t.my[0]==='right'?t.elemWidth:0,o=t.at[0]==='left'?t.targetWidth:t.at[0]==='right'?-t.targetWidth:0,s=-2*t.offset[0],a,l;if(h<0){a=e.left+ r+ o+ s+ t.collisionWidth- f- p;if(a<0||a<i(h)){e.left+=r+ o+ s}}else if(d>0){l=e.left- t.collisionPosition.marginLeft+ r+ o+ s- c;if(l>0||i(l)<d){e.left+=r+ o+ s}}},top:function(e,t){var s=t.within,p=s.offset.top+ s.scrollTop,h=s.height,u=s.isWindow?s.scrollTop:s.offset.top,d=e.top- t.collisionPosition.marginTop,c=d- u,f=d+ t.collisionHeight- h- u,m=t.my[1]==='top',o=m?-t.elemHeight:t.my[1]==='bottom'?t.elemHeight:0,r=t.at[1]==='top'?t.targetHeight:t.at[1]==='bottom'?-t.targetHeight:0,n=-2*t.offset[1],l,a;if(c<0){a=e.top+ o+ r+ n+ t.collisionHeight- h- p;if((e.top+ o+ r+ n)>c&&(a<0||a<i(c))){e.top+=o+ r+ n}}else if(f>0){l=e.top- t.collisionPosition.marginTop+ o+ r+ n- u;if((e.top+ o+ r+ n)>f&&(l>0||i(l)<f)){e.top+=o+ r+ n}}}},flipfit:{left:function(){e.ui.position.flip.left.apply(this,arguments);e.ui.position.fit.left.apply(this,arguments)},top:function(){e.ui.position.flip.top.apply(this,arguments);e.ui.position.fit.top.apply(this,arguments)}}};(function(){var t,n,i,o,a,r=document.getElementsByTagName('body')[0],s=document.createElement('div');t=document.createElement(r?'div':'body');i={visibility:'hidden',width:0,height:0,border:0,margin:0,background:'none'};if(r){e.extend(i,{position:'absolute',left:'-1000px',top:'-1000px'})};for(a in i){t.style[a]=i[a]};t.appendChild(s);n=r||document.documentElement;n.insertBefore(t,n.firstChild);s.style.cssText='position: absolute; left: 10.7432222px;';o=e(s).offset().left;e.support.offsetFractions=o>10&&o<11;t.innerHTML='';n.removeChild(t)})()}(jQuery));(function(e,t){e.widget('ui.draggable',e.ui.mouse,{version:'1.10.3',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},E$:function(){if(this.options.helper==='original'&&!(/^(?:r|a|f)/).test(this.element.css('position'))){this.element[0].style.position='relative'};if(this.options.addClasses){this.element.addClass('ui-draggable')};if(this.options.disabled){this.element.addClass('ui-draggable-disabled')};this.U$()},I$:function(){this.element.removeClass('ui-draggable ui-draggable-dragging ui-draggable-disabled');this.le$()},X$:function(t){var i=this.options;if(this.helper||i.disabled||e(t.target).closest('.ui-resizable-handle').length>0){return!1};this.handle=this.yi$(t);if(!this.handle){return!1};e(i.iframeFix===!0?'iframe':i.iframeFix).each(function(){e('<div class=\'ui-draggable-iframeFix\' style=\'background: #fff;\'></div>').css({width:this.offsetWidth+'px',height:this.offsetHeight+'px',position:'absolute',opacity:'0.001',zIndex:1000}).css(e(this).offset()).appendTo('body')});return!0},O$:function(t){var i=this.options;this.helper=this.pe$(t);this.helper.addClass('ui-draggable-dragging');this.K$();if(e.ui.ddmanager){e.ui.ddmanager.current=this};this.me$();this.cssPosition=this.helper.css('position');this.scrollParent=this.helper.scrollParent();this.offsetParent=this.helper.offsetParent();this.offsetParentCssPosition=this.offsetParent.css('position');this.offset=this.positionAbs=this.element.offset();this.offset={top:this.offset.top- this.margins.top,left:this.offset.left- this.margins.left};this.offset.scroll=!1;e.extend(this.offset,{click:{left:t.pageX- this.offset.left,top:t.pageY- this.offset.top},parent:this.V$(),relative:this.re$()});this.originalPosition=this.position=this.J$(t);this.originalPageX=t.pageX;this.originalPageY=t.pageY;(i.cursorAt&&this.de$(i.cursorAt));this.ge$();if(this.t$('start',t)===!1){this.F$();return!1};this.K$();if(e.ui.ddmanager&&!i.dropBehaviour){e.ui.ddmanager.prepareOffsets(this,t)};this.C$(t,!0);if(e.ui.ddmanager){e.ui.ddmanager.dragStart(this,t)};return!0},C$:function(t,i){if(this.offsetParentCssPosition==='fixed'){this.offset.parent=this.V$()};this.position=this.J$(t);this.positionAbs=this.c$('absolute');if(!i){var n=this.n$();if(this.t$('drag',t,n)===!1){this.y$({});return!1};this.position=n.position};if(!this.options.axis||this.options.axis!=='y'){this.helper[0].style.left=this.position.left+'px'};if(!this.options.axis||this.options.axis!=='x'){this.helper[0].style.top=this.position.top+'px'};if(e.ui.ddmanager){e.ui.ddmanager.drag(this,t)};return!1},z$:function(t){var n=this,i=!1;if(e.ui.ddmanager&&!this.options.dropBehaviour){i=e.ui.ddmanager.drop(this,t)};if(this.dropped){i=this.dropped;this.dropped=!1};if(this.options.helper==='original'&&!e.contains(this.element[0].ownerDocument,this.element[0])){return!1};if((this.options.revert==='invalid'&&!i)||(this.options.revert==='valid'&&i)||this.options.revert===!0||(e.isFunction(this.options.revert)&&this.options.revert.call(this.element,i))){e(this.helper).animate(this.originalPosition,parseInt(this.options.revertDuration,10),function(){if(n.t$('stop',t)!==!1){n.F$()}})}else{if(this.t$('stop',t)!==!1){this.F$()}};return!1},y$:function(t){e('div.ui-draggable-iframeFix').each(function(){this.parentNode.removeChild(this)});if(e.ui.ddmanager){e.ui.ddmanager.dragStop(this,t)};return e.ui.mouse.prototype.y$.call(this,t)},cancel:function(){if(this.helper.is('.ui-draggable-dragging')){this.y$({})}else{this.F$()};return this},yi$:function(t){return this.options.handle?!!e(t.target).closest(this.element.find(this.options.handle)).length:!0},pe$:function(t){var n=this.options,i=e.isFunction(n.helper)?e(n.helper.apply(this.element[0],[t])):(n.helper==='clone'?this.element.clone().removeAttr('id'):this.element);if(!i.parents('body').length){i.appendTo((n.appendTo==='parent'?this.element[0].parentNode:n.appendTo))};if(i[0]!==this.element[0]&&!(/(fixed|absolute)/).test(i.css('position'))){i.css('position','absolute')};return i},de$:function(t){if(typeof t==='string'){t=t.split(' ')};if(e.isArray(t)){t={left:+t[0],top:+t[1]||0}};if('left'in t){this.offset.click.left=t.left+ this.margins.left};if('right'in t){this.offset.click.left=this.helperProportions.width- t.right+ this.margins.left};if('top'in t){this.offset.click.top=t.top+ this.margins.top};if('bottom'in t){this.offset.click.top=this.helperProportions.height- t.bottom+ this.margins.top}},V$:function(){var t=this.offsetParent.offset();if(this.cssPosition==='absolute'&&this.scrollParent[0]!==document&&e.contains(this.scrollParent[0],this.offsetParent[0])){t.left+=this.scrollParent.scrollLeft();t.top+=this.scrollParent.scrollTop()};if((this.offsetParent[0]===document.body)||(this.offsetParent[0].tagName&&this.offsetParent[0].tagName.toLowerCase()==='html'&&e.ui.ie)){t={top:0,left:0}};return{top:t.top+(parseInt(this.offsetParent.css('borderTopWidth'),10)||0),left:t.left+(parseInt(this.offsetParent.css('borderLeftWidth'),10)||0)}},re$:function(){if(this.cssPosition==='relative'){var e=this.element.position();return{top:e.top-(parseInt(this.helper.css('top'),10)||0)+ this.scrollParent.scrollTop(),left:e.left-(parseInt(this.helper.css('left'),10)||0)+ this.scrollParent.scrollLeft()}}else{return{top:0,left:0}}},me$: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)}},K$:function(){this.helperProportions={width:this.helper.outerWidth(),height:this.helper.outerHeight()}},ge$:function(){var s,t,n,i=this.options;if(!i.containment){this.containment=null;return};if(i.containment==='window'){this.containment=[e(window).scrollLeft()- this.offset.relative.left- this.offset.parent.left,e(window).scrollTop()- this.offset.relative.top- this.offset.parent.top,e(window).scrollLeft()+ e(window).width()- this.helperProportions.width- this.margins.left,e(window).scrollTop()+(e(window).height()||document.body.parentNode.scrollHeight)- this.helperProportions.height- this.margins.top];return};if(i.containment==='document'){this.containment=[0,0,e(document).width()- this.helperProportions.width- this.margins.left,(e(document).height()||document.body.parentNode.scrollHeight)- this.helperProportions.height- this.margins.top];return};if(i.containment.constructor===Array){this.containment=i.containment;return};if(i.containment==='parent'){i.containment=this.helper[0].parentNode};t=e(i.containment);n=t[0];if(!n){return};s=t.css('overflow')!=='hidden';this.containment=[(parseInt(t.css('borderLeftWidth'),10)||0)+(parseInt(t.css('paddingLeft'),10)||0),(parseInt(t.css('borderTopWidth'),10)||0)+(parseInt(t.css('paddingTop'),10)||0),(s?Math.max(n.scrollWidth,n.offsetWidth):n.offsetWidth)-(parseInt(t.css('borderRightWidth'),10)||0)-(parseInt(t.css('paddingRight'),10)||0)- this.helperProportions.width- this.margins.left- this.margins.right,(s?Math.max(n.scrollHeight,n.offsetHeight):n.offsetHeight)-(parseInt(t.css('borderBottomWidth'),10)||0)-(parseInt(t.css('paddingBottom'),10)||0)- this.helperProportions.height- this.margins.top- this.margins.bottom];this.relative_container=t},c$:function(t,i){if(!i){i=this.position};var n=t==='absolute'?1:-1,s=this.cssPosition==='absolute'&&!(this.scrollParent[0]!==document&&e.contains(this.scrollParent[0],this.offsetParent[0]))?this.offsetParent:this.scrollParent;if(!this.offset.scroll){this.offset.scroll={top:s.scrollTop(),left:s.scrollLeft()}};return{top:(i.top+ this.offset.relative.top*n+ this.offset.parent.top*n-((this.cssPosition==='fixed'?-this.scrollParent.scrollTop():this.offset.scroll.top)*n)),left:(i.left+ this.offset.relative.left*n+ this.offset.parent.left*n-((this.cssPosition==='fixed'?-this.scrollParent.scrollLeft():this.offset.scroll.left)*n))}},J$:function(t){var i,a,r,s,n=this.options,c=this.cssPosition==='absolute'&&!(this.scrollParent[0]!==document&&e.contains(this.scrollParent[0],this.offsetParent[0]))?this.offsetParent:this.scrollParent,o=t.pageX,l=t.pageY;if(!this.offset.scroll){this.offset.scroll={top:c.scrollTop(),left:c.scrollLeft()}};if(this.originalPosition){if(this.containment){if(this.relative_container){a=this.relative_container.offset();i=[this.containment[0]+ a.left,this.containment[1]+ a.top,this.containment[2]+ a.left,this.containment[3]+ a.top]}else{i=this.containment};if(t.pageX- this.offset.click.left<i[0]){o=i[0]+ this.offset.click.left};if(t.pageY- this.offset.click.top<i[1]){l=i[1]+ this.offset.click.top};if(t.pageX- this.offset.click.left>i[2]){o=i[2]+ this.offset.click.left};if(t.pageY- this.offset.click.top>i[3]){l=i[3]+ this.offset.click.top}};if(n.grid){r=n.grid[1]?this.originalPageY+ Math.round((l- this.originalPageY)/ n.grid[1]) * n.grid[1] : this.originalPageY;
  7. l=i?((r- this.offset.click.top>=i[1]||r- this.offset.click.top>i[3])?r:((r- this.offset.click.top>=i[1])?r- n.grid[1]:r+ n.grid[1])):r;s=n.grid[0]?this.originalPageX+ Math.round((o- this.originalPageX)/ n.grid[0]) * n.grid[0] : this.originalPageX;
  8. o=i?((s- this.offset.click.left>=i[0]||s- this.offset.click.left>i[2])?s:((s- this.offset.click.left>=i[0])?s- n.grid[0]:s+ n.grid[0])):s}};return{top:(l- this.offset.click.top- this.offset.relative.top- this.offset.parent.top+(this.cssPosition==='fixed'?-this.scrollParent.scrollTop():this.offset.scroll.top)),left:(o- this.offset.click.left- this.offset.relative.left- this.offset.parent.left+(this.cssPosition==='fixed'?-this.scrollParent.scrollLeft():this.offset.scroll.left))}},F$:function(){this.helper.removeClass('ui-draggable-dragging');if(this.helper[0]!==this.element[0]&&!this.cancelHelperRemoval){this.helper.remove()};this.helper=null;this.cancelHelperRemoval=!1},t$:function(t,i,n){n=n||this.n$();e.ui.plugin.call(this,t,[i,n]);if(t==='drag'){this.positionAbs=this.c$('absolute')};return e.Widget.prototype.t$.call(this,t,i,n)},plugins:{},n$:function(){return{helper:this.helper,position:this.position,originalPosition:this.originalPosition,offset:this.positionAbs}}});e.ui.plugin.add('draggable','connectToSortable',{start:function(t,i){var n=e(this).data('ui-draggable'),r=n.options,s=e.extend({},i,{item:n.element});n.sortables=[];e(r.connectToSortable).each(function(){var i=e.data(this,'ui-sortable');if(i&&!i.options.disabled){n.sortables.push({instance:i,shouldRevert:i.options.revert});i.refreshPositions();i.t$('activate',t,s)}})},stop:function(t,i){var n=e(this).data('ui-draggable'),s=e.extend({},i,{item:n.element});e.each(n.sortables,function(){if(this.instance.isOver){this.instance.isOver=0;n.cancelHelperRemoval=!0;this.instance.cancelHelperRemoval=!1;if(this.shouldRevert){this.instance.options.revert=this.shouldRevert};this.instance.z$(t);this.instance.options.helper=this.instance.options.s$;if(n.options.helper==='original'){this.instance.currentItem.css({top:'auto',left:'auto'})}}else{this.instance.cancelHelperRemoval=!1;this.instance.t$('deactivate',t,s)}})},drag:function(t,i){var n=e(this).data('ui-draggable'),s=this;e.each(n.sortables,function(){var r=!1,o=this;this.instance.positionAbs=n.positionAbs;this.instance.helperProportions=n.helperProportions;this.instance.offset.click=n.offset.click;if(this.instance.be$(this.instance.containerCache)){r=!0;e.each(n.sortables,function(){this.instance.positionAbs=n.positionAbs;this.instance.helperProportions=n.helperProportions;this.instance.offset.click=n.offset.click;if(this!==o&&this.instance.be$(this.instance.containerCache)&&e.contains(o.instance.element[0],this.instance.element[0])){r=!1};return r})};if(r){if(!this.instance.isOver){this.instance.isOver=1;this.instance.currentItem=e(s).clone().removeAttr('id').appendTo(this.instance.element).data('ui-sortable-item',!0);this.instance.options.s$=this.instance.options.helper;this.instance.options.helper=function(){return i.helper[0]};t.target=this.instance.currentItem[0];this.instance.X$(t,!0);this.instance.O$(t,!0,!0);this.instance.offset.click.top=n.offset.click.top;this.instance.offset.click.left=n.offset.click.left;this.instance.offset.parent.left-=n.offset.parent.left- this.instance.offset.parent.left;this.instance.offset.parent.top-=n.offset.parent.top- this.instance.offset.parent.top;n.t$('toSortable',t);n.dropped=this.instance.element;n.currentItem=n.element;this.instance.fromOutside=n};if(this.instance.currentItem){this.instance.C$(t)}}else{if(this.instance.isOver){this.instance.isOver=0;this.instance.cancelHelperRemoval=!0;this.instance.options.revert=!1;this.instance.t$('out',t,this.instance.n$(this.instance));this.instance.z$(t,!0);this.instance.options.helper=this.instance.options.s$;this.instance.currentItem.remove();if(this.instance.placeholder){this.instance.placeholder.remove()};n.t$('fromSortable',t);n.dropped=!1}}})}});e.ui.plugin.add('draggable','cursor',{start:function(){var t=e('body'),i=e(this).data('ui-draggable').options;if(t.css('cursor')){i.ot$=t.css('cursor')};t.css('cursor',i.cursor)},stop:function(){var t=e(this).data('ui-draggable').options;if(t.ot$){e('body').css('cursor',t.ot$)}}});e.ui.plugin.add('draggable','opacity',{start:function(t,i){var n=e(i.helper),s=e(this).data('ui-draggable').options;if(n.css('opacity')){s.rt$=n.css('opacity')};n.css('opacity',s.opacity)},stop:function(t,i){var n=e(this).data('ui-draggable').options;if(n.rt$){e(i.helper).css('opacity',n.rt$)}}});e.ui.plugin.add('draggable','scroll',{start:function(){var t=e(this).data('ui-draggable');if(t.scrollParent[0]!==document&&t.scrollParent[0].tagName!=='HTML'){t.overflowOffset=t.scrollParent.offset()}},drag:function(t){var n=e(this).data('ui-draggable'),i=n.options,s=!1;if(n.scrollParent[0]!==document&&n.scrollParent[0].tagName!=='HTML'){if(!i.axis||i.axis!=='x'){if((n.overflowOffset.top+ n.scrollParent[0].offsetHeight)- t.pageY<i.scrollSensitivity){n.scrollParent[0].scrollTop=s=n.scrollParent[0].scrollTop+ i.scrollSpeed}else if(t.pageY- n.overflowOffset.top<i.scrollSensitivity){n.scrollParent[0].scrollTop=s=n.scrollParent[0].scrollTop- i.scrollSpeed}};if(!i.axis||i.axis!=='y'){if((n.overflowOffset.left+ n.scrollParent[0].offsetWidth)- t.pageX<i.scrollSensitivity){n.scrollParent[0].scrollLeft=s=n.scrollParent[0].scrollLeft+ i.scrollSpeed}else if(t.pageX- n.overflowOffset.left<i.scrollSensitivity){n.scrollParent[0].scrollLeft=s=n.scrollParent[0].scrollLeft- i.scrollSpeed}}}else{if(!i.axis||i.axis!=='x'){if(t.pageY- e(document).scrollTop()<i.scrollSensitivity){s=e(document).scrollTop(e(document).scrollTop()- i.scrollSpeed)}else if(e(window).height()-(t.pageY- e(document).scrollTop())<i.scrollSensitivity){s=e(document).scrollTop(e(document).scrollTop()+ i.scrollSpeed)}};if(!i.axis||i.axis!=='y'){if(t.pageX- e(document).scrollLeft()<i.scrollSensitivity){s=e(document).scrollLeft(e(document).scrollLeft()- i.scrollSpeed)}else if(e(window).width()-(t.pageX- e(document).scrollLeft())<i.scrollSensitivity){s=e(document).scrollLeft(e(document).scrollLeft()+ i.scrollSpeed)}}};if(s!==!1&&e.ui.ddmanager&&!i.dropBehaviour){e.ui.ddmanager.prepareOffsets(n,t)}}});e.ui.plugin.add('draggable','snap',{start:function(){var t=e(this).data('ui-draggable'),i=t.options;t.snapElements=[];e(i.snap.constructor!==String?(i.snap.items||':data(ui-draggable)'):i.snap).each(function(){var i=e(this),n=i.offset();if(this!==t.element[0]){t.snapElements.push({item:this,width:i.outerWidth(),height:i.outerHeight(),top:n.top,left:n.left})}})},drag:function(t,i){var l,c,u,a,f,d,o,h,s,y,n=e(this).data('ui-draggable'),v=n.options,r=v.snapTolerance,m=i.offset.left,b=m+ n.helperProportions.width,p=i.offset.top,g=p+ n.helperProportions.height;for(s=n.snapElements.length- 1;s>=0;s--){f=n.snapElements[s].left;d=f+ n.snapElements[s].width;o=n.snapElements[s].top;h=o+ n.snapElements[s].height;if(b<f- r||m>d+ r||g<o- r||p>h+ r||!e.contains(n.snapElements[s].item.ownerDocument,n.snapElements[s].item)){if(n.snapElements[s].snapping){(n.options.snap.release&&n.options.snap.release.call(n.element,t,e.extend(n.n$(),{snapItem:n.snapElements[s].item})))};n.snapElements[s].snapping=!1;continue};if(v.snapMode!=='inner'){l=Math.abs(o- g)<=r;c=Math.abs(h- p)<=r;u=Math.abs(f- b)<=r;a=Math.abs(d- m)<=r;if(l){i.position.top=n.c$('relative',{top:o- n.helperProportions.height,left:0}).top- n.margins.top};if(c){i.position.top=n.c$('relative',{top:h,left:0}).top- n.margins.top};if(u){i.position.left=n.c$('relative',{top:0,left:f- n.helperProportions.width}).left- n.margins.left};if(a){i.position.left=n.c$('relative',{top:0,left:d}).left- n.margins.left}};y=(l||c||u||a);if(v.snapMode!=='outer'){l=Math.abs(o- p)<=r;c=Math.abs(h- g)<=r;u=Math.abs(f- m)<=r;a=Math.abs(d- b)<=r;if(l){i.position.top=n.c$('relative',{top:o,left:0}).top- n.margins.top};if(c){i.position.top=n.c$('relative',{top:h- n.helperProportions.height,left:0}).top- n.margins.top};if(u){i.position.left=n.c$('relative',{top:0,left:f}).left- n.margins.left};if(a){i.position.left=n.c$('relative',{top:0,left:d- n.helperProportions.width}).left- n.margins.left}};if(!n.snapElements[s].snapping&&(l||c||u||a||y)){(n.options.snap.snap&&n.options.snap.snap.call(n.element,t,e.extend(n.n$(),{snapItem:n.snapElements[s].item})))};n.snapElements[s].snapping=(l||c||u||a||y)}}});e.ui.plugin.add('draggable','stack',{start:function(){var i,n=this.data('ui-draggable').options,t=e.makeArray(e(n.stack)).sort(function(t,i){return(parseInt(e(t).css('zIndex'),10)||0)-(parseInt(e(i).css('zIndex'),10)||0)});if(!t.length){return};i=parseInt(e(t[0]).css('zIndex'),10)||0;e(t).each(function(t){e(this).css('zIndex',i+ t)});this.css('zIndex',(i+ t.length))}});e.ui.plugin.add('draggable','zIndex',{start:function(t,i){var n=e(i.helper),s=e(this).data('ui-draggable').options;if(n.css('zIndex')){s.at$=n.css('zIndex')};n.css('zIndex',s.zIndex)},stop:function(t,i){var n=e(this).data('ui-draggable').options;if(n.at$){e(i.helper).css('zIndex',n.at$)}}})})(jQuery);(function(e,t){function i(e,t,i){return(e>t)&&(e<(t+ i))};e.widget('ui.droppable',{version:'1.10.3',widgetEventPrefix:'drop',options:{accept:'*',activeClass:!1,addClasses:!0,greedy:!1,hoverClass:!1,scope:'default',tolerance:'intersect',activate:null,deactivate:null,drop:null,out:null,over:null},E$:function(){var t=this.options,i=t.accept;this.isover=!1;this.isout=!0;this.accept=e.isFunction(i)?i:function(e){return e.is(i)};this.proportions={width:this.element[0].offsetWidth,height:this.element[0].offsetHeight};e.ui.ddmanager.droppables[t.scope]=e.ui.ddmanager.droppables[t.scope]||[];e.ui.ddmanager.droppables[t.scope].push(this);(t.addClasses&&this.element.addClass('ui-droppable'))},I$:function(){var t=0,i=e.ui.ddmanager.droppables[this.options.scope];for(;t<i.length;t++){if(i[t]===this){i.splice(t,1)}};this.element.removeClass('ui-droppable ui-droppable-disabled')},k$:function(t,i){if(t==='accept'){this.accept=e.isFunction(i)?i:function(e){return e.is(i)}};e.Widget.prototype.k$.apply(this,arguments)},ye$:function(t){var i=e.ui.ddmanager.current;if(this.options.activeClass){this.element.addClass(this.options.activeClass)};if(i){this.t$('activate',t,this.ui(i))}},oi$:function(t){var i=e.ui.ddmanager.current;if(this.options.activeClass){this.element.removeClass(this.options.activeClass)};if(i){this.t$('deactivate',t,this.ui(i))}},ri$:function(t){var i=e.ui.ddmanager.current;if(!i||(i.currentItem||i.element)[0]===this.element[0]){return};if(this.accept.call(this.element[0],(i.currentItem||i.element))){if(this.options.hoverClass){this.element.addClass(this.options.hoverClass)};this.t$('over',t,this.ui(i))}},si$:function(t){var i=e.ui.ddmanager.current;if(!i||(i.currentItem||i.element)[0]===this.element[0]){return};if(this.accept.call(this.element[0],(i.currentItem||i.element))){if(this.options.hoverClass){this.element.removeClass(this.options.hoverClass)};this.t$('out',t,this.ui(i))}},ai$:function(t,i){var n=i||e.ui.ddmanager.current,s=!1;if(!n||(n.currentItem||n.element)[0]===this.element[0]){return!1};this.element.find(':data(ui-droppable)').not('.ui-draggable-dragging').each(function(){var t=e.data(this,'ui-droppable');if(t.options.greedy&&!t.options.disabled&&t.options.scope===n.options.scope&&t.accept.call(t.element[0],(n.currentItem||n.element))&&e.ui.intersect(n,e.extend(t,{offset:t.element.offset()}),t.options.tolerance)){s=!0;return!1}});if(s){return!1};if(this.accept.call(this.element[0],(n.currentItem||n.element))){if(this.options.activeClass){this.element.removeClass(this.options.activeClass)};if(this.options.hoverClass){this.element.removeClass(this.options.hoverClass)};this.t$('drop',t,this.ui(n));return this.element};return!1},ui:function(e){return{draggable:(e.currentItem||e.element),helper:e.helper,position:e.position,offset:e.positionAbs}}});e.ui.intersect=function(e,t,n){if(!t.offset){return!1};var h,d,a=(e.positionAbs||e.position.absolute).left,u=a+ e.helperProportions.width,o=(e.positionAbs||e.position.absolute).top,f=o+ e.helperProportions.height,s=t.offset.left,l=s+ t.proportions.width,r=t.offset.top,c=r+ t.proportions.height;switch(n){case'fit':return(s<=a&&u<=l&&r<=o&&f<=c);case'intersect':return(s<a+(e.helperProportions.width/2)&&u-(e.helperProportions.width/2)<l&&r<o+(e.helperProportions.height/2)&&f-(e.helperProportions.height/2)<c);case'pointer':h=((e.positionAbs||e.position.absolute).left+(e.clickOffset||e.offset.click).left);d=((e.positionAbs||e.position.absolute).top+(e.clickOffset||e.offset.click).top);return i(d,r,t.proportions.height)&&i(h,s,t.proportions.width);case'touch':return((o>=r&&o<=c)||(f>=r&&f<=c)||(o<r&&f>c))&&((a>=s&&a<=l)||(u>=s&&u<=l)||(a<s&&u>l));default:return!1}};e.ui.ddmanager={current:null,droppables:{'default':[]},prepareOffsets:function(t,i){var n,r,s=e.ui.ddmanager.droppables[t.options.scope]||[],a=i?i.type:null,o=(t.currentItem||t.element).find(':data(ui-droppable)').addBack();droppablesLoop:for(n=0;n<s.length;n++){if(s[n].options.disabled||(t&&!s[n].accept.call(s[n].element[0],(t.currentItem||t.element)))){continue};for(r=0;r<o.length;r++){if(o[r]===s[n].element[0]){s[n].proportions.height=0;continue;droppablesLoop}};s[n].visible=s[n].element.css('display')!=='none';if(!s[n].visible){continue};if(a==='mousedown'){s[n].ye$.call(s[n],i)};s[n].offset=s[n].element.offset();s[n].proportions={width:s[n].element[0].offsetWidth,height:s[n].element[0].offsetHeight}}},drop:function(t,i){var n=!1;e.each((e.ui.ddmanager.droppables[t.options.scope]||[]).slice(),function(){if(!this.options){return};if(!this.options.disabled&&this.visible&&e.ui.intersect(t,this,this.options.tolerance)){n=this.ai$.call(this,i)||n};if(!this.options.disabled&&this.visible&&this.accept.call(this.element[0],(t.currentItem||t.element))){this.isout=!0;this.isover=!1;this.oi$.call(this,i)}});return n},dragStart:function(t,i){t.element.parentsUntil('body').bind('scroll.droppable',function(){if(!t.options.refreshPositions){e.ui.ddmanager.prepareOffsets(t,i)}})},drag:function(t,i){if(t.options.refreshPositions){e.ui.ddmanager.prepareOffsets(t,i)};e.each(e.ui.ddmanager.droppables[t.options.scope]||[],function(){if(this.options.disabled||this.greedyChild||!this.visible){return};var n,o,r,a=e.ui.intersect(t,this,this.options.tolerance),s=!a&&this.isover?'isout':(a&&!this.isover?'isover':null);if(!s){return};if(this.options.greedy){o=this.options.scope;r=this.element.parents(':data(ui-droppable)').filter(function(){return e.data(this,'ui-droppable').options.scope===o});if(r.length){n=e.data(r[0],'ui-droppable');n.greedyChild=(s==='isover')}};if(n&&s==='isover'){n.isover=!1;n.isout=!0;n.si$.call(n,i)};this[s]=!0;this[s==='isout'?'isover':'isout']=!1;this[s==='isover'?'_over':'_out'].call(this,i);if(n&&s==='isout'){n.isout=!1;n.isover=!0;n.ri$.call(n,i)}})},dragStop:function(t,i){t.element.parentsUntil('body').unbind('scroll.droppable');if(!t.options.refreshPositions){e.ui.ddmanager.prepareOffsets(t,i)}}}})(jQuery);(function(e,t){function n(e){return parseInt(e,10)||0};function i(e){return!isNaN(parseInt(e,10))};e.widget('ui.resizable',e.ui.mouse,{version:'1.10.3',widgetEventPrefix:'resize',options:{alsoResize:!1,animate:!1,animateDuration:'slow',animateEasing:'swing',aspectRatio:!1,autoHide:!1,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},E$:function(){var o,r,s,i,a,n=this,t=this.options;this.element.addClass('ui-resizable');e.extend(this,{Oe$:!!(t.aspectRatio),aspectRatio:t.aspectRatio,originalElement:this.element,W$:[],s$:t.helper||t.ghost||t.animate?t.helper||'ui-resizable-helper':null});if(this.element[0].nodeName.match(/canvas|textarea|input|select|button|img/i)){this.element.wrap(e('<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.data('ui-resizable'));this.elementIsWrapper=!0;this.element.css({marginLeft:this.originalElement.css('marginLeft'),marginTop:this.originalElement.css('marginTop'),marginRight:this.originalElement.css('marginRight'),marginBottom:this.originalElement.css('marginBottom')});this.originalElement.css({marginLeft:0,marginTop:0,marginRight:0,marginBottom:0});this.originalResizeStyle=this.originalElement.css('resize');this.originalElement.css('resize','none');this.W$.push(this.originalElement.css({position:'static',zoom:1,display:'block'}));this.originalElement.css({margin:this.originalElement.css('margin')});this.ae$()};this.handles=t.handles||(!e('.ui-resizable-handle',this.element).length?'e,s,se':{n:'.ui-resizable-n',e:'.ui-resizable-e',s:'.ui-resizable-s',w:'.ui-resizable-w',se:'.ui-resizable-se',sw:'.ui-resizable-sw',ne:'.ui-resizable-ne',nw:'.ui-resizable-nw'});if(this.handles.constructor===String){if(this.handles==='all'){this.handles='n,e,s,w,se,sw,ne,nw'};o=this.handles.split(',');this.handles={};for(r=0;r<o.length;r++){s=e.trim(o[r]);a='ui-resizable-'+ s;i=e('<div class=\'ui-resizable-handle '+ a+'\'></div>');i.css({zIndex:t.zIndex});if('se'===s){i.addClass('ui-icon ui-icon-gripsmall-diagonal-se')};this.handles[s]='.ui-resizable-'+ s;this.element.append(i)}};this.ni$=function(t){var i,n,r,s;t=t||this.element;for(i in this.handles){if(this.handles[i].constructor===String){this.handles[i]=e(this.handles[i],this.element).show()};if(this.elementIsWrapper&&this.originalElement[0].nodeName.match(/textarea|input|select|button/i)){n=e(this.handles[i],this.element);s=/sw|ne|nw|se|n|s/.test(i)?n.outerHeight():n.outerWidth();r=['padding',/ne|nw|n/.test(i)?'Top':/se|sw|s/.test(i)?'Bottom':/^e$/.test(i)?'Right':'Left'].join('');t.css(r,s);this.ae$()};if(!e(this.handles[i]).length){continue}}};this.ni$(this.element);this.te$=e('.ui-resizable-handle',this.element).disableSelection();this.te$.mouseover(function(){if(!n.resizing){if(this.className){i=this.className.match(/ui-resizable-(se|sw|ne|nw|n|e|s|w)/i)};n.axis=i&&i[1]?i[1]:'se'}});if(t.autoHide){this.te$.hide();e(this.element).addClass('ui-resizable-autohide').mouseenter(function(){if(t.disabled){return};e(this).removeClass('ui-resizable-autohide');n.te$.show()}).mouseleave(function(){if(t.disabled){return};if(!n.resizing){e(this).addClass('ui-resizable-autohide');n.te$.hide()}})};this.U$()},I$:function(){this.le$();var t,i=function(t){e(t).removeClass('ui-resizable ui-resizable-disabled ui-resizable-resizing').removeData('resizable').removeData('ui-resizable').unbind('.resizable').find('.ui-resizable-handle').remove()};if(this.elementIsWrapper){i(this.element);t=this.element;this.originalElement.css({position:t.css('position'),width:t.outerWidth(),height:t.outerHeight(),top:t.css('top'),left:t.css('left')}).insertAfter(t);t.remove()};this.originalElement.css('resize',this.originalResizeStyle);i(this.originalElement);return this},X$:function(t){var s,i,n=!1;for(s in this.handles){i=e(this.handles[s])[0];if(i===t.target||e.contains(i,t.target)){n=!0}};return!this.options.disabled&&n},O$:function(t){var o,r,a,s=this.options,l=this.element.position(),i=this.element;this.resizing=!0;if((/absolute/).test(i.css('position'))){i.css({position:'absolute',top:i.css('top'),left:i.css('left')})}else if(i.is('.ui-draggable')){i.css({position:'absolute',top:l.top,left:l.left})};this.Kt$();o=n(this.helper.css('left'));r=n(this.helper.css('top'));if(s.containment){o+=e(s.containment).scrollLeft()||0;r+=e(s.containment).scrollTop()||0};this.offset=this.helper.offset();this.position={left:o,top:r};this.size=this.s$?{width:i.outerWidth(),height:i.outerHeight()}:{width:i.width(),height:i.height()};this.originalSize=this.s$?{width:i.outerWidth(),height:i.outerHeight()}:{width:i.width(),height:i.height()};this.originalPosition={left:o,top:r};this.sizeDiff={width:i.outerWidth()- i.width(),height:i.outerHeight()- i.height()};this.originalMousePosition={left:t.pageX,top:t.pageY};this.aspectRatio=(typeof s.aspectRatio==='number')?s.aspectRatio:((this.originalSize.width/this.originalSize.height)||1);a=e('.ui-resizable-'+ this.axis).css('cursor');e('body').css('cursor',a==='auto'?this.axis+'-resize':a);i.addClass('ui-resizable-resizing');this.ne$('start',t);return!0},C$:function(t){var n,u=this.helper,i={},r=this.originalMousePosition,f=this.axis,c=this.position.top,h=this.position.left,d=this.size.width,a=this.size.height,o=(t.pageX- r.left)||0,l=(t.pageY- r.top)||0,s=this.h$[f];if(!s){return!1};n=s.apply(this,[t,o,l]);this.Zt$(t.shiftKey);if(this.Oe$||t.shiftKey){n=this.Gt$(n,t)};n=this.Vt$(n,t);this.ut$(n);this.ne$('resize',t);if(this.position.top!==c){i.top=this.position.top+'px'};if(this.position.left!==h){i.left=this.position.left+'px'};if(this.size.width!==d){i.width=this.size.width+'px'};if(this.size.height!==a){i.height=this.size.height+'px'};u.css(i);if(!this.s$&&this.W$.length){this.ae$()};if(!e.isEmptyObject(i)){this.t$('resize',t,this.ui())};return!1},z$:function(t){this.resizing=!1;var n,s,l,a,c,u,o,r=this.options,i=this;if(this.s$){n=this.W$;s=n.length&&(/textarea/i).test(n[0].nodeName);l=s&&e.ui.hasScroll(n[0],'left')?0:i.sizeDiff.height;a=s?0:i.sizeDiff.width;c={width:(i.helper.width()- a),height:(i.helper.height()- l)};u=(parseInt(i.element.css('left'),10)+(i.position.left- i.originalPosition.left))||null;o=(parseInt(i.element.css('top'),10)+(i.position.top- i.originalPosition.top))||null;if(!r.animate){this.element.css(e.extend(c,{top:o,left:u}))};i.helper.height(i.size.height);i.helper.width(i.size.width);if(this.s$&&!r.animate){this.ae$()}};e('body').css('cursor','auto');this.element.removeClass('ui-resizable-resizing');this.ne$('stop',t);if(this.s$){this.helper.remove()};return!1},Zt$:function(e){var o,a,r,s,t,n=this.options;t={minWidth:i(n.minWidth)?n.minWidth:0,maxWidth:i(n.maxWidth)?n.maxWidth:Infinity,minHeight:i(n.minHeight)?n.minHeight:0,maxHeight:i(n.maxHeight)?n.maxHeight:Infinity};if(this.Oe$||e){o=t.minHeight*this.aspectRatio;r=t.minWidth/this.aspectRatio;a=t.maxHeight*this.aspectRatio;s=t.maxWidth/this.aspectRatio;if(o>t.minWidth){t.minWidth=o};if(r>t.minHeight){t.minHeight=r};if(a<t.maxWidth){t.maxWidth=a};if(s<t.maxHeight){t.maxHeight=s}};this.ei$=t},ut$:function(e){this.offset=this.helper.offset();if(i(e.left)){this.position.left=e.left};if(i(e.top)){this.position.top=e.top};if(i(e.height)){this.size.height=e.height};if(i(e.width)){this.size.width=e.width}},Gt$:function(e){var n=this.position,t=this.size,s=this.axis;if(i(e.height)){e.width=(e.height*this.aspectRatio)}else if(i(e.width)){e.height=(e.width/this.aspectRatio)};if(s==='sw'){e.left=n.left+(t.width- e.width);e.top=null};if(s==='nw'){e.top=n.top+(t.height- e.height);e.left=n.left+(t.width- e.width)};return e},Vt$:function(e){var t=this.ei$,l=this.axis,c=i(e.width)&&t.maxWidth&&(t.maxWidth<e.width),u=i(e.height)&&t.maxHeight&&(t.maxHeight<e.height),a=i(e.width)&&t.minWidth&&(t.minWidth>e.width),f=i(e.height)&&t.minHeight&&(t.minHeight>e.height),r=this.originalPosition.left+ this.originalSize.width,n=this.position.top+ this.size.height,o=/sw|nw|w/.test(l),s=/nw|ne|n/.test(l);if(a){e.width=t.minWidth};if(f){e.height=t.minHeight};if(c){e.width=t.maxWidth};if(u){e.height=t.maxHeight};if(a&&o){e.left=r- t.minWidth};if(c&&o){e.left=r- t.maxWidth};if(f&&s){e.top=n- t.minHeight};if(u&&s){e.top=n- t.maxHeight};if(!e.width&&!e.height&&!e.left&&e.top){e.top=null}else if(!e.width&&!e.height&&!e.top&&e.left){e.left=null};return e},ae$:function(){if(!this.W$.length){return};var i,t,n,r,e,s=this.helper||this.element;for(i=0;i<this.W$.length;i++){e=this.W$[i];if(!this.borderDif){this.borderDif=[];n=[e.css('borderTopWidth'),e.css('borderRightWidth'),e.css('borderBottomWidth'),e.css('borderLeftWidth')];r=[e.css('paddingTop'),e.css('paddingRight'),e.css('paddingBottom'),e.css('paddingLeft')];for(t=0;t<n.length;t++){this.borderDif[t]=(parseInt(n[t],10)||0)+(parseInt(r[t],10)||0)}};e.css({height:(s.height()- this.borderDif[0]- this.borderDif[2])||0,width:(s.width()- this.borderDif[1]- this.borderDif[3])||0})}},Kt$:function(){var i=this.element,t=this.options;this.elementOffset=i.offset();if(this.s$){this.helper=this.helper||e('<div style=\'overflow:hidden;\'></div>');this.helper.addClass(this.s$).css({width:this.element.outerWidth()- 1,height:this.element.outerHeight()- 1,position:'absolute',left:this.elementOffset.left+'px',top:this.elementOffset.top+'px',zIndex:++t.zIndex});this.helper.appendTo('body').disableSelection()}else{this.helper=this.element}},h$:{e:function(e,t){return{width:this.originalSize.width+ t}},w:function(e,t){var n=this.originalSize,i=this.originalPosition;return{left:i.left+ t,width:n.width- t}},n:function(e,t,i){var s=this.originalSize,n=this.originalPosition;return{top:n.top+ i,height:s.height- i}},s:function(e,t,i){return{height:this.originalSize.height+ i}},se:function(t,i,n){return e.extend(this.h$.s.apply(this,arguments),this.h$.e.apply(this,[t,i,n]))},sw:function(t,i,n){return e.extend(this.h$.s.apply(this,arguments),this.h$.w.apply(this,[t,i,n]))},ne:function(t,i,n){return e.extend(this.h$.n.apply(this,arguments),this.h$.e.apply(this,[t,i,n]))},nw:function(t,i,n){return e.extend(this.h$.n.apply(this,arguments),this.h$.w.apply(this,[t,i,n]))}},ne$:function(t,i){e.ui.plugin.call(this,t,[i,this.ui()]);(t!=='resize'&&this.t$(t,i,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}}});e.ui.plugin.add('resizable','animate',{stop:function(t){var i=e(this).data('ui-resizable'),a=i.options,n=i.W$,o=n.length&&(/textarea/i).test(n[0].nodeName),l=o&&e.ui.hasScroll(n[0],'left')?0:i.sizeDiff.height,u=o?0:i.sizeDiff.width,c={width:(i.size.width- u),height:(i.size.height- l)},r=(parseInt(i.element.css('left'),10)+(i.position.left- i.originalPosition.left))||null,s=(parseInt(i.element.css('top'),10)+(i.position.top- i.originalPosition.top))||null;i.element.animate(e.extend(c,s&&r?{top:s,left:r}:{}),{duration:a.animateDuration,easing:a.animateEasing,step:function(){var s={width:parseInt(i.element.css('width'),10),height:parseInt(i.element.css('height'),10),top:parseInt(i.element.css('top'),10),left:parseInt(i.element.css('left'),10)};if(n&&n.length){e(n[0]).css({width:s.width,height:s.height})};i.ut$(s);i.ne$('resize',t)}})}});e.ui.plugin.add('resizable','containment',{start:function(){var r,o,a,u,f,l,c,t=e(this).data('ui-resizable'),d=t.options,h=t.element,s=d.containment,i=(s instanceof e)?s.get(0):(/parent/.test(s))?h.parent().get(0):s;if(!i){return};t.containerElement=e(i);if(/document/.test(s)||s===document){t.containerOffset={left:0,top:0};t.containerPosition={left:0,top:0};t.parentData={element:e(document),left:0,top:0,width:e(document).width(),height:e(document).height()||document.body.parentNode.scrollHeight}}else{r=e(i);o=[];e(['Top','Right','Left','Bottom']).each(function(e,t){o[e]=n(r.css('padding'+ t))});t.containerOffset=r.offset();t.containerPosition=r.position();t.containerSize={height:(r.innerHeight()- o[3]),width:(r.innerWidth()- o[1])};a=t.containerOffset;u=t.containerSize.height;f=t.containerSize.width;l=(e.ui.hasScroll(i,'left')?i.scrollWidth:f);c=(e.ui.hasScroll(i)?i.scrollHeight:u);t.parentData={element:i,left:a.left,top:a.top,width:l,height:c}}},resize:function(t){var r,a,l,c,i=e(this).data('ui-resizable'),h=i.options,n=i.containerOffset,u=i.position,o=i.Oe$||t.shiftKey,s={top:0,left:0},f=i.containerElement;if(f[0]!==document&&(/static/).test(f.css('position'))){s=n};if(u.left<(i.s$?n.left:0)){i.size.width=i.size.width+(i.s$?(i.position.left- n.left):(i.position.left- s.left));if(o){i.size.height=i.size.width/i.aspectRatio};i.position.left=h.helper?n.left:0};if(u.top<(i.s$?n.top:0)){i.size.height=i.size.height+(i.s$?(i.position.top- n.top):i.position.top);if(o){i.size.width=i.size.height*i.aspectRatio};i.position.top=i.s$?n.top:0};i.offset.left=i.parentData.left+ i.position.left;i.offset.top=i.parentData.top+ i.position.top;r=Math.abs((i.s$?i.offset.left- s.left:(i.offset.left- s.left))+ i.sizeDiff.width);a=Math.abs((i.s$?i.offset.top- s.top:(i.offset.top- n.top))+ i.sizeDiff.height);l=i.containerElement.get(0)===i.element.parent().get(0);c=/relative|absolute/.test(i.containerElement.css('position'));if(l&&c){r-=i.parentData.left};if(r+ i.size.width>=i.parentData.width){i.size.width=i.parentData.width- r;if(o){i.size.height=i.size.width/i.aspectRatio}};if(a+ i.size.height>=i.parentData.height){i.size.height=i.parentData.height- a;if(o){i.size.width=i.size.height*i.aspectRatio}}},stop:function(){var t=e(this).data('ui-resizable'),a=t.options,l=t.containerOffset,c=t.containerPosition,o=t.containerElement,i=e(t.helper),n=i.offset(),s=i.outerWidth()- t.sizeDiff.width,r=i.outerHeight()- t.sizeDiff.height;if(t.s$&&!a.animate&&(/relative/).test(o.css('position'))){e(this).css({left:n.left- c.left- l.left,width:s,height:r})};if(t.s$&&!a.animate&&(/static/).test(o.css('position'))){e(this).css({left:n.left- c.left- l.left,width:s,height:r})}}});e.ui.plugin.add('resizable','alsoResize',{start:function(){var n=e(this).data('ui-resizable'),t=n.options,i=function(t){e(t).each(function(){var t=e(this);t.data('ui-resizable-alsoresize',{width:parseInt(t.width(),10),height:parseInt(t.height(),10),left:parseInt(t.css('left'),10),top:parseInt(t.css('top'),10)})})};if(typeof(t.alsoResize)==='object'&&!t.alsoResize.parentNode){if(t.alsoResize.length){t.alsoResize=t.alsoResize[0];i(t.alsoResize)}else{e.each(t.alsoResize,function(e){i(e)})}}else{i(t.alsoResize)}},resize:function(t,i){var n=e(this).data('ui-resizable'),s=n.options,a=n.originalSize,o=n.originalPosition,l={height:(n.size.height- a.height)||0,width:(n.size.width- a.width)||0,top:(n.position.top- o.top)||0,left:(n.position.left- o.left)||0},r=function(t,n){e(t).each(function(){var s=e(this),o=e(this).data('ui-resizable-alsoresize'),t={},r=n&&n.length?n:s.parents(i.originalElement[0]).length?['width','height']:['width','height','top','left'];e.each(r,function(e,i){var n=(o[i]||0)+(l[i]||0);if(n&&n>=0){t[i]=n||null}});s.css(t)})};if(typeof(s.alsoResize)==='object'&&!s.alsoResize.nodeType){e.each(s.alsoResize,function(e,t){r(e,t)})}else{r(s.alsoResize)}},stop:function(){e(this).removeData('resizable-alsoresize')}});e.ui.plugin.add('resizable','ghost',{start:function(){var t=e(this).data('ui-resizable'),n=t.options,i=t.size;t.ghost=t.originalElement.clone();t.ghost.css({opacity:0.25,display:'block',position:'relative',height:i.height,width:i.width,margin:0,left:0,top:0}).addClass('ui-resizable-ghost').addClass(typeof n.ghost==='string'?n.ghost:'');t.ghost.appendTo(t.helper)},resize:function(){var t=e(this).data('ui-resizable');if(t.ghost){t.ghost.css({position:'relative',height:t.size.height,width:t.size.width})}},stop:function(){var t=e(this).data('ui-resizable');if(t.ghost&&t.helper){t.helper.get(0).removeChild(t.ghost.get(0))}}});e.ui.plugin.add('resizable','grid',{resize:function(){var t=e(this).data('ui-resizable'),i=t.options,d=t.size,l=t.originalSize,a=t.originalPosition,h=t.axis,c=typeof i.grid==='number'?[i.grid,i.grid]:i.grid,r=(c[0]||1),o=(c[1]||1),f=Math.round((d.width- l.width)/ r) * r,
  9. u=Math.round((d.height- l.height)/ o) * o,
  10. n=l.width+ f,s=l.height+ u,v=i.maxWidth&&(i.maxWidth<n),g=i.maxHeight&&(i.maxHeight<s),m=i.minWidth&&(i.minWidth>n),p=i.minHeight&&(i.minHeight>s);i.grid=c;if(m){n=n+ r};if(p){s=s+ o};if(v){n=n- r};if(g){s=s- o};if(/^(se|s|e)$/.test(h)){t.size.width=n;t.size.height=s}else if(/^(ne)$/.test(h)){t.size.width=n;t.size.height=s;t.position.top=a.top- u}else if(/^(sw)$/.test(h)){t.size.width=n;t.size.height=s;t.position.left=a.left- f}else{t.size.width=n;t.size.height=s;t.position.top=a.top- u;t.position.left=a.left- f}}})})(jQuery);(function(e,t){e.widget('ui.selectable',e.ui.mouse,{version:'1.10.3',options:{appendTo:'body',autoRefresh:!0,distance:0,filter:'*',tolerance:'touch',selected:null,selecting:null,start:null,stop:null,unselected:null,unselecting:null},E$:function(){var t,i=this;this.element.addClass('ui-selectable');this.dragged=!1;this.refresh=function(){t=e(i.options.filter,i.element[0]);t.addClass('ui-selectee');t.each(function(){var t=e(this),i=t.offset();e.data(this,'selectable-item',{element:this,o$:t,left:i.left,top:i.top,right:i.left+ t.outerWidth(),bottom:i.top+ t.outerHeight(),startselected:!1,selected:t.hasClass('ui-selected'),selecting:t.hasClass('ui-selecting'),unselecting:t.hasClass('ui-unselecting')})})};this.refresh();this.selectees=t.addClass('ui-selectee');this.U$();this.helper=e('<div class=\'ui-selectable-helper\'></div>')},I$:function(){this.selectees.removeClass('ui-selectee').removeData('selectable-item');this.element.removeClass('ui-selectable ui-selectable-disabled');this.le$()},O$:function(t){var n=this,i=this.options;this.opos=[t.pageX,t.pageY];if(this.options.disabled){return};this.selectees=e(i.filter,this.element[0]);this.t$('start',t);e(i.appendTo).append(this.helper);this.helper.css({'left':t.pageX,'top':t.pageY,'width':0,'height':0});if(i.autoRefresh){this.refresh()};this.selectees.filter('.ui-selected').each(function(){var i=e.data(this,'selectable-item');i.startselected=!0;if(!t.metaKey&&!t.ctrlKey){i.o$.removeClass('ui-selected');i.selected=!1;i.o$.addClass('ui-unselecting');i.unselecting=!0;n.t$('unselecting',t,{unselecting:i.element})}});e(t.target).parents().addBack().each(function(){var s,i=e.data(this,'selectable-item');if(i){s=(!t.metaKey&&!t.ctrlKey)||!i.o$.hasClass('ui-selected');i.o$.removeClass(s?'ui-unselecting':'ui-selected').addClass(s?'ui-selecting':'ui-unselecting');i.unselecting=!s;i.selecting=s;i.selected=s;if(s){n.t$('selecting',t,{selecting:i.element})}else{n.t$('unselecting',t,{unselecting:i.element})};return!1}})},C$:function(t){this.dragged=!0;if(this.options.disabled){return};var a,o=this,l=this.options,i=this.opos[0],n=this.opos[1],s=t.pageX,r=t.pageY;if(i>s){a=s;s=i;i=a};if(n>r){a=r;r=n;n=a};this.helper.css({left:i,top:n,width:s- i,height:r- n});this.selectees.each(function(){var a=e.data(this,'selectable-item'),c=!1;if(!a||a.element===o.element[0]){return};if(l.tolerance==='touch'){c=(!(a.left>s||a.right<i||a.top>r||a.bottom<n))}else if(l.tolerance==='fit'){c=(a.left>i&&a.right<s&&a.top>n&&a.bottom<r)};if(c){if(a.selected){a.o$.removeClass('ui-selected');a.selected=!1};if(a.unselecting){a.o$.removeClass('ui-unselecting');a.unselecting=!1};if(!a.selecting){a.o$.addClass('ui-selecting');a.selecting=!0;o.t$('selecting',t,{selecting:a.element})}}else{if(a.selecting){if((t.metaKey||t.ctrlKey)&&a.startselected){a.o$.removeClass('ui-selecting');a.selecting=!1;a.o$.addClass('ui-selected');a.selected=!0}else{a.o$.removeClass('ui-selecting');a.selecting=!1;if(a.startselected){a.o$.addClass('ui-unselecting');a.unselecting=!0};o.t$('unselecting',t,{unselecting:a.element})}};if(a.selected){if(!t.metaKey&&!t.ctrlKey&&!a.startselected){a.o$.removeClass('ui-selected');a.selected=!1;a.o$.addClass('ui-unselecting');a.unselecting=!0;o.t$('unselecting',t,{unselecting:a.element})}}}});return!1},z$:function(t){var i=this;this.dragged=!1;e('.ui-unselecting',this.element[0]).each(function(){var n=e.data(this,'selectable-item');n.o$.removeClass('ui-unselecting');n.unselecting=!1;n.startselected=!1;i.t$('unselected',t,{unselected:n.element})});e('.ui-selecting',this.element[0]).each(function(){var n=e.data(this,'selectable-item');n.o$.removeClass('ui-selecting').addClass('ui-selected');n.selecting=!1;n.selected=!0;n.startselected=!0;i.t$('selected',t,{selected:n.element})});this.t$('stop',t);this.helper.remove();return!1}})})(jQuery);(function(e,t){function i(e,t,i){return(e>t)&&(e<(t+ i))};function n(e){return(/left|right/).test(e.css('float'))||(/inline|table-cell/).test(e.css('display'))};e.widget('ui.sortable',e.ui.mouse,{version:'1.10.3',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},E$:function(){var e=this.options;this.containerCache={};this.element.addClass('ui-sortable');this.refresh();this.floating=this.items.length?e.axis==='x'||n(this.items[0].item):!1;this.offset=this.element.offset();this.U$();this.ready=!0},I$:function(){this.element.removeClass('ui-sortable ui-sortable-disabled');this.le$();for(var e=this.items.length- 1;e>=0;e--){this.items[e].item.removeData(this.widgetName+'-item')};return this},k$:function(t,i){if(t==='disabled'){this.options[t]=i;this.widget().toggleClass('ui-sortable-disabled',!!i)}else{e.Widget.prototype.k$.apply(this,arguments)}},X$:function(t,i){var n=null,r=!1,s=this;if(this.reverting){return!1};if(this.options.disabled||this.options.type==='static'){return!1};this.Ye$(t);e(t.target).parents().each(function(){if(e.data(this,s.widgetName+'-item')===s){n=e(this);return!1}});if(e.data(t.target,s.widgetName+'-item')===s){n=e(t.target)};if(!n){return!1};if(this.options.handle&&!i){e(this.options.handle,n).find('*').addBack().each(function(){if(this===t.target){r=!0}});if(!r){return!1}};this.currentItem=n;this.Ci$();return!0},O$:function(t,i,n){var o,r,s=this.options;this.currentContainer=this;this.refreshPositions();this.helper=this.pe$(t);this.K$();this.me$();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};e.extend(this.offset,{click:{left:t.pageX- this.offset.left,top:t.pageY- this.offset.top},parent:this.V$(),relative:this.re$()});this.helper.css('position','absolute');this.cssPosition=this.helper.css('position');this.originalPosition=this.J$(t);this.originalPageX=t.pageX;this.originalPageY=t.pageY;(s.cursorAt&&this.de$(s.cursorAt));this.domPosition={prev:this.currentItem.prev()[0],parent:this.currentItem.parent()[0]};if(this.helper[0]!==this.currentItem[0]){this.currentItem.hide()};this.ki$();if(s.containment){this.ge$()};if(s.cursor&&s.cursor!=='auto'){r=this.document.find('body');this.storedCursor=r.css('cursor');r.css('cursor',s.cursor);this.storedStylesheet=e('<style>*{ cursor: '+ s.cursor+' !important; }</style>').appendTo(r)};if(s.opacity){if(this.helper.css('opacity')){this.Ue$=this.helper.css('opacity')};this.helper.css('opacity',s.opacity)};if(s.zIndex){if(this.helper.css('zIndex')){this.He$=this.helper.css('zIndex')};this.helper.css('zIndex',s.zIndex)};if(this.scrollParent[0]!==document&&this.scrollParent[0].tagName!=='HTML'){this.overflowOffset=this.scrollParent.offset()};this.t$('start',t,this.n$());if(!this.ji$){this.K$()};if(!n){for(o=this.containers.length- 1;o>=0;o--){this.containers[o].t$('activate',t,this.n$(this))}};if(e.ui.ddmanager){e.ui.ddmanager.current=this};if(e.ui.ddmanager&&!s.dropBehaviour){e.ui.ddmanager.prepareOffsets(this,t)};this.dragging=!0;this.helper.addClass('ui-sortable-helper');this.C$(t);return!0},C$:function(t){var o,s,r,a,i=this.options,n=!1;this.position=this.J$(t);this.positionAbs=this.c$('absolute');if(!this.lastPositionAbs){this.lastPositionAbs=this.positionAbs};if(this.options.scroll){if(this.scrollParent[0]!==document&&this.scrollParent[0].tagName!=='HTML'){if((this.overflowOffset.top+ this.scrollParent[0].offsetHeight)- t.pageY<i.scrollSensitivity){this.scrollParent[0].scrollTop=n=this.scrollParent[0].scrollTop+ i.scrollSpeed}else if(t.pageY- this.overflowOffset.top<i.scrollSensitivity){this.scrollParent[0].scrollTop=n=this.scrollParent[0].scrollTop- i.scrollSpeed};if((this.overflowOffset.left+ this.scrollParent[0].offsetWidth)- t.pageX<i.scrollSensitivity){this.scrollParent[0].scrollLeft=n=this.scrollParent[0].scrollLeft+ i.scrollSpeed}else if(t.pageX- this.overflowOffset.left<i.scrollSensitivity){this.scrollParent[0].scrollLeft=n=this.scrollParent[0].scrollLeft- i.scrollSpeed}}else{if(t.pageY- e(document).scrollTop()<i.scrollSensitivity){n=e(document).scrollTop(e(document).scrollTop()- i.scrollSpeed)}else if(e(window).height()-(t.pageY- e(document).scrollTop())<i.scrollSensitivity){n=e(document).scrollTop(e(document).scrollTop()+ i.scrollSpeed)};if(t.pageX- e(document).scrollLeft()<i.scrollSensitivity){n=e(document).scrollLeft(e(document).scrollLeft()- i.scrollSpeed)}else if(e(window).width()-(t.pageX- e(document).scrollLeft())<i.scrollSensitivity){n=e(document).scrollLeft(e(document).scrollLeft()+ i.scrollSpeed)}};if(n!==!1&&e.ui.ddmanager&&!i.dropBehaviour){e.ui.ddmanager.prepareOffsets(this,t)}};this.positionAbs=this.c$('absolute');if(!this.options.axis||this.options.axis!=='y'){this.helper[0].style.left=this.position.left+'px'};if(!this.options.axis||this.options.axis!=='x'){this.helper[0].style.top=this.position.top+'px'};for(o=this.items.length- 1;o>=0;o--){s=this.items[o];r=s.item[0];a=this.wi$(s);if(!a){continue};if(s.instance!==this.currentContainer){continue};if(r!==this.currentItem[0]&&this.placeholder[a===1?'next':'prev']()[0]!==r&&!e.contains(this.placeholder[0],r)&&(this.options.type==='semi-dynamic'?!e.contains(this.element[0],r):!0)){this.direction=a===1?'down':'up';if(this.options.tolerance==='pointer'||this.Ti$(s)){this.Fe$(t,s)}else{break};this.t$('change',t,this.n$());break}};this.xi$(t);if(e.ui.ddmanager){e.ui.ddmanager.drag(this,t)};this.t$('sort',t,this.n$());this.lastPositionAbs=this.positionAbs;return!1},z$:function(t,i){if(!t){return};if(e.ui.ddmanager&&!this.options.dropBehaviour){e.ui.ddmanager.drop(this,t)};if(this.options.revert){var o=this,r=this.placeholder.offset(),n=this.options.axis,s={};if(!n||n==='x'){s.left=r.left- this.offset.parent.left- this.margins.left+(this.offsetParent[0]===document.body?0:this.offsetParent[0].scrollLeft)};if(!n||n==='y'){s.top=r.top- this.offset.parent.top- this.margins.top+(this.offsetParent[0]===document.body?0:this.offsetParent[0].scrollTop)};this.reverting=!0;e(this.helper).animate(s,parseInt(this.options.revert,10)||500,function(){o.F$(t)})}else{this.F$(t,i)};return!1},cancel:function(){if(this.dragging){this.y$({target:null});if(this.options.helper==='original'){this.currentItem.css(this.R$).removeClass('ui-sortable-helper')}else{this.currentItem.show()};for(var t=this.containers.length- 1;t>=0;t--){this.containers[t].t$('deactivate',null,this.n$(this));if(this.containers[t].containerCache.over){this.containers[t].t$('out',null,this.n$(this));this.containers[t].containerCache.over=0}}};if(this.placeholder){if(this.placeholder[0].parentNode){this.placeholder[0].parentNode.removeChild(this.placeholder[0])};if(this.options.helper!=='original'&&this.helper&&this.helper[0].parentNode){this.helper.remove()};e.extend(this,{helper:null,dragging:!1,reverting:!1,qe$:null});if(this.domPosition.prev){e(this.domPosition.prev).after(this.currentItem)}else{e(this.domPosition.parent).prepend(this.currentItem)}};return this},serialize:function(t){var n=this.nt$(t&&t.connected),i=[];t=t||{};e(n).each(function(){var n=(e(t.item||this).attr(t.attribute||'id')||'').match(t.expression||(/(.+)[\-=_](.+)/));if(n){i.push((t.key||n[1]+'[]')+'='+(t.key&&t.expression?n[1]:n[2]))}});if(!i.length&&t.key){i.push(t.key+'=')};return i.join('&')},toArray:function(t){var n=this.nt$(t&&t.connected),i=[];t=t||{};n.each(function(){i.push(e(t.item||this).attr(t.attribute||'id')||'')});return i},be$:function(e){var i=this.positionAbs.left,h=i+ this.helperProportions.width,t=this.positionAbs.top,d=t+ this.helperProportions.height,s=e.left,l=s+ e.width,n=e.top,o=n+ e.height,r=this.offset.click.top,a=this.offset.click.left,f=(this.options.axis==='x')||((t+ r)>n&&(t+ r)<o),u=(this.options.axis==='y')||((i+ a)>s&&(i+ a)<l),c=f&&u;if(this.options.tolerance==='pointer'||this.options.forcePointerForContainers||(this.options.tolerance!=='pointer'&&this.helperProportions[this.floating?'width':'height']>e[this.floating?'width':'height'])){return c}else{return(s<i+(this.helperProportions.width/2)&&h-(this.helperProportions.width/2)<l&&n<t+(this.helperProportions.height/2)&&d-(this.helperProportions.height/2)<o)}},wi$:function(e){var r=(this.options.axis==='x')||i(this.positionAbs.top+ this.offset.click.top,e.top,e.height),s=(this.options.axis==='y')||i(this.positionAbs.left+ this.offset.click.left,e.left,e.width),o=r&&s,t=this.ct$(),n=this.lt$();if(!o){return!1};return this.floating?(((n&&n==='right')||t==='down')?2:1):(t&&(t==='down'?2:1))},Ti$:function(e){var r=i(this.positionAbs.top+ this.offset.click.top,e.top+(e.height/2),e.height),s=i(this.positionAbs.left+ this.offset.click.left,e.left+(e.width/2),e.width),n=this.ct$(),t=this.lt$();if(this.floating&&t){return((t==='right'&&s)||(t==='left'&&!s))}else{return n&&((n==='down'&&r)||(n==='up'&&!r))}},ct$:function(){var e=this.positionAbs.top- this.lastPositionAbs.top;return e!==0&&(e>0?'down':'up')},lt$:function(){var e=this.positionAbs.left- this.lastPositionAbs.left;return e!==0&&(e>0?'right':'left')},refresh:function(e){this.Ye$(e);this.refreshPositions();return this},ft$:function(){var e=this.options;return e.connectWith.constructor===String?[e.connectWith]:e.connectWith},nt$:function(t){var n,s,a,i,l=[],r=[],o=this.ft$();if(o&&t){for(n=o.length- 1;n>=0;n--){a=e(o[n]);for(s=a.length- 1;s>=0;s--){i=e.data(a[s],this.widgetFullName);if(i&&i!==this&&!i.options.disabled){r.push([e.isFunction(i.options.items)?i.options.items.call(i.element):e(i.options.items,i.element).not('.ui-sortable-helper').not('.ui-sortable-placeholder'),i])}}}};r.push([e.isFunction(this.options.items)?this.options.items.call(this.element,null,{options:this.options,item:this.currentItem}):e(this.options.items,this.element).not('.ui-sortable-helper').not('.ui-sortable-placeholder'),this]);for(n=r.length- 1;n>=0;n--){r[n][0].each(function(){l.push(this)})};return e(l)},Ci$:function(){var t=this.currentItem.find(':data('+ this.widgetName+'-item)');this.items=e.grep(this.items,function(e){for(var i=0;i<t.length;i++){if(t[i]===e.item[0]){return!1}};return!0})},Ye$:function(t){this.items=[];this.containers=[this];var n,s,c,i,l,u,a,f,h=this.items,r=[[e.isFunction(this.options.items)?this.options.items.call(this.element[0],t,{item:this.currentItem}):e(this.options.items,this.element),this]],o=this.ft$();if(o&&this.ready){for(n=o.length- 1;n>=0;n--){c=e(o[n]);for(s=c.length- 1;s>=0;s--){i=e.data(c[s],this.widgetFullName);if(i&&i!==this&&!i.options.disabled){r.push([e.isFunction(i.options.items)?i.options.items.call(i.element[0],t,{item:this.currentItem}):e(i.options.items,i.element),i]);this.containers.push(i)}}}};for(n=r.length- 1;n>=0;n--){l=r[n][1];u=r[n][0];for(s=0,f=u.length;s<f;s++){a=e(u[s]);a.data(this.widgetName+'-item',l);h.push({item:a,instance:l,width:0,height:0,left:0,top:0})}}},refreshPositions:function(t){if(this.offsetParent&&this.helper){this.offset.parent=this.V$()};var i,n,r,s;for(i=this.items.length- 1;i>=0;i--){n=this.items[i];if(n.instance!==this.currentContainer&&this.currentContainer&&n.item[0]!==this.currentItem[0]){continue};r=this.options.toleranceElement?e(this.options.toleranceElement,n.item):n.item;if(!t){n.width=r.outerWidth();n.height=r.outerHeight()};s=r.offset();n.left=s.left;n.top=s.top};if(this.options.custom&&this.options.custom.refreshContainers){this.options.custom.refreshContainers.call(this)}else{for(i=this.containers.length- 1;i>=0;i--){s=this.containers[i].element.offset();this.containers[i].containerCache.left=s.left;this.containers[i].containerCache.top=s.top;this.containers[i].containerCache.width=this.containers[i].element.outerWidth();this.containers[i].containerCache.height=this.containers[i].element.outerHeight()}};return this},ki$:function(t){t=t||this;var n,i=t.options;if(!i.placeholder||i.placeholder.constructor===String){n=i.placeholder;i.placeholder={element:function(){var s=t.currentItem[0].nodeName.toLowerCase(),i=e('<'+ s+'>',t.document[0]).addClass(n||t.currentItem[0].className+' ui-sortable-placeholder').removeClass('ui-sortable-helper');if(s==='tr'){t.currentItem.children().each(function(){e('<td>&#160;</td>',t.document[0]).attr('colspan',e(this).attr('colspan')||1).appendTo(i)})}else if(s==='img'){i.attr('src',t.currentItem.attr('src'))};if(!n){i.css('visibility','hidden')};return i},update:function(e,s){if(n&&!i.forcePlaceholderSize){return};if(!s.height()){s.height(t.currentItem.innerHeight()- parseInt(t.currentItem.css('paddingTop')||0,10)- parseInt(t.currentItem.css('paddingBottom')||0,10))};if(!s.width()){s.width(t.currentItem.innerWidth()- parseInt(t.currentItem.css('paddingLeft')||0,10)- parseInt(t.currentItem.css('paddingRight')||0,10))}}}};t.placeholder=e(i.placeholder.element.call(t.element,t.currentItem));t.currentItem.after(t.placeholder);i.placeholder.update(t,t.placeholder)},xi$:function(t){var o,s,p,u,h,d,c,a,m,f,l=null,r=null;for(o=this.containers.length- 1;o>=0;o--){if(e.contains(this.currentItem[0],this.containers[o].element[0])){continue};if(this.be$(this.containers[o].containerCache)){if(l&&e.contains(this.containers[o].element[0],l.element[0])){continue};l=this.containers[o];r=o}else{if(this.containers[o].containerCache.over){this.containers[o].t$('out',t,this.n$(this));this.containers[o].containerCache.over=0}}};if(!l){return};if(this.containers.length===1){if(!this.containers[r].containerCache.over){this.containers[r].t$('over',t,this.n$(this));this.containers[r].containerCache.over=1}}else{p=10000;u=null;f=l.floating||n(this.currentItem);h=f?'left':'top';d=f?'width':'height';c=this.positionAbs[h]+ this.offset.click[h];for(s=this.items.length- 1;s>=0;s--){if(!e.contains(this.containers[r].element[0],this.items[s].item[0])){continue};if(this.items[s].item[0]===this.currentItem[0]){continue};if(f&&!i(this.positionAbs.top+ this.offset.click.top,this.items[s].top,this.items[s].height)){continue};a=this.items[s].item.offset()[h];m=!1;if(Math.abs(a- c)>Math.abs(a+ this.items[s][d]- c)){m=!0;a+=this.items[s][d]};if(Math.abs(a- c)<p){p=Math.abs(a- c);u=this.items[s];this.direction=m?'up':'down'}};if(!u&&!this.options.dropOnEmpty){return};if(this.currentContainer===this.containers[r]){return};u?this.Fe$(t,u,null,!0):this.Fe$(t,null,this.containers[r].element,!0);this.t$('change',t,this.n$());this.containers[r].t$('change',t,this.n$(this));this.currentContainer=this.containers[r];this.options.placeholder.update(this.currentContainer,this.placeholder);this.containers[r].t$('over',t,this.n$(this));this.containers[r].containerCache.over=1}},pe$:function(t){var n=this.options,i=e.isFunction(n.helper)?e(n.helper.apply(this.element[0],[t,this.currentItem])):(n.helper==='clone'?this.currentItem.clone():this.currentItem);if(!i.parents('body').length){e(n.appendTo!=='parent'?n.appendTo:this.currentItem[0].parentNode)[0].appendChild(i[0])};if(i[0]===this.currentItem[0]){this.R$={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')}};if(!i[0].style.width||n.forceHelperSize){i.width(this.currentItem.width())};if(!i[0].style.height||n.forceHelperSize){i.height(this.currentItem.height())};return i},de$:function(t){if(typeof t==='string'){t=t.split(' ')};if(e.isArray(t)){t={left:+t[0],top:+t[1]||0}};if('left'in t){this.offset.click.left=t.left+ this.margins.left};if('right'in t){this.offset.click.left=this.helperProportions.width- t.right+ this.margins.left};if('top'in t){this.offset.click.top=t.top+ this.margins.top};if('bottom'in t){this.offset.click.top=this.helperProportions.height- t.bottom+ this.margins.top}},V$:function(){this.offsetParent=this.helper.offsetParent();var t=this.offsetParent.offset();if(this.cssPosition==='absolute'&&this.scrollParent[0]!==document&&e.contains(this.scrollParent[0],this.offsetParent[0])){t.left+=this.scrollParent.scrollLeft();t.top+=this.scrollParent.scrollTop()};if(this.offsetParent[0]===document.body||(this.offsetParent[0].tagName&&this.offsetParent[0].tagName.toLowerCase()==='html'&&e.ui.ie)){t={top:0,left:0}};return{top:t.top+(parseInt(this.offsetParent.css('borderTopWidth'),10)||0),left:t.left+(parseInt(this.offsetParent.css('borderLeftWidth'),10)||0)}},re$:function(){if(this.cssPosition==='relative'){var e=this.currentItem.position();return{top:e.top-(parseInt(this.helper.css('top'),10)||0)+ this.scrollParent.scrollTop(),left:e.left-(parseInt(this.helper.css('left'),10)||0)+ this.scrollParent.scrollLeft()}}else{return{top:0,left:0}}},me$:function(){this.margins={left:(parseInt(this.currentItem.css('marginLeft'),10)||0),top:(parseInt(this.currentItem.css('marginTop'),10)||0)}},K$:function(){this.helperProportions={width:this.helper.outerWidth(),height:this.helper.outerHeight()}},ge$:function(){var t,n,s,i=this.options;if(i.containment==='parent'){i.containment=this.helper[0].parentNode};if(i.containment==='document'||i.containment==='window'){this.containment=[0- this.offset.relative.left- this.offset.parent.left,0- this.offset.relative.top- this.offset.parent.top,e(i.containment==='document'?document:window).width()- this.helperProportions.width- this.margins.left,(e(i.containment==='document'?document:window).height()||document.body.parentNode.scrollHeight)- this.helperProportions.height- this.margins.top]};if(!(/^(document|window|parent)$/).test(i.containment)){t=e(i.containment)[0];n=e(i.containment).offset();s=(e(t).css('overflow')!=='hidden');this.containment=[n.left+(parseInt(e(t).css('borderLeftWidth'),10)||0)+(parseInt(e(t).css('paddingLeft'),10)||0)- this.margins.left,n.top+(parseInt(e(t).css('borderTopWidth'),10)||0)+(parseInt(e(t).css('paddingTop'),10)||0)- this.margins.top,n.left+(s?Math.max(t.scrollWidth,t.offsetWidth):t.offsetWidth)-(parseInt(e(t).css('borderLeftWidth'),10)||0)-(parseInt(e(t).css('paddingRight'),10)||0)- this.helperProportions.width- this.margins.left,n.top+(s?Math.max(t.scrollHeight,t.offsetHeight):t.offsetHeight)-(parseInt(e(t).css('borderTopWidth'),10)||0)-(parseInt(e(t).css('paddingBottom'),10)||0)- this.helperProportions.height- this.margins.top]}},c$:function(t,i){if(!i){i=this.position};var n=t==='absolute'?1:-1,s=this.cssPosition==='absolute'&&!(this.scrollParent[0]!==document&&e.contains(this.scrollParent[0],this.offsetParent[0]))?this.offsetParent:this.scrollParent,r=(/(html|body)/i).test(s[0].tagName);return{top:(i.top+ this.offset.relative.top*n+ this.offset.parent.top*n-((this.cssPosition==='fixed'?-this.scrollParent.scrollTop():(r?0:s.scrollTop()))*n)),left:(i.left+ this.offset.relative.left*n+ this.offset.parent.left*n-((this.cssPosition==='fixed'?-this.scrollParent.scrollLeft():r?0:s.scrollLeft())*n))}},J$:function(t){var s,n,i=this.options,o=t.pageX,r=t.pageY,a=this.cssPosition==='absolute'&&!(this.scrollParent[0]!==document&&e.contains(this.scrollParent[0],this.offsetParent[0]))?this.offsetParent:this.scrollParent,l=(/(html|body)/i).test(a[0].tagName);if(this.cssPosition==='relative'&&!(this.scrollParent[0]!==document&&this.scrollParent[0]!==this.offsetParent[0])){this.offset.relative=this.re$()};if(this.originalPosition){if(this.containment){if(t.pageX- this.offset.click.left<this.containment[0]){o=this.containment[0]+ this.offset.click.left};if(t.pageY- this.offset.click.top<this.containment[1]){r=this.containment[1]+ this.offset.click.top};if(t.pageX- this.offset.click.left>this.containment[2]){o=this.containment[2]+ this.offset.click.left};if(t.pageY- this.offset.click.top>this.containment[3]){r=this.containment[3]+ this.offset.click.top}};if(i.grid){s=this.originalPageY+ Math.round((r- this.originalPageY)/ i.grid[1]) * i.grid[1];
  11. r=this.containment?((s- this.offset.click.top>=this.containment[1]&&s- this.offset.click.top<=this.containment[3])?s:((s- this.offset.click.top>=this.containment[1])?s- i.grid[1]:s+ i.grid[1])):s;n=this.originalPageX+ Math.round((o- this.originalPageX)/ i.grid[0]) * i.grid[0];
  12. o=this.containment?((n- this.offset.click.left>=this.containment[0]&&n- this.offset.click.left<=this.containment[2])?n:((n- this.offset.click.left>=this.containment[0])?n- i.grid[0]:n+ i.grid[0])):n}};return{top:(r- this.offset.click.top- this.offset.relative.top- this.offset.parent.top+((this.cssPosition==='fixed'?-this.scrollParent.scrollTop():(l?0:a.scrollTop())))),left:(o- this.offset.click.left- this.offset.relative.left- this.offset.parent.left+((this.cssPosition==='fixed'?-this.scrollParent.scrollLeft():l?0:a.scrollLeft())))}},Fe$:function(e,t,i,n){i?i[0].appendChild(this.placeholder[0]):t.item[0].parentNode.insertBefore(this.placeholder[0],(this.direction==='down'?t.item[0]:t.item[0].nextSibling));this.counter=this.counter?++this.counter:1;var s=this.counter;this.f$(function(){if(s===this.counter){this.refreshPositions(!n)}})},F$:function(e,t){this.reverting=!1;var i,n=[];if(!this.qe$&&this.currentItem.parent().length){this.placeholder.before(this.currentItem)};this.qe$=null;if(this.helper[0]===this.currentItem[0]){for(i in this.R$){if(this.R$[i]==='auto'||this.R$[i]==='static'){this.R$[i]=''}};this.currentItem.css(this.R$).removeClass('ui-sortable-helper')}else{this.currentItem.show()};if(this.fromOutside&&!t){n.push(function(e){this.t$('receive',e,this.n$(this.fromOutside))})};if((this.fromOutside||this.domPosition.prev!==this.currentItem.prev().not('.ui-sortable-helper')[0]||this.domPosition.parent!==this.currentItem.parent()[0])&&!t){n.push(function(e){this.t$('update',e,this.n$())})};if(this!==this.currentContainer){if(!t){n.push(function(e){this.t$('remove',e,this.n$())});n.push((function(e){return function(t){e.t$('receive',t,this.n$(this))}}).call(this,this.currentContainer));n.push((function(e){return function(t){e.t$('update',t,this.n$(this))}}).call(this,this.currentContainer))}};for(i=this.containers.length- 1;i>=0;i--){if(!t){n.push((function(e){return function(t){e.t$('deactivate',t,this.n$(this))}}).call(this,this.containers[i]))};if(this.containers[i].containerCache.over){n.push((function(e){return function(t){e.t$('out',t,this.n$(this))}}).call(this,this.containers[i]));this.containers[i].containerCache.over=0}};if(this.storedCursor){this.document.find('body').css('cursor',this.storedCursor);this.storedStylesheet.remove()};if(this.Ue$){this.helper.css('opacity',this.Ue$)};if(this.He$){this.helper.css('zIndex',this.He$==='auto'?'':this.He$)};this.dragging=!1;if(this.cancelHelperRemoval){if(!t){this.t$('beforeStop',e,this.n$());for(i=0;i<n.length;i++){n[i].call(this,e)};this.t$('stop',e,this.n$())};this.fromOutside=!1;return!1};if(!t){this.t$('beforeStop',e,this.n$())};this.placeholder[0].parentNode.removeChild(this.placeholder[0]);if(this.helper[0]!==this.currentItem[0]){this.helper.remove()};this.helper=null;if(!t){for(i=0;i<n.length;i++){n[i].call(this,e)};this.t$('stop',e,this.n$())};this.fromOutside=!1;return!0},t$:function(){if(e.Widget.prototype.t$.apply(this,arguments)===!1){this.cancel()}},n$:function(t){var i=t||this;return{helper:i.helper,placeholder:i.placeholder||e([]),position:i.position,originalPosition:i.originalPosition,offset:i.positionAbs,item:i.currentItem,sender:t?t.element:null}}})})(jQuery);(function(e,t){var i=0;e.widget('ui.autocomplete',{version:'1.10.3',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},pending:0,E$:function(){var t,n,i,r=this.element[0].nodeName.toLowerCase(),o=r==='textarea',s=r==='input';this.isMultiLine=o?!0:s?!1:this.element.prop('isContentEditable');this.valueMethod=this.element[o||s?'val':'text'];this.isNewMenu=!0;this.element.addClass('ui-autocomplete-input').attr('autocomplete','off');this.T$(this.element,{keydown:function(s){if(this.element.prop('readOnly')){t=!0;i=!0;n=!0;return};t=!1;i=!1;n=!1;var r=e.ui.keyCode;switch(s.keyCode){case r.PAGE_UP:t=!0;this.d$('previousPage',s);break;case r.PAGE_DOWN:t=!0;this.d$('nextPage',s);break;case r.UP:t=!0;this.P$('previous',s);break;case r.DOWN:t=!0;this.P$('next',s);break;case r.ENTER:case r.NUMPAD_ENTER:if(this.menu.active){t=!0;s.preventDefault();this.menu.select(s)};break;case r.TAB:if(this.menu.active){this.menu.select(s)};break;case r.ESCAPE:if(this.menu.element.is(':visible')){this.p$(this.term);this.close(s);s.preventDefault()};break;default:n=!0;this.Xe$(s);break}},keypress:function(i){if(t){t=!1;if(!this.isMultiLine||this.menu.element.is(':visible')){i.preventDefault()};return};if(n){return};var s=e.ui.keyCode;switch(i.keyCode){case s.PAGE_UP:this.d$('previousPage',i);break;case s.PAGE_DOWN:this.d$('nextPage',i);break;case s.UP:this.P$('previous',i);break;case s.DOWN:this.P$('next',i);break}},input:function(e){if(i){i=!1;e.preventDefault();return};this.Xe$(e)},focus:function(){this.selectedItem=null;this.previous=this.p$()},blur:function(e){if(this.cancelBlur){delete this.cancelBlur;return};clearTimeout(this.searching);this.close(e);this.h$(e)}});this.Re$();this.menu=e('<ul>').addClass('ui-autocomplete ui-front').appendTo(this.Be$()).menu({role:null}).hide().data('ui-menu');this.T$(this.menu.element,{mousedown:function(t){t.preventDefault();this.cancelBlur=!0;this.f$(function(){delete this.cancelBlur});var i=this.menu.element[0];if(!e(t.target).closest('.ui-menu-item').length){this.f$(function(){var t=this;this.document.one('mousedown',function(n){if(n.target!==t.element[0]&&n.target!==i&&!e.contains(i,n.target)){t.close()}})})}},menufocus:function(t,i){if(this.isNewMenu){this.isNewMenu=!1;if(t.originalEvent&&/^mouse/.test(t.originalEvent.type)){this.menu.blur();this.document.one('mousemove',function(){e(t.target).trigger(t.originalEvent)});return}};var n=i.item.data('ui-autocomplete-item');if(!1!==this.t$('focus',t,{item:n})){if(t.originalEvent&&/^key/.test(t.originalEvent.type)){this.p$(n.value)}}else{this.liveRegion.text(n.value)}},menuselect:function(e,t){var i=t.item.data('ui-autocomplete-item'),n=this.previous;if(this.element[0]!==this.document[0].activeElement){this.element.focus();this.previous=n;this.f$(function(){this.previous=n;this.selectedItem=i})};if(!1!==this.t$('select',e,{item:i})){this.p$(i.value)};this.term=this.p$();this.close(e);this.selectedItem=i}});this.liveRegion=e('<span>',{role:'status','aria-live':'polite'}).addClass('ui-helper-hidden-accessible').insertBefore(this.element);this.T$(this.window,{beforeunload:function(){this.element.removeAttr('autocomplete')}})},I$:function(){clearTimeout(this.searching);this.element.removeClass('ui-autocomplete-input').removeAttr('autocomplete');this.menu.element.remove();this.liveRegion.remove()},k$:function(e,t){this.ie$(e,t);if(e==='source'){this.Re$()};if(e==='appendTo'){this.menu.element.appendTo(this.Be$())};if(e==='disabled'&&t&&this.xhr){this.xhr.abort()}},Be$:function(){var t=this.options.appendTo;if(t){t=t.jquery||t.nodeType?e(t):this.document.find(t).eq(0)};if(!t){t=this.element.closest('.ui-front')};if(!t.length){t=this.document[0].body};return t},Re$:function(){var n,i,t=this;if(e.isArray(this.options.source)){n=this.options.source;this.source=function(t,i){i(e.ui.autocomplete.filter(n,t.term))}}else if(typeof this.options.source==='string'){i=this.options.source;this.source=function(n,s){if(t.xhr){t.xhr.abort()};t.xhr=e.ajax({url:i,data:n,dataType:'json',success:function(e){s(e)},error:function(){s([])}})}}else{this.source=this.options.source}},Xe$:function(e){clearTimeout(this.searching);this.searching=this.f$(function(){if(this.term!==this.p$()){this.selectedItem=null;this.search(null,e)}},this.options.delay)},search:function(e,t){e=e!=null?e:this.p$();this.term=this.p$();if(e.length<this.options.minLength){return this.close(t)};if(this.t$('search',t)===!1){return};return this.fi$(e)},fi$:function(e){this.pending++;this.element.addClass('ui-autocomplete-loading');this.cancelSearch=!1;this.source({term:e},this.hi$())},hi$:function(){var e=this,t=++i;return function(n){if(t===i){e.__response(n)};e.pending--;if(!e.pending){e.element.removeClass('ui-autocomplete-loading')}}},__response:function(e){if(e){e=this.pi$(e)};this.t$('response',null,{content:e});if(!this.options.disabled&&e&&e.length&&!this.cancelSearch){this.di$(e);this.t$('open')}else{this.A$()}},close:function(e){this.cancelSearch=!0;this.A$(e)},A$:function(e){if(this.menu.element.is(':visible')){this.menu.element.hide();this.menu.blur();this.isNewMenu=!0;this.t$('close',e)}},h$:function(e){if(this.previous!==this.p$()){this.t$('change',e,{item:this.selectedItem})}},pi$:function(t){if(t.length&&t[0].label&&t[0].value){return t};return e.map(t,function(t){if(typeof t==='string'){return{label:t,value:t}};return e.extend({label:t.label||t.value,value:t.value||t.label},t)})},di$:function(t){var i=this.menu.element.empty();this.gi$(i,t);this.isNewMenu=!0;this.menu.refresh();i.show();this.mi$();i.position(e.extend({of:this.element},this.options.position));if(this.options.autoFocus){this.menu.next()}},mi$:function(){var e=this.menu.element;e.outerWidth(Math.max(e.width('').outerWidth()+ 1,this.element.outerWidth()))},gi$:function(t,i){var n=this;e.each(i,function(e,i){n.bi$(t,i)})},bi$:function(e,t){return this.vi$(e,t).data('ui-autocomplete-item',t)},vi$:function(t,i){return e('<li>').append(e('<a>').text(i.label)).appendTo(t)},d$:function(e,t){if(!this.menu.element.is(':visible')){this.search(null,t);return};if(this.menu.isFirstItem()&&/^previous/.test(e)||this.menu.isLastItem()&&/^next/.test(e)){this.p$(this.term);this.menu.blur();return};this.menu[e](t)},widget:function(){return this.menu.element},p$:function(){return this.valueMethod.apply(this.element,arguments)},P$:function(e,t){if(!this.isMultiLine||this.menu.element.is(':visible')){this.d$(e,t);t.preventDefault()}}});e.extend(e.ui.autocomplete,{escapeRegex:function(e){return e.replace(/[\-\[\]{}()*+?.,\\\^$|#\s]/g,'\\$&')},filter:function(t,i){var n=new RegExp(e.ui.autocomplete.escapeRegex(i),'i');return e.grep(t,function(e){return n.test(e.label||e.value||e)})}});e.widget('ui.autocomplete',e.ui.autocomplete,{options:{messages:{noResults:'No search results.',results:function(e){return e+(e>1?' results are':' result is')+' available, use up and down arrow keys to navigate.'}}},__response:function(e){var t;this.xe$(arguments);if(this.options.disabled||this.cancelSearch){return};if(e&&e.length){t=this.options.messages.results(e.length)}else{t=this.options.messages.noResults};this.liveRegion.text(t)}})}(jQuery));(function(e,t){e.extend(e.ui,{datepicker:{version:'1.10.3'}});var i='datepicker',s;function r(){this.v$=null;this.P$=!1;this.S$=[];this.w$=!1;this.B$=!1;this.ue$='ui-datepicker-div';this.Ie$='ui-datepicker-inline';this.Nt$='ui-datepicker-append';this.Me$='ui-datepicker-trigger';this.yt$='ui-datepicker-dialog';this.Yi$='ui-datepicker-disabled';this.bt$='ui-datepicker-unselectable';this.mt$='ui-datepicker-current-day';this.ze$='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.l$={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};e.extend(this.l$,this.regional['']);this.dpDiv=o(e('<div id=\''+ this.ue$+'\' class=\'ui-datepicker ui-widget ui-widget-content ui-helper-clearfix ui-corner-all\'></div>'))};e.extend(r.prototype,{markerClassName:'hasDatepicker',maxRows:4,Pi$:function(){return this.dpDiv},setDefaults:function(e){n(this.l$,e||{});return this},It$:function(t,i){var s,r,n;s=t.nodeName.toLowerCase();r=(s==='div'||s==='span');if(!t.id){this.uuid+=1;t.id='dp'+ this.uuid};n=this.st$(e(t),r);n.settings=e.extend({},i||{});if(s==='input'){this.Mt$(t,n)}else if(r){this.Lt$(t,n)}},st$:function(t,i){var n=t[0].id.replace(/([^A-Za-z0-9_\-])/g,'\\\\$1');return{id:n,input:t,selectedDay:0,selectedMonth:0,selectedYear:0,drawMonth:0,drawYear:0,inline:i,dpDiv:(!i?this.dpDiv:o(e('<div class=\''+ this.Ie$+' ui-datepicker ui-widget ui-widget-content ui-helper-clearfix ui-corner-all\'></div>')))}},Mt$:function(t,n){var s=e(t);n.append=e([]);n.trigger=e([]);if(s.hasClass(this.markerClassName)){return};this.it$(s,n);s.addClass(this.markerClassName).keydown(this.Ee$).keypress(this.Je$).keyup(this.Qe$);this.tt$(n);e.data(t,i,n);if(n.settings.disabled){this.Ae$(t)}},it$:function(t,i){var s,n,r,a=this.e$(i,'appendText'),o=this.e$(i,'isRTL');if(i.append){i.append.remove()};if(a){i.append=e('<span class=\''+ this.Nt$+'\'>'+ a+'</span>');t[o?'before':'after'](i.append)};t.unbind('focus',this.H$);if(i.trigger){i.trigger.remove()};s=this.e$(i,'showOn');if(s==='focus'||s==='both'){t.focus(this.H$)};if(s==='button'||s==='both'){n=this.e$(i,'buttonText');r=this.e$(i,'buttonImage');i.trigger=e(this.e$(i,'buttonImageOnly')?e('<img/>').addClass(this.Me$).attr({src:r,alt:n,title:n}):e('<button type=\'button\'></button>').addClass(this.Me$).html(!r?n:e('<img/>').attr({src:r,alt:n,title:n})));t[o?'before':'after'](i.trigger);i.trigger.click(function(){if(e.datepicker.w$&&e.datepicker.Y$===t[0]){e.datepicker.m$()}else if(e.datepicker.w$&&e.datepicker.Y$!==t[0]){e.datepicker.m$();e.datepicker.H$(t[0])}else{e.datepicker.H$(t[0])};return!1})}},tt$:function(e){if(this.e$(e,'autoSize')&&!e.inline){var r,o,s,t,i=new Date(2009,12- 1,20),n=this.e$(e,'dateFormat');if(n.match(/[DM]/)){r=function(e){o=0;s=0;for(t=0;t<e.length;t++){if(e[t].length>o){o=e[t].length;s=t}};return s};i.setMonth(r(this.e$(e,(n.match(/MM/)?'monthNames':'monthNamesShort'))));i.setDate(r(this.e$(e,(n.match(/DD/)?'dayNames':'dayNamesShort')))+ 20- i.getDay())};e.input.attr('size',this.D$(e,i).length)}},Lt$:function(t,n){var s=e(t);if(s.hasClass(this.markerClassName)){return};s.addClass(this.markerClassName).append(n.dpDiv);e.data(t,i,n);this.ke$(n,this.je$(n),!0);this.L$(n);this.Q$(n);if(n.settings.disabled){this.Ae$(t)};n.dpDiv.css('display','block')},Ii$:function(t,s,r,o,a){var f,h,d,u,c,l=this.Jt$;if(!l){this.uuid+=1;f='dp'+ this.uuid;this.b$=e('<input type=\'text\' id=\''+ f+'\' style=\'position: absolute; top: -100px; width: 0px;\'/>');this.b$.keydown(this.Ee$);e('body').append(this.b$);l=this.Jt$=this.st$(this.b$,!1);l.settings={};e.data(this.b$[0],i,l)};n(l.settings,o||{});s=(s&&s.constructor===Date?this.D$(l,s):s);this.b$.val(s);this.g$=(a?(a.length?a:[a.pageX,a.pageY]):null);if(!this.g$){h=document.documentElement.clientWidth;d=document.documentElement.clientHeight;u=document.documentElement.scrollLeft||document.body.scrollLeft;c=document.documentElement.scrollTop||document.body.scrollTop;this.g$=[(h/2)- 100+ u,(d/2)- 150+ c]};this.b$.css('left',(this.g$[0]+ 20)+'px').css('top',this.g$[1]+'px');l.settings.onSelect=r;this.B$=!0;this.dpDiv.addClass(this.yt$);this.H$(this.b$[0]);if(e.blockUI){e.blockUI(this.dpDiv)};e.data(this.b$[0],i,l);return this},Mi$:function(t){var n,s=e(t),r=e.data(t,i);if(!s.hasClass(this.markerClassName)){return};n=t.nodeName.toLowerCase();e.removeData(t,i);if(n==='input'){r.append.remove();r.trigger.remove();s.removeClass(this.markerClassName).unbind('focus',this.H$).unbind('keydown',this.Ee$).unbind('keypress',this.Je$).unbind('keyup',this.Qe$)}else if(n==='div'||n==='span'){s.removeClass(this.markerClassName).empty()}},Ft$:function(t){var n,s,r=e(t),o=e.data(t,i);if(!r.hasClass(this.markerClassName)){return};n=t.nodeName.toLowerCase();if(n==='input'){t.disabled=!1;o.trigger.filter('button').each(function(){this.disabled=!1}).end().filter('img').css({opacity:'1.0',cursor:''})}else if(n==='div'||n==='span'){s=r.children('.'+ this.Ie$);s.children().removeClass('ui-state-disabled');s.find('select.ui-datepicker-month, select.ui-datepicker-year').prop('disabled',!1)};this.S$=e.map(this.S$,function(e){return(e===t?null:e)})},Ae$:function(t){var n,s,r=e(t),o=e.data(t,i);if(!r.hasClass(this.markerClassName)){return};n=t.nodeName.toLowerCase();if(n==='input'){t.disabled=!0;o.trigger.filter('button').each(function(){this.disabled=!0}).end().filter('img').css({opacity:'0.5',cursor:'default'})}else if(n==='div'||n==='span'){s=r.children('.'+ this.Ie$);s.children().addClass('ui-state-disabled');s.find('select.ui-datepicker-month, select.ui-datepicker-year').prop('disabled',!0)};this.S$=e.map(this.S$,function(e){return(e===t?null:e)});this.S$[this.S$.length]=t},fe$:function(e){if(!e){return!1};for(var t=0;t<this.S$.length;t++){if(this.S$[t]===e){return!0}};return!1},a$:function(t){try{return e.data(t,i)}catch(n){throw'Missing instance data for this datepicker';}},zt$:function(i,s,r){var a,u,l,c,o=this.a$(i);if(arguments.length===2&&typeof s==='string'){return(s==='defaults'?e.extend({},e.datepicker.l$):(o?(s==='all'?e.extend({},o.settings):this.e$(o,s)):null))};a=s||{};if(typeof s==='string'){a={};a[s]=r};if(o){if(this.v$===o){this.m$()};u=this.Ot$(i,!0);l=this.M$(o,'min');c=this.M$(o,'max');n(o.settings,a);if(l!==null&&a.dateFormat!==t&&a.minDate===t){o.settings.minDate=this.D$(o,l)};if(c!==null&&a.dateFormat!==t&&a.maxDate===t){o.settings.maxDate=this.D$(o,c)};if('disabled'in a){if(a.disabled){this.Ae$(i)}else{this.Ft$(i)}};this.it$(e(i),o);this.tt$(o);this.ke$(o,u);this.Q$(o);this.L$(o)}},Oi$:function(e,t,i){this.zt$(e,t,i)},zi$:function(e){var t=this.a$(e);if(t){this.L$(t)}},Li$:function(e,t){var i=this.a$(e);if(i){this.ke$(i,t);this.L$(i);this.Q$(i)}},Ot$:function(e,t){var i=this.a$(e);if(i&&!i.inline){this.Ne$(i,t)};return(i?this.Te$(i):null)},Ee$:function(t){var r,a,s,i=e.datepicker.a$(t.target),n=!0,o=i.dpDiv.is('.ui-datepicker-rtl');i.P$=!0;if(e.datepicker.w$){switch(t.keyCode){case 9:e.datepicker.m$();n=!1;break;case 13:s=e('td.'+ e.datepicker.ze$+':not(.'+ e.datepicker.mt$+')',i.dpDiv);if(s[0]){e.datepicker.Ze$(t.target,i.selectedMonth,i.selectedYear,s[0])};r=e.datepicker.e$(i,'onSelect');if(r){a=e.datepicker.D$(i);r.apply((i.input?i.input[0]:null),[a,i])}else{e.datepicker.m$()};return!1;case 27:e.datepicker.m$();break;case 33:e.datepicker.u$(t.target,(t.ctrlKey?-e.datepicker.e$(i,'stepBigMonths'):-e.datepicker.e$(i,'stepMonths')),'M');break;case 34:e.datepicker.u$(t.target,(t.ctrlKey?+e.datepicker.e$(i,'stepBigMonths'):+e.datepicker.e$(i,'stepMonths')),'M');break;case 35:if(t.ctrlKey||t.metaKey){e.datepicker.qt$(t.target)};n=t.ctrlKey||t.metaKey;break;case 36:if(t.ctrlKey||t.metaKey){e.datepicker.Ve$(t.target)};n=t.ctrlKey||t.metaKey;break;case 37:if(t.ctrlKey||t.metaKey){e.datepicker.u$(t.target,(o?+1:-1),'D')};n=t.ctrlKey||t.metaKey;if(t.originalEvent.altKey){e.datepicker.u$(t.target,(t.ctrlKey?-e.datepicker.e$(i,'stepBigMonths'):-e.datepicker.e$(i,'stepMonths')),'M')};break;case 38:if(t.ctrlKey||t.metaKey){e.datepicker.u$(t.target,-7,'D')};n=t.ctrlKey||t.metaKey;break;case 39:if(t.ctrlKey||t.metaKey){e.datepicker.u$(t.target,(o?-1:+1),'D')};n=t.ctrlKey||t.metaKey;if(t.originalEvent.altKey){e.datepicker.u$(t.target,(t.ctrlKey?+e.datepicker.e$(i,'stepBigMonths'):+e.datepicker.e$(i,'stepMonths')),'M')};break;case 40:if(t.ctrlKey||t.metaKey){e.datepicker.u$(t.target,+7,'D')};n=t.ctrlKey||t.metaKey;break;default:n=!1}}else if(t.keyCode===36&&t.ctrlKey){e.datepicker.H$(this)}else{n=!1};if(n){t.preventDefault();t.stopPropagation()}},Je$:function(t){var n,i,s=e.datepicker.a$(t.target);if(e.datepicker.e$(s,'constrainInput')){n=e.datepicker.Yt$(e.datepicker.e$(s,'dateFormat'));i=String.fromCharCode(t.charCode==null?t.keyCode:t.charCode);return t.ctrlKey||t.metaKey||(i<' '||!n||n.indexOf(i)>-1)}},Qe$:function(t){var s,n=e.datepicker.a$(t.target);if(n.input.val()!==n.lastVal){try{s=e.datepicker.parseDate(e.datepicker.e$(n,'dateFormat'),(n.input?n.input.val():null),e.datepicker.j$(n));if(s){e.datepicker.Ne$(n);e.datepicker.Q$(n);e.datepicker.L$(n)}}catch(i){}};return!0},H$:function(t){t=t.target||t;if(t.nodeName.toLowerCase()!=='input'){t=e('input',t.parentNode)[0]};if(e.datepicker.fe$(t)||e.datepicker.Y$===t){return};var i,c,l,s,o,r,a;i=e.datepicker.a$(t);if(e.datepicker.v$&&e.datepicker.v$!==i){e.datepicker.v$.dpDiv.stop(!0,!0);if(i&&e.datepicker.w$){e.datepicker.m$(e.datepicker.v$.input[0])}};c=e.datepicker.e$(i,'beforeShow');l=c?c.apply(t,[t,i]):{};if(l===!1){return};n(i.settings,l);i.lastVal=null;e.datepicker.Y$=t;e.datepicker.Ne$(i);if(e.datepicker.B$){t.value=''};if(!e.datepicker.g$){e.datepicker.g$=e.datepicker.Ht$(t);e.datepicker.g$[1]+=t.offsetHeight};s=!1;e(t).parents().each(function(){s|=e(this).css('position')==='fixed';return!s});o={left:e.datepicker.g$[0],top:e.datepicker.g$[1]};e.datepicker.g$=null;i.dpDiv.empty();i.dpDiv.css({position:'absolute',display:'block',top:'-1000px'});e.datepicker.L$(i);o=e.datepicker.Rt$(i,o,s);i.dpDiv.css({position:(e.datepicker.B$&&e.blockUI?'static':(s?'fixed':'absolute')),display:'none',left:o.left+'px',top:o.top+'px'});if(!i.inline){r=e.datepicker.e$(i,'showAnim');a=e.datepicker.e$(i,'duration');i.dpDiv.zIndex(e(t).zIndex()+ 1);e.datepicker.w$=!0;if(e.effects&&e.effects.effect[r]){i.dpDiv.show(r,e.datepicker.e$(i,'showOptions'),a)}else{i.dpDiv[r||'show'](r?a:null)};if(e.datepicker.Ke$(i)){i.input.focus()};e.datepicker.v$=i}},L$:function(t){this.maxRows=4;s=t;t.dpDiv.empty().append(this.Pt$(t));this.jt$(t);t.dpDiv.find('.'+ this.ze$+' a').mouseover();var r,n=this.De$(t),i=n[1],o=17;t.dpDiv.removeClass('ui-datepicker-multi-2 ui-datepicker-multi-3 ui-datepicker-multi-4').width('');if(i>1){t.dpDiv.addClass('ui-datepicker-multi-'+ i).css('width',(o*i)+'em')};t.dpDiv[(n[0]!==1||n[1]!==1?'add':'remove')+'Class']('ui-datepicker-multi');t.dpDiv[(this.e$(t,'isRTL')?'add':'remove')+'Class']('ui-datepicker-rtl');if(t===e.datepicker.v$&&e.datepicker.w$&&e.datepicker.Ke$(t)){t.input.focus()};if(t.yearshtml){r=t.yearshtml;setTimeout(function(){if(r===t.yearshtml&&t.yearshtml){t.dpDiv.find('select.ui-datepicker-year:first').replaceWith(t.yearshtml)};r=t.yearshtml=null},0)}},Ke$:function(e){return e.input&&e.input.is(':visible')&&!e.input.is(':disabled')&&!e.input.is(':focus')},Rt$:function(t,i,n){var s=t.dpDiv.outerWidth(),o=t.dpDiv.outerHeight(),c=t.input?t.input.outerWidth():0,a=t.input?t.input.outerHeight():0,r=document.documentElement.clientWidth+(n?0:e(document).scrollLeft()),l=document.documentElement.clientHeight+(n?0:e(document).scrollTop());i.left-=(this.e$(t,'isRTL')?(s- c):0);i.left-=(n&&i.left===t.input.offset().left)?e(document).scrollLeft():0;i.top-=(n&&i.top===(t.input.offset().top+ a))?e(document).scrollTop():0;i.left-=Math.min(i.left,(i.left+ s>r&&r>s)?Math.abs(i.left+ s- r):0);i.top-=Math.min(i.top,(i.top+ o>l&&l>o)?Math.abs(o+ a):0);return i},Ht$:function(t){var i,s=this.a$(t),n=this.e$(s,'isRTL');while(t&&(t.type==='hidden'||t.nodeType!==1||e.expr.filters.hidden(t))){t=t[n?'previousSibling':'nextSibling']};i=e(t).offset();return[i.left,i.top]},m$:function(t){var s,o,r,a,n=this.v$;if(!n||(t&&n!==e.data(t,i))){return};if(this.w$){s=this.e$(n,'showAnim');o=this.e$(n,'duration');r=function(){e.datepicker.Wt$(n)};if(e.effects&&(e.effects.effect[s]||e.effects[s])){n.dpDiv.hide(s,e.datepicker.e$(n,'showOptions'),o,r)}else{n.dpDiv[(s==='slideDown'?'slideUp':(s==='fadeIn'?'fadeOut':'hide'))]((s?o:null),r)};if(!s){r()};this.w$=!1;a=this.e$(n,'onClose');if(a){a.apply((n.input?n.input[0]:null),[(n.input?n.input.val():''),n])};this.Y$=null;if(this.B$){this.b$.css({position:'absolute',left:'0',top:'-100px'});if(e.blockUI){e.unblockUI();e('body').append(this.dpDiv)}};this.B$=!1}},Wt$:function(e){e.dpDiv.removeClass(this.yt$).unbind('.ui-datepicker-calendar')},Bt$:function(t){if(!e.datepicker.v$){return};var i=e(t.target),n=e.datepicker.a$(i[0]);if(((i[0].id!==e.datepicker.ue$&&i.parents('#'+ e.datepicker.ue$).length===0&&!i.hasClass(e.datepicker.markerClassName)&&!i.closest('.'+ e.datepicker.Me$).length&&e.datepicker.w$&&!(e.datepicker.B$&&e.blockUI)))||(i.hasClass(e.datepicker.markerClassName)&&e.datepicker.v$!==n)){e.datepicker.m$()}},u$:function(t,i,n){var r=e(t),s=this.a$(r[0]);if(this.fe$(r[0])){return};this.Se$(s,i+(n==='M'?this.e$(s,'showCurrentAtPos'):0),n);this.L$(s)},Ve$:function(t){var n,s=e(t),i=this.a$(s[0]);if(this.e$(i,'gotoCurrent')&&i.currentDay){i.selectedDay=i.currentDay;i.drawMonth=i.selectedMonth=i.currentMonth;i.drawYear=i.selectedYear=i.currentYear}else{n=new Date();i.selectedDay=n.getDate();i.drawMonth=i.selectedMonth=n.getMonth();i.drawYear=i.selectedYear=n.getFullYear()};this.ce$(i);this.u$(s)},et$:function(t,i,n){var r=e(t),s=this.a$(r[0]);s['selected'+(n==='M'?'Month':'Year')]=s['draw'+(n==='M'?'Month':'Year')]=parseInt(i.options[i.selectedIndex].value,10);this.ce$(s);this.u$(r)},Ze$:function(t,i,n,s){var r,o=e(t);if(e(s).hasClass(this.bt$)||this.fe$(o[0])){return};r=this.a$(o[0]);r.selectedDay=r.currentDay=e('a',s).html();r.selectedMonth=r.currentMonth=i;r.selectedYear=r.currentYear=n;this.Ge$(t,this.D$(r,r.currentDay,r.currentMonth,r.currentYear))},qt$:function(t){var i=e(t);this.Ge$(i,'')},Ge$:function(t,i){var s,r=e(t),n=this.a$(r[0]);i=(i!=null?i:this.D$(n));if(n.input){n.input.val(i)};this.Q$(n);s=this.e$(n,'onSelect');if(s){s.apply((n.input?n.input[0]:null),[i,n])}else if(n.input){n.input.trigger('change')};if(n.inline){this.L$(n)}else{this.m$();this.Y$=n.input[0];if(typeof(n.input[0])!=='object'){n.input.focus()};this.Y$=null}},Q$:function(t){var r,s,n,i=this.e$(t,'altField');if(i){r=this.e$(t,'altFormat')||this.e$(t,'dateFormat');s=this.Te$(t);n=this.formatDate(r,s,this.j$(t));e(i).each(function(){e(this).val(n)})}},noWeekends:function(e){var t=e.getDay();return[(t>0&&t<6),'']},iso8601Week:function(e){var i,t=new Date(e.getTime());t.setDate(t.getDate()+ 4-(t.getDay()||7));i=t.getTime();t.setMonth(0);t.setDate(1);return Math.floor(Math.round((i- t)/ 86400000) / 7) + 1
  13. },parseDate:function(t,i,n){if(t==null||i==null){throw'Invalid arguments';};i=(typeof i==='object'?i.toString():i+'');if(i===''){return null};var a,m,g,o=0,v=(n?n.shortYearCutoff:null)||this.l$.shortYearCutoff,w=(typeof v!=='string'?v:new Date().getFullYear()%100+ parseInt(v,10)),x=(n?n.dayNamesShort:null)||this.l$.dayNamesShort,k=(n?n.dayNames:null)||this.l$.dayNames,y=(n?n.monthNamesShort:null)||this.l$.monthNamesShort,C=(n?n.monthNames:null)||this.l$.monthNames,r=-1,l=-1,c=-1,h=-1,d=!1,s,f=function(e){var i=(a+ 1<t.length&&t.charAt(a+ 1)===e);if(i){a++};return i},u=function(e){var r=f(e),s=(e==='@'?14:(e==='!'?20:(e==='y'&&r?4:(e==='o'?3:2)))),n=new RegExp('^\\d{1,'+ s+'}'),t=i.substring(o).match(n);if(!t){throw'Missing number at position '+ o;};o+=t[0].length;return parseInt(t[0],10)},b=function(t,n,s){var r=-1,a=e.map(f(t)?s:n,function(e,t){return[[t,e]]}).sort(function(e,t){return-(e[1].length- t[1].length)});e.each(a,function(e,t){var n=t[1];if(i.substr(o,n.length).toLowerCase()===n.toLowerCase()){r=t[0];o+=n.length;return!1}});if(r!==-1){return r+ 1}else{throw'Unknown name at position '+ o;}},p=function(){if(i.charAt(o)!==t.charAt(a)){throw'Unexpected literal at position '+ o;};o++};for(a=0;a<t.length;a++){if(d){if(t.charAt(a)==='\''&&!f('\'')){d=!1}else{p()}}else{switch(t.charAt(a)){case'd':c=u('d');break;case'D':b('D',x,k);break;case'o':h=u('o');break;case'm':l=u('m');break;case'M':l=b('M',y,C);break;case'y':r=u('y');break;case'@':s=new Date(u('@'));r=s.getFullYear();l=s.getMonth()+ 1;c=s.getDate();break;case'!':s=new Date((u('!')- this.kt$)/ 10000);
  14. r=s.getFullYear();l=s.getMonth()+ 1;c=s.getDate();break;case'\'':if(f('\'')){p()}else{d=!0};break;default:p()}}};if(o<i.length){g=i.substr(o);if(!/^\s+/.test(g)){throw'Extra/unparsed characters found in date: '+ g;}};if(r===-1){r=new Date().getFullYear()}else if(r<100){r+=new Date().getFullYear()- new Date().getFullYear()%100+(r<=w?0:-100)};if(h>-1){l=1;c=h;do{m=this.q$(r,l- 1);if(c<=m){break};l++;c-=m}while(!0);};s=this.r$(new Date(r,l- 1,c));if(s.getFullYear()!==r||s.getMonth()+ 1!==l||s.getDate()!==c){throw'Invalid date';};return s},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',kt$:(((1970- 1)*365+ Math.floor(1970/4)- Math.floor(1970/100)+ Math.floor(1970/400))*24*60*60*10000000),formatDate:function(e,t,i){if(!t){return''};var s,u=(i?i.dayNamesShort:null)||this.l$.dayNamesShort,f=(i?i.dayNames:null)||this.l$.dayNames,c=(i?i.monthNamesShort:null)||this.l$.monthNamesShort,h=(i?i.monthNames:null)||this.l$.monthNames,r=function(t){var i=(s+ 1<e.length&&e.charAt(s+ 1)===t);if(i){s++};return i},a=function(e,t,i){var n=''+ t;if(r(e)){while(n.length<i){n='0'+ n}};return n},l=function(e,t,i,n){return(r(e)?n[t]:i[t])},n='',o=!1;if(t){for(s=0;s<e.length;s++){if(o){if(e.charAt(s)==='\''&&!r('\'')){o=!1}else{n+=e.charAt(s)}}else{switch(e.charAt(s)){case'd':n+=a('d',t.getDate(),2);break;case'D':n+=l('D',t.getDay(),u,f);break;case'o':n+=a('o',Math.round((new Date(t.getFullYear(),t.getMonth(),t.getDate()).getTime()- new Date(t.getFullYear(),0,0).getTime())/ 86400000), 3);
  15. break;case'm':n+=a('m',t.getMonth()+ 1,2);break;case'M':n+=l('M',t.getMonth(),c,h);break;case'y':n+=(r('y')?t.getFullYear():(t.getYear()%100<10?'0':'')+ t.getYear()%100);break;case'@':n+=t.getTime();break;case'!':n+=t.getTime()*10000+ this.kt$;break;case'\'':if(r('\'')){n+='\''}else{o=!0};break;default:n+=e.charAt(s)}}}};return n},Yt$:function(e){var t,i='',n=!1,s=function(i){var n=(t+ 1<e.length&&e.charAt(t+ 1)===i);if(n){t++};return n};for(t=0;t<e.length;t++){if(n){if(e.charAt(t)==='\''&&!s('\'')){n=!1}else{i+=e.charAt(t)}}else{switch(e.charAt(t)){case'd':case'm':case'y':case'@':i+='0123456789';break;case'D':case'M':return null;case'\'':if(s('\'')){i+='\''}else{n=!0};break;default:i+=e.charAt(t)}}};return i},e$:function(e,i){return e.settings[i]!==t?e.settings[i]:this.l$[i]},Ne$:function(e,t){if(e.input.val()===e.lastVal){return};var o=this.e$(e,'dateFormat'),s=e.lastVal=e.input?e.input.val():null,r=this.je$(e),n=r,a=this.j$(e);try{n=this.parseDate(o,s,a)||r}catch(i){s=(t?'':s)};e.selectedDay=n.getDate();e.drawMonth=e.selectedMonth=n.getMonth();e.drawYear=e.selectedYear=n.getFullYear();e.currentDay=(s?n.getDate():0);e.currentMonth=(s?n.getMonth():0);e.currentYear=(s?n.getFullYear():0);this.Se$(e)},je$:function(e){return this.Pe$(e,this.Ce$(e,this.e$(e,'defaultDate'),new Date()))},Ce$:function(t,i,n){var o=function(e){var t=new Date();t.setDate(t.getDate()+ e);return t},r=function(i){try{return e.datepicker.parseDate(e.datepicker.e$(t,'dateFormat'),i,e.datepicker.j$(t))}catch(n){};var l=(i.toLowerCase().match(/^c/)?e.datepicker.Te$(t):null)||new Date(),a=l.getFullYear(),o=l.getMonth(),s=l.getDate(),c=/([+\-]?[0-9]+)\s*(d|D|w|W|m|M|y|Y)?/g,r=c.exec(i);while(r){switch(r[2]||'d'){case'd':case'D':s+=parseInt(r[1],10);break;case'w':case'W':s+=parseInt(r[1],10)*7;break;case'm':case'M':o+=parseInt(r[1],10);s=Math.min(s,e.datepicker.q$(a,o));break;case'y':case'Y':a+=parseInt(r[1],10);s=Math.min(s,e.datepicker.q$(a,o));break};r=c.exec(i)};return new Date(a,o,s)},s=(i==null||i===''?n:(typeof i==='string'?r(i):(typeof i==='number'?(isNaN(i)?n:o(i)):new Date(i.getTime()))));s=(s&&s.toString()==='Invalid Date'?n:s);if(s){s.setHours(0);s.setMinutes(0);s.setSeconds(0);s.setMilliseconds(0)};return this.r$(s)},r$:function(e){if(!e){return null};e.setHours(e.getHours()>12?e.getHours()+ 2:0);return e},ke$:function(e,t,i){var r=!t,o=e.selectedMonth,s=e.selectedYear,n=this.Pe$(e,this.Ce$(e,t,new Date()));e.selectedDay=e.currentDay=n.getDate();e.drawMonth=e.selectedMonth=e.currentMonth=n.getMonth();e.drawYear=e.selectedYear=e.currentYear=n.getFullYear();if((o!==e.selectedMonth||s!==e.selectedYear)&&!i){this.ce$(e)};this.Se$(e);if(e.input){e.input.val(r?'':this.D$(e))}},Te$:function(e){var t=(!e.currentYear||(e.input&&e.input.val()==='')?null:this.r$(new Date(e.currentYear,e.currentMonth,e.currentDay)));return t},jt$:function(t){var n=this.e$(t,'stepMonths'),
  16.                 i = '#' + t.id.replace(/\\\\/g, '\\');
  17.             t.dpDiv.find('[data-handler]').map(function() {
  18.                 var t = {
  19.                     prev: function() {
  20.                         e.datepicker.u$(i, -n, 'M')
  21.                     },
  22.                     next: function() {
  23.                         e.datepicker.u$(i, +n, 'M')
  24.                     },
  25.                     hide: function() {
  26.                         e.datepicker.m$()
  27.                     },
  28.                     today: function() {
  29.                         e.datepicker.Ve$(i)
  30.                     },
  31.                     selectDay: function() {
  32.                         e.datepicker.Ze$(i, +this.getAttribute('data-month'), +this.getAttribute('data-year'), this);
  33.                         return !1
  34.                     },
  35.                     selectMonth: function() {
  36.                         e.datepicker.et$(i, this, 'M');
  37.                         return !1
  38.                     },
  39.                     selectYear: function() {
  40.                         e.datepicker.et$(i, this, 'Y');
  41.                         return !1
  42.                     }
  43.                 };
  44.                 e(this).bind(this.getAttribute('data-event'), t[this.getAttribute('data-handler')])
  45.             })
  46.         },
  47.         Pt$: function(e) {
  48.             var b, l, S, u, B, y, W, z, Q, c, F, X, J, Z, G, L, x, V, H, C, r, p, Y, m, U, h, s, q, M, R, O, k, E, i, T, D, v, f, w, I = new Date(),
  49.                 P = this.r$(new Date(I.getFullYear(), I.getMonth(), I.getDate())),
  50.                 o = this.e$(e, 'isRTL'),
  51.                 ie = this.e$(e, 'showButtonPanel'),
  52.                 K = this.e$(e, 'hideIfNoPrevNext'),
  53.                 A = this.e$(e, 'navigationAsDateFormat'),
  54.                 a = this.De$(e),
  55.                 te = this.e$(e, 'showCurrentAtPos'),
  56.                 ee = this.e$(e, 'stepMonths'),
  57.                 N = (a[0] !== 1 || a[1] !== 1),
  58.                 j = this.r$((!e.currentDay ? new Date(9999, 9, 9) : new Date(e.currentYear, e.currentMonth, e.currentDay))),
  59.                 g = this.M$(e, 'min'),
  60.                 d = this.M$(e, 'max'),
  61.                 t = e.drawMonth - te,
  62.                 n = e.drawYear;
  63.             if (t < 0) {
  64.                 t += 12;
  65.                 n--
  66.             };
  67.             if (d) {
  68.                 b = this.r$(new Date(d.getFullYear(), d.getMonth() - (a[0] * a[1]) + 1, d.getDate()));
  69.                 b = (g && b < g ? g : b);
  70.                 while (this.r$(new Date(n, t, 1)) > b) {
  71.                     t--;
  72.                     if (t < 0) {
  73.                         t = 11;
  74.                         n--
  75.                     }
  76.                 }
  77.             };
  78.             e.drawMonth = t;
  79.             e.drawYear = n;
  80.             l = this.e$(e, 'prevText');
  81.             l = (!A ? l : this.formatDate(l, this.r$(new Date(n, t - ee, 1)), this.j$(e)));
  82.             S = (this.gt$(e, -1, n, t) ? '<a class=\'ui-datepicker-prev ui-corner-all\' data-handler=\'prev\' data-event=\'click\' title=\'' + l + '\'><span class=\'ui-icon ui-icon-circle-triangle-' + (o ? 'e' : 'w') + '\'>' + l + '</span></a>' : (K ? '' : '<a class=\'ui-datepicker-prev ui-corner-all ui-state-disabled\' title=\'' + l + '\'><span class=\'ui-icon ui-icon-circle-triangle-' + (o ? 'e' : 'w') + '\'>' + l + '</span></a>'));
  83.             u = this.e$(e, 'nextText');
  84.             u = (!A ? u : this.formatDate(u, this.r$(new Date(n, t + ee, 1)), this.j$(e)));
  85.             B = (this.gt$(e, +1, n, t) ? '<a class=\'ui-datepicker-next ui-corner-all\' data-handler=\'next\' data-event=\'click\' title=\'' + u + '\'><span class=\'ui-icon ui-icon-circle-triangle-' + (o ? 'w' : 'e') + '\'>' + u + '</span></a>' : (K ? '' : '<a class=\'ui-datepicker-next ui-corner-all ui-state-disabled\' title=\'' + u + '\'><span class=\'ui-icon ui-icon-circle-triangle-' + (o ? 'w' : 'e') + '\'>' + u + '</span></a>'));
  86.             y = this.e$(e, 'currentText');
  87.             W = (this.e$(e, 'gotoCurrent') && e.currentDay ? j : P);
  88.             y = (!A ? y : this.formatDate(y, W, this.j$(e)));
  89.             z = (!e.inline ? '<button type=\'button\' class=\'ui-datepicker-close ui-state-default ui-priority-primary ui-corner-all\' data-handler=\'hide\' data-event=\'click\'>' + this.e$(e, 'closeText') + '</button>' : '');
  90.             Q = (ie) ? '<div class=\'ui-datepicker-buttonpane ui-widget-content\'>' + (o ? z : '') + (this.vt$(e, W) ? '<button type=\'button\' class=\'ui-datepicker-current ui-state-default ui-priority-secondary ui-corner-all\' data-handler=\'today\' data-event=\'click\'>' + y + '</button>' : '') + (o ? '' : z) + '</div>' : '';
  91.             c = parseInt(this.e$(e, 'firstDay'), 10);
  92.             c = (isNaN(c) ? 0 : c);
  93.             F = this.e$(e, 'showWeek');
  94.             X = this.e$(e, 'dayNames');
  95.             J = this.e$(e, 'dayNamesMin');
  96.             Z = this.e$(e, 'monthNames');
  97.             G = this.e$(e, 'monthNamesShort');
  98.             L = this.e$(e, 'beforeShowDay');
  99.             x = this.e$(e, 'showOtherMonths');
  100.             V = this.e$(e, 'selectOtherMonths');
  101.             H = this.je$(e);
  102.             C = '';
  103.             r;
  104.             for (p = 0; p < a[0]; p++) {
  105.                 Y = '';
  106.                 this.maxRows = 4;
  107.                 for (m = 0; m < a[1]; m++) {
  108.                     U = this.r$(new Date(n, t, e.selectedDay));
  109.                     h = ' ui-corner-all';
  110.                     s = '';
  111.                     if (N) {
  112.                         s += '<div class=\'ui-datepicker-group';
  113.                         if (a[1] > 1) {
  114.                             switch (m) {
  115.                             case 0:
  116.                                 s += ' ui-datepicker-group-first';
  117.                                 h = ' ui-corner-' + (o ? 'right' : 'left');
  118.                                 break;
  119.                             case a[1] - 1:
  120.                                 s += ' ui-datepicker-group-last';
  121.                                 h = ' ui-corner-' + (o ? 'left' : 'right');
  122.                                 break;
  123.                             default:
  124.                                 s += ' ui-datepicker-group-middle';
  125.                                 h = '';
  126.                                 break
  127.                             }
  128.                         };
  129.                         s += '\'>'
  130.                     };
  131.                     s += '<div class=\'ui-datepicker-header ui-widget-header ui-helper-clearfix' + h + '\'>' + (/all|left/.test(h) && p === 0 ? (o ? B : S) : '') + (/all|right/.test(h) && p === 0 ? (o ? S : B) : '') + this.At$(e, t, n, g, d, p > 0 || m > 0, Z, G) + '</div><table class=\'ui-datepicker-calendar\'><thead><tr>';
  132.                     q = (F ? '<th class=\'ui-datepicker-week-col\'>' + this.e$(e, 'weekHeader') + '</th>' : '');
  133.                     for (r = 0; r < 7; r++) {
  134.                         M = (r + c) % 7;
  135.                         q += '<th' + ((r + c + 6) % 7 >= 5 ? ' class=\'ui-datepicker-week-end\'' : '') + '><span title=\'' + X[M] + '\'>' + J[M] + '</span></th>'
  136.                     };
  137.                     s += q + '</tr></thead><tbody>';
  138.                     R = this.q$(n, t);
  139.                     if (n === e.selectedYear && t === e.selectedMonth) {
  140.                         e.selectedDay = Math.min(e.selectedDay, R)
  141.                     };
  142.                     O = (this.Et$(n, t) - c + 7) % 7;
  143.                     k = Math.ceil((O + R) / 7);
  144.                     E = (N ? this.maxRows > k ? this.maxRows : k : k);
  145.                     this.maxRows = E;
  146.                     i = this.r$(new Date(n, t, 1 - O));
  147.                     for (T = 0; T < E; T++) {
  148.                         s += '<tr>';
  149.                         D = (!F ? '' : '<td class=\'ui-datepicker-week-col\'>' + this.e$(e, 'calculateWeek')(i) + '</td>');
  150.                         for (r = 0; r < 7; r++) {
  151.                             v = (L ? L.apply((e.input ? e.input[0] : null), [i]) : [!0, '']);
  152.                             f = (i.getMonth() !== t);
  153.                             w = (f && !V) || !v[0] || (g && i < g) || (d && i > d);
  154.                             D += '<td class=\'' + ((r + c + 6) % 7 >= 5 ? ' ui-datepicker-week-end' : '') + (f ? ' ui-datepicker-other-month' : '') + ((i.getTime() === U.getTime() && t === e.selectedMonth && e.P$) || (H.getTime() === i.getTime() && H.getTime() === U.getTime()) ? ' ' + this.ze$ : '') + (w ? ' ' + this.bt$ + ' ui-state-disabled' : '') + (f && !x ? '' : ' ' + v[1] + (i.getTime() === j.getTime() ? ' ' + this.mt$ : '') + (i.getTime() === P.getTime() ? ' ui-datepicker-today' : '')) + '\'' + ((!f || x) && v[2] ? ' title=\'' + v[2].replace(/'/g, '&#39;') + '\'' : '') + (w ? '' : ' data-handler=\'selectDay\' data-event=\'click\' data-month=\'' + i.getMonth() + '\' data-year=\'' + i.getFullYear() + '\'') + '>' + (f && !x ? '&#xa0;' : (w ? '<span class=\'ui-state-default\'>' + i.getDate() + '</span>' : '<a class=\'ui-state-default' + (i.getTime() === P.getTime() ? ' ui-state-highlight' : '') + (i.getTime() === j.getTime() ? ' ui-state-active' : '') + (f ? ' ui-priority-secondary' : '') + '\' href=\'#\'>' + i.getDate() + '</a>')) + '</td>';
  155.                             i.setDate(i.getDate() + 1);
  156.                             i = this.r$(i)
  157.                         };
  158.                         s += D + '</tr>'
  159.                     };
  160.                     t++;
  161.                     if (t > 11) {
  162.                         t = 0;
  163.                         n++
  164.                     };
  165.                     s += '</tbody></table>' + (N ? '</div>' + ((a[0] > 0 && m === a[1] - 1) ? '<div class=\'ui-datepicker-row-break\'></div>' : '') : '');
  166.                     Y += s
  167.                 };
  168.                 C += Y
  169.             };
  170.             C += Q;
  171.             e.P$ = !1;
  172.             return C
  173.         },
  174.         At$: function(e, t, i, n, s, a, b, w) {
  175.             var g, v, o, p, m, d, r, u, h = this.e$(e, 'changeMonth'),
  176.                 f = this.e$(e, 'changeYear'),
  177.                 y = this.e$(e, 'showMonthAfterYear'),
  178.                 l = '<div class=\'ui-datepicker-title\'>',
  179.                 c = '';
  180.             if (a || !h) {
  181.                 c += '<span class=\'ui-datepicker-month\'>' + b[t] + '</span>'
  182.             } else {
  183.                 g = (n && n.getFullYear() === i);
  184.                 v = (s && s.getFullYear() === i);
  185.                 c += '<select class=\'ui-datepicker-month\' data-handler=\'selectMonth\' data-event=\'change\'>';
  186.                 for (o = 0; o < 12; o++) {
  187.                     if ((!g || o >= n.getMonth()) && (!v || o <= s.getMonth())) {
  188.                         c += '<option value=\'' + o + '\'' + (o === t ? ' selected=\'selected\'' : '') + '>' + w[o] + '</option>'
  189.                     }
  190.                 };
  191.                 c += '</select>'
  192.             };
  193.             if (!y) {
  194.                 l += c + (a || !(h && f) ? '&#xa0;' : '')
  195.             };
  196.             if (!e.yearshtml) {
  197.                 e.yearshtml = '';
  198.                 if (a || !f) {
  199.                     l += '<span class=\'ui-datepicker-year\'>' + i + '</span>'
  200.                 } else {
  201.                     p = this.e$(e, 'yearRange').split(':');
  202.                     m = new Date().getFullYear();
  203.                     d = function(e) {
  204.                         var t = (e.match(/c[+\-].*/) ? i + parseInt(e.substring(1), 10) : (e.match(/[+\-].*/) ? m + parseInt(e, 10) : parseInt(e, 10)));
  205.                         return (isNaN(t) ? m : t)
  206.                     };
  207.                     r = d(p[0]);
  208.                     u = Math.max(r, d(p[1] || ''));
  209.                     r = (n ? Math.max(r, n.getFullYear()) : r);
  210.                     u = (s ? Math.min(u, s.getFullYear()) : u);
  211.                     e.yearshtml += '<select class=\'ui-datepicker-year\' data-handler=\'selectYear\' data-event=\'change\'>';
  212.                     for (; r <= u; r++) {
  213.                         e.yearshtml += '<option value=\'' + r + '\'' + (r === i ? ' selected=\'selected\'' : '') + '>' + r + '</option>'
  214.                     };
  215.                     e.yearshtml += '</select>';
  216.                     l += e.yearshtml;
  217.                     e.yearshtml = null
  218.                 }
  219.             };
  220.             l += this.e$(e, 'yearSuffix');
  221.             if (y) {
  222.                 l += (a || !(h && f) ? '&#xa0;' : '') + c
  223.             };
  224.             l += '</div>';
  225.             return l
  226.         },
  227.         Se$: function(e, t, i) {
  228.             var s = e.drawYear + (i === 'Y' ? t : 0),
  229.                 r = e.drawMonth + (i === 'M' ? t : 0),
  230.                 o = Math.min(e.selectedDay, this.q$(s, r)) + (i === 'D' ? t : 0),
  231.                 n = this.Pe$(e, this.r$(new Date(s, r, o)));
  232.             e.selectedDay = n.getDate();
  233.             e.drawMonth = e.selectedMonth = n.getMonth();
  234.             e.drawYear = e.selectedYear = n.getFullYear();
  235.             if (i === 'M' || i === 'Y') {
  236.                 this.ce$(e)
  237.             }
  238.         },
  239.         Pe$: function(e, t) {
  240.             var n = this.M$(e, 'min'),
  241.                 i = this.M$(e, 'max'),
  242.                 s = (n && t < n ? n : t);
  243.             return (i && s > i ? i : s)
  244.         },
  245.         ce$: function(e) {
  246.             var t = this.e$(e, 'onChangeMonthYear');
  247.             if (t) {
  248.                 t.apply((e.input ? e.input[0] : null), [e.selectedYear, e.selectedMonth + 1, e])
  249.             }
  250.         },
  251.         De$: function(e) {
  252.             var t = this.e$(e, 'numberOfMonths');
  253.             return (t == null ? [1, 1] : (typeof t === 'number' ? [1, t] : t))
  254.         },
  255.         M$: function(e, t) {
  256.             return this.Ce$(e, this.e$(e, t + 'Date'), null)
  257.         },
  258.         q$: function(e, t) {
  259.             return 32 - this.r$(new Date(e, t, 32)).getDate()
  260.         },
  261.         Et$: function(e, t) {
  262.             return new Date(e, t, 1).getDay()
  263.         },
  264.         gt$: function(e, t, i, n) {
  265.             var r = this.De$(e),
  266.                 s = this.r$(new Date(i, n + (t < 0 ? t : r[0] * r[1]), 1));
  267.             if (t < 0) {
  268.                 s.setDate(this.q$(s.getFullYear(), s.getMonth()))
  269.             };
  270.             return this.vt$(e, s)
  271.         },
  272.         vt$: function(e, t) {
  273.             var i, r, a = this.M$(e, 'min'),
  274.                 l = this.M$(e, 'max'),
  275.                 n = null,
  276.                 s = null,
  277.                 o = this.e$(e, 'yearRange');
  278.             if (o) {
  279.                 i = o.split(':');
  280.                 r = new Date().getFullYear();
  281.                 n = parseInt(i[0], 10);
  282.                 s = parseInt(i[1], 10);
  283.                 if (i[0].match(/[+\-].*/)) {
  284.                     n += r
  285.                 };
  286.                 if (i[1].match(/[+\-].*/)) {
  287.                     s += r
  288.                 }
  289.             };
  290.             return ((!a || t.getTime() >= a.getTime()) && (!l || t.getTime() <= l.getTime()) && (!n || t.getFullYear() >= n) && (!s || t.getFullYear() <= s))
  291.         },
  292.         j$: function(e) {
  293.             var t = this.e$(e, 'shortYearCutoff');
  294.             t = (typeof t !== 'string' ? t : new Date().getFullYear() % 100 + parseInt(t, 10));
  295.             return {
  296.                 shortYearCutoff: t,
  297.                 dayNamesShort: this.e$(e, 'dayNamesShort'),
  298.                 dayNames: this.e$(e, 'dayNames'),
  299.                 monthNamesShort: this.e$(e, 'monthNamesShort'),
  300.                 monthNames: this.e$(e, 'monthNames')
  301.             }
  302.         },
  303.         D$: function(e, t, i, n) {
  304.             if (!t) {
  305.                 e.currentDay = e.selectedDay;
  306.                 e.currentMonth = e.selectedMonth;
  307.                 e.currentYear = e.selectedYear
  308.             };
  309.             var s = (t ? (typeof t === 'object' ? t : this.r$(new Date(n, i, t))) : this.r$(new Date(e.currentYear, e.currentMonth, e.currentDay)));
  310.             return this.formatDate(this.e$(e, 'dateFormat'), s, this.j$(e))
  311.         }
  312.     });
  313.  
  314.     function o(t) {
  315.         var i = 'button, .ui-datepicker-prev, .ui-datepicker-next, .ui-datepicker-calendar td a';
  316.         return t.delegate(i, 'mouseout', function() {
  317.             e(this).removeClass('ui-state-hover');
  318.             if (this.className.indexOf('ui-datepicker-prev') !== -1) {
  319.                 e(this).removeClass('ui-datepicker-prev-hover')
  320.             };
  321.             if (this.className.indexOf('ui-datepicker-next') !== -1) {
  322.                 e(this).removeClass('ui-datepicker-next-hover')
  323.             }
  324.         }).delegate(i, 'mouseover', function() {
  325.             if (!e.datepicker.fe$(s.inline ? t.parent()[0] : s.input[0])) {
  326.                 e(this).parents('.ui-datepicker-calendar').find('a').removeClass('ui-state-hover');
  327.                 e(this).addClass('ui-state-hover');
  328.                 if (this.className.indexOf('ui-datepicker-prev') !== -1) {
  329.                     e(this).addClass('ui-datepicker-prev-hover')
  330.                 };
  331.                 if (this.className.indexOf('ui-datepicker-next') !== -1) {
  332.                     e(this).addClass('ui-datepicker-next-hover')
  333.                 }
  334.             }
  335.         })
  336.     };
  337.  
  338.     function n(t, i) {
  339.         e.extend(t, i);
  340.         for (var n in i) {
  341.             if (i[n] == null) {
  342.                 t[n] = i[n]
  343.             }
  344.         };
  345.         return t
  346.     };
  347.     e.fn.datepicker = function(t) {
  348.         if (!this.length) {
  349.             return this
  350.         };
  351.         if (!e.datepicker.initialized) {
  352.             e(document).mousedown(e.datepicker.Bt$);
  353.             e.datepicker.initialized = !0
  354.         };
  355.         if (e('#' + e.datepicker.ue$).length === 0) {
  356.             e('body').append(e.datepicker.dpDiv)
  357.         };
  358.         var i = Array.prototype.slice.call(arguments, 1);
  359.         if (typeof t === 'string' && (t === 'isDisabled' || t === 'getDate' || t === 'widget')) {
  360.             return e.datepicker['_' + t + 'Datepicker'].apply(e.datepicker, [this[0]].concat(i))
  361.         };
  362.         if (t === 'option' && arguments.length === 2 && typeof arguments[1] === 'string') {
  363.             return e.datepicker['_' + t + 'Datepicker'].apply(e.datepicker, [this[0]].concat(i))
  364.         };
  365.         return this.each(function() {
  366.             typeof t === 'string' ? e.datepicker['_' + t + 'Datepicker'].apply(e.datepicker, [this].concat(i)) : e.datepicker.It$(this, t)
  367.         })
  368.     };
  369.     e.datepicker = new r();
  370.     e.datepicker.initialized = !1;
  371.     e.datepicker.uuid = new Date().getTime();
  372.     e.datepicker.version = '1.10.3'
  373. })(jQuery);
  374. (function(e, t) {
  375.     e.widget('ui.menu', {
  376.         version: '1.10.3',
  377.         defaultElement: '<ul>',
  378.         delay: 300,
  379.         options: {
  380.             icons: {
  381.                 submenu: 'ui-icon-carat-1-e'
  382.             },
  383.             menus: 'ul',
  384.             position: {
  385.                 my: 'left top',
  386.                 at: 'right top'
  387.             },
  388.             role: 'menu',
  389.             blur: null,
  390.             focus: null,
  391.             select: null
  392.         },
  393.         E$: function() {
  394.             this.activeMenu = this.element;
  395.             this.mouseHandled = !1;
  396.             this.element.uniqueId().addClass('ui-menu ui-widget ui-widget-content ui-corner-all').toggleClass('ui-menu-icons', !! this.element.find('.ui-icon').length).attr({
  397.                 role: this.options.role,
  398.                 tabIndex: 0
  399.             }).bind('click' + this.eventNamespace, e.proxy(function(e) {
  400.                 if (this.options.disabled) {
  401.                     e.preventDefault()
  402.                 }
  403.             }, this));
  404.             if (this.options.disabled) {
  405.                 this.element.addClass('ui-state-disabled').attr('aria-disabled', 'true')
  406.             };
  407.             this.T$({
  408.                 'mousedown .ui-menu-item > a': function(e) {
  409.                     e.preventDefault()
  410.                 },
  411.                 'click .ui-state-disabled > a': function(e) {
  412.                     e.preventDefault()
  413.                 },
  414.                 'click .ui-menu-item:has(a)': function(t) {
  415.                     var i = e(t.target).closest('.ui-menu-item');
  416.                     if (!this.mouseHandled && i.not('.ui-state-disabled').length) {
  417.                         this.mouseHandled = !0;
  418.                         this.select(t);
  419.                         if (i.has('.ui-menu').length) {
  420.                             this.expand(t)
  421.                         } else if (!this.element.is(':focus')) {
  422.                             this.element.trigger('focus', [!0]);
  423.                             if (this.active && this.active.parents('.ui-menu').length === 1) {
  424.                                 clearTimeout(this.timer)
  425.                             }
  426.                         }
  427.                     }
  428.                 },
  429.                 'mouseenter .ui-menu-item': function(t) {
  430.                     var i = e(t.currentTarget);
  431.                     i.siblings().children('.ui-state-active').removeClass('ui-state-active');
  432.                     this.focus(t, i)
  433.                 },
  434.                 mouseleave: 'collapseAll',
  435.                 'mouseleave .ui-menu': 'collapseAll',
  436.                 focus: function(e, t) {
  437.                     var i = this.active || this.element.children('.ui-menu-item').eq(0);
  438.                     if (!t) {
  439.                         this.focus(e, i)
  440.                     }
  441.                 },
  442.                 blur: function(t) {
  443.                     this.f$(function() {
  444.                         if (!e.contains(this.element[0], this.document[0].activeElement)) {
  445.                             this.collapseAll(t)
  446.                         }
  447.                     })
  448.                 },
  449.                 keydown: '_keydown'
  450.             });
  451.             this.refresh();
  452.             this.T$(this.document, {
  453.                 click: function(t) {
  454.                     if (!e(t.target).closest('.ui-menu').length) {
  455.                         this.collapseAll(t)
  456.                     };
  457.                     this.mouseHandled = !1
  458.                 }
  459.             })
  460.         },
  461.         I$: function() {
  462.             this.element.removeAttr('aria-activedescendant').find('.ui-menu').addBack().removeClass('ui-menu ui-widget ui-widget-content ui-corner-all ui-menu-icons').removeAttr('role').removeAttr('tabIndex').removeAttr('aria-labelledby').removeAttr('aria-expanded').removeAttr('aria-hidden').removeAttr('aria-disabled').removeUniqueId().show();
  463.             this.element.find('.ui-menu-item').removeClass('ui-menu-item').removeAttr('role').removeAttr('aria-disabled').children('a').removeUniqueId().removeClass('ui-corner-all ui-state-hover').removeAttr('tabIndex').removeAttr('role').removeAttr('aria-haspopup').children().each(function() {
  464.                 var t = e(this);
  465.                 if (t.data('ui-menu-submenu-carat')) {
  466.                     t.remove()
  467.                 }
  468.             });
  469.             this.element.find('.ui-menu-divider').removeClass('ui-menu-divider ui-widget-content')
  470.         },
  471.         Hi$: function(t) {
  472.             var i, o, n, r, s, l = !0;
  473.  
  474.             function a(e) {
  475.                 return e.replace(/[\-\[\]{}()*+?.,\\\^$|#\s]/g, '\\$&')
  476.             };
  477.             switch (t.keyCode) {
  478.             case e.ui.keyCode.PAGE_UP:
  479.                 this.previousPage(t);
  480.                 break;
  481.             case e.ui.keyCode.PAGE_DOWN:
  482.                 this.nextPage(t);
  483.                 break;
  484.             case e.ui.keyCode.HOME:
  485.                 this.d$('first', 'first', t);
  486.                 break;
  487.             case e.ui.keyCode.END:
  488.                 this.d$('last', 'last', t);
  489.                 break;
  490.             case e.ui.keyCode.UP:
  491.                 this.previous(t);
  492.                 break;
  493.             case e.ui.keyCode.DOWN:
  494.                 this.next(t);
  495.                 break;
  496.             case e.ui.keyCode.LEFT:
  497.                 this.collapse(t);
  498.                 break;
  499.             case e.ui.keyCode.RIGHT:
  500.                 if (this.active && !this.active.is('.ui-state-disabled')) {
  501.                     this.expand(t)
  502.                 };
  503.                 break;
  504.             case e.ui.keyCode.ENTER:
  505.             case e.ui.keyCode.SPACE:
  506.                 this.ye$(t);
  507.                 break;
  508.             case e.ui.keyCode.ESCAPE:
  509.                 this.collapse(t);
  510.                 break;
  511.             default:
  512.                 l = !1;
  513.                 o = this.previousFilter || '';
  514.                 n = String.fromCharCode(t.keyCode);
  515.                 r = !1;
  516.                 clearTimeout(this.filterTimer);
  517.                 if (n === o) {
  518.                     r = !0
  519.                 } else {
  520.                     n = o + n
  521.                 };
  522.                 s = new RegExp('^' + a(n), 'i');
  523.                 i = this.activeMenu.children('.ui-menu-item').filter(function() {
  524.                     return s.test(e(this).children('a').text())
  525.                 });
  526.                 i = r && i.index(this.active.next()) !== -1 ? this.active.nextAll('.ui-menu-item') : i;
  527.                 if (!i.length) {
  528.                     n = String.fromCharCode(t.keyCode);
  529.                     s = new RegExp('^' + a(n), 'i');
  530.                     i = this.activeMenu.children('.ui-menu-item').filter(function() {
  531.                         return s.test(e(this).children('a').text())
  532.                     })
  533.                 };
  534.                 if (i.length) {
  535.                     this.focus(t, i);
  536.                     if (i.length > 1) {
  537.                         this.previousFilter = n;
  538.                         this.filterTimer = this.f$(function() {
  539.                             delete this.previousFilter
  540.                         }, 1000)
  541.                     } else {
  542.                         delete this.previousFilter
  543.                     }
  544.                 } else {
  545.                     delete this.previousFilter
  546.                 }
  547.             };
  548.             if (l) {
  549.                 t.preventDefault()
  550.             }
  551.         },
  552.         ye$: function(e) {
  553.             if (!this.active.is('.ui-state-disabled')) {
  554.                 if (this.active.children('a[aria-haspopup=\'true\']').length) {
  555.                     this.expand(e)
  556.                 } else {
  557.                     this.select(e)
  558.                 }
  559.             }
  560.         },
  561.         refresh: function() {
  562.             var t, n = this.options.icons.submenu,
  563.                 i = this.element.find(this.options.menus);
  564.             i.filter(':not(.ui-menu)').addClass('ui-menu ui-widget ui-widget-content ui-corner-all').hide().attr({
  565.                 role: this.options.role,
  566.                 'aria-hidden': 'true',
  567.                 'aria-expanded': 'false'
  568.             }).each(function() {
  569.                 var t = e(this),
  570.                     i = t.prev('a'),
  571.                     s = e('<span>').addClass('ui-menu-icon ui-icon ' + n).data('ui-menu-submenu-carat', !0);
  572.                 i.attr('aria-haspopup', 'true').prepend(s);
  573.                 t.attr('aria-labelledby', i.attr('id'))
  574.             });
  575.             t = i.add(this.element);
  576.             t.children(':not(.ui-menu-item):has(a)').addClass('ui-menu-item').attr('role', 'presentation').children('a').uniqueId().addClass('ui-corner-all').attr({
  577.                 tabIndex: -1,
  578.                 role: this.Qt$()
  579.             });
  580.             t.children(':not(.ui-menu-item)').each(function() {
  581.                 var t = e(this);
  582.                 if (!/[^\-\u2014\u2013\s]/.test(t.text())) {
  583.                     t.addClass('ui-widget-content ui-menu-divider')
  584.                 }
  585.             });
  586.             t.children('.ui-state-disabled').attr('aria-disabled', 'true');
  587.             if (this.active && !e.contains(this.element[0], this.active[0])) {
  588.                 this.blur()
  589.             }
  590.         },
  591.         Qt$: function() {
  592.             return {
  593.                 menu: 'menuitem',
  594.                 listbox: 'option'
  595.             }[this.options.role]
  596.         },
  597.         k$: function(e, t) {
  598.             if (e === 'icons') {
  599.                 this.element.find('.ui-menu-icon').removeClass(this.options.icons.submenu).addClass(t.submenu)
  600.             };
  601.             this.ie$(e, t)
  602.         },
  603.         focus: function(e, t) {
  604.             var i, n;
  605.             this.blur(e, e && e.type === 'focus');
  606.             this.Xt$(t);
  607.             this.active = t.first();
  608.             n = this.active.children('a').addClass('ui-state-focus');
  609.             if (this.options.role) {
  610.                 this.element.attr('aria-activedescendant', n.attr('id'))
  611.             };
  612.             this.active.parent().closest('.ui-menu-item').children('a:first').addClass('ui-state-active');
  613.             if (e && e.type === 'keydown') {
  614.                 this.A$()
  615.             } else {
  616.                 this.timer = this.f$(function() {
  617.                     this.A$()
  618.                 }, this.delay)
  619.             };
  620.             i = t.children('.ui-menu');
  621.             if (i.length && (/^mouse/.test(e.type))) {
  622.                 this.Ut$(i)
  623.             };
  624.             this.activeMenu = t.parent();
  625.             this.t$('focus', e, {
  626.                 item: t
  627.             })
  628.         },
  629.         Xt$: function(t) {
  630.             var o, a, i, r, s, n;
  631.             if (this.Le$()) {
  632.                 o = parseFloat(e.css(this.activeMenu[0], 'borderTopWidth')) || 0;
  633.                 a = parseFloat(e.css(this.activeMenu[0], 'paddingTop')) || 0;
  634.                 i = t.offset().top - this.activeMenu.offset().top - o - a;
  635.                 r = this.activeMenu.scrollTop();
  636.                 s = this.activeMenu.height();
  637.                 n = t.height();
  638.                 if (i < 0) {
  639.                     this.activeMenu.scrollTop(r + i)
  640.                 } else if (i + n > s) {
  641.                     this.activeMenu.scrollTop(r + i - s + n)
  642.                 }
  643.             }
  644.         },
  645.         blur: function(e, t) {
  646.             if (!t) {
  647.                 clearTimeout(this.timer)
  648.             };
  649.             if (!this.active) {
  650.                 return
  651.             };
  652.             this.active.children('a').removeClass('ui-state-focus');
  653.             this.active = null;
  654.             this.t$('blur', e, {
  655.                 item: this.active
  656.             })
  657.         },
  658.         Ut$: function(e) {
  659.             clearTimeout(this.timer);
  660.             if (e.attr('aria-hidden') !== 'true') {
  661.                 return
  662.             };
  663.             this.timer = this.f$(function() {
  664.                 this.A$();
  665.                 this.dt$(e)
  666.             }, this.delay)
  667.         },
  668.         dt$: function(t) {
  669.             var i = e.extend({
  670.                 of: this.active
  671.             }, this.options.position);
  672.             clearTimeout(this.timer);
  673.             this.element.find('.ui-menu').not(t.parents('.ui-menu')).hide().attr('aria-hidden', 'true');
  674.             t.show().removeAttr('aria-hidden').attr('aria-expanded', 'true').position(i)
  675.         },
  676.         collapseAll: function(t, i) {
  677.             clearTimeout(this.timer);
  678.             this.timer = this.f$(function() {
  679.                 var n = i ? this.element : e(t && t.target).closest(this.element.find('.ui-menu'));
  680.                 if (!n.length) {
  681.                     n = this.element
  682.                 };
  683.                 this.A$(n);
  684.                 this.blur(t);
  685.                 this.activeMenu = n
  686.             }, this.delay)
  687.         },
  688.         A$: function(e) {
  689.             if (!e) {
  690.                 e = this.active ? this.active.parent() : this.element
  691.             };
  692.             e.find('.ui-menu').hide().attr('aria-hidden', 'true').attr('aria-expanded', 'false').end().find('a.ui-state-active').removeClass('ui-state-active')
  693.         },
  694.         collapse: function(e) {
  695.             var t = this.active && this.active.parent().closest('.ui-menu-item', this.element);
  696.             if (t && t.length) {
  697.                 this.A$();
  698.                 this.focus(e, t)
  699.             }
  700.         },
  701.         expand: function(e) {
  702.             var t = this.active && this.active.children('.ui-menu ').children('.ui-menu-item').first();
  703.             if (t && t.length) {
  704.                 this.dt$(t.parent());
  705.                 this.f$(function() {
  706.                     this.focus(e, t)
  707.                 })
  708.             }
  709.         },
  710.         next: function(e) {
  711.             this.d$('next', 'first', e)
  712.         },
  713.         previous: function(e) {
  714.             this.d$('prev', 'last', e)
  715.         },
  716.         isFirstItem: function() {
  717.             return this.active && !this.active.prevAll('.ui-menu-item').length
  718.         },
  719.         isLastItem: function() {
  720.             return this.active && !this.active.nextAll('.ui-menu-item').length
  721.         },
  722.         d$: function(e, t, i) {
  723.             var n;
  724.             if (this.active) {
  725.                 if (e === 'first' || e === 'last') {
  726.                     n = this.active[e === 'first' ? 'prevAll' : 'nextAll']('.ui-menu-item').eq(-1)
  727.                 } else {
  728.                     n = this.active[e + 'All']('.ui-menu-item').eq(0)
  729.                 }
  730.             };
  731.             if (!n || !n.length || !this.active) {
  732.                 n = this.activeMenu.children('.ui-menu-item')[t]()
  733.             };
  734.             this.focus(i, n)
  735.         },
  736.         nextPage: function(t) {
  737.             var i, s, n;
  738.             if (!this.active) {
  739.                 this.next(t);
  740.                 return
  741.             };
  742.             if (this.isLastItem()) {
  743.                 return
  744.             };
  745.             if (this.Le$()) {
  746.                 s = this.active.offset().top;
  747.                 n = this.element.height();
  748.                 this.active.nextAll('.ui-menu-item').each(function() {
  749.                     i = e(this);
  750.                     return i.offset().top - s - n < 0
  751.                 });
  752.                 this.focus(t, i)
  753.             } else {
  754.                 this.focus(t, this.activeMenu.children('.ui-menu-item')[!this.active ? 'first' : 'last']())
  755.             }
  756.         },
  757.         previousPage: function(t) {
  758.             var i, s, n;
  759.             if (!this.active) {
  760.                 this.next(t);
  761.                 return
  762.             };
  763.             if (this.isFirstItem()) {
  764.                 return
  765.             };
  766.             if (this.Le$()) {
  767.                 s = this.active.offset().top;
  768.                 n = this.element.height();
  769.                 this.active.prevAll('.ui-menu-item').each(function() {
  770.                     i = e(this);
  771.                     return i.offset().top - s + n > 0
  772.                 });
  773.                 this.focus(t, i)
  774.             } else {
  775.                 this.focus(t, this.activeMenu.children('.ui-menu-item').first())
  776.             }
  777.         },
  778.         Le$: function() {
  779.             return this.element.outerHeight() < this.element.prop('scrollHeight')
  780.         },
  781.         select: function(t) {
  782.             this.active = this.active || e(t.target).closest('.ui-menu-item');
  783.             var i = {
  784.                 item: this.active
  785.             };
  786.             if (!this.active.has('.ui-menu').length) {
  787.                 this.collapseAll(t, !0)
  788.             };
  789.             this.t$('select', t, i)
  790.         }
  791.     })
  792. }(jQuery));
  793. (function(e) {
  794.     e.support.touch = 'ontouchend' in document;
  795.     if (!e.support.touch) {
  796.         return
  797.     };
  798.     var n = e.ui.mouse.prototype,
  799.         s = n.U$,
  800.         i;
  801.  
  802.     function t(e, t) {
  803.         if (e.originalEvent.touches.length > 1) {
  804.             return
  805.         };
  806.         e.preventDefault();
  807.         var i = e.originalEvent.changedTouches[0],
  808.             n = document.createEvent('MouseEvents');
  809.         n.initMouseEvent(t, !0, !0, window, 1, i.screenX, i.screenY, i.clientX, i.clientY, !1, !1, !1, !1, 0, null);
  810.         e.target.dispatchEvent(n)
  811.     };
  812.     n.Ri$ = function(e) {
  813.         var n = this;
  814.         if (i || !n.X$(e.originalEvent.changedTouches[0])) {
  815.             return
  816.         };
  817.         i = !0;
  818.         n.pt$ = !1;
  819.         t(e, 'mouseover');
  820.         t(e, 'mousemove');
  821.         t(e, 'mousedown')
  822.     };
  823.     n.Bi$ = function(e) {
  824.         if (!i) {
  825.             return
  826.         };
  827.         this.pt$ = !0;
  828.         t(e, 'mousemove')
  829.     };
  830.     n.qi$ = function(e) {
  831.         if (!i) {
  832.             return
  833.         };
  834.         t(e, 'mouseup');
  835.         t(e, 'mouseout');
  836.         if (!this.pt$) {
  837.             t(e, 'click')
  838.         };
  839.         i = !1
  840.     };
  841.     n.U$ = function() {
  842.         var t = this;
  843.         t.element.bind('touchstart', e.proxy(t, '_touchStart')).bind('touchmove', e.proxy(t, '_touchMove')).bind('touchend', e.proxy(t, '_touchEnd'));
  844.         s.call(t)
  845.     }
  846. })(jQuery);
  847. (function(e) {
  848.     var c, g, p, n, T, o, k, l, y, w, h = 0,
  849.         i = {},
  850.         f = [],
  851.         u = 0,
  852.         t = {},
  853.         a = [],
  854.         P = null,
  855.         m = new Image(),
  856.         I = /\.(jpg|gif|png|bmp|jpeg)(.*)?$/i,
  857.         q = /[^\.]\.(swf)\s*$/i,
  858.         M, L = 1,
  859.         b = 0,
  860.         v = '',
  861.         d, r, s = !1,
  862.         x = e.extend(e('<div/>')[0], {
  863.             prop: 0
  864.         }),
  865.         J, S, O = function() {
  866.             g.hide();
  867.             m.onerror = m.onload = null;
  868.             if (P) {
  869.                 P.abort()
  870.             };
  871.             c.empty()
  872.         },
  873.         z = function() {
  874.             if (!1 === i.onError(f, h, i)) {
  875.                 g.hide();
  876.                 s = !1;
  877.                 return
  878.             };
  879.             i.titleShow = !1;
  880.             i.width = 'auto';
  881.             i.height = 'auto';
  882.             c.html('<p id="fancybox-error">The requested content cannot be loaded.<br />Please try again later.</p>');
  883.             C()
  884.         },
  885.         D = function() {
  886.             var n = f[h],
  887.                 t, r, l, u, d, a;
  888.             O();
  889.             i = e.extend({}, e.fn.fancybox.defaults, (typeof e(n).data('fancybox') == 'undefined' ? i : e(n).data('fancybox')));
  890.             a = i.onStart(f, h, i);
  891.             if (a === !1) {
  892.                 s = !1;
  893.                 return
  894.             } else if (typeof a == 'object') {
  895.                 i = e.extend(i, a)
  896.             };
  897.             l = i.title || (n.nodeName ? e(n).attr('title') : n.title) || '';
  898.             if (n.nodeName && !i.orig) {
  899.                 i.orig = e(n).children('img:first').length ? e(n).children('img:first') : e(n)
  900.             };
  901.             if (l === '' && i.orig && i.titleFromAlt) {
  902.                 l = i.orig.attr('alt')
  903.             };
  904.             t = i.href || (n.nodeName ? e(n).attr('href') : n.href) || null;
  905.             if ((/^(?:javascript)/i).test(t) || t == '#') {
  906.                 t = null
  907.             };
  908.             if (i.type) {
  909.                 r = i.type;
  910.                 if (!t) {
  911.                     t = i.content
  912.                 }
  913.             } else if (i.content) {
  914.                 r = 'html'
  915.             } else if (t) {
  916.                 if (t.match(I)) {
  917.                     r = 'image'
  918.                 } else if (t.match(q)) {
  919.                     r = 'swf'
  920.                 } else if (e(n).hasClass('iframe')) {
  921.                     r = 'iframe'
  922.                 } else if (t.indexOf('#') === 0) {
  923.                     r = 'inline'
  924.                 } else {
  925.                     r = 'ajax'
  926.                 }
  927.             };
  928.             if (!r) {
  929.                 z();
  930.                 return
  931.             };
  932.             if (r == 'inline') {
  933.                 n = t.substr(t.indexOf('#'));
  934.                 r = e(n).length > 0 ? 'inline' : 'ajax'
  935.             };
  936.             i.type = r;
  937.             i.href = t;
  938.             i.title = l;
  939.             if (i.close_timeout !== undefined) {
  940.                 S = setTimeout('$.fancybox.close()', i.close_timeout)
  941.             };
  942.             if (i.autoDimensions) {
  943.                 if (i.type == 'html' || i.type == 'inline' || i.type == 'ajax') {
  944.                     i.width = 'auto';
  945.                     i.height = 'auto'
  946.                 } else {
  947.                     i.autoDimensions = !1
  948.                 }
  949.             };
  950.             if (i.modal) {
  951.                 i.overlayShow = !0;
  952.                 i.hideOnOverlayClick = !1;
  953.                 i.hideOnContentClick = !1;
  954.                 i.enableEscapeButton = !1;
  955.                 i.showCloseButton = !1
  956.             };
  957.             i.padding = parseInt(i.padding, 20);
  958.             i.margin = parseInt(i.margin, 0);
  959.             c.css('padding', (i.padding + i.margin));
  960.             e('.fancybox-inline-tmp').unbind('fancybox-cancel').bind('fancybox-change', function() {
  961.                 e(this).replaceWith(o.children())
  962.             });
  963.             switch (r) {
  964.             case 'html':
  965.                 c.html(i.content);
  966.                 C();
  967.                 break;
  968.             case 'inline':
  969.                 if (e(n).parent().is('#fancybox-content') === !0) {
  970.                     s = !1;
  971.                     return
  972.                 };
  973.                 e('<div class="fancybox-inline-tmp" />').hide().bind('fancybox-cleanup', function() {
  974.                     e(this).replaceWith(o.children())
  975.                 }).bind('fancybox-cancel', function() {
  976.                     e(this).replaceWith(c.children())
  977.                 });
  978.                 e(n).clone().show().appendTo(c);
  979.                 C();
  980.                 break;
  981.             case 'image':
  982.                 s = !1;
  983.                 e.fancybox.showActivity();
  984.                 m = new Image();
  985.                 m.onerror = function() {
  986.                     z()
  987.                 };
  988.                 m.onload = function() {
  989.                     s = !0;
  990.                     m.onerror = m.onload = null;
  991.                     Y()
  992.                 };
  993.                 m.src = t;
  994.                 break;
  995.             case 'swf':
  996.                 i.scrolling = 'no';
  997.                 u = '<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" width="' + i.width + '" height="' + i.height + '"><param name="movie" value="' + t + '"></param>';
  998.                 d = '';
  999.                 e.each(i.swf, function(e, t) {
  1000.                     u += '<param name="' + e + '" value="' + t + '"></param>';
  1001.                     d += ' ' + e + '="' + t + '"'
  1002.                 });
  1003.                 u += '<embed src="' + t + '" type="application/x-shockwave-flash" width="' + i.width + '" height="' + i.height + '"' + d + '></embed></object>';
  1004.                 c.html(u);
  1005.                 C();
  1006.                 break;
  1007.             case 'ajax':
  1008.                 s = !1;
  1009.                 e.fancybox.showActivity();
  1010.                 i.ajax.win = i.ajax.success;
  1011.                 P = e.ajax(e.extend({}, i.ajax, {
  1012.                     url: t,
  1013.                     data: i.ajax.data || {},
  1014.                     dataType: 'json',
  1015.                     error: function(e, t, i) {
  1016.                         if (e.status > 0) {
  1017.                             z()
  1018.                         }
  1019.                     },
  1020.                     success: function(e, n, s) {
  1021.                         var r = typeof s == 'object' ? s : P;
  1022.                         if (r.status == 200) {
  1023.                             if (typeof i.ajax.win == 'function') {
  1024.                                 a = i.ajax.win(t, e, n, s);
  1025.                                 if (a === !1) {
  1026.                                     g.hide();
  1027.                                     return
  1028.                                 } else if (typeof a == 'string' || typeof a == 'object') {
  1029.                                     e = a
  1030.                                 }
  1031.                             };
  1032.                             if (typeof e == 'object') {
  1033.                                 if (e.method == 'error') {
  1034.                                     var e = '<h2>Error</h2><div class="alertfield">' + e.html + '</div>'
  1035.                                 } else if (e.method == 'ok') {
  1036.                                     if (e.url != null) {
  1037.                                         window.location = e.url;
  1038.                                         return
  1039.                                     };
  1040.                                     var e = '<h2>Reloading...</h2><br>';
  1041.                                     window.location.reload(!0)
  1042.                                 } else if (e.method == 'show') {
  1043.                                     var e = e.html
  1044.                                 }
  1045.                             } else if (e == '{"method":"ok","html":""}') {
  1046.                                 var e = '<h2>Reloading...</h2><br>';
  1047.                                 window.location.reload(!0)
  1048.                             };
  1049.                             c.html(e);
  1050.                             C()
  1051.                         }
  1052.                     }
  1053.                 }));
  1054.                 break;
  1055.             case 'iframe':
  1056.                 j();
  1057.                 break
  1058.             }
  1059.         },
  1060.         C = function() {
  1061.             var n = i.width,
  1062.                 t = i.height;
  1063.             if (n.toString().indexOf('%') > -1) {
  1064.                 n = parseInt((e(window).width() - (i.margin * 2)) * parseFloat(n) / 100, 10) + 'px'
  1065.             } else {
  1066.                 n = n == 'auto' ? 'auto' : n + 'px'
  1067.             };
  1068.             if (t.toString().indexOf('%') > -1) {
  1069.                 t = parseInt((e(window).height() - (i.margin * 2)) * parseFloat(t) / 100, 10) + 'px'
  1070.             } else {
  1071.                 t = t == 'auto' ? 'auto' : t + 'px'
  1072.             };
  1073.             c.wrapInner('<div style="width:' + n + ';height:' + t + ';overflow: ' + (i.scrolling == 'auto' ? 'visible' : (i.scrolling == 'yes' ? 'scroll' : 'hidden')) + ';position:relative;"></div>');
  1074.             i.width = c.width();
  1075.             i.height = c.height();
  1076.             j()
  1077.         },
  1078.         Y = function() {
  1079.             i.width = m.width;
  1080.             i.height = m.height;
  1081.             e('<img />').attr({
  1082.                 'id': 'fancybox-img',
  1083.                 'src': m.src,
  1084.                 'alt': i.title
  1085.             }).appendTo(c);
  1086.             j()
  1087.         },
  1088.         j = function() {
  1089.             var m, v;
  1090.             g.hide();
  1091.             a = f;
  1092.             u = h;
  1093.             t = i;
  1094.             if (n.is(':visible') && !1 === t.onCleanup(a, u, t)) {
  1095.                 e.event.trigger('fancybox-cancel');
  1096.                 s = !1;
  1097.                 return
  1098.             };
  1099.             s = !0;
  1100.             e(o.add(p)).unbind();
  1101.             e(window).unbind('resize.fb scroll.fb');
  1102.             e(document).unbind('keydown.fb');
  1103.             if (n.is(':visible') && t.titlePosition !== 'outside') {
  1104.                 n.css('height', n.height())
  1105.             };
  1106.             if (t.overlayShow) {
  1107.                 p.css({
  1108.                     'background-color': t.overlayColor,
  1109.                     'opacity': t.overlayOpacity,
  1110.                     'cursor': t.hideOnOverlayClick ? 'pointer' : 'auto',
  1111.                     'height': e(document).height()
  1112.                 });
  1113.                 if (!p.is(':visible')) {
  1114.                     p.show()
  1115.                 }
  1116.             } else {
  1117.                 p.hide()
  1118.             };
  1119.             r = H();
  1120.             U();
  1121.             if (n.is(':visible')) {
  1122.                 e(k.add(y).add(w)).hide();
  1123.                 m = n.position(), d = {
  1124.                     top: m.top,
  1125.                     left: m.left,
  1126.                     width: n.width(),
  1127.                     height: n.height()
  1128.                 };
  1129.                 v = (d.width == r.width && d.height == r.height);
  1130.                 o.fadeTo(t.changeFade, 0.3, function() {
  1131.                     var n = function() {
  1132.                             o.html(c.contents()).fadeTo(t.changeFade, 1, A)
  1133.                         };
  1134.                     e.event.trigger('fancybox-change');
  1135.                     o.empty().removeAttr('filter').css({
  1136.                         'width': r.width - t.padding * 2,
  1137.                         'height': i.autoDimensions ? 'auto' : r.height - b - t.padding * 2
  1138.                     });
  1139.                     if (v) {
  1140.                         n()
  1141.                     } else {
  1142.                         x.prop = 0;
  1143.                         e(x).animate({
  1144.                             prop: 1
  1145.                         }, {
  1146.                             duration: t.changeSpeed,
  1147.                             easing: t.easingChange,
  1148.                             step: E,
  1149.                             complete: n
  1150.                         })
  1151.                     }
  1152.                 });
  1153.                 return
  1154.             };
  1155.             n.removeAttr('style');
  1156.             if (t.transitionIn == 'elastic') {
  1157.                 d = F();
  1158.                 o.html(c.contents());
  1159.                 n.show();
  1160.                 if (t.opacity) {
  1161.                     r.opacity = 0
  1162.                 };
  1163.                 x.prop = 0;
  1164.                 e(x).animate({
  1165.                     prop: 1
  1166.                 }, {
  1167.                     duration: t.speedIn,
  1168.                     easing: t.easingIn,
  1169.                     step: E,
  1170.                     complete: A
  1171.                 });
  1172.                 return
  1173.             };
  1174.             if (t.titlePosition == 'inside' && b > 0) {
  1175.                 l.show()
  1176.             };
  1177.             o.css({
  1178.                 'width': r.width - t.padding * 2,
  1179.                 'height': i.autoDimensions ? 'auto' : r.height - b - t.padding * 2
  1180.             }).html(c.contents());
  1181.             n.css(r).fadeIn(t.transitionIn == 'none' ? 0 : t.speedIn, A)
  1182.         },
  1183.         B = function(e) {
  1184.             if (e && e.length) {
  1185.                 if (t.titlePosition == 'float') {
  1186.                     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">' + e + '</td><td id="fancybox-title-float-right"></td></tr></table>'
  1187.                 };
  1188.                 return '<div id="fancybox-title-' + t.titlePosition + '">' + e + '</div>'
  1189.             };
  1190.             return !1
  1191.         },
  1192.         U = function() {
  1193.             v = t.title || '';
  1194.             b = 0;
  1195.             l.empty().removeAttr('style').removeClass();
  1196.             if (t.titleShow === !1) {
  1197.                 l.hide();
  1198.                 return
  1199.             };
  1200.             v = e.isFunction(t.titleFormat) ? t.titleFormat(v, a, u, t) : B(v);
  1201.             if (!v || v === '') {
  1202.                 l.hide();
  1203.                 return
  1204.             };
  1205.             l.addClass('fancybox-title-' + t.titlePosition).html(v).appendTo('body').show();
  1206.             switch (t.titlePosition) {
  1207.             case 'inside':
  1208.                 l.css({
  1209.                     'width': r.width - (t.padding * 2),
  1210.                     'marginLeft': t.padding,
  1211.                     'marginRight': t.padding
  1212.                 });
  1213.                 b = l.outerHeight(!0);
  1214.                 l.appendTo(T);
  1215.                 r.height += b;
  1216.                 break;
  1217.             case 'over':
  1218.                 l.css({
  1219.                     'marginLeft': t.padding,
  1220.                     'width': r.width - (t.padding * 2),
  1221.                     'bottom': t.padding
  1222.                 }).appendTo(T);
  1223.                 break;
  1224.             case 'float':
  1225.                 l.css('left', parseInt((l.width() - r.width - 40) / 2, 10) * -1).appendTo(n);
  1226.                 break;
  1227.             case 'none':
  1228.                 break;
  1229.             default:
  1230.                 l.css({
  1231.                     'width': r.width - (t.padding * 2),
  1232.                     'paddingLeft': t.padding,
  1233.                     'paddingRight': t.padding
  1234.                 }).appendTo(n);
  1235.                 break
  1236.             };
  1237.             l.hide()
  1238.         },
  1239.         Q = function() {
  1240.             if (t.enableEscapeButton || t.enableKeyboardNav) {
  1241.                 e(document).bind('keydown.fb', function(i) {
  1242.                     if (i.keyCode == 27 && t.enableEscapeButton) {
  1243.                         i.preventDefault();
  1244.                         e.fancybox.close()
  1245.                     } else if ((i.keyCode == 37 || i.keyCode == 39) && t.enableKeyboardNav && i.target.tagName !== 'INPUT' && i.target.tagName !== 'TEXTAREA' && i.target.tagName !== 'SELECT') {
  1246.                         i.preventDefault();
  1247.                         e.fancybox[i.keyCode == 37 ? 'prev' : 'next']()
  1248.                     }
  1249.                 })
  1250.             };
  1251.             if (!t.showNavArrows) {
  1252.                 y.hide();
  1253.                 w.hide();
  1254.                 return
  1255.             };
  1256.             if ((t.cyclic && a.length > 1) || u !== 0) {
  1257.                 y.show()
  1258.             };
  1259.             if ((t.cyclic && a.length > 1) || u != (a.length - 1)) {
  1260.                 w.show()
  1261.             }
  1262.         },
  1263.         A = function() {
  1264.             if (!e.support.opacity) {
  1265.                 o.get(0).style.removeAttribute('filter');
  1266.                 n.get(0).style.removeAttribute('filter')
  1267.             };
  1268.             if (i.autoDimensions) {
  1269.                 o.css('height', 'auto')
  1270.             };
  1271.             n.css('height', 'auto');
  1272.             if (v && v.length) {
  1273.                 l.show()
  1274.             };
  1275.             if (t.showCloseButton) {
  1276.                 k.show()
  1277.             };
  1278.             Q();
  1279.             if (t.hideOnContentClick) {
  1280.                 o.bind('click', e.fancybox.close)
  1281.             };
  1282.             if (t.hideOnOverlayClick) {
  1283.                 p.bind('click', e.fancybox.close)
  1284.             };
  1285.             e(window).bind('resize.fb', e.fancybox.resize);
  1286.             if (t.centerOnScroll) {
  1287.                 e(window).bind('scroll.fb', e.fancybox.center)
  1288.             };
  1289.             if (t.type == 'iframe') {
  1290.                 e('<iframe id="fancybox-frame" name="fancybox-frame' + new Date().getTime() + '" frameborder="0" hspace="0" allowtransparency="true" scrolling="' + i.scrolling + '" src="' + t.href + '"></iframe>').appendTo(o)
  1291.             };
  1292.             n.show();
  1293.             s = !1;
  1294.             e.fancybox.center();
  1295.             t.onComplete(a, u, t);
  1296.             o.find('[autofocus]').focus();
  1297.             X()
  1298.         },
  1299.         X = function() {
  1300.             var e, t;
  1301.             if ((a.length - 1) > u) {
  1302.                 e = a[u + 1].href;
  1303.                 if (typeof e !== 'undefined' && e.match(I)) {
  1304.                     t = new Image();
  1305.                     t.src = e
  1306.                 }
  1307.             };
  1308.             if (u > 0) {
  1309.                 e = a[u - 1].href;
  1310.                 if (typeof e !== 'undefined' && e.match(I)) {
  1311.                     t = new Image();
  1312.                     t.src = e
  1313.                 }
  1314.             }
  1315.         },
  1316.         E = function(e) {
  1317.             var i = {
  1318.                 width: parseInt(d.width + (r.width - d.width) * e, 10),
  1319.                 height: parseInt(d.height + (r.height - d.height) * e, 10),
  1320.                 top: parseInt(d.top + (r.top - d.top) * e, 10),
  1321.                 left: parseInt(d.left + (r.left - d.left) * e, 10)
  1322.             };
  1323.             if (typeof r.opacity !== 'undefined') {
  1324.                 i.opacity = e < 0.5 ? 0.5 : e
  1325.             };
  1326.             n.css(i);
  1327.             o.css({
  1328.                 'width': i.width - t.padding * 2,
  1329.                 'height': i.height - (b * e) - t.padding * 2
  1330.             })
  1331.         },
  1332.         N = function() {
  1333.             return [e(window).width() - (t.margin * 2), e(window).height() - (t.margin * 2), e(document).scrollLeft() + t.margin, e(document).scrollTop() + t.margin]
  1334.         },
  1335.         H = function() {
  1336.             var n = N(),
  1337.                 e = {},
  1338.                 o = t.autoScale,
  1339.                 s = t.padding * 2,
  1340.                 r;
  1341.             if (t.width.toString().indexOf('%') > -1) {
  1342.                 e.width = parseInt((n[0] * parseFloat(t.width)) / 100, 10)
  1343.             } else {
  1344.                 e.width = t.width + s
  1345.             };
  1346.             if (t.height.toString().indexOf('%') > -1) {
  1347.                 e.height = parseInt((n[1] * parseFloat(t.height)) / 100, 10)
  1348.             } else {
  1349.                 e.height = t.height + s
  1350.             };
  1351.             if (o && (e.width > n[0] || e.height > n[1])) {
  1352.                 if (i.type == 'image' || i.type == 'swf') {
  1353.                     r = (t.width) / (t.height);
  1354.                     if ((e.width) > n[0]) {
  1355.                         e.width = n[0];
  1356.                         e.height = parseInt(((e.width - s) / r) + s, 10)
  1357.                     };
  1358.                     if ((e.height) > n[1]) {
  1359.                         e.height = n[1];
  1360.                         e.width = parseInt(((e.height - s) * r) + s, 10)
  1361.                     }
  1362.                 } else {
  1363.                     e.width = Math.min(e.width, n[0]);
  1364.                     e.height = Math.min(e.height, n[1])
  1365.                 }
  1366.             };
  1367.             e.top = parseInt(Math.max(n[3] - 20, n[3] + ((n[1] - e.height - 40) * 0.5)), 10);
  1368.             e.left = parseInt(Math.max(n[2] - 20, n[2] + ((n[0] - e.width - 40) * 0.5)), 10);
  1369.             return e
  1370.         },
  1371.         R = function(e) {
  1372.             var t = e.offset();
  1373.             t.top += parseInt(e.css('paddingTop'), 10) || 0;
  1374.             t.left += parseInt(e.css('paddingLeft'), 10) || 0;
  1375.             t.top += parseInt(e.css('border-top-width'), 10) || 0;
  1376.             t.left += parseInt(e.css('border-left-width'), 10) || 0;
  1377.             t.width = e.width();
  1378.             t.height = e.height();
  1379.             return t
  1380.         },
  1381.         F = function() {
  1382.             var o = i.orig ? e(i.orig) : !1,
  1383.                 r = {},
  1384.                 s, n;
  1385.             if (o && o.length) {
  1386.                 s = R(o);
  1387.                 r = {
  1388.                     width: s.width + (t.padding * 2),
  1389.                     height: s.height + (t.padding * 2),
  1390.                     top: s.top - t.padding - 20,
  1391.                     left: s.left - t.padding - 20
  1392.                 }
  1393.             } else {
  1394.                 n = N();
  1395.                 r = {
  1396.                     width: t.padding * 2,
  1397.                     height: t.padding * 2,
  1398.                     top: parseInt(n[3] + n[1] * 0.5, 10),
  1399.                     left: parseInt(n[2] + n[0] * 0.5, 10)
  1400.                 }
  1401.             };
  1402.             return r
  1403.         },
  1404.         W = function() {
  1405.             if (!g.is(':visible')) {
  1406.                 clearInterval(M);
  1407.                 return
  1408.             };
  1409.             e('div', g).css('top', (L * -40) + 'px');
  1410.             L = (L + 1) % 12
  1411.         };
  1412.     e.fn.fancybox = function(t) {
  1413.         if (!e(this).length) {
  1414.             return this
  1415.         };
  1416.         e(this).data('fancybox', e.extend({}, t, (e.metadata ? e(this).metadata() : {}))).unbind('click.fb').bind('click.fb', function(t) {
  1417.             t.preventDefault();
  1418.             if (s) {
  1419.                 return
  1420.             };
  1421.             s = !0;
  1422.             e(this).blur();
  1423.             f = [];
  1424.             h = 0;
  1425.             var i = e(this).attr('rel') || '';
  1426.             if (!i || i == '' || i === 'nofollow') {
  1427.                 f.push(this)
  1428.             } else {
  1429.                 f = e('a[rel=' + i + '], area[rel=' + i + ']');
  1430.                 h = f.index(this)
  1431.             };
  1432.             D();
  1433.             return
  1434.         });
  1435.         return this
  1436.     };
  1437.     e.fancybox = function(t) {
  1438.         var n;
  1439.         if (s) {
  1440.             return
  1441.         };
  1442.         s = !0;
  1443.         n = typeof arguments[1] !== 'undefined' ? arguments[1] : {};
  1444.         f = [];
  1445.         h = parseInt(n.index, 10) || 0;
  1446.         if (e.isArray(t)) {
  1447.             for (var i = 0, r = t.length; i < r; i++) {
  1448.                 if (typeof t[i] == 'object') {
  1449.                     e(t[i]).data('fancybox', e.extend({}, n, t[i]))
  1450.                 } else {
  1451.                     t[i] = e({}).data('fancybox', e.extend({
  1452.                         content: t[i]
  1453.                     }, n))
  1454.                 }
  1455.             };
  1456.             f = jQuery.merge(f, t)
  1457.         } else {
  1458.             if (typeof t == 'object') {
  1459.                 e(t).data('fancybox', e.extend({}, n, t))
  1460.             } else {
  1461.                 t = e({}).data('fancybox', e.extend({
  1462.                     content: t
  1463.                 }, n))
  1464.             };
  1465.             f.push(t)
  1466.         };
  1467.         if (h > f.length || h < 0) {
  1468.             h = 0
  1469.         };
  1470.         D()
  1471.     };
  1472.     e.fancybox.isActive = function() {
  1473.         return e('#fancybox-content').is(':visible')
  1474.     };
  1475.     e.fancybox.setContent = function(t) {
  1476.         e('#fancybox-content div').html(t);
  1477.         e.fancybox.resize()
  1478.     };
  1479.     e.fancybox.queue = function(t, i) {
  1480.         if (!t.length) return;
  1481.         i = e.extend({
  1482.             onNext: null,
  1483.             timeout: 0
  1484.         }, i);
  1485.         var s = t.pop(),
  1486.             n = e(s).html();
  1487.         if (i.timeout) {
  1488.             setTimeout(function() {
  1489.                 e.fancybox.close()
  1490.             }, i.timeout)
  1491.         };
  1492.         if (typeof i.onNext == 'function') {
  1493.             i.onNext.call(this, n)
  1494.         };
  1495.         if (e.fancybox.isActive()) {
  1496.             e.fancybox.setContent(n);
  1497.             return
  1498.         };
  1499.         e.fancybox({
  1500.             content: n,
  1501.             hideOnContentClick: !0,
  1502.             onCleanup: function() {
  1503.                 if (t.length) {
  1504.                     e.fancybox.queue(t, i);
  1505.                     return !1
  1506.                 }
  1507.             }
  1508.         })
  1509.     };
  1510.     e.fancybox.saveState = function() {
  1511.         var i = e('#fancybox-wrap'),
  1512.             t = e('#fancybox-content');
  1513.         return {
  1514.             title: t.find('h1,h2,h3').eq(0).text(),
  1515.             div: e('<div/>').hide().appendTo('body').append(t.contents()),
  1516.             wrapTop: i.css('top'),
  1517.             wrapLeft: i.css('left'),
  1518.             wrapWidth: i.css('width'),
  1519.             contentWidth: t.css('width')
  1520.         }
  1521.     };
  1522.     e.fancybox.restoreState = function(t) {
  1523.         e('#fancybox-wrap').css({
  1524.             top: t.wrapTop,
  1525.             left: t.wrapLeft,
  1526.             width: t.wrapWidth
  1527.         });
  1528.         e('#fancybox-content').empty().append(t.div.contents()).css({
  1529.             width: t.contentWidth
  1530.         });
  1531.         t.div.remove()
  1532.     };
  1533.     e.fancybox.showActivity = function() {
  1534.         clearInterval(M);
  1535.         g.show();
  1536.         M = setInterval(W, 66)
  1537.     };
  1538.     e.fancybox.hideActivity = function() {
  1539.         g.hide()
  1540.     };
  1541.     e.fancybox.next = function() {
  1542.         return e.fancybox.pos(u + 1)
  1543.     };
  1544.     e.fancybox.prev = function() {
  1545.         return e.fancybox.pos(u - 1)
  1546.     };
  1547.     e.fancybox.pos = function(e) {
  1548.         if (s) {
  1549.             return
  1550.         };
  1551.         e = parseInt(e);
  1552.         f = a;
  1553.         if (e > -1 && e < a.length) {
  1554.             h = e;
  1555.             D()
  1556.         } else if (t.cyclic && a.length > 1) {
  1557.             h = e >= a.length ? 0 : a.length - 1;
  1558.             D()
  1559.         };
  1560.         return
  1561.     };
  1562.     e.fancybox.cancel = function() {
  1563.         if (s) {
  1564.             return
  1565.         };
  1566.         s = !0;
  1567.         e.event.trigger('fancybox-cancel');
  1568.         O();
  1569.         i.onCancel(f, h, i);
  1570.         s = !1
  1571.     };
  1572.     e.fancybox.close = function() {
  1573.         if (S !== undefined) {
  1574.             clearTimeout(S);
  1575.             delete S
  1576.         };
  1577.         if (s || n.is(':hidden')) {
  1578.             return
  1579.         };
  1580.         s = !0;
  1581.         if (t && !1 === t.onCleanup(a, u, t)) {
  1582.             s = !1;
  1583.             return
  1584.         };
  1585.         O();
  1586.         e(k.add(y).add(w)).hide();
  1587.         e(o.add(p)).unbind();
  1588.         e(window).unbind('resize.fb scroll.fb');
  1589.         e(document).unbind('keydown.fb');
  1590.         o.find('iframe').attr('src', 'about:blank');
  1591.         if (t.titlePosition !== 'inside') {
  1592.             l.empty()
  1593.         };
  1594.         n.stop();
  1595.  
  1596.         function c() {
  1597.             p.fadeOut('fast');
  1598.             l.empty().hide();
  1599.             n.hide();
  1600.             e.event.trigger('fancybox-cleanup');
  1601.             o.empty();
  1602.             t.onClosed(a, u, t);
  1603.             a = i = [];
  1604.             u = h = 0;
  1605.             t = i = {};
  1606.             s = !1
  1607.         };
  1608.         if (t.transitionOut == 'elastic') {
  1609.             d = F();
  1610.             var f = n.position();
  1611.             r = {
  1612.                 top: f.top,
  1613.                 left: f.left,
  1614.                 width: n.width(),
  1615.                 height: n.height()
  1616.             };
  1617.             if (t.opacity) {
  1618.                 r.opacity = 1
  1619.             };
  1620.             l.empty().hide();
  1621.             x.prop = 1;
  1622.             e(x).animate({
  1623.                 prop: 0
  1624.             }, {
  1625.                 duration: t.speedOut,
  1626.                 easing: t.easingOut,
  1627.                 step: E,
  1628.                 complete: c
  1629.             })
  1630.         } else {
  1631.             n.fadeOut(t.transitionOut == 'none' ? 0 : t.speedOut, c)
  1632.         }
  1633.     };
  1634.     e.fancybox.resize = function() {
  1635.         if (p.is(':visible')) {
  1636.             p.css('height', e(document).height())
  1637.         };
  1638.         e.fancybox.center(!0)
  1639.     };
  1640.     e.fancybox.center = function() {
  1641.         var e, i;
  1642.         if (s) {
  1643.             return
  1644.         };
  1645.         i = arguments[0] === !0 ? 1 : 0;
  1646.         e = N();
  1647.         if (!i && (n.width() > e[0] || n.height() > e[1])) {
  1648.             return
  1649.         };
  1650.         n.stop().animate({
  1651.             'top': parseInt(Math.max(e[3] - 20, e[3] + ((e[1] - o.height() - 40) * 0.5) - t.padding)),
  1652.             'left': parseInt(Math.max(e[2] - 20, e[2] + ((e[0] - o.width() - 40) * 0.5) - t.padding))
  1653.         }, typeof arguments[0] == 'number' ? arguments[0] : 200)
  1654.     };
  1655.     e.fancybox.init = function() {
  1656.         if (e('#fancybox-wrap').length) {
  1657.             return
  1658.         };
  1659.         e('body').append(c = e('<div id="fancybox-tmp"></div>'), g = e('<div id="fancybox-loading"><div></div></div>'), p = e('<div id="fancybox-overlay"></div>'), n = e('<div id="fancybox-wrap"></div>'));
  1660.         T = e('<div id="fancybox-outer"></div>').appendTo(n);
  1661.         T.append(o = e('<div id="fancybox-content"></div>'), k = e('<a id="fancybox-close"><i class="ka ka16 ka-delete"></i></a>'), l = e('<div id="fancybox-title"></div>'), y = e('<a href="javascript:;" id="fancybox-left"><span class="fancy-ico" id="fancybox-left-ico"></span></a>'), w = e('<a href="javascript:;" id="fancybox-right"><span class="fancy-ico" id="fancybox-right-ico"></span></a>'));
  1662.         k.click(e.fancybox.close);
  1663.         g.click(e.fancybox.cancel);
  1664.         y.click(function(t) {
  1665.             t.preventDefault();
  1666.             e.fancybox.prev()
  1667.         });
  1668.         w.click(function(t) {
  1669.             t.preventDefault();
  1670.             e.fancybox.next()
  1671.         });
  1672.         if (e.fn.mousewheel) {
  1673.             n.bind('mousewheel.fb', function(t, i) {
  1674.                 if (s) {
  1675.                     t.preventDefault()
  1676.                 } else if (e(t.target).get(0).clientHeight == 0 || e(t.target).get(0).scrollHeight === e(t.target).get(0).clientHeight) {
  1677.                     t.preventDefault();
  1678.                     e.fancybox[i > 0 ? 'prev' : 'next']()
  1679.                 }
  1680.             })
  1681.         };
  1682.         if (!e.support.opacity) {
  1683.             n.addClass('fancybox-ie')
  1684.         }
  1685.     };
  1686.     e.fn.fancybox.defaults = {
  1687.         padding: 10,
  1688.         margin: 40,
  1689.         opacity: !1,
  1690.         modal: !1,
  1691.         cyclic: !1,
  1692.         scrolling: 'auto',
  1693.         width: 560,
  1694.         height: 340,
  1695.         autoScale: !0,
  1696.         autoDimensions: !0,
  1697.         centerOnScroll: !1,
  1698.         ajax: {},
  1699.         swf: {
  1700.             wmode: 'transparent'
  1701.         },
  1702.         hideOnOverlayClick: !0,
  1703.         hideOnContentClick: !1,
  1704.         overlayShow: !0,
  1705.         overlayOpacity: 0.9,
  1706.         titleShow: !1,
  1707.         titlePosition: 'float',
  1708.         titleFormat: null,
  1709.         titleFromAlt: !1,
  1710.         transitionIn: 'fade',
  1711.         transitionOut: 'fade',
  1712.         speedIn: 300,
  1713.         speedOut: 300,
  1714.         changeSpeed: 300,
  1715.         changeFade: 'fast',
  1716.         easingIn: 'swing',
  1717.         easingOut: 'swing',
  1718.         showCloseButton: !0,
  1719.         showNavArrows: !0,
  1720.         enableEscapeButton: !0,
  1721.         enableKeyboardNav: !0,
  1722.         onStart: function() {},
  1723.         onCancel: function() {},
  1724.         onComplete: function() {},
  1725.         onCleanup: function() {},
  1726.         onClosed: function() {},
  1727.         onError: function() {}
  1728.     };
  1729.     e(document).ready(function() {
  1730.         e.fancybox.init()
  1731.     })
  1732. })(jQuery);
  1733. (function(e) {
  1734.     e.bbedit = {
  1735.         baseURL: '/static/kar/images/',
  1736.         i18n: {
  1737.             'default': {
  1738.                 'b': 'Bold',
  1739.                 'i': 'Italic',
  1740.                 'u': 'Underline',
  1741.                 's': 'Strike through',
  1742.                 'url': 'Insert link',
  1743.                 'torrent': 'Insert torrent link',
  1744.                 'user': 'Insert link to user profile',
  1745.                 'image': 'Insert image',
  1746.                 'code': 'Insert code',
  1747.                 'quote': 'Insert quote',
  1748.                 'smiles': 'Show smiles',
  1749.                 'spoiler': 'Insert spoiler',
  1750.                 'size': 'Font size',
  1751.                 'align': 'Text alignment',
  1752.                 'list': 'Insert List',
  1753.                 'color': 'Set text color',
  1754.                 'youtube': 'Embed YouTube video',
  1755.                 'preview': 'Preview',
  1756.                 'biggrin': 'Big grin',
  1757.                 'cry': 'Cry',
  1758.                 'dizzy': 'Dizzy',
  1759.                 'funk': 'Funk',
  1760.                 'huffy': 'Huffy',
  1761.                 'lol': 'Laugh out Loud',
  1762.                 'loveliness': 'Loveliness',
  1763.                 'mad': 'Mad',
  1764.                 'sad': 'Sad',
  1765.                 'shocked': 'Shocked',
  1766.                 'shy': 'Shy',
  1767.                 'sleepy': 'Sleepy',
  1768.                 'smile': 'Smile',
  1769.                 'sweat': 'Sweat',
  1770.                 'titter': 'Titter',
  1771.                 'tongue': 'Tongue out',
  1772.                 'pirate': 'Pirate',
  1773.                 'nervous': 'Nervous Laughter',
  1774.                 'white': 'White Flag',
  1775.                 'cold': 'Cold Sweat',
  1776.                 'lucky': 'Ya feelin lucky, punk??',
  1777.                 'boo': 'Boo',
  1778.                 'wink': 'Little D',
  1779.                 'dull': 'Dull',
  1780.                 'chuckle': 'Chuckle',
  1781.                 'clap': 'Clap',
  1782.                 'drunk': 'Drunk',
  1783.                 'finger': 'Middle finger',
  1784.                 'inlove': 'In love',
  1785.                 'nerd': 'Nerd',
  1786.                 'no': 'No',
  1787.                 'rofl': 'ROFL',
  1788.                 'sealed': 'Lips sealed',
  1789.                 'smirk': 'Smirk',
  1790.                 'think': 'Think',
  1791.                 'yes': 'Yes',
  1792.                 'wait': 'Wait',
  1793.                 'wave': 'Wave',
  1794.                 'cool': 'Cool dude',
  1795.                 'evil': 'Evil',
  1796.                 'punch': 'Punch',
  1797.                 'doh': 'Doh',
  1798.                 'yawn': 'Yawn',
  1799.                 'tmi': 'TMI',
  1800.                 'fubar': 'FUBAR',
  1801.                 'rock': 'Rock',
  1802.                 'bandit': 'Bandit',
  1803.                 'swear': 'Swear',
  1804.                 'facepalm': 'Facepalm',
  1805.                 'thumb_dwn': 'Thumbs Down',
  1806.                 'thump_up': 'Thumbs Up'
  1807.             }
  1808.         },
  1809.         menus: {
  1810.             'size': {
  1811.                 '200': 'Big',
  1812.                 '100': 'Normal',
  1813.                 'small': 'Small'
  1814.             },
  1815.             'align': {
  1816.                 'left': 'Left',
  1817.                 'center': 'Center',
  1818.                 'right': 'Right',
  1819.                 'justify': 'Justify'
  1820.             },
  1821.             'list': {
  1822.                 'bullet': 'Bulleted List',
  1823.                 'numeric': 'Numeric List',
  1824.                 'additem': 'Add Item'
  1825.             },
  1826.             'image': {
  1827.                 'upload': 'Insert image',
  1828.                 'link': 'Link image',
  1829.             },
  1830.             'color': {
  1831.                 'yellow': '',
  1832.                 'orange': '',
  1833.                 'red': '',
  1834.                 'blue': '',
  1835.                 'purple': '',
  1836.                 'green': '',
  1837.                 'white': '',
  1838.                 'gray': '',
  1839.                 'black': '',
  1840.             }
  1841.         }
  1842.     };
  1843.     e.fn.extend({
  1844.         bbedit: function(s) {
  1845.             this.defaults = {
  1846.                 highlight: !0,
  1847.                 enableToolbar: !0,
  1848.                 enableSmileybar: !0,
  1849.                 isforSignature: !1,
  1850.                 reportbox: !1,
  1851.                 lang: 'default',
  1852.                 tags: 'b,i,u,s,image,url,torrent,user,code,quote,smiles,spoiler,size,align,list,color,youtube,preview',
  1853.                 hasmenu: 'size,align',
  1854.                 smilies: 'biggrin,cry,dizzy,funk,huffy,lol,loveliness,mad,sad,shocked,shy,sleepy,smile,sweat,titter,tongue,pirate,boo,wink,dull,chuckle,clap,drunk,finger,inlove,nerd,no,rofl,sealed,smirk,think,yes,wait,wave,cool,evil,punch,doh,yawn,tmi,fubar,rock,bandit,swear,facepalm,thump_up,thumb_dwn',
  1855.                 attachImage: !0,
  1856.                 lastBBcode: ''
  1857.             };
  1858.             var s = e.extend(this.defaults, s),
  1859.                 a = s.tags.split(/,\s*/),
  1860.                 c = '<div class="bbedit-toolbar">';
  1861.             for (var r in a) {
  1862.                 c += ((a[r] in e.bbedit.menus) ? '<div class="bbedit-hasmenu">' : '') + '<span class="ka ka-' + a[r] + ' bbedit-' + a[r] + '" title="' + e.bbedit.i18n[s.lang][a[r]] + '"></span>' + ((a[r] in e.bbedit.menus) ? '</div> ' : ' ')
  1863.             };
  1864.             c += '</div>';
  1865.             var o = s.smilies.split(/,\s*/),
  1866.                 u = '<div class="clear"></div>',
  1867.                 l = '<div class="bbedit-smileybar">';
  1868.             for (var r in o) {
  1869.                 if (o[r] != '|' && o != undefined) {
  1870.                     l += '<img src="' + e.bbedit.baseURL + 'smiley/' + o[r] + '.gif" class="bbedit-' + o[r] + '" alt="' + o[r] + '" title="' + e.bbedit.i18n[s.lang][o[r]] + '" /> '
  1871.                 } else {
  1872.                     l += '<br />'
  1873.                 }
  1874.             };
  1875.             l += '</div>';
  1876.             return this.each(function() {
  1877.                 var r = s;
  1878.                 r.ta = this;
  1879.                 var u = 'sm' + Math.random();
  1880.                 u = u.replace('0.', '');
  1881.                 e(this).bind('select click keyup', function() {
  1882.                     if (document.selection) {
  1883.                         var i = document.selection.createRange(),
  1884.                             t = r.ta.createTextRange(),
  1885.                             e = t.duplicate();
  1886.                         t.moveToBookmark(i.getBookmark());
  1887.                         e.setEndPoint('EndToStart', t);
  1888.                         r.selectionStart = e.text.length;
  1889.                         r.selectionEnd = e.text.length + i.text.length
  1890.                     }
  1891.                 });
  1892.                 if (s.enableToolbar) {
  1893.                     var a = e(c);
  1894.                     e(this).before(a);
  1895.                     if (s.isforSignature) a.find('.bbedit-code, .bbedit-quote, .bbedit-spoiler, .bbedit-youtube').remove();
  1896.                     if (s.reportbox) a.find('.bbedit-smiles, .bbedit-hasmenu:has(.bbedit-size, .bbedit-align, .bbedit-color), .bbedit-youtube').remove();
  1897.                     if (!s.preview) {
  1898.                         a.find('.bbedit-preview').remove()
  1899.                     } else {
  1900.                         a.find('.bbedit-preview').attr('data-preview', s.preview).before('<span class="bbedit-separator"></span> ')
  1901.                     };
  1902.                     a.find('.bbedit-hasmenu').each(function() {
  1903.                         n(e(this))
  1904.                     });
  1905.                     a.find('.bbedit-b').click(function() {
  1906.                         t(r, '[b]', '[/b]')
  1907.                     });
  1908.                     a.find('.bbedit-i').click(function() {
  1909.                         t(r, '[i]', '[/i]')
  1910.                     });
  1911.                     a.find('.bbedit-u').click(function() {
  1912.                         t(r, '[u]', '[/u]')
  1913.                     });
  1914.                     a.find('.bbedit-s').click(function() {
  1915.                         t(r, '[s]', '[/s]')
  1916.                     });
  1917.                     a.find('.bbedit-code').click(function() {
  1918.                         t(r, '[code]', '[/code]')
  1919.                     });
  1920.                     a.find('.bbedit-quote').click(function() {
  1921.                         t(r, '[quote]', '[/quote]')
  1922.                     });
  1923.                     a.find('.bbedit-spoiler').click(function() {
  1924.                         var e = prompt('Enter spoiler button text:');
  1925.                         if (e.replace(/ /g, '') != '') {
  1926.                             t(r, '[spoiler="' + e.replace(/"/g, '`') + '"]', '[/spoiler]')
  1927.                         } else {
  1928.                             t(r, '[spoiler]', '[/spoiler]')
  1929.                         }
  1930.                     });
  1931.                     a.find('.bbedit-align').click(function() {
  1932.                         var e = prompt('Enter alignment:');
  1933.                         if (e == 'left' || e == 'center' || e == 'right' || e == 'justify') t(r, '[' + e + ']', '[/' + e + ']')
  1934.                     });
  1935.                     a.find('[class*="bbedit-align-"]').click(function() {
  1936.                         var i = e(this).attr('class').replace(/.*bbedit-align-/, '');
  1937.                         t(r, '[' + i + ']', '[/' + i + ']')
  1938.                     });
  1939.                     a.find('.bbedit-list').click(function() {
  1940.                         t(r, '[*] ', '')
  1941.                     });
  1942.                     a.find('[class*="bbedit-list-"]').click(function() {
  1943.                         if (e(this).is('.bbedit-list-additem')) {
  1944.                             t(r, '[*] ', '')
  1945.                         } else if (e(this).is('.bbedit-list-numeric')) {
  1946.                             t(r, '[list=1]\n', '\n[/list]')
  1947.                         } else {
  1948.                             t(r, '[list]\n', '\n[/list]')
  1949.                         }
  1950.                     });
  1951.                     a.find('.bbedit-size').click(function() {
  1952.                         var e = prompt('Text size');
  1953.                         if (e) t(r, '[size=' + e + ']', '[/size]')
  1954.                     });
  1955.                     a.find('[class*="bbedit-size-"]').click(function() {
  1956.                         var i = e(this).attr('class').replace(/.*bbedit-size-/, '');
  1957.                         if (i == 'small') {
  1958.                             t(r, '[small]', '[/small]')
  1959.                         } else {
  1960.                             t(r, '[size=' + i + ']', '[/size]')
  1961.                         }
  1962.                     });
  1963.                     a.find('.bbedit-color').click(function() {
  1964.                         var e = prompt('Enter color');
  1965.                         if (/^#*([a-f0-9]{3}){1,2}$/i.test(e)) {
  1966.                             t(r, '[color=' + (/^#/.test(e) ? '' : '#') + e + ']', '[/color]')
  1967.                         } else if (e != '' && e != null) {
  1968.                             t(r, '[color="' + e + '"]', '[/color]')
  1969.                         }
  1970.                     });
  1971.                     a.find('[class*="bbedit-color-"]').click(function() {
  1972.                         var i = e(this).attr('class').replace(/.*bbedit-color-/, '');
  1973.                         if (i == 'menu') return;
  1974.                         t(r, '[color="' + i + '"]', '[/color]')
  1975.                     });
  1976.                     a.find('.bbedit-image-link').click(function() {
  1977.                         t(r, function(e) {
  1978.                             if (e != '') {
  1979.                                 return '[img]' + e + '[/img]'
  1980.                             } else {
  1981.                                 var t = prompt('Image URL: ', '');
  1982.                                 if (t != null && t != '') {
  1983.                                     return '[img]' + t + '[/img]'
  1984.                                 };
  1985.                                 return !1
  1986.                             }
  1987.                         })
  1988.                     });
  1989.                     a.find('.bbedit-url').click(function() {
  1990.                         t(r, function(e) {
  1991.                             if (/^https?:\/\//i.test(e)) {
  1992.                                 return '[url]' + e + '[/url]'
  1993.                             } else {
  1994.                                 var t = prompt('URL: ', '');
  1995.                                 if (t != null && t != '') {
  1996.                                     if (!/^https?:\/\//i.test(t)) {
  1997.                                         t = 'http://' + t
  1998.                                     };
  1999.                                     if (e == '') {
  2000.                                         return '[url="' + t + '"]' + t + '[/url]'
  2001.                                     } else {
  2002.                                         return '[url="' + t + '"]' + e + '[/url]'
  2003.                                     }
  2004.                                 };
  2005.                                 return !1
  2006.                             }
  2007.                         })
  2008.                     });
  2009.                     a.find('.bbedit-youtube').click(function() {
  2010.                         t(r, function(e) {
  2011.                             if (e.length > 0) {
  2012.                                 return '[youtube]' + e + '[/youtube]'
  2013.                             } else {
  2014.                                 var t = prompt('YouTube URL: ', '');
  2015.                                 if (t != null && t != '') {
  2016.                                     return '[youtube]' + t + '[/youtube]'
  2017.                                 };
  2018.                                 return !1
  2019.                             }
  2020.                         })
  2021.                     });
  2022.                     a.find('.bbedit-image-upload, .bbedit-image').imageSelector({
  2023.                         select: function(i) {
  2024.                             for (var n in i) {
  2025.                                 if (s.attachImage) {
  2026.                                     e(this).parents('form:eq(0)').find('.objectAttachmentsJs').append(e('<div/>').attr('class', 'galleryThumbSizerStills inlineblock').append(e('<input/>').attr('type', 'hidden').attr('name', 'image_ids[]').val(i[n].id)).append(e('<a/>').attr('class', 'topmarg2px leftmarg2px absolute').click(function() {
  2027.                                         e(this).parent().remove()
  2028.                                     }).append(e('<span/>').attr('class', 'ka ka16 ka-delete ka-red'))).append(e('<a/>').attr('rel', 'images_' + u).attr('class', 'galleryThumb').attr('href', i[n].link).fancybox().append(e('<img/>').attr('src', i[n].thumb_link))))
  2029.                                 } else {
  2030.                                     t(r, '[image=' + i[n].name + ']')
  2031.                                 }
  2032.                             }
  2033.                         }
  2034.                     });
  2035.                     a.find('.bbedit-smiles').click(function() {
  2036.                         if (e(r.ta).hasClass('activeSmiles')) {
  2037.                             e(r.ta).removeClass('activeSmiles')
  2038.                         } else {
  2039.                             e(r.ta).addClass('activeSmiles')
  2040.                         };
  2041.                         e('#' + u).toggle();
  2042.                         return !1
  2043.                     });
  2044.                     a.find('.bbedit-user').click(function() {
  2045.                         t(r, function(e) {
  2046.                             var t = prompt('Nickname: ', e);
  2047.                             if (t != null && t != '') {
  2048.                                 t = t.replace(/https?.+\/user\/([^\/]+)\/.*/, '$1');
  2049.                                 return '[user="' + t + '"]'
  2050.                             } else {
  2051.                                 return !1
  2052.                             }
  2053.                         })
  2054.                     });
  2055.                     a.find('.bbedit-torrent').click(function() {
  2056.                         t(r, function(e) {
  2057.                             var t = prompt('Torrent link, id or hash: ', e);
  2058.                             if (t != null && t != '') {
  2059.                                 t = t.replace(/https?.+t(\d+)\.html/, '$1');
  2060.                                 if ((/\d+/i.test(t)) || (/^[a-f0-9]{40}/i.test(t))) {
  2061.                                     return '[torrent=' + t + ']'
  2062.                                 };
  2063.                                 return 'Wrong torrent: ' + t
  2064.                             } else {
  2065.                                 return !1
  2066.                             }
  2067.                         })
  2068.                     });
  2069.                     a.find('.bbedit-preview').click(function() {
  2070.                         i(r, e(this).attr('data-preview'))
  2071.                     })
  2072.                 };
  2073.                 if (s.enableSmileybar) {
  2074.                     var f = e(l);
  2075.                     f.attr('id', u);
  2076.                     e(this).after(f);
  2077.                     f.hide();
  2078.                     for (var h in o) {
  2079.                         var d = f.find('.bbedit-' + o[h]);
  2080.                         d.click(function() {
  2081.                             t(r, '[:Q' + e(this).attr('class').replace(/bbedit-/, '') + ']')
  2082.                         })
  2083.                     }
  2084.                 }
  2085.             })
  2086.         }
  2087.     });
  2088.  
  2089.     function t(e, t, i) {
  2090.         var n = e.ta,
  2091.             r = e.selectionStart || n.selectionStart || 0,
  2092.             l = e.selectionEnd || n.selectionEnd || 0,
  2093.             a = n.value.substring(r, l),
  2094.             s;
  2095.         if (typeof t == 'function') {
  2096.             s = t(a);
  2097.             if (s === !1) {
  2098.                 return
  2099.             }
  2100.         } else {
  2101.             if (!i || i == '') {
  2102.                 s = a + t
  2103.             } else {
  2104.                 s = t + a + i
  2105.             }
  2106.         };
  2107.         n.value = n.value.substring(0, r) + s + n.value.substr(l);
  2108.         n.focus();
  2109.         if (typeof n.createTextRange != 'undefined') {
  2110.             var o = n.createTextRange();
  2111.             if (e.highlight) {
  2112.                 o.moveStart('character', r);
  2113.                 o.moveEnd('character', r + s.length)
  2114.             } else {
  2115.                 o.moveStart('character', r + s.length);
  2116.                 o.moveEnd('character', r + s.length)
  2117.             };
  2118.             o.select()
  2119.         } else if (typeof n.selectionStart != 'undefined') {
  2120.             if (e.highlight) {
  2121.                 n.selectionStart = r;
  2122.                 n.selectionEnd = r + s.length
  2123.             } else {
  2124.                 n.selectionStart = r + s.length;
  2125.                 n.selectionEnd = r + s.length
  2126.             }
  2127.         } else {
  2128.             n.value += s
  2129.         }
  2130.     };
  2131.  
  2132.     function n(t) {
  2133.         var i = t.find('[class*="bbedit-"]').attr('class').replace(/.*bbedit-/, ''),
  2134.             n = '<ul class="bbedit-menu ' + (i == 'color' ? 'bbedit-color-menu' : '') + '">';
  2135.         e.each(e.bbedit.menus[i], function(e, t) {
  2136.             if (i == 'color') {
  2137.                 n += '<li style="background-color:' + e + ';" class="bbedit-' + i + '-' + e + '" title="' + t + '"><span></span><i>' + t + '</i></li>'
  2138.             } else {
  2139.                 n += '<li class="ka ka-' + i + '-' + e + ' bbedit-' + i + '-' + e + '" title="' + t + '"><span></span><i>' + t + '</i></li>'
  2140.             }
  2141.         });
  2142.         t.append(n + '</ul>')
  2143.     };
  2144.  
  2145.     function i(t, i) {
  2146.         bbcode = t.ta.value;
  2147.         lastBBcode = t.lastBBcode;
  2148.         if (t.lastBBcode != bbcode) {
  2149.             if (bbcode.replace(/\s|\r|\t|\n/gm, '') != '') {
  2150.                 e.ajax({
  2151.                     'type': 'POST',
  2152.                     'url': '/preview.php',
  2153.                     'data': {
  2154.                         data: bbcode
  2155.                     },
  2156.                     beforeSend: function() {
  2157.                         e(i).show().html('<div class="center"><img src="/static/kar/images/indicator.gif" alt="loading"/></div>')
  2158.                     },
  2159.                     success: function(t) {
  2160.                         e(i).html(t);
  2161.                         e(i).find('.ajaxLink').fancybox()
  2162.                     }
  2163.                 })
  2164.             } else {
  2165.                 e(i).html('')
  2166.             };
  2167.             t.lastBBcode = bbcode
  2168.         }
  2169.     }
  2170. })(jQuery);
  2171. (function(e, t) {
  2172.     e.fn.fcbkcomplete = function(t) {
  2173.         return this.queue(function() {
  2174.             function z() {
  2175.                 L();
  2176.                 A(0)
  2177.             };
  2178.  
  2179.             function L() {
  2180.                 l = e('<ul class="holder textinput"></ul>').width(n.width);
  2181.                 if (n.attachto) {
  2182.                     if (typeof(n.attachto) == 'object') {
  2183.                         n.attachto.append(l)
  2184.                     } else {
  2185.                         e(n.attachto).append(l)
  2186.                     }
  2187.                 } else {
  2188.                     s.after(l)
  2189.                 };
  2190.                 c = e('<div class="facebook-auto">').width(n.width);
  2191.                 if (n.complete_text != '') {
  2192.                     var t = n.complete_text;
  2193.                     if (n.select_all_text) {
  2194.                         c.children('.default').append(e('<a href="" class="select_all_items">' + n.select_all_text + '</a>').click(function() {
  2195.                             e(s).trigger('selectAll');
  2196.                             return !1
  2197.                         }))
  2198.                     }
  2199.                 };
  2200.                 c.hover(function() {
  2201.                     D = 0
  2202.                 }, function() {
  2203.                     D = 1
  2204.                 });
  2205.                 r = e('<ul id="' + p + '_feed"></ul>').width(n.width);
  2206.                 l.after(c.prepend(r));
  2207.                 M()
  2208.             };
  2209.  
  2210.             function M() {
  2211.                 name = s.attr('name');
  2212.                 if (n.bricket) {
  2213.                     if (typeof(name) != 'undefined' && name.indexOf('[]') == -1) {
  2214.                         name = name + '[]'
  2215.                     }
  2216.                 };
  2217.                 var t = e('<' + s.get(0).tagName + ' name="' + name + '" id="' + p + '" multiple="multiple" class="' + s.get(0).className + ' hidden">').data('cache', {});
  2218.                 e.each(s.children('option'), function(i, n) {
  2219.                     n = e(n);
  2220.                     t.data('cache')[n.val()] = n.text();
  2221.                     if (n.hasClass('selected')) {
  2222.                         var s = u(n.text(), n.val(), !0, n.hasClass('locked'));
  2223.                         t.append('<option value="' + n.val() + '" selected="selected" id="opt_' + s + '"class="selected">' + n.text() + '</option>')
  2224.                     }
  2225.                 });
  2226.                 s.after(t);
  2227.                 s.remove();
  2228.                 s = t;
  2229.                 e(s).bind('addItem', function(e, t) {
  2230.                     u(t.title, t.value, 0, 0, 0)
  2231.                 });
  2232.                 e(s).bind('removeItem', function(e, t) {
  2233.                     var i = l.children('li[rel=' + t.value + ']');
  2234.                     if (i.length) {
  2235.                         b(i)
  2236.                     }
  2237.                 });
  2238.                 e(s).bind('destroy', function(e, t) {
  2239.                     l.remove();
  2240.                     c.remove();
  2241.                     s.show()
  2242.                 });
  2243.                 e(s).bind('selectAll', function(t, i) {
  2244.                     var n = e(s).val() || [];
  2245.                     e.each(e(s).data('cache'), function(t, i) {
  2246.                         if (e.inArray(t, n) === -1) {
  2247.                             u(i, t, 0, 0, 0)
  2248.                         }
  2249.                     });
  2250.                     r.parent().hide()
  2251.                 })
  2252.             };
  2253.  
  2254.             function u(t, i, r, o, a) {
  2255.                 if (!m()) {
  2256.                     return !1
  2257.                 };
  2258.                 var g = 'bit-box' + (o ? ' locked' : ''),
  2259.                     c = O(),
  2260.                     y = document.createTextNode(h(t)),
  2261.                     u = e('<a class="closebutton" href="#"></a>'),
  2262.                     d = e('<li class="' + g + '" rel="' + i + '" id="pt_' + c + '"></li>').prepend(y).append(u);
  2263.                 l.append(d);
  2264.                 u.click(function() {
  2265.                     b(e(this).parent('li'));
  2266.                     return !1
  2267.                 });
  2268.                 if (!r) {
  2269.                     e('#' + p + '_annoninput').remove();
  2270.                     A(a);
  2271.                     var f = e('<option value="' + h(i) + '" id="opt_' + c + '" class="selected" selected="selected">' + h(t) + '</option>');
  2272.                     s.append(f);
  2273.                     if (n.onselect) {
  2274.                         S(n.onselect, f)
  2275.                     };
  2276.                     s.change()
  2277.                 };
  2278.                 l.children('li.bit-box.deleted').removeClass('deleted');
  2279.                 v(1);
  2280.                 return c
  2281.             };
  2282.  
  2283.             function b(t) {
  2284.                 if (!t.hasClass('locked')) {
  2285.                     t.fadeOut('fast');
  2286.                     var i = t.attr('id');
  2287.                     if (n.onremove) {
  2288.                         var r = i ? e('#o' + i + '') : s.children('option[value=' + t.attr('rel') + ']');
  2289.                         S(n.onremove, r)
  2290.                     };
  2291.                     if (i) {
  2292.                         e('#o' + i + '').remove()
  2293.                     } else {
  2294.                         s.children('option[value="' + t.attr('rel') + '"]').remove()
  2295.                     };
  2296.                     t.remove();
  2297.                     s.change();
  2298.                     C = 0
  2299.                 }
  2300.             };
  2301.  
  2302.             function A(t) {
  2303.                 var s = e('<li class="bit-input" id="' + p + '_annoninput">'),
  2304.                     i = e('<input type="text" class="maininput" size="' + n.input_min_size + '" autocomplete="off">');
  2305.                 if (n.input_tabindex > 0) i.attr('tabindex', n.input_tabindex);
  2306.                 if (n.input_name != '') i.attr('name', n.input_name);
  2307.                 l.append(s.append(i));
  2308.                 i.focus(function() {
  2309.                     P = !0;
  2310.                     if (m()) {
  2311.                         c.fadeIn('fast')
  2312.                     }
  2313.                 });
  2314.                 i.blur(function() {
  2315.                     P = !1;
  2316.                     if (D) {
  2317.                         c.fadeOut('fast')
  2318.                     } else {}
  2319.                 });
  2320.                 l.click(function() {
  2321.                     if (n.input_min_size < 0 && r.length) {
  2322.                         E(d(i.val(), 1))
  2323.                     };
  2324.                     i.focus();
  2325.                     if (r.length && i.val().length > n.input_min_size) {
  2326.                         r.show()
  2327.                     } else {
  2328.                         v(1);
  2329.                         c.children('.default').show()
  2330.                     }
  2331.                 });
  2332.                 i.keypress(function(e) {
  2333.                     if (e.keyCode == a.enter) {
  2334.                         return !1
  2335.                     };
  2336.                     var t = (n.input_min_size > i.val().length) ? n.input_min_size : (i.val().length + 1);
  2337.                     i.attr('size', t).width(parseInt(i.css('font-size')) * t)
  2338.                 });
  2339.                 i.keyup(function(t) {
  2340.                     var s = d(i.val(), 1);
  2341.                     if (t.keyCode == a.backspace && s.length == 0) {
  2342.                         v(1);
  2343.                         if (!l.children('li.bit-box:last').hasClass('locked')) {
  2344.                             if (l.children('li.bit-box.deleted').length == 0) {
  2345.                                 l.children('li.bit-box:last').addClass('deleted');
  2346.                                 return !1
  2347.                             } else {
  2348.                                 if (C) {
  2349.                                     return
  2350.                                 };
  2351.                                 C = 1;
  2352.                                 l.children('li.bit-box.deleted').fadeOut('fast', function() {
  2353.                                     b(e(this));
  2354.                                     return !1
  2355.                                 })
  2356.                             }
  2357.                         }
  2358.                     };
  2359.                     if (t.keyCode != a.downarrow && t.keyCode != a.uparrow && t.keyCode != a.leftarrow && t.keyCode != a.rightarrow && s.length >= n.input_min_size) {
  2360.                         E(s);
  2361.                         c.children('.default').hide();
  2362.                         r.show()
  2363.                     }
  2364.                 });
  2365.                 if (n.oncreate) {
  2366.                     S(n.oncreate, i)
  2367.                 };
  2368.                 if (t) {
  2369.                     setTimeout(function() {
  2370.                         i.focus();
  2371.                         c.children('.default').show()
  2372.                     }, 1)
  2373.                 }
  2374.             };
  2375.  
  2376.             function x(t, i) {
  2377.                 r.html('');
  2378.                 if (!n.cache && i != null) {
  2379.                     f.clear()
  2380.                 };
  2381.                 H(t);
  2382.                 if (i != null && i.length) {
  2383.                     e.each(i, function(e, t) {
  2384.                         f.set(d(t.key), d(t.value))
  2385.                     })
  2386.                 };
  2387.                 var l = n.maxshownitems < f.length() ? n.maxshownitems : f.length(),
  2388.                     a = '';
  2389.                 e.each(f.search(t), function(e, i) {
  2390.                     if (l) {
  2391.                         if (n.filter_selected && s.children('option[value="' + i.key + '"]').hasClass('selected')) {} else {
  2392.                             a += '<li rel="' + i.key + '">' + h(F(i.value, t)) + '</li>';
  2393.                             g++;
  2394.                             l--
  2395.                         }
  2396.                     }
  2397.                 });
  2398.                 r.append(a);
  2399.                 if (n.firstselected) {
  2400.                     o = r.children('li:visible:first');
  2401.                     o.addClass('auto-focus')
  2402.                 };
  2403.                 if (g > n.height) {
  2404.                     r.css({
  2405.                         'height': (n.height * 24) + 'px',
  2406.                         'overflow': 'auto'
  2407.                     })
  2408.                 } else {
  2409.                     r.css('height', 'auto')
  2410.                 };
  2411.                 if (m() && c.is(':hidden')) {
  2412.                     c.show()
  2413.                 }
  2414.             };
  2415.  
  2416.             function F(e, t) {
  2417.                 var r = n.filter_begin ? '' : '(.*)',
  2418.                     a = n.filter_begin ? '<em>$1</em>$2' : '$1<em>$2</em>$3',
  2419.                     s = r + (n.filter_case ? '(' + t + ')(.*)' : '(' + t.toLowerCase() + ')(.*)');
  2420.                 try {
  2421.                     var o = new RegExp(s, ((n.filter_case) ? 'g' : 'gi')),
  2422.                         e = e.replace(o, a)
  2423.                 } catch (i) {};
  2424.                 return e
  2425.             };
  2426.  
  2427.             function N() {
  2428.                 r.children('li').mouseover(function() {
  2429.                     r.children('li').removeClass('auto-focus');
  2430.                     o = e(this);
  2431.                     o.addClass('auto-focus')
  2432.                 });
  2433.                 r.children('li').mouseout(function() {
  2434.                     e(this).removeClass('auto-focus');
  2435.                     o = null
  2436.                 })
  2437.             };
  2438.  
  2439.             function W() {
  2440.                 r.unbind('mouseover').unbind('mouseout').mousemove(function() {
  2441.                     N();
  2442.                     r.unbind('mousemove')
  2443.                 })
  2444.             };
  2445.  
  2446.             function w() {
  2447.                 var t = e('#' + p + '_annoninput').children('.maininput');
  2448.                 N();
  2449.                 r.children('li').unbind('mousedown').mousedown(function() {
  2450.                     var t = e(this);
  2451.                     u(t.text(), t.attr('rel'), 0, 0, 1);
  2452.                     v(1);
  2453.                     c.hide()
  2454.                 });
  2455.                 t.unbind('keydown');
  2456.                 t.keydown(function(t) {
  2457.                     if (t.keyCode != a.backspace) {
  2458.                         l.children('li.bit-box.deleted').removeClass('deleted')
  2459.                     };
  2460.                     if ((t.keyCode == a.enter || t.keyCode == a.tab || t.keyCode == a.comma) && I()) {
  2461.                         var i = o;
  2462.                         u(i.text(), i.attr('rel'), 0, 0, 1);
  2463.                         return y(t)
  2464.                     };
  2465.                     if ((t.keyCode == a.enter || t.keyCode == a.tab || t.keyCode == a.comma) && !I()) {
  2466.                         if (n.newel) {
  2467.                             var s = d(e(this).val());
  2468.                             u(s, s, 0, 0, 1);
  2469.                             return y(t)
  2470.                         };
  2471.                         if ((n.addontab || n.addoncomma) && n.newel) {
  2472.                             o = r.children('li:visible:first');
  2473.                             var i = o;
  2474.                             u(i.text(), i.attr('rel'), 0, 0, 1);
  2475.                             return y(t)
  2476.                         }
  2477.                     };
  2478.                     if (t.keyCode == a.downarrow) {
  2479.                         j('first')
  2480.                     };
  2481.                     if (t.keyCode == a.uparrow) {
  2482.                         j('last')
  2483.                     }
  2484.                 })
  2485.             };
  2486.  
  2487.             function j(e) {
  2488.                 W();
  2489.                 if (o == null || o.length == 0) {
  2490.                     o = r.children('li:visible:' + e);
  2491.                     r.get(0).scrollTop = e == 'first' ? 0 : parseInt(o.get(0).scrollHeight, 10) * (parseInt(r.children('li:visible').length, 10) - Math.round(n.height / 2))
  2492.                 } else {
  2493.                     o.removeClass('auto-focus');
  2494.                     o = e == 'first' ? o.nextAll('li:visible:first') : o.prevAll('li:visible:first');
  2495.                     var t = parseInt(o.prevAll('li:visible').length, 10),
  2496.                         i = parseInt(o.nextAll('li:visible').length, 10);
  2497.                     if (((e == 'first' ? t : i) > Math.round(n.height / 2) || (e == 'first' ? t : i) <= Math.round(n.height / 2)) && typeof(o.get(0)) != 'undefined') {
  2498.                         r.get(0).scrollTop = parseInt(o.get(0).scrollHeight, 10) * (t - Math.round(n.height / 2))
  2499.                     }
  2500.                 };
  2501.                 r.children('li').removeClass('auto-focus');
  2502.                 o.addClass('auto-focus')
  2503.             };
  2504.  
  2505.             function y(e) {
  2506.                 c.hide();
  2507.                 e.preventDefault();
  2508.                 o = null;
  2509.                 return !1
  2510.             };
  2511.  
  2512.             function m() {
  2513.                 return n.maxitems != 0 && (l.children('li.bit-box').length < n.maxitems)
  2514.             };
  2515.  
  2516.             function H(t) {
  2517.                 if (n.newel && m()) {
  2518.                     r.children('li[fckb=1]').remove();
  2519.                     if (t.length == 0) {
  2520.                         return
  2521.                     };
  2522.                     var i = e('<li rel="' + t + '" fckb="1">').html(h(t));
  2523.                     r.prepend(i);
  2524.                     g++
  2525.                 };
  2526.                 return
  2527.             };
  2528.  
  2529.             function S(e, t) {
  2530.                 var n = {};
  2531.                 for (i = 0; i < t.get(0).attributes.length; i++) {
  2532.                     if (t.get(0).attributes[i].nodeValue != null) {
  2533.                         n['_' + t.get(0).attributes[i].nodeName] = t.get(0).attributes[i].nodeValue
  2534.                     }
  2535.                 };
  2536.                 return e.call(e, n)
  2537.             };
  2538.  
  2539.             function I() {
  2540.                 if (o == null || o.length == 0) {
  2541.                     return !1
  2542.                 };
  2543.                 return !0
  2544.             };
  2545.  
  2546.             function d(e, t) {
  2547.                 if (typeof t != 'undefined') {
  2548.                     for (i = 0; i < e.length; i++) {
  2549.                         var n = e.charCodeAt(i);
  2550.                         if ((a.exclamation <= n && n <= a.slash) || (a.colon <= n && n <= a.at) || (a.squarebricket_left <= n && n <= a.apostrof)) {
  2551.                             e = e.replace(e[i], escape(e[i]))
  2552.                         }
  2553.                     };
  2554.                     e = e.replace(/(\{|\}|\*)/i, '\\$1')
  2555.                 };
  2556.                 return e.replace(/script(.*)/g, '')
  2557.             };
  2558.  
  2559.             function h(e, t) {
  2560.                 e = e.toString();
  2561.                 e = e.replace('\\', '');
  2562.                 if (typeof t != 'undefined') {
  2563.                     return e
  2564.                 };
  2565.                 return unescape(e)
  2566.             };
  2567.  
  2568.             function v(e) {
  2569.                 r.children().remove();
  2570.                 if (e) {
  2571.                     r.hide()
  2572.                 }
  2573.             };
  2574.  
  2575.             function E(t) {
  2576.                 g = 0;
  2577.                 if (n.json_url && m()) {
  2578.                     if (n.cache && k.get(t)) {
  2579.                         x(t);
  2580.                         w()
  2581.                     } else {
  2582.                         T++;
  2583.                         var i = T;
  2584.                         setTimeout(function() {
  2585.                             if (i != T) return;
  2586.                             e.getJSON(n.json_url, {
  2587.                                 'tag': h(t)
  2588.                             }, function(e) {
  2589.                                 if (!P) return;
  2590.                                 x(t, e);
  2591.                                 k.set(t, 1);
  2592.                                 w()
  2593.                             })
  2594.                         }, n.delay)
  2595.                     }
  2596.                 } else {
  2597.                     x(t);
  2598.                     w()
  2599.                 }
  2600.             };
  2601.             var n = e.extend({
  2602.                 json_url: null,
  2603.                 width: 522,
  2604.                 cache: !1,
  2605.                 height: '10',
  2606.                 newel: !1,
  2607.                 addontab: !1,
  2608.                 addoncomma: !1,
  2609.                 firstselected: !1,
  2610.                 filter_case: !1,
  2611.                 filter_selected: !1,
  2612.                 filter_begin: !1,
  2613.                 complete_text: 'Start to type...',
  2614.                 select_all_text: null,
  2615.                 maxshownitems: 30,
  2616.                 maxitems: 10,
  2617.                 oncreate: null,
  2618.                 onselect: null,
  2619.                 onremove: null,
  2620.                 attachto: null,
  2621.                 delay: 350,
  2622.                 input_tabindex: 0,
  2623.                 input_min_size: 1,
  2624.                 input_name: '',
  2625.                 bricket: !0
  2626.             }, t);
  2627.             var l = null,
  2628.                 r = null,
  2629.                 c = null,
  2630.                 g = 0,
  2631.                 P = !1,
  2632.                 o = null,
  2633.                 C = 0,
  2634.                 D = 1,
  2635.                 s = e(this),
  2636.                 p = s.attr('id'),
  2637.                 T = 0,
  2638.                 k = {
  2639.                     'set': function(e, t) {
  2640.                         var i = s.data('jsoncache');
  2641.                         i[e] = t;
  2642.                         s.data('jsoncache', i)
  2643.                     },
  2644.                     'get': function(e) {
  2645.                         return s.data('jsoncache')[e] != 'undefined' ? s.data('jsoncache')[e] : null
  2646.                     },
  2647.                     'init': function() {
  2648.                         s.data('jsoncache', {})
  2649.                     }
  2650.                 };
  2651.             var a = {
  2652.                 'enter': 13,
  2653.                 'tab': 9,
  2654.                 'comma': 188,
  2655.                 'backspace': 8,
  2656.                 'leftarrow': 37,
  2657.                 'uparrow': 38,
  2658.                 'rightarrow': 39,
  2659.                 'downarrow': 40,
  2660.                 'exclamation': 33,
  2661.                 'slash': 47,
  2662.                 'colon': 58,
  2663.                 'at': 64,
  2664.                 'squarebricket_left': 91,
  2665.                 'apostrof': 96
  2666.             };
  2667.             var O = function() {
  2668.                     var t = '0123456789ABCDEFGHIJKLMNOPQRSTUVWXTZabcdefghiklmnopqrstuvwxyz',
  2669.                         e = '';
  2670.                     for (var i = 0; i < 32; i++) {
  2671.                         var n = Math.floor(Math.random() * t.length);
  2672.                         e += t.substring(n, n + 1)
  2673.                     };
  2674.                     return e
  2675.                 },
  2676.                 f = {
  2677.                     'search': function(t, i) {
  2678.                         var r = [],
  2679.                             o = new RegExp((n.filter_begin ? '^' : '') + t, (n.filter_case ? 'g' : 'gi'));
  2680.                         e.each(s.data('cache'), function(e, t) {
  2681.                             if (typeof t.search === 'function') {
  2682.                                 if (t.search(o) != -1) {
  2683.                                     r.push({
  2684.                                         'key': e,
  2685.                                         'value': t
  2686.                                     })
  2687.                                 }
  2688.                             }
  2689.                         });
  2690.                         return r
  2691.                     },
  2692.                     'set': function(e, t) {
  2693.                         var i = s.data('cache');
  2694.                         i[e] = t;
  2695.                         s.data('cache', i)
  2696.                     },
  2697.                     'get': function(e) {
  2698.                         return s.data('cache')[e] != 'undefined' ? s.data('cache')[e] : null
  2699.                     },
  2700.                     'clear': function() {
  2701.                         s.data('cache', {})
  2702.                     },
  2703.                     'length': function() {
  2704.                         if (typeof(s.data('cache')) == 'object') {
  2705.                             var e = 0;
  2706.                             for (i in s.data('cache')) {
  2707.                                 e++
  2708.                             };
  2709.                             return e
  2710.                         } else {
  2711.                             return s.data('cache').length
  2712.                         }
  2713.                     },
  2714.                     'init': function() {
  2715.                         if (s.data('cache') == 'undefined') {
  2716.                             s.data('cache', {})
  2717.                         }
  2718.                     }
  2719.                 };
  2720.             z();
  2721.             k.init();
  2722.             f.init();
  2723.             return this
  2724.         })
  2725.     }
  2726. })(jQuery);
  2727. (function(e) {
  2728.     e.fn.tooManyTabs = function(t) {
  2729.         var i = this,
  2730.             s = {
  2731.                 moreTabSelector: '.more-tab',
  2732.                 dropdownSelector: '.menu-more',
  2733.                 tabSelector: 'li:not(.action-tab, .drop-tab, .plus-tab)',
  2734.                 excludeSelector: '.action-tab:visible'
  2735.             };
  2736.         var r = 2;
  2737.         i.readjustTabs = function() {
  2738.             i.G$ = e(i.config.moreTabSelector, this);
  2739.             i.ht$ = e(i.config.dropdownSelector, this);
  2740.             var o = i.G$.outerWidth();
  2741.             i.G$.hide();
  2742.             var n = e(e(i.config.tabSelector, this).get().reverse());
  2743.             n.show();
  2744.             var r = (kat.mobile ? 0 : 20);
  2745.             e(i.config.excludeSelector, this).each(function() {
  2746.                 r += parseInt(e(this).outerWidth())
  2747.             });
  2748.             var a = e(window).width(),
  2749.                 s = a - r,
  2750.                 t = 0;
  2751.             n.each(function() {
  2752.                 t += parseInt(e(this).outerWidth())
  2753.             });
  2754.             i.freeRatio = Math.round(s / t);
  2755.             if (t > s) {
  2756.                 i.ht$.html('');
  2757.                 i.G$.show();
  2758.                 s -= o;
  2759.                 n.each(function() {
  2760.                     if (t < s) {
  2761.                         return !1
  2762.                     } else {
  2763.                         t -= e(this).outerWidth();
  2764.                         i.addTabToDropdown(e(this));
  2765.                         e(this).hide()
  2766.                     }
  2767.                 });
  2768.                 i.G$.hover(function() {
  2769.                     clearTimeout(e.data(this, 'timer'));
  2770.                     e('ul', this).stop(!0, !0).slideDown(200)
  2771.                 }, function() {
  2772.                     e.data(this, 'timer', setTimeout(e.proxy(function() {
  2773.                         e('ul', this).stop(!0, !0).slideUp(200)
  2774.                     }, this), 200))
  2775.                 })
  2776.             } else {
  2777.                 i.G$.hide();
  2778.                 n.show()
  2779.             }
  2780.         };
  2781.         i.addTabToDropdown = function(t) {
  2782.             var n = e('<li class=\'drop-tab\'>' + t.html() + '</li>');
  2783.             n.click(function() {
  2784.                 t.triggerHandler('click');
  2785.                 e(this).remove()
  2786.             });
  2787.             i.ht$.append(n)
  2788.         };
  2789.         i.bindEvents = function() {
  2790.             e(window).resize(function() {
  2791.                 i.readjustTabs()
  2792.             })
  2793.         };
  2794.         var n = function(t) {
  2795.                 i.config = e.extend({}, s, t);
  2796.                 i.bindEvents();
  2797.                 i.readjustTabs()
  2798.             };
  2799.         n(t)
  2800.     }
  2801. })(jQuery);
  2802. (function(e) {
  2803.     if (typeof define === 'function' && define.amd) {
  2804.         define(['jquery'], e)
  2805.     } else if (typeof module === 'object' && typeof module.exports === 'object') {
  2806.         e(require('jquery'))
  2807.     } else {
  2808.         e(jQuery)
  2809.     }
  2810. }(function(e) {
  2811.     e.timeago = function(t) {
  2812.         if (t instanceof Date) {
  2813.             return i(t)
  2814.         } else if (typeof t === 'string') {
  2815.             return i(e.timeago.parse(t))
  2816.         } else if (typeof t === 'number') {
  2817.             return i(new Date(t))
  2818.         } else {
  2819.             return i(e.timeago.datetime(t))
  2820.         }
  2821.     };
  2822.     var t = e.timeago;
  2823.     e.extend(e.timeago, {
  2824.         settings: {
  2825.             refreshMillis: 60000,
  2826.             allowPast: !0,
  2827.             allowFuture: !1,
  2828.             localeTitle: !1,
  2829.             cutoff: 0,
  2830.             strings: {
  2831.                 prefixAgo: null,
  2832.                 prefixFromNow: null,
  2833.                 suffixAgo: 'ago',
  2834.                 suffixFromNow: 'from now',
  2835.                 inPast: 'any moment now',
  2836.                 seconds: '%d seconds',
  2837.                 minute: 'a minute',
  2838.                 minutes: '%d minutes',
  2839.                 hour: 'an hour',
  2840.                 hours: '%d&nbsp;hours',
  2841.                 day: 'a day',
  2842.                 days: '%d&nbsp;days',
  2843.                 month: 'about a month',
  2844.                 months: '%d months',
  2845.                 year: 'about a year',
  2846.                 years: '%d&nbsp;years',
  2847.                 wordSeparator: ' ',
  2848.                 numbers: []
  2849.             },
  2850.             addAgo: !0
  2851.         },
  2852.         inWords: function(t) {
  2853.             if (!this.settings.allowPast && !this.settings.allowFuture) {
  2854.                 throw 'timeago allowPast and allowFuture settings can not both be set to false.';
  2855.             };
  2856.             var i = this.settings.strings,
  2857.                 l = i.prefixAgo,
  2858.                 c = this.settings.addAgo ? i.suffixAgo : '';
  2859.             if (this.settings.allowFuture) {
  2860.                 if (t < 0) {
  2861.                     l = i.prefixFromNow;
  2862.                     c = i.suffixFromNow
  2863.                 }
  2864.             };
  2865.             if (!this.settings.allowPast && t >= 0) {
  2866.                 return this.settings.strings.inPast
  2867.             };
  2868.             var a = Math.abs(t) / 1000,
  2869.                 o = a / 60,
  2870.                 r = o / 60,
  2871.                 s = r / 24,
  2872.                 f = s / 365;
  2873.  
  2874.             function n(n, s) {
  2875.                 var o = e.isFunction(n) ? n(s, t) : n,
  2876.                     r = (i.numbers && i.numbers[s]) || s;
  2877.                 return o.replace(/%d/i, r)
  2878.             };
  2879.             var h = a < 45 && n(i.seconds, Math.round(a)) || a < 90 && n(i.minute, 1) || o < 45 && n(i.minutes, Math.round(o)) || o < 90 && n(i.hour, 1) || r < 24 && n(i.hours, Math.round(r)) || r < 42 && n(i.day, 1) || s < 30 && n(i.days, Math.round(s)) || s < 45 && n(i.month, 1) || s < 365 && n(i.months, Math.round(s / 30)) || f < 1.5 && n(i.year, 1) || n(i.years, Math.round(f)),
  2880.                 u = i.wordSeparator || '';
  2881.             if (i.wordSeparator === undefined) {
  2882.                 u = ' '
  2883.             };
  2884.             return e.trim([l, h, c].join(u))
  2885.         },
  2886.         parse: function(t) {
  2887.             var i = e.trim(t);
  2888.             i = i.replace(/\.\d+/, '');
  2889.             i = i.replace(/-/, '/').replace(/-/, '/');
  2890.             i = i.replace(/T/, ' ').replace(/Z/, ' UTC');
  2891.             i = i.replace(/([\+\-]\d\d)\:?(\d\d)/, ' $1$2');
  2892.             i = i.replace(/([\+\-]\d\d)$/, ' $100');
  2893.             return new Date(i)
  2894.         },
  2895.         datetime: function(i) {
  2896.             var n = t.isTime(i) ? e(i).attr('datetime') : e(i).attr('title');
  2897.             return t.parse(n)
  2898.         },
  2899.         isTime: function(t) {
  2900.             return e(t).get(0).tagName.toLowerCase() === 'time'
  2901.         }
  2902.     });
  2903.     var r = {
  2904.         init: function() {
  2905.             var i = e.proxy(n, this);
  2906.             i();
  2907.             var s = t.settings;
  2908.             if (s.refreshMillis > 0) {
  2909.                 this.ve$ = setInterval(i, s.refreshMillis)
  2910.             }
  2911.         },
  2912.         update: function(i) {
  2913.             var s = t.parse(i);
  2914.             e(this).data('timeago', {
  2915.                 datetime: s
  2916.             });
  2917.             if (t.settings.localeTitle) e(this).attr('title', s.toLocaleString());
  2918.             n.apply(this)
  2919.         },
  2920.         updateFromDOM: function() {
  2921.             e(this).data('timeago', {
  2922.                 datetime: t.parse(t.isTime(this) ? e(this).attr('datetime') : e(this).attr('title'))
  2923.             });
  2924.             n.apply(this)
  2925.         },
  2926.         dispose: function() {
  2927.             if (this.ve$) {
  2928.                 window.clearInterval(this.ve$);
  2929.                 this.ve$ = null
  2930.             }
  2931.         }
  2932.     };
  2933.     e.fn.timeago = function(e, t) {
  2934.         var i = e ? r[e] : r.init;
  2935.         if (!i) {
  2936.             throw new Error('Unknown function name \'' + e + '\' for timeago');
  2937.         };
  2938.         this.each(function() {
  2939.             i.call(this, t)
  2940.         });
  2941.         return this
  2942.     };
  2943.  
  2944.     function n() {
  2945.         if (!e.contains(document.documentElement, this)) {
  2946.             e(this).timeago('dispose');
  2947.             return this
  2948.         };
  2949.         var n = o(this),
  2950.             r = t.settings;
  2951.         if (!isNaN(n.datetime)) {
  2952.             if (r.cutoff == 0 || Math.abs(s(n.datetime)) < r.cutoff) {
  2953.                 e(this).html(i(n.datetime))
  2954.             }
  2955.         };
  2956.         return this
  2957.     };
  2958.  
  2959.     function o(i) {
  2960.         i = e(i);
  2961.         t.settings.addAgo = !i.data('age');
  2962.         if (!i.data('timeago')) {
  2963.             i.data('timeago', {
  2964.                 datetime: t.datetime(i)
  2965.             });
  2966.             var n = e.trim(i.text());
  2967.             if (t.settings.localeTitle) {
  2968.                 i.attr('title', i.data('timeago').datetime.toLocaleString())
  2969.             } else if (n.length > 0 && !(t.isTime(i) && i.attr('title'))) {
  2970.                 i.attr('title', n)
  2971.             }
  2972.         };
  2973.         return i.data('timeago')
  2974.     };
  2975.  
  2976.     function i(e) {
  2977.         return t.inWords(s(e))
  2978.     };
  2979.  
  2980.     function s(e) {
  2981.         return (new Date().getTime() - e.getTime())
  2982.     };
  2983.     document.createElement('abbr');
  2984.     document.createElement('time')
  2985. }));
  2986. (function(e, t) {
  2987.     'use strict';
  2988.     t.State = {
  2989.         COOKIE_NAME: 'state',
  2990.         last: 0,
  2991.         get: function() {
  2992.             return e.cookie(this.COOKIE_NAME)
  2993.         },
  2994.         set: function(t) {
  2995.             e.cookie(this.COOKIE_NAME, t, {
  2996.                 path: '/'
  2997.             })
  2998.         },
  2999.         update: function() {
  3000.             this.last = new Date().getTime();
  3001.             this.set(this.last)
  3002.         },
  3003.         init: function() {
  3004.             var i = this;
  3005.             if (!this.get()) {
  3006.                 this.update()
  3007.             };
  3008.             e(t).focus(function() {
  3009.                 i.update()
  3010.             })
  3011.         },
  3012.         isCurrent: function() {
  3013.             return (this.last == this.get())
  3014.         },
  3015.         run: function(e) {
  3016.             if (this.isCurrent()) {
  3017.                 e()
  3018.             }
  3019.         }
  3020.     };
  3021.     State.init()
  3022. })(jQuery, window);
  3023. (function(e, t, i, n) {
  3024.     var s = e(t);
  3025.     e.fn.lazyload = function(r) {
  3026.         var a = this,
  3027.             c, o = {
  3028.                 threshold: 0,
  3029.                 failure_limit: 0,
  3030.                 event: 'scroll',
  3031.                 effect: 'show',
  3032.                 container: t,
  3033.                 data_attribute: 'original',
  3034.                 skip_invisible: !0,
  3035.                 appear: null,
  3036.                 load: null,
  3037.                 placeholder: 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsQAAA7EAZUrDhsAAAANSURBVBhXYzh8+PB/AAffA0nNPuCLAAAAAElFTkSuQmCC'
  3038.             };
  3039.  
  3040.         function l() {
  3041.             var t = 0;
  3042.             a.each(function() {
  3043.                 var i = e(this);
  3044.                 if (o.skip_invisible && !i.is(':visible')) {
  3045.                     return
  3046.                 };
  3047.                 if (e.abovethetop(this, o) || e.leftofbegin(this, o)) {} else if (!e.belowthefold(this, o) && !e.rightoffold(this, o)) {
  3048.                     i.trigger('appear');
  3049.                     t = 0
  3050.                 } else {
  3051.                     if (++t > o.failure_limit) {
  3052.                         return !1
  3053.                     }
  3054.                 }
  3055.             })
  3056.         };
  3057.         if (r) {
  3058.             if (n !== r.failurelimit) {
  3059.                 r.failure_limit = r.failurelimit;
  3060.                 delete r.failurelimit
  3061.             };
  3062.             if (n !== r.effectspeed) {
  3063.                 r.effect_speed = r.effectspeed;
  3064.                 delete r.effectspeed
  3065.             };
  3066.             e.extend(o, r)
  3067.         };
  3068.         c = (o.container === n || o.container === t) ? s : e(o.container);
  3069.         if (0 === o.event.indexOf('scroll')) {
  3070.             c.bind(o.event, function() {
  3071.                 return l()
  3072.             })
  3073.         };
  3074.         this.each(function() {
  3075.             var i = this,
  3076.                 t = e(i);
  3077.             i.loaded = !1;
  3078.             if (t.attr('src') === n || t.attr('src') === !1) {
  3079.                 t.attr('src', o.placeholder)
  3080.             };
  3081.             t.one('appear', function() {
  3082.                 if (!this.loaded) {
  3083.                     if (o.appear) {
  3084.                         var n = a.length;
  3085.                         o.appear.call(i, n, o)
  3086.                     };
  3087.                     e('<img />').bind('load', function() {
  3088.                         var n = t.data(o.data_attribute);
  3089.                         t.hide();
  3090.                         if (t.is('img')) {
  3091.                             t.attr('src', n)
  3092.                         } else {
  3093.                             t.css('background-image', 'url(\'' + n + '\')')
  3094.                         };
  3095.                         t[o.effect](o.effect_speed);
  3096.                         i.loaded = !0;
  3097.                         var s = e.grep(a, function(e) {
  3098.                             return !e.loaded
  3099.                         });
  3100.                         a = e(s);
  3101.                         if (o.load) {
  3102.                             var r = a.length;
  3103.                             o.load.call(i, r, o)
  3104.                         }
  3105.                     }).attr('src', t.data(o.data_attribute))
  3106.                 }
  3107.             });
  3108.             if (0 !== o.event.indexOf('scroll')) {
  3109.                 t.bind(o.event, function() {
  3110.                     if (!i.loaded) {
  3111.                         t.trigger('appear')
  3112.                     }
  3113.                 })
  3114.             }
  3115.         });
  3116.         s.bind('resize', function() {
  3117.             l()
  3118.         });
  3119.         if ((/iphone|ipod|ipad.*os 5/gi).test(navigator.appVersion)) {
  3120.             s.bind('pageshow', function(t) {
  3121.                 if (t.originalEvent && t.originalEvent.persisted) {
  3122.                     a.each(function() {
  3123.                         e(this).trigger('appear')
  3124.                     })
  3125.                 }
  3126.             })
  3127.         };
  3128.         e(i).ready(function() {
  3129.             l()
  3130.         });
  3131.         return this
  3132.     };
  3133.     e.belowthefold = function(i, r) {
  3134.         var o;
  3135.         if (r.container === n || r.container === t) {
  3136.             o = (t.innerHeight ? t.innerHeight : s.height()) + s.scrollTop()
  3137.         } else {
  3138.             o = e(r.container).offset().top + e(r.container).height()
  3139.         };
  3140.         return o <= e(i).offset().top - r.threshold
  3141.     };
  3142.     e.rightoffold = function(i, r) {
  3143.         var o;
  3144.         if (r.container === n || r.container === t) {
  3145.             o = s.width() + s.scrollLeft()
  3146.         } else {
  3147.             o = e(r.container).offset().left + e(r.container).width()
  3148.         };
  3149.         return o <= e(i).offset().left - r.threshold
  3150.     };
  3151.     e.abovethetop = function(i, r) {
  3152.         var o;
  3153.         if (r.container === n || r.container === t) {
  3154.             o = s.scrollTop()
  3155.         } else {
  3156.             o = e(r.container).offset().top
  3157.         };
  3158.         return o >= e(i).offset().top + r.threshold + e(i).height()
  3159.     };
  3160.     e.leftofbegin = function(i, r) {
  3161.         var o;
  3162.         if (r.container === n || r.container === t) {
  3163.             o = s.scrollLeft()
  3164.         } else {
  3165.             o = e(r.container).offset().left
  3166.         };
  3167.         return o >= e(i).offset().left + r.threshold + e(i).width()
  3168.     };
  3169.     e.inviewport = function(t, i) {
  3170.         return !e.rightoffold(t, i) && !e.leftofbegin(t, i) && !e.belowthefold(t, i) && !e.abovethetop(t, i)
  3171.     };
  3172.     e.extend(e.expr[':'], {
  3173.         'below-the-fold': function(t) {
  3174.             return e.belowthefold(t, {
  3175.                 threshold: 0
  3176.             })
  3177.         },
  3178.         'above-the-top': function(t) {
  3179.             return !e.belowthefold(t, {
  3180.                 threshold: 0
  3181.             })
  3182.         },
  3183.         'right-of-screen': function(t) {
  3184.             return e.rightoffold(t, {
  3185.                 threshold: 0
  3186.             })
  3187.         },
  3188.         'left-of-screen': function(t) {
  3189.             return !e.rightoffold(t, {
  3190.                 threshold: 0
  3191.             })
  3192.         },
  3193.         'in-viewport': function(t) {
  3194.             return e.inviewport(t, {
  3195.                 threshold: 0
  3196.             })
  3197.         },
  3198.         'above-the-fold': function(t) {
  3199.             return !e.belowthefold(t, {
  3200.                 threshold: 0
  3201.             })
  3202.         },
  3203.         'right-of-fold': function(t) {
  3204.             return e.rightoffold(t, {
  3205.                 threshold: 0
  3206.             })
  3207.         },
  3208.         'left-of-fold': function(t) {
  3209.             return !e.rightoffold(t, {
  3210.                 threshold: 0
  3211.             })
  3212.         }
  3213.     })
  3214. })(jQuery, window, document);
  3215. (function(e, t) {
  3216.     'use strict';
  3217.     var i = function(t) {
  3218.             this.options = e.extend({
  3219.                 iconUrl: '',
  3220.                 acl: 0,
  3221.                 title: '',
  3222.                 text: '',
  3223.                 timeout: 0,
  3224.                 zIndex: 1100
  3225.             }, t);
  3226.             this.div = e('<div class="ajaxAlert" style="left: 10px; bottom: 10px; display: none; z-index: ' + this.options.zIndex + ';"><div class="ajaxAlertBody"><div class="commentbody"><div class="userPic"><div class="height50px userPicHeight relative"><img src="' + this.options.iconUrl + '" style="display: inline;"></div></div><div class="commentcontent"><div class="commentownerLeft"><span class="badgeInline"><span class="plain bold aclColor_' + this.options.acl + '">' + this.options.title + '</span></span></div><p class="commentText botmarg5px"></p></div></div></div></div>')
  3227.         };
  3228.     i.prototype = {
  3229.         open: function() {
  3230.             e('body').append(this.div);
  3231.             e('.commentText', this.div).html(this.options.text);
  3232.             i.add(this);
  3233.             if (this.options.timeout) {
  3234.                 var t = this;
  3235.                 setTimeout(function() {
  3236.                     t.close()
  3237.                 }, this.options.timeout)
  3238.             };
  3239.             return this
  3240.         },
  3241.         on: function(e, t) {
  3242.             var i = this;
  3243.             this.div.on(e, function(e) {
  3244.                 t.call(i, e)
  3245.             });
  3246.             return this
  3247.         },
  3248.         close: function() {
  3249.             var e = this;
  3250.             this.div.fadeOut('slow', function() {
  3251.                 e.div.remove();
  3252.                 i.remove(e);
  3253.                 e = null
  3254.             });
  3255.             return this
  3256.         },
  3257.         move: function(i) {
  3258.             if (i == 0) this.div.fadeIn();
  3259.             var u = this.div.outerWidth(),
  3260.                 l = this.div.outerHeight(),
  3261.                 n = 10,
  3262.                 a = 10,
  3263.                 o = Math.floor(e(t).height() / (l + n)),
  3264.                 s = Math.ceil((i + 1) / o) - 1,
  3265.                 r = i % o,
  3266.                 f = s * n + n + s * u,
  3267.                 c = r * a + a + r * l;
  3268.             this.div.animate({
  3269.                 bottom: c,
  3270.                 left: f,
  3271.                 opacity: i == 0 ? 1 : 0.5
  3272.             });
  3273.             return this
  3274.         }
  3275.     };
  3276.     i.Z$ = [];
  3277.     i.add = function(e) {
  3278.         i.Z$.push(e);
  3279.         i.reorder()
  3280.     };
  3281.     i.remove = function(t) {
  3282.         var n = e.inArray(t, i.Z$);
  3283.         if (n != -1) {
  3284.             i.Z$.splice(n, 1);
  3285.             i.reorder()
  3286.         }
  3287.     };
  3288.     i.reorder = function() {
  3289.         for (var e = i.Z$.length - 1, t = 0; e >= 0; e--, t++) {
  3290.             i.Z$[e].move(t)
  3291.         }
  3292.     };
  3293.     t.AlertWindow = i
  3294. })(jQuery, window);
  3295. (function(e, t) {
  3296.     function i(i) {
  3297.         this.state = null;
  3298.         this.xhr = null;
  3299.         this.options = e.extend({
  3300.             element: null,
  3301.             multiple: !0,
  3302.             maxFiles: 10,
  3303.             albumId: 0,
  3304.             dragAndDrop: !1,
  3305.             select: null,
  3306.             dragEnter: null,
  3307.             dragLeave: null
  3308.         }, i);
  3309.         if (this.options.element) {
  3310.             var s = this,
  3311.                 n = e(this.options.element);
  3312.             n.click(function() {
  3313.                 s.open();
  3314.                 return !1
  3315.             });
  3316.             if (this.options.dragAndDrop) {
  3317.                 var r = !1,
  3318.                     o = !1;
  3319.                 if (typeof this.options.dragEnter == 'function' || typeof this.options.dragLeave == 'function') {
  3320.                     e(t).bind('dragover', function() {
  3321.                         r = !0
  3322.                     });
  3323.                     e(t).bind('dragleave', function() {
  3324.                         r = !1
  3325.                     });
  3326.                     var a = setInterval(function() {
  3327.                         if (!o) {
  3328.                             if (r) {
  3329.                                 if (typeof s.options.dragEnter == 'function') {
  3330.                                     s.options.dragEnter.call(s.options.element)
  3331.                                 }
  3332.                             } else {
  3333.                                 if (typeof s.options.dragLeave == 'function') {
  3334.                                     s.options.dragLeave.call(s.options.element)
  3335.                                 }
  3336.                             }
  3337.                         }
  3338.                     }, 250)
  3339.                 };
  3340.                 n.addClass('ui-uploadee');
  3341.                 n.bind('dragenter dragover', function() {
  3342.                     r = !0;
  3343.                     return !1
  3344.                 });
  3345.                 n.bind('dragleave', function() {
  3346.                     r = !1;
  3347.                     return !1
  3348.                 });
  3349.                 n.bind('drop', function(t) {
  3350.                     r = !1;
  3351.                     try {
  3352.                         var l = [];
  3353.                         e.each(t.originalEvent.dataTransfer.files, function() {
  3354.                             if (this.type.match(/image\/.+/)) {
  3355.                                 l.push(this)
  3356.                             }
  3357.                         });
  3358.                         if (l.length) {
  3359.                             var a = new FormData();
  3360.                             a.append('ajax', 1);
  3361.                             e.each(l, function() {
  3362.                                 a.append('files[]', this)
  3363.                             });
  3364.                             e.ajax({
  3365.                                 url: '/image/upload/',
  3366.                                 type: 'POST',
  3367.                                 data: a,
  3368.                                 dataType: 'json',
  3369.                                 cache: !1,
  3370.                                 processData: !1,
  3371.                                 contentType: !1,
  3372.                                 beforeSend: function() {
  3373.                                     o = !0;
  3374.                                     n.next('.alertfield').remove();
  3375.                                     n.removeClass('ui-uploaded').addClass('ui-uploading')
  3376.                                 },
  3377.                                 complete: function() {
  3378.                                     o = !1;
  3379.                                     n.removeClass('ui-uploading').addClass('ui-uploaded')
  3380.                                 },
  3381.                                 success: function(t) {
  3382.                                     if (t.method == 'error') {
  3383.                                         n.after(e('<div/>').addClass('alertfield').append(t.html))
  3384.                                     } else {
  3385.                                         s.parseResponse(t.html)
  3386.                                     }
  3387.                                 },
  3388.                                 error: function(t) {
  3389.                                     n.after(e('<div/>').addClass('alertfield').append(t.responseText))
  3390.                                 }
  3391.                             })
  3392.                         }
  3393.                     } catch (i) {};
  3394.                     return !1
  3395.                 })
  3396.             }
  3397.         }
  3398.     };
  3399.     i.prototype.open = function() {
  3400.         this.load('/image/select/' + (this.options.albumId ? 'album/' + this.options.albumId : 'recent') + '/')
  3401.     };
  3402.     i.prototype.load = function(t, i) {
  3403.         var n = this;
  3404.         e.fancybox.showActivity();
  3405.         e.get(t, function(t) {
  3406.             e.fancybox.hideActivity();
  3407.             if (e.fancybox.isActive() && !i) {
  3408.                 n.state = e.fancybox.saveState()
  3409.             };
  3410.             e.fancybox(t.html, {
  3411.                 onCleanup: function() {
  3412.                     return n.abort()
  3413.                 },
  3414.                 onComplete: function() {
  3415.                     var t = e('#fancybox-content'),
  3416.                         s = e('.imageUploadError', t),
  3417.                         o = e('.imageUploadFile', t),
  3418.                         i = e('.imageUploadUrl', t),
  3419.                         r = e('.indicator', t);
  3420.  
  3421.                     function a(t) {
  3422.                         var i = [];
  3423.                         e(t).each(function() {
  3424.                             var t = e(this);
  3425.                             i.push({
  3426.                                 id: t.data('imageId'),
  3427.                                 name: t.data('imageName'),
  3428.                                 link: t.attr('href'),
  3429.                                 thumb_link: t.find('img').attr('src')
  3430.                             })
  3431.                         });
  3432.                         n.onSelect(i)
  3433.                     };
  3434.                     if (n.state) {
  3435.                         e('.fancyCustomTop', t).attr('title', 'Back to "' + n.state.title + '"').show().click(function() {
  3436.                             e.fancybox.restoreState(n.state);
  3437.                             return !1
  3438.                         })
  3439.                     };
  3440.                     e('.pages a', t).click(function() {
  3441.                         if (n.abort()) {
  3442.                             n.load(e(this).attr('href'), !0)
  3443.                         };
  3444.                         return !1
  3445.                     });
  3446.                     e('.imageClose', t).click(function() {
  3447.                         n.close()
  3448.                     });
  3449.                     if (n.options.multiple) {
  3450.                         e('.imageSelector', t).selectable({
  3451.                             filter: '.galleryThumbSizerStills',
  3452.                             stop: function() {
  3453.                                 var s = e(this),
  3454.                                     i = s.find('.ui-selected a'),
  3455.                                     t = i.size();
  3456.                                 s.next('button').remove();
  3457.                                 if (t == 1) {
  3458.                                     a(i)
  3459.                                 } else if (t < n.options.maxFiles) {
  3460.                                     s.after(e('<button type="submit" class="siteButton bigButton"><span>Select ' + t + ' image(s)</span></button>').click(function() {
  3461.                                         a(i)
  3462.                                     }))
  3463.                                 }
  3464.                             }
  3465.                         })
  3466.                     } else {
  3467.                         e('.imageSelector a', t).click(function() {
  3468.                             a(this);
  3469.                             return !1
  3470.                         })
  3471.                     };
  3472.                     e('.imageUpload', t).ajaxForm({
  3473.                         dataType: 'json',
  3474.                         beforeSubmit: function() {
  3475.                             try {
  3476.                                 if (o.is(':visible')) {
  3477.                                     var r = e('input[type=file]', o).get(0);
  3478.                                     if (!r.files.length && !i.val()) {
  3479.                                         throw 'No file(s) selected';
  3480.                                     } else if (r.files.length > n.options.maxFiles) {
  3481.                                         throw 'Too many files selected';
  3482.                                     }
  3483.                                 } else if (i.is(':visible')) {
  3484.                                     var r = e('input[type=text]', i);
  3485.                                     if (!r.val()) {
  3486.                                         throw 'Please enter URL';
  3487.                                     }
  3488.                                 }
  3489.                             } catch (t) {
  3490.                                 s.html(t).fadeIn('slow');
  3491.                                 return !1
  3492.                             }
  3493.                         },
  3494.                         beforeSend: function() {
  3495.                             s.hide();
  3496.                             e.fancybox.showActivity();
  3497.                             e('button', t).prop('disabled', !0)
  3498.                         },
  3499.                         complete: function() {
  3500.                             e.fancybox.hideActivity();
  3501.                             e('button', t).prop('disabled', !1)
  3502.                         },
  3503.                         success: function(e) {
  3504.                             if (e.method == 'error') {
  3505.                                 s.html(e.html).fadeIn('slow');
  3506.                                 r.hide()
  3507.                             } else {
  3508.                                 n.parseResponse(e.html)
  3509.                             }
  3510.                         },
  3511.                         error: function(e) {
  3512.                             r.hide();
  3513.                             if (!e.aborted) {
  3514.                                 s.html(e.responseText);
  3515.                                 s.fadeIn('slow')
  3516.                             }
  3517.                         },
  3518.                         xhr: function() {
  3519.                             var t = e.ajaxSettings.xhr();
  3520.                             t.upload.addEventListener('progress', function(e) {
  3521.                                 if (e.lengthComputable) {
  3522.                                     var t = (e.loaded / e.total * 100).toFixed(0) + '%';
  3523.                                     r.show();
  3524.                                     r.find('div').width(t);
  3525.                                     r.find('span').html(t)
  3526.                                 }
  3527.                             }, !1);
  3528.                             return t
  3529.                         }
  3530.                     });
  3531.                     e('.switcherBox a', t).click(function() {
  3532.                         var t = e(this);
  3533.                         t.parent().find('a').removeClass('active');
  3534.                         t.addClass('active');
  3535.                         if (t.hasClass('switchRight')) {
  3536.                             i.show();
  3537.                             o.hide()
  3538.                         };
  3539.                         if (t.hasClass('switchLeft')) {
  3540.                             i.hide();
  3541.                             o.show()
  3542.                         }
  3543.                     });
  3544.                     e('.imageUploadInput input[type=file]', t).attr('multiple', n.options.multiple).customFileInput()
  3545.                 }
  3546.             })
  3547.         }, 'json')
  3548.     };
  3549.     i.prototype.abort = function() {
  3550.         if (this.xhr && !this.xhr.aborted) {
  3551.             if (confirm('Abort uploading?')) {
  3552.                 try {
  3553.                     this.xhr.abort();
  3554.                     return !0
  3555.                 } catch (e) {}
  3556.             } else {
  3557.                 return !1
  3558.             }
  3559.         };
  3560.         return !0
  3561.     };
  3562.     i.prototype.close = function() {
  3563.         this.state = null;
  3564.         e.fancybox.close()
  3565.     };
  3566.     i.prototype.parseResponse = function(t) {
  3567.         var i = [],
  3568.             n = e.parseJSON(t);
  3569.         e.each(n, function() {
  3570.             i.push({
  3571.                 id: this.id,
  3572.                 name: this.name,
  3573.                 link: this.link,
  3574.                 thumb_link: this.thumb_link
  3575.             })
  3576.         });
  3577.         this.onSelect(i)
  3578.     };
  3579.     i.prototype.onSelect = function(t) {
  3580.         if (this.state) {
  3581.             e.fancybox.restoreState(this.state)
  3582.         } else {
  3583.             this.close()
  3584.         };
  3585.         if (t.length && typeof this.options.select == 'function') {
  3586.             this.options.select.call(this.options.element, t, this)
  3587.         }
  3588.     };
  3589.     t.ImageSelector = i;
  3590.     e.fn.imageSelector = function(t) {
  3591.         if (this.length) {
  3592.             e.each(this, function() {
  3593.                 t = e.extend({}, t, {
  3594.                     element: this
  3595.                 });
  3596.                 new i(t)
  3597.             })
  3598.         };
  3599.         return this
  3600.     }
  3601. })(jQuery, window);
  3602. (function(e, t) {
  3603.     'use strict';
  3604.     var i = {
  3605.         playing: !1,
  3606.         timeout: 500,
  3607.         play: function(e) {
  3608.             if (i.playing) return !1;
  3609.             i.playing = !0;
  3610.             setTimeout(function() {
  3611.                 i.playing = !1
  3612.             }, this.timeout);
  3613.             var n = t.createElement('audio');
  3614.             if (n && typeof n.canPlayType == 'function') {
  3615.                 if (n.canPlayType('audio/ogg') != '') {
  3616.                     n.src = e + '.ogg';
  3617.                     n.play();
  3618.                     return !0
  3619.                 } else if (n.canPlayType('audio/mpeg') != '') {
  3620.                     n.src = e + '.mp3';
  3621.                     n.play();
  3622.                     return !0
  3623.                 }
  3624.             } else {
  3625.                 var s = t.createElement('embed');
  3626.                 s.setAttribute('autostart', 'true');
  3627.                 s.setAttribute('hidden', 'true');
  3628.                 s.setAttribute('loop', 'false');
  3629.                 s.setAttribute('src', e + '.mp3');
  3630.                 t.body.appendChild(s);
  3631.                 return !0
  3632.             };
  3633.             return !1
  3634.         }
  3635.     };
  3636.     e.Sound = i
  3637. })(window, document);
  3638. (function(e, t, i) {
  3639.     'use strict';
  3640.     e.fn.tabs = function(n) {
  3641.         var s = null;
  3642.         n = e.extend({
  3643.             useHash: !0,
  3644.         default:
  3645.             null,
  3646.             tabSelector: '> div',
  3647.             linkSelector: '.tabNavigation:first a',
  3648.             selectedTabClass: 'selectedTab',
  3649.             onShow: function() {}
  3650.         }, n);
  3651.  
  3652.         function r() {
  3653.             var e = t.hash.substring(1);
  3654.             e = e.replace(/\d+$/, '');
  3655.             e = e.replace(/_.+$/, '');
  3656.             return e
  3657.         };
  3658.         e(this).each(function() {
  3659.             var l = e(n.tabSelector, this),
  3660.                 a = e(n.linkSelector, this);
  3661.             l.hide();
  3662.  
  3663.             function c(e, r) {
  3664.                 if (!e) return;
  3665.                 a.removeClass(n.selectedTabClass);
  3666.                 l.hide();
  3667.                 l.filter('#' + e).show();
  3668.                 l.filter('#tab-' + e).show();
  3669.                 a.filter('[rel=' + e + ']').addClass(n.selectedTabClass);
  3670.                 if (n.useHash && r) {
  3671.                     if (i.replaceState) {
  3672.                         i.replaceState({}, '', '#' + e)
  3673.                     } else {
  3674.                         t.hash = e
  3675.                     }
  3676.                 };
  3677.                 s = e
  3678.             };
  3679.             var o = e(),
  3680.                 u = r();
  3681.             if (n.useHash && u) {
  3682.                 o = a.filter('[rel=' + u + ']')
  3683.             };
  3684.             if (!o.size() && n.
  3685.         default) {
  3686.                 o = a.filter('[rel=' + n.
  3687.             default +']')
  3688.             };
  3689.             if (!o.size()) {
  3690.                 o = a.filter('.' + n.selectedTabClass)
  3691.             };
  3692.             if (!o.size()) {
  3693.                 o = a.filter(':first')
  3694.             };
  3695.             c(o.prop('rel'));
  3696.             a.click(function() {
  3697.                 n.onShow(s, e(this));
  3698.                 c(e(this).prop('rel'), !0);
  3699.                 return !1
  3700.             })
  3701.         });
  3702.         return this
  3703.     };
  3704.     e(function() {
  3705.         e('.tabSwitcher').tabs()
  3706.     })
  3707. })(jQuery, document.location, history);
  3708.  
  3709. function width(e, t) {
  3710.     w = document.documentElement.clientWidth;
  3711.     return (w <= e) ? e + 'px' : ((w >= t) ? t + 'px' : 'auto')
  3712. };
  3713.  
  3714. function Toggle(e, t) {
  3715.     var i = $(t);
  3716.     $('#' + e).toggle();
  3717.     if ($(t).parent().hasClass('folder')) {
  3718.         $(t).parent().addClass('folderopen');
  3719.         $(t).parent().removeClass('folder')
  3720.     } else {
  3721.         $(t).parent().addClass('folder');
  3722.         $(t).parent().removeClass('folderopen')
  3723.     }
  3724. };
  3725. $(document).on('click', '#openAllFolders', function() {
  3726.     var e = $('#torrent_files table'),
  3727.         t = $('#closeAllFolders');
  3728.     if (e.has(e.css('display', 'none'))) {
  3729.         e.css('display', 'table');
  3730.         $(this).toggle();
  3731.         $(t).toggle()
  3732.     };
  3733.     $('span').parent().removeClass('folder');
  3734.     $('span').parent().addClass('folderopen');
  3735.     if ($('td').is('.torTree', '.torFileIcon', '.torFileName', '.torFileSize')) {
  3736.         $('td').removeClass('folderopen')
  3737.     }
  3738. });
  3739. $(document).on('click', '#closeAllFolders', function() {
  3740.     var e = $('#torrent_files table'),
  3741.         t = $('#openAllFolders');
  3742.     if (e.has(e.css('display', 'table'))) {
  3743.         e.css('display', 'none');
  3744.         $(this).toggle();
  3745.         $(t).toggle()
  3746.     };
  3747.     $('span').parent().removeClass('folderopen');
  3748.     $('span').parent().addClass('folder');
  3749.     if ($('td').hasClass('novertpad')) {
  3750.         $('td').removeClass('folder')
  3751.     }
  3752. });
  3753.  
  3754. function Show(e) {
  3755.     $('#' + e).show()
  3756. };
  3757.  
  3758. function Hide(e) {
  3759.     $('#' + e).hide()
  3760. }(function(e) {
  3761.     e.Tache = {
  3762.         Data: [],
  3763.         Delete: function(e) {
  3764.             s(e)
  3765.         },
  3766.         DeleteAll: function() {
  3767.             r()
  3768.         },
  3769.         Get: function(e) {
  3770.             n(e)
  3771.         },
  3772.         SetTimeout: function(e) {
  3773.             i(e)
  3774.         },
  3775.         Timeout: 600
  3776.     };
  3777.  
  3778.     function t(e) {
  3779.         var t = e.url;
  3780.         t += e.data.torrentId;
  3781.         t += ((typeof e.dataType == 'string') ? e.dataType : '');
  3782.         t += ((typeof e.type == 'string') ? e.type : '');
  3783.         return t
  3784.     };
  3785.  
  3786.     function s(i) {
  3787.         if (typeof i.url != 'string') {
  3788.             alert('No AJAX URL passed');
  3789.             return
  3790.         };
  3791.         var r = t(i),
  3792.             s = new Date();
  3793.         for (var n = e.Tache.Data.length; n > 0; n--) {
  3794.             if ((((s.valueOf() - e.Tache.Data[n - 1].dtAge.valueOf()) / 1000) > e.Tache.Timeout) || (e.Tache.Data[n - 1].sIdentifier == r)) {
  3795.                 e.Tache.Data.splice(n - 1, 1)
  3796.             }
  3797.         }
  3798.     };
  3799.  
  3800.     function r() {
  3801.         e.Tache.Data = []
  3802.     };
  3803.  
  3804.     function n(i) {
  3805.         if (typeof i.url != 'string') {
  3806.             alert('No AJAX URL passed');
  3807.             return
  3808.         };
  3809.         var s = t(i),
  3810.             r = new Date();
  3811.         for (var n = e.Tache.Data.length; n > 0; n--) {
  3812.             if (((r.valueOf() - e.Tache.Data[n - 1].dtAge.valueOf()) / 1000) > e.Tache.Timeout) {
  3813.                 e.Tache.Data.splice(n - 1, 1)
  3814.             } else if (e.Tache.Data[n - 1].sIdentifier == s) {
  3815.                 i.success(e.Tache.Data[n - 1].oData);
  3816.                 return
  3817.             }
  3818.         };
  3819.         var o = i.success;
  3820.         i.success = function(t) {
  3821.             e.Tache.Data.push({
  3822.                 sIdentifier: s,
  3823.                 oData: t,
  3824.                 dtAge: new Date()
  3825.             });
  3826.             o(t)
  3827.         };
  3828.         e.ajax(i)
  3829.     };
  3830.  
  3831.     function i(t) {
  3832.         e.Tache.Timeout = t
  3833.     }
  3834. })(jQuery);
  3835. $(function() {
  3836.     var i = 1000,
  3837.         n, e = !0,
  3838.         t = $('<div id="previewPopupContainer">   <div class="tail"></div>   <div class="prevAV topOriented darkivorybg" id="prevAV">Loading...</div>   <div id="previewPopupContent"><img style="display:block;" src="/static/kar/images/indicator.gif"></div></div>');
  3839.     $('body').append(t);
  3840.     $('.icommentjs').on('mouseover', function(i) {
  3841.         var o = $(this).attr('rel').split(','),
  3842.             r = o[0];
  3843.         currentID = o[1];
  3844.         if (r == '') return;
  3845.         if (e) clearTimeout(e);
  3846.         var s = $(this).offset(),
  3847.             l = $(this).width(),
  3848.             n = s.left - 340;
  3849.         if (n > 0) {
  3850.             var a = 'leftPlacing previewPopupContainer'
  3851.         } else {
  3852.             var a = 'rightPlacing previewPopupContainer';
  3853.             n = (s.left + 5 + l)
  3854.         };
  3855.         $('#previewPopupContainer').attr('class', a);
  3856.         t.css({
  3857.             left: n + 'px',
  3858.             top: s.top - 5 + 'px'
  3859.         });
  3860.         $('#previewPopupContent').html('&nbsp;');
  3861.         $('#prevAV').html('Loading...');
  3862.         $.Tache.Get({
  3863.             type: 'GET',
  3864.             url: '/get_comments.php',
  3865.             cache: !0,
  3866.             data: {
  3867.                 ajax: '1',
  3868.                 torrentId: r
  3869.             },
  3870.             beforeSend: function() {
  3871.                 $('#previewPopupContent').html('<center style="margin:auto 0;width:340px;"><img style="display:block !important;" src="/static/kar/images/indicator.gif"></center>')
  3872.             },
  3873.             success: function(e) {
  3874.                 if (e.indexOf(r) > 0) {
  3875.                     $('#previewPopupContent').html(e);
  3876.                     var t = $('#previewPopupContent').find('.ratestring').remove();
  3877.                     $('#prevAV').html(t);
  3878.                     t.show()
  3879.                 } else {
  3880.                     $('#previewPopupContent').html('');
  3881.                     $('#prevAV').html('No comments')
  3882.                 }
  3883.             }
  3884.         });
  3885.         t.fadeIn(500)
  3886.     });
  3887.     $('.icommentjs').on('mouseout', function() {
  3888.         if (e) clearTimeout(e);
  3889.         e = setTimeout(function() {
  3890.             t.css('display', 'none')
  3891.         }, i)
  3892.     })
  3893. });
  3894.  
  3895. function doFade(e) {
  3896.     for (var t = 0; t < 3; t++) {
  3897.         doFadeOnce(e)
  3898.     }
  3899. };
  3900.  
  3901. function doFadeOnce(e) {
  3902.     $(e).css('opacity', 1).animate({
  3903.         opacity: 0.0
  3904.     }, 500).animate({
  3905.         opacity: 1.0
  3906.     }, 500)
  3907. };
  3908.  
  3909. function deleteLocation(e) {
  3910.     $.ajax({
  3911.         type: 'POST',
  3912.         url: '/moderator/torrent/deletelocation/',
  3913.         data: {
  3914.             ajax: 1,
  3915.             location: e
  3916.         },
  3917.         dataType: 'json',
  3918.         success: function(t) {
  3919.             $('#tl_' + e).fadeOut(500, function() {
  3920.                 $('#tl_' + e).remove()
  3921.             })
  3922.         }
  3923.     })
  3924. };
  3925.  
  3926. function undeleteLocation(e) {
  3927.     $.ajax({
  3928.         type: 'POST',
  3929.         url: '/moderator/torrent/undeletelocation/',
  3930.         data: {
  3931.             ajax: 1,
  3932.             location: e
  3933.         },
  3934.         dataType: 'json',
  3935.         success: function(t) {
  3936.             $('#tlc_' + e).fadeOut(500)
  3937.         }
  3938.     })
  3939. };
  3940.  
  3941. function setDeleted(e, t, i, n, s) {
  3942.     var o = s ? 1 : 0,
  3943.         r = $('#del_' + e).html();
  3944.     $.ajax({
  3945.         type: 'POST',
  3946.         url: '/moderator/torrent/' + (n ? '' : 'un') + 'deletetorrent/' + t + '/',
  3947.         data: {
  3948.             ajax: 1,
  3949.             copyright: o
  3950.         },
  3951.         dataType: 'json',
  3952.         beforeSend: function() {
  3953.             $('#del_' + e).html('<img src="/static/kar/images/indicator.gif">')
  3954.         },
  3955.         success: function(s) {
  3956.             if (s.method == 'error') {
  3957.                 alert(s.html);
  3958.                 $('#del_' + e).html(r);
  3959.                 return !1
  3960.             };
  3961.             if (i) {
  3962.                 $('#del_' + e).html('<a href="javascript: ' + (n ? 'un' : '') + 'deleteTorrent(\'' + e + '\', \'' + t + '\', true);"><i class="ka ka16 ka-delete ka-' + (n ? 'green' : 'red') + '"></i></a>')
  3963.             } else {
  3964.                 $('#del_' + e).html('<a href="javascript: ' + (n ? 'un' : '') + 'deleteTorrent(\'' + e + '\', \'' + t + '\');"><i class="ka ka16 ka-delete ka-' + (n ? 'green' : 'red') + '"></i> ' + (n ? 'un' : '') + 'delete torrent</a>')
  3965.             }
  3966.         }
  3967.     })
  3968. };
  3969.  
  3970. function deleteTorrent(e, t, i, n) {
  3971.     setDeleted(e, t, i, 1, n)
  3972. };
  3973.  
  3974. function undeleteTorrent(e, t, i) {
  3975.     setDeleted(e, t, i, 0)
  3976. };
  3977.  
  3978. function setVerification(e, t, i) {
  3979.     $.ajax({
  3980.         type: 'POST',
  3981.         url: '/moderator/torrent/' + (i ? '' : 'un') + 'verify/' + t + '/',
  3982.         data: {
  3983.             ajax: 1,
  3984.             hash: t
  3985.         },
  3986.         dataType: 'json',
  3987.         beforeSend: function() {
  3988.             $('#ver_' + e).html('<img src="/static/kar/images/indicator.gif">')
  3989.         },
  3990.         success: function(n) {
  3991.             $('#ver_' + e).html('<a href="javascript: ' + (i ? 'un' : '') + 'verifyTorrent(\'' + e + '\', \'' + t + '\');"> <i class="ka ka16 ' + (i ? 'ka-unverify ka-red' : 'ka-verify ka-green') + '"></i></a>')
  3992.         }
  3993.     })
  3994. };
  3995.  
  3996. function verifyTorrent(e, t) {
  3997.     setVerification(e, t, 1)
  3998. };
  3999.  
  4000. function unverifyTorrent(e, t) {
  4001.     setVerification(e, t, 0)
  4002. };
  4003.  
  4004. function rateTopComment(e, t) {
  4005.     $.ajax({
  4006.         type: 'POST',
  4007.         url: '/comments/rate/' + (t ? 'like' : 'dislike') + '/' + e + '/',
  4008.         dataType: 'json',
  4009.         beforeSend: function() {
  4010.             $('#topcommrate_' + e).html('<img src="/static/kar/images/indicator.gif">')
  4011.         },
  4012.         success: function(t) {
  4013.             if (t.method == 'show') {
  4014.                 $('#topratediv_' + e).html(t.html);
  4015.                 $('a.ajaxLink').fancybox()
  4016.             } else {
  4017.                 $('#topcommrate_' + e).html('error');
  4018.                 $('#topratediv_' + e).html($('#commrate_' + e))
  4019.             }
  4020.         },
  4021.         error: function(t) {
  4022.             $('#topcommrate_' + e).html('error')
  4023.         }
  4024.     })
  4025. };
  4026.  
  4027. function rateTopMinus(e) {
  4028.     rateTopComment(e, 0)
  4029. };
  4030.  
  4031. function rateTopPlus(e) {
  4032.     rateTopComment(e, 1)
  4033. };
  4034.  
  4035. function rateComment(e, t) {
  4036.     $.ajax({
  4037.         type: 'POST',
  4038.         url: '/comments/rate/' + (t ? 'like' : 'dislike') + '/' + e + '/',
  4039.         dataType: 'json',
  4040.         beforeSend: function() {
  4041.             $('#commrate_' + e).html('<img src="/static/kar/images/indicator.gif">')
  4042.         },
  4043.         success: function(i) {
  4044.             if (i.method == 'show') {
  4045.                 if (!t) {
  4046.                     if (!$('#cshow_' + e).length) {
  4047.                         $('#comment' + e).find('div.commentownerLeft').append('<a class="siteButton smallButton reject showComment" id="cshow_' + e + '" href="javascript:showComment(' + e + ')"><span>Show comment</span></a>')
  4048.                     } else {
  4049.                         $('#cshow_' + e).href = 'javascript:showComment(\'+id+\')';
  4050.                         $('#cshow_' + e).html('<span>Show comment</span>')
  4051.                     };
  4052.                     if ($('#comment' + e).parent().hasClass('reply')) {
  4053.                         $('#comment' + e).parent().parent().addClass('hiddenComment')
  4054.                     } else {
  4055.                         $('#comment' + e).parent().addClass('hiddenComment')
  4056.                     };
  4057.                     $('#cpic_' + e).hide();
  4058.                     $('#cdate_' + e).hide();
  4059.                     $('#ctext_' + e).hide();
  4060.                     $('#rep_link' + e).hide()
  4061.                 };
  4062.                 $('#ratediv_' + e).html(i.html);
  4063.                 $('a.ajaxLink').fancybox()
  4064.             } else if (i.method == 'error') {
  4065.                 alert(i.html);
  4066.                 $('#commrate_' + e).html('error');
  4067.                 $('#ratediv_' + e).html($('#commrate_' + e))
  4068.             } else {
  4069.                 $('#commrate_' + e).html('error');
  4070.                 $('#ratediv_' + e).html($('#commrate_' + e))
  4071.             }
  4072.         }
  4073.     })
  4074. };
  4075.  
  4076. function rateMinus(e) {
  4077.     rateComment(e, 0)
  4078. };
  4079.  
  4080. function ratePlus(e) {
  4081.     rateComment(e, 1)
  4082. };
  4083.  
  4084. function showComment(e) {
  4085.     $('#cpic_' + e).toggle();
  4086.     $('#cdate_' + e).css('display', 'inline');
  4087.     $('#ctext_' + e).toggle();
  4088.     $('#rep_link' + e).toggle();
  4089.     if ($('#ctext_' + e + ':visible').length) {
  4090.         $('#cshow_' + e).html('<span>Hide</span>')
  4091.     } else {
  4092.         $('#cshow_' + e).html('<span>Show</span>')
  4093.     }
  4094. };
  4095.  
  4096. function getFiles(e, t, i) {
  4097.     $.ajax({
  4098.         type: 'POST',
  4099.         url: '/torrents/getfiles/' + e + '/',
  4100.         data: {
  4101.             ajax: 1,
  4102.             all: t,
  4103.             dir: i
  4104.         },
  4105.         dataType: 'json',
  4106.         beforeSend: function() {
  4107.             $('#torrent_files').html('<center style="margin:auto 0;width:100%;"><img src="/static/kar/images/indicator.gif"></center>')
  4108.         },
  4109.         success: function(e) {
  4110.             $('#torrent_files').html(e.html)
  4111.         }
  4112.     })
  4113. };
  4114.  
  4115. function updateFeedback(e) {
  4116.     e = e || 1;
  4117.     var t = $('#menu_feedback .menuValue'),
  4118.         n = parseInt(t.text()) || 0,
  4119.         i = n + e;
  4120.     if (i > 0) {
  4121.         t.text(i).show();
  4122.         doFade(t.parent())
  4123.     } else {
  4124.         t.hide()
  4125.     }
  4126. };
  4127.  
  4128. function trim(e, t) {
  4129.     return ltrim(rtrim(e, t), t)
  4130. };
  4131.  
  4132. function ltrim(e, t) {
  4133.     t = t || '\\s';
  4134.     return e.replace(new RegExp('^[' + t + ']+', 'g'), '')
  4135. };
  4136.  
  4137. function rtrim(e, t) {
  4138.     t = t || '\\s';
  4139.     return e.replace(new RegExp('[' + t + ']+$', 'g'), '')
  4140. };
  4141. String.prototype.ReplaceAll = function(e, t) {
  4142.     var i = this;
  4143.     if (typeof(e) == String) {
  4144.         var n = i.indexOf(e)
  4145.     } else {
  4146.         var n = i.match(e)
  4147.     }
  4148.     while (n != -1) {
  4149.         i = i.replace(e, t);
  4150.         n = i.indexOf(e)
  4151.     };
  4152.     return i
  4153. };
  4154. String.prototype.HighlightSpecial = function() {
  4155.     var e = this;
  4156.     e = e.replace(/(&lt;.+?&gt;)/g, '<span class="highlightTag">$1</span>');
  4157.     e = e.replace(/(&lt;\/+?&gt;)/gi, '<span class="highlightTag">$1</span>');
  4158.     e = e.replace(/(&amp;.+?;)/gi, '<span class="highlightEntity">$1</span>');
  4159.     e = e.replace(/(%\d+)/gi, '<span class="highlightParam">$1</span>');
  4160.     return e
  4161. };
  4162.  
  4163. function doSearch(e) {
  4164.     text = e;
  4165.     text = text.ReplaceAll(new RegExp(/\s\s+/gi), ' ');
  4166.     text = jQuery.trim(text);
  4167.     e = encodeURIComponent(text).replace(/!/g, '%21').replace(/'/g, '%27').replace(/\(/g, '%28').replace(/\)/g, '%29').replace(/\*/g, '%2A');
  4168.     if (!e) {
  4169.         window.location = '/new/';
  4170.         return !1
  4171.     };
  4172.     window.location = '/usearch/' + e + '/';
  4173.     return !1
  4174. };
  4175.  
  4176. function proof(e) {
  4177.     $(e).append('<input type="hidden" name="turing" value="iamhuman">')
  4178. };
  4179.  
  4180. function reportComment(e) {
  4181.     $.ajax({
  4182.         type: 'POST',
  4183.         url: '/comments/report/' + e + '/',
  4184.         data: {
  4185.             ajax: '1'
  4186.         },
  4187.         dataType: 'json',
  4188.         beforeSend: function() {
  4189.             $('#report_comment_' + e).html('<img src="/static/kar/images/indicator.gif">')
  4190.         },
  4191.         success: function(t) {
  4192.             if (t.method == 'error') {
  4193.                 alert(t.html)
  4194.             } else $('#report_comment_' + e).replaceWith('<a class="siteButton smallButton disabledButton"><span>reported</span></a>')
  4195.         },
  4196.         error: function(t) {
  4197.             $('#report_comment_' + e).html('<center>Something nasty happened. Please try to reload a page or visit kastatus.com for details.</center>')
  4198.         }
  4199.     });
  4200.     return !1
  4201. };
  4202.  
  4203. function reportPost(e) {
  4204.     $.ajax({
  4205.         type: 'POST',
  4206.         url: '/community/report/post/' + e + '/',
  4207.         dataType: 'json',
  4208.         beforeSend: function() {
  4209.             $('#report_post_' + e).removeClass('ka-red ka-report').html('<img src="/static/kar/images/indicator.gif">')
  4210.         },
  4211.         success: function(t) {
  4212.             if (t.method == 'error') {
  4213.                 $('#report_post_' + e).remove();
  4214.                 alert(t.html)
  4215.             } else {
  4216.                 $('#report_post_' + e).replaceWith('<span class="kaButton smallButton normalText disabledButton"><i class="ka ka-report"></i>reported</span>')
  4217.             }
  4218.         },
  4219.         error: function(t) {
  4220.             $('#report_post_' + e).html('<center>Something nasty happened. Please try to reload a page or visit kastatus.com for details.</center>')
  4221.         }
  4222.     });
  4223.     return !1
  4224. };
  4225.  
  4226. function reportThread(e, t) {
  4227.     if (!e.reason.value) {
  4228.         alert('Please fill out the reason field.');
  4229.         return !1
  4230.     };
  4231.     $.fancybox.showActivity();
  4232.     var i = $(e).find('button[type=submit]').prop('disabled', !0);
  4233.     i.addClass('disabledButton');
  4234.     $.ajax({
  4235.         type: 'POST',
  4236.         url: '/community/report/thread/' + t + '/',
  4237.         data: {
  4238.             reason: e.reason.value
  4239.         },
  4240.         dataType: 'json',
  4241.         beforeSend: function() {
  4242.             $('#report_thread_' + t).html('<img src="/static/kar/images/indicator.gif">')
  4243.         },
  4244.         success: function(e) {
  4245.             if (e.method == 'error') {
  4246.                 alert(e.html);
  4247.                 $.fancybox.hideActivity();
  4248.                 i.removeClass('disabledButton').prop('disabled', !1)
  4249.             } else {
  4250.                 $('#report_thread_' + t).replaceWith('<a class="kaButton smallButton normalText disabledButton"><i class="ka ka-report"></i> reported</a>');
  4251.                 $.fancybox.close()
  4252.             }
  4253.         },
  4254.         error: function(e) {
  4255.             $('#report_thread_' + t).html('<center>Something nasty happened. Please try to reload a page or visit kastatus.com for details.</center>');
  4256.             $.fancybox.close()
  4257.         }
  4258.     });
  4259.     return !1
  4260. };
  4261. last = 0;
  4262.  
  4263. function comment(e) {
  4264.     if (last) {
  4265.         $('cf_' + last).setStyle('display', 'none')
  4266.     };
  4267.     if (last != e) {
  4268.         $('cf_' + e).setStyle('display', 'block');
  4269.         $('cf_edit_' + e).focus();
  4270.         last = e
  4271.     } else {
  4272.         last = 0
  4273.     }
  4274. };
  4275.  
  4276. function getPage(e, t, i) {
  4277.     var n = '#morecomments_' + e,
  4278.         s = $('#tab-comment_comments').length ? '#tab-comment_comments' : '#comments';
  4279.     if ($(s).html() == '') {
  4280.         n = s
  4281.     };
  4282.     $.ajax({
  4283.         type: 'POST',
  4284.         url: '/comments/index/' + i + '/' + t + '/',
  4285.         data: {
  4286.             ajax: '1',
  4287.             page: e
  4288.         },
  4289.         dataType: 'json',
  4290.         beforeSend: function() {
  4291.             $((n == s ? n : '#showmore_' + e)).html('<img src="/static/kar/images/indicator.gif">')
  4292.         },
  4293.         success: function(t) {
  4294.             container = $(n);
  4295.             container.html(t.html);
  4296.             var s = container.find('#comment_votes');
  4297.             if (s.length) {
  4298.                 var r = container.find('#comment_comments');
  4299.                 container.before($(r.html()));
  4300.                 r.remove();
  4301.                 if (s.children().size()) $('#tab-votes_button').show();
  4302.                 $('#tab-comment_votes').append($(s.html()));
  4303.                 s.remove()
  4304.             };
  4305.             $(n).fadeIn('fast');
  4306.             $('#showmore_' + e).hide();
  4307.             $('a.ajaxLink').fancybox();
  4308.             try {
  4309.                 $('img.lazyjs').lazyload({
  4310.                     effect: 'fadeIn',
  4311.                     skip_invisible: !1
  4312.                 })
  4313.             } catch (i) {}
  4314.         },
  4315.         error: function(t) {
  4316.             $(n).html('<center>Something nasty happened. Please try to reload a page or visit kastatus.com for details.</center>');
  4317.             $(n).center();
  4318.             $('#showmore_' + e).hide()
  4319.         }
  4320.     })
  4321. };
  4322.  
  4323. function getAll(e, t, i) {
  4324.     var n = '#morecomments_' + e,
  4325.         s = $('#tab-comment_comments').length ? '#tab-comment_comments' : '#comments';
  4326.     if ($(s).html() == '') {
  4327.         n = s
  4328.     };
  4329.     $.ajax({
  4330.         type: 'POST',
  4331.         url: '/comments/index/' + i + '/' + t + '/',
  4332.         data: {
  4333.             ajax: '1',
  4334.             all: '1',
  4335.             page: e
  4336.         },
  4337.         dataType: 'json',
  4338.         beforeSend: function() {
  4339.             $((n == s ? n : '#showmore_' + e)).html('<img src="/static/kar/images/indicator.gif">')
  4340.         },
  4341.         success: function(t) {
  4342.             container = $(n);
  4343.             container.html(t.html);
  4344.             var s = container.find('#comment_votes');
  4345.             if (s.length) {
  4346.                 var r = container.find('#comment_comments');
  4347.                 container.before($(r.html()));
  4348.                 r.remove();
  4349.                 if (s.children().size()) $('#tab-votes_button').show();
  4350.                 $('#tab-comment_votes').append($(s.html()));
  4351.                 s.remove()
  4352.             };
  4353.             $(n).fadeIn('fast');
  4354.             $('#showmore_' + e).hide();
  4355.             $('a.ajaxLink').fancybox();
  4356.             try {
  4357.                 $('img.lazyjs').lazyload({
  4358.                     effect: 'fadeIn',
  4359.                     skip_invisible: !1
  4360.                 })
  4361.             } catch (i) {}
  4362.         },
  4363.         error: function(t) {
  4364.             $(n).html('<center>Something nasty happened. Please try to reload a page or visit kastatus.com for details.</center>');
  4365.             $(n).center();
  4366.             $('#showmore_' + e).hide()
  4367.         }
  4368.     })
  4369. };
  4370.  
  4371. function loadTrailers(e) {
  4372.     $.ajax({
  4373.         type: 'POST',
  4374.         url: '/torrents/details/' + e + '/trailer/',
  4375.         dataType: 'json',
  4376.         beforeSend: function() {
  4377.             $('#tab-trailer').html('<img src="/static/kar/images/indicator.gif">')
  4378.         },
  4379.         success: function(e) {
  4380.             $('#tab-trailer').html(e.html).show();
  4381.             $('#trailer_link').unbind('click.my')
  4382.         },
  4383.         error: function(e) {
  4384.             $('#tab-trailer').html('<center>Something nasty happened. Please try to reload a page or visit kastatus.com for details.</center>')
  4385.         }
  4386.     })
  4387. };
  4388.  
  4389. function validateComment(e) {
  4390.     if ((e.content.value == '')) {
  4391.         alert('Please fill the comment field');
  4392.         return !1
  4393.     };
  4394.     if ((e.content.value.length < 3)) {
  4395.         alert('Comment is too short');
  4396.         return !1
  4397.     };
  4398.     return !0
  4399. };
  4400.  
  4401. function disableSubmit(e) {
  4402.     $(e).find('button[type=submit]').prop('disabled', !0).addClass('disabledButton');
  4403.     return !0
  4404. };
  4405.  
  4406. function addComment(e, t) {
  4407.     e.turing.value = 'iamhuman';
  4408.     var n = $(e).serialize();
  4409.     n = n + '&ajax=1';
  4410.     var s = (typeof(e.pid) == 'undefined') ? 0 : e.pid.value;
  4411.     if (n.indexOf('audio_rate') == -1) {
  4412.         if (!validateComment(e)) return !1
  4413.     };
  4414.     var r = $(e).find('button[type=submit]');
  4415.     r.prop('disabled', !0).addClass('disabledButton');
  4416.     var i = $('#tab-comment_comments').length ? '#tab-comment_comments' : '#comments';
  4417.     $(i).show();
  4418.     $.ajax({
  4419.         type: 'POST',
  4420.         url: '/comments/create/' + t + '/',
  4421.         data: n,
  4422.         dataType: 'json',
  4423.         success: function(t) {
  4424.             if (t.method == 'error') {
  4425.                 var n = $('<div class="alertfield">' + t.html + '</div>');
  4426.                 n.prependTo(i);
  4427.                 return !1
  4428.             };
  4429.             if (s) {
  4430.                 var n = $('<div class="reply"><div class="commentThread">' + t.html + '</div></div>');
  4431.                 n.appendTo($('#comment' + s).parent());
  4432.                 hideReply(s)
  4433.             } else {
  4434.                 var n = $('<div class="commentThread">' + t.html + '</div>');
  4435.                 n.prependTo(i)
  4436.             };
  4437.             n.hide();
  4438.             n.fadeIn('fast');
  4439.             n.find('.ajaxLink').fancybox();
  4440.             e.reset();
  4441.             $(e).find('.galleryThumbSizerStills').remove()
  4442.         },
  4443.         error: function(e) {
  4444.             $(i).html('<center>Something nasty happened. Please try to reload a page or visit kastatus.com for details.</center>');
  4445.             $(i).center()
  4446.         },
  4447.         complete: function() {
  4448.             r.prop('disabled', !1).removeClass('disabledButton');
  4449.             $('.captcha', e).click()
  4450.         }
  4451.     });
  4452.     return !1
  4453. };
  4454.  
  4455. function hideReply(e) {
  4456.     $('#rep' + e).hide();
  4457.     $('#close_link' + e).hide();
  4458.     $('#rep_link' + e).show()
  4459. };
  4460.  
  4461. function showReply(e) {
  4462.     $('#rep' + e).show();
  4463.     $('#close_link' + e).show();
  4464.     $('#rep_link' + e).hide();
  4465.     var t = $('#comment_form').find('input[name=pid]').val();
  4466.     if (t && t != e) hideReply(t);
  4467.     $('#comment_form').appendTo('#rep' + e).show().find('input[name=pid]').val(e);
  4468.     $('#rep' + e).find('img.captcha').click()
  4469. };
  4470.  
  4471. function deleteWidget(e) {
  4472.     $.ajax({
  4473.         type: 'POST',
  4474.         url: '/account/settings/widgets/',
  4475.         data: {
  4476.             ajax: 1,
  4477.             remove: 1,
  4478.             id: e
  4479.         },
  4480.         dataType: 'json',
  4481.         success: function(t) {
  4482.             $('#order_' + e).fadeOut(500, function() {
  4483.                 $('#order_' + e).remove()
  4484.             })
  4485.         }
  4486.     })
  4487. };
  4488.  
  4489. function unblockUser(e) {
  4490.     $.ajax({
  4491.         type: 'POST',
  4492.         url: '/account/settings/privacy/',
  4493.         data: {
  4494.             ajax: '1',
  4495.             unblock: e
  4496.         },
  4497.         dataType: 'json',
  4498.         success: function(t) {
  4499.             if (t.method == 'error') {
  4500.                 alert(t.html)
  4501.             } else $('#blocked_' + e).fadeOut(500, function() {
  4502.                 $('#blocked_' + e).remove()
  4503.             })
  4504.         },
  4505.         error: function(t) {
  4506.             $('#blocked_' + e).html('<center>Something nasty happened. Please try to reload a page or visit kastatus.com for details.</center>')
  4507.         }
  4508.     });
  4509.     return !1
  4510. };
  4511.  
  4512. function deletePost(e) {
  4513.     $.ajax({
  4514.         type: 'POST',
  4515.         url: '/community/delete/post/' + e + '/',
  4516.         dataType: 'json',
  4517.         success: function(t) {
  4518.             if (t.method == 'error') {
  4519.                 alert(t.html)
  4520.             } else $('#post' + e).fadeOut(500, function() {
  4521.                 $('#post' + e).remove()
  4522.             })
  4523.         },
  4524.         error: function(e) {
  4525.             console.log(e)
  4526.         }
  4527.     })
  4528. };
  4529.  
  4530. function DeleteComment(e) {
  4531.     var t = $('#tab-comment_comments').length ? '#tab-comment_comments' : '#comments';
  4532.     $.ajax({
  4533.         type: 'POST',
  4534.         url: '/comments/delete/',
  4535.         data: {
  4536.             ajax: '1',
  4537.             cid: e
  4538.         },
  4539.         dataType: 'json',
  4540.         success: function(t) {
  4541.             if (t.method == 'error') {
  4542.                 alert(t.html)
  4543.             } else $('#comment' + e).fadeOut(500, function() {
  4544.                 $('#comment' + e).remove()
  4545.             })
  4546.         },
  4547.         error: function(e) {
  4548.             $(t).html('<center>Something nasty happened. Please try to reload a page or visit kastatus.com for details.</center>');
  4549.             $(t).center();
  4550.             $('#darkenBackground').hide()
  4551.         }
  4552.     })
  4553. };
  4554.  
  4555. function unDeleteComment(e, t) {
  4556.     var i = $('#tab-comment_comments').length ? '#tab-comment_comments' : '#comments';
  4557.     $.ajax({
  4558.         type: 'POST',
  4559.         url: '/comments/undelete/' + e + '/',
  4560.         data: {
  4561.             ajax: '1'
  4562.         },
  4563.         dataType: 'json',
  4564.         beforeSend: function() {
  4565.             $('#ctext_' + e).html('<img src="/static/kar/images/indicator.gif">')
  4566.         },
  4567.         success: function(i) {
  4568.             $('#ctext_' + e).fadeIn(500, function() {
  4569.                 $('#ctext_' + e).html(i.html)
  4570.             });
  4571.             $('#restore_' + e).hide();
  4572.             $('#rep_link' + e).html('<a href="javascript: DeleteComment(' + e + ');">delete</a>');
  4573.             $(t).removeClass('greenButton');
  4574.             $(t).addClass('redButton');
  4575.             $(t).attr('onClick', 'DeleteComment(' + e + ');')
  4576.         },
  4577.         error: function(e) {
  4578.             $(i).html('<center>Something nasty happened. Please try to reload a page or visit kastatus.com for details.</center>');
  4579.             $(i).center();
  4580.             $('#darkenBackground').hide()
  4581.         }
  4582.     })
  4583. };
  4584. var current_edit_comment = 0,
  4585.     top_edit = !1;
  4586.  
  4587. function editComment(e, t) {
  4588.     var i = (t ? '#topctext_' : '#ctext_') + e;
  4589.     top_edit = t;
  4590.     if (current_edit_comment > 0) {
  4591.         $((t ? '#topctext_' : '#ctext_') + current_edit_comment).html($('#cbuffer').html())
  4592.     } else {
  4593.         if ($('#cbuffer').length == 0) $('body').append('<div id="cbuffer" style="display:none"></div>')
  4594.     };
  4595.     current_edit_comment = e;
  4596.     $('#cbuffer').html($(i).html());
  4597.     $.ajax({
  4598.         type: 'GET',
  4599.         url: '/comments/edit/' + e + '/',
  4600.         dataType: 'json',
  4601.         beforeSend: function() {
  4602.             $(i).html('<img src="/static/kar/images/indicator.gif" alt="loading..."/>');
  4603.             $(i).fadeIn('fast')
  4604.         },
  4605.         success: function(t) {
  4606.             $('#edited_' + e).remove();
  4607.             $(i).html(t.html).find('.ajaxLink').fancybox();
  4608.             current_edit_comment = 0
  4609.         }
  4610.     });
  4611.     return !1
  4612. };
  4613.  
  4614. function cancelEditComment(e) {
  4615.     current_edit_comment = 0;
  4616.     $((top_edit ? '#topctext_' : '#ctext_') + e).html($('#cbuffer').html());
  4617.     return !1
  4618. };
  4619.  
  4620. function saveComment(e, t) {
  4621.     var i = $(e).serialize();
  4622.     i = i;
  4623.     var n = (typeof(e.pid) == 'undefined') ? 0 : e.pid.value;
  4624.     if (!validateComment(e)) return !1;
  4625.     e.submit.disabled = !0;
  4626.     $.ajax({
  4627.         type: 'POST',
  4628.         url: '/comments/edit/' + t + '/',
  4629.         data: i,
  4630.         dataType: 'json',
  4631.         beforeSend: function() {
  4632.             e.submit.disabled = !0
  4633.         },
  4634.         success: function(i) {
  4635.             if (i.method == 'error') {
  4636.                 var n = $('<div class="alertfield">' + i.html + '</div>');
  4637.                 n.prependTo($(e));
  4638.                 e.submit.disabled = !1;
  4639.                 return !1
  4640.             };
  4641.             $((top_edit ? '#topctext_' : '#ctext_') + t).html(i.html).find('.ajaxLink').fancybox()
  4642.         },
  4643.         error: function(e) {
  4644.             $((top_edit ? '#topctext_' : '#ctext_') + t).html('<center>Something nasty happened. Please try to reload a page or visit kastatus.com for details.</center>')
  4645.         }
  4646.     });
  4647.     return !1
  4648. };
  4649.  
  4650. function replyPost(e) {
  4651.     $('#pid').val(e);
  4652.     doFadeOnce($('#content_' + e).parent().parent());
  4653.     $('#replytext').val('');
  4654.     $('#replytext').focus();
  4655.     return !1
  4656. };
  4657. var current_edit_id = 0;
  4658.  
  4659. function editPost(e) {
  4660.     if (current_edit_id > 0) {
  4661.         $('#content_' + current_edit_id).html($('#cbuffer').html())
  4662.     };
  4663.     current_edit_id = e;
  4664.     $('#cbuffer').html($('#content_' + e).html());
  4665.     $.ajax({
  4666.         type: 'GET',
  4667.         url: '/community/edit/' + e + '/',
  4668.         dataType: 'json',
  4669.         beforeSend: function() {
  4670.             $('#content_' + e).html('<img src="/static/kar/images/indicator.gif" alt="loading..."/>');
  4671.             $('#content_' + e).fadeIn('fast')
  4672.         },
  4673.         success: function(t) {
  4674.             $('#edited_' + e).remove();
  4675.             $('#content_' + e).html(t.html).find('.ajaxLink').fancybox();
  4676.             $('#post' + e).find('.smallButtonsline').hide();
  4677.             current_edit_id = 0
  4678.         }
  4679.     });
  4680.     return !1
  4681. };
  4682.  
  4683. function cancelEditPost(e) {
  4684.     current_edit_id = 0;
  4685.     $('#content_' + e).html($('#cbuffer').html());
  4686.     return !1
  4687. };
  4688.  
  4689. function savePost(e, t) {
  4690.     var i = $(e).serialize();
  4691.     i = i;
  4692.     var n = (typeof(e.pid) == 'undefined') ? 0 : e.pid.value;
  4693.     if (!validateComment(e)) return !1;
  4694.     e.submit.disabled = !0;
  4695.     $.ajax({
  4696.         type: 'POST',
  4697.         url: '/community/edit/' + t + '/',
  4698.         data: i,
  4699.         dataType: 'json',
  4700.         beforeSend: function() {
  4701.             e.submit.disabled = !0
  4702.         },
  4703.         success: function(i) {
  4704.             if (i.method == 'error') {
  4705.                 var n = $('<div class="alertfield">' + i.html + '</div>');
  4706.                 n.prependTo($(e));
  4707.                 e.submit.disabled = !1;
  4708.                 return !1
  4709.             };
  4710.             $('#content_' + t).html(i.html).find('.ajaxLink').fancybox();
  4711.             $('#post' + t).find('.smallButtonsline').show()
  4712.         },
  4713.         error: function(e) {
  4714.             $('#content_' + t).html('<center>Something nasty happened. Please try to reload a page or visit kastatus.com for details.</center>')
  4715.         }
  4716.     });
  4717.     return !1
  4718. };
  4719.  
  4720. function quotePost(e, t) {
  4721.     $('#pid').val(0);
  4722.     var i = t != undefined ? '#post_' + e : '#content_' + e,
  4723.         s = toBBcode($(i).html()),
  4724.         n = $(i).parent().parent().find('.badgeUsernamejs').find('a').html();
  4725.     $('#replytext').val($('#replytext').val() + '[quote="' + n + '"]' + s + '[/quote]\n');
  4726.     $('#replytext').focus();
  4727.     return !1
  4728. };
  4729.  
  4730. function toBBcode(e) {
  4731.     var t = $('<div>' + e + '</div>'),
  4732.         n = null,
  4733.         s = null;
  4734.     t.html(t.html().replace(/<br([^>]*)>/igm, '\r'));
  4735.     while (t.find('div.spoiler_container .spoiler_js').length) {
  4736.         n = t.find('div.spoiler_container').first();
  4737.         n.replaceWith('[spoiler]' + n.find('.spoiler_js').html() + '[/spoiler]')
  4738.     }
  4739.     while (t.find('div.quote').length) {
  4740.         n = t.find('div.quote').first();
  4741.         s = '';
  4742.         if (n.find('> .quoteAuthor.plain a').length) {
  4743.             s = '="' + n.find('> .quoteAuthor.plain a').html() + '"';
  4744.             n.find('> .quoteAuthor.plain').remove()
  4745.         };
  4746.         n.replaceWith('[quote' + s + ']' + n.html() + '[/quote]')
  4747.     }
  4748.     while (t.find('div.spoiler_body').length) {
  4749.         n = t.find('div.spoiler_body').first();
  4750.         s = '';
  4751.         if (n.find('> .spoiler_header > .spoiler_toggle.spoiler_custom').length) {
  4752.             s = '="' + n.find('> .spoiler_header > .spoiler_toggle.spoiler_custom').html() + '"'
  4753.         };
  4754.         n.replaceWith('[spoiler' + s + ']' + n.find('> .spoiler_js').html() + '[/spoiler]')
  4755.     };
  4756.     t.find('pre').each(function() {
  4757.         if ($(this).find('code').length) {
  4758.             $(this).replaceWith('[code]' + $(this).find('code').html() + '[/code]')
  4759.         } else {
  4760.             $(this).replaceWith('[pre]' + $(this).html() + '[/pre]')
  4761.         }
  4762.     });
  4763.     while (t.find('span[style^="color:"]').length) {
  4764.         n = t.find('span[style^="color:"]').first();
  4765.         s = n.attr('style').match(/color:(.*)/)[1];
  4766.         n.replaceWith('[color=' + s + ']' + n.html() + '[/color]')
  4767.     }
  4768.     while (t.find('span[style^="text-decoration: underline;"]').length) {
  4769.         n = t.find('span[style^="text-decoration: underline;"]').first();
  4770.         n.replaceWith('[u]' + n.html() + '[/u]')
  4771.     }
  4772.     while (t.find('span[style^="font-size:"]').length) {
  4773.         n = t.find('span[style^="font-size:"]').first();
  4774.         s = n.attr('style').match(/font-size:(.*)/)[1].replace(/%/g, '');
  4775.         if (/px/.test(s)) s = '"' + s + '"';
  4776.         n.replaceWith('[size=' + s + ']' + n.html() + '[/size]')
  4777.     }
  4778.     while (t.find('div[class="left"],div[class="center"],div[class="right"],div[class="justify"]').length) {
  4779.         n = t.find('div[class="left"],div[class="center"],div[class="right"],div[class="justify"]').first();
  4780.         s = n.attr('class');
  4781.         n.replaceWith('[' + s + ']' + n.html() + '[/' + s + ']')
  4782.     };
  4783.     t.html(t.html().replace(/<small>/igm, '[small]').replace(/<\/small>/igm, '[/small]'));
  4784.     t.html(t.html().replace(/<hr([^>]*)>/igm, '[hr]'));
  4785.     t.html(t.html().replace(/<(b|big|strong)>/ig, '[b]').replace(/<\/(b|big|strong)>/ig, '[/b]'));
  4786.     t.html(t.html().replace(/<i>/ig, '[i]').replace(/<\/i>/ig, '[/i]'));
  4787.     t.find('iframe[src*="embed/"]').each(function() {
  4788.         $(this).replaceWith('[youtube]' + $(this).attr('src').match(/.*embed\/([^"]*)/i)[1] + '[/youtube]')
  4789.     });
  4790.     t.find('ul').each(function() {
  4791.         $(this).replaceWith('[list]' + $(this).html() + '[/list]')
  4792.     });
  4793.     t.find('ol').each(function() {
  4794.         $(this).replaceWith('[list=1]' + $(this).html() + '[/list]')
  4795.     });
  4796.     t.html(t.html().replace(/<li>/ig, '[*]'));
  4797.     t.find('a.ka-widget[widget-type][rel]').each(function() {
  4798.         $(this).replaceWith('[' + $(this).attr('widget-type') + '=' + $(this).attr('rel') + ']')
  4799.     });
  4800.     t.find('.achBadge:has(> a[rel])').each(function() {
  4801.         $(this).replaceWith('[achievement=' + $(this).find('> a[rel]').attr('rel') + ']')
  4802.     });
  4803.     t.find('span.red[title]').each(function() {
  4804.         $(this).replaceWith('[user="' + $(this).attr('title') + '"]')
  4805.     });
  4806.     t.find('.badgeInline').each(function() {
  4807.         $(this).replaceWith('[user="' + $(this).find('a.plain').html() + '"]')
  4808.     });
  4809.     t.find('img[class="emoticon"][src*="/images/smiley/"]').each(function() {
  4810.         $(this).replaceWith('[:Q' + $(this).attr('src').match(/\/images\/smiley\/([^>]+).gif/i)[1] + ']')
  4811.     });
  4812.     t.find('img[src]').each(function() {
  4813.         n = $(this);
  4814.         s = '';
  4815.         var i = n.parent(),
  4816.             t = /yuq\.me\/users\/\d+\/\d+\/([a-z0-9]+)\.(gif|png|jpg)/i,
  4817.             e = n.is('[data-original]') ? n.attr('data-original') : n.attr('src');
  4818.         if (i.is('a[href]')) {
  4819.             if (i.is('.ajaxLink')) {
  4820.                 if (n.is('[width]')) {
  4821.                     s = ' width=' + n.attr('width');
  4822.                     i.replaceWith('[img' + s + ']' + e + '[/img]')
  4823.                 } else {
  4824.                     e = i.attr('href');
  4825.                     console.log('imgsrc: ' + e + '\nTo: [image=' + (t.test(e) ? e.match(t)[1] : 'invalid image') + ']');
  4826.                     i.replaceWith('[image=' + (t.test(e) ? e.match(t)[1] : 'invalid image') + ']')
  4827.                 }
  4828.             } else {
  4829.                 if (n.is('[width]')) s = ' width=' + n.attr('width');
  4830.                 n.replaceWith('[img' + s + ']' + e + '[/img]')
  4831.             }
  4832.         } else {
  4833.             if (t.test(e)) {
  4834.                 n.replaceWith('[image=' + e.match(t)[1] + ']')
  4835.             } else {
  4836.                 n.replaceWith('[img]' + e + '[/img]')
  4837.             }
  4838.         }
  4839.     });
  4840.     t.html(t.html().replace(/<a href="[^"]*?\/users\/\d+\/\d+\/([a-z0-9]+)\.(gif|png|jpg)"[^>]*?><img[^>]*?src="[^"]*?"[^>]*?><\/a>/ig, '[image=$1]'));
  4841.     t.html(t.html().replace(/<img.*?src=".*?\/u\/\d+\/([a-z0-9]+)\.(gif|png|jpg)".*?>/ig, '[image=$1]'));
  4842.     t.html(t.html().replace(/<img src="([^>]+)">/ig, '[img]$1[\/img]'));
  4843.     t.html(t.html().replace(/<img[^>]*src=["']?([^>"]+)["'][^>]*?>/ig, '[img]$1[\/img]'));
  4844.     t.find('a[href^="/confirm/url/"]').each(function() {
  4845.         var e = atob(decodeURIComponent($(this).attr('href').match(/\/confirm\/url\/([^\/]*)/)[1])),
  4846.             t = $(this).html();
  4847.         console.log(e + '\n' + t);
  4848.         if (e == t) {
  4849.             $(this).replaceWith('[url]' + e + '[/url]')
  4850.         } else {
  4851.             $(this).replaceWith('[url="' + e + '"]' + t + '[/url]')
  4852.         }
  4853.     });
  4854.     t.html(t.html().replace(/<span><\/span>/ig, ''));
  4855.     t.html(t.html().replace(/<i class="ka ka16 ka-message"><\/i>/ig, ''));
  4856.     t.find('.vtipContentjs').remove();
  4857.     t.html(t.html().replace(/<span class="blank"><\/span>[^>]+<\/span>/ig, ''));
  4858.     var i = t.html();
  4859.     i = i.replace(/<a class="plain" href="\/user\/([^>"]+)\/"><strong>([^>]+)<\/strong><\/a>/gi, '[user="$1"]');
  4860.     i = i.replace(/<a class="plain" href="\/user\/([^>\/"]+)\/">([^>]+)<\/a>/gi, '[user="$1"]');
  4861.     i = i.replace(/<span class="blank"><\/span>[^>]+<\/span>/gi, '');
  4862.     i = i.replace(/<a [^>]*href="\/messenger\/create\/[^>]+imessage"><\/a>/gi, '');
  4863.     i = i.replace(/class="repValue[^>]+>[^<]+<\/span>/gi, '></span>');
  4864.     i = i.replace(/<STRONG>/gi, '[b]');
  4865.     i = i.replace(/<\/STRONG>/gi, '[/b]');
  4866.     i = i.replace(/<a[^>]*?href="\/confirm\/url[^>]+>(https?[^>]+)<\/a>/gi, '[url]$1[\/url]');
  4867.     i = i.replace(/<a rel="nofollow" href="[^>"]+\/user\/([^>\/"]+)\/">.+\/user\/([^>"]+)\/<\/a>/gi, '[user="$1"]$2[\/user]');
  4868.     i = i.replace(/<a rel="nofollow" href="[^>"]+\/user\/([^>\/"]+)\/">([^>]+)<\/a>/gi, '[user="$1"]$2[\/user]');
  4869.     i = i.replace(/<a rel="nofollow" href="([^>"]+)">([^>]+)<\/a>/gi, '[url="$1"]$2[\/url]');
  4870.     i = i.replace(/<P>/gi, '\r\r');
  4871.     i = i.replace(/<\/P>/gi, '');
  4872.     i = i.replace(/<P [^>]*>/gi, '\r\r');
  4873.     i = i.replace(/<a[^>]+href=["']([^>"']+)["'][^>]*>([^>]+)<\/a>/gi, '[url="$1"]$2[\/url]');
  4874.     i = i.replace(/<A HREF/i, '[url');
  4875.     i = i.replace(/<\/A>/i, '[/url]');
  4876.     i = i.replace(/<[^>]*>/g, '');
  4877.     i = i.replace(/">/g, '"]');
  4878.     i = i.replace(/&lt;/ig, '<').replace(/&gt;/ig, '>');
  4879.     return i
  4880. };
  4881.  
  4882. function showAlbum(e, t) {
  4883.     var i = $(e).parent().parent().find('.container_js'),
  4884.         n = $(e).parent();
  4885.     if (i.is(':visible')) {
  4886.         i.fadeOut('fast');
  4887.         n.removeClass('versionsUnFolded');
  4888.         n.addClass('versionsFolded');
  4889.         return !1
  4890.     };
  4891.     $.ajax({
  4892.         type: 'POST',
  4893.         url: '/media/getalbum/' + t + '/',
  4894.         dataType: 'json',
  4895.         error: function() {
  4896.             i.html('<center>Something nasty happened. Please try to reload a page or visit kastatus.com for details.</center>')
  4897.         },
  4898.         beforeSend: function() {
  4899.             i.html('<img src="/static/kar/images/indicator.gif" alt="loading..."/>');
  4900.             i.fadeIn('fast')
  4901.         },
  4902.         success: function(e) {
  4903.             i.html(e.html);
  4904.             n.removeClass('versionsFolded');
  4905.             n.addClass('versionsUnFolded')
  4906.         }
  4907.     });
  4908.     return !1
  4909. };
  4910.  
  4911. function showEpisodeInfo(e, t) {
  4912.     var i = $(e).parent().parent().find('.container_js'),
  4913.         n = $(e).parent();
  4914.     if (i.is(':visible')) {
  4915.         i.fadeOut('fast');
  4916.         n.removeClass('versionsUnFolded');
  4917.         n.addClass('versionsFolded');
  4918.         return !1
  4919.     };
  4920.     $.ajax({
  4921.         type: 'POST',
  4922.         url: '/media/getepisode/' + t + '/',
  4923.         dataType: 'json',
  4924.         error: function() {
  4925.             i.html('<center>Something nasty happened. Please try to reload a page or visit kastatus.com for details.</center>')
  4926.         },
  4927.         beforeSend: function() {
  4928.             i.html('<img src="/static/kar/images/indicator.gif" alt="loading..."/>');
  4929.             i.fadeIn('fast')
  4930.         },
  4931.         success: function(e) {
  4932.             i.html(e.html);
  4933.             n.removeClass('versionsFolded');
  4934.             n.addClass('versionsUnFolded')
  4935.         }
  4936.     });
  4937.     return !1
  4938. };
  4939.  
  4940. function showAnimeEpisodeInfo(e, t) {
  4941.     var i = $(e).parent().parent().find('.container_js'),
  4942.         n = $(e).parent();
  4943.     if (i.is(':visible')) {
  4944.         i.fadeOut('fast');
  4945.         n.removeClass('versionsUnFolded');
  4946.         n.addClass('versionsFolded');
  4947.         return !1
  4948.     };
  4949.     $.ajax({
  4950.         type: 'POST',
  4951.         url: '/media/getanimeepisode/' + t + '/',
  4952.         dataType: 'json',
  4953.         error: function() {
  4954.             i.html('<center>Something nasty happened. Please try to reload a page or visit kastatus.com for details.</center>')
  4955.         },
  4956.         beforeSend: function() {
  4957.             i.html('<img src="/static/kar/images/indicator.gif" alt="loading..."/>');
  4958.             i.fadeIn('fast')
  4959.         },
  4960.         success: function(e) {
  4961.             i.html(e.html);
  4962.             n.removeClass('versionsFolded');
  4963.             n.addClass('versionsUnFolded')
  4964.         }
  4965.     });
  4966.     return !1
  4967. };
  4968.  
  4969. function toggleQuestions(e, t) {
  4970.     if ($('#' + e + '_group').is(':visible')) {
  4971.         $('#' + e + '_group').fadeOut('fast');
  4972.         $(t).parent().removeClass('questionGroupUnFolded');
  4973.         $(t).parent().addClass('questionGroupFolded');
  4974.         return !1
  4975.     } else {
  4976.         $('#' + e + '_group').fadeIn('fast');
  4977.         $(t).parent().removeClass('questionGroupFolded');
  4978.         $(t).parent().addClass('questionGroupUnFolded')
  4979.     }
  4980. };
  4981.  
  4982. function showNewComments(e) {
  4983.     if ($('#torrent_' + e).is(':visible')) {
  4984.         $('#torrent_' + e).fadeOut('fast');
  4985.         $('#infoList_' + e).removeClass('versionsUnFolded');
  4986.         $('#infoList_' + e).addClass('versionsFolded');
  4987.         return !1
  4988.     };
  4989.     $.ajax({
  4990.         type: 'POST',
  4991.         url: '/account/new_comments/',
  4992.         data: {
  4993.             ajax: 1,
  4994.             torrentId: e
  4995.         },
  4996.         dataType: 'json',
  4997.         beforeSend: function() {
  4998.             $('#torrent_' + e).html('<img src="/static/kar/images/indicator.gif" alt="loading..."/>');
  4999.             $('#torrent_' + e).fadeIn('fast')
  5000.         },
  5001.         success: function(t) {
  5002.             $('#torrent_' + e).html(t.html);
  5003.             $('#infoList_' + e).removeClass('versionsFolded');
  5004.             $('#infoList_' + e).addClass('versionsUnFolded')
  5005.         }
  5006.     });
  5007.     return !1
  5008. };
  5009.  
  5010. function getCategories(e, t) {
  5011.     $.ajax({
  5012.         type: 'POST',
  5013.         url: '/torrents/getcategory/' + t + '/' + e + '/',
  5014.         dataType: 'json',
  5015.         beforeSend: function() {
  5016.             $('#cat_place_' + e).html('<img src="/static/kar/images/indicator.gif" alt="loading..."/>')
  5017.         },
  5018.         success: function(t) {
  5019.             $('#cat_place_' + e).html(t.html).show()
  5020.         }
  5021.     });
  5022.     return !1
  5023. };
  5024.  
  5025. function validateIdea(e) {
  5026.     if ((e.text.value == '')) {
  5027.         alert('Please fill the description field');
  5028.         return !1
  5029.     };
  5030.     if ((e.name.value.length < 4)) {
  5031.         alert('Idea name is too short');
  5032.         return !1
  5033.     };
  5034.     if ((e.category.value == '')) {
  5035.         alert('Please select category');
  5036.         return !1
  5037.     };
  5038.     return !0
  5039. };
  5040. var force_submit_idea = !1;
  5041.  
  5042. function searchSimilarIdeas(e) {
  5043.     if (!validateIdea(e)) return !1;
  5044.     var t = $(e).serialize();
  5045.     t = t + '&ajax=1' + (force_submit_idea ? '&force=1' : '');
  5046.     e.submit.disabled = !0;
  5047.     $.ajax({
  5048.         type: 'POST',
  5049.         url: '/ideabox/create/',
  5050.         data: t,
  5051.         dataType: 'json',
  5052.         beforeSend: function() {
  5053.             $('#similar_ideas').html('<img src="/static/kar/images/indicator.gif">');
  5054.             e.submit.disabled = !0
  5055.         },
  5056.         success: function(t) {
  5057.             e.submit.disabled = !1;
  5058.             if (t.idea_link != undefined) {
  5059.                 document.location = t.idea_link;
  5060.                 return !1
  5061.             } else if (t.method == 'error') {
  5062.                 $('#similar_ideas').attr('style', 'color: red;')
  5063.             } else {
  5064.                 $('#butsave').html('<span>save</span>')
  5065.             };
  5066.             $('#similar_ideas').html(t.html);
  5067.             $('#similar_ideas').fadeIn('fast');
  5068.             force_submit_idea = !0
  5069.         },
  5070.         error: function(t) {
  5071.             $('#similar_ideas').html('<center>Something nasty happened. Please try to reload a page or visit kastatus.com for details.</center>');
  5072.             e.submit.disabled = !1
  5073.         }
  5074.     });
  5075.     return !1
  5076. };
  5077.  
  5078. function getSubcategory(e) {
  5079.     $.ajax({
  5080.         type: 'POST',
  5081.         url: '/torrents/getcategory/' + $('#categoryId_' + e + ' :selected').val() + '/' + e + '/',
  5082.         dataType: 'json',
  5083.         beforeSend: function() {
  5084.             $('#cat_place_' + e).html('<img src="/static/kar/images/indicator.gif">')
  5085.         },
  5086.         success: function(t) {
  5087.             $('#cat_place_' + e).html(t.html)
  5088.         }
  5089.     });
  5090.     return !1
  5091. };
  5092.  
  5093. function setCategory(e) {
  5094.     var i = $('#sub_cat_' + e + ' :selected').val() != undefined ? $('#sub_cat_' + e + ' :selected').val() : 0,
  5095.         t = $('#cat_' + e).html();
  5096.     $.ajax({
  5097.         type: 'POST',
  5098.         url: '/moderator/torrent/changecategory/' + e + '/',
  5099.         data: {
  5100.             ajax: 1,
  5101.             categoryId: $('#categoryId_' + e + ' :selected').val(),
  5102.             sub_cat: i
  5103.         },
  5104.         dataType: 'json',
  5105.         beforeSend: function() {
  5106.             $('#cat_' + e).html('<img src="/static/kar/images/indicator.gif" alt="loading..."/>')
  5107.         },
  5108.         success: function(i) {
  5109.             if (i.method == 'error') {
  5110.                 alert(i.html);
  5111.                 $('#cat_' + e).html(t)
  5112.             } else {
  5113.                 $('#cat_' + e).html(i.html)
  5114.             };
  5115.             $('#cat_place_' + e).hide()
  5116.         }
  5117.     });
  5118.     return !1
  5119. };
  5120.  
  5121. function requestReseed(e, t) {
  5122.     $.ajax({
  5123.         type: 'POST',
  5124.         url: '/torrents/requestreseed/' + e + '/',
  5125.         data: {
  5126.             ajax: 1
  5127.         },
  5128.         dataType: 'json',
  5129.         beforeSend: function(e) {
  5130.             $(t).html('<img src="/static/kar/images/indicator.gif" alt="loading..."/>')
  5131.         },
  5132.         success: function(e) {
  5133.             $(t).hide();
  5134.             $('#reseed_div').html('RESEED HAS BEEN REQUESTED FOR THIS TORRENT').show()
  5135.         }
  5136.     });
  5137.     return !1
  5138. };
  5139.  
  5140. function hideSidebar() {
  5141.     $('#sidebar').hide();
  5142.     $('#hidesidebar').hide();
  5143.     $('#showsidebar').show();
  5144.     $.post('/account/hidesidebar/', {
  5145.         hide: 1,
  5146.         ajax: 1
  5147.     });
  5148.     return !1
  5149. };
  5150.  
  5151. function showSidebar() {
  5152.     $('#sidebar').show();
  5153.     $('#hidesidebar').show();
  5154.     $('#showsidebar').hide();
  5155.     $.post('/account/hidesidebar/', {
  5156.         hide: 0,
  5157.         ajax: 1
  5158.     });
  5159.     return !1
  5160. };
  5161.  
  5162. function saveAndClosePartner(e) {
  5163.     $.cookie('partner' + e, '1', {
  5164.         expires: 365,
  5165.         path: '/'
  5166.     });
  5167.     $('#promoPartner' + e).fadeOut('fast')
  5168. };
  5169.  
  5170. function saveAndCloseLeech() {
  5171.     $.cookie('leech', '1', {
  5172.         expires: 365,
  5173.         path: '/'
  5174.     });
  5175.     $('#promoLeechmonster').fadeOut('fast')
  5176. };
  5177.  
  5178. function saveFriendRequest(e) {
  5179.     $.ajax({
  5180.         type: 'POST',
  5181.         url: e.href,
  5182.         data: {
  5183.             ajax: '1'
  5184.         },
  5185.         dataType: 'json',
  5186.         success: function(t) {
  5187.             if (t.method == 'error') return alert(t.html);
  5188.             $(e).parent().parent().parent().fadeOut('fast').remove()
  5189.         }
  5190.     });
  5191.     return !1
  5192. };
  5193.  
  5194. function uploadChangeCat() {
  5195.     $.ajax({
  5196.         type: 'POST',
  5197.         url: '/torrents/getcategory/' + $('#categoryId :selected').val() + '/',
  5198.         dataType: 'json',
  5199.         beforeSend: function() {
  5200.             $('#subcat').html('<img src="/static/kar/images/indicator.gif">')
  5201.         },
  5202.         success: function(e) {
  5203.             var t = $('#categoryId :selected').val();
  5204.             $('#tvshow,#movie,#game,#book,#anime,#music,#langs,#subs,#scrcp,#scrns,#completeness').hide();
  5205.             if (t == 2) {
  5206.                 $('#movie,#langs,#subs,#scrcp,#scrns,#completeness').show()
  5207.             } else if (t == 21) {
  5208.                 $('#tvshow,#langs,#subs,#scrcp,#scrns,#completeness').show()
  5209.             } else if (t == 4) {
  5210.                 $('#game,#langs,#scrns,#completeness').show()
  5211.             } else if (t == 6) {
  5212.                 $('#scrcp,#scrns,#completeness').show()
  5213.             } else if (t == 7) {
  5214.                 $('#anime,#langs,#subs,#scrcp,#scrns').show()
  5215.             } else if (t == 9) {
  5216.                 $('#book').show()
  5217.             } else if (t == 12) {
  5218.                 $('#music').show()
  5219.             };
  5220.             $('#subcat').html(e.html)
  5221.         }
  5222.     })
  5223. };
  5224.  
  5225. function toggleTags(e, t) {
  5226.     t = t || 0;
  5227.     if (t) {
  5228.         $.ajax({
  5229.             type: 'POST',
  5230.             url: '/account/toggletagcloud/show/',
  5231.             dataType: 'json',
  5232.             success: function(e) {
  5233.                 $('#tagcloud').html(e.html).slideDown('normal')
  5234.             }
  5235.         });
  5236.         $(e).html('<span class="font80perc">&#x25B2;</span>');
  5237.         $(e).prop('title', 'Hide tagcloud');
  5238.         $(e).attr('onclick', 'toggleTags(this);')
  5239.     } else {
  5240.         $('#tagcloud').slideUp('normal');
  5241.         $.post('/account/toggletagcloud/hide/');
  5242.         $(e).prop('title', 'Show tagcloud');
  5243.         $(e).html('<span class="font80perc">&#x25BC;</span>');
  5244.         $(e).attr('onclick', 'toggleTags(this, 1);')
  5245.     }
  5246. };
  5247.  
  5248. function uploadFile(e) {
  5249.     $(e).parent().find('.switchRight').removeClass('active');
  5250.     $(e).addClass('active');
  5251.     $('#fileinput_container').html('<input type=\'file\' name=\'file\' class=\'primary inputfile\' />').find('input[type=file]').customFileInput();
  5252.     return !1
  5253. };
  5254.  
  5255. function uploadUrl(e) {
  5256.     $(e).parent().find('.switchLeft').removeClass('active');
  5257.     $(e).addClass('active');
  5258.     $('#fileinput_container').html('<input type=\'url\' class=\'primary textinput longtextinput\' name=\'uploadUrl\' value=\'\' />');
  5259.     return !1
  5260. };
  5261.  
  5262. function setLanguage(e, t) {
  5263.     $('#langSelectorLine').hide();
  5264.     $.cookie('lang_code', e, {
  5265.         expires: 365,
  5266.         path: '/',
  5267.         domain: t
  5268.     });
  5269.     $.post('/account/switch_language/' + e + '/');
  5270.     window.location.reload()
  5271. };
  5272.  
  5273. function refreshMeta(e) {
  5274.     var t = Math.floor(Math.random() * 99999999999);
  5275.     $.ajax({
  5276.         type: 'POST',
  5277.         url: $(e).attr('href'),
  5278.         dataType: 'json',
  5279.         beforeSend: function() {
  5280.             $(e).replaceWith('<img id="prg' + t + '" src="/static/kar/images/indicator.gif">')
  5281.         },
  5282.         success: function(e) {
  5283.             $('#prg' + t).replaceWith('ok')
  5284.         }
  5285.     });
  5286.     return !1
  5287. };
  5288.  
  5289. function doLogout(e) {
  5290.     var t = e ? document[e] : document.logoutform;
  5291.     t.submit();
  5292.     return !1
  5293. };
  5294. $.fn.makePost = function(e) {
  5295.     if (!$(this).length) {
  5296.         return this
  5297.     };
  5298.     $(this).unbind('click.pst').bind('click.pst', function(e) {
  5299.         e.preventDefault();
  5300.         $(this).blur();
  5301.         $.post($(this).attr('href'), {}, function(e) {
  5302.             if (e.method == 'error') {
  5303.                 alert('Error: ' + e.html)
  5304.             } else {
  5305.                 document.location.reload()
  5306.             }
  5307.         }, 'json').error(function(e) {
  5308.             alert('XHR Error: ' + e.responseText)
  5309.         });
  5310.         return
  5311.     });
  5312.     return this
  5313. };
  5314. (function(e, t, i, n) {
  5315.     e.fn.doubleTapToGo = function(n) {
  5316.         if (!('ontouchstart' in t) && !navigator.msMaxTouchPoints && !navigator.userAgent.toLowerCase().match(/windows phone os 7/i)) return !1;
  5317.         this.each(function() {
  5318.             var t = !1;
  5319.             e(this).on('click', function(i) {
  5320.                 var n = e(this);
  5321.                 if (n[0] != t[0]) {
  5322.                     i.preventDefault();
  5323.                     t = n
  5324.                 }
  5325.             });
  5326.             e(i).on('click touchstart MSPointerDown', function(i) {
  5327.                 var r = !0,
  5328.                     s = e(i.target).parents();
  5329.                 for (var n = 0; n < s.length; n++) if (s[n] == t[0]) r = !1;
  5330.                 if (r) t = !1
  5331.             })
  5332.         });
  5333.         return this
  5334.     }
  5335. })(jQuery, window, document);
  5336. $(function() {
  5337.     $('a.ajaxLink').fancybox();
  5338.     $('a.postLink').makePost();
  5339.     $('#translate_link').fancybox({
  5340.         autoDimensions: !1,
  5341.         width: 500
  5342.     });
  5343.     var t = 'ch|tw|bn'.split('|');
  5344.     if (t.indexOf($.cookie('lang_code')) >= 0) {
  5345.         var i = '#navigation li a .menuItem:not(.usernameProfile), #navigation li .dropdown li a, footer ul li a, .sliderbox ul li span.explanation, .data tr th a, .font11px, small, .font10px, .firstPost strong, #translate_link strong';
  5346.         $(i).addClass('thinGlyph')
  5347.     };
  5348.     $(document).on('click', 'td.forumhideJS', function() {
  5349.         var n = $(this),
  5350.             t = n.attr('rel'),
  5351.             e = $('#forum_' + t),
  5352.             i = e.hasClass('hideBlockJS') ? null : 1;
  5353.         $.cookie('kat_settings[hide_forum][' + t + ']', i, {
  5354.             expires: 365,
  5355.             path: '/'
  5356.         });
  5357.         e.slideToggle('normal');
  5358.         if (e.hasClass('hideBlockJS')) {
  5359.             e.removeClass('hideBlockJS').addClass('showBlockJS')
  5360.         } else {
  5361.             e.removeClass('showBlockJS').addClass('hideBlockJS')
  5362.         }
  5363.     });
  5364.     $(document).on('click', '.foldClose', function() {
  5365.         var t = $(this).parent().parent().find('ul').attr('rel'),
  5366.             e = $('#' + t),
  5367.             i = e.hasClass('hideBlockJS') ? null : 1;
  5368.         $.cookie('kat_settings[sidebar][' + t + ']', i, {
  5369.             expires: 365,
  5370.             path: '/'
  5371.         });
  5372.         if (e.hasClass('hideBlockJS')) {
  5373.             e.removeClass('hideBlockJS').addClass('showBlockJS');
  5374.             $(this).removeClass('ka-arrow2-down').addClass('ka-arrow2-up')
  5375.         } else {
  5376.             e.removeClass('showBlockJS').addClass('hideBlockJS');
  5377.             $(this).removeClass('ka-arrow2-up').addClass('ka-arrow2-down')
  5378.         }
  5379.     });
  5380.     $(document).on('click', '#toggleAch', function() {
  5381.         var e = $('table .achTable'),
  5382.             t = e.hasClass('hideBlockJS') ? null : 1;
  5383.         $.cookie('kat_settings[hide_achievements]', t, {
  5384.             expires: 365,
  5385.             path: '/'
  5386.         });
  5387.         e.toggle();
  5388.         if (e.hasClass('hideBlockJS')) {
  5389.             e.removeClass('hideBlockJS').addClass('showBlockJS')
  5390.         } else {
  5391.             e.removeClass('showBlockJS').addClass('hideBlockJS')
  5392.         }
  5393.     });
  5394.     $(document).on('click', '#toggleFriends', function() {
  5395.         var e = $('#onlineFriends'),
  5396.             t = e.hasClass('hideBlockJS') ? 0 : 1;
  5397.         $.cookie('kat_settings[hide_friends]', t, {
  5398.             expires: 365,
  5399.             path: '/'
  5400.         });
  5401.         e.toggle();
  5402.         if (e.hasClass('hideBlockJS')) {
  5403.             e.removeClass('hideBlockJS').addClass('showBlockJS')
  5404.         } else {
  5405.             e.removeClass('showBlockJS').addClass('hideBlockJS')
  5406.         }
  5407.     });
  5408.     $(document).on('click', '#toggleAwaiting', function() {
  5409.         var e = $('#awaitingFriends'),
  5410.             t = e.hasClass('hideBlockJS') ? 0 : 1;
  5411.         $.cookie('kat_settings[hide_friends_awaiting]', t, {
  5412.             expires: 365,
  5413.             path: '/'
  5414.         });
  5415.         e.toggle();
  5416.         if (e.hasClass('hideBlockJS')) {
  5417.             e.removeClass('hideBlockJS').addClass('showBlockJS')
  5418.         } else {
  5419.             e.removeClass('showBlockJS').addClass('hideBlockJS')
  5420.         }
  5421.     });
  5422.     $(document).on('click', '#togglePending', function() {
  5423.         var e = $('#pendingFriends'),
  5424.             t = e.hasClass('hideBlockJS') ? 0 : 1;
  5425.         $.cookie('kat_settings[hide_friends_pending]', t, {
  5426.             expires: 365,
  5427.             path: '/'
  5428.         });
  5429.         e.toggle();
  5430.         if (e.hasClass('hideBlockJS')) {
  5431.             e.removeClass('hideBlockJS').addClass('showBlockJS')
  5432.         } else {
  5433.             e.removeClass('showBlockJS').addClass('hideBlockJS')
  5434.         }
  5435.     });
  5436.     $(document).on('click', '.hideChatBar', function() {
  5437.         $.cookie('kat_settings[chatbar]', 1, {
  5438.             expires: 365,
  5439.             path: '/'
  5440.         });
  5441.         $('#chat-bar-full').hide();
  5442.         $('#chat-bar-short').show();
  5443.         $('.chat-bar').addClass('chat-bar-short')
  5444.     });
  5445.     $(document).on('click', '.showChatBar', function() {
  5446.         $.cookie('kat_settings[chatbar]', null, {
  5447.             expires: 365,
  5448.             path: '/'
  5449.         });
  5450.         $('#chat-bar-full').show();
  5451.         $('#chat-bar-short').hide();
  5452.         $('.chat-bar').removeClass('chat-bar-short')
  5453.     });
  5454.     $(document).on('click', '.closeChatBar', function() {
  5455.         $.cookie('kat_settings[chatbar]', 2, {
  5456.             expires: 365,
  5457.             path: '/'
  5458.         });
  5459.         $('.chat-bar').hide()
  5460.     });
  5461.     $(document).on('keypress', '.quicksubmit', function(e) {
  5462.         if (e.keyCode == 13 && e.shiftKey) {
  5463.             $(this).parents('form').eq(0).submit();
  5464.             return !1
  5465.         }
  5466.     });
  5467.     $('.comareajs').each(function() {
  5468.         $(this).bbedit()
  5469.     }).one('focus', function(e) {
  5470.         var t = $(this).parent().find('.captchaformjs');
  5471.         t.show();
  5472.         t.find('img').trigger('click')
  5473.     });
  5474.     $.fancybox.queue($('#achievements').children().toArray(), {
  5475.         timeout: 30000,
  5476.         onNext: function(e) {
  5477.             $.post('/achievement/mark/' + $(e).data('achievement-id') + '/')
  5478.         }
  5479.     });
  5480. if (kat.detect_lang && $.cookie('lang_detected') == null) {
  5481.         $.ajax({
  5482.             type: 'POST',
  5483.             url: '/detectlang/',
  5484.             dataType: 'json',
  5485.             success: function(e) {
  5486.                 if (e != null) $('#langSelectorLine').html(e.html).slideDown('normal')
  5487.             }
  5488.         })
  5489.     };
  5490.     try {
  5491.         $('img.lazyjs').lazyload({
  5492.             effect: 'fadeIn'
  5493.         })
  5494.     } catch (e) {};
  5495.     $(document).on('click', 'img.captcha', function() {
  5496.         this.src = '/captcha/show/?' + Math.floor(Math.random() * 10000)
  5497.     });
  5498.     $(document).on('click', '.captchareload', function() {
  5499.         $(this).parent().find('img.captcha').click()
  5500.     });
  5501.     $(document).on('click', '.spoiler_toggle', function() {
  5502.         $(this).parent().parent().toggleClass('spoiler_opened').find('.spoiler_js').first().toggle()
  5503.     });
  5504.     $('.askFeedbackjs').click(function() {
  5505.         var e = $(this),
  5506.             i = e.attr('href'),
  5507.             t = e.data('id');
  5508.         if (t) {
  5509.             $.post('/account/askfeedback/' + t + '/', {}, function(e) {
  5510.                 if (e.method == 'error') {
  5511.                     alert('Error: ' + e.html)
  5512.                 } else {
  5513.                     updateFeedback();
  5514.                     document.location.href = i
  5515.                 }
  5516.             }, 'json').error(function(e) {
  5517.                 alert('XHR Error: ' + e.responseText);
  5518.                 console.log(e)
  5519.             });
  5520.             return !1
  5521.         } else {
  5522.             updateFeedback()
  5523.         }
  5524.     });
  5525.     $('.voteButton_js').on('click', function(e) {
  5526.         e.preventDefault();
  5527.         var t = $(this).parent(),
  5528.             i = $(this).is('.ka-thumbs-up');
  5529.         $.ajax({
  5530.             type: 'POST',
  5531.             dataType: 'json',
  5532.             url: $(this).attr('href'),
  5533.             beforeSend: function() {
  5534.                 t.find('.ratemark').html('<img src="/static/kar/images/indicator.gif">').removeClass('plus minus');
  5535.                 t.find('.ratemark .ka').remove()
  5536.             },
  5537.             success: function(e) {
  5538.                 t.find('.ka16').remove();
  5539.                 if (e.method == 'ok') {
  5540.                     t.prepend('<a class="ka kasmall ka16 ' + (i ? 'ka-thumbs-up' : 'ka-thumbs-down') + ' ka-disabled"><span></span></a>');
  5541.                     var n = parseInt(e.html);
  5542.                     t.find('.ratemark').html(e.html).addClass((n > 0 ? 'plus' : (n < 0 ? 'minus' : ''))).prepend('<i class="ka ka-arrow2-' + (n > 0 ? 'up' : 'down') + '"></i>')
  5543.                 } else {
  5544.                     t.find('.ratemark').html('error')
  5545.                 }
  5546.             },
  5547.             error: function() {
  5548.                 t.find('.ka16').remove();
  5549.                 t.find('.ratemark').html('error')
  5550.             }
  5551.         })
  5552.     });
  5553.     $(document).on('click', '#showHideSearch', function(e) {
  5554.         e.preventDefault();
  5555.         var t = $(this);
  5556.         $('#torrentSearch').slideToggle('fast');
  5557.         if (t.hasClass('ka-delete')) t.attr('class', 'ka ka-zoom');
  5558.         else if (t.hasClass('ka-zoom')) t.attr('class', 'ka ka-delete')
  5559.     });
  5560.     if (('ontouchstart' in document.documentElement)) {
  5561.         $('#tagcloud').hide().addClass('folded')
  5562.     };
  5563.     $('#navigation li:has(ul)').doubleTapToGo();
  5564.     $('.icommentjs').doubleTapToGo();
  5565.     $('.checkboxchecker').each(populateCheckBoxes());
  5566.     $('#thnxLink,#fakeLink').click(function() {
  5567.         var t = $(this),
  5568.             i = t.data('hash'),
  5569.             e;
  5570.         if (t.is('.jslike')) {
  5571.             e = 'like'
  5572.         } else if (t.is('.jsunlike')) {
  5573.             e = 'unlike'
  5574.         } else if (t.is('.jsdislike')) {
  5575.             e = 'dislike'
  5576.         } else if (t.is('.jsundislike')) {
  5577.             e = 'undislike'
  5578.         } else {
  5579.             return !1
  5580.         };
  5581.         $.ajax({
  5582.             type: 'POST',
  5583.             url: '/torrents/vote/' + e + '/' + i + '/',
  5584.             dataType: 'json',
  5585.             success: function(t) {
  5586.                 if (t.method == 'error') {
  5587.                     alert(t.html);
  5588.                     return
  5589.                 };
  5590.                 $('#thnxCount span').html(t.thanks_count != 0 ? '+' + t.thanks_count : 0);
  5591.                 $('#fakeCount span').html(t.fakes_count != 0 ? '-' + t.fakes_count : 0);
  5592.                 var n = $('#thnxLink'),
  5593.                     i = $('#fakeLink');
  5594.                 switch (e) {
  5595.                 case 'like':
  5596.                     n.removeClass('jslike').addClass('jsunlike');
  5597.                     i.removeClass('jsdislike').addClass('gfunchecked');
  5598.                     break;
  5599.                 case 'unlike':
  5600.                     n.removeClass('jsunlike').addClass('jslike');
  5601.                     i.removeClass('gfunchecked').addClass('jsdislike');
  5602.                     break;
  5603.                 case 'dislike':
  5604.                     n.removeClass('jslike').addClass('gfunchecked');
  5605.                     i.removeClass('jsdislike').addClass('jsundislike');
  5606.                     break;
  5607.                 case 'undislike':
  5608.                     n.removeClass('gfunchecked').addClass('jslike');
  5609.                     i.removeClass('jsundislike').addClass('jsdislike');
  5610.                     break
  5611.                 }
  5612.             }
  5613.         });
  5614.         return !1
  5615.     });
  5616.     jQuery('.timeago').timeago()
  5617. });
  5618.  
  5619. function populateCheckBoxes() {
  5620.     return function() {
  5621.         var e = $(this),
  5622.             i = e.data('selector'),
  5623.             t = $(i);
  5624.         e.click(function(i) {
  5625.             t.prop('checked', e.prop('checked'));
  5626.             i.stopPropagation()
  5627.         });
  5628.         t.click(function(i) {
  5629.             var n = !0;
  5630.             t.each(function() {
  5631.                 if (!$(this).prop('checked')) {
  5632.                     n = !1;
  5633.                     return !1
  5634.                 }
  5635.             });
  5636.             e.prop('checked', n);
  5637.             i.stopPropagation()
  5638.         })
  5639.     }
  5640. };
  5641.  
  5642. function updateMessagesCount(e) {
  5643.     var n = $('#menu_messages_count'),
  5644.         t = n.find('a'),
  5645.         i = n.find('i');
  5646.     if (e) {
  5647.         if (!i.size()) {
  5648.             t.fancybox();
  5649.             t.attr('href', '/messenger/unread/');
  5650.             i = $('<i />').addClass('menuValue valueBubble').appendTo(t)
  5651.         };
  5652.         i.html(e).show()
  5653.     } else {
  5654.         t.unbind('click.fb');
  5655.         t.attr('href', '/messenger/');
  5656.         i.remove()
  5657.     }
  5658. };
  5659.  
  5660. function confirm_url(e) {
  5661.     dont = $(e).prop('checked') ? 1 : null;
  5662.     $.cookie('kat_settings[dont_ask]', dont, {
  5663.         expires: 365,
  5664.         path: '/'
  5665.     })
  5666. };
  5667. $(function() {
  5668.     $.fn.extend({
  5669.         addFilters: function() {
  5670.             return this.each(function() {
  5671.                 $(this).find('tr.firstr > *').each(function() {
  5672.                     $(this).attr('style', 'width: ' + $(this).width() + 'px !important')
  5673.                 });
  5674.                 $(this).find('tr.firstr > :eq(0)').html('<select class="tableFilter" id="tableFilter_event"><option value="">Event</option></select>');
  5675.                 $(this).find('tr.firstr > :eq(1)').html('<select class="tableFilter" id="tableFilter_performer"><option value="">Performed by</option></select>');
  5676.                 filterEvents = [];
  5677.                 filterPerformers = [];
  5678.                 var t, e;
  5679.                 $(this).find('tr:not(.firstr)').each(function() {
  5680.                     t = $(this).find(':eq(0)').text();
  5681.                     e = $(this).find(':eq(1) .badgeInline .plain').text();
  5682.                     if (filterEvents.indexOf(t) < 0) {
  5683.                         filterEvents.push(t);
  5684.                         $('#tableFilter_event').append('<option value="' + t + '">' + t + '</option>')
  5685.                     };
  5686.                     if (filterPerformers.indexOf(e) < 0) {
  5687.                         filterPerformers.push(e);
  5688.                         $('#tableFilter_performer').append('<option value="' + e + '">' + e + '</option>')
  5689.                     }
  5690.                 })
  5691.             })
  5692.         }
  5693.     });
  5694.     $(document).delegate('.tableFilter', 'change', function() {
  5695.         $(this).closest('table').find('tr:not(.firstr)').each(function() {
  5696.             $(this).hide();
  5697.             if (($(this).find(':eq(0)').text() == $('#tableFilter_event').val() || $('#tableFilter_event').val() == '') && ($(this).find(':eq(1) .badgeInline .plain').text() == $('#tableFilter_performer').val() || $('#tableFilter_performer').val() == '')) $(this).show()
  5698.         })
  5699.     })
  5700. });
  5701. $(function() {
  5702.     $('#feedback').click(function() {
  5703.         var e = $('<div />').css({
  5704.             position: 'absolute',
  5705.             zIndex: 9990,
  5706.             cursor: 'crosshair',
  5707.             left: 0,
  5708.             top: 0,
  5709.             width: $(document).width(),
  5710.             height: $(document).height(),
  5711.             background: '#000',
  5712.             opacity: 0.5
  5713.         }).appendTo('body');
  5714.         var t = $('<div />').css({
  5715.             color: '#fff',
  5716.             position: 'fixed',
  5717.             top: '50%',
  5718.             left: '50%',
  5719.             width: '100px',
  5720.             marginLeft: '-50px',
  5721.             lineHeight: '16px',
  5722.             fontWeight: 'bold'
  5723.         }).append($('<img />').attr('src', '/static/kar/images/indicator.gif').css({
  5724.             marginRight: '5px',
  5725.             verticalAlign: 'top'
  5726.         })).append('Loading...').appendTo(e);
  5727.         $(window).bind('keypress.fb', function(i) {
  5728.             if (i.keyCode == 27) {
  5729.                 $(window).unbind('keypress.fb');
  5730.                 t.remove();
  5731.                 e.remove()
  5732.             }
  5733.         });
  5734.         $.getScript('/content/js/feedback/html2canvas.min-' + kat.release_id + '.js', function() {
  5735.             $.getJSON('/issue/form/?_=' + new Date().getTime(), function(i) {
  5736.                 $.getScript('/content/js/feedback/feedback-' + kat.release_id + '.js', function() {
  5737.                     t.remove();
  5738.                     $(window).unbind('.fb');
  5739.                     $('body').feedback(i.html, e);
  5740.                     $('.lazyjs').lazyload()
  5741.                 })
  5742.             })
  5743.         });
  5744.         return !1
  5745.     })
  5746. });
Add Comment
Please, Sign In to add comment