function loadJS(n){var t=document.createElement("script"),i;t.type="text/javascript";t.defer=!0;t.async=!0;t.src=n;i=document.getElementsByTagName("script")[0];i.parentNode.insertBefore(t,i)}function jsToLoad(){}function postLoadJS(n){if(typeof readCookie=="function"&&typeof jQuery=="function")jQuery(document).ready(function(){n()});else{var t=jsToLoad;jsToLoad=typeof jsToLoad!="function"?n:function(){t();n()}}}function truncateAtSpace(n,t,i){if(typeof i=="undefined")return truncateAtSpaceHelper(n);var r=n.substring(0,t)+truncateAtSpaceHelper(n.substring(0,t+1));return(r.length>t+5||r.length<n.length&&i)&&(r=r.substring(0,t+2)+"&hellip;"),r.replace(/&\s*$/,"")}function truncateAtSpaceSearch(n,t,i){if(typeof i=="undefined")return truncateAtSpaceHelper(n);if(n!=null&&t!=null&&n.length<t)return n;var r=n.substring(0,t);return(r.length>t+5||r.length<n.length&&i)&&(r=r.substring(0,t+2)+"&hellip;"),r.replace(/&\s*$/,"")}function truncateAtSpaceHelper(n){for(var t=0,i="",r="",t=1;t<n.length;t++){if(i=n.charAt(t),i==" "||i==",")break;r+=i}return r}function truncateAtChar(n,t,i){if(typeof i=="undefined")return truncateAtCharHelper(n,t);var r=n.substring(0,i);return r!=""&&(r=r.replace(/"\s*$/,""),r=r.replace(/&*$/,""),r=r.replace(/,*$/,""),r=r.replace(/-*$/,"")),r}function truncateAtCharHelper(n,t){for(var i=0,r="",u="",i=1;i<n.length;i++)if(r=n.charAt(i),u+=r,r=t)break;return u}function changeZindex(){$("#contentWrapper").css("z-index","-1")}function resetZindex(){$("#contentWrapper").css("z-index","190")}function getCartButtonNew(){var n=readCookie("cartitem");typeof strShortName!="undefined"&&n&&n.length>0&&displayCartItemsCountNew(n)}function ciResponseHandlerNew(n){displayCartItemsCountNew(n)}function displayCartItemsCountNew(n){var t=n.toString();document.getElementById("cartBLowes")!=undefined?setCartIconStyle(n,"cartBLowes"):document.getElementById("cartButtonDiv")!=undefined&&setCartIconStyle(n,"cartButtonDiv")}function setCartIconStyle(n,t){$("#"+t).text(n.replace("items","").replace("Items","").replace("item","").replace("Item","").replace(" ",""));strShortName!="atgs"?parseInt($("#"+t).text())>99?(document.getElementById(t).style.left="-25px",document.getElementById(t).innerHTML="99+",document.getElementById("lowesCartNew").style.width="45px",document.getElementById("lowesCartNew").style.height="33px",document.getElementById(t).style.left="-30px",document.getElementById(t).style.top="-20px",document.getElementById("cartSection").style.position="relative",document.getElementById("cartSection").style.top="-6px"):document.getElementById(t).style.left=parseInt($("#"+t).text())>9?"-24px":"-20px":parseInt($("#"+t).text())>99&&(document.getElementById(t).innerHTML="99+")}function mobileHoverClick(n){globalMenuName=n}function mobileClickRedirect(n,t){globalMenuName==n&&(window.location=t)}function deskTopClickRedirect(n){globalMenuName==n&&(window.location=n);globalMenuName=n}function mobileClick(n){$("#"+n).slideToggle();var t=setTimeout(function(){$("#"+n).removeAttr("style")},3e3)}function toggleAnswer(n,t,i){var i,r,u;typeof i=="undefined"&&(i=40);r=$(document.getElementById(t));r!=null&&(r.height()==i?(r.css("height","auto"),u=r.height(),r.css("height",i+"px"),r.animate({height:u+"px"},"slow",function(){r.css("height","auto")}),n.innerHTML="show less"):(r.animate({height:i+"px"},"slow"),n.innerHTML="show more"))}function checkForCookie(){var n,t;strShortName=="atgs"&&(n=readCookie("FirstTimeUser"),n==null&&(t=new ajaxRequestObject("/ajax/EntryPopUp.aspx","",openEntryPopUp),t.doGetCallback()))}function isPopUpMobile(){var n=$(window),t=n.width();return isMobileUser()?!0:t<785?!0:!1}function openEntryPopUp(n){var t=!0;try{openPopBoxNew("",n)}catch(i){t=!1;console.log("no open pop up js")}t&&setUsersCookie()}function setUsersCookie(){SetCookie("FirstTimeUser","1",5)}function answerHelpful(n,t,i,r,u,f){var o=document.getElementById(n),s=o.innerHTML,e;f.parentElement.innerHTML='<span style="color: green;">Thank you for your feedback.<\/span>';e=new ajaxRequestObject("/ajax/logHelpfulQuestions.ashx","question="+s+"&groupid="+i+"&type="+t+"&isHelpful="+u+"&ansId="+r);e.doGetCallback()}function setSkuPriceHandler(n,t){if(arrSkuPriceHanders[n]){var i=arrSkuPriceHanders[n];arrSkuPriceHanders[n]=function(n,r){i(n,r);t(n,r)}}else arrSkuPriceHanders[n]=t}function clearSkuPriceHandlers(){arrSkuPriceHanders=[]}function swapSlideShowImage(n,t){var f,r,e,o,u;typeof SlideShowTimeOut!="undefined"&&window.clearTimeout(SlideShowTimeOut);typeof swapImageHomePage!="undefined"&&window.clearTimeout(swapImageHomePage);try{if(t||(f=document.getElementById("btn"+n),r=f.parentNode.children),e=document.getElementById("imgHomePage"),o=$(".homePageImageLink"),o.attr("href",arrLink[n-1]),typeof arrTrackingCode!="undefined"&&arrTrackingCode.length>0&&$(".homePageImageLink").attr("onclick","sendSatelliteTrack('"+arrTrackingCode[n-1]+"')"),e.src=arrImage[n-1],e.setAttribute("alt",arrAltText[n-1]),!t)for(i=0;i<r.length;i++)u=r[i],u!=f?($("#bar"+(i+1)).removeClass("charcoalbg"),u.style.color="grey"):($("#bar"+(i+1)).addClass("charcoalbg"),u.style.color="black");SlideShowTimeOut=n<r.length?window.setTimeout("swapSlideShowImage("+(n+1)+")",timeout):window.setTimeout("swapSlideShowImage(1)",timeout)}catch(s){postJavaError(s)}}function handleSkuPrices(n){setTimeout(function(){function h(){var n=window.location.href.toLowerCase();return n.indexOf("customcatalog.aspx")>-1}var s=n.split("@"),i=s[0].split("|"),e="",u,t,f,r,o;for(s.length>=2&&(e=s[1].split("~")),t=0;t<i.length;t++){if(i[t]=="")break;u=i[t].split("~");try{u[0]in arrSkuPriceHanders?arrSkuPriceHanders[u[0]](u,e):handleAjaxPrice(u,e)}catch(c){}}if(strShortName=="lfp"&&h())for(t=0;t<i.length;t++){if(i[t]=="")break;f=i[t].split("~");strShortName=="lfp"&&hideLFPAddToCartCPandI(f)&&(r=$("#compare"+f[0]+" :button"),o=$("#lowesItemNum"+f[0].toString()),r.length&&o.length&&typeof o.attr("data-lowesitemnum")!="undefined"&&(r.removeClass("green"),r.addClass("g3 charcoal"),r.html("Check Other Stores"),r.attr("onclick","'openLowesStoresByQty("+f[0].toString()+","+o.attr("data-lowesitemnum")+");")))}},250)}function hideLFPAddToCartCPandI(n){function t(){var t=!1,i=$("#lowesItemNum"+n[0].toString());return i.length&&i.attr("data-instoreonly")==="8"&&(t=!0),t}return n[28]&&n[28].toString()==="0"&&!t()}function handleAjaxPrice(n,t,i){var r,u;r=typeof i=="undefined"?document.getElementById("price"+n[0]):document.getElementById("price"+n[0]+i);r!=null&&(u=getCookie("CommercialID"),strShortName=="lfp"||u!=""?(pCount++,r.innerHTML=toCurrency(n[8]),n[24]!=3||isLfpUserLoggedIn()&&n[29]||(r.innerHTML="Add to cart to see price")):r.innerHTML=displayPriceNew(n[1],n[2],n[3],n[4],n[5],n[6],n[7],n[8],n[0],n[9],n[10],n[11],n[12],t[0],t[1],t[2],t[3],t[4],!1))}function getAjaxPrices(n){var r,e,f,o,t,i,u;(typeof strShortName!=typeof undefined&&strShortName||setSiteName(),typeof strShortName!="undefined"&&(strShortName==="lfp"||strShortName==="atgs"))&&(r=document.getElementById("divSkuList"),r!=null)&&(e=getCookie("storeinfo"),f="",e!=null&&(o=e.split("|"),o.length>=2&&(f="&storeId="+o[1])),t=getCookie("CommercialID"),t=t!=null&&t!==""?"&commercialId="+t:"",strShortName!=="atgs"||t!=="")&&(thepage=n,i=getParameterByName("db"),i=isNaN(i)?"":"&db="+i,u=null,r.innerHTML.length<1850?(u=new ajaxRequestObject("/ajax/catPrices.ashx","skus="+r.innerHTML+f+t+"&pagefrom="+n+i,handleSkuPrices),u.doGetCallback()):(u=new ajaxRequestObject("/ajax/catPrices.ashx","pagefrom="+n+f+t+ +i,handleSkuPrices),u.doPostCallback("skus="+r.innerHTML)))}function displayPriceNew(n,t,i,r,u,f,e,o,s,h,c,l,a,v,y,p,w,b,k,d,g){return(k&&(minprice=o),n=="True")?"<span class='cg strong'>Configure to see price<\/span>":t!="True"&&e!="True"&&(d!=3||isLfpUserLoggedIn()&&g)?i<2&&a<2?priceHelper(u,f,o,0,p,w,b):i>1?priceHelper(u,f,o,i,p,w,b):a>1?priceHelper(u,f,o,a,p,w,b):"":e=="True"?"<span class='cg strong'>Call "+v+" to purchase<\/span>":siteInfo.shortName=="lowesca"?"<span class='cg strong'><a id='AddToCartToSeePrice' href='/checkout/addToCart.aspx?sku="+s+"&linkloc=productItemsCart' onClick='genAddToCart("+s+", 1, 0);return false;' title='"+h+"'>Add to cart to see price<\/a><\/span>":isIe8JS?void 0:"<span class='cg strong'><a id='AddToCartToSeePrice' href='//"+y+"/checkout/addToCart.aspx?sku="+s+"&linkloc=productItemsCart' onClick='genAddToCart("+s+", 1, 0);return false;' title='"+h+"'>Add to cart to see price<\/a><\/span>"}function priceHelper(n,t,i,r,u,f,e){return hasCustomPrice()?r>1?"<div class='fntlb cgd'>"+toCurrency(convertPrice2(i/r,u,f,e))+" Each<\/div><div>"+toCurrency(convertPrice2(i,u,f,e))+" for "+r.toString()+"<\/div>":toCurrency(convertPrice2(i,u,f,e)):n!=t&&n!=0&&t!=0?toCurrency(convertPrice2(n,u,f,e))+" to "+toCurrency(convertPrice2(t,u,f,e)):i>0?r>1?"<div class='fntlb cgd'>"+toCurrency(convertPrice2(i/r,u,f,e))+" Each<\/div><div>"+toCurrency(convertPrice2(i,u,f,e))+" for "+r.toString()+"<\/div>":toCurrency(convertPrice2(i,u,f,e)):n>0?r>1?"<div class='fntlb cgd'>"+toCurrency(convertPrice2(n/r,u,f,e))+" Each<\/div><div>"+toCurrency(convertPrice2(n,u,f,e))+" for "+r.toString()+"<\/div>":toCurrency(convertPrice2(n,u,f,e)):t>0?r>1?"<div class='fntlb cgd'>"+toCurrency(convertPrice2(t/r,u,f,e))+" Each<\/div><div>"+toCurrency(convertPrice2(t,u,f,e))+" for "+r.toString()+"<\/div>":toCurrency(convertPrice2(t,u,f,e)):""}function convertPrice2(n,t,i,r){var u=0;return n!=undefined&&(u=t!=undefined&&t!="False"?n*1.66:i!=undefined&&parseFloat(i)>1?n*i:n),r!=undefined&&(u=u*r),u}function hasCustomPrice(){var n=readCookie("CommercialID");return(typeof strShortName=="undefined"&&document.getElementById("siteDiv")&&(strShortName=document.getElementById("siteDiv").innerHTML.replace(/\t/g,"").replace(/\n/g,"").replace(/\s+/g,"")),n!=null&&strShortName=="lfp")?!0:!1}function notifyWhenInStock(n){var i=0,r=window.location.href,u=readCookie("gpv_pgtype"),t;if(n==null)return!1;document.getElementById("selOpt1")==null&&document.getElementById("selOpt0")!=null&&(t=document.getElementById("selOpt0"),i=t.options[t.selectedIndex].value);n==null||typeof n=="undefined"?openPopBox(350,150,"<iframe id='NOTIFY' src='/products/notifyWhenInStock.aspx?sku="+intSku2+"' width='345px' height='115px' scrolling='no' frameBorder='0'><\/iframe>"):openPopBox(350,150,"<iframe src='/products/notifyWhenInStock.aspx?sku="+n+"' width='345px' height='115px' scrolling='no' frameBorder='0'><\/iframe>");$(function(){r.indexOf(".html")>0&&u=="product-detail"&&$("#popBox").addClass("popBoxNewPos")})}function readCookie(n){for(var r=n.toLowerCase()+"=",u=document.cookie.split(";"),t,i=0;i<u.length;i++){for(t=u[i];t.charAt(0)==" ";)t=t.substring(1,t.length);if(t.toLowerCase().indexOf(r)==0)return t.substring(r.length,t.length)}return null}function postJavaError(n){var t=new Image(1,1);t.src=document.location.protocol+"//track.atgstores.com/ajax/trackJavaError.aspx?err="+escape(n)+"&pg="+escape(location.pathname)}function SetCookie(n,t,i){var f,u,r;try{f=new Date;u=new Date;(i==null||i==0)&&(i=1);u.setTime(f.getTime()+864e5*i);r="";window.location.href.indexOf(".atgstores.com")!=-1?r=";domain=.atgstores.com":window.location.href.indexOf(".lowes.ca")!=-1?r=";domain=.lowes.ca":window.location.href.indexOf(".lowesforpros.com")!=-1&&(r=";domain=lowesforpros.com");document.cookie=n+"="+$("<textarea/>").html(decodeURIComponent(t.toString().trim())).text()+";path=/;expires="+u.toGMTString()+r}catch(e){postJavaError(e.message)}}function expireCookie(n){var t=new Date;document.cookie=n+"=;path=/;expires="+t.getTime()}function logoutRemoveCookies(){}function openpopupnotime(n,t,i){window.open(n,t,i)}function openpopup(n,t,i){window.open(n,t,i)}function get_focus(n){n.focus()}function formatPhone(n){return n=n.replace(" ",""),"("+n.substring(0,3)+") "+n.substring(3,6)+"-"+n.substring(6,10)}function formatPhoneHeader(n){return n=n.replace(" ",""),n.length!=10?n.substring(0,1)+"."+n.substring(1,4)+"."+n.substring(4,7)+"."+n.substring(7,11):n.substring(0,3)+"."+n.substring(3,6)+"."+n.substring(6,10)}function setDDL(n,t){for(var r=document.getElementById(n),i=0;i<r.options.length;i++)if(r.options[i].value==t){r.selectedIndex=i;break}}function checkRefreshTime(n,t,i,r){var u,f;try{u=document.getElementById("detect"+t);u.src&&u.src!=""&&(f=u.offsetHeight,f==2?(document.getElementById("a"+t+"on").style.display="none",document.getElementById("a"+t+"off").style.display=""):f==1&&(document.getElementById("a"+t+"on").style.display="",document.getElementById("a"+t+"off").style.display="none"));ATGupdateCount++;ATGupdateCount%r==0&&refreshImage(n,t,i);setTimeout("checkRefreshTime('"+n+"','"+t+"','"+i+"',"+r+");",1e3)}catch(e){postJavaError("checkRefreshTime: "+e.message)}}function refreshImage(n,t,i){date1=new Date;updateurl=n+"ChatScript.ashx?config="+i+"&refresh=1&time="+date1.getTime();var r=document.getElementById("detect"+t);r.src=updateurl}function showDivDetail(n,t){try{openPopBox(800,50,'<img src="/images/animated/indicator.gif"> Loading Manufacturer');var i=new ajaxRequestObject(n,t,writeDetailMFR);i.doGetCallback()}catch(r){postJavaError("showDivDetail: "+r.message)}}function writeDetailMFR(n){n.match(/Please Login/g)?openPopBox(810,50,"You need to login to the admin of this site before you can view mfr details."):openPopBox(810,760,"<div>"+n+"<\/div>");var t=document.getElementById("popBoxInner");try{t.setAttribute("style",t.getAttribute("style")+"overflow:auto ; -webkit-overflow-scrolling: touch;")}catch(i){t.style.overflow="auto"}}function hideDivDetail(n){document.getElementById(n).style.display="none"}function Right(n,t){if(t<=0)return"";if(t>String(n).length)return n;var i=String(n).length;return String(n).substring(i,i-t)}function readQuery(n,t){for(var u=n+"=",f=location.search.substring(1).split("&"),i,r=0;r<f.length;r++){for(i=f[r].toLowerCase();i.charAt(0)==" ";)i=i.substring(1,i.length);if(i.indexOf(u.toLowerCase())==0)return t!==undefined&&t?i.substring(u.length,i.length).replace(/[^\d]/g,""):i.substring(u.length,i.length)}return null}function getCheckedValue(n){var i,t;if(!n)return"";if(i=n.length,i===undefined)return n.checked?n.value:"";for(t=0;t<i;t++)if(n[t].checked)return n[t].value;return""}function toCurrency(dblMoney){var retval;try{currency=eval(dblMoney);workNum=Math.abs(Math.round(currency*100)/100);workStr=""+workNum;workStr.indexOf(".")==-1&&(workStr+=".00");dStr=workStr.substr(0,workStr.indexOf("."));dNum=+dStr;pStr=workStr.substr(workStr.indexOf("."));workNum>=1e3&&(dLen=dStr.length,dStr=parseInt(""+workNum/1e3)+","+dStr.substring(dLen-3,dLen));workNum>=1e6&&(dLen=dStr.length,dStr=parseInt(""+workNum/1e6)+","+dStr.substring(dLen-7,dLen));pStr.length==2&&(pStr+="0");retval=dStr+pStr;retval=currency<0?"- $"+retval:"$"+retval}catch(err){postJavaError("toCurrency: "+err.message)}return retval}function stripCurrency(n){return n=n.replace(/[^0-9.]/g,""),n*1}function toPercent(dblPercent){return percent=eval(dblPercent),percent=percent*100,workNum=Math.abs(Math.round(percent*100)/100),workStr=""+workNum,workStr.indexOf(".")==-1&&(workStr+=".00"),dStr=workStr.substr(0,workStr.indexOf(".")),dNum=+dStr,pStr=workStr.substr(workStr.indexOf(".")),retval=dStr+pStr,retval=percent<0?"- "+retval+"%":retval+"%"}function AddTop(n,t,i,r){var u,f=document.createElement("b"),o="r",s=4,e;for(r&&r=="small"&&(o="rs",s=2),f.className="rtop",f.style.backgroundColor=t,u=1;u<=s;u++)e=document.createElement("b"),e.className=o+u,e.style.backgroundColor=i,f.appendChild(e);try{n.insertBefore(f,n.firstChild)}catch(h){}}function AddBottom(n,t,i,r){var u,f=document.createElement("b"),o="r",s=4,e;for(r&&r=="small"&&(o="rs",s=2),f.className="rbottom",f.style.backgroundColor=t,u=s;u>0;u--)e=document.createElement("b"),e.className=o+u,e.style.backgroundColor=i,f.appendChild(e);try{n.appendChild(f,n.firstChild)}catch(h){}}function getElementsBySelector(n){var i,t=[],f="",e="",o=n,r=[],s,u;if(n.indexOf(" ")>0)return(t=n.split(" "),s=t[0].split("#"),s.length==1)?r:document.getElementById(s[1]).getElementsByTagName(t[1]);if(n.indexOf("#")>0&&(t=n.split("#"),o=t[0],f=t[1]),f!="")return r.push(document.getElementById(f)),r;if(n.indexOf(".")>0&&(t=n.split("."),o=t[0],e=t[1]),u=document.getElementsByTagName(o),e=="")return u;for(i=0;i<u.length;i++)u[i].className==e&&r.push(u[i]);return r}function fnDefault(n,t){var i=window.event?t.keyCode:t.which;n!=undefined&&i==13&&(t.stopPropagation&&(t.stopPropagation(),t&&t.preventDefault&&t.preventDefault()),t.returnValue=!1,t.cancelBubble=!0,n.click())}function addLoadEvent(n){var t=window.onload;window.onload=typeof window.onload!="function"?n:partial(ExecuteFunctions,t,n)}function ExecuteFunctions(n,t){n&&n();t&&t()}function partial(n){var t=Array.prototype.slice.call(arguments,1);return function(){var i=t.concat(Array.prototype.slice.call(arguments));return n.apply(this,i)}}function clickButton(n,t){var i=document.getElementById(t);if(typeof i=="object")if(n.keyCode){if(n.keyCode==13)return i.click(),!1}else if(event.keyCode&&event.keyCode==13)return i.click(),!1}function insertAfter(n,t){var i=t.parentNode;i.lastChild==t?i.appendChild(n):i.insertBefore(n,t.nextSibling)}function clearDiv(n){n=="acctLink"?ATGhideDivAcct=setTimeout("fnHide('"+n+"')",300):n=="hrefSite"?ATGhideDivSite=setTimeout("fnHide('"+n+"')",300):ATGhideDivShop=setTimeout("fnHide('"+n+"')",300)}function fnHide(n){document.getElementById(n+"SubMenu")?document.getElementById(n+"SubMenu").style.display="none":document.getElementById(n+"subMenu")&&(document.getElementById(n+"subMenu").style.display="none")}function findPosX(n){var t=0;if(n.offsetParent)for(;;){if(t+=n.offsetLeft,!n.offsetParent)break;n=n.offsetParent}else n.x&&(t+=n.x);return t}function findPosY(n){var t=0;if(n.offsetParent)for(;;){if(t+=n.offsetTop,!n.offsetParent)break;n=n.offsetParent}else n.y&&(t+=n.y);return t}function rpLink(){readCookie("user%5Fid")!=null&&readCookie("lui%5Frep%5Fid")!=null&&readCookie("fullName")!=null&&($("#rewardA").attr("href","/admin/orders/customer.aspx?id="+readCookie("user%5Fid")+""),$("#rewardA").empty(),$("#rewardA").wrapInner(""+readCookie("fullName")+" <a class='fnts l' href='/account/logout.aspx'>Logout<\/a>"))}function loadCart(){try{if(readCookie("cartItem")!=null){readCookie("cartItem").indexOf("~")>0&&SetCookie("cartItem","0-0",-1);var n=readCookie("cartItem").split("-");n.length==2&&(n[0]==0?document.write("0 Items : <strong>$0.00"):document.write(n[0]+" Items : <strong>"+toCurrency(n[1])))}else document.write("0 Items : <strong>$0.00")}catch(t){postJavaError("loadCart: "+t.message)}}function showRecentViewed(){var r,t,u,f,i,n;if(document.getElementById("RecentlyViewedContent")!=null)try{if(r=unescape(readCookie("recentView")),t="",r!=null)for(u=r.split("~"),f=0,i=u.length-1;i>=0;i--)n=u[i].split("|"),n[0].length>0&&n[2]&&f<4&&(f++,t+="<a class='l mgr16 g2' href='/products/view.aspx?family="+n[0]+"'> <div class ='l' title='"+n[2]+"'>",t+=n[1].length>5?"<img src='//images.atgstores.com/img/t/"+n[1].replace(/\+/g,"%20")+"' class=' img75 brd' />":"<img src='//images.atgstores.com/images/Product/NoImage.png' class='img75 brd'/>",t+="<div class='l ofh txtl g2' style='text-overflow: ellipsis; height: 3.6em; line-height:1.2em;'>"+n[2]+"<\/div><\/div><\/a>");t!=""&&(document.getElementById("RecentlyViewedContent").innerHTML=t)}catch(e){postJavaError("showRecentViewed: "+e.message)}}function displayButton(){document.getElementById("btnForward").style.display="inline"}function recentlyViewedForward(){document.getElementById("RecentlyViewedContent").innerHTML='<iframe width="445px" height="70px" id="iframeRvc" frameborder="0" src="//track.atgstores.com/ajax/getRecentlyViewed.aspx" scrolling="no" />';document.getElementById("btnForward").style.display="none"}function sendFeedBackLocal(n){var i,f,e;try{var r=document.getElementById("txtFbEmail"),o=document.getElementById("divFeedBackEmail"),t=document.getElementById("txtFeedBack"),u=r.value;if(location.protocol+"//"+location.host+location.pathname+location.search,n==""&&(n=0),i=!1,t.value==""||t.value=="We appreciate your suggestions. Please note that we are unable to respond directly to every suggestion."?(t.style.border="1px solid red",$("#imgError").removeClass("displayn").addClass("displayi"),i=!0):(t.style.border="",$("#imgError").removeClass("displayi").addClass("displayn")),f=/^[a-zA-Z0-9._-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,4}$/,f.test(u)||u==""?(r.style.border="",$("#imgEmailError").removeClass("displayi").addClass("displayn")):(r.style.border="1px solid red",$("#imgEmailError").removeClass("displayn").addClass("displayi"),i=!0),i)return;e=new ajaxRequestObject("/ajax/miniFeedBack.aspx","group_id="+n+"&page="+escape(location.protocol+"//"+location.host+location.pathname+location.search)+"&feedback="+escape(t.value)+"&email="+u,loginAfterFeedback);e.doGetCallback();o.innerHTML="<div style='height:55px;'><\/div><div style='color:#666;'>Thank you for your feedback.<\/div>"}catch(s){postJavaError("sendFeedbackLocal: "+s.message)}}function loginAfterFeedback(n){try{var t=document.createElement("iframe");t.setAttribute("id","iFrameLogin");document.body.appendChild(t);t.setAttribute("src","//www.atgstores.com/ajax/login.aspx"+n);document.getElementById("iFrameLogin").style.height="0px";document.getElementById("iFrameLogin").style.width="0px";document.getElementById("iFrameLogin").style.display="none"}catch(i){postJavaError("loginAfterFeedback: "+i.message)}}function track(n,t,i,r){r===undefined&&(r="track");var u=new ajaxRequestObject("//track.atgstores.com/ajax/track.aspx","name="+n+"&value1="+t+"&value2="+i+"&tableName="+r);u.doGetCallback()}function trackClick(n,t){var i=new ajaxRequestObject("//track.atgstores.com/ajax/searchClickTrack.ashx","term="+n+"&groupId="+t);i.doGetCallback()}function autoFillNav(n){var i,t,r;try{i=window.event?event.keyCode:n.which;switch(i){case 13:enter();break;case 38:move("up");break;case 40:move("down");break;default:document.getElementById("tbxsearchterm")&&(t=document.getElementById("tbxsearchterm"),t.value.length>3?(r=new ajaxRequestObjectCache("/ajax/fillSearch.aspx","term="+t.value,showFillNav),r.doGetCallback()):hideFNDelay())}}catch(u){postJavaError("autoFillNav: "+u.message)}}function showFillNav(n){var r,f;try{if(ATGshow){var i=n.split("~"),t=document.getElementById("divNavMatch"),u=document.getElementById("tbxsearchterm");if(t.innerHTML="",currentLength=i.length,i.length>1)for(t.className="fillBoxNav",t.innerHTML+='<span style="color:#666;font-size:8pt;text-align:center;display:block;">- Search Suggestions -<\/span>',r=0;r<i.length-1;r++)f=i[r].replace(u.value.replace(/^\s+/,"").toLowerCase(),'<span style="font-size:9pt;color: #6699FF; padding: 0px; margin: 0px;">'+u.value.toLowerCase()+"<\/span>"),t.innerHTML+='<div style="margin:5px"><a href="/search/default.aspx?term='+i[r]+'" style="font-size:9pt;padding: 3px 3px; display: block; text-decoration:none;" onmouseout="this.style.background=\'#FFF\'" onmouseover="clearSelectNav(); this.style.background=\'#DDD\';this.style.color=\'#003399\'">'+f+"<\/a><\/div>";else t.className="hide",t.innerHTML=""}else t.className="hide",t.innerHTML=""}catch(e){postJavaError("showFillNav: "+e.message)}}function clearSelectNav(){var i,t,n;try{if(ATGcur>-1)for(i=document.getElementById("divNavMatch"),t=i.getElementsByTagName("div"),ATGcur=-1,n=0;n<t.length;n++)t[n].getElementsByTagName("a")[0].style.background="#FFF"}catch(r){postJavaError("clearSelectNav: "+r.message)}}function hideFN(){setTimeout(hideFNDelay,1e3)}function hideFNDelay(){var n=document.getElementById("divNavMatch");n.className="hide";n.innerHTML=""}function moveNew(n){var r,t,i;try{if(r=document.getElementById("divSearchResults"),r){for(t=r.getElementsByTagName("a"),n=="down"?ATGcur++:ATGcur--,ATGcur>t.length-1&&(ATGcur=-1),ATGcur<-1&&(ATGcur=t.length-1),i=0;i<t.length;i++)t[i].style.background=i==ATGcur?"#ddd":"#fff";ATGcur!=-1?document.getElementById("tbxsearchtermNew").value=document.getElementById("divSearchResults").getElementsByTagName("a")[ATGcur].innerText.replace("(category)","").replace("(brand)","").replace("(article)","").replace(new RegExp("<[^>]*>","gi"),"").replace(/[|$%@"<>()+,]/g,""):strSavedSearchString!=""&&(document.getElementById("tbxsearchtermNew").value=strSavedSearchString);intPreviousMove=ATGcur}}catch(u){postJavaError("move: "+u.message)}}function countStrokesNew(n){var i,r,t;try{if(!is_ie6()){if(i=document.getElementById("tbxsearchtermNew").value,i.indexOf("Search for")!=-1||i.indexOf("Search and")!=-1){document.getElementById("tbxsearchtermNew").value="";return}r=window.event?event.keyCode:n.which;t=document.getElementById("tbxsearchtermNew").value;switch(r){case 13:return enterNew();case 38:moveNew("up");break;case 40:moveNew("down");break;default:strSavedSearchString=document.getElementById("tbxsearchtermNew").value;t.length>3?(t=cleanTermForSearch(t),t.length>2&&(ajaxSearchSuggestion!==undefined&&ajaxSearchSuggestion.abort(),ajaxSearchSuggestion=$.ajax({url:"/ajaxcache/searchSuggestions.ashx?term="+escape(t),type:"GET",dataType:"html",cache:!0}).done(displaySearchSuggestionsNew)),document.getElementById("tbxsearchtermNew").value.length>127&&(document.getElementById("tbxsearchtermNew").value=t.substring(0,127))):hideSearchSuggestionsNew()}}}catch(u){postJavaError("countStrokes: "+u.message)}}function updateSearchBox(n){return document.getElementById("tbxsearchterm").value=n,!0}function updateSearchBoxNew(n){return document.getElementById("tbxsearchtermNew").value=n,!0}function cleanTermForSearch(n){try{strNewTrim=newTrim(n);var t=strNewTrim.replace("é","e");return strRegex2=t.replace(new RegExp("[^ 0-9A-Za-z_'-/\"&É]*","g"),""),strRegex3=strRegex2.replace(new RegExp("[*<>]*","g"),""),strRegex4=strRegex3.replace(new RegExp("_","g"),"%5"),strRegex3.replace(/ /g,"-")}catch(i){postJavaError("cleantermforsearch: "+i.message)}}function setSearchTracking(n,t,i){window.autoSearchVar=[];autoSearchVar.push({userEnteredTerm:n,searchTermUserSelected:i,positionOfResults:t,typeOfSearch:"keyword"});autoSearchVar.length>0&&_satellite.track("autoCompleteSearch")}function SetSearchTermCookie(n){typeof n!="undefined"&&n!==null&&n!==""&&SetCookie("searchTerm",n.replace(/-/g," "),1/96)}function submitSearchNew(){var n,t,r,i,u;try{if(n=cleanTermForSearch(document.getElementById("tbxsearchtermNew").value).replace("É","E"),lfpSearchTerm=n,n.length==2&&(n=n.toLowerCase()),n.indexOf("Search-for")>-1||n.indexOf("Search-over")>-1)showErrArrow("Three Character Minimum");else{if(n.length>2||n.length==2&&/3m|pb|lg|ge|o3|aq|ki|mw|nk|c3|xo|e3/.test(n.toLowerCase())){if(t="",SetSearchTermCookie(n),locationToRedirect=t+"/search/"+encodeURIComponent(n.replace(/in-Category|in-Brand/gi,"").replace(/^\s+|\s+$/gm,""))+".html?iterm="+encodeURIComponent(n.replace(/in-Category|in-Brand/gi,"").replace(/^\s+|\s+$/gm,""))+"",n.match(new RegExp("^[0-9]+[gG]$","")))locationToRedirect=t+"/products/view.aspx?family="+n.substring(0,n.length-1)+"&iterm="+n;else if(n.match(new RegExp("^[0-9]+[sS]$","")))locationToRedirect=t+"/products/view.aspx?sku="+n.substring(0,n.length-1)+"&iterm="+n;else if((typeof strShortName=="undefined"||strShortName=="atgs")&&n.match(new RegExp("^[0-9]+[cC]$","")))locationToRedirect=t+"/products/view.aspx?sku="+n.substring(0,n.length-1)+"&SearchTerm="+n+"&INT_CMP=3665";else if(n.match(new RegExp("^[0-9]+[gG][cC]$","")))locationToRedirect=t+"/products/view.aspx?family="+n.substring(0,n.length-2)+"&isProdSet=1";else if(n.match(new RegExp("^[0-9]+[sS][cC]$","")))locationToRedirect=t+"/products/view.aspx?sku="+n.substring(0,n.length-2)+"&isProdSet=1";else if(document.getElementById("divSearchResults"))for(r=document.getElementById("divSearchResults").getElementsByTagName("a"),i=0;i<r.length;i++){var f=r[i].href,e=r[i].innerHTML,o=r[i].innerText;if(o==n.replace(/-/g," ")&&(u=r[i].onclick),f.indexOf("search")==-1&&e==n.replace("-"," ")){f+=f.indexOf("?")==-1?"?linkloc=newSearchRedirect":"&linkloc=newSearchRedirect";locationToRedirect=f;break}}typeof u!="undefined"&&u!=null&&u!=""&&u();redirectSearch()}else newTrim(document.getElementById("tbxsearchtermNew").value).length<3?showErrArrow("Three Character Minimum"):n.length<3&&showErrArrow("Invalid Search");typeof event!="undefined"&&(event.cancelBubble=!0,event.returnValue=!1)}return!1}catch(s){postJavaError("submitSearch: "+s.message)}}function fadeElement(n,t,i){typeof t=="undefined"&&(t=2);fadeElementHelper(n,t,10,i)}function fadeElementHelper(n,t,i,r){i>1?(document.getElementById(n).style.opacity=i/10,document.getElementById(n).style.filter="alpha(opacity="+i*10+")",i-=t/10,intFadeElementId=setTimeout("fadeElementHelper('"+n+"', '"+t+"', '"+i+"', "+r+")",150)):(document.getElementById(n).style.display="none",i=10,r!==undefined&&r())}function showErrArrow(n){document.getElementById("errArrContainer").innerHTML="<span style='position:absolute;top:4px;left:27px;color:white;'>"+n+"<\/span>";document.getElementById("errArrContainer").style.display="inline";clearTimeout(intFadeElementId);fadeElement("errArrContainer")}function growSearchButton(){Math.round(document.getElementById("inpSearchSubmit").style.width.replace("px",""))<90&&(document.getElementById("inpSearchSubmit").style.width=Math.round(document.getElementById("inpSearchSubmit").style.width.replace("px",""))+2+"px",setTimeout("growSearchButton()",25))}function redirectSearch(){window.location=locationToRedirect}function is_ie6(){return window.XMLHttpRequest==undefined&&ActiveXObject!=undefined}function enterNew(){return ATGshow=!1,submitSearchNew()}function displaySearchSuggestions(n){try{var t=document.getElementById("searchSuggestions");n!=""&&n!=null?(document.getElementById("tbxsearchterm").style.backgroundImage="url(//images.atgstores.com/images/layout/searchboxnobottom.png)",t.style.display="block",t.innerHTML=n+'<div style="text-align: center; position: relative;clear:both;" class="fnts">Search Suggestions<\/div><div style="text-align: center; position: absolute; left: 0px; bottom: -4px; width: 376px; height: 5px; background-image: url(//images.atgstores.com/images/layout/searchbottomnew.png); background-repeat: no-repeat;" ><\/div>'):(t.style.visible="none",document.getElementById("tbxsearchterm").style.backgroundImage="url(//images.atgstores.com/images/layout/searchbox.png)")}catch(i){postJavaError("displaySearchSuggestions: "+i.message)}}function displaySearchSuggestionsNew(n){try{var t=document.getElementById("searchSuggestions");n!=""&&isNaN(n)&&n!=null?(t.style.display="block",t.innerHTML=n+'<div style="text-align: center; position: relative;clear:both;" class="fnts">Search Suggestions<\/div>'):t.style.display="none"}catch(i){postJavaError("displaySearchSuggestions: "+i.message)}}function hideSearchSuggestionsNew(){setTimeout(function(){delayHideNew("searchSuggestions")},400)}function delayHideNew(){document.getElementById("searchSuggestions").style.display="none"}function hideSearchSuggestions(){setTimeout(function(){delayHide("searchSuggestions")},400)}function delayHide(){document.getElementById("searchSuggestions").style.display="none";document.getElementById("tbxsearchterm").style.backgroundImage="url(//images.atgstores.com/images/layout/searchbox.png)"}function chgColor(n){n=="On"?(document.getElementById(this).style.backgroundColor="#000",document.getElementById(this).style.color="#fff"):(document.getElementById(this).style.backgroundColor="#fff",document.getElementById(this).style.color="#000")}function ajaxRequestObject(n,t,i,r){function f(){return window.XMLHttpRequest?new XMLHttpRequest:window.ActiveXObject?new ActiveXObject("Microsoft.XMLHTTP"):void 0}function e(){u.readyState==4&&i&&i(u.responseText,r)}var u=f();u.onreadystatechange=e;this.doGetCallback=function(){var r=(new Date).getTime(),i="&rand="+r;n.indexOf("storelocatorhelper")!=-1&&(i="");u.open("get",n+"?"+t+i);u.send(null)};this.doPostCallback=function(i){var f=(new Date).getTime(),r="&rand="+ +f;n.indexOf("storelocatorhelper")!=-1&&(r="");u.open("post",n+"?"+t+r);u.setRequestHeader("Content-Type","application/x-www-form-urlencoded");u.send(i)}}function ajaxRequestObjectCache(n,t,i,r){function f(){return window.XMLHttpRequest?new XMLHttpRequest:window.ActiveXObject?new ActiveXObject("Microsoft.XMLHTTP"):void 0}function e(){u.readyState==4&&i&&i(u.responseText,r)}var u=f();u.onreadystatechange=e;this.doGetCallback=function(){u.open("get",n+"?"+t);u.send(null)};this.doPostCallback=function(i){var r=(new Date).getTime();u.open("post",n+"?"+t);u.setRequestHeader("Content-Type","application/x-www-form-urlencoded");u.send(i)}}function ajax(n,t,i){var u,f,r;try{u=n;f="";n.indexOf("?")>=0&&(u=n.substring(0,n.indexOf("?")),f=n.substring(n.indexOf("?")+1,n.length));i?(r=new ajaxRequestObject(u,f,t),r.doGetCallback()):(r=new ajaxRequestObjectCache(u,f,t),r.doGetCallback())}catch(e){postJavaError("ajax: "+e.message)}}function flipSpinner(n){var t=document.getElementById(n);t.style.display=t.style.display=="none"?"":"none"}function hideElement(n){document.getElementById(n).style.display="none"}function showElement(n){document.getElementById(n).style.display=""}function showSiteDelay(n){n!=""?(clearTimeout(showSiteTimeout),clearTimeout(hideSiteTimeout),showSiteTimeout=setTimeout("showSubSite('"+n+"')",200)):hideSite()}function showSubSite(n){overNav=!0;curTab=n;var t=new ajaxRequestObjectCache("/ajax/navigationd.aspx","site="+n,setSiteDiv);t.doGetCallback()}function setSiteDiv(n){clearTimeout(hideSiteTimeout);clearBox();document.getElementById(curTab+"Box").innerHTML=n}function clearBox(){document.getElementById("lightBox").innerHTML="";document.getElementById("plumbBox").innerHTML="";document.getElementById("hardBox").innerHTML="";document.getElementById("hfsBox").innerHTML="";document.getElementById("homeBox").innerHTML="";document.getElementById("rugBox").innerHTML="";document.getElementById("olsBox").innerHTML="";document.getElementById("kidsBox").innerHTML="";document.getElementById("babyBox").innerHTML="";document.getElementById("toolsBox").innerHTML="";document.getElementById("sportsBox").innerHTML="";document.getElementById("cookBox").innerHTML="";document.getElementById("hasBox").innerHTML="";document.getElementById("lugsrBox").innerHTML="";document.getElementById("ofuBox").innerHTML=""}function hideSiteDelay(){overNav=!1;clearTimeout(hideSiteTimeout);clearTimeout(showSiteTimeout);hideSiteTimeout=setTimeout("hideSite()",500)}function hideSite(){overNav||clearBox()}function showAcctSub(){clearTimeout(hideAcctTimeout);document.getElementById("imgAcctSub").style.display="block"}function hideAcctSubDelay(){clearTimeout(hideAcctTimeout);hideAcctTimeout=setTimeout("hideAcctSub()",500)}function hideAcctSub(){document.getElementById("imgAcctSub").style.display="none"}function checkIfMobile(){return/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent)?!0:!1}function checkValidSurveyLocation(){var n=!1,t=window.location.href.toString().toLowerCase();return t.search(".atgstores.com")>-1&&document.getElementById("popBox")==null&&document.getElementById("popUpBox")==null&&(n=!0),n}function showSurvey(){try{if(readCookie("popunder")){var n=parseInt(readCookie("popunder"));n==15&&displaySurvey();SetCookie("popunder",n+1,100)}else SetCookie("popunder",1,100)}catch(t){postJavaError("showSurvey: "+t.message)}}function displaySurvey(){checkValidSurveyLocation()&&!checkIfMobile()&&openPopBox(403,223,"<div><h1>Customer Survey<\/h1><strong style='margin-top:-6px;' class='displayb mgb16'>Your opinion matters!<\/strong><p>Your answers to our super-fast survey will help us serve you better!<\/p><input type='button'class=' btnReg green mgr8' value='Continue' onClick='popUnder(this)'/><input type='button' class='btnReg mgr8' value='Cancel' onclick='closePopBox()' /><\/div><\/div><div class='cfb'><\/div><div class='full'><div style='width: 74%;' class='center mgt16'><img src='//images.atgstores.com/images/layout/ATGSurveyLogoSml.png' alt='ATGStores.com' style='border-top-color: #f7f7f7;' class='brdt mgt16'><\/div><\/div><\/div>")}function popUnder(){SetCookie("popunder",40,100);closePopBox();var n=0,t=0;this.parent.innerWidth>530&&this.parent.innerHeight>300&&(t=Math.abs(this.parent.innerWidth/2-265),n=Math.abs(this.parent.innerHeight/2-150));winUnder=window.open("/survey/surveyWaitPopUp.aspx","_blank","toolbar=no, scrollbars=no, resizable=yes, top="+n+", left="+t+", width=530, height=300")}function displayEmailSignUpBox(){if(strShortName&&strShortName=="lfp")openPopBox(280,110,"<div id='LFP_emailDiv' class='g6 center'><h1>E-Mail Sign Up<\/h1><label class='labelPos fnts'>Enter your email to get into our email listing<\/label><input id='tbxCustEmail' type='text' class='atgInput' style='width:228px;' placeholder='example@test.com' /><br><input type='button' value='Submit' onclick='saveLFPEmail(tbxCustEmail.value);' class='btnReg green r' /><label id='LFP_lblErr' class='fnts crd'/><\/div>");else{if(strShortName&&strShortName=="lowesca"||document.getElementById("popBox")!=null)return;openPopBox(440,475,"<div style='background: url(//images.atgstores.com/images/mktg/emailPopUpBackground.jpg); display: block; width: 439px;height: 366px; position: relative;'> <div style='display: block; width: 220px; position: absolute; top: 80px;'> <h1 style='color:#336699;text-align: right; font-size: 36px;'>SAVE 5%!<\/h1> <p style='color:#336699;text-align: right; margin-top: -10px;'>On Your First Order*<\/p> <\/div> <div> <p style='color:#71922a; display:block; position:absolute; top:158px; left:90px; width:260px; line-height:15px;'>  <strong style='line-height:inherit;'>SIGN UP<\/strong> and <strong style='line-height:inherit;'>SAVE EVEN MORE<\/strong> with deals, sales news and special discounts designed for you. <\/p> <\/div> <div id='divEmailSignUpDiv' style='position:absolute; top:229px; left:161px; text-align:center;'> <input id='txtBoxEmailSignUp' type='text' style='width:202px; margin: 5px 0; position: relative; padding: 6px; background: transparent; outline: 0; transition: all .25s ease-in-out;-webkit-transition: all .25s ease-in-out;-moz-transition: all .25s ease-in-out;border-radius: 4px;-webkit-border-radius: 4px;-moz-border-radius: 4px;border: 1px solid #aaa;-webkit-box-shadow: 0 1px 0 white;-moz-box-shadow: 0 1px 0 #fff;box-shadow: 0 1px 0 white; background: #FFF; margin-top:-3px;' name='ctl00$Main$createaccount$TextBox1' alt='Email *'> <input id='btnEmailSignUp' type='button' style='background-color:#8cb535;padding:6px 0; text-align:center; width:116px;font-weight:bold;vertical-align :middle;border-radius: 3px;color: #FFFFFF; border: 1px solid #678724;margin-top:-3px;' value='Sign Up' onclick='goToSubscriptionPage(txtBoxEmailSignUp.value)'/>  <\/div>  <\/div> <p class='fntsi'><a href='https://www.atgstores.com/about/couponspolicies.aspx' target='_blank'>*Excludes some manufacturers.<\/a><\/p><p class='fntsi'>You are consenting to receive marketing emails from ATGStores.com. You can unsubscribe any time by using the unsubscribe link in our marketing emails, contacting us at ATG Stores, 11410 NE 122nd Way, Ste. 200, Kirkland WA 98034 or via email at <a href='mailto:support@atgstores.com'  class='fntsi ' style='color:#336699;  '>support@atgstores.com.<\/a><\/p>")}}function goToSubscriptionPage(n){var t=new ajaxRequestObject("/ajax/OneClickEmailSignup.aspx","&email="+n,displayResult);t.doGetCallback()}function displayResult(n){if(n.toString().indexOf("wrong input")>-1)document.getElementById("divEmailSignUpDiv").innerHTML=" <input id='txtBoxEmailSignUp' type='text' style='width:202px; margin: 5px 0; position: relative; padding: 6px; background: transparent; outline: 0; transition: all .25s ease-in-out;-webkit-transition: all .25s ease-in-out;-moz-transition: all .25s ease-in-out;border-radius: 4px;-webkit-border-radius: 4px;-moz-border-radius: 4px;border: 1px solid red;-webkit-box-shadow: 0 1px 0 white;-moz-box-shadow: 0 1px 0 #fff;box-shadow: 0 1px 0 white; background: #FFF; margin-top:-3px;' name='ctl00$Main$createaccount$TextBox1' placeholder='Please enter a valid email.'  alt='Email *'> <input id='btnEmailSignUp' type='button' style='background-color:#8cb535;padding:6px 0; text-align:center; width:116px;font-weight:bold;vertical-align :middle;border-radius: 3px;color: #FFFFFF; border: 1px solid #678724;margin-top:-3px;' value='Sign Up' onclick='goToSubscriptionPage(txtBoxEmailSignUp.value)'/> ";else if(n.indexOf("filtered")>1){var t=n.indexOf("!"),r=n.substring(0,t+1),i=n.indexOf("e!"),u=n.substring(t+1,i+2),f=n.substring(i+2,n.length);document.getElementById("divEmailSignUpDiv").innerHTML="<div style='width:175px; margin-left:-52px; margin-top: -2px;' ><strong style='color:#551A8B;'>"+r+"<\/strong><\/div><br/><div style='width:222px; margin-left:0px; margin-top: -21px;' ><strong style='color:#551A8B;'>"+u+"<\/strong><\/div><br/><div class=' fntsi cg ftEmailsignText' style='position:relative; width:318px; top:-19px; left:-32px; ' >"+f+"<\/div>"}else document.getElementById("divEmailSignUpDiv").innerHTML="<div style='width:222px; margin-left:15px; margin-top: 10px;' ><strong style='color:#551A8B;'>"+n+"<\/strong><\/div><br/>"}function saveLFPEmail(n){if(n.indexOf("@")>-1&&n.indexOf(".")>-1){var t=new ajaxRequestObject("/ajax/LFP_storeCustEmail.ashx","email="+n,LFP_displayResult);t.doGetCallback();document.getElementById("LFP_emailDiv").innerHTML="<img style='height:70px;width:70px;margin-left:95px;margin-top:15px;' src='//images.atgstores.com/images/layout/spinner3.gif' />"}else document.getElementById("LFP_lblErr").innerHTML="Please enter a valid email address."}function LFP_displayResult(n){n=="0"?document.getElementById("LFP_emailDiv").innerHTML="<div class='success txtc' style='margin:0px; width:196px; height:68px;'>Thank you for signing up with us.<\/div>":n=="-1"?document.getElementById("LFP_emailDiv").innerHTML="<div class='err txtc' style='margin:0px; width:196px; height:68px;'>There has been an error. Please try again. <\/div>":n=="1"&&(document.getElementById("LFP_emailDiv").innerHTML="<div class='info txtc' style='margin:0px; width:196px; height:68px;'>This email already exists in our database. Thank you.<\/div>")}function closePopUpChatWindow(){document.getElementById("surveyDiv").style.display="none"}function pageSetup(){try{document.getElementById("tbxsearchterm")&&document.getElementById("tbxsearchterm").value==""&&readQuery("term")!=null&&(document.getElementById("tbxsearchterm").value=decodeURIComponent(readQuery("term").replace(/\+/g," ").replace(/%20/g," ")));readCookie("af800")!=null&&readCookie("af800")!=""&&(document.getElementById("aPhone").innerHTML=formatPhone(readCookie("af800").replace(/[^0-9]/g,"")))}catch(i){postJavaError("pageSetup: "+i.message)}try{var n=new Date,r=n.getTimezoneOffset(),u=n.getHours(),t=u+r/60;day=n.getDay();ATGTime=n.dst()?t-7:t-8;working()?($("#imgChat").attr("src","//images.atgstores.com/images/layout/livechat.png"),strShortName!=null&&strShortName=="atgs"?$(".lchatmeNew").get(0).lastChild.nodeValue="Live Chat":$(".lchatme").get(0).lastChild.nodeValue="Live Chat",$("#headNew_ctl00_liveChat").removeClass("cgl")):(strShortName!=null&&strShortName=="atgs"?$(".lchatmeNew").get(0).lastChild.nodeValue="OFFLINE":$(".lchatme").get(0).lastChild.nodeValue="OFFLINE",$("#headNew_ctl00_liveChat").addClass("cgl"),$("#imgChat").attr("src","https://images.atgstores.com/img/chatoff.png"),$("#headNew_ctl00_liveChat").attr("onclick","return true;"))}catch(f){}}function betweenWeekday(n,t,i,r){if(r==1)if(t=="am")switch(n){case"6":return!0;case"7":return!0;case"8":return!0;case"9":return!0;case"10":return!0;case"11":return!0;default:return!1}else switch(n){case"12":return!0;case"1":return!0;case"2":return!0;case"3":return!0;case"4":return!0;case"5":return!0;case"6":return!0;case"7":return!0;default:return!1}else if(t=="am")switch(n){case"4":return!0;case"5":return!0;case"6":return!0;case"7":return!0;case"8":return!0;case"9":return!0;case"10":return!0;case"11":return!0;default:return!1}else switch(n){case"12":return!0;case"1":return!0;case"2":return!0;case"3":return!0;case"4":return!0;case"5":return!0;case"6":return!0;case"7":return!0;case"8":return!0;case"9":return!0;default:return!1}}function displaySubNav(n){typeof displaySubType=="function"&&(hideSubNav(n),navTimer=setTimeout('displaySubType("'+n+'")',300))}function displaySubType(n){var t=document.getElementById(n+"DropDownMenu");t.style.display="block"}function hideSubNav(n){var t,u,i,r;typeof navTimer!="undefined"&&clearTimeout(navTimer);try{for(u=document.getElementById("subNavElements"),i=u.childNodes,t=0;t<i.length;t++)r=i[t].id,r.indexOf(n)<0&&r.indexOf("DropDownMenu")>0&&i[t].style.display=="block"&&clearDivNav(i[t].id,"DropDownMenu")}catch(f){postJavaError("showDivDetail: "+f.message)}}function clearDivNav(n){subNavHideTimer=setTimeout("fnHideNav('"+n+"')",300)}function fnHideNav(n){document.getElementById(n)&&(document.getElementById(n).style.display="none")}function keepSubNav(){typeof subNavHideTimer!="undefined"&&clearTimeout(subNavHideTimer)}function showSubType(n){navTimer=setTimeout('showSubTypeTime("'+n+'")',350);clearSub()}function showSubTypeTime(n){var t=document.getElementById(n+"subMenu"),r,i,u;t?(r=t.getElementsByTagName("a"),r.length>0&&(t.style.display="block")):(i=document.getElementById(n+"SubMenu"),u=i.getElementsByTagName("a"),u.length>0&&(i.style.display="block"))}function clearSub(){var r,t,n;try{for(r=document.getElementById("ulTopNavType"),t=r.getElementsByTagName("li"),i=1;i<t.length;i++)n=t[i].getElementsByTagName("a"),n[0].id!=""&&(document.getElementById(n[0].id+"SubMenu")?document.getElementById(n[0].id+"SubMenu").style.display="none":document.getElementById(n[0].id+"subMenu")&&(document.getElementById(n[0].id+"subMenu").style.display="none"))}catch(u){postJavaError("showDivDetail: "+u.message)}}function lpAddMonitorTag(n){typeof n=="undefined"||typeof n=="object";n.indexOf("http")!=0?n=lpMTagConfig.lpProtocol+"://"+lpMTagConfig.lpServer+n+"?site="+lpMTagConfig.lpNumber:n.indexOf("site=")<0&&(n=n.indexOf("?")<0?n+"?":n+"&",n=n+"site="+lpMTagConfig.lpNumber);var t=document.createElement("script");t.setAttribute("type","text/javascript");t.setAttribute("charset","iso-8859-1");t.setAttribute("src",n);document.getElementsByTagName("head").item(0).appendChild(t)}function saveUserLog(n){var t=location.pathname;if(!t.toLowerCase().indexOf("/checkout/")>-1)try{params="";n!=undefined&&(params+="logType="+n+"&");createData();postData(n)}catch(i){postJavaError("SaveUserLog: "+i.message);params=""}}function createData(){var n,t;try{if(cookie("NetSessionId")==0?(n=guid(),SetCookie("NetSessionId",n,365)):n=cookie("NetSessionId"),params+="sessionId="+n+"&",params+="customerId="+cookie("user%5Fid")+"&",params+="ATGRepId="+cookie("lui%5Frep%5Fid")+"&",params+="h="+location.host+"&",typeof wvtid!="undefined"&&(params+="t="+wvtid+"&"),typeof wvsku!="undefined"&&(params+="s="+wvsku+"&"),typeof wvfamily!="undefined"&&(params+="f="+wvfamily+"&"),typeof wvmfr!="undefined"&&(params+="m="+wvmfr+"&"),typeof wvstyle!="undefined"&&(params+="st="+wvstyle+"&"),typeof wvprice!="undefined"&&(params+="p="+wvprice+"&"),typeof trackViewsArray!="undefined"){for(params+="tr=",t=0;t<trackViewsArray.length;t++)params+=trackViewsArray[t]+"|";params+="&"}params+="pg="+location.pathname+"&";params+="rf="+escape(document.referrer)+"&";params+="qs="+escape(location.search)+"&";document.getElementById("loadTimeForWebVisitorLog")&&(params+="lt="+document.getElementById("loadTimeForWebVisitorLog").innerHTML+"&",params+="sqlt="+document.getElementById("sqlTimeForWebVisitorLog").innerHTML+"&",params+="guid="+document.getElementById("guidForWebVisitorLog").innerHTML+"&");typeof pageName!="undefined"&&(params+="pn="+escape(pageName),params+="rqs="+escape(strPageQueryString));cookieStr=cookie("user%5Fid")}catch(i){postJavaError("CreateDatea: "+i.message)}}function postData(){var n=new Image(1,1);n.src=document.location.protocol+"//track.atgstores.com/ajax/webVisitorLog.aspx?"+params}function cookie(n){for(var r=n.toLowerCase()+"=",u=document.cookie.split(";"),t,i=0;i<u.length;i++){for(t=u[i].toLowerCase();t.charAt(0)==" ";)t=t.substring(1,t.length);if(t.indexOf(r)==0)return t.substring(r.length,t.length)}return 0}function S4(){return((1+Math.random())*65536|0).toString(16).substring(1)}function guid(){return S4()+S4()+S4()+S4()+S4()+S4()+S4()}function highlightlink(){var i,t,n;if(readQuery("nextLink")!=null)for(i=unescape(readQuery("nextLink")),t=document.getElementsByTagName("a"),n=0;n<t.length;n++)t[n].href.split("#")[0].toLowerCase()==i.toLowerCase()&&(t[n].style.borderWidth="3pt",t[n].style.borderColor="33CC00",t[n].style.borderStyle="solid")}function saveCookie(n){SetCookie("NetSessionId",n.replace(/^\s+|\s+$/g,""),365)}function share(n){try{var i=location.href,t=document.title,r="";document.getElementById("prodDesc")&&(r=document.getElementById("prodDesc").innerHTML);t.length>30&&(t=t.substring(0,30));r.length>30&&(r=r.substring(0,30));switch(n){case 0:window.location="/products/emailToFriend.aspx?page="+i;break;case 1:window.open("//www.facebook.com/sharer.php?u="+i+"&t="+t,"share","width=600,height=600,resizable=1");break;case 2:window.open("//twitter.com/home?status="+t+" "+i,"share","width=600,height=600,resizable=1");break;case 3:window.open("//delicious.com/save?v=5&noui&jump=close&url="+i+"&title="+t,"share","width=600,height=600,resizable=1");break;case 4:window.open("//www.stumbleupon.com/submit?url="+i+"&title="+t,"share","width=600,height=600,resizable=1");break;case 5:window.open("//digg.com/submit?url="+i+"&title="+t+"&bodytext="+r,"share","width=600,height=600,resizable=1");break;case 6:window.open("//www.myspace.com/Modules/PostTo/Pages?t="+t+"&u="+i+"&c="+r,"share","width=600,height=600,resizable=1");break;case 7:window.external&&window.external.AddFavorite(location.href,document.title)}return!1}catch(u){postJavaError("share: "+u.message)}}function stopSwap(){clearTimeout(imageSwap)}function setOpacity(n,t){t=t==100?99.999:t;n.style.filter="alpha(opacity:"+t+")";n.style.KHTMLOpacity=t/100;n.style.MozOpacity=t/100;n.style.opacity=t/100}function focusTabDelayNew(n,t,i,r,u){clearTimeout(atgTabShowTimeout);clearTimeout(atgTabHideTimeout);clearTimeout(atgLoadDelay);atgTabShowTimeout=setTimeout(function(){focusTabNew(n,t,i,r,u)},300)}function focusTabNew(n,t,i,r,u){var f,e,o;lastCall!=i&&(lastCall=i,turnOffAllTabs(),f=document.getElementById(t+"tab").className,document.getElementById(t+"tab").className=f.substring(f.length,f.length-1)=="2"?t+"BGDark "+t+"LightBorder atgTabOn2":t+"BGDark "+t+"LightBorder atgTabOn",e=document.getElementById(t+"tab").getElementsByTagName("a"),e[0].className=t,o=new ajaxRequestObjectCache("/ajax/atgBar.aspx","v=18&root="+i+"&sname="+t+"&count="+r+"&list="+u,loadNav),o.doGetCallback())}function createPlaceHolder(n,t){loadNav('<div style="background:#FFF;width:1000px;height:150px;border:1pt solid #CCC;border-top:0px;font-weight:bold;"><div style="padding:10px;color:#FFF;font-weight:bold;font-size:12pt;text-decoration:none;text-align:left;margin-bottom:10px;border:0px;" class="'+t+'BGDark">'+n.toUpperCase()+'<\/div><img src="\\images\\loading.gif" style="vertical-align:middle;"> Loading ...<\/div>')}function focusTabDelay(n,t,i){clearTimeout(atgTabShowTimeout);clearTimeout(atgTabHideTimeout);clearTimeout(atgLoadDelay);atgTabShowTimeout=setTimeout(function(){focusTab(n,t,i)},300)}function focusTab(n,t,i){var r,u,f;lastCall!=i&&(lastCall=i,turnOffAllTabs(),r=document.getElementById(t+"tab").className,document.getElementById(t+"tab").className=r.substring(r.length,r.length-1)=="2"?t+"BGDark "+t+"LightBorder atgTabOn2":t+"BGDark "+t+"LightBorder atgTabOn",u=document.getElementById(t+"tab").getElementsByTagName("a"),u[0].className=t,f=new ajaxRequestObjectCache("/ajax/atgBar.aspx","v=18&root="+i,loadNav),f.doGetCallback())}function createPlaceHolder(n,t){loadNav('<div style="background:#FFF;width:1000px;height:150px;border:1pt solid #CCC;border-top:0px;font-weight:bold;"><div style="padding:10px;color:#FFF;font-weight:bold;font-size:12pt;text-decoration:none;text-align:left;margin-bottom:10px;border:0px;" class="'+t+'BGDark">'+n.toUpperCase()+'<\/div><img src="\\images\\loading.gif" style="vertical-align:middle;"> Loading ...<\/div>')}function loadNav(n){clearTimeout(atgLoadDelay);document.getElementById("atgNavLinks").innerHTML=n;document.getElementById("atgNavLinks").style.display="block";lastCall=""}function blurTabDelay(){atgTabHideTimeout=setTimeout("blurTab()",200)}function blurTab(){var n,t;clearTimeout(atgTabShowTimeout);clearTimeout(atgTabHideTimeout);clearTimeout(atgLoadDelay);lastCall="";document.getElementById("atgNavLinks").style.display="none";turnOffAllTabs();curATGTab!=""&&(n=document.getElementById(curATGTab+"tab").className,document.getElementById(curATGTab+"tab").className=n.substring(n.length,n.length-1)=="2"?curATGTab+"BGDark "+curATGTab+"LightBorder atgTabOn2":curATGTab+"BGDark "+curATGTab+"LightBorder atgTabOn",t=document.getElementById(curATGTab+"tab").getElementsByTagName("a"),t[0].className=curATGTab)}function turnOffAllTabs(){var u=document.getElementById("tabBar"),n=u.getElementsByTagName("div"),r,t;for(i=0;i<n.length-1;i++)r=n[i].getElementsByTagName("a"),n[i].id.substring(n[i].id.length,n[i].id.length-3)=="tab"&&(t=n[i].className,n[i].className=t.substring(t.length,t.length-1)=="2"?"atgTabOff2":"atgTabOff",r[0]&&(r[0].className=""))}function turnOnTab(n){resetTabs();changeInfoText(n);var t="img"+n;document.getElementById(n).style.backgroundColor="#fff";document.getElementById(n).style.backgroundImage="none";document.getElementById(t).src="//images.atgstores.com/images/layout/tabfeedbackarrowon.png";document.getElementById(n).style.borderBottom="1px solid #fff"}function changeInfoText(n){var i=clearOutFeedback(-1),t;if(i!=1)switch(n){case"content":t="Thank you for letting us know about issues you have seen with our content. Please note that we are unable to respond directly to every comment.";document.getElementById("txtFeedBack").value=t;break;case"bug":t="We are sorry you encountered an issue with our website. Please provide as much detail as possible so we can solve this issue as soon as possible.";document.getElementById("txtFeedBack").value=t;break;case"other":t="Thank you for your comments. Please note we are unable to respond directly to every comment.";document.getElementById("txtFeedBack").value=t;break;default:t="We appreciate your suggestions. Please note that we are unable to respond directly to every suggestion.";document.getElementById("txtFeedBack").value=t}}function resetTabs(){try{document.getElementById("suggestion").style.background="none";document.getElementById("imgsuggestion").src="//images.atgstores.com/images/layout/tabfeedbackarrowoff.png";document.getElementById("suggestion").style.backgroundImage="url('//images.atgstores.com/images/layout/tabfeedbackbackground.png')";document.getElementById("suggestion").style.borderBottom="none";document.getElementById("content").style.background="none";document.getElementById("imgcontent").src="//images.atgstores.com/images/layout/tabfeedbackarrowoff.png";document.getElementById("content").style.backgroundImage="url('//images.atgstores.com/images/layout/tabfeedbackbackground.png')";document.getElementById("content").style.borderBottom="none";document.getElementById("bug").style.background="none";document.getElementById("imgbug").src="//images.atgstores.com/images/layout/tabfeedbackarrowoff.png";document.getElementById("bug").style.backgroundImage="url('//images.atgstores.com/images/layout/tabfeedbackbackground.png')";document.getElementById("bug").style.borderBottom="none";document.getElementById("other").style.background="none";document.getElementById("imgother").src="//images.atgstores.com/images/layout/tabfeedbackarrowoff.png";document.getElementById("other").style.backgroundImage="url('//images.atgstores.com/images/layout/tabfeedbackbackground.png')";document.getElementById("other").style.borderBottom="none"}catch(n){postJavaError("resetTabs: "+n.message)}}function clearOutFeedback(){if(document.getElementById("txtFeedBack").value=="We appreciate your suggestions. Please note that we are unable to respond directly to every suggestion.")document.getElementById("txtFeedBack").value="";else if(document.getElementById("txtFeedBack").value=="Thank you for letting us know about issues you have seen with our content. Please note that we are unable to respond directly to every comment.")document.getElementById("txtFeedBack").value="";else if(document.getElementById("txtFeedBack").value=="We are sorry you encountered an issue with our website. Please provide as much detail as possible so we can solve this issue as soon as possible.")document.getElementById("txtFeedBack").value="";else if(document.getElementById("txtFeedBack").value=="Thank you for your comments. Please note we are unable to respond directly to every comment.")document.getElementById("txtFeedBack").value="";else return 1}function displayWelcomeback(){var t,n,r,i;readQuery("af")=="48"?(document.getElementById("divTopBannerBg").innerHTML='<a href="/support/policies.aspx" style="height:38px;margin-bottom:10px;"><img src="//images.atgstores.com/images/layout/topbar_email_freeship_1020x38_global.png" /><\/a>',document.getElementById("divEmailForm").style.left="462px",document.getElementById("divWelcome").style.backgroundImage="url('//images.atgstores.com/images/layout/welcome_back_lowes.jpg')",document.getElementById("divWelcome").style.display="block"):readQuery("af")=="20"?(document.getElementById("divTopBannerBg").innerHTML='<a href="/support/policies.aspx" style="height:38px;margin-bottom:10px;"><img src="//images.atgstores.com/images/layout/topbar_email_freeship_1020x38_global.png" /><\/a>',document.getElementById("divEmailForm").style.left="462px",document.getElementById("divWelcome").style.backgroundImage="url('//images.atgstores.com/images/layout/welcome_back_lowes2.jpg')",document.getElementById("divWelcome").style.display="block"):readCookie("custInfo")!=null&&(t=document.getElementById("divWelcome"),t!=null&&(n=readCookie("custInfo").split("="),n!=null&&(r=n[0],i=n[1],document.getElementById("divWelcome").style.display="block",document.getElementById("divWelcome").style.backgroundImage="url(//images.atgstores.com/images/layout/welcome.png)",t.innerHTML='<div class="fntlb" style="padding-top:2px;height:33px;text-align:left;margin-left:60px;"><div style="text-align:left;">Welcome back '+i+'<\/div><div style="border:solid 0px green; margin-top:-2px;padding-bottom:2px;"><a href="/account/" style="font-size:8pt;color:#666;text-decoration:none;">'+i+'\'s Account<\/a> | <a href="/account/logout.aspx" style="font-size:8pt;color:#666;text-decoration:none;">Logout<\/a><\/div><\/div>',document.getElementById("divTopBannerBg").innerHTML='<a href="/support/policies.aspx" style="height:38px;margin-bottom:10px;"><img src="//images.atgstores.com/images/layout/topbar_freeship_1020x38_global.png" /><\/a>')))}function openPopBoxPunchOut(n,t,i,r,u){var p,f,v,e,s,w,b,h,c,k,d,g,y,l,o,a;try{p=!1;(navigator.userAgent.toLowerCase().match(/ipod/)||navigator.userAgent.toLowerCase().match(/ipad/)||navigator.userAgent.toLowerCase().match(/iphone/))&&(p=!0);o=document.getElementsByTagName("body")[0];r===undefined?(f=document.getElementById("popBox"),v=""):(f=document.getElementById(r),v=r);e=null;f?(f.parentNode.removeChild(f),o.appendChild(f),e=document.getElementById("popBoxInner"),e===null&&(e=document.createElement("div"),e.id="popBoxInner",e.setAttribute("style","overflow:auto ; -webkit-overflow-scrolling: touch;"))):(s=document.createElement("div"),s.id="popBox",o.appendChild(s),f=document.getElementById("popBox"),e=document.createElement("div"),e.id="popBoxInner",s.appendChild(e));i&&i!=""&&(e.innerHTML=i);u!="storeLoc"&&u!="punchOut"?(f.className="popBox popBoxPos",f.style.width=n+5+"px",f.style.height=t+5+"px"):u=="punchOut"?(f.className="popBoxSL popBoxPos",f.style.width=n+5+"px",f.style.height=t+5+"px"):(f.className="popBoxSL popBoxSLPos",f.style.width=n+5+"px",f.style.height=t+5+"px");w=window.innerWidth;b=window.innerHeight;u!="catVideo"&&u!="storeLoc"?(h=w-60,c=b-100,n>h?(e.setAttribute("style","overflow-x:auto ; -webkit-overflow-scrolling: touch;"),f.style.width=h+"px",e.style.width=h-10+"px"):e.style.width=n-10+"px",t>c?(e.setAttribute("style","overflow-y:auto ; -webkit-overflow-scrolling: touch;"),f.style.height=c+"px",e.style.height=c-10+"px"):e.style.height=t-10+"px"):u=="storeLoc"||u=="punchOut"?(e.style.width=n+4+"px",e.style.height=t+3+"px"):(e.style.width=n+22+"px",e.style.height=t+13+"px");f.style.display="block";scrolledY=document.documentElement&&document.documentElement.scrollTop||document.body.scrollTop;scrolledX=document.documentElement&&document.documentElement.scrollLeft||document.body.scrollLeft;g=scrolledX+(k-n)/2;y=scrolledY+(d-t)/2;y<0&&(y=20);u!="storeLoc"&&(l=document.getElementById("popBoxLayer"),l||(o=document.getElementsByTagName("body")[0],a=document.createElement("div"),a.className="popBoxLayer",a.id="popBoxLayer",o.appendChild(a),l=document.getElementById("popBoxLayer")),l.style.display="block")}catch(nt){postJavaError("openPopBox: "+nt.message)}}function openPopBox(n,t,i,r,u){var w,e,h,f,l,b,k,a,v,d,s,g,nt,tt,p,c,o,y;try{w=!1;(navigator.userAgent.toLowerCase().match(/ipod/)||navigator.userAgent.toLowerCase().match(/ipad/)||navigator.userAgent.toLowerCase().match(/iphone/))&&(w=!0);o=document.getElementsByTagName("body")[0];r===undefined?(e=document.getElementById("popBox"),h=""):(e=document.getElementById(r),h=r);f=null;e?(e.parentNode.removeChild(e),o.appendChild(e),f=document.getElementById("popBoxInner"),f===null&&(f=document.createElement("div"),f.id="popBoxInner",f.setAttribute("style","overflow:auto ; -webkit-overflow-scrolling: touch;"))):(l=document.createElement("div"),l.id="popBox",o.appendChild(l),e=document.getElementById("popBox"),f=document.createElement("div"),f.id="popBoxInner",l.appendChild(f));i&&i!=""&&(f.innerHTML=i);e.className="popBox popBoxPos";e.style.width=n+35+"px";e.style.height=t+30+"px";b=window.innerWidth;k=window.innerHeight;u!="catVideo"?(a=b-60,v=k-100,n>a?(f.setAttribute("style","overflow-x:auto ; -webkit-overflow-scrolling: touch;"),e.style.width=a+"px",f.style.width=a-10+"px"):f.style.width=n-10+"px",t>v?(f.setAttribute("style","overflow-y:auto ; -webkit-overflow-scrolling: touch;"),e.style.height=v+"px",f.style.height=v-10+"px"):f.style.height=t-10+"px"):(f.style.width=n+22+"px",f.style.height=t+13+"px");e.style.display="block";d=document.getElementById("imgPopBoxClose"+h);d||(s=document.createElement("img"),s.src="//images.atgstores.com/images/layout/closebk.png",s.className="popBoxClose",s.onclick=function(){closePopBox(r)},s.id="imgPopBoxClose"+h,e.appendChild(s));scrolledY=document.documentElement&&document.documentElement.scrollTop||document.body.scrollTop;scrolledX=document.documentElement&&document.documentElement.scrollLeft||document.body.scrollLeft;tt=scrolledX+(g-n)/2;p=scrolledY+(nt-t)/2;p<0&&(p=20);c=document.getElementById("popBoxLayer");c||(o=document.getElementsByTagName("body")[0],y=document.createElement("div"),y.className="popBoxLayer",y.id="popBoxLayer",o.appendChild(y),c=document.getElementById("popBoxLayer"),c.onclick=function(){closePopBox(r)});c.style.display="block"}catch(it){postJavaError("openPopBox: "+it.message)}}function closePopBoxPunch(n,t,i,r){try{if(n===undefined||n==null?document.getElementById("popBox"):document.getElementById(n)&&(document.getElementById(n).style.display="none"),document.getElementById("popBoxLayer")&&(document.getElementById("popBoxLayer").style.display="none"),document.getElementById("popBox")){var u=document.getElementById("popBox"),f=u.parentNode;f.removeChild(u)}t!=undefined&&i!=1?(openPopBoxPunchOut(401,585,"<iframe width='408' height='591' frameborder='0' scrolling='no' src='/ajax/punchOutStoreLocatorLFP.aspx"+t+"&initialLoad=1'><\/iframe>",undefined,"punchOut"),setTcpnAndNam()):i!="closePO"&&r.toString().indexOf("store-locator")==-1&&window.location.reload()}catch(e){postJavaError(e.message)}}function closePopBox(n,t){try{if(n===undefined||n==null?document.getElementById("popBox")&&(document.getElementById("popBox").style.display="none"):document.getElementById(n)&&(document.getElementById(n).style.display="none"),document.getElementById("popBoxLayer")&&(document.getElementById("popBoxLayer").style.display="none"),window.parent.document.getElementById("popBoxInner")&&window.parent.document.getElementById("popBoxInner").innerHTML!=""&&(window.parent.document.getElementById("popBoxInner").innerHTML=""),window.parent.document.getElementById("popBox")){var i=document.getElementById("popBox"),r=i.parentNode;r.removeChild(i)}t==1?window.parent.document.getElementById("curArrOptSku")&&openLowesStoresByQty():t==2&&window.parent.document.getElementById("curArrOptSku")&&notifyWhenInStockQV()}catch(u){postJavaError(u.message)}}function openRecommendations(n){var t,i,r,u;try{n==undefined&&(n="");t=unescape(readCookie("recentView"));t!=""&&t!=null&&(i="",typeof intTypeId!="undefined"?i+="&typeid="+intTypeId.toString():typeof strTypeId!="undefined"&&(i+="&typeid="+strTypeId.toString()),r=[],r=t.split("~"),r.length>1&&(u=window.location.protocol+"//"+window.location.hostname.replace(/lowes.ca|lowesforpros.com/i,"atgstores.com")+"/noAkamaiJs/recommendations_n"+readCookie("NetSessionId")+"_s24_l"+n+"_r"+Math.floor(Math.random()*11005600)+".js?site="+strShortName+i,loadJS(u)))}catch(f){postJavaError("OpenRecommend: "+f.message)}}function writeRecommendations(n){n=unescape(n);n!=""&&(n.indexOf("<div")>-1&&n.indexOf("<img")>-1&&document.getElementById("recommendationContainer6")?document.getElementById("recommendationContainer6").innerHTML=n:populateDivs(n))}function populateDivs(n){for(var s=n.toString().split("~"),r="<h2>Recommended For You<\/h2><div>",u="<div style='margin-top:22px; float:left; width:435px; height:165px;'>",i,t,f=0;f<s.length;f++)if(s[f]!==""){i=s[f].toString().split("|");t=i[0];t=typeof t==null||t==""?"//images.atgstores.com/images/Product/NoImage.png":"//images.atgstores.com/img/t/"+t;var e=i[1],l=i[2],h=i[3],o=i[4],c=strShortName!="lowesca"?"<div class='pr'>"+l+"<\/div>":"";u+="<div class='l' title='"+e+"' style='height:150px;' ><div class='g2 mgr16' style='text-align:left;'><div class='recomBtmDivItem trackRecom'><a href='"+o+"'><img style='width:75px; height:75px;' src='"+t+"'><\/a><\/div><a href='"+o+"' class='trackRecom'><div style='overflow:hidden;text-overflow: ellipsis;height:2.4em;line-height:1.2em;'>"+e+"<\/div><\/a>"+c+"<\/div>";r+="<div class='l mgr16' title='"+e+"'><div class='txtl' style='width: 120px;'><div class='recomBtmDivItem'><a href='"+o+"'><img style='width:75px; height:75px;' src='"+t+"'><\/a><\/div><a href='"+o+"'><div style='overflow-x:hidden; white-space:nowrap;text-overflow: ellipsis;'>"+e+"<\/div><\/a>"+c+"<\/div>";parseInt(h)>0&&(r+="<div class='pr l rvwStar"+h+"' style='padding=left:90px;'><\/div>",u+="<div class='pr l rvwStar"+h+"' style='padding=left:90px;'><\/div>");r+="<\/div>";u+="<\/div>"}r+="<\/div>";u+="<\/div>";document.getElementById("recommendationContainer6")&&(document.getElementById("recommendationContainer6").innerHTML=r);document.getElementById("RecommendedContent")&&(document.getElementById("RecommendedContent").innerHTML=u,document.getElementById("aRecSeeMore")&&$("#aRecSeeMore").removeClass("displayn"))}function openLastViewed(){}function writeLastViewed(n){document.getElementById("lastViewedCont")&&(document.getElementById("lastViewedCont").innerHTML=n)}function showInternalTabs(n){var t=new ajaxRequestObject("/ajax/showInternalTabs.aspx","isOx="+n+"&v="+Math.floor(Math.random()*11005600),showTabs);t.doGetCallback()}function showTabs(n){document.getElementById("internalTabs").innerHTML=n;document.getElementById("internalTabs").style.zIndex=1e3}function openReportABug(n){n==undefined&&(n=!0);openPopBox(590,480,"<iframe src='/ajax/layoutFix.aspx?v=2&url="+escape(window.location.href)+"&email="+readCookie("rep_email")+"&id="+readCookie("lui%5Frep%5Fid")+"&isOX="+n+"' width='600px' height='465px' frameBorder='0'><\/iframe>")}function openShareIdea(n){n==undefined&&(n=!0);openPopBox(590,325,"<iframe src='/ajax/shareIdea.aspx?url="+escape(window.location.href)+"&email="+readCookie("rep_email")+"&id="+readCookie("lui%5Frep%5Fid")+"&isOX="+n+"' width='600px' height='320px' frameBorder='0'><\/iframe>")}function openForeSee(){try{typeof strShortName=="undefined"&&(window.location.href.toString().indexOf("lowesforpros.com")>0?strShortName="lfp":window.location.href.toString().indexOf("lowes.ca")>0&&(strShortName="lowesca"));strShortName=="lfp"?FSR.popFeedback("pro"):strShortName=="lowesca"&&FSR.popFeedback("canada")}catch(n){console.log(n.message)}}function showLoadTime(n){var i=document.getElementsByTagName("body")[0],t=document.createElement("div");t.className="toolbox";t.id="divToolBox";t.innerHTML="<div style='background-color:#CCC;cursor:pointer;display:none;' onClick='expandLoad();'>"+n+" s<\/div>";i.appendChild(t);document.getElementById("loadTimeForWebVisitorLog")&&ajax("/ajax/getAvgTime.aspx?pageName="+pageName+"&pageTime="+document.getElementById("loadTimeForWebVisitorLog").innerHTML,showAvgTime)}function showAvgTime(n){document.getElementById("divToolBox").innerHTML+=n}function expandLoad(){openPopBox(800,600,"<h2>Loading<\/h2>");var n=Math.floor(Math.random()*1e10);ajax("/ajax/showLoadTime.aspx?v="+n,expandLoadDisplay)}function expandLoadDisplay(n){openPopBox(800,600,n)}function gridButton(){document.getElementById("divToolBox")?document.getElementById("divToolBox").innerHTML="<div class='gridButtonNew' style='height:31px;width:14px' onClick='showGrid()' id='grid'><\/div>"+document.getElementById("divToolBox").innerHTML:setTimeOut("gridButton",100)}function showGrid(){var t;if(document.getElementById("divGrid"))t=document.getElementById("divGrid"),t.parentNode.removeChild(t);else{var n=document.createElement("div"),r=document.getElementById("divContainer"),i=(document.body.clientWidth-1008)/2;n.style.width="1008px";n.style.height="4000px";n.style.background="url('/images/layout/grid.png')";n.style.position="absolute";n.style.zIndex="100000";n.style.top="0px";n.style.left=i+"px";n.setAttribute("id","divGrid");document.body.appendChild(n)}}function valButton(n){document.getElementById("divToolBox")?document.getElementById("divToolBox").innerHTML="<div class='valButtonNew' style='height:31px;width:14px' onClick='valUrl(\""+n+"\")' id='valButton'><\/div>"+document.getElementById("divToolBox").innerHTML:setTimeOut("gridButton",100)}function valUrl(n){window.location="//validator.w3.org/check?uri="+n+"&charset=(detect+automatically)&doctype=Inline&group=0"}function swapImageHomePage(){return null}function setImageHomePage(n,t,i,r){var u,f,e,o;try{document.getElementById&&(u=document.getElementById(n),f=document.getElementById(t),i==0?(setOpacity(u,0),f.style.zIndex=-1,document.getElementById("mapHolder")!=null&&document.getElementById("homePageImageLink").removeChild(document.getElementById("mapHolder")),arrLink[r]!=null&&arrLink[r]!=""?(document.getElementById("homePageImageLink").setAttribute("href","/"+arrLink[r]),document.getElementById("homePageImageLink").setAttribute("onClick","track('adBlockClick', '"+jsSiteShortName+"', '0_"+arrAdId[r]+"'); return true;"),u.setAttribute("alt",arrAltText[r]),arrOpenNewWindow[r]=="1"?document.getElementById("homePageImageLink").setAttribute("target","_blank"):document.getElementById("homePageImageLink").setAttribute("target","_self"),u.useMap=""):(u.setAttribute("alt",arrAltText[r]),document.getElementById("homePageImageLink").setAttribute("onClick",""),e=document.createElement("div"),e.setAttribute("id","mapHolder"),e.innerHTML=arrMapHTML[r],document.getElementById("homePageImageLink").appendChild(e),o=arrMapHTML[r].replace(/.*id=[""']?([A-Za-z0-9]*)[""' >]{1}.*/,"$1"),u.useMap="#"+o),i+=25,window.setTimeout("setImageHomePage('"+n+"','"+t+"',"+i+","+r+")",30)):i<100?(setOpacity(u,i),i+=25,window.setTimeout("setImageHomePage('"+n+"','"+t+"',"+i+","+r+")",30)):(f.src=u.src,f.useMap=u.useMap,f.style.zIndex=0))}catch(s){postJavaError("setimghomepage: "+s.message)}}function setOpacity(n,t){t=t==100?99.999:t;n.style.filter="alpha(opacity:"+t+")";n.style.KHTMLOpacity=t/100;n.style.MozOpacity=t/100;n.style.opacity=t/100}function switchButtons(n){var e,o,r,s,h,u,f,t,i;if(n!=""&&n!=null&&document.getElementById("btn"+n)!=null){for(e="notfound",o=document.getElementById("btn"+n).className.split(" "),s=document.getElementById("btnSlideshow"),h=s.getElementsByTagName("div"),f=0;f<o.length;f++)o[f]==strClassName&&(e="found");for(e!="found"&&(strClassName="atgsBG",document.getElementById("btn"+n).className=document.getElementById("btn"+n).className+" atgsBG",document.getElementById("btn"+n).style.color="#fff"),t=1;t<=h.length;t++)if(u="",t!=n)for(r=document.getElementById("btn"+t).className.split(" "),i=0;i<r.length;i++)r[i]!=strClassName&&(u=u+" "+r[i]),document.getElementById("btn"+t).className=u,document.getElementById("btn"+t).style.color="#663366"}}function newTrim(n){return n!==undefined&&n!=""?n.replace(/^\s\s*/,"").replace(/\s\s*$/,""):""}function getABTestCookieInfo(){return sendCookiesToCart()}function sendCookiesToCart(){var n;return n=readCookie("abtest")!=null?"&abtest="+readCookie("abtest"):"",n+=readCookie("storeInfo")!=null?"&storeInfo="+escape(readCookie("storeInfo")):"",readCookie("semphone")!=null&&(n+="&ph="+readCookie("semphone")),readCookie("NetSessionId")!=null&&(n+="&NetSessionId="+readCookie("NetSessionId")),n.length<=1e3?n:n.substring(0,1e3)}function genAddToCart(n,t,i){window.location="/checkout/addToCart.aspx?sku="+n+"&qty="+t+"&shipOpt="+i+getABTestCookieInfo()+"&rand="+guid()}function callCartHandler(n){return $.ajax({url:"/ajax/cartCookieDisplay.ashx",cache:!1,contentType:"application/json; charset=utf-8",data:{cookieName:n},responseType:"json",success:OnFinish}),showSpinnerGif(),!1}function OnFinish(n){n=="Empty"?($("#divCartCookie").removeClass("displayn"),$("#divCartCookie").html(n),getCartButtonNew(),setCartTimeOut()):($("#divCartCookie").removeClass("displayn"),$("#divCartCookie").html(n),getCartButtonNew(),setCartTimeOut(),strShortName!="atgs"&&$("#cartDetails").length&&$("#cartDetails").offset({top:80}))}function hideDivCart(){$("#divCartCookie").addClass("displayn")}function setCartTimeOut(){cartCookieDisplay=setTimeout("hideDivCart()",5e3)}function openCartWindow(){window.open("/checkout/cart.aspx","_self")}function showSpinnerGif(){$("#divCartCookie").html('<div id="cartDetails" class="l cartmenu " style="background-color:white; width:236px; padding: 12px 12px;"><img style=\'margin-left:106px;\' src=\'//images.atgstores.com/images/layout/colorspinner.gif\'/><\/div>');strShortName!="atgs"&&document.getElementById("cartBLowes").innerHTML=="99+"&&(document.getElementById("cartDetails").style.top="40px",document.getElementById("cartDetails").style.right="30px");showCookieCartDiv()}function showCookieCartDiv(){$("#divCartCookie").removeClass("displayn");clearTimeout(cartCookieDisplay)}function genAddToCartWlinkLoc(n,t,i,r){window.location=strSecure+"/checkout/addToCart.aspx?sku="+n+r+"&qty="+t+"&shipOpt="+i+getABTestCookieInfo()}function canonicalLink(n,t,i,r,u,f,e,o,s,h,c,l,a,v,y){var b="",k="",d="",g="",nt="",tt="",it="",rt="",w="",ut="",p="?";try{if((s==0||s==undefined)&&(o==0||o==undefined))return t!=undefined&&t!="0"&&t!=""&&(b="-"+URLFormat(n),t.toString().indexOf(",")==-1?k="_"+t:p+="tid="+t.replace(/[^0-9,]/gi,"")+"&"),f!=undefined&&f!="0"&&f!=""&&(d="-"+URLFormat(u),f.toString().indexOf(",")==-1?g="_m"+f:p+="mfr="+f.replace(/[^0-9,]/gi,"")+"&"),r!=undefined&&r!="0"&&r!=""&&(nt="-"+URLFormat(i),r.toString().indexOf(",")==-1?tt="_s"+r:p+="st="+r.replace(/[^0-9,]/gi,"")+"&"),l!=undefined&&l!="0"&&l!=""&&(it="-"+URLFormat(h),p+=l),y!=undefined&&y!="0"&&y!=""&&(rt="-"+URLFormat(a),p+=y),w=d+it+rt+nt+b,w=w.substring(1,w.length),ut=k+g+tt+"",p=p.length==1?"":p.substring(0,p.length-1),"/"+w+ut+".html"+p;if(s!=undefined&&s>0)return"/"+URLFormat(n)+"/"+URLFormat(e)+"_"+s+".html";if(o!=undefined&&o>0)return"/"+URLFormat(n)+"/"+URLFormat(e)+"_g"+o+".html"}catch(ft){postJavaError("canonicalLink: "+ft.message)}return"/products/default.aspx"}function URLFormat(n){return n!=""?n.replace(/\s/gi,"-").replace(/[^a-zA-Z0-9-]/gi,"").replace(/-{2,}/gi,"-").replace(/-*$/gi,"").toLowerCase():"general"}function saveDisplayPHNumber(){if(document.getElementById("spnPhone")){var n=readQuery("ph",!0);n!==undefined&&n!=null&&n.length>0?SetCookie("semphone",n,1):n=readCookie("semphone");n!==undefined&&n!=null&&n.length>0&&(document.getElementById("spnPhone").innerHTML=formatPhoneHeader(n))}}function imgErr(n){i=new Image;i.src="/images/loadImageError.aspx?src="+n+"&page="+window.location}function showActMenuDelay(){clearTimeout(atgAcctTO);clearTimeout(atgAcctHideTO);atgAcctTO=setTimeout(function(){showActMenu()},250)}function showActMenuDelayNew(){clearTimeout(atgAcctTO);clearTimeout(atgAcctHideTO);atgAcctTO=setTimeout(function(){showActMenuNew()},250)}function showActMenuDelayLowes(){clearTimeout(atgAcctTO);clearTimeout(atgAcctHideTO);atgAcctTO=setTimeout(function(){showActMenuLowes()},250)}function showActMenuLowes(){document.getElementById("divActMLowes").style.display="block";$("#accountSlowes").addClass("accountDisplay")}function showActMenuNew(){document.getElementById("divActMenu").style.display="block";$("#accountSpan").addClass("accountDisplay")}function showActMenu(){document.getElementById("divActMenu").style.display="block"}function hideActMenuDelayNew(){atgAcctHideTO=setTimeout(function(){hideActMenuNew()},250)}function hideActMenuDelayLowes(){atgAcctHideTO=setTimeout(function(){hideActMenuLowes()},250)}function hideActMenuLowes(){clearTimeout(atgAcctTO);clearTimeout(atgAcctHideTO);document.getElementById("divActMLowes").style.display="none";$("#accountSlowes").removeClass("accountDisplay")}function hideActMenuNew(){clearTimeout(atgAcctTO);clearTimeout(atgAcctHideTO);document.getElementById("divActMenu").style.display="none";$("#accountSpan").removeClass("accountDisplay")}function hideActMenuDelay(){atgAcctHideTO=setTimeout(function(){hideActMenu()},250)}function hideActMenu(){clearTimeout(atgAcctTO);clearTimeout(atgAcctHideTO);document.getElementById("divActMenu").style.display="none"}function isValidPostalCode(n){return n.match(/^\s*[a-ceghj-npr-tv-z]\d[a-ceghj-npr-tv-z]\s*\d[a-ceghj-npr-tv-z]\d\s*$/gi)!=null}function isValidZipCode(n){return n.match(/^\s*\d{5}(?:[-\s]\d{4})?\s*$/gi)!=null}function setStoreFromPostalCode(n){var n=n.replace(/^\s+|\s+$/g,""),u;if(strShortName=="lowesca")if(isValidPostalCode(n)){var t="/Navigation/ajax/StoreInformation.aspx",i="pc="+n,r=new ajaxRequestObject(t,i,setStoreLocatorCookie);r.doGetCallback()}else return openPopBox(365,75,"<div class='err' style='width:300px; margin:0px;'>The postal code you entered is not valid. Please try again.<\/div>"),document.getElementById("popBox").style.top="30px",!1;else if(strShortName=="lfp")if(u=new RegExp("^[0-9]+$"),n!=undefined&&n.length==5&&n.match(u)){var t="/Navigation/ajax/StoreInformation.aspx",i="pc="+n+returnStringForStoreLocator,r=new ajaxRequestObject(t,i,setStoreLocatorCookieLFP);r.doGetCallback()}else openPopBox(365,75,"<div class='err' style='width:300px; margin:0px;'>The zip code you entered is not valid. Please try again.<br>Ex: 94093 <\/div>"),document.getElementById("popBox").style.top="30px"}function setStoreFromStoreId(n){var t=getStoreCookie("postalcode",undefined,!1);t==undefined&&(t="");var i="pc="+t+"&storeid="+n,r=new ajaxRequestObject("/Navigation/ajax/StoreInformation.aspx",i,setStoreLocatorCookie);r.doGetCallback()}function setStoreFromStoreIdLFP(n){var t=getStoreCookie("postalcode",undefined,!1);t==undefined&&(t="");var i="pc="+t+"&storeid="+n,r=new ajaxRequestObject("/Navigation/ajax/StoreInformation.aspx",i,setStoreLocatorCookieLFP);r.doGetCallback()}function setStoreLocatorCookie(n){if(n.length>2)try{SetCookie("storeinfo",n,30);setTimeout("",1e3);var t=n.split("|");SetCookie("storeIDCookie",t[1],30);t[6]!=""?window.location.href=decodeURIComponent(t[6]):(lowesStoreLocatior(),closePopBox(),(typeof pageType2!=undefined&&pageType2&&(pageType2=="product-list"||pageType2=="productdetail"||pageType2=="search-results")||window.location.href.indexOf("/checkout/cart.aspx")>-1||typeof pageName!=typeof undefined&&pageName=="/products/default.aspx")&&location.reload(!1))}catch(i){postJavaError(i.message)}else openPopBox(150,42,"<span class='crd'>There is no store near your area<\/span>")}function setStoreLocatorCookieLFP(n){var i,r,t;if(n.length>2)try{i=n.split("~");r=i[0];SetCookie("storeinfo",r,30);setTimeout("",1e3);t=n.split("|");t[6]!=""?window.location.href=decodeURIComponent(t[6]):(lowesStoreLocatior(),closePopBox(),location.reload(!1))}catch(u){postJavaError(u.message)}else openPopBox(150,42,"<span class='crd'>There is no store near your area<\/span>")}function getStoreLookUpRedirectURL(){var t=window.location.pathname,n=window.location.href,i,r;return n.indexOf("/search/default.aspx")!=-1||n.indexOf("/search/")!=-1&&n.indexOf("?tid=")!=-1?(i=getQueryStringNameValue("tid"),t=i!=undefined&&i.length>0?"/search/default.aspx?tid="+i:"/search/default.aspx"+window.location.search):n.indexOf("/products/view.aspx?")!=-1&&(r=n.split("?"),t=t+"?"+r[1]),t}function getQueryStringNameValue(n){var r=null,f=window.location.href,u=f.split("?"),i,t;if(u.length>1)for(i=u[1].split("&"),t=0;t<i.length;t++)queryStringNameValueArray=i[t].split("="),n==queryStringNameValueArray[0]&&(r=queryStringNameValueArray[1]);return r}function getQueryStringAttrNameArr(){var n=[],f,u,i,t,r,e;try{if(f=window.location.href,u=f.split("?"),u.length>1){for(i=u[1].split("&"),t=0;t<i.length;t++)if(i[t].indexOf("atb")==0){for(queryStringAttrArray=i[t].substring(4).split("~"),r=1;r<queryStringAttrArray.length;r++)e=queryStringAttrArray[r].split("="),strAttrVal0=e[0],strAttrVal0.indexOf("price")<0&&n.push(queryStringNameValueArra[1].replace("-","_"));break}n.length==0&&n.push(getUrlAttrName)}else n.push(getUrlAttrName)}catch(o){postJavaError("getAttrNameErr: "+o.message)}return n}function getUrlAttrName(){for(var i=window.location.href,t=i.split("/"),n=t.length-1;n>=0;n--)if(t[n]!="")return t[n].replace("-","_")}function getStoreCookie(n,t,i,r,u,f){var o,h,c,e,s;try{if(customPopBox===undefined&&r!==undefined&&(customPopBox=r),t===undefined&&(t=""),o=unescape(readCookie("storeinfo")),i===undefined&&(i=!0),h=!0,(o=="null"||o==""||o.indexOf("XXXXXX")!=-1)&&(h=!1,o.indexOf("XXXXXX")!=-1&&(document.cookie="storeinfo=; expires=Thu, 01-Jan-70 00:00:01 GMT")),!h&&i){if(customPopBox===undefined){c='"'+n+"|"+t+'"';t==""&&(c=n);openPopBox(200,83,"<h2>Enter Postal Code<\/h2><input type='text' id='txbpostalcode'><div class='btnSml' onClick='getStoreInfoCookie()'>Submit<\/div>");return}customPopBox(n,t,f)}if(e=[],e.storename=0,e.storeid=1,e.patchid=2,e.postalcode=3,e.distance=4,e.shoplocalid=5,s=o.split("|")[e[n.toLowerCase()]],t.length==0){if(u!==undefined){u(s);return}return s}window.location.href=t.indexOf("?")!=-1?t+"&"+n+"="+s:t+"?"+n+"="+s}catch(l){postJavaError("getStoreCookie: "+l.message)}}function getStoreInfoCookie(n,t){var u="/Navigation/ajax/StoreInformation.aspx",f=document.getElementById("tbxpostalcode"),e=document.getElementById("txbpostalcode"),o="",r,i;o=typeof e!="undefined"?e.value:typeof f=="undefined"?storeInventory._postalCode:f.value;r="pc="+o+"&linkloc=cartpopup&strCall=0";t===undefined?i=new ajaxRequestObject(u,r,createStoreInfoCookie,n):(createSCI=function(n,t){createStoreInfoCookie(n,t)},i=new ajaxRequestObject(u,r,createSCI,n));i.doGetCallback()}function createStoreInfoCookie(n,t){if(n.length>2){var i=n.split("~");i.length>1?SetCookie("storeinfo",i[0],30):SetCookie("storeinfo",n,30);window.parent.location.href.indexOf("/cart")!=-1?(setTimeout("",2e3),self.close(),window.parent.location.href="cart.aspx"):t!=undefined&&getStoreCookie(t.split("|")[0],t.split("|")[1],undefined,undefined,undefined,"This postal code does not exist.");openLowesStoresByQty()}else $("#wrongPostalWarning").text("There is no store near you"),$("#wrongPostalWarning").show()}function displayStoreRelatedAds(){return null}function setCompareItem(n,t,i){n.checked?t==0?(i>0&&typeof i!="undefined"&&i!=null&&(i=-Math.abs(i)),isNaN(i)||setCompareCookie(!0,i)):setCompareCookie(!0,t):t==0?(i>0&&typeof i!="undefined"&&i!=null&&(i=-Math.abs(i)),isNaN(i)||setCompareCookie(!1,i)):setCompareCookie(!1,t)}function AddCompareItem(n,t,i,r){var u=readCookie("compareItems"),f,e="",o;n?(f=n,e="sku"):t?(f=t,e="group_id"):f="";o=f+":"+r+":"+e+"|";i=findCheckboxDiv(f);(u===null||u!==null&&(u===""||u.indexOf(f)<0))&&!CheckItemLimit(i)&&((u===null||u===undefined)&&(u=""),u=u+o,SetCookie("compareItems",u,.5))}function HandleCompareItem(n,t,i,r){var s="compareItems",u=readCookie(s),f,h="",e=$("#divCompare")[0],c,o;n?(f=n,h="sku"):t?(f=t,h="group_id"):f="";c=f+":"+r+":"+h+"|";i=findCheckboxDiv(f);u!==null&&(u===null||u!=="")||CheckItemLimit(i)?u.indexOf(f)>-1?(RemoveFromCompareCookie(f,GetCompareItemFromCookie(f,u),s),e&&(RemoveCompareImage(r),intTotalItemsLoaded--,UpdateCompareTitle(intTotalItemsLoaded),o=readCookie(s),(o===null||o!==null&&o==="")&&(e.style.display="none"),i&&(i.checked=!1),$("#spnCompareError")[0].innerHTML="")):CheckItemLimit(i)||(u=u+c,SetCookie("compareItems",u,.5),e&&(intTotalItemsLoaded++,UpdateCompareTitle(intTotalItemsLoaded),i&&(InsertCompareImage(r,n,t),i.checked=!0))):(e&&($("#divCompare")[0].style.display="",SetCompareDivScrolling(),InsertCompareImage(r,n,t),intTotalItemsLoaded++,UpdateCompareTitle(intTotalItemsLoaded)),SetCookie("compareItems",c,.5))}function CheckItemLimit(n){try{return intTotalItemsLoaded>14?($("#spnCompareError")[0].innerHTML="<br class='displayn displaybs' />Maximum item limit reached (15)",n&&(n.checked=!1),!0):!1}catch(t){return!1}}function UpdateCompareTitle(n){var t=$("#divCompareCount")[0];t!==undefined&&t!==null&&($("#divCompareCount")[0].innerHTML=n)}function SetCompareItemStatus(){var e=readCookie("compareItems"),n={},o=!1,s,t,r;if(e&&e!="")for(s=e.split("|"),i=0;i<s.length;i++)t=s[i].split(":"),t[0]!=""&&(n[t[0]]={},n[t[0]].checked=!0,n[t[0]].imagePath=t[1],o||(o=!0));if(o)for(r=$("#divResults").find("input[onclick*='HandleCompareItem']"),i=0;i<r.length;i++){var u=r[i].getAttributeNode("onclick").nodeValue,h=u.indexOf("HandleCompareItem"),c=u.substr(h).indexOf("(")+1,l=u.substr(h).indexOf(")"),f=u.substr(c,l-c).split(",");n[f[0]]!==undefined&&n[f[0]].checked?r[i].checked=!0:n[f[1]]!==undefined&&n[f[1]].checked&&(r[i].checked=!0)}}function ChangeCheckBoxes(n){if(n!==undefined){var t=$("#divResults").find("input[onclick*='HandleCompareItem']");for(i=0;i<t.length;i++)t[i].checked=n}}function ClearCompareItems(){var f,t,e;$("#divCompareItems")[0].innerHTML="";var r=readCookie("compareItems"),u=readCookie("NetSessionId"),n=readCookie("user%5fid"),o=$("#divCompare")[0];if(o&&(o.style.display="none"),n&&n!==""||(n="0"),DeleteCookie("compareItems"),$("#spnCompareError")[0].innerHTML="",ChangeCheckBoxes(!1),intTotalItemsLoaded=0,r&&r!==""&&u&&u!=="")for(f=r.split("|"),i=0;i<f.length;i++)t=f[i].split(":"),t&&t[0]&&(e=new ajaxRequestObject("/ajax/deleteCompare.aspx","&removeSku="+t[0]+"&cookieId="+u),n&&n!==""&&(e=new ajaxRequestObject("/ajax/deleteCompare.aspx","&removeSku="+t[0]+"&customer="+n)),e.doGetCallback())}function DeleteCookie(n){var r=window.location.host.split(".")[1],i=".atgstores.com",t;r==="lowes"?i=".lowes.ca":r==="lowesforpros"&&(i=".lowesforpros.com");t=new Date;t.setDate(t.getDate()-1);document.cookie=n+"=;expires="+t+";domain="+i+";path=/"}function findCheckboxDiv(n){var t=$("#divResults").find("input[onclick*='HandleCompareItem']");for(i=0;i<t.length;i++)if(t[i].getAttributeNode("onclick").nodeValue.indexOf(n)>-1)return t[i]}function InsertCompareImage(n,t,i){var o=document.getElementById("divCompareItems"),s,f,r,e,u;o&&(s=t&&t>0?"/products/view.aspx?sku="+t:"/products/view.aspx?family="+i,f=document.createElement("a"),f.href=s,f.position="relative",r=document.createElement("div"),r.setAttribute("class","l"),r.style.position="relative",r.style.left="0",r.style.top="0",e=document.createElement("a"),e.setAttribute("href","#"),e.setAttribute("onclick","HandleCompareItem("+t+","+i+",null,'"+n+"'); return false;"),e.innerHTML="<div class='spriteAtg redx' style='position: absolute; top: -6px; left: 32px;height:15px;z-index: 1;'\">",r.appendChild(e),u=document.createElement("img"),u.setAttribute("src","//images.atgstores.com/img/i/"+n),u.style.height="35px",u.style.width="35px",u.style.padding="2px",u.className="mgr8 brd",f.appendChild(u),r.appendChild(f),o.appendChild(r))}function RemoveCompareImage(n){var t=document.getElementById("divCompareItems");if(t&&t.children)for(i=0;i<t.children.length;i++)if(t.children[i].innerHTML.indexOf(n)>-1){t.removeChild(t.children[i]);break}}function LoadCompareItems(){var t=readCookie("compareItems"),r,n;if(t&&t!=""){for(r=t.split("|"),i=0;i<r.length;i++)$("#divCompare")[0].style.display="",n=r[i].split(":"),n[0]!=""&&n[2]&&(n[2]=="sku"?(InsertCompareImage(n[1],n[0]),intTotalItemsLoaded++):n[2]=="group_id"&&(InsertCompareImage(n[1],undefined,n[0]),intTotalItemsLoaded++));intTotalItemsLoaded>0&&UpdateCompareTitle(intTotalItemsLoaded)}}function GetCompareItemFromCookie(n,t){if(t){var r=t.split("|");for(i=0;i<r.length;i++)if(r[i].indexOf(n)>-1)return r[i]+"|"}return null}function RemoveFromCompareCookie(n,t,i){var e=readCookie("NetSessionId"),r=readCookie("user%5fid"),o=$("#divCompare")[0],u=readCookie(i),f;u=u.replace(t,"");SetCookie(i,u,30);f=new ajaxRequestObject("/ajax/deleteCompare.aspx","&removeSku="+n+"&cookieId="+e);r&&r!==""&&(f=new ajaxRequestObject("/ajax/deleteCompare.aspx","&removeSku="+n+"&customer="+r));f.doGetCallback()}function SetCompareDivScrolling(){var t=$(window),n=$("#divCompare"),i=n.offset().top;n[0]&&n[0].style.display!="none"&&t.scroll(function(){n.toggleClass("compareScrolling",t.scrollTop()>i);n.toggleClass("full",t.scrollTop()<i);n.toggleClass("maxg24",t.scrollTop()>i);n[0].style.backgroundColor=t.scrollTop()>i?"white":""})}function setCompareCookie(n,t){var i;n?readCookie("compareItems")==null?SetCookie("compareItems",t+"|",.5):(i=readCookie("compareItems"),i.indexOf(t+"|")==-1&&(i=i+t+"|"),SetCookie("compareItems",i,.5)):readCookie("compareItems")!=null&&(i=readCookie("compareItems"),i=i.replace(t+"|",""),SetCookie("compareItems",i,.5))}function getCompareItem(n,t,i){var r;n!=null&&(n==0?(i>0&&typeof i!="undefined"&&i!=null&&(i=-Math.abs(i)),isNaN(i)||setCompareCookie(!0,i)):setCompareCookie(!0,n));r=readCookie("compareItems");r=r!=null?r.replace(new RegExp("%2C","g"),","):"";window.location="/products/compare.aspx?sku="+r}function buildOrganicCache(){bolBuiltOrganicCache||(bolBuiltOrganicCache=!0,ajax("/ajax/organicSearchCacheBuild.aspx"))}function getRealTimeLowesItemQuantity(n,t,i,r,u){var f=new ajaxRequestObject("/ajax/lowesItemQtyReaderAjax.aspx","sku=138402&lowesItemNum="+t+"&mfrProdId="+i+"&storeNum="+r+"&qty="+u,testDisplay);f.doGetCallback()}function testDisplay(n){openPopBox(800,800,n)}function validateEmail(n,t){var i=new RegExp(".+@.+\\..+");n.value.match(i)?document.getElementById(t).style.display="none":(document.getElementById(t).style.display="block",document.getElementById("thankYouMessage").style.display="none")}function cleanForm(){var n=document.getElementsByTagName("input"),t=n.length;for(i=0;i<t;i++)n[i].value!=""&&n[i].type.toLowerCase()=="text"&&(n[i].value=n[i].value.replace(/&#/gi,""))}function setUserLanguage(n){n!==undefined&&n!=""&&(SetCookie("userlanguage",n.toLowerCase(),30),setTimeout("",200))}function validateformfield(n,t){var e,r,i,u,f,h,o,s,c;for(strValMessage="",n==undefined&&(n="frmMain"),r=document.getElementById(n).getElementsByTagName("*"),i=0;i<r.length;i++)(r[i].tagName=="INPUT"||r[i].tagName=="SELECT"||r[i].tagName=="TEXTAREA"||r[i].tagName=="TABLE")&&(u=r[i],u!=null&&(u.className!=null&&(u.className=u.className.replace("frmError","")),document.getElementById(u.id+"ErrMsg")&&(document.getElementById(u.id+"ErrMsg").style.display="none"),f=r[i].tagName+u.id+"msg",r[i].tagName=="INPUT"&&(r[i].type=="text"||r[i].type=="password"||r[i].type=="email")?(e+=u.value.length==0||u.value==u.alt?validateReq(u.id,f):validateTextbox(u,f),$(r[i]).attr("data-validator")!==undefined&&t!==undefined&&(e+=validateCustom(r[i],f,t))):r[i].tagName=="TABLE"?validateCheckbox(u.id,f):r[i].tagName=="SELECT"?(h=u.options[u.selectedIndex].value,e+=h.length==0||h=="0"?validateReq(u.id,f):displayValidationMsg(!0,u.id,f,""),$(r[i]).attr("data-validator")!==undefined&&t!==undefined&&(e+=validateCustom(r[i],f,t))):r[i].tagName=="TEXTAREA"&&(o=document.getElementById(r[i].id),o!=null&&(e+=o.value.length==0?validateReq(o.id,f):validateTextbox(o,f)))));return document.getElementById("divValidationErrorBox")&&(s=document.getElementById("divValidationErrorBox"),strValMessage!=""?(s.innerHTML=strValMessage,s.className="err"):(s.innerHTML="",s.className="")),c=typeof e,c=="string"?e.indexOf("FALSE")>0?!1:!0:!0}function validateCheckbox(n,t){var r=document.getElementById(n).getElementsByTagName("input"),u=0,i,e,f;if($("#"+n+"").hasClass("chkreq")){for(i=0;i<r.length;i++)r[i].checked&&(u+=1);return u==0?(e=document.getElementById(n),$("#"+n+"").addClass("redborder"),f=document.getElementById(t),f==null&&$("#"+n+"").after("<div id='"+t+"' class='l'><img src='//images.atgstores.com/images/layout/errorx.png' title='Required' /><\/div>"),!1):($("#"+n+"").removeClass("redborder"),"")}return""}function validateCustom(n,t,i){var r=$(n),f=r.attr("data-validator"),u="";return $.each(i,function(n,i){n==f&&(i(r.val())||(r.css("border","solid 1px #b95151"),r.after("<div id='"+t+"'><img src='//images.atgstores.com/images/layout/errorx.png' title='Required' /><\/div>"),u="FALSE"))}),u}function validateReq(n){var t,r,i;return $("#"+n).hasClass("req")&&document.getElementById(n).value==""?($("#"+n).addClass("frmError"),t=document.getElementById(n),r="",strValMessage.indexOf("Please complete all required fields<br>")==-1&&(strValMessage+="Please complete all required fields<br>"),t.previousSibling!=null&&t.previousSibling.className!=null&&t.previousSibling.className.indexOf("labelPos")>-1?(r=t.previousSibling.innerHTML.replace("*",""),strValMessage+="&middot; "+t.previousSibling.innerHTML.replace("*","")+"<br>"):t.previousSibling.previousSibling!=null&&t.previousSibling.previousSibling.className!=null&&t.previousSibling.previousSibling.className.indexOf("labelPos")>-1&&(r=t.previousSibling.previousSibling.innerHTML.replace("*",""),strValMessage+="&middot; "+r+"<br>"),document.getElementById(n+"ErrMsg")?(i=document.getElementById(n+"ErrMsg"),i.style.display="block",i.innerHTML=r!=""?r+" is required":"Required"):(i=document.createElement("div"),i.id=n+"ErrMsg",i.className="red fnts",i.innerHTML=r!=""?r+" is required":"Required",t.parentNode.insertBefore(i,t.nextSibling)),"FALSE"):""}function validateTextbox(n,t){var i=!0,r="",u="",s=n.id,e,f,o;return $(n).is(".emailtxt")?(r=/^\s*[\w\-\+_]+(\.[\w\-\+_]+)*\@[\w\-\+_]+\.[\w\-\+_]+(\.[\w\-\+_]+)*\s*$/,r.test(n.value)||(u=n.getAttribute("errorMessage")!=null?n.getAttribute("errorMessage"):"Invalid email",i=!1)):$(n).is(".phone")?(r=/^(?:\+?1[-. ]?)?\(?([0-9]{3})\)?[-. ]?([0-9]{3})[-. ]?([0-9]{4})$/,r.test(n.value)||(u=n.getAttribute("errorMessage")!=null?n.getAttribute("errorMessage"):"Invalid phone",i=!1)):$(n).is(".postalCode")?(r=/^[a-ceghj-npr-tv-z]\d[a-ceghj-npr-tv-z]\s*\d[a-ceghj-npr-tv-z]\d$/gi,r.test(n.value)||(u=n.getAttribute("errorMessage")!=null?n.getAttribute("errorMessage"):"Invalid postal code",i=!1)):$(n).is(".zip")?(r=/^([0-9]{5})(?:[-\s]*([0-9]{4}))?$/,r.test(n.value)||(u=n.getAttribute("errorMessage")!=null?n.getAttribute("errorMessage"):"Invalid zip code",i=!1)):$(n).is(".money")?(r=/^([0-9.]*)?$/,r.test(n.value)||(u=n.getAttribute("errorMessage")!=null?n.getAttribute("errorMessage"):"Invalid dollar amount",i=!1)):$(n).is(".date")?(r=/^[0-9]{1,2}[\/|-]{1}[0-9]{1,2}[\/|-]{1}[0-9]{4}$/,r.test(n.value)?(e=n.value.split("/"),(parseInt(e[0])>12||parseInt(e[1])>31)&&(u=n.getAttribute("errorMessage")!=null?n.getAttribute("errorMessage"):"Invalid date format (MM/DD/YYYY)",i=!1)):(u=n.getAttribute("errorMessage")!=null?n.getAttribute("errorMessage"):"Invalid date format (MM/DD/YYYY)",i=!1)):$(n).is(".birthday")?(r=/^[0-9]{1,2}\/[0-9]{1,2}\/[0-9]{4}$/,r.test(n.value)?(f=n.value.split("/"),(parseInt(f[0])>12||parseInt(f[1])>31||parseInt(f[2])<1900||parseInt(f[2])>2006)&&(u=n.getAttribute("errorMessage")!=null?n.getAttribute("errorMessage"):"Invalid birthday format (MM/DD/YYYY)",i=!1)):(u=n.getAttribute("errorMessage")!=null?n.getAttribute("errorMessage"):"Invalid birthday format (MM/DD/YYYY)",i=!1)):$(n).is(".fullname")?(o=parseInt(n.value.indexOf(" ")),o>0&&o<n.value.length?n.value.match(/[0-9.&\'!?,:;$%®]/g)!=null&&(u=n.getAttribute("errorMessage")!=null?n.getAttribute("errorMessage"):"Please don't use numbers or special characters in your name",i=!1):(u=n.getAttribute("errorMessage")!=null?n.getAttribute("errorMessage"):"Please enter your full name ex) John Smith",i=!1)):$(n).is(".textBox")?n.value.length==""&&(u=n.getAttribute("errorMessage")!=null?n.getAttribute("errorMessage"):"Please fill out the required text field",i=!1):$(n).is(".city")&&n.value.match(/^([^0-9]*)$/)==null&&(u=n.getAttribute("errorMessage")!=null?n.getAttribute("errorMessage"):"Please use a valid city name",i=!1),displayValidationMsg(i,s,t,u)}function displayValidationMsg(n,t,i,r){var u,f;return n?"":($("#"+t).addClass("frmError"),document.getElementById(t+"ErrMsg")?(u=document.getElementById(t+"ErrMsg"),u.style.display="block",u.innerHTML=r):(u=document.createElement("div"),u.id=t+"ErrMsg",u.className="red fnts",u.innerHTML=r,f=document.getElementById(t),f.parentNode.insertBefore(u,f.nextSibling)),strValMessage.indexOf("msg")==-1&&(strValMessage+=r),"FALSE")}function hideErrorAlt(n){timeOutId=setTimeout(function(){document.getElementById(n).style.display="none";document.getElementById(n).style.display="none";lastCalledId=0},1e3)}function showErrorAlt(n,t){var i=document.getElementById(n);n!=null&&(i.innerHTML=unescape(t),document.getElementById(n).style.display="block")}function displayErrorXwithAltDiv(n,t,i){var r,u,f,e,o;r=$("#"+n+"").parent().width();r+=36;f=$("#"+n+"").parent().position();e="top:"+f.top+"px;";u="left:"+r+"px;";o="<div id='"+t+"' style='position:relative;'><div style='width:16px;height:16px;float:left;margin-left:2px;'><img src=//images.atgstores.com/images/layout/errorx.png  onmouseover=showErrorAlt('divErrorAlt"+t+"','"+escape(i)+"'); onmouseout=hideErrorAlt('divErrorAlt"+t+"'); /><\/div><div style='border:solid 1px #ccc;background-color:#fff; padding:5px 5px;z-index:1000;float:left;position:absolute;"+u+e+"' id=divErrorAlt"+t+"><\/div><\/div>";$("#"+n+"").parent().after(o)}function showSponsoredHelp(n){document.getElementById(n).style.display=""}function hideSponsoredHelp(n){document.getElementById(n).style.display="none"}function findCampaignInCookie(n){var i=readCookie("sponsored"),r,t;if(i==null||i=="")return!1;for(r=unescape(i).split("~"),t=1;t<r.length;t++)if(n==r[t].split("|")[0]+"|")return!0;return!1}function prepForm(){var t,n;if(document.getElementById("frmMain")){for(t=document.getElementById("frmMain"),arrInput=t.getElementsByTagName("input"),n=arrInput.length-1;n>=0;n--)arrInput[n].alt?(arrInput[n].onfocus=new Function("prepBoxForTyping('"+arrInput[n].id+"', '"+arrInput[n].alt+"')"),arrInput[n].onclick=new Function("prepBoxForTyping('"+arrInput[n].id+"', '"+arrInput[n].alt+"')"),oldKeyUp=arrInput[n].onkeyup,arrInput[n].onkeyup=new Function("textBoxKeyUp('"+arrInput[n].id+"', '"+arrInput[n].alt+"')"),typeof oldKeyUp=="function"&&(currentFunction=arrInput[n].onkeyup,arrInput[n].onkeydown=attachEvt(oldKeyUp,currentFunction)),oldOnkeydown=arrInput[n].onkeydown,arrInput[n].onkeydown=new Function("textBoxKeyDown('"+arrInput[n].id+"', '"+arrInput[n].alt+"')"),typeof oldOnkeydown=="function"&&(currentFunction=arrInput[n].onkeydown,arrInput[n].onkeyup=attachEvt(oldOnkeydown,currentFunction)),oldOnBlur=arrInput[n].onblur,arrInput[n].onblur=new Function("textBoxBlur('"+arrInput[n].id+"', '"+arrInput[n].alt+"')"),typeof oldOnBlur=="function"&&(currentFunction=arrInput[n].onblur,arrInput[n].onblur=attachEvt(oldOnBlur,currentFunction)),arrInput[n].value==""&&arrInput[n].alt!=""&&(arrInput[n].value=arrInput[n].alt),arrInput[n].value==arrInput[n].alt&&(arrInput[n].style.color=colorHint)):arrInput[n].id.match(/.*assword.*/)&&(oldOnBlur=arrInput[n].onblur,arrInput[n].onblur=new Function("textBoxBlur('"+arrInput[n].id+"', '"+arrInput[n].alt+"')"),typeof oldOnBlur=="function"&&(currentFunction=arrInput[n].onblur,arrInput[n].onblur=function(){oldOnBlur();currentFunction()}));for(arrInput=t.getElementsByTagName("textarea"),n=arrInput.length-1;n>=0;n--)arrInput[n].alt&&(arrInput[n].onfocus=new Function("prepBoxForTyping('"+arrInput[n].id+"', '"+arrInput[n].alt+"')"),arrInput[n].onclick=new Function("prepBoxForTyping('"+arrInput[n].id+"', '"+arrInput[n].alt+"')"),arrInput[n].onkeyup=new Function("textBoxKeyUp('"+arrInput[n].id+"', '"+arrInput[n].alt+"')"),arrInput[n].onkeydown=new Function("textBoxKeyDown('"+arrInput[n].id+"', '"+arrInput[n].alt+"')"),arrInput[n].onblur=new Function("textBoxBlur('"+arrInput[n].id+"', '"+arrInput[n].alt+"')"),arrInput[n].value==""&&arrInput[n].alt!=""&&(arrInput[n].value=arrInput[n].alt),arrInput[n].value==arrInput[n].alt&&(arrInput[n].style.color=colorHint))}}function attachEvt(n,t){return function(){n();t()}}function prepBoxForTyping(n,t){tbxCurrent=document.getElementById(n);tbxCurrent.className=tbxCurrent.className.replace("borderOn","")+" borderOn";tbxCurrent.id.indexOf("tbxPass")>-1?(tbxCurrent.style.display="none",document.getElementById(tbxCurrent.id.replace("_helper","")).style.display="inline",document.getElementById(tbxCurrent.id.replace("_helper","")).focus(),document.getElementById(tbxCurrent.id.replace("_helper","")).className.replace("borderOn","")+" borderOn"):tbxCurrent.value==t&&(setCaretPosition(tbxCurrent,0),tbxCurrent.style.color=colorHintLight)}function textBoxKeyDown(n,t){tbxCurrent=document.getElementById(n);tbxCurrent.value==t&&(tbxCurrent.value=tbxCurrent.value.replace(t,""),tbxCurrent.style.color=colorText)}function textBoxKeyUp(n,t){tbxCurrent=document.getElementById(n);tbxCurrent.value==""&&(tbxCurrent.value=t,prepBoxForTyping(n,t))}function textBoxBlur(n,t){tbxCurrent=document.getElementById(n);tbxCurrent.className=tbxCurrent.className.replace("borderOn","");tbxCurrent.value==""&&(tbxCurrent.id.match(/.*assword.*/)&&document.getElementById(tbxCurrent.id+"_helper")?(tbxCurrent.style.display="none",document.getElementById(tbxCurrent.id+"_helper").style.display="inline"):tbxCurrent.value=t);tbxCurrent.value==t&&(tbxCurrent.style.color=colorHint)}function setCaretPosition(n,t){if(n!=null)if(n.createTextRange){var i=n.createTextRange();i.move("character",t);i.select()}else n.selectionStart!=null?(n.focus(),n.setSelectionRange(t,t)):n.focus()}function getViewport(){var n,t;return typeof window.innerWidth!="undefined"?(n=window.innerWidth,t=window.innerHeight):typeof document.documentElement!="undefined"&&typeof document.documentElement.clientWidth!="undefined"&&document.documentElement.clientWidth!=0?(n=document.documentElement.clientWidth,t=document.documentElement.clientHeight):(n=document.getElementsByTagName("body")[0].clientWidth,t=document.getElementsByTagName("body")[0].clientHeight),[n,t]}function addFunc(){try{}catch(n){postJavaError("addfunc: "+n.message)}}function displayGov(n){n.checked?$("#displayGov").show():$("#displayGov").hide()}function displayG(){var n=document.getElementById("ddlLevelG"),t=document.getElementById("ddlContact");n.value==1?($("#contactDisplay").hide(),$("#govMessage").html("<font class='strong'>Notice<\/font>:GSA transactions must be facilitated through the local Lowes's store. Should you decide to proceed be advised your purchase would be Open Market.Want to learn more about Lowe's GSA contract? Visit <a href='/gsa' >lowesforpros.com/gsa<\/a>.")):n.value==0?($("#contactDisplay").show(),$("#govMessage").html("")):($("#contactDisplay").hide(),$("#govMessage").html(""))}function displayC(){var n=document.getElementById("ddlLevelG"),t=document.getElementById("ddlContact");t.value==0&&n.value==0?$("#govMessage").html("If you are not registered with TCPN, please, visit <a href='/tcpn.aspx'>www.lowesforpros.com/tcpn<\/a> to learn more <a href='//www.tcpn.org/'>tcpn.org<\/a> to register."):t.value==2&&n.value==0?$("#govMessage").html("To learn more about contracts that are available at Lowe's for in-store shopping click here"):$("#govMessage").html("")}function loadQA(){var n=document.getElementById("divQAContainer");n&&(n.innerHTML+="<input type='button' class='qaTab l' onclick='toggleQABody();'><\/input><div id='divQABody' class='r displayn qaContent bBox shadr pd8 txtl' style='width: 0;'><span class='h1'>Questions & Answers<\/span><\/div>")}function toggleQABody(){var n=document.getElementById("divQABody"),t;if(n)if(n.className.indexOf("displayb")!=-1){n.className=n.className.replace(/wrapNorm/g,"");n.className=n.className.replace(/  /g," ");$(n).animate({width:"0"},"slow","swing",function(){n.className=n.className.replace(/displayb/g,"");n.className+=" displayn";n.className=n.className.replace(/  /g," ")});try{window.removeEventListener("mousedown",clickOutsideQA,!1)}catch(i){document.detachEvent("onmousedown",clickOutsideQA)}}else{n.className=n.className.replace(/displayn/g,"");n.className+=" displayb";n.className=n.className.replace(/  /g," ");isQALoaded||(t="",typeof intTypeId!="undefined"?t+="?typeId="+intTypeId.toString():typeof strTypeId!="undefined"&&(t+="?typeId="+strTypeId.toString()),typeof intGId!="undefined"&&(t+="&groupId="+intGId.toString()),typeof intMfrId!="undefined"&&(t+="&mfrId="+intMfrId.toString()),ajax("/products/ajax/qaAjax.aspx"+t,loadQAAjax,!0));$(n).animate({width:"500px"},"slow",function(){n.className+=" wrapNorm"});try{window.addEventListener("mousedown",clickOutsideQA,!1)}catch(i){document.attachEvent("onmousedown",clickOutsideQA)}}}function clickOutsideQA(n){n||(n=window.event);var i=document.getElementById("divQAContainer"),t;n.target?t=n.target:n.srcElement&&(t=n.srcElement);do{if(i==t)return!1;t=t.parentNode}while(t);return toggleQABody(),!0}function loadQAAjax(n){var t=document.getElementById("divQABody");t&&!isQALoaded&&(isQALoaded=!0,t.innerHTML+=n)}function searchQA(n,t){var i=document.getElementById("tbxQAQuestion"+t).value,f,e,r,o,u;i==="Type your question here..."&&(i="");n==="true"&&(strLastQuestionQA===i?n="false":strLastQuestionQA=i);f=document.getElementById("divQAParams"+t);e=f.innerHTML.replace(/aaa/g,"&");callBackNumQA++;r=[];r[0]=callBackNumQA;r[1]=t;o=new ajaxRequestObject("/ajax/getAnswers.ashx","question="+i+e+"&log="+n+"&suffix="+t,answerCallbackQA,r);o.doGetCallback();u=document.getElementById("divAnswer"+t);u.innerHTML===""&&(u.innerHTML='<img src="//images.atgstores.com/images/layout/colorspinner.gif" style="margin: auto; vertical-align: middle;"/><span class="mglr4">searching<\/span>')}function answerCallbackQA(n,t){if(callBackNumQA==t[0]){var i=document.getElementById("divAnswer"+t[1]),r=document.getElementById("divContact"+t[1]);r.style.display="block";i.innerHTML=n[0]==""?"Sorry there are no results.":n}}function clearIfDefaultQA(n,t){n.value===t&&(n.value="")}function setDefaultIfEmptyQA(n,t){n.value===""&&(n.value=t)}function dynamicSearchQA(n,t){searchTimerQA!=null&&clearTimeout(searchTimerQA);searchTimerQA=setTimeout(function(){dynamicSearchQACallback(n,"false",t)},500);logTimerQA!=null&&clearTimeout(logTimerQA);logTimerQA=setTimeout(function(){dynamicSearchQACallback(n,"true",t)},5e3)}function dynamicSearchQACallback(n,t,i){searchPending=!1;removeQuestionWordsQA(n.value).length>=3&&searchQA(t,i)}function removeQuestionWordsQA(n){n=n.toLowerCase();var t=new RegExp("a|able|about|across|after|all|almost|also|am|among|an|and|any|are|as|at|be|because|been|but|by|can|cannot|could|dear|did|do|does|either|else|ever|every|for|from|get|got|had|has|have|he|her|hers|him|his|how|however|i|if|in|into|is|it|its|just|least|let|like|likely|may|me|might|most|must|my|neither|no|nor|not|of|off|often|on|only|or|other|our|own|rather|said|say|says|she|should|since|so|some|than|that|the|their|them|then|there|these|they|this|tis|to|too|twas|us|wants|was|we|were|what|when|where|which|while|who|whom|why|will|with|would|yet|you|your","gi");return n.replace(t,"")}function googleRemarketing(){}function getParameterByName(n){n=n.replace(/[\[]/,"\\[").replace(/[\]]/,"\\]");var i=new RegExp("[\\?&]"+n+"=([^&#]*)"),t=i.exec(location.search);return t==null?"":decodeURIComponent(t[1].replace(/\+/g," "))}function hideRecentViewed(){var t,i;if(document.getElementById("isHomepage")!=null&&document.getElementById("RvFdOuterWrapper")?document.getElementById("RvFdOuterWrapper").style.display="none":typeof hideForContest!="undefined"&&hideForContest=="yes"&&document.getElementById("reFeWrapper")&&(document.getElementById("reFeWrapper").style.display="none"),navigator.userAgent.indexOf("Firefox")>-1?strShortName&&document.getElementById("inContentWrap")&&strShortName!="lowesca"&&strShortName!="lfp"&&(document.getElementById("inContentWrap").style.height="155px"):navigator.userAgent.indexOf("MSIE 7.0")>-1&&strShortName&&strShortName!="lowesca"&&strShortName!="lfp"&&(t=document.getElementById("RvFdOuterWrapper"),(typeof t=="undefined"||t==null)&&(t.style.height="235px")),i=getParameterByName("grid"),i!=""){var n=document.createElement("div"),u=document.getElementById("divContainer"),r=(document.body.clientWidth-1008)/2;n.style.width="1008px";n.style.height="4000px";n.style.background="url('/images/layout/grid.png')";n.style.position="absolute";n.style.zIndex="100000";n.style.top="0px";n.style.left=r+"px";document.body.appendChild(n)}}function hideRecentLowes(){var t;if(typeof hideForContest!="undefined"&&hideForContest=="yes"&&document.getElementById("reFeWrapper")&&(document.getElementById("reFeWrapper").style.display="none"),t=getParameterByName("grid"),t!=""){var n=document.createElement("div"),r=document.getElementById("divContainer"),i=(document.body.clientWidth-1008)/2;n.style.width="1008px";n.style.height="4000px";n.style.background="url('/images/layout/grid.png')";n.style.position="absolute";n.style.zIndex="100000";n.style.top="0px";n.style.left=i+"px";document.body.appendChild(n)}}function googleRemarketingLowes(){if(typeof strShortName!="undefined"&&strShortName=="lowesca"){var n=getParameterByName("tid");n=="2330"&&(google_conversion_id=1039461274,google_conversion_label="GIwzCMKTugMQmtfT7wM",$("#litGoogleRemarketingImage").prepend("<img height='1' width='1' style='border-style:none;' src='//www.googleadservices.com/pagead/conversion/1068234926/?label=dhNMCObGrgIQrvGv_QM&amp;guid=ON&amp;script=0' />"));google_conversion_language="en";google_conversion_format="3";google_conversion_color="666666";google_conversion_value=0}}function miniFeedBackCurPage(){}function signUpEmail(){var n;typeof strShortName!="undefined"&&(strShortName=="lowesca"?(n=$("#txtfooteremail").val(),$("#btnLowesEmail").hide(),$("#mSpinner").append("<div class='loader'>Loader...<\/div>")):($("#btnSignUpFooterNew").hide(),$("#mSpinner").append("<div class='loader'>Loader...<\/div>"),n=$("#txtNavEmail").val()));$.ajax({url:"/ajax/OneClickEmailSignup.aspx",type:"GET",data:{email:n},success:function(n){strShortName=="atgs"?$("#mSpinner").html(""):$("#mSpinner img:last-child").remove();strShortName=="lowesca"?$("#btnLowesEmail").show():$("#btnSignUpFooterNew").show();$("#lEmailMsg").html(n)}});strShortName=="lowesca"&&(window.location.href="//www.lowes.ca/account/subscriptionMgmt.aspx?coupon=yes")}function getCookie(n){var t=document.cookie,i=t.indexOf(" "+n+"="),r;return i==-1&&(i=t.indexOf(n+"=")),i==-1?t=null:(i=t.indexOf("=",i)+1,r=t.indexOf(";",i),r==-1&&(r=t.length),t=unescape(t.substring(i,r))),t}function sectionPageLevel(){var n=getParameterByName("nomobile");n==1&&expireCookie("mATGStopRedirect")}function loadJSVar(){try{strSecureLogin=$("#strSLogin").val();strUnsecureLogout=$("#strULogout").val();showChatInvite=$("#strShowC").val();strServer=$("#strServer").val();strShortName=$("#strSName").val()}catch(n){var t=new Image(1,1);t.src=document.location.protocol+"//track.atgstores.com/ajax/trackJavaError.aspx?err="+escape(n.message)+"&pg="+escape(location.pathname)}}function isMobileUser(){var n=navigator.userAgent.toLowerCase();return window.location.href.indexOf("nomobile=1")>-1?!1:window.location.href.indexOf("showmobile=1")>-1?!0:window.location.href.indexOf("/articles/")>-1?!1:n.search("ipad")>-1?!1:n.search("iphone")>-1||n.search("ppc")>-1&&n.search("macintosh")<0||n.search("windows ce")>-1||n.search("blackberry")>-1||n.search("opera mini")>-1||n.search("mobile")>-1||n.search("palm")>-1||n.search("portable")>-1?!0:!1}function CheckNonMobileUser(){var i,n,s,u,r;if(typeof strShortName!="undefined"&&strShortName=="lowesca"){var f="",e="mATGStopRedirect".toLowerCase()+"=",o=document.cookie.split(";"),t="";for(i=0;i<o.length;i++){for(n=o[i].toLowerCase();n.charAt(0)==" ";)n=n.substring(1,n.length);n.indexOf(e)==0&&(f=n.substring(e.length,n.length))}if(t=window.location.href.indexOf("mobileToFull=1"),isMobileUser()&&document.referrer.indexOf("/mobile/")>-1&&window.location.href.indexOf("mobileToFull=1")==-1&&(s=new Date,u=new Date,u.setTime(s.getTime()-864e5),document.cookie="mATGStopRedirect=-1;path=/;expires="+u.toGMTString(),t+="clearCookie"),f=="-1"||window.location.href.indexOf("mobileToFull=1")!=-1||window.location.href.indexOf(".atgstores.com")!=-1&&window.location.href.indexOf("www.atgstores.com")==-1)return;isMobileUser()&&(r=getRedirectURL(),window.location=r.indexOf("?")==-1?r+"?mPath="+t:r+"&mPath="+t)}}function getRedirectURL(){var n=window.location.href,i=window.location.pathname,t;return n.indexOf("account/subscriptionMgmt.aspx")!=-1?(t=n.split("email="),t.length>1?"/mobile/sm.aspx?email="+t[1]:"/mobile/sm.aspx"):n.match("_g([0-9]+).html")?"/mobile/productitem.aspx?gid="+n.match("_g([0-9]+)")[1]:n.match("/.+/[0-9a-zA-Z-]+/[0-9a-zA-Z-]+_([0-9]+).html")?"/mobile/productitem.aspx?sku="+n.match("/[0-9a-zA-Z-]+/[0-9a-zA-Z-]+_([0-9]+)")[1]:n.match("([a-zA-Z-]+)_([0-9]+)_m([0-9]+).html")?"/mobile/searchresults.aspx?stype=ctg&mfrid="+n.match("([a-zA-Z-]+)_([0-9]+)_m([0-9]+).html")[3]+"&tid="+n.match("([a-zA-Z-]+)_([0-9]+)_m([0-9]+).html")[2]:n.match("([a-zA-Z-]+)_([0-9]+).html")?"/mobile/searchresults.aspx?stype=ctg&tid="+n.match("([a-zA-Z-]+)_([0-9]+).html")[2]:n.match("([a-zA-Z-]+)_m([0-9]+).html")?"/mobile/mfrs.aspx?mfrid="+n.match("([a-zA-Z-]+)_m([0-9]+).html")[2]:i=="/"?"/mobile":void 0}function setZipCode(n){if(n!=""){returnStringForStoreLocator="";var t=n;checkNumber(t)&&strShortName=="lowesca"&&(t="M6B4B3");setStoreFromPostalCode(t)}}function checkNumber(n){return!isNaN(parseFloat(n))&&isFinite(n)}function clearCookieAndShowEntry(){window.location.href="/store/storelocatorlfp.aspx?entryPoint=topFlyout"}function delete_cookiestore(n,t){var i="";window.location.href.indexOf(".atgstores.com")!=-1?i=";domain=.atgstores.com":window.location.href.indexOf(".lowes.ca")!=-1?i=";domain=.lowes.ca":window.location.href.indexOf(".lowesforpros.com")!=-1&&(i=";domain=lowesforpros.com");document.cookie=n+"="+(t?";path="+t:"")+(i?";domain="+i:"")+";expires=Thu, 01 Jan 1970 00:00:01 GMT"}function doPopUp(){}function getStoreById(){var n;return n}function newStoreInfoChnage(){document.getElementById("popBox")!=undefined&&document.getElementById("popBox").className.indexOf("popBoxSL")!=-1&&closePopBoxPunch(null,null,"closePO");msieVersion()>8||msieVersion()=="otherbrowser"||isNaN(msieVersion())?(document.body.removeEventListener("click",boxCloser,!1),$("#divStoreInfo").css("display")=="block"&&$("#divStoreInfo").hide()):$("#divStoreInfo").css("display")=="block"&&$("#divStoreInfo").hide()}function readCookieJsonSL(n){return readCookie(n)==undefined?null:decodeURIComponent(readCookie(n))}function SetCookieJsonSL(n,t,i){var u,f,r,e;try{u=new Date;f=new Date;(i==null||i==0)&&(i=1);f.setTime(u.getTime()+864e5*i);r="";window.location.href.indexOf(".atgstores.com")!=-1?r=".atgstores.com":window.location.href.indexOf(".lowes.ca")!=-1?r=".lowes.ca":window.location.href.indexOf(".lowesforpros.com")!=-1&&(r=".lowesforpros.com");e={expires:i,path:"/",domain:r,secure:!1};$.cookie(n,JSON.stringify(JSON.parse(t)),e)}catch(o){postJavaError(o.message)}}function setNavigationStoreOldFlyOut(n){var f=strShortName,r,u,i;if(n.indexOf("|")>-1){var t=n.split("|"),s=customerCurrentDateNav.getDay(),h=customerCurrentDateNav.toLocaleDateString().replace(/\//g,"-"),e=["am","AM","pm","PM"];function c(n,t){var f=n.replace(new RegExp("("+e.join("|")+")","g"),"").replace(/\s/g,"").split("-"),o=f[0],s=parseInt(12)+parseInt(f[1]),i=!1,r=new Date,u=new Date;r.setHours(o);r.setMinutes(0,0,0);u.setHours(s);u.setMinutes(0,0,0);customerCurrentDateNav>=r&&customerCurrentDateNav<=u&&(i=!0);switch(t){case 1:$(".spnNavOpenMonday:last").length>0&&(i?$(".spnNavOpenMonday:last").show():$(".spnNavCloseMonday:last").show());break;case 2:$(".spnNavOpenSat:last").length>0&&(i?$(".spnNavOpenSat:last").show():$(".spnNavCloseSat:last").show());break;case 3:$(".spnNavOpenSunday:last").length>0&&(i?$(".spnNavOpenSunday:last").show():$(".spnNavCloseSunday:last").show())}}if(f=="lfp"){if($("#divServices").hide(),$("#spnMainStore","").text(t[15].replace(/(\d{3})(\d{3})(\d{4})/,"($1) $2-$3")),$("#spnStorePhone").text(t[12].replace(/(\d{3})(\d{3})(\d{4})/,"($1) $2-$3")),$("#spnStoreFax").text(t[13].replace(/(\d{3})(\d{3})(\d{4})/,"($1) $2-$3")),t[14]!="")try{$("#lfpHoursShowMe").html(t[14])}catch(l){}}else{if(t[35]!="NULL"&&t[35]&&t[35].length!=0){for($("#divPunchOutCanadaHours").removeClass("displayn"),$("#divPunchOutHours").addClass("displayn"),$("#divHoursMF").text(""),$("#divHoursSsat").text(""),$("#divHoursSsun").text(""),r=JSON.parse(t[35]),u="",i=0;i<r.Rows.length;i++)u+="<div class='g7 l'><div class='g3 l'>"+r.Rows[i].Days+"<\/div><div class='l g3' >"+r.Rows[i].Hours+"<\/div><\/div>";$("#divPunchOutCanadaHours").append(u)}else $("#divPunchOutHours").removeClass("displayn"),$("#divPunchOutCanadaHours").addClass("displayn"),$("#divPunchOutCanadaHours").text(""),$("#divHoursMF").text(t[14]),$("#divHoursSsat").text(t[19]),$("#divHoursSsun").text(t[20]);$("#divHolidayHours").append(divifyHolidayHours(t[31],t[32],t[33],t[34]));$("#spnStorePhone").text(t[12].replace(/(\d{3})(\d{3})(\d{4})/,"($1) $2-$3"));$("#spnStoreFax").text(t[13].replace(/(\d{3})(\d{3})(\d{4})/,"($1) $2-$3"))}function o(n,t){return n.length>t?n.substring(0,t-3)+"...":n}$("#storeNameHead").html(o(t[0],23));$("#divStoreName").text(t[0]);$("#divStoreStreet").text(t[9]);$("#divcityProvZip").text(t[10]+", "+t[11]+" "+t[3]);$("#spnStoreID").text(t[1]);f=="lowesca"&&(t[27]!=""?($("#aGarden").text(t[27]),$("#aGarden").attr("href",Base64Decode(t[28]))):$("#divGarden").hide(),t[29]!=""?($("#aTool").text(t[29]),$("#aTool").attr("href",Base64Decode(t[30]))):$("#divTools").hide(),t[22]!="True"&&t[23]!="True"&&t[24]!="True"&&t[25]!="True"&&$("#divRecyle").hide(),t[21]!=""?$("#spnRestaurant").text(t[21]):$("#divRestaurant").hide());$("#btnTopStoreRedirect").length&&$("#btnTopStoreRedirect").click(function(){window.location="/store-locator/directions/"+t[1]})}}function lowesStoreLocatior(){var t,n;if(cookieEnabled)if(self!==top&&strShortName=="lfp"&&document.getElementById("internalTabs")&&(document.getElementById("internalTabs").style.display="none"),readCookieJsonSL("punchOut")===null||readCookieJsonSL("punchOut")===undefined||readCookieJsonSL("punchOut")===""){if(setSiteName(),typeof strShortName!="undefined"&&(strShortName=="lfp"||strShortName=="lowesca")){function i(){var n,o;if(document.getElementById("divStoreInfo")&&(document.getElementById("divStoreInfo").style.display="none"),n=unescape(readCookie("storeinfo")),(n!="null"||n!=null)&&n.match(/<(\w+)((?:\s+\w+(?:\s*=\s*(?:(?:"[^"]*")|(?:'[^']*')|[^>\s]+))?)*)\s*(\/?)>/)&&delete_cookiestore("storeinfo","/"),(strShortName=="lfp"||strShortName=="lowesca")&&(n=="null"||n==null)){isCurrentPagePopUp="inProgress";var f="shortName="+strShortName,e=new ajaxRequestObject("/Navigation/closestStoreZip.ashx",f,setZipCode);e.doGetCallback();n=unescape(readCookie("storeinfo"))}if(o=getParameterByName("zipFT"),n===null)if(strShortName=="lfp")document.getElementById("storelocatorForm")&&(document.getElementById("storelocatorForm").style.display="block"),document.getElementById("lowesStoreArea")&&(document.getElementById("lowesStoreArea").style.display="none");else{function s(){$("#lowesStoreArea").hide();$("#lowesFailZipIn").show()}s()}else if(strShortName=="lowesca")setNavigationStoreOldFlyOut(n);else if(strShortName=="lfp"&&n.indexOf("|")>-1){var t=n.split("|"),i=r(t[10],t[11],t[0]),u=t[1],h=t[2];document.getElementById("storelocatorForm")&&(document.getElementById("storelocatorForm").style.display="none");document.getElementById("lowesStoreArea")&&(document.getElementById("lowesStoreArea").style.display="block");document.getElementById("spStoreName")&&i.indexOf("Lowes")!=-1&&(i=i.replace("Lowes","Lowe's"));document.getElementById("spStoreName")&&(document.getElementById("spStoreName").innerHTML=i);document.getElementById("spStoreId")&&(document.getElementById("spStoreId").innerHTML=u);document.getElementById("hrefStoreInfo")&&(document.getElementById("hrefStoreInfo").href="/store/storelocatorlfp.aspx?entryPoint=topFlyoutStore_Info&storeid="+u);lowesStoreID=u}}function r(n,t,i){return typeof i!="undefined"?i:typeof n!="undefined"&&n!==null&&n!==""&&typeof t!="undefined"&&t!==null&&t!==""?"Lowe's of "+n+", "+t:""}function e(n,i){clearTimeout(t);var r=new ajaxRequestObject("/ajax/adblockhelper.aspx","action=getfimages&storeid="+n+"&patchid="+i+"&siteid=1916&adtype=leftLg",displayStoreRelatedAds);r.doGetCallback()}i()}}else try{n=JSON.parse(readCookieJsonSL("punchOut"));n[0].user==!0&&n[0].authorization==!1&&n[0].authorizationStepOne==undefined?openPopBoxPunchOut(345,225,"<iframe width='350' height='225' frameborder='0' scrolling='no' src='/ajax/punchOut.aspx'><\/iframe>"):n[0].user==!0&&n[0].authorization==!1&&n[0].authorizationStepTwo==undefined&&openPopBoxPunchOut(345,225,"<iframe width='350' height='225' frameborder='0' scrolling='no' src='/ajax/punchOut.aspx'><\/iframe>")}catch(u){console.log(u.message)}else try{$("#cookieEnableDisplay").text("Your cookies are disabled, some pages will not function or display properly.");$("#cookieEnableDisplay").show()}catch(f){console.log(f.message)}}function zipInFailFindStore(){var n=$("#txtZipInFailed").val();n.match(/[a-zA-Z][0-9][a-zA-Z](-| |)[0-9][a-zA-Z][0-9]/)?$.ajax({url:"/Navigation/ajax/StoreInformation.aspx",data:{pc:n,clear:getParameterByName("clear")},processdata:!0,async:!1,success:function(t){var i=unescape(t),r;i!=null?(r=i.split("|"),SetCookie("storeinfo",t,30),SetCookie("storeIDCookie",r[1],30),window.location.reload()):window.location="/store-locator/search/"+n.replace(/ +?/g,"")},error:function(){window.location="/store-locator/search/"+n.replace(/ +?/g,"")}}):window.location="/store-locator/search/"+n.replace(/ +?/g,"")}function zipInFailDown(n){var t;window.event?t=n.keyCode:n.which&&(t=n.which);t==13&&(zipInFailFindStore(),n.preventDefault?n.preventDefault:n.returnValue=!1)}function Base64Decode(n){var r="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",t="",o,s,h,c,f,u,e,i=0;if(n!=undefined)do c=r.indexOf(n.charAt(i++)),f=r.indexOf(n.charAt(i++)),u=r.indexOf(n.charAt(i++)),e=r.indexOf(n.charAt(i++)),o=c<<2|f>>4,s=(f&15)<<4|u>>2,h=(u&3)<<6|e,t=t+String.fromCharCode(o),u!=64&&(t=t+String.fromCharCode(s)),e!=64&&(t=t+String.fromCharCode(h));while(i<n.length);return t}function loadStore(){function t(){var n=readCookieJson("storeIDCookie");if(n===null)document.getElementById("storelocatorForm")&&(document.getElementById("storelocatorForm").style.display="block"),document.getElementById("lowesStoreArea")&&(document.getElementById("lowesStoreArea").style.display="none");else if(n=JSON.parse(n),n[0].strLowesStoreId!="undefined"){if(strShortName=="lfp"){if($("#divServices").hide(),$("#spnMainStore").text(n[0].strPhone.replace(/(\d{3})(\d{3})(\d{4})/,"($1) $2-$3")),$("#spnStorePhone").text(n[0].strCommercialPhone.replace(/(\d{3})(\d{3})(\d{4})/,"($1) $2-$3")),$("#spnStoreFax").text(n[0].strCommercialFax.replace(/(\d{3})(\d{3})(\d{4})/,"($1) $2-$3")),n[0].strAllOpenHours!="NULL"&&n[0].strAllOpenHours!="")try{$("#lfpHoursShowMe").html(n[0].strAllOpenHours)}catch(t){console.log(t.message)}}else $("#divHoursMF").text(n[0].strMonday),$("#divHoursSsat").text(n[0].strSaturday),$("#divHoursSsun").text(n[0].strSunday),$("#spnStorePhone").text(n[0].strPhone.replace(/(\d{3})(\d{3})(\d{4})/,"($1) $2-$3")),$("#spnStoreFax").text(n[0].strFax.replace(/(\d{3})(\d{3})(\d{4})/,"($1) $2-$3"));$("#storeNameHead").html(i(n[0].strDescr,23));$("#divStoreName").text(n[0].strDescr);$("#divStoreStreet").text(n[0].strAddress);$("#divcityProvZip").text(n[0].strCity+", "+n[0].strState+" "+n[0].strZip);$("#spnStoreID").text(n[0].strLowesStoreId);n[0].strGardenCenterName!="NULL"?($("#aGarden").text(n[0].strGardenCenterName),$("#aGarden").attr("href",n[0].strGardenCenterUrl)):$("#divGarden").hide();n[0].strToolRentalName!="NULL"?($("#aTool").text(n[0].strToolRentalName),$("#aTool").attr("href",n[0].strToolRentalUrl)):$("#divTools").hide();n[0].strRecyclePaint!="True"&&n[0].strRecycleCFL!="True"&&n[0].strRecycleBatterySingle!="True"&&n[0].strRecycleBatteryRecharge!="True"&&$("#divRecyle").hide();n[0].strRestaurant!="NULL"?$("#spnRestaurant").text(n[0].strRestaurant):$("#divRestaurant").hide();$("#btnTopStoreRedirect").on("click",function(){window.location="/storeLocator/storeLocatorPage.aspx?initial=directions&directionsto="+n[0].strLowesStoreId})}}function i(n,t){return n.length>t?n.substring(0,t-3)+"...":n}var n;t()}function setAsMyStorePP(n,t){SetCookieJsonSL("storeIDCookie",n,7);window.parent.closePopBox();window.parent.location=t}function readCookieJson(n){return $.cookie(n)==undefined?null:decodeURIComponent($.cookie(n))}function SetCookieJson(n,t,i){var u,f,r,e;try{u=new Date;f=new Date;(i==null||i==0)&&(i=1);f.setTime(u.getTime()+864e5*i);r="";window.location.href.indexOf(".atgstores.com")!=-1?r=".atgstores.com":window.location.href.indexOf(".lowes.ca")!=-1?r=".lowes.ca":window.location.href.indexOf(".lowesforpros.com")!=-1&&(r=".lowesforpros.com");e={expires:i,path:"/",domain:r,secure:!1};$.cookie(n,JSON.stringify(JSON.parse(t.replace(/<\/?[^>]+>/gi,""))),e)}catch(o){postJavaError(o.message)}}function showRecycling(n,t){var i="";t&&(i="smallView");document.getElementById(i+"showRecycleText").style.display="";document.getElementById(i+"showRecycleText").innerHTML=n}function hideRecycling(){document.getElementById("smallViewshowRecycleText")&&(document.getElementById("smallViewshowRecycleText").style.display="none")}function clearStoreInfo(){}function showStoreDiv(){}function showStoreInfoPopup(n){if(n){var t=new ajaxRequestObject("/Navigation/ajax/storelocatorhelper.aspx","storeid="+lowesStoreID+"&smallview=1&linkloc=toppanel",slResponseHandler);t.doGetCallback();clearTimeout(3e3);tLowesStoreInfoShow=setTimeout("lowesStorePopUp(true)",500)}else clearTimeout(3e3),tLowesStoreInfoHide=setTimeout("lowesStorePopUp(false)",500)}function slResponseHandler(n){document.getElementById("divStoreInfo")&&(document.getElementById("divStoreInfo").style.display="none",document.getElementById("divStoreInfo").innerHTML=n,document.getElementById("addressDiv").style.margin="15px",document.getElementById("storeInfoDiv").style.margin="15px",document.getElementById("divAddInfo")!=null&&(document.getElementById("divAddInfo").style.display="none"))}function lowesStorePopUp(n){document.getElementById("divStoreInfo")&&(n?(document.getElementById("divStoreInfo").style.display="block",storeDisplayTimeout()):document.getElementById("divStoreInfo").style.display="none")}function storeDisplayTimeout(){}function readCookies(n){for(var r=n.toLowerCase()+"=",u=document.cookie.split(";"),t,i=0;i<u.length;i++){for(t=u[i];t.charAt(0)==" ";)t=t.substring(1,t.length);if(t.toLowerCase().indexOf(r)==0)return t.substring(r.length,t.length)}return null}function getUserCookiesDetails(n){for(var r=n,u=document.cookie.split(";"),t,i=0;i<u.length;i++){for(t=u[i];t.charAt(0)==" ";)t=t.substring(1,t.length);if(t.indexOf(r)==0)return t.substring(r.length,t.length)}return null}function processNAM(n){if(n!=null&&n!=","){var t=n.split(","),r="",i="",u="";return t[0]!=null&&t[0].toString()!=""&&(r="National Account Manager: ",i="<b>"+t[0].toString()+"<\/b>",t.length>1&&t[1]!=null&&t[1]!=""&&(u=t[1].toString()),readCookie("BuyerCookie")==null&&u!=""&&i!=""?r+='<a href="mailto:'+u+'">'+i+"<\/a>":i!=""&&(r+=i)),r}return null}function checkLoginUser(){var n,r,t;if(typeof returnStringLog!="undefined"&&(n="?return="+returnStringLog),setSiteName(),strShortName=="lowesca")readCookies("user%5Fid")!=null&&readCookies("user%5Fid")!=""?($("#anchorLoginLowes").attr("onclick","logoutRemoveCookies()"),$("#anchorLoginLowes").text("Logout"),$("#anchorLoginLowes").attr("href","/account/logout.aspx")):($("#anchorLoginLowes").attr("onclick","").unbind("click"),$("#anchorLoginLowes").text("Login"),$("#anchorLoginLowes").attr("href","/account/login.aspx"+decodeURI(n)));else if(strShortName=="lfp")readCookies("user%5Fid")!=null&&readCookies("user%5Fid")!=""&&readCookies("LFPCustomerID")!=null&&readCookies("LFPCustomerID")!=""?($("#anchorSignInLowes").attr("onclick","").unbind("click"),$("#anchorSignInLowes").text(""),$("#anchorSignInLowes").append("Sign Out"),r=location.hostname,$("#anchorSignInLowes").attr("href","https://"+r+"/pro/proLogout.aspx"),$("#anchorLoginLowes").text("Sign Out"),$("#anchorLoginLowes").attr("href","/pro/proLogout.aspx"),t=getUserCookiesDetails("LFPCustomerFirst="),t!=null&&$("#accountName").html("Welcome "+t+'&nbsp;<img class="topsprite droparrow" src="//images.atgstores.com/images/1pt_trans.gif">'),setTcpnAndNam()):($("#anchorLoginLowes").text("Sign In"),$("#anchorLoginLowes").attr("onclick",'openPopBox(450,180,"<iframe class=noFrames frameborder=0 height=190 width=450 src=../localpros/lfpLogin.aspx?doAnother=true&doReturn=..'+window.location.pathname+' ><\/iframe>"); return false; '),$("#accountName").html('Account&nbsp;<img class="topsprite droparrow" src="//images.atgstores.com/images/1pt_trans.gif">'),$("#NAMInfo").html(""));else if(readCookies("user%5Fid")!=null&&readCookies("user%5Fid")!=""){$("#anchorLogin").text("Logout");$("#anchorLogin").attr("href","/account/logout.aspx");$("#anchorLogin").attr("onclick","logoutRemoveCookies()");var u=getUserCookiesDetails("ProAdmin="),i=getUserCookiesDetails("NAM="),f=processNAM(i);u!=null?i!=","&&i!=null?($("#NAMInfo").html(f),$("#namBar").removeClass("displayn"),$("#namBar").addClass("displayb")):($("#namBar").removeClass("displayb"),$("#namBar").addClass("displayn")):($("#namBar").removeClass("displayb"),$("#namBar").addClass("displayn"))}else $("#anchorLogin").text("Login"),$("#anchorLogin").attr("href","/account/login.aspx"+decodeURI(n))}function setTcpnAndNam(){var n=getUserCookiesDetails("TCPN="),i,t,r;n!=null&&n!=""&&(n==1?$("#contractGov").html("Contract:&nbsp<b>TCPN<\/b>&nbsp&nbsp&nbsp"):$("#contractGov").html("Contract:&nbsp<b>No Contract<\/b>&nbsp&nbsp&nbsp"));try{i=getUserCookiesDetails("isFederal=");null!=i&&""!=i&&i==1&&$("#contractGov").html("")}catch(u){}t=getUserCookiesDetails("NAM=");r=processNAM(t);n!=""&&t!=","?$("#NAMInfo").html(r):n!=""&&t==","?readCookie("BuyerCookie")!=null?n==1?$("#NAMInfo").html("National Account Manager:&nbsp&nbsp<b>TCPN Contract Administrator<\/b>"):n==0&&$("#NAMInfo").html("National Account Manager:&nbsp&nbsp<b>Government Sales Team<\/b>"):n==1?$("#NAMInfo").html("National Account Manager:&nbsp&nbsp<a href='mailto:Tcpn@lowes.com'><b>TCPN Contract Administrator<\/b><\/a>"):n==0&&$("#NAMInfo").html("National Account Manager:&nbsp&nbsp<a href='mailto:Govmilaccount@lowes.com'><b>Government Sales Team<\/b><\/a>"):t!=","&&$("#NAMInfo").html(r)}function rpLinkNew(){readCookies("user%5Fid")!=null&&readCookies("lui%5Frep%5Fid")!=null&&readCookies("fullName")!=null&&($("#rewardA").attr("href","/admin/orders/customer.aspx?id="+readCookies("user%5Fid")+""),$("#rewardA").empty(),$("#rewardA").wrapInner(""+readCookies("fullName")+" <a class='fnts l' href='/account/logout.aspx'>Logout<\/a>"),$("#rewardA").css("width","150px"))}function tabletOnclick(){var n=$(this),t=n.attr("href");t.indexOf("linkloc")==-1&&(t.indexOf("?")>0?n.attr("href",n.attr("href")+"&linkloc=tn"):n.attr("href",n.attr("href")+"?linkloc=tn"));n.text()===previousTarget&&tabletUserCheck&&(window.location=n.attr("href"));previousTarget=n.text()}function hideAll(){$("#menu li > div").hide()}function hideMore(){$("#More").hide()}function displayHours(){var i=new Date,f=i.getHours(),n=i.getFullYear(),r=i.getMonth(),t=i.getDate(),u=i.getDay();if($("#sHours").hide(),strShortName!="lfp")switch(u){case 1:case 2:3<=ATGTime&&ATGTime<=22&&($("#sHours").show(),$("#popTime").show());break;case 3:n==2014&&t==24&&r==11?4<=ATGTime&&ATGTime<=12&&($("#sHours").show(),$("#popTime").show()):n==2014&&t==31?4<=ATGTime&&ATGTime<=15&&($("#sHours").show(),$("#popTime").show()):3<=ATGTime&&ATGTime<=22&&($("#sHours").show(),$("#popTime").show());break;case 4:(n=2014&&t==25&&r==11)?($("#sHours").hide(),$("#popTime").hide()):n==2015&&t==1&&r==0?5<=ATGTime&&ATGTime<=14&&($("#sHours").show(),$("#popTime").show()):3<=ATGTime&&ATGTime<=22&&($("#sHours").show(),$("#popTime").show());break;case 5:(n=2014&&t==26&&r==11)?strShortName=="lowesca"?4<=ATGTime&&ATGTime<=23&&($("#sHours").show(),$("#popTime").show()):strShortName=="atgs"&&4<=ATGTime&&ATGTime<=21&&($("#sHours").show(),$("#popTime").show()):(n=2015&&t==24&&r==3&&strShortName=="lowesca")?ATGTime>=20&&($("#sHours").show(),$("#popTime").show()):3<=ATGTime&&ATGTime<=22&&($("#sHours").show(),$("#popTime").show());break;case 0:case 6:ATGTime>=5&&ATGTime<=20&&($("#sHours").show(),$("#popTime").show())}else $("#sHours").show()}function getTime(n){var i=(new Date).getTimezoneOffset(),t;return(i=7-i/60,t=n+i,t>24)?t-24:t<0?t+24:t}function hideHours(){$("#sHours").hide();$("#popTime").hide()}function navTopBottomResponsive(){if(window.location.pathname.indexOf("dailydeals")>-1){$("body").addClass("js");var r=$("#menu1"),n=$(".menu-link1"),u=$(".has-submenu > a");n.click(function(t){t.preventDefault();n.toggleClass("active");r.toggleClass("active")});u.click(function(n){n.preventDefault();var t=$(this);t.toggleClass("active").next("ul").toggleClass("active")});var f=$("#menu2"),t=$(".menu-link2"),e=$(".has-submenu > a");t.click(function(n){n.preventDefault();t.toggleClass("active");f.toggleClass("active")});e.click(function(n){n.preventDefault();var t=$(this);t.toggleClass("active").next("ul").toggleClass("active")});var o=$("#menu3"),s=$(".menu-link3"),h=$(".has-submenu > a");n.click(function(n){n.preventDefault();s.toggleClass("active");o.toggleClass("active")});h.click(function(n){n.preventDefault();var t=$(this);t.toggleClass("active").next("ul").toggleClass("active")});var c=$("#menu4"),i=$(".menu-link4"),l=$(".has-submenu > a");i.click(function(n){n.preventDefault();i.toggleClass("active");c.toggleClass("active")});l.click(function(n){n.preventDefault();var t=$(this);t.toggleClass("active").next("ul").toggleClass("active")});$("#menu-toggle").click(function(n){$("#menu").toggleClass("open");n.preventDefault()})}}function setCookie(n,t,i){var r=new Date,u;r.setTime(r.getTime()+i*31536e6);u="expires="+r.toGMTString();document.cookie=n+"="+t+"; "+u}function getCookie(n){for(var r=n+"=",u=document.cookie.split(";"),t,i=0;i<u.length;i++){for(t=u[i];t.charAt(0)==" ";)t=t.substring(1);if(t.indexOf(r)!=-1)return t.substring(r.length,t.length)}return""}function addEvent(n,t,i){n.addEventListener?n.addEventListener(t,i,!1):n.attachEvent&&n.attachEvent("on"+t,i)}function addMouseOutFeature(){var i=0,n=0,t=!0;addEvent(document,"mouseout",function(r){if(i=r.pageX,n=r.pageY,!(n>=0)||!(n<=window.innerHeight)){var u=r.relatedTarget||r.toElement;!u&&t&&strShortName=="atgs"&&(openPopBox(520,430,"<iframe width='520' height='430' frameborder='0' scrolling='no' src='/marketing/exitpop-up.aspx'><\/iframe>"),t=!1,SetCookie("returningcustomer","yes",100))}})}function StartShowPopup(){var n,t,i;try{n=readQuery("et_cid",!1);t=readQuery("et_rid",!1);n==null&&t==null?checkCookie():(i=getCookie("returningcustomer"),i==""&&SetCookie("returningcustomer","yes",100))}catch(r){}}function checkCookie(){if(checkIfCookiesEnabled()){var n=getCookie("returningcustomer");n==""&&window.setTimeout(addMouseOutFeature,1e3)}}function checkIfCookiesEnabled(){var n=navigator.cookieEnabled;return typeof n!="undefined"||n||(document.cookie="checkCookie",n=document.cookie.indexOf("testcookie")!=-1),n}function switch_style(n){for(var t=0,i=document.getElementsByTagName("link");t<i.length;t++)i[t].rel.indexOf("stylesheet")!=-1&&i[t].title&&(i[t].disabled=!0,i[t].title==n&&(i[t].disabled=!1)),n==="searchListStyle"?$(".searchInfo").show():$(".searchInfo").hide(),strTid!=""?set_cookie(style_cookie_nameType,n,style_cookie_duration):set_cookie(style_cookie_name,n,style_cookie_duration)}function set_cookie(n,t,i,r){var u=r?"; domain="+r:"";document.cookie=n+"="+encodeURIComponent(t)+"; max-age="+86400*i+"; path=/"+u}function showFilterGroups(n){var t=document.getElementById("divFilters"),i=document.getElementById("divFilter");if(typeof n=="boolean"){t.className=n?"":"expArea";return}t.className.indexOf("expArea")!=-1?(t.className="",i.className!="expArea"&&(i.className="expArea")):t.className="expArea"}function showSortGroup(n){var t=document.getElementById("divFilter"),i=document.getElementById("divFilters");if(typeof n=="boolean"){t.className=n?"":"expArea";return}t.className.indexOf("expArea")!=-1?(t.className="",i.className!="expArea"&&(i.className="expArea")):t.className="expArea"}function searchShowMore(n){var i,r,t,u;for(ul=document.getElementById("searchSort_"+n),i=ul.getElementsByTagName("LI"),r=[],t=0,u=i.length;t<u;t++)r[t]=[],r[t][0]=i[t].innerHTML,r[t][1]=i[t].id;for(n!="attr_averagereview"&&r.sort(filterSortNum),t=0,u=i.length;t<u;t++)i[t].innerHTML=r[t][0],i[t].id=r[t][1];ul.className="";a=document.getElementById("searchFilterLink_"+n);a!=null&&(a.innerHTML="show less",a.onclick=new Function("searchShowLess('"+n+"')"));divT=document.getElementById("div_"+n);divT.onclick=new Function("searchShowLess('"+n+"')")}function mobileCatalogFilterToggle(){$(".subfilter").click(function(){$(".filterImgPlus",this).toggleClass("filterImgMinus")})}function filterSortNum(n,t){var e=/>[^<>]+</,i=decodeURIComponent(n[0].match(e)[0].replace("%","")),r=decodeURIComponent(t[0].match(e)[0].replace("%","")),o=filterHasNumber(i),s=filterHasNumber(r),h=1,c=1,u,f;return i.indexOf("ft")!=-1&&(h=12),r.indexOf("ft")!=-1&&(c=12),o&&s?(u=filterGetNumber(i)*h,f=filterGetNumber(r)*c,u>f?1:f>u?-1:0):o?-1:s?1:i.localeCompare(r)}function filterHasNumber(n){return/^.{0,3}[0-9]+.*|^.{0,3}Over.{0,3}[0-9]+.*/g.test(n)}function filterGetNumber(n){return parseFloat(n.match(/[0-9]+\.?[0-9]*/)[0])}function searchShowLess(n){var r,i,e,f,t,u;for(ul=document.getElementById("searchSort_"+n),r=ul.getElementsByTagName("LI"),i=[],t=0,u=r.length;t<u;t++)i[t]=[],i[t][0]=r[t].innerHTML,i[t][1]=r[t].id;for(e=/>[^<>]+</,n!="attr_averagereview"&&(f=decodeURIComponent(i[0][0].match(e)[0].replace("%",""))),n=="attr_price"||f==""||filterHasNumber(f)?n!="attr_averagereview"&&i.sort(filterSortNum):i.sort(function(n,t){return t[1]-n[1]}),t=0,u=r.length;t<u;t++)r[t].innerHTML=i[t][0],r[t].id=i[t][1];ul.className="searchShortList";a=document.getElementById("searchFilterLink_"+n);a!=null&&(a.innerHTML="show more",a.onclick=new Function("searchShowMore('"+n+"')"));divT=document.getElementById("div_"+n);divT.onclick=new Function("searchShowMore('"+n+"')")}function callSearchHelp(n,t,i,r,u){return $.ajax({url:"/ajax/searchHelplful.ashx",contentType:"application/json; charset=utf-8",data:{helpType:n,term:t,site:i,url:r,ipAddress:u},responseType:"json",success:OnComplete}),!1}function OnComplete(n){$("#divHelp").html(n)}function getUrlVars(){var n={},t=window.location.href.replace(/[?&]+([^=&]+)=([^&]*)/gi,function(t,i,r){n[i]=r});return n}function clearNonContent(){attribute!=null&&attribute!=""&&($("#divNonContent").addClass("displayn"),$("#divHelp").addClass("displayn"))}function hideNonContent(n){$("#divPopularCategories")!=null&&(n!=1?(typeof strShortName!="undefined"&&strShortName!="lowesca"&&$("#divNonContent").addClass("displayn"),$("#divPopularCategories").addClass("displayn"),$("#divPopularCategories").html(""),$("#divRecentReviews").addClass("displayn"),$("#divCatArticle").addClass("displayn")):(typeof strShortName!="undefined"&&strShortName!="lowesca"&&$("#divNonContent").addClass("displayn"),$("#divPopularCategories").removeClass("displayn"),divPopularCategoriesValue!=null&&divPopularCategoriesValue!="undefined"&&$("#divPopularCategories").html(divPopularCategoriesValue),$("#divRecentReviews").removeClass("displayn"),$("#divCatArticle").removeClass("displayn")));$("#SearchProdFind")!=null&&(n!=1?$("#SearchProdFind").addClass("displayn"):$("#SearchProdFind").removeClass("displayn"),$("#divSearchBBQParts")!=undefined&&$("#divSearchBBQParts").html()=="945"&&$("#SearchProdFind").removeClass("displayn"))}function getQuery(n){var t="p="+n.toString()+"&q="+strSearchTerm;return strTidJs!=""&&(t+="&tid="+strTidJs),strMfrIdJs!=""&&(t+="&mfr="+strMfrIdJs),strStIdJs!=""&&(t+="&st="+strStIdJs),t}function preloadPage(n){var i,t;n<1||(i=getQuery(n),strNewPageQ=getPageUrlCatalog(n),strNewPageQ.indexOf("/search/")==-1?arrPreLoadedPages[strNewPageQ]||(t=new ajaxRequestObject("/ajaxcache/SphinxHandler.ashx",i,preloadPageAjax,n),t.doGetCallback()):arrPreLoadedPages[n]||(t=new ajaxRequestObject("/ajaxcache/SphinxHandler.ashx",i,preloadPageAjax,n),t.doGetCallback()))}function preloadPageAjax(data,intPage){var matches,arrImages,i,match,strImg;try{if(strNewPageQ=getPageUrlCatalog(intPage),matches=null,strNewPageQ.indexOf("/search/")==-1?arrPreLoadedPages[strNewPageQ]||(arrPreLoadedPages[strNewPageQ]=eval(data),matches=arrPreLoadedPages[strNewPageQ]):arrPreLoadedPages[intPage]||(arrPreLoadedPages[intPage]=eval(data),matches=arrPreLoadedPages[intPage]),arrImages=[],matches!=null)for(i=0;i<matches.length;i++)match=matches[i],strImg=getCatImg(match),arrImages[i]=new Image,arrImages[i].src="//images.atgstores.com/img/i/"+match.mfr_id.toString()+"/"+strImg}catch(e){}}function getPageUrlCatalog(n){var e,s,i,r,u,f,t,o;strNewPageQ=document.URL;e="";s="";try{if(strNewPageQ.indexOf("linkloc=")>-1||strNewPageQ.indexOf("recanonical=")>-1){for(i=strNewPageQ.replace("?linkloc","&linkloc").replace("?recanonical","&recanonical"),r=i.split("&"),t=0;t<r.length;t++)(r[t].indexOf("linkloc")>-1||r[t].indexOf("recanonical")>-1)&&(i=i.replace("&"+r[t],""));strNewPageQ=i.replace("/&","/?")}if(u="?p=",(strNewPageQ.indexOf("&p=")>-1||strNewPageQ.indexOf("?p=")==-1&&strNewPageQ.indexOf("?")>-1)&&(u="&p="),strNewPageQ.indexOf("?p=")==-1&&strNewPageQ.indexOf("&p=")==-1)strNewPageQ=strNewPageQ+u+n.toString();else{for(f=strNewPageQ.substring(strNewPageQ.indexOf("?")+1,strNewPageQ.length).split("&"),t=0;t<f.length;t++)if(f[t].indexOf("p=")>-1&&f[t].substr(0,2)=="p="){e=f[t].replace("p=","");break}e!=""&&(o=u+e,strNewPageQ=strNewPageQ.replace(o,u+n.toString()))}}catch(h){}return strNewPageQ}function searchChangePage(n,t){var r=document.getElementById("divMfrDetail"),u,s,t,h,f,c,i,e,o;r&&(n==0||n==1?$(r).removeClass("displayn"):$(r).addClass("displayn"));u=document.getElementById("divObsoleteProd");n==1||n==0||!u||$(u).addClass("displayn");window.scrollTo(0,0);strShortName=="lfp"&&document.URL.lastIndexOf("/search/")!=-1&&document.getElementById("litResult")&&(document.getElementById("litResult").style.visibility="visible");document.getElementById("divResults").innerHTML="<br class='cfb' /><img src='//images.atgstores.com/images/layout/colorspinner.gif' style='margin-left: auto; margin-right: auto; margin-top: 32px;' class='displayb'/><div class='mglr4 fntlb txtc mgb16'>Loading&#8230;<\/div>";strNewPageQ=getPageUrlCatalog(n);arrPreLoadedPages[strNewPageQ]&&strNewPageQ.indexOf("/search/")==-1?(strOverWritePage=strNewPageQ,searchAjaxLoadPage(arrPreLoadedPages[strNewPageQ],t)):arrPreLoadedPages[n]?searchAjaxLoadPage(arrPreLoadedPages[n],t):(s=getQuery(n),typeof t=="undefined"&&(t=!0),strNewPageQ.indexOf("/search/")==-1&&(strOverWritePage=strNewPageQ),h=new ajaxRequestObject("/ajaxcache/SphinxHandler.ashx",s,searchAjaxLoadPage,t),h.doGetCallback());preloadPage(n+1);hideRelatedSearches(n);hideRelatedProducts(n);try{(document.URL.lastIndexOf("/search/")!=-1||getParameterByName("q")!=""||getParameterByName("redirectTerm")!="")&&digitalData!=null&&(digitalData.search.attributes.listPageNumber=n.toString(),f=digitalData.search.attributes.resultsPageNumber,c=f.replace(/(^\d+)(.+$)/i,"$1"),digitalData.search.attributes.resultsPageNumber=f.replace(c,n),_satellite.track("searchPageNumber"))}catch(l){}strShortName&&(strShortName=="atgs"||strShortName=="lowesca")&&(strShortName&&strShortName==="atgs"&&(n!==1?($("#CatalogSEODesc").addClass("displayn"),$("#divCompleteYourProject").addClass("displayn")):($("#CatalogSEODesc").removeClass("displayn"),$("#divCompleteYourProject").removeClass("displayn"))),hideCategoryDesc());try{digitalData!=null&&digitalData.search.attributes.searchTerm!=null&&getParameterByName("p")!=null&&(i=document.getElementById("divMsgPage").innerHTML,digitalData.search.attributes.listPageNumber=n,i!=null&&i!=""&&(e=i.split(" "),e.length==6&&(o=e[4].replace(",",""),digitalData.search.attributes.numberSearchResults=o,digitalData.search.attributes.resultsPageNumber=digitalData.search.attributes.listPageNumber+" of "+Math.ceil(parseInt(o)/parseInt(digitalData.search.attributes.resultsPerPage)).toString())))}catch(l){}}function searchHistoryChange(n){var o=strCurrentPage,s,i,h,u,t,f,e,r,c;if(strCurUrlFilt=document.URL,s=document.location.origin,strCurUrlFilt=strCurUrlFilt.replace(s,""),strCurrentPage=="0"&&(strCurrentPage="1"),n.state){if(i=n.state.strPage,i=="0"&&(i="1"),i&&i!=strCurrentPage)strCurrentPage=i;else if(!strCurUrlFilt||strCurUrlFilt.indexOf("p=")!=-1||strCurUrlFilt.indexOf("/search/")!=-1)return}else return;if((strCurUrlFilt.indexOf("p=")==-1||o=="undefined")&&arrObjFilters[strCurUrlFilt]&&arrObjFilters[strCurUrlFilt]!="")strHistoryBaseLink==strCurUrlFilt?hideNonContent(1):strCurUrlFilt!=null&&strCurUrlFilt!=""&&strCurUrlFilt.indexOf("?linkloc=")>-1&&strCurUrlFilt.indexOf("&")==-1&&(h=strCurUrlFilt.split("?"),strHistoryBaseLink==h[0]&&hideNonContent(1)),searchAjaxLoadPageFilter(arrObjFilters[strCurUrlFilt]);else if(strCurUrlFilt.indexOf("/search/")==-1&&strCurUrlFilt.indexOf("p=")==-1||o=="undefined"&&strHistoryBaseLink)updateSearchFilters("",strCurUrlFilt,strHistoryBaseLink,"true");else if(strCurUrlFilt.indexOf("/search/")==-1){for(strNewFilterHistory=strCurrentPage,u=strNewFilterHistory,t=strCurUrlFilt.replace("?p=","&p="),hideNonContent(2),f=t.split("&"),e="",r=0;r<f.length;r++)if(f[r].substr(0,2)=="p="){e=f[r].replace("p=","");break}t=t.replace("&p="+e,"");arrObjFilters[t]!=""&&arrObjFilters[t]?searchAjaxLoadPageFilter(arrObjFilters[t]):updateSearchFilters("",strCurUrlFilt,strHistoryBaseLink,"true");searchChangePage(parseInt(u),!1);c=NUMBER_OF_OBJECT_PER_PAGE*(parseInt(u)-1)+NUMBER_OF_OBJECT_PER_PAGE;document.getElementById("divMsgPage").innerHTML=NUMBER_OF_OBJECT_PER_PAGE*(parseInt(u)-1)+1+" - "+c+" of "+addCommas(parseInt(strNumResults))+"<span id='hideResultsMob' class='fntsi mgl4'> Results<\/span>"}else searchChangePage(parseInt(strCurrentPage),!1)}function searchAjaxLoadPage(data,setHistory){var strHistoryLinkNew,bazaarVoiceProductIDs,strProducts,strPage,strRemoving,strPageSplitRM,i,newState,queryPageIndex,windowLocation;try{for(typeof data=="string"?arrProducts=eval(data):typeof data=="object"&&(arrProducts=data),strHistoryLinkNew=strHistoryLink,strHistoryLinkNew==""&&strCurUrlFilt!=""&&(strHistoryLinkNew=strCurUrlFilt),strOverWritePage!=""&&data!=null&&document.URL.indexOf("/search/")==-1&&(strHistoryLinkNew==""&&(strHistoryLinkNew=strOverWritePage),arrPreLoadedPages[strOverWritePage]||(arrPreLoadedPages[strOverWritePage]=eval(data),strOverWritePage="")),arrObjMainProd[strHistoryLinkNew]?data==null&&(data=arrObjMainProd[strHistoryLinkNew],typeof data=="string"?arrProducts=eval(data):typeof data=="object"&&(arrProducts=data)):arrObjMainProd[strHistoryLinkNew]=data,document.URL.indexOf("/search/")==-1&&(data==null||data=="[]")&&strHistoryBaseLink!=""&&window.location.replace(strHistoryBaseLink+"?filter=failed"),divSkuList.innerHTML="",clearSkuPriceHandlers(),bazaarVoiceProductIDs="",strProducts="",arrAttrNames=getQueryStringAttrNameArr(),i=0;i<arrProducts.length;i++)strProducts+=searchLoadItem(arrProducts[i],i),strShortName=="lowesca"&&(bazaarVoiceProductIDs+=BuildBazaarVoiceDelimitedList(arrProducts[i]));if(document.getElementById("divResults").innerHTML="<div class='l width4of4'>"+strProducts+"<\/div>",strShortName=="lowesca"&&CallBazaarVoiceService(bazaarVoiceProductIDs),searchSetPaging(),strPage=window.location.pathname+window.location.search,window.location.search!=""&&document.URL.indexOf("/search/")==-1&&(window.location.search.indexOf("linkloc")>-1||window.location.search.indexOf("recanonical")>-1)){for(strRemoving=strPage.replace("?linkloc","&linkloc").replace("?recanonical","&recanonical"),strPageSplitRM=strRemoving.split("&"),i=0;i<strPageSplitRM.length;i++)(strPageSplitRM[i].indexOf("linkloc")>-1||strPageSplitRM[i].indexOf("recanonical")>-1)&&(strRemoving=strRemoving.replace("&"+strPageSplitRM[i],""));strPage=strRemoving.replace("/&","/?")}strPage.indexOf("p=")!=-1?strPage=strPage.replace(/p=[0-9]*/,"p="+strCurrentPage):strCurrentPage!="0"&&(strPage+=strPage.indexOf("?")!=-1?"&p="+strCurrentPage:"?p="+strCurrentPage);strCurrentPage!=0&&(typeof setHistory=="undefined"||setHistory)&&(window.history.pushState?(newState={strPage:strCurrentPage},window.history.pushState(newState,"page "+strCurrentPage,strPage)):window.location.hash="page"+strCurrentPage);showPriceDivs();getAjaxPrices();SetCompareItemStatus()}catch(SphinxHandlerException){window.location.href.indexOf("&p=")>-1||window.location.href.indexOf("?p=")>-1?(queryPageIndex="&p=",window.location.href.indexOf("?p=")>-1&&(queryPageIndex="?p="),windowLocation=window.location.href,windowLocation=windowLocation.substr(0,windowLocation.indexOf(queryPageIndex))+queryPageIndex+strCurrentPage,windowLocation.length!==window.location.href.length&&(windowLocation+=window.location.href.substr(windowLocation.length,window.location.href.length=windowLocation.length)),window.location.href=windowLocation):window.location.href=window.location.href.indexOf("?")===-1?window.location.href+"?p="+strCurrentPage:window.location.href+"&p="+strCurrentPage}}function getPageLink(n,t){var i="";return(NUMBER_OF_OBJECT_PER_PAGE=="80"||NUMBER_OF_OBJECT_PER_PAGE=="200")&&(i="&perpage="+NUMBER_OF_OBJECT_PER_PAGE),n.indexOf("?")!==-1?n+"&p="+t.toString()+i:n+"?p="+t.toString()+i}function searchSetPaging(){var r=parseInt(strNumResults),n=parseInt(strCurrentPage),i=Math.floor(r/NUMBER_OF_OBJECT_PER_PAGE),f,t;r%NUMBER_OF_OBJECT_PER_PAGE>0&&(i+=1);n==0&&(n=1);f=NUMBER_OF_OBJECT_PER_PAGE*(n-1)+NUMBER_OF_OBJECT_PER_PAGE;strAttribute!=""&&(strAttribute="&atb="+strAttribute);strTid!=""&&(strAttribute+=strTid);strCustomAttr!=""&&(strMfrIdJs!=""&&(strAttribute+="&mfr="+strMfrLink),strStIdJs!=""&&(strAttribute+="&st="+strStyleLink));f>r&&(f=r);var e=n-3,o=n+3,u="",s="",h="",c="/search/default.aspx?q="+encodeURIComponent(strQueryTerm)+strAttribute;for(e<2&&(e=2),o>i&&(o=i),u+=n==1?'<strong class="fntlb pdr16">1<\/strong>':'<a href="'+getPageLink(strUrl,1)+'" onclick="if(event && event.preventDefault) { event.preventDefault(); } strCurrentPage = \'1\'; searchChangePage(1); hideNonContent(1); return false;" class="pdr16">1<\/a>',e>2&&(u+='<strong class="fntlb pdr16">&hellip;<\/strong>'),t=e;t<=o;t++)u+=t==n?'<strong class="fntlb pdr16">'+t+"<\/strong>":'<a href="'+getPageLink(strUrl,t)+'" onclick="if(event && event.preventDefault) { event.preventDefault(); } strCurrentPage = '+t+"; searchChangePage("+t+"); hideNonContent("+t+'); return false;" class="pdr16">'+t+"<\/a>";o<i&&i>n+2&&i>5&&(u+='<strong class="fntlb pdr16">&hellip;<\/strong>');n>1&&(s='<a href="'+getPageLink(strUrl,n-1)+'" onclick="if(event && event.preventDefault) { event.preventDefault(); } strCurrentPage = '+(n-1)+"; searchChangePage("+(n-1)+"); hideNonContent("+(n-1)+'); return false;" class="pdr16 prev pr" rel="prev">< Prev<\/a>');n<i&&(h='<a href="'+getPageLink(strUrl,n+1)+'" onclick="if(event && event.preventDefault) { event.preventDefault(); } strCurrentPage = '+(n+1)+"; searchChangePage("+(n+1)+"); hideNonContent("+(n+1)+'); return false;" class="pdr16 next pr" rel="next">Next ><\/a>');document.getElementById("divBtnPageBtm").innerHTML=s+u+h;document.getElementById("divMsgPage").innerHTML=NUMBER_OF_OBJECT_PER_PAGE*(n-1)+1+" - "+f+" of "+addCommas(r)+"<span id='hideResultsMob' class='fntsi mgl4'> Results<\/span>"}function addCommas(n){n+="";x=n.split(".");x1=x[0];x2=x.length>1?"."+x[1]:"";for(var t=/(\d+)(\d{3})/;t.test(x1);)x1=x1.replace(t,"$1,$2");return x1+x2}function searchLoadItem(n,t){var r="",f="",ri="",u="",ui="",e="",g="",nt="",tt="",s="",yi="",fi="",ct="",p=t+1,ei="",l="",i=0,w=0,oi="",si="",hi="fntlb ",h=n.min_sku,et,b,c,it,lt,ci,rt,k,o,a,t,ut,at,vt,li,ot,d,v,st,yt,ai,ht,pt,wt,vi,y,bt,kt,dt,ft,gt,ni,ti,ii;if(n.isPartSelector==1&&(ri=""),n.hideprice.toString()=="0")if(intHasProdSet==1&&typeof n.prodsetid!="undefined"&&n.prodsetid.toString()!="0")n.prodsetprice.toString()!="0"&&(u=toCurrency(n.prodsetprice));else{if(n.minprice.toString()==n.maxprice.toString())i=n.minprice,u=toCurrency(i);else try{if(n.skuoptions!=null&&n.skuoptions.toString()!=""&&arrAttrNames.length>0){for(et=JSON.parse(n.skuoptions),t=0;t<et.length;t++){for(b=0,c=0,it=0;it<lstAttrSkuPrice.length;it++)et[t].getValue(lstAttrSkuPrice[it])!=null&&(b++,c=c=et[t].getValue(arrAttrNames[it]));b>intMaxMatchNum&&c!=0?(intMaxMatchNum=b,i=c,w=c):b!=0&&c!=0&&b==intMaxMatchNum&&((i==0||c<i)&&(i=c),(w==0||c>w)&&(w=c))}i==0?(i=n.minprice,u=toCurrency(i)+" to "+toCurrency(n.maxprice)):u=i==w?toCurrency(i):toCurrency(i)+" to "+toCurrency(w)}else i=n.minprice,u=toCurrency(i)+" to "+toCurrency(n.maxprice)}catch(pi){i=n.minprice;u=toCurrency(i)+" to "+toCurrency(n.maxprice)}n.priceperunit!="undefined"&&n.priceperunit!="0"&&n.uom!="undefined"&&n.uom!=""&&(n.uom!=""&&n.uom.indexOf("start")>-1||n.minprice.toString()!=n.maxprice.toString()?ct="<div class='fnts cg' style='display: inline-block'>(Starts at $"+toCurrency(n.priceperunit)+" "+n.uom.toString().replace("starts","")+")<\/div>":(ct="<div class='l fntlb mgt4 txtCap'>$"+toCurrency(n.priceperunit).replace("$","")+"&nbsp;/&nbsp;"+n.uom+"<\/div>",oi="<div class='cfb l fntsb'>Purchase Price:&nbsp;<\/div>",si="<div class='l fntsb'>&nbsp;/&nbsp;Linear Ft.<\/div>",hi="fntsb "),yi="true")}else isIe8JS==!0&&strShortName=="lfp"||(tt="Add to cart to see price",typeof n.hideprice!="undefined"&&typeof n.hidepricereason!="undefined"&&(n.hidepricereason==="2"?tt="Visit or contact your local store for price and availability":n.hidepricereason==="3"&&(tt="Contact your local store for the best price!")));ui=strShortName=="lowesca"?InjectBazaarVoiceDiv(n.group_id):reviewClass(n.averagereview,n.reviewcount.toString());lt="";lt=intHasProdSet==1&&typeof n.prodsetid!="undefined"&&n.prodsetid.toString()!="0"?canonicalLink(n.type_desc.toString(),n.type_id.toString(),"","0","","0",n.title,n.group_id)+"?isProdSet=1&prodsetid="+n.prodsetid.toString():canonicalLink(n.type_desc.toString(),n.type_id.toString(),"","0","","0",n.cleantitle,n.group_id);var di=canonicalLink("","0","","0",n.attr_brand,n.mfr_id),wi=getCatImg(n);n.finishcount!=null&&n.finishcount>1&&n.sizecount!=null&&n.sizecount>1?g+="<div class='fnts l pa txtc nwSrchOpts'>More Colors & Sizes Available<\/div>":n.finishcount!=null&&n.finishcount>1?g+="<div class='fnts l pa txtc nwSrchOpts'>More Colors Available<\/div>":n.sizecount!=null&&n.sizecount>1?g+="<div class='fnts l pa txtc nwSrchOpts'>More Sizes Available<\/div>":n.skucount!=null&&n.skucount>1&&(g+="<div class='fnts l pa txtc nwSrchOpts'>More Options Available<\/div>");try{if(strShortName=="lowesca"?n.pricetype==100?(u!=""&&u.indexOf("to")==-1&&n.wasprice>0&&(f+=formatWasPrice(n.minprice.toString(),n.wasprice,h)),l="Regular price"):n.pricetype==101?(e="<div class='spriteAtg svsm topLeft bannerStyle'><\/div>",u!=""&&u.indexOf("to")==-1&&n.wasprice>0&&n.enddateca!=undefined&&n.enddateca.toString()!="1900-01-01"?f+=formatWasPriceDate(n.minprice.toString(),n.wasprice,n.enddateca.toString(),h):u!=""&&u.indexOf("to")==-1&&n.wasprice>0&&(f+=formatWasPrice(n.minprice.toString(),n.wasprice,h)),l="Special value"):n.pricetype==102?(e="<div class='spriteAtg cspmsm topLeft bannerStyle'><\/div>",l="Competative price match",u!=""&&u.indexOf("to")==-1&&n.wasprice>0&&n.enddateca!=undefined&&n.enddateca.toString()!="1900-01-01"&&(f+=formatWasPriceDate(n.minprice.toString(),n.wasprice,n.enddateca.toString(),h))):n.pricetype==103?(e="<div class='spriteAtg sbsm topLeft bannerStyle'><\/div>",l="Special buy"):n.pricetype==104?(e="<div class='spriteAtg specialprice topLeft bannerStyle'><\/div>",n.wasprice>0&&(ei="crd",f+="<div class='fnts pdr8 cg'>List Price:  <strike class='fnts pdr8 '>"+toCurrency(n.wasprice)+"<\/strike><\/div>"),l="Special price"):n.pricetype==1&&n.wasprice>n.minprice?(e="<div class='spriteAtg nlpsm topLeft bannerStyle'><\/div>",l="New lower price",u!=""&&u.indexOf("to")==-1&&n.wasprice>0&&(f+=formatWasPrice(n.minprice.toString(),n.wasprice,h,!0))):n.pricetype==2?(e="<div class='spriteAtg clearance topLeft bannerStyle' ><\/div>",l="Clearance",u!=""&&u.indexOf("to")==-1&&n.wasprice>0&&(f+=formatWasPrice(n.minprice.toString(),n.wasprice,h))):n.pricetype==0&&n.pricetype==1?r+="<div class='spriteAtg new topLeft bannerStyle'><\/div>":n.ismfrtopseller!=null&&n.ismfrtopseller:strShortName!="atgs"||n.isPartSelector||n.hideprice||n.mustcalltopurchase||n.mfr_id.toString()=="47"||n.hidesavings||!((n.msrp-i)/n.msrp>=.01)?strShortName=="lfp"&&(n.wasprice!=""&&n.wasprice!=0&&i!=""&&i!=0&&(rt=100-i/n.wasprice*100,rt=Math.round(rt)),n.wasprice!=0&&n.wasprice>i&&(f+='<div id="was'+h.toString()+"\" class='fnts displayb'>Was "+toCurrency(i)+"<\/div>",f+=n.enddate!=null&&n.enddate!=""?'<div id="save'+h.toString()+"\" class='crd fnts cfb displayi'>Save "+rt+"% Thru"+n.enddate+"<\/div>":'<div id="save'+h.toString()+"\" class='crd fnts cfb displayi'>Save "+rt+"%<\/div>")):n.wasprice!=0&&n.wasprice>i?f+=formatWasPrice(i.toString(),n.wasprice,h):(ci=100*(n.msrp-i)/n.msrp,f+="<div class='cg fnts youSavePrice'>Save up to "+Math.round(ci)+"%<\/div>"),strShortName=="atgs"&&(n.guaranteedbuy&&n.guaranteedbuy>0?n.guaranteedbuy===25267?e="<div class='spriteAtg thanksgiving topLeft pa'><\/div>":n.guaranteedbuy===22875&&(e="<div class='spriteAtg christmas topLeft pa'><\/div>"):n.newprod!=null&&n.newprod?e="<div class='spriteAtg new topLeft bannerStyle'><\/div>":n.onsale!=null&&n.onsale?e="<div class='spriteAtg sale topLeft bannerStyle'><\/div>":n.ismfrtopseller!=null&&n.ismfrtopseller&&(e="<div class='spriteAtg topseller topLeft bannerStyle'><\/div>")),n.getkeyfeatures!=null&&n.getkeyfeatures!="")for(o=n.getkeyfeatures.toString().split(","),a=o.length,a>2&&(a=2),t=0;t<a;t++)ut=o[t].indexOf("|"),ut>-1&&o[t].split("|")[0].length<20&&(t==2&&(nt+="<br class = 'hideBreak'"),nt+="<span class='fnts cg'> "+o[t].split("|")[0].replace("Hammock","")+": <\/span> <span class='fnts cg spanSearchDims'> "+o[t].split("|")[1].replace("^"," to ").replace('"',"in").replace("'","ft")+"<\/span><br class = 'hideBreak' />");else if(n.getdimensions!=null&&n.getdimensions!="")for(k=n.getdimensions.toString(),k=truncateAtChar(k.replace("X","x"),"x",48),k=k.replace("^","~"),o=k.split("-"),a=o.length,a>2&&(a=2),t=0;t<a;t++)ut=o[t].indexOf(":"),ut>-1&&(t==2&&(nt+="<br class = 'hideBreak'"),nt+="<span class='fnts cg'>"+o[t].split(":")[0]+": <\/span> <span class='fnts cg spanSearchDims'> "+o[t].split(":")[1].replace("^"," to ").replace('"',"in").replace("'","ft")+"<\/span><br class = 'hideBreak' /> ")}catch(pi){typeof console!="undefined"&&console.error(pi.toString())}at="hidden='hidden'";vt="";document.cookie.indexOf("searchListStyle")>-1&&(at="");getUrlVars().stat==="1"&&(vt="<div class='searchInfo' "+at+" style='clear:both;width:496px;background-color:lightgrey'><b>Weight:<\/b> "+n.w.toString()+"; <b>Sales Rank Normal<\/b>: "+n.salesranknormal.toString()+"; <b>Accessory<\/b>: "+n.accessory.toString()+"; <b>Type Search Weight<\/b>: "+n.typesearchweight.toString()+"; <b>Stock Status<\/b>: "+n.stockstatus.toString()+"; <b>Can Purchase<\/b>: "+n.canpurchase.toString()+"; <b>Price Ratio<\/b>: "+n.priceratio.toString()+"; <b>Total Sphinx Weigh<\/b>t: "+n.sphinxweight.toString()+"<\/div>");li=new RegExp("\\d+\\sx\\s\\d+","gmi");ot="("+strFinalTerm+")";strFinalTerm.match(li)||(ot="("+strFinalTerm.replace(" ","|")+")");d=strFinalTerm.replace(" ","|").trim();v="<b>$1<\/b>";bolProductPage=="True"&&(v="");try{d[d.length-1]=="s"&&bolProductPage=="False"&&(ot="(\\b"+d.slice(0,d.length-1)+"\\b)|(\\b"+d+"\\b)",v="<b>$1$2<\/b>")}catch(bi){postJavaError(bi)}if(st=new RegExp(ot,"gmi"),yt="",intHasProdSet==1&&typeof n.prodsetid!="undefined"&&n.prodsetid.toString()!="0"?(yt=n.prodsetname.toString().replace(st,v),s=n.prodsetname.toString()):(yt=n.cleantitle.toString().replace(st,v),s=v!=""&&strFinalTerm.toLowerCase()!=n.attr_brand.toLowerCase()?n.cleantitle.toString().replace(st,v):n.cleantitle.toString()),s!=""&&n.attr_brand!=""&&(ai=new RegExp(n.attr_brand.toString().replace(/([.*+?^=!:${}()|\[\]\/\\])/g,"\\$1"),"i"),s=s.replace(ai,"")),s!=""&&(s=s.trim().replace(/^\,+/,"").trim(),s=s.replace(/^\Inc./,"")),ht=canonicalLink(n.type_desc.toString(),n.type_id.toString(),"","0",n.attr_style.toString(),"",n.title.toString(),n.group_id,0,"","0","0","","0","0"),pt="",(strShortName=="lowesca"||strShortName=="lfp")&&n.priceType==2&&(pt="&csku="+n.min_sku.toString()),divSkuList.innerHTML+=n.min_sku.toString()+"|",setSkuPriceHandler(h.toString(),populateAjaxPrice,n.group_id.toString()),wt="",vi="",vi=intHasProdSet==1&&typeof n.prodsetid!="undefined"&&n.prodsetid.toString()!="0"?n.prodsetname.toString():n.title.toString(),wt=n.min_sku!=null&&parseInt(n.min_sku)?"<div class='r mgt4 compareadd' id='compare"+n.group_id.toString()+"'><input type='checkbox' class='mgr8' onclick=\"HandleCompareItem("+n.min_sku.toString()+", "+n.group_id.toString()+", this, '"+n.mfr_id.toString()+"/"+n.img.toString()+"')\"><span class='fnts' title='Compare'>Compare<\/span><\/div><div class='cfb'><\/div>":"<div class='r mgt4 compareadd' id='compare"+n.group_id.toString()+"'><input type='checkbox' class='mgr8' onclick=\"HandleCompareItem(0, "+n.group_id.toString()+", this, '"+n.mfr_id.toString()+"/"+n.img.toString()+"')\"><span class='fnts' title='Compare'>Compare<\/span><\/div><div class='cfb'><\/div>",r="<div class=''>",y=!1,n.stockstatus<=0&&!n.canpurchase&&n.instoreonly!=undefined&&n.instoreonly!=7)n.preorderavailondate.toString()!="1900-01-01"?(r+='<span id="spnHidePrice'+n.min_sku.toString()+"\"><button type='button' id='preOrderBtn"+n.group_id.toString()+"' class='r pr mgtb4 btnSml charcoal' onClick='genAddToCart("+n.min_sku.toString()+", 1, 0, "+n.min_sku+", "+p+");return false;'>Pre-Order<\/button><\/span>",strShortName=="lowesca"&&(n.instoreonly==7?(y=!0,r+="<div class='l fntsb'>In Store Only<\/div>"):r+=n.instoreonly==0||n.instoreonly==8?"<div class='l fntsb'>Online Exclusive<\/div>":"<div class='l fntsb'><\/div>")):strShortName!="lfp"?strShortName=="lowesca"?(n.instoreonly==7?(r+="<div class='l fntsb'>In Store Only<\/div>",y=!0):r+=n.instoreonly==0||n.instoreonly==8?"<div class='l fntsb'>Online Exclusive<\/div>":"<div class='l fntsb'><\/div>",y||(r+="<button type='button' id='notifyStockBtn"+n.group_id.toString()+"' class='r pr btnSml charcoal' onClick='notifyWhenInStock("+n.min_sku.toString()+")' >Notify Me<\/button>")):strShortName=="atgs"&&(y||(r+="<button type='button'id='notifyStockBtn"+n.group_id.toString()+"' class='r pr btnSml charcoal' onClick='notifyWhenInStock("+n.min_sku.toString()+")' >Notify Me<\/button>")):isIe8JS==!0&&strShortName=="lfp"||(r+="<div class='r pr mgtb4 fnts' style='top:-4px;'><button id='lowesChkSt"+n.group_id.toString()+"' type='button' class='l btnSml charcoal g3' href='#' onclick='updateCurProdDiv("+n.min_sku.toString()+","+n.lowesitemnum.toString()+"); openLowesStoresByQty("+n.min_sku.toString()+","+n.lowesitemnum.toString()+");'>Check Other Stores<\/button><\/div>");else if(strShortName=="lowesca"&&(n.instoreonly==7?(y=!0,r+="<div class='l fntsb'>In Store Only<\/div>"):r+=n.instoreonly==0||n.instoreonly==8?"<div class='l fntsb'>Online Exclusive<\/div>":"<div class='l fntsb'><\/div>"),bt="'"+n.min_sku.toString()+"'",strShortName=="lowesca"&&l=="''"?l="Regular price":strShortName=="lfp"&&(bt="'"+n.dtmproductid.toString()+"'"),n.ispartselector)isIe8JS==!0&&strShortName=="lfp"||(r+='<span id="spnHidePrice'+n.min_sku.toString()+"\"><button id='addCartGen"+n.group_id.toString()+"' class='r pr btnSml green hiddens' onClick='window.open('"+ht+"?linkloc=productItemsName"+pt+"')'>Add To Cart<\/button> <\/span>");else if(!n.canpurchase&&(n.stockstatus<=0||n.stockstatus==1)&&n.instoreonly==7&&strShortName!="lowesca")r+="<span class='l fntsb'>In Store Only <\/span>";else if(n.canpurchase||n.stockstatus!=1)if(n.mustcalltopurchase)u="",tt='<span class="fntlb">Call to purchase<\/span>';else if(n.min_sku>0&&n.skucount<=1)if(n.preorderavailondate!=""&&n.preorderavailondate!="1900-01-01")r+='<span id="spnHidePrice'+n.min_sku.toString()+"\"><button type='button' id='preOrderBtn"+n.group_id.toString()+"' class='r pr btnSml charcoal' onClick='genAddToCart("+n.min_sku+", 1, 0, "+n.min_sku+", "+p+");return false;'>Pre-Order<\/button><\/span>";else try{isIe8JS==!0&&strShortName=="lfp"||(r+='<span id="spnHidePrice'+n.min_sku.toString()+"\"><button type='button' id='addCartGen"+n.group_id.toString()+"' class='r pr btnSml green hiddens' onClick=\"setCartTrackingSphinx("+bt+", '"+l+"', "+u.replace("$","")+", '"+n.title.replace("'","\\'")+"', 1, "+n.min_sku+");genAddToCart("+n.min_sku+", 1, 0, '"+n.dtmproductid+"', "+p+');return false;">Add To Cart<\/button><\/span>')}catch(ki){console.log(ki.message)}else isIe8JS==!0&&strShortName=="lfp"||(r+=n.preorderavailondate!=""&&n.preorderavailondate!="1900-01-01"?'<span id="spnHidePrice'+n.min_sku.toString()+"\"><button type='button' id='preOrderBtn"+n.group_id.toString()+"' class='r pr btnSml charcoal' onClick=\"SetCookie('prodSlot', '"+n.group_id+","+p+"', 1/24);window.open('"+ht+"','_self');\">Pre-Order<\/button><\/span>":'<span id="spnHidePrice'+n.min_sku.toString()+"\"><button type='button' id='addCartGen"+n.group_id.toString()+"' class='r pr btnSml green hiddens' onClick=\"SetCookie('prodSlot', '"+n.group_id+","+p+"', 1/24);window.open('"+ht+"','_self');\">Add To Cart<\/button><\/span>");else strShortName!="lfp"?y||(r+="<button type='button' id='notifyStockBtn"+n.group_id.toString()+"' class='r pr btnSml charcoal' onClick='notifyWhenInStock("+n.min_sku.toString()+")' >Notify Me<\/button>"):isIe8JS==!0&&strShortName=="lfp"||(r+="<div class='r pr mgtb4 fnts' style='top:-4px;'><button id='lowesChkSt"+n.group_id.toString()+"' type='button' class='l btnSml charcoal g3' href='#' onclick='updateCurProdDiv("+n.min_sku.toString()+","+n.lowesitemnum.toString()+"); openLowesStoresByQty("+n.min_sku.toString()+","+n.lowesitemnum.toString()+");'>Check Other Stores<\/button><\/div>");return r+="<\/div>",f==""&&(f+="<div class='youSavePrice'><\/div>"),kt="",strShortName=="lfp"&&(fi="class='displayn hideNum'",kt="<img src='//images.atgstores.com/images/layout/blurPlaceholder1.png' class='hideBlur' />"),dt="",strShortName=="lfp"&&(dt="name='sku"+n.min_sku.toString()+"' title='"+n.lowesitemnum.toString()+"'"),ft="",(strShortName=="lowesca"||strShortName=="lfp")&&(parseInt(n.skucount)==1?(n.lowesitemnum&&n.lowesitemnum.toString()!="0"&&(ft+="<div class='fnts'><span class='fntsb'>Lowe's Item #: <\/span>"+n.lowesitemnum.toString()+"<\/div>"),n.mfr_prod_id&&n.mfr_prod_id.toString()!="0"&&(ft+="<div class='fnts'><span class='fntsb'>Model: <\/span>"+n.mfr_prod_id.toString()+"<\/div>")):ft="<div class='fntsb'>Select item for more details<\/div>"),gt=n.attr_brand,n.attr_brand.trim()=="Unbranded"&&(gt=""),ni="",strTrack!=""&&(ni="onclick=\"trackClick('"+strFinalTerm.trim()+"', '"+n.group_id.toString()+"')\""),ti="",ii="",strShortName=="lowesca"&&(ti=" priceareaLc ",ii=" srcheightLc "),"<div id='divQuick' class='bBox displayn'><\/div><div id='id"+n.group_id.toString()+"' "+dt+" class='l g5 pdr4 mgb4 mgl4 brdb pr "+ii+" srcheight' "+ri+" ><div><\/div>"+wt+g+e+"<div class='l searchImg fltns center'><a  "+ni+" href='"+lt+"' onClick=\"SetCookie('prodSlot', '"+n.group_id+","+p+"', 1/24);\"><div class='img200 txtc displayt vam'><img src='//images.atgstores.com/img/i/"+n.mfr_id.toString()+"/"+wi+"' /><\/div><div class='prodName cbl' style='max-height:56px;'><span class='strong' class='cbl' id='catBrand"+n.group_id.toString()+"'>"+gt+"<\/span><br /><span class='cbl' id='catTitle"+n.group_id.toString()+"'>"+s+"<\/span><\/div><\/a><\/div><div class='l listdes'><div class='g5' id='divSearchName'><div class='prodes'><div class='srcheightL'>"+ft+"<\/div>"+nt+"<\/div>"+ui+"<\/div><div class='fntlb mgtb4 "+ti+" pricearea'>"+kt+'<div id="divHidePrice'+n.min_sku.toString()+'"'+fi+">"+ct+oi+"<span class='"+hi+ei+"' id=\"price"+n.min_sku.toString()+'">'+u+tt+" <\/span> "+si+"<\/div>"+f+"<\/div>"+r+vt+"<\/div><\/div>"}function getCatImg(n){var t="";return intHasProdSet==1&&typeof n.prodsetid!="undefined"&&n.prodsetid.toString()!="0"?t=n.prodsetimage.toString():(t=n.img.toString(),n.imgoptstring.toString()!=""&&(t=getBestImg(n.imgoptstring.toString().toLowerCase(),n.img.toString(),n.group_id.toString()))),t}function reviewClass(n,t){var r="",i=Math.round(n*100)/100,u;return i<1.25?r="rvwStar1":i>=1.25&&i<1.75?r="rvwStar15":i>=1.75&&i<2.25?r="rvwStar2":i>=2.25&&i<2.75?r="rvwStar25":i>=2.75&&i<3.25?r="rvwStar3":i>=3.25&&i<3.75?r="rvwStar35":i>=3.75&&i<4.25?r="rvwStar4":i>=4.25&&i<4.75?r="rvwStar45":i>=4.75&&(r="rvwStar5"),r!=""&&t!="0"?(u=" reviews",t=="1"&&(u=" review"),r="<div class='fnts cgd "+r+"' style='margin: 0px 0 2px 0;'>("+t+u+")<\/div>"):r="",r}function InjectBazaarVoiceDiv(n){return strReview="<div id='BVRRInlineRating-"+n+"'><\/div>"}function BuildBazaarVoiceDelimitedList(n){return productId=n.group_id+","}function CallBazaarVoiceService(n){n=n.slice(",",-1);n=n.split(",");n!=="undefined"&&n!==""&&$BV.ui("rr","inline_ratings",{productIds:n,containerPrefix:"BVRRInlineRating"})}function getBestImg(n,t){var i=strQueryTerm,f=[],l,o,h,s,e,c,u,r;if(strAttribute!=""&&(l=/(&[a-z]+=)|([a-z]+=)|(&amp;)/gm,document.getElementById("searchH1")&&(i=document.getElementById("searchH1").innerText),document.getElementById("headTag")&&(i=document.getElementById("headTag").innerText),i!=undefined?(i=i.replace("~"," ").toLowerCase(),i=i.replace("|","").toLowerCase()):i=""),n!=""){for(o=i.split(" "),h=n.split("|"),s=0;s<h.length;s++)for(e=0;e<o.length;e++)c=h[s].split("~"),o[e].length>=3&&c.length>=2&&(c[0].toLowerCase().indexOf(o[e].toLowerCase())>=0||c[1].toLowerCase().indexOf(o[e].toLowerCase())>=0)&&f.push(h[s]);if(f.length===1)return f[0].split("~")[0];if(f.length>0)return u=[],r=[],$.each(f,function(n,t){$.inArray(t,r)===-1?r.push(t):u.push(t)}),u.length>1?(duplicateMatches2=[],r=[],$.each(u,function(n,t){$.inArray(t,r)===-1?r.push(t):duplicateMatches2.push(t)}),duplicateMatches2.length>1?(duplicateMatches3=[],r=[],$.each(duplicateMatches2,function(n,t){$.inArray(t,r)===-1?r.push(t):duplicateMatches3.push(t)}),duplicateMatches3.length>0?duplicateMatches3[0].split("~")[0]:duplicateMatches2[0].split("~")[0]):duplicateMatches2.length>0?duplicateMatches2[0].split("~")[0]:u[0].split("~")[0]):u.length>0?u[0].split("~")[0]:f[0].split("~")[0]}return t}function formatWasPrice(n,t,i,r,u){var e="",o="";typeof r===undefined&&(r=!1);u&&(o="up to ");try{var h=n.replace(/[^0-9.]/gm,""),f=0,s=parseFloat(h);t>s*1.05?(f=t-s,r||(e='<div id="save'+i.toString()+"\" class='fnts pdr8 rd crd'>Save "+o+toCurrency(f)+"<\/div>"),u||(e+='<div id="was'+i.toString()+"\" class='crd fnts'>Was "+toCurrency(t)+"<\/div>")):u&&(f=t,f>s*.05&&(e='<div id="save'+i.toString()+"\" class='fnts pdr8 crd'>Save "+o+toCurrency(f)+"<\/div>"))}catch(c){console&&console.log(c.toString())}return e}function formatWasPriceDate(n,t,i,r){var f="",s,e;try{var v=n.replace(/[^0-9.]/gm,""),o=0,c=parseFloat(v);if(t>c&&i!=undefined&&i!="1900-01-01"){s=new Date;s.getDate();var u=i.split("-"),l=new Date(u[0],u[1]-1,u[2]),h="",a=new Date;a.setDate(l.getDate()+1);s<l?(o=t-c,f='<div id="save'+r.toString()+"\" class='fnts crd'>Save "+toCurrency(o),e=[" ","Jan","Feb","March","April","May","June","July","Aug","Sept","Oct","Nov","Dec"],h=u[1].charAt(0)=="0"?u[1].substring(1):u[1],f+=" until "+e[h]+" "+u[2]+", "+u[0],f+='<\/div><div id="was'+r.toString()+"\" class='crd fnts' >Was "+toCurrency(t)+"<\/div>"):strShortName=="lowesca"&&s<a&&(o=t-c,f='<div id="save'+r.toString()+"\" class='fnts crd'>Save "+toCurrency(o),e=[" ","Jan","Feb","March","April","May","June","July","Aug","Sept","Oct","Nov","Dec"],h=u[1].charAt(0)=="0"?u[1].substring(1):u[1],f+=" until "+e[h]+" "+u[2]+", "+u[0],f+='<\/div><div id="was'+r.toString()+"\" class='crd fnts' >Was "+toCurrency(t)+"<\/div>")}}catch(y){console&&console.log(y.toString())}return f}function cartLoginPopup(n){openPopBox(450,180,"<iframe class=noFrames frameborder=0 height=190 width=450 src=../localpros/lfpLogin.aspx?doAnother=true&doReturn="+n+" ><\/iframe>")}function addLinkLoc(){}function clickFromCheckBoxSearch(n,t,i){var f=[],rt=[],r=fullSafeJSPageUrl,u="&atb=",o="",lt="",at="",a="",ut=[],b="",k="",y="",p="",vt=getUrlVars().linkloc,yt=getUrlVars().filter,pt=getUrlVars().fndrbx,ri=getUrlVars().perpage,h=getUrlVars().q,wt="",s="",bt=!1,kt,ft,dt,et,c,d,st,tt,g,nt,w,ht,ct,e,l,v,it;try{searchFilterAnalytics(n)}catch(ui){}if(vt!=null&&(r=r.replace("linkloc="+vt,"")),yt!=null&&(r=r.replace("filter="+yt,"")),pt!=null&&(r=r.replace("fndrbx="+pt,"")),r.indexOf("sort=")>-1&&(kt=r.split("sort="),ft=kt[1].split("&"),y="&sort="+ft[0].toString(),r=r.replace("sort="+ft[0].toString(),"")),r.indexOf("perpage=")>-1&&(dt=r.split("perpage="),et=dt[1].split("&"),p="&perpage="+valCatPerPage(et[0].toString()),r=r.replace("perpage="+et[0].toString(),"")),r.indexOf("p=")>-1){var gt=r.split("p="),ni=gt[1].split("&"),ot="p="+ni[0].toString();r=r.replace(ot,"")}if(r.indexOf("_oa")>-1){var ti=r.split("_oa"),ii=ti[1].split(".html"),ot="_oa"+ii[0].toString();r=r.replace(ot,"")}else r.indexOf("option0=optionA=")>-1?(c=r.split("option0=optionA="),r=c[0].toString()):r.indexOf("option0=")>-1&&(c=r.split("option0="),r=c[0].toString(),c.length>1&&c[1]!=null&&c[1]!=""&&(d=c[1].toString().split("&"),r+="&"+d[1].toString(),d[2]!=null&&d[2]!=""&&(r+="&"+d[2].toString())));if(r=r.replace("?instock=true","").replace("&instock=true","").replace("?inStock","").replace("&inStock",""),r=r.replace("attr_",""),r.indexOf("/search/")<0&&r.indexOf("/collections/")<0&&(ut=r.split(".html"),ut[0].indexOf("_m")>-1?a="brand":ut[0].indexOf("_s")>-1&&(a="style"),strMfrIdJs!=""&&(b=strMfrIdJs.replace(/%2c/g,","),b.substring(0,1)==","&&(b=b.substring(1)),r=r.replace("mfr="+b,"")),strStIdJs!=""&&(k=strStIdJs.replace(/%2c/g,","),k.substring(0,1)==","&&(k=k.substring(1)),r=r.replace("st="+k,""))),$("input[type=checkbox][onclick*='clickFromCheckBoxSearch']:checked").each(function(){f.push($(this).val())}),f.length==0&&i&&$("input[type=checkbox][onclick*='updateSearchFilters']:checked").each(function(){f.push($(this).val())}),f.sort(),st=document.getElementById("tbxLowPrice"),tt=document.getElementById("tbxHighPrice"),validatePriceRange(),g=!1,tt!=null&&(nt=tt.value,w=st.value,nt!=""&&w==""&&(w="0"),w!=""&&nt!=""))if(ht=parseFloat(w),ct=parseFloat(nt),ht>=0&&ct>=0&&ht<=ct)u+="price-range=$"+w+"-to-$"+nt+"~",g=!0;else{st.value="";tt.value="";return}for(e=0;e<f.length;e++)g&&(f[e].indexOf("attr_price")==0||f[e].indexOf("price=")==0)||f[e].indexOf("inStock")==0||(a==""?(f[e].toString().indexOf("attr_brand")>-1?u+=f[e].toString().replace("&","%26").replace("%2a","%26").replace("*","%26").toLowerCase()+"~":f[e].toString().indexOf("sTerm")==-1&&(u+=f[e].toString().replace("&","%26").replace("%2a","%26").replace("*","%26").toLowerCase()+"~"),i!=null&&i!=""&&g&&f[e].indexOf("price-range")==0?u=u.replace(f[e].toString().replace("&","%26").replace("%2a","%26").replace("*","%26").toLowerCase()+"~",""):i!=null&&i!=""&&g&&f[e].indexOf("prices=")>-1&&(u=u.replace(f[e].toString().replace("&","%26").replace("%2a","%26").replace("*","%26").toLowerCase()+"~",""))):a=="brand"&&f[e].indexOf("attr_brand")!=-1?lt=f[e].toString().replace("&","%26").replace("%2a","%26").replace("*","%26")+"~":a=="style"&&f[e].indexOf("attr_style")!=-1?at+=f[e].toString().replace("&","%26").replace("%2a","%26").replace("*","%26").toLowerCase()+"~":f[e].toString().indexOf("sTerm")==-1&&(u+=f[e].toString().replace("&","%26").replace("%2a","%26").replace("*","%26").toLowerCase()+"~")),bt=f[e].indexOf("inStock")>-1;u!=""&&u.indexOf("~")>-1?(u=u.substring(0,u.length-1),u=u.replace("-&","-%26")):u!=""&&u=="&atb="&&(u="");a!=""&&lt==""&&r.indexOf("_m")>-1?(l=[],v=[],l=r.split("_m"),v=l[1].split(".html"),r=l[0]+".html"+v[1]):a!=""&&at==""&&r.indexOf("_s")>-1&&(l=[],v=[],l=r.split("_s"),v=l[1].split(".html"),r=l[0]+".html"+v[1]);r.indexOf("q=")>-1&&r.indexOf("search/")==-1&&r.indexOf("collections/")==-1?(r=r.replace("q="+h,""),h="&q="+h):h="";r.indexOf("atb=")>-1?(rt=r.split("atb="),o=rt[0].toString(),wt=rt[0].toString(),o+=u+h+p+y):(wt=r,o=r+u+h+p+y);o=o.replace("?&","?").replace("&&","&").replace(".html&",".html?").toLowerCase();r.indexOf("/search/")<0&&r.indexOf("/collections/")<0&&r.indexOf(".html")<0&&r.indexOf("/sale.aspx")<0&&t!=""&&(it=window.location.hostname,u.indexOf("~")<0&&t!=""?(s="//"+it+"/"+t+"/"+h+p+y,u!=""&&(s="//"+it+"/"+t+"/"+u.replace("&atb=","").replace("/","%2f").replace("=","/").replace("-&","-%26")+"/"+h+p+y)):u.indexOf("~")>0&&i&&(s="//"+it+"/products/default.aspx?tid="+i.toString()+u.replace("/","%2f").replace("-&","-%26")+h+p+y),s!=""&&(s=s.replace("/&","/?")));r.indexOf("/collections/")>=0&&(o=o.replace(/\'/g,""));r.indexOf("/sale.aspx")>=0&&(o=o.replace(/\'/g,""));bt&&(o+=o.indexOf("?")>-1||o.indexOf("&")>-1?"&inStock=true":"?inStock=true",s+=s.indexOf("?")>-1||s.indexOf("&")>-1?"&inStock=true":"?inStock=true");s!=""?o=s.replace("%24","$").replace("-/","/"):o!=""&&(o=o.replace("%24","$").replace("-/","/"));window.location=o}function getUrlVars(){var n={},t=window.location.href.replace(/[?&]+([^=&]+)=([^&]*)/gi,function(t,i,r){n[i]=r});return n}function validatePriceRange(){var n=document.getElementById("tbxLowPrice"),t=document.getElementById("tbxHighPrice"),i=/^[0-9.]*$/;n==null||i.test(n.value)||(n.value="");t==null||i.test(t.value)||(t.value="")}function catalogNarrowSearchTxt(n){n.keyCode==13&&catalogNarrowSearch()}function catalogNarrowSearch(){var t=cleanTermForSearch(document.getElementById("catalogSearchBox").value),n=document.URL,i=getUrlVars().linkloc,r=getUrlVars().filter,u=getUrlVars().fndrbx,f=getUrlVars().p,e=getUrlVars().q;t=t.replace("-"," ");i!=null&&(n=n.replace("linkloc="+i,""));r!=null&&(n=n.replace("filter="+r,""));u!=null&&(n=n.replace("fndrbx="+u,""));f!=null&&(n=n.replace("p="+f,""));e!=null?n=n.replace("q="+e,"q="+t):t!=null&&t!=""&&(n=n.indexOf("?")>-1?n+"&q="+t.toLowerCase():n+"?q="+t.toLowerCase());window.location=n.replace("?&","?").replace("&&","&").replace(".html&",".html?").replace(/&$/,"")}function getNewCatalogUrl(){var n=document.URL,t=getUrlVars().q;t!=null&&(n=n.replace("q="+t,""));n=n.replace("?&","?").replace("&&","&").replace(".html&",".html?");n[n.length-1]==="&"&&(n=n.slice(0,-1));window.location=n}function setCartTrackingSphinx(n,t,i,r,u,f){try{strShortName=="lfp"&&f!=0&&(i=document.getElementById("price"+f).innerHTML.replace("$",""));strShortName=="lowesca"&&t==""&&(t="Regular");window.AddToCartItems=[{productId:n,productPrice:i,productQuantity:u,priceType:t,productName:r}];_satellite.track("addToCart")}catch(e){}}function setCartTrackingProducts(){var e=document.getElementById("digitalDataInfo"),f=document.getElementById("divPrice").innerHTML,h=document.getElementById("prodName").innerHTML,o,i=document.getElementById("tdCurSku").innerHTML,s,n="",u,r,t;if(i&&i.indexOf("S")>-1){if(i=i.replace("S",""),f&&(f=f.replace("$",""),s=parseFloat(f).toFixed(2)/1),u=document.getElementById("tbxQty"),u==null&&(u=document.getElementById("ddlMinMultQty")),o=u===null||isNaN(u.value)?1:u.value,siteName&&siteName=="lowesca"){for(r=$("#prodBanner").attr("class").split(" "),t=0;t<r.length;t++)if(r[t]=="sprite-bannerlarge"){n="On sale";break}else if(r[t]=="sprite-clearancelarge"){n="Clearance";break}else if(r[t]=="sprite-sbvlarge"){n="Special value";break}else if(r[t]=="sprite-nlplarge"){n="New Lower Price";break}else if(r[t]=="sprite-cspmlarge"){n="Price match";break}else if(r[t]=="sprite-sblarge"){n="Special buy";break}n&&n!=""||(n="Regular")}else siteName&&siteName=="lfp"&&e&&document.getElementById("lowesItemNum")&&(i=document.getElementById("lowesItemNum").innerHTML+"-"+e.getAttribute("vendorNumber")+"-"+e.getAttribute("mfr_prod_id"));window.AddToCartItems=[{productId:i,productPrice:s,productQuantity:o,priceType:n,productName:h}];i&&i.indexOf("C")<0&&siteName&&(siteName=="atgs"||siteName=="lowesca")?_satellite.track("addToCart"):siteName&&siteName=="lfp"&&_satellite.track("addToCart")}}function addCartTrackingCompare(n){var t;window.AddToCartItems=[];try{var i=n,r=document.getElementById("price_"+n).innerHTML.replace("$",""),u=getPriceTypeString(document.getElementById("price_"+n).getAttribute("priceType"),siteName),f=document.getElementById("prodTitle_"+n).innerHTML;strShortName=="lfp"&&(t=document.getElementById("price_"+n),t&&(i=t.getAttribute("lowesItemNum")+"-"+t.getAttribute("vendorNumber")+"-"+t.getAttribute("modelId")));AddToCartItems.push({productId:i,productPrice:r,productQuantity:"1",priceType:u,productName:f});_satellite.track("addToCart")}catch(e){console.log(e)}}function getPriceTypeString(n,t){if(t&&t=="lfp")switch(n){case 2:return"Clearance";case 3:return"Was_Now Price";case 4:return"New Lower Price";case 5:return"SOS Price";case 6:return"Advertised Price";case 7:return"Map Price";default:return"Regular Price"}else if(t&&t=="lowesca")switch(n){case 101:return"Special value";case 102:return"Competative price match";case 103:return"Special buy";case 104:return"Special price";case 1:return"New Lower Price";case 2:return"Clearance";default:return"Regular"}else return""}function widgetTool(){var n=[],i=$(".lowescaWidgetWrapper"),t;(i.length&&$(".lowescaWidgetWrapper").height(460),$(".widget-area").each(function(){var t=$(this).data("value"),r=$(this).data("type"),i;t.length!=0&&(i={id:$(this).attr("id"),sku:t,type:r},n.push(i))}),n.length!==0)&&(t=JSON.stringify(n),$.ajax({type:"POST",url:"../ajax/WidgetHandlerCallNew.ashx",dataType:"text",data:{data:t,articleName:window.location.pathname,clear:getParameterByName("clear")},success:getResult}))}function rateAnswer(n,t,i,r,u){var f=new ajaxRequestObject("/ajax/rateAnswer.aspx","questionId="+n+"&answerId="+t+"&helpful="+i+"&report="+r);f.doGetCallback();u.parentNode.innerHTML="<span style='color: green'>Thank you for giving feedback on this answer.<\/span>"}function checkCartItems(){$.ajax({url:"/ajax/displaycartcookie.ashx",contentType:"application/json; charset=utf-8",data:{cookieName:"shopCartItems"},responseType:"json",success:updateCartCount})}function updateCartCount(n){if(n!=null){var t=n+" items";strShortName=="atgs"?$("#cartButtonDiv").html(t):$("#cartBLowes").html(t)}}function showFilterOptionHelpS(n){document.getElementById(n+"Text").style.display="table";document.getElementById(n+"Img").style.display="block";$("searchSort_attr_"+n).addClass("l")}function hideFilterOptionHelpS(n){document.getElementById(n+"Text").style.display="none";document.getElementById(n+"Img").style.display="none";$("searchSort_attr_"+n).removeClass("l")}function hideRelatedSearches(n){n!=1?$("#divMyOrganicSearch").hide():$("#divMyOrganicSearch").show()}function hideRelatedProducts(n){($("#divRelatedProducts")!=null||$("#divProductBox")!=null)&&(n!=1?($("#divRelatedProducts").addClass("displayn"),$("#divProductBox").addClass("displayn"),$("#divReProductName").addClass("displayn")):$("#divRelatedProducts").removeClass("displayn"));$("#divQuickViewBox")!=null&&(n!=1?$("#divQuickViewBox").addClass("displayn"):$("#divQuickViewBox").removeClass("displayn"))}function getRelatedProducts(){}function loadRelatedProducts(n){$("#divRelatedProducts").html(n)}function getSearchesByKeywords(){return!1}function loadSearchedProducts(n){$("#divSearches").hide();n.indexOf("<!-- BEGIN RELATED -->")>-1?(relatedSearches=n.substring(n.indexOf("<!-- BEGIN RELATED -->"),n.indexOf("<!-- BEGIN MORE-RESULTS -->")),relatedProducts=n.substring(n.indexOf("<!-- BEGIN MORE-RESULTS -->")),$("#divMyOrganicSearch").html(relatedSearches),$("#divRelatedProducts").html(relatedProducts)):$("#divMyOrganicSearch").html(n)}function openProductFlyout(n,t){return $.ajax({url:"/ajax/relatedproducts.ashx",contentType:"application/json; charset=utf-8",data:{groupId:n,image:t},cache:!1,responseType:"json",success:loadProductBox}),!1}function loadProductBox(n){$("#divRelatedProducts").addClass("displayn");$("#divProductBox").removeClass("displayn");$("#divProductBox").css("width","82%");$("#divReProductName").removeClass("displayn");$("#divProductBox").html(n)}function closeProductBox(){$("#divRelatedProducts").removeClass("displayn");$("#divProductBox").addClass("displayn");$("#divProductBox").css("width","");$("#divReProductName").addClass("displayn")}function valCatPerPage(n){return n=="40"||n=="80"||n=="200"?n:"40"}function updateSearchFilters(n,t,i,r){var c="",b="",f=valCatPerPage(getUrlVars().perpage),e=getUrlVars().q,o="",l="",h="",nt="",a="",v,y,p,s,w,u,tt,k,d;if(catIdAnalytic=n,window.scrollTo(0,0),t.indexOf("?")==-1&&t.indexOf("&")>-1&&(t=t.replace("&","?")),v=document.getElementById("divObsoleteProd"),v&&$(v).addClass("displayn"),i!=""&&(strHistoryBaseLink=i),t!=""&&t.indexOf("?q=")==-1&&t.indexOf("&q=")==-1&&(e=""),t=t.replace("*","%2a"),strHistoryLink=t,strHistoryBaseLink!=""&&(i=strHistoryBaseLink),i==""&&strHistoryBaseLink!=""&&(i=strHistoryBaseLink),i!=""&&(strCurrBaseLink=i),f||(f=""),strSorting||(strSorting=""),e||(e=""),f!=""&&(h+="&perpage="+f),strSorting!=""&&(h+="&sort="+strSorting),e!=""&&(h+="&q="+e),strTidJs!=""&&(l="&perpage="+f+"&sort="+strSorting,c="&tid="+strTidJs+"&perpage="+f+"&sort="+strSorting+"&q="+e,b="&tid="+strTidJs+"&newlink="+t.replace("+","%2b")+"&host="+strHost+"&baselink="+i+"&q="+e+"&perpage="+f+"&sort="+strSorting),t.indexOf("/?")>-1&&(y=t.split("/?"),t=y[0].toString()+"/",nt="?"+y[1].toString()),t.indexOf("atb=")>-1?(p=t.split("atb="),s="",p.length>1&&(w=p[1].split("&"),s="&atb="+w[0],o=s,strSelectFiltJs=w[0]),c=c.replace("atb=","")+s,l+=o,hideNonContent(2)):t!=i?(u=t.replace(i,""),u=u.replace("/","=").substring(0,u.length-1),u=u,u="&atb="+u.toLowerCase(),o=u,strSelectFiltJs=u.toLowerCase(),c=c.replace("atb=","")+u,l+=o,hideNonContent(2)):t==i&&(hideNonContent(1),strSelectFiltJs=""),document.getElementById("divResults").innerHTML="<br class='cfb' /><img src='//images.atgstores.com/images/layout/colorspinner.gif' style='margin-left: auto; margin-right: auto; margin-top: 32px;' class='displayb'/><div class='mglr4 fntlb txtc mgb16'>Loading&#8230;<\/div>",tt=!0,s==undefined&&u!=undefined?a=u:u==undefined&&s!=undefined&&(a=s),strSearchTerm=l,(r==""||r==null||r==="undefined")&&strHistoryLink!="undefined"&&(window.history.pushState?(k={strHistoryLink:o+h},window.history.pushState(k,"filter "+o+h,strHistoryLink)):window.location.hash=strHistoryLink),r="",strCurUrlFilt="&tid="+strTidJs+o+h,arrObjFilters[strHistoryLink]?searchAjaxLoadPageFilter(arrObjFilters[strHistoryLink]):(d=new ajaxRequestObject("/ajax/SphinxHandlerFilter.ashx",b,searchAjaxLoadPageFilter),d.doGetCallback()),strTidJs!="")try{getRelatedProducts(strTidJs,encodeURIComponent(a))}catch(g){postJavaError("Get related products/atgjs: "+g.message)}if(strTidJs!="")try{}catch(g){postJavaError("Get related products/atgjs: "+g.message)}showFilterGroups(!1);showSortGroup(!1);updateLiveEngageFilters(n)}function updateCurrentlySelectedFilters(){$("#divFilters").find("input:checked").length>0&&$("#divCurrentFilters").is(":empty")&&strHistoryBaseLink&&strHistoryBaseLink!=""&&$("#divCurrentFilters").html('<h2 class="l" style="color:#555">Filter<\/h2><a class="r mgt4 pdr8" href="" onclick="updateSearchFilters(\'\', \''+strHistoryBaseLink+"','"+strHistoryBaseLink+'\'); return false;">Remove All<\/a><div class="cfb"><\/div><ul id="ulCurrentFilters" class="l full fltns centers borderbox"><\/ul><div class="cfb mgb16 displayb"><\/div>');$("#ulCurrentFilters").empty();$("#divFilters").find("ul").each(function(){var n,t;$(this).find("input:checked").length>0&&(n=$(this).prev().clone(),n.find("span").remove(),t="<li class='pr displayt strong' style='text-transform: capitalize;'>"+n.text()+"<\/li>",$("#ulCurrentFilters").append(t),$(this).find(":checkbox").each(function(){if(currentFilterID="lbl"+$(this).attr("value").replace(/[\.,-\/#!$%\^&\*;:{}=\-_`~()]/g,"").trim(),$(this).attr("checked")){if($("#"+currentFilterID).length===0){var n=$(this).next().text().replace(/\s\(\d+\)/,""),t="width:100%;";currentFilterID.toLowerCase().indexOf("averagereview")>0&&(n="Review: "+$(this).attr("value").split("=")[1].replace(/\s\(\d+\)/,""),t+="text-transform: capitalize;");t="style='"+t+"'";n="<div class='displayt vam pdl4' "+t+">"+n+"<\/div>";$("#ulCurrentFilters").append("<li style='display:table;' id='"+currentFilterID+"' class='rad3 mgb8 pdl4 l cfb brd recomLbl pdt4 pdb4 pointer'>"+n+"<div id='X"+currentFilterID+"' class='displayt vam pdl8 pdr8' style='color: #999;' >x<\/div><\/li>")}$("#"+currentFilterID).length>0&&$("#"+currentFilterID).attr("onclick",$(this).attr("onclick"))}}))});$("ul#ulCurrentFilters li").length===0&&$("#divCurrentFilters").html("")}function setCatalogL3Breadcrumb(n){var u=window.location.href,r=document.getElementById("headTag").textContent.trim()||document.getElementById("headTag").innerText.trim(),t,i;if(strShortName=="atgs")t=document.getElementById("currentCatB");else if(strShortName=="lowesca")t=document.getElementById("lowesCABCrumbs2");else return;i=t.textContent.trim()||t.innerText.trim();t.innerHTML=r==i.replace(">","").trim()?" <span class='nav fnts'>"+i+"<\/span>":" <a href='"+n+"' class='nav fnts'>"+i+"<\/a>"}function searchAjaxLoadPageFilter(n){var t,i,r;arrObjFilters[strHistoryLink]||(arrObjFilters[strHistoryLink]=n);try{if(t=n.split("^"),t.length>1){strNumResults=t[1];t.length>3&&(strUrl=t[2]);strNewFilterHistory==""&&(searchAjaxLoadPageMain(strCurUrlFilt),strCurrentPage="0");strNewFilterHistory="";document.getElementById("divFilters").innerHTML="<div class='l width4of4'>"+t[0]+"<\/div>";i="";t.length>4&&($("#divFilters").find(":checkbox").each(function(){$(this).attr("checked")&&(i.length>0?i+=", "+$(this).next().text().replace(" - ","-").replace(/\s\(\d+\)/,""):i=$(this).next().text().replace(" - ","-").replace(/\s\(\d+\)/,""))}),t.length>6&&t[7]!=null&&(i.indexOf(t[7].toString().replace(/s([^s]*)$/,""))!=-1?i=t[3].toString():i+=" "+t[7].toString()),window.location.href.indexOf("/search/")==-1&&setCatalogL3Breadcrumb(strHistoryBaseLink));t.length>5&&(document.getElementById("selSearchFilter").innerHTML=t[4]);t.length>7&&(document.getElementById("divMobileSort").innerHTML=t[8]);$("#headTag").text(i);strSorting&&(searchFilter=strSorting,loadSearchFilters());try{document.getElementById("divPerPage").innerHTML=t[5]}catch(u){}searchSetPaging();i.length>0?(r=" | ATG Stores",strShortName==="lfp"?r=" | Lowe's for Pros":strShortName==="lowesca"&&(r=" | Lowe's Canada"),document.title=i+r):document.title=t[6].toString();(strShortName=="atgs"||strShortName=="lowesca")&&hideCategoryDesc();$(".disableLinksCat").removeAttr("href");$(".disableLinksCat").removeAttr("onclick");try{setRefinementAnalytic(catIdAnalytic)}catch(f){}strShortName=="lfp"&&t.length>9&&(document.getElementById("divShopByStock").innerHTML=t[9].toString())}}catch(u){}updateCurrentlySelectedFilters()}function updateLiveEngageFilters(n){var u,t,i,r,n;if(typeof $(n).attr("id")!="undefined"&&$(n).attr("id").indexOf("lbl")===0)return Promise.resolve();if(typeof liveEngage=="undefined")return Promise.reject(new Error("liveEngage is undefined"));if(jQuery.isEmptyObject(n)||$(n).length===0)return Promise.reject(new Error("Passed element is empty"));if(u=!1,t=$(n).attr("value")!==undefined?$(n).attr("value"):$(n).attr("id"),!t&&$(n).is("a"))if(i=$(n).prev(),i.attr("type")==="checkbox")t=$(i).attr("value");else return Promise.reject(new Error("Could not parse filter to store."));if(lastFilter===t)return Promise.resolve();if($(n).attr("type")==="checkbox"?u=!$(n).is(":checked"):t&&t.length>0&&(i||(i=$("input[value='"+t+"']")),i.attr("type")==="checkbox"&&(u=$(i).is(":checked"))),u)return Promise.resolve(!0);if(t&&t.length!==0){if(typeof liveEngage.addSearchFilter=="undefined")return Promise.reject(new Error("addSearchFilter function is undefined"))}else return Promise.reject(new Error("Filter text length is 0."));return r="",$("#lowesBCrumbs").length>0?(n=$("#lowesBCrumbs").next().next(),r=$(n).is("span")?$(n).text().replace(">","").trim():""):$("#lowesCABCrumbs2").length>0?r=$("#lowesCABCrumbs2").text().replace(">","").trim():$("#currentCatB").length>0&&(r=$("#currentCatB").text().replace(">","").trim()),r!==""&&(t=t+" (Category: "+r+")"),liveEngage.addSearchFilter(t)}function setRefinementAnalytic(n){var f,i,o=0,s=0,l=0,a=0,h,e,c,v,t,r,u;try{document.URL.lastIndexOf("/search/")==-1&&getParameterByName("redirectTerm")==""&&getParameterByName("q")==""&&digitalData!=null&&digitalData.search.attributes.searchTerm!=null&&(digitalData.search.attributes.InternalSearchType="",digitalData.search.attributes.searchTerm="",digitalData.search.attributes.searchType="",digitalData.search.attributes.listPageNumber=getParameterByName("p")==""?"1":getParameterByName("p"),t=document.getElementById("divMsgPage").innerHTML,t!=null&&t!=""&&(r=t.split(" "),r.length==6&&(u=r[4].replace(",",""),digitalData.search.attributes.numberSearchResults=u,digitalData.search.attributes.resultsPageNumber=digitalData.search.attributes.listPageNumber+" of "+Math.ceil(parseInt(u)/parseInt(digitalData.search.attributes.resultsPerPage)).toString())))}catch(p){}try{n&&n!=""&&(i=n.id,h=$("input[id='"+i.replace(/([ #;&,.+*~\':"!^$[\]()=>|\/@])/g,"\\$1")+"']:checked"),h&&(e=$(h).closest("li").attr("id"),e=e.replace(/([ #;&,.+*~\':"!^$[\]()=>|\/@])/g,"\\$1"),s=$("li[id='"+e+"']").index()),i&&(f="div_attr_"+i.split("=")[0].replace(/ /g,"_"),c=0,v=0,f=="div_attr_price_range"&&(f=f.replace("price_range","price"),i=i.replace("price_range","price")),$('div[id^="div_attr_"]').each(function(){if($(this).attr("id")!="div_attr_relatedCats"){$(this).attr("id")==f&&(l=a,c=o);var n=$(this).attr("id");n=n.replace("div_","searchSort_");o=$("#"+n+" li").length+o;a++}}),window.menuName=i.split("=")[0].replace(/_/g," "),window.sortedOptionName=i.split("=")[1].replace(/-/g," "),window.refinementPosition=l,window.refinementValue=s,window.overallPosition=c+s,_satellite.track("refinement")))}catch(y){postJavaError("Error on setRefinementAnalytic "+y.message)}try{digitalData!=null&&digitalData.search.attributes.searchTerm!=null&&(digitalData.search.attributes.listPageNumber=getParameterByName("p")==""?"1":getParameterByName("p"),t=document.getElementById("divMsgPage").innerHTML,t!=null&&t!=""&&(r=t.split(" "),r.length==6&&(u=r[4].replace(",",""),digitalData.search.attributes.numberSearchResults=u,digitalData.search.attributes.resultsPageNumber=digitalData.search.attributes.listPageNumber+" of "+Math.ceil(parseInt(u)/parseInt(digitalData.search.attributes.resultsPerPage)).toString(),getParameterByName("q")!=""&&(digitalData.search.attributes.searchTerm=getParameterByName("q"),digitalData.search.attributes.searchType="refinement"))));_satellite.track("refinementSearch")}catch(p){}}function searchFilterAnalytics(n){var t,i;try{if(n&&(t=n.value,t||(t=n.id),t)){i=$(n).closest("li").attr("id");i=i.replace(/([ #;&,.+*~\':"!^$[\]()=>|\/@])/g,"\\$1");var u,r,e=0,f=0,o=0,s=0;u=$("li[id='"+i+"']").index();r="div_attr_"+t.split("=")[0].replace(/ /g,"_");r=="div_attr_price_range"&&(r="div_attr_price",t=t.replace("price_range","price"));$('div[id^="div_attr_"]').each(function(){$(this).attr("id")==r&&(s=o,e=f);var n=$(this).attr("id");n=n.replace("div_","searchSort_");f=$("#"+n+" li input").length+f;o++});window.menuName=t.split("=")[0].replace("_"," ");window.sortedOptionName=decodeURIComponent(t.split("=")[1].replace(/-/g," "));window.refinementPosition=s;window.refinementValue=u;window.overallPosition=e+u;_satellite.track("refinement")}}catch(h){postJavaError("Error on searchFilterAnalytics "+h.message)}}function searchAjaxLoadPageMain(n){var t,i,r,u,f;n.indexOf("/products/default.aspx")>-1&&(n=n.replace("/products/default.aspx?","&"));n.indexOf("atb=")==-1&&n.indexOf("tid=")==-1&&n!=""&&(i="",n.indexOf("?")==-1?t=n:(r=n.split("?"),t=r[0],i="&"+r[1]),t!=strHistoryBaseLink?(u=t.replace(strHistoryBaseLink,"").replace("/","="),n="&tid="+strTidJs+"&atb="+u.substring(0,u.length-1)+i):n="&tid="+strTidJs+i);arrObjMainProd[n]?searchAjaxLoadPage(arrObjMainProd[n],!1):(f=new ajaxRequestObject("/ajaxcache/SphinxHandler.ashx",n,searchAjaxLoadPage,1),f.doGetCallback())}function imageError(n){var t=n.src,i;t.indexOf("mfr_logo")==-1?n.src="//images.atgstores.com/images/noimage/atg_p.jpg":(document.getElementById("divMfrLogoBox")&&$("#divMfrLogoBox").addClass("displayn"),document.getElementById("imgMfrSearch")&&$("#imgMfrSearch").addClass("displayn"));i=new ajaxRequestObject("/ajax/logImageFailure.ashx","url="+window.location+"&img="+t);i.doGetCallback()}function callMessageHandler(n){var t=readCookie("user%5Fid"),i=readCookie("newMessages");t!=null&&t!=""&&i==null?populateMessageIcon(t):t!=null&&t!=""&&i!=null&&i!=""&&(n==1?populateMessageIcon(t):handleCustomerCookie(i))}function populateMessageIcon(n){return $.ajax({url:"/ajax/getCustomerMessages.ashx",contentType:"application/json; charset=utf-8",cache:!1,data:{customerID:n},responseType:"json",success:handleCustomerCookie}),!1}function handleCustomerCookie(n){n!="empty"&&changeMessageCount(n)}function changeMessageCount(n){n=="0"?($("#divAccountMessage").addClass("displayn"),$("#divMessages").addClass("displayn")):($("#divAccountMessage").removeClass("displayn"),$("#divMessages").removeClass("displayn"),strShortName=="atgs"?($("#divAccountMessage").html('<a title="click to see your messages" href="/messagecenter/messagecenter.aspx"><div class="crcl redbg cw txtc pa pointer promsgtop">'+n+"<\/div><\/a>"),$("#divMessages").html('<a title="click to see your messages" href="/messagecenter/messagecenter.aspx"><div class="pa crcl redbg cw txtc pa pointer promsgacct">'+n+"<\/div><\/a>")):($("#divAccountMessage").html('<div style="border-radius: 100%;behavior: url(PIE.htc);width: 17px;height: 17px;background: #d84949;color: #fff;text-align: center;font-size: 7pt;position: absolute;top: -3px;right: -5px;cursor: pointer; z-index: 999; ">'+n+"<\/div>"),$("#divMessages").html('<div class="l pa" style="border-radius: 100%;behavior: url(PIE.htc);width: 17px;height: 17px;background: #d84949;color: #fff;text-align: center;font-size: 7pt;;cursor: pointer; left: 100px; top: 0px;">'+n+"<\/div>")))}function hideCategoryDesc(){var t=document.getElementById("headTag").innerText.toLowerCase().replace(" ","-").trim(),i=window.location.href,n=getUrlVars();typeof n.atb!="undefined"||i.indexOf(t)==-1&&typeof n.tid=="undefined"?($("#CatalogSEODesc").addClass("displayn"),$("#divCompleteYourProject").addClass("displayn")):($("#CatalogSEODesc").removeClass("displayn"),$("#divCompleteYourProject").removeClass("displayn"))}function overrideBloomReachOnclickAttributes(){!document.getElementById("ancQuickview_br1")||document.getElementById("ancQuickview_br1").firstElementChild.setAttribute("onclick",'openPopBox(400,520,$("#br1").html())');!document.getElementById("ancQuickview_br2")||document.getElementById("ancQuickview_br2").firstElementChild.setAttribute("onclick",'openPopBox(400,530,$("#br2").html())');!document.getElementById("ancQuickview_br3")||document.getElementById("ancQuickview_br3").firstElementChild.setAttribute("onclick",'openPopBox(400,520,$("#br3").html())')}function divifyHolidayHours(n,t,i,r){function v(n){var t=n.split("/"),i=new Date(t[2],t[0]-1,t[1],23,59,59),r=new Date;return i.setDate(i.getDate()+1),r>i}var c="",u,o;try{var f=n.split("{{}}"),l=t.split("{{}}"),a=i.split("{{}}"),s=r.split("{{}}"),h="<div id='divHolidayNames' class='l strong g3'>",e="<div id='divHoursOrTexts' class='l' style='line-height: 1.5em;'>";if(f.length>0)for(u=0;u<f.length;u++)o=!1,a[u].length>0?v(a[u])||(o=!0):o=!0,o&&f[u]&&(h+="<div style='color: #0645AD'>"+f[u]+"<\/div>",s[u]&&s[u]!="NULL"?e+="<div>"+s[u]+"<\/div>":l[u]&&(e+="<div>"+l[u]+"<\/div>"));h+="<\/div>";e+="<\/div>";c+=h+e}catch(y){}return c}function setSiteName(){strShortName||$("#strSName")&&(strShortName=$("#strSName").val())}function viewInStockTracking(n){n.checked&&_satellite.track("viewInStockFilter")}function isLfpUserLoggedIn(){var n=!1;return setSiteName(),strShortName=="lfp"&&readCookies("user%5Fid")!=null&&readCookies("user%5Fid")!=""&&readCookies("LFPCustomerID")!=null&&readCookies("LFPCustomerID")!=""&&(n=!0),n}function HtmlEncode(n){return $("<div/>").text(n).html()}function LoadDTMValues(){var r,f,e,u,i,t,o,n;try{if((typeof strShortName=="undefined"||strShortName==null||strShortName=="")&&(window.strShortName="atgs",window.location.href.toString().indexOf("lowesforpros.com")>-1?strShortName="lfp":window.location.href.toString().indexOf("lowes.ca")>-1&&(strShortName="lowesca")),digitalData.page.attributes.responseType=window.screen.width+"x"+window.screen.height,i=readCookie("dtm_page"),r=readCookie("dtm_pr"),digitalData.profile={},digitalData.profile.attributes={},f=readCookie("user%5Fid"),f==null?digitalData.profile.attributes.visitorStatus="guest":(digitalData.profile.attributes.visitorStatus="registered",digitalData.profile.attributes.userId=f),(strShortName=="lowesca"||strShortName=="lfp")&&readCookie("storeinfo")!=null&&(e=getCookie("storeinfo"),e!=null&&(u=e.split("|"),u.length>=2&&(digitalData.profile.attributes.userStoreId={},digitalData.profile.attributes.userStoreId.location=u[0],digitalData.profile.attributes.userStoreId.storeId=u[1],digitalData.profile.attributes.userStoreId.postal=u[3]))),i=readCookie("dtm_page"),i&&typeof i!="undefined"&&i!=""){var t=i.split("%"),h=t.length,o=getCurrentSiteSection();for(n=0;n<t.length;n++)t[n]!=null&&t[n]!=""&&setSiteSection(n+1,t[n].toString());setSiteSection(t.length+1,o);clearSiteSection(t.length+2);eraseCookie("dtm_page")}if(typeof r!="undefined"&&r!=""&&r!=null){for(t=r.split("%"),o=getCurrentSiteSection(),n=0;n<t.length;n++)t[n]!=null&&t[n]!=""&&setSiteSection(n+1,t[n].toString());clearSiteSection(t.length+1);eraseCookie("dtm_pr")}setProductDetailDTM()}catch(s){console.log("LoadDTMValue Error: "+s.message)}}function setProductDetailDTM(){var t,n,r,i;try{if(t=document.getElementById("digitalDataInfo"),t!=null){var h=document.getElementById("prodRvwStar"),c=document.getElementById("prodBanner"),u=t.getAttribute("lowesitemnum"),f=t.getAttribute("mfr_prod_id"),l=t.getAttribute("mfr_id"),e=t.getAttribute("atgsku"),o=document.getElementById("tdGroupId"),a=document.getElementById("soeOutStock"),s=getQueryStringNameValue("ProductSlot");digitalData.product={};digitalData.product.attributes={};n=digitalData.product.attributes;r=t.getAttribute("vendorNumber");n.reviewStarRating=h?Math.round(h.getAttribute("avgrvw")*10)/10:"0";c!=null&&strShortName=="lowesca"?(i=c.classList,n.priceType=i.contains("sprite-bannerlarge")?"On sale":i.contains("sprite-clearancelarge")?"Clearance":i.contains("sprite-sbvlarge")?"Special value":i.contains("sprite-cspmlarge")?"Price match":i.contains("sprite-sblarge")?"Special buy":"Regular"):n.priceType="";n.numberOfReviews=$("#lnkReviews span").html().replace(/\D+/g,"");n.lowesItemNumber=u!=null&&u!=""?u:"";n.mfrPartNumber=f!=null&&f!=""?f:"";l==null&&(l="");(r==null||r=="undefined")&&(r="");n.atgSku=e!=null&&e!=""?e:"";n.groupId=o!=null&&o.innerHTML!=""?o.innerHTML.trim():"";n.productId=strShortName=="lfp"?n.lowesItemNumber+"-"+r+"-"+n.mfrPartNumber:n.atgSku;n.wasProductPrice=$("#spnWas").html().replace(/\$*\s*/g,"").replace(/-+/g,"_");n.productPrice=$("#divPrice").html().replace(/\$*\s*/g,"").replace(/-+/g,"_");n.displayProducts=n.productId+";1;"+n.productPrice+";eVar68="+n.priceType;n.productName=document.getElementById("prodName").innerHTML.trim();n.productInStock=a&&a.innerHTML!=""?"no":"yes";n.productSlot=s!=null&&s!=""?s:""}}catch(v){console.log("setProductDetailDTM Error: "+v.message)}}function createCookie(n,t,i){var r,u;i?(r=new Date,r.setTime(r.getTime()+i*864e5),u="; expires="+r.toGMTString()):u="";document.cookie=n+"="+t+u+"; path=/"}function readCookie(n){for(var r=n+"=",u=document.cookie.split(";"),t,i=0;i<u.length;i++){for(t=u[i];t.charAt(0)==" ";)t=t.substring(1,t.length);if(t.indexOf(r)==0)return t.substring(r.length,t.length)}return null}function eraseCookie(n){createCookie(n,"",-1)}function getCurrentSiteSection(){for(var n=digitalData.page.attributes,t=6;t>0;t--)switch(t){case 1:if(n.siteSection1!=null&&n.siteSection1!="")return n.siteSection1;break;case 2:if(n.siteSection2!=null&&n.siteSection2!="")return n.siteSection2;break;case 3:if(n.siteSection3!=null&&n.siteSection3!="")return n.siteSection3;break;case 4:if(n.siteSection4!=null&&n.siteSection4!="")return n.siteSection4;break;case 5:if(n.siteSection5!=null&&n.siteSection5!="")return n.siteSection5;break;case 6:if(n.siteSection6!=null&&n.siteSection6!="")return n.siteSection6;break;default:return""}}function setSiteSection(n,t){switch(n){case 1:digitalData.page.attributes.siteSection1=t;break;case 2:digitalData.page.attributes.siteSection2=t;break;case 3:digitalData.page.attributes.siteSection3=t;break;case 4:digitalData.page.attributes.siteSection4=t;break;case 5:digitalData.page.attributes.siteSection5=t;break;case 6:digitalData.page.attributes.siteSection6=t}}function clearSiteSection(n){for(var t=n;t<=6;t++)setSiteSection(t,"")}function loadLivePersonEngage(){liveEngage.load();liveEngage.bindPreChatSubmit()}var isCurrentPagePopUp,arrSkuPriceHanders,pCount,thepage,hideSiteTimeout,showSiteTimeout,hideAcctTimeout,overNav,curTab,navTimer,subNavTimer,subNavHideTimer,subbubNavHideTimer,day,ATGTime,working,lpMTagConfig,params,cookieStr,atgTabShowTimeout,atgTabHideTimeout,atgLoadDelay,atgAcctTO,atgAcctHideTO,lastCall,cartCookieDisplay,customPopBox,strValMessage,timeOutId,lastEventToRun,agentDisplayCnt,isQALoaded,strLastQuestionQA,callBackNumQA,logTimerQA,searchTimerQA,postLoadJS,popUpStoreClose,storeincleartime,categorySelection,cateCount,strCurUrlFilt,strNewFilterHistory,previousTarget,getResult,catIdAnalytic,liveEngage;(function(n){var r=document,i,t,u={http:"http://cdn.mplxtms.com/s/MasterTMS.min.js",https:"https://secure-cdn.mplxtms.com/s/MasterTMS.min.js"}[/\w+/.exec(window.location.protocol)[0]];t=r.createElement("script");t.type="text/javascript";t.async=!0;t.src=u+"#1092";i=r.getElementsByTagName("script")[0];i.parentNode.insertBefore(t,i);t.readyState?t.onreadystatechange=function(){(t.readyState==="loaded"||t.readyState==="complete")&&(t.onreadystatechange=null)}:t.onload=function(){try{n()}catch(t){}}})(function(){});var ATGupdateCount=0,ATGhideDivAcct,ATGhideDivSite,ATGhideDivShop,ATGcur=-1,ATGshow=!0,locationToRedirect="",strSavedSearchString="",intPreviousMove=-1,bolBuiltOrganicCache=!1,imageSwap,intFadeElementId,ajaxSearchSuggestion,globalMenuName="",loadedGroup=0,arrOptQV,defaultPrice="",curLocation="",createArrOpt=!1,qvQuantity=1,lowesStoreID,returnStringForStoreLocator="",tabletUserCheck=!1,intTotalItemsLoaded=0,lfpSearchTerm="",cookieEnabled=navigator.cookieEnabled?!0:!1,isIe8JS=!1,customerCurrentDateNav=new Date,_strPorchRedirectUrlSecondInstance="",arrAttrNames="",lastFilter="";if(window.console=window.console||{log:function(){}},$(document).ready(function(){checkLoginUser();lowesStoreLocatior();mobileCatalogFilterToggle();overrideBloomReachOnclickAttributes()}),navigator.userAgent.indexOf("MSIE")!==-1||navigator.appVersion.indexOf("Trident/")>0){function ieVersion(){var n=window.navigator.userAgent;return n.indexOf("Trident/7.0")>0?11:n.indexOf("Trident/6.0")>0?10:n.indexOf("Trident/5.0")>0?9:0}ieVersion()<9&&(isIe8JS=!0)}try{addLoadEvent(getCartButtonNew)}catch(ex){postJavaError("Refresh Cart Cookie: "+ex.message)}addLoadEvent(checkForCookie);isCurrentPagePopUp="";arrSkuPriceHanders=[];pCount=0;thepage="";typeof String.prototype.trim!="function"&&(String.prototype.trim=function(){return this.replace(/^\s+|\s+$/g,"")});overNav=!1;curTab="light";Date.prototype.stdTimezoneOffset=function(){var n=new Date(this.getFullYear(),0,1),t=new Date(this.getFullYear(),6,1);return Math.max(n.getTimezoneOffset(),t.getTimezoneOffset())};Date.prototype.dst=function(){return this.getTimezoneOffset()<this.stdTimezoneOffset()};working=function(){var n=new Date,i=n.getFullYear(),r=n.getMonth(),t=n.getDate(),u=n.getTime();if(strShortName=="lowesca"&&i==2016&&r==8&&(t==16||t==17)){if(t==16){if(ATGTime>=4)return!0}else if(t==17&&(ATGTime<2||ATGTime>=5&&ATGTime<20))return!0;return!1}return day==0||day==6?ATGTime>=5&&ATGTime<20?!0:!1:day>=1&&day<=5?ATGTime>=4&&ATGTime<22?!0:!1:void 0};try{lpMTagConfig={lpServer:"server.iad.liveperson.net",lpNumber:"51320037",lpProtocol:"https"}}catch(err){postJavaError("InlineLP: "+err.message)}try{typeof lpMTagConfig.sessionVar=="undefined"&&(lpMTagConfig.sessionVar=[]);readCookie("NetSessionID")!=null&&(lpMTagConfig.sessionVar[lpMTagConfig.sessionVar.length]="netsessionid="+readCookie("NetSessionID"))}catch(err){postJavaError("inline3: "+err.message)}params="";cookieStr="";strValMessage="";timeOutId=0;lastEventToRun=0;var colorText="#444",colorHint="#AAA",colorHintLight="#DDD";try{typeof jsToLoad!="undefined"&&addLoadEvent(jsToLoad);addLoadEvent(addFunc);addLoadEvent(highlightlink);addLoadEvent(partial(swapSlideShowImage,1));addLoadEvent(openRecommendations);(window.location.toString().indexOf("admin")<0||window.parent==window)&&(addLoadEvent(saveUserLog),addLoadEvent(pageSetup),addLoadEvent(saveDisplayPHNumber),addLoadEvent(showSurvey));agentDisplayCnt=0;window.onresize=function(){pbxShadow=document.getElementById("popBoxLayer");pbxShadow!=null&&(pbxShadow.style.width=document.body.scrollWidth+"px")}}catch(err){postJavaError("Inline Z: "+err.message)}isQALoaded=!1;strLastQuestionQA=null;callBackNumQA=0;logTimerQA=null;searchTimerQA=null;typeof postLoadJS==typeof undefined&&(postLoadJS=function(n){if(typeof readCookie=="function"&&typeof jQuery=="function")jQuery(document).ready(function(){n()});else{var t=jsToLoad;jsToLoad=typeof jsToLoad!="function"?n:function(){t();n()}}});var google_conversion_id,google_conversion_label,google_conversion_language="en",google_conversion_format="3",google_conversion_color="666666",google_conversion_value=0,miniFeedCurrentPage;popUpStoreClose=0;cateCount=1;loadJSVar();typeof bolIsUserInternal!="undefined"&&bolIsUserInternal=="true"&&rpLinkNew();addLoadEvent(sectionPageLevel);addLoadEvent(miniFeedBackCurPage);addLoadEvent(hideRecentViewed);try{addLoadEvent(googleRemarketing)}catch(e){Console.log(e)}addLoadEvent(hideRecentLowes);addLoadEvent(googleRemarketingLowes);addLoadEvent(showRecentViewed);addLoadEvent(navTopBottomResponsive);addLoadEvent(widgetTool);addLoadEvent(function(){callMessageHandler(2)});var arrPreLoadedPages={},strNewPageQ="",strOverWritePage="";strCurUrlFilt="";strNewFilterHistory="";previousTarget=null;getResult=function(n){var u,s,l,f,e,a;for(n=JSON.parse(n),u=0;u<n.length;){if(u<40){var t=n[u],c=t.Id,i=$("#"+c);if(t.priceCA){var r=parseFloat(t.priceCA).toFixed(2),o="//images.atgstores.com/images/noimage/atg_p.jpg",v=t.sku,h="/products/view.aspx?sku="+t.sku;t.Mfr&&t.Image&&(o="//images.atgstores.com/img/i/"+t.Mfr+"/"+t.Image);typeof i.data("image")!="undefined"&&(s=i.data("image"),s.length>0&&(o=s));l=$("<div>").css("min-height","200px").wrapInner('<a id="productLink'+t.sku+'" href="'+h+'" />').appendTo(i);$("#productLink"+t.sku).wrapInner($("<img>").attr("src",o).hover(function(){$(this).css("cursor","pointer")}));t.minPrice!=t.maxPrice&&t.itemType=="g"?($("<div>").addClass("priceCA strong mgtb8").attr("data-priceca",r).html("$"+t.minPrice+" - "+t.maxPrice).appendTo(i),$("<div>").addClass("save strong mgtb8").attr("data-save",e).html("&nbsp").appendTo(i),$("<div>").addClass("wasCA strong mgtb8").attr("data-wasca",f).html("&nbsp").appendTo(i)):t.wasCA?(f=parseFloat(t.wasCA).toFixed(2),e=parseFloat(f-r).toFixed(2),$("<div>").addClass("save strong mgtb8").attr("data-save",e).html("SAVE $"+e).appendTo(i),$("<div>").addClass("priceCA strong mgtb8").attr("data-priceca",r).html("NOW $"+r).appendTo(i),$("<div>").addClass("wasCA strong mgtb8").attr("data-wasca",f).html("WAS $"+f).appendTo(i)):$("<div>").addClass("priceCA strong ").attr("data-priceca",r).css("margin-bottom","73px").html("$"+r).appendTo(i);typeof i.data("desc")!="undefined"?$("<div>").addClass("productName").css("min-height","60px").html(i.data("desc")).appendTo(i):$("<div>").addClass("productName").css({"min-height":"60px","word-wrap":"break-word"}).html(t.name).appendTo(i);a=t.sku;$("<button/>",{text:"Buy Now"}).wrapInner('<a id="productLink'+t.sku+'" href="'+h+'" />').addClass("  btnReg green  mgb16").appendTo(i)}}u++}};var arrObjFilters={},arrObjMainProd={},strHistoryLink="",strBackHistory="",strCurrNewLink="",strCurrBaseLink="",strSorting=getUrlVars().sort,strSetNumResultsFilters="",strSelectFiltJs="";(function(n){typeof define=="function"&&define.amd?define(["jquery"],n):typeof exports=="object"?n(require("jquery")):n(jQuery)})(function(n){function i(n){return t.raw?n:encodeURIComponent(n)}function f(n){return t.raw?n:decodeURIComponent(n)}function e(n){return i(t.json?JSON.stringify(n):String(n))}function o(n){n.indexOf('"')===0&&(n=n.slice(1,-1).replace(/\\"/g,'"').replace(/\\\\/g,"\\"));try{return n=decodeURIComponent(n.replace(u," ")),t.json?JSON.parse(n):n}catch(i){}}function r(i,r){var u=t.raw?i:o(i);return n.isFunction(r)?r(u):u}var u=/\+/g,t=n.cookie=function(u,o,s){var y,a,h,v,c,p;if(o!==undefined&&!n.isFunction(o))return s=n.extend({},t.defaults,s),typeof s.expires=="number"&&(y=s.expires,a=s.expires=new Date,a.setTime(+a+y*864e5)),document.cookie=[i(u),"=",e(o),s.expires?"; expires="+s.expires.toUTCString():"",s.path?"; path="+s.path:"",s.domain?"; domain="+s.domain:"",s.secure?"; secure":""].join("");for(h=u?undefined:{},v=document.cookie?document.cookie.split("; "):[],c=0,p=v.length;c<p;c++){var w=v[c].split("="),b=f(w.shift()),l=w.join("=");if(u&&u===b){h=r(l,o);break}u||(l=r(l))===undefined||(h[b]=l)}return h};t.defaults={};n.removeCookie=function(t,i){return n.cookie(t)===undefined?!1:(n.cookie(t,"",n.extend({},i,{expires:-1})),!n.cookie(t))}});$(function(){$(".iecurs").hover(function(){document.activeElement.blur()})});liveEngage={config:{lfp:"11934925",lowesca:"8130361",atgs:"8130361"},site:"",pushDataToLivePerson:!0,shouldPushLatestSearch:!1,initializeLivePerson:function(n){window.lpTag=window.lpTag||{};typeof window.lpTag._tagCount=="undefined"?(window.lpTag={site:n||"",section:lpTag.section||"",autoStart:lpTag.autoStart===!1?!1:!0,ovr:lpTag.ovr||{},_v:"1.6.0",_tagCount:1,protocol:"https:",events:{bind:function(n,t,i){lpTag.defer(function(){lpTag.events.bind(n,t,i)},0)},trigger:function(n,t,i){lpTag.defer(function(){lpTag.events.trigger(n,t,i)},1)}},defer:function(n,t){t==0?(this._defB=this._defB||[],this._defB.push(n)):t==1?(this._defT=this._defT||[],this._defT.push(n)):(this._defL=this._defL||[],this._defL.push(n))},load:function(n,t,i){var r=this;setTimeout(function(){r._load(n,t,i)},0)},_load:function(n,t,i){var u=n,r;n||(u=this.protocol+"//"+(this.ovr&&this.ovr.domain?this.ovr.domain:"lptag.liveperson.net")+"/tag/tag.js?site="+this.site);r=document.createElement("script");r.setAttribute("charset",t?t:"UTF-8");i&&r.setAttribute("id",i);r.setAttribute("src",u);document.getElementsByTagName("head").item(0).appendChild(r)},init:function(){this._timing=this._timing||{};this._timing.start=(new Date).getTime();var n=this;window.attachEvent?window.attachEvent("onload",function(){n._domReady("domReady")}):(window.addEventListener("DOMContentLoaded",function(){n._domReady("contReady")},!1),window.addEventListener("load",function(){n._domReady("domReady")},!1));typeof window._lptStop=="undefined"&&this.load()},start:function(){this.autoStart=!0},_domReady:function(n){this.isDom||(this.isDom=!0,this.events.trigger("LPT","DOM_READY",{t:n}));this._timing[n]=(new Date).getTime()},vars:lpTag.vars||[],dbs:lpTag.dbs||[],ctn:lpTag.ctn||[],sdes:lpTag.sdes||[],ev:lpTag.ev||[]},lpTag.init()):window.lpTag._tagCount+=1},load:function(){liveEngage.site=liveEngage.getSite();var n=liveEngage.config[liveEngage.site];liveEngage.displayLiveChatCA();liveEngage.site==="lfp"&&(liveEngage.pushDataToLivePerson=!1);typeof localforage!="undefined"&&localforage.setDriver(localforage.LOCALSTORAGE).then(function(){liveEngage.setEngagementData().then(function(){if(liveEngage.isProductPage()){var n=liveEngage.parseProduct();typeof engagementData.lastProduct!="undefined"&&(engagementData.lastProduct===""||n.product.name!==engagementData.lastProduct.product.name)&&(liveEngage.addProduct(n),liveEngage.pushDataToLivePerson&&lpTag.sdes.push(liveEngage.getProdView(n)))}})});liveEngage.displayLiveChatCACheckout()},getEngagementData:function(){var i,n,t,r,u;return typeof readCookie!="function"?Promise.reject():(i=function(n){var t=readCookie(n);return t!==null?t.toString():""},n={sessionID:i("LPSID-"+liveEngage.config[liveEngage.site]),customerID:i("LFPCustomerID"),visitorID:i("LPVID"),commercialID:i("CommercialID"),zipCode:"",store:"",storeID:"",recentSearches:[],lastProduct:"",products:[],lastSearchFilter:"",searchFilters:[],surveyResponse:[]},n.customerID===""&&(n.customerID=i("user%5Fid")),readCookie("storeinfo")!==null&&liveEngage.getSite()!=="atgs"&&(t=readCookie("storeinfo").toString().split("|"),t!==null&&typeof t!="undefined"&&t.length>2&&(n.store=t[0],n.storeID=t[1],n.zipCode=t[3])),readCookie("userLastVisited")!==null&&(r=liveEngage.parseDate(readCookie("userLastVisited").split(" ")[0]),r!==null&&(n.lastVisitedDate=r)),readCookie("userLastPurchased")!==null&&(u=liveEngage.parseDate(readCookie("userLastPurchased").split(" ")[0]),u!==null&&(n.lastPaymentDate=u)),typeof localforage=="undefined")?Promise.resolve(n):localforage.getItem("lpSurveyResponse").then(function(t){return t!==null&&(n.surveyResponse=t),localforage.getItem("LowesProductsLP")}).catch(function(n){return typeof postJavaError=="function"&&postJavaError("Error occurred while retrieving last survey response: "+n.message),localforage.getItem("LowesProductsLP")}).then(function(t){return Array.isArray(t)&&t.length>0&&(n.lastProduct=t[t.length-1],n.products=t),localforage.getItem("LowesRecentSearchesLP")}).catch(function(n){return typeof postJavaError=="function"&&postJavaError("Error occurred while retrieving recent searches: "+n.message),localforage.getItem("LowesRecentSearchesLP")}).then(function(t){Array.isArray(t)||(t=[]);var i=readCookie("searchTerm");return i!=null?((t.length===0||i!==t[t.length-1])&&(t.push(i),liveEngage.shouldPushLatestSearch=!0),n.recentSearches=t,localforage.setItem("LowesRecentSearchesLP",t).then(function(){return localforage.getItem("LowesSearchFiltersLP")}).catch(function(){return localforage.getItem("LowesSearchFiltersLP")})):(n.recentSearches=t,localforage.getItem("LowesSearchFiltersLP"))}).catch(function(n){return typeof postJavaError=="function"&&postJavaError("Error occurred while retrieving recent searches: "+n.message),localforage.getItem("LowesSearchFiltersLP")}).then(function(t){return Array.isArray(t)&&t.length>0&&(n.lastSearchFilter=t[t.length-1],n.searchFilters=t),Promise.resolve(n)}).catch(function(t){return typeof postJavaError=="function"&&postJavaError("Error occurred while retrieving live engage search filters: "+t.message),Promise.resolve(n)})},setEngagementData:function(){return liveEngage.getEngagementData().then(function(n){if(window.engagementData=n,typeof lpTag=="undefined"||typeof lpTag.sdes=="undefined"||!liveEngage.pushDataToLivePerson)return Promise.resolve();var t=liveEngage.getCustomerEngagement(n);return t&&lpTag.sdes.push(t),liveEngage.shouldPushLatestSearch&&n.recentSearches.length>0&&liveEngage.pushSearchLead(n.recentSearches[n.recentSearches.length-1]),Promise.resolve()}).catch(function(n){return typeof postJavaError=="function"&&postJavaError("Error occurred while setting live engagement data: "+n.message),Promise.reject()})},getCustomerEngagement:function(n){var t={type:"ctmrinfo",info:{}},i;return n.store!==""&&(t.info.imei="Store: "+n.store),n.storeID!==""&&(t.info.imei+=" (Store ID: "+n.storeID+")"),n.zipCode!==""&&(t.info.socialId=n.zipCode),i="",n.sessionID!==""&&(i+="Session ID: "+n.sessionID+" "),n.customerID!==""&&(i+="Customer ID: "+n.customerID+" "),n.visitorID!==""&&n.customerID!==""&&(i+="Visitor ID: "+n.visitorID+" "),liveEngage.getSite()!=="atgs"&&n.commercialID!==""&&(i+="Commercial ID: "+n.commercialID+" "),i!==""&&(t.info.customerId=i),typeof n.lastVisitedDate!="undefined"&&(t.info.registrationDate=n.lastVisitedDate),typeof n.lastPaymentDate!="undefined"&&(t.info.lastPaymentDate=n.lastPaymentDate),t},pushSearchLead:function(n){if(typeof n!="undefined"&&n!==""){var t={type:"lead",lead:{topic:"search",leadId:n}};lpTag.sdes.push(t)}},addSearchFilter:function(n){if(typeof engagementData.lastSearchFilter!="undefined"&&n===engagementData.lastSearchFilter)return Promise.resolve();n=decodeURIComponent(n);var t="LowesSearchFiltersLP";return typeof window.engagementData!="undefined"&&Array.isArray(window.engagementData.searchFilters)&&(window.engagementData.searchFilters.push(n),window.engagementData.searchFilters.length>5&&window.engagementData.searchFilters.splice(0,window.engagementData.searchFilters.length-5),engagementData.lastSearchFilter=n,liveEngage.pushDataToLivePerson&&liveEngage.pushFilter(n)),localforage.getItem(t).then(function(i){return Array.isArray(i)&&i.length!==0||(i=[]),i.push(n),i.length>10&&i.splice(0,i.length-10),localforage.setItem(t,i)}).catch(function(n){return typeof postJavaError=="function"&&postJavaError("Error occurred while updating live engage search filters: "+n.message),Promise.reject(n)})},pushFilter:function(n){if(typeof lpTag!="undefined"&&lpTag.sdes!=="undefined"&&lpTag.sdes.inspect!=="undefined"){var t={type:"lead",lead:{topic:"filtering",leadId:n}};lpTag.sdes.push(t)}},addProduct:function(n){var t="LowesProductsLP";return localforage.getItem(t).then(function(i){return Array.isArray(i)||(i=[]),i.push(n),i.length>5&&i.splice(0,i.length-5),engagementData.products=i,engagementData.lastProduct=n,localforage.setItem(t,i)}).catch(function(n){return typeof postJavaError=="function"&&postJavaError("Error occurred while adding a product: "+n.message),Promise.reject(n)})},isProductPage:function(){return $("#divPriceBlock").length>0},parseProduct:function(){var n={product:{name:"",category:"",sku:"",price:""}},t=function(n){return n.text().replace(/[\r\n]/g,"").trim()},i;return $("#prodName").length>0&&(n.product.name=t($("#prodName"))),i=$("strong:contains('Category:')"),i.length>0&&(n.product.category=t(i.parent().next())),$("#tdCurSku").length>0&&(n.product.sku=t($("#tdCurSku"))),$("#divPrice").length>0&&(n.product.price=t($("#divPrice"))),n},getProdView:function(n){return{type:"prodView",products:[n]}},getSite:function(){if(typeof strSiteName!="undefined")return strSiteName;var n=window.location.host.toLowerCase();return n.indexOf("atgstores.com")>-1?"atgs":n.indexOf("lowes.ca")>-1?"lowesca":n.indexOf("lowesforpros.com")>-1?"lfp":""},bindPreChatSubmit:function(){$(document).on("click",".lp_submit_button",function(){if(typeof window.engagementData!="undefined"){var n=[];$(".lp_question_wrapper").children().each(function(t,i){var e=$(i).find(".lp_question_label"),r=$(i).find("input"),u,f;(r.length===0&&(r=$(i).find("textarea")),$(e).length!==0&&$(r).length!==0)&&(u=$(e).text(),f=$(r).val(),u.length>0&&f.length>0&&n.push({field:u,response:f}))});n.length>0&&(window.engagementData.surveyResponse=n,localforage.setItem("lpSurveyResponse",n))}})},parseDate:function(n){var t,r,i;if(typeof n=="undefined"||n.length===0)return null;if(t=n.split("/"),t.length>2){for(r=0;r<2;r++)if(isNaN(t[r]))return null;return i={},i.month=t[0],i.day=t[1],i.year=t[2],i}},displayLiveChatCA:function(){try{$("#lowesLiveChat").length>0&&$("#lowesLiveChat").mouseover(function(){$("#divChatTooltip").hasClass("displayn")&&(jQuery("#divChatTooltip").detach().appendTo("#divEngageToolTip"),$("#divChatTooltip").removeClass("displayn"))})}catch(n){typeof postJavaError=="function"&&postJavaError("unable to add tooltip time. "+n.message)}},displayLiveChatCACheckout:function(){try{$("#divCheckLiveChat").mouseover(function(){$("#atgJS_liveChat").hasClass("displayn")&&($("#liveEngageRemove").text(""),$("#atgJS_liveChat").removeClass("displayn"),jQuery("#atgJS_liveChat").detach().appendTo("#liveEngageRemove"))})}catch(n){typeof postJavaError=="function"&&postJavaError("unable to add checkout tooltip. "+error.message)}}};addLoadEvent(loadLivePersonEngage)