!function(e){"function"==typeof define&&define.amd?define(["jquery"],e):e(jQuery)}(function(a){var e,t,n,i;function r(e,t){var n,i,r,o=e.nodeName.toLowerCase();return"area"===o?(i=(n=e.parentNode).name,!(!e.href||!i||"map"!==n.nodeName.toLowerCase())&&(!!(r=a("img[usemap='#"+i+"']")[0])&&s(r))):(/^(input|select|textarea|button|object)$/.test(o)?!e.disabled:"a"===o&&e.href||t)&&s(e)}function s(e){return a.expr.filters.visible(e)&&!a(e).parents().addBack().filter(function(){return"hidden"===a.css(this,"visibility")}).length}a.ui=a.ui||{},a.extend(a.ui,{version:"1.11.4",keyCode:{BACKSPACE:8,COMMA:188,DELETE:46,DOWN:40,END:35,ENTER:13,ESCAPE:27,HOME:36,LEFT:37,PAGE_DOWN:34,PAGE_UP:33,PERIOD:190,RIGHT:39,SPACE:32,TAB:9,UP:38}}),a.fn.extend({scrollParent:function(e){var t=this.css("position"),n="absolute"===t,i=e?/(auto|scroll|hidden)/:/(auto|scroll)/,r=this.parents().filter(function(){var e=a(this);return(!n||"static"!==e.css("position"))&&i.test(e.css("overflow")+e.css("overflow-y")+e.css("overflow-x"))}).eq(0);return"fixed"!==t&&r.length?r:a(this[0].ownerDocument||document)},uniqueId:(e=0,function(){return this.each(function(){this.id||(this.id="ui-id-"+ ++e)})}),removeUniqueId:function(){return this.each(function(){/^ui-id-\d+$/.test(this.id)&&a(this).removeAttr("id")})}}),a.extend(a.expr[":"],{data:a.expr.createPseudo?a.expr.createPseudo(function(t){return function(e){return!!a.data(e,t)}}):function(e,t,n){return!!a.data(e,n[3])},focusable:function(e){return r(e,!isNaN(a.attr(e,"tabindex")))},tabbable:function(e){var t=a.attr(e,"tabindex"),n=isNaN(t);return(n||0<=t)&&r(e,!n)}}),a("").outerWidth(1).jquery||a.each(["Width","Height"],function(e,n){var r="Width"===n?["Left","Right"]:["Top","Bottom"],i=n.toLowerCase(),o={innerWidth:a.fn.innerWidth,innerHeight:a.fn.innerHeight,outerWidth:a.fn.outerWidth,outerHeight:a.fn.outerHeight};function s(e,t,n,i){return a.each(r,function(){t-=parseFloat(a.css(e,"padding"+this))||0,n&&(t-=parseFloat(a.css(e,"border"+this+"Width"))||0),i&&(t-=parseFloat(a.css(e,"margin"+this))||0)}),t}a.fn["inner"+n]=function(e){return void 0===e?o["inner"+n].call(this):this.each(function(){a(this).css(i,s(this,e)+"px")})},a.fn["outer"+n]=function(e,t){return"number"!=typeof e?o["outer"+n].call(this,e):this.each(function(){a(this).css(i,s(this,e,!0,t)+"px")})}}),a.fn.addBack||(a.fn.addBack=function(e){return this.add(null==e?this.prevObject:this.prevObject.filter(e))}),a("").data("a-b","a").removeData("a-b").data("a-b")&&(a.fn.removeData=(t=a.fn.removeData,function(e){return arguments.length?t.call(this,a.camelCase(e)):t.call(this)})),a.ui.ie=!!/msie [\w.]+/.exec(navigator.userAgent.toLowerCase()),a.fn.extend({focus:(i=a.fn.focus,function(t,n){return"number"==typeof t?this.each(function(){var e=this;setTimeout(function(){a(e).focus(),n&&n.call(e)},t)}):i.apply(this,arguments)}),disableSelection:(n="onselectstart"in document.createElement("div")?"selectstart":"mousedown",function(){return this.bind(n+".ui-disableSelection",function(e){e.preventDefault()})}),enableSelection:function(){return this.unbind(".ui-disableSelection")},zIndex:function(e){if(void 0!==e)return this.css("zIndex",e);if(this.length)for(var t,n,i=a(this[0]);i.length&&i[0]!==document;){if(("absolute"===(t=i.css("position"))||"relative"===t||"fixed"===t)&&(n=parseInt(i.css("zIndex"),10),!isNaN(n)&&0!==n))return n;i=i.parent()}return 0}}),a.ui.plugin={add:function(e,t,n){var i,r=a.ui[e].prototype;for(i in n)r.plugins[i]=r.plugins[i]||[],r.plugins[i].push([t,n[i]])},call:function(e,t,n,i){var r,o=e.plugins[t];if(o&&(i||e.element[0].parentNode&&11!==e.element[0].parentNode.nodeType))for(r=0;r",options:{disabled:!1,create:null},_createWidget:function(t,e){e=h(e||this.defaultElement||this)[0],this.element=h(e),this.uuid=i++,this.eventNamespace="."+this.widgetName+this.uuid,this.bindings=h(),this.hoverable=h(),this.focusable=h(),e!==this&&(h.data(e,this.widgetFullName,this),this._on(!0,this.element,{remove:function(t){t.target===e&&this.destroy()}}),this.document=h(e.style?e.ownerDocument:e.document||e),this.window=h(this.document[0].defaultView||this.document[0].parentWindow)),this.options=h.widget.extend({},this.options,this._getCreateOptions(),t),this._create(),this._trigger("create",null,this._getCreateEventData()),this._init()},_getCreateOptions:h.noop,_getCreateEventData:h.noop,_create:h.noop,_init:h.noop,destroy:function(){this._destroy(),this.element.unbind(this.eventNamespace).removeData(this.widgetFullName).removeData(h.camelCase(this.widgetFullName)),this.widget().unbind(this.eventNamespace).removeAttr("aria-disabled").removeClass(this.widgetFullName+"-disabled ui-state-disabled"),this.bindings.unbind(this.eventNamespace),this.hoverable.removeClass("ui-state-hover"),this.focusable.removeClass("ui-state-focus")},_destroy:h.noop,widget:function(){return this.element},option:function(t,e){var i,n,s,o=t;if(0===arguments.length)return h.widget.extend({},this.options);if("string"==typeof t)if(o={},t=(i=t.split(".")).shift(),i.length){for(n=o[t]=h.widget.extend({},this.options[t]),s=0;s=this.options.distance},_mouseDelayMet:function(){return this.mouseDelayMet},_mouseStart:function(){},_mouseDrag:function(){},_mouseStop:function(){},_mouseCapture:function(){return!0}})}); !function(t){"function"==typeof define&&define.amd?define(["jquery","./core","./mouse","./widget"],t):t(jQuery)}(function(u){return u.widget("ui.sortable",u.ui.mouse,{version:"1.11.4",widgetEventPrefix:"sort",ready:!1,options:{appendTo:"parent",axis:!1,connectWith:!1,containment:!1,cursor:"auto",cursorAt:!1,dropOnEmpty:!0,forcePlaceholderSize:!1,forceHelperSize:!1,grid:!1,handle:!1,helper:"original",items:"> *",opacity:!1,placeholder:!1,revert:!1,scroll:!0,scrollSensitivity:20,scrollSpeed:20,scope:"default",tolerance:"intersect",zIndex:1e3,activate:null,beforeStop:null,change:null,deactivate:null,out:null,over:null,receive:null,remove:null,sort:null,start:null,stop:null,update:null},_isOverAxis:function(t,e,i){return e<=t&&t*{ cursor: "+r.cursor+" !important; }").appendTo(o)),r.opacity&&(this.helper.css("opacity")&&(this._storedOpacity=this.helper.css("opacity")),this.helper.css("opacity",r.opacity)),r.zIndex&&(this.helper.css("zIndex")&&(this._storedZIndex=this.helper.css("zIndex")),this.helper.css("zIndex",r.zIndex)),this.scrollParent[0]!==this.document[0]&&"HTML"!==this.scrollParent[0].tagName&&(this.overflowOffset=this.scrollParent.offset()),this._trigger("start",t,this._uiHash()),this._preserveHelperProportions||this._cacheHelperProportions(),!i)for(s=this.containers.length-1;0<=s;s--)this.containers[s]._trigger("activate",t,this._uiHash(this));return u.ui.ddmanager&&(u.ui.ddmanager.current=this),u.ui.ddmanager&&!r.dropBehaviour&&u.ui.ddmanager.prepareOffsets(this,t),this.dragging=!0,this.helper.addClass("ui-sortable-helper"),this._mouseDrag(t),!0},_mouseDrag:function(t){var e,i,s,o,r=this.options,n=!1;for(this.position=this._generatePosition(t),this.positionAbs=this._convertPositionTo("absolute"),this.lastPositionAbs||(this.lastPositionAbs=this.positionAbs),this.options.scroll&&(this.scrollParent[0]!==this.document[0]&&"HTML"!==this.scrollParent[0].tagName?(this.overflowOffset.top+this.scrollParent[0].offsetHeight-t.pageYt[this.floating?"width":"height"]?u:r",i.document[0]).addClass(s||i.currentItem[0].className+" ui-sortable-placeholder").removeClass("ui-sortable-helper");return"tbody"===t?i._createTrPlaceholder(i.currentItem.find("tr").eq(0),u("",i.document[0]).appendTo(e)):"tr"===t?i._createTrPlaceholder(i.currentItem,e):"img"===t&&e.attr("src",i.currentItem.attr("src")),s||e.css("visibility","hidden"),e},update:function(t,e){s&&!o.forcePlaceholderSize||(e.height()||e.height(i.currentItem.innerHeight()-parseInt(i.currentItem.css("paddingTop")||0,10)-parseInt(i.currentItem.css("paddingBottom")||0,10)),e.width()||e.width(i.currentItem.innerWidth()-parseInt(i.currentItem.css("paddingLeft")||0,10)-parseInt(i.currentItem.css("paddingRight")||0,10)))}}),i.placeholder=u(o.placeholder.element.call(i.element,i.currentItem)),i.currentItem.after(i.placeholder),o.placeholder.update(i,i.placeholder)},_createTrPlaceholder:function(t,e){var i=this;t.children().each(function(){u(" ",i.document[0]).attr("colspan",u(this).attr("colspan")||1).appendTo(e)})},_contactContainers:function(t){var e,i,s,o,r,n,h,a,l,c,p=null,f=null;for(e=this.containers.length-1;0<=e;e--)if(!u.contains(this.currentItem[0],this.containers[e].element[0]))if(this._intersectsWith(this.containers[e].containerCache)){if(p&&u.contains(this.containers[e].element[0],p.element[0]))continue;p=this.containers[e],f=e}else this.containers[e].containerCache.over&&(this.containers[e]._trigger("out",t,this._uiHash(this)),this.containers[e].containerCache.over=0);if(p)if(1===this.containers.length)this.containers[f].containerCache.over||(this.containers[f]._trigger("over",t,this._uiHash(this)),this.containers[f].containerCache.over=1);else{for(s=1e4,o=null,r=(l=p.floating||this._isFloating(this.currentItem))?"left":"top",n=l?"width":"height",c=l?"clientX":"clientY",i=this.items.length-1;0<=i;i--)u.contains(this.containers[f].element[0],this.items[i].item[0])&&this.items[i].item[0]!==this.currentItem[0]&&(h=this.items[i].item.offset()[r],a=!1,t[c]-h>this.items[i][n]/2&&(a=!0),Math.abs(t[c]-h)this.containment[2]&&(o=this.containment[2]+this.offset.click.left),t.pageY-this.offset.click.top>this.containment[3]&&(r=this.containment[3]+this.offset.click.top)),s.grid&&(e=this.originalPageY+Math.round((r-this.originalPageY)/s.grid[1])*s.grid[1],r=this.containment?e-this.offset.click.top>=this.containment[1]&&e-this.offset.click.top<=this.containment[3]?e:e-this.offset.click.top>=this.containment[1]?e-s.grid[1]:e+s.grid[1]:e,i=this.originalPageX+Math.round((o-this.originalPageX)/s.grid[0])*s.grid[0],o=this.containment?i-this.offset.click.left>=this.containment[0]&&i-this.offset.click.left<=this.containment[2]?i:i-this.offset.click.left>=this.containment[0]?i-s.grid[0]:i+s.grid[0]:i)),{top:r-this.offset.click.top-this.offset.relative.top-this.offset.parent.top+("fixed"===this.cssPosition?-this.scrollParent.scrollTop():h?0:n.scrollTop()),left:o-this.offset.click.left-this.offset.relative.left-this.offset.parent.left+("fixed"===this.cssPosition?-this.scrollParent.scrollLeft():h?0:n.scrollLeft())}},_rearrange:function(t,e,i,s){i?i[0].appendChild(this.placeholder[0]):e.item[0].parentNode.insertBefore(this.placeholder[0],"down"===this.direction?e.item[0]:e.item[0].nextSibling),this.counter=this.counter?++this.counter:1;var o=this.counter;this._delay(function(){o===this.counter&&this.refreshPositions(!s)})},_clear:function(t,e){this.reverting=!1;var i,s=[];if(!this._noFinalSort&&this.currentItem.parent().length&&this.placeholder.before(this.currentItem),this._noFinalSort=null,this.helper[0]===this.currentItem[0]){for(i in this._storedCSS)"auto"!==this._storedCSS[i]&&"static"!==this._storedCSS[i]||(this._storedCSS[i]="");this.currentItem.css(this._storedCSS).removeClass("ui-sortable-helper")}else this.currentItem.show();function o(e,i,s){return function(t){s._trigger(e,t,i._uiHash(i))}}for(this.fromOutside&&!e&&s.push(function(t){this._trigger("receive",t,this._uiHash(this.fromOutside))}),!this.fromOutside&&this.domPosition.prev===this.currentItem.prev().not(".ui-sortable-helper")[0]&&this.domPosition.parent===this.currentItem.parent()[0]||e||s.push(function(t){this._trigger("update",t,this._uiHash())}),this!==this.currentContainer&&(e||(s.push(function(t){this._trigger("remove",t,this._uiHash())}),s.push(function(e){return function(t){e._trigger("receive",t,this._uiHash(this))}}.call(this,this.currentContainer)),s.push(function(e){return function(t){e._trigger("update",t,this._uiHash(this))}}.call(this,this.currentContainer)))),i=this.containers.length-1;0<=i;i--)e||s.push(o("deactivate",this,this.containers[i])),this.containers[i].containerCache.over&&(s.push(o("out",this,this.containers[i])),this.containers[i].containerCache.over=0);if(this.storedCursor&&(this.document.find("body").css("cursor",this.storedCursor),this.storedStylesheet.remove()),this._storedOpacity&&this.helper.css("opacity",this._storedOpacity),this._storedZIndex&&this.helper.css("zIndex","auto"===this._storedZIndex?"":this._storedZIndex),this.dragging=!1,e||this._trigger("beforeStop",t,this._uiHash()),this.placeholder[0].parentNode.removeChild(this.placeholder[0]),this.cancelHelperRemoval||(this.helper[0]!==this.currentItem[0]&&this.helper.remove(),this.helper=null),!e){for(i=0;i?@\[\]\^`{|}~]/g,"\\$&"):""},refresh:function(){var t=this.options,e=this.tablist.children(":has(a[href])");t.disabled=l.map(e.filter(".ui-state-disabled"),function(t){return e.index(t)}),this._processTabs(),!1!==t.active&&this.anchors.length?this.active.length&&!l.contains(this.tablist[0],this.active[0])?this.tabs.length===t.disabled.length?(t.active=!1,this.active=l()):this._activate(this._findNextTab(Math.max(0,t.active-1),!1)):t.active=this.tabs.index(this.active):(t.active=!1,this.active=l()),this._refresh()},_refresh:function(){this._setupDisabled(this.options.disabled),this._setupEvents(this.options.event),this._setupHeightStyle(this.options.heightStyle),this.tabs.not(this.active).attr({"aria-selected":"false","aria-expanded":"false",tabIndex:-1}),this.panels.not(this._getPanelForTab(this.active)).hide().attr({"aria-hidden":"true"}),this.active.length?(this.active.addClass("ui-tabs-active ui-state-active").attr({"aria-selected":"true","aria-expanded":"true",tabIndex:0}),this._getPanelForTab(this.active).show().attr({"aria-hidden":"false"})):this.tabs.eq(0).attr("tabIndex",0)},_processTabs:function(){var o=this,t=this.tabs,e=this.anchors,i=this.panels;this.tablist=this._getList().addClass("ui-tabs-nav ui-helper-reset ui-helper-clearfix ui-widget-header ui-corner-all").attr("role","tablist").delegate("> li","mousedown"+this.eventNamespace,function(t){l(this).is(".ui-state-disabled")&&t.preventDefault()}).delegate(".ui-tabs-anchor","focus"+this.eventNamespace,function(){l(this).closest("li").is(".ui-state-disabled")&&this.blur()}),this.tabs=this.tablist.find("> li:has(a[href])").addClass("ui-state-default ui-corner-top").attr({role:"tab",tabIndex:-1}),this.anchors=this.tabs.map(function(){return l("a",this)[0]}).addClass("ui-tabs-anchor").attr({role:"presentation",tabIndex:-1}),this.panels=l(),this.anchors.each(function(t,e){var i,a,s,n=l(e).uniqueId().attr("id"),r=l(e).closest("li"),h=r.attr("aria-controls");o._isLocal(e)?(s=(i=e.hash).substring(1),a=o.element.find(o._sanitizeSelector(i))):(i="#"+(s=r.attr("aria-controls")||l({}).uniqueId()[0].id),(a=o.element.find(i)).length||(a=o._createPanel(s)).insertAfter(o.panels[t-1]||o.tablist),a.attr("aria-live","polite")),a.length&&(o.panels=o.panels.add(a)),h&&r.data("ui-tabs-aria-controls",h),r.attr({"aria-controls":s,"aria-labelledby":n}),a.attr("aria-labelledby",n)}),this.panels.addClass("ui-tabs-panel ui-widget-content ui-corner-bottom").attr("role","tabpanel"),t&&(this._off(t.not(this.tabs)),this._off(e.not(this.anchors)),this._off(i.not(this.panels)))},_getList:function(){return this.tablist||this.element.find("ol,ul").eq(0)},_createPanel:function(t){return l("
").attr("id",t).addClass("ui-tabs-panel ui-widget-content ui-corner-bottom").data("ui-tabs-destroy",!0)},_setupDisabled:function(t){l.isArray(t)&&(t.length?t.length===this.anchors.length&&(t=!0):t=!1);for(var e,i=0;e=this.tabs[i];i++)!0===t||-1!==l.inArray(i,t)?l(e).addClass("ui-state-disabled").attr("aria-disabled","true"):l(e).removeClass("ui-state-disabled").removeAttr("aria-disabled");this.options.disabled=t},_setupEvents:function(t){var i={};t&&l.each(t.split(" "),function(t,e){i[e]="_eventHandler"}),this._off(this.anchors.add(this.tabs).add(this.panels)),this._on(!0,this.anchors,{click:function(t){t.preventDefault()}}),this._on(this.anchors,i),this._on(this.tabs,{keydown:"_tabKeydown"}),this._on(this.panels,{keydown:"_panelKeydown"}),this._focusable(this.tabs),this._hoverable(this.tabs)},_setupHeightStyle:function(t){var i,e=this.element.parent();"fill"===t?(i=e.height(),i-=this.element.outerHeight()-this.element.height(),this.element.siblings(":visible").each(function(){var t=l(this),e=t.css("position");"absolute"!==e&&"fixed"!==e&&(i-=t.outerHeight(!0))}),this.element.children().not(this.panels).each(function(){i-=l(this).outerHeight(!0)}),this.panels.each(function(){l(this).height(Math.max(0,i-l(this).innerHeight()+l(this).height()))}).css("overflow","auto")):"auto"===t&&(i=0,this.panels.each(function(){i=Math.max(i,l(this).height("").height())}).height(i))},_eventHandler:function(t){var e=this.options,i=this.active,a=l(t.currentTarget).closest("li"),s=a[0]===i[0],n=s&&e.collapsible,r=n?l():this._getPanelForTab(a),h=i.length?this._getPanelForTab(i):l(),o={oldTab:i,oldPanel:h,newTab:n?l():a,newPanel:r};t.preventDefault(),a.hasClass("ui-state-disabled")||a.hasClass("ui-tabs-loading")||this.running||s&&!e.collapsible||!1===this._trigger("beforeActivate",t,o)||(e.active=!n&&this.tabs.index(a),this.active=s?l():a,this.xhr&&this.xhr.abort(),h.length||r.length||l.error("jQuery UI Tabs: Mismatching fragment identifier."),r.length&&this.load(this.tabs.index(a),t),this._toggle(t,o))},_toggle:function(t,e){var i=this,a=e.newPanel,s=e.oldPanel;function n(){i.running=!1,i._trigger("activate",t,e)}function r(){e.newTab.closest("li").addClass("ui-tabs-active ui-state-active"),a.length&&i.options.show?i._show(a,i.options.show,n):(a.show(),n())}this.running=!0,s.length&&this.options.hide?this._hide(s,this.options.hide,function(){e.oldTab.closest("li").removeClass("ui-tabs-active ui-state-active"),r()}):(e.oldTab.closest("li").removeClass("ui-tabs-active ui-state-active"),s.hide(),r()),s.attr("aria-hidden","true"),e.oldTab.attr({"aria-selected":"false","aria-expanded":"false"}),a.length&&s.length?e.oldTab.attr("tabIndex",-1):a.length&&this.tabs.filter(function(){return 0===l(this).attr("tabIndex")}).attr("tabIndex",-1),a.attr("aria-hidden","false"),e.newTab.attr({"aria-selected":"true","aria-expanded":"true",tabIndex:0})},_activate:function(t){var e,i=this._findActive(t);i[0]!==this.active[0]&&(i.length||(i=this.active),e=i.find(".ui-tabs-anchor")[0],this._eventHandler({target:e,currentTarget:e,preventDefault:l.noop}))},_findActive:function(t){return!1===t?l():this.tabs.eq(t)},_getIndex:function(t){return"string"==typeof t&&(t=this.anchors.index(this.anchors.filter("[href$='"+t+"']"))),t},_destroy:function(){this.xhr&&this.xhr.abort(),this.element.removeClass("ui-tabs ui-widget ui-widget-content ui-corner-all ui-tabs-collapsible"),this.tablist.removeClass("ui-tabs-nav ui-helper-reset ui-helper-clearfix ui-widget-header ui-corner-all").removeAttr("role"),this.anchors.removeClass("ui-tabs-anchor").removeAttr("role").removeAttr("tabIndex").removeUniqueId(),this.tablist.unbind(this.eventNamespace),this.tabs.add(this.panels).each(function(){l.data(this,"ui-tabs-destroy")?l(this).remove():l(this).removeClass("ui-state-default ui-state-active ui-state-disabled ui-corner-top ui-corner-bottom ui-widget-content ui-tabs-active ui-tabs-panel").removeAttr("tabIndex").removeAttr("aria-live").removeAttr("aria-busy").removeAttr("aria-selected").removeAttr("aria-labelledby").removeAttr("aria-hidden").removeAttr("aria-expanded").removeAttr("role")}),this.tabs.each(function(){var t=l(this),e=t.data("ui-tabs-aria-controls");e?t.attr("aria-controls",e).removeData("ui-tabs-aria-controls"):t.removeAttr("aria-controls")}),this.panels.show(),"content"!==this.options.heightStyle&&this.panels.css("height","")},enable:function(i){var t=this.options.disabled;!1!==t&&(t=void 0!==i&&(i=this._getIndex(i),l.isArray(t)?l.map(t,function(t){return t!==i?t:null}):l.map(this.tabs,function(t,e){return e!==i?e:null})),this._setupDisabled(t))},disable:function(t){var e=this.options.disabled;if(!0!==e){if(void 0===t)e=!0;else{if(t=this._getIndex(t),-1!==l.inArray(t,e))return;e=l.isArray(e)?l.merge([t],e).sort():[t]}this._setupDisabled(e)}},load:function(t,a){t=this._getIndex(t);function s(t,e){"abort"===e&&n.panels.stop(!1,!0),i.removeClass("ui-tabs-loading"),r.removeAttr("aria-busy"),t===n.xhr&&delete n.xhr}var n=this,i=this.tabs.eq(t),e=i.find(".ui-tabs-anchor"),r=this._getPanelForTab(i),h={tab:i,panel:r};this._isLocal(e[0])||(this.xhr=l.ajax(this._ajaxSettings(e,a,h)),this.xhr&&"canceled"!==this.xhr.statusText&&(i.addClass("ui-tabs-loading"),r.attr("aria-busy","true"),this.xhr.done(function(t,e,i){setTimeout(function(){r.html(t),n._trigger("load",a,h),s(i,e)},1)}).fail(function(t,e){setTimeout(function(){s(t,e)},1)})))},_ajaxSettings:function(t,i,a){var s=this;return{url:t.attr("href"),beforeSend:function(t,e){return s._trigger("beforeLoad",i,l.extend({jqXHR:t,ajaxSettings:e},a))}}},_getPanelForTab:function(t){var e=l(t).attr("aria-controls");return this.element.find(this._sanitizeSelector("#"+e))}});var a}); !function(e){"function"==typeof define&&define.amd?define(["jquery","./core","./widget"],e):e(jQuery)}(function(d){return d.widget("ui.accordion",{version:"1.11.4",options:{active:0,animate:{},collapsible:!1,event:"click",header:"> li > :first-child,> :not(li):even",heightStyle:"auto",icons:{activeHeader:"ui-icon-triangle-1-s",header:"ui-icon-triangle-1-e"},activate:null,beforeActivate:null},hideProps:{borderTopWidth:"hide",borderBottomWidth:"hide",paddingTop:"hide",paddingBottom:"hide",height:"hide"},showProps:{borderTopWidth:"show",borderBottomWidth:"show",paddingTop:"show",paddingBottom:"show",height:"show"},_create:function(){var e=this.options;this.prevShow=this.prevHide=d(),this.element.addClass("ui-accordion ui-widget ui-helper-reset").attr("role","tablist"),e.collapsible||!1!==e.active&&null!=e.active||(e.active=0),this._processPanels(),e.active<0&&(e.active+=this.headers.length),this._refresh()},_getCreateEventData:function(){return{header:this.active,panel:this.active.length?this.active.next():d()}},_createIcons:function(){var e=this.options.icons;e&&(d("").addClass("ui-accordion-header-icon ui-icon "+e.header).prependTo(this.headers),this.active.children(".ui-accordion-header-icon").removeClass(e.header).addClass(e.activeHeader),this.headers.addClass("ui-accordion-icons"))},_destroyIcons:function(){this.headers.removeClass("ui-accordion-icons").children(".ui-accordion-header-icon").remove()},_destroy:function(){var e;this.element.removeClass("ui-accordion ui-widget ui-helper-reset").removeAttr("role"),this.headers.removeClass("ui-accordion-header ui-accordion-header-active ui-state-default ui-corner-all ui-state-active ui-state-disabled ui-corner-top").removeAttr("role").removeAttr("aria-expanded").removeAttr("aria-selected").removeAttr("aria-controls").removeAttr("tabIndex").removeUniqueId(),this._destroyIcons(),e=this.headers.next().removeClass("ui-helper-reset ui-widget-content ui-corner-bottom ui-accordion-content ui-accordion-content-active ui-state-disabled").css("display","").removeAttr("role").removeAttr("aria-hidden").removeAttr("aria-labelledby").removeUniqueId(),"content"!==this.options.heightStyle&&e.css("height","")},_setOption:function(e,t){"active"!==e?("event"===e&&(this.options.event&&this._off(this.headers,this.options.event),this._setupEvents(t)),this._super(e,t),"collapsible"!==e||t||!1!==this.options.active||this._activate(0),"icons"===e&&(this._destroyIcons(),t&&this._createIcons()),"disabled"===e&&(this.element.toggleClass("ui-state-disabled",!!t).attr("aria-disabled",t),this.headers.add(this.headers.next()).toggleClass("ui-state-disabled",!!t))):this._activate(t)},_keydown:function(e){if(!e.altKey&&!e.ctrlKey){var t=d.ui.keyCode,i=this.headers.length,a=this.headers.index(e.target),s=!1;switch(e.keyCode){case t.RIGHT:case t.DOWN:s=this.headers[(a+1)%i];break;case t.LEFT:case t.UP:s=this.headers[(a-1+i)%i];break;case t.SPACE:case t.ENTER:this._eventHandler(e);break;case t.HOME:s=this.headers[0];break;case t.END:s=this.headers[i-1]}s&&(d(e.target).attr("tabIndex",-1),d(s).attr("tabIndex",0),s.focus(),e.preventDefault())}},_panelKeyDown:function(e){e.keyCode===d.ui.keyCode.UP&&e.ctrlKey&&d(e.currentTarget).prev().focus()},refresh:function(){var e=this.options;this._processPanels(),!1===e.active&&!0===e.collapsible||!this.headers.length?(e.active=!1,this.active=d()):!1===e.active?this._activate(0):this.active.length&&!d.contains(this.element[0],this.active[0])?this.headers.length===this.headers.find(".ui-state-disabled").length?(e.active=!1,this.active=d()):this._activate(Math.max(0,e.active-1)):e.active=this.headers.index(this.active),this._destroyIcons(),this._refresh()},_processPanels:function(){var e=this.headers,t=this.panels;this.headers=this.element.find(this.options.header).addClass("ui-accordion-header ui-state-default ui-corner-all"),this.panels=this.headers.next().addClass("ui-accordion-content ui-helper-reset ui-widget-content ui-corner-bottom").filter(":not(.ui-accordion-content-active)").hide(),t&&(this._off(e.not(this.headers)),this._off(t.not(this.panels)))},_refresh:function(){var i,e=this.options,t=e.heightStyle,a=this.element.parent();this.active=this._findActive(e.active).addClass("ui-accordion-header-active ui-state-active ui-corner-top").removeClass("ui-corner-all"),this.active.next().addClass("ui-accordion-content-active").show(),this.headers.attr("role","tab").each(function(){var e=d(this),t=e.uniqueId().attr("id"),i=e.next(),a=i.uniqueId().attr("id");e.attr("aria-controls",a),i.attr("aria-labelledby",t)}).next().attr("role","tabpanel"),this.headers.not(this.active).attr({"aria-selected":"false","aria-expanded":"false",tabIndex:-1}).next().attr({"aria-hidden":"true"}).hide(),this.active.length?this.active.attr({"aria-selected":"true","aria-expanded":"true",tabIndex:0}).next().attr({"aria-hidden":"false"}):this.headers.eq(0).attr("tabIndex",0),this._createIcons(),this._setupEvents(e.event),"fill"===t?(i=a.height(),this.element.siblings(":visible").each(function(){var e=d(this),t=e.css("position");"absolute"!==t&&"fixed"!==t&&(i-=e.outerHeight(!0))}),this.headers.each(function(){i-=d(this).outerHeight(!0)}),this.headers.next().each(function(){d(this).height(Math.max(0,i-d(this).innerHeight()+d(this).height()))}).css("overflow","auto")):"auto"===t&&(i=0,this.headers.next().each(function(){i=Math.max(i,d(this).css("height","").height())}).height(i))},_activate:function(e){var t=this._findActive(e)[0];t!==this.active[0]&&(t=t||this.active[0],this._eventHandler({target:t,currentTarget:t,preventDefault:d.noop}))},_findActive:function(e){return"number"==typeof e?this.headers.eq(e):d()},_setupEvents:function(e){var i={keydown:"_keydown"};e&&d.each(e.split(" "),function(e,t){i[t]="_eventHandler"}),this._off(this.headers.add(this.headers.next())),this._on(this.headers,i),this._on(this.headers.next(),{keydown:"_panelKeyDown"}),this._hoverable(this.headers),this._focusable(this.headers)},_eventHandler:function(e){var t=this.options,i=this.active,a=d(e.currentTarget),s=a[0]===i[0],n=s&&t.collapsible,r=n?d():a.next(),o=i.next(),h={oldHeader:i,oldPanel:o,newHeader:n?d():a,newPanel:r};e.preventDefault(),s&&!t.collapsible||!1===this._trigger("beforeActivate",e,h)||(t.active=!n&&this.headers.index(a),this.active=s?d():a,this._toggle(h),i.removeClass("ui-accordion-header-active ui-state-active"),t.icons&&i.children(".ui-accordion-header-icon").removeClass(t.icons.activeHeader).addClass(t.icons.header),s||(a.removeClass("ui-corner-all").addClass("ui-accordion-header-active ui-state-active ui-corner-top"),t.icons&&a.children(".ui-accordion-header-icon").removeClass(t.icons.header).addClass(t.icons.activeHeader),a.next().addClass("ui-accordion-content-active")))},_toggle:function(e){var t=e.newPanel,i=this.prevShow.length?this.prevShow:e.oldPanel;this.prevShow.add(this.prevHide).stop(!0,!0),this.prevShow=t,this.prevHide=i,this.options.animate?this._animate(t,i,e):(i.hide(),t.show(),this._toggleComplete(e)),i.attr({"aria-hidden":"true"}),i.prev().attr({"aria-selected":"false","aria-expanded":"false"}),t.length&&i.length?i.prev().attr({tabIndex:-1,"aria-expanded":"false"}):t.length&&this.headers.filter(function(){return 0===parseInt(d(this).attr("tabIndex"),10)}).attr("tabIndex",-1),t.attr("aria-hidden","false").prev().attr({"aria-selected":"true","aria-expanded":"true",tabIndex:0})},_animate:function(e,i,t){function a(){o._toggleComplete(t)}var s,n,r,o=this,h=0,d=e.css("box-sizing"),c=e.length&&(!i.length||e.index()
"),i.append("
");var r=i.find("img:first"),w=i.find("img:last");i.append("
");var c=i.find(".twentytwenty-handle");c.append(""),c.append(""),i.addClass("twentytwenty-container"),r.addClass("twentytwenty-before"),w.addClass("twentytwenty-after");var o=i.find(".twentytwenty-overlay");o.append("
"),o.append("
");var f=function(t){var e=r.width(),n=r.height();return{w:e+"px",h:n+"px",cw:t*e+"px",ch:t*n+"px"}},l=function(t){"vertical"===a?r.css("clip","rect(0,"+t.w+","+t.ch+",0)"):r.css("clip","rect(0,"+t.cw+","+t.h+",0)"),i.css("height",t.h)},v=function(t){var e=f(t);c.css("vertical"===a?"top":"left","vertical"===a?e.ch:e.cw),l(e)};t(window).on("resize.twentytwenty",function(t){v(n)});var p=0,y=0;c.on("movestart",function(t){(t.distX>t.distY&&t.distX<-t.distY||t.distX-t.distY)&&"vertical"!==a?t.preventDefault():(t.distXt.distY&&t.distX>-t.distY)&&"vertical"===a&&t.preventDefault(),i.addClass("active"),p=i.offset().left,offsetY=i.offset().top,y=r.width(),imgHeight=r.height()}),c.on("moveend",function(t){i.removeClass("active")}),c.on("move",function(t){i.hasClass("active")&&(n="vertical"===a?(t.pageY-offsetY)/imgHeight:(t.pageX-p)/y,0>n&&(n=0),n>1&&(n=1),v(n))}),i.find("img").on("mousedown",function(t){t.preventDefault()}),t(window).trigger("resize.twentytwenty")})}}(jQuery); !function(t){"function"==typeof define&&define.amd?define(["jquery"],t):t(jQuery)}(function(t,e){function n(t){function e(t){a?(n(),O(e),i=!0,a=!1):i=!1}var n=t,a=!1,i=!1;this.kick=function(t){a=!0,i||e()},this.end=function(t){var e=n;t&&(i?(n=a?function(){e(),t()}:t,a=!0):t())}}function a(){return!0}function i(){return!1}function o(t){t.preventDefault()}function r(t){z[t.target.tagName.toLowerCase()]||t.preventDefault()}function u(t){return 1===t.which&&!t.ctrlKey&&!t.altKey}function c(t,e){var n,a;if(t.identifiedTouch)return t.identifiedTouch(e);for(n=-1,a=t.length;++ni*i+o*o||y(t,e,n,i,o,a)}function Y(){return this._handled=a,!1}function w(t){t._handled()}function y(t,e,n,a,i,o){var r,u;e.target;r=t.targetTouches,u=t.timeStamp-e.timeStamp,e.type="movestart",e.distX=a,e.distY=i,e.deltaX=a,e.deltaY=i,e.pageX=n.pageX,e.pageY=n.pageY,e.velocityX=a/u,e.velocityY=i/u,e.targetTouches=r,e.finger=r?r.length:1,e._handled=Y,e._preventTouchmoveDefault=function(){t.preventDefault()},N(e.target,e),o(e.identifier)}function T(t){var e=t.data.timer;t.data.touch=t,t.data.timeStamp=t.timeStamp,e.kick()}function S(t){var e=t.data.event,n=t.data.timer;k(),F(e,n,function(){setTimeout(function(){L(e.target,"click",i)},0)})}function k(t){L(document,Q.move,T),L(document,Q.end,S)}function _(t){var e=t.data.event,n=t.data.timer,a=d(t,e);a&&(t.preventDefault(),e.targetTouches=t.targetTouches,t.data.touch=a,t.data.timeStamp=t.timeStamp,n.kick())}function q(t){var e=t.data.event,n=t.data.timer,a=c(t.changedTouches,e.identifier);a&&(A(e),F(e,n))}function A(t){L(document,"."+t.identifier,_),L(document,"."+t.identifier,q)}function D(t,e,n,a){var i=n-t.timeStamp;t.type="move",t.distX=e.pageX-t.startX,t.distY=e.pageY-t.startY,t.deltaX=e.pageX-t.pageX,t.deltaY=e.pageY-t.pageY,t.velocityX=.3*t.velocityX+.7*t.deltaX/i,t.velocityY=.3*t.velocityY+.7*t.deltaY/i,t.pageX=e.pageX,t.pageY=e.pageY}function F(t,e,n){e.end(function(){return t.type="moveend",N(t.target,t),n&&n()})}function R(t,e,n){return K(this,"movestart.move",w),!0}function x(t){return L(this,"dragstart drag",o),L(this,"mousedown touchstart",r),L(this,"movestart",w),!0}function b(t){"move"!==t.namespace&&"moveend"!==t.namespace&&(K(this,"dragstart."+t.guid+" drag."+t.guid,o,e,t.selector),K(this,"mousedown."+t.guid,r,e,t.selector))}function j(t){"move"!==t.namespace&&"moveend"!==t.namespace&&(L(this,"dragstart."+t.guid+" drag."+t.guid),L(this,"mousedown."+t.guid))}var C=6,K=t.event.add,L=t.event.remove,N=function(e,n,a){t.event.trigger(n,a,e)},O=function(){return window.requestAnimationFrame||window.webkitRequestAnimationFrame||window.mozRequestAnimationFrame||window.oRequestAnimationFrame||window.msRequestAnimationFrame||function(t,e){return window.setTimeout(function(){t()},25)}}(),z={textarea:!0,input:!0,select:!0,button:!0},Q={move:"mousemove",cancel:"mouseup dragstart",end:"mouseup"},B={move:"touchmove",cancel:"touchend",end:"touchend"};t.event.special.movestart={setup:R,teardown:x,add:b,remove:j,_default:function(t){function a(e){D(o,r.touch,r.timeStamp),N(t.target,o)}var o,r;t._handled()&&(o={target:t.target,startX:t.startX,startY:t.startY,pageX:t.pageX,pageY:t.pageY,distX:t.distX,distY:t.distY,deltaX:t.deltaX,deltaY:t.deltaY,velocityX:t.velocityX,velocityY:t.velocityY,timeStamp:t.timeStamp,identifier:t.identifier,targetTouches:t.targetTouches,finger:t.finger},r={event:o,timer:new n(a),touch:e,timeStamp:e},t.identifier===e?(K(t.target,"click",i),K(document,Q.move,T,r),K(document,Q.end,S,r)):(t._preventTouchmoveDefault(),K(document,B.move+"."+t.identifier,_,r),K(document,B.end+"."+t.identifier,q,r)))}},t.event.special.move={setup:function(){K(this,"movestart.move",t.noop)},teardown:function(){L(this,"movestart.move",t.noop)}},t.event.special.moveend={setup:function(){K(this,"movestart.moveend",t.noop)},teardown:function(){L(this,"movestart.moveend",t.noop)}},K(document,"mousedown.move",m),K(document,"touchstart.move",p),"function"==typeof Array.prototype.indexOf&&!function(t,e){for(var n=["changedTouches","targetTouches"],a=n.length;a--;)-1===t.event.props.indexOf(n[a])&&t.event.props.push(n[a])}(t)}); !function(a,b){"object"==typeof exports?module.exports=b(require("jquery")):"function"==typeof define&&define.amd?define("EasyPieChart",["jquery"],b):b(a.jQuery)}(this,function(a){var b=function(a,b){var c,d=document.createElement("canvas");"undefined"!=typeof G_vmlCanvasManager&&G_vmlCanvasManager.initElement(d);var e=d.getContext("2d");d.width=d.height=b.size,a.appendChild(d);var f=1;window.devicePixelRatio>1&&(f=window.devicePixelRatio,d.style.width=d.style.height=[b.size,"px"].join(""),d.width=d.height=b.size*f,e.scale(f,f)),e.translate(b.size/2,b.size/2),e.rotate((-0.5+b.rotate/180)*Math.PI);var g=(b.size-b.lineWidth)/2;b.scaleColor&&b.scaleLength&&(g-=b.scaleLength+2),Date.now=Date.now||function(){return+new Date};var h=function(a,b,c){c=Math.min(Math.max(-1,c||0),1);var d=0>=c?!0:!1;e.beginPath(),e.arc(0,0,g,0,2*Math.PI*c,d),e.strokeStyle=a,e.lineWidth=b,e.stroke()},i=function(){var a,c,d=24;e.lineWidth=1,e.fillStyle=b.scaleColor,e.save();for(var d=24;d>0;--d)0===d%6?(c=b.scaleLength,a=0):(c=.6*b.scaleLength,a=b.scaleLength-c),e.fillRect(-b.size/2+a,0,c,1),e.rotate(Math.PI/12);e.restore()},j=function(){return window.requestAnimationFrame||window.webkitRequestAnimationFrame||window.mozRequestAnimationFrame||function(a){window.setTimeout(a,1e3/60)}}(),k=function(){b.scaleColor&&i(),b.trackColor&&h(b.trackColor,b.lineWidth,1)};this.clear=function(){e.clearRect(b.size/-2,b.size/-2,b.size,b.size)},this.draw=function(a){b.scaleColor||b.trackColor?e.getImageData&&e.putImageData?c?e.putImageData(c,0,0):(k(),c=e.getImageData(0,0,b.size*f,b.size*f)):(this.clear(),k()):this.clear(),e.lineCap=b.lineCap;var d;d="function"==typeof b.barColor?b.barColor(a):b.barColor,h(d,b.lineWidth,a/100)}.bind(this),this.animate=function(a,c){var d=Date.now();b.onStart(a,c);var e=function(){var f=Math.min(Date.now()-d,b.animate),g=b.easing(this,f,a,c-a,b.animate);this.draw(g),b.onStep(a,c,g),f>=b.animate?b.onStop(a,c):j(e)}.bind(this);j(e)}.bind(this)},c=function(a,c){var d={barColor:"#ef1e25",trackColor:"#f9f9f9",scaleColor:"#dfe0e0",scaleLength:5,lineCap:"round",lineWidth:3,size:110,rotate:0,animate:1e3,easing:function(a,b,c,d,e){return b/=e/2,1>b?d/2*b*b+c:-d/2*(--b*(b-2)-1)+c},onStart:function(){},onStep:function(){},onStop:function(){}};if("undefined"!=typeof b)d.renderer=b;else{if("undefined"==typeof SVGRenderer)throw new Error("Please load either the SVG- or the CanvasRenderer");d.renderer=SVGRenderer}var e={},f=0,g=function(){this.el=a,this.options=e;for(var b in d)d.hasOwnProperty(b)&&(e[b]=c&&"undefined"!=typeof c[b]?c[b]:d[b],"function"==typeof e[b]&&(e[b]=e[b].bind(this)));e.easing="string"==typeof e.easing&&"undefined"!=typeof jQuery&&jQuery.isFunction(jQuery.easing[e.easing])?jQuery.easing[e.easing]:d.easing,this.renderer=new e.renderer(a,e),this.renderer.draw(f),a.dataset&&a.dataset.percent?this.update(parseFloat(a.dataset.percent)):a.getAttribute&&a.getAttribute("data-percent")&&this.update(parseFloat(a.getAttribute("data-percent")))}.bind(this);this.update=function(a){return a=parseFloat(a),e.animate?this.renderer.animate(f,a):this.renderer.draw(a),f=a,this}.bind(this),g()};a.fn.easyPieChart=function(b){return this.each(function(){var d;a.data(this,"easyPieChart")||(d=a.extend({},b,a(this).data()),a.data(this,"easyPieChart",new c(this,d)))})}}); (function(e){e.fn.downCount=function(t,n){function o(){var e=new Date(r.date),t=s();var o=e-t;if(o<0){clearInterval(u);if(n&&typeof n==="function")n();return}var a=1e3,f=a*60,l=f*60,c=l*24;var h=Math.floor(o/c),p=Math.floor(o%c/l),d=Math.floor(o%l/f),v=Math.floor(o%f/a);h=String(h).length>=2?h:"0"+h;p=String(p).length>=2?p:"0"+p;d=String(d).length>=2?d:"0"+d;v=String(v).length>=2?v:"0"+v;var m=h===1?"day":"days",g=p===1?"hour":"hours",y=d===1?"minute":"minutes",b=v===1?"second":"seconds";i.find(".days").text(h);i.find(".hours").text(p);i.find(".minutes").text(d);i.find(".seconds").text(v);i.find(".days_ref").text(m);i.find(".hours_ref").text(g);i.find(".minutes_ref").text(y);i.find(".seconds_ref").text(b)}var r=e.extend({date:null,offset:null},t);if(!r.date){e.error("Date is not defined.")}if(!Date.parse(r.date)){e.error("Incorrect date format, it should look like this, 12/24/2012 12:00:00.")}var i=this;var s=function(){var e=new Date;var t=e.getTime()+e.getTimezoneOffset()*6e4;var n=new Date(t+36e5*r.offset);return n};var u=setInterval(o,1e3)}})(jQuery); !function(a){a.fn.extend({BlackAndWhite:function(b){"use strict";var c=this,d=a.extend({hoverEffect:!0,webworkerPath:!1,invertHoverEffect:!1,speed:500,onImageReady:null,intensity:1},b),e=d.hoverEffect,f=d.webworkerPath,g=d.invertHoverEffect,h="number"==typeof d.intensity&&d.intensity<1&&d.intensity>0?d.intensity:1,i=a.isPlainObject(d.speed)?d.speed.fadeIn:d.speed,j=a.isPlainObject(d.speed)?d.speed.fadeOut:d.speed,k=a(window),l=".BlackAndWhite",m=(document.all&&!window.opera&&window.XMLHttpRequest?!0:!1," -webkit- -moz- -o- -ms- ".split(" ")),n={},o=function(a){if(n[a]||""===n[a])return n[a]+a;var b=document.createElement("div"),c=["","Moz","Webkit","O","ms","Khtml"];for(var d in c)if("undefined"!=typeof b.style[c[d]+a])return n[a]=c[d],c[d]+a;return a.toLowerCase()},p=function(){var a=document.createElement("div");return a.style.cssText=m.join("filter:blur(2px); "),!!a.style.length&&(void 0===document.documentMode||document.documentMode>9)}(),q=!!document.createElement("canvas").getContext,r=function(){return"undefined"!=typeof Worker?!0:!1}(),s=o("Filter"),t=[],u=r&&f?new Worker(f+"BnWWorker.js"):!1,v=function(b){a(b.currentTarget).find(".BWfade").stop(!0,!0).animate({opacity:g?0:1},j)},w=function(b){a(b.currentTarget).find(".BWfade").stop(!0,!0).animate({opacity:g?1:0},i)},x=function(a){"function"==typeof d.onImageReady&&d.onImageReady(a)},y=function(a){u&&q&&!p&&!a&&z()},z=function(){return t.length?(u.postMessage({imgData:t[0].imageData,intensity:h}),void(u.onmessage=function(a){t[0].ctx.putImageData(a.data,0,0),x(t[0].img),t.splice(0,1),z()})):(u.terminate&&u.terminate(),void(u.close&&u.close()))},A=function(a){return a.complete||"undefined"!=typeof a.naturalWidth&&a.naturalWidth},B=function(a,b,c,d){var e=b.getContext("2d"),f=0;e.drawImage(a,0,0,c,d);var g=e.getImageData(0,0,c,d),i=g.data,j=i.length;if(u)t.push({imageData:g,ctx:e,img:a});else{for(;j>f;f+=4){var k=.3*i[f]+.59*i[f+1]+.11*i[f+2];i[f]=~~(k*h+i[f]*(1-h)),i[f+1]=~~(k*h+i[f+1]*(1-h)),i[f+2]=~~(k*h+i[f+2]*(1-h))}e.putImageData(g,0,0),x(a)}},C=function(b,c){var d,e=b[0],f=(e.src,b.position()),i={top:f.top,left:f.left,position:"absolute","-webkit-transform":"translate3d(0,0,0)",opacity:g?0:1};e.crossOrigin="anonymous",q&&!p?(d=a(''),i.width=b.width(),i.height=b.height(),B(e,d.get(0),e.naturalWidth,e.naturalHeight)):(q?i[s]="grayscale("+100*h+"%)":i.filter="progid:DXImageTransform.Microsoft.BasicImage(grayscale=1)",d=b.clone().addClass("BWFilter BWfade"),x(e)),d.css(i).prependTo(c),!a.support.opacity&&g&&d.animate({opacity:0},0)},D=function(){c.each(function(b,c){var d=a(c).find("img"),e=a(d).width(),f=a(d).height();a(this).find("canvas").css({width:e,height:f})})},E=function(){var b=c.find("img").filter(function(){return!a(this).data("_b&w")}).length;c.each(function(c,d){var e=a(d),f=e.find("img");f.data("_b&w")||(A(f[0])?(b--,C(f,e)):f.on("load",function(){return f.data("_b&w_loaded")||!f[0].complete?void setTimeout(function(){f.load()},20):(C(f,e),f.data("_b&w_loaded",!0),b--,void y(b))}).load(),f.data("_b&w",!0))}),y(b),e&&c.unbind(l).on("mouseleave"+l,v).on("mouseenter"+l,w),q&&!p&&k.unbind(l).on("resize"+l+" orientationchange"+l,D)},F=function(){c.off(l),k.off(l)};return E(),{destroy:F}}})}(jQuery); !function(e,t){"function"==typeof define&&define.amd?define("ev-emitter/ev-emitter",t):"object"==typeof module&&module.exports?module.exports=t():e.EvEmitter=t()}("undefined"!=typeof window?window:this,function(){function e(){}var t=e.prototype;return t.on=function(e,t){if(e&&t){var i=this._events=this._events||{},n=i[e]=i[e]||[];return n.indexOf(t)==-1&&n.push(t),this}},t.once=function(e,t){if(e&&t){this.on(e,t);var i=this._onceEvents=this._onceEvents||{},n=i[e]=i[e]||{};return n[t]=!0,this}},t.off=function(e,t){var i=this._events&&this._events[e];if(i&&i.length){var n=i.indexOf(t);return n!=-1&&i.splice(n,1),this}},t.emitEvent=function(e,t){var i=this._events&&this._events[e];if(i&&i.length){i=i.slice(0),t=t||[];for(var n=this._onceEvents&&this._onceEvents[e],o=0;o
");return b.inlineElement=e,e}return n.updateStatus("ready"),n._parseMarkup(c,{},b),c}}});var H="ajax",I,J=function(){I&&a(document.body).removeClass(I)},K=function(){J(),n.req&&n.req.abort()};a.magnificPopup.registerModule(H,{options:{settings:null,cursor:"mfp-ajax-cur",tError:'The content could not be loaded.'},proto:{initAjax:function(){n.types.push(H),I=n.st.ajax.cursor,w(b+"."+H,K),w("BeforeChange."+H,K)},getAjax:function(b){I&&a(document.body).addClass(I),n.updateStatus("loading");var c=a.extend({url:b.src,success:function(c,d,e){var f={data:c,xhr:e};y("ParseAjax",f),n.appendContent(a(f.data),H),b.finished=!0,J(),n._setFocus(),setTimeout(function(){n.wrap.addClass(k)},16),n.updateStatus("ready"),y("AjaxContentAdded")},error:function(){J(),b.finished=b.loadError=!0,n.updateStatus("error",n.st.ajax.tError.replace("%url%",b.src))}},n.st.ajax.settings);return n.req=a.ajax(c),""}}});var L,M=function(b){if(b.data&&b.data.title!==undefined)return b.data.title;var c=n.st.image.titleSrc;if(c){if(a.isFunction(c))return c.call(n,b);if(b.el)return b.el.attr(c)||""}return""};a.magnificPopup.registerModule("image",{options:{markup:'
',cursor:"mfp-zoom-out-cur",titleSrc:"title",verticalFit:!0,tError:'The image could not be loaded.'},proto:{initImage:function(){var c=n.st.image,d=".image";n.types.push("image"),w(g+d,function(){n.currItem.type==="image"&&c.cursor&&a(document.body).addClass(c.cursor)}),w(b+d,function(){c.cursor&&a(document.body).removeClass(c.cursor),r.off("resize"+j)}),w("Resize"+d,n.resizeImage),n.isLowIE&&w("AfterChange",n.resizeImage)},resizeImage:function(){var a=n.currItem;if(!a||!a.img)return;if(n.st.image.verticalFit){var b=0;n.isLowIE&&(b=parseInt(a.img.css("padding-top"),10)+parseInt(a.img.css("padding-bottom"),10)),a.img.css("max-height",n.wH-b)}},_onImageHasSize:function(a){a.img&&(a.hasSize=!0,L&&clearInterval(L),a.isCheckingImgSize=!1,y("ImageHasSize",a),a.imgHidden&&(n.content&&n.content.removeClass("mfp-loading"),a.imgHidden=!1))},findImageSize:function(a){var b=0,c=a.img[0],d=function(e){L&&clearInterval(L),L=setInterval(function(){if(c.naturalWidth>0){n._onImageHasSize(a);return}b>200&&clearInterval(L),b++,b===3?d(10):b===40?d(50):b===100&&d(500)},e)};d(1)},getImage:function(b,c){var d=0,e=function(){b&&(b.img[0].complete?(b.img.off(".mfploader"),b===n.currItem&&(n._onImageHasSize(b),n.updateStatus("ready")),b.hasSize=!0,b.loaded=!0,y("ImageLoadComplete")):(d++,d<200?setTimeout(e,100):f()))},f=function(){b&&(b.img.off(".mfploader"),b===n.currItem&&(n._onImageHasSize(b),n.updateStatus("error",g.tError.replace("%url%",b.src))),b.hasSize=!0,b.loaded=!0,b.loadError=!0)},g=n.st.image,h=c.find(".mfp-img");if(h.length){var i=document.createElement("img");i.className="mfp-img",b.el&&b.el.find("img").length&&(i.alt=b.el.find("img").attr("alt")),b.img=a(i).on("load.mfploader",e).on("error.mfploader",f),i.src=b.src,h.is("img")&&(b.img=b.img.clone()),i=b.img[0],i.naturalWidth>0?b.hasSize=!0:i.width||(b.hasSize=!1)}return n._parseMarkup(c,{title:M(b),img_replaceWith:b.img},b),n.resizeImage(),b.hasSize?(L&&clearInterval(L),b.loadError?(c.addClass("mfp-loading"),n.updateStatus("error",g.tError.replace("%url%",b.src))):(c.removeClass("mfp-loading"),n.updateStatus("ready")),c):(n.updateStatus("loading"),b.loading=!0,b.hasSize||(b.imgHidden=!0,c.addClass("mfp-loading"),n.findImageSize(b)),c)}}});var N,O=function(){return N===undefined&&(N=document.createElement("p").style.MozTransform!==undefined),N};a.magnificPopup.registerModule("zoom",{options:{enabled:!1,easing:"ease-in-out",duration:300,opener:function(a){return a.is("img")?a:a.find("img")}},proto:{initZoom:function(){var a=n.st.zoom,d=".zoom",e;if(!a.enabled||!n.supportsTransition)return;var f=a.duration,g=function(b){var c=b.clone().removeAttr("style").removeAttr("class").addClass("mfp-animated-image"),d="all "+a.duration/1e3+"s "+a.easing,e={position:"fixed",zIndex:9999,left:0,top:0,"-webkit-backface-visibility":"hidden"},f="transition";return e["-webkit-"+f]=e["-moz-"+f]=e["-o-"+f]=e[f]=d,c.css(e),c},h=function(){n.content.css("visibility","visible")},i,j;w("BuildControls"+d,function(){if(n._allowZoom()){clearTimeout(i),n.content.css("visibility","hidden"),e=n._getItemToZoom();if(!e){h();return}j=g(e),j.css(n._getOffset()),n.wrap.append(j),i=setTimeout(function(){j.css(n._getOffset(!0)),i=setTimeout(function(){h(),setTimeout(function(){j.remove(),e=j=null,y("ZoomAnimationEnded")},16)},f)},16)}}),w(c+d,function(){if(n._allowZoom()){clearTimeout(i),n.st.removalDelay=f;if(!e){e=n._getItemToZoom();if(!e)return;j=g(e)}j.css(n._getOffset(!0)),n.wrap.append(j),n.content.css("visibility","hidden"),setTimeout(function(){j.css(n._getOffset())},16)}}),w(b+d,function(){n._allowZoom()&&(h(),j&&j.remove(),e=null)})},_allowZoom:function(){return n.currItem.type==="image"},_getItemToZoom:function(){return n.currItem.hasSize?n.currItem.img:!1},_getOffset:function(b){var c;b?c=n.currItem.img:c=n.st.zoom.opener(n.currItem.el||n.currItem);var d=c.offset(),e=parseInt(c.css("padding-top"),10),f=parseInt(c.css("padding-bottom"),10);d.top-=a(window).scrollTop()-e;var g={width:c.width(),height:(p?c.innerHeight():c[0].offsetHeight)-f-e};return O()?g["-moz-transform"]=g.transform="translate("+d.left+"px,"+d.top+"px)":(g.left=d.left,g.top=d.top),g}}});var P="iframe",Q="//about:blank",R=function(a){if(n.currTemplate[P]){var b=n.currTemplate[P].find("iframe");b.length&&(a||(b[0].src=Q),n.isIE8&&b.css("display",a?"block":"none"))}};a.magnificPopup.registerModule(P,{options:{markup:'
',srcAction:"iframe_src",patterns:{youtube:{index:"youtube.com",id:"v=",src:"//www.youtube.com/embed/%id%?autoplay=1"},vimeo:{index:"vimeo.com/",id:"/",src:"//player.vimeo.com/video/%id%?autoplay=1"},gmaps:{index:"//maps.google.",src:"%id%&output=embed"}}},proto:{initIframe:function(){n.types.push(P),w("BeforeChange",function(a,b,c){b!==c&&(b===P?R():c===P&&R(!0))}),w(b+"."+P,function(){R()})},getIframe:function(b,c){var d=b.src,e=n.st.iframe;a.each(e.patterns,function(){if(d.indexOf(this.index)>-1)return this.id&&(typeof this.id=="string"?d=d.substr(d.lastIndexOf(this.id)+this.id.length,d.length):d=this.id.call(this,d)),d=this.src.replace("%id%",d),!1});var f={};return e.srcAction&&(f[e.srcAction]=d),n._parseMarkup(c,f,b),n.updateStatus("ready"),c}}});var S=function(a){var b=n.items.length;return a>b-1?a-b:a<0?b+a:a},T=function(a,b,c){return a.replace(/%curr%/gi,b+1).replace(/%total%/gi,c)};a.magnificPopup.registerModule("gallery",{options:{enabled:!1,arrowMarkup:'',preload:[0,2],navigateByImgClick:!0,arrows:!0,tPrev:"Previous (Left arrow key)",tNext:"Next (Right arrow key)",tCounter:"%curr% of %total%"},proto:{initGallery:function(){var c=n.st.gallery,d=".mfp-gallery";n.direction=!0;if(!c||!c.enabled)return!1;u+=" mfp-gallery",w(g+d,function(){c.navigateByImgClick&&n.wrap.on("click"+d,".mfp-img",function(){if(n.items.length>1)return n.next(),!1}),s.on("keydown"+d,function(a){a.keyCode===37?n.prev():a.keyCode===39&&n.next()})}),w("UpdateStatus"+d,function(a,b){b.text&&(b.text=T(b.text,n.currItem.index,n.items.length))}),w(f+d,function(a,b,d,e){var f=n.items.length;d.counter=f>1?T(c.tCounter,e.index,f):""}),w("BuildControls"+d,function(){if(n.items.length>1&&c.arrows&&!n.arrowLeft){var b=c.arrowMarkup,d=n.arrowLeft=a(b.replace(/%title%/gi,c.tPrev).replace(/%dir%/gi,"left")).addClass(m),e=n.arrowRight=a(b.replace(/%title%/gi,c.tNext).replace(/%dir%/gi,"right")).addClass(m);d.click(function(){n.prev()}),e.click(function(){n.next()}),n.container.append(d.add(e))}}),w(h+d,function(){n._preloadTimeout&&clearTimeout(n._preloadTimeout),n._preloadTimeout=setTimeout(function(){n.preloadNearbyImages(),n._preloadTimeout=null},16)}),w(b+d,function(){s.off(d),n.wrap.off("click"+d),n.arrowRight=n.arrowLeft=null})},next:function(){n.direction=!0,n.index=S(n.index+1),n.updateItemHTML()},prev:function(){n.direction=!1,n.index=S(n.index-1),n.updateItemHTML()},goTo:function(a){n.direction=a>=n.index,n.index=a,n.updateItemHTML()},preloadNearbyImages:function(){var a=n.st.gallery.preload,b=Math.min(a[0],n.items.length),c=Math.min(a[1],n.items.length),d;for(d=1;d<=(n.direction?c:b);d++)n._preloadItem(n.index+d);for(d=1;d<=(n.direction?b:c);d++)n._preloadItem(n.index-d)},_preloadItem:function(b){b=S(b);if(n.items[b].preloaded)return;var c=n.items[b];c.parsed||(c=n.parseEl(b)),y("LazyLoad",c),c.type==="image"&&(c.img=a('').on("load.mfploader",function(){c.hasSize=!0}).on("error.mfploader",function(){c.hasSize=!0,c.loadError=!0,y("LazyLoadError",c)}).attr("src",c.src)),c.preloaded=!0}}});var U="retina";a.magnificPopup.registerModule(U,{options:{replaceSrc:function(a){return a.src.replace(/\.\w+$/,function(a){return"@2x"+a})},ratio:1},proto:{initRetina:function(){if(window.devicePixelRatio>1){var a=n.st.retina,b=a.ratio;b=isNaN(b)?b():b,b>1&&(w("ImageHasSize."+U,function(a,c){c.img.css({"max-width":c.img[0].naturalWidth/b,width:"100%"})}),w("ElementParse."+U,function(c,d){d.src=a.replaceSrc(d,b)}))}}}}),A()}) !function(t){"use strict";t.fn.enllax=function(r){var a=t(window).height(),n=t(document).height(),o=t.extend({ratio:0,type:"background",direction:"vertical"},r),e=t("[data-enllax-ratio]");e.each(function(){var r,e,s,i=t(this),c=i.offset().top,l=i.outerHeight(),p=i.data("enllax-ratio"),d=i.data("enllax-type"),x=i.data("enllax-direction");r=p?p:o.ratio,e=d?d:o.type,s=x?x:o.direction;var f=Math.round(c*r),u=Math.round((c-a/2+l)*r);"background"==e?"vertical"==s?i.css({"background-position":"center "+-f+"px"}):"horizontal"==s&&i.css({"background-position":-f+"px center"}):"foreground"==e&&("vertical"==s?i.css({"-webkit-transform":"translateY("+u+"px)","-moz-transform":"translateY("+u+"px)",transform:"translateY("+u+"px)"}):"horizontal"==s&&i.css({"-webkit-transform":"translateX("+u+"px)","-moz-transform":"translateX("+u+"px)",transform:"translateX("+u+"px)"})),t(window).on("scroll",function(){var o=t(this).scrollTop();f=Math.round((c-o)*r),u=Math.round((c-a/2+l-o)*r),"background"==e?"vertical"==s?i.css({"background-position":"center "+-f+"px"}):"horizontal"==s&&i.css({"background-position":-f+"px center"}):"foreground"==e&&n>o&&("vertical"==s?i.css({"-webkit-transform":"translateY("+u+"px)","-moz-transform":"translateY("+u+"px)",transform:"translateY("+u+"px)"}):"horizontal"==s&&i.css({"-webkit-transform":"translateX("+u+"px)","-moz-transform":"translateX("+u+"px)",transform:"translateX("+u+"px)"}))})})}}(jQuery); (function(e){var t=e.event,n,r;n=t.special.debouncedresize={setup:function(){e(this).on("resize",n.handler)},teardown:function(){e(this).off("resize",n.handler)},handler:function(e,i){var s=this,o=arguments,u=function(){e.type="debouncedresize";t.dispatch.apply(s,o)};if(r){clearTimeout(r)}i?u():r=setTimeout(u,n.threshold)},threshold:150}})(jQuery); !function(e){"function"==typeof define&&define.amd?define(["jquery"],e):"object"==typeof exports?module.exports=e(require("jquery")):e(jQuery)}(function(e){"use strict";function o(){var e=document.getElementsByTagName("script"),o=e.length?e[e.length-1].src.split("?")[0]:"";return o.split("/").length>0?o.split("/").slice(0,-1).join("/")+"/":""}function t(e,o,t){for(var r=0;r=9,n.isie10=n.isie&&"performance"in window&&10==document.documentMode,n.isie11="msRequestFullscreen"in o&&document.documentMode>=11,n.isieedge=navigator.userAgent.match(/Edge\/12\./),n.isie9mobile=/iemobile.9/i.test(r),n.isie9mobile&&(n.isie9=!1),n.isie7mobile=!n.isie9mobile&&n.isie7&&/iemobile/i.test(r),n.ismozilla="MozAppearance"in t,n.iswebkit="WebkitAppearance"in t,n.ischrome="chrome"in window,n.ischrome22=n.ischrome&&n.haspointerlock,n.ischrome26=n.ischrome&&"transition"in t,n.cantouch="ontouchstart"in document.documentElement||"ontouchstart"in window,n.hasmstouch=window.MSPointerEvent||!1,n.hasw3ctouch=(window.PointerEvent||!1)&&(navigator.MaxTouchPoints>0||navigator.msMaxTouchPoints>0),n.ismac=/^mac$/i.test(i),n.isios=n.cantouch&&/iphone|ipad|ipod/i.test(i),n.isios4=n.isios&&!("seal"in Object),n.isios7=n.isios&&"webkitHidden"in document,n.isandroid=/android/i.test(r),n.haseventlistener="addEventListener"in o,n.trstyle=!1,n.hastransform=!1,n.hastranslate3d=!1,n.transitionstyle=!1,n.hastransition=!1,n.transitionend=!1;var s,l=["transform","msTransform","webkitTransform","MozTransform","OTransform"];for(s=0;s0;){if(9==e[0].nodeType)return!1;var o=e.css("zIndex");if(!isNaN(o)&&0!=o)return parseInt(o);e=e.parent()}return!1}function h(e,o,t){var r=e.css(o),i=parseFloat(r);if(isNaN(i)){i=k[r]||0;var n=3==i?t?v.win.outerHeight()-v.win.innerHeight():v.win.outerWidth()-v.win.innerWidth():1;return v.isie8&&i&&(i+=1),n?i:0}return i}function p(e,o,t,r){v._bind(e,o,function(r){var r=r?r:window.event,i={original:r,target:r.target||r.srcElement,type:"wheel",deltaMode:"MozMousePixelScroll"==r.type?0:1,deltaX:0,deltaZ:0,preventDefault:function(){return r.preventDefault?r.preventDefault():r.returnValue=!1,!1},stopImmediatePropagation:function(){r.stopImmediatePropagation?r.stopImmediatePropagation():r.cancelBubble=!0}};return"mousewheel"==o?(i.deltaY=-1/40*r.wheelDelta,r.wheelDeltaX&&(i.deltaX=-1/40*r.wheelDeltaX)):i.deltaY=r.detail,t.call(e,i)},r)}function g(e,o,t){var r,i;if(0==e.deltaMode?(r=-Math.floor(e.deltaX*(v.opt.mousescrollstep/54)),i=-Math.floor(e.deltaY*(v.opt.mousescrollstep/54))):1==e.deltaMode&&(r=-Math.floor(e.deltaX*v.opt.mousescrollstep),i=-Math.floor(e.deltaY*v.opt.mousescrollstep)),o&&v.opt.oneaxismousemode&&0==r&&i&&(r=i,i=0,t)){var n=0>r?v.getScrollLeft()>=v.page.maxw:v.getScrollLeft()<=0;n&&(i=r,r=0)}if(r&&(v.scrollmom&&v.scrollmom.stop(),v.lastdeltax+=r,v.debounced("mousewheelx",function(){var e=v.lastdeltax;v.lastdeltax=0,v.rail.drag||v.doScrollLeftBy(e)},15)),i){if(v.opt.nativeparentscrolling&&t&&!v.ispage&&!v.zoomactive)if(0>i){if(v.getScrollTop()>=v.page.maxh)return!0}else if(v.getScrollTop()<=0)return!0;v.scrollmom&&v.scrollmom.stop(),v.lastdeltay+=i,v.debounced("mousewheely",function(){var e=v.lastdeltay;v.lastdeltay=0,v.rail.drag||v.doScrollBy(e)},15)}return e.stopImmediatePropagation(),e.preventDefault()}var v=this;if(this.version="3.6.6",this.name="nicescroll",this.me=o,this.opt={doc:a("body"),win:!1},a.extend(this.opt,f),this.opt.snapbackspeed=80,e)for(var y in v.opt)"undefined"!=typeof e[y]&&(v.opt[y]=e[y]);this.doc=v.opt.doc,this.iddoc=this.doc&&this.doc[0]?this.doc[0].id||"":"",this.ispage=/^BODY|HTML/.test(v.opt.win?v.opt.win[0].nodeName:this.doc[0].nodeName),this.haswrapper=v.opt.win!==!1,this.win=v.opt.win||(this.ispage?a(window):this.doc),this.docscroll=this.ispage&&!this.haswrapper?a(window):this.win,this.body=a("body"),this.viewport=!1,this.isfixed=!1,this.iframe=!1,this.isiframe="IFRAME"==this.doc[0].nodeName&&"IFRAME"==this.win[0].nodeName,this.istextarea="TEXTAREA"==this.win[0].nodeName,this.forcescreen=!1,this.canshowonmouseevent="scroll"!=v.opt.autohidemode,this.onmousedown=!1,this.onmouseup=!1,this.onmousemove=!1,this.onmousewheel=!1,this.onkeypress=!1,this.ongesturezoom=!1,this.onclick=!1,this.onscrollstart=!1,this.onscrollend=!1,this.onscrollcancel=!1,this.onzoomin=!1,this.onzoomout=!1,this.view=!1,this.page=!1,this.scroll={x:0,y:0},this.scrollratio={x:0,y:0},this.cursorheight=20,this.scrollvaluemax=0,this.isrtlmode="auto"==this.opt.rtlmode?"rtl"==(this.win[0]==window?this.body:this.win).css("direction"):this.opt.rtlmode===!0,this.scrollrunning=!1,this.scrollmom=!1,this.observer=!1,this.observerremover=!1,this.observerbody=!1;do this.id="ascrail"+s++;while(document.getElementById(this.id));this.rail=!1,this.cursor=!1,this.cursorfreezed=!1,this.selectiondrag=!1,this.zoom=!1,this.zoomactive=!1,this.hasfocus=!1,this.hasmousefocus=!1,this.visibility=!0,this.railslocked=!1,this.locked=!1,this.hidden=!1,this.cursoractive=!0,this.wheelprevented=!1,this.overflowx=v.opt.overflowx,this.overflowy=v.opt.overflowy,this.nativescrollingarea=!1,this.checkarea=0,this.events=[],this.saved={},this.delaylist={},this.synclist={},this.lastdeltax=0,this.lastdeltay=0,this.detected=w();var x=a.extend({},this.detected);this.canhwscroll=x.hastransform&&v.opt.hwacceleration,this.ishwscroll=this.canhwscroll&&v.haswrapper,this.hasreversehr=this.isrtlmode&&!x.iswebkit,this.istouchcapable=!1,!x.cantouch||x.isios||x.isandroid||!x.iswebkit&&!x.ismozilla||(this.istouchcapable=!0,x.cantouch=!1),v.opt.enablemouselockapi||(x.hasmousecapture=!1,x.haspointerlock=!1),this.debounced=function(e,o,t){var r=v.delaylist[e];v.delaylist[e]=o,r||(v.debouncedelayed=setTimeout(function(){if(v){var o=v.delaylist[e];v.delaylist[e]=!1,o.call(v)}},t))};var S=!1;this.synched=function(e,o){function t(){S||(d(function(){S=!1;for(var e in v.synclist){var o=v.synclist[e];o&&o.call(v),v.synclist[e]=!1}}),S=!0)}return v.synclist[e]=o,t(),e},this.unsynched=function(e){v.synclist[e]&&(v.synclist[e]=!1)},this.css=function(e,o){for(var t in o)v.saved.css.push([e,t,e.css(t)]),e.css(t,o[t])},this.scrollTop=function(e){return"undefined"==typeof e?v.getScrollTop():v.setScrollTop(e)},this.scrollLeft=function(e){return"undefined"==typeof e?v.getScrollLeft():v.setScrollLeft(e)};var z=function(e,o,t,r,i,n,s){this.st=e,this.ed=o,this.spd=t,this.p1=r||0,this.p2=i||1,this.p3=n||0,this.p4=s||1,this.ts=(new Date).getTime(),this.df=this.ed-this.st};if(z.prototype={B2:function(e){return 3*e*e*(1-e)},B3:function(e){return 3*e*(1-e)*(1-e)},B4:function(e){return(1-e)*(1-e)*(1-e)},getNow:function(){var e=(new Date).getTime(),o=1-(e-this.ts)/this.spd,t=this.B2(o)+this.B3(o)+this.B4(o);return 0>o?this.ed:this.st+Math.round(this.df*t)},update:function(e,o){return this.st=this.getNow(),this.ed=e,this.spd=o,this.ts=(new Date).getTime(),this.df=this.ed-this.st,this}},this.ishwscroll){this.doc.translate={x:0,y:0,tx:"0px",ty:"0px"},x.hastranslate3d&&x.isios&&this.doc.css("-webkit-backface-visibility","hidden"),this.getScrollTop=function(e){if(!e){var o=t();if(o)return 16==o.length?-o[13]:-o[5];if(v.timerscroll&&v.timerscroll.bz)return v.timerscroll.bz.getNow()}return v.doc.translate.y},this.getScrollLeft=function(e){if(!e){var o=t();if(o)return 16==o.length?-o[12]:-o[4];if(v.timerscroll&&v.timerscroll.bh)return v.timerscroll.bh.getNow()}return v.doc.translate.x},this.notifyScrollEvent=function(e){var o=document.createEvent("UIEvents");o.initUIEvent("scroll",!1,!0,window,1),o.niceevent=!0,e.dispatchEvent(o)};var T=this.isrtlmode?1:-1;x.hastranslate3d&&v.opt.enabletranslate3d?(this.setScrollTop=function(e,o){v.doc.translate.y=e,v.doc.translate.ty=-1*e+"px",v.doc.css(x.trstyle,"translate3d("+v.doc.translate.tx+","+v.doc.translate.ty+",0px)"),o||v.notifyScrollEvent(v.win[0])},this.setScrollLeft=function(e,o){v.doc.translate.x=e,v.doc.translate.tx=e*T+"px",v.doc.css(x.trstyle,"translate3d("+v.doc.translate.tx+","+v.doc.translate.ty+",0px)"),o||v.notifyScrollEvent(v.win[0])}):(this.setScrollTop=function(e,o){v.doc.translate.y=e,v.doc.translate.ty=-1*e+"px",v.doc.css(x.trstyle,"translate("+v.doc.translate.tx+","+v.doc.translate.ty+")"),o||v.notifyScrollEvent(v.win[0])},this.setScrollLeft=function(e,o){v.doc.translate.x=e,v.doc.translate.tx=e*T+"px",v.doc.css(x.trstyle,"translate("+v.doc.translate.tx+","+v.doc.translate.ty+")"),o||v.notifyScrollEvent(v.win[0])})}else this.getScrollTop=function(){return v.docscroll.scrollTop()},this.setScrollTop=function(e){return setTimeout(function(){v.docscroll.scrollTop(e)},1)},this.getScrollLeft=function(){return v.detected.ismozilla&&v.isrtlmode?Math.abs(v.docscroll.scrollLeft()):v.docscroll.scrollLeft()},this.setScrollLeft=function(e){return setTimeout(function(){v.docscroll.scrollLeft(v.detected.ismozilla&&v.isrtlmode?-e:e)},1)};this.getTarget=function(e){return e?e.target?e.target:e.srcElement?e.srcElement:!1:!1},this.hasParent=function(e,o){if(!e)return!1;for(var t=e.target||e.srcElement||e||!1;t&&t.id!=o;)t=t.parentNode||!1;return t!==!1};var k={thin:1,medium:3,thick:5};this.getDocumentScrollOffset=function(){return{top:window.pageYOffset||document.documentElement.scrollTop,left:window.pageXOffset||document.documentElement.scrollLeft}},this.getOffset=function(){if(v.isfixed){var e=v.win.offset(),o=v.getDocumentScrollOffset();return e.top-=o.top,e.left-=o.left,e}var t=v.win.offset();if(!v.viewport)return t;var r=v.viewport.offset();return{top:t.top-r.top,left:t.left-r.left}},this.updateScrollBar=function(e){if(v.ishwscroll)v.rail.css({height:v.win.innerHeight()-(v.opt.railpadding.top+v.opt.railpadding.bottom)}),v.railh&&v.railh.css({width:v.win.innerWidth()-(v.opt.railpadding.left+v.opt.railpadding.right)});else{var o=v.getOffset(),t={top:o.top,left:o.left-(v.opt.railpadding.left+v.opt.railpadding.right)};t.top+=h(v.win,"border-top-width",!0),t.left+=v.rail.align?v.win.outerWidth()-h(v.win,"border-right-width")-v.rail.width:h(v.win,"border-left-width");var r=v.opt.railoffset;if(r&&(r.top&&(t.top+=r.top),r.left&&(t.left+=r.left)),v.railslocked||v.rail.css({top:t.top,left:t.left,height:(e?e.h:v.win.innerHeight())-(v.opt.railpadding.top+v.opt.railpadding.bottom)}),v.zoom&&v.zoom.css({top:t.top+1,left:1==v.rail.align?t.left-20:t.left+v.rail.width+4}),v.railh&&!v.railslocked){var t={top:o.top,left:o.left},r=v.opt.railhoffset;r&&(r.top&&(t.top+=r.top),r.left&&(t.left+=r.left));var i=v.railh.align?t.top+h(v.win,"border-top-width",!0)+v.win.innerHeight()-v.railh.height:t.top+h(v.win,"border-top-width",!0),n=t.left+h(v.win,"border-left-width");v.railh.css({top:i-(v.opt.railpadding.top+v.opt.railpadding.bottom),left:n,width:v.railh.width})}}},this.doRailClick=function(e,o,t){var r,i,n,s;v.railslocked||(v.cancelEvent(e),o?(r=t?v.doScrollLeft:v.doScrollTop,n=t?(e.pageX-v.railh.offset().left-v.cursorwidth/2)*v.scrollratio.x:(e.pageY-v.rail.offset().top-v.cursorheight/2)*v.scrollratio.y,r(n)):(r=t?v.doScrollLeftBy:v.doScrollBy,n=t?v.scroll.x:v.scroll.y,s=t?e.pageX-v.railh.offset().left:e.pageY-v.rail.offset().top,i=t?v.view.w:v.view.h,r(n>=s?i:-i)))},v.hasanimationframe=d,v.hascancelanimationframe=u,v.hasanimationframe?v.hascancelanimationframe||(u=function(){v.cancelAnimationFrame=!0}):(d=function(e){return setTimeout(e,15-Math.floor(+new Date/1e3)%16)},u=clearInterval),this.init=function(){if(v.saved.css=[],x.isie7mobile)return!0;if(x.isoperamini)return!0;if(x.hasmstouch&&v.css(v.ispage?a("html"):v.win,{"-ms-touch-action":"none"}),v.zindex="auto",v.ispage||"auto"!=v.opt.zindex?v.zindex=v.opt.zindex:v.zindex=c()||"auto",v.ispage||"auto"==v.zindex||v.zindex>l&&(l=v.zindex),v.isie&&0==v.zindex&&"auto"==v.opt.zindex&&(v.zindex="auto"),!v.ispage||!x.cantouch&&!x.isieold&&!x.isie9mobile){var e=v.docscroll;v.ispage&&(e=v.haswrapper?v.win:v.doc),x.isie9mobile||v.css(e,{"overflow-y":"hidden"}),v.ispage&&x.isie7&&("BODY"==v.doc[0].nodeName?v.css(a("html"),{"overflow-y":"hidden"}):"HTML"==v.doc[0].nodeName&&v.css(a("body"),{"overflow-y":"hidden"})),!x.isios||v.ispage||v.haswrapper||v.css(a("body"),{"-webkit-overflow-scrolling":"touch"});var o=a(document.createElement("div"));o.css({position:"relative",top:0,"float":"right",width:v.opt.cursorwidth,height:"0px","background-color":v.opt.cursorcolor,border:v.opt.cursorborder,"background-clip":"padding-box","-webkit-border-radius":v.opt.cursorborderradius,"-moz-border-radius":v.opt.cursorborderradius,"border-radius":v.opt.cursorborderradius}),o.hborder=parseFloat(o.outerHeight()-o.innerHeight()),o.addClass("nicescroll-cursors"),v.cursor=o;var t=a(document.createElement("div"));t.attr("id",v.id),t.addClass("nicescroll-rails nicescroll-rails-vr");var s,d,u=["left","right","top","bottom"];for(var h in u)d=u[h],s=v.opt.railpadding[d],s?t.css("padding-"+d,s+"px"):v.opt.railpadding[d]=0;t.append(o),t.width=Math.max(parseFloat(v.opt.cursorwidth),o.outerWidth()),t.css({width:t.width+"px",zIndex:v.zindex,background:v.opt.background,cursor:"default"}),t.visibility=!0,t.scrollable=!0,t.align="left"==v.opt.railalign?0:1,v.rail=t,v.rail.drag=!1;var p=!1;!v.opt.boxzoom||v.ispage||x.isieold||(p=document.createElement("div"),v.bind(p,"click",v.doZoom),v.bind(p,"mouseenter",function(){v.zoom.css("opacity",v.opt.cursoropacitymax)}),v.bind(p,"mouseleave",function(){v.zoom.css("opacity",v.opt.cursoropacitymin)}),v.zoom=a(p),v.zoom.css({cursor:"pointer","z-index":v.zindex,backgroundImage:"url("+v.opt.scriptpath+"zoomico.png)",height:18,width:18,backgroundPosition:"0px 0px"}),v.opt.dblclickzoom&&v.bind(v.win,"dblclick",v.doZoom),x.cantouch&&v.opt.gesturezoom&&(v.ongesturezoom=function(e){return e.scale>1.5&&v.doZoomIn(e),e.scale<.8&&v.doZoomOut(e),v.cancelEvent(e)},v.bind(v.win,"gestureend",v.ongesturezoom))),v.railh=!1;var f;if(v.opt.horizrailenabled){v.css(e,{"overflow-x":"hidden"});var o=a(document.createElement("div"));o.css({position:"absolute",top:0,height:v.opt.cursorwidth,width:"0px","background-color":v.opt.cursorcolor,border:v.opt.cursorborder,"background-clip":"padding-box","-webkit-border-radius":v.opt.cursorborderradius,"-moz-border-radius":v.opt.cursorborderradius,"border-radius":v.opt.cursorborderradius}),x.isieold&&o.css({overflow:"hidden"}),o.wborder=parseFloat(o.outerWidth()-o.innerWidth()),o.addClass("nicescroll-cursors"),v.cursorh=o,f=a(document.createElement("div")),f.attr("id",v.id+"-hr"),f.addClass("nicescroll-rails nicescroll-rails-hr"),f.height=Math.max(parseFloat(v.opt.cursorwidth),o.outerHeight()),f.css({height:f.height+"px",zIndex:v.zindex,background:v.opt.background}),f.append(o),f.visibility=!0,f.scrollable=!0,f.align="top"==v.opt.railvalign?0:1,v.railh=f,v.railh.drag=!1}if(v.ispage)t.css({position:"fixed",top:"0px",height:"100%"}),t.align?t.css({right:"0px"}):t.css({left:"0px"}),v.body.append(t),v.railh&&(f.css({position:"fixed",left:"0px",width:"100%"}),f.align?f.css({bottom:"0px"}):f.css({top:"0px"}),v.body.append(f));else{if(v.ishwscroll){"static"==v.win.css("position")&&v.css(v.win,{position:"relative"});var g="HTML"==v.win[0].nodeName?v.body:v.win;a(g).scrollTop(0).scrollLeft(0),v.zoom&&(v.zoom.css({position:"absolute",top:1,right:0,"margin-right":t.width+4}),g.append(v.zoom)),t.css({position:"absolute",top:0}),t.align?t.css({right:0}):t.css({left:0}),g.append(t),f&&(f.css({position:"absolute",left:0,bottom:0}),f.align?f.css({bottom:0}):f.css({top:0}),g.append(f))}else{v.isfixed="fixed"==v.win.css("position");var w=v.isfixed?"fixed":"absolute";v.isfixed||(v.viewport=v.getViewport(v.win[0])),v.viewport&&(v.body=v.viewport,0==/fixed|absolute/.test(v.viewport.css("position"))&&v.css(v.viewport,{position:"relative"})),t.css({position:w}),v.zoom&&v.zoom.css({position:w}),v.updateScrollBar(),v.body.append(t),v.zoom&&v.body.append(v.zoom),v.railh&&(f.css({position:w}),v.body.append(f))}x.isios&&v.css(v.win,{"-webkit-tap-highlight-color":"rgba(0,0,0,0)","-webkit-touch-callout":"none"}),x.isie&&v.opt.disableoutline&&v.win.attr("hideFocus","true"),x.iswebkit&&v.opt.disableoutline&&v.win.css({outline:"none"})}if(v.opt.autohidemode===!1?(v.autohidedom=!1,v.rail.css({opacity:v.opt.cursoropacitymax}),v.railh&&v.railh.css({opacity:v.opt.cursoropacitymax})):v.opt.autohidemode===!0||"leave"===v.opt.autohidemode?(v.autohidedom=a().add(v.rail),x.isie8&&(v.autohidedom=v.autohidedom.add(v.cursor)),v.railh&&(v.autohidedom=v.autohidedom.add(v.railh)),v.railh&&x.isie8&&(v.autohidedom=v.autohidedom.add(v.cursorh))):"scroll"==v.opt.autohidemode?(v.autohidedom=a().add(v.rail),v.railh&&(v.autohidedom=v.autohidedom.add(v.railh))):"cursor"==v.opt.autohidemode?(v.autohidedom=a().add(v.cursor),v.railh&&(v.autohidedom=v.autohidedom.add(v.cursorh))):"hidden"==v.opt.autohidemode&&(v.autohidedom=!1,v.hide(),v.railslocked=!1),x.isie9mobile){v.scrollmom=new b(v),v.onmangotouch=function(){var e=v.getScrollTop(),o=v.getScrollLeft();if(e==v.scrollmom.lastscrolly&&o==v.scrollmom.lastscrollx)return!0;var t=e-v.mangotouch.sy,r=o-v.mangotouch.sx,i=Math.round(Math.sqrt(Math.pow(r,2)+Math.pow(t,2)));if(0!=i){var n=0>t?-1:1,s=0>r?-1:1,l=+new Date;if(v.mangotouch.lazy&&clearTimeout(v.mangotouch.lazy),l-v.mangotouch.tm>80||v.mangotouch.dry!=n||v.mangotouch.drx!=s)v.scrollmom.stop(),v.scrollmom.reset(o,e),v.mangotouch.sy=e,v.mangotouch.ly=e,v.mangotouch.sx=o,v.mangotouch.lx=o,v.mangotouch.dry=n,v.mangotouch.drx=s,v.mangotouch.tm=l;else{v.scrollmom.stop(),v.scrollmom.update(v.mangotouch.sx-r,v.mangotouch.sy-t),v.mangotouch.tm=l;var a=Math.max(Math.abs(v.mangotouch.ly-e),Math.abs(v.mangotouch.lx-o));v.mangotouch.ly=e,v.mangotouch.lx=o,a>2&&(v.mangotouch.lazy=setTimeout(function(){v.mangotouch.lazy=!1,v.mangotouch.dry=0,v.mangotouch.drx=0,v.mangotouch.tm=0,v.scrollmom.doMomentum(30)},100))}}};var y=v.getScrollTop(),S=v.getScrollLeft();v.mangotouch={sy:y,ly:y,dry:0,sx:S,lx:S,drx:0,lazy:!1,tm:0},v.bind(v.docscroll,"scroll",v.onmangotouch)}else{if(x.cantouch||v.istouchcapable||v.opt.touchbehavior||x.hasmstouch){v.scrollmom=new b(v),v.ontouchstart=function(e){if(e.pointerType&&2!=e.pointerType&&"touch"!=e.pointerType)return!1;if(v.hasmoving=!1,!v.railslocked){var o;if(x.hasmstouch)for(o=e.target?e.target:!1;o;){var t=a(o).getNiceScroll();if(t.length>0&&t[0].me==v.me)break;if(t.length>0)return!1;if("DIV"==o.nodeName&&o.id==v.id)break;o=o.parentNode?o.parentNode:!1}if(v.cancelScroll(),o=v.getTarget(e)){var r=/INPUT/i.test(o.nodeName)&&/range/i.test(o.type);if(r)return v.stopPropagation(e)}if(!("clientX"in e)&&"changedTouches"in e&&(e.clientX=e.changedTouches[0].clientX,e.clientY=e.changedTouches[0].clientY),v.forcescreen){var i=e;e={original:e.original?e.original:e},e.clientX=i.screenX,e.clientY=i.screenY}if(v.rail.drag={x:e.clientX,y:e.clientY,sx:v.scroll.x,sy:v.scroll.y,st:v.getScrollTop(),sl:v.getScrollLeft(),pt:2,dl:!1},v.ispage||!v.opt.directionlockdeadzone)v.rail.drag.dl="f";else{var n={w:a(window).width(),h:a(window).height()},s={w:Math.max(document.body.scrollWidth,document.documentElement.scrollWidth),h:Math.max(document.body.scrollHeight,document.documentElement.scrollHeight)},l=Math.max(0,s.h-n.h),c=Math.max(0,s.w-n.w);!v.rail.scrollable&&v.railh.scrollable?v.rail.drag.ck=l>0?"v":!1:v.rail.scrollable&&!v.railh.scrollable?v.rail.drag.ck=c>0?"h":!1:v.rail.drag.ck=!1,v.rail.drag.ck||(v.rail.drag.dl="f")}if(v.opt.touchbehavior&&v.isiframe&&x.isie){var d=v.win.position();v.rail.drag.x+=d.left,v.rail.drag.y+=d.top}if(v.hasmoving=!1,v.lastmouseup=!1,v.scrollmom.reset(e.clientX,e.clientY),!x.cantouch&&!this.istouchcapable&&!e.pointerType){var u=o?/INPUT|SELECT|TEXTAREA/i.test(o.nodeName):!1;if(!u)return!v.ispage&&x.hasmousecapture&&o.setCapture(),v.opt.touchbehavior?(o.onclick&&!o._onclick&&(o._onclick=o.onclick,o.onclick=function(e){return v.hasmoving?!1:void o._onclick.call(this,e)}),v.cancelEvent(e)):v.stopPropagation(e);/SUBMIT|CANCEL|BUTTON/i.test(a(o).attr("type"))&&(pc={tg:o,click:!1},v.preventclick=pc)}}},v.ontouchend=function(e){if(!v.rail.drag)return!0;if(2==v.rail.drag.pt){if(e.pointerType&&2!=e.pointerType&&"touch"!=e.pointerType)return!1;if(v.scrollmom.doMomentum(),v.rail.drag=!1,v.hasmoving&&(v.lastmouseup=!0,v.hideCursor(),x.hasmousecapture&&document.releaseCapture(),!x.cantouch))return v.cancelEvent(e)}else if(1==v.rail.drag.pt)return v.onmouseup(e)};var z=v.opt.touchbehavior&&v.isiframe&&!x.hasmousecapture;v.ontouchmove=function(e,o){if(!v.rail.drag)return!1;if(e.targetTouches&&v.opt.preventmultitouchscrolling&&e.targetTouches.length>1)return!1;if(e.pointerType&&2!=e.pointerType&&"touch"!=e.pointerType)return!1;if(2==v.rail.drag.pt){if(x.cantouch&&x.isios&&"undefined"==typeof e.original)return!0;v.hasmoving=!0,v.preventclick&&!v.preventclick.click&&(v.preventclick.click=v.preventclick.tg.onclick||!1,v.preventclick.tg.onclick=v.onpreventclick);var t=a.extend({original:e},e);if(e=t,"changedTouches"in e&&(e.clientX=e.changedTouches[0].clientX,e.clientY=e.changedTouches[0].clientY),v.forcescreen){var r=e;e={original:e.original?e.original:e},e.clientX=r.screenX,e.clientY=r.screenY}var i,n;if(n=i=0,z&&!o){var s=v.win.position();n=-s.left,i=-s.top}var l=e.clientY+i,c=l-v.rail.drag.y,d=e.clientX+n,u=d-v.rail.drag.x,h=v.rail.drag.st-c;v.ishwscroll&&v.opt.bouncescroll?0>h?h=Math.round(h/2):h>v.page.maxh&&(h=v.page.maxh+Math.round((h-v.page.maxh)/2)):(0>h&&(h=0,l=0),h>v.page.maxh&&(h=v.page.maxh,l=0));var p;v.railh&&v.railh.scrollable&&(p=v.isrtlmode?u-v.rail.drag.sl:v.rail.drag.sl-u,v.ishwscroll&&v.opt.bouncescroll?0>p?p=Math.round(p/2):p>v.page.maxw&&(p=v.page.maxw+Math.round((p-v.page.maxw)/2)):(0>p&&(p=0,d=0),p>v.page.maxw&&(p=v.page.maxw,d=0)));var m=!1;if(v.rail.drag.dl)m=!0,"v"==v.rail.drag.dl?p=v.rail.drag.sl:"h"==v.rail.drag.dl&&(h=v.rail.drag.st);else{var f=Math.abs(c),g=Math.abs(u),w=v.opt.directionlockdeadzone;if("v"==v.rail.drag.ck){if(f>w&&.3*f>=g)return v.rail.drag=!1,!0;g>w&&(v.rail.drag.dl="f",a("body").scrollTop(a("body").scrollTop()))}else if("h"==v.rail.drag.ck){if(g>w&&.3*g>=f)return v.rail.drag=!1,!0;f>w&&(v.rail.drag.dl="f",a("body").scrollLeft(a("body").scrollLeft()))}}if(v.synched("touchmove",function(){v.rail.drag&&2==v.rail.drag.pt&&(v.prepareTransition&&v.prepareTransition(0),v.rail.scrollable&&v.setScrollTop(h),v.scrollmom.update(d,l),v.railh&&v.railh.scrollable?(v.setScrollLeft(p),v.showCursor(h,p)):v.showCursor(h),x.isie10&&document.selection.clear())}),x.ischrome&&v.istouchcapable&&(m=!1),m)return v.cancelEvent(e)}else if(1==v.rail.drag.pt)return v.onmousemove(e)}}if(v.onmousedown=function(e,o){if(!v.rail.drag||1==v.rail.drag.pt){if(v.railslocked)return v.cancelEvent(e);v.cancelScroll(),v.rail.drag={x:e.clientX,y:e.clientY,sx:v.scroll.x,sy:v.scroll.y,pt:1,hr:!!o};var t=v.getTarget(e);return!v.ispage&&x.hasmousecapture&&t.setCapture(),v.isiframe&&!x.hasmousecapture&&(v.saved.csspointerevents=v.doc.css("pointer-events"),v.css(v.doc,{"pointer-events":"none"})),v.hasmoving=!1,v.cancelEvent(e)}},v.onmouseup=function(e){return v.rail.drag?1!=v.rail.drag.pt?!0:(x.hasmousecapture&&document.releaseCapture(),v.isiframe&&!x.hasmousecapture&&v.doc.css("pointer-events",v.saved.csspointerevents),v.rail.drag=!1,v.hasmoving&&v.triggerScrollEnd(),v.cancelEvent(e)):void 0},v.onmousemove=function(e){if(v.rail.drag){if(1!=v.rail.drag.pt)return;if(x.ischrome&&0==e.which)return v.onmouseup(e);if(v.cursorfreezed=!0,v.hasmoving=!0,v.rail.drag.hr){v.scroll.x=v.rail.drag.sx+(e.clientX-v.rail.drag.x),v.scroll.x<0&&(v.scroll.x=0);var o=v.scrollvaluemaxw;v.scroll.x>o&&(v.scroll.x=o)}else{v.scroll.y=v.rail.drag.sy+(e.clientY-v.rail.drag.y),v.scroll.y<0&&(v.scroll.y=0);var t=v.scrollvaluemax;v.scroll.y>t&&(v.scroll.y=t)}return v.synched("mousemove",function(){v.rail.drag&&1==v.rail.drag.pt&&(v.showCursor(),v.rail.drag.hr?v.hasreversehr?v.doScrollLeft(v.scrollvaluemaxw-Math.round(v.scroll.x*v.scrollratio.x),v.opt.cursordragspeed):v.doScrollLeft(Math.round(v.scroll.x*v.scrollratio.x),v.opt.cursordragspeed):v.doScrollTop(Math.round(v.scroll.y*v.scrollratio.y),v.opt.cursordragspeed))}),v.cancelEvent(e)}v.checkarea=0},x.cantouch||v.opt.touchbehavior)v.onpreventclick=function(e){return v.preventclick?(v.preventclick.tg.onclick=v.preventclick.click,v.preventclick=!1,v.cancelEvent(e)):void 0},v.bind(v.win,"mousedown",v.ontouchstart),v.onclick=x.isios?!1:function(e){return v.lastmouseup?(v.lastmouseup=!1,v.cancelEvent(e)):!0},v.opt.grabcursorenabled&&x.cursorgrabvalue&&(v.css(v.ispage?v.doc:v.win,{cursor:x.cursorgrabvalue}),v.css(v.rail,{cursor:x.cursorgrabvalue}));else{var T=function(e){if(v.selectiondrag){if(e){var o=v.win.outerHeight(),t=e.pageY-v.selectiondrag.top;t>0&&o>t&&(t=0),t>=o&&(t-=o),v.selectiondrag.df=t}if(0!=v.selectiondrag.df){var r=2*-Math.floor(v.selectiondrag.df/6);v.doScrollBy(r),v.debounced("doselectionscroll",function(){T()},50)}}};"getSelection"in document?v.hasTextSelected=function(){return document.getSelection().rangeCount>0}:"selection"in document?v.hasTextSelected=function(){return"None"!=document.selection.type}:v.hasTextSelected=function(){return!1},v.onselectionstart=function(e){v.ispage||(v.selectiondrag=v.win.offset())},v.onselectionend=function(e){v.selectiondrag=!1},v.onselectiondrag=function(e){v.selectiondrag&&v.hasTextSelected()&&v.debounced("selectionscroll",function(){T(e)},250)}}x.hasw3ctouch?(v.css(v.rail,{"touch-action":"none"}),v.css(v.cursor,{"touch-action":"none"}),v.bind(v.win,"pointerdown",v.ontouchstart),v.bind(document,"pointerup",v.ontouchend),v.bind(document,"pointermove",v.ontouchmove)):x.hasmstouch?(v.css(v.rail,{"-ms-touch-action":"none"}),v.css(v.cursor,{"-ms-touch-action":"none"}),v.bind(v.win,"MSPointerDown",v.ontouchstart),v.bind(document,"MSPointerUp",v.ontouchend),v.bind(document,"MSPointerMove",v.ontouchmove),v.bind(v.cursor,"MSGestureHold",function(e){e.preventDefault()}),v.bind(v.cursor,"contextmenu",function(e){e.preventDefault()})):this.istouchcapable&&(v.bind(v.win,"touchstart",v.ontouchstart),v.bind(document,"touchend",v.ontouchend),v.bind(document,"touchcancel",v.ontouchend),v.bind(document,"touchmove",v.ontouchmove)),(v.opt.cursordragontouch||!x.cantouch&&!v.opt.touchbehavior)&&(v.rail.css({cursor:"default"}),v.railh&&v.railh.css({cursor:"default"}),v.jqbind(v.rail,"mouseenter",function(){return v.ispage||v.win.is(":visible")?(v.canshowonmouseevent&&v.showCursor(),void(v.rail.active=!0)):!1}),v.jqbind(v.rail,"mouseleave",function(){v.rail.active=!1,v.rail.drag||v.hideCursor()}),v.opt.sensitiverail&&(v.bind(v.rail,"click",function(e){v.doRailClick(e,!1,!1)}),v.bind(v.rail,"dblclick",function(e){v.doRailClick(e,!0,!1)}),v.bind(v.cursor,"click",function(e){v.cancelEvent(e)}),v.bind(v.cursor,"dblclick",function(e){v.cancelEvent(e)})),v.railh&&(v.jqbind(v.railh,"mouseenter",function(){return v.ispage||v.win.is(":visible")?(v.canshowonmouseevent&&v.showCursor(),void(v.rail.active=!0)):!1}),v.jqbind(v.railh,"mouseleave",function(){v.rail.active=!1,v.rail.drag||v.hideCursor()}),v.opt.sensitiverail&&(v.bind(v.railh,"click",function(e){v.doRailClick(e,!1,!0)}),v.bind(v.railh,"dblclick",function(e){v.doRailClick(e,!0,!0)}),v.bind(v.cursorh,"click",function(e){v.cancelEvent(e)}),v.bind(v.cursorh,"dblclick",function(e){v.cancelEvent(e)})))),x.cantouch||v.opt.touchbehavior?(v.bind(x.hasmousecapture?v.win:document,"mouseup",v.ontouchend),v.bind(document,"mousemove",v.ontouchmove),v.onclick&&v.bind(document,"click",v.onclick),v.opt.cursordragontouch&&(v.bind(v.cursor,"mousedown",v.onmousedown),v.bind(v.cursor,"mouseup",v.onmouseup),v.cursorh&&v.bind(v.cursorh,"mousedown",function(e){v.onmousedown(e,!0)}),v.cursorh&&v.bind(v.cursorh,"mouseup",v.onmouseup))):(v.bind(x.hasmousecapture?v.win:document,"mouseup",v.onmouseup),v.bind(document,"mousemove",v.onmousemove),v.onclick&&v.bind(document,"click",v.onclick),v.bind(v.cursor,"mousedown",v.onmousedown),v.bind(v.cursor,"mouseup",v.onmouseup),v.railh&&(v.bind(v.cursorh,"mousedown",function(e){v.onmousedown(e,!0)}),v.bind(v.cursorh,"mouseup",v.onmouseup)),!v.ispage&&v.opt.enablescrollonselection&&(v.bind(v.win[0],"mousedown",v.onselectionstart),v.bind(document,"mouseup",v.onselectionend),v.bind(v.cursor,"mouseup",v.onselectionend),v.cursorh&&v.bind(v.cursorh,"mouseup",v.onselectionend),v.bind(document,"mousemove",v.onselectiondrag)),v.zoom&&(v.jqbind(v.zoom,"mouseenter",function(){v.canshowonmouseevent&&v.showCursor(),v.rail.active=!0}),v.jqbind(v.zoom,"mouseleave",function(){v.rail.active=!1,v.rail.drag||v.hideCursor()}))),v.opt.enablemousewheel&&(v.isiframe||v.bind(x.isie&&v.ispage?document:v.win,"mousewheel",v.onmousewheel),v.bind(v.rail,"mousewheel",v.onmousewheel),v.railh&&v.bind(v.railh,"mousewheel",v.onmousewheelhr)),v.ispage||x.cantouch||/HTML|^BODY/.test(v.win[0].nodeName)||(v.win.attr("tabindex")||v.win.attr({tabindex:n++}),v.jqbind(v.win,"focus",function(e){r=v.getTarget(e).id||!0,v.hasfocus=!0,v.canshowonmouseevent&&v.noticeCursor()}), v.jqbind(v.win,"blur",function(e){r=!1,v.hasfocus=!1}),v.jqbind(v.win,"mouseenter",function(e){i=v.getTarget(e).id||!0,v.hasmousefocus=!0,v.canshowonmouseevent&&v.noticeCursor()}),v.jqbind(v.win,"mouseleave",function(){i=!1,v.hasmousefocus=!1,v.rail.drag||v.hideCursor()}))}if(v.onkeypress=function(e){if(v.railslocked&&0==v.page.maxh)return!0;e=e?e:window.e;var o=v.getTarget(e);if(o&&/INPUT|TEXTAREA|SELECT|OPTION/.test(o.nodeName)){var t=o.getAttribute("type")||o.type||!1;if(!t||!/submit|button|cancel/i.tp)return!0}if(a(o).attr("contenteditable"))return!0;if(v.hasfocus||v.hasmousefocus&&!r||v.ispage&&!r&&!i){var n=e.keyCode;if(v.railslocked&&27!=n)return v.cancelEvent(e);var s=e.ctrlKey||!1,l=e.shiftKey||!1,c=!1;switch(n){case 38:case 63233:v.doScrollBy(72),c=!0;break;case 40:case 63235:v.doScrollBy(-72),c=!0;break;case 37:case 63232:v.railh&&(s?v.doScrollLeft(0):v.doScrollLeftBy(72),c=!0);break;case 39:case 63234:v.railh&&(s?v.doScrollLeft(v.page.maxw):v.doScrollLeftBy(-72),c=!0);break;case 33:case 63276:v.doScrollBy(v.view.h),c=!0;break;case 34:case 63277:v.doScrollBy(-v.view.h),c=!0;break;case 36:case 63273:v.railh&&s?v.doScrollPos(0,0):v.doScrollTo(0),c=!0;break;case 35:case 63275:v.railh&&s?v.doScrollPos(v.page.maxw,v.page.maxh):v.doScrollTo(v.page.maxh),c=!0;break;case 32:v.opt.spacebarenabled&&(l?v.doScrollBy(v.view.h):v.doScrollBy(-v.view.h),c=!0);break;case 27:v.zoomactive&&(v.doZoom(),c=!0)}if(c)return v.cancelEvent(e)}},v.opt.enablekeyboard&&v.bind(document,x.isopera&&!x.isopera12?"keypress":"keydown",v.onkeypress),v.bind(document,"keydown",function(e){var o=e.ctrlKey||!1;o&&(v.wheelprevented=!0)}),v.bind(document,"keyup",function(e){var o=e.ctrlKey||!1;o||(v.wheelprevented=!1)}),v.bind(window,"blur",function(e){v.wheelprevented=!1}),v.bind(window,"resize",v.lazyResize),v.bind(window,"orientationchange",v.lazyResize),v.bind(window,"load",v.lazyResize),x.ischrome&&!v.ispage&&!v.haswrapper){var k=v.win.attr("style"),M=parseFloat(v.win.css("width"))+1;v.win.css("width",M),v.synched("chromefix",function(){v.win.attr("style",k)})}v.onAttributeChange=function(e){v.lazyResize(v.isieold?250:30)},m!==!1&&(v.observerbody=new m(function(e){return e.forEach(function(e){return"attributes"==e.type?a("body").hasClass("modal-open")&&!a.contains(a(".modal-dialog")[0],v.doc[0])?v.hide():v.show():void 0}),document.body.scrollHeight!=v.page.maxh?v.lazyResize(30):void 0}),v.observerbody.observe(document.body,{childList:!0,subtree:!0,characterData:!1,attributes:!0,attributeFilter:["class"]})),v.ispage||v.haswrapper||(m!==!1?(v.observer=new m(function(e){e.forEach(v.onAttributeChange)}),v.observer.observe(v.win[0],{childList:!0,characterData:!1,attributes:!0,subtree:!1}),v.observerremover=new m(function(e){e.forEach(function(e){if(e.removedNodes.length>0)for(var o in e.removedNodes)if(v&&e.removedNodes[o]==v.win[0])return v.remove()})}),v.observerremover.observe(v.win[0].parentNode,{childList:!0,characterData:!1,attributes:!1,subtree:!1})):(v.bind(v.win,x.isie&&!x.isie9?"propertychange":"DOMAttrModified",v.onAttributeChange),x.isie9&&v.win[0].attachEvent("onpropertychange",v.onAttributeChange),v.bind(v.win,"DOMNodeRemoved",function(e){e.target==v.win[0]&&v.remove()}))),!v.ispage&&v.opt.boxzoom&&v.bind(window,"resize",v.resizeZoom),v.istextarea&&(v.bind(v.win,"keydown",v.lazyResize),v.bind(v.win,"mouseup",v.lazyResize)),v.lazyResize(30)}if("IFRAME"==this.doc[0].nodeName){var E=function(){v.iframexd=!1;var e;try{e="contentDocument"in this?this.contentDocument:this.contentWindow.document;e.domain}catch(o){v.iframexd=!0,e=!1}if(v.iframexd)return!0;if(v.forcescreen=!0,v.isiframe&&(v.iframe={doc:a(e),html:v.doc.contents().find("html")[0],body:v.doc.contents().find("body")[0]},v.getContentSize=function(){return{w:Math.max(v.iframe.html.scrollWidth,v.iframe.body.scrollWidth),h:Math.max(v.iframe.html.scrollHeight,v.iframe.body.scrollHeight)}},v.docscroll=a(v.iframe.body)),!x.isios&&v.opt.iframeautoresize&&!v.isiframe){v.win.scrollTop(0),v.doc.height("");var t=Math.max(e.getElementsByTagName("html")[0].scrollHeight,e.body.scrollHeight);v.doc.height(t)}v.lazyResize(30),x.isie7&&v.css(a(v.iframe.html),{"overflow-y":"hidden"}),v.css(a(v.iframe.body),{"overflow-y":"hidden"}),x.isios&&v.haswrapper&&v.css(a(e.body),{"-webkit-transform":"translate3d(0,0,0)"}),"contentWindow"in this?v.bind(this.contentWindow,"scroll",v.onscroll):v.bind(e,"scroll",v.onscroll),v.opt.enablemousewheel&&v.bind(e,"mousewheel",v.onmousewheel),v.opt.enablekeyboard&&v.bind(e,x.isopera?"keypress":"keydown",v.onkeypress),(x.cantouch||v.opt.touchbehavior)&&(v.bind(e,"mousedown",v.ontouchstart),v.bind(e,"mousemove",function(e){return v.ontouchmove(e,!0)}),v.opt.grabcursorenabled&&x.cursorgrabvalue&&v.css(a(e.body),{cursor:x.cursorgrabvalue})),v.bind(e,"mouseup",v.ontouchend),v.zoom&&(v.opt.dblclickzoom&&v.bind(e,"dblclick",v.doZoom),v.ongesturezoom&&v.bind(e,"gestureend",v.ongesturezoom))};this.doc[0].readyState&&"complete"==this.doc[0].readyState&&setTimeout(function(){E.call(v.doc[0],!1)},500),v.bind(this.doc,"load",E)}},this.showCursor=function(e,o){if(v.cursortimeout&&(clearTimeout(v.cursortimeout),v.cursortimeout=0),v.rail){if(v.autohidedom&&(v.autohidedom.stop().css({opacity:v.opt.cursoropacitymax}),v.cursoractive=!0),v.rail.drag&&1==v.rail.drag.pt||("undefined"!=typeof e&&e!==!1&&(v.scroll.y=Math.round(1*e/v.scrollratio.y)),"undefined"!=typeof o&&(v.scroll.x=Math.round(1*o/v.scrollratio.x))),v.cursor.css({height:v.cursorheight,top:v.scroll.y}),v.cursorh){var t=v.hasreversehr?v.scrollvaluemaxw-v.scroll.x:v.scroll.x;!v.rail.align&&v.rail.visibility?v.cursorh.css({width:v.cursorwidth,left:t+v.rail.width}):v.cursorh.css({width:v.cursorwidth,left:t}),v.cursoractive=!0}v.zoom&&v.zoom.stop().css({opacity:v.opt.cursoropacitymax})}},this.hideCursor=function(e){v.cursortimeout||v.rail&&v.autohidedom&&(v.hasmousefocus&&"leave"==v.opt.autohidemode||(v.cursortimeout=setTimeout(function(){v.rail.active&&v.showonmouseevent||(v.autohidedom.stop().animate({opacity:v.opt.cursoropacitymin}),v.zoom&&v.zoom.stop().animate({opacity:v.opt.cursoropacitymin}),v.cursoractive=!1),v.cursortimeout=0},e||v.opt.hidecursordelay)))},this.noticeCursor=function(e,o,t){v.showCursor(o,t),v.rail.active||v.hideCursor(e)},this.getContentSize=v.ispage?function(){return{w:Math.max(document.body.scrollWidth,document.documentElement.scrollWidth),h:Math.max(document.body.scrollHeight,document.documentElement.scrollHeight)}}:v.haswrapper?function(){return{w:v.doc.outerWidth()+parseInt(v.win.css("paddingLeft"))+parseInt(v.win.css("paddingRight")),h:v.doc.outerHeight()+parseInt(v.win.css("paddingTop"))+parseInt(v.win.css("paddingBottom"))}}:function(){return{w:v.docscroll[0].scrollWidth,h:v.docscroll[0].scrollHeight}},this.onResize=function(e,o){if(!v||!v.win)return!1;if(!v.haswrapper&&!v.ispage){if("none"==v.win.css("display"))return v.visibility&&v.hideRail().hideRailHr(),!1;v.hidden||v.visibility||v.showRail().showRailHr()}var t=v.page.maxh,r=v.page.maxw,i={h:v.view.h,w:v.view.w};if(v.view={w:v.ispage?v.win.width():parseInt(v.win[0].clientWidth),h:v.ispage?v.win.height():parseInt(v.win[0].clientHeight)},v.page=o?o:v.getContentSize(),v.page.maxh=Math.max(0,v.page.h-v.view.h),v.page.maxw=Math.max(0,v.page.w-v.view.w),v.page.maxh==t&&v.page.maxw==r&&v.view.w==i.w&&v.view.h==i.h){if(v.ispage)return v;var n=v.win.offset();if(v.lastposition){var s=v.lastposition;if(s.top==n.top&&s.left==n.left)return v}v.lastposition=n}if(0==v.page.maxh?(v.hideRail(),v.scrollvaluemax=0,v.scroll.y=0,v.scrollratio.y=0,v.cursorheight=0,v.setScrollTop(0),v.rail&&(v.rail.scrollable=!1)):(v.page.maxh-=v.opt.railpadding.top+v.opt.railpadding.bottom,v.rail.scrollable=!0),0==v.page.maxw?(v.hideRailHr(),v.scrollvaluemaxw=0,v.scroll.x=0,v.scrollratio.x=0,v.cursorwidth=0,v.setScrollLeft(0),v.railh&&(v.railh.scrollable=!1)):(v.page.maxw-=v.opt.railpadding.left+v.opt.railpadding.right,v.railh&&(v.railh.scrollable=v.opt.horizrailenabled)),v.railslocked=v.locked||0==v.page.maxh&&0==v.page.maxw,v.railslocked)return v.ispage||v.updateScrollBar(v.view),!1;v.hidden||v.visibility?!v.railh||v.hidden||v.railh.visibility||v.showRailHr():v.showRail().showRailHr(),v.istextarea&&v.win.css("resize")&&"none"!=v.win.css("resize")&&(v.view.h-=20),v.cursorheight=Math.min(v.view.h,Math.round(v.view.h*(v.view.h/v.page.h))),v.cursorheight=v.opt.cursorfixedheight?v.opt.cursorfixedheight:Math.max(v.opt.cursorminheight,v.cursorheight),v.cursorwidth=Math.min(v.view.w,Math.round(v.view.w*(v.view.w/v.page.w))),v.cursorwidth=v.opt.cursorfixedheight?v.opt.cursorfixedheight:Math.max(v.opt.cursorminheight,v.cursorwidth),v.scrollvaluemax=v.view.h-v.cursorheight-v.cursor.hborder-(v.opt.railpadding.top+v.opt.railpadding.bottom),v.railh&&(v.railh.width=v.page.maxh>0?v.view.w-v.rail.width:v.view.w,v.scrollvaluemaxw=v.railh.width-v.cursorwidth-v.cursorh.wborder-(v.opt.railpadding.left+v.opt.railpadding.right)),v.ispage||v.updateScrollBar(v.view),v.scrollratio={x:v.page.maxw/v.scrollvaluemaxw,y:v.page.maxh/v.scrollvaluemax};var l=v.getScrollTop();return l>v.page.maxh?v.doScrollTop(v.page.maxh):(v.scroll.y=Math.round(v.getScrollTop()*(1/v.scrollratio.y)),v.scroll.x=Math.round(v.getScrollLeft()*(1/v.scrollratio.x)),v.cursoractive&&v.noticeCursor()),v.scroll.y&&0==v.getScrollTop()&&v.doScrollTo(Math.floor(v.scroll.y*v.scrollratio.y)),v},this.resize=v.onResize,this.lazyResize=function(e){return e=isNaN(e)?30:e,v.debounced("resize",v.resize,e),v},this.jqbind=function(e,o,t){v.events.push({e:e,n:o,f:t,q:!0}),a(e).bind(o,t)},this.bind=function(e,o,t,r){var i="jquery"in e?e[0]:e;if("mousewheel"==o)if("onwheel"in v.win)v._bind(i,"wheel",t,r||!1);else{var n="undefined"!=typeof document.onmousewheel?"mousewheel":"DOMMouseScroll";p(i,n,t,r||!1),"DOMMouseScroll"==n&&p(i,"MozMousePixelScroll",t,r||!1)}else if(i.addEventListener){if(x.cantouch&&/mouseup|mousedown|mousemove/.test(o)){var s="mousedown"==o?"touchstart":"mouseup"==o?"touchend":"touchmove";v._bind(i,s,function(e){if(e.touches){if(e.touches.length<2){var o=e.touches.length?e.touches[0]:e;o.original=e,t.call(this,o)}}else if(e.changedTouches){var o=e.changedTouches[0];o.original=e,t.call(this,o)}},r||!1)}v._bind(i,o,t,r||!1),x.cantouch&&"mouseup"==o&&v._bind(i,"touchcancel",t,r||!1)}else v._bind(i,o,function(e){return e=e||window.event||!1,e&&e.srcElement&&(e.target=e.srcElement),"pageY"in e||(e.pageX=e.clientX+document.documentElement.scrollLeft,e.pageY=e.clientY+document.documentElement.scrollTop),t.call(i,e)===!1||r===!1?v.cancelEvent(e):!0})},x.haseventlistener?(this._bind=function(e,o,t,r){v.events.push({e:e,n:o,f:t,b:r,q:!1}),e.addEventListener(o,t,r||!1)},this.cancelEvent=function(e){if(!e)return!1;var e=e.original?e.original:e;return e.preventDefault(),e.stopPropagation(),e.preventManipulation&&e.preventManipulation(),!1},this.stopPropagation=function(e){if(!e)return!1;var e=e.original?e.original:e;return e.stopPropagation(),!1},this._unbind=function(e,o,t,r){e.removeEventListener(o,t,r)}):(this._bind=function(e,o,t,r){v.events.push({e:e,n:o,f:t,b:r,q:!1}),e.attachEvent?e.attachEvent("on"+o,t):e["on"+o]=t},this.cancelEvent=function(e){var e=window.event||!1;return e?(e.cancelBubble=!0,e.cancel=!0,e.returnValue=!1,!1):!1},this.stopPropagation=function(e){var e=window.event||!1;return e?(e.cancelBubble=!0,!1):!1},this._unbind=function(e,o,t,r){e.detachEvent?e.detachEvent("on"+o,t):e["on"+o]=!1}),this.unbindAll=function(){for(var e=0;e0)return t;o=o.parentNode?o.parentNode:!1}return!1},this.triggerScrollEnd=function(){if(v.onscrollend){var e=v.getScrollLeft(),o=v.getScrollTop(),t={type:"scrollend",current:{x:e,y:o},end:{x:e,y:o}};v.onscrollend.call(v,t)}},this.onmousewheel=function(e){if(!v.wheelprevented){if(v.railslocked)return v.debounced("checkunlock",v.resize,250),!0;if(v.rail.drag)return v.cancelEvent(e);if("auto"==v.opt.oneaxismousemode&&0!=e.deltaX&&(v.opt.oneaxismousemode=!1),v.opt.oneaxismousemode&&0==e.deltaX&&!v.rail.scrollable)return v.railh&&v.railh.scrollable?v.onmousewheelhr(e):!0;var o=+new Date,t=!1;if(v.opt.preservenativescrolling&&v.checkarea+60020?t:0},v.opt.smoothscroll?v.ishwscroll&&x.hastransition&&v.opt.usetransition&&v.opt.smoothscroll?(this.prepareTransition=function(e,o){var t=o?e>20?e:0:v.getTransitionSpeed(e),r=t?x.prefixstyle+"transform "+t+"ms ease-out":"";return v.lasttransitionstyle&&v.lasttransitionstyle==r||(v.lasttransitionstyle=r,v.doc.css(x.transitionstyle,r)),t},this.doScrollLeft=function(e,o){var t=v.scrollrunning?v.newscrolly:v.getScrollTop();v.doScrollPos(e,t,o)},this.doScrollTop=function(e,o){var t=v.scrollrunning?v.newscrollx:v.getScrollLeft();v.doScrollPos(t,e,o)},this.doScrollPos=function(e,o,t){var r=v.getScrollTop(),i=v.getScrollLeft();return((v.newscrolly-r)*(o-r)<0||(v.newscrollx-i)*(e-i)<0)&&v.cancelScroll(),0==v.opt.bouncescroll&&(0>o?o=0:o>v.page.maxh&&(o=v.page.maxh),0>e?e=0:e>v.page.maxw&&(e=v.page.maxw)),v.scrollrunning&&e==v.newscrollx&&o==v.newscrolly?!1:(v.newscrolly=o,v.newscrollx=e,v.newscrollspeed=t||!1,v.timer?!1:void(v.timer=setTimeout(function(){var t=v.getScrollTop(),r=v.getScrollLeft(),i={};i.x=e-r,i.y=o-t,i.px=r,i.py=t;var n=Math.round(Math.sqrt(Math.pow(i.x,2)+Math.pow(i.y,2))),s=v.newscrollspeed&&v.newscrollspeed>1?v.newscrollspeed:v.getTransitionSpeed(n);if(v.newscrollspeed&&v.newscrollspeed<=1&&(s*=v.newscrollspeed),v.prepareTransition(s,!0),v.timerscroll&&v.timerscroll.tm&&clearInterval(v.timerscroll.tm),s>0){if(!v.scrollrunning&&v.onscrollstart){var l={type:"scrollstart",current:{x:r,y:t},request:{x:e,y:o},end:{x:v.newscrollx,y:v.newscrolly},speed:s};v.onscrollstart.call(v,l)}x.transitionend?v.scrollendtrapped||(v.scrollendtrapped=!0,v.bind(v.doc,x.transitionend,v.onScrollTransitionEnd,!1)):(v.scrollendtrapped&&clearTimeout(v.scrollendtrapped),v.scrollendtrapped=setTimeout(v.onScrollTransitionEnd,s));var a=t,c=r;v.timerscroll={bz:new z(a,v.newscrolly,s,0,0,.58,1),bh:new z(c,v.newscrollx,s,0,0,.58,1)},v.cursorfreezed||(v.timerscroll.tm=setInterval(function(){v.showCursor(v.getScrollTop(),v.getScrollLeft())},60))}v.synched("doScroll-set",function(){v.timer=0,v.scrollendtrapped&&(v.scrollrunning=!0),v.setScrollTop(v.newscrolly),v.setScrollLeft(v.newscrollx),v.scrollendtrapped||v.onScrollTransitionEnd()})},50)))},this.cancelScroll=function(){if(!v.scrollendtrapped)return!0;var e=v.getScrollTop(),o=v.getScrollLeft();return v.scrollrunning=!1,x.transitionend||clearTimeout(x.transitionend),v.scrollendtrapped=!1,v._unbind(v.doc[0],x.transitionend,v.onScrollTransitionEnd),v.prepareTransition(0),v.setScrollTop(e),v.railh&&v.setScrollLeft(o),v.timerscroll&&v.timerscroll.tm&&clearInterval(v.timerscroll.tm),v.timerscroll=!1,v.cursorfreezed=!1,v.showCursor(e,o),v},this.onScrollTransitionEnd=function(){v.scrollendtrapped&&v._unbind(v.doc[0],x.transitionend,v.onScrollTransitionEnd),v.scrollendtrapped=!1,v.prepareTransition(0),v.timerscroll&&v.timerscroll.tm&&clearInterval(v.timerscroll.tm),v.timerscroll=!1;var e=v.getScrollTop(),o=v.getScrollLeft();return v.setScrollTop(e),v.railh&&v.setScrollLeft(o),v.noticeCursor(!1,e,o),v.cursorfreezed=!1,0>e?e=0:e>v.page.maxh&&(e=v.page.maxh),0>o?o=0:o>v.page.maxw&&(o=v.page.maxw),e!=v.newscrolly||o!=v.newscrollx?v.doScrollPos(o,e,v.opt.snapbackspeed):(v.onscrollend&&v.scrollrunning&&v.triggerScrollEnd(),void(v.scrollrunning=!1))}):(this.doScrollLeft=function(e,o){var t=v.scrollrunning?v.newscrolly:v.getScrollTop();v.doScrollPos(e,t,o)},this.doScrollTop=function(e,o){var t=v.scrollrunning?v.newscrollx:v.getScrollLeft();v.doScrollPos(t,e,o)},this.doScrollPos=function(e,o,t){function r(){if(v.cancelAnimationFrame)return!0;if(v.scrollrunning=!0,h=1-h)return v.timer=d(r)||1;var e,o,t=0,i=o=v.getScrollTop();if(v.dst.ay){i=v.bzscroll?v.dst.py+v.bzscroll.getNow()*v.dst.ay:v.newscrolly;var n=i-o;(0>n&&i0&&i>v.newscrolly)&&(i=v.newscrolly),v.setScrollTop(i),i==v.newscrolly&&(t=1)}else t=1;var s=e=v.getScrollLeft();if(v.dst.ax){s=v.bzscroll?v.dst.px+v.bzscroll.getNow()*v.dst.ax:v.newscrollx;var n=s-e;(0>n&&s0&&s>v.newscrollx)&&(s=v.newscrollx),v.setScrollLeft(s),s==v.newscrollx&&(t+=1)}else t+=1;2==t?(v.timer=0,v.cursorfreezed=!1,v.bzscroll=!1,v.scrollrunning=!1,0>i?i=0:i>v.page.maxh&&(i=v.page.maxh),0>s?s=0:s>v.page.maxw&&(s=v.page.maxw),s!=v.newscrollx||i!=v.newscrolly?v.doScrollPos(s,i):v.onscrollend&&v.triggerScrollEnd()):v.timer=d(r)||1}var o="undefined"==typeof o||o===!1?v.getScrollTop(!0):o;if(v.timer&&v.newscrolly==o&&v.newscrollx==e)return!0;v.timer&&u(v.timer),v.timer=0;var i=v.getScrollTop(),n=v.getScrollLeft();((v.newscrolly-i)*(o-i)<0||(v.newscrollx-n)*(e-n)<0)&&v.cancelScroll(),v.newscrolly=o,v.newscrollx=e,v.bouncescroll&&v.rail.visibility||(v.newscrolly<0?v.newscrolly=0:v.newscrolly>v.page.maxh&&(v.newscrolly=v.page.maxh)),v.bouncescroll&&v.railh.visibility||(v.newscrollx<0?v.newscrollx=0:v.newscrollx>v.page.maxw&&(v.newscrollx=v.page.maxw)),v.dst={},v.dst.x=e-n,v.dst.y=o-i,v.dst.px=n,v.dst.py=i;var s=Math.round(Math.sqrt(Math.pow(v.dst.x,2)+Math.pow(v.dst.y,2)));v.dst.ax=v.dst.x/s,v.dst.ay=v.dst.y/s;var l=0,a=s;0==v.dst.x?(l=i,a=o,v.dst.ay=1,v.dst.py=0):0==v.dst.y&&(l=n,a=e,v.dst.ax=1,v.dst.px=0);var c=v.getTransitionSpeed(s);if(t&&1>=t&&(c*=t),c>0?v.bzscroll=v.bzscroll?v.bzscroll.update(a,c):new z(l,a,c,0,1,0,1):v.bzscroll=!1,!v.timer){(i==v.page.maxh&&o>=v.page.maxh||n==v.page.maxw&&e>=v.page.maxw)&&v.checkContentSize();var h=1;if(v.cancelAnimationFrame=!1,v.timer=1,v.onscrollstart&&!v.scrollrunning){var p={type:"scrollstart",current:{x:n,y:i},request:{x:e,y:o},end:{x:v.newscrollx,y:v.newscrolly},speed:c};v.onscrollstart.call(v,p)}r(),(i==v.page.maxh&&o>=i||n==v.page.maxw&&e>=n)&&v.checkContentSize(),v.noticeCursor()}},this.cancelScroll=function(){return v.timer&&u(v.timer),v.timer=0,v.bzscroll=!1,v.scrollrunning=!1,v}):(this.doScrollLeft=function(e,o){var t=v.getScrollTop();v.doScrollPos(e,t,o)},this.doScrollTop=function(e,o){var t=v.getScrollLeft();v.doScrollPos(t,e,o)},this.doScrollPos=function(e,o,t){var r=e>v.page.maxw?v.page.maxw:e;0>r&&(r=0);var i=o>v.page.maxh?v.page.maxh:o;0>i&&(i=0),v.synched("scroll",function(){v.setScrollTop(i),v.setScrollLeft(r)})},this.cancelScroll=function(){}),this.doScrollBy=function(e,o){var t=0;if(o)t=Math.floor((v.scroll.y-e)*v.scrollratio.y);else{var r=v.timer?v.newscrolly:v.getScrollTop(!0);t=r-e}if(v.bouncescroll){var i=Math.round(v.view.h/2);-i>t?t=-i:t>v.page.maxh+i&&(t=v.page.maxh+i)}v.cursorfreezed=!1;var n=v.getScrollTop(!0);return 0>t&&0>=n?v.noticeCursor():t>v.page.maxh&&n>=v.page.maxh?(v.checkContentSize(),v.noticeCursor()):void v.doScrollTop(t)},this.doScrollLeftBy=function(e,o){var t=0;if(o)t=Math.floor((v.scroll.x-e)*v.scrollratio.x);else{var r=v.timer?v.newscrollx:v.getScrollLeft(!0);t=r-e}if(v.bouncescroll){var i=Math.round(v.view.w/2);-i>t?t=-i:t>v.page.maxw+i&&(t=v.page.maxw+i)}v.cursorfreezed=!1;var n=v.getScrollLeft(!0);return 0>t&&0>=n?v.noticeCursor():t>v.page.maxw&&n>=v.page.maxw?v.noticeCursor():void v.doScrollLeft(t)},this.doScrollTo=function(e,o){var t=o?Math.round(e*v.scrollratio.y):e;0>t?t=0:t>v.page.maxh&&(t=v.page.maxh),v.cursorfreezed=!1,v.doScrollTop(e)},this.checkContentSize=function(){var e=v.getContentSize();(e.h!=v.page.h||e.w!=v.page.w)&&v.resize(!1,e)},v.onscroll=function(e){v.rail.drag||v.cursorfreezed||v.synched("scroll",function(){v.scroll.y=Math.round(v.getScrollTop()*(1/v.scrollratio.y)),v.railh&&(v.scroll.x=Math.round(v.getScrollLeft()*(1/v.scrollratio.x))),v.noticeCursor()})},v.bind(v.docscroll,"scroll",v.onscroll),this.doZoomIn=function(e){if(!v.zoomactive){v.zoomactive=!0,v.zoomrestore={style:{}};var o=["position","top","left","zIndex","backgroundColor","marginTop","marginBottom","marginLeft","marginRight"],t=v.win[0].style;for(var r in o){var i=o[r];v.zoomrestore.style[i]="undefined"!=typeof t[i]?t[i]:""}v.zoomrestore.style.width=v.win.css("width"),v.zoomrestore.style.height=v.win.css("height"),v.zoomrestore.padding={w:v.win.outerWidth()-v.win.width(),h:v.win.outerHeight()-v.win.height()},x.isios4&&(v.zoomrestore.scrollTop=a(window).scrollTop(),a(window).scrollTop(0)),v.win.css({position:x.isios4?"absolute":"fixed",top:0,left:0,"z-index":l+100,margin:"0px"});var n=v.win.css("backgroundColor");return(""==n||/transparent|rgba\(0, 0, 0, 0\)|rgba\(0,0,0,0\)/.test(n))&&v.win.css("backgroundColor","#fff"),v.rail.css({"z-index":l+101}),v.zoom.css({"z-index":l+102}),v.zoom.css("backgroundPosition","0px -18px"),v.resizeZoom(),v.onzoomin&&v.onzoomin.call(v),v.cancelEvent(e)}},this.doZoomOut=function(e){return v.zoomactive?(v.zoomactive=!1,v.win.css("margin",""),v.win.css(v.zoomrestore.style),x.isios4&&a(window).scrollTop(v.zoomrestore.scrollTop),v.rail.css({"z-index":v.zindex}),v.zoom.css({"z-index":v.zindex}),v.zoomrestore=!1,v.zoom.css("backgroundPosition","0px 0px"),v.onResize(),v.onzoomout&&v.onzoomout.call(v),v.cancelEvent(e)):void 0},this.doZoom=function(e){return v.zoomactive?v.doZoomOut(e):v.doZoomIn(e)},this.resizeZoom=function(){if(v.zoomactive){var e=v.getScrollTop();v.win.css({width:a(window).width()-v.zoomrestore.padding.w+"px",height:a(window).height()-v.zoomrestore.padding.h+"px"}),v.onResize(),v.setScrollTop(Math.min(v.page.maxh,e))}},this.init(),a.nicescroll.push(this)},b=function(e){var o=this;this.nc=e,this.lastx=0,this.lasty=0,this.speedx=0,this.speedy=0,this.lasttime=0,this.steptime=0,this.snapx=!1,this.snapy=!1,this.demulx=0,this.demuly=0,this.lastscrollx=-1,this.lastscrolly=-1,this.chkx=0,this.chky=0,this.timer=0,this.time=function(){return+new Date},this.reset=function(e,t){o.stop();var r=o.time();o.steptime=0,o.lasttime=r,o.speedx=0,o.speedy=0,o.lastx=e,o.lasty=t,o.lastscrollx=-1,o.lastscrolly=-1},this.update=function(e,t){var r=o.time();o.steptime=r-o.lasttime,o.lasttime=r;var i=t-o.lasty,n=e-o.lastx,s=o.nc.getScrollTop(),l=o.nc.getScrollLeft(),a=s+i,c=l+n;o.snapx=0>c||c>o.nc.page.maxw,o.snapy=0>a||a>o.nc.page.maxh,o.speedx=n,o.speedy=i,o.lastx=e,o.lasty=t},this.stop=function(){o.nc.unsynched("domomentum2d"),o.timer&&clearTimeout(o.timer),o.timer=0,o.lastscrollx=-1,o.lastscrolly=-1},this.doSnapy=function(e,t){var r=!1;0>t?(t=0,r=!0):t>o.nc.page.maxh&&(t=o.nc.page.maxh,r=!0),0>e?(e=0,r=!0):e>o.nc.page.maxw&&(e=o.nc.page.maxw,r=!0),r?o.nc.doScrollPos(e,t,o.nc.opt.snapbackspeed):o.nc.triggerScrollEnd()},this.doMomentum=function(e){var t=o.time(),r=e?t+e:o.lasttime,i=o.nc.getScrollLeft(),n=o.nc.getScrollTop(),s=o.nc.page.maxh,l=o.nc.page.maxw;o.speedx=l>0?Math.min(60,o.speedx):0,o.speedy=s>0?Math.min(60,o.speedy):0;var a=r&&60>=t-r;(0>n||n>s||0>i||i>l)&&(a=!1);var c=o.speedy&&a?o.speedy:!1,d=o.speedx&&a?o.speedx:!1;if(c||d){var u=Math.max(16,o.steptime);if(u>50){var h=u/50;o.speedx*=h,o.speedy*=h,u=50}o.demulxy=0,o.lastscrollx=o.nc.getScrollLeft(),o.chkx=o.lastscrollx,o.lastscrolly=o.nc.getScrollTop(),o.chky=o.lastscrolly;var p=o.lastscrollx,m=o.lastscrolly,f=function(){var e=o.time()-t>600?.04:.02;o.speedx&&(p=Math.floor(o.lastscrollx-o.speedx*(1-o.demulxy)),o.lastscrollx=p,(0>p||p>l)&&(e=.1)),o.speedy&&(m=Math.floor(o.lastscrolly-o.speedy*(1-o.demulxy)),o.lastscrolly=m,(0>m||m>s)&&(e=.1)),o.demulxy=Math.min(1,o.demulxy+e),o.nc.synched("domomentum2d",function(){if(o.speedx){var e=o.nc.getScrollLeft();e!=o.chkx&&o.stop(),o.chkx=p,o.nc.setScrollLeft(p)}if(o.speedy){var t=o.nc.getScrollTop();t!=o.chky&&o.stop(),o.chky=m,o.nc.setScrollTop(m)}o.timer||(o.nc.hideCursor(),o.doSnapy(p,m))}),o.demulxy<1?o.timer=setTimeout(f,u):(o.stop(),o.nc.hideCursor(),o.doSnapy(p,m))};f()}else o.doSnapy(o.nc.getScrollLeft(),o.nc.getScrollTop())}},y=e.fn.scrollTop;e.cssHooks.pageYOffset={get:function(e,o,t){var r=a.data(e,"__nicescroll")||!1;return r&&r.ishwscroll?r.getScrollTop():y.call(e)},set:function(e,o){var t=a.data(e,"__nicescroll")||!1;return t&&t.ishwscroll?t.setScrollTop(parseInt(o)):y.call(e,o),this}},e.fn.scrollTop=function(e){if("undefined"==typeof e){var o=this[0]?a.data(this[0],"__nicescroll")||!1:!1;return o&&o.ishwscroll?o.getScrollTop():y.call(this)}return this.each(function(){var o=a.data(this,"__nicescroll")||!1;o&&o.ishwscroll?o.setScrollTop(parseInt(e)):y.call(a(this),e)})};var x=e.fn.scrollLeft;a.cssHooks.pageXOffset={get:function(e,o,t){var r=a.data(e,"__nicescroll")||!1;return r&&r.ishwscroll?r.getScrollLeft():x.call(e)},set:function(e,o){var t=a.data(e,"__nicescroll")||!1;return t&&t.ishwscroll?t.setScrollLeft(parseInt(o)):x.call(e,o),this}},e.fn.scrollLeft=function(e){if("undefined"==typeof e){var o=this[0]?a.data(this[0],"__nicescroll")||!1:!1;return o&&o.ishwscroll?o.getScrollLeft():x.call(this)}return this.each(function(){var o=a.data(this,"__nicescroll")||!1;o&&o.ishwscroll?o.setScrollLeft(parseInt(e)):x.call(a(this),e)})};var S=function(e){var o=this;if(this.length=0,this.name="nicescrollarray",this.each=function(e){for(var t=0,r=0;tPrevious',nextArrow:'',autoplay:!1,autoplaySpeed:3e3,centerMode:!1,centerPadding:"50px",cssEase:"ease",customPaging:function(e,t){return i('").addClass(this._triggerClass).html(s?b("").attr({src:s,alt:i,title:i}):i)),e[n?"before":"after"](t.trigger),t.trigger.click(function(){return b.datepicker._datepickerShowing&&b.datepicker._lastInput===e[0]?b.datepicker._hideDatepicker():(b.datepicker._datepickerShowing&&b.datepicker._lastInput!==e[0]&&b.datepicker._hideDatepicker(),b.datepicker._showDatepicker(e[0])),!1}))},_autoSize:function(e){if(this._get(e,"autoSize")&&!e.inline){var t,a,i,s,r=new Date(2009,11,20),n=this._get(e,"dateFormat");n.match(/[DM]/)&&(t=function(e){for(s=i=a=0;sa&&(a=e[s].length,i=s);return i},r.setMonth(t(this._get(e,n.match(/MM/)?"monthNames":"monthNamesShort"))),r.setDate(t(this._get(e,n.match(/DD/)?"dayNames":"dayNamesShort"))+20-r.getDay())),e.input.attr("size",this._formatDate(e,r).length)}},_inlineDatepicker:function(e,t){var a=b(e);a.hasClass(this.markerClassName)||(a.addClass(this.markerClassName).append(t.dpDiv),b.data(e,"datepicker",t),this._setDate(t,this._getDefaultDate(t),!0),this._updateDatepicker(t),this._updateAlternate(t),t.settings.disabled&&this._disableDatepicker(e),t.dpDiv.css("display","block"))},_dialogDatepicker:function(e,t,a,i,s){var r,n,d,c,o,l=this._dialogInst;return l||(this.uuid+=1,r="dp"+this.uuid,this._dialogInput=b(""),this._dialogInput.keydown(this._doKeyDown),b("body").append(this._dialogInput),(l=this._dialogInst=this._newInst(this._dialogInput,!1)).settings={},b.data(this._dialogInput[0],"datepicker",l)),h(l.settings,i||{}),t=t&&t.constructor===Date?this._formatDate(l,t):t,this._dialogInput.val(t),this._pos=s?s.length?s:[s.pageX,s.pageY]:null,this._pos||(n=document.documentElement.clientWidth,d=document.documentElement.clientHeight,c=document.documentElement.scrollLeft||document.body.scrollLeft,o=document.documentElement.scrollTop||document.body.scrollTop,this._pos=[n/2-100+c,d/2-150+o]),this._dialogInput.css("left",this._pos[0]+20+"px").css("top",this._pos[1]+"px"),l.settings.onSelect=a,this._inDialog=!0,this.dpDiv.addClass(this._dialogClass),this._showDatepicker(this._dialogInput[0]),b.blockUI&&b.blockUI(this.dpDiv),b.data(this._dialogInput[0],"datepicker",l),this},_destroyDatepicker:function(e){var t,a=b(e),i=b.data(e,"datepicker");a.hasClass(this.markerClassName)&&(t=e.nodeName.toLowerCase(),b.removeData(e,"datepicker"),"input"===t?(i.append.remove(),i.trigger.remove(),a.removeClass(this.markerClassName).unbind("focus",this._showDatepicker).unbind("keydown",this._doKeyDown).unbind("keypress",this._doKeyPress).unbind("keyup",this._doKeyUp)):"div"!==t&&"span"!==t||a.removeClass(this.markerClassName).empty(),r===i&&(r=null))},_enableDatepicker:function(t){var e,a,i=b(t),s=b.data(t,"datepicker");i.hasClass(this.markerClassName)&&("input"===(e=t.nodeName.toLowerCase())?(t.disabled=!1,s.trigger.filter("button").each(function(){this.disabled=!1}).end().filter("img").css({opacity:"1.0",cursor:""})):"div"!==e&&"span"!==e||((a=i.children("."+this._inlineClass)).children().removeClass("ui-state-disabled"),a.find("select.ui-datepicker-month, select.ui-datepicker-year").prop("disabled",!1)),this._disabledInputs=b.map(this._disabledInputs,function(e){return e===t?null:e}))},_disableDatepicker:function(t){var e,a,i=b(t),s=b.data(t,"datepicker");i.hasClass(this.markerClassName)&&("input"===(e=t.nodeName.toLowerCase())?(t.disabled=!0,s.trigger.filter("button").each(function(){this.disabled=!0}).end().filter("img").css({opacity:"0.5",cursor:"default"})):"div"!==e&&"span"!==e||((a=i.children("."+this._inlineClass)).children().addClass("ui-state-disabled"),a.find("select.ui-datepicker-month, select.ui-datepicker-year").prop("disabled",!0)),this._disabledInputs=b.map(this._disabledInputs,function(e){return e===t?null:e}),this._disabledInputs[this._disabledInputs.length]=t)},_isDisabledDatepicker:function(e){if(!e)return!1;for(var t=0;td&&ic&&st;)--G<0&&(G=11,ee--);for(e.drawMonth=G,e.drawYear=ee,a=this._get(e,"prevText"),a=B?this.formatDate(a,this._daylightSavingAdjust(new Date(ee,G-q,1)),this._getFormatConfig(e)):a,i=this._canAdjustMonth(e,-1,ee,G)?""+a+"":z?"":""+a+"",s=this._get(e,"nextText"),s=B?this.formatDate(s,this._daylightSavingAdjust(new Date(ee,G+q,1)),this._getFormatConfig(e)):s,r=this._canAdjustMonth(e,1,ee,G)?""+s+"":z?"":""+s+"",n=this._get(e,"currentText"),d=this._get(e,"gotoCurrent")&&e.currentDay?X:H,n=B?this.formatDate(n,d,this._getFormatConfig(e)):n,c=e.inline?"":"",o=U?"
"+(P?c:"")+(this._isInRange(e,d)?"":"")+(P?"":c)+"
":"",l=parseInt(this._get(e,"firstDay"),10),l=isNaN(l)?0:l,h=this._get(e,"showWeek"),u=this._get(e,"dayNames"),p=this._get(e,"dayNamesMin"),g=this._get(e,"monthNames"),_=this._get(e,"monthNamesShort"),f=this._get(e,"beforeShowDay"),k=this._get(e,"showOtherMonths"),D=this._get(e,"selectOtherMonths"),m=this._getDefaultDate(e),y="",M=0;M"+(/all|left/.test(I)&&0===M?P?r:i:"")+(/all|right/.test(I)&&0===M?P?i:r:"")+this._generateMonthYearHeader(e,G,ee,Z,$,0",Y=h?"":"",v=0;v<7;v++)Y+="";for(x+=Y+"",N=this._getDaysInMonth(ee,G),ee===e.selectedYear&&G===e.selectedMonth&&(e.selectedDay=Math.min(e.selectedDay,N)),F=(this._getFirstDayOfMonth(ee,G)-l+7)%7,T=Math.ceil((F+N)/7),A=Q&&this.maxRows>T?this.maxRows:T,this.maxRows=A,K=this._daylightSavingAdjust(new Date(ee,G,1-F)),j=0;j",O=h?"":"",v=0;v<7;v++)R=f?f.apply(e.input?e.input[0]:null,[K]):[!0,""],W=(L=K.getMonth()!==G)&&!D||!R[0]||Z&&K"+(L&&!k?" ":W?""+K.getDate()+"":""+K.getDate()+"")+"",K.setDate(K.getDate()+1),K=this._daylightSavingAdjust(K);x+=O+""}11<++G&&(G=0,ee++),b+=x+="
"+this._get(e,"weekHeader")+""+p[S]+"
"+this._get(e,"calculateWeek")(K)+"
"+(Q?"
"+(0":""):"")}y+=b}return y+=o,e._keyEvent=!1,y},_generateMonthYearHeader:function(e,t,a,i,s,r,n,d){var c,o,l,h,u,p,g,_,f=this._get(e,"changeMonth"),k=this._get(e,"changeYear"),D=this._get(e,"showMonthAfterYear"),m="
",y="";if(r||!f)y+=""+n[t]+"";else{for(c=i&&i.getFullYear()===a,o=s&&s.getFullYear()===a,y+=""}if(D||(m+=y+(!r&&f&&k?"":" ")),!e.yearshtml)if(e.yearshtml="",r||!k)m+=""+a+"";else{for(h=this._get(e,"yearRange").split(":"),u=(new Date).getFullYear(),g=(p=function(e){var t=e.match(/c[+\-].*/)?a+parseInt(e.substring(1),10):e.match(/[+\-].*/)?u+parseInt(e,10):parseInt(e,10);return isNaN(t)?u:t})(h[0]),_=Math.max(g,p(h[1]||"")),g=i?Math.max(g,i.getFullYear()):g,_=s?Math.min(_,s.getFullYear()):_,e.yearshtml+="",m+=e.yearshtml,e.yearshtml=null}return m+=this._get(e,"yearSuffix"),D&&(m+=(!r&&f&&k?"":" ")+y),m+="
"},_adjustInstDate:function(e,t,a){var i=e.drawYear+("Y"===a?t:0),s=e.drawMonth+("M"===a?t:0),r=Math.min(e.selectedDay,this._getDaysInMonth(i,s))+("D"===a?t:0),n=this._restrictMinMax(e,this._daylightSavingAdjust(new Date(i,s,r)));e.selectedDay=n.getDate(),e.drawMonth=e.selectedMonth=n.getMonth(),e.drawYear=e.selectedYear=n.getFullYear(),"M"!==a&&"Y"!==a||this._notifyChange(e)},_restrictMinMax:function(e,t){var a=this._getMinMaxDate(e,"min"),i=this._getMinMaxDate(e,"max"),s=a&&t=s.getTime())&&(!r||t.getTime()<=r.getTime())&&(!n||t.getFullYear()>=n)&&(!d||t.getFullYear()<=d)},_getFormatConfig:function(e){var t=this._get(e,"shortYearCutoff");return{shortYearCutoff:t="string"!=typeof t?t:(new Date).getFullYear()%100+parseInt(t,10),dayNamesShort:this._get(e,"dayNamesShort"),dayNames:this._get(e,"dayNames"),monthNamesShort:this._get(e,"monthNamesShort"),monthNames:this._get(e,"monthNames")}},_formatDate:function(e,t,a,i){t||(e.currentDay=e.selectedDay,e.currentMonth=e.selectedMonth,e.currentYear=e.selectedYear);var s=t?"object"==typeof t?t:this._daylightSavingAdjust(new Date(i,a,t)):this._daylightSavingAdjust(new Date(e.currentYear,e.currentMonth,e.currentDay));return this.formatDate(this._get(e,"dateFormat"),s,this._getFormatConfig(e))}}),b.fn.datepicker=function(e){if(!this.length)return this;b.datepicker.initialized||(b(document).mousedown(b.datepicker._checkExternalClick),b.datepicker.initialized=!0),0===b("#"+b.datepicker._mainDivId).length&&b("body").append(b.datepicker.dpDiv);var t=Array.prototype.slice.call(arguments,1);return"string"!=typeof e||"isDisabled"!==e&&"getDate"!==e&&"widget"!==e?"option"===e&&2===arguments.length&&"string"==typeof arguments[1]?b.datepicker["_"+e+"Datepicker"].apply(b.datepicker,[this[0]].concat(t)):this.each(function(){"string"==typeof e?b.datepicker["_"+e+"Datepicker"].apply(b.datepicker,[this].concat(t)):b.datepicker._attachDatepicker(this,e)}):b.datepicker["_"+e+"Datepicker"].apply(b.datepicker,[this[0]].concat(t))},b.datepicker=new e,b.datepicker.initialized=!1,b.datepicker.uuid=(new Date).getTime(),b.datepicker.version="1.11.4",b.datepicker}); !function(t){"function"==typeof define&&define.amd?define(["jquery"],t):t(jQuery)}(function(s){var u,l,c,d,t,p,h,g,i,e,b,a,o,f,m,y,n,r,v,x,C="ui-effects-",w=s;function _(t,e,n){var r=g[e.type]||{};return null==t?n||!e.def?null:e.def:(t=r.floor?~~t:parseFloat(t),isNaN(t)?e.def:r.mod?(t+r.mod)%r.mod:t<0?0:r.max")[0],b=u.each,e.style.cssText="background-color:rgba(1,1,1,.5)",i.rgba=-1a.mod/2?r+=a.mod:r-o>a.mod/2&&(r-=a.mod)),c[n]=_((o-r)*i+r,e)))}),this[e](c)},blend:function(t){if(1===this._rgba[3])return this;var e=this._rgba.slice(),n=e.pop(),r=p(t)._rgba;return p(u.map(e,function(t,e){return(1-n)*r[e]+n*t}))},toRgbaString:function(){var t="rgba(",e=u.map(this._rgba,function(t,e){return null==t?2").addClass("ui-effects-wrapper").css({fontSize:"100%",background:"transparent",border:"none",margin:0,padding:0}),e={width:n.width(),height:n.height()},o=document.activeElement;try{o.id}catch(t){o=document.body}return n.wrap(t),n[0]!==o&&!s.contains(n[0],o)||s(o).focus(),t=n.parent(),"static"===n.css("position")?(t.css({position:"relative"}),n.css({position:"relative"})):(s.extend(r,{position:n.css("position"),zIndex:n.css("z-index")}),s.each(["top","left","bottom","right"],function(t,e){r[e]=n.css(e),isNaN(parseInt(r[e],10))&&(r[e]="auto")}),n.css({position:"relative",top:0,left:0,right:"auto",bottom:"auto"})),n.css(e),t.css(r).show()},removeWrapper:function(t){var e=document.activeElement;return t.parent().is(".ui-effects-wrapper")&&(t.parent().replaceWith(t),t[0]!==e&&!s.contains(t[0],e)||s(e).focus()),t},setTransition:function(r,t,o,a){return a=a||{},s.each(t,function(t,e){var n=r.cssUnit(e);0=2) return false; fp.find('.qcf-state').hide(); fp.find('.qcf-ajax-loading').show(); $.post(ajaxurl, fd + "&action=qcf_validate_form", function(e){ if(e.success!==undefined){ data=e; var d=[]; for (var x=0; x < data.errors.length; x++){ if(data.errors[x].name!="attach"){ d.push(data.errors[x]); }} data.errors=d; var has_file_error=false; if(typeof qfc_file_info!=='undefined'){ has_file_error=false; var file_error={'name':'attach','error':qfc_file_info.error}, files=f.find('[type=file]'); if(qfc_file_info.required){ if(!files[0].files.length){ has_file_error=true; file_error.error=qfc_file_info.error_required; }} if(!has_file_error){ x=0; var lf, y=0, match; for (x; x < files.length; x++){ if(files[x].files.length){ lf=files[x].files[0]; if(lf.size > qfc_file_info.max_size){ has_file_error=true; file_error.error=qfc_file_info.error_size; } if(qfc_file_info.types.length > 0){ match=false, REGEX=new RegExp; for (y=0; y < qfc_file_info.types.length; y++){ REGEX=new RegExp(qfc_file_info.types[y],"i"); if(lf.name.match(REGEX)) match=true; } if(!match){ has_file_error=true; file_error.error=qfc_file_info.error_type; }} }} }} if(has_file_error){ data.errors.push(file_error) } if(data.errors.length){ f.find('.qcf-input-error').remove(); f.find('.error').removeClass('error'); fp.find('.qcf-header').addClass('error').html(data.display); fp.find('.qcf-blurb').addClass('error').html(data.blurb); for (i=0; i < data.errors.length; i++){ error=data.errors[i]; if(error.name=='attach'){ element=f.find('[name='+error.name+']').prepend("

"+error.error+"

");; }else{ element=f.find('[name='+error.name+']'); element.addClass('error'); if(error.name=='qcfname12'){ element.parent().prepend(error.error); }else{ element.before(error.error); }} } fp.find('.qcf-state').hide(); fp.find('.qcf-form-wrapper').fadeIn('fast'); }else{ fp.find('.qcf-state').hide(); fp.find('.qcf-sending').fadeIn('fast'); f.unbind('submit'); f.find('input[type=submit]').click(); }}else{ fp.find('.qcf-state').hide(); fp.find('.qcf-ajax-error').fadeIn('fast'); } return false; }, "JSON"); }); return false; }); }); jQuery(document).ready(function($){ (function(factory){ 'use strict'; if(typeof define==='function'&&define.amd){ define(['jquery'], factory); } else if(typeof exports==='object'){ factory(require('jquery')); }else{ factory(jQuery); }}(function($){ 'use strict'; function supportsRange(){ var input=document.createElement('input'); input.setAttribute('type', 'range'); return input.type!=='text'; } var pluginName='rangeslider', pluginInstances=[], inputrange=supportsRange(), defaults={ polyfill: true, rangeClass: 'rangeslider', disabledClass: 'rangeslider--disabled', fillClass: 'rangeslider__fill', handleClass: 'rangeslider__handle', startEvent: ['mousedown', 'touchstart', 'pointerdown'], moveEvent: ['mousemove', 'touchmove', 'pointermove'], endEvent: ['mouseup', 'touchend', 'pointerup'] }; function delay(fn, wait){ var args=Array.prototype.slice.call(arguments, 2); return setTimeout(function(){ return fn.apply(null, args); }, wait); } function debounce(fn, debounceDuration){ debounceDuration=debounceDuration||100; return function(){ if(!fn.debouncing){ var args=Array.prototype.slice.apply(arguments); fn.lastReturnVal=fn.apply(window, args); fn.debouncing=true; } clearTimeout(fn.debounceTimeout); fn.debounceTimeout=setTimeout(function(){ fn.debouncing=false; }, debounceDuration); return fn.lastReturnVal; };} function Plugin(element, options){ this.$window=$(window); this.$document=$(document); this.$element=$(element); this.options=$.extend({}, defaults, options); this._defaults=defaults; this._name=pluginName; this.startEvent=this.options.startEvent.join('.' + pluginName + ' ') + '.' + pluginName; this.moveEvent=this.options.moveEvent.join('.' + pluginName + ' ') + '.' + pluginName; this.endEvent=this.options.endEvent.join('.' + pluginName + ' ') + '.' + pluginName; this.polyfill=this.options.polyfill; this.onInit=this.options.onInit; this.onSlide=this.options.onSlide; this.onSlideEnd=this.options.onSlideEnd; if(this.polyfill){ if(inputrange){ return false; }} this.identifier='js-' + pluginName + '-' +(+new Date()); this.min=parseFloat(this.$element[0].getAttribute('min')||0); this.max=parseFloat(this.$element[0].getAttribute('max')||100); this.value=parseFloat(this.$element[0].value||this.min + (this.max-this.min)/2); this.step=parseFloat(this.$element[0].getAttribute('step')||1); this.$fill=$('
'); this.$handle=$('
'); this.$range=$('
').insertAfter(this.$element).prepend(this.$fill, this.$handle); this.$element.css({ 'position': 'absolute', 'width': '1px', 'height': '1px', 'overflow': 'hidden', 'opacity': '0' }); this.handleDown=$.proxy(this.handleDown, this); this.handleMove=$.proxy(this.handleMove, this); this.handleEnd=$.proxy(this.handleEnd, this); this.init(); var _this=this; this.$window.on('resize' + '.' + pluginName, debounce(function(){ delay(function(){ _this.update(); }, 300); }, 20)); this.$document.on(this.startEvent, '#' + this.identifier + ':not(.' + this.options.disabledClass + ')', this.handleDown); this.$element.on('change' + '.' + pluginName, function(e, data){ if(data&&data.origin===pluginName){ return; } var value=e.target.value, pos=_this.getPositionFromValue(value); _this.setPosition(pos); }); } Plugin.prototype.init=function(){ if(this.onInit&&typeof this.onInit==='function'){ this.onInit(); } this.update(); }; Plugin.prototype.update=function(){ this.handleWidth=this.$handle[0].offsetWidth; this.rangeWidth=this.$range[0].offsetWidth; this.maxHandleX=this.rangeWidth - this.handleWidth; this.grabX=this.handleWidth / 2; this.position=this.getPositionFromValue(this.value); if(this.$element[0].disabled){ this.$range.addClass(this.options.disabledClass); }else{ this.$range.removeClass(this.options.disabledClass); } this.setPosition(this.position); }; Plugin.prototype.handleDown=function(e){ e.preventDefault(); this.$document.on(this.moveEvent, this.handleMove); this.$document.on(this.endEvent, this.handleEnd); if((' ' + e.target.className + ' ').replace(/[\n\t]/g, ' ').indexOf(this.options.handleClass) > -1){ return; } var posX=this.getRelativePosition(this.$range[0], e), handleX=this.getPositionFromNode(this.$handle[0]) - this.getPositionFromNode(this.$range[0]); this.setPosition(posX - this.grabX); if(posX >=handleX&&posX < handleX + this.handleWidth){ this.grabX=posX - handleX; }}; Plugin.prototype.handleMove=function(e){ e.preventDefault(); var posX=this.getRelativePosition(this.$range[0], e); this.setPosition(posX - this.grabX); }; Plugin.prototype.handleEnd=function(e){ e.preventDefault(); this.$document.off(this.moveEvent, this.handleMove); this.$document.off(this.endEvent, this.handleEnd); if(this.onSlideEnd&&typeof this.onSlideEnd==='function'){ this.onSlideEnd(this.position, this.value); }}; Plugin.prototype.cap=function(pos, min, max){ if(pos < min){ return min; } if(pos > max){ return max; } return pos; }; Plugin.prototype.setPosition=function(pos){ var value, left; value=(this.getValueFromPosition(this.cap(pos, 0, this.maxHandleX)) / this.step) * this.step; left=this.getPositionFromValue(value); this.$fill[0].style.width=(left + this.grabX) + 'px'; this.$handle[0].style.left=left + 'px'; this.setValue(value); this.position=left; this.value=value; if(this.onSlide&&typeof this.onSlide==='function'){ this.onSlide(left, value); }}; Plugin.prototype.getPositionFromNode=function(node){ var i=0; while (node!==null){ i +=node.offsetLeft; node=node.offsetParent; } return i; }; Plugin.prototype.getRelativePosition=function(node, e){ return (e.pageX||e.originalEvent.clientX||e.originalEvent.touches[0].clientX||e.currentPoint.x) - this.getPositionFromNode(node); }; Plugin.prototype.getPositionFromValue=function(value){ var percentage, pos; percentage=(value - this.min)/(this.max - this.min); pos=percentage * this.maxHandleX; return pos; }; Plugin.prototype.getValueFromPosition=function(pos){ var percentage, value; percentage=((pos) / (this.maxHandleX||1)); value=this.step * Math.ceil((((percentage) * (this.max - this.min)) + this.min) / this.step); return Number((value).toFixed(2)); }; Plugin.prototype.setValue=function(value){ if(value!==this.value){ this.$element.val(value).trigger('change', {origin: pluginName}); }}; Plugin.prototype.destroy=function(){ this.$document.off(this.startEvent, '#' + this.identifier, this.handleDown); this.$element .off('.' + pluginName) .removeAttr('style') .removeData('plugin_' + pluginName); if(this.$range&&this.$range.length){ this.$range[0].parentNode.removeChild(this.$range[0]); } pluginInstances.splice(pluginInstances.indexOf(this.$element[0]),1); if(!pluginInstances.length){ this.$window.off('.' + pluginName); }}; $.fn[pluginName]=function(options){ return this.each(function(){ var $this=$(this), data=$this.data('plugin_' + pluginName); if(!data){ $this.data('plugin_' + pluginName, (data=new Plugin(this, options))); pluginInstances.push(this); } if(typeof options==='string'){ data[options](); }}); };})); }); !function(d,l){"use strict";var e=!1,o=!1;if(l.querySelector)if(d.addEventListener)e=!0;if(d.wp=d.wp||{},!d.wp.receiveEmbedMessage)if(d.wp.receiveEmbedMessage=function(e){var t=e.data;if(t)if(t.secret||t.message||t.value)if(!/[^a-zA-Z0-9]/.test(t.secret)){var r,a,i,s,n,o=l.querySelectorAll('iframe[data-secret="'+t.secret+'"]'),c=l.querySelectorAll('blockquote[data-secret="'+t.secret+'"]');for(r=0;r this.length-1) nextId=0; return this[nextId]; } jQuery.fn.clearForm=function(){ return this.each(function(){ var type=this.type, tag=this.tagName.toLowerCase(); if(tag=='form') return jQuery(':input', this).clearForm(); if(type=='text'||type=='password'||tag=='textarea') this.value=''; else if(type=='checkbox'||type=='radio') this.checked=false; else if(tag=='select') this.selectedIndex=-1; }); } jQuery.fn.tagName=function(){ return this.get(0).tagName; } jQuery.fn.exists=function(){ return (jQuery(this).size() > 0 ? true:false); } function isNumber(val){ return /^\d+/.test(val); } function pushDataToParam(data, pref){ pref=pref ? pref:''; var res=[]; for(var key in data){ var name=pref&&pref!='' ? pref+ '['+ key+ ']':key; if(typeof(data[key])==='array'||typeof(data[key])==='object'){ res=jQuery.merge(res, pushDataToParam(data[key], name)); }else{ res.push(name+ "="+ data[key]); }} return res; } jQuery.fn.serializeAnythingPts=function(addData){ var toReturn=[]; var els=jQuery(this).find(':input').get(); jQuery.each(els, function(){ if(this.name&&!this.disabled&&(this.checked||/select|textarea/i.test(this.nodeName)||/text|hidden|password/i.test(this.type))){ var val=jQuery(this).val(); toReturn.push(encodeURIComponent(this.name) + "=" + encodeURIComponent(val)); }}); if(typeof(addData)!='undefined'){ toReturn=jQuery.merge(toReturn, pushDataToParam(addData)); } return toReturn.join("&").replace(/%20/g, "+"); }; jQuery.fn.serializeAssoc=function(){ var data=[ ]; jQuery.each(this.serializeArray(), function(key, obj){ var a=obj.name.match(/(.*?)\[(.*?)\]/); if(a!==null){ var subName=a[1]; var subKey=a[2]; if(!data[subName]) data[subName]=[ ]; if(data[subName][subKey]){ if(jQuery.isArray(data[subName][subKey])){ data[subName][subKey].push(obj.value); }else{ data[subName][subKey]=[ ]; data[subName][subKey].push(obj.value); };}else{ data[subName][subKey]=obj.value; };}else{ if(data[obj.name]){ if(jQuery.isArray(data[obj.name])){ data[obj.name].push(obj.value); }else{ data[obj.name]=[ ]; data[obj.name].push(obj.value); };}else{ data[obj.name]=obj.value; };}; }); return data; }; jQuery.fn.serializeObject=function(){ var obj={}; jQuery.each(this.serializeArray(), function(i,o){ var n=o.name, v=o.value; obj[n]=obj[n]===undefined ? v : jQuery.isArray(obj[n]) ? obj[n].concat(v) : [ obj[n], v ]; }); return obj; }; str_replace_all=function(str, token, newToken, ignoreCase){ var _token; str +=""; var i=-1; if(typeof token==="string"){ if(ignoreCase){ _token=token.toLowerCase(); while(( i=str.toLowerCase().indexOf(_token, i >=0 ? i + newToken.length:0 ))!==-1 ){ str=str.substring(0, i) + newToken + str.substring(i + token.length); }}else{ return str.split(token).join(newToken); }} return str; }; function str_replace(haystack, needle, replacement){ var temp=haystack.split(needle); return temp.join(replacement); } function str_repeat(input, multiplier){ var buf=''; for (var i=0; i < multiplier; i++){ buf +=input; } return buf; } function str_split(f_string, f_split_length, f_backwards){ if(f_backwards==undefined){ f_backwards=false; } if(f_split_length > 0){ var result=new Array(); if(f_backwards){ var r=(f_string.length % f_split_length); if(r > 0){ result[result.length]=f_string.substring(0, r); f_string=f_string.substring(r); }} while(f_string.length > f_split_length){ result[result.length]=f_string.substring(0, f_split_length); f_string=f_string.substring(f_split_length); } result[result.length]=f_string; return result; } return false; } function hexdec(hex_string){ hex_string=(hex_string + '') .replace(/[^a-f0-9]/gi, ''); return parseInt(hex_string, 16); } function dechex(number){ if(number < 0){ number=0xFFFFFFFF + number + 1; } return parseInt(number, 10) .toString(16); } function str_pad(input, pad_length, pad_string, pad_type){ var half='', pad_to_go; var str_pad_repeater=function(s, len){ var collect='', i; while(collect.length < len) collect +=s; collect=collect.substr(0,len); return collect; }; if(pad_type!='STR_PAD_LEFT'&&pad_type!='STR_PAD_RIGHT'&&pad_type!='STR_PAD_BOTH'){ pad_type='STR_PAD_RIGHT'; } if((pad_to_go=pad_length - input.length) > 0){ if(pad_type=='STR_PAD_LEFT'){ input=str_pad_repeater(pad_string, pad_to_go) + input; } else if(pad_type=='STR_PAD_RIGHT'){ input=input + str_pad_repeater(pad_string, pad_to_go); } else if(pad_type=='STR_PAD_BOTH'){ half=str_pad_repeater(pad_string, Math.ceil(pad_to_go/2)); input=half + input + half; input=input.substr(0, pad_length); }} return input; } function nameToClassId(name){ return str_replace( str_replace(name, ']', ''), '[', '' ); } function strpos(haystack, needle, offset){ var i=haystack.indexOf(needle, offset); return i >=0 ? i:false; } function extend(Child, Parent){ var F=function(){ }; F.prototype=Parent.prototype; Child.prototype=new F(); Child.prototype.constructor=Child; Child.superclass=Parent.prototype; } function toeRedirect(url, newWnd){ if(newWnd){ var win=window.open(url, '_blank'); win.focus(); }else{ document.location.href=url; }} function toeReload(url){ if(url) toeRedirect(url); document.location.reload(); } jQuery.fn.toeRebuildSelect=function(data, useIdAsValue, val){ if(jQuery(this).tagName()=='SELECT'&&typeof(data)=='object'){ if(jQuery(data).size() > 0){ if(typeof(val)=='undefined') val=false; if(jQuery(this).children('option').length){ jQuery(this).children('option').remove(); } if(typeof(useIdAsValue)=='undefined') useIdAsValue=false; var selected=''; for(var id in data){ selected=''; if(val&&((useIdAsValue&&id==val)||(data[id]==val))) selected='selected'; jQuery(this).append(''); }} }} function toeInArray(needle, haystack){ if(typeof(haystack)=='object'){ for(var k in haystack){ if(haystack[ k ]==needle) return k; }}else if(typeof(haystack)=='array'){ return jQuery.inArray(needle, haystack); } return -1; } jQuery.fn.setReadonly=function(){ jQuery(this).addClass('toeReadonly').attr('readonly', 'readonly'); } jQuery.fn.unsetReadonly=function(){ jQuery(this).removeClass('toeReadonly').removeAttr('readonly', 'readonly'); } jQuery.fn.getClassId=function(pref, test){ var classId=jQuery(this).attr('class'); classId=classId.substr(strpos(classId, pref+ '_')); if(strpos(classId, ' ')) classId=classId.substr(0, strpos(classId, ' ')); classId=classId.split('_'); classId=classId[1]; return classId; } function toeTextIncDec(textFieldId, inc){ var value=parseInt(jQuery('#'+ textFieldId).val()); if(isNaN(value)) value=0; if(!(inc < 0&&value < 1)){ value +=inc; } jQuery('#'+ textFieldId).val(value); } function toeStrFirstUp(str){ str +=''; var f=str.charAt(0).toUpperCase(); return f + str.substr(1); } function parseStr (str, array){ var strArr=String(str).replace(/^&/, '').replace(/&$/, '').split('&'), sal=strArr.length, i, j, ct, p, lastObj, obj, lastIter, undef, chr, tmp, key, value, postLeftBracketPos, keys, keysLen, fixStr=function (str){ return decodeURIComponent(str.replace(/\+/g, '%20')); }; if(!array){ array={};} for (i=0; i < sal; i++){ tmp=strArr[i].split('='); key=fixStr(tmp[0]); value=(tmp.length < 2) ? '':fixStr(tmp[1]); while (key.charAt(0)===' '){ key=key.slice(1); } if(key.indexOf('\x00') > -1){ key=key.slice(0, key.indexOf('\x00')); } if(key&&key.charAt(0)!=='['){ keys=[]; postLeftBracketPos=0; for (j=0; j < key.length; j++){ if(key.charAt(j)==='['&&!postLeftBracketPos){ postLeftBracketPos=j + 1; }else if(key.charAt(j)===']'){ if(postLeftBracketPos){ if(!keys.length){ keys.push(key.slice(0, postLeftBracketPos - 1)); } keys.push(key.substr(postLeftBracketPos, j - postLeftBracketPos)); postLeftBracketPos=0; if(key.charAt(j + 1)!=='['){ break; }} }} if(!keys.length){ keys=[key]; } for (j=0; j < keys[0].length; j++){ chr=keys[0].charAt(j); if(chr===' '||chr==='.'||chr==='['){ keys[0]=keys[0].substr(0, j) + '_' + keys[0].substr(j + 1); } if(chr==='['){ break; }} obj=array; for (j=0, keysLen=keys.length; j < keysLen; j++){ key=keys[j].replace(/^['"]/, '').replace(/['"]$/, ''); lastIter=j!==keys.length - 1; lastObj=obj; if((key!==''&&key!==' ')||j===0){ if(obj[key]===undef){ obj[key]={};} obj=obj[key]; }else{ ct=-1; for (p in obj){ if(obj.hasOwnProperty(p)){ if(+p > ct&&p.match(/^\d+$/g)){ ct=+p; }} } key=ct + 1; }} lastObj[key]=value; }} return array; } function toeListablePts(params){ this.params=jQuery.extend({}, params); this.table=jQuery(this.params.table); this.paging=jQuery(this.params.paging); this.perPage=this.params.perPage; this.list=this.params.list; this.count=this.params.count; this.page=this.params.page; this.pagingCallback=this.params.pagingCallback; var self=this; this.draw=function(list, count){ this.table.find('tr').not('.ptsExample, .ptsTblHeader').remove(); var exampleRow=this.table.find('.ptsExample'); for(var i in list){ var newRow=exampleRow.clone(); for(var key in list[i]){ var element=newRow.find('.'+ key); if(element.size()){ var valueTo=element.attr('valueTo'); if(valueTo){ var newValue=list[i][key]; var prevValue=element.attr(valueTo); if(prevValue) newValue=prevValue+ ' '+ newValue; element.attr(valueTo, newValue); } else element.html(list[i][key]); }} newRow.removeClass('ptsExample').show(); this.table.append(newRow); } if(this.paging){ this.paging.html(''); if(count&&count > list.length&&this.perPage){ for(var i=1; i <=Math.ceil(count/this.perPage); i++){ var newPageId=i-1 , newElement=(newPageId==this.page) ? jQuery(''):jQuery(''); if(newPageId!=this.page){ newElement.attr('href', '#'+ newPageId) .click(function(){ if(self.pagingCallback&&typeof(self.pagingCallback)=='function'){ self.pagingCallback(parseInt(jQuery(this).attr('href').replace('#', ''))); return false; }}); } newElement.addClass('toePagingElement').html(i); this.paging.append(newElement); if(i%20==0&&i) this.paging.append('
'); }} }}; if(this.list) this.draw(this.list, this.count); } function setCookiePts(c_name, value, exdays){ var exdate=new Date(); exdate.setDate(exdate.getDate() + exdays); var value_prepared=''; if(typeof(value)=='array'||typeof(value)=='object'){ value_prepared='_JSON:'+ JSON.stringify(value); }else{ value_prepared=value; } var c_value=escape(value_prepared)+ ((exdays==null) ? "":"; expires="+exdate.toUTCString())+ '; path=/'; document.cookie=c_name+ "="+ c_value; } function getCookiePts(name){ var parts=document.cookie.split(name + "="); if(parts.length==2){ var value=unescape(parts.pop().split(";").shift()); if(value.indexOf('_JSON:')===0){ value=JSON.parse(value.split("_JSON:").pop()); } return value; } return null; } function delCookiePts(name){ document.cookie=name+ '=; expires=Thu, 01 Jan 1970 00:00:01 GMT;'; } function callUserFuncArray(cb, parameters){ var func; if(typeof cb==='string'){ func=(typeof this[cb]==='function') ? this[cb]:func=(new Function(null, 'return ' + cb))(); } else if(Object.prototype.toString.call(cb)==='[object Array]'){ func=(typeof cb[0]=='string') ? eval(cb[0] + "['" + cb[1] + "']"):func=cb[0][cb[1]]; } else if(typeof cb==='function'){ func=cb; } if(typeof func!=='function'){ throw new Error(func + ' is not a valid function'); } return (typeof cb[0]==='string') ? func.apply(eval(cb[0]), parameters):(typeof cb[0]!=='object') ? func.apply(null, parameters):func.apply(cb[0], parameters); } jQuery.fn.zoom=function(level, position){ position=position ? position:'center center'; var scaleCss=level==1 ? 'none':'scale('+ level+ ')'; jQuery(this).data('zoom', level); return jQuery(this).css({ '-moz-transform': scaleCss , '-moz-transform-origin': position , '-o-transform': scaleCss , '-o-transform-origin': position , '-webkit-transform': scaleCss , '-webkit-transform-origin': position , 'transform': scaleCss , 'transform-origin': position }); }; jQuery.fn.scrollWidth=function(){ var inner=document.createElement('p'); inner.style.width="100%"; inner.style.height="200px"; var outer=document.createElement('div'); outer.style.position="absolute"; outer.style.top="0px"; outer.style.left="0px"; outer.style.visibility="hidden"; outer.style.width="200px"; outer.style.height="150px"; outer.style.overflow="hidden"; outer.appendChild (inner); document.body.appendChild (outer); var w1=inner.offsetWidth; outer.style.overflow='scroll'; var w2=inner.offsetWidth; if(w1==w2) w2=outer.clientWidth; document.body.removeChild (outer); return (w1 - w2); }; function toeGetImgAttachId(img){ var classesStr=jQuery(img).attr('class') , aid=0; if(classesStr&&classesStr!=''){ var matches=classesStr.match(/wp-image-(\d+)/); if(matches&&matches[1]){ aid=parseInt(matches[1]); }} return aid; } function toeGetHashParams(){ var hashArr=window.location.hash.split('#') , res=[]; for(var i in hashArr){ if(hashArr[i]&&hashArr[i]!=''){ res.push(hashArr[i]); }} return res; } function traverseElement(el, regex, textReplacerFunc, to){ if(!/^(script|style)$/.test(el.tagName)){ var child=el.lastChild; while (child){ if(child.nodeType==1){ traverseElement(child, regex, textReplacerFunc, to); }else if(child.nodeType==3){ textReplacerFunc(child, regex, to); } child=child.previousSibling; }} } function textReplacerFunc(textNode, regex, to){ textNode.data=textNode.data.replace(regex, to); } function replaceWords(html, words){ var container=document.createElement("div"); container.innerHTML=html; for(var replace in words){ traverseElement(container, new RegExp(replace, "g"), textReplacerFunc, words[ replace ]); } return container.innerHTML; } function toeSelectText(element){ var doc=document , text=jQuery(element).get(0) , range, selection; if(doc.body.createTextRange){ range=doc.body.createTextRange(); range.moveToElementText(text); range.select(); }else if(window.getSelection){ selection=window.getSelection(); range=doc.createRange(); range.selectNodeContents(text); selection.removeAllRanges(); selection.addRange(range); }} jQuery.fn.animationDuration=function(seconds, isMili){ if(isMili){ seconds=parseFloat(seconds) / 1000; } var secondsStr=seconds+ 's'; return jQuery(this).css({ 'webkit-animation-duration': secondsStr , '-moz-animation-duration': secondsStr , '-o-animation-duration': secondsStr , 'animation-duration': secondsStr }); }; function ptsStrToMs(strDate){ var dateHours=strDate.split(' '); if(dateHours.length==2){ strDate=dateHours[0]+ ' '; var hms=dateHours[1].split(':'); for(var i=0; i < 3; i++){ strDate +=hms[ i ] ? hms[ i ]:'00'; if(i < 2) strDate +=':'; }} var date=new Date(str_replace(strDate, '-', '/')) , res=0; if(date){ res=date.getTime(); } return res; } function mtRand (min, max){ return Math.floor(Math.random() * (max - min + 1)) + min; } Date.prototype.format=function(e){var t="";var n=Date.replaceChars;for(var r=0;r=0&&e.charAt(r-1)=="\\"){t+=i}else if(n[i]){t+=n[i].call(this)}else if(i!="\\"){t+=i}}return t};Date.replaceChars={shortMonths:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Pts","Nov","Dec"],longMonths:["January","February","March","April","May","June","July","August","September","Ptsober","November","December"],shortDays:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],longDays:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],d:function(){return(this.getDate()<10?"0":"")+this.getDate()},D:function(){return Date.replaceChars.shortDays[this.getDay()]},j:function(){return this.getDate()},l:function(){return Date.replaceChars.longDays[this.getDay()]},N:function(){return this.getDay()+1},S:function(){return this.getDate()%10==1&&this.getDate()!=11?"st":this.getDate()%10==2&&this.getDate()!=12?"nd":this.getDate()%10==3&&this.getDate()!=13?"rd":"th"},w:function(){return this.getDay()},z:function(){var e=new Date(this.getFullYear(),0,1);return Math.ceil((this-e)/864e5)},W:function(){var e=new Date(this.getFullYear(),0,1);return Math.ceil(((this-e)/864e5+e.getDay()+1)/7)},F:function(){return Date.replaceChars.longMonths[this.getMonth()]},m:function(){return(this.getMonth()<9?"0":"")+(this.getMonth()+1)},M:function(){return Date.replaceChars.shortMonths[this.getMonth()]},n:function(){return this.getMonth()+1},t:function(){var e=new Date;return(new Date(e.getFullYear(),e.getMonth(),0)).getDate()},L:function(){var e=this.getFullYear();return e%400==0||e%100!=0&&e%4==0},o:function(){var e=new Date(this.valueOf());e.setDate(e.getDate()-(this.getDay()+6)%7+3);return e.getFullYear()},Y:function(){return this.getFullYear()},y:function(){return(""+this.getFullYear()).substr(2)},a:function(){return this.getHours()<12?"am":"pm"},A:function(){return this.getHours()<12?"AM":"PM"},B:function(){return Math.floor(((this.getUTCHours()+1)%24+this.getUTCMinutes()/60+this.getUTCSeconds()/3600)*1e3/24)},g:function(){return this.getHours()%12||12},G:function(){return this.getHours()},h:function(){return((this.getHours()%12||12)<10?"0":"")+(this.getHours()%12||12)},H:function(){return(this.getHours()<10?"0":"")+this.getHours()},i:function(){return(this.getMinutes()<10?"0":"")+this.getMinutes()},s:function(){return(this.getSeconds()<10?"0":"")+this.getSeconds()},u:function(){var e=this.getMilliseconds();return(e<10?"00":e<100?"0":"")+e},e:function(){return"Not Yet Supported"},I:function(){var e=null;for(var t=0;t<12;++t){var n=new Date(this.getFullYear(),t,1);var r=n.getTimezoneOffset();if(e===null)e=r;else if(re)break}return this.getTimezoneOffset()==e|0},O:function(){return(-this.getTimezoneOffset()<0?"-":"+")+(Math.abs(this.getTimezoneOffset()/60)<10?"0":"")+Math.abs(this.getTimezoneOffset()/60)+"00"},P:function(){return(-this.getTimezoneOffset()<0?"-":"+")+(Math.abs(this.getTimezoneOffset()/60)<10?"0":"")+Math.abs(this.getTimezoneOffset()/60)+":00"},T:function(){var e=this.getMonth();this.setMonth(0);var t=this.toTimeString().replace(/^.+ \(?([^\)]+)\)?$/,"$1");this.setMonth(e);return t},Z:function(){return-this.getTimezoneOffset()*60},c:function(){return this.format("Y-m-d\\TH:i:sP")},r:function(){return this.toString()},U:function(){return this.getTime()/1e3}} function ptsInitCustomCheckRadio(selector){ if(!selector) selector=document; jQuery(selector).find('input:not(".ptsCpInpFlag")').iCheck('destroy').iCheck({ checkboxClass: 'icheckbox_minimal' , radioClass: 'iradio_minimal' }).on('ifChanged', function(e){ jQuery(this).trigger('change'); if(jQuery(this).hasClass('cbox')){ var parentRow=jQuery(this).parents('.jqgrow:first'); if(parentRow&&parentRow.size()){ jQuery(this).parents('td:first').trigger('click'); }else{ var checkId=jQuery(this).attr('id'); if(checkId&&checkId!=''&&strpos(checkId, 'cb_')===0){ var parentTblId=str_replace(checkId, 'cb_', ''); if(parentTblId&&parentTblId!=''&&jQuery('#'+ parentTblId).size()){ jQuery('#'+ parentTblId).find('input[type=checkbox]').iCheck('update'); }} }} }).on('ifClicked', function(e){ jQuery(this).trigger('click'); }); } function ptsCheckUpdate(checkbox){ jQuery(checkbox).iCheck('update'); } function ptsCheckUpdateArea(selector){ jQuery(selector).find('input[type=checkbox]').iCheck('update'); jQuery(selector).find('input[type=radio]').iCheck('update'); } function ptsCallWpMedia(params){ params=params||{}; if(typeof wp!=='undefined'&&wp.media&&wp.media.editor) wp.media.editor.open(params.id); wp.media.editor.insert=function(html){ if(wp.media.editor._attachSent){ wp.media.editor._attachSent=false; return; } if(html&&html!=''){ var imgUrl=jQuery(html).attr('src'); if(imgUrl){ params.clb({}, {}, imgUrl); }} }; wp.media.editor.send.attachment=function(opts, attach){ wp.media.editor._attachSent=true; var imgUrl=opts.size&&attach.sizes[ opts.size ]&&attach.sizes[ opts.size ].url ? attach.sizes[ opts.size ].url : attach.url; params.clb(opts, attach, imgUrl); }; window.original_send_to_editor=window.send_to_editor; window.send_to_editor=function(html){ };} function ptsMceMoveToolbar(editor, clientX){ var panel=editor.theme.panel; if(!panel) return; var panelRect=panel.layoutRect() , bodyElement=jQuery(editor.bodyElement) , bodyOffset=bodyElement.offset() , newX=clientX - panelRect.w / 2 , newY=bodyOffset.top - 30; if(newY <=150){ newY +=bodyElement.height() + 30; } if(newX < 0) newX=0; panel.moveTo(newX, panelRect.y ? panelRect.y:newY); panel._ptsOriginalTop=newY } function getSelectionCoords(win){ win=win||window; var doc=win.document; var sel=doc.selection, range, rects, rect; var x=0, y=0; if(sel){ if(sel.type!="Control"){ range=sel.createRange(); range.collapse(true); x=range.boundingLeft; y=range.boundingTop; }}else if(win.getSelection){ sel=win.getSelection(); if(sel.rangeCount){ range=sel.getRangeAt(0).cloneRange(); if(range.getClientRects){ range.collapse(true); rects=range.getClientRects(); if(rects.length > 0){ rect=range.getClientRects()[0]; } if(!rect){ return false; } x=rect.left; y=rect.top; } if(x==0&&y==0){ var span=doc.createElement("span"); if(span.getClientRects){ span.appendChild(doc.createTextNode("\u200b")); range.insertNode(span); rect=span.getClientRects()[0]; x=rect.left; y=rect.top; var spanParent=span.parentNode; spanParent.removeChild(span); spanParent.normalize(); }} }} return { x: x, y: y };} function get_class(obj){ if(obj instanceof Object&&!(obj instanceof Array) && !(obj instanceof Function)&&obj.constructor){ var arr=obj.constructor.toString().match(/function\s*(\w+)/); if(arr&&arr.length==2){ return arr[1]; }} return false; } function serialize(mixed_val){ switch (typeof(mixed_val)){ case "number": if(isNaN(mixed_val)||!isFinite(mixed_val)){ return false; }else{ return (Math.floor(mixed_val)==mixed_val ? "i":"d") + ":" + mixed_val + ";"; } case "string": return "s:" + mixed_val.length + ":\"" + mixed_val + "\";"; case "boolean": return "b:" + (mixed_val ? "1":"0") + ";"; case "object": if(mixed_val==null){ return "N;"; }else if(mixed_val instanceof Array){ var idxobj={ idx: -1 }; var map=[] for(var i=0; i
'); $parent.prepend($newEl); }; ptsChangeElAttrs.prototype._initSubMenuItem=function(){ var self=this._scope, $parent=self._$.find('.ptsElMenuContent'), $newEl=jQuery('#ptsSubMenyAddHtmlAttr'); $newEl=$newEl .clone() .removeAttr('id'); $parent.append($newEl); this._itemSubMenu=$parent; }; ptsChangeElAttrs.prototype._getAttrToSubMenu=function (){ var me=this, self=me._scope, $el=self._element._$.hasClass('ptsEl') ? self._element._$ : self._element._$.find('.ptsEl').eq(0), $parent=this._itemSubMenu, $newEl=null, allowedAttr=this._allowedAttrs; me._element=$el; var $attrNames={}, $attrs={}; $parent.find('.ptsElMenuSubPanel[data-sub-panel="add_attr"] .ptsElMenuSubPanelRow').remove(); $el.each(function(){ $attrNames=this.attributes; $parent=$parent.find('.ptsElMenuSubPanel[data-sub-panel="add_attr"]'); for (var key in allowedAttr){ if(typeof allowedAttr[key]=='string'){ $attrs[allowedAttr[key]]=jQuery(this).attr(allowedAttr[key]); $newEl=jQuery('#ptsRowAddHtmlAttr') .clone() .removeAttr('id'); $newEl.attr('data-id', allowedAttr[key]); $newEl.find('span').text(allowedAttr[key]); $newEl.find('input').val($attrs[allowedAttr[key]]); $newEl.find('input').attr('name', allowedAttr[key]); $parent.append($newEl); }} me._elAttributes=$attrs; me._setEventChangeElVal(); me._setEventUpdateAttrs(); }); }; ptsChangeElAttrs.prototype._updateElAttrs=function(){ this._isChangedAttrText=true; }; ptsChangeElAttrs.prototype._setEventChangeElVal=function(){ var me=this, $parent=this._itemSubMenu; function callBackFn(){ var thatAttr=jQuery(this).attr('name'), thatVal=jQuery(this).val(); me._element.attr(thatAttr, thatVal); me._updateElAttrs(); } $parent.find('div[data-sub-panel="add_attr"] input:not(".ptsCpInpFlag")').unbind('keyup'); $parent.find('div[data-sub-panel="add_attr"] input:not(".ptsCpInpFlag")').on('keyup', callBackFn); }; ptsChangeElAttrs.prototype._setEventUpdateAttrs=function(){ var me=this, $parent=this._itemSubMenu; function callBackFn(){ if(me._isChangedAttrText){ me._getAttrToSubMenu(); me._isChangedAttrText=false; }} $parent.find('input').unbind('blur'); $parent.find('input').on('blur', callBackFn); }; !function(t){var i=t(window);t.fn.visible=function(t,e,o){if(!(this.length<1)){var r=this.length>1?this.eq(0):this,n=r.get(0),f=i.width(),h=i.height(),o=o?o:"both",l=e===!0?n.offsetWidth*n.offsetHeight:!0;if("function"==typeof n.getBoundingClientRect){var g=n.getBoundingClientRect(),u=g.top>=0&&g.top0&&g.bottom<=h,c=g.left>=0&&g.left0&&g.right<=f,v=t?u||s:u&&s,b=t?c||a:c&&a;if("both"===o)return l&&v&&b;if("vertical"===o)return l&&v;if("horizontal"===o)return l&&b}else{var d=i.scrollTop(),p=d+h,w=i.scrollLeft(),m=w+f,y=r.offset(),z=y.top,B=z+r.height(),C=y.left,R=C+r.width(),j=t===!0?B:z,q=t===!0?z:B,H=t===!0?R:C,L=t===!0?C:R;if("both"===o)return!!l&&p>=q&&j>=d&&m>=L&&H>=w;if("vertical"===o)return!!l&&p>=q&&j>=d;if("horizontal"===o)return!!l&&m>=L&&H>=w}}}}(jQuery); (function(window){ window.htmlentities={ encode:function(str){ var buf=[]; for (var i=str.length-1;i>=0;i--){ buf.unshift(['&#', str[i].charCodeAt(), ';'].join('')); } return buf.join(''); }, decode:function(str){ return str.replace(/&#(\d+);/g, function(match, dec){ return String.fromCharCode(dec); }); }};})(window); (function(f){function A(a,b,d){var c=a[0],g=/er/.test(d)?_indeterminate:/bl/.test(d)?n:k,e=d==_update?{checked:c[k],disabled:c[n],indeterminate:"true"==a.attr(_indeterminate)||"false"==a.attr(_determinate)}:c[g];if(/^(ch|di|in)/.test(d)&&!e)x(a,g);else if(/^(un|en|de)/.test(d)&&e)q(a,g);else if(d==_update)for(var f in e)e[f]?x(a,f,!0):q(a,f,!0);else if(!b||"toggle"==d){if(!b)a[_callback]("ifClicked");e?c[_type]!==r&&q(a,g):x(a,g)}}function x(a,b,d){var c=a[0],g=a.parent(),e=b==k,u=b==_indeterminate, v=b==n,s=u?_determinate:e?y:"enabled",F=l(a,s+t(c[_type])),B=l(a,b+t(c[_type]));if(!0!==c[b]){if(!d&&b==k&&c[_type]==r&&c.name){var w=a.closest("form"),p='input[name="'+c.name+'"]',p=w.length?w.find(p):f(p);p.each(function(){this!==c&&f(this).data(m)&&q(f(this),b)})}u?(c[b]=!0,c[k]&&q(a,k,"force")):(d||(c[b]=!0),e&&c[_indeterminate]&&q(a,_indeterminate,!1));D(a,e,b,d)}c[n]&&l(a,_cursor,!0)&&g.find("."+C).css(_cursor,"default");g[_add](B||l(a,b)||"");g.attr("role")&&!u&&g.attr("aria-"+(v?n:k),"true"); g[_remove](F||l(a,s)||"")}function q(a,b,d){var c=a[0],g=a.parent(),e=b==k,f=b==_indeterminate,m=b==n,s=f?_determinate:e?y:"enabled",q=l(a,s+t(c[_type])),r=l(a,b+t(c[_type]));if(!1!==c[b]){if(f||!d||"force"==d)c[b]=!1;D(a,e,s,d)}!c[n]&&l(a,_cursor,!0)&&g.find("."+C).css(_cursor,"pointer");g[_remove](r||l(a,b)||"");g.attr("role")&&!f&&g.attr("aria-"+(m?n:k),"false");g[_add](q||l(a,s)||"")}function E(a,b){if(a.data(m)){a.parent().html(a.attr("style",a.data(m).s||""));if(b)a[_callback](b);a.off(".i").unwrap(); f(_label+'[for="'+a[0].id+'"]').add(a.closest(_label)).off(".i")}}function l(a,b,f){if(a.data(m))return a.data(m).o[b+(f?"":"Class")]}function t(a){return a.charAt(0).toUpperCase()+a.slice(1)}function D(a,b,f,c){if(!c){if(b)a[_callback]("ifToggled");a[_callback]("ifChanged")[_callback]("if"+t(f))}}var m="iCheck",C=m+"-helper",r="radio",k="checked",y="un"+k,n="disabled";_determinate="determinate";_indeterminate="in"+_determinate;_update="update";_type="type";_click="click";_touch="touchbegin.i touchend.i"; _add="addClass";_remove="removeClass";_callback="trigger";_label="label";_cursor="cursor";_mobile=/ipad|iphone|ipod|android|blackberry|windows phone|opera mini|silk/i.test(navigator.userAgent);f.fn[m]=function(a,b){var d='input[type="checkbox"], input[type="'+r+'"]',c=f(),g=function(a){a.each(function(){var a=f(this);c=a.is(d)?c.add(a):c.add(a.find(d))})};if(/^(check|uncheck|toggle|indeterminate|determinate|disable|enable|update|destroy)$/i.test(a))return a=a.toLowerCase(),g(this),c.each(function(){var c= f(this);"destroy"==a?E(c,"ifDestroyed"):A(c,!0,a);f.isFunction(b)&&b()});if("object"!=typeof a&&a)return this;var e=f.extend({checkedClass:k,disabledClass:n,indeterminateClass:_indeterminate,labelHover:!0},a),l=e.handle,v=e.hoverClass||"hover",s=e.focusClass||"focus",t=e.activeClass||"active",B=!!e.labelHover,w=e.labelHoverClass||"hover",p=(""+e.increaseArea).replace("%","")|0;if("checkbox"==l||l==r)d='input[type="'+l+'"]';-50>p&&(p=-50);g(this);return c.each(function(){var a=f(this);E(a);var c=this, b=c.id,g=-p+"%",d=100+2*p+"%",d={position:"absolute",top:g,left:g,display:"block",width:d,height:d,margin:0,padding:0,background:"#fff",border:0,opacity:0},g=_mobile?{position:"absolute",visibility:"hidden"}:p?d:{position:"absolute",opacity:0},l="checkbox"==c[_type]?e.checkboxClass||"icheckbox":e.radioClass||"i"+r,z=f(_label+'[for="'+b+'"]').add(a.closest(_label)),u=!!e.aria,y=m+"-"+Math.random().toString(36).substr(2,6),h='
")[_callback]("ifCreated").parent().append(e.insert);d=f('').css(d).appendTo(h);a.data(m,{o:e,s:a.attr("style")}).css(g);e.inheritClass&&h[_add](c.className||"");e.inheritID&&b&&h.attr("id",m+"-"+b);"static"==h.css("position")&&h.css("position","relative");A(a,!0,_update);if(z.length)z.on(_click+".i mouseover.i mouseout.i "+_touch,function(b){var d=b[_type],e=f(this);if(!c[n]){if(d==_click){if(f(b.target).is("a"))return; A(a,!1,!0)}else B&&(/ut|nd/.test(d)?(h[_remove](v),e[_remove](w)):(h[_add](v),e[_add](w)));if(_mobile)b.stopPropagation();else return!1}});a.on(_click+".i focus.i blur.i keyup.i keydown.i keypress.i",function(b){var d=b[_type];b=b.keyCode;if(d==_click)return!1;if("keydown"==d&&32==b)return c[_type]==r&&c[k]||(c[k]?q(a,k):x(a,k)),!1;if("keyup"==d&&c[_type]==r)!c[k]&&x(a,k);else if(/us|ur/.test(d))h["blur"==d?_remove:_add](s)});d.on(_click+" mousedown mouseup mouseover mouseout "+_touch,function(b){var d= b[_type],e=/wn|up/.test(d)?t:v;if(!c[n]){if(d==_click)A(a,!1,!0);else{if(/wn|er|in/.test(d))h[_add](e);else h[_remove](e+" "+t);if(z.length&&B&&e==v)z[/ut|nd/.test(d)?_remove:_add](w)}if(_mobile)b.stopPropagation();else return!1}})})}})(window.jQuery||window.Zepto); if(typeof(PTS_DATA)=='undefined') var PTS_DATA={}; if(isNumber(PTS_DATA.animationSpeed)) PTS_DATA.animationSpeed=parseInt(PTS_DATA.animationSpeed); else if(jQuery.inArray(PTS_DATA.animationSpeed, ['fast', 'slow'])==-1) PTS_DATA.animationSpeed='fast'; PTS_DATA.showSubscreenOnCenter=parseInt(PTS_DATA.showSubscreenOnCenter); var sdLoaderImgPts=''; var g_ptsAnimationSpeed=300; jQuery.fn.showLoaderPts=function(){ return jQuery(this).html(sdLoaderImgPts); }; jQuery.fn.appendLoaderPts=function(){ jQuery(this).append(sdLoaderImgPts); }; jQuery.sendFormPts=function(params){ return jQuery('
').sendFormPts(params); }; jQuery.fn.removeClassWild=function(mask){ return this.removeClass(function(index, cls){ var re=mask.replace(/\*/g, '\\S+'); return (cls.match(new RegExp('\\b' + re + '', 'g'))||[]).join(' '); }); }; jQuery.fn.sendFormPts=function(params){ var form=null; if(!params) params={fid: false, msgElID: false, onSuccess: false}; if(params.fid) form=jQuery('#'+ fid); else form=jQuery(this); var sentFromForm=(jQuery(form).tagName()=='FORM'); var data=new Array(); if(params.data) data=params.data; else if(sentFromForm) data=jQuery(form).serialize(); params.errorClass='ptsErrorMsg'+ (params.errorClass ? ' '+ params.errorClass:''); params.successClass='ptsSuccessMsg'+ (params.successClass ? ' '+ params.successClass:''); if(params.appendData){ var dataIsString=typeof(data)=='string'; var addStrData=[]; for(var i in params.appendData){ if(dataIsString){ addStrData.push(i+ '='+ params.appendData[i]); } else data[i]=params.appendData[i]; } if(dataIsString) data +='&'+ addStrData.join('&'); } var msgEl=null; if(params.msgElID){ if(params.msgElID=='noMessages') msgEl=false; else if(typeof(params.msgElID)=='object') msgEl=params.msgElID; else msgEl=jQuery('#'+ params.msgElID); } if(typeof(params.inputsWraper)=='string'){ form=jQuery('#'+ params.inputsWraper); sentFromForm=true; } if(sentFromForm&&form){ jQuery(form).find('*').removeClass('ptsInputError'); } if(msgEl&&!params.btn){ jQuery(msgEl) .removeClass(params.errorClass) .removeClass(params.successClass); if(params.hideLoader){ jQuery(msgEl).html(''); }else{ jQuery(msgEl).showLoaderPts(); }} if(params.btn){ var btnWasDisabled=jQuery(params.btn).attr('disabled') ? true:false; jQuery(params.btn).attr('disabled', 'disabled'); params.btnIconElement=jQuery(params.btn).find('.fa').size() ? jQuery(params.btn).find('.fa'):jQuery(params.btn); if(jQuery(params.btn).find('.fa').size()){ if(!btnWasDisabled){ params.btnIconElement .data('prev-class', params.btnIconElement.attr('class')); } params.btnIconElement .attr('class', 'fa fa-spinner fa-spin'); }} var url=''; if(typeof(params.url)!='undefined') url=params.url; else if(typeof(ajaxurl)=='undefined') url=PTS_DATA.ajaxurl; else url=ajaxurl; jQuery('.ptsErrorForField').hide(PTS_DATA.animationSpeed); var dataType=params.dataType ? params.dataType:'json'; if(typeof(data)=='string'){ data +='&pl='+ PTS_DATA.PTS_CODE; data +='&reqType=ajax'; }else{ data['pl']=PTS_DATA.PTS_CODE; data['reqType']='ajax'; } if(params.onBeforeSend&&typeof(params.onBeforeSend)==='function'){ params.onBeforeSend(); } jQuery.ajax({ url: url, data: data, type: 'POST', dataType: dataType, success: function(res){ toeProcessAjaxResponsePts(res, msgEl, form, sentFromForm, params); if(params.clearMsg){ setTimeout(function(){ if(msgEl) jQuery(msgEl).animateClear(); }, typeof(params.clearMsg)=='boolean' ? 5000:params.clearMsg); }} }); }; jQuery.fn.animateClear=function(){ var newContent=jQuery(''+ jQuery(this).html()+ ''); jQuery(this).html(newContent); jQuery(newContent).hide(PTS_DATA.animationSpeed, function(){ jQuery(newContent).remove(); }); }; jQuery.fn.animateRemovePts=function(animationSpeed, onSuccess){ animationSpeed=animationSpeed==undefined ? PTS_DATA.animationSpeed:animationSpeed; jQuery(this).hide(animationSpeed, function(){ jQuery(this).remove(); if(typeof(onSuccess)==='function') onSuccess(); }); }; function toeProcessAjaxResponsePts(res, msgEl, form, sentFromForm, params){ if(typeof(params)=='undefined') params={}; if(typeof(msgEl)=='string') msgEl=jQuery('#'+ msgEl); if(msgEl) jQuery(msgEl).html(''); if(params.btn){ jQuery(params.btn).removeAttr('disabled'); if(params.btnIconElement){ params.btnIconElement.attr('class', params.btnIconElement.data('prev-class')); }} if(typeof(res)=='object'){ if(msgEl){ msgEl.show(); } if(msgEl&¶ms.msgCloseBtn){ var closeBtn=jQuery(''); msgEl.append(closeBtn); closeBtn.click(function(){ msgEl.slideUp(g_ptsAnimationSpeed, function(){ msgEl.html(''); }); return false; }); } if(res.error){ if(msgEl){ jQuery(msgEl) .removeClass(params.successClass) .addClass(params.errorClass); } var errorsArr=[]; for(var name in res.errors){ if(sentFromForm){ var inputError=jQuery(form).find('[name*="'+ name+ '"]'); inputError.addClass('ptsInputError'); if(inputError.attr('placeholder')){ } if(!inputError.data('keyup-error-remove-binded')){ inputError.keydown(function(){ jQuery(this).removeClass('ptsInputError'); }).data('keyup-error-remove-binded', 1); }} if(jQuery('.ptsErrorForField.toe_'+ nameToClassId(name)+ '').exists()) jQuery('.ptsErrorForField.toe_'+ nameToClassId(name)+ '').show().html(res.errors[name]); else if(msgEl) jQuery(msgEl).append(res.errors[name]).append('
'); else errorsArr.push(res.errors[name]); } if(errorsArr.length&¶ms.btn&&jQuery.fn.dialog){ jQuery('
').html(errorsArr.join('
')).appendTo('body').dialog({ modal: true , width: '500px' , classes: { "ui-dialog": "ptsCreateTableModal" } , dialogClass: 'ptsCreateTableModal', }); }}else if(res.messages.length){ if(msgEl){ jQuery(msgEl) .removeClass(params.errorClass) .addClass(params.successClass); for(var i=0; i < res.messages.length; i++){ jQuery(msgEl).append(res.messages[i]).append('
'); }} }} if(params.onSuccess&&typeof(params.onSuccess)=='function'){ params.onSuccess(res); }} function getDialogElementPts(){ return jQuery('
').appendTo(jQuery('body')); } function toeOptionPts(key){ if(PTS_DATA.options&&PTS_DATA.options[ key ]) return PTS_DATA.options[ key ]; return false; } function toeLangPts(key){ if(PTS_DATA.siteLang&&PTS_DATA.siteLang[key]) return PTS_DATA.siteLang[key]; return key; } function toePagesPts(key){ if(typeof(PTS_DATA)!='undefined'&&PTS_DATA[key]) return PTS_DATA[key]; return false;; } function toeOptTimeoutHideDescriptionPts(){ jQuery('#ptsOptDescription').removeAttr('toeFixTip'); setTimeout(function(){ if(!jQuery('#ptsOptDescription').attr('toeFixTip')) toeOptHideDescriptionPts(); }, 500); } function toeOptShowDescriptionPts(description, x, y, moveToLeft){ if(typeof(description)!='undefined'&&description!=''){ if(!jQuery('#ptsOptDescription').size()){ jQuery('body').append('
'); } if(moveToLeft) jQuery('#ptsOptDescription').css('right', jQuery(window).width() - (x - 10)); else jQuery('#ptsOptDescription').css('left', x + 10); jQuery('#ptsOptDescription').css('top', y); jQuery('#ptsOptDescription').show(200); jQuery('#ptsOptDescription').html(description); }} function toeOptHideDescriptionPts(){ jQuery('#ptsOptDescription').removeAttr('toeFixTip'); jQuery('#ptsOptDescription').hide(200); } function toeInArrayPts(needle, haystack){ if(haystack){ for(var i in haystack){ if(haystack[i]==needle) return true; }} return false; } function toeShowDialogCustomized(element, options){ options=jQuery.extend({ resizable: false , width: 500 , height: 300 , closeOnEscape: true , open: function(event, ui){ jQuery('.ui-dialog-titlebar').css({ 'background-color': '#222222' , 'background-image': 'none' , 'border': 'none' , 'margin': '0' , 'padding': '0' , 'border-radius': '0' , 'color': '#CFCFCF' , 'height': '27px' }); jQuery('.ui-dialog-titlebar-close').css({ 'background': 'url("'+ PTS_DATA.cssPath+ 'img/tb-close.png") no-repeat scroll 0 0 transparent' , 'border': '0' , 'width': '15px' , 'height': '15px' , 'padding': '0' , 'border-radius': '0' , 'margin': '7px 7px 0' }).html(''); jQuery('.ui-dialog').css({ 'border-radius': '3px' , 'background-color': '#FFFFFF' , 'background-image': 'none' , 'padding': '1px' , 'z-index': '300000' , 'position': 'fixed' , 'top': '60px' }); jQuery('.ui-dialog-buttonpane').css({ 'background-color': '#FFFFFF' }); jQuery('.ui-dialog-title').css({ 'color': '#CFCFCF' , 'font': '12px sans-serif' , 'padding': '6px 10px 0' }); if(options.openCallback&&typeof(options.openCallback)=='function'){ options.openCallback(event, ui); } jQuery('.ui-widget-overlay').css({ 'z-index': jQuery(event.target).parents('.ui-dialog:first').css('z-index') - 1 , 'background-image': 'none' }); if(options.modal&&options.closeOnBg){ jQuery('.ui-widget-overlay').unbind('click').bind('click', function(){ jQuery(element).dialog('close'); }); }} }, options); return jQuery(element).dialog(options); } function toeSliderMove(event, ui){ var id=jQuery(event.target).attr('id'); jQuery('#toeSliderDisplay_'+ id).html(ui.value); jQuery('#toeSliderInput_'+ id).val(ui.value).change(); } function extendPts(Child, Parent){ var F=function(){ }; F.prototype=Parent.prototype; Child.prototype=new F(); Child.prototype.constructor=Child; Child.superclass=Parent.prototype; }; ;(function(e,t,n){function s(t,n){this.bodyOverflowX;this.callbacks={hide:[],show:[]};this.checkInterval=null;this.Content;this.$el=e(t);this.$elProxy;this.elProxyPosition;this.enabled=true;this.options=e.extend({},i,n);this.mouseIsOverProxy=false;this.namespace="tooltipster-"+Math.round(Math.random()*1e5);this.Status="hidden";this.timerHide=null;this.timerShow=null;this.$tooltip;this.options.iconTheme=this.options.iconTheme.replace(".","");this.options.theme=this.options.theme.replace(".","");this._init()}function o(t,n){var r=true;e.each(t,function(e,i){if(typeof n[e]==="undefined"||t[e]!==n[e]){r=false;return false}});return r}function f(){return!a&&u}function l(){var e=n.body||n.documentElement,t=e.style,r="transition";if(typeof t[r]=="string"){return true}v=["Moz","Webkit","Khtml","O","ms"],r=r.charAt(0).toUpperCase()+r.substr(1);for(var i=0;i');t.$elProxy.text(t.options.icon)}else{if(t.options.iconCloning)t.$elProxy=t.options.icon.clone(true);else t.$elProxy=t.options.icon}t.$elProxy.insertAfter(t.$el)}else{t.$elProxy=t.$el}if(t.options.trigger=="hover"){t.$elProxy.on("mouseenter."+t.namespace,function(){if(!f()||t.options.touchDevices){t.mouseIsOverProxy=true;t._show()}}).on("mouseleave."+t.namespace,function(){if(!f()||t.options.touchDevices){t.mouseIsOverProxy=false}});if(u&&t.options.touchDevices){t.$elProxy.on("touchstart."+t.namespace,function(){t._showNow()})}}else if(t.options.trigger=="click"){t.$elProxy.on("click."+t.namespace,function(){if(!f()||t.options.touchDevices){t._show()}})}}},_show:function(){var e=this;if(e.Status!="shown"&&e.Status!="appearing"){if(e.options.delay){e.timerShow=setTimeout(function(){if(e.options.trigger=="click"||e.options.trigger=="hover"&&e.mouseIsOverProxy){e._showNow()}},e.options.delay)}else e._showNow()}},_showNow:function(n){var r=this;r.options.functionBefore.call(r.$el,r.$el,function(){if(r.enabled&&r.Content!==null){if(n)r.callbacks.show.push(n);r.callbacks.hide=[];clearTimeout(r.timerShow);r.timerShow=null;clearTimeout(r.timerHide);r.timerHide=null;if(r.options.onlyOne){e(".tooltipstered").not(r.$el).each(function(t,n){var r=e(n),i=r.data("tooltipster-ns");e.each(i,function(e,t){var n=r.data(t),i=n.status(),s=n.option("autoClose");if(i!=="hidden"&&i!=="disappearing"&&s){n.hide()}})})}var i=function(){r.Status="shown";e.each(r.callbacks.show,function(e,t){t.call(r.$el)});r.callbacks.show=[]};if(r.Status!=="hidden"){var s=0;if(r.Status==="disappearing"){r.Status="appearing";if(l()){r.$tooltip.clearQueue().removeClass("tooltipster-dying").addClass("tooltipster-"+r.options.animation+"-show");if(r.options.speed>0)r.$tooltip.delay(r.options.speed);r.$tooltip.queue(i)}else{r.$tooltip.stop().fadeIn(i)}}else if(r.Status==="shown"){i()}}else{r.Status="appearing";var s=r.options.speed;r.bodyOverflowX=e("body").css("overflow-x");e("body").css("overflow-x","hidden");var o="tooltipster-"+r.options.animation,a="-webkit-transition-duration: "+r.options.speed+"ms; -webkit-animation-duration: "+r.options.speed+"ms; -moz-transition-duration: "+r.options.speed+"ms; -moz-animation-duration: "+r.options.speed+"ms; -o-transition-duration: "+r.options.speed+"ms; -o-animation-duration: "+r.options.speed+"ms; -ms-transition-duration: "+r.options.speed+"ms; -ms-animation-duration: "+r.options.speed+"ms; transition-duration: "+r.options.speed+"ms; animation-duration: "+r.options.speed+"ms;",f=r.options.minWidth?"min-width:"+Math.round(r.options.minWidth)+"px;":"",c=r.options.maxWidth?"max-width:"+Math.round(r.options.maxWidth)+"px;":"",h=r.options.interactive?"pointer-events: auto;":"";r.$tooltip=e('
');if(l())r.$tooltip.addClass(o);r._content_insert();r.$tooltip.appendTo("body");r.reposition();r.options.functionReady.call(r.$el,r.$el,r.$tooltip);if(l()){r.$tooltip.addClass(o+"-show");if(r.options.speed>0)r.$tooltip.delay(r.options.speed);r.$tooltip.queue(i)}else{r.$tooltip.css("display","none").fadeIn(r.options.speed,i)}r._interval_set();e(t).on("scroll."+r.namespace+" resize."+r.namespace,function(){r.reposition()});if(r.options.autoClose){e("body").off("."+r.namespace);if(r.options.trigger=="hover"){if(u){setTimeout(function(){e("body").on("touchstart."+r.namespace,function(){r.hide()})},0)}if(r.options.interactive){if(u){r.$tooltip.on("touchstart."+r.namespace,function(e){e.stopPropagation()})}var p=null;r.$elProxy.add(r.$tooltip).on("mouseleave."+r.namespace+"-autoClose",function(){clearTimeout(p);p=setTimeout(function(){r.hide()},r.options.interactiveTolerance)}).on("mouseenter."+r.namespace+"-autoClose",function(){clearTimeout(p)})}else{r.$elProxy.on("mouseleave."+r.namespace+"-autoClose",function(){r.hide()})}if(r.options.hideOnClick){r.$elProxy.on("click."+r.namespace+"-autoClose",function(){r.hide()})}}else if(r.options.trigger=="click"){setTimeout(function(){e("body").on("click."+r.namespace+" touchstart."+r.namespace,function(){r.hide()})},0);if(r.options.interactive){r.$tooltip.on("click."+r.namespace+" touchstart."+r.namespace,function(e){e.stopPropagation()})}}}}if(r.options.timer>0){r.timerHide=setTimeout(function(){r.timerHide=null;r.hide()},r.options.timer+s)}}})},_interval_set:function(){var t=this;t.checkInterval=setInterval(function(){if(e("body").find(t.$el).length===0||e("body").find(t.$elProxy).length===0||t.Status=="hidden"||e("body").find(t.$tooltip).length===0){if(t.Status=="shown"||t.Status=="appearing")t.hide();t._interval_cancel()}else{if(t.options.positionTracker){var n=t._repositionInfo(t.$elProxy),r=false;if(o(n.dimension,t.elProxyPosition.dimension)){if(t.$elProxy.css("position")==="fixed"){if(o(n.position,t.elProxyPosition.position))r=true}else{if(o(n.offset,t.elProxyPosition.offset))r=true}}if(!r){t.reposition();t.options.positionTrackerCallback.call(t,t.$el)}}}},200)},_interval_cancel:function(){clearInterval(this.checkInterval);this.checkInterval=null},_content_set:function(e){if(typeof e==="object"&&e!==null&&this.options.contentCloning){e=e.clone(true)}this.Content=e},_content_insert:function(){var e=this,t=this.$tooltip.find(".tooltipster-content");if(typeof e.Content==="string"&&!e.options.contentAsHTML){t.text(e.Content)}else{t.empty().append(e.Content)}},_update:function(e){var t=this;t._content_set(e);if(t.Content!==null){if(t.Status!=="hidden"){t._content_insert();t.reposition();if(t.options.updateAnimation){if(l()){t.$tooltip.css({width:"","-webkit-transition":"all "+t.options.speed+"ms, width 0ms, height 0ms, left 0ms, top 0ms","-moz-transition":"all "+t.options.speed+"ms, width 0ms, height 0ms, left 0ms, top 0ms","-o-transition":"all "+t.options.speed+"ms, width 0ms, height 0ms, left 0ms, top 0ms","-ms-transition":"all "+t.options.speed+"ms, width 0ms, height 0ms, left 0ms, top 0ms",transition:"all "+t.options.speed+"ms, width 0ms, height 0ms, left 0ms, top 0ms"}).addClass("tooltipster-content-changing");setTimeout(function(){if(t.Status!="hidden"){t.$tooltip.removeClass("tooltipster-content-changing");setTimeout(function(){if(t.Status!=="hidden"){t.$tooltip.css({"-webkit-transition":t.options.speed+"ms","-moz-transition":t.options.speed+"ms","-o-transition":t.options.speed+"ms","-ms-transition":t.options.speed+"ms",transition:t.options.speed+"ms"})}},t.options.speed)}},t.options.speed)}else{t.$tooltip.fadeTo(t.options.speed,.5,function(){if(t.Status!="hidden"){t.$tooltip.fadeTo(t.options.speed,1)}})}}}}else{t.hide()}},_repositionInfo:function(e){return{dimension:{height:e.outerHeight(false),width:e.outerWidth(false)},offset:e.offset(),position:{left:parseInt(e.css("left")),top:parseInt(e.css("top"))}}},hide:function(n){var r=this;if(n)r.callbacks.hide.push(n);r.callbacks.show=[];clearTimeout(r.timerShow);r.timerShow=null;clearTimeout(r.timerHide);r.timerHide=null;var i=function(){e.each(r.callbacks.hide,function(e,t){t.call(r.$el)});r.callbacks.hide=[]};if(r.Status=="shown"||r.Status=="appearing"){r.Status="disappearing";var s=function(){r.Status="hidden";if(typeof r.Content=="object"&&r.Content!==null){r.Content.detach()}r.$tooltip.remove();r.$tooltip=null;e(t).off("."+r.namespace);e("body").off("."+r.namespace).css("overflow-x",r.bodyOverflowX);e("body").off("."+r.namespace);r.$elProxy.off("."+r.namespace+"-autoClose");r.options.functionAfter.call(r.$el,r.$el);i()};if(l()){r.$tooltip.clearQueue().removeClass("tooltipster-"+r.options.animation+"-show").addClass("tooltipster-dying");if(r.options.speed>0)r.$tooltip.delay(r.options.speed);r.$tooltip.queue(s)}else{r.$tooltip.stop().fadeOut(r.options.speed,s)}}else if(r.Status=="hidden"){i()}return r},show:function(e){this._showNow(e);return this},update:function(e){return this.content(e)},content:function(e){if(typeof e==="undefined"){return this.Content}else{this._update(e);return this}},reposition:function(){var n=this;if(e("body").find(n.$tooltip).length!==0){n.$tooltip.css("width","");n.elProxyPosition=n._repositionInfo(n.$elProxy);var r=null,i=e(t).width(),s=n.elProxyPosition,o=n.$tooltip.outerWidth(false),u=n.$tooltip.innerWidth()+1,a=n.$tooltip.outerHeight(false);if(n.$elProxy.is("area")){var f=n.$elProxy.attr("shape"),l=n.$elProxy.parent().attr("name"),c=e('img[usemap="#'+l+'"]'),h=c.offset().left,p=c.offset().top,d=n.$elProxy.attr("coords")!==undefined?n.$elProxy.attr("coords").split(","):undefined;if(f=="circle"){var v=parseInt(d[0]),m=parseInt(d[1]),g=parseInt(d[2]);s.dimension.height=g*2;s.dimension.width=g*2;s.offset.top=p+m-g;s.offset.left=h+v-g}else if(f=="rect"){var v=parseInt(d[0]),m=parseInt(d[1]),y=parseInt(d[2]),b=parseInt(d[3]);s.dimension.height=b-m;s.dimension.width=y-v;s.offset.top=p+m;s.offset.left=h+v}else if(f=="poly"){var w=[],E=[],S=0,x=0,T=0,N=0,C="even";for(var k=0;kT){T=L;if(k===0){S=T}}if(LN){N=L;if(k==1){x=N}}if(Li){r=A-(i+n-o);A=i+n-o}}function B(n,r){if(s.offset.top-e(t).scrollTop()-a-_-12<0&&r.indexOf("top")>-1){P=n}if(s.offset.top+s.dimension.height+a+12+_>e(t).scrollTop()+e(t).height()&&r.indexOf("bottom")>-1){P=n;M=s.offset.top-a-_-12}}if(P=="top"){var j=s.offset.left+o-(s.offset.left+s.dimension.width);A=s.offset.left+D-j/2;M=s.offset.top-a-_-12;H();B("bottom","top")}if(P=="top-left"){A=s.offset.left+D;M=s.offset.top-a-_-12;H();B("bottom-left","top-left")}if(P=="top-right"){A=s.offset.left+s.dimension.width+D-o;M=s.offset.top-a-_-12;H();B("bottom-right","top-right")}if(P=="bottom"){var j=s.offset.left+o-(s.offset.left+s.dimension.width);A=s.offset.left-j/2+D;M=s.offset.top+s.dimension.height+_+12;H();B("top","bottom")}if(P=="bottom-left"){A=s.offset.left+D;M=s.offset.top+s.dimension.height+_+12;H();B("top-left","bottom-left")}if(P=="bottom-right"){A=s.offset.left+s.dimension.width+D-o;M=s.offset.top+s.dimension.height+_+12;H();B("top-right","bottom-right")}if(P=="left"){A=s.offset.left-D-o-12;O=s.offset.left+D+s.dimension.width+12;var F=s.offset.top+a-(s.offset.top+s.dimension.height);M=s.offset.top-F/2-_;if(A<0&&O+o>i){var I=parseFloat(n.$tooltip.css("border-width"))*2,q=o+A-I;n.$tooltip.css("width",q+"px");a=n.$tooltip.outerHeight(false);A=s.offset.left-D-q-12-I;F=s.offset.top+a-(s.offset.top+s.dimension.height);M=s.offset.top-F/2-_}else if(A<0){A=s.offset.left+D+s.dimension.width+12;r="left"}}if(P=="right"){A=s.offset.left+D+s.dimension.width+12;O=s.offset.left-D-o-12;var F=s.offset.top+a-(s.offset.top+s.dimension.height);M=s.offset.top-F/2-_;if(A+o>i&&O<0){var I=parseFloat(n.$tooltip.css("border-width"))*2,q=i-A-I;n.$tooltip.css("width",q+"px");a=n.$tooltip.outerHeight(false);F=s.offset.top+a-(s.offset.top+s.dimension.height);M=s.offset.top-F/2-_}else if(A+o>i){A=s.offset.left-D-o-12;r="right"}}if(n.options.arrow){var R="tooltipster-arrow-"+P;if(n.options.arrowColor.length<1){var U=n.$tooltip.css("background-color")}else{var U=n.options.arrowColor}if(!r){r=""}else if(r=="left"){R="tooltipster-arrow-right";r=""}else if(r=="right"){R="tooltipster-arrow-left";r=""}else{r="left:"+Math.round(r)+"px;"}if(P=="top"||P=="top-left"||P=="top-right"){var z=parseFloat(n.$tooltip.css("border-bottom-width")),W=n.$tooltip.css("border-bottom-color")}else if(P=="bottom"||P=="bottom-left"||P=="bottom-right"){var z=parseFloat(n.$tooltip.css("border-top-width")),W=n.$tooltip.css("border-top-color")}else if(P=="left"){var z=parseFloat(n.$tooltip.css("border-right-width")),W=n.$tooltip.css("border-right-color")}else if(P=="right"){var z=parseFloat(n.$tooltip.css("border-left-width")),W=n.$tooltip.css("border-left-color")}else{var z=parseFloat(n.$tooltip.css("border-bottom-width")),W=n.$tooltip.css("border-bottom-color")}if(z>1){z++}var X="";if(z!==0){var V="",J="border-color: "+W+";";if(R.indexOf("bottom")!==-1){V="margin-top: -"+Math.round(z)+"px;"}else if(R.indexOf("top")!==-1){V="margin-bottom: -"+Math.round(z)+"px;"}else if(R.indexOf("left")!==-1){V="margin-right: -"+Math.round(z)+"px;"}else if(R.indexOf("right")!==-1){V="margin-left: -"+Math.round(z)+"px;"}X=''}n.$tooltip.find(".tooltipster-arrow").remove();var K='
'+X+'
';n.$tooltip.append(K)}n.$tooltip.css({top:Math.round(M)+"px",left:Math.round(A)+"px"})}return n},enable:function(){this.enabled=true;return this},disable:function(){this.hide();this.enabled=false;return this},destroy:function(){var t=this;t.hide();if(t.$el[0]!==t.$elProxy[0]){t.$elProxy.remove()}t.$el.removeData(t.namespace).off("."+t.namespace);var n=t.$el.data("tooltipster-ns");if(n.length===1){var r=null;if(t.options.restoration==="previous"){r=t.$el.data("tooltipster-initialTitle")}else if(t.options.restoration==="current"){r=typeof t.Content==="string"?t.Content:e("
").append(t.Content).html()}if(r){t.$el.attr("title",r)}t.$el.removeClass("tooltipstered").removeData("tooltipster-ns").removeData("tooltipster-initialTitle")}else{n=e.grep(n,function(e,n){return e!==t.namespace});t.$el.data("tooltipster-ns",n)}return t},elementIcon:function(){return this.$el[0]!==this.$elProxy[0]?this.$elProxy[0]:undefined},elementTooltip:function(){return this.$tooltip?this.$tooltip[0]:undefined},option:function(e,t){if(typeof t=="undefined")return this.options[e];else{this.options[e]=t;return this}},status:function(){return this.Status}};e.fn[r]=function(){var t=arguments;if(this.length===0){if(typeof t[0]==="string"){var n=true;switch(t[0]){case"setDefaults":e.extend(i,t[1]);break;default:n=false;break}if(n)return true;else return this}else{return this}}else{if(typeof t[0]==="string"){var r="#*$~&";this.each(function(){var n=e(this).data("tooltipster-ns"),i=n?e(this).data(n[0]):null;if(i){if(typeof i[t[0]]==="function"){var s=i[t[0]](t[1],t[2])}else{throw new Error('Unknown method .tooltipster("'+t[0]+'")')}if(s!==i){r=s;return false}}else{throw new Error("You called Tooltipster's \""+t[0]+'" method on an uninitialized element')}});return r!=="#*$~&"?r:this}else{var o=[],u=t[0]&&typeof t[0].multiple!=="undefined",a=u&&t[0].multiple||!u&&i.multiple,f=t[0]&&typeof t[0].debug!=="undefined",l=f&&t[0].debug||!f&&i.debug;this.each(function(){var n=false,r=e(this).data("tooltipster-ns"),i=null;if(!r){n=true}else if(a){n=true}else if(l){console.log('Tooltipster: one or more tooltips are already attached to this element: ignoring. Use the "multiple" option to attach more tooltips.')}if(n){i=new s(this,t[0]);if(!r)r=[];r.push(i.namespace);e(this).data("tooltipster-ns",r);e(this).data(i.namespace,i)}o.push(i)});if(a)return o;else return this}}};var u=!!("ontouchstart"in t);var a=false;e("body").one("mousemove",function(){a=true})})(jQuery,window,document); (function($){ $.fn.responsiveText=function(options){ var settings=$.extend({ 'minFontSize':Number.NEGATIVE_INFINITY, 'maxFontSize':Number.POSITIVE_INFINITY }, options); return this.each(function(){ var $this=$(this), text=$this.get(0); if(!text) return; $this.data('original-font-size', parseFloat( window.getComputedStyle(text).fontSize ), 10); var resizer=function (){ var ratio=null, originalWidth=window.screen.availWidth, currentWidth=window.innerWidth, size=$this.data('original-font-size'); if(originalWidth==currentWidth||!size) return; if(currentWidth!=originalWidth) ratio=originalWidth / currentWidth; if(currentWidth > originalWidth) size *=ratio; else size /=ratio; size=Math.max(Math.min(size, settings.maxFontSize ), settings.minFontSize ); $this.css('font-size', size + 'px'); }; resizer(); $(window).on('resize.responsiveText orientationchange.responsiveText', resizer); }); };})(jQuery); function ptsBlockFabric(){ this._blocks=[]; this._isSorting=false; this._animationSpeed=g_ptsAnimationSpeed; } ptsBlockFabric.prototype.addFromHtml=function(blockData, jqueryHtml){ var block=this.add(blockData); block.setRaw(jqueryHtml); }; ptsBlockFabric.prototype.add=function(blockData){ var blockData=jQuery.extend({}, blockData); if(!blockData.original_id){ blockData.original_id=blockData.id; blockData.id=0; } var blockClass=window[ 'ptsBlock_'+ blockData.cat_code ]; if(blockClass){ var block=new blockClass(blockData); var blockIter=this._blocks.push(block); block.setIter(blockIter - 1); return block; }else{ console.log('Block Class For '+ blockData.cat_code+ ' Not Found!!!'); }}; ptsBlockFabric.prototype.getByViewId=function(viewId){ if(this._blocks&&this._blocks.length){ for(var i=0; i < this._blocks.length; i++){ if(this._blocks[ i ].get('view_id')==viewId){ return this._blocks[ i ]; }} } return false; }; function ptsBlockBase(blockData){ this._data=blockData; this._$=null; this._original$=null; this._id=0; this._iter=0; this._elements=[]; this._animationSpeed=300; this._disableContentChange=false; } ptsBlockBase.prototype.get=function(key){ return this._data[ key ]; }; ptsBlockBase.prototype.getParam=function(key){ return this._data.params[ key ] ? this._data.params[ key ].val:false; }; ptsBlockBase.prototype.setParam=function(key, value){ if(!this._data.params[ key ]) this._data.params[ key ]={}; this._data.params[ key ].val=value; }; ptsBlockBase.prototype.getRaw=function(){ return this._$; }; ptsBlockBase.prototype.$=function(){ return this.getRaw(); }; ptsBlockBase.prototype.setRaw=function(jqueryHtml){ this._$=jqueryHtml; this._resetElements(); this._initHtml(); if(this.getParam('font_family')){ this._setFont(this.getParam('font_family')); }}; ptsBlockBase.prototype._initElements=function(){ this._initElementsForArea(this._$); }; ptsBlockBase.prototype._initElementsForArea=function(area){ var block=this , addedElements=[]; var initElement=function(htmlEl){ var elementCode=jQuery(htmlEl).data('el') , elementClass=window[ 'ptsElement_'+ elementCode ]; if(elementClass){ var newElement=new elementClass(jQuery(htmlEl), block); newElement._setCode(elementCode); var newIterNum=block._elements.push(newElement); addedElements.push(newElement); newElement.setIterNum(newIterNum - 1); }else{ if(g_ptsEdit) console.log('Undefined Element ['+ elementCode+ '] !!!'); }}; jQuery(area).find('.ptsEl').each(function(){ initElement(this); }); if(jQuery(area).hasClass('ptsEl')){ initElement(area); } this._afterInitElements(); return addedElements; }; ptsBlockBase.prototype._afterInitElements=function(){ }; ptsBlockBase.prototype._resetElements=function(){ this._clearElements(); this._initElements(); }; ptsBlockBase.prototype._clearElements=function(){ if(this._elements&&this._elements.length){ for(var i=0; i < this._elements.length; i++){ this._elements[ i ].destroy(); } this._elements=[]; }}; ptsBlockBase.prototype.getElements=function(){ return this._elements; }; ptsBlockBase.prototype._initHtml=function(){ }; ptsBlockBase.prototype.setIter=function(iter){ this._iter=iter; }; ptsBlockBase.prototype.showLoader=function(txt){ var loaderHtml=jQuery('#ptsBlockLoader'); txt=txt ? txt:loaderHtml.data('base-txt'); loaderHtml.find('.ptsBlockLoaderTxt').html(txt); loaderHtml.css({ 'height': this._$.height() , 'top': this._$.offset().top }).addClass('active'); }; ptsBlockBase.prototype.hideLoader=function(){ var loaderHtml=jQuery('#ptsBlockLoader'); loaderHtml.removeClass('active'); }; ptsBlockBase.prototype._setFont=function(fontFamily){ var $fontLink=this._getFontLink(); if(toeInArrayPts(fontFamily, ptsBuildConst.standardFonts)===false){ $fontLink.attr({ 'href': 'https://fonts.googleapis.com/css?family='+ encodeURIComponent(fontFamily) }); } this._$.css({ 'font-family': fontFamily }); this.setParam('font_family', fontFamily); }; ptsBlockBase.prototype._getFontLink=function(){ var $link=this._$.find('link.ptsFont'); if(!$link.size()){ $link=jQuery('').appendTo(this._$); } return $link; }; ptsBlockBase.prototype.getElementByIterNum=function(iterNum){ return this._elements[ iterNum ]; }; ptsBlockBase.prototype.removeElementByIterNum=function(iterNum){ this._elements.splice(iterNum, 1); if(this._elements&&this._elements.length){ for(var i=0; i < this._elements.length; i++){ this._elements[ i ].setIterNum(i); }} }; ptsBlockBase.prototype.destroyElementByIterNum=function(iterNum, clb){ this.getElementByIterNum(iterNum).destroy(clb); }; function ptsBlock_price_table(blockData){ this._increaseHoverFontPerc=20; this._$lastHoveredCol=null; this._refreshColsBinded=false; this._onloadHandle=false; this._isAlreadyShowed=false; this._isResponsiveDescInit=false; ptsBlock_price_table.superclass.constructor.apply(this, arguments); } extendPts(ptsBlock_price_table, ptsBlockBase); ptsBlock_price_table.prototype._getColsContainer=function(){ return this._$.find('.ptsColsWrapper:first'); }; ptsBlock_price_table.prototype._getCols=function(includeDescCol){ return this._getColsContainer().find('.ptsCol'+ (includeDescCol ? '':':not(.ptsTableDescCol)')); }; ptsBlock_price_table.prototype._initTooltipsForCells=function(){ if(this.getParam('disable_custom_tooltip_style')!='1'){ var $tooltipstedCells=this._$.find('.ptsCell[title], .ptsColFooter[title], .ptsColHeader[title], .ptsColDesc[title]'); if($tooltipstedCells&&$tooltipstedCells.size()){ var tooltipsterSettings={ contentAsHTML: true , interactive: true , speed: 250 , delay: 0 , animation: 'swing' , maxWidth: 450 , position: 'top' }; $tooltipstedCells.tooltipster(tooltipsterSettings); $tooltipstedCells.each(function(){ var el=jQuery(this); el.attr('data-title', el.attr('title')).removeAttr('title'); }); }} }; ptsBlock_price_table.prototype._afterInitElements=function(){ ptsBlock_price_table.superclass._afterInitElements.apply(this, arguments); if(parseInt(this.getParam('enb_hover_animation'))){ this._initHoverEffect(); } if(this.getParam('table_align')) this._$.addClass('ptsTableAlign_' + this.getParam('table_align')); if(this.getParam('text_align')) this._$.addClass('ptsAlign_' + this.getParam('text_align')); if(!this._disableContentChange){ this._refreshCellsHeight(); } if(!this._refreshColsBinded){ this._$.bind('ptsBlockContentChanged', jQuery.proxy(function(){ this._refreshCellsHeight(); }, this)); this._refreshColsBinded=true; } if(!_ptsIsEditMode()){ this._initTooltipsForCells(); var self=this , PTS_VISIBLE_SET_HEIGHT_KEY='PTS-VISIBLE-SET-HEIGHT-KEY'; this._fixResponsive(); jQuery(window).resize(function(){ if(! self._$.is(':visible')){ self._$.data(PTS_VISIBLE_SET_HEIGHT_KEY, false); }else{ self._fixResponsive(); self._refreshCellsHeight(); }}); jQuery('.ptsTableFrontedShell .ptsPreDisplayStyle').remove(); jQuery('.ptsBlock').css({ 'opacity': '1' , 'visibility': 'visible' }); jQuery(window).on('toggleChangeCellHeight', function (){ self._refreshCellsHeight(); }); jQuery(function (){ var isEnableLazyLoad=function (){ return self._$.find('img[data-lazy-src]:not(.lazyloaded)').size() > 0; }, checkedLazyLoadLib=false; if(isEnableLazyLoad()) checkedLazyLoadLib=true; document.body.addEventListener("DOMSubtreeModified", function (e){ if(checkedLazyLoadLib && e.target.nodeType==1 && e.target.nodeName=="IMG" && jQuery.contains(self._$.get(0), e.target) ){ var isLoadedImages=true; self._$.find('img[data-lazy-src]').each(function (){ var $this=jQuery(this); if(!$this.hasClass('lazyloaded')&&!$this.hasClass('lazyload')) isLoadedImages=false; }); if(isLoadedImages){ checkedLazyLoadLib=false; self._$.find('img[data-lazy-src]').on('load', function (){ self._fixResponsive(); self._refreshCellsHeight(); }); }} if(self._isAlreadyShowed||! self._$) return; if(self._$.visible()){ self._isAlreadyShowed=true; self._fixResponsive(); self._refreshCellsHeight(); }}, false); self.setCalcWidth(); }); }else{ this.columnChidrensWidthCalc(); } var self=this; if(! this._onloadHandle){ this._onloadHandle=true; jQuery(window).load(function(){ self._refreshCellsHeight(); }); }}; ptsBlock_price_table.prototype._initHoverEffect=function(){ if(_ptsIsEditMode()){ this.setParam('enb_hover_animation', 1); return; } var $cols=this._getCols() , self=this; this._disableHoverEffect($cols); $cols.bind('hover.animation', function(e){ switch(e.type){ case 'mouseenter': case 'mousein': self._increaseHoverFont(jQuery(this)); break; case 'mouseleave': case 'mouseout': self._backHoverFont(jQuery(this)); break; }}); this.setParam('enb_hover_animation', 1); }; ptsBlock_price_table.prototype._increaseHoverFont=function($col){ var self=this; if(_ptsIsEditMode()) return; var $descCell=$col.find('.ptsColDesc'); $col.height($col.height()); $descCell.find('span').each(function(){ var newFontSize=jQuery(this).data('new-font-size'); if(!newFontSize){ var prevFontSize=jQuery(this).css('font-size') , fontUnits=prevFontSize.replace(/\d+/, '') , fontSize=parseInt(str_replace(prevFontSize, fontUnits, '')); if(fontSize&&fontUnits){ newFontSize=Math.ceil(fontSize + (self._increaseHoverFontPerc * fontSize / 100)); jQuery(this) .data('prev-font-size', prevFontSize) .data('font-units', fontUnits) .data('new-font-size', newFontSize); }} if(newFontSize){ jQuery(this).css('font-size', newFontSize+ jQuery(this).data('font-units')); }}); if(this.getParam('is_horisontal_row_type')!='1'){ if(!$descCell.attr('data-prev-height')){ var descHeight=$descCell.outerHeight(); $descCell.attr('data-prev-height', descHeight); }else{ descHeight=$descCell.attr('data-prev-height'); } $descCell.css({ 'min-height': descHeight , 'height': 'auto' }); } $col.addClass('hover'); if(_ptsIsEditMode()){ setTimeout(function(){ var colElement=self.getElementByIterNum($col.data('iter-num')); if(colElement){ colElement.repositeMenu(); }}, g_ptsHoverAnim); }}; ptsBlock_price_table.prototype._backHoverFont=function($col){ if(_ptsIsEditMode()) return; $col.removeClass('hover'); var $descCell=$col.find('.ptsColDesc'); $descCell.find('span').each(function(){ var prevFontSize=jQuery(this).data('prev-font-size'); if(prevFontSize){ jQuery(this).css('font-size', prevFontSize); }}); setTimeout(function(){ $descCell.outerHeight($descCell.data('prev-height')); }, 300); }; ptsBlock_price_table.prototype._disableHoverEffect=function($cols){ this.setParam('enb_hover_animation', 0); if(_ptsIsEditMode()) return; $cols=$cols ? $cols:this._getCols(); $cols.unbind('hover.animation'); }; ptsBlock_price_table.prototype.getColSelectors=function(){ return { header: {sel: '.ptsColHeader'} , desc: {sel: '.ptsColDesc'} , rows: {sel: '.ptsRows'} , cells: {sel: '.ptsCell'} , footer: {sel: '.ptsColFooter'}};}; ptsBlock_price_table.prototype.getMaxColsSizes=function(widthDesc){ var $cols=this._getCols(widthDesc) , sizes=this.getColSelectors(); $cols.each(function(){ jQuery(this).css({'min-height':'auto'}); for(var key in sizes){ if(key=='rows') continue; var $entity=jQuery(this).find(sizes[ key ].sel); if($entity&&$entity.size()){ if(key=='cells'){ if(!sizes[ key ].height) sizes[ key ].height=[]; var cellNum=0; $entity.each(function(){ var prevHeight=jQuery(this).outerHeight(); jQuery(this).css('height', 'auto'); var height=jQuery(this).outerHeight(); if(!sizes[ key ].height[ cellNum ]||sizes[ key ].height[ cellNum ] < height){ sizes[ key ].height[ cellNum ]=height; } cellNum++; }); }else{ var prevHeight=$entity.outerHeight(); $entity.css('height', 'auto'); var height=$entity.outerHeight(); if(!sizes[ key ].height||sizes[ key ].height < height){ sizes[ key ].height=height; } $entity.outerHeight(prevHeight); }} }}); return sizes; }; ptsBlock_price_table.prototype.getColumnWithInfo=function(strWidthAttr){ var trimAttr=strWidthAttr.trim(); var number=trimAttr.match('\\d+'); var isPerc=trimAttr.match('%'); var isPx=trimAttr.match('\\d+'); if(number===null||(isPerc===null&&isPx===null)){ return null; } return new Object({ 'num': (number.length&&number.length > 0&&!isNaN(parseInt(number[0]))) ? parseInt(number[0]):null, 'isPerc': isPerc===null ? false:true }); }; ptsBlock_price_table.prototype.setColsWidth=function(width, perc){ var thatObj=this; if(thatObj.getParam('is_horisontal_row_type')!='1'){ if(this.getParam('dsbl_responsive')==='1'){ var tableWidth=this._$.width(), fixedValueTableWidth=this._$.width(), $cols=this._getCols(true), notSettedColumnWidthArr=new Array(); $cols.each(function (){ var col1=jQuery(this); if(col1.length > 0&&col1[0].style&&col1[0].style.width){ var colWidthObj=thatObj.getColumnWithInfo(col1[0].style.width); if(colWidthObj&&'num' in colWidthObj&&'isPerc' in colWidthObj){ var calcColWidth=0; if(colWidthObj.isPerc){ calcColWidth=fixedValueTableWidth * colWidthObj.num / 100; }else{ calcColWidth=colWidthObj.num; } var colPdL=parseFloat(col1.css('padding-left')), colPdR=parseFloat(col1.css('padding-right')), colMgL=parseFloat(col1.css('margin-left')), colMgR=parseFloat(col1.css('margin-right')), colSumMarginPadding=0; if(!isNaN(colPdL)){ colSumMarginPadding +=colPdL; } if(!isNaN(colPdR)){ colSumMarginPadding +=colPdR; } if(!isNaN(colMgL)){ colSumMarginPadding +=colMgL; } if(!isNaN(colMgR)){ colSumMarginPadding +=colMgR; } tableWidth -=calcColWidth; calcColWidth=Math.floor(calcColWidth - colSumMarginPadding); if(calcColWidth < 0){ calcColWidth=0; } col1.width(calcColWidth); }else{ notSettedColumnWidthArr[notSettedColumnWidthArr.length]=col1; }}else{ notSettedColumnWidthArr[notSettedColumnWidthArr.length]=col1; }}); if(tableWidth > 0&¬SettedColumnWidthArr.length > 0){ var calcWidthForNsCol=Math.round(tableWidth / notSettedColumnWidthArr.length); for (var oneNsColumn in notSettedColumnWidthArr){ notSettedColumnWidthArr[oneNsColumn].width(calcWidthForNsCol); }} }else{ width=parseFloat(width); if(width){ if(!perc){ this.setParam('col_width', width); } var $cols=this._getCols(true); if(perc){ width +='%'; }else{ width +='px'; } $cols.css({ 'width': width }); }} }else{ this.columnChidrensWidthCalc(); }}; ptsBlock_price_table.prototype.columnChidrensWidthCalc=function(){ if(this.getParam('is_horisontal_row_type')!='1'){ return; } var $cols=this._getCols(true); $cols.each(function (ind, oneCol){ var currColumn=jQuery(oneCol) , emptyChilds=currColumn.find('.ptsTableElementContent').children(':not(:has(">div")):not(".ptsColBadge")') , level1Childs=currColumn.find('.ptsTableElementContent').children(':has(">div"):not(".ptsColBadge")') , level1ChildRows=currColumn.find('.ptsTableElementContent').children('.ptsRows') , level2ChildRows=level1ChildRows.children() , allChildCount=level1Childs.length , level2ChildCount=1; if(level1ChildRows.length > 0&&level2ChildRows.length > 0){ allChildCount +=level2ChildRows.length -1; level2ChildCount=level2ChildRows.length; } emptyChilds.css({ 'width': "0%", 'margin': '0', 'padding': '0', }); var oneChildWidth=Math.floor(95 / allChildCount); level1Childs.css('width', oneChildWidth + '%'); var widthInPixel=level1Childs.css('width'); level1ChildRows.css('width', (level2ChildCount*oneChildWidth+2) + '%'); level2ChildRows.css('width', widthInPixel); }); } ptsBlock_price_table.prototype.checkColWidthPerc=function(){ if(this.getParam('calc_width')==='table'){ this.setColWidthPerc(); }}; ptsBlock_price_table.prototype.setColWidthPerc=function(){ var $cols=this._getCols(parseInt(this.getParam('enb_desc_col'))); this.setColsWidth(100 / $cols.size(), true); }; ptsBlock_price_table.prototype.setTableWidth=function(width, measure){ if(width&&parseInt(width)){ width=parseInt(width); this.setParam('table_width', width); }else{ width=this.getParam('table_width'); } if(measure){ this.setParam('table_width_measure', measure); }else{ measure=this.getParam('table_width_measure'); } this._$.width(width+ measure); }; ptsBlock_price_table.prototype.setTableVertPadding=function(padding, measure){ if(padding&&parseInt(padding)){ padding=parseInt(padding); this.setParam('vert_padding', padding); }else{ padding=this.getParam('vert_padding'); } if(measure){ this.setParam('vert_padding_measure', measure); }else{ measure=this.getParam('vert_padding_measure'); } this._$.find('.ptsCol').css('paddingBottom', padding + 'px'); }; ptsBlock_price_table.prototype.setCalcWidth=function(type){ if(type){ this.setParam('calc_width', type); }else{ type=this.getParam('calc_width'); } switch(type){ case 'table': this.setTableWidth(); this.setColWidthPerc(); break; case 'col': var enb_desc_col=this.getParam('enb_desc_col')!=0 ? true:false; this._$.width(this._getCols(enb_desc_col).size() * this.getParam('col_width')); this.setColsWidth(this.getParam('col_width')); break; }}; ptsBlock_price_table.prototype._fixResponsive=function(){ if(this.getParam('is_horisontal_row_type')=='1'){ var $parent=this._$.parents('.ptsTableFrontedShell:first').parent() , parentWidth=$parent.width(); if(jQuery(window).width() < 600){ $parent.addClass('ptsResponcive'); }else{ $parent.removeClass('ptsResponcive'); } return; } var $parent=this._$.parents('.ptsTableFrontedShell:first').parent() , parentWidth=$parent.width() , widthMeasure=this.getParam('table_width_measure') , calcWidth=this.getParam('calc_width') , includeDesc=parseInt(this.getParam('enb_desc_col')) , $cols=this._getCols(includeDesc) , actualTblWidth=this._$.width() , criticalColWidth=isNaN(parseInt(this.getParam('resp_min_col_width'))) ? 150:parseInt(this.getParam('resp_min_col_width')) , dsblResponsive=parseInt(this.getParam('dsbl_responsive')); this._$.removeClass('ptsBlockMobile'); switch(calcWidth){ case 'table': switch(widthMeasure){ case '%': var self=this , removeOtherDescCol=function (){ if(!dsblResponsive && !_ptsIsEditMode() && self._$.find('.ptsTableDescCol').size() > 1 && includeDesc ){ var $descCols=self._$.find('.ptsTableDescCol') , firstCol=false; $descCols.each(function (){ var $this=jQuery(this); if(! firstCol){ firstCol=true; return; } $this.remove(); }); }}; $cols=this._getCols(includeDesc); var descColNum=$cols.filter('.ptsTableDescCol').length; var colsNum=$cols.length - (descColNum > 1 ? descColNum - 1:0) , currWidth=actualTblWidth / colsNum; if(currWidth <=criticalColWidth&&!dsblResponsive){ $cols.css('width', '100%'); if(!_ptsIsEditMode()&&includeDesc){ var $descColumn=this._$.find('.ptsTableDescCol').first() , $columns=this._$.find('.ptsCol:not(.ptsTableDescCol)') , firstCol=false; removeOtherDescCol(); var i=0; $columns.each(function (){ var $this=jQuery(this); if(! firstCol){ firstCol=true; return; } i++; var $descClone=$descColumn.clone(); $descClone.find('.tooltipstered[data-title]').removeClass('tooltipstered').each(function (){ var el=jQuery(this); el.attr('title', el.attr('data-title')).removeAttr('data-title'); }); $descClone.insertBefore($this); }); this._initTooltipsForCells(); this._isResponsiveDescInit=true; this._$.find('.ptsCol').css('width', '50%'); } this._$.addClass('ptsBlockMobile'); this.setParam('went_to_responsive', 1); }else{ removeOtherDescCol(); if(this.getParam('went_to_responsive')){ this.setColWidthPerc(); this.setParam('went_to_responsive', 0); }} break; case 'px': if(actualTblWidth > parentWidth){ this.setParam('went_to_responsive', this.getParam('table_width')); this.setTableWidth(100, '%'); this._fixResponsive(); }else if(this.getParam('went_to_responsive')){ this.setTableWidth(this.getParam('went_to_responsive'), 'px'); this.setParam('went_to_responsive', 0); } break; } break; case 'col': var colsNum=$cols.size() , currWidth=parseFloat(this.getParam('col_width')); if(currWidth * colsNum >=parentWidth){ this.setParam('went_to_responsive', currWidth); this.setParam('table_width', 100); this.setParam('table_width_measure', '%'); this.setCalcWidth('table'); this._fixResponsive(); }else if(this.getParam('went_to_responsive')){ this.setCalcWidth('col'); this.setParam('col_width', this.getParam('went_to_responsive')); this.setParam('went_to_responsive', 0); } break; }}; ptsBlock_price_table.prototype._refreshCellsHeight=function(){ var $cols=this._getCols(true) , self=this , sizes=this.getMaxColsSizes(true); $cols.each(function(){ for(var key in sizes){ var $entity=jQuery(this).find(sizes[ key ].sel); if(self.getParam('is_horisontal_row_type')=='1'){ $entity.css({'height': 'auto'}); }else{ if(key=='rows'){ $entity.css({'height': 'auto'}); continue; } if($entity&&$entity.size()){ if(key=='cells'){ var cellNum=0; $entity.each(function(){ jQuery(this).css('height', sizes[ key ].height[ cellNum ]); cellNum++; }); }else{ $entity.outerHeight(sizes[ key ].height); if($entity.outerHeight()!=sizes[ key ].height){ $entity.css('height', sizes[ key ].height); }} }} }}); }; function ptsElementBase(jqueryHtml, block){ this._iterNum=0; this._id='el_'+ mtRand (1, 999999); this._animationSpeed=g_ptsAnimationSpeed; this._$=jqueryHtml; this._block=block; if(typeof(this._menuOriginalId)==='undefined'){ this._menuOriginalId=''; } this._innerImgsCount=0; this._innerImgsLoaded=0; this._menu=null; this._menuClbs={}; if(typeof(this._menuClass)==='undefined'){ this._menuClass='ptsElementMenu'; } this._menuOnBottom=false; this._code='base'; this._initedComplete=false; this._editArea=null; if(typeof(this._isMovable)==='undefined'){ this._isMovable=false; } this._moveHandler=null; this._sortInProgress=false; if(typeof(this._showMenuEvent)==='undefined'){ this._showMenuEvent='click'; } if(typeof(this._changeable)==='undefined'){ this._changeable=false; } if(g_ptsEdit){ this._init(); this._initMenuClbs(); this._initMenu(); var images=this._$.find('img'); if(images&&(this._innerImgsCount=images.size())){ this._innerImgsLoaded=0; var self=this; images.load(function(){ self._innerImgsLoaded++; if(self._$.find('img').size()==self._innerImgsLoaded){ self._afterFullContentLoad(); }}); }} this._onlyFirstHtmlInit(); this._initedComplete=true; } ptsElementBase.prototype.getId=function(){ return this._id; }; ptsElementBase.prototype.getBlock=function(){ return this._block; }; ptsElementBase.prototype._onlyFirstHtmlInit=function(){ if(this._$&&!this._$.data('first-inited')){ this._$.data('first-inited', 1); return true; } return false; }; ptsElementBase.prototype.setIterNum=function(num){ this._iterNum=num; this._$.data('iter-num', num); }; ptsElementBase.prototype.getIterNum=function(){ return this._iterNum; }; ptsElementBase.prototype.$=function(){ return this._$; }; ptsElementBase.prototype.getCode=function(){ return this._code; }; ptsElementBase.prototype._setCode=function(code){ this._code=code; }; ptsElementBase.prototype._init=function(){ this._beforeInit(); }; ptsElementBase.prototype._beforeInit=function(){ }; ptsElementBase.prototype.destroy=function(){ }; ptsElementBase.prototype.get=function(opt){ return jQuery('
').html(this._$.attr('data-'+ opt)).text(); }; ptsElementBase.prototype.set=function(opt, val){ this._$.attr('data-'+ opt, jQuery('
').text(val).html()); }; ptsElementBase.prototype._getEditArea=function(){ if(!this._editArea||this._$.attr('data-reset')=='1'){ this._editArea=this._$.children('.ptsElArea'); if(!this._editArea.size()){ this._editArea=this._$.find('.ptsInputShell'); this._$.removeAttr('data-reset'); }} return this._editArea; }; ptsElementBase.prototype._getOverlay=function(){ return this._$.find('.ptsElOverlay'); }; function ptsElement_btn(jqueryHtml, block){ if(typeof(this._menuOriginalId)==='undefined'){ this._menuOriginalId='ptsElMenuBtnExl'; } this._menuClass='ptsElementMenu_btn'; this._haveAdditionBgEl=null; this._changeable=true; this.includePostLinks=true; ptsElement_btn.superclass.constructor.apply(this, arguments); } extendPts(ptsElement_btn, ptsElementBase); ptsElement_btn.prototype._onlyFirstHtmlInit=function(){ if(ptsElement_btn.superclass._onlyFirstHtmlInit.apply(this, arguments)){ if(this.get('customhover-clb')){ var clbName=this.get('customhover-clb'); if(typeof(this[clbName])==='function'){ var self=this; this._getEditArea().hover(function(){ self[clbName](true, this); }, function(){ self[clbName](false, this); }); }} }}; ptsElement_btn.prototype._hoverChangeFontColor=function(hover, element){ if(hover){ jQuery(element) .data('original-color', this._getEditArea().css('color')) .css('color', jQuery(element).parents('.ptsEl:first').attr('data-bgcolor')); }else{ jQuery(element) .css('color', jQuery(element).data('original-color')); }}; ptsElement_btn.prototype._hoverChangeBgColor=function(hover, element){ var parentElement=jQuery(element).parents('.ptsEl:first'); if(hover){ parentElement .data('original-color', parentElement.css('background-color')) .css('background-color', parentElement.attr('data-bgcolor')); }else{ parentElement .css('background-color', parentElement.data('original-color')); }}; ptsElement_btn.prototype._hoverBorderColor=function(hover, element){ if(hover){ jQuery(element) .data('original-color', jQuery(element).css('border-color')) .css('border-color', jQuery(element).parents('.ptsEl:first').attr('data-bgcolor')); }else{ jQuery(element) .css('border-color', jQuery(element).data('original-color')); }}; function ptsElement_table_col(jqueryHtml, block){ if(typeof(this._menuOriginalId)==='undefined'){ this._menuOriginalId='ptsElMenuTableColExl'; } if(typeof(this._menuClass)==='undefined'){ this._menuClass='ptsElementMenu_table_col'; } if(typeof(this._isMovable)==='undefined'){ this._isMovable=true; } this._showMenuEvent='hover'; this._colNum=0; ptsElement_table_col.superclass.constructor.apply(this, arguments); } extendPts(ptsElement_table_col, ptsElementBase); ptsElement_table_col.prototype.setIterNum=function(){ ptsElement_table_col.superclass.setIterNum.apply(this, arguments); if(!g_ptsEdit&&typeof(ptsScheduleCheck)!=='undefined'){ ptsScheduleCheck(this); }}; function ptsElement_table_col_desc(jqueryHtml, block){ this._isMovable=false; ptsElement_table_col_desc.superclass.constructor.apply(this, arguments); /*this.getBlock().$().bind('ptsBlockContentChanged', function(){ self.refreshHeight(); });*/ } extendPts(ptsElement_table_col_desc, ptsElement_table_col); /*ptsElement_table_col_desc.prototype.refreshHeight=function(){ var sizes=this.getBlock().getMaxColsSizes(); for(var key in sizes){ var $entity=this._$.find(sizes[ key ].sel); if($entity&&$entity.size()){ if(key=='cells'&&sizes[ key ].height){ var cellNum=0; $entity.each(function(){ if(typeof(sizes[ key ].height[ cellNum ])!=='undefined'){ jQuery(this).css('height', sizes[ key ].height[ cellNum ]); } cellNum++; }); }else{ $entity.css('height', sizes[ key ].height); }} }};*/ function ptsElement_table_cell_txt(jqueryHtml, block){ if(block.getParam('responsive_text')){ jqueryHtml.find('span, p').responsiveText({ minFontSize: 14 }); } this.includePostLinks=true; ptsElement_table_cell_txt.superclass.constructor.apply(this, arguments); } extendPts(ptsElement_table_cell_txt, ptsElementBase); (function ($){ 'use strict'; $.fn.sModal=function(options){ var self=this, settings=$.extend({ width: 640, height: 480, buttons: [], }, options), $modalOverlay, $modalContainer, $closeModalButton, $modalContent, $modalButtons, modalOverlayStyle={ position: 'fixed', top: 0, left: 0, background: 'rgba(0,0,0,.75)', width: '100%', height: '100%', 'z-index': '100000', display: 'none', 'overflow-y': 'auto', }, modalContainerStyle={ width: settings.width, position: 'absolute', top: '50%', left: '50%', 'max-width': 'calc(100% - 1.5em)', 'margin-right': '-50%', 'margin-bottom': '20px', transform: 'translate(-50%, -50%)', background: '#fff', padding: '1em', }, modalContentStyle={ height: 'calc(100% - 3.6em)', 'overflow-y': 'auto', 'overflow-x': 'hidden', padding: '1em', }, closeButtonStyle={ position: 'absolute', right: '10px', top: '10px', 'font-size': '35px', color: '#fff', cursor: 'pointer', }, modalButtonsStyle={ position: 'relative', width: '100%', 'text-align': 'right', 'margin-top': '1em', }; function closeModal(){ self.trigger('close.before'); if(jQuery('.sModal:visible').length < 2){ jQuery('body').css('overflow', 'auto'); } $modalOverlay.fadeOut(); self.trigger('close.after'); } function openModal(){ jQuery('body').css('overflow', 'hidden'); $modalOverlay.show(0, function(){ resizeModal(); $modalOverlay.hide().fadeIn(); }); if(parseInt(jQuery('.sc-modal-container').css('top')) > jQuery(window).height()){ var offset=jQuery(window).height() / 2 + 40; jQuery('.sc-modal-container').css('top' , offset); }} function resizeModal(){ var offset='50%'; if($modalContainer.height() > jQuery(window).height()){ offset=$modalContainer.height() / 2 + 40; } $modalContainer.css('top', offset); } function createInstance($modalTemplate){ $modalOverlay=jQuery('
').css(modalOverlayStyle); $modalContainer=jQuery('
').css(modalContainerStyle); $closeModalButton=jQuery('
×
').css(closeButtonStyle); $closeModalButton.appendTo($modalOverlay); $modalContent=jQuery('
').css(modalContentStyle); $modalContent.appendTo($modalContainer); $modalTemplate.appendTo($modalContent).show(); $modalContainer.appendTo($modalOverlay); $modalOverlay.appendTo('body'); $modalOverlay.add($closeModalButton).on('click', function(event){ if(jQuery(this).is(jQuery(event.target))){ closeModal(); }}); jQuery(document).on('keyup', function(event){ if(event.which==27&&$modalOverlay.is(':visible')){ closeModal(); }}); var resizeTimer; jQuery(window).on('resize', function(event){ clearTimeout(resizeTimer); resizeTimer=setTimeout(function(){ resizeModal(); }, 250); }); if(settings.buttons.length > 0){ $modalButtons=jQuery('
').css(modalButtonsStyle); for (var i=0; i < settings.buttons.length; i++){ jQuery('