diff --git a/conference/models.py b/conference/models.py index 4ba66129..75c91e56 100644 --- a/conference/models.py +++ b/conference/models.py @@ -1,4 +1,5 @@ # -*- coding: utf-8 -*- +import datetime from django.utils.translation import ugettext as _ from django.db import models from django.db.models import Q @@ -129,8 +130,15 @@ class Conference(TranslatableModel, EventMixin, ExpoMixin): #return list(Service.objects.language().filter(url__in=ids, type=Service.type.conference).order_by('sort')) def get_nearest_events(self): - conferences = Conference.objects.all()[:5] - return conferences + if self.theme.all(): + theme = self.theme.all()[0] + now = datetime.datetime.now() + now = now - datetime.timedelta(days=1) + conferences = Conference.objects.filter(theme__in=[theme], data_begin__gt=now).exclude(id=self.id).order_by('data_begin') + return conferences[:3] + else: + return [] + def get_catalog_url(self): return '/conference/' diff --git a/service/models.py b/service/models.py index 16177e67..e490e574 100644 --- a/service/models.py +++ b/service/models.py @@ -136,7 +136,7 @@ ADVERTYSE_TYPES = ((u'Рекламировать участника', u'Рекл (u'Приоритетное размещение событий в каталоге',u'Приоритетное размещение событий в каталоге'), (u'Персональная визитка Вашей компании',u'Персональная визитка Вашей компании')) class Advertising(AbstractOrder): - type = models.CharField(choices=ADVERTYSE_TYPES, max_length=255, blank=True, null=True) + type = models.CharField(max_length=255, blank=True, null=True) class CallBack(models.Model): diff --git a/service/order_forms.py b/service/order_forms.py index bded10f3..77e6a9f6 100644 --- a/service/order_forms.py +++ b/service/order_forms.py @@ -192,6 +192,7 @@ class AdvertiseForm(AbstractOrderForm): action = '/service/com_rek/' country = forms.CharField(required=False, widget=forms.TextInput(attrs={'placeholder': _(u'Страна')})) city = forms.CharField(required=False, widget=forms.TextInput(attrs={'placeholder': _(u'Город')})) + type = forms.CharField(required=False, widget=forms.HiddenInput()) class Meta: model = Advertising diff --git a/settings/templatetags/template_filters.py b/settings/templatetags/template_filters.py index 667ebc75..10c11444 100644 --- a/settings/templatetags/template_filters.py +++ b/settings/templatetags/template_filters.py @@ -251,7 +251,8 @@ def in_events(day, events): @register.filter def base64_encode(value): - return base64.b64encode(value) + + return base64.b64encode(value.encode("utf-8")) @register.filter diff --git a/templates/admin/base.html b/templates/admin/base.html index 743e7d89..9861275b 100644 --- a/templates/admin/base.html +++ b/templates/admin/base.html @@ -54,116 +54,12 @@ {# Side navigation #} {% block sidebar %} - + {% if user.is_superuser %} + {% include 'admin/includes/admin_nav.html' %} + {% else %} + {% include 'admin/includes/staff_nav.html' %} + {% endif %} + {% endblock %} diff --git a/templates/admin/includes/admin_nav.html b/templates/admin/includes/admin_nav.html new file mode 100644 index 00000000..51a37be8 --- /dev/null +++ b/templates/admin/includes/admin_nav.html @@ -0,0 +1,110 @@ + \ No newline at end of file diff --git a/templates/admin/includes/staff_nav.html b/templates/admin/includes/staff_nav.html new file mode 100644 index 00000000..24bdf99a --- /dev/null +++ b/templates/admin/includes/staff_nav.html @@ -0,0 +1,30 @@ + \ No newline at end of file diff --git a/templates/client/includes/exposition/exposition_list.html b/templates/client/includes/exposition/exposition_list.html index 61082756..a0e2fcba 100644 --- a/templates/client/includes/exposition/exposition_list.html +++ b/templates/client/includes/exposition/exposition_list.html @@ -8,20 +8,26 @@ {% for obj in objects %}
  • - - {% if obj.canceled %} -
    - {% else %} - {% if obj.expohit %} -
    - {% endif %} - {% endif %} -
    - {% with obj=obj %} - {% include 'client/includes/show_logo.html' %} - {% endwith %} -
    -
    + {% if not obj.canceled %} + + {% if obj.expohit %} +
    + {% endif %} +
    + {% with obj=obj %} + {% include 'client/includes/show_logo.html' %} + {% endwith %} +
    +
    + + {% else %} +
    +
    + {% with obj=obj %} + {% include 'client/includes/show_logo.html' %} + {% endwith %} +
    + {% endif %}
    {% if obj.quality_label.ufi.is_set %} diff --git a/templates/client/includes/header.html b/templates/client/includes/header.html index 3c1ee4ae..a8487e9b 100644 --- a/templates/client/includes/header.html +++ b/templates/client/includes/header.html @@ -35,8 +35,8 @@ {% endfor %} - {% if user.is_admin %} -
  • admin
  • + {% if user.is_staff %} +
  • admin
  • {% endif %} diff --git a/templates/client/popups/advertise.html b/templates/client/popups/advertise.html index 52be638f..3e09d165 100644 --- a/templates/client/popups/advertise.html +++ b/templates/client/popups/advertise.html @@ -31,6 +31,7 @@
    + \ No newline at end of file diff --git a/templates/client/simple_pages/advertising.html b/templates/client/simple_pages/advertising.html index 49372a6f..f1d435cb 100644 --- a/templates/client/simple_pages/advertising.html +++ b/templates/client/simple_pages/advertising.html @@ -19,196 +19,205 @@ {% block content_list %}
    {% trans 'Рост аудитории Expomap 2009–2014 гг.' %}
    -
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    300 000
    - - - - - - - - - -
    -
    -
    -

    - 300 000 - {% trans 'посещений в' %} {% trans 'месяц' %} -

    - -

    - 1 000 000 + - {% trans 'целевых' %}
    {% trans 'просмотров' %}
    {% trans 'вашей рекламы' %} -

    -
    -
    -
    -
    250 000
    200 000
    150 000
    100 000
    48 000
    24 000
    12 000
    6 000
    2 000
    {% trans 'Посещений в' %} {% trans 'месяц' %}
    - - - - - - - - - -
    200920102011201220132014
    -
    - -
    -
    - -
    - -
    - -
    - -
    - -
    - -
    {% trans 'Наша аудитория' %}
    -
      -
    • {% trans 'Маркетологи' %}
    • -
    • {% trans 'PR-специалисты' %}
    • -
    • {% trans 'Профильные специалисты' %}
    • -
    • {% trans 'Руководители департаментов' %} {% trans '(продажи, снабжение, маркетинг, PR и др.)' %} -
    • -
    • {% trans 'Руководители компаний' %}
    • -
    • {% trans 'Собственники бизнеса' %}
    • -
    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    300 000
    + + + + + + + + + +
    +
    +
    +

    + 300 000 + {% trans 'посещений в' %} {% trans 'месяц' %} +

    + +

    + 1 000 000 + + {% trans 'целевых' %}
    {% trans 'просмотров' %}
    {% trans 'вашей рекламы' %} +

    +
    +
    +
    250 000
    200 000
    150 000
    100 000
    48 000
    24 000
    12 000
    6 000
    2 000
    {% trans 'Посещений в' %} {% trans 'месяц' %}
    + + + + + + + + + +
    200920102011201220132014
    +
    -
    +
    +
    -
    {% trans 'Наши рекламодатели' %}
    +
    +
      + +
    • +
      +
      +

      {% trans 'Баннерная реклама' %}

      + +
      +

      {% trans 'Вы можете таргетировать Вашу рекламу, привязывая ее показы к определенной тематической отрасли (например, события в сфере строительства) или географической зоне (например, выставки и конференции Москвы).' %}

      +

      {% trans 'Возможные варианты размещения и размеры баннеров можно посмотреть на эскизе.' %}

      +
      + +
      +
      + {% trans 'от' %} 10 000 {% trans 'руб.' %} до 80 000 {% trans 'руб.' %} + +
      + +
      {% trans 'за месяц размещения' %}
      +
      + +

      {% trans 'Скидки при длительном размещении, а также агентствам.' %}

      +
      +
    • + +
    • +
      +
      +

      {% trans 'Приоритетное размещение событий в каталоге' %}

      + +
      +

      {% trans 'Ваше событие всегда в Топе тематического календаря и выделено цветом — вне зависимости от дат его проведения.' %}

      +
      + +
      +
      + 5 000 {% trans 'руб.' %} + +
      + +
      {% trans 'за месяц размещения в ТОП в 1 тематике' %}
      +
      + +
      +
    • + +
    • +
      +
      +

      {% trans 'Персональная визитка Вашей компании' %}

      +
      +

      {% trans 'В связи с недавним появлением каталога, спешите занять первые места в рубриках!' %}

      +
      + +
      +
      + 12 000 {% trans 'руб.' %} + +
      + +
      {% trans 'за год за 1 тематический раздел' %}
      +
      + +
      +
    • + +
    +
    -
      -
    • {% trans 'Организаторы мероприятий' %}
    • -
    • {% trans 'Туристические компании' %}
    • -
    • {% trans 'Гостиницы и системы бронирования' %}
    • -
    • {% trans 'Сервис-компании в сфере конгрессно-выставочного бизнеса' %}
    • -
    • {% trans 'Компании-производители' %}
    • -
    • {% trans 'Торговые компании' %}
    • -
    -
    +
    -
    +
    -
    +
    + +
    {% trans 'Наша аудитория' %}
    +
      +
    • {% trans 'Маркетологи' %}
    • +
    • {% trans 'PR-специалисты' %}
    • +
    • {% trans 'Профильные специалисты' %}
    • +
    • {% trans 'Руководители департаментов' %} {% trans '(продажи, снабжение, маркетинг, PR и др.)' %} +
    • +
    • {% trans 'Руководители компаний' %}
    • +
    • {% trans 'Собственники бизнеса' %}
    • +
    +
    + +
    + +
    {% trans 'Наши рекламодатели' %}
    + +
      +
    • {% trans 'Организаторы мероприятий' %}
    • +
    • {% trans 'Туристические компании' %}
    • +
    • {% trans 'Гостиницы и системы бронирования' %}
    • +
    • {% trans 'Сервис-компании в сфере конгрессно-выставочного бизнеса' %}
    • +
    • {% trans 'Компании-производители' %}
    • +
    • {% trans 'Торговые компании' %}
    • +
    +
    + +
    + +
    {% include 'client/popups/advertise.html' %}
    + +{% if request.GET.debug == '1' %} + +{% else %} + +{% endif %} + {% endblock %} \ No newline at end of file diff --git a/templates/client/static_client/js/_modules/page.advertising.js b/templates/client/static_client/js/_modules/page.advertising.js new file mode 100644 index 00000000..6726ba5d --- /dev/null +++ b/templates/client/static_client/js/_modules/page.advertising.js @@ -0,0 +1,51 @@ +var EXPO = EXPO || {}; //isolated namespace +if (EXPO.advertising) { + console.warn('WARNING: EXPO.advertising is already defined!'); +} else { + EXPO.advertising = (function () { + /** + * private (visible inside this module only) variables + */ + /** + * @type {Object} - module API interafce realization + */ + var that = {}; + /** + * @type {Object} default setting + */ + that.opt = {}; + /** + * dependencies.Place where you can switch on dependencies for module + * @type {EXPO.common|*} - mostly used in project functions and data (block.common.js) + */ + var com = EXPO.common; + + /** + * current module general initialization + * @param {Object} options - options recieved from web page view + */ + that.init = function (options) { + /** + * default module options + * @type {Object} + */ + this.opt = { + linkClass:"advert-modal", + inputId:"id_type" + + }; + // settings extending + $.extend(this.opt, options); + // begin of initialization + var self = this, + opt = this.opt; + + $('.'+opt.linkClass).on("mousedown", function () { + $(document.getElementById(opt.inputId)).val($(this).attr("data-type-title")); + }); + + + }; + return that; + }()); +} diff --git a/templates/client/static_client/js_min/_modules/page.advertising.min.js b/templates/client/static_client/js_min/_modules/page.advertising.min.js new file mode 100644 index 00000000..cf471a41 --- /dev/null +++ b/templates/client/static_client/js_min/_modules/page.advertising.min.js @@ -0,0 +1 @@ +var EXPO=EXPO||{};EXPO.advertising?console.warn("WARNING: EXPO.advertising is already defined!"):EXPO.advertising=function(){var t={};t.opt={};EXPO.common;return t.init=function(t){this.opt={linkClass:"advert-modal",inputId:"id_type"},$.extend(this.opt,t);var n=this.opt;$("."+n.linkClass).on("mousedown",function(){$(document.getElementById(n.inputId)).val($(this).attr("data-type-title"))})},t}(); \ No newline at end of file diff --git a/templates/client/static_client/js_min/vendor.min.js b/templates/client/static_client/js_min/vendor.min.js index 049f41ce..a75a8844 100644 --- a/templates/client/static_client/js_min/vendor.min.js +++ b/templates/client/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){!function(e){e(jQuery)}(function(i){var n="mCustomScrollbar",a="mCS",o=".mCustomScrollbar",s={setWidth:!1,setHeight:!1,setTop:0,setLeft:0,axis:"y",scrollbarPosition:"inside",scrollInertia:950,autoDraggerLength:!0,autoHideScrollbar:!1,autoExpandScrollbar:!1,alwaysShowScrollbar:0,snapAmount:null,snapOffset:0,mouseWheel:{enable:!0,scrollAmount:"auto",axis:"y",preventDefault:!1,deltaFactor:"auto",normalizeDelta:!1,invert:!1,disableOver:["select","option","keygen","datalist","textarea"]},scrollButtons:{enable:!1,scrollType:"stepless",scrollAmount:"auto"},keyboard:{enable:!0,scrollType:"stepless",scrollAmount:"auto"},contentTouchScroll:25,advanced:{autoExpandHorizontalScroll:!1,autoScrollOnFocus:"input,textarea,select,button,datalist,keygen,a[tabindex],area,object,[contenteditable='true']",updateOnContentResize:!0,updateOnImageLoad:!0,updateOnSelectorChange:!1},theme:"light",callbacks:{onScrollStart:!1,onScroll:!1,onTotalScroll:!1,onTotalScrollBack:!1,whileScrolling:!1,onTotalScrollOffset:0,onTotalScrollBackOffset:0,alwaysTriggerOffsets:!0,onOverflowY:!1,onOverflowX:!1,onOverflowYNone:!1,onOverflowXNone:!1},live:!1,liveSelector:null},r=0,l={},c=function(e){l[e]&&(clearTimeout(l[e]),p._delete.call(null,l[e]))},d=e.attachEvent&&!e.addEventListener?1:0,h=!1,u={init:function(e){var e=i.extend(!0,{},s,e),t=p._selector.call(this);if(e.live){var n=e.liveSelector||this.selector||o,d=i(n);if("off"===e.live)return void c(n);l[n]=setTimeout(function(){d.mCustomScrollbar(e),"once"===e.live&&d.length&&c(n)},500)}else c(n);return e.setWidth=e.set_width?e.set_width:e.setWidth,e.setHeight=e.set_height?e.set_height:e.setHeight,e.axis=e.horizontalScroll?"x":p._findAxis.call(null,e.axis),e.scrollInertia=e.scrollInertia>0&&e.scrollInertia<17?17:e.scrollInertia,"object"!=typeof e.mouseWheel&&1==e.mouseWheel&&(e.mouseWheel={enable:!0,scrollAmount:"auto",axis:"y",preventDefault:!1,deltaFactor:"auto",normalizeDelta:!1,invert:!1}),e.mouseWheel.scrollAmount=e.mouseWheelPixels?e.mouseWheelPixels:e.mouseWheel.scrollAmount,e.mouseWheel.normalizeDelta=e.advanced.normalizeMouseWheelDelta?e.advanced.normalizeMouseWheelDelta:e.mouseWheel.normalizeDelta,e.scrollButtons.scrollType=p._findScrollButtonsType.call(null,e.scrollButtons.scrollType),p._theme.call(null,e),i(t).each(function(){var t=i(this);if(!t.data(a)){t.data(a,{idx:++r,opt:e,scrollRatio:{y:null,x:null},overflowed:null,contentReset:{y:null,x:null},bindEvents:!1,tweenRunning:!1,sequential:{},langDir:t.css("direction"),cbOffsets:null,trigger:null});var n=t.data(a).opt,o=t.data("mcs-axis"),s=t.data("mcs-scrollbar-position"),l=t.data("mcs-theme");o&&(n.axis=o),s&&(n.scrollbarPosition=s),l&&(n.theme=l,p._theme.call(null,n)),p._pluginMarkup.call(this),u.update.call(null,t)}})},update:function(e){var t=e||p._selector.call(this);return i(t).each(function(){var e=i(this);if(e.data(a)){var t=e.data(a),n=t.opt,o=i("#mCSB_"+t.idx+"_container"),s=[i("#mCSB_"+t.idx+"_dragger_vertical"),i("#mCSB_"+t.idx+"_dragger_horizontal")];if(!o.length)return;t.tweenRunning&&p._stop.call(null,e),e.hasClass("mCS_disabled")&&e.removeClass("mCS_disabled"),e.hasClass("mCS_destroyed")&&e.removeClass("mCS_destroyed"),p._maxHeight.call(this),p._expandContentHorizontally.call(this),"y"===n.axis||n.advanced.autoExpandHorizontalScroll||o.css("width",p._contentWidth(o.children())),t.overflowed=p._overflowed.call(this),p._scrollbarVisibility.call(this),n.autoDraggerLength&&p._setDraggerLength.call(this),p._scrollRatio.call(this),p._bindEvents.call(this);var r=[Math.abs(o[0].offsetTop),Math.abs(o[0].offsetLeft)];"x"!==n.axis&&(t.overflowed[0]?s[0].height()>s[0].parent().height()?p._resetContentPosition.call(this):(p._scrollTo.call(this,e,r[0].toString(),{dir:"y",dur:0,overwrite:"none"}),t.contentReset.y=null):(p._resetContentPosition.call(this),"y"===n.axis?p._unbindEvents.call(this):"yx"===n.axis&&t.overflowed[1]&&p._scrollTo.call(this,e,r[1].toString(),{dir:"x",dur:0,overwrite:"none"}))),"y"!==n.axis&&(t.overflowed[1]?s[1].width()>s[1].parent().width()?p._resetContentPosition.call(this):(p._scrollTo.call(this,e,r[1].toString(),{dir:"x",dur:0,overwrite:"none"}),t.contentReset.x=null):(p._resetContentPosition.call(this),"x"===n.axis?p._unbindEvents.call(this):"yx"===n.axis&&t.overflowed[0]&&p._scrollTo.call(this,e,r[0].toString(),{dir:"y",dur:0,overwrite:"none"}))),p._autoUpdate.call(this)}})},scrollTo:function(e,t){if("undefined"!=typeof e&&null!=e){var n=p._selector.call(this);return i(n).each(function(){var n=i(this);if(n.data(a)){var o=n.data(a),s=o.opt,r={trigger:"external",scrollInertia:s.scrollInertia,scrollEasing:"mcsEaseInOut",moveDragger:!1,timeout:60,callbacks:!0,onStart:!0,onUpdate:!0,onComplete:!0},l=i.extend(!0,{},r,t),c=p._arr.call(this,e),d=l.scrollInertia>0&&l.scrollInertia<17?17:l.scrollInertia;c[0]=p._to.call(this,c[0],"y"),c[1]=p._to.call(this,c[1],"x"),l.moveDragger&&(c[0]*=o.scrollRatio.y,c[1]*=o.scrollRatio.x),l.dur=d,setTimeout(function(){null!==c[0]&&"undefined"!=typeof c[0]&&"x"!==s.axis&&o.overflowed[0]&&(l.dir="y",l.overwrite="all",p._scrollTo.call(this,n,c[0].toString(),l)),null!==c[1]&&"undefined"!=typeof c[1]&&"y"!==s.axis&&o.overflowed[1]&&(l.dir="x",l.overwrite="none",p._scrollTo.call(this,n,c[1].toString(),l))},l.timeout)}})}},stop:function(){var e=p._selector.call(this);return i(e).each(function(){var e=i(this);e.data(a)&&p._stop.call(null,e)})},disable:function(e){var t=p._selector.call(this);return i(t).each(function(){var t=i(this);if(t.data(a)){{var n=t.data(a);n.opt}p._autoUpdate.call(this,"remove"),p._unbindEvents.call(this),e&&p._resetContentPosition.call(this),p._scrollbarVisibility.call(this,!0),t.addClass("mCS_disabled")}})},destroy:function(){var e=p._selector.call(this);return i(e).each(function(){var t=i(this);if(t.data(a)){var o=t.data(a),s=o.opt,r=i("#mCSB_"+o.idx),l=i("#mCSB_"+o.idx+"_container"),d=i(".mCSB_"+o.idx+"_scrollbar");s.live&&c(e),p._autoUpdate.call(this,"remove"),p._unbindEvents.call(this),p._resetContentPosition.call(this),t.removeData(a),p._delete.call(null,this.mcs),d.remove(),r.replaceWith(l.contents()),t.removeClass(n+" _"+a+"_"+o.idx+" mCS-autoHide mCS-dir-rtl mCS_no_scrollbar mCS_disabled").addClass("mCS_destroyed")}})}},p={_selector:function(){return"object"!=typeof i(this)||i(this).length<1?o:this},_theme:function(e){var t=["rounded","rounded-dark","rounded-dots","rounded-dots-dark"],n=["rounded-dots","rounded-dots-dark","3d","3d-dark","3d-thick","3d-thick-dark","inset","inset-dark","inset-2","inset-2-dark","inset-3","inset-3-dark"],a=["minimal","minimal-dark"],o=["minimal","minimal-dark"],s=["minimal","minimal-dark"];e.autoDraggerLength=i.inArray(e.theme,t)>-1?!1:e.autoDraggerLength,e.autoExpandScrollbar=i.inArray(e.theme,n)>-1?!1:e.autoExpandScrollbar,e.scrollButtons.enable=i.inArray(e.theme,a)>-1?!1:e.scrollButtons.enable,e.autoHideScrollbar=i.inArray(e.theme,o)>-1?!0:e.autoHideScrollbar,e.scrollbarPosition=i.inArray(e.theme,s)>-1?"outside":e.scrollbarPosition},_findAxis:function(e){return"yx"===e||"xy"===e||"auto"===e?"yx":"x"===e||"horizontal"===e?"x":"y"},_findScrollButtonsType:function(e){return"stepped"===e||"pixels"===e||"step"===e||"click"===e?"stepped":"stepless"},_pluginMarkup:function(){var e=i(this),t=e.data(a),o=t.opt,s=o.autoExpandScrollbar?" mCSB_scrollTools_onDrag_expand":"",r=["
    ","
    "],l="yx"===o.axis?"mCSB_vertical_horizontal":"x"===o.axis?"mCSB_horizontal":"mCSB_vertical",c="yx"===o.axis?r[0]+r[1]:"x"===o.axis?r[1]:r[0],d="yx"===o.axis?"
    ":"",h=o.autoHideScrollbar?" mCS-autoHide":"",u="x"!==o.axis&&"rtl"===t.langDir?" mCS-dir-rtl":"";o.setWidth&&e.css("width",o.setWidth),o.setHeight&&e.css("height",o.setHeight),o.setLeft="y"!==o.axis&&"rtl"===t.langDir?"989999px":o.setLeft,e.addClass(n+" _"+a+"_"+t.idx+h+u).wrapInner("
    ");var f=i("#mCSB_"+t.idx),g=i("#mCSB_"+t.idx+"_container");"y"===o.axis||o.advanced.autoExpandHorizontalScroll||g.css("width",p._contentWidth(g.children())),"outside"===o.scrollbarPosition?("static"===e.css("position")&&e.css("position","relative"),e.css("overflow","visible"),f.addClass("mCSB_outside").after(c)):(f.addClass("mCSB_inside").append(c),g.wrap(d)),p._scrollButtons.call(this);var m=[i("#mCSB_"+t.idx+"_dragger_vertical"),i("#mCSB_"+t.idx+"_dragger_horizontal")];m[0].css("min-height",m[0].height()),m[1].css("min-width",m[1].width())},_contentWidth:function(e){return Math.max.apply(Math,e.map(function(){return i(this).outerWidth(!0)}).get())},_expandContentHorizontally:function(){var e=i(this),t=e.data(a),n=t.opt,o=i("#mCSB_"+t.idx+"_container");n.advanced.autoExpandHorizontalScroll&&"y"!==n.axis&&o.css({position:"absolute",width:"auto"}).wrap("
    ").css({width:Math.ceil(o[0].getBoundingClientRect().right+.4)-Math.floor(o[0].getBoundingClientRect().left),position:"relative"}).unwrap()},_scrollButtons:function(){var e=i(this),t=e.data(a),n=t.opt,o=i(".mCSB_"+t.idx+"_scrollbar:first"),s=["","","",""],r=["x"===n.axis?s[2]:s[0],"x"===n.axis?s[3]:s[1],s[2],s[3]];n.scrollButtons.enable&&o.prepend(r[0]).append(r[1]).next(".mCSB_scrollTools").prepend(r[2]).append(r[3])},_maxHeight:function(){var e=i(this),t=e.data(a),n=(t.opt,i("#mCSB_"+t.idx)),o=e.css("max-height"),s=-1!==o.indexOf("%"),r=e.css("box-sizing");if("none"!==o){var l=s?e.parent().height()*parseInt(o)/100:parseInt(o);"border-box"===r&&(l-=e.innerHeight()-e.height()+(e.outerHeight()-e.innerHeight())),n.css("max-height",Math.round(l))}},_setDraggerLength:function(){var e=i(this),t=e.data(a),n=i("#mCSB_"+t.idx),o=i("#mCSB_"+t.idx+"_container"),s=[i("#mCSB_"+t.idx+"_dragger_vertical"),i("#mCSB_"+t.idx+"_dragger_horizontal")],r=[n.height()/o.outerHeight(!1),n.width()/o.outerWidth(!1)],l=[parseInt(s[0].css("min-height")),Math.round(r[0]*s[0].parent().height()),parseInt(s[1].css("min-width")),Math.round(r[1]*s[1].parent().width())],c=d&&l[1]n.height(),r>n.width()]},_resetContentPosition:function(){var e=i(this),t=e.data(a),n=t.opt,o=i("#mCSB_"+t.idx),s=i("#mCSB_"+t.idx+"_container"),r=[i("#mCSB_"+t.idx+"_dragger_vertical"),i("#mCSB_"+t.idx+"_dragger_horizontal")];if(p._stop(e),("x"!==n.axis&&!t.overflowed[0]||"y"===n.axis&&t.overflowed[0])&&(r[0].add(s).css("top",0),p._scrollTo(e,"_resetY")),"y"!==n.axis&&!t.overflowed[1]||"x"===n.axis&&t.overflowed[1]){var l=dx=0;"rtl"===t.langDir&&(l=o.width()-s.outerWidth(!1),dx=Math.abs(l/t.scrollRatio.x)),s.css("left",l),r[1].css("left",dx),p._scrollTo(e,"_resetX")}},_bindEvents:function(){function e(){s=setTimeout(function(){i.event.special.mousewheel?(clearTimeout(s),p._mousewheel.call(t[0])):e()},1e3)}var t=i(this),n=t.data(a),o=n.opt;if(!n.bindEvents){if(p._draggable.call(this),o.contentTouchScroll&&p._contentDraggable.call(this),o.mouseWheel.enable){var s;e()}p._draggerRail.call(this),p._wrapperScroll.call(this),o.advanced.autoScrollOnFocus&&p._focus.call(this),o.scrollButtons.enable&&p._buttons.call(this),o.keyboard.enable&&p._keyboard.call(this),n.bindEvents=!0}},_unbindEvents:function(){var e=i(this),n=e.data(a),o=a+"_"+n.idx,s=".mCSB_"+n.idx+"_scrollbar",r=i("#mCSB_"+n.idx+",#mCSB_"+n.idx+"_container,#mCSB_"+n.idx+"_container_wrapper,"+s+" .mCSB_draggerContainer,#mCSB_"+n.idx+"_dragger_vertical,#mCSB_"+n.idx+"_dragger_horizontal,"+s+">a"),l=i("#mCSB_"+n.idx+"_container");n.bindEvents&&(i(t).unbind("."+o),r.each(function(){i(this).unbind("."+o)}),clearTimeout(e[0]._focusTimeout),p._delete.call(null,e[0]._focusTimeout),clearTimeout(n.sequential.step),p._delete.call(null,n.sequential.step),clearTimeout(l[0].onCompleteTimeout),p._delete.call(null,l[0].onCompleteTimeout),n.bindEvents=!1)},_scrollbarVisibility:function(e){var t=i(this),n=t.data(a),o=n.opt,s=i("#mCSB_"+n.idx+"_container_wrapper"),r=s.length?s:i("#mCSB_"+n.idx+"_container"),l=[i("#mCSB_"+n.idx+"_scrollbar_vertical"),i("#mCSB_"+n.idx+"_scrollbar_horizontal")],c=[l[0].find(".mCSB_dragger"),l[1].find(".mCSB_dragger")];"x"!==o.axis&&(n.overflowed[0]&&!e?(l[0].add(c[0]).add(l[0].children("a")).css("display","block"),r.removeClass("mCS_no_scrollbar_y mCS_y_hidden")):(o.alwaysShowScrollbar?(2!==o.alwaysShowScrollbar&&c[0].add(l[0].children("a")).css("display","none"),r.removeClass("mCS_y_hidden")):(l[0].css("display","none"),r.addClass("mCS_y_hidden")),r.addClass("mCS_no_scrollbar_y"))),"y"!==o.axis&&(n.overflowed[1]&&!e?(l[1].add(c[1]).add(l[1].children("a")).css("display","block"),r.removeClass("mCS_no_scrollbar_x mCS_x_hidden")):(o.alwaysShowScrollbar?(2!==o.alwaysShowScrollbar&&c[1].add(l[1].children("a")).css("display","none"),r.removeClass("mCS_x_hidden")):(l[1].css("display","none"),r.addClass("mCS_x_hidden")),r.addClass("mCS_no_scrollbar_x"))),n.overflowed[0]||n.overflowed[1]?t.removeClass("mCS_no_scrollbar"):t.addClass("mCS_no_scrollbar")},_coordinates:function(e){var t=e.type;switch(t){case"pointerdown":case"MSPointerDown":case"pointermove":case"MSPointerMove":case"pointerup":case"MSPointerUp":return[e.originalEvent.pageY,e.originalEvent.pageX];case"touchstart":case"touchmove":case"touchend":var i=e.originalEvent.touches[0]||e.originalEvent.changedTouches[0];return[i.pageY,i.pageX];default:return[e.pageY,e.pageX]}},_draggable:function(){function e(e){var t=m.find("iframe");if(t.length){var i=e?"auto":"none";t.css("pointer-events",i)}}function n(e,t,i,n){if(m[0].idleTimer=u.scrollInertia<233?250:0,o.attr("id")===g[1])var a="x",s=(o[0].offsetLeft-t+n)*c.scrollRatio.x;else var a="y",s=(o[0].offsetTop-e+i)*c.scrollRatio.y;p._scrollTo(l,s.toString(),{dir:a,drag:!0})}var o,s,r,l=i(this),c=l.data(a),u=c.opt,f=a+"_"+c.idx,g=["mCSB_"+c.idx+"_dragger_vertical","mCSB_"+c.idx+"_dragger_horizontal"],m=i("#mCSB_"+c.idx+"_container"),v=i("#"+g[0]+",#"+g[1]);v.bind("mousedown."+f+" touchstart."+f+" pointerdown."+f+" MSPointerDown."+f,function(n){if(n.stopImmediatePropagation(),n.preventDefault(),p._mouseBtnLeft(n)){h=!0,d&&(t.onselectstart=function(){return!1}),e(!1),p._stop(l),o=i(this);var a=o.offset(),c=p._coordinates(n)[0]-a.top,f=p._coordinates(n)[1]-a.left,g=o.height()+a.top,m=o.width()+a.left;g>c&&c>0&&m>f&&f>0&&(s=c,r=f),p._onDragClasses(o,"active",u.autoExpandScrollbar)}}).bind("touchmove."+f,function(e){e.stopImmediatePropagation(),e.preventDefault();var t=o.offset(),i=p._coordinates(e)[0]-t.top,a=p._coordinates(e)[1]-t.left;n(s,r,i,a)}),i(t).bind("mousemove."+f+" pointermove."+f+" MSPointerMove."+f,function(e){if(o){var t=o.offset(),i=p._coordinates(e)[0]-t.top,a=p._coordinates(e)[1]-t.left;if(s===i)return;n(s,r,i,a)}}).add(v).bind("mouseup."+f+" touchend."+f+" pointerup."+f+" MSPointerUp."+f,function(){o&&(p._onDragClasses(o,"active",u.autoExpandScrollbar),o=null),h=!1,d&&(t.onselectstart=null),e(!0)})},_contentDraggable:function(){function e(e,t){var i=[1.5*t,2*t,t/1.5,t/2];return e>90?t>4?i[0]:i[3]:e>60?t>3?i[3]:i[2]:e>30?t>8?i[1]:t>6?i[0]:t>4?t:i[2]:t>8?t:i[3]}function t(e,t,i,n,a,o){e&&p._scrollTo(v,e.toString(),{dur:t,scrollEasing:i,dir:n,overwrite:a,drag:o})}var n,o,s,r,l,c,d,u,f,g,m,v=i(this),w=v.data(a),x=w.opt,b=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"===x.axis?"none":"all";C.bind("touchstart."+b+" pointerdown."+b+" MSPointerDown."+b,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."+b+" pointermove."+b+" MSPointerMove."+b,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"===x.axis?[n-a,o-s]:"x"===x.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."+b+" pointerdown."+b+" MSPointerDown."+b,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."+b+" pointerup."+b+" MSPointerUp."+b,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",b=2.5>f,S=b?[_[_.length-2],T[T.length-2]]:[0,0];u=b?[a-S[0],o-S[1]]:[a-s,o-r];var k=[Math.abs(u[0]),Math.abs(u[1])];f=b?[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"===x.axis?[M[0],M[1]]:"x"===x.axis?[null,M[1]]:[M[0],null],m=[4*k[0]+x.scrollInertia,4*k[1]+x.scrollInertia];var P=parseInt(x.contentTouchScroll)||0;g[0]=k[0]>P?g[0]:0,g[1]=k[1]>P?g[1]:0,w.overflowed[0]&&t(g[0],m[0],v,"y",E,!1),w.overflowed[1]&&t(g[1],m[1],v,"x",E,!1)}}})},_mousewheel:function(){function e(e){var t=null;try{var i=e.contentDocument||e.contentWindow.document;t=i.body.innerHTML}catch(n){}return null!==t}var t=i(this),n=t.data(a);if(n){var o=n.opt,s=a+"_"+n.idx,r=i("#mCSB_"+n.idx),l=[i("#mCSB_"+n.idx+"_dragger_vertical"),i("#mCSB_"+n.idx+"_dragger_horizontal")],c=i("#mCSB_"+n.idx+"_container").find("iframe"),h=r;c.length&&c.each(function(){var t=this;e(t)&&(h=h.add(i(t).contents().find("body")))}),h.bind("mousewheel."+s,function(e,a){if(p._stop(t),!p._disableMousewheel(t,e.target)){var s="auto"!==o.mouseWheel.deltaFactor?parseInt(o.mouseWheel.deltaFactor):d&&e.deltaFactor<100?100:e.deltaFactor||100;if("x"===o.axis||"x"===o.mouseWheel.axis)var c="x",h=[Math.round(s*n.scrollRatio.x),parseInt(o.mouseWheel.scrollAmount)],u="auto"!==o.mouseWheel.scrollAmount?h[1]:h[0]>=r.width()?.9*r.width():h[0],f=Math.abs(i("#mCSB_"+n.idx+"_container")[0].offsetLeft),g=l[1][0].offsetLeft,m=l[1].parent().width()-l[1].width(),v=e.deltaX||e.deltaY||a;else var c="y",h=[Math.round(s*n.scrollRatio.y),parseInt(o.mouseWheel.scrollAmount)],u="auto"!==o.mouseWheel.scrollAmount?h[1]:h[0]>=r.height()?.9*r.height():h[0],f=Math.abs(i("#mCSB_"+n.idx+"_container")[0].offsetTop),g=l[0][0].offsetTop,m=l[0].parent().height()-l[0].height(),v=e.deltaY||a;"y"===c&&!n.overflowed[0]||"x"===c&&!n.overflowed[1]||(o.mouseWheel.invert&&(v=-v),o.mouseWheel.normalizeDelta&&(v=0>v?-1:1),(v>0&&0!==g||0>v&&g!==m||o.mouseWheel.preventDefault)&&(e.stopImmediatePropagation(),e.preventDefault()),p._scrollTo(t,(f-v*u).toString(),{dir:c}))}})}},_disableMousewheel:function(e,t){var n=t.nodeName.toLowerCase(),o=e.data(a).opt.mouseWheel.disableOver,s=["select","textarea"];return i.inArray(n,o)>-1&&!(i.inArray(n,s)>-1&&!i(t).is(":focus"))},_draggerRail:function(){var e=i(this),t=e.data(a),n=a+"_"+t.idx,o=i("#mCSB_"+t.idx+"_container"),s=o.parent(),r=i(".mCSB_"+t.idx+"_scrollbar .mCSB_draggerContainer");r.bind("touchstart."+n+" pointerdown."+n+" MSPointerDown."+n,function(){h=!0}).bind("touchend."+n+" pointerup."+n+" MSPointerUp."+n,function(){h=!1}).bind("click."+n,function(n){if(i(n.target).hasClass("mCSB_draggerContainer")||i(n.target).hasClass("mCSB_draggerRail")){p._stop(e);var a=i(this),r=a.find(".mCSB_dragger");if(a.parent(".mCSB_scrollTools_horizontal").length>0){if(!t.overflowed[1])return;var l="x",c=n.pageX>r.offset().left?-1:1,d=Math.abs(o[0].offsetLeft)-.9*c*s.width()}else{if(!t.overflowed[0])return;var l="y",c=n.pageY>r.offset().top?-1:1,d=Math.abs(o[0].offsetTop)-.9*c*s.height() }p._scrollTo(e,d.toString(),{dir:l,scrollEasing:"mcsEaseInOut"})}})},_focus:function(){var e=i(this),n=e.data(a),o=n.opt,s=a+"_"+n.idx,r=i("#mCSB_"+n.idx+"_container"),l=r.parent();r.bind("focusin."+s,function(){var n=i(t.activeElement),a=r.find(".mCustomScrollBox").length,s=0;n.is(o.advanced.autoScrollOnFocus)&&(p._stop(e),clearTimeout(e[0]._focusTimeout),e[0]._focusTimer=a?(s+17)*a:0,e[0]._focusTimeout=setTimeout(function(){var t=[n.offset().top-r.offset().top,n.offset().left-r.offset().left],i=[r[0].offsetTop,r[0].offsetLeft],a=[i[0]+t[0]>=0&&i[0]+t[0]=0&&i[0]+t[1]a");l.bind("mousedown."+s+" touchstart."+s+" pointerdown."+s+" MSPointerDown."+s+" mouseup."+s+" touchend."+s+" pointerup."+s+" MSPointerUp."+s+" mouseout."+s+" pointerout."+s+" MSPointerOut."+s+" click."+s,function(a){function s(t,i){o.scrollAmount=n.snapAmount||n.scrollButtons.scrollAmount,p._sequentialScroll.call(this,e,t,i)}if(a.preventDefault(),p._mouseBtnLeft(a)){var r=i(this).attr("class");switch(o.type=n.scrollButtons.scrollType,a.type){case"mousedown":case"touchstart":case"pointerdown":case"MSPointerDown":if("stepped"===o.type)return;h=!0,t.tweenRunning=!1,s("on",r);break;case"mouseup":case"touchend":case"pointerup":case"MSPointerUp":case"mouseout":case"pointerout":case"MSPointerOut":if("stepped"===o.type)return;h=!1,o.dir&&s("off",r);break;case"click":if("stepped"!==o.type||t.tweenRunning)return;s("on",r)}}})},_keyboard:function(){var e=i(this),n=e.data(a),o=n.opt,s=n.sequential,r=a+"_"+n.idx,l=i("#mCSB_"+n.idx),c=i("#mCSB_"+n.idx+"_container"),d=c.parent(),h="input,textarea,select,datalist,keygen,[contenteditable='true']";l.attr("tabindex","0").bind("blur."+r+" keydown."+r+" keyup."+r,function(a){function r(t,i){s.type=o.keyboard.scrollType,s.scrollAmount=o.snapAmount||o.keyboard.scrollAmount,"stepped"===s.type&&n.tweenRunning||p._sequentialScroll.call(this,e,t,i)}switch(a.type){case"blur":n.tweenRunning&&s.dir&&r("off",null);break;case"keydown":case"keyup":var l=a.keyCode?a.keyCode:a.which,u="on";if("x"!==o.axis&&(38===l||40===l)||"y"!==o.axis&&(37===l||39===l)){if((38===l||40===l)&&!n.overflowed[0]||(37===l||39===l)&&!n.overflowed[1])return;"keyup"===a.type&&(u="off"),i(t.activeElement).is(h)||(a.preventDefault(),a.stopImmediatePropagation(),r(u,l))}else if(33===l||34===l){if((n.overflowed[0]||n.overflowed[1])&&(a.preventDefault(),a.stopImmediatePropagation()),"keyup"===a.type){p._stop(e);var f=34===l?-1:1;if("x"===o.axis||"yx"===o.axis&&n.overflowed[1]&&!n.overflowed[0])var g="x",m=Math.abs(c[0].offsetLeft)-.9*f*d.width();else var g="y",m=Math.abs(c[0].offsetTop)-.9*f*d.height();p._scrollTo(e,m.toString(),{dir:g,scrollEasing:"mcsEaseInOut"})}}else if((35===l||36===l)&&!i(t.activeElement).is(h)&&((n.overflowed[0]||n.overflowed[1])&&(a.preventDefault(),a.stopImmediatePropagation()),"keyup"===a.type)){if("x"===o.axis||"yx"===o.axis&&n.overflowed[1]&&!n.overflowed[0])var g="x",m=35===l?Math.abs(d.width()-c.outerWidth(!1)):0;else var g="y",m=35===l?Math.abs(d.height()-c.outerHeight(!1)):0;p._scrollTo(e,m.toString(),{dir:g,scrollEasing:"mcsEaseInOut"})}}})},_sequentialScroll:function(e,t,n){function o(t){var i="stepped"!==c.type,n=t?i?l.scrollInertia/1.5:l.scrollInertia:1e3/60,a=t?i?7.5:40:2.5,s=[Math.abs(d[0].offsetTop),Math.abs(d[0].offsetLeft)],h=[r.scrollRatio.y>10?10:r.scrollRatio.y,r.scrollRatio.x>10?10:r.scrollRatio.x],u="x"===c.dir[0]?s[1]+c.dir[1]*h[1]*a:s[0]+c.dir[1]*h[0]*a,f="x"===c.dir[0]?s[1]+c.dir[1]*parseInt(c.scrollAmount):s[0]+c.dir[1]*parseInt(c.scrollAmount),g="auto"!==c.scrollAmount?f:u,m=t?i?"mcsLinearOut":"mcsEaseInOut":"mcsLinear",v=t?!0:!1;return t&&17>n&&(g="x"===c.dir[0]?s[1]:s[0]),p._scrollTo(e,g.toString(),{dir:c.dir[0],scrollEasing:m,dur:n,onComplete:v}),t?void(c.dir=!1):(clearTimeout(c.step),void(c.step=setTimeout(function(){o()},n)))}function s(){clearTimeout(c.step),p._stop(e)}var r=e.data(a),l=r.opt,c=r.sequential,d=i("#mCSB_"+r.idx+"_container"),h="stepped"===c.type?!0:!1;switch(t){case"on":if(c.dir=["mCSB_buttonRight"===n||"mCSB_buttonLeft"===n||39===n||37===n?"x":"y","mCSB_buttonUp"===n||"mCSB_buttonLeft"===n||38===n||37===n?-1:1],p._stop(e),p._isNumeric(n)&&"stepped"===c.type)return;o(h);break;case"off":s(),(h||r.tweenRunning&&c.dir)&&o(!0)}},_arr:function(e){var t=i(this).data(a).opt,n=[];return"function"==typeof e&&(e=e()),e instanceof Array?n=e.length>1?[e[0],e[1]]:"x"===t.axis?[null,e[0]]:[e[0],null]:(n[0]=e.y?e.y:e.x||"x"===t.axis?null:e,n[1]=e.x?e.x:e.y||"y"===t.axis?null:e),"function"==typeof n[0]&&(n[0]=n[0]()),"function"==typeof n[1]&&(n[1]=n[1]()),n},_to:function(e,t){if(null!=e&&"undefined"!=typeof e){var n=i(this),o=n.data(a),s=o.opt,r=i("#mCSB_"+o.idx+"_container"),l=r.parent(),c=typeof e;t||(t="x"===s.axis?"x":"y");var d="x"===t?r.outerWidth(!1):r.outerHeight(!1),h="x"===t?r.offset().left:r.offset().top,f="x"===t?r[0].offsetLeft:r[0].offsetTop,g="x"===t?"left":"top";switch(c){case"function":return e();case"object":if(e.nodeType)var m="x"===t?i(e).offset().left:i(e).offset().top;else if(e.jquery){if(!e.length)return;var m="x"===t?e.offset().left:e.offset().top}return m-h;case"string":case"number":if(p._isNumeric.call(null,e))return Math.abs(e);if(-1!==e.indexOf("%"))return Math.abs(d*parseInt(e)/100);if(-1!==e.indexOf("-="))return Math.abs(f-parseInt(e.split("-=")[1]));if(-1!==e.indexOf("+=")){var v=f+parseInt(e.split("+=")[1]);return v>=0?0:Math.abs(v)}if(-1!==e.indexOf("px")&&p._isNumeric.call(null,e.split("px")[0]))return Math.abs(e.split("px")[0]);if("top"===e||"left"===e)return 0;if("bottom"===e)return Math.abs(l.height()-r.outerHeight(!1));if("right"===e)return Math.abs(l.width()-r.outerWidth(!1));if("first"===e||"last"===e){var w=r.find(":"+e),m="x"===t?i(w).offset().left:i(w).offset().top;return m-h}if(i(e).length){var m="x"===t?i(e).offset().left:i(e).offset().top;return m-h}return r.css(g,e),void u.update.call(null,n[0])}}},_autoUpdate:function(e){function t(){clearTimeout(h[0].autoUpdate),h[0].autoUpdate=setTimeout(function(){return d.advanced.updateOnSelectorChange&&(f=s(),f!==b)?(r(),void(b=f)):(d.advanced.updateOnContentResize&&(g=[h.outerHeight(!1),h.outerWidth(!1),v.height(),v.width(),x()[0],x()[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")],x=function(){return[w[0].is(":visible")?w[0].outerHeight(!0):0,w[1].is(":visible")?w[1].outerWidth(!0):0]},b=s(),y=[h.outerHeight(!1),h.outerWidth(!1),v.height(),v.width(),x()[0],x()[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||x>=b[0]+C,c.callbacks.alwaysTriggerOffsets||-S>=x]}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",x=f[0].offsetLeft,b=[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",x=f[0].offsetTop,b=[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]>=b[1]?y=[b[0],b[1]]:y[0]=-y[0],e[0].mcs||r(),clearTimeout(f[0].onCompleteTimeout),(l.tweenRunning||!(0===x&&y[0]>=0||x===b[0]&&y[0]<=b[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]>=b[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||(b||m.call(),b=p._getTime()-x,c(),b>=t._mcstime&&(t._mcstime=b>t._mcstime?b+f-(b-t._mcstime):b+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=b+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(){},x=p._getTime(),b=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,x,b=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)?(b.w-n)*g(M)/100:M,s=p(P)?(b.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),x=w.contents().find("body"),D&&x.css("overflow-x","hidden"),s=x.outerHeight(!0))}catch(z){}}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(b.w-n,O),B=Math.min(b.h-a,B)),f=b.w-W,v=b.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):alert(i.message?i.message:t.literals.communicationProblem)},h=function(a,o){a.click(function(s){s.preventDefault();var r=a.attr("href").substring(1),l=c(o);l[t.tag.tagIdParameter]=r,e.getJSON(t.deleteTagsUrl,l,function(e){e.result||d(e)}),e("#"+t.tag.deleteLinkIdPrefix+r).parents().eq(1).remove(),e("#"+t.imageWrapBox.tagListRemoveItemIdPrefix+r).parent().remove();var h=e("span.comma"),u=e("a.highlight-tag");return e("ul.photoTag-taglist li").last().find(h).remove(),e("ul.photoTag-taglist li").last().find(u).mouseover(function(){i(e("#photoTag-tag_"+e(this).attr("tag-id")).find(".taghover"))}).mouseleave(function(){n(e("#photoTag-tag_"+e(this).attr("tag-id")).find(".taghover"))}),!1})},u=function(i,n,a){e(i).click(function(i){i.preventDefault(),0==e("#"+t.tag.idPrefix+"expo").length&&(S(a),e("#"+t.imageWrapBox.idPrefix+a).append(C(n)),m(e("#"+t.tag.idPrefix+"expo"),n,a))})},p=function(){var t=(e(this),e(this).position()),i=t.left,n=t.top;e("#expoTagBoxForm")&&e("#expoTagBoxForm").css({top:n,left:i+e(this).width()+10}),e("#photoTag-tag_expo .utag-right").css({height:e(this).height(),left:e(this).width()}),e("#photoTag-tag_expo .utag-left").css({height:e(this).height()}),e("#photoTag-tag_expo .utag-bot").css({top:e(this).height()})},f=function(){e("#expoTagBoxForm")&&e("#expoTagBoxForm").css({display:"none"})},g=function(){var t=(e(this),e(this).position()),i=t.left,n=t.top;e("#expoTagBoxForm")&&e("#expoTagBoxForm").css({display:"block",top:n,left:i+e(this).width()+10})},m=function(i,n,a){i.draggable({containment:n,cursor:"move",drag:p,start:f,stop:g,grid:[1,1]}),i.resizable({handles:"n, e, s, w, ne, se, sw, nw",maxHeight:n.height(),maxWidth:n.width(),minHeight:t.tag.minHeight,minWidth:t.tag.minWidth,containment:n,resize:p}),v(i,n,a),e(".utag-bot").css({top:t.tag.defaultWidth}),e(".utag-right").css({height:t.tag.defaultHeight,left:t.tag.defaultWidth}),e(".utag-left").css({height:t.tag.defaultHeight})},v=function(i,n,a){var o=e('
    '),r=e('
    '),l=e(i).position();r.css({position:"absolute",top:l.top,left:l.left+i.width()+10,width:t.tag.newTagFormWidth}),r.append(e('
    '));var c=e("#"+t.imageWrapBox.idPrefix+a);c.append(r),e("#expoNewTagFormContent").append(o),e.each(t.parametersForNewTag,function(t,i){var n=e('
    ');if(i.label){{var a=e("");e("
    ")}a.append(i.label),e("#expoNewTagForm").append(a)}e("#expoNewTagForm").append(n),e("#expoInput_name").bind("keydown",function(t){t.keyCode===e.ui.keyCode.TAB&&e(this).data("ui-autocomplete").menu.active&&t.preventDefault()}).autocomplete({appendTo:e(".ptListHolder"),minLength:1,source:function(t,i){var n=e.ui.autocomplete.escapeRegex(t.term),a=new RegExp("^"+n,"i"),o=e.grep(photoTagData,function(e){return a.test(e.label||e.value||e)}),s=new RegExp(n,"i"),r=e.grep(photoTagData,function(t){return e.inArray(t,o)<0&&s.test(t.label||t.value||t)});i(o.concat(r))},focus:function(){return!1},select:function(t,i){e("#hidden_expoInput_name").val(i.item.id)}}),e("#expoInput_name").parent().append(e(''))});var h=e('");e("#expoNewTagForm").append(h);var u=e("");e("#expoNewTagForm").append(u);var p=e('');p.click(function(e){return e.preventDefault(),w(),_(a),!1}),e("#expoNewTagForm").append(p),e("#expoNewTagForm").submit(function(i){i.preventDefault();var o=e("#"+t.tag.idPrefix+"expo"),r={left:o.position().left,top:o.position().top,width:o.width(),height:o.height()};e.getJSON(t.addTagUrl+"?"+e.param(r)+"&"+e(this).serialize(),function(i){if(void 0!=i.result&&!i.result)return void d(i);var o=b(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()},x=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},b=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=x(i.id,a,o,0),r=e("
    ");if(r.append(i.text.replace(/ /g," ")),s.append(r),t.isEnabledToEditTags&&i.isDeleteEnable&&t.tag.showDeleteLinkOnTag){var l=e('');h(l,n)}return s.find(".taghover").append(l),s},y=function(a,o){e(".photoTag-taglist").html().length>0&&e(".photoTag-taglist li").last().append(', ');var s=e("
  • ");if(a.url){var r=e(''+a.text+"");s.append(r)}else s.append(a.text);if(a.isDeleteEnable){var l=e('  ');h(l,o),s.append(l)}var c=e("a.highlight-tag");return e("ul.photoTag-taglist li").last().find(c).mouseover(function(){i(e("#photoTag-tag_"+e(this).attr("tag-id")).find(".taghover"))}).mouseleave(function(){n(e("#photoTag-tag_"+e(this).attr("tag-id")).find(".taghover"))}),s},C=function(e){var i={width:t.tag.defaultWidth,height:t.tag.defaultHeight},n={top:e.height()/2-i.height/2,left:e.width()/2-i.width/2};l.expoId++;var a=x("expo",i,n,1);return a},S=function(t){e.each(l.tags[t],function(){e(this).css({opacity:0}),e(this).hide()})},_=function(t){e.each(l.tags[t],function(){e(this).show()})},T=function(i,n){var a=e(''+t.literals.addNewTag+"");return u(a,i,n),a},k=function(i,n){var a=i.height(),o=i.width(),s=e('
    '),r=e('
    ');s.append(r);var l=e('
    ');if(s.append(l),i.wrap(s),t.externalAddTagLinks.bind){var c=e(t.externalAddTagLinks.selector);c.each(function(){u(this,i,n)})}else e("#"+t.imageWrapBox.controlPaneIdPrefix+n).append(T(i,n));var d=e("
    ");if(e("#"+t.imageWrapBox.canvasIdPrefix+n).wrap(d),t.imageWrapBox.showTagList){var h=e('
      ');e(".pg-photo-descr#imgid"+n).append(h)}},E=function(a,o,s,r){if(t.tag.flashAfterCreation&&(e(a).css({opacity:1}),e(a).stop().animate({opacity:0},800)),t.imageWrapBox.showTagList){var l=y(o,s);e("#"+t.imageWrapBox.tagListIdPrefix+r).append(l);var c=e("a.highlight-tag");e("ul.photoTag-taglist li").last().find(c).mouseover(function(){i(e("#photoTag-tag_"+e(this).attr("tag-id")).find(".taghover"))}).mouseleave(function(){n(e("#photoTag-tag_"+e(this).attr("tag-id")).find(".taghover"))})}},M=function(i,n){k(n,i.id);var a=l.tags[i.id]={};e.each(i.Tags,function(){var o=b(this,n);a[this.id]=o,e("#"+t.imageWrapBox.idPrefix+i.id).append(o),s(),E(o,this,n,i.id)})};return this.each(function(){var i=e(this),n=c(i);(!e.isFunction(t.beforeTagRequest)||t.beforeTagRequest(n))&&e.getJSON(t.requestTagsUrl,n,function(n){return void 0==n.result||n.result?(n.options&&(t=e.extend(!0,t,n.options)),void e.each(n.Image,function(){M(this,i)})):void d(n)})}),this}}(jQuery);var dna={clone:function(e,t,i){var n={fade:!1,top:!1,container:null,empty:!1,html:!1,callback:null};$.extend(n,i);var a=dna.store.getTemplate(e);a.nested&&!n.container&&dna.core.berserk("Container missing for nested template: "+e),n.empty&&dna.empty(e);for(var o=t instanceof Array?t:[t],s=$(),r=0;r0&&i(window,e.split(".")),n}},dna.ui={toElem:function(e,t){return e instanceof jQuery?e:$(e?e.target:t)},deleteElem:function(e){return dna.ui.toElem(e,this).remove()},slideFade:function(e,t,i){function n(){e.css(r)}var a={opacity:0,transition:"opacity 0s ease 0s"},o={opacity:1,transition:"opacity 0.4s ease-in"},s={opacity:0,transition:"opacity 0.4s ease-out"},r={transition:"opacity 0s ease 0s"};return window.setTimeout(n,1e3),i?e.css(a).hide().slideDown({complete:t}).css(o):e.css(s).slideUp({complete:t}),e},slideFadeIn:function(e,t){return dna.ui.slideFade(e,t,!0)},slideFadeOut:function(e,t){return dna.ui.slideFade(e,t,!1)},slideFadeToggle:function(e,t){return dna.ui.slideFade(e,t,e.is(":hidden"))},slideFadeDelete:function(e){return dna.ui.slideFadeOut(e,dna.ui.deleteElem)},slidingFlasher:function(e,t){return e.is(":hidden")?dna.ui.slideFadeIn(e,t):e.hide().fadeIn()}},dna.compile={regexDnaField:/^[\s]*(~~|\{\{).*(~~|\}\})[\s]*$/,regexDnaBasePair:/~~|{{|}}/,regexDnaBasePairs:/~~|\{\{|\}\}/g,setupNucleotide:function(e){return void 0===e.data().dnaRules&&(e.data().dnaRules={}),e.addClass("dna-nucleotide")},isDnaField:function(){var e=$(this)[0].childNodes[0];return e&&e.nodeValue&&e.nodeValue.match(dna.compile.regexDnaField)},field:function(){var e=dna.compile.setupNucleotide($(this));return e.data().dnaRules.text=$.trim(e.text()).replace(dna.compile.regexDnaBasePairs,""),e.empty()},propsAndAttrs:function(){function e(){if(/^data-dna-prop-/.test(this.name))i.push(this.name.replace(/^data-dna-prop-/,""),this.value.replace(dna.compile.regexDnaBasePairs,""));else{if(3!==this.value.split(dna.compile.regexDnaBasePair).length)return;n.push(this.name.replace(/^data-dna-attr-/,""),this.value.split(dna.compile.regexDnaBasePair))}a.push(this.name)}var t=$(this),i=[],n=[],a=[];return $.each(t.get(0).attributes,e),i.length>0&&(dna.compile.setupNucleotide(t).data().dnaRules.props=i),n.length>0&&(dna.compile.setupNucleotide(t).data().dnaRules.attrs=n),t.removeAttr(a.join(" "))},getDataField:function(e,t){return $.trim(e.data("dna-"+t).replace(dna.compile.regexDnaBasePairs,""))},subTemplateName:function(e,t){var i=e instanceof jQuery?dna.getClone(e).data().dnaRules.template:e;return i+"-"+t+"-instance"},rules:function(e,t,i){function n(){var e=dna.compile.setupNucleotide($(this)),n=dna.compile.getDataField(e,t);e.data().dnaRules[t]=i?n.split(","):n}return e.filter("[data-dna-"+t+"]").each(n).removeAttr("data-dna-"+t)},template:function(e){function t(){$(this).data().dnaRules={template:$(this).attr("id")}}var i=$("#"+e);i.length||dna.core.berserk("Template not found: "+e),i.find(".dna-template").addBack().each(t).removeAttr("id");var n=i.find("*").addBack();return n.filter(dna.compile.isDnaField).each(dna.compile.field),dna.compile.rules(n,"array").addClass("dna-array"),dna.compile.rules(n,"class",!0),dna.compile.rules(n,"require"),dna.compile.rules(n,"missing"),dna.compile.rules(n,"truthy"),dna.compile.rules(n,"falsey"),n.each(dna.compile.propsAndAttrs),dna.store.stash(i)}},dna.store={templates:{},stash:function(e){function t(){var e=$(this),t=e.data().dnaRules.template,i={name:t,elem:e,container:e.parent().addClass("dna-container").addClass("dna-contains-"+t),nested:0!==e.parent().closest(".dna-clone").length,index:e.index(),clones:0};dna.store.templates[t]=i,e.removeClass("dna-template").addClass("dna-clone").addClass(t).detach()}function i(){var e=$(this),t=e.data().dnaRules.array,i=dna.compile.subTemplateName(n,t);dna.compile.setupNucleotide(e.parent()).data().dnaRules.loop={name:i,field:t},e.data().dnaRules.template=i}var n=e.data().dnaRules.template;return e.find(".dna-template").addBack().each(t),e.find(".dna-array").each(i).each(t),dna.store.templates[n]},getTemplate:function(e){return dna.store.templates[e]||dna.compile.template(e)}},dna.events={initializers:[],elementSetup:function(e,t){function i(){dna.util.apply($(this).data("dna-setup"),[$(this),t])}var n="[data-dna-setup]",a=e?e.find(n).addBack(n):$(".dna-setup");return a.each(i).addClass("dna-initialized")},runInitializers:function(e,t){function i(){dna.util.apply(this.func,[(this.selector?e.find(this.selector).addBack(this.selector):e).addClass("dna-initialized")].concat(this.params))}return dna.events.elementSetup(e,t),$.each(dna.events.initializers,i),e},runner:function(e,t,i){return e=e.closest("[data-dna-"+t+"]"),dna.util.apply(e.data("dna-"+t),[e,i])},handle:function(e){return dna.events.runner($(e.target),e.type.replace("key","key-"),e)},handleEnterKey:function(e){return 13===e.which?dna.events.runner($(e.target),"enter-key",e):null},setup:function(){$(document).click(dna.events.handle).change(dna.events.handle).keyup(dna.events.handle).keyup(dna.events.handleEnterKey).keydown(dna.events.handle).keypress(dna.events.handle),dna.events.elementSetup()}},$(dna.events.setup),dna.core={inject:function(e,t,i,n){function a(e,a){function o(e){return-1!==$.inArray(typeof e,r)}var s="object"==typeof t?dna.util.value(t,a):"[count]"===a?i:"[value]"===a?t:null,r=["string","number","boolean"];o(s)&&(e=n.html?e.html(s):e.text(s))}function o(e,i){for(var n=0;n1&&(e.toggleClass(i[1],a),i[2]&&e.toggleClass(i[2],!a))}function l(e,i){var n=dna.util.value(t,i.field);n&&dna.clone(i.name,n,{container:e})}function c(){var e=$(this),i=e.data().dnaRules;i.text&&a(e,i.text),i.props&&o(e,i.props),i.attrs&&s(e,i.attrs),i.class&&r(e,i.class),i.require&&e.toggle(void 0!==dna.util.value(t,i.require)),i.missing&&e.toggle(void 0===dna.util.value(t,i.missing)),i.truthy&&e.toggle(dna.util.realTruth(dna.util.value(t,i.truthy))),i.falsey&&e.toggle(!dna.util.realTruth(dna.util.value(t,i.falsey))),i.loop&&l(e,i.loop)}return e.find(".dna-array").remove(),e.find(".dna-nucleotide").addBack(".dna-nucleotide").each(c),e.data("dna-model",t)},replicate:function(e,t,i,n){var a=e.elem.clone(!0,!0);e.clones++,dna.core.inject(a,t,i,n);var o=".dna-contains-"+e.name,s=n.container?n.container.find(o).addBack(o):e.container;return s[n.top?"prepend":"append"](a),dna.events.runInitializers(a,t),n.callback&&n.callback(a,t),n.fade&&dna.ui.slideFadeIn(a),a},unload:function(e,t,i){t.error||dna.clone(e,t,i)},berserk:function(e){throw"dna.js error -> "+e}};var map;!function(e){var t=e(window),i=(e("html"),e("body"),e(document));e.widget("custom.catcomplete",e.ui.autocomplete,{_renderMenu:function(t,i){var n=this,a="";e.each(i,function(e,i){i.category!=a&&(t.append("
    • "+i.category+"
    • "),a=i.category),n._renderItemData(t,i)})}}),e(function(){function n(e){return(e.getDate()<10?"0":"")+e.getDate()+"."+(e.getMonth()<9?"0":"")+(e.getMonth()+1)+"."+e.getFullYear()}e("#send_message_form").on("submit",function(t){t.preventDefault(),$this=e(this);var i=$this.serialize(),n=$this.attr("action");e.post(n,i,function(t){t.success&&(e.fancybox.close(),$this.find("#id_body").val(""))})}),e("#reply_form").on("submit",function(t){t.preventDefault(),$this=e(this);var i=$this.serialize(),n=e("#reply_message").val(),a="/profile/messages/reply/"+n+"/";e.post(a,i,function(t){t.success&&(e.fancybox.close(),$this.find("#id_recipient").val(""),$this.find("#id_body").val(""))})}),e(".visit, .unvisit").on("click",function(t){t.preventDefault();var i=e(this),n=e(this).attr("href");e.get(n,function(t){t.not_authorized?e.fancybox.open("#pw-login"):t.success&&(t.in?i.hasClass("visit")&&(i.hide(),i.siblings(".unvisit").show()):i.hasClass("unvisit")&&(i.hide(),i.siblings(".visit").show()))})}),e("#paswd_change").on("submit",function(t){t.preventDefault();var i=e(this).serialize(),n="/profile/change-password/",a=e(this);e.post(n,i,function(t){if(t.success)e("#paswd_change .mf-success").fadeIn(300),setTimeout(function(){e("#paswd_change .mf-success").fadeOut(300)},3e3),a.find("#id_old password").val("");else{e("#paswd_change .mf-error").parent().remove();var i=e("
      ").attr("class","mf-line").append(e("
      ").attr("class","mf-error").append(t.errors[0]));a.find(".mf-buttons-line").before(i)}})}),e(".reg").on("click",function(t){t.preventDefault(),e(".register").click()}),e.fn.customSelect=function(){return e(this).each(function(){var t=e(this),i=t.children("option"),n=t.children("option").length,a=e(":selected",t);t.addClass("s-hidden"),t.wrap('
      '),t.after('
      ');var o=t.next("div.custom-select-wrap"),s=o.children(".custom-select-text"),r=0!=a.length?a.text():t.children("option").eq(0).text();s.text(r),0!=i.index(a)||t.children("option").eq(0).val()&&t.children("option").eq(0).attr("value")||s.addClass("placeholder");for(var l=e('
      ').insertAfter(o),c=l.find(".scroll-content"),d=e("
        ").appendTo(c),h=0;n>h;h++){var u=""!=t.children("option").eq(h).text()?t.children("option").eq(h).html():" ";e("
      • ",{html:u,"data-value":t.children("option").eq(h).val()}).appendTo(d)}var p=d.children("li");if(o.on("click",function(i){i.stopPropagation(),e("div.custom-select-wrap.active").not(this).each(function(){e(this).removeClass("active").next(".options").hide()}),t.prop("disabled")||e(this).toggleClass("active").next(".options").toggle()}),p.on("click",function(i){var n=e(this);i.stopPropagation(),s.text(n.text()),o.removeClass("active"),t.val(n.data("value")),0!=n.index()||t.children("option").eq(0).val()&&t.children("option").eq(0).attr("value")?s.removeClass("placeholder"):s.addClass("placeholder"),l.hide() -}),e.fn.mCustomScrollbar){var f={scrollInertia:200,contentTouchScroll:!0,scrollButtons:{enable:!1},advanced:{autoScrollOnFocus:!1,updateOnContentResize:!0}},g=l.find("div.cs-scroll-container");g.mCustomScrollbar(f)}e(document).on("click",function(){o.removeClass("active"),l.hide()}),t.on("change",function(){var i=e(this),n=i.prop("selectedIndex"),a=i.children("option").eq(n).text();s.text(a),0!=n||t.children("option").eq(0).val()&&t.children("option").eq(0).attr("value")?s.removeClass("placeholder"):s.addClass("placeholder")})})},e("select:not([multiple])").each(function(){var t=e(this);t.hasClass("select2")||t.customSelect()}),e("#mp-recent-expo").each(function(){var t=e(this),i=t.children("ul"),n=i.children("li"),a=t.children("div.re-controls"),o=a.children("a.prev"),s=a.children("a.next");if(n.length>1){a.addClass("enabled"),n.css({display:"block"}),t.height(n.eq(0).height());var r=t.swiper({speed:500,mode:"horizontal",loop:!1,simulateTouch:!1,autoplay:6200,onInit:function(){o.addClass("disabled")},onSlideChangeStart:function(e){t.animate({height:n.eq(e.activeIndex).children("div.re-body").height()},300),0==e.activeIndex?(o.hasClass("disabled")||o.addClass("disabled"),s.hasClass("disabled")&&s.removeClass("disabled")):e.activeIndex==e.slides.length-1?(s.hasClass("disabled")||s.addClass("disabled"),o.hasClass("disabled")&&o.removeClass("disabled")):(o.hasClass("disabled")&&o.removeClass("disabled"),s.hasClass("disabled")&&s.removeClass("disabled"))}});o.on("click",function(){return e(this).hasClass("disabled")||r.swipePrev(),!1}),s.on("click",function(){return e(this).hasClass("disabled")||r.swipeNext(),!1})}}),e("#mp-photo-gallery").each(function(){var t=e(this),i=t.children("ul"),n=i.children("li"),a=t.children("div.re-controls"),o=a.children("a.prev"),s=a.children("a.next");if(n.length>1){a.addClass("enabled");var r=t.swiper({speed:500,mode:"horizontal",loop:!1,simulateTouch:!1,onInit:function(){o.addClass("disabled")},onSlideChangeStart:function(e){var t=n.find("div.pgi-descr");t.animate({height:"hide",opacity:"hide"},500),0==e.activeIndex?(o.hasClass("disabled")||o.addClass("disabled"),s.hasClass("disabled")&&s.removeClass("disabled")):e.activeIndex==e.slides.length-1?(s.hasClass("disabled")||s.addClass("disabled"),o.hasClass("disabled")&&o.removeClass("disabled")):(o.hasClass("disabled")&&o.removeClass("disabled"),s.hasClass("disabled")&&s.removeClass("disabled"))},onSlideChangeEnd:function(e){var t=n.find("div.pgi-descr");t.eq(e.activeIndex).slideDown(250)}});o.on("click",function(){return e(this).hasClass("disabled")||r.swipePrev(),!1}),s.on("click",function(){return e(this).hasClass("disabled")||r.swipeNext(),!1})}}),e("#ps-photo-gallery").each(function(){var t=e(this),i=t.children("ul"),n=i.children("li"),a=t.children("div.re-controls"),o=a.children("a.prev"),s=a.children("a.next");if(n.length>1){a.addClass("enabled"),n.css({display:"block"});var r=t.swiper({speed:500,mode:"horizontal",calculateHeight:!0,loop:!1,simulateTouch:!1,onInit:function(){o.addClass("disabled")},onSlideChangeStart:function(e){0==e.activeIndex?(o.hasClass("disabled")||o.addClass("disabled"),s.hasClass("disabled")&&s.removeClass("disabled")):e.activeIndex==e.slides.length-1?(s.hasClass("disabled")||s.addClass("disabled"),o.hasClass("disabled")&&o.removeClass("disabled")):(o.hasClass("disabled")&&o.removeClass("disabled"),s.hasClass("disabled")&&s.removeClass("disabled"))}});o.on("click",function(){return e(this).hasClass("disabled")||r.swipePrev(),!1}),s.on("click",function(){return e(this).hasClass("disabled")||r.swipeNext(),!1})}}),e("#s-slide-gallery").each(function(){var i=e(this),n=i.children("ul"),a=n.children("li"),o=i.children("div.re-controls"),s=o.children("a.prev"),r=o.children("a.next");if(a.length>4){o.addClass("enabled"),a.css({display:"block"}),t.on("resize",function(){i.height(a.eq(0).height())}).trigger("resize");var l=i.swiper({slidesPerView:4,slidesPerGroup:4,speed:500,mode:"horizontal",calculateHeight:!0,loop:!1,simulateTouch:!1,onInit:function(){s.addClass("disabled")},onSlideChangeStart:function(e){0==e.activeIndex?(s.hasClass("disabled")||s.addClass("disabled"),r.hasClass("disabled")&&r.removeClass("disabled")):e.activeIndex==e.slides.length-4?(r.hasClass("disabled")||r.addClass("disabled"),s.hasClass("disabled")&&s.removeClass("disabled")):(s.hasClass("disabled")&&s.removeClass("disabled"),r.hasClass("disabled")&&r.removeClass("disabled"))}});s.on("click",function(){return e(this).hasClass("disabled")||l.swipePrev(),!1}),r.on("click",function(){return e(this).hasClass("disabled")||l.swipeNext(),!1})}}),e(".sli-slides").each(function(){var i=e(this),n=i.children("ul"),a=n.children("li"),o=i.children("div.re-controls"),s=o.children("a.prev"),r=o.children("a.next");if(a.length>4){o.addClass("enabled"),a.css({display:"block"}),t.on("resize",function(){i.css({height:a.eq(0).height()})}).trigger("resize");var l=i.swiper({slidesPerView:4,slidesPerGroup:4,calculateHeight:!0,speed:500,mode:"horizontal",loop:!1,simulateTouch:!1,onInit:function(){s.addClass("disabled")},onSlideChangeStart:function(e){0==e.activeIndex?(s.hasClass("disabled")||s.addClass("disabled"),r.hasClass("disabled")&&r.removeClass("disabled")):e.activeIndex==e.slides.length-4?(r.hasClass("disabled")||r.addClass("disabled"),s.hasClass("disabled")&&s.removeClass("disabled")):(s.hasClass("disabled")&&s.removeClass("disabled"),r.hasClass("disabled")&&r.removeClass("disabled"))}});s.on("click",function(){return e(this).hasClass("disabled")||l.swipePrev(),!1}),r.on("click",function(){return e(this).hasClass("disabled")||l.swipeNext(),!1})}});var a={padding:0,fitToView:!1};e("a.pw-open").fancybox(a),e("input[placeholder], textarea[placeholder]").placeholder(),i.on("focus",'form.pw-form input[type="text"], form.pw-form input[type="password"]',function(){var t=e(this),i=t.closest(".pwf-line"),n=i.find("div.msg-help"),a=i.find("div.msg-error"),o=e(this).parent().parent().parent().find(".mf-error");a.parent().remove(),o.parent().remove(),n.is(":hidden")&&n.fadeIn(300)}),i.on("blur",'form.pw-form input[type="text"], form.pw-form input[type="password"]',function(){var t=e(this),i=t.closest(".pwf-line"),n=i.find("div.msg-help");n.is(":visible")&&n.fadeOut(300)});var o={scrollInertia:200,contentTouchScroll:!0,scrollButtons:{enable:!1},advanced:{updateOnContentResize:!0}};e("div.scroll-container").each(function(){var t=e(this);t.mCustomScrollbar(o)}),e("#subscribe-sm").each(function(){var t=e(this),i=t.find("a");i.on("click",function(){var t=(e(this),i.index(this)),n=e("#pw-subscribe");e.fancybox(n,a);var o=n.find("ul.tabs > li");return o.eq(t).trigger("click"),!1})}),e("ul.tabs > li").on("click",function(){var t=e(this),i=t.closest("ul"),n=i.children("li").index(this),a=i.siblings(".tabs-content"),o=t.find("a"),s=t.closest("#pw-subscribe");if(!t.hasClass("active")){s.length&&(a=s.find(".tabs-content"));var r=i.children("li.active"),l=a.find("li.active"),c=a.children("li").eq(n);r.removeClass("active"),l.removeClass("active"),t.addClass("active"),c.addClass("active")}return o.blur(),closeSelectBox(),!1}),e("#cli-pg").each(function(){var t=e(this),i=t.find("a");i.on({mouseenter:function(){var t=e(this),i=t.find(".pg-title");i.stop(!0,!0).slideDown(300,function(){i.css({display:"block"})})},mouseleave:function(){var t=e(this),i=t.find(".pg-title");i.stop(!0,!0).slideUp(300)}})}),e("#map-canvas").each(function(){var t=e(this);t.is(":hidden")||(google.maps.event.addDomListener(window,"load",mapInit),t.data("init",!0))}),e("a.toggle-map").on({click:function(){{var t=e(this),i=t.closest(".i-address"),n=i.children(".i-map"),a=e("#map-canvas");i.find("header a.toggle-map")}return n.is(":hidden")?n.stop(!0,!0).animate({opacity:"show",height:"show"},300,function(){a.data("init")||(mapInit(),a.data("init",!0)),i.addClass("map-opened")}):n.stop(!0,!0).animate({opacity:"hide",height:"hide"},300,function(){i.removeClass("map-opened")}),!1}}),e("ul.messages-list").each(function(){var t=e(this),i=t.children("li");i.on({mouseenter:function(){var t=e(this),i=t.find("div.mi-buttons");i.stop(!0,!0).animate({opacity:"show",height:"show"},250)},mouseleave:function(){var t=e(this),i=t.find("div.mi-buttons");i.stop(!0,!0).animate({opacity:"hide",height:"hide"},250)}})}),e(".set-sect > header").on("click",function(){var t=e(this),i=t.closest(".set-sect"),n=i.children("div.set-sect-body");n.is(":visible")?n.stop(!0,!0).animate({height:"hide",opacity:"hide"},300,function(){i.addClass("closed")}):n.stop(!0,!0).animate({height:"show",opacity:"show"},300,function(){i.removeClass("closed")})}),e('input[type="checkbox"].annoncesFlag').each(function(){var t=e(this);t.on("change",function(){var e=t.closest("div.mf-announces").children("div.mf-announces-body"),i=e.find("input, select, textarea"),n=e.find("div.c-select-box");t.prop("checked")?(e.removeClass("disabled"),n.removeClass("disabled"),i.prop("disabled",!1)):(e.addClass("disabled"),n.addClass("disabled"),i.prop("disabled",!0))}).trigger("change")}),e("a.icb-edit-profile").on("click",function(){var t=e(this),i=t.next("a.icb-exit-edit"),n=e("div.p-editable");return t.css({display:"none"}),i.css({display:"inline-block"}),n.addClass("pe-active"),!1}),e("a.icb-exit-edit").on("click",function(){var t=e(this),i=t.prev("a.icb-edit-profile"),n=e("div.p-editable");return i.css({display:"inline-block"}),t.css({display:"none"}),n.removeClass("pe-active"),!1}),e('input[type="file"]').each(function(){var t=e(this),i=t.closest(".input-file"),n=i.children(".file-text");""!=t.val()?(n.text(t.val()),n.removeClass("placeholder")):(n.text(n.data("placeholder")),n.addClass("placeholder")),t.on({change:function(){""!=t.val()?(n.text(t.val()),n.removeClass("placeholder")):(n.text(n.data("placeholder")),n.addClass("placeholder"))}})}),e("form.af-statistic div.mf-stat").each(function(){var t=e(this),i=t.children(".mf-stat-add-button"),n=i.find("a.icon-add");n.on("click",function(){var n=t.children(".mf-stat-item"),a=n.length,o=n.eq(0).find("select").eq(0).find("option").length-1,s=n.eq(0).clone(),r=s.find("select"),l=s.find("input");return l.val(""),r.each(function(){var t=e(this),i=t.closest(".custom-select"),n=t.clone();n.insertAfter(i),n.customSelect(),i.remove()}),s.insertBefore(i),a==o-1&&i.hide(),!1})}),e('input[type="checkbox"].w-time-switcher').each(function(){function t(){var t=n.find("div.w-time"),a=t.eq(0),o=a.find("select");t.each(function(t){var i=e(this);if(0!=t)for(var n=i.find("select"),a=1;a");o.val(n(t)).text(n(t)),i.html(o);for(var s=1;u>s;s++){var l=o.clone();t.setDate(t.getDate()+1),l.val(n(t)).text(n(t)),i.append(l)}i.prop("selectedIndex",0),a.length&&(i.insertAfter(a),a.remove()),i.customSelect()});for(var f=1;u>f;f++){var g=a.clone(),m=g.find("select");g.children("label.check").remove(),m.each(function(t){var i=e(this),n=i.closest(".custom-select");i.insertAfter(n),0==t?i.prop("selectedIndex",f):h.prop("checked")&&i.prop("selectedIndex",p.eq(t).prop("selectedIndex")),n.remove(),i.customSelect()}),c.append(g)}}var a=e(this),o=a.find("input.dateFrom"),s=a.find("input.dateTo"),r=new Date,l=new Date,c=e("#work-time");o.on("change",function(){i()}),s.on("change",function(){i()}),i()}),e("div.request-form").each(function(){{var t=e(this),i=t.find("div.rq-btn-to-hide"),n=i.find("a"),a=t.find("div.rq-form"),o=t.find("div.rq-to-hide");a.find("div.rq-btn-wrap")}n.on("click",function(){return o.hide(),a.animate({height:"show",opacity:"show"},300,function(){t.addClass("rqf-opened")}),!1})}),e("form div.rq-switch").each(function(){function t(){var e=o.find("input, select"),t=o.find("div.c-select-box");n.prop("checked")?(o.removeClass("disabled"),t.removeClass("disabled"),e.prop("disabled",!1)):(o.addClass("disabled"),t.addClass("disabled"),e.prop("checked",!1).prop("disabled",!0),e.trigger("change"))}var i=e(this),n=i.find('input[type="checkbox"]'),a=i.closest(".rq-sub-sect"),o=a.children(".rq-sub-sect-body");t(),n.on("change",t)}),e("a.reply-msg").on("click",function(){var t=e(this).attr("data-sender"),i=e(this).attr("data-reply-message"),n=e("#pw-reply");n.find("#id_recipient").val(t),n.find("#reply_message").val(i)})})}(jQuery),$(document).ready(function(){$("div.ht-main_1").each(function(){$(this).width($("div.serv-links").width())}),$(window).resize(function(){$("div.ht-main_1").each(function(){$(this).width($("div.serv-links").width())})}),$("a.small_link").click(function(){return $("#large img").hide().attr({src:$(this).attr("href"),title:$("> img",this).attr("title")}),!1}),$("#large>img").load(function(){$("#large>img:hidden").fadeIn("slow")}),setTimeout(function(){$("a.subscribe_link").click()},3e3),$(".subscribe_success").click(function(){return $("div.subscribe_before").hide(),$("div.subscribe_after").show(),setTimeout(function(){$("a.fancybox-close").click()},2e3),!1});var e=$("div.subjects_list ul li").length,t=e-5;$("div.subjects_list ul li:gt(4)").hide(),$("div.subjects_list span i").text(t),e>5&&$("div.subjects_list").addClass("more"),$("div.subjects_list span").click(function(){return $(this).parents("div.subjects_list").removeClass("more"),$(this).parents("div.subjects_list").find("li").show(),!1})});var Base64={_keyStr:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",encode:function(e){var t,i,n,a,o,s,r,l="",c=0;for(e=Base64._utf8_encode(e);c>2,o=(3&t)<<4|i>>4,s=(15&i)<<2|n>>6,r=63&n,isNaN(i)?s=r=64:isNaN(n)&&(r=64),l=l+this._keyStr.charAt(a)+this._keyStr.charAt(o)+this._keyStr.charAt(s)+this._keyStr.charAt(r);return l},decode:function(e){var t,i,n,a,o,s,r,l="",c=0;for(e=e.replace(/[^A-Za-z0-9\+\/\=]/g,"");c>4,i=(15&o)<<4|s>>2,n=(3&s)<<6|r,l+=String.fromCharCode(t),64!=s&&(l+=String.fromCharCode(i)),64!=r&&(l+=String.fromCharCode(n));return l=Base64._utf8_decode(l)},_utf8_encode:function(e){e=e.replace(/\r\n/g,"\n");for(var t="",i=0;in?t+=String.fromCharCode(n):n>127&&2048>n?(t+=String.fromCharCode(n>>6|192),t+=String.fromCharCode(63&n|128)):(t+=String.fromCharCode(n>>12|224),t+=String.fromCharCode(n>>6&63|128),t+=String.fromCharCode(63&n|128))}return t},_utf8_decode:function(e){for(var t="",i=0,n=c1=c2=0;in?(t+=String.fromCharCode(n),i++):n>191&&224>n?(c2=e.charCodeAt(i+1),t+=String.fromCharCode((31&n)<<6|63&c2),i+=2):(c2=e.charCodeAt(i+1),c3=e.charCodeAt(i+2),t+=String.fromCharCode((15&n)<<12|(63&c2)<<6|63&c3),i+=3);return t}}; \ No newline at end of file +}),e.fn.mCustomScrollbar){var f={scrollInertia:200,contentTouchScroll:!0,scrollButtons:{enable:!1},advanced:{autoScrollOnFocus:!1,updateOnContentResize:!0}},g=l.find("div.cs-scroll-container");g.mCustomScrollbar(f)}e(document).on("click",function(){o.removeClass("active"),l.hide()}),t.on("change",function(){var i=e(this),n=i.prop("selectedIndex"),a=i.children("option").eq(n).text();s.text(a),0!=n||t.children("option").eq(0).val()&&t.children("option").eq(0).attr("value")?s.removeClass("placeholder"):s.addClass("placeholder")})})},e("select:not([multiple])").each(function(){var t=e(this);t.hasClass("select2")||t.customSelect()}),e("#mp-recent-expo").each(function(){var t=e(this),i=t.children("ul"),n=i.children("li"),a=t.children("div.re-controls"),o=a.children("a.prev"),s=a.children("a.next");if(n.length>1){a.addClass("enabled"),n.css({display:"block"}),t.height(n.eq(0).height());var r=t.swiper({speed:500,mode:"horizontal",loop:!1,simulateTouch:!1,autoplay:4200,onInit:function(){o.addClass("disabled")},onSlideChangeStart:function(e){t.animate({height:n.eq(e.activeIndex).children("div.re-body").height()},300),0==e.activeIndex?(o.hasClass("disabled")||o.addClass("disabled"),s.hasClass("disabled")&&s.removeClass("disabled")):e.activeIndex==e.slides.length-1?(s.hasClass("disabled")||s.addClass("disabled"),o.hasClass("disabled")&&o.removeClass("disabled")):(o.hasClass("disabled")&&o.removeClass("disabled"),s.hasClass("disabled")&&s.removeClass("disabled"))}});o.on("click",function(){return e(this).hasClass("disabled")||r.swipePrev(),!1}),s.on("click",function(){return e(this).hasClass("disabled")||r.swipeNext(),!1})}}),e("#mp-photo-gallery").each(function(){var t=e(this),i=t.children("ul"),n=i.children("li"),a=t.children("div.re-controls"),o=a.children("a.prev"),s=a.children("a.next");if(n.length>1){a.addClass("enabled");var r=t.swiper({speed:500,mode:"horizontal",loop:!1,simulateTouch:!1,onInit:function(){o.addClass("disabled")},onSlideChangeStart:function(e){var t=n.find("div.pgi-descr");t.animate({height:"hide",opacity:"hide"},500),0==e.activeIndex?(o.hasClass("disabled")||o.addClass("disabled"),s.hasClass("disabled")&&s.removeClass("disabled")):e.activeIndex==e.slides.length-1?(s.hasClass("disabled")||s.addClass("disabled"),o.hasClass("disabled")&&o.removeClass("disabled")):(o.hasClass("disabled")&&o.removeClass("disabled"),s.hasClass("disabled")&&s.removeClass("disabled"))},onSlideChangeEnd:function(e){var t=n.find("div.pgi-descr");t.eq(e.activeIndex).slideDown(250)}});o.on("click",function(){return e(this).hasClass("disabled")||r.swipePrev(),!1}),s.on("click",function(){return e(this).hasClass("disabled")||r.swipeNext(),!1})}}),e("#ps-photo-gallery").each(function(){var t=e(this),i=t.children("ul"),n=i.children("li"),a=t.children("div.re-controls"),o=a.children("a.prev"),s=a.children("a.next");if(n.length>1){a.addClass("enabled"),n.css({display:"block"});var r=t.swiper({speed:500,mode:"horizontal",calculateHeight:!0,loop:!1,simulateTouch:!1,onInit:function(){o.addClass("disabled")},onSlideChangeStart:function(e){0==e.activeIndex?(o.hasClass("disabled")||o.addClass("disabled"),s.hasClass("disabled")&&s.removeClass("disabled")):e.activeIndex==e.slides.length-1?(s.hasClass("disabled")||s.addClass("disabled"),o.hasClass("disabled")&&o.removeClass("disabled")):(o.hasClass("disabled")&&o.removeClass("disabled"),s.hasClass("disabled")&&s.removeClass("disabled"))}});o.on("click",function(){return e(this).hasClass("disabled")||r.swipePrev(),!1}),s.on("click",function(){return e(this).hasClass("disabled")||r.swipeNext(),!1})}}),e("#s-slide-gallery").each(function(){var i=e(this),n=i.children("ul"),a=n.children("li"),o=i.children("div.re-controls"),s=o.children("a.prev"),r=o.children("a.next");if(a.length>4){o.addClass("enabled"),a.css({display:"block"}),t.on("resize",function(){i.height(a.eq(0).height())}).trigger("resize");var l=i.swiper({slidesPerView:4,slidesPerGroup:4,speed:500,mode:"horizontal",calculateHeight:!0,loop:!1,simulateTouch:!1,onInit:function(){s.addClass("disabled")},onSlideChangeStart:function(e){0==e.activeIndex?(s.hasClass("disabled")||s.addClass("disabled"),r.hasClass("disabled")&&r.removeClass("disabled")):e.activeIndex==e.slides.length-4?(r.hasClass("disabled")||r.addClass("disabled"),s.hasClass("disabled")&&s.removeClass("disabled")):(s.hasClass("disabled")&&s.removeClass("disabled"),r.hasClass("disabled")&&r.removeClass("disabled"))}});s.on("click",function(){return e(this).hasClass("disabled")||l.swipePrev(),!1}),r.on("click",function(){return e(this).hasClass("disabled")||l.swipeNext(),!1})}}),e(".sli-slides").each(function(){var i=e(this),n=i.children("ul"),a=n.children("li"),o=i.children("div.re-controls"),s=o.children("a.prev"),r=o.children("a.next");if(a.length>4){o.addClass("enabled"),a.css({display:"block"}),t.on("resize",function(){i.css({height:a.eq(0).height()})}).trigger("resize");var l=i.swiper({slidesPerView:4,slidesPerGroup:4,calculateHeight:!0,speed:500,mode:"horizontal",loop:!1,simulateTouch:!1,onInit:function(){s.addClass("disabled")},onSlideChangeStart:function(e){0==e.activeIndex?(s.hasClass("disabled")||s.addClass("disabled"),r.hasClass("disabled")&&r.removeClass("disabled")):e.activeIndex==e.slides.length-4?(r.hasClass("disabled")||r.addClass("disabled"),s.hasClass("disabled")&&s.removeClass("disabled")):(s.hasClass("disabled")&&s.removeClass("disabled"),r.hasClass("disabled")&&r.removeClass("disabled"))}});s.on("click",function(){return e(this).hasClass("disabled")||l.swipePrev(),!1}),r.on("click",function(){return e(this).hasClass("disabled")||l.swipeNext(),!1})}});var a={padding:0,fitToView:!1};e("a.pw-open").fancybox(a),e("input[placeholder], textarea[placeholder]").placeholder(),i.on("focus",'form.pw-form input[type="text"], form.pw-form input[type="password"]',function(){var t=e(this),i=t.closest(".pwf-line"),n=i.find("div.msg-help"),a=i.find("div.msg-error"),o=e(this).parent().parent().parent().find(".mf-error");a.parent().remove(),o.parent().remove(),n.is(":hidden")&&n.fadeIn(300)}),i.on("blur",'form.pw-form input[type="text"], form.pw-form input[type="password"]',function(){var t=e(this),i=t.closest(".pwf-line"),n=i.find("div.msg-help");n.is(":visible")&&n.fadeOut(300)});var o={scrollInertia:200,contentTouchScroll:!0,scrollButtons:{enable:!1},advanced:{updateOnContentResize:!0}};e("div.scroll-container").each(function(){var t=e(this);t.mCustomScrollbar(o)}),e("#subscribe-sm").each(function(){var t=e(this),i=t.find("a");i.on("click",function(){var t=(e(this),i.index(this)),n=e("#pw-subscribe");e.fancybox(n,a);var o=n.find("ul.tabs > li");return o.eq(t).trigger("click"),!1})}),e("ul.tabs > li").on("click",function(){var t=e(this),i=t.closest("ul"),n=i.children("li").index(this),a=i.siblings(".tabs-content"),o=t.find("a"),s=t.closest("#pw-subscribe");if(!t.hasClass("active")){s.length&&(a=s.find(".tabs-content"));var r=i.children("li.active"),l=a.find("li.active"),c=a.children("li").eq(n);r.removeClass("active"),l.removeClass("active"),t.addClass("active"),c.addClass("active")}return o.blur(),closeSelectBox(),!1}),e("#cli-pg").each(function(){var t=e(this),i=t.find("a");i.on({mouseenter:function(){var t=e(this),i=t.find(".pg-title");i.stop(!0,!0).slideDown(300,function(){i.css({display:"block"})})},mouseleave:function(){var t=e(this),i=t.find(".pg-title");i.stop(!0,!0).slideUp(300)}})}),e("#map-canvas").each(function(){var t=e(this);t.is(":hidden")||(google.maps.event.addDomListener(window,"load",mapInit),t.data("init",!0))}),e("a.toggle-map").on({click:function(){{var t=e(this),i=t.closest(".i-address"),n=i.children(".i-map"),a=e("#map-canvas");i.find("header a.toggle-map")}return n.is(":hidden")?n.stop(!0,!0).animate({opacity:"show",height:"show"},300,function(){a.data("init")||(mapInit(),a.data("init",!0)),i.addClass("map-opened")}):n.stop(!0,!0).animate({opacity:"hide",height:"hide"},300,function(){i.removeClass("map-opened")}),!1}}),e("ul.messages-list").each(function(){var t=e(this),i=t.children("li");i.on({mouseenter:function(){var t=e(this),i=t.find("div.mi-buttons");i.stop(!0,!0).animate({opacity:"show",height:"show"},250)},mouseleave:function(){var t=e(this),i=t.find("div.mi-buttons");i.stop(!0,!0).animate({opacity:"hide",height:"hide"},250)}})}),e(".set-sect > header").on("click",function(){var t=e(this),i=t.closest(".set-sect"),n=i.children("div.set-sect-body");n.is(":visible")?n.stop(!0,!0).animate({height:"hide",opacity:"hide"},300,function(){i.addClass("closed")}):n.stop(!0,!0).animate({height:"show",opacity:"show"},300,function(){i.removeClass("closed")})}),e('input[type="checkbox"].annoncesFlag').each(function(){var t=e(this);t.on("change",function(){var e=t.closest("div.mf-announces").children("div.mf-announces-body"),i=e.find("input, select, textarea"),n=e.find("div.c-select-box");t.prop("checked")?(e.removeClass("disabled"),n.removeClass("disabled"),i.prop("disabled",!1)):(e.addClass("disabled"),n.addClass("disabled"),i.prop("disabled",!0))}).trigger("change")}),e("a.icb-edit-profile").on("click",function(){var t=e(this),i=t.next("a.icb-exit-edit"),n=e("div.p-editable");return t.css({display:"none"}),i.css({display:"inline-block"}),n.addClass("pe-active"),!1}),e("a.icb-exit-edit").on("click",function(){var t=e(this),i=t.prev("a.icb-edit-profile"),n=e("div.p-editable");return i.css({display:"inline-block"}),t.css({display:"none"}),n.removeClass("pe-active"),!1}),e('input[type="file"]').each(function(){var t=e(this),i=t.closest(".input-file"),n=i.children(".file-text");""!=t.val()?(n.text(t.val()),n.removeClass("placeholder")):(n.text(n.data("placeholder")),n.addClass("placeholder")),t.on({change:function(){""!=t.val()?(n.text(t.val()),n.removeClass("placeholder")):(n.text(n.data("placeholder")),n.addClass("placeholder"))}})}),e("form.af-statistic div.mf-stat").each(function(){var t=e(this),i=t.children(".mf-stat-add-button"),n=i.find("a.icon-add");n.on("click",function(){var n=t.children(".mf-stat-item"),a=n.length,o=n.eq(0).find("select").eq(0).find("option").length-1,s=n.eq(0).clone(),r=s.find("select"),l=s.find("input");return l.val(""),r.each(function(){var t=e(this),i=t.closest(".custom-select"),n=t.clone();n.insertAfter(i),n.customSelect(),i.remove()}),s.insertBefore(i),a==o-1&&i.hide(),!1})}),e('input[type="checkbox"].w-time-switcher').each(function(){function t(){var t=n.find("div.w-time"),a=t.eq(0),o=a.find("select");t.each(function(t){var i=e(this);if(0!=t)for(var n=i.find("select"),a=1;a");o.val(n(t)).text(n(t)),i.html(o);for(var s=1;u>s;s++){var l=o.clone();t.setDate(t.getDate()+1),l.val(n(t)).text(n(t)),i.append(l)}i.prop("selectedIndex",0),a.length&&(i.insertAfter(a),a.remove()),i.customSelect()});for(var f=1;u>f;f++){var g=a.clone(),m=g.find("select");g.children("label.check").remove(),m.each(function(t){var i=e(this),n=i.closest(".custom-select");i.insertAfter(n),0==t?i.prop("selectedIndex",f):h.prop("checked")&&i.prop("selectedIndex",p.eq(t).prop("selectedIndex")),n.remove(),i.customSelect()}),c.append(g)}}var a=e(this),o=a.find("input.dateFrom"),s=a.find("input.dateTo"),r=new Date,l=new Date,c=e("#work-time");o.on("change",function(){i()}),s.on("change",function(){i()}),i()}),e("div.request-form").each(function(){{var t=e(this),i=t.find("div.rq-btn-to-hide"),n=i.find("a"),a=t.find("div.rq-form"),o=t.find("div.rq-to-hide");a.find("div.rq-btn-wrap")}n.on("click",function(){return o.hide(),a.animate({height:"show",opacity:"show"},300,function(){t.addClass("rqf-opened")}),!1})}),e("form div.rq-switch").each(function(){function t(){var e=o.find("input, select"),t=o.find("div.c-select-box");n.prop("checked")?(o.removeClass("disabled"),t.removeClass("disabled"),e.prop("disabled",!1)):(o.addClass("disabled"),t.addClass("disabled"),e.prop("checked",!1).prop("disabled",!0),e.trigger("change"))}var i=e(this),n=i.find('input[type="checkbox"]'),a=i.closest(".rq-sub-sect"),o=a.children(".rq-sub-sect-body");t(),n.on("change",t)}),e("a.reply-msg").on("click",function(){var t=e(this).attr("data-sender"),i=e(this).attr("data-reply-message"),n=e("#pw-reply");n.find("#id_recipient").val(t),n.find("#reply_message").val(i)})})}(jQuery),$(document).ready(function(){$("div.ht-main_1").each(function(){$(this).width($("div.serv-links").width())}),$(window).resize(function(){$("div.ht-main_1").each(function(){$(this).width($("div.serv-links").width())})}),$("a.small_link").click(function(){return $("#large img").hide().attr({src:$(this).attr("href"),title:$("> img",this).attr("title")}),!1}),$("#large>img").load(function(){$("#large>img:hidden").fadeIn("slow")}),setTimeout(function(){$("a.subscribe_link").click()},3e3),$(".subscribe_success").click(function(){return $("div.subscribe_before").hide(),$("div.subscribe_after").show(),setTimeout(function(){$("a.fancybox-close").click()},2e3),!1});var e=$("div.subjects_list ul li").length,t=e-5;$("div.subjects_list ul li:gt(4)").hide(),$("div.subjects_list span i").text(t),e>5&&$("div.subjects_list").addClass("more"),$("div.subjects_list span").click(function(){return $(this).parents("div.subjects_list").removeClass("more"),$(this).parents("div.subjects_list").find("li").show(),!1})});var Base64={_keyStr:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",encode:function(e){var t,i,n,a,o,s,r,l="",c=0;for(e=Base64._utf8_encode(e);c>2,o=(3&t)<<4|i>>4,s=(15&i)<<2|n>>6,r=63&n,isNaN(i)?s=r=64:isNaN(n)&&(r=64),l=l+this._keyStr.charAt(a)+this._keyStr.charAt(o)+this._keyStr.charAt(s)+this._keyStr.charAt(r);return l},decode:function(e){var t,i,n,a,o,s,r,l="",c=0;for(e=e.replace(/[^A-Za-z0-9\+\/\=]/g,"");c>4,i=(15&o)<<4|s>>2,n=(3&s)<<6|r,l+=String.fromCharCode(t),64!=s&&(l+=String.fromCharCode(i)),64!=r&&(l+=String.fromCharCode(n));return l=Base64._utf8_decode(l)},_utf8_encode:function(e){e=e.replace(/\r\n/g,"\n");for(var t="",i=0;in?t+=String.fromCharCode(n):n>127&&2048>n?(t+=String.fromCharCode(n>>6|192),t+=String.fromCharCode(63&n|128)):(t+=String.fromCharCode(n>>12|224),t+=String.fromCharCode(n>>6&63|128),t+=String.fromCharCode(63&n|128))}return t},_utf8_decode:function(e){for(var t="",i=0,n=c1=c2=0;in?(t+=String.fromCharCode(n),i++):n>191&&224>n?(c2=e.charCodeAt(i+1),t+=String.fromCharCode((31&n)<<6|63&c2),i+=2):(c2=e.charCodeAt(i+1),c3=e.charCodeAt(i+2),t+=String.fromCharCode((15&n)<<12|(63&c2)<<6|63&c3),i+=3);return t}}; \ No newline at end of file