function updateUploadBoxes(){uploadBoxes=[];$(".x-control.x-upload-box").each(function(index,ub){var $ub=$(ub),uploadForm,typ;$ub.id=ub.id;uploadForm=$("*[data-form]",$($ub));$ub.supportedTypes=[];typ=$ub.data("file-types");$ub.supportedTypes=typ.length>0?typ.split(","):[];$ub.serviceUrl=$ub.data("serviceurl");$ub.initCallback=function(){};$ub.successCallback=function(){};$ub.failureCallback=function(){};$ub.cancelCallback=function(){};$ub.progressCallback=function(){};$ub.input=$("*[data-input]",$($ub));$ub.remove=$("*[data-remove-button]",$($ub));$ub.isFileSelected=function(){return $ub.input.val().length<1?!1:!0};$ub.isValid=function(){var input,type,found,i;if(!this.isFileSelected())return!0;if(input=$("*[data-input]",$($ub)),type=input.val().substr((~-input.val().lastIndexOf(".")>>>0)+2).toLowerCase(),this.supportedTypes.length>0){for(found=!1,i=0;i>>0)+2).toLowerCase(),this.supportedTypes.length>0){for(found=!1,i=0;i-1&&(mask+="abcdefghijklmnopqrstuvwxyz"),chars.indexOf("A")>-1&&(mask+="ABCDEFGHIJKLMNOPQRSTUVWXYZ"),chars.indexOf("#")>-1&&(mask+="0123456789"),chars.indexOf("!")>-1&&(mask+="~`!@#$%^&*()_+-={}[]:\";'<>?,./|\\"),result="",i=length;i>0;--i)result+=mask[Math.round(Math.random()*(mask.length-1))];return result}function initDropDownMenus(){function mouseenter(){$(this).addClass("hovered")}function mouseleave(){$(this).removeClass("hovered")}var $submenus=$(".main-menu > ul > li .nav-2"),config;$submenus.length!=0&&(config={sensitivity:2,interval:100,over:mouseenter,timeout:200,out:mouseleave},$submenus.parent().hoverIntent(config),initThreeLevelDropDownMenu())}function initThreeLevelDropDownMenu(){var totalSiteWidth=960,totalThreshold=30,$topLi=$(".threeLevel");$topLi.length!=0&&$topLi.each(function(){var totalWidth=0;$(this).find(".level_3_ul").each(function(){totalWidth+=$(this).width()+1});totalWidth>totalSiteWidth-totalThreshold&&(totalWidth=totalSiteWidth);$(this).find(".submenu > li").width(totalWidth);var relPos=parseInt($(this).position().left)+1,availableSpace=totalSiteWidth-relPos,excess=availableSpace-totalWidth;excess<0&&(-excess>relPos&&(excess=-relPos),$(this).find(".submenu").css({left:excess}))})}function initMyAccountFunctions(){typeof InitMyAccountFunctions=="function"&&InitMyAccountFunctions()}function initCheckoutFunction(){typeof InitCheckoutFunctions=="function"&&InitCheckoutFunctions()}function initProductDetailsFunction(){typeof initProductDetails=="function"&&initProductDetails()}function initWaterInputs(){$(".waterInput").length<1||$(".waterInput").each(function(){var val=$(this).attr("data-name");$(this).watermark(val)})}function initClickableBackground(){$(".site-background .x-htmlarea ul li a").length<1||$(".site-container").click(function(e){$(e.target)[0]==$(".site-container")[0]&&(window.location=$(".site-background .x-htmlarea ul li a").attr("href"))})}function initDetailsThumbs(){$(".details-thumbs-carouzel").each(function(){var numOfItems=$(this).find("li").length;numOfItems>3&&($(this).siblings(".details-thumbs-next").addClass("shown"),$(this).siblings(".details-thumbs-prev").addClass("shown"),$(this).jCarouselLite({btnNext:$(this).siblings(".details-thumbs-next"),btnPrev:$(this).siblings(".details-thumbs-prev"),visible:3,start:0,scroll:3,circular:!1,easing:"easeInOutCubic",speed:700,vertical:!0}))})}function UpdateQueryString(key,value,url){var re,value,pos,separator,hash;return url||(url=window.location.href),re=new RegExp("([?|&])"+key+"=.*?(&|#|$)","gi"),url.match(re)?(value=value?url.replace(re,"$1"+key+"="+value+"$2"):url.replace(re,"$2"),value.indexOf("?")==-1&&(pos=value.indexOf("&"),pos!=-1&&(value=value.substring(0,pos-1)+"?"+value.substring(pos+1,value.length))),value):value?(separator=url.indexOf("?")!==-1?"&":"?",hash=url.split("#"),url=hash[0]+separator+key+"="+value,hash[1]&&(url+="#"+hash[1]),url):url}function getQueryStringValueByName(name){name=name.replace(/[\[]/,"\\[").replace(/[\]]/,"\\]");var regexS="[\\?&]"+name+"=([^&#]*)",regex=new RegExp(regexS),results=regex.exec(window.location.search);return results==null?"":decodeURIComponent(results[1].replace(/\+/g," "))}function removeValueFromCommaSeparatedString(list,value,separator){var values,i;for(separator=separator||",",values=list.split(separator),i=0;i57)&&event.preventDefault():(event.keyCode<96||event.keyCode>105)&&event.preventDefault())}function preventSpecialCharacter(e){var shiftPressed=e.shiftKey,keyCode=e.keyCode;shiftPressed?(keyCode==188||keyCode==190||keyCode==51||keyCode==55||keyCode==53||keyCode==219||keyCode==221)&&e.preventDefault():(keyCode==191||keyCode==219||keyCode==221||keyCode==111)&&e.preventDefault()}function phoneGROnly(event){numbersOnly(event);$(event.currentTarget).val().length>9&&(event.keyCode==46||event.keyCode==8||event.keyCode==36||event.keyCode==35||event.keyCode==37||event.keyCode==39||event.keyCode==9||event.preventDefault())}function initSearchExpand(){$("body").on("click",function(event){$(event.target).closest(".x-searchbox").length||$(".x-searchbox").hasClass("open")&&$(".x-searchbox").removeClass("open")})}function initListDescrExpand(){if($(".product-list-page").length>0){var $expandBtn=$(".expand-desc"),$expandCont=$(".inner-area-two > .title-container .description");$expandBtn.click(function(){$(this).hasClass("expanded")?($(this).removeClass("expanded"),$expandCont.slideUp()):($(this).addClass("expanded"),$expandCont.slideDown())})}}function initPrintRecipe(){if($(".news-details-page").length>0){var $printBtn=$(".socialShareLinks").find(".addthis_button_print");$printBtn.on("click",function(){var $printCont=$(this).closest(".js-print");$(".news-details-page .print-visible").each(function(){$(this).removeClass("print-visible")});$printCont.addClass("print-visible")})}}function initAvailabilityInfo(){$(".product-details-region .pd-availability-4").length>0?$(".availability-info").show():$(".availability-info").hide()}function initSelectedCutType(){if($(".product-details-region").length>0){var selectedWrapper=$(".x-cut-type-attribute .newListSelected"),select=selectedWrapper.find(".selectedTxt").text(),selectedLink=selectedWrapper.find(".newList li a");$(".cut-type-attr").val(select);selectedLink.on("click",function(){select=selectedWrapper.find(".selectedTxt").text();$(".cut-type-attr").val(select)})}}function stickyHeader(){var header=$(".x-menu.main-menu"),headerHeight=header.height(),scrlTop=$(window).scrollTop(),spacer;header.before("
<\/div>");spacer=$(".spacer");scrlTop>=200?(spacer.height(headerHeight),header.addClass("sticky").addClass("slideInDown")):(spacer.height(0),header.removeClass("sticky").removeClass("slideInDown"));$(window).scroll(function(){scrlTop=$(window).scrollTop();scrlTop>=200?(spacer.height(headerHeight),header.addClass("sticky").addClass("slideInDown")):(spacer.height(0),header.removeClass("sticky").removeClass("slideInDown"))})}function initCheckoutLoggedin(){$(".checkout-completed-region").length>0&&($(".account-area").hasClass("ng-hide")?$(".checkout-completed-region").addClass("logged-in"):$(".checkout-completed-region").addClass("logged-out"))}function initHomeBanner(){if($(".home-page").length>0){$(".x-owl-slider ul ").owlCarousel({items:3,itemsDesktop:[1260,3],itemsMobile:[479,1],itemsTablet:[768,2],itemsDesktopSmall:[980,3],margin:10,loop:!0,autoWidth:!0,navigation:!0,lazyLoad:!0,pagination:!1,navigationText:!1});var slides=$(".x-slider-bottom > ul").children().length;slides<=1&&$(".x-slider-bottom > .nav").hide()}}function initMobileMenu(){var $wrapper=$(".header-template-one");$(".x-sitelogo",$wrapper).detach().prependTo(".header-template-one .region-area-one .center-container .inner-area-one").show();$(".x-language-selector",$wrapper).detach().prependTo(".header-template-one .region-area-three .center-container").show();$(".x-htmlarea",$wrapper).detach().insertAfter(".header-template-one .region-area-three .center-container .main-menu").show()}function initMainMenu(){var $wrapper=$(".header-template-one");$(".x-sitelogo",$wrapper).detach().prependTo(".header-template-one .region-area-two .center-container .inner-area-one").show();$(".x-htmlarea",$wrapper).detach().prependTo(".header-template-one .region-area-two .center-container .inner-area-two").show();$(".x-language-selector",$wrapper).detach().prependTo(".header-template-one .region-area-one .center-container .inner-area-one").show()}function initClickMobileMenu(){var $wrapper=$(".header-template-one"),$menuButton=$(".mobile-menu-button");$menuButton.on("click",function(){$(".region-area-three",$wrapper).hasClass("open")?($(".region-area-three",$wrapper).removeClass("open"),$(".site-overlay").removeClass("visible"),$("body").css("overflow","initial")):($(".region-area-three",$wrapper).addClass("open"),$(".site-overlay").addClass("visible"),$("body").css("overflow","hidden"))})}function initClickOutsideModileMenu(){var $wrapper=$(".header-template-one"),$siteOverlay=$(".site-overlay");$siteOverlay.on("click",function(){$(".region-area-three",$wrapper).hasClass("open")&&($(".region-area-three",$wrapper).removeClass("open"),$siteOverlay.removeClass("visible"),$("body").css("overflow","initial"))})}function initExpandLogin(){var $wrapper=$(".x-login-widget"),$button=$(".mobile .logged-in");$button.on("click",function(){$(".form-container.logged-user",$wrapper).hasClass("x-expanded")?$(".form-container.logged-user",$wrapper).removeClass("x-expanded"):$(".form-container.logged-user",$wrapper).addClass("x-expanded")})}function initHomePopup(){if($(".home-page").length>0){var homepopup=localStorage.getItem("homepopup"),current_date=new Date;current_date.setDate(current_date.getDate());localStorage.getItem("time_to_expire")!==null&&new Date(localStorage.getItem("time_to_expire")).getTime()-current_date<=0&&(localStorage.setItem("homepopup",!1),homepopup=!1);homepopup||(localStorage.setItem("time_to_expire",(new Date).setDate((new Date).getDate()+30)),$(".open-fancy-promo").fancybox({padding:0,width:700,height:500,fitToView:!0,autoSize:!1,closeBtn:!1,autoCenter:!0,helpers:{overlay:{closeClick:!1}},afterClose:function(){localStorage.setItem("homepopup",!0)},tpl:{wrap:'
<\/div><\/div><\/div><\/div>'}}),setTimeout(function(){$(".open-fancy-promo").trigger("click")},1e3),$(".icon-close").click(function(){$("input#hide-this").is(":checked")&&localStorage.removeItem("time_to_expire");$.fancybox.close()}))}}function initMoreContent(){if($(".news-details-page").length>0){var $wrapper=$(".x-article"),$control=$(".control-area-one",$wrapper);$(".title-container .title",$control).click(function(){$wrapper.hasClass("visible")?$wrapper.removeClass("visible"):($wrapper.addClass("visible"),$("html,body").animate({scrollTop:$(".title-container",$control).offset().top-50},"smooth"))});$(".image-container",$wrapper).click(function(){$wrapper.hasClass("visible")?$wrapper.removeClass("visible"):($wrapper.addClass("visible"),$("html,body").animate({scrollTop:$(".title-container",$control).offset().top-50},"smooth"))})}}function initMoreContent2(){if($(".news-details-page").length>0){var $wrapper=$(".x-article-list .x-article-box"),$control=$(".control-area-one",$wrapper);$(".title-container .title",$control).click(function(){$(this).closest($wrapper).hasClass("visible")?$(this).closest($wrapper).removeClass("visible"):($(this).closest($wrapper).addClass("visible"),$("html,body").animate({scrollTop:$(this).offset().top-50},"smooth"))});$(".image-container",$wrapper).click(function(){$(this).closest($wrapper).hasClass("visible")?$(this).closest($wrapper).removeClass("visible"):($(this).closest($wrapper).addClass("visible"),$("html,body").animate({scrollTop:$(this).siblings($control).children(".title-container").offset().top-50},"smooth"))})}}function initSideMenuToggle(){var $wrapper=$(".side-menu"),$title=$(".my-account-master-page .side-menu-title");$title.click(function(){$wrapper.hasClass("show-side-menu")?($wrapper.removeClass("show-side-menu"),$title.removeClass("minus")):($wrapper.addClass("show-side-menu"),$title.addClass("minus"))})}var uploadBoxes,processProductBox;jQuery.easing.jswing=jQuery.easing.swing;jQuery.extend(jQuery.easing,{def:"easeOutQuad",swing:function(x,t,b,c,d){return jQuery.easing[jQuery.easing.def](x,t,b,c,d)},easeInQuad:function(x,t,b,c,d){return c*(t/=d)*t+b},easeOutQuad:function(x,t,b,c,d){return-c*(t/=d)*(t-2)+b},easeInOutQuad:function(x,t,b,c,d){return(t/=d/2)<1?c/2*t*t+b:-c/2*(--t*(t-2)-1)+b},easeInCubic:function(x,t,b,c,d){return c*(t/=d)*t*t+b},easeOutCubic:function(x,t,b,c,d){return c*((t=t/d-1)*t*t+1)+b},easeInOutCubic:function(x,t,b,c,d){return(t/=d/2)<1?c/2*t*t*t+b:c/2*((t-=2)*t*t+2)+b},easeInQuart:function(x,t,b,c,d){return c*(t/=d)*t*t*t+b},easeOutQuart:function(x,t,b,c,d){return-c*((t=t/d-1)*t*t*t-1)+b},easeInOutQuart:function(x,t,b,c,d){return(t/=d/2)<1?c/2*t*t*t*t+b:-c/2*((t-=2)*t*t*t-2)+b},easeInQuint:function(x,t,b,c,d){return c*(t/=d)*t*t*t*t+b},easeOutQuint:function(x,t,b,c,d){return c*((t=t/d-1)*t*t*t*t+1)+b},easeInOutQuint:function(x,t,b,c,d){return(t/=d/2)<1?c/2*t*t*t*t*t+b:c/2*((t-=2)*t*t*t*t+2)+b},easeInSine:function(x,t,b,c,d){return-c*Math.cos(t/d*(Math.PI/2))+c+b},easeOutSine:function(x,t,b,c,d){return c*Math.sin(t/d*(Math.PI/2))+b},easeInOutSine:function(x,t,b,c,d){return-c/2*(Math.cos(Math.PI*t/d)-1)+b},easeInExpo:function(x,t,b,c,d){return t==0?b:c*Math.pow(2,10*(t/d-1))+b},easeOutExpo:function(x,t,b,c,d){return t==d?b+c:c*(-Math.pow(2,-10*t/d)+1)+b},easeInOutExpo:function(x,t,b,c,d){return t==0?b:t==d?b+c:(t/=d/2)<1?c/2*Math.pow(2,10*(t-1))+b:c/2*(-Math.pow(2,-10*--t)+2)+b},easeInCirc:function(x,t,b,c,d){return-c*(Math.sqrt(1-(t/=d)*t)-1)+b},easeOutCirc:function(x,t,b,c,d){return c*Math.sqrt(1-(t=t/d-1)*t)+b},easeInOutCirc:function(x,t,b,c,d){return(t/=d/2)<1?-c/2*(Math.sqrt(1-t*t)-1)+b:c/2*(Math.sqrt(1-(t-=2)*t)+1)+b},easeInElastic:function(x,t,b,c,d){var s=1.70158,p=0,a=c;return t==0?b:(t/=d)==1?b+c:(p||(p=d*.3),a>>0,len===0)||(n=0,arguments.length>0&&(n=Number(arguments[1]),n!==n?n=0:n!==0&&n!==1/0&&n!==-(1/0)&&(n=(n>0||-1)*Math.floor(Math.abs(n)))),n>=len))return-1;for(k=n>=0?n:Math.max(len-Math.abs(n),0);k'+option+"<\/a><\/li>").data({key:key,selected:$(item).is(":selected")}))}function newUlPos(){var containerPosY=$containerDiv.offset().top,docHeight=$(window).height(),scrollTop=$(window).scrollTop();newUlHeight>parseInt(opts.ddMaxHeight)&&(newUlHeight=parseInt(opts.ddMaxHeight));containerPosY=containerPosY-scrollTop;containerPosY+newUlHeight>=docHeight?($newUl.css({height:newUlHeight}),$containerDivWrapper.css({top:"-"+newUlHeight+"px",height:newUlHeight}),$input.onTop=!0):($newUl.css({height:newUlHeight}),$containerDivWrapper.css({top:containerHeight+"px",height:newUlHeight}),$input.onTop=!1)}function positionFix(){$containerDiv.css("position","relative")}function positionHideFix(){$containerDiv.css({position:"static"})}function closeDropDown(fireChange,resetText){fireChange==!0&&(prevIndex=currentIndex,$input.change());resetText==!0&&(currentIndex=prevIndex,navigateList(currentIndex));$containerDivWrapper.hide();positionHideFix()}function navigateList(currentIndex,fireChange){if(currentIndex==-1)$containerDivText.text(opts.defaultText),$newLi.removeClass("hiLite");else{$newLi.removeClass("hiLite").eq(currentIndex).addClass("hiLite");var text=$newLi.eq(currentIndex).text(),val=$newLi.eq(currentIndex).parent().data("key");try{$input.val(val)}catch(ex){$input[0].selectedIndex=currentIndex}if($containerDivText.text(text),fireChange==!0&&(prevIndex=currentIndex,$input.change()),$containerDivWrapper.is(":visible"))try{$newLi.eq(currentIndex).focus()}catch(ex){}}}function keyPress(element){$(element).unbind("keydown.sSelect").bind("keydown.sSelect",function(e){var keycode=e.which,currentKeyIndex;prevented=!0;switch(keycode){case 40:case 39:return incrementList(),!1;case 38:case 37:return decrementList(),!1;case 33:case 36:return gotoFirst(),!1;case 34:case 35:return gotoLast(),!1;case 13:case 27:return closeDropDown(!0),!1;case 9:return closeDropDown(!0),nextFormElement(),!1}return keyPressed=String.fromCharCode(keycode).toLowerCase(),currentKeyIndex=keys.indexOf(keyPressed),typeof currentKeyIndex!="undefined"?(++currentIndex,currentIndex=keys.indexOf(keyPressed,currentIndex),(currentIndex==-1||currentIndex==null||prevKey!=keyPressed)&&(currentIndex=keys.indexOf(keyPressed)),navigateList(currentIndex),prevKey=keyPressed,!1):void 0})}function incrementList(){currentIndex0&&(--currentIndex,navigateList(currentIndex))}function gotoFirst(){currentIndex=0;navigateList(currentIndex)}function gotoLast(){currentIndex=newLiLength-1;navigateList(currentIndex)}function nextFormElement(){var fields=$("body").find("button,input,textarea,select"),index=fields.index($input);return index>-1&&index+1<\/div>'),$containerDiv=$('
<\/div>'),$containerDivWrapper=$('