function getPageCategory(){return location.pathname.toLowerCase().lastIndexOf("entry")!=-1?($(".banner").css("width","100% !important"),"entrydoor"):location.pathname.toLowerCase().lastIndexOf("commercial")!=-1?"commercial":void 0}function ChangeUrl(n,t){if(typeof history.pushState!="undefined"){var i={Page:n,Url:t};history.pushState(i,i.Page,i.Url)}}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 base64ToByteArray(n){var t,i,f;try{var r=1024,e=atob(n),o=e.length,s=Math.ceil(o/r),h=new Array(s);for(t=0;t<s;++t){var u=t*r,c=Math.min(u+r,o),l=new Array(c-u);for(i=u,f=0;i<c;++f,++i)l[f]=e[i].charCodeAt(0);h[t]=new Uint8Array(l)}return h}catch(a){return console.log("Couldn't convert to byte array: "+a),undefined}}function customCheckbox(n){var t=$('input[name="'+n+'"]');$(t).each(function(){$(this).wrap("<span class='custom-checkbox'><\/span>");$(this).is(":checked")&&$(this).parent().addClass("selected")});$(t).click(function(){$(this).parent().toggleClass("selected")})}function checkNumeric(n){var t=/^[0-9]*$/.exec(n);return t!==null?!0:!1}var bindPageEvents,updateProductQuickView;$(function(){$("#pc_headingsbox h1").css("text-transform","none !important");$("select.style").children("option:selected").val(1);$("select.style").change(function(){var t=$(this).children("option:selected").val(),i=$(this).children("option:selected").text().replace(/\s/g,"").toLowerCase(),r="https://www.clopaydoor.com/residential-garage-doors?doorstyle="+i,n;ChangeUrl("https://www.clopaydoor.com/residential-garage-doors",r);n=getParameterByName("doorstyle");(t=="1"||n=="all")&&($('div[data-productstyle="2"]').show(),$('div[data-productstyle="3"]').show(),$('div[data-productstyle="4"]').show(),$('div[data-productstyle="5"]').show(),$('div[data-productstyle="6"]').show(),$('div[data-productstyle="7"]').show(),$('div[data-productstyle="8"]').show());(t=="2"||n=="carriagehouse")&&($('div[data-productstyle="2"]').show(),$('div[data-productstyle="5"]').show(),$('div[data-productstyle="3"]').hide(),$('div[data-productstyle="4"]').hide(),$('div[data-productstyle="6"]').show(),$('div[data-productstyle="7"]').hide(),$('div[data-productstyle="8"]').show(),$(".pc_left.pc_gridboxone").removeClass("pc_second"));(t=="3"||n=="coastal")&&($('div[data-productstyle="2"]').hide(),$('div[data-productstyle="3"]').hide(),$('div[data-productstyle="4"]').hide(),$('div[data-productstyle="5"]').hide(),$('div[data-productstyle="6"]').hide(),$('div[data-productstyle="7"]').show(),$('div[data-productstyle="8"]').show(),$(".pc_left.pc_gridboxone").removeClass("pc_second"));(t=="4"||n=="modern")&&($('div[data-productstyle="2"]').hide(),$('div[data-productstyle="3"]').show(),$('div[data-productstyle="6"]').show(),$('div[data-productstyle="4"]').hide(),$('div[data-productstyle="5"]').hide(),$('div[data-productstyle="7"]').hide(),$('div[data-productstyle="8"]').hide());(t=="5"||n=="traditional")&&($('div[data-productstyle="2"]').hide(),$('div[data-productstyle="3"]').hide(),$('div[data-productstyle="4"]').show(),$('div[data-productstyle="5"]').show(),$('div[data-productstyle="6"]').hide(),$('div[data-productstyle="7"]').hide(),$('div[data-productstyle="8"]').show(),$(".pc_left.pc_gridboxone").removeClass("pc_second"))});$(".accordion_head").click(function(){$(".accordion_body").is(":visible")&&($(".accordion_body").slideUp(300),$(".plusminus").text("+"));$(this).next(".accordion_body").is(":visible")?($(this).next(".accordion_body").slideUp(300),$(this).children(".plusminus").text("+")):($(this).next(".accordion_body").slideDown(300),$(this).children(".plusminus").text("-"))});$(".inputtextbox").keypress(function(n){if(n.keyCode==13)return $("#btnSearch").click(),!1});$("#btnSearch").on("click",function(){var t=getPageCategory(),n;$("#ZipCodeTextBox").val()!==""&&(n=$("#ZipCodeTextBox").attr("value"),t=="commercial"?(analytics.track("Where To Buy Call To Action Searched",{zip_code:n}),window.open("http://www.clopaydoor.com/where-to-buy/commercial?type=commercial&loc_dealer="+n,"_self")):t=="entrydoor"?(analytics.track("Where To Buy Call To Action Searched",{zip_code:n}),window.open("http://www.clopaydoor.com/where-to-buy/entrydoor?type=entry&loc_dealer="+n,"_self")):(analytics.track("Where To Buy Call To Action Searched",{zip_code:n}),window.open("http://www.clopaydoor.com/where-to-buy/residential?type=res&loc_dealer="+n,"_self")))});$(".pc_gridboxone").click(function(){analytics.track("Product Clicked",{category:appConfig.doorType,name:$(this).find(".pc_imgbox a img").attr("title"),brand:"Clopay",url:document.URL,image_url:appConfig.domain+$(this).find(".pc_imgbox a img").attr("src")})});$(".pc_imgbox").click(function(){elementBlock("body","Loading Product information")});$(".blogCtaButton ").click(function(){elementBlock("body","Loading Product information")});$(".commercialTemplate").click(function(){elementBlock("body","Loading Product information");analytics.track("Product Clicked",{category:appConfig.doorType,name:$(this).find(".vm_imgboxcommercial a img").attr("title"),brand:"Clopay",url:document.URL,image_url:appConfig.domain+$(this).find(".vm_imgboxcommercial a img").attr("src")})});$(".entryDoorTemplate").click(function(){elementBlock("body","Loading Product information");analytics.track("Product Clicked",{category:appConfig.doorType,name:$(this).find(".vm_imgbox a img").attr("title"),brand:"Clopay",url:document.URL,image_url:appConfig.domain+$(this).find(".vm_imgbox a img").attr("src")})});window.location.href.indexOf("don-gardner")>-1&&$(".contest_banner").hide();bindPageEvents();customCheckbox("browser[]")});bindPageEvents=function(){var n,t;$(window).load(function(){(function(n){n.fn.valList=function(){return n.map(this,function(n){if(checkNumeric(n.value))return n.value||""}).join(",")}})(jQuery)});n=getPageCategory();n!==""&&n!==null&&n!==undefined?n=n.toLowerCase():(n="residential",$("#ProductImageContainer").addClass("resimagecontainer"),analytics.track("Product List Viewed",{list_id:"hot_deals_1",category:"Residential Garage Doors",products:[{product_id:"30",name:"CANYON RIDGE� collection LIMITED EDITION series",position:1,category:"Residential",url:appConfig.domain+"/canyonridge",image_url:appConfig.domain+"/images/default-source/product-image-gallery/residential/garage-door/canyon-ridge/compare-canyon-ridge-limited-edition.jpg"},{product_id:"29",name:"CANYON RIDGE� collection ULTRA-GRAIN� series",position:2,category:"Residential",url:appConfig.domain+"/canyonridgeultragrain",image_url:appConfig.domain+"/images/default-source/product-image-gallery/residential/garage-door/canyon-ridge-ug/compare-canyon-ridge-ultra-grain.jpg"},{product_id:"26",name:"CANYON RIDGE� collection MODERN series",position:3,category:"Residential",url:appConfig.domain+"/canyon-ridge-modern-garage-doors",image_url:appConfig.domain+"/images/default-source/product-image-gallery/residential/garage-door/Canyon-Ridge-Modern/comparecanyonridgemodern.jpg"},{product_id:"11",name:"COACHMAN� collection",position:4,category:"Residential",url:appConfig.domain+"/coachman",image_url:appConfig.domain+"/images/default-source/product-image-gallery/residential/garage-door/showcase-images/comparecoachman.jpg"},{product_id:"27",name:"GRAND HARBOR� collection",position:5,category:"Residential",url:appConfig.domain+"/grandharbor",image_url:appConfig.domain+"/images/default-source/product-image-gallery/residential/garage-door/showcase-images/comparegrandharbor.jpg"},{product_id:"12",name:"GALLERY� collection",position:6,category:"Residential",url:appConfig.domain+"/gallerysteel",image_url:appConfig.domain+"/images/default-source/product-image-gallery/residential/garage-door/gallery-collection/comparegallery.jpg"},{product_id:"13",name:"CLASSIC� collection",position:7,category:"Residential",url:appConfig.domain+"/classic",image_url:appConfig.domain+"/images/default-source/product-image-gallery/residential/garage-door/showcase-images/compareclassic.jpg"},{product_id:"170",name:"MODERN STEEL� collection",position:8,category:"Residential",url:appConfig.domain+"/modern-steel-collection",image_url:appConfig.domain+"/images/default-source/product-image-gallery/residential/garage-door/showcase-images/compareclassic.jpg"},{product_id:"16",name:"AVANTE� collection",position:9,category:"Residential",url:appConfig.domain+"/avante",image_url:appConfig.domain+"/images/default-source/product-image-gallery/residential/garage-door/showcase-images/compareavante.jpg"},{product_id:"8",name:"RESERVE� WOOD collection CUSTOM SERIES",position:10,category:"Residential",url:appConfig.domain+"/Reserve-Custom",image_url:appConfig.domain+"/images/default-source/product-image-gallery/residential/garage-door/reserve-custom/comparereservecustome4cc824eb5719689a9c59ff05005f6e55.jpg"},{product_id:"10",name:"RESERVE� WOOD collection LIMITED EDITION series",position:11,category:"Residential",url:appConfig.domain+"/reserve",image_url:appConfig.domain+"/images/default-source/product-image-gallery/residential/garage-door/reserve-collection-limited-edition-series/compare-reserve-limited-edition.jpg"},{product_id:"25",name:"RESERVE� WOOD collection MODERN series",position:12,category:"Residential",url:appConfig.domain+"/reserve-modern-contemporary-garage-doors",image_url:appConfig.domain+"/images/default-source/product-image-gallery/residential/garage-door/reserve-wood-modern/comparereservemodern.jpg"},{product_id:"9",name:"RESERVE� WOOD collection SEMI-CUSTOM series",position:13,category:"Residential",url:appConfig.domain+"/Reserve-Semi",image_url:appConfig.domain+"/images/default-source/product-image-gallery/residential/garage-door/reservesc/compare-reserve-semi-custom.jpg"},{product_id:"23",name:"CLASSIC� WOOD collection",position:14,category:"Residential",url:appConfig.domain+"/classicwood",image_url:appConfig.domain+"/images/default-source/product-image-gallery/residential/garage-door/showcase-images/compareclassicwood.jpg"}]}));n=="commercial"&&($("#selectValue").css("display","none"),$("#product-collection-container").removeClass("pc_mainblock"),$("#product-collection-container").addClass("pc_mainblockEntryDoor"),$(".pc_radio").remove(),$(".pc_comparetxt").remove(),$("#SeeOnMyHouseLink").hide(),$("#AddToIdeaBookLink").hide(),$(".resCompareDoorText").hide(),$("#CompareBtn").hide(),analytics.track("Product List Viewed",{list_id:"hot_deals_1",category:"Commercial Doors",products:[{product_id:"120",name:"ARCHITECTURAL SERIES",position:1,category:"Commercial Door",url:appConfig.domain+"/aluminum-doors",image_url:appConfig.domain+"/images/default-source/product-image-gallery/commercial/fullview-aluminum/arch-series-beauty.jpg"},{product_id:"100",name:"ENERGY SERIES WITH INTELLICORE�",position:2,category:"Commercial Door",url:appConfig.domain+"/insulated-polyurethane-doors",image_url:appConfig.domain+"/images/default-source/product-image-gallery/commercial/insulated-polyurethane/spokane-airport_284.png"},{product_id:"17",name:"ENERGY SERIES",position:3,category:"Commercial Door",url:appConfig.domain+"/insulated-polystyrene-doors",image_url:appConfig.domain+"/images/default-source/product-image-gallery/commercial/showcaseimages/compareinsulatedpolystyrene.jpg"},{product_id:"140",name:"INDUSTRIAL SERIES",position:4,category:"Commercial Door",url:appConfig.domain+"/industrial-overhead-doors",image_url:appConfig.domain+"/images/default-source/product-image-gallery/commercial/insulated-economy/gallery/images/beautycommercial13fd920deb5719689a9c59ff00005f6e55.jpg"},{product_id:"151",name:"SPECIALTY PRODUCTS & ACCESSORIES",position:5,category:"Commercial Door",url:appConfig.domain+"/specialty-commercial-doors",image_url:appConfig.domain+"/images/default-source/product-image-gallery/commercial/showcaseimages/comparecommercialspeciality.jpg"},{product_id:"155",name:"SERVICE DOORS",position:6,category:"Commercial Door",url:appConfig.domain+"/coilingservice-doors",image_url:appConfig.domain+"/images/default-source/product-image-gallery/commercial/showcaseimages/compareservice.jpg"},{product_id:"332",name:"COUNTER DOORS / SHUTTERS",position:7,category:"Commercial Door",url:appConfig.domain+"/coilingcountershutter-doors",image_url:appConfig.domain+"/images/default-source/product-image-gallery/commercial/showcaseimages/comparecounter.jpg"},{product_id:"153",name:"SECURITY GRILLES",position:8,category:"Commercial Door",url:appConfig.domain+"/coilinggrille-doors",image_url:appConfig.domain+"/images/default-source/product-image-gallery/commercial/showcaseimages/comparesecuritygrille.jpg"},{product_id:"154",name:"ROLL-UP SHEET DOORS",position:9,category:"Commercial Door",url:appConfig.domain+"/coiling-sheet-doors",image_url:appConfig.domain+"/images/default-source/product-image-gallery/commercial/showcaseimages/comparerollupsheet.jpg"}]}));n=="entrydoor"&&($("#selectValue").css("display","none"),$("#product-collection-container").removeClass("pc_mainblock"),$("#product-collection-container").addClass("pc_mainblockEntryDoor"),$(".pc_radio").remove(),$(".pc_comparetxt").remove(),$("#CompareBtn").hide(),analytics.track("Product List Viewed",{list_id:"hot_deals_1",category:"Entry Doors",products:[{product_id:"3",name:"ARBOR GROVE� fiberglass collection",position:1,category:"Entry Door",url:appConfig.domain+"/front-door-arborgrove",image_url:appConfig.domain+"/images/default-source/product-image-gallery/residential/entry-door/entry-arbor-images/gallery/arborgrove_cmpare.jpg"},{product_id:"2",name:"RUSTIC collection",position:2,category:"Entry Door",url:appConfig.domain+"/front-door-rustic",image_url:appConfig.domain+"/images/default-source/product-image-gallery/residential/entry-door/rustic/rustic_comparepg.png"},{product_id:"7",name:"CRAFTSMAN collection",position:3,category:"Residential",url:appConfig.domain+"/front-door-craftsman",image_url:appConfig.domain+"/images/default-source/product-image-gallery/residential/entry-door/craftsman/craftsman_comparepg.png"},{product_id:"5",name:"SMOOTH fiberglass collection",position:4,category:"Residential",url:appConfig.domain+"/front-door-smooth",image_url:appConfig.domain+"/images/default-source/product-image-gallery/residential/entry-door/smooth/smoothfg_9-12.jpg"},{product_id:"6",name:"STEEL collection",position:5,category:"Residential",url:appConfig.domain+"/entry-door-steel",image_url:appConfig.domain+"/images/default-source/product-image-gallery/residential/entry-door/steel/steel_comparepg.png"}]}));$(".pc_clickquickview").hide();$(".pc_imgbox, .vm_imgbox, .vm_imgboxcommercial").mouseover(function(){$(this).next(".pc_clickquickview").show()});$(".pc_imgbox, .vm_imgbox, .vm_imgboxcommercial").mouseout(function(){$(this).next(".pc_clickquickview").hide()});$(".pc_clickquickview").mouseover(function(){$(this).show()});$(".pc_clickquickview").mouseout(function(){$(this).hide()});t=$('<div id="pc_overlay"><\/div>');$(".pc_close").click(function(){return $(".pc_popup").hide(),t.appendTo(document.body).remove(),!1});$(".pc_x").click(function(n){$(".pc_popup").hide();t.appendTo(document.body).remove();n.preventDefault()});$(".pc_click").click(function(i){t.show();t.appendTo(document.body);var r=$(this).data("id"),u=$(this).attr("data-canonicalName");(r!=null||r!="")&&(updateProductQuickView(r,u),n=="Commercial"&&$("#SeeOnMyHouseLink").remove(),i.preventDefault())});$("#CompareBtn").click(function(n){var t=$("input:checked").valList(),i=t.split(",").length,r=$("span.custom-checkbox :checked").map(function(){return this.value}).get().join();i>1&&analytics.track("Product Compare Doors Clicked",{type:"Button",position:"Compare Doors",message:"CompareResults",name:"",product_id:r,sku:"",brand:"Clopay"});window.location.href=t===null||t===""||i<2?"/common/productresults?productids=30,29,26,11,27,12,13,170,16,8,10,25,23,9":"/common/productresults?productids="+t;n.preventDefault()})};$.fn.centerPopup=function(){return this.css("left",($(window).width()-this.width())/2+"px"),this};$(".pc_contentbox").centerPopup();$(window).resize(function(){$(".pc_contentbox").centerPopup()});updateProductQuickView=function(n,t,i){elementBlock("#product-collection-container","Loading Quick View");var i=appConfig.doorType;$.ajax({url:"/ServiceHandlers/Product.asmx/GetProduct",type:"POST",data:JSON.stringify({productId:n}),dataType:"json",contentType:"application/json; charset=utf-8",success:function(r){var u=r.d,f;$("#ProductImageContainer").html("<img src="+u.ShowcaseImage+"/>");$("#ProductTitle").html("<h2>"+u.QuickViewFormatedTitle+"<\/h2>");$("#ProductSubTitleLiteralContainer").html("<h4>"+u.FormatedShortDescription+"<\/h4>");u.Intellicore&&$("#ProductStandardsContainer").remove();$("#ProductDescriptionContainer").html(u.FormatedDescription);$("#prodID").val(n);$("div.carousel-navigation li.active").attr("data-imagepath",u.ThumbnailImage);$("div.carousel-navigation li.active").attr("Id",u.ImageIdentifier);i=="entrydoor"&&$("#SeeOnMyHouseLink").attr("href","/residential/entry-door-imagination-system");i=="residential"&&$("#SeeOnMyHouseLink").attr("href","/door-imagination-system");u.Intellicore?$("#ProductStandardsContainer").show():$("#ProductStandardsContainer").hide();elementUnBlock("#product-collection-container");$(".pc_popup").show();f=$("#ProductTitle").text();analytics.track("Product Quick View Clicked",{name:f,product_id:n,sku:"",brand:"Clopay",position:"",url:appConfig.domain+t,image_url:u.ShowcaseImage});$("#whereToBuyLink").on("click",function(){analytics.track("Where To Buy Clicked",{type:"Button",position:"Quick View",message:"Where to Buy",name:f,product_id:n,sku:"",brand:"Clopay",url:appConfig.domain+t,image_url:u.ShowcaseImage})});$("#SeeOnMyHouseLink").on("click",function(){analytics.track("Door Visualizer Clicked",{type:"Button",position:"Quick View",message:"See On My House",name:f,product_id:n,sku:"",brand:"Clopay",url:appConfig.domain+t,image_url:u.ShowcaseImage})});$("#AddToIdeaBookLink").on("click",function(){analytics.track("Add To Idea Book Clicked",{type:"Button",position:"Quick View",message:"Add To Idea Book",name:f,product_id:n,sku:"",brand:"Clopay",url:appConfig.domain+t,image_url:u.ShowcaseImage})})},error:function(){$(".pc_popup").hide();$("#pc_overlay").remove();elementUnBlock("#product-collection-container");errorAlert("There is server error in processing your request.","Request Error")}})},function(n,t,i,r){function l(n,t){return n[t]===r?u[t]:n[t]}function g(){var n=t.pageYOffset;return n===r?f.scrollTop:n}function h(n,t){var i=u["on"+n];i&&(k(i)?i.call(t[0]):(i.addClass&&t.addClass(i.addClass),i.removeClass&&t.removeClass(i.removeClass)));t.trigger("lazy"+n,[t]);a()}function nt(t){h(t.type,n(this).off(w,nt))}function tt(i){var b,it;if(e.length){i=i||u.forceLoad;c=Infinity;for(var rt=g(),ot=t.innerHeight||f.clientHeight,st=t.innerWidth||f.clientWidth,s=0,a=e.length;s<a;s++){var l=e[s],r=l[0],v=l[o],d=!1,tt=i,y;if(et(f,r)){if(i||!v.visibleOnly||r.offsetWidth||r.offsetHeight){if(!tt){var p=r.getBoundingClientRect(),ut=v.edgeX,ft=v.edgeY;y=p.top+rt-ft-ot;tt=y<=rt&&p.bottom>-ft&&p.left<=st+ut&&p.right>-ut}if(tt){if(h("show",l),b=v.srcAttr,it=k(b)?b(l):r.getAttribute(b),it){l.on(w,nt);r.src=it}d=!0}else y<c&&(c=y)}}else d=!0;d&&(e.splice(s--,1),a--)}a||h("complete",n(f))}}function it(){s>1?(s=1,tt(),setTimeout(it,u.throttle)):s=0}function a(n){e.length&&(n&&n.type==="scroll"&&n.currentTarget===t&&c>=g()||(s||setTimeout(it,0),s=2))}function rt(){y.lazyLoadXT()}function ot(){tt(!0)}var o="lazyLoadXT",p="lazied",w="load error",v="lazy-hidden",f=i.documentElement||i.body,ut=t.onscroll===r||!!t.operamini||!f.getBoundingClientRect,u={autoInit:!0,selector:"img[data-img]",blankImage:"data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7",throttle:99,forceLoad:ut,loadEvent:"pageshow",updateEvent:"load orientationchange resize scroll touchmove focus",forceEvent:"",oninit:{removeClass:"lazy"},onshow:{addClass:v},onload:{removeClass:v,addClass:"lazy-loaded"},onerror:{removeClass:v},checkDuplicates:!0},b={srcAttr:"data-img",edgeX:0,edgeY:0,visibleOnly:!0},y=n(t),k=n.isFunction,d=n.extend,ft=n.data||function(t,i){return n(t).data(i)},et=n.contains||function(n,t){while(t=t.parentNode)if(t===n)return!0;return!1},e=[],c=0,s=0;n[o]=d(u,b,n[o]);n.fn[o]=function(i){i=i||{};var f=l(i,"blankImage"),c=l(i,"checkDuplicates"),v=l(i,"scrollContainer"),s={},r;n(v).on("scroll",a);for(r in b)s[r]=l(i,r);return this.each(function(r,l){if(l===t)n(u.selector).lazyLoadXT(i);else{if(c&&ft(l,p))return;var a=n(l).data(p,1);f&&l.tagName==="IMG"&&!l.src&&(l.src=f);a[o]=d({},s);h("init",a);e.push(a)}})};n(i).ready(function(){h("start",y);y.on(u.loadEvent,rt).on(u.updateEvent,a).on(u.forceEvent,ot);n(i).on(u.updateEvent,a);u.autoInit&&rt()})}(window.jQuery||window.Zepto||window.$,window,document)