$.views.helpers({currencyFormat:function(num){num=num.toString().replace(/\$|\,/g,'');if(isNaN(num)) num="0";sign=(num==(num=Math.abs(num)));num=Math.floor(num*100+0.50000000001);cents=num%100;num=Math.floor(num/100).toString();if(cents<10) cents="0"+cents;for(var i=0;i0){location.href=url;title=json.title;title="IGDREC -- Title -- "+((title!==undefined&&title.length>0)?title:"Title undefined");sku=$(this).attr("data-sku");sku="IGDREC -- SKU -- "+((sku!==undefined&&sku.length>0)?sku:"SKU undefined");loc=$(this).attr("data-loc");loc="IGDREC -- Location -- "+((loc!==undefined&&loc.length>0)?loc:"Location undefined");_gaq.push(['_trackEvent',title,sku,loc])}}).html($template.render(json)).show()}}}).done(doneCallback)} $(document).ready(function(){var $body=$("body");if($body.is("#Home")){loadRecommendations('//matco.recs.igodigital.com/a/matco/home/recommend.json',$("#homeRecommendationsTemplate"),{item_count:4},function(){var bodyWidth=$("body").width();if(bodyWidth<=769){$("#home-featured-products").addClass("border");$(".hidden_div").remove();$(".mobile-carousel").owlCarousel({slideSpeed:300,paginationSpeed:400,singleItem:!0})}})} else if($body.is("#Catalog")){loadRecommendations('//matco.recs.igodigital.com/a/matco/product/recommend.json',$("#catalogRecommendationsTemplate"),{item_count:4},function(){})} else if($body.is("#CatalogProduct")){loadRecommendations('//matco.recs.igodigital.com/a/matco/product/recommend.json',$("#productRecommendationsTemplate"),{item:$("[name='item']").val(),item_count:4},function(){})} else if($body.is("#ViewCart")){loadRecommendations('//matco.recs.igodigital.com/a/matco/cart/recommend.json',$("#cartRecommendationsTemplate"),{cart:$("[name='items']").val(),item_count:4},function(){})} else if($body.is("#OrderConfirm")){loadRecommendations('//matco.recs.igodigital.com/a/matco/cart_confirm/recommend.json',$("#confirmRecommendationsTemplate"),{item_count:4},function(){})} $(".product-recommendations").on('mouseenter','.recommendation',function(){$(".popup",this).show('fade',200);return!1}).on('mouseleave','.recommendation',function(){$(".popup",this).stop().hide('fade',200);return!1})});return{loadRecommendations:loadRecommendations}})(jQuery)