From fee508aa8b760bda2c784fd45e3bd43e2438c2dc Mon Sep 17 00:00:00 2001 From: Alexander Burdeiny Date: Mon, 8 Aug 2016 16:12:52 +0300 Subject: [PATCH] =?UTF-8?q?1461:=20=D0=AD=D1=82=D0=B0=D0=BF=20=E2=84=965:?= =?UTF-8?q?=20=D0=A4=D0=B8=D0=BB=D1=8C=D1=82=D1=80=D0=B0=D1=86=D0=B8=D1=8F?= =?UTF-8?q?=20=D1=81=D0=BE=D0=B1=D1=8B=D1=82=D0=B8=D0=B9=20=D0=B8=D0=B7?= =?UTF-8?q?=D0=BC=D0=B5=D0=BD=D0=B5=D0=BD=D0=B8=D1=8F=20=D1=84=D1=80=D0=BE?= =?UTF-8?q?=D0=BD=D1=82=D0=B5=D0=BD=D0=B4=D0=B0=20=D0=B4=D0=BB=D1=8F=20?= =?UTF-8?q?=D1=84=D0=B8=D0=BB=D1=8C=D1=82=D1=80=D0=B0=D1=86=D0=B8=D0=B8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- events/forms.py | 3 ++- package.json | 19 ++++++++++--------- static/client/js/scripts.js | 11 +++++++---- static/client/js/vendor.js | 11 +++++++---- static/client/js_min/vendor.min.js | 2 +- templates/client/base_catalog.html | 4 +++- 6 files changed, 30 insertions(+), 20 deletions(-) diff --git a/events/forms.py b/events/forms.py index 52c78e87..d0d13815 100644 --- a/events/forms.py +++ b/events/forms.py @@ -202,6 +202,7 @@ class FilterForm(forms.Form): self._related_fields.append('tag') self._lookup_kwargs['tag__in'] = d.get('tag') if d.get('country'): + self._related_fields.append('country') self._lookup_kwargs['country_id__in'] = d.get('country') if d.get('city'): self._related_fields.append('city') @@ -263,7 +264,7 @@ class FilterForm(forms.Form): qs.query.having.add(ExtraWhere(having, [], OR), AND) qs = qs.values(*values).order_by(*order_by) self.fields[field].queryset = qs - # print(self.fields[field].queryset.query) + print(self.fields[field].queryset.query) for field in ['members', 'visitors', 'price']: self.fields[field].choices = self.make_local_field_count(field) or self.fields[field].choices diff --git a/package.json b/package.json index 0a7def19..3c7bb660 100644 --- a/package.json +++ b/package.json @@ -8,19 +8,20 @@ }, "devDependencies": { "connect": "~3.4.0", + "gulp": "^3.9.1", + "gulp-autoprefixer": "~3.0.2", + "gulp-cli": "^1.2.2", "gulp-concat": "~2.6.0", - "gulp-livereload": "~3.8.1", - "gulp": "~3.9.0", - "gulp-stylus": "~2.1.0", - "gulp-uglify": "~1.4.1", - "gulp-jade": "~1.1.0", - "gulp-imagemin": "~2.3.0", + "gulp-cssmin": "~0.1.7", "gulp-csso": "~1.0.0", + "gulp-imagemin": "~2.3.0", + "gulp-jade": "~1.1.0", + "gulp-livereload": "~3.8.1", "gulp-myth": "~1.0.3", + "gulp-newer": "~0.5.1", "gulp-rename": "~1.2.2", - "gulp-autoprefixer": "~3.0.2", - "gulp-cssmin": "~0.1.7", - "gulp-newer": "~0.5.1" + "gulp-stylus": "~2.1.0", + "gulp-uglify": "~1.4.1" }, "scripts": { "test": "echo \"Error: no test specified\" && exit 1" diff --git a/static/client/js/scripts.js b/static/client/js/scripts.js index 92c18abd..a6db756c 100644 --- a/static/client/js/scripts.js +++ b/static/client/js/scripts.js @@ -95,7 +95,7 @@ $(document).ready(function () { $this.find('.fa').toggleClass('fa-caret-down fa-caret-up'); }); - $('.filter_form').on('change', 'input[type="checkbox"]', function(event) { + $('#filter_form_wraper').on('change', 'input[type="checkbox"]', function(event) { event.preventDefault(); var $form = $('.filter_form'), params = $form.serialize(), @@ -109,13 +109,16 @@ $(document).ready(function () { data: $form.serialize(), }) .done(function(data) { - $('.page-body').html(data); - $loader.hide(); + if (data.success) { + $('.page-body').html(data.results); + $('#filter_form_wraper').html(data.form); + $loader.hide(); + } }) }); - $('.filter_form_clear_all').on('click', function(event) { + $('#filter_form_wraper').on('click', '.filter_form_clear_all', function(event) { event.preventDefault(); $('.filter_form input').prop('checked', false); diff --git a/static/client/js/vendor.js b/static/client/js/vendor.js index fa9541c1..7ad4356f 100644 --- a/static/client/js/vendor.js +++ b/static/client/js/vendor.js @@ -5012,7 +5012,7 @@ $(document).ready(function () { $this.find('.fa').toggleClass('fa-caret-down fa-caret-up'); }); - $('.filter_form').on('change', 'input[type="checkbox"]', function(event) { + $('#filter_form_wraper').on('change', 'input[type="checkbox"]', function(event) { event.preventDefault(); var $form = $('.filter_form'), params = $form.serialize(), @@ -5026,13 +5026,16 @@ $(document).ready(function () { data: $form.serialize(), }) .done(function(data) { - $('.page-body').html(data); - $loader.hide(); + if (data.success) { + $('.page-body').html('appended' + data.results); + $('#filter_form_wraper').html('appended' + data.form); + $loader.hide(); + } }) }); - $('.filter_form_clear_all').on('click', function(event) { + $('#filter_form_wraper').on('click', '.filter_form_clear_all', function(event) { event.preventDefault(); $('.filter_form input').prop('checked', false); diff --git a/static/client/js_min/vendor.min.js b/static/client/js_min/vendor.min.js index 8f33e255..78de0653 100644 --- a/static/client/js_min/vendor.min.js +++ b/static/client/js_min/vendor.min.js @@ -4,4 +4,4 @@ if(h.maximumInputLength&&c.val().length>h.maximumInputLength)return void a(_(h.f 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,i){!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(i){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(e){h=!0}).bind("touchend."+n+" pointerup."+n+" MSPointerUp."+n,function(e){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)-c*(.9*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)-c*(.9*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(n){var a=i(t.activeElement),s=r.find(".mCustomScrollBox").length,c=0;a.is(o.advanced.autoScrollOnFocus)&&(p._stop(e),clearTimeout(e[0]._focusTimeout),e[0]._focusTimer=s?(c+17)*s:0,e[0]._focusTimeout=setTimeout(function(){var t=[a.offset().top-r.offset().top,a.offset().left-r.offset().left],i=[r[0].offsetTop,r[0].offsetLeft],n=[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)-f*(.9*d.width());else var g="y",m=Math.abs(c[0].offsetTop)-f*(.9*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){"use strict";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)&&e.indexOf("%")>0},f=function(e){return e&&!(e.style.overflow&&"hidden"===e.style.overflow)&&(e.clientWidth&&e.scrollWidth>e.clientWidth||e.clientHeight&&e.scrollHeight>e.clientHeight)},g=function(e,t){var i=parseInt(e,10)||0;return t&&p(e)&&(i=r.getViewport()[t]/100*i),Math.ceil(i)},m=function(e,t){return g(e,t)+"px"};i.extend(r,{version:"2.1.5",defaults:{padding:15,margin:20,width:800,height:600,minWidth:100,minHeight:100,maxWidth:9999,maxHeight:9999,pixelRatio:1,autoSize:!0,autoHeight:!1,autoWidth:!1,autoResize:!0,autoCenter:!d,fitToView:!0,aspectRatio:!1,topRatio:.5,leftRatio:.5,scrolling:"auto",wrapCSS:"",arrows:!0,closeBtn:!0,closeClick:!1,nextClick:!1,mouseWheel:!0,autoPlay:!1,playSpeed:3e3,preload:3,modal:!1,loop:!0,ajax:{dataType:"html",headers:{"X-fancyBox":!0}},iframe:{scrolling:"auto",preload:!0},swf:{wmode:"transparent",allowfullscreen:"true",allowscriptaccess:"always"},keys:{next:{13:"left",34:"up",39:"left",40:"up"},prev:{8:"right",33:"down",37:"right",38:"down"},close:[27],play:[32],toggle:[70]},direction:{next:"left",prev:"right"},scrollOutside:!0,index:0,type:null,href:null,content:null,title:null,tpl:{wrap:'
',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,g,m={};"object"===i.type(o)&&(o.nodeType&&(o=i(o)),h(o)?(m={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,m,o.metadata())):m=o),s=t.href||m.href||(u(o)?o:null),l=t.title!==n?t.title:m.title||"",c=t.content||m.content,d=c?"html":t.type||m.type,!d&&m.isDom&&(d=o.data("fancybox-type"),d||(p=o.prop("class").match(/fancybox\.(\w+)/),d=p?p[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&&(f=s.split(/\s+/,2),s=f.shift(),g=f.shift())),c||("inline"===d?s?c=i(u(s)?s.replace(/.*(?=#[^\s]+$)/,""):s):m.isDom&&(c=o):"html"===d?c=s:d||s||!m.isDom||(d="inline",c=o)),i.extend(m,{href:s,type:d,content:c,title:l,selector:g}),e[a]=m}),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&&e!==!0?(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")},a=function(){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,e&&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 t.group.length>1&&s[o]!==n?(r[e](s[o]),a.preventDefault(),!1):i.inArray(o,s)>-1?(r[e](),a.preventDefault(),!1):void 0}))}),i.fn.mousewheel&&t.mouseWheel&&r.wrap.bind("mousewheel.fb",function(e,n,a,o){for(var s=e.target||null,l=i(s),c=!1;l.length&&!(c||l.is(".fancybox-skin")||l.is(".fancybox-wrap"));)c=f(l[0]),l=i(l).parent();0===n||c||r.group.length>1&&!t.canShrink&&(o>0||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))),n===!1)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,o,s,l={};if(e=g(e),t=r.group[e]||null,!t)return!1;if(l=i.extend(!0,{},r.opts,t),o=l.margin,s=l.padding,"number"===i.type(o)&&(l.margin=[o,o,o,o]),"number"===i.type(s)&&(l.padding=[s,s,s,s]),l.modal&&i.extend(!0,l,{closeBtn:!1,closeClick:!1,nextClick:!1,arrows:!1,mouseWheel:!1,keys:null,helpers:{overlay:{closeClick:!1}}}),l.autoSize&&(l.autoWidth=l.autoHeight=!0),"auto"===l.width&&(l.autoWidth=!0),"auto"===l.height&&(l.autoHeight=!0),l.group=r.group,l.index=e,r.coming=l,!1===r.trigger("beforeLoad"))return void(r.coming=null);if(a=l.type,n=l.href,!a)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"===a||"swf"===a)&&(l.autoHeight=l.autoWidth=!1,l.scrolling="visible"),"image"===a&&(l.aspectRatio=!0),"iframe"===a&&d&&(l.scrolling="scroll"),l.wrap=i(l.tpl.wrap).addClass("fancybox-"+(d?"mobile":"desktop")+" fancybox-type-"+a+" fancybox-tmp "+l.wrapCSS).appendTo(l.parent||"body"),i.extend(l,{skin:i(".fancybox-skin",l.wrap),outer:i(".fancybox-outer",l.wrap),inner:i(".fancybox-inner",l.wrap)}),i.each(["Top","Right","Bottom","Left"],function(e,t){l.skin.css("padding"+t,m(l.padding[e]))}),r.trigger("onReady"),"inline"===a||"html"===a){if(!l.content||!l.content.length)return r._error("content")}else if(!n)return r._error("href");"image"===a?r._loadImage():"ajax"===a?r._loadAjax():"iframe"===a?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,e.complete!==!0&&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,l=r.coming,c=r.current,d="fancybox-placeholder";if(r.hideLoading(),l&&r.isActive!==!1){if(!1===r.trigger("afterLoad",l,c))return l.wrap.stop(!0).trigger("onReset").remove(),void(r.coming=null);switch(c&&(r.trigger("beforeChange",c),c.wrap.stop(!0).removeClass("fancybox-opened").find(".fancybox-item, .fancybox-nav").remove()),r.unbindEvents(),e=l,t=l.content,n=l.type,a=l.scrolling,i.extend(r,{wrap:e.wrap,skin:e.skin,outer:e.outer,inner:e.inner,current:e,previous:c}),o=e.href,n){case"inline":case"ajax":case"html":e.selector?t=i("
").html(t).find(e.selector):h(t)&&(t.data(d)||t.data(d,i('
').insertAfter(t).hide()),t=t.show().detach(),e.wrap.bind("onReset",function(){i(this).find(t).length&&t.hide().replaceAll(t.data(d)).data(d,!1)}));break;case"image":t=e.tpl.image.replace("{href}",o);break;case"swf":t='',s="",i.each(e.swf,function(e,i){t+='',s+=" "+e+'="'+i+'"'}),t+='"}h(t)&&t.parent().is(e.inner)||e.inner.append(t),r.trigger("beforeShow"),e.inner.css("overflow","yes"===a?"scroll":"no"===a?"hidden":a),r._setDimension(),r.reposition(),r.isOpen=!1,r.coming=null,r.bindEvents(),r.isOpened?c.prevMethod&&r.transitions[c.prevMethod]():i(".fancybox-wrap").not(e.wrap).stop(!0).trigger("onReset").remove(),r.transitions[r.isOpened?e.nextMethod:e.openMethod](),r._preloadImages()}},_setDimension:function(){var e,t,n,a,o,s,l,c,d,h,u,f,v,w,b,x=r.getViewport(),y=0,C=!1,S=!1,_=r.wrap,T=r.skin,k=r.inner,E=r.current,M=E.width,P=E.height,I=E.minWidth,L=E.minHeight,O=E.maxWidth,B=E.maxHeight,A=E.scrolling,D=E.scrollOutside?E.scrollbarWidth:0,R=E.margin,W=g(R[1]+R[3]),H=g(R[0]+R[2]);if(_.add(T).add(k).width("auto").height("auto").removeClass("fancybox-tmp"),e=g(T.outerWidth(!0)-T.width()),t=g(T.outerHeight(!0)-T.height()),n=W+e,a=H+t,o=p(M)?(x.w-n)*g(M)/100:M,s=p(P)?(x.h-a)*g(P)/100:P,"iframe"===E.type){if(w=E.content,E.autoHeight&&1===w.data("ready"))try{w[0].contentWindow.document.location&&(k.width(o).height(9999),b=w.contents().find("body"),D&&b.css("overflow-x","hidden"),s=b.outerHeight(!0))}catch(N){}}else(E.autoWidth||E.autoHeight)&&(k.addClass("fancybox-tmp"),E.autoWidth||k.width(o),E.autoHeight||k.height(s),E.autoWidth&&(o=k.width()),E.autoHeight&&(s=k.height()),k.removeClass("fancybox-tmp"));if(M=g(o),P=g(s),d=o/s,I=g(p(I)?g(I,"w")-n:I),O=g(p(O)?g(O,"w")-n:O),L=g(p(L)?g(L,"h")-a:L),B=g(p(B)?g(B,"h")-a:B),l=O,c=B,E.fitToView&&(O=Math.min(x.w-n,O),B=Math.min(x.h-a,B)),f=x.w-W,v=x.h-H,E.aspectRatio?(M>O&&(M=O,P=g(M/d)),P>B&&(P=B,M=g(P*d)),I>M&&(M=I,P=g(M/d)),L>P&&(P=L,M=g(P*d))):(M=Math.max(I,Math.min(M,O)),E.autoHeight&&"iframe"!==E.type&&(k.width(M),P=k.height()),P=Math.max(L,Math.min(P,B))),E.fitToView)if(k.width(M).height(P),_.width(M+e),h=_.width(),u=_.height(),E.aspectRatio)for(;(h>f||u>v)&&M>I&&P>L&&!(y++>19);)P=Math.max(L,Math.min(B,P-10)),M=g(P*d),I>M&&(M=I,P=g(M/d)),M>O&&(M=O,P=g(M/d)),k.width(M).height(P),_.width(M+e),h=_.width(),u=_.height();else M=Math.max(I,Math.min(M,M-(h-f))),P=Math.max(L,Math.min(P,P-(u-v)));D&&"auto"===A&&s>P&&f>M+e+D&&(M+=D),k.width(M).height(P),_.width(M+e),h=_.width(),u=_.height(),C=(h>f||u>v)&&M>I&&P>L,S=E.aspectRatio?l>M&&c>P&&o>M&&s>P:(l>M||c>P)&&(o>M||s>P),i.extend(E,{dim:{width:m(h),height:m(u)},origWidth:o,origHeight:s,canShrink:C,canExpand:S,wPadding:e,hPadding:t,wrapSpace:u-T.outerHeight(!0),skinSpace:T.height()-P}),!w&&E.autoHeight&&P>L&&B>P&&!S&&k.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],s={position:"absolute",top:n[0],left:n[3]};return t.autoCenter&&t.fixed&&!e&&o<=i.h&&a<=i.w?s.position="fixed":t.locked||(s.top+=i.y,s.left+=i.x),s.top=m(Math.max(s.top,s.top+(i.h-o)*t.topRatio)),s.left=m(Math.max(s.left,s.left+(i.w-a)*t.leftRatio)),s},_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&&r.group.length>1)&&r.inner.css("cursor","pointer").bind("click.fb",function(t){i(t.target).is("a")||i(t.target).parent().is("a")||(t.preventDefault(),r[e.closeClick?"close":"next"]())}),e.closeBtn&&i(e.tpl.closeBtn).appendTo(r.skin).bind("click.fb",function(e){e.preventDefault(),r.close()}),e.arrows&&r.group.length>1&&((e.loop||e.index>0)&&i(e.tpl.prev).appendTo(r.outer).bind("click.fb",r.prev),(e.loop||e.index
').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),e.showEarly===!0&&this.beforeShow.apply(this,arguments)},beforeShow:function(e,t){var n,a;t.locked&&(this.margin!==!1&&(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,n,a=r.current,o=a.title,s=e.type;if(i.isFunction(o)&&(o=o.call(a.element,a)),u(o)&&""!==i.trim(o)){switch(t=i('
'+o+"
"),s){case"inside":n=r.skin;break;case"outside":n=r.wrap;break;case"over":n=r.inner;break;default:n=r.skin,t.appendTo("body"),l&&t.width(t.width()),t.wrapInner(''),r.current.margin[2]+=Math.abs(g(t.css("margin-bottom")))}t["top"===e.position?"prependTo":"appendTo"](n)}}},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,r.open(c,e)!==!1&&o.preventDefault())};return e=e||{},t=e.index||0,a&&e.live!==!1?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;i.scrollbarWidth===n&&(i.scrollbarWidth=function(){var e=i('
').appendTo("body"),t=e.children(),n=t.innerWidth()-t.height(99).innerWidth();return e.remove(),n}),i.support.fixedPosition===n&&(i.support.fixedPosition=function(){var e=i('
').appendTo("body"),t=20===e[0].offsetTop||15===e[0].offsetTop;return e.remove(),t}()),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):i.message?alert(i.message):alert(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(t,i){var n=(e(this),e(this).position()),a=n.left,o=n.top;e("#expoTagBoxForm")&&e("#expoTagBoxForm").css({top:o,left:a+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(t,i){e("#expoTagBoxForm")&&e("#expoTagBoxForm").css({display:"none"})},g=function(t,i){var n=(e(this),e(this).position()),a=n.left,o=n.top;e("#expoTagBoxForm")&&e("#expoTagBoxForm").css({display:"block",top:o,left:a+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,i){var n={width:t.tag.defaultWidth,height:t.tag.defaultHeight},a={top:e.height()/2-n.height/2,left:e.width()/2-n.width/2};l.expoId++;var o=b("expo",n,a,1);return o},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=$.extend({fade:!1,top:!1,container:null,empty:!1,html:!1,callback:null},i),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){var t=dna.ui.toElem(e,this);return dna.core.remove(t),t},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()},smoothMove:function(e,t){function i(){var i=n.clone();t?e.after(n.hide()).before(i):e.before(n.hide()).after(i),dna.ui.slideFadeIn(n),dna.ui.slideFadeDelete(i)}var n=t?e.prev():e.next();n.length&&i()},focus:function(e){return e.focus()}},dna.placeholder={setup:function(){function e(){var e=$(this).stop();return dna.getClones(e.data().placeholder).length?e.fadeOut():e.fadeIn()}$("[data-placeholder]").each(e)}},$(dna.placeholder.setup),dna.pageToken={put:function(e,t){return sessionStorage[e+window.location.pathname]=JSON.stringify(t),t},get:function(e,t){var i=sessionStorage[e+window.location.pathname];return void 0===i?t:JSON.parse(i)}},dna.panels={key:function(e){return"#"+e.attr("id")+"-panels"},display:function(e,t,i){function n(){dna.pageToken.put(s,t),i&&o.data().hash&&window.history.pushState(null,null,"#"+o.data().hash)}var a,o,s=dna.panels.key(e),r=e.find(".menu-item");void 0===t&&(t=dna.pageToken.get(s,0)),t=Math.max(0,Math.min(t,r.length-1)),r.removeClass("selected").eq(t).addClass("selected"),a=$(s).children().hide().removeClass("displayed"),o=a.eq(t).fadeIn().addClass("displayed"),n(),dna.util.apply(e.data().callback,o)},rotate:function(e){var t=$(e.target).closest(".menu-item"),i=t.closest(".dna-menu");dna.panels.display(i,i.find(".menu-item").index(t),!0)},reload:function(e){dna.panels.display($("#"+e))},refresh:function(){function e(e){return e.filter("[data-hash="+n+"]").index()}function t(e){return e.first().closest(".dna-template").length>0}function i(){var i=$(this),a=dna.panels.key(i),o=$(a).children().addClass("panel");if(0===i.find(".menu-item").length&&i.children().addClass("menu-item"),!t(o)&&!t(i.children())){var s=n&&o.first().data().hash?e(o):dna.pageToken.get(a,0);dna.panels.display(i,s)}}var n=window.location.hash.slice(1);$(".dna-menu").each(i)},setup:function(){dna.panels.refresh(),$(document).on("click",".dna-menu .menu-item",dna.panels.rotate)}},$(dna.panels.setup),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(e,t){s.push(e),e=e.replace(/^data-prop-/,"").toLowerCase(),t=t.replace(dna.compile.regexDnaBasePairs,""),a.push(e,t),"checked"===e&&n.is("input")?n.addClass("dna-update-model").data().dnaField=t:"selected"===e&&n.is("option")&&(n.parent().addClass("dna-update-model").end().data().dnaField=t)}function t(e,t){var i=t.split(dna.compile.regexDnaBasePair);"[value]"===i[1]&&(i[1]=!0),o.push(e.replace(/^data-attr-/,""),i),s.push(e);var a="input:not(:checkbox, :radio)";"value"===e&&n.is(a)&&""===i[0]&&""===i[2]&&(n.addClass("dna-update-model").data().dnaField=i[1])}function i(){/^data-prop-/.test(this.name)?e(this.name,this.value):3===this.value.split(dna.compile.regexDnaBasePair).length&&t(this.name,this.value)}var n=$(this),a=[],o=[],s=[];return $.each(n.get(0).attributes,i),a.length>0&&(dna.compile.setupNucleotide(n).data().dnaRules.props=a),o.length>0&&(dna.compile.setupNucleotide(n).data().dnaRules.attrs=o),n.data().transform&&(dna.compile.setupNucleotide(n).data().dnaRules.transform=n.data().transform),n.data().callback&&(dna.compile.setupNucleotide(n).data().dnaRules.callback=n.data().callback),n.removeAttr(s.join(" "))},getDataField:function(e,t){return $.trim(e.data(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-"+t+"]").each(n).removeAttr("data-"+t)},separators:function(e){function t(){return 3===this.nodeType&&!/\S/.test(this.nodeValue)}function i(e,i,n){i&&(e.contents().last().filter(t).remove(),e.append($("").addClass(n).html(i)))}function n(){var e=$(this);i(e,e.data().separator,"dna-separator"),i(e,e.data().lastSeparator,"dna-last-separator")}e.find(".dna-template, .dna-sub-clone").addBack().each(n)},template:function(e){function t(){$(this).data().dnaRules={template:$(this).attr("id")}}function i(){$(this).attr("type",$(this).data().attrType)}var n=$("#"+e);n.length||dna.core.berserk("Template not found: "+e),n.find(".dna-template").addBack().each(t).removeAttr("id");var a=n.find("*").addBack();return a.filter(dna.compile.isDnaField).each(dna.compile.field),dna.compile.rules(a,"array").addClass("dna-sub-clone"),dna.compile.rules(a,"class",!0),dna.compile.rules(a,"require"),dna.compile.rules(a,"missing"),dna.compile.rules(a,"truthy"),dna.compile.rules(a,"falsey"),dna.compile.rules(a.filter("select"),"option").addClass("dna-update-model"),a.each(dna.compile.propsAndAttrs),dna.compile.separators(n),$("input[data-attr-type]").each(i),dna.store.stash(n)}},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,separators:e.find(".dna-separator, .dna-last-separator").length,index:e.index(),elemsAbove:e.index()>0,elemsBelow:e.nextAll().length>0,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().addClass("dna-array")).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-sub-clone").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().onLoad,[$(this),t])}var n="[data-on-load]",a=e?e.find(n).addBack(n):$(n);return a.not(".dna-initialized").each(i).addClass("dna-initialized")},runInitializers:function(e,t){function i(){var t=this.selector?e.find(this.selector).addBack(this.selector):e;dna.util.apply(this.func,[t.addClass("dna-initialized")].concat(this.params))}return dna.events.elementSetup(e,t),$.each(dna.events.initializers,i),e},setup:function(){function e(e,t,i){return e=e.closest("[data-"+t+"]"),dna.util.apply(e.data(t),[e,i])}function t(t){function i(e){return e.dnaRules&&e.dnaRules.option||e.dnaField}function n(e,t){dna.getModel(e)[i(e.data())]=t(e)}function a(e){return e.val()}function o(e){return e.is(":checked")}function s(){n($(this),o)}function r(){var e=dna.getClone(l,{main:!0});0!==e.length&&(l.is("input:checkbox")?n(l,o):l.is("input:radio")?$("input:radio[name="+l.attr("name")+"]").each(s):l.is("input")||l.data().dnaRules.option?n(l,a):l.is("select")&&l.find("option").each(s),dna.refresh(e))}var l=$(t.target);l.hasClass("dna-update-model")&&r(),e(l,t.type.replace("key","key-"),t)}function i(t){13===t.which&&e($(t.target),"enter-key",t)}function n(t){function i(){function i(){o.dnaLastUpdated=Date.now(),o.dnaTimeoutId=void 0,e(a,"smart-update",t)}var s=o.smartThrottle?Number(o.smartThrottle):n;o.dnaLastValue=a.val(),o.dnaTimeoutId||(Date.now()1&&(e.toggleClass(i[1],a),i[2]&&e.toggleClass(i[2],!a))}function c(e,i){function a(e){dna.core.inject($(this),s[e],e,n)}function o(){r.remove(),dna.clone(i.name,s,{container:e,html:n.html})}var s=dna.util.value(t,i.field),r=e.children("."+i.name.replace(/[.]/g,"\\."));s?s.length===r.length?r.each(a):o():t[i.field]=[]}function d(){var e=$(this),i=e.data().dnaRules;i.transform&&dna.util.apply(i.transform,t),i.text&&a(e,i.text),i.props&&o(e,i.props),i.attrs&&s(e,i.attrs),i["class"]&&l(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&&c(e,i.loop),i.option&&r(e,dna.util.value(t,i.option)),i.callback&&dna.util.apply(i.callback,e)}function h(e){e.filter(".dna-nucleotide").each(d),e.length&&h(e.children().not(".dna-sub-clone"))}return h(e),e.data().dnaModel=t,e},replicate:function(e,t,i,n){function a(){var t=r.children("."+e.name);t.find(".dna-separator").show().end().last().find(".dna-separator").hide(),t.find(".dna-last-separator").hide().end().eq(-2).find(".dna-last-separator").show().closest(".dna-clone").find(".dna-separator").hide()}var o=e.elem.clone(!0,!0);e.clones++,dna.core.inject(o,t,i,n);var s=".dna-contains-"+e.name.replace(/[.]/g,"\\."),r=n.container?n.container.find(s).addBack(s):e.container;return n.top&&!e.elemsAbove?r.prepend(o):n.top||e.elemsBelow?n.top?r.children().eq(e.index-1).after(o):r.children().eq(e.index+r.children().filter(".dna-clone").length).before(o):r.append(o),e.separators&&a(),dna.events.runInitializers(o,t),n.callback&&n.callback(o,t),n.fade&&dna.ui.slideFadeIn(o),o},remove:function(e){return e.remove(),dna.placeholder.setup(),e},berserk:function(e){throw"dna.js error -> "+e}},function(e){"function"==typeof define&&define.amd?define(["jquery"],e):e(jQuery)}(function(e,t){"use strict";function i(e,t){this.container=e,this.options=t,this.init()}function n(t,i){this.widget=t,this.options=e.extend({},i),this.detectService(),this.service&&this.init()}function a(e){function t(e,t){return t.toUpper()}var i={},n=e.data();for(var a in n){var o=n[a];"yes"===o?o=!0:"no"===o&&(o=!1),i[a.replace(/-(\w)/g,t)]=o}return i}function o(e,t){return s(e,t,encodeURIComponent)}function s(e,t,i){return e.replace(/\{([^\}]+)\}/g,function(e,n){return n in t?i?i(t[n]):t[n]:e})}function r(e,t){var i=h+e;return i+" "+i+"_"+t}function l(t,i){function n(s){"keydown"===s.type&&27!==s.which||e(s.target).closest(t).length||(t.removeClass(u),a.off(o,n),e.isFunction(i)&&i())}var a=e(document),o="click touchstart keydown";a.on(o,n)}function c(e){var t=10;if(document.documentElement.getBoundingClientRect){var i=parseInt(e.css("left"),10),n=parseInt(e.css("top"),10),a=e[0].getBoundingClientRect();a.leftwindow.innerWidth-t&&e.css("left",window.innerWidth-a.right-t+i),a.topwindow.innerHeight-t&&e.css("top",window.innerHeight-a.bottom-t+n)}e.addClass(u)}var d="social-likes",h=d+"__",u=d+"_opened",p="https:"===location.protocol?"https:":"http:",f={facebook:{counterUrl:"https://graph.facebook.com/fql?q=SELECT+total_count+FROM+link_stat+WHERE+url%3D%22{url}%22&callback=?",convertNumber:function(e){return e.data[0].total_count},popupUrl:"https://www.facebook.com/sharer/sharer.php?u={url}",popupWidth:600,popupHeight:359},twitter:{popupUrl:"https://twitter.com/intent/tweet?url={url}&text={title}",popupWidth:600,popupHeight:250,click:function(){return/[\.\?:\-–—]\s*$/.test(this.options.title)||(this.options.title+=":"),!0}},mailru:{counterUrl:p+"//connect.mail.ru/share_count?url_list={url}&callback=1&func=?",convertNumber:function(e){for(var t in e)if(e.hasOwnProperty(t))return e[t].shares},popupUrl:"https://connect.mail.ru/share?share_url={url}&title={title}",popupWidth:492,popupHeight:500},vkontakte:{counterUrl:"https://vk.com/share.php?act=count&url={url}&index={index}",counter:function(t,i){var n=f.vkontakte;n._||(n._=[],window.VK||(window.VK={}),window.VK.Share={count:function(e,t){n._[e].resolve(t)}});var a=n._.length;n._.push(i),e.getScript(o(t,{index:a})).fail(i.reject)},popupUrl:"https://vk.com/share.php?url={url}&title={title}",popupWidth:655,popupHeight:450},odnoklassniki:{counterUrl:p+"//connect.ok.ru/dk?st.cmd=extLike&ref={url}&uid={index}",counter:function(t,i){var n=f.odnoklassniki;n._||(n._=[],window.ODKL||(window.ODKL={}),window.ODKL.updateCount=function(e,t){n._[e].resolve(t)});var a=n._.length;n._.push(i),e.getScript(o(t,{index:a})).fail(i.reject)},popupUrl:"https://connect.ok.ru/dk?st.cmd=WidgetSharePreview&service=odnoklassniki&st.shareUrl={url}",popupWidth:580,popupHeight:336},plusone:{counterUrl:p+"//share.yandex.ru/gpp.xml?url={url}&callback=?",convertNumber:function(e){return parseInt(e.replace(/\D/g,""),10)},popupUrl:"https://plus.google.com/share?url={url}",popupWidth:500,popupHeight:550},pinterest:{counterUrl:p+"//api.pinterest.com/v1/urls/count.json?url={url}&callback=?",convertNumber:function(e){return e.count},popupUrl:"https://pinterest.com/pin/create/button/?url={url}&description={title}",popupWidth:740,popupHeight:550}},g={promises:{},fetch:function(t,i,n){g.promises[t]||(g.promises[t]={});var a=g.promises[t];if(!n.forceUpdate&&a[i])return a[i];var s=e.extend({},f[t],n),r=e.Deferred(),l=s.counterUrl&&o(s.counterUrl,{url:i});return l&&e.isFunction(s.counter)?s.counter(l,r):s.counterUrl?e.getJSON(l).done(function(t){try{var i=t;e.isFunction(s.convertNumber)&&(i=s.convertNumber(t)),r.resolve(i)}catch(n){r.reject()}}).fail(r.reject):r.reject(),a[i]=r.promise(),a[i]}};e.fn.socialLikes=function(t){return this.each(function(){var n=e(this),o=n.data(d);o?e.isPlainObject(t)&&o.update(t):(o=new i(n,e.extend({},e.fn.socialLikes.defaults,t,a(n))),n.data(d,o))})},e.fn.socialLikes.defaults={url:window.location.href.replace(window.location.hash,""),title:document.title,counters:!0,zeroes:!1,wait:500,timeout:1e4,popupCheckInterval:500,singleTitle:"Share"},i.prototype={init:function(){this.container.addClass(d),this.single=this.container.hasClass(d+"_single"),this.initUserButtons(),this.countersLeft=0,this.number=0,this.container.on("counter."+d,e.proxy(this.updateCounter,this));var t=this.container.children();this.makeSingleButton(),this.buttons=[],t.each(e.proxy(function(t,i){var a=new n(e(i),this.options);this.buttons.push(a),a.options.counterUrl&&this.countersLeft++},this)),this.options.counters?(this.timer=setTimeout(e.proxy(this.appear,this),this.options.wait),this.timeout=setTimeout(e.proxy(this.ready,this,!0),this.options.timeout)):this.appear()},initUserButtons:function(){!this.userButtonInited&&window.socialLikesButtons&&e.extend(!0,f,socialLikesButtons),this.userButtonInited=!0},makeSingleButton:function(){if(this.single){var t=this.container;t.addClass(d+"_vertical"),t.wrap(e("
      ",{"class":d+"_single-w"})),t.wrapInner(e("
      ",{"class":d+"__single-container"}));var i=t.parent(),n=e("
      ",{"class":r("widget","single")}),a=e(s('
      {title}
      ',{buttonCls:r("button","single"),iconCls:r("icon","single"),title:this.options.singleTitle}));n.append(a),i.append(n),n.on("click",function(){var e=d+"__widget_active";return n.toggleClass(e),n.hasClass(e)?(t.css({left:-(t.width()-n.width())/2,top:-t.height()}),c(t),l(t,function(){n.removeClass(e)})):t.removeClass(u),!1}),this.widget=n}},update:function(t){if(t.forceUpdate||t.url!==this.options.url){this.number=0,this.countersLeft=this.buttons.length,this.widget&&this.widget.find("."+d+"__counter").remove(),e.extend(this.options,t);for(var i=0;i",{"class":r("counter","single")}),this.widget.append(t)),t}},n.prototype={init:function(){this.detectParams(),this.initHtml(),setTimeout(e.proxy(this.initCounter,this),0)},update:function(t){e.extend(this.options,{forceUpdate:!1},t),this.widget.find("."+d+"__counter").remove(),this.initCounter()},detectService:function(){var t=this.widget.data("service");if(!t){for(var i=this.widget[0],n=i.classList||i.className.split(" "),a=0;a",{"class":this.getElementClassNames("button"),html:i.html()});if(t.clickUrl){var s=o(t.clickUrl,{url:t.url,title:t.title}),r=e("",{href:s});this.cloneDataAttrs(i,r),i.replaceWith(r),this.widget=i=r}else i.on("click",e.proxy(this.click,this));i.removeClass(this.service),i.addClass(this.getElementClassNames("widget")),a.prepend(e("",{"class":this.getElementClassNames("icon")})),i.empty().append(a),this.button=a},initCounter:function(){if(this.options.counters)if(this.options.counterNumber)this.updateCounter(this.options.counterNumber);else{var t={counterUrl:this.options.counterUrl,forceUpdate:this.options.forceUpdate};g.fetch(this.service,this.options.url,t).always(e.proxy(this.updateCounter,this))}},cloneDataAttrs:function(e,t){var i=e.data();for(var n in i)i.hasOwnProperty(n)&&t.data(n,i[n])},getElementClassNames:function(e){return r(e,this.service)},updateCounter:function(t){t=parseInt(t,10)||0;var i={"class":this.getElementClassNames("counter"),text:t};t||this.options.zeroes||(i["class"]+=" "+d+"__counter_empty",i.text="");var n=e("",i);this.widget.append(n),this.widget.trigger("counter."+d,[this.service,t])},click:function(t){var i=this.options,n=!0;if(e.isFunction(i.click)&&(n=i.click.call(this,t)),n){var a=o(i.popupUrl,{url:i.url,title:i.title});a=this.addAdditionalParamsToUrl(a),this.openPopup(a,{width:i.popupWidth,height:i.popupHeight})}return!1},addAdditionalParamsToUrl:function(t){var i=e.param(e.extend(this.widget.data(),this.options.data));if(e.isEmptyObject(i))return t;var n=-1===t.indexOf("?")?"?":"&";return t+n+i},openPopup:function(t,i){var n=Math.round(screen.width/2-i.width/2),a=0;screen.height>i.height&&(a=Math.round(screen.height/3-i.height/2));var o=window.open(t,"sl_"+this.service,"left="+n+",top="+a+",width="+i.width+",height="+i.height+",personalbar=0,toolbar=0,scrollbars=1,resizable=1");if(o){o.focus(),this.widget.trigger("popup_opened."+d,[this.service,o]);var s=setInterval(e.proxy(function(){o.closed&&(clearInterval(s),this.widget.trigger("popup_closed."+d,this.service))},this),this.options.popupCheckInterval)}else location.href=t}},e(function(){e("."+d).socialLikes()})});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("#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("