$("document").ready(function(){browse.initialize()});var browse={initialize:function(){this.bindEvents()},bindEvents:function(){var a=$("img[id^='swatchImage.']");$.each(a,function(b,c){$(c).click(function(){if(!$(c).hasClass("selectedSwatch")){var g=$(c).attr("id").split(".");if(g.length>1){var f=g[1];var e=null;if(g.length==3){e=g[2]}var i=$("img[id^='swatchImage."+f+".']");$.each(i,function(k,j){if($(j).hasClass("selectedSwatch")){$(j).removeClass("selectedSwatch")}});$(c).toggleClass("selectedSwatch");$("#selectedColorCode\\."+f).html(e);var d=$("#thumbnailImage\\."+f);$(d).attr("src",$("#largeImageUrl\\."+f+"\\."+e).html());var h="&colorId="+e;$.each($(this).parents(".productBrowseProduct:eq(0)").find(".productDetailLink"),function(){var j=$(this).attr("href");if(j.indexOf("colorId")==-1){j=j+h}else{j=j.replace(/&colorId=\d+/,h)}$(this).attr("href",j)})}}})});$(".viewAllLink").click(function(){$.cookie("bopBrowsePref","viewAll",{path:"/",expires:365});quickFind.submitQuickFindForm(false)});$(".viewNormalLink").click(function(){$.cookie("bopBrowsePref",null,{path:"/",expires:-1});quickFind.submitQuickFindForm(false)});$(".previousPageLink, .nextPageLink, .paginationPageNumber").click(function(){quickFind.submitQuickFindForm(false)});$("#backToTop").click(function(){scroll(0,0)});$(".productBrowseMainImage,.productBrowseMainImageLarge").hover(function(){var c=$(this).parents(".productBrowseProduct:eq(0)");var g=c.find(".image:eq(0)");var d=g.attr("width");var b=g.attr("height");var f=d+"x"+b;var e=c.find(".productInfo").attr("id").substr(12);var h=$("#selectedColorCode\\."+e).html();imageRotator.startCrossFade(c,g,f,e,h,1)},function(){var b=$(this).parents(".productBrowseProduct:eq(0)");var c=b.find(".image:eq(0)");imageRotator.stopCrossFade(b,c)})}};
