function isBotCrawler(){var n=new RegExp("(googlebot/|Googlebot-Mobile|Googlebot-Image|Google favicon|Mediapartners-Google|bingbot|slurp|java|wget|curl|Commons-HttpClient|Python-urllib|libwww|httpunit|nutch|phpcrawl|msnbot|jyxobot|FAST-WebCrawler|FAST Enterprise Crawler|biglotron|teoma|convera|seekbot|gigablast|exabot|ngbot|ia_archiver|GingerCrawler|webmon |httrack|webcrawler|grub.org|UsineNouvelleCrawler|antibot|netresearchserver|speedy|fluffy|bibnum.bnf|findlink|msrbot|panscient|yacybot|AISearchBot|IOI|ips-agent|tagoobot|MJ12bot|dotbot|woriobot|yanga|buzzbot|mlbot|yandexbot|purebot|Linguee Bot|Voyager|CyberPatrol|voilabot|baiduspider|citeseerxbot|spbot|twengabot|postrank|turnitinbot|scribdbot|page2rss|sitebot|linkdex|Adidxbot|blekkobot|ezooms|dotbot|Mail.RU_Bot|discobot|heritrix|findthatfile|europarchive.org|NerdByNature.Bot|sistrix crawler|ahrefsbot|Aboundex|domaincrawler|wbsearchbot|summify|ccbot|edisterbot|seznambot|ec2linkfinder|gslfbot|aihitbot|intelium_bot|facebookexternalhit|yeti|RetrevoPageAnalyzer|lb-spider|sogou|lssbot|careerbot|wotbox|wocbot|ichiro|DuckDuckBot|lssrocketcrawler|drupact|webcompanycrawler|acoonbot|openindexspider|gnam gnam spider|web-archive-net.com.bot|backlinkcrawler|coccoc|integromedb|content crawler spider|toplistbot|seokicks-robot|it2media-domain-crawler|ip-web-crawler.com|siteexplorer.info|elisabot|proximic|changedetection|blexbot|arabot|WeSEE:Search|niki-bot|CrystalSemanticsBot|rogerbot|360Spider|psbot|InterfaxScanBot|Lipperhey SEO Service|CC Metadata Scaper|g00g1e.net|GrapeshotCrawler|urlappendbot|brainobot|fr-crawler|binlar|SimpleCrawler|Livelapbot|Twitterbot|cXensebot|smtbot|bnf.fr_bot|A6-Indexer|ADmantX|Facebot|Twitterbot|OrangeBot|memorybot|AdvBot|MegaIndex|SemanticScholarBot|ltx71|nerdybot|xovibot|BUbiNG|Qwantify|archive.org_bot|Applebot|TweetmemeBot|crawler4j|findxbot|SemrushBot|yoozBot|lipperhey|y!j-asr|Domain Re-Animator Bot|AddThis)","i"),t=navigator.userAgent;return n.test(t)?!0:!1}function noDuplicateFormSubmit(n){$(n).submit(function(){var n=$(this),t=n.attr("id"),f=!1,e,o,i,r,u;if(t==="bookaTourForm"&&$("#locationInterested").length&&(e=n.find("#locationInterested select option:selected").val(),o=n.find("#locationInterested select option:selected").attr("disabled")===undefined,!e||!o))return i=".locationErrorDrop span.field-validation-valid",r=".locationErrorDrop span.field-validation-error",n.find(r).length===0&&n.find("#Location").val()&&(n.find(".locationErrorDrop").css({display:"block"}),n.find(i).addClass("field-validation-error"),n.find(i).removeClass("field-validation-valid"),n.find(r).html("<span for='potential-centre-options' class=''>"+$("#preselected-centre-error").val()+"<\/span>")),!1;t==="centreQuickquoteForm"||t==="centreBookaTourForm"||t==="crystalCentreBookaTourForm"||t==="crystalCentreQuickquoteForm"||t==="ppcBrandLpTopForm"||t==="ppcBrandLpBottomForm"?(u=n.find("button.DropdownFormProductsVal"),n.find("input#ProductType").val()?u.removeClass("input-validation-error"):u.addClass("input-validation-error")):n.find("button.DropdownFormProductsVal").length&&!n.find(".form-dropdown-wrapper").find("input").val()?n.find("button.DropdownFormProductsVal").css({color:"#c90c0f","background-color":"#fdd9dd"}):t==="NextStepsForm"?n.find("button.DropdownFormProductsVal").css({color:"#939696","background-color":"#fff"}):n.find("button.DropdownFormProductsVal").css({color:"#000","background-color":"#e8e8e8"});$.each(n.find("input[type=text][data-val-phonenumberformat]"),function(n,t){if($(t).data("WaitingForAsyncPhoneValidation"))return f=!0,!1});!f&&n.valid()&&($(":submit",n).prop("disabled",!0),document.cookie.indexOf("AnyOfForms=submitted")===-1&&(document.cookie="AnyOfForms=submitted; path=/"),t==="bookATourCnInline"&&loader("#"+n.attr("id")))})}function InfoBox(n){n=n||{};google.maps.OverlayView.apply(this,arguments);this.content_=n.content||"";this.disableAutoPan_=n.disableAutoPan||!1;this.maxWidth_=n.maxWidth||0;this.pixelOffset_=n.pixelOffset||new google.maps.Size(0,0);this.position_=n.position||new google.maps.LatLng(0,0);this.zIndex_=n.zIndex||null;this.boxClass_=n.boxClass||"infoBox";this.boxStyle_=n.boxStyle||{};this.closeBoxMargin_=n.closeBoxMargin||"2px";this.closeBoxURL_=n.closeBoxURL||"http://www.google.com/intl/en_us/mapfiles/close.gif";n.closeBoxURL===""&&(this.closeBoxURL_="");this.infoBoxClearance_=n.infoBoxClearance||new google.maps.Size(1,1);typeof n.visible=="undefined"&&(n.visible=typeof n.isHidden=="undefined"?!0:!n.isHidden);this.isHidden_=!n.visible;this.alignBottom_=n.alignBottom||!1;this.pane_=n.pane||"floatPane";this.enableEventPropagation_=n.enableEventPropagation||!1;this.div_=null;this.closeListener_=null;this.moveListener_=null;this.contextListener_=null;this.eventListeners_=null;this.fixedWidthSet_=null}function addCentreImagesUrls(n){var r,u,e;if(n){var o=$(".image-url-list-"+n),f=o.data(),t=f.urls,s=f.urlTemplate,h=f.predefinedUrlTemplate,i=f.predefined;if(t&&t.length)for(r=0;r<t.length;r++)t[r]=s+t[r];if(i&&i.length)for(u=0;u<i.length;u++)i[u]=h+i[u];e=(t||[]).concat(i||[]);applyLiqiudPixel(e);applyCarousel(o,e);$(".loc-horiz-centrimg-arrow").addClass("tilearrowsshow")}}function initCenterImageUrlsAjax(n,t){var r=n.find(".image-url-list-"+t.CenterNumber),i=t.ImageUrls;applyLiqiudPixel(i);applyCarousel(r,i);$(".loc-horiz-centrimg-arrow").addClass("tilearrowsshow")}function applyLiqiudPixel(n){var u=$("#liquid-pixel")&&$("#liquid-pixel").length,i,r,t;if(u)for(i=$(".city_opt_img").width(),r=$(".city_opt_img").height(),t=0;t<n.length;t++)n[t]+="?sz="+i+"x"+r+"&qlt=80"}function applyCarousel(n,t){var e=n.closest(".horizv-map-centrescards"),i=e.find(".city_opt_img img"),o=e.find(".back"),s=e.find(".fwd"),r,u,f;i.attr("data-src",t[0]);i.addClass("lazyload");s.on("click",function(){r=+i.data("img-active");u=r+1;u>t.length?(i.attr("src",t[0]),i.data("img-active","0")):(i.attr("src",t[u]),i.data("img-active",""+u+""))});o.on("click",function(){r=+i.data("img-active");f=r-1;f<0?(i.attr("src",t[t.length-1]),i.data("img-active",""+t.length-1+"")):(i.attr("src",t[f]),i.data("img-active",""+f+""))})}function extend(n,t){var i=t.split("."),u=n,f,r;for(i[0]=="nwp"&&(i=i.slice(1)),f=i.length,r=0;r<f;r++)typeof u[i[r]]=="undefined"&&(u[i[r]]={}),u=u[i[r]];return u}function addChinaToCountryAndTranslateIfQueryIsInChinese(n,t){var u=n.split(", "),r=u[0],i=u[1];return t?i=/[\u3400-\u9FBF]/.test(t)?chineseCountryMappings[i]||i:englishCountryMappings[i]||i:(r=chineseCityMappings[r]||r,i=chineseCountryMappings[i]||i),[r,i].join(", ")}function convertNumbersToSpecificFormat(n,t){var u,f,e,o,i,r,s,h;if(!n)return"";for(typeof t=="undefined"&&(t=$("body").data("iseasternumbers")),u=["0","1","2","3","4","5","6","7","8","9"],f=["٠","١","٢","٣","٤","٥","٦","٧","٨","٩"],t?(e=u,o=f):(e=f,o=u),i="",r=0;r<n.length;r++)s=n[r],h=e.indexOf(s),i=h>=0?i+o[h]:i+s;return i}function afterModalShown(n){if(navigator.appName=="Microsoft Internet Explorer"||!!(navigator.userAgent.match(/Trident/)||navigator.userAgent.match(/rv:11/))||typeof $.browser!="undefined"&&$.browser.msie==1){var t=$(n.target).find("form"),i=t.find("input[type=text]").filter(":visible");i.each(function(){$(this).attr("id")!=="ProductType"&&$(this).attr("id")!="ecomWidgetPeople"&&$(this).val("")})}dataFillElements.updateDataFillElements(n);nwp.locationAutocomplete.initLocationAutocomplete(n)}function loader(n){$(n+" input[type=submit]").prop("disabled",!0);$(n+" .form-loader").show()}function leadIdToDataLayer(n,t){window.dataLayer=window.dataLayer||[];dataLayer.push({event:"Lead Submitted",leadid:n,URL:t})}function trackEcommerceStep(n,t){window.dataLayer=window.dataLayer||[];dataLayer.push({event:"VirtualPageview",virtualPageURL:t,virtualPageTitle:n})}function trackEcommerceEvent(n,t){window.dataLayer=window.dataLayer||[];dataLayer.push({event:n,eventCategory:"Button",eventAction:"Click",eventLabel:t})}function trackAuthEvent(n){window.dataLayer=window.dataLayer||[];dataLayer.push({event:"authentication",userId:n})}function equalizeHeights(n,t){var i=[],r;if(t&&t.reset)return $(n).each(function(){$(this).css("min-height","");$(this).css("max-height","");$(this).css("height","")}),!1;$(n).each(function(){$(this).css("min-height","0");$(this).css("max-height","none");$(this).css("height","auto");i.push($(this).outerHeight())});r=Math.max.apply(Math,i);$(n).each(function(){$(this).css(t&&t.optimize?"min-height":"height",r+"px")})}function loadCentreImage(){$("img.centre-image").each(function(){var t=$(this).data("centrenumber"),i=$(this).data("product"),r="/api/search/centres/image/"+t+"/product/"+i,n=$(this);$.ajax({url:r,type:"GET",context:n,success:function(t){n.attr("src",t)}})})}var dataFillElements,nwp;(function(n){function t(t){var i={};return{getItem:function(r){try{return n[t].getItem(r)}catch(u){return i[r]}},setItem:function(r,u){try{n[t].setItem(r,u)}catch(f){i[r]=u}},removeItem:function(r){try{n[t].removeItem(r)}catch(u){}delete i[r]}}}n.nwp=n.nwp||{};n.nwp.sessionStorage=n.nwp.sessionStorage||t("sessionStorage");n.nwp.localStorage=n.nwp.localStorage||t("localStorage")})(window);!function(n,t){"use strict";function f(r,f,e,o,s){function it(){ut=n.devicePixelRatio>1;e=rt(e);f.delay>=0&&setTimeout(function(){p(!0)},f.delay);(f.delay<0||f.combined)&&(o.e=lt(f.throttle,function(n){"resize"===n.type&&(w=b=-1);p(n.all)}),o.a=function(n){n=rt(n);e.push.apply(e,n)},o.g=function(){return e=i(e).filter(function(){return!i(this).data(f.loadedName)})},o.f=function(n){for(var i,t=0;t<n.length;t++)i=e.filter(function(){return this===n[t]}),i.length&&p(!1,i)},p(),i(f.appendScroll).on("scroll."+s+" resize."+s,o.e))}function rt(n){var v=f.defaultImage,p=f.placeholder,k=f.imageBase,s=f.srcsetAttribute,c=f.loaderAttribute,a=f._f||{},e,w;for(n=i(n).filter(function(){var n=i(this),r=g(this);return!n.data(f.handledName)&&(n.attr(f.attribute)||n.attr(s)||n.attr(c)||a[r]!==t)}).data("plugin_"+f.name,r),e=0,w=n.length;e<w;e++){var u=i(n[e]),o=g(n[e]),b=u.attr(f.imageBaseAttribute)||k;o===l&&b&&u.attr(s)&&u.attr(s,ct(u.attr(s),b));a[o]===t||u.attr(c)||u.attr(c,a[o]);o===l&&v&&!u.attr(h)?u.attr(h,v):o===l||!p||u.css(y)&&"none"!==u.css(y)||u.css(y,"url('"+p+"')")}return n}function p(n,t){if(!e.length)return void(f.autoDestroy&&r.destroy());for(var s=t||e,w=!1,nt=f.imageBase||"",b=f.srcsetAttribute,c=f.handledName,o=0;o<s.length;o++)if(n||t||ot(s[o])){var u=i(s[o]),a=g(s[o]),v=u.attr(f.attribute),p=u.attr(f.imageBaseAttribute)||nt,d=u.attr(f.loaderAttribute);!u.data(c)&&(!f.visibleOnly||u.is(":visible"))&&((v||u.attr(b))&&(a===l&&(p+v!==u.attr(h)||u.attr(b)!==u.attr(k))||a!==l&&p+v!==u.css(y))||d)&&(w=!0,u.data(c,!0),et(u,a,p,d))}w&&(e=i(e).filter(function(){return!i(this).data(c)}))}function et(n,t,r,u){var o,s,e,w;++tt;o=function(){c("onError",n);nt();o=i.noop};c("beforeLoad",n);var b=f.attribute,g=f.srcsetAttribute,p=f.sizesAttribute,it=f.retinaAttribute,rt=f.removeAttribute,et=f.loadedName,ot=n.attr(it);if(u)s=function(){rt&&n.removeAttr(f.loaderAttribute);n.data(et,!0);c(ft,n);setTimeout(nt,1);s=i.noop},n.off(v).one(v,o).one(a,s),c(u,n,function(t){t?(n.off(a),s()):(n.off(v),o())})||n.trigger(v);else{e=i(new Image);e.one(v,o).one(a,function(){n.hide();t===l?n.attr(d,e.attr(d)).attr(k,e.attr(k)).attr(h,e.attr(h)):n.css(y,"url('"+e.attr(h)+"')");n[f.effect](f.effectTime);rt&&(n.removeAttr(b+" "+g+" "+it+" "+f.imageBaseAttribute),p!==d&&n.removeAttr(p));n.data(et,!0);c(ft,n);e.remove();nt()});w=(ut&&ot?ot:n.attr(b))||"";e.attr(d,n.attr(p)).attr(k,n.attr(g)).attr(h,w?r+w:null);e.complete&&e.trigger(a)}}function ot(n){var t=n.getBoundingClientRect(),r=f.scrollDirection,i=f.threshold,u=ht()+i>t.top&&-i<t.bottom,e=st()+i>t.left&&-i<t.right;return"vertical"===r?u:"horizontal"===r?e:u&&e}function st(){return w>=0?w:w=i(n).width()}function ht(){return b>=0?b:b=i(n).height()}function g(n){return n.tagName.toLowerCase()}function ct(n,t){var r,i,u;if(t)for(r=n.split(","),n="",i=0,u=r.length;i<u;i++)n+=t+r[i].trim()+(i!==u-1?",":"");return n}function lt(n,t){var i,u=0;return function(e,o){function s(){u=+new Date;t.call(r,e)}var h=+new Date-u;i&&clearTimeout(i);h>n||!f.enableThrottle||o?s():i=setTimeout(s,n-h)}}function nt(){--tt;e.length||tt||c("onFinishedAll")}function c(n){return!!(n=f[n])&&(n.apply(r,[].slice.call(arguments,1)),!0)}var tt=0,w=-1,b=-1,ut=!1,ft="afterLoad",a="load",v="error",l="img",h="src",k="srcset",d="sizes",y="background-image";"event"===f.bind||u?it():i(n).on(a+"."+s,it)}function r(r,u){var o=this,h=i.extend({},o.config,u),s={},c=h.name+"-"+ ++e;return o.config=function(n,i){return i===t?h[n]:(h[n]=i,o)},o.addItems=function(n){return s.a&&s.a("string"===i.type(n)?i(n):n),o},o.getItems=function(){return s.g?s.g():{}},o.update=function(n){return s.e&&s.e({},!n),o},o.force=function(n){return s.f&&s.f("string"===i.type(n)?i(n):n),o},o.loadAll=function(){return s.e&&s.e({all:!0},!0),o},o.destroy=function(){return i(h.appendScroll).off("."+c,s.e),i(n).off("."+c),s={},t},f(o,h,r,s,c),h.chainable?r:o}var i=n.jQuery||n.Zepto,e=0,u=!1;i.fn.Lazy=i.fn.lazy=function(n){return new r(this,n)};i.Lazy=i.lazy=function(n,u,f){var s,h;if(i.isFunction(u)&&(f=u,u=[]),i.isFunction(f)){n=i.isArray(n)?n:[n];u=i.isArray(u)?u:[u];for(var e=r.prototype.config,c=e._f||(e._f={}),o=0,l=n.length;o<l;o++)(e[n[o]]===t||i.isFunction(e[n[o]]))&&(e[n[o]]=f);for(s=0,h=u.length;s<h;s++)c[u[s]]=n[0]}};r.prototype.config={name:"lazy",chainable:!0,autoDestroy:!0,bind:"load",threshold:500,visibleOnly:!1,appendScroll:n,scrollDirection:"both",imageBase:null,defaultImage:"data:image/gif;base64,R0lGODlhAQABAIAAAP///wAAACH5BAEAAAAALAAAAAABAAEAAAICRAEAOw==",placeholder:null,delay:-1,combined:!1,attribute:"data-src",srcsetAttribute:"data-srcset",sizesAttribute:"data-sizes",retinaAttribute:"data-retina",loaderAttribute:"data-loader",imageBaseAttribute:"data-imagebase",removeAttribute:!0,handledName:"handled",loadedName:"loaded",effect:"show",effectTime:0,enableThrottle:!0,throttle:250,beforeLoad:t,afterLoad:t,onError:t,onFinishedAll:t};i(n).on("load",function(){u=!0})}(window);$(function(){if($("#products-main-menulistid").length&&$(".productdropdImageLazy").length)$("#products-main-menulistid").one("hover mouseover click focus",function(){$(".productdropdImageLazy").lazy()})});InfoBox.prototype=typeof google!="undefined"&&typeof window.google.maps!="undefined"?new google.maps.OverlayView:{};InfoBox.prototype.createInfoBoxDiv_=function(){var n,t,i,u=this,r=function(n){n.cancelBubble=!0;n.stopPropagation&&n.stopPropagation()},f=function(n){n.returnValue=!1;n.preventDefault&&n.preventDefault();u.enableEventPropagation_||r(n)};if(!this.div_){if(this.div_=document.createElement("div"),this.setBoxStyle_(),typeof this.content_.nodeType=="undefined"?this.div_.innerHTML=this.getCloseBoxImg_()+this.content_:(this.div_.innerHTML=this.getCloseBoxImg_(),this.div_.appendChild(this.content_)),this.getPanes()[this.pane_].appendChild(this.div_),this.addClickHandler_(),this.div_.style.width?this.fixedWidthSet_=!0:this.maxWidth_!==0&&this.div_.offsetWidth>this.maxWidth_?(this.div_.style.width=this.maxWidth_,this.div_.style.overflow="auto",this.fixedWidthSet_=!0):(i=this.getBoxWidths_(),this.div_.style.width=this.div_.offsetWidth-i.left-i.right+"px",this.fixedWidthSet_=!1),this.panBox_(this.disableAutoPan_),!this.enableEventPropagation_){for(this.eventListeners_=[],t=["mousedown","mouseover","mouseout","mouseup","click","dblclick","touchstart","touchend","touchmove"],n=0;n<t.length;n++)this.eventListeners_.push(google.maps.event.addDomListener(this.div_,t[n],r));this.eventListeners_.push(google.maps.event.addDomListener(this.div_,"mouseover",function(){this.style.cursor="default"}))}this.contextListener_=google.maps.event.addDomListener(this.div_,"contextmenu",f);google.maps.event.trigger(this,"domready")}};InfoBox.prototype.getCloseBoxImg_=function(){var n="";return this.closeBoxURL_!==""&&(n="<img",n+=" src='"+this.closeBoxURL_+"'",n+=" alt=''",n+=" align=right",n+=" style='",n+=" position: relative;",n+=" cursor: pointer;",n+=" margin: "+this.closeBoxMargin_+";",n+="'>"),n};InfoBox.prototype.addClickHandler_=function(){var n;this.closeBoxURL_!==""?(n=this.div_.firstChild,this.closeListener_=google.maps.event.addDomListener(n,"click",this.getCloseClickHandler_())):this.closeListener_=null};InfoBox.prototype.getCloseClickHandler_=function(){var n=this;return function(t){t.cancelBubble=!0;t.stopPropagation&&t.stopPropagation();google.maps.event.trigger(n,"closeclick");n.close()}};InfoBox.prototype.panBox_=function(n){var i,y,e=0,f=0,p;if(!n&&(i=this.getMap(),i instanceof google.maps.Map)){i.getBounds().contains(this.position_)||i.setCenter(this.position_);y=i.getBounds();var l=i.getDiv(),a=l.offsetWidth,o=l.offsetHeight,s=this.pixelOffset_.width,r=this.pixelOffset_.height,v=this.div_.offsetWidth,h=this.div_.offsetHeight,c=this.infoBoxClearance_.width,u=this.infoBoxClearance_.height,t=this.getProjection().fromLatLngToContainerPixel(this.position_);t.x<-s+c?e=t.x+s-c:t.x+v+s+c>a&&(e=t.x+v+s+c-a);this.alignBottom_?t.y<-r+u+h?f=t.y+r-u-h:t.y+r+u>o&&(f=t.y+r+u-o):t.y<-r+u?f=t.y+r-u:t.y+h+r+u>o&&(f=t.y+h+r+u-o);e===0&&f===0||(p=i.getCenter(),i.panBy(e,f))}};InfoBox.prototype.setBoxStyle_=function(){var n,t;if(this.div_){this.div_.className=this.boxClass_;this.div_.style.cssText="";t=this.boxStyle_;for(n in t)t.hasOwnProperty(n)&&(this.div_.style[n]=t[n]);this.div_.style.WebkitTransform="translateZ(0)";typeof this.div_.style.opacity!="undefined"&&this.div_.style.opacity!==""&&(this.div_.style.MsFilter='"progid:DXImageTransform.Microsoft.Alpha(Opacity='+this.div_.style.opacity*100+')"',this.div_.style.filter="alpha(opacity="+this.div_.style.opacity*100+")");this.div_.style.position="absolute";this.div_.style.visibility="hidden";this.zIndex_!==null&&(this.div_.style.zIndex=this.zIndex_)}};InfoBox.prototype.getBoxWidths_=function(){var i,n={top:0,bottom:0,left:0,right:0},t=this.div_;return document.defaultView&&document.defaultView.getComputedStyle?(i=t.ownerDocument.defaultView.getComputedStyle(t,""),i&&(n.top=parseInt(i.borderTopWidth,10)||0,n.bottom=parseInt(i.borderBottomWidth,10)||0,n.left=parseInt(i.borderLeftWidth,10)||0,n.right=parseInt(i.borderRightWidth,10)||0)):document.documentElement.currentStyle&&t.currentStyle&&(n.top=parseInt(t.currentStyle.borderTopWidth,10)||0,n.bottom=parseInt(t.currentStyle.borderBottomWidth,10)||0,n.left=parseInt(t.currentStyle.borderLeftWidth,10)||0,n.right=parseInt(t.currentStyle.borderRightWidth,10)||0),n};InfoBox.prototype.onRemove=function(){this.div_&&(this.div_.parentNode.removeChild(this.div_),this.div_=null)};InfoBox.prototype.draw=function(){this.createInfoBoxDiv_();var n=this.getProjection().fromLatLngToDivPixel(this.position_);this.div_.style.left=n.x+this.pixelOffset_.width+"px";this.alignBottom_?this.div_.style.bottom=-(n.y+this.pixelOffset_.height)+"px":this.div_.style.top=n.y+this.pixelOffset_.height+"px";this.div_.style.visibility=this.isHidden_?"hidden":"visible"};InfoBox.prototype.setOptions=function(n){typeof n.boxClass!="undefined"&&(this.boxClass_=n.boxClass,this.setBoxStyle_());typeof n.boxStyle!="undefined"&&(this.boxStyle_=n.boxStyle,this.setBoxStyle_());typeof n.content!="undefined"&&this.setContent(n.content);typeof n.disableAutoPan!="undefined"&&(this.disableAutoPan_=n.disableAutoPan);typeof n.maxWidth!="undefined"&&(this.maxWidth_=n.maxWidth);typeof n.pixelOffset!="undefined"&&(this.pixelOffset_=n.pixelOffset);typeof n.alignBottom!="undefined"&&(this.alignBottom_=n.alignBottom);typeof n.position!="undefined"&&this.setPosition(n.position);typeof n.zIndex!="undefined"&&this.setZIndex(n.zIndex);typeof n.closeBoxMargin!="undefined"&&(this.closeBoxMargin_=n.closeBoxMargin);typeof n.closeBoxURL!="undefined"&&(this.closeBoxURL_=n.closeBoxURL);typeof n.infoBoxClearance!="undefined"&&(this.infoBoxClearance_=n.infoBoxClearance);typeof n.isHidden!="undefined"&&(this.isHidden_=n.isHidden);typeof n.visible!="undefined"&&(this.isHidden_=!n.visible);typeof n.enableEventPropagation!="undefined"&&(this.enableEventPropagation_=n.enableEventPropagation);this.div_&&this.draw()};InfoBox.prototype.setContent=function(n){this.content_=n;this.div_&&(this.closeListener_&&(google.maps.event.removeListener(this.closeListener_),this.closeListener_=null),this.fixedWidthSet_||(this.div_.style.width=""),typeof n.nodeType=="undefined"?this.div_.innerHTML=this.getCloseBoxImg_()+n:(this.div_.innerHTML=this.getCloseBoxImg_(),this.div_.appendChild(n)),this.fixedWidthSet_||(this.div_.style.width=this.div_.offsetWidth+"px",typeof n.nodeType=="undefined"?this.div_.innerHTML=this.getCloseBoxImg_()+n:(this.div_.innerHTML=this.getCloseBoxImg_(),this.div_.appendChild(n))),this.addClickHandler_());google.maps.event.trigger(this,"content_changed")};InfoBox.prototype.setPosition=function(n){this.position_=n;this.div_&&this.draw();google.maps.event.trigger(this,"position_changed")};InfoBox.prototype.setZIndex=function(n){this.zIndex_=n;this.div_&&(this.div_.style.zIndex=n);google.maps.event.trigger(this,"zindex_changed")};InfoBox.prototype.setVisible=function(n){this.isHidden_=!n;this.div_&&(this.div_.style.visibility=this.isHidden_?"hidden":"visible")};InfoBox.prototype.getContent=function(){return this.content_};InfoBox.prototype.getPosition=function(){return this.position_};InfoBox.prototype.getZIndex=function(){return this.zIndex_};InfoBox.prototype.getVisible=function(){return typeof this.getMap()=="undefined"||this.getMap()===null?!1:!this.isHidden_};InfoBox.prototype.show=function(){this.isHidden_=!1;this.div_&&(this.div_.style.visibility="visible")};InfoBox.prototype.hide=function(){this.isHidden_=!0;this.div_&&(this.div_.style.visibility="hidden")};InfoBox.prototype.open=function(n,t){var i=this;t&&(this.position_=t.getPosition(),this.moveListener_=google.maps.event.addListener(t,"position_changed",function(){i.setPosition(this.getPosition())}));this.setMap(n);this.div_&&this.panBox_()};InfoBox.prototype.close=function(){var n;if(this.closeListener_&&(google.maps.event.removeListener(this.closeListener_),this.closeListener_=null),this.eventListeners_){for(n=0;n<this.eventListeners_.length;n++)google.maps.event.removeListener(this.eventListeners_[n]);this.eventListeners_=null}this.moveListener_&&(google.maps.event.removeListener(this.moveListener_),this.moveListener_=null);this.contextListener_&&(google.maps.event.removeListener(this.contextListener_),this.contextListener_=null);this.setMap(null)},function(n,t){typeof define=="function"&&define.amd?define(["jquery"],t):t(n.jQuery)}(this,function(n){function u(){var i=document.createElement("smartbanner"),n={WebkitTransition:"webkitTransitionEnd",MozTransition:"transitionend",OTransition:"oTransitionEnd otransitionend",transition:"transitionend"};for(var t in n)if(i.style[t]!==undefined)return{end:n[t]};return!1}var t=navigator.userAgent,r=/Edge/i.test(t),i=function(i){var e,u,f;if((this.origHtmlMargin=parseFloat(n("html").css("margin-top")),this.options=n.extend({},n.smartbanner.defaults,i),e=navigator.standalone,this.options.force?this.type=this.options.force:t.match(/Windows Phone/i)!==null&&t.match(/Edge|Touch/i)!==null?this.type="windows":t.match(/iPhone|iPod/i)!==null||t.match(/iPad/)&&this.options.iOSUniversalApp?t.match(/Safari/i)!==null&&(t.match(/CriOS/i)!==null||window.Number(t.substr(t.indexOf("OS ")+3,3).replace("_","."))<6)&&(this.type="ios"):t.match(/\bSilk\/(.*\bMobile Safari\b)?/)||t.match(/\bKF\w/)||t.match("Kindle Fire")?this.type="kindle":t.match(/Android/i)!==null&&(this.type="android"),this.type&&!e&&!this.getCookie("sb-closed")&&!this.getCookie("sb-installed"))&&(this.scale=this.options.scale=="auto"?n(window).width()/window.screen.width:this.options.scale,this.scale<1&&(this.scale=1),u=n(this.type=="android"?'meta[name="google-play-app"]':this.type=="ios"?'meta[name="apple-itunes-app"]':this.type=="kindle"?'meta[name="kindle-fire-app"]':'meta[name="msApplication-ID"]'),u.length)){if(this.type=="windows")r&&(this.appId=n('meta[name="msApplication-PackageEdgeName"]').attr("content")),this.appId||(this.appId=n('meta[name="msApplication-PackageFamilyName"]').attr("content"));else if(f=/app-id=([^\s,]+)/.exec(u.attr("content")),f)this.appId=f[1];else return;this.title=this.options.title?this.options.title:u.data("title")||n("title").text().replace(/\s*[|\-·].*$/,"");this.author=this.options.author?this.options.author:u.data("author")||(n('meta[name="author"]').length?n('meta[name="author"]').attr("content"):window.location.hostname);this.iconUrl=u.data("icon-url");this.price=u.data("price");this.options.onInstall=typeof this.options.onInstall=="function"?this.options.onInstall:function(){};this.options.onClose=typeof this.options.onClose=="function"?this.options.onClose:function(){};this.create();this.show();this.listen()}};(i.prototype={constructor:i,create:function(){var t,u=this.price||this.options.price,f=this.options.url||function(){switch(this.type){case"android":return"market://details?id=";case"kindle":return"amzn://apps/android?asin=";case"windows":return r?"ms-windows-store://pdp/?productid=":"ms-windows-store:navigate?appid="}return"https://itunes.apple.com/"+this.options.appStoreLanguage+"/app/id"}.call(this)+this.appId,o=u?function(){var n=u+" - ";switch(this.type){case"android":return n+this.options.inGooglePlay;case"kindle":return n+this.options.inAmazonAppStore;case"windows":return n+this.options.inWindowsStore}return n+this.options.inAppStore}.call(this):"",e=this.options.iconGloss==null?this.type=="ios":this.options.iconGloss,i;this.type=="android"&&this.options.GooglePlayParams&&(f+="&referrer="+this.options.GooglePlayParams);i='<div id="smartbanner" class="'+this.type+'"><div class="sb-container"><a href="#" class="sb-close">&times;<\/a><span class="sb-icon"><\/span><div class="sb-info"><strong>'+this.title+"<\/strong><span>"+this.author+"<\/span><span>"+o+'<\/span><\/div><a href="'+f+'" class="sb-button"><span>'+this.options.button+"<\/span><\/a><\/div><\/div>";this.options.layer?n(this.options.appendToSelector).append(i):n(this.options.appendToSelector).prepend(i);this.options.icon?t=this.options.icon:this.iconUrl?t=this.iconUrl:n('link[rel="apple-touch-icon-precomposed"]').length>0?(t=n('link[rel="apple-touch-icon-precomposed"]').attr("href"),this.options.iconGloss==null&&(e=!1)):n('link[rel="apple-touch-icon"]').length>0?t=n('link[rel="apple-touch-icon"]').attr("href"):n('meta[name="msApplication-TileImage"]').length>0?t=n('meta[name="msApplication-TileImage"]').attr("content"):n('meta[name="msapplication-TileImage"]').length>0&&(t=n('meta[name="msapplication-TileImage"]').attr("content"));t?(n("#smartbanner .sb-icon").css("background-image","url("+t+")"),e&&n("#smartbanner .sb-icon").addClass("gloss")):n("#smartbanner").addClass("no-icon");this.bannerHeight=n("#smartbanner").outerHeight()+2;this.scale>1&&(n("#smartbanner").css("top",parseFloat(n("#smartbanner").css("top"))*this.scale).css("height",parseFloat(n("#smartbanner").css("height"))*this.scale).hide(),n("#smartbanner .sb-container").css("-webkit-transform","scale("+this.scale+")").css("-msie-transform","scale("+this.scale+")").css("-moz-transform","scale("+this.scale+")").css("width",n(window).width()/this.scale));n("#smartbanner").css("position",this.options.layer?"absolute":"static")},listen:function(){n("#smartbanner .sb-close").on("click",n.proxy(this.close,this));n("#smartbanner .sb-button").on("click",n.proxy(this.install,this))},show:function(t){var i=n("#smartbanner"),r;i.stop();this.options.layer?(i.animate({top:0,display:"block"},this.options.speedIn).addClass("shown").show(),n(this.pushSelector).animate({paddingTop:this.origHtmlMargin+this.bannerHeight*this.scale},this.options.speedIn,"swing",t)):n.support.transition?(i.animate({top:0},this.options.speedIn).addClass("shown"),r=function(){n("html").removeClass("sb-animation");t&&t()},n(this.pushSelector).addClass("sb-animation").one(n.support.transition.end,r).emulateTransitionEnd(this.options.speedIn).css("margin-top",this.origHtmlMargin+this.bannerHeight*this.scale)):i.slideDown(this.options.speedIn).addClass("shown")},hide:function(t){var i=n("#smartbanner"),r;i.stop();this.options.layer?(i.animate({top:-1*this.bannerHeight*this.scale,display:"block"},this.options.speedIn).removeClass("shown"),n(this.pushSelector).animate({paddingTop:this.origHtmlMargin},this.options.speedIn,"swing",t)):n.support.transition?(this.type!=="android"?i.css("top",-1*this.bannerHeight*this.scale).removeClass("shown"):i.css({display:"none"}).removeClass("shown"),r=function(){n("html").removeClass("sb-animation");t&&t()},n(this.pushSelector).addClass("sb-animation").one(n.support.transition.end,r).emulateTransitionEnd(this.options.speedOut).css("margin-top",this.origHtmlMargin)):i.slideUp(this.options.speedOut).removeClass("shown")},close:function(n){n.preventDefault();this.hide();this.setCookie("sb-closed","true",this.options.daysHidden);this.options.onClose(n)},install:function(n){this.options.hideOnInstall&&this.hide();this.setCookie("sb-installed","true",this.options.daysReminder);this.options.onInstall(n)},setCookie:function(n,t,i){var r=new Date;r.setDate(r.getDate()+i);t=encodeURI(t)+(i==null?"":"; expires="+r.toUTCString());document.cookie=n+"="+t+"; path=/;"},getCookie:function(n){for(var r,u,i=document.cookie.split(";"),t=0;t<i.length;t++)if(r=i[t].substr(0,i[t].indexOf("=")),u=i[t].substr(i[t].indexOf("=")+1),r=r.replace(/^\s+|\s+$/g,""),r==n)return decodeURI(u);return null},switchType:function(){var t=this;this.hide(function(){t.type=t.type=="android"?"ios":"android";var i=n(t.type=="android"?'meta[name="google-play-app"]':'meta[name="apple-itunes-app"]').attr("content");t.appId=/app-id=([^\s,]+)/.exec(i)[1];n("#smartbanner").detach();t.create();t.show()})}},n.smartbanner=function(t){var u=n(window),r=u.data("smartbanner"),f=typeof t=="object"&&t;r||u.data("smartbanner",r=new i(f));typeof t=="string"&&r[t]()},n.smartbanner.defaults={title:null,author:null,price:"FREE",appStoreLanguage:"us",inAppStore:"On the App Store",inGooglePlay:"In Google Play",inAmazonAppStore:"In the Amazon Appstore",inWindowsStore:"In the Windows Store",GooglePlayParams:null,icon:null,iconGloss:null,button:"VIEW",url:null,scale:"auto",speedIn:300,speedOut:400,daysHidden:15,daysReminder:90,force:null,hideOnInstall:!0,layer:!1,iOSUniversalApp:!0,appendToSelector:"body",pushSelector:"html"},n.smartbanner.Constructor=i,n.support.transition===undefined)&&(n.fn.emulateTransitionEnd=function(t){var i=!1,u=this,r;n(this).one(n.support.transition.end,function(){i=!0});return r=function(){i||n(u).trigger(n.support.transition.end)},setTimeout(r,t),this},n(function(){n.support.transition=u()}))});dataFillElements=function(n){"use strict";var t={};return t.updateDataFillElements=function(t){var c=n(t.relatedTarget),u=n(t.target),v=u.find("input, select, h2"),r=[],f=[],i,e,o,h,s,l,a;if(c.length)for(e=c.get(0),i=0;i<e.attributes.length;i++)e.attributes[i].name.toUpperCase().indexOf("DATA-FILLSOURCE-")===0&&r.push({attrName:e.attributes[i].name.substr(16).toUpperCase(),attrValue:e.attributes[i].value});for(o=0;o<r.length;o++)if(r[o].attrName==="CMTHEADER"){n("#location-name-data").text(r[o].attrValue);break}for(n.each(v,function(){var t=this,r;for(i=0;i<t.attributes.length;i++)t.attributes[i].name.toUpperCase().indexOf("DATA-FILLDESTINATION-")===0&&(t.attributes[i].value.toUpperCase()==="CLEAR"?(r=n(t),r.is(":checkbox")?r.prop("checked",!1):r.val("")):f.push({elem:n(this),attrName:t.attributes[i].name.substr(21).toUpperCase()}))}),i=0;i<f.length;i++){for(h=null,s=0;s<r.length;s++)r[s].attrName===f[i].attrName&&(h=r[s]);h?f[i].elem.val(h.attrValue):f[i].elem.val("")}a=u.find("#ProductType").val();u.find("#ProductType").attr({readonly:"readonly",tabindex:"-1"});n(".DropdownFormProducts li").each(function(){var t=n(this).find("a").attr("data-item-value");t==a&&(l=n(this).find("a").html())});n("#crystalSearchToggle")&&n("#crystalSearchToggle").data("value")==="True"&&u.attr("id")==="getQuote"&&n(".DropdownFormProductsVal").html(l);n(".DropdownFormProducts li").on("click",function(t){var i=n(this).find("a").attr("data-item-value");n(this).parent().parent().find("button.DropdownFormProductsVal").html(n(this).find("a").html());n(this).parents(".form-dropdown-wrapper").find("input").val(i);t.preventDefault();i===""?(n(this).parent().parent().find("button.DropdownFormProductsVal").css({color:"#c90c0f","background-color":"#fdd9dd"}),n(this).parent().parent().find("button.DropdownFormProductsVal").removeClass("validation-valid").addClass("validation-error")):(n(this).parent().parent().find("button.DropdownFormProductsVal").css({color:"#000","background-color":"#e8e8e8"}),n(this).parent().parent().find("button.DropdownFormProductsVal").removeClass("validation-error").addClass("validation-valid"))});nwp.dropdownKeyInteraction.initDropdownKeyInteraction(u)},t}($);$(function(){$("form").on("submit",function(){window.addEventListener("pagehide",function(){$("[id=submitEmail]").removeAttr("disabled")},!1);window.onbeforeunload=function(){$("[id=submitEmail]").removeAttr("disabled")}})});nwp=nwp||{};extend(nwp,"google");nwp.google.Geocoder=function(){var n=$("body").data("rootpath"),t=n+"api/google/geocode",i=function(n,i){return $.ajax({url:t,type:"POST",data:n,success:function(n){i&&i(n)},error:function(){i&&i()}})};return{geocode:i}}();nwp.google.PlacesApi=function(){var n=$("body").data("rootpath"),t=n+"api/google/places/",i=function(n,i){return $.ajax({url:t+n,type:"GET",success:function(n){i&&i(n)},error:function(){i&&i()}})};return{getDetails:i}}();nwp.google.Autocomplete=function(n,t){var i,r,u;this.input=n;this.$input=$(this.input);this.defaults=t||{};this.defaults.minLength=this.defaults.minLength||3;this.defaults.delay=this.defaults.delay||500;try{this.autocompleteService=new google.maps.places.AutocompleteService}catch(f){console.error(f)}i=this;this.$input.on("input propertychange paste",function(){(i.defaults.onChange||function(){}).call(i.$input,i.defaults);var n=i.$input.val();r&&r!=n&&(i.defaults.onReset||function(){})()});u={minLength:this.defaults.minLength,delay:this.defaults.delay,displayText:function(n){return n.description},matcher:function(){return!0},sorter:function(n){return n},highlighter:function(n,t){var f=t.structured_formatting,e=t.structured_formatting.main_text,o=t.structured_formatting.secondary_text,l="",c,u,s,i;if(f.main_text_matched_substrings.length){var r=e.substring(t.matched_substrings[0].offset,t.matched_substrings[0].offset+t.matched_substrings[0].length),h="",a="";if(e.indexOf(r)>0)for(h=e.split(r)[0],c=0;c<e.split(r).length;c++)c!==0&&(a+=e.split(r)[c]);else h=e.substring(t.matched_substrings[0].length);l=r&&h&&e.indexOf(r)>0?"<span class='main-text'>"+h+"<strong>"+r+"<\/strong><span>"+a+"<\/span><\/span>":"<span class='main-text'><strong>"+r+"<\/strong>"+h+"<\/span>"}if(u="",f.secondary_text_matched_substrings&&f.secondary_text_matched_substrings.length)for(s=0;s<f.secondary_text_matched_substrings.length;s++)i=f.secondary_text_matched_substrings[s],s===0&&i.offset>0&&(u+=o.substring(0,i.offset)),u+="<strong>"+o.substring(i.offset,i.offset+i.length)+"<\/strong>",u+=s+1<f.secondary_text_matched_substrings.length?o.substring(i.offset+i.length,f.secondary_text_matched_substrings[s+1].offset):o.substring(i.offset+i.length,o.length);else u=o;return o?(u="<span class='secondary-text'>"+u+"<\/span>",[l,u].join(" ")):l},source:function(n,t){var r={input:n};i.defaults.bounds&&(r.bounds=i.defaults.bounds);i.defaults.types&&(r.types=i.defaults.types);i.autocompleteService.getPlacePredictions(r,function(r,u){u!=google.maps.places.PlacesServiceStatus.OK&&u!=google.maps.places.PlacesServiceStatus.ZERO_RESULTS?(console.log("Prediction getting error",u),t([])):u==google.maps.places.PlacesServiceStatus.ZERO_RESULTS?(i.defaults.noResults||function(){}).call(i.$input,n):r!=null&&(_.each(r,function(n){n.resolveQuery=function(){return _.pluck(this.terms,"value").join(",")}}),t(r))})},updater:function(n){return r=n.description,(i.defaults.onClick||function(){}).call(i.$input,n),window.virtualPageView&&window.virtualPageView.send&&(nwp.sessionStorage.setItem("shouldSendVirtualPageView",!0),nwp.sessionStorage.setItem("autocompleteSearchValue",n.description),window.dataLayer&&window.dataLayer[0].pageName==="Virtual Office Checkout"&&window.virtualPageView.send()),n}};this.$input.attr("autocomplete","off");this.Instance=this.$input.typeahead(u)};nwp.google.Autocomplete.prototype.setBounds=function(n){this.defaults.bounds=n};nwp.google.Autocomplete.prototype.setTypes=function(n){this.defaults.types=n};nwp=nwp||{};nwp.SearchApi=function(){var n="/api/search/centres",t=function(t){return $.ajax({url:n,dataType:"json",cache:!1,data:{latitude:t.coords.latitude,longitude:t.coords.longitude,productType:t.productType,zoomDiff:t.zoomDiff},type:"GET"})};return{searchCentres:t}}();nwp=nwp||{},function(n,t){n.loadImage=function(n){var i=n.src,r=n.srcError||"/images/gable.jpg",u=n.callback;t('<img alt="" src="'+i+'">').load(function(){u(t(this))}).error(function(){t(this).attr("src",r)})}}(nwp,jQuery);nwp=nwp||{};nwp.dropdownKeyInteraction={};nwp.dropdownKeyInteraction.initLanguagesDropdownKeyInteraction=function(){var n=$("#Languages");n.on("keydown",function(t){var i=jQuery.Event("keypress");t.keyCode===40?(i.keyCode=40,n.find(".dropdown").trigger("keypress",i)):t.keyCode===38&&(i.keyCode=38,n.find(".dropdown").trigger("keypress",i))})};nwp.dropdownKeyInteraction.initDropdownKeyInteraction=function(n){var i=n,t;nwp.dropdownKeyInteraction.selectedProduct="";nwp.dropdownKeyInteraction.selectedSubProduct="";nwp.dropdownKeyInteraction.selectedLocationNumber="";nwp.dropdownKeyInteraction.selectedWorkstationNumber="";t="DropdownFormProducts-selected";$.each(i.find(".country-flag-and-calling-code"),function(n,t){var t=$(t),i="";t.find(".dropdown-toggle.DropdownFormCallingCodesVal").on("keydown",function(n){var r=jQuery.Event("keydown");n.keyCode===40?(r.keyCode=40,r.target=i?i:t.find(".dropdown-menu.DropdownFormCallingCodes.country-flags").find("a")[0],t.find(".DropdownFormCallingCodes").trigger("keydown",r)):n.keyCode===38&&(r.keyCode=38,r.target=i?i:t.find(".dropdown-menu.DropdownFormCallingCodes.country-flags").find("a")[0],t.find(".DropdownFormCallingCodes").trigger("keydown",r))});t.find(".DropdownFormCallingCodes").on("keydown",function(n){var r=$(n.target),u;if(r.is("ul"))return i||(i=t.find(this).find("li").first(),i.css({background:"#f1f1f1"})),t.find(".dropdown-menu.formDropdIcons.DropdownFormCallingCodes.country-flags").animate({scrollTop:i.position().top+t.find(".dropdown-menu.formDropdIcons.DropdownFormCallingCodes.country-flags").scrollTop()}),!1;if(n.keyCode===38){if(!i)return i=t.find(r.parent()),t.find(r.parent()).css({background:"#f1f1f1"}),!1;t.find(i).prev()&&t.find(i).prev().length&&(i.css({background:"#fff"}),t.find(i).prev().css({background:"#f1f1f1"}),i=t.find(i).prev(),t.find(".dropdown-menu.formDropdIcons.DropdownFormCallingCodes.country-flags").animate({scrollTop:i.position().top+t.find(".dropdown-menu.formDropdIcons.DropdownFormCallingCodes.country-flags").scrollTop()}))}else if(n.keyCode===40){if(!i)return i=t.find(r.parent()),t.find(r.parent()).css({background:"#f1f1f1"}),!1;t.find(i).next()&&t.find(i).next().length&&(i.css({background:"#fff"}),t.find(i).next().css({background:"#f1f1f1"}),i=t.find(i).next(),t.find(".dropdown-menu.formDropdIcons.DropdownFormCallingCodes.country-flags").animate({scrollTop:i.position().top+t.find(".dropdown-menu.formDropdIcons.DropdownFormCallingCodes.country-flags").scrollTop()}))}else if(n.keyCode===13)i&&(i.trigger("click",n),u=r.parent().parent().parent(),t.find($(this).parent().find(".dropdown-toggle")).focus());else if(n.keyCode===27)return t.find(".FormDropdownHolder").removeClass("open"),t.find(".FormDropdownHolder .dropdown-toggle").focus(),!1;n.preventDefault()})});$(".DropdownFormProducts li").on("mouseover",function(n){var t=$(n.target).is("li")?$(n.target):$(n.target).parent();t.is("li")&&(t.css({background:"#f1f1f1"}),t.find("a").css({color:"#000"}))});$(".DropdownFormProducts li").on("mouseout",function(n){var t=$(n.target).is("li")?$(n.target):$(n.target).parent();t.is("li")&&(t&&nwp.dropdownKeyInteraction.selectedProduct&&t.text()!==nwp.dropdownKeyInteraction.selectedProduct.text()||!nwp.dropdownKeyInteraction.selectedProduct)&&(t.css({background:"#818181"}),t.find("a").css({color:"#fff"}))});$(".dropdown-toggle.DropdownFormProductsVal").on("keydown",function(n){var t=jQuery.Event("keydown");n.keyCode===40?(t.keyCode=40,t.target=$(".dropdown-menu.DropdownFormProducts").find("a")[0],$(".DropdownFormProducts").trigger("keydown",t)):n.keyCode===38&&(t.keyCode=38,t.target=$(".dropdown-menu.DropdownFormProducts").find("a")[0],$(".DropdownFormProducts").trigger("keydown",t))});$(".DropdownFormProducts").each(function(n,i){var u=$(i),r;u.on("focusout",function(){$(".FormDropdownHolder").hasClass("open")||($(r).css({background:"#818181"}).removeClass(t),$(r).find("a").css({color:"#fff"}),r="")});u.off("keydown").on("keydown",function(n){var i=$(n.target);if(i.is("ul"))return r=i.find("li").first(),r.css({background:"#f1f1f1"}),r.css({color:"#000"}),$(r).find("a").css({color:"#000"}),r.addClass(t),!1;if(n.keyCode===38){if(!r)return r=$(i.parent()),$(i.parent()).css({background:"#f1f1f1"}),r.css({color:"#000"}),!1;$(r).prev()&&$(r).prev().length&&(r.css({background:"#818181"}),r.removeClass(t),i.css({color:"#fff"}),$(r).prev().css({background:"#f1f1f1"}),$(r).prev().find("a").css({color:"#000"}),$(r).prev().addClass(t),r=$(r).prev(),$($(".dropdown-menu.formDropdIcons.DropdownFormProducts").get(0)).animate({scrollTop:r.position().top+$(".dropdown-menu.formDropdIcons.DropdownFormProducts").scrollTop()}))}else if(n.keyCode===40){if(!r)return r=$(i.parent()),$(i.parent()).css({background:"#f1f1f1"}),r.css({color:"#000"}),!1;$(r).next()&&$(r).next().length&&(r.css({background:"#818181"}),r.removeClass(t),i.css({color:"#fff"}),$(r).next().css({background:"#f1f1f1"}),$(r).next().find("a").css({color:"#000"}),$(r).next().addClass(t),r=$(r).next(),$($(".dropdown-menu.formDropdIcons.DropdownFormProducts").get(0)).animate({scrollTop:r.position().top+$(".dropdown-menu.formDropdIcons.DropdownFormProducts").scrollTop()}))}else if(n.keyCode===13)r&&(r.trigger("click",n),i.closest(".FormDropdownHolder").find(".DropdownFormProductsVal").focus());else if(n.keyCode===27)return i.closest(".FormDropdownHolder.open").removeClass("open"),i.closest(".FormDropdownHolder").find(".DropdownFormProductsVal").focus(),!1;n.preventDefault()})});$(".DropdownFormSubProducts li").on("mouseover",function(n){var t=$(n.target).is("li")?$(n.target):$(n.target).parent();t.is("li")&&(t.css({background:"#f1f1f1"}),t.find("a").css({color:"#000"}))});$(".DropdownFormSubProducts li").on("mouseout",function(n){var t=$(n.target).is("li")?$(n.target):$(n.target).parent();t.is("li")&&(t&&nwp.dropdownKeyInteraction.selectedSubProduct&&t.text()!==nwp.dropdownKeyInteraction.selectedSubProduct.text()||!nwp.dropdownKeyInteraction.selectedSubProduct)&&(t.css({background:"#818181"}),t.find("a").css({color:"#fff"}))});$(".DropdownFormSubProducts").on("focusout",function(){$(".FormDropdownHolder").hasClass("open")||($(nwp.dropdownKeyInteraction.selectedSubProduct).css({background:"#818181"}),$(nwp.dropdownKeyInteraction.selectedSubProduct).find("a").css({color:"#fff"}),nwp.dropdownKeyInteraction.selectedSubProduct="")});$(".dropdown-toggle.DropdownFormSubProductsVal").on("keydown",function(n){var t=jQuery.Event("keydown");n.keyCode===40?(t.keyCode=40,t.target=$(".dropdown-menu.DropdownFormSubProducts").find("a")[0],$(".DropdownFormSubProducts").trigger("keydown",t)):n.keyCode===38&&(t.keyCode=38,t.target=$(".dropdown-menu.DropdownFormSubProducts").find("a")[0],$(".DropdownFormSubProducts").trigger("keydown",t))});$(".DropdownFormSubProducts").on("keydown",function(n){var t=$(n.target);if(t.is("ul"))return nwp.dropdownKeyInteraction.selectedSubProduct=$("ul.dropdown-menu.DropdownFormSubProducts li").first(),nwp.dropdownKeyInteraction.selectedSubProduct.css({background:"#f1f1f1"}),nwp.dropdownKeyInteraction.selectedSubProduct.css({color:"#000"}),$(nwp.dropdownKeyInteraction.selectedSubProduct).find("a").css({color:"#000"}),!1;if(n.keyCode===38){if(!nwp.dropdownKeyInteraction.selectedSubProduct)return nwp.dropdownKeyInteraction.selectedSubProduct=$(t.parent()),$(t.parent()).css({background:"#f1f1f1"}),nwp.dropdownKeyInteraction.selectedSubProduct.css({color:"#000"}),!1;$(nwp.dropdownKeyInteraction.selectedSubProduct).prev()&&$(nwp.dropdownKeyInteraction.selectedSubProduct).prev().length&&(nwp.dropdownKeyInteraction.selectedSubProduct.css({background:"#818181"}),t.css({color:"#fff"}),$(nwp.dropdownKeyInteraction.selectedSubProduct).prev().css({background:"#f1f1f1"}),$(nwp.dropdownKeyInteraction.selectedSubProduct).prev().find("a").css({color:"#000"}),nwp.dropdownKeyInteraction.selectedSubProduct=$(nwp.dropdownKeyInteraction.selectedSubProduct).prev(),$($(".dropdown-menu.formDropdIcons.DropdownFormSubProducts").get(0)).animate({scrollTop:nwp.dropdownKeyInteraction.selectedSubProduct.position().top+$(".dropdown-menu.formDropdIcons.DropdownFormSubProducts").scrollTop()}))}else if(n.keyCode===40){if(!nwp.dropdownKeyInteraction.selectedSubProduct)return nwp.dropdownKeyInteraction.selectedSubProduct=$(t.parent()),$(t.parent()).css({background:"#f1f1f1"}),nwp.dropdownKeyInteraction.selectedSubProduct.css({color:"#000"}),!1;$(nwp.dropdownKeyInteraction.selectedSubProduct).next()&&$(nwp.dropdownKeyInteraction.selectedSubProduct).next().length&&(nwp.dropdownKeyInteraction.selectedSubProduct.css({background:"#818181"}),t.css({color:"#fff"}),$(nwp.dropdownKeyInteraction.selectedSubProduct).next().css({background:"#f1f1f1"}),$(nwp.dropdownKeyInteraction.selectedSubProduct).next().find("a").css({color:"#000"}),nwp.dropdownKeyInteraction.selectedSubProduct=$(nwp.dropdownKeyInteraction.selectedSubProduct).next(),$($(".dropdown-menu.formDropdIcons.DropdownFormSubProducts").get(0)).animate({scrollTop:nwp.dropdownKeyInteraction.selectedSubProduct.position().top+$(".dropdown-menu.formDropdIcons.DropdownFormSubProducts").scrollTop()}))}else if(n.keyCode===13)nwp.dropdownKeyInteraction.selectedSubProduct&&(nwp.dropdownKeyInteraction.selectedSubProduct.trigger("click",n),$(".dropdown-toggle.DropdownFormSubProductsVal").focus());else if(n.keyCode===27)return $(".FormDropdownHolder.open").removeClass("open"),$(".dropdown-toggle.DropdownFormSubProductsVal").focus(),!1;n.preventDefault()});$(".dropdownNumberOfLocations li").on("mouseover",function(n){var t=$(n.target).is("li")?$(n.target):$(n.target).parent();t.is("li")&&(t.css({background:"#f1f1f1"}),t.find("a").css({color:"#000"}))});$(".dropdownNumberOfLocations li").on("mouseout",function(n){var t=$(n.target).is("li")?$(n.target):$(n.target).parent();t.is("li")&&(t&&nwp.dropdownKeyInteraction.selectedLocationNumber&&t.text()!==nwp.dropdownKeyInteraction.selectedLocationNumber.text()||!nwp.dropdownKeyInteraction.selectedLocationNumber)&&(t.css({background:"#818181"}),t.find("a").css({color:"#fff"}))});$(".dropdownNumberOfLocations").on("focusout",function(){$(".FormDropdownHolder").hasClass("open")||($(nwp.dropdownKeyInteraction.selectedLocationNumber).css({background:"#818181"}),$(nwp.dropdownKeyInteraction.selectedLocationNumber).find("a").css({color:"#fff"}),nwp.dropdownKeyInteraction.selectedLocationNumber="")});$(".dropdown-toggle#nrLocWorldwide").on("keydown",function(n){var t=jQuery.Event("keydown");n.keyCode===40?(t.keyCode=40,t.target=$(".dropdown-menu.dropdownNumberOfLocations").find("a")[0],$(".dropdownNumberOfLocations").trigger("keydown",t)):n.keyCode===38&&(t.keyCode=38,t.target=$(".dropdown-menu.dropdownNumberOfLocations").find("a")[0],$(".dropdownNumberOfLocations").trigger("keydown",t))});$(".dropdownNumberOfLocations").on("keydown",function(n){var t=$(n.target);if(t.is("ul"))return nwp.dropdownKeyInteraction.selectedLocationNumber=$("ul.dropdown-menu.dropdownNumberOfLocations li").first(),nwp.dropdownKeyInteraction.selectedLocationNumber.css({background:"#f1f1f1"}),nwp.dropdownKeyInteraction.selectedLocationNumber.css({color:"#000"}),$(nwp.dropdownKeyInteraction.selectedLocationNumber).find("a").css({color:"#000"}),!1;if(n.keyCode===38){if(!nwp.dropdownKeyInteraction.selectedLocationNumber)return nwp.dropdownKeyInteraction.selectedLocationNumber=$(t.parent()),$(t.parent()).css({background:"#f1f1f1"}),nwp.dropdownKeyInteraction.selectedLocationNumber.css({color:"#000"}),!1;$(nwp.dropdownKeyInteraction.selectedLocationNumber).prev()&&$(nwp.dropdownKeyInteraction.selectedLocationNumber).prev().length&&(nwp.dropdownKeyInteraction.selectedLocationNumber.css({background:"#818181"}),t.css({color:"#fff"}),$(nwp.dropdownKeyInteraction.selectedLocationNumber).prev().css({background:"#f1f1f1"}),$(nwp.dropdownKeyInteraction.selectedLocationNumber).prev().find("a").css({color:"#000"}),nwp.dropdownKeyInteraction.selectedLocationNumber=$(nwp.dropdownKeyInteraction.selectedLocationNumber).prev(),$($(".dropdown-menu.dropdownNumberOfLocations").get(0)).animate({scrollTop:nwp.dropdownKeyInteraction.selectedLocationNumber.position().top+$(".dropdown-menu.dropdownNumberOfLocations").scrollTop()}))}else if(n.keyCode===40){if(!nwp.dropdownKeyInteraction.selectedLocationNumber)return nwp.dropdownKeyInteraction.selectedLocationNumber=$(t.parent()),$(t.parent()).css({background:"#f1f1f1"}),nwp.dropdownKeyInteraction.selectedLocationNumber.css({color:"#000"}),!1;$(nwp.dropdownKeyInteraction.selectedLocationNumber).next()&&$(nwp.dropdownKeyInteraction.selectedLocationNumber).next().length&&(nwp.dropdownKeyInteraction.selectedLocationNumber.css({background:"#818181"}),t.css({color:"#fff"}),$(nwp.dropdownKeyInteraction.selectedLocationNumber).next().css({background:"#f1f1f1"}),$(nwp.dropdownKeyInteraction.selectedLocationNumber).next().find("a").css({color:"#000"}),nwp.dropdownKeyInteraction.selectedLocationNumber=$(nwp.dropdownKeyInteraction.selectedLocationNumber).next(),$($(".dropdown-menu.dropdownNumberOfLocations").get(0)).animate({scrollTop:nwp.dropdownKeyInteraction.selectedLocationNumber.position().top+$(".dropdown-menu.dropdownNumberOfLocations").scrollTop()}))}else if(n.keyCode===13)nwp.dropdownKeyInteraction.selectedLocationNumber&&(nwp.dropdownKeyInteraction.selectedLocationNumber.trigger("click",n),$("#nrLocWorldwide").focus());else if(n.keyCode===27)return $(".FormDropdownHolder.open").removeClass("open"),$("#nrLocWorldwide").focus(),!1;n.preventDefault()});$(".dropdownNumberOfWorkstations li").on("mouseover",function(n){var t=$(n.target).is("li")?$(n.target):$(n.target).parent();t.is("li")&&(t.css({background:"#f1f1f1"}),t.find("a").css({color:"#000"}))});$(".dropdownNumberOfWorkstations li").on("mouseout",function(n){var t=$(n.target).is("li")?$(n.target):$(n.target).parent();t.is("li")&&(t&&nwp.dropdownKeyInteraction.selectedWorkstationNumber&&t.text()!==nwp.dropdownKeyInteraction.selectedWorkstationNumber.text()||!nwp.dropdownKeyInteraction.selectedWorkstationNumber)&&(t.css({background:"#818181"}),t.find("a").css({color:"#fff"}))});$(".dropdownNumberOfWorkstations").on("focusout",function(){$(".FormDropdownHolder").hasClass("open")||($(nwp.dropdownKeyInteraction.selectedWorkstationNumber).css({background:"#818181"}),$(nwp.dropdownKeyInteraction.selectedWorkstationNumber).find("a").css({color:"#fff"}),nwp.dropdownKeyInteraction.selectedWorkstationNumber="")});$(".dropdown-toggle#nrWorkstations").on("keydown",function(n){var t=jQuery.Event("keydown");n.keyCode===40?(t.keyCode=40,t.target=$(".dropdown-menu.dropdownNumberOfWorkstations").find("a")[0],$(".dropdownNumberOfWorkstations").trigger("keydown",t)):n.keyCode===38&&(t.keyCode=38,t.target=$(".dropdown-menu.dropdownNumberOfWorkstations").find("a")[0],$(".dropdownNumberOfWorkstations").trigger("keydown",t))});$(".dropdownNumberOfWorkstations").on("keydown",function(n){var t=$(n.target);if(t.is("ul"))return nwp.dropdownKeyInteraction.selectedWorkstationNumber=$("ul.dropdown-menu.dropdownNumberOfWorkstations li").first(),nwp.dropdownKeyInteraction.selectedWorkstationNumber.css({background:"#f1f1f1"}),nwp.dropdownKeyInteraction.selectedWorkstationNumber.css({color:"#000"}),$(nwp.dropdownKeyInteraction.selectedWorkstationNumber).find("a").css({color:"#000"}),!1;if(n.keyCode===38){if(!nwp.dropdownKeyInteraction.selectedWorkstationNumber)return nwp.dropdownKeyInteraction.selectedWorkstationNumber=$(t.parent()),$(t.parent()).css({background:"#f1f1f1"}),nwp.dropdownKeyInteraction.selectedWorkstationNumber.css({color:"#000"}),!1;$(nwp.dropdownKeyInteraction.selectedWorkstationNumber).prev()&&$(nwp.dropdownKeyInteraction.selectedWorkstationNumber).prev().length&&(nwp.dropdownKeyInteraction.selectedWorkstationNumber.css({background:"#818181"}),t.css({color:"#fff"}),$(nwp.dropdownKeyInteraction.selectedWorkstationNumber).prev().css({background:"#f1f1f1"}),$(nwp.dropdownKeyInteraction.selectedWorkstationNumber).prev().find("a").css({color:"#000"}),nwp.dropdownKeyInteraction.selectedWorkstationNumber=$(nwp.dropdownKeyInteraction.selectedWorkstationNumber).prev(),$($(".dropdown-menu.dropdownNumberOfWorkstations").get(0)).animate({scrollTop:nwp.dropdownKeyInteraction.selectedWorkstationNumber.position().top+$(".dropdown-menu.dropdownNumberOfWorkstations").scrollTop()}))}else if(n.keyCode===40){if(!nwp.dropdownKeyInteraction.selectedWorkstationNumber)return nwp.dropdownKeyInteraction.selectedWorkstationNumber=$(t.parent()),$(t.parent()).css({background:"#f1f1f1"}),nwp.dropdownKeyInteraction.selectedWorkstationNumber.css({color:"#000"}),!1;$(nwp.dropdownKeyInteraction.selectedWorkstationNumber).next()&&$(nwp.dropdownKeyInteraction.selectedWorkstationNumber).next().length&&(nwp.dropdownKeyInteraction.selectedWorkstationNumber.css({background:"#818181"}),t.css({color:"#fff"}),$(nwp.dropdownKeyInteraction.selectedWorkstationNumber).next().css({background:"#f1f1f1"}),$(nwp.dropdownKeyInteraction.selectedWorkstationNumber).next().find("a").css({color:"#000"}),nwp.dropdownKeyInteraction.selectedWorkstationNumber=$(nwp.dropdownKeyInteraction.selectedWorkstationNumber).next(),$($(".dropdown-menu.dropdownNumberOfWorkstations").get(0)).animate({scrollTop:nwp.dropdownKeyInteraction.selectedWorkstationNumber.position().top+$(".dropdown-menu.dropdownNumberOfWorkstations").scrollTop()}))}else if(n.keyCode===13)nwp.dropdownKeyInteraction.selectedWorkstationNumber&&(nwp.dropdownKeyInteraction.selectedWorkstationNumber.trigger("click",n),$("#nrWorkstations").focus());else if(n.keyCode===27)return $(".FormDropdownHolder.open").removeClass("open"),$("#nrWorkstations").focus(),!1;n.preventDefault()})},function(n){Array.prototype.find||Object.defineProperty(Array.prototype,"find",{value:function(n){var i,u,f,t,r;if(this==null)throw new Error('"this" is null or not defined');if(i=Object(this),u=i.length>>>0,typeof n!="function")throw new Error("predicate must be a function");for(f=arguments[1],t=0;t<u;){if(r=i[t],n.call(f,r,t,i))return r;t++}return undefined}});n.extend({debounce:function(n,t,i,r){arguments.length==3&&typeof i!="boolean"&&(r=i,i=!1);var u;return function(){var f=arguments;r=r||this;i&&!u&&n.apply(r,f);clearTimeout(u);u=setTimeout(function(){i||n.apply(r,f);u=null},t)}},throttle:function(n,t,i){var r,f,u;return function(){f=arguments;u=!0;i=i||this;r||function(){u?(n.apply(i,f),u=!1,r=setTimeout(arguments.callee,t)):r=null}()}}});n.fn.resetValidation=function(){var n=this.closest("form");return n.validate().resetForm(),n.find("[data-valmsg-summary=true]").removeClass("validation-summary-errors").addClass("validation-summary-valid").find("ul").empty(),n.find("[data-valmsg-replace]").removeClass("field-validation-error").addClass("field-validation-valid").empty(),n.find(".modal_window_forms.input-validation-error").removeClass("input-validation-error"),n};n.fn.formReset=function(n){var t=this.closest("form");return t[0].reset(),(n==undefined||n)&&t.resetValidation(),t}}(jQuery);var geoLocationDataCookieName="NWP_GeoLocation",geoLocationRedirectCookieName="NWP_GeoLocationRedirect",geoLocationRedirectPopupCookieName="NWP_GeoLocationRedirectPopup",geoLocationByIpCookieName="NWP_GeoLocationByIp",callingCodeByIpCookieName="NWP_CallingCOdeByIp",userLocationWithCentresDataCookieName="NWP_UserLocationWithCentresDataByIp",searcmTermCookieName="NWP_searchTerm",botsConst=/bot|appneta|monitoring|slurp|crawl|fetch|search|spider/i,chineseCountryMappings={China:"中国","Hong Kong":"中国香港",Taiwan:"中国台湾"},chineseCityMappings={"Hong Kong":"香港"},englishCountryMappings={"Hong Kong":"China",Taiwan:"Taiwan, China"};nwp=nwp||{};nwp.locationAutocomplete={};nwp.locationAutocomplete.initLocationAutocomplete=function(n){function s(n,t,i,r,u,f,e){var s=n.find(".LoaderAjaxQueries"),o=n.find("#potential-centre-options"),h;n.find(".dropHolder").nwpDatepicker("setLocation",t);s.show();h=$.ajax({url:o.data("url"),method:"GET",data:{location:t,country:i,state:r,latString:u,lngString:f},success:function(t){e(n,t)},cache:!1,complete:function(){s.hide()},error:function(n,t,i){console.log(n,t,i)}});o.change(function(){n.find(".dropHolder").nwpDatepicker("setLocation",t,o.find(":selected").attr("data-number"))})}function h(n,t){var h=n.find(".LoaderAjaxQueries"),c=n.find("#noCentresWarning"),u=n.find(".propertyDisabledFake"),l=n.find("#chooseLocatText"),i=n.find("#potential-centre-options"),r=n.find("#locationInterested"),f=n.find("#BookAllCentres"),e=n.find("#bookallcentrescheck"),o=n.find("#bookAllCentresMode"),s;i.empty();console.log(t);t.length?(c.hide(),h.show(),r.removeClass("absoluteDropdownDiv"),s=l.val(),t.length===1?(i.css("background-color","#e8e8e8"),u.addClass("active")):(i.css("background-color","transparent"),u.removeClass("active"),i.append("<option disabled selected>"+s+"<\/option>")),r.css({display:"block"}),$(t).each(function(){var n=$("<option />"),t=this.TranslatedName;t||(t=this.Name);n.attr("value",this.Name).text(t);n.attr("data-number",this.Number);i.append(n)}),f.length&&e.length&&o.show(),i.trigger("click")):(r.addClass("absoluteDropdownDiv"),f.length&&e.length&&o.hide())}var l,a,f;if(!isBotCrawler()){var c=$(n.target),i=c.find(".locationAutocomp"),t=i.length?$(i[0]):null,r=i.siblings("input[name=LocationLatitude]"),u=i.siblings("input[name=LocationLongitude]"),e=i.siblings("input[name=LocationState]"),o=i.siblings("input[name=LocationCountry]");t&&t.data("last-google-autocomplete",t.val());i.unbind("keypress").keypress(function(n){return n.which===13?(n.preventDefault(),!1):!0});c.unbind("submit").submit(function(){t&&t.val()!==t.data("last-google-autocomplete")&&(r.val(""),u.val(""))});t&&$(".google_autocomplete_enabled").length>0?(l=new nwp.google.Autocomplete(t.get(0),{types:["geocode"],minLength:$("#autocomplete-min-length").data("autocomplete-min-length"),onReset:function(){r.val("");u.val("");e.val("");o.val("");t.data("last-google-autocomplete","")},onClick:function(i){nwp.google.Geocoder.geocode({address:i.description},function(f){var c,l,a,v,y;f&&f.length&&(c=f[0],r.val(c.geometry.location.lat),u.val(c.geometry.location.lng),l=c.address_components.filter(function(n){return n.types.indexOf("country")>-1}),a=l.length>0?l[0].long_name:"",o.val(a),v=a=="United States"?c.address_components.filter(function(n){return n.types.indexOf("administrative_area_level_1")>-1}):[],y=v.length>0?v[0].long_name:"",e.val(y),t.data("last-google-autocomplete",i.description),$(n.target).attr("id")=="bookATour"&&s($(n.target),t.val(),o.val(),e.val(),r.val(),u.val(),h))});$(".autocompleteSearchError").hide()}}),nwp.google.Geocoder.geocode({address:$("body").data("countryname")},function(n){var i,t,r;if(n&&n.length)for(i=0;i<n.length;i++)n[i].types.indexOf("country")>-1&&(t=n[0].geometry.bounds,r=new google.maps.LatLngBounds(new google.maps.LatLng(t.southwest.lat,t.southwest.lng),new google.maps.LatLng(t.northeast.lat,t.northeast.lng)),l.setBounds(r))})):t&&$(".disabled_google_autocomplete").length>0&&$("body[data-countryname='China']").length>0&&(f=$(n.target),f.find(".chinaFormAutocomp").autocomplete({appendTo:f.find(".autocomplete_holder_china"),source:function(n,t){var i,r,u,e;console.log(t);a=n.term;i=new RegExp("^"+$.ui.autocomplete.escapeRegex(n.term),"i");r=$.grep(app.search.citiesData.Cities,function(n){return i.test(n.City)||i.test(n.CityEnglishName)});r.length>0?(u=r.sort(function(n,t){var u=$.trim(n.Country).toLowerCase(),f=$.trim(t.Country).toLowerCase(),r=$.trim(app.search.citiesData.SiteCountry).toLowerCase(),i;return i=u===r&&f===r?0:u!==r&&f!==r?0:u===r?-1:1,i===0&&(i=n.City.localeCompare(t.City),i===0&&(i=n.Country.localeCompare(t.Country))),i}),e=$.map(u.slice(0,3),function(n){return n.City.toLowerCase().match(a.toLowerCase())!==null?n.Country.length?n.City+", "+n.Country:n.City:n.Country.length?n.CityEnglishName+", "+n.Country:n.CityEnglishName}),t(e)):$("body[data-countryname='China']").length>0?function(n,i){var u=$(f.find(".chinaFormAutocomp ")).val(),r=$.trim(u),e=$(n).val()+" "+$(i).val();r.length>1?/^([ a-zA-Z0-9\u00C0-\u1FFF\u2C00-\uD7FF\w/]{1}[a-zA-Z\u00C0-\u1FFF\u2C00-\uD7FF\w/. |\-| |']*[a-zA-Z0-9\u00C0-\u1FFF\u2C00-\uD7FF\w/. ]{1})$/i.test(r)?t([r]):t([]):t([])}("#ChinaSearchError1","#ChinaSearchError2"):t(["No results found for: "+n.term])},select:function(i,c){if(c.item.value.indexOf("No results")>0)return!1;if($("#ChinaSearchError1").length>0&&c.item.value.indexOf($("#ChinaSearchError1").val())>0)return $(f.find(".chinaFormAutocomp ")).val(""),!1;if(f.find(".chinaFormAutocomp ").val(c.item.value),$(n.target).attr("id")==="emailForm")return!1;s($(n.target),t.val(),o.val(),e.val(),r.val(),u.val(),h)}}));$(n.target).attr("id")=="bookATour"&&(r.val().length>1&&u.val().length>1||t.val().length>1)&&!$("#remove-location-dropdown").length&&s($(n.target),t.val(),o.val(),e.val(),r.val(),u.val(),h)}},function(n){n.fn.fillText=function(t){var i=t.maxFont,e=t.pad||0,o=t.selector||"h1",r=n(o,this),s=n(this).height()-e,h=n(this).width(),u,f;do r.css("font-size",i),u=r.height(),f=r.width(),i-=1;while((u>s||f>h)&&i>20);return this}}(jQuery),function(n){"use strict";function s(t){if(!t)return!1;n.ajax({url:t.url,method:"GET",success:t.callbacks.success||function(){},cache:!1,error:t.callbacks.error||function(){}})}function c(t){var i=n(t).outerHeight()/2,r=Math.round(i),u="-"+String(r)+"px";n(t).css("margin-top",u)}function f(){return n.cookie("check","valid",{expires:1})&&n.cookie("check")==="valid"}function v(){var t=n(this),i=t.find(".modal-dialog");t.css("display","block");setTimeout(function(){i.css("margin-top",Math.max(0,(n(window).height()-i.height())/2))},200)}var e;(function(){n(window).on("orientationchange",n.debounce(function(){n(window).trigger("resize")},500))})();n(function(){var t=n("#enquiryform-loader-container").html();n(".modal[data-url]").html(t)});n(".modal[data-url]").on("show.bs.modal",function(){window.app.layout.reposition(n(this));n(".cmt-wrapper-tag").each(function(){var t=n(this),i=t.prev(),r;i.length>0&&i.hasClass("cmt-wrapper")&&(r=i.position(),t.css("top",r.top+"px"),t.css("left",r.left+"px"),t.css("font-size",i.outerHeight()/5+"px"))})});window.app=window.app||{};window.app.FormIsOpened=!1;n(document).on("hidden.bs.modal",function(){window.app.FormIsOpened=!1});n(document).on("shown.bs.modal",function(t){var i=n(t.target).data("url");window.app.FormIsOpened=!0;i?(window.app.layout.reposition(n(this)),s({url:i,callbacks:{success:function(i){function u(){n(this).html(n("#enquiryform-loader-container").html())}function f(){n(t.target).html(i);var r=n(t.target).find("form");n(r).find("[autofocus]").focus();r.removeData("validator").removeData("unobtrusiveValidation");n.validator.unobtrusive.parse(r);n(t.target).trigger("resize");n(t.target).off("hidden.bs.modal",u).on("hidden.bs.modal",u);noDuplicateFormSubmit(r);n(".dropHolder",t.target).nwpDatepicker("destroy").nwpDatepicker({startDate:new Date,selectedDateHolder:"[name=DateOfTour],[name=StartDate]",linkedTimePickerFinder:function(t){return n(t).closest(".date-time-wrapp").find("select[name=TimeOfTour]")},linkedTimePickerTimeShiftHours:2});n(".country-flag-and-calling-code",t.target).nwpPhoneNumberControl("destroy").nwpPhoneNumberControl();n(t.target).attr("id")!=="solutionFinder-modal"&&afterModalShown(t)}var r,e;if(n.each(n.parseHTML(i),function(t,i){var u=n(i);if(u.hasClass("modal-dialog"))return r=u.data("styles-url")}),!r||n('link[href="'+r+'"]').length)return f();e=loadCSS(r);onloadCSS(e,function(){setTimeout(function(){f()},100)})},error:function(){n(t.target).modal("hide")}}})):afterModalShown(t)});var h=navigator.userAgent,r=h.match(/iPad/i)?"touchend":"click",t=window.app={init:function(){this.anchors.init();this.layout.init();this.nav.init();this.cookies_bar.init();this.rushModal.init();this.search.init();this.dropdown2.init();n("#site-selector").length>0&&this.geoLocationRedirect.init();n("#overseas-popup-container").length>0&&this.geoLocationRedirectPopup.init();this.geoLocationByIpPromise=this.geoLocationByIpPromiseFunc.init();this.callingCodeByIpPromise=this.callingCodeByIpPromiseFunc.init();this.callingCodeByIpPromise.then(function(t){n(document).trigger("nwp.callingCodeByIp",[t])});this.userLocationWithCentresPromise=this.userLocationWithCentresPromiseFunc.init();this.dynamicPhonePromise=this.paidSearchPromiseFunc.init();window.languageSelectorHelper&&languageSelectorHelper.redirectHomeToSelectedLanguage();this.phoneNumbersUpdateFunc.init()}},i=t.search={init:function(){this.init_cities_data();this.init_all_searchgroups()},init_cities_data:function(){if(nwp.sessionStorage.getItem("CitiesData")!=null)i.citiesData=n.parseJSON(nwp.sessionStorage.getItem("CitiesData"));else{var t=n("body").data("rootpath");n.get(t+"api/city/getallcities",function(t){nwp.sessionStorage.setItem("CitiesData",t);i.citiesData=n.parseJSON(t)})}},init_all_searchgroups:function(t){t=t||n("body");t.find(".search_group").each(function(){i.init_searchgroup(n(this))})},init_searchgroup:function(t){var u=t.find(".search_field"),f=t.find(".search_submit");if(u.length<1){console.log("Error initializing search group ",t);return}f.length===0&&(u=t.closest(".find-location-block").find("input, select"),f=t.closest(".find-location-block").find(".cta-button"),t.closest(".find-location-block").find("select").change(function(){i.search_field_trigger(n(this))}));f.on(r,function(){return n(".typeahead.dropdown-menu").length&&n(".typeahead.dropdown-menu li a:first").click(),!1});f.on(r,function(){var n=document.createEvent("HTMLEvents"),t;n.initEvent("keydown",!0,!1);Object.defineProperty(n,"keyCode",{get:function(){return 13}});Object.defineProperty(n,"which",{get:function(){return 13}});t=u[0];t.dispatchEvent(n)});i.init_search_autocomplete(u)},init_search_autocomplete:function(t){function f(){var t;if(n("#ui-id-1 li:first-child a")&&n("#ui-id-1 li:first-child a").length){t=n("#ui-id-1 li:first-child a").text();n("#topSearchField").val(t);n("#ui-id-1 li:first-child a").click();return}if(n("#ui-id-2 li:first-child a")&&n("#ui-id-2 li:first-child a").length){t=n("#ui-id-2 li:first-child a").text();n("input.search_field.ui-autocomplete-input").val(t);n("#ui-id-2 li:first-child a").click();return}if(n("#ui-id-3 li:first-child a")&&n("#ui-id-3 li:first-child a").length){t=n("#ui-id-3 li:first-child a").text();n("input.search_field.ui-autocomplete-input").val(t);n("#ui-id-3 li:first-child a").click();return}if(n("#ui-id-4 li:first-child a")&&n("#ui-id-4 li:first-child a").length){t=n("#ui-id-4 li:first-child a").text();n("input.search_field.ui-autocomplete-input").val(t);n("#ui-id-4 li:first-child a").click();return}}function h(t){if(n("#ui-id-2 li:first-child a")&&n("#ui-id-2 li:first-child a").length){var i=n("#ui-id-2 li:first-child a").text();n("input.search_field.ui-autocomplete-input").val(i);n("#ui-id-2 li:first-child a").click()}else c(t)}function c(t){if(n("#ui-id-3 li:first-child a")&&n("#ui-id-3 li:first-child a").length){var i=n("#ui-id-3 li:first-child a").text();n(t).val(i);n("#ui-id-3 li:first-child a").click()}}var s,r,l,u,e,a,o;if(!isBotCrawler())if(s=n(".google_autocomplete_enabled").length>0,r=n("body").hasClass("new_rebrand_homepage"),s)if(l=n("body").data("autocomplete"),u=new nwp.google.Autocomplete(t[0],{types:["cities"],minLength:n("#autocomplete-min-length").data("autocomplete-min-length"),onClick:function(n){var u=r?this.parent().parent():this.parent();i.search_query(n.resolveQuery(),t);u.find(".autocompleteSearchError").remove();u.find(".fake-brake-line").remove()},onChange:function(n){if(this.val().length<n.minLength){var t=r?this.parent().parent():this.parent();t.find(".autocompleteSearchError").remove();t.find(".fake-brake-line").remove()}},noResults:function(t){var f,i;if(this.data("maxlength")<(this.val()&&this.val().length))f=n("#location-maxlength-error-message").val(),i=r?this.parent().parent():this.parent(),i.find(".autocompleteSearchError").remove(),i.find(".fake-brake-line").remove(),i.append('<break class="fake-brake-line"><\/break><div class="autocompleteSearchError"><\/div>'),i.find(".autocompleteSearchError").text(f);else{var e=_.template(n(".autocompleteSearchError").html()),o=e({term:t}),u=r?this.parent().parent():this.parent();u.find(".autocompleteSearchError").remove();u.find(".fake-brake-line").remove();u.append('<break class="fake-brake-line"><\/break><div class="autocompleteSearchError"><\/div>');u.find(".autocompleteSearchError").text(o)}}}),l=="autocomplete_cities"){n(t).keydown(function(){n(this).val().length>3&&!n(".pac-container .pac-item").length?u.setTypes(["geocode"]):n(this).val().length<=3&&u.setTypes(["cities"])});n(t).on("blur",function(){u.setTypes(["cities"])})}else u.setTypes(["geocode","establishment"]);else{n("input[id='searchSubmit']").unbind("click");n("#topSearchField").unbind("keyup");n("input.autocompSubm.searchSubmit.search_submit").unbind("click");n(".search_field").unbind("keyup");n(".bottom_search_holder .search_field").unbind("click");n("input[id='searchSubmit']").on("click",function(){f()});n("input.autocompSubm.searchSubmit.search_submit").on("click",function(n){h(n.target)});n("#topSearchField").on("keyup",function(n){n.keyCode===13&&f()});n(".search_field.ui-autocomplete-input").on("keyup",function(n){n.keyCode===13&&f()});n(".autocompSubm.searchSubmit.search_submit, .autocomplete_holder.banner_search_section .search_submit").on("click",function(){f()});n(".search_field").on("keyup",function(n){n.keyCode===13&&h(n.target)});n(".bottom_search_holder .search_field").on("click",function(n){c(n.target)});n("#currentCityName").length&&(e=n("#currentCityName").val(),a=n(".autocomplete_holder.autocomplete_holder-cn-search .search_field"),n("body").data("countryname")==="China"&&(e=addChinaToCountryAndTranslateIfQueryIsInChinese(e)));t.autocomplete({appendTo:t.closest(".search_group").find(".autocomplete_holder"),source:function(t,r){var f,e,s,u;o=t.term;f=new RegExp("^"+n.ui.autocomplete.escapeRegex(t.term),"i");e=n.grep(i.citiesData.Cities,function(n){return f.test(n.City)||f.test(n.CityEnglishName)});e.length>0&&(s=e.sort(function(t,r){var e=n.trim(t.Country).toLowerCase(),o=n.trim(r.Country).toLowerCase(),f=n.trim(i.citiesData.SiteCountry).toLowerCase(),u;return u=e===f&&o===f?0:e!==f&&o!==f?0:e===f?-1:1,u===0&&(u=t.City.localeCompare(r.City),u===0&&(u=t.Country.localeCompare(r.Country))),u}),u=n.map(s.slice(0,3),function(n){return n.City.toLowerCase().match(o.toLowerCase())!==null?n.Country.length?n.City+", "+n.Country:n.City:n.Country.length?n.CityEnglishName+", "+n.Country:n.CityEnglishName}),n("body").data("countryname")==="China"&&(i.predictionsMap={},n.each(u,function(n,t){var r=addChinaToCountryAndTranslateIfQueryIsInChinese(t,o);i.predictionsMap[r]=t}),u=_.keys(i.predictionsMap)),r(u))},select:function(r,u){if(u.item.value.indexOf("No results")>0)return!1;if(n("#ChinaSearchError1").length>0&&u.item.value.indexOf(n("#ChinaSearchError1").val())>0)return n(t).val(""),!1;n(".autocompleteSearchError").remove();t.val(u.item.value);i.search_field_trigger(t)}});n(".search_field").on("input propertychange paste",_.debounce(function(){var t=n(this).val();if(n(".autocompleteErrorBlock").html(t),n(".autocompleteSearchError").length)if(t.length>3&&!n(this).parent().find("ul.typeahead.dropdown-menu").is(":visible")&&!n(".pac-container.pac-logo").is(":visible")&&!n(".ui-autocomplete.ui-front").is(":visible")){var f=_.template(n(".autocompleteSearchError").html()),u=f({term:t}),i=r?n(this).parent().parent():n(this).parent();i.find(".autocompleteSearchError").remove();i.find(".fake-brake-line").remove();i.append('<div class="autocompleteSearchError">'+u+"<\/div>");console.log(u)}else n(".autocompleteSearchError").hide()},300))}},search_query:function(n,i){var r=i.data("placeholder");r&&r.length!==0&&r===n||t.search.request(n,i.data("producttype"))},search_field_trigger:function(r){var f=n.grep(r,function(t){return n.trim(n(t).val()).length});if(f.length){var s=n.grep(f,function(t){return n(t).is("input")}),e=s.length?n(s[0]):n(f[0]),u=e.val(),o=e.data("placeholder");n("body").data("countryname")==="China"&&i.predictionsMap&&(u=i.predictionsMap[u]||u);o&&o.length!==0&&o===u||t.search.request(u,e.data("producttype"))}},request:function(t,i){var o=n(".google_autocomplete_enabled").length>0;if(o)virtualPageView&&virtualPageView.send&&(nwp.sessionStorage.setItem("shouldSendVirtualPageView",!0),nwp.sessionStorage.setItem("autocompleteSearchValue",t),dataLayer&&dataLayer[0].pageName==="Virtual Office Checkout"&&virtualPageView.send()),n.get("/api/city/url?t="+(new Date).getTime(),{productType:i&&i.length?i:"",searchTerm:t},function(i){i!==""?(AllCookies.set(searcmTermCookieName,t,{expires:.01,path:"/"}),window.location.href=i):n("#search-no-city").show()}).fail(function(n){console.log("Search error",n)});else{var r=t.split(","),f="",u="",e="";r.length===3?(e=r[1].trim(),f=r[2].trim(),u=r[0]):r.length===2?(f=r[1].trim(),u=r[0]):u=r[0];virtualPageView&&virtualPageView.send&&(nwp.sessionStorage.setItem("shouldSendVirtualPageView",!0),nwp.sessionStorage.setItem("autocompleteSearchValue",t),virtualPageView.send());n.get("/api/city/cityname",{cityName:u,state:e,countryName:f,productType:i&&i.length?i:""},function(i){i!==""?(AllCookies.set(searcmTermCookieName,t,{expires:.01,path:"/"}),window.location.href=i):n("#search-no-city").show()}).fail(function(n){console.log("Search error",n)})}},selectFirstSearchResult:function(t){function i(i,u){if(i=="keydown"){var f=u;u=function(i){var u=n(".pac-item-selected").length>0,r;i.which!=13||u||(r=n.Event("keydown",{keyCode:40,which:40}),f.apply(t,[r]));f.apply(t,[i])}}r.apply(t,[i,u])}var r=t.addEventListener?t.addEventListener:t.attachEvent;t.addEventListener?t.addEventListener=i:t.attachEvent&&(t.attachEvent=i)}},y=t.google_places={get_service:function(){return this.googleSearchService===undefined&&(this.googleSearchService=new google.maps.places.AutocompleteService),this.googleSearchService},get_predictions:function(t,i,r){var u=n.extend(!0,{input:t},r);this.get_service().getQueryPredictions(u,function(n,t){t!=google.maps.places.PlacesServiceStatus.OK&&t!=google.maps.places.PlacesServiceStatus.ZERO_RESULTS&&console.log("Preditcition getting error",t);var r=[];n.forEach&&n.length>0&&n.forEach(function(n){r.push(n.description)});i(r)})},get_cities:function(n,t){this.get_predictions(n,t,{types:["(cities)"]})}},p=t.nav={init:function(){this.init_main();this.init_sticky()},init_main:function(){n(".collapse-nav-ico").on(r,function(){var t=n(".navbar-collapse");t.toggleClass("mobile-name",window.innerWidth<=1200);window.innerWidth<=1200&&(n(".navbar-collapse").addClass("mobile-nav").slideToggle(300),n(this).toggleClass("active"))});n(".nav_top ul li").on("touchend",function(t){n(this).toggleClass("mobile_clicked active").siblings().removeClass("mobile_clicked active");t.stopPropagation()});n("body, .nav_top>ul").on("touchend",function(){n(".nav_top ul li").removeClass("mobile_clicked active")});n("body").on("touchend",function(t){n(".collapse-nav-ico").find(t.target).length||n(".nav_top.mobile-nav").css("display")!=="block"||n(".nav_top.mobile-nav").css({display:"none"})});n(".nav_top > ul > li").hover(function(){var i=n(this).offset(),t=n(document).width(),r=n(this).find("ul.sub-menu.productDropdImages");t<1184&&t>733&&(t<1025&&t>940&&/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent)?r.css({left:-i.left+"px",width:t+"px"}):r.css({left:-i.left+"px",width:t+"px"}))});n(".nav_top ul li").hover(function(){n(this).find(".sub-menu").is(":visible")?n(this).addClass("active"):n(this).removeClass("active")}).mouseleave(function(){n(this).removeClass("active")});n(".collapse-nav-sidebar").on(r,function(){n(".sidebar-inv-accordion").slideToggle();n(this).toggleClass("active")});window.safari!==undefined&&(n(".top-nav-holder__sub-menu--locations").css({"overflow-y":"auto"}),n(".locations-list-items").css({"overflow-y":"initial"}))},init_sticky:function(){this.sticky_update();n(window).on("scroll resize",this.sticky_update)},sticky_update:function(){var t=n(window).scrollTop();t>150?n(".header_fixed").fadeIn():n(".header_fixed").fadeOut()}},u=t.layout={init:function(){function e(){var t=n(".autocomplete_holder input").width(),i=t;n(".autocomplete_holder input").on("keydown",function(){n(".pac-container").css({"max-width":i+"px"})})}var i,r,f,t;this.equalizeHeights(".mr_descr_wrapp h3");this.equalizeHeights(".city_opt_header h4");this.equalizeHeights(".city_opt_descr");this.equalizeHeights("h4.color_header");this.equalizeHeights(".sub_map_t");this.equalizeHeights(".mr_text_wrapp");this.equalizeHeights(".get_started_sect .sub_header");this.equalizeHeights("p.index_offer_descr");this.equalizeHeights(".centreTypesHeight-cw p.index_offer_descr");this.equalizeHeights("p.index_offer_price");this.equalizeHeights(".vo-options-descr");this.equalizeHeights(".vo-options-title");this.equalizeHeights(".slider_text_block");this.equalizeHeights(".bottom-cta-holder");this.equalizeHeights(".index_offer_descr_wrapp h4");this.equalizeHeights(".bxslider-app .header");this.equalizeHeights(".bxslider-app .community_descr");this.equalizeHeights(".option_city_one .city_opt_subheader");this.equalizeHeights(".option_city_one .city_opt_header");this.equalizeHeights(".meet-room_opt_butt > .book_u_app > .cta-button");this.equalizeHeights(".horizv-map-centrescards .city_opt_header .cta-button");this.equalizeHeights(".optimly-tile-format .city__fromto");this.equalizeHeights(".padding-customers-color-h");this.equalizeHeights(".sl-feature-bottom > div");this.equalizeHeights(".top-cta-wrapper.top-nav-right--special-class button");n(".infoBox_wrapp").length>0&&function(){var t=n(".mapCenter_wrapp").height(),i=n(".infoWind-header").height(),r=t/i;r<2.4&&setTimeout(function(){n(".infoBox_wrapp").fillText({maxFont:60,pad:100,selector:"h1"});n(".htmlnsinfobox").length>0&&c(".htmlnsinfobox")},1e3)}();n(".js-linebreak").each(function(){this.innerHTML=this.innerHTML.replace(/,/g,"<br />")});n(".modal:not([data-url])").on("show.bs.modal",function(){var t=n(this).find("form")[0];n(t).find("[autofocus]").focus();t&&(t.reset(),n(".input-validation-error").addClass("input-validation-valid"),n(".input-validation-error").removeClass("input-validation-error"),n(t).resetValidation());u.reposition(n(this));n(".cmt-wrapper-tag").each(function(){var t=n(this),i=t.prev(),r;i.length>0&&i.hasClass("cmt-wrapper")&&(r=i.position(),t.css("top",r.top+"px"),t.css("left",r.left+"px"),t.css("font-size",i.outerHeight()/5+"px"))})});n(".modal:not([data-url])").on("hidden.bs.modal",function(){n("body").removeClass("body_fx");n("html").removeClass("overflow");n("#location-name-data").text("")});this.resize_handler();n("#topSearchField").placeholder({force:!0});e();n("a.phone-number[href*=tel]").click(function(t){t.preventDefault();window.location.href=n(this).attr("href")});i=n(".city_slider").bxSlider({adaptiveHeight:!0,mode:"horizontal",speed:500,pause:15e3,useCSS:!1,captions:!1,controls:!1,auto:!0,preventDefaultSwipeY:!1,onSlideAfter:function(t,i,r){n("ul.tabs_slider li a").removeClass("active");n("ul.tabs_slider li a").eq(r).addClass("active")}});n(".city_slider_3").length&&(i=n(".city_slider_3").bxSlider({adaptiveHeight:!0,mode:"horizontal",speed:500,pause:15e3,useCSS:!1,captions:!1,controls:!0,auto:!0,preventDefaultSwipeY:!1,onSlideAfter:function(t,i,r){n("ul.tabs_slider li a").removeClass("active");n("ul.tabs_slider li a").eq(r).addClass("active")}}));n("ul.tabs_slider li a").click(function(t){var r=n("ul.tabs_slider li a").index(this);i.goToSlide(r);t.preventDefault()});n(".datePickerCommon").on("shown.bs.modal",function(){n(".dropHolder",this).nwpDatepicker("destroy").nwpDatepicker({startDate:new Date,selectedDateHolder:"[name=DateOfTour],[name=StartDate]",linkedTimePickerFinder:function(t){return n(t).closest(".date-time-wrapp").find("select[name=TimeOfTour]")},linkedTimePickerTimeShiftHours:2});n(".country-flag-and-calling-code",this).nwpPhoneNumberControl("destroy").nwpPhoneNumberControl()});n(".contact-advisors-hold div").each(function(){for(f=n(this).find("p").text(),r=f.split(","),n(".contact-advisors-hold > div > p").css("display","none"),t=0;t<r.length;++t)n(this).append('<div style="margin: 0;"><p>'+r[t]+"<\/p><\/div>")});this.replace_with_template(".products_dropdown","#template_products_dropdown")},equalizeHeights:function(t){var i=[],r;n(t).each(function(){n(this).css("min-height","0");n(this).css("max-height","none");n(this).css("height","auto");i.push(n(this).outerHeight())});r=Math.max.apply(Math,i);n(t).each(function(){n(this).css("height",r+"px")})},reposition:function(t){var t,i=t.find(".modal-dialog");t.css("display","block");i.css("margin-top",Math.max(0,(n(window).height()-i.height())/2));this.equalizeHeights(".community_opt .community_descr");this.equalizeHeights(".col-md-3 > h4");this.equalizeHeights(".fgb-slider-features h4");this.equalizeHeights(".color_opt_description");this.equalizeHeights(".line_1 .community_descr");this.equalizeHeights(".line_2 .community_descr");this.equalizeHeights(".sub_map_t");this.equalizeHeights(".row-icons-wrapp p")},resize_handler:function(){this.equalizeHeights(".mr_descr_wrapp h3");this.equalizeHeights(".community_opt .community_descr");this.equalizeHeights(".line_1 .community_descr");this.equalizeHeights(".line_2 .community_descr");this.equalizeHeights(".city_opt_header h4");this.equalizeHeights(".fgb-slider-features h3");this.equalizeHeights(".color_opt_description");this.equalizeHeights(".city_opt_descr");this.equalizeHeights(".col-md-4 h4.easyOptions");this.equalizeHeights(".sub_map_t");this.equalizeHeights(".mr_text_wrapp");this.equalizeHeights(".get_started_sect .sub_header");this.equalizeHeights("p.index_offer_descr");this.equalizeHeights(".centreTypesHeight-cw p.index_offer_descr");this.equalizeHeights("p.index_offer_price");this.equalizeHeights(".vo-options-descr");this.equalizeHeights(".vo-options-title");this.equalizeHeights(".slider_text_block");this.equalizeHeights(".bottom-cta-holder");this.equalizeHeights(".index_offer_descr_wrapp h4");this.equalizeHeights(".bxslider-app .header");this.equalizeHeights(".bxslider-app .community_descr");this.equalizeHeights(".horizv-map-centrescards .city_opt_header .cta-button");this.equalizeHeights(".optimly-tile-format .city__fromto")},resizeAccordionCheck:function(){window.innerWidth>767?n(".sidebar-inv-accordion").show():n(".sidebar-inv-accordion").hide()},replace_with_template:function(t,i,r){r=r||".original_contents";var u=n(i);u[0]?n(t).replaceWith(function(){var i=n(this).html(),t=n(u.html());return t.find(r).replaceWith(i),t}):console.log("Template "+i+" not found")}};var o=t.anchors={init:function(){n("a[href^=#]:not([href=#])").click(function(t){if(t.target.classList.contains("cmt-wrapper"))return!0;t.preventDefault();o.scroll(n(this).attr("href").substr(1))});document.location.hash&&o.scroll(document.location.hash.substr(1),!1)},scroll:function(t){var i,r,u;try{i=n("#"+t)}catch(f){i=[]}i.length&&(r=i.offset().top,i.hasClass("anchor_header_offset")&&(u=i.css("top"),i.css("top",0),r=i.offset().top-n(".header_fixed").outerHeight(),i.css("top",u)),n("html, body").animate({scrollTop:r},500))}},l=t.cookies_bar={height:0,visible:!1,init:function(){var t=this;n("#cookies_policy").find(".close").on("click",function(){l.close_bar()});AllCookies.get("cpa")!=="true"&&this.show_bar();n(window).resize(_.debounce(function(){t.visible&&(t.setHeight(),n(document).trigger("NWP:CookieBar:resize",[{height:t.getHeight()}]))},300))},show_bar:function(){var t=this;this.setHeight();n("#cookies_policy").fadeIn(function(){t.visible=!0});n(document).trigger("NWP:CookieBar:show",[{height:t.getHeight()}])},close_bar:function(){var t=this,i=n("#NextStepsForm:visible");n("#cookies_policy").fadeOut(function(){t.visible=!1});n("#backToTopArrow").css("bottom",i.length?"110px":n(".footer_mobile_cta").outerHeight()+20+"px");AllCookies.set("cpa",!0,{expires:31536e3});n(document).trigger("NWP:CookieBar:hide")},reset:function(){AllCookies.remove("cpa")},setHeight:function(){this.height=n("#cookies_policy").outerHeight()},getHeight:function(){return this.height}},w=t.rushModal={init:function(){function t(n,t){t||(t=window.location.href);n=n.replace(/[\[\]]/g,"\\$&");var r=new RegExp("[?&]"+n+"(=([^&#]*)|&|#|$)"),i=r.exec(t);return i?i[2]?decodeURIComponent(i[2].replace(/\+/g," ")):"":null}var i=t("FormType");n("#rushModal-modal").on("hidden.bs.modal",function(){AllCookies.set("rushModal",!0,{expires:365})});i==="Rush"&&AllCookies.set("rushModal",!0,{expires:365});AllCookies.get("pageVisited");AllCookies.get("pageVisited")==="true"&&AllCookies.get("refererOrganicOrPpc")==="true"&&AllCookies.get("rushModal")!=="true"&&AllCookies.get("onExitModal")!=="true"&&document.cookie.indexOf("AnyOfForms=submitted")==-1?n("#rushModal-modal").modal("show"):AllCookies.get("rushModal")!=="true"&&AllCookies.get("refererOrganicOrPpc")!=="true"&&AllCookies.get("pageVisited")==="true"&&document.cookie.indexOf("AnyOfForms=submitted")==-1?n("#rushModal-modal").modal("show"):AllCookies.set("pageVisited",!0)},reset:function(){AllCookies.remove("rushModal")}},a=t.onExitModal={init:function(){function u(n,t){t||(t=window.location.href);n=n.replace(/[\[\]]/g,"\\$&");var r=new RegExp("[?&]"+n+"(=([^&#]*)|&|#|$)"),i=r.exec(t);return i?i[2]?decodeURIComponent(i[2].replace(/\+/g," ")):"":null}var i,t,r;if((_.isNull(AllCookies.get("cold_user"))||_.isUndefined(AllCookies.get("cold_user")))&&AllCookies.set("cold_user",!0,{expires:365}),dataLayer[0].Section==="HomePage"&&window.location.search.indexOf("branded=yes")!==-1){AllCookies.get("cold_user")==="true"&&AllCookies.set("cold_user",!1,{expires:365});return}if(!n("#rushModal-modal").length||n("#rushModal-modal").css("display")==="none"){i=u("FormType");i==="OnExitForm"&&(AllCookies.set("onExitModal",!0,{expires:365}),AllCookies.set("cold_user",!1,{expires:365}));t=n(".modal.in");r=t.length===1&&n(t[0]).attr("id")==="hy-regus-pricing"?!1:t.length>0?!0:!1;r||AllCookies.get("onExitModal")==="true"||(document.cookie.indexOf("AnyOfForms=submitted")!==-1?n("#onExitModal-modal").modal("hide"):n("#onExitModal-modal").modal("show"));n("#onExitModal-modal").on("hidden.bs.modal",function(){AllCookies.set("onExitModal",!0,{expires:365});AllCookies.get("cold_user")==="true"&&AllCookies.set("cold_user",!1,{expires:365})})}},reset:function(){AllCookies.remove("onExitModal")}},b=t.dropdown2={init:function(){n(".dropdown2").each(function(){var t=n(this),i=t.find("ul");t.click(function(n){var r=t.find("span.cmt-wrapper");r.length===0&&(i.toggle(),n.stopPropagation())});i.find("li a").click(function(r){var u=n(this).html();t.find("span").html(u);i.toggle();r.stopPropagation()});n(document).click(function(){i.hide()})})}};var k=t.userLocationWithCentresPromiseFunc={init:function(t){var r=AllCookies.get(userLocationWithCentresDataCookieName),i=n.Deferred();return!f()||botsConst.test(navigator.userAgent)?(i.resolve(),i.promise()):(!r||t?n.ajax({url:n("#geolocation-urls").data("getuserlocationwithcentres"),data:{ipParam:t},cache:!1,type:"GET",success:function(n){AllCookies.set(userLocationWithCentresDataCookieName,JSON.stringify(n),{expires:.15,path:"/",secure:"true",sameSite:"Lax"});i.resolve(n)},error:function(n){console.log(n);i.resolve()}}):setTimeout(function(){var n=JSON.parse(r);i.resolve(n)},0),i.promise())}},d=t.callingCodeByIpPromiseFunc={init:function(t){var r=AllCookies.get(callingCodeByIpCookieName),i=n.Deferred();return!f()||botsConst.test(navigator.userAgent)?(i.resolve({CountryName:n("body").data("countryname"),TelephoneCode:n("body").data("country-calling-code"),FlagIcon:n("body").data("flag-icon")}),i.promise()):(!r||t?n.ajax({url:n("#geolocation-urls").data("getcallingcode"),data:{ipParam:t},cache:!1,type:"GET",success:function(n){AllCookies.set(callingCodeByIpCookieName,JSON.stringify(n),{expires:.15,path:"/",secure:"true",sameSite:"lax"});i.resolve(n)},error:function(n){console.log(n);i.resolve()}}):setTimeout(function(){var n=JSON.parse(r);i.resolve(n)},0),i.promise())}},g=t.paidSearchPromiseFunc={init:function(){function i(n,t){t||(t=window.location.href);n=n.replace(/[\[\]]/g,"\\$&");var r=new RegExp("[?&]"+n+"(=([^&#]*)|&|#|$)"),i=r.exec(t);return i?i[2]?decodeURIComponent(i[2].replace(/\+/g," ")):"":null}var r,u=n("#phone-view-mode").data("phone-view-mode"),t=n.Deferred(),f=window.DynamicValuesResolver.dynamicPhoneNumberUrl,e=i("gclid"),o=i("type");return r=n("#skip-changing-phone").data("skip-changing-phone")!=undefined&&n("#skip-changing-phone").data("skip-changing-phone").length?n("#skip-changing-phone").data("skip-changing-phone"):null,n.ajax({url:f,type:"GET",cache:!1,data:{skip:r,viewMode:u,gclidValue:e,typeValue:o},success:function(n){t.resolve(n)},error:function(n){console.log(n);t.resolve()}}),t.promise()}},nt=t.phoneNumbersUpdateFunc={init:function(){n.when(t.geoLocationByIpPromise,t.dynamicPhonePromise).done(function(t,i){var r=JSON.parse(i),u,f,s,o,e;if(r&&r.Cmt)for(o=n(".phone-number[data-text-int], .phone-number[data-href-int], .phone-number [data-text-int], .phone-number [data-href-int]"),e=0;e<o.length;e++)(u=n(o[e]),u.hasClass("skip-replacement"))||(u.is("[data-href-int]")&&(u.attr("href","tel:"+r.Cmt.LocalNumberUnformatted),u.data("href-int","tel:"+r.Cmt.InternationalNumberUnformatted)),u.is("[data-text-int]")&&(u.text(r.Cmt.LocalNumberFormatted),u.data("text-int",r.Cmt.InternationalNumberFormatted)));if(r&&r.Proton&&(f=n(".phone-number-header"),f&&f.length&&(f.attr("href","tel:"+r.Proton.LocalNumberUnformatted),f.data("href-int","tel:"+r.Proton.InternationalNumberUnformatted),f.text(r.Proton.LocalNumberFormatted),f.data("text-int",r.Proton.InternationalNumberFormatted),n("body").css("direction")==="rtl"&&f.css({direction:"ltr"}),s=n("#phone-view-mode").data("phone-view-mode"),s&&f.text(s==="local"?r.Proton.LocalNumberFormatted:s==="global"?r.Proton.InternationalNumberFormatted:r.Proton.LocalNumberFormatted))),t)for(o=n(".phone-number, .phone-number-header"),e=0;e<o.length;e++){var u=n(o[e]),h=u.data("href-int"),c=u.data("text-int");h&&u.attr("href",h);c&&u.html(c)}})}},tt=t.geoLocationByIpPromiseFunc={init:function(t){var r=AllCookies.get(geoLocationByIpCookieName),i=n.Deferred();return!f()||botsConst.test(navigator.userAgent)?(i.resolve(!1),i.promise()):(!r||t?n.ajax({url:n("#geolocation-urls").data("checkinternationalnumber"),data:{ipParam:t},cache:!1,type:"GET",success:function(n){typeof n=="boolean"?(AllCookies.set(geoLocationByIpCookieName,n,{expires:.15,path:"/",secure:"true",sameSite:"Lax"}),i.resolve(n)):(AllCookies.remove(geoLocationByIpCookieName),i.resolve(!1))},error:function(n){console.log(n);i.resolve(!1)}}):setTimeout(function(){var n=r=="true";i.resolve(n)},0),i.promise())}},it=t.geoLocationRedirectPopup={init:function(t){var i=AllCookies.get(geoLocationRedirectPopupCookieName);(!i||t)&&n.ajax({url:n("#geolocation-urls").data("getoverseaspulldown"),data:{ipParam:t},cache:!1,headers:{"browser-language":navigator.language||navigator.userLanguage},method:"GET",success:function(t){var r=n("#overseas-popup-container");t&&r&&r.length?(r.html(t),r.show(),r.find(".close-overseas-pullDown, .overseas-pullDown-main-link-stay").click(function(){r.slideUp(function(){n(document).trigger("NWP:GeolocationPopup:hide")});AllCookies.set(geoLocationRedirectPopupCookieName,!0,{expires:1,path:"/"})}),r.trigger("opened"),n(document).trigger("NWP:GeolocationPopup:show")):AllCookies.set(geoLocationRedirectPopupCookieName,!0,{expires:1,path:"/"});var i=n("#franchiseFormWrap"),u=n("#overseas-popup-container"),s=n(".covid19-banner-wrap");if(i.length&&n(window).innerWidth()>=768&&u.is(":visible")){var f=150,e=u.outerHeight(!0),o=s.outerHeight(!0);i.css({"margin-top":e+o+f-n(document).scrollTop()});i.addClass("franchise-form-handle-top");i.on("sticky_kit:bottom",function(){i.removeClass("franchise-form-handle-top")}).on("sticky_kit:unbottom",function(){i.addClass("franchise-form-handle-top")});n(document).on("scroll",function(){n(document).scrollTop()<=e&&u.is(":visible")&&i.css({"margin-top":e+o+f-n(document).scrollTop()})});n(".close-overseas-pullDown").on("click",function(){i.css({"margin-top":f});n(document).off("scroll");i.off("sticky_kit:bottom").off("sticky_kit:unbottom");i.removeClass("franchise-form-handle-top")})}}})}},rt=t.geoLocationRedirect={init:function(t){var r=AllCookies.get(geoLocationRedirectCookieName),i;(!r||t)&&(i=n("#site-selector"),i.length>0&&n.get(n("#geolocation-urls").data("getcountryswitch"),{ipParam:t,timestamp:(new Date).getTime()},function(t){if(t){i.html(t);n("#site-selector-modal").modal("show");n("#site-selector-modal").on("click",".current-country a",function(){return n("#site-selector-modal").modal("hide"),!1});n("#site-selector-modal").on("hidden.bs.modal",function(){AllCookies.set(geoLocationRedirectCookieName,!0,{expires:1,path:"/"})})}else AllCookies.set(geoLocationRedirectCookieName,!0,{expires:1,path:"/"})}))}};e=window.innerWidth;n(window).resize(function(){u.resize_handler();var t=window.innerWidth;t!==e&&(u.resizeAccordionCheck(),e=t);n(".modal:visible").each(v)});n(window).load(function(){var t,i,r;if(n(window).blur(n.debounce(function(){document.activeElement&&document.activeElement.tagName==="IFRAME"||a.init()},100)),equalizeHeights(".selectedloc-opt"),t=n(".magazineLeft").height(),i=n(".magazineRight").height(),t>i?n(".magazineRight").height(t):n(".magazineLeft").height(i),r="#emailMeForm, #getPricesForm, #quickquoteForm, #emailmeOverlayForm, #bookaTourForm, #makeReferralForm, #referAFriendForm, #bookaTourFormInline",n(r).submit(function(){var t=n(this);t.valid()&&loader("#"+t.attr("id"))}),n("body[data-countryname='China']").length>0){n(".search_field.ui-autocomplete-input").unbind("keyup");n(".search_field.ui-autocomplete-input").on("keyup",function(t){if(t.keyCode===13){var i;if(n("#ui-id-1 li:first-child a")&&n("#ui-id-1 li:first-child a").length){i=n("#ui-id-1 li:first-child a").text();n("#topSearchField").val(i);n("#ui-id-1 li:first-child a").click();return}if(n("#ui-id-2 li:first-child a")&&n("#ui-id-2 li:first-child a").length){i=n("#ui-id-2 li:first-child a").text();n("input.search_field.ui-autocomplete-input").val(i);n("#ui-id-2 li:first-child a").click();return}if(n("#ui-id-3 li:first-child a")&&n("#ui-id-3 li:first-child a").length){i=n("#ui-id-3 li:first-child a").text();n("input.search_field.ui-autocomplete-input").val(i);n("#ui-id-3 li:first-child a").click();return}if(n("#ui-id-4 li:first-child a")&&n("#ui-id-4 li:first-child a").length){i=n("#ui-id-4 li:first-child a").text();n("input.search_field.ui-autocomplete-input").val(i);n("#ui-id-4 li:first-child a").click();return}}})}});n(function(){function u(){var t=n.Deferred();return n.ajax({dataType:"json",url:n("#geolocation-urls").data("getuserlocation"),data:{ipParam:null},cache:!1,headers:{"Cache-Control":"max-age=1000"},success:function(n){t.resolve(n)},error:function(n){console.log(n)}}),t.promise()}var f=n(window).height(),e=n(".footer_bottom").outerHeight()+20,r=n("#cookies_policy").outerHeight()+20,i=n("#NextStepsForm:visible").length?90:0,t;AllCookies.get("cpa")!=="true"?n("#backToTopArrow").css("bottom",r+i+"px"):n("#backToTopArrow").css("bottom",n(".footer_mobile_cta").outerHeight()+20+i+"px");n("#backToTopArrow").on("click",function(){return n("html, body").animate({scrollTop:0},400),!1});n(window).resize(function(){t=window.innerWidth;t>480&&n(window).scrollTop()>1&&n("#backToTopArrow").hide()});n(window).scroll(function(){t=window.innerWidth;t<481&&n(window).scrollTop()>100?n("#backToTopArrow").show():n("#backToTopArrow").hide()});n(".use-location-link").click(function(){var t=n(this);u().then(function(i){var u=t.data("parentautocompletecontainer"),r,f;r=u.length?t.closest(u).find(".search_field.grey-bg-search"):n(".search_field.grey-bg-search");f=i.City&&i.City.length?i.City+", "+i.CountryName:i.CountryName;r.val(f);r.trigger("propertychange")})});n("#livechat-compact-container").length&&n("#cookies_policy").length&&function(){function u(){t.css("display","none");i.css("display","none")}function r(){t.css("display","block");i.css("display","block")}var t=n("#livechat-compact-container"),i=n("#livechat-full");window.AllCookies.get("cpa")!=="true"?u():r();n("#cookies_policy").find(".close").on("click",function(){r()})}();n(".required-asterisk-parent input[tabindex=-1], .honeyPotRushHolder input[tabindex=-1]").on("keyup change",function(){n(this).val("")});n("#bookATour").on("show.bs.modal",function(){n(this).find("[autofocus]").focus();n(".locationAutocomp ").on("input propertychange paste",function(){n("#potential-centre-options").empty();n("#locationInterested").addClass("absoluteDropdownDiv");var t=n.trim(this.value).length;t<1&&n(".locationErrorDrop").length?n(".locationErrorDrop").hide():n(".locationErrorDrop").show();n("#BookAllCentres").length&&n("#bookallcentrescheck").length&&n("#bookAllCentresMode").hide()});n(".chinaFormAutocomp").on("input propertychange paste",function(){n("#potential-centre-options").empty();n(".propertyDisabledFake").removeClass("active");n("#locationInterested").addClass("absoluteDropdownDiv");var t=n.trim(this.value).length;t<1&&n(".locationErrorDrop").length?n(".locationErrorDrop").hide():n(".locationErrorDrop").show();n("#BookAllCentres").length&&n("#bookallcentrescheck").length&&n("#bookAllCentresMode").hide()});n("#bookallcentrescheck").on("change",function(){n("#BookAllCentres").length&&n("#bookallcentrescheck").length&&(n("#bookallcentrescheck").is(":checked")?(n("#BookAllCentres").val("true"),n("#locationInterested").hide()):(n("#BookAllCentres").val("false"),n("#locationInterested").show()))})});n("#bookATour").on("hidden.bs.modal",function(){n("#potential-centre-options").empty();n(".propertyDisabledFake").removeClass("active");n("#locationInterested").addClass("absoluteDropdownDiv");n("#BookAllCentres").length&&n("#bookallcentrescheck").length&&(n("#bookallcentrescheck").off("change"),n("#BookAllCentres").val("false"),n("#bookallcentrescheck").val("false"),n("#bookAllCentresMode").hide(),n("#locationInterested").css("display","block"))})})}(jQuery),function(n){function i(t){var i=t||window.event,e=[].slice.call(arguments,1),r=0,f=0,u=0;return t=n.event.fix(i),t.type="mousewheel",t.wheelDelta&&(r=t.wheelDelta/120),t.detail&&(r=-t.detail/3),u=r,i.axis!==undefined&&i.axis===i.HORIZONTAL_AXIS&&(u=0,f=-1*r),i.wheelDeltaY!==undefined&&(u=i.wheelDeltaY/120),i.wheelDeltaX!==undefined&&(f=i.wheelDeltaX/-120),e.unshift(t,r,f,u),n.event.dispatch.apply(this,e)}var t=["DOMMouseScroll","mousewheel"];n.event.special.mousewheel={setup:function(){if(this.addEventListener)for(var n=t.length;n;)this.addEventListener(t[--n],i,!1);else this.onmousewheel=i},teardown:function(){if(this.removeEventListener)for(var n=t.length;n;)this.removeEventListener(t[--n],i,!1);else this.onmousewheel=null}};n.fn.extend({mousewheel:function(n){return n?this.bind("mousewheel",n):this.trigger("mousewheel")},unmousewheel:function(n){return this.unbind("mousewheel",n)}})}(jQuery),function(n,t,i){n.fn.jScrollPane=function(t){function r(t,r){function ci(r){var h,d,g,y,p,k,nt=!1,tt=!1;if(u=r,f===i)p=t.scrollTop(),k=t.scrollLeft(),t.css({overflow:"hidden",padding:0}),s=t.innerWidth()+st,o=t.innerHeight(),t.width(s),f=n('<div class="jspPane" />').css("padding",vi).append(t.children()),e=n('<div class="jspContainer" />').css({width:s+"px",height:o+"px"}).append(f).appendTo(t);else{if(t.css("width",""),nt=u.stickToBottom&&sr(),tt=u.stickToRight&&hr(),y=t.innerWidth()+st!=s||t.outerHeight()!=o,y&&(s=t.innerWidth()+st,o=t.innerHeight(),e.css({width:s+"px",height:o+"px"})),!y&&yi==v&&f.outerHeight()==a){t.width(s);return}yi=v;f.css("width","");t.width(s);e.find(">.jspVerticalBar,>.jspHorizontalBar").remove().end()}f.css("overflow","auto");v=r.contentWidth?r.contentWidth:f[0].scrollWidth;a=f[0].scrollHeight;f.css("overflow","");ei=v/s;dt=a/o;b=dt>1;w=ei>1;w||b?(t.addClass("jspScrollable"),h=u.maintainPosition&&(c||l),h&&(d=ft(),g=et()),tr(),ir(),rr(),h&&(at(tt?v-s:d,!1),ut(nt?a-o:g,!1)),ar(),cr(),br(),u.enableKeyboardNavigation&&yr(),u.clickOnTrack&&fr(),wr(),u.hijackInternalLinks&&nr()):(t.removeClass("jspScrollable"),f.css({top:0,width:e.width()-st}),lr(),vr(),pr(),ki(),gi());u.autoReinitialise&&!ti?ti=setInterval(function(){ci(u)},u.autoReinitialiseDelay):!u.autoReinitialise&&ti&&clearInterval(ti);p&&t.scrollTop(0)&&ut(p,!1);k&&t.scrollLeft(0)&&at(k,!1);t.trigger("jsp-initialised",[w||b])}function tr(){b&&(e.append(n('<div class="jspVerticalBar" />').append(n('<div class="jspCap jspCapTop" />'),n('<div class="jspTrack" />').append(n('<div class="jspDrag" />').append(n('<div class="jspDragTop" />'),n('<div class="jspDragBottom" />'))),n('<div class="jspCap jspCapBottom" />'))),gt=e.find(">.jspVerticalBar"),d=gt.find(">.jspTrack"),y=d.find(">.jspDrag"),u.showArrows&&(yt=n('<a class="jspArrow jspArrowUp" />').bind("mousedown.jsp",rt(0,-1)).bind("click.jsp",vt),pt=n('<a class="jspArrow jspArrowDown" />').bind("mousedown.jsp",rt(0,1)).bind("click.jsp",vt),u.arrowScrollOnHover&&(yt.bind("mouseover.jsp",rt(0,-1,yt)),pt.bind("mouseover.jsp",rt(0,1,pt))),bi(d,u.verticalArrowPositions,yt,pt)),ct=o,e.find(">.jspVerticalBar>.jspCap:visible,>.jspVerticalBar>.jspArrow").each(function(){ct-=n(this).outerHeight()}),y.hover(function(){y.addClass("jspHover")},function(){y.removeClass("jspHover")}).bind("mousedown.jsp",function(t){n("html").bind("dragstart.jsp selectstart.jsp",vt);y.addClass("jspActive");var i=t.pageY-y.position().top;return n("html").bind("mousemove.jsp",function(n){ht(n.pageY-i,!1)}).bind("mouseup.jsp mouseleave.jsp",di),!1}),pi())}function pi(){d.height(ct+"px");c=0;oi=u.verticalGutter+d.outerWidth();f.width(s-oi-st);try{gt.position().left===0&&f.css("margin-left",oi+"px")}catch(n){}}function ir(){w&&(e.append(n('<div class="jspHorizontalBar" />').append(n('<div class="jspCap jspCapLeft" />'),n('<div class="jspTrack" />').append(n('<div class="jspDrag" />').append(n('<div class="jspDragLeft" />'),n('<div class="jspDragRight" />'))),n('<div class="jspCap jspCapRight" />'))),ni=e.find(">.jspHorizontalBar"),g=ni.find(">.jspTrack"),p=g.find(">.jspDrag"),u.showArrows&&(wt=n('<a class="jspArrow jspArrowLeft" />').bind("mousedown.jsp",rt(-1,0)).bind("click.jsp",vt),bt=n('<a class="jspArrow jspArrowRight" />').bind("mousedown.jsp",rt(1,0)).bind("click.jsp",vt),u.arrowScrollOnHover&&(wt.bind("mouseover.jsp",rt(-1,0,wt)),bt.bind("mouseover.jsp",rt(1,0,bt))),bi(g,u.horizontalArrowPositions,wt,bt)),p.hover(function(){p.addClass("jspHover")},function(){p.removeClass("jspHover")}).bind("mousedown.jsp",function(t){n("html").bind("dragstart.jsp selectstart.jsp",vt);p.addClass("jspActive");var i=t.pageX-p.position().left;return n("html").bind("mousemove.jsp",function(n){lt(n.pageX-i,!1)}).bind("mouseup.jsp mouseleave.jsp",di),!1}),ot=e.innerWidth(),wi())}function wi(){e.find(">.jspHorizontalBar>.jspCap:visible,>.jspHorizontalBar>.jspArrow").each(function(){ot-=n(this).outerWidth()});g.width(ot+"px");l=0}function rr(){if(w&&b){var t=g.outerHeight(),i=d.outerWidth();ct-=t;n(ni).find(">.jspCap:visible,>.jspArrow").each(function(){ot+=n(this).outerWidth()});ot-=i;o-=i;s-=t;g.parent().append(n('<div class="jspCorner" />').css("width",t+"px"));pi();wi()}w&&f.width(e.outerWidth()-st+"px");a=f.outerHeight();dt=a/o;w&&(it=Math.ceil(1/ei*ot),it>u.horizontalDragMaxWidth?it=u.horizontalDragMaxWidth:it<u.horizontalDragMinWidth&&(it=u.horizontalDragMinWidth),p.width(it+"px"),nt=ot-it,ai(l));b&&(tt=Math.ceil(1/dt*ct),tt>u.verticalDragMaxHeight?tt=u.verticalDragMaxHeight:tt<u.verticalDragMinHeight&&(tt=u.verticalDragMinHeight),y.height(tt+"px"),k=ct-tt,li(c))}function bi(n,t,i,r){var u="before",f="after",e;t=="os"&&(t=/Mac/.test(navigator.platform)?"after":"split");t==u?f=t:t==f&&(u=t,e=i,i=r,r=e);n[u](i)[f](r)}function rt(n,t,i){return function(){return ur(n,t,this,i),this.blur(),!1}}function ur(t,i,r,f){r=n(r).addClass("jspActive");var o,e,s=!0,c=function(){t!==0&&h.scrollByX(t*u.arrowButtonSpeed);i!==0&&h.scrollByY(i*u.arrowButtonSpeed);e=setTimeout(c,s?u.initialDelay:u.arrowRepeatFreq);s=!1};c();o=f?"mouseout.jsp":"mouseup.jsp";f=f||n("html");f.bind(o,function(){r.removeClass("jspActive");e&&clearTimeout(e);e=null;f.unbind(o)})}function fr(){ki();b&&d.bind("mousedown.jsp",function(t){if(t.originalTarget===i||t.originalTarget==t.currentTarget){var e=n(this),y=e.offset(),s=t.pageY-y.top-c,r,l=!0,v=function(){var p=e.offset(),n=t.pageY-p.top-tt/2,i=o*u.scrollPagePercent,y=k*i/(a-o);if(s<0)c-y>n?h.scrollByY(-i):ht(n);else if(s>0)c+y<n?h.scrollByY(i):ht(n);else{f();return}r=setTimeout(v,l?u.initialDelay:u.trackClickRepeatFreq);l=!1},f=function(){r&&clearTimeout(r);r=null;n(document).unbind("mouseup.jsp",f)};return v(),n(document).bind("mouseup.jsp",f),!1}});w&&g.bind("mousedown.jsp",function(t){if(t.originalTarget===i||t.originalTarget==t.currentTarget){var e=n(this),y=e.offset(),o=t.pageX-y.left-l,r,c=!0,a=function(){var p=e.offset(),n=t.pageX-p.left-it/2,i=s*u.scrollPagePercent,y=nt*i/(v-s);if(o<0)l-y>n?h.scrollByX(-i):lt(n);else if(o>0)l+y<n?h.scrollByX(i):lt(n);else{f();return}r=setTimeout(a,c?u.initialDelay:u.trackClickRepeatFreq);c=!1},f=function(){r&&clearTimeout(r);r=null;n(document).unbind("mouseup.jsp",f)};return a(),n(document).bind("mouseup.jsp",f),!1}})}function ki(){g&&g.unbind("mousedown.jsp");d&&d.unbind("mousedown.jsp")}function di(){n("html").unbind("dragstart.jsp selectstart.jsp mousemove.jsp mouseup.jsp mouseleave.jsp");y&&y.removeClass("jspActive");p&&p.removeClass("jspActive")}function ht(n,t){b&&(n<0?n=0:n>k&&(n=k),t===i&&(t=u.animateScroll),t?h.animate(y,"top",n,li):(y.css("top",n),li(n)))}function li(n){n===i&&(n=y.position().top);e.scrollTop(0);c=n;var r=c===0,u=c==k,h=n/k,s=-h*(a-o);(ii!=r||ui!=u)&&(ii=r,ui=u,t.trigger("jsp-arrow-change",[ii,ui,ri,fi]));er(r,u);f.css("top",s);t.trigger("jsp-scroll-y",[-s,r,u]).trigger("scroll")}function lt(n,t){w&&(n<0?n=0:n>nt&&(n=nt),t===i&&(t=u.animateScroll),t?h.animate(p,"left",n,ai):(p.css("left",n),ai(n)))}function ai(n){n===i&&(n=p.position().left);e.scrollTop(0);l=n;var r=l===0,u=l==nt,h=n/nt,o=-h*(v-s);(ri!=r||fi!=u)&&(ri=r,fi=u,t.trigger("jsp-arrow-change",[ii,ui,ri,fi]));or(r,u);f.css("left",o);t.trigger("jsp-scroll-x",[-o,r,u]).trigger("scroll")}function er(n,t){u.showArrows&&(yt[n?"addClass":"removeClass"]("jspDisabled"),pt[t?"addClass":"removeClass"]("jspDisabled"))}function or(n,t){u.showArrows&&(wt[n?"addClass":"removeClass"]("jspDisabled"),bt[t?"addClass":"removeClass"]("jspDisabled"))}function ut(n,t){var i=n/(a-o);ht(i*k,t)}function at(n,t){var i=n/(v-s);lt(i*nt,t)}function kt(t,i,r){var f,v,y,h=0,c=0,p,w,b,k,l,a;try{f=n(t)}catch(d){return}for(v=f.outerHeight(),y=f.outerWidth(),e.scrollTop(0),e.scrollLeft(0);!f.is(".jspPane");)if(h+=f.position().top,c+=f.position().left,f=f.offsetParent(),/^body|html$/i.test(f[0].nodeName))return;p=et();b=p+o;h<p||i?l=h-u.verticalGutter:h+v>b&&(l=h-o+v+u.verticalGutter);l&&ut(l,r);w=ft();k=w+s;c<w||i?a=c-u.horizontalGutter:c+y>k&&(a=c-s+y+u.horizontalGutter);a&&at(a,r)}function ft(){return-f.position().left}function et(){return-f.position().top}function sr(){var n=a-o;return n>20&&n-et()<10}function hr(){var n=v-s;return n>20&&n-ft()<10}function cr(){e.unbind(hi).bind(hi,function(n,t,i,r){var f=l,e=c;return h.scrollBy(i*u.mouseWheelSpeed,-r*u.mouseWheelSpeed,!1),f==l&&e==c})}function lr(){e.unbind(hi)}function vt(){return!1}function ar(){f.find(":input,a").unbind("focus.jsp").bind("focus.jsp",function(n){kt(n.target,!1)})}function vr(){f.find(":input,a").unbind("focus.jsp")}function yr(){function v(){var n=l,t=c;switch(i){case 40:h.scrollByY(u.keyboardSpeed,!1);break;case 38:h.scrollByY(-u.keyboardSpeed,!1);break;case 34:case 32:h.scrollByY(o*u.scrollPagePercent,!1);break;case 33:h.scrollByY(-o*u.scrollPagePercent,!1);break;case 39:h.scrollByX(u.keyboardSpeed,!1);break;case 37:h.scrollByX(-u.keyboardSpeed,!1)}return r=n!=l||t!=c}var i,r,s=[];w&&s.push(ni[0]);b&&s.push(gt[0]);f.focus(function(){t.focus()});t.attr("tabindex",0).unbind("keydown.jsp keypress.jsp").bind("keydown.jsp",function(t){if(t.target===this||s.length&&n(t.target).closest(s).length){var u=l,f=c;switch(t.keyCode){case 40:case 38:case 34:case 32:case 33:case 39:case 37:i=t.keyCode;v();break;case 35:ut(a-o);i=null;break;case 36:ut(0);i=null}return r=t.keyCode==i&&u!=l||f!=c,!r}}).bind("keypress.jsp",function(n){return n.keyCode==i&&v(),!r});u.hideFocus?(t.css("outline","none"),"hideFocus"in e[0]&&t.attr("hideFocus",!0)):(t.css("outline",""),"hideFocus"in e[0]&&t.attr("hideFocus",!1))}function pr(){t.attr("tabindex","-1").removeAttr("tabindex").unbind("keydown.jsp keypress.jsp")}function wr(){if(location.hash&&location.hash.length>1){var i,r,t=escape(location.hash);try{i=n(t)}catch(u){return}i.length&&f.find(t)&&(e.scrollTop()===0?r=setInterval(function(){e.scrollTop()>0&&(kt(t,!0),n(document).scrollTop(e.position().top),clearInterval(r))},50):(kt(t,!0),n(document).scrollTop(e.position().top)))}}function gi(){n("a.jspHijack").unbind("click.jsp-hijack").removeClass("jspHijack")}function nr(){gi();n("a[href^=#]").addClass("jspHijack").bind("click.jsp-hijack",function(){var t=this.href.split("#"),n;if(t.length>1&&(n=t[1],n.length>0&&f.find("#"+n).length>0))return kt("#"+n,!0),!1})}function br(){var u,f,t,i,n,r=!1;e.unbind("touchstart.jsp touchmove.jsp touchend.jsp click.jsp-touchclick").bind("touchstart.jsp",function(e){var o=e.originalEvent.touches[0];u=ft();f=et();t=o.pageX;i=o.pageY;n=!1;r=!0}).bind("touchmove.jsp",function(e){if(r){var o=e.originalEvent.touches[0],s=l,a=c;return h.scrollTo(u+t-o.pageX,f+i-o.pageY),n=n||Math.abs(t-o.pageX)>5||Math.abs(i-o.pageY)>5,s==l&&a==c}}).bind("touchend.jsp",function(){r=!1}).bind("click.jsp-touchclick",function(){if(n)return n=!1,!1})}function kr(){var n=et(),i=ft();t.removeClass("jspScrollable").unbind(".jsp");t.replaceWith(si.append(f.children()));si.scrollTop(n);si.scrollLeft(i)}var u,h=this,f,s,o,e,v,a,ei,dt,b,w,y,k,c,p,nt,l,gt,d,oi,ct,tt,yt,pt,ni,g,ot,it,wt,bt,ti,vi,st,yi,ii=!0,ri=!0,ui=!1,fi=!1,si=t.clone(!1,!1).empty(),hi=n.fn.mwheelIntent?"mwheelIntent.jsp":"mousewheel.jsp";vi=t.css("paddingTop")+" "+t.css("paddingRight")+" "+t.css("paddingBottom")+" "+t.css("paddingLeft");st=(parseInt(t.css("paddingLeft"),10)||0)+(parseInt(t.css("paddingRight"),10)||0);n.extend(h,{reinitialise:function(t){t=n.extend({},u,t);ci(t)},scrollToElement:function(n,t,i){kt(n,t,i)},scrollTo:function(n,t,i){at(n,i);ut(t,i)},scrollToX:function(n,t){at(n,t)},scrollToY:function(n,t){ut(n,t)},scrollToPercentX:function(n,t){at(n*(v-s),t)},scrollToPercentY:function(n,t){ut(n*(a-o),t)},scrollBy:function(n,t,i){h.scrollByX(n,i);h.scrollByY(t,i)},scrollByX:function(n,t){var i=ft()+Math[n<0?"floor":"ceil"](n),r=i/(v-s);lt(r*nt,t)},scrollByY:function(n,t){var i=et()+Math[n<0?"floor":"ceil"](n),r=i/(a-o);ht(r*k,t)},positionDragX:function(n,t){lt(n,t)},positionDragY:function(n,t){ht(n,t)},animate:function(n,t,i,r){var f={};f[t]=i;n.animate(f,{duration:u.animateDuration,ease:u.animateEase,queue:!1,step:r})},getContentPositionX:function(){return ft()},getContentPositionY:function(){return et()},getContentWidth:function(){return v},getContentHeight:function(){return a},getPercentScrolledX:function(){return ft()/(v-s)},getPercentScrolledY:function(){return et()/(a-o)},getIsScrollableH:function(){return w},getIsScrollableV:function(){return b},getContentPane:function(){return f},scrollToBottom:function(n){ht(k,n)},hijackInternalLinks:function(){nr()},destroy:function(){kr()}});ci(r)}return t=n.extend({},n.fn.jScrollPane.defaults,t),n.each(["mouseWheelSpeed","arrowButtonSpeed","trackClickSpeed","keyboardSpeed"],function(){t[this]=t[this]||t.speed}),this.each(function(){var u=n(this),i=u.data("jsp");i?i.reinitialise(t):(i=new r(u,t),u.data("jsp",i))})};n.fn.jScrollPane.defaults={showArrows:!1,maintainPosition:!0,stickToBottom:!1,stickToRight:!1,clickOnTrack:!0,autoReinitialise:!1,autoReinitialiseDelay:500,verticalDragMinHeight:0,verticalDragMaxHeight:99999,horizontalDragMinWidth:0,horizontalDragMaxWidth:99999,contentWidth:i,animateScroll:!1,animateDuration:300,animateEase:"linear",hijackInternalLinks:!1,verticalGutter:4,horizontalGutter:4,mouseWheelSpeed:0,arrowButtonSpeed:0,arrowRepeatFreq:50,arrowScrollOnHover:!1,trackClickSpeed:0,trackClickRepeatFreq:70,verticalArrowPositions:"split",horizontalArrowPositions:"split",enableKeyboardNavigation:!0,hideFocus:!1,keyboardSpeed:0,initialDelay:300,speed:30,scrollPagePercent:.8}}(jQuery,this),function(n){typeof define=="function"&&define.amd?define(["jquery"],n):typeof exports=="object"?module.exports=n(require("jquery")):n(jQuery)}(function(n){"use strict";function tt(){var n=t.currentScript||function(){var n=t.getElementsByTagName("script");return n.length?n[n.length-1]:!1}(),i=n?n.src.split("?")[0]:"";return i.split("/").length>0?i.split("/").slice(0,-1).join("/")+"/":""}function ft(n,t,i){for(var r=0,u=t.length;r<u;r++)i(n,t[r])}var a=!1,p=!1,g=0,nt=2e3,s=0,i=n,t=document,r=window,f=i(r),h=[],e=r.requestAnimationFrame||r.webkitRequestAnimationFrame||r.mozRequestAnimationFrame||!1,v=r.cancelAnimationFrame||r.webkitCancelAnimationFrame||r.mozCancelAnimationFrame||!1,w,c,l,d;e?r.cancelAnimationFrame||(v=function(){}):(w=0,e=function(n){var t=(new Date).getTime(),i=Math.max(0,16-(t-w)),u=r.setTimeout(function(){n(t+i)},i);return w=t+i,u},v=function(n){r.clearTimeout(n)});var o=r.MutationObserver||r.WebKitMutationObserver||!1,u=Date.now||function(){return(new Date).getTime()},k={zindex:"auto",cursoropacitymin:0,cursoropacitymax:1,cursorcolor:"#424242",cursorwidth:"5px",scrollspeed:40,mousescrollstep:27,touchbehavior:!1,emulatetouch:!1,hwacceleration:!0,usetransition:!0,boxzoom:!1,dblclickzoom:!0,gesturezoom:!0,grabcursorenabled:!0,autohidemode:!1,background:"",iframeautoresize:!0,cursorminheight:32,preservenativescrolling:!0,railoffset:!1,railhoffset:!1,bouncescroll:!0,spacebarenabled:!0,railpadding:{top:0,right:0,left:0,bottom:0},disableoutline:!0,horizrailenabled:!0,railalign:"right",railvalign:"bottom",enabletranslate3d:!0,enablemousewheel:!0,enablekeyboard:!0,smoothscroll:!0,sensitiverail:!0,enablemouselockapi:!0,cursorfixedheight:!1,directionlockdeadzone:6,hidecursordelay:400,nativeparentscrolling:!0,enablescrollonselection:!0,overflowx:!0,overflowy:!0,cursordragspeed:.3,rtlmode:"auto",cursordragontouch:!1,oneaxismousemode:"auto",scriptpath:tt(),preventmultitouchscrolling:!0,disablemutationobserver:!1,enableobserver:!0,scrollbarid:!1,scrollCLass:!1},b=!1,it=function(){function s(){var u=["grab","-webkit-grab","-moz-grab"],t,f,r;for((n.ischrome&&!n.ischrome38||n.isie)&&(u=[]),t=0,f=u.length;t<f;t++)if(r=u[t],i.cursor=r,i.cursor==r)return r;return"url(https://cdnjs.cloudflare.com/ajax/libs/slider-pro/1.3.0/css/images/openhand.cur),n-resize"}if(b)return b;var u=t.createElement("DIV"),i=u.style,e=navigator.userAgent,f=navigator.platform,n={};return n.haspointerlock="pointerLockElement"in t||"webkitPointerLockElement"in t||"mozPointerLockElement"in t,n.isopera="opera"in r,n.isopera12=n.isopera&&"getUserMedia"in navigator,n.isoperamini=Object.prototype.toString.call(r.operamini)==="[object OperaMini]",n.isie="all"in t&&"attachEvent"in u&&!n.isopera,n.isieold=n.isie&&!("msInterpolationMode"in i),n.isie7=n.isie&&!n.isieold&&(!("documentMode"in t)||t.documentMode===7),n.isie8=n.isie&&"documentMode"in t&&t.documentMode===8,n.isie9=n.isie&&"performance"in r&&t.documentMode===9,n.isie10=n.isie&&"performance"in r&&t.documentMode===10,n.isie11="msRequestFullscreen"in u&&t.documentMode>=11,n.ismsedge="msCredentials"in r,n.ismozilla="MozAppearance"in i,n.iswebkit=!n.ismsedge&&"WebkitAppearance"in i,n.ischrome=n.iswebkit&&"chrome"in r,n.ischrome38=n.ischrome&&"touchAction"in i,n.ischrome22=!n.ischrome38&&n.ischrome&&n.haspointerlock,n.ischrome26=!n.ischrome38&&n.ischrome&&"transition"in i,n.cantouch="ontouchstart"in t.documentElement||"ontouchstart"in r,n.hasw3ctouch=(r.PointerEvent||!1)&&(navigator.maxTouchPoints>0||navigator.msMaxTouchPoints>0),n.hasmstouch=!n.hasw3ctouch&&(r.MSPointerEvent||!1),n.ismac=/^mac$/i.test(f),n.isios=n.cantouch&&/iphone|ipad|ipod/i.test(f),n.isios4=n.isios&&!("seal"in Object),n.isios7=n.isios&&"webkitHidden"in t,n.isios8=n.isios&&"hidden"in t,n.isios10=n.isios&&r.Proxy,n.isandroid=/android/i.test(e),n.haseventlistener="addEventListener"in u,n.trstyle=!1,n.hastransform=!1,n.hastranslate3d=!1,n.transitionstyle=!1,n.hastransition=!1,n.transitionend=!1,n.trstyle="transform",n.hastransform="transform"in i||function(){for(var r=["msTransform","webkitTransform","MozTransform","OTransform"],t=0,u=r.length;t<u;t++)if(i[r[t]]!==undefined){n.trstyle=r[t];break}n.hastransform=!!n.trstyle}(),n.hastransform&&(i[n.trstyle]="translate3d(1px,2px,3px)",n.hastranslate3d=/translate3d/.test(i[n.trstyle])),n.transitionstyle="transition",n.prefixstyle="",n.transitionend="transitionend",n.hastransition="transition"in i||function(){var t,f;n.transitionend=!1;var r=["webkitTransition","msTransition","MozTransition","OTransition","OTransition","KhtmlTransition"],u=["-webkit-","-ms-","-moz-","-o-","-o","-khtml-"],e=["webkitTransitionEnd","msTransitionEnd","transitionend","otransitionend","oTransitionEnd","KhtmlTransitionEnd"];for(t=0,f=r.length;t<f;t++)if(r[t]in i){n.transitionstyle=r[t];n.prefixstyle=u[t];n.transitionend=e[t];break}n.ischrome26&&(n.prefixstyle=u[1]);n.hastransition=n.transitionstyle}(),n.cursorgrabvalue=s(),n.hasmousecapture="setCapture"in u,n.hasMutationObserver=o!==!1,u=null,b=n,n},rt=function(n,c){function pt(){var n=l.doc.css(w.trstyle);return n&&n.substr(0,6)=="matrix"?n.replace(/^.*\((.*)\)$/g,"$1").replace(/px/g,"").split(/, +/):!1}function ti(){var n=l.win,t;if("zIndex"in n)return n.zIndex();while(n.length>0){if(n[0].nodeType==9)return!1;if(t=n.css("zIndex"),!isNaN(t)&&t!==0)return parseInt(t);n=n.parent()}return!1}function ft(n,t,i){var u=n.css(t),r=parseFloat(u),f;return isNaN(r)?(r=wt[u]||0,f=r==3?i?l.win.outerHeight()-l.win.innerHeight():l.win.outerWidth()-l.win.innerWidth():1,l.isie8&&r&&(r+=1),f?r:0):r}function bt(n,t,i,u){l._bind(n,t,function(u){u=u||r.event;var f={original:u,target:u.target||u.srcElement,type:"wheel",deltaMode:u.type=="MozMousePixelScroll"?0:1,deltaX:0,deltaZ:0,preventDefault:function(){return u.preventDefault?u.preventDefault():u.returnValue=!1,!1},stopImmediatePropagation:function(){u.stopImmediatePropagation?u.stopImmediatePropagation():u.cancelBubble=!0}};return t=="mousewheel"?(u.wheelDeltaX&&(f.deltaX=-1/40*u.wheelDeltaX),u.wheelDeltaY&&(f.deltaY=-1/40*u.wheelDeltaY),f.deltaY||f.deltaX||(f.deltaY=-1/40*u.wheelDelta)):f.deltaY=u.detail,i.call(n,f)},u)}function yt(n,t,i,r){var s,e,h,f,o;if(l.scrollrunning||(l.newscrolly=l.getScrollTop(),l.newscrollx=l.getScrollLeft(),vt=u()),s=u()-vt,vt=u(),s>350?et=1:et+=(2-et)/10,n=n*et|0,t=t*et|0,n){if(r)if(n<0){if(l.getScrollLeft()>=l.page.maxw)return!0}else if(l.getScrollLeft()<=0)return!0;e=n>0?1:-1;gt!==e&&(l.scrollmom&&l.scrollmom.stop(),l.newscrollx=l.getScrollLeft(),gt=e);l.lastdeltax-=n}if(t){if(h=function(){var n=l.getScrollTop();if(t<0){if(n>=l.page.maxh)return!0}else if(n<=0)return!0}(),h){if(y.nativeparentscrolling&&i&&!l.ispage&&!l.zoomactive)return!0;f=l.view.h>>1;l.newscrolly<-f?(l.newscrolly=-f,t=-1):l.newscrolly>l.page.maxh+f?(l.newscrolly=l.page.maxh+f,t=1):t=0}o=t>0?1:-1;dt!==o&&(l.scrollmom&&l.scrollmom.stop(),l.newscrolly=l.getScrollTop(),dt=o);l.lastdeltay-=t}(t||n)&&l.synched("relativexy",function(){var t=l.lastdeltay+l.newscrolly,n;l.lastdeltay=0;n=l.lastdeltax+l.newscrollx;l.lastdeltax=0;l.rail.drag||l.doScrollPos(n,t)})}function ni(n,t,i){var r,u,f,e;if(!i&&ht)return!0;if(n.deltaMode===0?(r=-(n.deltaX*(y.mousescrollstep/54))|0,u=-(n.deltaY*(y.mousescrollstep/54))|0):n.deltaMode===1&&(r=-(n.deltaX*y.mousescrollstep*50/80)|0,u=-(n.deltaY*y.mousescrollstep*50/80)|0),t&&y.oneaxismousemode&&r===0&&u&&(r=u,u=0,i&&(f=r<0?l.getScrollLeft()>=l.page.maxw:l.getScrollLeft()<=0,f&&(u=r,r=0))),l.isrtlmode&&(r=-r),e=yt(r,u,i,!0),e)i&&(ht=!0);else return ht=!1,n.stopImmediatePropagation(),n.preventDefault()}var l=this,tt,y,ot,rt,b,w,st,lt,wt,d,at,kt,ht,ct;if(this.version="3.7.6",this.name="nicescroll",this.me=c,tt=i("body"),y=this.opt={doc:tt,win:!1},i.extend(y,k),y.snapbackspeed=80,n||!1)for(ot in y)n[ot]!==undefined&&(y[ot]=n[ot]);if(y.disablemutationobserver&&(o=!1),this.doc=y.doc,this.iddoc=this.doc&&this.doc[0]?this.doc[0].id||"":"",this.ispage=/^BODY|HTML/.test(y.win?y.win[0].nodeName:this.doc[0].nodeName),this.haswrapper=y.win!==!1,this.win=y.win||(this.ispage?f:this.doc),this.docscroll=this.ispage&&!this.haswrapper?f:this.win,this.body=tt,this.viewport=!1,this.isfixed=!1,this.iframe=!1,this.isiframe=this.doc[0].nodeName=="IFRAME"&&this.win[0].nodeName=="IFRAME",this.istextarea=this.win[0].nodeName=="TEXTAREA",this.forcescreen=!1,this.canshowonmouseevent=y.autohidemode!="scroll",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,y.rtlmode=="auto"?(rt=this.win[0]==r?this.body:this.win,b=rt.css("writing-mode")||rt.css("-webkit-writing-mode")||rt.css("-ms-writing-mode")||rt.css("-moz-writing-mode"),b=="horizontal-tb"||b=="lr-tb"||b===""?(this.isrtlmode=rt.css("direction")=="rtl",this.isvertical=!1):(this.isrtlmode=b=="vertical-rl"||b=="tb"||b=="tb-rl"||b=="rl-tb",this.isvertical=b=="vertical-rl"||b=="tb"||b=="tb-rl")):(this.isrtlmode=y.rtlmode===!0,this.isvertical=!1),this.scrollrunning=!1,this.scrollmom=!1,this.observer=!1,this.observerremover=!1,this.observerbody=!1,y.scrollbarid!==!1)this.id=y.scrollbarid;else do this.id="ascrail"+nt++;while(t.getElementById(this.id));if(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.railslocked=!1,this.locked=!1,this.hidden=!1,this.cursoractive=!0,this.wheelprevented=!1,this.overflowx=y.overflowx,this.overflowy=y.overflowy,this.nativescrollingarea=!1,this.checkarea=0,this.events=[],this.saved={},this.delaylist={},this.synclist={},this.lastdeltax=0,this.lastdeltay=0,this.detected=it(),w=i.extend({},this.detected),this.canhwscroll=w.hastransform&&y.hwacceleration,this.ishwscroll=this.canhwscroll&&l.haswrapper,this.hasreversehr=this.isrtlmode?this.isvertical?!(w.iswebkit||w.isie||w.isie11):!(w.iswebkit||w.isie&&!w.isie10&&!w.isie11):!1,this.istouchcapable=!1,!w.cantouch&&(w.hasw3ctouch||w.hasmstouch)?this.istouchcapable=!0:w.cantouch&&!w.isios&&!w.isandroid&&(w.iswebkit||w.ismozilla)&&(this.istouchcapable=!0),y.enablemouselockapi||(w.hasmousecapture=!1,w.haspointerlock=!1),this.debounced=function(n,t,i){if(l){var r=l.delaylist[n]||!1;r||(l.delaylist[n]={h:e(function(){l.delaylist[n].fn.call(l);l.delaylist[n]=!1},i)},t.call(l));l.delaylist[n].fn=t}},this.synched=function(n,t){l.synclist[n]?l.synclist[n]=t:(l.synclist[n]=t,e(function(){l&&(l.synclist[n]&&l.synclist[n].call(l),l.synclist[n]=null)}))},this.unsynched=function(n){l.synclist[n]&&(l.synclist[n]=!1)},this.css=function(n,t){for(var i in t)l.saved.css.push([n,i,n.css(i)]),n.css(i,t[i])},this.scrollTop=function(n){return n===undefined?l.getScrollTop():l.setScrollTop(n)},this.scrollLeft=function(n){return n===undefined?l.getScrollLeft():l.setScrollLeft(n)},st=function(n,t,i,r,f,e,o){this.st=n;this.ed=t;this.spd=i;this.p1=r||0;this.p2=f||1;this.p3=e||0;this.p4=o||1;this.ts=u();this.df=t-n},st.prototype={B2:function(n){return 3*(1-n)*(1-n)*n},B3:function(n){return 3*(1-n)*n*n},B4:function(n){return n*n*n},getPos:function(){return(u()-this.ts)/this.spd},getNow:function(){var n=(u()-this.ts)/this.spd,t=this.B2(n)+this.B3(n)+this.B4(n);return n>=1?this.ed:this.st+this.df*t|0},update:function(n,t){return this.st=this.getNow(),this.ed=n,this.spd=t,this.ts=u(),this.df=this.ed-this.st,this}},this.ishwscroll?(this.doc.translate={x:0,y:0,tx:"0px",ty:"0px"},w.hastranslate3d&&w.isios&&this.doc.css("-webkit-backface-visibility","hidden"),this.getScrollTop=function(n){if(!n){var t=pt();if(t)return t.length==16?-t[13]:-t[5];if(l.timerscroll&&l.timerscroll.bz)return l.timerscroll.bz.getNow()}return l.doc.translate.y},this.getScrollLeft=function(n){if(!n){var t=pt();if(t)return t.length==16?-t[12]:-t[4];if(l.timerscroll&&l.timerscroll.bh)return l.timerscroll.bh.getNow()}return l.doc.translate.x},this.notifyScrollEvent=function(n){var i=t.createEvent("UIEvents");i.initUIEvent("scroll",!1,!1,r,1);i.niceevent=!0;n.dispatchEvent(i)},lt=this.isrtlmode?1:-1,w.hastranslate3d&&y.enabletranslate3d?(this.setScrollTop=function(n,t){l.doc.translate.y=n;l.doc.translate.ty=n*-1+"px";l.doc.css(w.trstyle,"translate3d("+l.doc.translate.tx+","+l.doc.translate.ty+",0)");t||l.notifyScrollEvent(l.win[0])},this.setScrollLeft=function(n,t){l.doc.translate.x=n;l.doc.translate.tx=n*lt+"px";l.doc.css(w.trstyle,"translate3d("+l.doc.translate.tx+","+l.doc.translate.ty+",0)");t||l.notifyScrollEvent(l.win[0])}):(this.setScrollTop=function(n,t){l.doc.translate.y=n;l.doc.translate.ty=n*-1+"px";l.doc.css(w.trstyle,"translate("+l.doc.translate.tx+","+l.doc.translate.ty+")");t||l.notifyScrollEvent(l.win[0])},this.setScrollLeft=function(n,t){l.doc.translate.x=n;l.doc.translate.tx=n*lt+"px";l.doc.css(w.trstyle,"translate("+l.doc.translate.tx+","+l.doc.translate.ty+")");t||l.notifyScrollEvent(l.win[0])})):(this.getScrollTop=function(){return l.docscroll.scrollTop()},this.setScrollTop=function(n){l.docscroll.scrollTop(n)},this.getScrollLeft=function(){return l.hasreversehr?l.detected.ismozilla?l.page.maxw-Math.abs(l.docscroll.scrollLeft()):l.page.maxw-l.docscroll.scrollLeft():l.docscroll.scrollLeft()},this.setScrollLeft=function(n){return setTimeout(function(){if(l)return l.hasreversehr&&(n=l.detected.ismozilla?-(l.page.maxw-n):l.page.maxw-n),l.docscroll.scrollLeft(n)},1)}),this.getTarget=function(n){return n?n.target?n.target:n.srcElement?n.srcElement:!1:!1},this.hasParent=function(n,t){if(!n)return!1;for(var i=n.target||n.srcElement||n||!1;i&&i.id!=t;)i=i.parentNode||!1;return i!==!1},wt={thin:1,medium:3,thick:5},this.getDocumentScrollOffset=function(){return{top:r.pageYOffset||t.documentElement.scrollTop,left:r.pageXOffset||t.documentElement.scrollLeft}},this.getOffset=function(){var n,i,t,r;return l.isfixed?(n=l.win.offset(),i=l.getDocumentScrollOffset(),n.top-=i.top,n.left-=i.left,n):(t=l.win.offset(),!l.viewport)?t:(r=l.viewport.offset(),{top:t.top-r.top,left:t.left-r.left})},this.updateScrollBar=function(n){var t,i,r,u,f;l.ishwscroll?(l.rail.css({height:l.win.innerHeight()-(y.railpadding.top+y.railpadding.bottom)}),l.railh&&l.railh.css({width:l.win.innerWidth()-(y.railpadding.left+y.railpadding.right)})):(r=l.getOffset(),t={top:r.top,left:r.left-(y.railpadding.left+y.railpadding.right)},t.top+=ft(l.win,"border-top-width",!0),t.left+=l.rail.align?l.win.outerWidth()-ft(l.win,"border-right-width")-l.rail.width:ft(l.win,"border-left-width"),i=y.railoffset,i&&(i.top&&(t.top+=i.top),i.left&&(t.left+=i.left)),l.railslocked||l.rail.css({top:t.top,left:t.left,height:(n?n.h:l.win.innerHeight())-(y.railpadding.top+y.railpadding.bottom)}),l.zoom&&l.zoom.css({top:t.top+1,left:l.rail.align==1?t.left-20:t.left+l.rail.width+4}),l.railh&&!l.railslocked&&(t={top:r.top,left:r.left},i=y.railhoffset,i&&(i.top&&(t.top+=i.top),i.left&&(t.left+=i.left)),u=l.railh.align?t.top+ft(l.win,"border-top-width",!0)+l.win.innerHeight()-l.railh.height:t.top+ft(l.win,"border-top-width",!0),f=t.left+ft(l.win,"border-left-width"),l.railh.css({top:u-(y.railpadding.top+y.railpadding.bottom),left:f,width:l.railh.width})))},this.doRailClick=function(n,i,r){var u,e,f,o;l.railslocked||(l.cancelEvent(n),"pageY"in n||(n.pageX=n.clientX+t.documentElement.scrollLeft,n.pageY=n.clientY+t.documentElement.scrollTop),i?(u=r?l.doScrollLeft:l.doScrollTop,f=r?(n.pageX-l.railh.offset().left-l.cursorwidth/2)*l.scrollratio.x:(n.pageY-l.rail.offset().top-l.cursorheight/2)*l.scrollratio.y,l.unsynched("relativexy"),u(f|0)):(u=r?l.doScrollLeftBy:l.doScrollBy,f=r?l.scroll.x:l.scroll.y,o=r?n.pageX-l.railh.offset().left:n.pageY-l.rail.offset().top,e=r?l.view.w:l.view.h,u(f>=o?e:-e)))},l.newscrolly=l.newscrollx=0,l.hasanimationframe="requestAnimationFrame"in r,l.hascancelanimationframe="cancelAnimationFrame"in r,l.hasborderbox=!1,this.init=function(){var v,d,e,n,it,rt,ft,st,c,u,b,nt,at,ht,k,et,ct,lt,h,ot;if((l.saved.css=[],w.isoperamini)||w.isandroid&&!("hidden"in t))return!0;if(y.emulatetouch=y.emulatetouch||y.touchbehavior,l.hasborderbox=r.getComputedStyle&&r.getComputedStyle(t.body)["box-sizing"]==="border-box",v={"overflow-y":"hidden"},(w.isie11||w.isie10)&&(v["-ms-overflow-style"]="none"),l.ishwscroll&&(this.doc.css(w.transitionstyle,w.prefixstyle+"transform 0ms ease-out"),w.transitionend&&l.bind(l.doc,w.transitionend,l.onScrollTransitionEnd,!1)),l.zindex="auto",l.zindex=l.ispage||y.zindex!="auto"?y.zindex:ti()||"auto",!l.ispage&&l.zindex!="auto"&&l.zindex>s&&(s=l.zindex),l.isie&&l.zindex===0&&y.zindex=="auto"&&(l.zindex="auto"),!l.ispage||!w.isieold){d=l.docscroll;l.ispage&&(d=l.haswrapper?l.win:l.doc);l.css(d,v);l.ispage&&(w.isie11||w.isie)&&l.css(i("html"),v);!w.isios||l.ispage||l.haswrapper||l.css(tt,{"-webkit-overflow-scrolling":"touch"});e=i(t.createElement("div"));e.css({position:"relative",top:0,float:"right",width:y.cursorwidth,height:0,"background-color":y.cursorcolor,border:y.cursorborder,"background-clip":"padding-box","-webkit-border-radius":y.cursorborderradius,"-moz-border-radius":y.cursorborderradius,"border-radius":y.cursorborderradius});e.addClass("nicescroll-cursors");l.cursor=e;n=i(t.createElement("div"));n.attr("id",l.id);n.addClass("nicescroll-rails nicescroll-rails-vr");y.scrollCLass&&n.addClass(y.scrollCLass);ft=["left","right","top","bottom"];for(st in ft)rt=ft[st],it=y.railpadding[rt]||0,it&&n.css("padding-"+rt,it+"px");n.append(e);n.width=Math.max(parseFloat(y.cursorwidth),e.outerWidth());n.css({width:n.width+"px",zIndex:l.zindex,background:y.background,cursor:"default"});n.visibility=!0;n.scrollable=!0;n.align=y.railalign=="left"?0:1;l.rail=n;l.rail.drag=!1;c=!1;!y.boxzoom||l.ispage||w.isieold||(c=t.createElement("div"),l.bind(c,"click",l.doZoom),l.bind(c,"mouseenter",function(){l.zoom.css("opacity",y.cursoropacitymax)}),l.bind(c,"mouseleave",function(){l.zoom.css("opacity",y.cursoropacitymin)}),l.zoom=i(c),l.zoom.css({cursor:"pointer",zIndex:l.zindex,backgroundImage:"url("+y.scriptpath+"zoomico.png)",height:18,width:18,backgroundPosition:"0 0"}),y.dblclickzoom&&l.bind(l.win,"dblclick",l.doZoom),w.cantouch&&y.gesturezoom&&(l.ongesturezoom=function(n){return n.scale>1.5&&l.doZoomIn(n),n.scale<.8&&l.doZoomOut(n),l.cancelEvent(n)},l.bind(l.win,"gestureend",l.ongesturezoom)));l.railh=!1;y.horizrailenabled&&(l.css(d,{overflowX:"hidden"}),e=i(t.createElement("div")),e.css({position:"absolute",top:0,height:y.cursorwidth,width:0,backgroundColor:y.cursorcolor,border:y.cursorborder,backgroundClip:"padding-box","-webkit-border-radius":y.cursorborderradius,"-moz-border-radius":y.cursorborderradius,"border-radius":y.cursorborderradius}),w.isieold&&e.css("overflow","hidden"),e.addClass("nicescroll-cursors"),l.cursorh=e,u=i(t.createElement("div")),u.attr("id",l.id+"-hr"),u.addClass("nicescroll-rails nicescroll-rails-hr"),y.scrollCLass&&u.addClass(y.scrollCLass),u.height=Math.max(parseFloat(y.cursorwidth),e.outerHeight()),u.css({height:u.height+"px",zIndex:l.zindex,background:y.background}),u.append(e),u.visibility=!0,u.scrollable=!0,u.align=y.railvalign=="top"?0:1,l.railh=u,l.railh.drag=!1);l.ispage?(n.css({position:"fixed",top:0,height:"100%"}),n.css(n.align?{right:0}:{left:0}),l.body.append(n),l.railh&&(u.css({position:"fixed",left:0,width:"100%"}),u.css(u.align?{bottom:0}:{top:0}),l.body.append(u))):(l.ishwscroll?(l.win.css("position")=="static"&&l.css(l.win,{position:"relative"}),b=l.win[0].nodeName=="HTML"?l.body:l.win,i(b).scrollTop(0).scrollLeft(0),l.zoom&&(l.zoom.css({position:"absolute",top:1,right:0,"margin-right":n.width+4}),b.append(l.zoom)),n.css({position:"absolute",top:0}),n.css(n.align?{right:0}:{left:0}),b.append(n),u&&(u.css({position:"absolute",left:0,bottom:0}),u.css(u.align?{bottom:0}:{top:0}),b.append(u))):(l.isfixed=l.win.css("position")=="fixed",nt=l.isfixed?"fixed":"absolute",l.isfixed||(l.viewport=l.getViewport(l.win[0])),l.viewport&&(l.body=l.viewport,/fixed|absolute/.test(l.viewport.css("position"))||l.css(l.viewport,{position:"relative"})),n.css({position:nt}),l.zoom&&l.zoom.css({position:nt}),l.updateScrollBar(),l.body.append(n),l.zoom&&l.body.append(l.zoom),l.railh&&(u.css({position:nt}),l.body.append(u))),w.isios&&l.css(l.win,{"-webkit-tap-highlight-color":"rgba(0,0,0,0)","-webkit-touch-callout":"none"}),y.disableoutline&&(w.isie&&l.win.attr("hideFocus","true"),w.iswebkit&&l.win.css("outline","none")));y.autohidemode===!1?(l.autohidedom=!1,l.rail.css({opacity:y.cursoropacitymax}),l.railh&&l.railh.css({opacity:y.cursoropacitymax})):y.autohidemode===!0||y.autohidemode==="leave"?(l.autohidedom=i().add(l.rail),w.isie8&&(l.autohidedom=l.autohidedom.add(l.cursor)),l.railh&&(l.autohidedom=l.autohidedom.add(l.railh)),l.railh&&w.isie8&&(l.autohidedom=l.autohidedom.add(l.cursorh))):y.autohidemode=="scroll"?(l.autohidedom=i().add(l.rail),l.railh&&(l.autohidedom=l.autohidedom.add(l.railh))):y.autohidemode=="cursor"?(l.autohidedom=i().add(l.cursor),l.railh&&(l.autohidedom=l.autohidedom.add(l.cursorh))):y.autohidemode=="hidden"&&(l.autohidedom=!1,l.hide(),l.railslocked=!1);(w.cantouch||l.istouchcapable||y.emulatetouch||w.hasmstouch)&&(l.scrollmom=new ut(l),at=null,l.ontouchstart=function(n){var t,e,o,r,u,c;if(l.locked||n.pointerType&&(n.pointerType==="mouse"||n.pointerType===n.MSPOINTER_TYPE_MOUSE))return!1;if(l.hasmoving=!1,l.scrollmom.timer&&(l.triggerScrollEnd(),l.scrollmom.stop()),!l.railslocked){if(t=l.getTarget(n),t&&(e=/INPUT/i.test(t.nodeName)&&/range/i.test(t.type),e))return l.stopPropagation(n);if(o=n.type==="mousedown",!("clientX"in n)&&"changedTouches"in n&&(n.clientX=n.changedTouches[0].clientX,n.clientY=n.changedTouches[0].clientY),l.forcescreen&&(r=n,n={original:n.original?n.original:n},n.clientX=r.screenX,n.clientY=r.screenY),l.rail.drag={x:n.clientX,y:n.clientY,sx:l.scroll.x,sy:l.scroll.y,st:l.getScrollTop(),sl:l.getScrollLeft(),pt:2,dl:!1,tg:t},l.ispage||!y.directionlockdeadzone)l.rail.drag.dl="f";else{var s={w:f.width(),h:f.height()},h=l.getContentSize(),a=h.h-s.h,v=h.w-s.w;l.rail.drag.ck=l.rail.scrollable&&!l.railh.scrollable?a>0?"v":!1:!l.rail.scrollable&&l.railh.scrollable?v>0?"h":!1:!1}if(y.emulatetouch&&l.isiframe&&w.isie&&(u=l.win.position(),l.rail.drag.x+=u.left,l.rail.drag.y+=u.top),l.hasmoving=!1,l.lastmouseup=!1,l.scrollmom.reset(n.clientX,n.clientY),t&&o){if(c=/INPUT|SELECT|BUTTON|TEXTAREA/i.test(t.nodeName),!c)return(w.hasmousecapture&&t.setCapture(),y.emulatetouch)?(!t.onclick||t._onclick||!1||(t._onclick=t.onclick,t.onclick=function(n){if(l.hasmoving)return!1;t._onclick.call(this,n)}),l.cancelEvent(n)):l.stopPropagation(n);/SUBMIT|CANCEL|BUTTON/i.test(i(t).attr("type"))&&(l.preventclick={tg:t,click:!1})}}},l.ontouchend=function(n){if(!l.rail.drag)return!0;if(l.rail.drag.pt==2){if(n.pointerType&&(n.pointerType==="mouse"||n.pointerType===n.MSPOINTER_TYPE_MOUSE))return!1;l.rail.drag=!1;var i=n.type==="mouseup";if(l.hasmoving&&(l.scrollmom.doMomentum(),l.lastmouseup=!0,l.hideCursor(),w.hasmousecapture&&t.releaseCapture(),i))return l.cancelEvent(n)}else if(l.rail.drag.pt==1)return l.onmouseup(n)},ht=y.emulatetouch&&l.isiframe&&!w.hasmousecapture,k=y.directionlockdeadzone*.3|0,l.ontouchmove=function(n,i){var c,a,v,r;if(!l.rail.drag||n.targetTouches&&y.preventmultitouchscrolling&&n.targetTouches.length>1||n.pointerType&&(n.pointerType==="mouse"||n.pointerType===n.MSPOINTER_TYPE_MOUSE))return!0;if(l.rail.drag.pt==2){"changedTouches"in n&&(n.clientX=n.changedTouches[0].clientX,n.clientY=n.changedTouches[0].clientY);a=c=0;ht&&!i&&(v=l.win.position(),a=-v.left,c=-v.top);var s=n.clientY+c,b=s-l.rail.drag.y,h=n.clientX+a,p=h-l.rail.drag.x,u=l.rail.drag.st-b;if(l.ishwscroll&&y.bouncescroll)u<0?u=Math.round(u/2):u>l.page.maxh&&(u=l.page.maxh+Math.round((u-l.page.maxh)/2));else if(u<0?(u=0,s=0):u>l.page.maxh&&(u=l.page.maxh,s=0),s===0&&!l.hasmoving)return l.ispage||(l.rail.drag=!1),!0;if(r=l.getScrollLeft(),l.railh&&l.railh.scrollable&&(r=l.isrtlmode?p-l.rail.drag.sl:l.rail.drag.sl-p,l.ishwscroll&&y.bouncescroll?r<0?r=Math.round(r/2):r>l.page.maxw&&(r=l.page.maxw+Math.round((r-l.page.maxw)/2)):(r<0&&(r=0,h=0),r>l.page.maxw&&(r=l.page.maxw,h=0))),!l.hasmoving){if(l.rail.drag.y===n.clientY&&l.rail.drag.x===n.clientX)return l.cancelEvent(n);var e=Math.abs(b),o=Math.abs(p),f=y.directionlockdeadzone;if(l.rail.drag.ck?l.rail.drag.ck=="v"?o>f&&e<=k?l.rail.drag=!1:e>f&&(l.rail.drag.dl="v"):l.rail.drag.ck=="h"&&(e>f&&o<=k?l.rail.drag=!1:o>f&&(l.rail.drag.dl="h")):e>f&&o>f?l.rail.drag.dl="f":e>f?l.rail.drag.dl=o>k?"f":"v":o>f&&(l.rail.drag.dl=e>k?"f":"h"),!l.rail.drag.dl)return l.cancelEvent(n);l.triggerScrollStart(n.clientX,n.clientY,0,0,0);l.hasmoving=!0}return l.preventclick&&!l.preventclick.click&&(l.preventclick.click=l.preventclick.tg.onclick||!1,l.preventclick.tg.onclick=l.onpreventclick),l.rail.drag.dl&&(l.rail.drag.dl=="v"?r=l.rail.drag.sl:l.rail.drag.dl=="h"&&(u=l.rail.drag.st)),l.synched("touchmove",function(){l.rail.drag&&l.rail.drag.pt==2&&(l.prepareTransition&&l.resetTransition(),l.rail.scrollable&&l.setScrollTop(u),l.scrollmom.update(h,s),l.railh&&l.railh.scrollable?(l.setScrollLeft(r),l.showCursor(u,r)):l.showCursor(u),w.isie10&&t.selection.clear())}),l.cancelEvent(n)}if(l.rail.drag.pt==1)return l.onmousemove(n)},l.ontouchstartCursor=function(n,t){if(!l.rail.drag||l.rail.drag.pt==3){if(l.locked)return l.cancelEvent(n);l.cancelScroll();l.rail.drag={x:n.touches[0].clientX,y:n.touches[0].clientY,sx:l.scroll.x,sy:l.scroll.y,pt:3,hr:!!t};var i=l.getTarget(n);return!l.ispage&&w.hasmousecapture&&i.setCapture(),l.isiframe&&!w.hasmousecapture&&(l.saved.csspointerevents=l.doc.css("pointer-events"),l.css(l.doc,{"pointer-events":"none"})),l.cancelEvent(n)}},l.ontouchendCursor=function(n){if(l.rail.drag)return(w.hasmousecapture&&t.releaseCapture(),l.isiframe&&!w.hasmousecapture&&l.doc.css("pointer-events",l.saved.csspointerevents),l.rail.drag.pt!=3)?void 0:(l.rail.drag=!1,l.cancelEvent(n))},l.ontouchmoveCursor=function(n){var t,i;if(l.rail.drag)return l.rail.drag.pt!=3?void 0:(l.cursorfreezed=!0,l.rail.drag.hr?(l.scroll.x=l.rail.drag.sx+(n.touches[0].clientX-l.rail.drag.x),l.scroll.x<0&&(l.scroll.x=0),t=l.scrollvaluemaxw,l.scroll.x>t&&(l.scroll.x=t)):(l.scroll.y=l.rail.drag.sy+(n.touches[0].clientY-l.rail.drag.y),l.scroll.y<0&&(l.scroll.y=0),i=l.scrollvaluemax,l.scroll.y>i&&(l.scroll.y=i)),l.synched("touchmove",function(){l.rail.drag&&l.rail.drag.pt==3&&(l.showCursor(),l.rail.drag.hr?l.doScrollLeft(Math.round(l.scroll.x*l.scrollratio.x),y.cursordragspeed):l.doScrollTop(Math.round(l.scroll.y*l.scrollratio.y),y.cursordragspeed))}),l.cancelEvent(n))});l.onmousedown=function(n,t){if(!l.rail.drag||l.rail.drag.pt==1){if(l.railslocked)return l.cancelEvent(n);l.cancelScroll();l.rail.drag={x:n.clientX,y:n.clientY,sx:l.scroll.x,sy:l.scroll.y,pt:1,hr:t||!1};var i=l.getTarget(n);return w.hasmousecapture&&i.setCapture(),l.isiframe&&!w.hasmousecapture&&(l.saved.csspointerevents=l.doc.css("pointer-events"),l.css(l.doc,{"pointer-events":"none"})),l.hasmoving=!1,l.cancelEvent(n)}};l.onmouseup=function(n){if(l.rail.drag)return l.rail.drag.pt!=1?!0:(w.hasmousecapture&&t.releaseCapture(),l.isiframe&&!w.hasmousecapture&&l.doc.css("pointer-events",l.saved.csspointerevents),l.rail.drag=!1,l.cursorfreezed=!1,l.hasmoving&&l.triggerScrollEnd(),l.cancelEvent(n))};l.onmousemove=function(n){var t,i;if(l.rail.drag)return l.rail.drag.pt!==1?void 0:w.ischrome&&n.which===0?l.onmouseup(n):(l.cursorfreezed=!0,l.hasmoving||l.triggerScrollStart(n.clientX,n.clientY,0,0,0),l.hasmoving=!0,l.rail.drag.hr?(l.scroll.x=l.rail.drag.sx+(n.clientX-l.rail.drag.x),l.scroll.x<0&&(l.scroll.x=0),t=l.scrollvaluemaxw,l.scroll.x>t&&(l.scroll.x=t)):(l.scroll.y=l.rail.drag.sy+(n.clientY-l.rail.drag.y),l.scroll.y<0&&(l.scroll.y=0),i=l.scrollvaluemax,l.scroll.y>i&&(l.scroll.y=i)),l.synched("mousemove",function(){l.cursorfreezed&&(l.showCursor(),l.rail.drag.hr?l.scrollLeft(Math.round(l.scroll.x*l.scrollratio.x)):l.scrollTop(Math.round(l.scroll.y*l.scrollratio.y)))}),l.cancelEvent(n));l.checkarea=0};w.cantouch||y.emulatetouch?(l.onpreventclick=function(n){if(l.preventclick)return l.preventclick.tg.onclick=l.preventclick.click,l.preventclick=!1,l.cancelEvent(n)},l.onclick=w.isios?!1:function(n){return l.lastmouseup?(l.lastmouseup=!1,l.cancelEvent(n)):!0},y.grabcursorenabled&&w.cursorgrabvalue&&(l.css(l.ispage?l.doc:l.win,{cursor:w.cursorgrabvalue}),l.css(l.rail,{cursor:w.cursorgrabvalue}))):(et=function(n){var i,t,r;l.selectiondrag&&(n&&(i=l.win.outerHeight(),t=n.pageY-l.selectiondrag.top,t>0&&t<i&&(t=0),t>=i&&(t-=i),l.selectiondrag.df=t),l.selectiondrag.df!==0)&&(r=-(l.selectiondrag.df/3)|0,l.doScrollBy(r),l.debounced("doselectionscroll",function(){et()},50))},l.hasTextSelected="getSelection"in t?function(){return t.getSelection().rangeCount>0}:"selection"in t?function(){return t.selection.type!="None"}:function(){return!1},l.onselectionstart=function(){l.ispage||(l.selectiondrag=l.win.offset())},l.onselectionend=function(){l.selectiondrag=!1},l.onselectiondrag=function(n){l.selectiondrag&&l.hasTextSelected()&&l.debounced("selectionscroll",function(){et(n)},250)});w.hasw3ctouch?(l.css(l.ispage?i("html"):l.win,{"touch-action":"none"}),l.css(l.rail,{"touch-action":"none"}),l.css(l.cursor,{"touch-action":"none"}),l.bind(l.win,"pointerdown",l.ontouchstart),l.bind(t,"pointerup",l.ontouchend),l.delegate(t,"pointermove",l.ontouchmove)):w.hasmstouch?(l.css(l.ispage?i("html"):l.win,{"-ms-touch-action":"none"}),l.css(l.rail,{"-ms-touch-action":"none"}),l.css(l.cursor,{"-ms-touch-action":"none"}),l.bind(l.win,"MSPointerDown",l.ontouchstart),l.bind(t,"MSPointerUp",l.ontouchend),l.delegate(t,"MSPointerMove",l.ontouchmove),l.bind(l.cursor,"MSGestureHold",function(n){n.preventDefault()}),l.bind(l.cursor,"contextmenu",function(n){n.preventDefault()})):w.cantouch&&(l.bind(l.win,"touchstart",l.ontouchstart,!1,!0),l.bind(t,"touchend",l.ontouchend,!1,!0),l.bind(t,"touchcancel",l.ontouchend,!1,!0),l.delegate(t,"touchmove",l.ontouchmove,!1,!0));y.emulatetouch&&(l.bind(l.win,"mousedown",l.ontouchstart,!1,!0),l.bind(t,"mouseup",l.ontouchend,!1,!0),l.bind(t,"mousemove",l.ontouchmove,!1,!0));!y.cursordragontouch&&(w.cantouch||y.emulatetouch)||(l.rail.css({cursor:"default"}),l.railh&&l.railh.css({cursor:"default"}),l.jqbind(l.rail,"mouseenter",function(){if(!l.ispage&&!l.win.is(":visible"))return!1;l.canshowonmouseevent&&l.showCursor();l.rail.active=!0}),l.jqbind(l.rail,"mouseleave",function(){l.rail.active=!1;l.rail.drag||l.hideCursor()}),y.sensitiverail&&(l.bind(l.rail,"click",function(n){l.doRailClick(n,!1,!1)}),l.bind(l.rail,"dblclick",function(n){l.doRailClick(n,!0,!1)}),l.bind(l.cursor,"click",function(n){l.cancelEvent(n)}),l.bind(l.cursor,"dblclick",function(n){l.cancelEvent(n)})),l.railh&&(l.jqbind(l.railh,"mouseenter",function(){if(!l.ispage&&!l.win.is(":visible"))return!1;l.canshowonmouseevent&&l.showCursor();l.rail.active=!0}),l.jqbind(l.railh,"mouseleave",function(){l.rail.active=!1;l.rail.drag||l.hideCursor()}),y.sensitiverail&&(l.bind(l.railh,"click",function(n){l.doRailClick(n,!1,!0)}),l.bind(l.railh,"dblclick",function(n){l.doRailClick(n,!0,!0)}),l.bind(l.cursorh,"click",function(n){l.cancelEvent(n)}),l.bind(l.cursorh,"dblclick",function(n){l.cancelEvent(n)}))));y.cursordragontouch&&(this.istouchcapable||w.cantouch)&&(l.bind(l.cursor,"touchstart",l.ontouchstartCursor),l.bind(l.cursor,"touchmove",l.ontouchmoveCursor),l.bind(l.cursor,"touchend",l.ontouchendCursor),l.cursorh&&l.bind(l.cursorh,"touchstart",function(n){l.ontouchstartCursor(n,!0)}),l.cursorh&&l.bind(l.cursorh,"touchmove",l.ontouchmoveCursor),l.cursorh&&l.bind(l.cursorh,"touchend",l.ontouchendCursor));y.emulatetouch||w.isandroid||w.isios?(l.bind(w.hasmousecapture?l.win:t,"mouseup",l.ontouchend),l.onclick&&l.bind(t,"click",l.onclick),y.cursordragontouch?(l.bind(l.cursor,"mousedown",l.onmousedown),l.bind(l.cursor,"mouseup",l.onmouseup),l.cursorh&&l.bind(l.cursorh,"mousedown",function(n){l.onmousedown(n,!0)}),l.cursorh&&l.bind(l.cursorh,"mouseup",l.onmouseup)):(l.bind(l.rail,"mousedown",function(n){n.preventDefault()}),l.railh&&l.bind(l.railh,"mousedown",function(n){n.preventDefault()}))):(l.bind(w.hasmousecapture?l.win:t,"mouseup",l.onmouseup),l.bind(t,"mousemove",l.onmousemove),l.onclick&&l.bind(t,"click",l.onclick),l.bind(l.cursor,"mousedown",l.onmousedown),l.bind(l.cursor,"mouseup",l.onmouseup),l.railh&&(l.bind(l.cursorh,"mousedown",function(n){l.onmousedown(n,!0)}),l.bind(l.cursorh,"mouseup",l.onmouseup)),!l.ispage&&y.enablescrollonselection&&(l.bind(l.win[0],"mousedown",l.onselectionstart),l.bind(t,"mouseup",l.onselectionend),l.bind(l.cursor,"mouseup",l.onselectionend),l.cursorh&&l.bind(l.cursorh,"mouseup",l.onselectionend),l.bind(t,"mousemove",l.onselectiondrag)),l.zoom&&(l.jqbind(l.zoom,"mouseenter",function(){l.canshowonmouseevent&&l.showCursor();l.rail.active=!0}),l.jqbind(l.zoom,"mouseleave",function(){l.rail.active=!1;l.rail.drag||l.hideCursor()})));y.enablemousewheel&&(l.isiframe||l.mousewheel(w.isie&&l.ispage?t:l.win,l.onmousewheel),l.mousewheel(l.rail,l.onmousewheel),l.railh&&l.mousewheel(l.railh,l.onmousewheelhr));l.ispage||w.cantouch||/HTML|^BODY/.test(l.win[0].nodeName)||(l.win.attr("tabindex")||l.win.attr({tabindex:++g}),l.bind(l.win,"focus",function(n){a=l.getTarget(n).id||l.getTarget(n)||!1;l.hasfocus=!0;l.canshowonmouseevent&&l.noticeCursor()}),l.bind(l.win,"blur",function(){a=!1;l.hasfocus=!1}),l.bind(l.win,"mouseenter",function(n){p=l.getTarget(n).id||l.getTarget(n)||!1;l.hasmousefocus=!0;l.canshowonmouseevent&&l.noticeCursor()}),l.bind(l.win,"mouseleave",function(){p=!1;l.hasmousefocus=!1;l.rail.drag||l.hideCursor()}));l.onkeypress=function(n){var u,o,e;if(l.railslocked&&l.page.maxh===0||(n=n||r.event,u=l.getTarget(n),u&&/INPUT|TEXTAREA|SELECT|OPTION/.test(u.nodeName)&&(o=u.getAttribute("type")||u.type||!1,!o||!/submit|button|cancel/i.tp))||i(u).attr("contenteditable"))return!0;if(l.hasfocus||l.hasmousefocus&&!a||l.ispage&&!a&&!p){if(e=n.keyCode,l.railslocked&&e!=27)return l.cancelEvent(n);var f=n.ctrlKey||!1,s=n.shiftKey||!1,t=!1;switch(e){case 38:case 63233:l.doScrollBy(72);t=!0;break;case 40:case 63235:l.doScrollBy(-72);t=!0;break;case 37:case 63232:l.railh&&(f?l.doScrollLeft(0):l.doScrollLeftBy(72),t=!0);break;case 39:case 63234:l.railh&&(f?l.doScrollLeft(l.page.maxw):l.doScrollLeftBy(-72),t=!0);break;case 33:case 63276:l.doScrollBy(l.view.h);t=!0;break;case 34:case 63277:l.doScrollBy(-l.view.h);t=!0;break;case 36:case 63273:l.railh&&f?l.doScrollPos(0,0):l.doScrollTo(0);t=!0;break;case 35:case 63275:l.railh&&f?l.doScrollPos(l.page.maxw,l.page.maxh):l.doScrollTo(l.page.maxh);t=!0;break;case 32:y.spacebarenabled&&(s?l.doScrollBy(l.view.h):l.doScrollBy(-l.view.h),t=!0);break;case 27:l.zoomactive&&(l.doZoom(),t=!0)}if(t)return l.cancelEvent(n)}};y.enablekeyboard&&l.bind(t,w.isopera&&!w.isopera12?"keypress":"keydown",l.onkeypress);l.bind(t,"keydown",function(n){var t=n.ctrlKey||!1;t&&(l.wheelprevented=!0)});l.bind(t,"keyup",function(n){var t=n.ctrlKey||!1;t||(l.wheelprevented=!1)});l.bind(r,"blur",function(){l.wheelprevented=!1});l.bind(r,"resize",l.onscreenresize);l.bind(r,"orientationchange",l.onscreenresize);l.bind(r,"load",l.lazyResize);!w.ischrome||l.ispage||l.haswrapper||(ct=l.win.attr("style"),lt=parseFloat(l.win.css("width"))+1,l.win.css("width",lt),l.synched("chromefix",function(){l.win.attr("style",ct)}));l.onAttributeChange=function(){l.lazyResize(l.isieold?250:30)};y.enableobserver&&(l.isie11||o===!1||(l.observerbody=new o(function(n){return n.forEach(function(n){if(n.type=="attributes")return tt.hasClass("modal-open")&&tt.hasClass("modal-dialog")&&!i.contains(i(".modal-dialog")[0],l.doc[0])?l.hide():l.show()}),l.me.clientWidth!=l.page.width||l.me.clientHeight!=l.page.height?l.lazyResize(30):void 0}),l.observerbody.observe(t.body,{childList:!0,subtree:!0,characterData:!1,attributes:!0,attributeFilter:["class"]})),l.ispage||l.haswrapper||(h=l.win[0],o!==!1?(l.observer=new o(function(n){n.forEach(l.onAttributeChange)}),l.observer.observe(h,{childList:!0,characterData:!1,attributes:!0,subtree:!1}),l.observerremover=new o(function(n){n.forEach(function(n){if(n.removedNodes.length>0)for(var t in n.removedNodes)if(!!l&&n.removedNodes[t]===h)return l.remove()})}),l.observerremover.observe(h.parentNode,{childList:!0,characterData:!1,attributes:!1,subtree:!1})):(l.bind(h,w.isie&&!w.isie9?"propertychange":"DOMAttrModified",l.onAttributeChange),w.isie9&&h.attachEvent("onpropertychange",l.onAttributeChange),l.bind(h,"DOMNodeRemoved",function(n){n.target===h&&l.remove()}))));!l.ispage&&y.boxzoom&&l.bind(r,"resize",l.resizeZoom);l.istextarea&&(l.bind(l.win,"keydown",l.lazyResize),l.bind(l.win,"mouseup",l.lazyResize));l.lazyResize(30)}this.doc[0].nodeName=="IFRAME"&&(ot=function(){var n,u,t;l.iframexd=!1;try{n="contentDocument"in this?this.contentDocument:this.contentWindow._doc;u=n.domain}catch(f){l.iframexd=!0;n=!1}if(l.iframexd)return"console"in r&&console.log("NiceScroll error: policy restriced iframe"),!0;l.forcescreen=!0;l.isiframe&&(l.iframe={doc:i(n),html:l.doc.contents().find("html")[0],body:l.doc.contents().find("body")[0]},l.getContentSize=function(){return{w:Math.max(l.iframe.html.scrollWidth,l.iframe.body.scrollWidth),h:Math.max(l.iframe.html.scrollHeight,l.iframe.body.scrollHeight)}},l.docscroll=i(l.iframe.body));w.isios||!y.iframeautoresize||l.isiframe||(l.win.scrollTop(0),l.doc.height(""),t=Math.max(n.getElementsByTagName("html")[0].scrollHeight,n.body.scrollHeight),l.doc.height(t));l.lazyResize(30);l.css(i(l.iframe.body),v);w.isios&&l.haswrapper&&l.css(i(n.body),{"-webkit-transform":"translate3d(0,0,0)"});"contentWindow"in this?l.bind(this.contentWindow,"scroll",l.onscroll):l.bind(n,"scroll",l.onscroll);y.enablemousewheel&&l.mousewheel(n,l.onmousewheel);y.enablekeyboard&&l.bind(n,w.isopera?"keypress":"keydown",l.onkeypress);w.cantouch?(l.bind(n,"touchstart",l.ontouchstart),l.bind(n,"touchmove",l.ontouchmove)):y.emulatetouch&&(l.bind(n,"mousedown",l.ontouchstart),l.bind(n,"mousemove",function(n){return l.ontouchmove(n,!0)}),y.grabcursorenabled&&w.cursorgrabvalue&&l.css(i(n.body),{cursor:w.cursorgrabvalue}));l.bind(n,"mouseup",l.ontouchend);l.zoom&&(y.dblclickzoom&&l.bind(n,"dblclick",l.doZoom),l.ongesturezoom&&l.bind(n,"gestureend",l.ongesturezoom))},this.doc[0].readyState&&this.doc[0].readyState==="complete"&&setTimeout(function(){ot.call(l.doc[0],!1)},500),l.bind(this.doc,"load",ot))},this.showCursor=function(n,t){if(l.cursortimeout&&(clearTimeout(l.cursortimeout),l.cursortimeout=0),l.rail){if(l.autohidedom&&(l.autohidedom.stop().css({opacity:y.cursoropacitymax}),l.cursoractive=!0),l.rail.drag&&l.rail.drag.pt==1||(n!==undefined&&n!==!1&&(l.scroll.y=n/l.scrollratio.y|0),t!==undefined&&(l.scroll.x=t/l.scrollratio.x|0)),l.cursor.css({height:l.cursorheight,top:l.scroll.y}),l.cursorh){var i=l.hasreversehr?l.scrollvaluemaxw-l.scroll.x:l.scroll.x;l.cursorh.css({width:l.cursorwidth,left:!l.rail.align&&l.rail.visibility?i+l.rail.width:i});l.cursoractive=!0}l.zoom&&l.zoom.stop().css({opacity:y.cursoropacitymax})}},this.hideCursor=function(n){l.cursortimeout||l.rail&&l.autohidedom&&(l.hasmousefocus&&y.autohidemode==="leave"||(l.cursortimeout=setTimeout(function(){l.rail.active&&l.showonmouseevent||(l.autohidedom.stop().animate({opacity:y.cursoropacitymin}),l.zoom&&l.zoom.stop().animate({opacity:y.cursoropacitymin}),l.cursoractive=!1);l.cursortimeout=0},n||y.hidecursordelay)))},this.noticeCursor=function(n,t,i){l.showCursor(t,i);l.rail.active||l.hideCursor(n)},this.getContentSize=l.ispage?function(){return{w:Math.max(t.body.scrollWidth,t.documentElement.scrollWidth),h:Math.max(t.body.scrollHeight,t.documentElement.scrollHeight)}}:l.haswrapper?function(){return{w:l.doc[0].offsetWidth,h:l.doc[0].offsetHeight}}:function(){return{w:l.docscroll[0].scrollWidth,h:l.docscroll[0].scrollHeight}},this.onResize=function(n,t){var i,r,u;if(!l||!l.win)return!1;var f=l.page.maxh,e=l.page.maxw,o=l.view.h,s=l.view.w;if(l.view={w:l.ispage?l.win.width():l.win[0].clientWidth,h:l.ispage?l.win.height():l.win[0].clientHeight},l.page=t?t:l.getContentSize(),l.page.maxh=Math.max(0,l.page.h-l.view.h),l.page.maxw=Math.max(0,l.page.w-l.view.w),l.page.maxh==f&&l.page.maxw==e&&l.view.w==s&&l.view.h==o){if(l.ispage||(i=l.win.offset(),l.lastposition&&(r=l.lastposition,r.top==i.top&&r.left==i.left)))return l;l.lastposition=i}return(l.page.maxh===0?(l.hideRail(),l.scrollvaluemax=0,l.scroll.y=0,l.scrollratio.y=0,l.cursorheight=0,l.setScrollTop(0),l.rail&&(l.rail.scrollable=!1)):(l.page.maxh-=y.railpadding.top+y.railpadding.bottom,l.rail.scrollable=!0),l.page.maxw===0?(l.hideRailHr(),l.scrollvaluemaxw=0,l.scroll.x=0,l.scrollratio.x=0,l.cursorwidth=0,l.setScrollLeft(0),l.railh&&(l.railh.scrollable=!1)):(l.page.maxw-=y.railpadding.left+y.railpadding.right,l.railh&&(l.railh.scrollable=y.horizrailenabled)),l.railslocked=l.locked||l.page.maxh===0&&l.page.maxw===0,l.railslocked)?(l.ispage||l.updateScrollBar(l.view),!1):(l.hidden||(l.rail.visibility||l.showRail(),l.railh&&!l.railh.visibility&&l.showRailHr()),l.istextarea&&l.win.css("resize")&&l.win.css("resize")!="none"&&(l.view.h-=20),l.cursorheight=Math.min(l.view.h,Math.round(l.view.h*(l.view.h/l.page.h))),l.cursorheight=y.cursorfixedheight?y.cursorfixedheight:Math.max(y.cursorminheight,l.cursorheight),l.cursorwidth=Math.min(l.view.w,Math.round(l.view.w*(l.view.w/l.page.w))),l.cursorwidth=y.cursorfixedheight?y.cursorfixedheight:Math.max(y.cursorminheight,l.cursorwidth),l.scrollvaluemax=l.view.h-l.cursorheight-(y.railpadding.top+y.railpadding.bottom),l.hasborderbox||(l.scrollvaluemax-=l.cursor[0].offsetHeight-l.cursor[0].clientHeight),l.railh&&(l.railh.width=l.page.maxh>0?l.view.w-l.rail.width:l.view.w,l.scrollvaluemaxw=l.railh.width-l.cursorwidth-(y.railpadding.left+y.railpadding.right)),l.ispage||l.updateScrollBar(l.view),l.scrollratio={x:l.page.maxw/l.scrollvaluemaxw,y:l.page.maxh/l.scrollvaluemax},u=l.getScrollTop(),u>l.page.maxh?l.doScrollTop(l.page.maxh):(l.scroll.y=l.getScrollTop()/l.scrollratio.y|0,l.scroll.x=l.getScrollLeft()/l.scrollratio.x|0,l.cursoractive&&l.noticeCursor()),l.scroll.y&&l.getScrollTop()===0&&l.doScrollTo(l.scroll.y*l.scrollratio.y|0),l)},this.resize=l.onResize,d=0,this.onscreenresize=function(){clearTimeout(d);var n=!l.ispage&&!l.haswrapper;n&&l.hideRails();d=setTimeout(function(){l&&(n&&l.showRails(),l.resize());d=0},120)},this.lazyResize=function(n){return clearTimeout(d),n=isNaN(n)?240:n,d=setTimeout(function(){l&&l.resize();d=0},n),l},this.jqbind=function(n,t,r){l.events.push({e:n,n:t,f:r,q:!0});i(n).on(t,r)},this.mousewheel=function(n,i,r){var u="jquery"in n?n[0]:n,f;"onwheel"in t.createElement("div")?l._bind(u,"wheel",i,r||!1):(f=t.onmousewheel!==undefined?"mousewheel":"DOMMouseScroll",bt(u,f,i,r||!1),f=="DOMMouseScroll"&&bt(u,"MozMousePixelScroll",i,r||!1))},at=!1,w.haseventlistener){try{kt=Object.defineProperty({},"passive",{get:function(){at=!0}});r.addEventListener("test",null,kt)}catch(ii){}this.stopPropagation=function(n){return n?(n=n.original?n.original:n,n.stopPropagation(),!1):!1};this.cancelEvent=function(n){return n.cancelable&&n.preventDefault(),n.stopImmediatePropagation(),n.preventManipulation&&n.preventManipulation(),!1}}else Event.prototype.preventDefault=function(){this.returnValue=!1},Event.prototype.stopPropagation=function(){this.cancelBubble=!0},r.constructor.prototype.addEventListener=t.constructor.prototype.addEventListener=Element.prototype.addEventListener=function(n,t){this.attachEvent("on"+n,t)},r.constructor.prototype.removeEventListener=t.constructor.prototype.removeEventListener=Element.prototype.removeEventListener=function(n,t){this.detachEvent("on"+n,t)},this.cancelEvent=function(n){return n=n||r.event,n&&(n.cancelBubble=!0,n.cancel=!0,n.returnValue=!1),!1},this.stopPropagation=function(n){return n=n||r.event,n&&(n.cancelBubble=!0),!1};this.delegate=function(n,t,i,r,u){var f=h[t]||!1;f||(f={a:[],l:[],f:function(n){for(var r=f.l,u=r.length-1,t=!1,i=u;i>=0;i--)if(t=r[i].call(n.target,n),t===!1)return!1;return t}},l.bind(n,t,f.f,r,u),h[t]=f);l.ispage?(f.a=[l.id].concat(f.a),f.l=[i].concat(f.l)):(f.a.push(l.id),f.l.push(i))};this.undelegate=function(n,t){var i=h[t]||!1,r,u;if(i&&i.l)for(r=0,u=i.l.length;r<u;r++)i.a[r]===l.id&&(i.a.splice(r),i.l.splice(r),i.a.length===0&&(l._unbind(n,t,i.l.f),h[t]=null))};this.bind=function(n,t,i,r,u){var f="jquery"in n?n[0]:n;l._bind(f,t,i,r||!1,u||!1)};this._bind=function(n,t,i,r,u){l.events.push({e:n,n:t,f:i,b:r,q:!1});at&&u?n.addEventListener(t,i,{passive:!1,capture:r}):n.addEventListener(t,i,r||!1)};this._unbind=function(n,t,i,r){h[t]?l.undelegate(n,t,i,r):n.removeEventListener(t,i,r)};this.unbindAll=function(){for(var n,t=0;t<l.events.length;t++)n=l.events[t],n.q?n.e.unbind(n.n,n.f):l._unbind(n.e,n.n,n.f,n.b)};this.showRails=function(){return l.showRail().showRailHr()};this.showRail=function(){return l.page.maxh!==0&&(l.ispage||l.win.css("display")!="none")&&(l.rail.visibility=!0,l.rail.css("display","block")),l};this.showRailHr=function(){return l.railh&&l.page.maxw!==0&&(l.ispage||l.win.css("display")!="none")&&(l.railh.visibility=!0,l.railh.css("display","block")),l};this.hideRails=function(){return l.hideRail().hideRailHr()};this.hideRail=function(){return l.rail.visibility=!1,l.rail.css("display","none"),l};this.hideRailHr=function(){return l.railh&&(l.railh.visibility=!1,l.railh.css("display","none")),l};this.show=function(){return l.hidden=!1,l.railslocked=!1,l.showRails()};this.hide=function(){return l.hidden=!0,l.railslocked=!0,l.hideRails()};this.toggle=function(){return l.hidden?l.show():l.hide()};this.remove=function(){var u,r,t,n,f;l.stop();l.cursortimeout&&clearTimeout(l.cursortimeout);for(u in l.delaylist)l.delaylist[u]&&v(l.delaylist[u].h);for(l.doZoomOut(),l.unbindAll(),w.isie9&&l.win[0].detachEvent("onpropertychange",l.onAttributeChange),l.observer!==!1&&l.observer.disconnect(),l.observerremover!==!1&&l.observerremover.disconnect(),l.observerbody!==!1&&l.observerbody.disconnect(),l.events=null,l.cursor&&l.cursor.remove(),l.cursorh&&l.cursorh.remove(),l.rail&&l.rail.remove(),l.railh&&l.railh.remove(),l.zoom&&l.zoom.remove(),r=0;r<l.saved.css.length;r++)t=l.saved.css[r],t[0].css(t[1],t[2]===undefined?"":t[2]);l.saved=!1;l.me.data("__nicescroll","");n=i.nicescroll;n.each(function(t){if(this&&this.id===l.id){delete n[t];for(var i=++t;i<n.length;i++,t++)n[t]=n[i];n.length--;n.length&&delete n[n.length]}});for(f in l)l[f]=null,delete l[f];l=null};this.scrollstart=function(n){return this.onscrollstart=n,l};this.scrollend=function(n){return this.onscrollend=n,l};this.scrollcancel=function(n){return this.onscrollcancel=n,l};this.zoomin=function(n){return this.onzoomin=n,l};this.zoomout=function(n){return this.onzoomout=n,l};this.isScrollable=function(n){var t=n.target?n.target:n,r,u;if(t.nodeName=="OPTION")return!0;while(t&&t.nodeType==1&&t!==this.me[0]&&!/^BODY|HTML/.test(t.nodeName)){if(r=i(t),u=r.css("overflowY")||r.css("overflowX")||r.css("overflow")||"",/scroll|auto/.test(u))return t.clientHeight!=t.scrollHeight;t=t.parentNode?t.parentNode:!1}return!1};this.getViewport=function(n){for(var t=n&&n.parentNode?n.parentNode:!1,r,u;t&&t.nodeType==1&&!/^BODY|HTML/.test(t.nodeName);){if((r=i(t),/fixed|absolute/.test(r.css("position")))||(u=r.css("overflowY")||r.css("overflowX")||r.css("overflow")||"",/scroll|auto/.test(u)&&t.clientHeight!=t.scrollHeight)||r.getNiceScroll().length>0)return r;t=t.parentNode?t.parentNode:!1}return!1};this.triggerScrollStart=function(n,t,i,r,u){if(l.onscrollstart){var f={type:"scrollstart",current:{x:n,y:t},request:{x:i,y:r},end:{x:l.newscrollx,y:l.newscrolly},speed:u};l.onscrollstart.call(l,f)}};this.triggerScrollEnd=function(){if(l.onscrollend){var n=l.getScrollLeft(),t=l.getScrollTop(),i={type:"scrollend",current:{x:n,y:t},end:{x:n,y:t}};l.onscrollend.call(l,i)}};var dt=0,gt=0,vt=0,et=1;ht=!1;this.onmousewheel=function(n){var t,i,r;return l.wheelprevented||l.locked?!1:l.railslocked?(l.debounced("checkunlock",l.resize,250),!1):l.rail.drag?l.cancelEvent(n):(y.oneaxismousemode==="auto"&&n.deltaX!==0&&(y.oneaxismousemode=!1),y.oneaxismousemode&&n.deltaX===0&&!l.rail.scrollable)?l.railh&&l.railh.scrollable?l.onmousewheelhr(n):!0:(t=u(),i=!1,y.preservenativescrolling&&l.checkarea+600<t&&(l.nativescrollingarea=l.isScrollable(n),i=!0),l.checkarea=t,l.nativescrollingarea)?!0:(r=ni(n,!1,i),r&&(l.checkarea=0),r)};this.onmousewheelhr=function(n){if(!l.wheelprevented){if(l.railslocked||!l.railh.scrollable)return!0;if(l.rail.drag)return l.cancelEvent(n);var t=u(),i=!1;return(y.preservenativescrolling&&l.checkarea+600<t&&(l.nativescrollingarea=l.isScrollable(n),i=!0),l.checkarea=t,l.nativescrollingarea)?!0:l.railslocked?l.cancelEvent(n):ni(n,!0,i)}};this.stop=function(){return l.cancelScroll(),l.scrollmon&&l.scrollmon.stop(),l.cursorfreezed=!1,l.scroll.y=Math.round(l.getScrollTop()*(1/l.scrollratio.y)),l.noticeCursor(),l};this.getTransitionSpeed=function(n){return 80+n/72*y.scrollspeed|0};y.smoothscroll?l.ishwscroll&&w.hastransition&&y.usetransition&&!!y.smoothscroll?(ct="",this.resetTransition=function(){ct="";l.doc.css(w.prefixstyle+"transition-duration","0ms")},this.prepareTransition=function(n,t){var r=t?n:l.getTransitionSpeed(n),i=r+"ms";return ct!==i&&(ct=i,l.doc.css(w.prefixstyle+"transition-duration",i)),r},this.doScrollLeft=function(n,t){var i=l.scrollrunning?l.newscrolly:l.getScrollTop();l.doScrollPos(n,i,t)},this.doScrollTop=function(n,t){var i=l.scrollrunning?l.newscrollx:l.getScrollLeft();l.doScrollPos(i,n,t)},this.cursorupdate={running:!1,start:function(){var n=this,t;n.running||(n.running=!0,t=function(){n.running&&e(t);l.showCursor(l.getScrollTop(),l.getScrollLeft());l.notifyScrollEvent(l.win[0])},e(t))},stop:function(){this.running=!1}},this.doScrollPos=function(n,t){var u=l.getScrollTop(),f=l.getScrollLeft(),s,r;if(((l.newscrolly-u)*(t-u)<0||(l.newscrollx-f)*(n-f)<0)&&l.cancelScroll(),y.bouncescroll?(t<0?t=t/2|0:t>l.page.maxh&&(t=l.page.maxh+(t-l.page.maxh)/2|0),n<0?n=n/2|0:n>l.page.maxw&&(n=l.page.maxw+(n-l.page.maxw)/2|0)):(t<0?t=0:t>l.page.maxh&&(t=l.page.maxh),n<0?n=0:n>l.page.maxw&&(n=l.page.maxw)),l.scrollrunning&&n==l.newscrollx&&t==l.newscrolly)return!1;l.newscrolly=t;l.newscrollx=n;var e=l.getScrollTop(),o=l.getScrollLeft(),i={};i.x=n-o;i.y=t-e;s=Math.sqrt(i.x*i.x+i.y*i.y)|0;r=l.prepareTransition(s);l.scrollrunning||(l.scrollrunning=!0,l.triggerScrollStart(o,e,n,t,r),l.cursorupdate.start());l.scrollendtrapped=!0;w.transitionend||(l.scrollendtrapped&&clearTimeout(l.scrollendtrapped),l.scrollendtrapped=setTimeout(l.onScrollTransitionEnd,r));l.setScrollTop(l.newscrolly);l.setScrollLeft(l.newscrollx)},this.cancelScroll=function(){if(!l.scrollendtrapped)return!0;var n=l.getScrollTop(),t=l.getScrollLeft();return l.scrollrunning=!1,w.transitionend||clearTimeout(w.transitionend),l.scrollendtrapped=!1,l.resetTransition(),l.setScrollTop(n),l.railh&&l.setScrollLeft(t),l.timerscroll&&l.timerscroll.tm&&clearInterval(l.timerscroll.tm),l.timerscroll=!1,l.cursorfreezed=!1,l.cursorupdate.stop(),l.showCursor(n,t),l},this.onScrollTransitionEnd=function(){if(l.scrollendtrapped){var n=l.getScrollTop(),t=l.getScrollLeft();if(n<0?n=0:n>l.page.maxh&&(n=l.page.maxh),t<0?t=0:t>l.page.maxw&&(t=l.page.maxw),n!=l.newscrolly||t!=l.newscrollx)return l.doScrollPos(t,n,y.snapbackspeed);l.scrollrunning&&l.triggerScrollEnd();l.scrollrunning=!1;l.scrollendtrapped=!1;l.resetTransition();l.timerscroll=!1;l.setScrollTop(n);l.railh&&l.setScrollLeft(t);l.cursorupdate.stop();l.noticeCursor(!1,n,t);l.cursorfreezed=!1}}):(this.doScrollLeft=function(n,t){var i=l.scrollrunning?l.newscrolly:l.getScrollTop();l.doScrollPos(n,i,t)},this.doScrollTop=function(n,t){var i=l.scrollrunning?l.newscrollx:l.getScrollLeft();l.doScrollPos(i,n,t)},this.doScrollPos=function(n,t){var i=l.getScrollTop(),r=l.getScrollLeft(),f,c,o,s,a,h;if(((l.newscrolly-i)*(t-i)<0||(l.newscrollx-r)*(n-r)<0)&&l.cancelScroll(),f=!1,l.bouncescroll&&l.rail.visibility||(t<0?(t=0,f=!0):t>l.page.maxh&&(t=l.page.maxh,f=!0)),l.bouncescroll&&l.railh.visibility||(n<0?(n=0,f=!0):n>l.page.maxw&&(n=l.page.maxw,f=!0)),l.scrollrunning&&l.newscrolly===t&&l.newscrollx===n)return!0;l.newscrolly=t;l.newscrollx=n;l.dst={};l.dst.x=n-r;l.dst.y=t-i;l.dst.px=r;l.dst.py=i;c=Math.sqrt(l.dst.x*l.dst.x+l.dst.y*l.dst.y)|0;o=l.getTransitionSpeed(c);l.bzscroll={};s=f?1:.58;l.bzscroll.x=new st(r,l.newscrollx,o,0,0,s,1);l.bzscroll.y=new st(i,l.newscrolly,o,0,0,s,1);a=u();h=function(){if(l.scrollrunning){var n=l.bzscroll.y.getPos();l.setScrollLeft(l.bzscroll.x.getNow());l.setScrollTop(l.bzscroll.y.getNow());n<=1?l.timer=e(h):(l.scrollrunning=!1,l.timer=0,l.triggerScrollEnd())}};l.scrollrunning||(l.triggerScrollStart(r,i,n,t,o),l.scrollrunning=!0,l.timer=e(h))},this.cancelScroll=function(){return l.timer&&v(l.timer),l.timer=0,l.bzscroll=!1,l.scrollrunning=!1,l}):(this.doScrollLeft=function(n,t){var i=l.getScrollTop();l.doScrollPos(n,i,t)},this.doScrollTop=function(n,t){var i=l.getScrollLeft();l.doScrollPos(i,n,t)},this.doScrollPos=function(n,t){var r=n>l.page.maxw?l.page.maxw:n,i;r<0&&(r=0);i=t>l.page.maxh?l.page.maxh:t;i<0&&(i=0);l.synched("scroll",function(){l.setScrollTop(i);l.setScrollLeft(r)})},this.cancelScroll=function(){});this.doScrollBy=function(n){yt(0,n)};this.doScrollLeftBy=function(n){yt(n,0)};this.doScrollTo=function(n,t){var i=t?Math.round(n*l.scrollratio.y):n;i<0?i=0:i>l.page.maxh&&(i=l.page.maxh);l.cursorfreezed=!1;l.doScrollTop(n)};this.checkContentSize=function(){var n=l.getContentSize();(n.h!=l.page.h||n.w!=l.page.w)&&l.resize(!1,n)};l.onscroll=function(){l.rail.drag||l.cursorfreezed||l.synched("scroll",function(){l.scroll.y=Math.round(l.getScrollTop()/l.scrollratio.y);l.railh&&(l.scroll.x=Math.round(l.getScrollLeft()/l.scrollratio.x));l.noticeCursor()})};l.bind(l.docscroll,"scroll",l.onscroll);this.doZoomIn=function(n){var i,r,e,t,u;if(!l.zoomactive){l.zoomactive=!0;l.zoomrestore={style:{}};i=["position","top","left","zIndex","backgroundColor","marginTop","marginBottom","marginLeft","marginRight"];r=l.win[0].style;for(e in i)t=i[e],l.zoomrestore.style[t]=r[t]!==undefined?r[t]:"";return l.zoomrestore.style.width=l.win.css("width"),l.zoomrestore.style.height=l.win.css("height"),l.zoomrestore.padding={w:l.win.outerWidth()-l.win.width(),h:l.win.outerHeight()-l.win.height()},w.isios4&&(l.zoomrestore.scrollTop=f.scrollTop(),f.scrollTop(0)),l.win.css({position:w.isios4?"absolute":"fixed",top:0,left:0,zIndex:s+100,margin:0}),u=l.win.css("backgroundColor"),(""===u||/transparent|rgba\(0, 0, 0, 0\)|rgba\(0,0,0,0\)/.test(u))&&l.win.css("backgroundColor","#fff"),l.rail.css({zIndex:s+101}),l.zoom.css({zIndex:s+102}),l.zoom.css("backgroundPosition","0 -18px"),l.resizeZoom(),l.onzoomin&&l.onzoomin.call(l),l.cancelEvent(n)}};this.doZoomOut=function(n){if(l.zoomactive)return l.zoomactive=!1,l.win.css("margin",""),l.win.css(l.zoomrestore.style),w.isios4&&f.scrollTop(l.zoomrestore.scrollTop),l.rail.css({"z-index":l.zindex}),l.zoom.css({"z-index":l.zindex}),l.zoomrestore=!1,l.zoom.css("backgroundPosition","0 0"),l.onResize(),l.onzoomout&&l.onzoomout.call(l),l.cancelEvent(n)};this.doZoom=function(n){return l.zoomactive?l.doZoomOut(n):l.doZoomIn(n)};this.resizeZoom=function(){if(l.zoomactive){var n=l.getScrollTop();l.win.css({width:f.width()-l.zoomrestore.padding.w+"px",height:f.height()-l.zoomrestore.padding.h+"px"});l.onResize();l.setScrollTop(Math.min(l.page.maxh,n))}};this.init();i.nicescroll.push(this)},ut=function(n){var t=this;this.nc=n;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.reset=function(n,i){t.stop();t.steptime=0;t.lasttime=u();t.speedx=0;t.speedy=0;t.lastx=n;t.lasty=i;t.lastscrollx=-1;t.lastscrolly=-1};this.update=function(n,i){var r=u();t.steptime=r-t.lasttime;t.lasttime=r;var f=i-t.lasty,e=n-t.lastx,h=t.nc.getScrollTop(),c=t.nc.getScrollLeft(),o=h+f,s=c+e;t.snapx=s<0||s>t.nc.page.maxw;t.snapy=o<0||o>t.nc.page.maxh;t.speedx=e;t.speedy=f;t.lastx=n;t.lasty=i};this.stop=function(){t.nc.unsynched("domomentum2d");t.timer&&clearTimeout(t.timer);t.timer=0;t.lastscrollx=-1;t.lastscrolly=-1};this.doSnapy=function(n,i){var r=!1;i<0?(i=0,r=!0):i>t.nc.page.maxh&&(i=t.nc.page.maxh,r=!0);n<0?(n=0,r=!0):n>t.nc.page.maxw&&(n=t.nc.page.maxw,r=!0);r?t.nc.doScrollPos(n,i,t.nc.opt.snapbackspeed):t.nc.triggerScrollEnd()};this.doMomentum=function(n){var o=u(),l=n?o+n:t.lasttime,a=t.nc.getScrollLeft(),v=t.nc.getScrollTop(),s=t.nc.page.maxh,h=t.nc.page.maxw,e,y,p,f,c;if(t.speedx=h>0?Math.min(60,t.speedx):0,t.speedy=s>0?Math.min(60,t.speedy):0,e=l&&o-l<=60,(v<0||v>s||a<0||a>h)&&(e=!1),y=t.speedy&&e?t.speedy:!1,p=t.speedx&&e?t.speedx:!1,y||p){f=Math.max(16,t.steptime);f>50&&(c=f/50,t.speedx*=c,t.speedy*=c,f=50);t.demulxy=0;t.lastscrollx=t.nc.getScrollLeft();t.chkx=t.lastscrollx;t.lastscrolly=t.nc.getScrollTop();t.chky=t.lastscrolly;var i=t.lastscrollx,r=t.lastscrolly,w=function(){var n=u()-o>600?.04:.02;t.speedx&&(i=Math.floor(t.lastscrollx-t.speedx*(1-t.demulxy)),t.lastscrollx=i,(i<0||i>h)&&(n=.1));t.speedy&&(r=Math.floor(t.lastscrolly-t.speedy*(1-t.demulxy)),t.lastscrolly=r,(r<0||r>s)&&(n=.1));t.demulxy=Math.min(1,t.demulxy+n);t.nc.synched("domomentum2d",function(){var n,u;t.speedx&&(n=t.nc.getScrollLeft(),t.chkx=i,t.nc.setScrollLeft(i));t.speedy&&(u=t.nc.getScrollTop(),t.chky=r,t.nc.setScrollTop(r));t.timer||(t.nc.hideCursor(),t.doSnapy(i,r))});t.demulxy<1?t.timer=setTimeout(w,f):(t.stop(),t.nc.hideCursor(),t.doSnapy(i,r))};w()}else t.doSnapy(t.nc.getScrollLeft(),t.nc.getScrollTop())}},y=n.fn.scrollTop;n.cssHooks.pageYOffset={get:function(n){var t=i.data(n,"__nicescroll")||!1;return t&&t.ishwscroll?t.getScrollTop():y.call(n)},set:function(n,t){var r=i.data(n,"__nicescroll")||!1;return r&&r.ishwscroll?r.setScrollTop(parseInt(t)):y.call(n,t),this}};n.fn.scrollTop=function(n){if(n===undefined){var t=this[0]?i.data(this[0],"__nicescroll")||!1:!1;return t&&t.ishwscroll?t.getScrollTop():y.call(this)}return this.each(function(){var t=i.data(this,"__nicescroll")||!1;t&&t.ishwscroll?t.setScrollTop(parseInt(n)):y.call(i(this),n)})};c=n.fn.scrollLeft;i.cssHooks.pageXOffset={get:function(n){var t=i.data(n,"__nicescroll")||!1;return t&&t.ishwscroll?t.getScrollLeft():c.call(n)},set:function(n,t){var r=i.data(n,"__nicescroll")||!1;return r&&r.ishwscroll?r.setScrollLeft(parseInt(t)):c.call(n,t),this}};n.fn.scrollLeft=function(n){if(n===undefined){var t=this[0]?i.data(this[0],"__nicescroll")||!1:!1;return t&&t.ishwscroll?t.getScrollLeft():c.call(this)}return this.each(function(){var t=i.data(this,"__nicescroll")||!1;t&&t.ishwscroll?t.setScrollLeft(parseInt(n)):c.call(i(this),n)})};l=function(n){var t=this,r,u;if(this.length=0,this.name="nicescrollarray",this.each=function(n){return i.each(t,n),t},this.push=function(n){t[t.length]=n;t.length++},this.eq=function(n){return t[n]},n)for(r=0;r<n.length;r++)u=i.data(n[r],"__nicescroll")||!1,u&&(this[this.length]=u,this.length++);return this};ft(l.prototype,["show","hide","toggle","onResize","resize","remove","stop","doScrollPos"],function(n,t){n[t]=function(){var n=arguments;return this.each(function(){this[t].apply(this,n)})}});n.fn.getNiceScroll=function(n){return n===undefined?new l(this):this[n]&&i.data(this[n],"__nicescroll")||!1};d=n.expr.pseudos||n.expr[":"];d.nicescroll=function(n){return i.data(n,"__nicescroll")!==undefined};i.fn.niceScroll=function(n,t){t!==undefined||typeof n!="object"||"jquery"in n||(t=n,n=!1);var r=new l;return this.each(function(){var f=i(this),u=i.extend({},t),o,s,e;(n||!1)&&(o=i(n),u.doc=o.length>1?i(n,f):o,u.win=f);s=!("doc"in u);s||"win"in u||(u.win=f);e=f.data("__nicescroll")||!1;e||(u.doc=u.doc||f,e=new rt(u,f),f.data("__nicescroll",e));r.push(e)}),r.length===1?r[0]:r};r.NiceScroll={getjQuery:function(){return n}};i.nicescroll||(i.nicescroll=new l,i.nicescroll.options=k)})