PageSourceSearch

https://inni.info/f/js/v240.26.js

js inni.info collected 2026-10-04 17:45:56 UTC 530,323 bytes, 537 lines download raw bytes

vendor: 86,841 bytes, line 1
1!function(e,t){"use strict";"object"==typeof module&&"object"==typeof module.exports?module.exports=e.document?t(e,!0):function(e){if(!e.document)throw new Error("jQuery requires a window with a document");return t(e)}:t(e)}("undefined"!=typeof window?window:this,function(e,t){"use strict";var n=[],r=e.document,i=Object.getPrototypeOf,o=n.slice,a=n.concat,s=n.push,u=n.indexOf,l={},c=l.toString,f=l.hasOwnProperty,p=f.toString,d=p.call(Object),h={},g=function e(t){return"function"==typeof t&&"number"!=typeof t.nodeType},y=function e(t){return null!=t&&t===t.window},v={type:!0,src:!0,noModule:!0};function m(e,t,n){var i,o=(t=t||r).createElement("script");if(o.text=e,n)for(i in v)n[i]&&(o[i]=n[i]);t.head.appendChild(o).parentNode.removeChild(o)}function x(e){return null==e?e+"":"object"==typeof e||"function"==typeof e?l[c.call(e)]||"object":typeof e}var b="3.3.1",w=function(e,t){return new w.fn.init(e,t)},T=/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g;w.fn=w.prototype={jquery:"3.3.1",constructor:w,length:0,toArray:function(){return o.call(this)},get:function(e){return null==e?o.call(this):e<0?this[e+this.length]:this[e]},pushStack:function(e){var t=w.merge(this.constructor(),e);return t.prevObject=this,t},each:function(e){return w.each(this,e)},map:function(e){return this.pushStack(w.map(this,function(t,n){return e.call(t,n,t)}))},slice:function(){return this.pushStack(o.apply(this,arguments))},first:function(){return this.eq(0)},last:function(){return this.eq(-1)},eq:function(e){var t=this.length,n=+e+(e<0?t:0);return this.pushStack(n>=0&&n<t?[this[n]]:[])},end:function(){return this.prevObject||this.constructor()},push:s,sort:n.sort,splice:n.splice},w.extend=w.fn.extend=function(){var e,t,n,r,i,o,a=arguments[0]||{},s=1,u=arguments.length,l=!1;for("boolean"==typeof a&&(l=a,a=arguments[s]||{},s++),"object"==typeof a||g(a)||(a={}),s===u&&(a=this,s--);s<u;s++)if(null!=(e=arguments[s]))for(t in e)n=a[t],a!==(r=e[t])&&(l&&r&&(w.isPlainObject(r)||(i=Array.isArray(r)))?(i?(i=!1,o=n&&Array.isArray(n)?n:[]):o=n&&w.isPlainObject(n)?n:{},a[t]=w.extend(l,o,r)):void 0!==r&&(a[t]=r));return a},w.extend({expando:"jQuery"+("3.3.1"+Math.random()).replace(/\D/g,""),isReady:!0,error:function(e){throw new Error(e)},noop:function(){},isPlainObject:function(e){var t,n;return!(!e||"[object Object]"!==c.call(e))&&(!(t=i(e))||"function"==typeof(n=f.call(t,"constructor")&&t.constructor)&&p.call(n)===d)},isEmptyObject:function(e){var t;for(t in e)return!1;return!0},globalEval:function(e){m(e)},each:function(e,t){var n,r=0;if(C(e)){for(n=e.length;r<n;r++)if(!1===t.call(e[r],r,e[r]))break}else for(r in e)if(!1===t.call(e[r],r,e[r]))break;return e},trim:function(e){return null==e?"":(e+"").replace(T,"")},makeArray:function(e,t){var n=t||[];return null!=e&&(C(Object(e))?w.merge(n,"string"==typeof e?[e]:e):s.call(n,e)),n},inArray:function(e,t,n){return null==t?-1:u.call(t,e,n)},merge:function(e,t){for(var n=+t.length,r=0,i=e.length;r<n;r++)e[i++]=t[r];return e.length=i,e},grep:function(e,t,n){for(var r,i=[],o=0,a=e.length,s=!n;o<a;o++)(r=!t(e[o],o))!==s&&i.push(e[o]);return i},map:function(e,t,n){var r,i,o=0,s=[];if(C(e))for(r=e.length;o<r;o++)null!=(i=t(e[o],o,n))&&s.push(i);else for(o in e)null!=(i=t(e[o],o,n))&&s.push(i);return a.apply([],s)},guid:1,support:h}),"function"==typeof Symbol&&(w.fn[Symbol.iterator]=n[Symbol.iterator]),w.each("Boolean Number String Function Array Date RegExp Object Error Symbol".split(" "),function(e,t){l["[object "+t+"]"]=t.toLowerCase()});function C(e){var t=!!e&&"length"in e&&e.length,n=x(e);return!g(e)&&!y(e)&&("array"===n||0===t||"number"==typeof t&&t>0&&t-1 in e)}var E=function(e){var t,n,r,i,o,a,s,u,l,c,f,p,d,h,g,y,v,m,x,b="sizzle"+1*new Date,w=e.document,T=0,C=0,E=ae(),k=ae(),S=ae(),D=function(e,t){return e===t&&(f=!0),0},N={}.hasOwnProperty,A=[],j=A.pop,q=A.push,L=A.push,H=A.slice,O=function(e,t){for(var n=0,r=e.length;n<r;n++)if(e[n]===t)return n;return-1},P="checked|selected|async|autofocus|autoplay|controls|defer|disabled|hidden|ismap|loop|multiple|open|readonly|required|scoped",M="[\\x20\\t\\r\\n\\f]",R="(?:\\\\.|[\\w-]|[^\0-\\xa0])+",I="\\["+M+"*("+R+")(?:"+M+"*([*^$|!~]?=)"+M+"*(?:'((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\"|("+R+"))|)"+M+"*\\]",W=":("+R+")(?:\\((('((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\")|((?:\\\\.|[^\\\\()[\\]]|"+I+")*)|.*)\\)|)",$=new RegExp(M+"+","g"),B=new RegExp("^"+M+"+|((?:^|[^\\\\])(?:\\\\.)*)"+M+"+$","g"),F=new RegExp("^"+M+"*,"+M+"*"),_=new RegExp("^"+M+"*([>+~]|"+M+")"+M+"*"),z=new RegExp("="+M+"*([^\\]'\"]*?)"+M+"*\\]","g"),X=new RegExp(W),U=new RegExp("^"+R+"$"),V={ID:new RegExp("^#("+R+")"),CLASS:new RegExp("^\\.("+R+")"),TAG:new RegExp("^("+R+"|[*])"),ATTR:new RegExp("^"+I),PSEUDO:new RegExp("^"+W),CHILD:new RegExp("^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\("+M+"*(even|odd|(([+-]|)(\\d*)n|)"+M+"*(?:([+-]|)"+M+"*(\\d+)|))"+M+"*\\)|)","i"),bool:new RegExp("^(?:"+P+")$","i"),needsContext:new RegExp("^"+M+"*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\("+M+"*((?:-\\d)?\\d*)"+M+"*\\)|)(?=[^-]|$)","i")},G=/^(?:input|select|textarea|button)$/i,Y=/^h\d$/i,Q=/^[^{]+\{\s*\[native \w/,J=/^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/,K=/[+~]/,Z=new RegExp("\\\\([\\da-f]{1,6}"+M+"?|("+M+")|.)","ig"),ee=function(e,t,n){var r="0x"+t-65536;return r!==r||n?t:r<0?String.fromCharCode(r+65536):String.fromCharCode(r>>10|55296,1023&r|56320)},te=/([\0-\x1f\x7f]|^-?\d)|^-$|[^\0-\x1f\x7f-\uFFFF\w-]/g,ne=function(e,t){return t?"\0"===e?"\ufffd":e.slice(0,-1)+"\\"+e.charCodeAt(e.length-1).toString(16)+" ":"\\"+e},re=function(){p()},ie=me(function(e){return!0===e.disabled&&("form"in e||"label"in e)},{dir:"parentNode",next:"legend"});try{L.apply(A=H.call(w.childNodes),w.childNodes),A[w.childNodes.length].nodeType}catch(e){L={apply:A.length?function(e,t){q.apply(e,H.call(t))}:function(e,t){var n=e.length,r=0;while(e[n++]=t[r++]);e.length=n-1}}}function oe(e,t,r,i){var o,s,l,c,f,h,v,m=t&&t.ownerDocument,T=t?t.nodeType:9;if(r=r||[],"string"!=typeof e||!e||1!==T&&9!==T&&11!==T)return r;if(!i&&((t?t.ownerDocument||t:w)!==d&&p(t),t=t||d,g)){if(11!==T&&(f=J.exec(e)))if(o=f[1]){if(9===T){if(!(l=t.getElementById(o)))return r;if(l.id===o)return r.push(l),r}else if(m&&(l=m.getElementById(o))&&x(t,l)&&l.id===o)return r.push(l),r}else{if(f[2])return L.apply(r,t.getElementsByTagName(e)),r;if((o=f[3])&&n.getElementsByClassName&&t.getElementsByClassName)return L.apply(r,t.getElementsByClassName(o)),r}if(n.qsa&&!S[e+" "]&&(!y||!y.test(e))){if(1!==T)m=t,v=e;else if("object"!==t.nodeName.toLowerCase()){(c=t.getAttribute("id"))?c=c.replace(te,ne):t.setAttribute("id",c=b),s=(h=a(e)).length;while(s--)h[s]="#"+c+" "+ve(h[s]);v=h.join(","),m=K.test(e)&&ge(t.parentNode)||t}if(v)try{return L.apply(r,m.querySelectorAll(v)),r}catch(e){}finally{c===b&&t.removeAttribute("id")}}}return u(e.replace(B,"$1"),t,r,i)}function ae(){var e=[];function t(n,i){return e.push(n+" ")>r.cacheLength&&delete t[e.shift()],t[n+" "]=i}return t}function se(e){return e[b]=!0,e}function ue(e){var t=d.createElement("fieldset");try{return!!e(t)}catch(e){return!1}finally{t.parentNode&&t.parentNode.removeChild(t),t=null}}function le(e,t){var n=e.split("|"),i=n.length;while(i--)r.attrHandle[n[i]]=t}function ce(e,t){var n=t&&e,r=n&&1===e.nodeType&&1===t.nodeType&&e.sourceIndex-t.sourceIndex;if(r)return r;if(n)while(n=n.nextSibling)if(n===t)return-1;return e?1:-1}function fe(e){return function(t){return"input"===t.nodeName.toLowerCase()&&t.type===e}}function pe(e){return function(t){var n=t.nodeName.toLowerCase();return("input"===n||"button"===n)&&t.type===e}}function de(e){return function(t){return"form"in t?t.parentNode&&!1===t.disabled?"label"in t?"label"in t.parentNode?t.parentNode.disabled===e:t.disabled===e:t.isDisabled===e||t.isDisabled!==!e&&ie(t)===e:t.disabled===e:"label"in t&&t.disabled===e}}function he(e){return se(function(t){return t=+t,se(function(n,r){var i,o=e([],n.length,t),a=o.length;while(a--)n[i=o[a]]&&(n[i]=!(r[i]=n[i]))})})}function ge(e){return e&&"undefined"!=typeof e.getElementsByTagName&&e}n=oe.support={},o=oe.isXML=function(e){var t=e&&(e.ownerDocument||e).documentElement;return!!t&&"HTML"!==t.nodeName},p=oe.setDocument=function(e){var t,i,a=e?e.ownerDocument||e:w;return a!==d&&9===a.nodeType&&a.documentElement?(d=a,h=d.documentElement,g=!o(d),w!==d&&(i=d.defaultView)&&i.top!==i&&(i.addEventListener?i.addEventListener("unload",re,!1):i.attachEvent&&i.attachEvent("onunload",re)),n.attributes=ue(function(e){return e.className="i",!e.getAttribute("className")}),n.getElementsByTagName=ue(function(e){return e.appendChild(d.createComment("")),!e.getElementsByTagName("*").length}),n.getElementsByClassName=Q.test(d.getElementsByClassName),n.getById=ue(function(e){return h.appendChild(e).id=b,!d.getElementsByName||!d.getElementsByName(b).length}),n.getById?(r.filter.ID=function(e){var t=e.replace(Z,ee);return function(e){return e.getAttribute("id")===t}},r.find.ID=function(e,t){if("undefined"!=typeof t.getElementById&&g){var n=t.getElementById(e);return n?[n]:[]}}):(r.filter.ID=function(e){var t=e.replace(Z,ee);return function(e){var n="undefined"!=typeof e.getAttributeNode&&e.getAttributeNode("id");return n&&n.value===t}},r.find.ID=function(e,t){if("undefined"!=typeof t.getElementById&&g){var n,r,i,o=t.getElementById(e);if(o){if((n=o.getAttributeNode("id"))&&n.value===e)return[o];i=t.getElementsByName(e),r=0;while(o=i[r++])if((n=o.getAttributeNode("id"))&&n.value===e)return[o]}return[]}}),r.find.TAG=n.getElementsByTagName?function(e,t){return"undefined"!=typeof t.getElementsByTagName?t.getElementsByTagName(e):n.qsa?t.querySelectorAll(e):void 0}:function(e,t){var n,r=[],i=0,o=t.getElementsByTagName(e);if("*"===e){while(n=o[i++])1===n.nodeType&&r.push(n);return r}return o},r.find.CLASS=n.getElementsByClassName&&function(e,t){if("undefined"!=typeof t.getElementsByClassName&&g)return t.getElementsByClassName(e)},v=[],y=[],(n.qsa=Q.test(d.querySelectorAll))&&(ue(function(e){h.appendChild(e).innerHTML="<a id='"+b+"'></a><select id='"+b+"-\r\\' msallowcapture=''><option selected=''></option></select>",e.querySelectorAll("[msallowcapture^='']").length&&y.push("[*^$]="+M+"*(?:''|\"\")"),e.querySelectorAll("[selected]").length||y.push("\\["+M+"*(?:value|"+P+")"),e.querySelectorAll("[id~="+b+"-]").length||y.push("~="),e.querySelectorAll(":checked").length||y.push(":checked"),e.querySelectorAll("a#"+b+"+*").length||y.push(".#.+[+~]")}),ue(function(e){e.innerHTML="<a href='' disabled='disabled'></a><select disabled='disabled'><option/></select>";var t=d.createElement("input");t.setAttribute("type","hidden"),e.appendChild(t).setAttribute("name","D"),e.querySelectorAll("[name=d]").length&&y.push("name"+M+"*[*^$|!~]?="),2!==e.querySelectorAll(":enabled").length&&y.push(":enabled",":disabled"),h.appendChild(e).disabled=!0,2!==e.querySelectorAll(":disabled").length&&y.push(":enabled",":disabled"),e.querySelectorAll("*,:x"),y.push(",.*:")})),(n.matchesSelector=Q.test(m=h.matches||h.webkitMatchesSelector||h.mozMatchesSelector||h.oMatchesSelector||h.msMatchesSelector))&&ue(function(e){n.disconnectedMatch=m.call(e,"*"),m.call(e,"[s!='']:x"),v.push("!=",W)}),y=y.length&&new RegExp(y.join("|")),v=v.length&&new RegExp(v.join("|")),t=Q.test(h.compareDocumentPosition),x=t||Q.test(h.contains)?function(e,t){var n=9===e.nodeType?e.documentElement:e,r=t&&t.parentNode;return e===r||!(!r||1!==r.nodeType||!(n.contains?n.contains(r):e.compareDocumentPosition&&16&e.compareDocumentPosition(r)))}:function(e,t){if(t)while(t=t.parentNode)if(t===e)return!0;return!1},D=t?function(e,t){if(e===t)return f=!0,0;var r=!e.compareDocumentPosition-!t.compareDocumentPosition;return r||(1&(r=(e.ownerDocument||e)===(t.ownerDocument||t)?e.compareDocumentPosition(t):1)||!n.sortDetached&&t.compareDocumentPosition(e)===r?e===d||e.ownerDocument===w&&x(w,e)?-1:t===d||t.ownerDocument===w&&x(w,t)?1:c?O(c,e)-O(c,t):0:4&r?-1:1)}:function(e,t){if(e===t)return f=!0,0;var n,r=0,i=e.parentNode,o=t.parentNode,a=[e],s=[t];if(!i||!o)return e===d?-1:t===d?1:i?-1:o?1:c?O(c,e)-O(c,t):0;if(i===o)return ce(e,t);n=e;while(n=n.parentNode)a.unshift(n);n=t;while(n=n.parentNode)s.unshift(n);while(a[r]===s[r])r++;return r?ce(a[r],s[r]):a[r]===w?-1:s[r]===w?1:0},d):d},oe.matches=function(e,t){return oe(e,null,null,t)},oe.matchesSelector=function(e,t){if((e.ownerDocument||e)!==d&&p(e),t=t.replace(z,"='$1']"),n.matchesSelector&&g&&!S[t+" "]&&(!v||!v.test(t))&&(!y||!y.test(t)))try{var r=m.call(e,t);if(r||n.disconnectedMatch||e.document&&11!==e.document.nodeType)return r}catch(e){}return oe(t,d,null,[e]).length>0},oe.contains=function(e,t){return(e.ownerDocument||e)!==d&&p(e),x(e,t)},oe.attr=function(e,t){(e.ownerDocument||e)!==d&&p(e);var i=r.attrHandle[t.toLowerCase()],o=i&&N.call(r.attrHandle,t.toLowerCase())?i(e,t,!g):void 0;return void 0!==o?o:n.attributes||!g?e.getAttribute(t):(o=e.getAttributeNode(t))&&o.specified?o.value:null},oe.escape=function(e){return(e+"").replace(te,ne)},oe.error=function(e){throw new Error("Syntax error, unrecognized expression: "+e)},oe.uniqueSort=function(e){var t,r=[],i=0,o=0;if(f=!n.detectDuplicates,c=!n.sortStable&&e.slice(0),e.sort(D),f){while(t=e[o++])t===e[o]&&(i=r.push(o));while(i--)e.splice(r[i],1)}return c=null,e},i=oe.getText=function(e){var t,n="",r=0,o=e.nodeType;if(o){if(1===o||9===o||11===o){if("string"==typeof e.textContent)return e.textContent;for(e=e.firstChild;e;e=e.nextSibling)n+=i(e)}else if(3===o||4===o)return e.nodeValue}else while(t=e[r++])n+=i(t);return n},(r=oe.selectors={cacheLength:50,createPseudo:se,match:V,attrHandle:{},find:{},relative:{">":{dir:"parentNode",first:!0}," ":{dir:"parentNode"},"+":{dir:"previousSibling",first:!0},"~":{dir:"previousSibling"}},preFilter:{ATTR:function(e){return e[1]=e[1].replace(Z,ee),e[3]=(e[3]||e[4]||e[5]||"").replace(Z,ee),"~="===e[2]&&(e[3]=" "+e[3]+" "),e.slice(0,4)},CHILD:function(e){return e[1]=e[1].toLowerCase(),"nth"===e[1].slice(0,3)?(e[3]||oe.error(e[0]),e[4]=+(e[4]?e[5]+(e[6]||1):2*("even"===e[3]||"odd"===e[3])),e[5]=+(e[7]+e[8]||"odd"===e[3])):e[3]&&oe.error(e[0]),e},PSEUDO:function(e){var t,n=!e[6]&&e[2];return V.CHILD.test(e[0])?null:(e[3]?e[2]=e[4]||e[5]||"":n&&X.test(n)&&(t=a(n,!0))&&(t=n.indexOf(")",n.length-t)-n.length)&&(e[0]=e[0].slice(0,t),e[2]=n.slice(0,t)),e.slice(0,3))}},filter:{TAG:function(e){var t=e.replace(Z,ee).toLowerCase();return"*"===e?function(){return!0}:function(e){return e.nodeName&&e.nodeName.toLowerCase()===t}},CLASS:function(e){var t=E[e+" "];return t||(t=new RegExp("(^|"+M+")"+e+"("+M+"|$)"))&&E(e,function(e){return t.test("string"==typeof e.className&&e.className||"undefined"!=typeof e.getAttribute&&e.getAttribute("class")||"")})},ATTR:function(e,t,n){return function(r){var i=oe.attr(r,e);return null==i?"!="===t:!t||(i+="","="===t?i===n:"!="===t?i!==n:"^="===t?n&&0===i.indexOf(n):"*="===t?n&&i.indexOf(n)>-1:"$="===t?n&&i.slice(-n.length)===n:"~="===t?(" "+i.replace($," ")+" ").indexOf(n)>-1:"|="===t&&(i===n||i.slice(0,n.length+1)===n+"-"))}},CHILD:function(e,t,n,r,i){var o="nth"!==e.slice(0,3),a="last"!==e.slice(-4),s="of-type"===t;return 1===r&&0===i?function(e){return!!e.parentNode}:function(t,n,u){var l,c,f,p,d,h,g=o!==a?"nextSibling":"previousSibling",y=t.parentNode,v=s&&t.nodeName.toLowerCase(),m=!u&&!s,x=!1;if(y){if(o){while(g){p=t;while(p=p[g])if(s?p.nodeName.toLowerCase()===v:1===p.nodeType)return!1;h=g="only"===e&&!h&&"nextSibling"}return!0}if(h=[a?y.firstChild:y.lastChild],a&&m){x=(d=(l=(c=(f=(p=y)[b]||(p[b]={}))[p.uniqueID]||(f[p.uniqueID]={}))[e]||[])[0]===T&&l[1])&&l[2],p=d&&y.childNodes[d];while(p=++d&&p&&p[g]||(x=d=0)||h.pop())if(1===p.nodeType&&++x&&p===t){c[e]=[T,d,x];break}}else if(m&&(x=d=(l=(c=(f=(p=t)[b]||(p[b]={}))[p.uniqueID]||(f[p.uniqueID]={}))[e]||[])[0]===T&&l[1]),!1===x)while(p=++d&&p&&p[g]||(x=d=0)||h.pop())if((s?p.nodeName.toLowerCase()===v:1===p.nodeType)&&++x&&(m&&((c=(f=p[b]||(p[b]={}))[p.uniqueID]||(f[p.uniqueID]={}))[e]=[T,x]),p===t))break;return(x-=i)===r||x%r==0&&x/r>=0}}},PSEUDO:function(e,t){var n,i=r.pseudos[e]||r.setFilters[e.toLowerCase()]||oe.error("unsupported pseudo: "+e);return i[b]?i(t):i.length>1?(n=[e,e,"",t],r.setFilters.hasOwnProperty(e.toLowerCase())?se(function(e,n){var r,o=i(e,t),a=o.length;while(a--)e[r=O(e,o[a])]=!(n[r]=o[a])}):function(e){return i(e,0,n)}):i}},pseudos:{not:se(function(e){var t=[],n=[],r=s(e.replace(B,"$1"));return r[b]?se(function(e,t,n,i){var o,a=r(e,null,i,[]),s=e.length;while(s--)(o=a[s])&&(e[s]=!(t[s]=o))}):function(e,i,o){return t[0]=e,r(t,null,o,n),t[0]=null,!n.pop()}}),has:se(function(e){return function(t){return oe(e,t).length>0}}),contains:se(function(e){return e=e.replace(Z,ee),function(t){return(t.textContent||t.innerText||i(t)).indexOf(e)>-1}}),lang:se(function(e){return U.test(e||"")||oe.error("unsupported lang: "+e),e=e.replace(Z,ee).toLowerCase(),function(t){var n;do{if(n=g?t.lang:t.getAttribute("xml:lang")||t.getAttribute("lang"))return(n=n.toLowerCase())===e||0===n.indexOf(e+"-")}while((t=t.parentNode)&&1===t.nodeType);return!1}}),target:function(t){var n=e.location&&e.location.hash;return n&&n.slice(1)===t.id},root:function(e){return e===h},focus:function(e){return e===d.activeElement&&(!d.hasFocus||d.hasFocus())&&!!(e.type||e.href||~e.tabIndex)},enabled:de(!1),disabled:de(!0),checked:function(e){var t=e.nodeName.toLowerCase();return"input"===t&&!!e.checked||"option"===t&&!!e.selected},selected:function(e){return e.parentNode&&e.parentNode.selectedIndex,!0===e.selected},empty:function(e){for(e=e.firstChild;e;e=e.nextSibling)if(e.nodeType<6)return!1;return!0},parent:function(e){return!r.pseudos.empty(e)},header:function(e){return Y.test(e.nodeName)},input:function(e){return G.test(e.nodeName)},button:function(e){var t=e.nodeName.toLowerCase();return"input"===t&&"button"===e.type||"button"===t},text:function(e){var t;return"input"===e.nodeName.toLowerCase()&&"text"===e.type&&(null==(t=e.getAttribute("type"))||"text"===t.toLowerCase())},first:he(function(){return[0]}),last:he(function(e,t){return[t-1]}),eq:he(function(e,t,n){return[n<0?n+t:n]}),even:he(function(e,t){for(var n=0;n<t;n+=2)e.push(n);return e}),odd:he(function(e,t){for(var n=1;n<t;n+=2)e.push(n);return e}),lt:he(function(e,t,n){for(var r=n<0?n+t:n;--r>=0;)e.push(r);return e}),gt:he(function(e,t,n){for(var r=n<0?n+t:n;++r<t;)e.push(r);return e})}}).pseudos.nth=r.pseudos.eq;for(t in{radio:!0,checkbox:!0,file:!0,password:!0,image:!0})r.pseudos[t]=fe(t);for(t in{submit:!0,reset:!0})r.pseudos[t]=pe(t);function ye(){}ye.prototype=r.filters=r.pseudos,r.setFilters=new ye,a=oe.tokenize=function(e,t){var n,i,o,a,s,u,l,c=k[e+" "];if(c)return t?0:c.slice(0);s=e,u=[],l=r.preFilter;while(s){n&&!(i=F.exec(s))||(i&&(s=s.slice(i[0].length)||s),u.push(o=[])),n=!1,(i=_.exec(s))&&(n=i.shift(),o.push({value:n,type:i[0].replace(B," ")}),s=s.slice(n.length));for(a in r.filter)!(i=V[a].exec(s))||l[a]&&!(i=l[a](i))||(n=i.shift(),o.push({value:n,type:a,matches:i}),s=s.slice(n.length));if(!n)break}return t?s.length:s?oe.error(e):k(e,u).slice(0)};function ve(e){for(var t=0,n=e.length,r="";t<n;t++)r+=e[t].value;return r}function me(e,t,n){var r=t.dir,i=t.next,o=i||r,a=n&&"parentNode"===o,s=C++;return t.first?function(t,n,i){while(t=t[r])if(1===t.nodeType||a)return e(t,n,i);return!1}:function(t,n,u){var l,c,f,p=[T,s];if(u){while(t=t[r])if((1===t.nodeType||a)&&e(t,n,u))return!0}else while(t=t[r])if(1===t.nodeType||a)if(f=t[b]||(t[b]={}),c=f[t.uniqueID]||(f[t.uniqueID]={}),i&&i===t.nodeName.toLowerCase())t=t[r]||t;else{if((l=c[o])&&l[0]===T&&l[1]===s)return p[2]=l[2];if(c[o]=p,p[2]=e(t,n,u))return!0}return!1}}function xe(e){return e.length>1?function(t,n,r){var i=e.length;while(i--)if(!e[i](t,n,r))return!1;return!0}:e[0]}function be(e,t,n){for(var r=0,i=t.length;r<i;r++)oe(e,t[r],n);return n}function we(e,t,n,r,i){for(var o,a=[],s=0,u=e.length,l=null!=t;s<u;s++)(o=e[s])&&(n&&!n(o,r,i)||(a.push(o),l&&t.push(s)));return a}function Te(e,t,n,r,i,o){return r&&!r[b]&&(r=Te(r)),i&&!i[b]&&(i=Te(i,o)),se(function(o,a,s,u){var l,c,f,p=[],d=[],h=a.length,g=o||be(t||"*",s.nodeType?[s]:s,[]),y=!e||!o&&t?g:we(g,p,e,s,u),v=n?i||(o?e:h||r)?[]:a:y;if(n&&n(y,v,s,u),r){l=we(v,d),r(l,[],s,u),c=l.length;while(c--)(f=l[c])&&(v[d[c]]=!(y[d[c]]=f))}if(o){if(i||e){if(i){l=[],c=v.length;while(c--)(f=v[c])&&l.push(y[c]=f);i(null,v=[],l,u)}c=v.length;while(c--)(f=v[c])&&(l=i?O(o,f):p[c])>-1&&(o[l]=!(a[l]=f))}}else v=we(v===a?v.splice(h,v.length):v),i?i(null,a,v,u):L.apply(a,v)})}function Ce(e){for(var t,n,i,o=e.length,a=r.relative[e[0].type],s=a||r.relative[" "],u=a?1:0,c=me(function(e){return e===t},s,!0),f=me(function(e){return O(t,e)>-1},s,!0),p=[function(e,n,r){var i=!a&&(r||n!==l)||((t=n).nodeType?c(e,n,r):f(e,n,r));return t=null,i}];u<o;u++)if(n=r.relative[e[u].type])p=[me(xe(p),n)];else{if((n=r.filter[e[u].type].apply(null,e[u].matches))[b]){for(i=++u;i<o;i++)if(r.relative[e[i].type])break;return Te(u>1&&xe(p),u>1&&ve(e.slice(0,u-1).concat({value:" "===e[u-2].type?"*":""})).replace(B,"$1"),n,u<i&&Ce(e.slice(u,i)),i<o&&Ce(e=e.slice(i)),i<o&&ve(e))}p.push(n)}return xe(p)}function Ee(e,t){var n=t.length>0,i=e.length>0,o=function(o,a,s,u,c){var f,h,y,v=0,m="0",x=o&&[],b=[],w=l,C=o||i&&r.find.TAG("*",c),E=T+=null==w?1:Math.random()||.1,k=C.length;for(c&&(l=a===d||a||c);m!==k&&null!=(f=C[m]);m++){if(i&&f){h=0,a||f.ownerDocument===d||(p(f),s=!g);while(y=e[h++])if(y(f,a||d,s)){u.push(f);break}c&&(T=E)}n&&((f=!y&&f)&&v--,o&&x.push(f))}if(v+=m,n&&m!==v){h=0;while(y=t[h++])y(x,b,a,s);if(o){if(v>0)while(m--)x[m]||b[m]||(b[m]=j.call(u));b=we(b)}L.apply(u,b),c&&!o&&b.length>0&&v+t.length>1&&oe.uniqueSort(u)}return c&&(T=E,l=w),x};return n?se(o):o}return s=oe.compile=function(e,t){var n,r=[],i=[],o=S[e+" "];if(!o){t||(t=a(e)),n=t.length;while(n--)(o=Ce(t[n]))[b]?r.push(o):i.push(o);(o=S(e,Ee(i,r))).selector=e}return o},u=oe.select=function(e,t,n,i){var o,u,l,c,f,p="function"==typeof e&&e,d=!i&&a(e=p.selector||e);if(n=n||[],1===d.length){if((u=d[0]=d[0].slice(0)).length>2&&"ID"===(l=u[0]).type&&9===t.nodeType&&g&&r.relative[u[1].type]){if(!(t=(r.find.ID(l.matches[0].replace(Z,ee),t)||[])[0]))return n;p&&(t=t.parentNode),e=e.slice(u.shift().value.length)}o=V.needsContext.test(e)?0:u.length;while(o--){if(l=u[o],r.relative[c=l.type])break;if((f=r.find[c])&&(i=f(l.matches[0].replace(Z,ee),K.test(u[0].type)&&ge(t.parentNode)||t))){if(u.splice(o,1),!(e=i.length&&ve(u)))return L.apply(n,i),n;break}}}return(p||s(e,d))(i,t,!g,n,!t||K.test(e)&&ge(t.parentNode)||t),n},n.sortStable=b.split("").sort(D).join("")===b,n.detectDuplicates=!!f,p(),n.sortDetached=ue(function(e){return 1&e.compareDocumentPosition(d.createElement("fieldset"))}),ue(function(e){return e.innerHTML="<a href='#'></a>","#"===e.firstChild.getAttribute("href")})||le("type|href|height|width",function(e,t,n){if(!n)return e.getAttribute(t,"type"===t.toLowerCase()?1:2)}),n.attributes&&ue(function(e){return e.innerHTML="<input/>",e.firstChild.setAttribute("value",""),""===e.firstChild.getAttribute("value")})||le("value",function(e,t,n){if(!n&&"input"===e.nodeName.toLowerCase())return e.defaultValue}),ue(function(e){return null==e.getAttribute("disabled")})||le(P,function(e,t,n){var r;if(!n)return!0===e[t]?t.toLowerCase():(r=e.getAttributeNode(t))&&r.specified?r.value:null}),oe}(e);w.find=E,w.expr=E.selectors,w.expr[":"]=w.expr.pseudos,w.uniqueSort=w.unique=E.uniqueSort,w.text=E.getText,w.isXMLDoc=E.isXML,w.contains=E.contains,w.escapeSelector=E.escape;var k=function(e,t,n){var r=[],i=void 0!==n;while((e=e[t])&&9!==e.nodeType)if(1===e.nodeType){if(i&&w(e).is(n))break;r.push(e)}return r},S=function(e,t){for(var n=[];e;e=e.nextSibling)1===e.nodeType&&e!==t&&n.push(e);return n},D=w.expr.match.needsContext;function N(e,t){return e.nodeName&&e.nodeName.toLowerCase()===t.toLowerCase()}var A=/^<([a-z][^\/\0>:\x20\t\r\n\f]*)[\x20\t\r\n\f]*\/?>(?:<\/\1>|)$/i;function j(e,t,n){return g(t)?w.grep(e,function(e,r){return!!t.call(e,r,e)!==n}):t.nodeType?w.grep(e,function(e){return e===t!==n}):"string"!=typeof t?w.grep(e,function(e){return u.call(t,e)>-1!==n}):w.filter(t,e,n)}w.filter=function(e,t,n){var r=t[0];return n&&(e=":not("+e+")"),1===t.length&&1===r.nodeType?w.find.matchesSelector(r,e)?[r]:[]:w.find.matches(e,w.grep(t,function(e){return 1===e.nodeType}))},w.fn.extend({find:function(e){var t,n,r=this.length,i=this;if("string"!=typeof e)return this.pushStack(w(e).filter(function(){for(t=0;t<r;t++)if(w.contains(i[t],this))return!0}));for(n=this.pushStack([]),t=0;t<r;t++)w.find(e,i[t],n);return r>1?w.uniqueSort(n):n},filter:function(e){return this.pushStack(j(this,e||[],!1))},not:function(e){return this.pushStack(j(this,e||[],!0))},is:function(e){return!!j(this,"string"==typeof e&&D.test(e)?w(e):e||[],!1).length}});var q,L=/^(?:\s*(<[\w\W]+>)[^>]*|#([\w-]+))$/;(w.fn.init=function(e,t,n){var i,o;if(!e)return this;if(n=n||q,"string"==typeof e){if(!(i="<"===e[0]&&">"===e[e.length-1]&&e.length>=3?[null,e,null]:L.exec(e))||!i[1]&&t)return!t||t.jquery?(t||n).find(e):this.constructor(t).find(e);if(i[1]){if(t=t instanceof w?t[0]:t,w.merge(this,w.parseHTML(i[1],t&&t.nodeType?t.ownerDocument||t:r,!0)),A.test(i[1])&&w.isPlainObject(t))for(i in t)g(this[i])?this[i](t[i]):this.attr(i,t[i]);return this}return(o=r.getElementById(i[2]))&&(this[0]=o,this.length=1),this}return e.nodeType?(this[0]=e,this.length=1,this):g(e)?void 0!==n.ready?n.ready(e):e(w):w.makeArray(e,this)}).prototype=w.fn,q=w(r);var H=/^(?:parents|prev(?:Until|All))/,O={children:!0,contents:!0,next:!0,prev:!0};w.fn.extend({has:function(e){var t=w(e,this),n=t.length;return this.filter(function(){for(var e=0;e<n;e++)if(w.contains(this,t[e]))return!0})},closest:function(e,t){var n,r=0,i=this.length,o=[],a="string"!=typeof e&&w(e);if(!D.test(e))for(;r<i;r++)for(n=this[r];n&&n!==t;n=n.parentNode)if(n.nodeType<11&&(a?a.index(n)>-1:1===n.nodeType&&w.find.matchesSelector(n,e))){o.push(n);break}return this.pushStack(o.length>1?w.uniqueSort(o):o)},index:function(e){return e?"string"==typeof e?u.call(w(e),this[0]):u.call(this,e.jquery?e[0]:e):this[0]&&this[0].parentNode?this.first().prevAll().length:-1},add:function(e,t){return this.pushStack(w.uniqueSort(w.merge(this.get(),w(e,t))))},addBack:function(e){return this.add(null==e?this.prevObject:this.prevObject.filter(e))}});function P(e,t){while((e=e[t])&&1!==e.nodeType);return e}w.each({parent:function(e){var t=e.parentNode;return t&&11!==t.nodeType?t:null},parents:function(e){return k(e,"parentNode")},parentsUntil:function(e,t,n){return k(e,"parentNode",n)},next:function(e){return P(e,"nextSibling")},prev:function(e){return P(e,"previousSibling")},nextAll:function(e){return k(e,"nextSibling")},prevAll:function(e){return k(e,"previousSibling")},nextUntil:function(e,t,n){return k(e,"nextSibling",n)},prevUntil:function(e,t,n){return k(e,"previousSibling",n)},siblings:function(e){return S((e.parentNode||{}).firstChild,e)},children:function(e){return S(e.firstChild)},contents:function(e){return N(e,"iframe")?e.contentDocument:(N(e,"template")&&(e=e.content||e),w.merge([],e.childNodes))}},function(e,t){w.fn[e]=function(n,r){var i=w.map(this,t,n);return"Until"!==e.slice(-5)&&(r=n),r&&"string"==typeof r&&(i=w.filter(r,i)),this.length>1&&(O[e]||w.uniqueSort(i),H.test(e)&&i.reverse()),this.pushStack(i)}});var M=/[^\x20\t\r\n\f]+/g;function R(e){var t={};return w.each(e.match(M)||[],function(e,n){t[n]=!0}),t}w.Callbacks=function(e){e="string"==typeof e?R(e):w.extend({},e);var t,n,r,i,o=[],a=[],s=-1,u=function(){for(i=i||e.once,r=t=!0;a.length;s=-1){n=a.shift();while(++s<o.length)!1===o[s].apply(n[0],n[1])&&e.stopOnFalse&&(s=o.length,n=!1)}e.memory||(n=!1),t=!1,i&&(o=n?[]:"")},l={add:function(){return o&&(n&&!t&&(s=o.length-1,a.push(n)),function t(n){w.each(n,function(n,r){g(r)?e.unique&&l.has(r)||o.push(r):r&&r.length&&"string"!==x(r)&&t(r)})}(arguments),n&&!t&&u()),this},remove:function(){return w.each(arguments,function(e,t){var n;while((n=w.inArray(t,o,n))>-1)o.splice(n,1),n<=s&&s--}),this},has:function(e){return e?w.inArray(e,o)>-1:o.length>0},empty:function(){return o&&(o=[]),this},disable:function(){return i=a=[],o=n="",this},disabled:function(){return!o},lock:function(){return i=a=[],n||t||(o=n=""),this},locked:function(){return!!i},fireWith:function(e,n){return i||(n=[e,(n=n||[]).slice?n.slice():n],a.push(n),t||u()),this},fire:function(){return l.fireWith(this,arguments),this},fired:function(){return!!r}};return l};function I(e){return e}function W(e){throw e}function $(e,t,n,r){var i;try{e&&g(i=e.promise)?i.call(e).done(t).fail(n):e&&g(i=e.then)?i.call(e,t,n):t.apply(void 0,[e].slice(r))}catch(e){n.apply(void 0,[e])}}w.extend({Deferred:function(t){var n=[["notify","progress",w.Callbacks("memory"),w.Callbacks("memory"),2],["resolve","done",w.Callbacks("once memory"),w.Callbacks("once memory"),0,"resolved"],["reject","fail",w.Callbacks("once memory"),w.Callbacks("once memory"),1,"rejected"]],r="pending",i={state:function(){return r},always:function(){return o.done(arguments).fail(arguments),this},"catch":function(e){return i.then(null,e)},pipe:function(){var e=arguments;return w.Deferred(function(t){w.each(n,function(n,r){var i=g(e[r[4]])&&e[r[4]];o[r[1]](function(){var e=i&&i.apply(this,arguments);e&&g(e.promise)?e.promise().progress(t.notify).done(t.resolve).fail(t.reject):t[r[0]+"With"](this,i?[e]:arguments)})}),e=null}).promise()},then:function(t,r,i){var o=0;function a(t,n,r,i){return function(){var s=this,u=arguments,l=function(){var e,l;if(!(t<o)){if((e=r.apply(s,u))===n.promise())throw new TypeError("Thenable self-resolution");l=e&&("object"==typeof e||"function"==typeof e)&&e.then,g(l)?i?l.call(e,a(o,n,I,i),a(o,n,W,i)):(o++,l.call(e,a(o,n,I,i),a(o,n,W,i),a(o,n,I,n.notifyWith))):(r!==I&&(s=void 0,u=[e]),(i||n.resolveWith)(s,u))}},c=i?l:function(){try{l()}catch(e){w.Deferred.exceptionHook&&w.Deferred.exceptionHook(e,c.stackTrace),t+1>=o&&(r!==W&&(s=void 0,u=[e]),n.rejectWith(s,u))}};t?c():(w.Deferred.getStackHook&&(c.stackTrace=w.Deferred.getStackHook()),e.setTimeout(c))}}return w.Deferred(function(e){n[0][3].add(a(0,e,g(i)?i:I,e.notifyWith)),n[1][3].add(a(0,e,g(t)?t:I)),n[2][3].add(a(0,e,g(r)?r:W))}).promise()},promise:function(e){return null!=e?w.extend(e,i):i}},o={};return w.each(n,function(e,t){var a=t[2],s=t[5];i[t[1]]=a.add,s&&a.add(function(){r=s},n[3-e][2].disable,n[3-e][3].disable,n[0][2].lock,n[0][3].lock),a.add(t[3].fire),o[t[0]]=function(){return o[t[0]+"With"](this===o?void 0:this,arguments),this},o[t[0]+"With"]=a.fireWith}),i.promise(o),t&&t.call(o,o),o},when:function(e){var t=arguments.length,n=t,r=Array(n),i=o.call(arguments),a=w.Deferred(),s=function(e){return function(n){r[e]=this,i[e]=arguments.length>1?o.call(arguments):n,--t||a.resolveWith(r,i)}};if(t<=1&&($(e,a.done(s(n)).resolve,a.reject,!t),"pending"===a.state()||g(i[n]&&i[n].then)))return a.then();while(n--)$(i[n],s(n),a.reject);return a.promise()}});var B=/^(Eval|Internal|Range|Reference|Syntax|Type|URI)Error$/;w.Deferred.exceptionHook=function(t,n){e.console&&e.console.warn&&t&&B.test(t.name)&&e.console.warn("jQuery.Deferred exception: "+t.message,t.stack,n)},w.readyException=function(t){e.setTimeout(function(){throw t})};var F=w.Deferred();w.fn.ready=function(e){return F.then(e)["catch"](function(e){w.readyException(e)}),this},w.extend({isReady:!1,readyWait:1,ready:function(e){(!0===e?--w.readyWait:w.isReady)||(w.isReady=!0,!0!==e&&--w.readyWait>0||F.resolveWith(r,[w]))}}),w.ready.then=F.then;function _(){r.removeEventListener("DOMContentLoaded",_),e.removeEventListener("load",_),w.ready()}"complete"===r.readyState||"loading"!==r.readyState&&!r.documentElement.doScroll?e.setTimeout(w.ready):(r.addEventListener("DOMContentLoaded",_),e.addEventListener("load",_));var z=function(e,t,n,r,i,o,a){var s=0,u=e.length,l=null==n;if("object"===x(n)){i=!0;for(s in n)z(e,t,s,n[s],!0,o,a)}else if(void 0!==r&&(i=!0,g(r)||(a=!0),l&&(a?(t.call(e,r),t=null):(l=t,t=function(e,t,n){return l.call(w(e),n)})),t))for(;s<u;s++)t(e[s],n,a?r:r.call(e[s],s,t(e[s],n)));return i?e:l?t.call(e):u?t(e[0],n):o},X=/^-ms-/,U=/-([a-z])/g;function V(e,t){return t.toUpperCase()}function G(e){return e.replace(X,"ms-").replace(U,V)}var Y=function(e){return 1===e.nodeType||9===e.nodeType||!+e.nodeType};function Q(){this.expando=w.expando+Q.uid++}Q.uid=1,Q.prototype={cache:function(e){var t=e[this.expando];return t||(t={},Y(e)&&(e.nodeType?e[this.expando]=t:Object.defineProperty(e,this.expando,{value:t,configurable:!0}))),t},set:function(e,t,n){var r,i=this.cache(e);if("string"==typeof t)i[G(t)]=n;else for(r in t)i[G(r)]=t[r];return i},get:function(e,t){return void 0===t?this.cache(e):e[this.expando]&&e[this.expando][G(t)]},access:function(e,t,n){return void 0===t||t&&"string"==typeof t&&void 0===n?this.get(e,t):(this.set(e,t,n),void 0!==n?n:t)},remove:function(e,t){var n,r=e[this.expando];if(void 0!==r){if(void 0!==t){n=(t=Array.isArray(t)?t.map(G):(t=G(t))in r?[t]:t.match(M)||[]).length;while(n--)delete r[t[n]]}(void 0===t||w.isEmptyObject(r))&&(e.nodeType?e[this.expando]=void 0:delete e[this.expando])}},hasData:function(e){var t=e[this.expando];return void 0!==t&&!w.isEmptyObject(t)}};var J=new Q,K=new Q,Z=/^(?:\{[\w\W]*\}|\[[\w\W]*\])$/,ee=/[A-Z]/g;function te(e){return"true"===e||"false"!==e&&("null"===e?null:e===+e+""?+e:Z.test(e)?JSON.parse(e):e)}function ne(e,t,n){var r;if(void 0===n&&1===e.nodeType)if(r="data-"+t.replace(ee,"-$&").toLowerCase(),"string"==typeof(n=e.getAttribute(r))){try{n=te(n)}catch(e){}K.set(e,t,n)}else n=void 0;return n}w.extend({hasData:function(e){return K.hasData(e)||J.hasData(e)},data:function(e,t,n){return K.access(e,t,n)},removeData:function(e,t){K.remove(e,t)},_data:function(e,t,n){return J.access(e,t,n)},_removeData:function(e,t){J.remove(e,t)}}),w.fn.extend({data:function(e,t){var n,r,i,o=this[0],a=o&&o.attributes;if(void 0===e){if(this.length&&(i=K.get(o),1===o.nodeType&&!J.get(o,"hasDataAttrs"))){n=a.length;while(n--)a[n]&&0===(r=a[n].name).indexOf("data-")&&(r=G(r.slice(5)),ne(o,r,i[r]));J.set(o,"hasDataAttrs",!0)}return i}return"object"==typeof e?this.each(function(){K.set(this,e)}):z(this,function(t){var n;if(o&&void 0===t){if(void 0!==(n=K.get(o,e)))return n;if(void 0!==(n=ne(o,e)))return n}else this.each(function(){K.set(this,e,t)})},null,t,arguments.length>1,null,!0)},removeData:function(e){return this.each(function(){K.remove(this,e)})}}),w.extend({queue:function(e,t,n){var r;if(e)return t=(t||"fx")+"queue",r=J.get(e,t),n&&(!r||Array.isArray(n)?r=J.access(e,t,w.makeArray(n)):r.push(n)),r||[]},dequeue:function(e,t){t=t||"fx";var n=w.queue(e,t),r=n.length,i=n.shift(),o=w._queueHooks(e,t),a=function(){w.dequeue(e,t)};"inprogress"===i&&(i=n.shift(),r--),i&&("fx"===t&&n.unshift("inprogress"),delete o.stop,i.call(e,a,o)),!r&&o&&o.empty.fire()},_queueHooks:function(e,t){var n=t+"queueHooks";return J.get(e,n)||J.access(e,n,{empty:w.Callbacks("once memory").add(function(){J.remove(e,[t+"queue",n])})})}}),w.fn.extend({queue:function(e,t){var n=2;return"string"!=typeof e&&(t=e,e="fx",n--),arguments.length<n?w.queue(this[0],e):void 0===t?this:this.each(function(){var n=w.queue(this,e,t);w._queueHooks(this,e),"fx"===e&&"inprogress"!==n[0]&&w.dequeue(this,e)})},dequeue:function(e){return this.each(function(){w.dequeue(this,e)})},clearQueue:function(e){return this.queue(e||"fx",[])},promise:function(e,t){var n,r=1,i=w.Deferred(),o=this,a=this.length,s=function(){--r||i.resolveWith(o,[o])};"string"!=typeof e&&(t=e,e=void 0),e=e||"fx";while(a--)(n=J.get(o[a],e+"queueHooks"))&&n.empty&&(r++,n.empty.add(s));return s(),i.promise(t)}});var re=/[+-]?(?:\d*\.|)\d+(?:[eE][+-]?\d+|)/.source,ie=new RegExp("^(?:([+-])=|)("+re+")([a-z%]*)$","i"),oe=["Top","Right","Bottom","Left"],ae=function(e,t){return"none"===(e=t||e).style.display||""===e.style.display&&w.contains(e.ownerDocument,e)&&"none"===w.css(e,"display")},se=function(e,t,n,r){var i,o,a={};for(o in t)a[o]=e.style[o],e.style[o]=t[o];i=n.apply(e,r||[]);for(o in t)e.style[o]=a[o];return i};function ue(e,t,n,r){var i,o,a=20,s=r?function(){return r.cur()}:function(){return w.css(e,t,"")},u=s(),l=n&&n[3]||(w.cssNumber[t]?"":"px"),c=(w.cssNumber[t]||"px"!==l&&+u)&&ie.exec(w.css(e,t));if(c&&c[3]!==l){u/=2,l=l||c[3],c=+u||1;while(a--)w.style(e,t,c+l),(1-o)*(1-(o=s()/u||.5))<=0&&(a=0),c/=o;c*=2,w.style(e,t,c+l),n=n||[]}return n&&(c=+c||+u||0,i=n[1]?c+(n[1]+1)*n[2]:+n[2],r&&(r.unit=l,r.start=c,r.end=i)),i}var le={};function ce(e){var t,n=e.ownerDocument,r=e.nodeName,i=le[r];return i||(t=n.body.appendChild(n.createElement(r)),i=w.css(t,"display"),t.parentNode.removeChild(t),"none"===i&&(i="block"),le[r]=i,i)}function fe(e,t){for(var n,r,i=[],o=0,a=e.length;o<a;o++)(r=e[o]).style&&(n=r.style.display,t?("none"===n&&(i[o]=J.get(r,"display")||null,i[o]||(r.style.display="")),""===r.style.display&&ae(r)&&(i[o]=ce(r))):"none"!==n&&(i[o]="none",J.set(r,"display",n)));for(o=0;o<a;o++)null!=i[o]&&(e[o].style.display=i[o]);return e}w.fn.extend({show:function(){return fe(this,!0)},hide:function(){return fe(this)},toggle:function(e){return"boolean"==typeof e?e?this.show():this.hide():this.each(function(){ae(this)?w(this).show():w(this).hide()})}});var pe=/^(?:checkbox|radio)$/i,de=/<([a-z][^\/\0>\x20\t\r\n\f]+)/i,he=/^$|^module$|\/(?:java|ecma)script/i,ge={option:[1,"<select multiple='multiple'>","</select>"],thead:[1,"<table>","</table>"],col:[2,"<table><colgroup>","</colgroup></table>"],tr:[2,"<table><tbody>","</tbody></table>"],td:[3,"<table><tbody><tr>","</tr></tbody></table>"],_default:[0,"",""]};ge.optgroup=ge.option,ge.tbody=ge.tfoot=ge.colgroup=ge.caption=ge.thead,ge.th=ge.td;function ye(e,t){var n;return n="undefined"!=typeof e.getElementsByTagName?e.getElementsByTagName(t||"*"):"undefined"!=typeof e.querySelectorAll?e.querySelectorAll(t||"*"):[],void 0===t||t&&N(e,t)?w.merge([e],n):n}function ve(e,t){for(var n=0,r=e.length;n<r;n++)J.set(e[n],"globalEval",!t||J.get(t[n],"globalEval"))}var me=/<|&#?\w+;/;function xe(e,t,n,r,i){for(var o,a,s,u,l,c,f=t.createDocumentFragment(),p=[],d=0,h=e.length;d<h;d++)if((o=e[d])||0===o)if("object"===x(o))w.merge(p,o.nodeType?[o]:o);else if(me.test(o)){a=a||f.appendChild(t.createElement("div")),s=(de.exec(o)||["",""])[1].toLowerCase(),u=ge[s]||ge._default,a.innerHTML=u[1]+w.htmlPrefilter(o)+u[2],c=u[0];while(c--)a=a.lastChild;w.merge(p,a.childNodes),(a=f.firstChild).textContent=""}else p.push(t.createTextNode(o));f.textContent="",d=0;while(o=p[d++])if(r&&w.inArray(o,r)>-1)i&&i.push(o);else if(l=w.contains(o.ownerDocument,o),a=ye(f.appendChild(o),"script"),l&&ve(a),n){c=0;while(o=a[c++])he.test(o.type||"")&&n.push(o)}return f}!function(){var e=r.createDocumentFragment().appendChild(r.createElement("div")),t=r.createElement("input");t.setAttribute("type","radio"),t.setAttribute("checked","checked"),t.setAttribute("name","t"),e.appendChild(t),h.checkClone=e.cloneNode(!0).cloneNode(!0).lastChild.checked,e.innerHTML="<textarea>x</textarea>",h.noCloneChecked=!!e.cloneNode(!0).lastChild.defaultValue}();var be=r.documentElement,we=/^key/,Te=/^(?:mouse|pointer|contextmenu|drag|drop)|click/,Ce=/^([^.]*)(?:\.(.+)|)/;function Ee(){return!0}function ke(){return!1}function Se(){try{return r.activeElement}catch(e){}}function De(e,t,n,r,i,o){var a,s;if("object"==typeof t){"string"!=typeof n&&(r=r||n,n=void 0);for(s in t)De(e,s,n,r,t[s],o);return e}if(null==r&&null==i?(i=n,r=n=void 0):null==i&&("string"==typeof n?(i=r,r=void 0):(i=r,r=n,n=void 0)),!1===i)i=ke;else if(!i)return e;return 1===o&&(a=i,(i=function(e){return w().off(e),a.apply(this,arguments)}).guid=a.guid||(a.guid=w.guid++)),e.each(function(){w.event.add(this,t,i,r,n)})}w.event={global:{},add:function(e,t,n,r,i){var o,a,s,u,l,c,f,p,d,h,g,y=J.get(e);if(y){n.handler&&(n=(o=n).handler,i=o.selector),i&&w.find.matchesSelector(be,i),n.guid||(n.guid=w.guid++),(u=y.events)||(u=y.events={}),(a=y.handle)||(a=y.handle=function(t){return"undefined"!=typeof w&&w.event.triggered!==t.type?w.event.dispatch.apply(e,arguments):void 0}),l=(t=(t||"").match(M)||[""]).length;while(l--)d=g=(s=Ce.exec(t[l])||[])[1],h=(s[2]||"").split(".").sort(),d&&(f=w.event.special[d]||{},d=(i?f.delegateType:f.bindType)||d,f=w.event.special[d]||{},c=w.extend({type:d,origType:g,data:r,handler:n,guid:n.guid,selector:i,needsContext:i&&w.expr.match.needsContext.test(i),namespace:h.join(".")},o),(p=u[d])||((p=u[d]=[]).delegateCount=0,f.setup&&!1!==f.setup.call(e,r,h,a)||e.addEventListener&&e.addEventListener(d,a)),f.add&&(f.add.call(e,c),c.handler.guid||(c.handler.guid=n.guid)),i?p.splice(p.delegateCount++,0,c):p.push(c),w.event.global[d]=!0)}},remove:function(e,t,n,r,i){var o,a,s,u,l,c,f,p,d,h,g,y=J.hasData(e)&&J.get(e);if(y&&(u=y.events)){l=(t=(t||"").match(M)||[""]).length;while(l--)if(s=Ce.exec(t[l])||[],d=g=s[1],h=(s[2]||"").split(".").sort(),d){f=w.event.special[d]||{},p=u[d=(r?f.delegateType:f.bindType)||d]||[],s=s[2]&&new RegExp("(^|\\.)"+h.join("\\.(?:.*\\.|)")+"(\\.|$)"),a=o=p.length;while(o--)c=p[o],!i&&g!==c.origType||n&&n.guid!==c.guid||s&&!s.test(c.namespace)||r&&r!==c.selector&&("**"!==r||!c.selector)||(p.splice(o,1),c.selector&&p.delegateCount--,f.remove&&f.remove.call(e,c));a&&!p.length&&(f.teardown&&!1!==f.teardown.call(e,h,y.handle)||w.removeEvent(e,d,y.handle),delete u[d])}else for(d in u)w.event.remove(e,d+t[l],n,r,!0);w.isEmptyObject(u)&&J.remove(e,"handle events")}},dispatch:function(e){var t=w.event.fix(e),n,r,i,o,a,s,u=new Array(arguments.length),l=(J.get(this,"events")||{})[t.type]||[],c=w.event.special[t.type]||{};for(u[0]=t,n=1;n<arguments.length;n++)u[n]=arguments[n];if(t.delegateTarget=this,!c.preDispatch||!1!==c.preDispatch.call(this,t)){s=w.event.handlers.call(this,t,l),n=0;while((o=s[n++])&&!t.isPropagationStopped()){t.currentTarget=o.elem,r=0;while((a=o.handlers[r++])&&!t.isImmediatePropagationStopped())t.rnamespace&&!t.rnamespace.test(a.namespace)||(t.handleObj=a,t.data=a.data,void 0!==(i=((w.event.special[a.origType]||{}).handle||a.handler).apply(o.elem,u))&&!1===(t.result=i)&&(t.preventDefault(),t.stopPropagation()))}return c.postDispatch&&c.postDispatch.call(this,t),t.result}},handlers:function(e,t){var n,r,i,o,a,s=[],u=t.delegateCount,l=e.target;if(u&&l.nodeType&&!("click"===e.type&&e.button>=1))for(;l!==this;l=l.parentNode||this)if(1===l.nodeType&&("click"!==e.type||!0!==l.disabled)){for(o=[],a={},n=0;n<u;n++)void 0===a[i=(r=t[n]).selector+" "]&&(a[i]=r.needsContext?w(i,this).index(l)>-1:w.find(i,this,null,[l]).length),a[i]&&o.push(r);o.length&&s.push({elem:l,handlers:o})}return l=this,u<t.length&&s.push({elem:l,handlers:t.slice(u)}),s},addProp:function(e,t){Object.defineProperty(w.Event.prototype,e,{enumerable:!0,configurable:!0,get:g(t)?function(){if(this.originalEvent)return t(this.originalEvent)}:function(){if(this.originalEvent)return this.originalEvent[e]},set:function(t){Object.defineProperty(this,e,{enumerable:!0,configurable:!0,writable:!0,value:t})}})},fix:function(e){return e[w.expando]?e:new w.Event(e)},special:{load:{noBubble:!0},focus:{trigger:function(){if(this!==Se()&&this.focus)return this.focus(),!1},delegateType:"focusin"},blur:{trigger:function(){if(this===Se()&&this.blur)return this.blur(),!1},delegateType:"focusout"},click:{trigger:function(){if("checkbox"===this.type&&this.click&&N(this,"input"))return this.click(),!1},_default:function(e){return N(e.target,"a")}},beforeunload:{postDispatch:function(e){void 0!==e.result&&e.originalEvent&&(e.originalEvent.returnValue=e.result)}}}},w.removeEvent=function(e,t,n){e.removeEventListener&&e.removeEventListener(t,n)},w.Event=function(e,t){if(!(this instanceof w.Event))return new w.Event(e,t);e&&e.type?(this.originalEvent=e,this.type=e.type,this.isDefaultPrevented=e.defaultPrevented||void 0===e.defaultPrevented&&!1===e.returnValue?Ee:ke,this.target=e.target&&3===e.target.nodeType?e.target.parentNode:e.target,this.currentTarget=e.currentTarget,this.relatedTarget=e.relatedTarget):this.type=e,t&&w.extend(this,t),this.timeStamp=e&&e.timeStamp||Date.now(),this[w.expando]=!0},w.Event.prototype={constructor:w.Event,isDefaultPrevented:ke,isPropagationStopped:ke,isImmediatePropagationStopped:ke,isSimulated:!1,preventDefault:function(){var e=this.originalEvent;this.isDefaultPrevented=Ee,e&&!this.isSimulated&&e.preventDefault()},stopPropagation:function(){var e=this.originalEvent;this.isPropagationStopped=Ee,e&&!this.isSimulated&&e.stopPropagation()},stopImmediatePropagation:function(){var e=this.originalEvent;this.isImmediatePropagationStopped=Ee,e&&!this.isSimulated&&e.stopImmediatePropagation(),this.stopPropagation()}},w.each({altKey:!0,bubbles:!0,cancelable:!0,changedTouches:!0,ctrlKey:!0,detail:!0,eventPhase:!0,metaKey:!0,pageX:!0,pageY:!0,shiftKey:!0,view:!0,"char":!0,charCode:!0,key:!0,keyCode:!0,button:!0,buttons:!0,clientX:!0,clientY:!0,offsetX:!0,offsetY:!0,pointerId:!0,pointerType:!0,screenX:!0,screenY:!0,targetTouches:!0,toElement:!0,touches:!0,which:function(e){var t=e.button;return null==e.which&&we.test(e.type)?null!=e.charCode?e.charCode:e.keyCode:!e.which&&void 0!==t&&Te.test(e.type)?1&t?1:2&t?3:4&t?2:0:e.which}},w.event.addProp),w.each({mouseenter:"mouseover",mouseleave:"mouseout",pointerenter:"pointerover",pointerleave:"pointerout"},function(e,t){w.event.special[e]={delegateType:t,bindType:t,handle:function(e){var n,r=this,i=e.relatedTarget,o=e.handleObj;return i&&(i===r||w.contains(r,i))||(e.type=o.origType,n=o.handler.apply(this,arguments),e.type=t),n}}}),w.fn.extend({on:function(e,t,n,r){return De(this,e,t,n,r)},one:function(e,t,n,r){return De(this,e,t,n,r,1)},off:function(e,t,n){var r,i;if(e&&e.preventDefault&&e.handleObj)return r=e.handleObj,w(e.delegateTarget).off(r.namespace?r.origType+"."+r.namespace:r.origType,r.selector,r.handler),this;if("object"==typeof e){for(i in e)this.off(i,t,e[i]);return this}return!1!==t&&"function"!=typeof t||(n=t,t=void 0),!1===n&&(n=ke),this.each(function(){w.event.remove(this,e,n,t)})}});var Ne=/<(?!area|br|col|embed|hr|img|input|link|meta|param)(([a-z][^\/\0>\x20\t\r\n\f]*)[^>]*)\/>/gi,Ae=/<script|<style|<link/i,je=/checked\s*(?:[^=]|=\s*.checked.)/i,qe=/^\s*<!(?:\[CDATA\[|--)|(?:\]\]|--)>\s*$/g;function Le(e,t){return N(e,"table")&&N(11!==t.nodeType?t:t.firstChild,"tr")?w(e).children("tbody")[0]||e:e}function He(e){return e.type=(null!==e.getAttribute("type"))+"/"+e.type,e}function Oe(e){return"true/"===(e.type||"").slice(0,5)?e.type=e.type.slice(5):e.removeAttribute("type"),e}function Pe(e,t){var n,r,i,o,a,s,u,l;if(1===t.nodeType){if(J.hasData(e)&&(o=J.access(e),a=J.set(t,o),l=o.events)){delete a.handle,a.events={};for(i in l)for(n=0,r=l[i].length;n<r;n++)w.event.add(t,i,l[i][n])}K.hasData(e)&&(s=K.access(e),u=w.extend({},s),K.set(t,u))}}function Me(e,t){var n=t.nodeName.toLowerCase();"input"===n&&pe.test(e.type)?t.checked=e.checked:"input"!==n&&"textarea"!==n||(t.defaultValue=e.defaultValue)}function Re(e,t,n,r){t=a.apply([],t);var i,o,s,u,l,c,f=0,p=e.length,d=p-1,y=t[0],v=g(y);if(v||p>1&&"string"==typeof y&&!h.checkClone&&je.test(y))return e.each(function(i){var o=e.eq(i);v&&(t[0]=y.call(this,i,o.html())),Re(o,t,n,r)});if(p&&(i=xe(t,e[0].ownerDocument,!1,e,r),o=i.firstChild,1===i.childNodes.length&&(i=o),o||r)){for(u=(s=w.map(ye(i,"script"),He)).length;f<p;f++)l=i,f!==d&&(l=w.clone(l,!0,!0),u&&w.merge(s,ye(l,"script"))),n.call(e[f],l,f);if(u)for(c=s[s.length-1].ownerDocument,w.map(s,Oe),f=0;f<u;f++)l=s[f],he.test(l.type||"")&&!J.access(l,"globalEval")&&w.contains(c,l)&&(l.src&&"module"!==(l.type||"").toLowerCase()?w._evalUrl&&w._evalUrl(l.src):m(l.textContent.replace(qe,""),c,l))}return e}function Ie(e,t,n){for(var r,i=t?w.filter(t,e):e,o=0;null!=(r=i[o]);o++)n||1!==r.nodeType||w.cleanData(ye(r)),r.parentNode&&(n&&w.contains(r.ownerDocument,r)&&ve(ye(r,"script")),r.parentNode.removeChild(r));return e}w.extend({htmlPrefilter:function(e){return e.replace(Ne,"<$1></$2>")},clone:function(e,t,n){var r,i,o,a,s=e.cloneNode(!0),u=w.contains(e.ownerDocument,e);if(!(h.noCloneChecked||1!==e.nodeType&&11!==e.nodeType||w.isXMLDoc(e)))for(a=ye(s),r=0,i=(o=ye(e)).length;r<i;r++)Me(o[r],a[r]);if(t)if(n)for(o=o||ye(e),a=a||ye(s),r=0,i=o.length;r<i;r++)Pe(o[r],a[r]);else Pe(e,s);return(a=ye(s,"script")).length>0&&ve(a,!u&&ye(e,"script")),s},cleanData:function(e){for(var t,n,r,i=w.event.special,o=0;void 0!==(n=e[o]);o++)if(Y(n)){if(t=n[J.expando]){if(t.events)for(r in t.events)i[r]?w.event.remove(n,r):w.removeEvent(n,r,t.handle);n[J.expando]=void 0}n[K.expando]&&(n[K.expando]=void 0)}}}),w.fn.extend({detach:function(e){return Ie(this,e,!0)},remove:function(e){return Ie(this,e)},text:function(e){return z(this,function(e){return void 0===e?w.text(this):this.empty().each(function(){1!==this.nodeType&&11!==this.nodeType&&9!==this.nodeType||(this.textContent=e)})},null,e,arguments.length)},append:function(){return Re(this,arguments,function(e){1!==this.nodeType&&11!==this.nodeType&&9!==this.nodeType||Le(this,e).appendChild(e)})},prepend:function(){return Re(this,arguments,function(e){if(1===this.nodeType||11===this.nodeType||9===this.nodeType){var t=Le(this,e);t.insertBefore(e,t.firstChild)}})},before:function(){return Re(this,arguments,function(e){this.parentNode&&this.parentNode.insertBefore(e,this)})},after:function(){return Re(this,arguments,function(e){this.parentNode&&this.parentNode.insertBefore(e,this.nextSibling)})},empty:function(){for(var e,t=0;null!=(e=this[t]);t++)1===e.nodeType&&(w.cleanData(ye(e,!1)),e.textContent="");return this},clone:function(e,t){return e=null!=e&&e,t=null==t?e:t,this.map(function(){return w.clone(this,e,t)})},html:function(e){return z(this,function(e){var t=this[0]||{},n=0,r=this.length;if(void 0===e&&1===t.nodeType)return t.innerHTML;if("string"==typeof e&&!Ae.test(e)&&!ge[(de.exec(e)||["",""])[1].toLowerCase()]){e=w.htmlPrefilter(e);try{for(;n<r;n++)1===(t=this[n]||{}).nodeType&&(w.cleanData(ye(t,!1)),t.innerHTML=e);t=0}catch(e){}}t&&this.empty().append(e)},null,e,arguments.length)},replaceWith:function(){var e=[];return Re(this,arguments,function(t){var n=this.parentNode;w.inArray(this,e)<0&&(w.cleanData(ye(this)),n&&n.replaceChild(t,this))},e)}}),w.each({appendTo:"append",prependTo:"prepend",insertBefore:"before",insertAfter:"after",replaceAll:"replaceWith"},function(e,t){w.fn[e]=function(e){for(var n,r=[],i=w(e),o=i.length-1,a=0;a<=o;a++)n=a===o?this:this.clone(!0),w(i[a])[t](n),s.apply(r,n.get());return this.pushStack(r)}});var We=new RegExp("^("+re+")(?!px)[a-z%]+$","i"),$e=function(t){var n=t.ownerDocument.defaultView;return n&&n.opener||(n=e),n.getComputedStyle(t)},Be=new RegExp(oe.join("|"),"i");!function(){function t(){if(c){l.style.cssText="position:absolute;left:-11111px;width:60px;margin-top:1px;padding:0;border:0",c.style.cssText="position:relative;display:block;box-sizing:border-box;overflow:scroll;margin:auto;border:1px;padding:1px;width:60%;top:1%",be.appendChild(l).appendChild(c);var t=e.getComputedStyle(c);i="1%"!==t.top,u=12===n(t.marginLeft),c.style.right="60%",s=36===n(t.right),o=36===n(t.width),c.style.position="absolute",a=36===c.offsetWidth||"absolute",be.removeChild(l),c=null}}function n(e){return Math.round(parseFloat(e))}var i,o,a,s,u,l=r.createElement("div"),c=r.createElement("div");c.style&&(c.style.backgroundClip="content-box",c.cloneNode(!0).style.backgroundClip="",h.clearCloneStyle="content-box"===c.style.backgroundClip,w.extend(h,{boxSizingReliable:function(){return t(),o},pixelBoxStyles:function(){return t(),s},pixelPosition:function(){return t(),i},reliableMarginLeft:function(){return t(),u},scrollboxSize:function(){return t(),a}}))}();function Fe(e,t,n){var r,i,o,a,s=e.style;return(n=n||$e(e))&&(""!==(a=n.getPropertyValue(t)||n[t])||w.contains(e.ownerDocument,e)||(a=w.style(e,t)),!h.pixelBoxStyles()&&We.test(a)&&Be.test(t)&&(r=s.width,i=s.minWidth,o=s.maxWidth,s.minWidth=s.maxWidth=s.width=a,a=n.width,s.width=r,s.minWidth=i,s.maxWidth=o)),void 0!==a?a+"":a}function _e(e,t){return{get:function(){if(!e())return(this.get=t).apply(this,arguments);delete this.get}}}var ze=/^(none|table(?!-c[ea]).+)/,Xe=/^--/,Ue={position:"absolute",visibility:"hidden",display:"block"},Ve={letterSpacing:"0",fontWeight:"400"},Ge=["Webkit","Moz","ms"],Ye=r.createElement("div").style;function Qe(e){if(e in Ye)return e;var t=e[0].toUpperCase()+e.slice(1),n=Ge.length;while(n--)if((e=Ge[n]+t)in Ye)return e}function Je(e){var t=w.cssProps[e];return t||(t=w.cssProps[e]=Qe(e)||e),t}function Ke(e,t,n){var r=ie.exec(t);return r?Math.max(0,r[2]-(n||0))+(r[3]||"px"):t}function Ze(e,t,n,r,i,o){var a="width"===t?1:0,s=0,u=0;if(n===(r?"border":"content"))return 0;for(;a<4;a+=2)"margin"===n&&(u+=w.css(e,n+oe[a],!0,i)),r?("content"===n&&(u-=w.css(e,"padding"+oe[a],!0,i)),"margin"!==n&&(u-=w.css(e,"border"+oe[a]+"Width",!0,i))):(u+=w.css(e,"padding"+oe[a],!0,i),"padding"!==n?u+=w.css(e,"border"+oe[a]+"Width",!0,i):s+=w.css(e,"border"+oe[a]+"Width",!0,i));return!r&&o>=0&&(u+=Math.max(0,Math.ceil(e["offset"+t[0].toUpperCase()+t.slice(1)]-o-u-s-.5))),u}function et(e,t,n){var r=$e(e),i=Fe(e,t,r),o="border-box"===w.css(e,"boxSizing",!1,r),a=o;if(We.test(i)){if(!n)return i;i="auto"}return a=a&&(h.boxSizingReliable()||i===e.style[t]),("auto"===i||!parseFloat(i)&&"inline"===w.css(e,"display",!1,r))&&(i=e["offset"+t[0].toUpperCase()+t.slice(1)],a=!0),(i=parseFloat(i)||0)+Ze(e,t,n||(o?"border":"content"),a,r,i)+"px"}w.extend({cssHooks:{opacity:{get:function(e,t){if(t){var n=Fe(e,"opacity");return""===n?"1":n}}}},cssNumber:{animationIterationCount:!0,columnCount:!0,fillOpacity:!0,flexGrow:!0,flexShrink:!0,fontWeight:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,widows:!0,zIndex:!0,zoom:!0},cssProps:{},style:function(e,t,n,r){if(e&&3!==e.nodeType&&8!==e.nodeType&&e.style){var i,o,a,s=G(t),u=Xe.test(t),l=e.style;if(u||(t=Je(s)),a=w.cssHooks[t]||w.cssHooks[s],void 0===n)return a&&"get"in a&&void 0!==(i=a.get(e,!1,r))?i:l[t];"string"==(o=typeof n)&&(i=ie.exec(n))&&i[1]&&(n=ue(e,t,i),o="number"),null!=n&&n===n&&("number"===o&&(n+=i&&i[3]||(w.cssNumber[s]?"":"px")),h.clearCloneStyle||""!==n||0!==t.indexOf("background")||(l[t]="inherit"),a&&"set"in a&&void 0===(n=a.set(e,n,r))||(u?l.setProperty(t,n):l[t]=n))}},css:function(e,t,n,r){var i,o,a,s=G(t);return Xe.test(t)||(t=Je(s)),(a=w.cssHooks[t]||w.cssHooks[s])&&"get"in a&&(i=a.get(e,!0,n)),void 0===i&&(i=Fe(e,t,r)),"normal"===i&&t in Ve&&(i=Ve[t]),""===n||n?(o=parseFloat(i),!0===n||isFinite(o)?o||0:i):i}}),w.each(["height","width"],function(e,t){w.cssHooks[t]={get:function(e,n,r){if(n)return!ze.test(w.css(e,"display"))||e.getClientRects().length&&e.getBoundingClientRect().width?et(e,t,r):se(e,Ue,function(){return et(e,t,r)})},set:function(e,n,r){var i,o=$e(e),a="border-box"===w.css(e,"boxSizing",!1,o),s=r&&Ze(e,t,r,a,o);return a&&h.scrollboxSize()===o.position&&(s-=Math.ceil(e["offset"+t[0].toUpperCase()+t.slice(1)]-parseFloat(o[t])-Ze(e,t,"border",!1,o)-.5)),s&&(i=ie.exec(n))&&"px"!==(i[3]||"px")&&(e.style[t]=n,n=w.css(e,t)),Ke(e,n,s)}}}),w.cssHooks.marginLeft=_e(h.reliableMarginLeft,function(e,t){if(t)return(parseFloat(Fe(e,"marginLeft"))||e.getBoundingClientRect().left-se(e,{marginLeft:0},function(){return e.getBoundingClientRect().left}))+"px"}),w.each({margin:"",padding:"",border:"Width"},function(e,t){w.cssHooks[e+t]={expand:function(n){for(var r=0,i={},o="string"==typeof n?n.split(" "):[n];r<4;r++)i[e+oe[r]+t]=o[r]||o[r-2]||o[0];return i}},"margin"!==e&&(w.cssHooks[e+t].set=Ke)}),w.fn.extend({css:function(e,t){return z(this,function(e,t,n){var r,i,o={},a=0;if(Array.isArray(t)){for(r=$e(e),i=t.length;a<i;a++)o[t[a]]=w.css(e,t[a],!1,r);return o}return void 0!==n?w.style(e,t,n):w.css(e,t)},e,t,arguments.length>1)}});function tt(e,t,n,r,i){return new tt.prototype.init(e,t,n,r,i)}w.Tween=tt,tt.prototype={constructor:tt,init:function(e,t,n,r,i,o){this.elem=e,this.prop=n,this.easing=i||w.easing._default,this.options=t,this.start=this.now=this.cur(),this.end=r,this.unit=o||(w.cssNumber[n]?"":"px")},cur:function(){var e=tt.propHooks[this.prop];return e&&e.get?e.get(this):tt.propHooks._default.get(this)},run:function(e){var t,n=tt.propHooks[this.prop];return this.options.duration?this.pos=t=w.easing[this.easing](e,this.options.duration*e,0,1,this.options.duration):this.pos=t=e,this.now=(this.end-this.start)*t+this.start,this.options.step&&this.options.step.call(this.elem,this.now,this),n&&n.set?n.set(this):tt.propHooks._default.set(this),this}},tt.prototype.init.prototype=tt.prototype,tt.propHooks={_default:{get:function(e){var t;return 1!==e.elem.nodeType||null!=e.elem[e.prop]&&null==e.elem.style[e.prop]?e.elem[e.prop]:(t=w.css(e.elem,e.prop,""))&&"auto"!==t?t:0},set:function(e){w.fx.step[e.prop]?w.fx.step[e.prop](e):1!==e.elem.nodeType||null==e.elem.style[w.cssProps[e.prop]]&&!w.cssHooks[e.prop]?e.elem[e.prop]=e.now:w.style(e.elem,e.prop,e.now+e.unit)}}},tt.propHooks.scrollTop=tt.propHooks.scrollLeft={set:function(e){e.elem.nodeType&&e.elem.parentNode&&(e.elem[e.prop]=e.now)}},w.easing={linear:function(e){return e},swing:function(e){return.5-Math.cos(e*Math.PI)/2},_default:"swing"},w.fx=tt.prototype.init,w.fx.step={};var nt,rt,it=/^(?:toggle|show|hide)$/,ot=/queueHooks$/;function at(){rt&&(!1===r.hidden&&e.requestAnimationFrame?e.requestAnimationFrame(at):e.setTimeout(at,w.fx.interval),w.fx.tick())}function st(){return e.setTimeout(function(){nt=void 0}),nt=Date.now()}function ut(e,t){var n,r=0,i={height:e};for(t=t?1:0;r<4;r+=2-t)i["margin"+(n=oe[r])]=i["padding"+n]=e;return t&&(i.opacity=i.width=e),i}function lt(e,t,n){for(var r,i=(pt.tweeners[t]||[]).concat(pt.tweeners["*"]),o=0,a=i.length;o<a;o++)if(r=i[o].call(n,t,e))return r}function ct(e,t,n){var r,i,o,a,s,u,l,c,f="width"in t||"height"in t,p=this,d={},h=e.style,g=e.nodeType&&ae(e),y=J.get(e,"fxshow");n.queue||(null==(a=w._queueHooks(e,"fx")).unqueued&&(a.unqueued=0,s=a.empty.fire,a.empty.fire=function(){a.unqueued||s()}),a.unqueued++,p.always(function(){p.always(function(){a.unqueued--,w.queue(e,"fx").length||a.empty.fire()})}));for(r in t)if(i=t[r],it.test(i)){if(delete t[r],o=o||"toggle"===i,i===(g?"hide":"show")){if("show"!==i||!y||void 0===y[r])continue;g=!0}d[r]=y&&y[r]||w.style(e,r)}if((u=!w.isEmptyObject(t))||!w.isEmptyObject(d)){f&&1===e.nodeType&&(n.overflow=[h.overflow,h.overflowX,h.overflowY],null==(l=y&&y.display)&&(l=J.get(e,"display")),"none"===(c=w.css(e,"display"))&&(l?c=l:(fe([e],!0),l=e.style.display||l,c=w.css(e,"display"),fe([e]))),("inline"===c||"inline-block"===c&&null!=l)&&"none"===w.css(e,"float")&&(u||(p.done(function(){h.display=l}),null==l&&(c=h.display,l="none"===c?"":c)),h.display="inline-block")),n.overflow&&(h.overflow="hidden",p.always(function(){h.overflow=n.overflow[0],h.overflowX=n.overflow[1],h.overflowY=n.overflow[2]})),u=!1;for(r in d)u||(y?"hidden"in y&&(g=y.hidden):y=J.access(e,"fxshow",{display:l}),o&&(y.hidden=!g),g&&fe([e],!0),p.done(function(){g||fe([e]),J.remove(e,"fxshow");for(r in d)w.style(e,r,d[r])})),u=lt(g?y[r]:0,r,p),r in y||(y[r]=u.start,g&&(u.end=u.start,u.start=0))}}function ft(e,t){var n,r,i,o,a;for(n in e)if(r=G(n),i=t[r],o=e[n],Array.isArray(o)&&(i=o[1],o=e[n]=o[0]),n!==r&&(e[r]=o,delete e[n]),(a=w.cssHooks[r])&&"expand"in a){o=a.expand(o),delete e[r];for(n in o)n in e||(e[n]=o[n],t[n]=i)}else t[r]=i}function pt(e,t,n){var r,i,o=0,a=pt.prefilters.length,s=w.Deferred().always(function(){delete u.elem}),u=function(){if(i)return!1;for(var t=nt||st(),n=Math.max(0,l.startTime+l.duration-t),r=1-(n/l.duration||0),o=0,a=l.tweens.length;o<a;o++)l.tweens[o].run(r);return s.notifyWith(e,[l,r,n]),r<1&&a?n:(a||s.notifyWith(e,[l,1,0]),s.resolveWith(e,[l]),!1)},l=s.promise({elem:e,props:w.extend({},t),opts:w.extend(!0,{specialEasing:{},easing:w.easing._default},n),originalProperties:t,originalOptions:n,startTime:nt||st(),duration:n.duration,tweens:[],createTween:function(t,n){var r=w.Tween(e,l.opts,t,n,l.opts.specialEasing[t]||l.opts.easing);return l.tweens.push(r),r},stop:function(t){var n=0,r=t?l.tweens.length:0;if(i)return this;for(i=!0;n<r;n++)l.tweens[n].run(1);return t?(s.notifyWith(e,[l,1,0]),s.resolveWith(e,[l,t])):s.rejectWith(e,[l,t]),this}}),c=l.props;for(ft(c,l.opts.specialEasing);o<a;o++)if(r=pt.prefilters[o].call(l,e,c,l.opts))return g(r.stop)&&(w._queueHooks(l.elem,l.opts.queue).stop=r.stop.bind(r)),r;return w.map(c,lt,l),g(l.opts.start)&&l.opts.start.call(e,l),l.progress(l.opts.progress).done(l.opts.done,l.opts.complete).fail(l.opts.fail).always(l.opts.always),w.fx.timer(w.extend(u,{elem:e,anim:l,queue:l.opts.queue})),l}w.Animation=w.extend(pt,{tweeners:{"*":[function(e,t){var n=this.createTween(e,t);return ue(n.elem,e,ie.exec(t),n),n}]},tweener:function(e,t){g(e)?(t=e,e=["*"]):e=e.match(M);for(var n,r=0,i=e.length;r<i;r++)n=e[r],pt.tweeners[n]=pt.tweeners[n]||[],pt.tweeners[n].unshift(t)},prefilters:[ct],prefilter:function(e,t){t?pt.prefilters.unshift(e):pt.prefilters.push(e)}}),w.speed=function(e,t,n){var r=e&&"object"==typeof e?w.extend({},e):{complete:n||!n&&t||g(e)&&e,duration:e,easing:n&&t||t&&!g(t)&&t};return w.fx.off?r.duration=0:"number"!=typeof r.duration&&(r.duration in w.fx.speeds?r.duration=w.fx.speeds[r.duration]:r.duration=w.fx.speeds._default),null!=r.queue&&!0!==r.queue||(r.queue="fx"),r.old=r.complete,r.complete=function(){g(r.old)&&r.old.call(this),r.queue&&w.dequeue(this,r.queue)},r},w.fn.extend({fadeTo:function(e,t,n,r){return this.filter(ae).css("opacity",0).show().end().animate({opacity:t},e,n,r)},animate:function(e,t,n,r){var i=w.isEmptyObject(e),o=w.speed(t,n,r),a=function(){var t=pt(this,w.extend({},e),o);(i||J.get(this,"finish"))&&t.stop(!0)};return a.finish=a,i||!1===o.queue?this.each(a):this.queue(o.queue,a)},stop:function(e,t,n){var r=function(e){var t=e.stop;delete e.stop,t(n)};return"string"!=typeof e&&(n=t,t=e,e=void 0),t&&!1!==e&&this.queue(e||"fx",[]),this.each(function(){var t=!0,i=null!=e&&e+"queueHooks",o=w.timers,a=J.get(this);if(i)a[i]&&a[i].stop&&r(a[i]);else for(i in a)a[i]&&a[i].stop&&ot.test(i)&&r(a[i]);for(i=o.length;i--;)o[i].elem!==this||null!=e&&o[i].queue!==e||(o[i].anim.stop(n),t=!1,o.splice(i,1));!t&&n||w.dequeue(this,e)})},finish:function(e){return!1!==e&&(e=e||"fx"),this.each(function(){var t,n=J.get(this),r=n[e+"queue"],i=n[e+"queueHooks"],o=w.timers,a=r?r.length:0;for(n.finish=!0,w.queue(this,e,[]),i&&i.stop&&i.stop.call(this,!0),t=o.length;t--;)o[t].elem===this&&o[t].queue===e&&(o[t].anim.stop(!0),o.splice(t,1));for(t=0;t<a;t++)r[t]&&r[t].finish&&r[t].finish.call(this);delete n.finish})}}),w.each(["toggle","show","hide"],function(e,t){var n=w.fn[t];w.fn[t]=function(e,r,i){return null==e||"boolean"==typeof e?n.apply(this,arguments):this.animate(ut(t,!0),e,r,i)}}),w.each({slideDown:ut("show"),slideUp:ut("hide"),slideToggle:ut("toggle"),fadeIn:{opacity:"show"},fadeOut:{opacity:"hide"},fadeToggle:{opacity:"toggle"}},function(e,t){w.fn[e]=function(e,n,r){return this.animate(t,e,n,r)}}),w.timers=[],w.fx.tick=function(){var e,t=0,n=w.timers;for(nt=Date.now();t<n.length;t++)(e=n[t])()||n[t]!==e||n.splice(t--,1);n.length||w.fx.stop(),nt=void 0},w.fx.timer=function(e){w.timers.push(e),w.fx.start()},w.fx.interval=13,w.fx.start=function(){rt||(rt=!0,at())},w.fx.stop=function(){rt=null},w.fx.speeds={slow:600,fast:200,_default:400},w.fn.delay=function(t,n){return t=w.fx?w.fx.speeds[t]||t:t,n=n||"fx",this.queue(n,function(n,r){var i=e.setTimeout(n,t);r.stop=function(){e.clearTimeout(i)}})},function(){var e=r.createElement("input"),t=r.createElement("select").appendChild(r.createElement("option"));e.type="checkbox",h.checkOn=""!==e.value,h.optSelected=t.selected,(e=r.createElement("input")).value="t",e.type="radio",h.radioValue="t"===e.value}();var dt,ht=w.expr.attrHandle;w.fn.extend({attr:function(e,t){return z(this,w.attr,e,t,arguments.length>1)},removeAttr:function(e){return this.each(function(){w.removeAttr(this,e)})}}),w.extend({attr:function(e,t,n){var r,i,o=e.nodeType;if(3!==o&&8!==o&&2!==o)return"undefined"==typeof e.getAttribute?w.prop(e,t,n):(1===o&&w.isXMLDoc(e)||(i=w.attrHooks[t.toLowerCase()]||(w.expr.match.bool.test(t)?dt:void 0)),void 0!==n?null===n?void w.removeAttr(e,t):i&&"set"in i&&void 0!==(r=i.set(e,n,t))?r:(e.setAttribute(t,n+""),n):i&&"get"in i&&null!==(r=i.get(e,t))?r:null==(r=w.find.attr(e,t))?void 0:r)},attrHooks:{type:{set:function(e,t){if(!h.radioValue&&"radio"===t&&N(e,"input")){var n=e.value;return e.setAttribute("type",t),n&&(e.value=n),t}}}},removeAttr:function(e,t){var n,r=0,i=t&&t.match(M);if(i&&1===e.nodeType)while(n=i[r++])e.removeAttribute(n)}}),dt={set:function(e,t,n){return!1===t?w.removeAttr(e,n):e.setAttribute(n,n),n}},w.each(w.expr.match.bool.source.match(/\w+/g),function(e,t){var n=ht[t]||w.find.attr;ht[t]=function(e,t,r){var i,o,a=t.toLowerCase();return r||(o=ht[a],ht[a]=i,i=null!=n(e,t,r)?a:null,ht[a]=o),i}});var gt=/^(?:input|select|textarea|button)$/i,yt=/^(?:a|area)$/i;w.fn.extend({prop:function(e,t){return z(this,w.prop,e,t,arguments.length>1)},removeProp:function(e){return this.each(function(){delete this[w.propFix[e]||e]})}}),w.extend({prop:function(e,t,n){var r,i,o=e.nodeType;if(3!==o&&8!==o&&2!==o)return 1===o&&w.isXMLDoc(e)||(t=w.propFix[t]||t,i=w.propHooks[t]),void 0!==n?i&&"set"in i&&void 0!==(r=i.set(e,n,t))?r:e[t]=n:i&&"get"in i&&null!==(r=i.get(e,t))?r:e[t]},propHooks:{tabIndex:{get:function(e){var t=w.find.attr(e,"tabindex");return t?parseInt(t,10):gt.test(e.nodeName)||yt.test(e.nodeName)&&e.href?0:-1}}},propFix:{"for":"htmlFor","class":"className"}}),h.optSelected||(w.propHooks.selected={get:function(e){var t=e.parentNode;return t&&t.parentNode&&t.parentNode.selectedIndex,null},set:function(e){var t=e.parentNode;t&&(t.selectedIndex,t.parentNode&&t.parentNode.selectedIndex)}}),w.each(["tabIndex","readOnly","maxLength","cellSpacing","cellPadding","rowSpan","colSpan","useMap","frameBorder","contentEditable"],function(){w.propFix[this.toLowerCase()]=this});function vt(e){return(e.match(M)||[]).join(" ")}function mt(e){return e.getAttribute&&e.getAttribute("class")||""}function xt(e){return Array.isArray(e)?e:"string"==typeof e?e.match(M)||[]:[]}w.fn.extend({addClass:function(e){var t,n,r,i,o,a,s,u=0;if(g(e))return this.each(function(t){w(this).addClass(e.call(this,t,mt(this)))});if((t=xt(e)).length)while(n=this[u++])if(i=mt(n),r=1===n.nodeType&&" "+vt(i)+" "){a=0;while(o=t[a++])r.indexOf(" "+o+" ")<0&&(r+=o+" ");i!==(s=vt(r))&&n.setAttribute("class",s)}return this},removeClass:function(e){var t,n,r,i,o,a,s,u=0;if(g(e))return this.each(function(t){w(this).removeClass(e.call(this,t,mt(this)))});if(!arguments.length)return this.attr("class","");if((t=xt(e)).length)while(n=this[u++])if(i=mt(n),r=1===n.nodeType&&" "+vt(i)+" "){a=0;while(o=t[a++])while(r.indexOf(" "+o+" ")>-1)r=r.replace(" "+o+" "," ");i!==(s=vt(r))&&n.setAttribute("class",s)}return this},toggleClass:function(e,t){var n=typeof e,r="string"===n||Array.isArray(e);return"boolean"==typeof t&&r?t?this.addClass(e):this.removeClass(e):g(e)?this.each(function(n){w(this).toggleClass(e.call(this,n,mt(this),t),t)}):this.each(function(){var t,i,o,a;if(r){i=0,o=w(this),a=xt(e);while(t=a[i++])o.hasClass(t)?o.removeClass(t):o.addClass(t)}else void 0!==e&&"boolean"!==n||((t=mt(this))&&J.set(this,"__className__",t),this.setAttribute&&this.setAttribute("class",t||!1===e?"":J.get(this,"__className__")||""))})},hasClass:function(e){var t,n,r=0;t=" "+e+" ";while(n=this[r++])if(1===n.nodeType&&(" "+vt(mt(n))+" ").indexOf(t)>-1)return!0;return!1}});var bt=/\r/g;w.fn.extend({val:function(e){var t,n,r,i=this[0];{if(arguments.length)return r=g(e),this.each(function(n){var i;1===this.nodeType&&(null==(i=r?e.call(this,n,w(this).val()):e)?i="":"number"==typeof i?i+="":Array.isArray(i)&&(i=w.map(i,function(e){return null==e?"":e+""})),(t=w.valHooks[this.type]||w.valHooks[this.nodeName.toLowerCase()])&&"set"in t&&void 0!==t.set(this,i,"value")||(this.value=i))});if(i)return(t=w.valHooks[i.type]||w.valHooks[i.nodeName.toLowerCase()])&&"get"in t&&void 0!==(n=t.get(i,"value"))?n:"string"==typeof(n=i.value)?n.replace(bt,""):null==n?"":n}}}),w.extend({valHooks:{option:{get:function(e){var t=w.find.attr(e,"value");return null!=t?t:vt(w.text(e))}},select:{get:function(e){var t,n,r,i=e.options,o=e.selectedIndex,a="select-one"===e.type,s=a?null:[],u=a?o+1:i.length;for(r=o<0?u:a?o:0;r<u;r++)if(((n=i[r]).selected||r===o)&&!n.disabled&&(!n.parentNode.disabled||!N(n.parentNode,"optgroup"))){if(t=w(n).val(),a)return t;s.push(t)}return s},set:function(e,t){var n,r,i=e.options,o=w.makeArray(t),a=i.length;while(a--)((r=i[a]).selected=w.inArray(w.valHooks.option.get(r),o)>-1)&&(n=!0);return n||(e.selectedIndex=-1),o}}}}),w.each(["radio","checkbox"],function(){w.valHooks[this]={set:function(e,t){if(Array.isArray(t))return e.checked=w.inArray(w(e).val(),t)>-1}},h.checkOn||(w.valHooks[this].get=function(e){return null===e.getAttribute("value")?"on":e.value})}),h.focusin="onfocusin"in e;var wt=/^(?:focusinfocus|focusoutblur)$/,Tt=function(e){e.stopPropagation()};w.extend(w.event,{trigger:function(t,n,i,o){var a,s,u,l,c,p,d,h,v=[i||r],m=f.call(t,"type")?t.type:t,x=f.call(t,"namespace")?t.namespace.split("."):[];if(s=h=u=i=i||r,3!==i.nodeType&&8!==i.nodeType&&!wt.test(m+w.event.triggered)&&(m.indexOf(".")>-1&&(m=(x=m.split(".")).shift(),x.sort()),c=m.indexOf(":")<0&&"on"+m,t=t[w.expando]?t:new w.Event(m,"object"==typeof t&&t),t.isTrigger=o?2:3,t.namespace=x.join("."),t.rnamespace=t.namespace?new RegExp("(^|\\.)"+x.join("\\.(?:.*\\.|)")+"(\\.|$)"):null,t.result=void 0,t.target||(t.target=i),n=null==n?[t]:w.makeArray(n,[t]),d=w.event.special[m]||{},o||!d.trigger||!1!==d.trigger.apply(i,n))){if(!o&&!d.noBubble&&!y(i)){for(l=d.delegateType||m,wt.test(l+m)||(s=s.parentNode);s;s=s.parentNode)v.push(s),u=s;u===(i.ownerDocument||r)&&v.push(u.defaultView||u.parentWindow||e)}a=0;while((s=v[a++])&&!t.isPropagationStopped())h=s,t.type=a>1?l:d.bindType||m,(p=(J.get(s,"events")||{})[t.type]&&J.get(s,"handle"))&&p.apply(s,n),(p=c&&s[c])&&p.apply&&Y(s)&&(t.result=p.apply(s,n),!1===t.result&&t.preventDefault());return t.type=m,o||t.isDefaultPrevented()||d._default&&!1!==d._default.apply(v.pop(),n)||!Y(i)||c&&g(i[m])&&!y(i)&&((u=i[c])&&(i[c]=null),w.event.triggered=m,t.isPropagationStopped()&&h.addEventListener(m,Tt),i[m](),t.isPropagationStopped()&&h.removeEventListener(m,Tt),w.event.triggered=void 0,u&&(i[c]=u)),t.result}},simulate:function(e,t,n){var r=w.extend(new w.Event,n,{type:e,isSimulated:!0});w.event.trigger(r,null,t)}}),w.fn.extend({trigger:function(e,t){return this.each(function(){w.event.trigger(e,t,this)})},triggerHandler:function(e,t){var n=this[0];if(n)return w.event.trigger(e,t,n,!0)}}),h.focusin||w.each({focus:"focusin",blur:"focusout"},function(e,t){var n=function(e){w.event.simulate(t,e.target,w.event.fix(e))};w.event.special[t]={setup:function(){var r=this.ownerDocument||this,i=J.access(r,t);i||r.addEventListener(e,n,!0),J.access(r,t,(i||0)+1)},teardown:function(){var r=this.ownerDocument||this,i=J.access(r,t)-1;i?J.access(r,t,i):(r.removeEventListener(e,n,!0),J.remove(r,t))}}});var Ct=e.location,Et=Date.now(),kt=/\?/;w.parseXML=function(t){var n;if(!t||"string"!=typeof t)return null;try{n=(new e.DOMParser).parseFromString(t,"text/xml")}catch(e){n=void 0}return n&&!n.getElementsByTagName("parsererror").length||w.error("Invalid XML: "+t),n};var St=/\[\]$/,Dt=/\r?\n/g,Nt=/^(?:submit|button|image|reset|file)$/i,At=/^(?:input|select|textarea|keygen)/i;function jt(e,t,n,r){var i;if(Array.isArray(t))w.each(t,function(t,i){n||St.test(e)?r(e,i):jt(e+"["+("object"==typeof i&&null!=i?t:"")+"]",i,n,r)});else if(n||"object"!==x(t))r(e,t);else for(i in t)jt(e+"["+i+"]",t[i],n,r)}w.param=function(e,t){var n,r=[],i=function(e,t){var n=g(t)?t():t;r[r.length]=encodeURIComponent(e)+"="+encodeURIComponent(null==n?"":n)};if(Array.isArray(e)||e.jquery&&!w.isPlainObject(e))w.each(e,function(){i(this.name,this.value)});else for(n in e)jt(n,e[n],t,i);return r.join("&")},w.fn.extend({serialize:function(){return w.param(this.serializeArray())},serializeArray:function(){return this.map(function(){var e=w.prop(this,"elements");return e?w.makeArray(e):this}).filter(function(){var e=this.type;return this.name&&!w(this).is(":disabled")&&At.test(this.nodeName)&&!Nt.test(e)&&(this.checked||!pe.test(e))}).map(function(e,t){var n=w(this).val();return null==n?null:Array.isArray(n)?w.map(n,function(e){return{name:t.name,value:e.replace(Dt,"\r\n")}}):{name:t.name,value:n.replace(Dt,"\r\n")}}).get()}});var qt=/%20/g,Lt=/#.*$/,Ht=/([?&])_=[^&]*/,Ot=/^(.*?):[ \t]*([^\r\n]*)$/gm,Pt=/^(?:about|app|app-storage|.+-extension|file|res|widget):$/,Mt=/^(?:GET|HEAD)$/,Rt=/^\/\//,It={},Wt={},$t="*/".concat("*"),Bt=r.createElement("a");Bt.href=Ct.href;function Ft(e){return function(t,n){"string"!=typeof t&&(n=t,t="*");var r,i=0,o=t.toLowerCase().match(M)||[];if(g(n))while(r=o[i++])"+"===r[0]?(r=r.slice(1)||"*",(e[r]=e[r]||[]).unshift(n)):(e[r]=e[r]||[]).push(n)}}function _t(e,t,n,r){var i={},o=e===Wt;function a(s){var u;return i[s]=!0,w.each(e[s]||[],function(e,s){var l=s(t,n,r);return"string"!=typeof l||o||i[l]?o?!(u=l):void 0:(t.dataTypes.unshift(l),a(l),!1)}),u}return a(t.dataTypes[0])||!i["*"]&&a("*")}function zt(e,t){var n,r,i=w.ajaxSettings.flatOptions||{};for(n in t)void 0!==t[n]&&((i[n]?e:r||(r={}))[n]=t[n]);return r&&w.extend(!0,e,r),e}function Xt(e,t,n){var r,i,o,a,s=e.contents,u=e.dataTypes;while("*"===u[0])u.shift(),void 0===r&&(r=e.mimeType||t.getResponseHeader("Content-Type"));if(r)for(i in s)if(s[i]&&s[i].test(r)){u.unshift(i);break}if(u[0]in n)o=u[0];else{for(i in n){if(!u[0]||e.converters[i+" "+u[0]]){o=i;break}a||(a=i)}o=o||a}if(o)return o!==u[0]&&u.unshift(o),n[o]}function Ut(e,t,n,r){var i,o,a,s,u,l={},c=e.dataTypes.slice();if(c[1])for(a in e.converters)l[a.toLowerCase()]=e.converters[a];o=c.shift();while(o)if(e.responseFields[o]&&(n[e.responseFields[o]]=t),!u&&r&&e.dataFilter&&(t=e.dataFilter(t,e.dataType)),u=o,o=c.shift())if("*"===o)o=u;else if("*"!==u&&u!==o){if(!(a=l[u+" "+o]||l["* "+o]))for(i in l)if((s=i.split(" "))[1]===o&&(a=l[u+" "+s[0]]||l["* "+s[0]])){!0===a?a=l[i]:!0!==l[i]&&(o=s[0],c.unshift(s[1]));break}if(!0!==a)if(a&&e["throws"])t=a(t);else try{t=a(t)}catch(e){return{state:"parsererror",error:a?e:"No conversion from "+u+" to "+o}}}return{state:"success",data:t}}w.extend({active:0,lastModified:{},etag:{},ajaxSettings:{url:Ct.href,type:"GET",isLocal:Pt.test(Ct.protocol),global:!0,processData:!0,async:!0,contentType:"application/x-www-form-urlencoded; charset=UTF-8",accepts:{"*":$t,text:"text/plain",html:"text/html",xml:"application/xml, text/xml",json:"application/json, text/javascript"},contents:{xml:/\bxml\b/,html:/\bhtml/,json:/\bjson\b/},responseFields:{xml:"responseXML",text:"responseText",json:"responseJSON"},converters:{"* text":String,"text html":!0,"text json":JSON.parse,"text xml":w.parseXML},flatOptions:{url:!0,context:!0}},ajaxSetup:function(e,t){return t?zt(zt(e,w.ajaxSettings),t):zt(w.ajaxSettings,e)},ajaxPrefilter:Ft(It),ajaxTransport:Ft(Wt),ajax:function(t,n){"object"==typeof t&&(n=t,t=void 0),n=n||{};var i,o,a,s,u,l,c,f,p,d,h=w.ajaxSetup({},n),g=h.context||h,y=h.context&&(g.nodeType||g.jquery)?w(g):w.event,v=w.Deferred(),m=w.Callbacks("once memory"),x=h.statusCode||{},b={},T={},C="canceled",E={readyState:0,getResponseHeader:function(e){var t;if(c){if(!s){s={};while(t=Ot.exec(a))s[t[1].toLowerCase()]=t[2]}t=s[e.toLowerCase()]}return null==t?null:t},getAllResponseHeaders:function(){return c?a:null},setRequestHeader:function(e,t){return null==c&&(e=T[e.toLowerCase()]=T[e.toLowerCase()]||e,b[e]=t),this},overrideMimeType:function(e){return null==c&&(h.mimeType=e),this},statusCode:function(e){var t;if(e)if(c)E.always(e[E.status]);else for(t in e)x[t]=[x[t],e[t]];return this},abort:function(e){var t=e||C;return i&&i.abort(t),k(0,t),this}};if(v.promise(E),h.url=((t||h.url||Ct.href)+"").replace(Rt,Ct.protocol+"//"),h.type=n.method||n.type||h.method||h.type,h.dataTypes=(h.dataType||"*").toLowerCase().match(M)||[""],null==h.crossDomain){l=r.createElement("a");try{l.href=h.url,l.href=l.href,h.crossDomain=Bt.protocol+"//"+Bt.host!=l.protocol+"//"+l.host}catch(e){h.crossDomain=!0}}if(h.data&&h.processData&&"string"!=typeof h.data&&(h.data=w.param(h.data,h.traditional)),_t(It,h,n,E),c)return E;(f=w.event&&h.global)&&0==w.active++&&w.event.trigger("ajaxStart"),h.type=h.type.toUpperCase(),h.hasContent=!Mt.test(h.type),o=h.url.replace(Lt,""),h.hasContent?h.data&&h.processData&&0===(h.contentType||"").indexOf("application/x-www-form-urlencoded")&&(h.data=h.data.replace(qt,"+")):(d=h.url.slice(o.length),h.data&&(h.processData||"string"==typeof h.data)&&(o+=(kt.test(o)?"&":"?")+h.data,delete h.data),!1===h.cache&&(o=o.replace(Ht,"$1"),d=(kt.test(o)?"&":"?")+"_="+Et+++d),h.url=o+d),h.ifModified&&(w.lastModified[o]&&E.setRequestHeader("If-Modified-Since",w.lastModified[o]),w.etag[o]&&E.setRequestHeader("If-None-Match",w.etag[o])),(h.data&&h.hasContent&&!1!==h.contentType||n.contentType)&&E.setRequestHeader("Content-Type",h.contentType),E.setRequestHeader("Accept",h.dataTypes[0]&&h.accepts[h.dataTypes[0]]?h.accepts[h.dataTypes[0]]+("*"!==h.dataTypes[0]?", "+$t+"; q=0.01":""):h.accepts["*"]);for(p in h.headers)E.setRequestHeader(p,h.headers[p]);if(h.beforeSend&&(!1===h.beforeSend.call(g,E,h)||c))return E.abort();if(C="abort",m.add(h.complete),E.done(h.success),E.fail(h.error),i=_t(Wt,h,n,E)){if(E.readyState=1,f&&y.trigger("ajaxSend",[E,h]),c)return E;h.async&&h.timeout>0&&(u=e.setTimeout(function(){E.abort("timeout")},h.timeout));try{c=!1,i.send(b,k)}catch(e){if(c)throw e;k(-1,e)}}else k(-1,"No Transport");function k(t,n,r,s){var l,p,d,b,T,C=n;c||(c=!0,u&&e.clearTimeout(u),i=void 0,a=s||"",E.readyState=t>0?4:0,l=t>=200&&t<300||304===t,r&&(b=Xt(h,E,r)),b=Ut(h,b,E,l),l?(h.ifModified&&((T=E.getResponseHeader("Last-Modified"))&&(w.lastModified[o]=T),(T=E.getResponseHeader("etag"))&&(w.etag[o]=T)),204===t||"HEAD"===h.type?C="nocontent":304===t?C="notmodified":(C=b.state,p=b.data,l=!(d=b.error))):(d=C,!t&&C||(C="error",t<0&&(t=0))),E.status=t,E.statusText=(n||C)+"",l?v.resolveWith(g,[p,C,E]):v.rejectWith(g,[E,C,d]),E.statusCode(x),x=void 0,f&&y.trigger(l?"ajaxSuccess":"ajaxError",[E,h,l?p:d]),m.fireWith(g,[E,C]),f&&(y.trigger("ajaxComplete",[E,h]),--w.active||w.event.trigger("ajaxStop")))}return E},getJSON:function(e,t,n){return w.get(e,t,n,"json")},getScript:function(e,t){return w.get(e,void 0,t,"script")}}),w.each(["get","post"],function(e,t){w[t]=function(e,n,r,i){return g(n)&&(i=i||r,r=n,n=void 0),w.ajax(w.extend({url:e,type:t,dataType:i,data:n,success:r},w.isPlainObject(e)&&e))}}),w._evalUrl=function(e){return w.ajax({url:e,type:"GET",dataType:"script",cache:!0,async:!1,global:!1,"throws":!0})},w.fn.extend({wrapAll:function(e){var t;return this[0]&&(g(e)&&(e=e.call(this[0])),t=w(e,this[0].ownerDocument).eq(0).clone(!0),this[0].parentNode&&t.insertBefore(this[0]),t.map(function(){var e=this;while(e.firstElementChild)e=e.firstElementChild;return e}).append(this)),this},wrapInner:function(e){return g(e)?this.each(function(t){w(this).wrapInner(e.call(this,t))}):this.each(function(){var t=w(this),n=t.contents();n.length?n.wrapAll(e):t.append(e)})},wrap:function(e){var t=g(e);return this.each(function(n){w(this).wrapAll(t?e.call(this,n):e)})},unwrap:function(e){return this.parent(e).not("body").each(function(){w(this).replaceWith(this.childNodes)}),this}}),w.expr.pseudos.hidden=function(e){return!w.expr.pseudos.visible(e)},w.expr.pseudos.visible=function(e){return!!(e.offsetWidth||e.offsetHeight||e.getClientRects().length)},w.ajaxSettings.xhr=function(){try{return new e.XMLHttpRequest}catch(e){}};var Vt={0:200,1223:204},Gt=w.ajaxSettings.xhr();h.cors=!!Gt&&"withCredentials"in Gt,h.ajax=Gt=!!Gt,w.ajaxTransport(function(t){var n,r;if(h.cors||Gt&&!t.crossDomain)return{send:function(i,o){var a,s=t.xhr();if(s.open(t.type,t.url,t.async,t.username,t.password),t.xhrFields)for(a in t.xhrFields)s[a]=t.xhrFields[a];t.mimeType&&s.overrideMimeType&&s.overrideMimeType(t.mimeType),t.crossDomain||i["X-Requested-With"]||(i["X-Requested-With"]="XMLHttpRequest");for(a in i)s.setRequestHeader(a,i[a]);n=function(e){return function(){n&&(n=r=s.onload=s.onerror=s.onabort=s.ontimeout=s.onreadystatechange=null,"abort"===e?s.abort():"error"===e?"number"!=typeof s.status?o(0,"error"):o(s.status,s.statusText):o(Vt[s.status]||s.status,s.statusText,"text"!==(s.responseType||"text")||"string"!=typeof s.responseText?{binary:s.response}:{text:s.responseText},s.getAllResponseHeaders()))}},s.onload=n(),r=s.onerror=s.ontimeout=n("error"),void 0!==s.onabort?s.onabort=r:s.onreadystatechange=function(){4===s.readyState&&e.setTimeout(function(){n&&r()})},n=n("abort");try{s.send(t.hasContent&&t.data||null)}catch(e){if(n)throw e}},abort:function(){n&&n()}}}),w.ajaxPrefilter(function(e){e.crossDomain&&(e.contents.script=!1)}),w.ajaxSetup({accepts:{script:"text/javascript, application/javascript, application/ecmascript, application/x-ecmascript"},contents:{script:/\b(?:java|ecma)script\b/},converters:{"text script":function(e){return w.globalEval(e),e}}}),w.ajaxPrefilter("script",function(e){void 0===e.cache&&(e.cache=!1),e.crossDomain&&(e.type="GET")}),w.ajaxTransport("script",function(e){if(e.crossDomain){var t,n;return{send:function(i,o){t=w("<script>").prop({charset:e.scriptCharset,src:e.url}).on("load error",n=function(e){t.remove(),n=null,e&&o("error"===e.type?404:200,e.type)}),r.head.appendChild(t[0])},abort:function(){n&&n()}}}});var Yt=[],Qt=/(=)\?(?=&|$)|\?\?/;w.ajaxSetup({jsonp:"callback",jsonpCallback:function(){var e=Yt.pop()||w.expando+"_"+Et++;return this[e]=!0,e}}),w.ajaxPrefilter("json jsonp",function(t,n,r){var i,o,a,s=!1!==t.jsonp&&(Qt.test(t.url)?"url":"string"==typeof t.data&&0===(t.contentType||"").indexOf("application/x-www-form-urlencoded")&&Qt.test(t.data)&&"data");if(s||"jsonp"===t.dataTypes[0])return i=t.jsonpCallback=g(t.jsonpCallback)?t.jsonpCallback():t.jsonpCallback,s?t[s]=t[s].replace(Qt,"$1"+i):!1!==t.jsonp&&(t.url+=(kt.test(t.url)?"&":"?")+t.jsonp+"="+i),t.converters["script json"]=function(){return a||w.error(i+" was not called"),a[0]},t.dataTypes[0]="json",o=e[i],e[i]=function(){a=arguments},r.always(function(){void 0===o?w(e).removeProp(i):e[i]=o,t[i]&&(t.jsonpCallback=n.jsonpCallback,Yt.push(i)),a&&g(o)&&o(a[0]),a=o=void 0}),"script"}),h.createHTMLDocument=function(){var e=r.implementation.createHTMLDocument("").body;return e.innerHTML="<form></form><form></form>",2===e.childNodes.length}(),w.parseHTML=function(e,t,n){if("string"!=typeof e)return[];"boolean"==typeof t&&(n=t,t=!1);var i,o,a;return t||(h.createHTMLDocument?((i=(t=r.implementation.createHTMLDocument("")).createElement("base")).href=r.location.href,t.head.appendChild(i)):t=r),o=A.exec(e),a=!n&&[],o?[t.createElement(o[1])]:(o=xe([e],t,a),a&&a.length&&w(a).remove(),w.merge([],o.childNodes))},w.fn.load=function(e,t,n){var r,i,o,a=this,s=e.indexOf(" ");return s>-1&&(r=vt(e.slice(s)),e=e.slice(0,s)),g(t)?(n=t,t=void 0):t&&"object"==typeof t&&(i="POST"),a.length>0&&w.ajax({url:e,type:i||"GET",dataType:"html",data:t}).done(function(e){o=arguments,a.html(r?w("<div>").append(w.parseHTML(e)).find(r):e)}).always(n&&function(e,t){a.each(function(){n.apply(this,o||[e.responseText,t,e])})}),this},w.each(["ajaxStart","ajaxStop","ajaxComplete","ajaxError","ajaxSuccess","ajaxSend"],function(e,t){w.fn[t]=function(e){return this.on(t,e)}}),w.expr.pseudos.animated=function(e){return w.grep(w.timers,function(t){return e===t.elem}).length},w.offset={setOffset:function(e,t,n){var r,i,o,a,s,u,l,c=w.css(e,"position"),f=w(e),p={};"static"===c&&(e.style.position="relative"),s=f.offset(),o=w.css(e,"top"),u=w.css(e,"left"),(l=("absolute"===c||"fixed"===c)&&(o+u).indexOf("auto")>-1)?(a=(r=f.position()).top,i=r.left):(a=parseFloat(o)||0,i=parseFloat(u)||0),g(t)&&(t=t.call(e,n,w.extend({},s))),null!=t.top&&(p.top=t.top-s.top+a),null!=t.left&&(p.left=t.left-s.left+i),"using"in t?t.using.call(e,p):f.css(p)}},w.fn.extend({offset:function(e){if(arguments.length)return void 0===e?this:this.each(function(t){w.offset.setOffset(this,e,t)});var t,n,r=this[0];if(r)return r.getClientRects().length?(t=r.getBoundingClientRect(),n=r.ownerDocument.defaultView,{top:t.top+n.pageYOffset,left:t.left+n.pageXOffset}):{top:0,left:0}},position:function(){if(this[0]){var e,t,n,r=this[0],i={top:0,left:0};if("fixed"===w.css(r,"position"))t=r.getBoundingClientRect();else{t=this.offset(),n=r.ownerDocument,e=r.offsetParent||n.documentElement;while(e&&(e===n.body||e===n.documentElement)&&"static"===w.css(e,"position"))e=e.parentNode;e&&e!==r&&1===e.nodeType&&((i=w(e).offset()).top+=w.css(e,"borderTopWidth",!0),i.left+=w.css(e,"borderLeftWidth",!0))}return{top:t.top-i.top-w.css(r,"marginTop",!0),left:t.left-i.left-w.css(r,"marginLeft",!0)}}},offsetParent:function(){return this.map(function(){var e=this.offsetParent;while(e&&"static"===w.css(e,"position"))e=e.offsetParent;return e||be})}}),w.each({scrollLeft:"pageXOffset",scrollTop:"pageYOffset"},function(e,t){var n="pageYOffset"===t;w.fn[e]=function(r){return z(this,function(e,r,i){var o;if(y(e)?o=e:9===e.nodeType&&(o=e.defaultView),void 0===i)return o?o[t]:e[r];o?o.scrollTo(n?o.pageXOffset:i,n?i:o.pageYOffset):e[r]=i},e,r,arguments.length)}}),w.each(["top","left"],function(e,t){w.cssHooks[t]=_e(h.pixelPosition,function(e,n){if(n)return n=Fe(e,t),We.test(n)?w(e).position()[t]+"px":n})}),w.each({Height:"height",Width:"width"},function(e,t){w.each({padding:"inner"+e,content:t,"":"outer"+e},function(n,r){w.fn[r]=function(i,o){var a=arguments.length&&(n||"boolean"!=typeof i),s=n||(!0===i||!0===o?"margin":"border");return z(this,function(t,n,i){var o;return y(t)?0===r.indexOf("outer")?t["inner"+e]:t.document.documentElement["client"+e]:9===t.nodeType?(o=t.documentElement,Math.max(t.body["scroll"+e],o["scroll"+e],t.body["offset"+e],o["offset"+e],o["client"+e])):void 0===i?w.css(t,n,s):w.style(t,n,i,s)},t,a?i:void 0,a)}})}),w.each("blur focus focusin focusout resize scroll click dblclick mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave change select submit keydown keypress keyup contextmenu".split(" "),function(e,t){w.fn[t]=function(e,n){return arguments.length>0?this.on(t,null,e,n):this.trigger(t)}}),w.fn.extend({hover:function(e,t){return this.mouseenter(e).mouseleave(t||e)}}),w.fn.extend({bind:function(e,t,n){return this.on(e,null,t,n)},unbind:function(e,t){return this.off(e,null,t)},delegate:function(e,t,n,r){return this.on(t,e,n,r)},undelegate:function(e,t,n){return 1===arguments.length?this.off(e,"**"):this.off(t,e||"**",n)}}),w.proxy=function(e,t){var n,r,i;if("string"==typeof t&&(n=e[t],t=e,e=n),g(e))return r=o.call(arguments,2),i=function(){return e.apply(t||this,r.concat(o.call(arguments)))},i.guid=e.guid=e.guid||w.guid++,i},w.holdReady=function(e){e?w.readyWait++:w.ready(!0)},w.isArray=Array.isArray,w.parseJSON=JSON.parse,w.nodeName=N,w.isFunction=g,w.isWindow=y,w.camelCase=G,w.type=x,w.now=Date.now,w.isNumeric=function(e){var t=w.type(e);return("number"===t||"string"===t)&&!isNaN(e-parseFloat(e))},"function"==typeof define&&define.amd&&define("jquery",[],function(){return w});var Jt=e.jQuery,Kt=e.$;return w.noConflict=function(t){return e.$===w&&(e.$=Kt),t&&e.jQuery===w&&(e.jQuery=Jt),w},t||(e.jQuery=e.$=w),w});
vendor: 12,498 bytes, line 1
1(function(t){"function"==typeof define&&define.amd?define(["jquery"],t):t(jQuery)})(function(t){function e(t){for(var e=t.css("visibility");"inherit"===e;)t=t.parent(),e=t.css("visibility");return"hidden"!==e}t.ui=t.ui||{},t.ui.version="1.12.1";var i=0,s=Array.prototype.slice;t.cleanData=function(e){return function(i){var s,n,o;for(o=0;null!=(n=i[o]);o++)try{s=t._data(n,"events"),s&&s.remove&&t(n).triggerHandler("remove")}catch(a){}e(i)}}(t.cleanData),t.widget=function(e,i,s){var n,o,a,r={},h=e.split(".")[0];e=e.split(".")[1];var l=h+"-"+e;return s||(s=i,i=t.Widget),t.isArray(s)&&(s=t.extend.apply(null,[{}].concat(s))),t.expr[":"][l.toLowerCase()]=function(e){return!!t.data(e,l)},t[h]=t[h]||{},n=t[h][e],o=t[h][e]=function(t,e){return this._createWidget?(arguments.length&&this._createWidget(t,e),void 0):new o(t,e)},t.extend(o,n,{version:s.version,_proto:t.extend({},s),_childConstructors:[]}),a=new i,a.options=t.widget.extend({},a.options),t.each(s,function(e,s){return t.isFunction(s)?(r[e]=function(){function t(){return i.prototype[e].apply(this,arguments)}function n(t){return i.prototype[e].apply(this,t)}return function(){var e,i=this._super,o=this._superApply;return this._super=t,this._superApply=n,e=s.apply(this,arguments),this._super=i,this._superApply=o,e}}(),void 0):(r[e]=s,void 0)}),o.prototype=t.widget.extend(a,{widgetEventPrefix:n?a.widgetEventPrefix||e:e},r,{constructor:o,namespace:h,widgetName:e,widgetFullName:l}),n?(t.each(n._childConstructors,function(e,i){var s=i.prototype;t.widget(s.namespace+"."+s.widgetName,o,i._proto)}),delete n._childConstructors):i._childConstructors.push(o),t.widget.bridge(e,o),o},t.widget.extend=function(e){for(var i,n,o=s.call(arguments,1),a=0,r=o.length;r>a;a++)for(i in o[a])n=o[a][i],o[a].hasOwnProperty(i)&&void 0!==n&&(e[i]=t.isPlainObject(n)?t.isPlainObject(e[i])?t.widget.extend({},e[i],n):t.widget.extend({},n):n);return e},t.widget.bridge=function(e,i){var n=i.prototype.widgetFullName||e;t.fn[e]=function(o){var a="string"==typeof o,r=s.call(arguments,1),h=this;return a?this.length||"instance"!==o?this.each(function(){var i,s=t.data(this,n);return"instance"===o?(h=s,!1):s?t.isFunction(s[o])&&"_"!==o.charAt(0)?(i=s[o].apply(s,r),i!==s&&void 0!==i?(h=i&&i.jquery?h.pushStack(i.get()):i,!1):void 0):t.error("no such method '"+o+"' for "+e+" widget instance"):t.error("cannot call methods on "+e+" prior to initialization; "+"attempted to call method '"+o+"'")}):h=void 0:(r.length&&(o=t.widget.extend.apply(null,[o].concat(r))),this.each(function(){var e=t.data(this,n);e?(e.option(o||{}),e._init&&e._init()):t.data(this,n,new i(o,this))})),h}},t.Widget=function(){},t.Widget._childConstructors=[],t.Widget.prototype={widgetName:"widget",widgetEventPrefix:"",defaultElement:"<div>",options:{classes:{},disabled:!1,create:null},_createWidget:function(e,s){s=t(s||this.defaultElement||this)[0],this.element=t(s),this.uuid=i++,this.eventNamespace="."+this.widgetName+this.uuid,this.bindings=t(),this.hoverable=t(),this.focusable=t(),this.classesElementLookup={},s!==this&&(t.data(s,this.widgetFullName,this),this._on(!0,this.element,{remove:function(t){t.target===s&&this.destroy()}}),this.document=t(s.style?s.ownerDocument:s.document||s),this.window=t(this.document[0].defaultView||this.document[0].parentWindow)),this.options=t.widget.extend({},this.options,this._getCreateOptions(),e),this._create(),this.options.disabled&&this._setOptionDisabled(this.options.disabled),this._trigger("create",null,this._getCreateEventData()),this._init()},_getCreateOptions:function(){return{}},_getCreateEventData:t.noop,_create:t.noop,_init:t.noop,destroy:function(){var e=this;this._destroy(),t.each(this.classesElementLookup,function(t,i){e._removeClass(i,t)}),this.element.off(this.eventNamespace).removeData(this.widgetFullName),this.widget().off(this.eventNamespace).removeAttr("aria-disabled"),this.bindings.off(this.eventNamespace)},_destroy:t.noop,widget:function(){return this.element},option:function(e,i){var s,n,o,a=e;if(0===arguments.length)return t.widget.extend({},this.options);if("string"==typeof e)if(a={},s=e.split("."),e=s.shift(),s.length){for(n=a[e]=t.widget.extend({},this.options[e]),o=0;s.length-1>o;o++)n[s[o]]=n[s[o]]||{},n=n[s[o]];if(e=s.pop(),1===arguments.length)return void 0===n[e]?null:n[e];n[e]=i}else{if(1===arguments.length)return void 0===this.options[e]?null:this.options[e];a[e]=i}return this._setOptions(a),this},_setOptions:function(t){var e;for(e in t)this._setOption(e,t[e]);return this},_setOption:function(t,e){return"classes"===t&&this._setOptionClasses(e),this.options[t]=e,"disabled"===t&&this._setOptionDisabled(e),this},_setOptionClasses:function(e){var i,s,n;for(i in e)n=this.classesElementLookup[i],e[i]!==this.options.classes[i]&&n&&n.length&&(s=t(n.get()),this._removeClass(n,i),s.addClass(this._classes({element:s,keys:i,classes:e,add:!0})))},_setOptionDisabled:function(t){this._toggleClass(this.widget(),this.widgetFullName+"-disabled",null,!!t),t&&(this._removeClass(this.hoverable,null,"ui-state-hover"),this._removeClass(this.focusable,null,"ui-state-focus"))},enable:function(){return this._setOptions({disabled:!1})},disable:function(){return this._setOptions({disabled:!0})},_classes:function(e){function i(i,o){var a,r;for(r=0;i.length>r;r++)a=n.classesElementLookup[i[r]]||t(),a=e.add?t(t.unique(a.get().concat(e.element.get()))):t(a.not(e.element).get()),n.classesElementLookup[i[r]]=a,s.push(i[r]),o&&e.classes[i[r]]&&s.push(e.classes[i[r]])}var s=[],n=this;return e=t.extend({element:this.element,classes:this.options.classes||{}},e),this._on(e.element,{remove:"_untrackClassesElement"}),e.keys&&i(e.keys.match(/\S+/g)||[],!0),e.extra&&i(e.extra.match(/\S+/g)||[]),s.join(" ")},_untrackClassesElement:function(e){var i=this;t.each(i.classesElementLookup,function(s,n){-1!==t.inArray(e.target,n)&&(i.classesElementLookup[s]=t(n.not(e.target).get()))})},_removeClass:function(t,e,i){return this._toggleClass(t,e,i,!1)},_addClass:function(t,e,i){return this._toggleClass(t,e,i,!0)},_toggleClass:function(t,e,i,s){s="boolean"==typeof s?s:i;var n="string"==typeof t||null===t,o={extra:n?e:i,keys:n?t:e,element:n?this.element:t,add:s};return o.element.toggleClass(this._classes(o),s),this},_on:function(e,i,s){var n,o=this;"boolean"!=typeof e&&(s=i,i=e,e=!1),s?(i=n=t(i),this.bindings=this.bindings.add(i)):(s=i,i=this.element,n=this.widget()),t.each(s,function(s,a){function r(){return e||o.options.disabled!==!0&&!t(this).hasClass("ui-state-disabled")?("string"==typeof a?o[a]:a).apply(o,arguments):void 0}"string"!=typeof a&&(r.guid=a.guid=a.guid||r.guid||t.guid++);var h=s.match(/^([\w:-]*)\s*(.*)$/),l=h[1]+o.eventNamespace,c=h[2];c?n.on(l,c,r):i.on(l,r)})},_off:function(e,i){i=(i||"").split(" ").join(this.eventNamespace+" ")+this.eventNamespace,e.off(i).off(i),this.bindings=t(this.bindings.not(e).get()),this.focusable=t(this.focusable.not(e).get()),this.hoverable=t(this.hoverable.not(e).get())},_delay:function(t,e){function i(){return("string"==typeof t?s[t]:t).apply(s,arguments)}var s=this;return setTimeout(i,e||0)},_hoverable:function(e){this.hoverable=this.hoverable.add(e),this._on(e,{mouseenter:function(e){this._addClass(t(e.currentTarget),null,"ui-state-hover")},mouseleave:function(e){this._removeClass(t(e.currentTarget),null,"ui-state-hover")}})},_focusable:function(e){this.focusable=this.focusable.add(e),this._on(e,{focusin:function(e){this._addClass(t(e.currentTarget),null,"ui-state-focus")},focusout:function(e){this._removeClass(t(e.currentTarget),null,"ui-state-focus")}})},_trigger:function(e,i,s){var n,o,a=this.options[e];if(s=s||{},i=t.Event(i),i.type=(e===this.widgetEventPrefix?e:this.widgetEventPrefix+e).toLowerCase(),i.target=this.element[0],o=i.originalEvent)for(n in o)n in i||(i[n]=o[n]);return this.element.trigger(i,s),!(t.isFunction(a)&&a.apply(this.element[0],[i].concat(s))===!1||i.isDefaultPrevented())}},t.each({show:"fadeIn",hide:"fadeOut"},function(e,i){t.Widget.prototype["_"+e]=function(s,n,o){"string"==typeof n&&(n={effect:n});var a,r=n?n===!0||"number"==typeof n?i:n.effect||i:e;n=n||{},"number"==typeof n&&(n={duration:n}),a=!t.isEmptyObject(n),n.complete=o,n.delay&&s.delay(n.delay),a&&t.effects&&t.effects.effect[r]?s[e](n):r!==e&&s[r]?s[r](n.duration,n.easing,o):s.queue(function(i){t(this)[e](),o&&o.call(s[0]),i()})}}),t.widget,function(){function e(t,e,i){return[parseFloat(t[0])*(u.test(t[0])?e/100:1),parseFloat(t[1])*(u.test(t[1])?i/100:1)]}function i(e,i){return parseInt(t.css(e,i),10)||0}function s(e){var i=e[0];return 9===i.nodeType?{width:e.width(),height:e.height(),offset:{top:0,left:0}}:t.isWindow(i)?{width:e.width(),height:e.height(),offset:{top:e.scrollTop(),left:e.scrollLeft()}}:i.preventDefault?{width:0,height:0,offset:{top:i.pageY,left:i.pageX}}:{width:e.outerWidth(),height:e.outerHeight(),offset:e.offset()}}var n,o=Math.max,a=Math.abs,r=/left|center|right/,h=/top|center|bottom/,l=/[\+\-]\d+(\.[\d]+)?%?/,c=/^\w+/,u=/%$/,d=t.fn.position;t.position={scrollbarWidth:function(){if(void 0!==n)return n;var e,i,s=t("<div style='display:block;position:absolute;width:50px;height:50px;overflow:hidden;'><div style='height:100px;width:auto;'></div></div>"),o=s.children()[0];return t("body").append(s),e=o.offsetWidth,s.css("overflow","scroll"),i=o.offsetWidth,e===i&&(i=s[0].clientWidth),s.remove(),n=e-i},getScrollInfo:function(e){var i=e.isWindow||e.isDocument?"":e.element.css("overflow-x"),s=e.isWindow||e.isDocument?"":e.element.css("overflow-y"),n="scroll"===i||"auto"===i&&e.width<e.element[0].scrollWidth,o="scroll"===s||"auto"===s&&e.height<e.element[0].scrollHeight;return{width:o?t.position.scrollbarWidth():0,height:n?t.position.scrollbarWidth():0}},getWithinInfo:function(e){var i=t(e||window),s=t.isWindow(i[0]),n=!!i[0]&&9===i[0].nodeType,o=!s&&!n;return{element:i,isWindow:s,isDocument:n,offset:o?t(e).offset():{left:0,top:0},scrollLeft:i.scrollLeft(),scrollTop:i.scrollTop(),width:i.outerWidth(),height:i.outerHeight()}}},t.fn.position=function(n){if(!n||!n.of)return d.apply(this,arguments);n=t.extend({},n);var u,p,f,m,g,v,_=t(n.of),b=t.position.getWithinInfo(n.within),y=t.position.getScrollInfo(b),w=(n.collision||"flip").split(" "),x={};return v=s(_),_[0].preventDefault&&(n.at="left top"),p=v.width,f=v.height,m=v.offset,g=t.extend({},m),t.each(["my","at"],function(){var t,e,i=(n[this]||"").split(" ");1===i.length&&(i=r.test(i[0])?i.concat(["center"]):h.test(i[0])?["center"].concat(i):["center","center"]),i[0]=r.test(i[0])?i[0]:"center",i[1]=h.test(i[1])?i[1]:"center",t=l.exec(i[0]),e=l.exec(i[1]),x[this]=[t?t[0]:0,e?e[0]:0],n[this]=[c.exec(i[0])[0],c.exec(i[1])[0]]}),1===w.length&&(w[1]=w[0]),"right"===n.at[0]?g.left+=p:"center"===n.at[0]&&(g.left+=p/2),"bottom"===n.at[1]?g.top+=f:"center"===n.at[1]&&(g.top+=f/2),u=e(x.at,p,f),g.left+=u[0],g.top+=u[1],this.each(function(){var s,r,h=t(this),l=h.outerWidth(),c=h.outerHeight(),d=i(this,"marginLeft"),v=i(this,"marginTop"),k=l+d+i(this,"marginRight")+y.width,D=c+v+i(this,"marginBottom")+y.height,C=t.extend({},g),T=e(x.my,h.outerWidth(),h.outerHeight());"right"===n.my[0]?C.left-=l:"center"===n.my[0]&&(C.left-=l/2),"bottom"===n.my[1]?C.top-=c:"center"===n.my[1]&&(C.top-=c/2),C.left+=T[0],C.top+=T[1],s={marginLeft:d,marginTop:v},t.each(["left","top"],function(e,i){t.ui.position[w[e]]&&t.ui.position[w[e]][i](C,{targetWidth:p,targetHeight:f,elemWidth:l,elemHeight:c,collisionPosition:s,collisionWidth:k,collisionHeight:D,offset:[u[0]+T[0],u[1]+T[1]],my:n.my,at:n.at,within:b,elem:h})}),n.using&&(r=function(t){var e=m.left-C.left,i=e+p-l,s=m.top-C.top,r=s+f-c,u={target:{element:_,left:m.left,top:m.top,width:p,height:f},element:{element:h,left:C.left,top:C.top,width:l,height:c},horizontal:0>i?"left":e>0?"right":"center",vertical:0>r?"top":s>0?"bottom":"middle"};l>p&&p>a(e+i)&&(u.horizontal="center"),c>f&&f>a(s+r)&&(u.vertical="middle"),u.important=o(a(e),a(i))>o(a(s),a(r))?"horizontal":"vertical",n.using.call(this,t,u)}),h.offset(t.extend(C,{using:r}))})},t.ui.position={fit:{left:function(t,e){var i,s=e.within,n=s.isWindow?s.scrollLeft:s.offset.left,a=s.width,r=t.left-e.collisionPosition.marginLeft,h=n-r,l=r+e.collisionWidth-a-n;e.collisionWidth>a?h>0&&0>=l?(i=t.left+h+e.collisionWidth-a-n,t.left+=h-i):t.left=l>0&&0>=h?n:h>l?n+a-e.collisionWidth:n:h>0?t.left+=h:l>0?t.left-=l:t.left=o(t.left-r,t.left)},top:function(t,e){var i,s=e.within,n=s.isWindow?s.scrollTop:s.offset.top,a=e.within.height,r=t.top-e.collisionPosition.marginTop,h=n-r,l=r+e.collisionHeight-a-n;e.collisionHeight>a?h>0&&0>
vendor: 5,980 bytes, line 1
1=l?(i=t.top+h+e.collisionHeight-a-n,t.top+=h-i):t.top=l>0&&0>=h?n:h>l?n+a-e.collisionHeight:n:h>0?t.top+=h:l>0?t.top-=l:t.top=o(t.top-r,t.top)}},flip:{left:function(t,e){var i,s,n=e.within,o=n.offset.left+n.scrollLeft,r=n.width,h=n.isWindow?n.scrollLeft:n.offset.left,l=t.left-e.collisionPosition.marginLeft,c=l-h,u=l+e.collisionWidth-r-h,d="left"===e.my[0]?-e.elemWidth:"right"===e.my[0]?e.elemWidth:0,p="left"===e.at[0]?e.targetWidth:"right"===e.at[0]?-e.targetWidth:0,f=-2*e.offset[0];0>c?(i=t.left+d+p+f+e.collisionWidth-r-o,(0>i||a(c)>i)&&(t.left+=d+p+f)):u>0&&(s=t.left-e.collisionPosition.marginLeft+d+p+f-h,(s>0||u>a(s))&&(t.left+=d+p+f))},top:function(t,e){var i,s,n=e.within,o=n.offset.top+n.scrollTop,r=n.height,h=n.isWindow?n.scrollTop:n.offset.top,l=t.top-e.collisionPosition.marginTop,c=l-h,u=l+e.collisionHeight-r-h,d="top"===e.my[1],p=d?-e.elemHeight:"bottom"===e.my[1]?e.elemHeight:0,f="top"===e.at[1]?e.targetHeight:"bottom"===e.at[1]?-e.targetHeight:0,m=-2*e.offset[1];0>c?(s=t.top+p+f+m+e.collisionHeight-r-o,(0>s||a(c)>s)&&(t.top+=p+f+m)):u>0&&(i=t.top-e.collisionPosition.marginTop+p+f+m-h,(i>0||u>a(i))&&(t.top+=p+f+m))}},flipfit:{left:function(){t.ui.position.flip.left.apply(this,arguments),t.ui.position.fit.left.apply(this,arguments)},top:function(){t.ui.position.flip.top.apply(this,arguments),t.ui.position.fit.top.apply(this,arguments)}}}}(),t.ui.position,t.extend(t.expr[":"],{data:t.expr.createPseudo?t.expr.createPseudo(function(e){return function(i){return!!t.data(i,e)}}):function(e,i,s){return!!t.data(e,s[3])}}),t.fn.extend({disableSelection:function(){var t="onselectstart"in document.createElement("div")?"selectstart":"mousedown";return function(){return this.on(t+".ui-disableSelection",function(t){t.preventDefault()})}}(),enableSelection:function(){return this.off(".ui-disableSelection")}}),t.ui.focusable=function(i,s){var n,o,a,r,h,l=i.nodeName.toLowerCase();return"area"===l?(n=i.parentNode,o=n.name,i.href&&o&&"map"===n.nodeName.toLowerCase()?(a=t("img[usemap='#"+o+"']"),a.length>0&&a.is(":visible")):!1):(/^(input|select|textarea|button|object)$/.test(l)?(r=!i.disabled,r&&(h=t(i).closest("fieldset")[0],h&&(r=!h.disabled))):r="a"===l?i.href||s:s,r&&t(i).is(":visible")&&e(t(i)))},t.extend(t.expr[":"],{focusable:function(e){return t.ui.focusable(e,null!=t.attr(e,"tabindex"))}}),t.ui.focusable,t.fn.scrollParent=function(e){var i=this.css("position"),s="absolute"===i,n=e?/(auto|scroll|hidden)/:/(auto|scroll)/,o=this.parents().filter(function(){var e=t(this);return s&&"static"===e.css("position")?!1:n.test(e.css("overflow")+e.css("overflow-y")+e.css("overflow-x"))}).eq(0);return"fixed"!==i&&o.length?o:t(this[0].ownerDocument||document)},t.ui.ie=!!/msie [\w.]+/.exec(navigator.userAgent.toLowerCase());var n=!1;t(document).on("mouseup",function(){n=!1}),t.widget("ui.mouse",{version:"1.12.1",options:{cancel:"input, textarea, button, select, option",distance:1,delay:0},_mouseInit:function(){var e=this;this.element.on("mousedown."+this.widgetName,function(t){return e._mouseDown(t)}).on("click."+this.widgetName,function(i){return!0===t.data(i.target,e.widgetName+".preventClickEvent")?(t.removeData(i.target,e.widgetName+".preventClickEvent"),i.stopImmediatePropagation(),!1):void 0}),this.started=!1},_mouseDestroy:function(){this.element.off("."+this.widgetName),this._mouseMoveDelegate&&this.document.off("mousemove."+this.widgetName,this._mouseMoveDelegate).off("mouseup."+this.widgetName,this._mouseUpDelegate)},_mouseDown:function(e){if(!n){this._mouseMoved=!1,this._mouseStarted&&this._mouseUp(e),this._mouseDownEvent=e;var i=this,s=1===e.which,o="string"==typeof this.options.cancel&&e.target.nodeName?t(e.target).closest(this.options.cancel).length:!1;return s&&!o&&this._mouseCapture(e)?(this.mouseDelayMet=!this.options.delay,this.mouseDelayMet||(this._mouseDelayTimer=setTimeout(function(){i.mouseDelayMet=!0},this.options.delay)),this._mouseDistanceMet(e)&&this._mouseDelayMet(e)&&(this._mouseStarted=this._mouseStart(e)!==!1,!this._mouseStarted)?(e.preventDefault(),!0):(!0===t.data(e.target,this.widgetName+".preventClickEvent")&&t.removeData(e.target,this.widgetName+".preventClickEvent"),this._mouseMoveDelegate=function(t){return i._mouseMove(t)},this._mouseUpDelegate=function(t){return i._mouseUp(t)},this.document.on("mousemove."+this.widgetName,this._mouseMoveDelegate).on("mouseup."+this.widgetName,this._mouseUpDelegate),e.preventDefault(),n=!0,!0)):!0}},_mouseMove:function(e){if(this._mouseMoved){if(t.ui.ie&&(!document.documentMode||9>document.documentMode)&&!e.button)return this._mouseUp(e);if(!e.which)if(e.originalEvent.altKey||e.originalEvent.ctrlKey||e.originalEvent.metaKey||e.originalEvent.shiftKey)this.ignoreMissingWhich=!0;else if(!this.ignoreMissingWhich)return this._mouseUp(e)}return(e.which||e.button)&&(this._mouseMoved=!0),this._mouseStarted?(this._mouseDrag(e),e.preventDefault()):(this._mouseDistanceMet(e)&&this._mouseDelayMet(e)&&(this._mouseStarted=this._mouseStart(this._mouseDownEvent,e)!==!1,this._mouseStarted?this._mouseDrag(e):this._mouseUp(e)),!this._mouseStarted)},_mouseUp:function(e){this.document.off("mousemove."+this.widgetName,this._mouseMoveDelegate).off("mouseup."+this.widgetName,this._mouseUpDelegate),this._mouseStarted&&(this._mouseStarted=!1,e.target===this._mouseDownEvent.target&&t.data(e.target,this.widgetName+".preventClickEvent",!0),this._mouseStop(e)),this._mouseDelayTimer&&(clearTimeout(this._mouseDelayTimer),delete this._mouseDelayTimer),this.ignoreMissingWhich=!1,n=!1,e.preventDefault()},_mouseDistanceMet:function(t){return Math.max(Math.abs(this._mouseDownEvent.pageX-t.pageX),Math.abs(this._mouseDownEvent.pageY-t.pageY))>=this.options.distance},_mouseDelayMet:function(){return this.mouseDelayMet},_mouseStart:function(){},_mouseDrag:function(){},_mouseStop:function(){},_mouseCapture:function(){return!0}}),t.ui.plugin={add:function(e,i,s){var n,o=t.ui[e].prototype;for(n in s)o.plugins[n]=o.plugins[n]||[],o.plugins[n].push([i,s[n]])}
vendor: 5,773 bytes, line 1
1,call:function(t,e,i,s){var n,o=t.plugins[e];if(o&&(s||t.element[0].parentNode&&11!==t.element[0].parentNode.nodeType))for(n=0;o.length>n;n++)t.options[o[n][0]]&&o[n][1].apply(t.element,i)}},t.ui.safeActiveElement=function(t){var e;try{e=t.activeElement}catch(i){e=t.body}return e||(e=t.body),e.nodeName||(e=t.body),e},t.ui.safeBlur=function(e){e&&"body"!==e.nodeName.toLowerCase()&&t(e).trigger("blur")},t.widget("ui.draggable",t.ui.mouse,{version:"1.12.1",widgetEventPrefix:"drag",options:{addClasses:!0,appendTo:"parent",axis:!1,connectToSortable:!1,containment:!1,cursor:"auto",cursorAt:!1,grid:!1,handle:!1,helper:"original",iframeFix:!1,opacity:!1,refreshPositions:!1,revert:!1,revertDuration:500,scope:"default",scroll:!0,scrollSensitivity:20,scrollSpeed:20,snap:!1,snapMode:"both",snapTolerance:20,stack:!1,zIndex:!1,drag:null,start:null,stop:null},_create:function(){"original"===this.options.helper&&this._setPositionRelative(),this.options.addClasses&&this._addClass("ui-draggable"),this._setHandleClassName(),this._mouseInit()},_setOption:function(t,e){this._super(t,e),"handle"===t&&(this._removeHandleClassName(),this._setHandleClassName())},_destroy:function(){return(this.helper||this.element).is(".ui-draggable-dragging")?(this.destroyOnClear=!0,void 0):(this._removeHandleClassName(),this._mouseDestroy(),void 0)},_mouseCapture:function(e){var i=this.options;return this.helper||i.disabled||t(e.target).closest(".ui-resizable-handle").length>0?!1:(this.handle=this._getHandle(e),this.handle?(this._blurActiveElement(e),this._blockFrames(i.iframeFix===!0?"iframe":i.iframeFix),!0):!1)},_blockFrames:function(e){this.iframeBlocks=this.document.find(e).map(function(){var e=t(this);return t("<div>").css("position","absolute").appendTo(e.parent()).outerWidth(e.outerWidth()).outerHeight(e.outerHeight()).offset(e.offset())[0]})},_unblockFrames:function(){this.iframeBlocks&&(this.iframeBlocks.remove(),delete this.iframeBlocks)},_blurActiveElement:function(e){var i=t.ui.safeActiveElement(this.document[0]),s=t(e.target);s.closest(i).length||t.ui.safeBlur(i)},_mouseStart:function(e){var i=this.options;return this.helper=this._createHelper(e),this._addClass(this.helper,"ui-draggable-dragging"),this._cacheHelperProportions(),t.ui.ddmanager&&(t.ui.ddmanager.current=this),this._cacheMargins(),this.cssPosition=this.helper.css("position"),this.scrollParent=this.helper.scrollParent(!0),this.offsetParent=this.helper.offsetParent(),this.hasFixedAncestor=this.helper.parents().filter(function(){return"fixed"===t(this).css("position")}).length>0,this.positionAbs=this.element.offset(),this._refreshOffsets(e),this.originalPosition=this.position=this._generatePosition(e,!1),this.originalPageX=e.pageX,this.originalPageY=e.pageY,i.cursorAt&&this._adjustOffsetFromHelper(i.cursorAt),this._setContainment(),this._trigger("start",e)===!1?(this._clear(),!1):(this._cacheHelperProportions(),t.ui.ddmanager&&!i.dropBehaviour&&t.ui.ddmanager.prepareOffsets(this,e),this._mouseDrag(e,!0),t.ui.ddmanager&&t.ui.ddmanager.dragStart(this,e),!0)},_refreshOffsets:function(t){this.offset={top:this.positionAbs.top-this.margins.top,left:this.positionAbs.left-this.margins.left,scroll:!1,parent:this._getParentOffset(),relative:this._getRelativeOffset()},this.offset.click={left:t.pageX-this.offset.left,top:t.pageY-this.offset.top}},_mouseDrag:function(e,i){if(this.hasFixedAncestor&&(this.offset.parent=this._getParentOffset()),this.position=this._generatePosition(e,!0),this.positionAbs=this._convertPositionTo("absolute"),!i){var s=this._uiHash();if(this._trigger("drag",e,s)===!1)return this._mouseUp(new t.Event("mouseup",e)),!1;this.position=s.position}return this.helper[0].style.left=this.position.left+"px",this.helper[0].style.top=this.position.top+"px",t.ui.ddmanager&&t.ui.ddmanager.drag(this,e),!1},_mouseStop:function(e){var i=this,s=!1;return t.ui.ddmanager&&!this.options.dropBehaviour&&(s=t.ui.ddmanager.drop(this,e)),this.dropped&&(s=this.dropped,this.dropped=!1),"invalid"===this.options.revert&&!s||"valid"===this.options.revert&&s||this.options.revert===!0||t.isFunction(this.options.revert)&&this.options.revert.call(this.element,s)?t(this.helper).animate(this.originalPosition,parseInt(this.options.revertDuration,10),function(){i._trigger("stop",e)!==!1&&i._clear()}):this._trigger("stop",e)!==!1&&this._clear(),!1},_mouseUp:function(e){return this._unblockFrames(),t.ui.ddmanager&&t.ui.ddmanager.dragStop(this,e),this.handleElement.is(e.target)&&this.element.trigger("focus"),t.ui.mouse.prototype._mouseUp.call(this,e)},cancel:function(){return this.helper.is(".ui-draggable-dragging")?this._mouseUp(new t.Event("mouseup",{target:this.element[0]})):this._clear(),this},_getHandle:function(e){return this.options.handle?!!t(e.target).closest(this.element.find(this.options.handle)).length:!0},_setHandleClassName:function(){this.handleElement=this.options.handle?this.element.find(this.options.handle):this.element,this._addClass(this.handleElement,"ui-draggable-handle")},_removeHandleClassName:function(){this._removeClass(this.handleElement,"ui-draggable-handle")},_createHelper:function(e){var i=this.options,s=t.isFunction(i.helper),n=s?t(i.helper.apply(this.element[0],[e])):"clone"===i.helper?this.element.clone().removeAttr("id"):this.element;return n.parents("body").length||n.appendTo("parent"===i.appendTo?this.element[0].parentNode:i.appendTo),s&&n[0]===this.element[0]&&this._setPositionRelative(),n[0]===this.element[0]||/(fixed|absolute)/.test(n.css("position"))||n.css("position","absolute"),n},_setPositionRelative:function(){/^(?:r|a|f)/.test(this.element.css("position"))||(this.element[0].style.position="relative")},_adjustOffsetFromHelper:function(e){"string"==typeof e&&(e=e.split(" ")),t.isArray(e)&&(e={left:+e[0],top:+e[1]||0}
vendor: 1,211 bytes, line 1
1),"left"in e&&(this.offset.click.left=e.left+this.margins.left),"right"in e&&(this.offset.click.left=this.helperProportions.width-e.right+this.margins.left),"top"in e&&(this.offset.click.top=e.top+this.margins.top),"bottom"in e&&(this.offset.click.top=this.helperProportions.height-e.bottom+this.margins.top)},_isRootNode:function(t){return/(html|body)/i.test(t.tagName)||t===this.document[0]},_getParentOffset:function(){var e=this.offsetParent.offset(),i=this.document[0];return"absolute"===this.cssPosition&&this.scrollParent[0]!==i&&t.contains(this.scrollParent[0],this.offsetParent[0])&&(e.left+=this.scrollParent.scrollLeft(),e.top+=this.scrollParent.scrollTop()),this._isRootNode(this.offsetParent[0])&&(e={top:0,left:0}),{top:e.top+(parseInt(this.offsetParent.css("borderTopWidth"),10)||0),left:e.left+(parseInt(this.offsetParent.css("borderLeftWidth"),10)||0)}},_getRelativeOffset:function(){if("relative"!==this.cssPosition)return{top:0,left:0};var t=this.element.position(),e=this._isRootNode(this.scrollParent[0]);return{top:t.top-(parseInt(this.helper.css("top"),10)||0)+(e?0:this.scrollParent.scrollTop()),left:t.left-(parseInt(this.helper.css("left"),10)||0)+(e?0:this.scrollParent.scrollLeft())}
vendor: 9,249 bytes, line 1
1},_cacheMargins:function(){this.margins={left:parseInt(this.element.css("marginLeft"),10)||0,top:parseInt(this.element.css("marginTop"),10)||0,right:parseInt(this.element.css("marginRight"),10)||0,bottom:parseInt(this.element.css("marginBottom"),10)||0}},_cacheHelperProportions:function(){this.helperProportions={width:this.helper.outerWidth(),height:this.helper.outerHeight()}},_setContainment:function(){var e,i,s,n=this.options,o=this.document[0];return this.relativeContainer=null,n.containment?"window"===n.containment?(this.containment=[t(window).scrollLeft()-this.offset.relative.left-this.offset.parent.left,t(window).scrollTop()-this.offset.relative.top-this.offset.parent.top,t(window).scrollLeft()+t(window).width()-this.helperProportions.width-this.margins.left,t(window).scrollTop()+(t(window).height()||o.body.parentNode.scrollHeight)-this.helperProportions.height-this.margins.top],void 0):"document"===n.containment?(this.containment=[0,0,t(o).width()-this.helperProportions.width-this.margins.left,(t(o).height()||o.body.parentNode.scrollHeight)-this.helperProportions.height-this.margins.top],void 0):n.containment.constructor===Array?(this.containment=n.containment,void 0):("parent"===n.containment&&(n.containment=this.helper[0].parentNode),i=t(n.containment),s=i[0],s&&(e=/(scroll|auto)/.test(i.css("overflow")),this.containment=[(parseInt(i.css("borderLeftWidth"),10)||0)+(parseInt(i.css("paddingLeft"),10)||0),(parseInt(i.css("borderTopWidth"),10)||0)+(parseInt(i.css("paddingTop"),10)||0),(e?Math.max(s.scrollWidth,s.offsetWidth):s.offsetWidth)-(parseInt(i.css("borderRightWidth"),10)||0)-(parseInt(i.css("paddingRight"),10)||0)-this.helperProportions.width-this.margins.left-this.margins.right,(e?Math.max(s.scrollHeight,s.offsetHeight):s.offsetHeight)-(parseInt(i.css("borderBottomWidth"),10)||0)-(parseInt(i.css("paddingBottom"),10)||0)-this.helperProportions.height-this.margins.top-this.margins.bottom],this.relativeContainer=i),void 0):(this.containment=null,void 0)},_convertPositionTo:function(t,e){e||(e=this.position);var i="absolute"===t?1:-1,s=this._isRootNode(this.scrollParent[0]);return{top:e.top+this.offset.relative.top*i+this.offset.parent.top*i-("fixed"===this.cssPosition?-this.offset.scroll.top:s?0:this.offset.scroll.top)*i,left:e.left+this.offset.relative.left*i+this.offset.parent.left*i-("fixed"===this.cssPosition?-this.offset.scroll.left:s?0:this.offset.scroll.left)*i}},_generatePosition:function(t,e){var i,s,n,o,a=this.options,r=this._isRootNode(this.scrollParent[0]),h=t.pageX,l=t.pageY;return r&&this.offset.scroll||(this.offset.scroll={top:this.scrollParent.scrollTop(),left:this.scrollParent.scrollLeft()}),e&&(this.containment&&(this.relativeContainer?(s=this.relativeContainer.offset(),i=[this.containment[0]+s.left,this.containment[1]+s.top,this.containment[2]+s.left,this.containment[3]+s.top]):i=this.containment,t.pageX-this.offset.click.left<i[0]&&(h=i[0]+this.offset.click.left),t.pageY-this.offset.click.top<i[1]&&(l=i[1]+this.offset.click.top),t.pageX-this.offset.click.left>i[2]&&(h=i[2]+this.offset.click.left),t.pageY-this.offset.click.top>i[3]&&(l=i[3]+this.offset.click.top)),a.grid&&(n=a.grid[1]?this.originalPageY+Math.round((l-this.originalPageY)/a.grid[1])*a.grid[1]:this.originalPageY,l=i?n-this.offset.click.top>=i[1]||n-this.offset.click.top>i[3]?n:n-this.offset.click.top>=i[1]?n-a.grid[1]:n+a.grid[1]:n,o=a.grid[0]?this.originalPageX+Math.round((h-this.originalPageX)/a.grid[0])*a.grid[0]:this.originalPageX,h=i?o-this.offset.click.left>=i[0]||o-this.offset.click.left>i[2]?o:o-this.offset.click.left>=i[0]?o-a.grid[0]:o+a.grid[0]:o),"y"===a.axis&&(h=this.originalPageX),"x"===a.axis&&(l=this.originalPageY)),{top:l-this.offset.click.top-this.offset.relative.top-this.offset.parent.top+("fixed"===this.cssPosition?-this.offset.scroll.top:r?0:this.offset.scroll.top),left:h-this.offset.click.left-this.offset.relative.left-this.offset.parent.left+("fixed"===this.cssPosition?-this.offset.scroll.left:r?0:this.offset.scroll.left)}},_clear:function(){this._removeClass(this.helper,"ui-draggable-dragging"),this.helper[0]===this.element[0]||this.cancelHelperRemoval||this.helper.remove(),this.helper=null,this.cancelHelperRemoval=!1,this.destroyOnClear&&this.destroy()},_trigger:function(e,i,s){return s=s||this._uiHash(),t.ui.plugin.call(this,e,[i,s,this],!0),/^(drag|start|stop)/.test(e)&&(this.positionAbs=this._convertPositionTo("absolute"),s.offset=this.positionAbs),t.Widget.prototype._trigger.call(this,e,i,s)},plugins:{},_uiHash:function(){return{helper:this.helper,position:this.position,originalPosition:this.originalPosition,offset:this.positionAbs}}}),t.ui.plugin.add("draggable","connectToSortable",{start:function(e,i,s){var n=t.extend({},i,{item:s.element});s.sortables=[],t(s.options.connectToSortable).each(function(){var i=t(this).sortable("instance");i&&!i.options.disabled&&(s.sortables.push(i),i.refreshPositions(),i._trigger("activate",e,n))})},stop:function(e,i,s){var n=t.extend({},i,{item:s.element});s.cancelHelperRemoval=!1,t.each(s.sortables,function(){var t=this;t.isOver?(t.isOver=0,s.cancelHelperRemoval=!0,t.cancelHelperRemoval=!1,t._storedCSS={position:t.placeholder.css("position"),top:t.placeholder.css("top"),left:t.placeholder.css("left")},t._mouseStop(e),t.options.helper=t.options._helper):(t.cancelHelperRemoval=!0,t._trigger("deactivate",e,n))})},drag:function(e,i,s){t.each(s.sortables,function(){var n=!1,o=this;o.positionAbs=s.positionAbs,o.helperProportions=s.helperProportions,o.offset.click=s.offset.click,o._intersectsWith(o.containerCache)&&(n=!0,t.each(s.sortables,function(){return this.positionAbs=s.positionAbs,this.helperProportions=s.helperProportions,this.offset.click=s.offset.click,this!==o&&this._intersectsWith(this.containerCache)&&t.contains(o.element[0],this.element[0])&&(n=!1),n})),n?(o.isOver||(o.isOver=1,s._parent=i.helper.parent(),o.currentItem=i.helper.appendTo(o.element).data("ui-sortable-item",!0),o.options._helper=o.options.helper,o.options.helper=function(){return i.helper[0]},e.target=o.currentItem[0],o._mouseCapture(e,!0),o._mouseStart(e,!0,!0),o.offset.click.top=s.offset.click.top,o.offset.click.left=s.offset.click.left,o.offset.parent.left-=s.offset.parent.left-o.offset.parent.left,o.offset.parent.top-=s.offset.parent.top-o.offset.parent.top,s._trigger("toSortable",e),s.dropped=o.element,t.each(s.sortables,function(){this.refreshPositions()}),s.currentItem=s.element,o.fromOutside=s),o.currentItem&&(o._mouseDrag(e),i.position=o.position)):o.isOver&&(o.isOver=0,o.cancelHelperRemoval=!0,o.options._revert=o.options.revert,o.options.revert=!1,o._trigger("out",e,o._uiHash(o)),o._mouseStop(e,!0),o.options.revert=o.options._revert,o.options.helper=o.options._helper,o.placeholder&&o.placeholder.remove(),i.helper.appendTo(s._parent),s._refreshOffsets(e),i.position=s._generatePosition(e,!0),s._trigger("fromSortable",e),s.dropped=!1,t.each(s.sortables,function(){this.refreshPositions()}))})}}),t.ui.plugin.add("draggable","cursor",{start:function(e,i,s){var n=t("body"),o=s.options;n.css("cursor")&&(o._cursor=n.css("cursor")),n.css("cursor",o.cursor)},stop:function(e,i,s){var n=s.options;n._cursor&&t("body").css("cursor",n._cursor)}}),t.ui.plugin.add("draggable","opacity",{start:function(e,i,s){var n=t(i.helper),o=s.options;n.css("opacity")&&(o._opacity=n.css("opacity")),n.css("opacity",o.opacity)},stop:function(e,i,s){var n=s.options;n._opacity&&t(i.helper).css("opacity",n._opacity)}}),t.ui.plugin.add("draggable","scroll",{start:function(t,e,i){i.scrollParentNotHidden||(i.scrollParentNotHidden=i.helper.scrollParent(!1)),i.scrollParentNotHidden[0]!==i.document[0]&&"HTML"!==i.scrollParentNotHidden[0].tagName&&(i.overflowOffset=i.scrollParentNotHidden.offset())},drag:function(e,i,s){var n=s.options,o=!1,a=s.scrollParentNotHidden[0],r=s.document[0];a!==r&&"HTML"!==a.tagName?(n.axis&&"x"===n.axis||(s.overflowOffset.top+a.offsetHeight-e.pageY<n.scrollSensitivity?a.scrollTop=o=a.scrollTop+n.scrollSpeed:e.pageY-s.overflowOffset.top<n.scrollSensitivity&&(a.scrollTop=o=a.scrollTop-n.scrollSpeed)),n.axis&&"y"===n.axis||(s.overflowOffset.left+a.offsetWidth-e.pageX<n.scrollSensitivity?a.scrollLeft=o=a.scrollLeft+n.scrollSpeed:e.pageX-s.overflowOffset.left<n.scrollSensitivity&&(a.scrollLeft=o=a.scrollLeft-n.scrollSpeed))):(n.axis&&"x"===n.axis||(e.pageY-t(r).scrollTop()<n.scrollSensitivity?o=t(r).scrollTop(t(r).scrollTop()-n.scrollSpeed):t(window).height()-(e.pageY-t(r).scrollTop())<n.scrollSensitivity&&(o=t(r).scrollTop(t(r).scrollTop()+n.scrollSpeed))),n.axis&&"y"===n.axis||(e.pageX-t(r).scrollLeft()<n.scrollSensitivity?o=t(r).scrollLeft(t(r).scrollLeft()-n.scrollSpeed):t(window).width()-(e.pageX-t(r).scrollLeft())<n.scrollSensitivity&&(o=t(r).scrollLeft(t(r).scrollLeft()+n.scrollSpeed)))),o!==!1&&t.ui.ddmanager&&!n.dropBehaviour&&t.ui.ddmanager.prepareOffsets(s,e)}}),t.ui.plugin.add("draggable","snap",{start:function(e,i,s){var n=s.options;s.snapElements=[],t(n.snap.constructor!==String?n.snap.items||":data(ui-draggable)":n.snap).each(function(){var e=t(this),i=e.offset();this!==s.element[0]&&s.snapElements.push({item:this,width:e.outerWidth(),height:e.outerHeight(),top:i.top,left:i.left})})},drag:function(e,i,s){var n,o,a,r,h,l,c,u,d,p,f=s.options,
vendor: 2,277 bytes, line 1
1m=f.snapTolerance,g=i.offset.left,v=g+s.helperProportions.width,_=i.offset.top,b=_+s.helperProportions.height;for(d=s.snapElements.length-1;d>=0;d--)h=s.snapElements[d].left-s.margins.left,l=h+s.snapElements[d].width,c=s.snapElements[d].top-s.margins.top,u=c+s.snapElements[d].height,h-m>v||g>l+m||c-m>b||_>u+m||!t.contains(s.snapElements[d].item.ownerDocument,s.snapElements[d].item)?(s.snapElements[d].snapping&&s.options.snap.release&&s.options.snap.release.call(s.element,e,t.extend(s._uiHash(),{snapItem:s.snapElements[d].item})),s.snapElements[d].snapping=!1):("inner"!==f.snapMode&&(n=m>=Math.abs(c-b),o=m>=Math.abs(u-_),a=m>=Math.abs(h-v),r=m>=Math.abs(l-g),n&&(i.position.top=s._convertPositionTo("relative",{top:c-s.helperProportions.height,left:0}).top),o&&(i.position.top=s._convertPositionTo("relative",{top:u,left:0}).top),a&&(i.position.left=s._convertPositionTo("relative",{top:0,left:h-s.helperProportions.width}).left),r&&(i.position.left=s._convertPositionTo("relative",{top:0,left:l}).left)),p=n||o||a||r,"outer"!==f.snapMode&&(n=m>=Math.abs(c-_),o=m>=Math.abs(u-b),a=m>=Math.abs(h-g),r=m>=Math.abs(l-v),n&&(i.position.top=s._convertPositionTo("relative",{top:c,left:0}).top),o&&(i.position.top=s._convertPositionTo("relative",{top:u-s.helperProportions.height,left:0}).top),a&&(i.position.left=s._convertPositionTo("relative",{top:0,left:h}).left),r&&(i.position.left=s._convertPositionTo("relative",{top:0,left:l-s.helperProportions.width}).left)),!s.snapElements[d].snapping&&(n||o||a||r||p)&&s.options.snap.snap&&s.options.snap.snap.call(s.element,e,t.extend(s._uiHash(),{snapItem:s.snapElements[d].item})),s.snapElements[d].snapping=n||o||a||r||p)}}),t.ui.plugin.add("draggable","stack",{start:function(e,i,s){var n,o=s.options,a=t.makeArray(t(o.stack)).sort(function(e,i){return(parseInt(t(e).css("zIndex"),10)||0)-(parseInt(t(i).css("zIndex"),10)||0)});a.length&&(n=parseInt(t(a[0]).css("zIndex"),10)||0,t(a).each(function(e){t(this).css("zIndex",n+e)}),this.css("zIndex",n+a.length))}}),t.ui.plugin.add("draggable","zIndex",{start:function(e,i,s){var n=t(i.helper),o=s.options;n.css("zIndex")&&(o._zIndex=n.css("zIndex")),n.css("zIndex",o.zIndex)},stop:function(e,i,s){var n=s.options;n._zIndex&&t(i.helper).css("zIndex",n._zIndex)}}),t.ui.draggable
vendor: 22,168 bytes, line 1
1,t.widget("ui.sortable",t.ui.mouse,{version:"1.12.1",widgetEventPrefix:"sort",ready:!1,options:{appendTo:"parent",axis:!1,connectWith:!1,containment:!1,cursor:"auto",cursorAt:!1,dropOnEmpty:!0,forcePlaceholderSize:!1,forceHelperSize:!1,grid:!1,handle:!1,helper:"original",items:"> *",opacity:!1,placeholder:!1,revert:!1,scroll:!0,scrollSensitivity:20,scrollSpeed:20,scope:"default",tolerance:"intersect",zIndex:1e3,activate:null,beforeStop:null,change:null,deactivate:null,out:null,over:null,receive:null,remove:null,sort:null,start:null,stop:null,update:null},_isOverAxis:function(t,e,i){return t>=e&&e+i>t},_isFloating:function(t){return/left|right/.test(t.css("float"))||/inline|table-cell/.test(t.css("display"))},_create:function(){this.containerCache={},this._addClass("ui-sortable"),this.refresh(),this.offset=this.element.offset(),this._mouseInit(),this._setHandleClassName(),this.ready=!0},_setOption:function(t,e){this._super(t,e),"handle"===t&&this._setHandleClassName()},_setHandleClassName:function(){var e=this;this._removeClass(this.element.find(".ui-sortable-handle"),"ui-sortable-handle"),t.each(this.items,function(){e._addClass(this.instance.options.handle?this.item.find(this.instance.options.handle):this.item,"ui-sortable-handle")})},_destroy:function(){this._mouseDestroy();for(var t=this.items.length-1;t>=0;t--)this.items[t].item.removeData(this.widgetName+"-item");return this},_mouseCapture:function(e,i){var s=null,n=!1,o=this;return this.reverting?!1:this.options.disabled||"static"===this.options.type?!1:(this._refreshItems(e),t(e.target).parents().each(function(){return t.data(this,o.widgetName+"-item")===o?(s=t(this),!1):void 0}),t.data(e.target,o.widgetName+"-item")===o&&(s=t(e.target)),s?!this.options.handle||i||(t(this.options.handle,s).find("*").addBack().each(function(){this===e.target&&(n=!0)}),n)?(this.currentItem=s,this._removeCurrentsFromItems(),!0):!1:!1)},_mouseStart:function(e,i,s){var n,o,a=this.options;if(this.currentContainer=this,this.refreshPositions(),this.helper=this._createHelper(e),this._cacheHelperProportions(),this._cacheMargins(),this.scrollParent=this.helper.scrollParent(),this.offset=this.currentItem.offset(),this.offset={top:this.offset.top-this.margins.top,left:this.offset.left-this.margins.left},t.extend(this.offset,{click:{left:e.pageX-this.offset.left,top:e.pageY-this.offset.top},parent:this._getParentOffset(),relative:this._getRelativeOffset()}),this.helper.css("position","absolute"),this.cssPosition=this.helper.css("position"),this.originalPosition=this._generatePosition(e),this.originalPageX=e.pageX,this.originalPageY=e.pageY,a.cursorAt&&this._adjustOffsetFromHelper(a.cursorAt),this.domPosition={prev:this.currentItem.prev()[0],parent:this.currentItem.parent()[0]},this.helper[0]!==this.currentItem[0]&&this.currentItem.hide(),this._createPlaceholder(),a.containment&&this._setContainment(),a.cursor&&"auto"!==a.cursor&&(o=this.document.find("body"),this.storedCursor=o.css("cursor"),o.css("cursor",a.cursor),this.storedStylesheet=t("<style>*{ cursor: "+a.cursor+" !important; }</style>").appendTo(o)),a.opacity&&(this.helper.css("opacity")&&(this._storedOpacity=this.helper.css("opacity")),this.helper.css("opacity",a.opacity)),a.zIndex&&(this.helper.css("zIndex")&&(this._storedZIndex=this.helper.css("zIndex")),this.helper.css("zIndex",a.zIndex)),this.scrollParent[0]!==this.document[0]&&"HTML"!==this.scrollParent[0].tagName&&(this.overflowOffset=this.scrollParent.offset()),this._trigger("start",e,this._uiHash()),this._preserveHelperProportions||this._cacheHelperProportions(),!s)for(n=this.containers.length-1;n>=0;n--)this.containers[n]._trigger("activate",e,this._uiHash(this));return t.ui.ddmanager&&(t.ui.ddmanager.current=this),t.ui.ddmanager&&!a.dropBehaviour&&t.ui.ddmanager.prepareOffsets(this,e),this.dragging=!0,this._addClass(this.helper,"ui-sortable-helper"),this._mouseDrag(e),!0},_mouseDrag:function(e){var i,s,n,o,a=this.options,r=!1;for(this.position=this._generatePosition(e),this.positionAbs=this._convertPositionTo("absolute"),this.lastPositionAbs||(this.lastPositionAbs=this.positionAbs),this.options.scroll&&(this.scrollParent[0]!==this.document[0]&&"HTML"!==this.scrollParent[0].tagName?(this.overflowOffset.top+this.scrollParent[0].offsetHeight-e.pageY<a.scrollSensitivity?this.scrollParent[0].scrollTop=r=this.scrollParent[0].scrollTop+a.scrollSpeed:e.pageY-this.overflowOffset.top<a.scrollSensitivity&&(this.scrollParent[0].scrollTop=r=this.scrollParent[0].scrollTop-a.scrollSpeed),this.overflowOffset.left+this.scrollParent[0].offsetWidth-e.pageX<a.scrollSensitivity?this.scrollParent[0].scrollLeft=r=this.scrollParent[0].scrollLeft+a.scrollSpeed:e.pageX-this.overflowOffset.left<a.scrollSensitivity&&(this.scrollParent[0].scrollLeft=r=this.scrollParent[0].scrollLeft-a.scrollSpeed)):(e.pageY-this.document.scrollTop()<a.scrollSensitivity?r=this.document.scrollTop(this.document.scrollTop()-a.scrollSpeed):this.window.height()-(e.pageY-this.document.scrollTop())<a.scrollSensitivity&&(r=this.document.scrollTop(this.document.scrollTop()+a.scrollSpeed)),e.pageX-this.document.scrollLeft()<a.scrollSensitivity?r=this.document.scrollLeft(this.document.scrollLeft()-a.scrollSpeed):this.window.width()-(e.pageX-this.document.scrollLeft())<a.scrollSensitivity&&(r=this.document.scrollLeft(this.document.scrollLeft()+a.scrollSpeed))),r!==!1&&t.ui.ddmanager&&!a.dropBehaviour&&t.ui.ddmanager.prepareOffsets(this,e)),this.positionAbs=this._convertPositionTo("absolute"),this.options.axis&&"y"===this.options.axis||(this.helper[0].style.left=this.position.left+"px"),this.options.axis&&"x"===this.options.axis||(this.helper[0].style.top=this.position.top+"px"),i=this.items.length-1;i>=0;i--)if(s=this.items[i],n=s.item[0],o=this._intersectsWithPointer(s),o&&s.instance===this.currentContainer&&n!==this.currentItem[0]&&this.placeholder[1===o?"next":"prev"]()[0]!==n&&!t.contains(this.placeholder[0],n)&&("semi-dynamic"===this.options.type?!t.contains(this.element[0],n):!0)){if(this.direction=1===o?"down":"up","pointer"!==this.options.tolerance&&!this._intersectsWithSides(s))break;this._rearrange(e,s),this._trigger("change",e,this._uiHash());break}return this._contactContainers(e),t.ui.ddmanager&&t.ui.ddmanager.drag(this,e),this._trigger("sort",e,this._uiHash()),this.lastPositionAbs=this.positionAbs,!1},_mouseStop:function(e,i){if(e){if(t.ui.ddmanager&&!this.options.dropBehaviour&&t.ui.ddmanager.drop(this,e),this.options.revert){var s=this,n=this.placeholder.offset(),o=this.options.axis,a={};o&&"x"!==o||(a.left=n.left-this.offset.parent.left-this.margins.left+(this.offsetParent[0]===this.document[0].body?0:this.offsetParent[0].scrollLeft)),o&&"y"!==o||(a.top=n.top-this.offset.parent.top-this.margins.top+(this.offsetParent[0]===this.document[0].body?0:this.offsetParent[0].scrollTop)),this.reverting=!0,t(this.helper).animate(a,parseInt(this.options.revert,10)||500,function(){s._clear(e)})}else this._clear(e,i);return!1}},cancel:function(){if(this.dragging){this._mouseUp(new t.Event("mouseup",{target:null})),"original"===this.options.helper?(this.currentItem.css(this._storedCSS),this._removeClass(this.currentItem,"ui-sortable-helper")):this.currentItem.show();for(var e=this.containers.length-1;e>=0;e--)this.containers[e]._trigger("deactivate",null,this._uiHash(this)),this.containers[e].containerCache.over&&(this.containers[e]._trigger("out",null,this._uiHash(this)),this.containers[e].containerCache.over=0)}return this.placeholder&&(this.placeholder[0].parentNode&&this.placeholder[0].parentNode.removeChild(this.placeholder[0]),"original"!==this.options.helper&&this.helper&&this.helper[0].parentNode&&this.helper.remove(),t.extend(this,{helper:null,dragging:!1,reverting:!1,_noFinalSort:null}),this.domPosition.prev?t(this.domPosition.prev).after(this.currentItem):t(this.domPosition.parent).prepend(this.currentItem)),this},serialize:function(e){var i=this._getItemsAsjQuery(e&&e.connected),s=[];return e=e||{},t(i).each(function(){var i=(t(e.item||this).attr(e.attribute||"id")||"").match(e.expression||/(.+)[\-=_](.+)/);i&&s.push((e.key||i[1]+"[]")+"="+(e.key&&e.expression?i[1]:i[2]))}),!s.length&&e.key&&s.push(e.key+"="),s.join("&")},toArray:function(e){var i=this._getItemsAsjQuery(e&&e.connected),s=[];return e=e||{},i.each(function(){s.push(t(e.item||this).attr(e.attribute||"id")||"")}),s},_intersectsWith:function(t){var e=this.positionAbs.left,i=e+this.helperProportions.width,s=this.positionAbs.top,n=s+this.helperProportions.height,o=t.left,a=o+t.width,r=t.top,h=r+t.height,l=this.offset.click.top,c=this.offset.click.left,u="x"===this.options.axis||s+l>r&&h>s+l,d="y"===this.options.axis||e+c>o&&a>e+c,p=u&&d;return"pointer"===this.options.tolerance||this.options.forcePointerForContainers||"pointer"!==this.options.tolerance&&this.helperProportions[this.floating?"width":"height"]>t[this.floating?"width":"height"]?p:e+this.helperProportions.width/2>o&&a>i-this.helperProportions.width/2&&s+this.helperProportions.height/2>r&&h>n-this.helperProportions.height/2},_intersectsWithPointer:function(t){var e,i,s="x"===this.options.axis||this._isOverAxis(this.positionAbs.top+this.offset.click.top,t.top,t.height),n="y"===this.options.axis||this._isOverAxis(this.positionAbs.left+this.offset.click.left,t.left,t.width),o=s&&n;return o?(e=this._getDragVerticalDirection(),i=this._getDragHorizontalDirection(),this.floating?"right"===i||"down"===e?2:1:e&&("down"===e?2:1)):!1},_intersectsWithSides:function(t){var e=this._isOverAxis(this.positionAbs.top+this.offset.click.top,t.top+t.height/2,t.height),i=this._isOverAxis(this.positionAbs.left+this.offset.click.left,t.left+t.width/2,t.width),s=this._getDragVerticalDirection(),n=this._getDragHorizontalDirection();return this.floating&&n?"right"===n&&i||"left"===n&&!i:s&&("down"===s&&e||"up"===s&&!e)},_getDragVerticalDirection:function(){var t=this.positionAbs.top-this.lastPositionAbs.top;return 0!==t&&(t>0?"down":"up")},_getDragHorizontalDirection:function(){var t=this.positionAbs.left-this.lastPositionAbs.left;return 0!==t&&(t>0?"right":"left")},refresh:function(t){return this._refreshItems(t),this._setHandleClassName(),this.refreshPositions(),this},_connectWith:function(){var t=this.options;return t.connectWith.constructor===String?[t.connectWith]:t.connectWith},_getItemsAsjQuery:function(e){function i(){r.push(this)}var s,n,o,a,r=[],h=[],l=this._connectWith();if(l&&e)for(s=l.length-1;s>=0;s--)for(o=t(l[s],this.document[0]),n=o.length-1;n>=0;n--)a=t.data(o[n],this.widgetFullName),a&&a!==this&&!a.options.disabled&&h.push([t.isFunction(a.options.items)?a.options.items.call(a.element):t(a.options.items,a.element).not(".ui-sortable-helper").not(".ui-sortable-placeholder"),a]);for(h.push([t.isFunction(this.options.items)?this.options.items.call(this.element,null,{options:this.options,item:this.currentItem}):t(this.options.items,this.element).not(".ui-sortable-helper").not(".ui-sortable-placeholder"),this]),s=h.length-1;s>=0;s--)h[s][0].each(i);return t(r)},_removeCurrentsFromItems:function(){var e=this.currentItem.find(":data("+this.widgetName+"-item)");this.items=t.grep(this.items,function(t){for(var i=0;e.length>i;i++)if(e[i]===t.item[0])return!1;return!0})},_refreshItems:function(e){this.items=[],this.containers=[this];var i,s,n,o,a,r,h,l,c=this.items,u=[[t.isFunction(this.options.items)?this.options.items.call(this.element[0],e,{item:this.currentItem}):t(this.options.items,this.element),this]],d=this._connectWith();if(d&&this.ready)for(i=d.length-1;i>=0;i--)for(n=t(d[i],this.document[0]),s=n.length-1;s>=0;s--)o=t.data(n[s],this.widgetFullName),o&&o!==this&&!o.options.disabled&&(u.push([t.isFunction(o.options.items)?o.options.items.call(o.element[0],e,{item:this.currentItem}):t(o.options.items,o.element),o]),this.containers.push(o));for(i=u.length-1;i>=0;i--)for(a=u[i][1],r=u[i][0],s=0,l=r.length;l>s;s++)h=t(r[s]),h.data(this.widgetName+"-item",a),c.push({item:h,instance:a,width:0,height:0,left:0,top:0})},refreshPositions:function(e){this.floating=this.items.length?"x"===this.options.axis||this._isFloating(this.items[0].item):!1,this.offsetParent&&this.helper&&(this.offset.parent=this._getParentOffset());var i,s,n,o;for(i=this.items.length-1;i>=0;i--)s=this.items[i],s.instance!==this.currentContainer&&this.currentContainer&&s.item[0]!==this.currentItem[0]||(n=this.options.toleranceElement?t(this.options.toleranceElement,s.item):s.item,e||(s.width=n.outerWidth(),s.height=n.outerHeight()),o=n.offset(),s.left=o.left,s.top=o.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--)o=this.containers[i].element.offset(),this.containers[i].containerCache.left=o.left,this.containers[i].containerCache.top=o.top,this.containers[i].containerCache.width=this.containers[i].element.outerWidth(),this.containers[i].containerCache.height=this.containers[i].element.outerHeight();return this},_createPlaceholder:function(e){e=e||this;var i,s=e.options;s.placeholder&&s.placeholder.constructor!==String||(i=s.placeholder,s.placeholder={element:function(){var s=e.currentItem[0].nodeName.toLowerCase(),n=t("<"+s+">",e.document[0]);return e._addClass(n,"ui-sortable-placeholder",i||e.currentItem[0].className)._removeClass(n,"ui-sortable-helper"),"tbody"===s?e._createTrPlaceholder(e.currentItem.find("tr").eq(0),t("<tr>",e.document[0]).appendTo(n)):"tr"===s?e._createTrPlaceholder(e.currentItem,n):"img"===s&&n.attr("src",e.currentItem.attr("src")),i||n.css("visibility","hidden"),n},update:function(t,n){(!i||s.forcePlaceholderSize)&&(n.height()||n.height(e.currentItem.innerHeight()-parseInt(e.currentItem.css("paddingTop")||0,10)-parseInt(e.currentItem.css("paddingBottom")||0,10)),n.width()||n.width(e.currentItem.innerWidth()-parseInt(e.currentItem.css("paddingLeft")||0,10)-parseInt(e.currentItem.css("paddingRight")||0,10)))}}),e.placeholder=t(s.placeholder.element.call(e.element,e.currentItem)),e.currentItem.after(e.placeholder),s.placeholder.update(e,e.placeholder)},_createTrPlaceholder:function(e,i){var s=this;e.children().each(function(){t("<td>&#160;</td>",s.document[0]).attr("colspan",t(this).attr("colspan")||1).appendTo(i)})},_contactContainers:function(e){var i,s,n,o,a,r,h,l,c,u,d=null,p=null;for(i=this.containers.length-1;i>=0;i--)if(!t.contains(this.currentItem[0],this.containers[i].element[0]))if(this._intersectsWith(this.containers[i].containerCache)){if(d&&t.contains(this.containers[i].element[0],d.element[0]))continue;d=this.containers[i],p=i}else this.containers[i].containerCache.over&&(this.containers[i]._trigger("out",e,this._uiHash(this)),this.containers[i].containerCache.over=0);if(d)if(1===this.containers.length)this.containers[p].containerCache.over||(this.containers[p]._trigger("over",e,this._uiHash(this)),this.containers[p].containerCache.over=1);else{for(n=1e4,o=null,c=d.floating||this._isFloating(this.currentItem),a=c?"left":"top",r=c?"width":"height",u=c?"pageX":"pageY",s=this.items.length-1;s>=0;s--)t.contains(this.containers[p].element[0],this.items[s].item[0])&&this.items[s].item[0]!==this.currentItem[0]&&(h=this.items[s].item.offset()[a],l=!1,e[u]-h>this.items[s][r]/2&&(l=!0),n>Math.abs(e[u]-h)&&(n=Math.abs(e[u]-h),o=this.items[s],this.direction=l?"up":"down"));if(!o&&!this.options.dropOnEmpty)return;if(this.currentContainer===this.containers[p])return this.currentContainer.containerCache.over||(this.containers[p]._trigger("over",e,this._uiHash()),this.currentContainer.containerCache.over=1),void 0;o?this._rearrange(e,o,null,!0):this._rearrange(e,null,this.containers[p].element,!0),this._trigger("change",e,this._uiHash()),this.containers[p]._trigger("change",e,this._uiHash(this)),this.currentContainer=this.containers[p],this.options.placeholder.update(this.currentContainer,this.placeholder),this.containers[p]._trigger("over",e,this._uiHash(this)),this.containers[p].containerCache.over=1}},_createHelper:function(e){var i=this.options,s=t.isFunction(i.helper)?t(i.helper.apply(this.element[0],[e,this.currentItem])):"clone"===i.helper?this.currentItem.clone():this.currentItem;return s.parents("body").length||t("parent"!==i.appendTo?i.appendTo:this.currentItem[0].parentNode)[0].appendChild(s[0]),s[0]===this.currentItem[0]&&(this._storedCSS={width:this.currentItem[0].style.width,height:this.currentItem[0].style.height,position:this.currentItem.css("position"),top:this.currentItem.css("top"),left:this.currentItem.css("left")}),(!s[0].style.width||i.forceHelperSize)&&s.width(this.currentItem.width()),(!s[0].style.height||i.forceHelperSize)&&s.height(this.currentItem.height()),s},_adjustOffsetFromHelper:function(e){"string"==typeof e&&(e=e.split(" ")),t.isArray(e)&&(e={left:+e[0],top:+e[1]||0}),"left"in e&&(this.offset.click.left=e.left+this.margins.left),"right"in e&&(this.offset.click.left=this.helperProportions.width-e.right+this.margins.left),"top"in e&&(this.offset.click.top=e.top+this.margins.top),"bottom"in e&&(this.offset.click.top=this.helperProportions.height-e.bottom+this.margins.top)},_getParentOffset:function(){this.offsetParent=this.helper.offsetParent();var e=this.offsetParent.offset();return"absolute"===this.cssPosition&&this.scrollParent[0]!==this.document[0]&&t.contains(this.scrollParent[0],this.offsetParent[0])&&(e.left+=this.scrollParent.scrollLeft(),e.top+=this.scrollParent.scrollTop()),(this.offsetParent[0]===this.document[0].body||this.offsetParent[0].tagName&&"html"===this.offsetParent[0].tagName.toLowerCase()&&t.ui.ie)&&(e={top:0,left:0}),{top:e.top+(parseInt(this.offsetParent.css("borderTopWidth"),10)||0),left:e.left+(parseInt(this.offsetParent.css("borderLeftWidth"),10)||0)}},_getRelativeOffset:function(){if("relative"===this.cssPosition){var t=this.currentItem.position();return{top:t.top-(parseInt(this.helper.css("top"),10)||0)+this.scrollParent.scrollTop(),left:t.left-(parseInt(this.helper.css("left"),10)||0)+this.scrollParent.scrollLeft()}}return{top:0,left:0}},_cacheMargins:function(){this.margins={left:parseInt(this.currentItem.css("marginLeft"),10)||0,top:parseInt(this.currentItem.css("marginTop"),10)||0}},_cacheHelperProportions:function(){this.helperProportions={width:this.helper.outerWidth(),height:this.helper.outerHeight()}},_setContainment:function(){var e,i,s,n=this.options;"parent"===n.containment&&(n.containment=this.helper[0].parentNode),("document"===n.containment||"window"===n.containment)&&(this.containment=[0-this.offset.relative.left-this.offset.parent.left,0-this.offset.relative.top-this.offset.parent.top,"document"===n.containment?this.document.width():this.window.width()-this.helperProportions.width-this.margins.left,("document"===n.containment?this.document.height()||document.body.parentNode.scrollHeight:this.window.height()||this.document[0].body.parentNode.scrollHeight)-this.helperProportions.height-this.margins.top]),/^(document|window|parent)$/.test(n.containment)||(e=t(n.containment)[0],i=t(n.containment).offset(),s="hidden"!==t(e).css("overflow"),this.containment=[i.left+(parseInt(t(e).css("borderLeftWidth"),10)||0)+(parseInt(t(e).css("paddingLeft"),10)||0)-this.margins.left,i.top+(parseInt(t(e).css("borderTopWidth"),10)||0)+(parseInt(t(e).css("paddingTop"),10)||0)-this.margins.top,i.left+(s?Math.max(e.scrollWidth,e.offsetWidth):e.offsetWidth)-(parseInt(t(e).css("borderLeftWidth"),10)||0)-(parseInt(t(e).css("paddingRight"),10)||0)-this.helperProportions.width-this.margins.left,i.top+(s?Math.max(e.scrollHeight,e.offsetHeight):e.offsetHeight)-(parseInt(t(e).css("borderTopWidth"),10)||0)-(parseInt(t(e).css("paddingBottom"),10)||0)-this.helperProportions.height-this.margins.top])},_convertPositionTo:function(e,i){i||(i=this.position);var s="absolute"===e?1:-1,n="absolute"!==this.cssPosition||this.scrollParent[0]!==this.document[0]&&t.contains(this.scrollParent[0],this.offsetParent[0])?this.scrollParent:this.offsetParent,o=/(html|body)/i.test(n[0].tagName);return{top:i.top+this.offset.relative.top*s+this.offset.parent.top*s-("fixed"===this.cssPosition?-this.scrollParent.scrollTop():o?0:n.scrollTop())*s,left:i.left+this.offset.relative.left*s+this.offset.parent.left*s-("fixed"===this.cssPosition?-this.scrollParent.scrollLeft():o?0:n.scrollLeft())*s}},_generatePosition:function(e){var i,s,n=this.options,o=e.pageX,a=e.pageY,r="absolute"!==this.cssPosition||this.scrollParent[0]!==this.document[0]&&t.contains(this.scrollParent[0],this.offsetParent[0])?this.scrollParent:this.offsetParent,h=/(html|body)/i.test(r[0].tagName);return"relative"!==this.cssPosition||this.scrollParent[0]!==this.document[0]&&this.scrollParent[0]!==this.offsetParent[0]||(this.offset.relative=this._getRelativeOffset()),this.originalPosition&&(this.containment&&(e.pageX-this.offset.click.left<this.containment[0]&&(o=this.containment[0]+this.offset.click.left),e.pageY-this.offset.click.top<this.containment[1]&&(a=this.containment[1]+this.offset.click.top),e.pageX-this.offset.click.left>this.containment[2]&&(o=this.containment[2]+this.offset.click.left),e.pageY-this.offset.click.top>this.containment[3]&&(a=this.containment[3]+this.offset.click.top)),n.grid&&(i=this.originalPageY+Math.round((a-this.originalPageY)/n.grid[1])*n.grid[1],a=this.containment?i-this.offset.click.top>=this.containment[1]&&i-this.offset.click.top<=this.containment[3]?i:i-this.offset.click.top>=this.containment[1]?i-n.grid[1]:i+n.grid[1]:i,s=this.originalPageX+Math.round((o-this.originalPageX)/n.grid[0])*n.grid[0],o=this.containment?s-this.offset.click.left>=this.containment[0]&&s-this.offset.click.left<=this.containment[2]?s:s-this.offset.click.left>=this.containment[0]?s-n.grid[0]:s+n.grid[0]:s)),{top:a-this.offset.click.top-this.offset.relative.top-this.offset.parent.top+("fixed"===this.cssPosition?-this.scrollParent.scrollTop():h?0:r.scrollTop()),left:o-this.offset.click.left-this.offset.relative.left-this.offset.parent.left+("fixed"===this.cssPosition?-this.scrollParent.scrollLeft():h?0:r.scrollLeft())}},_rearrange:function(t,e,i,s){i?i[0].appendChild(this.placeholder[0]):e.item[0].parentNode.insertBefore(this.placeholder[0],"down"===this.direction?e.item[0]:e.item[0].nextSibling),this.counter=this.counter?++this.counter:1;var n=this.counter;
vendor: 2,872 bytes, line 1
1this._delay(function(){n===this.counter&&this.refreshPositions(!s)})},_clear:function(t,e){function i(t,e,i){return function(s){i._trigger(t,s,e._uiHash(e))}}this.reverting=!1;var s,n=[];if(!this._noFinalSort&&this.currentItem.parent().length&&this.placeholder.before(this.currentItem),this._noFinalSort=null,this.helper[0]===this.currentItem[0]){for(s in this._storedCSS)("auto"===this._storedCSS[s]||"static"===this._storedCSS[s])&&(this._storedCSS[s]="");this.currentItem.css(this._storedCSS),this._removeClass(this.currentItem,"ui-sortable-helper")}else this.currentItem.show();for(this.fromOutside&&!e&&n.push(function(t){this._trigger("receive",t,this._uiHash(this.fromOutside))}),!this.fromOutside&&this.domPosition.prev===this.currentItem.prev().not(".ui-sortable-helper")[0]&&this.domPosition.parent===this.currentItem.parent()[0]||e||n.push(function(t){this._trigger("update",t,this._uiHash())}),this!==this.currentContainer&&(e||(n.push(function(t){this._trigger("remove",t,this._uiHash())}),n.push(function(t){return function(e){t._trigger("receive",e,this._uiHash(this))}}.call(this,this.currentContainer)),n.push(function(t){return function(e){t._trigger("update",e,this._uiHash(this))}}.call(this,this.currentContainer)))),s=this.containers.length-1;s>=0;s--)e||n.push(i("deactivate",this,this.containers[s])),this.containers[s].containerCache.over&&(n.push(i("out",this,this.containers[s])),this.containers[s].containerCache.over=0);if(this.storedCursor&&(this.document.find("body").css("cursor",this.storedCursor),this.storedStylesheet.remove()),this._storedOpacity&&this.helper.css("opacity",this._storedOpacity),this._storedZIndex&&this.helper.css("zIndex","auto"===this._storedZIndex?"":this._storedZIndex),this.dragging=!1,e||this._trigger("beforeStop",t,this._uiHash()),this.placeholder[0].parentNode.removeChild(this.placeholder[0]),this.cancelHelperRemoval||(this.helper[0]!==this.currentItem[0]&&this.helper.remove(),this.helper=null),!e){for(s=0;n.length>s;s++)n[s].call(this,t);this._trigger("stop",t,this._uiHash())}return this.fromOutside=!1,!this.cancelHelperRemoval},_trigger:function(){t.Widget.prototype._trigger.apply(this,arguments)===!1&&this.cancel()},_uiHash:function(e){var i=e||this;return{helper:i.helper,placeholder:i.placeholder||t([]),position:i.position,originalPosition:i.originalPosition,offset:i.positionAbs,item:i.currentItem,sender:e?e.element:null}}});var o="ui-effects-",a="ui-effects-style",r="ui-effects-animated",h=t;t.effects={effect:{}},function(t,e){function i(t,e,i){var s=u[e.type]||{};return null==t?i||!e.def?null:e.def:(t=s.floor?~~t:parseFloat(t),isNaN(t)?e.def:s.mod?(t+s.mod)%s.mod:0>t?0:t>s.max?s.max:t)}function s(i){var s=l(),n=s._rgba=[];return i=i.toLowerCase(),f(h,function(t,o){var a,r=o.re.exec(i),h=r&&o.parse(r),l=o.space||"rgba";return h?(a=s[l](h),s[c[l].cache]=a[c[l].cache],n=s._rgba=a._rgba,
vendor: 8,822 bytes, line 1
1!1):e}),n.length?("0,0,0,0"===n.join()&&t.extend(n,o.transparent),s):o[i]}function n(t,e,i){return i=(i+1)%1,1>6*i?t+6*(e-t)*i:1>2*i?e:2>3*i?t+6*(e-t)*(2/3-i):t}var o,a="backgroundColor borderBottomColor borderLeftColor borderRightColor borderTopColor color columnRuleColor outlineColor textDecorationColor textEmphasisColor",r=/^([\-+])=\s*(\d+\.?\d*)/,h=[{re:/rgba?\(\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d{1,3})\s*(?:,\s*(\d?(?:\.\d+)?)\s*)?\)/,parse:function(t){return[t[1],t[2],t[3],t[4]]}},{re:/rgba?\(\s*(\d+(?:\.\d+)?)\%\s*,\s*(\d+(?:\.\d+)?)\%\s*,\s*(\d+(?:\.\d+)?)\%\s*(?:,\s*(\d?(?:\.\d+)?)\s*)?\)/,parse:function(t){return[2.55*t[1],2.55*t[2],2.55*t[3],t[4]]}},{re:/#([a-f0-9]{2})([a-f0-9]{2})([a-f0-9]{2})/,parse:function(t){return[parseInt(t[1],16),parseInt(t[2],16),parseInt(t[3],16)]}},{re:/#([a-f0-9])([a-f0-9])([a-f0-9])/,parse:function(t){return[parseInt(t[1]+t[1],16),parseInt(t[2]+t[2],16),parseInt(t[3]+t[3],16)]}},{re:/hsla?\(\s*(\d+(?:\.\d+)?)\s*,\s*(\d+(?:\.\d+)?)\%\s*,\s*(\d+(?:\.\d+)?)\%\s*(?:,\s*(\d?(?:\.\d+)?)\s*)?\)/,space:"hsla",parse:function(t){return[t[1],t[2]/100,t[3]/100,t[4]]}}],l=t.Color=function(e,i,s,n){return new t.Color.fn.parse(e,i,s,n)},c={rgba:{props:{red:{idx:0,type:"byte"},green:{idx:1,type:"byte"},blue:{idx:2,type:"byte"}}},hsla:{props:{hue:{idx:0,type:"degrees"},saturation:{idx:1,type:"percent"},lightness:{idx:2,type:"percent"}}}},u={"byte":{floor:!0,max:255},percent:{max:1},degrees:{mod:360,floor:!0}},d=l.support={},p=t("<p>")[0],f=t.each;p.style.cssText="background-color:rgba(1,1,1,.5)",d.rgba=p.style.backgroundColor.indexOf("rgba")>-1,f(c,function(t,e){e.cache="_"+t,e.props.alpha={idx:3,type:"percent",def:1}}),l.fn=t.extend(l.prototype,{parse:function(n,a,r,h){if(n===e)return this._rgba=[null,null,null,null],this;(n.jquery||n.nodeType)&&(n=t(n).css(a),a=e);var u=this,d=t.type(n),p=this._rgba=[];return a!==e&&(n=[n,a,r,h],d="array"),"string"===d?this.parse(s(n)||o._default):"array"===d?(f(c.rgba.props,function(t,e){p[e.idx]=i(n[e.idx],e)}),this):"object"===d?(n instanceof l?f(c,function(t,e){n[e.cache]&&(u[e.cache]=n[e.cache].slice())}):f(c,function(e,s){var o=s.cache;f(s.props,function(t,e){if(!u[o]&&s.to){if("alpha"===t||null==n[t])return;u[o]=s.to(u._rgba)}u[o][e.idx]=i(n[t],e,!0)}),u[o]&&0>t.inArray(null,u[o].slice(0,3))&&(u[o][3]=1,s.from&&(u._rgba=s.from(u[o])))}),this):e},is:function(t){var i=l(t),s=!0,n=this;return f(c,function(t,o){var a,r=i[o.cache];return r&&(a=n[o.cache]||o.to&&o.to(n._rgba)||[],f(o.props,function(t,i){return null!=r[i.idx]?s=r[i.idx]===a[i.idx]:e})),s}),s},_space:function(){var t=[],e=this;return f(c,function(i,s){e[s.cache]&&t.push(i)}),t.pop()},transition:function(t,e){var s=l(t),n=s._space(),o=c[n],a=0===this.alpha()?l("transparent"):this,r=a[o.cache]||o.to(a._rgba),h=r.slice();return s=s[o.cache],f(o.props,function(t,n){var o=n.idx,a=r[o],l=s[o],c=u[n.type]||{};null!==l&&(null===a?h[o]=l:(c.mod&&(l-a>c.mod/2?a+=c.mod:a-l>c.mod/2&&(a-=c.mod)),h[o]=i((l-a)*e+a,n)))}),this[n](h)},blend:function(e){if(1===this._rgba[3])return this;var i=this._rgba.slice(),s=i.pop(),n=l(e)._rgba;return l(t.map(i,function(t,e){return(1-s)*n[e]+s*t}))},toRgbaString:function(){var e="rgba(",i=t.map(this._rgba,function(t,e){return null==t?e>2?1:0:t});return 1===i[3]&&(i.pop(),e="rgb("),e+i.join()+")"},toHslaString:function(){var e="hsla(",i=t.map(this.hsla(),function(t,e){return null==t&&(t=e>2?1:0),e&&3>e&&(t=Math.round(100*t)+"%"),t});return 1===i[3]&&(i.pop(),e="hsl("),e+i.join()+")"},toHexString:function(e){var i=this._rgba.slice(),s=i.pop();return e&&i.push(~~(255*s)),"#"+t.map(i,function(t){return t=(t||0).toString(16),1===t.length?"0"+t:t}).join("")},toString:function(){return 0===this._rgba[3]?"transparent":this.toRgbaString()}}),l.fn.parse.prototype=l.fn,c.hsla.to=function(t){if(null==t[0]||null==t[1]||null==t[2])return[null,null,null,t[3]];var e,i,s=t[0]/255,n=t[1]/255,o=t[2]/255,a=t[3],r=Math.max(s,n,o),h=Math.min(s,n,o),l=r-h,c=r+h,u=.5*c;return e=h===r?0:s===r?60*(n-o)/l+360:n===r?60*(o-s)/l+120:60*(s-n)/l+240,i=0===l?0:.5>=u?l/c:l/(2-c),[Math.round(e)%360,i,u,null==a?1:a]},c.hsla.from=function(t){if(null==t[0]||null==t[1]||null==t[2])return[null,null,null,t[3]];var e=t[0]/360,i=t[1],s=t[2],o=t[3],a=.5>=s?s*(1+i):s+i-s*i,r=2*s-a;return[Math.round(255*n(r,a,e+1/3)),Math.round(255*n(r,a,e)),Math.round(255*n(r,a,e-1/3)),o]},f(c,function(s,n){var o=n.props,a=n.cache,h=n.to,c=n.from;l.fn[s]=function(s){if(h&&!this[a]&&(this[a]=h(this._rgba)),s===e)return this[a].slice();var n,r=t.type(s),u="array"===r||"object"===r?s:arguments,d=this[a].slice();return f(o,function(t,e){var s=u["object"===r?t:e.idx];null==s&&(s=d[e.idx]),d[e.idx]=i(s,e)}),c?(n=l(c(d)),n[a]=d,n):l(d)},f(o,function(e,i){l.fn[e]||(l.fn[e]=function(n){var o,a=t.type(n),h="alpha"===e?this._hsla?"hsla":"rgba":s,l=this[h](),c=l[i.idx];return"undefined"===a?c:("function"===a&&(n=n.call(this,c),a=t.type(n)),null==n&&i.empty?this:("string"===a&&(o=r.exec(n),o&&(n=c+parseFloat(o[2])*("+"===o[1]?1:-1))),l[i.idx]=n,this[h](l)))})})}),l.hook=function(e){var i=e.split(" ");f(i,function(e,i){t.cssHooks[i]={set:function(e,n){var o,a,r="";if("transparent"!==n&&("string"!==t.type(n)||(o=s(n)))){if(n=l(o||n),!d.rgba&&1!==n._rgba[3]){for(a="backgroundColor"===i?e.parentNode:e;(""===r||"transparent"===r)&&a&&a.style;)try{r=t.css(a,"backgroundColor"),a=a.parentNode}catch(h){}n=n.blend(r&&"transparent"!==r?r:"_default")}n=n.toRgbaString()}try{e.style[i]=n}catch(h){}}},t.fx.step[i]=function(e){e.colorInit||(e.start=l(e.elem,i),e.end=l(e.end),e.colorInit=!0),t.cssHooks[i].set(e.elem,e.start.transition(e.end,e.pos))}})},l.hook(a),t.cssHooks.borderColor={expand:function(t){var e={};return f(["Top","Right","Bottom","Left"],function(i,s){e["border"+s+"Color"]=t}),e}},o=t.Color.names={aqua:"#00ffff",black:"#000000",blue:"#0000ff",fuchsia:"#ff00ff",gray:"#808080",green:"#008000",lime:"#00ff00",maroon:"#800000",navy:"#000080",olive:"#808000",purple:"#800080",red:"#ff0000",silver:"#c0c0c0",teal:"#008080",white:"#ffffff",yellow:"#ffff00",transparent:[null,null,null,0],_default:"#ffffff"}}(h),function(){function e(e){var i,s,n=e.ownerDocument.defaultView?e.ownerDocument.defaultView.getComputedStyle(e,null):e.currentStyle,o={};if(n&&n.length&&n[0]&&n[n[0]])for(s=n.length;s--;)i=n[s],"string"==typeof n[i]&&(o[t.camelCase(i)]=n[i]);else for(i in n)"string"==typeof n[i]&&(o[i]=n[i]);return o}function i(e,i){var s,o,a={};for(s in i)o=i[s],e[s]!==o&&(n[s]||(t.fx.step[s]||!isNaN(parseFloat(o)))&&(a[s]=o));return a}var s=["add","remove","toggle"],n={border:1,borderBottom:1,borderColor:1,borderLeft:1,borderRight:1,borderTop:1,borderWidth:1,margin:1,padding:1};t.each(["borderLeftStyle","borderRightStyle","borderBottomStyle","borderTopStyle"],function(e,i){t.fx.step[i]=function(t){("none"!==t.end&&!t.setAttr||1===t.pos&&!t.setAttr)&&(h.style(t.elem,i,t.end),t.setAttr=!0)}}),t.fn.addBack||(t.fn.addBack=function(t){return this.add(null==t?this.prevObject:this.prevObject.filter(t))}),t.effects.animateClass=function(n,o,a,r){var h=t.speed(o,a,r);return this.queue(function(){var o,a=t(this),r=a.attr("class")||"",l=h.children?a.find("*").addBack():a;l=l.map(function(){var i=t(this);return{el:i,start:e(this)}}),o=function(){t.each(s,function(t,e){n[e]&&a[e+"Class"](n[e])})},o(),l=l.map(function(){return this.end=e(this.el[0]),this.diff=i(this.start,this.end),this}),a.attr("class",r),l=l.map(function(){var e=this,i=t.Deferred(),s=t.extend({},h,{queue:!1,complete:function(){i.resolve(e)}});return this.el.animate(this.diff,s),i.promise()}),t.when.apply(t,l.get()).done(function(){o(),t.each(arguments,function(){var e=this.el;t.each(this.diff,function(t){e.css(t,"")})}),h.complete.call(a[0])})})},t.fn.extend({addClass:function(e){return function(i,s,n,o){return s?t.effects.animateClass.call(this,{add:i},s,n,o):e.apply(this,arguments)}}(t.fn.addClass),removeClass:function(e){return function(i,s,n,o){return arguments.length>1?t.effects.animateClass.call(this,{remove:i},s,n,o):e.apply(this,arguments)}}(t.fn.removeClass),toggleClass:function(e){return function(i,s,n,o,a){return"boolean"==typeof s||void 0===s?n?t.effects.animateClass.call(this,s?{add:i}:{remove:i},n,o,a):e.apply(this,arguments):t.effects.animateClass.call(this,{toggle:i},s,n,o)}}(t.fn.toggleClass),switchClass:function(e,i,s,n,o){return t.effects.animateClass.call(this,{add:i,remove:e},s,n,o)}})}(),function(){function e(e,i,s,n){return t.isPlainObject(e)&&(i=e,e=e.effect),e={effect:e},null==i&&(i={}),t.isFunction(i)&&(n=i,s=null,i={}),("number"==typeof i||t.fx.speeds[i])&&(n=s,s=i,i={}),t.isFunction(s)&&(n=s,s=null),i&&t.extend(e,i),s=s||i.duration,e.duration=t.fx.off?0:"number"==typeof s?s:s in t.fx.speeds?t.fx.speeds[s]:t.fx.speeds._default,e.complete=n||i.complete,e}function i(e){return!e||"number"==typeof e||t.fx.speeds[e]?!0:"str
vendor: 5,459 bytes, line 1
1ing"!=typeof e||t.effects.effect[e]?t.isFunction(e)?!0:"object"!=typeof e||e.effect?!1:!0:!0}function s(t,e){var i=e.outerWidth(),s=e.outerHeight(),n=/^rect\((-?\d*\.?\d*px|-?\d+%|auto),?\s*(-?\d*\.?\d*px|-?\d+%|auto),?\s*(-?\d*\.?\d*px|-?\d+%|auto),?\s*(-?\d*\.?\d*px|-?\d+%|auto)\)$/,o=n.exec(t)||["",0,i,s,0];return{top:parseFloat(o[1])||0,right:"auto"===o[2]?i:parseFloat(o[2]),bottom:"auto"===o[3]?s:parseFloat(o[3]),left:parseFloat(o[4])||0}}t.expr&&t.expr.filters&&t.expr.filters.animated&&(t.expr.filters.animated=function(e){return function(i){return!!t(i).data(r)||e(i)}}(t.expr.filters.animated)),t.uiBackCompat!==!1&&t.extend(t.effects,{save:function(t,e){for(var i=0,s=e.length;s>i;i++)null!==e[i]&&t.data(o+e[i],t[0].style[e[i]])},restore:function(t,e){for(var i,s=0,n=e.length;n>s;s++)null!==e[s]&&(i=t.data(o+e[s]),t.css(e[s],i))},setMode:function(t,e){return"toggle"===e&&(e=t.is(":hidden")?"show":"hide"),e},createWrapper:function(e){if(e.parent().is(".ui-effects-wrapper"))return e.parent();var i={width:e.outerWidth(!0),height:e.outerHeight(!0),"float":e.css("float")},s=t("<div></div>").addClass("ui-effects-wrapper").css({fontSize:"100%",background:"transparent",border:"none",margin:0,padding:0}),n={width:e.width(),height:e.height()},o=document.activeElement;try{o.id}catch(a){o=document.body}return e.wrap(s),(e[0]===o||t.contains(e[0],o))&&t(o).trigger("focus"),s=e.parent(),"static"===e.css("position")?(s.css({position:"relative"}),e.css({position:"relative"})):(t.extend(i,{position:e.css("position"),zIndex:e.css("z-index")}),t.each(["top","left","bottom","right"],function(t,s){i[s]=e.css(s),isNaN(parseInt(i[s],10))&&(i[s]="auto")}),e.css({position:"relative",top:0,left:0,right:"auto",bottom:"auto"})),e.css(n),s.css(i).show()},removeWrapper:function(e){var i=document.activeElement;return e.parent().is(".ui-effects-wrapper")&&(e.parent().replaceWith(e),(e[0]===i||t.contains(e[0],i))&&t(i).trigger("focus")),e}}),t.extend(t.effects,{version:"1.12.1",define:function(e,i,s){return s||(s=i,i="effect"),t.effects.effect[e]=s,t.effects.effect[e].mode=i,s},scaledDimensions:function(t,e,i){if(0===e)return{height:0,width:0,outerHeight:0,outerWidth:0};var s="horizontal"!==i?(e||100)/100:1,n="vertical"!==i?(e||100)/100:1;return{height:t.height()*n,width:t.width()*s,outerHeight:t.outerHeight()*n,outerWidth:t.outerWidth()*s}},clipToBox:function(t){return{width:t.clip.right-t.clip.left,height:t.clip.bottom-t.clip.top,left:t.clip.left,top:t.clip.top}},unshift:function(t,e,i){var s=t.queue();e>1&&s.splice.apply(s,[1,0].concat(s.splice(e,i))),t.dequeue()},saveStyle:function(t){t.data(a,t[0].style.cssText)},restoreStyle:function(t){t[0].style.cssText=t.data(a)||"",t.removeData(a)},mode:function(t,e){var i=t.is(":hidden");return"toggle"===e&&(e=i?"show":"hide"),(i?"hide"===e:"show"===e)&&(e="none"),e},getBaseline:function(t,e){var i,s;switch(t[0]){case"top":i=0;break;case"middle":i=.5;break;case"bottom":i=1;break;default:i=t[0]/e.height}switch(t[1]){case"left":s=0;break;case"center":s=.5;break;case"right":s=1;break;default:s=t[1]/e.width}return{x:s,y:i}},createPlaceholder:function(e){var i,s=e.css("position"),n=e.position();return e.css({marginTop:e.css("marginTop"),marginBottom:e.css("marginBottom"),marginLeft:e.css("marginLeft"),marginRight:e.css("marginRight")}).outerWidth(e.outerWidth()).outerHeight(e.outerHeight()),/^(static|relative)/.test(s)&&(s="absolute",i=t("<"+e[0].nodeName+">").insertAfter(e).css({display:/^(inline|ruby)/.test(e.css("display"))?"inline-block":"block",visibility:"hidden",marginTop:e.css("marginTop"),marginBottom:e.css("marginBottom"),marginLeft:e.css("marginLeft"),marginRight:e.css("marginRight"),"float":e.css("float")}).outerWidth(e.outerWidth()).outerHeight(e.outerHeight()).addClass("ui-effects-placeholder"),e.data(o+"placeholder",i)),e.css({position:s,left:n.left,top:n.top}),i},removePlaceholder:function(t){var e=o+"placeholder",i=t.data(e);i&&(i.remove(),t.removeData(e))},cleanUp:function(e){t.effects.restoreStyle(e),t.effects.removePlaceholder(e)},setTransition:function(e,i,s,n){return n=n||{},t.each(i,function(t,i){var o=e.cssUnit(i);o[0]>0&&(n[i]=o[0]*s+o[1])}),n}}),t.fn.extend({effect:function(){function i(e){function i(){h.removeData(r),t.effects.cleanUp(h),"hide"===s.mode&&h.hide(),a()}function a(){t.isFunction(l)&&l.call(h[0]),t.isFunction(e)&&e()}var h=t(this);s.mode=u.shift(),t.uiBackCompat===!1||o?"none"===s.mode?(h[c](),a()):n.call(h[0],s,i):(h.is(":hidden")?"hide"===c:"show"===c)?(h[c](),a()):n.call(h[0],s,a)}var s=e.apply(this,arguments),n=t.effects.effect[s.effect],o=n.mode,a=s.queue,h=a||"fx",l=s.complete,c=s.mode,u=[],d=function(e){var i=t(this),s=t.effects.mode(i,c)||o;i.data(r,!0),u.push(s),o&&("show"===s||s===o&&"hide"===s)&&i.show(),o&&"none"===s||t.effects.saveStyle(i),t.isFunction(e)&&e()};return t.fx.off||!n?c?this[c](s.duration,l):this.each(function(){l&&l.call(this)}):a===!1?this.each(d).each(i):this.queue(h,d).queue(h,i)},show:function(t){return function(s){if(i(s))return t.apply(this,arguments);var n=e.apply(this,arguments);return n.mode="show",this.effect.call(this,n)}}(t.fn.show),hide:function(t){return function(s){if(i(s))return t.apply(this,arguments);var n=e.apply(this,arguments);return n.mode="hide",this.effect.call(this,n)}}(t.fn.hide),toggle:function(t){return function(s){if(i(s)||"boolean"==typeof s)return t.apply(this,arguments);var n=e.apply(this,arguments);return n.mode="toggle",this.effect.call(this,n)}}
1(t.fn.toggle),cssUnit:function(e){var i=this.css(e),s=[];return t.each(["em","px","%","pt"],function(t,e){i.indexOf(e)>0&&(s=[parseFloat(i),e])}),s},cssClip:function(t){return t?this.css("clip","rect("+t.top+"px "+t.right+"px "+t.bottom+"px "+t.left+"px)"):s(this.css("clip"),this)},transfer:function(e,i){var s=t(this),n=t(e.to),o="fixed"===n.css("position"),a=t("body"),r=o?a.scrollTop():0,h=o?a.scrollLeft():0,l=n.offset(),c={top:l.top-r,left:l.left-h,height:n.innerHeight(),width:n.innerWidth()},u=s.offset(),d=t("<div class='ui-effects-transfer'></div>").appendTo("body").addClass(e.className).css({top:u.top-r,left:u.left-h,height:s.innerHeight(),width:s.innerWidth(),position:o?"fixed":"absolute"}).animate(c,e.duration,e.easing,function(){d.remove(),t.isFunction(i)&&i()})}}),t.fx.step.clip=function(e){e.clipInit||(e.start=t(e.elem).cssClip(),"string"==typeof e.end&&(e.end=s(e.end,e.elem)),e.clipInit=!0),t(e.elem).cssClip({top:e.pos*(e.end.top-e.start.top)+e.start.top,right:e.pos*(e.end.right-e.start.right)+e.start.right,bottom:e.pos*(e.end.bottom-e.start.bottom)+e.start.bottom,left:e.pos*(e.end.left-e.start.left)+e.start.left})}}(),function(){var e={};t.each(["Quad","Cubic","Quart","Quint","Expo"],function(t,i){e[i]=function(e){return Math.pow(e,t+2)}}),t.extend(e,{Sine:function(t){return 1-Math.cos(t*Math.PI/2)},Circ:function(t){return 1-Math.sqrt(1-t*t)},Elastic:function(t){return 0===t||1===t?t:-Math.pow(2,8*(t-1))*Math.sin((80*(t-1)-7.5)*Math.PI/15)},Back:function(t){return t*t*(3*t-2)},Bounce:function(t){for(var e,i=4;((e=Math.pow(2,--i))-1)/11>t;);return 1/Math.pow(4,3-i)-7.5625*Math.pow((3*e-2)/22-t,2)}}),t.each(e,function(e,i){t.easing["easeIn"+e]=i,t.easing["easeOut"+e]=function(t){return 1-i(1-t)},t.easing["easeInOut"+e]=function(t){return.5>t?i(2*t)/2:1-i(-2*t+2)/2}})}(),t.effects,t.effects.define("fade","toggle",function(e,i){var s="show"===e.mode;t(this).css("opacity",s?0:1).animate({opacity:s?1:0},{queue:!1,duration:e.duration,easing:e.easing,complete:i})})});(function($,undefined){$.widget("ui.filelist",{options:{},_create:function(){var self=this;self.box=$("<div></div>").addClass("file").css({"margin":0}).insertBefore(self.element);self.ul=$("<ul></ul>").appendTo(self.box);self.ul.disableSelection();self._text_to_list();self.element.hide();self.element.closest("form").submit(function(e){self._update()});self._rebuild()},destroy:function(){this.box.remove()},add:function(id,title,description){var self=this;id=parseInt(id);var file,n=0,res=new Array;for(var i in self.list){file=self.list[i];if(file.id!=id){n++;res[n]=file}}n++;res[n]={"id":id,"title":title,"description":description,"draft":false};self.list=res;self._list_to_text();self._rebuild()},_text_to_list:function(){var self=this;var text=self.element.val().split(";");self.list=new Array;var n=0,file;for(var i in text){file=text[i];if(file.length>0){n++;file=file.split(",");self.list[n]={"id":parseInt(file[0]),"title":file[1],"description":file[2],"draft":false}}}},_list_to_text:function(){var self=this,i,item,res="";for(i in self.list){item=self.list[i];if(!item.draft){if(res.length>0)res=res.concat(";");res=res.concat(item.id,",",item.title,",",item.description)}}self.element.val(res)},_rebuild:function(){var self=this;var li,n=0,file,str,str2;self.ul.unbind();if(self.ul.hasClass("ui-sortable"))self.ul.sortable("destroy");self.ul.empty();for(var i in self.list){file=self.list[i];n++;li=$('<li id="file-item-'+file.id+'"></li>').appendTo(self.ul);str=str_hex(file.title,true);str=str.replace(/"/g,"&quot;");str2=str_hex(file.description,true);str2=str2.replace(/"/g,"&quot;");if(file.draft){li.html('<div class="num">'+n+'.</div><div><input name="title" value="'+str+'" class="iform_input w4" style="margin:0 0 2px 0"><br><input name="description" value="'+str2+'" class="iform_input w4"></div><div class="show"></div><br class="cb">');li.css({"opacity":".5"})}else li.html('<div class="num">'+n+'.</div><div><input name="title" value="'+str+'" class="iform_input w4" style="margin:0 0 2px 0"><br><input name="description" value="'+
2str2+'" class="iform_input w4"></div><div class="hide"></div><br class="cb">')}self.ul.find("input").bind("change focus keydown keyup",function(){self._schedule_update()});self.ul.bind("click",function(event){var target=$(event.target);if(target.hasClass("hide")){target.closest("li").fadeTo(0,0.5);target.removeClass("hide").addClass("show");self._update()}else if(target.hasClass("show")){target.closest("li").fadeTo(0,1);target.removeClass("show").addClass("hide");self._update()}}).sortable({stop:function(event,ui){self._update()},axis:"y"})},_update:function(){var self=this;self.list=new Array;var n=0;self.ul.find("li").each(function(){n++;$(this).find("div.num").text(n+". ");
2if($(this).find("div.hide").length==0)self.list[n]={"id":parseInt($(this).attr("id").replace(/[^0-9]/g,"")),"title":str_hex($(this).find("input[name=title]").val(),false),"description":str_hex($(this).find("input[name=description]").val(),false),"draft":true};else self.list[n]={"id":parseInt($(this).attr("id").replace(/[^0-9]/g,"")),"title":str_hex($(this).find("input[name=title]").val(),false),"description":str_hex($(this).find("input[name=description]").val(),false),"draft":false}});self._list_to_text()},_schedule_update:function(){var self=this;clearTimeout(self.timer);self.timer=setTimeout(function(){self._update()},1E3)}})})(jQuery);(function(e){e.widget("ui.tags",{options:{tag_list:[]},_create:function(){this.focus=!1;this.suggestion_offset=this.suggestion_size=0;this.suggestion_filter="";this.box=e('<div class="'+this.element.attr("class")+'"></div>').insertAfter(this.element);this.constructor=e("<div></div>").appendTo(this.box);this.suggestion=e('<div class="suggestion"></div>').insertAfter(this.box);this.element.hide();this.element.closest("form").submit(function(){this.focus=!1;this._create_new_tag()});this._rebuild()},destroy:function(){this.element.unbind(".tags");this.element.show();this.suggestion.remove();this.constructor.remove();this.box.remove()},_rebuild:function(){this.constructor.empty();var a=e("<ul></ul>").appendTo(this.constructor),c=this.element.val();if(c.length>0){var c=this._split(c),b;for(b in c)e("<li><a>x</a><span>"+c[b]+"</span></li>").appendTo(a)}c=e('<li class="last"></li>').appendTo(a);this.input=e('<input type="text" class="fake" style="width:50px" autocomplete="off">').appendTo(c);e('<br class="cb">').insertAfter(a);this.input.width(this.constructor.width()-this.input.position().left+this.constructor.position().left-8);this.focus&&this.input.focus();this._rebind()},_rebind:function(){var a=this;a.input.bind("focus.tags",function(){a.focus=!0;a.box.addClass("tags_focus");a._suggestion_navigate("down")}).bind("blur.tags",function(){a.focus=!1;setTimeout(function(){a.focus||(a._create_new_tag(),a._suggestion_close())},250);a.box.removeClass("tags_focus")}).bind("keydown.tags",function(c){switch(c.keyCode){case 8:a.input.val()==""&&a._remove_last_tag();break;case 13:c.preventDefault();a._suggestion_select();break;case 27:c.preventDefault();a._suggestion_close();break;case 32:a.input.val()==""&&c.preventDefault();break;case 38:c.preventDefault();a._suggestion_navigate("up");break;case 40:c.preventDefault(),a._suggestion_navigate("down")}}).bind("keyup.tags",function(){a._create_new_tag();a._suggestion(a.input.val(),!1)});a.constructor.find("li").bind("click",function(c){c.preventDefault();e(c.target).is("a")&&e(this).css({"white-space":"nowrap"}).animate({width:"0px",opacity:"0"},100,function(){a._remove_tag(e(this).find("span").text())})})},_create_new_tag:function(){var a=this.input.val();if(a.length>0&&(a.match(",")||!this.focus)){for(var a=this._split(a),c=this.focus?a.length-1:a.length,b=this._split(this.element.val()),d=0;d<c;d++)a[d]=trim(a[d]),a[d].length>0&&b.push(a[d]);b=this._array_unique(b).join(",");this.element.val(b);this._rebuild();this.focus&&this.input.val(trim(a[a.length-1]))}},_remove_tag:function(a){var c=this._split(this.element.val()),b=[],d;for(d in c)c[d]!=a&&b.push(c[d]);b=b.join(",");this.element.val(b);a=this.input.val();this.focus=!0;this._rebuild();this.input.val(a)},_remove_last_tag:function(){var a=this._split(this.element.val()),c=a.pop(),a=a.join(",");this.element.val(a);this._rebuild();this.input.val(c)},suggest:function(){this._suggestion("",!0)},_suggestion:function(a,c){var b=this;if(a!=b.suggestion_filter||c){b.suggestion_filter=a;b.suggestion_size=0;b.suggestion_offset=0;var d="",f="",i=!1;if(c)for(var g in b.options.tag_list)f=b.options.tag_list[g],b.suggestion_size++,d+='<li value="'+b.suggestion_size+'"><a>'+f+"</a></li>";else if(a.length>0){var h=RegExp(a,"i");for(g in b.options.tag_list)f=b.options.tag_list[g],f==a?(b.suggestion_size++,i=!0,d+='<li value="'+b.suggestion_size+'"><a><b>'+f+"</b></a></li>"):f.search(h)>=0&&(b.suggestion_size++,h=RegExp(a,"gi"),f=f.replace(h,function(a){return"<b>"+a+"</b>"}),d+='<li value="'+b.suggestion_size+'"><a>'+f+"</a></li>")}if(b.suggestion_size==1&&i)b.suggestion_size=0;b.suggestion.empty();b.suggestion_size>0&&(b.suggestion.html("<ul>"+d+"</ul>"),b.suggestion.find("a").bind("click",function(){b.focus=!0;var a=e(this).html(),a=a.replace(/<\/?[^>]+(>|$)/g,"");b.input.val(a+",");b._create_new_tag();b._suggestion("",!0)}),b.suggestion.css({left:Math.round(b.input.position().left-b.constructor.position().left+3)+"px"}))}},_suggestion_navigate:function(a){this.suggestion_size>0?(a=="up"&&this.suggestion_offset>1&&this.suggestion_offset--,a=="down"&&this.suggestion_offset<this.suggestion_size&&this.suggestion_offset++,this.suggestion.find("a").removeClass("hover"),this.suggestion.find("li").eq(this.suggestion_offset-1).find("a").addClass("hover")):this._suggestion("",!0)},_suggestion_select:function(){if(this.suggestion_size>0&&this.suggestion_offset>0){var a=this.suggestion.find("li").eq(this.suggestion_offset-1).find("a").text(),a=a.replace(/<\/?[^>]+(>|$)/g,"");this.input.val(a+",");this._create_new_tag();this._suggestion("",!1)}},_suggestion_close:function(){this.suggestion_size=0;this.suggestion.empty()},_split:function(a){var c=[];if(a.length!=0)for(var a=a.split(","),b=a.length,d=0;d<b;d++)(a[d].length>0||d==b-1)&&c.push(a[d]);return c},_array_unique:function(a){for(var c=a.length,b=[],d,f=0;f<c;f++){d=!0;for(var e=f+1;e<c;e++)a[f]==a[e]&&(d=!1);d&&b.push(a[f])}return b}})})(jQuery);
2(function(c){c.widget("ui.textarea",{options:{extra_space:0,max_height:500,max_length:0},_create:function(){var a=this;this.element.css({resize:"none","overflow-y":"hidden",display:"block"});this.frame_div=c('<div class="iform_countdown"></div>').insertAfter(this.element);this.alert_div=c("<div></div>").appendTo(this.frame_div).hide();this.element.wrap("<div></div>");this.original_height=this.element.height();this.clone=this._clone();this.last_scroll_top=null;this.element.bind("keyup.textarea keydown.textarea change.textarea focus.textarea",function(){a._change()});this.element.bind("blur.textarea",function(){a._blur()})},destroy:function(){this.element.unbind(".textarea");this.clone.remove();this.element.unwrap();this.alert_div.remove();this.frame_div.remove()},_clone:function(){var a=this,b={};c.each(["height","width","lineHeight","textDecoration","letterSpacing"],function(c,d){b[d]=a.element.css(d)});return this.element.clone().removeAttr("id").removeAttr("name").css({position:"absolute",top:0,left:-9999}).css(b).attr("tabIndex","-1").insertBefore(this.element)},_change:function(){var a=this.element.val();if(0<this.options.max_length){var b=a.length;this.alert_div.text(this.options.max_length-b).show();b>this.options.max_length?(a=a.substr(0,this.options.max_length),this.element.val(a),this.alert_div.addClass("overflow")):this.alert_div.removeClass("overflow")}this.clone.height(0).val(a).scrollTop(1E4);a=Math.max(this.clone.scrollTop(),this.original_height)+this.options.extra_space;b=this.element.add(this.clone);this.last_scroll_top!==a&&(this.last_scroll_top=a,a>=this.options.max_height&&(a=this.options.max_height,this.element.css("overflow-y","")),b.height(a))},_blur:function(){if(0<this.options.max_length){var a=this.element.val().length;a<=this.options.max_length&&this.alert_div.text(this.options.max_length-a).hide()}}})})(jQuery);(function($,undefined){var $body=$('body');var $document=$(document);var modal_list=new Array();$.widget('vp.modal',{options:{'close':{'esc':true,'click':true,'icon':true},'close_others':false,'css_prefix':'','fade':true,'fade_duration':200},_create:function(){var self=this;self.validate_options();self.open();},destroy:function(){var self=this;},validate_options:function(){var self=this;self.options.close=(typeof self.options.close&&typeof self.options.close==='object'&&self.options.close.constructor===Object)?self.options.close:{};self.options.close.esc=(typeof self.options.close.esc==='boolean')?self.options.close.esc:true;self.options.close.click=(typeof self.options.close.click==='boolean')?self.options.close.click:true;self.options.close.icon=(typeof self.options.close.icon==='boolean')?self.options.close.icon:true;self.options.close=(typeof self.options.close&&typeof self.options.close==='object'&&self.options.close.constructor===Object)?self.options.close:{};self.options.close=(typeof self.options.close&&typeof self.options.close==='object'&&self.options.close.constructor===Object)?self.options.close:{};self.options.close_others=(typeof self.options.close_others==='boolean')?self.options.close_others:false;self.options.css_prefix=(typeof self.options.css_prefix==='string'||self.options.css_prefix instanceof String)?self.options.css_prefix.replace(/[^a-z0-9_]/g,''):'';self.options.fade=(typeof self.options.fade==='boolean')?self.options.fade:false;self.options.fade_duration=(typeof self.options.fade_duration==='number'&&isFinite(self.options.fade_duration))?parseInt(this.options.fade_duration)||200:200;},open:function(){var self=this;if(self.options.close_others){while(modal_list.length){modal_list[modal_list.length-1].close(true);}}
3modal_list.push(self);self.block();if(self.options.fade){setTimeout(function(){self.show();},self.options.fade_duration);}else{self.show();}
4$document.off('keydown').on('keydown',function(event){if(event.which===27&&self.options.close.esc){modal_list[modal_list.length-1].close();}});self.$blocker.click(function(event){if(event.target===this&&self.options.close.click){self.close();}});},close:function(){var self=this;if(self.options.close.icon){self.$modal_close.remove();}
5modal_list.pop();self.unblock();self.hide();if(modal_list.length==0){$document.off('keydown');}},block:function(){var self=this;$body.css({'overflow':'hidden'});self.$blocker=$('<div class="'+self.options.css_prefix+'modal_blocker"></div>').appendTo($body);self.mark_upper();if(self.options.fade&&modal_list.length==1){self.$blocker.css({'opacity':0}).animate({'opacity':1},self.options.fade_duration);}},unblock:function(immediately){var self=this;if(!immediately&&self.options.fade&&modal_list.length==0){self.$blocker.fadeOut(self.options.fade_duration,function(){self.unblock(true);});}else{self.$blocker.remove();self.$blocker=null;self.mark_upper();if(modal_list.length==0){$body.css({'overflow':''});}}},show:function(){var self=this;self.$modal=$('<div class="'+self.options.css_prefix+'modal"></div>').appendTo(self.$blocker);self.$modal.append(self.element);if(self.options.close.icon){self.$modal_close=$('<a class="modal_close">x</a>').on('click',function(){self.close();}).appendTo(self.$modal);}
6if(self.options.fade&&modal_list.length==1){self.$modal.css({'display':'inline-block','opacity':0}).animate({'opacity':1},self.options.fade_duration);}else{self.$modal.css('display','inline-block');}
7self.$modal.find('.'+self.options.css_prefix+'modal_close_handler').on('click',function(event){event.preventDefault();self.close();});self.element.trigger('modal:open');},hide:function(){var self=this;if(self.options.fade){self.$modal.fadeOut(self.options.fade_duration);}else{self.$modal.hide();}},mark_upper:function(){var self=this;var i,upper=true;for(i=modal_list.length-1;i>=0;i--){if(modal_list[i].$blocker){if(upper){modal_list[i].$blocker.addClass(self.options.css_prefix+'modal_blocker_upper');}else{modal_list[i].$blocker.removeClass(self.options.css_prefix+'modal_blocker_upper');}
8upper=false;}}}});})(jQuery);(function($,undefined){$.widget("vp.x_autocomplete",{options:{group:0,size:14,data:null,zindex:0},_create:function(){var self=this;self.data=[];self.filter={group:self.options.group,text:""};self.is_open=false;self.cursor=0;self.moratorium=false;
8self._data_init();self.element.on("blur.x_autocomplete",function(){self._blur()}).on("keydown.x_autocomplete",function(event){self._keydown(event)}).on("keyup.x_autocomplete",function(event){self._keyup(event)}).appendTo(self.container);self.width=self.element.outerWidth(true);self._popup_init()},destroy:function(){var self=this;clearTimeout(self.timer);self.popup_fader.off().empty();self.arrow.off().remove();self.element.off();self.popup_fader=null;self.popup=null;self.data=[];self.filtered_data=[];self.filter={group:0,text:""};self.is_open=false;self.cursor=0;self.moratorium=false;$.Widget.prototype.destroy.call(self)},set_value:function(value){var self=this,old=self.element.val(),group="",title="";if(value in self.data){group=self.data[value].group;title=self.data[value].title}self.filter.text=title;self.element.val(title);if(title!==old)self._trigger("change",{type:"change"},{group:group})},set_group:function(group){var self=this;self.filter.group=group},_data_init:function(){var self=this,i;self.data=[];for(i in self.options.data)self.data.push({group:self.options.data[i].group||0,title:self.options.data[i].title})},_data_filter:function(){var self=this,i,j;self.filtered_data=[];if(self.filter.group==0)if(self.filter.text.length==0)self.filtered_data=self.data;else{var re=new RegExp(self.filter.text,"i");for(i in self.data)if(self.data[i].title.search(re)>=0)self.filtered_data[i]={group:self.data[i].group,title:self.data[i].title}}else if(self.filter.text.length==0)for(i in self.data){if(self.data[i].group==self.filter.group)self.filtered_data[i]={group:self.data[i].group,title:self.data[i].title}}else{var re=new RegExp(self.filter.text,"i");for(i in self.data)if(self.data[i].group==self.filter.group&&self.data[i].title.search(re)>=0)self.filtered_data[i]={group:self.data[i].group,title:self.data[i].title}}},_open:function(){var self=this;clearTimeout(self.timeout);if(!self.moratorium){var val=self.element.val();if(self.is_open){if(self.filter.text!==val){self.filter.text=val;self._data_filter();self._list()}}else{self.is_open=true;self.popup.position({of:self.element,my:"left top",at:"left bottom"});self.popup_fader.stop(true,true).fadeIn(200);self.filter.text=val;self._data_filter();self._list()}}},_close:function(){var self=this;clearTimeout(self.timer);self.is_open=false;self.popup_fader.off().stop(true,true).fadeOut(200)},_list:function(){var self=this,i,n=0,html="";self.cursor=0;self.popup_fader.off().empty();self.select=$("<select></select>").addClass("iform_input").css({"width":this.width+"px"}).on("click.x_autocomplete",function(event){self._popup_click(event)}).on("focus.x_autocomplete",function(event){self._popup_focus(event)}).appendTo(this.popup_fader);for(i in self.filtered_data){html+='<option value="'+i+'">'+self.filtered_data[i].title+"</option>";n++}if(n==0)self.select.hide();else{self.select.show();n=self._adjust_size(n);self.select.attr("size",n).html(html)}},_adjust_size:function(n){var self=this,size=self.options.size;if(n<size)size=n;if(size<2)size=2;return size},_blur:function(event){var self=this;self._close()},_keydown:function(event){var self=this;if(self.is_open)switch(event.keyCode){case 13:event.preventDefault();var $selected=self.select.find(":selected");if($selected.length){self.set_value($selected.val());self._close()}break;case 27:event.preventDefault();self._close();break;case 38:event.preventDefault();var $options=self.select.find("option");n=$options.length;if(self.cursor>1)self.cursor--;if(self.cursor>n)self.cursor=n;$options.filter(":selected").removeProp("selected");$options.eq(self.cursor-1).prop("selected",true);break;case 40:event.preventDefault();var $options=self.select.find("option");n=$options.length;if(self.cursor<n)self.cursor++;if(self.cursor<1)self.cursor=1;$options.filter(":selected").removeProp("selected");$options.eq(self.cursor-1).prop("selected",true);break}else switch(event.keyCode){case 40:event.preventDefault();self._open();break}},_keyup:function(event){var self=this,val=self.element.val();clearTimeout(self.timer);self.timer=setTimeout(function(){if(self.filter.text!==val)self._open()},250)},_popup_init:function(){var self=this;var popup=$("#iform-popup-select");if(popup.length){self.popup=popup;self.popup_fader=self.popup.find("div")}
8else{self.popup=$("<div></div>").attr("id","iform-popup-select").addClass("iform_popup").addClass("iform").appendTo($("body"));if(self.options.zindex!=0)self.popup.css({"z-index":self.options.zindex});else self.popup.css({"z-index":""});self.popup_fader=$("<div></div>").appendTo(this.popup).hide()}},_popup_click:function(event){var self=this,$target=$(event.target);if($target.is("option"))self.set_value($target.val(),$target.text())},_popup_focus:function(event){var self=this;self.moratorium=true;self.element.focus();self.moratorium=false}})})(jQuery);(function($,undefined){$.widget("vp.x_calendar",{options:{},txt:{day_names:["\u041f\u043d","\u0412\u0442","\u0421\u0440","\u0427\u0442","\u041f\u0442","\u0421\u0431","\u0412\u0441"],month_names:["\u042f\u043d\u0432\u0430\u0440\u044c","\u0424\u0435\u0432\u0440\u0430\u043b\u044c","\u041c\u0430\u0440\u0442","\u0410\u043f\u0440\u0435\u043b\u044c","\u041c\u0430\u0439","\u0418\u044e\u043d\u044c","\u0418\u044e\u043b\u044c","\u0410\u0432\u0433\u0443\u0441\u0442","\u0421\u0435\u043d\u0442\u044f\u0431\u0440\u044c","\u041e\u043a\u0442\u044f\u0431\u0440\u044c","\u041d\u043e\u044f\u0431\u0440\u044c","\u0414\u0435\u043a\u0430\u0431\u0440\u044c"]},_create:function(){var self=this;self.date={year:0,month:0,day:0,time:0};self.viewport={year:0,month:0,day:0,time:0,start:0};self.is_open=false;self.moratorium=false;self.element.on("click.x_calendar focus.x_calendar change.x_calendar keyup.x_calendar",function(event){self._open(event)}).on("keydown.x_calendar",function(event){self._keydown(event)});self._popup_init()},destroy:function(){this.element.off(".x_calendar");this.div_calendar.remove()},_open:function(event){var self=this;if(!self.moratorium){var old=self.date.time,val=self.element.val();if(self.is_open){self.date=self._date_parse(val);if(self.date.time!=old){self.viewport=self._date_viewport(self.date.year,self.date.month);self._grid()}}else{self.is_open=true;self.popup.position({of:self.element,my:"left top",at:"left bottom"});self.popup_fader.stop(true,true).fadeIn(200);self.date=self._date_parse(val);self.viewport=self._date_viewport(self.date.year,self.date.month);self._grid();$(document).on("mousedown.x_calendar",function(event){self._elsewhere_click(event)})}}},_close:function(){var self=this;self.is_open=false;$(document).off("mousedown.x_calendar");self.popup_fader.off().stop(true,true).fadeOut(200)},_grid:function(){var self=this,time=self.viewport.start,today_time=self._date_today_time(),x,y,css,d=new Date,html="";self.popup_fader.off().empty();self.calendar=$("<div></div>").addClass("calendar").on("click.x_calendar",function(event){self._popup_click(event)}).appendTo(this.popup_fader);html+='<a class="calendar_previous"><i></i></a><a class="calendar_next"><i></i></a><h1>'+self.txt.month_names[self.viewport.month]+" "+self.viewport.year+"</h1>";html+="<table><thead><tr>";for(x=0;x<7;x++)html+="<td>"+(x>4?'<span class="calendar_day_off">'+self.txt.day_names[x]+"</span>":self.txt.day_names[x])+"</td>";html+="</tr></thead><tbody>";for(y=0;y<6;y++){html+="<tr>";for(var x=0;x<7;x++){d.setTime(time);css=[];if(self.viewport.month==d.getMonth()){if(time==today_time)css.push("calendar_today")}else css.push("calendar_other_months");if(time==self.date.time)css.push("calendar_selected");if(css.length==0)html+="<td><a>"+d.getDate()+"</a></td>";else html+='<td><a class="'+css.join(" ")+'">'+d.getDate()+"</a></td>";time+=864E5}html+="</tr>"}html+="</tbody></table>";self.calendar.html(html)},_keydown:function(event){var self=this;if(self.is_open)switch(event.keyCode){case 9:self._close();break}else switch(event.keyCode){case 40:event.preventDefault();self._open();break}},_viewport_previous:function(){var self=this;if(self.viewport.month==0){self.viewport.year--;self.viewport.month=11}else self.viewport.month--;self.viewport=self._date_viewport(self.viewport.year,self.viewport.month);self._grid()},_viewport_next:function(){var self=this;if(self.viewport.month==11){self.viewport.year++;self.viewport.month=0}else self.viewport.month++;self.viewport=self._date_viewport(self.viewport.year,self.viewport.month);self._grid()},_date_parse:function(str){var d=new Date;str=str.replace(/[^0-9]/g,".")+"..";str=str.split(".");str[2]=parseInt(str[2]);if(isNaN(str[2]))str[2]=d.getFullYear();str[1]=parseInt(str[1]);if(isNaN(str[1]))str[1]=d.getMonth();else str[1]--;str[0]=parseInt(str[0]);if(isNaN(str[0]))str[0]=d.getDate();d=new Date(str[2],str[1],str[0],12,0,0,0);return{year:d.getFullYear(),month:d.getMonth(),day:d.getDate(),time:d.getTime()}},_date_today_time:function(){var d=new Date,d=new Date(d.getFullYear(),d.getMonth(),d.getDate(),12,0,0,0);return d.getTime()},_date_viewport:function(year,month){var self=this,date=new Date(year,month,1,12,0,0,0),day_of_week=date.getDay();return{year:date.getFullYear(),month:date.getMonth(),day:date.getDate(),time:date.getTime(),start:-864E5*(day_of_week==0?6:day_of_week-1)+date.getTime()}},_popup_init:function(){var self=this;var popup=$("#iform-popup-select");if(popup.length){self.popup=popup;self.popup_fader=self.popup.find("div")}
8else{self.popup=$("<div></div>").attr("id","iform-popup-select").addClass("iform_popup").addClass("iform").appendTo($("body"));self.popup_fader=$("<div></div>").appendTo(this.popup).hide()}},_popup_click:function(event){var self=this,$target=$(event.target);if($target.is("i"))$target=$target.closest("a");if($target.hasClass("calendar_previous"))self._viewport_previous();else if($target.hasClass("calendar_next"))self._viewport_next();else if($target.hasClass("calendar_other_months")){var v=parseInt($target.text());if(!isNaN(v))if(v<10)self._viewport_next();else if(v>10)self._viewport_previous()}else if($target.is("a")){var val=parseInt($target.text());if(!isNaN(val)){val=val+"."+self._leading_zero(self.viewport.month+1,2)+"."+self._leading_zero(self.viewport.year,4);self.element.val(val)}self._close()}},_leading_zero:function(i,d){i=i.toString();while(i.length<d)i="0"+i;return i},_elsewhere_click:function(event){var self=this,$target=$(event.target);if($target.closest(self.input).length==0)if($target.closest(self.popup).length==0)self._close()}})})(jQuery);(function($,undefined){$.widget("vp.x_checkbox",{options:{rem_class:"rem"},_create:function(){var self=this;self._change();self.element.on("change.x_checkbox",function(){self._change()})},destroy:function(){var self=this;self.element.unbind(".x_checkbox")},_change:function(){var self=this,id=self.element.attr("id");if(self.element.prop("checked")){$("#"+id+"-for").removeClass(self.options.rem_class);self._trigger("change",{type:"change"},{value:1})}else{$("#"+id+"-for").addClass(self.options.rem_class);self._trigger("change",{type:"change"},{value:0})}}})})(jQuery);(function($,undefined){$.widget('vp.x_collapsible',{options:{title:''},_create:function(){var self=this;self.element.wrap('<div class="collapsible"></div>');self.element.wrap('<div class="collapsible_container x"></div>');self.collapsible=self.element.closest('.collapsible');self.collapsible.prepend('<div class="collapsible_open"><a><u>'+self.options.title+'</u></a></div>');self.collapsible.append('<div class="collapsible_close x"><a><u>Ñâåðíóòü</u></a></div>');self.collapsible.on('click',function(event){self._click(event);});},_click:function(event){var self=this;var $target=$(event.target);if($target.closest('.collapsible_open').length){self.collapsible.children('div').slideToggle(250);}
9if($target.closest('.collapsible_close').length){var top=self.collapsible.offset().top;top=top<10?0:top-10;$("html, body").animate({scrollTop:top+'px'},250);self.collapsible.children('div').slideToggle(250);}}});})(jQuery);(function($,undefined){$.widget("vp.x_file",{_create:function(){var self=this;self.element.wrap('<div class="iform_upload"></div>');self.fake=$("<a>"+self.element.attr("title")+"</a>").addClass("iform_upload_fake").insertBefore(self.element);self.element.addClass("iform_upload_file").on("mouseenter.x_file",$.proxy(self._enter,self)).on("mouseleave.x_file",$.proxy(self._leave,self))},_enter:function(){this.fake.addClass("iform_upload_fake_hover")},_leave:function(){this.fake.removeClass("iform_upload_fake_hover")}})})(jQuery);(function($,undefined){$.widget("vp.x_input",{options:{max_length:0},_create:function(){var self=this;this.frame_div=$('<div class="iform_countdown"></div>').insertAfter(this.element);this.alert_div=$("<div></div>").appendTo(this.frame_div).hide();this.element.on("keyup.x_input change.x_input focus.x_input",function(){self._change()});this.element.on("blur.x_input",function(){self._blur()})},destroy:function(){this.element.off(".x_input");this.alert_div.remove();this.frame_div.remove()},_change:function(){var self=this;var value=self.element.val();if(self.options.max_length>0){var length=value.length;self.alert_div.text(self.options.max_length-length).show();if(length>self.options.max_length){value=value.substr(0,self.options.max_length);self.element.val(value);self.alert_div.addClass("overflow")}else self.alert_div.removeClass("overflow")}},_blur:function(){var self=this;if(self.options.max_length>0){var length=self.element.val().length;if(length<=self.options.max_length)self.alert_div.text(self.options.max_length-
10length).hide()}}})})(jQuery);(function($,undefined){$.widget("vp.x_period",{options:{suspend:false,data:[],month:0,year:0,update_delay:1E3,open_delay:300,open_duration:300,chanel:0},txt:{day_names:["\u041f\u043d","\u0412\u0442","\u0421\u0440","\u0427\u0442","\u041f\u0442","\u0421\u0431","\u0412\u0441"],month_names:["\u042f\u043d\u0432\u0430\u0440\u044c","\u0424\u0435\u0432\u0440\u0430\u043b\u044c","\u041c\u0430\u0440\u0442","\u0410\u043f\u0440\u0435\u043b\u044c","\u041c\u0430\u0439","\u0418\u044e\u043d\u044c","\u0418\u044e\u043b\u044c","\u0410\u0432\u0433\u0443\u0441\u0442","\u0421\u0435\u043d\u0442\u044f\u0431\u0440\u044c","\u041e\u043a\u0442\u044f\u0431\u0440\u044c","\u041d\u043e\u044f\u0431\u0440\u044c","\u0414\u0435\u043a\u0430\u0431\u0440\u044c"]},_create:function(){var self=this,date=new Date;self.is_down=false;self.is_open=false;self.is_suspend=self.options.suspend;self.date_start={year:0,month:0,day:0,time:0};self.date_stop={year:0,month:0,day:0,time:0};self.highlight={start:0,stop:0};if(self.options.year==0)date=new Date(date.getFullYear(),date.getMonth(),1,12,0,0,0);else date=new Date(self.options.year,self.options.month,1,12,0,0,0);self.viewport={year:date.getFullYear(),month:date.getMonth(),day:date.getDate(),time:date.getTime()};self._container_init()},destroy:function(){this.element.off(".x_period");this.element.empty()},_container_init:function(){var self=this;self.container=$("<div></div>").addClass("period").on("mousedown.x_period",function(event){self._down(event)}).on("mousemove.x_period",function(event){self._move(event)}).appendTo(self.element);$(document).on("mouseup.x_period",function(event){self._up(event)}).on("click.x_period",$.proxy(self._body,self));self._grid();
10self._popup_init()},_popup_init:function(){var self=this,popup=$("#x-popup-"+self.options.chanel);if(popup.length){self.popup=popup;self.popup_fader=self.popup.children("div")}else{self.popup=$("<div></div>").attr("id","x-popup-"+self.options.chanel).addClass("x_popup").css({"left":0,"position":"absolute","top":0,"z-index":10+self.options.chanel}).appendTo($("body"));self.popup_fader=$("<div></div>").appendTo(self.popup).hide()}},_grid:function(){var self=this,date=new Date,today=new Date,today_year=today.getFullYear(),today_month=today.getMonth(),today_day=today.getDate(),m,n,html="",time=self.viewport.time,x,y;if(self.is_suspend)html+='<p class="period_up"><a>\u041a\u0430\u043b\u0435\u043d\u0434\u0430\u0440\u044c</a></p><p class="period_cb"></p>';else{date.setTime(time);n=date.getDay();n=n==0?-5:2-n;days_in_month=self._tools_nodim(time);html+='<p class="period_up"><a>'+self.txt.month_names[date.getMonth()]+" "+date.getFullYear()+'</a></p><p class="period_cb"></p>';html+="<table><thead><tr>";for(x=0;x<7;x++)html+="<td"+(x>4?' class="period_day_off"':"")+">"+self.txt.day_names[x]+"</td>";html+="</tr></thead><tbody>";for(y=0;y<6;y++){html+="<tr>";for(var x=0;x<7;x++){date.setTime(time);if(n<1||n>days_in_month)html+="<td></td>";else{if(today_year==date.getFullYear()&&today_month==date.getMonth()&&today_day==date.getDate())html+='<td class="period_today period_day" data-time="'+time+'">'+n+"</td>";else html+='<td class="period_day" data-time="'+time+'">'+n+"</td>";time+=864E5}n++}html+="</tr>"}html+="</tbody></table>"}self.container.html(html)},_highlight:function(){var self=this;if(self.highlight.start!=self.date_start.time||self.highlight.stop!=self.date_stop.time){var time,start,stop;if(self.date_start.time>self.date_stop.time){start=self.date_stop.time;stop=self.date_start.time}else{start=self.date_start.time;stop=self.date_stop.time}self.element.find("td.period_day").each(function(){time=$(this).data("time");if(time>=start&&time<=stop)$(this).addClass("period_hl");else $(this).removeClass("period_hl")});self.highlight.start=self.date_start.time;self.highlight.stop=self.date_stop.time}},_down:function(event){event.preventDefault();var self=this,time,$target=$(event.target);clearTimeout(self.timer);if($target.is("a"))self._open();else self._close();if($target.hasClass("period_day")){time=parseInt($target.data("time"));self.date_start={year:0,month:0,day:0,time:time};self.date_stop={year:0,month:0,day:0,time:time};self.is_down=true;self._highlight()}},_move:function(event){event.preventDefault();var self=this;if(self.is_down){var $target=$(event.target);if($target.hasClass("period_day")){var time;time=parseInt($target.data("time"));self.date_stop={year:0,month:0,day:0,time:time};self._highlight()}}},_up:function(event){event.preventDefault();var self=this;if(self.is_down){var date=new Date;date.setTime(self.date_start.time);self.date_start.year=date.getFullYear();self.date_start.month=date.getMonth();self.date_start.day=date.getDate();date.setTime(self.date_stop.time);self.date_stop.year=date.getFullYear();self.date_stop.month=date.getMonth();self.date_stop.day=date.getDate();self.is_down=false;clearTimeout(self.timer);self.timer=setTimeout(function(){self._change()},self.options.update_delay)}},_click:function(event){event.preventDefault();var self=this,$target=$(event.target);if($target.is("td"))if($target.text()!=""){var date=new Date;self.viewport.year=parseInt($target.data("year"));self.viewport.month=parseInt($target.data("month"));date=new Date(self.viewport.year,self.viewport.month,1,12,0,0,0);self.viewport.time=date.getTime();self.popup_fader.find("td.a").removeClass("a");$target.addClass("a");self.is_suspend=false;self._grid();self.date_start.year=self.viewport.year;self.date_start.month=self.viewport.month;self.date_start.day=self.viewport.day;self.date_start.time=self.viewport.time;date.setTime(self.viewport.time);date.setMonth(date.getMonth()+1);date.setDate(date.getDate()-1);self.date_stop.year=date.getFullYear();self.date_stop.month=date.getMonth();self.date_stop.day=date.getDate();self.date_stop.time=date.getTime();self.is_down=false;clearTimeout(self.timer);self.timer=setTimeout(function(){self._change()},self.options.update_delay)}},_change:function(event){var self=this,a=self.date_start.year*599040+(self.date_start.month+1)*46080+self.date_start.day*1440,b=self.date_stop.year*599040+(self.date_stop.month+1)*46080+self.date_stop.day*1440;self._trigger("change",{type:"change"},{date_start:a>b?b:a,date_stop:(a>b?a:b)+1439})},_enter:function(){var self=this;clearTimeout(self.timer_close);
10clearTimeout(self.timer_open);self.timer_open=setTimeout(function(){self._open()},self.options.open_delay)},_leave:function(){var self=this;clearTimeout(self.timer_open);clearTimeout(self.timer_close);self.timer_close=setTimeout(function(){self._close()},self.options.open_delay)},_body:function(event){var self=this,target=$(event.target);if(!target.closest(self.popup).length)if(!target.closest(self.container).length)self._close()},_open:function(){var self=this;if(!self.is_open){self.is_open=true;var html='<div class="period"><table>';html+="<tr>";html+="<th></th>";for(var y in self.options.data)html+="<th>"+y+"</th>";html+="</tr>";for(var m=0;m<12;m++){if(m%2==0)html+='<tr class="period_hl0">';else html+='<tr class="period_hl1">';html+="<th>"+self.txt.month_names[m]+"</th>";for(var y in self.options.data){html+="<td ";if(m in self.options.data[y]){if(!self.is_suspend&&y==self.viewport.year&&m==self.viewport.month)html+='class="a" ';html+='data-year="'+y+'" data-month="'+m+'">'+self.options.data[y][m]}else html+='class="d">';html+="</td>"}html+="</tr>"}html+="</table></div>";self.popup_fader.off().stop(true,true).html(html).on("mouseenter.x_popup",function(){self._enter()}).on("mouseleave.x_popup",function(){self._leave()}).on("click.x_popup",function(event){self._click(event)}).fadeIn(self.options.open_duration);self.popup.position({of:self.container,my:"right top",at:"left top",offset:"0 0"})}},_close:function(){var self=this;if(self.is_open){self.is_open=false;self.popup_fader.stop(true,true).fadeOut(self.options.open_duration)}},_tools_nodim:function(time){var n=28,date=new Date;date.setTime(time);year=parseInt(date.getFullYear());month=parseInt(date.getMonth());switch(month){case 0:case 2:case 4:case 6:case 7:case 9:case 11:n=31;break;case 3:case 5:case 8:case 10:n=30;break;case 1:if(year%4==0)if(year%100==0){if(year%400==0)n=29}else n=29;break}return n}})})(jQuery);(function($,undefined){$.widget("vp.x_photoalbum",{options:{'css_prefix':'','crop':true,'edit':true,'image_height':0,'image_width':0,'single':false},_create:function(){var self=this;self.validate_options();self.$list=$('<div class="'+self.options.css_prefix+'photoalbum_list clearfix"></div>').disableSelection().on('click',function(event){self.click(event);}).insertBefore(self.element);self.$ul=$('<ul></ul>').appendTo(self.$list);$('<li class="'+self.options.css_prefix+'photoalbum_list_item '+self.options.css_prefix+'photoalbum_list_item_new">'+'<div class="'+self.options.css_prefix+'photoalbum_new">'+'<div class="'+self.options.css_prefix+'photoalbum_image">'+'<div class="'+self.options.css_prefix+'photoalbum_image_upload">'+'Ïåðåòàùèòå ôîòî ñþäà<br>èëè<br><button class="iform_button">âûáåðèòå ôàéë</button>'+'<input type="file" name="file" size="1" title="Çàãðóçèòü" multiple="multiple">'+'<div class="'+self.options.css_prefix+'photoalbum_image_recent">'+'<a>Ïîêàçàòü ðàíåå çàãðóæåííûå èçîáðàæåíèÿ</a>'+'</div>'+'</div>'+'</div>'+'</div>'+'</li>').appendTo(self.$ul);self.list=JSON.parse(self.element.val());self.validate_list();self.update();if(!self.options.single){self.$ul.sortable({cancel:'.'+self.options.css_prefix+'photoalbum_list_item_new',stop:function(event,ui){self.reorder();self.update();}});}
11self.$ul.find('input[name="file"]').on('change',function(){self.upload(this);});},destroy:function(){},click:function(event){var self=this;var $target=$(event.target);if($target.hasClass('adm_panel_19_edit')){var $target=$target.closest('.'+self.options.css_prefix+'photoalbum_list_item');var i=$target.data('i');self.edit(i);}
12if($target.hasClass('adm_panel_19_hide')){var $target=$target.closest('.'+self.options.css_prefix+'photoalbum_list_item');var i=$target.data('i');if(self.options.single){self.list=[];}else{self.list[i].draft=true;}
13self.update();}
14if($target.hasClass('adm_panel_19_remove')){var $target=$target.closest('.'+self.options.css_prefix+'photoalbum_list_item');var i=$target.data('i');self.list[i]={};self.validate_list();self.update();}
15if($target.hasClass('adm_panel_19_show')){var $target=$target.closest('.'+self.options.css_prefix+'photoalbum_list_item');var i=$target.data('i');self.list[i].draft=false;
15self.update();}
16if($target.closest('.'+self.options.css_prefix+'photoalbum_image_recent').length){self.recent_show();}},edit:function(i){var self=this;self.i=i;if(self.options.crop&&self.list[self.i].src_original==''){JsHttpRequest.query(x_ajax_path+'ajax/adm/image/crop',{ajx_src:self.list[self.i].src,ajx_width:0,ajx_height:0},function(res,err){if(res){self.list[self.i].src_original=res.ajx_src;self.editor_show();}},true);}else{self.editor_show();}},reorder:function(){var self=this;var list=[];self.$ul.children('li:not(.'+self.options.css_prefix+'photoalbum_list_item_new)').each(function(){var i=$(this).data('i');list.push(self.list[i]);});self.list=list;},set:function(list){var self=this;self.list=list;self.validate_list();self.update();},update:function(){var self=this;self.$ul.children('li:not(.'+self.options.css_prefix+'photoalbum_list_item_new)').remove();var html='';if(self.options.single){self.$ul.children('li.'+self.options.css_prefix+'photoalbum_list_item_new').show();}
17for(var i in self.list){html+='<li class="'+self.options.css_prefix+'photoalbum_list_item'+(self.list[i].draft?' opacity50':'')+'" data-i="'+i+'">'+'<div class="'+self.options.css_prefix+'photoalbum">'+'<img alt="'+self.list[i].alt.replace(/"/g,'&quot;')+'" src="'+self.list[i].src+'">'+
18(self.list[i].alt.length==0?'':' <p>'+self.list[i].alt.replace(/"/g,'&quot;').substr(0,60)+'</p>')+'</div>'+'<div class="adm_panel_19 clearfix">'+
19(self.options.edit?'<a class="adm_panel_19_edit"></a>':'')+
20(self.list[i].draft?'<a class="adm_panel_19_show"></a><a class="adm_panel_19_remove"></a>':'<a class="adm_panel_19_hide"></a>')+'</div>'+'</li>';if(self.options.single){self.$ul.children('li.'+self.options.css_prefix+'photoalbum_list_item_new').hide();break;}}
21self.$ul.prepend(html);self.element.val(JSON.stringify(self.list));},upload:function(file){var self=this;JsHttpRequest.query(x_ajax_path+'ajax/adm/image/upload',{ajx_file:file,ajx_width:self.options.image_width,ajx_height:self.options.image_height},function(res,err){if(res){for(var i in res.ajx_url_list){self.list.push(self.validate_item({'src':res.ajx_url_list[i]}));}
22self.update();}},true);},validate_item:function(item){var self=this;var valid_item={};if(!self.is_object(item)){item={};}
23valid_item.src='src'in item?(self.is_string(item.src)?item.src:''):'';valid_item.src_original='src_original'in item?(self.is_string(item.src_original)?item.src_original:''):'';if(!('crop'in item)||!self.is_object(item.crop)){item.crop={};}
24valid_item.crop={};valid_item.crop.x='x'in item.crop?(self.is_number(item.crop.x)?Math.round(parseFloat(item.crop.x)||0):0):0;valid_item.crop.y='y'in item.crop?(self.is_number(item.crop.y)?Math.round(parseFloat(item.crop.y)||0):0):0;valid_item.crop.w='w'in item.crop?(self.is_number(item.crop.w)?Math.round(parseFloat(item.crop.w)||0):0):0;valid_item.crop.h='h'in item.crop?(self.is_number(item.crop.h)?Math.round(parseFloat(item.crop.h)||0):0):0;valid_item.alt='alt'in item?(self.is_string(item.alt)?item.alt:''):'';valid_item.draft='draft'in item?(self.is_boolean(item.draft)?item.draft:false):false;return valid_item;},validate_list:function(){var self=this;var list=[];if(self.is_array(self.list)){for(var i in self.list){var item=self.validate_item(self.list[i]);if(item.src!=''){list.push(item);}}}
25self.list=list;},validate_options:function(){var self=this;self.options.css_prefix=self.is_string(self.options.css_prefix)?self.options.css_prefix.replace(/[^a-z0-9_]/g,''):'';self.options.css_prefix=self.options.css_prefix.replace(/[^a-z0-9_]/g,'-').replace(/^-+/g,'').replace(/-+$/g,'').replace(/-{2,}/g,'-');if(self.options.css_prefix!=''){self.options.css_prefix='-'.self.options.css_prefix;}
26self.options.crop=self.is_boolean(self.options.crop)?self.options.crop:true;self.options.image_height=self.is_number(self.options.image_height)?parseInt(self.options.image_height)||0:0;self.options.image_width=self.is_number(self.options.image_width)?parseInt(self.options.image_width)||0:0;self.options.single=self.is_boolean(self.options.single)?self.options.single:false;},editor_apply:function(){var self=this;if(self.options.crop&&self.crop_is_changed){JsHttpRequest.query(x_ajax_path+'ajax
26/adm/image/crop',{ajx_src:self.list[self.i].src,ajx_crop:self.selection,ajx_width:self.options.image_width,ajx_height:self.options.image_height},function(res,err){if(res){self.list[self.i].src=res.ajx_src;self.list[self.i].crop=self.selection;self.list[self.i].alt=self.$modal.find('input[name="alt"]').val();self.list[self.i]=self.validate_item(self.list[self.i]);self.$modal.modal('close');self.update();}},true);}else{self.list[self.i].alt=self.$modal.find('input[name="alt"]').val();self.list[self.i]=self.validate_item(self.list[self.i]);self.$modal.modal('close');self.update();}},editor_crop:function(){var self=this;var aspect_ratio=self.options.image_width>0&&self.options.image_height>0?self.options.image_width/self.options.image_height:0;var box_width=Math.min($(window).width()-60,600);var box_height=Math.min($(window).height()-120,600);if(self.list[self.i].crop.w>0||self.list[self.i].crop.h>0){var selection=[self.list[self.i].crop.x,self.list[self.i].crop.y,self.list[self.i].crop.x+self.list[self.i].crop.w,self.list[self.i].crop.y+self.list[self.i].crop.h];}else{var image_object=new Image();image_object.src=self.$modal.find('img').attr('src');var native_width=image_object.width;var native_height=image_object.height;if(self.options.image_width==0||self.options.image_height==0){var selection=[0,0,native_width,native_height];}else{var k_width=native_width/self.options.image_width;var k_height=native_height/self.options.image_height;if(k_width>k_height){var selection=[(native_width-self.options.image_width*k_height)/2,0,(native_width-self.options.image_width*k_height)/2+self.options.image_width*k_height,native_height];}else{var selection=[0,(native_height-self.options.image_height*k_width)/2,native_width,(native_height-self.options.image_height*k_width)/2+self.options.image_height*k_width];}}}
27self.$modal.find('img').Jcrop({aspectRatio:aspect_ratio,boxHeight:box_height,boxWidth:box_width,onChange:function(c){self.selection=c;self.crop_is_changed=true;},onSelect:function(c){self.selection=c;self.crop_is_changed=true;},setSelect:selection});},editor_show:function(){var self=this;self.crop_is_changed=false;
27var html='<div class="iform draggable_cancel">'+
28(self.options.crop?'<div>'+'<img src="'+self.list[self.i].src_original+'">'+'</div>'+'<br>':'')+'<div class="iform_line">'+'<label>Àëüòåðíàòèâíûé òåêñò</label>'+'<input class="iform_input iform_w6" maxlength="400" name="alt" type="text" value="'+self.list[self.i].alt.replace(/"/g,'&quot;')+'">'+'</div>'+'<br>'+'<div class="iform_line">'+'<input class="iform_button" name="apply" type="button" value="Ïðèìåíèòü"> '+'<input class="iform_button" name="cancel" type="button" value="Îòìåíèòü">'+'</div>'+'</div>';self.$modal=$(html).on('modal:open',function(){if(self.options.crop){self.editor_crop();}
29self.$modal.on('click',function(event){var $target=$(event.target);if($target.hasClass('iform_button')){switch($target.attr('name')){case'apply':self.editor_apply();break;case'cancel':self.$modal.modal('close');break;}}});}).modal({'close':{'esc':true,'click':false,'icon':true},});},recent_show:function(){var self=this;self.recent_offset=0;JsHttpRequest.query(x_ajax_path+'ajax/adm/image/recent',{ajx_act:'start',ajx_width:self.options.image_width,ajx_height:self.options.image_height,ajx_offset:self.recent_offset},function(res,err){if(res){var html='<div class="box9"><div class="adm_image_list clearfix"><div class="adm_image_list_title">Ðàíåå çàãðóæåííûå èçîáðàæåíèÿ</div><ul>'+res.ajx_html+'</ul></div>'+(res.ajx_html==''?'':'<div class="adm_image_list_more"><a>Ïîêàçàòü åùå</a></div>')+'</div>';self.$modal=$(html).on('modal:open',function(){self.$modal.on('click',function(event){var $target=$(event.target);if($target.closest('.adm_image_list_more').length){self.recent_more();}
30if($target.is('img')){self.list.push(self.validate_item({'src':$target.data('src')}));self.update();self.$modal.modal('close');}});}).modal({'close':{'esc':true,'click':false,'icon':true},});}},true);},recent_more:function(){var self=this;var $ul=self.$modal.find('.adm_image_list ul');var $more=self.$modal.find('.adm_image_list_more');$ul.children('li.x').removeClass('x');self.recent_offset++;JsHttpRequest.query(x_ajax_path+'ajax/adm/image/recent',{ajx_act:'more',ajx_width:self.options.image_width,ajx_height:self.options.image_height,ajx_offset:self.recent_offset},function(res,err){if(res){if(res.ajx_html_more==''){$more.hide();}else{$more.show();}
31$ul.append(res.ajx_html);}},true);},is_array:function(value){return value&&typeof value==='object'&&value.constructor===Array;},is_boolean:function(value){return typeof value==='boolean';},is_number:function(value){return typeof value==='number'&&isFinite(value);},is_object:function(value){return value&&typeof value==='object'&&value.constructor===Object;},is_string:function(value){return typeof value==='string'||value instanceof String;}});})(jQuery);(function($,undefined){$.widget("vp.x_playlist",{_create:function(){var self=this;self.box=$("<div></div>").addClass("iform_audio").insertBefore(self.element);self._create_ul();self._create_file();self.popup=new Popup({});self._get_list();self._show_list()},destroy:function(){this.box.remove()},_create_ul:function(){var self=this;self.ul=$("<ul></ul>").appendTo(self.box);self.ul.disableSelection().on("click",function(event){var $target=$(event.target);if($target.hasClass("iform_audio_edit")){var $li=$target.closest("li"),i=parseInt($li.data("i")),html='<div class="popup_decor iform">'+'<div class="iform_line">'+"<label>\u0410\u0432\u0442\u043e\u0440</label>"+'<input type="text" name="f_composer" value="" class="iform_input w5" maxlength="75">'+"</div>"+'<div class="iform_line">'+"<label>\u041d\u0430\u0437\u0432\u0430\u043d\u0438\u0435</label>"+'<input type="text" name="f_name" value="" class="iform_input w5" maxlength="75">'+"</div>"+'<div class="iform_line">'+"<label>\u0418\u0441\u043f\u043e\u043b\u043d\u0438\u0442\u0435\u043b\u044c</label>"+'<input type="text" name="f_artist" value="" class="iform_input w5" maxlength="75">'+"</div>"+"<br>"+'<div class="iform_line">'+'<input type="hidden" name="f_i" value="'+i+'">'+'<input type="button" name="f_btn_apply" value="\u041f\u0440\u0438\u043c\u0435\u043d\u0438\u0442\u044c" class="iform_button">'+"</div>"+"</div>";self.popup.open({element:$target,content:html,my:"center",at:"center",of:window,action:"click",delay:100,effect:"fade",duration:200,active_element_class:"",hide_before_show:true});self.popup.popup.find('input[name="f_composer"]').val(self.list[i].composer),self.popup.popup.find('input[name="f_name"]').val(self.list[i].name),self.popup.popup.find('input[name="f_artist"]').val(self.list[i].artist),self.popup.popup.find('input[name="f_btn_apply"]').on("click",function(event){var composer=self.popup.popup.find('input[name="f_composer"]').val(),name=self.popup.popup.find('input[name="f_name"]').val(),artist=self.popup.popup.find('input[name="f_artist"]').val(),i=self.popup.popup.find('input[name="f_i"]').val();self.list[i].composer=composer.replace(/(<([^>]+)>)/ig,"");self.list[i].name=name.replace(/(<([^>]+)>)/ig,"");self.list[i].artist=artist.replace(/(<([^>]+)>)/ig,"");if(self.list[i].composer==""&&self.list[i].name==""&&self.list[i].artist=="")self.list[i].name="\u0410\u0443\u0434\u0438\u043e\u0444\u0430\u0439\u043b \u0431\u0435\u0437 \u043d\u0430\u0437\u0432\u0430\u043d\u0438\u044f";self._show_list();self._set_list();self.popup.close()})}if($target.hasClass("iform_audio_show")||$target.hasClass("iform_audio_hide")){var $li=$target.closest("li"),i=parseInt($li.data("i"));if(self.list[i].draft){self.list[i].draft=false;$li.removeClass("opacity50").find(".iform_audio_show").removeClass("iform_audio_show").addClass("iform_audio_hide")}else{self.list[i].draft=true;$li.addClass("opacity50").find(".iform_audio_hide").removeClass("iform_audio_hide").addClass("iform_audio_show")}self._set_list()}})},_create_file:function(){var self=this;self.file=$('<input type="file" name="f_file_playlist" id="f-file-playlist" size="1" title="\u0412\u044b\u0431\u0435\u0440\u0438\u0442\u0435 \u0430\u0443\u0434\u0438\u043e\u0444\u0430\u0439\u043b \u0434\u043b\u044f \u0437\u0430\u0433\u0440\u0443\u0437\u043a\u0438 \u0438\u043b\u0438 \u043f\u0435\u0440\u0435\u0442\u0430\u0449\u0438\u0442\u0435 \u0435\u0433\u043e \u0441\u044e\u0434\u0430 \u043c\u044b\u0448\u044c\u044e">').appendTo(self.box);$('<p class="cb"></p>').appendTo(self.box);self.recent=$('<a class="action">
31\u041f\u043e\u043a\u0430\u0437\u0430\u0442\u044c \u0440\u0430\u043d\u0435\u0435 \u0437\u0430\u0433\u0440\u0443\u0436\u0435\u043d\u043d\u044b\u0435 \u0430\u0443\u0434\u0438\u043e\u0444\u0430\u0439\u043b\u044b</a>').appendTo(self.box);self.file.x_file().on("change",function(){self._upload(this)});self.recent.on("click",function(event){self._recent(event)})},_get_list:function(){var self=this;var i,n=0,item,data=self.element.val().split(";");self.list=[];for(i in data){item=data[i];if(item.length>0){item=item.split(",");self.list[n]={"id":parseInt(item[0]),"composer":str_hex(item[1],true),"name":str_hex(item[2],true),"artist":str_hex(item[3],true),"draft":false};n++}}},_set_list:function(){var self=this,i,item,res="";for(i in self.list){item=self.list[i];if(!item.draft){if(res.length>0)res=res.concat(";");res=res.concat(item.id,",",str_hex(item.composer),",",str_hex(item.name),",",str_hex(item.artist))}}self.element.val(res)},_show_list:function(){var self=this;var html="",i,item,li,title;if(self.ul.hasClass("ui-sortable"))self.ul.sortable("destroy");self.ul.empty();for(i in self.list){item=self.list[i];title=[];if(item.composer.length>0)title.push(item.composer);if(item.name.length>0)title.push(item.name);if(item.artist.length>0)title.push(item.artist);title=title.join(". ").replace(/\.+/g,".");html+='<li id="audio-item-'+item.id+'" data-i="'+i+'"'+(item.draft?' class="opacity50"':"")+">"+'<p class="iform_audio_button iform_audio_edit"></p>'+'<p class="iform_audio_button iform_audio_'+
32(item.draft?"show":"hide")+'"></p>'+'<p class="iform_audio_title">'+title+"</p>"+'<p class="cb"></p>'+"</li>"}self.ul.html(html).sortable({stop:function(event,ui){self._reorder()},axis:"y",containment:"parent"})},_upload:function(file){var self=this;self.ul.append('<li><p class="iform_audio_upload"></p><p class="iform_audio_title">\u041e\u0436\u0438\u0434\u0430\u0439\u0442\u0435...</p><p class="cb"></p></li>');JsHttpRequest.query(x_ajax_path+"ajax/adm/audio/upload",{ajx_file:file},function(res,err){if(res){self.list.push({"id":res["ajx_id"],"composer":res["ajx_composer"],"name":res["ajx_name"],"artist":res["ajx_artist"],"draft":false});self._list_unique();self._show_list();self._set_list()}},true)},_reorder:function(){var self=this,arr=[],i;self.ul.find("li").each(function(){i=parseInt($(this).data("i"));arr.push(self.list[i])});self.list=arr;self._show_list();self._set_list()},_list_unique:function(file){var self=this,arr=[],i,j;for(i in self.list){var unique=true;for(j in arr)if(arr[j].id==self.list[i].id)unique=false;if(unique)arr.push(self.list[i]);else alert("\u0424\u0430\u0439\u043b "+self.list[i].name+" \u0443\u0436\u0435 \u0435\u0441\u0442\u044c \u0432 \u0441\u043f\u0438\u0441\u043a\u0435 \u0432\u043e\u0441\u043f\u0440\u043e\u0438\u0437\u0432\u0435\u0434\u0435\u043d\u0438\u044f")}self.list=arr},_recent:function(event){var self=this;var $target=$(event.target);JsHttpRequest.query(x_ajax_path+"ajax/adm/audio/recent",{ajx_act:"start",ajx_offset:0},function(res,err){if(res){self.popup.open({element:$target,content:'<div class="iform_audio_recent"><div><ul>'+
33res["ajx_recent_list"]+"</ul><p><a>\u041f\u043e\u043a\u0430\u0437\u0430\u0442\u044c \u0435\u0449\u0435</a></p></div></div>",my:"center",at:"center",of:window,action:"click",delay:100,effect:"fade",duration:200,active_element_class:"",hide_before_show:true});var $ul=self.popup.popup.find("ul"),$p=self.popup.popup.find("p");if(res["ajx_more"])$p.show();else $p.hide();$ul.on("click",function(event){self._recent_ul_click(event)});$p.on("click",function(event){self._recent_p_click(event)});self.recent_offset=1}},true)},_recent_ul_click:function(event){var self=this;var $target=$(event.target);if($target.is("a")){var item=$target.data("item").split(",");self.list.push({"id":parseInt(item[0]),"composer":str_hex(item[1],true),"name":str_hex(item[2],true),"artist":str_hex(item[3],true),"draft":false});self._list_unique();self._show_list();self._set_list();self.popup.close()}},_recent_p_click:function(event){var self=this;var $ul=self.popup.popup.find("ul"),$p=self.popup.popup.find("p");$ul.children(".x").removeClass("x");self.recent_offset++;JsHttpRequest.query(x_ajax_path+"ajax/adm/audio/recent",{ajx_act:"more",ajx_offset:self.recent_offset},function(res,err){if(res){if(res["ajx_more"])$p.show();else $p.hide();$ul.append(res["ajx_recent_list"])}},true)}})})(jQuery);(function(a){a.widget("vp.x_radiogroup",{options:{rem_class:"rem"},_create:function(){var a=this;a._change(!1);a.element.find("input").on("change.x_radiogroup",function(){a._change(!0)})},destroy:function(){this.element.find("input").off(".x_radiogroup")},_change:function(d){var b=this;this.element.find("input").each(function(){var c=a(this).attr("id");a(this).prop("checked")?(d&&b._trigger("change",{type:"change"},{value:c}),a("#"+c+"-for").removeClass(b.options.rem_class)):a("#"+c+"-for").addClass(b.options.rem_class)})}})})(jQuery);(function($,undefined){$.widget("vp.x_select",{options:{group:0,size:14,submit:false,target_url:""},_create:function(){var self=this;self.data=[];self.raw_data=[];self.filter={group:self.options.group};self.is_open=false;self.cursor=0;self.moratorium=false;
33self._data_init();self.element.hide();self.container=$("<div></div>").addClass("iform_select").insertBefore(self.element);self.input=$('<input type="text">').css({"width":"100%"}).prop("readonly",true).val(self.element.find(":selected").text()).on("click.x_select focus.x_select",function(){self._open()}).on("keydown.x_select",function(event){self._keydown(event)}).appendTo(self.container);if(self.element.attr("placeholder"))self.input.attr("placeholder",self.element.attr("placeholder"));var classList=self.element.attr("class").split(/\s+/);for(var i=0;i<classList.length;i++)if(classList[i].match(/w[012345]{1,3}/g))self.container.addClass(classList[i]);else self.input.addClass(classList[i]);self._arrow_init();self._popup_init()},destroy:function(){var self=this;self.popup_fader.off().empty();self.arrow.off().remove();self.input.off().remove();self.container.off().remove();self.popup_fader=null;self.popup=null;self.arrow=null;self.input=null;self.container=null;self.element.show();self.data=[];self.raw_data=[];self.filtered_data=[];self.filter={group:0};self.is_open=false;self.cursor=0;self.moratorium=false;$.Widget.prototype.destroy.call(self)},set_value:function(value){var self=this,old=self.element.val(),text=value in self.raw_data?self.raw_data[value]:"";self.element.val(value);self.input.val(text);if(value!==old)self._trigger("change",{type:"change"},{value:value});if(self.options.submit)this.element.closest("form").submit();if(self.options.target_url.length>0)location.href=self.options.target_url.replace("[value]",val).replace("://0.","://").replace("://.","://")},set_group:function(group){var self=this;if(group!==self.filter.group){self.filter.group=group;if(group!=0)self.set_value(0)}},_data_init:function(){var self=this,v,t,options;self.data=[];self.raw_data=[];options=[];self.element.children("option").each(function(){t=$(this).text();if(t!==""){v=$(this).val();options.push({value:v,title:t});self.raw_data[v]=t}});self.data.push({value:0,title:"",options:options});self.element.children("optgroup").each(function(){options=[];$(this).children("option").each(function(){t=$(this).text();if(t!==""){v=$(this).val();options.push({value:v,title:t});self.raw_data[v]=t}});t=$(this).attr("title");self.data.push({value:t,title:$(this).attr("label"),options:options})})},_data_filter:function(){var self=this,i,j;self.filtered_data=[];if(self.filter.group==0)self.filtered_data=self.data;else for(i in self.data)if(self.data[i].value==self.filter.group){self.filtered_data[i]={value:self.data[i].value,title:self.data[i].title,options:[]};for(j in self.data[i].options)self.filtered_data[i].options[j]=self.data[i].options[j];break}},_open:function(){var self=this;if(!self.moratorium){var val=self.input.val();if(!self.is_open){self.is_open=true;self.popup.position({of:self.input,my:"left top",at:"left bottom"}).css({"width":self.input.outerWidth(true)});self.popup_fader.stop(true,true).fadeIn(200);self._data_filter();self._list();$(document).on("mousedown.x_select",function(event){self._elsewhere_click(event)})}}},_close:function(){var self=this;self.is_open=false;$(document).off("mousedown.x_select");self.popup_fader.off().stop(true,true).fadeOut(200)},_list:function(){var self=this,i,j,n=0,html="";self.cursor=0;self.popup_fader.off().empty();self.select=$("<select></select>").addClass("iform_input").css({"width":"100%"}).on("click.x_select",function(event){self._popup_click(event)}).on("focus.x_select",function(event){self._popup_focus(event)}).appendTo(this.popup_fader);for(j in self.filtered_data)if(j==0)for(i in self.filtered_data[j].options){html+='<option value="'+self.filtered_data[j].options[i].value+'">'+self.filtered_data[j].options[i].title+"</option>";n++}else{html+='<optgroup label="'+self.filtered_data[j].title+'">';for(i in self.filtered_data[j].options){html+='<option value="'+self.filtered_data[j].options[i].value+'">'+self.filtered_data[j].options[i].title+"</option>";n++}html+="</optgroup>";n++}if(n==0)self.select.hide();else{self.select.show();n=self._adjust_size(n);self.select.attr("size",n).html(html).val(0).val(self.element.val());self.cursor=self.select.find("option").index(self.select.find("option:selected"))+1}},_adjust_size:function(n){var self=this,size=self.options.size;if(n<size)size=n;if(size<2)size=2;return size},_keydown:function(event){var self=this;if(self.is_open)switch(event.keyCode){case 9:self._close();break;case 13:event.preventDefault();var $selected=self.select.find(":selected");if($selected.length){self.set_value($selected.val());self._close()}break;case 27:self._close();break;case 38:event.preventDefault();var $options=self.select.find("option");n=$options.length;if(self.cursor>1)self.cursor--;if(self.cursor>n)self.cursor=n;$options.filter(":selected").removeProp("selected");$options.eq(self.cursor-1).prop("selected",true);break;case 40:event.preventDefault();var $options=self.select.find("option");n=$options.length;if(self.cursor<n)self.cursor++;if(self.cursor<1)self.cursor=1;$options.filter(":selected").removeProp("selected");$options.eq(self.cursor-1).prop("selected",true);break}else switch(event.keyCode){case 40:event.preventDefault();self._open();break}},_arrow_init:function(){var self=this;self.arrow=$("<div></div>").addClass("iform_select_arrow").appendTo(self.container).on("click.x_select",function(){self._arrow_click()})},_arrow_click:function(){var self=this;self.moratorium=true;self.input.focus();self.moratorium=false;self._open()},_popup_init:function(){var self=this;var popup=$("#iform-popup-select");if(popup.length){self.popup=popup;self.popup_fader=self.popup.find("div")}
33else{self.popup=$("<div></div>").attr("id","iform-popup-select").addClass("iform_popup").addClass("iform").appendTo($("body"));self.popup_fader=$("<div></div>").appendTo(this.popup).hide()}},_popup_click:function(event){var self=this,$target=$(event.target);self.set_value($target.val());self._close()},_popup_focus:function(event){var self=this;self.moratorium=true;self.input.focus();self.moratorium=false},_elsewhere_click:function(event){var self=this,$target=$(event.target);if($target.closest(self.input).length==0)if($target.closest(self.popup).length==0)self._close()}})})(jQuery);(function($,undefined){$.widget("vp.x_select_filter",{options:{data_url:'',group:0,size:14,submit:false,tags_below:false,target_url:'',zindex:0},_create:function(){var self=this;self.data=[];self.raw_data=[];self.filter={group:self.options.group,text:''};self.is_open=false;self.cursor=0;self.moratorium=false;self.multiple=self.element.prop('multiple');self.cached_data_pattern3=[];self._data_init();self.element.hide();self.container=$("<div></div>").addClass("iform_select").insertBefore(self.element);self.input=$('<input type="text">').css({'width':'100%'}).on("click.x_select_filter focus.x_select_filter",function(){self._open()}).on("keydown.x_select_filter",function(event){self._keydown(event)}).on("keyup.x_select_filter",function(event){self._keyup(event)}).appendTo(self.container);if(!self.multiple){self.input.val(self.element.find(":selected").text());}
34if(self.element.attr('placeholder')){self.input.attr('placeholder',self.element.attr('placeholder'));}
35var classList=self.element.attr('class').split(/\s+/);for(var i=0;i<classList.length;i++){if(classList[i].match(/w[012345]{1,3}/g)){self.container.addClass(classList[i]);}else{self.input.addClass(classList[i]);}}
36self._arrow_init();self._popup_init();self._tags_init();},destroy:function(){var self=this;clearTimeout(self.timer);self.popup_fader.off().empty();self.arrow.off().remove();self.input.off().remove();self.container.off().remove();self.popup_fader=null;self.popup=null;self.arrow=null;self.input=null;self.container=null;self.element.show();self.data=[];self.raw_data=[];self.filtered_data=[];self.filter={group:0,text:''};self.is_open=false;self.cursor=0;self.moratorium=false;$.Widget.prototype.destroy.call(self);},add_value:function(id,title){var self=this;if(id in self.raw_data){}else{self.data.push({id,title});self.raw_data[id]=title;self.element.append('<option value='+id+'>'+title+'</option>');self.data.sort(function(a,b){var a_title=a.title.toLowerCase();var b_title=b.title.toLowerCase();if(a_title<b_title){return-1;}else if(a_title>b_title){return 1;}
37return 0;});if(self.is_open&&data_changed){self._data_filter();self._list();}}
38self.set_value(id);},set_value:function(value){var self=this,val_old=self.element.val();if(self.multiple){if(!val_old)val_old=[];if(value!=0){if(val_old.indexOf(value)<0){self.filter.text='';self.input.val('');val_old.push(value);self.element.val(val_old);self._trigger("change",{type:"change"},{value:value});self._tags_to_html(value);}}}else{if(value!==val_old){var text=value in self.raw_data?self.raw_data[value]:'';self.filter.text=text;self.input.val(text);self.element.val(value);self._trigger("change",{type:"change"},{value:value});if(value==0)
39self.arrow.removeClass('iform_select_cross').addClass('iform_select_arrow');else
40self.arrow.removeClass('iform_select_arrow').addClass('iform_select_cross');if(self.options.submit){this.element.closest("form").submit();}
41if(self.options.target_url.length>0){location.href=self.options.target_url.replace("[value]",value).replace("://0.","://").replace("://.","://");}}}},unset_value:function(value){var self=this;if(self.multiple){var val_old=self.element.val(),val_new=[],i;if(!val_old)val_old=[];for(i in val_old){if(val_old[i]!=value){val_new.push(val_old[i]);}}
42self.element.val(val_new);if(val_new.length==0){self._trigger("change",{type:"change"},{value:0});}else{self._trigger("change",{type:"change"},{value:value});}
43self._tags_to_html(0);}else{self.set_value(0);}},set_group:function(group){var self=this;if(group!==self.filter.group){self.filter.group=group;if(group!=0){self._approve();}}},_data_init:function(){var self=this,v,t,options;self.data=[];self.raw_data=[];self.element.children("option,optgroup").each(function(){if($(this).is('option')){t=$(this).text();if(t!==''){v=$(this).val();self.data.push({value:v,title:t});self.raw_data[v]=t;}}else{options=[];$(this).children("option").each(function(){t=$(this).text();if(t!==''){v=$(this).val();options.push({value:v,title:t});self.raw_data[v]=t;}});t=$(this).attr("title");
43self.data.push({value:t,title:$(this).attr("label"),options:options});}});},_data_load:function(){var self=this,i;if(self.options.data_url.length>0&&self.filter.text.length>2){if(!self._in_array(self.cached_data_pattern3,self.filter.text.substring(0,3))){JsHttpRequest.query(x_ajax_path+self.options.data_url,{ajx_pattern:self.filter.text},function(res,err){if(res){self.cached_data_pattern3.push(res.ajx_pattern3);var data_changed=false;for(i in res.ajx_data){if(res.ajx_data[i].id in self.raw_data){}else{self.data.push({value:res.ajx_data[i].id,title:res.ajx_data[i].title});self.raw_data[res.ajx_data[i].id]=res.ajx_data[i].title;self.element.append('<option value='+res.ajx_data[i].id+'>'+res.ajx_data[i].title+'</option>');data_changed=true;}}
44if(data_changed){self.data.sort(function(a,b){var a_title=a.title.toLowerCase();var b_title=b.title.toLowerCase();if(a_title<b_title){return-1;}else if(a_title>b_title){return 1;}
45return 0;});}
46if(self.is_open&&data_changed){self._data_filter();self._list();}}},true);}}},_data_filter:function(){var self=this,i,j,options;self.filtered_data=[];if(self.filter.group==0){if(self.filter.text.length==0){self.filtered_data=self.data;}else{var re=self.filter.text;for(j in self.data){if('options'in self.data[j]){if(self._fuzzy_search(self.data[j].title,re)){options=[];for(i in self.data[j].options){options[i]={value:self.data[j].options[i].value,title:self.data[j].options[i].title};}
47self.filtered_data[j]={value:self.data[j].value,title:self.data[j].title,options:options};}else{var clear=true;for(i in self.data[j].options){if(self._fuzzy_search(self.data[j].options[i].title,re)){if(clear){self.filtered_data[j]={value:self.data[j].value,title:self.data[j].title,options:[]};clear=false;}
48self.filtered_data[j].options[i]={value:self.data[j].options[i].value,title:self.data[j].options[i].title};}}}}else{if(self._fuzzy_search(self.data[j].title,re)){self.filtered_data[j]={value:self.data[j].value,title:self.data[j].title};}}}}}else{for(i in self.data){if(self.data[i].value==self.filter.group){if(self.filter.text.length==0){self.filtered_data[i]={value:self.data[i].value,title:self.data[i].title,options:[]};for(j in self.data[i].options){self.filtered_data[i].options[j]={value:self.data[i].options[j].value,title:self.data[i].options[j].title};}}else{var re=self.filter.text;if('options'in self.data[i]){if(self._fuzzy_search(self.data[i].title,re)){self.filtered_data[i]={value:self.data[i].value,title:self.data[i].title,options:[]};for(j in self.data[i].options){self.filtered_data[i].options[j]={value:self.data[i].options[j].value,title:self.data[i].options[j].title};}}else{var clear=true;for(j in self.data[i].options){if(self._fuzzy_search(self.data[i].options[j].title,re)){if(clear){self.filtered_data[i]={value:self.data[i].value,title:self.data[i].title,options:[]};clear=false;}
49self.filtered_data[i].options[j]={value:self.data[i].options[j].value,title:self.data[i].options[j].title};}}}}else{if(self._fuzzy_search(self.data[i].title,re)){self.filtered_data[i]={value:self.data[i].value,title:self.data[i].title};}}}}}}},_data_exact_fit:function(){var self=this,val=self.input.val().toLowerCase(),i,exact_fit=0;if(val.length!==0){for(i in self.raw_data){if(self.raw_data[i].toLowerCase()==val){exact_fit=i;break;}}}
50return exact_fit;},_open:function(){var self=this;clearTimeout(self.timeout);if(!self.moratorium){var val=self.input.val();if(self.is_open){if(self.filter.text!==val){self.filter.text=val;self._data_load();self._data_filter();self._list()}}else{self.is_open=true;self.popup.position({of:self.input,my:"left top",at:"left bottom"}).css({'width':self.input.outerWidth(true)});self.popup_fader.stop(true,true).fadeIn(200);self.filter.text=val;self._data_load();self._data_filter();self._list();$(document).on("mousedown.x_select_filter",function(event){self._elsewhere_click(event);})}}},_close:function(){var self=this;clearTimeout(self.timer);self.is_open=false;$(document).off("mousedown.x_select_filter");self.popup_fader.off().stop(true,true).fadeOut(200);},_list:function(){var self=this,i,j,n=0,html='';self.cursor=0;self.popup_fader.off().empty();self.select=$("<select></select>").addClass("iform_input").css({"width":"100%"}).on("click.x_select_filter",function(event){self._popup_click(event);}).on("focus.x_select_filter",function(event){self._popup_focus(event)}).appendTo(this.popup_fader);for(j in self.filtered_data){if('options'in self.filtered_data[j]){html+='<optgroup label="'+self.filtered_data[j].title+'">';
50for(i in self.filtered_data[j].options){html+='<option value="'+self.filtered_data[j].options[i].value+'">'+self.filtered_data[j].options[i].title+"</option>";n++;}
51html+="</optgroup>";n++;}else{html+='<option value="'+self.filtered_data[j].value+'">'+self.filtered_data[j].title+"</option>";n++;}}
52if(n==0){self.select.hide();}else{self.select.show();n=self._adjust_size(n);self.select.attr("size",n).html(html);}},_adjust_size:function(n){var self=this,size=self.options.size;if(n>self.options.size)n=self.options.size;if(n<2)n=2;return n;},_approve:function(){var self=this,exact_fit=self._data_exact_fit();if(exact_fit==0){self.input.val('');}else{self.set_value(exact_fit);}},_keydown:function(event){var self=this;if(self.is_open){switch(event.keyCode){case 9:self._approve();self._close();break;case 13:event.preventDefault();var $selected=self.select.find(":selected");if($selected.length){self.set_value($selected.val());self._close();}
53break;case 27:self._close();break;case 38:event.preventDefault();var $options=self.select.find("option"),n=$options.length;if(self.cursor>1){self.cursor--;}
54if(self.cursor>n){self.cursor=n;}
55$options.filter(":selected").removeProp("selected");$options.eq(self.cursor-1).prop("selected",true);break;case 40:event.preventDefault();var $options=self.select.find("option"),n=$options.length;if(self.cursor<n){self.cursor++;}
56if(self.cursor<1){self.cursor=1;}
57$options.filter(":selected").removeProp("selected");$options.eq(self.cursor-1).prop("selected",true);break;}}else{switch(event.keyCode){case 40:event.preventDefault();self._open();break;}}},_keyup:function(event){var self=this,val=self.input.val();clearTimeout(self.timer);self.timer=setTimeout(function(){if(self.filter.text!==val){self._open();}},250);},_arrow_init:function(){var self=this;self.arrow=$("<div></div>").addClass(self.element.val()==0||self.multiple?"iform_select_arrow":"iform_select_cross").appendTo(self.container).on("click.x_select_filter",function(){self._arrow_click();});},_arrow_click:function(){var self=this;if(self.multiple){self.moratorium=true;self.input.val('').focus();self.arrow.removeClass('iform_select_cross').addClass('iform_select_arrow');self.moratorium=false;self._open();}else{if(self.element.val()==0){self.moratorium=true;self.element.val(0);self.input.val('').focus();self.arrow.removeClass('iform_select_cross').addClass('iform_select_arrow');self.moratorium=false;self._open();}else{self.moratorium=true;self.element.val(0);self.input.val('');self.arrow.removeClass('iform_select_cross').addClass('iform_select_arrow');self.moratorium=false;self._open();}}},_popup_init:function(){var self=this;var popup=$("#iform-popup-select");if(popup.length){self.popup=popup;self.popup_fader=self.popup.find("div");}else{self.popup=$("<div></div>").attr("id","iform-popup-select").addClass("iform_popup").addClass("iform").appendTo($("body"));if(self.options.zindex!=0)
58self.popup.css({'z-index':self.options.zindex});else
59self.popup.css({'z-index':''});self.popup_fader=$("<div></div>").appendTo(this.popup).hide();}},_popup_click:function(event){var self=this,$target=$(event.target);self.set_value($target.val());self._close();},_popup_focus:function(event){var self=this;self.moratorium=true;self.input.focus();self.moratorium=false},_tags_init:function(){var self=this;if(self.multiple){self.tags_data=[];if(self.options.tags_below){self.tags_container=$("<div></div>").addClass("iform_select_tags_below").insertAfter(self.container);}else{self.tags_container=$("<div></div>").addClass("iform_select_tags").insertBefore(self.container);}
60self._tags_to_html(0);}},_tags_to_html:function(value){var self=this;var val=self.element.val(),tags_data=[],html='',i;if(!val)val=[];for(i in val){if(val[i]in self.raw_data){tags_data.push({val:val[i],text:self.raw_data[val[i]]});}}
61self.tags_data=tags_data;self.tags_container.off().empty();if(self.tags_data.length>0){var ul=$("<ul></ul>").on("click.x_select_filter",function(event){self._tags_click(event);}).appendTo(self.tags_container);$("<p>").addClass("cb").appendTo(self.tags_container);for(i in self.tags_data){html+="<li"+(self.tags_data[i].val==value?' class="x"':'')+"><span>"+self.tags_data[i].text+'</span><a>&#10005;<i title="'+self.tags_data[i].val+'"></i></a><br class="cb"></li>';}
62ul.html(html);if(value!=0){self.tags_container.find("li.x").slideDown(200,function(){$(this).removeClass("x");});}}},_tags_click:function(event){var self=this,$target=$(event.target);if($target.is("a")){self.unset_value($target.find("i").attr("title"))}},_elsewhere_click:function(event){var self=this,$target=$(event.target);if($target.closest(self.input).length==0){if($target.closest(self.popup).length==0){self._approve();self._close();}}},_in_array:function(haystack,needle){var i,l=haystack.length;for(i=0;i<l;i++){if(haystack[i]==needle)return true;}
63return false;},_fuzzy_search:function(haystack,needle){var self=this;var j,k,l,pattern,replace,regex,tokens;haystack=String(haystack).replace(String.fromCharCode(160),' ').replace(/¸/g,'å').replace(/¨/g,'Å').replace(/[^0-9a-zA-Zà-ÿÀ-ß ]/g,'');needle=String(needle).replace(/¸/g,'å').replace(/¨/g,'Å').replace(/[^0-9a-zA-Zà-ÿÀ-ß ]/g,'');if(needle.length==0||haystack.length==0)return false;var ok=false;regex=new RegExp('^'+needle.substring(0,3),"img");if(regex.test(haystack)){ok=true;}else{regex=new RegExp(' '+needle.substring(0,3),"img");if(regex.test(haystack)){ok=true;}}
64if(!ok)return false;regex=new RegExp(needle,"img");if(regex.test(haystack))return true;tokens=needle.split(' ');pattern=tokens.join(".*?");regex=new RegExp(pattern,"img");if(regex.test(haystack))return true;var needle_a=needle.substring(0,2);var needle_b=needle.substring(2);tokens=needle_b.split('');tokens[0]=needle_a+tokens[0];pattern=tokens.join(".*?");regex=new RegExp(pattern,"img");if(regex.test(haystack))return true;return false;}});})(jQuery);(function($,undefined){$.widget("vp.x_set",{options:{},_create:function(){var self=this;self._change();self.timer;self.element.find("input").on("blur.x_set change.x_set keyup.x_set",function(){clearTimeout(self.timer);self.timer=setTimeout(function(){self._change()},500)})},destroy:function(){var self=this;self.element.find("input").off("blur.x_set change.x_set keyup.x_set")},_change:function(){var self=this;var i,j,k;var $items=self.element.children("div"),$item,count=$items.length;for(i=0;i<count;i++){$item=$items.eq(i);$item.show();if(self._is_item_empty($item)){for(j=i+1;j<count;j++){$item_j=$items.eq(j);if(!self._is_item_empty($item_j)){k=0;$item_j.find("input").each(function(){switch($(this).attr("type")){case"text":case"password":$item.find("input").eq(k).val($(this).val());$(this).val("");break;case"checkbox":$item.find("input").eq(k).prop("checked",$(this).prop("checked"));$(this).prop("checked",false);break}k++});k=0;$item_j.find("textarea").each(function(){$item.find("textarea").eq(k).val($(this).val());$(this).val("");k++});break}}if(self._is_item_empty($item)){for(j=i+1;j<count;j++)$items.eq(j).hide();break}}}},_is_item_empty:function($item){var self=this;res=true;$item.find("input").each(function(){switch($(this).attr("type")){case"text":case"password":if($(this).val()!="")res=false;break;case"checkbox":if($(this).prop("checked"))res=false;break}});$item.find("textarea").each(function(){if($(this).val()!="")res=false});return res}})})(jQuery);(function($,undefined){$.widget("vp.x_table",{options:{structure:[{type:"text",title:"\u041d\u0430\u0437\u0432\u0430\u043d\u0438\u0435"}],image_width:50,nicEditor:{buttonList:[],iconsPath:"",maxHeight:"",purifyScript:"",purifyMode:"",rootClass:""}},_create:function(){var self=this;self.box=$("<div></div>").css({"position":"relative","overflow":"hidden"}).addClass("iform_table").insertBefore(self.element);self.phantom_textarea=$("<textarea></textarea>").css({"position":"absolute","width":"90px","left":"-100px"}).appendTo(self.box);self.phantom_textarea.on("change keyup",function(event){self._phantom_textarea_change(event)}).on("paste",function(){setTimeout(function(){self._phantom_paste()},50)});self._data_get();self._table_init();self._table_show();self.element.hide();self.cursor={x:0,y:0};self.fullscreen=true;self.status=0},destroy:function(){this.box.remove()},set_data:function(data,mode){var self=this;mode=mode||false;if(mode)self.element.val(self.element.val()+data);else self.element.val(data);self._data_get();self._table_show()},_data_get:function(){var self=this;var y,x,rows=self.element.val().split("\n"),cells=[];self.data=[];for(y in rows){self.data[y]=[];cells=rows[y].split("\t");for(x in self.options.structure)if(typeof cells[x]=="undefined")self.data[y][x]="";else self.data[y][x]=cells[x]}},_data_set:function(){var self=this;var y,arr=[],empty_row=true;
64for(y in self.data)arr[y]=self.data[y].join("\t");self.element.val(arr.join("\n").replace(/[\n\t]+$/,"\n"));for(y in self.data[self.data.length-1])if(self.data[self.data.length-
651][y]!="")empty_row=false;if(!empty_row)self._table_add_row()},_table_init:function(){var self=this;var x,html="";self.table=$("<table></table>").appendTo(self.box);html+="<thead><tr>";for(x in self.options.structure)html+="<td>"+self.options.structure[x]["title"]+"</td>";html+="</tr></thead>";self.table.append(html);self.tbody=$("<tbody></tbody>").appendTo(self.table);self.tbody.on("click",function(event){self._table_click(event)});$(document).on("mousedown.x_table",function(event){self._click(event)}).on("keydown.x_table",function(event){self._keydown(event)})},_table_show:function(){var self=this;var y,x,html="",row;for(y in self.data){row=self.data[y];html+="<tr>";for(x in self.options.structure)switch(self.options.structure[x]["type"]){case"image":html+='<td class="iform_table_image">';html+='<div class="iform_table_upload"'+(row[x]==""?"":'style="border:1px dashed transparent"')+">";html+='<img src="'+(row[x]==""?"i/t.gif":row[x])+'">';html+='<input type="file" name="f_file_'+y+"_"+x+'[]" id="f-file-'+y+"-"+x+'" size="1" title="\u0417\u0430\u0433\u0440\u0443\u0437\u0438\u0442\u044c" multiple="multiple">';html+="</div></td>";break;case"int":case"price":case"text":html+="<td>"+self._escape_html(row[x])+"</td>";break;case"html":html+="<td>"+self._preview_html(row[x])+"</td>";break}html+="</tr>"}self.tbody.html(html);self.tbody.find("input").on("change",function(){self._upload(this)})},_table_add_row:function(){var self=this;var y=self.data.length,x,html="";html+="<tr>";self.data[y]=[];for(x in self.options.structure){self.data[y][x]="";switch(self.options.structure[x]["type"]){case"image":html+='<td><div class="iform_table_upload">';html+='<img src="i/t.gif">';html+='<input type="file" name="f_file_'+y+"_"+x+'[]" id="f-file-'+y+"-"+x+'" size="1" title="\u0417\u0430\u0433\u0440\u0443\u0437\u0438\u0442\u044c" multiple="multiple">';html+="</div></td>";break;case"int":case"price":case"text":case"html":html+="<td></td>";break}}html+="</tr>";self.tbody.append(html);self.tbody.find("tr").eq(y).find("input").on("change",function(){self._upload(this)})},_table_click:function(event){var self=this;var $target=$(event.target),$td=$target.closest("td"),$tr=$target.closest("tr"),x=parseInt($tr.find("td").index($td)),y=parseInt(self.tbody.find("tr").index($tr));if(!$td.closest("table").is(self.table))return;switch(self.status){case 0:event.preventDefault();self.status=1;self.cursor.x=x;self.cursor.y=y;self._cursor_show();break;case 1:if(x==self.cursor.x&&y==self.cursor.y)self._editor_open();else{event.preventDefault();self.cursor.x=x;self.cursor.y=y;self._cursor_show()}break;case 2:if(x!=self.cursor.x||y!=self.cursor.y){self._editor_close();self.cursor.x=x;self.cursor.y=y;self._cursor_show()}break}},_cursor_show:function(event){var self=this;self.tbody.find(".iform_table_selected").removeClass("iform_table_selected");self.tbody.find(".iform_table_active").removeClass("iform_table_active");switch(self.status){case 1:self.tbody.find("tr").eq(self.cursor.y).find("td").eq(self.cursor.x).addClass("iform_table_selected");self.phantom_textarea.val(self.data[self.cursor.y][self.cursor.x]).position({my:"left-100 top",at:"left top",of:self.tbody.find("tr").eq(self.cursor.y)}).select();break;case 2:self.tbody.find("tr").eq(self.cursor.y).find("td").eq(self.cursor.x).addClass("iform_table_active");break}},_editor_open:function(select){var self=this;if(self.status==2)self._editor_close();if(self.status==1)switch(self.options.structure[self.cursor.x]["type"]){case"int":case"price":case"text":var $td=self.tbody.find("tr").eq(self.cursor.y).find("td").eq(self.cursor.x);var w=$td.width(),h=$td.height();if(w<50)w=75;if(h<16)h=20;$td.empty();self.textarea=$("<textarea></textarea>").appendTo($td);self.textarea.css({"width":w+"px","height":h+"px"}).focus().val(self.data[self.cursor.y][self.cursor.x]);$td.css({"width":w+"px"});if(select)self.textarea.select();self.status=2;self._cursor_show();break;case"html":var $td=self.tbody.find("tr").eq(self.cursor.y).find("td").eq(self.cursor.x);var w=$td.width(),h=$td.height();if(h<16)h=20;$td.empty();var $div=$('<div style="margin:0 14px 0 0"></div>').appendTo($td);if(self.fullscreen){$div.addClass("iform_table_fullscreen");$("body").addClass("noscroll")}self.textarea=$("<textarea></textarea>").appendTo($div);self.textarea.css({"height":(self.fullscreen?$(window).height()-200:h)+"px"}).val("<br>"+self.data[self.cursor.y][self.cursor.x]+"<br>");self.options.nicEditor.maxHeight=$(window).height()-200;self.nicEditor=(new nicEditor(self.options.nicEditor)).panelInstance(self.textarea[0]);$(self.nicEditor.nicInstances[0].elm).focus();$td.css({"width":"75%"});if(select)self.textarea.select();var $panel=$('<div class="iform_table_buttons"></div>').appendTo($div);var $a=$("<a>\u041d\u0430 \u0432\u0435\u0441\u044c \u044d\u043a\u0440\u0430\u043d</a>").appendTo($panel);$a.on("click",function(event){if(self.fullscreen){$div.removeClass("iform_table_fullscreen");$("body").removeClass("noscroll");self.fullscreen=false}else{$div.addClass("iform_table_fullscreen");$("body").addClass("noscroll");self.fullscreen=true}});var $a=$("<a>
65\u041f\u0440\u0438\u043c\u0435\u043d\u0438\u0442\u044c</a>").appendTo($panel);$a.on("click",function(event){self._editor_close()});self.status=2;self._cursor_show();break}},_editor_close:function(){var self=this;if(self.status==2){$("body").removeClass("noscroll");var $td=self.tbody.find("tr").eq(self.cursor.y).find("td").eq(self.cursor.x);switch(self.options.structure[self.cursor.x]["type"]){case"int":case"price":case"text":self.data[self.cursor.y][self.cursor.x]=self.textarea.val().replace(/[\t\n\r]+/g," ").replace(/\s{2,}/g," ").replace(/^\s/g,"").replace(/\s$/g,"");$td.text(self.data[self.cursor.y][self.cursor.x]);$td.css({"width":"auto"});break;case"html":self.data[self.cursor.y][self.cursor.x]=x_purify($(self.nicEditor.nicInstances[0].elm)).replace(/[\t\n\r]+/g," ").replace(/\s{2,}/g," ").replace(/^\s/g,"").replace(/\s$/g,"");self.nicEditor.removeInstance(self.textarea[0]);$td.text(self._preview_html(self.data[self.cursor.y][self.cursor.x]));$td.css({"width":"auto"});var regex=/<img.*?src="(.*?)"/;var match=regex.exec(self.data[self.cursor.y][self.cursor.x]);if(match&&1 in match){var src=match[1];for(var x in self.options.structure)switch(self.options.structure[x]["type"]){case"image":if(self.data[self.cursor.y][x]==""||self.data[self.cursor.y][x]=='<img src="i/t.gif">'){self.data[self.cursor.y][x]=src;var $td=self.tbody.find("tr").eq(self.cursor.y).find("td").eq(x);$td.find("img").attr("src",src).closest("div").css({border:"1px solid transparent"})}break}}break}self._data_set();self.status=1;self._cursor_show()}},_upload:function(input){var self=this;if(self.status==3)return;if(self.status==2)self._editor_close();var $td=$(input).closest("td"),$tr=$(input).closest("tr");self.cursor.x=$tr.find("td").index($td);self.cursor.y=self.tbody.find("tr").index($tr);self.status=1;self._cursor_show();self.status=3;JsHttpRequest.query(x_ajax_path+"ajax/adm/image/upload",{ajx_file:input,ajx_width:self.options.image_width,ajx_height:self.options.image_width},function(res,err){if(res){var y,y_table;for(y in res["ajx_url_list"]){y=parseInt(y);y_table=y+self.cursor.y;if(y_table>=self.data.length)self._table_add_row();var $td=self.tbody.find("tr").eq(y_table).find("td").eq(self.cursor.x);self.data[y_table][self.cursor.x]=res["ajx_url_list"][y];$td.find("img").attr("src",res["ajx_url_list"][y]).closest("div").css({border:"1px solid transparent"})}self._data_set();self.status=1;self._cursor_show()}},true)},_paste:function(){var self=this;var y,x,y_table,x_table,rows=self.textarea.val().split("\n"),cells=[];for(y in rows){y=parseInt(y);cells=rows[y].split("\t");for(x in cells){x=parseInt(x);y_table=y+self.cursor.y;x_table=x+self.cursor.x;if(y_table>=self.data.length)self._table_add_row();if(x_table>=self.options.structure.length){x_table=self.options.structure.length-1;switch(self.options.structure[x_table]["type"]){case"int":case"price":case"text":case"html":if(y_table==self.cursor.y&&x_table==self.cursor.x)self.textarea.val(self.textarea.val()+" "+cells[x]);else{var $td=self.tbody.find("tr").eq(y_table).find("td").eq(x_table);self.data[y_table][x_table]+=" "+cells[x];$td.text(self.data[y_table][x_table])}break}}else switch(self.options.structure[x_table]["type"]){case"int":case"price":case"text":case"html":if(y_table==self.cursor.y&&x_table==self.cursor.x)self.textarea.val(cells[x]);else{var $td=self.tbody.find("tr").eq(y_table).find("td").eq(x_table);self.data[y_table][x_table]=cells[x];$td.text(self.data[y_table][x_table])}break}}}self._data_set()},_phantom_paste:function(){var self=this;var y,x,y_table,x_table,rows=self.phantom_textarea.val().split("\n"),cells=[];self._editor_close();for(y in rows){y=parseInt(y);cells=rows[y].split("\t");y_table=y+self.cursor.y;for(x in cells){x=parseInt(x);x_table=x+self.cursor.x;if(x_table>=self.options.structure.length)cells[self.options.structure.length-self.cursor.x-1]+=" "+cells[x]}cells=cells.slice(0,self.options.structure.length-self.cursor.x);for(x in cells){x=parseInt(x);x_table=x+self.cursor.x;if(y_table>=self.data.length)self._table_add_row();switch(self.options.structure[x_table]["type"]){case"image":src=self._valid_url(cells[x]
65);if(src==""){if(y==0&&x==0)self.phantom_textarea.val(self.data[y_table][x_table]).select()}else{if(y==0&&x==0)self.phantom_textarea.val(src).select();self.data[y_table][x_table]=src;var $td=self.tbody.find("tr").eq(y_table).find("td").eq(x_table);$td.find("img").attr("src",src).closest("div").css({border:"1px solid transparent"})}break;case"int":case"price":case"text":case"html":if(y==0&&x==0)self.phantom_textarea.val(cells[x]).select();var $td=self.tbody.find("tr").eq(y_table).find("td").eq(x_table);self.data[y_table][x_table]=cells[x];$td.text(self.data[y_table][x_table]);break}}}self._data_set()},_left:function(){var self=this;self.cursor.x--;if(self.cursor.x<0)self.cursor.x=0;self._cursor_show()},_up:function(){var self=this;self.cursor.y--;if(self.cursor.y<0)self.cursor.y=0;self._cursor_show()},_right:function(){var self=this;self.cursor.x++;if(self.cursor.x>=self.options.structure.length)self.cursor.x=self.options.structure.length-1;self._cursor_show()},_down:function(){var self=this;self.cursor.y++;if(self.cursor.y>=self.data.length)self.cursor.y=self.data.length-1;self._cursor_show()},_click:function(event){var self=this;var $target=$(event.target);if(self.status==3)return;if($target.closest(self.tbody).length==0){if(self.status==2)self._editor_close();self.status=0;self._cursor_show()}},_keydown:function(event){var self=this;switch(self.status){case 1:if(event.keyCode==9&&event.shiftKey==true||event.keyCode==37){event.preventDefault();self._left()}if(event.keyCode==38){event.preventDefault();self._up()}if(event.keyCode==9&&event.shiftKey==false||event.keyCode==39){event.preventDefault();self._right()}if(event.keyCode==40){event.preventDefault();self._down()}if(event.keyCode==8){event.preventDefault();switch(self.options.structure[self.cursor.x]["type"]){case"image":self.phantom_textarea.val("");self.data[self.cursor.y][self.cursor.x]="";self.tbody.find("tr").eq(self.cursor.y).find("td").eq(self.cursor.x).find("img").attr("src","i/t.gif").closest("div").css({border:"1px dashed #ccc"});self._data_set();break;case"int":case"price":case"text":case"html":self.phantom_textarea.val("");self.data[self.cursor.y][self.cursor.x]="";self.tbody.find("tr").eq(self.cursor.y).find("td").eq(self.cursor.x).text("");self._data_set();break}}if(event.keyCode==13){event.preventDefault();if(self.options.structure[self.cursor.x]["type"]=="image")self.tbody.find("tr").eq(self.cursor.y).find("td").eq(self.cursor.x).find("input").click();self._editor_open()}break;case 2:if(event.keyCode==9){event.preventDefault();self._editor_close();if(event.shiftKey)self._left();else self._right()}if(event.keyCode==13)if(self.options.structure[self.cursor.x]["type"]!="html"){if(navigator.appVersion.indexOf("Mac")!=-1&&event.ctrlKey)return;if(navigator.appVersion.indexOf("Win")!=-1&&event.shiftKey)return;event.preventDefault();self._editor_close();if(event.shiftKey)self._up();else self._down()}if(event.keyCode==27){event.preventDefault();self._editor_close()}break}},_keypress:function(event){var self=this;switch(self.status){case 1:if(event.charCode>=32)if(event.metaKey||event.ctrlKey)self._editor_open(true);else{self.data[self.cursor.y][self.cursor.x]="";self._editor_open()}break}},_phantom_textarea_change:function(event){var self=this;switch(self.status){case 1:if(self.options.structure[self.cursor.x]["type"]!="image")if(self.phantom_textarea.val()!=self.data[self.cursor.y][self.cursor.x]){self.data[self.cursor.y][self.cursor.x]=self.phantom_textarea.val();self._editor_open()}break}},_escape_html:function(string){return String(string).replace(/[&<>"'\/]/g,function(s){var entityMap={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;","/":"&#x2F;"};return entityMap[s]})},_preview_html:function(html){var res=html.replace(/<[^>]+>/g," ").replace(/[\t\n\r]+/g," ").replace(/&lt;/g,"<").replace(/&gt;/g,">").replace(/&amp;/g,"&");if(res.length>150*1.25)res=res.substring(0,150)+"...";return res},_valid_url:function(url){var regex=new RegExp("^"+"(?:(?:https?|ftp)://)"+"(?:\\S+(?::\\S*)?@)?"+"(?:"+"(?!(?:10|127)(?:\\.\\d{1,3}){3})"+"(?!(?:169\\.254|192\\.168)(?:\\.\\d{1,3}){2})"+"(?!172\\.(?:1[6-9]|2\\d|3[0-1])(?:\\.\\d{1,3}){2})"+"(?:[1-9]\\d?|1\\d\\d|2[01]\\d|22[0-3])"+"(?:\\.(?:1?\\d{1,2}|2[0-4]\\d|25[0-5])){2}"+"(?:\\.(?:[1-9]\\d?|1\\d\\d|2[0-4]\\d|25[0-4]))"+"|"+"(?:(?:[a-z\\u00a1-\\uffff0-9]-*)*[a-z\\u00a1-\\uffff0-9]+)"+"(?:\\.(?:[a-z\\u00a1-\\uffff0-9]-*)*[a-z\\u00a1-\\uffff0-9]+)*"+"(?:\\.(?:[a-z\\u00a1-\\uffff]{2,}))"+"\\.?"+")"+"(?::\\d{2,5})?"+"(?:[/?#]\\S*)?"+"$","i");var match=regex.exec(url);if(match)return url;else return""}})})(jQuery);(function($,undefined){$.widget("vp.x_tag_suggestion",{options:{all_in_one:false}
65,txt:{tightly_bound:'Òåñíî ñâÿçàííûå òåãè',relevant:'Ðåëåâàíòíûå òåãè',string_matched:'Âîçìîæíî, âû èìåëè â âèäó',all_in_one:'Ñìîòðèòå òàêæå'},_create:function(){var self=this;self.old='';},destroy:function(){this.element.empty();},set_tag:function(tag){var self=this;clearTimeout(self.timeout);self.timeout=setTimeout(function(){self.tag=tag;self._get();},1500);},_get:function(){var self=this;if(self.tag==''){self.element.html('').hide();self.old='';}else{if(self.tag!=self.old){self.old=self.tag;JsHttpRequest.query(x_ajax_path+'ajax/tag/select-suggestion',{ajx_tag_list:self.tag},function(res,err){if(res){var html='';if(self.options.all_in_one){if(res['ajx_tightly_bound']!=''){html+=res['ajx_tightly_bound'];}
66if(res['ajx_relevant']!=''){if(html!='')html+=', ';html+=res['ajx_relevant'];}
67if(html!='')html=self.txt.all_in_one+': '+html;if(res['ajx_string_matched']!=''){if(html!='')html+='<br>';html+=self.txt.string_matched+': '+res['ajx_string_matched'];}}else{if(res['ajx_tightly_bound']!=''){if(html!='')html+='<br>';html+=self.txt.tightly_bound+': '+res['ajx_tightly_bound'];}
68if(res['ajx_relevant']!=''){if(html!='')html+='<br>';html+=self.txt.relevant+': '+res['ajx_relevant'];}
69if(res['ajx_string_matched']!=''){if(html!='')html+='<br>';html+=self.txt.string_matched+': '+res['ajx_string_matched'];}}
70if(html!=''){self.element.html(html).show();}else{self.element.html('<br>').hide();}}},true);}}}});})(jQuery);(function($,undefined){var $body=$('body');var $document=$(document);$.widget('vp.zoom',{options:{'close':{'esc':true,'click':true,'icon':true},'css_prefix':'','fade':true,'fade_duration':200},_create:function(){var self=this;self.control_lock=false;self.visible=false;$document.on('click',function(event){self.open(event);});},destroy:function(){var self=this;},validate_options:function(){var self=this;self.options.close=(typeof self.options.close&&typeof self.options.close==='object'&&self.options.close.constructor===Object)?self.options.close:{};self.options.close.esc=(typeof self.options.close.esc==='boolean')?self.options.close.esc:true;self.options.close.click=(typeof self.options.close.click==='boolean')?self.options.close.click:true;self.options.close.icon=(typeof self.options.close.icon==='boolean')?self.options.close.icon:true;self.options.css_prefix=(typeof self.options.css_prefix==='string'||self.options.css_prefix instanceof String)?self.options.css_prefix.replace(/[^a-z0-9_]/g,''):'';self.options.fade=(typeof self.options.fade==='boolean')?self.options.fade:false;self.options.fade_duration=(typeof self.options.fade_duration==='number'&&isFinite(self.options.fade_duration))?parseInt(this.options.fade_duration)||200:200;},open:function(event){var self=this;self.control_lock=true;var $target=$(event.target);if(!$target.is('img.zoom')){self.control_lock=false;return;}
71event.preventDefault();self.offset=0;self.cluster=[];self.make_cluster($target);if(self.cluster.length==0){self.control_lock=false;return;}
72self.block();if(self.options.fade){setTimeout(function(){self.show();},self.options.fade_duration);}else{self.show();}
73$document.off('keydown').on('keydown',function(event){if(event.which===27&&self.options.close.esc){self.close();}
74if(self.cluster.length>0){if(event.which===37){self.previous();}
75if(event.which===39){self.next();}}});self.$blocker.click(function(event){if((event.target===this||$(event.target).is(self.$pad))&&self.options.close.click){self.close();}});},close:function(){var self=this;if(!self.control_lock){self.unblock();self.hide();$document.off('keydown');}},block:function(){var self=this;self.$blocker=$('<div class="'+self.options.css_prefix+'zoom_blocker"></div>').appendTo($body);if(self.options.fade){self.$blocker.css({'opacity':0}).animate({'opacity':1},self.options.fade_duration,function(){$body.css({'overflow':'hidden'});});}else{$body.css({'overflow':'hidden'});}},unblock:function(immediately){var self=this;$body.css({'overflow':''});if(!immediately&&self.options.fade){self.$blocker.fadeOut(self.options.fade_duration,function(){self.unblock(true);});}else{self.$blocker.remove();self.$blocker=null;}},show:function(){var self=this;if(!self.cluster[self.offset].original){JsHttpRequest.query(x_ajax_path+'ajax
75/adm/image/zoom',{ajx_cluster:self.cluster},function(res,err){if(res){self.cluster=res.ajx_cluster;self.show();}},true);return;}
76if(self.visible===false){self.visible=true;self.$pad=$('<div class="'+self.options.css_prefix+'zoom_pad"></div>').hide().appendTo(self.$blocker);self.$img=$('<img>').on('load',function(){if(self.options.fade){self.$pad.stop(true,true).fadeIn(self.options.fade_duration);}else{self.$pad.show();}}).appendTo(self.$pad);self.$title=$('<div class="'+self.options.css_prefix+'zoom_title">'+self.cluster[self.offset].alt+'</div>').appendTo(self.$blocker);if(self.options.close.icon){self.$zoom_close=$('<a class="'+self.options.css_prefix+'zoom_close">x</a>').on('click',function(){self.control_lock=false;self.close();}).appendTo(self.$blocker);}
77if(self.cluster.length>1){self.$previous=$('<a class="'+self.options.css_prefix+'zoom_previous">&lt;</a>').on('click',function(){self.previous();}).appendTo(self.$blocker);self.$next=$('<a class="'+self.options.css_prefix+'zoom_next">&gt;</a>').on('click',function(){self.next();}).appendTo(self.$blocker);}
78self.$img.attr('src',self.cluster[self.offset].src);self.element.trigger('zoom:open');}else{if(self.options.fade){self.$pad.fadeOut(self.options.fade_duration,function(){self.$img.attr('src',self.cluster[self.offset].src);self.$title.text(self.cluster[self.offset].alt);});}else{self.$pad.hide();self.$img.attr('src',self.cluster[self.offset].src);self.$title.text(self.cluster[self.offset].alt);}}
79if(self.cluster.length>1){if(self.offset==0){self.$previous.hide();}else{self.$previous.show();}
80if(self.offset==self.cluster.length-1){self.$next.hide();}else{self.$next.show();}}
81self.control_lock=false;},hide:function(){var self=this;self.visible=false;if(self.options.fade){self.$pad.fadeOut(self.options.fade_duration);}else{self.$pad.hide();}},previous:function(){var self=this;if(!self.control_lock){if(self.offset>0){self.control_lock=true;self.offset--;self.show();}}},next:function(){var self=this;if(!self.control_lock){if(self.offset<self.cluster.length-1){self.control_lock=true;self.offset++;self.show();}}},make_cluster:function($cluster){var self=this;var selected_cluster_item=self.make_cluster_item($cluster);var unique_list=[];var $zoom_cluster=$cluster.closest('.'+self.options.css_prefix+'zoom_cluster');if($zoom_cluster.length){$zoom_cluster.find('img.zoom').each(function(){var cluster_item=self.make_cluster_item($(this));if(cluster_item!==false&&$.inArray(cluster_item.src,unique_list)===-1){var length=self.cluster.push(cluster_item);if(selected_cluster_item.src==cluster_item.src){self.offset=length-1;}
82unique_list.push(cluster_item.src);}});if($zoom_cluster.data('zoom')!==undefined){var data_zoom=$zoom_cluster.data('zoom');if(Array.isArray(data_zoom)){for(var i in data_zoom){var src=data_zoom[i].src||'';if(src.search(/f\/i\/[0-9a-z]+\.(gif|jpg|png)/i)>=0||src.search(/\.(gif|jpg|png)$/i)>=0){var cluster_item={'src':src,'original':true,'alt':data_zoom[i].alt||''};if($.inArray(cluster_item.src,unique_list)===-1){var length=self.cluster.push(cluster_item);if(selected_cluster_item.src==cluster_item.src){self.offset=length-1;}
83unique_list.push(cluster_item.src);}}}}}}else{var cluster_item=self.make_cluster_item($cluster);if(cluster_item!==false&&$.inArray(cluster_item.src,unique_list)===-1){var length=self.cluster.push(cluster_item);if(selected_cluster_item.src==cluster_item.src){self.offset=length-1;}
84unique_list.push(cluster_item.src);}}},make_cluster_item:function($img){var self=this;var alt,src;var $a=$img.closest('a');if($a.length){var src=$a.attr('href')||'';if(src.search(/f\/i\/[0-9a-z]+\.(gif|jpg|png)/i)>=0||src.search(/\.(gif|jpg|png)$/i)>=0){return{'src':src,'original':true,'alt':$img.attr('alt')||''};}else{var src=$img.attr('src')||'';if(src.search(/f\/i\/[0-9a-z]+\.(gif|jpg|png)/i)>=0){return{'src':src,'original':false,'alt':$img.attr('alt')||''};}}}else{var src=$img.attr('src')||'';if(src.search(/f\/i\/[0-9a-z]+\.(gif|jpg|png)/i)>=0){return{'src':src,'original':false,'alt':$img.attr('alt')||''};}}
85return false;}});})(jQuery);$(function(){$.vp.zoom();});(function($,document,undefined){var pluses=/\+/g;function raw(s){return s}function decoded(s){return decodeURIComponent(s.replace(pluses," "))}var config=$.cookie=function(key,value,options){if(value!==undefined){options=$.extend({},config.defaults,options);if(value===null)options.expires=-1;if(typeof options.expires==="number"){var days=options.expires,t=options.expires=new Date;t.setDate(t.getDate()+days)}value=config.json?JSON.stringify(value):String(value);return document.cookie=[encodeURIComponent(key),"=",config.raw?value:encodeURIComponent(value),options.expires?"; expires="+options.expires.toUTCString():"",options.path?"; path="+options.path:"",options.domain?"; domain="+options.domain:"",options.secure?"; secure":""].join("")}var decode=config.raw?raw:decoded;var cookies=document.cookie.split("; ");for(var i=0,l=cookies.length;i<l;i++){var parts=cookies[i].split("=");if(decode(parts.shift())===key){var cookie=decode(parts.join("="));return config.json?JSON.parse(cookie):cookie}}return null};config.defaults={};$.removeCookie=function(key,options){if($.cookie(key)!==null){$.cookie(key,null,options);return true}return false}})(jQuery,document);jQuery.fn.highlight=function(pat){function innerHighlight(node,pat){var skip=0;if(node.nodeType==3){var pos=node.data.toUpperCase().indexOf(pat);pos-=node.data.substr(0,pos).toUpperCase().length-node.data.substr(0,pos).length;if(pos>=0){var spannode=document.createElement("span");spannode.className="highlight";var middlebit=node.splitText(pos);var endbit=middlebit.splitText(pat.length);var middleclone=middlebit.cloneNode(true);spannode.appendChild(middleclone);middlebit.parentNode.replaceChild(spannode,middlebit);skip=1}}else if(node.nodeType==1&&node.childNodes&&!/(script|style)/i.test(node.tagName))for(var i=0;i<node.childNodes.length;++i)i+=innerHighlight(node.childNodes[i],pat);return skip}return this.length&&pat&&pat.length?this.each(function(){innerHighlight(this,pat.toUpperCase())}):this};jQuery.fn.removeHighlight=function(){return this.find("span.highlight").each(function(){this.parentNode.firstChild.nodeName;with(this.parentNode){replaceChild(this.firstChild,this);normalize()}}).end()};(function(b){b.Jcrop=function(y,w){function n(a){return Math.round(a)+"px"}function E(a){a=b(a).offset();return[a.left,a.top]}function A(a){return[a.pageX-I[0],a.pageY-I[1]]}function F(d){"object"!==typeof d&&(d={});a=b.extend(a,d);
85b.each(["onChange","onSelect","onRelease","onDblClick"],function(d,k){"function"!==typeof a[k]&&(a[k]=function(){})})}function da(a,f,k){I=E(u);D.setCursor("move"===a?a:a+"-resize");if("move"===a)return D.activateHandlers(qa(f),Y,k);f=x.getFixed();var b=ea(a),c=x.getCorner(ea(b));x.setPressed(x.getCorner(b));x.setCurrent(c);D.activateHandlers(ra(a,f),Y,k)}function ra(d,f){return function(k){if(a.aspectRatio)switch(d){case"e":k[1]=f.y+1;break;case"w":k[1]=f.y+1;break;case"n":k[0]=f.x+1;break;case"s":k[0]=f.x+1}else switch(d){case"e":k[1]=f.y2;break;case"w":k[1]=f.y2;break;case"n":k[0]=f.x2;break;case"s":k[0]=f.x2}x.setCurrent(k);m.update()}}function qa(a){var f=a;return function(a){x.moveOffset([a[0]-f[0],a[1]-f[1]]);f=a;m.update()}}function ea(a){switch(a){case"n":return"sw";case"s":return"nw";case"e":return"nw";case"w":return"ne";case"ne":return"sw";case"nw":return"se";case"se":return"nw";case"sw":return"ne"}}function fa(d){return function(f){if(a.disabled||"move"===d&&!a.allowMove)return!1;I=E(u);M=!0;da(d,A(f));f.stopPropagation();f.preventDefault();return!1}}function ga(a,f,k){var b=a.width(),c=a.height();b>f&&0<f&&(b=f,c=f/a.width()*a.height());c>k&&0<k&&(c=k,b=k/a.height()*a.width());s=a.width()/b;z=a.height()/c;a.width(b).height(c)}function Q(a){return{x:a.x*s,y:a.y*z,x2:a.x2*s,y2:a.y2*z,w:a.w*s,h:a.h*z}}function Y(d){d=x.getFixed();d.w>a.minSelect[0]&&d.h>a.minSelect[1]?(m.enableHandles(),m.done()):m.release();D.setCursor(a.allowSelect?"crosshair":"default")}function ha(d){if(a.disabled||!a.allowSelect)return!1;M=!0;I=E(u);m.disableHandles();D.setCursor("crosshair");var b=A(d);x.setPressed(b);m.update();D.activateHandlers(sa,Y,"touch"===d.type.substring(0,5));d.stopPropagation();d.preventDefault();return!1}function sa(a){x.setCurrent(a);m.update()}function ia(){var d=b("<div></div>").addClass(a.baseClass+"-tracker");ja&&d.css({opacity:0,backgroundColor:"white"});return d}function ka(d){la([d[0]/s,d[1]/z,d[2]/s,d[3]/z]);a.onSelect.call(B,Q(x.getFixed()));m.enableHandles()}function la(a){x.setPressed([a[0],a[1]]);x.setCurrent([a[2],a[3]]);m.update()}function ma(){a.disabled=!0;m.disableHandles();m.setCursor("default");D.setCursor("default")}function na(){a.disabled=!1;Z()}function $(d,f,k){f=f||a.bgColor;a.bgFade&&b.fx.step.hasOwnProperty("backgroundColor")&&a.fadeTime&&!k?d.animate({backgroundColor:f},{queue:!1,duration:a.fadeTime}):d.css("backgroundColor",f)}function Z(d){a.allowResize?d?m.enableOnly():m.enableHandles():m.disableHandles();D.setCursor(a.allowSelect?"crosshair":"default");m.setCursor(a.allowMove?"move":"default");a.hasOwnProperty("trueSize")&&(s=a.trueSize[0]/t,z=a.trueSize[1]/l);a.hasOwnProperty("setSelect")&&(ka(a.setSelect),m.done(),delete a.setSelect);J.refresh();a.bgColor!=oa&&($(a.shade?J.getShades():G,a.shade?a.shadeColor||a.bgColor:a.bgColor),oa=a.bgColor);R!=a.bgOpacity&&(R=a.bgOpacity,a.shade?J.refresh():m.setBgOpacity(R));S=a.maxSize[0]||0;T=a.maxSize[1]||0;U=a.minSize[0]||0;V=a.minSize[1]||0;a.hasOwnProperty("outerImage")&&(u.attr("src",a.outerImage),delete a.outerImage);m.refresh()}var a=b.extend({},b.Jcrop.defaults),I,W=navigator.userAgent.toLowerCase(),ja=/msie/.test(W),W=/msie [1-6]\./.test(W);"object"!==typeof y&&(y=b(y)[0]);"object"!==typeof w&&(w={});F(w);var aa={border:"none",visibility:"visible",margin:0,padding:0,position:"absolute",top:0,left:0},v=b(y),pa=!0;if("IMG"==y.tagName){if(0!=v[0].width&&0!=v[0].height)v.width(v[0].width),v.height(v[0].height);else{var ba=new Image;ba.src=v[0].src;v.width(ba.width);v.height(ba.height)}var u=v.clone().removeAttr("id").css(aa).show();u.width(v.width());u.height(v.height());v.after(u).hide()}else u=v.css(aa).show(),pa=!1,null===a.shade&&(a.shade=!0);ga(u,a.boxWidth,a.boxHeight);var t=u.width(),l=u.height(),G=b("<div />").width(t).height(l).addClass(a.baseClass+"-holder").css({position:"relative",backgroundColor:a.bgColor}).insertAfter(v).append(u);a.addClass&&G.addClass(a.addClass);var K=b("<div />"),X=b("<div />").width("100%").height("100%").css({zIndex:310,position:"absolute",overflow:"hidden"}),N=b("<div />").width("100%").height("100%").css("zIndex",320),O=b("<div />").css({position:"absolute",zIndex:600}).dblclick(function(){var d=x.getFixed();a.onDblClick.call(B,d)}).insertBefore(u).append(X,N);pa&&(K=b("<img />").attr("src",u.attr("src")).css(aa).width(t).height(l),X.append(K));W&&O.css({overflowY:"hidden"});var P=a.boundary,L=ia().width(t+2*P).height(l+2*P).css({position:"absolute",top:n(-P),left:n(-P),zIndex:290}).mousedown(ha),oa=a.bgColor,R=a.bgOpacity,S,T,U,V,s,z,M,ca;I=E(u);var C=function(){function d(){var a={},d=["touchstart","touchmove","touchend"],c=document.createElement("div"),e;try{for(e=0;e<d.length;e++){var b=d[e],b="on"+b,h=b in c;h||(c.setAttribute(b,"return;"),h="function"==typeof c[b]);a[d[e]]=h}return a.touchstart&&a.touchend&&a.touchmove}catch(f){return!1}}
86var b;b=!0===a.touchSupport||!1===a.touchSupport?a.touchSupport:d();return{createDragger:function(b){return function(d){if(a.disabled||"move"===b&&!a.allowMove)return!1;I=E(u);M=!0;da(b,A(C.cfilter(d)),!0);d.stopPropagation();d.preventDefault();return!1}},newSelection:function(a){return ha(C.cfilter(a))},cfilter:function(a){a.pageX=a.originalEvent.changedTouches[0].pageX;a.pageY=a.originalEvent.changedTouches[0].pageY;return a},isSupported:d,support:b}}(),x=function(){function d(){if(!a.aspectRatio){var q=p-c,b=h-e;S&&Math.abs(q)>S&&(p=0<q?c+S:c-S);T&&Math.abs(b)>T&&(h=0<b?e+T:e-T);V/z&&Math.abs(b)<V/z&&(h=0<b?e+V/z:e-V/z);U/s&&Math.abs(q)<U/s&&(p=0<q?c+U/s:c-U/s);0>c&&(p-=c,c-=c);0>e&&(h-=e,e-=e);0>p&&(c-=p,p-=p);0>h&&(e-=h,h-=h);p>t&&(q=p-t,c-=q,p-=q);h>l&&(q=h-l,e-=q,h-=q);c>t&&(q=c-l,h-=q,e-=q);e>l&&(q=e-l,h-=q,e-=q);return m(k(c,e,p,h))}var q=a.aspectRatio,b=a.minSize[0]/s,d=a.maxSize[0]/s,f=p-c,n=h-e,r=Math.abs(f),g=Math.abs(n);0===d&&(d=10*t);r/g<q?(r=h,g*=q,g=0>f?c-g:g+c,0>g?(g=0,r=Math.abs((g-
87c)/q),r=0>n?e-r:r+e):g>t&&(g=t,r=Math.abs((g-c)/q),r=0>n?e-r:r+e)):(g=p,r/=q,r=0>n?e-r:e+r,0>r?(r=0,g=Math.abs((r-e)*q),g=0>f?c-g:g+c):r>l&&(r=l,g=Math.abs(r-e)*q,g=0>f?c-g:g+c));g>c?(g-c<b?g=c+b:g-c>d&&(g=c+d),r=r>e?e+(g-c)/q:e-(g-c)/q):g<c&&(c-g<b?g=c-b:c-g>d&&(g=c-d),r=r>e?e+(c-g)/q:e-(c-g)/q);0>g?(c-=g,g=0):g>t&&(c-=g-t,g=t);0>r?(e-=r,r=0):r>l&&(e-=r-l,r=l);return m(k(c,e,g,r))}function b(a){0>a[0]&&(a[0]=0);0>a[1]&&(a[1]=0);a[0]>t&&(a[0]=t);a[1]>l&&(a[1]=l);return[Math.round(a[0]),Math.round(a[1])]}
88function k(a,b,c,d){var e=a,h=c,f=b,k=d;c<a&&(e=c,h=a);d<b&&(f=d,k=b);return[e,f,h,k]}function m(a){return{x:a[0],y:a[1],x2:a[2],y2:a[3],w:a[2]-a[0],h:a[3]-a[1]}}var c=0,e=0,p=0,h=0,H,n;return{flipCoords:k,setPressed:function(a){a=b(a);p=c=a[0];h=e=a[1]},setCurrent:function(a){a=b(a);H=a[0]-p;n=a[1]-h;p=a[0];h=a[1]},getOffset:function(){return[H,n]},moveOffset:function(a){var b=a[0];a=a[1];0>c+b&&(b-=b+c);0>e+a&&(a-=a+e);l<h+a&&(a+=l-(h+a));t<p+b&&(b+=t-(p+b));c+=b;p+=b;e+=a;h+=a},getCorner:function(a){var b=d();switch(a){case"ne":return[b.x2,b.y];case"nw":return[b.x,b.y];case"se":return[b.x2,b.y2];case"sw":return[b.x,b.y2]}},getFixed:d}}(),J=function(){function d(){return f(x.getFixed())}function f(a){q.top.css({left:n(a.x),width:n(a.w),height:n(a.y)});q.bottom.css({top:n(a.y2),left:n(a.x),width:n(a.w),height:n(l-a.y2)});q.right.css({left:n(a.x2),width:n(t-a.x2)});q.left.css({width:n(a.x)})}function k(){return b("<div />").css({position:"absolute",backgroundColor:a.shadeColor||a.bgColor}).appendTo(s)}
89function v(){H||(H=!0,s.insertBefore(u),d(),m.setBgOpacity(1,0,1),K.hide(),c(a.shadeColor||a.bgColor,1),m.isAwake()?p(a.bgOpacity,1):p(1,
891))}function c(a,b){$(h(),a,b)}function e(){H&&(s.remove(),K.show(),H=!1,m.isAwake()?m.setBgOpacity(a.bgOpacity,1,1):(m.setBgOpacity(1,1,1),m.disableHandles()),$(G,0,1))}function p(b,c){H&&(a.bgFade&&!c?s.animate({opacity:1-b},{queue:!1,duration:a.fadeTime}):s.css({opacity:1-b}))}function h(){return s.children()}var H=!1,s=b("<div />").css({position:"absolute",zIndex:240,opacity:0}),q={top:k(),left:k().height(l),right:k().height(l),bottom:k()};return{update:d,updateRaw:f,getShades:h,setBgColor:c,enable:v,disable:e,resize:function(a,b){q.left.css({height:n(b)});q.right.css({height:n(b)})},refresh:function(){a.shade?v():e();m.isAwake()&&p(a.bgOpacity)},opacity:p}}(),m=function(){function d(a,c){var d=b("<div />").mousedown(fa(a)).css({cursor:a+"-resize",position:"absolute",zIndex:c}).addClass("ord-"+a);C.support&&d.bind("touchstart.jcrop",C.createDragger(a));N.append(d);return d}function f(a){var b;for(b=0;b<a.length;b++)d(a[b],v++).addClass("jcrop-dragbar")}function k(c){var d,e;for(e=0;e<c.length;e++){switch(c[e]){case"n":d="hline";break;case"s":d="hline bottom";break;case"e":d="vline right";break;case"w":d="vline"}var h=z,f=c[e],g=d,g=b("<div />").css({position:"absolute",opacity:a.borderOpacity}).addClass(a.baseClass+"-"+g);X.append(g);h[f]=g}}function m(b){var c;for(c=0;c<b.length;c++){var e=y,h=b[c],f=a.handleSize,g=d(b[c],v++).css({opacity:a.handleOpacity}).addClass(a.baseClass+"-handle");f&&g.width(f).height(f);e[h]=g}}function c(){var a=x.getFixed();x.setPressed([a.x,a.y]);x.setCurrent([a.x2,a.y2]);e()}function e(a){if(s)return p(a)}function p(b){var c=x.getFixed(),d=c.h;O.width(Math.round(c.w)).height(Math.round(d));var d=c.x,e=c.y;a.shade||K.css({top:n(-e),left:n(-d)});O.css({top:n(e),left:n(d)});a.shade&&J.updateRaw(c);s||(O.show(),a.shade?J.opacity(R):h(R,!0),s=!0);b?a.onSelect.call(B,Q(c)):a.onChange.call(B,Q(c))}function h(b,c,d){if(s||c)a.bgFade&&!d?u.animate({opacity:b},{queue:!1,duration:a.fadeTime}):u.css("opacity",b)}function l(){r=!0;if(a.allowResize)return N.show(),!0}function t(){r=!1;N.hide()}function q(a){a?(ca=!0,t()):(ca=!1,l())}var s,v=370,z={},y={},r=!1;a.dragEdges&&b.isArray(a.createDragbars)&&f(a.createDragbars);b.isArray(a.createHandles)&&m(a.createHandles);a.drawBorders&&b.isArray(a.createBorders)&&k(a.createBorders);b(document).bind("touchstart.jcrop-ios",function(a){b(a.currentTarget).hasClass("jcrop-tracker")&&a.stopPropagation()});var g=ia().mousedown(fa("move")).css({cursor:"move",position:"absolute",zIndex:360});C.support&&g.bind("touchstart.jcrop",C.createDragger("move"));X.append(g);t();return{updateVisible:e,update:p,release:function(){t();O.hide();a.shade?J.opacity(1):h(1);s=!1;a.onRelease.call(B)},refresh:c,isAwake:function(){return s},setCursor:function(a){g.css("cursor",a)},enableHandles:l,enableOnly:function(){r=!0},showHandles:function(){r&&N.show()},disableHandles:t,animMode:q,setBgOpacity:h,done:function(){q(!1);c()}}}(),D=function(){function d(a){c(A(a));return!1}
90function f(d){d.preventDefault();d.stopPropagation();M&&(M=!1,e(A(d)),m.isAwake()&&a.onSelect.call(B,Q(x.getFixed())),L.css({zIndex:290}),b(document).unbind(".jcrop"),c=function(){},e=function(){});return!1}function k(a){c(A(C.cfilter(a)));return!1}function n(a){return f(C.cfilter(a))}var c=function(){},e=function(){},p=a.trackDocument;p||L.mousemove(d).mouseup(f).mouseout(f);u.before(L);return{activateHandlers:function(a,m,s){M=!0;c=a;e=m;L.css({zIndex:450});s?b(document).bind("touchmove.jcrop",k).bind("touchend.jcrop",n):p&&b(document).bind("mousemove.jcrop",d).bind("mouseup.jcrop",f);return!1},setCursor:function(a){L.css("cursor",a)}}}();C.support&&L.bind("touchstart.jcrop",C.newSelection);N.hide();Z(!0);var B={setImage:function(b,f){m.release();ma();var k=new Image;k.onload=function(){var m=k.height,c=a.boxWidth,e=a.boxHeight;u.width(k.width).height(m);u.attr("src",b);K.attr("src",b);ga(u,c,e);t=u.width();l=u.height();K.width(t).height(l);L.width(t+2*P).height(l+2*P);G.width(t).height(l);J.resize(t,l);na();"function"===typeof f&&f.call(B)};k.src=b},animateTo:function(b,f){var k=b[0]/s,n=b[1]/z,c=b[2]/s,e=b[3]/z;if(!ca){var p=x.flipCoords(k,n,c,e),h=x.getFixed(),l=[h.x,h.y,h.x2,h.y2],t=a.animationDelay,q=p[0]-l[0],u=p[1]-l[1],v=p[2]-l[2],y=p[3]-l[3],w=0,r=a.swingSpeed,k=l[0],n=l[1],c=l[2],e=l[3];m.animMode(!0);var g=function(){return function(){w+=(100-w)/r;l[0]=Math.round(k+w/100*q);l[1]=Math.round(n+w/100*u);l[2]=Math.round(c+w/100*v);l[3]=Math.round(e+w/100*y);99.8<=w&&(w=100);100>w?(la(l),window.setTimeout(g,t)):(m.done(),m.animMode(!1),"function"===typeof f&&f.call(B))}}();window.setTimeout(g,t)}},setSelect:ka,setOptions:function(a){F(a);Z()},tellSelect:function(){return Q(x.getFixed())},tellScaled:function(){return x.getFixed()},setClass:function(b){G.removeClass().addClass(a.baseClass+"-holder").addClass(b)}
90,disable:ma,enable:na,cancel:function(){m.done();D.activateHandlers(null,null)},release:m.release,destroy:function(){G.remove();v.show();v.css("visibility","visible");b(y).removeData("Jcrop")},getBounds:function(){return[t*s,l*z]},getWidgetSize:function(){return[t,l]},getScaleFactor:function(){return[s,z]},getOptions:function(){return a},ui:{holder:G,selection:O}};ja&&G.bind("selectstart",function(){return!1});v.data("Jcrop",B);return B};b.fn.Jcrop=function(y,w){var n;this.each(function(){if(b(this).data("Jcrop")){if("api"===y)return b(this).data("Jcrop");b(this).data("Jcrop").setOptions(y)}else"IMG"==this.tagName?b.Jcrop.Loader(this,function(){b(this).css({display:"block",visibility:"hidden"});n=b.Jcrop(this,y);b.isFunction(w)&&w.call(n)}):(b(this).css({display:"block",visibility:"hidden"}),n=b.Jcrop(this,y),b.isFunction(w)&&w.call(n))});return this};b.Jcrop.Loader=function(y,w,n){function E(){F.complete?(A.unbind(".jcloader"),b.isFunction(w)&&w.call(F)):window.setTimeout(E,50)}var A=b(y),F=A[0];A.bind("load.jcloader",E).bind("error.jcloader",function(w){A.unbind(".jcloader");b.isFunction(n)&&n.call(F)});F.complete&&b.isFunction(w)&&(A.unbind(".jcloader"),w.call(F))};b.Jcrop.defaults={allowSelect:!0,allowMove:!0,allowResize:!0,trackDocument:!0,baseClass:"jcrop",addClass:null,bgColor:"black",bgOpacity:0.6,bgFade:!1,borderOpacity:0.4,handleOpacity:0.5,handleSize:null,aspectRatio:0,createHandles:"n s e w nw ne se sw".split(" "),createDragbars:["n","s","e","w"],createBorders:["n","s","e","w"],drawBorders:!0,dragEdges:!0,fixedSupport:!0,touchSupport:null,shade:null,boxWidth:0,boxHeight:0,boundary:2,fadeTime:400,animationDelay:20,swingSpeed:3,minSelect:[0,0],maxSize:[0,0],minSize:[0,0],onChange:function(){},onSelect:function(){},onDblClick:function(){},onRelease:function(){}}})(jQuery);;(function($){$.fn.unveil=function(threshold,callback){var $w=$(window),th=threshold||0,retina=window.devicePixelRatio>1,attrib=retina?"data-src-retina":"data-src",images=this,loaded;this.one("unveil",function(){var source=this.getAttribute(attrib);source=source||this.getAttribute("data-src");if(source){this.setAttribute("src",source);if(typeof callback==="function")callback.call(this);}});function unveil(){var inview=images.filter(function(){var $e=$(this),wt=$w.scrollTop(),wb=wt+$w.height(),et=$e.offset().top,eb=et+$e.height();return eb>=wt-th&&et<=wb+th;});loaded=inview.trigger("unveil");images=images.not(loaded);}$w.scroll(unveil);$w.resize(unveil);unveil();return this;};})(window.jQuery||window.Zepto);!function(a,b){"function"==typeof define&&define.amd?define("Chartist",[],function(){return a.Chartist=b()}):"object"==typeof module&&module.exports?module.exports=b():a.Chartist=b()}(this,function(){var a={version:"0.11.0"};return function(a,b,c){"use strict";c.namespaces={svg:"http://www.w3.org/2000/svg",xmlns:"http://www.w3.org/2000/xmlns/",xhtml:"http://www.w3.org/1999/xhtml",xlink:"http://www.w3.org/1999/xlink",ct:"http://gionkunz.github.com/chartist-js/ct"},c.noop=function(a){return a},c.alphaNumerate=function(a){return String.fromCharCode(97+a%26)},c.extend=function(a){var b,d,e;for(a=a||{},b=1;b<arguments.length;b++){d=arguments[b];for(var f in d)e=d[f],"object"!=typeof e||null===e||e instanceof Array?a[f]=e:a[f]=c.extend(a[f],e)}return a},c.replaceAll=function(a,b,c){return a.replace(new RegExp(b,"g"),c)},c.ensureUnit=function(a,b){return"number"==typeof a&&(a+=b),a},c.quantity=function(a){if("string"==typeof a){var b=/^(\d+)\s*(.*)$/g.exec(a);return{value:+b[1],unit:b[2]||void 0}}return{value:a}},c.querySelector=function(a){return a instanceof Node?a:b.querySelector(a)},c.times=function(a){return Array.apply(null,new Array(a))},c.sum=function(a,b){return a+(b?b:0)},c.mapMultiply=function(a){return function(b){return b*a}},c.mapAdd=function(a){return function(b){return b+a}},c.serialMap=function(a,b){var d=[],e=Math.max.apply(null,a.map(function(a){return a.length}));return c.times(e).forEach(function(c,e){var f=a.map(function(a){return a[e]});d[e]=b.apply(null,f)}),d},c.roundWithPrecision=function(a,b){var d=Math.pow(10,b||c.precision);return Math.round(a*d)/d},c.precision=8,c.escapingMap={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#039;"},c.serialize=function(a){return null===a||void 0===a?a:("number"==typeof a?a=""+a:"object"==typeof a&&(a=JSON.stringify({data:a})),Object.keys(c.escapingMap).reduce(function(a,b){return c.replaceAll(a,b,c.escapingMap[b])},a))}
90,c.deserialize=function(a){if("string"!=typeof a)return a;a=Object.keys(c.escapingMap).reduce(function(a,b){return c.replaceAll(a,c.escapingMap[b],b)},a);try{a=JSON.parse(a),a=void 0!==a.data?a.data:a}catch(b){}return a},c.createSvg=function(a,b,d,e){var f;return b=b||"100%",d=d||"100%",Array.prototype.slice.call(a.querySelectorAll("svg")).filter(function(a){return a.getAttributeNS(c.namespaces.xmlns,"ct")}).forEach(function(b){a.removeChild(b)}),f=new c.Svg("svg").attr({width:b,height:d}).addClass(e),f._node.style.width=b,f._node.style.height=d,a.appendChild(f._node),f},c.normalizeData=function(a,b,d){var e,f={raw:a,normalized:{}};return f.normalized.series=c.getDataArray({series:a.series||[]},b,d),e=f.normalized.series.every(function(a){return a instanceof Array})?Math.max.apply(null,f.normalized.series.map(function(a){return a.length})):f.normalized.series.length,f.normalized.labels=(a.labels||[]).slice(),Array.prototype.push.apply(f.normalized.labels,c.times(Math.max(0,e-f.normalized.labels.length)).map(function(){return""})),b&&c.reverseData(f.normalized),f},c.safeHasProperty=function(a,b){return null!==a&&"object"==typeof a&&a.hasOwnProperty(b)},c.isDataHoleValue=function(a){return null===a||void 0===a||"number"==typeof a&&isNaN(a)},c.reverseData=function(a){a.labels.reverse(),a.series.reverse();for(var b=0;b<a.series.length;b++)"object"==typeof a.series[b]&&void 0!==a.series[b].data?a.series[b].data.reverse():a.series[b]instanceof Array&&a.series[b].reverse()},c.getDataArray=function(a,b,d){function e(a){if(c.safeHasProperty(a,"value"))return e(a.value);if(c.safeHasProperty(a,"data"))return e(a.data);if(a instanceof Array)return a.map(e);if(!c.isDataHoleValue(a)){if(d){var b={};return"string"==typeof d?b[d]=c.getNumberOrUndefined(a):b.y=c.getNumberOrUndefined(a),b.x=a.hasOwnProperty("x")?c.getNumberOrUndefined(a.x):b.x,b.y=a.hasOwnProperty("y")?c.getNumberOrUndefined(a.y):b.y,b}return c.getNumberOrUndefined(a)}}return a.series.map(e)},c.normalizePadding=function(a,b){return b=b||0,"number"==typeof a?{top:a,right:a,bottom:a,left:a}:{top:"number"==typeof a.top?a.top:b,right:"number"==typeof a.right?a.right:b,bottom:"number"==typeof a.bottom?a.bottom:b,left:"number"==typeof a.left?a.left:b}},c.getMetaData=function(a,b){var c=a.data?a.data[b]:a[b];return c?c.meta:void 0},c.orderOfMagnitude=function(a){return Math.floor(Math.log(Math.abs(a))/Math.LN10)},c.projectLength=function(a,b,c){return b/c.range*a},c.getAvailableHeight=function(a,b){return Math.max((c.quantity(b.height).value||a.height())-(b.chartPadding.top+b.chartPadding.bottom)-b.axisX.offset,0)},c.getHighLow=function(a,b,d){function e(a){if(void 0!==a)if(a instanceof Array)for(var b=0;b<a.length;b++)e(a[b]);else{var c=d?+a[d]:+a;g&&c>f.high&&(f.high=c),h&&c<f.low&&(f.low=c)}}b=c.extend({},b,d?b["axis"+d.toUpperCase()]:{});var f={high:void 0===b.high?-Number.MAX_VALUE:+b.high,low:void 0===b.low?Number.MAX_VALUE:+b.low},g=void 0===b.high,h=void 0===b.low;return(g||h)&&e(a),(b.referenceValue||0===b.referenceValue)&&(f.high=Math.max(b.referenceValue,f.high),f.low=Math.min(b.referenceValue,f.low)),f.high<=f.low&&(0===f.low?f.high=1:f.low<0?f.high=0:f.high>0?f.low=0:(f.high=1,f.low=0)),f},c.isNumeric=function(a){return null!==a&&isFinite(a)},c.isFalseyButZero=function(a){return!a&&0!==a},c.getNumberOrUndefined=function(a){return c.isNumeric(a)?+a:void 0},c.isMultiValue=function(a){return"object"==typeof a&&("x"in a||"y"in a)},c.getMultiValue=function(a,b){return c.isMultiValue(a)?c.getNumberOrUndefined(a[b||"y"]):c.getNumberOrUndefined(a)},c.rho=function(a){function b(a,c){return a%c===0?c:b(c,a%c)}function c(a){return a*a+1}if(1===a)return a;var d,e=2,f=2;if(a%2===0)return 2;do e=c(e)%a,f=c(c(f))%a,d=b(Math.abs(e-f),a);while(1===d);return d},c.getBounds=function(a,b,d,e){function f(a,b){return a===(a+=b)&&(a*=1+(b>0?o:-o)),a}var g,h,i,j=0,k={high:b.high,low:b.low};k.valueRange=k.high-k.low,k.oom=c.orderOfMagnitude(k.valueRange),k.step=Math.pow(10,k.oom),k.min=Math.floor(k.low/k.step)*k.step,k.max=Math.ceil(k.high/k.step)*k.step,k.range=k.max-k.min,k.numberOfSteps=Math.round(k.range/k.step);var l=c.projectLength(a,k.step,k),m=l<d,n=e?c.rho(k.range):0;if(e&&c.projectLength(a,1,k)>=d)k.step=1;else if(e&&n<k.step&&c.projectLength(a,n,k)>=d)k.step=n;else for(;;){if(m&&c.projectLength(a,k.step,k)<=d)k.step*=2;else{if(m||!(c.projectLength(a,k.step/2,k)>=d))break;if(k.step/=2,e&&k.step%1!==0){k.step*=2;break}}if(j++>1e3)throw new Error("Exceeded maximum number of iterations while optimizing scale step!")}var o=2.221e-16;for(k.step=Math.max(k.step,o),h=k.min,i=k.max;h+k.step<=k.low;)h=f(h,k.step);for(;i-k.step>=k.high;)i=f(i,-k.step);k.min=h,k.max=i,k.range=k.max-k.min;var p=[];for(g=k.min;g<=k.max;g=f(g,k.step)){var q=c.roundWithPrecision(g);q!==p[p.length-1]&&p.push(q)}return k.values=p,k},c.polarToCartesian=function(a,b,c,d){var e=(d-90)*Math.PI/180;return{x:a+c*Math.cos(e),y:b+c*Math.sin(e)}},c.createChartRect=function(a,b,d){var e=!(!b.axisX&&!b.axisY),f=e?b.axisY.offset:0,g=e?b.axisX.offset:0,h=a.width()||c.quantity(b.width).value||0,i=a.height()||c.quantity(b.height).value||0,j=c.normalizePadding(b.chartPadding,d);h=Math.max(h,f+j.left+j.right),i=Math.max(i,g+j.top+j.bottom);var k={padding:j,width:function(){return this.x2-this.x1},height:function(){return this.y1-this.y2}};return e?("start"===b.axisX.position?(k.y2=j.top+g,k.y1=Math.max(i-j.bottom,k.y2+1)):(k.y2=j.top,k.y1=Math.max(i-j.bottom-g,k.y2+1)),"start"===b.axisY.position?(k.x1=j.left+f,k.x2=Math.max(h-j.right,k.x1+1)):(k.x1=j.left,k.x2=Math.max(h-j.right-f,k.x1+1))):(k.x1=j.left,k.x2=Math.max(h-j.right,k.x1+1),k.y2=j.top,k.y1=Math.max(i-j.bottom,k.y2+1)),k},c.createGrid=function(a,b,d,e,f,g,h,i){var j={};j[d.units.pos+"1"]=a,j[d.units.pos+"2"]=a,j[d.counterUnits.pos+"1"]=e,j[d.counterUnits.pos+"2"]=e+f;var k=g.elem("line",j,h.join(" "));i.emit("draw",c.extend({type:"grid",axis:d,index:b,group:g,element:k},j))}
90,c.createGridBackground=function(a,b,c,d){var e=a.elem("rect",{x:b.x1,y:b.y2,width:b.width(),height:b.height()},c,!0);d.emit("draw",{type:"gridBackground",group:a,element:e})},c.createLabel=function(a,d,e,f,g,h,i,j,k,l,m){var n,o={};if(o[g.units.pos]=a+i[g.units.pos],o[g.counterUnits.pos]=i[g.counterUnits.pos],o[g.units.len]=d,o[g.counterUnits.len]=Math.max(0,h-10),l){var p=b.createElement("span");p.className=k.join(" "),p.setAttribute("xmlns",c.namespaces.xhtml),p.innerText=f[e],p.style[g.units.len]=Math.round(o[g.units.len])+"px",p.style[g.counterUnits.len]=Math.round(o[g.counterUnits.len])+"px",n=j.foreignObject(p,c.extend({style:"overflow: visible;"},o))}else n=j.elem("text",o,k.join(" ")).text(f[e]);m.emit("draw",c.extend({type:"label",axis:g,index:e,group:j,element:n,text:f[e]},o))},c.getSeriesOption=function(a,b,c){if(a.name&&b.series&&b.series[a.name]){var d=b.series[a.name];return d.hasOwnProperty(c)?d[c]:b[c]}return b[c]},c.optionsProvider=function(b,d,e){function f(b){var f=h;if(h=c.extend({},j),d)for(i=0;i<d.length;i++){var g=a.matchMedia(d[i][0]);g.matches&&(h=c.extend(h,d[i][1]))}e&&b&&e.emit("optionsChanged",{previousOptions:f,currentOptions:h})}function g(){k.forEach(function(a){a.removeListener(f)})}var h,i,j=c.extend({},b),k=[];
90if(!a.matchMedia)throw"window.matchMedia not found! Make sure you're using a polyfill.";if(d)for(i=0;i<d.length;i++){var l=a.matchMedia(d[i][0]);l.addListener(f),k.push(l)}return f(),{removeMediaQueryListeners:g,getCurrentOptions:function(){return c.extend({},h)}}},c.splitIntoSegments=function(a,b,d){var e={increasingX:!1,fillHoles:!1};d=c.extend({},e,d);for(var f=[],g=!0,h=0;h<a.length;h+=2)void 0===c.getMultiValue(b[h/2].value)?d.fillHoles||(g=!0):(d.increasingX&&h>=2&&a[h]<=a[h-2]&&(g=!0),g&&(f.push({pathCoordinates:[],valueData:[]}),g=!1),f[f.length-1].pathCoordinates.push(a[h],a[h+1]),f[f.length-1].valueData.push(b[h/2]));return f}}(window,document,a),function(a,b,c){"use strict";c.Interpolation={},c.Interpolation.none=function(a){var b={fillHoles:!1};return a=c.extend({},b,a),function(b,d){for(var e=new c.Svg.Path,f=!0,g=0;g<b.length;g+=2){var h=b[g],i=b[g+1],j=d[g/2];void 0!==c.getMultiValue(j.value)?(f?e.move(h,i,!1,j):e.line(h,i,!1,j),f=!1):a.fillHoles||(f=!0)}return e}},c.Interpolation.simple=function(a){var b={divisor:2,fillHoles:!1};a=c.extend({},b,a);var d=1/Math.max(1,a.divisor);return function(b,e){for(var f,g,h,i=new c.Svg.Path,j=0;j<b.length;j+=2){var k=b[j],l=b[j+1],m=(k-f)*d,n=e[j/2];void 0!==n.value?(void 0===h?i.move(k,l,!1,n):i.curve(f+m,g,k-m,l,k,l,!1,n),f=k,g=l,h=n):a.fillHoles||(f=k=h=void 0)}return i}},c.Interpolation.cardinal=function(a){var b={tension:1,fillHoles:!1};a=c.extend({},b,a);var d=Math.min(1,Math.max(0,a.tension)),e=1-d;return function f(b,g){var h=c.splitIntoSegments(b,g,{fillHoles:a.fillHoles});if(h.length){if(h.length>1){var i=[];return h.forEach(function(a){i.push(f(a.pathCoordinates,a.valueData))}),c.Svg.Path.join(i)}if(b=h[0].pathCoordinates,g=h[0].valueData,b.length<=4)return c.Interpolation.none()(b,g);for(var j,k=(new c.Svg.Path).move(b[0],b[1],!1,g[0]),l=0,m=b.length;m-2*!j>l;l+=2){var n=[{x:+b[l-2],y:+b[l-1]},{x:+b[l],y:+b[l+1]},{x:+b[l+2],y:+b[l+3]},{x:+b[l+4],y:+b[l+5]}];j?l?m-4===l?n[3]={x:+b[0],y:+b[1]}:m-2===l&&(n[2]={x:+b[0],y:+b[1]},n[3]={x:+b[2],y:+b[3]}):n[0]={x:+b[m-2],y:+b[m-1]}:m-4===l?n[3]=n[2]:l||(n[0]={x:+b[l],y:+b[l+1]}),k.curve(d*(-n[0].x+6*n[1].x+n[2].x)/6+e*n[2].x,d*(-n[0].y+6*n[1].y+n[2].y)/6+e*n[2].y,d*(n[1].x+6*n[2].x-n[3].x)/6+e*n[2].x,d*(n[1].y+6*n[2].y-n[3].y)/6+e*n[2].y,n[2].x,n[2].y,!1,g[(l+2)/2])}return k}return c.Interpolation.none()([])}},c.Interpolation.monotoneCubic=function(a){var b={fillHoles:!1};return a=c.extend({},b,a),function d(b,e){var f=c.splitIntoSegments(b,e,{fillHoles:a.fillHoles,increasingX:!0});if(f.length){if(f.length>1){var g=[];return f.forEach(function(a){g.push(d(a.pathCoordinates,a.valueData))}),c.Svg.Path.join(g)}if(b=f[0].pathCoordinates,e=f[0].valueData,b.length<=4)return c.Interpolation.none()(b,e);var h,i,j=[],k=[],l=b.length/2,m=[],n=[],o=[],p=[];for(h=0;h<l;h++)j[h]=b[2*h],k[h]=b[2*h+1];for(h=0;h<l-1;h++)o[h]=k[h+1]-k[h],p[h]=j[h+1]-j[h],n[h]=o[h]/p[h];for(m[0]=n[0],m[l-1]=n[l-2],h=1;h<l-1;h++)0===n[h]||0===n[h-1]||n[h-1]>0!=n[h]>0?m[h]=0:(m[h]=3*(p[h-1]+p[h])/((2*p[h]+p[h-1])/n[h-1]+(p[h]+2*p[h-1])/n[h]),isFinite(m[h])||(m[h]=0));for(i=(new c.Svg.Path).move(j[0],k[0],!1,e[0]),h=0;h<l-1;h++)i.curve(j[h]+p[h]/3,k[h]+m[h]*p[h]/3,j[h+1]-p[h]/3,k[h+1]-m[h+1]*p[h]/3,j[h+1],k[h+1],!1,e[h+1]);return i}return c.Interpolation.none()([])}},c.Interpolation.step=function(a){var b={postpone:!0,fillHoles:!1};return a=c.extend({},b,a),function(b,d){for(var e,f,g,h=new c.Svg.Path,i=0;i<b.length;i+=2){var j=b[i],k=b[i+1],l=d[i/2];void 0!==l.value?(void 0===g?h.move(j,k,!1,l):(a.postpone?h.line(j,f,!1,g):h.line(e,k,!1,l),h.line(j,k,!1,l)),e=j,f=k,g=l):a.fillHoles||(e=f=g=void 0)}return h}}}(window,document,a),function(a,b,c){"use strict";c.EventEmitter=function(){function a(a,b){d[a]=d[a]||[],d[a].push(b)}function b(a,b){d[a]&&(b?(d[a].splice(d[a].indexOf(b),1),0===d[a].length&&delete d[a]):delete d[a])}function c(a,b){d[a]&&d[a].forEach(function(a){a(b)}),d["*"]&&d["*"].forEach(function(c){c(a,b)})}var d=[];return{addEventHandler:a,removeEventHandler:b,emit:c}}}(window,document,a),function(a,b,c){"use strict";function d(a){var b=[];if(a.length)for(var c=0;c<a.length;c++)b.push(a[c]);return b}function e(a,b){var d=b||this.prototype||c.Class,e=Object.create(d);c.Class.cloneDefinitions(e,a);var f=function(){var a,b=e.constructor||function(){};return a=this===c?Object.create(e):this,b.apply(a,Array.prototype.slice.call(arguments,0)),a};return f.prototype=e,f["super"]=d,f.extend=this.extend,f}function f(){var a=d(arguments),b=a[0];
90return a.splice(1,a.length-1).forEach(function(a){Object.getOwnPropertyNames(a).forEach(function(c){delete b[c],Object.defineProperty(b,c,Object.getOwnPropertyDescriptor(a,c))})}),b}c.Class={extend:e,cloneDefinitions:f}}(window,document,a),function(a,b,c){"use strict";function d(a,b,d){return a&&(this.data=a||{},this.data.labels=this.data.labels||[],this.data.series=this.data.series||[],this.eventEmitter.emit("data",{type:"update",data:this.data})),b&&(this.options=c.extend({},d?this.options:this.defaultOptions,b),this.initializeTimeoutId||(this.optionsProvider.removeMediaQueryListeners(),this.optionsProvider=c.optionsProvider(this.options,this.responsiveOptions,this.eventEmitter))),this.initializeTimeoutId||this.createChart(this.optionsProvider.getCurrentOptions()),this}function e(){return this.initializeTimeoutId?a.clearTimeout(this.initializeTimeoutId):(a.removeEventListener("resize",this.resizeListener),this.optionsProvider.removeMediaQueryListeners()),this}function f(a,b){return this.eventEmitter.addEventHandler(a,b),this}function g(a,b){return this.eventEmitter.removeEventHandler(a,b),this}function h(){a.addEventListener("resize",this.resizeListener),this.optionsProvider=c.optionsProvider(this.options,this.responsiveOptions,this.eventEmitter),this.eventEmitter.addEventHandler("optionsChanged",function(){this.update()}.bind(this)),this.options.plugins&&this.options.plugins.forEach(function(a){a instanceof Array?a[0](this,a[1]):a(this)}.bind(this)),this.eventEmitter.emit("data",{type:"initial",data:this.data}),this.createChart(this.optionsProvider.getCurrentOptions()),this.initializeTimeoutId=void 0}function i(a,b,d,e,f){this.container=c.querySelector(a),this.data=b||{},this.data.labels=this.data.labels||[],this.data.series=this.data.series||[],this.defaultOptions=d,this.options=e,this.responsiveOptions=f,this.eventEmitter=c.EventEmitter(),this.supportsForeignObject=c.Svg.isSupported("Extensibility"),this.supportsAnimations=c.Svg.isSupported("AnimationEventsAttribute"),this.resizeListener=function(){this.update()}.bind(this),this.container&&(this.container.__chartist__&&this.container.__chartist__.detach(),this.container.__chartist__=this),this.initializeTimeoutId=setTimeout(h.bind(this),0)}c.Base=c.Class.extend({constructor:i,optionsProvider:void 0,container:void 0,svg:void 0,eventEmitter:void 0,createChart:function(){throw new Error("Base chart type can't be instantiated!")},update:d,detach:e,on:f,off:g,version:c.version,supportsForeignObject:!1})}(window,document,a),function(a,b,c){"use strict";function d(a,d,e,f,g){a instanceof Element?this._node=a:(this._node=b.createElementNS(c.namespaces.svg,a),"svg"===a&&this.attr({"xmlns:ct":c.namespaces.ct})),d&&this.attr(d),e&&this.addClass(e),f&&(g&&f._node.firstChild?f._node.insertBefore(this._node,f._node.firstChild):f._node.appendChild(this._node))}function e(a,b){return"string"==typeof a?b?this._node.getAttributeNS(b,a):this._node.getAttribute(a):(Object.keys(a).forEach(function(b){if(void 0!==a[b])if(b.indexOf(":")!==-1){var d=b.split(":");this._node.setAttributeNS(c.namespaces[d[0]],b,a[b])}else this._node.setAttribute(b,a[b])}.bind(this)),this)}function f(a,b,d,e){return new c.Svg(a,b,d,this,e)}function g(){return this._node.parentNode instanceof SVGElement?new c.Svg(this._node.parentNode):null}function h(){for(var a=this._node;"svg"!==a.nodeName;)a=a.parentNode;return new c.Svg(a)}function i(a){var b=this._node.querySelector(a);return b?new c.Svg(b):null}function j(a){var b=this._node.querySelectorAll(a);return b.length?new c.Svg.List(b):null}function k(){return this._node}function l(a,d,e,f){if("string"==typeof a){var g=b.createElement("div");g.innerHTML=a,a=g.firstChild}a.setAttribute("xmlns",c.namespaces.xmlns);var h=this.elem("foreignObject",d,e,f);return h._node.appendChild(a),h}function m(a){return this._node.appendChild(b.createTextNode(a)),this}function n(){for(;this._node.firstChild;)this._node.removeChild(this._node.firstChild);return this}function o(){return this._node.parentNode.removeChild(this._node),this.parent()}function p(a){return this._node.parentNode.replaceChild(a._node,this._node),a}function q(a,b){return b&&this._node.firstChild?this._node.insertBefore(a._node,this._node.firstChild):this._node.appendChild(a._node),this}function r(){return this._node.getAttribute("class")?this._node.getAttribute("class").trim().split(/\s+/):[]}function s(a){return this._node.setAttribute("class",this.classes(this._node).concat(a.trim().split(/\s+/)).filter(function(a,b,c){return c.indexOf(a)===b}).join(" ")),this}function t(a){var b=a.trim().split(/\s+/);return this._node.setAttribute("class",this.classes(this._node).filter(function(a){return b.indexOf(a)===-1}).join(" ")),this}function u(){return this._node.setAttribute("class",""),this}function v(){return this._node.getBoundingClientRect().height}function w(){return this._node.getBoundingClientRect().width}function x(a,b,d){return void 0===b&&(b=!0),Object.keys(a).forEac
90h(function(e){function f(a,b){var f,g,h,i={};a.easing&&(h=a.easing instanceof Array?a.easing:c.Svg.Easing[a.easing],delete a.easing),a.begin=c.ensureUnit(a.begin,"ms"),a.dur=c.ensureUnit(a.dur,"ms"),h&&(a.calcMode="spline",a.keySplines=h.join(" "),a.keyTimes="0;1"),b&&(a.fill="freeze",i[e]=a.from,this.attr(i),g=c.quantity(a.begin||0).value,a.begin="indefinite"),f=this.elem("animate",c.extend({attributeName:e},a)),b&&setTimeout(function(){try{f._node.beginElement()}catch(b){i[e]=a.to,this.attr(i),f.remove()}}.bind(this),g),d&&f._node.addEventListener("beginEvent",function(){d.emit("animationBegin",{element:this,animate:f._node,params:a})}.bind(this)),f._node.addEventListener("endEvent",function(){d&&d.emit("animationEnd",{element:this,animate:f._node,params:a}),b&&(i[e]=a.to,this.attr(i),f.remove())}.bind(this))}a[e]instanceof Array?a[e].forEach(function(a){f.bind(this)(a,!1)}.bind(this)):f.bind(this)(a[e],b)}.bind(this)),this}function y(a){var b=this;this.svgElements=[];for(var d=0;d<a.length;d++)this.svgElements.push(new c.Svg(a[d]));Object.keys(c.Svg.prototype).filter(function(a){return["constructor","parent","querySelector","querySelectorAll","replace","append","classes","height","width"].indexOf(a)===-1}).forEach(function(a){b[a]=function(){var d=Array.prototype.slice.call(arguments,0);return b.svgElements.forEach(function(b){c.Svg.prototype[a].apply(b,d)}),b}})}c.Svg=c.Class.extend({constructor:d,attr:e,elem:f,parent:g,root:h,querySelector:i,querySelectorAll:j,getNode:k,foreignObject:l,text:m,empty:n,remove:o,replace:p,append:q,classes:r,addClass:s,removeClass:t,removeAllClasses:u,height:v,width:w,animate:x}),c.Svg.isSupported=function(a){return b.implementation.hasFeature("http://www.w3.org/TR/SVG11/feature#"+a,"1.1")};var z={easeInSine:[.47,0,.745,.715],easeOutSine:[.39,.575,.565,1],easeInOutSine:[.445,.05,.55,.95],easeInQuad:[.55,.085,.68,.53],easeOutQuad:[.25,.46,.45,.94],easeInOutQuad:[.455,.03,.515,.955],easeInCubic:[.55,.055,.675,.19],easeOutCubic:[.215,.61,.355,1],easeInOutCubic:[.645,.045,.355,1],easeInQuart:[.895,.03,.685,.22],easeOutQuart:[.165,.84,.44,1],easeInOutQuart:[.77,0,.175,1],easeInQuint:[.755,.05,.855,.06],easeOutQuint:[.23,1,.32,1],easeInOutQuint:[.86,0,.07,1],easeInExpo:[.95,.05,.795,.035],easeOutExpo:[.19,1,.22,1],easeInOutExpo:[1,0,0,1],easeInCirc:[.6,.04,.98,.335],easeOutCirc:[.075,.82,.165,1],easeInOutCirc:[.785,.135,.15,.86],easeInBack:[.6,-.28,.735,.045],easeOutBack:[.175,.885,.32,1.275],easeInOutBack:[.68,-.55,.265,1.55]};c.Svg.Easing=z,c.Svg.List=c.Class.extend({constructor:y})}(window,document,a),function(a,b,c){"use strict";function d(a,b,d,e,f,g){var h=c.extend({command:f?a.toLowerCase():a.toUpperCase()},b,g?{data:g}:{});d.splice(e,0,h)}function e(a,b){a.forEach(function(c,d){u[c.command.toLowerCase()].forEach(function(e,f){b(c,e,d,f,a)})})}function f(a,b){this.pathElements=[],this.pos=0,this.close=a,this.options=c.extend({},v,b)}function g(a){return void 0!==a?(this.pos=Math.max(0,Math.min(this.pathElements.length,a)),this):this.pos}function h(a){return this.pathElements.splice(this.pos,a),this}function i(a,b,c,e){return d("M",{x:+a,y:+b},this.pathElements,this.pos++,c,e),this}function j(a,b,c,e){return d("L",{x:+a,y:+b},this.pathElements,this.pos++,c,e),this}function k(a,b,c,e,f,g,h,i){return d("C",{x1:+a,y1:+b,x2:+c,y2:+e,x:+f,y:+g},this.pathElements,this.pos++,h,i),this}function l(a,b,c,e,f,g,h,i,j){return d("A",{rx:+a,ry:+b,xAr:+c,lAf:+e,sf:+f,x:+g,y:+h},this.pathElements,this.pos++,i,j),this}function m(a){var b=a.replace(/([A-Za-z])([0-9])/g,"$1 $2").replace(/([0-9])([A-Za-z])/g,"$1 $2").split(/[\s,]+/).reduce(function(a,b){return b.match(/[A-Za-z]/)&&a.push([]),a[a.length-1].push(b),a},[]);"Z"===b[b.length-1][0].toUpperCase()&&b.pop();var d=b.map(function(a){var b=a.shift(),d=u[b.toLowerCase()];return c.extend({command:b},d.reduce(function(b,c,d){return b[c]=+a[d],b},{}))}),e=[this.pos,0];return Array.prototype.push.apply(e,d),Array.prototype.splice.apply(this.pathElements,e),this.pos+=d.length,this}function n(){var a=Math.pow(10,this.options.accuracy);return this.pathElements.reduce(function(b,c){var d=u[c.command.toLowerCase()].map(function(b){return this.options.accuracy?Math.round(c[b]*a)/a:c[b]}.bind(this));return b+c.command+d.join(",")}.bind(this),"")+(this.close?"Z":"")}function o(a,b){return e(this.pathElements,function(c,d){c[d]*="x"===d[0]?a:b}),this}function p(a,b){return e(this.pathElements,function(c,d){c[d]+="x"===d[0]?a:b}),this}function q(a){return e(this.pathElements,function(b,c,d,e,f){var g=a(b,c,d,e,f);(g||0===g)&&(b[c]=g)}),this}function r(a){var b=new c.Svg.Path(a||this.close);return b.pos=this.pos,b.pathElements=this.pathElements.slice().map(function(a){return c.extend({},a)}),b.options=c.extend({},this.options),b}function s(a){var b=[new c.Svg.Path];
90return this.pathElements.forEach(function(d){d.command===a.toUpperCase()&&0!==b[b.length-1].pathElements.length&&b.push(new c.Svg.Path),b[b.length-1].pathElements.push(d)}),b}function t(a,b,d){for(var e=new c.Svg.Path(b,d),f=0;f<a.length;f++)for(var g=a[f],h=0;h<g.pathElements.length;h++)e.pathElements.push(g.pathElements[h]);return e}var u={m:["x","y"],l:["x","y"],c:["x1","y1","x2","y2","x","y"],a:["rx","ry","xAr","lAf","sf","x","y"]},v={accuracy:3};c.Svg.Path=c.Class.extend({constructor:f,position:g,remove:h,move:i,line:j,curve:k,arc:l,scale:o,translate:p,transform:q,parse:m,stringify:n,clone:r,splitByCommand:s}),c.Svg.Path.elementDescriptions=u,c.Svg.Path.join=t}(window,document,a),function(a,b,c){"use strict";function d(a,b,c,d){this.units=a,this.counterUnits=a===f.x?f.y:f.x,this.chartRect=b,this.axisLength=b[a.rectEnd]-b[a.rectStart],this.gridOffset=b[a.rectOffset],this.ticks=c,this.options=d}function e(a,b,d,e,f){var g=e["axis"+this.units.pos.toUpperCase()],h=this.ticks.map(this.projectValue.bind(this)),i=this.ticks.map(g.labelInterpolationFnc);h.forEach(function(j,k){var l,m={x:0,y:0};l=h[k+1]?h[k+1]-j:Math.max(this.axisLength-j,30),c.isFalseyButZero(i[k])&&""!==i[k]||("x"===this.units.pos?(j=this.chartRect.x1+j,m.x=e.axisX.labelOffset.x,"start"===e.axisX.position?m.y=this.chartRect.padding.top+e.axisX.labelOffset.y+(d?5:20):m.y=this.chartRect.y1+e.axisX.labelOffset.y+(d?5:20)):(j=this.chartRect.y1-j,m.y=e.axisY.labelOffset.y-(d?l:0),"start"===e.axisY.position?m.x=d?this.chartRect.padding.left+e.axisY.labelOffset.x:this.chartRect.x1-10:m.x=this.chartRect.x2+e.axisY.labelOffset.x+10),g.showGrid&&c.createGrid(j,k,this,this.gridOffset,this.chartRect[this.counterUnits.len](),a,[e.classNames.grid,e.classNames[this.units.dir]],f),g.showLabel&&c.createLabel(j,l,k,i,this,g.offset,m,b,[e.classNames.label,e.classNames[this.units.dir],"start"===g.position?e.classNames[g.position]:e.classNames.end],d,f))}.bind(this))}var f={x:{pos:"x",len:"width",dir:"horizontal",rectStart:"x1",rectEnd:"x2",rectOffset:"y2"},y:{pos:"y",len:"height",dir:"vertical",rectStart:"y2",rectEnd:"y1",rectOffset:"x1"}};c.Axis=c.Class.extend({constructor:d,createGridAndLabels:e,projectValue:function(a,b,c){throw new Error("Base axis can't be instantiated!")}}),c.Axis.units=f}(window,document,a),function(a,b,c){"use strict";function d(a,b,d,e){var f=e.highLow||c.getHighLow(b,e,a.pos);this.bounds=c.getBounds(d[a.rectEnd]-d[a.rectStart],f,e.scaleMinSpace||20,e.onlyInteger),this.range={min:this.bounds.min,max:this.bounds.max},c.AutoScaleAxis["super"].constructor.call(this,a,d,this.bounds.values,e)}function e(a){return this.axisLength*(+c.getMultiValue(a,this.units.pos)-this.bounds.min)/this.bounds.range}c.AutoScaleAxis=c.Axis.extend({constructor:d,projectValue:e})}(window,document,a),function(a,b,c){"use strict";function d(a,b,d,e){var f=e.highLow||c.getHighLow(b,e,a.pos);this.divisor=e.divisor||1,this.ticks=e.ticks||c.times(this.divisor).map(function(a,b){return f.low+(f.high-f.low)/this.divisor*b}.bind(this)),this.ticks.sort(function(a,b){return a-b}),this.range={min:f.low,max:f.high},c.FixedScaleAxis["super"].constructor.call(this,a,d,this.ticks,e),this.stepLength=this.axisLength/this.divisor}function e(a){return this.axisLength*(+c.getMultiValue(a,this.units.pos)-this.range.min)/(this.range.max-this.range.min)}c.FixedScaleAxis=c.Axis.extend({constructor:d,projectValue:e})}(window,document,a),function(a,b,c){"use strict";function d(a,b,d,e){c.StepAxis["super"].constructor.call(this,a,d,e.ticks,e);var f=Math.max(1,e.ticks.length-(e.stretch?1:0));this.stepLength=this.axisLength/f}function e(a,b){return this.stepLength*b}c.StepAxis=c.Axis.extend({constructor:d,projectValue:e})}(window,document,a),function(a,b,c){"use strict";function d(a){var b=c.normalizeData(this.data,a.reverseData,!0);this.svg=c.createSvg(this.container,a.width,a.height,a.classNames.chart);var d,e,g=this.svg.elem("g").addClass(a.classNames.gridGroup),h=this.svg.elem("g"),i=this.svg.elem("g").addClass(a.classNames.labelGroup),j=c.createChartRect(this.svg,a,f.padding);d=void 0===a.axisX.type?new c.StepAxis(c.Axis.units.x,b.normalized.series,j,c.extend({},a.axisX,{ticks:b.normalized.labels,stretch:a.fullWidth})):a.axisX.type.call(c,c.Axis.units.x,b.normalized.series,j,a.axisX),e=void 0===a.axisY.type?new c.AutoScaleAxis(c.Axis.units.y,b.normalized.series,j,c.extend({},a.axisY,{high:c.isNumeric(a.high)?a.high:a.axisY.high,low:c.isNumeric(a.low)?a.low:a.axisY.low}
90)):a.axisY.type.call(c,c.Axis.units.y,b.normalized.series,j,a.axisY),d.createGridAndLabels(g,i,this.supportsForeignObject,a,this.eventEmitter),e.createGridAndLabels(g,i,this.supportsForeignObject,a,this.eventEmitter),a.showGridBackground&&c.createGridBackground(g,j,a.classNames.gridBackground,this.eventEmitter),b.raw.series.forEach(function(f,g){var i=h.elem("g");i.attr({"ct:series-name":f.name,"ct:meta":c.serialize(f.meta)}),i.addClass([a.classNames.series,f.className||a.classNames.series+"-"+c.alphaNumerate(g)].join(" "));var k=[],l=[];b.normalized.series[g].forEach(function(a,h){var i={x:j.x1+d.projectValue(a,h,b.normalized.series[g]),y:j.y1-e.projectValue(a,h,b.normalized.series[g])};k.push(i.x,i.y),l.push({value:a,valueIndex:h,meta:c.getMetaData(f,h)})}.bind(this));var m={lineSmooth:c.getSeriesOption(f,a,"lineSmooth"),showPoint:c.getSeriesOption(f,a,"showPoint"),showLine:c.getSeriesOption(f,a,"showLine"),showArea:c.getSeriesOption(f,a,"showArea"),areaBase:c.getSeriesOption(f,a,"areaBase")},n="function"==typeof m.lineSmooth?m.lineSmooth:m.lineSmooth?c.Interpolation.monotoneCubic():c.Interpolation.none(),o=n(k,l);if(m.showPoint&&o.pathElements.forEach(function(b){var h=i.elem("line",{x1:b.x,y1:b.y,x2:b.x+.01,y2:b.y},a.classNames.point).attr({"ct:value":[b.data.value.x,b.data.value.y].filter(c.isNumeric).join(","),"ct:meta":c.serialize(b.data.meta)});this.eventEmitter.emit("draw",{type:"point",value:b.data.value,index:b.data.valueIndex,meta:b.data.meta,series:f,seriesIndex:g,axisX:d,axisY:e,group:i,element:h,x:b.x,y:b.y})}.bind(this)),m.showLine){var p=i.elem("path",{d:o.stringify()},a.classNames.line,!0);this.eventEmitter.emit("draw",{type:"line",values:b.normalized.series[g],path:o.clone(),chartRect:j,index:g,series:f,seriesIndex:g,seriesMeta:f.meta,axisX:d,axisY:e,group:i,element:p})}if(m.showArea&&e.range){var q=Math.max(Math.min(m.areaBase,e.range.max),e.range.min),r=j.y1-e.projectValue(q);o.splitByCommand("M").filter(function(a){return a.pathElements.length>1}).map(function(a){var b=a.pathElements[0],c=a.pathElements[a.pathElements.length-1];return a.clone(!0).position(0).remove(1).move(b.x,r).line(b.x,b.y).position(a.pathElements.length+1).line(c.x,r)}).forEach(function(c){var h=i.elem("path",{d:c.stringify()},a.classNames.area,!0);this.eventEmitter.emit("draw",{type:"area",values:b.normalized.series[g],path:c.clone(),series:f,seriesIndex:g,axisX:d,axisY:e,chartRect:j,index:g,group:i,element:h})}.bind(this))}}.bind(this)),this.eventEmitter.emit("created",{bounds:e.bounds,chartRect:j,axisX:d,axisY:e,svg:this.svg,options:a})}function e(a,b,d,e){c.Line["super"].constructor.call(this,a,b,f,c.extend({},f,d),e)}var f={axisX:{offset:30,position:"end",labelOffset:{x:0,y:0},showLabel:!0,showGrid:!0,labelInterpolationFnc:c.noop,type:void 0},axisY:{offset:40,position:"start",labelOffset:{x:0,y:0},showLabel:!0,showGrid:!0,labelInterpolationFnc:c.noop,type:void 0,scaleMinSpace:20,onlyInteger:!1},width:void 0,height:void 0,showLine:!0,showPoint:!0,showArea:!1,areaBase:0,lineSmooth:!0,showGridBackground:!1,low:void 0,high:void 0,chartPadding:{top:15,right:15,bottom:5,left:10},fullWidth:!1,reverseData:!1,classNames:{chart:"ct-chart-line",label:"ct-label",labelGroup:"ct-labels",series:"ct-series",line:"ct-line",point:"ct-point",area:"ct-area",grid:"ct-grid",gridGroup:"ct-grids",gridBackground:"ct-grid-background",vertical:"ct-vertical",horizontal:"ct-horizontal",start:"ct-start",end:"ct-end"}};c.Line=c.Base.extend({constructor:e,createChart:d})}(window,document,a),function(a,b,c){"use strict";function d(a){var b,d;a.distributeSeries?(b=c.normalizeData(this.data,a.reverseData,a.horizontalBars?"x":"y"),b.normalized.series=b.normalized.series.map(function(a){return[a]})):b=c.normalizeData(this.data,a.reverseData,a.horizontalBars?"x":"y"),this.svg=c.createSvg(this.container,a.width,a.height,a.classNames.chart+(a.horizontalBars?" "+a.classNames.horizontalBars:""));var e=this.svg.elem("g").addClass(a.classNames.gridGroup),g=this.svg.elem("g"),h=this.svg.elem("g").addClass(a.classNames.labelGroup);
90if(a.stackBars&&0!==b.normalized.series.length){var i=c.serialMap(b.normalized.series,function(){return Array.prototype.slice.call(arguments).map(function(a){return a}).reduce(function(a,b){return{x:a.x+(b&&b.x)||0,y:a.y+(b&&b.y)||0}},{x:0,y:0})});d=c.getHighLow([i],a,a.horizontalBars?"x":"y")}else d=c.getHighLow(b.normalized.series,a,a.horizontalBars?"x":"y");d.high=+a.high||(0===a.high?0:d.high),d.low=+a.low||(0===a.low?0:d.low);var j,k,l,m,n,o=c.createChartRect(this.svg,a,f.padding);k=a.distributeSeries&&a.stackBars?b.normalized.labels.slice(0,1):b.normalized.labels,a.horizontalBars?(j=m=void 0===a.axisX.type?new c.AutoScaleAxis(c.Axis.units.x,b.normalized.series,o,c.extend({},a.axisX,{highLow:d,referenceValue:0})):a.axisX.type.call(c,c.Axis.units.x,b.normalized.series,o,c.extend({},a.axisX,{highLow:d,referenceValue:0})),l=n=void 0===a.axisY.type?new c.StepAxis(c.Axis.units.y,b.normalized.series,o,{ticks:k}):a.axisY.type.call(c,c.Axis.units.y,b.normalized.series,o,a.axisY)):(l=m=void 0===a.axisX.type?new c.StepAxis(c.Axis.units.x,b.normalized.series,o,{ticks:k}):a.axisX.type.call(c,c.Axis.units.x,b.normalized.series,o,a.axisX),j=n=void 0===a.axisY.type?new c.AutoScaleAxis(c.Axis.units.y,b.normalized.series,o,c.extend({},a.axisY,{highLow:d,referenceValue:0})):a.axisY.type.call(c,c.Axis.units.y,b.normalized.series,o,c.extend({},a.axisY,{highLow:d,referenceValue:0})));var p=a.horizontalBars?o.x1+j.projectValue(0):o.y1-j.projectValue(0),q=[];l.createGridAndLabels(e,h,this.supportsForeignObject,a,this.eventEmitter),j.createGridAndLabels(e,h,this.supportsForeignObject,a,this.eventEmitter),a.showGridBackground&&c.createGridBackground(e,o,a.classNames.gridBackground,this.eventEmitter),b.raw.series.forEach(function(d,e){var f,h,i=e-(b.raw.series.length-1)/2;f=a.distributeSeries&&!a.stackBars?l.axisLength/b.normalized.series.length/2:a.distributeSeries&&a.stackBars?l.axisLength/2:l.axisLength/b.normalized.series[e].length/2,h=g.elem("g"),h.attr({"ct:series-name":d.name,"ct:meta":c.serialize(d.meta)}),h.addClass([a.classNames.series,d.className||a.classNames.series+"-"+c.alphaNumerate(e)].join(" ")),b.normalized.series[e].forEach(function(g,k){var r,s,t,u;if(u=a.distributeSeries&&!a.stackBars?e:a.distributeSeries&&a.stackBars?0:k,r=a.horizontalBars?{x:o.x1+j.projectValue(g&&g.x?g.x:0,k,b.normalized.series[e]),y:o.y1-l.projectValue(g&&g.y?g.y:0,u,b.normalized.series[e])}:{x:o.x1+l.projectValue(g&&g.x?g.x:0,u,b.normalized.series[e]),y:o.y1-j.projectValue(g&&g.y?g.y:0,k,b.normalized.series[e])},l instanceof c.StepAxis&&(l.options.stretch||(r[l.units.pos]+=f*(a.horizontalBars?-1:1)),r[l.units.pos]+=a.stackBars||a.distributeSeries?0:i*a.seriesBarDistance*(a.horizontalBars?-1:1)),t=q[k]||p,q[k]=t-(p-r[l.counterUnits.pos]),void 0!==g){var v={};v[l.units.pos+"1"]=r[l.units.pos],v[l.units.pos+"2"]=r[l.units.pos],!a.stackBars||"accumulate"!==a.stackMode&&a.stackMode?(v[l.counterUnits.pos+"1"]=p,v[l.counterUnits.pos+"2"]=r[l.counterUnits.pos]):(v[l.counterUnits.pos+"1"]=t,v[l.counterUnits.pos+"2"]=q[k]),v.x1=Math.min(Math.max(v.x1,o.x1),o.x2),v.x2=Math.min(Math.max(v.x2,o.x1),o.x2),v.y1=Math.min(Math.max(v.y1,o.y2),o.y1),v.y2=Math.min(Math.max(v.y2,o.y2),o.y1);var w=c.getMetaData(d,k);s=h.elem("line",v,a.classNames.bar).attr({"ct:value":[g.x,g.y].filter(c.isNumeric).join(","),"ct:meta":c.serialize(w)}),this.eventEmitter.emit("draw",c.extend({type:"bar",value:g,index:k,meta:w,series:d,seriesIndex:e,axisX:m,axisY:n,chartRect:o,group:h,element:s},v))}}.bind(this))}.bind(this)),this.eventEmitter.emit("created",{bounds:j.bounds,chartRect:o,axisX:m,axisY:n,svg:this.svg,options:a})}function e(a,b,d,e){c.Bar["super"].constructor.call(this,a,b,f,c.extend({},f,d),e)}var f={axisX:{offset:30,position:"end",labelOffset:{x:0,y:0},showLabel:!0,showGrid:!0,labelInterpolationFnc:c.noop,scaleMinSpace:30,onlyInteger:!1},axisY:{offset:40,position:"start",labelOffset:{x:0,y:0},showLabel:!0,showGrid:!0,labelInterpolationFnc:c.noop,scaleMinSpace:20,onlyInteger:!1},width:void 0,height:void 0,high:void 0,low:void 0,referenceValue:0,chartPadding:{top:15,right:15,bottom:5,left:10},seriesBarDistance:15,stackBars:!1,stackMode:"accumulate",horizontalBars:!1,distributeSeries:!1,reverseData:!1,showGridBackgroun
90d:!1,classNames:{chart:"ct-chart-bar",horizontalBars:"ct-horizontal-bars",label:"ct-label",labelGroup:"ct-labels",series:"ct-series",bar:"ct-bar",grid:"ct-grid",gridGroup:"ct-grids",gridBackground:"ct-grid-background",vertical:"ct-vertical",horizontal:"ct-horizontal",start:"ct-start",end:"ct-end"}};c.Bar=c.Base.extend({constructor:e,createChart:d})}(window,document,a),function(a,b,c){"use strict";function d(a,b,c){var d=b.x>a.x;return d&&"explode"===c||!d&&"implode"===c?"start":d&&"implode"===c||!d&&"explode"===c?"end":"middle"}function e(a){var b,e,f,h,i,j=c.normalizeData(this.data),k=[],l=a.startAngle;this.svg=c.createSvg(this.container,a.width,a.height,a.donut?a.classNames.chartDonut:a.classNames.chartPie),e=c.createChartRect(this.svg,a,g.padding),f=Math.min(e.width()/2,e.height()/2),i=a.total||j.normalized.series.reduce(function(a,b){return a+b},0);var m=c.quantity(a.donutWidth);"%"===m.unit&&(m.value*=f/100),f-=a.donut&&!a.donutSolid?m.value/2:0,h="outside"===a.labelPosition||a.donut&&!a.donutSolid?f:"center"===a.labelPosition?0:a.donutSolid?f-m.value/2:f/2,h+=a.labelOffset;var n={x:e.x1+e.width()/2,y:e.y2+e.height()/2},o=1===j.raw.series.filter(function(a){return a.hasOwnProperty("value")?0!==a.value:0!==a}).length;j.raw.series.forEach(function(a,b){k[b]=this.svg.elem("g",null,null)}.bind(this)),a.showLabel&&(b=this.svg.elem("g",null,null)),j.raw.series.forEach(function(e,g){if(0!==j.normalized.series[g]||!a.ignoreEmptyValues){k[g].attr({"ct:series-name":e.name}),k[g].addClass([a.classNames.series,e.className||a.classNames.series+"-"+c.alphaNumerate(g)].join(" "));var p=i>0?l+j.normalized.series[g]/i*360:0,q=Math.max(0,l-(0===g||o?0:.2));p-q>=359.99&&(p=q+359.99);var r,s,t,u=c.polarToCartesian(n.x,n.y,f,q),v=c.polarToCartesian(n.x,n.y,f,p),w=new c.Svg.Path(!a.donut||a.donutSolid).move(v.x,v.y).arc(f,f,0,p-l>180,0,u.x,u.y);a.donut?a.donutSolid&&(t=f-m.value,r=c.polarToCartesian(n.x,n.y,t,l-(0===g||o?0:.2)),s=c.polarToCartesian(n.x,n.y,t,p),w.line(r.x,r.y),w.arc(t,t,0,p-l>180,1,s.x,s.y)):w.line(n.x,n.y);var x=a.classNames.slicePie;a.donut&&(x=a.classNames.sliceDonut,a.donutSolid&&(x=a.classNames.sliceDonutSolid));var y=k[g].elem("path",{d:w.stringify()},x);if(y.attr({"ct:value":j.normalized.series[g],"ct:meta":c.serialize(e.meta)}),a.donut&&!a.donutSolid&&(y._node.style.strokeWidth=m.value+"px"),this.eventEmitter.emit("draw",{type:"slice",value:j.normalized.series[g],totalDataSum:i,index:g,meta:e.meta,series:e,group:k[g],element:y,path:w.clone(),center:n,radius:f,startAngle:l,endAngle:p}),a.showLabel){var z;z=1===j.raw.series.length?{x:n.x,y:n.y}:c.polarToCartesian(n.x,n.y,h,l+(p-l)/2);var A;A=j.normalized.labels&&!c.isFalseyButZero(j.normalized.labels[g])?j.normalized.labels[g]:j.normalized.series[g];var B=a.labelInterpolationFnc(A,g);if(B||0===B){var C=b.elem("text",{dx:z.x,dy:z.y,"text-anchor":d(n,z,a.labelDirection)},a.classNames.label).text(""+B);this.eventEmitter.emit("draw",{type:"label",index:g,group:b,element:C,text:""+B,x:z.x,y:z.y})}}l=p}}.bind(this)),this.eventEmitter.emit("created",{chartRect:e,svg:this.svg,options:a})}function f(a,b,d,e){c.Pie["super"].constructor.call(this,a,b,g,c.extend({},g,d),e)}var g={width:void 0,height:void 0,chartPadding:5,classNames:{chartPie:"ct-chart-pie",chartDonut:"ct-chart-donut",series:"ct-series",slicePie:"ct-slice-pie",sliceDonut:"ct-slice-donut",sliceDonutSolid:"ct-slice-donut-solid",label:"ct-label"},startAngle:0,total:void 0,donut:!1,donutSolid:!1,donutWidth:60,showLabel:!0,labelOffset:0,labelPosition:"inside",labelInterpolationFnc:c.noop,labelDirection:"neutral",reverseData:!1,ignoreEmptyValues:!1};c.Pie=c.Base.extend({constructor:f,createChart:e,determineAnchorPosition:d})}(window,document,a),a});var x_collection=[];x_url();var
91txt_uvereny='Óâåðåíû?',err_required='Ïîæàëóéñòà, çàïîëíèòå âñå ïîëÿ, ïîìå÷åííûå êðàñíîé çâåçäî÷êîé.',x_ajax_loader='<img src="'+x_collection.url_home+'i/lf.gif" class="ajax_loader">',x_ajax_path=x_collection.url_ajax,x_cookie_path=x_collection.domain_cookie;function x_url(){x_collection['url_home']='';x_collection['domain_cookie']='';var
92loc=window.location,host=loc.host.split('.');x_collection.url_home=loc.protocol+'//'+host.slice(-2).join('.')+'/';x_collection.url_ajax=loc.protocol+'//'+loc.host+'/';x_collection.domain_cookie=host.slice(-2).join('.');}
93function x_player_play(playlist_id,index,file,title){$('#p').show();var $li=$("#player-list-"+playlist_id).find("li").eq(index);if($('#html5audio').length==0)$('<audio id="html5audio"></audio>').appendTo('body');var audio=document.getElementById("html5audio");if($li.hasClass("active")){audio.pause();$li.removeClass("active");}else{if(audio.src!=x_collection.url_home+'f/a/'+file){audio.src=x_collection.url_home+'f/a/'+file;audio.load();}
94audio.play();if(x_collection.player_list==undefined){x_collection.player_list=[];}
95for(var i in x_collection.player_list){$("#player-list-"+x_collection.player_list[i]).find("li").removeClass("active");}
96$li.addClass("active");if(x_collection.player_list.indexOf(playlist_id)==-1){x_collection.player_list.push(playlist_id);}}}
97function x_video_iframe(id,hex){$("#video-"+id).find(".note_video_wrapper, .pageblock_video_wrapper").empty().append(str_hex(hex,true));}
98function x_vimeo(id,file){$("#video-"+id).find(".note_video_wrapper, .pageblock_video_wrapper").empty().append('<iframe src="https://player.vimeo.com/video/'+file+'?autoplay=1" frameborder="0" webkitAllowFullScreen mozallowfullscreen allowFullScreen></iframe>');}
99function x_youtube(id,file,start){$("#video-"+id).find(".note_video_wrapper, .pageblock_video_wrapper").empty().append('<iframe src="https://www.youtube.com/embed/'+file+"?autoplay=1&rel=0"+(start==""?"":"&start="+start)+'" frameborder="0" allowfullscreen></iframe>');}
100function x_youtube_playlist(id,file){$("#video-"+id).find(".note_video_wrapper, .pageblock_video_wrapper").empty().append('<iframe src="https://www.youtube.com/embed/?list='+file+'&autoplay=1" frameborder="0" allowfullscreen></iframe>');}
101function x_youtube_playlist_item(id,file,item){$("#video-"+id).find(".note_video_wrapper, .pageblock_video_wrapper").empty().append('<iframe src="https://www.youtube.com/embed/'+item+"?list="+file+'&autoplay=1" frameborder="0" allowfullscreen></iframe>');}
102function Fixcase(){var self=this;self.abbr=['BWV','FX','JA','JD','LA','NC','NN','US','VIA','VS','ÀÀÖ','ÀÐÍÎ','ÀÒÐ','ÁÃÑÎ','ÁÑÎ','ÂÃÒÐÊ','ÂÌÎÌÊ','ÂÌÔ','ÃÀÑÎ','ÃÁÊÇ','ÃÁÓÐÀ','ÃÊÇ','ÃÊÎ','ÃÐÎÖ','ÃÑÎ','ÃÒÐÊ','ÄÀÑ','ÄÂÀÑÎ','ÊÇ','ÊÊÇ','ÊÒÖ','ÊÔÎ','ÌÀÑÎ','ÌÁÔ','ÌÂÄ','ÌÃÀÑÎ','ÌÃÀÔ','ÌÃÊ','ÌÃÒÓ','ÌÌÄÌ','ÌÑÑÌØ','ÌÕÒ','ÍÍÃÊ','ÍÐÍÎ','ÍÔÎÐ','ÎÀÎ','ÎÎÎ','ÎÐÍÈ','ÏÃÀÈÊ','ÏÃÈÊ','ÐÀ','ÐÀÌ','ÐÀÑÎ','ÐÁ','ÐÄ','ÐÊ','ÐÌ','ÐÍÄÌ','ÐÍÎ','ÐÎ','ÐÑ','ÐÑÔÑÐ','ÐÒ','ÐÔ','ÑÑÑÐ','ÑØÀ','ÒÀÑÎ','ÓÀÔÎ','ÓÐ','ÖÌØ'];}
103Fixcase.prototype.fix=function(html,force_lowercase){var self=this;var char_type;force_lowercase=typeof(force_lowercase)!=='undefined'?force_lowercase:false;self.html=html;self.len=self.html.length;self.res='';self.pointer=0;self.words_count=0;self.uppercase_words_count=0;self.first_word=true;do{if(self.pointer>=self.len){break;}
104char_type=self.get_char_type();switch(char_type){case'a-z':self.find_end_of_word(force_lowercase);break;case'.!?':self.first_word=true;self.res+=self.html[self.pointer];break;case'<':self.find_end_of_tag();break;default:self.res+=self.html[self.pointer];}
105self.pointer++;}while(true);if(!force_lowercase&&self.words_count>1&&self.uppercase_words_count/self.words_count>.5){self.res=self.fix(self.res,true);}
106return self.res;}
107Fixcase.prototype.find_end_of_word=function(force_lowercase){var self=this;var char_type;var word='';var regexp;var uppercase;force_lowercase=typeof(force_lowercase)!=='undefined'?force_lowercase:false;do{char_type=self.get_char_type();switch(char_type){case'a-z':word+=self.html[self.pointer];break;default:uppercase=true;regexp=/^[a-zà-ÿ¸][A-ZÀ-ߨ]+$/;if(regexp.exec(word)){word=word.charAt(0).toUpperCase()+word.substr(1).toLowerCase();}
108if(uppercase&&char_type=='.!?'&&word.length==1){uppercase=false;}
109regexp=/^[IVXLCDM]+$/;if(uppercase&&regexp.exec(word)){uppercase=false;}
110regexp=/[a-zà-ÿ¸]$/;if(uppercase&&regexp.exec(word)){uppercase=false;}
111if(uppercase&&self.is_abbr(word)){uppercase=false;}
112if(force_lowercase&&uppercase){if(self.first_word){word=word.charAt(0).toUpperCase()+word.substr(1).toLowerCase();}else{word=word.toLowerCase();}
113uppercase=false;}
114self.first_word=false;self.res+=word;self.words_count++;
114if(uppercase){self.uppercase_words_count++;}
115self.pointer--;return;}
116self.pointer++;}while(true);}
117Fixcase.prototype.find_end_of_tag=function(){var self=this;var char_type;do{if(self.pointer>=self.len){return;}
118self.res+=self.html[self.pointer];char_type=self.get_char_type();switch(char_type){case'>':return;}
119self.pointer++;}while(true);}
120Fixcase.prototype.get_char_type=function(){var self=this;if(self.pointer>=self.len){return'eof';}
121if(self.html[self.pointer]=='<'){return'<';}
122if(self.html[self.pointer]=='>'){return'>';}
123var regexp=/[a-zA-Zà-ÿÀ-߸¨]/;if(regexp.exec(self.html[self.pointer])){return'a-z';}
124var regexp=/[.!?]/;if(regexp.exec(self.html[self.pointer])){return'.!?';}
125return'';}
126Fixcase.prototype.is_abbr=function(word){var self=this;var i;var len=self.abbr.length;for(i=0;i<len;i++){if(self.abbr[i]==word)return true;}
127return false;}
128function JsHttpRequest(){var t=this;t.onreadystatechange=null;t.readyState=0;t.responseText=null;t.responseXML=null;t.status=200;t.statusText="OK";t.responseJS=null;t.caching=false;t.loader=null;t.session_name="PHPSESSID";t._ldObj=null;t._reqHeaders=[];t._openArgs=null;t._errors={inv_form_el:"Invalid FORM element detected: name=%, tag=%",must_be_single_el:"If used, <form> must be a single HTML element in the list.",js_invalid:"JavaScript code generated by backend is invalid!\n%",url_too_long:"Cannot use so long query with GET request (URL is larger than % bytes)",unk_loader:"Unknown loader: %",no_loaders:"No loaders registered at all, please check JsHttpRequest.LOADERS array",no_loader_matched:"Cannot find a loader which may process the request. Notices are:\n%"};t.abort=function(){with(this){if(_ldObj&&_ldObj.abort)_ldObj.abort();_cleanup();if(readyState==0)return;if(readyState==1&&!_ldObj){readyState=0;return}_changeReadyState(4,true)}};t.open=function(_2,_3,_4,_5,_6){with(this){if(_3.match(/^((\w+)\.)?(GET|POST)\s+(.*)/i)){this.loader=RegExp.$2?RegExp.$2:null;_2=RegExp.$3;_3=RegExp.$4}try{if(document.location.search.match(new RegExp("[&?]"+session_name+"=([^&?]*)"))||document.cookie.match(new RegExp("(?:;|^)\\s*"+session_name+"=([^;]*)")))_3+=(_3.indexOf("?")>=0?"&":"?")+session_name+"="+this.escape(RegExp.$1)}catch(e){}_openArgs={method:(_2||"").toUpperCase(),url:_3,asyncFlag:_4,username:_5!=null?_5:"",password:_6!=null?_6:""};_ldObj=null;_changeReadyState(1,true);return true}};t.send=function(_7){if(!this.readyState)return;this._changeReadyState(1,true);this._ldObj=null;var _8=[];var _9=[];if(!this._hash2query(_7,null,_8,_9))return;var _a=null;if(this.caching&&!_9.length){_a=this._openArgs.username+":"+this._openArgs.password+"@"+this._openArgs.url+"|"+_8+"#"+this._openArgs.method;var _b=JsHttpRequest.CACHE[_a];if(_b){this._dataReady(_b[0],_b[1]);return false}}var _c=(this.loader||"").toLowerCase();if(_c&&!JsHttpRequest.LOADERS[_c])return this._error("unk_loader",_c);var _d=[];var _e=JsHttpRequest.LOADERS;for(var _f in _e){var ldr=_e[_f].loader;if(!ldr)continue;if(_c&&_f!=_c)continue;var _11=new ldr(this);JsHttpRequest.extend(_11,this._openArgs);JsHttpRequest.extend(_11,{queryText:_8.join("&"),queryElem:_9,id:(new Date).getTime()+""+JsHttpRequest.COUNT++,hash:_a,span:null});var _12=_11.load();if(!_12){this._ldObj=_11;JsHttpRequest.PENDING[_11.id]=this;return true}if(!_c)_d[_d.length]="- "+_f.toUpperCase()+": "+this._l(_12);else return this._error(_12)}return _f?this._error("no_loader_matched",_d.join("\n")):this._error("no_loaders")};t.getAllResponseHeaders=function(){with(this)return _ldObj&&_ldObj.getAllResponseHeaders?_ldObj.getAllResponseHeaders():[]};t.getResponseHeader=function(_13){with(this)return _ldObj&&_ldObj.getResponseHeader?_ldObj.getResponseHeader(_13):null};t.setRequestHeader=function(_14,_15){with(this)_reqHeaders[_reqHeaders.length]=[_14,_15]};t._dataReady=function(_16,js){with(this){if(caching&&_ldObj)JsHttpRequest.CACHE[_ldObj.hash]=[_16,js];responseText=responseXML=_16;responseJS=js;if(js!==null){status=200;statusText="OK"}else{status=500;statusText="Internal Server Error"}_changeReadyState(2);_changeReadyState(3);_changeReadyState(4);_cleanup()}};t._l=function(_18){var i=0,p=0,msg=this._errors[_18[0]];while((p=msg.indexOf("%",p))>=0){var a=_18[++i]+"";msg=msg.substring(0,p)+a+msg.substring(p+1,msg.length);p+=1+a.length}return msg};t._error=function(msg){msg=this._l(typeof msg=="string"?arguments:msg);msg="JsHttpRequest: "+msg;if(!window.Error)throw msg;else if((new Error(1,"test")).description=="test")throw new Error(1,msg);else throw new Error(msg);};
128t._hash2query=function(_1e,_1f,_20,_21){if(_1f==null)_1f="";if((""+typeof _1e).toLowerCase()=="object"){var _22=false;if(_1e&&_1e.parentNode&&_1e.parentNode.appendChild&&_1e.tagName&&_1e.tagName.toUpperCase()=="FORM")_1e={form:_1e};for(var k in _1e){var v=_1e[k];if(v instanceof Function)continue;var _25=_1f?_1f+"["+this.escape(k)+"]":this.escape(k);var _26=v&&v.parentNode&&v.parentNode.appendChild&&v.tagName;if(_26){var tn=v.tagName.toUpperCase();if(tn=="FORM")_22=true;else if(tn=="INPUT"||tn=="TEXTAREA"||tn=="SELECT");else return this._error("inv_form_el",v.name||"",v.tagName);if(v.hasAttribute("multiple")){_25+='[]';}_21[_21.length]={name:_25,e:v}}else if(v instanceof Object)this._hash2query(v,_25,_20,_21);else{if(v===null)continue;if(v===true)v=1;if(v===false)v="";_20[_20.length]=_25+"="+this.escape(""+v)}if(_22&&_21.length>1)return this._error("must_be_single_el")}}else _20[_20.length]=_1e;return true};t._cleanup=function(){var _28=this._ldObj;if(!_28)return;JsHttpRequest.PENDING[_28.id]=false;var _29=_28.span;if(!_29)return;_28.span=null;var _2a=function(){_29.parentNode.removeChild(_29)};JsHttpRequest.setTimeout(_2a,50)};t._changeReadyState=function(s,_2c){with(this){if(_2c){status=statusText=responseJS=null;responseText=""}readyState=s;if(onreadystatechange)onreadystatechange()}};t.escape=function(s){return escape(s).replace(new RegExp("\\+","g"),"%2B")}}JsHttpRequest.COUNT=0;JsHttpRequest.MAX_URL_LEN=2E3;JsHttpRequest.CACHE={};JsHttpRequest.PENDING={};JsHttpRequest.LOADERS={};JsHttpRequest._dummy=function(){};JsHttpRequest.TIMEOUTS={s:window.setTimeout,c:window.clearTimeout};JsHttpRequest.setTimeout=function(_2e,dt){window.JsHttpRequest_tmp=JsHttpRequest.TIMEOUTS.s;if(typeof _2e=="string")id=window.JsHttpRequest_tmp(_2e,dt);else{var id=null;var _31=function(){_2e();delete JsHttpRequest.TIMEOUTS[id]};id=window.JsHttpRequest_tmp(_31,dt);JsHttpRequest.TIMEOUTS[id]=_31}window.JsHttpRequest_tmp=null;return id};JsHttpRequest.clearTimeout=function(id){window.JsHttpRequest_tmp=JsHttpRequest.TIMEOUTS.c;delete JsHttpRequest.TIMEOUTS[id];var r=window.JsHttpRequest_tmp(id);window.JsHttpRequest_tmp=null;return r};JsHttpRequest.query=function(url,_35,_36,_37){var req=new this;req.caching=!_37;req.onreadystatechange=function(){if(req.readyState==4)_36(req.responseJS,req.responseText)};req.open(null,url,true);req.send(_35)};JsHttpRequest.dataReady=function(d){var th=this.PENDING[d.id];delete this.PENDING[d.id];if(th)th._dataReady(d.text,d.js);else if(th!==false)throw"dataReady(): unknown pending id: "+d.id;};JsHttpRequest.extend=function(_3b,src){for(var k in src)_3b[k]=src[k]};JsHttpRequest.LOADERS.xml={loader:function(req){JsHttpRequest.extend(req._errors,{xml_no:"Cannot use XMLHttpRequest or ActiveX loader: not supported",xml_no_diffdom:"Cannot use XMLHttpRequest to load data from different domain %",xml_no_headers:"Cannot use XMLHttpRequest loader or ActiveX loader, POST method: headers setting is not supported, needed to work with encodings correctly",xml_no_form_upl:"Cannot use XMLHttpRequest loader: direct form elements using and uploading are not implemented"});this.load=function(){if(this.queryElem.length)return["xml_no_form_upl"];if(this.url.match(new RegExp("^([a-z]+://[^\\/]+)(.*)","i")))if(RegExp.$1.toLowerCase()!=document.location.protocol+"//"+document.location.hostname.toLowerCase())return["xml_no_diffdom",RegExp.$1];var xr=null;if(window.XMLHttpRequest)try{xr=new XMLHttpRequest}catch(e){}else if(window.ActiveXObject){try{xr=new ActiveXObject("Microsoft.XMLHTTP")}catch(e){}if(!xr)try{xr=new ActiveXObject("Msxml2.XMLHTTP")}catch(e){}}if(!xr)return["xml_no"];var _40=window.ActiveXObject||xr.setRequestHeader;if(!this.method)this.method=_40&&this.queryText.length?"POST":"GET";if(this.method=="GET"){if(this.queryText)this.url+=(this.url.indexOf("?")>=0?"&":"?")+this.queryText;this.queryText="";if(this.url.length>JsHttpRequest.MAX_URL_LEN)return["url_too_long",JsHttpRequest.MAX_URL_LEN]}else if(this.method=="POST"&&!_40)return["xml_no_headers"];this.url+=(this.url.indexOf("?")>
128=0?"&":"?")+"JsHttpRequest="+(req.caching?"0":this.id)+"-xml";var id=this.id;xr.onreadystatechange=function(){if(xr.readyState!=4)return;xr.onreadystatechange=JsHttpRequest._dummy;req.status=null;try{req.status=xr.status;req.responseText=xr.responseText}catch(e){}if(!req.status)return;try{var _42=req.responseText||"{ js: null, text: null }";eval("JsHttpRequest._tmp = function(id) { var d = "+_42+"; d.id = id; JsHttpRequest.dataReady(d); }")}catch(e){return req._error("js_invalid",req.responseText)}JsHttpRequest._tmp(id);JsHttpRequest._tmp=null};xr.open(this.method,this.url,true,this.username,this.password);if(_40){for(var i=0;i<req._reqHeaders.length;i++)xr.setRequestHeader(req._reqHeaders[i][0],req._reqHeaders[i][1]);xr.setRequestHeader("Content-Type","application/octet-stream")}xr.send(this.queryText);this.span=null;this.xr=xr;return null};this.getAllResponseHeaders=function(){return this.xr.getAllResponseHeaders()};this.getResponseHeader=function(_44){return this.xr.getResponseHeader(_44)};this.abort=function(){this.xr.abort();this.xr=null}}};JsHttpRequest.LOADERS.script={loader:function(req){JsHttpRequest.extend(req._errors,{script_only_get:"Cannot use SCRIPT loader: it supports only GET method",script_no_form:"Cannot use SCRIPT loader: direct form elements using and uploading are not implemented"});this.load=function(){if(this.queryText)this.url+=(this.url.indexOf("?")>=0?"&":"?")+this.queryText;this.url+=(this.url.indexOf("?")>=0?"&":"?")+"JsHttpRequest="+this.id+"-"+"script";this.queryText="";if(!this.method)this.method="GET";if(this.method!=="GET")return["script_only_get"];if(this.queryElem.length)return["script_no_form"];if(this.url.length>JsHttpRequest.MAX_URL_LEN)return["url_too_long",JsHttpRequest.MAX_URL_LEN];var th=this,d=document,s=null,b=d.body;if(!window.opera){this.span=s=d.createElement("SCRIPT");var _4a=function(){s.language="JavaScript";if(s.setAttribute)s.setAttribute("src",th.url);else s.src=th.url;b.insertBefore(s,b.lastChild)}}else{this.span=s=d.createElement("SPAN");s.style.display="none";b.insertBefore(s,b.lastChild);s.innerHTML="Workaround for IE.<s"+"cript></"+"script>";var _4a=function(){s=s.getElementsByTagName("SCRIPT")[0];s.language="JavaScript";if(s.setAttribute)s.setAttribute("src",th.url);else s.src=th.url}}JsHttpRequest.setTimeout(_4a,10);return null}}};JsHttpRequest.LOADERS.form={loader:function(req){JsHttpRequest.extend(req._errors,{form_el_not_belong:'Element "%" does not belong to any form!',form_el_belong_diff:'Element "%" belongs to a different form. All elements must belong to the same form!',form_el_inv_enctype:'Attribute "enctype" of the form must be "%" (for IE), "%" given.'});this.load=function(){var th=this;if(!th.method)th.method="POST";th.url+=(th.url.indexOf("?")>=0?"&":"?")+"JsHttpRequest="+th.id+"-"+"form";if(th.method=="GET"){if(th.queryText)th.url+=(th.url.indexOf("?")>=0?"&":"?")+th.queryText;if(th.url.length>JsHttpRequest.MAX_URL_LEN)return["url_too_long",JsHttpRequest.MAX_URL_LEN];var p=th.url.split("?",2);th.url=p[0];th.queryText=p[1]||""}var _4e=null;var _4f=false;if(th.queryElem.length){if(th.queryElem[0].e.tagName.toUpperCase()=="FORM"){_4e=th.queryElem[0].e;_4f=true;th.queryElem=[]}else{_4e=th.queryElem[0].e.form;for(var i=0;i<th.queryElem.length;i++){var e=th.queryElem[i].e;if(!e.form)return["form_el_not_belong",e.name];if(e.form!=_4e)return["form_el_belong_diff",e.name]}}if(th.method=="POST"){var _52="multipart/form-data";var _53=_4e.attributes.encType&&_4e.attributes.encType.nodeValue||_4e.attributes.enctype&&_4e.attributes.enctype.value||_4e.enctype;if(_53!=_52)return["form_el_inv_enctype",_52,_53]}}var d=_4e&&(_4e.ownerDocument||_4e.document)||document;var _55="jshr_i_"+th.id;var s=th.span=d.createElement("DIV");s.style.position="absolute";s.style.display="none";s.style.visibility="hidden";s.innerHTML=(_4e?"":"<form"+(th.method=="POST"?' enctype="multipart/form-data" method="post"':"")+"></form>")+'<iframe name="'+_55+'" id="'+_55+'" style="width:0px; height:0px; overflow:hidden; border:none"></iframe>';if(!_4e)_4e=th.span.firstChild;d.body.insertBefore(s,d.body.lastChild);var _57=function(e,_59){var sv=[];var _5b=e;if(e.mergeAttributes){var _5b=d.createElement("form");_5b.mergeAttributes(e,false)}for(var i=0;i<_59.length;i++){var k=_59[i][0],v=_59[i][1];sv[sv.length]=[k,_5b.getAttribute(k)];if(v===null)_5b.removeAttribute(k);else _5b.setAttribute(k,v)}
128if(e.mergeAttributes)e.mergeAttributes(_5b,false);return sv};var _5f=function(){top.JsHttpRequestGlobal=JsHttpRequest;var _60=[];if(!_4f)for(var i=0,n=_4e.elements.length;i<n;i++){_60[i]=_4e.elements[i].name;_4e.elements[i].name=""}var qt=th.queryText.split("&");for(var i=qt.length-1;i>=0;i--){var _64=qt[i].split("=",2);var e=d.createElement("INPUT");e.type="hidden";e.name=unescape(_64[0]);e.value=_64[1]!=null?unescape(_64[1]):"";_4e.appendChild(e)}for(var i=0;i<th.queryElem.length;i++)th.queryElem[i].e.name=th.queryElem[i].name;var sv=_57(_4e,[["action",th.url],["method",th.method],["onsubmit",null],["target",_55]]);_4e.submit();_57(_4e,sv);for(var i=0;i<qt.length;i++)_4e.lastChild.parentNode.removeChild(_4e.lastChild);if(!_4f)for(var i=0,n=_4e.elements.length;i<n;i++)_4e.elements[i].name=_60[i]};JsHttpRequest.setTimeout(_5f,100);return null}}};function Popup(options){var self=this;self.options={chanel:options.chanel||0,position:options.position||"absolute"};self.status=0;self.eventname=".popup_"+self.options.chanel;self.elements=new Array;self.active_element={};var popup_overlay_zindex=(self.options.position=="fixed"?110:10)+self.options.chanel*2;var popup_overlay=$("#popup-overlay-"+self.options.chanel);if(popup_overlay.length)self.popup_overlay=popup_overlay;else self.popup_overlay=$("<div></div>").attr("id","popup-overlay-"+self.options.chanel).addClass("popup_overlay").css({"z-index":popup_overlay_zindex}).appendTo($("body"));var popup_zindex=popup_overlay_zindex+1;var popup=$("#popup-"+self.options.chanel);if(popup.length){self.popup=popup;self.popup_fader=self.popup.children("div")}else{self.popup=$("<div></div>").attr("id","popup-"+self.options.chanel).addClass("popup").css({"position":self.options.position,"z-index":popup_zindex}).appendTo($("body"));self.popup_fader=$("<div></div>").appendTo(this.popup).hide()}self.popup_fader.on("mouseenter"+self.eventname,function(){self.enter()});self.popup_fader.on("mouseleave"+
129self.eventname,function(){self.leave()});$("body").on("click"+self.eventname,function(event){self.body_click(event)})}
130Popup.prototype.add_element=function(o){var self=this;self.elements.push(o);var k=self.elements.length-1;if(self.elements[k].action=="click")self.elements[k].element.on("click"+self.eventname,function(){self.open_element(k)});if(self.elements[k].action=="hover")self.elements[k].element.on("mouseenter"+self.eventname,function(){self.enter_element(k)}).on("mouseleave"+self.eventname,function(){self.leave_element(k)})};Popup.prototype.open=function(o){var self=this;var need_to_open=false;switch(self.status){case 0:need_to_open=true;break;case 2:case 3:if(o.of.is(self.active_element.of)){if(o.content!=self.active_element.content)need_to_open=true}else need_to_open=true;break}if(need_to_open){self.status=1;clearTimeout(self.timer_status);if(o.hide_before_show)self.popup_fader.stop(true,true).hide();self.popup_overlay.hide();if(o.modal)self.popup_overlay.show();switch(o.effect){case"fade":self.popup_fader.stop(true,true).html(o.content).fadeIn(o.duration);break;case"slide":self.popup_fader.stop(true,true).html(o.content).slideDown(o.duration);break;default:self.popup_fader.stop(true,true).html(o.content).show()}self.popup.position({my:o.my,at:o.at,of:o.of});if("active_element_class"in self.active_element)self.active_element.element.removeClass(self.active_element.active_element_class);if("active_element_class"in o)o.element.addClass(o.active_element_class);self.active_element=o;self.timer_status=setTimeout(function(){self.popup.trigger("popup-open");self.status=2},200)}};Popup.prototype.open_element=function(k){var self=this;self.open(self.elements[k])};Popup.prototype.close=function(){var self=this;if(self.status==2){self.status=3;clearTimeout(self.timer_status);switch(self.active_element.effect){case"fade":self.popup_fader.stop(true,true).fadeOut(self.active_element.duration);break;case"slide":self.popup_fader.stop(true,true).slideUp(self.active_element.duration);break;default:self.popup_fader.stop(true,true).hide()}self.popup_overlay.hide();if("active_element_class"in self.active_element)self.active_element.element.removeClass(self.active_element.active_element_class);self.timer_status=setTimeout(function(){self.popup.trigger("popup-close");self.status=0;self.active_element={}},200)}};Popup.prototype.enter=function(){var self=this;if(self.active_element.action=="hover")clearTimeout(self.timer_close)};Popup.prototype.enter_element=function(k){var self=this;if(self.elements[k].of.is(self.active_element.of))clearTimeout(self.timer_close);else{clearTimeout(self.timer_close);
130clearTimeout(self.timer_open);self.timer_open=setTimeout(function(){self.open_element(k)},self.elements[k].delay)}};Popup.prototype.leave=function(){var self=this;if(self.active_element.action=="hover"){clearTimeout(self.timer_open);clearTimeout(self.timer_close);self.timer_close=setTimeout(function(){self.close()},self.active_element.delay)}};Popup.prototype.leave_element=function(k){var self=this;if(self.elements[k].of.is(self.active_element.of)||self.active_element.action=="hover"){clearTimeout(self.timer_open);clearTimeout(self.timer_close);self.timer_close=setTimeout(function(){self.close()},self.active_element.delay)}else clearTimeout(self.timer_open)};Popup.prototype.body_click=function(event){var self=this,target=$(event.target);if(self.status==2&&self.active_element.action!="manual")if(!target.closest(self.popup).length)self.close()};$(document).ready(function(){x_collection["popup"]=new Popup({chanel:0,position:"absolute"})});function Search_suggestion(options){var self=this;self.text={}
131self.eventname='.search_suggestion';self.analytics_group=options.analytics_group;self.element_input=options.element_input;self.element_button=options.element_button;self.element_reset=options.element_reset;self.container_autocomplete=options.container_autocomplete;self.container_tree=options.container_tree;self.container_ad=options.container_ad;self.first_run=true;self.list_name=options.list_name||'';self.area_id=options.area_id||0;self.group_id=options.group_id||0;self.pattern='';self.pattern3='';self.pattern_effective='';self.autocomplete_data=[];self.autocomplete_cursor=0;self.status=0;var pattern=self.element_input.val();var pattern_syntax=self.pattern_syntax(pattern);self.pattern=pattern_syntax.canonical;self.pattern_effective=pattern_syntax.canonical;if(self.pattern_effective=='')self.element_reset.hide();self.element_input.on('focus'+self.eventname,function(event){self.input_focus(event);}).on('blur'+self.eventname,function(event){self.input_blur(event);}).on('change'+self.eventname+' keyup'+self.eventname,function(event){self.input_change(event);}).on('keydown'+self.eventname,function(event){self.input_keydown(event);});self.element_button.on('click'+self.eventname,function(event){self.button_click(event);});self.element_reset.on('click'+self.eventname,function(event){self.reset_click(event);});self.container_autocomplete.hide().on('click'+self.eventname,function(event){self.container_autocomplete_click(event);});self.container_tree.on('click'+self.eventname,function(event){self.container_tree_click(event);});self.on_first_run=options.on_first_run;}
132Search_suggestion.prototype.input_focus=function(event){var self=this;clearTimeout(self.timeout_focus);self.container_autocomplete.show();}
133Search_suggestion.prototype.input_blur=function(event){var self=this;clearTimeout(self.timeout_focus);self.timeout_focus=setTimeout(function(){self.container_autocomplete.hide();},300);}
134Search_suggestion.prototype.input_change=function(event){var self=this;var pattern=self.element_input.val();var pattern_syntax=self.pattern_syntax(pattern);if(self.pattern!=pattern_syntax.canonical){clearTimeout(self.timeout_autocomplete);self.timeout_autocomplete=setTimeout(function(){self.autocomplete();},200);}
135var pattern3=pattern_syntax.last.substring(0,3);if(self.pattern3!=pattern3&&pattern3.length>=3){clearTimeout(self.timeout_get_autocomplete);self.timeout_get_autocomplete=setTimeout(function(){self.get_autocomplete();},400);}}
136Search_suggestion.prototype.input_keydown=function(event){var self=this;switch(event.keyCode){case 13:x_analytics('ss_autocomplete');event.preventDefault();var $a=self.container_autocomplete.find('a.a');if($a.length){self.element_input.val($a.text());self.get_data();}else{self.get_data();}
137break
138case 38:event.preventDefault();var $autocomplete=self.container_autocomplete.find('a'),n=$autocomplete.length;if(self.autocomplete_cursor>1)self.autocomplete_cursor--;if(self.autocomplete_cursor>n)self.autocomplete_cursor=n;$autocomplete.removeClass('a');$autocomplete.eq(self.autocomplete_cursor-1).addClass('a');break;case 40:event.preventDefault();var $autocomplete=self.container_autocomplete.find('a'),n=$autocomplete.length;if(self.autocomplete_cursor<n)self.autocomplete_cursor++;if(self.autocomplete_cursor<1)self.autocomplete_cursor=1;$autocomplete.removeClass('a');
138$autocomplete.eq(self.autocomplete_cursor-1).addClass('a');break;}}
139Search_suggestion.prototype.button_click=function(event){var self=this;x_analytics('ss_search');self.get_data();}
140Search_suggestion.prototype.reset_click=function(event){var self=this;x_analytics('ss_reset');self.element_reset.hide();self.set_search('');}
141Search_suggestion.prototype.container_autocomplete_click=function(event){var self=this;x_analytics('ss_autocomplete');event.preventDefault();var $a=$(event.target).closest('a');if($a.length){self.set_search($a.text());}}
142Search_suggestion.prototype.container_tree_click=function(event){var self=this;x_analytics('ss_tree');var $a=$(event.target).closest('a');if($a.length){event.preventDefault();self.set_search($a.data('search'));}}
143Search_suggestion.prototype.set_search=function(search){var self=this;self.element_input.val(search);self.get_data();}
144Search_suggestion.prototype.autocomplete=function(){var self=this;var k,h='';var pattern=self.element_input.val();var pattern_syntax=self.pattern_syntax(pattern);self.pattern=pattern_syntax.canonical;self.autocomplete_cursor=0;if(pattern_syntax.last.length>=3){self.element_reset.show();var match_count=0,exact_match=false;for(k in self.autocomplete_data){if(self.autocomplete_data[k].title==pattern_syntax.last){exact_match=true;}
145var title=self.fuzzy_search(self.autocomplete_data[k].title,pattern_syntax.last);if(title!==false){h+='<li><a>'+title+'</a></li>';match_count++;}}
146if(exact_match&&match_count==1)h='';if(h!='')h='<ul>'+h+'</ul>';}
147self.container_autocomplete.html(h);}
148Search_suggestion.prototype.get_autocomplete=function(){var self=this;var pattern=self.element_input.val();var pattern_syntax=self.pattern_syntax(pattern);var pattern3=pattern_syntax.last.substring(0,3);if(pattern3.length>=3){self.pattern3=pattern3;JsHttpRequest.query(x_ajax_path+'ajax/tag/search-suggestion',{ajx_analytics_group:self.analytics_group,ajx_required_autocomplete:true,ajx_required_ad:false,ajx_required_menu:false,ajx_area_id:self.area_id,ajx_group_id:self.group_id,ajx_pattern:self.pattern3},function(res,err){if(res){self.autocomplete_data=res.ajx_autocomplete_data;self.autocomplete();}},true);}}
149Search_suggestion.prototype.get_data=function(){var self=this;if(self.status==0){self.status=1;var pattern=self.element_input.val();var pattern_syntax=self.pattern_syntax(pattern);if(self.pattern_effective!=pattern_syntax.canonical){self.pattern_effective=pattern_syntax.canonical;var required_autocomplete=false;var pattern3=pattern_syntax.last.substring(0,3);if(self.pattern3!=pattern3&&pattern3.length>=3){required_autocomplete=true;self.pattern3=pattern3;}
150JsHttpRequest.query(x_ajax_path+'ajax/tag/search-suggestion',{ajx_analytics_group:self.analytics_group,ajx_required_autocomplete:required_autocomplete,ajx_required_ad:true,ajx_required_menu:true,ajx_area_id:self.area_id,ajx_group_id:self.group_id,ajx_pattern:self.pattern_effective},function(res,err){if(res){if(required_autocomplete){self.autocomplete_data=res.ajx_autocomplete_data;self.autocomplete();}
151if(res.ajx_ad!=''){self.container_ad.html(res.ajx_ad);}
152self.container_tree.html(res.ajx_menu);
152if(res.ajx_menu=='')self.container_tree.hide();else self.container_tree.show();self.container_tree.find('.m_menu_area_alphabet_scrollbox').html(x_alphabet_area());self.status=0;}},true);self.update_list();}else{self.status=0;}}else if(self.status==1){clearTimeout(self.timeout_get_data);self.timeout_get_data=setTimeout(function(){self.get_data();},1000);}}
153Search_suggestion.prototype.get_tree=function(pattern){var self=this;if(self.status==0){self.status=1;JsHttpRequest.query(x_ajax_path+'ajax/tag/search-suggestion',{ajx_analytics_group:self.analytics_group,ajx_required_autocomplete:false,ajx_required_ad:true,ajx_required_menu:true,ajx_area_id:self.area_id,ajx_group_id:self.group_id,ajx_pattern:pattern},function(res,err){if(res){if(res.ajx_ad!=''){self.container_ad.html(res.ajx_ad);}
154self.container_tree.html(res.ajx_menu);if(res.ajx_menu=='')self.container_tree.hide();else self.container_tree.show();self.container_tree.find('.m_menu_area_alphabet_scrollbox').html(x_alphabet_area());self.status=0;}},true);}else if(self.status==1){clearTimeout(self.timeout_get_data);self.timeout_get_data=setTimeout(function(){self.get_tree(pattern);},1000);}}
155Search_suggestion.prototype.update_list=function(){var self=this;if(self.first_run){first_run=false;self.on_first_run();}
156x_collection[self.list_name].tag(self.pattern_effective);}
157Search_suggestion.prototype.fuzzy_search=function(haystack,needle){var self=this;var j,k,l,pattern,replace,regex,tokens;haystack=String(haystack).replace(/¸/g,'å').replace(/¨/g,'Å').replace(/[^0-9a-zA-Zà-ÿÀ-ß ]/g,'');needle=String(needle).replace(/¸/g,'å').replace(/¨/g,'Å').replace(/[^0-9a-zA-Zà-ÿÀ-ß ]/g,'');if(needle.length==0||haystack.length==0)return false;regex=new RegExp(needle,"img");if(regex.test(haystack)){replace='$1<b>$2</b>$3';pattern="(.*?)("+needle+")(.*)";regex=new RegExp(pattern,"img");haystack=haystack.replace(regex,replace);return haystack;}
158tokens=needle.split(' ');pattern=tokens.join(".*?");regex=new RegExp(pattern,"img");if(regex.test(haystack)){replace='$1';l=tokens.length;for(k=0;k<l;k++){j=k*2+1;replace=replace+"<b>"+"$"+(j+1)+"</b>"+"$"+(j+2);}
159pattern="(.*?)("+tokens.join(")(.*?)(")+")(.*)";regex=new RegExp(pattern,"img");haystack=haystack.replace(regex,replace);return haystack;}
160var needle_a=needle.substring(0,2);var needle_b=needle.substring(2);tokens=needle_b.split('');tokens[0]=needle_a+tokens[0];pattern=tokens.join(".*?");regex=new RegExp(pattern,"img");if(regex.test(haystack)){replace='$1';l=tokens.length;for(k=0;k<l;k++){j=k*2+1;replace=replace+"<b>"+"$"+(j+1)+"</b>"+"$"+(j+2);}
161pattern="(.*?)("+tokens.join(")(.*?)(")+")(.*)";regex=new RegExp(pattern,"img");haystack=haystack.replace(regex,replace);return haystack;}
162return false;}
163Search_suggestion.prototype.pattern_syntax=function(pattern){pattern=pattern.substr(0,99);var res={};var match;if(match=pattern.match(/^(.{3,})\+(.{3,})$/)){res.first=match[1].substr(0,64).trim();res.last=match[2].substr(0,64).trim();res.canonical=res.first+' +'+res.last;res.syntax='plus';}else if(match=pattern.match(/^(.{3,}) \-(.{3,})$/)){res.first=match[1].substr(0,64).trim();res.last=match[2].substr(0,64).trim();res.canonical=res.first+' -'+res.last;res.syntax='minus';}else if(pattern.length>=3){res.first='';if(match=pattern.match(/^(.{3,})\+.*$/)){res.last=match[1].substr(0,64).trim();}else if(match=pattern.match(/^(.{3,}) \-.*$/)){res.last=match[1].substr(0,64).trim();}else{res.last=pattern.substr(0,64).trim();}
164res.canonical=res.last;res.syntax='simple';}else{res.first='';res.last='';res.canonical='';res.syntax='';}
165return res;}
166function Slide(o){var self=this;self.container=o.container;self.o={width:o.width||616,height:o.height||316,tile_size:o.tile_size||69,slide_count:o.slide_count||10,first_wave_timeout:o.first_wave_timeout||5E3,wave_timeout:o.wave_timeout||5E3,change_timeout:o.change_timeout||100,change_fadeout_timeout:o.change_fadeout_timeout||750,wave_limit:o.wave_limit||30,url_list:o.url_list||[]};return this}
167Slide.prototype.start=function(){var self=this;self.slide_number=0;self.cut();setTimeout(function(){self.wave()},self.o.first_wave_timeout)};Slide.prototype.stop=function(){var self=this;self.o.wave_limit=0};Slide.prototype.cut=function(){var self=this;self.tile_cnt_vertical=Math.ceil(self.o.height/self.o.tile_size),self.tile_cnt_horizontal=Math.ceil(self.o.width/self.o.tile_size);self.tile=new Array;for(var y=0;y<self.tile_cnt_vertical;y++)for(var x=0;x<self.tile_cnt_horizontal;x++){var $tile=$("<div></div>").css({"top":y*self.o.tile_size,"left":x*self.o.tile_size,"background-position":"-"+x*self.o.tile_size+"px -"+y*self.o.tile_size+"px"}).appendTo(self.container);
167self.tile.push({"tile":$tile,"slide":0,"y":y,"x":x})}};Slide.prototype.wave=function(){var self=this;for(var i=0;i<self.tile.length;i++)self.tile[i].tile.css({"background-position":"-"+self.tile[i].x*self.o.tile_size+"px -"+(self.tile[i].y*self.o.tile_size+self.slide_number*self.o.height)+"px"}).show();self.slide_number++;if(self.slide_number==self.o.slide_count)self.slide_number=0;self.o.wave_limit--;if(self.o.wave_limit>=0){var url=self.o.url_list[self.slide_number]||"";if(url=="")self.container.css({"cursor":"default"}).off();else self.container.css({"cursor":"pointer"}).on("click",function(){location.href=url});self.container.css({"background-position":"0px -"+self.slide_number*self.o.height+"px"});for(var y=0;y<self.tile_cnt_vertical;y++)self.change(y);var timeout=Math.max(self.o.wave_timeout,1.2*(self.tile_cnt_horizontal*self.o.change_timeout+self.o.change_fadeout_timeout));setTimeout(function(){self.wave()},timeout)}};Slide.prototype.change=function(y){var self=this;var tile_to_change=new Array;for(var i in self.tile)if(self.tile[i].slide!=self.slide_number&&self.tile[i].y==y)tile_to_change.push(i);if(tile_to_change.length>0){var random_tile_index=tile_to_change[Math.round(Math.random()*(tile_to_change.length-1))];self.tile[random_tile_index].tile.fadeOut(self.o.change_fadeout_timeout);self.tile[random_tile_index].slide=self.slide_number;setTimeout(function(){self.change(y)},self.o.change_timeout)}};$.fn.focusWithoutScrolling=function(){var x=window.scrollX,y=window.scrollY;this.focus();window.scrollTo(x,y);};function translit(a){for(var g=["","B","V","G","D","","","Zh","Z","","Y","K","L","M","N","","P","R","S","T","","F","Kh","Ts","Ch","Sh","Shch","","","","","","","a","b","v","g","d","","","zh","z","","y","k","l","m","n","","p","r","s","t","","f","kh","ts","ch","sh","shch","","","","","",""],e=["A","","","","","Ye","Yo","","","I","","","","","","O","","","","","U","","","","","","","","","","E","Yu","Ya","a","","","","","ye","yo","","","i","","","","","","o","","","","","u","","","","","","","","","","e","yu","ya"],k=["A","","","","","E","E","","","I","","","","","","O","","","","","U","","","","","","","","Y","","E","Yu","Ya","a","","","","","e","e","","","i","","","","","","o","","","","","u","","","","","","","","y","","e","yu","ya"],m=["A","","","","","E","E","","","I","","","","","","O","","","","","U","","","","","","","","","","","","","a","","","","","e","e","","","i","","","","","","o","","","","","u","","","","","","","","","","","",""],n=["","","","","","Ye","Yo","","","Yi","","","","","","Yo","","","","","","","","","","","","","","","","Yu","Ya","","","","","","ye","yo","","","yi","","","","","","yo","","","","","","","","","","","","","","","","yu","ya"],c="",f="f",d="",j="",h="",l=a.length-1,i=0;i<=l;i++){if(i<l){d=a.charAt(i+1);var b="\u0410\u0411\u0412\u0413\u0414\u0415\u0401\u0416\u0417\u0418\u0419\u041a\u041b\u041c\u041d\u041e\u041f\u0420\u0421\u0422\u0423\u0424\u0425\u0426\u0427\u0428\u0429\u042a\u042b\u042c\u042d\u042e\u042f\u0430\u0431\u0432\u0433\u0434\u0435\u0451\u0436\u0437\u0438\u0439\u043a\u043b\u043c\u043d\u043e\u043f\u0440\u0441\u0442\u0443\u0444\u0445\u0446\u0447\u0448\u0449\u044a\u044b\u044c\u044d\u044e\u044f".indexOf(d);j=b<0?"e":"gssssgghsgjssssgssssgssshhhngnggggssssggssgjssssgssssgssssssngnggg"[b]}else j="e";d=a.charAt(i);b="\u0410\u0411\u0412\u0413\u0414\u0415\u0401\u0416\u0417\u0418\u0419\u041a\u041b\u041c\u041d\u041e\u041f\u0420\u0421\u0422\u0423\u0424\u0425\u0426\u0427\u0428\u0429\u042a\u042b\u042c\u042d\u042e\u042f\u0430\u0431\u0432\u0433\u0434\u0435\u0451\u0436\u0437\u0438\u0439\u043a\u043b\u043c\u043d\u043e\u043f\u0440\u0441\u0442\u0443\u0444\u0445\u0446\u0447\u0448\u0449\u044a\u044b\u044c\u044d\u044e\u044f".indexOf(d);if(b>=0){d="gssssgghsgjssssgssssgssshhhngnggggssssggssgjssssgssssgssssssngnggg"[b];h+=" \u0438\u0439 \u0440 \u044e \u0438\u0439 \u0440 \u044e "[b];if(d=="g")if(f=="f"||f=="g")c+=e[b];else if(f=="s"||f=="j")c+=k[b];else if(f=="h")c+=m[b];else{if(f=="n")c+=n[b]}else if(d=="j"){if(!(j=="e"&&h.substr(h.length-4)=="\u044e\u0440\u0438\u0439"))if(j=="e"&&h.substr(h.length-2)=="\u0438\u0439")c=c.substr(0,c.length-1)+g[b];else c+=g[b]}
167else if(d=="s"||d=="h")c+=g[b];f=d}else{f="f";h="";c+=d}}return c}
168function in_array(haystack,needle){var i,l=haystack.length;for(i=0;i<l;i++){if(haystack[i]==needle)return true;}
169return false;}
170function trim(string){var s=s.replace(/^\s\s*/,""),regexp=/\s/,i=s.length;while(regexp.test(s.charAt(--i)));return s.slice(0,i+1);}
171function str_hex(str,reverse){var i,len=str.length,ord=0,res='';if(reverse){var map={128:1026,129:1027,130:8218,131:1107,132:8222,133:8230,134:8224,135:8225,136:8364,137:8240,138:1033,139:8249,140:1034,141:1036,142:1035,143:1039,144:1106,145:8216,146:8217,147:8220,148:8221,149:8226,150:8211,151:8212,153:8482,154:1113,155:8250,156:1114,157:1116,158:1115,159:1119,160:160,161:1038,162:1118,163:1032,164:164,165:1168,166:166,167:167,168:1025,169:169,170:1028,171:171,172:172,173:173,174:174,175:1031,176:176,177:177,178:1030,179:1110,180:1169,181:181,182:182,183:183,184:1105,185:8470,186:1108,187:187,188:1112,189:1029,190:1109,191:1111,192:1040,193:1041,194:1042,195:1043,196:1044,197:1045,198:1046,199:1047,200:1048,201:1049,202:1050,203:1051,204:1052,205:1053,206:1054,207:1055,208:1056,209:1057,210:1058,211:1059,212:1060,213:1061,214:1062,215:1063,216:1064,217:1065,218:1066,219:1067,220:1068,221:1069,222:1070,223:1071,224:1072,225:1073,226:1074,227:1075,228:1076,229:1077,230:1078,231:1079,232:1080,233:1081,234:1082,235:1083,236:1084,237:1085,238:1086,239:1087,240:1088,241:1089,242:1090,243:1091,244:1092,245:1093,246:1094,247:1095,248:1096,249:1097,250:1098,251:1099,252:1100,253:1101,254:1102,255:1103};len=Math.floor(len/2);for(i=0;i<len;i++){ord=parseInt(str.substr(i*2,2),16);if(ord<128){res=res.concat(String.fromCharCode(ord));}else if(ord in map){ord=map[ord];res=res.concat(String.fromCharCode(ord));}}}else{var map={1027:129,8225:135,1046:198,8222:132,1047:199,1168:165,1048:200,1113:154,1049:201,1045:197,1050:202,1028:170,160:160,1040:192,1051:203,164:164,166:166,167:167,169:169,171:171,172:172,173:173,174:174,1053:205,176:176,177:177,1114:156,181:181,182:182,183:183,8221:148,187:187,1029:189,1056:208,1057:209,1058:210,8364:136,1112:188,1115:158,1059:211,1060:212,1030:178,1061:213,1062:214,1063:215,1116:157,1064:216,1065:217,1031:175,1066:218,1067:219,1068:220,1069:221,1070:222,1032:163,8226:149,1071:223,1072:224,8482:153,1073:225,8240:137,1118:162,1074:226,1110:179,8230:133,1075:227,1033:138,1076:228,1077:229,8211:150,1078:230,1119:159,1079:231,1042:194,1080:232,1034:140,1025:168,1081:233,1082:234,8212:151,1083:235,1169:180,1084:236,1052:204,1085:237,1035:142,1086:238,1087:239,1088:240,1089:241,1090:242,1036:141,1041:193,1091:243,1092:244,8224:134,1093:245,8470:185,1094:246,1054:206,1095:247,1096:248,8249:139,1097:249,1098:250,1044:196,1099:251,1111:191,1055:207,1100:252,1038:161,8220:147,1101:253,8250:155,1102:254,8216:145,1103:255,1043:195,1105:184,1039:143,1026:128,1106:144,8218:130,1107:131,8217:146,1108:186,1109:190};for(i=0;i<len;i++){ord=str.charCodeAt(i);if(ord<16){res=res.concat('0',ord.toString(16));}else if(ord<128){res=res.concat(ord.toString(16));}else if(ord in map){ord=map[ord];res=res.concat(ord.toString(16));}}}
172return res;}
173function typograf(text){return text.replace(/\u0020-(\d)/g," \u2212$1").replace(/(^|\n|\s|>)\-(\s)/g,"$1\u2014$2").replace(/\-{2} /g,function(){caretPosition--;return"\u2014 ";}).replace(/\u00a0{2,}|\u00a0\u0020|\u0020\u00a0/g,function(str){caretPosition-=str.length-1;return"\u00a0";}).replace(/<!\u2014/ig,function(){caretPosition++;return"\x3c!--";}).replace(/(\d)(\u0020)?[-\u2014](\u0020)?(\d)/g,function(str,$1,$2,$3,$4){if($2==' '){caretPosition--;}
174if($3==' '){caretPosition--;}
175return $1+"\u2013"+$4;}).replace(/\([c\u0441]\)/ig,function(){caretPosition-=2;return"\u00a9";}).replace(/\(r\)/ig,function(){caretPosition-=2;return"\u00ae";}).replace(/\(tm\)/ig,function(){caretPosition-=2;return"\u2122";}).replace(/\([\u0440p]\)/ig,function(){caretPosition-=2;return"\u20bd";}).replace(/\.{3}/g,function(){caretPosition-=2;return"\u2026";}).replace(/\"([a-z0-9\u0410-\u042f\u0401\u2026])/ig,"«"+"$1").replace(/([a-z0-9\u0410-\u042f\u0401\u2026?!])\"/ig,"$1"+"»").replace(new RegExp('"('+"«"+"[a-z0-9\u0410-\u042f\u0401\u2026])","ig"),"«"+"$1").replace(new RegExp("([a-z0-9\u0410-\u042f\u0401\u2026?!]"+"»"+')"',"ig"),"$1"+"»").replace(new RegExp("([-a-z0-9]+=)"+"["+"«"+"»"+"]"+"([^"+"«"+"»"+"]*?)","ig"),'$1"$2').replace(new RegExp('([-a-z0-9]+=)["]'+"([^>"+"«"+"»"+"]*?)"+"["+"«"+"»"+"]","ig"),'$1"$2"').replace(new RegExp("([0-6]?[0-9])['\u2032]([0-6]?[0-9])?(\\d+)"+"["+"»"+'"]',"g"),"$1'$2$3\"");}
176function x_analytics(url,callback){var xmlHttp=new XMLHttpRequest();xmlHttp.onreadystatechange=function(){if(xmlHttp.readyState==4&&xmlHttp.status==200){
176if(callback!==undefined){callback(xmlHttp.responseText);}}}
177xmlHttp.open('GET',x_collection.url_ajax+'.a/'+url,true);xmlHttp.send(null);}
178function x_purify($html){x_collection['purify_max_num_image']=10;var html=x_purify_branch($html,{});html=html.replace(/(<br>\s*)*<br>/g,'<br>').replace(/<br>\s*</g,'<').replace(/>\s*<br>/g,'>').replace(/^\s*<br>/g,'').replace(/<br>\s$/g,'');return html;}
179function x_purify_branch($html,options){var
180branch='',res='',tag_cr=new Array('address','blockquote','caption','center','dd','div','dt','embed','form','frame','h1','h2','h3','h4','h5','h6','hr','iframe','img','li','marquee','p','pre','th','tr'),tag_fbdn=new Array('iframe'),tagName='',text='';if(typeof options==='undefined'){options={};}
181$html.contents().each(function(){switch($(this)[0].nodeType){case Node.ELEMENT_NODE:tagName=$(this)[0].tagName.toLowerCase();switch(tagName){case'a':branch=x_purify_branch_severe($(this));var href=$(this).attr('href');if(href!==undefined&&href!==''){var type=href.split('.').pop();var valid_types=['doc','docx','pdf','xls','xlsx'];if(in_array(valid_types,type)){res+='<a href="'+href+'">'+branch+'</a>';}else{res+=branch;}}else{res+=branch;}
182break;case'br':res+='<br>';break;case'h6':branch=x_purify_branch($(this),{'h6':true,'trim':true});if(branch!=''){res+='<h6>'+branch+'</h6>';}
183break;case'sup':branch=x_purify_branch($(this),{'trim':true});if(branch!=''){res+='<sup>'+branch+'</sup>';}
184break;case'sub':branch=x_purify_branch($(this),{'trim':true});if(branch!=''){res+='<sub>'+branch+'</sub>';}
185break;case'h1':case'h2':case'h3':case'h4':case'h5':branch=x_purify_branch($(this),{'trim':true});if(branch!=''){res+='<h3>'+branch+'</h3>';}
186break;case'img':var src=$(this).attr('src');if(src===undefined&&src!==''){src=$(this).attr('fake-src');}
187res+='<img src="'+src+'">';break;case'ul':case'ol':branch=x_purify_branch($(this),{'trim':true});if(branch!=''){res+='<ul>'+branch+'</ul>';}
188break;case'li':branch=x_purify_branch($(this),{'trim':true});if(branch!=''){res+='<li>'+branch+'</li>';}
189break;case'table':var
190$table=$(this),$td,$tr,cell,colspan,columns=0,data=[],i,j,rowspan,x=0,y=0;$table.find('tr').not($table.find('table tr')).each(function(){$tr=$(this);$tr.find('td, th').not($table.find('table td, table th')).each(function(){$td=$(this);while(data[y]!==undefined&&data[y][x]!==undefined){x++;}
191colspan=$td.attr('colspan')||1;rowspan=$td.attr('rowspan')||1;cell={colspan:colspan,rowspan:rowspan,html:x_purify_branch($td,{'trim':true})};for(i=0;i<colspan;i++){for(j=0;j<rowspan;j++){if(data[y+j]===undefined){data[y+j]=[];}
192data[y+j][x+i]=0;columns=Math.max(columns,x+i);}}
193if(data[y]===undefined){data[y]=[];}
194data[y][x]=cell;x+=1;});x=0;y++;});res+='<table>';for(y in data){res+='<tr>';for(x in data[y]){if(data[y][x]!==0){res+='<td';if(data[y][x].colspan>1){res+=' colspan="'+data[y][x].colspan+'"';}
195if(data[y][x].rowspan>1){res+=' rowspan="'+data[y][x].rowspan+'"';}
196res+='>'+data[y][x].html+'</td>';}}
197if(data[y].length<columns+1){for(x=0;x<columns+1-data[y].length;x++){res+='<td></td>';}}
198res+='</tr>';}
199res+='</table>';break;default:if(!in_array(tag_fbdn,tagName)){if(in_array(tag_cr,tagName)){res+='<br>'+x_purify_branch($(this),{'trim':true})+'<br>';}else{res+=x_purify_branch($(this));}}}
200break;case Node.TEXT_NODE:text=$(this).text().replace(/&/g,'&amp;').replace(/</g,'&lt;').replace(/>/g,'&gt;').replace(/\\xA0/g,' ').replace(/\s+/g,' ');if(text!=''){res+=text;}
201break;}});if(typeof options.trim!=='undefined'){res=res.replace(/^\s+/,'').replace(/\s+$/,'');}
202return res;}
203function x_purify_branch_severe($html,options){var
204branch='',res='',tag_cr=new Array('address','blockquote','caption','center','dd','div','dt','embed','form','frame','h1','h2','h3','h4','h5','h6','hr','iframe','img','li','marquee','p','pre','th','tr'),tag_fbdn=new Array('iframe'),tagName='',text='';if(typeof options==='undefined'){options={};}
205$html.contents().each(function(){switch($(this)[0].nodeType){case Node.ELEMENT_NODE:tagName=$(this)[0].tagName.toLowerCase();switch(tagName){case'br':res+='<br>';break;case'img':var src=$(this).attr('src');if(src===undefined&&src!==''){src=$(this).attr('fake-src');}
206if(src!==undefined&&src!==''){res+='<img src="'+src+'">';}
207break;default:if(!in_array(tag_fbdn,tagName)){if(in_array(tag_cr,tagName)){res+='<br>'+x_purify_branch_severe($(this))+'<br>';}else{res+=x_purify_branch_severe($(this));}}}
208break;case Node.TEXT_NODE:text=$(this).text().replace(/\\xA0/g,' ').replace(/\s+/g,' ');if(text!=''){res+=text;}
209break;}});res=res.replace(/^\s+/,'').replace(/\s+$/,'');return res;}
210function x_update_query(uri,key,value){var regexp=new RegExp("([?&])"+key+"=.*?(&|$)","i");var separator=uri.indexOf('?')!==-1?'&':'?';if(uri.match(regexp)){if(value==''){uri=uri.replace(regexp,'$1');uri=uri.replace(/\?&/,'?');uri=uri.replace(/\?$/,'');}else{uri=uri.replace(regexp,'$1'+key+'='+value+'$2');}}else{if(value!=''){uri+=separator+key+'='+value;}}
211return uri;}
212var bkExtend=function(){var args=arguments;if(args.length==1){args=[this,args[0]];}
213for(var prop in args[1]){args[0][prop]=args[1][prop];}
214return args[0]};function bkClass(){}
215bkClass.prototype.construct=function(){};bkClass.extend=function(def){var classDef=function(){if(arguments[0]!==bkClass){return this.construct.apply(this,arguments);}};var proto=new this(bkClass);bkExtend(proto,def);classDef.prototype=proto;classDef.extend=this.extend;return classDef;};var bkElement=bkClass.extend({construct:function(elm,d){if(typeof elm=='string'){elm=(d||document).createElement(elm);}
216elm=$BK(elm);return elm;},appendTo:function(elm){elm.appendChild(this);return this;},appendBefore:function(elm){elm.parentNode.insertBefore(this,elm);return this;},addEvent:function(type,fn){bkLib.addEvent(this,type,fn);return this;},setContent:function(c){this.innerHTML=c;return this;},pos:function(){var curleft=curtop=0;var o=obj=this;if(obj.offsetParent){do{curleft+=obj.offsetLeft;curtop+=obj.offsetTop;}while(obj=obj.offsetParent);}
217var b=!window.opera?parseInt(this.getStyle('border-width')||this.style.border)||0:0;return[curleft+b,curtop+b+this.offsetHeight];},noSelect:function(){bkLib.noSelect(this);return this;},parentTag:function(t){var elm=this;do{if(elm&&elm.nodeName&&elm.nodeName.toUpperCase()==t){return elm;}
218elm=elm.parentNode;}while(elm);return false;},hasClass:function(cls){return this.className.match(new RegExp("(\\s|^)nicEdit_"+cls+"(\\s|$)"));},addClassRAW:function(cls){this.className+=' '+cls;return this;},addClass:function(cls){if(!this.hasClass(cls)){this.className+=" nicEdit_"+cls;}
219return this;},removeClass:function(cls){if(this.hasClass(cls)){this.className=this.className.replace(new RegExp('(\\s|^)nicEdit_'+cls+'(\\s|$)'),' ');}
220return this;},setStyle:function(st){var elmStyle=this.style;for(var itm in st){switch(itm){case'float':elmStyle['cssFloat']=elmStyle['styleFloat']=st[itm];break;case'opacity':elmStyle.opacity=st[itm];elmStyle.filter='alpha(opacity='+Math.round(st[itm]*100)+')';break;case'className':this.className=st[itm];break;default:elmStyle[itm]=st[itm];}}
221return this;},getStyle:function(cssRule,d){var doc=!d?document.defaultView:d;if(this.nodeType==1){return doc&&doc.getComputedStyle?doc.getComputedStyle(this,null).getPropertyValue(cssRule):this.currentStyle[bkLib.camelize(cssRule)];}},remove:function(){this.parentNode.removeChild(this);return this;},setAttributes:function(at){for(var itm in at){this[itm]=at[itm];}
222return this;}});var bkLib={isMSIE:navigator.appVersion.indexOf("MSIE")!=-1,addEvent:function(obj,type,fn){obj.addEventListener?obj.addEventListener(type,fn,false):obj.attachEvent("on"+type,fn);},toArray:function(iterable){var length=iterable.length,results=new Array(length);while(length--){results[length]=iterable[length];}
223return results;},noSelect:function(element){if(element.setAttribute&&element.nodeName.toLowerCase()!='input'&&element.nodeName.toLowerCase()!='textarea'){element.setAttribute("unselectable","on");}
224for(var i=0;i<element.childNodes.length;i++){bkLib.noSelect(element.childNodes[i]);}}
224,camelize:function(s){return s.replace(/\-(.)/g,function(m,l){return l.toUpperCase();});},inArray:function(arr,item){return bkLib.search(arr,item)!=null;},search:function(arr,itm){for(var i=0;i<arr.length;i++){if(arr[i]==itm){return i;}}
225return null;},cancelEvent:function(e){e=e||window.event;if(e.preventDefault&&e.stopPropagation){e.preventDefault();e.stopPropagation()}
226return false;},domLoad:[],domLoaded:function(){if(arguments.callee.done){return;}
227arguments.callee.done=true;for(i=0;i<bkLib.domLoad.length;i++){bkLib.domLoad[i]();}},onDomLoaded:function(fireThis){this.domLoad.push(fireThis);if(document.addEventListener){document.addEventListener("DOMContentLoaded",bkLib.domLoaded,null);}else{if(bkLib.isMSIE){document.write("<style> .nicEdit_main p{margin:0} </style><scr"+"ipt id=__ie_onload defer "+(location.protocol=="https:"?"src='javascript:void(0)'":"src=//0")+"></scr"+"ipt>");$BK("__ie_onload").onreadystatechange=function(){if(this.readyState=="complete"){bkLib.domLoaded()}}}}
228window.onload=bkLib.domLoaded;}};function $BK(elm){if(typeof elm=='string'){elm=document.getElementById(elm);}
229return elm&&!elm.appendTo?bkExtend(elm,bkElement.prototype):elm}
230var bkEvent={addEvent:function(evType,evFunc){if(evFunc){this.eventList=this.eventList||{};this.eventList[evType]=this.eventList[evType]||[];this.eventList[evType].push(evFunc)}
231return this;},fireEvent:function(){var args=bkLib.toArray(arguments),evType=args.shift();if(this.eventList&&this.eventList[evType]){for(var i=0;i<this.eventList[evType].length;i++){this.eventList[evType][i].apply(this,args)}}}};function __(s){return s;}
232Function.prototype.closure=function(){var
233__method=this,args=bkLib.toArray(arguments),obj=args.shift();return function(){if(typeof bkLib!='undefined'){return __method.apply(obj,args.concat(bkLib.toArray(arguments)));}}};Function.prototype.closureListener=function(){var
234__method=this,args=bkLib.toArray(arguments),object=args.shift();return function(e){e=e||window.event;if(e.target){var target=e.target;}else{var target=e.srcElement;}
235return __method.apply(object,[e,target].concat(args));}};var nicEditorConfig=bkClass.extend({buttons:{'fullscreen':{name:__('Ðàçâåðíóòü íà âåñü ýêðàí'),type:'nicFullscreenButton'},'purify':{name:__('Óäàëèòü ôîðìàòèðîâàíèå'),type:'nicPurifyButton'},'h2':{name:__('Çàãîëîâîê'),command:'formatBlock',commandArgs:'<H2>',tags:['H2']},'h3':{name:__('Ïîäçàãîëîâîê'),command:'formatBlock',commandArgs:'<H3>',tags:['H3']},'h5':{name:__('Öèòàòà'),command:'formatBlock',commandArgs:'<H5>',tags:['H5']},'h6':{name:__('Ïîäïèñü ê èçîáðàæåíèþ'),command:'formatBlock',commandArgs:'<H6>',tags:['H6']},'bold':{name:__('Æèðíûé'),command:'Bold',tags:['B','STRONG'],css:{'font-weight':'bold'},key:'b'},'italic':{name:__('Êóðñèâ'),command:'Italic',tags:['EM','I'],css:{'font-style':'italic'},key:'i'},'underline':{name:__('Ïîä÷åðêíóòûé'),command:'Underline',tags:['U'],css:{'text-decoration':'underline'},key:'u'},'left':{name:__('Âûðàâíèâàíèå ïî ëåâîìó êðàþ'),command:'justifyleft',noActive:true},'center':{name:__('Âûðàâíèâàíèå ïî öåíòðó'),command:'justifycenter',noActive:true},'right':{name:__('Âûðàâíèâàíèå ïî ïðàâîìó êðàþ'),command:'justifyright',noActive:true},'justify':{name:__('Âûðàâíèâàíèå ïî øèðèíå'),command:'justifyfull',noActive:true},'ol':{name:__('Íóìåðîâàííûé ñïèñîê'),command:'insertorderedlist',tags:['OL']},'ul':{name:__('Ìàðêèðîâàííûé ñïèñîê'),command:'insertunorderedlist',tags:['UL']},'subscript':{name:__('Âåðõíèé èíäåêñ'),command:'subscript',tags:['SUB']},'superscript':{name:__('Íèæíèé èíäåêñ'),command:'superscript',tags:['SUP']},'strikethrough':{name:__('Çà÷åðêíóòûé'),command:'strikeThrough',css:{'text-decoration':'line-through'}},'removeformat':{name:__('Óäàëèòü ôîðìàòèðîâàíèå'),command:'removeformat',noActive:true},'hr':{name:__('Ëèíèÿ îòðåçà'),command:'insertHorizontalRule',noActive:true},'code':{name:__('Èñõîäíûé êîä'),type:'nicCodeButton'}},iconsPath:'',maxLength:65536,rootClass:'text',purifyScript:'',purifyMode:'',buttonList:['fullscreen','purify','h2','h3','h5','h6','bold','italic','ol','ul','left','center','right','strikethrough','superscript','subscript','image','video','link','unlink','code'],iconList:{'fullscreen':30,'windowed':31,'purify':24,'arrow':22,'h2':26,'h3':27,'h5':28,'h6':29,'bold':1,'center':6,'hr':20,'image':14,'video':25,'italic':2,'justify':0,'left':5,'link':17,'ol':4,'removeformat':0,'right':7,'strikethrough':10,'subscript':12,'superscript':11,'ul':3,'underline':0,'unlink':18,'xhtml':0,'code':23}});var nicEditors={nicPlugins:[],editors:[],registerPlugin:function(plugin,options){this.nicPlugins.push({p:plugin,o:options});},allTextAreas:function(nicOptions){var textareas=document.getElementsByTagName("textarea");for(var i=0;i<textareas.length;i++){nicEditors.editors.push((new nicEditor(nicOptions)).panelInstance(textareas[i]));}
236return nicEditors.editors;},findEditor:function(e){var editors=nicEditors.editors;for(var i=0;i<editors.length;i++){if(editors[i].instanceById(e)){return editors[i].instanceById(e)}}}};var nicEditor=bkClass.extend({construct:function(o){this.options=new nicEditorConfig;bkExtend(this.options,o);this.nicInstances=new Array;this.loadedPlugins=new Array;var plugins=nicEditors.nicPlugins;for(var i=0;i<plugins.length;i++){this.loadedPlugins.push(new plugins[i].p(this,plugins[i].o));}
237nicEditors.editors.push(this);bkLib.addEvent(document.body,"mousedown",this.selectCheck.closureListener(this));},panelInstance:function(e,o){e=this.checkReplace($BK(e));var panelElm=(new bkElement("div")).appendBefore(e);this.setPanel(panelElm);return this.addInstance(e,o);},checkReplace:function(e){var r=nicEditors.findEditor(e);console.log(r);if(r){r.removeInstance(e);r.removePanel()}
238return e;},addInstance:function(e,o){e=this.checkReplace($BK(e));if(e.contentEditable||!!window.opera){var newInstance=new nicEditorInstance(e,o,this);}else{var newInstance=new nicEditorIFrameInstance(e,o,this);}
239this.nicInstances.push(newInstance);return this;},removeInstance:function(e){e=$BK(e);var instances=this.nicInstances;for(var i=0;i<instances.length;i++){if(instances[i].e==e){instances[i].remove();this.nicInstances.splice(i,1);}}},removePanel:function(e){if(this.nicPanel){this.nicPanel.remove();this.nicPanel=null}},instanceById:function(e){e=$BK(e);var instances=this.nicInstances;for(var i=0;i<instances.length;i++){if(instances[i].e==e){return instances[i];}}},setPanel:function(e){this.nicPanel=new nicEditorPanel($BK(e),this.options,this);this.fireEvent("panel",this.nicPanel);return this;},nicCommand:function(cmd,args){if(this.selectedInstance){this.selectedInstance.nicCommand(cmd,args);}},getIcon:function(iconName,options){var icon=this.options.iconList[iconName];var file=options.iconFiles?options.iconFiles[iconName]:"";return{backgroundImage:"url('"+(icon?this.options.iconsPath:file)+"')",backgroundPosition:(icon?(icon-1)*-24:0)+"px 0"}},selectCheck:function(e,t){var found=false;do{if(t.className&&t.className.indexOf("nicEdit")!=-1){return false}}while(t=t.parentNode);this.fireEvent("blur",this.selectedInstance,t);this.lastSelectedInstance=this.selectedInstance;this.selectedInstance=null;return false}});nicEditor=nicEditor.extend(bkEvent);var nicEditorInstance=bkClass.extend({isSelected:false,construct:function(e,options,nicEditor){this.ne=nicEditor;this.elm=this.e=e;this.options=options||{};
239newY=parseInt(e.getStyle("height"))||e.clientHeight;this.initialHeight=newY-8;var isTextarea=e.nodeName.toLowerCase()=='textarea';if(isTextarea||this.options.hasPanel){var s={};s['maxHeight']=this.ne.options.maxHeight?this.ne.options.maxHeight+'px':null;this.editorContain=(new bkElement('div')).setStyle(s).addClass('editorContain').appendBefore(e);var editorElm=(new bkElement('div')).setStyle({minHeight:newY+'px'}).addClass('main').addClass(this.ne.options.rootClass).appendTo(this.editorContain);this.statusContain=(new bkElement('div')).addClassRAW('iform_countdown').appendBefore(e);e.setStyle({display:'none'});editorElm.innerHTML=e.innerHTML;if(isTextarea){editorElm.setContent(e.value);this.copyElm=e;var f=e.parentTag('FORM');if(f){bkLib.addEvent(f,'submit',this.saveContent.closure(this))}}
240editorElm.setStyle({overflow:'hidden'});this.elm=editorElm;}
241this.ne.addEvent('blur',this.blur.closure(this));this.init();this.blur();},init:function(){this.elm.setAttribute('contentEditable','true');if(this.getContent()==''){this.setContent('<br>');}
242this.instanceDoc=document.defaultView;this.elm.addEvent('mousedown',this.selected.closureListener(this)).addEvent('keypress',this.keyDown.closureListener(this)).addEvent('focus',this.selected.closure(this)).addEvent('blur',this.blur.closure(this)).addEvent('keyup',this.selected.closure(this));this.ne.fireEvent('add',this);},remove:function(){this.saveContent();if(this.copyElm||this.options.hasPanel){this.editorContain.remove();this.statusContain.remove();this.e.setStyle({display:'block'});this.ne.removePanel();}
243this.disable();this.ne.fireEvent('remove',this);},disable:function(){this.elm.setAttribute('contentEditable','false');},getSel:function(){return window.getSelection?window.getSelection():document.selection;},getRng:function(){var s=this.getSel();if(!s){return null;}
244return s.rangeCount>0?s.getRangeAt(0):s.createRange&&s.createRange()||document.createRange();},selRng:function(rng,s){if(window.getSelection){s.removeAllRanges();s.addRange(rng);}else{rng.select();}},selElm:function(){var r=this.getRng();if(r.startContainer){var contain=r.startContainer;if(r.cloneContents().childNodes.length==1){for(var i=0;i<contain.childNodes.length;i++){var rng=contain.childNodes[i].ownerDocument.createRange();rng.selectNode(contain.childNodes[i]);if(r.compareBoundaryPoints(Range.START_TO_START,rng)!=1&&r.compareBoundaryPoints(Range.END_TO_END,rng)!=-1){return $BK(contain.childNodes[i]);}}}
245return $BK(contain);}else{return $BK(this.getSel().type=='Control'?r.item(0):r.parentElement());}},saveRng:function(){this.savedRange=this.getRng();this.savedSel=this.getSel();},restoreRng:function(){if(this.savedRange){this.selRng(this.savedRange,this.savedSel);}},keyDown:function(e,t){if(e.ctrlKey){this.ne.fireEvent('key',this,e);}},keyUp:function(e,t){},selected:function(e,t){this.content=this.getElm().innerHTML;var l=Math.round(this.content.length/this.ne.options.maxLength*100);if(l>100){this.statusContain.innerHTML='<div class="overflow">'+l+'%</div>'}else{this.statusContain.innerHTML='<div>'+l+'%</div>'}
246if(!t){t=this.selElm();}
247if(!e.ctrlKey){var selInstance=this.ne.selectedInstance;if(selInstance!=this){if(selInstance){this.ne.fireEvent('blur',selInstance,t);}
248this.ne.selectedInstance=this;this.ne.fireEvent('focus',selInstance,t);}
249this.ne.fireEvent('selected',selInstance,t);this.isFocused=true;this.elm.addClass('selected');}
250return false;},blur:function(){this.isFocused=false;this.elm.removeClass('selected');},saveContent:function(){if(this.copyElm||this.options.hasPanel){this.ne.fireEvent('save',this);this.copyElm?this.copyElm.value=this.getContent():this.e.innerHTML=this.getContent();}},getElm:function(){return this.elm;},getContent:function(){this.content=this.getElm().innerHTML;this.ne.fireEvent('get',this);return this.content;},setContent:function(e){this.content=e;this.ne.fireEvent('set',this);this.elm.innerHTML=this.content;},nicCommand:function(cmd,args){try{document.execCommand('styleWithCSS',0,false);}catch(e){try{document.execCommand('useCSS',0,true);}catch(e$$1){try{document.execCommand('styleWithCSS',false,false);}catch(e$$2){}}}
251document.execCommand(cmd,false,args);}});var nicEditorIFrameInstance=nicEditorInstance.extend({savedStyles:[],init:function(){var c=this.elm.innerHTML.replace(/^\s+|\s+$/g,"");this.elm.innerHTML='';!c?c='<br>':c;this.initialContent=c;this.elmFrame=(new bkElement("iframe")).setAttributes({src:'javascript:;',frameBorder:0,allowTransparency:'true',scrolling:'no'}).setStyle({height:'100px',width:'100%'}).addClass('frame').appendTo(this.elm);if(this.copyElm){this.elmFrame.setStyle({width:this.elm.offsetWidth-4+'px'})}
252var styleList=['font-size','font-family','font-weight','color'];for(itm in styleList){this.savedStyles[bkLib.camelize(itm)]=this.elm.getStyle(itm);}
253setTimeout(this.initFrame.closure(this),50);},disable:function(){this.elm.innerHTML=this.getContent();},initFrame:function(){var fd=$BK(this.elmFrame.contentWindow.document);fd.designMode='on';fd.open();var css=this.ne.options.externalCSS;fd.write("<html><head>"+(css?'<link href="'+css+'" rel="stylesheet" type="text/css">':'')+'</head><body id="nicEditContent" style="margin: 0 !important;background-color:transparent !important">'+this.initialContent+'</body></html>');fd.close();this.frameDoc=fd;this.frameWin=$BK(this.elmFrame.contentWindow);this.frameContent=$BK(this.frameWin.document.body).setStyle(this.savedStyles);this.instanceDoc=this.frameWin.document.defaultView;this.heightUpdate();this.frameDoc.addEvent('mousedown',this.selected.closureListener(this)).addEvent('keyup',this.heightUpdate.closureListener(this)).addEvent('keydown',this.keyDown.closureListener(this)).addEvent('keyup',this.selected.closure(this));this.ne.fireEvent('add',this);},getElm:function(){return this.frameContent;},setContent:function(c){this.content=c;this.ne.fireEvent('set',this);this.frameContent.innerHTML=this.content;this.heightUpdate();}
253,getSel:function(){return this.frameWin?this.frameWin.getSelection():this.frameDoc.selection;},heightUpdate:function(){this.elmFrame.style.height=Math.max(this.frameContent.offsetHeight,this.initialHeight)+'px';},nicCommand:function(cmd,args){this.frameDoc.execCommand(cmd,false,args);setTimeout(this.heightUpdate.closure(this),100);}});var nicEditorPanel=bkClass.extend({construct:function(e,options,nicEditor){this.elm=e;this.options=options;this.ne=nicEditor;this.panelButtons=new Array();this.buttonList=bkExtend([],this.ne.options.buttonList);this.panelContain=(new bkElement('div')).addClass('panelContain');this.panelElm=(new bkElement('div')).addClass('panel').appendTo(this.panelContain);this.panelContain.appendTo(e);var opt=this.ne.options;var buttons=opt.buttons;for(button in buttons){this.addButton(button,opt,true);}
254this.reorder();e.noSelect();},addButton:function(buttonName,options,noOrder){var button=options.buttons[buttonName];var type=button["type"]?eval("(typeof("+button["type"]+')=="undefined") ? null:'+button["type"]+";"):nicEditorButton;var hasButton=bkLib.inArray(this.buttonList,buttonName);if(type&&(hasButton||this.ne.options.fullPanel)){this.panelButtons.push(new type(this.panelElm,buttonName,options,this.ne));if(!hasButton){this.buttonList.push(buttonName);}}},findButton:function(itm){for(var i=0;i<this.panelButtons.length;i++){if(this.panelButtons[i].name==itm){return this.panelButtons[i];}}},reorder:function(){var bl=this.buttonList;for(var i=0;i<bl.length;i++){var button=this.findButton(bl[i]);if(button){this.panelElm.appendChild(button.margin)}}},remove:function(){this.elm.remove();}});var nicEditorButton=bkClass.extend({construct:function(e,buttonName,options,nicEditor){this.options=options.buttons[buttonName];this.name=buttonName;this.ne=nicEditor;this.elm=e;this.margin=(new bkElement('div')).addClass((buttonName=='fullscreen'?'buttonMarginRight':'buttonMargin')).appendTo(e);this.contain=(new bkElement('div')).addClass('buttonContain').appendTo(this.margin);this.button=(new bkElement('div')).addClass('button').setAttributes({"title":this.options.name}).setStyle(this.ne.getIcon(buttonName,options)).appendTo(this.contain);this.button.addEvent('mouseover',this.hoverOn.closure(this)).addEvent('mouseout',this.hoverOff.closure(this)).addEvent('mousedown',this.mouseClick.closure(this)).noSelect();if(!window.opera){this.button.onmousedown=this.button.onclick=bkLib.cancelEvent;}
255nicEditor.addEvent('selected',this.enable.closure(this)).addEvent('blur',this.disable.closure(this)).addEvent('key',this.key.closure(this));this.disable();this.init();},init:function(){},hide:function(){this.contain.setStyle({display:'none'});},updateState:function(){if(this.isDisabled){this.setBg();}else{if(this.isHover){this.setBg('hover');}else{if(this.isActive){this.setBg('active');}else{this.setBg();}}}},setBg:function(state){switch(state){case'hover':var stateStyle={backgroundColor:'#666'};break;case'active':var stateStyle={backgroundColor:'#666'};break;default:var stateStyle={backgroundColor:'#999'}}
256this.contain.setStyle(stateStyle).addClass('button_'+state);},checkNodes:function(e){var elm=e;do{if(this.options.tags&&bkLib.inArray(this.options.tags,elm.nodeName)){this.activate();return true}}while(elm=elm.parentNode&&elm.className!='nicEdit');elm=$BK(e);while(elm.nodeType==3){elm=$BK(elm.parentNode);}
257if(this.options.css){for(itm in this.options.css){if(elm.getStyle(itm,this.ne.selectedInstance.instanceDoc)==this.options.css[itm]){this.activate();return true;}}}
258this.deactivate();return false;},activate:function(){if(!this.isDisabled){this.isActive=true;this.updateState();this.ne.fireEvent('buttonActivate',this);}},deactivate:function(){this.isActive=false;this.updateState();if(!this.isDisabled){this.ne.fireEvent('buttonDeactivate',this);}},enable:function(ins,t){if(this.name=='fullscreen')return;this.isDisabled=false;this.contain.setStyle({opacity:1}).addClass('buttonEnabled');this.updateState();this.checkNodes(t);},disable:function(ins,t){if(this.name=='fullscreen')return;this.isDisabled=true;this.contain.setStyle({opacity:0.5}).removeClass('buttonEnabled');this.updateState();},toggleActive:function(){this.isActive?this.deactivate():this.activate();},hoverOn:function(){if(!this.isDisabled){this.isHover=true;this.updateState();this.ne.fireEvent('buttonOver',this);}},hoverOff:function(){this.isHover=false;this.updateState();this.ne.fireEvent('buttonOut',this);},mouseClick:function(){if(this.options.command){if(this.options.command=="formatBlock"){if(this.isActive){this.ne.nicCommand(this.options.command,"<P>");}else{this.ne.nicCommand(this.options.command,this.options.commandArgs);}}else{this.ne.nicCommand(this.options.command,this.options.commandArgs);}
259if(!this.options.noActive){this.toggleActive();}}
260this.ne.fireEvent("buttonClick",this);},key:function(nicInstance,e){if(this.options.key&&e.ctrlKey&&String.fromCharCode(e.keyCode||e.charCode).toLowerCase()==this.options.key){this.mouseClick();if(e.preventDefault){e.preventDefault();}}}});var nicPlugin=bkClass.extend({construct:function(nicEditor,options){this.options=options;this.ne=nicEditor;this.ne.addEvent('panel',this.loadPanel.closure(this));this.init();},loadPanel:function(np){var buttons=this.options.buttons;for(var button in buttons){np.addButton(button,this.options);}
261np.reorder();},init:function(){}});var nicPaneOptions={};var nicEditorPane=bkClass.extend({construct:function(elm,nicEditor,options,openButton){this.ne=nicEditor;this.elm=elm;if('fullscreen'in this.ne&&this.ne.fullscreen){this.contain=(new bkElement('div')).addClass('paneContainFullscreen');this.pane=(new bkElement('div')).addClass('pane').appendTo(this.contain);this.contain.noSelect().appendTo(document.body);}else{this.pos=elm.pos();this.contain=(new bkElement('div')).addClass('paneContain').setStyle({left:this.pos[0]+'px',top:this.pos[1]+'px'});this.pane=(new bkElement('div')).addClass('pane').setStyle(options).appendTo(this.contain);this.contain.noSelect().appendTo(document.body);this.position();}
262this.init()},init:function(){},position:function(){if(this.ne.nicPanel){var panelElm=this.ne.nicPanel.elm;var panelPos=panelElm.pos();var newLeft=panelPos[0]+parseInt(panelElm.getStyle("width"))-(parseInt(this.pane.getStyle("width"))+8);if(newLeft<this.pos[0])this.contain.setStyle({left:newLeft+"px"});}},toggle:function(){this.isVisible=!this.isVisible;this.contain.setStyle({display:this.isVisible?"block":"none"});},remove:function(){if(this.contain){this.contain.remove();this.contain=null;}},append:function(c){c.appendTo(this.pane);},setContent:function(c){this.pane.setContent(c);}});var nicEditorAdvancedButton=nicEditorButton.extend({init:function(){this.ne.addEvent("selected",this.removePane.closure(this)).addEvent("blur",this.removePane.closure(this)).addEvent("fullscreen",this.removePane.closure(this)).addEvent("windowed",this.removePane.closure(this))},mouseClick:function(){if(!this.isDisabled){if(this.pane&&this.pane.pane){this.removePane()}else{this.pane=new nicEditorPane(this.contain,this.ne,{width:this.width||'375px'},this);this.addPane();this.ne.selectedInstance.saveRng()}}},addForm:function(f,elm){var self=this;this.form=(new bkElement("form")).addClass("iform").setAttributes({"enctype":"multipart/form-data"}).addEvent("submit",this.submit.closureListener(this));this.pane.append(this.form);this.inputs={};for(itm in f){var field=f[itm];var val="";if(elm){val=elm.getAttribute(itm)}
263if(!val){val=field["value"]||""}
264var type=f[itm].type;var name=f[itm].name;switch(type){case'images':var images=(new bkElement("div")).addClass("adm_image_list").addClassRAW("adm_image_list").appendTo(this.form).setContent(x_ajax_loader);
264JsHttpRequest.query(x_ajax_path+'ajax/adm/image/list/',{ajx_act:'start',ajx_file:0,ajx_image_id:0,ajx_mode:2,ajx_namespace:'w',ajx_offset:0},function(res,err){if(res){(new bkElement("div")).addClass("iform_line").appendBefore(images).setContent(res['ajx_image_file']);images.setContent('<ul>'+res['ajx_image_list']+'</ul>');x_collection['image_list_w']=new Image_list({container:$(images),namespace:'w',act:'',image_id:0,mode:2,offset:1});x_collection.image_list_w.target(self);x_collection.image_list_w.more();self.set=function(src){this.inputs['src'].value=src;}
265$('#f-file-w').x_file().on('change',function(){x_collection.image_list_w.upload(this);});}},true);break;case'pages':var pages=(new bkElement("div")).addClass("adm_page_list").appendTo(this.form).setContent(x_ajax_loader).addEvent('click',function(e){e.preventDefault();if(e.target.tagName=='A'){self.inputs['href'].value=e.target.href;self.inputs['title'].value=e.target.text;return false;}});JsHttpRequest.query(x_ajax_path+'ajax/page/tree/',{},function(res,err){if(res){pages.setContent(res['ajx_page_tree']);}},true);break;case'title':(new bkElement("div")).setContent(field.txt).addClass("iform_title").appendTo(this.form)
266break;case'end':(new bkElement("div")).addClass("iform_end").appendTo(this.form)
267break;case'submit':var contain=(new bkElement("div")).addClass("iform_line").appendTo(this.form);(new bkElement("input")).setAttributes({value:val,type:"submit"}).addClass("iform_button").appendTo(contain);break;default:var contain=(new bkElement("div")).addClass("iform_line").appendTo(this.form);if(field.txt){(new bkElement("label")).setAttributes({"for":itm}).setContent(field.txt).appendTo(contain);}
268switch(type){case"text":this.inputs[itm]=(new bkElement("input")).setAttributes({id:itm,value:val,type:"text"}).addClass("iform_input").setStyle(field.style).appendTo(contain);break;case"radio":this.inputs[itm]=(new bkElement("input")).setAttributes({id:itm,name:name,value:val,type:"radio"}).addClass("iform_input").setStyle(field.style).appendTo(contain);break;case"source":this.inputs[itm]=(new bkElement("textarea")).setAttributes({id:itm}).addClass("iform_source").setStyle(field.style).appendTo(contain);this.inputs[itm].value=val;}
269if(field.info){(new bkElement("span")).setContent(field.info).addClass("iform_label").appendTo(contain)}}}
270this.form.onsubmit=bkLib.cancelEvent;$(this.pane.contain).draggable({handle:'.nicEdit_iform_title:first'});},submit:function(){},findElm:function(tag,attr,val){var list=this.ne.selectedInstance.getElm().getElementsByTagName(tag);for(var i=0;i<list.length;i++){if(list[i].getAttribute(attr)==val){return $BK(list[i])}}},removePane:function(){if(this.pane){this.pane.remove();this.pane=null;this.ne.selectedInstance.restoreRng();}}});var nicButtonTips=bkClass.extend({});nicEditors.registerPlugin(nicButtonTips);var nicLinkOptions={buttons:{link:{name:"Äîáàâèòü ññûëêó",type:"nicLinkButton",tags:["A"]},unlink:{name:"Óäàëèòü ññûëêó",command:"unlink",noActive:true}}};var nicLinkButton=nicEditorAdvancedButton.extend({addPane:function(){this.ln=this.ne.selectedInstance.selElm().parentTag("A");this.addForm({"head1":{type:"title",txt:"\u0412\u0441\u0442\u0430\u0432\u0438\u0442\u044c, \u0440\u0435\u0434\u0430\u043a\u0442\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0433\u0438\u043f\u0435\u0440\u0441\u0441\u044b\u043b\u043a\u0443"},"href":{type:"text",txt:"\u0421\u0441\u044b\u043b\u043a\u0430 \u0438\u043b\u0438 \u0430\u0434\u0440\u0435\u0441 \u044d\u043b\u0435\u043a\u0442\u0440\u043e\u043d\u043d\u043e\u0439 \u043f\u043e\u0447\u0442\u044b",value:""},"title":{type:"text",txt:"\u041e\u043f\u0438\u0441\u0430\u043d\u0438\u0435"},"submit":{type:"submit",value:"\u0412\u0441\u0442\u0430\u0432\u0438\u0442\u044c"},"head2":{type:"title",txt:"\u0421\u0441\u044b\u043b\u043a\u0430 \u043d\u0430 \u0441\u0442\u0440\u0430\u043d\u0438\u0446\u044b \u0441\u0430\u0439\u0442\u0430"},"":{type:"pages"},"end":{type:"end"}},this.ln)},submit:function(e){var url=this.inputs["href"].value;if(url=="http://"||url==""){alert("\u0412\u044b \u043d\u0435 \u0443\u043a\u0430\u0437\u0430\u043b\u0438 \u0441\u0441\u044b\u043b\u043a\u0443");return false;}
271this.removePane();if(!this.ln){var selected='';
271if(document.selection){selected=document.selection.createRange().text;}else{selected=window.getSelection();}
272var tmp='javascript:void(0)';if(selected==''){tmp=url;pasteHtmlAtCaret(this.inputs['title'].value||tmp,true);}
273this.ne.nicCommand("createlink",tmp);this.ln=this.findElm("A","href",tmp)
274if(this.ln.innerHTML==tmp){this.ln.innerHTML=this.inputs['title'].value||url;};}
275if(this.ln){if(url.match(/@/i)){if(url.match(/^mailto/i)){}else{url="mailto:"+url}}else{if(url.match(/^http/i)){}else{url="http://"+url}}
276if(url.match(x_cookie_path)){var t="_self"}else{var t="_blank"}
277this.ln.setAttributes({href:url,title:this.inputs['title'].value,target:t});}}});nicEditors.registerPlugin(nicPlugin,nicLinkOptions);var nicVideoOptions={buttons:{video:{name:"Âñòàâèòü âèäåîðîëèê",type:"nicVideoButton",tags:["EMBED"]}}};var nicVideoButton=nicEditorAdvancedButton.extend({addPane:function(){this.ln=this.ne.selectedInstance.selElm().parentTag("EMBED");this.addForm({"head1":{type:"title",txt:"\u0412\u0441\u0442\u0430\u0432\u0438\u0442\u044c, \u0440\u0435\u0434\u0430\u043a\u0442\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0433\u0438\u043f\u0435\u0440\u0441\u0441\u044b\u043b\u043a\u0443"},"data":{type:"text",txt:"Ññûëêà íà âèäåîðîëèê (YouTube, Vimeo è ò.ï.)",value:""},"submit":{type:"submit",value:"\u0412\u0441\u0442\u0430\u0432\u0438\u0442\u044c"},"end":{type:"title",txt:"&nbsp;"}},this.ln)},submit:function(e){var url=this.inputs["data"].value;if(url=="http://"||url==""){alert("\u0412\u044b \u043d\u0435 \u0443\u043a\u0430\u0437\u0430\u043b\u0438 \u0441\u0441\u044b\u043b\u043a\u0443");return false;}
278this.removePane();if(!this.ln){this.ne.nicCommand("inserthtml",'<EMBED src='+url+'>Video</EMBED>');}
279if(this.ln){if(url.match(/^http/i)){}else{url="http://"+url}
280this.ln.setAttributes({data:url});}}});nicEditors.registerPlugin(nicPlugin,nicVideoOptions);var nicImageOptions={buttons:{"image":{name:"Âñòàâèòü èçîáðàæåíèå",type:"nicImageButton",tags:["IMG"]}}};var nicImageButton=nicEditorAdvancedButton.extend({addPane:function(){this.im=this.ne.selectedInstance.selElm().parentTag("IMG");this.addForm({"head1":{type:"title",txt:"Âñòàâèòü, ðåäàêòèðîâàòü èçîáðàæåíèå"},"alt":{type:"text",txt:"Êëþ÷åâûå ñëîâà äëÿ ïîèñêîâûõ ñèñòåì"},"src":{type:"text",txt:"Ññûëêà íà èçîáðàæåíèå"},"submit":{type:"submit",value:"Âñòàâèòü"},"head2":{type:"title",txt:"Ðàíåå çàãðóæåííûå èçîáðàæåíèÿ"},"":{type:"images"},"end":{type:"end"}},this.im);},submit:function(e){var src=this.inputs["src"].value;if(src==""||src=="http://"){alert("Íå óêàçàíà ññûëêà íà èçîáðàæåíèå");return false;}
281this.removePane();if(!this.im){var src_list=src.split(',');var tmp="i/t.gif";for(var i in src_list){this.ne.nicCommand("insertImage",tmp);this.im=this.findElm("IMG","src",tmp);this.im.setAttributes({src:src_list[i],alt:this.inputs["alt"].value});}}else{var src_list=src.split(',');if(typeof src_list[0]!='undefined'){this.im.setAttributes({src:src_list[0],alt:this.inputs["alt"].value});}}}});nicEditors.registerPlugin(nicPlugin,nicImageOptions);var nicCodeOptions={buttons:{xhtml:{name:"Èñõîäíûé êîä",type:"nicCodeButton"}}};var nicCodeButton=nicEditorAdvancedButton.extend({width:"475px",addPane:function(){this.addForm({"head1":{type:"title",txt:"\u0418\u0441\u0445\u043e\u0434\u043d\u044b\u0439 \u043a\u043e\u0434"},"source":{type:"source",value:this.ne.selectedInstance.getContent(),style:{height:"300px"}},"submit":{type:"submit",value:"\u041f\u0440\u0438\u043c\u0435\u043d\u0438\u0442\u044c"},"end":{type:"end"}});},submit:function(e){var code=this.inputs["source"].value;this.ne.selectedInstance.setContent(code);this.removePane()}});nicEditors.registerPlugin(nicPlugin,nicCodeOptions);var nicPurifyOptions={buttons:{purify:{name:"\u041e\u0447\u0438\u0441\u0442\u043a\u0430 \u0442\u0435\u043a\u0441\u0442\u0430",type:"nicEditorPurifyButton"}}};var nicPurifyButton=nicEditorAdvancedButton.extend({width:"350px",addPane:function(){this.addForm({"head1":{type:"title",txt:"\u0423\u0434\u0430\u043b\u0438\u0442\u044c"},"purifymode1":{type:"radio",name:"purifymode",value:"1",info:"Íåäîïóñòèìîå ôîðìàòèðîâàíèå",checked:"checked"},"purifymode2":{type:"radio",name:"purifymode",value:"2",info:"Âñ¸ ôîðìàòèðîâàíèå"},"purifymode3":{type:"radio",name:"purifymode",value:"3",info:"Âñ¸, êðîìå òåêñòà"},"purifymode4":{type:"radio",name:"purifymode",value:"4",info:"Äîáàâèòü ïåðåíîñû ñòðîê ïîñëå ïàðàãðàôîâ"},"purifymode5":{type:"radio",name:"purifymode",value:"5",info:"Èñïðàâèòü CAPSLOCK"},"submit":{type:"submit",value:"ÎÊ"},"end":{type:"end"}});},submit:function(){var
282purifymode1=this.inputs["purifymode1"].checked,purifymode2=this.inputs["purifymode2"].checked,purifymode3=this.inputs["purifymode3"].checked,purifymode4=this.inputs["purifymode4"].checked,purifymode5=this.inputs["purifymode5"].checked,purifymode="";if(purifymode4){var selectedInstance=this.ne.selectedInstance;var selectedInstanceContent=selectedInstance.getContent();selectedInstanceContent=selectedInstanceContent.replace(/<\/p>/gi,'</p><br>');selectedInstance.setContent(selectedInstanceContent);purifymode1=true;}
283if(purifymode5){var selectedInstance=this.ne.selectedInstance;var selectedInstanceContent=selectedInstance.getContent();selectedInstanceContent=x_collection.fixcase.fix(selectedInstanceContent,true);selectedInstance.setContent(selectedInstanceContent);purifymode1=true;}
284if(purifymode1)purifymode=this.ne.options.purifyMode;if(purifymode2)purifymode="structure";if(purifymode3)purifymode="severe";this.removePane();if(purifymode!=""&&this.ne.options.purifyScript!=''){var selectedInstance=this.ne.selectedInstance;var selectedInstanceContent=selectedInstance.getContent();var beforeLength=selectedInstanceContent.length;selectedInstance.statusContain.innerHTML='<div>Îæèäàéòå...</div>';JsHttpRequest.query(this.ne.options.purifyScript,{"ajx_content":selectedInstanceContent,"ajx_mode":purifymode},function(res,err){if(res){selectedInstance.setContent(res["ajx_content"]);var eff=Math.round(100-100*res["ajx_content"].length/beforeLength);if(eff>0){selectedInstance.statusContain.innerHTML='<div>Ôîðìàòèðîâàíèå óäàëåíî. HTML-êîä ñòàë êîðî÷å íà '+Math.round(100-100*res["ajx_content"].length/beforeLength)+'%</div>';}else{selectedInstance.statusContain.innerHTML='<div>Ôîðìàòèðîâàíèå óäàëåíî.</div>';}}},true);}}});nicEditors.registerPlugin(nicPlugin,nicPurifyOptions);var nicFullscreenOptions={buttons:{fullscreen:{name:"Ðàçâåðíóòü íà âåñü ýêðàí",type:"nicEditorFullscreenButton"}}};var nicFullscreenButton=nicEditorAdvancedButton.extend({init:function(){}
284,mouseClick:function(){if(!this.ne.selectedInstance&&this.ne.nicInstances.length==1){this.ne.selectedInstance=this.ne.nicInstances[0];this.ne.selectedInstance=this.ne.nicInstances[0];}
285if(this.ne.selectedInstance){selectedInstance=this.ne.selectedInstance;if('fullscreen'in this.ne&&this.ne.fullscreen){selectedInstance.ne.nicPanel.panelContain.removeClass('panelContainFullscreen');selectedInstance.editorContain.removeClass('editorContainFullscreen');selectedInstance.editorContain.style['max-height']=this.ne.options.maxHeight?this.ne.options.maxHeight+'px':null;selectedInstance.elm.style['min-height']=selectedInstance.elm.getAttribute('data-min-height');document.body.style.overflow='visible';var icon=this.ne.options.iconList['fullscreen'];this.button.style.backgroundPosition=(icon?(icon-1)*-24:0)+"px 0";this.button.setAttribute('title','Ðàçâåðíóòü íà âåñü ýêðàí');this.ne.fireEvent('windowed',this);this.ne.fullscreen=false;}else{selectedInstance.ne.nicPanel.panelContain.addClass('panelContainFullscreen');selectedInstance.editorContain.addClass('editorContainFullscreen');selectedInstance.editorContain.style['max-height']=null;selectedInstance.elm.setAttribute('data-min-height',selectedInstance.elm.style['min-height']);selectedInstance.elm.style['min-height']='100%';document.body.style.overflow='hidden';var icon=this.ne.options.iconList['windowed'];this.button.style.backgroundPosition=(icon?(icon-1)*-24:0)+"px 0";this.button.setAttribute('title','Ñâåðíóòü');this.ne.fireEvent('fullscreen',this);this.ne.fullscreen=true;}}}});nicEditors.registerPlugin(nicPlugin,nicPurifyOptions);function pasteHtmlAtCaret(html,selectPastedContent){var sel,range;if(window.getSelection){sel=window.getSelection();if(sel.getRangeAt&&sel.rangeCount){range=sel.getRangeAt(0);range.deleteContents();var el=document.createElement("div");el.innerHTML=html;var frag=document.createDocumentFragment(),node,lastNode;while((node=el.firstChild)){lastNode=frag.appendChild(node);}
286var firstNode=frag.firstChild;range.insertNode(frag);if(lastNode){range=range.cloneRange();range.setStartAfter(lastNode);if(selectPastedContent){range.setStartBefore(firstNode);}else{range.collapse(true);}
287sel.removeAllRanges();sel.addRange(range);}}}else if((sel=document.selection)&&sel.type!="Control"){var originalRange=sel.createRange();originalRange.collapse(true);sel.createRange().pasteHTML(html);if(selectPastedContent){range=sel.createRange();range.setEndPoint("StartToStart",originalRange);range.select();}}}
288function Ad_list(o){var self=this;self.container=o.container;self.o={namespace:o.namespace||"",act:o.act||"",ad_id:o.ad_id||0,offset:o.offset||0};return self}Ad_list.prototype.ajx_o=function(){var self=this;return{ajx_namespace:self.o.namespace,ajx_act:self.o.act,ajx_ad_id:self.o.ad_id,ajx_offset:self.o.offset}};Ad_list.prototype.output=function(){var self=this;self.o.act="output";self.container.stop(true,true).fadeTo(200,.1,function(){JsHttpRequest.query(x_ajax_path+"ajax/ad/list",self.ajx_o(),function(res,err){if(res)self.container.stop(true,true).html(res["ajx_ad_list"]).fadeTo(200,1)},true)})};Ad_list.prototype.offset=function(offset){var self=this;self.o.offset=offset;self.output()};Ad_list.prototype.act=function(act,ad_id){var self=this;switch(act){case"hide":case"show":case"remove":case"start":case"stop":self.o.ad_id=ad_id;self.o.act=act;self.container.stop(true,true).fadeTo(200,.1,function(){JsHttpRequest.query(x_ajax_path+"ajax/ad/list",self.ajx_o(),function(res,err){if(res)self.container.stop(true,true).html(res["ajx_ad_list"]).fadeTo(200,1)},true)});break}};function inni_controller(){var self=this;self.is_sticky=false;self.$inni_top=$('#w .inni_top');self.$inni_side=$('#s .inni_side');self.$super_sticky=self.$inni_side.find('.inni_side_super_sticky');self.inni_top_live=false;self.inni_side_live_240x400=false;self.inni_side_live_300x500=false;self.ww=0;self.eventname='.inni_controller';return self;}
289inni_controller.prototype.start=function(){var self=this;self.ww=$(window).outerWidth();self.st=0;if(self.ww>=1280){self.$inni_top.hide();self.start_side_300x500();}else if(self.ww>=1024){self.$inni_top.hide();self.start_side_240x400();}else if(self.ww>=640){self.$inni_top.hide();}else{self.start_top();}
290$(window).on('scroll'+self.eventname,function(){self.sticky();});$(window).on('resize'+self.eventname,function(){self.sticky();});};inni_controller.prototype.start_top=function(){var self=this;self.inni_top_live=true;$.getScript('js/R-A-176848-5.js');};inni_controller.prototype.start_side_240x400=function(){var self=this;self.inni_side_live_240x400=true;if($('#data-ad-slot-5176517590').length){$('#data-ad-slot-5176517590').load('js/data-ad-slot-5176517590.html');}
291$.getScript('js/R-A-176848-99.js');$.getScript('js/R-A-176848-9.js');};inni_controller.prototype.start_side_300x500=function(){var self=this;self.inni_side_live_300x500=true;if($('#data-ad-slot-3422304993').length){$('#data-ad-slot-3422304993').load('js/data-ad-slot-3422304993.html');}
292$.getScript('js/R-A-176848-88.js');$.getScript('js/R-A-176848-8.js');};inni_controller.prototype.sticky=function(){var self=this;var ww=$(window).outerWidth();if(ww>=1280&&self.ww<1280){if(!self.inni_side_300x500_live)self.start_side_300x500();self.$inni_top.hide();}else if((ww>=1024&&self.ww<1024)||(ww<1280&&self.ww>=1280)){if(!self.inni_side_240x400_live)self.start_side_240x400();self.$inni_top.hide();}else if(ww<640&&self.ww>=640){if(!self.inni_top_live)self.start_top();self.$inni_top.show();}else if((ww>=640&&self.ww<600)||(ww<1024&&self.ww>=1024)){self.$inni_top.hide();}
293self.ww=ww;if(self.ww>=1024){var dh=$(document).height();var fh=$('#f').height();var ot=self.$super_sticky.parent('div').offset().top;var ssh=self.$super_sticky.height();var st=$(window).scrollTop();var th=32+$('#t').outerHeight();var wh=$(window).height();var ch=$('#c').height();if(ssh+50<ch){if(!self.is_sticky){var ot=self.$super_sticky.parent('div').offset().top;self.$super_sticky.css({'margin-top':ot+'px','position':'fixed','top':0});self.is_sticky=true;}}else{if(self.is_sticky){self.$super_sticky.css({'margin':0,'position':'relative','top':0});self.is_sticky=false;}}
294if(self.is_sticky){if(st>self.st){if(st>=ssh-wh+ot){if(st+wh>=dh-fh){var t=dh-st-ssh-fh-ot;}else{var t=wh-ssh-ot;t=(3*parseInt(self.$super_sticky.css('top'),10)+t)/4;}}else{var t=-1*st;}
295self.st=st;self.$super_sticky.css({'top':t+'px'});}else if(st<self.st){if(dh-st>=ssh+th+fh){if(st<ot-th){var t=-st;}else{var t=th-ot;t=(3*parseInt(self.$super_sticky.css('top'),10)+t)/4;}}else{var t=dh-st-ssh-fh-ot;}
296self.st=st;self.$super_sticky.css({'top':t+'px'});}}}else if(self.ww>639){}}
297function Audio_list(o){var self=this;self.container=o.container;self.o={namespace:o.namespace||"",act:o.act||"",audio_id:o.audio_id||0,offset:o.offset||0,select_mode:o.select_mode||0};if(self.container){self.ul=self.container.find("ul");self.p=$("<p></p>").appendTo(self.container)}return self}
298Audio_list.prototype.more=function(){var self=this;self.p.html(x_ajax_loader);self.container.find("li.x").removeClass("x");JsHttpRequest.query(x_ajax_path+"ajax/adm/audio/list/",{ajx_namespace:self.o.namespace,ajx_act:"more",ajx_offset:self.o.offset,ajx_select_mode:self.o.select_mode},function(res,err){if(res){self.p.html(res["ajx_audio_more"]);self.ul.append(res["ajx_audio_list"]);self.o.offset++}},true)};Audio_list.prototype.hide=function(audio_id){var self=this;self.o.audio_id=audio_id||self.o.audio_id;var $item=$("#audio-list"+(self.o.namespace!=""?"-"+self.o.namespace:"")+"-item-"+self.o.audio_id);$item.fadeTo(200,0.5,function(){if(confirm(txt_uvereny))JsHttpRequest.query(x_ajax_path+"ajax/adm/audio/item",{ajx_namespace:self.o.namespace,ajx_act:"hide",ajx_audio_id:self.o.audio_id,ajx_select_mode:self.o.select_mode},function(res,err){if(res)$item.html(res["ajx_audio_item"])},true);else $item.fadeTo(200,1)})};Audio_list.prototype.show=function(audio_id){var self=this;self.o.audio_id=audio_id||self.o.audio_id;var $item=$("#audio-list"+(self.o.namespace!=""?"-"+self.o.namespace:"")+"-item-"+self.o.audio_id);$item.fadeTo(200,1,function(){if(confirm(txt_uvereny))JsHttpRequest.query(x_ajax_path+"ajax/adm/audio/item",{ajx_namespace:self.o.namespace,ajx_act:"show",ajx_audio_id:self.o.audio_id,ajx_select_mode:self.o.select_mode},function(res,err){if(res)$item.html(res["ajx_audio_item"])},true);else $item.fadeTo(200,0.5)})};Audio_list.prototype.rename=function(audio_id){var self=this;self.o.audio_id=audio_id||self.o.audio_id;self.loader(self.o.audio_id);JsHttpRequest.query(x_ajax_path+"ajax/adm/audio/item",{ajx_namespace:self.o.namespace,ajx_act:"rename",ajx_audio_id:self.o.audio_id,ajx_select_mode:self.o.select_mode},function(res,err){if(res)$("#audio-list"+(self.o.namespace!=""?"-"+self.o.namespace:"")+"-item-"+self.o.audio_id).html(res["ajx_audio_item"])},true)};Audio_list.prototype.save=function(audio_id){var self=this;self.o.audio_id=audio_id||self.o.audio_id;self.loader(self.o.audio_id);var $item=$("#audio-list"+(self.o.namespace!=""?"-"+self.o.namespace:"")+"-item-"+self.o.audio_id),composer=$item.find('input[name="f_composer"]').val(),name=$item.find('input[name="f_name"]').val(),artist=$item.find('input[name="f_artist"]').val();JsHttpRequest.query(x_ajax_path+"ajax/adm/audio/item",{ajx_namespace:self.o.namespace,ajx_act:"save",ajx_audio_id:self.o.audio_id,ajx_select_mode:self.o.select_mode,ajx_title_composer:composer,ajx_title_name:name,ajx_title_artist:artist},function(res,err){if(res)$item.html(res["ajx_audio_item"])},true)};Audio_list.prototype.revert=function(audio_id){var self=this;self.o.audio_id=audio_id||self.o.audio_id;self.loader(self.o.audio_id);var $item=$("#audio-list"+(self.o.namespace!=""?"-"+self.o.namespace:"")+"-item-"+self.o.audio_id);JsHttpRequest.query(x_ajax_path+"ajax/adm/audio/item",{ajx_namespace:self.o.namespace,ajx_act:"start",ajx_audio_id:self.o.audio_id,ajx_select_mode:self.o.select_mode},function(res,err){if(res)$item.html(res["ajx_audio_item"])},true)};Audio_list.prototype.upload=function(file){var self=this;self.ul.prepend('<li class="load"></li>');JsHttpRequest.query(x_ajax_path+"ajax/adm/audio/list/",{ajx_namespace:self.o.namespace,ajx_act:"upload",ajx_select_mode:self.o.select_mode,ajx_file:file},function(res,err){if(res)if(res["ajx_audio_upload_error"].length>0){self.ul.find(".upload").remove();alert(res["ajx_audio_upload_error"]);self.ul.empty();self.o.offset=0;self.more()}else{self.ul.empty();switch(self.o.select_mode){case 0:self.ul.html(res["ajx_audio_list"]);self.o.offset=1;self.more();break}}},true)};Audio_list.prototype.target=function(target){this.target=target};Audio_list.prototype.loader=function(audio_id){var self=this;if(audio_id!=0)$("#audio-list"+(self.o.namespace!=""?"-"+self.o.namespace:"")+"-service-"+audio_id).prepend(x_ajax_loader)};function File_list(o){var self=this;self.container=o.container;self.o={namespace:o.namespace||"",act:o.act||"",file_id:o.file_id||0,offset:o.offset||0,select_mode:o.select_mode||0};if(self.container){self.ul=self.container.find("ul");self.p=$("<p></p>").appendTo(self.container)}return self}
299File_list.prototype.more=function(){var self=this;self.p.html(x_ajax_loader);self.container.find("li.x").removeClass("x");JsHttpRequest.query(x_ajax_path+"ajax/adm/file/list/",{ajx_namespace:self.o.namespace,ajx_act:"more",ajx_offset:self.o.offset,ajx_select_mode:self.o.select_mode},function(res,err){if(res){self.p.html(res["ajx_file_more"]);self.ul.append(res["ajx_file_list"]);self.o.offset++}},true)};File_list.prototype.hide=function(file_id){var self=this;self.o.file_id=file_id||self.o.file_id;var $item=$("#file-list"+(self.o.namespace!=""?"-"+self.o.namespace:"")+"-item-"+self.o.file_id);$item.fadeTo(200,0.5,function(){if(confirm(txt_uvereny))JsHttpRequest.query(x_ajax_path+"ajax/adm/file/item/",{ajx_namespace:self.o.namespace,ajx_act:"hide",ajx_file_id:self.o.file_id,ajx_select_mode:self.o.select_mode},function(res,err){if(res)$item.html(res["ajx_file_item"])},true);else $item.fadeTo(200,1)})};File_list.prototype.show=function(file_id){var self=this;self.o.file_id=file_id||self.o.file_id;var $item=$("#file-list"+(self.o.namespace!=""?"-"+self.o.namespace:"")+"-item-"+self.o.file_id);$item.fadeTo(200,1,function(){if(confirm(txt_uvereny))JsHttpRequest.query(x_ajax_path+"ajax/adm/file/item/",{ajx_namespace:self.o.namespace,ajx_act:"show",ajx_file_id:self.o.file_id,ajx_select_mode:self.o.select_mode},function(res,err){if(res)$item.html(res["ajx_file_item"])},true);else $item.fadeTo(200,0.5)})};File_list.prototype.rename=function(file_id){var self=this;self.o.file_id=file_id||self.o.file_id;self.loader(self.o.file_id);JsHttpRequest.query(x_ajax_path+"ajax/adm/file/item/",{ajx_namespace:self.o.namespace,ajx_act:"rename",ajx_file_id:self.o.file_id,ajx_select_mode:self.o.select_mode},function(res,err){if(res)$("#file-list"+(self.o.namespace!=""?"-"+self.o.namespace:"")+"-item-"+self.o.file_id).html(res["ajx_file_item"])},true)};File_list.prototype.save=function(file_id){var self=this;self.o.file_id=file_id||self.o.file_id;self.loader(self.o.file_id);var $item=$("#file-list"+(self.o.namespace!=""?"-"+self.o.namespace:"")+"-item-"+self.o.file_id),title=$item.find('input[name="f_file_rename"]').val(),description=$item.find('input[name="f_file_description"]').val();JsHttpRequest.query(x_ajax_path+"ajax/adm/file/item/",{ajx_namespace:self.o.namespace,ajx_act:"save",ajx_file_id:self.o.file_id,ajx_select_mode:self.o.select_mode,ajx_title:title,ajx_description:description},function(res,err){if(res)$item.html(res["ajx_file_item"])},true)};File_list.prototype.revert=function(file_id){var self=this;self.o.file_id=file_id||self.o.file_id;self.loader(self.o.file_id);var $item=$("#file-list"+(self.o.namespace!=""?"-"+self.o.namespace:"")+"-item-"+self.o.file_id);JsHttpRequest.query(x_ajax_path+"ajax/adm/file/item/",{ajx_namespace:self.o.namespace,ajx_act:"start",ajx_file_id:self.o.file_id,ajx_select_mode:self.o.select_mode},function(res,err){if(res)$item.html(res["ajx_file_item"])},true)};File_list.prototype.upload=function(file){var self=this;self.ul.prepend('<li class="load"></li>');JsHttpRequest.query(x_ajax_path+"ajax/adm/file/list/",{ajx_namespace:self.o.namespace,ajx_act:"upload",ajx_select_mode:self.o.select_mode,ajx_file:file},function(res,err){if(res)if(res["ajx_file_upload_error"].length>0){self.ul.find(".upload").remove();alert(res["ajx_file_upload_error"]);self.ul.empty();self.o.offset=0;self.more()}else{self.ul.empty();switch(self.o.select_mode){case 0:self.ul.html(res["ajx_file_list"]);self.o.offset=1;self.more();break;case 1:$("#f-media").filelist("add",res["ajx_file_upload_id"],res["ajx_file_upload_title"],res["ajx_file_upload_description"]);self.ul.html(res["ajx_file_list"]);self.o.offset=1;self.more();break}}},true)};File_list.prototype.target=function(target){this.target=target};File_list.prototype.loader=function(file_id){var self=this;if(file_id!=0)$("#file-list"+(self.o.namespace!=""?"-"+self.o.namespace:"")+"-service-"+file_id).prepend(x_ajax_loader)};function Image_list(o){var self=this;self.container=o.container;self.o={namespace:o.namespace||"",act:o.act||"",image_id:o.image_id||0,mode:o.mode||0,offset:o.offset||""};if(self.container){self.ul=self.container.find("ul");$("<br>").addClass("cb").appendTo(self.container);self.p=$("<p></p>").appendTo(self.container)}return self}
300Image_list.prototype.more=function(){var self=this;self.p.html(x_ajax_loader);self.container.find("li.x").removeClass("x");JsHttpRequest.query(x_ajax_path+"ajax/adm/image/list/",{ajx_namespace:self.o.namespace,ajx_act:"more",ajx_mode:self.o.mode,ajx_offset:self.o.offset},function(res,err){if(res){self.p.html(res["ajx_image_more"]);self.ul.append(res["ajx_image_list"]);self.o.offset++}},true)};Image_list.prototype.upload=function(file){var self=this;self.ul.prepend('<li class="upload"></li>');JsHttpRequest.query(x_ajax_path+"ajax/adm/image/list/",{ajx_namespace:self.o.namespace,ajx_act:"upload",ajx_mode:self.o.mode,ajx_file:file},function(res,err){if(res){if(res["ajx_image_upload_error"].length>0)alert(res["ajx_image_upload_error"]);if(res["ajx_image_upload_list"].length==0)self.ul.find(".upload").remove();else{self.ul.empty();switch(self.o.mode){case 0:self.ul.html(res["ajx_image_list"]);self.o.offset=1;self.more();break;case 2:if(self.target)self.target.set(res["ajx_image_upload_list"].join(","));self.ul.html(res["ajx_image_list"
300]);self.o.offset=1;self.more();break}}}},true)};Image_list.prototype.target=function(target){this.target=target};function do_mail(act,ofst){if(act=='output'){$('#mail-list').fadeTo(200,.1);JsHttpRequest.query(x_ajax_path+'ajax/adm/mail/list/',{'ajx_act':act,'ajx_ofst':ofst},function(res,err){if(res){$('#mail-list').stop().html(res['ajx_mail_list']).fadeTo(200,1);}},true);}}
301function Billing_order_list(o){var self=this;self.container=o.container;self.o={namespace:o.namespace||"",act:o.act||"",offset:o.offset||0};return self}Billing_order_list.prototype.ajx_o=function(){var self=this;return{ajx_namespace:self.o.namespace,ajx_act:self.o.act,ajx_offset:self.o.offset}};Billing_order_list.prototype.output=function(){var self=this;self.o.act="output";self.container.stop(true,true).fadeTo(200,.1,function(){JsHttpRequest.query(x_ajax_path+"ajax/billing/order/list",self.ajx_o(),function(res,err){if(res)self.container.stop(true,true).html(res["ajx_billing_order_list"]).fadeTo(200,1)},true)})};Billing_order_list.prototype.offset=function(offset){var self=this;self.o.offset=offset;self.output()};function Billing_payment_list(o){var self=this;self.container=o.container;self.o={namespace:o.namespace||"",act:o.act||"",offset:o.offset||0};return self}Billing_payment_list.prototype.ajx_o=function(){var self=this;return{ajx_namespace:self.o.namespace,ajx_act:self.o.act,ajx_offset:self.o.offset}};Billing_payment_list.prototype.output=function(){var self=this;self.o.act="output";self.container.stop(true,true).fadeTo(200,.1,function(){JsHttpRequest.query(x_ajax_path+"ajax/billing/payment/list",self.ajx_o(),function(res,err){if(res)self.container.stop(true,true).html(res["ajx_billing_payment_list"]).fadeTo(200,1)},true)})};Billing_payment_list.prototype.offset=function(offset){var self=this;self.o.offset=offset;self.output()};function Line_list(o){var self=this;self.container=o.container;self.o={namespace:(o.namespace||''),act:(o.act||''),line_id:(o.line_id||0),group_id:(o.group_id||0),type_id:(o.type_id||0),user_id:(o.user_id||0),area_id:(o.area_id||0),is_period:(o.is_period||false),date_start:(o.date_start||0),date_stop:(o.date_stop||0),tag:(o.tag||''),is_recent:(o.is_recent||false),is_redirect:(o.is_redirect||false),is_short:(o.is_short||false),is_static:(o.is_static||false),offset:(o.offset||0),area_id_end:(o.area_id_end||0)}
302self.autoload=o.autoload===undefined?false:o.autoload;self.analytics_group=o.analytics_group===undefined?0:o.analytics_group;self.is_clear=true;self.more_initial_call=true;if(self.autoload)self.live_autoload();self.job_init();self.note_init();self.product_init();return this;}
303Line_list.prototype.ajx_o=function(){var self=this;return{ajx_namespace:self.o.namespace,ajx_act:self.o.act,ajx_line_id:self.o.line_id,ajx_group_id:self.o.group_id,ajx_type_id:self.o.type_id,ajx_user_id:self.o.user_id,ajx_area_id:self.o.area_id,ajx_is_period:self.o.is_period,ajx_date_start:self.o.date_start,ajx_date_stop:self.o.date_stop,ajx_tag:self.o.tag,ajx_is_recent:self.o.is_recent,ajx_is_redirect:self.o.is_redirect,ajx_is_short:self.o.is_short,ajx_is_static:self.o.is_static,ajx_offset:self.o.offset,ajx_area_id_end:self.o.area_id_end}};Line_list.prototype.output=function(){var self=this;if(self.is_clear){self.is_clear=false;self.o.act="output";self.container.stop(true,true).fadeTo(200,0.1,function(){JsHttpRequest.query(x_ajax_path+"ajax/line/list",self.ajx_o(),function(res,err){if(res){self.container.stop(true,true).html(res['ajx_line_list']).fadeTo(200,1);self.o.area_id_end=res["ajx_area_id_end"];self.live();self.is_clear=true;}},true);});}};Line_list.prototype.start=function(){var self=this;if(self.is_clear){self.is_clear=false;self.o.offset=0;self.o.area_id_end=0;self.o.act="start";self.container.stop(true,true).fadeTo(200,0.1,function(){JsHttpRequest.query(x_ajax_path+"ajax/line/list",self.ajx_o(),function(res,err){if(res){self.more_initial_call=false;self.o.offset=1;self.container.empty();self.div_more=$("<div></div>").addClass("more").html(res["ajx_line_more"]).appendTo(self.container);$('<p class="cb"></p>').appendTo(self.container);self.div_more.before(res["ajx_line_list"]);self.o.area_id_end=res["ajx_area_id_end"];self.container.stop(true,true).fadeTo(200,1);self.live();self.is_clear=true;}},true);});}};Line_list.prototype.more=function(){var self=this;x_analytics('line_'+self.o.group_id+'_more');
303if(self.is_clear){self.is_clear=false;if(!self.more_initial_call){self.div_more.find('a').text('Çàãðóçêà...');(function(w,d,n,s,t){w[n]=w[n]||[];w[n].push(function(){Ya.Context.AdvManager.render({blockId:"R-A-176848-10",renderTo:"yandex_rtb_R-A-176848-10-"+(self.o.offset-1),pageNumber:(self.o.offset-1),async:true});});t=d.getElementsByTagName("script")[0];s=d.createElement("script");s.type="text/javascript";s.src="//an.yandex.ru/system/context.js";s.async=true;t.parentNode.insertBefore(s,t);})(window,window.document,"yandexContextAsyncCallbacks");}
304setTimeout(function(){self.o.act="more";if(!self.more_initial_call){self.container.children(".x").removeClass("x");self.o.offset=self.o.offset+1;}
305JsHttpRequest.query(x_ajax_path+'ajax/line/list',self.ajx_o(),function(res,err){if(res){if(self.more_initial_call){self.more_initial_call=false;self.container.find('ul.line_pages').remove();self.div_more=$("<div></div>").addClass("more").html(res["ajx_line_more"]).appendTo(self.container);$("<p></p>").addClass("cb").appendTo(self.container);}else{self.div_more.html(res["ajx_line_more"]);}
306self.div_more.before(res["ajx_line_list"]);self.o.area_id_end=res["ajx_area_id_end"];self.live();clearTimeout(self.timer_scroll);self.timer_scroll=setTimeout(function(){self.is_clear=true;},200);}},true);},1000);}}
307Line_list.prototype.offset=function(offset){var self=this;self.o.offset=offset;self.output();$("body, html").animate({scrollTop:(self.container.offset().top-80)+'px'},600);};Line_list.prototype.tag=function(tag){var self=this;self.o.is_period=false;self.o.tag=tag;self.offset=0;self.start();}
308Line_list.prototype.period=function(date_start,date_stop){var self=this;self.o.tag='';self.o.is_period=true;self.o.date_start=date_start;self.o.date_stop=date_stop;self.offset=0;self.start();};Line_list.prototype.hide=function(line_id){var self=this;if(self.is_clear){self.is_clear=false;var $item=self.container.find('#line-'+line_id);self.o.act="hide";self.o.line_id=line_id;$item.fadeTo(200,0.5,function(){if(confirm(txt_uvereny)){$('#line-service-'+line_id).html(x_ajax_loader+'<p class="cb"></p>');JsHttpRequest.query(x_ajax_path+'ajax/line/item',self.ajx_o(),function(res,err){if(res){$item.find('#line-service-'+line_id).html(res.ajx_line_item_service);self.is_clear=true;}},true);}else{$item.stop(true,true).fadeTo(200,1);self.is_clear=true;}});}}
309Line_list.prototype.show=function(line_id){var self=this;if(self.is_clear){self.is_clear=false;var $item=self.container.find('#line-'+line_id);self.o.act="show";self.o.line_id=line_id;$item.fadeTo(200,1,function(){if(confirm(txt_uvereny)){$('#line-service-'+line_id).html(x_ajax_loader+'<p class="cb"></p>');JsHttpRequest.query(x_ajax_path+'ajax/line/item',self.ajx_o(),function(res,err){if(res){$item.find('#line-service-'+line_id).html(res.ajx_line_item_service);self.is_clear=true;}},true);}else{$item.stop(true,true).fadeTo(200,0.5);self.is_clear=true;}});}}
310Line_list.prototype.remove=function(line_id){var self=this,$item=self.container.find('#line-'+line_id);self.o.act="remove";self.o.line_id=line_id;$item.fadeTo(200,0.2,function(){if(confirm(txt_uvereny)){$('#line-service-'+line_id).html(x_ajax_loader+'<p class="cb"></p>');JsHttpRequest.query(x_ajax_path+'ajax/line/item',self.ajx_o(),function(res,err){if(res){$item.stop(true,true).slideUp(200);}},true);}else{$item.stop(true,true).fadeTo(200,0.5);}});}
311Line_list.prototype.up=function(line_id){var self=this;if(self.is_clear){self.is_clear=false;var $item=self.container.find("#line-"+line_id);self.o.act="up";self.o.line_id=line_id;JsHttpRequest.query(x_ajax_path+'ajax/line/item',self.ajx_o(),function(res,err){if(res){}},true);$item.fadeTo(300,.5,function(){$('html,body').scrollTop(0);$item.detach().prependTo(self.container).fadeTo(300,1);});}};Line_list.prototype.tag_edit=function(line_id){var self=this;if(self.is_clear){self.is_clear=false;var $item=self.container.find('#line-'+line_id);self.o.act="edit";self.o.line_id=line_id;JsHttpRequest.query(x_ajax_path+'ajax/line/tag',self.ajx_o(),function(res,err){if(res){x_collection.popup.open({element:$item,content:res.ajx_line_item,my:'center',at:'center',of:$(window),action:'manual',delay:100,effect:'fade',duration:250,active_element_class:'',hide_before_show:true,modal:true});var $info=x_collection.popup.popup.find('.iform_info'),$select=x_collection.popup.popup.find('select[name="f_tag_list[]"]'),$apply=x_collection.popup.popup.find('input[name="f_btn_apply"]'),$cancel=x_collection.popup.popup.find('input[name="f_btn_cancel"]');$info.x_tag_suggestion({});$info.on('click',function(event){var $target=$(event.target);if($target.is('a')){$select.x_select_filter('add_value',$target.data('tag-id'),$target.text());}});$select.x_select_filter({zindex:20,change:function(){$info.x_tag_suggestion('set_tag',$select.val());}});$apply.on('click',function(){self.tag_store(line_id);});$cancel.on('click',function(){x_collection.popup.close();});self.is_clear=true;}},true);}}
312Line_list.prototype.tab_click=function(event,line_id){var self=this;var $target=$(event.target);if($target.is('a')){$target.closest('ul').find('li').removeClass('line_tab_handlers_active');$target.closest('li').addClass('line_tab_handlers_active');$target.closest('div.line_tab').find('div.line_tab_container').hide();switch($target.data('action')){case'message':var $container=$target.closest('div.line_tab').find('div.line_tab_container[data-content=message]');
312if(!$container.hasClass('live')){$container.addClass('live');var $div=$container.find('div.message_list');x_collection['message_public_list_line'+line_id]=new Message_public_list({container:$div,namespace:'line'+line_id,recipient_user_id:$target.data('message-recipient-user-id')||0,recipient_site_id:$target.data('message-recipient-site-id')||0,recipient_email_name:$target.data('message-recipient-email-name')||0,secret:$target.data('message-secret')||'',obj_id:$target.data('message-obj-id')||0,obj_type:$target.data('message-obj-type')||''});x_collection['message_public_list_line'+line_id].output();}
313$container.show();break;case'site':var $container=$target.closest('div.line_tab').find('div.line_tab_container[data-content=site]');if(!$container.hasClass('live')){JsHttpRequest.query(x_ajax_path+'ajax/site/about',{ajx_namespace:self.o.namespace,ajx_site_id:$target.data('site-id')||0},function(res,err){if(res){$container.html(res.ajx_html);$container.addClass('live');}},true);}
314$container.show();break;case'share':var $container=$target.closest('div.line_tab').find('div.line_tab_container[data-content=share]');if(!$container.hasClass('live')){$container.addClass('live');var $div=$('<div></div>').addClass('shr').appendTo($container);var url='//inni.info/~'+parseInt(line_id).toString(16);$div.html('<ul>'+'<li><a href="'+url+'/vk" target="_blank"><i class="shr_vk"></i><u>Âêîíòàêòå</u></a></li>'+'<li><a href="'+url+'/fb" target="_blank"><i class="shr_fb"></i><u>Facebook</u></a></li>'+'<li><a href="'+url+'/t" target="_blank"><i class="shr_t"></i><u>twitter</u></a></li>'+'<li><a href="'+url+'/mru" target="_blank"><i class="shr_mru"></i><u>Ìîé Ìèð</u></a></li>'+'<li><a href="'+url+'/lj" target="_blank"><i class="shr_lj"></i><u>Livejournal</u></a></li>'+'<li><a href="'+url+'" target="_blank"><i class="shr_lnk"></i></a><input type="text" value="https:'+url+'" readonly></li>'+'</ul>');}
315$container.show();break;case'stat':var $container=$target.closest('div.line_tab').find('div.line_tab_container[data-content=stat]');if(!$container.hasClass('live')){JsHttpRequest.query(x_ajax_path+'ajax/line/stat',{ajx_namespace:self.o.namespace,ajx_line_id:line_id},function(res,err){if(res){if(res.ajx_data.series[0].length>3){$container.wrapInner('<div style="text-align:right"></div>');$('<div class="ct-chart ct-octave"></div>').appendTo($container);var options={chartPadding:{bottom:0,left:0,right:0,top:20},onlyInteger:true,showArea:true,axisY:{low:0}};var responsiveOptions=[['screen and (min-width: 1280px)',{axisX:{labelInterpolationFnc:function(value,index){if(!value)return'';var date=new Date(value*1000);var months=['ÿíâ','ôåâ','ìàð','àïð','ìàé','èþí','èþë','àâã','ñåí','îêò','íîÿ','äåê'];return months[date.getMonth()];}}}],['screen and (max-width:1279px)',{axisX:{labelInterpolationFnc:function(value,index){if(!value)return'';var date=new Date(value*1000);var months=['ÿ','ô','ì','à','ì','è','è','à','ñ','î','í','ä'];return months[date.getMonth()];}}}]];new Chartist.Line('#line-'+line_id+' .ct-chart',res.ajx_data,options,responsiveOptions);}
316$container.addClass('live');}},true);}
317$container.show();break;default:location.href=$target.attr('href');}}}
318Line_list.prototype.tag_store=function(line_id){var self=this;if(self.is_clear){self.is_clear=false;var $item=self.container.find('#line-'+line_id),tag_list=x_collection.popup.popup.find('select[name="f_tag_list[]"]').val(),tag_added=x_collection.popup.popup.find('input[name="f_tag"]').val();self.o.act="store";self.o.line_id=line_id;var obj=self.ajx_o();obj['ajx_tag_list']=tag_list;obj['ajx_tag_added']=tag_added;$('#line-service-'+line_id).html(x_ajax_loader+'<p class="cb"></p>');JsHttpRequest.query(x_ajax_path+'ajax/line/tag',obj,function(res,err){if(res){$item.html(res.ajx_line_item);self.live_item($item);x_collection.popup.close();self.is_clear=true;}},true);}}
319Line_list.prototype.live=function(){var self=this;self.live_tag_description();self.container.children('div').each(function(){var $item=$(this);if(!$item.hasClass('live')&&!$item.hasClass('x')){self.live_item($item);}});}
320Line_list.prototype.live_item=function($item){var self=this;if($item.hasClass('line')){if($item.hasClass('line_job'))self.job_live($item);if($item.hasClass('line_note'))self.note_live($item);if($item.hasClass('line_product'))self.product_live($item);}else{var $item_children=$item.children('.line');if($item_children.length){if($item_children.hasClass('line_job'))self.job_live($item);if($item_children.hasClass('line_note'))self.note_live($item);if($item_children.hasClass('line_product'))self.product_live($item);}}}
321Line_list.prototype.live_autoload=function(){var self=this;var w=$(window);w.on('scroll',function(){if(self.autoload){if(($(document).height()-w.height()-w.scrollTop())<300){x_analytics('line_'+self.o.group_id+'_more_auto');self.more();}}});}
322Line_list.prototype.live_alphabet=function(){var self=this;$alphabet=self.container.children('.alphabet');if($alphabet.length&&!$alphabet.hasClass('live')){$alphabet.addClass('live').on('click',function(event){var $target=$(event.target),$a=$target.closest('a');
322if($a.length&&$a.data('search')!==undefined){event.preventDefault();x_collection['search_suggestion'].set_search($a.data('search'));}});}}
323Line_list.prototype.live_tag_description=function(){var self=this;setTimeout(function(){$tag_description=self.container.children('.line_tag_description');if($tag_description.length&&!$tag_description.hasClass('live')){$tag_description.addClass('live');$tag_description_container=$tag_description.find('.line_tag_description_container');if($tag_description_container.children('div').height()>$tag_description_container.height()){$tag_description.find('.line_read').show();$tag_description.find('.line_read a').addClass('live').on('click',function(event){event.preventDefault();$tag_description.find('.line_read').hide();$tag_description_container.css({'max-height':'none','opacity':.1}).fadeTo(200,1);});}else{$tag_description.find('.line_read').hide();}}},200);}
324Line_list.prototype.job_init=function(){var self=this;};Line_list.prototype.job_read=function(line_id){var self=this;if(self.is_clear){self.is_clear=false;var $item=self.container.find("#line-"+line_id);$item.find(".line_read").html(x_ajax_loader);self.o.act="output";self.o.line_id=line_id;self.o.is_short=false;JsHttpRequest.query(x_ajax_path+"ajax/line/item",self.ajx_o(),function(res,err){if(res){$item.html(res.ajx_line_item);self.job_live($item);self.is_clear=true}},true)}};Line_list.prototype.job_live=function($item){var self=this,line_id=$item.attr("id");if(line_id!==undefined)if(line_id.substring(0,4)=="line"){line_id=line_id.substring(5);$item.addClass("live");$item.find("h2 a").addClass("live").on("click",function(event){event.preventDefault()});$item.find("p.line_read a").addClass("live").on("click",function(event){event.preventDefault();self.job_read(line_id)});$item.find("div.line_tab a").addClass("live").on("click",function(event){event.preventDefault();self.tab_click(event,line_id)});if(self.o.tag!="")$item.highlight(self.o.tag)}};Line_list.prototype.note_init=function(){var self=this};Line_list.prototype.note_read=function(line_id){var self=this;x_analytics("line_5_read");if(self.is_clear){self.is_clear=false;var $item=self.container.find("#line-"+line_id);$item.find(".line_read").html(x_ajax_loader);self.o.act="output";self.o.line_id=line_id;self.o.is_short=false;JsHttpRequest.query(x_ajax_path+"ajax/line/item",self.ajx_o(),function(res,err){if(res){$item.html(res.ajx_line_item);self.note_live($item);self.is_clear=true}},true)}};Line_list.prototype.note_live=function($item){var self=this,line_id=$item.attr("id");if(line_id!==undefined)if(line_id.substring(0,4)=="line"){if(!$item.hasClass("x"))$item.find("img").unveil();line_id=line_id.substring(5);$item.addClass("live");$item.find("h2 a").addClass("live").on("click",function(event){event.preventDefault()});$item.find("p.line_read a").addClass("live").on("click",function(event){event.preventDefault();self.note_read(line_id)});$item.find("div.line_tab a").addClass("live").on("click",function(event){event.preventDefault();self.tab_click(event,line_id)});if(self.o.tag!="")$item.highlight(self.o.tag)}};function Note_parser(o){var self=this;self.container=o.container;self.structure=o.structure;self.site_id=o.site_id;self.callback=o.callback;self.step=0;self.html='';self.url='';self.add_info={};self.md5hash='';self.result={'title':'','date':'','text':'','random_site_id':0};self.charset='auto';return self;}
325Note_parser.prototype.init=function(){var self=this;var $div,$row,$cell,i;$div=$('<div class="iform_line"></div>').appendTo(self.container);self.button_parse_2=$('<input type="button" value="Ïîëó÷èòü äàííûå" class="iform_button">').appendTo($div);$('<span> </span>').appendTo($div);self.button_save_2=$('<input type="button" value="Ñîõðàíèòü è ïðîäîëæèòü" class="iform_button">').appendTo($div);$('<span> </span>').appendTo($div);self.button_skip_2=$('<input type="button" value="Ïðîïóñòèòü" class="iform_button">').appendTo($div);$('<span> </span>').appendTo($div);self.a_parser_url=$('<a class="x">Íàñòðîéêè ïàðñåðà</a>').appendTo(self.container);self.div_x=$('<div'+(self.site_id==0?' class="x"':'')+'></div>').appendTo(self.container);$('<hr class="iform_sep">').appendTo(self.div_x);$div=$('<div class="iform_line"></div>').appendTo(self.div_x);$('<label>Àäðåñ ñòðàíèöû ñî ñïèñêîì íîâîñòåé <b>*</b></label>').appendTo($div);self.main_url=$('<input type="text" class="iform_input w5" maxlength="400" placeholder="url">').appendTo($div);
325$row=$('<div class="iform_row clearfix"></div>').appendTo($div);$column=$('<div class="iform_column w0"></div>').appendTo($row);var $label=$('<label style="margin:8px 0 3px 8px"> utf-8</label>').appendTo($column);self.charset_utf8=$('<input type="radio" name="f_parser_charset">').prependTo($label);$column=$('<div class="iform_column w0"></div>').appendTo($row);var $label=$('<label style="margin:8px 0 3px 8px"> cp1251</label>').appendTo($column);self.charset_cp1251=$('<input type="radio" name="f_parser_charset">').prependTo($label);$column=$('<div class="iform_column w0"></div>').appendTo($row);var $label=$('<label style="margin:8px 0 3px 8px"> àâòî</label>').appendTo($column);self.charset_auto=$('<input type="radio" name="f_parser_charset">').prependTo($label);$div=$('<div class="iform_line"></div>').appendTo(self.div_x);$('<label>Ññûëêà íà îòäåëüíóþ íîâîñòü <b>*</b></label>').appendTo($div);self.a_regex=$('<input type="text" class="w5 iform_input" maxlength="200" placeholder="regex">').appendTo($div);$div=$('<div class="iform_line"></div>').appendTo(self.div_x);self.button_test=$('<input type="button" value="Òåñò" class="iform_button">').appendTo($div);self.container_test=$('<div></div>').appendTo($div);$('<hr class="iform_sep">').appendTo($div);$div=$('<div class="iform_line"></div>').appendTo(self.div_x);$('<label>Çàìåíÿòü â html-êîäå</label>').appendTo($div);self.html_find_set=$('<div></div>').appendTo($div);for(i=1;i<=10;i++){$row=$('<div class="iform_row clearfix"></div>').appendTo(self.html_find_set);$column=$('<div class="iform_column w2"></div>').appendTo($row);$cell=$('<div class="iform_cell"></div>').appendTo($column);self['html_find_'+i]=$('<input type="text" class="iform_input" maxlength="200" placeholder="regex">').appendTo($cell);$column=$('<div class="iform_column w0">íà</div>').appendTo($row);$column=$('<div class="iform_column w2"></div>').appendTo($row);$cell=$('<div class="iform_cell"></div>').appendTo($column);self['html_replace_'+i]=$('<input type="text" class="iform_input" maxlength="200">').appendTo($cell);}
326$div=$('<div class="iform_line"></div>').appendTo(self.div_x);$('<label>Íîâîñòü <b>*</b></label>').appendTo($div);self.item_selector=$('<input type="text" class="w5 iform_input" maxlength="200" placeholder="jquery ñåëåêòîð">').appendTo($div);$div=$('<div class="iform_line"></div>').appendTo(self.div_x);$('<label>Íàçâàíèå <b>*</b></label>').appendTo($div);self.title_selector=$('<input type="text" class="w5 iform_input" maxlength="200" placeholder="jquery ñåëåêòîð">').appendTo($div);$div=$('<div class="iform_line"></div>').appendTo(self.div_x);$('<label>Äàòà</label>').appendTo($div);self.date_selector=$('<input type="text" class="w5 iform_input" maxlength="200" placeholder="jquery ñåëåêòîð">').appendTo($div);$div=$('<div class="iform_line"></div>').appendTo(self.div_x);$('<label>Òåêñò íîâîñòè <b>*</b></label>').appendTo($div);self.text_selector=$('<input type="text" class="w5 iform_input" maxlength="200" placeholder="jquery ñåëåêòîð">').appendTo($div);$div=$('<div class="iform_line"></div>').appendTo(self.div_x);var $label=$('<label> äîáàâèòü ññûëêó íà èñòî÷íèê</label>').appendTo($div);self.add_origin=$('<input type="checkbox">').prependTo($label);$div=$('<div class="iform_line"></div>').appendTo(self.div_x);$('<label>Èçîáðàæåíèÿ â òåêñòå íîâîñòè</label>').appendTo($div);self.image_selector=$('<input type="text" class="w5 iform_input" maxlength="200" placeholder="jquery ñåëåêòîðû ÷åðåç çàïÿòóþ">').appendTo($div);$('<div class="iform_info">"img" (ïî-óìîë÷àíèþ), "a" è ò.ï.</div>').appendTo($div);$div=$('<div class="iform_line"></div>').appendTo(self.div_x);$('<label>Èñêëþ÷èòü èç òåêñòà íîâîñòè</label>').appendTo($div);self.exclude_selector=$('<input type="text" class="w5 iform_input" maxlength="200" placeholder="jquery ñåëåêòîðû ÷åðåç çàïÿòóþ">').appendTo($div);$div=$('<div class="iform_line"></div>').appendTo(self.div_x);$('<label>Çàìåíÿòü â òåêñòå íîâîñòè</label>').appendTo($div);self.text_find_set=$('<div></div>').appendTo($div);for(i=1;i<=10;i++){$row=$('<div class="iform_row clearfix"></div>').appendTo(self.text_find_set);$column=$('<div class="iform_column w2"></div>').appendTo($row);$cell=$('<div class="iform_cell"></div>').appendTo($column);self['text_find_'+i]=$('<input type="text" class="iform_input" maxlength="200" placeholder="regex">').appendTo($cell);$column=$('<div class="iform_column w0">íà</div>').appendTo($row);$column=$('<div class="iform_column w2"></div>').appendTo($row);$cell=$('<div class="iform_cell"></div>').appendTo($column);self['text_replace_'+i]=$('<input type="text" class="iform_input" maxlength="200">').appendTo($cell);}
327$('<hr class="iform_sep">').appendTo($div);$div=$('<div class="iform_line"></div>').appendTo(self.div_x);self.button_parse=$('<input type="button" value="Ïîëó÷èòü äàííûå" class="iform_button">').appendTo($div);$('<span> </span>').appendTo($div);self.button_save=$('<input type="button" value="Ñîõðàíèòü è ïðîäîëæèòü" class="iform_button">').appendTo($div);$('<span> </span>').appendTo($div);self.button_skip=$('<input type="button" value="Ïðîïóñòèòü" class="iform_button">').appendTo($div);self.disable_button();self.button_parse_2.on('click',function(){self.start();});self.button_parse.on('click',function(){self.start();});self.button_save_2.on('click',function(){self.save();});self.button_save.on('click',function(){self.save();});self.button_skip_2.on('click',function(){self.skip();});self.button_skip.on('click',function(){self.skip();});self.button_test.on('click',function(){self.test();});self.html_find_set.x_set();self.text_find_set.x_set();if(self.site_id!=0){self.load_default(function(){self.enable_button();});}else{self.enable_button();}}
328Note_parser.prototype.start=function(){var self=this;if(self.step!=0)return;self.disable_button();self.html='';self.url='';self.md5hash='';self.result={'title':'','date':'','text':'','random_site_id':0};if(self.site_id==0){self.load_default(function(){self.download();});}else{self.save_default(function(){self.download();});}}
329Note_parser.prototype.download=function(){var self=this;JsHttpRequest.query(x_ajax_path+"ajax/line/note/parser/download",{ajx_site_id:self.site_id},function(res,err){if(res){self.html=res['ajx_html'];self.url=res['ajx_url'];self.add_info=res['ajx_add_info'];self.md5hash=res['ajx_md5hash'];self.replace_html();self.parse_item();}},true);}
330Note_parser.prototype.parse_item=function(){var self=this;var $html,item_selector=self.item_selector.val(),title_selector=self.title_selector.val(),date_selector=self.date_selector.val(),text_selector=self.text_selector.val(),add_origin=(self.add_origin.prop('checked')?1:0),image_selector=self.image_selector.val(),exclude_selector=self.exclude_selector.val(),$element;var $html=$('<output>').append($.parseHTML(self.html));var $item=$html.find(item_selector).first();if(title_selector!=''){if(title_selector=='title'){var text=self.html.match(/<title>([^<]+)<\/title>/i)[1]||'';text=self.replace_text(text);self.result.title=text.replace(/\\xA0/g,' ').replace(/\s+/g,' ').trim();}else{$element=$item.find(title_selector);if($element.length){var text=$element.text();self.result.title=text.replace(/\\xA0/g,' ').replace(/\s+/g,' ').trim();}}}
331if(date_selector!=''){$element=$item.find(date_selector);if($element.length){var text=$element.text();self.result.date=text.replace(/\\xA0/g,' ').replace(/\s+/g,' ').trim();}}
332if(text_selector!=''){$element=$item.find(text_selector);if($element.length){if(image_selector!=''){var $image=$element.find(image_selector);$element.find('img').each(function(){var $img=$(this);if(!$img.is($image))
333$img.remove();});$element.find('a').each(function(){var $a=$(this);if($a.is($image))
334$a.after('<img fake-src="'+$a.attr('href')+'">');$a.remove();});}
335if(exclude_selector!=''){$element.find(exclude_selector).each(function(){$(this).remove();});}
336var text=x_purify($element);text=self.replace_text(text);self.result.text=text.replace(/\\xA0/g,' ').replace(/\s+/g,' ').trim();if(self.result.text!=''&&add_origin==1){self.result.text+='<br><p>Èñòî÷íèê: <a href="'+self.url+'" target="_blank">'+self.url+'</a></p>';}}}
337self.additional_processing('show_url_for_diagnostic');self.return_data();}
338Note_parser.prototype.return_data=function(){var self=this;self.callback(self.result);self.stop();}
339Note_parser.prototype.stop=function(){var self=this;self.enable_button();}
340Note_parser.prototype.save=function(){var self=this;self.disable_button();JsHttpRequest.query(x_ajax_path+"ajax/line/note/parser/status",{ajx_md5hash:self.md5hash,ajx_status:1},function(res,err){if(res){if(res.ajx_status==0){alert('Íîâîñòü óæå îáðàáîòàíà. Ïîâòîðíîå ñîõðàíåíèå íåâîçìîæíî');self.enable_button();self.skip();}
340else{var $fake_button=$('<input name="f_btn_apply_and_repeat" type="hidden" value="true">').appendTo(self.container);self.enable_button();self.container.closest('form').submit();}}},true);}
341Note_parser.prototype.skip=function(){var self=this;self.disable_button();JsHttpRequest.query(x_ajax_path+"ajax/line/note/parser/status",{ajx_md5hash:self.md5hash,ajx_status:2},function(res,err){if(res){self.enable_button();self.start();}},true);}
342Note_parser.prototype.test=function(){var self=this;self.disable_button();self.container_test.empty();var ajx_o={ajx_act:'test',ajx_site_id:self.site_id,ajx_main_url:self.main_url.val(),ajx_charset:(self.charset_utf8.prop('checked')?'utf8':(self.charset_cp1251.prop('checked')?'cp1251':'auto')),ajx_a_regex:self.a_regex.val()};JsHttpRequest.query(x_ajax_path+"ajax/line/note/parser/test",ajx_o,function(res,err){if(res){var $div=$('<div class="box" style="max-height:200px;overflow-x:hidden;overflow-y:scroll;"></div>').appendTo(self.container_test);$div.html(res.ajx_html);var $div=$('<div></div>').appendTo(self.container_test);var $a=$('<a class="action">Çàêðûòü</a>').appendTo($div);$a.on('click',function(){self.container_test.empty();});self.enable_button();}},true);}
343Note_parser.prototype.load_default=function(callback){var self=this;var i;JsHttpRequest.query(x_ajax_path+"ajax/line/note/parser/default",{ajx_act:'get',ajx_site_id:self.site_id},function(res,err){if(res){self.button_parse_2.val('Ïîëó÷èòü äàííûå ('+res.ajx_queue_length+')');self.button_parse.val('Ïîëó÷èòü äàííûå ('+res.ajx_queue_length+')');self.main_url.val(res.ajx_main_url);self.charset_utf8.prop('checked',res.ajx_charset=='utf8');self.charset_cp1251.prop('checked',res.ajx_charset=='cp1251');self.charset_auto.prop('checked',res.ajx_charset=='auto');self.a_regex.val(res.ajx_a_regex);self.item_selector.val(res.ajx_item_selector);self.title_selector.val(res.ajx_title_selector);self.date_selector.val(res.ajx_date_selector);self.text_selector.val(res.ajx_text_selector);self.add_origin.prop('checked',res.ajx_add_origin==1?true:false);self.image_selector.val(res.ajx_image_selector);self.exclude_selector.val(res.ajx_exclude_selector);for(i=1;i<=10;i++){self['html_find_'+i].val(res['ajx_html_find_'+i]);self['html_replace_'+i].val(res['ajx_html_replace_'+i]);}
344for(i=1;i<=10;i++){self['text_find_'+i].val(res['ajx_text_find_'+i]);self['text_replace_'+i].val(res['ajx_text_replace_'+i]);}
345if(self.site_id==0){self.result.random_site_id=res.ajx_site_id;self.a_parser_url.attr('href',res.ajx_parser_url).show();}
346callback();}},true);}
347Note_parser.prototype.save_default=function(callback){var self=this;var i;var ajx_o={ajx_act:'set',ajx_site_id:self.site_id,ajx_main_url:self.main_url.val(),ajx_charset:(self.charset_utf8.prop('checked')?'utf8':(self.charset_cp1251.prop('checked')?'cp1251':'auto')),ajx_a_regex:self.a_regex.val(),ajx_item_selector:self.item_selector.val(),ajx_title_selector:self.title_selector.val(),ajx_date_selector:self.date_selector.val(),ajx_text_selector:self.text_selector.val(),ajx_add_origin:(self.add_origin.prop('checked')?1:0),ajx_image_selector:self.image_selector.val(),ajx_exclude_selector:self.exclude_selector.val()};for(i=1;i<=10;i++){ajx_o['ajx_html_find_'+i]=self['html_find_'+i].val();ajx_o['ajx_html_replace_'+i]=self['html_replace_'+i].val();}
348for(i=1;i<=10;i++){ajx_o['ajx_text_find_'+i]=self['text_find_'+i].val();ajx_o['ajx_text_replace_'+i]=self['text_replace_'+i].val();}
349JsHttpRequest.query(x_ajax_path+"ajax/line/note/parser/default",ajx_o,function(res,err){if(res){callback();}},true);}
350Note_parser.prototype.enable_button=function(){var self=this;self.button_parse_2.prop('disabled',false);self.button_parse.prop('disabled',false);self.button_save_2.prop('disabled',false);self.button_save.prop('disabled',false);self.button_skip_2.prop('disabled',false);self.button_skip.prop('disabled',false);self.button_test.prop('disabled',false);if(self.md5hash==''){self.button_save_2.hide();self.button_save.hide();self.button_skip_2.hide();self.button_skip.hide();}else{self.button_save_2.show();self.button_save.show();self.button_skip_2.show();self.button_skip.show();}
351self.step=0;}
352Note_parser.prototype.disable_button=function(){var self=this;self.button_parse_2.prop('disabled',true);self.button_parse.prop('disabled',true);self.button_save_2.prop('disabled',true);self.button_save.prop('disabled',true);self.button_skip_2.prop('disabled',true);self.button_skip.prop('disabled',true);self.button_test.prop('disabled',true);if(self.md5hash==''){self.button_save_2.hide();self.button_save.hide();self.button_skip_2.hide();self.button_skip.hide();}else{self.button_save_2.show();self.button_save.show();self.button_skip_2.show();self.button_skip.show();}
353self.step=1;}
354Note_parser.prototype.replace_html=function(){var self=this;var i,find,replace;for(i=1;i<=4;i++){find=self['html_find_'+i].val();if(find!=''){replace=self['html_replace_'+i].val();var regexp=new RegExp(find,'g');self.html=self.html.replace(regexp,replace);}}}
355Note_parser.prototype.replace_text=function(text){var self=this;var i,find,replace;for(i=1;i<=8;i++){find=self['text_find_'+i].val();if(find!=''){replace=self['text_replace_'+i].val();var regexp=new RegExp(find,'g');text=text.replace(regexp,replace);}}
356return text;}
357Note_parser.prototype.host=function(url){if(url.search(/^https?\:\/\//)!=-1){url=url.match(/^(https?\:\/\/[^\/?#]+)(?:[\/?#]|$)/i,"");}else{url=url.match(/^([^\/?#]+)(?:[\/?#]|$)/i,"");}
358return url[1];}
359Note_parser.prototype.additional_processing=function(parameter){var self=this;switch(parameter){case'show_url_for_diagnostic':if(self.url!=''){$('.note_parser_notice').remove();add_info='<div class="iform_info">ïàðñèì url: '+self.url+'</div>';if(self.add_info.date_added_to_queue){add_info+='<div class="iform_info">äîáàâëåíà â î÷åðåäü: '+self.add_info.date_added_to_queue+'</div>';}
360$('<div class="note_parser_notice"><div class="iform_line">'+add_info+'</div></div>').prependTo(self.container);}
361break;default:return;}}
362Line_list.prototype.product_init=function(){var self=this;x_collection['line_product_popup']=new Popup({chanel:2,position:'fixed'});$(document).on('keydown',function(event){self.product_keydown(event);});return this;}
363Line_list.prototype.product_read=function(line_id){var self=this;x_analytics('line_2_read');if(self.is_clear){self.is_clear=false;var $item=self.container.find("#line-"+line_id);$item.find('.line_read').html(x_ajax_loader);self.o.act='output';self.o.line_id=line_id;self.o.is_short=false;JsHttpRequest.query(x_ajax_path+"ajax/line/item",self.ajx_o(),function(res,err){if(res){$item.html(res.ajx_line_item);self.product_live($item);$item.find('.line_tab_handlers a[data-action=message]').click();self.is_clear=true;}},true);}}
364Line_list.prototype.product_element=function(element_id){var self=this;if(self.is_clear){x_analytics('line_2_element_popup');self.is_clear=false;
364JsHttpRequest.query(x_ajax_path+'ajax/line/product/element',{ajx_namespace:self.o.namespace,ajx_act:'output',ajx_id:element_id,ajx_width:parseInt($(window).width()),ajx_height:parseInt($(window).height())},function(res,err){if(res){x_collection.line_product_popup.open({content:res.ajx_html,my:'center',at:'center',of:$(window),action:'click',delay:100,effect:'fade',duration:200,hide_before_show:false,modal:true});var window_height=parseInt($(window).height()),popup_height=parseInt(x_collection.line_product_popup.popup.height());var top=-26+Math.floor(popup_height/2);x_collection.line_product_popup.popup.find('.popup_line_product_previous').css({'top':top+'px'});x_collection.line_product_popup.popup.find('.popup_line_product_next').css({'top':top+'px'});if(window_height-popup_height<164){top=-62+Math.floor((164-(window_height-popup_height))/2);x_collection.line_product_popup.popup.find('.popup_line_product_close').css({'top':top+'px'});}else{x_collection.line_product_popup.popup.find('.popup_line_product_close').css({'top':'-62px'});}
365var available_height=x_collection.line_product_popup.popup.find('.popup_line_product_scroll').css({'max-height':x_collection.line_product_popup.popup.find('.popup_line_product').height()+'px'});self.is_clear=true;}},true);}}
366Line_list.prototype.product_close_element=function(){var self=this;x_collection.line_product_popup.close();}
367Line_list.prototype.product_keydown=function(event){var self=this;if(x_collection.line_product_popup.popup.is(':visible')&&x_collection.line_product_popup.popup.find('.popup_line_product').length){switch(event.keyCode){case 27:event.preventDefault();x_collection.line_product_popup.popup.find('.popup_line_product_close').click();break;case 37:event.preventDefault();x_collection.line_product_popup.popup.find('.popup_line_product_previous').click();break;case 39:event.preventDefault();x_collection.line_product_popup.popup.find('.popup_line_product_next').click();break;}}}
368Line_list.prototype.product_live=function($item){var self=this,line_id=$item.attr("id");if(line_id!==undefined){if(line_id.substring(0,4)=='line'){line_id=line_id.substring(5);$item.addClass('live');$item.find('h2 a').addClass('live').on('click',function(event){event.preventDefault();});$item.find('ul').addClass('live').on('click',function(event){event.preventDefault();var $target=$(event.target).closest('li');if($target.length){if($target.hasClass('line_product_more')){event.preventDefault();self.product_read(line_id);}else{var element_id=$target.data('id'),element_path=$target.data('product-path');if(element_id!==undefined){x_analytics('line_2_element_popup');location.href=$target.find('a').attr('href');}}}});$item.find('li').not('.line_product_more').find('.line_product_image').each(function(){$(this).append('<i>Ïîäðîáíîå îïèñàíèå</i>');});$item.find('p.line_read a').addClass('live').on('click',function(event){event.preventDefault();self.product_read(line_id);});$item.find('div.line_tab a').addClass('live').on('click',function(event){event.preventDefault();self.tab_click(event,line_id);});if(self.o.tag!=''){$item.highlight(self.o.tag);}}}}
369function Product_parser(o){var self=this;self.container=o.container;self.structure=o.structure;self.site_id=o.site_id;self.slot=o.slot;self.callback=o.callback;self.step=0;self.url='';self.html='';self.a=[];self.url_list=[];self.curs=0;self.res='';self.charset='auto';return self;}
370Product_parser.prototype.init=function(){var self=this;var $div,$row,$cell,i;$div=$('<div class="iform_line"></div>').appendTo(self.container);self.button2=$('<input type="button" value="Ïîëó÷èòü äàííûå" class="iform_button">').appendTo($div);$('<hr class="iform_sep">').appendTo($div);$div=$('<div class="iform_line"></div>').appendTo(self.container);self.description=$('<input type="text" class="iform_input w5" maxlength="400" placeholder="Çàìåòêè">').appendTo($div);$('<hr class="iform_sep">').appendTo($div);$div=$('<div class="iform_line"></div>').appendTo(self.container);$('<label>Ãëàâíàÿ ñòðàíèöà êàòàëîãà</label>').appendTo($div);self.main_url=$('<input type="text" class="iform_input w5" maxlength="400" placeholder="url">').appendTo($div);
370$row=$('<div class="iform_row clearfix"></div>').appendTo($div);$column=$('<div class="iform_column w0"></div>').appendTo($row);var $label=$('<label style="margin:8px 0 3px 8px"> utf-8</label>').appendTo($column);self.charset_utf8=$('<input type="radio" name="f_parser_charset">').prependTo($label);$column=$('<div class="iform_column w0"></div>').appendTo($row);var $label=$('<label style="margin:8px 0 3px 8px"> cp1251</label>').appendTo($column);self.charset_cp1251=$('<input type="radio" name="f_parser_charset">').prependTo($label);$column=$('<div class="iform_column w0"></div>').appendTo($row);var $label=$('<label style="margin:8px 0 3px 8px"> àâòî</label>').appendTo($column);self.charset_auto=$('<input type="radio" name="f_parser_charset">').prependTo($label);self.main_a=$('<p><a class="action">Ïîäìåíèòü ãëàâíóþ ñòðàíèöó êàòàëîãà</a></p>').appendTo($div);$div=$('<div class="iform_line x"></div>').appendTo(self.container);$('<label>Ïîäìåíèòü ãëàâíóþ ñòðàíèöó êàòàëîãà</label>').appendTo($div);self.main_html=$('<textarea class="w5 h1 iform_input" placeholder="html êîä"></textarea>').appendTo($div);$div=$('<div class="iform_line"></div>').appendTo(self.container);$('<label>Ññûëêà íà îòäåëüíûé ïðîäóêò</label>').appendTo($div);self.a_selector=$('<input type="text" class="w5 iform_input" maxlength="200" placeholder="jquery ñåëåêòîð">').appendTo($div);$div=$('<div class="iform_line"></div>').appendTo(self.container);$row=$('<div class="iform_row clearfix"></div>').appendTo($div);$column=$('<div class="iform_column w0"></div>').appendTo($row);var $label=$('<label style="margin:8px 0 3px 8px"> äîáàâèòü äàííûå ê òàáëèöå</label>').appendTo($column);self.mode_append=$('<input type="checkbox">').prependTo($label);$column=$('<div class="iform_column w0"></div>').appendTo($row);var $label=$('<label style="margin:8px 0 3px 8px"> íå ñïåøèòü</label>').appendTo($column);self.slow=$('<input type="checkbox">').prependTo($label);$('<hr class="iform_sep">').appendTo($div);$div=$('<div class="iform_line"></div>').appendTo(self.container);$('<label>Çàìåíÿòü â html-êîäå</label>').appendTo($div);self.html_find_set=$('<div></div>').appendTo($div);for(i=1;i<=8;i++){$row=$('<div class="iform_row clearfix"></div>').appendTo(self.html_find_set);$column=$('<div class="iform_column w2"></div>').appendTo($row);$cell=$('<div class="iform_cell"></div>').appendTo($column);self['html_find_'+i]=$('<input type="text" class="iform_input" maxlength="200" placeholder="ðåãóëÿðíîå âûðàæåíèå">').appendTo($cell);$column=$('<div class="iform_column w0">íà</div>').appendTo($row);$column=$('<div class="iform_column w2"></div>').appendTo($row);$cell=$('<div class="iform_cell"></div>').appendTo($column);self['html_replace_'+i]=$('<input type="text" class="iform_input" maxlength="200">').appendTo($cell);}
371$('<hr class="iform_sep">').appendTo($div);$div=$('<div class="iform_line"></div>').appendTo(self.container);$('<label>Ïðîäóêò</label>').appendTo($div);self.item_selector=$('<input type="text" class="w5 iform_input" maxlength="200" placeholder="jquery ñåëåêòîð">').appendTo($div);$div=$('<div class="iform_line"></div>').appendTo(self.container);$('<label>Íàçâàíèå</label>').appendTo($div);self.title_selector=$('<input type="text" class="w5 iform_input" maxlength="200" placeholder="jquery ñåëåêòîð">').appendTo($div);$div=$('<div class="iform_line"></div>').appendTo(self.container);$('<label>Èçîáðàæåíèå</label>').appendTo($div);self.image_selector=$('<input type="text" class="w5 iform_input" maxlength="200" placeholder="jquery ñåëåêòîð">').appendTo($div);$div=$('<div class="iform_line"></div>').appendTo(self.container);$('<label>Îïèñàíèå</label>').appendTo($div);self.text_selector=$('<input type="text" class="w5 iform_input" maxlength="200" placeholder="jquery ñåëåêòîð">').appendTo($div);$div=$('<div class="iform_line"></div>').appendTo(self.container);$('<label>Èçîáðàæåíèå â îïèñàíèè</label>').appendTo($div);self.desc_image_selector=$('<input type="text" class="w5 iform_input" maxlength="200" placeholder="jquery ñåëåêòîð">').appendTo($div);$div=$('<div class="iform_line"></div>').appendTo(self.container);$('<label>Öåíà</label>').appendTo($div);self.price_selector=$('<input type="text" class="w5 iform_input" maxlength="200" placeholder="jquery ñåëåêòîð">').appendTo($div);$('<hr class="iform_sep">').appendTo($div);$div=$('<div class="iform_line"></div>').appendTo(self.container);$('<label>Íàçâàíèå èëè îïèñàíèå ïðîäóêòà ñîâïàäàåò ñ</label>').appendTo($div);self.text_match=$('<input type="text" class="w5 iform_input" maxlength="200" placeholder="ðåãóëÿðíîå âûðàæåíèå">').appendTo($div);$div=$('<div class="iform_line"></div>').appendTo(self.container);$('<label>Çàìåíÿòü â íàçâàíèè è îïèñàíèè ïðîäóêòà</label>').appendTo($div);self.text_find_set=$('<div></div>').appendTo($div);for(i=1;i<=8;
371i++){$row=$('<div class="iform_row clearfix"></div>').appendTo(self.text_find_set);$column=$('<div class="iform_column w2"></div>').appendTo($row);$cell=$('<div class="iform_cell"></div>').appendTo($column);self['text_find_'+i]=$('<input type="text" class="iform_input" maxlength="200" placeholder="ðåãóëÿðíîå âûðàæåíèå">').appendTo($cell);$column=$('<div class="iform_column w0">íà</div>').appendTo($row);$column=$('<div class="iform_column w2"></div>').appendTo($row);$cell=$('<div class="iform_cell"></div>').appendTo($column);self['text_replace_'+i]=$('<input type="text" class="iform_input" maxlength="200">').appendTo($cell);}
372$('<hr class="iform_sep">').appendTo($div);$div=$('<div class="iform_line"></div>').appendTo(self.container);self.button=$('<input type="button" value="Ïîëó÷èòü äàííûå" class="iform_button">').appendTo($div);self.main_a.on('click',function(){self.main_a.closest('p').hide();self.main_html.closest('div').show();});self.button2.on('click',function(){self.start();});self.button.on('click',function(){self.start();});self.html_find_set.x_set();self.text_find_set.x_set();JsHttpRequest.query(x_ajax_path+"ajax/line/product/parser/default",{ajx_act:'get',ajx_site_id:self.site_id,ajx_slot:self.slot},function(res,err){if(res){self.description.val(res.ajx_description);self.main_url.val(res.ajx_main_url);self.charset_utf8.prop('checked',res.ajx_charset=='utf8');self.charset_cp1251.prop('checked',res.ajx_charset=='cp1251');self.charset_auto.prop('checked',res.ajx_charset=='auto');self.slow.prop('checked',res.ajx_slow);self.a_selector.val(res.ajx_a_selector);self.mode_append.prop('checked',res.ajx_mode_append);self.item_selector.val(res.ajx_item_selector);self.image_selector.val(res.ajx_image_selector);self.title_selector.val(res.ajx_title_selector);self.text_selector.val(res.ajx_text_selector);self.desc_image_selector.val(res.ajx_desc_image_selector);self.price_selector.val(res.ajx_price_selector);for(i=1;i<=8;i++){self['html_find_'+i].val(res['ajx_html_find_'+i]);self['html_replace_'+i].val(res['ajx_html_replace_'+i]);}
373self.text_match.val(res.ajx_text_match);for(i=1;i<=8;i++){self['text_find_'+i].val(res['ajx_text_find_'+i]);self['text_replace_'+i].val(res['ajx_text_replace_'+i]);}}},true);}
374Product_parser.prototype.start=function(){var self=this;if(self.step==0){var ajx_o={ajx_act:'set',ajx_site_id:self.site_id,ajx_slot:self.slot,ajx_description:self.description.val(),ajx_main_url:self.main_url.val(),ajx_charset:(self.charset_utf8.prop('checked')?'utf8':(self.charset_cp1251.prop('checked')?'cp1251':'auto')),ajx_slow:self.slow.prop('checked'),ajx_a_selector:self.a_selector.val(),ajx_mode_append:self.mode_append.prop('checked'),ajx_item_selector:self.item_selector.val(),ajx_image_selector:self.image_selector.val(),ajx_title_selector:self.title_selector.val(),ajx_text_selector:self.text_selector.val(),ajx_desc_image_selector:self.desc_image_selector.val(),ajx_price_selector:self.price_selector.val(),ajx_text_match:self.text_match.val()};for(i=1;i<=8;i++){ajx_o['ajx_html_find_'+i]=self['html_find_'+i].val();ajx_o['ajx_html_replace_'+i]=self['html_replace_'+i].val();}
375for(i=1;i<=8;i++){ajx_o['ajx_text_find_'+i]=self['text_find_'+i].val();ajx_o['ajx_text_replace_'+i]=self['text_replace_'+i].val();}
376JsHttpRequest.query(x_ajax_path+"ajax/line/product/parser/default",ajx_o,function(res,err){if(res){}},true);self.url='';self.html='';self.a=[];self.url_list=[];self.curs=0;self.res='';self.button.prop('disabled',true);self.button2.prop('disabled',true);self.next();}}
377Product_parser.prototype.next=function(){var self=this;switch(self.step){case 0:self.url=self.main_url.val();if(self.url==''){alert('Íå óêàçàí url ãëàâíîé ñòðàíèöû êàòàëîãà');self.stop();}else{var html=self.main_html.val();if(html==''){self.step=1;self.download();}else{self.step=1;self.html='<div>'+html.replace(new RegExp(" src=","gi"),' fake-src=')+'</div>';self.replace_html();self.next();}}
378break;case 1:if(self.html==''){alert('Íå ïîëó÷åíà ãëàâíàÿ ñòðàíèöà êàòàëîãà');self.stop();}else{self.curs=0;if(self.a_selector.val()==''){self.step=2;self.parse_all_items();}else{self.step=2;self.get_a();}}
379break;case 2:if(self.curs==self.a.length){if(self.a.length==0&&self.a_selector.val()!='')alert('Íå íàéäåíî íè îäíîé ññûëêè íà îòäåëüíûé ïðîäóêò');self.return_data();}else{self.url=$(self.a[self.curs]).attr('href');if($.inArray(self.url,self.url_list)<0){self.url_list.push(self.url);}else{self.url='';}
380self.curs++;self.button2.val(Math.round(100*self.curs/self.a.length)+'%');self.button.val(Math.round(100*self.curs/self.a.length)+'%');if(self.url==''){self.next();}else{if(self.url.match(/^\//)){self.url=self.host(self.main_url.val())+self.url;}
381self.step=3;self.download();}}
382break;case 3:if(self.html==''){self.step=2;self.next();}else{self.step=2;self.parse_item();}
383break;}}
384Product_parser.prototype.stop=function(){var self=this;self.step=0;self.button2.val('Ïîëó÷èòü äàííûå').prop('disabled',false);self.button.val('Ïîëó÷èòü äàííûå').prop('disabled',false);}
385Product_parser.prototype.download=function(){var self=this;JsHttpRequest.query(x_ajax_path+"ajax/line/product/parser/download",{ajx_charset
385:(self.charset_utf8.prop('checked')?'utf8':(self.charset_cp1251.prop('checked')?'cp1251':'auto')),ajx_url:self.url},function(res,err){if(res){self.html=res['ajx_html'];self.replace_html();if(self.slow.prop('checked')){setTimeout(function(){self.next();},5000);}else{self.next();}}},true);}
386Product_parser.prototype.get_a=function(){var self=this;var $html=$($.parseHTML(self.html));self.a=$html.find(self.a_selector.val());self.next();}
387Product_parser.prototype.replace_html=function(){var self=this;var i,find,replace;for(i=1;i<=8;i++){find=self['html_find_'+i].val();if(find!=''){replace=self['html_replace_'+i].val();var regexp=new RegExp(find,'g');self.html=self.html.replace(regexp,replace);}}}
388Product_parser.prototype.replace_text=function(text){var self=this;var i,find,replace;for(i=1;i<=8;i++){find=self['text_find_'+i].val();if(find!=''){replace=self['text_replace_'+i].val();var regexp=new RegExp(find,'g');text=text.replace(regexp,replace);}}
389return text;}
390Product_parser.prototype.parse_item=function(){var self=this;var $html,item_selector=self.item_selector.val(),image_selector=self.image_selector.val(),image_selector_array=[],title_selector=self.title_selector.val(),text_selector=self.text_selector.val(),text_selector_array=[],desc_image_selector=self.desc_image_selector.val(),price_selector=self.price_selector.val(),i,j,$item,$element,url='',item_image_url='',title='',item_title='',item_text='',item_desc='',price='',item_price='',host=self.host(self.main_url.val());$html=$('<output>').append($.parseHTML(self.html));$html.find(item_selector).each(function(){$item=$(this);console.log($item);for(i in self.structure){switch(self.structure[i].name){case'image_id':if(image_selector!=''){if(image_selector.match(/\,/)){image_selector_array=image_selector.split(',');}else{image_selector_array=[image_selector];}
391for(j in image_selector_array){$element=$item.find(image_selector_array[j]);if($element.length){if($element.is('img')){url=$element.attr('fake-src').replace(/[\t\n\r]/g,' ').trim();if(url.match(/^\//)){url=host+url;}}else if($element.is('a')){url=$element.attr('href').replace(/[\t\n\r]/g,' ').trim();if(url.match(/^\//)){url=host+url;}}
392break;}}}
393if(url.length>0){item_image_url=url;}
394break;case'title':if(title_selector!=''){if(title_selector=='title'){var text=self.html.match(/<title>([^<]+)<\/title>/i)[1]||'';text=self.replace_text(text);title=text.replace(/\\xA0/g,' ').replace(/\s+/g,' ').trim();}else{$element=$item.find(title_selector);console.log($element);if($element.length){var text=$element.text();text=self.replace_text(text);title=text.replace(/\\xA0/g,' ').replace(/\s+/g,' ').trim();}}}
395if(title.length>0){item_title=title;}
396break;case'text':if(text_selector!=''){if(text_selector.match(/\,/)){text_selector_array=text_selector.split(',');}else{text_selector_array=[text_selector];}
397var k=0,element_text='';for(j in text_selector_array){$element=$item.find(text_selector_array[j]);if($element.length){console.log($element);if(desc_image_selector!=''){var $desc_image=$element.find(desc_image_selector);$element.find('img').each(function(){var $img=$(this);if(!$img.is($desc_image))
398$img.attr('src','').attr('fake-src','');});$element.find('a').each(function(){var $a=$(this);if($a.is($desc_image))
399$a.prepend('<img fake-src="'+$a.attr('href')+'">');});}
400if(self.structure[i].type=='html'){var text=x_purify($element);}else{var text=$element.text();}
401text=self.replace_text(text);if(k!=0)element_text+=' ';k++;element_text+=text.replace(/\\xA0/g,' ').replace(/\s+/g,' ').trim();element_text=element_text+'<div> </div>';}}}
402if(element_text.length>0){item_desc+=element_text;}
403break;case'price':if(price_selector!=''){$element=$item.find(price_selector);if($element.length){price=$element.text().replace(/\\xA0/g,' ').replace(/\s+/g,' ').replace(/[^0-9,\.]/g,'').replace(/^\s+|[\s\.,]+$/g,'');}}
404if(price.length>0){item_price=price;}
405break;}}});self.res+=item_image_url+"\t"+item_title+"\t"+item_desc+"\t"+item_price;self.res+="\n";self.next();}
406Product_parser.prototype.parse_all_items=function(){var self=this;var $html,item_selector=self.item_selector.val(),image_selector=self.image_selector.val(),image_selector_array=[],title_selector=self.title_selector.val(),text_selector=self.text_selector.val(),text_selector_array=[],desc_image_selector=self.desc_image_selector.val(),price_selector=self.price_selector.val(),i,j,$item,$element,url,host=self.host(self.main_url.val());$html=$('<output>').append($.parseHTML(self.html));console.log($html);console.log(item_selector);$html.find(item_selector).each(function(){$item=$(this);console.log($item);for(i in self.structure){switch(self.structure[i].name){case'image_id':if(image_selector!=''){if(image_selector.match(/\,/)){image_selector_array=image_selector.split(',');}else{image_selector_array=[image_selector];}
407for(j in image_selector_array){$element=$item.find(image_selector_array[j]);if($element.length){if($element.is('img')){url=$element.attr('fake-src').replace(/[\t\n\r]/g,' ').trim();if(url.match(/^\//)){url=host+url;}
408self.res+=url;}else if($element.is('a')){url=$element.attr('href').replace(/[\t\n\r]/g,' ').trim();if(url.match(/^\//)){url=host+url;}
409self.res+=url;}
410break;}}}
411self.res+="\t";break;case'title':if(title_selector!=''){if(title_selector=='title'){var text=self.html.match(/<title>([^<]+)<\/title>/i)[1]||'';text=self.replace_text(text);self.res+=text.replace(/\\xA0/g,' ').replace(/\s+/g,' ').trim();}else{$element=$item.find(title_selector);console.log($element);if($element.length){var text=$element.text();text=self.replace_text(text);self.res+=text.replace(/\\xA0/g,' ').replace(/\s+/g,' ').trim();}}}
412self.res+="\t";break;case'text':if(text_selector!=''){if(text_selector.match(/\,/)){text_selector_array=text_selector.split(',');}else{text_selector_array=[text_selector];}
413var k=0;for(j in text_selector_array){$element=$item.find(text_selector_array[j]);if($element.length){if(desc_image_selector!=''){var $desc_image=$element.find(desc_image_selector);$element.find('img').each(function(){var $img=$(this);if(!$img.is($desc_image))
414$img.attr('src','').attr('fake-src','');});$element.find('a').each(function(){var $a=$(this);if($a.is($desc_image))
415$a.prepend('<img fake-src="'+$a.attr('href')+'">');});}
416if(self.structure[i].type=='html'){var text=x_purify($element);}else{var text=$element.text();}
417text=self.replace_text(text);if(k!=0)self.res+=' ';k++;self.res+=text.replace(/\\xA0/g,' ').replace(/\s+/g,' ').trim();}}}
418self.res+="\t";break;case'price':if(price_selector!=''){$element=$item.find(price_selector);if($element.length){self.res+=$element.text().replace(/\\xA0/g,' ').replace(/\s+/g,' ').replace(/[^0-9,\.]/g,'').replace(/^\s+|[\s\.,]+$/g,'');}}
419self.res+="\t";break;}}
420self.res+="\n";});self.next();}
421Product_parser.prototype.return_data=function(){var self=this;if(self.res==''){self.stop();}else{var text_match=self.text_match.val();if(text_match!=''){var regexp=new RegExp(text_match,'i'),rows=self.res.split("\n"),i;self.res='';
421for(i in rows){if(regexp.test(rows[i])){self.res+=rows[i]+"\n";}}}
422self.callback(self.res,self.mode_append.prop('checked'));self.stop();}}
423Product_parser.prototype.host=function(url){if(url.search(/^https?\:\/\//)!=-1){url=url.match(/^(https?\:\/\/[^\/?#]+)(?:[\/?#]|$)/i,"");}else{url=url.match(/^([^\/?#]+)(?:[\/?#]|$)/i,"");}
424return url[1];}
425function Mailer_list(o){var self=this;self.container=o.container;self.o={namespace:o.namespace||"",act:o.act||"",mailer_id:o.mailer_id||0,filter:o.filter||"",offset:o.offset||0};return self}
426Mailer_list.prototype.output=function(){var self=this;self.container.stop(true,true).fadeTo(200,0.1,function(){JsHttpRequest.query(x_ajax_path+"ajax/mailer/list",{ajx_namespace:self.o.namespace,ajx_act:"output",ajx_mailer_id:self.o.mailer_id,ajx_filter:self.o.filter,ajx_offset:self.o.offset},function(res,err){if(res)self.container.stop(true,true).html(res["ajx_mailer_list"]).fadeTo(200,1)},true)})};Mailer_list.prototype.filter=function(){var self=this;self.o.filter=self.container.find('input[name="filter"]').val();self.output()};Mailer_list.prototype.offset=function(offset){var self=this;self.o.offset=offset;self.output()};Mailer_list.prototype.hide=function(mailer_id){var self=this;self.o.mailer_id=mailer_id||self.o.mailer_id;var $item=$("#mailer-"+self.o.mailer_id);$item.fadeTo(200,0.5,function(){if(confirm(txt_uvereny)){$("#mailer-service-"+self.o.mailer_id).html(x_ajax_loader+'<p class="cb"></p>');JsHttpRequest.query(x_ajax_path+"ajax/mailer/item",{ajx_act:"hide",ajx_namespace:self.o.namespace,ajx_mailer_id:self.o.mailer_id},function(res,err){if(res)$item.html(res["ajx_mailer_item"])},true)}else $item.css({"opacity":1})})};function Message_recent_list(o){var self=this;self.container=o.container;self.o={namespace:o.namespace||"",act:o.act||"",pattern:o.pattern||"",offset:o.offset||0};self.text={time_is_up:"\u0412\u0440\u0435\u043c\u044f \u043e\u0436\u0438\u0434\u0430\u043d\u0438\u044f \u043e\u0442\u0432\u0435\u0442\u0430 \u043e\u0442 \u0441\u0435\u0440\u0432\u0435\u0440\u0430 \u0438\u0441\u0442\u0435\u043a\u043b\u043e. \u041f\u043e\u0432\u0442\u043e\u0440\u0438\u0442\u0435 \u043f\u043e\u043f\u044b\u0442\u043a\u0443 \u043f\u043e\u0437\u0436\u0435."};self.more_initial_call=true;self.autoload=o.autoload||false;self.ajax_timer;self.ajax_status=0;return this}Message_recent_list.prototype.ajx_o=function(){var self=this;return{ajx_namespace:self.o.namespace,ajx_act:self.o.act,ajx_pattern:self.o.pattern,ajx_offset:self.o.offset}};Message_recent_list.prototype.output=function(){var self=this;if(!self.ajax_ready())return;self.o.act="output";self.container.stop(true,true).fadeTo(200,.1,function(){JsHttpRequest.query(x_ajax_path+"ajax/message/list",self.ajx_o(),function(res,err){if(res){if(!self.ajax_waiting())return;self.container.find("table").html(res["ajx_html"]);self.container.stop(true,true).fadeTo(200,1)}},true)})};Message_recent_list.prototype.start=function(){var self=this;if(!self.ajax_ready())return;self.o.offset=0;self.o.act="start";self.container.stop(true,true).fadeTo(200,.1,function(){JsHttpRequest.query(x_ajax_path+"ajax/message/list",self.ajx_o(),function(res,err){if(res){if(!self.ajax_waiting())return;self.more_initial_call=false;self.o.offset=1;self.container.empty();self.div_more=$("<div></div>").addClass("more").html(res["ajx_more"]).appendTo(self.container);$('<p class="cb"></p>').appendTo(self.container);self.div_more.before(res["ajx_html"]);self.container.stop(true,true).fadeTo(200,1)}},true)})};Message_recent_list.prototype.more=function(){var self=this;if(!self.ajax_ready())return;self.o.act="more";if(self.more_initial_call);else{self.container.children(".x").removeClass("x");self.o.offset=self.o.offset+1}JsHttpRequest.query(x_ajax_path+"ajax/message/list",self.ajx_o(),function(res,err){if(res){if(!self.ajax_waiting())return;if(self.more_initial_call){self.more_initial_call=false;self.div_more=$("<div></div>").addClass("more").html(res["ajx_more"]).appendTo(self.container);$("<p></p>").addClass("cb").appendTo(self.container)}else self.div_more.html(res["ajx_more"]);self.div_more.before(res["ajx_html"])}},true)};Message_recent_list.prototype.pattern=function(pattern){var self=this;self.o.pattern=pattern;self.offset=0;self.start()};Message_recent_list.prototype.live_autoload=function(){var self=this;var w=$(window);w.on("scroll",function(){if($(document).height()-w.height()-w.scrollTop()<200)self.more()})};Message_recent_list.prototype.ajax_ready=function(o){var self=this;if(self.ajax_status!=0)return false;self.ajax_status=1;clearTimeout(self.ajax_timer);self.ajax_timer=setTimeout(function(){o.action_on_delay();
426alert(self.text.time_is_up);self.ajax_status=0},2E3);return true};Message_recent_list.prototype.ajax_waiting=function(){var self=this;if(self.ajax_status==0)return false;clearTimeout(self.ajax_timer);self.ajax_status=0;return true};function Message_flow_list(o){var self=this;self.container=o.container;self.o={namespace:o.namespace||"",act:o.act||"",message_id:o.message_id||0,offset:o.offset||0};self.text={time_is_up:"\u0412\u0440\u0435\u043c\u044f \u043e\u0436\u0438\u0434\u0430\u043d\u0438\u044f \u043e\u0442\u0432\u0435\u0442\u0430 \u043e\u0442 \u0441\u0435\u0440\u0432\u0435\u0440\u0430 \u0438\u0441\u0442\u0435\u043a\u043b\u043e. \u041f\u043e\u0432\u0442\u043e\u0440\u0438\u0442\u0435 \u043f\u043e\u043f\u044b\u0442\u043a\u0443 \u043f\u043e\u0437\u0436\u0435."};self.more_initial_call=true;self.autoload=o.autoload||false;self.ajax_timer;self.ajax_status=0;return this}Message_flow_list.prototype.ajx_o=function(){var self=this;return{ajx_namespace:self.o.namespace,ajx_act:self.o.act,ajx_message_id:self.o.message_id,ajx_offset:self.o.offset}};Message_flow_list.prototype.output=function(){var self=this;if(!self.ajax_ready())return;self.o.act="output";self.container.stop(true,true).fadeTo(200,.1,function(){JsHttpRequest.query(x_ajax_path+"ajax/message/flow/list",self.ajx_o(),function(res,err){if(res){if(!self.ajax_waiting())return;self.container.find("table").html(res["ajx_html"]);self.container.stop(true,true).fadeTo(200,1)}},true)})};Message_flow_list.prototype.start=function(){var self=this;if(!self.ajax_ready())return;self.o.offset=0;self.o.act="start";self.container.stop(true,true).fadeTo(200,.1,function(){JsHttpRequest.query(x_ajax_path+"ajax/message/flow/list",self.ajx_o(),function(res,err){if(res){if(!self.ajax_waiting())return;self.more_initial_call=false;self.o.offset=1;self.container.empty();self.div_more=$("<div></div>").addClass("more").html(res["ajx_more"]).appendTo(self.container);$('<p class="cb"></p>').appendTo(self.container);self.div_more.before(res["ajx_html"]);self.container.stop(true,true).fadeTo(200,1)}},true)})};Message_flow_list.prototype.more=function(){var self=this;if(!self.ajax_ready())return;self.o.act="more";if(self.more_initial_call);else{self.container.children(".x").removeClass("x");self.o.offset=self.o.offset+1}JsHttpRequest.query(x_ajax_path+"ajax/message/flow/list",self.ajx_o(),function(res,err){if(res){if(!self.ajax_waiting())return;if(self.more_initial_call){self.more_initial_call=false;self.div_more=$("<div></div>").addClass("more").html(res["ajx_more"]).appendTo(self.container);$("<p></p>").addClass("cb").appendTo(self.container)}else self.div_more.html(res["ajx_more"]);self.div_more.before(res["ajx_html"])}},true)};Message_flow_list.prototype.act=function(act,message_id){var self=this;switch(act){case"hide":case"show":if(confirm(txt_uvereny)){if(!self.ajax_ready())return;self.o.message_id=message_id;self.o.act=act;JsHttpRequest.query(x_ajax_path+"ajax/message/flow/item",self.ajx_o(),function(res,err){if(res){if(!self.ajax_waiting())return;self.container.find("#message-"+self.o.message_id).html(res["ajx_html"])}},true)}break}};Message_flow_list.prototype.live_autoload=function(){var self=this;var w=$(window);w.on("scroll",function(){if($(document).height()-w.height()-w.scrollTop()<200)self.more()})};Message_flow_list.prototype.ajax_ready=function(action_on_delay){var self=this;if(self.ajax_status!=0)return false;self.ajax_status=1;clearTimeout(self.ajax_timer);self.ajax_timer=setTimeout(function(){if(typeof action_on_delay=="function")action_on_delay();alert(self.text.time_is_up);self.ajax_status=0},2E3);return true};Message_flow_list.prototype.ajax_waiting=function(){var self=this;if(self.ajax_status==0)return false;clearTimeout(self.ajax_timer);self.ajax_status=0;return true};function Messenger(){var self=this;self.text={send:'Îòïðàâèòü',time_is_up:'Âðåìÿ îæèäàíèÿ îòâåòà îò ñåðâåðà èñòåêëî. Ïîâòîðèòå ïîïûòêó ïîçæå.',wait:'Ïîäîæäèòå...'}
427self.max_length={email:255,name:40,text:2000}
428self.eventname='.messenger';self.elements=new Array();self.active_element={};self.memory_reset();self.ajax_timer;self.ajax_status=0;}
429Messenger.prototype.add_element=function(o){var self=this;self.elements.push(o);var k=self.elements.length-1;self.elements[k].element.on('click'+self.eventname,function(event){event.preventDefault();self.open_element(k);});}
430Messenger.prototype.open=function(o){var self=this;var is_popup=o.container===undefined;self.recipient_user_id=o.element.data('messenger-recipient-user-id')||0;self.recipient_site_id=o.element.data('messenger-recipient-site-id')||0;self.recipient_email_name=o.element.data('messenger-recipient-email-name')||0;self.obj_type=o.element.data('messenger-obj-type')||'';self.obj_id=o.element.data('messenger-obj-id')||0;if(!self.ajax_ready())return;
430JsHttpRequest.query(x_ajax_path+'ajax/message/messenger/item',{ajx_act:'get',ajx_recipient_user_id:self.recipient_user_id,ajx_recipient_site_id:self.recipient_site_id,ajx_recipient_email_name:self.recipient_email_name,ajx_obj_type:self.obj_type,ajx_obj_id:self.obj_id},function(res,err){if(res){if(!self.ajax_waiting())return;self.active_element=o;if(is_popup){html='<div class="popup_decor">'+res.ajx_html+'</div>';x_collection.popup.open({element:o.element,content:html,my:'left top',at:'left bottom',of:o.element,action:'none',delay:100,effect:'fade',duration:250,active_element_class:'',hide_before_show:true,modal:false});}else{html='<div>'+res.ajx_html+'</div>';o.container.html(html).hide().fadeIn(250);}
431self.memory_read();self.live();}},true);}
432Messenger.prototype.open_element=function(k){var self=this;self.open(self.elements[k]);}
433Messenger.prototype.send=function(){var self=this;var is_popup=self.active_element.container===undefined;var $form=is_popup?x_collection.popup.popup.find('form'):self.active_element.container.find('form');var test=self.test();if(test.ok){if(!self.ajax_ready())return;var $send_button=$form.find('input[name="f_btn_apply"]');$send_button.attr('value',self.text.wait).prop({disabled:true});JsHttpRequest.query(x_ajax_path+'ajax/message/messenger/item',{ajx_act:'send',ajx_recipient_user_id:self.recipient_user_id,ajx_recipient_site_id:self.recipient_site_id,ajx_recipient_email_name:self.recipient_email_name,ajx_text:test.text,ajx_file:test.file,ajx_sender_name:test.sender_name,ajx_sender_email:test.sender_email,ajx_private:test.private,ajx_obj_type:self.obj_type,ajx_obj_id:self.obj_id},function(res,err){if(res){if(!self.ajax_waiting()){$send_button.attr('value',self.text.send).prop({disabled:false});return;}
434if(res.ajx_html==''){$form.find('.message_inline_form_error').show();$send_button.attr('value',self.text.send).prop({disabled:false});}else{self.memory_reset();if(is_popup){html='<div class="popup_decor">'+res.ajx_html+'</div>';x_collection.popup.open({element:self.active_element.element,content:html,my:'left top',at:'left bottom',of:self.active_element.element,action:'none',delay:100,effect:'fade',duration:250,active_element_class:'',hide_before_show:true});}else{html='<div>'+res.ajx_html+'</div>';self.active_element.container.html(html).hide().fadeIn(250);}
435self.live();}}},true);}}
436Messenger.prototype.test=function(){var self=this,$input,$label,res={ok:true,file:false,text:'',sender_name:'',sender_email:'',private:'0'},is_popup=self.active_element.container===undefined,$form=is_popup?x_collection.popup.popup.find('form'):self.active_element.container.find('form');var $input=$form.find('textarea[name="f_text"]');res.text=$input.val();if(res.text==''){res.ok=false;}
437var $file=$form.find('input[name="f_file"]');if($file.length){res.file=$file[0];}
438var $input=$form.find('input[name="f_sender_name"]'),$label=$input.parent('div').siblings('label');if($input.length){res.sender_name=$input.val();if(res.sender_name==''){res.ok=false;$label.addClass('bad');}else{$label.removeClass('bad');}}
439var $input=$form.find('input[name="f_sender_email"]'),$label=$input.parent('div').siblings('label');if($input.length){res.sender_email=$input.val();if(res.sender_email==''){res.ok=false;$label.addClass('bad');}else{if(res.sender_email.match(/^[0-9a-z_\-\.]+@[0-9a-z_\-^\.]+\.[a-z]{2,6}$/i)){$label.removeClass('bad');}else{res.ok=false;$label.addClass('bad');}}}
440res.private=$form.find('input[name="f_private"]').prop('checked')?1:0;if(res.ok){$form.find('.message_inline_form_error').hide();}else{$form.find('.message_inline_form_error').show();}
441return res;}
442Messenger.prototype.live=function(){var self=this,is_popup=self.active_element.container===undefined,$form=is_popup?x_collection.popup.popup.find('form'):self.active_element.container.find('form');if($form.length&&!$form.hasClass('live')){$form.addClass('live');$form.find('textarea[name=f_text]').focusWithoutScrolling();$file=$form.find('input[name=f_file]');if($file.length){$file_i=$('<i></i>').insertAfter($file);$file_b=$('<b></b>').insertAfter($file);$file_span=$('<span></span>').insertAfter($file).hide();$file_reset=$form.find('input[name=f_file_reset]');$MAX_FILE_SIZE=$form.find('input[name=MAX_FILE_SIZE]');$file_b.html($file.attr('title'));$file_i.html($MAX_FILE_SIZE.data('title'));$file.on('change'+self.eventname,function(event){var filename=$file.val().split('\\').pop();if(filename.length>35){var extension=filename.split('.').pop();filename=filename.substring(0,35-1-extension.length)+'...'+extension;}
443if(filename){$file_span.text(filename).show();$file_b.hide();$file_i.hide();$file_reset.show();}else{$file_span.hide();$file_b.show();$file_i.show();$file_reset.hide();}});$file_reset.on('click'+self.eventname,function(event){$file.wrap('<form>').closest('form').get(0).reset();$file.unwrap().change();});}
444$form.find('input[name="f_btn_apply"]').on('click'+self.eventname,function(event){event.preventDefault();self.send();});$form.find('[data-memory=true]').on('keyup'+self.eventname+' change'+self.eventname,function(){self.memory_write();});if(is_popup){$form.find('input[name="f_btn_ok"]').on('click'+self.eventname,function(){x_collection.popup.close();});}else{$form.find('input[name="f_btn_ok"]').on('click'+self.eventname,function(){self.active_element.container.fadeOut(250,function(){self.active_element.container.empty();});});}}}
445Messenger.prototype.memory_write=function(){var self=this,$input,is_popup=self.active_element.container===undefined,$form=is_popup?x_collection.popup.popup.find('form'):self.active_element.container.find('form');self.memory_reset();$input=$form.find('textarea[name="f_text"]');if($input.length){self.memory.text=$input.val();}
446$input=$form.find('input[name="f_sender_name"]');
446if($input.length){self.memory.sender_name=$input.val();}
447$input=$form.find('input[name="f_sender_email"]');if($input.length){self.memory.sender_email=$input.val();}
448$input=$form.find('input[name="f_sender_email"]');self.memory.private=$form.find('input[name="f_private"]').prop('checked')?1:0;}
449Messenger.prototype.memory_read=function(){var self=this,$input,is_popup=self.active_element.container===undefined,$form=is_popup?x_collection.popup.popup.find('form'):self.active_element.container.find('form');$input=$form.find('textarea[name="f_text"]');if($input.length){$input.val(self.memory.text);}
450$input=$form.find('input[name="f_sender_name"]');if($input.length){$input.val(self.memory.sender_name);}
451$input=$form.find('input[name="f_sender_email"]');if($input.length){$input.val(self.memory.sender_email);}
452$input=$form.find('input[name="f_private"]').prop('checked',self.memory.private);}
453Messenger.prototype.memory_reset=function(){var self=this;self.memory={text:'',sender_name:'',sender_email:'',private:0};}
454Messenger.prototype.ajax_ready=function(){var self=this;if(self.ajax_status!=0)return false;self.ajax_status=1;clearTimeout(self.ajax_timer);self.ajax_timer=setTimeout(function(){alert(self.text.time_is_up);self.ajax_status=0;},2000);return true;}
455Messenger.prototype.ajax_waiting=function(){var self=this;if(self.ajax_status==0)return false;clearTimeout(self.ajax_timer);self.ajax_status=0;return true;}
456$(document).ready(function(){x_collection['messenger']=new Messenger();});function Message_private_list(o){var self=this;self.container=o.container;self.o={namespace:(o.namespace||''),act:(o.act||''),message_id:(o.message_id||0),recipient_user_id:(o.recipient_user_id||0),created_last:(o.created_last||0),offset:(o.offset||0)}
457self.text={send:'Îòïðàâèòü',time_is_up:'Âðåìÿ îæèäàíèÿ îòâåòà îò ñåðâåðà èñòåêëî. Ïîâòîðèòå ïîïûòêó ïîçæå.',wait:'Ïîäîæäèòå...'}
458self.max_length={email:255,name:40,text:2000}
459self.interval=5000;self.ajax_timer;self.ajax_status=0;self.ask_interval;self.send_timeout;return this;}
460Message_private_list.prototype.ajx_o=function(){var self=this;return{ajx_namespace:self.o.namespace,ajx_act:self.o.act,ajx_message_id:self.o.message_id,ajx_recipient_user_id:self.o.recipient_user_id,ajx_created_last:self.o.created_last,ajx_offset:self.o.offset}};Message_private_list.prototype.ajx_o_extended=function(){var self=this;return{ajx_namespace:self.o.namespace,ajx_act:self.o.act,ajx_message_id:self.o.message_id,ajx_recipient_user_id:self.o.recipient_user_id,ajx_created_last:self.o.created_last,ajx_offset:self.o.offset,ajx_text:self.o.text,ajx_file:self.o.file}};Message_private_list.prototype.start=function(){var self=this;self.live();self.start_ask_interval();}
461Message_private_list.prototype.start_ask_interval=function(){var self=this;self.ask_interval=setTimeout(function(){self.start_ask_interval();self.ask_for_message();},self.interval);}
462Message_private_list.prototype.ask_for_message=function(){var self=this;if(!self.ajax_ready())return;self.o.act="output";JsHttpRequest.query(x_ajax_path+"ajax/message/private/list",self.ajx_o(),function(res,err){if(res){if(!self.ajax_waiting())return;var recent_messages_count=0;var $form=self.container.find('form');for(recent_message_id in res['ajx_message_recent_list']){if($('#message-'+recent_message_id).length==0){$form.after('<div id="message-'+recent_message_id+'">'+res['ajx_message_recent_list'][recent_message_id]+'</div>');recent_messages_count++;}}
463if(recent_messages_count>0){self.beep();self.interval=5000;}else{self.interval=Math.round(self.interval*1.2);if(self.interval>120000){self.interval=120000;}}
464self.o.created_last=res['ajx_created_last'];}},true);};Message_private_list.prototype.send=function(){var self=this,$form=self.container.find('form');var test=self.test();if(test.ok){var $send_button=$form.find('input[name="f_btn_apply"]');$send_button.attr('value',self.text.wait).prop({disabled:true});var ajax_ready=self.ajax_ready({action_on_delay:function(){self.container.find('form').find('input[name="f_btn_apply"]').attr('value',self.text.send).prop({disabled:false});}});if(!ajax_ready){clearTimeout(self.send_timeout);self.send_timeout=setTimeout(function(){self.send();},2000);return;}
465self.o.act='send';self.o.text=test.text;self.o.file=test.file;JsHttpRequest.query(x_ajax_path+"ajax/message/private/list",self.ajx_o_extended(),function(res,err){if(res){if(!self.ajax_waiting())return;$form=self.container.find('form');$form.find('textarea[name=f_text]').val('');var $file=$form.find('input[name=f_file]');if($file.length){$file.wrap('<form>').closest('form').get(0).reset();$file.unwrap().change();}
466$form.find('input[name="f_btn_apply"]').attr('value',self.text.send).prop({disabled:false});var recent_messages_count=0;for(recent_message_id in res['ajx_message_recent_list']){if($('#message-'+recent_message_id).length==0){$form.after('<div id="message-'+recent_message_id+'">'+res['ajx_message_recent_list'][recent_message_id]+'</div>');recent_messages_count++;}}
467if(recent_messages_count>0){self.beep();self.interval=5000;}
468self.o.created_last=res['ajx_created_last'];}},true);}};Message_private_list.prototype.test=function(){var self=this,$input,$label,res={ok:true,text:'',file:false},$form=self.container.find('form');var $input=$form.find('textarea[name="f_text"]');res.text=$input.val();if(res.text==''){res.ok=false;}else{}
469var $file=$form.find('input[name="f_file"]');
469if($file.length){res.file=$file[0];}
470if(res.ok){$form.find('.message_inline_form_error').hide();}else{$form.find('.message_inline_form_error').show();}
471return res;}
472Message_private_list.prototype.live=function(){var self=this,$form=self.container.find('form');if($form.length&&!$form.hasClass('live')){$form.addClass('live');$form.find('textarea[name=f_text]').focusWithoutScrolling();$file=$form.find('input[name=f_file]');if($file.length){$file_i=$('<i></i>').insertAfter($file);$file_b=$('<b></b>').insertAfter($file);$file_span=$('<span></span>').insertAfter($file).hide();$file_reset=$form.find('input[name=f_file_reset]');$MAX_FILE_SIZE=$form.find('input[name=MAX_FILE_SIZE]');$file_b.html($file.attr('title'));$file_i.html($MAX_FILE_SIZE.data('title'));$file.on('change',function(event){var filename=$file.val().split('\\').pop();if(filename.length>35){var extension=filename.split('.').pop();filename=filename.substring(0,35-1-extension.length)+'...'+extension;}
473if(filename){$file_span.text(filename).show();$file_b.hide();$file_i.hide();$file_reset.show();}else{$file_span.hide();$file_b.show();$file_i.show();$file_reset.hide();}});$file_reset.on('click',function(event){$file.wrap('<form>').closest('form').get(0).reset();$file.unwrap().change();});}
474$form.find('input[name="f_btn_apply"]').on('click',function(event){event.preventDefault();self.send();});}}
475Message_private_list.prototype.ajax_ready=function(o){var self=this;if(self.ajax_status!=0)return false;self.ajax_status=1;clearTimeout(self.ajax_timer);self.ajax_timer=setTimeout(function(){o.action_on_delay();alert(self.text.time_is_up);self.ajax_status=0;},2000);return true;}
476Message_private_list.prototype.ajax_waiting=function(){var self=this;if(self.ajax_status==0)return false;clearTimeout(self.ajax_timer);self.ajax_status=0;return true;}
477Message_private_list.prototype.beep=function(){var self=this;var filename=x_ajax_path+'i/tick.mp3';var $sound=$('<audio autoplay="autoplay"><source src="'+filename+'" type="audio/mpeg"><embed hidden="true" autostart="true" loop="false" src="'+filename+'"></audio>');}
478function Message_public_list(o){var self=this;self.container=o.container;self.o={namespace:(o.namespace||''),act:(o.act||''),message_id:(o.message_id||0),parent_id:(o.parent_id||0),recipient_user_id:(o.recipient_user_id||0),recipient_site_id:(o.recipient_site_id||0),recipient_email_name:(o.recipient_email_name||''),obj_type:(o.obj_type||''),obj_id:(o.obj_id||0)}
479self.text={send:'Îòïðàâèòü',time_is_up:'Âðåìÿ îæèäàíèÿ îòâåòà îò ñåðâåðà èñòåêëî. Ïîâòîðèòå ïîïûòêó ïîçæå.',wait:'Ïîäîæäèòå...'}
480self.max_length={email:255,name:40,text:2000}
481self.ajax_timer;self.ajax_status=0;return this;}
482Message_public_list.prototype.ajx_o=function(){var self=this;return{ajx_namespace:self.o.namespace,ajx_act:self.o.act,ajx_message_id:self.o.message_id,ajx_parent_id:self.o.parent_id,ajx_recipient_user_id:self.o.recipient_user_id,ajx_recipient_site_id:self.o.recipient_site_id,ajx_recipient_email_name:self.o.recipient_email_name,ajx_obj_type:self.o.obj_type,ajx_obj_id:self.o.obj_id}};Message_public_list.prototype.ajx_o_extended=function(){var self=this;return{ajx_namespace:self.o.namespace,ajx_act:self.o.act,ajx_message_id:self.o.message_id,ajx_parent_id:self.o.parent_id,ajx_recipient_user_id:self.o.recipient_user_id,ajx_recipient_site_id:self.o.recipient_site_id,ajx_recipient_email_name:self.o.recipient_email_name,ajx_obj_type:self.o.obj_type,ajx_obj_id:self.o.obj_id,ajx_text:self.o.text,ajx_file:self.o.file,ajx_file_id:self.o.file_id,ajx_sender_name:self.o.sender_name,ajx_sender_email:self.o.sender_email,ajx_private:self.o.private}};Message_public_list.prototype.output=function(){var self=this;if(!self.ajax_ready())return;self.o.act='output';JsHttpRequest.query(x_ajax_path+'ajax/message/public/list',self.ajx_o(),function(res,err){if(res){if(!self.ajax_waiting())return;self.container.html(res['ajx_html']);self.live();}},true);}
483Message_public_list.prototype.act=function(act,message_id){var self=this;switch(act){case'hide':case'show':if(confirm(txt_uvereny)){if(!self.ajax_ready())return;self.o.message_id=message_id;self.o.act=act;JsHttpRequest.query(x_ajax_path+"ajax/message/public/item",self.ajx_o(),function(res,err){if(res){if(!self.ajax_waiting())return;self.container.find('#message-'+self.o.message_id).html(res["ajx_html"]);}},true);}
484break;}};Message_public_list.prototype.answer=function(parent_id){var self=this;self.o.message_id=0;self.o.parent_id=parent_id;self.output();}
485Message_public_list.prototype.edit=function(message_id){var self=this;self.o.message_id=message_id;self.output();}
486Message_public_list.prototype.send=function(){var self=this,$form=self.container.find('form'),$send_button=$form.find('input[name="f_btn_apply"]');var test=self.test();if(test.ok){if(!self.ajax_ready())return;$send_button.attr('value',self.text.wait).prop({disabled:true});self.o.act='send';self.o.text=test.text;self.o.file=test.file;self.o.file_id=test.file_id;self.o.sender_name=test.sender_name;self.o.sender_email=test.sender_email;self.o.private=test.private;JsHttpRequest.query(x_ajax_path+"ajax/message/public/list",self.ajx_o_extended(),function(res,err){if(res){if(!self.ajax_waiting())return;if(res.ajx_html_notice!=''){var html='<div class="popup_decor">'+res.ajx_html_notice+'</div>';x_collection.popup.open({element:$(window),content:html,my:'center',at:'center',of:$(window),action:'none',delay:100,effect:'fade',duration:250,active_element_class:'',hide_before_show:true,modal:false});var $form=x_collection.popup.popup.find('form');$form.find('input[name="f_btn_ok"]').on('click',function(){x_collection.popup.close();});}
487self.container.html(res['ajx_html']);self.live();}},true);}};Message_public_list.prototype.test=function(){var self=this,$input,$label,res={ok:true,file:false,file_id:0,text:'',sender_name:'',sender_email:'',private:0,parent_id:0},$form=self.container.find('form');var $input=$form.find('textarea[name="f_text"]');res.text=$input.val();var $file=$form.find('input[name="f_file"]');
487if($file.length){res.file=$file[0];}
488var $file_id=$form.find('input[name="f_file_id"]');if($file_id.length){res.file_id=$file_id.val();}
489if(res.text==''){res.ok=false;}
490var $input=$form.find('input[name="f_sender_name"]'),$label=$input.parent('div').siblings('label');if($input.length){res.sender_name=$input.val();if(res.sender_name==''){res.ok=false;$label.addClass('bad');}else{$label.removeClass('bad');}}
491var $input=$form.find('input[name="f_sender_email"]'),$label=$input.parent('div').siblings('label');if($input.length){res.sender_email=$input.val();if(res.sender_email==''){res.ok=false;$label.addClass('bad');}else{if(res.sender_email.match(/^[0-9a-z_\-\.]+@[0-9a-z_\-^\.]+\.[a-z]{2,6}$/i)){$label.removeClass('bad');}else{res.ok=false;$label.addClass('bad');}}}
492res.private=$form.find('input[name="f_private"]').prop('checked')?1:0;res.parent_id=parseInt($form.find('input[name="f_parent_id"]').val());if(isNaN(res.parent_id))res.parent_id=0;if(res.ok){$form.find('.message_inline_form_error').hide();}else{$form.find('.message_inline_form_error').show();}
493return res;}
494Message_public_list.prototype.live=function(){var self=this,$form=self.container.find('form');if($form.length&&!$form.hasClass('live')){$form.addClass('live');$file=$form.find('input[name=f_file]');if($file.length){$file_i=$('<i></i>').insertAfter($file);$file_b=$('<b></b>').insertAfter($file);$file_span=$('<span></span>').insertAfter($file).hide();$file_id=$form.find('input[name=f_file_id]');$file_reset=$form.find('input[name=f_file_reset]');$MAX_FILE_SIZE=$form.find('input[name=MAX_FILE_SIZE]');$file_b.html($file.attr('title'));$file_i.html($MAX_FILE_SIZE.data('title'));if($file_id.val()!='0'){$file_span.text($file_id.data('filename')).show();$file_b.hide();$file_i.hide();$file_reset.show();}
495$file.on('change',function(event){var filename=$file.val().split('\\').pop();if(filename.length>35){var extension=filename.split('.').pop();filename=filename.substring(0,35-1-extension.length)+'...'+extension;}
496if(filename){$file_span.text(filename).show();$file_b.hide();$file_i.hide();$file_reset.show();}else{$file_span.hide();$file_b.show();$file_i.show();$file_reset.hide();}});$file_reset.on('click',function(event){$file.wrap('<form>').closest('form').get(0).reset();$file.unwrap().change();$file_id.val(0);});}
497$form.find('input[name="f_btn_apply"]').on('click',function(event){event.preventDefault();self.send();});}}
498Message_public_list.prototype.ajax_ready=function(){var self=this;if(self.ajax_status!=0)return false;self.ajax_status=1;clearTimeout(self.ajax_timer);self.ajax_timer=setTimeout(function(){alert(self.text.time_is_up);self.ajax_status=0;},2000);return true;}
499Message_public_list.prototype.ajax_waiting=function(){var self=this;if(self.ajax_status==0)return false;clearTimeout(self.ajax_timer);self.ajax_status=0;return true;}
500Message_public_list.prototype.beep=function(){var self=this;var filename=x_ajax_path+'i/tick.mp3';var $sound=$('<audio autoplay="autoplay"><source src="'+filename+'" type="audio/mpeg"><embed hidden="true" autostart="true" loop="false" src="'+filename+'"></audio>');}
501function Page_list(o){var self=this;self.container=o.container;self.o={act:o.act||"",namespace:o.namespace||"",page_id:o.page_id||0,parent_id:o.parent_id||0};return this}
502Page_list.prototype.output=function(parent_id){var self=this;self.o.parent_id=parent_id;self.container.stop(true,true).fadeTo(200,0.1,function(){JsHttpRequest.query(x_ajax_path+"ajax/page/list/",{ajx_act:"output",ajx_namespace:self.o.namespace,ajx_page_id:self.o.page_id,ajx_parent_id:self.o.parent_id},function(res,err){if(res){self.container.stop(true,true).html(res["ajx_page_list"]).fadeTo(200,1);self.live()}},true)})};Page_list.prototype.order=function(arr){var self=this;JsHttpRequest.query(x_ajax_path+"ajax/page/list/",{ajx_act:"order",ajx_namespace:self.o.namespace,ajx_page_id:arr,ajx_parent_id:self.o.parent_id},function(res,err){if(res){self.container.html(res["ajx_page_list"]);self.live()}},true)};Page_list.prototype.hide=function(page_id){var self=this,pi=$("#page-service-"+self.o.page_id);self.o.page_id=page_id||self.o.page_id;pi.fadeTo(200,0.5,function(){if(confirm(txt_uvereny)){self.loader();JsHttpRequest.query(x_ajax_path+"ajax/page/item/",{ajx_act:"hide",ajx_namespace:self.o.namespace,ajx_page_id:self.o.page_id},function(res,err){if(res)pi.html(res["ajx_page_item"])},true)}else pi.css({"opacity":1}
502)})};Page_list.prototype.show=function(page_id){var self=this,pi=$("#page-service-"+self.o.page_id);self.o.page_id=page_id||self.o.page_id;pi.fadeTo(200,1,function(){if(confirm(txt_uvereny)){self.loader();JsHttpRequest.query(x_ajax_path+"ajax/page/item/",{ajx_act:"show",ajx_namespace:self.o.namespace,ajx_page_id:self.o.page_id},function(res,err){if(res)pi.html(res["ajx_page_item"])},true)}else pi.css({"opacity":0.5})})};Page_list.prototype.loader=function(page_id){var self=this;self.o.page_id=page_id||self.o.page_id;if(self.o.page_id!=0)$("#page-service-"+self.o.page_id).html(x_ajax_loader)};Page_list.prototype.live=function(){var self=this;self.container.find("span").css({"cursor":"move"});var tmp=self.o.parent_id==0?"#page-list":"#page-branch-"+parent_id;$(tmp).sortable({axis:"y",stop:function(event,ui){var arr=$(this).sortable("toArray");if(arr.length>1){arr=arr.join(";").replace(/[^0-9;]/g,"");self.order(arr)}}}).disableSelection()};function Page_block_list(o){var self=this;self.container=o.container;self.o={namespace:o.namespace||"",act:o.act||"",block_id:o.block_id||0,page_id:o.page_id||0};return this}
503Page_block_list.prototype.output=function(){var self=this;self.container.stop(true,true).fadeTo(200,0.1,function(){JsHttpRequest.query(x_ajax_path+"ajax/page/block/list/",{ajx_namespace:self.o.namespace,ajx_act:"output",ajx_block_id:self.o.block_id,ajx_page_id:self.o.page_id},function(res,err){if(res)self.container.stop(true,true).html(res["ajx_block_list"]).fadeTo(200,1)},true)})};Page_block_list.prototype.hide=function(block_id){var self=this,$item=$("#page-block-"+block_id);$item.fadeTo(200,0.5,function(){if(confirm(txt_uvereny)){$("#page-block-service-"+block_id).html(x_ajax_loader);JsHttpRequest.query(x_ajax_path+"ajax/page/block/item/",{ajx_namespace:self.o.namespace,ajx_act:"hide",ajx_block_id:block_id},function(res,err){if(res)$item.html(res["ajx_block_item"])},true)}else $item.stop(true,true).fadeTo(200,1)})};Page_block_list.prototype.show=function(block_id){var self=this,$item=$("#page-block-"+block_id);$item.fadeTo(200,1,function(){if(confirm(txt_uvereny)){$("#page-block-service-"+block_id).html(x_ajax_loader);JsHttpRequest.query(x_ajax_path+"ajax/page/block/item/",{ajx_namespace:self.o.namespace,ajx_act:"show",ajx_block_id:block_id},function(res,err){if(res)$item.html(res["ajx_block_item"])},true)}else $item.stop(true,true).fadeTo(200,0.5)})};Page_block_list.prototype.remove=function(block_id){var self=this,$item=$("#page-block-"+block_id);$item.fadeTo(200,0.2,function(){if(confirm(txt_uvereny)){$("#page-block-service-"+block_id).html(x_ajax_loader);JsHttpRequest.query(x_ajax_path+"ajax/page/block/item/",{ajx_namespace:self.o.namespace,ajx_act:"remove",ajx_block_id:block_id},function(res,err){if(res)$item.stop(true,true).slideUp(200)},true)}else $item.stop(true,true).fadeTo(200,0.5)})};Page_block_list.prototype.up=function(block_id){var self=this;self.container.fadeTo(200,0.5,function(){JsHttpRequest.query(x_ajax_path+"ajax/page/block/list/",{ajx_namespace:self.o.namespace,ajx_act:"up",ajx_block_id:block_id,ajx_page_id:self.o.page_id},function(res,err){if(res)self.container.stop(true,true).html(res["ajx_block_list"]).fadeTo(200,1)},true)})};Page_block_list.prototype.down=function(block_id){var self=this;self.container.fadeTo(200,0.5,function(){JsHttpRequest.query(x_ajax_path+"ajax/page/block/list/",{ajx_namespace:self.o.namespace,ajx_act:"down",ajx_block_id:block_id,ajx_page_id:self.o.page_id},function(res,err){if(res)self.container.stop(true,true).html(res["ajx_block_list"]).fadeTo(200,1)},true)})};function Site_list(o){var self=this;self.container=o.container;self.o={namespace:(o.namespace||''),act:(o.act||''),site_id:(o.site_id||0),area_id:(o.area_id||0),tag:(o.tag||''),is_readonly:(o.is_readonly||false),is_redirect:(o.is_redirect||false),is_short:(o.is_short||false),is_static:(o.is_static||false),offset:(o.offset||0),area_id_end:(o.area_id_end||0)}
504self.analytics_group=o.analytics_group===undefined?0:o.analytics_group;self.more_initial_call=true;return this;}
505Site_list.prototype.ajx_o=function(){var self=this;return{ajx_namespace:self.o.namespace,ajx_act:self.o.act,ajx_site_id:self.o.site_id,ajx_area_id:self.o.area_id,ajx_tag:self.o.tag,ajx_is_readonly:self.o.is_readonly,ajx_is_redirect:self.o.is_redirect,ajx_is_short:self.o.is_short,ajx_is_static:self.o.is_static,ajx_offset:self.o.offset,ajx_area_id_end:self.o.area_id_end}};Site_list.prototype.output=function(){var self=this;self.o.act="output";self.container.stop(true,true).fadeTo(200,0.1,function(){JsHttpRequest.query(x_ajax_path+"ajax/site/list",self.ajx_o(),function(res,err){if(res){self.container.stop(true,true).html(res['ajx_site_list']).fadeTo(200,1);self.o.area_id_end=res["ajx_area_id_end"];self.live();}},true);});};Site_list.prototype.start=function(){var self=this;self.o.offset=0;self.o.ajx_area_id=0;self.o.act="start";self.container.stop(true,true).fadeTo(200,0.1,function(){JsHttpRequest.query(x_ajax_path+"ajax/site/list",self.ajx_o(),function(res,err){if(res){self.more_initial_call=false;self.o.offset=1;self.container.empty();self.div_more=$("<div></div>").addClass("more").html(res["ajx_site_more"]).appendTo(self.container);$('<p class="cb"></p>').appendTo(self.container);self.div_more.before(res["ajx_site_list"]);self.o.area_id_end=res["ajx_area_id_end"];self.container.stop(true,true).fadeTo(200,1);self.live();}},true);});};Site_list.prototype.more=function(){var self=this;x_analytics('site_more');self.o.act="more";if(self.more_initial_call){}else{self.container.children(".x").removeClass("x");self.o.offset=self.o.offset+1;}
506JsHttpRequest.query(x_ajax_path+"ajax/site/list",self.ajx_o(),function(res,err){if(res){if(self.more_initial_call){self.more_initial_call=false;self.div_more=$("<div></div>").addClass("more").html(res["ajx_site_more"]).appendTo(self.container);$("<p></p>").addClass("cb").appendTo(self.container);}else{self.div_more.html(res["ajx_site_more"]);}
507self.div_more.before(res["ajx_site_list"]);self.o.area_id_end=res["ajx_area_id_end"];self.live();}},true);};Site_list.prototype.hide=function(site_id){var self=this,$item=self.container.find('#site-'+site_id);self.o.act="hide";self.o.site_id=site_id;$item.fadeTo(200,.5,function(){if(confirm(txt_uvereny)){$('#site-service-'+site_id).html('<hr class="above">'+x_ajax_loader+'<p class="cb"></p>');
507JsHttpRequest.query(x_ajax_path+'ajax/site/item',self.ajx_o(),function(res,err){if(res){$item.html(res['ajx_site_item']);}},true);}else{$item.stop(true,true).fadeTo(200,1);}});}
508Site_list.prototype.show=function(site_id){var self=this,$item=self.container.find('#site-'+site_id);self.o.act="show";self.o.site_id=site_id;$item.fadeTo(200,1,function(){if(confirm(txt_uvereny)){$('#site-service-'+site_id).html('<hr class="above">'+x_ajax_loader+'<p class="cb"></p>');JsHttpRequest.query(x_ajax_path+'ajax/site/item',self.ajx_o(),function(res,err){if(res){$item.html(res['ajx_site_item']);}},true);}else{$item.stop(true,true).fadeTo(200,.5);}});}
509Site_list.prototype.remove=function(site_id){var self=this,$item=self.container.find('#site-'+site_id);self.o.act="remove";self.o.site_id=site_id;$item.fadeTo(200,.2,function(){if(confirm(txt_uvereny)){$('#site-service-'+site_id).html('<hr class="above">'+x_ajax_loader+'<p class="cb"></p>');JsHttpRequest.query(x_ajax_path+'ajax/site/item',self.ajx_o(),function(res,err){if(res){$item.stop(true,true).slideUp(200);}},true);}else{$item.stop(true,true).fadeTo(200,.5);}});}
510Site_list.prototype.tag=function(tag){var self=this;self.o.tag=tag;self.o.offset=0;self.container.empty();self.output();}
511Site_list.prototype.live=function(){var self=this;}
512Site_list.prototype.live_alphabet=function(){var self=this;$alphabet=self.container.children('.alphabet');if($alphabet.length&&!$alphabet.hasClass('live')){$alphabet.addClass('live').on('click',function(event){var $target=$(event.target),$a=$target.closest('a');if($a.length&&$a.data('search')!==undefined){event.preventDefault();x_collection['search_suggestion'].set_search($a.data('search'));}});}}
513function Site_list_recent(o){var self=this;self.container=o.container;self.o={namespace:(o.namespace||''),act:(o.act||''),site_id:(o.site_id||0),area_id:(o.area_id||0),offset:(o.offset||0)}
514self.more_initial_call=true;return this;}
515Site_list_recent.prototype.ajx_o=function(){var self=this;return{ajx_namespace:self.o.namespace,ajx_act:self.o.act,ajx_site_id:self.o.site_id,ajx_area_id:self.o.area_id,ajx_offset:self.o.offset}};Site_list_recent.prototype.output=function(){var self=this;self.o.act="output";self.container.stop(true,true).fadeTo(200,0.1,function(){JsHttpRequest.query(x_ajax_path+"ajax/site/list-recent",self.ajx_o(),function(res,err){if(res){self.container.stop(true,true).html(res['ajx_site_list_recent']).fadeTo(200,1);}},true);});};Site_list_recent.prototype.start=function(){var self=this;self.o.offset=0;self.o.act="start";self.container.stop(true,true).fadeTo(200,0.1,function(){JsHttpRequest.query(x_ajax_path+"ajax/site/list-recent",self.ajx_o(),function(res,err){if(res){self.more_initial_call=false;self.o.offset=1;self.container.empty();self.div_more=$("<div></div>").addClass("more").html(res["ajx_site_more_recent"]).appendTo(self.container);$('<p class="cb"></p>').appendTo(self.container);self.div_more.before(res["ajx_site_list_recent"]);self.container.stop(true,true).fadeTo(200,1);}},true);});};Site_list_recent.prototype.more=function(){var self=this;x_analytics('site_more');self.o.act="more";if(self.more_initial_call){}else{self.container.children(".x").removeClass("x");self.o.offset=self.o.offset+1;}
516JsHttpRequest.query(x_ajax_path+"ajax/site/list-recent",self.ajx_o(),function(res,err){if(res){if(self.more_initial_call){self.more_initial_call=false;self.div_more=$("<div></div>").addClass("more").html(res["ajx_site_more_recent"]).appendTo(self.container);$("<p></p>").addClass("cb").appendTo(self.container);}else{self.div_more.html(res["ajx_site_more_recent"]);}
517self.div_more.before(res["ajx_site_list_recent"]);}},true);};function Site_list_adm(o){var self=this;self.container=o.container;self.o={namespace:o.namespace||"",act:o.act||"",site_id:o.site_id||0,site_type:o.site_type||0,filter:o.filter||"",offset:o.offset||0};return self}
518Site_list_adm.prototype.ajx_o=function(){var self=this;return{ajx_namespace:self.o.namespace,ajx_act:self.o.act,ajx_site_id:self.o.site_id,ajx_site_type:self.o.site_type,ajx_filter:self.o.filter,ajx_offset:self.o.offset}};Site_list_adm.prototype.output=function(){var self=this;self.o.act="output";self.container.stop(true,true).fadeTo(200,0.1,function(){JsHttpRequest.query(x_ajax_path+"ajax/site/list-adm",self.ajx_o(),function(res,err){if(res){self.container.stop(true,true).html(res["ajx_site_list_adm"]).fadeTo(200,1);if(self.o.filter!='')self.container.children('ul').highlight(self.o.filter);}},true);});};Site_list_adm.prototype.site_type=function(site_type){var self=this;self.o.offset=0;if(site_type=="a")self.o.filter="";self.o.site_type=site_type;self.output();};Site_list_adm.prototype.filter=function(parameter=''){var self=this;self.o.offset=0;self.o.filter=self.container.find('input[name="filter"]').val();if(parameter!='')self.o.filter=parameter+'/'+self.o.filter;self.output();};Site_list_adm.prototype.offset=function(offset){var self=this;self.o.offset=offset;self.output();};
518function Dadata_list(options){var self=this;self.text={}
519self.eventname='.dadata_list';self.element_input=options.element_input;self.element_list=options.element_list;self.callback=options.callback;self.data=[];self.pattern='';self.cursor=0;self.status=0;var pattern=self.element_input.val();self.pattern_effective=pattern;self.element_input.on('focus'+self.eventname,function(event){self.input_focus(event);}).on('blur'+self.eventname,function(event){self.input_blur(event);}).on('change'+self.eventname+' keyup'+self.eventname,function(event){self.input_change(event);}).on('keydown'+self.eventname,function(event){self.input_keydown(event);});self.element_list.on('click'+self.eventname,function(event){self.element_list_click(event);});}
520Dadata_list.prototype.input_focus=function(event){var self=this;clearTimeout(self.timeout_focus);self.element_list.show();}
521Dadata_list.prototype.input_blur=function(event){var self=this;clearTimeout(self.timeout_focus);self.timeout_focus=setTimeout(function(){self.element_list.hide();},300);}
522Dadata_list.prototype.input_change=function(event){var self=this;var pattern=self.element_input.val();clearTimeout(self.timeout_input_change);self.timeout_input_change=setTimeout(function(){self.get_list();},400);}
523Dadata_list.prototype.input_keydown=function(event){var self=this;if(self.element_list.is(':visible')){switch(event.keyCode){case 13:event.preventDefault();var $a=self.element_list.find('a.a');self.pattern_effective=$a.data('title');self.element_input.val($a.data('title')).change();self.callback(self.data[parseInt($a.data('i'))]);self.element_list.hide();return false;case 38:event.preventDefault();var $autocomplete=self.element_list.find('a'),n=$autocomplete.length;if(self.cursor>1)self.cursor--;if(self.cursor>n)self.cursor=n;$autocomplete.removeClass('a');$autocomplete.eq(self.cursor-1).addClass('a');break;case 40:event.preventDefault();var $autocomplete=self.element_list.find('a'),n=$autocomplete.length;if(self.cursor<n)self.cursor++;if(self.cursor<1)self.cursor=1;$autocomplete.removeClass('a');$autocomplete.eq(self.cursor-1).addClass('a');break;}}}
524Dadata_list.prototype.element_list_click=function(event){var self=this;var $a=$(event.target).closest('a');if($a.length){event.preventDefault();self.pattern_effective=$a.data('title');self.element_input.val($a.data('title')).change();self.callback(self.data[parseInt($a.data('i'))]);}}
525Dadata_list.prototype.set_search=function(search){var self=this;self.element_input.val(search);self.get_list();}
526Dadata_list.prototype.get_list=function(){var self=this;if(self.status==0){self.status=1;var pattern=self.element_input.val();pattern=pattern.replace(/[.*+?^${}()|[\]\\]/g,'\\$&');if(self.pattern_effective!=pattern){self.pattern_effective=pattern;if(self.pattern_effective.length>2){JsHttpRequest.query(x_ajax_path+'ajax/site/dadata/list',{ajx_act:'output',ajx_pattern:self.pattern_effective},function(res,err){if(res){self.data=res;var h='',replace='$1<b>$2</b>$3',pattern="(.*?)("+self.pattern_effective+")(.*)",regex=new RegExp(pattern,"img");for(var i=0;i<res.length;i++){h+='<li><a data-title="'+res[i].title+'" data-operational_status="'+res[i].operational_status.status+'" data-i="'+i+'">'+res[i].text.replace(regex,replace)+'</a></li>';}
527self.element_list.html('<ul>'+h+'</ul>');self.status=0;}},true);}else{self.element_list.html('');self.status=0;}}else{self.status=0;}}else if(self.status==1){clearTimeout(self.timeout_get_list);self.timeout_get_list=setTimeout(function(){self.get_list();},1000);}}
528function SVM_control(o){var self=this;self.o={act:'',obj_type:'',obj_id:0,}
529self.text={time_is_up:'Âðåìÿ îæèäàíèÿ îòâåòà îò ñåðâåðà èñòåêëî. Ïîâòîðèòå ïîïûòêó ïîçæå.'}
530self.ajax_timer;self.ajax_status=0;return this;}
531SVM_control.prototype.ajx_o=function(){var self=this;return{ajx_act:self.o.act,ajx_obj_type:self.o.obj_type,ajx_obj_id:self.o.obj_id}}
532SVM_control.prototype.output=function(obj_type,obj_id){var self=this;if(!self.ajax_ready())return;self.o.act='output';self.o.obj_type=obj_type;self.o.obj_id=obj_id;$('#svm-'+self.o.obj_type+'-'+self.o.obj_id).stop(true,true).fadeTo(200,.1);
532JsHttpRequest.query(x_ajax_path+'ajax/svm/control',self.ajx_o(),function(res,err){if(res){if(!self.ajax_waiting())return;$('#svm-'+self.o.obj_type+'-'+self.o.obj_id).html(res.ajx_html).stop(true,true).fadeTo(200,1);}},true);}
533SVM_control.prototype.act=function(act,obj_type,obj_id){var self=this;switch(act){case'positive':case'negative':case'reset':if(!self.ajax_ready())return;self.o.act=act;self.o.obj_type=obj_type;self.o.obj_id=obj_id;$('#svm-'+self.o.obj_type+'-'+self.o.obj_id).stop(true,true).fadeTo(200,.5);JsHttpRequest.query(x_ajax_path+'ajax/svm/control',self.ajx_o(),function(res,err){if(res){if(!self.ajax_waiting())return;$('#svm-'+self.o.obj_type+'-'+self.o.obj_id).html(res.ajx_html).stop(true,true).fadeTo(200,1);}},true);break;}};SVM_control.prototype.ajax_ready=function(action_on_delay){var self=this;if(self.ajax_status!=0)return false;self.ajax_status=1;clearTimeout(self.ajax_timer);self.ajax_timer=setTimeout(function(){if(typeof action_on_delay=='function'){action_on_delay();}
534alert(self.text.time_is_up);self.ajax_status=0;},2000);return true;}
535SVM_control.prototype.ajax_waiting=function(){var self=this;if(self.ajax_status==0)return false;clearTimeout(self.ajax_timer);self.ajax_status=0;return true;}
536$(document).ready(function(){x_collection['svm_control']=new SVM_control();});function Tag_list(o){var self=this;self.container=o.container;self.o={namespace:o.namespace||'',act:o.act||'',tag_id:o.tag_id||0,filter:o.filter||'',offset:o.offset||0};return self;}
537Tag_list.prototype.ajx_o=function(){var self=this;return{ajx_namespace:self.o.namespace,ajx_act:self.o.act,ajx_tag_id:self.o.tag_id,ajx_filter:self.o.filter,ajx_offset:self.o.offset}};Tag_list.prototype.output=function(){var self=this;self.o.act='output';self.container.stop(true,true).fadeTo(200,.1,function(){JsHttpRequest.query(x_ajax_path+'ajax/tag/list',self.ajx_o(),function(res,err){if(res){self.container.stop(true,true).html(res['ajx_tag_list']).fadeTo(200,1);}},true);});};Tag_list.prototype.filter=function(){var self=this;self.o.filter=self.container.find('input[name="filter"]').val();self.output();};Tag_list.prototype.offset=function(offset){var self=this;self.o.offset=offset;self.output();};Tag_list.prototype.remove=function(tag_id){var self=this;self.o.act='remove';self.o.tag_id=tag_id;var $item=$("#tag-"+self.o.tag_id);$item.fadeTo(200,0.5,function(){if(confirm(txt_uvereny)){$("#tag-service-"+self.o.tag_id).html(x_ajax_loader+'<p class="cb"></p>');JsHttpRequest.query(x_ajax_path+'ajax/tag/act',self.ajx_o(),function(res,err){if(res){$item.stop(true,true).slideUp(200);}},true);}else{$item.css({'opacity':1});}});};function User_list(o){var self=this;self.container=o.container;self.o={namespace:o.namespace||"",act:o.act||"",user_id:o.user_id||0,user_type:o.user_type||0,filter:o.filter||"",offset:o.offset||0};return self}User_list.prototype.ajx_o=function(){var self=this;return{ajx_namespace:self.o.namespace,ajx_act:self.o.act,ajx_user_id:self.o.user_id,ajx_user_type:self.o.user_type,ajx_filter:self.o.filter,ajx_offset:self.o.offset}};User_list.prototype.output=function(){var self=this;self.o.act="output";self.container.stop(true,true).fadeTo(200,0.1,function(){JsHttpRequest.query(x_ajax_path+"ajax/user/list",self.ajx_o(),function(res,err){if(res)self.container.stop(true,true).html(res["ajx_user_list"]).fadeTo(200,1)},true)})};User_list.prototype.user_type=function(user_type){var self=this;self.o.offset=0;if(user_type=="a")self.o.filter="";self.o.user_type=user_type;self.output()};User_list.prototype.filter=function(){var self=this;self.o.offset=0;self.o.filter=self.container.find('input[name="filter"]').val();self.output()};User_list.prototype.offset=function(offset){var self=this;self.o.offset=offset;self.output()};$(document).ready(function(){$(document).on('click',function(event){var $target=$(event.target);if($target.hasClass('username')){var user_id=$target.data('user-id');if(user_id!==undefined)location.href=x_collection.url_home+'user/'+user_id;}});});

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