var FlatRateShipping = 9.99; var total = 0.00
var shipping = FlatRateShipping; var services = new Array(); var HasShipping = false; var ShippingID = 0; var RetrievedServices = false; var services; var DEFAULT_SERVICEID = '1'; var PastZip = ""; var ShippingAddressPrevious = 0; var BillingAddressPrevious = 0; Event.observe(document, "dom:loaded", RecalculateEverything); Event.observe(document, "dom:loaded", GetProductShippingEstimate); function AddGiftCertificate() {
if ($("GiftCertificate").value != "") {
$("CertificateFeedback").className = ""; $("CertificateFeedback").update('<span class="loading-ajax"><img src="./icons/checkout/waiting.gif" alt="" /> Please wait while we apply this gift certificate to your order...</span>'); new Ajax.Request('./CheckoutService.aspx',
{
method: 'post',
parameters: SerializeForm() + "&ServiceName=AddGiftCertificate",
onSuccess: function(transport) {
var data = transport.responseText; if (data.indexOf("value") == -1) {
$("CertificateFeedback").addClassName("error-giftcert"); }
else {
$("CertificateFeedback").addClassName("confirm-giftcert"); }
$("CertificateFeedback").update(data); RecalculateEverything(); },
onFailure: function() {
$("CertificateFeedback").update("There was an error processing your request. Please try again later"); $("CertificateFeedback").addClassName("error-giftcert"); }
}
); }
}
function AddCoupon() {
if ($(ShoppingCartTxtCoupon).value != "") {
$(ShoppingCartTxtCoupon).className = ""; new Ajax.Request('./CheckoutService.aspx',
{
method: 'post',
parameters: SerializeForm() + "&ServiceName=AddCoupon",
onSuccess: function(transport) {
var data = transport.responseText; if (data != "1") {
$(ShoppingCartCouponMessage).update(data); }
else {
$(ShoppingCartCouponMessage).update("The coupon was successfully added. If you still have a coupon total of <b>$0.00</b>, this means that your coupon was not applicable to any of the items in your shopping cart."); $(ShoppingCartCouponMessage).addClassName("error-giftcert"); RecalculateEverything(); }
},
onFailure: function() {
$(ShoppingCartCouponMessage).update("There was an error processing your request. Please try again later"); $(ShoppingCartCouponMessage).addClassName("error-giftcert"); }
}
); }
}
function Forgot() {
$('ReturningCustomerDiv').hide(); $('ForgotPasswordDiv').show(); return; }
function DoLoginAndGetFancyShow(obj) {
var idd = obj.id; readmore('login'); new Ajax.Request(window.location.href,
{
method: 'post',
parameters: Form.serializeElements($$('input[type="text"]', 'input[type="password"]')) + "&AjaxWow=" + idd,
onSuccess: function(transport) {
var data = transport.responseText; if (data.length < 1000) {
$("LoginError").update(data.replace(/<LI>/, "")).addClassName("error-ajax"); readless(); return; }
$("LoginForm").hide(); if (data.indexOf("<!-- Begin Ajax Magic -->") != -1 &&
data.indexOf("<!-- End Ajax Magic -->") != -1) {
data = data.substring(data.indexOf("<!-- Begin Ajax Magic -->")); data = data.substring(0, data.indexOf("<!-- End Ajax Magic -->")); $("FullFormForCheckout").update(data); $("FullFormForCheckout").show(); }
else {
window.location.href += "?t=1"; return; }
RecalculateEverything(); readless(); },
onFailure: function() {
$("LoginError").update("Unfortunately, there was a system error logging you in.  Please try again."); readless(); }
}
); }
function GetProductShippingEstimate() {
if ($("ShippingZip") == null) return; var zip = $("ShippingZip").value.toUpperCase(); var reg = /^([0-9]{5}|[a-zA-Z][0-9][a-zA-Z][0-9][a-zA-Z][0-9])$/; if (!zip.match(reg)) {
return; }
new Ajax.Request('./CheckoutService.aspx',
{
method: 'post',
parameters: SerializeForm() + "&ServiceName=GetProductShippingEstimate",
onSuccess: function(transport) {
var data = transport.responseText.evalJSON(); data.each(function(item) {
var message = ""; if (item.IsArrivalEstimate) {
message += "<b>Estimated Arrival Date</b><br />"; }
else {
message += "<b>Estimated Ship Date</b><br />"; }
message += "<small>" + item.Date + "</small>"; $$('input[value="' + item.ProductID + '"][type="hidden"]')[0].up("tr").down("td.shipping-for-product").update(message); }); },
onFailure: function() {
$$("td.shipping-for-product").each(function(item) { item.update("Unable to calculate"); }); }
}
); }
function RecalculateEverything() {
if ($(ShoppingCartZip) == null && $("ShippingZip") == null)
return; new Ajax.Request('/CheckoutService.aspx',
{
method: 'post',
parameters: SerializeForm() + "&ShippingCost=" + shipping + "&ServiceName=GetEverything",
onSuccess: function(transport) {
var data = transport.responseText.evalJSON(); $("subtotal").update(currency_format(data.SubTotal)); $("tax").update(currency_format(data.Tax)); $("handlingfees").update(currency_format(data.Handling)); if (data.Tax == 0.00) {
$("tax_tbody").style.display = 'none'; }
else {
$("tax_tbody").style.display = ''; }
if (data.Handling == 0.00) {
$("HandlingFeesTbody").hide(); }
else {
$("HandlingFeesTbody").show(); }
if (parseFloat(data.GiftWrap) > 0.00) {
$("GiftWrapTbody").style.display = ''; }
else {
$("GiftWrapTbody").style.display = 'none'; }
$("GiftWrapCharges").update(currency_format(data.GiftWrap)); if (parseFloat(data.Coupons) > 0.00) {
$("CouponsTotal").style.color = "#CC0000"; if ($("CouponTBody") != null && $("CouponTBody").style.display != 'none') {
$("CouponTBody").hide(); if ($("SpecialCouponTbody") != null) {
$("SpecialCouponTbody").show(); }
if ($("CouponToggle") != null) {
$("CouponToggle").src = "./icons/checkout/pill_maximize.gif"; $("CouponToggle").up("tr").down("td.pill-left").removeClassName("pill-left-dropdown"); }
}
$("CouponsTotal").update("(" + currency_format(data.Coupons) + ")"); if ($(ShoppingCartCouponMessage) != null) {
$(ShoppingCartCouponMessage).update(data.CouponMessage); }
}
else {
$("CouponsTotal").update(currency_format(data.Coupons)); $("CouponsTotal").style.color = ""; if ($("CouponTBody") != null && $("CouponTBody").style.display != 'none') {
if ($("SpecialCouponTbody") != null) {
$("SpecialCouponTbody").show(); }
if ($("CouponToggle") != null) {
$("CouponToggle").src = "./icons/checkout/pill_minimize.gif"; $("CouponToggle").up("tr").down("td.pill-left").removeClassName("pill-left-dropdown"); }
}
if ($(ShoppingCartCouponMessage) != null) {
$(ShoppingCartCouponMessage).update(data.CouponMessage); if ($("SpecialCouponTbody") != null) {
$("SpecialCouponTbody").show(); }
if ($("CouponTBody") != null) {
$("CouponTBody").show(); }
if ($("CouponToggle") != null) {
$("CouponToggle").src = "./icons/checkout/pill_minimize.gif"; $("CouponToggle").up("tr").down("td.pill-left").removeClassName("pill-left-dropdown"); }
}
}
if (data.GiftCertificate > 0.00) {
if ($("SpecialGiftCertificateTbody") != null) {
$("GiftCertificateTotal").update("(" + currency_format(Math.min(data.GiftCertificate, data.Total + shipping)) + ")"); $("GiftCertificateTotal").style.color = "#CC0000"; $("SpecialGiftCertificateTbody").style.display = ''; $("CertificateFeedback").update("The gift certificate you added has a <b>current</b> value of " + currency_format(data.GiftCertificate) + "."); $("CertificateFeedback").addClassName("confirm-giftcert"); }
}
else {
if ($("SpecialGiftCertificateTbody") != null) {
$("GiftCertificateTotal").style.color = ""; $("GiftCertificateTotal").update(currency_format(Math.min(data.GiftCertificate, data.Total + shipping))); $("SpecialGiftCertificateTbody").style.display = 'none'; }
}
total = data.Total; fake_total = Math.max(0, data.Total + shipping - data.GiftCertificate); if ($("CCOptions") != null) {
if (fake_total > 0) {
$("CCOptions").style.display = ''; }
else {
$("CCOptions").style.display = 'none'; }
}
$("total").update(currency_format(data.Total + shipping - Math.min(data.GiftCertificate, data.Total + shipping))); if ($("header_cart_text") != null) {
$("header_cart_text").update("<b>" + data.ItemCount + "</b> Items"); }
},
onFailure: function() {
alert("Unfortunately, there was an error updating your order."); }
}
); }
function ToggleShowCoupons() {
if ($("CouponTBody") != null &&
$("CouponToggle") != null) {
if ($("CouponTBody").style.display != 'none') {
$("CouponTBody").hide(); $("CouponToggle").src = "./icons/checkout/pill_maximize.gif"; $("CouponToggle").up("tr").down("td.pill-left").removeClassName("pill-left-dropdown"); }
else {
$("CouponTBody").show(); $("CouponToggle").src = "./icons/checkout/pill_minimize.gif"; $("CouponToggle").up("tr").down("td.pill-left").addClassName("pill-left-dropdown"); }
}
}
function GetRate() {
GetRateWithObj(this); }
function GetRateWithObj(obj) {
GetRateWithObj2(obj, true); }
function GetRateWithObj2(obj, hide_shipping) {
var foo = parseFloat(obj.getAttribute("cost")); shipping = foo; $("shippingcost").update(currency_format(foo)); HasShipping = true; GetProductShippingEstimate(); if (hide_shipping) {
toggleShowShipping(); }
RecalculateEverything(); }
function getCityStateFromZip(obj, address_type, do_foo) {
var zip = obj.value.toUpperCase().replace(/ /, ""); var reg = /^([0-9]{5}|[a-zA-Z][0-9][a-zA-Z][0-9][a-zA-Z][0-9])$/; if (!zip.match(reg)) {
return; }
if (address_type == "Shipping" && do_foo) {
getShippingOptions($("ShippingZip")); }
new Ajax.Request('./CheckoutService.aspx',
{
method: 'post',
parameters: "Zip=" + obj.value + "&ServiceName=GetCityState",
onSuccess: function(transport) {
var data = transport.responseText.evalJSON(); $$("#" + address_type + "State option").each(function(item) {
item.selected = (item.value == data.State); }
); $$("#" + address_type + "Country option").each(function(item) {
item.selected = (item.value == data.Country); }
); if (data.City != "") {
if ($(address_type + "City").hasAttribute("AutoZip")) {
$(address_type + "City").value = data.City; $(address_type + "City").setAttribute("AutoZip", "1"); }
else if ($(address_type + "City").value == "") {
$(address_type + "City").value = data.City; $(address_type + "City").setAttribute("AutoZip", "1"); }
}
},
onFailure: function() {
alert("We are unable to retrieve your City and State at this time."); }
}
); return true; }
function getShippingOptions(obj) {
var zip = obj.value.toUpperCase().replace(/ /, ""); var reg = /^([0-9]{5}|[a-zA-Z][0-9][a-zA-Z][0-9][a-zA-Z][0-9])$/; if (!zip.match(reg)) {
if (reg.length >= 5) {
}
return; }
/*if (zip == PastZip)
return; */
PastZip = zip; var foo = $("ShippingOptionsDiv"); if (foo != null) {
foo.show(); }
$("service").update('<span class="loading-ajax"><img src="./icons/checkout/waiting.gif" alt="" /> Updating Shipping Options</span>'); $("service").style.display = ''; HasShipping = false; RetrievedServices = false; new Ajax.Request('./CheckoutService.aspx',
{
method: 'post',
parameters: SerializeForm() + "&ServiceName=GetServices",
onSuccess: function(transport) {
if (transport.responseText.indexOf("error") == 0) {
$("shippingcost").update(currency_format(FlatRateShipping)); $("service").update(); if ($("ShippingOptionsTBody") != null) {
$("ShippingOptionsTBody").show(); $("ShippingOptionsToggle").src = "./icons/checkout/minimize.gif"; }
return; }
else if (transport.responseText.indexOf("cannotship") == 0) {
$("service").update('<span class="error-ajax">Unfortunately, we are unable to ship these items to this location.</span>'); }
else {
$("service").update(); services = transport.responseText.evalJSON(); }
var i = 0; var table = document.createElement("table"); $("service").appendChild(table); if (services.length == 0) {
$("service").update('<span class="error-ajax">Unfortunately, we are unable to ship these items to this location.</span>'); var foo = $("ShippingOptionsDiv"); if (foo != null) {
foo.style.display = 'block'; }
if ($("ShippingOptionsTBody") != null) {
$("ShippingOptionsTBody").show(); $("ShippingOptionsToggle").src = "./icons/checkout/minimize.gif"; }
RetrievedServices = true; }
else {
var has_one = (services.length == 1); var id_to_select = ''; services.each(function(item) {
var row = table.insertRow(-1); var cell1 = row.insertCell(-1); var cell2 = row.insertCell(-1); cell1.setAttribute("cost", item.Rate); $(cell1).update('<input type="radio" name="Service" value="' + item.ServiceBabyAgeID + '" id="Service-' + i + '" />'); $(cell1).select("input")[0].setAttribute("cost", item.Rate); $(cell1).select("input")[0].onclick = GetRate; if (has_one) {
$(cell1).select("input")[0].checked = true; }
if (item.ServiceBabyAgeID == DEFAULT_SERVICEID) {
$(cell1).select("input")[0].checked = true; }
var label = document.createElement("label"); label.setAttribute("for", "Service-" + i); $(label).update(item.Description); cell2.appendChild(label); cell1.setAttribute("valign", "top"); cell2.setAttribute("valign", "top"); if (has_one) {
GetRateWithObj($(cell1).select("input")[0]); }
else if (item.ServiceBabyAgeID == DEFAULT_SERVICEID) {
id_to_select = 'Service-' + i; }
i++; }); GetRateWithObj2($(id_to_select), false); var foo = $("ShippingOptionsDiv"); if (foo != null) {
foo.style.display = 'block'; }
if ($("ShippingOptionsTBody") != null) {
$("ShippingOptionsTBody").show(); $("ShippingOptionsToggle").src = "./icons/checkout/minimize.gif"; }
RetrievedServices = true; }
RecalculateEverything(); },
onFailure: function() {
$("service").update('<span class="error-ajax">Unfortunately, we are unable to present your shipping options at this time.</span>'); }
}
); return true; }
function toggleShowShipping() {
var id = ""; var prefix = ""; var img = ""; if ($("ShippingOptionsTBody") != null) {
id = "ShippingOptionsTBody"; }
else if ($("ShippingTbody") != null) {
id = "ShippingTbody"; prefix = "pill_"; }
if (id != "") {
if ($("ShippingOptionsToggle").src.match(/minimize/)) {
$(id).hide(); $("ShippingOptionsToggle").src = "./icons/checkout/" + prefix + "maximize.gif"; if (prefix != "") {
$("ShippingOptionsToggle").up("tr").down("td.pill-left").removeClassName("pill-left-dropdown"); }
}
else {
$(id).show(); $("ShippingOptionsToggle").src = "./icons/checkout/" + prefix + "minimize.gif"; if (prefix != "") {
$("ShippingOptionsToggle").up("tr").down("td.pill-left").addClassName("pill-left-dropdown"); }
}
}
}
function toggle_giftwrap(obj) {
var img = obj; var input = obj.parentNode.getElementsByTagName("input")[0]; if (img.src.indexOf("_y.gif") != -1) {
img.src = "icons/checkout/giftwrap_n.gif"; input.value = 'N'; }
else if (img.src.indexOf("_n.gif") != -1) {
img.src = "icons/checkout/giftwrap_y.gif"; input.value = 'Y'; }
else {
img.onclick = function(e) { }; }
RecalculateEverything(); }
function updateShipping() {
}
function toggleShowBilling(obj) {
if (obj.checked == true) {
if ($("BillingAddressForm") != null) {
$("BillingAddressForm").style.display = 'none'; }
else if ($("NewBillingAddress") != null) {
$("NewBillingAddress").style.display = 'none'; }
}
else {
if ($("BillingAddressForm") != null) {
$("BillingAddressForm").style.display = ''; }
else if ($("NewBillingAddress") != null) {
$("NewBillingAddress").style.display = ''; }
}
}
function updateGiftMessageCount(obj) {
var MAX = 250; var length = obj.value.length; if (length >= MAX) {
obj.value = obj.value.substring(0, MAX); }
$("GiftMessageCount").update(Math.max(0, MAX - obj.value.length)); }
function onQuantityChange(obj) {
var price_cell = $(obj.parentNode).next(); var price_hidden = $(obj).next(); if (obj.value == "") {
obj.value = "0"; }
if (parseInt(obj.value, 10) > 1) {
obj.value = parseInt(obj.value, 10); price_cell.update("<div class=\"price-times\">" + number_format(obj.value) + " x " + currency_format(price_hidden.value) + "</div>" + currency_format(parseInt(obj.value) * parseFloat(price_hidden.value))); }
else {
obj.value = parseInt(obj.value, 10); price_cell.update(currency_format(parseInt(obj.value) * parseFloat(price_hidden.value))); }
if ($(ShoppingCartZip).value != "") {
PastZip = ""; getShippingOptions($(ShoppingCartZip)); }
RecalculateEverything(); }
function updateShippingCityState() {
}
function number_format(num) {
num = num + ""; i = 0; while (num.search(/[0-9]{4}/) != -1 && ++i < 15) {
num = num.replace(/([0-9]{3})(\.|,|$)/, ",$1$2"); }
return num; }
function currency_format(num) {
var is_negative = false; if (parseFloat(num) < 0) {
is_negative = true; }
num = Math.abs(parseFloat(num)).toFixed(2) + ""; num = number_format(num); if (is_negative) {
return "-$" + num; }
else {
return "$" + num; }
}
function Delete(ProductID) {
var ok = confirm("Are you sure you wish to remove this product from your shopping cart?"); if (!ok) {
return; }
new Ajax.Request('./CheckoutService.aspx',
{
method: 'post',
parameters: "ServiceName=Remove&ProductID=" + ProductID,
onSuccess: function(transport) {
var block = $$('input[type="hidden"][value="' + ProductID + '"]'); var node = block[0]; node = node.up("tr"); if (node != undefined) {
node.parentNode.removeChild(node); }
if ($$('#CheckoutTableWrap input[disabled="disabled"]').length > 0) {
window.location.reload(true); }
var i = 0; $$("#CheckoutTableWrap tr").each(function(item) {
if (item.className.indexOf("shopping-cart-item-") == 0) {
item.className = "shopping-cart-item-" + (i % 2); i++; }
}); if (i == 0) {
var table = $("CheckoutTableWrap").down("table"); var row = table.insertRow(1); row.className = 'shopping-cart-item-0'; var cell1 = row.insertCell(-1); cell1.colSpan = '5'; $(cell1).update("Your shopping cart is empty. Please use the links below to see some of our great products."); }
},
onFailure: function() {
alert("There was an error while removing this item from your shopping cart. Please refresh this page."); }
}
); RecalculateEverything(); }
function SerializeForm() {
return Form.serializeElements($$('.shopping-cart-item-0 input', '.shopping-cart-item-1 input', 'input[type="text"]', 'input[type="radio"]')); }
function UpdateCreditCard() {
$("creditcardimage").src = "./icons/checkout/cards/" + DetermineCreditCardType($("CardNumber")); }
function DetermineCreditCardType(textbox) {
var creditcard = textbox.value.replace(/[^0-9]/, ""); var valid = mod10(creditcard); if (creditcard.search(/^(34|37)/) != -1) {
return "amex.gif"; }
if (creditcard.search(/^(51|52|53|54|55)/) != -1) {
return "mastercard.gif"; }
if (creditcard.search(/^4/) != -1) {
return "visa.gif"; }
if (creditcard.search(/^(6011|65)/) != -1) {
return "discover.gif"; }
return "blank.gif"; }
function mod10(cardNumber) {
var clen = new Array(cardNumber.length); var n = 0, sum = 0; for (n = 0; n < cardNumber.length; ++n) {
clen[n] = parseInt(cardNumber.charAt(n)); }
for (n = clen.length - 2; n >= 0; n -= 2)
clen[n] *= 2; if (clen[n] > 9)
clen[n] -= 9; for (n = 0; n < clen.length; ++n) {
sum += clen[n]; }
return (sum % 10 == 0); }
function SetActiveAddressToggle(address_type, value, zip) {
$$("#" + address_type + "Selector td").each(function(item) {
var radios = item.select('input[type="radio"]'); if (radios.length > 0) {
var radio = radios[0]; var img = item.select('img')[0]; radio.style.display = 'none'; if (radio.value == value) {
radio.checked = true; if (item.className.indexOf("address_selected") == -1)
item.setAttribute("old_class", item.className); if (address_type == "Shipping") {
if (radio.value == "-1") {
if ($("SameAsShipping") != null && $("ShippingAddress1").value != "") {
$("SameAsShipping").checked = false; toggleShowBilling($("SameAsShipping")); $("SameAsShipping").disabled = true; }
}
else {
if ($("SameAsShipping") != null)
$("SameAsShipping").disabled = false; }
}
$(address_type + "Zip").value = zip + " "; var show = false; if (address_type == "Shipping") {
show = (ShippingAddressPrevious != zip && zip != "omar"); }
else if (address_type == "Billing") {
show = false; }
if ($("ShippingAddress1").value != "")
show = false; getCityStateFromZip($(address_type + "Zip"), address_type, show); if (address_type == "Shipping") {
ShippingAddressPrevious = zip; }
else if (address_type == "Billing") {
BillingAddressPrevious = zip; }
item.className += " address_selected"; img.src = "./icons/checkout/selected_option.gif"; }
else {
radio.checked = false; if (item.className.indexOf("address_selected") != -1)
item.className = item.getAttribute("old_class"); img.src = "./icons/checkout/select_option.gif"; }
}
}); }
function SetActiveCreditCardToggle(value) {
$$("#CreditCardSelector td").each(function(item) {
var radios = item.select('input[type="radio"]'); if (radios.length > 0) {
var radio = radios[0]; var img = item.select('img')[0]; radio.style.display = 'none'; if (radio.value == value) {
radio.checked = true; if (item.className.indexOf("credit_selected") == -1)
item.setAttribute("old_class", item.className); item.className += " credit_selected"; img.src = "./icons/checkout/selected_option.gif"; }
else {
radio.checked = false; if (item.className.indexOf("credit_selected") != -1)
item.className = item.getAttribute("old_class"); img.src = "./icons/checkout/select_option.gif"; }
}
}
); }
function AddNewAddress(type) {
if ($('New' + type + 'Address') != null)
$('New' + type + 'Address').style.display = ''; }
function getCoupon(obj) {
RecalculateEverything(); }
function ToggleGiftMessage(obj) {
if (obj.checked) {
$("GiftMessageTbody").style.display = ''; $("GiftMessageExpander").src = './icons/checkout/minimize.gif'; }
else {
$("GiftMessageTbody").style.display = 'none'; $("GiftMessageExpander").src = './icons/checkout/maximize.gif'; $("GiftMessageTbody").down("textarea").value = ""; $("GiftMessageCount").update("250"); }
}
function ToggleGiftMessageVisibility(obj) {
var tbody = $("GiftMessageTbody"); if (tbody.style.display == 'none') {
obj.src = './icons/checkout/minimize.gif'; tbody.style.display = ''; }
else {
obj.src = './icons/checkout/maximize.gif'; tbody.style.display = 'none'; }
}
function ToggleLoginShow(radio) {
if (radio.id == "CustomerStatusReturning") {
$('LoginSelector').hide(); $('ReturningCustomerDiv').show(); }
else if (radio.id == "CustomerStatusNew") {
$('LoginForm').hide(); $('FullFormForCheckout').show(); }
if ($('ShippingZip') != null && $('ShippingZip').visible()) {
getShippingOptions($('ShippingZip')); }
}
function ValidateForm() {
return true; /*
var reg_errors = ""; if ($("RegisterEmail") != null)
{
if ($("RegisterEmail").value.Trim() == "")
{
reg_errors += "You must enter an email address<br />"; }
}
if ($("RegisterPassword") != null)
{
if ($("RegisterPassword").value.Trim() == "")
{
reg_errors += "You must create a password"; }
else
{
$("RegisterPassword").value.Trim()
}
}
if ($("ShippingAddress1").value != "")
{
}
*/
}
function readmore(lol) {
if (lol == "login") {
$("popup-loading").down("img").src = "./icons/checkout/login_processing.gif"; }
else if (lol == "order") {
$("popup-loading").down("img").src = "./icons/checkout/processing.gif"; var valid = ValidateForm(); if (!valid) {
return false; }
}
else {
return true; }
$("popup-loading").style.display = ''; var arrayPageSize = getPageSize(); var arrayPageScroll = getPageScroll(); var top = arrayPageScroll[1] + ((arrayPageSize[3] - 100) / 2) + 20; var left = ((arrayPageSize[0] - 250) / 2); var objOverlay = document.getElementById("overlay"); objOverlay.style.height = (arrayPageSize[1] + 'px'); objOverlay.style.display = 'block'; var popup = document.getElementById("popup-loading"); popup.style.top = Math.max(0, top) + 'px'; popup.style.left = Math.max(0, left) + 'px'; popup.style.display = ''; arrayPageSize = getPageSize(); objOverlay.style.height = (arrayPageSize[1] + 'px'); return true; }
function ShowLoginOnRegisterFail() {
$("ReturningCustomerDiv").show(); $("LoginForm").show(); $("FullFormForCheckout").hide(); }
function readless() {
$("popup-loading").style.display = 'none'; var objOverlay = document.getElementById("overlay"); objOverlay.style.height = '0px'; objOverlay.style.display = 'none'; }
/*
Lightbox JS: Fullsize Image Overlays
by Lokesh Dhakar - http://www.huddletogether.com
For more information on this script, visit:
http://huddletogether.com/projects/lightbox/
*/
function getPageSize() {
var xScroll, yScroll; if (window.innerHeight && window.scrollMaxY) {
xScroll = document.body.scrollWidth; yScroll = window.innerHeight + window.scrollMaxY; } else if (document.body.scrollHeight > document.body.offsetHeight) { // all but Explorer Mac
xScroll = document.body.scrollWidth; yScroll = document.body.scrollHeight; } else { // Explorer Mac...would also work in Explorer 6 Strict, Mozilla and Safari
xScroll = document.body.offsetWidth; yScroll = document.body.offsetHeight; }
var windowWidth, windowHeight; if (self.innerHeight) {	// all except Explorer
windowWidth = self.innerWidth; windowHeight = self.innerHeight; } else if (document.documentElement && document.documentElement.clientHeight) { // Explorer 6 Strict Mode
windowWidth = document.documentElement.clientWidth; windowHeight = document.documentElement.clientHeight; } else if (document.body) { // other Explorers
windowWidth = document.body.clientWidth; windowHeight = document.body.clientHeight; }
if (yScroll < windowHeight) {
pageHeight = windowHeight; } else {
pageHeight = yScroll; }
if (xScroll < windowWidth) {
pageWidth = windowWidth; } else {
pageWidth = xScroll; }
arrayPageSize = new Array(pageWidth, pageHeight, windowWidth, windowHeight)
return arrayPageSize; }
function getPageScroll() {
var yScroll; if (self.pageYOffset) {
yScroll = self.pageYOffset; } else if (document.documentElement && document.documentElement.scrollTop) {	 // Explorer 6 Strict
yScroll = document.documentElement.scrollTop; } else if (document.body) {// all other Explorers
yScroll = document.body.scrollTop; }
arrayPageScroll = new Array('', yScroll)
return arrayPageScroll; }
