(function(){if(document.readyState==="complete"||(document.readyState!=="loading"&&!document.documentElement.doScroll)){pfHashEvent()}else{document.addEventListener("DOMContentLoaded",pfHashEvent)} handle_product_finder();function pfHashEvent(){var hash=location.hash;if(hash.indexOf("#pf")==0){if(hash=="#pf-restart"){var string="/product-finder/?ajax"}else{var vals=hash.split("/");var string="/product-finder/?pf&ajax&";var count=1;vals.forEach(function(val){if(val!="#pf"){string+="q"+count+"="+escape(val)+"&";count++}})} product_finder_status();product_finder_go(string)}} window.addEventListener("hashchange",pfHashEvent)})();function handle_product_finder(){document.querySelectorAll('#product_finder a').forEach(function(el){if(!el.classList.contains("link_out"))el.addEventListener("click",function(ev){ev.preventDefault();console.log(this.getAttribute("href"));var hash="#"+this.getAttribute("href").replace("?","").replace("/product-finder/","").replace("&ajax","").replace(/\&q[0-9]+\=/g,"/").replace(" ","+").replace("&sqft=","/sqft=").toLowerCase();window.location.hash=hash})});if(document.querySelector('#product_finder form')){document.querySelector('#product_finder form').addEventListener('submit',function(ev){ev.preventDefault();var hash="#pf"+ev.target.getAttribute("data-query").replace("?","").replace("/product-finder/","").replace("&ajax","").replace(/\&q[0-9]+\=/g,"/").replace(" ","+").replace("&sqft=","/sqft=").toLowerCase();if(document.getElementById('product_finder_sqft')){var val=document.getElementById('product_finder_sqft').value;if(val*1!=val)val=0;hash+="/sqft="+val} window.location.hash=hash})} if(document.querySelector('#product_finder form #product_finder_sqft'))document.querySelector('#product_finder form #product_finder_sqft').focus()} function product_finder_go(href){var xhttp=new XMLHttpRequest();xhttp.onreadystatechange=function(){if(this.readyState==4&&this.status==200){document.getElementById('product_finder').innerHTML=this.responseText;if(typeof handleDFN==="function")handleDFN();handle_product_finder();scrollIt(document.getElementById("product_finder_anchor"),200,'easeOutQuad')}};xhttp.open("GET",href,!0);xhttp.setRequestHeader("Content-Type","application/x-www-form-urlencoded");var data=new FormData();data.append("ajax",!0);xhttp.send(data);if(typeof gsa==='function')gsa("#pfinder:"+href)} function product_finder_status(){if(document.querySelector('#product_finder .status')){document.querySelector('#product_finder .status').innerHTML='
';document.querySelector('#product_finder .status').classList.add("status-loading")}}