diff --git a/templates/client/blank.html b/templates/client/blank.html index 4798acf0..a479ae7a 100644 --- a/templates/client/blank.html +++ b/templates/client/blank.html @@ -37,8 +37,9 @@ This template include basic anf main styles and js files, - - + + + @@ -135,48 +136,9 @@ This template include basic anf main styles and js files, - - - - - {% if not request.user.is_anonymous %} - {% if not request.user.url %} - - - {% endif %} -{% endif %} - - - - - - - - + - - {% block pre_scripts %} - {% endblock %} - - {% if not request.user.is_anonymous %} - {% if not request.user.url %} - - - {% endif %} - {% endif %} - - - - {% block scripts %} - {% endblock %} -{% comment %} -{% if not request.user.is_anonymous %} - {% if not request.user.url %} - - {% endif %} -{% endif %} -{% endcomment %} diff --git a/templates/client/static_client/js/app.js b/templates/client/static_client/js/app.js new file mode 100644 index 00000000..99795376 --- /dev/null +++ b/templates/client/static_client/js/app.js @@ -0,0 +1,2562 @@ +// Avoid `console` errors in browsers that lack a console. +(function() { + var method; + var noop = function () {}; + var methods = [ + 'assert', 'clear', 'count', 'debug', 'dir', 'dirxml', 'error', + 'exception', 'group', 'groupCollapsed', 'groupEnd', 'info', 'log', + 'markTimeline', 'profile', 'profileEnd', 'table', 'time', 'timeEnd', + 'timeStamp', 'trace', 'warn' + ]; + var length = methods.length; + var console = (window.console = window.console || {}); + + while (length--) { + method = methods[length]; + + // Only stub undefined methods. + if (!console[method]) { + console[method] = noop; + } + } +}()); + +// Place any jQuery/helper plugins in here. + +/* +Copyright 2014 Igor Vaynberg + +Version: 3.5.1 Timestamp: Tue Jul 22 18:58:56 EDT 2014 + +This software is licensed under the Apache License, Version 2.0 (the "Apache License") or the GNU +General Public License version 2 (the "GPL License"). You may choose either license to govern your +use of this software only upon the condition that you accept all of the terms of either the Apache +License or the GPL License. + +You may obtain a copy of the Apache License and the GPL License at: + +http://www.apache.org/licenses/LICENSE-2.0 +http://www.gnu.org/licenses/gpl-2.0.html + +Unless required by applicable law or agreed to in writing, software distributed under the Apache License +or the GPL Licesnse is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, +either express or implied. See the Apache License and the GPL License for the specific language governing +permissions and limitations under the Apache License and the GPL License. +*/ +!function(a){"undefined"==typeof a.fn.each2&&a.extend(a.fn,{each2:function(b){for(var c=a([0]),d=-1,e=this.length;++dc;c+=1)if(r(a,b[c]))return c;return-1}function q(){var b=a(l);b.appendTo("body");var c={width:b.width()-b[0].clientWidth,height:b.height()-b[0].clientHeight};return b.remove(),c}function r(a,c){return a===c?!0:a===b||c===b?!1:null===a||null===c?!1:a.constructor===String?a+""==c+"":c.constructor===String?c+""==a+"":!1}function s(b,c){var d,e,f;if(null===b||b.length<1)return[];for(d=b.split(c),e=0,f=d.length;f>e;e+=1)d[e]=a.trim(d[e]);return d}function t(a){return a.outerWidth(!1)-a.width()}function u(c){var d="keyup-change-value";c.on("keydown",function(){a.data(c,d)===b&&a.data(c,d,c.val())}),c.on("keyup",function(){var e=a.data(c,d);e!==b&&c.val()!==e&&(a.removeData(c,d),c.trigger("keyup-change"))})}function v(c){c.on("mousemove",function(c){var d=i;(d===b||d.x!==c.pageX||d.y!==c.pageY)&&a(c.target).trigger("mousemove-filtered",c)})}function w(a,c,d){d=d||b;var e;return function(){var b=arguments;window.clearTimeout(e),e=window.setTimeout(function(){c.apply(d,b)},a)}}function x(a,b){var c=w(a,function(a){b.trigger("scroll-debounced",a)});b.on("scroll",function(a){p(a.target,b.get())>=0&&c(a)})}function y(a){a[0]!==document.activeElement&&window.setTimeout(function(){var d,b=a[0],c=a.val().length;a.focus();var e=b.offsetWidth>0||b.offsetHeight>0;e&&b===document.activeElement&&(b.setSelectionRange?b.setSelectionRange(c,c):b.createTextRange&&(d=b.createTextRange(),d.collapse(!1),d.select()))},0)}function z(b){b=a(b)[0];var c=0,d=0;if("selectionStart"in b)c=b.selectionStart,d=b.selectionEnd-c;else if("selection"in document){b.focus();var e=document.selection.createRange();d=document.selection.createRange().text.length,e.moveStart("character",-b.value.length),c=e.text.length-d}return{offset:c,length:d}}function A(a){a.preventDefault(),a.stopPropagation()}function B(a){a.preventDefault(),a.stopImmediatePropagation()}function C(b){if(!h){var c=b[0].currentStyle||window.getComputedStyle(b[0],null);h=a(document.createElement("div")).css({position:"absolute",left:"-10000px",top:"-10000px",display:"none",fontSize:c.fontSize,fontFamily:c.fontFamily,fontStyle:c.fontStyle,fontWeight:c.fontWeight,letterSpacing:c.letterSpacing,textTransform:c.textTransform,whiteSpace:"nowrap"}),h.attr("class","select2-sizer"),a("body").append(h)}return h.text(b.val()),h.width()}function D(b,c,d){var e,g,f=[];e=a.trim(b.attr("class")),e&&(e=""+e,a(e.split(/\s+/)).each2(function(){0===this.indexOf("select2-")&&f.push(this)})),e=a.trim(c.attr("class")),e&&(e=""+e,a(e.split(/\s+/)).each2(function(){0!==this.indexOf("select2-")&&(g=d(this),g&&f.push(g))})),b.attr("class",f.join(" "))}function E(a,b,c,d){var e=o(a.toUpperCase()).indexOf(o(b.toUpperCase())),f=b.length;return 0>e?(c.push(d(a)),void 0):(c.push(d(a.substring(0,e))),c.push(""),c.push(d(a.substring(e,e+f))),c.push(""),c.push(d(a.substring(e+f,a.length))),void 0)}function F(a){var b={"\\":"\","&":"&","<":"<",">":">",'"':""","'":"'","/":"/"};return String(a).replace(/[&<>"'\/\\]/g,function(a){return b[a]})}function G(c){var d,e=null,f=c.quietMillis||100,g=c.url,h=this;return function(i){window.clearTimeout(d),d=window.setTimeout(function(){var d=c.data,f=g,j=c.transport||a.fn.select2.ajaxDefaults.transport,k={type:c.type||"GET",cache:c.cache||!1,jsonpCallback:c.jsonpCallback||b,dataType:c.dataType||"json"},l=a.extend({},a.fn.select2.ajaxDefaults.params,k);d=d?d.call(h,i.term,i.page,i.context):null,f="function"==typeof f?f.call(h,i.term,i.page,i.context):f,e&&"function"==typeof e.abort&&e.abort(),c.params&&(a.isFunction(c.params)?a.extend(l,c.params.call(h)):a.extend(l,c.params)),a.extend(l,{url:f,dataType:c.dataType,data:d,success:function(a){var b=c.results(a,i.page,i);i.callback(b)},error:function(a,b,c){var d={hasError:!0,jqXHR:a,textStatus:b,errorThrown:c};i.callback(d)}}),e=j.call(h,l)},f)}}function H(b){var d,e,c=b,f=function(a){return""+a.text};a.isArray(c)&&(e=c,c={results:e}),a.isFunction(c)===!1&&(e=c,c=function(){return e});var g=c();return g.text&&(f=g.text,a.isFunction(f)||(d=g.text,f=function(a){return a[d]})),function(b){var g,d=b.term,e={results:[]};return""===d?(b.callback(c()),void 0):(g=function(c,e){var h,i;if(c=c[0],c.children){h={};for(i in c)c.hasOwnProperty(i)&&(h[i]=c[i]);h.children=[],a(c.children).each2(function(a,b){g(b,h.children)}),(h.children.length||b.matcher(d,f(h),c))&&e.push(h)}else b.matcher(d,f(c),c)&&e.push(c)},a(c().results).each2(function(a,b){g(b,e.results)}),b.callback(e),void 0)}}function I(c){var d=a.isFunction(c);return function(e){var f=e.term,g={results:[]},h=d?c(e):c;a.isArray(h)&&(a(h).each(function(){var a=this.text!==b,c=a?this.text:this;(""===f||e.matcher(f,c))&&g.results.push(a?this:{id:this,text:this})}),e.callback(g))}}function J(b,c){if(a.isFunction(b))return!0;if(!b)return!1;if("string"==typeof b)return!0;throw new Error(c+" must be a string, function, or falsy value")}function K(b,c){if(a.isFunction(b)){var d=Array.prototype.slice.call(arguments,2);return b.apply(c,d)}return b}function L(b){var c=0;return a.each(b,function(a,b){b.children?c+=L(b.children):c++}),c}function M(a,c,d,e){var h,i,j,k,l,f=a,g=!1;if(!e.createSearchChoice||!e.tokenSeparators||e.tokenSeparators.length<1)return b;for(;;){for(i=-1,j=0,k=e.tokenSeparators.length;k>j&&(l=e.tokenSeparators[j],i=a.indexOf(l),!(i>=0));j++);if(0>i)break;if(h=a.substring(0,i),a=a.substring(i+l.length),h.length>0&&(h=e.createSearchChoice.call(this,h,c),h!==b&&null!==h&&e.id(h)!==b&&null!==e.id(h))){for(g=!1,j=0,k=c.length;k>j;j++)if(r(e.id(h),e.id(c[j]))){g=!0;break}g||d(h)}}return f!==a?a:void 0}function N(){var b=this;a.each(arguments,function(a,c){b[c].remove(),b[c]=null})}function O(b,c){var d=function(){};return d.prototype=new b,d.prototype.constructor=d,d.prototype.parent=b.prototype,d.prototype=a.extend(d.prototype,c),d}if(window.Select2===b){var c,d,e,f,g,h,j,k,i={x:0,y:0},c={TAB:9,ENTER:13,ESC:27,SPACE:32,LEFT:37,UP:38,RIGHT:39,DOWN:40,SHIFT:16,CTRL:17,ALT:18,PAGE_UP:33,PAGE_DOWN:34,HOME:36,END:35,BACKSPACE:8,DELETE:46,isArrow:function(a){switch(a=a.which?a.which:a){case c.LEFT:case c.RIGHT:case c.UP:case c.DOWN:return!0}return!1},isControl:function(a){var b=a.which;switch(b){case c.SHIFT:case c.CTRL:case c.ALT:return!0}return a.metaKey?!0:!1},isFunctionKey:function(a){return a=a.which?a.which:a,a>=112&&123>=a}},l="
",m={"\u24b6":"A","\uff21":"A","\xc0":"A","\xc1":"A","\xc2":"A","\u1ea6":"A","\u1ea4":"A","\u1eaa":"A","\u1ea8":"A","\xc3":"A","\u0100":"A","\u0102":"A","\u1eb0":"A","\u1eae":"A","\u1eb4":"A","\u1eb2":"A","\u0226":"A","\u01e0":"A","\xc4":"A","\u01de":"A","\u1ea2":"A","\xc5":"A","\u01fa":"A","\u01cd":"A","\u0200":"A","\u0202":"A","\u1ea0":"A","\u1eac":"A","\u1eb6":"A","\u1e00":"A","\u0104":"A","\u023a":"A","\u2c6f":"A","\ua732":"AA","\xc6":"AE","\u01fc":"AE","\u01e2":"AE","\ua734":"AO","\ua736":"AU","\ua738":"AV","\ua73a":"AV","\ua73c":"AY","\u24b7":"B","\uff22":"B","\u1e02":"B","\u1e04":"B","\u1e06":"B","\u0243":"B","\u0182":"B","\u0181":"B","\u24b8":"C","\uff23":"C","\u0106":"C","\u0108":"C","\u010a":"C","\u010c":"C","\xc7":"C","\u1e08":"C","\u0187":"C","\u023b":"C","\ua73e":"C","\u24b9":"D","\uff24":"D","\u1e0a":"D","\u010e":"D","\u1e0c":"D","\u1e10":"D","\u1e12":"D","\u1e0e":"D","\u0110":"D","\u018b":"D","\u018a":"D","\u0189":"D","\ua779":"D","\u01f1":"DZ","\u01c4":"DZ","\u01f2":"Dz","\u01c5":"Dz","\u24ba":"E","\uff25":"E","\xc8":"E","\xc9":"E","\xca":"E","\u1ec0":"E","\u1ebe":"E","\u1ec4":"E","\u1ec2":"E","\u1ebc":"E","\u0112":"E","\u1e14":"E","\u1e16":"E","\u0114":"E","\u0116":"E","\xcb":"E","\u1eba":"E","\u011a":"E","\u0204":"E","\u0206":"E","\u1eb8":"E","\u1ec6":"E","\u0228":"E","\u1e1c":"E","\u0118":"E","\u1e18":"E","\u1e1a":"E","\u0190":"E","\u018e":"E","\u24bb":"F","\uff26":"F","\u1e1e":"F","\u0191":"F","\ua77b":"F","\u24bc":"G","\uff27":"G","\u01f4":"G","\u011c":"G","\u1e20":"G","\u011e":"G","\u0120":"G","\u01e6":"G","\u0122":"G","\u01e4":"G","\u0193":"G","\ua7a0":"G","\ua77d":"G","\ua77e":"G","\u24bd":"H","\uff28":"H","\u0124":"H","\u1e22":"H","\u1e26":"H","\u021e":"H","\u1e24":"H","\u1e28":"H","\u1e2a":"H","\u0126":"H","\u2c67":"H","\u2c75":"H","\ua78d":"H","\u24be":"I","\uff29":"I","\xcc":"I","\xcd":"I","\xce":"I","\u0128":"I","\u012a":"I","\u012c":"I","\u0130":"I","\xcf":"I","\u1e2e":"I","\u1ec8":"I","\u01cf":"I","\u0208":"I","\u020a":"I","\u1eca":"I","\u012e":"I","\u1e2c":"I","\u0197":"I","\u24bf":"J","\uff2a":"J","\u0134":"J","\u0248":"J","\u24c0":"K","\uff2b":"K","\u1e30":"K","\u01e8":"K","\u1e32":"K","\u0136":"K","\u1e34":"K","\u0198":"K","\u2c69":"K","\ua740":"K","\ua742":"K","\ua744":"K","\ua7a2":"K","\u24c1":"L","\uff2c":"L","\u013f":"L","\u0139":"L","\u013d":"L","\u1e36":"L","\u1e38":"L","\u013b":"L","\u1e3c":"L","\u1e3a":"L","\u0141":"L","\u023d":"L","\u2c62":"L","\u2c60":"L","\ua748":"L","\ua746":"L","\ua780":"L","\u01c7":"LJ","\u01c8":"Lj","\u24c2":"M","\uff2d":"M","\u1e3e":"M","\u1e40":"M","\u1e42":"M","\u2c6e":"M","\u019c":"M","\u24c3":"N","\uff2e":"N","\u01f8":"N","\u0143":"N","\xd1":"N","\u1e44":"N","\u0147":"N","\u1e46":"N","\u0145":"N","\u1e4a":"N","\u1e48":"N","\u0220":"N","\u019d":"N","\ua790":"N","\ua7a4":"N","\u01ca":"NJ","\u01cb":"Nj","\u24c4":"O","\uff2f":"O","\xd2":"O","\xd3":"O","\xd4":"O","\u1ed2":"O","\u1ed0":"O","\u1ed6":"O","\u1ed4":"O","\xd5":"O","\u1e4c":"O","\u022c":"O","\u1e4e":"O","\u014c":"O","\u1e50":"O","\u1e52":"O","\u014e":"O","\u022e":"O","\u0230":"O","\xd6":"O","\u022a":"O","\u1ece":"O","\u0150":"O","\u01d1":"O","\u020c":"O","\u020e":"O","\u01a0":"O","\u1edc":"O","\u1eda":"O","\u1ee0":"O","\u1ede":"O","\u1ee2":"O","\u1ecc":"O","\u1ed8":"O","\u01ea":"O","\u01ec":"O","\xd8":"O","\u01fe":"O","\u0186":"O","\u019f":"O","\ua74a":"O","\ua74c":"O","\u01a2":"OI","\ua74e":"OO","\u0222":"OU","\u24c5":"P","\uff30":"P","\u1e54":"P","\u1e56":"P","\u01a4":"P","\u2c63":"P","\ua750":"P","\ua752":"P","\ua754":"P","\u24c6":"Q","\uff31":"Q","\ua756":"Q","\ua758":"Q","\u024a":"Q","\u24c7":"R","\uff32":"R","\u0154":"R","\u1e58":"R","\u0158":"R","\u0210":"R","\u0212":"R","\u1e5a":"R","\u1e5c":"R","\u0156":"R","\u1e5e":"R","\u024c":"R","\u2c64":"R","\ua75a":"R","\ua7a6":"R","\ua782":"R","\u24c8":"S","\uff33":"S","\u1e9e":"S","\u015a":"S","\u1e64":"S","\u015c":"S","\u1e60":"S","\u0160":"S","\u1e66":"S","\u1e62":"S","\u1e68":"S","\u0218":"S","\u015e":"S","\u2c7e":"S","\ua7a8":"S","\ua784":"S","\u24c9":"T","\uff34":"T","\u1e6a":"T","\u0164":"T","\u1e6c":"T","\u021a":"T","\u0162":"T","\u1e70":"T","\u1e6e":"T","\u0166":"T","\u01ac":"T","\u01ae":"T","\u023e":"T","\ua786":"T","\ua728":"TZ","\u24ca":"U","\uff35":"U","\xd9":"U","\xda":"U","\xdb":"U","\u0168":"U","\u1e78":"U","\u016a":"U","\u1e7a":"U","\u016c":"U","\xdc":"U","\u01db":"U","\u01d7":"U","\u01d5":"U","\u01d9":"U","\u1ee6":"U","\u016e":"U","\u0170":"U","\u01d3":"U","\u0214":"U","\u0216":"U","\u01af":"U","\u1eea":"U","\u1ee8":"U","\u1eee":"U","\u1eec":"U","\u1ef0":"U","\u1ee4":"U","\u1e72":"U","\u0172":"U","\u1e76":"U","\u1e74":"U","\u0244":"U","\u24cb":"V","\uff36":"V","\u1e7c":"V","\u1e7e":"V","\u01b2":"V","\ua75e":"V","\u0245":"V","\ua760":"VY","\u24cc":"W","\uff37":"W","\u1e80":"W","\u1e82":"W","\u0174":"W","\u1e86":"W","\u1e84":"W","\u1e88":"W","\u2c72":"W","\u24cd":"X","\uff38":"X","\u1e8a":"X","\u1e8c":"X","\u24ce":"Y","\uff39":"Y","\u1ef2":"Y","\xdd":"Y","\u0176":"Y","\u1ef8":"Y","\u0232":"Y","\u1e8e":"Y","\u0178":"Y","\u1ef6":"Y","\u1ef4":"Y","\u01b3":"Y","\u024e":"Y","\u1efe":"Y","\u24cf":"Z","\uff3a":"Z","\u0179":"Z","\u1e90":"Z","\u017b":"Z","\u017d":"Z","\u1e92":"Z","\u1e94":"Z","\u01b5":"Z","\u0224":"Z","\u2c7f":"Z","\u2c6b":"Z","\ua762":"Z","\u24d0":"a","\uff41":"a","\u1e9a":"a","\xe0":"a","\xe1":"a","\xe2":"a","\u1ea7":"a","\u1ea5":"a","\u1eab":"a","\u1ea9":"a","\xe3":"a","\u0101":"a","\u0103":"a","\u1eb1":"a","\u1eaf":"a","\u1eb5":"a","\u1eb3":"a","\u0227":"a","\u01e1":"a","\xe4":"a","\u01df":"a","\u1ea3":"a","\xe5":"a","\u01fb":"a","\u01ce":"a","\u0201":"a","\u0203":"a","\u1ea1":"a","\u1ead":"a","\u1eb7":"a","\u1e01":"a","\u0105":"a","\u2c65":"a","\u0250":"a","\ua733":"aa","\xe6":"ae","\u01fd":"ae","\u01e3":"ae","\ua735":"ao","\ua737":"au","\ua739":"av","\ua73b":"av","\ua73d":"ay","\u24d1":"b","\uff42":"b","\u1e03":"b","\u1e05":"b","\u1e07":"b","\u0180":"b","\u0183":"b","\u0253":"b","\u24d2":"c","\uff43":"c","\u0107":"c","\u0109":"c","\u010b":"c","\u010d":"c","\xe7":"c","\u1e09":"c","\u0188":"c","\u023c":"c","\ua73f":"c","\u2184":"c","\u24d3":"d","\uff44":"d","\u1e0b":"d","\u010f":"d","\u1e0d":"d","\u1e11":"d","\u1e13":"d","\u1e0f":"d","\u0111":"d","\u018c":"d","\u0256":"d","\u0257":"d","\ua77a":"d","\u01f3":"dz","\u01c6":"dz","\u24d4":"e","\uff45":"e","\xe8":"e","\xe9":"e","\xea":"e","\u1ec1":"e","\u1ebf":"e","\u1ec5":"e","\u1ec3":"e","\u1ebd":"e","\u0113":"e","\u1e15":"e","\u1e17":"e","\u0115":"e","\u0117":"e","\xeb":"e","\u1ebb":"e","\u011b":"e","\u0205":"e","\u0207":"e","\u1eb9":"e","\u1ec7":"e","\u0229":"e","\u1e1d":"e","\u0119":"e","\u1e19":"e","\u1e1b":"e","\u0247":"e","\u025b":"e","\u01dd":"e","\u24d5":"f","\uff46":"f","\u1e1f":"f","\u0192":"f","\ua77c":"f","\u24d6":"g","\uff47":"g","\u01f5":"g","\u011d":"g","\u1e21":"g","\u011f":"g","\u0121":"g","\u01e7":"g","\u0123":"g","\u01e5":"g","\u0260":"g","\ua7a1":"g","\u1d79":"g","\ua77f":"g","\u24d7":"h","\uff48":"h","\u0125":"h","\u1e23":"h","\u1e27":"h","\u021f":"h","\u1e25":"h","\u1e29":"h","\u1e2b":"h","\u1e96":"h","\u0127":"h","\u2c68":"h","\u2c76":"h","\u0265":"h","\u0195":"hv","\u24d8":"i","\uff49":"i","\xec":"i","\xed":"i","\xee":"i","\u0129":"i","\u012b":"i","\u012d":"i","\xef":"i","\u1e2f":"i","\u1ec9":"i","\u01d0":"i","\u0209":"i","\u020b":"i","\u1ecb":"i","\u012f":"i","\u1e2d":"i","\u0268":"i","\u0131":"i","\u24d9":"j","\uff4a":"j","\u0135":"j","\u01f0":"j","\u0249":"j","\u24da":"k","\uff4b":"k","\u1e31":"k","\u01e9":"k","\u1e33":"k","\u0137":"k","\u1e35":"k","\u0199":"k","\u2c6a":"k","\ua741":"k","\ua743":"k","\ua745":"k","\ua7a3":"k","\u24db":"l","\uff4c":"l","\u0140":"l","\u013a":"l","\u013e":"l","\u1e37":"l","\u1e39":"l","\u013c":"l","\u1e3d":"l","\u1e3b":"l","\u017f":"l","\u0142":"l","\u019a":"l","\u026b":"l","\u2c61":"l","\ua749":"l","\ua781":"l","\ua747":"l","\u01c9":"lj","\u24dc":"m","\uff4d":"m","\u1e3f":"m","\u1e41":"m","\u1e43":"m","\u0271":"m","\u026f":"m","\u24dd":"n","\uff4e":"n","\u01f9":"n","\u0144":"n","\xf1":"n","\u1e45":"n","\u0148":"n","\u1e47":"n","\u0146":"n","\u1e4b":"n","\u1e49":"n","\u019e":"n","\u0272":"n","\u0149":"n","\ua791":"n","\ua7a5":"n","\u01cc":"nj","\u24de":"o","\uff4f":"o","\xf2":"o","\xf3":"o","\xf4":"o","\u1ed3":"o","\u1ed1":"o","\u1ed7":"o","\u1ed5":"o","\xf5":"o","\u1e4d":"o","\u022d":"o","\u1e4f":"o","\u014d":"o","\u1e51":"o","\u1e53":"o","\u014f":"o","\u022f":"o","\u0231":"o","\xf6":"o","\u022b":"o","\u1ecf":"o","\u0151":"o","\u01d2":"o","\u020d":"o","\u020f":"o","\u01a1":"o","\u1edd":"o","\u1edb":"o","\u1ee1":"o","\u1edf":"o","\u1ee3":"o","\u1ecd":"o","\u1ed9":"o","\u01eb":"o","\u01ed":"o","\xf8":"o","\u01ff":"o","\u0254":"o","\ua74b":"o","\ua74d":"o","\u0275":"o","\u01a3":"oi","\u0223":"ou","\ua74f":"oo","\u24df":"p","\uff50":"p","\u1e55":"p","\u1e57":"p","\u01a5":"p","\u1d7d":"p","\ua751":"p","\ua753":"p","\ua755":"p","\u24e0":"q","\uff51":"q","\u024b":"q","\ua757":"q","\ua759":"q","\u24e1":"r","\uff52":"r","\u0155":"r","\u1e59":"r","\u0159":"r","\u0211":"r","\u0213":"r","\u1e5b":"r","\u1e5d":"r","\u0157":"r","\u1e5f":"r","\u024d":"r","\u027d":"r","\ua75b":"r","\ua7a7":"r","\ua783":"r","\u24e2":"s","\uff53":"s","\xdf":"s","\u015b":"s","\u1e65":"s","\u015d":"s","\u1e61":"s","\u0161":"s","\u1e67":"s","\u1e63":"s","\u1e69":"s","\u0219":"s","\u015f":"s","\u023f":"s","\ua7a9":"s","\ua785":"s","\u1e9b":"s","\u24e3":"t","\uff54":"t","\u1e6b":"t","\u1e97":"t","\u0165":"t","\u1e6d":"t","\u021b":"t","\u0163":"t","\u1e71":"t","\u1e6f":"t","\u0167":"t","\u01ad":"t","\u0288":"t","\u2c66":"t","\ua787":"t","\ua729":"tz","\u24e4":"u","\uff55":"u","\xf9":"u","\xfa":"u","\xfb":"u","\u0169":"u","\u1e79":"u","\u016b":"u","\u1e7b":"u","\u016d":"u","\xfc":"u","\u01dc":"u","\u01d8":"u","\u01d6":"u","\u01da":"u","\u1ee7":"u","\u016f":"u","\u0171":"u","\u01d4":"u","\u0215":"u","\u0217":"u","\u01b0":"u","\u1eeb":"u","\u1ee9":"u","\u1eef":"u","\u1eed":"u","\u1ef1":"u","\u1ee5":"u","\u1e73":"u","\u0173":"u","\u1e77":"u","\u1e75":"u","\u0289":"u","\u24e5":"v","\uff56":"v","\u1e7d":"v","\u1e7f":"v","\u028b":"v","\ua75f":"v","\u028c":"v","\ua761":"vy","\u24e6":"w","\uff57":"w","\u1e81":"w","\u1e83":"w","\u0175":"w","\u1e87":"w","\u1e85":"w","\u1e98":"w","\u1e89":"w","\u2c73":"w","\u24e7":"x","\uff58":"x","\u1e8b":"x","\u1e8d":"x","\u24e8":"y","\uff59":"y","\u1ef3":"y","\xfd":"y","\u0177":"y","\u1ef9":"y","\u0233":"y","\u1e8f":"y","\xff":"y","\u1ef7":"y","\u1e99":"y","\u1ef5":"y","\u01b4":"y","\u024f":"y","\u1eff":"y","\u24e9":"z","\uff5a":"z","\u017a":"z","\u1e91":"z","\u017c":"z","\u017e":"z","\u1e93":"z","\u1e95":"z","\u01b6":"z","\u0225":"z","\u0240":"z","\u2c6c":"z","\ua763":"z","\u0386":"\u0391","\u0388":"\u0395","\u0389":"\u0397","\u038a":"\u0399","\u03aa":"\u0399","\u038c":"\u039f","\u038e":"\u03a5","\u03ab":"\u03a5","\u038f":"\u03a9","\u03ac":"\u03b1","\u03ad":"\u03b5","\u03ae":"\u03b7","\u03af":"\u03b9","\u03ca":"\u03b9","\u0390":"\u03b9","\u03cc":"\u03bf","\u03cd":"\u03c5","\u03cb":"\u03c5","\u03b0":"\u03c5","\u03c9":"\u03c9","\u03c2":"\u03c3"};j=a(document),g=function(){var a=1;return function(){return a++}}(),d=O(Object,{bind:function(a){var b=this;return function(){a.apply(b,arguments)}},init:function(c){var d,e,f=".select2-results";this.opts=c=this.prepareOpts(c),this.id=c.id,c.element.data("select2")!==b&&null!==c.element.data("select2")&&c.element.data("select2").destroy(),this.container=this.createContainer(),this.liveRegion=a("",{role:"status","aria-live":"polite"}).addClass("select2-hidden-accessible").appendTo(document.body),this.containerId="s2id_"+(c.element.attr("id")||"autogen"+g()),this.containerEventName=this.containerId.replace(/([.])/g,"_").replace(/([;&,\-\.\+\*\~':"\!\^#$%@\[\]\(\)=>\|])/g,"\\$1"),this.container.attr("id",this.containerId),this.container.attr("title",c.element.attr("title")),this.body=a("body"),D(this.container,this.opts.element,this.opts.adaptContainerCssClass),this.container.attr("style",c.element.attr("style")),this.container.css(K(c.containerCss,this.opts.element)),this.container.addClass(K(c.containerCssClass,this.opts.element)),this.elementTabIndex=this.opts.element.attr("tabindex"),this.opts.element.data("select2",this).attr("tabindex","-1").before(this.container).on("click.select2",A),this.container.data("select2",this),this.dropdown=this.container.find(".select2-drop"),D(this.dropdown,this.opts.element,this.opts.adaptDropdownCssClass),this.dropdown.addClass(K(c.dropdownCssClass,this.opts.element)),this.dropdown.data("select2",this),this.dropdown.on("click",A),this.results=d=this.container.find(f),this.search=e=this.container.find("input.select2-input"),this.queryCount=0,this.resultsPage=0,this.context=null,this.initContainer(),this.container.on("click",A),v(this.results),this.dropdown.on("mousemove-filtered",f,this.bind(this.highlightUnderEvent)),this.dropdown.on("touchstart touchmove touchend",f,this.bind(function(a){this._touchEvent=!0,this.highlightUnderEvent(a)})),this.dropdown.on("touchmove",f,this.bind(this.touchMoved)),this.dropdown.on("touchstart touchend",f,this.bind(this.clearTouchMoved)),this.dropdown.on("click",this.bind(function(){this._touchEvent&&(this._touchEvent=!1,this.selectHighlighted())})),x(80,this.results),this.dropdown.on("scroll-debounced",f,this.bind(this.loadMoreIfNeeded)),a(this.container).on("change",".select2-input",function(a){a.stopPropagation()}),a(this.dropdown).on("change",".select2-input",function(a){a.stopPropagation()}),a.fn.mousewheel&&d.mousewheel(function(a,b,c,e){var f=d.scrollTop();e>0&&0>=f-e?(d.scrollTop(0),A(a)):0>e&&d.get(0).scrollHeight-d.scrollTop()+e<=d.height()&&(d.scrollTop(d.get(0).scrollHeight-d.height()),A(a))}),u(e),e.on("keyup-change input paste",this.bind(this.updateResults)),e.on("focus",function(){e.addClass("select2-focused")}),e.on("blur",function(){e.removeClass("select2-focused")}),this.dropdown.on("mouseup",f,this.bind(function(b){a(b.target).closest(".select2-result-selectable").length>0&&(this.highlightUnderEvent(b),this.selectHighlighted(b))})),this.dropdown.on("click mouseup mousedown touchstart touchend focusin",function(a){a.stopPropagation()}),this.nextSearchTerm=b,a.isFunction(this.opts.initSelection)&&(this.initSelection(),this.monitorSource()),null!==c.maximumInputLength&&this.search.attr("maxlength",c.maximumInputLength);var h=c.element.prop("disabled");h===b&&(h=!1),this.enable(!h);var i=c.element.prop("readonly");i===b&&(i=!1),this.readonly(i),k=k||q(),this.autofocus=c.element.prop("autofocus"),c.element.prop("autofocus",!1),this.autofocus&&this.focus(),this.search.attr("placeholder",c.searchInputPlaceholder)},destroy:function(){var a=this.opts.element,c=a.data("select2"),d=this;this.close(),a.length&&a[0].detachEvent&&a.each(function(){this.detachEvent("onpropertychange",d._sync)}),this.propertyObserver&&(this.propertyObserver.disconnect(),this.propertyObserver=null),this._sync=null,c!==b&&(c.container.remove(),c.liveRegion.remove(),c.dropdown.remove(),a.removeClass("select2-offscreen").removeData("select2").off(".select2").prop("autofocus",this.autofocus||!1),this.elementTabIndex?a.attr({tabindex:this.elementTabIndex}):a.removeAttr("tabindex"),a.show()),N.call(this,"container","liveRegion","dropdown","results","search")},optionToData:function(a){return a.is("option")?{id:a.prop("value"),text:a.text(),element:a.get(),css:a.attr("class"),disabled:a.prop("disabled"),locked:r(a.attr("locked"),"locked")||r(a.data("locked"),!0)}:a.is("optgroup")?{text:a.attr("label"),children:[],element:a.get(),css:a.attr("class")}:void 0},prepareOpts:function(c){var d,e,f,h,i=this;if(d=c.element,"select"===d.get(0).tagName.toLowerCase()&&(this.select=e=c.element),e&&a.each(["id","multiple","ajax","query","createSearchChoice","initSelection","data","tags"],function(){if(this in c)throw new Error("Option '"+this+"' is not allowed for Select2 when attached to a ","
"," ","
    ","
","
"].join(""));return b},enableInterface:function(){this.parent.enableInterface.apply(this,arguments)&&this.focusser.prop("disabled",!this.isInterfaceEnabled())},opening:function(){var c,d,e;this.opts.minimumResultsForSearch>=0&&this.showSearch(!0),this.parent.opening.apply(this,arguments),this.showSearchInput!==!1&&this.search.val(this.focusser.val()),this.opts.shouldFocusInput(this)&&(this.search.focus(),c=this.search.get(0),c.createTextRange?(d=c.createTextRange(),d.collapse(!1),d.select()):c.setSelectionRange&&(e=this.search.val().length,c.setSelectionRange(e,e))),""===this.search.val()&&this.nextSearchTerm!=b&&(this.search.val(this.nextSearchTerm),this.search.select()),this.focusser.prop("disabled",!0).val(""),this.updateResults(!0),this.opts.element.trigger(a.Event("select2-open"))},close:function(){this.opened()&&(this.parent.close.apply(this,arguments),this.focusser.prop("disabled",!1),this.opts.shouldFocusInput(this)&&this.focusser.focus())},focus:function(){this.opened()?this.close():(this.focusser.prop("disabled",!1),this.opts.shouldFocusInput(this)&&this.focusser.focus())},isFocused:function(){return this.container.hasClass("select2-container-active")},cancel:function(){this.parent.cancel.apply(this,arguments),this.focusser.prop("disabled",!1),this.opts.shouldFocusInput(this)&&this.focusser.focus()},destroy:function(){a("label[for='"+this.focusser.attr("id")+"']").attr("for",this.opts.element.attr("id")),this.parent.destroy.apply(this,arguments),N.call(this,"selection","focusser")},initContainer:function(){var b,h,d=this.container,e=this.dropdown,f=g();this.opts.minimumResultsForSearch<0?this.showSearch(!1):this.showSearch(!0),this.selection=b=d.find(".select2-choice"),this.focusser=d.find(".select2-focusser"),b.find(".select2-chosen").attr("id","select2-chosen-"+f),this.focusser.attr("aria-labelledby","select2-chosen-"+f),this.results.attr("id","select2-results-"+f),this.search.attr("aria-owns","select2-results-"+f),this.focusser.attr("id","s2id_autogen"+f),h=a("label[for='"+this.opts.element.attr("id")+"']"),this.focusser.prev().text(h.text()).attr("for",this.focusser.attr("id"));var i=this.opts.element.attr("title");this.opts.element.attr("title",i||h.text()),this.focusser.attr("tabindex",this.elementTabIndex),this.search.attr("id",this.focusser.attr("id")+"_search"),this.search.prev().text(a("label[for='"+this.focusser.attr("id")+"']").text()).attr("for",this.search.attr("id")),this.search.on("keydown",this.bind(function(a){if(this.isInterfaceEnabled()&&229!=a.keyCode){if(a.which===c.PAGE_UP||a.which===c.PAGE_DOWN)return A(a),void 0;switch(a.which){case c.UP:case c.DOWN:return this.moveHighlight(a.which===c.UP?-1:1),A(a),void 0;case c.ENTER:return this.selectHighlighted(),A(a),void 0;case c.TAB:return this.selectHighlighted({noFocus:!0}),void 0;case c.ESC:return this.cancel(a),A(a),void 0}}})),this.search.on("blur",this.bind(function(){document.activeElement===this.body.get(0)&&window.setTimeout(this.bind(function(){this.opened()&&this.search.focus()}),0)})),this.focusser.on("keydown",this.bind(function(a){if(this.isInterfaceEnabled()&&a.which!==c.TAB&&!c.isControl(a)&&!c.isFunctionKey(a)&&a.which!==c.ESC){if(this.opts.openOnEnter===!1&&a.which===c.ENTER)return A(a),void 0;if(a.which==c.DOWN||a.which==c.UP||a.which==c.ENTER&&this.opts.openOnEnter){if(a.altKey||a.ctrlKey||a.shiftKey||a.metaKey)return;return this.open(),A(a),void 0}return a.which==c.DELETE||a.which==c.BACKSPACE?(this.opts.allowClear&&this.clear(),A(a),void 0):void 0}})),u(this.focusser),this.focusser.on("keyup-change input",this.bind(function(a){if(this.opts.minimumResultsForSearch>=0){if(a.stopPropagation(),this.opened())return;this.open()}})),b.on("mousedown touchstart","abbr",this.bind(function(a){this.isInterfaceEnabled()&&(this.clear(),B(a),this.close(),this.selection.focus())})),b.on("mousedown touchstart",this.bind(function(c){n(b),this.container.hasClass("select2-container-active")||this.opts.element.trigger(a.Event("select2-focus")),this.opened()?this.close():this.isInterfaceEnabled()&&this.open(),A(c)})),e.on("mousedown touchstart",this.bind(function(){this.opts.shouldFocusInput(this)&&this.search.focus()})),b.on("focus",this.bind(function(a){A(a)})),this.focusser.on("focus",this.bind(function(){this.container.hasClass("select2-container-active")||this.opts.element.trigger(a.Event("select2-focus")),this.container.addClass("select2-container-active")})).on("blur",this.bind(function(){this.opened()||(this.container.removeClass("select2-container-active"),this.opts.element.trigger(a.Event("select2-blur")))})),this.search.on("focus",this.bind(function(){this.container.hasClass("select2-container-active")||this.opts.element.trigger(a.Event("select2-focus")),this.container.addClass("select2-container-active")})),this.initContainerWidth(),this.opts.element.addClass("select2-offscreen"),this.setPlaceholder()},clear:function(b){var c=this.selection.data("select2-data");if(c){var d=a.Event("select2-clearing");if(this.opts.element.trigger(d),d.isDefaultPrevented())return;var e=this.getPlaceholderOption();this.opts.element.val(e?e.val():""),this.selection.find(".select2-chosen").empty(),this.selection.removeData("select2-data"),this.setPlaceholder(),b!==!1&&(this.opts.element.trigger({type:"select2-removed",val:this.id(c),choice:c}),this.triggerChange({removed:c}))}},initSelection:function(){if(this.isPlaceholderOptionSelected())this.updateSelection(null),this.close(),this.setPlaceholder();else{var c=this;this.opts.initSelection.call(null,this.opts.element,function(a){a!==b&&null!==a&&(c.updateSelection(a),c.close(),c.setPlaceholder(),c.nextSearchTerm=c.opts.nextSearchTerm(a,c.search.val()))})}},isPlaceholderOptionSelected:function(){var a;return this.getPlaceholder()===b?!1:(a=this.getPlaceholderOption())!==b&&a.prop("selected")||""===this.opts.element.val()||this.opts.element.val()===b||null===this.opts.element.val()},prepareOpts:function(){var b=this.parent.prepareOpts.apply(this,arguments),c=this;return"select"===b.element.get(0).tagName.toLowerCase()?b.initSelection=function(a,b){var d=a.find("option").filter(function(){return this.selected&&!this.disabled});b(c.optionToData(d))}:"data"in b&&(b.initSelection=b.initSelection||function(c,d){var e=c.val(),f=null;b.query({matcher:function(a,c,d){var g=r(e,b.id(d));return g&&(f=d),g},callback:a.isFunction(d)?function(){d(f)}:a.noop})}),b},getPlaceholder:function(){return this.select&&this.getPlaceholderOption()===b?b:this.parent.getPlaceholder.apply(this,arguments)},setPlaceholder:function(){var a=this.getPlaceholder();if(this.isPlaceholderOptionSelected()&&a!==b){if(this.select&&this.getPlaceholderOption()===b)return;this.selection.find(".select2-chosen").html(this.opts.escapeMarkup(a)),this.selection.addClass("select2-default"),this.container.removeClass("select2-allowclear")}},postprocessResults:function(a,b,c){var d=0,e=this;if(this.findHighlightableChoices().each2(function(a,b){return r(e.id(b.data("select2-data")),e.opts.element.val())?(d=a,!1):void 0}),c!==!1&&(b===!0&&d>=0?this.highlight(d):this.highlight(0)),b===!0){var g=this.opts.minimumResultsForSearch;g>=0&&this.showSearch(L(a.results)>=g)}},showSearch:function(b){this.showSearchInput!==b&&(this.showSearchInput=b,this.dropdown.find(".select2-search").toggleClass("select2-search-hidden",!b),this.dropdown.find(".select2-search").toggleClass("select2-offscreen",!b),a(this.dropdown,this.container).toggleClass("select2-with-searchbox",b))},onSelect:function(a,b){if(this.triggerSelect(a)){var c=this.opts.element.val(),d=this.data();this.opts.element.val(this.id(a)),this.updateSelection(a),this.opts.element.trigger({type:"select2-selected",val:this.id(a),choice:a}),this.nextSearchTerm=this.opts.nextSearchTerm(a,this.search.val()),this.close(),b&&b.noFocus||!this.opts.shouldFocusInput(this)||this.focusser.focus(),r(c,this.id(a))||this.triggerChange({added:a,removed:d})}},updateSelection:function(a){var d,e,c=this.selection.find(".select2-chosen");this.selection.data("select2-data",a),c.empty(),null!==a&&(d=this.opts.formatSelection(a,c,this.opts.escapeMarkup)),d!==b&&c.append(d),e=this.opts.formatSelectionCssClass(a,c),e!==b&&c.addClass(e),this.selection.removeClass("select2-default"),this.opts.allowClear&&this.getPlaceholder()!==b&&this.container.addClass("select2-allowclear")},val:function(){var a,c=!1,d=null,e=this,f=this.data();if(0===arguments.length)return this.opts.element.val();if(a=arguments[0],arguments.length>1&&(c=arguments[1]),this.select)this.select.val(a).find("option").filter(function(){return this.selected}).each2(function(a,b){return d=e.optionToData(b),!1}),this.updateSelection(d),this.setPlaceholder(),c&&this.triggerChange({added:d,removed:f});else{if(!a&&0!==a)return this.clear(c),void 0;if(this.opts.initSelection===b)throw new Error("cannot call val() if initSelection() is not defined");this.opts.element.val(a),this.opts.initSelection(this.opts.element,function(a){e.opts.element.val(a?e.id(a):""),e.updateSelection(a),e.setPlaceholder(),c&&e.triggerChange({added:a,removed:f})})}},clearSearch:function(){this.search.val(""),this.focusser.val("")},data:function(a){var c,d=!1;return 0===arguments.length?(c=this.selection.data("select2-data"),c==b&&(c=null),c):(arguments.length>1&&(d=arguments[1]),a?(c=this.data(),this.opts.element.val(a?this.id(a):""),this.updateSelection(a),d&&this.triggerChange({added:a,removed:c})):this.clear(d),void 0)}}),f=O(d,{createContainer:function(){var b=a(document.createElement("div")).attr({"class":"select2-container select2-container-multi"}).html(["","
","
    ","
","
"].join(""));return b},prepareOpts:function(){var b=this.parent.prepareOpts.apply(this,arguments),c=this;return"select"===b.element.get(0).tagName.toLowerCase()?b.initSelection=function(a,b){var d=[];a.find("option").filter(function(){return this.selected&&!this.disabled}).each2(function(a,b){d.push(c.optionToData(b))}),b(d)}:"data"in b&&(b.initSelection=b.initSelection||function(c,d){var e=s(c.val(),b.separator),f=[];b.query({matcher:function(c,d,g){var h=a.grep(e,function(a){return r(a,b.id(g))}).length;return h&&f.push(g),h},callback:a.isFunction(d)?function(){for(var a=[],c=0;c0||(this.selectChoice(null),this.clearPlaceholder(),this.container.hasClass("select2-container-active")||this.opts.element.trigger(a.Event("select2-focus")),this.open(),this.focusSearch(),b.preventDefault()))})),this.container.on("focus",b,this.bind(function(){this.isInterfaceEnabled()&&(this.container.hasClass("select2-container-active")||this.opts.element.trigger(a.Event("select2-focus")),this.container.addClass("select2-container-active"),this.dropdown.addClass("select2-drop-active"),this.clearPlaceholder())})),this.initContainerWidth(),this.opts.element.addClass("select2-offscreen"),this.clearSearch()},enableInterface:function(){this.parent.enableInterface.apply(this,arguments)&&this.search.prop("disabled",!this.isInterfaceEnabled())},initSelection:function(){if(""===this.opts.element.val()&&""===this.opts.element.text()&&(this.updateSelection([]),this.close(),this.clearSearch()),this.select||""!==this.opts.element.val()){var c=this;this.opts.initSelection.call(null,this.opts.element,function(a){a!==b&&null!==a&&(c.updateSelection(a),c.close(),c.clearSearch())})}},clearSearch:function(){var a=this.getPlaceholder(),c=this.getMaxSearchWidth();a!==b&&0===this.getVal().length&&this.search.hasClass("select2-focused")===!1?(this.search.val(a).addClass("select2-default"),this.search.width(c>0?c:this.container.css("width"))):this.search.val("").width(10)},clearPlaceholder:function(){this.search.hasClass("select2-default")&&this.search.val("").removeClass("select2-default")},opening:function(){this.clearPlaceholder(),this.resizeSearch(),this.parent.opening.apply(this,arguments),this.focusSearch(),""===this.search.val()&&this.nextSearchTerm!=b&&(this.search.val(this.nextSearchTerm),this.search.select()),this.updateResults(!0),this.opts.shouldFocusInput(this)&&this.search.focus(),this.opts.element.trigger(a.Event("select2-open"))},close:function(){this.opened()&&this.parent.close.apply(this,arguments)},focus:function(){this.close(),this.search.focus()},isFocused:function(){return this.search.hasClass("select2-focused")},updateSelection:function(b){var c=[],d=[],e=this;a(b).each(function(){p(e.id(this),c)<0&&(c.push(e.id(this)),d.push(this))}),b=d,this.selection.find(".select2-search-choice").remove(),a(b).each(function(){e.addSelectedChoice(this)}),e.postprocessResults()},tokenize:function(){var a=this.search.val();a=this.opts.tokenizer.call(this,a,this.data(),this.bind(this.onSelect),this.opts),null!=a&&a!=b&&(this.search.val(a),a.length>0&&this.open())},onSelect:function(a,c){this.triggerSelect(a)&&""!==a.text&&(this.addSelectedChoice(a),this.opts.element.trigger({type:"selected",val:this.id(a),choice:a}),this.nextSearchTerm=this.opts.nextSearchTerm(a,this.search.val()),this.clearSearch(),this.updateResults(),(this.select||!this.opts.closeOnSelect)&&this.postprocessResults(a,!1,this.opts.closeOnSelect===!0),this.opts.closeOnSelect?(this.close(),this.search.width(10)):this.countSelectableResults()>0?(this.search.width(10),this.resizeSearch(),this.getMaximumSelectionSize()>0&&this.val().length>=this.getMaximumSelectionSize()?this.updateResults(!0):this.nextSearchTerm!=b&&(this.search.val(this.nextSearchTerm),this.updateResults(),this.search.select()),this.positionDropdown()):(this.close(),this.search.width(10)),this.triggerChange({added:a}),c&&c.noFocus||this.focusSearch())},cancel:function(){this.close(),this.focusSearch()},addSelectedChoice:function(c){var j,k,d=!c.locked,e=a("
  • "),f=a("
  • "),g=d?e:f,h=this.id(c),i=this.getVal();j=this.opts.formatSelection(c,g.find("div"),this.opts.escapeMarkup),j!=b&&g.find("div").replaceWith("
    "+j+"
    "),k=this.opts.formatSelectionCssClass(c,g.find("div")),k!=b&&g.addClass(k),d&&g.find(".select2-search-choice-close").on("mousedown",A).on("click dblclick",this.bind(function(b){this.isInterfaceEnabled()&&(this.unselect(a(b.target)),this.selection.find(".select2-search-choice-focus").removeClass("select2-search-choice-focus"),A(b),this.close(),this.focusSearch())})).on("focus",this.bind(function(){this.isInterfaceEnabled()&&(this.container.addClass("select2-container-active"),this.dropdown.addClass("select2-drop-active"))})),g.data("select2-data",c),g.insertBefore(this.searchContainer),i.push(h),this.setVal(i)},unselect:function(b){var d,e,c=this.getVal();if(b=b.closest(".select2-search-choice"),0===b.length)throw"Invalid argument: "+b+". Must be .select2-search-choice";if(d=b.data("select2-data")){var f=a.Event("select2-removing");if(f.val=this.id(d),f.choice=d,this.opts.element.trigger(f),f.isDefaultPrevented())return!1;for(;(e=p(this.id(d),c))>=0;)c.splice(e,1),this.setVal(c),this.select&&this.postprocessResults();return b.remove(),this.opts.element.trigger({type:"select2-removed",val:this.id(d),choice:d}),this.triggerChange({removed:d}),!0}},postprocessResults:function(a,b,c){var d=this.getVal(),e=this.results.find(".select2-result"),f=this.results.find(".select2-result-with-children"),g=this;e.each2(function(a,b){var c=g.id(b.data("select2-data"));p(c,d)>=0&&(b.addClass("select2-selected"),b.find(".select2-result-selectable").addClass("select2-selected"))}),f.each2(function(a,b){b.is(".select2-result-selectable")||0!==b.find(".select2-result-selectable:not(.select2-selected)").length||b.addClass("select2-selected")}),-1==this.highlight()&&c!==!1&&g.highlight(0),!this.opts.createSearchChoice&&!e.filter(".select2-result:not(.select2-selected)").length>0&&(!a||a&&!a.more&&0===this.results.find(".select2-no-results").length)&&J(g.opts.formatNoMatches,"formatNoMatches")&&this.results.append("
  • "+K(g.opts.formatNoMatches,g.opts.element,g.search.val())+"
  • ")},getMaxSearchWidth:function(){return this.selection.width()-t(this.search)},resizeSearch:function(){var a,b,c,d,e,f=t(this.search);a=C(this.search)+10,b=this.search.offset().left,c=this.selection.width(),d=this.selection.offset().left,e=c-(b-d)-f,a>e&&(e=c-f),40>e&&(e=c-f),0>=e&&(e=a),this.search.width(Math.floor(e))},getVal:function(){var a;return this.select?(a=this.select.val(),null===a?[]:a):(a=this.opts.element.val(),s(a,this.opts.separator))},setVal:function(b){var c;this.select?this.select.val(b):(c=[],a(b).each(function(){p(this,c)<0&&c.push(this)}),this.opts.element.val(0===c.length?"":c.join(this.opts.separator)))},buildChangeDetails:function(a,b){for(var b=b.slice(0),a=a.slice(0),c=0;c0&&c--,a.splice(d,1),d--);return{added:b,removed:a}},val:function(c,d){var e,f=this;if(0===arguments.length)return this.getVal();if(e=this.data(),e.length||(e=[]),!c&&0!==c)return this.opts.element.val(""),this.updateSelection([]),this.clearSearch(),d&&this.triggerChange({added:this.data(),removed:e}),void 0;if(this.setVal(c),this.select)this.opts.initSelection(this.select,this.bind(this.updateSelection)),d&&this.triggerChange(this.buildChangeDetails(e,this.data()));else{if(this.opts.initSelection===b)throw new Error("val() cannot be called if initSelection() is not defined");this.opts.initSelection(this.opts.element,function(b){var c=a.map(b,f.id);f.setVal(c),f.updateSelection(b),f.clearSearch(),d&&f.triggerChange(f.buildChangeDetails(e,f.data()))})}this.clearSearch()},onSortStart:function(){if(this.select)throw new Error("Sorting of elements is not supported when attached to instead.");this.search.width(0),this.searchContainer.hide()},onSortEnd:function(){var b=[],c=this;this.searchContainer.show(),this.searchContainer.appendTo(this.searchContainer.parent()),this.resizeSearch(),this.selection.find(".select2-search-choice").each(function(){b.push(c.opts.id(a(this).data("select2-data")))}),this.setVal(b),this.triggerChange()},data:function(b,c){var e,f,d=this;return 0===arguments.length?this.selection.children(".select2-search-choice").map(function(){return a(this).data("select2-data")}).get():(f=this.data(),b||(b=[]),e=a.map(b,function(a){return d.opts.id(a)}),this.setVal(e),this.updateSelection(b),this.clearSearch(),c&&this.triggerChange(this.buildChangeDetails(f,this.data())),void 0)}}),a.fn.select2=function(){var d,e,f,g,h,c=Array.prototype.slice.call(arguments,0),i=["val","destroy","opened","open","close","focus","isFocused","container","dropdown","onSortStart","onSortEnd","enable","disable","readonly","positionDropdown","data","search"],j=["opened","isFocused","container","dropdown"],k=["val","data"],l={search:"externalSearch"};return this.each(function(){if(0===c.length||"object"==typeof c[0])d=0===c.length?{}:a.extend({},c[0]),d.element=a(this),"select"===d.element.get(0).tagName.toLowerCase()?h=d.element.prop("multiple"):(h=d.multiple||!1,"tags"in d&&(d.multiple=h=!0)),e=h?new window.Select2["class"].multi:new window.Select2["class"].single,e.init(d);else{if("string"!=typeof c[0])throw"Invalid arguments to select2 plugin: "+c;if(p(c[0],i)<0)throw"Unknown method: "+c[0];if(g=b,e=a(this).data("select2"),e===b)return;if(f=c[0],"container"===f?g=e.container:"dropdown"===f?g=e.dropdown:(l[f]&&(f=l[f]),g=e[f].apply(e,c.slice(1))),p(c[0],j)>=0||p(c[0],k)>=0&&1==c.length)return!1}}),g===b?this:g},a.fn.select2.defaults={width:"copy",loadMorePadding:0,closeOnSelect:!0,openOnEnter:!0,containerCss:{},dropdownCss:{},containerCssClass:"",dropdownCssClass:"",formatResult:function(a,b,c,d){var e=[];return E(a.text,c.term,e,d),e.join("")},formatSelection:function(a,c,d){return a?d(a.text):b},sortResults:function(a){return a},formatResultCssClass:function(a){return a.css},formatSelectionCssClass:function(){return b},minimumResultsForSearch:0,minimumInputLength:0,maximumInputLength:null,maximumSelectionSize:0,id:function(a){return a==b?null:a.id},matcher:function(a,b){return o(""+b).toUpperCase().indexOf(o(""+a).toUpperCase())>=0},separator:",",tokenSeparators:[],tokenizer:M,escapeMarkup:F,blurOnChange:!1,selectOnBlur:!1,adaptContainerCssClass:function(a){return a},adaptDropdownCssClass:function(){return null},nextSearchTerm:function(){return b},searchInputPlaceholder:"",createSearchChoicePosition:"top",shouldFocusInput:function(a){var b="ontouchstart"in window||navigator.msMaxTouchPoints>0;return b?a.opts.minimumResultsForSearch<0?!1:!0:!0}},a.fn.select2.locales=[],a.fn.select2.locales.en={formatMatches:function(a){return 1===a?"One result is available, press enter to select it.":a+" results are available, use up and down arrow keys to navigate." +},formatNoMatches:function(){return"No matches found"},formatAjaxError:function(){return"Loading failed"},formatInputTooShort:function(a,b){var c=b-a.length;return"Please enter "+c+" or more character"+(1==c?"":"s")},formatInputTooLong:function(a,b){var c=a.length-b;return"Please delete "+c+" character"+(1==c?"":"s")},formatSelectionTooBig:function(a){return"You can only select "+a+" item"+(1==a?"":"s")},formatLoadMore:function(){return"Loading more results\u2026"},formatSearching:function(){return"Searching\u2026"}},a.extend(a.fn.select2.defaults,a.fn.select2.locales.en),a.fn.select2.ajaxDefaults={transport:a.ajax,params:{type:"GET",cache:!1,dataType:"json"}},window.Select2={query:{ajax:G,local:H,tags:I},util:{debounce:w,markMatch:E,escapeMarkup:F,stripDiacritics:o},"class":{"abstract":d,single:e,multi:f}}}}(jQuery); +/** + * Select2 Russian translation. + * + * @author Uriy Efremochkin + */ +(function ($) { + "use strict"; + + $.fn.select2.locales['ru'] = { + formatNoMatches: function () { return "Совпадений не найдено"; }, + formatInputTooShort: function (input, min) { return "Пожалуйста, введите еще хотя бы" + character(min - input.length); }, + formatInputTooLong: function (input, max) { return "Пожалуйста, введите на" + character(input.length - max) + " меньше"; }, + formatSelectionTooBig: function (limit) { return "Вы можете выбрать не более " + limit + " элемент" + (limit%10 == 1 && limit%100 != 11 ? "а" : "ов"); }, + formatLoadMore: function (pageNumber) { return "Загрузка данных…"; }, + formatSearching: function () { return "Поиск…"; } + }; + + $.extend($.fn.select2.defaults, $.fn.select2.locales['ru']); + + function character (n) { + return " " + n + " символ" + (n%10 < 5 && n%10 > 0 && (n%100 < 5 || n%100 > 20) ? n%10 > 1 ? "a" : "" : "ов"); + } +})(jQuery); + +/* Russian (UTF-8) initialisation for the jQuery UI date picker plugin. */ +/* Written by Andrew Stromnov (stromnov@gmail.com). */ +jQuery(function($){ + $.datepicker.regional['ru'] = { + closeText: 'Закрыть', + prevText: '<Пред', + nextText: 'След>', + currentText: 'Сегодня', + monthNames: ['Январь','Февраль','Март','Апрель','Май','Июнь', + 'Июль','Август','Сентябрь','Октябрь','Ноябрь','Декабрь'], + monthNamesShort: ['Янв','Фев','Мар','Апр','Май','Июн', + 'Июл','Авг','Сен','Окт','Ноя','Дек'], + dayNames: ['воскресенье','понедельник','вторник','среда','четверг','пятница','суббота'], + dayNamesShort: ['вск','пнд','втр','срд','чтв','птн','сбт'], + dayNamesMin: ['Вс','Пн','Вт','Ср','Чт','Пт','Сб'], + weekHeader: 'Нед', + dateFormat: 'dd.mm.yy', + firstDay: 1, + isRTL: false, + showMonthAfterYear: false, + yearSuffix: ''}; + $.datepicker.setDefaults($.datepicker.regional['ru']); +}); + +/*! Copyright (c) 2011 Brandon Aaron (http://brandonaaron.net) + * Licensed under the MIT License (LICENSE.txt). + * + * Thanks to: http://adomas.org/javascript-mouse-wheel/ for some pointers. + * Thanks to: Mathias Bank(http://www.mathias-bank.de) for a scope bug fix. + * Thanks to: Seamus Leahy for adding deltaX and deltaY + * + * Version: 3.0.6 + * + * Requires: 1.2.2+ + */ +(function(a){function d(b){var c=b||window.event,d=[].slice.call(arguments,1),e=0,f=!0,g=0,h=0;return b=a.event.fix(c),b.type="mousewheel",c.wheelDelta&&(e=c.wheelDelta/120),c.detail&&(e=-c.detail/3),h=e,c.axis!==undefined&&c.axis===c.HORIZONTAL_AXIS&&(h=0,g=-1*e),c.wheelDeltaY!==undefined&&(h=c.wheelDeltaY/120),c.wheelDeltaX!==undefined&&(g=-1*c.wheelDeltaX/120),d.unshift(b,e,g,h),(a.event.dispatch||a.event.handle).apply(this,d)}var b=["DOMMouseScroll","mousewheel"];if(a.event.fixHooks)for(var c=b.length;c;)a.event.fixHooks[b[--c]]=a.event.mouseHooks;a.event.special.mousewheel={setup:function(){if(this.addEventListener)for(var a=b.length;a;)this.addEventListener(b[--a],d,!1);else this.onmousewheel=d},teardown:function(){if(this.removeEventListener)for(var a=b.length;a;)this.removeEventListener(b[--a],d,!1);else this.onmousewheel=null}},a.fn.extend({mousewheel:function(a){return a?this.bind("mousewheel",a):this.trigger("mousewheel")},unmousewheel:function(a){return this.unbind("mousewheel",a)}})})(jQuery); + +/* + * Swiper 2.4+ - Mobile Touch Slider + * http://www.idangero.us/sliders/swiper/ + * + * Copyright 2012-2013, Vladimir Kharlampidi + * The iDangero.us + * http://www.idangero.us/ + * + * Licensed under GPL & MIT + * + * Updated on: December 6, 2013 +*/ +var Swiper=function(f,b){function h(a,b){return document.querySelectorAll?(b||document).querySelectorAll(a):jQuery(a,b)}function g(){var c=A-m;b.freeMode&&(c=A-m);b.slidesPerView>a.slides.length&&(c=0);0>c&&(c=0);return c}function l(){function c(c){var d=new Image;d.onload=function(){a.imagesLoaded++;a.imagesLoaded==a.imagesToLoad.length&&(a.reInit(),b.onImagesReady&&a.fireCallback(b.onImagesReady,a))};d.src=c}var d=a.h.addEventListener;a.browser.ie10?(d(a.wrapper,a.touchEvents.touchStart,B),d(document, +a.touchEvents.touchMove,C),d(document,a.touchEvents.touchEnd,D)):(a.support.touch&&(d(a.wrapper,"touchstart",B),d(a.wrapper,"touchmove",C),d(a.wrapper,"touchend",D)),b.simulateTouch&&(d(a.wrapper,"mousedown",B),d(document,"mousemove",C),d(document,"mouseup",D)));b.autoResize&&d(window,"resize",a.resizeFix);q();a._wheelEvent=!1;if(b.mousewheelControl){void 0!==document.onmousewheel&&(a._wheelEvent="mousewheel");try{WheelEvent("wheel"),a._wheelEvent="wheel"}catch(e){}a._wheelEvent||(a._wheelEvent="DOMMouseScroll"); +a._wheelEvent&&d(a.container,a._wheelEvent,P)}b.keyboardControl&&d(document,"keydown",Q);if(b.updateOnImagesReady)for(a.imagesToLoad=h("img",a.container),d=0;d=v&&r[0]<=v+h&&r[1]>=g&&r[1]<=g+m&&(e=!0)}if(!e)return}if(k){if(37==b||39==b)c.preventDefault?c.preventDefault(): +c.returnValue=!1;39==b&&a.swipeNext();37==b&&a.swipePrev()}else{if(38==b||40==b)c.preventDefault?c.preventDefault():c.returnValue=!1;40==b&&a.swipeNext();38==b&&a.swipePrev()}}function P(c){var d=a._wheelEvent,e=0;if(c.detail)e=-c.detail;else if("mousewheel"==d)if(k)if(Math.abs(c.wheelDeltaX)>Math.abs(c.wheelDeltaY))e=c.wheelDeltaX;else return;else if(Math.abs(c.wheelDeltaY)>Math.abs(c.wheelDeltaX))e=c.wheelDeltaY;else return;else if("DOMMouseScroll"==d)e=-c.detail;else if("wheel"==d)if(k)if(Math.abs(c.deltaX)> +Math.abs(c.deltaY))e=-c.deltaX;else return;else if(Math.abs(c.deltaY)>Math.abs(c.deltaX))e=-c.deltaY;else return;if(b.freeMode){if(d=a.getWrapperTranslate()+e,0e?a.swipeNext():a.swipePrev()),V=(new Date).getTime();b.autoplay&&a.stopAutoplay(!0);c.preventDefault?c.preventDefault():c.returnValue=!1;return!1}function T(c){a.allowSlideClick&&(W(c), +a.fireCallback(b.onSlideClick,a,c))}function U(c){W(c);a.fireCallback(b.onSlideTouch,a,c)}function W(c){if(c.currentTarget)a.clickedSlide=c.currentTarget;else{c=c.srcElement;do if(-1Math.abs(d-a.touches.startX)));"undefined"!==typeof y||k||(y=!!(y||Math.abs(e-a.touches.startY)c?m/2:a.positions.current*c),a.positions.current<-g()&&(d=(a.touches.current-a.touches.start)*b.touchRatio+(g()+a.positions.start), +c=(m+d)/m,d=a.positions.current-d*(1-c)/2,e=-g()-m/2,a.positions.current=d=c?e:d)),b.resistance&&"100%"==b.resistance&&(0b.moveStartThreshold||N?(N=!0,a.setWrapperTranslate(a.positions.current)):a.positions.current=a.positions.start:a.setWrapperTranslate(a.positions.current), +(b.freeMode||b.watchActiveIndex)&&a.updateActiveSlide(a.positions.current),b.grabCursor&&(a.container.style.cursor="move",a.container.style.cursor="grabbing",a.container.style.cursor="-moz-grabbin",a.container.style.cursor="-webkit-grabbing"),G||(G=a.touches.current),J||(J=(new Date).getTime()),a.velocity=(a.touches.current-G)/((new Date).getTime()-J)/2,2>Math.abs(a.touches.current-G)&&(a.velocity=0),G=a.touches.current,J=(new Date).getTime(),a.callPlugins("onTouchMoveEnd"),b.onTouchMove&&a.fireCallback(b.onTouchMove, +a),!1}}function D(c){y&&a.swipeReset();if(!b.onlyExternal&&a.isTouched){a.isTouched=!1;b.grabCursor&&(a.container.style.cursor="move",a.container.style.cursor="grab",a.container.style.cursor="-moz-grab",a.container.style.cursor="-webkit-grab");a.positions.current||0===a.positions.current||(a.positions.current=a.positions.start);b.followFinger&&a.setWrapperTranslate(a.positions.current);a.times.end=(new Date).getTime();a.touches.diff=a.touches.current-a.touches.start;a.touches.abs=Math.abs(a.touches.diff); +a.positions.diff=a.positions.current-a.positions.start;a.positions.abs=Math.abs(a.positions.diff);var d=a.positions.diff,e=a.positions.abs;c=a.times.end-a.times.start;5>e&&300>c&&!1==a.allowLinks&&(b.freeMode||0==e||a.swipeReset(),b.preventLinks&&(a.allowLinks=!0),b.onSlideClick&&(a.allowSlideClick=!0));setTimeout(function(){b.preventLinks&&(a.allowLinks=!0);b.onSlideClick&&(a.allowSlideClick=!0)},100);var f=g();if(!a.isMoved&&b.freeMode)a.isMoved=!1,b.onTouchEnd&&a.fireCallback(b.onTouchEnd,a);else if(!a.isMoved|| +0n&&(d=n),h=0,I=v=!0):d=0);0!=a.velocity&&(e=Math.abs((d-a.positions.current)/a.velocity));a.setWrapperTranslate(d); +a.setWrapperTransition(e);b.momentumBounce&&v&&a.wrapperTransitionEnd(function(){I&&(b.onMomentumBounce&&a.fireCallback(b.onMomentumBounce,a),a.callPlugins("onMomentumBounce"),a.setWrapperTranslate(h),a.setWrapperTransition(300))});a.updateActiveSlide(d)}(!b.freeModeFluid||300<=c)&&a.updateActiveSlide(a.positions.current);b.onTouchEnd&&a.fireCallback(b.onTouchEnd,a)}else{H=0>d?"toNext":"toPrev";"toNext"==H&&300>=c&&(30>e||!b.shortSwipes?a.swipeReset():a.swipeNext(!0));"toPrev"==H&&300>=c&&(30>e|| +!b.shortSwipes?a.swipeReset():a.swipePrev(!0));f=0;if("auto"==b.slidesPerView){for(var d=Math.abs(a.getWrapperTranslate()),l=v=0;ld){f=n;break}f>m&&(f=m)}else f=s*b.slidesPerView;"toNext"==H&&300=0.5*f?a.swipeNext(!0):a.swipeReset());"toPrev"==H&&300=0.5*f?a.swipePrev(!0):a.swipeReset());if(b.onTouchEnd)b.onTouchEnd(a)}a.callPlugins("onTouchEnd")}}function K(c,d,e){function f(){g+=h;(m="toNext"==k? +g>c:gc?"toNext":"toPrev",m="toNext"==k?g>c:gm){for(w=0;w<=Math.floor(t/(m+a.wrapperLeft));w++)0===w?a.snapGrid.push(n+a.wrapperLeft):a.snapGrid.push(n+a.wrapperLeft+m*w);a.slidesGrid.push(n+a.wrapperLeft)}else a.snapGrid.push(l),a.slidesGrid.push(l);l+=t/2+u/2}else{if(t>m)for(w=0;w<=Math.floor(t/m);w++)a.snapGrid.push(n+m*w);else a.snapGrid.push(n);a.slidesGrid.push(n)}n+=t;g+=f;h+=q}b.calculateHeight&&(a.height=p);k?(A=g+a.wrapperRight+a.wrapperLeft,e.style.width=g+"px",e.style.height=a.height+ +"px"):(A=h+a.wrapperTop+a.wrapperBottom,e.style.width=a.width+"px",e.style.height=h+"px")}else if(b.scrollContainer)e.style.width="",e.style.height="",p=a.slides[0].getWidth(!0),g=a.slides[0].getHeight(!0),A=k?p:g,e.style.width=p+"px",e.style.height=g+"px",s=k?p:g;else{if(b.calculateHeight){g=p=0;k||(a.container.style.height="");e.style.height="";for(r=0;r=a.snapGrid[e]&&-ca.snapGrid[e]&&-c=a.snapGrid[e]&&-c=a.snapGrid[a.snapGrid.length-1]&&(d=-a.snapGrid[a.snapGrid.length-1]);c<=-g()&&(d=-g())}else d=0>c?Math.round(c/d)*d:0;b.scrollContainer&&(d=0>c?c:0);d<-g()&&(d=-g());b.scrollContainer&&m>s&&(d=0);if(d==c)return!1;K(d,"reset");return!0};a.swipeTo=function(c,d,e){c=parseInt(c,10);a.callPlugins("onSwipeTo", +{index:c,speed:d});b.loop&&(c+=a.loopedSlides);var f=a.getWrapperTranslate();if(!(c>a.slides.length-1||0>c)){var h;h="auto"==b.slidesPerView?-a.slidesGrid[c]:-c*s;h<-g()&&(h=-g());if(h==f)return!1;K(h,"to",{index:c,speed:d,runCallbacks:!1===e?!1:!0});return!0}};a._queueStartCallbacks=!1;a._queueEndCallbacks=!1;a.updateActiveSlide=function(c){if(a.initialized&&0!=a.slides.length){a.previousIndex=a.activeIndex;"undefined"==typeof c&&(c=a.getWrapperTranslate());0a.activeIndex){for(var d=0;da.slidesGrid[d]&&-ca.activeIndex&&(a.activeIndex=0);if(a.slides[a.activeIndex]){a.calcVisibleSlides(c);e=RegExp("\\s*"+b.slideActiveClass);f=RegExp("\\s*"+b.slideVisibleClass); +for(d=0;d=a.slides.length-2*d&&(a.activeLoopIndex=a.slides.length-2*d-a.activeLoopIndex),0>a.activeLoopIndex&&(a.activeLoopIndex=a.slides.length-2*d+a.activeLoopIndex)):a.activeLoopIndex= +a.activeIndex;b.pagination&&a.updatePagination(c)}}};a.createPagination=function(c){b.paginationClickable&&a.paginationButtons&&X();a.paginationContainer=b.pagination.nodeType?b.pagination:h(b.pagination)[0];if(b.createPagination){var d="",e=a.slides.length;b.loop&&(e-=2*a.loopedSlides);for(var f=0;f";a.paginationContainer.innerHTML=d}a.paginationButtons=h("."+b.paginationElementClass,a.paginationContainer); +c||a.updatePagination();a.callPlugins("onCreatePagination");if(b.paginationClickable)for(c=a.paginationButtons,d=0;da.slides.length)&&h("."+b.paginationActiveClass,a.paginationContainer)){var d=a.paginationButtons;if(0!=d.length){for(var e=0;eg&&(g=a.slides.length-2*a.loopedSlides+g);b.loop&&g>=a.slides.length-2*a.loopedSlides&&(g=a.slides.length-2*a.loopedSlides-g,g=Math.abs(g));c.push(g)}for(e=0;e=-c&&g<=-c+m&&(n=!0),e<=-c&&g>=-c+m&&(n=!0)):(g>-c&&g<=-c+m&&(n=!0),e>=-c&&e<-c+m&&(n= +!0),e<-c&&g>-c+m&&(n=!0));n&&d.push(a.slides[h])}0==d.length&&(d=[a.slides[a.activeIndex]]);a.visibleSlides=d};var E=void 0;a.startAutoplay=function(){if("undefined"!==typeof E)return!1;b.autoplay&&(a.callPlugins("onAutoplayStart"),O())};a.stopAutoplay=function(c){E&&clearTimeout(E);E=void 0;c&&!b.autoplayDisableOnInteraction&&a.wrapperTransitionEnd(function(){O()});a.callPlugins("onAutoplayStop")};a.loopCreated=!1;a.removeLoopedSlides=function(){if(a.loopCreated)for(var b=0;ba.slides.length&&(a.loopedSlides=a.slides.length);var c="",d="",e,f="",g=a.slides.length,h=Math.floor(a.loopedSlides/g),n=a.loopedSlides%g;for(e=0;e=g&&(k=e-g*Math.floor(e/g));f+=a.slides[k].outerHTML}for(e=0;e=a.slides.length-a.loopedSlides)&&a.slides[e].setData("looped",!0);a.callPlugins("onCreateLoop")}};a.fixLoop=function(){var c;a.activeIndexa.slides.length-2*b.slidesPerView&&(c=-a.slides.length+a.activeIndex+a.loopedSlides,a.swipeTo(c,0,!1))};a.loadSlides=function(){var c= +"";a.activeLoaderIndex=0;for(var d=b.loader.slides,e=b.loader.loadAllSlides?d.length:b.slidesPerView*(1+b.loader.surroundGroups),f=0;f'+d[f]+"");a.wrapper.innerHTML=c;a.calcSlides(!0);b.loader.loadAllSlides||a.wrapperTransitionEnd(a.reloadSlides,!0)};a.reloadSlides=function(){var c=b.loader.slides,d=parseInt(a.activeSlide().data("swiperindex"),10);if(!(0> +d||d>c.length-1)){a.activeLoaderIndex=d;var e=Math.max(0,d-b.slidesPerView*b.loader.surroundGroups),f=Math.min(d+b.slidesPerView*(1+b.loader.surroundGroups)-1,c.length-1);0'+c[d]+"";a.wrapper.innerHTML=g}else{for(var g=1E3,h=0,d= +0;df?a.wrapper.removeChild(a.slides[d]):(g=Math.min(k,g),h=Math.max(k,h))}for(d=e;d<=f;d++)dh&&(e=document.createElement(b.slideElement),e.className=b.slideClass,e.setAttribute("data-swiperindex",d),e.innerHTML=c[d],a.wrapper.appendChild(e))}a.reInit(!0)}};a.calcSlides(); +0f}(),ie10:window.navigator.msPointerEnabled}}; +(window.jQuery||window.Zepto)&&function(f){f.fn.swiper=function(b){b=new Swiper(f(this)[0],b);f(this).data("swiper",b);return b}}(window.jQuery||window.Zepto);"undefined"!==typeof module&&(module.exports=Swiper); +/* == jquery mousewheel plugin == Version: 3.1.11, License: MIT License (MIT) */ +!function(a){"function"==typeof define&&define.amd?define(["jquery"],a):"object"==typeof exports?module.exports=a:a(jQuery)}(function(a){function b(b){var g=b||window.event,h=i.call(arguments,1),j=0,l=0,m=0,n=0,o=0,p=0;if(b=a.event.fix(g),b.type="mousewheel","detail"in g&&(m=-1*g.detail),"wheelDelta"in g&&(m=g.wheelDelta),"wheelDeltaY"in g&&(m=g.wheelDeltaY),"wheelDeltaX"in g&&(l=-1*g.wheelDeltaX),"axis"in g&&g.axis===g.HORIZONTAL_AXIS&&(l=-1*m,m=0),j=0===m?l:m,"deltaY"in g&&(m=-1*g.deltaY,j=m),"deltaX"in g&&(l=g.deltaX,0===m&&(j=-1*l)),0!==m||0!==l){if(1===g.deltaMode){var q=a.data(this,"mousewheel-line-height");j*=q,m*=q,l*=q}else if(2===g.deltaMode){var r=a.data(this,"mousewheel-page-height");j*=r,m*=r,l*=r}if(n=Math.max(Math.abs(m),Math.abs(l)),(!f||f>n)&&(f=n,d(g,n)&&(f/=40)),d(g,n)&&(j/=40,l/=40,m/=40),j=Math[j>=1?"floor":"ceil"](j/f),l=Math[l>=1?"floor":"ceil"](l/f),m=Math[m>=1?"floor":"ceil"](m/f),k.settings.normalizeOffset&&this.getBoundingClientRect){var s=this.getBoundingClientRect();o=b.clientX-s.left,p=b.clientY-s.top}return b.deltaX=l,b.deltaY=m,b.deltaFactor=f,b.offsetX=o,b.offsetY=p,b.deltaMode=0,h.unshift(b,j,l,m),e&&clearTimeout(e),e=setTimeout(c,200),(a.event.dispatch||a.event.handle).apply(this,h)}}function c(){f=null}function d(a,b){return k.settings.adjustOldDeltas&&"mousewheel"===a.type&&b%120===0}var e,f,g=["wheel","mousewheel","DOMMouseScroll","MozMousePixelScroll"],h="onwheel"in document||document.documentMode>=9?["wheel"]:["mousewheel","DomMouseScroll","MozMousePixelScroll"],i=Array.prototype.slice;if(a.event.fixHooks)for(var j=g.length;j;)a.event.fixHooks[g[--j]]=a.event.mouseHooks;var k=a.event.special.mousewheel={version:"3.1.11",setup:function(){if(this.addEventListener)for(var c=h.length;c;)this.addEventListener(h[--c],b,!1);else this.onmousewheel=b;a.data(this,"mousewheel-line-height",k.getLineHeight(this)),a.data(this,"mousewheel-page-height",k.getPageHeight(this))},teardown:function(){if(this.removeEventListener)for(var c=h.length;c;)this.removeEventListener(h[--c],b,!1);else this.onmousewheel=null;a.removeData(this,"mousewheel-line-height"),a.removeData(this,"mousewheel-page-height")},getLineHeight:function(b){var c=a(b)["offsetParent"in a.fn?"offsetParent":"parent"]();return c.length||(c=a("body")),parseInt(c.css("fontSize"),10)},getPageHeight:function(b){return a(b).height()},settings:{adjustOldDeltas:!0,normalizeOffset:!0}};a.fn.extend({mousewheel:function(a){return a?this.bind("mousewheel",a):this.trigger("mousewheel")},unmousewheel:function(a){return this.unbind("mousewheel",a)}})}); +/* == malihu jquery custom scrollbar plugin == Version: 3.0.4, License: MIT License (MIT) */ +(function(b,a,c){(function(d){d(jQuery)}(function(j){var g="mCustomScrollbar",d="mCS",m=".mCustomScrollbar",h={setWidth:false,setHeight:false,setTop:0,setLeft:0,axis:"y",scrollbarPosition:"inside",scrollInertia:950,autoDraggerLength:true,autoHideScrollbar:false,autoExpandScrollbar:false,alwaysShowScrollbar:0,snapAmount:null,snapOffset:0,mouseWheel:{enable:true,scrollAmount:"auto",axis:"y",preventDefault:false,deltaFactor:"auto",normalizeDelta:false,invert:false,disableOver:["select","option","keygen","datalist","textarea"]},scrollButtons:{enable:false,scrollType:"stepless",scrollAmount:"auto"},keyboard:{enable:true,scrollType:"stepless",scrollAmount:"auto"},contentTouchScroll:25,advanced:{autoExpandHorizontalScroll:false,autoScrollOnFocus:"input,textarea,select,button,datalist,keygen,a[tabindex],area,object,[contenteditable='true']",updateOnContentResize:true,updateOnImageLoad:true,updateOnSelectorChange:false},theme:"light",callbacks:{onScrollStart:false,onScroll:false,onTotalScroll:false,onTotalScrollBack:false,whileScrolling:false,onTotalScrollOffset:0,onTotalScrollBackOffset:0,alwaysTriggerOffsets:true,onOverflowY:false,onOverflowX:false,onOverflowYNone:false,onOverflowXNone:false},live:false,liveSelector:null},l=0,o={},f=function(p){if(o[p]){clearTimeout(o[p]);i._delete.call(null,o[p])}},k=(b.attachEvent&&!b.addEventListener)?1:0,n=false,e={init:function(q){var q=j.extend(true,{},h,q),p=i._selector.call(this);if(q.live){var s=q.liveSelector||this.selector||m,r=j(s);if(q.live==="off"){f(s);return}o[s]=setTimeout(function(){r.mCustomScrollbar(q);if(q.live==="once"&&r.length){f(s)}},500)}else{f(s)}q.setWidth=(q.set_width)?q.set_width:q.setWidth;q.setHeight=(q.set_height)?q.set_height:q.setHeight;q.axis=(q.horizontalScroll)?"x":i._findAxis.call(null,q.axis);q.scrollInertia=q.scrollInertia>0&&q.scrollInertia<17?17:q.scrollInertia;if(typeof q.mouseWheel!=="object"&&q.mouseWheel==true){q.mouseWheel={enable:true,scrollAmount:"auto",axis:"y",preventDefault:false,deltaFactor:"auto",normalizeDelta:false,invert:false}}q.mouseWheel.scrollAmount=!q.mouseWheelPixels?q.mouseWheel.scrollAmount:q.mouseWheelPixels;q.mouseWheel.normalizeDelta=!q.advanced.normalizeMouseWheelDelta?q.mouseWheel.normalizeDelta:q.advanced.normalizeMouseWheelDelta;q.scrollButtons.scrollType=i._findScrollButtonsType.call(null,q.scrollButtons.scrollType);i._theme.call(null,q);return j(p).each(function(){var u=j(this);if(!u.data(d)){u.data(d,{idx:++l,opt:q,scrollRatio:{y:null,x:null},overflowed:null,contentReset:{y:null,x:null},bindEvents:false,tweenRunning:false,sequential:{},langDir:u.css("direction"),cbOffsets:null,trigger:null});var w=u.data(d).opt,v=u.data("mcs-axis"),t=u.data("mcs-scrollbar-position"),x=u.data("mcs-theme");if(v){w.axis=v}if(t){w.scrollbarPosition=t}if(x){w.theme=x;i._theme.call(null,w)}i._pluginMarkup.call(this);e.update.call(null,u)}})},update:function(q){var p=q||i._selector.call(this);return j(p).each(function(){var t=j(this);if(t.data(d)){var v=t.data(d),u=v.opt,r=j("#mCSB_"+v.idx+"_container"),s=[j("#mCSB_"+v.idx+"_dragger_vertical"),j("#mCSB_"+v.idx+"_dragger_horizontal")];if(!r.length){return}if(v.tweenRunning){i._stop.call(null,t)}if(t.hasClass("mCS_disabled")){t.removeClass("mCS_disabled")}if(t.hasClass("mCS_destroyed")){t.removeClass("mCS_destroyed")}i._maxHeight.call(this);i._expandContentHorizontally.call(this);if(u.axis!=="y"&&!u.advanced.autoExpandHorizontalScroll){r.css("width",i._contentWidth(r.children()))}v.overflowed=i._overflowed.call(this);i._scrollbarVisibility.call(this);if(u.autoDraggerLength){i._setDraggerLength.call(this)}i._scrollRatio.call(this);i._bindEvents.call(this);var w=[Math.abs(r[0].offsetTop),Math.abs(r[0].offsetLeft)];if(u.axis!=="x"){if(!v.overflowed[0]){i._resetContentPosition.call(this);if(u.axis==="y"){i._unbindEvents.call(this)}else{if(u.axis==="yx"&&v.overflowed[1]){i._scrollTo.call(this,t,w[1].toString(),{dir:"x",dur:0,overwrite:"none"})}}}else{if(s[0].height()>s[0].parent().height()){i._resetContentPosition.call(this)}else{i._scrollTo.call(this,t,w[0].toString(),{dir:"y",dur:0,overwrite:"none"});v.contentReset.y=null}}}if(u.axis!=="y"){if(!v.overflowed[1]){i._resetContentPosition.call(this);if(u.axis==="x"){i._unbindEvents.call(this)}else{if(u.axis==="yx"&&v.overflowed[0]){i._scrollTo.call(this,t,w[0].toString(),{dir:"y",dur:0,overwrite:"none"})}}}else{if(s[1].width()>s[1].parent().width()){i._resetContentPosition.call(this)}else{i._scrollTo.call(this,t,w[1].toString(),{dir:"x",dur:0,overwrite:"none"});v.contentReset.x=null}}}i._autoUpdate.call(this)}})},scrollTo:function(r,q){if(typeof r=="undefined"||r==null){return}var p=i._selector.call(this);return j(p).each(function(){var u=j(this);if(u.data(d)){var x=u.data(d),w=x.opt,v={trigger:"external",scrollInertia:w.scrollInertia,scrollEasing:"mcsEaseInOut",moveDragger:false,timeout:60,callbacks:true,onStart:true,onUpdate:true,onComplete:true},s=j.extend(true,{},v,q),y=i._arr.call(this,r),t=s.scrollInertia>0&&s.scrollInertia<17?17:s.scrollInertia;y[0]=i._to.call(this,y[0],"y");y[1]=i._to.call(this,y[1],"x");if(s.moveDragger){y[0]*=x.scrollRatio.y;y[1]*=x.scrollRatio.x}s.dur=t;setTimeout(function(){if(y[0]!==null&&typeof y[0]!=="undefined"&&w.axis!=="x"&&x.overflowed[0]){s.dir="y";s.overwrite="all";i._scrollTo.call(this,u,y[0].toString(),s)}if(y[1]!==null&&typeof y[1]!=="undefined"&&w.axis!=="y"&&x.overflowed[1]){s.dir="x";s.overwrite="none";i._scrollTo.call(this,u,y[1].toString(),s)}},s.timeout)}})},stop:function(){var p=i._selector.call(this);return j(p).each(function(){var q=j(this);if(q.data(d)){i._stop.call(null,q)}})},disable:function(q){var p=i._selector.call(this);return j(p).each(function(){var r=j(this);if(r.data(d)){var t=r.data(d),s=t.opt;i._autoUpdate.call(this,"remove");i._unbindEvents.call(this);if(q){i._resetContentPosition.call(this)}i._scrollbarVisibility.call(this,true);r.addClass("mCS_disabled")}})},destroy:function(){var p=i._selector.call(this);return j(p).each(function(){var s=j(this);if(s.data(d)){var u=s.data(d),t=u.opt,q=j("#mCSB_"+u.idx),r=j("#mCSB_"+u.idx+"_container"),v=j(".mCSB_"+u.idx+"_scrollbar");if(t.live){f(p)}i._autoUpdate.call(this,"remove");i._unbindEvents.call(this);i._resetContentPosition.call(this);s.removeData(d);i._delete.call(null,this.mcs);v.remove();q.replaceWith(r.contents());s.removeClass(g+" _"+d+"_"+u.idx+" mCS-autoHide mCS-dir-rtl mCS_no_scrollbar mCS_disabled").addClass("mCS_destroyed")}})}},i={_selector:function(){return(typeof j(this)!=="object"||j(this).length<1)?m:this},_theme:function(s){var r=["rounded","rounded-dark","rounded-dots","rounded-dots-dark"],q=["rounded-dots","rounded-dots-dark","3d","3d-dark","3d-thick","3d-thick-dark","inset","inset-dark","inset-2","inset-2-dark","inset-3","inset-3-dark"],p=["minimal","minimal-dark"],u=["minimal","minimal-dark"],t=["minimal","minimal-dark"];s.autoDraggerLength=j.inArray(s.theme,r)>-1?false:s.autoDraggerLength;s.autoExpandScrollbar=j.inArray(s.theme,q)>-1?false:s.autoExpandScrollbar;s.scrollButtons.enable=j.inArray(s.theme,p)>-1?false:s.scrollButtons.enable;s.autoHideScrollbar=j.inArray(s.theme,u)>-1?true:s.autoHideScrollbar;s.scrollbarPosition=j.inArray(s.theme,t)>-1?"outside":s.scrollbarPosition},_findAxis:function(p){return(p==="yx"||p==="xy"||p==="auto")?"yx":(p==="x"||p==="horizontal")?"x":"y"},_findScrollButtonsType:function(p){return(p==="stepped"||p==="pixels"||p==="step"||p==="click")?"stepped":"stepless"},_pluginMarkup:function(){var y=j(this),x=y.data(d),r=x.opt,t=r.autoExpandScrollbar?" mCSB_scrollTools_onDrag_expand":"",B=["
    ","
    "],u=r.axis==="yx"?"mCSB_vertical_horizontal":r.axis==="x"?"mCSB_horizontal":"mCSB_vertical",w=r.axis==="yx"?B[0]+B[1]:r.axis==="x"?B[1]:B[0],v=r.axis==="yx"?"
    ":"",s=r.autoHideScrollbar?" mCS-autoHide":"",p=(r.axis!=="x"&&x.langDir==="rtl")?" mCS-dir-rtl":"";if(r.setWidth){y.css("width",r.setWidth)}if(r.setHeight){y.css("height",r.setHeight)}r.setLeft=(r.axis!=="y"&&x.langDir==="rtl")?"989999px":r.setLeft;y.addClass(g+" _"+d+"_"+x.idx+s+p).wrapInner("
    ");var q=j("#mCSB_"+x.idx),z=j("#mCSB_"+x.idx+"_container");if(r.axis!=="y"&&!r.advanced.autoExpandHorizontalScroll){z.css("width",i._contentWidth(z.children()))}if(r.scrollbarPosition==="outside"){if(y.css("position")==="static"){y.css("position","relative")}y.css("overflow","visible");q.addClass("mCSB_outside").after(w)}else{q.addClass("mCSB_inside").append(w);z.wrap(v)}i._scrollButtons.call(this);var A=[j("#mCSB_"+x.idx+"_dragger_vertical"),j("#mCSB_"+x.idx+"_dragger_horizontal")];A[0].css("min-height",A[0].height());A[1].css("min-width",A[1].width())},_contentWidth:function(p){return Math.max.apply(Math,p.map(function(){return j(this).outerWidth(true)}).get())},_expandContentHorizontally:function(){var q=j(this),s=q.data(d),r=s.opt,p=j("#mCSB_"+s.idx+"_container");if(r.advanced.autoExpandHorizontalScroll&&r.axis!=="y"){p.css({position:"absolute",width:"auto"}).wrap("
    ").css({width:(Math.ceil(p[0].getBoundingClientRect().right+0.4)-Math.floor(p[0].getBoundingClientRect().left)),position:"relative"}).unwrap()}},_scrollButtons:function(){var s=j(this),u=s.data(d),t=u.opt,q=j(".mCSB_"+u.idx+"_scrollbar:first"),r=["","","",""],p=[(t.axis==="x"?r[2]:r[0]),(t.axis==="x"?r[3]:r[1]),r[2],r[3]];if(t.scrollButtons.enable){q.prepend(p[0]).append(p[1]).next(".mCSB_scrollTools").prepend(p[2]).append(p[3])}},_maxHeight:function(){var t=j(this),w=t.data(d),v=w.opt,r=j("#mCSB_"+w.idx),q=t.css("max-height"),s=q.indexOf("%")!==-1,p=t.css("box-sizing");if(q!=="none"){var u=s?t.parent().height()*parseInt(q)/100:parseInt(q);if(p==="border-box"){u-=((t.innerHeight()-t.height())+(t.outerHeight()-t.innerHeight()))}r.css("max-height",Math.round(u))}},_setDraggerLength:function(){var u=j(this),s=u.data(d),p=j("#mCSB_"+s.idx),v=j("#mCSB_"+s.idx+"_container"),y=[j("#mCSB_"+s.idx+"_dragger_vertical"),j("#mCSB_"+s.idx+"_dragger_horizontal")],t=[p.height()/v.outerHeight(false),p.width()/v.outerWidth(false)],q=[parseInt(y[0].css("min-height")),Math.round(t[0]*y[0].parent().height()),parseInt(y[1].css("min-width")),Math.round(t[1]*y[1].parent().width())],r=k&&(q[1]q.height(),p>q.width()]},_resetContentPosition:function(){var t=j(this),v=t.data(d),u=v.opt,q=j("#mCSB_"+v.idx),r=j("#mCSB_"+v.idx+"_container"),s=[j("#mCSB_"+v.idx+"_dragger_vertical"),j("#mCSB_"+v.idx+"_dragger_horizontal")];i._stop(t);if((u.axis!=="x"&&!v.overflowed[0])||(u.axis==="y"&&v.overflowed[0])){s[0].add(r).css("top",0);i._scrollTo(t,"_resetY")}if((u.axis!=="y"&&!v.overflowed[1])||(u.axis==="x"&&v.overflowed[1])){var p=dx=0;if(v.langDir==="rtl"){p=q.width()-r.outerWidth(false);dx=Math.abs(p/v.scrollRatio.x)}r.css("left",p);s[1].css("left",dx);i._scrollTo(t,"_resetX")}},_bindEvents:function(){var r=j(this),t=r.data(d),s=t.opt;if(!t.bindEvents){i._draggable.call(this);if(s.contentTouchScroll){i._contentDraggable.call(this)}if(s.mouseWheel.enable){function q(){p=setTimeout(function(){if(!j.event.special.mousewheel){q()}else{clearTimeout(p);i._mousewheel.call(r[0])}},1000)}var p;q()}i._draggerRail.call(this);i._wrapperScroll.call(this);if(s.advanced.autoScrollOnFocus){i._focus.call(this)}if(s.scrollButtons.enable){i._buttons.call(this)}if(s.keyboard.enable){i._keyboard.call(this)}t.bindEvents=true}},_unbindEvents:function(){var s=j(this),t=s.data(d),p=d+"_"+t.idx,u=".mCSB_"+t.idx+"_scrollbar",r=j("#mCSB_"+t.idx+",#mCSB_"+t.idx+"_container,#mCSB_"+t.idx+"_container_wrapper,"+u+" .mCSB_draggerContainer,#mCSB_"+t.idx+"_dragger_vertical,#mCSB_"+t.idx+"_dragger_horizontal,"+u+">a"),q=j("#mCSB_"+t.idx+"_container");if(t.bindEvents){j(a).unbind("."+p);r.each(function(){j(this).unbind("."+p)});clearTimeout(s[0]._focusTimeout);i._delete.call(null,s[0]._focusTimeout);clearTimeout(t.sequential.step);i._delete.call(null,t.sequential.step);clearTimeout(q[0].onCompleteTimeout);i._delete.call(null,q[0].onCompleteTimeout);t.bindEvents=false}},_scrollbarVisibility:function(q){var t=j(this),v=t.data(d),u=v.opt,p=j("#mCSB_"+v.idx+"_container_wrapper"),r=p.length?p:j("#mCSB_"+v.idx+"_container"),w=[j("#mCSB_"+v.idx+"_scrollbar_vertical"),j("#mCSB_"+v.idx+"_scrollbar_horizontal")],s=[w[0].find(".mCSB_dragger"),w[1].find(".mCSB_dragger")];if(u.axis!=="x"){if(v.overflowed[0]&&!q){w[0].add(s[0]).add(w[0].children("a")).css("display","block");r.removeClass("mCS_no_scrollbar_y mCS_y_hidden")}else{if(u.alwaysShowScrollbar){if(u.alwaysShowScrollbar!==2){s[0].add(w[0].children("a")).css("display","none")}r.removeClass("mCS_y_hidden")}else{w[0].css("display","none");r.addClass("mCS_y_hidden")}r.addClass("mCS_no_scrollbar_y")}}if(u.axis!=="y"){if(v.overflowed[1]&&!q){w[1].add(s[1]).add(w[1].children("a")).css("display","block");r.removeClass("mCS_no_scrollbar_x mCS_x_hidden")}else{if(u.alwaysShowScrollbar){if(u.alwaysShowScrollbar!==2){s[1].add(w[1].children("a")).css("display","none")}r.removeClass("mCS_x_hidden")}else{w[1].css("display","none");r.addClass("mCS_x_hidden")}r.addClass("mCS_no_scrollbar_x")}}if(!v.overflowed[0]&&!v.overflowed[1]){t.addClass("mCS_no_scrollbar")}else{t.removeClass("mCS_no_scrollbar")}},_coordinates:function(q){var p=q.type;switch(p){case"pointerdown":case"MSPointerDown":case"pointermove":case"MSPointerMove":case"pointerup":case"MSPointerUp":return[q.originalEvent.pageY,q.originalEvent.pageX];break;case"touchstart":case"touchmove":case"touchend":var r=q.originalEvent.touches[0]||q.originalEvent.changedTouches[0];return[r.pageY,r.pageX];break;default:return[q.pageY,q.pageX]}},_draggable:function(){var u=j(this),s=u.data(d),p=s.opt,r=d+"_"+s.idx,t=["mCSB_"+s.idx+"_dragger_vertical","mCSB_"+s.idx+"_dragger_horizontal"],v=j("#mCSB_"+s.idx+"_container"),w=j("#"+t[0]+",#"+t[1]),A,y,z;w.bind("mousedown."+r+" touchstart."+r+" pointerdown."+r+" MSPointerDown."+r,function(E){E.stopImmediatePropagation();E.preventDefault();if(!i._mouseBtnLeft(E)){return}n=true;if(k){a.onselectstart=function(){return false}}x(false);i._stop(u);A=j(this);var F=A.offset(),G=i._coordinates(E)[0]-F.top,B=i._coordinates(E)[1]-F.left,D=A.height()+F.top,C=A.width()+F.left;if(G0&&B0){y=G;z=B}i._onDragClasses(A,"active",p.autoExpandScrollbar)}).bind("touchmove."+r,function(C){C.stopImmediatePropagation();C.preventDefault();var D=A.offset(),E=i._coordinates(C)[0]-D.top,B=i._coordinates(C)[1]-D.left;q(y,z,E,B)});j(a).bind("mousemove."+r+" pointermove."+r+" MSPointerMove."+r,function(C){if(A){var D=A.offset(),E=i._coordinates(C)[0]-D.top,B=i._coordinates(C)[1]-D.left;if(y===E){return}q(y,z,E,B)}}).add(w).bind("mouseup."+r+" touchend."+r+" pointerup."+r+" MSPointerUp."+r,function(B){if(A){i._onDragClasses(A,"active",p.autoExpandScrollbar);A=null}n=false;if(k){a.onselectstart=null}x(true)});function x(B){var C=v.find("iframe");if(!C.length){return}var D=!B?"none":"auto";C.css("pointer-events",D)}function q(D,E,G,B){v[0].idleTimer=p.scrollInertia<233?250:0;if(A.attr("id")===t[1]){var C="x",F=((A[0].offsetLeft-E)+B)*s.scrollRatio.x}else{var C="y",F=((A[0].offsetTop-D)+G)*s.scrollRatio.y}i._scrollTo(u,F.toString(),{dir:C,drag:true})}},_contentDraggable:function(){var y=j(this),K=y.data(d),I=K.opt,F=d+"_"+K.idx,v=j("#mCSB_"+K.idx),z=j("#mCSB_"+K.idx+"_container"),w=[j("#mCSB_"+K.idx+"_dragger_vertical"),j("#mCSB_"+K.idx+"_dragger_horizontal")],E,G,L,M,C=[],D=[],H,A,u,t,J,x,r=0,q,s=I.axis==="yx"?"none":"all";z.bind("touchstart."+F+" pointerdown."+F+" MSPointerDown."+F,function(N){if(!i._pointerTouch(N)||n){return}var O=z.offset();E=i._coordinates(N)[0]-O.top;G=i._coordinates(N)[1]-O.left}).bind("touchmove."+F+" pointermove."+F+" MSPointerMove."+F,function(Q){if(!i._pointerTouch(Q)||n){return}Q.stopImmediatePropagation();A=i._getTime();var P=v.offset(),S=i._coordinates(Q)[0]-P.top,U=i._coordinates(Q)[1]-P.left,R="mcsLinearOut";C.push(S);D.push(U);if(K.overflowed[0]){var O=w[0].parent().height()-w[0].height(),T=((E-S)>0&&(S-E)>-(O*K.scrollRatio.y))}if(K.overflowed[1]){var N=w[1].parent().width()-w[1].width(),V=((G-U)>0&&(U-G)>-(N*K.scrollRatio.x))}if(T||V){Q.preventDefault()}x=I.axis==="yx"?[(E-S),(G-U)]:I.axis==="x"?[null,(G-U)]:[(E-S),null];z[0].idleTimer=250;if(K.overflowed[0]){B(x[0],r,R,"y","all",true)}if(K.overflowed[1]){B(x[1],r,R,"x",s,true)}});v.bind("touchstart."+F+" pointerdown."+F+" MSPointerDown."+F,function(N){if(!i._pointerTouch(N)||n){return}N.stopImmediatePropagation();i._stop(y);H=i._getTime();var O=v.offset();L=i._coordinates(N)[0]-O.top;M=i._coordinates(N)[1]-O.left;C=[];D=[]}).bind("touchend."+F+" pointerup."+F+" MSPointerUp."+F,function(P){if(!i._pointerTouch(P)||n){return}P.stopImmediatePropagation();u=i._getTime();var N=v.offset(),T=i._coordinates(P)[0]-N.top,V=i._coordinates(P)[1]-N.left;if((u-A)>30){return}J=1000/(u-H);var Q="mcsEaseOut",R=J<2.5,W=R?[C[C.length-2],D[D.length-2]]:[0,0];t=R?[(T-W[0]),(V-W[1])]:[T-L,V-M];var O=[Math.abs(t[0]),Math.abs(t[1])];J=R?[Math.abs(t[0]/4),Math.abs(t[1]/4)]:[J,J];var U=[Math.abs(z[0].offsetTop)-(t[0]*p((O[0]/J[0]),J[0])),Math.abs(z[0].offsetLeft)-(t[1]*p((O[1]/J[1]),J[1]))];x=I.axis==="yx"?[U[0],U[1]]:I.axis==="x"?[null,U[1]]:[U[0],null];q=[(O[0]*4)+I.scrollInertia,(O[1]*4)+I.scrollInertia];var S=parseInt(I.contentTouchScroll)||0;x[0]=O[0]>S?x[0]:0;x[1]=O[1]>S?x[1]:0;if(K.overflowed[0]){B(x[0],q[0],Q,"y",s,false)}if(K.overflowed[1]){B(x[1],q[1],Q,"x",s,false)}});function p(P,N){var O=[N*1.5,N*2,N/1.5,N/2];if(P>90){return N>4?O[0]:O[3]}else{if(P>60){return N>3?O[3]:O[2]}else{if(P>30){return N>8?O[1]:N>6?O[0]:N>4?N:O[2]}else{return N>8?N:O[3]}}}}function B(P,R,S,O,N,Q){if(!P){return}i._scrollTo(y,P.toString(),{dur:R,scrollEasing:S,dir:O,overwrite:N,drag:Q})}},_mousewheel:function(){var w=j(this),v=w.data(d);if(v){var p=v.opt,s=d+"_"+v.idx,q=j("#mCSB_"+v.idx),x=[j("#mCSB_"+v.idx+"_dragger_vertical"),j("#mCSB_"+v.idx+"_dragger_horizontal")],t=j("#mCSB_"+v.idx+"_container").find("iframe"),r=q;if(t.length){t.each(function(){var y=this;if(u(y)){r=r.add(j(y).contents().find("body"))}})}r.bind("mousewheel."+s,function(C,G){i._stop(w);if(i._disableMousewheel(w,C.target)){return}var E=p.mouseWheel.deltaFactor!=="auto"?parseInt(p.mouseWheel.deltaFactor):(k&&C.deltaFactor<100)?100:C.deltaFactor||100;if(p.axis==="x"||p.mouseWheel.axis==="x"){var z="x",F=[Math.round(E*v.scrollRatio.x),parseInt(p.mouseWheel.scrollAmount)],B=p.mouseWheel.scrollAmount!=="auto"?F[1]:F[0]>=q.width()?q.width()*0.9:F[0],H=Math.abs(j("#mCSB_"+v.idx+"_container")[0].offsetLeft),D=x[1][0].offsetLeft,A=x[1].parent().width()-x[1].width(),y=C.deltaX||C.deltaY||G}else{var z="y",F=[Math.round(E*v.scrollRatio.y),parseInt(p.mouseWheel.scrollAmount)],B=p.mouseWheel.scrollAmount!=="auto"?F[1]:F[0]>=q.height()?q.height()*0.9:F[0],H=Math.abs(j("#mCSB_"+v.idx+"_container")[0].offsetTop),D=x[0][0].offsetTop,A=x[0].parent().height()-x[0].height(),y=C.deltaY||G}if((z==="y"&&!v.overflowed[0])||(z==="x"&&!v.overflowed[1])){return}if(p.mouseWheel.invert){y=-y}if(p.mouseWheel.normalizeDelta){y=y<0?-1:1}if((y>0&&D!==0)||(y<0&&D!==A)||p.mouseWheel.preventDefault){C.stopImmediatePropagation();C.preventDefault()}i._scrollTo(w,(H-(y*B)).toString(),{dir:z})})}function u(z){var y=null;try{var B=z.contentDocument||z.contentWindow.document;y=B.body.innerHTML}catch(A){}return(y!==null)}},_disableMousewheel:function(r,t){var p=t.nodeName.toLowerCase(),q=r.data(d).opt.mouseWheel.disableOver,s=["select","textarea"];return j.inArray(p,q)>-1&&!(j.inArray(p,s)>-1&&!j(t).is(":focus"))},_draggerRail:function(){var s=j(this),t=s.data(d),q=d+"_"+t.idx,r=j("#mCSB_"+t.idx+"_container"),u=r.parent(),p=j(".mCSB_"+t.idx+"_scrollbar .mCSB_draggerContainer");p.bind("touchstart."+q+" pointerdown."+q+" MSPointerDown."+q,function(v){n=true}).bind("touchend."+q+" pointerup."+q+" MSPointerUp."+q,function(v){n=false}).bind("click."+q,function(z){if(j(z.target).hasClass("mCSB_draggerContainer")||j(z.target).hasClass("mCSB_draggerRail")){i._stop(s);var w=j(this),y=w.find(".mCSB_dragger");if(w.parent(".mCSB_scrollTools_horizontal").length>0){if(!t.overflowed[1]){return}var v="x",x=z.pageX>y.offset().left?-1:1,A=Math.abs(r[0].offsetLeft)-(x*(u.width()*0.9))}else{if(!t.overflowed[0]){return}var v="y",x=z.pageY>y.offset().top?-1:1,A=Math.abs(r[0].offsetTop)-(x*(u.height()*0.9))}i._scrollTo(s,A.toString(),{dir:v,scrollEasing:"mcsEaseInOut"})}})},_focus:function(){var r=j(this),t=r.data(d),s=t.opt,p=d+"_"+t.idx,q=j("#mCSB_"+t.idx+"_container"),u=q.parent();q.bind("focusin."+p,function(x){var w=j(a.activeElement),y=q.find(".mCustomScrollBox").length,v=0;if(!w.is(s.advanced.autoScrollOnFocus)){return}i._stop(r);clearTimeout(r[0]._focusTimeout);r[0]._focusTimer=y?(v+17)*y:0;r[0]._focusTimeout=setTimeout(function(){var C=[w.offset().top-q.offset().top,w.offset().left-q.offset().left],B=[q[0].offsetTop,q[0].offsetLeft],z=[(B[0]+C[0]>=0&&B[0]+C[0]=0&&B[0]+C[1]a");q.bind("mousedown."+r+" touchstart."+r+" pointerdown."+r+" MSPointerDown."+r+" mouseup."+r+" touchend."+r+" pointerup."+r+" MSPointerUp."+r+" mouseout."+r+" pointerout."+r+" MSPointerOut."+r+" click."+r,function(z){z.preventDefault();if(!i._mouseBtnLeft(z)){return}var y=j(this).attr("class");p.type=v.scrollButtons.scrollType;switch(z.type){case"mousedown":case"touchstart":case"pointerdown":case"MSPointerDown":if(p.type==="stepped"){return}n=true;w.tweenRunning=false;x("on",y);break;case"mouseup":case"touchend":case"pointerup":case"MSPointerUp":case"mouseout":case"pointerout":case"MSPointerOut":if(p.type==="stepped"){return}n=false;if(p.dir){x("off",y)}break;case"click":if(p.type!=="stepped"||w.tweenRunning){return}x("on",y);break}function x(A,B){p.scrollAmount=v.snapAmount||v.scrollButtons.scrollAmount;i._sequentialScroll.call(this,u,A,B)}})},_keyboard:function(){var u=j(this),t=u.data(d),q=t.opt,x=t.sequential,s=d+"_"+t.idx,r=j("#mCSB_"+t.idx),w=j("#mCSB_"+t.idx+"_container"),p=w.parent(),v="input,textarea,select,datalist,keygen,[contenteditable='true']";r.attr("tabindex","0").bind("blur."+s+" keydown."+s+" keyup."+s,function(D){switch(D.type){case"blur":if(t.tweenRunning&&x.dir){y("off",null)}break;case"keydown":case"keyup":var A=D.keyCode?D.keyCode:D.which,B="on";if((q.axis!=="x"&&(A===38||A===40))||(q.axis!=="y"&&(A===37||A===39))){if(((A===38||A===40)&&!t.overflowed[0])||((A===37||A===39)&&!t.overflowed[1])){return}if(D.type==="keyup"){B="off"}if(!j(a.activeElement).is(v)){D.preventDefault();D.stopImmediatePropagation();y(B,A)}}else{if(A===33||A===34){if(t.overflowed[0]||t.overflowed[1]){D.preventDefault();D.stopImmediatePropagation()}if(D.type==="keyup"){i._stop(u);var C=A===34?-1:1;if(q.axis==="x"||(q.axis==="yx"&&t.overflowed[1]&&!t.overflowed[0])){var z="x",E=Math.abs(w[0].offsetLeft)-(C*(p.width()*0.9))}else{var z="y",E=Math.abs(w[0].offsetTop)-(C*(p.height()*0.9))}i._scrollTo(u,E.toString(),{dir:z,scrollEasing:"mcsEaseInOut"})}}else{if(A===35||A===36){if(!j(a.activeElement).is(v)){if(t.overflowed[0]||t.overflowed[1]){D.preventDefault();D.stopImmediatePropagation()}if(D.type==="keyup"){if(q.axis==="x"||(q.axis==="yx"&&t.overflowed[1]&&!t.overflowed[0])){var z="x",E=A===35?Math.abs(p.width()-w.outerWidth(false)):0}else{var z="y",E=A===35?Math.abs(p.height()-w.outerHeight(false)):0}i._scrollTo(u,E.toString(),{dir:z,scrollEasing:"mcsEaseInOut"})}}}}}break}function y(F,G){x.type=q.keyboard.scrollType;x.scrollAmount=q.snapAmount||q.keyboard.scrollAmount;if(x.type==="stepped"&&t.tweenRunning){return}i._sequentialScroll.call(this,u,F,G)}})},_sequentialScroll:function(r,u,s){var w=r.data(d),q=w.opt,y=w.sequential,x=j("#mCSB_"+w.idx+"_container"),p=y.type==="stepped"?true:false;switch(u){case"on":y.dir=[(s==="mCSB_buttonRight"||s==="mCSB_buttonLeft"||s===39||s===37?"x":"y"),(s==="mCSB_buttonUp"||s==="mCSB_buttonLeft"||s===38||s===37?-1:1)];i._stop(r);if(i._isNumeric(s)&&y.type==="stepped"){return}t(p);break;case"off":v();if(p||(w.tweenRunning&&y.dir)){t(true)}break}function t(z){var F=y.type!=="stepped",J=!z?1000/60:F?q.scrollInertia/1.5:q.scrollInertia,B=!z?2.5:F?7.5:40,I=[Math.abs(x[0].offsetTop),Math.abs(x[0].offsetLeft)],E=[w.scrollRatio.y>10?10:w.scrollRatio.y,w.scrollRatio.x>10?10:w.scrollRatio.x],C=y.dir[0]==="x"?I[1]+(y.dir[1]*(E[1]*B)):I[0]+(y.dir[1]*(E[0]*B)),H=y.dir[0]==="x"?I[1]+(y.dir[1]*parseInt(y.scrollAmount)):I[0]+(y.dir[1]*parseInt(y.scrollAmount)),G=y.scrollAmount!=="auto"?H:C,D=!z?"mcsLinear":F?"mcsLinearOut":"mcsEaseInOut",A=!z?false:true;if(z&&J<17){G=y.dir[0]==="x"?I[1]:I[0]}i._scrollTo(r,G.toString(),{dir:y.dir[0],scrollEasing:D,dur:J,onComplete:A});if(z){y.dir=false;return}clearTimeout(y.step);y.step=setTimeout(function(){t()},J)}function v(){clearTimeout(y.step);i._stop(r)}},_arr:function(r){var q=j(this).data(d).opt,p=[];if(typeof r==="function"){r=r()}if(!(r instanceof Array)){p[0]=r.y?r.y:r.x||q.axis==="x"?null:r;p[1]=r.x?r.x:r.y||q.axis==="y"?null:r}else{p=r.length>1?[r[0],r[1]]:q.axis==="x"?[null,r[0]]:[r[0],null]}if(typeof p[0]==="function"){p[0]=p[0]()}if(typeof p[1]==="function"){p[1]=p[1]()}return p},_to:function(v,w){if(v==null||typeof v=="undefined"){return}var C=j(this),B=C.data(d),u=B.opt,D=j("#mCSB_"+B.idx+"_container"),r=D.parent(),F=typeof v;if(!w){w=u.axis==="x"?"x":"y"}var q=w==="x"?D.outerWidth(false):D.outerHeight(false),x=w==="x"?D.offset().left:D.offset().top,E=w==="x"?D[0].offsetLeft:D[0].offsetTop,z=w==="x"?"left":"top";switch(F){case"function":return v();break;case"object":if(v.nodeType){var A=w==="x"?j(v).offset().left:j(v).offset().top}else{if(v.jquery){if(!v.length){return}var A=w==="x"?v.offset().left:v.offset().top}}return A-x;break;case"string":case"number":if(i._isNumeric.call(null,v)){return Math.abs(v)}else{if(v.indexOf("%")!==-1){return Math.abs(q*parseInt(v)/100)}else{if(v.indexOf("-=")!==-1){return Math.abs(E-parseInt(v.split("-=")[1]))}else{if(v.indexOf("+=")!==-1){var s=(E+parseInt(v.split("+=")[1]));return s>=0?0:Math.abs(s)}else{if(v.indexOf("px")!==-1&&i._isNumeric.call(null,v.split("px")[0])){return Math.abs(v.split("px")[0])}else{if(v==="top"||v==="left"){return 0}else{if(v==="bottom"){return Math.abs(r.height()-D.outerHeight(false))}else{if(v==="right"){return Math.abs(r.width()-D.outerWidth(false))}else{if(v==="first"||v==="last"){var y=D.find(":"+v),A=w==="x"?j(y).offset().left:j(y).offset().top;return A-x}else{if(j(v).length){var A=w==="x"?j(v).offset().left:j(v).offset().top;return A-x}else{D.css(z,v);e.update.call(null,C[0]);return}}}}}}}}}}break}},_autoUpdate:function(q){var t=j(this),F=t.data(d),z=F.opt,v=j("#mCSB_"+F.idx+"_container");if(q){clearTimeout(v[0].autoUpdate);i._delete.call(null,v[0].autoUpdate);return}var s=v.parent(),p=[j("#mCSB_"+F.idx+"_scrollbar_vertical"),j("#mCSB_"+F.idx+"_scrollbar_horizontal")],D=function(){return[p[0].is(":visible")?p[0].outerHeight(true):0,p[1].is(":visible")?p[1].outerWidth(true):0]},E=y(),x,u=[v.outerHeight(false),v.outerWidth(false),s.height(),s.width(),D()[0],D()[1]],H,B=G(),w;C();function C(){clearTimeout(v[0].autoUpdate);v[0].autoUpdate=setTimeout(function(){if(z.advanced.updateOnSelectorChange){x=y();if(x!==E){r();E=x;return}}if(z.advanced.updateOnContentResize){H=[v.outerHeight(false),v.outerWidth(false),s.height(),s.width(),D()[0],D()[1]];if(H[0]!==u[0]||H[1]!==u[1]||H[2]!==u[2]||H[3]!==u[3]||H[4]!==u[4]||H[5]!==u[5]){r();u=H}}if(z.advanced.updateOnImageLoad){w=G();if(w!==B){v.find("img").each(function(){A(this.src)});B=w}}if(z.advanced.updateOnSelectorChange||z.advanced.updateOnContentResize||z.advanced.updateOnImageLoad){C()}},60)}function G(){var I=0;if(z.advanced.updateOnImageLoad){I=v.find("img").length}return I}function A(L){var I=new Image();function K(M,N){return function(){return N.apply(M,arguments)}}function J(){this.onload=null;r()}I.onload=K(I,J);I.src=L}function y(){if(z.advanced.updateOnSelectorChange===true){z.advanced.updateOnSelectorChange="*"}var I=0,J=v.find(z.advanced.updateOnSelectorChange);if(z.advanced.updateOnSelectorChange&&J.length>0){J.each(function(){I+=j(this).height()+j(this).width()})}return I}function r(){clearTimeout(v[0].autoUpdate);e.update.call(null,t[0])}},_snapAmount:function(r,p,q){return(Math.round(r/p)*p-q)},_stop:function(p){var r=p.data(d),q=j("#mCSB_"+r.idx+"_container,#mCSB_"+r.idx+"_container_wrapper,#mCSB_"+r.idx+"_dragger_vertical,#mCSB_"+r.idx+"_dragger_horizontal");q.each(function(){i._stopTween.call(this)})},_scrollTo:function(q,s,u){var I=q.data(d),E=I.opt,D={trigger:"internal",dir:"y",scrollEasing:"mcsEaseOut",drag:false,dur:E.scrollInertia,overwrite:"all",callbacks:true,onStart:true,onUpdate:true,onComplete:true},u=j.extend(D,u),G=[u.dur,(u.drag?0:u.dur)],v=j("#mCSB_"+I.idx),B=j("#mCSB_"+I.idx+"_container"),K=E.callbacks.onTotalScrollOffset?i._arr.call(q,E.callbacks.onTotalScrollOffset):[0,0],p=E.callbacks.onTotalScrollBackOffset?i._arr.call(q,E.callbacks.onTotalScrollBackOffset):[0,0];I.trigger=u.trigger;if(s==="_resetY"&&!I.contentReset.y){if(t("onOverflowYNone")){E.callbacks.onOverflowYNone.call(q[0])}I.contentReset.y=1}if(s==="_resetX"&&!I.contentReset.x){if(t("onOverflowXNone")){E.callbacks.onOverflowXNone.call(q[0])}I.contentReset.x=1}if(s==="_resetY"||s==="_resetX"){return}if((I.contentReset.y||!q[0].mcs)&&I.overflowed[0]){if(t("onOverflowY")){E.callbacks.onOverflowY.call(q[0])}I.contentReset.x=null}if((I.contentReset.x||!q[0].mcs)&&I.overflowed[1]){if(t("onOverflowX")){E.callbacks.onOverflowX.call(q[0])}I.contentReset.x=null}if(E.snapAmount){s=i._snapAmount(s,E.snapAmount,E.snapOffset)}switch(u.dir){case"x":var x=j("#mCSB_"+I.idx+"_dragger_horizontal"),z="left",C=B[0].offsetLeft,H=[v.width()-B.outerWidth(false),x.parent().width()-x.width()],r=[s,s===0?0:(s/I.scrollRatio.x)],L=K[1],J=p[1],A=L>0?L/I.scrollRatio.x:0,w=J>0?J/I.scrollRatio.x:0;break;case"y":var x=j("#mCSB_"+I.idx+"_dragger_vertical"),z="top",C=B[0].offsetTop,H=[v.height()-B.outerHeight(false),x.parent().height()-x.height()],r=[s,s===0?0:(s/I.scrollRatio.y)],L=K[0],J=p[0],A=L>0?L/I.scrollRatio.y:0,w=J>0?J/I.scrollRatio.y:0;break}if(r[1]<0||(r[0]===0&&r[1]===0)){r=[0,0]}else{if(r[1]>=H[1]){r=[H[0],H[1]]}else{r[0]=-r[0]}}if(!q[0].mcs){F()}clearTimeout(B[0].onCompleteTimeout);if(!I.tweenRunning&&((C===0&&r[0]>=0)||(C===H[0]&&r[0]<=H[0]))){return}i._tweenTo.call(null,x[0],z,Math.round(r[1]),G[1],u.scrollEasing);i._tweenTo.call(null,B[0],z,Math.round(r[0]),G[0],u.scrollEasing,u.overwrite,{onStart:function(){if(u.callbacks&&u.onStart&&!I.tweenRunning){if(t("onScrollStart")){F();E.callbacks.onScrollStart.call(q[0])}I.tweenRunning=true;i._onDragClasses(x);I.cbOffsets=y()}},onUpdate:function(){if(u.callbacks&&u.onUpdate){if(t("whileScrolling")){F();E.callbacks.whileScrolling.call(q[0])}}},onComplete:function(){if(u.callbacks&&u.onComplete){if(E.axis==="yx"){clearTimeout(B[0].onCompleteTimeout)}var M=B[0].idleTimer||0;B[0].onCompleteTimeout=setTimeout(function(){if(t("onScroll")){F();E.callbacks.onScroll.call(q[0])}if(t("onTotalScroll")&&r[1]>=H[1]-A&&I.cbOffsets[0]){F();E.callbacks.onTotalScroll.call(q[0])}if(t("onTotalScrollBack")&&r[1]<=w&&I.cbOffsets[1]){F();E.callbacks.onTotalScrollBack.call(q[0])}I.tweenRunning=false;B[0].idleTimer=0;i._onDragClasses(x,"hide")},M)}}});function t(M){return I&&E.callbacks[M]&&typeof E.callbacks[M]==="function"}function y(){return[E.callbacks.alwaysTriggerOffsets||C>=H[0]+L,E.callbacks.alwaysTriggerOffsets||C<=-J]}function F(){var O=[B[0].offsetTop,B[0].offsetLeft],P=[x[0].offsetTop,x[0].offsetLeft],M=[B.outerHeight(false),B.outerWidth(false)],N=[v.height(),v.width()];q[0].mcs={content:B,top:O[0],left:O[1],draggerTop:P[0],draggerLeft:P[1],topPct:Math.round((100*Math.abs(O[0]))/(Math.abs(M[0])-N[0])),leftPct:Math.round((100*Math.abs(O[1]))/(Math.abs(M[1])-N[1])),direction:u.dir}}},_tweenTo:function(r,u,s,q,B,t,K){var K=K||{},H=K.onStart||function(){},C=K.onUpdate||function(){},I=K.onComplete||function(){},z=i._getTime(),x,v=0,E=r.offsetTop,F=r.style,A;if(u==="left"){E=r.offsetLeft}var y=s-E;r._mcsstop=0;if(t!=="none"){D()}p();function J(){if(r._mcsstop){return}if(!v){H.call()}v=i._getTime()-z;G();if(v>=r._mcstime){r._mcstime=(v>r._mcstime)?v+x-(v-r._mcstime):v+x-1;if(r._mcstime0){r._mcscurrVal=w(r._mcstime,E,y,q,B);F[u]=Math.round(r._mcscurrVal)+"px"}else{F[u]=s+"px"}C.call()}function p(){x=1000/60;r._mcstime=v+x;A=(!b.requestAnimationFrame)?function(L){G();return setTimeout(L,0.01)}:b.requestAnimationFrame;r._mcsid=A(J)}function D(){if(r._mcsid==null){return}if(!b.requestAnimationFrame){clearTimeout(r._mcsid)}else{b.cancelAnimationFrame(r._mcsid)}r._mcsid=null}function w(N,M,R,Q,O){switch(O){case"linear":case"mcsLinear":return R*N/Q+M;break;case"mcsLinearOut":N/=Q;N--;return R*Math.sqrt(1-N*N)+M;break;case"easeInOutSmooth":N/=Q/2;if(N<1){return R/2*N*N+M}N--;return -R/2*(N*(N-2)-1)+M;break;case"easeInOutStrong":N/=Q/2;if(N<1){return R/2*Math.pow(2,10*(N-1))+M}N--;return R/2*(-Math.pow(2,-10*N)+2)+M;break;case"easeInOut":case"mcsEaseInOut":N/=Q/2;if(N<1){return R/2*N*N*N+M}N-=2;return R/2*(N*N*N+2)+M;break;case"easeOutSmooth":N/=Q;N--;return -R*(N*N*N*N-1)+M;break;case"easeOutStrong":return R*(-Math.pow(2,-10*N/Q)+1)+M;break;case"easeOut":case"mcsEaseOut":default:var P=(N/=Q)*N,L=P*N;return M+R*(0.499999999999997*L*P+-2.5*P*P+5.5*L+-6.5*P+4*N)}}},_getTime:function(){if(b.performance&&b.performance.now){return b.performance.now()}else{if(b.performance&&b.performance.webkitNow){return b.performance.webkitNow()}else{if(Date.now){return Date.now()}else{return new Date().getTime()}}}},_stopTween:function(){var p=this;if(p._mcsid==null){return}if(!b.requestAnimationFrame){clearTimeout(p._mcsid)}else{b.cancelAnimationFrame(p._mcsid)}p._mcsid=null;p._mcsstop=1},_delete:function(r){try{delete r}catch(q){r=null}},_mouseBtnLeft:function(p){return !(p.which&&p.which!==1)},_pointerTouch:function(q){var p=q.originalEvent.pointerType;return !(p&&p!=="touch"&&p!==2)},_isNumeric:function(p){return !isNaN(parseFloat(p))&&isFinite(p)}};j.fn[g]=function(p){if(e[p]){return e[p].apply(this,Array.prototype.slice.call(arguments,1))}else{if(typeof p==="object"||!p){return e.init.apply(this,arguments)}else{j.error("Method "+p+" does not exist")}}};j[g]=function(p){if(e[p]){return e[p].apply(this,Array.prototype.slice.call(arguments,1))}else{if(typeof p==="object"||!p){return e.init.apply(this,arguments)}else{j.error("Method "+p+" does not exist")}}};j[g].defaults=h;b[g]=true;j(b).load(function(){j(m)[g]()})}))}(window,document)); +/*! fancyBox v2.1.5 fancyapps.com | fancyapps.com/fancybox/#license */ +(function(r,G,f,v){var J=f("html"),n=f(r),p=f(G),b=f.fancybox=function(){b.open.apply(this,arguments)},I=navigator.userAgent.match(/msie/i),B=null,s=G.createTouch!==v,t=function(a){return a&&a.hasOwnProperty&&a instanceof f},q=function(a){return a&&"string"===f.type(a)},E=function(a){return q(a)&&0
    ',image:'',iframe:'",error:'

    The requested content cannot be loaded.
    Please try again later.

    ',closeBtn:'
    ',next:'',prev:''},openEffect:"fade",openSpeed:250,openEasing:"swing",openOpacity:!0, +openMethod:"zoomIn",closeEffect:"fade",closeSpeed:250,closeEasing:"swing",closeOpacity:!0,closeMethod:"zoomOut",nextEffect:"elastic",nextSpeed:250,nextEasing:"swing",nextMethod:"changeIn",prevEffect:"elastic",prevSpeed:250,prevEasing:"swing",prevMethod:"changeOut",helpers:{overlay:!0,title:!0},onCancel:f.noop,beforeLoad:f.noop,afterLoad:f.noop,beforeShow:f.noop,afterShow:f.noop,beforeChange:f.noop,beforeClose:f.noop,afterClose:f.noop},group:{},opts:{},previous:null,coming:null,current:null,isActive:!1, +isOpen:!1,isOpened:!1,wrap:null,skin:null,outer:null,inner:null,player:{timer:null,isActive:!1},ajaxLoad:null,imgPreload:null,transitions:{},helpers:{},open:function(a,d){if(a&&(f.isPlainObject(d)||(d={}),!1!==b.close(!0)))return f.isArray(a)||(a=t(a)?f(a).get():[a]),f.each(a,function(e,c){var k={},g,h,j,m,l;"object"===f.type(c)&&(c.nodeType&&(c=f(c)),t(c)?(k={href:c.data("fancybox-href")||c.attr("href"),title:c.data("fancybox-title")||c.attr("title"),isDom:!0,element:c},f.metadata&&f.extend(!0,k, +c.metadata())):k=c);g=d.href||k.href||(q(c)?c:null);h=d.title!==v?d.title:k.title||"";m=(j=d.content||k.content)?"html":d.type||k.type;!m&&k.isDom&&(m=c.data("fancybox-type"),m||(m=(m=c.prop("class").match(/fancybox\.(\w+)/))?m[1]:null));q(g)&&(m||(b.isImage(g)?m="image":b.isSWF(g)?m="swf":"#"===g.charAt(0)?m="inline":q(c)&&(m="html",j=c)),"ajax"===m&&(l=g.split(/\s+/,2),g=l.shift(),l=l.shift()));j||("inline"===m?g?j=f(q(g)?g.replace(/.*(?=#[^\s]+$)/,""):g):k.isDom&&(j=c):"html"===m?j=g:!m&&(!g&& +k.isDom)&&(m="inline",j=c));f.extend(k,{href:g,type:m,content:j,title:h,selector:l});a[e]=k}),b.opts=f.extend(!0,{},b.defaults,d),d.keys!==v&&(b.opts.keys=d.keys?f.extend({},b.defaults.keys,d.keys):!1),b.group=a,b._start(b.opts.index)},cancel:function(){var a=b.coming;a&&!1!==b.trigger("onCancel")&&(b.hideLoading(),b.ajaxLoad&&b.ajaxLoad.abort(),b.ajaxLoad=null,b.imgPreload&&(b.imgPreload.onload=b.imgPreload.onerror=null),a.wrap&&a.wrap.stop(!0,!0).trigger("onReset").remove(),b.coming=null,b.current|| +b._afterZoomOut(a))},close:function(a){b.cancel();!1!==b.trigger("beforeClose")&&(b.unbindEvents(),b.isActive&&(!b.isOpen||!0===a?(f(".fancybox-wrap").stop(!0).trigger("onReset").remove(),b._afterZoomOut()):(b.isOpen=b.isOpened=!1,b.isClosing=!0,f(".fancybox-item, .fancybox-nav").remove(),b.wrap.stop(!0,!0).removeClass("fancybox-opened"),b.transitions[b.current.closeMethod]())))},play:function(a){var d=function(){clearTimeout(b.player.timer)},e=function(){d();b.current&&b.player.isActive&&(b.player.timer= +setTimeout(b.next,b.current.playSpeed))},c=function(){d();p.unbind(".player");b.player.isActive=!1;b.trigger("onPlayEnd")};if(!0===a||!b.player.isActive&&!1!==a){if(b.current&&(b.current.loop||b.current.index=c.index?"next":"prev"],b.router=e||"jumpto",c.loop&&(0>a&&(a=c.group.length+a%c.group.length),a%=c.group.length),c.group[a]!==v&&(b.cancel(),b._start(a)))},reposition:function(a,d){var e=b.current,c=e?e.wrap:null,k;c&&(k=b._getPosition(d),a&&"scroll"===a.type?(delete k.position,c.stop(!0,!0).animate(k,200)):(c.css(k),e.pos=f.extend({},e.dim,k)))},update:function(a){var d= +a&&a.type,e=!d||"orientationchange"===d;e&&(clearTimeout(B),B=null);b.isOpen&&!B&&(B=setTimeout(function(){var c=b.current;c&&!b.isClosing&&(b.wrap.removeClass("fancybox-tmp"),(e||"load"===d||"resize"===d&&c.autoResize)&&b._setDimension(),"scroll"===d&&c.canShrink||b.reposition(a),b.trigger("onUpdate"),B=null)},e&&!s?0:300))},toggle:function(a){b.isOpen&&(b.current.fitToView="boolean"===f.type(a)?a:!b.current.fitToView,s&&(b.wrap.removeAttr("style").addClass("fancybox-tmp"),b.trigger("onUpdate")), +b.update())},hideLoading:function(){p.unbind(".loading");f("#fancybox-loading").remove()},showLoading:function(){var a,d;b.hideLoading();a=f('
    ').click(b.cancel).appendTo("body");p.bind("keydown.loading",function(a){if(27===(a.which||a.keyCode))a.preventDefault(),b.cancel()});b.defaults.fixed||(d=b.getViewport(),a.css({position:"absolute",top:0.5*d.h+d.y,left:0.5*d.w+d.x}))},getViewport:function(){var a=b.current&&b.current.locked||!1,d={x:n.scrollLeft(), +y:n.scrollTop()};a?(d.w=a[0].clientWidth,d.h=a[0].clientHeight):(d.w=s&&r.innerWidth?r.innerWidth:n.width(),d.h=s&&r.innerHeight?r.innerHeight:n.height());return d},unbindEvents:function(){b.wrap&&t(b.wrap)&&b.wrap.unbind(".fb");p.unbind(".fb");n.unbind(".fb")},bindEvents:function(){var a=b.current,d;a&&(n.bind("orientationchange.fb"+(s?"":" resize.fb")+(a.autoCenter&&!a.locked?" scroll.fb":""),b.update),(d=a.keys)&&p.bind("keydown.fb",function(e){var c=e.which||e.keyCode,k=e.target||e.srcElement; +if(27===c&&b.coming)return!1;!e.ctrlKey&&(!e.altKey&&!e.shiftKey&&!e.metaKey&&(!k||!k.type&&!f(k).is("[contenteditable]")))&&f.each(d,function(d,k){if(1h[0].clientWidth||h[0].clientHeight&&h[0].scrollHeight>h[0].clientHeight),h=f(h).parent();if(0!==c&&!j&&1g||0>k)b.next(0>g?"up":"right");d.preventDefault()}}))},trigger:function(a,d){var e,c=d||b.coming||b.current;if(c){f.isFunction(c[a])&&(e=c[a].apply(c,Array.prototype.slice.call(arguments,1)));if(!1===e)return!1;c.helpers&&f.each(c.helpers,function(d,e){if(e&&b.helpers[d]&&f.isFunction(b.helpers[d][a]))b.helpers[d][a](f.extend(!0, +{},b.helpers[d].defaults,e),c)});p.trigger(a)}},isImage:function(a){return q(a)&&a.match(/(^data:image\/.*,)|(\.(jp(e|g|eg)|gif|png|bmp|webp|svg)((\?|#).*)?$)/i)},isSWF:function(a){return q(a)&&a.match(/\.(swf)((\?|#).*)?$/i)},_start:function(a){var d={},e,c;a=l(a);e=b.group[a]||null;if(!e)return!1;d=f.extend(!0,{},b.opts,e);e=d.margin;c=d.padding;"number"===f.type(e)&&(d.margin=[e,e,e,e]);"number"===f.type(c)&&(d.padding=[c,c,c,c]);d.modal&&f.extend(!0,d,{closeBtn:!1,closeClick:!1,nextClick:!1,arrows:!1, +mouseWheel:!1,keys:null,helpers:{overlay:{closeClick:!1}}});d.autoSize&&(d.autoWidth=d.autoHeight=!0);"auto"===d.width&&(d.autoWidth=!0);"auto"===d.height&&(d.autoHeight=!0);d.group=b.group;d.index=a;b.coming=d;if(!1===b.trigger("beforeLoad"))b.coming=null;else{c=d.type;e=d.href;if(!c)return b.coming=null,b.current&&b.router&&"jumpto"!==b.router?(b.current.index=a,b[b.router](b.direction)):!1;b.isActive=!0;if("image"===c||"swf"===c)d.autoHeight=d.autoWidth=!1,d.scrolling="visible";"image"===c&&(d.aspectRatio= +!0);"iframe"===c&&s&&(d.scrolling="scroll");d.wrap=f(d.tpl.wrap).addClass("fancybox-"+(s?"mobile":"desktop")+" fancybox-type-"+c+" fancybox-tmp "+d.wrapCSS).appendTo(d.parent||"body");f.extend(d,{skin:f(".fancybox-skin",d.wrap),outer:f(".fancybox-outer",d.wrap),inner:f(".fancybox-inner",d.wrap)});f.each(["Top","Right","Bottom","Left"],function(a,b){d.skin.css("padding"+b,w(d.padding[a]))});b.trigger("onReady");if("inline"===c||"html"===c){if(!d.content||!d.content.length)return b._error("content")}else if(!e)return b._error("href"); +"image"===c?b._loadImage():"ajax"===c?b._loadAjax():"iframe"===c?b._loadIframe():b._afterLoad()}},_error:function(a){f.extend(b.coming,{type:"html",autoWidth:!0,autoHeight:!0,minWidth:0,minHeight:0,scrolling:"no",hasError:a,content:b.coming.tpl.error});b._afterLoad()},_loadImage:function(){var a=b.imgPreload=new Image;a.onload=function(){this.onload=this.onerror=null;b.coming.width=this.width/b.opts.pixelRatio;b.coming.height=this.height/b.opts.pixelRatio;b._afterLoad()};a.onerror=function(){this.onload= +this.onerror=null;b._error("image")};a.src=b.coming.href;!0!==a.complete&&b.showLoading()},_loadAjax:function(){var a=b.coming;b.showLoading();b.ajaxLoad=f.ajax(f.extend({},a.ajax,{url:a.href,error:function(a,e){b.coming&&"abort"!==e?b._error("ajax",a):b.hideLoading()},success:function(d,e){"success"===e&&(a.content=d,b._afterLoad())}}))},_loadIframe:function(){var a=b.coming,d=f(a.tpl.iframe.replace(/\{rnd\}/g,(new Date).getTime())).attr("scrolling",s?"auto":a.iframe.scrolling).attr("src",a.href); +f(a.wrap).bind("onReset",function(){try{f(this).find("iframe").hide().attr("src","//about:blank").end().empty()}catch(a){}});a.iframe.preload&&(b.showLoading(),d.one("load",function(){f(this).data("ready",1);s||f(this).bind("load.fb",b.update);f(this).parents(".fancybox-wrap").width("100%").removeClass("fancybox-tmp").show();b._afterLoad()}));a.content=d.appendTo(a.inner);a.iframe.preload||b._afterLoad()},_preloadImages:function(){var a=b.group,d=b.current,e=a.length,c=d.preload?Math.min(d.preload, +e-1):0,f,g;for(g=1;g<=c;g+=1)f=a[(d.index+g)%e],"image"===f.type&&f.href&&((new Image).src=f.href)},_afterLoad:function(){var a=b.coming,d=b.current,e,c,k,g,h;b.hideLoading();if(a&&!1!==b.isActive)if(!1===b.trigger("afterLoad",a,d))a.wrap.stop(!0).trigger("onReset").remove(),b.coming=null;else{d&&(b.trigger("beforeChange",d),d.wrap.stop(!0).removeClass("fancybox-opened").find(".fancybox-item, .fancybox-nav").remove());b.unbindEvents();e=a.content;c=a.type;k=a.scrolling;f.extend(b,{wrap:a.wrap,skin:a.skin, +outer:a.outer,inner:a.inner,current:a,previous:d});g=a.href;switch(c){case "inline":case "ajax":case "html":a.selector?e=f("
    ").html(e).find(a.selector):t(e)&&(e.data("fancybox-placeholder")||e.data("fancybox-placeholder",f('
    ').insertAfter(e).hide()),e=e.show().detach(),a.wrap.bind("onReset",function(){f(this).find(e).length&&e.hide().replaceAll(e.data("fancybox-placeholder")).data("fancybox-placeholder",!1)}));break;case "image":e=a.tpl.image.replace("{href}", +g);break;case "swf":e='',h="",f.each(a.swf,function(a,b){e+='';h+=" "+a+'="'+b+'"'}),e+='"}(!t(e)||!e.parent().is(a.inner))&&a.inner.append(e);b.trigger("beforeShow");a.inner.css("overflow","yes"===k?"scroll": +"no"===k?"hidden":k);b._setDimension();b.reposition();b.isOpen=!1;b.coming=null;b.bindEvents();if(b.isOpened){if(d.prevMethod)b.transitions[d.prevMethod]()}else f(".fancybox-wrap").not(a.wrap).stop(!0).trigger("onReset").remove();b.transitions[b.isOpened?a.nextMethod:a.openMethod]();b._preloadImages()}},_setDimension:function(){var a=b.getViewport(),d=0,e=!1,c=!1,e=b.wrap,k=b.skin,g=b.inner,h=b.current,c=h.width,j=h.height,m=h.minWidth,u=h.minHeight,n=h.maxWidth,p=h.maxHeight,s=h.scrolling,q=h.scrollOutside? +h.scrollbarWidth:0,x=h.margin,y=l(x[1]+x[3]),r=l(x[0]+x[2]),v,z,t,C,A,F,B,D,H;e.add(k).add(g).width("auto").height("auto").removeClass("fancybox-tmp");x=l(k.outerWidth(!0)-k.width());v=l(k.outerHeight(!0)-k.height());z=y+x;t=r+v;C=E(c)?(a.w-z)*l(c)/100:c;A=E(j)?(a.h-t)*l(j)/100:j;if("iframe"===h.type){if(H=h.content,h.autoHeight&&1===H.data("ready"))try{H[0].contentWindow.document.location&&(g.width(C).height(9999),F=H.contents().find("body"),q&&F.css("overflow-x","hidden"),A=F.outerHeight(!0))}catch(G){}}else if(h.autoWidth|| +h.autoHeight)g.addClass("fancybox-tmp"),h.autoWidth||g.width(C),h.autoHeight||g.height(A),h.autoWidth&&(C=g.width()),h.autoHeight&&(A=g.height()),g.removeClass("fancybox-tmp");c=l(C);j=l(A);D=C/A;m=l(E(m)?l(m,"w")-z:m);n=l(E(n)?l(n,"w")-z:n);u=l(E(u)?l(u,"h")-t:u);p=l(E(p)?l(p,"h")-t:p);F=n;B=p;h.fitToView&&(n=Math.min(a.w-z,n),p=Math.min(a.h-t,p));z=a.w-y;r=a.h-r;h.aspectRatio?(c>n&&(c=n,j=l(c/D)),j>p&&(j=p,c=l(j*D)),cz||y>r)&&(c>m&&j>u)&&!(19n&&(c=n,j=l(c/D)),g.width(c).height(j),e.width(c+x),a=e.width(),y=e.height();else c=Math.max(m,Math.min(c,c-(a-z))),j=Math.max(u,Math.min(j,j-(y-r)));q&&("auto"===s&&jz||y>r)&&c>m&&j>u;c=h.aspectRatio?cu&&j
    ').appendTo(b.coming?b.coming.parent:a.parent);this.fixed=!1;a.fixed&&b.defaults.fixed&&(this.overlay.addClass("fancybox-overlay-fixed"),this.fixed=!0)},open:function(a){var d=this;a=f.extend({},this.defaults,a);this.overlay?this.overlay.unbind(".overlay").width("auto").height("auto"):this.create(a);this.fixed||(n.bind("resize.overlay",f.proxy(this.update,this)),this.update());a.closeClick&&this.overlay.bind("click.overlay",function(a){if(f(a.target).hasClass("fancybox-overlay"))return b.isActive? +b.close():d.close(),!1});this.overlay.css(a.css).show()},close:function(){var a,b;n.unbind("resize.overlay");this.el.hasClass("fancybox-lock")&&(f(".fancybox-margin").removeClass("fancybox-margin"),a=n.scrollTop(),b=n.scrollLeft(),this.el.removeClass("fancybox-lock"),n.scrollTop(a).scrollLeft(b));f(".fancybox-overlay").remove().hide();f.extend(this,{overlay:null,fixed:!1})},update:function(){var a="100%",b;this.overlay.width(a).height("100%");I?(b=Math.max(G.documentElement.offsetWidth,G.body.offsetWidth), +p.width()>b&&(a=p.width())):p.width()>n.width()&&(a=p.width());this.overlay.width(a).height(p.height())},onReady:function(a,b){var e=this.overlay;f(".fancybox-overlay").stop(!0,!0);e||this.create(a);a.locked&&(this.fixed&&b.fixed)&&(e||(this.margin=p.height()>n.height()?f("html").css("margin-right").replace("px",""):!1),b.locked=this.overlay.append(b.wrap),b.fixed=!1);!0===a.showEarly&&this.beforeShow.apply(this,arguments)},beforeShow:function(a,b){var e,c;b.locked&&(!1!==this.margin&&(f("*").filter(function(){return"fixed"=== +f(this).css("position")&&!f(this).hasClass("fancybox-overlay")&&!f(this).hasClass("fancybox-wrap")}).addClass("fancybox-margin"),this.el.addClass("fancybox-margin")),e=n.scrollTop(),c=n.scrollLeft(),this.el.addClass("fancybox-lock"),n.scrollTop(e).scrollLeft(c));this.open(a)},onUpdate:function(){this.fixed||this.update()},afterClose:function(a){this.overlay&&!b.coming&&this.overlay.fadeOut(a.speedOut,f.proxy(this.close,this))}};b.helpers.title={defaults:{type:"float",position:"bottom"},beforeShow:function(a){var d= +b.current,e=d.title,c=a.type;f.isFunction(e)&&(e=e.call(d.element,d));if(q(e)&&""!==f.trim(e)){d=f('
    '+e+"
    ");switch(c){case "inside":c=b.skin;break;case "outside":c=b.wrap;break;case "over":c=b.inner;break;default:c=b.skin,d.appendTo("body"),I&&d.width(d.width()),d.wrapInner(''),b.current.margin[2]+=Math.abs(l(d.css("margin-bottom")))}d["top"===a.position?"prependTo":"appendTo"](c)}}};f.fn.fancybox=function(a){var d, +e=f(this),c=this.selector||"",k=function(g){var h=f(this).blur(),j=d,k,l;!g.ctrlKey&&(!g.altKey&&!g.shiftKey&&!g.metaKey)&&!h.is(".fancybox-wrap")&&(k=a.groupAttr||"data-fancybox-group",l=h.attr(k),l||(k="rel",l=h.get(0)[k]),l&&(""!==l&&"nofollow"!==l)&&(h=c.length?f(c):e,h=h.filter("["+k+'="'+l+'"]'),j=h.index(this)),a.index=j,!1!==b.open(h,a)&&g.preventDefault())};a=a||{};d=a.index||0;!c||!1===a.live?e.unbind("click.fb-start").bind("click.fb-start",k):p.undelegate(c,"click.fb-start").delegate(c+ +":not('.fancybox-item, .fancybox-nav')","click.fb-start",k);this.filter("[data-fancybox-start=1]").trigger("click");return this};p.ready(function(){var a,d;f.scrollbarWidth===v&&(f.scrollbarWidth=function(){var a=f('
    ').appendTo("body"),b=a.children(),b=b.innerWidth()-b.height(99).innerWidth();a.remove();return b});if(f.support.fixedPosition===v){a=f.support;d=f('
    ').appendTo("body");var e=20=== +d[0].offsetTop||15===d[0].offsetTop;d.remove();a.fixedPosition=e}f.extend(b.defaults,{scrollbarWidth:f.scrollbarWidth(),fixed:f.support.fixedPosition,parent:f("body")});a=f(r).width();J.addClass("fancybox-lock-test");d=f(r).width();J.removeClass("fancybox-lock-test");f("").appendTo("head")})})(window,document,jQuery); +/*! http://mths.be/placeholder v2.0.7 by @mathias */ +;(function(window, document, $) { + + var isInputSupported = 'placeholder' in document.createElement('input'); + var isTextareaSupported = 'placeholder' in document.createElement('textarea'); + var prototype = $.fn; + var valHooks = $.valHooks; + var propHooks = $.propHooks; + var hooks; + var placeholder; + + if (isInputSupported && isTextareaSupported) { + + placeholder = prototype.placeholder = function() { + return this; + }; + + placeholder.input = placeholder.textarea = true; + + } else { + + placeholder = prototype.placeholder = function() { + var $this = this; + $this + .filter((isInputSupported ? 'textarea' : ':input') + '[placeholder]') + .not('.placeholder') + .bind({ + 'focus.placeholder': clearPlaceholder, + 'blur.placeholder': setPlaceholder + }) + .data('placeholder-enabled', true) + .trigger('blur.placeholder'); + return $this; + }; + + placeholder.input = isInputSupported; + placeholder.textarea = isTextareaSupported; + + hooks = { + 'get': function(element) { + var $element = $(element); + + var $passwordInput = $element.data('placeholder-password'); + if ($passwordInput) { + return $passwordInput[0].value; + } + + return $element.data('placeholder-enabled') && $element.hasClass('placeholder') ? '' : element.value; + }, + 'set': function(element, value) { + var $element = $(element); + + var $passwordInput = $element.data('placeholder-password'); + if ($passwordInput) { + return $passwordInput[0].value = value; + } + + if (!$element.data('placeholder-enabled')) { + return element.value = value; + } + if (value == '') { + element.value = value; + // Issue #56: Setting the placeholder causes problems if the element continues to have focus. + if (element != safeActiveElement()) { + // We can't use `triggerHandler` here because of dummy text/password inputs :( + setPlaceholder.call(element); + } + } else if ($element.hasClass('placeholder')) { + clearPlaceholder.call(element, true, value) || (element.value = value); + } else { + element.value = value; + } + // `set` can not return `undefined`; see http://jsapi.info/jquery/1.7.1/val#L2363 + return $element; + } + }; + + if (!isInputSupported) { + valHooks.input = hooks; + propHooks.value = hooks; + } + if (!isTextareaSupported) { + valHooks.textarea = hooks; + propHooks.value = hooks; + } + + $(function() { + // Look for forms + $(document).delegate('form', 'submit.placeholder', function() { + // Clear the placeholder values so they don't get submitted + var $inputs = $('.placeholder', this).each(clearPlaceholder); + setTimeout(function() { + $inputs.each(setPlaceholder); + }, 10); + }); + }); + + // Clear placeholder values upon page reload + $(window).bind('beforeunload.placeholder', function() { + $('.placeholder').each(function() { + this.value = ''; + }); + }); + + } + + function args(elem) { + // Return an object of element attributes + var newAttrs = {}; + var rinlinejQuery = /^jQuery\d+$/; + $.each(elem.attributes, function(i, attr) { + if (attr.specified && !rinlinejQuery.test(attr.name)) { + newAttrs[attr.name] = attr.value; + } + }); + return newAttrs; + } + + function clearPlaceholder(event, value) { + var input = this; + var $input = $(input); + if (input.value == $input.attr('placeholder') && $input.hasClass('placeholder')) { + if ($input.data('placeholder-password')) { + $input = $input.hide().next().show().attr('id', $input.removeAttr('id').data('placeholder-id')); + // If `clearPlaceholder` was called from `$.valHooks.input.set` + if (event === true) { + return $input[0].value = value; + } + $input.focus(); + } else { + input.value = ''; + $input.removeClass('placeholder'); + input == safeActiveElement() && input.select(); + } + } + } + + function setPlaceholder() { + var $replacement; + var input = this; + var $input = $(input); + var id = this.id; + if (input.value == '') { + if (input.type == 'password') { + if (!$input.data('placeholder-textinput')) { + try { + $replacement = $input.clone().attr({ 'type': 'text' }); + } catch(e) { + $replacement = $('').attr($.extend(args(this), { 'type': 'text' })); + } + $replacement + .removeAttr('name') + .data({ + 'placeholder-password': $input, + 'placeholder-id': id + }) + .bind('focus.placeholder', clearPlaceholder); + $input + .data({ + 'placeholder-textinput': $replacement, + 'placeholder-id': id + }) + .before($replacement); + } + $input = $input.removeAttr('id').hide().prev().attr('id', id).show(); + // Note: `$input[0] != input` now! + } + $input.addClass('placeholder'); + $input[0].value = $input.attr('placeholder'); + } else { + $input.removeClass('placeholder'); + } + } + + function safeActiveElement() { + // Avoid IE9 `document.activeElement` of death + // https://github.com/mathiasbynens/jquery-placeholder/pull/99 + try { + return document.activeElement; + } catch (err) {} + } + +}(this, document, jQuery)); + +/* + * jQuery PhotoTag plugin 1.3 + * + * Copyright (c) 2012 Karl Mendes + * http://karlmendes.com + * + * Dual licensed under the MIT and GPL licenses: + * http://www.opensource.org/licenses/mit-license.php + * + * Revision: + * Customized for Expomap +*/ +// Limit scope pollution from any deprecated API +(function() { + + var matched, browser; + +// Use of jQuery.browser is frowned upon. +// More details: http://api.jquery.com/jQuery.browser +// jQuery.uaMatch maintained for back-compat + jQuery.uaMatch = function( ua ) { + ua = ua.toLowerCase(); + + var match = /(chrome)[ \/]([\w.]+)/.exec( ua ) || + /(webkit)[ \/]([\w.]+)/.exec( ua ) || + /(opera)(?:.*version|)[ \/]([\w.]+)/.exec( ua ) || + /(msie) ([\w.]+)/.exec( ua ) || + ua.indexOf("compatible") < 0 && /(mozilla)(?:.*? rv:([\w.]+)|)/.exec( ua ) || + []; + + return { + browser: match[ 1 ] || "", + version: match[ 2 ] || "0" + }; + }; + + matched = jQuery.uaMatch( navigator.userAgent ); + browser = {}; + + if ( matched.browser ) { + browser[ matched.browser ] = true; + browser.version = matched.version; + } + +// Chrome is Webkit, but Webkit is also Safari. + if ( browser.chrome ) { + browser.webkit = true; + } else if ( browser.webkit ) { + browser.safari = true; + } + + jQuery.browser = browser; + + jQuery.sub = function() { + function jQuerySub( selector, context ) { + return new jQuerySub.fn.init( selector, context ); + } + jQuery.extend( true, jQuerySub, this ); + jQuerySub.superclass = this; + jQuerySub.fn = jQuerySub.prototype = this(); + jQuerySub.fn.constructor = jQuerySub; + jQuerySub.sub = this.sub; + jQuerySub.fn.init = function init( selector, context ) { + if ( context && context instanceof jQuery && !(context instanceof jQuerySub) ) { + context = jQuerySub( context ); + } + + return jQuery.fn.init.call( this, selector, context, rootjQuerySub ); + }; + jQuerySub.fn.init.prototype = jQuerySub.fn; + var rootjQuerySub = jQuerySub(document); + return jQuerySub; + }; + +})(); +(function($) { + + $.fn.photoTag = function( options ){ + + var defaultOptions = { + //requestTagsUrl: '/photo/existing-tags/', + deleteTagsUrl: '/photo/delete-tag/', + addTagUrl: '/add-tag.php', + parametersForNewTag: { + name: { + parameterKey: 'name', + isAutocomplete: true, + label: 'Name' + } + }, + parametersForRequest : ['image-id','album-id'], + literals:{ + communicationProblem: 'Произошла ошибка. Изменения не сохранены.', + saveTag: 'Добавить', + cancelTag: '', + addNewTag: 'Отметить человека', + removeTag: 'X' + }, + tag: { + tagIdParameter: 'tag-id', + defaultWidth: 100, + defaultHeight: 100, + isResizable: true, + minWidth: 50, + minHeight: 50, + maxWidth: 150, + maxHeight: 150, + cssClass: 'photoTag-tag', + idPrefix: 'photoTag-tag_', + showDeleteLinkOnTag: true, + deleteLinkCssClass: 'photoTag-delete', + deleteLinkIdPrefix: 'photoTag-delete_', + flashAfterCreation: true, + newTagFormWidth: 170, + newTagFormClass: 'photoTag-newTagForm' + }, + imageWrapBox: { + cssClass: 'photoTag-wrap', + idPrefix: 'photoTag-wrap_', + addNewLinkIdPrefix: 'photoTag-add_', + controlPaneIdPrefix: 'photoTag-cpanel_', + showTagList: true, + tagListCssClass: 'photoTag-taglist', + tagListIdPrefix: 'photoTag-taglist_', + tagListRemoveItemIdPrefix: 'photoTag-removeTag', + canvasIdPrefix: 'photoTag-canvas_', + controlPanelHeight: 25 + }, + showAddTagLinks: true, + externalAddTagLinks: { + bind: true, + selector: ".addTag" + }, + isEnabledToEditTags: true, + manageError: 'internal function, user can bind a new one. function(response)', + beforeTagRequest: 'bind by user, function( parameters )' + }; + + var cache = { + tags: {} + }; + + var options = $.extend(true,defaultOptions,options); + + var getParametersForImage = function( imageElement ){ + var parameters = {}; + $.each(options.parametersForRequest,function( i, key){ + var parameterValue = imageElement.attr('data-'+key); + if(parameterValue) + parameters[key] = parameterValue; + }); + return parameters; + }; + function mover(elem){ + elem.parent().css({'overflow':'visible'}); + elem.parent().find('.utag-bot, .utag-top, .utag-right, .utag-left').show(); + elem.parent().find('.utag-bot').css({ + 'top': elem.parent().css('height') + }); + elem.parent().find('.utag-right').css({ + 'height': elem.parent().css('height'), + 'left': elem.parent().css('width') + }); + elem.parent().find('.utag-left').css({ + 'height': elem.parent().css('height') + }); + elem.parent().stop().animate({ opacity: 1.0 }, 500); + }; + function mleave(elem){ + + elem.parent().stop().animate({ opacity: 0.0 }, 500, function() { + elem.parent().css({'overflow':'hidden'}); + }); + elem.parent().find('.utag-bot, .utag-top, .utag-right, .utag-left').hide(); + }; + function moverie(elem){ + elem.css({'overflow':'visible'}); + elem.find('.utag-bot, .utag-top, .utag-right, .utag-left').show(); + elem.find('.utag-bot').css({ + 'top': elem.css('height') + }); + elem.find('.utag-right').css({ + 'height': elem.css('height'), + 'left': elem.css('width') + }); + elem.find('.utag-left').css({ + 'height': elem.css('height') + }); + elem.stop().animate({ opacity: 1.0 }, 500); + }; + function mleaveie(elem){ + + elem.stop().animate({ opacity: 0.0 }, 500, function() { + elem.css({'overflow':'hidden'}); + }); + elem.find('.utag-bot, .utag-top, .utag-right, .utag-left').hide(); + }; + function registerHighlightHovers() { + $('.highlight-tag').each(function() { + $(this).mouseenter( + function() { + moverie($('#photoTag-tag_'+$(this).attr('tag-id'))); + } + ).mouseleave( + function() { + mleaveie($('#photoTag-tag_'+$(this).attr('tag-id'))); + } + ); + }); + }; + + var manageError = function( response ){ + if( $.isFunction(options.manageError) ) + options.manageError(response); + else{ + if(response.message) + alert(response.message); + else + alert(options.literals.communicationProblem); + } + }; + + var registerEventsForDeleteLink = function( link, image ){ + link.click( + function(e){ + e.preventDefault(); + var tagId = link.attr('href').substring(1); + var parameters = getParametersForImage(image); + parameters[options.tag.tagIdParameter] = tagId; + $.getJSON(options.deleteTagsUrl,parameters, + function( data ){ + if(!data.result) + manageError(data); + } + ); + $('#' + options.tag.deleteLinkIdPrefix + tagId).parents().eq(1).remove(); + $('#' + options.imageWrapBox.tagListRemoveItemIdPrefix + tagId).parent().remove(); + //Удаляем запятую последнего элемента в списке: + var comma=$('span.comma'); + var hltag=$('a.highlight-tag'); + $('ul.photoTag-taglist li').last().find(comma).remove(); + $('ul.photoTag-taglist li').last().find(hltag).mouseover( + function() { + mover($('#photoTag-tag_'+$(this).attr('tag-id')).find('.taghover')); + } + ).mouseleave( + function() { + mleave($('#photoTag-tag_'+$(this).attr('tag-id')).find('.taghover')); + } + ); + return false; + } + ); + + }; + + + var registerEventsForAddTagLink = function( link, image, image_id ){ + $(link).click(function(e){ + e.preventDefault(); + if($('#' + options.tag.idPrefix + 'expo').length == 0){ + hideAllTags(image_id); + $('#' + options.imageWrapBox.idPrefix + image_id).append(createExpoTag(image)); + prepareExpoTagBox($('#' + options.tag.idPrefix + 'expo'),image,image_id); + } + }); + }; + + var dragOrResizeEventHandler = function( e, ui ){ + var $this = $(this); + var tagPosition = $(this).position(); + var x = tagPosition.left; + var y = tagPosition.top; + if($("#expoTagBoxForm")){ + $("#expoTagBoxForm").css({ + 'top':y, + 'left':x + $(this).width() + 10 + }); + }; + $('#photoTag-tag_expo .utag-right').css({ + 'height': $(this).height(), + 'left': $(this).width() + }); + $('#photoTag-tag_expo .utag-left').css({ + 'height': $(this).height() + }); + $('#photoTag-tag_expo .utag-bot').css({ + 'top': $(this).height() + }); + + + } + var dragStartHandler = function( e, ui ) { + if($("#expoTagBoxForm")){ + $("#expoTagBoxForm").css({ + 'display':'none' + }); + }; + }; + var dragStopHandler = function( e, ui ) { + var $this = $(this); + var tagPosition = $(this).position(); + var x = tagPosition.left; + var y = tagPosition.top; + if($("#expoTagBoxForm")){ + $("#expoTagBoxForm").css({ + 'display':'block', + 'top':y, + 'left':x + $(this).width() + 10 + }); + }; + }; + + var prepareExpoTagBox = function( expoTagBox, image, image_id ){ + expoTagBox.draggable({ + containment: image, + cursor: 'move', + drag: dragOrResizeEventHandler, + start: dragStartHandler, + stop: dragStopHandler, + grid: [1,1] + }); + expoTagBox.resizable({ + handles: 'n, e, s, w, ne, se, sw, nw', + maxHeight: image.height(), + maxWidth: image.width(), + minHeight: options.tag.minHeight, + minWidth: options.tag.minWidth, + containment: image, + resize: dragOrResizeEventHandler + }); + createNewTagForm(expoTagBox,image,image_id); + $('.utag-bot').css({ + 'top': options.tag.defaultWidth + }); + $('.utag-right').css({ + 'height': options.tag.defaultHeight, + 'left': options.tag.defaultWidth + }); + $('.utag-left').css({ + 'height': options.tag.defaultHeight + }); + + }; + + var createNewTagForm = function( expoTagBox, image, image_id ){ + var form = $('
    '); + var newTagFormBox = $('
    '); + var expoTagBoxPosition = $(expoTagBox).position(); + newTagFormBox.css({ + 'position':'absolute', + 'top': expoTagBoxPosition.top, + 'left': expoTagBoxPosition.left + expoTagBox.width() + 10, + 'width' : options.tag.newTagFormWidth + }); + newTagFormBox.append($('
    ')); + var imageWrapper = $("#" + options.imageWrapBox.idPrefix + image_id); + imageWrapper.append(newTagFormBox); + $('#expoNewTagFormContent').append(form); + $.each(options.parametersForNewTag,function( i, properties ){ + var input = $('
    '); + if(properties.label){ + var label = $(''); + var div = $('
    '); + label.append(properties.label); + $('#expoNewTagForm').append(label); + }; + $('#expoNewTagForm').append(input); + $('#expoInput_name').bind( "keydown", function( event ) { + if ( event.keyCode === $.ui.keyCode.TAB && + $( this ).data( "ui-autocomplete" ).menu.active ) { + event.preventDefault(); + } + }) + .autocomplete({ + appendTo: $('.ptListHolder'), + minLength: 1, + source: function (request, response) { + var term = $.ui.autocomplete.escapeRegex(request.term) + , startsWithMatcher = new RegExp("^" + term, "i") + , startsWith = $.grep(photoTagData, function(value) { + return startsWithMatcher.test(value.label || value.value || value); + }) + , containsMatcher = new RegExp(term, "i") + , contains = $.grep(photoTagData, function (value) { + return $.inArray(value, startsWith) < 0 && + containsMatcher.test(value.label || value.value || value); + }); + + response(startsWith.concat(contains)); + }, + focus: function() { + return false; + }, + select: function( event, ui){ + $('#hidden_expoInput_name').val(ui.item.id); + } + }); + $('#expoInput_name').parent().append($('')); + + + }); + var submit = $(''); + $('#expoNewTagForm').append(submit); + var hiddenInput = $(""); + $('#expoNewTagForm').append(hiddenInput); + var cancel = $(''); + cancel.click(function(e){ + e.preventDefault(); + removeNewExpoTag(); + showAllTags(image_id); + return false; + }); + $('#expoNewTagForm').append(cancel); + $('#expoNewTagForm').submit(function(e){ + e.preventDefault(); + var expoTagBox = $('#'+options.tag.idPrefix+'expo'); + var tag = { + left: expoTagBox.position().left, + top: expoTagBox.position().top, + width: expoTagBox.width(), + height: expoTagBox.height() + } + $.getJSON(options.addTagUrl+'?'+$.param(tag) + '&' + $(this).serialize(),function(response){ + if(response.result != undefined && !response.result){ + manageError(response); + return; + } + var tagBox = createTagBoxFromJSON(response.tag,image); + $('#' + options.imageWrapBox.idPrefix + image_id).append(tagBox); + registerHighlightHovers(); + extendTagBoxAttributes(tagBox,response.tag,image,image_id); + }); + removeNewExpoTag(); + showAllTags(image_id); + }); + + }; + + var removeNewExpoTag = function(){ + $('#'+options.tag.idPrefix+'expo').remove(); + $('#expoTagBoxForm').remove(); + }; + + var createTagBox = function( tagId, dimension, position, opacity ){ + var tagBox = $('
    '); + var css = { + 'position': 'absolute', + 'top': Math.round(position.top) + 'px', + 'left': Math.round(position.left) + 'px', + 'height': dimension.height + 'px', + 'width': dimension.width + 'px', + 'opacity': opacity + }; + tagBox.css(css); + tagBox.append(' 
    '); + return tagBox + }; + + var createTagBoxFromJSON = function( tagJSON, image ){ + if( !(tagJSON.height && tagJSON.width) ){ + tagJSON.height = options.tag.defaultHeight; + tagJSON.width = options.tag.defaultWidth; + }; + var dimension = {width: tagJSON.width,height: tagJSON.height}; + var position = {top: tagJSON.top,left: tagJSON.left}; + var tagBox = createTagBox(tagJSON.id,dimension,position,0); + + var innerElement = $("
    "); + innerElement.append(tagJSON.text.replace(/ /g, ' ')); + tagBox.append(innerElement); + + if(options.isEnabledToEditTags && tagJSON.isDeleteEnable && options.tag.showDeleteLinkOnTag){ + var deleteLink = $(''); + registerEventsForDeleteLink(deleteLink,image); + }; + + + tagBox.find('.taghover').append(deleteLink); + return tagBox; + } + + var createTagItemForList = function( tagJSON, image ){ + //Если список меток не пустой - добавляем запятую и пробел после предыдущего человека: + if ($('.photoTag-taglist').html().length>0) { + $('.photoTag-taglist li').last().append(', '); + }; + var item = $('
  • '); + if(tagJSON.url){ + var link = $(''+ tagJSON.text +''); + item.append(link); + }else{ + item.append(tagJSON.text); + } + if(tagJSON.isDeleteEnable){ + var deleteLink = $('  '); + registerEventsForDeleteLink(deleteLink,image); + item.append(deleteLink); + } + var hltag=$('a.highlight-tag'); + $('ul.photoTag-taglist li').last().find(hltag).mouseover( + function() { + mover($('#photoTag-tag_'+$(this).attr('tag-id')).find('.taghover')); + } + ).mouseleave( + function() { + mleave($('#photoTag-tag_'+$(this).attr('tag-id')).find('.taghover')); + } + ); + return item; + } + + var createExpoTag = function( image, image_id ){ + var dimension = {width: options.tag.defaultWidth,height: options.tag.defaultHeight}; + var position = { + top: (image.height()/2-dimension.height/2), + left: (image.width()/2-dimension.width/2) + }; + cache.expoId++; + var expoTagBox = createTagBox('expo',dimension,position,1); + return expoTagBox; + }; + + var hideAllTags = function( image_id ){ + $.each(cache.tags[image_id],function(){ + $(this).css({'opacity':0.0}); + $(this).hide(); + }); + }; + + var showAllTags = function( image_id ){ + $.each(cache.tags[image_id],function(){ + $(this).show(); + }); + } + + var createAddTagLink = function( image, image_id ){ + var addTagLink = $(''+ options.literals.addNewTag +''); + registerEventsForAddTagLink(addTagLink,image,image_id); + return addTagLink; + }; + + var wrapImage = function( image, image_id ){ + var imageHeight = image.height(); + var imageWidth = image.width(); + var canvas = $('
    '); + var wrapper = $('
    '); + canvas.append(wrapper); + var controlPane = $('
    '); + canvas.append(controlPane); + image.wrap(canvas); + if(!options.externalAddTagLinks.bind) + $('#' + options.imageWrapBox.controlPaneIdPrefix + image_id).append(createAddTagLink(image,image_id)); + else{ + var externalAddLinks = $(options.externalAddTagLinks.selector); + externalAddLinks.each(function(){ + registerEventsForAddTagLink(this,image,image_id); + }); + } + var container = $('
    '); + $('#' + options.imageWrapBox.canvasIdPrefix + image_id).wrap(container); + if(options.imageWrapBox.showTagList){ + var tagList = $('
      '); + $('.pg-photo-descr#imgid'+image_id).append(tagList); + } + } + + var extendTagBoxAttributes = function( tagBox, tagJSON, image, image_id ){ + if(options.tag.flashAfterCreation){ + $(tagBox).css({'opacity':1.0}); + + $(tagBox).stop().animate({ opacity: 0.0 }, 800); + }; + if(options.imageWrapBox.showTagList){ + var tagItemForList = createTagItemForList(tagJSON,image); + $('#'+options.imageWrapBox.tagListIdPrefix+image_id).append(tagItemForList); + var hltag=$('a.highlight-tag'); + $('ul.photoTag-taglist li').last().find(hltag).mouseover( + function() { + mover($('#photoTag-tag_'+$(this).attr('tag-id')).find('.taghover')); + } + ).mouseleave( + function() { + mleave($('#photoTag-tag_'+$(this).attr('tag-id')).find('.taghover')); + } + ); + }; + } + + var prepareImage = function( imageDetailsJSON, image ){ + wrapImage(image,imageDetailsJSON.id); + var cachedInstance = cache.tags[imageDetailsJSON.id] = {}; + $.each(imageDetailsJSON.Tags,function(){ + var tagBox = createTagBoxFromJSON(this,image); + + cachedInstance[this.id] = tagBox; + $('#' + options.imageWrapBox.idPrefix + imageDetailsJSON.id).append(tagBox); + registerHighlightHovers(); + + extendTagBoxAttributes(tagBox,this,image,imageDetailsJSON.id); + }); + }; + + this.each(function(){ + var $this = $(this); + + var parameters = getParametersForImage($this); + + if( !$.isFunction(options.beforeTagRequest) || options.beforeTagRequest(parameters) ){ + $.getJSON( + options.requestTagsUrl, + parameters, + function( response ){ + if(response.result != undefined && !response.result){ + manageError(response); + return; + } + if(response.options){ + options = $.extend(true,options,response.options); + } + $.each(response.Image,function(){ + prepareImage(this,$this); + }); + } + ); + } + }); + + return this; + }; +})(jQuery); + +//dna.js v0.2.9 ~~ dnajs.org/license.html +var dna={clone:function(a,b,c){var d={fade:!1,top:!1,container:null,empty:!1,html:!1,callback:null};$.extend(d,c);var e=dna.store.getTemplate(a);e.nested&&!d.container&&dna.core.berserk("Container missing for nested template: "+a),d.empty&&dna.empty(a);for(var f=b instanceof Array?b:[b],g=$(),h=0;h0&&c(window,a.split(".")),d}},dna.ui={toElem:function(a,b){return a instanceof jQuery?a:$(a?a.target:b)},deleteElem:function(a){return dna.ui.toElem(a,this).remove()},slideFade:function(a,b,c){function d(){a.css(h)}var e={opacity:0,transition:"opacity 0s ease 0s"},f={opacity:1,transition:"opacity 0.4s ease-in"},g={opacity:0,transition:"opacity 0.4s ease-out"},h={transition:"opacity 0s ease 0s"};return window.setTimeout(d,1e3),c?a.css(e).hide().slideDown({complete:b}).css(f):a.css(g).slideUp({complete:b}),a},slideFadeIn:function(a,b){return dna.ui.slideFade(a,b,!0)},slideFadeOut:function(a,b){return dna.ui.slideFade(a,b,!1)},slideFadeToggle:function(a,b){return dna.ui.slideFade(a,b,a.is(":hidden"))},slideFadeDelete:function(a){return dna.ui.slideFadeOut(a,dna.ui.deleteElem)},slidingFlasher:function(a,b){return a.is(":hidden")?dna.ui.slideFadeIn(a,b):a.hide().fadeIn()}},dna.compile={regexDnaField:/^[\s]*(~~|\{\{).*(~~|\}\})[\s]*$/,regexDnaBasePair:/~~|{{|}}/,regexDnaBasePairs:/~~|\{\{|\}\}/g,setupNucleotide:function(a){return void 0===a.data().dnaRules&&(a.data().dnaRules={}),a.addClass("dna-nucleotide")},isDnaField:function(){var a=$(this)[0].childNodes[0];return a&&a.nodeValue&&a.nodeValue.match(dna.compile.regexDnaField)},field:function(){var a=dna.compile.setupNucleotide($(this));return a.data().dnaRules.text=$.trim(a.text()).replace(dna.compile.regexDnaBasePairs,""),a.empty()},propsAndAttrs:function(){function a(){if(/^data-dna-prop-/.test(this.name))c.push(this.name.replace(/^data-dna-prop-/,""),this.value.replace(dna.compile.regexDnaBasePairs,""));else{if(3!==this.value.split(dna.compile.regexDnaBasePair).length)return;d.push(this.name.replace(/^data-dna-attr-/,""),this.value.split(dna.compile.regexDnaBasePair))}e.push(this.name)}var b=$(this),c=[],d=[],e=[];return $.each(b.get(0).attributes,a),c.length>0&&(dna.compile.setupNucleotide(b).data().dnaRules.props=c),d.length>0&&(dna.compile.setupNucleotide(b).data().dnaRules.attrs=d),b.removeAttr(e.join(" "))},getDataField:function(a,b){return $.trim(a.data("dna-"+b).replace(dna.compile.regexDnaBasePairs,""))},subTemplateName:function(a,b){var c=a instanceof jQuery?dna.getClone(a).data().dnaRules.template:a;return c+"-"+b+"-instance"},rules:function(a,b,c){function d(){var a=dna.compile.setupNucleotide($(this)),d=dna.compile.getDataField(a,b);a.data().dnaRules[b]=c?d.split(","):d}return a.filter("[data-dna-"+b+"]").each(d).removeAttr("data-dna-"+b)},template:function(a){function b(){$(this).data().dnaRules={template:$(this).attr("id")}}var c=$("#"+a);c.length||dna.core.berserk("Template not found: "+a),c.find(".dna-template").addBack().each(b).removeAttr("id");var d=c.find("*").addBack();return d.filter(dna.compile.isDnaField).each(dna.compile.field),dna.compile.rules(d,"array").addClass("dna-array"),dna.compile.rules(d,"class",!0),dna.compile.rules(d,"require"),dna.compile.rules(d,"missing"),dna.compile.rules(d,"truthy"),dna.compile.rules(d,"falsey"),d.each(dna.compile.propsAndAttrs),dna.store.stash(c)}},dna.store={templates:{},stash:function(a){function b(){var a=$(this),b=a.data().dnaRules.template,c={name:b,elem:a,container:a.parent().addClass("dna-container").addClass("dna-contains-"+b),nested:0!==a.parent().closest(".dna-clone").length,index:a.index(),clones:0};dna.store.templates[b]=c,a.removeClass("dna-template").addClass("dna-clone").addClass(b).detach()}function c(){var a=$(this),b=a.data().dnaRules.array,c=dna.compile.subTemplateName(d,b);dna.compile.setupNucleotide(a.parent()).data().dnaRules.loop={name:c,field:b},a.data().dnaRules.template=c}var d=a.data().dnaRules.template;return a.find(".dna-template").addBack().each(b),a.find(".dna-array").each(c).each(b),dna.store.templates[d]},getTemplate:function(a){return dna.store.templates[a]||dna.compile.template(a)}},dna.events={initializers:[],elementSetup:function(a,b){function c(){dna.util.apply($(this).data("dna-setup"),[$(this),b])}var d="[data-dna-setup]",e=a?a.find(d).addBack(d):$(".dna-setup");return e.each(c).addClass("dna-initialized")},runInitializers:function(a,b){function c(){dna.util.apply(this.func,[(this.selector?a.find(this.selector).addBack(this.selector):a).addClass("dna-initialized")].concat(this.params))}return dna.events.elementSetup(a,b),$.each(dna.events.initializers,c),a},runner:function(a,b,c){return a=a.closest("[data-dna-"+b+"]"),dna.util.apply(a.data("dna-"+b),[a,c])},handle:function(a){return dna.events.runner($(a.target),a.type.replace("key","key-"),a)},handleEnterKey:function(a){return 13===a.which?dna.events.runner($(a.target),"enter-key",a):null},setup:function(){$(document).click(dna.events.handle).change(dna.events.handle).keyup(dna.events.handle).keyup(dna.events.handleEnterKey).keydown(dna.events.handle).keypress(dna.events.handle),dna.events.elementSetup()}},$(dna.events.setup),dna.core={inject:function(a,b,c,d){function e(a,e){function f(a){return-1!==$.inArray(typeof a,h)}var g="object"==typeof b?dna.util.value(b,e):"[count]"===e?c:"[value]"===e?b:null,h=["string","number","boolean"];f(g)&&(a=d.html?a.html(g):a.text(g))}function f(a,c){for(var d=0;d1&&(a.toggleClass(c[1],e),c[2]&&a.toggleClass(c[2],!e))}function i(a,c){var d=dna.util.value(b,c.field);d&&dna.clone(c.name,d,{container:a})}function j(){var a=$(this),c=a.data().dnaRules;c.text&&e(a,c.text),c.props&&f(a,c.props),c.attrs&&g(a,c.attrs),c.class&&h(a,c.class),c.require&&a.toggle(void 0!==dna.util.value(b,c.require)),c.missing&&a.toggle(void 0===dna.util.value(b,c.missing)),c.truthy&&a.toggle(dna.util.realTruth(dna.util.value(b,c.truthy))),c.falsey&&a.toggle(!dna.util.realTruth(dna.util.value(b,c.falsey))),c.loop&&i(a,c.loop)}return a.find(".dna-array").remove(),a.find(".dna-nucleotide").addBack(".dna-nucleotide").each(j),a.data("dna-model",b)},replicate:function(a,b,c,d){var e=a.elem.clone(!0,!0);a.clones++,dna.core.inject(e,b,c,d);var f=".dna-contains-"+a.name,g=d.container?d.container.find(f).addBack(f):a.container;return g[d.top?"prepend":"append"](e),dna.events.runInitializers(e,b),d.callback&&d.callback(e,b),d.fade&&dna.ui.slideFadeIn(e),e},unload:function(a,b,c){b.error||dna.clone(a,b,c)},berserk:function(a){throw"dna.js error -> "+a}}; +var map; + +function mapInit() { + var canvas = document.getElementById('map-canvas'); + var coords = canvas.getAttribute('data-coords'); + var commaPos = coords.indexOf(','); + var lat = parseFloat(coords.substring(0, commaPos)); + var lng = parseFloat(coords.substring(commaPos + 1, coords.length)); + var myLatlng = new google.maps.LatLng(lat, lng); + var mapOptions = { + zoom: 15, + center: myLatlng + }; + map = new google.maps.Map(canvas, mapOptions); + + var marker = new google.maps.Marker({ + position: myLatlng, + map: map + }); +} +/* */ +function addError(inputId, msg){ + var $input = $('#reg_form '+ inputId); + var $error = $("
      ").attr("class", "pwf-msg").append( + $("
      ").attr("class", "msg-error").append(msg) + ); + + $input.parent().parent().append($error) + +} + +function placeInput(width){ + $('#id_country').val('159').select2({ + placeholder: "Ваша страна", + width: width + }); + + $('#id_city').select2({ + placeholder: "Ваш город", + width: width, + ajax: { + + url: "/city/get-city/", + dataType: "json", + quietMillis: 200, + + data: function(term, page, country){ + var country = $('#id_country').val() + return {term: term, + page: page, + country: country}; + }, + + results: function (data) { + var results = []; + $.each(data, function(index, item){ + results.push({ + id: item.id, + text: item.label + }); + }); + return {results: results}; + } + }, + initSelection : function(element, callback) { + var id= $(element).val(); + var text = $(element).attr('data-init-text'); + callback({id: id, text:text}); + + } + + }); + +} + +!function ($) { + + var $win = $(window); + var $html = $('html'); + var $body = $('body'); + var $doc = $(document); + + + $.widget( "custom.catcomplete", $.ui.autocomplete, { + _renderMenu: function( ul, items ) { + var that = this, + currentCategory = ""; + $.each( items, function( index, item ) { + if ( item.category != currentCategory ) { + ul.append( "
    • " + item.category + "
    • " ); + currentCategory = item.category; + } + that._renderItemData( ul, item ); + }); + } + }); + + /* submiting registration form */ + $(function () { + + $('#callback-form').on('submit', function(e){ + e.preventDefault(); + var $form = $(this); + var url = $form.attr('action'); + var formData = $(this).serialize(); + + $.get(url, formData, function(data){ + if (data.success){ + $.fancybox.close(); + } + else{ + // delete prvious error + $("#callback-form .error").remove(); + + var $input = $('#id_callback_phone') + // generate new error + var $error = $("
      ").attr("class", "error").append(data.errors['callback_phone']); + $input.parent().prepend($error) + console.log(data.errors) + } + }); + //alert(123); + }); + $('#send_message_form').on('submit', function(event){ + event.preventDefault(); + $this = $(this); + var formData = $this.serialize(); + var url = $this.attr('action') + $.post(url, formData, function(data){ + if (data.success){ + $.fancybox.close(); + $this.find('#id_body').val('') + } + }); + }); + $('#reply_form').on('submit', function(event){ + event.preventDefault(); + $this = $(this); + var formData = $this.serialize(); + var reply_message = $('#reply_message').val() + var url = '/profile/messages/reply/'+reply_message+'/' + + $.post(url, formData, function(data){ + if (data.success){ + $.fancybox.close(); + $this.find('#id_recipient').val('') + $this.find('#id_body').val('') + } + }); + + }); + + $('.visit, .unvisit').on('click', function(event){ + event.preventDefault(); + var $this = $(this); + var url = $(this).attr('href'); + $.get(url, function(data){ + if (data.not_authorized){ + $.fancybox.open('#pw-login'); + } + else{ + if(data.success){ + if(data.in){ + if($this.hasClass('visit')){ + $this.hide(); + $this.siblings('.unvisit').show() + } + } + else{ + if($this.hasClass('unvisit')){ + $this.hide(); + $this.siblings('.visit').show() + } + } + } + } + }); + + }); + + + /* + $('#reg_form').on('submit', function(event){ + event.preventDefault(); + var formData = $(this).serialize(); + var url = '/register/'; + console.log(url); + + + $.post(url, formData, function(data){ + if(data.success){ + //register success + + // remove input values + $('#reg_form input').each(function(i){ + $(this).val(""); + }); + // close popup + $.fancybox.open('#pw-reg-complete'); + //$.fancybox.close(); + + } + else{ + console.log(data); + // hide help messages + $("#reg_form .msg-help:visible").hide(); + // delete previous errors + $("#reg_form .msg-error").parent().remove(); + + // generate new errors + var form_inputs = ['first_name', 'last_name', 'email', 'password1', 'password2'] + for(var i= 0; i < form_inputs.length; i++){ + if(form_inputs[i] in data){ + var input_id = '#id_'+form_inputs[i]; + addError(input_id, data[form_inputs[i]]) + } + } + } + }); + + }); + */ + /* submiting change password form */ + $('#paswd_change').on('submit', function(event){ + event.preventDefault(); + var formData = $(this).serialize(); + var url = '/profile/change-password/'; + var $form = $(this); + $.post(url, formData, function(data){ + if (data.success){ + $('#paswd_change .mf-success').fadeIn(300); + setTimeout(function(){ + $('#paswd_change .mf-success').fadeOut(300); + }, 3000); + $form.find('#id_old password').val('') + + } + else{ + // remove previous error + $('#paswd_change .mf-error').parent().remove(); + // add new error + var $element = $("
      ").attr("class", "mf-line").append( + $("
      ").attr("class", "mf-error").append(data.errors[0])) + $form.find('.mf-buttons-line').before($element); + } + }); + }); + $('.reg').on('click', function(event){ + event.preventDefault(); + $('.register').click(); + }); + + + /* ******************************************* + * Нестандартное оформление для поля select + * Изменено 24.04.2014 + * */ + $.fn.customSelect = function () { + return $(this).each(function() { + + var $this = $(this); + var $options = $this.children('option'); + var numberOfOptions = $this.children('option').length; + var $selected = $(":selected", $this); + + $this.addClass('s-hidden'); + + $this.wrap('
      '); + $this.after('
      '); + + var $styledSelect = $this.next('div.custom-select-wrap'); + var $styledSelectText = $styledSelect.children('.custom-select-text'); + var soText = $selected.length != 0 ? $selected.text() : $this.children('option').eq(0).text(); + + $styledSelectText.text(soText); + + if ( $options.index($selected) == 0 && (!$this.children('option').eq(0).val() || !$this.children('option').eq(0).attr('value')) ) { + $styledSelectText.addClass('placeholder'); + } + + var $menu = $('
      ').insertAfter($styledSelect); + var $optionsWrap = $menu.find('.scroll-content'); + + var $list = $('
        ').appendTo($optionsWrap); + + for (var i = 0; i < numberOfOptions; i++) { + var oText = ($this.children('option').eq(i).text() != '') ? $this.children('option').eq(i).html() : ' '; + $('
      • ', { + html: oText, + 'data-value': $this.children('option').eq(i).val() + }).appendTo($list); + } + + var $listItems = $list.children('li'); + + $styledSelect.on('click', function(e) { + e.stopPropagation(); + $('div.custom-select-wrap.active').not(this).each(function() { + $(this).removeClass('active').next('.options').hide(); + }); + if (!$this.prop('disabled')) { + $(this).toggleClass('active').next('.options').toggle(); + } + }); + + $listItems.on('click', function(e) { + var $el = $(this); + e.stopPropagation(); + $styledSelectText.text($el.text()); + $styledSelect.removeClass('active'); + $this.val($el.data('value')); + if ( $el.index() == 0 && (!$this.children('option').eq(0).val() || !$this.children('option').eq(0).attr('value')) ) { + $styledSelectText.addClass('placeholder'); + } else { + $styledSelectText.removeClass('placeholder'); + } + $menu.hide(); + }); + + if ($.fn.mCustomScrollbar) { + var customSelectScrollOptions = { + scrollInertia: 200, + contentTouchScroll: true, + scrollButtons: { + enable: false + }, + advanced:{ + autoScrollOnFocus:false, + updateOnContentResize: true + } + }; + + var $scrollContainer = $menu.find('div.cs-scroll-container'); + $scrollContainer.mCustomScrollbar(customSelectScrollOptions); + } + + $(document).on('click', function() { + $styledSelect.removeClass('active'); + $menu.hide(); + }); + + $this.on('change', function () { + var $cThis = $(this); + var selectedIndex = $cThis.prop('selectedIndex'); + var Text = $cThis.children('option').eq(selectedIndex).text(); + $styledSelectText.text(Text); + if ( selectedIndex == 0 && (!$this.children('option').eq(0).val() || !$this.children('option').eq(0).attr('value')) ) { + $styledSelectText.addClass('placeholder'); + } else { + $styledSelectText.removeClass('placeholder'); + } + }); + + }); + }; + $("select:not([multiple])").each(function () { + var $el = $(this); + if (!$el.hasClass('select2')) { + $el.customSelect(); + } + }); + + + + /* Обработка autocomplete в полях поиска + * используется jQuery UI Autocomplete + * */ + /* Галереи-слайдеры на главной + * использован плагин Swiper + * http://www.idangero.us/sliders/swiper/api.php + * */ + $('#mp-recent-expo').each(function () { + var $reContainer = $(this); + var $reSwipeWrap = $reContainer.children('ul'); + var $reSwipeItems = $reSwipeWrap.children('li'); + var $reControls = $reContainer.children('div.re-controls'); + var $recPrev = $reControls.children('a.prev'); + var $recNext = $reControls.children('a.next'); + + if ($reSwipeItems.length > 1) { + $reControls.addClass('enabled'); + $reSwipeItems.css({ + display: 'block' + }); + $reContainer.height($reSwipeItems.eq(0).height()); + var $reSwiper = $reContainer.swiper({ + speed: 500, + mode:'horizontal', + loop: false, + simulateTouch: false, + onInit: function () { + $recPrev.addClass('disabled'); + }, + onSlideChangeStart: function (swiper) { + $reContainer.animate({ + height: $reSwipeItems.eq(swiper.activeIndex).children('div.re-body').height() + }, 300); + if (swiper.activeIndex == 0) { + if (!$recPrev.hasClass('disabled')) { + $recPrev.addClass('disabled'); + } + if ($recNext.hasClass('disabled')) { + $recNext.removeClass('disabled'); + } + } else if (swiper.activeIndex == swiper.slides.length-1) { + if (!$recNext.hasClass('disabled')) { + $recNext.addClass('disabled'); + } + if ($recPrev.hasClass('disabled')) { + $recPrev.removeClass('disabled'); + } + } else { + if ($recPrev.hasClass('disabled')) { + $recPrev.removeClass('disabled'); + } + if ($recNext.hasClass('disabled')) { + $recNext.removeClass('disabled'); + } + } + } + }); + + $recPrev.on('click', function () { + if (!$(this).hasClass('disabled')) { + $reSwiper.swipePrev(); + } + return false; + }); + $recNext.on('click', function () { + if (!$(this).hasClass('disabled')) { + $reSwiper.swipeNext(); + } + return false; + }); + } + + }); + + $('#mp-photo-gallery').each(function () { + var $reContainer = $(this); + var $reSwipeWrap = $reContainer.children('ul'); + var $reSwipeItems = $reSwipeWrap.children('li'); + var $reControls = $reContainer.children('div.re-controls'); + var $recPrev = $reControls.children('a.prev'); + var $recNext = $reControls.children('a.next'); + + if ($reSwipeItems.length > 1) { + $reControls.addClass('enabled'); + var $reSwiper = $reContainer.swiper({ + speed: 500, + mode:'horizontal', + loop: false, + simulateTouch: false, + onInit: function (swiper) { + $recPrev.addClass('disabled'); + }, + onSlideChangeStart: function (swiper) { + var $descrs = $reSwipeItems.find('div.pgi-descr'); + $descrs.animate({ + height: 'hide', + opacity: 'hide' + }, 500); + if (swiper.activeIndex == 0) { + if (!$recPrev.hasClass('disabled')) { + $recPrev.addClass('disabled'); + } + if ($recNext.hasClass('disabled')) { + $recNext.removeClass('disabled'); + } + } else if (swiper.activeIndex == swiper.slides.length-1) { + if (!$recNext.hasClass('disabled')) { + $recNext.addClass('disabled'); + } + if ($recPrev.hasClass('disabled')) { + $recPrev.removeClass('disabled'); + } + } else { + if ($recPrev.hasClass('disabled')) { + $recPrev.removeClass('disabled'); + } + if ($recNext.hasClass('disabled')) { + $recNext.removeClass('disabled'); + } + } + }, + onSlideChangeEnd: function (swiper) { + var $descrs = $reSwipeItems.find('div.pgi-descr'); + $descrs.eq(swiper.activeIndex).slideDown(250); + } + }); + + $recPrev.on('click', function () { + if (!$(this).hasClass('disabled')) { + $reSwiper.swipePrev(); + } + return false; + }); + $recNext.on('click', function () { + if (!$(this).hasClass('disabled')) { + $reSwiper.swipeNext(); + } + return false; + }); + } + }); + + $('#ps-photo-gallery').each(function () { + var $reContainer = $(this); + var $reSwipeWrap = $reContainer.children('ul'); + var $reSwipeItems = $reSwipeWrap.children('li'); + var $reControls = $reContainer.children('div.re-controls'); + var $recPrev = $reControls.children('a.prev'); + var $recNext = $reControls.children('a.next'); + + if ($reSwipeItems.length > 1) { + $reControls.addClass('enabled'); + $reSwipeItems.css({ + display: 'block' + }); + var $reSwiper = $reContainer.swiper({ + speed: 500, + mode:'horizontal', + calculateHeight: true, + loop: false, + simulateTouch: false, + onInit: function (swiper) { + $recPrev.addClass('disabled'); + }, + onSlideChangeStart: function (swiper) { + if (swiper.activeIndex == 0) { + if (!$recPrev.hasClass('disabled')) { + $recPrev.addClass('disabled'); + } + if ($recNext.hasClass('disabled')) { + $recNext.removeClass('disabled'); + } + } else if (swiper.activeIndex == swiper.slides.length-1) { + if (!$recNext.hasClass('disabled')) { + $recNext.addClass('disabled'); + } + if ($recPrev.hasClass('disabled')) { + $recPrev.removeClass('disabled'); + } + } else { + if ($recPrev.hasClass('disabled')) { + $recPrev.removeClass('disabled'); + } + if ($recNext.hasClass('disabled')) { + $recNext.removeClass('disabled'); + } + } + } + }); + + $recPrev.on('click', function () { + if (!$(this).hasClass('disabled')) { + $reSwiper.swipePrev(); + } + return false; + }); + $recNext.on('click', function () { + if (!$(this).hasClass('disabled')) { + $reSwiper.swipeNext(); + } + return false; + }); + } + + }); + + $('#s-slide-gallery').each(function () { + var $reContainer = $(this); + var $reSwipeWrap = $reContainer.children('ul'); + var $reSwipeItems = $reSwipeWrap.children('li'); + var $reControls = $reContainer.children('div.re-controls'); + var $recPrev = $reControls.children('a.prev'); + var $recNext = $reControls.children('a.next'); + + if ($reSwipeItems.length > 4) { + $reControls.addClass('enabled'); + $reSwipeItems.css({ + display: 'block' + }); + + $win.on('resize', function () { + $reContainer.height($reSwipeItems.eq(0).height()); + }).trigger('resize'); + + var $reSwiper = $reContainer.swiper({ + slidesPerView: 4, + slidesPerGroup: 4, + speed: 500, + mode:'horizontal', + calculateHeight: true, + loop: false, + simulateTouch: false, + onInit: function (swiper) { + $recPrev.addClass('disabled'); + }, + onSlideChangeStart: function (swiper) { + if (swiper.activeIndex == 0) { + if (!$recPrev.hasClass('disabled')) { + $recPrev.addClass('disabled'); + } + if ($recNext.hasClass('disabled')) { + $recNext.removeClass('disabled'); + } + } else if (swiper.activeIndex == swiper.slides.length-4) { + if (!$recNext.hasClass('disabled')) { + $recNext.addClass('disabled'); + } + if ($recPrev.hasClass('disabled')) { + $recPrev.removeClass('disabled'); + } + } else { + if ($recPrev.hasClass('disabled')) { + $recPrev.removeClass('disabled'); + } + if ($recNext.hasClass('disabled')) { + $recNext.removeClass('disabled'); + } + } + } + }); + + $recPrev.on('click', function () { + if (!$(this).hasClass('disabled')) { + $reSwiper.swipePrev(); + } + return false; + }); + $recNext.on('click', function () { + if (!$(this).hasClass('disabled')) { + $reSwiper.swipeNext(); + } + return false; + }); + + } + + }); + + $('.sli-slides').each(function () { + var $reContainer = $(this); + var $reSwipeWrap = $reContainer.children('ul'); + var $reSwipeItems = $reSwipeWrap.children('li'); + var $reControls = $reContainer.children('div.re-controls'); + var $recPrev = $reControls.children('a.prev'); + var $recNext = $reControls.children('a.next'); + + if ($reSwipeItems.length > 4) { + $reControls.addClass('enabled'); + $reSwipeItems.css({ + display: 'block' + }); + + $win.on('resize', function () { + $reContainer.css({ + height: $reSwipeItems.eq(0).height() + }); + }).trigger('resize'); + + var $reSwiper = $reContainer.swiper({ + slidesPerView: 4, + slidesPerGroup: 4, + calculateHeight: true, + speed: 500, + mode:'horizontal', + loop: false, + simulateTouch: false, + onInit: function (swiper) { + $recPrev.addClass('disabled'); + }, + onSlideChangeStart: function (swiper) { + if (swiper.activeIndex == 0) { + if (!$recPrev.hasClass('disabled')) { + $recPrev.addClass('disabled'); + } + if ($recNext.hasClass('disabled')) { + $recNext.removeClass('disabled'); + } + } else if (swiper.activeIndex == swiper.slides.length-4) { + if (!$recNext.hasClass('disabled')) { + $recNext.addClass('disabled'); + } + if ($recPrev.hasClass('disabled')) { + $recPrev.removeClass('disabled'); + } + } else { + if ($recPrev.hasClass('disabled')) { + $recPrev.removeClass('disabled'); + } + if ($recNext.hasClass('disabled')) { + $recNext.removeClass('disabled'); + } + } + } + }); + + $recPrev.on('click', function () { + if (!$(this).hasClass('disabled')) { + $reSwiper.swipePrev(); + } + return false; + }); + $recNext.on('click', function () { + if (!$(this).hasClass('disabled')) { + $reSwiper.swipeNext(); + } + return false; + }); + + } + + }); + + /* Открытие popup диалогов */ + var fbPopupOptions = { + padding: 0, + fitToView: false + }; + + $('a.pw-open').fancybox(fbPopupOptions); + + /* Обработка placeholder для старых браузеров */ + $('input[placeholder], textarea[placeholder]').placeholder(); + + /* показ сообщений помощи в полях диалогов*/ + $doc.on('focus', 'form.pw-form input[type="text"], form.pw-form input[type="password"]', function (event) { + var $input = $(this); + var $fLine = $input.closest(".pwf-line"); + var $help = $fLine.find('div.msg-help'); + var $error = $fLine.find('div.msg-error'); + var $error2 = $(this).parent().parent().parent().find('.mf-error'); + $error.parent().remove(); + $error2.parent().remove(); + + if ($help.is(':hidden')) { + $help.fadeIn(300); + } + }); + + $doc.on('blur', 'form.pw-form input[type="text"], form.pw-form input[type="password"]', function (event) { + var $input = $(this); + var $fLine = $input.closest(".pwf-line"); + var $help = $fLine.find('div.msg-help'); + if ($help.is(':visible')) { + $help.fadeOut(300); + } + }); + + + /* Custom scroll + * использован плагин malihu-custom-scrollbar-plugin + * http://manos.malihu.gr/jquery-custom-content-scroller/ + * */ + var customScrollOptions = { + scrollInertia: 200, + contentTouchScroll: true, + scrollButtons: { + enable: false + }, + advanced:{ + updateOnContentResize: true + } + }; + + + $('div.scroll-container').each(function () { + var $scrollContainer = $(this); + $scrollContainer.mCustomScrollbar(customScrollOptions); + }); + + /* Открыть диалог подписки на нужной вкладке */ + $('#subscribe-sm').each(function () { + var $container = $(this); + var $links = $container.find('a'); + + $links.on('click', function () { + var $link = $(this); + var index = $links.index(this); + var popupSubscribe = $('#pw-subscribe'); + + $.fancybox(popupSubscribe, fbPopupOptions); + var $tabs = popupSubscribe.find('ul.tabs > li'); + $tabs.eq(index).trigger('click'); + return false; + }); + }); + + /* Обработка поведения вкладок */ + $("ul.tabs > li").on('click', function () { + var $curTab = $(this); + var $parentUl = $curTab.closest('ul'); + var index = $parentUl.children('li').index(this); + var $contentUl = $parentUl.siblings('.tabs-content'); + var $link = $curTab.find("a"); + var $popupSubscr = $curTab.closest('#pw-subscribe'); + + if (!$curTab.hasClass('active')) { + if ($popupSubscr.length) { + $contentUl = $popupSubscr.find('.tabs-content'); + } + var $activeTab = $parentUl.children('li.active'); + var $activeTContent = $contentUl.find('li.active'); + var $currentTContent = $contentUl.children('li').eq(index); + + $activeTab.removeClass("active"); + $activeTContent.removeClass("active"); + $curTab.addClass("active"); + $currentTContent.addClass("active"); + } + + $link.blur(); + closeSelectBox(); + return false; + }); + + /* Показ подписей картинок в деталях фото галерей */ + $('#cli-pg').each(function () { + var $wrap = $(this); + var $link = $wrap.find('a'); + $link.on({ + mouseenter: function () { + var $el = $(this); + var $title = $el.find('.pg-title'); + + $title + .stop(true, true) + .slideDown(300, function () { + $title.css({ + display: 'block' + }); + }); + }, + mouseleave: function () { + var $el = $(this); + var $title = $el.find('.pg-title'); + + $title + .stop(true, true) + .slideUp(300); + } + }); + }); + + $('#map-canvas').each(function () { + var $mapCanvas = $(this); + if(!$mapCanvas.is(':hidden')) { + google.maps.event.addDomListener(window, 'load', mapInit); + $mapCanvas.data('init', true); + } + }); + + $('a.toggle-map').on({ + click: function () { + var $tLink = $(this); + var $tContainer = $tLink.closest('.i-address'); + var $mapWrap = $tContainer.children('.i-map'); + var $mapCanvas = $('#map-canvas'); + var $hlink = $tContainer.find('header a.toggle-map'); + + if ($mapWrap.is(':hidden')) { + $mapWrap + .stop(true, true) + .animate({ + opacity: 'show', + height: 'show' + }, 300, function () { + if(!$mapCanvas.data('init')) { + mapInit(); + $mapCanvas.data('init', true); + } + $tContainer.addClass('map-opened'); + }); + } else { + $mapWrap + .stop(true, true) + .animate({ + opacity: 'hide', + height: 'hide' + }, 300, function () { + $tContainer.removeClass('map-opened'); + }); + } + return false; + } + }); + + $('ul.messages-list').each(function () { + var $mList = $(this); + var $mItems = $mList.children('li'); + + $mItems.on({ + mouseenter: function () { + var $item = $(this); + var $mButtons = $item.find('div.mi-buttons'); + + $mButtons + .stop(true, true) + .animate({ + opacity: 'show', + height: 'show' + }, 250); + }, + mouseleave: function () { + var $item = $(this); + var $mButtons = $item.find('div.mi-buttons'); + + $mButtons + .stop(true, true) + .animate({ + opacity: 'hide', + height: 'hide' + }, 250); + } + }); + }); + + $('.set-sect > header').on('click', function () { + var $trigger = $(this); + var $container = $trigger.closest('.set-sect'); + var $fBody = $container.children('div.set-sect-body'); + + if ($fBody.is(':visible')) { + $fBody + .stop(true, true) + .animate({ + height: 'hide', + opacity: 'hide' + }, 300, function () { + $container.addClass('closed') + }); + } else { + $fBody + .stop(true, true) + .animate({ + height: 'show', + opacity: 'show' + }, 300, function () { + $container.removeClass('closed') + }); + } + }); + + + $('input[type="checkbox"].annoncesFlag').each(function () { + var $check = $(this); + + $check.on('change', function () { + var $aInputsWrap = $check.closest('div.mf-announces').children('div.mf-announces-body'); + var $inputs = $aInputsWrap.find('input, select, textarea'); + var $selectBox = $aInputsWrap.find('div.c-select-box'); + + if ($check.prop('checked')) { + $aInputsWrap.removeClass('disabled'); + $selectBox.removeClass('disabled'); + $inputs.prop('disabled', false); + } else { + $aInputsWrap.addClass('disabled'); + $selectBox.addClass('disabled'); + $inputs.prop('disabled', true); + } + }).trigger('change'); + }); + $('a.icb-edit-profile').on('click', function () { + var $editBtn = $(this); + var $exitBtn = $editBtn.next('a.icb-exit-edit'); + var $editable = $('div.p-editable'); + + $editBtn.css({ + display: 'none' + }); + $exitBtn.css({ + display: 'inline-block' + }); + $editable.addClass('pe-active'); + + return false; + }); + + $('a.icb-exit-edit').on('click', function () { + var $exitBtn = $(this); + var $editBtn = $exitBtn.prev('a.icb-edit-profile'); + var $editable = $('div.p-editable'); + + $editBtn.css({ + display: 'inline-block' + }); + $exitBtn.css({ + display: 'none' + }); + $editable.removeClass('pe-active'); + + return false; + }); + + $('a.e-btn').on('click', function () { + var $switch = $(this); + var $wrapper = $switch.closest('.edit-wrap'); + var $container = $switch.closest('.p-editable'); + var $pForm = $wrapper.children('.e-form'); + var $closeBtn = $pForm.find('a.ef-close'); + var $eContainers = $('.p-editable.pe-current').not($container); + + $eContainers.each(function() { + $(this).removeClass('pe-current'); + }); + $container.toggleClass('pe-current'); + + $closeBtn.one('click', function() { + $container.removeClass('pe-current'); + return false; + }); + + $(document).one('click', function(event) { + var targetObj = $(event.target); + if (targetObj.parents().filter('.e-form').length < 1) { + $container.removeClass('pe-current'); + } + }); + + return false; + }); + + $('a.eps-open').on('click', function () { + var $switch = $(this); + var $sect = $switch.closest('.ep-sect'); + var $sectBody = $sect.children('div.ep-sect-body'); + + if ($sect.hasClass('eps-opened')) { + $sectBody + .stop() + .animate({ + height: 'hide', + opacity: 'hide' + }, 300, function () { + $sect.removeClass('eps-opened'); + }); + } else { + $sectBody + .stop() + .animate({ + height: 'show', + opacity: 'show' + }, 300, function () { + $sect.addClass('eps-opened'); + }); + } + + return false; + }); + + /* Custom scroll для календаря*/ + $('div.calendar-container').each(function () { + var $scrollContainer = $(this); + var calScrollOptions = $.extend(customScrollOptions, { horizontalScroll: true }); + $scrollContainer.mCustomScrollbar(calScrollOptions); + }); + + /* Временная функция для указания файла */ + $('input[type="file"]').each(function () { + var $iFile = $(this); + var $ifContainer = $iFile.closest('.input-file'); + var $inpText = $ifContainer.children('.file-text'); + + if ($iFile.val() != "") { + $inpText.text($iFile.val()); + $inpText.removeClass('placeholder'); + } else { + $inpText.text($inpText.data('placeholder')); + $inpText.addClass('placeholder'); + } + + $iFile.on({ + change: function () { + if ($iFile.val() != "") { + $inpText.text($iFile.val()); + $inpText.removeClass('placeholder'); + } else { + $inpText.text($inpText.data('placeholder')); + $inpText.addClass('placeholder'); + } + } + }); + }); + + /* Если на страницах "Добавить событие" не выбран ни один из типов форму делаем неактивной и наоборот */ + $('form > div.afs-type').each(function () { + var $radsCont = $(this); + var $rads = $radsCont.find('input[type="radio"]'); + var $formBody = $rads.closest('form').children('div.adm-form-body'); + + function formState () { + var radsChecked = $rads.filter(':checked').length > 0; + var $inputs = $formBody.find('input, select, textarea, button'); + var $selectBox = $formBody.find('div.c-select-box'); + + if (radsChecked) { + $formBody.removeClass('disabled'); + $selectBox.removeClass('disabled'); + $inputs.prop('disabled', false); + } else { + $formBody.addClass('disabled'); + $selectBox.addClass('disabled'); + $inputs.prop('disabled', true); + } + } + + formState(); + $rads.on('change', formState); + }); + + /* Добавление секций "Статистика за" на нажатие кнопки "добавить данные за другой период" */ + $('form.af-statistic div.mf-stat').each(function () { + var $statWrap = $(this); + var $addButtonWrap = $statWrap.children('.mf-stat-add-button'); + var $addButton = $addButtonWrap.find('a.icon-add'); + + $addButton.on('click', function () { + var $statItem = $statWrap.children('.mf-stat-item'); + var numItems = $statItem.length; + var numYears = $statItem.eq(0).find('select').eq(0).find('option').length-1; + + var $cloneItem = $statItem.eq(0).clone(); + var $selects = $cloneItem.find('select'); + var $inputs = $cloneItem.find('input'); + + $inputs.val(''); + $selects.each(function () { + var $el = $(this); + var $cWrap = $el.closest('.custom-select'); + var $cloneSel = $el.clone(); + $cloneSel.insertAfter($cWrap); + $cloneSel.customSelect(); + $cWrap.remove(); + }); + + $cloneItem.insertBefore($addButtonWrap); + + if (numItems == numYears - 1){ + $addButtonWrap.hide(); + } + return false; + }) + }); + + + /* + * Управление расписанием проведения выставки + * */ + + /* Пeреключение между общим временем для всех дней и уникальным для каждого дня */ + $('input[type="checkbox"].w-time-switcher').each(function () { + var $switch = $(this); + var $wTimeContainer = $switch.closest('.mf-field'); + + function checkSwitch () { + var $tLines = $wTimeContainer.find('div.w-time'); + var $firstTimeLine = $tLines.eq(0); + var $ftlSelects = $firstTimeLine.find('select'); + + $tLines.each(function (index) { + var $timeLine = $(this); + if (index != 0) { + var $selects = $timeLine.find('select'); + + for (var i = 1; i < $selects.length; i++ ) { + $selects.eq(i).prop('selectedIndex', $ftlSelects.eq(i).prop('selectedIndex')).trigger('change'); + } + } + }); + + if ($switch.prop('checked')) { + $tLines.removeClass('show'); + } else { + $tLines.addClass('show'); + } + } + + checkSwitch(); + $switch.on('change', checkSwitch); + }); + + function getDateStr(date) { + return (date.getDate() < 10 ? '0' : '') + date.getDate() + '.' + (date.getMonth() < 9 ? '0' : '') + (date.getMonth() + 1) + '.' + date.getFullYear(); + } + + /* Построение сетки расписания в зависимости от выбранного диапазона дат */ + $('#dates-range').each(function () { + var $dRange = $(this); + var $dateFrom = $dRange.find('input.dateFrom'); + var $dateTo = $dRange.find('input.dateTo'); + var startDay = new Date(); + var endDay = new Date(); + var $wtSchedule = $('#work-time'); + + function numScheduleDays() { + return (endDay - startDay)/(1000*60*60*24) + 1; + } + + function drawSchedule() { + var $timeLines = $wtSchedule.children('.w-time'); + var $timeLine = $timeLines.eq(0); + var $datesSelect = $timeLine.find('select').eq(0); + var $switch = $timeLine.find('input[type="checkbox"].w-time-switcher'); + + startDay = $dateFrom.datepicker('getDate') ? $dateFrom.datepicker('getDate') : new Date(); + endDay = $dateTo.datepicker('getDate') ? $dateTo.datepicker('getDate') : new Date(); + var numDays = numScheduleDays(); + + var $selects = $timeLine.find('select'); + $timeLines.filter(':not(:first)').remove(); + + $datesSelect.each(function () { + var date = startDay; + var $select = $(this); + var $cWrap = $select.closest('.custom-select'); + var $option = $('
      • "+a.cat+"
      • "),n=a.cat),i._renderItemData(e,a)})}}),this.exhibitionField=new u(i.settings.firstField),this.exhibitionField.completeName="exibitionComplete",this.exhibitionField.opt.anyChar=!0,this.placesModal=new c(i.settings.place),this.subjModal=new o(i.settings.subject),this.periodModal=new d(i.settings.period),this.exhibitionField.selectCheckBoxes=function(e,t){var i,a,s=this,l=t;"th"==t?i=document.getElementById(s.opt.prefix+e):"tg"==t&&(i=document.getElementById(s.opt.prefixInner+e),l="th"),r.show(),i?(r.hide(),$(i).prop("checked",!0),$(i).trigger("change")):(a={name:t,id:e},n(a,EXPO.searchBlock.subjModal.opt.getParentUrl,function(i){EXPO.searchBlock.subjModal._loadParentTree(i,function(){EXPO.searchBlock.subjModal._checkCheckBox(e,t)})}))},this.placesField=new u(i.settings.placeField),this.placesField.dataForm=EXPO.searchBlock.placesModal.$inputFilter.attr("data-form"),this.placesField.selectCheckBoxes=function(e,t){var i,a,s=this;i=document.getElementById(s.opt.prefix+e),i?(r.hide(),$(i).prop("checked",!0),$(i).trigger("change")):(a={name:t,id:e},n(a,EXPO.searchBlock.placesModal.opt.getParentUrl,function(i){EXPO.searchBlock.placesModal._loadParentTree(i,function(){EXPO.searchBlock.placesModal._checkCheckBox(e,t)})}))},this.exhibitionField.afterClear=function(){i.subjModal.resetList()},this.placesField.afterClear=function(){i.placesModal.resetList()},this.modalWindow=new t.Modal(i.settings.modal),this.periodModal.applyHandler=function(){i.modalWindow.close(),$(i.DOMform).submit()},this.placesModal.applyHandler=function(){i.modalWindow.close(),$(i.DOMform).submit()},this.subjModal.applyHandler=function(){i.modalWindow.close(),$(i.DOMform).submit()},$("."+i.settings.modalTriggerClass).on("click",function(e){return e.preventDefault(),i.modalWindow.pullData(this.getAttribute("href")),i.modalWindow.open(),!1}),$(function(){if(i.previousSearch)for(var e=0;e')))):s.length&&(e=$("#img-"+n),e.parent("a").length&&(a=e.attr("src").replace(".png","_hover.png"),e.attr("src",a),e.unwrap()));$(".p-editable").removeClass("pe-current")}},this.ajaxPath=t},t.phone_form=function(t){this.pullHandler=function(t){t.success&&($("#static-phone-value").text($("#id_phone")[0].value),$(".p-editable").removeClass("pe-current"))},this.ajaxPath=t},t.email_form=function(t){var e;this.pullHandler=function(t){t.success&&(e=$("#id_email").val(),$("#static-email-value").attr("href","mailto:"+e).text(e),$(".p-editable").removeClass("pe-current"))},this.ajaxPath=t},t.web_page_form=function(t){var e;this.pullHandler=function(t){t.success&&(e=$("#id_web_page").val(),$("#static-web-page-value").attr("href",e).text(e),$(".p-editable").removeClass("pe-current"))},this.ajaxPath=t},t.home_form=function(t){this.pullHandler=function(t){if(t.success){var e=$("#s2id_id_country").find(".select2-chosen").text(),a=$("#s2id_id_city").find(".select2-chosen").text();$("#static-home-country").text(e),$("#static-home-city").text(a),$(".p-editable").removeClass("pe-current")}},this.ajaxPath=t},t.found_form=function(t){var e,a,s,i,n,r;this.pullHandler=function(t){t.success&&(a=$("#id_foundation"),e=$.trim(a.val()),s=a.parents(".p-editable"),r=a.parents(".edit-wrap").children("e-btn"),i=$("#static-found-value"),n=$("#static-foundation"),""==e?(s.removeClass("ic-tel").addClass("add_link_text add_link_text_medium"),i.hide().children("span").text(""),n.show()):(s.removeClass("add_link_text add_link_text_medium").addClass("ic-tel"),i.show().children("span").text(e),n.hide()),$(".p-editable").removeClass("pe-current"))},this.ajaxPath=t},t.staff_form=function(t){var e,a,s,i,n,r;this.pullHandler=function(t){t.success&&(a=$("#id_staff_number"),e=$.trim(a.val()),s=a.parents(".p-editable"),r=a.parents(".edit-wrap").children("e-btn"),i=$("#static-staff_number-value"),n=$("#static-staff_number"),""==e?(s.removeClass("ic-tel").addClass("add_link_text add_link_text_medium"),i.hide().children("span").text(""),n.show()):(s.removeClass("add_link_text add_link_text_medium").addClass("ic-tel"),i.show().children("span").text(e),n.hide()),$(".p-editable").removeClass("pe-current"))},this.ajaxPath=t},t.description_form=function(t){var e,a,s,i,n,r=$("#id_description");this.pullHandler=function(t){t.success&&(e=$.trim(r.val()),a=r.parents(".p-editable"),n=r.parents(".edit-wrap").children("e-btn"),s=$("#static-description-value"),i=$("#static-description"),""==e?(a.removeClass("ic-tel").addClass("add_link_text add_link_text_medium"),s.hide().children("span").text(""),i.show()):(a.removeClass("add_link_text add_link_text_medium").addClass("ic-tel"),s.show().text(e),i.hide()),$(".p-editable").removeClass("pe-current"))},r.on("keypress",function(t){var e=t.keyCode?t.keyCode:t.which;return"13"==e?!1:void 0}),this.ajaxPath=t},e.init=function(e){$.extend(this.lang,e.lang),e.lang=null,$.extend(this.settings,e);var a=this,s=function(t){var e=$.masksSort($.masksLoad("/static/client/js/plugins/inputmask/phone-codes.json"),["#"],/[0-9]|#/,"mask"),a={inputmask:{definitions:{"#":{validator:"[0-9]",cardinality:1}},showMaskOnHover:!1,autoUnmask:!0},match:/[0-9]/,replace:"#",list:e,listKey:"mask",onMaskChange:function(){$(this).attr("placeholder",$(this).inputmask("getemptymask"))}},s="#"+t;$(s).attr("placeholder","+_(___)___-__-__"),$(s).inputmasks(a)};this.forms={},$(function(){$("#"+a.settings.selectBox[0].id).select2({width:"element"}),$("#"+a.settings.selectBox[1].id).select2({placeholder:a.settings.selectBox[1].placeHolder,width:"element",ajax:{url:a.settings.selectBox[1].path,dataType:"json",quietMillis:200,data:function(t,e,s){var s=$("#"+a.settings.selectBox[0].id).val();return{term:t,page:e,country:s}},results:function(t){var e=[];return $.each(t,function(t,a){e.push({id:a.id,text:a.label})}),{results:e}}},initSelection:function(t,e){var a=$(t).val(),s=$(t).attr("data-init-text");e({id:a,text:s})}}),$("#"+a.settings.selectBox[2].id).select2({placeholder:a.settings.selectBox[2].placeholder,width:"368px",multiple:!0,maximumSelectionSize:5,ajax:{url:a.settings.selectBox[2].path,dataType:"json",quietMillis:200,data:function(t,e){var a=$("#theme-inf").attr("data-theme");return a=a.split(","),a.pop(),{term:t,page:e,themes:a}},results:function(t){var e=[];return $.each(t,function(t,a){e.push({id:a.id,text:a.label})}),{results:e}}},initSelection:function(){}}),s(a.settings.phoneBox),$("."+a.settings.updateFormClass).each(function(){var e=$(this).attr("id"),s=$(this).attr("action");a.forms[e]=t.factory(e,s),$(this).off("submit"),$(this).on("submit",function(){var t=$(this).serialize();return a.forms[e].pushData(t,e),!1})})})},e}(); \ No newline at end of file diff --git a/templates/client/static_client/js/min/_modules/page.events.feed.min.js b/templates/client/static_client/js/min/_modules/page.events.feed.min.js new file mode 100644 index 00000000..15c9df7c --- /dev/null +++ b/templates/client/static_client/js/min/_modules/page.events.feed.min.js @@ -0,0 +1 @@ +var EXPO=EXPO||{};EXPO.events=EXPO.events||{},EXPO.events.feed?console.warn("WARNING: EXPO.eventsFeed is already defined!"):EXPO.events.feed=function(){var e={};e.opt={};var t=EXPO.common,i=function(e){this.opt=e,this.DOMbody=document.getElementById(e.bodyId)},n=function(e,t,i){e||(e=""),$.ajax({type:"GET",url:t,data:e,success:function(e){return"function"!=typeof i?e:void i(e)}})},s=function(e,t,i){return e.hasOwnProperty(t)&&(e[i]=e[t]),this},a=function(e){var t,i=0;for(t in e)e.hasOwnProperty(t)&&i++;return i},r=$(".wait-ajax.absolute"),o=function(e){var t=Object.keys(e).map(function(t){return encodeURIComponent(t)+"="+encodeURIComponent(e[t])}).join("&");return"?"+t};i.prototype={show:function(){$(this.DOMbody).slideDown()},hide:function(){$(this.DOMbody).hide()}};var l=function(e){this.opt=e;var i,n=this,s=0,a=$("#"+n.opt.subjectTriggerWrapId),r=n.opt.id,o=$("#"+r),l=$(".csb-menu-input",o),c=$("#"+this.opt.selectedItemsContainer,o),d=n.opt.defaultOn,h=n.opt.applyBtnClass,u=$("#"+n.opt.modalTrigger),p=(document.getElementById(n.opt.bodyId),function(){f.hide()}),f=$(".wait-ajax.absolute");this.$modalInst=$("#"+r),this.itemsSelected={},this.tagsBoxItems={},this.sublist={},this.$inputFilter=$("#"+n.opt.filterInputId),this.$label=$(document.getElementById(this.opt.labelId)),this.$selectedItemsWrap=c,$(function(){for($(".topicChecks",a).on("change",function(){$(this).prop("checked")?n._setVisible($(this).val()):n._setUnvisible($(this).val())}),s=0;s2&&d?(n({term:t,form:l},o.opt.autoCompleteUrl,u),d=!1):0!=t.length||d||o.$inputFilter.hasClass("ui-autocomplete-input")&&(o.$inputFilter.autocomplete("destroy"),d=!0),!1}).click(function(){return!1})},_renderSublist:function(e,t,i){var n=this,s=0,a=t+"-sub",o=function(e){if(e.length){for(n.sublist[a]={},s;sI;I++)for(c=y[I],T=0;x>T;T++)c==C[T]&&A(s[T]);for(I=0;_>I;I++)c=y[I],c==S&&A(i)}else for(I=0;_>I;I++)c=y[I],c==S&&A(S)},A=function(e){var t=e.getAttribute("id");i._destroyTag(t),M()},O=function(e){var s=t.closest(e,n),a=s.querySelector("."+p),r=a.innerHTML,o=e.getAttribute("id"),l={id:o,text:r};i._addTag(o,l),M()},M=function(){o.children("."+d).length&&"~~id~~"!=o.children("."+d)[0].getAttribute(f)?o.addClass("visible"):o.removeClass("visible")},F=function(){var t=$(b).children("li").children("."+e).find("."+r+":checked");t.each(function(){O(this)})},j=function(){var t=$(b).children("li").children("."+e).find("."+r+":checked");t.each(function(){A(this)})};this.checked?(B()?(S(this),T(this),D(v),O(v),j(b),v.getAttribute("id")!=y.getAttribute("id")||y.checked||(T(y),D(y),O(y))):(T(this),D(this),O(this)),k&&_(this)):(P()?(I(this),w(this),D(v),A(v),F(b),y.checked&&(w(y),D(y),A(y))):(w(this),D(this),A(this)),k&&x(this)),u()}),$("."+i.opt.deleteTagClass,s).on("click",function(){var e=$(this).attr("data-checkbox-id"),t=$("#"+e);return t.prop("checked",!1),t.trigger("change"),i._refreshLabel(),o.children(".dna-clone").length||o.removeClass("visible"),!1}),$("#"+i.opt.deleteId).on("click",function(){$("."+i.opt.deleteTagClass,s).trigger("click")}),$(".clear",s).on("click",function(){return i.resetList(),!1}),$(".q-sel a",s).on("click",function(){var e=$(this),t=e.attr("data-name"),s=e.attr("data-id"),a={name:t,id:s},r=function(e){i._loadParentTree(e,function(){i._checkCheckBox(s)})};return n(a,i.opt.getParentUrl,r),!1}),$("."+d,s).on("click",function(){return i.applyHandler(this),!1}),c.siblings("."+i.opt.clearAllButtonClass).on("click",function(){i.resetList()})})};return c.prototype={_getAjax:function(e,t){var i=this;e||(e=""),$.ajax({type:"GET",url:i.opt.ajaxUrl,data:e,success:function(e){return"function"!=typeof t?(i.rawData=e,e):(i.rawData=e,void t(e))}})},_renderSublist:function(e,t,i){var n=this,s=0,a=t+"-sub",o=function(e){if(e.length){for(n.curDNA[a]={},s;s2&&c?(r.show(),n({term:t,form:o},a.opt.autoCompleteUrl,h),c=!1):0!=t.length||c||a.$inputFilter.hasClass("ui-autocomplete-input")&&(a.$inputFilter.autocomplete("destroy"),c=!0),!1}).click(function(){return!1})},_loadParentTree:function(e,t,i){var n,s,o,l,c=this,d=e,h=$("#id_"+c.opt.prefix+d.id),u=function(e){var n=$("#id_"+c.opt.prefix+d.id),h=function(){r.hide(),i||0===i?t(i):t()};r.hide(),n.length&&a(c.curDNA[s+"-sub"])==e&&(o={name:d.name,id:d.id},r.show(),l=$("#id_"+c.opt.prefix+d.id).closest(".level").children(".trigger").attr("data-template-id"),c._renderNested(o,h,l,d.id))},p=function(){r.hide(),i||0===i?t(i):t()};r.show(),d.hasOwnProperty("parent")?h.length?(o={name:d.name,id:d.id},l=h.closest(".level").children(".trigger").attr("data-template-id"),c._renderNested(o,function(){r.hide(),t()},l,d.id)):(n={name:d.parent.name,id:d.parent.id},s=$("#id_"+c.opt.prefix+d.parent.id).closest(".level").children(".trigger").attr("data-template-id"),c._renderSublist(n,s,u)):(n={name:d.name,id:d.id},s=$("#id_"+c.opt.prefix+d.id).closest(".level").children(".trigger").attr("data-template-id"),c._renderSublist(n,s,p))},applyHandler:function(){},_refreshLabel:function(){var e=this.selectedWrap.children().length;this.$label.text(this.$label.attr(e?"data-selected":"data-default"))}},e.init=function(e){$.extend(this.opt,e);var n=this,s=function(){$(n.DOMform).find('input[name="~~name~~"]').remove()};"None"!=this.opt.searchData&&this.opt.searchData&&(this.previousSearch=JSON.parse(this.opt.searchData)),this.DOMform=document.getElementById(this.opt.formId),$(this.DOMform).on("submit",function(){s()}),this.DOMapplyButton=document.getElementById(this.opt.applyButtonId),this.filterPane=new i(this.opt.filter),$("#"+this.opt.filter.buttonId).on("click",function(){return t.hasClass(this,n.opt.activeClass)?(t.removeClass(this,n.opt.activeClass),n.filterPane.hide()):(t.addClass(this,n.opt.activeClass),n.filterPane.show()),!1}),$("#"+n.opt.bodyId+" ."+n.opt.modalTriggerClass).on("click",function(e){return e.preventDefault(),n.modalWindow.pullData(this.getAttribute("href")),n.modalWindow.open(),!1}),$("#"+n.opt.applyButtonId).on("click",function(){return $(n.DOMform).submit(),!1}),this.modalWindow=new t.Modal(n.opt.modal),this.placesModal=new c(n.opt.place),this.subjModal=new l(n.opt.subject),this.placesModal.applyHandler=function(){n.modalWindow.close(),$(n.DOMform).submit()},this.subjModal.applyHandler=function(){n.modalWindow.close(),$(n.DOMform).submit()},$(function(){if(n.previousSearch)for(var e=0;e":e();break;case"<":i();break;default:o()}},close:function(){$("body").removeClass("no-scroll"),this.$mWindow.hide()},open:function(){$("body").addClass("no-scroll"),this.$mWindow.show()},nextSlide:function(){var t=this.currentId;this._getId(">"),t!=this.currentId&&this._renderSlide()},prevSlide:function(){var t=this.currentId;this._getId("<"),t!=this.currentId&&this._renderSlide()},show:function(t){var n=this;this._renderSlide(t,function(){n.open()})}},t.init=function(t){$.extend(this.lang,t.lang),t.lang=null,$.extend(this.settings,t);var e=this;this.modal=new n(e.settings.modalId,e.settings.containerId,e.settings.modalTrigger,e.settings.ajaxUrl,e.settings.nextButtonId,e.settings.prevButtonId,e.settings.closeModalButtonId,e.settings.modalContainerId)},t}(); \ No newline at end of file diff --git a/templates/client/static_client/js/min/_modules/page.profile.min.js b/templates/client/static_client/js/min/_modules/page.profile.min.js new file mode 100644 index 00000000..74c87286 --- /dev/null +++ b/templates/client/static_client/js/min/_modules/page.profile.min.js @@ -0,0 +1 @@ +var EXPO=EXPO||{};EXPO.profile?console.warn("WARNING: EXPO.profile is already defined!"):EXPO.profile=function(){function t(){}var e={};return e.settings={updateFormClass:"update-profile-form"},e.lang={},t.prototype={getajax:function(t){var e=this;t||(t=""),$.ajax({type:"POST",url:e.ajaxPath,data:t,processData:!1,contentType:!1,success:function(t){e.pullHandler(t),$("#wait-ajax").fadeOut()}})},pushData:function(t,e){var a=this.pushHandler,i=t;this.formData="string"!=typeof i?i:JSON.parse('{"'+decodeURI(i).replace(/"/g,'\\"').replace(/&/g,'","').replace(/=/g,'":"')+'"}'),this.formId=e,"function"==typeof a?(a(t),$("#wait-ajax").show()):(this.getajax(t),$("#wait-ajax").show()),console.log("formData type"),console.log(typeof i)},pullData:function(t){var e=this.pullHandler;if("function"!=typeof e)throw{name:"Error",message:" handler function for processing response after form submit not defined, please define it!"};e(t)},fulfillInputs:function(){var t=this;for(input in t.formData)$("#id_"+input,$("#"+t.formId)).length>0&&$("#id_"+input,$("#"+t.formId)).value(t.formData[input]),$("#static-"+input).length>0&&$("#static-"+input).html}},t.factory=function(e,a){var i,n=e;if("function"!=typeof t[n])throw{name:"Error",message:n+"doesen't exist"};return"function"!=typeof t[n].prototype.pushData&&(t[n].prototype=new t),i=new t[n](a)},t.home_form=function(t){this.pullHandler=function(t){if(t.success){var e=$("#s2id_id_country").find(".select2-chosen").text(),a=$("#s2id_id_city").find(".select2-chosen").text();$("#static-home-country").text(e),$("#static-home-city").text(a),$(".p-editable").removeClass("pe-current")}},this.ajaxPath=t},t.name_form=function(t){this.pullHandler=function(t){t.success&&($("#static-name-value").text($("#id_last_name").val()+" "+$("#id_first_name").val()),$(".p-editable").removeClass("pe-current"))},this.ajaxPath=t},t.work_form=function(t){this.pullHandler=function(t){if(t.success){var e=$("#s2id_id_company").find(".select2-chosen").text();$("#static-work-value").html($("#id_position").val()+" "+EXPO.profile.lang.workIn+' "'+e+'"'),$(".p-editable").removeClass("pe-current")}},this.ajaxPath=t},t.about_company_form=function(t){this.pullHandler=function(t){t.success&&window.location.reload()},this.ajaxPath=t},t.social_form=function(t){this.pullHandler=function(t){t.success&&window.location.reload()},this.ajaxPath=t},t.phone_form=function(t){this.pullHandler=function(t){t.success&&($("#static-phone-value").text($("#id_phone")[0].value),$(".p-editable").removeClass("pe-current"))},this.ajaxPath=t},t.web_page_form=function(t){this.pullHandler=function(t){if(t.success){var e=$("#id_web_page").val();$("#static-web-page-value").attr("href",e).text(e),$(".p-editable").removeClass("pe-current")}},this.ajaxPath=t},t.about_form=function(t){this.pullHandler=function(t){t.success&&($("#static-about-value").text($("#id_about").val()),$(".p-editable").removeClass("pe-current"))},$("#id_about").on("keypress",function(t){var e=t.keyCode?t.keyCode:t.which;return"13"==e?!1:void 0}),this.ajaxPath=t},t.social_form=function(t){var e,a,i,n,s=this;this.pullHandler=function(t){if(t.success){for(item in s.formData)i=$("#id_"+item),""!=$.trim(s.formData[item])&&i.length?(e=$("#img-"+item),e.length&&(n=$.trim(i.val()),e.parent("a").length?(e.parent("a").attr("href",n),a=e.attr("src").replace("_hover",""),e.attr("src",a)):(a=e.attr("src").replace("_hover",""),e.attr("src",a),e.wrap('')))):i.length&&(e=$("#img-"+item),e.parent("a").length&&(a=e.attr("src").replace(".png","_hover.png"),e.attr("src",a),e.unwrap()));$(".p-editable").removeClass("pe-current")}},this.ajaxPath=t},t.avatar_form=function(t){var e,a=this,i=$("#id_avatar"),n=$("#pic-edit-photo"),s=$("#pick-block"),r=$(".pic_block img");this.pullHandler=function(t){t.success&&(r.length?r.attr("src",t.url):(s.removeClass("add_pic_block").addClass("pic_block"),$(".add-wrapper",s).remove(),$("").attr("src",t.url).prependTo(s)),$(".p-editable").removeClass("pe-current"))},this.pushHandler=function(t){"string"!=typeof t?(a.getajax(t),$("#wait-ajax").show()):(e=$("#"+a.formId),e.off("submit"),e.trigger("submit"))},i.on("change",function(){$(this).parents("form").submit()}),n.on("click",function(){i.trigger("click")}),this.ajaxPath=t},$(function(){}),e.init=function(e){$.extend(this.lang,e.lang),e.lang=null,$.extend(this.settings,e);var a=this,i=function(t){var e=$.masksSort($.masksLoad("/static/client/js/plugins/inputmask/phone-codes.json"),["#"],/[0-9]|#/,"mask"),a={inputmask:{definitions:{"#":{validator:"[0-9]",cardinality:1}},showMaskOnHover:!1,autoUnmask:!0},match:/[0-9]/,replace:"#",list:e,listKey:"mask",onMaskChange:function(){$(this).attr("placeholder",$(this).inputmask("getemptymask"))}},i="#"+t;$(i).attr("placeholder","+_(___)___-__-__"),$(i).inputmasks(a)};this.forms={},$(function(){$("#"+a.settings.selectBox[0].id).select2({width:"element"}),$("#"+a.settings.selectBox[1].id).select2({width:"element",placeholder:a.settings.selectBox[1].placeholder,maximumSelectionSize:3}),$("#"+a.settings.selectBox[2].id).select2({placeholder:a.settings.selectBox[2].placeholder,width:"element",ajax:{url:a.settings.selectBox[2].path,dataType:"json",quietMillis:200,data:function(t,e,i){var i=$("#"+a.settings.selectBox[0].id).val();return{term:t,page:e,country:i}},results:function(t){var e=[];return $.each(t,function(t,a){e.push({id:a.id,text:a.label})}),{results:e}}},initSelection:function(t,e){var a=$(t).val(),i=$(t).attr("data-init-text");e({id:a,text:i})}}),$("#"+a.settings.selectBox[3].id).select2({placeholder:a.settings.selectBox[3].placeholder,width:"200px",minimumInputLength:1,ajax:{url:a.settings.selectBox[3].path,dataType:"json",quietMillis:200,data:function(t,e){return{term:t,page:e}},results:function(t){var e=[];return $.each(t,function(t,a){e.push({id:a.id,text:a.label})}),{results:e}}},initSelection:function(t,e){var a=$(t).val(),i=$(t).attr("data-init-text");e({id:a,text:i})}}),i(a.settings.phoneBox),$("."+a.settings.updateFormClass).each(function(){var e,i=$(this).attr("id"),n=$(this).attr("action");a.forms[i]=t.factory(i,n),$(this).off("submit"),$(this).on("submit",function(){return window.FormData&&"upload"in $.ajaxSettings.xhr()?(e=new FormData(this),a.forms[i].pushData(e,i)):(e=$(this).serialize(),a.forms[i].pushData(e,i)),!1})})})},e}(); \ No newline at end of file diff --git a/templates/client/static_client/js/min/app.min.js b/templates/client/static_client/js/min/app.min.js new file mode 100644 index 00000000..e87cd119 --- /dev/null +++ b/templates/client/static_client/js/min/app.min.js @@ -0,0 +1,7 @@ +function mapInit(){var e=document.getElementById("map-canvas"),t=e.getAttribute("data-coords"),i=t.indexOf(","),n=parseFloat(t.substring(0,i)),a=parseFloat(t.substring(i+1,t.length)),o=new google.maps.LatLng(n,a),s={zoom:15,center:o};map=new google.maps.Map(e,s);new google.maps.Marker({position:o,map:map})}function addError(e,t){var i=$("#reg_form "+e),n=$("
        ").attr("class","pwf-msg").append($("
        ").attr("class","msg-error").append(t));i.parent().parent().append(n)}function placeInput(e){$("#id_country").val("159").select2({placeholder:"Ваша страна",width:e}),$("#id_city").select2({placeholder:"Ваш город",width:e,ajax:{url:"/city/get-city/",dataType:"json",quietMillis:200,data:function(e,t,i){var i=$("#id_country").val();return{term:e,page:t,country:i}},results:function(e){var t=[];return $.each(e,function(e,i){t.push({id:i.id,text:i.label})}),{results:t}}},initSelection:function(e,t){var i=$(e).val(),n=$(e).attr("data-init-text");t({id:i,text:n})}})}!function(){for(var e,t=function(){},i=["assert","clear","count","debug","dir","dirxml","error","exception","group","groupCollapsed","groupEnd","info","log","markTimeline","profile","profileEnd","table","time","timeEnd","timeStamp","trace","warn"],n=i.length,a=window.console=window.console||{};n--;)e=i[n],a[e]||(a[e]=t)}(),!function(e){"undefined"==typeof e.fn.each2&&e.extend(e.fn,{each2:function(t){for(var i=e([0]),n=-1,a=this.length;++ni;i+=1)if(s(e,t[i]))return i;return-1}function o(){var t=e(z);t.appendTo("body");var i={width:t.width()-t[0].clientWidth,height:t.height()-t[0].clientHeight};return t.remove(),i}function s(e,i){return e===i?!0:e===t||i===t?!1:null===e||null===i?!1:e.constructor===String?e+""==i+"":i.constructor===String?i+""==e+"":!1}function r(t,i){var n,a,o;if(null===t||t.length<1)return[];for(n=t.split(i),a=0,o=n.length;o>a;a+=1)n[a]=e.trim(n[a]);return n}function l(e){return e.outerWidth(!1)-e.width()}function c(i){var n="keyup-change-value";i.on("keydown",function(){e.data(i,n)===t&&e.data(i,n,i.val())}),i.on("keyup",function(){var a=e.data(i,n);a!==t&&i.val()!==a&&(e.removeData(i,n),i.trigger("keyup-change"))})}function d(i){i.on("mousemove",function(i){var n=H;(n===t||n.x!==i.pageX||n.y!==i.pageY)&&e(i.target).trigger("mousemove-filtered",i)})}function h(e,i,n){n=n||t;var a;return function(){var t=arguments;window.clearTimeout(a),a=window.setTimeout(function(){i.apply(n,t)},e)}}function u(e,t){var i=h(e,function(e){t.trigger("scroll-debounced",e)});t.on("scroll",function(e){a(e.target,t.get())>=0&&i(e)})}function p(e){e[0]!==document.activeElement&&window.setTimeout(function(){var t,i=e[0],n=e.val().length;e.focus();var a=i.offsetWidth>0||i.offsetHeight>0;a&&i===document.activeElement&&(i.setSelectionRange?i.setSelectionRange(n,n):i.createTextRange&&(t=i.createTextRange(),t.collapse(!1),t.select()))},0)}function f(t){t=e(t)[0];var i=0,n=0;if("selectionStart"in t)i=t.selectionStart,n=t.selectionEnd-i;else if("selection"in document){t.focus();var a=document.selection.createRange();n=document.selection.createRange().text.length,a.moveStart("character",-t.value.length),i=a.text.length-n}return{offset:i,length:n}}function g(e){e.preventDefault(),e.stopPropagation()}function m(e){e.preventDefault(),e.stopImmediatePropagation()}function v(t){if(!A){var i=t[0].currentStyle||window.getComputedStyle(t[0],null);A=e(document.createElement("div")).css({position:"absolute",left:"-10000px",top:"-10000px",display:"none",fontSize:i.fontSize,fontFamily:i.fontFamily,fontStyle:i.fontStyle,fontWeight:i.fontWeight,letterSpacing:i.letterSpacing,textTransform:i.textTransform,whiteSpace:"nowrap"}),A.attr("class","select2-sizer"),e("body").append(A)}return A.text(t.val()),A.width()}function w(t,i,n){var a,o,s=[];a=e.trim(t.attr("class")),a&&(a=""+a,e(a.split(/\s+/)).each2(function(){0===this.indexOf("select2-")&&s.push(this)})),a=e.trim(i.attr("class")),a&&(a=""+a,e(a.split(/\s+/)).each2(function(){0!==this.indexOf("select2-")&&(o=n(this),o&&s.push(o))})),t.attr("class",s.join(" "))}function b(e,t,i,a){var o=n(e.toUpperCase()).indexOf(n(t.toUpperCase())),s=t.length;return 0>o?void i.push(a(e)):(i.push(a(e.substring(0,o))),i.push(""),i.push(a(e.substring(o,o+s))),i.push(""),void i.push(a(e.substring(o+s,e.length))))}function x(e){var t={"\\":"\","&":"&","<":"<",">":">",'"':""","'":"'","/":"/"};return String(e).replace(/[&<>"'\/\\]/g,function(e){return t[e]})}function y(i){var n,a=null,o=i.quietMillis||100,s=i.url,r=this;return function(l){window.clearTimeout(n),n=window.setTimeout(function(){var n=i.data,o=s,c=i.transport||e.fn.select2.ajaxDefaults.transport,d={type:i.type||"GET",cache:i.cache||!1,jsonpCallback:i.jsonpCallback||t,dataType:i.dataType||"json"},h=e.extend({},e.fn.select2.ajaxDefaults.params,d);n=n?n.call(r,l.term,l.page,l.context):null,o="function"==typeof o?o.call(r,l.term,l.page,l.context):o,a&&"function"==typeof a.abort&&a.abort(),i.params&&(e.isFunction(i.params)?e.extend(h,i.params.call(r)):e.extend(h,i.params)),e.extend(h,{url:o,dataType:i.dataType,data:n,success:function(e){var t=i.results(e,l.page,l);l.callback(t)},error:function(e,t,i){var n={hasError:!0,jqXHR:e,textStatus:t,errorThrown:i};l.callback(n)}}),a=c.call(r,h)},o)}}function C(t){var i,n,a=t,o=function(e){return""+e.text};e.isArray(a)&&(n=a,a={results:n}),e.isFunction(a)===!1&&(n=a,a=function(){return n});var s=a();return s.text&&(o=s.text,e.isFunction(o)||(i=s.text,o=function(e){return e[i]})),function(t){var i,n=t.term,s={results:[]};return""===n?void t.callback(a()):(i=function(a,s){var r,l;if(a=a[0],a.children){r={};for(l in a)a.hasOwnProperty(l)&&(r[l]=a[l]);r.children=[],e(a.children).each2(function(e,t){i(t,r.children)}),(r.children.length||t.matcher(n,o(r),a))&&s.push(r)}else t.matcher(n,o(a),a)&&s.push(a)},e(a().results).each2(function(e,t){i(t,s.results)}),void t.callback(s))}}function S(i){var n=e.isFunction(i);return function(a){var o=a.term,s={results:[]},r=n?i(a):i;e.isArray(r)&&(e(r).each(function(){var e=this.text!==t,i=e?this.text:this;(""===o||a.matcher(o,i))&&s.results.push(e?this:{id:this,text:this})}),a.callback(s))}}function _(t,i){if(e.isFunction(t))return!0;if(!t)return!1;if("string"==typeof t)return!0;throw new Error(i+" must be a string, function, or falsy value")}function T(t,i){if(e.isFunction(t)){var n=Array.prototype.slice.call(arguments,2);return t.apply(i,n)}return t}function k(t){var i=0;return e.each(t,function(e,t){t.children?i+=k(t.children):i++}),i}function E(e,i,n,a){var o,r,l,c,d,h=e,u=!1;if(!a.createSearchChoice||!a.tokenSeparators||a.tokenSeparators.length<1)return t;for(;;){for(r=-1,l=0,c=a.tokenSeparators.length;c>l&&(d=a.tokenSeparators[l],r=e.indexOf(d),!(r>=0));l++);if(0>r)break;if(o=e.substring(0,r),e=e.substring(r+d.length),o.length>0&&(o=a.createSearchChoice.call(this,o,i),o!==t&&null!==o&&a.id(o)!==t&&null!==a.id(o))){for(u=!1,l=0,c=i.length;c>l;l++)if(s(a.id(o),a.id(i[l]))){u=!0;break}u||n(o)}}return h!==e?e:void 0}function M(){var t=this;e.each(arguments,function(e,i){t[i].remove(),t[i]=null})}function P(t,i){var n=function(){};return n.prototype=new t,n.prototype.constructor=n,n.prototype.parent=t.prototype,n.prototype=e.extend(n.prototype,i),n}if(window.Select2===t){var I,L,O,B,D,A,R,W,H={x:0,y:0},I={TAB:9,ENTER:13,ESC:27,SPACE:32,LEFT:37,UP:38,RIGHT:39,DOWN:40,SHIFT:16,CTRL:17,ALT:18,PAGE_UP:33,PAGE_DOWN:34,HOME:36,END:35,BACKSPACE:8,DELETE:46,isArrow:function(e){switch(e=e.which?e.which:e){case I.LEFT:case I.RIGHT:case I.UP:case I.DOWN:return!0}return!1},isControl:function(e){var t=e.which;switch(t){case I.SHIFT:case I.CTRL:case I.ALT:return!0}return e.metaKey?!0:!1},isFunctionKey:function(e){return e=e.which?e.which:e,e>=112&&123>=e}},z="
        ",F={"Ⓐ":"A","A":"A","À":"A","Á":"A","Â":"A","Ầ":"A","Ấ":"A","Ẫ":"A","Ẩ":"A","Ã":"A","Ā":"A","Ă":"A","Ằ":"A","Ắ":"A","Ẵ":"A","Ẳ":"A","Ȧ":"A","Ǡ":"A","Ä":"A","Ǟ":"A","Ả":"A","Å":"A","Ǻ":"A","Ǎ":"A","Ȁ":"A","Ȃ":"A","Ạ":"A","Ậ":"A","Ặ":"A","Ḁ":"A","Ą":"A","Ⱥ":"A","Ɐ":"A","Ꜳ":"AA","Æ":"AE","Ǽ":"AE","Ǣ":"AE","Ꜵ":"AO","Ꜷ":"AU","Ꜹ":"AV","Ꜻ":"AV","Ꜽ":"AY","Ⓑ":"B","B":"B","Ḃ":"B","Ḅ":"B","Ḇ":"B","Ƀ":"B","Ƃ":"B","Ɓ":"B","Ⓒ":"C","C":"C","Ć":"C","Ĉ":"C","Ċ":"C","Č":"C","Ç":"C","Ḉ":"C","Ƈ":"C","Ȼ":"C","Ꜿ":"C","Ⓓ":"D","D":"D","Ḋ":"D","Ď":"D","Ḍ":"D","Ḑ":"D","Ḓ":"D","Ḏ":"D","Đ":"D","Ƌ":"D","Ɗ":"D","Ɖ":"D","Ꝺ":"D","DZ":"DZ","DŽ":"DZ","Dz":"Dz","Dž":"Dz","Ⓔ":"E","E":"E","È":"E","É":"E","Ê":"E","Ề":"E","Ế":"E","Ễ":"E","Ể":"E","Ẽ":"E","Ē":"E","Ḕ":"E","Ḗ":"E","Ĕ":"E","Ė":"E","Ë":"E","Ẻ":"E","Ě":"E","Ȅ":"E","Ȇ":"E","Ẹ":"E","Ệ":"E","Ȩ":"E","Ḝ":"E","Ę":"E","Ḙ":"E","Ḛ":"E","Ɛ":"E","Ǝ":"E","Ⓕ":"F","F":"F","Ḟ":"F","Ƒ":"F","Ꝼ":"F","Ⓖ":"G","G":"G","Ǵ":"G","Ĝ":"G","Ḡ":"G","Ğ":"G","Ġ":"G","Ǧ":"G","Ģ":"G","Ǥ":"G","Ɠ":"G","Ꞡ":"G","Ᵹ":"G","Ꝿ":"G","Ⓗ":"H","H":"H","Ĥ":"H","Ḣ":"H","Ḧ":"H","Ȟ":"H","Ḥ":"H","Ḩ":"H","Ḫ":"H","Ħ":"H","Ⱨ":"H","Ⱶ":"H","Ɥ":"H","Ⓘ":"I","I":"I","Ì":"I","Í":"I","Î":"I","Ĩ":"I","Ī":"I","Ĭ":"I","İ":"I","Ï":"I","Ḯ":"I","Ỉ":"I","Ǐ":"I","Ȉ":"I","Ȋ":"I","Ị":"I","Į":"I","Ḭ":"I","Ɨ":"I","Ⓙ":"J","J":"J","Ĵ":"J","Ɉ":"J","Ⓚ":"K","K":"K","Ḱ":"K","Ǩ":"K","Ḳ":"K","Ķ":"K","Ḵ":"K","Ƙ":"K","Ⱪ":"K","Ꝁ":"K","Ꝃ":"K","Ꝅ":"K","Ꞣ":"K","Ⓛ":"L","L":"L","Ŀ":"L","Ĺ":"L","Ľ":"L","Ḷ":"L","Ḹ":"L","Ļ":"L","Ḽ":"L","Ḻ":"L","Ł":"L","Ƚ":"L","Ɫ":"L","Ⱡ":"L","Ꝉ":"L","Ꝇ":"L","Ꞁ":"L","LJ":"LJ","Lj":"Lj","Ⓜ":"M","M":"M","Ḿ":"M","Ṁ":"M","Ṃ":"M","Ɱ":"M","Ɯ":"M","Ⓝ":"N","N":"N","Ǹ":"N","Ń":"N","Ñ":"N","Ṅ":"N","Ň":"N","Ṇ":"N","Ņ":"N","Ṋ":"N","Ṉ":"N","Ƞ":"N","Ɲ":"N","Ꞑ":"N","Ꞥ":"N","NJ":"NJ","Nj":"Nj","Ⓞ":"O","O":"O","Ò":"O","Ó":"O","Ô":"O","Ồ":"O","Ố":"O","Ỗ":"O","Ổ":"O","Õ":"O","Ṍ":"O","Ȭ":"O","Ṏ":"O","Ō":"O","Ṑ":"O","Ṓ":"O","Ŏ":"O","Ȯ":"O","Ȱ":"O","Ö":"O","Ȫ":"O","Ỏ":"O","Ő":"O","Ǒ":"O","Ȍ":"O","Ȏ":"O","Ơ":"O","Ờ":"O","Ớ":"O","Ỡ":"O","Ở":"O","Ợ":"O","Ọ":"O","Ộ":"O","Ǫ":"O","Ǭ":"O","Ø":"O","Ǿ":"O","Ɔ":"O","Ɵ":"O","Ꝋ":"O","Ꝍ":"O","Ƣ":"OI","Ꝏ":"OO","Ȣ":"OU","Ⓟ":"P","P":"P","Ṕ":"P","Ṗ":"P","Ƥ":"P","Ᵽ":"P","Ꝑ":"P","Ꝓ":"P","Ꝕ":"P","Ⓠ":"Q","Q":"Q","Ꝗ":"Q","Ꝙ":"Q","Ɋ":"Q","Ⓡ":"R","R":"R","Ŕ":"R","Ṙ":"R","Ř":"R","Ȑ":"R","Ȓ":"R","Ṛ":"R","Ṝ":"R","Ŗ":"R","Ṟ":"R","Ɍ":"R","Ɽ":"R","Ꝛ":"R","Ꞧ":"R","Ꞃ":"R","Ⓢ":"S","S":"S","ẞ":"S","Ś":"S","Ṥ":"S","Ŝ":"S","Ṡ":"S","Š":"S","Ṧ":"S","Ṣ":"S","Ṩ":"S","Ș":"S","Ş":"S","Ȿ":"S","Ꞩ":"S","Ꞅ":"S","Ⓣ":"T","T":"T","Ṫ":"T","Ť":"T","Ṭ":"T","Ț":"T","Ţ":"T","Ṱ":"T","Ṯ":"T","Ŧ":"T","Ƭ":"T","Ʈ":"T","Ⱦ":"T","Ꞇ":"T","Ꜩ":"TZ","Ⓤ":"U","U":"U","Ù":"U","Ú":"U","Û":"U","Ũ":"U","Ṹ":"U","Ū":"U","Ṻ":"U","Ŭ":"U","Ü":"U","Ǜ":"U","Ǘ":"U","Ǖ":"U","Ǚ":"U","Ủ":"U","Ů":"U","Ű":"U","Ǔ":"U","Ȕ":"U","Ȗ":"U","Ư":"U","Ừ":"U","Ứ":"U","Ữ":"U","Ử":"U","Ự":"U","Ụ":"U","Ṳ":"U","Ų":"U","Ṷ":"U","Ṵ":"U","Ʉ":"U","Ⓥ":"V","V":"V","Ṽ":"V","Ṿ":"V","Ʋ":"V","Ꝟ":"V","Ʌ":"V","Ꝡ":"VY","Ⓦ":"W","W":"W","Ẁ":"W","Ẃ":"W","Ŵ":"W","Ẇ":"W","Ẅ":"W","Ẉ":"W","Ⱳ":"W","Ⓧ":"X","X":"X","Ẋ":"X","Ẍ":"X","Ⓨ":"Y","Y":"Y","Ỳ":"Y","Ý":"Y","Ŷ":"Y","Ỹ":"Y","Ȳ":"Y","Ẏ":"Y","Ÿ":"Y","Ỷ":"Y","Ỵ":"Y","Ƴ":"Y","Ɏ":"Y","Ỿ":"Y","Ⓩ":"Z","Z":"Z","Ź":"Z","Ẑ":"Z","Ż":"Z","Ž":"Z","Ẓ":"Z","Ẕ":"Z","Ƶ":"Z","Ȥ":"Z","Ɀ":"Z","Ⱬ":"Z","Ꝣ":"Z","ⓐ":"a","a":"a","ẚ":"a","à":"a","á":"a","â":"a","ầ":"a","ấ":"a","ẫ":"a","ẩ":"a","ã":"a","ā":"a","ă":"a","ằ":"a","ắ":"a","ẵ":"a","ẳ":"a","ȧ":"a","ǡ":"a","ä":"a","ǟ":"a","ả":"a","å":"a","ǻ":"a","ǎ":"a","ȁ":"a","ȃ":"a","ạ":"a","ậ":"a","ặ":"a","ḁ":"a","ą":"a","ⱥ":"a","ɐ":"a","ꜳ":"aa","æ":"ae","ǽ":"ae","ǣ":"ae","ꜵ":"ao","ꜷ":"au","ꜹ":"av","ꜻ":"av","ꜽ":"ay","ⓑ":"b","b":"b","ḃ":"b","ḅ":"b","ḇ":"b","ƀ":"b","ƃ":"b","ɓ":"b","ⓒ":"c","c":"c","ć":"c","ĉ":"c","ċ":"c","č":"c","ç":"c","ḉ":"c","ƈ":"c","ȼ":"c","ꜿ":"c","ↄ":"c","ⓓ":"d","d":"d","ḋ":"d","ď":"d","ḍ":"d","ḑ":"d","ḓ":"d","ḏ":"d","đ":"d","ƌ":"d","ɖ":"d","ɗ":"d","ꝺ":"d","dz":"dz","dž":"dz","ⓔ":"e","e":"e","è":"e","é":"e","ê":"e","ề":"e","ế":"e","ễ":"e","ể":"e","ẽ":"e","ē":"e","ḕ":"e","ḗ":"e","ĕ":"e","ė":"e","ë":"e","ẻ":"e","ě":"e","ȅ":"e","ȇ":"e","ẹ":"e","ệ":"e","ȩ":"e","ḝ":"e","ę":"e","ḙ":"e","ḛ":"e","ɇ":"e","ɛ":"e","ǝ":"e","ⓕ":"f","f":"f","ḟ":"f","ƒ":"f","ꝼ":"f","ⓖ":"g","g":"g","ǵ":"g","ĝ":"g","ḡ":"g","ğ":"g","ġ":"g","ǧ":"g","ģ":"g","ǥ":"g","ɠ":"g","ꞡ":"g","ᵹ":"g","ꝿ":"g","ⓗ":"h","h":"h","ĥ":"h","ḣ":"h","ḧ":"h","ȟ":"h","ḥ":"h","ḩ":"h","ḫ":"h","ẖ":"h","ħ":"h","ⱨ":"h","ⱶ":"h","ɥ":"h","ƕ":"hv","ⓘ":"i","i":"i","ì":"i","í":"i","î":"i","ĩ":"i","ī":"i","ĭ":"i","ï":"i","ḯ":"i","ỉ":"i","ǐ":"i","ȉ":"i","ȋ":"i","ị":"i","į":"i","ḭ":"i","ɨ":"i","ı":"i","ⓙ":"j","j":"j","ĵ":"j","ǰ":"j","ɉ":"j","ⓚ":"k","k":"k","ḱ":"k","ǩ":"k","ḳ":"k","ķ":"k","ḵ":"k","ƙ":"k","ⱪ":"k","ꝁ":"k","ꝃ":"k","ꝅ":"k","ꞣ":"k","ⓛ":"l","l":"l","ŀ":"l","ĺ":"l","ľ":"l","ḷ":"l","ḹ":"l","ļ":"l","ḽ":"l","ḻ":"l","ſ":"l","ł":"l","ƚ":"l","ɫ":"l","ⱡ":"l","ꝉ":"l","ꞁ":"l","ꝇ":"l","lj":"lj","ⓜ":"m","m":"m","ḿ":"m","ṁ":"m","ṃ":"m","ɱ":"m","ɯ":"m","ⓝ":"n","n":"n","ǹ":"n","ń":"n","ñ":"n","ṅ":"n","ň":"n","ṇ":"n","ņ":"n","ṋ":"n","ṉ":"n","ƞ":"n","ɲ":"n","ʼn":"n","ꞑ":"n","ꞥ":"n","nj":"nj","ⓞ":"o","o":"o","ò":"o","ó":"o","ô":"o","ồ":"o","ố":"o","ỗ":"o","ổ":"o","õ":"o","ṍ":"o","ȭ":"o","ṏ":"o","ō":"o","ṑ":"o","ṓ":"o","ŏ":"o","ȯ":"o","ȱ":"o","ö":"o","ȫ":"o","ỏ":"o","ő":"o","ǒ":"o","ȍ":"o","ȏ":"o","ơ":"o","ờ":"o","ớ":"o","ỡ":"o","ở":"o","ợ":"o","ọ":"o","ộ":"o","ǫ":"o","ǭ":"o","ø":"o","ǿ":"o","ɔ":"o","ꝋ":"o","ꝍ":"o","ɵ":"o","ƣ":"oi","ȣ":"ou","ꝏ":"oo","ⓟ":"p","p":"p","ṕ":"p","ṗ":"p","ƥ":"p","ᵽ":"p","ꝑ":"p","ꝓ":"p","ꝕ":"p","ⓠ":"q","q":"q","ɋ":"q","ꝗ":"q","ꝙ":"q","ⓡ":"r","r":"r","ŕ":"r","ṙ":"r","ř":"r","ȑ":"r","ȓ":"r","ṛ":"r","ṝ":"r","ŗ":"r","ṟ":"r","ɍ":"r","ɽ":"r","ꝛ":"r","ꞧ":"r","ꞃ":"r","ⓢ":"s","s":"s","ß":"s","ś":"s","ṥ":"s","ŝ":"s","ṡ":"s","š":"s","ṧ":"s","ṣ":"s","ṩ":"s","ș":"s","ş":"s","ȿ":"s","ꞩ":"s","ꞅ":"s","ẛ":"s","ⓣ":"t","t":"t","ṫ":"t","ẗ":"t","ť":"t","ṭ":"t","ț":"t","ţ":"t","ṱ":"t","ṯ":"t","ŧ":"t","ƭ":"t","ʈ":"t","ⱦ":"t","ꞇ":"t","ꜩ":"tz","ⓤ":"u","u":"u","ù":"u","ú":"u","û":"u","ũ":"u","ṹ":"u","ū":"u","ṻ":"u","ŭ":"u","ü":"u","ǜ":"u","ǘ":"u","ǖ":"u","ǚ":"u","ủ":"u","ů":"u","ű":"u","ǔ":"u","ȕ":"u","ȗ":"u","ư":"u","ừ":"u","ứ":"u","ữ":"u","ử":"u","ự":"u","ụ":"u","ṳ":"u","ų":"u","ṷ":"u","ṵ":"u","ʉ":"u","ⓥ":"v","v":"v","ṽ":"v","ṿ":"v","ʋ":"v","ꝟ":"v","ʌ":"v","ꝡ":"vy","ⓦ":"w","w":"w","ẁ":"w","ẃ":"w","ŵ":"w","ẇ":"w","ẅ":"w","ẘ":"w","ẉ":"w","ⱳ":"w","ⓧ":"x","x":"x","ẋ":"x","ẍ":"x","ⓨ":"y","y":"y","ỳ":"y","ý":"y","ŷ":"y","ỹ":"y","ȳ":"y","ẏ":"y","ÿ":"y","ỷ":"y","ẙ":"y","ỵ":"y","ƴ":"y","ɏ":"y","ỿ":"y","ⓩ":"z","z":"z","ź":"z","ẑ":"z","ż":"z","ž":"z","ẓ":"z","ẕ":"z","ƶ":"z","ȥ":"z","ɀ":"z","ⱬ":"z","ꝣ":"z","Ά":"Α","Έ":"Ε","Ή":"Η","Ί":"Ι","Ϊ":"Ι","Ό":"Ο","Ύ":"Υ","Ϋ":"Υ","Ώ":"Ω","ά":"α","έ":"ε","ή":"η","ί":"ι","ϊ":"ι","ΐ":"ι","ό":"ο","ύ":"υ","ϋ":"υ","ΰ":"υ","ω":"ω","ς":"σ"};R=e(document),D=function(){var e=1;return function(){return e++}}(),L=P(Object,{bind:function(e){var t=this;return function(){e.apply(t,arguments)}},init:function(i){var n,a,s=".select2-results";this.opts=i=this.prepareOpts(i),this.id=i.id,i.element.data("select2")!==t&&null!==i.element.data("select2")&&i.element.data("select2").destroy(),this.container=this.createContainer(),this.liveRegion=e("",{role:"status","aria-live":"polite"}).addClass("select2-hidden-accessible").appendTo(document.body),this.containerId="s2id_"+(i.element.attr("id")||"autogen"+D()),this.containerEventName=this.containerId.replace(/([.])/g,"_").replace(/([;&,\-\.\+\*\~':"\!\^#$%@\[\]\(\)=>\|])/g,"\\$1"),this.container.attr("id",this.containerId),this.container.attr("title",i.element.attr("title")),this.body=e("body"),w(this.container,this.opts.element,this.opts.adaptContainerCssClass),this.container.attr("style",i.element.attr("style")),this.container.css(T(i.containerCss,this.opts.element)),this.container.addClass(T(i.containerCssClass,this.opts.element)),this.elementTabIndex=this.opts.element.attr("tabindex"),this.opts.element.data("select2",this).attr("tabindex","-1").before(this.container).on("click.select2",g),this.container.data("select2",this),this.dropdown=this.container.find(".select2-drop"),w(this.dropdown,this.opts.element,this.opts.adaptDropdownCssClass),this.dropdown.addClass(T(i.dropdownCssClass,this.opts.element)),this.dropdown.data("select2",this),this.dropdown.on("click",g),this.results=n=this.container.find(s),this.search=a=this.container.find("input.select2-input"),this.queryCount=0,this.resultsPage=0,this.context=null,this.initContainer(),this.container.on("click",g),d(this.results),this.dropdown.on("mousemove-filtered",s,this.bind(this.highlightUnderEvent)),this.dropdown.on("touchstart touchmove touchend",s,this.bind(function(e){this._touchEvent=!0,this.highlightUnderEvent(e)})),this.dropdown.on("touchmove",s,this.bind(this.touchMoved)),this.dropdown.on("touchstart touchend",s,this.bind(this.clearTouchMoved)),this.dropdown.on("click",this.bind(function(){this._touchEvent&&(this._touchEvent=!1,this.selectHighlighted())})),u(80,this.results),this.dropdown.on("scroll-debounced",s,this.bind(this.loadMoreIfNeeded)),e(this.container).on("change",".select2-input",function(e){e.stopPropagation()}),e(this.dropdown).on("change",".select2-input",function(e){e.stopPropagation()}),e.fn.mousewheel&&n.mousewheel(function(e,t,i,a){var o=n.scrollTop();a>0&&0>=o-a?(n.scrollTop(0),g(e)):0>a&&n.get(0).scrollHeight-n.scrollTop()+a<=n.height()&&(n.scrollTop(n.get(0).scrollHeight-n.height()),g(e))}),c(a),a.on("keyup-change input paste",this.bind(this.updateResults)),a.on("focus",function(){a.addClass("select2-focused")}),a.on("blur",function(){a.removeClass("select2-focused")}),this.dropdown.on("mouseup",s,this.bind(function(t){e(t.target).closest(".select2-result-selectable").length>0&&(this.highlightUnderEvent(t),this.selectHighlighted(t))})),this.dropdown.on("click mouseup mousedown touchstart touchend focusin",function(e){e.stopPropagation()}),this.nextSearchTerm=t,e.isFunction(this.opts.initSelection)&&(this.initSelection(),this.monitorSource()),null!==i.maximumInputLength&&this.search.attr("maxlength",i.maximumInputLength);var r=i.element.prop("disabled");r===t&&(r=!1),this.enable(!r);var l=i.element.prop("readonly");l===t&&(l=!1),this.readonly(l),W=W||o(),this.autofocus=i.element.prop("autofocus"),i.element.prop("autofocus",!1),this.autofocus&&this.focus(),this.search.attr("placeholder",i.searchInputPlaceholder)},destroy:function(){var e=this.opts.element,i=e.data("select2"),n=this;this.close(),e.length&&e[0].detachEvent&&e.each(function(){this.detachEvent("onpropertychange",n._sync)}),this.propertyObserver&&(this.propertyObserver.disconnect(),this.propertyObserver=null),this._sync=null,i!==t&&(i.container.remove(),i.liveRegion.remove(),i.dropdown.remove(),e.removeClass("select2-offscreen").removeData("select2").off(".select2").prop("autofocus",this.autofocus||!1),this.elementTabIndex?e.attr({tabindex:this.elementTabIndex}):e.removeAttr("tabindex"),e.show()),M.call(this,"container","liveRegion","dropdown","results","search")},optionToData:function(e){return e.is("option")?{id:e.prop("value"),text:e.text(),element:e.get(),css:e.attr("class"),disabled:e.prop("disabled"),locked:s(e.attr("locked"),"locked")||s(e.data("locked"),!0)}:e.is("optgroup")?{text:e.attr("label"),children:[],element:e.get(),css:e.attr("class")}:void 0},prepareOpts:function(i){var n,a,o,l,c=this;if(n=i.element,"select"===n.get(0).tagName.toLowerCase()&&(this.select=a=i.element),a&&e.each(["id","multiple","ajax","query","createSearchChoice","initSelection","data","tags"],function(){if(this in i)throw new Error("Option '"+this+"' is not allowed for Select2 when attached to a ","
        "," ","
          ","
        ","
        "].join(""));return t},enableInterface:function(){this.parent.enableInterface.apply(this,arguments)&&this.focusser.prop("disabled",!this.isInterfaceEnabled())},opening:function(){var i,n,a;this.opts.minimumResultsForSearch>=0&&this.showSearch(!0),this.parent.opening.apply(this,arguments),this.showSearchInput!==!1&&this.search.val(this.focusser.val()),this.opts.shouldFocusInput(this)&&(this.search.focus(),i=this.search.get(0),i.createTextRange?(n=i.createTextRange(),n.collapse(!1),n.select()):i.setSelectionRange&&(a=this.search.val().length,i.setSelectionRange(a,a))),""===this.search.val()&&this.nextSearchTerm!=t&&(this.search.val(this.nextSearchTerm),this.search.select()),this.focusser.prop("disabled",!0).val(""),this.updateResults(!0),this.opts.element.trigger(e.Event("select2-open"))},close:function(){this.opened()&&(this.parent.close.apply(this,arguments),this.focusser.prop("disabled",!1),this.opts.shouldFocusInput(this)&&this.focusser.focus())},focus:function(){this.opened()?this.close():(this.focusser.prop("disabled",!1),this.opts.shouldFocusInput(this)&&this.focusser.focus())},isFocused:function(){return this.container.hasClass("select2-container-active")},cancel:function(){this.parent.cancel.apply(this,arguments),this.focusser.prop("disabled",!1),this.opts.shouldFocusInput(this)&&this.focusser.focus()},destroy:function(){e("label[for='"+this.focusser.attr("id")+"']").attr("for",this.opts.element.attr("id")),this.parent.destroy.apply(this,arguments),M.call(this,"selection","focusser")},initContainer:function(){var t,n,a=this.container,o=this.dropdown,s=D();this.showSearch(this.opts.minimumResultsForSearch<0?!1:!0),this.selection=t=a.find(".select2-choice"),this.focusser=a.find(".select2-focusser"),t.find(".select2-chosen").attr("id","select2-chosen-"+s),this.focusser.attr("aria-labelledby","select2-chosen-"+s),this.results.attr("id","select2-results-"+s),this.search.attr("aria-owns","select2-results-"+s),this.focusser.attr("id","s2id_autogen"+s),n=e("label[for='"+this.opts.element.attr("id")+"']"),this.focusser.prev().text(n.text()).attr("for",this.focusser.attr("id"));var r=this.opts.element.attr("title");this.opts.element.attr("title",r||n.text()),this.focusser.attr("tabindex",this.elementTabIndex),this.search.attr("id",this.focusser.attr("id")+"_search"),this.search.prev().text(e("label[for='"+this.focusser.attr("id")+"']").text()).attr("for",this.search.attr("id")),this.search.on("keydown",this.bind(function(e){if(this.isInterfaceEnabled()&&229!=e.keyCode){if(e.which===I.PAGE_UP||e.which===I.PAGE_DOWN)return void g(e);switch(e.which){case I.UP:case I.DOWN:return this.moveHighlight(e.which===I.UP?-1:1),void g(e);case I.ENTER:return this.selectHighlighted(),void g(e);case I.TAB:return void this.selectHighlighted({noFocus:!0});case I.ESC:return this.cancel(e),void g(e)}}})),this.search.on("blur",this.bind(function(){document.activeElement===this.body.get(0)&&window.setTimeout(this.bind(function(){this.opened()&&this.search.focus()}),0)})),this.focusser.on("keydown",this.bind(function(e){if(this.isInterfaceEnabled()&&e.which!==I.TAB&&!I.isControl(e)&&!I.isFunctionKey(e)&&e.which!==I.ESC){if(this.opts.openOnEnter===!1&&e.which===I.ENTER)return void g(e);if(e.which==I.DOWN||e.which==I.UP||e.which==I.ENTER&&this.opts.openOnEnter){if(e.altKey||e.ctrlKey||e.shiftKey||e.metaKey)return;return this.open(),void g(e)}return e.which==I.DELETE||e.which==I.BACKSPACE?(this.opts.allowClear&&this.clear(),void g(e)):void 0}})),c(this.focusser),this.focusser.on("keyup-change input",this.bind(function(e){if(this.opts.minimumResultsForSearch>=0){if(e.stopPropagation(),this.opened())return;this.open()}})),t.on("mousedown touchstart","abbr",this.bind(function(e){this.isInterfaceEnabled()&&(this.clear(),m(e),this.close(),this.selection.focus())})),t.on("mousedown touchstart",this.bind(function(n){i(t),this.container.hasClass("select2-container-active")||this.opts.element.trigger(e.Event("select2-focus")),this.opened()?this.close():this.isInterfaceEnabled()&&this.open(),g(n)})),o.on("mousedown touchstart",this.bind(function(){this.opts.shouldFocusInput(this)&&this.search.focus()})),t.on("focus",this.bind(function(e){g(e)})),this.focusser.on("focus",this.bind(function(){this.container.hasClass("select2-container-active")||this.opts.element.trigger(e.Event("select2-focus")),this.container.addClass("select2-container-active")})).on("blur",this.bind(function(){this.opened()||(this.container.removeClass("select2-container-active"),this.opts.element.trigger(e.Event("select2-blur")))})),this.search.on("focus",this.bind(function(){this.container.hasClass("select2-container-active")||this.opts.element.trigger(e.Event("select2-focus")),this.container.addClass("select2-container-active")})),this.initContainerWidth(),this.opts.element.addClass("select2-offscreen"),this.setPlaceholder()},clear:function(t){var i=this.selection.data("select2-data");if(i){var n=e.Event("select2-clearing");if(this.opts.element.trigger(n),n.isDefaultPrevented())return;var a=this.getPlaceholderOption();this.opts.element.val(a?a.val():""),this.selection.find(".select2-chosen").empty(),this.selection.removeData("select2-data"),this.setPlaceholder(),t!==!1&&(this.opts.element.trigger({type:"select2-removed",val:this.id(i),choice:i}),this.triggerChange({removed:i}))}},initSelection:function(){if(this.isPlaceholderOptionSelected())this.updateSelection(null),this.close(),this.setPlaceholder();else{var e=this;this.opts.initSelection.call(null,this.opts.element,function(i){i!==t&&null!==i&&(e.updateSelection(i),e.close(),e.setPlaceholder(),e.nextSearchTerm=e.opts.nextSearchTerm(i,e.search.val()))})}},isPlaceholderOptionSelected:function(){var e;return this.getPlaceholder()===t?!1:(e=this.getPlaceholderOption())!==t&&e.prop("selected")||""===this.opts.element.val()||this.opts.element.val()===t||null===this.opts.element.val()},prepareOpts:function(){var t=this.parent.prepareOpts.apply(this,arguments),i=this;return"select"===t.element.get(0).tagName.toLowerCase()?t.initSelection=function(e,t){var n=e.find("option").filter(function(){return this.selected&&!this.disabled});t(i.optionToData(n))}:"data"in t&&(t.initSelection=t.initSelection||function(i,n){var a=i.val(),o=null;t.query({matcher:function(e,i,n){var r=s(a,t.id(n));return r&&(o=n),r},callback:e.isFunction(n)?function(){n(o)}:e.noop})}),t},getPlaceholder:function(){return this.select&&this.getPlaceholderOption()===t?t:this.parent.getPlaceholder.apply(this,arguments)},setPlaceholder:function(){var e=this.getPlaceholder();if(this.isPlaceholderOptionSelected()&&e!==t){if(this.select&&this.getPlaceholderOption()===t)return;this.selection.find(".select2-chosen").html(this.opts.escapeMarkup(e)),this.selection.addClass("select2-default"),this.container.removeClass("select2-allowclear")}},postprocessResults:function(e,t,i){var n=0,a=this;if(this.findHighlightableChoices().each2(function(e,t){return s(a.id(t.data("select2-data")),a.opts.element.val())?(n=e,!1):void 0}),i!==!1&&this.highlight(t===!0&&n>=0?n:0),t===!0){var o=this.opts.minimumResultsForSearch;o>=0&&this.showSearch(k(e.results)>=o)}},showSearch:function(t){this.showSearchInput!==t&&(this.showSearchInput=t,this.dropdown.find(".select2-search").toggleClass("select2-search-hidden",!t),this.dropdown.find(".select2-search").toggleClass("select2-offscreen",!t),e(this.dropdown,this.container).toggleClass("select2-with-searchbox",t))},onSelect:function(e,t){if(this.triggerSelect(e)){var i=this.opts.element.val(),n=this.data();this.opts.element.val(this.id(e)),this.updateSelection(e),this.opts.element.trigger({type:"select2-selected",val:this.id(e),choice:e}),this.nextSearchTerm=this.opts.nextSearchTerm(e,this.search.val()),this.close(),t&&t.noFocus||!this.opts.shouldFocusInput(this)||this.focusser.focus(),s(i,this.id(e))||this.triggerChange({added:e,removed:n})}},updateSelection:function(e){var i,n,a=this.selection.find(".select2-chosen");this.selection.data("select2-data",e),a.empty(),null!==e&&(i=this.opts.formatSelection(e,a,this.opts.escapeMarkup)),i!==t&&a.append(i),n=this.opts.formatSelectionCssClass(e,a),n!==t&&a.addClass(n),this.selection.removeClass("select2-default"),this.opts.allowClear&&this.getPlaceholder()!==t&&this.container.addClass("select2-allowclear")},val:function(){var e,i=!1,n=null,a=this,o=this.data();if(0===arguments.length)return this.opts.element.val();if(e=arguments[0],arguments.length>1&&(i=arguments[1]),this.select)this.select.val(e).find("option").filter(function(){return this.selected}).each2(function(e,t){return n=a.optionToData(t),!1}),this.updateSelection(n),this.setPlaceholder(),i&&this.triggerChange({added:n,removed:o});else{if(!e&&0!==e)return void this.clear(i);if(this.opts.initSelection===t)throw new Error("cannot call val() if initSelection() is not defined");this.opts.element.val(e),this.opts.initSelection(this.opts.element,function(e){a.opts.element.val(e?a.id(e):""),a.updateSelection(e),a.setPlaceholder(),i&&a.triggerChange({added:e,removed:o})})}},clearSearch:function(){this.search.val(""),this.focusser.val("")},data:function(e){var i,n=!1;return 0===arguments.length?(i=this.selection.data("select2-data"),i==t&&(i=null),i):(arguments.length>1&&(n=arguments[1]),void(e?(i=this.data(),this.opts.element.val(e?this.id(e):""),this.updateSelection(e),n&&this.triggerChange({added:e,removed:i})):this.clear(n)))}}),B=P(L,{createContainer:function(){var t=e(document.createElement("div")).attr({"class":"select2-container select2-container-multi"}).html(["
          ","
        • "," "," ","
        • ","
        ","
        ","
          ","
        ","
        "].join(""));return t},prepareOpts:function(){var t=this.parent.prepareOpts.apply(this,arguments),i=this;return"select"===t.element.get(0).tagName.toLowerCase()?t.initSelection=function(e,t){var n=[];e.find("option").filter(function(){return this.selected&&!this.disabled}).each2(function(e,t){n.push(i.optionToData(t))}),t(n)}:"data"in t&&(t.initSelection=t.initSelection||function(i,n){var a=r(i.val(),t.separator),o=[];t.query({matcher:function(i,n,r){var l=e.grep(a,function(e){return s(e,t.id(r))}).length;return l&&o.push(r),l},callback:e.isFunction(n)?function(){for(var e=[],i=0;i0||(this.selectChoice(null),this.clearPlaceholder(),this.container.hasClass("select2-container-active")||this.opts.element.trigger(e.Event("select2-focus")),this.open(),this.focusSearch(),t.preventDefault()))})),this.container.on("focus",i,this.bind(function(){this.isInterfaceEnabled()&&(this.container.hasClass("select2-container-active")||this.opts.element.trigger(e.Event("select2-focus")),this.container.addClass("select2-container-active"),this.dropdown.addClass("select2-drop-active"),this.clearPlaceholder())})),this.initContainerWidth(),this.opts.element.addClass("select2-offscreen"),this.clearSearch()},enableInterface:function(){this.parent.enableInterface.apply(this,arguments)&&this.search.prop("disabled",!this.isInterfaceEnabled())},initSelection:function(){if(""===this.opts.element.val()&&""===this.opts.element.text()&&(this.updateSelection([]),this.close(),this.clearSearch()),this.select||""!==this.opts.element.val()){var e=this;this.opts.initSelection.call(null,this.opts.element,function(i){i!==t&&null!==i&&(e.updateSelection(i),e.close(),e.clearSearch())})}},clearSearch:function(){var e=this.getPlaceholder(),i=this.getMaxSearchWidth();e!==t&&0===this.getVal().length&&this.search.hasClass("select2-focused")===!1?(this.search.val(e).addClass("select2-default"),this.search.width(i>0?i:this.container.css("width"))):this.search.val("").width(10)},clearPlaceholder:function(){this.search.hasClass("select2-default")&&this.search.val("").removeClass("select2-default")},opening:function(){this.clearPlaceholder(),this.resizeSearch(),this.parent.opening.apply(this,arguments),this.focusSearch(),""===this.search.val()&&this.nextSearchTerm!=t&&(this.search.val(this.nextSearchTerm),this.search.select()),this.updateResults(!0),this.opts.shouldFocusInput(this)&&this.search.focus(),this.opts.element.trigger(e.Event("select2-open"))},close:function(){this.opened()&&this.parent.close.apply(this,arguments)},focus:function(){this.close(),this.search.focus()},isFocused:function(){return this.search.hasClass("select2-focused")},updateSelection:function(t){var i=[],n=[],o=this;e(t).each(function(){a(o.id(this),i)<0&&(i.push(o.id(this)),n.push(this))}),t=n,this.selection.find(".select2-search-choice").remove(),e(t).each(function(){o.addSelectedChoice(this)}),o.postprocessResults()},tokenize:function(){var e=this.search.val();e=this.opts.tokenizer.call(this,e,this.data(),this.bind(this.onSelect),this.opts),null!=e&&e!=t&&(this.search.val(e),e.length>0&&this.open())},onSelect:function(e,i){this.triggerSelect(e)&&""!==e.text&&(this.addSelectedChoice(e),this.opts.element.trigger({type:"selected",val:this.id(e),choice:e}),this.nextSearchTerm=this.opts.nextSearchTerm(e,this.search.val()),this.clearSearch(),this.updateResults(),(this.select||!this.opts.closeOnSelect)&&this.postprocessResults(e,!1,this.opts.closeOnSelect===!0),this.opts.closeOnSelect?(this.close(),this.search.width(10)):this.countSelectableResults()>0?(this.search.width(10),this.resizeSearch(),this.getMaximumSelectionSize()>0&&this.val().length>=this.getMaximumSelectionSize()?this.updateResults(!0):this.nextSearchTerm!=t&&(this.search.val(this.nextSearchTerm),this.updateResults(),this.search.select()),this.positionDropdown()):(this.close(),this.search.width(10)),this.triggerChange({added:e}),i&&i.noFocus||this.focusSearch())},cancel:function(){this.close(),this.focusSearch()},addSelectedChoice:function(i){var n,a,o=!i.locked,s=e("
      • "),r=e("
      • "),l=o?s:r,c=this.id(i),d=this.getVal();n=this.opts.formatSelection(i,l.find("div"),this.opts.escapeMarkup),n!=t&&l.find("div").replaceWith("
        "+n+"
        "),a=this.opts.formatSelectionCssClass(i,l.find("div")),a!=t&&l.addClass(a),o&&l.find(".select2-search-choice-close").on("mousedown",g).on("click dblclick",this.bind(function(t){this.isInterfaceEnabled()&&(this.unselect(e(t.target)),this.selection.find(".select2-search-choice-focus").removeClass("select2-search-choice-focus"),g(t),this.close(),this.focusSearch())})).on("focus",this.bind(function(){this.isInterfaceEnabled()&&(this.container.addClass("select2-container-active"),this.dropdown.addClass("select2-drop-active"))})),l.data("select2-data",i),l.insertBefore(this.searchContainer),d.push(c),this.setVal(d)},unselect:function(t){var i,n,o=this.getVal();if(t=t.closest(".select2-search-choice"),0===t.length)throw"Invalid argument: "+t+". Must be .select2-search-choice";if(i=t.data("select2-data")){var s=e.Event("select2-removing");if(s.val=this.id(i),s.choice=i,this.opts.element.trigger(s),s.isDefaultPrevented())return!1;for(;(n=a(this.id(i),o))>=0;)o.splice(n,1),this.setVal(o),this.select&&this.postprocessResults();return t.remove(),this.opts.element.trigger({type:"select2-removed",val:this.id(i),choice:i}),this.triggerChange({removed:i}),!0}},postprocessResults:function(e,t,i){var n=this.getVal(),o=this.results.find(".select2-result"),s=this.results.find(".select2-result-with-children"),r=this;o.each2(function(e,t){var i=r.id(t.data("select2-data"));a(i,n)>=0&&(t.addClass("select2-selected"),t.find(".select2-result-selectable").addClass("select2-selected"))}),s.each2(function(e,t){t.is(".select2-result-selectable")||0!==t.find(".select2-result-selectable:not(.select2-selected)").length||t.addClass("select2-selected")}),-1==this.highlight()&&i!==!1&&r.highlight(0),!this.opts.createSearchChoice&&!o.filter(".select2-result:not(.select2-selected)").length>0&&(!e||e&&!e.more&&0===this.results.find(".select2-no-results").length)&&_(r.opts.formatNoMatches,"formatNoMatches")&&this.results.append("
      • "+T(r.opts.formatNoMatches,r.opts.element,r.search.val())+"
      • ")},getMaxSearchWidth:function(){return this.selection.width()-l(this.search)},resizeSearch:function(){var e,t,i,n,a,o=l(this.search);e=v(this.search)+10,t=this.search.offset().left,i=this.selection.width(),n=this.selection.offset().left,a=i-(t-n)-o,e>a&&(a=i-o),40>a&&(a=i-o),0>=a&&(a=e),this.search.width(Math.floor(a))},getVal:function(){var e;return this.select?(e=this.select.val(),null===e?[]:e):(e=this.opts.element.val(),r(e,this.opts.separator))},setVal:function(t){var i;this.select?this.select.val(t):(i=[],e(t).each(function(){a(this,i)<0&&i.push(this)}),this.opts.element.val(0===i.length?"":i.join(this.opts.separator)))},buildChangeDetails:function(e,t){for(var t=t.slice(0),e=e.slice(0),i=0;i0&&i--,e.splice(n,1),n--);return{added:t,removed:e}},val:function(i,n){var a,o=this;if(0===arguments.length)return this.getVal();if(a=this.data(),a.length||(a=[]),!i&&0!==i)return this.opts.element.val(""),this.updateSelection([]),this.clearSearch(),void(n&&this.triggerChange({added:this.data(),removed:a}));if(this.setVal(i),this.select)this.opts.initSelection(this.select,this.bind(this.updateSelection)),n&&this.triggerChange(this.buildChangeDetails(a,this.data()));else{if(this.opts.initSelection===t)throw new Error("val() cannot be called if initSelection() is not defined");this.opts.initSelection(this.opts.element,function(t){var i=e.map(t,o.id);o.setVal(i),o.updateSelection(t),o.clearSearch(),n&&o.triggerChange(o.buildChangeDetails(a,o.data()))})}this.clearSearch()},onSortStart:function(){if(this.select)throw new Error("Sorting of elements is not supported when attached to instead.");this.search.width(0),this.searchContainer.hide()},onSortEnd:function(){var t=[],i=this;this.searchContainer.show(),this.searchContainer.appendTo(this.searchContainer.parent()),this.resizeSearch(),this.selection.find(".select2-search-choice").each(function(){t.push(i.opts.id(e(this).data("select2-data")))}),this.setVal(t),this.triggerChange()},data:function(t,i){var n,a,o=this;return 0===arguments.length?this.selection.children(".select2-search-choice").map(function(){return e(this).data("select2-data")}).get():(a=this.data(),t||(t=[]),n=e.map(t,function(e){return o.opts.id(e)}),this.setVal(n),this.updateSelection(t),this.clearSearch(),void(i&&this.triggerChange(this.buildChangeDetails(a,this.data()))))}}),e.fn.select2=function(){var i,n,o,s,r,l=Array.prototype.slice.call(arguments,0),c=["val","destroy","opened","open","close","focus","isFocused","container","dropdown","onSortStart","onSortEnd","enable","disable","readonly","positionDropdown","data","search"],d=["opened","isFocused","container","dropdown"],h=["val","data"],u={search:"externalSearch"};return this.each(function(){if(0===l.length||"object"==typeof l[0])i=0===l.length?{}:e.extend({},l[0]),i.element=e(this),"select"===i.element.get(0).tagName.toLowerCase()?r=i.element.prop("multiple"):(r=i.multiple||!1,"tags"in i&&(i.multiple=r=!0)),n=r?new window.Select2["class"].multi:new window.Select2["class"].single,n.init(i);else{if("string"!=typeof l[0])throw"Invalid arguments to select2 plugin: "+l;if(a(l[0],c)<0)throw"Unknown method: "+l[0];if(s=t,n=e(this).data("select2"),n===t)return;if(o=l[0],"container"===o?s=n.container:"dropdown"===o?s=n.dropdown:(u[o]&&(o=u[o]),s=n[o].apply(n,l.slice(1))),a(l[0],d)>=0||a(l[0],h)>=0&&1==l.length)return!1}}),s===t?this:s},e.fn.select2.defaults={width:"copy",loadMorePadding:0,closeOnSelect:!0,openOnEnter:!0,containerCss:{},dropdownCss:{},containerCssClass:"",dropdownCssClass:"",formatResult:function(e,t,i,n){var a=[];return b(e.text,i.term,a,n),a.join("")},formatSelection:function(e,i,n){return e?n(e.text):t},sortResults:function(e){return e},formatResultCssClass:function(e){return e.css},formatSelectionCssClass:function(){return t},minimumResultsForSearch:0,minimumInputLength:0,maximumInputLength:null,maximumSelectionSize:0,id:function(e){return e==t?null:e.id},matcher:function(e,t){return n(""+t).toUpperCase().indexOf(n(""+e).toUpperCase())>=0},separator:",",tokenSeparators:[],tokenizer:E,escapeMarkup:x,blurOnChange:!1,selectOnBlur:!1,adaptContainerCssClass:function(e){return e},adaptDropdownCssClass:function(){return null},nextSearchTerm:function(){return t},searchInputPlaceholder:"",createSearchChoicePosition:"top",shouldFocusInput:function(e){var t="ontouchstart"in window||navigator.msMaxTouchPoints>0;return t&&e.opts.minimumResultsForSearch<0?!1:!0}},e.fn.select2.locales=[],e.fn.select2.locales.en={formatMatches:function(e){return 1===e?"One result is available, press enter to select it.":e+" results are available, use up and down arrow keys to navigate."},formatNoMatches:function(){return"No matches found"},formatAjaxError:function(){return"Loading failed"},formatInputTooShort:function(e,t){var i=t-e.length;return"Please enter "+i+" or more character"+(1==i?"":"s")},formatInputTooLong:function(e,t){var i=e.length-t;return"Please delete "+i+" character"+(1==i?"":"s")},formatSelectionTooBig:function(e){return"You can only select "+e+" item"+(1==e?"":"s")},formatLoadMore:function(){return"Loading more results…"},formatSearching:function(){return"Searching…"}},e.extend(e.fn.select2.defaults,e.fn.select2.locales.en),e.fn.select2.ajaxDefaults={transport:e.ajax,params:{type:"GET",cache:!1,dataType:"json"}},window.Select2={query:{ajax:y,local:C,tags:S},util:{debounce:h,markMatch:b,escapeMarkup:x,stripDiacritics:n},"class":{"abstract":L,single:O,multi:B}}}}(jQuery),function(e){"use strict";function t(e){return" "+e+" символ"+(5>e%10&&e%10>0&&(5>e%100||e%100>20)?e%10>1?"a":"":"ов")}e.fn.select2.locales.ru={formatNoMatches:function(){return"Совпадений не найдено"},formatInputTooShort:function(e,i){return"Пожалуйста, введите еще хотя бы"+t(i-e.length)},formatInputTooLong:function(e,i){return"Пожалуйста, введите на"+t(e.length-i)+" меньше"},formatSelectionTooBig:function(e){return"Вы можете выбрать не более "+e+" элемент"+(e%10==1&&e%100!=11?"а":"ов")},formatLoadMore:function(){return"Загрузка данных…"},formatSearching:function(){return"Поиск…"}},e.extend(e.fn.select2.defaults,e.fn.select2.locales.ru)}(jQuery),jQuery(function(e){e.datepicker.regional.ru={closeText:"Закрыть",prevText:"<Пред",nextText:"След>",currentText:"Сегодня",monthNames:["Январь","Февраль","Март","Апрель","Май","Июнь","Июль","Август","Сентябрь","Октябрь","Ноябрь","Декабрь"],monthNamesShort:["Янв","Фев","Мар","Апр","Май","Июн","Июл","Авг","Сен","Окт","Ноя","Дек"],dayNames:["воскресенье","понедельник","вторник","среда","четверг","пятница","суббота"],dayNamesShort:["вск","пнд","втр","срд","чтв","птн","сбт"],dayNamesMin:["Вс","Пн","Вт","Ср","Чт","Пт","Сб"],weekHeader:"Нед",dateFormat:"dd.mm.yy",firstDay:1,isRTL:!1,showMonthAfterYear:!1,yearSuffix:""},e.datepicker.setDefaults(e.datepicker.regional.ru)}),function(e){function t(t){var i=t||window.event,n=[].slice.call(arguments,1),a=0,o=0,s=0;return t=e.event.fix(i),t.type="mousewheel",i.wheelDelta&&(a=i.wheelDelta/120),i.detail&&(a=-i.detail/3),s=a,void 0!==i.axis&&i.axis===i.HORIZONTAL_AXIS&&(s=0,o=-1*a),void 0!==i.wheelDeltaY&&(s=i.wheelDeltaY/120),void 0!==i.wheelDeltaX&&(o=-1*i.wheelDeltaX/120),n.unshift(t,a,o,s),(e.event.dispatch||e.event.handle).apply(this,n)}var i=["DOMMouseScroll","mousewheel"];if(e.event.fixHooks)for(var n=i.length;n;)e.event.fixHooks[i[--n]]=e.event.mouseHooks;e.event.special.mousewheel={setup:function(){if(this.addEventListener)for(var e=i.length;e;)this.addEventListener(i[--e],t,!1);else this.onmousewheel=t +},teardown:function(){if(this.removeEventListener)for(var e=i.length;e;)this.removeEventListener(i[--e],t,!1);else this.onmousewheel=null}},e.fn.extend({mousewheel:function(e){return e?this.bind("mousewheel",e):this.trigger("mousewheel")},unmousewheel:function(e){return this.unbind("mousewheel",e)}})}(jQuery);var Swiper=function(e,t){function i(e,t){return document.querySelectorAll?(t||document).querySelectorAll(e):jQuery(e,t)}function n(){var e=k-P;return t.freeMode&&(e=k-P),t.slidesPerView>S.slides.length&&(e=0),0>e&&(e=0),e}function a(){function e(e){var i=new Image;i.onload=function(){S.imagesLoaded++,S.imagesLoaded==S.imagesToLoad.length&&(S.reInit(),t.onImagesReady&&S.fireCallback(t.onImagesReady,S))},i.src=e}var n=S.h.addEventListener;if(S.browser.ie10?(n(S.wrapper,S.touchEvents.touchStart,f),n(document,S.touchEvents.touchMove,g),n(document,S.touchEvents.touchEnd,m)):(S.support.touch&&(n(S.wrapper,"touchstart",f),n(S.wrapper,"touchmove",g),n(S.wrapper,"touchend",m)),t.simulateTouch&&(n(S.wrapper,"mousedown",f),n(document,"mousemove",g),n(document,"mouseup",m))),t.autoResize&&n(window,"resize",S.resizeFix),o(),S._wheelEvent=!1,t.mousewheelControl){void 0!==document.onmousewheel&&(S._wheelEvent="mousewheel");try{WheelEvent("wheel"),S._wheelEvent="wheel"}catch(a){}S._wheelEvent||(S._wheelEvent="DOMMouseScroll"),S._wheelEvent&&n(S.container,S._wheelEvent,l)}if(t.keyboardControl&&n(document,"keydown",r),t.updateOnImagesReady)for(S.imagesToLoad=i("img",S.container),n=0;n=a&&c[0]<=a+s&&c[1]>=o&&c[1]<=o+r&&(i=!0)}if(!i)return}O?((37==t||39==t)&&(e.preventDefault?e.preventDefault():e.returnValue=!1),39==t&&S.swipeNext(),37==t&&S.swipePrev()):((38==t||40==t)&&(e.preventDefault?e.preventDefault():e.returnValue=!1),40==t&&S.swipeNext(),38==t&&S.swipePrev())}function l(e){var i=S._wheelEvent,a=0;if(e.detail)a=-e.detail;else if("mousewheel"==i)if(O){if(!(Math.abs(e.wheelDeltaX)>Math.abs(e.wheelDeltaY)))return;a=e.wheelDeltaX}else{if(!(Math.abs(e.wheelDeltaY)>Math.abs(e.wheelDeltaX)))return;a=e.wheelDeltaY}else if("DOMMouseScroll"==i)a=-e.detail;else if("wheel"==i)if(O){if(!(Math.abs(e.deltaX)>Math.abs(e.deltaY)))return;a=-e.deltaX}else{if(!(Math.abs(e.deltaY)>Math.abs(e.deltaX)))return;a=-e.deltaY}if(t.freeMode){if(i=S.getWrapperTranslate()+a,i>0&&(i=0),i<-n()&&(i=-n()),S.setWrapperTransition(0),S.setWrapperTranslate(i),S.updateActiveSlide(i),0==i||i==-n())return}else 60<(new Date).getTime()-A&&(0>a?S.swipeNext():S.swipePrev()),A=(new Date).getTime();return t.autoplay&&S.stopAutoplay(!0),e.preventDefault?e.preventDefault():e.returnValue=!1,!1}function c(e){S.allowSlideClick&&(h(e),S.fireCallback(t.onSlideClick,S,e))}function d(e){h(e),S.fireCallback(t.onSlideTouch,S,e)}function h(e){if(e.currentTarget)S.clickedSlide=e.currentTarget;else{e=e.srcElement;do if(-1Math.abs(i-S.touches.startX))),"undefined"!=typeof M||O||(M=!!(M||Math.abs(a-S.touches.startY)e?P/2:S.positions.current*e),S.positions.current<-n()&&(i=(S.touches.current-S.touches.start)*t.touchRatio+(n()+S.positions.start),e=(P+i)/P,i=S.positions.current-i*(1-e)/2,a=-n()-P/2,S.positions.current=a>i||0>=e?a:i)),t.resistance&&"100%"==t.resistance&&(0t.moveStartThreshold||R?(R=!0,S.setWrapperTranslate(S.positions.current)):S.positions.current=S.positions.start:S.setWrapperTranslate(S.positions.current),(t.freeMode||t.watchActiveIndex)&&S.updateActiveSlide(S.positions.current),t.grabCursor&&(S.container.style.cursor="move",S.container.style.cursor="grabbing",S.container.style.cursor="-moz-grabbin",S.container.style.cursor="-webkit-grabbing"),W||(W=S.touches.current),H||(H=(new Date).getTime()),S.velocity=(S.touches.current-W)/((new Date).getTime()-H)/2,2>Math.abs(S.touches.current-W)&&(S.velocity=0),W=S.touches.current,H=(new Date).getTime(),S.callPlugins("onTouchMoveEnd"),t.onTouchMove&&S.fireCallback(t.onTouchMove,S),!1}}function m(e){if(M&&S.swipeReset(),!t.onlyExternal&&S.isTouched){S.isTouched=!1,t.grabCursor&&(S.container.style.cursor="move",S.container.style.cursor="grab",S.container.style.cursor="-moz-grab",S.container.style.cursor="-webkit-grab"),S.positions.current||0===S.positions.current||(S.positions.current=S.positions.start),t.followFinger&&S.setWrapperTranslate(S.positions.current),S.times.end=(new Date).getTime(),S.touches.diff=S.touches.current-S.touches.start,S.touches.abs=Math.abs(S.touches.diff),S.positions.diff=S.positions.current-S.positions.start,S.positions.abs=Math.abs(S.positions.diff);var i=S.positions.diff,a=S.positions.abs;e=S.times.end-S.times.start,5>a&&300>e&&0==S.allowLinks&&(t.freeMode||0==a||S.swipeReset(),t.preventLinks&&(S.allowLinks=!0),t.onSlideClick&&(S.allowSlideClick=!0)),setTimeout(function(){t.preventLinks&&(S.allowLinks=!0),t.onSlideClick&&(S.allowSlideClick=!0)},100);var o=n();if(!S.isMoved&&t.freeMode)S.isMoved=!1,t.onTouchEnd&&S.fireCallback(t.onTouchEnd,S);else if(!S.isMoved||0i&&(t.momentumBounce&&S.support.transitions?(-l>i+o&&(i=-o-l),s=-o,F=r=!0):i=-o),i>0&&(t.momentumBounce&&S.support.transitions?(i>l&&(i=l),s=0,F=r=!0):i=0),0!=S.velocity&&(a=Math.abs((i-S.positions.current)/S.velocity)),S.setWrapperTranslate(i),S.setWrapperTransition(a),t.momentumBounce&&r&&S.wrapperTransitionEnd(function(){F&&(t.onMomentumBounce&&S.fireCallback(t.onMomentumBounce,S),S.callPlugins("onMomentumBounce"),S.setWrapperTranslate(s),S.setWrapperTransition(300))}),S.updateActiveSlide(i)}(!t.freeModeFluid||e>=300)&&S.updateActiveSlide(S.positions.current),t.onTouchEnd&&S.fireCallback(t.onTouchEnd,S)}else{if(E=0>i?"toNext":"toPrev","toNext"==E&&300>=e&&(30>a||!t.shortSwipes?S.swipeReset():S.swipeNext(!0)),"toPrev"==E&&300>=e&&(30>a||!t.shortSwipes?S.swipeReset():S.swipePrev(!0)),o=0,"auto"==t.slidesPerView){for(var i=Math.abs(S.getWrapperTranslate()),c=r=0;ci){o=l;break}o>P&&(o=P)}else o=T*t.slidesPerView;"toNext"==E&&e>300&&(a>=.5*o?S.swipeNext(!0):S.swipeReset()),"toPrev"==E&&e>300&&(a>=.5*o?S.swipePrev(!0):S.swipeReset()),t.onTouchEnd&&t.onTouchEnd(S)}S.callPlugins("onTouchEnd")}}function v(e,i,n){function a(){s+=r,(c="toNext"==l?s>e:e>s)?(S.setWrapperTranslate(Math.round(s)),S._DOMAnimating=!0,window.setTimeout(function(){a()},1e3/60)):(t.onSlideChangeEnd&&S.fireCallback(t.onSlideChangeEnd,S),S.setWrapperTranslate(e),S._DOMAnimating=!1)}var o="to"==i&&0<=n.speed?n.speed:t.speed;if(S.support.transitions||!t.DOMAnimation)S.setWrapperTranslate(e),S.setWrapperTransition(o);else{var s=S.getWrapperTranslate(),r=Math.ceil((e-s)/o*(1e3/60)),l=s>e?"toNext":"toPrev",c="toNext"==l?s>e:e>s;if(S._DOMAnimating)return;a()}S.updateActiveSlide(e),t.onSlideNext&&"next"==i&&S.fireCallback(t.onSlideNext,S,e),t.onSlidePrev&&"prev"==i&&S.fireCallback(t.onSlidePrev,S,e),t.onSlideReset&&"reset"==i&&S.fireCallback(t.onSlideReset,S,e),("next"==i||"prev"==i||"to"==i&&1==n.runCallbacks)&&w(i)}function w(e){if(S.callPlugins("onSlideChangeStart"),t.onSlideChangeStart)if(t.queueStartCallbacks&&S.support.transitions){if(S._queueStartCallbacks)return;S._queueStartCallbacks=!0,S.fireCallback(t.onSlideChangeStart,S,e),S.wrapperTransitionEnd(function(){S._queueStartCallbacks=!1})}else S.fireCallback(t.onSlideChangeStart,S,e);t.onSlideChangeEnd&&(S.support.transitions?t.queueEndCallbacks?S._queueEndCallbacks||(S._queueEndCallbacks=!0,S.wrapperTransitionEnd(function(i){S.fireCallback(t.onSlideChangeEnd,i,e)})):S.wrapperTransitionEnd(function(i){S.fireCallback(t.onSlideChangeEnd,i,e)}):t.DOMAnimation||setTimeout(function(){S.fireCallback(t.onSlideChangeStart,S,e)},10))}function b(){for(var e=S.paginationButtons,t=0;ti;i++)if(this[i]===e)return i;return-1}),(document.querySelectorAll||window.jQuery)&&"undefined"!=typeof e&&(e.nodeType||0!==i(e).length)){var S=this;S.touches={start:0,startX:0,startY:0,current:0,currentX:0,currentY:0,diff:0,abs:0},S.positions={start:0,abs:0,diff:0,current:0},S.times={start:0,end:0},S.id=(new Date).getTime(),S.container=e.nodeType?e:i(e)[0],S.isTouched=!1,S.isMoved=!1,S.activeIndex=0,S.centerIndex=0,S.activeLoaderIndex=0,S.activeLoopIndex=0,S.previousIndex=null,S.velocity=0,S.snapGrid=[],S.slidesGrid=[],S.imagesToLoad=[],S.imagesLoaded=0,S.wrapperLeft=0,S.wrapperRight=0,S.wrapperTop=0,S.wrapperBottom=0;var _,T,k,E,M,P,C={mode:"horizontal",touchRatio:1,speed:300,freeMode:!1,freeModeFluid:!1,momentumRatio:1,momentumBounce:!0,momentumBounceRatio:1,slidesPerView:1,slidesPerGroup:1,simulateTouch:!0,followFinger:!0,shortSwipes:!0,moveStartThreshold:!1,onlyExternal:!1,createPagination:!0,pagination:!1,paginationElement:"span",paginationClickable:!1,paginationAsRange:!0,resistance:!0,scrollContainer:!1,preventLinks:!0,noSwiping:!1,noSwipingClass:"swiper-no-swiping",initialSlide:0,keyboardControl:!1,mousewheelControl:!1,useCSS3Transforms:!0,autoplay:!1,autoplayDisableOnInteraction:!0,loop:!1,loopAdditionalSlides:0,calculateHeight:!1,cssWidthAndHeight:!1,updateOnImagesReady:!0,releaseFormElements:!0,watchActiveIndex:!1,visibilityFullFit:!1,offsetPxBefore:0,offsetPxAfter:0,offsetSlidesBefore:0,offsetSlidesAfter:0,centeredSlides:!1,queueStartCallbacks:!1,queueEndCallbacks:!1,autoResize:!0,resizeReInit:!1,DOMAnimation:!0,loader:{slides:[],slidesHTMLType:"inner",surroundGroups:1,logic:"reload",loadAllSlides:!1},slideElement:"div",slideClass:"swiper-slide",slideActiveClass:"swiper-slide-active",slideVisibleClass:"swiper-slide-visible",wrapperClass:"swiper-wrapper",paginationElementClass:"swiper-pagination-switch",paginationActiveClass:"swiper-active-switch",paginationVisibleClass:"swiper-visible-switch"};t=t||{};for(var I in C)if(I in t&&"object"==typeof t[I])for(var L in C[I])L in t[I]||(t[I][L]=C[I][L]);else I in t||(t[I]=C[I]);S.params=t,t.scrollContainer&&(t.freeMode=!0,t.freeModeFluid=!0),t.loop&&(t.resistance="100%");var O="horizontal"===t.mode;for(S.touchEvents={touchStart:S.support.touch||!t.simulateTouch?"touchstart":S.browser.ie10?"MSPointerDown":"mousedown",touchMove:S.support.touch||!t.simulateTouch?"touchmove":S.browser.ie10?"MSPointerMove":"mousemove",touchEnd:S.support.touch||!t.simulateTouch?"touchend":S.browser.ie10?"MSPointerUp":"mouseup"},I=S.container.childNodes.length-1;I>=0;I--)if(S.container.childNodes[I].className)for(L=S.container.childNodes[I].className.split(" "),C=0;C=0;i--)e===S.slides[i]&&(t=i);return t},e.isActive=function(){return e.index()===S.activeIndex?!0:!1},e.swiperSlideDataStorage||(e.swiperSlideDataStorage={}),e.getData=function(t){return e.swiperSlideDataStorage[t]},e.setData=function(t,i){return e.swiperSlideDataStorage[t]=i,e},e.data=function(t,i){return i?(e.setAttribute("data-"+t,i),e):e.getAttribute("data-"+t)},e.getWidth=function(t){return S.h.getWidth(e,t)},e.getHeight=function(t){return S.h.getHeight(e,t)},e.getOffset=function(){return S.h.getOffset(e)},e},S.calcSlides=function(e){var i=S.slides?S.slides.length:!1;S.slides=[],S.displaySlides=[];for(var n=0;n=0;n--)S._extendSwiperSlide(S.slides[n]);!1===i||i===S.slides.length&&!e||(s(),o(),S.updateActiveSlide(),S.params.pagination&&S.createPagination(),S.callPlugins("numberOfSlidesChanged"))},S.createSlide=function(e,i,n){return i=i||S.params.slideClass,n=n||t.slideElement,n=document.createElement(n),n.innerHTML=e||"",n.className=i,S._extendSwiperSlide(n)},S.appendSlide=function(e,t,i){return e?e.nodeType?S._extendSwiperSlide(e).append():S.createSlide(e,t,i).append():void 0},S.prependSlide=function(e,t,i){return e?e.nodeType?S._extendSwiperSlide(e).prepend():S.createSlide(e,t,i).prepend():void 0},S.insertSlideAfter=function(e,t,i,n){return"undefined"==typeof e?!1:t.nodeType?S._extendSwiperSlide(t).insertAfter(e):S.createSlide(t,i,n).insertAfter(e)},S.removeSlide=function(e){if(S.slides[e]){if(t.loop){if(!S.slides[e+S.loopedSlides])return!1;S.slides[e+S.loopedSlides].remove(),S.removeLoopedSlides(),S.calcSlides(),S.createLoop()}else S.slides[e].remove();return!0}return!1},S.removeLastSlide=function(){return 0=0;e--)S.slides[e].remove()},S.getSlide=function(e){return S.slides[e]},S.getLastSlide=function(){return S.slides[S.slides.length-1]},S.getFirstSlide=function(){return S.slides[0]},S.activeSlide=function(){return S.slides[S.activeIndex]};var B,D=[];for(B in S.plugins)t[B]&&(I=S.plugins[B](S,t[B]))&&D.push(I);S.callPlugins=function(e,t){t||(t={});for(var i=0;iP){for(f=0;f<=Math.floor(u/(P+S.wrapperLeft));f++)S.snapGrid.push(0===f?r+S.wrapperLeft:r+S.wrapperLeft+P*f);S.slidesGrid.push(r+S.wrapperLeft)}else S.snapGrid.push(l),S.slidesGrid.push(l);l+=u/2+p/2}else{if(u>P)for(f=0;f<=Math.floor(u/P);f++)S.snapGrid.push(r+P*f);else S.snapGrid.push(r);S.slidesGrid.push(r)}r+=u,o+=a,s+=h}t.calculateHeight&&(S.height=c),O?(k=o+S.wrapperRight+S.wrapperLeft,n.style.width=o+"px",n.style.height=S.height+"px"):(k=s+S.wrapperTop+S.wrapperBottom,n.style.width=S.width+"px",n.style.height=s+"px")}else if(t.scrollContainer)n.style.width="",n.style.height="",c=S.slides[0].getWidth(!0),o=S.slides[0].getHeight(!0),k=O?c:o,n.style.width=c+"px",n.style.height=o+"px",T=O?c:o;else{if(t.calculateHeight){for(o=c=0,O||(S.container.style.height=""),n.style.height="",d=0;d=S.snapGrid[a]&&-eS.snapGrid[n]&&-e0&&(i=0),i==e?!1:(v(i,"prev"),!0)},S.swipeReset=function(){S.callPlugins("onSwipeReset");var e=S.getWrapperTranslate(),i=T*t.slidesPerGroup;if(n(),"auto"==t.slidesPerView){for(var a=i=0;a=S.snapGrid[a]&&-e=S.snapGrid[S.snapGrid.length-1]&&(i=-S.snapGrid[S.snapGrid.length-1]),e<=-n()&&(i=-n())}else i=0>e?Math.round(e/i)*i:0;return t.scrollContainer&&(i=0>e?e:0),i<-n()&&(i=-n()),t.scrollContainer&&P>T&&(i=0),i==e?!1:(v(i,"reset"),!0)},S.swipeTo=function(e,i,a){e=parseInt(e,10),S.callPlugins("onSwipeTo",{index:e,speed:i}),t.loop&&(e+=S.loopedSlides);var o=S.getWrapperTranslate();if(!(e>S.slides.length-1||0>e)){var s;return s="auto"==t.slidesPerView?-S.slidesGrid[e]:-e*T,s<-n()&&(s=-n()),s==o?!1:(v(s,"to",{index:e,speed:i,runCallbacks:!1===a?!1:!0}),!0)}},S._queueStartCallbacks=!1,S._queueEndCallbacks=!1,S.updateActiveSlide=function(e){if(S.initialized&&0!=S.slides.length){if(S.previousIndex=S.activeIndex,"undefined"==typeof e&&(e=S.getWrapperTranslate()),e>0&&(e=0),"auto"==t.slidesPerView){if(S.activeIndex=S.slidesGrid.indexOf(-e),0>S.activeIndex){for(var i=0;iS.slidesGrid[i]&&-e=n?i:i+1}}else S.activeIndex=Math[t.visibilityFullFit?"ceil":"round"](-e/T);if(S.activeIndex==S.slides.length&&(S.activeIndex=S.slides.length-1),0>S.activeIndex&&(S.activeIndex=0),S.slides[S.activeIndex]){for(S.calcVisibleSlides(e),n=RegExp("\\s*"+t.slideActiveClass),a=RegExp("\\s*"+t.slideVisibleClass),i=0;i=S.slides.length-2*i&&(S.activeLoopIndex=S.slides.length-2*i-S.activeLoopIndex),0>S.activeLoopIndex&&(S.activeLoopIndex=S.slides.length-2*i+S.activeLoopIndex)):S.activeLoopIndex=S.activeIndex,t.pagination&&S.updatePagination(e)}}},S.createPagination=function(e){if(t.paginationClickable&&S.paginationButtons&&b(),S.paginationContainer=t.pagination.nodeType?t.pagination:i(t.pagination)[0],t.createPagination){var n="",a=S.slides.length;t.loop&&(a-=2*S.loopedSlides);for(var o=0;a>o;o++)n+="<"+t.paginationElement+' class="'+t.paginationElementClass+'">";S.paginationContainer.innerHTML=n}if(S.paginationButtons=i("."+t.paginationElementClass,S.paginationContainer),e||S.updatePagination(),S.callPlugins("onCreatePagination"),t.paginationClickable)for(e=S.paginationButtons,n=0;nS.slides.length)&&i("."+t.paginationActiveClass,S.paginationContainer)){var n=S.paginationButtons;if(0!=n.length){for(var a=0;as&&(s=S.slides.length-2*S.loopedSlides+s),t.loop&&s>=S.slides.length-2*S.loopedSlides&&(s=S.slides.length-2*S.loopedSlides-s,s=Math.abs(s)),e.push(s)}for(a=0;a=-e&&-e+P>=o&&(r=!0),-e>=n&&o>=-e+P&&(r=!0)):(o>-e&&-e+P>=o&&(r=!0),n>=-e&&-e+P>n&&(r=!0),-e>n&&o>-e+P&&(r=!0)),r&&i.push(S.slides[s])}0==i.length&&(i=[S.slides[S.activeIndex]]),S.visibleSlides=i};var N=void 0;S.startAutoplay=function(){return"undefined"!=typeof N?!1:void(t.autoplay&&(S.callPlugins("onAutoplayStart"),y()))},S.stopAutoplay=function(e){N&&clearTimeout(N),N=void 0,e&&!t.autoplayDisableOnInteraction&&S.wrapperTransitionEnd(function(){y()}),S.callPlugins("onAutoplayStop")},S.loopCreated=!1,S.removeLoopedSlides=function(){if(S.loopCreated)for(var e=0;eS.slides.length&&(S.loopedSlides=S.slides.length);var e,i="",n="",a="",o=S.slides.length,s=Math.floor(S.loopedSlides/o),r=S.loopedSlides%o;for(e=0;s*o>e;e++){var l=e;e>=o&&(l=e-o*Math.floor(e/o)),a+=S.slides[l].outerHTML}for(e=0;r>e;e++)n+=S.slides[e].outerHTML;for(e=o-r;o>e;e++)i+=S.slides[e].outerHTML;for(_.innerHTML=i+a+_.innerHTML+a+n,S.loopCreated=!0,S.calcSlides(),e=0;e=S.slides.length-S.loopedSlides)&&S.slides[e].setData("looped",!0);S.callPlugins("onCreateLoop")}},S.fixLoop=function(){var e;S.activeIndexS.slides.length-2*t.slidesPerView&&(e=-S.slides.length+S.activeIndex+S.loopedSlides,S.swipeTo(e,0,!1))},S.loadSlides=function(){var e="";S.activeLoaderIndex=0;for(var i=t.loader.slides,n=t.loader.loadAllSlides?i.length:t.slidesPerView*(1+t.loader.surroundGroups),a=0;n>a;a++)e="outer"==t.loader.slidesHTMLType?e+i[a]:e+("<"+t.slideElement+' class="'+t.slideClass+'" data-swiperindex="'+a+'">'+i[a]+"");S.wrapper.innerHTML=e,S.calcSlides(!0),t.loader.loadAllSlides||S.wrapperTransitionEnd(S.reloadSlides,!0)},S.reloadSlides=function(){var e=t.loader.slides,i=parseInt(S.activeSlide().data("swiperindex"),10);if(!(0>i||i>e.length-1)){S.activeLoaderIndex=i;var n=Math.max(0,i-t.slidesPerView*t.loader.surroundGroups),a=Math.min(i+t.slidesPerView*(1+t.loader.surroundGroups)-1,e.length-1); +if(i>0&&(S.setWrapperTranslate(-T*(i-n)),S.setWrapperTransition(0)),"reload"===t.loader.logic){for(var o=S.wrapper.innerHTML="",i=n;a>=i;i++)o+="outer"==t.loader.slidesHTMLType?e[i]:"<"+t.slideElement+' class="'+t.slideClass+'" data-swiperindex="'+i+'">'+e[i]+"";S.wrapper.innerHTML=o}else{for(var o=1e3,s=0,i=0;ir||r>a?S.wrapper.removeChild(S.slides[i]):(o=Math.min(r,o),s=Math.max(r,s))}for(i=n;a>=i;i++)o>i&&(n=document.createElement(t.slideElement),n.className=t.slideClass,n.setAttribute("data-swiperindex",i),n.innerHTML=e[i],S.wrapper.insertBefore(n,S.wrapper.firstChild)),i>s&&(n=document.createElement(t.slideElement),n.className=t.slideClass,n.setAttribute("data-swiperindex",i),n.innerHTML=e[i],S.wrapper.appendChild(n))}S.reInit(!0)}},S.calcSlides(),0e}(),ie10:window.navigator.msPointerEnabled}},(window.jQuery||window.Zepto)&&function(e){e.fn.swiper=function(t){return t=new Swiper(e(this)[0],t),e(this).data("swiper",t),t}}(window.jQuery||window.Zepto),"undefined"!=typeof module&&(module.exports=Swiper),!function(e){"function"==typeof define&&define.amd?define(["jquery"],e):"object"==typeof exports?module.exports=e:e(jQuery)}(function(e){function t(t){var s=t||window.event,r=l.call(arguments,1),c=0,h=0,u=0,p=0,f=0,g=0;if(t=e.event.fix(s),t.type="mousewheel","detail"in s&&(u=-1*s.detail),"wheelDelta"in s&&(u=s.wheelDelta),"wheelDeltaY"in s&&(u=s.wheelDeltaY),"wheelDeltaX"in s&&(h=-1*s.wheelDeltaX),"axis"in s&&s.axis===s.HORIZONTAL_AXIS&&(h=-1*u,u=0),c=0===u?h:u,"deltaY"in s&&(u=-1*s.deltaY,c=u),"deltaX"in s&&(h=s.deltaX,0===u&&(c=-1*h)),0!==u||0!==h){if(1===s.deltaMode){var m=e.data(this,"mousewheel-line-height");c*=m,u*=m,h*=m}else if(2===s.deltaMode){var v=e.data(this,"mousewheel-page-height");c*=v,u*=v,h*=v}if(p=Math.max(Math.abs(u),Math.abs(h)),(!o||o>p)&&(o=p,n(s,p)&&(o/=40)),n(s,p)&&(c/=40,h/=40,u/=40),c=Math[c>=1?"floor":"ceil"](c/o),h=Math[h>=1?"floor":"ceil"](h/o),u=Math[u>=1?"floor":"ceil"](u/o),d.settings.normalizeOffset&&this.getBoundingClientRect){var w=this.getBoundingClientRect();f=t.clientX-w.left,g=t.clientY-w.top}return t.deltaX=h,t.deltaY=u,t.deltaFactor=o,t.offsetX=f,t.offsetY=g,t.deltaMode=0,r.unshift(t,c,h,u),a&&clearTimeout(a),a=setTimeout(i,200),(e.event.dispatch||e.event.handle).apply(this,r)}}function i(){o=null}function n(e,t){return d.settings.adjustOldDeltas&&"mousewheel"===e.type&&t%120===0}var a,o,s=["wheel","mousewheel","DOMMouseScroll","MozMousePixelScroll"],r="onwheel"in document||document.documentMode>=9?["wheel"]:["mousewheel","DomMouseScroll","MozMousePixelScroll"],l=Array.prototype.slice;if(e.event.fixHooks)for(var c=s.length;c;)e.event.fixHooks[s[--c]]=e.event.mouseHooks;var d=e.event.special.mousewheel={version:"3.1.11",setup:function(){if(this.addEventListener)for(var i=r.length;i;)this.addEventListener(r[--i],t,!1);else this.onmousewheel=t;e.data(this,"mousewheel-line-height",d.getLineHeight(this)),e.data(this,"mousewheel-page-height",d.getPageHeight(this))},teardown:function(){if(this.removeEventListener)for(var i=r.length;i;)this.removeEventListener(r[--i],t,!1);else this.onmousewheel=null;e.removeData(this,"mousewheel-line-height"),e.removeData(this,"mousewheel-page-height")},getLineHeight:function(t){var i=e(t)["offsetParent"in e.fn?"offsetParent":"parent"]();return i.length||(i=e("body")),parseInt(i.css("fontSize"),10)},getPageHeight:function(t){return e(t).height()},settings:{adjustOldDeltas:!0,normalizeOffset:!0}};e.fn.extend({mousewheel:function(e){return e?this.bind("mousewheel",e):this.trigger("mousewheel")},unmousewheel:function(e){return this.unbind("mousewheel",e)}})}),function(e,t){!function(e){e(jQuery)}(function(i){var n="mCustomScrollbar",a="mCS",o=".mCustomScrollbar",s={setWidth:!1,setHeight:!1,setTop:0,setLeft:0,axis:"y",scrollbarPosition:"inside",scrollInertia:950,autoDraggerLength:!0,autoHideScrollbar:!1,autoExpandScrollbar:!1,alwaysShowScrollbar:0,snapAmount:null,snapOffset:0,mouseWheel:{enable:!0,scrollAmount:"auto",axis:"y",preventDefault:!1,deltaFactor:"auto",normalizeDelta:!1,invert:!1,disableOver:["select","option","keygen","datalist","textarea"]},scrollButtons:{enable:!1,scrollType:"stepless",scrollAmount:"auto"},keyboard:{enable:!0,scrollType:"stepless",scrollAmount:"auto"},contentTouchScroll:25,advanced:{autoExpandHorizontalScroll:!1,autoScrollOnFocus:"input,textarea,select,button,datalist,keygen,a[tabindex],area,object,[contenteditable='true']",updateOnContentResize:!0,updateOnImageLoad:!0,updateOnSelectorChange:!1},theme:"light",callbacks:{onScrollStart:!1,onScroll:!1,onTotalScroll:!1,onTotalScrollBack:!1,whileScrolling:!1,onTotalScrollOffset:0,onTotalScrollBackOffset:0,alwaysTriggerOffsets:!0,onOverflowY:!1,onOverflowX:!1,onOverflowYNone:!1,onOverflowXNone:!1},live:!1,liveSelector:null},r=0,l={},c=function(e){l[e]&&(clearTimeout(l[e]),p._delete.call(null,l[e]))},d=e.attachEvent&&!e.addEventListener?1:0,h=!1,u={init:function(e){var e=i.extend(!0,{},s,e),t=p._selector.call(this);if(e.live){var n=e.liveSelector||this.selector||o,d=i(n);if("off"===e.live)return void c(n);l[n]=setTimeout(function(){d.mCustomScrollbar(e),"once"===e.live&&d.length&&c(n)},500)}else c(n);return e.setWidth=e.set_width?e.set_width:e.setWidth,e.setHeight=e.set_height?e.set_height:e.setHeight,e.axis=e.horizontalScroll?"x":p._findAxis.call(null,e.axis),e.scrollInertia=e.scrollInertia>0&&e.scrollInertia<17?17:e.scrollInertia,"object"!=typeof e.mouseWheel&&1==e.mouseWheel&&(e.mouseWheel={enable:!0,scrollAmount:"auto",axis:"y",preventDefault:!1,deltaFactor:"auto",normalizeDelta:!1,invert:!1}),e.mouseWheel.scrollAmount=e.mouseWheelPixels?e.mouseWheelPixels:e.mouseWheel.scrollAmount,e.mouseWheel.normalizeDelta=e.advanced.normalizeMouseWheelDelta?e.advanced.normalizeMouseWheelDelta:e.mouseWheel.normalizeDelta,e.scrollButtons.scrollType=p._findScrollButtonsType.call(null,e.scrollButtons.scrollType),p._theme.call(null,e),i(t).each(function(){var t=i(this);if(!t.data(a)){t.data(a,{idx:++r,opt:e,scrollRatio:{y:null,x:null},overflowed:null,contentReset:{y:null,x:null},bindEvents:!1,tweenRunning:!1,sequential:{},langDir:t.css("direction"),cbOffsets:null,trigger:null});var n=t.data(a).opt,o=t.data("mcs-axis"),s=t.data("mcs-scrollbar-position"),l=t.data("mcs-theme");o&&(n.axis=o),s&&(n.scrollbarPosition=s),l&&(n.theme=l,p._theme.call(null,n)),p._pluginMarkup.call(this),u.update.call(null,t)}})},update:function(e){var t=e||p._selector.call(this);return i(t).each(function(){var e=i(this);if(e.data(a)){var t=e.data(a),n=t.opt,o=i("#mCSB_"+t.idx+"_container"),s=[i("#mCSB_"+t.idx+"_dragger_vertical"),i("#mCSB_"+t.idx+"_dragger_horizontal")];if(!o.length)return;t.tweenRunning&&p._stop.call(null,e),e.hasClass("mCS_disabled")&&e.removeClass("mCS_disabled"),e.hasClass("mCS_destroyed")&&e.removeClass("mCS_destroyed"),p._maxHeight.call(this),p._expandContentHorizontally.call(this),"y"===n.axis||n.advanced.autoExpandHorizontalScroll||o.css("width",p._contentWidth(o.children())),t.overflowed=p._overflowed.call(this),p._scrollbarVisibility.call(this),n.autoDraggerLength&&p._setDraggerLength.call(this),p._scrollRatio.call(this),p._bindEvents.call(this);var r=[Math.abs(o[0].offsetTop),Math.abs(o[0].offsetLeft)];"x"!==n.axis&&(t.overflowed[0]?s[0].height()>s[0].parent().height()?p._resetContentPosition.call(this):(p._scrollTo.call(this,e,r[0].toString(),{dir:"y",dur:0,overwrite:"none"}),t.contentReset.y=null):(p._resetContentPosition.call(this),"y"===n.axis?p._unbindEvents.call(this):"yx"===n.axis&&t.overflowed[1]&&p._scrollTo.call(this,e,r[1].toString(),{dir:"x",dur:0,overwrite:"none"}))),"y"!==n.axis&&(t.overflowed[1]?s[1].width()>s[1].parent().width()?p._resetContentPosition.call(this):(p._scrollTo.call(this,e,r[1].toString(),{dir:"x",dur:0,overwrite:"none"}),t.contentReset.x=null):(p._resetContentPosition.call(this),"x"===n.axis?p._unbindEvents.call(this):"yx"===n.axis&&t.overflowed[0]&&p._scrollTo.call(this,e,r[0].toString(),{dir:"y",dur:0,overwrite:"none"}))),p._autoUpdate.call(this)}})},scrollTo:function(e,t){if("undefined"!=typeof e&&null!=e){var n=p._selector.call(this);return i(n).each(function(){var n=i(this);if(n.data(a)){var o=n.data(a),s=o.opt,r={trigger:"external",scrollInertia:s.scrollInertia,scrollEasing:"mcsEaseInOut",moveDragger:!1,timeout:60,callbacks:!0,onStart:!0,onUpdate:!0,onComplete:!0},l=i.extend(!0,{},r,t),c=p._arr.call(this,e),d=l.scrollInertia>0&&l.scrollInertia<17?17:l.scrollInertia;c[0]=p._to.call(this,c[0],"y"),c[1]=p._to.call(this,c[1],"x"),l.moveDragger&&(c[0]*=o.scrollRatio.y,c[1]*=o.scrollRatio.x),l.dur=d,setTimeout(function(){null!==c[0]&&"undefined"!=typeof c[0]&&"x"!==s.axis&&o.overflowed[0]&&(l.dir="y",l.overwrite="all",p._scrollTo.call(this,n,c[0].toString(),l)),null!==c[1]&&"undefined"!=typeof c[1]&&"y"!==s.axis&&o.overflowed[1]&&(l.dir="x",l.overwrite="none",p._scrollTo.call(this,n,c[1].toString(),l))},l.timeout)}})}},stop:function(){var e=p._selector.call(this);return i(e).each(function(){var e=i(this);e.data(a)&&p._stop.call(null,e)})},disable:function(e){var t=p._selector.call(this);return i(t).each(function(){var t=i(this);if(t.data(a)){{var n=t.data(a);n.opt}p._autoUpdate.call(this,"remove"),p._unbindEvents.call(this),e&&p._resetContentPosition.call(this),p._scrollbarVisibility.call(this,!0),t.addClass("mCS_disabled")}})},destroy:function(){var e=p._selector.call(this);return i(e).each(function(){var t=i(this);if(t.data(a)){var o=t.data(a),s=o.opt,r=i("#mCSB_"+o.idx),l=i("#mCSB_"+o.idx+"_container"),d=i(".mCSB_"+o.idx+"_scrollbar");s.live&&c(e),p._autoUpdate.call(this,"remove"),p._unbindEvents.call(this),p._resetContentPosition.call(this),t.removeData(a),p._delete.call(null,this.mcs),d.remove(),r.replaceWith(l.contents()),t.removeClass(n+" _"+a+"_"+o.idx+" mCS-autoHide mCS-dir-rtl mCS_no_scrollbar mCS_disabled").addClass("mCS_destroyed")}})}},p={_selector:function(){return"object"!=typeof i(this)||i(this).length<1?o:this},_theme:function(e){var t=["rounded","rounded-dark","rounded-dots","rounded-dots-dark"],n=["rounded-dots","rounded-dots-dark","3d","3d-dark","3d-thick","3d-thick-dark","inset","inset-dark","inset-2","inset-2-dark","inset-3","inset-3-dark"],a=["minimal","minimal-dark"],o=["minimal","minimal-dark"],s=["minimal","minimal-dark"];e.autoDraggerLength=i.inArray(e.theme,t)>-1?!1:e.autoDraggerLength,e.autoExpandScrollbar=i.inArray(e.theme,n)>-1?!1:e.autoExpandScrollbar,e.scrollButtons.enable=i.inArray(e.theme,a)>-1?!1:e.scrollButtons.enable,e.autoHideScrollbar=i.inArray(e.theme,o)>-1?!0:e.autoHideScrollbar,e.scrollbarPosition=i.inArray(e.theme,s)>-1?"outside":e.scrollbarPosition},_findAxis:function(e){return"yx"===e||"xy"===e||"auto"===e?"yx":"x"===e||"horizontal"===e?"x":"y"},_findScrollButtonsType:function(e){return"stepped"===e||"pixels"===e||"step"===e||"click"===e?"stepped":"stepless"},_pluginMarkup:function(){var e=i(this),t=e.data(a),o=t.opt,s=o.autoExpandScrollbar?" mCSB_scrollTools_onDrag_expand":"",r=["
        ","
        "],l="yx"===o.axis?"mCSB_vertical_horizontal":"x"===o.axis?"mCSB_horizontal":"mCSB_vertical",c="yx"===o.axis?r[0]+r[1]:"x"===o.axis?r[1]:r[0],d="yx"===o.axis?"
        ":"",h=o.autoHideScrollbar?" mCS-autoHide":"",u="x"!==o.axis&&"rtl"===t.langDir?" mCS-dir-rtl":"";o.setWidth&&e.css("width",o.setWidth),o.setHeight&&e.css("height",o.setHeight),o.setLeft="y"!==o.axis&&"rtl"===t.langDir?"989999px":o.setLeft,e.addClass(n+" _"+a+"_"+t.idx+h+u).wrapInner("
        ");var f=i("#mCSB_"+t.idx),g=i("#mCSB_"+t.idx+"_container");"y"===o.axis||o.advanced.autoExpandHorizontalScroll||g.css("width",p._contentWidth(g.children())),"outside"===o.scrollbarPosition?("static"===e.css("position")&&e.css("position","relative"),e.css("overflow","visible"),f.addClass("mCSB_outside").after(c)):(f.addClass("mCSB_inside").append(c),g.wrap(d)),p._scrollButtons.call(this);var m=[i("#mCSB_"+t.idx+"_dragger_vertical"),i("#mCSB_"+t.idx+"_dragger_horizontal")];m[0].css("min-height",m[0].height()),m[1].css("min-width",m[1].width())},_contentWidth:function(e){return Math.max.apply(Math,e.map(function(){return i(this).outerWidth(!0)}).get())},_expandContentHorizontally:function(){var e=i(this),t=e.data(a),n=t.opt,o=i("#mCSB_"+t.idx+"_container");n.advanced.autoExpandHorizontalScroll&&"y"!==n.axis&&o.css({position:"absolute",width:"auto"}).wrap("
        ").css({width:Math.ceil(o[0].getBoundingClientRect().right+.4)-Math.floor(o[0].getBoundingClientRect().left),position:"relative"}).unwrap()},_scrollButtons:function(){var e=i(this),t=e.data(a),n=t.opt,o=i(".mCSB_"+t.idx+"_scrollbar:first"),s=["","","",""],r=["x"===n.axis?s[2]:s[0],"x"===n.axis?s[3]:s[1],s[2],s[3]];n.scrollButtons.enable&&o.prepend(r[0]).append(r[1]).next(".mCSB_scrollTools").prepend(r[2]).append(r[3])},_maxHeight:function(){var e=i(this),t=e.data(a),n=(t.opt,i("#mCSB_"+t.idx)),o=e.css("max-height"),s=-1!==o.indexOf("%"),r=e.css("box-sizing");if("none"!==o){var l=s?e.parent().height()*parseInt(o)/100:parseInt(o);"border-box"===r&&(l-=e.innerHeight()-e.height()+(e.outerHeight()-e.innerHeight())),n.css("max-height",Math.round(l))}},_setDraggerLength:function(){var e=i(this),t=e.data(a),n=i("#mCSB_"+t.idx),o=i("#mCSB_"+t.idx+"_container"),s=[i("#mCSB_"+t.idx+"_dragger_vertical"),i("#mCSB_"+t.idx+"_dragger_horizontal")],r=[n.height()/o.outerHeight(!1),n.width()/o.outerWidth(!1)],l=[parseInt(s[0].css("min-height")),Math.round(r[0]*s[0].parent().height()),parseInt(s[1].css("min-width")),Math.round(r[1]*s[1].parent().width())],c=d&&l[1]n.height(),r>n.width()]},_resetContentPosition:function(){var e=i(this),t=e.data(a),n=t.opt,o=i("#mCSB_"+t.idx),s=i("#mCSB_"+t.idx+"_container"),r=[i("#mCSB_"+t.idx+"_dragger_vertical"),i("#mCSB_"+t.idx+"_dragger_horizontal")];if(p._stop(e),("x"!==n.axis&&!t.overflowed[0]||"y"===n.axis&&t.overflowed[0])&&(r[0].add(s).css("top",0),p._scrollTo(e,"_resetY")),"y"!==n.axis&&!t.overflowed[1]||"x"===n.axis&&t.overflowed[1]){var l=dx=0;"rtl"===t.langDir&&(l=o.width()-s.outerWidth(!1),dx=Math.abs(l/t.scrollRatio.x)),s.css("left",l),r[1].css("left",dx),p._scrollTo(e,"_resetX")}},_bindEvents:function(){function e(){s=setTimeout(function(){i.event.special.mousewheel?(clearTimeout(s),p._mousewheel.call(t[0])):e()},1e3)}var t=i(this),n=t.data(a),o=n.opt;if(!n.bindEvents){if(p._draggable.call(this),o.contentTouchScroll&&p._contentDraggable.call(this),o.mouseWheel.enable){var s;e()}p._draggerRail.call(this),p._wrapperScroll.call(this),o.advanced.autoScrollOnFocus&&p._focus.call(this),o.scrollButtons.enable&&p._buttons.call(this),o.keyboard.enable&&p._keyboard.call(this),n.bindEvents=!0}},_unbindEvents:function(){var e=i(this),n=e.data(a),o=a+"_"+n.idx,s=".mCSB_"+n.idx+"_scrollbar",r=i("#mCSB_"+n.idx+",#mCSB_"+n.idx+"_container,#mCSB_"+n.idx+"_container_wrapper,"+s+" .mCSB_draggerContainer,#mCSB_"+n.idx+"_dragger_vertical,#mCSB_"+n.idx+"_dragger_horizontal,"+s+">a"),l=i("#mCSB_"+n.idx+"_container");n.bindEvents&&(i(t).unbind("."+o),r.each(function(){i(this).unbind("."+o)}),clearTimeout(e[0]._focusTimeout),p._delete.call(null,e[0]._focusTimeout),clearTimeout(n.sequential.step),p._delete.call(null,n.sequential.step),clearTimeout(l[0].onCompleteTimeout),p._delete.call(null,l[0].onCompleteTimeout),n.bindEvents=!1)},_scrollbarVisibility:function(e){var t=i(this),n=t.data(a),o=n.opt,s=i("#mCSB_"+n.idx+"_container_wrapper"),r=s.length?s:i("#mCSB_"+n.idx+"_container"),l=[i("#mCSB_"+n.idx+"_scrollbar_vertical"),i("#mCSB_"+n.idx+"_scrollbar_horizontal")],c=[l[0].find(".mCSB_dragger"),l[1].find(".mCSB_dragger")];"x"!==o.axis&&(n.overflowed[0]&&!e?(l[0].add(c[0]).add(l[0].children("a")).css("display","block"),r.removeClass("mCS_no_scrollbar_y mCS_y_hidden")):(o.alwaysShowScrollbar?(2!==o.alwaysShowScrollbar&&c[0].add(l[0].children("a")).css("display","none"),r.removeClass("mCS_y_hidden")):(l[0].css("display","none"),r.addClass("mCS_y_hidden")),r.addClass("mCS_no_scrollbar_y"))),"y"!==o.axis&&(n.overflowed[1]&&!e?(l[1].add(c[1]).add(l[1].children("a")).css("display","block"),r.removeClass("mCS_no_scrollbar_x mCS_x_hidden")):(o.alwaysShowScrollbar?(2!==o.alwaysShowScrollbar&&c[1].add(l[1].children("a")).css("display","none"),r.removeClass("mCS_x_hidden")):(l[1].css("display","none"),r.addClass("mCS_x_hidden")),r.addClass("mCS_no_scrollbar_x"))),n.overflowed[0]||n.overflowed[1]?t.removeClass("mCS_no_scrollbar"):t.addClass("mCS_no_scrollbar")},_coordinates:function(e){var t=e.type;switch(t){case"pointerdown":case"MSPointerDown":case"pointermove":case"MSPointerMove":case"pointerup":case"MSPointerUp":return[e.originalEvent.pageY,e.originalEvent.pageX];case"touchstart":case"touchmove":case"touchend":var i=e.originalEvent.touches[0]||e.originalEvent.changedTouches[0];return[i.pageY,i.pageX];default:return[e.pageY,e.pageX]}},_draggable:function(){function e(e){var t=m.find("iframe");if(t.length){var i=e?"auto":"none";t.css("pointer-events",i)}}function n(e,t,i,n){if(m[0].idleTimer=u.scrollInertia<233?250:0,o.attr("id")===g[1])var a="x",s=(o[0].offsetLeft-t+n)*c.scrollRatio.x;else var a="y",s=(o[0].offsetTop-e+i)*c.scrollRatio.y;p._scrollTo(l,s.toString(),{dir:a,drag:!0})}var o,s,r,l=i(this),c=l.data(a),u=c.opt,f=a+"_"+c.idx,g=["mCSB_"+c.idx+"_dragger_vertical","mCSB_"+c.idx+"_dragger_horizontal"],m=i("#mCSB_"+c.idx+"_container"),v=i("#"+g[0]+",#"+g[1]);v.bind("mousedown."+f+" touchstart."+f+" pointerdown."+f+" MSPointerDown."+f,function(n){if(n.stopImmediatePropagation(),n.preventDefault(),p._mouseBtnLeft(n)){h=!0,d&&(t.onselectstart=function(){return!1}),e(!1),p._stop(l),o=i(this);var a=o.offset(),c=p._coordinates(n)[0]-a.top,f=p._coordinates(n)[1]-a.left,g=o.height()+a.top,m=o.width()+a.left;g>c&&c>0&&m>f&&f>0&&(s=c,r=f),p._onDragClasses(o,"active",u.autoExpandScrollbar)}}).bind("touchmove."+f,function(e){e.stopImmediatePropagation(),e.preventDefault();var t=o.offset(),i=p._coordinates(e)[0]-t.top,a=p._coordinates(e)[1]-t.left;n(s,r,i,a)}),i(t).bind("mousemove."+f+" pointermove."+f+" MSPointerMove."+f,function(e){if(o){var t=o.offset(),i=p._coordinates(e)[0]-t.top,a=p._coordinates(e)[1]-t.left;if(s===i)return;n(s,r,i,a)}}).add(v).bind("mouseup."+f+" touchend."+f+" pointerup."+f+" MSPointerUp."+f,function(){o&&(p._onDragClasses(o,"active",u.autoExpandScrollbar),o=null),h=!1,d&&(t.onselectstart=null),e(!0)})},_contentDraggable:function(){function e(e,t){var i=[1.5*t,2*t,t/1.5,t/2];return e>90?t>4?i[0]:i[3]:e>60?t>3?i[3]:i[2]:e>30?t>8?i[1]:t>6?i[0]:t>4?t:i[2]:t>8?t:i[3]}function t(e,t,i,n,a,o){e&&p._scrollTo(v,e.toString(),{dur:t,scrollEasing:i,dir:n,overwrite:a,drag:o})}var n,o,s,r,l,c,d,u,f,g,m,v=i(this),w=v.data(a),b=w.opt,x=a+"_"+w.idx,y=i("#mCSB_"+w.idx),C=i("#mCSB_"+w.idx+"_container"),S=[i("#mCSB_"+w.idx+"_dragger_vertical"),i("#mCSB_"+w.idx+"_dragger_horizontal")],_=[],T=[],k=0,E="yx"===b.axis?"none":"all";C.bind("touchstart."+x+" pointerdown."+x+" MSPointerDown."+x,function(e){if(p._pointerTouch(e)&&!h){var t=C.offset();n=p._coordinates(e)[0]-t.top,o=p._coordinates(e)[1]-t.left}}).bind("touchmove."+x+" pointermove."+x+" MSPointerMove."+x,function(e){if(p._pointerTouch(e)&&!h){e.stopImmediatePropagation(),c=p._getTime();var i=y.offset(),a=p._coordinates(e)[0]-i.top,s=p._coordinates(e)[1]-i.left,r="mcsLinearOut";if(_.push(a),T.push(s),w.overflowed[0])var l=S[0].parent().height()-S[0].height(),d=n-a>0&&a-n>-(l*w.scrollRatio.y);if(w.overflowed[1])var u=S[1].parent().width()-S[1].width(),f=o-s>0&&s-o>-(u*w.scrollRatio.x);(d||f)&&e.preventDefault(),g="yx"===b.axis?[n-a,o-s]:"x"===b.axis?[null,o-s]:[n-a,null],C[0].idleTimer=250,w.overflowed[0]&&t(g[0],k,r,"y","all",!0),w.overflowed[1]&&t(g[1],k,r,"x",E,!0)}}),y.bind("touchstart."+x+" pointerdown."+x+" MSPointerDown."+x,function(e){if(p._pointerTouch(e)&&!h){e.stopImmediatePropagation(),p._stop(v),l=p._getTime();var t=y.offset();s=p._coordinates(e)[0]-t.top,r=p._coordinates(e)[1]-t.left,_=[],T=[]}}).bind("touchend."+x+" pointerup."+x+" MSPointerUp."+x,function(i){if(p._pointerTouch(i)&&!h){i.stopImmediatePropagation(),d=p._getTime();var n=y.offset(),a=p._coordinates(i)[0]-n.top,o=p._coordinates(i)[1]-n.left;if(!(d-c>30)){f=1e3/(d-l);var v="mcsEaseOut",x=2.5>f,S=x?[_[_.length-2],T[T.length-2]]:[0,0];u=x?[a-S[0],o-S[1]]:[a-s,o-r];var k=[Math.abs(u[0]),Math.abs(u[1])];f=x?[Math.abs(u[0]/4),Math.abs(u[1]/4)]:[f,f];var M=[Math.abs(C[0].offsetTop)-u[0]*e(k[0]/f[0],f[0]),Math.abs(C[0].offsetLeft)-u[1]*e(k[1]/f[1],f[1])];g="yx"===b.axis?[M[0],M[1]]:"x"===b.axis?[null,M[1]]:[M[0],null],m=[4*k[0]+b.scrollInertia,4*k[1]+b.scrollInertia];var P=parseInt(b.contentTouchScroll)||0;g[0]=k[0]>P?g[0]:0,g[1]=k[1]>P?g[1]:0,w.overflowed[0]&&t(g[0],m[0],v,"y",E,!1),w.overflowed[1]&&t(g[1],m[1],v,"x",E,!1)}}})},_mousewheel:function(){function e(e){var t=null;try{var i=e.contentDocument||e.contentWindow.document;t=i.body.innerHTML}catch(n){}return null!==t}var t=i(this),n=t.data(a);if(n){var o=n.opt,s=a+"_"+n.idx,r=i("#mCSB_"+n.idx),l=[i("#mCSB_"+n.idx+"_dragger_vertical"),i("#mCSB_"+n.idx+"_dragger_horizontal")],c=i("#mCSB_"+n.idx+"_container").find("iframe"),h=r;c.length&&c.each(function(){var t=this;e(t)&&(h=h.add(i(t).contents().find("body")))}),h.bind("mousewheel."+s,function(e,a){if(p._stop(t),!p._disableMousewheel(t,e.target)){var s="auto"!==o.mouseWheel.deltaFactor?parseInt(o.mouseWheel.deltaFactor):d&&e.deltaFactor<100?100:e.deltaFactor||100;if("x"===o.axis||"x"===o.mouseWheel.axis)var c="x",h=[Math.round(s*n.scrollRatio.x),parseInt(o.mouseWheel.scrollAmount)],u="auto"!==o.mouseWheel.scrollAmount?h[1]:h[0]>=r.width()?.9*r.width():h[0],f=Math.abs(i("#mCSB_"+n.idx+"_container")[0].offsetLeft),g=l[1][0].offsetLeft,m=l[1].parent().width()-l[1].width(),v=e.deltaX||e.deltaY||a;else var c="y",h=[Math.round(s*n.scrollRatio.y),parseInt(o.mouseWheel.scrollAmount)],u="auto"!==o.mouseWheel.scrollAmount?h[1]:h[0]>=r.height()?.9*r.height():h[0],f=Math.abs(i("#mCSB_"+n.idx+"_container")[0].offsetTop),g=l[0][0].offsetTop,m=l[0].parent().height()-l[0].height(),v=e.deltaY||a;"y"===c&&!n.overflowed[0]||"x"===c&&!n.overflowed[1]||(o.mouseWheel.invert&&(v=-v),o.mouseWheel.normalizeDelta&&(v=0>v?-1:1),(v>0&&0!==g||0>v&&g!==m||o.mouseWheel.preventDefault)&&(e.stopImmediatePropagation(),e.preventDefault()),p._scrollTo(t,(f-v*u).toString(),{dir:c}))}})}},_disableMousewheel:function(e,t){var n=t.nodeName.toLowerCase(),o=e.data(a).opt.mouseWheel.disableOver,s=["select","textarea"];return i.inArray(n,o)>-1&&!(i.inArray(n,s)>-1&&!i(t).is(":focus"))},_draggerRail:function(){var e=i(this),t=e.data(a),n=a+"_"+t.idx,o=i("#mCSB_"+t.idx+"_container"),s=o.parent(),r=i(".mCSB_"+t.idx+"_scrollbar .mCSB_draggerContainer");r.bind("touchstart."+n+" pointerdown."+n+" MSPointerDown."+n,function(){h=!0}).bind("touchend."+n+" pointerup."+n+" MSPointerUp."+n,function(){h=!1}).bind("click."+n,function(n){if(i(n.target).hasClass("mCSB_draggerContainer")||i(n.target).hasClass("mCSB_draggerRail")){p._stop(e);var a=i(this),r=a.find(".mCSB_dragger");if(a.parent(".mCSB_scrollTools_horizontal").length>0){if(!t.overflowed[1])return;var l="x",c=n.pageX>r.offset().left?-1:1,d=Math.abs(o[0].offsetLeft)-.9*c*s.width()}else{if(!t.overflowed[0])return;var l="y",c=n.pageY>r.offset().top?-1:1,d=Math.abs(o[0].offsetTop)-.9*c*s.height() +}p._scrollTo(e,d.toString(),{dir:l,scrollEasing:"mcsEaseInOut"})}})},_focus:function(){var e=i(this),n=e.data(a),o=n.opt,s=a+"_"+n.idx,r=i("#mCSB_"+n.idx+"_container"),l=r.parent();r.bind("focusin."+s,function(){var n=i(t.activeElement),a=r.find(".mCustomScrollBox").length,s=0;n.is(o.advanced.autoScrollOnFocus)&&(p._stop(e),clearTimeout(e[0]._focusTimeout),e[0]._focusTimer=a?(s+17)*a:0,e[0]._focusTimeout=setTimeout(function(){var t=[n.offset().top-r.offset().top,n.offset().left-r.offset().left],i=[r[0].offsetTop,r[0].offsetLeft],a=[i[0]+t[0]>=0&&i[0]+t[0]=0&&i[0]+t[1]a");l.bind("mousedown."+s+" touchstart."+s+" pointerdown."+s+" MSPointerDown."+s+" mouseup."+s+" touchend."+s+" pointerup."+s+" MSPointerUp."+s+" mouseout."+s+" pointerout."+s+" MSPointerOut."+s+" click."+s,function(a){function s(t,i){o.scrollAmount=n.snapAmount||n.scrollButtons.scrollAmount,p._sequentialScroll.call(this,e,t,i)}if(a.preventDefault(),p._mouseBtnLeft(a)){var r=i(this).attr("class");switch(o.type=n.scrollButtons.scrollType,a.type){case"mousedown":case"touchstart":case"pointerdown":case"MSPointerDown":if("stepped"===o.type)return;h=!0,t.tweenRunning=!1,s("on",r);break;case"mouseup":case"touchend":case"pointerup":case"MSPointerUp":case"mouseout":case"pointerout":case"MSPointerOut":if("stepped"===o.type)return;h=!1,o.dir&&s("off",r);break;case"click":if("stepped"!==o.type||t.tweenRunning)return;s("on",r)}}})},_keyboard:function(){var e=i(this),n=e.data(a),o=n.opt,s=n.sequential,r=a+"_"+n.idx,l=i("#mCSB_"+n.idx),c=i("#mCSB_"+n.idx+"_container"),d=c.parent(),h="input,textarea,select,datalist,keygen,[contenteditable='true']";l.attr("tabindex","0").bind("blur."+r+" keydown."+r+" keyup."+r,function(a){function r(t,i){s.type=o.keyboard.scrollType,s.scrollAmount=o.snapAmount||o.keyboard.scrollAmount,"stepped"===s.type&&n.tweenRunning||p._sequentialScroll.call(this,e,t,i)}switch(a.type){case"blur":n.tweenRunning&&s.dir&&r("off",null);break;case"keydown":case"keyup":var l=a.keyCode?a.keyCode:a.which,u="on";if("x"!==o.axis&&(38===l||40===l)||"y"!==o.axis&&(37===l||39===l)){if((38===l||40===l)&&!n.overflowed[0]||(37===l||39===l)&&!n.overflowed[1])return;"keyup"===a.type&&(u="off"),i(t.activeElement).is(h)||(a.preventDefault(),a.stopImmediatePropagation(),r(u,l))}else if(33===l||34===l){if((n.overflowed[0]||n.overflowed[1])&&(a.preventDefault(),a.stopImmediatePropagation()),"keyup"===a.type){p._stop(e);var f=34===l?-1:1;if("x"===o.axis||"yx"===o.axis&&n.overflowed[1]&&!n.overflowed[0])var g="x",m=Math.abs(c[0].offsetLeft)-.9*f*d.width();else var g="y",m=Math.abs(c[0].offsetTop)-.9*f*d.height();p._scrollTo(e,m.toString(),{dir:g,scrollEasing:"mcsEaseInOut"})}}else if((35===l||36===l)&&!i(t.activeElement).is(h)&&((n.overflowed[0]||n.overflowed[1])&&(a.preventDefault(),a.stopImmediatePropagation()),"keyup"===a.type)){if("x"===o.axis||"yx"===o.axis&&n.overflowed[1]&&!n.overflowed[0])var g="x",m=35===l?Math.abs(d.width()-c.outerWidth(!1)):0;else var g="y",m=35===l?Math.abs(d.height()-c.outerHeight(!1)):0;p._scrollTo(e,m.toString(),{dir:g,scrollEasing:"mcsEaseInOut"})}}})},_sequentialScroll:function(e,t,n){function o(t){var i="stepped"!==c.type,n=t?i?l.scrollInertia/1.5:l.scrollInertia:1e3/60,a=t?i?7.5:40:2.5,s=[Math.abs(d[0].offsetTop),Math.abs(d[0].offsetLeft)],h=[r.scrollRatio.y>10?10:r.scrollRatio.y,r.scrollRatio.x>10?10:r.scrollRatio.x],u="x"===c.dir[0]?s[1]+c.dir[1]*h[1]*a:s[0]+c.dir[1]*h[0]*a,f="x"===c.dir[0]?s[1]+c.dir[1]*parseInt(c.scrollAmount):s[0]+c.dir[1]*parseInt(c.scrollAmount),g="auto"!==c.scrollAmount?f:u,m=t?i?"mcsLinearOut":"mcsEaseInOut":"mcsLinear",v=t?!0:!1;return t&&17>n&&(g="x"===c.dir[0]?s[1]:s[0]),p._scrollTo(e,g.toString(),{dir:c.dir[0],scrollEasing:m,dur:n,onComplete:v}),t?void(c.dir=!1):(clearTimeout(c.step),void(c.step=setTimeout(function(){o()},n)))}function s(){clearTimeout(c.step),p._stop(e)}var r=e.data(a),l=r.opt,c=r.sequential,d=i("#mCSB_"+r.idx+"_container"),h="stepped"===c.type?!0:!1;switch(t){case"on":if(c.dir=["mCSB_buttonRight"===n||"mCSB_buttonLeft"===n||39===n||37===n?"x":"y","mCSB_buttonUp"===n||"mCSB_buttonLeft"===n||38===n||37===n?-1:1],p._stop(e),p._isNumeric(n)&&"stepped"===c.type)return;o(h);break;case"off":s(),(h||r.tweenRunning&&c.dir)&&o(!0)}},_arr:function(e){var t=i(this).data(a).opt,n=[];return"function"==typeof e&&(e=e()),e instanceof Array?n=e.length>1?[e[0],e[1]]:"x"===t.axis?[null,e[0]]:[e[0],null]:(n[0]=e.y?e.y:e.x||"x"===t.axis?null:e,n[1]=e.x?e.x:e.y||"y"===t.axis?null:e),"function"==typeof n[0]&&(n[0]=n[0]()),"function"==typeof n[1]&&(n[1]=n[1]()),n},_to:function(e,t){if(null!=e&&"undefined"!=typeof e){var n=i(this),o=n.data(a),s=o.opt,r=i("#mCSB_"+o.idx+"_container"),l=r.parent(),c=typeof e;t||(t="x"===s.axis?"x":"y");var d="x"===t?r.outerWidth(!1):r.outerHeight(!1),h="x"===t?r.offset().left:r.offset().top,f="x"===t?r[0].offsetLeft:r[0].offsetTop,g="x"===t?"left":"top";switch(c){case"function":return e();case"object":if(e.nodeType)var m="x"===t?i(e).offset().left:i(e).offset().top;else if(e.jquery){if(!e.length)return;var m="x"===t?e.offset().left:e.offset().top}return m-h;case"string":case"number":if(p._isNumeric.call(null,e))return Math.abs(e);if(-1!==e.indexOf("%"))return Math.abs(d*parseInt(e)/100);if(-1!==e.indexOf("-="))return Math.abs(f-parseInt(e.split("-=")[1]));if(-1!==e.indexOf("+=")){var v=f+parseInt(e.split("+=")[1]);return v>=0?0:Math.abs(v)}if(-1!==e.indexOf("px")&&p._isNumeric.call(null,e.split("px")[0]))return Math.abs(e.split("px")[0]);if("top"===e||"left"===e)return 0;if("bottom"===e)return Math.abs(l.height()-r.outerHeight(!1));if("right"===e)return Math.abs(l.width()-r.outerWidth(!1));if("first"===e||"last"===e){var w=r.find(":"+e),m="x"===t?i(w).offset().left:i(w).offset().top;return m-h}if(i(e).length){var m="x"===t?i(e).offset().left:i(e).offset().top;return m-h}return r.css(g,e),void u.update.call(null,n[0])}}},_autoUpdate:function(e){function t(){clearTimeout(h[0].autoUpdate),h[0].autoUpdate=setTimeout(function(){return d.advanced.updateOnSelectorChange&&(f=s(),f!==x)?(r(),void(x=f)):(d.advanced.updateOnContentResize&&(g=[h.outerHeight(!1),h.outerWidth(!1),v.height(),v.width(),b()[0],b()[1]],(g[0]!==y[0]||g[1]!==y[1]||g[2]!==y[2]||g[3]!==y[3]||g[4]!==y[4]||g[5]!==y[5])&&(r(),y=g)),d.advanced.updateOnImageLoad&&(m=n(),m!==C&&(h.find("img").each(function(){o(this.src)}),C=m)),void((d.advanced.updateOnSelectorChange||d.advanced.updateOnContentResize||d.advanced.updateOnImageLoad)&&t()))},60)}function n(){var e=0;return d.advanced.updateOnImageLoad&&(e=h.find("img").length),e}function o(e){function t(e,t){return function(){return t.apply(e,arguments)}}function i(){this.onload=null,r()}var n=new Image;n.onload=t(n,i),n.src=e}function s(){d.advanced.updateOnSelectorChange===!0&&(d.advanced.updateOnSelectorChange="*");var e=0,t=h.find(d.advanced.updateOnSelectorChange);return d.advanced.updateOnSelectorChange&&t.length>0&&t.each(function(){e+=i(this).height()+i(this).width()}),e}function r(){clearTimeout(h[0].autoUpdate),u.update.call(null,l[0])}var l=i(this),c=l.data(a),d=c.opt,h=i("#mCSB_"+c.idx+"_container");if(e)return clearTimeout(h[0].autoUpdate),void p._delete.call(null,h[0].autoUpdate);var f,g,m,v=h.parent(),w=[i("#mCSB_"+c.idx+"_scrollbar_vertical"),i("#mCSB_"+c.idx+"_scrollbar_horizontal")],b=function(){return[w[0].is(":visible")?w[0].outerHeight(!0):0,w[1].is(":visible")?w[1].outerWidth(!0):0]},x=s(),y=[h.outerHeight(!1),h.outerWidth(!1),v.height(),v.width(),b()[0],b()[1]],C=n();t()},_snapAmount:function(e,t,i){return Math.round(e/t)*t-i},_stop:function(e){var t=e.data(a),n=i("#mCSB_"+t.idx+"_container,#mCSB_"+t.idx+"_container_wrapper,#mCSB_"+t.idx+"_dragger_vertical,#mCSB_"+t.idx+"_dragger_horizontal");n.each(function(){p._stopTween.call(this)})},_scrollTo:function(e,t,n){function o(e){return l&&c.callbacks[e]&&"function"==typeof c.callbacks[e]}function s(){return[c.callbacks.alwaysTriggerOffsets||b>=x[0]+C,c.callbacks.alwaysTriggerOffsets||-S>=b]}function r(){var t=[f[0].offsetTop,f[0].offsetLeft],i=[v[0].offsetTop,v[0].offsetLeft],a=[f.outerHeight(!1),f.outerWidth(!1)],o=[u.height(),u.width()];e[0].mcs={content:f,top:t[0],left:t[1],draggerTop:i[0],draggerLeft:i[1],topPct:Math.round(100*Math.abs(t[0])/(Math.abs(a[0])-o[0])),leftPct:Math.round(100*Math.abs(t[1])/(Math.abs(a[1])-o[1])),direction:n.dir}}var l=e.data(a),c=l.opt,d={trigger:"internal",dir:"y",scrollEasing:"mcsEaseOut",drag:!1,dur:c.scrollInertia,overwrite:"all",callbacks:!0,onStart:!0,onUpdate:!0,onComplete:!0},n=i.extend(d,n),h=[n.dur,n.drag?0:n.dur],u=i("#mCSB_"+l.idx),f=i("#mCSB_"+l.idx+"_container"),g=c.callbacks.onTotalScrollOffset?p._arr.call(e,c.callbacks.onTotalScrollOffset):[0,0],m=c.callbacks.onTotalScrollBackOffset?p._arr.call(e,c.callbacks.onTotalScrollBackOffset):[0,0];if(l.trigger=n.trigger,"_resetY"!==t||l.contentReset.y||(o("onOverflowYNone")&&c.callbacks.onOverflowYNone.call(e[0]),l.contentReset.y=1),"_resetX"!==t||l.contentReset.x||(o("onOverflowXNone")&&c.callbacks.onOverflowXNone.call(e[0]),l.contentReset.x=1),"_resetY"!==t&&"_resetX"!==t){switch(!l.contentReset.y&&e[0].mcs||!l.overflowed[0]||(o("onOverflowY")&&c.callbacks.onOverflowY.call(e[0]),l.contentReset.x=null),!l.contentReset.x&&e[0].mcs||!l.overflowed[1]||(o("onOverflowX")&&c.callbacks.onOverflowX.call(e[0]),l.contentReset.x=null),c.snapAmount&&(t=p._snapAmount(t,c.snapAmount,c.snapOffset)),n.dir){case"x":var v=i("#mCSB_"+l.idx+"_dragger_horizontal"),w="left",b=f[0].offsetLeft,x=[u.width()-f.outerWidth(!1),v.parent().width()-v.width()],y=[t,0===t?0:t/l.scrollRatio.x],C=g[1],S=m[1],_=C>0?C/l.scrollRatio.x:0,T=S>0?S/l.scrollRatio.x:0;break;case"y":var v=i("#mCSB_"+l.idx+"_dragger_vertical"),w="top",b=f[0].offsetTop,x=[u.height()-f.outerHeight(!1),v.parent().height()-v.height()],y=[t,0===t?0:t/l.scrollRatio.y],C=g[0],S=m[0],_=C>0?C/l.scrollRatio.y:0,T=S>0?S/l.scrollRatio.y:0}y[1]<0||0===y[0]&&0===y[1]?y=[0,0]:y[1]>=x[1]?y=[x[0],x[1]]:y[0]=-y[0],e[0].mcs||r(),clearTimeout(f[0].onCompleteTimeout),(l.tweenRunning||!(0===b&&y[0]>=0||b===x[0]&&y[0]<=x[0]))&&(p._tweenTo.call(null,v[0],w,Math.round(y[1]),h[1],n.scrollEasing),p._tweenTo.call(null,f[0],w,Math.round(y[0]),h[0],n.scrollEasing,n.overwrite,{onStart:function(){n.callbacks&&n.onStart&&!l.tweenRunning&&(o("onScrollStart")&&(r(),c.callbacks.onScrollStart.call(e[0])),l.tweenRunning=!0,p._onDragClasses(v),l.cbOffsets=s())},onUpdate:function(){n.callbacks&&n.onUpdate&&o("whileScrolling")&&(r(),c.callbacks.whileScrolling.call(e[0]))},onComplete:function(){if(n.callbacks&&n.onComplete){"yx"===c.axis&&clearTimeout(f[0].onCompleteTimeout);var t=f[0].idleTimer||0;f[0].onCompleteTimeout=setTimeout(function(){o("onScroll")&&(r(),c.callbacks.onScroll.call(e[0])),o("onTotalScroll")&&y[1]>=x[1]-_&&l.cbOffsets[0]&&(r(),c.callbacks.onTotalScroll.call(e[0])),o("onTotalScrollBack")&&y[1]<=T&&l.cbOffsets[1]&&(r(),c.callbacks.onTotalScrollBack.call(e[0])),l.tweenRunning=!1,f[0].idleTimer=0,p._onDragClasses(v,"hide")},t)}}}))}},_tweenTo:function(t,i,n,a,o,s,r){function l(){t._mcsstop||(x||m.call(),x=p._getTime()-b,c(),x>=t._mcstime&&(t._mcstime=x>t._mcstime?x+f-(x-t._mcstime):x+f-1,t._mcstime0?(t._mcscurrVal=u(t._mcstime,y,S,a,o),C[i]=Math.round(t._mcscurrVal)+"px"):C[i]=n+"px",v.call()}function d(){f=1e3/60,t._mcstime=x+f,g=e.requestAnimationFrame?e.requestAnimationFrame:function(e){return c(),setTimeout(e,.01)},t._mcsid=g(l)}function h(){null!=t._mcsid&&(e.requestAnimationFrame?e.cancelAnimationFrame(t._mcsid):clearTimeout(t._mcsid),t._mcsid=null)}function u(e,t,i,n,a){switch(a){case"linear":case"mcsLinear":return i*e/n+t;case"mcsLinearOut":return e/=n,e--,i*Math.sqrt(1-e*e)+t;case"easeInOutSmooth":return e/=n/2,1>e?i/2*e*e+t:(e--,-i/2*(e*(e-2)-1)+t);case"easeInOutStrong":return e/=n/2,1>e?i/2*Math.pow(2,10*(e-1))+t:(e--,i/2*(-Math.pow(2,-10*e)+2)+t);case"easeInOut":case"mcsEaseInOut":return e/=n/2,1>e?i/2*e*e*e+t:(e-=2,i/2*(e*e*e+2)+t);case"easeOutSmooth":return e/=n,e--,-i*(e*e*e*e-1)+t;case"easeOutStrong":return i*(-Math.pow(2,-10*e/n)+1)+t;case"easeOut":case"mcsEaseOut":default:var o=(e/=n)*e,s=o*e;return t+i*(.499999999999997*s*o+-2.5*o*o+5.5*s+-6.5*o+4*e)}}var f,g,r=r||{},m=r.onStart||function(){},v=r.onUpdate||function(){},w=r.onComplete||function(){},b=p._getTime(),x=0,y=t.offsetTop,C=t.style;"left"===i&&(y=t.offsetLeft);var S=n-y;t._mcsstop=0,"none"!==s&&h(),d()},_getTime:function(){return e.performance&&e.performance.now?e.performance.now():e.performance&&e.performance.webkitNow?e.performance.webkitNow():Date.now?Date.now():(new Date).getTime()},_stopTween:function(){var t=this;null!=t._mcsid&&(e.requestAnimationFrame?e.cancelAnimationFrame(t._mcsid):clearTimeout(t._mcsid),t._mcsid=null,t._mcsstop=1)},_delete:function(e){try{delete e}catch(t){e=null}},_mouseBtnLeft:function(e){return!(e.which&&1!==e.which)},_pointerTouch:function(e){var t=e.originalEvent.pointerType;return!(t&&"touch"!==t&&2!==t)},_isNumeric:function(e){return!isNaN(parseFloat(e))&&isFinite(e)}};i.fn[n]=function(e){return u[e]?u[e].apply(this,Array.prototype.slice.call(arguments,1)):"object"!=typeof e&&e?void i.error("Method "+e+" does not exist"):u.init.apply(this,arguments)},i[n]=function(e){return u[e]?u[e].apply(this,Array.prototype.slice.call(arguments,1)):"object"!=typeof e&&e?void i.error("Method "+e+" does not exist"):u.init.apply(this,arguments)},i[n].defaults=s,e[n]=!0,i(e).load(function(){i(o)[n]()})})}(window,document),function(e,t,i,n){var a=i("html"),o=i(e),s=i(t),r=i.fancybox=function(){r.open.apply(this,arguments)},l=navigator.userAgent.match(/msie/i),c=null,d=t.createTouch!==n,h=function(e){return e&&e.hasOwnProperty&&e instanceof i},u=function(e){return e&&"string"===i.type(e)},p=function(e){return u(e)&&0
        ',image:'',iframe:'",error:'

        The requested content cannot be loaded.
        Please try again later.

        ',closeBtn:'
        ',next:'',prev:''},openEffect:"fade",openSpeed:250,openEasing:"swing",openOpacity:!0,openMethod:"zoomIn",closeEffect:"fade",closeSpeed:250,closeEasing:"swing",closeOpacity:!0,closeMethod:"zoomOut",nextEffect:"elastic",nextSpeed:250,nextEasing:"swing",nextMethod:"changeIn",prevEffect:"elastic",prevSpeed:250,prevEasing:"swing",prevMethod:"changeOut",helpers:{overlay:!0,title:!0},onCancel:i.noop,beforeLoad:i.noop,afterLoad:i.noop,beforeShow:i.noop,afterShow:i.noop,beforeChange:i.noop,beforeClose:i.noop,afterClose:i.noop},group:{},opts:{},previous:null,coming:null,current:null,isActive:!1,isOpen:!1,isOpened:!1,wrap:null,skin:null,outer:null,inner:null,player:{timer:null,isActive:!1},ajaxLoad:null,imgPreload:null,transitions:{},helpers:{},open:function(e,t){return e&&(i.isPlainObject(t)||(t={}),!1!==r.close(!0))?(i.isArray(e)||(e=h(e)?i(e).get():[e]),i.each(e,function(a,o){var s,l,c,d,p,f={};"object"===i.type(o)&&(o.nodeType&&(o=i(o)),h(o)?(f={href:o.data("fancybox-href")||o.attr("href"),title:o.data("fancybox-title")||o.attr("title"),isDom:!0,element:o},i.metadata&&i.extend(!0,f,o.metadata())):f=o),s=t.href||f.href||(u(o)?o:null),l=t.title!==n?t.title:f.title||"",d=(c=t.content||f.content)?"html":t.type||f.type,!d&&f.isDom&&(d=o.data("fancybox-type"),d||(d=(d=o.prop("class").match(/fancybox\.(\w+)/))?d[1]:null)),u(s)&&(d||(r.isImage(s)?d="image":r.isSWF(s)?d="swf":"#"===s.charAt(0)?d="inline":u(o)&&(d="html",c=o)),"ajax"===d&&(p=s.split(/\s+/,2),s=p.shift(),p=p.shift())),c||("inline"===d?s?c=i(u(s)?s.replace(/.*(?=#[^\s]+$)/,""):s):f.isDom&&(c=o):"html"===d?c=s:!d&&!s&&f.isDom&&(d="inline",c=o)),i.extend(f,{href:s,type:d,content:c,title:l,selector:p}),e[a]=f}),r.opts=i.extend(!0,{},r.defaults,t),t.keys!==n&&(r.opts.keys=t.keys?i.extend({},r.defaults.keys,t.keys):!1),r.group=e,r._start(r.opts.index)):void 0},cancel:function(){var e=r.coming;e&&!1!==r.trigger("onCancel")&&(r.hideLoading(),r.ajaxLoad&&r.ajaxLoad.abort(),r.ajaxLoad=null,r.imgPreload&&(r.imgPreload.onload=r.imgPreload.onerror=null),e.wrap&&e.wrap.stop(!0,!0).trigger("onReset").remove(),r.coming=null,r.current||r._afterZoomOut(e))},close:function(e){r.cancel(),!1!==r.trigger("beforeClose")&&(r.unbindEvents(),r.isActive&&(r.isOpen&&!0!==e?(r.isOpen=r.isOpened=!1,r.isClosing=!0,i(".fancybox-item, .fancybox-nav").remove(),r.wrap.stop(!0,!0).removeClass("fancybox-opened"),r.transitions[r.current.closeMethod]()):(i(".fancybox-wrap").stop(!0).trigger("onReset").remove(),r._afterZoomOut())))},play:function(e){var t=function(){clearTimeout(r.player.timer)},i=function(){t(),r.current&&r.player.isActive&&(r.player.timer=setTimeout(r.next,r.current.playSpeed))},n=function(){t(),s.unbind(".player"),r.player.isActive=!1,r.trigger("onPlayEnd")};!0===e||!r.player.isActive&&!1!==e?r.current&&(r.current.loop||r.current.index=a.index?"next":"prev"],r.router=i||"jumpto",a.loop&&(0>e&&(e=a.group.length+e%a.group.length),e%=a.group.length),a.group[e]!==n&&(r.cancel(),r._start(e)))},reposition:function(e,t){var n,a=r.current,o=a?a.wrap:null;o&&(n=r._getPosition(t),e&&"scroll"===e.type?(delete n.position,o.stop(!0,!0).animate(n,200)):(o.css(n),a.pos=i.extend({},a.dim,n)))},update:function(e){var t=e&&e.type,i=!t||"orientationchange"===t;i&&(clearTimeout(c),c=null),r.isOpen&&!c&&(c=setTimeout(function(){var n=r.current;n&&!r.isClosing&&(r.wrap.removeClass("fancybox-tmp"),(i||"load"===t||"resize"===t&&n.autoResize)&&r._setDimension(),"scroll"===t&&n.canShrink||r.reposition(e),r.trigger("onUpdate"),c=null)},i&&!d?0:300))},toggle:function(e){r.isOpen&&(r.current.fitToView="boolean"===i.type(e)?e:!r.current.fitToView,d&&(r.wrap.removeAttr("style").addClass("fancybox-tmp"),r.trigger("onUpdate")),r.update())},hideLoading:function(){s.unbind(".loading"),i("#fancybox-loading").remove()},showLoading:function(){var e,t;r.hideLoading(),e=i('
        ').click(r.cancel).appendTo("body"),s.bind("keydown.loading",function(e){27===(e.which||e.keyCode)&&(e.preventDefault(),r.cancel())}),r.defaults.fixed||(t=r.getViewport(),e.css({position:"absolute",top:.5*t.h+t.y,left:.5*t.w+t.x}))},getViewport:function(){var t=r.current&&r.current.locked||!1,i={x:o.scrollLeft(),y:o.scrollTop()};return t?(i.w=t[0].clientWidth,i.h=t[0].clientHeight):(i.w=d&&e.innerWidth?e.innerWidth:o.width(),i.h=d&&e.innerHeight?e.innerHeight:o.height()),i},unbindEvents:function(){r.wrap&&h(r.wrap)&&r.wrap.unbind(".fb"),s.unbind(".fb"),o.unbind(".fb")},bindEvents:function(){var e,t=r.current;t&&(o.bind("orientationchange.fb"+(d?"":" resize.fb")+(t.autoCenter&&!t.locked?" scroll.fb":""),r.update),(e=t.keys)&&s.bind("keydown.fb",function(a){var o=a.which||a.keyCode,s=a.target||a.srcElement;return 27===o&&r.coming?!1:void!(a.ctrlKey||a.altKey||a.shiftKey||a.metaKey||s&&(s.type||i(s).is("[contenteditable]"))||!i.each(e,function(e,s){return 1s[0].clientWidth||s[0].clientHeight&&s[0].scrollHeight>s[0].clientHeight),s=i(s).parent();0!==n&&!l&&10||a>0?r.prev(o>0?"down":"left"):(0>o||0>a)&&r.next(0>o?"up":"right"),e.preventDefault())}))},trigger:function(e,t){var n,a=t||r.coming||r.current;if(a){if(i.isFunction(a[e])&&(n=a[e].apply(a,Array.prototype.slice.call(arguments,1))),!1===n)return!1;a.helpers&&i.each(a.helpers,function(t,n){n&&r.helpers[t]&&i.isFunction(r.helpers[t][e])&&r.helpers[t][e](i.extend(!0,{},r.helpers[t].defaults,n),a)}),s.trigger(e)}},isImage:function(e){return u(e)&&e.match(/(^data:image\/.*,)|(\.(jp(e|g|eg)|gif|png|bmp|webp|svg)((\?|#).*)?$)/i)},isSWF:function(e){return u(e)&&e.match(/\.(swf)((\?|#).*)?$/i)},_start:function(e){var t,n,a={};if(e=f(e),t=r.group[e]||null,!t)return!1;if(a=i.extend(!0,{},r.opts,t),t=a.margin,n=a.padding,"number"===i.type(t)&&(a.margin=[t,t,t,t]),"number"===i.type(n)&&(a.padding=[n,n,n,n]),a.modal&&i.extend(!0,a,{closeBtn:!1,closeClick:!1,nextClick:!1,arrows:!1,mouseWheel:!1,keys:null,helpers:{overlay:{closeClick:!1}}}),a.autoSize&&(a.autoWidth=a.autoHeight=!0),"auto"===a.width&&(a.autoWidth=!0),"auto"===a.height&&(a.autoHeight=!0),a.group=r.group,a.index=e,r.coming=a,!1===r.trigger("beforeLoad"))r.coming=null;else{if(n=a.type,t=a.href,!n)return r.coming=null,r.current&&r.router&&"jumpto"!==r.router?(r.current.index=e,r[r.router](r.direction)):!1;if(r.isActive=!0,("image"===n||"swf"===n)&&(a.autoHeight=a.autoWidth=!1,a.scrolling="visible"),"image"===n&&(a.aspectRatio=!0),"iframe"===n&&d&&(a.scrolling="scroll"),a.wrap=i(a.tpl.wrap).addClass("fancybox-"+(d?"mobile":"desktop")+" fancybox-type-"+n+" fancybox-tmp "+a.wrapCSS).appendTo(a.parent||"body"),i.extend(a,{skin:i(".fancybox-skin",a.wrap),outer:i(".fancybox-outer",a.wrap),inner:i(".fancybox-inner",a.wrap)}),i.each(["Top","Right","Bottom","Left"],function(e,t){a.skin.css("padding"+t,g(a.padding[e]))}),r.trigger("onReady"),"inline"===n||"html"===n){if(!a.content||!a.content.length)return r._error("content")}else if(!t)return r._error("href");"image"===n?r._loadImage():"ajax"===n?r._loadAjax():"iframe"===n?r._loadIframe():r._afterLoad()}},_error:function(e){i.extend(r.coming,{type:"html",autoWidth:!0,autoHeight:!0,minWidth:0,minHeight:0,scrolling:"no",hasError:e,content:r.coming.tpl.error}),r._afterLoad()},_loadImage:function(){var e=r.imgPreload=new Image;e.onload=function(){this.onload=this.onerror=null,r.coming.width=this.width/r.opts.pixelRatio,r.coming.height=this.height/r.opts.pixelRatio,r._afterLoad()},e.onerror=function(){this.onload=this.onerror=null,r._error("image")},e.src=r.coming.href,!0!==e.complete&&r.showLoading()},_loadAjax:function(){var e=r.coming;r.showLoading(),r.ajaxLoad=i.ajax(i.extend({},e.ajax,{url:e.href,error:function(e,t){r.coming&&"abort"!==t?r._error("ajax",e):r.hideLoading()},success:function(t,i){"success"===i&&(e.content=t,r._afterLoad())}}))},_loadIframe:function(){var e=r.coming,t=i(e.tpl.iframe.replace(/\{rnd\}/g,(new Date).getTime())).attr("scrolling",d?"auto":e.iframe.scrolling).attr("src",e.href);i(e.wrap).bind("onReset",function(){try{i(this).find("iframe").hide().attr("src","//about:blank").end().empty()}catch(e){}}),e.iframe.preload&&(r.showLoading(),t.one("load",function(){i(this).data("ready",1),d||i(this).bind("load.fb",r.update),i(this).parents(".fancybox-wrap").width("100%").removeClass("fancybox-tmp").show(),r._afterLoad()})),e.content=t.appendTo(e.inner),e.iframe.preload||r._afterLoad()},_preloadImages:function(){var e,t,i=r.group,n=r.current,a=i.length,o=n.preload?Math.min(n.preload,a-1):0;for(t=1;o>=t;t+=1)e=i[(n.index+t)%a],"image"===e.type&&e.href&&((new Image).src=e.href)},_afterLoad:function(){var e,t,n,a,o,s=r.coming,l=r.current;if(r.hideLoading(),s&&!1!==r.isActive)if(!1===r.trigger("afterLoad",s,l))s.wrap.stop(!0).trigger("onReset").remove(),r.coming=null;else{switch(l&&(r.trigger("beforeChange",l),l.wrap.stop(!0).removeClass("fancybox-opened").find(".fancybox-item, .fancybox-nav").remove()),r.unbindEvents(),e=s.content,t=s.type,n=s.scrolling,i.extend(r,{wrap:s.wrap,skin:s.skin,outer:s.outer,inner:s.inner,current:s,previous:l}),a=s.href,t){case"inline":case"ajax":case"html":s.selector?e=i("
        ").html(e).find(s.selector):h(e)&&(e.data("fancybox-placeholder")||e.data("fancybox-placeholder",i('
        ').insertAfter(e).hide()),e=e.show().detach(),s.wrap.bind("onReset",function(){i(this).find(e).length&&e.hide().replaceAll(e.data("fancybox-placeholder")).data("fancybox-placeholder",!1)}));break;case"image":e=s.tpl.image.replace("{href}",a);break;case"swf":e='',o="",i.each(s.swf,function(t,i){e+='',o+=" "+t+'="'+i+'"'}),e+='"}(!h(e)||!e.parent().is(s.inner))&&s.inner.append(e),r.trigger("beforeShow"),s.inner.css("overflow","yes"===n?"scroll":"no"===n?"hidden":n),r._setDimension(),r.reposition(),r.isOpen=!1,r.coming=null,r.bindEvents(),r.isOpened?l.prevMethod&&r.transitions[l.prevMethod]():i(".fancybox-wrap").not(s.wrap).stop(!0).trigger("onReset").remove(),r.transitions[r.isOpened?s.nextMethod:s.openMethod](),r._preloadImages()}},_setDimension:function(){var e,t,n,a,o,s,l,c,d,h=r.getViewport(),u=0,m=!1,v=!1,m=r.wrap,w=r.skin,b=r.inner,x=r.current,v=x.width,y=x.height,C=x.minWidth,S=x.minHeight,_=x.maxWidth,T=x.maxHeight,k=x.scrolling,E=x.scrollOutside?x.scrollbarWidth:0,M=x.margin,P=f(M[1]+M[3]),I=f(M[0]+M[2]);if(m.add(w).add(b).width("auto").height("auto").removeClass("fancybox-tmp"),M=f(w.outerWidth(!0)-w.width()),e=f(w.outerHeight(!0)-w.height()),t=P+M,n=I+e,a=p(v)?(h.w-t)*f(v)/100:v,o=p(y)?(h.h-n)*f(y)/100:y,"iframe"===x.type){if(d=x.content,x.autoHeight&&1===d.data("ready"))try{d[0].contentWindow.document.location&&(b.width(a).height(9999),s=d.contents().find("body"),E&&s.css("overflow-x","hidden"),o=s.outerHeight(!0))}catch(L){}}else(x.autoWidth||x.autoHeight)&&(b.addClass("fancybox-tmp"),x.autoWidth||b.width(a),x.autoHeight||b.height(o),x.autoWidth&&(a=b.width()),x.autoHeight&&(o=b.height()),b.removeClass("fancybox-tmp"));if(v=f(a),y=f(o),c=a/o,C=f(p(C)?f(C,"w")-t:C),_=f(p(_)?f(_,"w")-t:_),S=f(p(S)?f(S,"h")-n:S),T=f(p(T)?f(T,"h")-n:T),s=_,l=T,x.fitToView&&(_=Math.min(h.w-t,_),T=Math.min(h.h-n,T)),t=h.w-P,I=h.h-I,x.aspectRatio?(v>_&&(v=_,y=f(v/c)),y>T&&(y=T,v=f(y*c)),C>v&&(v=C,y=f(v/c)),S>y&&(y=S,v=f(y*c))):(v=Math.max(C,Math.min(v,_)),x.autoHeight&&"iframe"!==x.type&&(b.width(v),y=b.height()),y=Math.max(S,Math.min(y,T))),x.fitToView)if(b.width(v).height(y),m.width(v+M),h=m.width(),P=m.height(),x.aspectRatio)for(;(h>t||P>I)&&v>C&&y>S&&!(19v&&(v=C,y=f(v/c)),v>_&&(v=_,y=f(v/c)),b.width(v).height(y),m.width(v+M),h=m.width(),P=m.height();else v=Math.max(C,Math.min(v,v-(h-t))),y=Math.max(S,Math.min(y,y-(P-I)));E&&"auto"===k&&o>y&&t>v+M+E&&(v+=E),b.width(v).height(y),m.width(v+M),h=m.width(),P=m.height(),m=(h>t||P>I)&&v>C&&y>S,v=x.aspectRatio?s>v&&l>y&&a>v&&o>y:(s>v||l>y)&&(a>v||o>y),i.extend(x,{dim:{width:g(h),height:g(P)},origWidth:a,origHeight:o,canShrink:m,canExpand:v,wPadding:M,hPadding:e,wrapSpace:P-w.outerHeight(!0),skinSpace:w.height()-y}),!d&&x.autoHeight&&y>S&&T>y&&!v&&b.height("auto")},_getPosition:function(e){var t=r.current,i=r.getViewport(),n=t.margin,a=r.wrap.width()+n[1]+n[3],o=r.wrap.height()+n[0]+n[2],n={position:"absolute",top:n[0],left:n[3]};return t.autoCenter&&t.fixed&&!e&&o<=i.h&&a<=i.w?n.position="fixed":t.locked||(n.top+=i.y,n.left+=i.x),n.top=g(Math.max(n.top,n.top+(i.h-o)*t.topRatio)),n.left=g(Math.max(n.left,n.left+(i.w-a)*t.leftRatio)),n},_afterZoomIn:function(){var e=r.current;e&&(r.isOpen=r.isOpened=!0,r.wrap.css("overflow","visible").addClass("fancybox-opened"),r.update(),(e.closeClick||e.nextClick&&1
        ').appendTo(r.coming?r.coming.parent:e.parent),this.fixed=!1,e.fixed&&r.defaults.fixed&&(this.overlay.addClass("fancybox-overlay-fixed"),this.fixed=!0)},open:function(e){var t=this;e=i.extend({},this.defaults,e),this.overlay?this.overlay.unbind(".overlay").width("auto").height("auto"):this.create(e),this.fixed||(o.bind("resize.overlay",i.proxy(this.update,this)),this.update()),e.closeClick&&this.overlay.bind("click.overlay",function(e){return i(e.target).hasClass("fancybox-overlay")?(r.isActive?r.close():t.close(),!1):void 0}),this.overlay.css(e.css).show()},close:function(){var e,t;o.unbind("resize.overlay"),this.el.hasClass("fancybox-lock")&&(i(".fancybox-margin").removeClass("fancybox-margin"),e=o.scrollTop(),t=o.scrollLeft(),this.el.removeClass("fancybox-lock"),o.scrollTop(e).scrollLeft(t)),i(".fancybox-overlay").remove().hide(),i.extend(this,{overlay:null,fixed:!1})},update:function(){var e,i="100%";this.overlay.width(i).height("100%"),l?(e=Math.max(t.documentElement.offsetWidth,t.body.offsetWidth),s.width()>e&&(i=s.width())):s.width()>o.width()&&(i=s.width()),this.overlay.width(i).height(s.height())},onReady:function(e,t){var n=this.overlay;i(".fancybox-overlay").stop(!0,!0),n||this.create(e),e.locked&&this.fixed&&t.fixed&&(n||(this.margin=s.height()>o.height()?i("html").css("margin-right").replace("px",""):!1),t.locked=this.overlay.append(t.wrap),t.fixed=!1),!0===e.showEarly&&this.beforeShow.apply(this,arguments)},beforeShow:function(e,t){var n,a;t.locked&&(!1!==this.margin&&(i("*").filter(function(){return"fixed"===i(this).css("position")&&!i(this).hasClass("fancybox-overlay")&&!i(this).hasClass("fancybox-wrap")}).addClass("fancybox-margin"),this.el.addClass("fancybox-margin")),n=o.scrollTop(),a=o.scrollLeft(),this.el.addClass("fancybox-lock"),o.scrollTop(n).scrollLeft(a)),this.open(e)},onUpdate:function(){this.fixed||this.update()},afterClose:function(e){this.overlay&&!r.coming&&this.overlay.fadeOut(e.speedOut,i.proxy(this.close,this))}},r.helpers.title={defaults:{type:"float",position:"bottom"},beforeShow:function(e){var t=r.current,n=t.title,a=e.type;if(i.isFunction(n)&&(n=n.call(t.element,t)),u(n)&&""!==i.trim(n)){switch(t=i('
        '+n+"
        "),a){case"inside":a=r.skin;break;case"outside":a=r.wrap;break;case"over":a=r.inner;break;default:a=r.skin,t.appendTo("body"),l&&t.width(t.width()),t.wrapInner(''),r.current.margin[2]+=Math.abs(f(t.css("margin-bottom")))}t["top"===e.position?"prependTo":"appendTo"](a)}}},i.fn.fancybox=function(e){var t,n=i(this),a=this.selector||"",o=function(o){var s,l,c=i(this).blur(),d=t;!(o.ctrlKey||o.altKey||o.shiftKey||o.metaKey||c.is(".fancybox-wrap")||(s=e.groupAttr||"data-fancybox-group",l=c.attr(s),l||(s="rel",l=c.get(0)[s]),l&&""!==l&&"nofollow"!==l&&(c=a.length?i(a):n,c=c.filter("["+s+'="'+l+'"]'),d=c.index(this)),e.index=d,!1===r.open(c,e)||!o.preventDefault()))};return e=e||{},t=e.index||0,a&&!1!==e.live?s.undelegate(a,"click.fb-start").delegate(a+":not('.fancybox-item, .fancybox-nav')","click.fb-start",o):n.unbind("click.fb-start").bind("click.fb-start",o),this.filter("[data-fancybox-start=1]").trigger("click"),this},s.ready(function(){var t,o;if(i.scrollbarWidth===n&&(i.scrollbarWidth=function(){var e=i('
        ').appendTo("body"),t=e.children(),t=t.innerWidth()-t.height(99).innerWidth();return e.remove(),t}),i.support.fixedPosition===n){t=i.support,o=i('
        ').appendTo("body");var s=20===o[0].offsetTop||15===o[0].offsetTop;o.remove(),t.fixedPosition=s}i.extend(r.defaults,{scrollbarWidth:i.scrollbarWidth(),fixed:i.support.fixedPosition,parent:i("body")}),t=i(e).width(),a.addClass("fancybox-lock-test"),o=i(e).width(),a.removeClass("fancybox-lock-test"),i("").appendTo("head")})}(window,document,jQuery),function(e,t,i){function n(e){var t={},n=/^jQuery\d+$/;return i.each(e.attributes,function(e,i){i.specified&&!n.test(i.name)&&(t[i.name]=i.value)}),t}function a(e,t){var n=this,a=i(n);if(n.value==a.attr("placeholder")&&a.hasClass("placeholder"))if(a.data("placeholder-password")){if(a=a.hide().next().show().attr("id",a.removeAttr("id").data("placeholder-id")),e===!0)return a[0].value=t;a.focus()}else n.value="",a.removeClass("placeholder"),n==s()&&n.select()}function o(){var e,t=this,o=i(t),s=this.id;if(""==t.value){if("password"==t.type){if(!o.data("placeholder-textinput")){try{e=o.clone().attr({type:"text"})}catch(r){e=i("").attr(i.extend(n(this),{type:"text"}))}e.removeAttr("name").data({"placeholder-password":o,"placeholder-id":s}).bind("focus.placeholder",a),o.data({"placeholder-textinput":e,"placeholder-id":s}).before(e)}o=o.removeAttr("id").hide().prev().attr("id",s).show()}o.addClass("placeholder"),o[0].value=o.attr("placeholder")}else o.removeClass("placeholder")}function s(){try{return t.activeElement}catch(e){}}var r,l,c="placeholder"in t.createElement("input"),d="placeholder"in t.createElement("textarea"),h=i.fn,u=i.valHooks,p=i.propHooks;c&&d?(l=h.placeholder=function(){return this},l.input=l.textarea=!0):(l=h.placeholder=function(){var e=this;return e.filter((c?"textarea":":input")+"[placeholder]").not(".placeholder").bind({"focus.placeholder":a,"blur.placeholder":o}).data("placeholder-enabled",!0).trigger("blur.placeholder"),e},l.input=c,l.textarea=d,r={get:function(e){var t=i(e),n=t.data("placeholder-password");return n?n[0].value:t.data("placeholder-enabled")&&t.hasClass("placeholder")?"":e.value},set:function(e,t){var n=i(e),r=n.data("placeholder-password");return r?r[0].value=t:n.data("placeholder-enabled")?(""==t?(e.value=t,e!=s()&&o.call(e)):n.hasClass("placeholder")?a.call(e,!0,t)||(e.value=t):e.value=t,n):e.value=t}},c||(u.input=r,p.value=r),d||(u.textarea=r,p.value=r),i(function(){i(t).delegate("form","submit.placeholder",function(){var e=i(".placeholder",this).each(a);setTimeout(function(){e.each(o)},10)})}),i(e).bind("beforeunload.placeholder",function(){i(".placeholder").each(function(){this.value=""})}))}(this,document,jQuery),function(){var e,t;jQuery.uaMatch=function(e){e=e.toLowerCase();var t=/(chrome)[ \/]([\w.]+)/.exec(e)||/(webkit)[ \/]([\w.]+)/.exec(e)||/(opera)(?:.*version|)[ \/]([\w.]+)/.exec(e)||/(msie) ([\w.]+)/.exec(e)||e.indexOf("compatible")<0&&/(mozilla)(?:.*? rv:([\w.]+)|)/.exec(e)||[];return{browser:t[1]||"",version:t[2]||"0"}},e=jQuery.uaMatch(navigator.userAgent),t={},e.browser&&(t[e.browser]=!0,t.version=e.version),t.chrome?t.webkit=!0:t.webkit&&(t.safari=!0),jQuery.browser=t,jQuery.sub=function(){function e(t,i){return new e.fn.init(t,i)}jQuery.extend(!0,e,this),e.superclass=this,e.fn=e.prototype=this(),e.fn.constructor=e,e.sub=this.sub,e.fn.init=function(i,n){return n&&n instanceof jQuery&&!(n instanceof e)&&(n=e(n)),jQuery.fn.init.call(this,i,n,t)},e.fn.init.prototype=e.fn;var t=e(document);return e}}(),function(e){e.fn.photoTag=function(t){function i(e){e.parent().css({overflow:"visible"}),e.parent().find(".utag-bot, .utag-top, .utag-right, .utag-left").show(),e.parent().find(".utag-bot").css({top:e.parent().css("height")}),e.parent().find(".utag-right").css({height:e.parent().css("height"),left:e.parent().css("width")}),e.parent().find(".utag-left").css({height:e.parent().css("height")}),e.parent().stop().animate({opacity:1},500)}function n(e){e.parent().stop().animate({opacity:0},500,function(){e.parent().css({overflow:"hidden"})}),e.parent().find(".utag-bot, .utag-top, .utag-right, .utag-left").hide()}function a(e){e.css({overflow:"visible"}),e.find(".utag-bot, .utag-top, .utag-right, .utag-left").show(),e.find(".utag-bot").css({top:e.css("height")}),e.find(".utag-right").css({height:e.css("height"),left:e.css("width")}),e.find(".utag-left").css({height:e.css("height")}),e.stop().animate({opacity:1},500)}function o(e){e.stop().animate({opacity:0},500,function(){e.css({overflow:"hidden"})}),e.find(".utag-bot, .utag-top, .utag-right, .utag-left").hide()}function s(){e(".highlight-tag").each(function(){e(this).mouseenter(function(){a(e("#photoTag-tag_"+e(this).attr("tag-id")))}).mouseleave(function(){o(e("#photoTag-tag_"+e(this).attr("tag-id")))})})}var r={deleteTagsUrl:"/photo/delete-tag/",addTagUrl:"/add-tag.php",parametersForNewTag:{name:{parameterKey:"name",isAutocomplete:!0,label:"Name"}},parametersForRequest:["image-id","album-id"],literals:{communicationProblem:"Произошла ошибка. Изменения не сохранены.",saveTag:"Добавить",cancelTag:"",addNewTag:"Отметить человека",removeTag:"X"},tag:{tagIdParameter:"tag-id",defaultWidth:100,defaultHeight:100,isResizable:!0,minWidth:50,minHeight:50,maxWidth:150,maxHeight:150,cssClass:"photoTag-tag",idPrefix:"photoTag-tag_",showDeleteLinkOnTag:!0,deleteLinkCssClass:"photoTag-delete",deleteLinkIdPrefix:"photoTag-delete_",flashAfterCreation:!0,newTagFormWidth:170,newTagFormClass:"photoTag-newTagForm"},imageWrapBox:{cssClass:"photoTag-wrap",idPrefix:"photoTag-wrap_",addNewLinkIdPrefix:"photoTag-add_",controlPaneIdPrefix:"photoTag-cpanel_",showTagList:!0,tagListCssClass:"photoTag-taglist",tagListIdPrefix:"photoTag-taglist_",tagListRemoveItemIdPrefix:"photoTag-removeTag",canvasIdPrefix:"photoTag-canvas_",controlPanelHeight:25},showAddTagLinks:!0,externalAddTagLinks:{bind:!0,selector:".addTag"},isEnabledToEditTags:!0,manageError:"internal function, user can bind a new one. function(response)",beforeTagRequest:"bind by user, function( parameters )"},l={tags:{}},t=e.extend(!0,r,t),c=function(i){var n={};return e.each(t.parametersForRequest,function(e,t){var a=i.attr("data-"+t);a&&(n[t]=a)}),n},d=function(i){e.isFunction(t.manageError)?t.manageError(i):alert(i.message?i.message:t.literals.communicationProblem)},h=function(a,o){a.click(function(s){s.preventDefault();var r=a.attr("href").substring(1),l=c(o);l[t.tag.tagIdParameter]=r,e.getJSON(t.deleteTagsUrl,l,function(e){e.result||d(e)}),e("#"+t.tag.deleteLinkIdPrefix+r).parents().eq(1).remove(),e("#"+t.imageWrapBox.tagListRemoveItemIdPrefix+r).parent().remove();var h=e("span.comma"),u=e("a.highlight-tag");return e("ul.photoTag-taglist li").last().find(h).remove(),e("ul.photoTag-taglist li").last().find(u).mouseover(function(){i(e("#photoTag-tag_"+e(this).attr("tag-id")).find(".taghover"))}).mouseleave(function(){n(e("#photoTag-tag_"+e(this).attr("tag-id")).find(".taghover"))}),!1})},u=function(i,n,a){e(i).click(function(i){i.preventDefault(),0==e("#"+t.tag.idPrefix+"expo").length&&(S(a),e("#"+t.imageWrapBox.idPrefix+a).append(C(n)),m(e("#"+t.tag.idPrefix+"expo"),n,a))})},p=function(){var t=(e(this),e(this).position()),i=t.left,n=t.top;e("#expoTagBoxForm")&&e("#expoTagBoxForm").css({top:n,left:i+e(this).width()+10}),e("#photoTag-tag_expo .utag-right").css({height:e(this).height(),left:e(this).width()}),e("#photoTag-tag_expo .utag-left").css({height:e(this).height()}),e("#photoTag-tag_expo .utag-bot").css({top:e(this).height()})},f=function(){e("#expoTagBoxForm")&&e("#expoTagBoxForm").css({display:"none"})},g=function(){var t=(e(this),e(this).position()),i=t.left,n=t.top;e("#expoTagBoxForm")&&e("#expoTagBoxForm").css({display:"block",top:n,left:i+e(this).width()+10})},m=function(i,n,a){i.draggable({containment:n,cursor:"move",drag:p,start:f,stop:g,grid:[1,1]}),i.resizable({handles:"n, e, s, w, ne, se, sw, nw",maxHeight:n.height(),maxWidth:n.width(),minHeight:t.tag.minHeight,minWidth:t.tag.minWidth,containment:n,resize:p}),v(i,n,a),e(".utag-bot").css({top:t.tag.defaultWidth}),e(".utag-right").css({height:t.tag.defaultHeight,left:t.tag.defaultWidth}),e(".utag-left").css({height:t.tag.defaultHeight})},v=function(i,n,a){var o=e('
        '),r=e('
        '),l=e(i).position();r.css({position:"absolute",top:l.top,left:l.left+i.width()+10,width:t.tag.newTagFormWidth}),r.append(e('
        '));var c=e("#"+t.imageWrapBox.idPrefix+a);c.append(r),e("#expoNewTagFormContent").append(o),e.each(t.parametersForNewTag,function(t,i){var n=e('
        ');if(i.label){{var a=e("");e("
        ")}a.append(i.label),e("#expoNewTagForm").append(a)}e("#expoNewTagForm").append(n),e("#expoInput_name").bind("keydown",function(t){t.keyCode===e.ui.keyCode.TAB&&e(this).data("ui-autocomplete").menu.active&&t.preventDefault()}).autocomplete({appendTo:e(".ptListHolder"),minLength:1,source:function(t,i){var n=e.ui.autocomplete.escapeRegex(t.term),a=new RegExp("^"+n,"i"),o=e.grep(photoTagData,function(e){return a.test(e.label||e.value||e)}),s=new RegExp(n,"i"),r=e.grep(photoTagData,function(t){return e.inArray(t,o)<0&&s.test(t.label||t.value||t)});i(o.concat(r))},focus:function(){return!1},select:function(t,i){e("#hidden_expoInput_name").val(i.item.id)}}),e("#expoInput_name").parent().append(e(''))});var h=e('");e("#expoNewTagForm").append(h);var u=e("");e("#expoNewTagForm").append(u);var p=e('');p.click(function(e){return e.preventDefault(),w(),_(a),!1}),e("#expoNewTagForm").append(p),e("#expoNewTagForm").submit(function(i){i.preventDefault();var o=e("#"+t.tag.idPrefix+"expo"),r={left:o.position().left,top:o.position().top,width:o.width(),height:o.height()};e.getJSON(t.addTagUrl+"?"+e.param(r)+"&"+e(this).serialize(),function(i){if(void 0!=i.result&&!i.result)return void d(i);var o=x(i.tag,n);e("#"+t.imageWrapBox.idPrefix+a).append(o),s(),E(o,i.tag,n,a)}),w(),_(a)})},w=function(){e("#"+t.tag.idPrefix+"expo").remove(),e("#expoTagBoxForm").remove()},b=function(i,n,a,o){var s=e('
        '),r={position:"absolute",top:Math.round(a.top)+"px",left:Math.round(a.left)+"px",height:n.height+"px",width:n.width+"px",opacity:o};return s.css(r),s.append(' 
        '),s},x=function(i,n){i.height&&i.width||(i.height=t.tag.defaultHeight,i.width=t.tag.defaultWidth);var a={width:i.width,height:i.height},o={top:i.top,left:i.left},s=b(i.id,a,o,0),r=e("
        ");if(r.append(i.text.replace(/ /g," ")),s.append(r),t.isEnabledToEditTags&&i.isDeleteEnable&&t.tag.showDeleteLinkOnTag){var l=e('');h(l,n)}return s.find(".taghover").append(l),s},y=function(a,o){e(".photoTag-taglist").html().length>0&&e(".photoTag-taglist li").last().append(', ');var s=e("
      • ");if(a.url){var r=e(''+a.text+"");s.append(r)}else s.append(a.text);if(a.isDeleteEnable){var l=e('  ');h(l,o),s.append(l)}var c=e("a.highlight-tag");return e("ul.photoTag-taglist li").last().find(c).mouseover(function(){i(e("#photoTag-tag_"+e(this).attr("tag-id")).find(".taghover"))}).mouseleave(function(){n(e("#photoTag-tag_"+e(this).attr("tag-id")).find(".taghover"))}),s},C=function(e){var i={width:t.tag.defaultWidth,height:t.tag.defaultHeight},n={top:e.height()/2-i.height/2,left:e.width()/2-i.width/2};l.expoId++;var a=b("expo",i,n,1);return a},S=function(t){e.each(l.tags[t],function(){e(this).css({opacity:0}),e(this).hide()})},_=function(t){e.each(l.tags[t],function(){e(this).show()})},T=function(i,n){var a=e(''+t.literals.addNewTag+"");return u(a,i,n),a},k=function(i,n){var a=i.height(),o=i.width(),s=e('
        '),r=e('
        ');s.append(r);var l=e('
        ');if(s.append(l),i.wrap(s),t.externalAddTagLinks.bind){var c=e(t.externalAddTagLinks.selector);c.each(function(){u(this,i,n)})}else e("#"+t.imageWrapBox.controlPaneIdPrefix+n).append(T(i,n));var d=e("
        ");if(e("#"+t.imageWrapBox.canvasIdPrefix+n).wrap(d),t.imageWrapBox.showTagList){var h=e('
          ');e(".pg-photo-descr#imgid"+n).append(h)}},E=function(a,o,s,r){if(t.tag.flashAfterCreation&&(e(a).css({opacity:1}),e(a).stop().animate({opacity:0},800)),t.imageWrapBox.showTagList){var l=y(o,s);e("#"+t.imageWrapBox.tagListIdPrefix+r).append(l);var c=e("a.highlight-tag");e("ul.photoTag-taglist li").last().find(c).mouseover(function(){i(e("#photoTag-tag_"+e(this).attr("tag-id")).find(".taghover"))}).mouseleave(function(){n(e("#photoTag-tag_"+e(this).attr("tag-id")).find(".taghover"))})}},M=function(i,n){k(n,i.id);var a=l.tags[i.id]={};e.each(i.Tags,function(){var o=x(this,n);a[this.id]=o,e("#"+t.imageWrapBox.idPrefix+i.id).append(o),s(),E(o,this,n,i.id)})};return this.each(function(){var i=e(this),n=c(i);(!e.isFunction(t.beforeTagRequest)||t.beforeTagRequest(n))&&e.getJSON(t.requestTagsUrl,n,function(n){return void 0==n.result||n.result?(n.options&&(t=e.extend(!0,t,n.options)),void e.each(n.Image,function(){M(this,i)})):void d(n)})}),this}}(jQuery);var dna={clone:function(e,t,i){var n={fade:!1,top:!1,container:null,empty:!1,html:!1,callback:null};$.extend(n,i);var a=dna.store.getTemplate(e);a.nested&&!n.container&&dna.core.berserk("Container missing for nested template: "+e),n.empty&&dna.empty(e);for(var o=t instanceof Array?t:[t],s=$(),r=0;r0&&i(window,e.split(".")),n}},dna.ui={toElem:function(e,t){return e instanceof jQuery?e:$(e?e.target:t)},deleteElem:function(e){return dna.ui.toElem(e,this).remove()},slideFade:function(e,t,i){function n(){e.css(r)}var a={opacity:0,transition:"opacity 0s ease 0s"},o={opacity:1,transition:"opacity 0.4s ease-in"},s={opacity:0,transition:"opacity 0.4s ease-out"},r={transition:"opacity 0s ease 0s"};return window.setTimeout(n,1e3),i?e.css(a).hide().slideDown({complete:t}).css(o):e.css(s).slideUp({complete:t}),e},slideFadeIn:function(e,t){return dna.ui.slideFade(e,t,!0)},slideFadeOut:function(e,t){return dna.ui.slideFade(e,t,!1)},slideFadeToggle:function(e,t){return dna.ui.slideFade(e,t,e.is(":hidden"))},slideFadeDelete:function(e){return dna.ui.slideFadeOut(e,dna.ui.deleteElem)},slidingFlasher:function(e,t){return e.is(":hidden")?dna.ui.slideFadeIn(e,t):e.hide().fadeIn()}},dna.compile={regexDnaField:/^[\s]*(~~|\{\{).*(~~|\}\})[\s]*$/,regexDnaBasePair:/~~|{{|}}/,regexDnaBasePairs:/~~|\{\{|\}\}/g,setupNucleotide:function(e){return void 0===e.data().dnaRules&&(e.data().dnaRules={}),e.addClass("dna-nucleotide")},isDnaField:function(){var e=$(this)[0].childNodes[0];return e&&e.nodeValue&&e.nodeValue.match(dna.compile.regexDnaField)},field:function(){var e=dna.compile.setupNucleotide($(this));return e.data().dnaRules.text=$.trim(e.text()).replace(dna.compile.regexDnaBasePairs,""),e.empty()},propsAndAttrs:function(){function e(){if(/^data-dna-prop-/.test(this.name))i.push(this.name.replace(/^data-dna-prop-/,""),this.value.replace(dna.compile.regexDnaBasePairs,""));else{if(3!==this.value.split(dna.compile.regexDnaBasePair).length)return;n.push(this.name.replace(/^data-dna-attr-/,""),this.value.split(dna.compile.regexDnaBasePair))}a.push(this.name)}var t=$(this),i=[],n=[],a=[];return $.each(t.get(0).attributes,e),i.length>0&&(dna.compile.setupNucleotide(t).data().dnaRules.props=i),n.length>0&&(dna.compile.setupNucleotide(t).data().dnaRules.attrs=n),t.removeAttr(a.join(" "))},getDataField:function(e,t){return $.trim(e.data("dna-"+t).replace(dna.compile.regexDnaBasePairs,""))},subTemplateName:function(e,t){var i=e instanceof jQuery?dna.getClone(e).data().dnaRules.template:e;return i+"-"+t+"-instance"},rules:function(e,t,i){function n(){var e=dna.compile.setupNucleotide($(this)),n=dna.compile.getDataField(e,t);e.data().dnaRules[t]=i?n.split(","):n}return e.filter("[data-dna-"+t+"]").each(n).removeAttr("data-dna-"+t)},template:function(e){function t(){$(this).data().dnaRules={template:$(this).attr("id")}}var i=$("#"+e);i.length||dna.core.berserk("Template not found: "+e),i.find(".dna-template").addBack().each(t).removeAttr("id");var n=i.find("*").addBack();return n.filter(dna.compile.isDnaField).each(dna.compile.field),dna.compile.rules(n,"array").addClass("dna-array"),dna.compile.rules(n,"class",!0),dna.compile.rules(n,"require"),dna.compile.rules(n,"missing"),dna.compile.rules(n,"truthy"),dna.compile.rules(n,"falsey"),n.each(dna.compile.propsAndAttrs),dna.store.stash(i)}},dna.store={templates:{},stash:function(e){function t(){var e=$(this),t=e.data().dnaRules.template,i={name:t,elem:e,container:e.parent().addClass("dna-container").addClass("dna-contains-"+t),nested:0!==e.parent().closest(".dna-clone").length,index:e.index(),clones:0};dna.store.templates[t]=i,e.removeClass("dna-template").addClass("dna-clone").addClass(t).detach()}function i(){var e=$(this),t=e.data().dnaRules.array,i=dna.compile.subTemplateName(n,t);dna.compile.setupNucleotide(e.parent()).data().dnaRules.loop={name:i,field:t},e.data().dnaRules.template=i}var n=e.data().dnaRules.template;return e.find(".dna-template").addBack().each(t),e.find(".dna-array").each(i).each(t),dna.store.templates[n]},getTemplate:function(e){return dna.store.templates[e]||dna.compile.template(e)}},dna.events={initializers:[],elementSetup:function(e,t){function i(){dna.util.apply($(this).data("dna-setup"),[$(this),t])}var n="[data-dna-setup]",a=e?e.find(n).addBack(n):$(".dna-setup");return a.each(i).addClass("dna-initialized")},runInitializers:function(e,t){function i(){dna.util.apply(this.func,[(this.selector?e.find(this.selector).addBack(this.selector):e).addClass("dna-initialized")].concat(this.params))}return dna.events.elementSetup(e,t),$.each(dna.events.initializers,i),e},runner:function(e,t,i){return e=e.closest("[data-dna-"+t+"]"),dna.util.apply(e.data("dna-"+t),[e,i])},handle:function(e){return dna.events.runner($(e.target),e.type.replace("key","key-"),e)},handleEnterKey:function(e){return 13===e.which?dna.events.runner($(e.target),"enter-key",e):null},setup:function(){$(document).click(dna.events.handle).change(dna.events.handle).keyup(dna.events.handle).keyup(dna.events.handleEnterKey).keydown(dna.events.handle).keypress(dna.events.handle),dna.events.elementSetup()}},$(dna.events.setup),dna.core={inject:function(e,t,i,n){function a(e,a){function o(e){return-1!==$.inArray(typeof e,r)}var s="object"==typeof t?dna.util.value(t,a):"[count]"===a?i:"[value]"===a?t:null,r=["string","number","boolean"];o(s)&&(e=n.html?e.html(s):e.text(s))}function o(e,i){for(var n=0;n1&&(e.toggleClass(i[1],a),i[2]&&e.toggleClass(i[2],!a))}function l(e,i){var n=dna.util.value(t,i.field);n&&dna.clone(i.name,n,{container:e})}function c(){var e=$(this),i=e.data().dnaRules;i.text&&a(e,i.text),i.props&&o(e,i.props),i.attrs&&s(e,i.attrs),i.class&&r(e,i.class),i.require&&e.toggle(void 0!==dna.util.value(t,i.require)),i.missing&&e.toggle(void 0===dna.util.value(t,i.missing)),i.truthy&&e.toggle(dna.util.realTruth(dna.util.value(t,i.truthy))),i.falsey&&e.toggle(!dna.util.realTruth(dna.util.value(t,i.falsey))),i.loop&&l(e,i.loop)}return e.find(".dna-array").remove(),e.find(".dna-nucleotide").addBack(".dna-nucleotide").each(c),e.data("dna-model",t)},replicate:function(e,t,i,n){var a=e.elem.clone(!0,!0);e.clones++,dna.core.inject(a,t,i,n);var o=".dna-contains-"+e.name,s=n.container?n.container.find(o).addBack(o):e.container;return s[n.top?"prepend":"append"](a),dna.events.runInitializers(a,t),n.callback&&n.callback(a,t),n.fade&&dna.ui.slideFadeIn(a),a},unload:function(e,t,i){t.error||dna.clone(e,t,i)},berserk:function(e){throw"dna.js error -> "+e}};var map;!function(e){var t=e(window),i=(e("html"),e("body"),e(document));e.widget("custom.catcomplete",e.ui.autocomplete,{_renderMenu:function(t,i){var n=this,a="";e.each(i,function(e,i){i.category!=a&&(t.append("
        • "+i.category+"
        • "),a=i.category),n._renderItemData(t,i)})}}),e(function(){function n(e){return(e.getDate()<10?"0":"")+e.getDate()+"."+(e.getMonth()<9?"0":"")+(e.getMonth()+1)+"."+e.getFullYear()}e("#callback-form").on("submit",function(t){t.preventDefault();var i=e(this),n=i.attr("action"),a=e(this).serialize();e.get(n,a,function(t){if(t.success)e.fancybox.close();else{e("#callback-form .error").remove();var i=e("#id_callback_phone"),n=e("
          ").attr("class","error").append(t.errors.callback_phone);i.parent().prepend(n),console.log(t.errors)}})}),e("#send_message_form").on("submit",function(t){t.preventDefault(),$this=e(this);var i=$this.serialize(),n=$this.attr("action");e.post(n,i,function(t){t.success&&(e.fancybox.close(),$this.find("#id_body").val(""))})}),e("#reply_form").on("submit",function(t){t.preventDefault(),$this=e(this);var i=$this.serialize(),n=e("#reply_message").val(),a="/profile/messages/reply/"+n+"/";e.post(a,i,function(t){t.success&&(e.fancybox.close(),$this.find("#id_recipient").val(""),$this.find("#id_body").val(""))})}),e(".visit, .unvisit").on("click",function(t){t.preventDefault();var i=e(this),n=e(this).attr("href");e.get(n,function(t){t.not_authorized?e.fancybox.open("#pw-login"):t.success&&(t.in?i.hasClass("visit")&&(i.hide(),i.siblings(".unvisit").show()):i.hasClass("unvisit")&&(i.hide(),i.siblings(".visit").show()))})}),e("#paswd_change").on("submit",function(t){t.preventDefault();var i=e(this).serialize(),n="/profile/change-password/",a=e(this);e.post(n,i,function(t){if(t.success)e("#paswd_change .mf-success").fadeIn(300),setTimeout(function(){e("#paswd_change .mf-success").fadeOut(300)},3e3),a.find("#id_old password").val("");else{e("#paswd_change .mf-error").parent().remove();var i=e("
          ").attr("class","mf-line").append(e("
          ").attr("class","mf-error").append(t.errors[0]));a.find(".mf-buttons-line").before(i)}})}),e(".reg").on("click",function(t){t.preventDefault(),e(".register").click()}),e.fn.customSelect=function(){return e(this).each(function(){var t=e(this),i=t.children("option"),n=t.children("option").length,a=e(":selected",t);t.addClass("s-hidden"),t.wrap('
          '),t.after('
          ');var o=t.next("div.custom-select-wrap"),s=o.children(".custom-select-text"),r=0!=a.length?a.text():t.children("option").eq(0).text();s.text(r),0!=i.index(a)||t.children("option").eq(0).val()&&t.children("option").eq(0).attr("value")||s.addClass("placeholder");for(var l=e('
          ').insertAfter(o),c=l.find(".scroll-content"),d=e("
            ").appendTo(c),h=0;n>h;h++){var u=""!=t.children("option").eq(h).text()?t.children("option").eq(h).html():" ";e("
          • ",{html:u,"data-value":t.children("option").eq(h).val()}).appendTo(d)}var p=d.children("li"); +if(o.on("click",function(i){i.stopPropagation(),e("div.custom-select-wrap.active").not(this).each(function(){e(this).removeClass("active").next(".options").hide()}),t.prop("disabled")||e(this).toggleClass("active").next(".options").toggle()}),p.on("click",function(i){var n=e(this);i.stopPropagation(),s.text(n.text()),o.removeClass("active"),t.val(n.data("value")),0!=n.index()||t.children("option").eq(0).val()&&t.children("option").eq(0).attr("value")?s.removeClass("placeholder"):s.addClass("placeholder"),l.hide()}),e.fn.mCustomScrollbar){var f={scrollInertia:200,contentTouchScroll:!0,scrollButtons:{enable:!1},advanced:{autoScrollOnFocus:!1,updateOnContentResize:!0}},g=l.find("div.cs-scroll-container");g.mCustomScrollbar(f)}e(document).on("click",function(){o.removeClass("active"),l.hide()}),t.on("change",function(){var i=e(this),n=i.prop("selectedIndex"),a=i.children("option").eq(n).text();s.text(a),0!=n||t.children("option").eq(0).val()&&t.children("option").eq(0).attr("value")?s.removeClass("placeholder"):s.addClass("placeholder")})})},e("select:not([multiple])").each(function(){var t=e(this);t.hasClass("select2")||t.customSelect()}),e("#mp-recent-expo").each(function(){var t=e(this),i=t.children("ul"),n=i.children("li"),a=t.children("div.re-controls"),o=a.children("a.prev"),s=a.children("a.next");if(n.length>1){a.addClass("enabled"),n.css({display:"block"}),t.height(n.eq(0).height());var r=t.swiper({speed:500,mode:"horizontal",loop:!1,simulateTouch:!1,onInit:function(){o.addClass("disabled")},onSlideChangeStart:function(e){t.animate({height:n.eq(e.activeIndex).children("div.re-body").height()},300),0==e.activeIndex?(o.hasClass("disabled")||o.addClass("disabled"),s.hasClass("disabled")&&s.removeClass("disabled")):e.activeIndex==e.slides.length-1?(s.hasClass("disabled")||s.addClass("disabled"),o.hasClass("disabled")&&o.removeClass("disabled")):(o.hasClass("disabled")&&o.removeClass("disabled"),s.hasClass("disabled")&&s.removeClass("disabled"))}});o.on("click",function(){return e(this).hasClass("disabled")||r.swipePrev(),!1}),s.on("click",function(){return e(this).hasClass("disabled")||r.swipeNext(),!1})}}),e("#mp-photo-gallery").each(function(){var t=e(this),i=t.children("ul"),n=i.children("li"),a=t.children("div.re-controls"),o=a.children("a.prev"),s=a.children("a.next");if(n.length>1){a.addClass("enabled");var r=t.swiper({speed:500,mode:"horizontal",loop:!1,simulateTouch:!1,onInit:function(){o.addClass("disabled")},onSlideChangeStart:function(e){var t=n.find("div.pgi-descr");t.animate({height:"hide",opacity:"hide"},500),0==e.activeIndex?(o.hasClass("disabled")||o.addClass("disabled"),s.hasClass("disabled")&&s.removeClass("disabled")):e.activeIndex==e.slides.length-1?(s.hasClass("disabled")||s.addClass("disabled"),o.hasClass("disabled")&&o.removeClass("disabled")):(o.hasClass("disabled")&&o.removeClass("disabled"),s.hasClass("disabled")&&s.removeClass("disabled"))},onSlideChangeEnd:function(e){var t=n.find("div.pgi-descr");t.eq(e.activeIndex).slideDown(250)}});o.on("click",function(){return e(this).hasClass("disabled")||r.swipePrev(),!1}),s.on("click",function(){return e(this).hasClass("disabled")||r.swipeNext(),!1})}}),e("#ps-photo-gallery").each(function(){var t=e(this),i=t.children("ul"),n=i.children("li"),a=t.children("div.re-controls"),o=a.children("a.prev"),s=a.children("a.next");if(n.length>1){a.addClass("enabled"),n.css({display:"block"});var r=t.swiper({speed:500,mode:"horizontal",calculateHeight:!0,loop:!1,simulateTouch:!1,onInit:function(){o.addClass("disabled")},onSlideChangeStart:function(e){0==e.activeIndex?(o.hasClass("disabled")||o.addClass("disabled"),s.hasClass("disabled")&&s.removeClass("disabled")):e.activeIndex==e.slides.length-1?(s.hasClass("disabled")||s.addClass("disabled"),o.hasClass("disabled")&&o.removeClass("disabled")):(o.hasClass("disabled")&&o.removeClass("disabled"),s.hasClass("disabled")&&s.removeClass("disabled"))}});o.on("click",function(){return e(this).hasClass("disabled")||r.swipePrev(),!1}),s.on("click",function(){return e(this).hasClass("disabled")||r.swipeNext(),!1})}}),e("#s-slide-gallery").each(function(){var i=e(this),n=i.children("ul"),a=n.children("li"),o=i.children("div.re-controls"),s=o.children("a.prev"),r=o.children("a.next");if(a.length>4){o.addClass("enabled"),a.css({display:"block"}),t.on("resize",function(){i.height(a.eq(0).height())}).trigger("resize");var l=i.swiper({slidesPerView:4,slidesPerGroup:4,speed:500,mode:"horizontal",calculateHeight:!0,loop:!1,simulateTouch:!1,onInit:function(){s.addClass("disabled")},onSlideChangeStart:function(e){0==e.activeIndex?(s.hasClass("disabled")||s.addClass("disabled"),r.hasClass("disabled")&&r.removeClass("disabled")):e.activeIndex==e.slides.length-4?(r.hasClass("disabled")||r.addClass("disabled"),s.hasClass("disabled")&&s.removeClass("disabled")):(s.hasClass("disabled")&&s.removeClass("disabled"),r.hasClass("disabled")&&r.removeClass("disabled"))}});s.on("click",function(){return e(this).hasClass("disabled")||l.swipePrev(),!1}),r.on("click",function(){return e(this).hasClass("disabled")||l.swipeNext(),!1})}}),e(".sli-slides").each(function(){var i=e(this),n=i.children("ul"),a=n.children("li"),o=i.children("div.re-controls"),s=o.children("a.prev"),r=o.children("a.next");if(a.length>4){o.addClass("enabled"),a.css({display:"block"}),t.on("resize",function(){i.css({height:a.eq(0).height()})}).trigger("resize");var l=i.swiper({slidesPerView:4,slidesPerGroup:4,calculateHeight:!0,speed:500,mode:"horizontal",loop:!1,simulateTouch:!1,onInit:function(){s.addClass("disabled")},onSlideChangeStart:function(e){0==e.activeIndex?(s.hasClass("disabled")||s.addClass("disabled"),r.hasClass("disabled")&&r.removeClass("disabled")):e.activeIndex==e.slides.length-4?(r.hasClass("disabled")||r.addClass("disabled"),s.hasClass("disabled")&&s.removeClass("disabled")):(s.hasClass("disabled")&&s.removeClass("disabled"),r.hasClass("disabled")&&r.removeClass("disabled"))}});s.on("click",function(){return e(this).hasClass("disabled")||l.swipePrev(),!1}),r.on("click",function(){return e(this).hasClass("disabled")||l.swipeNext(),!1})}});var a={padding:0,fitToView:!1};e("a.pw-open").fancybox(a),e("input[placeholder], textarea[placeholder]").placeholder(),i.on("focus",'form.pw-form input[type="text"], form.pw-form input[type="password"]',function(){var t=e(this),i=t.closest(".pwf-line"),n=i.find("div.msg-help"),a=i.find("div.msg-error"),o=e(this).parent().parent().parent().find(".mf-error");a.parent().remove(),o.parent().remove(),n.is(":hidden")&&n.fadeIn(300)}),i.on("blur",'form.pw-form input[type="text"], form.pw-form input[type="password"]',function(){var t=e(this),i=t.closest(".pwf-line"),n=i.find("div.msg-help");n.is(":visible")&&n.fadeOut(300)});var o={scrollInertia:200,contentTouchScroll:!0,scrollButtons:{enable:!1},advanced:{updateOnContentResize:!0}};e("div.scroll-container").each(function(){var t=e(this);t.mCustomScrollbar(o)}),e("#subscribe-sm").each(function(){var t=e(this),i=t.find("a");i.on("click",function(){var t=(e(this),i.index(this)),n=e("#pw-subscribe");e.fancybox(n,a);var o=n.find("ul.tabs > li");return o.eq(t).trigger("click"),!1})}),e("ul.tabs > li").on("click",function(){var t=e(this),i=t.closest("ul"),n=i.children("li").index(this),a=i.siblings(".tabs-content"),o=t.find("a"),s=t.closest("#pw-subscribe");if(!t.hasClass("active")){s.length&&(a=s.find(".tabs-content"));var r=i.children("li.active"),l=a.find("li.active"),c=a.children("li").eq(n);r.removeClass("active"),l.removeClass("active"),t.addClass("active"),c.addClass("active")}return o.blur(),closeSelectBox(),!1}),e("#cli-pg").each(function(){var t=e(this),i=t.find("a");i.on({mouseenter:function(){var t=e(this),i=t.find(".pg-title");i.stop(!0,!0).slideDown(300,function(){i.css({display:"block"})})},mouseleave:function(){var t=e(this),i=t.find(".pg-title");i.stop(!0,!0).slideUp(300)}})}),e("#map-canvas").each(function(){var t=e(this);t.is(":hidden")||(google.maps.event.addDomListener(window,"load",mapInit),t.data("init",!0))}),e("a.toggle-map").on({click:function(){{var t=e(this),i=t.closest(".i-address"),n=i.children(".i-map"),a=e("#map-canvas");i.find("header a.toggle-map")}return n.is(":hidden")?n.stop(!0,!0).animate({opacity:"show",height:"show"},300,function(){a.data("init")||(mapInit(),a.data("init",!0)),i.addClass("map-opened")}):n.stop(!0,!0).animate({opacity:"hide",height:"hide"},300,function(){i.removeClass("map-opened")}),!1}}),e("ul.messages-list").each(function(){var t=e(this),i=t.children("li");i.on({mouseenter:function(){var t=e(this),i=t.find("div.mi-buttons");i.stop(!0,!0).animate({opacity:"show",height:"show"},250)},mouseleave:function(){var t=e(this),i=t.find("div.mi-buttons");i.stop(!0,!0).animate({opacity:"hide",height:"hide"},250)}})}),e(".set-sect > header").on("click",function(){var t=e(this),i=t.closest(".set-sect"),n=i.children("div.set-sect-body");n.is(":visible")?n.stop(!0,!0).animate({height:"hide",opacity:"hide"},300,function(){i.addClass("closed")}):n.stop(!0,!0).animate({height:"show",opacity:"show"},300,function(){i.removeClass("closed")})}),e('input[type="checkbox"].annoncesFlag').each(function(){var t=e(this);t.on("change",function(){var e=t.closest("div.mf-announces").children("div.mf-announces-body"),i=e.find("input, select, textarea"),n=e.find("div.c-select-box");t.prop("checked")?(e.removeClass("disabled"),n.removeClass("disabled"),i.prop("disabled",!1)):(e.addClass("disabled"),n.addClass("disabled"),i.prop("disabled",!0))}).trigger("change")}),e("a.icb-edit-profile").on("click",function(){var t=e(this),i=t.next("a.icb-exit-edit"),n=e("div.p-editable");return t.css({display:"none"}),i.css({display:"inline-block"}),n.addClass("pe-active"),!1}),e("a.icb-exit-edit").on("click",function(){var t=e(this),i=t.prev("a.icb-edit-profile"),n=e("div.p-editable");return i.css({display:"inline-block"}),t.css({display:"none"}),n.removeClass("pe-active"),!1}),e("a.e-btn").on("click",function(){var t=e(this),i=t.closest(".edit-wrap"),n=t.closest(".p-editable"),a=i.children(".e-form"),o=a.find("a.ef-close"),s=e(".p-editable.pe-current").not(n);return s.each(function(){e(this).removeClass("pe-current")}),n.toggleClass("pe-current"),o.one("click",function(){return n.removeClass("pe-current"),!1}),e(document).one("click",function(t){var i=e(t.target);i.parents().filter(".e-form").length<1&&n.removeClass("pe-current")}),!1}),e("a.eps-open").on("click",function(){var t=e(this),i=t.closest(".ep-sect"),n=i.children("div.ep-sect-body");return i.hasClass("eps-opened")?n.stop().animate({height:"hide",opacity:"hide"},300,function(){i.removeClass("eps-opened")}):n.stop().animate({height:"show",opacity:"show"},300,function(){i.addClass("eps-opened")}),!1}),e("div.calendar-container").each(function(){var t=e(this),i=e.extend(o,{horizontalScroll:!0});t.mCustomScrollbar(i)}),e('input[type="file"]').each(function(){var t=e(this),i=t.closest(".input-file"),n=i.children(".file-text");""!=t.val()?(n.text(t.val()),n.removeClass("placeholder")):(n.text(n.data("placeholder")),n.addClass("placeholder")),t.on({change:function(){""!=t.val()?(n.text(t.val()),n.removeClass("placeholder")):(n.text(n.data("placeholder")),n.addClass("placeholder"))}})}),e("form > div.afs-type").each(function(){function t(){var e=n.filter(":checked").length>0,t=a.find("input, select, textarea, button"),i=a.find("div.c-select-box");e?(a.removeClass("disabled"),i.removeClass("disabled"),t.prop("disabled",!1)):(a.addClass("disabled"),i.addClass("disabled"),t.prop("disabled",!0))}var i=e(this),n=i.find('input[type="radio"]'),a=n.closest("form").children("div.adm-form-body");t(),n.on("change",t)}),e("form.af-statistic div.mf-stat").each(function(){var t=e(this),i=t.children(".mf-stat-add-button"),n=i.find("a.icon-add");n.on("click",function(){var n=t.children(".mf-stat-item"),a=n.length,o=n.eq(0).find("select").eq(0).find("option").length-1,s=n.eq(0).clone(),r=s.find("select"),l=s.find("input");return l.val(""),r.each(function(){var t=e(this),i=t.closest(".custom-select"),n=t.clone();n.insertAfter(i),n.customSelect(),i.remove()}),s.insertBefore(i),a==o-1&&i.hide(),!1})}),e('input[type="checkbox"].w-time-switcher').each(function(){function t(){var t=n.find("div.w-time"),a=t.eq(0),o=a.find("select");t.each(function(t){var i=e(this);if(0!=t)for(var n=i.find("select"),a=1;a");o.val(n(t)).text(n(t)),i.html(o);for(var s=1;u>s;s++){var l=o.clone();t.setDate(t.getDate()+1),l.val(n(t)).text(n(t)),i.append(l)}i.prop("selectedIndex",0),a.length&&(i.insertAfter(a),a.remove()),i.customSelect()});for(var f=1;u>f;f++){var g=a.clone(),m=g.find("select");g.children("label.check").remove(),m.each(function(t){var i=e(this),n=i.closest(".custom-select");i.insertAfter(n),0==t?i.prop("selectedIndex",f):h.prop("checked")&&i.prop("selectedIndex",p.eq(t).prop("selectedIndex")),n.remove(),i.customSelect()}),c.append(g)}}var a=e(this),o=a.find("input.dateFrom"),s=a.find("input.dateTo"),r=new Date,l=new Date,c=e("#work-time");o.on("change",function(){i()}),s.on("change",function(){i()}),i()}),e("div.request-form").each(function(){{var t=e(this),i=t.find("div.rq-btn-to-hide"),n=i.find("a"),a=t.find("div.rq-form"),o=t.find("div.rq-to-hide");a.find("div.rq-btn-wrap")}n.on("click",function(){return o.hide(),a.animate({height:"show",opacity:"show"},300,function(){t.addClass("rqf-opened")}),!1})}),e("form div.rq-switch").each(function(){function t(){var e=o.find("input, select"),t=o.find("div.c-select-box");n.prop("checked")?(o.removeClass("disabled"),t.removeClass("disabled"),e.prop("disabled",!1)):(o.addClass("disabled"),t.addClass("disabled"),e.prop("disabled",!0))}var i=e(this),n=i.find('input[type="checkbox"]'),a=i.closest(".rq-sub-sect"),o=a.children(".rq-sub-sect-body");t(),n.on("change",t)}),e("a.reply-msg").on("click",function(){var t=e(this).attr("data-sender"),i=e(this).attr("data-reply-message"),n=e("#pw-reply");n.find("#id_recipient").val(t),n.find("#reply_message").val(i)})})}(jQuery),$(document).ready(function(){$("ul.about_block_menu li.m_01").click(function(){return $(this).parents("ul").find("li").removeClass("active"),$(this).addClass("active"),$(this).parents("ul").removeClass("about_active"),$("div.about_block").removeClass("about_show"),$("div.team_about_block").addClass("about_show"),$("div.parnters_about_block").removeClass("about_show"),$("div.contacts_about_block").removeClass("about_show"),$("div.review_about_block").removeClass("about_show"),$("div.team_about_block_text").addClass("about_show"),$("div.parnters_about_block_text").removeClass("about_show"),$("div.contacts_about_block_text").removeClass("about_show"),$("div.review_about_block_text").removeClass("about_show"),!1}),$("ul.about_block_menu li.m_02").click(function(){return $(this).parents("ul").find("li").removeClass("active"),$(this).addClass("active"),$(this).parents("ul").removeClass("about_active"),$("div.about_block").removeClass("about_show"),$("div.team_about_block").removeClass("about_show"),$("div.parnters_about_block").addClass("about_show"),$("div.contacts_about_block").removeClass("about_show"),$("div.review_about_block").removeClass("about_show"),$("div.team_about_block_text").removeClass("about_show"),$("div.parnters_about_block_text").addClass("about_show"),$("div.contacts_about_block_text").removeClass("about_show"),$("div.review_about_block_text").removeClass("about_show"),!1}),$("ul.about_block_menu li.m_03").click(function(){return $(this).parents("ul").find("li").removeClass("active"),$(this).addClass("active"),$(this).parents("ul").removeClass("about_active"),$("div.about_block").removeClass("about_show"),$("div.team_about_block").removeClass("about_show"),$("div.parnters_about_block").removeClass("about_show"),$("div.contacts_about_block").addClass("about_show"),$("div.review_about_block").removeClass("about_show"),$("div.team_about_block_text").removeClass("about_show"),$("div.parnters_about_block_text").removeClass("about_show"),$("div.contacts_about_block_text").addClass("about_show"),$("div.review_about_block_text").removeClass("about_show"),!1}),$("ul.about_block_menu li.m_04").click(function(){return $(this).parents("ul").find("li").removeClass("active"),$(this).addClass("active"),$(this).parents("ul").removeClass("about_active"),$("div.about_block").removeClass("about_show"),$("div.team_about_block").removeClass("about_show"),$("div.parnters_about_block").removeClass("about_show"),$("div.contacts_about_block").removeClass("about_show"),$("div.review_about_block").addClass("about_show"),$("div.team_about_block_text").removeClass("about_show"),$("div.parnters_about_block_text").removeClass("about_show"),$("div.contacts_about_block_text").removeClass("about_show"),$("div.review_about_block_text").addClass("about_show"),!1}),$("ul.about_block_menu li.m_05").click(function(){return $(this).parents("ul").find("li").removeClass("active"),$(this).parents("ul").addClass("about_active"),$("div.about_block").addClass("about_show"),$("div.team_about_block").removeClass("about_show"),$("div.parnters_about_block").removeClass("about_show"),$("div.contacts_about_block").removeClass("about_show"),$("div.review_about_block").removeClass("about_show"),$("div.team_about_block_text").removeClass("about_show"),$("div.parnters_about_block_text").removeClass("about_show"),$("div.contacts_about_block_text").removeClass("about_show"),$("div.review_about_block_text").removeClass("about_show"),!1}),$("div.ht-main_1").each(function(){$(this).width($("div.serv-links").width())}),$(window).resize(function(){$("div.ht-main_1").each(function(){$(this).width($("div.serv-links").width())})}),$("a.small_link").click(function(){return $("#large img").hide().attr({src:$(this).attr("href"),title:$("> img",this).attr("title")}),!1}),$("#large>img").load(function(){$("#large>img:hidden").fadeIn("slow")}),setTimeout(function(){$("a.subscribe_link").click()},3e3),$(".subscribe_success").click(function(){return $("div.subscribe_before").hide(),$("div.subscribe_after").show(),setTimeout(function(){$("a.fancybox-close").click()},2e3),!1});var e=$("div.subjects_list ul li").length,t=e-5;$("div.subjects_list ul li:gt(4)").hide(),$("div.subjects_list span i").text(t),e>5&&$("div.subjects_list").addClass("more"),$("div.subjects_list span").click(function(){return $(this).parents("div.subjects_list").removeClass("more"),$(this).parents("div.subjects_list").find("li").show(),!1})}); \ No newline at end of file