function init(){postalMessage=postalCodeDefault[0];if(document.getElementById("postalCode")!=null){document.getElementById("postalCode").value=postalMessage;document.getElementById("postalCode").style.color="Gray"}if(document.getElementById("span_shippingRates")!=null&&trim(document.getElementById("span_shippingRates").innerHTML)!=""){hidetbody("t_shipping");
showtbody("t_shippingRates");document.getElementById("link_calculateShipping").enabled=false;document.getElementById("link_calculateShipping").href="#";document.getElementById("postalCode").value=postalCode;document.getElementById("postalCode").style.color="Black";
document.getElementById("shippingType").value=addressType;document.getElementById("shippingRates").value=selectedOption;if(countryCode!="undefined"){document.getElementById("country").value=countryCode}}}function addGiftWrapping(A){updateCartInfo(A)}function saveComments(B){var A;
A='<cart><cartid value="'+document.getElementById("cartID").value+'"/>';A+="<comments>"+encodeHTML(B.value)+"</comments>";A+="</cart>";updateCartInfo(A);document.getElementById("cmd_saveComments").disabled=true}function ShowShippingOptions(B){var A=false;if(document.getElementById("postalCode").value==postalMessage){document.getElementById("postalCode").value=""
}switch(B.value){case"0":hidetbody("shippingCountries");postalMessage=postalCodeDefault[0];break;case"1":hidetbody("shippingCountries");postalMessage=postalCodeDefault[0];break;case"2":document.getElementById("shippingCountries").style.display="inline";postalMessage=postalCodeDefault[1];
break}if(document.getElementById("postalCode").value==""){document.getElementById("postalCode").value=postalMessage;document.getElementById("postalCode").style.color="Gray"}}function EnterPromo(){showtbody("addPromotion");s.pageName="Shopping Cart Micro (I Have A Promotion)";
void (s.t())}function GetRates(){var B;var A="undefined";s.pageName="Shopping Cart Micro (Get Rates)";void (s.t());if(document.getElementById("postalCode").value.length>=5){if(document.getElementById("postalCode").value.indexOf("Enter")>-1){alert(postalMessage.replace("Enter","Enter in your")+" code")
}else{if(document.getElementById("shippingCountries").style.display!="none"){A=document.getElementById("country").value}B='<cart><cartid value="'+document.getElementById("cartID").value+'"/>';B+='<shipping value="undefined" addressType="'+document.getElementById("shippingType").value+'" countryCode="'+A+'" postalCode="'+document.getElementById("postalCode").value+'"/>';
B+="</cart>";updateCartInfo(B);hidetbody("t_shipping");showtbody("t_shippingRates")}}else{alert(postalMessage.replace("Enter","Enter in your")+" code")}}function setShippingRate(C){var B;var A="undefined";if(document.getElementById("shippingCountries").style.display!="none"){A=document.getElementById("country").value
}B=C.options[C.selectedIndex].innerHTML;B='<cart><cartid value="'+document.getElementById("cartID").value+'"/>';B+='<shipping value="'+C.value+'" addressType="'+document.getElementById("shippingType").value+'" countryCode="'+A+'" postalCode="'+document.getElementById("postalCode").value+'" />';
B+="</cart>";updateCartInfo(B)}function ajaxUpdateCartInfo(A){ajaxGetCartInfo(A)}function updateCartInfo(B){B=URLEncode(B);var A=new AJAX();A.callService(baseURL+"services/Cart.asmx","UpdateCartInfo","xmlParameters="+B)}function ajaxUpdateCheckoutInfo(A){ajaxGetCartInfo(A)
}function getCartInfo(B){var A=new AJAX();A.callService(baseURL+"services/Cart.asmx","GetCartInfo","htmlTable="+B,"cartID="+document.getElementById("cartID").value)}function ajaxGetCartInfo(A){if(A.indexOf("shipping")>-1&&document.getElementById("span_shippingRates")!=null){document.getElementById("span_shippingRates").innerHTML=stripCDATA(xmlValue(A,"shipping"))
}if(A.indexOf("shippingValue")>-1){if(trim(stripCDATA(xmlValue(A,"shippingValue")))==""){if(document.getElementById("t_shipping")!=null&&document.getElementById("link_calculateShipping")==null){hidetbody("t_shipping");hidetbody("t_shippingHeader");hidetbody("t_shippingRates")
}}else{document.getElementById("shippingValue").innerHTML=stripCDATA(xmlValue(A,"shippingValue"))}}if(A.indexOf("promotion")>-1){document.getElementById("promotion").innerHTML=stripCDATA(xmlValue(A,"promotion"))}if(A.indexOf("cartItems")>-1){document.getElementById("cartItems").innerHTML=stripCDATA(xmlValue(A,"cartItems"))
}if(A.indexOf("subTotal")>-1){document.getElementById("subTotal").innerHTML=stripCDATA(xmlValue(A,"subTotal")).replace("]]>","")}if(A.indexOf("estimateTotal")>-1){document.getElementById("estimateTotal").innerHTML=stripCDATA(xmlValue(A,"estimateTotal"))}if(A.indexOf("promotionValue")>-1){document.getElementById("promotionValue").innerHTML=stripCDATA(xmlValue(A,"promotionValue"))
}}function removePromotion(){updateCartInfo('<cart><cartid value="'+document.getElementById("cartID").value+'"/><promotion code=""/></cart>')}function applyPromotion(A){updateCartInfo('<cart><cartid value="'+document.getElementById("cartID").value+'"/><promotion code="'+document.getElementById("newPromo").value+'"/></cart>')
}function RemoveItem(D){var A;var C=cartItems.length;for(var B=0;B<cartItems.length;B++){if(cartItems[B]==D){cartItems[B]=""}if(cartItems[B]==""){C--}}A='<cart><cartid value="'+document.getElementById("cartID").value+'"/><cartItems><cartItem action="delete" id="'+D+'"/></cartItems></cart>';
updateCartInfo(A);if(C==0){if(document.getElementById("t_shippingHeader")!=null){hidetbody("t_shippingHeader")}hidetbody("t_shipping");if(document.getElementById("t_promotion")!=null){hidetbody("t_promotion")}hidetbody("t_shippingRates");hidetbody("t_altCheckout");
hide_span("s_updateQuantity");hide_span("s_clickToCheckout");document.getElementById("estimateTotal").innerHTML="$0.00"}}function UpdateQuantity(C){var A;A='<cart><cartid value="'+document.getElementById("cartID").value+'"/><cartItems>';for(var B=0;B<cartItems.length;
B++){if(cartItems[B]!=""){if(document.getElementById("qty"+cartItems[B]).value==0){A+='<cartItem action="delete" id="'+cartItems[B]+'" '}else{A+='<cartItem action="update" id="'+cartItems[B]+'" quantity="'+parseInt(document.getElementById("qty"+cartItems[B]).value)+'" '
}if(document.getElementById("item"+cartItems[B])!=null&&document.getElementById("item"+cartItems[B]).value>0){A+='newPrice="'+parseFloat(document.getElementById("item"+cartItems[B]).value)+'" '}if(document.getElementById("setup"+cartItems[B])!=null&&document.getElementById("setup"+cartItems[B]).value>=0){A+='setupCharge="'+parseFloat(document.getElementById("setup"+cartItems[B]).value)+'" '
}A+="/>"}}A+="</cartItems></cart>";updateCartInfo(A)}function togglePersonalizationRush(A){if(A.checked){redirect("/cart.aspx?personalizationRush=true")}else{redirect("/cart.aspx?personalizationRush=false")}}