var $jq=jQuery;var sizeChartId;function polarisRecentlyViewedName(basketName){var rv_pid=basketName.toUpperCase();rv_pid=rv_pid.split('(');if(rv_pid.length>1){rv_pid=rv_pid[0];} return('P_RECENT_VIEW_'+rv_pid+'_CAROUSEL');} function stripCatelogString(str){str=str.split('(');if(str.length>1){str=str[0];} return str;} var rvlog=function(msg){if((console!=undefined)&&(console.log!=undefined)){console.log(msg);}};var decorateChart=function(){$jq('#'+sizeChartId).find('[width]').removeAttr('width');$jq(jQuery('.sizingInnerTable').get(0)).addClass('sortable');$jq(jQuery('.sizingInnerTable').get(1)).addClass('datawrapper');};var holdForReadyDelay=40;$jq(document).ready(function(){if(((typeof productId)!="undefined")&&((typeof basket)!="undefined")&&((typeof polaris)!="undefined")&&((typeof polaris.cookie)!="undefined")&&(polaris.cookie.enabled)){var recentlyViewedName=polarisRecentlyViewedName(basket);var cookie=polaris.cookie.get(recentlyViewedName);if((cookie==undefined)||(cookie=="")){cookie={};cookie[stripCatelogString(productId)]=0;}else{cookie=JSON.parse(cookie);} if((cookie[stripCatelogString(productId)]==undefined)||isNaN(cookie[stripCatelogString(productId)])){cookie[stripCatelogString(productId)]=0;} cookie[stripCatelogString(productId)]++;var cval=JSON.stringify(cookie);polaris.cookie.set(recentlyViewedName,cval,365);var carouselID='ecomm_carousel_2';var $carousel=$jq('#'+carouselID);$carousel.empty();var rvc_size=(($carousel.attr('data-item-size')!=undefined)?$carousel.attr('data-item-size'):'133x133');rvc_size=rvc_size.split('x');rvc_size={'width':rvc_size[0],'height':rvc_size[1]};var $tmp;if((cookie!=undefined)&&((typeof cookie)=="object")){for(var key in cookie){$tmp='';$carousel.append($tmp);}} $jq('.ecomm-carousel').each(function(){if($jq(this).attr('data-base-url')!=undefined){$jq(this).on('click','img',function(){document.location.replace($jq(this).closest('.ecomm-carousel').attr('data-base-url')+$jq(this).attr('data-part-id'));return false;});}});} $jq(".ecomm-carousel-wrapper").addClass('hold-for-ready');$jq(".ecomm-carousel").each(function(){var caro={circular:false,infinite:false,auto:false,prev:{button:"#"+$jq(this).closest('.ecomm-carousel-wrapper').find('.prev').attr('id'),key:"left"},next:{button:"#"+$jq(this).closest('.ecomm-carousel-wrapper').find('.next').attr('id'),key:"right"}};$jq(this).carouFredSel(caro);});if($jq('#related_items_content').find('.ecomm-carousel img').length<5){$jq('#related_items_content').remove();$jq('[href="#related_items_content"]').parent().next().find('a').click();$jq('[href="#related_items_content"]').parent().remove();} setTimeout(function(){$jq('.ecomm-carousel-wrapper').removeClass('hold-for-ready');},holdForReadyDelay);if(((typeof lpLabelConfig)!="undefined")&&((typeof lpImageConfig)!="undefined")){var lpCombinedConfig={'viewerTemplate':'/polaris-pixels/templates/victory-viewer-controls-default.html','modalTemplate':'/polaris-pixels/templates/victory-modal-default.html'};jQuery.extend(true,lpCombinedConfig,lpLabelConfig,lpImageConfig);setTimeout(function(){$jq('#polarisPixelsProduct').polarisPixels(lpCombinedConfig);},50);} $jq('.input-fixed-controls.fixed-numerical').on('click','.fixed-control',function(evt){var op=$jq(this).attr('data-operator');var opFor=$jq(this).attr('data-attached');var myfld=$jq('[data-id="'+opFor+'"]');var curr=$jqfld.val();if(!isNaN(curr)){if(op=='add'){curr=(parseInt(curr)+1);myfld.val(curr);} else if(op=='subtract'){if(curr<=1){myfld.val('1');return;}curr=(parseInt(curr)-1);myfld.val(curr);}}else{myfld.val('1');}});$jq('.ecomm-variant-select-one').on('click','li a',function(){if(!$jq(this).parent().hasClass('disabled')){$jq(this).closest('ul').find('li.active').removeClass('active');$jq(this).parent().addClass('active');} return false;});$jq('.product-info.original-price').each(function(){if($jq(this).text().length==0){$jq(this).remove();}});$jq('.ecomm-variant.variant-controls').each(function(){var pos={'left':0,'top':0};$jq(this).find('.ecomm-variant-select-one li').each(function(){if($jq(this).position().leftSee More');window.jeff=$lnk;var togo=$jq(this).closest('.row-of-one').find('.btn-details').parent().attr('href');rvlog(togo);if((typeof $lnk)!="undefined"){$lnk.on('click',function(){document.location.href=togo;});$lnk.addClass('jsreadmore');$jq(this).before($lnk);}});var lenf=jQuery('[data-purpose] img').length;var maxf=8;var maxu=(lenf