Back to Top
//cart var cartChecked = 0; cartRan=false; //before timeout var mCartCheck = 0; window.addEventListener("load", wCart); window.addEventListener("resize", wCart); function wCart(){ if (window.innerWidth<=958){ if (mCartCheck<=0){ cartTimeOut = window.setInterval(mobileCart(), 500); } } else { //if (!cart_count){var cart_count=0;}; if (cartChecked<=0){ check4Cart = window.setInterval("setCart4header()", 800); } } } function setCart4header(){ if(document.getElementById("link-cart")!=null) { if (cart_count==null){}else{ document.getElementById("link-cart").innerHTML = "Shopping Cart ("+cart_count+")"; } if ((cartChecked >= 12)){if (typeof check4Cart==='undefined'){}else{clearInterval(check4Cart);}}; cartChecked = cartChecked +1; } } //$(window).resize(function(){closeAll();mobileCart();}) function mobileCart() { if (typeof global_elements_jq !== 'undefined') { //during timeout mCartCheck = mCartCheck+1; if (cart_count==null){}else{ cartNu = cart_count; if(parseInt(cartNu)){ cartNu = "

"+cartNu+"

"; document.getElementById("mob-cart").innerHTML = cartNu cartRan=true; } if(parseInt(cartNu)>9){cartNu = '

9'+'+

';cartRan=true;} //after timeout if(mCartCheck>5){cartRan = true;} if(cartRan){if (typeof cartTimeOut==='undefined'){}else{window.clearInterval(cartTimeOut);}} if (typeof cartTimeOut==='undefined'){}else{clearInterval(cartTimeOut);} } } } storeHost = "store.usps.com"; // Get current URL if (!appID) { var appID = "Phoenix"; } else if (appID=="ATG") { currentPage="https://"+storeHost+"/store"; currentPageIn="https://"+storeHost+document.location.pathname+document.location.search; currentPageIn=prepURL(currentPageIn); } if (document.location.pathname.indexOf("holdmail")!=-1){ currentPageIn="https://"+storeHost+"/holdmail/"; } if (document.location.pathname.indexOf("redelivery")!=-1) { currentPageIn="https://"+storeHost+"/redelivery/"; if((typeof isUserLoggedIn !== 'undefined')&&(isUserLoggedIn)){ document.getElementById("link-cart").setAttribute('display', 'none'); document.getElementById("mob-cart").setAttribute('display', 'none'); } } if (document.location.pathname.indexOf("pse")!=-1) { currentPageIn="https://"+storeHost+"/store/pse/"; } if (document.location.pathname.indexOf("pfs")!=-1) { currentPageIn="https://"+storeHost+"/pfs/"; }