function validateCampaignID(n){var i="[A-Za-z0-9_-]{0,100}",r=new RegExp(i),t=r.exec(n);return t==null?"":t[0]}function DetectHeaderLogin(n){var t=n,r,i;t==null||t.customerid==""||t.customerid==0?(r='<a href="#" id="signinlink">'+res.HeaderFooterMaster_LoginDes+'</a> / <a href="'+res.SECURESERVER+'/account/register">'+res.HeaderFooterMaster_RegDes+'</a><div class="login-dropdown" id="login-dropdown"><div class="dropdown-body"><div class="row text-right"><a href=\'#\' onclick="$(\'#login-dropdown\').fadeOut()">x</a></div></div>',global.store.id!=2&&(r+='<div class="stretch margin-bottom-10  mini-login-or-box"><div class="caps mini-login-or">'+res.txtOR+'</div></div><a href="javascript:;" id="fb-login" scope="email,user_checkins" class="button-small bg-dark-blue white stretch margin-bottom-10 margin-top-10" style="padding-left: 0px; padding-right: 0px" onclick="login()">'+res.LoginWithFacebook.replace("Facebook",'<img src="/content/images/fb-icon.png" width="28" height="28">')+'</a><div class="dropdown-blank"></div></div>'),$(".store-login .login").html(r),setTimeout(function(){$(".store-login .login .dropdown-body").append('<iframe src="'+res.SECURESERVER+'/account/minilogin" width="100%" height="100%" style="border:none;" frameborder="0" scrolling="no"></iframe>')},1e3),$("#signinlink").click(function(){$("#login-dropdown").is(":visible")?$("#login-dropdown").fadeOut():$("#login-dropdown").fadeIn()})):t.customerid>0&&(i="",t.facebookid!=null&&(i='<img src="https://graph.facebook.com/'+t.facebookid+'/picture" width=32 height=32 style="position: absolute;top: 0px;left: -40px;"/>'),$(".store-login .login").html(i+"<span>"+String.format(res.HiName,t.name)+'</span> / <a href="'+res.SECURESERVER+'/account">'+res.bcMyAccount+'</a> / <a href="'+res.SECURESERVER+'/account/signout" id="signinlink" class="dark-grey  font-raleway">'+res.Logout+"</a>")),typeof t.cartItemCount!="undefined"&&t.cartItemCount!=null&&$.fn.updateShoppingCartCount(t.cartItemCount)}function login(){$("#fb-login").html('<img src="/content/images/fb-loading.gif" style="margin-right:10px"/>'+res.Communicating+' <img src="/content/images/fb-icon.png" width="28" height="28">'),FB.getUserID()==""?FB.login(function(n){n.authResponse?FacebookAuthRedirect():$("#fb-login").html(res.LoginWithFacebook.replace("Facebook",'<img src="/content/images/fb-icon.png" width="28" height="28">'))},{scope:"email,user_birthday"}):FB.getLoginStatus(function(n){n.status==="connected"?FacebookAuthRedirect():$("#fb-login").html(res.LoginWithFacebook.replace("Facebook",'<img src="/content/images/fb-icon.png" width="28" height="28">'))},{scope:"email,user_birthday"})}function FacebookAuthRedirect(){var t=FB.getAuthResponse().accessToken,n=location.href;n=n.indexOf(global.store.secureServer)>=0?global.store.secureServer:global.store.storeServer,FB.api("/me",function(i){i.email==null||i.email==""||$.ajax({url:n+"/account/MiniLoginWithFacebook",type:"POST",data:{email:i.email,facebookid:i.id,firstname:i.first_name,lastname:i.last_name,authtoken:t,dob:i.birthday}}).done(function(n){n=="true"&&(FacebookLoginCallBack!=undefined?FacebookLoginCallBack():location.reload())})})}function Signout(){location.href=res.SECURESERVER+"/account/signout"}function CheckShippingCityBlackList(n,t){var u=$(n).val(),r=$(t).val(),i=res.SECURESERVER+"/account/checkcityblacklist?shippingCity="+u+"&shippingCountry="+r;$.get(i,function(t){if(t=="false"){$(n).validationEngine("showPrompt",String.format(res.DeliveryWarningMsgForBlackCities,res.NORMALSTORESERVER+"/contactus"),"error","topLeft",!0);$(n).on("focus",function(){$(n).validationEngine("hide")})}})}function GetAbsoluteURL(){var n=location.href.toString();return n.toLowerCase().indexOf(res.SECURESERVER.toLowerCase())>=0?res.SECURESERVER:typeof global!="undefined"?global.store.storeServer:""}function newWindow(n,t,i){n.toLowerCase().indexOf("youtube.com")>=0&&n.toLowerCase().indexOf("embed")>=0?$.fancybox.open({title:"&nbsp;",href:n,type:"iframe",maxWidth:800,maxHeight:600,fitToView:!1,width:"70%",height:"70%",autoSize:!1,closeClick:!1,openEffect:"elastic",closeEffect:"elastic"}):(n.toLowerCase().indexOf(res.IMAGESERVER.toLowerCase())==-1&&(n=n.replace("/images/inline/products/",""),n.indexOf("img=")>=0&&(n.indexOf(".jpg")>=0&&(n=n.substring(n.indexOf("img=")+4,n.indexOf(".jpg")+4)),n.indexOf(".gif")>=0&&(n=n.substring(n.indexOf("img=")+4,n.indexOf(".gif")+4)),n.indexOf(".png")>=0&&(n=n.substring(n.indexOf("img=")+4,n.indexOf(".png")+4))),n=res.IMAGESERVER+"/images/inline/products/"+n),n.toLowerCase().indexOf(".html")>=0?$.fancybox.open({href:n,type:"iframe",title:"&nbsp;",openEffect:"elastic",closeEffect:"elastic",width:t,height:i}):i>800?$.fancybox.open({href:n,title:"&nbsp;",openEffect:"elastic",closeEffect:"elastic",fitToView:!1}):$.fancybox.open({href:n,title:"&nbsp;",openEffect:"elastic",closeEffect:"elastic"}))}function fancyConfirm(n,t,i,r,u,f){$.fancybox({modal:!0,title:n,content:'<div style="margin:1px;width:300px;">'+t+'<div style="text-align:right;margin-top:30px;"><a id="fancyConfirm_cancel" href="#" class="link-button nano">'+r+'</a>&nbsp;&nbsp;<input id="fancyConfirm_ok" type="button" value="'+i+'" class="button-small bg-red"></div></div>',afterShow:function(){$("#fancyConfirm_cancel").click(function(n){n.preventDefault(),f(),$.fancybox.close()}),$("#fancyConfirm_ok").click(function(n){n.preventDefault(),u(n),$.fancybox.close()})}})}function ShowNotifyMeLightBox(n,t){Product.popUpNotifyMe(t,0,0)}function RecommendedProducts(n,t,i){$.fn.showFreeShippingThreshold(t,i)}var Utility={splitParam:function(n){for(var r={},t,f=/\+/g,e=/([^&=]+)=?([^&]*)/g,i=function(n){return decodeURIComponent(n.replace(f," "))},u=n;t=e.exec(u);)r[i(t[1])]=i(t[2]);return r}},urlParams={},Hashtable,featuredimagezoomer,msf,FacebookLoginCallBack,Product,shoponlineTimeout,RECOMMENDEDBOX;(function(){for(var n,r=/\+/g,u=/([^&=]+)=?([^&]*)/g,t=function(n){return decodeURIComponent(n.replace(r," "))},i=window.location.search.substring(1);n=u.exec(i);)urlParams[t(n[1]).toLowerCase()]=t(n[2])})(),function(){for(var n,u=function(){},r=["assert","clear","count","debug","dir","dirxml","error","exception","group","groupCollapsed","groupEnd","info","log","markTimeline","profile","profileEnd","table","time","timeEnd","timeStamp","trace","warn"],t=r.length,i=window.console=window.console||{};t--;)n=r[t],i[n]||(i[n]=u)}(),function(n){typeof n.fn.each2=="undefined"&&n.fn.extend({each2:function(t){for(var i=n([0]),r=-1,u=this.length;++r<u&&(i.context=i[0]=this[r])&&t.call(i[0],r,i)!==!1;);return this}})}(jQuery),function(n,t){"use strict";function f(n,t){for(var i=0,r=t.length;i<r;i=i+1)if(u(n,t[i]))return i;return-1}function u(n,i){return n===i?!0:n===t||i===t?!1:n===null||i===null?!1:n.constructor===String?n===i+"":i.constructor===String?i===n+"":!1}function a(t,i){var u,r,f;if(t===null||t.length<1)return[];for(u=t.split(i),r=0,f=u.length;r<f;r=r+1)u[r]=n.trim(u[r]);return u}function et(n){return n.outerWidth(!1)-n.width()}function tt(i){var r="keyup-change-value";i.bind("keydown",function(){n.data(i,r)===t&&n.data(i,r,i.val())}),i.bind("keyup",function(){var u=n.data(i,r);u!==t&&i.val()!==u&&(n.removeData(i,r),i.trigger("keyup-change"))})}function st(i){i.bind("mousemove",function(i){var r=g;(r===t||r.x!==i.pageX||r.y!==i.pageY)&&n(i.target).trigger("mousemove-filtered",i)})}function it(n,i,r){r=r||t;var u;return function(){var t=arguments;window.clearTimeout(u),u=window.setTimeout(function(){i.apply(r,t)},n)}}function ot(n){var i=!1,t;return function(){return i===!1&&(t=n(),i=!0),t}}function ht(n,t){var i=it(n,function(n){t.trigger("scroll-debounced",n)});t.bind("scroll",function(n){f(n.target,t.get())>=0&&i(n)})}function ut(n){n[0]!==document.activeElement&&window.setTimeout(function(){var i=n[0],r=n.val().length,t;n.focus(),i.setSelectionRange?i.setSelectionRange(r,r):i.createTextRange&&(t=i.createTextRange(),t.collapse(!0),t.moveEnd("character",r),t.moveStart("character",r),t.select())},0)}function r(n){n.preventDefault(),n.stopPropagation()}function lt(n){n.preventDefault(),n.stopImmediatePropagation()}function ct(t){if(!o){var i=t[0].currentStyle||window.getComputedStyle(t[0],null);o=n(document.createElement("div")).css({position:"absolute",left:"-10000px",top:"-10000px",display:"none",fontSize:i.fontSize,fontFamily:i.fontFamily,fontStyle:i.fontStyle,fontWeight:i.fontWeight,letterSpacing:i.letterSpacing,textTransform:i.textTransform,whiteSpace:"nowrap"}),o.attr("class","select2-sizer"),n("body").append(o)}return o.text(t.val()),o.width()}function l(t,i,r){var u,e=[],f;u=t.attr("class"),typeof u=="string"&&n(u.split(" ")).each2(function(){this.indexOf("select2-")===0&&e.push(this)}),u=i.attr("class"),typeof u=="string"&&n(u.split(" ")).each2(function(){this.indexOf("select2-")!==0&&(f=r(this),typeof f=="string"&&f.length>0&&e.push(this))}),t.attr("class",e.join(" "))}function d(n,t,i,r){var u=n.toUpperCase().indexOf(t.toUpperCase()),f=t.length;if(u<0){i.push(r(n));return}i.push(r(n.substring(0,u))),i.push("<span class='select2-match'>"),i.push(r(n.substring(u,u+f))),i.push("</span>"),i.push(r(n.substring(u+f,n.length)))}function k(t){var f,u=0,r=null,e=t.quietMillis||100,o=t.url,i=this;return function(s){window.clearTimeout(f),f=window.setTimeout(function(){u+=1;var c=u,h=t.data,f=o,a=t.transport||n.ajax,l=t.type||"GET",e={};h=h?h.call(i,s.term,s.page,s.context):null,f=typeof f=="function"?f.call(i,s.term,s.page,s.context):f,null!==r&&r.abort(),t.params&&(n.isFunction(t.params)?n.extend(e,t.params.call(i)):n.extend(e,t.params)),n.extend(e,{url:f,dataType:t.dataType,data:h,type:l,cache:!1,success:function(n){if(!(c<u)){var i=t.results(n,s.page);s.callback(i)}}}),r=a.call(i,e)},e)}}function b(t){var i=t,e,u,r=function(n){return""+n.text},f;return n.isArray(i)&&(u=i,i={results:u}),n.isFunction(i)===!1&&(u=i,i=function(){return u}),f=i(),f.text&&(r=f.text,n.isFunction(r)||(e=i.text,r=function(n){return n[e]})),function(t){var f=t.term,e={results:[]},u;if(f===""){t.callback(i());return}u=function(i,e){var o,s;if(i=i[0],i.children){o={};for(s in i)i.hasOwnProperty(s)&&(o[s]=i[s]);o.children=[],n(i.children).each2(function(n,t){u(t,o.children)}),(o.children.length||t.matcher(f,r(o),i))&&e.push(o)}else t.matcher(f,r(i),i)&&e.push(i)},n(i().results).each2(function(n,t){u(t,e.results)}),t.callback(e)}}function w(i){var r=n.isFunction(i);return function(u){var e=u.term,f={results:[]};n(r?i():i).each(function(){var n=this.text!==t,i=n?this.text:this;(e===""||u.matcher(e,i))&&f.results.push(n?this:{id:this,text:this})}),u.callback(f)}}function s(t){if(n.isFunction(t))return!0;if(!t)return!1;throw new Error("formatterName must be a function or a falsy value");}function e(t){return n.isFunction(t)?t():t}function rt(t){var i=0;return n.each(t,function(n,t){t.children?i+=rt(t.children):i++}),i}function ft(n,i,r,f){var a=n,l=!1,e,s,o,h,c;if(!f.createSearchChoice||!f.tokenSeparators||f.tokenSeparators.length<1)return t;for(;;){for(s=-1,o=0,h=f.tokenSeparators.length;o<h;o++)if(c=f.tokenSeparators[o],s=n.indexOf(c),s>=0)break;if(s<0)break;if(e=n.substring(0,s),n=n.substring(s+c.length),e.length>0&&(e=f.createSearchChoice(e,i),e!==t&&e!==null&&f.id(e)!==t&&f.id(e)!==null)){for(l=!1,o=0,h=i.length;o<h;o++)if(u(f.id(e),f.id(i[o]))){l=!0;break}l||r(e)}}if(a!==n)return n}function c(t,i){var r=function(){};return r.prototype=new t,r.prototype.constructor=r,r.prototype.parent=t.prototype,r.prototype=n.extend(r.prototype,i),r}if(window.Select2===t){var i,h,y,v,p,o,g,nt;i={TAB:9,ENTER:13,ESC:27,SPACE:32,LEFT:37,UP:38,RIGHT:39,DOWN:40,SHIFT:16,CTRL:17,ALT:18,PAGE_UP:33,PAGE_DOWN:34,HOME:36,END:35,BACKSPACE:8,DELETE:46,isArrow:function(n){n=n.which?n.which:n;switch(n){case i.LEFT:case i.RIGHT:case i.UP:case i.DOWN:return!0}return!1},isControl:function(n){var t=n.which;switch(t){case i.SHIFT:case i.CTRL:case i.ALT:return!0}return n.metaKey?!0:!1},isFunctionKey:function(n){return n=n.which?n.which:n,n>=112&&n<=123}},nt=n(document),p=function(){var n=1;return function(){return n++}}(),nt.bind("mousemove",function(n){g={x:n.pageX,y:n.pageY}}),h=c(Object,{bind:function(n){var t=this;return function(){n.apply(t,arguments)}},init:function(i){var u,f,o=".select2-results",s;this.opts=i=this.prepareOpts(i),this.id=i.id,i.element.data("select2")!==t&&i.element.data("select2")!==null&&this.destroy(),this.enabled=!0,this.container=this.createContainer(),this.containerId="s2id_"+(i.element.attr("id")||"autogen"+p()),this.containerSelector="#"+this.containerId.replace(/([;&,\.\+\*\~':"\!\^#$%@\[\]\(\)=>\|])/g,"\\$1"),this.container.attr("id",this.containerId),this.body=ot(function(){return i.element.closest("body")}),l(this.container,this.opts.element,this.opts.adaptContainerCssClass),this.container.css(e(i.containerCss)),this.container.addClass(e(i.containerCssClass)),this.elementTabIndex=this.opts.element.attr("tabIndex"),this.opts.element.data("select2",this).addClass("select2-offscreen").bind("focus.select2",function(){n(this).select2("focus")}).attr("tabIndex","-1").before(this.container),this.container.data("select2",this),this.dropdown=this.container.find(".select2-drop"),this.dropdown.addClass(e(i.dropdownCssClass)),this.dropdown.data("select2",this),this.results=u=this.container.find(o),this.search=f=this.container.find("input.select2-input"),f.attr("tabIndex",this.elementTabIndex),this.resultsPage=0,this.context=null,this.initContainer(),st(this.results),this.dropdown.delegate(o,"mousemove-filtered touchstart touchmove touchend",this.bind(this.highlightUnderEvent)),ht(80,this.results),this.dropdown.delegate(o,"scroll-debounced",this.bind(this.loadMoreIfNeeded)),n.fn.mousewheel&&u.mousewheel(function(n,t,i,f){var e=u.scrollTop(),o;f>0&&e-f<=0?(u.scrollTop(0),r(n)):f<0&&u.get(0).scrollHeight-u.scrollTop()+f<=u.height()&&(u.scrollTop(u.get(0).scrollHeight-u.height()),r(n))}),tt(f),f.bind("keyup-change input paste",this.bind(this.updateResults)),f.bind("focus",function(){f.addClass("select2-focused")}),f.bind("blur",function(){f.removeClass("select2-focused")}),this.dropdown.delegate(o,"mouseup",this.bind(function(t){n(t.target).closest(".select2-result-selectable").length>0&&(this.highlightUnderEvent(t),this.selectHighlighted(t))})),this.dropdown.bind("click mouseup mousedown",function(n){n.stopPropagation()}),n.isFunction(this.opts.initSelection)&&(this.initSelection(),this.monitorSource()),(i.element.is(":disabled")||i.element.is("[readonly='readonly']"))&&this.disable()},destroy:function(){var n=this.opts.element.data("select2");this.propertyObserver&&(delete this.propertyObserver,this.propertyObserver=null),n!==t&&(n.container.remove(),n.dropdown.remove(),n.opts.element.removeClass("select2-offscreen").removeData("select2").unbind(".select2").attr({tabIndex:this.elementTabIndex}).show())},prepareOpts:function(i){var e,f,o,r;if(e=i.element,e.get(0).tagName.toLowerCase()==="select"&&(this.select=f=i.element),f&&n.each(["id","multiple","ajax","query","createSearchChoice","initSelection","data","tags"],function(){if(this in i)throw new Error("Option '"+this+"' is not allowed for Select2 when attached to a <select> element.");}),i=n.extend({},{populateResults:function(r,u,f){var e,h,c,l,s=this.opts.id,o=this;e=function(r,u,h){var v,d,l,k,b,p,c,a,y,w;for(r=i.sortResults(r,u,f),v=0,d=r.length;v<d;v=v+1)l=r[v],b=l.disabled===!0,k=!b&&s(l)!==t,p=l.children&&l.children.length>0,c=n("<li></li>"),c.addClass("select2-results-dept-"+h),c.addClass("select2-result"),c.addClass(k?"select2-result-selectable":"select2-result-unselectable"),b&&c.addClass("select2-disabled"),p&&c.addClass("select2-result-with-children"),c.addClass(o.opts.formatResultCssClass(l)),a=n(document.createElement("div")),a.addClass("select2-result-label"),w=i.formatResult(l,a,f,o.opts.escapeMarkup),w!==t&&a.html(w),c.append(a),p&&(y=n("<ul></ul>"),y.addClass("select2-result-sub"),e(l.children,y,h+1),c.append(y)),c.data("select2-data",l),u.append(c)},e(u,r,0)}},n.fn.select2.defaults,i),typeof i.id!="function"&&(o=i.id,i.id=function(n){return n[o]}),n.isArray(i.element.data("select2Tags"))){if("tags"in i)throw"tags specified as both an attribute 'data-select2-tags' and in options of Select2 "+i.element.attr("id");i.tags=i.element.attr("data-select2-tags")}if(f?(i.query=this.bind(function(i){var s={results:[],more:!1},h=i.term,r,f,o;o=function(n,t){var r;n.is("option")?i.matcher(h,n.text(),n)&&t.push({id:n.attr("value"),text:n.text(),element:n.get(),css:n.attr("class"),disabled:u(n.attr("disabled"),"disabled")}):n.is("optgroup")&&(r={text:n.attr("label"),children:[],element:n.get(),css:n.attr("class")},n.children().each2(function(n,t){o(t,r.children)}),r.children.length>0&&t.push(r))},r=e.children(),this.getPlaceholder()!==t&&r.length>0&&(f=r[0],n(f).text()===""&&(r=r.not(f))),r.each2(function(n,t){o(t,s.results)}),i.callback(s)}),i.id=function(n){return n.id},i.formatResultCssClass=function(n){return n.css}):"query"in i||("ajax"in i?(r=i.element.data("ajax-url"),r&&r.length>0&&(i.ajax.url=r),i.query=k.call(i.element,i.ajax)):"data"in i?i.query=b(i.data):"tags"in i&&(i.query=w(i.tags),i.createSearchChoice===t&&(i.createSearchChoice=function(n){return{id:n,text:n}}),i.initSelection===t&&(i.initSelection=function(t,r){var f=[];n(a(t.val(),i.separator)).each(function(){var r=this,e=this,t=i.tags;n.isFunction(t)&&(t=t()),n(t).each(function(){if(u(this.id,r))return e=this.text,!1}),f.push({id:r,text:e})}),r(f)}))),typeof i.query!="function")throw"query function not defined for Select2 "+i.element.attr("id");return i},monitorSource:function(){var t=this.opts.element,n;t.bind("change.select2",this.bind(function(){this.opts.element.data("select2-change-triggered")!==!0&&this.initSelection()})),n=this.bind(function(){var n,t,i=this;n=this.opts.element.attr("disabled")!=="disabled",t=this.opts.element.attr("readonly")==="readonly",n=n&&!t,this.enabled!==n&&(n?this.enable():this.disable()),l(this.container,this.opts.element,this.opts.adaptContainerCssClass),this.container.addClass(e(this.opts.containerCssClass)),l(this.dropdown,this.opts.element,this.opts.adaptDropdownCssClass),this.dropdown.addClass(e(this.opts.dropdownCssClass))}),t.bind("propertychange.select2 DOMAttrModified.select2",n),typeof WebKitMutationObserver!="undefined"&&(this.propertyObserver&&(delete this.propertyObserver,this.propertyObserver=null),this.propertyObserver=new WebKitMutationObserver(function(t){t.forEach(n)}),this.propertyObserver.observe(t.get(0),{attributes:!0,subtree:!1}))},triggerChange:function(t){t=t||{},t=n.extend({},t,{type:"change",val:this.val()}),this.opts.element.data("select2-change-triggered",!0),this.opts.element.trigger(t),this.opts.element.data("select2-change-triggered",!1),this.opts.element.click(),this.opts.blurOnChange&&this.opts.element.blur()},enable:function(){this.enabled||(this.enabled=!0,this.container.removeClass("select2-container-disabled"),this.opts.element.removeAttr("disabled"))},disable:function(){this.enabled&&(this.close(),this.enabled=!1,this.container.addClass("select2-container-disabled"),this.opts.element.attr("disabled","disabled"))},opened:function(){return this.container.hasClass("select2-dropdown-open")},positionDropdown:function(){var i=this.container.offset(),y=this.container.outerHeight(!1),a=this.container.outerWidth(!1),f=this.dropdown.outerHeight(!1),v=n(window).scrollLeft()+n(window).width(),p=n(window).scrollTop()+n(window).height(),r=i.top+y,u=i.left,c=r+f<=p,l=i.top-f>=this.body().scrollTop(),h=this.dropdown.outerWidth(!1),w=u+h<=v,b=this.dropdown.hasClass("select2-drop-above"),o,t,s;this.body().css("position")!=="static"&&(o=this.body().offset(),r-=o.top,u-=o.left),b?(t=!0,!l&&c&&(t=!1)):(t=!1,!c&&l&&(t=!0)),w||(u=i.left+a-h),t?(r=i.top-f,this.container.addClass("select2-drop-above"),this.dropdown.addClass("select2-drop-above")):(this.container.removeClass("select2-drop-above"),this.dropdown.removeClass("select2-drop-above")),s=n.extend({top:r,left:u,width:a},e(this.opts.dropdownCss)),this.dropdown.css(s)},shouldOpen:function(){var t;return this.opened()?!1:(t=n.Event("opening"),this.opts.element.trigger(t),!t.isDefaultPrevented())},clearDropdownAlignmentPreference:function(){this.container.removeClass("select2-drop-above"),this.dropdown.removeClass("select2-drop-above")},open:function(){return this.shouldOpen()?(window.setTimeout(this.bind(this.opening),1),!0):!1},opening:function(){var i=this.containerId,f="scroll."+i,u="resize."+i,e="orientationchange."+i,t,r;this.clearDropdownAlignmentPreference(),this.container.addClass("select2-dropdown-open").addClass("select2-container-active"),this.dropdown[0]!==this.body().children().last()[0]&&this.dropdown.detach().appendTo(this.body()),this.updateResults(!0),t=n("#select2-drop-mask"),t.length==0&&(t=n(document.createElement("div")),t.attr("id","select2-drop-mask").attr("class","select2-drop-mask"),t.hide(),t.appendTo(this.body()),t.bind("mousedown touchstart",function(){var r=n("#select2-drop"),i;r.length>0&&(i=r.data("select2"),i.opts.selectOnBlur&&i.selectHighlighted({noFocus:!0}),i.close())})),this.dropdown.prev()[0]!==t[0]&&this.dropdown.before(t),n("#select2-drop").removeAttr("id"),this.dropdown.attr("id","select2-drop"),t.css({width:document.documentElement.scrollWidth,height:document.documentElement.scrollHeight}),t.show(),this.dropdown.show(),this.positionDropdown(),this.dropdown.addClass("select2-drop-active"),this.ensureHighlightVisible(),r=this,this.container.parents().add(window).each(function(){n(this).bind(u+" "+f+" "+e,function(){n("#select2-drop-mask").css({width:document.documentElement.scrollWidth,height:document.documentElement.scrollHeight}),r.positionDropdown()})}),this.focusSearch()},close:function(){if(this.opened()){var t=this.containerId,u="scroll."+t,r="resize."+t,i="orientationchange."+t;this.container.parents().add(window).each(function(){n(this).unbind(u).unbind(r).unbind(i)}),this.clearDropdownAlignmentPreference(),n("#select2-drop-mask").hide(),this.dropdown.removeAttr("id"),this.dropdown.hide(),this.container.removeClass("select2-dropdown-open"),this.results.empty(),this.clearSearch(),this.opts.element.trigger(n.Event("close"))}},clearSearch:function(){},getMaximumSelectionSize:function(){return e(this.opts.maximumSelectionSize)},ensureHighlightVisible:function(){var t=this.results,e,r,i,u,s,o,f;if(r=this.highlight(),!(r<0)){if(r==0){t.scrollTop(0);return}e=this.findHighlightableChoices(),i=n(e[r]),u=i.offset().top+i.outerHeight(!0),r===e.length-1&&(f=t.find("li.select2-more-results"),f.length>0&&(u=f.offset().top+f.outerHeight(!0))),s=t.offset().top+t.outerHeight(!0),u>s&&t.scrollTop(t.scrollTop()+(u-s)),o=i.offset().top-t.offset().top,o<0&&i.css("display")!="none"&&t.scrollTop(t.scrollTop()+o)}},findHighlightableChoices:function(){var n=this.results.find(".select2-result-selectable:not(.select2-selected):not(.select2-disabled)");return this.results.find(".select2-result-selectable:not(.select2-selected):not(.select2-disabled)")},moveHighlight:function(t){for(var u=this.findHighlightableChoices(),i=this.highlight(),r;i>-1&&i<u.length;)if(i+=t,r=n(u[i]),r.hasClass("select2-result-selectable")&&!r.hasClass("select2-disabled")&&!r.hasClass("select2-selected")){this.highlight(i);break}},highlight:function(t){var i=this.findHighlightableChoices(),u,r;if(arguments.length===0)return f(i.filter(".select2-highlighted")[0],i.get());t>=i.length&&(t=i.length-1),t<0&&(t=0),this.results.find(".select2-highlighted").removeClass("select2-highlighted"),u=n(i[t]),u.addClass("select2-highlighted"),this.ensureHighlightVisible(),r=u.data("select2-data"),r&&this.opts.element.trigger({type:"highlight",val:this.id(r),choice:r})},countSelectableResults:function(){return this.findHighlightableChoices().length},highlightUnderEvent:function(t){var i=n(t.target).closest(".select2-result-selectable"),r;i.length>0&&!i.is(".select2-highlighted")?(r=this.findHighlightableChoices(),this.highlight(r.index(i))):i.length==0&&this.results.find(".select2-highlighted").removeClass("select2-highlighted")},loadMoreIfNeeded:function(){var t=this.results,i=t.find("li.select2-more-results"),f,o=-1,r=this.resultsPage+1,n=this,u=this.search.val(),e=this.context;i.length!==0&&(f=i.offset().top-t.offset().top-t.height(),f<=this.opts.loadMorePadding&&(i.addClass("select2-active"),this.opts.query({element:this.opts.element,term:u,page:r,context:e,matcher:this.opts.matcher,callback:this.bind(function(f){n.opened()&&(n.opts.populateResults.call(this,t,f.results,{term:u,page:r,context:e}),f.more===!0?(i.detach().appendTo(t).text(n.opts.formatLoadMore(r+1)),window.setTimeout(function(){n.loadMoreIfNeeded()},10)):i.remove(),n.positionDropdown(),n.resultsPage=r,n.context=f.context)})})))},tokenize:function(){},updateResults:function(i){function v(){h.scrollTop(0),f.removeClass("select2-active"),e.positionDropdown()}function o(n){h.html(n),v()}var f=this.search,h=this.results,r=this.opts,a,e=this,c,l;if(i===!0||this.showSearchInput!==!1&&this.opened()){if(f.addClass("select2-active"),l=this.getMaximumSelectionSize(),l>=1&&(a=this.data(),n.isArray(a)&&a.length>=l&&s(r.formatSelectionTooBig,"formatSelectionTooBig"))){o("<li class='select2-selection-limit'>"+r.formatSelectionTooBig(l)+"</li>");return}if(f.val().length<r.minimumInputLength){s(r.formatInputTooShort,"formatInputTooShort")?o("<li class='select2-no-results'>"+r.formatInputTooShort(f.val(),r.minimumInputLength)+"</li>"):o("");return}if(r.formatSearching()&&i===!0&&o("<li class='select2-searching'>"+r.formatSearching()+"</li>"),r.maximumInputLength&&f.val().length>r.maximumInputLength){s(r.formatInputTooLong,"formatInputTooLong")?o("<li class='select2-no-results'>"+r.formatInputTooLong(f.val(),r.maximumInputLength)+"</li>"):o("");return}c=this.tokenize(),c!=t&&c!=null&&f.val(c),this.resultsPage=1,r.query({element:r.element,term:f.val(),page:this.resultsPage,context:null,matcher:r.matcher,callback:this.bind(function(c){var l;if(this.opened()){if(this.context=c.context===t?null:c.context,this.opts.createSearchChoice&&f.val()!==""&&(l=this.opts.createSearchChoice.call(null,f.val(),c.results),l!==t&&l!==null&&e.id(l)!==t&&e.id(l)!==null&&n(c.results).filter(function(){return u(e.id(this),e.id(l))}).length===0&&c.results.unshift(l)),c.results.length===0&&s(r.formatNoMatches,"formatNoMatches")){o("<li class='select2-no-results'>"+r.formatNoMatches(f.val())+"</li>");return}h.empty(),e.opts.populateResults.call(this,h,c.results,{term:f.val(),page:this.resultsPage,context:null}),c.more===!0&&s(r.formatLoadMore,"formatLoadMore")&&(h.append("<li class='select2-more-results'>"+e.opts.escapeMarkup(r.formatLoadMore(this.resultsPage))+"</li>"),window.setTimeout(function(){e.loadMoreIfNeeded()},10)),this.postprocessResults(c,i),v()}})})}},cancel:function(){this.close()},blur:function(){this.opts.selectOnBlur&&this.selectHighlighted({noFocus:!0}),this.close(),this.container.removeClass("select2-container-active"),this.search[0]===document.activeElement&&this.search.blur(),this.clearSearch(),this.selection.find(".select2-search-choice-focus").removeClass("select2-search-choice-focus")},focusSearch:function(){ut(this.search)},selectHighlighted:function(n){var i=this.highlight(),r=this.results.find(".select2-highlighted"),t=r.closest(".select2-result").data("select2-data");if(t){this.highlight(i);this.onSelect(t,n)}},getPlaceholder:function(){return this.opts.element.attr("placeholder")||this.opts.element.attr("data-placeholder")||this.opts.element.data("placeholder")||this.opts.placeholder},initContainerWidth:function(){function r(){var i,f,u,r,e;if(this.opts.width==="off")return null;if(this.opts.width==="element")return this.opts.element.outerWidth(!1)===0?"auto":this.opts.element.outerWidth(!1)+"px";if(this.opts.width==="copy"||this.opts.width==="resolve"){if(i=this.opts.element.attr("style"),i!==t)for(f=i.split(";"),r=0,e=f.length;r<e;r=r+1)if(u=f[r].replace(/\s/g,"").match(/width:(([-+]?([0-9]*\.)?[0-9]+)(px|em|ex|%|in|cm|mm|pt|pc))/),u!==null&&u.length>=1)return u[1];return this.opts.width==="resolve"?(i=this.opts.element.css("width"),i.indexOf("%")>0)?i:this.opts.element.outerWidth(!1)===0?"auto":this.opts.element.outerWidth(!1)+"px":null}return n.isFunction(this.opts.width)?this.opts.width():this.opts.width}var i=r.call(this);i!==null&&this.container.css("width",i)}}),y=c(h,{createContainer:function(){return n(document.createElement("div")).attr({"class":"select2-container"}).html(["<a href='javascript:void(0)' onclick='return false;' class='select2-choice' tabindex='-1'>","   <span></span><abbr class='select2-search-choice-close' style='display:none;'></abbr>","   <div><b></b></div>","</a>","<input class='select2-focusser select2-offscreen' type='text'/>","<div class='select2-drop' style='display:none'>","   <div class='select2-search'>","       <input type='text' autocomplete='off' class='select2-input'/>","   </div>","   <ul class='select2-results'>","   </ul>","</div>"].join(""))},disable:function(){this.enabled&&(this.parent.disable.apply(this,arguments),this.focusser.attr("disabled","disabled"))},enable:function(){this.enabled||(this.parent.enable.apply(this,arguments),this.focusser.removeAttr("disabled"))},opening:function(){this.parent.opening.apply(this,arguments),this.focusser.attr("disabled","disabled"),this.opts.element.trigger(n.Event("open"))},close:function(){this.opened()&&(this.parent.close.apply(this,arguments),this.focusser.removeAttr("disabled"),ut(this.focusser))},focus:function(){this.opened()?this.close():(this.focusser.removeAttr("disabled"),this.focusser.focus())},isFocused:function(){return this.container.hasClass("select2-container-active")},cancel:function(){this.parent.cancel.apply(this,arguments),this.focusser.removeAttr("disabled"),this.focusser.focus()},initContainer:function(){var n,u=this.container,f=this.dropdown,t=!1;this.showSearch(this.opts.minimumResultsForSearch>=0),this.selection=n=u.find(".select2-choice"),this.focusser=u.find(".select2-focusser"),this.search.bind("keydown",this.bind(function(n){if(this.enabled){if(n.which===i.PAGE_UP||n.which===i.PAGE_DOWN){r(n);return}switch(n.which){case i.UP:case i.DOWN:this.moveHighlight(n.which===i.UP?-1:1),r(n);return;case i.TAB:case i.ENTER:this.selectHighlighted(),r(n);return;case i.ESC:this.cancel(n),r(n);return}}})),this.focusser.bind("keydown",this.bind(function(n){if(this.enabled&&n.which!==i.TAB&&!i.isControl(n)&&!i.isFunctionKey(n)&&n.which!==i.ESC){if(this.opts.openOnEnter===!1&&n.which===i.ENTER){r(n);return}if(n.which==i.DOWN||n.which==i.UP||n.which==i.ENTER&&this.opts.openOnEnter){this.open(),r(n);return}if(n.which==i.DELETE||n.which==i.BACKSPACE){this.opts.allowClear&&this.clear(),r(n);return}}})),tt(this.focusser),this.focusser.bind("keyup-change input",this.bind(function(n){this.opened()||(this.open(),this.showSearchInput!==!1&&this.search.val(this.focusser.val()),this.focusser.val(""),r(n))})),n.delegate("abbr","mousedown",this.bind(function(n){this.enabled&&(this.clear(),lt(n),this.close(),this.selection.focus())})),n.bind("mousedown",this.bind(function(n){t=!0,this.opened()?this.close():this.enabled&&this.open(),r(n),t=!1})),f.bind("mousedown",this.bind(function(){this.search.focus()})),n.bind("focus",this.bind(function(n){r(n)})),this.focusser.bind("focus",this.bind(function(){this.container.addClass("select2-container-active")})).bind("blur",this.bind(function(){this.opened()||this.container.removeClass("select2-container-active")})),this.search.bind("focus",this.bind(function(){this.container.addClass("select2-container-active")})),this.initContainerWidth(),this.setPlaceholder()},clear:function(){var n=this.selection.data("select2-data");this.opts.element.val(""),this.selection.find("span").empty(),this.selection.removeData("select2-data"),this.setPlaceholder(),this.opts.element.trigger({type:"removed",val:this.id(n),choice:n}),this.triggerChange({removed:n})},initSelection:function(){var i,n;this.opts.element.val()===""&&this.opts.element.text()===""?(this.close(),this.setPlaceholder()):(n=this,this.opts.initSelection.call(null,this.opts.element,function(i){i!==t&&i!==null&&(n.updateSelection(i),n.close(),n.setPlaceholder())}))},prepareOpts:function(){var t=this.parent.prepareOpts.apply(this,arguments);return t.element.get(0).tagName.toLowerCase()==="select"?t.initSelection=function(t,i){var r=t.find(":selected");n.isFunction(i)&&i({id:r.attr("value"),text:r.text(),element:r})}:"data"in t&&(t.initSelection=t.initSelection||function(i,r){var f=i.val();t.query({matcher:function(n,i,r){return u(f,t.id(r))},callback:n.isFunction(r)?function(n){r(n.results.length?n.results[0]:null)}:n.noop})}),t},getPlaceholder:function(){return this.select&&this.select.find("option").first().text()!==""?t:this.parent.getPlaceholder.apply(this,arguments)},setPlaceholder:function(){var n=this.getPlaceholder();if(this.opts.element.val()===""&&n!==t){if(this.select&&this.select.find("option:first").text()!=="")return;this.selection.find("span").html(this.opts.escapeMarkup(n)),this.selection.addClass("select2-default"),this.selection.find("abbr").hide()}},postprocessResults:function(n,t){var r=0,e=this,f=!0,i;this.findHighlightableChoices().each2(function(n,t){if(u(e.id(t.data("select2-data")),e.opts.element.val()))return r=n,!1}),this.highlight(r),t===!0&&(i=this.opts.minimumResultsForSearch,f=i<0?!1:rt(n.results)>=i,this.showSearch(f))},showSearch:function(t){this.showSearchInput=t,this.dropdown.find(".select2-search")[t?"removeClass":"addClass"]("select2-search-hidden"),n(this.dropdown,this.container)[t?"addClass":"removeClass"]("select2-with-searchbox")},onSelect:function(n,t){var i=this.opts.element.val();this.opts.element.val(this.id(n)),this.updateSelection(n),this.opts.element.trigger({type:"selected",val:this.id(n),choice:n}),this.close(),t&&t.noFocus||this.selection.focus(),u(i,this.id(n))||this.triggerChange()},updateSelection:function(n){var r=this.selection.find("span"),i;this.selection.data("select2-data",n),r.empty(),i=this.opts.formatSelection(n,r),i!==t&&r.append(this.opts.escapeMarkup(i)),this.selection.removeClass("select2-default"),this.opts.allowClear&&this.getPlaceholder()!==t&&this.selection.find("abbr").show()},val:function(){var i,r=!1,u=null,n=this;if(arguments.length===0)return this.opts.element.val();if(i=arguments[0],arguments.length>1&&(r=arguments[1]),this.select)this.select.val(i).find(":selected").each2(function(n,t){return u={id:t.attr("value"),text:t.text()},!1}),this.updateSelection(u),this.setPlaceholder(),r&&this.triggerChange();else{if(this.opts.initSelection===t)throw new Error("cannot call val() if initSelection() is not defined");if(!i&&i!==0){this.clear(),r&&this.triggerChange();return}this.opts.element.val(i),this.opts.initSelection(this.opts.element,function(t){n.opts.element.val(t?n.id(t):""),n.updateSelection(t),n.setPlaceholder(),r&&n.triggerChange()})}},clearSearch:function(){this.search.val(""),this.focusser.val("")},data:function(n){var i;if(arguments.length===0)return i=this.selection.data("select2-data"),i==t&&(i=null),i;n&&n!==""?(this.opts.element.val(n?this.id(n):""),this.updateSelection(n)):this.clear()}}),v=c(h,{createContainer:function(){return n(document.createElement("div")).attr({"class":"select2-container select2-container-multi"}).html(["    <ul class='select2-choices'>","  <li class='select2-search-field'>","    <input type='text' autocomplete='off' class='select2-input'>","  </li>","</ul>","<div class='select2-drop select2-drop-multi' style='display:none;'>","   <ul class='select2-results'>","   </ul>","</div>"].join(""))},prepareOpts:function(){var t=this.parent.prepareOpts.apply(this,arguments);return t.element.get(0).tagName.toLowerCase()==="select"?t.initSelection=function(n,t){var i=[];n.find(":selected").each2(function(n,t){i.push({id:t.attr("value"),text:t.text(),element:t[0]})}),t(i)}:"data"in t&&(t.initSelection=t.initSelection||function(i,r){var f=a(i.val(),t.separator);t.query({matcher:function(i,r,e){return n.grep(f,function(n){return u(n,t.id(e))}).length},callback:n.isFunction(r)?function(n){r(n.results)}:n.noop})}),t},initContainer:function(){var u=".select2-choices",t;this.searchContainer=this.container.find(".select2-search-field"),this.selection=t=this.container.find(u),this.search.bind("input paste",this.bind(function(){this.enabled&&(this.opened()||this.open())})),this.search.bind("keydown",this.bind(function(n){if(this.enabled){if(n.which===i.BACKSPACE&&this.search.val()===""){this.close();var u,f=t.find(".select2-search-choice-focus");if(f.length>0){this.unselect(f.first()),this.search.width(10),r(n);return}u=t.find(".select2-search-choice:not(.select2-locked)"),u.length>0&&u.last().addClass("select2-search-choice-focus")}else t.find(".select2-search-choice-focus").removeClass("select2-search-choice-focus");if(this.opened())switch(n.which){case i.UP:case i.DOWN:this.moveHighlight(n.which===i.UP?-1:1),r(n);return;case i.ENTER:case i.TAB:this.selectHighlighted(),r(n);return;case i.ESC:this.cancel(n),r(n);return}if(n.which!==i.TAB&&!i.isControl(n)&&!i.isFunctionKey(n)&&n.which!==i.BACKSPACE&&n.which!==i.ESC){if(n.which===i.ENTER){if(this.opts.openOnEnter===!1)return;if(n.altKey||n.ctrlKey||n.shiftKey||n.metaKey)return}this.open(),(n.which===i.PAGE_UP||n.which===i.PAGE_DOWN)&&r(n)}}})),this.search.bind("keyup",this.bind(this.resizeSearch)),this.search.bind("blur",this.bind(function(n){this.container.removeClass("select2-container-active"),this.search.removeClass("select2-focused"),this.opened()||this.clearSearch(),n.stopImmediatePropagation()})),this.container.delegate(u,"mousedown",this.bind(function(t){this.enabled&&(n(t.target).closest(".select2-search-choice").length>0||(this.clearPlaceholder(),this.open(),this.focusSearch(),t.preventDefault()))})),this.container.delegate(u,"focus",this.bind(function(){this.enabled&&(this.container.addClass("select2-container-active"),this.dropdown.addClass("select2-drop-active"),this.clearPlaceholder())})),this.initContainerWidth(),this.clearSearch()},enable:function(){this.enabled||(this.parent.enable.apply(this,arguments),this.search.removeAttr("disabled"))},disable:function(){this.enabled&&(this.parent.disable.apply(this,arguments),this.search.attr("disabled",!0))},initSelection:function(){var i,n;this.opts.element.val()===""&&this.opts.element.text()===""&&(this.updateSelection([]),this.close(),this.clearSearch()),(this.select||this.opts.element.val()!=="")&&(n=this,this.opts.initSelection.call(null,this.opts.element,function(i){i!==t&&i!==null&&(n.updateSelection(i),n.close(),n.clearSearch())}))},clearSearch:function(){var n=this.getPlaceholder();n!==t&&this.getVal().length===0&&this.search.hasClass("select2-focused")===!1?(this.search.val(n).addClass("select2-default"),this.resizeSearch()):this.search.val("").width(10)},clearPlaceholder:function(){this.search.hasClass("select2-default")&&this.search.val("").removeClass("select2-default")},opening:function(){this.parent.opening.apply(this,arguments),this.clearPlaceholder(),this.resizeSearch(),this.focusSearch(),this.opts.element.trigger(n.Event("open"))},close:function(){this.opened()&&this.parent.close.apply(this,arguments)},focus:function(){this.close(),this.search.focus(),this.opts.element.triggerHandler("focus")},isFocused:function(){return this.search.hasClass("select2-focused")},updateSelection:function(t){var r=[],u=[],i=this;n(t).each(function(){f(i.id(this),r)<0&&(r.push(i.id(this)),u.push(this))}),t=u,this.selection.find(".select2-search-choice").remove(),n(t).each(function(){i.addSelectedChoice(this)}),i.postprocessResults()},tokenize:function(){var n=this.search.val();n=this.opts.tokenizer(n,this.data(),this.bind(this.onSelect),this.opts),n!=null&&n!=t&&(this.search.val(n),n.length>0&&this.open())},onSelect:function(n,t){this.addSelectedChoice(n),this.opts.element.trigger({type:"selected",val:this.id(n),choice:n}),(this.select||!this.opts.closeOnSelect)&&this.postprocessResults(),this.opts.closeOnSelect?(this.close(),this.search.width(10)):this.countSelectableResults()>0?(this.search.width(10),this.resizeSearch(),this.val().length>=this.getMaximumSelectionSize()&&this.updateResults(!0),this.positionDropdown()):(this.close(),this.search.width(10)),this.triggerChange({added:n}),t&&t.noFocus||this.focusSearch()},cancel:function(){this.close(),this.focusSearch()},addSelectedChoice:function(i){var o=!i.locked,h=n("<li class='select2-search-choice'>    <div></div>    <a href='#' onclick='return false;' class='select2-search-choice-close' tabindex='-1'></a></li>"),s=n("<li class='select2-search-choice select2-locked'><div></div></li>"),u=o?h:s,c=this.id(i),e=this.getVal(),f;f=this.opts.formatSelection(i,u.find("div")),f!=t&&u.find("div").replaceWith("<div>"+this.opts.escapeMarkup(f)+"</div>"),o&&u.find(".select2-search-choice-close").bind("mousedown",r).bind("click dblclick",this.bind(function(t){this.enabled&&(n(t.target).closest(".select2-search-choice").fadeOut("fast",this.bind(function(){this.unselect(n(t.target)),this.selection.find(".select2-search-choice-focus").removeClass("select2-search-choice-focus"),this.close(),this.focusSearch()})).dequeue(),r(t))})).bind("focus",this.bind(function(){this.enabled&&(this.container.addClass("select2-container-active"),this.dropdown.addClass("select2-drop-active"))})),u.data("select2-data",i),u.insertBefore(this.searchContainer),e.push(c),this.setVal(e)},unselect:function(n){var r=this.getVal(),t,i;if(n=n.closest(".select2-search-choice"),n.length===0)throw"Invalid argument: "+n+". Must be .select2-search-choice";(t=n.data("select2-data"),t)&&(i=f(this.id(t),r),i>=0&&(r.splice(i,1),this.setVal(r),this.select&&this.postprocessResults()),n.remove(),this.opts.element.trigger({type:"removed",val:this.id(t),choice:t}),this.triggerChange({removed:t}))},postprocessResults:function(){var t=this.getVal(),r=this.results.find(".select2-result"),i=this.results.find(".select2-result-with-children"),n=this;r.each2(function(i,r){var u=n.id(r.data("select2-data"));f(u,t)>=0&&(r.addClass("select2-selected"),r.find(".select2-result-selectable").addClass("select2-selected"))}),i.each2(function(n,t){t.is(".select2-result-selectable")||t.find(".select2-result-selectable:not(.select2-selected)").length!==0||t.addClass("select2-selected")}),this.highlight()==-1&&n.highlight(0)},resizeSearch:function(){var r,u,t,f,n,i=et(this.search);r=ct(this.search)+10,u=this.search.offset().left,t=this.selection.width(),f=this.selection.offset().left,n=t-(u-f)-i,n<r&&(n=t-i),n<40&&(n=t-i),n<=0&&(n=r),this.search.width(n)},getVal:function(){var n;return this.select?(n=this.select.val(),n===null?[]:n):(n=this.opts.element.val(),a(n,this.opts.separator))},setVal:function(t){var i;this.select?this.select.val(t):(i=[],n(t).each(function(){f(this,i)<0&&i.push(this)}),this.opts.element.val(i.length===0?"":i.join(this.opts.separator)))},val:function(){var r,u=!1,f=[],i=this;if(arguments.length===0)return this.getVal();if(r=arguments[0],arguments.length>1&&(u=arguments[1]),!r&&r!==0){this.opts.element.val(""),this.updateSelection([]),this.clearSearch(),u&&this.triggerChange();return}if(this.setVal(r),this.select)this.opts.initSelection(this.select,this.bind(this.updateSelection)),u&&this.triggerChange();else{if(this.opts.initSelection===t)throw new Error("val() cannot be called if initSelection() is not defined");this.opts.initSelection(this.opts.element,function(t){var r=n(t).map(i.id);i.setVal(r),i.updateSelection(t),i.clearSearch(),u&&i.triggerChange()})}this.clearSearch()},onSortStart:function(){if(this.select)throw new Error("Sorting of elements is not supported when attached to <select>. Attach to <input type='hidden'/> instead.");this.search.width(0),this.searchContainer.hide()},onSortEnd:function(){var t=[],i=this;this.searchContainer.show(),this.searchContainer.appendTo(this.searchContainer.parent()),this.resizeSearch(),this.selection.find(".select2-search-choice").each(function(){t.push(i.opts.id(n(this).data("select2-data")))}),this.setVal(t),this.triggerChange()},data:function(t){var r=this,i;if(arguments.length===0)return this.selection.find(".select2-search-choice").map(function(){return n(this).data("select2-data")}).get();t||(t=[]),i=n.map(t,function(n){return r.opts.id(n)}),this.setVal(i),this.updateSelection(t),this.clearSearch()}}),n.fn.select2=function(){var i=Array.prototype.slice.call(arguments,0),r,u,e,o,s=["val","destroy","opened","open","close","focus","isFocused","container","onSortStart","onSortEnd","enable","disable","positionDropdown","data"];return this.each(function(){if(i.length===0||typeof i[0]=="object")r=i.length===0?{}:n.extend({},i[0]),r.element=n(this),r.element.get(0).tagName.toLowerCase()==="select"?o=r.element.attr("multiple"):(o=r.multiple||!1,"tags"in r&&(r.multiple=o=!0)),u=o?new v:new y,u.init(r);else if(typeof i[0]=="string"){if(f(i[0],s)<0)throw"Unknown method: "+i[0];if(e=t,u=n(this).data("select2"),u===t)return;if(e=i[0]==="container"?u.container:u[i[0]].apply(u,i.slice(1)),e!==t)return!1}else throw"Invalid arguments to select2 plugin: "+i;}),e===t?this:e},n.fn.select2.defaults={width:"copy",loadMorePadding:0,closeOnSelect:!0,openOnEnter:!0,containerCss:{},dropdownCss:{},containerCssClass:"",dropdownCssClass:"",formatResult:function(n,t,i,r){var u=[];return d(n.text,i.term,u,r),u.join("")},formatSelection:function(n){return n?n.text:t},sortResults:function(n){return n},formatResultCssClass:function(){return t},formatNoMatches:function(){return"No matches found"},formatInputTooShort:function(n,t){var i=t-n.length;return"Please enter "+i+" more character"+(i==1?"":"s")},formatInputTooLong:function(n,t){var i=n.length-t;return"Please enter "+i+" less character"+(i==1?"":"s")},formatSelectionTooBig:function(n){return"You can only select "+n+" item"+(n==1?"":"s")},formatLoadMore:function(){return"Loading more results..."},formatSearching:function(){return"Searching..."},minimumResultsForSearch:0,minimumInputLength:0,maximumInputLength:null,maximumSelectionSize:0,id:function(n){return n.id},matcher:function(n,t){return t.toUpperCase().indexOf(n.toUpperCase())>=0},separator:",",tokenSeparators:[],tokenizer:ft,escapeMarkup:function(n){var t={"\\":"&#92;","&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;","/":"&#47;"};return String(n).replace(/[&<>"'/\\]/g,function(n){return t[n[0]]})},blurOnChange:!1,selectOnBlur:!1,adaptContainerCssClass:function(n){return n},adaptDropdownCssClass:function(){return null}},window.Select2={query:{ajax:k,local:b,tags:w},util:{debounce:it,markMatch:d},"class":{abstract:h,single:y,multi:v}}}}(jQuery),function(n){n.fn.hoverIntent=function(t,i,r){var u={interval:100,sensitivity:7,timeout:0};u=typeof t=="object"?n.extend(u,t):n.isFunction(i)?n.extend(u,{over:t,out:i,selector:r}):n.extend(u,{over:t,out:t,selector:i});var s,h,o,f,e=function(n){s=n.pageX,h=n.pageY},l=function(t,i){if(i.hoverIntent_t=clearTimeout(i.hoverIntent_t),Math.abs(o-s)+Math.abs(f-h)<u.sensitivity)return n(i).off("mousemove.hoverIntent",e),i.hoverIntent_s=1,u.over.apply(i,[t]);o=s,f=h,i.hoverIntent_t=setTimeout(function(){l(t,i)},u.interval)},a=function(n,t){return t.hoverIntent_t=clearTimeout(t.hoverIntent_t),t.hoverIntent_s=0,u.out.apply(t,[n])},c=function(t){var r=jQuery.extend({},t),i=this;if(i.hoverIntent_t&&(i.hoverIntent_t=clearTimeout(i.hoverIntent_t)),t.type=="mouseenter"){o=r.pageX,f=r.pageY;n(i).on("mousemove.hoverIntent",e);i.hoverIntent_s!=1&&(i.hoverIntent_t=setTimeout(function(){l(r,i)},u.interval))}else n(i).off("mousemove.hoverIntent",e),i.hoverIntent_s==1&&(i.hoverIntent_t=setTimeout(function(){a(r,i)},u.timeout))};return this.on({"mouseenter.hoverIntent":c,"mouseleave.hoverIntent":c},u.selector)}}(jQuery),function(n){n.fn.cond=function(){for(var e,f=arguments,u=0,t,i,r;!t&&u<f.length;)t=f[u++],i=f[u++],t=n.isFunction(t)?t.call(this):t,r=i?t?i.call(this,t):e:t;return r!==e?r:this}}(jQuery),Hashtable=function(){function f(t){var i;if(typeof t=="string")return t;if(typeof t.hashCode==n)return i=t.hashCode(),typeof i=="string"?i:f(i);if(typeof t.toString==n)return t.toString();try{return String(t)}catch(r){return Object.prototype.toString.call(t)}}function y(n,t){return n.equals(t)}function p(t,i){return typeof i.equals==n?i.equals(t):t===i}function a(n){return function(t){if(t===null)throw new Error("null is not a valid "+n);else if(typeof t=="undefined")throw new Error(n+" must not be undefined");}}function u(n,t,i,r){this[0]=n,this.entries=[],this.addEntry(t,i),r!==null&&(this.getEqualityFunction=function(){return r})}function r(n){return function(t){for(var r=this.entries.length,i,u=this.getEqualityFunction(t);r--;)if(i=this.entries[r],u(t,i[0]))switch(n){case v:return!0;case c:return i;case e:return[r,i[1]]}return!1}}function o(n){return function(t){for(var u=t.length,i=0,r=this.entries.length;i<r;++i)t[u+i]=this.entries[i][n]}}function w(n,t){for(var i=n.length,r;i--;)if(r=n[i],t===r[0])return i;return null}function i(n,t){var i=n[t];return i&&i instanceof u?i:null}function s(r,e){var y=this,o=[],c={},v=typeof r==n?r:f,p=typeof e==n?e:null,a;this.put=function(n,r){t(n),l(r);var s=v(n),f,e,h=null;return f=i(c,s),f?(e=f.getEntryForKey(n),e?(h=e[1],e[1]=r):f.addEntry(n,r)):(f=new u(s,n,r,p),o[o.length]=f,c[s]=f),h},this.get=function(n){var f,r,u;return(t(n),f=v(n),r=i(c,f),r&&(u=r.getEntryForKey(n),u))?u[1]:null},this.containsKey=function(n){t(n);var u=v(n),r=i(c,u);return r?r.containsKey(n):!1},this.containsValue=function(n){l(n);for(var t=o.length;t--;)if(o[t].containsValue(n))return!0;return!1},this.clear=function(){o.length=0,c={}},this.isEmpty=function(){return!o.length},a=function(n){return function(){for(var i=[],t=o.length;t--;)o[t][n](i);return i}},this.keys=a("keys"),this.values=a("values"),this.entries=a("getEntries"),this.remove=function(n){t(n);var f=v(n),e,r=null,u=i(c,f);return u&&(r=u.removeEntryForKey(n),r!==null&&(u.entries.length||(e=w(o,f),h(o,e),delete c[f]))),r},this.size=function(){for(var t=0,n=o.length;n--;)t+=o[n].entries.length;return t},this.each=function(n){for(var i=y.entries(),r=i.length,t;r--;)t=i[r],n(t[0],t[1])},this.putAll=function(t,i){for(var s=t.entries(),f,r,u,o,e=s.length,h=typeof i==n;e--;)f=s[e],r=f[0],u=f[1],h&&(o=y.get(r))&&(u=i(r,o,u)),y.put(r,u)},this.clone=function(){var n=new s(r,e);return n.putAll(y),n}}var n="function",h=typeof Array.prototype.splice==n?function(n,t){n.splice(t,1)}:function(n,t){var r,i,u;if(t===n.length-1)n.length=t;else for(r=n.slice(t+1),n.length=t,i=0,u=r.length;i<u;++i)n[t+i]=r[i]},t=a("key"),l=a("value"),v=0,c=1,e=2;return u.prototype={getEqualityFunction:function(t){return typeof t.equals==n?y:p},getEntryForKey:r(c),getEntryAndIndexForKey:r(e),removeEntryForKey:function(n){var t=this.getEntryAndIndexForKey(n);return t?(h(this.entries,t[0]),t[1]):null},addEntry:function(n,t){this.entries[this.entries.length]=[n,t]},keys:o(0),values:o(1),getEntries:function(n){for(var r=n.length,t=0,i=this.entries.length;t<i;++t)n[r+t]=this.entries[t].slice(0)},containsKey:r(v),containsValue:function(n){for(var t=this.entries.length;t--;)if(n===this.entries[t][1])return!0;return!1}},s}(),function(n){function e(n,t,i){this.dec=n,this.group=t,this.neg=i}function f(){for(var t,n=0;n<r.length;n++)for(localeGroup=r[n],t=0;t<localeGroup.length;t++)i.put(localeGroup[t],n)}function t(n,t){var u,r;i.size()==0&&f();var s=".",o=",",c="-";return t==!1&&(n.indexOf("_")!=-1?n=n.split("_")[1].toLowerCase():n.indexOf("-")!=-1&&(n=n.split("-")[1].toLowerCase())),u=i.get(n),u&&(r=h[u],r&&(s=r[0],o=r[1])),new e(s,o,c)}var i=new Hashtable,s=["ae","au","ca","cn","eg","gb","hk","il","in","jp","sk","th","tw","us"],o=["at","br","de","dk","es","gr","it","nl","pt","tr","vn"],c=["cz","fi","fr","ru","se","pl"],u=["ch"],h=[[".",","],[",","."],[","," "],[".","'"]],r=[s,o,c,u];n.fn.formatNumber=function(t,i,r){return this.each(function(){var f,u;return i==null&&(i=!0),r==null&&(r=!0),f=n(this).is(":input")?new String(n(this).val()):new String(n(this).text()),u=n.formatNumber(f,t),i&&(n(this).is(":input")?n(this).val(u):n(this).text(u)),r?u:void 0})},n.formatNumber=function(i,r){for(var r=n.extend({},n.fn.formatNumber.defaults,r),o=t(r.locale.toLowerCase(),r.isFullLocale),a=o.dec,v=o.group,l=o.neg,c="0#-,.",e="",s=!1,f,h,u=0;u<r.format.length;u++)if(c.indexOf(r.format.charAt(u))==-1)e=e+r.format.charAt(u);else if(u==0&&r.format.charAt(u)=="-"){s=!0;continue}else break;for(f="",u=r.format.length-1;u>=0;u--)if(c.indexOf(r.format.charAt(u))==-1)f=r.format.charAt(u)+f;else break;return r.format=r.format.substring(e.length),r.format=r.format.substring(0,r.format.length-f.length),h=new Number(i),n._formatNumber(h,r,f,e,s)},n._formatNumber=function(i,r,u,f,e){var r=n.extend({},n.fn.formatNumber.defaults,r),d=t(r.locale.toLowerCase(),r.isFullLocale),rt=d.dec,ot=d.group,ft=d.neg,ut=!1,h,y,a,v,st,l,et,p,s,c,nt,k,b,o,g,it,tt,w;if(isNaN(i))if(r.nanForceZero==!0)i=0,ut=!0;else return null;if(u=="%"&&(i=i*100),h="",r.format.indexOf(".")>-1){for(y=rt,a=r.format.substring(r.format.lastIndexOf(".")+1),r.round==!0?i=new Number(i.toFixed(a.length)):(v=i.toString(),v=v.substring(0,v.lastIndexOf(".")+a.length+1),i=new Number(v)),st=i%1,l=new String(st.toFixed(a.length)),l=l.substring(l.lastIndexOf(".")+1),o=0;o<a.length;o++)if(a.charAt(o)=="#"&&l.charAt(o)!="0"){y+=l.charAt(o);continue}else if(a.charAt(o)=="#"&&l.charAt(o)=="0")if(et=l.substring(o),et.match("[1-9]")){y+=l.charAt(o);continue}else break;else a.charAt(o)=="0"&&(y+=l.charAt(o));h+=y}else i=Math.round(i);if(p=Math.floor(i),i<0&&(p=Math.ceil(i)),s="",s=r.format.indexOf(".")==-1?r.format:r.format.substring(0,r.format.indexOf(".")),c="",!(p==0&&s.substr(s.length-1)=="#")||ut){for(nt=new String(Math.abs(p)),k=9999,s.lastIndexOf(",")!=-1&&(k=s.length-s.lastIndexOf(",")-1),b=0,o=nt.length-1;o>-1;o--)c=nt.charAt(o)+c,b++,b==k&&o!=0&&(c=ot+c,b=0);if(s.length>c.length&&(g=s.indexOf("0"),g!=-1))for(it=s.length-g,tt=s.length-c.length-1;c.length<it;)w=s.charAt(tt),w==","&&(w=ot),c=w+c,tt--}return c||s.indexOf("0",s.length-1)===-1||(c="0"),h=c+h,i<0&&e&&f.length>0?f=ft+f:i<0&&(h=ft+h),r.decimalSeparatorAlwaysShown||h.lastIndexOf(rt)==h.length-1&&(h=h.substring(0,h.length-1)),h=f+h+u},n.fn.parseNumber=function(t,i,r){var f,u;return i==null&&(i=!0),r==null&&(r=!0),f=n(this).is(":input")?new String(n(this).val()):new String(n(this).text()),u=n.parseNumber(f,t),u&&(i&&(n(this).is(":input")?n(this).val(u.toString()):n(this).text(u.toString())),r)?u:void 0},n.parseNumber=function(i,r){for(var r=n.extend({},n.fn.parseNumber.defaults,r),h=t(r.locale.toLowerCase(),r.isFullLocale),v=h.dec,c=h.group,y=h.neg,a="1234567890.-",f,s,e,u,o,l;i.indexOf(c)>-1;)i=i.replace(c,"");for(i=i.replace(v,".").replace(y,"-"),f="",s=!1,(i.charAt(i.length-1)=="%"||r.isPercentage==!0)&&(s=!0),e=0;e<i.length;e++)a.indexOf(i.charAt(e))>-1&&(f=f+i.charAt(e));return u=new Number(f),s&&(u=u/100,o=f.indexOf("."),o!=-1?(l=f.length-o-1,u=u.toFixed(l+2)):u=u.toFixed(f.length-1)),u},n.fn.parseNumber.defaults={locale:"us",decimalSeparatorAlwaysShown:!1,isPercentage:!1,isFullLocale:!1},n.fn.formatNumber.defaults={format:"#,###.00",locale:"us",decimalSeparatorAlwaysShown:!1,nanForceZero:!0,round:!0,isFullLocale:!1},Number.prototype.toFixed=function(t){return n._roundNumber(this,t)},n._roundNumber=function(n,t){var u=Math.pow(10,t||0),r=String(Math.round(n*u)/u),i;if(t>0)for(i=r.indexOf("."),i==-1?(r+=".",i=0):i=r.length-(i+1);i<t;)r+="0",i++;return r}}(jQuery),function(){var n={};this.tmpl=function t(i,r){var u=/\W/.test(i)?new Function("obj","var p=[],print=function(){p.push.apply(p,arguments);};with(obj){p.push('"+i.replace(/[\r\t\n]/g," ").split("<%").join("\t").replace(/((^|%>)[^\t]*)'/g,"$1\r").replace(/\t=(.*?)%>/g,"',$1,'").split("\t").join("');").split("%>").join("p.push('").split("\r").join("\\'")+"');}return p.join('');"):n[i]=n[i]||t(document.getElementById(i).innerHTML);return r?u(r):u}}(),function(n){n.baseClass=function(t){return t=n(t),t.get(0).className.match(/([^ ]+)/)[1]},n.fn.addDependClass=function(t,i){var r={delimiter:i?i:"-"};return this.each(function(){var i=n.baseClass(this);i&&n(this).addClass(i+r.delimiter+t)})},n.fn.removeDependClass=function(t,i){var r={delimiter:i?i:"-"};return this.each(function(){var i=n.baseClass(this);i&&n(this).removeClass(i+r.delimiter+t)})},n.fn.toggleDependClass=function(t,i){var r={delimiter:i?i:"-"};return this.each(function(){var i=n.baseClass(this);i&&(n(this).is("."+i+r.delimiter+t)?n(this).removeClass(i+r.delimiter+t):n(this).addClass(i+r.delimiter+t))})}}(jQuery),function(n){function t(){this._init.apply(this,arguments)}t.prototype.oninit=function(){},t.prototype.events=function(){},t.prototype.onmousedown=function(){this.ptr.css({position:"absolute"})},t.prototype.onmousemove=function(n,t,i){this.ptr.css({left:t,top:i})},t.prototype.onmouseup=function(){},t.prototype.isDefault={drag:!1,clicked:!1,toclick:!0,mouseup:!1},t.prototype._init=function(){if(arguments.length>0){this.ptr=n(arguments[0]),this.outer=n(".draggable-outer"),this.is={},n.extend(this.is,this.isDefault);var t=this.ptr.offset();this.d={left:t.left,top:t.top,width:this.ptr.width(),height:this.ptr.height()},this.oninit.apply(this,arguments),this._events()}},t.prototype._getPageCoords=function(n){return n.targetTouches&&n.targetTouches[0]?{x:n.targetTouches[0].pageX,y:n.targetTouches[0].pageY}:{x:n.pageX,y:n.pageY}},t.prototype._bindEvent=function(n,t,i){var r=this;this.supportTouches_?n.get(0).addEventListener(this.events_[t],i,!1):n.bind(this.events_[t],i)},t.prototype._events=function(){var t=this;this.supportTouches_=!1,this.events_={click:this.supportTouches_?"touchstart":"click",down:this.supportTouches_?"touchstart":"mousedown",move:this.supportTouches_?"touchmove":"mousemove",up:this.supportTouches_?"touchend":"mouseup"},this._bindEvent(n(document),"move",function(n){t.is.drag&&(n.stopPropagation(),n.preventDefault(),t._mousemove(n))}),this._bindEvent(n(document),"down",function(n){t.is.drag&&(n.stopPropagation(),n.preventDefault())}),this._bindEvent(n(document),"up",function(n){t._mouseup(n)}),this._bindEvent(this.ptr,"down",function(n){return t._mousedown(n),!1}),this._bindEvent(this.ptr,"up",function(n){t._mouseup(n)}),this.ptr.find("a").click(function(){return t.is.clicked=!0,t.is.toclick?void 0:(t.is.toclick=!0,!1)}).mousedown(function(n){return t._mousedown(n),!1}),this.events()},t.prototype._mousedown=function(t){this.is.drag=!0,this.is.clicked=!1,this.is.mouseup=!1;var i=this.ptr.offset(),r=this._getPageCoords(t);this.cx=r.x-i.left,this.cy=r.y-i.top,n.extend(this.d,{left:i.left,top:i.top,width:this.ptr.width(),height:this.ptr.height()}),this.outer&&this.outer.get(0)&&this.outer.css({height:Math.max(this.outer.height(),n(document.body).height()),overflow:"hidden"});this.onmousedown(t)},t.prototype._mousemove=function(n){this.is.toclick=!1;var t=this._getPageCoords(n);this.onmousemove(n,t.x-this.cx,t.y-this.cy)},t.prototype._mouseup=function(t){var i=this;if(this.is.drag){this.is.drag=!1,this.outer&&this.outer.get(0)&&(n.browser.mozilla?this.outer.css({overflow:"hidden"}):this.outer.css({overflow:"visible"}),n.browser.msie&&n.browser.version=="6.0"?this.outer.css({height:"100%"}):this.outer.css({height:"auto"}));this.onmouseup(t)}},window.Draggable=t}(jQuery),function(n){function u(n){return typeof n=="undefined"?!1:n instanceof Array||!(n instanceof Object)&&Object.prototype.toString.call(n)=="[object Array]"||typeof n.length=="number"&&typeof n.splice!="undefined"&&typeof n.propertyIsEnumerable!="undefined"&&!n.propertyIsEnumerable("splice")?!0:!1}function t(){return this.init.apply(this,arguments)}function r(){Draggable.apply(this,arguments)}n.slider=function(i,r){var u=n(i);return u.data("jslider")||u.data("jslider",new t(i,r)),u.data("jslider")},n.fn.slider=function(t,i){function o(n){return n!==undefined}function f(n){return n!=null}var e,r=arguments;return this.each(function(){var h=n.slider(this,t),s,l,c;if(typeof t=="string")switch(t){case"value":o(r[1])&&o(r[2])?(s=h.getPointers(),f(s[0])&&f(r[1])&&(s[0].set(r[1]),s[0].setIndexOver()),f(s[1])&&f(r[2])&&(s[1].set(r[2]),s[1].setIndexOver())):o(r[1])?(s=h.getPointers(),f(s[0])&&f(r[1])&&(s[0].set(r[1]),s[0].setIndexOver())):e=h.getValue();break;case"prc":o(r[1])&&o(r[2])?(s=h.getPointers(),f(s[0])&&f(r[1])&&(s[0]._set(r[1]),s[0].setIndexOver()),f(s[1])&&f(r[2])&&(s[1]._set(r[2]),s[1].setIndexOver())):o(r[1])?(s=h.getPointers(),f(s[0])&&f(r[1])&&(s[0]._set(r[1]),s[0].setIndexOver())):e=h.getPrcValue();break;case"calculatedValue":for(l=h.getValue().split(";"),e="",c=0;c<l.length;c++)e+=(c>0?";":"")+h.nice(l[c]);break;case"skin":h.setSkin(r[1])}else t||i||(u(e)||(e=[]),e.push(h))}),u(e)&&e.length==1&&(e=e[0]),e||this};var i={settings:{from:1,to:10,step:1,smooth:!0,limits:!0,round:0,format:{format:"#,##0.##"},value:"5;7",dimension:""},className:"jslider",selector:".jslider-",template:tmpl('<span class="<%=className%>"><table><tr><td><div class="<%=className%>-bg"><i class="l"></i><i class="f"></i><i class="r"></i><i class="v"></i></div><div class="<%=className%>-pointer"></div><div class="<%=className%>-pointer <%=className%>-pointer-to"></div><div class="<%=className%>-label"><span><%=settings.from%></span></div><div class="<%=className%>-label <%=className%>-label-to"><span><%=settings.to%></span><%=settings.dimension%></div><div class="<%=className%>-value"><span></span><%=settings.dimension%></div><div class="<%=className%>-value <%=className%>-value-to"><span></span><%=settings.dimension%></div><div class="<%=className%>-scale"><%=scale%></div></td></tr></table></span>')};t.prototype.init=function(t,r){this.settings=n.extend(!0,{},i.settings,r?r:{}),this.inputNode=n(t).hide(),this.settings.interval=this.settings.to-this.settings.from,this.settings.value=this.inputNode.attr("value"),this.settings.calculate&&n.isFunction(this.settings.calculate)&&(this.nice=this.settings.calculate),this.settings.onstatechange&&n.isFunction(this.settings.onstatechange)&&(this.onstatechange=this.settings.onstatechange),this.is={init:!1},this.o={},this.create()},t.prototype.onstatechange=function(){},t.prototype.create=function(){var t=this;this.domNode=n(i.template({className:i.className,settings:{from:this.nice(this.settings.from),to:this.nice(this.settings.to),dimension:this.settings.dimension},scale:this.generateScale()})),this.inputNode.after(this.domNode),this.drawScale(),this.settings.skin&&this.settings.skin.length>0&&this.setSkin(this.settings.skin),this.sizes={domWidth:this.domNode.width(),domOffset:this.domNode.offset()},n.extend(this.o,{pointers:{},labels:{0:{o:this.domNode.find(i.selector+"value").not(i.selector+"value-to")},1:{o:this.domNode.find(i.selector+"value").filter(i.selector+"value-to")}},limits:{0:this.domNode.find(i.selector+"label").not(i.selector+"label-to"),1:this.domNode.find(i.selector+"label").filter(i.selector+"label-to")}}),n.extend(this.o.labels[0],{value:this.o.labels[0].o.find("span")}),n.extend(this.o.labels[1],{value:this.o.labels[1].o.find("span")}),t.settings.value.split(";")[1]||(this.settings.single=!0,this.domNode.addDependClass("single")),t.settings.limits||this.domNode.addDependClass("limitless"),this.domNode.find(i.selector+"pointer").each(function(n){var i=t.settings.value.split(";")[n],u;i&&(t.o.pointers[n]=new r(this,n,t),u=t.settings.value.split(";")[n-1],u&&new Number(i)<new Number(u)&&(i=u),i=i<t.settings.from?t.settings.from:i,i=i>t.settings.to?t.settings.to:i,t.o.pointers[n].set(i,!0))}),this.o.value=this.domNode.find(".v"),this.is.init=!0,n.each(this.o.pointers,function(){t.redraw(this)}),function(t){n(window).resize(function(){t.onresize()})}(this)},t.prototype.setSkin=function(n){this.skin_&&this.domNode.removeDependClass(this.skin_,"_"),this.domNode.addDependClass(this.skin_=n,"_")},t.prototype.setPointersIndex=function(){n.each(this.getPointers(),function(n){this.index(n)})},t.prototype.getPointers=function(){return this.o.pointers},t.prototype.generateScale=function(){var n;if(this.settings.scale&&this.settings.scale.length>0){var i="",t=this.settings.scale,r=Math.round(1e3/(t.length-1))/10;for(n=0;n<t.length;n++)i+='<span style="left: '+n*r+'%">'+(t[n]!="|"?"<ins>"+t[n]+"</ins>":"")+"</span>";return i}return""},t.prototype.drawScale=function(){this.domNode.find(i.selector+"scale span ins").each(function(){n(this).css({marginLeft:-n(this).outerWidth()/2})})},t.prototype.onresize=function(){var t=this;this.sizes={domWidth:this.domNode.width(),domOffset:this.domNode.offset()},n.each(this.o.pointers,function(){t.redraw(this)})},t.prototype.update=function(){this.onresize(),this.drawScale()},t.prototype.limits=function(n,t){var r,i;return this.settings.smooth||(r=this.settings.step*100/this.settings.interval,n=Math.round(n/r)*r),i=this.o.pointers[1-t.uid],i&&t.uid&&n<i.value.prc&&(n=i.value.prc),i&&!t.uid&&n>i.value.prc&&(n=i.value.prc),n<0&&(n=0),n>100&&(n=100),Math.round(n*10)/10},t.prototype.redraw=function(n){if(!this.is.init)return!1;this.setValue(),this.o.pointers[0]&&this.o.pointers[1]&&this.o.value.css({left:this.o.pointers[0].value.prc+"%",width:this.o.pointers[1].value.prc-this.o.pointers[0].value.prc+"%"}),this.o.labels[n.uid].value.html(this.nice(n.value.origin)),this.redrawLabels(n)},t.prototype.redrawLabels=function(n){function e(n,t,i){return t.margin=-t.label/2,label_left=t.border+t.margin,label_left<0&&(t.margin-=label_left),t.border+t.label/2>o.sizes.domWidth?(t.margin=0,t.right=!0):t.right=!1,n.o.css({left:i+"%",marginLeft:t.margin,right:"auto"}),t.right&&n.o.css({left:"auto",right:0}),t}var o=this,f=this.o.labels[n.uid],u=n.value.prc,t={label:f.o.outerWidth(),right:!1,border:u*this.sizes.domWidth/100},i,r;if(!this.settings.single){i=this.o.pointers[1-n.uid],r=this.o.labels[i.uid];switch(n.uid){case 0:t.border+t.label/2>r.o.offset().left-this.sizes.domOffset.left?(r.o.css({visibility:"hidden"}),r.value.html(this.nice(i.value.origin)),f.o.css({visibility:"visible"}),u=(i.value.prc-u)/2+u,i.value.prc!=n.value.prc&&(f.value.html(this.nice(n.value.origin)+"&nbsp;&ndash;&nbsp;"+this.nice(i.value.origin)),t.label=f.o.outerWidth(),t.border=u*this.sizes.domWidth/100)):r.o.css({visibility:"visible"});break;case 1:t.border-t.label/2<r.o.offset().left-this.sizes.domOffset.left+r.o.outerWidth()?(r.o.css({visibility:"hidden"}),r.value.html(this.nice(i.value.origin)),f.o.css({visibility:"visible"}),u=(u-i.value.prc)/2+i.value.prc,i.value.prc!=n.value.prc&&(f.value.html(this.nice(i.value.origin)+"&nbsp;&ndash;&nbsp;"+this.nice(n.value.origin)),t.label=f.o.outerWidth(),t.border=u*this.sizes.domWidth/100)):r.o.css({visibility:"visible"})}}t=e(f,t,u),r&&(t={label:r.o.outerWidth(),right:!1,border:i.value.prc*this.sizes.domWidth/100},t=e(r,t,i.value.prc)),this.redrawLimits()},t.prototype.redrawLimits=function(){var t,i,n;if(this.settings.limits){t=[!0,!0];for(key in this.o.pointers)if(!this.settings.single||key==0){var f=this.o.pointers[key],r=this.o.labels[f.uid],u=r.o.offset().left-this.sizes.domOffset.left,i=this.o.limits[0];u<i.outerWidth()&&(t[0]=!1),i=this.o.limits[1],u+r.o.outerWidth()>this.sizes.domWidth-i.outerWidth()&&(t[1]=!1)}for(n=0;n<t.length;n++)t[n]?this.o.limits[n].fadeIn("fast"):this.o.limits[n].fadeOut("fast")}},t.prototype.setValue=function(){var n=this.getValue();this.inputNode.attr("value",n),this.onstatechange.call(this,n)},t.prototype.getValue=function(){if(!this.is.init)return!1;var i=this,t="";return n.each(this.o.pointers,function(n){this.value.prc==undefined||isNaN(this.value.prc)||(t+=(n>0?";":"")+i.prcToValue(this.value.prc))}),t},t.prototype.getPrcValue=function(){if(!this.is.init)return!1;var i=this,t="";return n.each(this.o.pointers,function(n){this.value.prc==undefined||isNaN(this.value.prc)||(t+=(n>0?";":"")+this.value.prc)}),t},t.prototype.prcToValue=function(n){var i,t,u;if(this.settings.heterogeneity&&this.settings.heterogeneity.length>0){var f=this.settings.heterogeneity,r=0,e=this.settings.from;for(i=0;i<=f.length;i++)t=f[i]?f[i].split("/"):[100,this.settings.to],t[0]=new Number(t[0]),t[1]=new Number(t[1]),n>=r&&n<=t[0]&&(u=e+(n-r)*(t[1]-e)/(t[0]-r)),r=t[0],e=t[1]}else u=this.settings.from+n*this.settings.interval/100;return this.round(u)},t.prototype.valueToPrc=function(n,t){var r,i,f;if(this.settings.heterogeneity&&this.settings.heterogeneity.length>0){var e=this.settings.heterogeneity,o=0,u=this.settings.from;for(r=0;r<=e.length;r++)i=e[r]?e[r].split("/"):[100,this.settings.to],i[0]=new Number(i[0]),i[1]=new Number(i[1]),n>=u&&n<=i[1]&&(f=t.limits(o+(n-u)*(i[0]-o)/(i[1]-u))),o=i[0],u=i[1]}else f=t.limits((n-this.settings.from)*100/this.settings.interval);return f},t.prototype.round=function(n){return n=Math.round(n/this.settings.step)*this.settings.step,n=this.settings.round?Math.round(n*Math.pow(10,this.settings.round))/Math.pow(10,this.settings.round):Math.round(n)},t.prototype.nice=function(t){return t=t.toString().replace(/,/gi,".").replace(/ /gi,""),n.formatNumber?n.formatNumber(new Number(t),this.settings.format||{}).replace(/-/gi,"&minus;"):new Number(t)},r.prototype=new Draggable,r.prototype.oninit=function(n,t,i){this.uid=t,this.parent=i,this.value={},this.settings=this.parent.settings},r.prototype.onmousedown=function(){this._parent={offset:this.parent.domNode.offset(),width:this.parent.domNode.width()},this.ptr.addDependClass("hover"),this.setIndexOver()},r.prototype.onmousemove=function(n){var i=this._getPageCoords(n);this._set(this.calc(i.x))},r.prototype.onmouseup=function(){this.parent.settings.callback&&n.isFunction(this.parent.settings.callback)&&this.parent.settings.callback.call(this.parent,this.parent.getValue()),this.ptr.removeDependClass("hover")},r.prototype.setIndexOver=function(){this.parent.setPointersIndex(1),this.index(2)},r.prototype.index=function(n){this.ptr.css({zIndex:n})},r.prototype.limits=function(n){return this.parent.limits(n,this)},r.prototype.calc=function(n){return this.limits((n-this._parent.offset.left)*100/this._parent.width)},r.prototype.set=function(n,t){this.value.origin=this.parent.round(n),this._set(this.parent.valueToPrc(n,this),t)},r.prototype._set=function(n,t){t||(this.value.origin=this.parent.prcToValue(n)),this.value.prc=n,this.ptr.css({left:n+"%"}),this.parent.redraw(this)}}(jQuery),function(n,t,i){"use strict";var c=n.event,f,o,e,r,u;f=c.special.debouncedresize={setup:function(){n(this).on("resize",f.handler)},teardown:function(){n(this).off("resize",f.handler)},handler:function(n,t){var r=this,u=arguments,i=function(){n.type="debouncedresize",c.dispatch.apply(r,u)};o&&clearTimeout(o),t?i():o=setTimeout(i,f.threshold)},threshold:20};var h=n(t),l=n(document),s=t.Modernizr;n.Slitslider=function(t,i){this.$elWrapper=n(i),this._init(t)},n.Slitslider.defaults={speed:800,optOpacity:!1,translateFactor:230,maxAngle:25,maxScale:2,autoplay:!1,keyboard:!0,interval:4e3,onBeforeChange:function(){return!1},onAfterChange:function(){return!1}},n.Slitslider.prototype={_init:function(t){this.options=n.extend(!0,{},n.Slitslider.defaults,t),this.transEndEventNames={WebkitTransition:"webkitTransitionEnd",MozTransition:"transitionend",OTransition:"oTransitionEnd",msTransition:"MSTransitionEnd",transition:"transitionend"},this.transEndEventName=this.transEndEventNames[s.prefixed("transition")],this.support=s.csstransitions&&s.csstransforms3d,this.$el=this.$elWrapper.children(".sl-slider"),this.$slides=this.$el.children(".sl-slide").hide(),this.slidesCount=this.$slides.length,this.current=0,this.isAnimating=!1,this._getSize(),this._layout(),this._loadEvents(),this.options.autoplay&&this._startSlideshow()},_getSize:function(){this.size={width:this.$elWrapper.outerWidth(!0),height:this.$elWrapper.outerHeight(!0)}},_layout:function(){this.$slideWrapper=n('<div class="sl-slides-wrapper" />'),this.$slides.wrapAll(this.$slideWrapper).each(function(){var i=n(this),r=i.data("orientation");i.addClass("sl-slide-"+r).children().wrapAll('<div class="sl-content-wrapper" />').wrapAll('<div class="sl-content" />')}),this._setSize(),this.$slides.eq(this.current).show()},_navigate:function(t,r){var e,f,a;if(this.isAnimating||this.slidesCount<2)return!1;this.isAnimating=!0,e=this,f=this.$slides.eq(this.current),r!==i?this.current=r:t==="next"?this.current=this.current<this.slidesCount-1?++this.current:0:t==="prev"&&(this.current=this.current>0?--this.current:this.slidesCount-1);this.options.onBeforeChange(f,this.current);var l=this.$slides.eq(this.current),c=t==="next"?f:l,o=c.data(),u={};u.orientation=o.orientation||"horizontal",u.slice1angle=o.slice1Rotation||0,u.slice1scale=o.slice1Scale||1,u.slice2angle=o.slice2Rotation||0,u.slice2scale=o.slice2Scale||1,this._validateValues(u);var y=u.orientation==="horizontal"?{marginTop:-this.size.height/2}:{marginLeft:-this.size.width/2},v={transform:"translate(0%,0%) rotate(0deg) scale(1)",opacity:1},s=u.orientation==="horizontal"?{transform:"translateY(-"+this.options.translateFactor+"%) rotate("+u.slice1angle+"deg) scale("+u.slice1scale+")"}:{transform:"translateX(-"+this.options.translateFactor+"%) rotate("+u.slice1angle+"deg) scale("+u.slice1scale+")"},h=u.orientation==="horizontal"?{transform:"translateY("+this.options.translateFactor+"%) rotate("+u.slice2angle+"deg) scale("+u.slice2scale+")"}:{transform:"translateX("+this.options.translateFactor+"%) rotate("+u.slice2angle+"deg) scale("+u.slice2scale+")"};this.options.optOpacity&&(s.opacity=0,h.opacity=0),f.removeClass("sl-trans-elems"),a={transition:"all "+this.options.speed+"ms ease-in-out"},c.css("z-index",this.slidesCount).find("div.sl-content-wrapper").wrap(n('<div class="sl-content-slice" />').css(a)).parent().cond(t==="prev",function(){var n=this;this.css(s),setTimeout(function(){n.css(v)},50)},function(){var n=this;setTimeout(function(){n.css(s)},50)}).clone().appendTo(c).cond(t==="prev",function(){var n=this;this.css(h),setTimeout(function(){if(f.addClass("sl-trans-back-elems"),e.support)n.css(v).on(e.transEndEventName,function(){e._onEndNavigate(n,f,t)});else e._onEndNavigate(n,f,t)},50)},function(){var n=this;setTimeout(function(){if(l.addClass("sl-trans-elems"),e.support)n.css(h).on(e.transEndEventName,function(){e._onEndNavigate(n,f,t)});else e._onEndNavigate(n,f,t)},50)}).find("div.sl-content-wrapper").css(y),l.show()},_validateValues:function(n){(n.slice1angle>this.options.maxAngle||n.slice1angle<-this.options.maxAngle)&&(n.slice1angle=this.options.maxAngle),(n.slice2angle>this.options.maxAngle||n.slice2angle<-this.options.maxAngle)&&(n.slice2angle=this.options.maxAngle),(n.slice1scale>this.options.maxScale||n.slice1scale<=0)&&(n.slice1scale=this.options.maxScale),(n.slice2scale>this.options.maxScale||n.slice2scale<=0)&&(n.slice2scale=this.options.maxScale),n.orientation!=="vertical"&&n.orientation!=="horizontal"&&(n.orientation="horizontal")},_onEndNavigate:function(n,t){var r=n.parent(),u="sl-trans-elems sl-trans-back-elems";n.remove(),r.css("z-index",1).find("div.sl-content-wrapper").unwrap(),t.hide().removeClass(u),r.removeClass(u),this.isAnimating=!1;this.options.onAfterChange(r,this.current)},_setSize:function(){var n={width:this.size.width,height:this.size.height};this.$el.css(n).find("div.sl-content-wrapper").css(n)},_loadEvents:function(){var n=this;h.on("debouncedresize.slitslider",function(){n._getSize(),n._setSize()});if(this.options.keyboard)l.on("keydown.slitslider",function(t){var r=t.keyCode||t.which,i={left:37,up:38,right:39,down:40};switch(r){case i.left:n._stopSlideshow(),n._navigate("prev");break;case i.right:n._stopSlideshow(),n._navigate("next")}})},_startSlideshow:function(){var n=this;this.slideshow=setTimeout(function(){n._navigate("next"),n.options.autoplay&&n._startSlideshow()},this.options.interval)},_stopSlideshow:function(){this.options.autoplay&&(clearTimeout(this.slideshow),this.isPlaying=!1,this.options.autoplay=!1)},_destroy:function(t){this.$el.off(".slitslider").removeData("slitslider"),h.off(".slitslider"),l.off(".slitslider"),this.$slides.each(function(){var i=n(this),r=i.find("div.sl-content").children();r.appendTo(i),i.children("div.sl-content-wrapper").remove()}),this.$slides.unwrap(this.$slideWrapper).hide(),this.$slides.eq(0).show(),t&&t.call()},add:function(t,i){this.$slides=this.$slides.add(t);var r=this;t.each(function(){var i=n(this),u=i.data("orientation");i.hide().addClass("sl-slide-"+u).children().wrapAll('<div class="sl-content-wrapper" />').wrapAll('<div class="sl-content" />').end().appendTo(r.$el.find("div.sl-slides-wrapper"))}),this._setSize(),this.slidesCount=this.$slides.length,i&&i.call($items)},next:function(){this._stopSlideshow(),this._navigate("next")},previous:function(){this._stopSlideshow(),this._navigate("prev")},jump:function(n){if(n-=1,n===this.current||n>=this.slidesCount||n<0)return!1;this._stopSlideshow(),this._navigate(n>this.current?"next":"prev",n)},play:function(){this.isPlaying||(this.isPlaying=!0,this._navigate("next"),this.options.autoplay=!0,this._startSlideshow())},pause:function(){this.isPlaying&&this._stopSlideshow()},isActive:function(){return this.isAnimating},destroy:function(n){this._destroy(n)}},e=function(n){t.console&&t.console.error(n)},n.fn.slitslider=function(t){var i=n.data(this,"slitslider"),r;return typeof t=="string"?(r=Array.prototype.slice.call(arguments,1),this.each(function(){if(!i){e("cannot call methods on slitslider prior to initialization; attempted to call method '"+t+"'");return}if(!n.isFunction(i[t])||t.charAt(0)==="_"){e("no such method '"+t+"' for slitslider self");return}i[t].apply(i,r)})):this.each(function(){i?i._init():i=n.data(this,"slitslider",new n.Slitslider(t,this))}),i},n.fn.loadHomeSpotlight=function(t){var f=[],c='<div class="sl-slide" data-orientation="horizontal" data-slice1-rotation="-25" data-slice2-rotation="-25" data-slice1-scale="2" data-slice2-scale="2"><div class="sl-slide-inner content child{number}"></div></div>',s,h,o,i,e;for(f.push(c),s='<div class="sl-slide" data-orientation="vertical" data-slice1-rotation="10" data-slice2-rotation="-15" data-slice1-scale="1.5" data-slice2-scale="1.5"><div class="sl-slide-inner content child{number}"></div></div>',f.push(s),h='<div class="sl-slide" data-orientation="horizontal" data-slice1-rotation="3" data-slice2-rotation="3" data-slice1-scale="2" data-slice2-scale="1"><div class="sl-slide-inner content child{number}"></div></div>',f.push(h),o="",i=0,e=1;e<=t;e++)o+=f[i].replace("{number}",e),i++,i>=f.length&&(i=0);n("#homespotlight .creafbanner").html(o),r=n("#homespotlight").slitslider({interval:8e3}),u=setTimeout(function(){r.play()},1e4),n("#sl-navright").click(function(){r.next(),clearTimeout(u)}),n("#sl-navleft").click(function(){r.previous(),clearTimeout(u)}),n.browser.msie&&n.browser.version<9&&n("#homespotlight ul li").css("background-position","right top"),t==1&&(n("#sl-navright").hide(),n("#sl-navleft").hide())},n.fn.stoppingHomeSpotlight=!1,n.fn.stopHomeSpotlight=function(){typeof r!="object"||n.fn.stoppingHomeSpotlight||(n.fn.stoppingHomeSpotlight=!0,clearTimeout(u),r._stopSlideshow(),r.pause(),setTimeout(function(){n.fn.stoppingHomeSpotlight=!1},5e3))}}(jQuery,window),function(n,t,i,r){"use strict";var h=i(n),e=i(t),u=i.fancybox=function(){u.open.apply(this,arguments)},y=navigator.userAgent.match(/msie/),v=null,o=t.createTouch!==r,a=function(n){return n&&n.hasOwnProperty&&n instanceof i},c=function(n){return n&&i.type(n)==="string"},l=function(n){return c(n)&&n.indexOf("%")>0},p=function(n){return n&&!(n.style.overflow&&n.style.overflow==="hidden")&&(n.clientWidth&&n.scrollWidth>n.clientWidth||n.clientHeight&&n.scrollHeight>n.clientHeight)},f=function(n,t){var i=parseInt(n,10)||0;return t&&l(n)&&(i=u.getViewport()[t]/100*i),Math.ceil(i)},s=function(n,t){return f(n,t)+"px"};i.extend(u,{version:"2.1.4",defaults:{padding:15,margin:20,width:800,height:600,minWidth:100,minHeight:100,maxWidth:9999,maxHeight:9999,autoSize:!0,autoHeight:!1,autoWidth:!1,autoResize:!0,autoCenter:!o,fitToView:!0,aspectRatio:!1,topRatio:.5,leftRatio:.5,scrolling:"auto",wrapCSS:"",arrows:!0,closeBtn:!0,closeClick:!1,nextClick:!1,mouseWheel:!0,autoPlay:!1,playSpeed:3e3,preload:3,modal:!1,loop:!0,ajax:{dataType:"html",headers:{"X-fancyBox":!0}},iframe:{scrolling:"auto",preload:!0},swf:{wmode:"transparent",allowfullscreen:"true",allowscriptaccess:"always"},keys:{next:{13:"left",34:"up",39:"left",40:"up"},prev:{8:"right",33:"down",37:"right",38:"down"},close:[27],play:[32],toggle:[70]},direction:{next:"left",prev:"right"},scrollOutside:!0,index:0,type:null,href:null,content:null,title:null,tpl:{wrap:'<div class="fancybox-wrap" tabIndex="-1"><div class="fancybox-skin"><div class="fancybox-outer"><div class="fancybox-inner"></div></div></div></div>',image:'<img class="fancybox-image" src="{href}" alt="" />',iframe:'<iframe id="fancybox-frame{rnd}" name="fancybox-frame{rnd}" class="fancybox-iframe" frameborder="0" vspace="0" hspace="0" webkitAllowFullScreen mozallowfullscreen allowFullScreen'+(y?' allowtransparency="true"':"")+"></iframe>",error:'<p class="fancybox-error">The requested content cannot be loaded.<br/>Please try again later.</p>',closeBtn:'<a title="Close" class="fancybox-item fancybox-close" href="javascript:;"></a>',next:'<a title="Next" class="fancybox-nav fancybox-next" href="javascript:;"><span></span></a>',prev:'<a title="Previous" class="fancybox-nav fancybox-prev" href="javascript:;"><span></span></a>'},openEffect:"fade",openSpeed:250,openEasing:"swing",openOpacity:!0,openMethod:"zoomIn",closeEffect:"fade",closeSpeed:250,closeEasing:"swing",closeOpacity:!0,closeMethod:"zoomOut",nextEffect:"elastic",nextSpeed:250,nextEasing:"swing",nextMethod:"changeIn",prevEffect:"elastic",prevSpeed:250,prevEasing:"swing",prevMethod:"changeOut",helpers:{overlay:!0,title:!0},onCancel:i.noop,beforeLoad:i.noop,afterLoad:i.noop,beforeShow:i.noop,afterShow:i.noop,beforeChange:i.noop,beforeClose:i.noop,afterClose:i.noop},group:{},opts:{},previous:null,coming:null,current:null,isActive:!1,isOpen:!1,isOpened:!1,wrap:null,skin:null,outer:null,inner:null,player:{timer:null,isActive:!1},ajaxLoad:null,imgPreload:null,transitions:{},helpers:{},open:function(n,t){if(n)return(i.isPlainObject(t)||(t={}),!1===u.close(!0))?void 0:(i.isArray(n)||(n=a(n)?i(n).get():[n]),i.each(n,function(f,e){var h={},s,w,l,o,v,y,p;i.type(e)==="object"&&(e.nodeType&&(e=i(e)),a(e)?(h={href:e.data("fancybox-href")||e.attr("href"),title:e.data("fancybox-title")||e.attr("title"),isDom:!0,element:e},i.metadata&&i.extend(!0,h,e.metadata())):h=e),s=t.href||h.href||(c(e)?e:null),w=t.title!==r?t.title:h.title||"",l=t.content||h.content,o=l?"html":t.type||h.type,!o&&h.isDom&&(o=e.data("fancybox-type"),o||(v=e.prop("class").match(/fancybox\.(\w+)/),o=v?v[1]:null)),c(s)&&(o||(u.isImage(s)?o="image":u.isSWF(s)?o="swf":s.charAt(0)==="#"?o="inline":c(e)&&(o="html",l=e)),o==="ajax"&&(y=s.split(/\s+/,2),s=y.shift(),p=y.shift())),l||(o==="inline"?s?l=i(c(s)?s.replace(/.*(?=#[^\s]+$)/,""):s):h.isDom&&(l=e):o==="html"?l=s:o||s||!h.isDom||(o="inline",l=e)),i.extend(h,{href:s,type:o,content:l,title:w,selector:p}),n[f]=h}),u.opts=i.extend(!0,{},u.defaults,t),t.keys!==r&&(u.opts.keys=t.keys?i.extend({},u.defaults.keys,t.keys):!1),u.group=n,u._start(u.opts.index))},cancel:function(){var n=u.coming;n&&!1!==u.trigger("onCancel")&&(u.hideLoading(),u.ajaxLoad&&u.ajaxLoad.abort(),u.ajaxLoad=null,u.imgPreload&&(u.imgPreload.onload=u.imgPreload.onerror=null),n.wrap&&n.wrap.stop(!0,!0).trigger("onReset").remove(),u.coming=null,u.current||u._afterZoomOut(n))},close:function(n){(u.cancel(),!1!==u.trigger("beforeClose"))&&(u.unbindEvents(),u.isActive)&&(u.isOpen&&n!==!0?(u.isOpen=u.isOpened=!1,u.isClosing=!0,i(".fancybox-item, .fancybox-nav").remove(),u.wrap.stop(!0,!0).removeClass("fancybox-opened"),u.transitions[u.current.closeMethod]()):(i(".fancybox-wrap").stop(!0).trigger("onReset").remove(),u._afterZoomOut()))},play:function(n){var t=function(){clearTimeout(u.player.timer)},f=function(){t(),u.current&&u.player.isActive&&(u.player.timer=setTimeout(u.next,u.current.playSpeed))},r=function(){t(),i("body").unbind(".player"),u.player.isActive=!1,u.trigger("onPlayEnd")},e=function(){u.current&&(u.current.loop||u.current.index<u.group.length-1)&&(u.player.isActive=!0,i("body").bind({"afterShow.player onUpdate.player":f,"onCancel.player beforeClose.player":r,"beforeLoad.player":t}),f(),u.trigger("onPlayStart"))};n!==!0&&(u.player.isActive||n===!1)?r():e()},next:function(n){var t=u.current;t&&(c(n)||(n=t.direction.next),u.jumpto(t.index+1,n,"next"))},prev:function(n){var t=u.current;t&&(c(n)||(n=t.direction.prev),u.jumpto(t.index-1,n,"prev"))},jumpto:function(n,t,i){var e=u.current;e&&(n=f(n),u.direction=t||e.direction[n>=e.index?"next":"prev"],u.router=i||"jumpto",e.loop&&(n<0&&(n=e.group.length+n%e.group.length),n=n%e.group.length),e.group[n]!==r&&(u.cancel(),u._start(n)))},reposition:function(n,t){var f=u.current,e=f?f.wrap:null,r;e&&(r=u._getPosition(t),n&&n.type==="scroll"?(delete r.position,e.stop(!0,!0).animate(r,200)):(e.css(r),f.pos=i.extend({},f.dim,r)))},update:function(n){var t=n&&n.type,i=!t||t==="orientationchange";(i&&(clearTimeout(v),v=null),u.isOpen&&!v)&&(v=setTimeout(function(){var r=u.current;r&&!u.isClosing&&(u.wrap.removeClass("fancybox-tmp"),(i||t==="load"||t==="resize"&&r.autoResize)&&u._setDimension(),t==="scroll"&&r.canShrink||u.reposition(n),u.trigger("onUpdate"),v=null)},i&&!o?0:300))},toggle:function(n){u.isOpen&&(u.current.fitToView=i.type(n)==="boolean"?n:!u.current.fitToView,o&&(u.wrap.removeAttr("style").addClass("fancybox-tmp"),u.trigger("onUpdate")),u.update())},hideLoading:function(){e.unbind(".loading"),i("#fancybox-loading").remove()},showLoading:function(){var t,n;u.hideLoading(),t=i('<div id="fancybox-loading"><div></div></div>').click(u.cancel).appendTo("body"),e.bind("keydown.loading",function(n){(n.which||n.keyCode)===27&&(n.preventDefault(),u.cancel())}),u.defaults.fixed||(n=u.getViewport(),t.css({position:"absolute",top:n.h*.5+n.y,left:n.w*.5+n.x}))},getViewport:function(){var i=u.current&&u.current.locked||!1,t={x:h.scrollLeft(),y:h.scrollTop()};return i?(t.w=i[0].clientWidth,t.h=i[0].clientHeight):(t.w=o&&n.innerWidth?n.innerWidth:h.width(),t.h=o&&n.innerHeight?n.innerHeight:h.height()),t},unbindEvents:function(){u.wrap&&a(u.wrap)&&u.wrap.unbind(".fb"),e.unbind(".fb"),h.unbind(".fb")},bindEvents:function(){var n=u.current,t;n&&(h.bind("orientationchange.fb"+(o?"":" resize.fb")+(n.autoCenter&&!n.locked?" scroll.fb":""),u.update),t=n.keys,t&&e.bind("keydown.fb",function(f){var e=f.which||f.keyCode,o=f.target||f.srcElement;if(e===27&&u.coming)return!1;f.ctrlKey||f.altKey||f.shiftKey||f.metaKey||o&&(o.type||i(o).is("[contenteditable]"))||i.each(t,function(t,o){return n.group.length>1&&o[e]!==r?(u[t](o[e]),f.preventDefault(),!1):i.inArray(e,o)>-1?(u[t](),f.preventDefault(),!1):void 0})}),i.fn.mousewheel&&n.mouseWheel&&u.wrap.bind("mousewheel.fb",function(t,r,f,e){for(var h=t.target||null,o=i(h),s=!1;o.length;){if(s||o.is(".fancybox-skin")||o.is(".fancybox-wrap"))break;s=p(o[0]),o=i(o).parent()}r===0||s||u.group.length>1&&!n.canShrink&&(e>0||f>0?u.prev(e>0?"down":"left"):(e<0||f<0)&&u.next(e<0?"up":"right"),t.preventDefault())}))},trigger:function(n,t){var f,r=t||u.coming||u.current;if(r){if(i.isFunction(r[n])&&(f=r[n].apply(r,Array.prototype.slice.call(arguments,1))),f===!1)return!1;r.helpers&&i.each(r.helpers,function(t,f){f&&u.helpers[t]&&i.isFunction(u.helpers[t][n])&&(f=i.extend(!0,{},u.helpers[t].defaults,f),u.helpers[t][n](f,r))}),i.event.trigger(n+".fb")}},isImage:function(n){return c(n)&&n.match(/(^data:image\/.*,)|(\.(jp(e|g|eg)|gif|png|bmp|webp)((\?|#).*)?$)/i)},isSWF:function(n){return c(n)&&n.match(/\.(swf)((\?|#).*)?$/i)},_start:function(n){var t={},c,l,r,e,h;if(n=f(n),c=u.group[n]||null,!c)return!1;if(t=i.extend(!0,{},u.opts,c),e=t.margin,h=t.padding,i.type(e)==="number"&&(t.margin=[e,e,e,e]),i.type(h)==="number"&&(t.padding=[h,h,h,h]),t.modal&&i.extend(!0,t,{closeBtn:!1,closeClick:!1,nextClick:!1,arrows:!1,mouseWheel:!1,keys:null,helpers:{overlay:{closeClick:!1}}}),t.autoSize&&(t.autoWidth=t.autoHeight=!0),t.width==="auto"&&(t.autoWidth=!0),t.height==="auto"&&(t.autoHeight=!0),t.group=u.group,t.index=n,u.coming=t,!1===u.trigger("beforeLoad")){u.coming=null;return}if(r=t.type,l=t.href,!r)return(u.coming=null,u.current&&u.router&&u.router!=="jumpto")?(u.current.index=n,u[u.router](u.direction)):!1;if(u.isActive=!0,(r==="image"||r==="swf")&&(t.autoHeight=t.autoWidth=!1,t.scrolling="visible"),r==="image"&&(t.aspectRatio=!0),r==="iframe"&&o&&(t.scrolling="scroll"),t.wrap=i(t.tpl.wrap).addClass("fancybox-"+(o?"mobile":"desktop")+" fancybox-type-"+r+" fancybox-tmp "+t.wrapCSS).appendTo(t.parent||"body"),i.extend(t,{skin:i(".fancybox-skin",t.wrap),outer:i(".fancybox-outer",t.wrap),inner:i(".fancybox-inner",t.wrap)}),i.each(["Top","Right","Bottom","Left"],function(n,i){t.skin.css("padding"+i,s(t.padding[n]))}),u.trigger("onReady"),r==="inline"||r==="html"){if(!t.content||!t.content.length)return u._error("content")}else if(!l)return u._error("href");r==="image"?u._loadImage():r==="ajax"?u._loadAjax():r==="iframe"?u._loadIframe():u._afterLoad()},_error:function(n){i.extend(u.coming,{type:"html",autoWidth:!0,autoHeight:!0,minWidth:0,minHeight:0,scrolling:"no",hasError:n,content:u.coming.tpl.error}),u._afterLoad()},_loadImage:function(){var n=u.imgPreload=new Image;n.onload=function(){this.onload=this.onerror=null,u.coming.width=this.width,u.coming.height=this.height,u._afterLoad()},n.onerror=function(){this.onload=this.onerror=null,u._error("image")},n.src=u.coming.href,n.complete!==!0&&u.showLoading()},_loadAjax:function(){var n=u.coming;u.showLoading(),u.ajaxLoad=i.ajax(i.extend({},n.ajax,{url:n.href,error:function(n,t){u.coming&&t!=="abort"?u._error("ajax",n):u.hideLoading()},success:function(t,i){i==="success"&&(n.content=t,u._afterLoad())}}))},_loadIframe:function(){var n=u.coming,t=i(n.tpl.iframe.replace(/\{rnd\}/g,+new Date)).attr("scrolling",o?"auto":n.iframe.scrolling).attr("src",n.href);if(i(n.wrap).bind("onReset",function(){try{i(this).find("iframe").hide().attr("src","//about:blank").end().empty()}catch(n){}}),n.iframe.preload){u.showLoading();t.one("load",function(){i(this).data("ready",1),o||i(this).bind("load.fb",u.update),i(this).parents(".fancybox-wrap").width("100%").removeClass("fancybox-tmp").show(),u._afterLoad()})}n.content=t.appendTo(n.inner),n.iframe.preload||u._afterLoad()},_preloadImages:function(){for(var r=u.group,i=u.current,f=r.length,e=i.preload?Math.min(i.preload,f-1):0,n,t=1;t<=e;t+=1)n=r[(i.index+t)%f],n.type==="image"&&n.href&&((new Image).src=n.href)},_afterLoad:function(){var r=u.coming,f=u.current,e="fancybox-placeholder",t,n,c,o,s,h;if(u.hideLoading(),r&&u.isActive!==!1){if(!1===u.trigger("afterLoad",r,f)){r.wrap.stop(!0).trigger("onReset").remove(),u.coming=null;return}f&&(u.trigger("beforeChange",f),f.wrap.stop(!0).removeClass("fancybox-opened").find(".fancybox-item, .fancybox-nav").remove()),u.unbindEvents(),t=r,n=r.content,c=r.type,o=r.scrolling,i.extend(u,{wrap:t.wrap,skin:t.skin,outer:t.outer,inner:t.inner,current:t,previous:f}),s=t.href;switch(c){case"inline":case"ajax":case"html":t.selector?n=i("<div>").html(n).find(t.selector):a(n)&&(n.data(e)||n.data(e,i('<div class="'+e+'"></div>').insertAfter(n).hide()),n=n.show().detach(),t.wrap.bind("onReset",function(){i(this).find(n).length&&n.hide().replaceAll(n.data(e)).data(e,!1)}));break;case"image":n=t.tpl.image.replace("{href}",s);break;case"swf":n='<object id="fancybox-swf" classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" width="100%" height="100%"><param name="movie" value="'+s+'"></param>',h="",i.each(t.swf,function(t,i){n+='<param name="'+t+'" value="'+i+'"></param>',h+=" "+t+'="'+i+'"'}),n+='<embed src="'+s+'" type="application/x-shockwave-flash" width="100%" height="100%"'+h+"></embed></object>"}a(n)&&n.parent().is(t.inner)||t.inner.append(n),u.trigger("beforeShow"),t.inner.css("overflow",o==="yes"?"scroll":o==="no"?"hidden":o),u._setDimension(),u.reposition(),u.isOpen=!1,u.coming=null,u.bindEvents(),u.isOpened?f.prevMethod&&u.transitions[f.prevMethod]():i(".fancybox-wrap").not(t.wrap).stop(!0).trigger("onReset").remove(),u.transitions[u.isOpened?t.nextMethod:t.openMethod](),u._preloadImages()}},_setDimension:function(){var nt=u.getViewport(),wt=0,vt=!1,ht=!1,y=u.wrap,g=u.skin,e=u.inner,r=u.current,n=r.width,t=r.height,o=r.minWidth,h=r.minHeight,a=r.maxWidth,c=r.maxHeight,bt=r.scrolling,ot=r.scrollOutside?r.scrollbarWidth:0,et=r.margin,yt=f(et[1]+et[3]),pt=f(et[0]+et[2]),d,lt,it,rt,p,v,at,ct,w,k,b,ut,ft,tt,st;if(y.add(g).add(e).width("auto").height("auto").removeClass("fancybox-tmp"),d=f(g.outerWidth(!0)-g.width()),lt=f(g.outerHeight(!0)-g.height()),it=yt+d,rt=pt+lt,p=l(n)?(nt.w-it)*f(n)/100:n,v=l(t)?(nt.h-rt)*f(t)/100:t,r.type==="iframe"){if(tt=r.content,r.autoHeight&&tt.data("ready")===1)try{tt[0].contentWindow.document.location&&(e.width(p).height(9999),st=tt.contents().find("body"),ot&&st.css("overflow-x","hidden"),v=st.height())}catch(kt){}}else(r.autoWidth||r.autoHeight)&&(e.addClass("fancybox-tmp"),r.autoWidth||e.width(p),r.autoHeight||e.height(v),r.autoWidth&&(p=e.width()),r.autoHeight&&(v=e.height()),e.removeClass("fancybox-tmp"));if(n=f(p),t=f(v),w=p/v,o=f(l(o)?f(o,"w")-it:o),a=f(l(a)?f(a,"w")-it:a),h=f(l(h)?f(h,"h")-rt:h),c=f(l(c)?f(c,"h")-rt:c),at=a,ct=c,r.fitToView&&(a=Math.min(nt.w-it,a),c=Math.min(nt.h-rt,c)),ut=nt.w-yt,ft=nt.h-pt,r.aspectRatio?(n>a&&(n=a,t=f(n/w)),t>c&&(t=c,n=f(t*w)),n<o&&(n=o,t=f(n/w)),t<h&&(t=h,n=f(t*w))):(n=Math.max(o,Math.min(n,a)),r.autoHeight&&r.type!=="iframe"&&(e.width(n),t=e.height()),t=Math.max(h,Math.min(t,c))),r.fitToView)if(e.width(n).height(t),y.width(n+d),k=y.width(),b=y.height(),r.aspectRatio)while((k>ut||b>ft)&&n>o&&t>h){if(wt++>19)break;t=Math.max(h,Math.min(c,t-10)),n=f(t*w),n<o&&(n=o,t=f(n/w)),n>a&&(n=a,t=f(n/w)),e.width(n).height(t),y.width(n+d),k=y.width(),b=y.height()}else n=Math.max(o,Math.min(n,n-(k-ut))),t=Math.max(h,Math.min(t,t-(b-ft)));ot&&bt==="auto"&&t<v&&n+d+ot<ut&&(n+=ot),e.width(n).height(t),y.width(n+d),k=y.width(),b=y.height(),vt=(k>ut||b>ft)&&n>o&&t>h,ht=r.aspectRatio?n<at&&t<ct&&n<p&&t<v:(n<at||t<ct)&&(n<p||t<v),i.extend(r,{dim:{width:s(k),height:s(b)},origWidth:p,origHeight:v,canShrink:vt,canExpand:ht,wPadding:d,hPadding:lt,wrapSpace:b-g.outerHeight(!0),skinSpace:g.height()-t}),!tt&&r.autoHeight&&t>h&&t<c&&!ht&&e.height("auto")},_getPosition:function(n){var r=u.current,f=u.getViewport(),i=r.margin,e=u.wrap.width()+i[1]+i[3],o=u.wrap.height()+i[0]+i[2],t={position:"absolute",top:i[0]+20,left:i[3]};return r.autoCenter&&r.fixed&&!n&&o<=f.h&&e<=f.w?t.position="fixed":r.locked||(t.top+=f.y,t.left+=f.x),t.top=s(Math.max(t.top,t.top+(f.h-o)*r.topRatio)),t.left=s(Math.max(t.left,t.left+(f.w-e)*r.leftRatio)),t},_afterZoomIn:function(){var n=u.current;n&&(u.isOpen=u.isOpened=!0,u.wrap.css("overflow","visible").addClass("fancybox-opened"),u.update(),(n.closeClick||n.nextClick&&u.group.length>1)&&u.inner.css("cursor","pointer").bind("click.fb",function(t){i(t.target).is("a")||i(t.target).parent().is("a")||(t.preventDefault(),u[n.closeClick?"close":"next"]())}),n.closeBtn&&i(n.tpl.closeBtn).appendTo(u.skin).bind("click.fb",function(n){n.preventDefault(),u.close()}),n.arrows&&u.group.length>1&&((n.loop||n.index>0)&&i(n.tpl.prev).appendTo(u.outer).bind("click.fb",u.prev),(n.loop||n.index<u.group.length-1)&&i(n.tpl.next).appendTo(u.outer).bind("click.fb",u.next)),u.trigger("afterShow"),n.loop||n.index!==n.group.length-1?u.opts.autoPlay&&!u.player.isActive&&(u.opts.autoPlay=!1,u.play()):u.play(!1))},_afterZoomOut:function(n){n=n||u.current,i(".fancybox-wrap").trigger("onReset").remove(),i.extend(u,{group:{},opts:{},router:!1,current:null,isActive:!1,isOpened:!1,isOpen:!1,isClosing:!1,wrap:null,skin:null,outer:null,inner:null}),u.trigger("afterClose",n)}}),u.transitions={getOrigPosition:function(){var n=u.current,o=n.element,t=n.orig,i={},f=50,e=50,h=n.hPadding,c=n.wPadding,r=u.getViewport();return!t&&n.isDom&&o.is(":visible")&&(t=o.find("img:first"),t.length||(t=o)),a(t)?(i=t.offset(),t.is("img")&&(f=t.outerWidth(),e=t.outerHeight())):(i.top=r.y+(r.h-e)*n.topRatio,i.left=r.x+(r.w-f)*n.leftRatio),(u.wrap.css("position")==="fixed"||n.locked)&&(i.top-=r.y,i.left-=r.x),i={top:s(i.top-h*n.topRatio),left:s(i.left-c*n.leftRatio),width:s(f+c),height:s(e+h)}},step:function(n,t){var r,h,e,i=t.prop,o=u.current,s=o.wrapSpace,c=o.skinSpace;(i==="width"||i==="height")&&(r=t.end===t.start?1:(n-t.start)/(t.end-t.start),u.isClosing&&(r=1-r),h=i==="width"?o.wPadding:o.hPadding,e=n-h,u.skin[i](f(i==="width"?e:e-s*r)),u.inner[i](f(i==="width"?e:e-s*r-c*r)))},zoomIn:function(){var t=u.current,n=t.pos,r=t.openEffect,e=r==="elastic",f=i.extend({opacity:1},n);delete f.position,e?(n=this.getOrigPosition(),t.openOpacity&&(n.opacity=.1)):r==="fade"&&(n.opacity=.1),u.wrap.css(n).animate(f,{duration:r==="none"?0:t.openSpeed,easing:t.openEasing,step:e?this.step:null,complete:u._afterZoomIn})},zoomOut:function(){var n=u.current,i=n.closeEffect,r=i==="elastic",t={opacity:.1};r&&(t=this.getOrigPosition(),n.closeOpacity&&(t.opacity=.1)),u.wrap.animate(t,{duration:i==="none"?0:n.closeSpeed,easing:n.closeEasing,step:r?this.step:null,complete:u._afterZoomOut})},changeIn:function(){var e=u.current,h=e.nextEffect,t=e.pos,o={opacity:1},i=u.direction,r=200,n;t.opacity=.1,h==="elastic"&&(n=i==="down"||i==="up"?"top":"left",i==="down"||i==="right"?(t[n]=s(f(t[n])-r),o[n]="+="+r+"px"):(t[n]=s(f(t[n])+r),o[n]="-="+r+"px")),h==="none"?u._afterZoomIn():u.wrap.css(t).animate(o,{duration:e.nextSpeed,easing:e.nextEasing,complete:u._afterZoomIn})},changeOut:function(){var t=u.previous,f=t.prevEffect,r={opacity:.1},n=u.direction,e=200;f==="elastic"&&(r[n==="down"||n==="up"?"top":"left"]=(n==="up"||n==="left"?"-":"+")+"="+e+"px"),t.wrap.animate(r,{duration:f==="none"?0:t.prevSpeed,easing:t.prevEasing,complete:function(){i(this).trigger("onReset").remove()}})}},u.helpers.overlay={defaults:{closeClick:!0,speedOut:200,showEarly:!0,css:{},locked:!o,fixed:!0},overlay:null,fixed:!1,create:function(n){n=i.extend({},this.defaults,n),this.overlay&&this.close(),this.overlay=i('<div class="fancybox-overlay"></div>').appendTo("body"),this.fixed=!1,n.fixed&&u.defaults.fixed&&(this.overlay.addClass("fancybox-overlay-fixed"),this.fixed=!0)},open:function(n){var t=this;n=i.extend({},this.defaults,n),this.overlay?this.overlay.unbind(".overlay").width("auto").height("auto"):this.create(n),this.fixed||(h.bind("resize.overlay",i.proxy(this.update,this)),this.update()),n.closeClick&&this.overlay.bind("click.overlay",function(n){i(n.target).hasClass("fancybox-overlay")&&(u.isActive?u.close():t.close())}),this.overlay.css(n.css).show()},close:function(){i(".fancybox-overlay").remove(),h.unbind("resize.overlay"),this.overlay=null,this.margin!==!1&&(i("body").css("margin-right",this.margin),this.margin=!1),this.el&&this.el.removeClass("fancybox-lock")},update:function(){var n="100%",i;this.overlay.width(n).height("100%"),y?(i=Math.max(t.documentElement.offsetWidth,t.body.offsetWidth),e.width()>i&&(n=e.width())):e.width()>h.width()&&(n=e.width()),this.overlay.width(n).height(e.height())},onReady:function(n,r){i(".fancybox-overlay").stop(!0,!0),this.overlay||(this.margin=e.height()>h.height()||i("body").css("overflow-y")==="scroll"?i("body").css("margin-right"):!1,this.el=t.all&&!t.querySelector?i("html"):i("body"),this.create(n)),n.locked&&this.fixed&&(r.locked=this.overlay.append(r.wrap),r.fixed=!1),n.showEarly===!0&&this.beforeShow.apply(this,arguments)},beforeShow:function(n,t){t.locked&&(this.el.addClass("fancybox-lock"),this.margin!==!1&&i("body").css("margin-right",f(this.margin)+t.scrollbarWidth)),this.open(n)},onUpdate:function(){this.fixed||this.update()},afterClose:function(n){this.overlay&&!u.isActive&&this.overlay.fadeOut(n.speedOut,i.proxy(this.close,this))}},u.helpers.title={defaults:{type:"float",position:"bottom"},beforeShow:function(n){var o=u.current,r=o.title,s=n.type,t,e;if(i.isFunction(r)&&(r=r.call(o.element,o)),c(r)&&i.trim(r)!==""){t=i('<div class="fancybox-title fancybox-title-'+s+'-wrap">'+r+"</div>");switch(s){case"inside":e=u.skin;break;case"outside":e=u.wrap;break;case"over":e=u.inner;break;default:e=u.skin,t.appendTo("body"),y&&t.width(t.width()),t.wrapInner('<span class="child"></span>'),u.current.margin[2]+=Math.abs(f(t.css("margin-bottom")))}t[n.position==="top"?"prependTo":"appendTo"](e)}}},i.fn.fancybox=function(n){var f,o=i(this),t=this.selector||"",r=function(r){var e=i(this).blur(),c=f,h,s;r.ctrlKey||r.altKey||r.shiftKey||r.metaKey||e.is(".fancybox-wrap")||(h=n.groupAttr||"data-fancybox-group",s=e.attr(h),s||(h="rel",s=e.get(0)[h]),s&&s!==""&&s!=="nofollow"&&(e=t.length?i(t):o,e=e.filter("["+h+'="'+s+'"]'),c=e.index(this)),n.index=c,u.open(e,n)!==!1&&r.preventDefault())};return n=n||{},f=n.index||0,t&&n.live!==!1?e.undelegate(t,"click.fb-start").delegate(t+":not('.fancybox-item, .fancybox-nav')","click.fb-start",r):o.unbind("click.fb-start").bind("click.fb-start",r),this.filter("[data-fancybox-start=1]").trigger("click"),this},e.ready(function(){i.scrollbarWidth===r&&(i.scrollbarWidth=function(){var t=i('<div style="width:50px;height:50px;overflow:auto"><div/></div>').appendTo("body"),n=t.children(),r=n.innerWidth()-n.height(99).innerWidth();return t.remove(),r}),i.support.fixedPosition===r&&(i.support.fixedPosition=function(){var n=i('<div style="position:fixed;top:20px;"></div>').appendTo("body"),t=n[0].offsetTop===20||n[0].offsetTop===15;return n.remove(),t}()),i.extend(u.defaults,{scrollbarWidth:i.scrollbarWidth(),fixed:i.support.fixedPosition,parent:i("body")})})}(window,document,jQuery),function(n){"use strict";var t={init:function(i){var r=this;if(!r.data("jqv")||r.data("jqv")==null){i=t._saveOptions(r,i);n(document).on("click",".formError",function(){n(this).fadeOut(150,function(){n(this).parent(".formErrorOuter").remove(),n(this).remove()})})}return this},attach:function(i){var u=this,r;if(r=i?t._saveOptions(u,i):u.data("jqv"),r.validateAttribute=u.find("[data-validation-engine*=validate]").length?"data-validation-engine":"class",r.binded){u.on(r.validationEventTrigger,"["+r.validateAttribute+"*=validate]:not([type=checkbox]):not([type=radio]):not(.datepicker)",t._onFieldEvent);u.on("click","["+r.validateAttribute+"*=validate][type=checkbox],["+r.validateAttribute+"*=validate][type=radio]",t._onFieldEvent);u.on(r.validationEventTrigger,"["+r.validateAttribute+"*=validate][class*=datepicker]",{delay:300},t._onFieldEvent)}r.autoPositionUpdate&&n(window).bind("resize",{noAnimation:!0,formElem:u},t.updatePromptsPosition);u.on("click","a[data-validation-engine-skip], a[class*='validate-skip'], button[data-validation-engine-skip], button[class*='validate-skip'], input[data-validation-engine-skip], input[class*='validate-skip']",t._submitButtonClick);u.removeData("jqv_submitButton");u.on("submit",t._onSubmitEvent);return this},detach:function(){var i=this,r=i.data("jqv");return i.find("["+r.validateAttribute+"*=validate]").not("[type=checkbox]").off(r.validationEventTrigger,t._onFieldEvent),i.find("["+r.validateAttribute+"*=validate][type=checkbox],[class*=validate][type=radio]").off("click",t._onFieldEvent),i.off("submit",t.onAjaxFormComplete),i.off("submit",t.onAjaxFormComplete),i.removeData("jqv"),i.off("click","a[data-validation-engine-skip], a[class*='validate-skip'], button[data-validation-engine-skip], button[class*='validate-skip'], input[data-validation-engine-skip], input[class*='validate-skip']",t._submitButtonClick),i.removeData("jqv_submitButton"),r.autoPositionUpdate&&n(window).unbind("resize",t.updatePromptsPosition),this},validate:function(){var r=n(this),u=null,i;if(r.is("form")||r.hasClass("validationEngineContainer")){if(r.hasClass("validating"))return!1;r.addClass("validating"),i=r.data("jqv"),u=t._validateFields(this),setTimeout(function(){r.removeClass("validating")},100),u&&i.onSuccess?i.onSuccess():!u&&i.onFailure&&i.onFailure()}else if(r.is("form")||r.hasClass("validationEngineContainer"))r.removeClass("validating");else{var f=r.closest("form, .validationEngineContainer"),i=f.data("jqv")?f.data("jqv"):n.validationEngine.defaults,u=t._validateField(r,i);u&&i.onFieldSuccess?i.onFieldSuccess():i.onFieldFailure&&i.InvalidFields.length>0&&i.onFieldFailure()}return i.onValidationComplete?!!i.onValidationComplete(f,u):u},updatePromptsPosition:function(i){var f,u,r;return i&&this==window?(u=i.data.formElem,f=i.data.noAnimation):u=n(this.closest("form, .validationEngineContainer")),r=u.data("jqv"),u.find("["+r.validateAttribute+"*=validate]").not(":disabled").each(function(){var i=n(this),e,o;r.prettySelect&&i.is(":hidden")&&(i=u.find("#"+r.usePrefix+i.attr("id")+r.useSuffix)),e=t._getPrompt(i),o=n(e).find(".formErrorContent").html(),e&&t._updatePrompt(i,n(e),o,undefined,!1,r,f)}),this},showPrompt:function(n,i,r,u){var e=this.closest("form, .validationEngineContainer"),f=e.data("jqv");return f||(f=t._saveOptions(this,f)),r&&(f.promptPosition=r),f.showArrow=u==!0,t._showPrompt(this,n,i,!1,f),this},hide:function(){var u=n(this).closest("form, .validationEngineContainer"),r=u.data("jqv"),f=r&&r.fadeDuration?r.fadeDuration:.3,i;return i=n(this).is("form")||n(this).hasClass("validationEngineContainer")?"parentForm"+t._getClassName(n(this).attr("id")):t._getClassName(n(this).attr("id"))+"formError",n("."+i).fadeTo(f,.3,function(){n(this).parent(".formErrorOuter").remove(),n(this).remove()}),this},hideAll:function(){var r=this,t=r.data("jqv"),i=t?t.fadeDuration:300;return n(".formError").fadeTo(i,300,function(){n(this).parent(".formErrorOuter").remove(),n(this).remove()}),this},_onFieldEvent:function(i){var u=n(this),f=u.closest("form, .validationEngineContainer"),r=f.data("jqv");r.eventTrigger="field",window.setTimeout(function(){t._validateField(u,r),r.InvalidFields.length==0&&r.onFieldSuccess?r.onFieldSuccess():r.InvalidFields.length>0&&r.onFieldFailure&&r.onFieldFailure()},i.data?i.data.delay:0)},_onSubmitEvent:function(){var i=n(this),u=i.data("jqv"),r,f;return i.data("jqv_submitButton")&&(r=n("#"+i.data("jqv_submitButton")),r&&r.length>0&&(r.hasClass("validate-skip")||r.attr("data-validation-engine-skip")=="true"))?!0:(u.eventTrigger="submit",f=t._validateFields(i),f&&u.ajaxFormValidation)?(t._validateFormWithAjax(i,u),!1):u.onValidationComplete?!!u.onValidationComplete(i,f):f},_checkAjaxStatus:function(t){var i=!0;return n.each(t.ajaxValidCache,function(n,t){if(!t)return i=!1,!1}),i},_checkAjaxFieldStatus:function(n,t){return t.ajaxValidCache[n]==!0},_validateFields:function(i){var r=i.data("jqv"),o=!1,u,h,s,l,c,a;if(i.trigger("jqv.form.validating"),u=null,i.find("["+r.validateAttribute+"*=validate]").not(":disabled").each(function(){var f=n(this),e=[];if(n.inArray(f.attr("name"),e)<0&&((o|=t._validateField(f,r),o&&u==null&&(u=f.is(":hidden")&&r.prettySelect?f=i.find("#"+r.usePrefix+t._jqSelector(f.attr("id"))+r.useSuffix):f),r.doNotShowAllErrosOnSubmit)||(e.push(f.attr("name")),r.showOneMessage==!0&&o)))return!1}),i.trigger("jqv.form.result",[o]),o){if(r.scroll){var e=u.offset().top,v=u.offset().left,f=r.promptPosition;if(typeof f=="string"&&f.indexOf(":")!=-1&&(f=f.substring(0,f.indexOf(":"))),f!="bottomRight"&&f!="bottomLeft"&&(h=t._getPrompt(u),h&&(e=h.offset().top)),r.scrollOffset&&(e-=r.scrollOffset),r.isOverflown){if(s=n(r.overflownDIV),!s.length)return!1;l=s.scrollTop(),c=-parseInt(s.offset().top),e+=l+c-5,a=n(r.overflownDIV+":not(:animated)"),a.animate({scrollTop:e},1100,function(){r.focusFirstField&&u.focus()})}else n("html, body").animate({scrollTop:e},1100,function(){r.focusFirstField&&u.focus()}),n("html, body").animate({scrollLeft:v},1100)}else r.focusFirstField&&u.focus();return!1}return!0},_validateFormWithAjax:function(i,r){var f=i.serialize(),o=r.ajaxFormValidationMethod?r.ajaxFormValidationMethod:"GET",e=r.ajaxFormValidationURL?r.ajaxFormValidationURL:i.attr("action"),u=r.dataType?r.dataType:"json";n.ajax({type:o,url:e,cache:!1,dataType:u,data:f,form:i,methods:t,options:r,beforeSend:function(){return r.onBeforeAjaxFormValidation(i,r)},error:function(n,i){t._ajaxError(n,i)},success:function(f){var c,h,e,o;if(u=="json"&&f!==!0){for(c=!1,h=0;h<f.length;h++){var l=f[h],a=l[0],s=n(n("#"+a)[0]);s.length==1&&(e=l[2],l[1]==!0?e!=""&&e?(r.allrules[e]&&(o=r.allrules[e].alertTextOk,o&&(e=o)),r.showPrompts&&t._showPrompt(s,e,"pass",!1,r,!0)):t._closePrompt(s):(c|=!0,r.allrules[e]&&(o=r.allrules[e].alertText,o&&(e=o)),r.showPrompts&&t._showPrompt(s,e,"",!1,r,!0)))}r.onAjaxFormComplete(!c,i,f,r)}else r.onAjaxFormComplete(!0,i,f,r)}})},_validateField:function(i,r,u){var rt,y,s,f,d,v,o,a,c,b,w,g,p;if((i.attr("id")||(i.attr("id","form-validation-field-"+n.validationEngine.fieldIdCounter),++n.validationEngine.fieldIdCounter),!r.validateNonVisibleFields&&(i.is(":hidden")&&!r.prettySelect||i.parent().is(":hidden")))||(rt=i.attr(r.validateAttribute),y=/validate\[(.*)\]/.exec(rt),!y))return!1;var ut=y[1],e=ut.split(/\[|,|\]/),tt=!1,l=i.attr("name"),k="",nt="",h=!1,it=!1;for(r.isError=!1,r.showArrow=!0,r.maxErrorsPerField>0&&(it=!0),s=n(i.closest("form, .validationEngineContainer")),f=0;f<e.length;f++)e[f]=e[f].replace(" ",""),e[f]===""&&delete e[f];for(f=0,d=0;f<e.length;f++){if(it&&d>=r.maxErrorsPerField){h||(v=n.inArray("required",e),h=v!=-1&&v>=f);break}o=undefined;switch(e[f]){case"required":h=!0,o=t._getErrorMessage(s,i,e[f],e,f,r,t._required);break;case"custom":o=t._getErrorMessage(s,i,e[f],e,f,r,t._custom);break;case"groupRequired":c="["+r.validateAttribute+"*="+e[f+1]+"]",a=s.find(c).eq(0),a[0]!=i[0]&&(t._validateField(a,r,u),r.showArrow=!0),o=t._getErrorMessage(s,i,e[f],e,f,r,t._groupRequired),o&&(h=!0),r.showArrow=!1;break;case"ajax":o=t._ajax(i,e,f,r),o&&(nt="load");break;case"minSize":o=t._getErrorMessage(s,i,e[f],e,f,r,t._minSize);break;case"maxSize":o=t._getErrorMessage(s,i,e[f],e,f,r,t._maxSize);break;case"min":o=t._getErrorMessage(s,i,e[f],e,f,r,t._min);break;case"max":o=t._getErrorMessage(s,i,e[f],e,f,r,t._max);break;case"past":o=t._getErrorMessage(s,i,e[f],e,f,r,t._past);break;case"future":o=t._getErrorMessage(s,i,e[f],e,f,r,t._future);break;case"dateRange":c="["+r.validateAttribute+"*="+e[f+1]+"]",r.firstOfGroup=s.find(c).eq(0),r.secondOfGroup=s.find(c).eq(1),(r.firstOfGroup[0].value||r.secondOfGroup[0].value)&&(o=t._getErrorMessage(s,i,e[f],e,f,r,t._dateRange)),o&&(h=!0),r.showArrow=!1;break;case"dateTimeRange":c="["+r.validateAttribute+"*="+e[f+1]+"]",r.firstOfGroup=s.find(c).eq(0),r.secondOfGroup=s.find(c).eq(1),(r.firstOfGroup[0].value||r.secondOfGroup[0].value)&&(o=t._getErrorMessage(s,i,e[f],e,f,r,t._dateTimeRange)),o&&(h=!0),r.showArrow=!1;break;case"maxCheckbox":i=n(s.find("input[name='"+l+"']")),o=t._getErrorMessage(s,i,e[f],e,f,r,t._maxCheckbox);break;case"minCheckbox":i=n(s.find("input[name='"+l+"']")),o=t._getErrorMessage(s,i,e[f],e,f,r,t._minCheckbox);break;case"equals":o=t._getErrorMessage(s,i,e[f],e,f,r,t._equals);break;case"funcCall":o=t._getErrorMessage(s,i,e[f],e,f,r,t._funcCall);break;case"creditCard":o=t._getErrorMessage(s,i,e[f],e,f,r,t._creditCard);break;case"condRequired":o=t._getErrorMessage(s,i,e[f],e,f,r,t._condRequired),o!==undefined&&(h=!0)}if(b=!1,typeof o=="object")switch(o.status){case"_break":b=!0;break;case"_error":o=o.message;break;case"_error_no_prompt":return!0}if(b)break;typeof o=="string"&&(k=o,r.isError=!0,d++)}if(!h&&!i.val()&&i.val().length<1&&(r.isError=!1),w=i.prop("type"),g=i.data("promptPosition")||r.promptPosition,(w=="radio"||w=="checkbox")&&s.find("input[name='"+l+"']").size()>1&&(i=g==="inline"?n(s.find("input[name='"+l+"'][type!=hidden]:last")):n(s.find("input[name='"+l+"'][type!=hidden]:first")),r.showArrow=!1),i.attr("id").indexOf("s2id_")==0&&r.prettySelect&&(i=s.find("#"+r.usePrefix+t._jqSelector(i.attr("id"))+r.useSuffix)),r.isError&&r.showPrompts?t._showPrompt(i,k,nt,!1,r):tt||t._closePrompt(i),tt||i.trigger("jqv.field.result",[i,r.isError,k]),p=n.inArray(i[0],r.InvalidFields),p==-1?r.isError&&r.InvalidFields.push(i[0]):r.isError||r.InvalidFields.splice(p,1),t._handleStatusCssClasses(i,r),r.isError&&r.onFieldFailure)r.onFieldFailure(i);if(!r.isError&&r.onFieldSuccess)r.onFieldSuccess(i);return r.isError},_handleStatusCssClasses:function(n,t){t.addSuccessCssClassToField&&n.removeClass(t.addSuccessCssClassToField),t.addFailureCssClassToField&&n.removeClass(t.addFailureCssClassToField),t.addSuccessCssClassToField&&!t.isError&&n.addClass(t.addSuccessCssClassToField),t.addFailureCssClassToField&&t.isError&&n.addClass(t.addFailureCssClassToField)},_getErrorMessage:function(i,r,u,f,e,o,s){var l=jQuery.inArray(u,f),a,c;(u==="custom"||u==="funcCall")&&(a=f[l+1],u=u+"["+a+"]",delete f[l]);var y=u,v=r.attr("data-validation-engine")?r.attr("data-validation-engine"):r.attr("class"),p=v.split(" "),h;return h=u=="future"||u=="past"||u=="maxCheckbox"||u=="minCheckbox"?s(i,r,f,e,o):s(r,f,e,o),h!=undefined&&(c=t._getCustomErrorMessage(n(r),p,y,o),c&&(h=c)),h},_getCustomErrorMessage:function(n,i,r,u){var f=!1,h=t._validityProp[r],s,e,o;if(h!=undefined&&(f=n.attr("data-errormessage-"+h),f!=undefined)||(f=n.attr("data-errormessage"),f!=undefined))return f;if(s="#"+n.attr("id"),typeof u.custom_error_messages[s]!="undefined"&&typeof u.custom_error_messages[s][r]!="undefined")f=u.custom_error_messages[s][r].message;else if(i.length>0)for(e=0;e<i.length&&i.length>0;e++)if(o="."+i[e],typeof u.custom_error_messages[o]!="undefined"&&typeof u.custom_error_messages[o][r]!="undefined"){f=u.custom_error_messages[o][r].message;break}return f||typeof u.custom_error_messages[r]=="undefined"||typeof u.custom_error_messages[r].message=="undefined"||(f=u.custom_error_messages[r].message),f},_validityProp:{required:"value-missing",custom:"custom-error",groupRequired:"value-missing",ajax:"custom-error",minSize:"range-underflow",maxSize:"range-overflow",min:"range-underflow",max:"range-overflow",past:"type-mismatch",future:"type-mismatch",dateRange:"type-mismatch",dateTimeRange:"type-mismatch",maxCheckbox:"range-overflow",minCheckbox:"range-underflow",equals:"pattern-mismatch",funcCall:"custom-error",creditCard:"pattern-mismatch",condRequired:"value-missing"},_required:function(t,i,r,u,f){var o,e;switch(t.prop("type")){case"text":case"password":case"textarea":case"file":case"select-one":case"select-multiple":default:var s=n.trim(t.val()),c=n.trim(t.attr("data-validation-placeholder")),h=n.trim(t.attr("placeholder"));if(!s||c&&s==c||h&&s==h)return u.allrules[i[r]].alertText;break;case"radio":case"checkbox":if(f){if(!t.attr("checked"))return u.allrules[i[r]].alertTextCheckboxMultiple;break}if(o=t.closest("form, .validationEngineContainer"),e=t.attr("name"),o.find("input[name='"+e+"']:checked").size()==0)return o.find("input[name='"+e+"']:visible").size()==1?u.allrules[i[r]].alertTextCheckboxe:u.allrules[i[r]].alertTextCheckboxMultiple}},_groupRequired:function(i,r,u,f){var o="["+f.validateAttribute+"*="+r[u+1]+"]",e=!1;return i.closest("form, .validationEngineContainer").find(o).each(function(){if(!t._required(n(this),r,u,f))return e=!0,!1}),e?void 0:f.allrules[r[u]].alertText},_custom:function(n,t,i,r){var u=t[i+1],f=r.allrules[u],o,e,s;if(!f){alert("jqv:custom rule not found - "+u);return}if(f.regex){if(e=f.regex,!e){alert("jqv:custom regex not found - "+u);return}if(s=new RegExp(e),!s.test(n.val()))return r.allrules[u].alertText}else if(f.func){if(o=f.func,typeof o!="function"){alert("jqv:custom parameter 'function' is no function - "+u);return}if(!o(n,t,i,r))return r.allrules[u].alertText}else{alert("jqv:custom type not allowed "+u);return}},_funcCall:function(n,t,i,r){var e=t[i+1],f,o,u;if(e.indexOf(".")>-1){for(o=e.split("."),u=window;o.length;)u=u[o.shift()];f=u}else f=window[e]||r.customFunctions[e];if(typeof f=="function")return f(n,t,i,r)},_equals:function(t,i,r,u){var f=i[r+1];if(t.val()!=n("#"+f).val())return u.allrules.equals.alertText},_maxSize:function(n,t,i,r){var f=t[i+1],e=n.val().length,u;if(e>f)return u=r.allrules.maxSize,u.alertText+f+u.alertText2},_minSize:function(n,t,i,r){var f=t[i+1],e=n.val().length,u;if(e<f)return u=r.allrules.minSize,u.alertText+f+u.alertText2},_min:function(n,t,i,r){var f=parseFloat(t[i+1]),e=parseFloat(n.val()),u;if(e<f)return(u=r.allrules.min,u.alertText2)?u.alertText+f+u.alertText2:u.alertText+f},_max:function(n,t,i,r){var f=parseFloat(t[i+1]),e=parseFloat(n.val()),u;if(e>f)return(u=r.allrules.max,u.alertText2)?u.alertText+f+u.alertText2:u.alertText+f},_past:function(i,r,u,f,e){var h=u[f+1],c=n(i.find("input[name='"+h.replace(/^#+/,"")+"']")),o,l,s;if(h.toLowerCase()=="now")o=new Date;else if(undefined!=c.val()){if(c.is(":disabled"))return;o=t._parseDate(c.val())}else o=t._parseDate(h);return l=t._parseDate(r.val()),l>o?(s=e.allrules.past,s.alertText2)?s.alertText+t._dateToString(o)+s.alertText2:s.alertText+t._dateToString(o):void 0},_future:function(i,r,u,f,e){var h=u[f+1],c=n(i.find("input[name='"+h.replace(/^#+/,"")+"']")),o,l,s;if(h.toLowerCase()=="now")o=new Date;else if(undefined!=c.val()){if(c.is(":disabled"))return;o=t._parseDate(c.val())}else o=t._parseDate(h);return l=t._parseDate(r.val()),l<o?(s=e.allrules.future,s.alertText2)?s.alertText+t._dateToString(o)+s.alertText2:s.alertText+t._dateToString(o):void 0},_isDate:function(n){var t=new RegExp(/^\d{4}[\/\-](0?[1-9]|1[012])[\/\-](0?[1-9]|[12][0-9]|3[01])$|^(?:(?:(?:0?[13578]|1[02])(\/|-)31)|(?:(?:0?[1,3-9]|1[0-2])(\/|-)(?:29|30)))(\/|-)(?:[1-9]\d\d\d|\d[1-9]\d\d|\d\d[1-9]\d|\d\d\d[1-9])$|^(?:(?:0?[1-9]|1[0-2])(\/|-)(?:0?[1-9]|1\d|2[0-8]))(\/|-)(?:[1-9]\d\d\d|\d[1-9]\d\d|\d\d[1-9]\d|\d\d\d[1-9])$|^(0?2(\/|-)29)(\/|-)(?:(?:0[48]00|[13579][26]00|[2468][048]00)|(?:\d\d)?(?:0[48]|[2468][048]|[13579][26]))$/);return t.test(n)},_isDateTime:function(n){var t=new RegExp(/^\d{4}[\/\-](0?[1-9]|1[012])[\/\-](0?[1-9]|[12][0-9]|3[01])\s+(1[012]|0?[1-9]){1}:(0?[1-5]|[0-6][0-9]){1}:(0?[0-6]|[0-6][0-9]){1}\s+(am|pm|AM|PM){1}$|^(?:(?:(?:0?[13578]|1[02])(\/|-)31)|(?:(?:0?[1,3-9]|1[0-2])(\/|-)(?:29|30)))(\/|-)(?:[1-9]\d\d\d|\d[1-9]\d\d|\d\d[1-9]\d|\d\d\d[1-9])$|^((1[012]|0?[1-9]){1}\/(0?[1-9]|[12][0-9]|3[01]){1}\/\d{2,4}\s+(1[012]|0?[1-9]){1}:(0?[1-5]|[0-6][0-9]){1}:(0?[0-6]|[0-6][0-9]){1}\s+(am|pm|AM|PM){1})$/);return t.test(n)},_dateCompare:function(n,t){return new Date(n.toString())<new Date(t.toString())},_dateRange:function(n,i,r,u){return!u.firstOfGroup[0].value&&u.secondOfGroup[0].value||u.firstOfGroup[0].value&&!u.secondOfGroup[0].value?u.allrules[i[r]].alertText+u.allrules[i[r]].alertText2:!t._isDate(u.firstOfGroup[0].value)||!t._isDate(u.secondOfGroup[0].value)?u.allrules[i[r]].alertText+u.allrules[i[r]].alertText2:t._dateCompare(u.firstOfGroup[0].value,u.secondOfGroup[0].value)?void 0:u.allrules[i[r]].alertText+u.allrules[i[r]].alertText2},_dateTimeRange:function(n,i,r,u){return!u.firstOfGroup[0].value&&u.secondOfGroup[0].value||u.firstOfGroup[0].value&&!u.secondOfGroup[0].value?u.allrules[i[r]].alertText+u.allrules[i[r]].alertText2:!t._isDateTime(u.firstOfGroup[0].value)||!t._isDateTime(u.secondOfGroup[0].value)?u.allrules[i[r]].alertText+u.allrules[i[r]].alertText2:t._dateCompare(u.firstOfGroup[0].value,u.secondOfGroup[0].value)?void 0:u.allrules[i[r]].alertText+u.allrules[i[r]].alertText2},_maxCheckbox:function(n,t,i,r,u){var f=i[r+1],o=t.attr("name"),e=n.find("input[name='"+o+"']:checked").size();if(e>f)return(u.showArrow=!1,u.allrules.maxCheckbox.alertText2)?u.allrules.maxCheckbox.alertText+" "+f+" "+u.allrules.maxCheckbox.alertText2:u.allrules.maxCheckbox.alertText},_minCheckbox:function(n,t,i,r,u){var f=i[r+1],o=t.attr("name"),e=n.find("input[name='"+o+"']:checked").size();if(e<f)return u.showArrow=!1,u.allrules.minCheckbox.alertText+" "+f+" "+u.allrules.minCheckbox.alertText2},_creditCard:function(n,t,i,r){var s=!1,o=n.val().replace(/ +/g,"").replace(/-+/g,""),e=o.length;if(e>=14&&e<=16&&parseInt(o)>0){var h=0,i=e-1,c=1,u,f=new String;do u=parseInt(o.charAt(i)),f+=c++%2==0?u*2:u;while(--i>=0);for(i=0;i<f.length;i++)h+=parseInt(f.charAt(i));s=h%10==0}if(!s)return r.allrules.creditCard.alertText},_ajax:function(i,r,u,f){var w=r[u+1],e=f.allrules[w],c=e.extraData,y=e.extraDataDynamic,h={fieldId:i.attr("id"),fieldValue:i.val()},v,o,b,l,u,s,a,p;if(typeof c=="object")n.extend(h,c);else if(typeof c=="string")for(v=c.split("&"),u=0;u<v.length;u++)o=v[u].split("="),o[0]&&o[0]&&(h[o[0]]=o[1]);if(y)for(b=[],l=String(y).split(","),u=0;u<l.length;u++)s=l[u],n(s).length&&(a=i.closest("form, .validationEngineContainer").find(s).val(),p=s.replace("#","")+"="+escape(a),h[s.replace("#","")]=a);return f.eventTrigger=="field"&&delete f.ajaxValidCache[i.attr("id")],!f.isError&&!t._checkAjaxFieldStatus(i.attr("id"),f)?(n.ajax({type:f.ajaxFormValidationMethod,url:e.url,cache:!1,dataType:"json",data:h,field:i,rule:e,methods:t,options:f,beforeSend:function(){},error:function(n,i){t._ajaxError(n,i)},success:function(r){var h=r[0],s=n("#"+h).eq(0),c,u,o;s.length==1&&(c=r[1],u=r[2],c?(f.ajaxValidCache[h]=!0,u?f.allrules[u]&&(o=f.allrules[u].alertTextOk,o&&(u=o)):u=e.alertTextOk,f.showPrompts&&(u?t._showPrompt(s,u,"pass",!0,f):t._closePrompt(s)),f.eventTrigger=="submit"&&i.closest("form").submit()):(f.ajaxValidCache[h]=!1,f.isError=!0,u?f.allrules[u]&&(o=f.allrules[u].alertText,o&&(u=o)):u=e.alertText,f.showPrompts&&t._showPrompt(s,u,"",!0,f))),s.trigger("jqv.field.result",[s,f.isError,u])}}),e.alertTextLoad):void 0},_ajaxError:function(n,t){n.status==0&&t==null?alert("The page is not served from a server! ajax call failed"):typeof console!="undefined"&&console.log("Ajax error: "+n.status+" "+t)},_dateToString:function(n){return n.getFullYear()+"-"+(n.getMonth()+1)+"-"+n.getDate()},_parseDate:function(n){var t=n.split("-");return(t==n&&(t=n.split("/")),t==n)?(t=n.split("."),new Date(t[2],t[1]-1,t[0])):new Date(t[0],t[1]-1,t[2])},_showPrompt:function(i,r,u,f,e,o){var s=t._getPrompt(i);o&&(s=!1),n.trim(r)&&(s?t._updatePrompt(i,s,r,u,f,e):t._buildPrompt(i,r,u,f,e))},_buildPrompt:function(i,r,u,f,e){var o=n("<div>"),v,s,c,l,a,h;o.addClass(t._getClassName(i.attr("id"))+"formError"),o.addClass("parentForm"+t._getClassName(i.closest("form, .validationEngineContainer").attr("id"))),o.addClass("formError");switch(u){case"pass":o.addClass("greenPopup");break;case"load":o.addClass("blackPopup")}if(f&&o.addClass("ajaxed"),v=n("<div>").addClass("formErrorContent").html(r).appendTo(o),s=i.data("promptPosition")||e.promptPosition,e.showArrow){c=n("<div>").addClass("formErrorArrow"),typeof s=="string"&&(h=s.indexOf(":"),h!=-1&&(s=s.substring(0,h)));switch(s){case"bottomLeft":case"bottomRight":o.find(".formErrorContent").before(c),c.addClass("formErrorArrowBottom").html('<div class="line1"><!-- --></div><div class="line2"><!-- --></div><div class="line3"><!-- --></div><div class="line4"><!-- --></div><div class="line5"><!-- --></div><div class="line6"><!-- --></div><div class="line7"><!-- --></div><div class="line8"><!-- --></div><div class="line9"><!-- --></div><div class="line10"><!-- --></div>');break;case"topLeft":case"topRight":c.html('<div class="line10"><!-- --></div><div class="line9"><!-- --></div><div class="line8"><!-- --></div><div class="line7"><!-- --></div><div class="line6"><!-- --></div><div class="line5"><!-- --></div><div class="line4"><!-- --></div><div class="line3"><!-- --></div><div class="line2"><!-- --></div><div class="line1"><!-- --></div>'),o.append(c)}}return e.addPromptClass&&o.addClass(e.addPromptClass),l=i.attr("data-required-class"),l!==undefined?o.addClass(l):e.prettySelect&&n("#"+i.attr("id")).next().is("select")&&(a=n("#"+i.attr("id").substr(e.usePrefix.length).substring(e.useSuffix.length)).attr("data-required-class"),a!==undefined&&o.addClass(a)),o.css({opacity:0}),s==="inline"?(o.addClass("inline"),typeof i.attr("data-prompt-target")!="undefined"&&n("#"+i.attr("data-prompt-target")).length>0?o.appendTo(n("#"+i.attr("data-prompt-target"))):i.after(o)):i.before(o),h=t._calculatePosition(i,o,e),o.css({position:s==="inline"?"relative":"absolute",top:h.callerTopPosition,left:h.callerleftPosition,marginTop:h.marginTopSize,opacity:0}).data("callerField",i),e.autoHidePrompt&&setTimeout(function(){o.animate({opacity:0},function(){o.closest(".formErrorOuter").remove(),o.remove()})},e.autoHideDelay),o.animate({opacity:.87})},_updatePrompt:function(n,i,r,u,f,e,o){if(i){typeof u!="undefined"&&(u=="pass"?i.addClass("greenPopup"):i.removeClass("greenPopup"),u=="load"?i.addClass("blackPopup"):i.removeClass("blackPopup")),f?i.addClass("ajaxed"):i.removeClass("ajaxed"),i.find(".formErrorContent").html(r);var s=t._calculatePosition(n,i,e),h={top:s.callerTopPosition,left:s.callerleftPosition,marginTop:s.marginTopSize};o?i.css(h):i.animate(h)}},_closePrompt:function(n){var i=t._getPrompt(n);i&&i.fadeTo("fast",0,function(){i.parent(".formErrorOuter").remove(),i.remove()})},closePrompt:function(n){return t._closePrompt(n)},_getPrompt:function(i){var u=n(i).closest("form, .validationEngineContainer").attr("id"),f=t._getClassName(i.attr("id"))+"formError",r=n("."+t._escapeExpression(f)+".parentForm"+u)[0];if(r)return n(r)},_escapeExpression:function(n){return n.replace(/([#;&,\.\+\*\~':"\!\^$\[\]\(\)=>\|])/g,"\\$1")},isRTL:function(t){var r=n(document),i=n("body"),u=t&&t.hasClass("rtl")||t&&(t.attr("dir")||"").toLowerCase()==="rtl"||r.hasClass("rtl")||(r.attr("dir")||"").toLowerCase()==="rtl"||i.hasClass("rtl")||(i.attr("dir")||"").toLowerCase()==="rtl";return Boolean(u)},_calculatePosition:function(n,t,i){var f,u,o,v=n.width(),h=n.position().left,s=n.position().top,p=n.height(),y=t.height();f=u=0,o=-y;var e=n.data("promptPosition")||i.promptPosition,r="",l="",a=0,c=0;typeof e=="string"&&e.indexOf(":")!=-1&&(r=e.substring(e.indexOf(":")+1),e=e.substring(0,e.indexOf(":")),r.indexOf(",")!=-1&&(l=r.substring(r.indexOf(",")+1),r=r.substring(0,r.indexOf(",")),c=parseInt(l),isNaN(c)&&(c=0)),a=parseInt(r),isNaN(r)&&(r=0));switch(e){default:case"topRight":u+=h+v-30,f+=s;break;case"topLeft":f+=s,u+=h;break;case"centerRight":f=s+4,o=0,u=h+n.outerWidth(!0)+5;break;case"centerLeft":u=h-(t.width()+2),f=s+4,o=0;break;case"bottomLeft":f=s+n.height()+5,o=0,u=h;break;case"bottomRight":u=h+v-30,f=s+n.height()+5,o=0;break;case"inline":u=0,f=0,o=0}return u+=a,f+=c,{callerTopPosition:f+"px",callerleftPosition:u+"px",marginTopSize:o+"px"}},_saveOptions:function(t,i){var u,r;return n.validationEngineLanguage?u=n.validationEngineLanguage.allRules:n.error("jQuery.validationEngine rules are not loaded, plz add localization files to the page"),n.validationEngine.defaults.allrules=u,r=n.extend(!0,{},n.validationEngine.defaults,i),t.data("jqv",r),r},_getClassName:function(n){if(n)return n.replace(/:/g,"_").replace(/\./g,"_")},_jqSelector:function(n){return n.replace(/([;&,\.\+\*\~':"\!\^#$%@\[\]\(\)=>\|])/g,"\\$1")},_condRequired:function(n,i,r,u){for(var e,f=r+1;f<i.length;f++)if(e=jQuery("#"+i[f]).first(),e.length&&t._required(e,["required"],0,u,!0)==undefined)return t._required(n,["required"],0,u)},_submitButtonClick:function(){var i=n(this),r=i.closest("form, .validationEngineContainer");r.data("jqv_submitButton",i.attr("id"))}};n.fn.validationEngine=function(i){var r=n(this);if(!r[0])return r;if(typeof i=="string"&&i.charAt(0)!="_"&&t[i])return i!="showPrompt"&&i!="hide"&&i!="hideAll"&&t.init.apply(r),t[i].apply(r,Array.prototype.slice.call(arguments,1));if(typeof i!="object"&&i)n.error("Method "+i+" does not exist in jQuery.validationEngine");else return t.init.apply(r,arguments),t.attach.apply(r)},n.validationEngine={fieldIdCounter:0,defaults:{validationEventTrigger:"blur",scroll:!0,focusFirstField:!0,showPrompts:!0,validateNonVisibleFields:!1,promptPosition:"topRight",bindMethod:"bind",inlineAjax:!1,ajaxFormValidation:!1,ajaxFormValidationURL:!1,ajaxFormValidationMethod:"get",onAjaxFormComplete:n.noop,onBeforeAjaxFormValidation:n.noop,onValidationComplete:!1,doNotShowAllErrosOnSubmit:!1,custom_error_messages:{},binded:!0,showArrow:!0,isError:!1,maxErrorsPerField:!1,ajaxValidCache:{},autoPositionUpdate:!1,InvalidFields:[],onFieldSuccess:!1,onFieldFailure:!1,onSuccess:!1,onFailure:!1,validateAttribute:"class",addSuccessCssClassToField:"",addFailureCssClassToField:"",autoHidePrompt:!1,autoHideDelay:1e4,fadeDuration:.3,prettySelect:!1,addPromptClass:"",usePrefix:"",useSuffix:"",showOneMessage:!1}},n(function(){n.validationEngine.defaults.promptPosition=t.isRTL()?"topLeft":"topRight"})}(jQuery),function(n){n.fn.validationEngineLanguage=function(){},n.validationEngineLanguage={newLang:function(){n.validationEngineLanguage.allRules={required:{regex:"none",alertText:"* This field is required",alertTextCheckboxMultiple:"* Please select an option",alertTextCheckboxe:"* This checkbox is required",alertTextDateRange:"* Both date range fields are required"},requiredInFunction:{func:function(n){return n.val()=="test"?!0:!1},alertText:"* Field must equal test"},dateRange:{regex:"none",alertText:"* Invalid ",alertText2:"Date Range"},dateTimeRange:{regex:"none",alertText:"* Invalid ",alertText2:"Date Time Range"},minSize:{regex:"none",alertText:"* Minimum ",alertText2:" characters required"},maxSize:{regex:"none",alertText:"* Maximum ",alertText2:" characters allowed"},groupRequired:{regex:"none",alertText:"* You must fill one of the following fields"},min:{regex:"none",alertText:"* Minimum value is "},max:{regex:"none",alertText:"* Maximum value is "},past:{regex:"none",alertText:"* Date prior to "},future:{regex:"none",alertText:"* Date past "},maxCheckbox:{regex:"none",alertText:"* Maximum ",alertText2:" options allowed"},minCheckbox:{regex:"none",alertText:"* Please select ",alertText2:" options"},equals:{regex:"none",alertText:"* Fields do not match"},creditCard:{regex:"none",alertText:"* Invalid credit card number"},phone:{regex:/^([\+][0-9]{1,3}[\ \.\-])?([\(]{1}[0-9]{2,6}[\)])?([0-9\ \.\-\/]{3,20})((x|ext|extension)[\ ]?[0-9]{1,4})?$/,alertText:"* Invalid phone number"},email:{regex:/^(([^<>()[\]\\.,;:\s@\"]+(\.[^<>()[\]\\.,;:\s@\"]+)*)|(\".+\"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/,alertText:res.CustomerLogin_EmailError},integer:{regex:/^[\-\+]?\d+$/,alertText:"* Not a valid integer"},number:{regex:/^[\-\+]?((([0-9]{1,3})([,][0-9]{3})*)|([0-9]+))?([\.]([0-9]+))?$/,alertText:"* Invalid floating decimal number"},date:{func:function(n){var e=new RegExp(/^(\d{4})[\/\-\.](0?[1-9]|1[012])[\/\-\.](0?[1-9]|[12][0-9]|3[01])$/),t=e.exec(n.val());if(t==null)return!1;var u=t[1],f=t[2]*1,r=t[3]*1,i=new Date(u,f-1,r);return i.getFullYear()==u&&i.getMonth()==f-1&&i.getDate()==r},alertText:"* Invalid date, must be in YYYY-MM-DD format"},ipv4:{regex:/^((([01]?[0-9]{1,2})|(2[0-4][0-9])|(25[0-5]))[.]){3}(([0-1]?[0-9]{1,2})|(2[0-4][0-9])|(25[0-5]))$/,alertText:"* Invalid IP address"},url:{regex:/^(https?|ftp):\/\/(((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:)*@)?(((\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5]))|((([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.)+(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.?)(:\d*)?)(\/((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)+(\/(([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)*)*)?)?(\?((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)|[\uE000-\uF8FF]|\/|\?)*)?(\#((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)|\/|\?)*)?$/i,alertText:"* Invalid URL"},onlyNumberSp:{regex:/^[0-9\ ]+$/,alertText:"* Numbers only"},onlyLetterSp:{regex:/^[a-zA-Z\ \']+$/,alertText:"* Letters only"},onlyLetterNumber:{regex:/^[0-9a-zA-Z]+$/,alertText:"* No special characters allowed"},postCode:{regex:/^[0-9a-zA-Z-\s]+$/,alertText:res.CustomerVerify_PostalCodeErrorFormat},password:{regex:/^\S{6,30}$/,alertText:res.CustomerVerify_PasswordLimitError},ajaxEmailExistCheck:{url:res.SECURESERVER+"/account/customerexists",extraDataDynamic:["#guest"],alertText:res.txtEmailRegistered,alertTextLoad:res.SearchLoading},ajaxEmailNotExistCheck:{url:res.SECURESERVER+"/account/customernotexists",alertText:res.GetPasswordBack_NoExistEmail,alertTextLoad:res.SearchLoading},ajaxCityBlackList:{url:res.SECURESERVER+"/account/checkcityblacklist",extraDataDynamic:["#shippingCountry"],alertText:res.DeliveryWarningMsgForBlackCities,alertTextLoad:res.ValidatingPleaseWait},ajaxUserCall:{url:"ajaxValidateFieldUser",extraData:"name=eric",alertText:"* This user is already taken",alertTextLoad:"* Validating, please wait"},ajaxUserCallPhp:{url:"phpajax/ajaxValidateFieldUser.php",extraData:"name=eric",alertTextOk:"* This username is available",alertText:"* This user is already taken",alertTextLoad:"* Validating, please wait"},ajaxNameCall:{url:"ajaxValidateFieldName",alertText:"* This name is already taken",alertTextOk:"* This name is available",alertTextLoad:"* Validating, please wait"},ajaxNameCallPhp:{url:"phpajax/ajaxValidateFieldName.php",alertText:"* This name is already taken",alertTextLoad:"* Validating, please wait"},ajaxValidateAssociateCode:{url:"/associates/validateassociatecode",extraDataDynamic:["#assoc"],alertText:"Bad",alertTextLoad:res.ValidatingPleaseWait},validate2fields:{alertText:"* Please input HELLO"},dateFormat:{regex:/^\d{4}[\/\-](0?[1-9]|1[012])[\/\-](0?[1-9]|[12][0-9]|3[01])$|^(?:(?:(?:0?[13578]|1[02])(\/|-)31)|(?:(?:0?[1,3-9]|1[0-2])(\/|-)(?:29|30)))(\/|-)(?:[1-9]\d\d\d|\d[1-9]\d\d|\d\d[1-9]\d|\d\d\d[1-9])$|^(?:(?:0?[1-9]|1[0-2])(\/|-)(?:0?[1-9]|1\d|2[0-8]))(\/|-)(?:[1-9]\d\d\d|\d[1-9]\d\d|\d\d[1-9]\d|\d\d\d[1-9])$|^(0?2(\/|-)29)(\/|-)(?:(?:0[48]00|[13579][26]00|[2468][048]00)|(?:\d\d)?(?:0[48]|[2468][048]|[13579][26]))$/,alertText:"* Invalid Date"},dateTimeFormat:{regex:/^\d{4}[\/\-](0?[1-9]|1[012])[\/\-](0?[1-9]|[12][0-9]|3[01])\s+(1[012]|0?[1-9]){1}:(0?[1-5]|[0-6][0-9]){1}:(0?[0-6]|[0-6][0-9]){1}\s+(am|pm|AM|PM){1}$|^(?:(?:(?:0?[13578]|1[02])(\/|-)31)|(?:(?:0?[1,3-9]|1[0-2])(\/|-)(?:29|30)))(\/|-)(?:[1-9]\d\d\d|\d[1-9]\d\d|\d\d[1-9]\d|\d\d\d[1-9])$|^((1[012]|0?[1-9]){1}\/(0?[1-9]|[12][0-9]|3[01]){1}\/\d{2,4}\s+(1[012]|0?[1-9]){1}:(0?[1-5]|[0-6][0-9]){1}:(0?[0-6]|[0-6][0-9]){1}\s+(am|pm|AM|PM){1})$/,alertText:"* Invalid Date or Date Format",alertText2:"Expected Format: ",alertText3:"mm/dd/yyyy hh:mm:ss AM|PM or ",alertText4:"yyyy-mm-dd hh:mm:ss AM|PM"}}}},n.validationEngineLanguage.newLang()}(jQuery),function(n,t,i){function f(n){return n}function s(n){return e(decodeURIComponent(n.replace(o," ")))}function e(n){return n.indexOf('"')===0&&(n=n.slice(1,-1).replace(/\\"/g,'"').replace(/\\\\/g,"\\")),n}function u(n){return r.json?JSON.parse(n):n}var o=/\+/g,r=n.cookie=function(e,o,h){var b,a,c,w;if(o!==i)return h=n.extend({},r.defaults,h),o===null&&(h.expires=-1),typeof h.expires=="number"&&(b=h.expires,a=h.expires=new Date,a.setDate(a.getDate()+b)),o=r.json?JSON.stringify(o):String(o),t.cookie=[encodeURIComponent(e),"=",r.raw?o:encodeURIComponent(o),h.expires?"; expires="+h.expires.toUTCString():"",h.path?"; path="+h.path:"",h.domain?"; domain="+h.domain:"",h.secure?"; secure":""].join("");var k=r.raw?f:s,d=t.cookie.split("; "),l=e?null:{};for(c=0,w=d.length;c<w;c++){var p=d[c].split("="),y=k(p.shift()),v=k(p.join("="));if(e&&e===y){l=u(v);break}e||(l[y]=u(v))}return l};r.defaults={},n.removeCookie=function(t,i){return n.cookie(t)!==null?(n.cookie(t,null,i),!0):!1}}(jQuery,document),function(n,t,i){function l(n){var t={},r=/^jQuery\d+$/;return i.each(n.attributes,function(n,i){i.specified&&!r.test(i.name)&&(t[i.name]=i.value)}),t}function u(n,r){var f=this,u=i(f);if(f.value==u.attr("placeholder")&&u.hasClass("placeholder"))if(u.data("placeholder-password")){if(u=u.hide().next().show().attr("id",u.removeAttr("id").data("placeholder-id")),n===!0)return u[0].value=r;u.focus()}else f.value="",u.removeClass("placeholder"),f==t.activeElement&&f.select()}function o(){var t,f=this,n=i(f),o=n,r=this.id;if(f.value==""){if(f.type=="password"){if(!n.data("placeholder-textinput")){try{t=n.clone().attr({type:"text"})}catch(e){t=i("<input>").attr(i.extend(l(this),{type:"text"}))}t.removeAttr("name").data({"placeholder-password":!0,"placeholder-id":r}).bind("focus.placeholder",u),n.data({"placeholder-textinput":t,"placeholder-id":r}).before(t)}n=n.removeAttr("id").hide().prev().attr("id",r).show()}n.addClass("placeholder"),n[0].value=n.attr("placeholder")}else n.removeClass("placeholder")}var f="placeholder"in t.createElement("input"),s="placeholder"in t.createElement("textarea"),h=i.fn,c=i.valHooks,e,r;f&&s?(r=h.placeholder=function(){return this},r.input=r.textarea=!0):(r=h.placeholder=function(){var n=this;return n.filter((f?"textarea":":input")+"[placeholder]").not(".placeholder").bind({"focus.placeholder":u,"blur.placeholder":o}).data("placeholder-enabled",!0).trigger("blur.placeholder"),n},r.input=f,r.textarea=s,e={get:function(n){var t=i(n);return t.data("placeholder-enabled")&&t.hasClass("placeholder")?"":n.value},set:function(n,r){var f=i(n);return f.data("placeholder-enabled")?(r==""?(n.value=r,n!=t.activeElement&&o.call(n)):f.hasClass("placeholder")?u.call(n,!0,r)||(n.value=r):n.value=r,f):n.value=r}},f||(c.input=e),s||(c.textarea=e),i(function(){i(t).delegate("form","submit.placeholder",function(){var n=i(".placeholder",this).each(u);setTimeout(function(){n.each(o)},10)})}),i(n).bind("beforeunload.placeholder",function(){i(".placeholder").each(function(){this.value=""})}))}(this,document,jQuery),function(){(function(n,t,i){var r,f,u;return u="slidesjs",f={width:940,height:528,start:1,navigation:{active:!0,effect:"slide"},pagination:{active:!0,effect:"slide"},play:{active:!1,effect:"slide",interval:5e3,auto:!1,swap:!0,pauseOnHover:!1,restartDelay:2500},effect:{slide:{speed:500},fade:{speed:300,crossfade:!0}},callback:{loaded:function(){},start:function(){},complete:function(){}}},r=function(){function t(t,i){this.element=t,this.options=n.extend(!0,{},f,i),this._defaults=f,this._name=u,this.init()}return t}(),r.prototype.init=function(){var i,s,e,f,o,u,r=this;if(i=n(this.element),this.data=n.data(this),n.data(this,"animating",!1),n.data(this,"total",i.children().not(".slidesjs-navigation",i).length),n.data(this,"current",this.options.start-1),n.data(this,"vendorPrefix",this._getVendorPrefix()),typeof TouchEvent!="undefined"&&(n.data(this,"touch",!0),this.options.effect.slide.speed=this.options.effect.slide.speed/2),i.css({overflow:"hidden"}),i.slidesContainer=i.children().not(".slidesjs-navigation",i).wrapAll("<div class='slidesjs-container'>",i).parent().css({overflow:"hidden",position:"relative"}),n(".slidesjs-container",i).wrapInner("<div class='slidesjs-control'>",i).children(),n(".slidesjs-control",i).css({position:"relative",left:0}),n(".slidesjs-control",i).children().addClass("slidesjs-slide").css({position:"absolute",top:0,left:0,width:"100%",zIndex:0,display:"none",webkitBackfaceVisibility:"hidden"}),n.each(n(".slidesjs-control",i).children(),function(t){var i;return i=n(this),i.attr("slidesjs-index",t)}),this.data.touch){n(".slidesjs-control",i).on("touchstart",function(n){return r._touchstart(n)});n(".slidesjs-control",i).on("touchmove",function(n){return r._touchmove(n)});n(".slidesjs-control",i).on("touchend",function(n){return r._touchend(n)})}return i.fadeIn(0),this.update(),this.data.touch&&this._setuptouch(),n(".slidesjs-control",i).children(":eq("+this.data.current+")").eq(0).fadeIn(0,function(){return n(this).css({zIndex:10})}),this.options.navigation.active&&(o=n("<a>",{"class":"slidesjs-previous slidesjs-navigation",href:"#",title:"Previous",text:"Previous"}).appendTo(i),s=n("<a>",{"class":"slidesjs-next slidesjs-navigation",href:"#",title:"Next",text:"Next"}).appendTo(i)),n(".slidesjs-next",i).click(function(n){return n.preventDefault(),r.stop(!0),r.next(r.options.navigation.effect)}),n(".slidesjs-previous",i).click(function(n){return n.preventDefault(),r.stop(!0),r.previous(r.options.navigation.effect)}),this.options.play.active&&(f=n("<a>",{"class":"slidesjs-play slidesjs-navigation",href:"#",title:"Play",text:"Play"}).appendTo(i),u=n("<a>",{"class":"slidesjs-stop slidesjs-navigation",href:"#",title:"Stop",text:"Stop"}).appendTo(i),f.click(function(n){return n.preventDefault(),r.play(!0)}),u.click(function(n){return n.preventDefault(),r.stop(!0)}),this.options.play.swap&&u.css({display:"none"})),this.options.pagination.active&&(e=n("<ul>",{"class":"slidesjs-pagination"}).appendTo(i),n.each(new Array(this.data.total),function(t){var u,i;return u=n("<li>",{"class":"slidesjs-pagination-item"}).appendTo(e),i=n("<a>",{href:"#","data-slidesjs-item":t,html:t+1}).appendTo(u),i.click(function(t){return t.preventDefault(),r.stop(!0),r.goto(n(t.currentTarget).attr("data-slidesjs-item")*1+1)})})),n(t).bind("resize",function(){return r.update()}),this._setActive(),this.options.play.auto&&this.play(),this.options.callback.loaded(this.options.start)},r.prototype._setActive=function(t){var i,r;return i=n(this.element),this.data=n.data(this),r=t>-1?t:this.data.current,n(".active",i).removeClass("active"),n("li:eq("+r+") a",i).addClass("active")},r.prototype.update=function(){var i,r,t;return i=n(this.element),this.data=n.data(this),n(".slidesjs-control",i).children(":not(:eq("+this.data.current+"))").css({display:"none",left:0,zIndex:0}),t=i.width(),r=this.options.height/this.options.width*t,this.options.width=t,this.options.height=r,n(".slidesjs-control, .slidesjs-container",i).css({width:t,height:r})},r.prototype.next=function(t){var i;return i=n(this.element),this.data=n.data(this),n.data(this,"direction","next"),t===void 0&&(t=this.options.navigation.effect),t==="fade"?this._fade():this._slide()},r.prototype.previous=function(t){var i;return i=n(this.element),this.data=n.data(this),n.data(this,"direction","previous"),t===void 0&&(t=this.options.navigation.effect),t==="fade"?this._fade():this._slide()},r.prototype.goto=function(t){var r,i;if(r=n(this.element),this.data=n.data(this),i===void 0&&(i=this.options.pagination.effect),t>this.data.total?t=this.data.total:t<1&&(t=1),typeof t=="number")return i==="fade"?this._fade(t):this._slide(t);if(typeof t=="string"){if(t==="first")return i==="fade"?this._fade(0):this._slide(0);if(t==="last")return i==="fade"?this._fade(this.data.total):this._slide(this.data.total)}},r.prototype._setuptouch=function(){var u,i,t,r;return u=n(this.element),this.data=n.data(this),r=n(".slidesjs-control",u),i=this.data.current+1,t=this.data.current-1,t<0&&(t=this.data.total-1),i>this.data.total-1&&(i=0),r.children(":eq("+i+")").css({display:"block",left:this.options.width}),r.children(":eq("+t+")").css({display:"block",left:-this.options.width})},r.prototype._touchstart=function(t){var r,i;return r=n(this.element),this.data=n.data(this),i=t.originalEvent.touches[0],this._setuptouch(),n.data(this,"touchtimer",Number(new Date)),n.data(this,"touchstartx",i.pageX),n.data(this,"touchstarty",i.pageY),t.stopPropagation()},r.prototype._touchend=function(t){var o,f,r,i,e,h,u,s=this;o=n(this.element),this.data=n.data(this),h=t.originalEvent.touches[0],i=n(".slidesjs-control",o),i.position().left>this.options.width*.5||i.position().left>this.options.width*.1&&Number(new Date)-this.data.touchtimer<250?(n.data(this,"direction","previous"),this._slide()):i.position().left<-(this.options.width*.5)||i.position().left<-(this.options.width*.1)&&Number(new Date)-this.data.touchtimer<250?(n.data(this,"direction","next"),this._slide()):(r=this.data.vendorPrefix,u=r+"Transform",f=r+"TransitionDuration",e=r+"TransitionTimingFunction",i[0].style[u]="translateX(0px)",i[0].style[f]=this.options.effect.slide.speed*.85+"ms");i.on("transitionend webkitTransitionEnd oTransitionEnd otransitionend MSTransitionEnd",function(){return r=s.data.vendorPrefix,u=r+"Transform",f=r+"TransitionDuration",e=r+"TransitionTimingFunction",i[0].style[u]="",i[0].style[f]="",i[0].style[e]=""});return t.stopPropagation()},r.prototype._touchmove=function(t){var f,e,u,i,r;return f=n(this.element),this.data=n.data(this),i=t.originalEvent.touches[0],e=this.data.vendorPrefix,u=n(".slidesjs-control",f),r=e+"Transform",n.data(this,"scrolling",Math.abs(i.pageX-this.data.touchstartx)<Math.abs(i.pageY-this.data.touchstarty)),this.data.animating||this.data.scrolling||(t.preventDefault(),this._setuptouch(),u[0].style[r]="translateX("+(i.pageX-this.data.touchstartx)+"px)"),t.stopPropagation()},r.prototype.play=function(t){var r,f,u,i=this;return r=n(this.element),this.data=n.data(this),!this.data.playInterval&&(t&&(f=this.data.current,this.data.direction="next",this.options.play.effect==="fade"?this._fade():this._slide()),n.data(this,"playInterval",setInterval(function(){return f=i.data.current,i.data.direction="next",i.options.play.effect==="fade"?i._fade():i._slide()},this.options.play.interval)),u=n(".slidesjs-container",r),this.options.play.pauseOnHover&&(u.unbind(),u.bind("mouseenter",function(){return i.stop()}),u.bind("mouseleave",function(){return i.options.play.restartDelay?n.data(i,"restartDelay",setTimeout(function(){return i.play(!0)},i.options.play.restartDelay)):i.play()})),n.data(this,"playing",!0),n(".slidesjs-play",r).addClass("slidesjs-playing"),this.options.play.swap)?(n(".slidesjs-play",r).hide(),n(".slidesjs-stop",r).show()):void 0},r.prototype.stop=function(t){var i;return i=n(this.element),this.data=n.data(this),clearInterval(this.data.playInterval),this.options.play.pauseOnHover&&t&&n(".slidesjs-container",i).unbind(),n.data(this,"playInterval",null),n.data(this,"playing",!1),n(".slidesjs-play",i).removeClass("slidesjs-playing"),this.options.play.swap?(n(".slidesjs-stop",i).hide(),n(".slidesjs-play",i).show()):void 0},r.prototype._slide=function(t){var l,u,e,h,r,s,i,a,c,o,f=this;if(l=n(this.element),this.data=n.data(this),!this.data.animating&&t!==this.data.current+1){if(n.data(this,"animating",!0),u=this.data.current,t>-1?(t=t-1,o=t>u?1:-1,e=t>u?-this.options.width:this.options.width,r=t):(o=this.data.direction==="next"?1:-1,e=this.data.direction==="next"?-this.options.width:this.options.width,r=u+o),r===-1&&(r=this.data.total-1),r===this.data.total&&(r=0),this._setActive(r),i=n(".slidesjs-control",l),t>-1&&i.children(":not(:eq("+u+"))").css({display:"none",left:0,zIndex:0}),i.children(":eq("+r+")").css({display:"block",left:o*this.options.width,zIndex:10}),this.options.callback.start(u+1),this.data.vendorPrefix){s=this.data.vendorPrefix,c=s+"Transform",h=s+"TransitionDuration",a=s+"TransitionTimingFunction",i[0].style[c]="translateX("+e+"px)",i[0].style[h]=this.options.effect.slide.speed+"ms";return i.on("transitionend webkitTransitionEnd oTransitionEnd otransitionend MSTransitionEnd",function(){return i[0].style[c]="",i[0].style[h]="",i.children(":eq("+r+")").css({left:0}),i.children(":eq("+u+")").css({display:"none",left:0,zIndex:0}),n.data(f,"current",r),n.data(f,"animating",!1),i.unbind("transitionend webkitTransitionEnd oTransitionEnd otransitionend MSTransitionEnd"),i.children(":not(:eq("+r+"))").css({display:"none",left:0,zIndex:0}),f.data.touch&&f._setuptouch(),f.options.callback.complete(r+1)})}return i.stop().animate({left:e},this.options.effect.slide.speed,function(){return i.css({left:0}),i.children(":eq("+r+")").css({left:0}),i.children(":eq("+u+")").css({display:"none",left:0,zIndex:0},n.data(f,"current",r),n.data(f,"animating",!1),f.options.callback.complete(r+1))})}},r.prototype._fade=function(t){var o,f,i,r,e,u=this;return o=n(this.element),this.data=n.data(this),!this.data.animating&&t!==this.data.current+1?(n.data(this,"animating",!0),f=this.data.current,t?(t=t-1,e=t>f?1:-1,i=t):(e=this.data.direction==="next"?1:-1,i=f+e),i===-1&&(i=this.data.total-1),i===this.data.total&&(i=0),this._setActive(i),r=n(".slidesjs-control",o),r.children(":eq("+i+")").css({display:"none",left:0,zIndex:10}),this.options.callback.start(f+1),this.options.effect.fade.crossfade?(r.children(":eq("+this.data.current+")").stop().fadeOut(this.options.effect.fade.speed),r.children(":eq("+i+")").stop().fadeIn(this.options.effect.fade.speed,function(){return r.children(":eq("+i+")").css({zIndex:0}),n.data(u,"animating",!1),n.data(u,"current",i),u.options.callback.complete(i+1)})):r.children(":eq("+f+")").stop().fadeOut(this.options.effect.fade.speed,function(){return r.children(":eq("+i+")").stop().fadeIn(u.options.effect.fade.speed,function(){return r.children(":eq("+i+")").css({zIndex:10})}),n.data(u,"animating",!1),n.data(u,"current",i),u.options.callback.complete(i+1)})):void 0},r.prototype._getVendorPrefix=function(){for(var u=i.body||i.documentElement,f=u.style,n="transition",r=["Moz","Webkit","Khtml","O","ms"],n=n.charAt(0).toUpperCase()+n.substr(1),t=0;t<r.length;){if(typeof f[r[t]+n]=="string")return r[t];t++}return!1},n.fn[u]=function(t){return this.each(function(){if(!n.data(this,"plugin_"+u))return n.data(this,"plugin_"+u,new r(this,t))})}})(jQuery,window,document)}.call(this),featuredimagezoomer={loadinggif:"/content/images/loadinganimation.gif",magnifycursor:"crosshair"},function(n){n.fn.multizoomhide=function(){return n('<style type="text/css">'+this.selector+" {visibility: hidden;}</style>").appendTo("head")},n.fn.addmultizoom=function(t){function o(){var s=this,y={},c={},p,h,a,v,l,o;(h=s.getAttribute("data-dims"))&&(h=h.split(e),l=h[0],o=h[1]),n(new Image).error(function(){s.tagName&&!t.notmulti&&(alert("Error: I couldn't find the image:\n\n"+s.href+((a=s.getAttribute("data-title"))?'\n\n"'+a+'"':"")),(v=i.data("last-trigger"))&&(u=!0,n(v).trigger("click")))}).load(function(){var e=i.css("opacity"),h={},u;isNaN(e)&&(e=1),(t.notmulti||!r.largeimage)&&(l=t.width||i.width(),o=t.height||i.height()),i.attr("src",this.src).css({width:l||t.width||this.width,height:o=+(o||t.height||this.height)}),i.data("added")&&i.data("added").remove(),i.data("last-trigger",s),t.imagevertcenter&&(y={top:(i.parent().innerHeight()-o)/2}),i.css(y).addimagezoom(n.extend(h,t,r)).data("added",n(".magnifyarea:last"+(h.cursorshade?", .cursorshade:last":"")+", .zoomstatus:last, .zoomtracker:last")),t.magvertcenter&&n(".magnifyarea:last").css({marginTop:(o-n(".magnifyarea:last").height())/2}),t.descpos&&(u=i.parent(),c={left:u.offset().left+(u.outerWidth()-u.width())/2,top:o+i.offset().top}),t.notmulti?f.css(c):f.css(c).empty().append(s.getAttribute("data-title")||""),+e<1&&i.add(f).animate({opacity:1},t.speed)}).attr("src",i.data("src"))}var r={largeimage:t.largeimage},i=n(t.imgObj+':not(".thumbs")'),f=n(t.descArea),u=!0,e=/, ?/;return t=n.extend({speed:"slow",initzoomablefade:!0,zoomablefade:!0},t),this.click(function(e){e.preventDefault();var src=i.attr("src"),ms,zr,cs,opacityObj={opacity:0};(u||src!==this.href&&src!==this.getAttribute("href"))&&((!u||t.initzoomablefade)&&t.zoomablefade||(opacityObj={}),u=!1,r.largeimage=this.getAttribute("data-large")||t.largeimage||"",r.largeimage==="none"&&(r.largeimage=""),(ms=this.getAttribute("data-magsize"))||t.magnifiersize?r.magnifiersize=(ms?ms.split(e):"")||t.magnifiersize:delete r.magnifiersize,r.zoomrange=((zr=this.getAttribute("data-zoomrange"))?zr=zr.split(e):"")||t.zoomrange||"",zr&&(zr[0]=+zr[0],zr[1]=+zr[1]),r.cursorshade=((cs=this.getAttribute("data-lens"))?cs:"")||t.cursorshade||"",cs&&(r.cursorshade=eval(cs)),i.data("added")&&i.stop(!0,!0).data("added").not(".zoomtracker").remove().end().css({background:"url("+featuredimagezoomer.loadinggif+") center no-repeat"}),i.css(n.extend({visibility:"visible"},i.data("added")?t.zoomablefade?{opacity:.25}:opacityObj:opacityObj)).data("src",this.href),f.css(n.extend({visibility:"visible"},opacityObj)),o.call(this))}).eq(0).trigger("click"),this},n.extend(featuredimagezoomer,{dsetting:{magnifierpos:"right",magnifiersize:[200,200],cursorshadecolor:"#fff",cursorshadeopacity:.3,cursorshadeborder:"1px solid black",cursorshade:!1,leftoffset:15,rightoffset:10},isie:function(){if(n.browser.msie){var t=parseFloat(n.browser.version);if(t>=7)return!0}return!1}(),showimage:function(t,i,r){var u=t.data("specs"),o=u.magpos,s=this,e=t.data("specs").coords,f;u.windimensions={w:n(window).width(),h:n(window).height()},f={},f.left=e.left+(o==="left"?-u.magsize.w-u.lo:t.width()+u.ro),o!=="left"&&f.left+u.magsize.w+u.lo>=u.windimensions.w&&e.left-u.magsize.w>=u.lo?f.left=e.left-u.magsize.w-u.lo:o==="left"&&f.left<u.ro&&(f.left=e.left+t.width()+u.ro),i.css({left:f.left,top:e.top}).show(),u.$statusdiv.html("Current Zoom: "+u.curpower+'<div style="font-size:80%">Use Mouse Wheel to Zoom In/Out</div>'),r&&s.showstatusdiv(u,400,2e3)},hideimage:function(n,t,i){var r=n.data("specs");t.hide(),i&&this.hidestatusdiv(r)},showstatusdiv:function(n,t,i){clearTimeout(n.statustimer),n.$statusdiv.css({visibility:"visible"}).fadeIn(t),n.statustimer=setTimeout(function(){featuredimagezoomer.hidestatusdiv(n)},i)},hidestatusdiv:function(n){n.$statusdiv.stop(!0,!0).hide()},getboundary:function(n,t,i){var u,r;return n=="left"?(u=-i.imagesize.w*i.curpower+i.magsize.w,t>0?0:t<u?u:t):(r=-i.imagesize.h*i.curpower+i.magsize.h,t>0?0:t<r?r:t)},moveimage:function(n,t,i,r){var u=n.data("specs"),h=Math.round(u.magsize.w/u.curpower),c=Math.round(u.magsize.h/u.curpower),f=u.csborder,y=this,e=u.coords,o=r.pageX||u.lastpagex,s=r.pageY||u.lastpagey,p=o-e.left,v=s-e.top,l,a;i.css({visibility:"",width:h,height:c,top:Math.min(u.imagesize.h-c-f,Math.max(0,v-(f+c)/2))+e.top,left:Math.min(u.imagesize.w-h-f,Math.max(0,p-(f+h)/2))+e.left}),l=-p*u.curpower+u.magsize.w/2,a=-v*u.curpower+u.magsize.h/2,t.css({left:y.getboundary("left",l,u),top:y.getboundary("top",a,u)}),u.$statusdiv.css({left:o-10,top:s+20}),u.lastpagex=o,u.lastpagey=s},magnifyimage:function(n,t,i){t.detail||t.wheelDelta||(t=t.originalEvent);var c=t.detail?t.detail*-120:t.wheelDelta,s=c<=-120?"out":"in",r=n.data("specs"),h=r.magnifier,o=r.imagesize,e=r.curpower,u=s=="in"?Math.min(e+1,i[1]):Math.max(e-1,i[0]),f=[o.w*u,o.h*u];h.$image.css({width:f[0],height:f[1]}),r.curpower=u,r.$statusdiv.html("Current Zoom: "+r.curpower),this.showstatusdiv(r,0,500),n.trigger("mousemove")},highestzindex:function(t){var r=0,u=t.parents().add(t),i;return u.each(function(){i=n(this).css("zIndex"),i=isNaN(i)?0:+i,r=Math.max(r,i)}),r},init:function(t,i){function p(n,t){var c={w:f.width(),h:f.height()},s={w:h,h:l},i=r.zoomrange?r.zoomrange[0]:(t.width()/h).toFixed(5);u.data("specs",{$statusdiv:e,statustimer:null,magnifier:{$outer:f,$inner:n,$image:t},magsize:c,magpos:r.magnifierpos,imagesize:s,curpower:i,coords:a(),csborder:o.outerWidth(),lo:r.leftoffset,ro:r.rightoffset})}function a(){var n=u.offset();return{left:n.left,top:n.top}}var r=n.extend({},this.dsetting,i),h=t.width(),l=t.height(),y=t.offset(),s=this,u,o,e,f,v={pageX:0,pageY:0},c=r.zIndex||this.highestzindex(t);if(l===0||h===0){n(new Image).load(function(){featuredimagezoomer.init(t,i)}).attr("src",t.attr("src"));return}t.css({visibility:"visible"}),r.largeimage=r.largeimage||t.get(0).src,f=n('<div class="magnifyarea" style="position:absolute;z-index:'+c+";width:"+r.magnifiersize[0]+"px;height:"+r.magnifiersize[1]+'px;left:-10000px;top:-10000px;visibility:hidden;overflow:hidden;border:1px solid black;" />').append('<div style="position:relative;left:0;top:0;z-index:'+c+';" />').appendTo(document.body),o=r.cursorshade?n('<div class="cursorshade" style="visibility:hidden;position:absolute;left:0;top:0;z-index:'+c+';" />').css({border:r.cursorshadeborder,opacity:r.cursorshadeopacity,backgroundColor:r.cursorshadecolor}).appendTo(document.body):n("<div />"),e=n('<div class="zoomstatus preloadevt" style="position:absolute;visibility:hidden;left:0;top:0;z-index:'+c+';" />').html('<img src="'+this.loadinggif+'" />').appendTo(document.body),u=n('<div class="zoomtracker" style="cursor:progress;position:absolute;z-index:'+c+";left:"+y.left+"px;top:"+y.top+"px;height:"+l+"px;width:"+h+'px;" />').css({backgroundImage:this.isie?"url(cannotbe)":"none"}).appendTo(document.body),n(window).bind("load resize",function(){var f=t.offset(),r;u.css({left:f.left,top:f.top}),i.descpos&&i.descArea&&(r=t.parent(),n(i.descArea).css({left:r.offset().left+(r.outerWidth()-r.width())/2,top:t.height()+f.top}))}),u.mouseover(function(){o.add(f).add(e).removeClass("featuredimagezoomerhidden"),u.data("premouseout",!1)}).mouseout(function(){o.add(f).add(e.not(".preloadevt")).addClass("featuredimagezoomerhidden"),u.data("premouseout",!0)}).mousemove(function(n){v.pageX=n.pageX,v.pageY=n.pageY});u.one("mouseover",function(){var y=f.find("div:eq(0)"),c=n('<img src="'+r.largeimage+'"/>').appendTo(y),k=featuredimagezoomer.loaded[n('<a href="'+r.largeimage+'"></a>').get(0).href],w=r.zoomrange&&r.zoomrange[1]>r.zoomrange[0],b=a();k||(t.stop(!0,!0).css({opacity:.1}),e.css({left:b.left+h/2-e.width()/2,top:b.top+l/2-e.height()/2,visibility:"visible"})),c.bind("loadevt",function(i,b){var d,k;if(b.type==="error"){t.css({opacity:1}).data("added").remove(),d=n('<a href="'+c.attr("src")+'"></a>').get(0).href,window.console&&console.error?console.error("Cannot find Featured Image Zoomer larger image: "+d):alert("Cannot find Featured Image Zoomer larger image:\n\n"+d);return}featuredimagezoomer.loaded[this.src]=!0,t.css({opacity:1}),e.empty().css({border:"1px solid black",background:"#C0C0C0",padding:"4px",font:"bold 13px Arial",opacity:.8}).hide().removeClass("preloadevt"),u.data("premouseout")&&e.addClass("featuredimagezoomerhidden"),r.zoomrange&&(k=[h*r.zoomrange[0],l*r.zoomrange[0]],c.css({width:k[0],height:k[1]})),p(y,c),f.css({display:"none",visibility:"visible"}),u.mouseover(function(){u.data("specs").coords=a(),s.showimage(u,f,w)}),u.mousemove(function(n){s.moveimage(u,y,o,n)}),u.data("premouseout")||(s.showimage(u,f,w),s.moveimage(u,y,o,v)),u.mouseout(function(){s.hideimage(u,f,w)}).css({cursor:s.magnifycursor}),r.zoomrange&&r.zoomrange[1]>r.zoomrange[0]?u.bind("DOMMouseScroll mousewheel",function(n){s.magnifyimage(u,n,r.zoomrange),n.preventDefault()}):r.disablewheel&&u.bind("DOMMouseScroll mousewheel",function(n){n.preventDefault()})}),c.get(0).complete?c.trigger("loadevt",{type:"load"}):c.bind("load error",function(n){c.trigger("loadevt",n)})})},iname:function(){var t=n("<img />"),i=t.get(0).tagName;return t.remove(),i}(),loaded:{},hashre:/^#/}),n.fn.addimagezoom=function(t){var i=this.selector,r=n(i.replace(featuredimagezoomer.hashre,".")+".thumbs a");return(t=t||{},t.multizoom!==null&&r.size())?(r.addmultizoom(n.extend(t,{imgObj:i,multizoom:null})),this):t.multizoom?(n(t.multizoom).addmultizoom(n.extend(t,{imgObj:i,multizoom:null})),this):t.multizoom!==null?this.each(function(){if(this.tagName!==featuredimagezoomer.iname)return!0;n('<a href="'+this.src+'"></a>').addmultizoom(n.extend(t,{imgObj:i,multizoom:null,notmulti:!0}))}):this.each(function(){if(this.tagName!==featuredimagezoomer.iname)return!0;featuredimagezoomer.init(n(this),t)})}}(jQuery),msf={},function(){function t(n){return(n<10?"0":"")+n}function i(n){n=n.toLowerCase();var t={name:"en-GB",d:"dd/MM/yyyy",D:"dd MMMM yyyy",t:"HH:mm",T:"HH:mm:ss",M:"d MMMM",Y:"MMMM yyyy",s:"yyyy-MM-ddTHH:mm:ss",_m:["January","February","March","April","May","June","July","August","September","October","November","December"],_d:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],_r:".",_t:",",_c:"?,0.00",_ct:",",_cr:"."};return n.substr(0,2)=="sv"?(t.name="sv-SE",t.d="yyyy-MM-dd",t.D="den dd MMMM yyyy",t._m=["januari","februari","mars","april","maj","juni","juli","augusti","september","oktober","november","december"],t._d=["s鰊dag","m錸dag","tisdag","onsdag","torsdag","fredag","l鰎dag"],t._r=",",t._t=" ",t._ct=".",t._cr=",",t._c="#,0.00 kr"):n!="en-gb"&&(t.name="en-US",t.t="hh:mm tt",t.T="hh:mm:ss tt",t.d="MM/dd/yyyy",t.D="MMMM dd, yyyy",t.Y="MMMM, yyyy",t._c="$#,0.00"),t.f=t.D+" "+t.t,t.F=t.D+" "+t.T,t.g=t.d+" "+t.t,t.G=t.d+" "+t.T,t}function r(n,t){function s(n){for(var i=0;i<n.length;i++)e.push(n.charAt(i)),a>1&&a--%3==1&&e.push(t.t)}for(var h=0,f=-1,u=-1,a=0,l=0,v=-1,o=!1,y=!0,e=[],r,c,i=0;i<t.f.length;i++)r=t.f.charAt(i),(r=="0"||r=="#")&&(l+=o,r=="0"&&(o?v=l:f<0&&(f=h)),h+=!o),o=o||r==".";for(f=f<0?1:h-f,n<0&&e.push("-"),n=(Math.round(Math.abs(n)*Math.pow(10,l))/Math.pow(10,l)).toString(),u=n.indexOf("."),u=u<0?n.length:u,i=u-h,t.f.match(/^[^\.]*[0#],[0#]/)&&(a=Math.max(u,f)),c=0;c<t.f.length;c++)r=t.f.charAt(c),r=="#"||r=="0"?(i<u?(i>=0?(y&&s(n.substr(0,i)),s(n.charAt(i))):i>=u-f&&s("0"),y=!1):(v-->0||i<n.length)&&s(i>=n.length?"0":n.charAt(i)),i++):r=="."?(n.length>++i||v>0)&&e.push(t.r):r!==","&&e.push(r);return e.join("")}Number.prototype.__Format=function(n){var t=Number(this),u;if(n=="X")return Math.round(t).toString(16).toUpperCase();if(n=="x")return Math.round(t).toString(16);var f={t:msf.LC._t,r:msf.LC._r},e="0.################",i=n?n.toLowerCase():null;return i===null||i=="g"?n=e:i=="n"?n="#,"+e:i=="c"?(n=msf.LC._c,f.r=msf.LC._cr,f.t=msf.LC._ct):i=="f"&&(n="0.00"),n.indexOf(",.")!==-1&&(t/=1e3),n.indexOf("%")!==-1&&(t*=100),u=n.split(";"),t<0&&u.length>1?(t*=-1,f.f=u[1]):f.f=u[!t&&u.length>2?2:0],r(t,f)},Date.prototype.__Format=function(n){var i=this,u="",r;return n.length==1&&(n=msf.LC[n]),n.replace(/(d{1,4}|M{1,4}|yyyy|yy|HH|H|hh|h|mm|m|ss|s|tt)/g,function(){switch(arguments[0]){case"dddd":return msf.LC._d[i.getDay()];case"ddd":return msf.LC._d[i.getDay()].substr(0,3);case"dd":return t(i.getDate());case"d":return i.getDate();case"MMMM":return msf.LC._m[i.getMonth()];case"MMM":return msf.LC._m[i.getMonth()].substr(0,3);case"MM":return t(i.getMonth()+1);case"M":return i.getMonth()+1;case"yyyy":return i.getFullYear();case"yy":return i.getFullYear().toString().substr(2);case"HH":return t(i.getHours());case"hh":return t((i.getHours()-1)%12+1);case"H":return i.getHours();case"h":return(i.getHours()-1)%12+1;case"mm":return t(i.getMinutes());case"m":return i.getMinutes();case"ss":return t(i.getSeconds());case"s":return i.getSeconds();case"tt":return i.getHours()<12?"AM":"PM";default:return""}})},String.__Format=function(n){var f=arguments,u;return n.replace(/(\{*)\{((\d+)(\,(-?\d*))?(\:([^\}]*))?)\}/g,function(){var n=arguments,t;if(n[1]&&n[1].length%2==1)return n[0];if((u=f[parseInt(n[3],10)+1])===undefined)throw"Missing argument";var i=u.__Format?u.__Format(n[7]):u.toString(),r=parseInt(n[5],10)||0,e=Math.abs(r)-i.length;if(e>0){for(t=" ";t.length<e;)t+=" ";i=r>0?i+t:t+i}return n[1]+i}).replace(/\{\{/g,"{")},msf.LC=null,msf.setCulture=function(n){msf.LC=i(n)||i(n.substr(0,2))||i()},msf.setCulture(navigator.systemLanguage||navigator.language||"en-US");var n=Date.prototype;n.format=n.format||n.__Format,n=Number.prototype,n.format=n.format||n.__Format,String.format=String.format||String.__Format}(),String.prototype.format=function(){for(var t=this,n=0;n<arguments.length;n++)t=t.replace(new RegExp("\\{"+n+"\\}","g"),arguments[n]);return t},function(){var r,t,n,i;$.fn.MenuFix=function(){var n=!1;$("div.top-menu-container > ul > li").removeClass("menu-hover"),$("div.top-menu-container > ul > li > a").hoverIntent(function(){if($(this).next().length>0){$(this).next().css("display","block");var t=$(this);t.addClass("blue"),t.append('<span class="arrow"></span>')}n=!1},function(){var t=this;n||($(t).next().css("display","none"),$(t).removeClass("blue"),$(t).find(".arrow").remove())}),$("div.top-menu-container > ul > li > div").hover(function(){n=!0,$(this).prev().find(".arrow").remove(),$(this).prev().append('<span class="arrow"></span>'),$(this).css("display","block"),$(this).prev().addClass("blue")},function(){n=!1,$(this).prev().find(".arrow").remove(),$(this).css("display","none"),$(this).prev().removeClass("blue")}),typeof Modernizr=="undefined"||Modernizr.input.placeholder||($("input, textarea").not("[id='topkeywords']").placeholder(),$("#labelSearch").show(),$("#topkeywords").focus(function(){$("#labelSearch").hide()}),$("#topkeywords").blur(function(){$("#topkeywords").val()==""&&$("#labelSearch").show()}),$("#labelSearch").click(function(){$("#labelSearch").hide(),$("#topkeywords").focus()}))},$.fn.MenuFix(),$(".leftnav-container .filter-close").click(function(){if($(this).hasClass("closed")){$(this).removeClass("closed");var t=$(this).parent().parent().parent(),n=25;t.find(">li").each(function(){n+=$(this).height()}),t.animate({height:n},300)}else $(this).addClass("closed"),$(this).parent().parent().parent().animate({height:$(this).height()},300)}),$(".leftnav-container .filter-close").each(function(){$(this).parent().parent().find("a:first").click(function(){$(this).next().find("a:first").click()}),$(this).hasClass("closed")&&$(this).parent().parent().parent().css("height",$(this).parent().parent().height()+16+"px")}),r=0,$(".floating-sidebar").length!=0&&(r=$(".floating-sidebar").offset().top-parseFloat($(".floating-sidebar").css("marginTop").replace(/auto/,0)),$(window).scroll(function(){var i=$(this).scrollTop(),t=$("body").height()-($(".floating-sidebar").position().top+$(".floating-sidebar").height())-$("footer").height();i>=r&&t>=10?$(".floating-sidebar").addClass("fixed"):t<10?$(".floating-sidebar").css("margin-top",t+"px"):($(".floating-sidebar").css("margin-top","0px"),$(".floating-sidebar").removeClass("fixed"))})),t=urlParams.ctlcmp||urlParams.refid,t!=""&&t!=undefined&&(t=validateCampaignID(t.substr(0,15)),jQuery.cookie("ctlcmp",t,{expires:7,path:"/",domain:".creative.com"})),n=urlParams.refid,n!=""&&n!=undefined&&(n=validateCampaignID(n.substr(0,15)),jQuery.cookie("referral_id",n,{expires:7,path:"/",domain:".creative.com"})),i=urlParams.assoc,i!=""&&i!=undefined&&jQuery.cookie("aid",i,{path:"/",domain:".creative.com"})}(jQuery),$(function(){var i=$.cookie("newsletterPopup")==null?"0":$.cookie("newsletterPopup"),r=Math.floor(Math.random()*10)+1,n=r%5==0,t=location.href.indexOf("/newsletter/indexP")==-1&&location.href.indexOf("/newsletter/minilogin")==-1&&location.href.indexOf("secure")==-1&&i=="0";n=!1,t&&global.store.id==10&&n&&setTimeout(function(){$.fancybox({title:"Newsletter Subscription",width:680,height:530,href:"/newsletter/indexP?ref="+location.href,type:"iframe",closeBtn:!0,fitToView:!0,aspectRatio:!1,afterShow:function(){setTimeout(function(){$.fancybox.close()},18e4)},afterClose:function(){console.log("set popup cookie"),$.cookie("newsletterPopup",1,{expires:10,path:"/",domain:".creative.com"})}})},5e3)}),$(document).ready(function(){(function(n){var t,r="facebook-jssdk",i=n.getElementsByTagName("script")[0];n.getElementById(r)||(t=n.createElement("script"),t.id=r,t.async=!0,t.src="//connect.facebook.net/en_US/all.js",i.parentNode.insertBefore(t,i))})(document)}),function(n){var i={show:function(t){var f=Math.round(Math.random()*1e4),r=n('<select id="countryselector'+f+'" onchange="$(\'#countryselector'+f+"').countryChange();\"></select>"),u,e,i;if(typeof GlobalizationSelector=="object")for(r.append('<option value=""></option>'),u=0,e=GlobalizationSelector.length;u<e;u++)i=GlobalizationSelector[u],r.append('<option value="'+i.CountryID+","+i.LanguageID+","+i.RegionID+'">'+i.CountryName+"</option>");typeof t=="object"?t.html(r):n("#country-dropdown").html(r),n("#countryselector"+f).select2({formatSearching:function(){},width:"200px",dropdownCssClass:"country-menu",placeholder:res.CURRENTCOUNTRYNAME})},change:function(n){var t=n.val();t!=""&&(location.href=GetAbsoluteURL()+"/home/country?id="+t)}},t;n.fn.countrySelect2=function(){typeof n(this).attr("id")=="string"?i.show(n(this)):i.show()},n.fn.countryChange=function(){i.change(n(this))},t={init:function(){var t=this;n("#footer-newsletter").click(function(){t.showTextBox()})},showTextBox:function(){var h,c,s,e,o;n("#footer-newsletter-input").remove();var u=n("#footer-newsletter"),f=n('<div id="footer-newsletter-input"></div>').css("position","absolute").css("top",u.offset().top-5+"px").css("left",u.offset().left+"px").css("z-index","500").css("width",u.width()+50+"px").css("background-color","#F9F9F9"),i=n('<form id="footer-newsletter-form" onsubmit="return false;"></from>'),r=!1;n.browser.msie&&parseInt(n.browser.version)<9&&(r=!0,i=n("<div></div>")),h=n('<div id="footer-newsletter-submit"><a href="javascript:;" onclick="$.fn.submitEmail();" class="button-small bg-black micro" style="height:100%; padding:0 5px; display:block; line-height:32px;">'+res.SubmitButton.toString().toUpperCase()+"</a></div>").css("position","absolute").css("right","0px").css("top","0px").css("height","100%").css("margin","0"),i.append(h),c=n('<input type="text" placeholder="'+res.Email.toUpperCase()+'" class="validate[required,custom[email]]"  data-prompt-position="bottomLeft" id="footer-newsletter-textbox" autocomplete="off">').css("width",f.width()+"px"),i.append(c),r&&(s=n('<label id="labelNewsletters" class="white-grey micro" style="">'+res.your_email.toUpperCase()+"</label>").css("position","absolute").css("left","10px").css("top","6px").css("cursor","text").hide(),i.append(s)),r?n("body").append(f.append('<form id="footer-newsletter-form" action="#" onsubmit="return false;">'+i.html()+"</form>")):n("body").append(f.append(i)),n("#footer-newsletter-form").validationEngine({custom_error_messages:{"#footer-newsletter-textbox":{required:{message:res.CustomerVerify_MailError},"custom[email]":{message:res.CustomerLogin_EmailError}}},validationEventTrigger:"submit"}),n("#footer-newsletter-textbox").focus(),e=n("#footer-newsletter-input").width()-n("#footer-newsletter-submit").width(),n("#footer-newsletter-textbox").css("box-sizing","border-box").css("width",e+"px"),o=this,n("#footer-newsletter-textbox").keypress(function(n){if(n.keyCode==13)return o.submitEmail(),!1}),n("#footer-newsletter-textbox").blur(function(){setTimeout(function(){n("#footer-newsletter-textbox").val()==""&&t.submitClick==!1&&n("#footer-newsletter-input").hide("slow").remove()},200)}),r&&(n("#labelNewsletters").show(),n("#labelNewsletters").click(function(){n("#footer-newsletter-textbox").focus(),t.submitClick=!0,setTimeout(function(){t.submitClick=!1},1e3)}),n("#footer-newsletter-textbox").keyup(function(){n("#footer-newsletter-textbox").val()!=""?n("#labelNewsletters").hide():n("#labelNewsletters").show()}))},submitClick:!1,submitEmail:function(){var r=n("#footer-newsletter-textbox").val(),i=res.CURRENTCOUNTRYNAME+" - footer";return t.submitClick=!0,setTimeout(function(){t.submitClick=!1},1e3),n("#footer-newsletter-form").validationEngine("validate")&&(n.fancybox.showLoading(),this.ajaxToSubmitEmail(r,i)),!1},submitForm:function(t,i){n("#"+t).validationEngine({custom_error_messages:{".newsletter-textbox":{required:{message:res.CustomerVerify_MailError},"custom[email]":{message:res.CustomerLogin_EmailError}}},validationEventTrigger:"submit",scroll:!1});var r=n("#"+t+" .newsletter-textbox").val();return n("#"+t).validationEngine("validate")&&(n.fancybox.showLoading(),this.ajaxToSubmitEmail(r,i)),!1},ajaxToSubmitEmail:function(t,i){var r="";typeof i=="string"&&(r=i),jQuery.ajax({url:GetAbsoluteURL()+"/home/SubscribeToNewsletter?d="+Math.random(),data:{email:t,touchpoint:r},type:"POST",dataType:"json",timeout:12e3,error:function(){n.fancybox.hideLoading()},success:function(t){if(t.status=="success"){var i=GetAbsoluteURL()+"/home/newsletter?user="+t.user,r=!1;i.length>0&&location.href.toString().toLowerCase().indexOf(i)==-1&&location.href.toLowerCase().indexOf("us.store.creative.com")>0&&(i+="&parenturl=amazon",r=!0),i.length>0&&location.href.toString().toLowerCase().indexOf(i)==-1&&location.href.toLowerCase().indexOf("us.outletstore.creative.com")>0&&(i+="&parenturl=outletstore",r=!0),r?n.fancybox.open({href:i,type:"iframe",maxWidth:480,minWidth:480,minHeight:500,Height:500,maxHeight:500,closeBtn:!0,title:res.ThankYouForYourSub}):n.fancybox.open({href:i,type:"iframe",maxWidth:480,minWidth:480,minHeight:500,closeBtn:!0,title:res.ThankYouForYourSub})}else n.fancybox.open(n("<div></div>").css("width","520px").addClass("newsletter-content").append("<div>"+res.ThankYouForInterest+"</div>"),{title:res.hd_ThankYouForInterest}),n.fancybox.hideLoading()}})}},n.fn.newsLetter=function(){t.init()},n.fn.submitEmail=function(){t.submitEmail()},n.fn.submitEmailForm=function(n,i){t.submitForm(n,i)},n.fn.ajaxToSubmitEmail=function(n,i){t.ajaxToSubmitEmail(n,i)},n.fn.closeFancybox=function(){n.fancybox.close()},n.fn.showUpdateSucccessMessage=function(){n.fancybox.close();for(var i=n.fancybox.open(n("<div></div>").css("width","520px").append('<div style="padding:15px 0;">'+res.SubUpdateProfileSuccMsg+"</div>"),{title:res.ThankYouForYourSub}),t=5;t>0;)setTimeout('$("#spanTimer").text('+t.toString()+")",(5-t)*1e3),t--;setTimeout(function(){n.fancybox.close(),n("#footer-newsletter-input").hide("slow").remove()},5e3)},n.fn.openLogin=function(t,i,r){var f=res.SECURESERVER+"/account/minilogin?returnurl="+encodeURIComponent(t),u;typeof i=="string"&&(f+="&message="+encodeURIComponent("Please sign in or register for us")),u=220,i.length>130&&(u=270),i.length>220&&(u=370),i.length>320&&(u=420),n.fancybox("#miniloginform",{title:res.LoginTitle,autoResize:!1,autoHeight:!1,afterClose:function(){typeof r=="function"&&r.call()},afterShow:function(){n("#miniloginiframe").attr("src",f).attr("height",u)}}),FacebookLoginCallBack=function(){n("#miniloginiframe").attr("src",t)}},n.fn.showAmazonAccount=function(){n("#topcart a").html("")}}(jQuery),Product={addToFavourites:function(n,t,i,r){$.post(GetAbsoluteURL()+"/api/favourites",{MasterProductID:t,EncryptedCustomerID:n},function(n){n.status==="Success"?i(n):r(n)})},deleteFavourite:function(n,t,i,r){$.ajax({type:"delete",url:GetAbsoluteURL()+"/api/favourites/"+t+"?c="+encodeURI(n),success:function(){i()},error:function(){r()}})},initFavourites:function(n,t,i,r,u){var f=$._data($(n).get(0),"events");f==undefined&&$(n).click(function(n){var e=$(this).data("product-id"),f=Utility.splitParam($.cookie("ESTORE.CUSTOMER")).ID||"";Product.addToFavourites(f,e,function(r){r.message.indexOf("Removed")!==-1?i(n):t(n),u!=undefined&&u()},function(t){t.message.indexOf("Not logged in")!==-1&&r(n)}),n.preventDefault()})},popUpNotifyMe:function(n,t,i){$.fancybox(GetAbsoluteURL()+"/notifyme/?p="+n+"&c="+t+"&s="+i,{autoResize:!1,autoHeight:!1,padding:15,transitionIn:"none",transitionOut:"none",width:480,minHeight:150,type:"iframe",title:res.ProductStock_NotifyMe})},galleryChange:function(){$(".gallery-thum").click(function(){var t=$(this).data("largeimage"),n;$(".gallery-thum").removeClass("selected"),$(this).addClass("selected"),n=t.replace("width=450","width=1350").replace("height=350","height=1050"),$("#gallery-large").html($('<img src="'+t+'"  data-large="'+n+'">')),$(".magnifyarea,.preloadevt,.zoomtracker,.cursorshade,.zoomstatus,#largeZoomInIcon").remove(),Product.imageWidthCheck(n,function(){Product.imageZoomInit(n)})}),$(".gallery-thum").each(function(){var n=$(this).data("largeimage");$("<img/>").attr("src",n).load()}),this.imageWidthCheck($("#gallery-large > img:first").data("large"),function(){Product.imageZoomInit($("#gallery-large > img:first").data("large"))})},imageZoomInit:function(n){typeof window.matchMedia=="function"&&window.matchMedia("(min-width: 400px)").matches&&($(".magnifyarea,.preloadevt,.zoomtracker,.cursorshade,.zoomstatus,#largeZoomInIcon").remove(),$("#gallery-large").css("position","relative").append($('<div class="icon-zoom-in" id="largeZoomInIcon"></div>').css("position","absolute").css("bottom","25px").css("left","370px")),$("#gallery-large > img:first").addimagezoom({zoomrange:[3,3],magnifiersize:[480,350],cursorshade:!1,speed:0,largeimage:n}))},imageWidthCheck:function(n,t){if($.browser.msie){var i=parseFloat($.browser.version);i<9&&(n+="&r="+Math.random())}$("<img/>").attr("src",n).load(function(){this.width>1e3&&t.call()})},faqSubmit:function(n,t){$("#faqForm").validationEngine({custom_error_messages:{"#emailAddress":{required:{message:res.CustomerVerify_MailError},"custom[email]":{message:res.CustomerLogin_EmailError}},"#questionText":{required:{message:res.PleaseEnterYourQuestion}}},validationEventTrigger:"submit"}),$("#faqForm").submit(function(){if($("#faqForm").validationEngine("validate")){var u=$("#emailAddress").val(),r=$("#questionText").val(),i={masterProductID:n,email:u,text:r,languageID:t};$.post("/question/submit",i,function(n){n.status==="Success"?($("#emailAddress").val(""),$("#questionText").val(""),$("#response-bar #message").html(res.QuestionSubmittedSuccessfully+" "+res.NotifiedViaEmailWhenAnswered).parent().show()):$("#response-bar #message").html(res.FailedMsg).parent().show()})}return!1})}},function(n){var u={show:function(t){t==null||t.length==0?n("#specifications-holder").parent().remove():n("#specifications-holder").append(this.getHtml(t))},getHtml:function(n){for(var i="",t=0;t<n.length;t++)i+='<li><span class="feature micro dark-grey">'+n[t].Title+'</span><span class="description micro">'+n[t].Values+"</span></li>";return i},showMore:function(t,i,r,u){n.fancybox.showLoading(),n.getScript(u+"/CompareChartApi/getdata.aspx?action=getcompareresult&categoryid="+t+"&languageid="+i+"&masterproductid="+r+"&callback=$.fn.specificationCallback")},showMore4Html:function(){var t=n("<div class='fancybox-specifications'></div>");t.append("<ul>"+n("#specifications-holder").html()+"</ul>"),t.find("li:last").remove(),t.find("li:first").remove(),t.find("li").show(),n.fancybox.open(t,{title:res.Page_technicalSpecifications.toString().toUpperCase()})}},t,i,r;n.fn.showspecifications=function(n){u.show(n)},n.fn.specificationShowMore=function(n,t,i,r){typeof n=="number"&&typeof t=="number"&&typeof i=="number"&&typeof r=="string"?u.showMore(n,t,i,r):u.showMore4Html()},n.fn.specificationCallback=function(t){for(var e=n("<div class='fancybox-specifications'></div>"),f=n("<ul></ul>"),h=t.Results,i,r,o,u=0,s=h.length;u<s;u++)for(i=h[u],f.append('<li><span class="blue">'+i.Name+"</span></li>"),r=0,o=i.Values.length;r<o;r++)f.append('<li><span class="feature micro dark-grey">'+i.Values[r].Name+'</span><span class="description micro">'+i.Values[r].Values+"</span></li>");e.append(f),n.fancybox.hideLoading(),n.fancybox.open(e,{title:res.Page_technicalSpecifications.toString(),maxHeight:400})},t={onhover:!1,init:function(){var i=10,r=n(window).width();r>1100?(i=(r-960)/2-80,n("#navigation").show()):n("#navigation").hide(),i>0?n("#navigation").css("left",parseInt(i)+"px"):n("#navigation").css("left","5px"),t.focus(),n(window).scroll(function(){t.focus()})},hover:function(){n("#navigation ul li a").hover(function(){var t,r,i;this.onhover==!1&&(this.onhover=!0,t=n(this).find("span"),r=n(t).width(),n(t).css("width","38px"),n(t).animate({width:r},300),i=this,setTimeout(function(){i.onhover=!1},300))})},userclick:!1,click:function(){n("#navigation ul li a").click(function(){var i,r;return t.userclick=!0,i=n(this).attr("href"),i.indexOf("#")>=0?(r=n(i).offset().top,n("html,body").animate({scrollTop:r},1e3,function(){t.userclick=!1,t.focus()}),!1):void 0})},focus:function(){var t,i;this.userclick||(t=n(document).scrollTop()+300,n("#navigation > ul > li > a").removeClass("selected"),i=0,n("#navigation > ul > li > a").each(function(){var r=n(this).attr("href"),u;r.indexOf("#")>=0&&typeof n(r).offset()!="undefined"&&typeof n(r).offset().top!="undefined"&&(u=n(r).offset().top-i*35,t>u&&t<=u+n(r).parent().height()?n(this).addClass("selected"):t>200&&t<700&&n("#navigation > ul > li > a.top").addClass("selected")),i++}))}},n.fn.scrollBar=function(){t.init(),t.hover(),t.click()},n(window).resize(function(){t.init()}),i=0,r="",n.fn.reviewReadMore=function(t){var f,u,e;if(n("#reviewreadmore"+t).attr("close")=="true"){if(f=n("#reviewlist"+t).height(),i=f,r=n("#reviewreadmore"+t).html(),i==0)for(u=0;u<3;u++)n("#reviewlist"+t+" li").eq(u).length>0&&n("#reviewlist"+t+" li").eq(u).height()>i&&(i=n("#reviewlist"+t+" li").eq(u).height());n("#reviewlist"+t).css("height",f+"px").css("overflow","hidden"),n("#reviewlist"+t+" li").show(),n(".reviewfixblank").remove(),n("#reviewlist"+t).append('<div class="clearfix reviewfixblank"></div><li class="reviewfixblank"></li>'),e=n("#reviewlist"+t+" li:last").offset().top-n("#reviewlist"+t+" li:first").offset().top,n("#reviewlist"+t).animate({height:e},600),n("#reviewreadmore"+t).html(res.Continue.toUpperCase()),n("#reviewreadmore"+t).attr("close","false"),n("#reviewenglishbutton"+t).length>0?(n("#reviewenglishbutton"+t).show(),n("#reviewreadmore2"+t).attr("close","true")):n("#englishreviews"+t).length>0&&n("#englishreviews"+t).show(function(){n("html,body").animate({scrollTop:n("#englishreviews"+t).offset().top},500)})}else n("#reviewlist"+t).animate({height:i},600),n("#englishreviews"+t).hide(),n("#reviewenglishbutton"+t).hide(),n("#reviewreadmore"+t).attr("close","true"),r!=""?n("#reviewreadmore"+t).html(r):n("#reviewreadmore"+t).html(res.ReadMore.toUpperCase()),n("html,body").animate({scrollTop:n("#reviewlist"+t).offset().top},1e3)},n.fn.reviewReadMore2=function(t){var r=n("#englishreviews"+t).height(),i;n("#englishreviews"+t).css("height",r+"px").css("overflow","hidden"),n("#englishreviews"+t).show(),n(".reviewfixblank2").remove(),n("#englishreviews"+t).append('<div class="clearfix reviewfixblank2"></div><li class="reviewfixblank2"></li>'),i=n("#englishreviews"+t+" li:last").offset().top-n("#englishreviews"+t+" li:first").offset().top+n("#englishreviews"+t+" > h2:first").height()+50,n("#englishreviews"+t).animate({height:i},600),n("#reviewreadmore2"+t).attr("close","false"),n("#reviewenglishbutton"+t).hide(),n("#reviewreadmore"+t).html(res.Continue.toUpperCase()),n("#reviewreadmore"+t).attr("close","false")},n.fn.favouritecheck=function(t){t?n(".btn-fav").addClass("btn-favourited-heart"):n(".btn-fav").removeClass("btn-favourited-heart")}}(jQuery),shoponlineTimeout=null,function(n){var t={init:function(n,t,i){this.check(n,i)},check:function(t,i){n.getJSON(i+"/products/getpricebyid?masterproductids="+t+"&callback=?",{},function(t){if(t.length>0&&t[0].Price>.01&&t[0].EStoreBuyURL.length>0){var r=i+t[0].EStoreBuyURL;n(".productspotlight .ptext .estorebuy").append(n("<a href=\"javascript:$.fn.shopOnlineClick('"+r+'\');" class="buy white button-small bg-red epsilon margin-bottom-20">'+res.shoponline+"</a>")),n("#navigation > ul").append(n(" <li><a href=\"javascript:$.fn.shopOnlineClick('"+r+'\');" class="estorebuy micro"><span class="bg-blue white">'+res.ProductBuy+"</span></a></li>"))}})},click:function(t){var r=n.cookie("LightboxBuy"),i;r!=null&&r.toString().toLowerCase()=="no"?location.href=t:(i='<div style="padding:15px; text-align:center;"><p>'+res.BeingRedirected.replace("{0}",t)+"</p><p>"+res.ProvideInformation+"</p><p>"+res.shoponlieclickhere.replace("{0}",t)+'</p><p><input type="checkbox" onclick="$.fn.disableShopOnline()" /> '+res.shoponlineshowmessage+"</p></div>",n.fancybox.open(i,{title:"&nbsp;",beforeClose:function(){clearTimeout(shoponlineTimeout)}}),shoponlineTimeout=setTimeout("$.fn.shopOnlineRedirect('"+t+"');",5e3))},setCookie:function(){n.cookie("LightboxBuy","no",{expires:30,path:"/"})},redirectClosed:!1,redirect:function(n){this.redirectClosed||(location.href=n)}};n.fn.shopOnlineButton=function(n,i){global.store.shoponline!=null&&global.store.shoponline.length>0&&t.init(n,i,global.store.shoponline)},n.fn.shopOnlineClick=function(n){t.click(n)},n.fn.disableShopOnline=function(){t.setCookie()},n.fn.shopOnlineRedirect=function(n){t.redirect(n)},typeof global!="undefined"&&global!=null&&global.store.contactusurl!=null&&global.store.contactusurl.length>0&&n(".contactuslink").attr("href","javascript:$.fn.shopOnlineClick('"+global.store.contactusurl+"');")}(jQuery),$(document).ready(function(){var r,i;jQuery(".features-contents a.fancybox").fancybox({title:"&nbsp;",autoSize:!0,autoResize:!0,autoHeight:!0,type:"iframe",height:280,width:500}),jQuery(".features-contents a.fancyboxImg").fancybox({title:"&nbsp;",autoSize:!0,autoResize:!0,autoHeight:!0}),jQuery(".section-review a.fancybox").fancybox({title:res.WriteReview,maxWidth:660,maxHeight:530,autoSize:!0,autoResize:!0,autoHeight:!0,autoCenter:!0}),jQuery(".product-navigation ul li a.fancybox").fancybox({title:res.WriteReview,maxWidth:660,maxHeight:530,autoSize:!0,autoResize:!0,autoHeight:!0,autoCenter:!0}),typeof window.addEventListener=="function"&&window.addEventListener("message",function(n){var u,t,r,i;n.data==="closed"&&$.fancybox.close(),n.data.indexOf("resize")>=0&&(n.data.split("-")[1]=="height"&&(u=n.data.split("-")[2],$(".fancybox-inner").height(parseInt(u))),n.data.split("-")[1]=="width"&&(t=n.data.split("-")[2],$(".fancybox-inner").width(parseInt(t)),$(".fancybox-wrap").width(parseInt(t)),r=$(window).height()/2-$(".fancybox-wrap").outerHeight()/2,i=$(window).width()/2-$(".fancybox-wrap").outerWidth()/2,$(".fancybox-wrap").css({top:r,left:i})))},!1),location.href.toLowerCase().indexOf("us.store.")==-1&&$(window).width()>600&&($(".slides-flexibility").length>0&&$(".slides-flexibility").slidesjs({navigation:{active:!1}}),$(".slides-perfect-audio").length>0&&$(".slides-perfect-audio").slidesjs({width:940,height:670,navigation:{active:!1}}),$(".slides-span8").length>0&&$(".slides-span8").slidesjs({width:940,height:518,navigation:{active:!1}}),$(".slides-grid12").length>0&&$(".slides-grid12").slidesjs({width:940,height:518,navigation:{active:!1}}),$(".slides-grid8").length>0&&$(".slides-grid8").slidesjs({width:940,height:518,navigation:{active:!1}}),$(".slides-grid6").length>0&&$(".slides-grid6").slidesjs({width:940,height:518,navigation:{active:!1}}),$(".slides-grid4").length>0&&$(".slides-grid4").slidesjs({width:940,height:518,navigation:{active:!1}}),$("#slides-modes").length>0&&(r=$("#slides-modes > div").length,$("#slides-modes").slidesjs({width:940,height:460,navigation:{active:!1},pagination:{active:!1},callback:{complete:function(n){n===r?($("#arrow-left").show(),$("#arrow-right").hide()):n===1?($("#arrow-left").hide(),$("#arrow-right").show()):($("#arrow-left").show(),$("#arrow-right").show())}}})),$("#slides-modes2").length>0&&(i=$("#slides-modes2 > div").length,$("#slides-modes2").slidesjs({width:940,height:460,navigation:{active:!1},pagination:{active:!1},callback:{complete:function(n){n===i?($("#arrow-left2").show(),$("#arrow-right2").hide()):n===1?($("#arrow-left2").hide(),$("#arrow-right2").show()):($("#arrow-left2").show(),$("#arrow-right2").show())}}})),$("#slides-tactic3d-control-panel").length>0&&(r=$("#slides-tactic3d-control-panel > div").length,$("#slides-tactic3d-control-panel").slidesjs({width:940,height:311,navigation:{active:!1},pagination:{active:!1},callback:{loaded:function(){$(".slidesjs-play").hide(),$(".slidesjs-stop").hide(),t=($("#slides-tactic3d-control-panel").height()-$("#arrow-left").height())/2,$("[id^=arrow-]").css("top",t)},complete:function(n){$(".slidesjs-play").hide(),$(".slidesjs-stop").hide(),n===r?($("#arrow-left").show(),$("#arrow-right").hide()):n===1?($("#arrow-left").hide(),$("#arrow-right").show()):($("#arrow-left").show(),$("#arrow-right").show())}}})),$("#slides-modes-21677").length>0&&(i=$("#slides-modes-21677 > div").length,$("#slides-modes-21677").slidesjs({width:940,height:383,navigation:{active:!1},pagination:{active:!1},callback:{loaded:function(){t=($("#slides-modes-21677").height()-$("#arrow-left").height())/2,$("[id^=arrow-]").css("top",t)},complete:function(n){var r,t;console.log(n),n===i?($("#arrow-left-21677").show(),$("#arrow-right-21677").hide()):n===1?($("#arrow-left-21677").hide(),$("#arrow-right-21677").show()):($("#arrow-left-21677").show(),$("#arrow-right-21677").show(),Modernizr.video&&(r='<video id="video1" style="border:none"><source src="http://img.creative.com/inline/products/21677/fea_nfc_2.mp4" type="video/mp4"><source src="http://img.creative.com/inline/products/21677/fea_nfc_2.ogv" type="video/ogg"><source src="http://img.creative.com/inline/products/21677/fea_nfc_2.webm" type="video/webm"><img src="http://img.creative.com/inline/products/21677/fea_nfc_2.jpg"/></video>',$("#fea_nfc_2").replaceWith(r),t=document.getElementById("video1"),t.play()))}}})))}),function(n){n(".features-contents div").hasClass("media")==!0&&n(".features-contents div.media").each(function(){var t=n(this),f=t.text().substr(0,1),u=t.text().substr(t.text().length-1,1),r,i;if(f=="["&&u=="]"){r=t.text().substr(1,t.text().length-2),i=r.split(",");switch(i[0].toLowerCase()){case"youtube":t.removeClass("hidden"),t.html('<iframe width="'+i[2]+'" height="'+i[3]+'" src="'+i[1]+'" frameborder="0" allowfullscreen></iframe>');break;case"mp3":t.removeClass("hidden"),t.html('<audio controls="controls" preload="auto"><source src="'+res.IMAGESERVER+i[1]+'" type="audio/mpeg">[<em>Your browser does not support the audio element.</em>]</audio>');break;case"ogg":t.removeClass("hidden"),t.html('<audio controls="controls" preload="auto"><source src="'+res.IMAGESERVER+i[1]+'" type="audio/ogg">[<em>Your browser does not support the audio element.</em>]</audio>');break;case"wav":t.removeClass("hidden"),t.html('<audio controls="controls" preload="auto"><source src="'+res.IMAGESERVER+i[1]+'" type="audio/wav">[<em>Your browser does not support the audio element.</em>]</audio>')}}})}(jQuery),function(n){n.productSelector=function(n,t,i){this.init(n,t,i)},n.productSelector.prototype={_self:null,masterProductJson:null,selectedValue:[],buttonCallback:null,containsProducts:[],excludesProducts:[],showPrice:null,selectedID:0,lightbox:!1,init:function(t,i,r){this.initOption(r),this._self=i,this.masterProductJson=t,this.filterProduct(),this._self.find(".product-selector").html(this.loadAttributeKey(this.masterProductJson.ProductAttributes)),this.selectProductByID(this.getDefaultProduct()),t.Favourited&&this._self.find(".button-fav-"+t.MasterProductID).addClass("btn-favourited-heart");var i=this;this._self.find(".product-button-notifyme").click(function(){i.notifyMe(t.CountryID,t.StoreID)}),this._self.find(".product-buttons").show(),this._self.find(".product-button-addtocart").click(function(){i.addToCart(),n.fancybox.close()})},initOption:function(n){this.selectedValue=[],this.containsProducts=[],this.excludesProducts=[],this.showPrice=null,n!=null&&(typeof n.buttonCallback=="function"&&(this.buttonCallback=n.buttonCallback),n.containsProducts!=null&&typeof n.containsProducts!="undefined"&&n.containsProducts.length>0&&(this.containsProducts=n.containsProducts),n.excludesProducts!=null&&typeof n.excludesProducts!="undefined"&&n.excludesProducts.length>0&&(this.excludesProducts=n.excludesProducts),n.showPrice!=null&&typeof n.showPrice!="undefined"&&(this.showPrice=n.showPrice),n.selectedID!=null&&typeof n.selectedID!="undefined"&&(this.selectedID=n.selectedID),n.lightbox!=null&&typeof n.lightbox!="undefined"&&(this.lightbox=n.lightbox))},filterProduct:function(){var r,f,e,t,u,i,o;if(this.containsProducts.length>0&&this.masterProductJson.Products.length>0){for(r=[],t=0,u=this.masterProductJson.Products.length;t<u;t++)n.inArray(this.masterProductJson.Products[t].ProductID,this.containsProducts)>=0&&r.push(this.masterProductJson.Products[t]);this.masterProductJson.Products=r}if(this.excludesProducts.length>0&&this.masterProductJson.Products.length>0){for(r=[],t=0,u=this.masterProductJson.Products.length;t<u;t++)n.inArray(this.masterProductJson.Products[t].ProductID,this.excludesProducts)<0&&r.push(this.masterProductJson.Products[t]);this.masterProductJson.Products=r}if(this.excludesProducts.length>0&&this.masterProductJson.ProductAttributes.length>0)for(f=0;f<this.excludesProducts.length;f++)for(e=this.excludesProducts[f],t=0,u=this.masterProductJson.ProductAttributes.length;t<u;t++)for(i=0,o=this.masterProductJson.ProductAttributes[t].Attributes.length;i<o;i++)typeof this.masterProductJson.ProductAttributes[t].Attributes[i]!="undefined"&&n.inArray(e,this.masterProductJson.ProductAttributes[t].Attributes[i].ProductIDs)>=0&&(this.masterProductJson.ProductAttributes[t].Attributes[i].ProductIDs.splice(n.inArray(e,this.masterProductJson.ProductAttributes[t].Attributes[i].ProductIDs),1),this.masterProductJson.ProductAttributes[t].Attributes[i].ProductIDs.length==0&&this.masterProductJson.ProductAttributes[t].Attributes.splice(i,1))},getDefaultProduct:function(){var i=this.masterProductJson.SelectedID,t,n,r;if(this.selectedID!=null&&this.selectedID>0&&(i=this.selectedID),t=this.getProduct(i),t==null||!t.InStock||i==0){for(n=0,r=this.masterProductJson.Products.length;n<r;n++)if(this.masterProductJson.Products[n].InStock)return this.masterProductJson.Products[n].ProductID;if(t==null&&this.masterProductJson.Products.length>0)return this.masterProductJson.Products[0].ProductID}return i},loadAttributeKey:function(t){for(var l=n("<div></div>"),y=this,i,c,u,f,v,r,s,e,h,o=0,a=t.length;o<a;o++){for(i=t[o],i.KeyID==2?i.Title=res.txtCapacities:i.KeyID==1?i.Title=res.txtColors:i.KeyID==4&&(i.Title=res.txtPlug),c=n('<div class="product-selector-title bold">'+i.Title+"</div>"),u=n("<ul></ul>"),f=0,v=i.Attributes.length;f<v;f++)if(r=i.Attributes[f],r.ProductIDs.length!=0){for(s=!1,e=0;e<r.ProductIDs.length;e++)if(h=this.getProduct(r.ProductIDs[e]),h!=null&&h.ProductID>0){s=!0;break}s&&(i.KeyID==2?this.getCapacity(r).appendTo(u):i.KeyID==1?this.getColor(r).appendTo(u):this.getAttr(r).appendTo(u))}c.append(u),l.append(c)}return l},getCapacity:function(t){for(var i=null,o,u,f,r=0,e=t.ProductIDs.length;r<e,i==null;r++)i=this.getProduct(t.ProductIDs[r]);return o=this,u=n('<a href="javascript:;" class="selector-attr-item" data-akey="'+t.AttributeKeyID+'" data-avalue="'+t.AttributeValueID+'"  data-productids="'+t.ProductIDs.toString()+'"></a>').click(function(){o.select(t.AttributeKeyID,t.AttributeValueID)}).append('<span class="checkbox"><span></span></span>').append('<span class="capacity">'+t.AttributeValueName+"</span>").append('<span class="realprice">'+i.PriceFormat+"</span>"),i.ListPrice>i.Price&&u.append('<span class="listprice">'+i.ListPriceFormat+"</span>"),f=n('<li class="checkbox-selector"></li>').append(u)},getColor:function(t){var r=this;return n('<li class="color-selector"></li>').css("margin-right","15px").append(n('<a href="javascript:;" data-akey="'+t.AttributeKeyID+'" data-avalue="'+t.AttributeValueID+'" data-productids="'+t.ProductIDs.toString()+'"  class="selector-attr-item color-selector-'+t.AttributeValueID+'" style="background-image:url('+res.IMAGESERVER+"/images/products/attribute/colour_square_"+t.AttributeValueID+'.gif)"></a>').click(function(){r.select(t.AttributeKeyID,t.AttributeValueID)}))},getAttr:function(t){var r=this;return n('<li class="checkbox-selector"></li>').append(n('<a href="javascript:;" class="selector-attr-item" data-akey="'+t.AttributeKeyID+'" data-avalue="'+t.AttributeValueID+'" data-productids="'+t.ProductIDs.toString()+'"></a>').click(function(){r.select(t.AttributeKeyID,t.AttributeValueID)}).append('<span class="checkbox"><span></span></span>').append(t.AttributeValueName))},getProduct:function(n){for(var i,t=0,r=this.masterProductJson.Products.length;t<r;t++)if(i=this.masterProductJson.Products[t],parseInt(n)==i.ProductID)return i;return null},select:function(n,t){this.addValue(n,t),this.selectDom(n,t);var i=this.selectProduct();this.hideAttr(n,t),this.selectDomByProductID(i),this.setPriceInfo(i),this.setPictureByProductID(i)},selectDom:function(t,i){var r=this;this._self.find(".selector-attr-item").each(function(){n(this).data("akey")==t&&(n(this).data("avalue")==i?n(this).addClass("selected"):n(this).removeClass("selected"))})},selectDomByProductID:function(t){var i=this;this._self.find(".selector-attr-item").each(function(){n(this).data("productids").toString().indexOf(t.toString())>=0?n(this).addClass("selected"):n(this).removeClass("selected")})},hideDom:function(t,i){this._self.find(".selector-attr-item").each(function(){n(this).data("akey")==t&&n(this).data("avalue")==i&&n(this).parent().hide()})},showDom:function(t,i){this._self.find(".selector-attr-item").each(function(){n(this).data("akey")==t&&n(this).data("avalue")==i&&n(this).parent().show()})},addValue:function(n,t){for(var r,i=0,u=this.selectedValue.length;i<u;i++){if(this.selectedValue[i].key==n&&this.selectedValue[i].value==t)return;if(this.selectedValue[i].key==n){this.selectedValue[i].value=t,this.selectedValue[i].product=this.getProductIDByKeyAndValue(n,t);return}}r={key:n,value:t,product:this.getProductIDByKeyAndValue(n,t)},this.selectedValue.push(r)},getProductIDByKeyAndValue:function(t,i){for(var o=this.masterProductJson.ProductAttributes,r,u,e,f=0,s=o.length;f<s;f++)if(r=o[f],r.KeyID==t)for(u=0,e=r.Attributes.length;u<e;u++)if(r.Attributes[u].AttributeValueID==i)return n.unique(r.Attributes[u].ProductIDs)},selectProduct:function(){for(var t=[],r,s,o,u,h,i,e,n=0,f=this.selectedValue.length;n<f;n++)if(typeof this.selectedValue[n].product!="undefined")for(r=0,s=this.selectedValue[n].product.length;r<s;r++){for(o=!1,u=0,h=t.length;u<h;u++)t[u].productid==this.selectedValue[n].product[r]&&(t[u].rank++,o=!0);o||t.push({productid:this.selectedValue[n].product[r],rank:1})}for(i=0,e=0,n=0,f=t.length;n<f;n++)t[n].rank>e&&(i=t[n].productid,e=t[n].rank);return i==0&&(i=this.masterProductJson.SelectedID),i},hideAttr:function(t,i){for(var a=this.masterProductJson.ProductAttributes,s=[],v=!1,u,r,f,l,h,o,c,e=0,y=a.length;e<y;e++)if(u=a[e],u.KeyID==t)for(r=0,f=u.Attributes.length;r<f;r++)u.Attributes[r].AttributeValueID==i&&(s=u.Attributes[r].ProductIDs,v=!0);else if(v)for(r=0,f=u.Attributes.length;r<f;r++){for(l=u.Attributes[r].ProductIDs,h=!1,o=0,c=s.length;o<c;o++)if(n.inArray(s[o],l)>=0){h=!0;break}h?this.showDom(u.KeyID,u.Attributes[r].AttributeValueID):this.hideDom(u.KeyID,u.Attributes[r].AttributeValueID)}},selectProductByID:function(t){var f=this.masterProductJson.ProductAttributes,u,o,i,r,e;if(f.length==0)this.setPriceInfo(t),this.setPictureByProductID(t);else for(u=0,o=f.length;u<o;u++)for(i=f[u],r=0,e=i.Attributes.length;r<e;r++)n.inArray(t,i.Attributes[r].ProductIDs)>=0&&this.select(i.KeyID,i.Attributes[r].AttributeValueID)},setPriceInfo:function(t){var i=this.getProduct(t),u,o,r,e;if(typeof i!="undefined"&&i!=null){if(u="",i.ListPrice>i.Price&&i.ListPrice>.01&&(u='<span class="del">'+i.ListPriceFormat+"</span>"),o=!1,this.showPrice!=null)if(typeof this.showPrice=="object")for(r=0;r<this.showPrice.length;r++)this.showPrice[r].ProductID==t&&(this._self.find(".masterproduct-price").html(this.showPrice[r].Price),o=!0);else u==""&&i.Price>.01&&(u='<span class="del">'+i.PriceFormat+"</span>"),this._self.find(".masterproduct-price").html(this.showPrice+u),o=!0;if(o||(!this.lightbox&&location.href.toString().toLowerCase().indexOf("utm_source=qrcode")>0&&i.ListPrice>i.Price?this._self.find(".masterproduct-price").html(i.ListPriceFormat+'<span> <a href="javascript:;" onclick="$(\'#'+this._self.attr("id")+" .masterproduct-price').html($('#qr-promoprice').html())\" style=\"font-size:12px; font-weight: normal;\">"+res.showpromoprice+'</a></span><span id="qr-promoprice" style="display:none;">'+i.PriceFormat+u+"</span>"):(this._self.find(".masterproduct-price").html(i.PriceFormat+u),i.PriceAfterGST!=""&&this._self.find(".masterproduct-price").append('<span style="font-size:14px;display:block;color:#666;">'+i.PriceAfterGST+"</span>"))),this._self.find(".masterproduct-available").html(i.Available),i.FreeShipping?this._self.find(".masterproduct-freeshipping").show():this._self.find(".masterproduct-freeshipping").hide(),this._self.find(".product-message").remove(),this._self.find(".product-freeitem").remove(),i.FreeItems!=null&&i.FreeItems.length>0){var s=n('<div class="product-message normal"></div>'),f=0,h=n('<p style="margin-top:5px" class="grey micro caps"></p>');for(r=0,e=i.FreeItems.length;r<e;r++)h.append(i.FreeItems[r].Name),r<i.FreeItems.length-1&&h.append(", "),i.FreeItems[r].MaxQuantity>f&&(f=i.FreeItems[r].MaxQuantity);f>0&&i.FreeItems.length>1?s.append('<p class="title bold" style="line-height:1.3">'+res.txt_selectfreeitem.toUpperCase().replace("{0}",f)+"</p>"):s.append('<p class="title bold" style="line-height:1.3">'+res.txtFreeItem.toUpperCase()+"</p>"),s.append(h),this._self.find(".product-saleinfo").append(s)}if(i.Message!=null&&i.Message.length>0)for(r=0,e=i.Message.length;r<e;r++)this._self.find(".product-saleinfo").append(n('<div class="product-message"><p class="title bold">'+i.Message[r].Title+'</p><p class="grey micro">'+i.Message[r].Message+"</p></div>"));i.TradeIn&&this._self.find(".product-saleinfo").append(n('<div class="product-message button-small bg-black" style="padding-top:0;" onclick="$.fn.tradeIn();">'+res.tradindesc+'&nbsp;&nbsp;&nbsp;<i class="icon-question-sign white epsilon"></i></div>')),this.masterProductJson.MasterProductID==21543&&location.href.toString().toLocaleLowerCase().indexOf("utm_campaign=airwavehd")>0&&global.store.id==12&&this._self.find(".product-saleinfo").append(n('<div class="product-message"><p class="title bold" style="margin:0;">Limited time offer:</p><p class="grey micro caps" style="margin:0;">Buy now &amp; get 20% off Creative Airwave HD.<br>Use Promo Code: <strong>YOUTUBE</strong></p></div>')),this.masterProductJson.BundleContent!=null&&this.masterProductJson.BundleContent!=""&&this._self.find(".product-bundlecontent .list").html(this.masterProductJson.BundleContent).parent().show(),i.InStock?(this._self.find(".product-button-addtocart").show(),this._self.find(".product-button-notifyme").hide()):(this._self.find(".product-button-addtocart").hide(),this._self.find(".product-button-notifyme").show()),typeof n.fn.loadLightningDeal!="undefined"&&n.fn.loadLightningDeal(t,this.masterProductJson.StoreID,this.masterProductJson.MasterProductID)}},setPictureByProductID:function(n){this.lightbox?this._self.find(".product-largeimage").html('<img src="'+res.IMAGESERVER+"/images/products/large/pdt_"+n+'.png.ashx?width=160&height=160">'):this._self.find(".product-largeimage").html('<img src="'+res.IMAGESERVER+"/images/products/large/pdt_"+n+'.png.ashx?width=450&height=350">')},notifyMe:function(n,t){var i=this.selectProduct();Product.popUpNotifyMe(i,n,t)},addToCart:function(){var n=this.selectProduct();this.buttonCallback!=null&&typeof this.buttonCallback=="function"?this.buttonCallback.call(this,n):i.showMiniCart(n)}};var i={showMiniCart:function(t){var i,u,r;n("#minishoppingcart").remove(),i=n('<div id="minishoppingcart"></div>'),n("<div></div>").css("position","absolute").css("left","0px").css("top","-15px").css("height","15px").css("width","100%").css("background-color","#FFF").appendTo(i),n('<span class="remove" id="minishoppingcart-remove"><a onclick="$.fn.miniShoppingCartClose();" href="javascript:;"></a></span>').appendTo(i),u=n("<div></div>").css("height","100px").css("text-align","center").css("padding-top","50px").append('<img src="/content/images/loadinganimation.gif">'),r=n('<div id="minishoppingcart-body"></div>'),r.html(u),i.append(r),n("#topcart").append(i),window.scrollTo(0,0),this.ajaxToAddProduct(t)},ajaxToAddProduct:function(t){jQuery.ajax({url:GetAbsoluteURL()+"/shoppingcart/minicart/"+t+"?d="+Math.random(),type:"GET",dataType:"html",timeout:12e4,error:function(){n("#minishoppingcart-body").html(n("<div>"+res.FailedMsg+"</div>").css("text-align","center").css("padding","50px 20px")),n("#minishoppingcart-remove").show()},success:function(t){n("#minishoppingcart-body").html(t),n("#minishoppingcart-remove").show()}})}},r={show:function(t,i){i=i||{},n.fancybox.showLoading(),this.ajaxToGetProduct(t,i)},ajaxToGetProduct:function(t,i){var r=this;jQuery.ajax({url:GetAbsoluteURL()+"/productpriceapi/GetMasterProductJson?MasterProductID="+t+"&d="+Math.random(),type:"GET",dataType:"json",timeout:12e4,error:function(){n.fancybox.hideLoading()},success:function(t){t=r.fixImageUrl(t),n.fancybox.open(r.getHtml(t,i),{title:res.txtQuickGlance}),i.lightbox=!0,n("#MasterLightbox"+t.MasterProductID).productSelector(t,i),n.fancybox.hideLoading()}})},isMobile:function(){return typeof window.matchMedia!="undefined"&&window.matchMedia("(max-width: 400px)").matches?!0:!1},fixImageUrl:function(n){if(n.Image=n.Image.replace("width=450&height=350","width=160&height=160"),n.Gallery!=null&&n.Gallery.length>0)for(var t=0,i=n.Gallery.length;t<i;t++)n.Gallery[t].LargeImage=n.Gallery[t].LargeImage.replace("width=450&height=350","width=160&height=160");return n},getHtml:function(t,i){var u=n('<div id="MasterLightbox'+t.MasterProductID+'" class="productlightbox"></div>').css("width","580px"),f,r,e;return this.isMobile()&&u.css("width","260px"),f=n('<div style="width:165px; float:left; padding-top:10px;"></div>'),this.isMobile()&&f.css("width","90%").css("float","none").css("pading","0"),f.append('<div class="product-largeimage text-center"><a href="'+t.FriendlyURL+'"><img src="'+t.Image+'" width="160" height="160" /></a></div>'),u.append(f),r=n('<div style="float:right; width:410px; min-height:250px; padding:10px 0 60px 0; position:relative;"></div>'),this.isMobile()&&r.css("width","90%").css("float","none").css("padding","0").css("padding-bottom","30px").css("min-height","100px"),r.append('<div><h4 class="grey caps no-top-margin no-bottom-margin"><a href="'+t.FriendlyURL+'">'+t.MasterProductName+'&nbsp;&nbsp;<i class="icon-external-link" style="font-size:0.75em"></i></a></h4></div>'),r.append('<div class="margin-bottom-10">'+t.Description+"</div>"),r.append('<div style="padding-bottom:0px">'+(this.hasCapacity(t)?"":'<p class="price beta dark-grey masterproduct-price margin-bottom-10 caps" style="padding:0"></p>')+(typeof global!="undefined"&&global.store.amazon?"":'<p class="dark-grey masterproduct-available no-top-margin" style="padding:0;margin-bottom:10px;"></p>')+"</div>"),r.append('<div class="product-selector micro"></div><div class="clearfix"></div><div class="product-bundlecontent" style="display:none;"><p style="letter-spacing:1px" class="bold micro caps no-top-margin no-bottom-margin">'+res.txtBundleContains+'</p><div class="list"></div></div><div class="product-saleinfo"></div>'),e=res.AddtoCart,i!=null&&i.buttonText!=null&&i.buttonText!=""&&(e=i.buttonText),r.append('<div style="position:absolute; right:0px; bottom:15px; display:none;" class="product-buttons"><a href="'+t.FriendlyURL+'" class="button-small bg-grey" style="margin-right:10px">&laquo; '+res.Page_features+'</a><a href="javascript:;" class="button-small white bg-red product-button-addtocart">'+e+'</a><a href="javascript:;" class="button-small white bg-grey product-button-notifyme" style="display:none;">'+res.ProductStock_NotifyMe.toUpperCase()+"</a></div>"),u.append(r),u.append('<div class="clearfix"></div>'),u},hasCapacity:function(n){var r=!1,t,i;if(n.ProductAttributes!=null)for(t=0,i=n.ProductAttributes.length;t<i;t++)if(n.ProductAttributes[t].KeyID==2)return!0;return r}},u={show:function(t,i){n.fancybox.showLoading(),this.ajaxToGetProduct(t,i)},loadHtml:function(t){var e=n('<div class="freeshipping-threshold"></div>').css("width","600px"),f,r,o,u;for(e.append('<div class="describe">'+res.RECOMMENDEDBOX_DESCRIBE+"</div>"),f=n("<ul></ul>"),r=0,o=t.length;r<o&&r<3;r++)u=n("<li></li>"),u.append('<div><img src="'+res.IMAGESERVER+"/images/products/large/pdt_"+t[r].MasterProductID+'.png.ashx?width=120&height=120"></div>'),u.append('<div class="dark-grey font-raleway bold micro" style="min-height:40px;">'+t[r].ProductName+"</div>"),u.append('<div class="price dark-grey">'+t[r].Price+'<span class="del">'+t[r].ListPrice+"</div>"),u.append('<div><a href="javascript:;" onclick="$.fn.addToShoppingCart('+t[r].ProductID+');" class="button-small bg-red micro">'+res.AddtoCart+"</a></div>"),f.append(u);return e.append(f),e},ajaxToGetProduct:function(t,i){var r=this;jQuery.ajax({url:GetAbsoluteURL()+"/shoppingcart/recommendbyprice?price="+t+"&d="+Math.random(),type:"GET",dataType:"json",timeout:12e4,error:function(){n.fancybox.hideLoading()},success:function(t){n.fancybox.open(r.loadHtml(t,i),{title:res.RECOMMENDEDBOX_TITLE.replace("{0}",i)}),n.fancybox.hideLoading()}})}},t={showFreeItem:function(i){for(var e="",f,r,u=0;u<i.length;u++)f="/productpriceapi/getucmsinfo?MasterProductID="+i[u],r=!1,n(".features-contents > div:last[class='row bg-light-grey']").length>0&&(r=!0),n.getJSON(f,function(i){if(typeof i.twohundredwords=="string"&&i.twohundredwords!=""){t.addFreeItemTitle(r);var u=i.twohundredwords;u=u.replace("[PRODUCTNAME]",n("meta[property='og:title']").attr("content")),r?n(".features-contents > div:last").before(u):n(".features-contents").append(u)}})},addFreeItemTitle:function(t){if(n(".freeitem-title").length==0){var i='<h3 class="feature-header freeitem-title">'+res.onlywhenyoushop+"</h3>";t?n(".features-contents > div:last").before(i):n(".features-contents").append(i)}}};n.fn.showFreeShippingThreshold=function(n,t){u.show(n,t)},n.fn.showProductLightBox=function(n,t){r.show(n,t)},n.fn.productSelector=function(i,r){var o=n.data(this,"productselector"),f,u,e,s;if(o?o.init(i,n(this),r):o=n.data(this,"productselector",new n.productSelector(i,n(this),r)),n(".features-contents").length>0&&typeof n('meta[name="x-masterproduct-id"]').attr("content")!="undefined"&&n('meta[name="x-masterproduct-id"]').attr("content")==i.MasterProductID){if(f=[],i.Products!=null&&i.Products.length>0)for(u=0;u<i.Products.length;u++)if(i.Products[u].FreeItems!=null)for(e=0;e<i.Products[u].FreeItems.length;e++)s=i.Products[u].FreeItems[e].MasterProductID,f.indexOf(s)==-1&&f.push(s);f.length>0&&t.showFreeItem(f)}return o},n.fn.tradeIn=function(){n.fancybox.open(n("<div><p>This product is eligible for trade-in.</p><p>******************</p><p>******************</p><p>******************</p><p>******************</p><p>******************</p><p>******************</p></div>"),{title:"&nbsp;"})},n.fn.addToShoppingCart=function(t){i.showMiniCart(t),n.fancybox.close()},n.fn.miniShoppingCartClose=function(){n("#minishoppingcart").fadeOut(),setTimeout(function(){n("#minishoppingcart").remove()},1e3)},n.fn.updateShoppingCartCount=function(t){n("#topcart-count").text(t).show().css("display","inline-block")},n.fn.favouritesInit4ProductBuy=function(){Product.initFavourites(".favourite",function(t){n(t.currentTarget).addClass("btn-favourited-heart").hide().fadeIn()},function(t){n(t.currentTarget).removeClass("btn-favourited-heart").hide().fadeIn()},function(t){n.fancybox("#miniloginform",{title:res.LoginTitle,afterClose:function(){n("body").append('<script type="text/javascript" src="'+GetAbsoluteURL()+"/productpriceapi/CheckFavouritesByMasterProductID?MasterProductID="+n(t.currentTarget).data("product-id")+'&amp;CallBack=%24.fn.favouritecheck"><\/script>')},afterShow:function(){n("#miniloginiframe").attr("src",res.SECURESERVER+"/account/insertfavourite?productid="+n(t.currentTarget).data("product-id"))}}),FacebookLoginCallBack=function(){n("body").append('<script type="text/javascript" src="'+GetAbsoluteURL()+"/productpriceapi/CheckFavouritesByMasterProductID?MasterProductID="+n(t.currentTarget).data("product-id")+'&amp;CallBack=%24.fn.favouritecheck"><\/script>'),n.fancybox.close()}})}}(jQuery),RECOMMENDEDBOX={hide:function(){$.fancybox.close()}},jQuery.fn.extend({pressEnter:function(n){this.keypress(function(t){t.which=="13"&&n()})},pressKey:function(n){this.keyup(function(t){t.which!="13"&&t.which!="38"&&t.which!="40"&&n()})},pressNavigationUp:function(n){this.keyup(function(t){t.which=="38"&&n()})},pressNavigationDown:function(n){this.keyup(function(t){t.which=="40"&&n()})}}),function(n){var t={ProductData:null,SearchProduct:[],CategoryKeywords:[],DisplayCount:0,CurrentId:-1,ProductUrl:"",bAbove:!1,CountLimit:14,Init:function(){this.LoadData(),n("#topkeywords").attr("autocomplete","off"),n("#searchform").submit(function(){return!1}),n("#global-search").append(this.SearchBox()),n("#global-search").append(this.NeedHelpBox()),global.store.livechatenabled=="0"&&n("#needHelpResult .help-livechat,#needHelpResult .help-faq").remove(),this.SearchBoxClose(),this.EventClick(),this.RegEvent(),this.EventSearch()},LoadData:function(){this.ProductData==null&&typeof SEARCHPRODUCTS!="undefined"&&(this.ProductData=SEARCHPRODUCTS.Products,this.CategoryKeywords=SEARCHPRODUCTS.Keywords),this.ProductData==null&&typeof SEARCHPRODUCTS=="undefined"&&(this.ProductData=[],this.CategoryKeywords=[])},SearchBox:function(){return n('<div id="searchResult" class="searchResult"><div class="searchResultHead"></div><div class="searchResultBox"><div class="searchResultContent"><div id="searchclose" class="searchClose"></div><div class="searchmiddleline"></div><div id="searchproductlist"><div id="plscroll"></div></div></div></div><div class="searchResultBottom"></div></div>')},NeedHelpBox:function(){return n('<div id="needHelpResult" class="searchResult"><div class="searchResultHead"></div><div class="searchResultBox"><div class="searchResultContent"><div class="search-need-help">'+res.txt_searchneedhelp.replace(/\{rooturl\}+/g,res.NORMALSTORESERVER)+'</div></div></div><div class="searchResultBottom"></div></div>').css("width",n("#global-search").width()+30+"px")},EventClick:function(){var t=this;n("#searchButton").click(function(){var i=n("#topkeywords").val();if(i==""||i.toLowerCase()==SearchInputValue.toLowerCase()){n("#topkeywords").focus();return}if(t.ProductUrl!="")window.location.href=t.ProductUrl;else return!1}),n("#topkeywords").pressEnter(function(){return t.ProductUrl!="undefined"&&t.ProductUrl!=""&&(window.location.href=t.ProductUrl),!1})},EventSearch:function(){var t=this;n("#topkeywords").pressKey(function(){var i=n("#topkeywords").val();i.length>0?(n("#needHelpResult").hide(),n("#searchResult").show(),t.EnterSearch(i)):(t.SearchBoxClose(),n("#needHelpResult").show())}),n("#topkeywords").pressNavigationUp(function(){t.CurrentId>0?t.CurrentId--:t.CurrentId=t.DisplayCount-1,n(".searchResultProductItem").removeClass("searchResultSelectProduct"),n("#searchProductItem_"+t.CurrentId).addClass("searchResultSelectProduct"),t.ProductUrl=n("#searchProductItem_"+t.CurrentId+" .pimg a").attr("href");var i=0;n("#searchResult #searchproductlist .searchResultProductItem").each(function(){if(n(this).attr("id")=="searchProductItem_"+t.CurrentId)return!1;i+=parseInt(n(this).height())+12}),i=i>220?i-100:0,n("#searchResult #searchproductlist").getNiceScroll()[0].doScrollPos(0,i)}),n("#topkeywords").pressNavigationDown(function(){t.CurrentId<t.DisplayCount-1?t.CurrentId++:t.CurrentId=0,n(".searchResultProductItem").removeClass("searchResultSelectProduct"),n("#searchProductItem_"+t.CurrentId).addClass("searchResultSelectProduct"),t.ProductUrl=n("#searchProductItem_"+t.CurrentId+" .pimg a").attr("href");var i=0;n("#searchResult #searchproductlist .searchResultProductItem").each(function(){if(n(this).attr("id")=="searchProductItem_"+t.CurrentId)return!1;i+=parseInt(n(this).height())+12}),i=i>220?i-100:0,n("#searchResult #searchproductlist").getNiceScroll()[0].doScrollPos(0,i)})},KeyFilter:function(n){return n=n.replace(/\(/ig,""),n=n.replace(/\)/ig,""),n.replace(/[^a-zA-Z0-9\u4E00-\u9FA5]*$/,"")},KeyFilter4SpecialChars:function(n){return n=n.replace(/\s+/g,""),n=n.replace(/\-/ig,""),n=n.replace(/\+/ig,""),n=n.replace(/\*/ig,""),n=n.replace(/\&/ig,""),n=n.replace(/\^/ig,""),n=n.replace(/\%/ig,""),n=n.replace(/\$/ig,""),n=n.replace(/\#/ig,""),n=n.replace(/\@/ig,""),n=n.replace(/\!/ig,""),n=n.replace(/\~/ig,""),n=n.replace(/\</ig,""),n=n.replace(/\>/ig,""),n=n.replace(/\[/ig,""),n=n.replace(/\]/ig,""),n=n.replace(/\{/ig,""),n=n.replace(/\}/ig,""),n=n.replace(/\(/ig,""),n=n.replace(/\)/ig,"")},CheckProduct:function(n,t){for(var i=0;i<n.length;i++)if(n[i]==t)return!0;return!1},LoadProduct:function(t,i,r,u){var e=t.H2==""?this.htmlDecode(t.Te):this.htmlDecode(t.H2),f;e=e.replace(new RegExp(r,"gi"),"<span class='highlight'>"+r.toUpperCase()+"</span>"),f=res.NORMALSTORESERVER+"/go/p/"+t.C+"/"+t.I,n("#searchResult #searchproductlist #plscroll").append('<div class="searchResultProductItem" id="searchProductItem_'+u+'"><div class="pimg"><a href="'+f+'"><img src="'+i+"/images/products/large/pdt_"+t.M+'.png.ashx?width=70&height=50"></a></div><div class="ptext"><span class="title"><a href="'+f+'">'+t.N.replace(new RegExp(r,"gi"),"<span class='highlight'>"+r.toUpperCase()+"</span>")+'</a></span><span class="detail"><a href="'+f+'">'+e+"</a></span></div></div>")},SearchCategoryKey:function(n){var r,u,i,t;if(this.DisplayCount<=this.CountLimit){for(r=0,u=new RegExp(this.KeyFilter(this.KeyFilter4SpecialChars(n)),"gi"),t=0;t<this.CategoryKeywords.length&&this.DisplayCount<=this.CountLimit;t++)if(i=this.CategoryKeywords[t].Keywords,i!=null&&i!=""&&this.KeyFilter4SpecialChars(i).search(u)>=0){r=this.CategoryKeywords[t].CID;break}if(r>0)for(t=0;t<this.ProductData.length&&this.DisplayCount<=this.CountLimit;t++)this.CheckProduct(this.SearchProduct,this.ProductData[t].I)||this.ProductData[t].C!=r||(this.SearchProduct.push(this.ProductData[t].I),this.LoadProduct(this.ProductData[t],res.IMAGESERVER,n,this.DisplayCount),this.DisplayCount++)}},SearchKey:function(n,t){var u,f,e,i,r;for(t==2&&(n=this.KeyFilter4SpecialChars(n)),u=new RegExp(this.KeyFilter(n),"gi"),i=0;i<this.ProductData.length&&this.DisplayCount<=this.CountLimit;i++)f=this.ProductData[i].N,t==2&&(f=this.KeyFilter4SpecialChars(f)),!this.CheckProduct(this.SearchProduct,this.ProductData[i].I)&&f.search(u)>=0&&(this.SearchProduct.push(this.ProductData[i].I),this.LoadProduct(this.ProductData[i],res.IMAGESERVER,n,this.DisplayCount),this.DisplayCount++);for(i=0;i<this.ProductData.length&&this.DisplayCount<=this.CountLimit;i++)e=this.ProductData[i].Ta,t==2&&(e=this.KeyFilter4SpecialChars(e)),!this.CheckProduct(this.SearchProduct,this.ProductData[i].I)&&e.search(u)>=0&&(this.SearchProduct.push(this.ProductData[i].I),this.LoadProduct(this.ProductData[i],res.IMAGESERVER,n,this.DisplayCount),this.DisplayCount++);for(i=0;i<this.ProductData.length&&this.DisplayCount<=this.CountLimit;i++)r=this.ProductData[i].H2,t==2&&r!=null&&r.length>0&&(r=this.KeyFilter4SpecialChars(r)),r!=null&&r.length>0&&!this.CheckProduct(this.SearchProduct,this.ProductData[i].I)&&r.search(u)>=0&&(this.SearchProduct.push(this.ProductData[i].I),this.LoadProduct(this.ProductData[i],res.IMAGESERVER,n,this.DisplayCount),this.DisplayCount++);for(i=0;i<this.ProductData.length&&this.DisplayCount<=this.CountLimit;i++)r=this.ProductData[i].Te,t==2&&(r=this.KeyFilter4SpecialChars(r)),!this.CheckProduct(this.SearchProduct,this.ProductData[i].I)&&r.search(u)>=0&&(this.SearchProduct.push(this.ProductData[i].I),this.LoadProduct(this.ProductData[i],res.IMAGESERVER,n,this.DisplayCount),this.DisplayCount++)},SmartSearch:function(n,t){for(var r=this.KeywordSplit(n),i=0;i<r.length;i++)r[i]!=""&&this.SearchKey(r[i],t)},ErrorSearch:function(t){res.SearchNoResults=res.SearchNoResults.replace(/\$root/g,res.NORMALSTORESERVER),t.length>18&&(t=t.substring(0,16)+"...");var r='<div class="searchResultError">'+res.SearchNoResults+"</div>",i='<table class="closetable"><tr><td><p class="stitle">'+res.SearchResults.toUpperCase()+"</p><p>"+String.format(res.SearchNoResultsText.replace("F66c11","0cbdef"),t)+"</p><p>"+res.SearchNoResultsTip+"</p></td></tr></table>";n("#searchclose").html(i),n("#searchproductlist #plscroll").html(r)},LoadingSearch:function(t){n("#searchclose").html("&nbsp;"),n("#searchproductlist  #plscroll").html('<div class="searchloading"><div><img src="'+GetAbsoluteURL()+'/content/images/loadinganimation.gif"></div><div>'+res.SearchLoading+"</div><div>"+String.format(res.SearchingTip,t)+"</div></div>")},GetSearchResult:function(n){var r,i,t;if(this.LoadData(),r=[],this.ProductData!=null&&this.ProductData.length>0)for(n=n.replace(/\*/ig,""),n=n.replace(/\./ig,""),n=n.replace(/\</ig,""),n=n.replace(/\>/ig,""),n=n.replace(/^\s+|\s+$/g,""),this.DisplayCount=0,this.SearchProduct=[],this.SearchCategoryKey(n),this.SearchKey(n,1),this.SmartSearch(n,1),this.SearchKey(n,2),this.SmartSearch(n,2),i=0;i<this.SearchProduct.length;i++)for(t=0;t<this.ProductData.length;t++)if(this.SearchProduct[i]==this.ProductData[t].I){r.push(this.ProductData[t]);break}return r},EnterSearch:function(t){if(this.ProductData!=null&&this.ProductData.length>0){t=t.replace(/\*/ig,""),t=t.replace(/\./ig,""),t=t.replace(/\</ig,""),t=t.replace(/\>/ig,""),t=t.replace(/^\s+|\s+$/g,""),this.LoadingSearch(t),this.ProductUrl="",this.CurrentId=-1,n("#searchproductlist  #plscroll").html(""),this.DisplayCount=0,this.SearchProduct=[],this.SearchCategoryKey(t),this.SearchKey(t,1),this.SmartSearch(t,1),this.SearchKey(t,2),this.SmartSearch(t,2),t.length>18&&(t=t.substring(0,16)+"...");var i='<table class="closetable"><tr><td><p class="stitle">'+res.SearchResults.toUpperCase()+"</p><p>"+String.format(res.SearchDisplaying.replace("F66c11","0cbdef"),this.DisplayCount,t)+'</p></td><td valign="bottom" width="90"><a id="searchBoxClose" onclick="$.fn.SearchBoxClose();" class="searchCloseLink" href="javascript:;">'+res.SearchCancel+"</a></td></tr></table>";n("#searchclose").html(i),this.RegEvent(),this.DisplayCount<=0&&this.ErrorSearch(t),this.ScrollBar()}else this.ErrorSearch(t);this.ProductData==null&&this.LoadingSearch(t)},SearchBoxClose:function(){n("#searchResult").hide("normal"),typeof n("#searchResult #searchproductlist").getNiceScroll!="undefined"&&n("#searchResult #searchproductlist").getNiceScroll().hide()},RegEvent:function(){var t=this;n("#topkeywords").focus(function(){n("#topkeywords").val(""),n("#needHelpResult").show()}).blur(function(){t.bAbove||(t.SearchBoxClose(),setTimeout(function(){n("#needHelpResult").hide()},800))}),n("#searchResult").hover(function(){t.bAbove=!0},function(){t.bAbove=!1}),n("#searchproductlist .searchResultProductItem").hover(function(){t.ProductUrl="",n(".searchResultProductItem").removeClass("searchResultSelectProduct"),n(this).addClass("searchResultSelectProduct")},function(){n(this).removeClass("searchResultSelectProduct")})},htmlEncode:function(t){return n("<div/>").text(t).html()},htmlDecode:function(t){return n("<div/>").html(t).text()},KeywordSplit:function(n){var t=null,r,u,i;for(typeof n=="string"?t=n.split(" "):jQuery.isArray(n)&&(t=n),r=0;r<t.length;r++)for(u=t[r],i=t.length-1;i>r;i--)u==t[i]&&t.splice(i,1);return t},ScrollBar:function(){if(n("#searchResult #searchproductlist .searchResultProductItem").length>6){n("#searchResult #searchproductlist .scrollblock").remove();var i=0,t=1;n("#searchResult #searchproductlist .searchResultProductItem").each(function(){if(t<7)i+=n(this).height()+11;else return;t++}),n("#searchResult #searchproductlist").css("position","relative"),n("#searchResult #searchproductlist").css("height",parseInt(i)+"px"),n("#searchResult #searchproductlist").css("overflow","hidden"),n("#searchResult #searchproductlist").css("margin-top","10px"),n("#searchResult #searchproductlist").css("padding-bottom","10px"),n("#searchResult #searchproductlist").niceScroll("#plscroll",{cursorcolor:"#0cbdef",boxzoom:!1,autohidemode:!1,horizrailenabled:!1,hwacceleration:!1})}else n("#searchResult #searchproductlist").css("height","auto"),n("#searchResult #searchproductlist .scrollblock").remove(),n("#searchResult #searchproductlist").css("position","static"),n("#searchResult #searchproductlist").css("height","auto"),n("#searchResult #searchproductlist #plscroll").css("position","static"),n("#searchResult #searchproductlist #plscroll").css("height","auto");n("#searchResult #searchproductlist").getNiceScroll().show(),n("#searchResult #searchproductlist").getNiceScroll().resize(),typeof n("#searchResult #searchproductlist").getNiceScroll()[0]!="undefined"&&n("#searchResult #searchproductlist").getNiceScroll()[0].doScrollPos(0,0)}};n.fn.searchInit=function(){t.Init()},n.fn.searchPopup=function(t){n("#topkeywords").focus(),n("#topkeywords").val(t)},n.fn.SearchBoxClose=function(){t.SearchBoxClose()},n.fn.SearchDown=function(){t.ScrollDown()},n.fn.SearchUp=function(){t.ScrollUp()},n.fn.SearchGetResult=function(n){return t.GetSearchResult(n)}}(jQuery),function(n){function y(){var t=document.getElementsByTagName("script"),n=t[t.length-1].src.split("?")[0];return n.split("/").length>0?n.split("/").slice(0,-1).join("/")+"/":""}function v(n,t,i){for(var r=0;r<t.length;r++)i(n,t[r])}var e=!1,h=!1,d=!1,w=5e3,p=2e3,t=n,k=y(),i=function(){return window.requestAnimationFrame||window.webkitRequestAnimationFrame||window.mozRequestAnimationFrame||window.oRequestAnimationFrame||window.msRequestAnimationFrame||!1}(),f=function(){return window.cancelRequestAnimationFrame||window.webkitCancelRequestAnimationFrame||window.mozCancelRequestAnimationFrame||window.oCancelRequestAnimationFrame||window.msCancelRequestAnimationFrame||!1}(),s=!1,b=function(){function u(){var u=["-moz-grab","-webkit-grab","grab"],r,i;for((n.ischrome&&!n.ischrome22||n.isie)&&(u=[]),r=0;r<u.length;r++)if(i=u[r],t.style.cursor=i,t.style.cursor==i)return i;return"url(http://www.google.com/intl/en_ALL/mapfiles/openhand.cur),n-resize"}var t,n,r,i;if(s)return s;for(t=document.createElement("DIV"),n={},n.haspointerlock=("pointerLockElement"in document)||("mozPointerLockElement"in document)||("webkitPointerLockElement"in document),n.isopera=("opera"in window),n.isopera12=n.isopera&&("getUserMedia"in navigator),n.isie=("all"in document)&&("attachEvent"in t)&&!n.isopera,n.isieold=n.isie&&!("msInterpolationMode"in t.style),n.isie7=n.isie&&!n.isieold&&(!("documentMode"in document)||document.documentMode==7),n.isie8=n.isie&&("documentMode"in document)&&document.documentMode==8,n.isie9=n.isie&&("performance"in window)&&document.documentMode>=9,n.isie10=n.isie&&("performance"in window)&&document.documentMode>=10,n.isie9mobile=/iemobile.9/i.test(navigator.userAgent),n.isie9mobile&&(n.isie9=!1),n.isie7mobile=!n.isie9mobile&&n.isie7&&/iemobile/i.test(navigator.userAgent),n.ismozilla=("MozAppearance"in t.style),n.iswebkit=("WebkitAppearance"in t.style),n.ischrome=("chrome"in window),n.ischrome22=n.ischrome&&n.haspointerlock,n.cantouch=("ontouchstart"in document.documentElement),n.hasmstouch=window.navigator.msPointerEnabled||!1,n.ismac=/^mac$/i.test(navigator.platform),n.isios=n.cantouch&&/iphone|ipad|ipod/i.test(navigator.platform),n.isios4=n.isios&&!("seal"in Object),n.isandroid=/android/i.test(navigator.userAgent),n.trstyle=!1,n.hastransform=!1,n.hastranslate3d=!1,n.transitionstyle=!1,n.hastransition=!1,n.transitionend=!1,r=["transform","msTransform","webkitTransform","MozTransform","OTransform"],i=0;i<r.length;i++)if(typeof t.style[r[i]]!="undefined"){n.trstyle=r[i];break}n.hastransform=n.trstyle!=!1,n.hastransform&&(t.style[n.trstyle]="translate3d(1px,2px,3px)",n.hastranslate3d=/translate3d/.test(t.style[n.trstyle])),n.transitionstyle=!1,n.prefixstyle="",n.transitionend=!1;var r=["transition","webkitTransition","MozTransition","OTransition","OTransition","msTransition","KhtmlTransition"],e=["","-webkit-","-moz-","-o-","-o","-ms-","-khtml-"],f=["transitionend","webkitTransitionEnd","transitionend","otransitionend","oTransitionEnd","msTransitionEnd","KhtmlTransitionEnd"];for(i=0;i<r.length;i++)if(r[i]in t.style){n.transitionstyle=r[i],n.prefixstyle=e[i],n.transitionend=f[i];break}return n.hastransition=n.transitionstyle,n.cursorgrabvalue=u(),n.hasmousecapture="setCapture"in t,t=null,s=n,n},l=function(n,r){function s(n,t,i){var e=n.css(t),r=parseFloat(e),f;return isNaN(r)?(r=y[e]||0,f=r==3?i?u.win.outerHeight()-u.win.innerHeight():u.win.outerWidth()-u.win.innerWidth():1,u.isie8&&r&&(r+=1),f?r:0):r}function a(n,t){var f=0,r=0,i;"wheelDeltaY"in n?(f=Math.floor(n.wheelDeltaX/2),r=Math.floor(n.wheelDeltaY/2)):(i=n.detail?n.detail*-1:n.wheelDelta/40,i&&(t?f=Math.floor(i*u.opt.mousescrollstep):r=Math.floor(i*u.opt.mousescrollstep))),f&&(u.scrollmom&&u.scrollmom.stop(),u.lastdeltax+=f,u.synched("mousewheelx",function(){var n=u.lastdeltax;u.lastdeltax=0,u.rail.drag||u.doScrollLeftBy(n)})),r&&(u.scrollmom&&u.scrollmom.stop(),u.lastdeltay+=r,u.synched("mousewheely",function(){var n=u.lastdeltay;u.lastdeltay=0,u.rail.drag||u.doScrollBy(n)}))}var u=this,l,o,y;if(this.version="3.0.0",this.name="nicescroll",this.me=r,this.opt={doc:t("body"),win:!1,zindex:9e3,cursoropacitymin:0,cursoropacitymax:1,cursorcolor:"#424242",cursorwidth:"5px",cursorborder:"1px solid #fff",cursorborderradius:"5px",scrollspeed:60,mousescrollstep:24,touchbehavior:!1,hwacceleration:!0,usetransition:!0,boxzoom:!1,dblclickzoom:!0,gesturezoom:!0,grabcursorenabled:!0,autohidemode:!0,background:"",iframeautoresize:!0,cursorminheight:32,preservenativescrolling:!0,railoffset:!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},this.opt.snapbackspeed=80,n||!1)for(l in u.opt)typeof n[l]!="undefined"&&(u.opt[l]=n[l]);this.doc=u.opt.doc,this.iddoc=this.doc&&this.doc[0]?this.doc[0].id||"":"",this.ispage=/BODY|HTML/.test(u.opt.win?u.opt.win[0].nodeName:this.doc[0].nodeName),this.haswrapper=u.opt.win!==!1,this.win=u.opt.win||(this.ispage?t(window):this.doc),this.docscroll=this.ispage&&!this.haswrapper?t(window):this.win,this.body=t("body"),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=u.opt.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,this.scrollrunning=!1,this.scrollmom=!1,this.observer=!1;do this.id="ascrail"+p++;while(document.getElementById(this.id));if(this.rail=!1,this.cursor=!1,this.cursorfreezed=!1,this.zoom=!1,this.zoomactive=!1,this.hasfocus=!1,this.hasmousefocus=!1,this.visibility=!0,this.locked=!1,this.hidden=!1,this.cursoractive=!0,this.nativescrollingarea=!1,this.events=[],this.saved={},this.delaylist={},this.synclist={},this.lastdeltax=0,this.lastdeltay=0,o=this.detected=b(),this.canhwscroll=o.hastransform&&u.opt.hwacceleration,this.ishwscroll=this.canhwscroll&&u.haswrapper,this.istouchcapable=!1,o.cantouch&&o.ischrome&&!o.isios&&!o.isandroid&&(this.istouchcapable=!0,o.cantouch=!1),o.cantouch&&o.ismozilla&&!o.isios&&(this.istouchcapable=!0,o.cantouch=!1),this.delayed=function(n,t,i,r){var f=u.delaylist[n],e=+new Date;if(!r&&f&&f.tt)return!1;f&&f.tt&&clearTimeout(f.tt),f&&f.last+i>e&&!f.tt?u.delaylist[n]={last:e+i,tt:setTimeout(function(){u.delaylist[n].tt=0,t.call()},i)}:f&&f.tt||(u.delaylist[n]={last:e,tt:0},setTimeout(function(){t.call()},0))},this.synched=function(n,t){function r(){u.onsync||(i(function(){u.onsync=!1;for(n in u.synclist){var t=u.synclist[n];t&&t.call(u),u.synclist[n]=!1}}),u.onsync=!0)}return u.synclist[n]=t,r(),n},this.unsynched=function(n){u.synclist[n]&&(u.synclist[n]=!1)},this.css=function(n,t){for(var i in t)u.saved.css.push([n,i,n.css(i)]),n.css(i,t[i])},this.scrollTop=function(n){return typeof n=="undefined"?u.getScrollTop():u.setScrollTop(n)},this.scrollLeft=function(n){return typeof n=="undefined"?u.getScrollLeft():u.setScrollLeft(n)},BezierClass=function(n,t,i,r,u,f,e){this.st=n,this.ed=t,this.spd=i,this.p1=r||0,this.p2=u||1,this.p3=f||0,this.p4=e||1,this.ts=+new Date,this.df=this.ed-this.st},BezierClass.prototype={B2:function(n){return 3*n*n*(1-n)},B3:function(n){return 3*n*(1-n)*(1-n)},B4:function(n){return(1-n)*(1-n)*(1-n)},getNow:function(){var i=+new Date,n=1-(i-this.ts)/this.spd,t=this.B2(n)+this.B3(n)+this.B4(n);return n<0?this.ed:this.st+Math.round(this.df*t)},update:function(n,t){return this.st=this.getNow(),this.ed=n,this.spd=t,this.ts=+new Date,this.df=this.ed-this.st,this}},this.ishwscroll){this.doc.translate={x:0,y:0,tx:"0px",ty:"0px"},o.hastranslate3d&&o.isios&&this.doc.css("-webkit-backface-visibility","hidden");function v(){var n=u.doc.css(o.trstyle);return n&&n.substr(0,6)=="matrix"?n.replace(/^.*\((.*)\)$/g,"$1").replace(/px/g,"").split(/, +/):!1}this.getScrollTop=function(n){if(!n){var t=v();if(t)return t.length==16?-t[13]:-t[5];if(u.timerscroll&&u.timerscroll.bz)return u.timerscroll.bz.getNow()}return u.doc.translate.y},this.getScrollLeft=function(n){if(!n){var t=v();if(t)return t.length==16?-t[12]:-t[4];if(u.timerscroll&&u.timerscroll.bh)return u.timerscroll.bh.getNow()}return u.doc.translate.x},this.notifyScrollEvent=document.createEvent?function(n){var t=document.createEvent("UIEvents");t.initUIEvent("scroll",!1,!0,window,1),n.dispatchEvent(t)}:document.fireEvent?function(n){var t=document.createEventObject();n.fireEvent("onscroll"),t.cancelBubble=!0}:function(){},o.hastranslate3d&&u.opt.enabletranslate3d?(this.setScrollTop=function(n,t){u.doc.translate.y=n,u.doc.translate.ty=n*-1+"px",u.doc.css(o.trstyle,"translate3d("+u.doc.translate.tx+","+u.doc.translate.ty+",0px)"),t||u.notifyScrollEvent(u.win[0])},this.setScrollLeft=function(n,t){u.doc.translate.x=n,u.doc.translate.tx=n*-1+"px",u.doc.css(o.trstyle,"translate3d("+u.doc.translate.tx+","+u.doc.translate.ty+",0px)"),t||u.notifyScrollEvent(u.win[0])}):(this.setScrollTop=function(n,t){u.doc.translate.y=n,u.doc.translate.ty=n*-1+"px",u.doc.css(o.trstyle,"translate("+u.doc.translate.tx+","+u.doc.translate.ty+")"),t||u.notifyScrollEvent(u.win[0])},this.setScrollLeft=function(n,t){u.doc.translate.x=n,u.doc.translate.tx=n*-1+"px",u.doc.css(o.trstyle,"translate("+u.doc.translate.tx+","+u.doc.translate.ty+")"),t||u.notifyScrollEvent(u.win[0])})}else this.getScrollTop=function(){return u.docscroll.scrollTop()},this.setScrollTop=function(n){return u.docscroll.scrollTop(n)},this.getScrollLeft=function(){return u.docscroll.scrollLeft()},this.setScrollLeft=function(n){return u.docscroll.scrollLeft(n)};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},y={thin:1,medium:3,thick:5},this.updateScrollBar=function(n){var r,t,o,i;if(u.ishwscroll)u.rail.css({height:u.win.innerHeight()}),u.railh&&u.railh.css({width:u.win.innerWidth()});else if(r=u.isfixed?{top:parseFloat(u.win.css("top")),left:parseFloat(u.win.css("left"))}:u.win.offset(),t={top:r.top,left:r.left},t.top+=s(u.win,"border-top-width",!0),o=(u.win.outerWidth()-u.win.innerWidth())/2,t.left+=u.rail.align?u.win.outerWidth()-s(u.win,"border-right-width")-u.rail.width:s(u.win,"border-left-width"),i=u.opt.railoffset,i&&(i.top&&(t.top+=i.top),u.rail.align&&i.left&&(t.left+=i.left)),u.locked||u.rail.css({top:t.top,left:t.left,height:n?n.h:u.win.innerHeight()}),u.zoom&&u.zoom.css({top:t.top+1,left:u.rail.align==1?t.left-20:t.left+u.rail.width+4}),u.railh&&!u.locked){var t={top:r.top,left:r.left},e=u.railh.align?t.top+s(u.win,"border-top-width",!0)+u.win.innerHeight()-u.railh.height:t.top+s(u.win,"border-top-width",!0),f=t.left+s(u.win,"border-left-width");u.railh.css({top:e,left:f,width:u.railh.width})}},this.doRailClick=function(n,t,i){var r,e,f,o;u.rail.drag&&u.rail.drag.pt!=1||u.locked||u.rail.drag||(u.cancelScroll(),u.cancelEvent(n),t?(r=i?u.doScrollLeft:u.doScrollTop,f=i?(n.pageX-u.railh.offset().left-u.cursorwidth/2)*u.scrollratio.x:(n.pageY-u.rail.offset().top-u.cursorheight/2)*u.scrollratio.y,r(f)):(r=i?u.doScrollLeftBy:u.doScrollBy,f=i?u.scroll.x:u.scroll.y,o=i?n.pageX-u.railh.offset().left:n.pageY-u.rail.offset().top,e=i?u.view.w:u.view.h,f>=o?r(e):r(-e)))},u.hasanimationframe=i,u.hascancelanimationframe=f,u.hasanimationframe?u.hascancelanimationframe||(f=function(){u.cancelAnimationFrame=!0}):(i=function(n){return setTimeout(n,16)},f=clearInterval),this.init=function(){var f,n,p,v,k,tt,s,r,i,a,l,b,y,it,nt,d;if(u.saved.css=[],o.isie7mobile)return!0;if(o.hasmstouch&&u.css(u.ispage?t("html"):u.win,{"-ms-touch-action":"none"}),!u.ispage||!o.cantouch&&!o.isieold&&!o.isie9mobile){f=u.docscroll,u.ispage&&(f=u.haswrapper?u.win:u.doc),o.isie9mobile||u.css(f,{"overflow-y":"hidden"}),u.ispage&&o.isie7&&(u.doc[0].nodeName=="BODY"?u.css(t("html"),{"overflow-y":"hidden"}):u.doc[0].nodeName=="HTML"&&u.css(t("body"),{"overflow-y":"hidden"})),!o.isios||u.ispage||u.haswrapper||u.css(t("body"),{"-webkit-overflow-scrolling":"touch"}),r=t(document.createElement("div")),r.css({position:"relative",top:0,float:"right",width:u.opt.cursorwidth,height:"0px","background-color":u.opt.cursorcolor,border:u.opt.cursorborder,"background-clip":"padding-box","-webkit-border-radius":u.opt.cursorborderradius,"-moz-border-radius":u.opt.cursorborderradius,"border-radius":u.opt.cursorborderradius}),r.hborder=parseFloat(r.outerHeight()-r.innerHeight()),u.cursor=r,n=t(document.createElement("div")),n.attr("id",u.id),k=["left","right"];for(tt in k)v=k[tt],p=u.opt.railpadding[v],p?n.css("padding-"+v,p+"px"):u.opt.railpadding[v]=0;n.append(r),n.width=Math.max(parseFloat(u.opt.cursorwidth),r.outerWidth())+u.opt.railpadding.left+u.opt.railpadding.right,n.css({width:n.width+"px",zIndex:u.ispage?u.opt.zindex:u.opt.zindex+2,background:u.opt.background}),n.visibility=!0,n.scrollable=!0,n.align=u.opt.railalign=="left"?0:1,u.rail=n,u.rail.drag=!1,s=!1,!u.opt.boxzoom||u.ispage||o.isieold||(s=document.createElement("div"),u.bind(s,"click",u.doZoom),u.zoom=t(s),u.zoom.css({cursor:"pointer","z-index":u.opt.zindex,height:18,width:18,backgroundPosition:"0px 0px"}),u.opt.dblclickzoom&&u.bind(u.win,"dblclick",u.doZoom),o.cantouch&&u.opt.gesturezoom&&(u.ongesturezoom=function(n){return n.scale>1.5&&u.doZoomIn(n),n.scale<.8&&u.doZoomOut(n),u.cancelEvent(n)},u.bind(u.win,"gestureend",u.ongesturezoom))),u.railh=!1,u.opt.horizrailenabled&&(u.css(f,{"overflow-x":"hidden"}),r=t(document.createElement("div")),r.css({position:"relative",top:0,height:u.opt.cursorwidth,width:"0px","background-color":u.opt.cursorcolor,border:u.opt.cursorborder,"background-clip":"padding-box","-webkit-border-radius":u.opt.cursorborderradius,"-moz-border-radius":u.opt.cursorborderradius,"border-radius":u.opt.cursorborderradius}),r.wborder=parseFloat(r.outerWidth()-r.innerWidth()),u.cursorh=r,i=t(document.createElement("div")),i.attr("id",u.id+"-hr"),i.height=1+Math.max(parseFloat(u.opt.cursorwidth),r.outerHeight()),i.css({height:i.height+"px",zIndex:u.ispage?u.opt.zindex:u.opt.zindex+2,background:u.opt.background}),i.append(r),i.visibility=!0,i.scrollable=!0,i.align=u.opt.railvalign=="top"?0:1,u.railh=i,u.railh.drag=!1),u.ispage?(n.css({position:"fixed",top:"0px",height:"100%"}),n.align?n.css({right:"0px"}):n.css({left:"0px"}),u.body.append(n),u.railh&&(i.css({position:"fixed",left:"0px",width:"100%"}),i.align?i.css({bottom:"0px"}):i.css({top:"0px"}),u.body.append(i))):(u.ishwscroll?(u.win.css("position")=="static"&&u.css(u.win,{position:"relative"}),a=u.win[0].nodeName=="HTML"?u.body:u.win,u.zoom&&(u.zoom.css({position:"absolute",top:1,right:0,"margin-right":n.width+4}),a.append(u.zoom)),n.css({position:"absolute",top:0}),n.align?n.css({right:0}):n.css({left:0}),a.append(n),i&&(i.css({position:"absolute",left:0,bottom:0}),i.align?i.css({bottom:0}):i.css({top:0}),a.append(i))):(u.isfixed=u.win.css("position")=="fixed",l=u.isfixed?"fixed":"absolute",n.css({position:l}),u.zoom&&u.zoom.css({position:l}),u.updateScrollBar(),u.body.append(n),u.zoom&&u.body.append(u.zoom),u.railh&&(i.css({position:l}),u.body.append(i))),o.isios&&u.css(u.win,{"-webkit-tap-highlight-color":"rgba(0,0,0,0)","-webkit-touch-callout":"none"}),o.isie&&u.opt.disableoutline&&u.win.attr("hideFocus","true"),o.iswebkit&&u.opt.disableoutline&&u.win.css({outline:"none"})),u.opt.autohidemode===!1?u.autohidedom=!1:u.opt.autohidemode===!0?(u.autohidedom=t().add(u.rail),u.railh&&(u.autohidedom=u.autohidedom.add(u.railh))):u.opt.autohidemode=="scroll"?(u.autohidedom=t().add(u.rail),u.railh&&(u.autohidedom=u.autohidedom.add(u.railh))):u.opt.autohidemode=="cursor"?(u.autohidedom=t().add(u.cursor),u.railh&&(u.autohidedom=u.autohidedom.add(u.railh.cursor))):u.opt.autohidemode=="hidden"&&(u.autohidedom=!1,u.hide(),u.locked=!1),o.isie9mobile?(u.scrollmom=new c(u),u.onmangotouch=function(){var i=u.getScrollTop(),t=u.getScrollLeft(),l,s;if(i==u.scrollmom.lastscrolly&&t==u.scrollmom.lastscrollx)return!0;var e=i-u.mangotouch.sy,f=t-u.mangotouch.sx,c=Math.round(Math.sqrt(Math.pow(f,2)+Math.pow(e,2)));if(c!=0){var h=e<0?-1:1,o=f<0?-1:1,r=+new Date;u.mangotouch.lazy&&clearTimeout(u.mangotouch.lazy),r-u.mangotouch.tm>80||u.mangotouch.dry!=h||u.mangotouch.drx!=o?(u.scrollmom.stop(),u.scrollmom.reset(t,i),u.mangotouch.sy=i,u.mangotouch.ly=i,u.mangotouch.sx=t,u.mangotouch.lx=t,u.mangotouch.dry=h,u.mangotouch.drx=o,u.mangotouch.tm=r):(u.scrollmom.stop(),u.scrollmom.update(u.mangotouch.sx-f,u.mangotouch.sy-e),l=r-u.mangotouch.tm,u.mangotouch.tm=r,s=Math.max(Math.abs(u.mangotouch.ly-i),Math.abs(u.mangotouch.lx-t)),u.mangotouch.ly=i,u.mangotouch.lx=t,s>2&&(u.mangotouch.lazy=setTimeout(function(){u.mangotouch.lazy=!1,u.mangotouch.dry=0,u.mangotouch.drx=0,u.mangotouch.tm=0,u.scrollmom.doMomentum(30)},100)))}},b=u.getScrollTop(),y=u.getScrollLeft(),u.mangotouch={sy:b,ly:b,dry:0,sx:y,lx:y,drx:0,lazy:!1,tm:0},u.bind(u.docscroll,"scroll",u.onmangotouch)):((o.cantouch||u.istouchcapable||u.opt.touchbehavior||o.hasmstouch)&&(u.scrollmom=new c(u),u.ontouchstart=function(n){var r,i,h,e,n,f,s;if(n.pointerType&&n.pointerType!=2)return!1;if(!u.locked){if(o.hasmstouch)for(i=n.target?n.target:!1;i;){if(r=t(i).getNiceScroll(),r.length>0&&r[0].me==u.me)break;if(r.length>0)return!1;if(i.nodeName=="DIV"&&i.id==u.id)break;i=i.parentNode?i.parentNode:!1}if(u.cancelScroll(),i=u.getTarget(n),i&&(h=/INPUT/i.test(i.nodeName)&&/range/i.test(i.type),h))return u.stopPropagation(n);if(u.forcescreen&&(e=n,n={original:n.original?n.original:n},n.clientX=e.screenX,n.clientY=e.screenY),u.rail.drag={x:n.clientX,y:n.clientY,sx:u.scroll.x,sy:u.scroll.y,st:u.getScrollTop(),sl:u.getScrollLeft(),pt:2},u.opt.touchbehavior&&u.isiframe&&o.isie&&(f=u.win.position(),u.rail.drag.x+=f.left,u.rail.drag.y+=f.top),u.hasmoving=!1,u.lastmouseup=!1,u.scrollmom.reset(n.clientX,n.clientY),!o.cantouch&&!this.istouchcapable&&!o.hasmstouch){if(s=i?/INPUT|SELECT|TEXTAREA/i.test(i.nodeName):!1,!s)return!u.ispage&&o.hasmousecapture&&i.setCapture(),u.cancelEvent(n);/SUBMIT|CANCEL|BUTTON/i.test(t(i).attr("type"))&&(pc={tg:i,click:!1},u.preventclick=pc)}}},u.ontouchend=function(n){return n.pointerType&&n.pointerType!=2?!1:u.rail.drag&&u.rail.drag.pt==2&&(u.scrollmom.doMomentum(),u.rail.drag=!1,u.hasmoving&&(u.hasmoving=!1,u.lastmouseup=!0,u.hideCursor(),o.hasmousecapture&&document.releaseCapture(),!o.cantouch))?u.cancelEvent(n):void 0},it=u.opt.touchbehavior&&u.isiframe&&!o.hasmousecapture,u.ontouchmove=function(n,t){var h,n,c,s,f,l,i;if(n.pointerType&&n.pointerType!=2)return!1;if(u.rail.drag&&u.rail.drag.pt==2){if(o.cantouch&&typeof n.original=="undefined")return!0;u.hasmoving=!0,u.preventclick&&!u.preventclick.click&&(u.preventclick.click=u.preventclick.tg.onclick||!1,u.preventclick.tg.onclick=u.onpreventclick),u.forcescreen&&(h=n,n={original:n.original?n.original:n},n.clientX=h.screenX,n.clientY=h.screenY),c=ofy=0,it&&!t&&(s=u.win.position(),c=-s.left,ofy=-s.top);var e=n.clientY+ofy,a=e-u.rail.drag.y,r=u.rail.drag.st-a;return u.ishwscroll&&u.opt.bouncescroll?r<0?r=Math.round(r/2):r>u.page.maxh&&(r=u.page.maxh+Math.round((r-u.page.maxh)/2)):(r<0&&(r=0,e=0),r>u.page.maxh&&(r=u.page.maxh,e=0)),f=n.clientX+c,u.railh&&u.railh.scrollable&&(l=f-u.rail.drag.x,i=u.rail.drag.sl-l,u.ishwscroll&&u.opt.bouncescroll?i<0?i=Math.round(i/2):i>u.page.maxw&&(i=u.page.maxw+Math.round((i-u.page.maxw)/2)):(i<0&&(i=0,f=0),i>u.page.maxw&&(i=u.page.maxw,f=0))),u.synched("touchmove",function(){u.rail.drag&&u.rail.drag.pt==2&&(u.prepareTransition&&u.prepareTransition(0),u.rail.scrollable&&u.setScrollTop(r),u.scrollmom.update(f,e),u.railh&&u.railh.scrollable?(u.setScrollLeft(i),u.showCursor(r,i)):u.showCursor(r),o.isie10&&document.selection.clear())}),u.cancelEvent(n)}}),o.cantouch||u.opt.touchbehavior?(u.onpreventclick=function(n){if(u.preventclick)return u.preventclick.tg.onclick=u.preventclick.click,u.preventclick=!1,u.cancelEvent(n)},u.onmousedown=u.ontouchstart,u.onmouseup=u.ontouchend,u.onclick=o.isios?!1:function(n){return u.lastmouseup?(u.lastmouseup=!1,u.cancelEvent(n)):!0},u.onmousemove=u.ontouchmove,o.cursorgrabvalue&&(u.css(u.ispage?u.doc:u.win,{cursor:o.cursorgrabvalue}),u.css(u.rail,{cursor:o.cursorgrabvalue}))):(u.onmousedown=function(n,t){if(!u.rail.drag||u.rail.drag.pt==1){if(u.locked)return u.cancelEvent(n);u.cancelScroll(),u.rail.drag={x:n.clientX,y:n.clientY,sx:u.scroll.x,sy:u.scroll.y,pt:1,hr:!!t};var i=u.getTarget(n);return!u.ispage&&o.hasmousecapture&&i.setCapture(),u.isiframe&&!o.hasmousecapture&&(u.saved.csspointerevents=u.doc.css("pointer-events"),u.css(u.doc,{"pointer-events":"none"})),u.cancelEvent(n)}},u.onmouseup=function(n){if(u.rail.drag)return(o.hasmousecapture&&document.releaseCapture(),u.isiframe&&!o.hasmousecapture&&u.doc.css("pointer-events",u.saved.csspointerevents),u.rail.drag.pt!=1)?void 0:(u.rail.drag=!1,u.cancelEvent(n))},u.onmousemove=function(n){var i,t;if(u.rail.drag)return u.rail.drag.pt!=1?void 0:o.ischrome&&n.which==0?u.onmouseup(n):(u.cursorfreezed=!0,u.rail.drag.hr?(u.scroll.x=u.rail.drag.sx+(n.clientX-u.rail.drag.x),u.scroll.x<0&&(u.scroll.x=0),i=u.scrollvaluemaxw,u.scroll.x>i&&(u.scroll.x=i)):(u.scroll.y=u.rail.drag.sy+(n.clientY-u.rail.drag.y),u.scroll.y<0&&(u.scroll.y=0),t=u.scrollvaluemax,u.scroll.y>t&&(u.scroll.y=t)),u.synched("mousemove",function(){u.rail.drag&&u.rail.drag.pt==1&&(u.showCursor(),u.rail.drag.hr?u.doScrollLeft(Math.round(u.scroll.x*u.scrollratio.x)):u.doScrollTop(Math.round(u.scroll.y*u.scrollratio.y)))}),u.cancelEvent(n));u.checkarea=!0}),(o.cantouch||u.opt.touchbehavior)&&u.bind(u.win,"mousedown",u.onmousedown),o.hasmstouch&&(u.css(u.rail,{"-ms-touch-action":"none"}),u.css(u.cursor,{"-ms-touch-action":"none"}),u.bind(u.win,"MSPointerDown",u.ontouchstart),u.bind(document,"MSPointerUp",u.ontouchend),u.bind(document,"MSPointerMove",u.ontouchmove),u.bind(u.cursor,"MSGestureHold",function(n){n.preventDefault()}),u.bind(u.cursor,"contextmenu",function(n){n.preventDefault()})),this.istouchcapable&&(u.bind(u.win,"touchstart",u.ontouchstart),u.bind(document,"touchend",u.ontouchend),u.bind(document,"touchmove",u.ontouchmove)),u.bind(u.cursor,"mousedown",u.onmousedown),u.bind(u.cursor,"mouseup",u.onmouseup),u.railh&&(u.bind(u.cursorh,"mousedown",function(n){u.onmousedown(n,!0)}),u.bind(u.cursorh,"mouseup",function(n){if(!u.rail.drag||u.rail.drag.pt!=2)return u.rail.drag=!1,u.hasmoving=!1,u.hideCursor(),o.hasmousecapture&&document.releaseCapture(),u.cancelEvent(n)})),u.bind(document,"mouseup",u.onmouseup),o.hasmousecapture&&u.bind(u.win,"mouseup",u.onmouseup),u.bind(document,"mousemove",u.onmousemove),u.onclick&&u.bind(document,"click",u.onclick),o.cantouch||u.opt.touchbehavior||(u.rail.mouseenter(function(){u.canshowonmouseevent&&u.showCursor(),u.rail.active=!0}),u.rail.mouseleave(function(){u.rail.active=!1,u.rail.drag||u.hideCursor()}),u.opt.sensitiverail&&(u.rail.click(function(n){u.doRailClick(n,!1,!1)}),u.rail.dblclick(function(n){u.doRailClick(n,!0,!1)}),u.cursor.click(function(n){u.cancelEvent(n)}),u.cursor.dblclick(function(n){u.cancelEvent(n)})),u.railh&&(u.railh.mouseenter(function(){u.canshowonmouseevent&&u.showCursor(),u.rail.active=!0}),u.railh.mouseleave(function(){u.rail.active=!1,u.rail.drag||u.hideCursor()})),u.zoom&&(u.zoom.mouseenter(function(){u.canshowonmouseevent&&u.showCursor(),u.rail.active=!0}),u.zoom.mouseleave(function(){u.rail.active=!1,u.rail.drag||u.hideCursor()}))),u.opt.enablemousewheel&&(u.isiframe||u.bind(o.isie&&u.ispage?document:u.docscroll,"mousewheel",u.onmousewheel),u.bind(u.rail,"mousewheel",u.onmousewheel),u.railh&&u.bind(u.railh,"mousewheel",u.onmousewheelhr)),u.ispage||o.cantouch||/HTML|BODY/.test(u.win[0].nodeName)||(u.win.attr("tabindex")||u.win.attr({tabindex:w++}),u.win.focus(function(n){e=u.getTarget(n).id||!0,u.hasfocus=!0,u.canshowonmouseevent&&u.noticeCursor()}),u.win.blur(function(){e=!1,u.hasfocus=!1}),u.win.mouseenter(function(n){h=u.getTarget(n).id||!0,u.hasmousefocus=!0,u.canshowonmouseevent&&u.noticeCursor()}),u.win.mouseleave(function(){h=!1,u.hasmousefocus=!1}))),u.onkeypress=function(n){var r,o,f,i,t;if(u.locked&&u.page.maxh==0||(n=n?n:window.e,r=u.getTarget(n),r&&/INPUT|TEXTAREA|SELECT|OPTION/.test(r.nodeName)&&(o=r.getAttribute("type")||r.type||!1,!o||!/submit|button|cancel/i.tp)))return!0;if(u.hasfocus||u.hasmousefocus&&!e||u.ispage&&!e&&!h){if(f=n.keyCode,i=n.ctrlKey||!1,u.locked&&f!=27)return u.cancelEvent(n);t=!1;switch(f){case 38:case 63233:u.doScrollBy(72),t=!0;break;case 40:case 63235:u.doScrollBy(-72),t=!0;break;case 37:case 63232:u.railh&&(i?u.doScrollLeft(0):u.doScrollLeftBy(72),t=!0);break;case 39:case 63234:u.railh&&(i?u.doScrollLeft(u.page.maxw):u.doScrollLeftBy(-72),t=!0);break;case 33:case 63276:u.doScrollBy(u.view.h),t=!0;break;case 34:case 63277:u.doScrollBy(-u.view.h),t=!0;break;case 36:case 63273:u.railh&&i?u.doScrollPos(0,0):u.doScrollTo(0),t=!0;break;case 35:case 63275:u.railh&&i?u.doScrollPos(u.page.maxw,u.page.maxh):u.doScrollTo(u.page.maxh),t=!0;break;case 32:u.opt.spacebarenabled&&(u.doScrollBy(-u.view.h),t=!0);break;case 27:u.zoomactive&&(u.doZoom(),t=!0)}if(t)return u.cancelEvent(n)}},u.opt.enablekeyboard&&u.bind(document,o.isopera&&!o.isopera12?"keypress":"keydown",u.onkeypress),u.bind(window,"resize",u.resize),u.bind(window,"orientationchange",u.resize),u.bind(window,"load",u.resize),!o.ischrome||u.ispage||u.haswrapper||(nt=u.win.attr("style"),d=parseFloat(u.win.css("width"))+1,u.win.css("width",d),u.synched("chromefix",function(){u.win.attr("style",nt)})),u.onAttributeChange=function(){u.lazyResize()},u.ispage||u.haswrapper||("WebKitMutationObserver"in window?(u.observer=new WebKitMutationObserver(function(n){n.forEach(u.onAttributeChange)}),u.observer.observe(u.win[0],{attributes:!0,subtree:!1})):(u.bind(u.win,o.isie&&!o.isie9?"propertychange":"DOMAttrModified",u.onAttributeChange),o.isie9&&u.win[0].attachEvent("onpropertychange",u.onAttributeChange))),!u.ispage&&u.opt.boxzoom&&u.bind(window,"resize",u.resizeZoom),u.istextarea&&u.bind(u.win,"mouseup",u.resize),u.resize()}if(this.doc[0].nodeName=="IFRAME"){function g(){var i,f,r;u.iframexd=!1;try{i="contentDocument"in this?this.contentDocument:this.contentWindow.document,f=i.domain}catch(n){u.iframexd=!0,i=!1}if(u.iframexd)return"console"in window&&console.log("NiceScroll error: policy restriced iframe"),!0;u.forcescreen=!0,u.isiframe&&(u.iframe={doc:t(i),html:u.doc.contents().find("html")[0],body:u.doc.contents().find("body")[0]},u.getContentSize=function(){return{w:Math.max(u.iframe.html.scrollWidth,u.iframe.body.scrollWidth),h:Math.max(u.iframe.html.scrollHeight,u.iframe.body.scrollHeight)}},u.docscroll=t(u.iframe.body)),o.isios||!u.opt.iframeautoresize||u.isiframe||(u.win.scrollTop(0),u.doc.height(""),r=Math.max(i.getElementsByTagName("html")[0].scrollHeight,i.body.scrollHeight),u.doc.height(r)),u.resize(),o.isie7&&u.css(t(u.iframe.html),{"overflow-y":"hidden"}),u.css(t(u.iframe.body),{"overflow-y":"hidden"}),"contentWindow"in this?u.bind(this.contentWindow,"scroll",u.onscroll):u.bind(i,"scroll",u.onscroll),u.opt.enablemousewheel&&u.bind(i,"mousewheel",u.onmousewheel),u.opt.enablekeyboard&&u.bind(i,o.isopera?"keypress":"keydown",u.onkeypress),(o.cantouch||u.opt.touchbehavior)&&(u.bind(i,"mousedown",u.onmousedown),u.bind(i,"mousemove",function(n){u.onmousemove(n,!0)}),o.cursorgrabvalue&&u.css(t(i.body),{cursor:o.cursorgrabvalue})),u.bind(i,"mouseup",u.onmouseup),u.zoom&&(u.opt.dblclickzoom&&u.bind(i,"dblclick",u.doZoom),u.ongesturezoom&&u.bind(i,"gestureend",u.ongesturezoom))}this.doc[0].readyState&&this.doc[0].readyState=="complete"&&setTimeout(function(){g.call(u.doc[0],!1)},500),u.bind(this.doc,"load",g)}},this.showCursor=function(n,t){(u.cursortimeout&&(clearTimeout(u.cursortimeout),u.cursortimeout=0),u.rail)&&(u.autohidedom&&(u.autohidedom.stop().css({opacity:u.opt.cursoropacitymax}),u.cursoractive=!0),typeof n!="undefined"&&n!==!1&&(u.scroll.y=Math.round(n*1/u.scrollratio.y)),typeof t!="undefined"&&(u.scroll.x=Math.round(t*1/u.scrollratio.x)),u.cursor.css({height:u.cursorheight,top:u.scroll.y}),u.cursorh&&(!u.rail.align&&u.rail.visibility?u.cursorh.css({width:u.cursorwidth,left:u.scroll.x+u.rail.width}):u.cursorh.css({width:u.cursorwidth,left:u.scroll.x}),u.cursoractive=!0),u.zoom&&u.zoom.stop().css({opacity:u.opt.cursoropacitymax}))},this.hideCursor=function(n){u.cursortimeout||u.rail&&u.autohidedom&&(u.cursortimeout=setTimeout(function(){u.rail.active&&u.showonmouseevent||(u.autohidedom.stop().animate({opacity:u.opt.cursoropacitymin}),u.zoom&&u.zoom.stop().animate({opacity:u.opt.cursoropacitymin}),u.cursoractive=!1),u.cursortimeout=0},n||400))},this.noticeCursor=function(n,t,i){u.showCursor(t,i),u.rail.active||u.hideCursor(n)},this.getContentSize=u.ispage?function(){return{w:Math.max(document.body.scrollWidth,document.documentElement.scrollWidth),h:Math.max(document.body.scrollHeight,document.documentElement.scrollHeight)}}:u.haswrapper?function(){return{w:u.doc.outerWidth()+parseInt(u.win.css("paddingLeft"))+parseInt(u.win.css("paddingRight")),h:u.doc.outerHeight()+parseInt(u.win.css("paddingTop"))+parseInt(u.win.css("paddingBottom"))}}:function(){return{w:u.docscroll[0].scrollWidth,h:u.docscroll[0].scrollHeight}},this.onResize=function(n,t){var i,r,f;if(!u.win)return!1;if(!u.haswrapper&&!u.ispage){if(u.win.css("display")=="none")return u.visibility&&u.hideRail().hideRailHr(),!1;u.hidden||u.visibility||u.showRail().showRailHr()}var o=u.page.maxh,e=u.page.maxw,s={h:u.view.h,w:u.view.w};if(u.view={w:u.ispage?u.win.width():parseInt(u.win[0].clientWidth),h:u.ispage?u.win.height():parseInt(u.win[0].clientHeight)},u.page=t?t:u.getContentSize(),u.page.maxh=Math.max(0,u.page.h-u.view.h),u.page.maxw=Math.max(0,u.page.w-u.view.w),u.page.maxh==o&&u.page.maxw==e&&u.view.w==s.w){if(u.ispage||(i=u.win.offset(),u.lastposition&&(r=u.lastposition,r.top==i.top&&r.left==i.left)))return u;u.lastposition=i}return(u.page.maxh==0?(u.hideRail(),u.scrollvaluemax=0,u.scroll.y=0,u.scrollratio.y=0,u.cursorheight=0,u.setScrollTop(0),u.rail.scrollable=!1):u.rail.scrollable=!0,u.page.maxw==0?(u.hideRailHr(),u.scrollvaluemaxw=0,u.scroll.x=0,u.scrollratio.x=0,u.cursorwidth=0,u.setScrollLeft(0),u.railh.scrollable=!1):u.railh.scrollable=!0,u.locked=u.page.maxh==0&&u.page.maxw==0,u.locked)?(u.ispage||u.updateScrollBar(u.view),!1):(u.hidden||u.visibility?u.hidden||u.railh.visibility||u.showRailHr():u.showRail().showRailHr(),u.istextarea&&u.win.css("resize")&&u.win.css("resize")!="none"&&(u.view.h-=20),u.ispage||u.updateScrollBar(u.view),u.cursorheight=Math.min(u.view.h,Math.round(u.view.h*(u.view.h/u.page.h))),u.cursorheight=Math.max(u.opt.cursorminheight,u.cursorheight),u.cursorwidth=Math.min(u.view.w,Math.round(u.view.w*(u.view.w/u.page.w))),u.cursorwidth=Math.max(u.opt.cursorminheight,u.cursorwidth),u.scrollvaluemax=u.view.h-u.cursorheight-u.cursor.hborder,u.railh&&(u.railh.width=u.page.maxh>0?u.view.w-u.rail.width:u.view.w,u.scrollvaluemaxw=u.railh.width-u.cursorwidth-u.cursorh.wborder),u.scrollratio={x:u.page.maxw/u.scrollvaluemaxw,y:u.page.maxh/u.scrollvaluemax},f=u.getScrollTop(),f>u.page.maxh?u.doScroll(u.page.maxh):(u.scroll.y=Math.round(u.getScrollTop()*(1/u.scrollratio.y)),u.scroll.x=Math.round(u.getScrollLeft()*(1/u.scrollratio.x)),u.cursoractive&&u.noticeCursor()),u.scroll.y&&u.getScrollTop()==0&&u.doScrollTo(Math.floor(u.scroll.y*u.scrollratio.y)),u)},this.resize=function(){return u.delayed("resize",u.onResize,30),u},this.lazyResize=function(){u.delayed("resize",u.resize,250)},this._bind=function(n,t,i,r){u.events.push({e:n,n:t,f:i,b:r}),n.addEventListener?n.addEventListener(t,i,r||!1):n.attachEvent?n.attachEvent("on"+t,i):n["on"+t]=i},this.bind=function(n,t,i,r){var f="jquery"in n?n[0]:n,e;f.addEventListener?(o.cantouch&&/mouseup|mousedown|mousemove/.test(t)&&(e=t=="mousedown"?"touchstart":t=="mouseup"?"touchend":"touchmove",u._bind(f,e,function(n){var t;n.touches?n.touches.length<2&&(t=n.touches.length?n.touches[0]:n,t.original=n,i.call(this,t)):n.changedTouches&&(t=n.changedTouches[0],t.original=n,i.call(this,t))},r||!1)),u._bind(f,t,i,r||!1),t=="mousewheel"&&u._bind(f,"DOMMouseScroll",i,r||!1),o.cantouch&&t=="mouseup"&&u._bind(f,"touchcancel",i,r||!1)):u._bind(f,t,function(n){return n=n||window.event||!1,n&&n.srcElement&&(n.target=n.srcElement),i.call(f,n)===!1||r===!1?u.cancelEvent(n):!0})},this._unbind=function(n,t,i,r){n.removeEventListener?n.removeEventListener(t,i,r):n.detachEvent?n.detachEvent("on"+t,i):n["on"+t]=!1},this.unbindAll=function(){for(var n,t=0;t<u.events.length;t++)n=u.events[t],u._unbind(n.e,n.n,n.f,n.b)},this.cancelEvent=function(n){var n=n.original?n.original:n?n:window.event||!1;return n?(n.preventDefault&&n.preventDefault(),n.stopPropagation&&n.stopPropagation(),n.preventManipulation&&n.preventManipulation(),n.cancelBubble=!0,n.cancel=!0,n.returnValue=!1,!1):!1},this.stopPropagation=function(n){var n=n.original?n.original:n?n:window.event||!1;return n?n.stopPropagation?n.stopPropagation():(n.cancelBubble&&(n.cancelBubble=!0),!1):!1},this.showRail=function(){return u.page.maxh!=0&&(u.ispage||u.win.css("display")!="none")&&(u.visibility=!0,u.rail.visibility=!0,u.rail.css("display","block")),u},this.showRailHr=function(){return u.railh?(u.page.maxw!=0&&(u.ispage||u.win.css("display")!="none")&&(u.railh.visibility=!0,u.railh.css("display","block")),u):u},this.hideRail=function(){return u.visibility=!1,u.rail.visibility=!1,u.rail.css("display","none"),u},this.hideRailHr=function(){return u.railh?(u.railh.visibility=!1,u.railh.css("display","none"),u):u},this.show=function(){return u.hidden=!1,u.locked=!1,u.showRail().showRailHr()},this.hide=function(){return u.hidden=!0,u.locked=!0,u.hideRail().hideRailHr()},this.remove=function(){var t,n;for(u.doZoomOut(),u.unbindAll(),u.observer!==!1&&u.observer.disconnect(),u.events=[],u.cursor&&(u.cursor.remove(),u.cursor=null),u.cursorh&&(u.cursorh.remove(),u.cursorh=null),u.rail&&(u.rail.remove(),u.rail=null),u.railh&&(u.railh.remove(),u.railh=null),u.zoom&&(u.zoom.remove(),u.zoom=null),t=0;t<u.saved.css.length;t++)n=u.saved.css[t],n[0].css(n[1],typeof n[2]=="undefined"?"":n[2]);return u.saved=!1,u.me.data("__nicescroll",""),u.me=null,u.doc=null,u.docscroll=null,u.win=null,u},this.scrollstart=function(n){return this.onscrollstart=n,u},this.scrollend=function(n){return this.onscrollend=n,u},this.scrollcancel=function(n){return this.onscrollcancel=n,u},this.zoomin=function(n){return this.onzoomin=n,u},this.zoomout=function(n){return this.onzoomout=n,u},this.isScrollable=function(n){for(var i=n.target?n.target:n,r,u;i&&i.nodeType==1&&!/BODY|HTML/.test(i.nodeName);){if(r=t(i),u=r.css("overflowY")||r.css("overflowX")||r.css("overflow")||"",/scroll|auto/.test(u))return i.clientHeight!=i.scrollHeight;i=i.parentNode?i.parentNode:!1}return!1},this.onmousewheel=function(n){return u.locked?!0:u.rail.scrollable?(u.opt.preservenativescrolling&&u.checkarea&&(u.checkarea=!1,u.nativescrollingarea=u.isScrollable(n)),u.nativescrollingarea)?!0:u.locked?u.cancelEvent(n):u.rail.drag?u.cancelEvent(n):(a(n,!1),u.cancelEvent(n)):u.railh&&u.railh.scrollable?u.onmousewheelhr(n):!0},this.onmousewheelhr=function(n){return u.locked||!u.railh.scrollable?!0:(u.opt.preservenativescrolling&&u.checkarea&&(u.checkarea=!1,u.nativescrollingarea=u.isScrollable(n)),u.nativescrollingarea)?!0:u.locked?u.cancelEvent(n):u.rail.drag?u.cancelEvent(n):(a(n,!0),u.cancelEvent(n))},this.stop=function(){return u.cancelScroll(),u.scrollmon&&u.scrollmon.stop(),u.cursorfreezed=!1,u.scroll.y=Math.round(u.getScrollTop()*(1/u.scrollratio.y)),u.noticeCursor(),u},this.getTransitionSpeed=function(n){var i=Math.round(u.opt.scrollspeed*10),t=Math.min(i,Math.round(n/20*u.opt.scrollspeed));return t>1?t:0},u.opt.smoothscroll?u.ishwscroll&&o.hastransition&&u.opt.usetransition?(this.prepareTransition=function(n,t){var r=t?n>20?n:0:u.getTransitionSpeed(n),i=r?o.prefixstyle+"transform "+r+"ms ease-out":"";return u.lasttransitionstyle&&u.lasttransitionstyle==i||(u.lasttransitionstyle=i,u.doc.css(o.transitionstyle,i)),r},this.doScrollLeft=function(n,t){var i=u.scrollrunning?u.newscrolly:u.getScrollTop();u.doScrollPos(n,i,t)},this.doScrollTop=function(n,t){var i=u.scrollrunning?u.newscrollx:u.getScrollLeft();u.doScrollPos(i,n,t)},this.doScrollPos=function(n,t,i){var f=u.getScrollTop(),r=u.getScrollLeft();if(((u.newscrolly-f)*(t-f)<0||(u.newscrollx-r)*(n-r)<0)&&u.cancelScroll(),u.newscrolly=t,u.newscrollx=n,u.newscrollspeed=i||!1,u.timer)return!1;u.timer=setTimeout(function(){var f=u.getScrollTop(),e=u.getScrollLeft(),i={},h,s,c;i.x=n-e,i.y=t-f,i.px=e,i.py=f;var a=Math.round(Math.sqrt(Math.pow(i.x,2)+Math.pow(i.y,2))),l=u.newscrollspeed?u.newscrollspeed:a,r=u.prepareTransition(l);u.timerscroll&&u.timerscroll.tm&&clearInterval(u.timerscroll.tm),r>0&&(!u.scrollrunning&&u.onscrollstart&&(h={type:"scrollstart",current:{x:e,y:f},request:{x:n,y:t},end:{x:u.newscrollx,y:u.newscrolly},speed:r},u.onscrollstart.call(u,h)),o.transitionend?u.scrollendtrapped||(u.scrollendtrapped=!0,u.bind(u.doc,o.transitionend,u.onScrollEnd,!1)):(u.scrollendtrapped&&clearTimeout(u.scrollendtrapped),u.scrollendtrapped=setTimeout(u.onScrollEnd,r)),s=f,c=e,u.timerscroll={bz:new BezierClass(s,u.newscrolly,r,0,0,.58,1),bh:new BezierClass(c,u.newscrollx,r,0,0,.58,1)},u.cursorfreezed||(u.timerscroll.tm=setInterval(function(){u.showCursor(u.getScrollTop(),u.getScrollLeft())},60))),u.synched("doScroll-set",function(){u.timer=0,u.scrollendtrapped&&(u.scrollrunning=!0),u.setScrollTop(u.newscrolly),u.setScrollLeft(u.newscrollx),u.scrollendtrapped||u.onScrollEnd()})},50)},this.cancelScroll=function(){if(!u.scrollendtrapped)return!0;var t=u.getScrollTop(),n=u.getScrollLeft();return u.scrollrunning=!1,o.transitionend||clearTimeout(o.transitionend),u.scrollendtrapped=!1,u._unbind(u.doc,o.transitionend,u.onScrollEnd),u.prepareTransition(0),u.setScrollTop(t),u.railh&&u.setScrollLeft(n),u.timerscroll&&u.timerscroll.tm&&clearInterval(u.timerscroll.tm),u.timerscroll=!1,u.cursorfreezed=!1,u.showCursor(t,n),u},this.onScrollEnd=function(){var t,n,i;if(u.scrollendtrapped&&u._unbind(u.doc,o.transitionend,u.onScrollEnd),u.scrollendtrapped=!1,u.prepareTransition(0),u.timerscroll&&u.timerscroll.tm&&clearInterval(u.timerscroll.tm),u.timerscroll=!1,t=u.getScrollTop(),n=u.getScrollLeft(),u.setScrollTop(t),u.railh&&u.setScrollLeft(n),u.noticeCursor(!1,t,n),u.cursorfreezed=!1,t<0?t=0:t>u.page.maxh&&(t=u.page.maxh),n<0?n=0:n>u.page.maxw&&(n=u.page.maxw),t!=u.newscrolly||n!=u.newscrollx)return u.doScrollPos(n,t,u.opt.snapbackspeed);u.onscrollend&&u.scrollrunning&&(i={type:"scrollend",current:{x:n,y:t},end:{x:u.newscrollx,y:u.newscrolly}},u.onscrollend.call(u,i)),u.scrollrunning=!1}):(this.doScrollLeft=function(n){var t=u.scrollrunning?u.newscrolly:u.getScrollTop();u.doScrollPos(n,t)},this.doScrollTop=function(n){var t=u.scrollrunning?u.newscrollx:u.getScrollLeft();u.doScrollPos(t,n)},this.doScrollPos=function(n,t){function a(){var f,n,t,r,e;if(u.cancelAnimationFrame)return!0;if(u.scrollrunning=!0,c=1-c,c)return u.timer=i(a)||1;f=0,n=sy=u.getScrollTop(),u.dst.ay?(n=u.bzscroll?u.dst.py+u.bzscroll.getNow()*u.dst.ay:u.newscrolly,r=n-sy,(r<0&&n<u.newscrolly||r>0&&n>u.newscrolly)&&(n=u.newscrolly),u.setScrollTop(n),n==u.newscrolly&&(f=1)):f=1,t=sx=u.getScrollLeft(),u.dst.ax?(t=u.bzscroll?u.dst.px+u.bzscroll.getNow()*u.dst.ax:u.newscrollx,r=t-sx,(r<0&&t<u.newscrollx||r>0&&t>u.newscrollx)&&(t=u.newscrollx),u.setScrollLeft(t),t==u.newscrollx&&(f+=1)):f+=1,f==2?(u.timer=0,u.cursorfreezed=!1,u.bzscroll=!1,u.scrollrunning=!1,n<0?n=0:n>u.page.maxh&&(n=u.page.maxh),t<0?t=0:t>u.page.maxw&&(t=u.page.maxw),t!=u.newscrollx||n!=u.newscrolly?u.doScrollPos(t,n):u.onscrollend&&(e={type:"scrollend",current:{x:sx,y:sy},end:{x:u.newscrollx,y:u.newscrolly}},u.onscrollend.call(u,e))):u.timer=i(a)||1}var t=typeof t=="undefined"||t===!1?u.getScrollTop(!0):t,e,r,h,l,o,s,c,v;if(u.timer&&u.newscrolly==t&&u.newscrollx==n)return!0;(u.timer&&f(u.timer),u.timer=0,e=u.getScrollTop(),r=u.getScrollLeft(),((u.newscrolly-e)*(t-e)<0||(u.newscrollx-r)*(n-r)<0)&&u.cancelScroll(),u.newscrolly=t,u.newscrollx=n,u.bouncescroll&&u.rail.visibility||(u.newscrolly<0?u.newscrolly=0:u.newscrolly>u.page.maxh&&(u.newscrolly=u.page.maxh)),u.bouncescroll&&u.railh.visibility||(u.newscrollx<0?u.newscrollx=0:u.newscrollx>u.page.maxw&&(u.newscrollx=u.page.maxw)),u.dst={},u.dst.x=n-r,u.dst.y=t-e,u.dst.px=r,u.dst.py=e,h=Math.round(Math.sqrt(Math.pow(u.dst.x,2)+Math.pow(u.dst.y,2))),u.dst.ax=u.dst.x/h,u.dst.ay=u.dst.y/h,l=0,o=h,u.dst.x==0?(l=e,o=t,u.dst.ay=1,u.dst.py=0):u.dst.y==0&&(l=r,o=n,u.dst.ax=1,u.dst.px=0),s=u.getTransitionSpeed(h),u.bzscroll=s>0?u.bzscroll?u.bzscroll.update(o,s):new BezierClass(l,o,s,0,1,0,1):!1,u.timer)||((e==u.page.maxh&&t>=u.page.maxh||r==u.page.maxw&&n>=u.page.maxw)&&u.checkContentSize(),c=1,u.cancelAnimationFrame=!1,u.timer=1,u.onscrollstart&&!u.scrollrunning&&(v={type:"scrollstart",current:{x:r,y:e},request:{x:n,y:t},end:{x:u.newscrollx,y:u.newscrolly},speed:s},u.onscrollstart.call(u,v)),a(),(e==u.page.maxh&&t>=e||r==u.page.maxw&&n>=r)&&u.checkContentSize(),u.noticeCursor())},this.cancelScroll=function(){return u.timer&&f(u.timer),u.timer=0,u.bzscroll=!1,u.scrollrunning=!1,u}):(this.doScrollLeft=function(n,t){var i=u.getScrollTop();u.doScrollPos(n,i,t)},this.doScrollTop=function(n,t){var i=u.getScrollLeft();u.doScrollPos(i,n,t)},this.doScrollPos=function(n,t){var f=n>u.page.maxw?u.page.maxw:n,r;f<0&&(f=0),r=t>u.page.maxh?u.page.maxh:t,r<0&&(r=0),u.synched("scroll",function(){u.setScrollTop(r),u.setScrollLeft(f)})},this.cancelScroll=function(){}),this.doScrollBy=function(n,t){var i=0,f,r;if(t?i=Math.floor((u.scroll.y-n)*u.scrollratio.y):(f=u.timer?u.newscrolly:u.getScrollTop(!0),i=f-n),u.bouncescroll&&(r=Math.round(u.view.h/2),i<-r?i=-r:i>u.page.maxh+r&&(i=u.page.maxh+r)),u.cursorfreezed=!1,py=u.getScrollTop(!0),i<0&&py<=0)return u.noticeCursor();if(i>u.page.maxh&&py>=u.page.maxh)return u.checkContentSize(),u.noticeCursor();u.doScrollTop(i)},this.doScrollLeftBy=function(n,t){var i=0,f,r;if((t?i=Math.floor((u.scroll.x-n)*u.scrollratio.x):(f=u.timer?u.newscrollx:u.getScrollLeft(!0),i=f-n),u.bouncescroll&&(r=Math.round(u.view.w/2),i<-r?i=-r:i>u.page.maxw+r&&(i=u.page.maxw+r)),u.cursorfreezed=!1,px=u.getScrollLeft(!0),i<0&&px<=0)||i>u.page.maxw&&px>=u.page.maxw)return u.noticeCursor();u.doScrollLeft(i)},this.doScrollTo=function(n,t){var i=t?Math.round(n*u.scrollratio.y):n;i<0?i=0:i>u.page.maxh&&(i=u.page.maxh),u.cursorfreezed=!1,u.doScrollTop(n)},this.checkContentSize=function(){var n=u.getContentSize();(n.h!=u.page.h||n.w!=u.page.w)&&u.resize(!1,n)},u.onscroll=function(){u.rail.drag||u.cursorfreezed||u.synched("scroll",function(){u.scroll.y=Math.round(u.getScrollTop()*(1/u.scrollratio.y)),u.railh&&(u.scroll.x=Math.round(u.getScrollLeft()*(1/u.scrollratio.x))),u.noticeCursor()})},u.bind(u.docscroll,"scroll",u.onscroll),this.doZoomIn=function(n){var f,e,s,i,r;if(!u.zoomactive){u.zoomactive=!0,u.zoomrestore={style:{}},f=["position","top","left","zIndex","backgroundColor","marginTop","marginBottom","marginLeft","marginRight"],e=u.win[0].style;for(s in f)i=f[s],u.zoomrestore.style[i]=typeof e[i]!="undefined"?e[i]:"";return u.zoomrestore.style.width=u.win.css("width"),u.zoomrestore.style.height=u.win.css("height"),u.zoomrestore.padding={w:u.win.outerWidth()-u.win.width(),h:u.win.outerHeight()-u.win.height()},o.isios4&&(u.zoomrestore.scrollTop=t(window).scrollTop(),t(window).scrollTop(0)),u.win.css({position:o.isios4?"absolute":"fixed",top:0,left:0,"z-index":u.opt.zindex+100,margin:"0px"}),r=u.win.css("backgroundColor"),(r==""||/transparent|rgba\(0, 0, 0, 0\)|rgba\(0,0,0,0\)/.test(r))&&u.win.css("backgroundColor","#fff"),u.rail.css({"z-index":u.opt.zindex+110}),u.zoom.css({"z-index":u.opt.zindex+112}),u.zoom.css("backgroundPosition","0px -18px"),u.resizeZoom(),u.onzoomin&&u.onzoomin.call(u),u.cancelEvent(n)}},this.doZoomOut=function(n){if(u.zoomactive)return u.zoomactive=!1,u.win.css("margin",""),u.win.css(u.zoomrestore.style),o.isios4&&t(window).scrollTop(u.zoomrestore.scrollTop),u.rail.css({"z-index":u.ispage?u.opt.zindex:u.opt.zindex+2}),u.zoom.css({"z-index":u.opt.zindex}),u.zoomrestore=!1,u.zoom.css("backgroundPosition","0px 0px"),u.onResize(),u.onzoomout&&u.onzoomout.call(u),u.cancelEvent(n)},this.doZoom=function(n){return u.zoomactive?u.doZoomOut(n):u.doZoomIn(n)},this.resizeZoom=function(){if(u.zoomactive){var n=u.getScrollTop();u.win.css({width:t(window).width()-u.zoomrestore.padding.w+"px",height:t(window).height()-u.zoomrestore.padding.h+"px"}),u.onResize(),u.setScrollTop(Math.min(u.page.maxh,n))}},this.init(),t.nicescroll.push(this)},c=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.time=function(){return+new Date},this.reset=function(n,i){t.stop();var r=t.time();t.steptime=0,t.lasttime=r,t.speedx=0,t.speedy=0,t.lastx=n,t.lasty=i,t.lastscrollx=-1,t.lastscrolly=-1},this.update=function(n,i){var o=t.time();t.steptime=o-t.lasttime,t.lasttime=o;var e=i-t.lasty,f=n-t.lastx,s=t.nc.getScrollTop(),h=t.nc.getScrollLeft(),r=s+e,u=h+f;t.snapx=u<0||u>t.nc.page.maxw,t.snapy=r<0||r>t.nc.page.maxh,t.speedx=f,t.speedy=e,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)},this.doMomentum=function(n){var o=t.time(),l=n?o+n:t.lasttime,y=t.nc.getScrollLeft(),v=t.nc.getScrollTop(),s=t.nc.page.maxh,h=t.nc.page.maxw,f,a,p,u,e;if(t.speedx=h>0?Math.min(60,t.speedx):0,t.speedy=s>0?Math.min(60,t.speedy):0,f=l&&o-l<=50,(v<0||v>s||y<0||y>h)&&(f=!1),a=t.speedy&&f?t.speedy:!1,p=t.speedx&&f?t.speedx:!1,a||p){u=Math.max(16,t.steptime),u>50&&(e=u/50,t.speedx*=e,t.speedy*=e,u=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,c=function(){var n=t.time()-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 u,n;t.speedx&&(u=t.nc.getScrollLeft(),u!=t.chkx&&t.stop(),t.chkx=i,t.nc.setScrollLeft(i)),t.speedy&&(n=t.nc.getScrollTop(),n!=t.chky&&t.stop(),t.chky=r,t.nc.setScrollTop(r)),t.timer||(t.nc.hideCursor(),t.doSnapy(i,r))}),t.demulxy<1?t.timer=setTimeout(c,u):(t.stop(),t.nc.hideCursor(),t.doSnapy(i,r))};c()}else t.doSnapy(t.nc.getScrollLeft(),t.nc.getScrollTop())}},o=n.fn.scrollTop,r,u;t.cssHooks.pageYOffset={get:function(n){var u=t.data(n,"__nicescroll")||!1;return u&&u.ishwscroll?u.getScrollTop():o.call(n)},set:function(n,i){var r=t.data(n,"__nicescroll")||!1;return r&&r.ishwscroll?r.setScrollTop(parseInt(i)):o.call(n,i),this}},n.fn.scrollTop=function(n){if(typeof n=="undefined"){var i=this[0]?t.data(this[0],"__nicescroll")||!1:!1;return i&&i.ishwscroll?i.getScrollTop():o.call(this)}return this.each(function(){var i=t.data(this,"__nicescroll")||!1;i&&i.ishwscroll?i.setScrollTop(parseInt(n)):o.call(t(this),n)})},r=n.fn.scrollLeft,t.cssHooks.pageXOffset={get:function(n){var f=t.data(n,"__nicescroll")||!1;return f&&f.ishwscroll?f.getScrollLeft():r.call(n)},set:function(n,i){var u=t.data(n,"__nicescroll")||!1;return u&&u.ishwscroll?u.setScrollLeft(parseInt(i)):r.call(n,i),this}},n.fn.scrollLeft=function(n){if(typeof n=="undefined"){var i=this[0]?t.data(this[0],"__nicescroll")||!1:!1;return i&&i.ishwscroll?i.getScrollLeft():r.call(this)}return this.each(function(){var i=t.data(this,"__nicescroll")||!1;i&&i.ishwscroll?i.setScrollLeft(parseInt(n)):r.call(t(this),n)})},u=function(n){var i=this,r;if(this.length=0,this.name="nicescrollarray",this.each=function(n){for(var t=0;t<i.length;t++)n.call(i[t]);return i},this.push=function(n){i[i.length]=n,i.length++},this.eq=function(n){return i[n]},n)for(a=0;a<n.length;a++)r=t.data(n[a],"__nicescroll")||!1,r&&(this[this.length]=r,this.length++);return this},v(u.prototype,["show","hide","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 typeof n=="undefined"?new u(this):t.data(this[n],"__nicescroll")||!1},n.extend(n.expr[":"],{nicescroll:function(n){return t.data(n,"__nicescroll")?!0:!1}}),t.fn.niceScroll=function(n,i){var r,f;return typeof i=="undefined"&&(typeof n!="object"||"jquery"in n||(i=n,n=!1)),r=new u,typeof i=="undefined"&&(i={}),(n||!1)&&(i.doc=t(n),i.win=t(this)),f=!("doc"in i),f||"win"in i||(i.win=t(this)),this.each(function(){var n=t(this).data("__nicescroll")||!1;n||(i.doc=f?t(this):i.doc,n=new l(i,t(this)),t(this).data("__nicescroll",n)),r.push(n)}),r.length==1?r[0]:r},window.NiceScroll={getjQuery:function(){return n}},t.nicescroll||(t.nicescroll=new u)}(jQuery),function(){function t(){var t=n.refid;try{t!=undefined&&console.log("referral_id="+t)}catch(i){}t!=undefined&&$.cookie("referral_id",t,{expires:30,path:"/",domain:"creative.com"})}var n={};(function(){for(var t,u=/\+/g,f=/([^&=]+)=?([^&]*)/g,i=function(n){return decodeURIComponent(n.replace(u," "))},r=window.location.search.substring(1);t=f.exec(r);)n[i(t[1])]=i(t[2])})(),$("document").ready(function(){t()})}($)