FILTER_NAME_SEPARATOR="__";var myHistory=new Array();var respHistory=new Array();var iframe_obj;if($.browser.msie){var iframe_obj=document.getElementById("dummyIframe").contentWindow.document;iframe_obj.open();iframe_obj.close()}var myHistoryLength=0;var currentHash=getHash();var _intervalId=null;var searchQueue=0;var colorFilterName="colorFilterName";var currentProductName="";var currentProductState="";var currentSearchResponse="";URL_COMPARE_ADD_PREFIX="/webapp/wcs/stores/servlet/TNFCompareItemAdd?listIdName=listId";URL_COMPARE_ADD_SUFFIX="&URL=AjaxCompareResponse";URL_COMPARE_REMOVE_PREFIX="/webapp/wcs/stores/servlet/TNFCompareItemDelete?listIdName=listId";URL_COMPARE_REMOVE_SUFFIX="&URL=AjaxCompareResponse";URL_COMPARE="/webapp/wcs/stores/servlet/TNFCompareDisplay";URL_RETRIEVEHISTORY="/webapp/wcs/stores/servlet/TNFRetrieveHistory";var SEARCH_REQUEST_COOKIE_NAME="sReqCookie";VIEW_ALL_PPP=36;function getHash(){var A;if($.browser.msie){A=iframe_obj.location.hash}else{A=location.hash}return A}function isdefined(A){return(typeof (A)!="undefined")}function init_iframe_obj(){if($.browser.msie){iframe_obj=document.getElementById("dummyIframe").contentWindow.document}}function listenHistory(){init_iframe_obj();var B=getHash();if(currentHash!=B){if((B!="")){currentHash=B;A=myHistory[B];if(isdefined(A)){clearAll();resetFilter(A);lastRes=respHistory[B];if(isdefined(lastRes)){resetPaginationViewAll(lastRes);searchResponseHandler(lastRes);var A=getQueryString();storeSearchCookie(A)}else{sendSearchRequest(true)}return }}else{if((B=="#")||(B=="")){currentHash=B;clearAll();currentPage=1;currentSort="default";if(window.location.toString().indexOf("TNFSearchResult")!=-1){productsPerPage=6}else{productsPerPage=9}sendSearchRequest(true)}}}}function disableAll(){$(".filter:checkbox").each(function(A){$(this).parent().addClass("disabled");$(this).attr("disabled","disabled")})}function clearAll(){$(".filter:checkbox").each(function(A){$(this).removeAttr("checked")});$(".colorSwatches a").removeClass("selected");$(".filterBar a").children(".all").removeClass("displayNone");$(".filterBar a").children(".clear").addClass("displayNone")}$(function(){if(_intervalId==null){_intervalId=setInterval(listenHistory,200)}if($(".relatedContent")){$("a.showRelatedContent").click(function(){var B=$(this).parent().parent().parent().parent().siblings("div.hiddenRelatedContent");var E=$(this).parent().parent().parent().parent().parent();var F=$(this).parent().children("span.plus");var D=$(this).parent().children("span.minus");var A=$(this).children("span.viewAll");var C=$(this).children("span.hide");if(B.is(":hidden")){B.slideDown(200);$(E).addClass("open");$(F).hide();$(A).hide();$(D).show();$(C).show();return false}else{B.slideUp(200);$(E).removeClass("open");$(D).hide();$(C).hide();$(A).show();$(F).show();return false}})}$("#checkoutNav a img").hover(function(){this.src=this.src.replace(/\.(png)/,"_on.png")},function(){this.src=this.src.replace("_on","")});$("#sortBy").change(function(){currentSort=$(this).val();currentPage=1;sendSearchRequest();this.blur();$("#allContent")[0].focus()});$(".filter:checkbox").click(function(){if($(this).hasClass("group")){var A=this;$(this).parent().find(":checkbox").each(function(B){this.checked=A.checked})}currentPage=1;setFilterCategoryLink();$("#allContent")[0].scrollTop=0;sendSearchRequest()});$(".loading").hide();$(".filterBar .header a").hide();hash=getHash();if(hash==""){$(".filter:checkbox").each(function(A){$(this).removeAttr("checked")})}setFilterGroup();$(".parametricNav .colorSwatches a").click(function(){if($(this).find("img").attr("style").indexOf("block")>0){return }if($(this).hasClass("selected")){$(this).removeClass("selected")}else{$(this).parent().prev().prev().children("a").children(".all").addClass("displayNone");$(this).parent().prev().prev().children("a").children(".clear").removeClass("displayNone");$(this).addClass("selected")}currentPage=1;$("#allContent")[0].scrollTop=0;sendSearchRequest()});$(".colorSwatches img").hide();if($(".parametricNav")){$(".filterBar a").click(function(){if($(this).parent().hasClass("header")){clearAll()}else{if(($(this).children(".all").hasClass("displayNone"))){$(this).children(".all").removeClass("displayNone");$(this).children(".clear").addClass("displayNone");if($(this).parent().attr("id")=="filterBarColors"){$(".colorSwatches a").removeClass("selected")}else{$(this).parent().next().next().children().find("input").removeAttr("checked")}}else{$(this).children(".all").addClass("displayNone");$(this).children(".clear").removeClass("displayNone");if($(this).parent().attr("id")=="filterBarColors"){$(".colorSwatches a").addClass("selected")}else{$(this).parent().next().next().children().find("input").each(function(){if(!$(this).parent().hasClass("disabled")){this.checked=true}})}}}currentPage=1;$("#allContent")[0].scrollTop=0;sendSearchRequest();return false})}if($(".pagination").length>0){generatePagination()}if($(".parametricNav").length>0){initializeProducts()}$(".viewBy a").click(function(){currentPage=1;if($(this).hasClass("grid2x3Col")){generateViewControl(6,true)}else{if($(this).hasClass("grid3Col")){generateViewControl(9,true)}else{generateViewControl(VIEW_ALL_PPP,true)}}return false});setFilterGroup()});function generateViewControl(B,A){$("#results").hide();$(".resultsBar:odd").hide();if(B==6){productsPerPage=6;$(".grid2x3Col").addClass("selected");$(".grid4Col").removeClass("selected");$("#grid").removeClass("fourCol");$("#grid").addClass("twoCol");$(".pagination").removeClass("disabled");if(A){sendSearchRequest()}else{$("#results").show();$(".resultsBar").show()}}else{if(B==9){productsPerPage=9;$(".grid3Col").addClass("selected");$(".grid6Col").removeClass("selected");$(".viewPerPage a").text("VIEW BY 36");$("#grid").removeClass("sixCol");$("#grid").addClass("threeCol");$(".pagination").removeClass("disabled");if(A){sendSearchRequest()}else{$("#results").show();$(".resultsBar").show()}}else{productsPerPage=VIEW_ALL_PPP;if($().find(".grid4Col").length>0){$(".grid4Col").addClass("selected");$(".grid2x3Col").removeClass("selected");$("#grid").removeClass("twoCol");$("#grid").addClass("fourCol")}else{$(".grid6Col").addClass("selected");$(".grid3Col").removeClass("selected");$("#grid").removeClass("threeCol");$("#grid").addClass("sixCol")}if(A){sendSearchRequest()}else{$("#results").show();$(".resultsBar").show()}}}}function sendSearchRequest(D){if(!isdefined(D)){D=false}$(".loading").show();$(".header a").hide();var C=getQueryString();if(!D){var B=+new Date();if($.browser.msie){iframe_obj.open();iframe_obj.close();iframe_obj.location.hash="#"+B;window.location.hash="#"+B;currentHash=iframe_obj.location.hash}else{window.location.hash="#"+B;currentHash=window.location.hash}var A="#"+B;myHistory[A]=C;myHistoryLength++}storeSearchCookie(C);searchQueue+=1;$.ajax({type:"POST",url:URL_SEARCH_REQUEST,data:C,cache:"false",dataType:"json",success:function(E,G){var F="";if($.browser.msie){F=iframe_obj.location.hash}else{F=location.hash}respHistory[F]=E;searchQueue-=1;if(D){resetPaginationViewAll(E);if(currentSort=="default"){document.getElementById("sortBy").options[0].selected=true}}searchResponseHandler(E)},error:function(E,G,F){searchQueue-=1;this;$(".loading").hide();$(".header a").show()}})}function retrieveHistory(){var A=loadSearchCookie();if(A!=null){sendHistorySearchRequest(A)}}function resetFilter(I){var G=I.split("&");for(i=0;i<G.length;i++){var A=G[i];if(A.indexOf("filter")!=-1){var F=(A.split("=")[1]).split("%25");var D=F[0];for(j=1;j<F.length;j++){var H=D+FILTER_NAME_SEPARATOR+F[j];if(document.getElementById(H).parentNode.parentNode.title!=""){$("#"+H).parent().parent().addClass("selected")}else{document.getElementById(H).checked="yes"}}}else{if(A.indexOf("sort")!=-1){var B=document.getElementById("sortBy").options.length;var E=A.split("=")[1];for(j=0;j<B;j++){var C=document.getElementById("sortBy").options[j].value;if(C==E){document.getElementById("sortBy").options[j].selected="true"}}}}}setFilterGroup()}function sendHistorySearchRequest(B){$(".loading").show();$(".header a").hide();var A=B;$(".parametricNav .colorSwatches a").each(function(C){id=$(this).find("span .innerBorder").attr("id");filterName=id.substring(0,id.indexOf(FILTER_NAME_SEPARATOR));colorFilterName=filterName});searchQueue+=1;$.ajax({type:"POST",url:URL_SEARCH_REQUEST,data:A,cache:"false",dataType:"json",success:function(C,D){searchQueue-=1;disableAll();clearAll();resetPaginationViewAll(C);searchResponseHandler(C);resetFilter(A);setFilterStates(C)},error:function(C,E,D){searchQueue-=1;this;$(".loading").hide();$(".header a").show()}})}function resetPaginationViewAll(A){if(searchQueue>0){return }currentPage=A.currentPage;ppp=A.ppp;currentSort=A.sort;generateViewControl(ppp,false)}function getQueryString(){var I="";var G="";var A="";var F="";var H="";if(searchType=="search"){H+="search="+searchTerm}else{if(searchType=="subcat"){H+="cat="+cat}else{if(searchType=="seriesCollection"){H+="departmentCatID="+departmentCatId;H+="&seriesName="+seriesName}}}H+="&storeId="+storeId;H+="&langId="+langId;H+="&catalogId="+catalogId;H+="&brandSCID="+brandSCID;H+="&gearSCID="+gearSCID;H+="&page="+currentPage;H+="&view="+currentView;H+="&sort="+currentSort;H+="&products_per_page="+productsPerPage;var C=$(".filter");var E=1;var D=1;$(".filter:checkbox").not(".group").each(function(K){filterName=$(this).attr("id").substring(0,$(this).attr("id").indexOf(FILTER_NAME_SEPARATOR));filterValue=$(this).attr("id").substring($(this).attr("id").indexOf(FILTER_NAME_SEPARATOR)+FILTER_NAME_SEPARATOR.length);if($(this).attr("checked")){if(filterName!=I){A+="&filter"+E+"="+filterName;I=filterName;E++}A+="%"+filterValue}else{if(!$(this).parent().hasClass("disabled")){if(filterName!=G){F+="&enableFilter"+D+"="+filterName;G=filterName;D++}F+="%"+filterValue}}});var J=0;var B="";$(".parametricNav .colorSwatches a").each(function(K){B=$(this).find("span .innerBorder").attr("id");filterName=B.substring(0,B.indexOf(FILTER_NAME_SEPARATOR));colorFilterName=filterName;filterValue=B.substring(B.indexOf(FILTER_NAME_SEPARATOR)+FILTER_NAME_SEPARATOR.length);if($(this).hasClass("selected")){if(J==0){A+="&filter"+E+"="+filterName}A+="%"+filterValue;J++}else{if(!$(this).parent().hasClass("disabled")){if(filterName!=G){F+="&enableFilter"+D+"="+filterName;G=filterName;D++}F+="%"+filterValue}}});H+=A+F;H=H.replace(/%/g,"%25");return H}function searchResponseHandler(B){if(searchQueue>0){return }currentSearchResponse=B;totalProducts=B.totalItems;totalPages=B.totalPages;var A=buildProductResults(B);$(".totalProductsNumber").html(totalProducts);if($(".totalItems").length>1){$(".totalItems").html(parseInt(totalRelatedContent)+parseInt(totalProducts))}$("#results").html(A);initializeProducts();generatePagination();DOMWindow_init("a.DOMWindow");setFilterStates(B);setFilterCategoryLink();setFilterGroup();$(".loading").hide();$(".header a").show();$(".productBlock a img").not(".colorSwatches a").hover(function(){$(this).parent().parent().children("a.quickView").css("visibility","visible")},function(){$(this).parent().parent().children("a.quickView").css("visibility","hidden")});$("a.quickView").hover(function(){$(this).css("visibility","visible")},function(){$(this).css("visibility","hidden")});$("#results").show();$(".resultsBar").show()}function buildProductResults(A){var C=new Date();var E="";var B=1;for(i=0;i<productsPerPage;i=i+1){if(i>A.products.length-1){break}compareWord=A.cmpwrd;var D=A.products[i];if(productsPerPage<VIEW_ALL_PPP){E=E+generateProductViewM(D,compareWord)}else{E=E+generateProductViewS(D,compareWord)}}return E}function setFilterStates(A){var B="";for(k=0;k<A.parametricNavBehavior.length;k=k+1){B=A.parametricNavBehavior[k];if(B.elementAction.toUpperCase()=="DISABLE"){if($("#"+B.elementID).length==0){continue}if(B.elementID.indexOf(colorFilterName)>=0){$("#"+B.elementID).prev().show()}else{$("#"+B.elementID).parent().addClass("disabled");$("#"+B.elementID).removeAttr("checked").attr("disabled","disabled")}}else{if(B.elementID.indexOf(colorFilterName)>=0){$("#"+B.elementID).prev().hide()}else{$("#"+B.elementID).parent().removeClass("disabled");$("#"+B.elementID).removeAttr("disabled")}}}return }function setFilterGroup(){var A=0;var C=0;var B;$(".group:checkbox").each(function(D){B=this;A=0;C=0;countInactive=0;$(this).parent().find(":checkbox").not(".group").each(function(E){A+=1;if(this.checked){C+=1}if($(this).parent().hasClass("disabled")){countInactive+=1}});if(A==C){B.checked=true}else{B.checked=false}if(A==countInactive){B.checked=false;$(B).parent().addClass("disabled");$(B).attr("disabled","disabled");$(B).removeAttr("checked")}else{$(B).parent().removeClass("disabled");$(B).removeAttr("disabled")}})}function setFilterCategoryLink(){var B="";var F="";var E=0;var A=0;var C="";E=1;var D;$(".filter:checkbox").not(".group").each(function(H){var G=$(this).attr("id").substring(0,$(this).attr("id").indexOf(FILTER_NAME_SEPARATOR));if(G!=C){if(E==0){$("#"+C).hide()}else{if(D){D.parent().parent().prev().prev().children("a").show()}E=0;C=G}if(A==0){if(D){D.parent().parent().prev().prev().children("a").children(".all").removeClass("displayNone");D.parent().parent().prev().prev().children("a").children(".clear").addClass("displayNone")}}else{if(D){D.parent().parent().prev().prev().children("a").children(".all").addClass("displayNone");D.parent().parent().prev().prev().children("a").children(".clear").removeClass("displayNone")}A=0}}if(!$(this).parent().hasClass("disabled")){E=E+1}if($(this).attr("checked")){A=A+1}D=$(this)})}function generateProductViewS(B,C){var G=new StringBuilder();var D="";var A=window.location.hostname;var E=window.location.protocol;var F=E+"//"+A+"/webapp/wcs/stores/servlet/";if(B.colors.length>0){D=B.colors[0].variationId}else{D="*"}if(D==undefined){D="*"}G.append('\n			     <div class="productBlock">\n');G.append('						<div class="gradientProductGrid6">\n');if(B.SHOW_QUICKVIEW=="true"){G.append('							<a href="'+F+B.URL_quickView_prefix+"&variationId="+D+B.URL_quickView_suffix+'" class="quickView button DOMWindow" title="'+B.name+'">Quick View</a>\n')}G.append('							<a href="'+F+B.URL_productDetails+"&variationId="+D+'" class="productLink" title="'+B.name+'"><img src="'+B.URL_image_96+'" width="96" height="131" alt="'+B.name+'" class="productImage"/></a>\n');G.append('							<div class="productInfo" id="'+B.productId+'">\n');G.append('								<div class="productName">\n');G.append('									<a href="'+F+B.URL_productDetails+"&variationId="+D+'" class="productLink" title="'+B.name+'">'+B.name+"</a>\n");G.append("								</div>\n");G.append('								<div class="productPrice">\n');G.append("									"+B.price);G.append("								</div>\n");G.append('								<div class="productActions">\n');if(B.IS_COMPARABLE=="true"){G.append('									<input name="'+B.productId+"__"+B.currentColor+'" type="checkbox" value="" />\n');G.append('									<a href="#" class="compare" title="Compare">'+C+"</a>\n")}G.append("								</div>\n");G.append("							</div>\n");G.append("						</div>\n");G.append("					</div>\n");return G.toString()}function generateProductViewM(A,E){var G=new StringBuilder();var C="";var H=window.location.hostname;var I=window.location.protocol;var J=I+"//"+H+"/webapp/wcs/stores/servlet/";if(A.colors.length>0){C=A.colors[0].variationId}else{C="*"}if(C==undefined){C="*"}G.append('\n					<div class="productBlock">\n');if(A.SUGGESTION_PICK=="1"){G.append('<div class="athletePick">'+A.SUGGESTION_PICK_VALUE+"</div>\n")}else{if(A.SUGGESTION_PICK=="2"){G.append('<div class="bestSeller">'+A.SUGGESTION_PICK_VALUE+"</div>\n")}else{if(A.SUGGESTION_PICK=="3"){G.append('<div class="staffPick">'+A.SUGGESTION_PICK_VALUE+"</div>\n")}else{if(A.SUGGESTION_PICK=="4"){G.append('<div class="newArrival">'+A.SUGGESTION_PICK_VALUE+"</div>\n")}}}}if(A.SHOW_QUICKVIEW=="true"){G.append('							<a href="'+J+A.URL_quickView_prefix+"&variationId="+C+A.URL_quickView_suffix+'" class="quickView button DOMWindow" title="'+A.name+'">Quick View</a>\n')}G.append('							<a href="'+J+A.URL_productDetails+"&variationId="+C+'" class="productLink" title="'+A.name+'"><img src="'+A.URL_image_201+'" width="201" height="201" alt="'+A.name+'" class="productImage"/></a>\n');G.append('							<div class="productInfo" id="'+A.productId+'">\n');G.append('								<div class="colorSwatches">\n');var F=new StringBuilder();for(j=0;j<A.colors.length;j=j+1){var B=A.colors[j];var D="";F.clear();if(typeof (B.color2)=="undefined"){F.append('  style="background-color: '+B.color1+'">'+B.colorName+"</span>\n")}else{F.append('>\n                                       <span  style="background-color: '+B.color1+'">'+B.colorName+"</span>\n");F.append('                                       <span style="background-color: '+B.color2+'"></span>\n');D="twoColor";if(typeof (B.color3)!="undefined"){F.append('                                       <span  style="background-color: '+B.color3+'"></span>\n');D="threeColor"}F.append("                                    </span>\n")}G.append('                                 <a href="'+B.imgUrl+'" class="loadColor" id="'+B.variationId+'">\n');G.append('									<span class="swatch '+D+'">\n');G.append('                                    <span class="innerBorder" ');G.append(F.toString());G.append("                                    </span></a> <!--swatch-->\n")}G.append("								</div>\n");G.append('								<div class="productName">\n');G.append('									<a href="'+J+A.URL_productDetails+"&variationId="+C+'" class="productLink" title="'+A.name+'">'+A.name+"</a>\n");G.append("								</div>\n");G.append('								<div class="productPrice">\n');G.append("									"+A.price);G.append("								</div>\n");G.append('								<div class="productActions">\n');if(A.URL_seeInAction.length>0){G.append('<a href="'+J+A.URL_seeInAction+'" class="seeItInAction DOMWindow" title="See It In Action">See It In Action</a>')}if(A.IS_COMPARABLE=="true"){G.append('									<input name="'+A.productId+"__"+A.currentColor+'" type="checkbox" value="" />\n');G.append('									<a href="#" class="compare" title="Compare">'+E+"</a>\n")}G.append("							</div>\n");G.append("						</div>\n");G.append("					</div>\n");return G.toString()}function debug(A){$("#debugText").append("<br/>"+A);window.dump(A)}function StringBuilder(A){this.strings=new Array("");this.append(A)}StringBuilder.prototype.append=function(A){if(A){this.strings.push(A)}};StringBuilder.prototype.clear=function(){this.strings.length=1};StringBuilder.prototype.toString=function(){return this.strings.join("")};function generatePagination(){var A=generatePaginationControl();$(".pagination").html(A);$(".paginationNext").bind("click",function(B){if(currentPage==totalPages){return }currentPage++;$("#allContent")[0].scrollTop=0;sendSearchRequest()});$(".paginationPrev").bind("click",function(B){if(currentPage==1){return }currentPage--;$("#allContent")[0].scrollTop=0;sendSearchRequest()});$(".pageNum").bind("click",function(B){currentPage=$(this).text();$("#allContent")[0].scrollTop=0;sendSearchRequest()});return }function initializeProducts(){if($(".productBlock")){$(".colorSwatches").each(function(){setSwatchAlignment($(this))})}$(".productActions input").each(function(){var C=this.name;var A=C.split(FILTER_NAME_SEPARATOR)[0];for(i=0;i<compareList.length;i=i+1){var B=compareList[i].split(FILTER_NAME_SEPARATOR);compareProductID=B[0];if(compareProductID==A){this.checked=true}}});$(".loadColor").click(function(){$(this).parent().parent().parent().find(".productImage").attr("src",this.href);var Q=this.id;var L=$(this).parent().parent().parent().find(".productInfo").attr("id");var I=window.location.hostname;var J=window.location.protocol;var D="";var G=J+"//"+I;var E=G+"/webapp/wcs/stores/servlet/";if(currentSearchResponse!=null&&currentSearchResponse!=""){for(i=0;i<productsPerPage;i=i+1){var B=currentSearchResponse.products[i];if(B.productId==L){D=E+B.URL_productDetails;break}}}else{var C=$(this).parent().parent().parent().find(".productLink").attr("href");var K=C.split(G);if(K.length>=2){C=K[1]}var S=C.indexOf("&variationId");if(S==-1){S=C.indexOf("?variationId")}if(S!=-1){C=C.substring(0,S)}D=G+C}var H=D.indexOf("?");if(H=="-1"){D+="?variationId="+Q}else{D+="&variationId="+Q}$(this).parent().parent().parent().find(".productLink").attr("href",D);if(B!=null&&B!=""){var O=E+B.URL_quickView_prefix+"&variationId="+Q+B.URL_quickView_suffix;$(this).parent().parent().parent().find(".quickView").attr("href",O)}else{var M=$(this).parent().parent().parent().find(".quickView").attr("href");var A=M.split("&amp;startDOMWindow");if(A.length>=1){var P="";var N=A[0].split("&variationId");var R=N[0];var F="&amp;startDOMWindow"+A[1];var P=R+"&variationId="+Q+F;$(this).parent().parent().parent().find(".quickView").attr("href",P)}}return false});compareLink=function(){var A=URL_COMPARE+"?storeId="+storeId+"&catalogId="+gearSCID+"&langId="+langId+"&listId="+listId;window.location=A;return false};$(".compare").bind("click",compareLink);$(".productActions input").click(function(){$(".compare").unbind("click",compareLink).addClass("noLinkCompare").css("text-decoration","none").removeAttr("href");if(this.checked){if(compareList.length>=6){DOMWindow_show("iframe content","/webapp/wcs/stores/servlet/TNFCompareMessageDOMWindow?KeepThis=true&startDOMWindow&iframeDOMWindow=true&height=125&width=313&modal=true",null);this.checked=false;$(".compare").bind("click",compareLink).removeClass("noLinkCompare").css("text-decoration","underline").attr("href","#");return }else{compareList.push($(this).attr("name"));sendCompareUpdate("add",$(this).attr("name"))}}else{for(i=0;i<compareList.length;i=i+1){if(compareList[i]==$(this).attr("name")){compareList.splice(i,1);break}}sendCompareUpdate("remove",$(this).attr("name"))}});return }function swapParameterInURL(B,E,A){var C=A.indexOf(B)+B.length+1;var D=A.substr(C).indexOf("&");if(D==-1){D=A.length-1}var F=A.replace(A.substr(C,D),E);return F}function sendCompareUpdate(D,E){if(D=="add"){url=URL_COMPARE_ADD_PREFIX+"&storeId="+storeId+"&catalogId="+gearSCID+"&langId="+langId+URL_COMPARE_ADD_SUFFIX;currentProductState="checked"}else{url=URL_COMPARE_REMOVE_PREFIX+"&storeId="+storeId+"&catalogId="+gearSCID+"&langId="+langId+URL_COMPARE_REMOVE_SUFFIX;currentProductState=""}var C=E.split(FILTER_NAME_SEPARATOR)[0];var B=E.split(FILTER_NAME_SEPARATOR)[1];var A="&productId="+C+"&variationId="+B;currentProductName=E;searchQueue+=1;$.ajax({type:"POST",url:url,data:A,cache:"false",dataType:"text",success:function(F,G){if((F.indexOf("Error")<0)&&(F.indexOf("ERROR")<0)){listId=F;if(currentProductState!="checked"){$("input[name="+currentProductName+"]").removeAttr("checked")}else{$("input[name="+currentProductName+"]").each(function(){this.checked=true})}}else{if(currentProductState=="checked"){$("input[name="+currentProductName+"]").removeAttr("checked");compareList.pop()}else{$("input[name="+currentProductName+"]").each(function(){this.checked=true;compareList.push(E)})}}$(".compare").bind("click",compareLink).removeClass("noLinkCompare").css("text-decoration","underline").attr("href","#");searchQueue-=1},error:function(F,H,G){searchQueue-=1;if(currentProductState=="checked"){$("input[name="+currentProductName+"]").removeAttr("checked")}else{$("input[name="+currentProductName+"]").each(function(){this.checked=true})}}})}function storeSearchCookie(B){var A="";document.cookie=SEARCH_REQUEST_COOKIE_NAME+"="+B+A+"; path=/"}function loadSearchCookie(){var B=document.cookie.split(";");for(var A=0;A<B.length;A++){var C=B[A];while(C.charAt(0)==" "){C=C.substring(1,C.length)}if(C.indexOf(SEARCH_REQUEST_COOKIE_NAME)==0){return C.substring(SEARCH_REQUEST_COOKIE_NAME.length+1,C.length)}}return null};