var creditCardFormInnerHTMLSwap; var creditCardFormDataSwap; var currentSpecialTld; var currentSpecialTldFields; var currentCreditCardFormFields = new Array(); var idnTagDefault; var globalCurrentAddOnDomainListType = ""; var globalCurrentAddOnProductType = ""; var globalCurrentAddOnProductName = ""; function showAddonDomainList(type, productName, productType) { if(type == "cart") { document.getElementById("div_addonDomainsInCart").innerHTML = ""; document.getElementById("div_addonDomainsInAccount").innerHTML = ""; getURL('/products-pricing/services/productCart.php?action=getaddondomainlist&name='+productName+'&type='+productType+'&listtype='+type, showAddonDomainListHandler, 0); document.getElementById("Add_cart_domains").style.fontWeight = 'bold'; document.getElementById("Add_account_domains").style.fontWeight = "normal"; } else if(type == "account") { document.getElementById("div_addonDomainsInAccount").innerHTML = ""; document.getElementById("div_addonDomainsInCart").innerHTML = ""; getURL('/products-pricing/services/productCart.php?action=getaccountdomainlist&type='+productType+'&listtype='+type, showAddonDomainListHandler); document.getElementById("Add_cart_domains").style.fontWeight = "normal"; document.getElementById("Add_account_domains").style.fontWeight = "bold"; } } function showAddonDomainListHandler(status, content, contentType) { if(status != 200 && status != 0) { resetLoadingDiv(); return; } var results = eval('('+content+')'); if(!results["status"]) { resetLoadingDiv(); return; } var listtype = results["listtype"]; var productType = results["type"]; var addOnDomainsArray = results["addOnDomainsArray"]; var accountId = results["accountId"]; var html = ""; var tag = (listtype != "account") ? "hidden_product" : "" ; html += (addOnDomainsArray.length) ? "" : "Empty "+listtype; for(var i = 0; i < addOnDomainsArray.length; i++) { var onclick = ""; // onclick += "handleProductTypeLevelOverride(\"this.checked\", \""+productType+"\", \""+addOnDomainsArray[i]+"\"); "; onclick += "productCartSwap(this.checked, \""+addOnDomainsArray[i]+"\", 1, \""+productType+"\", \"addon_product\", \"ALL\", productCartSwapAddOnHandler, 0); "; var checked = (document.getElementById("tr_"+productType+"_"+addOnDomainsArray[i]+"")) ? "checked" : "" ; html += " "+addOnDomainsArray[i]+"
"; } if(listtype == "cart") { document.getElementById("div_addonDomainsInCart").style.display = ""; document.getElementById("div_addonDomainsInAccount").style.display = "none"; document.getElementById("div_addonDomainsInCart").innerHTML = html; } else if(listtype == "account") { document.getElementById("div_addonDomainsInCart").style.display = "none"; document.getElementById("div_addonDomainsInAccount").style.display = ""; if(accountId) { document.getElementById("div_addonDomainsInAccount").innerHTML = html; } else { html_account = "
You must login to see the domains in your account:

Username:

Password:

Lost Password?
Create an Account!
"; document.getElementById("div_addonDomainsInAccount").innerHTML = html_account; //document.getElementById("div_addonDomainsInAccount").innerHTML = "You must login to see the domains in your account

UsernamePassword

"; document.getElementById("input_username").focus(); } } } function checkAllCheckOut(domains, prefix, checked) { for (var i = 0; i < domains.length; i++) { if(box = document.getElementById(prefix + domains[i])) { if(box.checked != checked) { box.checked = checked; box.onclick(); } } } } function processCheckoutPageSubmit() { resetLoadingDiv(); document.getElementById("LoadingDiv").style.display = 'block'; if(document.getElementById("span_agreementText")) document.getElementById("span_agreementText").style.color = ''; if(document.getElementById("span_billingOptionsText")) document.getElementById("span_billingOptionsText").style.color = ''; if(!document.getElementById("agreement_checkbox").checked) { if(document.getElementById("span_agreementText")) document.getElementById("span_agreementText").style.color = 'red'; alert("You must agree to the registration terms and conditions."); return; } if(document.getElementById("idn_tag_default")) { idnTagDefault = document.getElementById("idn_tag_default").value.trim(); } if(document.getElementById("payment_method_credit_card").checked) processCreditCard(); else if(document.getElementById("payment_method_paypal").checked) processPayPal(); else if(document.getElementById("payment_method_account_credit").checked) processAccountCredit(); else { if(document.getElementById("span_billingOptionsText")) document.getElementById("span_billingOptionsText").style.color = 'red'; alert("Invalid payment option."); } } function processAddOnServices(handler) { // addons disabled //return; if(!handler) { handler = processAddOnServicesPopupHandler; } document.getElementById("LoadingDiv").style.display = 'block'; getURL('/products-pricing/services/productCart.php?action=processaddonservices&promoCode='+document.getElementById("promo_code").value.trim(), handler, 1); } function processAddOnServicesInlineHandler(status, content, contentType) { if(status != 200 && status != 0) { resetLoadingDiv(); return; } var results = eval('('+content+')'); if(!results["status"]) { resetLoadingDiv(); return; } var addOnProducts; var addOnProductsAdditional; if(results["haveAddOnProducts"]) { addOnProducts = results["addOnProductsArray"]["addOnProducts"]["products"]; addOnProductsAdditional = results["addOnProductsArray"]["addOnProducts"]["additional"]; resetLoadingDiv(); } else { resetLoadingDiv(); return; } var addOnProductsLength = 0; if(!addOnProducts) { resetLoadingDiv(); return; } else addOnProductsLength = addOnProducts.length; if(!addOnProductsLength) { resetLoadingDiv(); return; } // addon HTML var html = ""; if(addOnProductsLength > 0) document.getElementById("span_addOnProducts").style.display = ""; for(var i = 0; i < addOnProductsLength; i++) { var product = addOnProducts[i]; var productName = product["name"]; var productType = product["type"]; var productPrice = product["price"]; var productTeaser = product["teaser"]; var productDetails = product["details"]; var productImage = product["image"]; var productContentPagePath = product["contentPagePath"]; var productCount = addOnProductsAdditional[productType]["count"]; var durationDropBox = ""; var currentQty = 0; var style = ""; var moreHtml = "More   "; var css_id = productName.substring(0,3); var add_link = ""; //html += "
"+productName+""+productTeaser+"

"+moreHtml+"Add To Cart
"; if(productName != "Rapid Blog") add_link = moreHtml+"Add To Cart"; html += "
"+productName+"

"+productTeaser+"

"; } document.getElementById("span_addOnProducts_inner").innerHTML = html; resetLoadingDiv(); } function processAddOnServicesDomainSelect(productType, productName) { getURL('/products-pricing/services/productCart.php?action=getaddondomainlist&name='+productName+'&type='+productType, processAddOnServicesDomainSelectHandler, 0); } function processAddOnServiceDomainsPopup(productType) { if(document.getElementById("input_addOnServiceDomainsPopupSubmit_1")) document.getElementById("input_addOnServiceDomainsPopupSubmit_1").disabled = true; if(document.getElementById("input_addOnServiceDomainsPopupSubmit_2")) document.getElementById("input_addOnServiceDomainsPopupSubmit_2").disabled = true; getURL('/products-pricing/services/productCart.php?action=getaddonextendedrequirements&type='+productType, processAddOnServiceDomainsPopupHandler, 0); } function processAddOnServiceDomainsPopupHandler(status, content, contentType) { if(status != 200 && status != 0) { alert("Something went wrong. Please refresh the page and try again. ("+status+")"); return; } var results = eval('('+content+')'); if(document.getElementById("input_addOnServiceDomainsPopupSubmit_1")) document.getElementById("input_addOnServiceDomainsPopupSubmit_1").disabled = false; if(document.getElementById("input_addOnServiceDomainsPopupSubmit_2")) document.getElementById("input_addOnServiceDomainsPopupSubmit_2").disabled = false; if(!results["status"]) { alert("Something went wrong. Please try again."); return; } var addonExtended = results["addonExtended"]; if(!addonExtended) { doNotRestLoadingDiv = 0; resetLoadingDiv(); return; } var fieldsLength = addonExtended.length; var addOnFields; var data; var productType = results["type"]; if(fieldsLength > 0) { addOnFields = new Object; for(var i = 0; i < fieldsLength; i++) { var fieldName = addonExtended[i]["name"]; var fieldRequired = addonExtended[i]["required"]; if(document.getElementById(fieldName) && document.getElementById(fieldName).value) addOnFields[fieldName] = document.getElementById(fieldName).value.trim(); } } if(addOnFields) { getURL('/products-pricing/services/productCart.php?action=submitaddonextendedrequirements&type='+productType+"&jsondata="+encodeURIComponent(addOnFields.toJSONString()), processAddOnServiceDomainsPopupHandlerSubmitHandler, 0); return; } doNotRestLoadingDiv = 0; resetLoadingDiv(); } function processAddOnServiceDomainsPopupHandlerSubmitHandler(status, content, contentType) { if(status != 200 && status != 0) { alert("Something went wrong. Please refresh the page and try again. ("+status+")"); return; } var results = eval('('+content+')'); if(!results["status"]) { alert(results["message"]); return; } doNotRestLoadingDiv = 0; resetLoadingDiv(); } function processAddOnServicesDomainSelectHandler(status, content, contentType) { if(status != 200 && status != 0) { resetLoadingDiv(); return; } var results = eval('('+content+')'); if(!results["status"]) { resetLoadingDiv(); return; } var addOnDomainsArray = results["addOnDomainsArray"]; var addonExtendedInfo = results["addonExtendedInfo"]; var productPrice = results["price"]; var productType = results["type"]; var productName = addonExtendedInfo["name"]; var productDetails = addonExtendedInfo["details"]; globalCurrentAddOnDomainListType = "account"; globalCurrentAddOnProductType = productType; globalCurrentAddOnProductName = productName; document.getElementById("span_addOnProducts_domainSelect").style.display = "block"; var html = ""; /* html += ""; html += ""; html += ""; html += ""; html += ""; html += "
"; html += "
"; html += "

"+productName+"

"; html += productDetails; html += "

Price: $"+formatCurrency(productPrice, true)+" / domain"; html += "
"; html += "
"; html += "
"; html += "Add To Domains In Cart | Add To Domains In Account

"; html+="
"; html += (addOnDomainsArray.length) ? "" : "Empty Cart"; html+="
"; html+=""; html += "
"; html += "
Close

"; html += "
"; */ html_details = "

"+productName+"

"+productDetails+"

Price: $"+formatCurrency(productPrice, true)+" /domain

"; html_addon_cart = (addOnDomainsArray.length) ? "" : "Empty Cart"; html_addon = "
"+html_addon_cart+"

Close
"; //html_details = "
test details
"; //html_addon = "
test
"; html = "
"+html_details+html_addon+"
"; document.getElementById("span_addOnProducts_domainSelect").innerHTML = html; showAddonDomainList("cart", productName, productType); } function processAddOnServicesDurationChange(selectId, productType, duration) { if(document.getElementById("check_"+productType) && document.getElementById("check_"+productType).checked == true) { document.getElementById("LoadingDiv").style.display = 'block'; if(!duration) duration = document.getElementById("addOnDuration_"+selectId).value; productCartSwapAddOn(document.getElementById("check_"+productType).checked, productType, duration, productType, "addon_product", "ALL", productCartSwapAddOnInlineHandler, 1); } } function processAddOnServicesPopupHandler(status, content, contentType) { if(status != 200 && status != 0) { resetLoadingDiv(); return; } var results = eval('('+content+')'); if(!results["status"]) { resetLoadingDiv(); return; } resetLoadingDiv(); var addOnProducts; var addOnProductsAdditional; if(results["haveAddOnProducts"]) { addOnProducts = results["addOnProductsArray"]["addOnProducts"]["products"]; addOnProductsAdditional = results["addOnProductsArray"]["addOnProducts"]["additional"]; } else { processCheckoutPageSubmit(); return; } var addOnProductsLength = 0; if(!addOnProducts) { resetLoadingDiv(); return; } else addOnProductsLength = addOnProducts.length; if(!addOnProductsLength) { resetLoadingDiv(); return; } scroll(0,0); loadingDivInnerHTMLSwap = document.getElementById("span_loading_content").innerHTML; var html = ""; html += "

Additional Products and Services

"; html += "
"; for(var i = 0; i < addOnProductsLength; i++) { var product = addOnProducts[i]; var productName = product["name"]; var productType = product["type"]; var productPrice = product["price"]; var productDetails = product["details"]; var productCount = addOnProductsAdditional[productType]["count"]; var durationDropBox = ""; if(productCount) { durationDropBox += "

Number of this product to add: "; } html += "
" + productName + "

Add this product"+durationDropBox+"

" + productDetails + "$" + formatCurrency(productPrice, true) + "

"; } html += "
"; html += "
"; document.getElementById("span_loading_content").innerHTML = html; document.getElementById("LoadingDiv_inner").style.height = 600; document.getElementById("LoadingDiv_inner").style.width = 400; document.getElementById("LoadingDiv").style.paddingTop = "50px"; document.getElementById("LoadingDiv").style.background = "url(/javascript/images/transbg.png)"; document.getElementById("LoadingDiv").style.display = 'block'; document.getElementById("LoadingDiv").style.overflow = 'auto'; if(document.getElementById("outer")) { document.getElementById("LoadingDiv").style.height = document.getElementById("outer").offsetHeight; } } function processAccountCredit() { document.getElementById("LoadingDiv").style.display = 'block'; getURL('/products-pricing/services/productCart.php?action=processaccountcredit&promoCode='+document.getElementById("promo_code").value.trim()+"&idnTagDefault="+idnTagDefault, processAccountCreditHandler); } function processAccountCreditHandler(status, content, contentType) { if(status != 200 && status != 0) { alert("Something went wrong. Please refresh the page and try again. ("+status+")"); resetLoadingDiv(); return; } var results = eval('('+content+')'); if(!results["status"]) { alert(results["message"]); //if(!results["accountId"]) location.reload(); resetLoadingDiv(); return; } window.location = ("/management/view_invoice.php?checkout=1&id="+results["orderId"]); } function processPayPal() { document.getElementById("LoadingDiv").style.display = 'block'; getURL('/products-pricing/services/productCart.php?action=processpaypal&promoCode='+document.getElementById("promo_code").value.trim()+"&idnTagDefault="+idnTagDefault, processPayPalHandler); } function processPayPalHandler(status, content, contentType) { if(status != 200 && status != 0) { alert("Something went wrong. Please refresh the page and try again. ("+status+")"); resetLoadingDiv(); return; } var results = eval('('+content+')'); if(!results["status"]) { alert(results["message"]); //if(!results["accountId"]) location.reload(); resetLoadingDiv(); return; } window.location = ("https://www.paypal.com/cgi-bin/webscr?cmd=_express-checkout&token="+results["payPalToken"]); } function processCreditCard() { var fieldsLength = currentCreditCardFormFields.length; var data = new Object; var validated = 1; for(var i = 0; i < fieldsLength; i++) { data[currentCreditCardFormFields[i]["name"]] = (document.getElementById(currentCreditCardFormFields[i]["name"]).value.trim()); if(data[currentCreditCardFormFields[i]["name"]] || !currentCreditCardFormFields[i]["required"]) { document.getElementById("td_"+currentCreditCardFormFields[i]["name"]).style.color = "#000000"; } else { validated = 0; document.getElementById("td_"+currentCreditCardFormFields[i]["name"]).style.color = "red"; } } if(validated) { document.getElementById("LoadingDiv").style.display = 'block'; getURL('/products-pricing/services/productCart.php?action=processcreditcard&promoCode='+document.getElementById("promo_code").value.trim()+'&jsondata='+encodeURIComponent(data.toJSONString())+"&idnTagDefault="+idnTagDefault, processCreditCardHandler); } else alert("Please complete the billing items in red."); } function processCreditCardHandler(status, content, contentType) { if(status != 200 && status != 0) { alert("Something went wrong. Please refresh the page and try again. ("+status+")"); resetLoadingDiv(); return; } var results = eval('('+content+')'); if(!results["status"]) { if(results["notCompletedArray"]) { var fieldsLength = results["notCompletedArray"].length; for(var i = 0; i < fieldsLength; i++) { document.getElementById("td_"+results["notCompletedArray"][i]).style.color = "red"; } } alert(results["message"]); //if(!results["accountId"]) location.reload(); resetLoadingDiv(); return; } window.location = ("/management/view_invoice.php?checkout=1&id="+results["orderId"]); } function prepareCreditCardForm() { var data = getBillingFormDataObject(); creditCardFormInnerHTMLSwap = document.getElementById("div_creditCardForm").innerHTML; creditCardFormDataSwap = getBillingFormDataObject(); document.getElementById("div_creditCardForm").innerHTML = "

Loading billing information..."; getURL('/products-pricing/services/productCart.php?action=getCreditCardFormFields', prepareCreditCardFormHandler); } function prepareCreditCardFormHandler(status, content, contentType) { if(status != 200 && status != 0) { alert("Something went wrong. Please refresh the page and try again. ("+status+")"); document.getElementById("div_creditCardForm").innerHTML = creditCardFormInnerHTMLSwap; populateCreditCardForm(creditCardFormDataSwap); creditCardFormInnerHTMLSwap = ""; creditCardFormDataSwap = ""; return; } var results = eval('('+content+')'); if(!results["status"]) { alert(results["message"]); document.getElementById("div_creditCardForm").innerHTML = creditCardFormInnerHTMLSwap; populateCreditCardForm(creditCardFormDataSwap); creditCardFormInnerHTMLSwap = ""; creditCardFormDataSwap = ""; return; } var html = ""; var credtCardFormFieldsLeft = results["credtCardFormFields"]["left"]; var credtCardFormFieldsLeftLength = credtCardFormFieldsLeft.length; var credtCardFormFieldsRight = results["credtCardFormFields"]["right"]; var credtCardFormFieldsRightLength = credtCardFormFieldsRight.length; var credtCardFormFieldsLength = 0; currentCreditCardFormFields = new Array(); (credtCardFormFieldsLeftLength > credtCardFormFieldsRightLength) ? credtCardFormFieldsLength = credtCardFormFieldsLeftLength : credtCardFormFieldsLength = credtCardFormFieldsRightLength; document.getElementById("div_creditCardForm").innerHTML = creditCardFormInnerHTMLSwap; html+= "
"; for(var i = 0; i < credtCardFormFieldsLength; i++) { var requiredLeft = ""; var requiredRight = ""; if(credtCardFormFieldsLeft[i] && credtCardFormFieldsLeft[i]["required"]) requiredLeft = "*"; if(credtCardFormFieldsRight[i] && credtCardFormFieldsRight[i]["required"]) requiredRight = "*"; html += ""; (credtCardFormFieldsLeft[i]) ? html += "" : html += ""; (credtCardFormFieldsRight[i]) ? html += "" : html += ""; html += ""; if(credtCardFormFieldsLeft[i]) currentCreditCardFormFields.push(credtCardFormFieldsLeft[i]); if(credtCardFormFieldsRight[i]) currentCreditCardFormFields.push(credtCardFormFieldsRight[i]); } html+= "
"+credtCardFormFieldsLeft[i]["label"]+" "+requiredLeft+"
"+getInputHtml(credtCardFormFieldsLeft[i]["type"], credtCardFormFieldsLeft[i]["name"], credtCardFormFieldsLeft[i]["options"], credtCardFormFieldsLeft[i]["value"])+"
"+credtCardFormFieldsRight[i]["label"]+" "+requiredRight+"
"+getInputHtml(credtCardFormFieldsRight[i]["type"], credtCardFormFieldsRight[i]["name"], credtCardFormFieldsRight[i]["options"], credtCardFormFieldsRight[i]["value"])+"
"; document.getElementById("span_creditCardForm").innerHTML = html; if(document.getElementById("payment_method_credit_card").checked) document.getElementById("div_creditCardForm").style.display = ""; creditCardFormInnerHTMLSwap = ""; creditCardFormDataSwap = ""; } function getInputHtml(type, name, options, value) { var html = ""; if(!value) value = ""; if(type == "text") { var textValue = ""; html += ""; } else if(type == "hidden") { var textValue = ""; html += ""; } else if(type == "select") { var optionsLengh = options.length; var selected = ""; html += ""; } else if(type == "radio") { var optionsLengh = options.length; var selected = ""; var hiddenInput = ""; for(var j = 0; j < optionsLengh; j++) { selected = ""; var onClick = "document.getElementById(\""+name+"\").value = this.value;"; if(value == options[j]["value"]) { selected = "checked"; hiddenInput = ""; } html += " "+options[j]["string"]+"

"; } html += hiddenInput; } return(html); } function specialRequirementsForm(tld) { scroll(0,0); loadingDivInnerHTMLSwap = document.getElementById("span_loading_content").innerHTML; document.getElementById("span_loading_content").innerHTML = "


Preparing special ."+tld+" requirements..."; document.getElementById("LoadingDiv_inner").style.height = 600; document.getElementById("LoadingDiv_inner").style.width = 400; document.getElementById("LoadingDiv").style.paddingTop = "50px"; document.getElementById("LoadingDiv").style.background = "url(/javascript/images/transbg.png)"; document.getElementById("LoadingDiv").style.display = 'block'; document.getElementById("LoadingDiv").style.overflow = 'auto'; if(document.getElementById("outer")) { document.getElementById("LoadingDiv").style.height = document.getElementById("outer").offsetHeight; } getURL('/products-pricing/services/productCart.php?action=getSpecialTldRequirementsForTld&tld='+tld, specialRequirementsFormPrepareHandler); } function specialRequirementsFormPrepareHandler(status, content, contentType) { if(status != 200 && status != 0) { alert("Something went wrong. Please refresh the page and try again. ("+status+")"); return; } var results = eval('('+content+')'); if(!results["status"]) { alert(results["message"]); return; } currentSpecialTld = results["tld"]; currentSpecialTldFields = results["specialTldInfo"]["fields"]; document.getElementById("span_loading_content").style.textAlign = "left"; var type = results["specialTldInfo"]["type"]; var fieldsLength = results["specialTldInfo"]["fields"].length; var html = ""; html += "
Special requirement for ."+results["tld"]+"

Required sections are highlighted in orange.
"; html += "
"; for(var i = 0; i < fieldsLength; i++) { var fields = results["specialTldInfo"]["fields"][i]; var required = fields["required"]; var borderHtml = ""; if(required) borderHtml = "border:1px solid #FF6800;"; html += ""; } html += "
"+""+fields["label"]+""; html += getInputHtml(fields["type"], fields["name"], fields["options"], results["specialTldInfo"]["data"][fields["name"]]); html += "
"; html += "

"; document.getElementById("span_loading_content").innerHTML = html; } function processSpecialTldForm() { var fieldsLength = currentSpecialTldFields.length; var data = new Object; var validated = 1; for(var i = 0; i < fieldsLength; i++) { data[currentSpecialTldFields[i]["name"]] = (document.getElementById(currentSpecialTldFields[i]["name"]).value.trim()); if(data[currentSpecialTldFields[i]["name"]] || !currentSpecialTldFields[i]["required"]) { document.getElementById("td_"+currentSpecialTldFields[i]["name"]).style.color = "#000000"; } else { validated = 0; document.getElementById("td_"+currentSpecialTldFields[i]["name"]).style.color = "red"; } } if(validated) getURL('/products-pricing/services/productCart.php?action=processSpecialTldData&tld='+currentSpecialTld+"&jsondata="+encodeURIComponent(data.toJSONString()), processSpecialTldFormHandler); else alert("Please complete the items in red."); } function processSpecialTldFormHandler(status, content, contentType) { if(status != 200 && status != 0) { alert("Something went wrong. Please refresh the page and try again. ("+status+")"); return; } var results = eval('('+content+')'); if(!results["status"]) { alert(results["message"]); return; } resetLoadingDiv(); prepareCheckoutLoggedIn(); } function nullHandler(status, content, contentType) { } function getBillingFormDataObject() { var data = new Object; if(document.getElementById("input_cc_type")) data["cc_type"] = (document.getElementById("input_cc_type").value); if(document.getElementById("input_cc_exp_m")) data["cc_exp_m"] = (document.getElementById("input_cc_exp_m").value); if(document.getElementById("input_cc_exp_y")) data["cc_exp_y"] = (document.getElementById("input_cc_exp_y").value); if(document.getElementById("input_cc_country")) data["cc_country"] = (document.getElementById("input_cc_country").value); if(document.getElementById("input_cc_phone")) data["cc_phone"] = (document.getElementById("input_cc_phone").value); if(document.getElementById("input_cc_address")) data["cc_address"] = (document.getElementById("input_cc_address").value); if(document.getElementById("input_cc_city")) data["cc_city"] = (document.getElementById("input_cc_city").value); if(document.getElementById("input_cc_state")) data["cc_state"] = (document.getElementById("input_cc_state").value); if(document.getElementById("input_cc_zip")) data["cc_zip"] = (document.getElementById("input_cc_zip").value); if(document.getElementById("input_cc_name")) data["cc_name"] = (document.getElementById("input_cc_name").value); if(document.getElementById("input_cc_number")) data["cc_number"] = (document.getElementById("input_cc_number").value); if(document.getElementById("input_cc_cvm")) data["cc_cvm"] = (document.getElementById("input_cc_cvm").value); if(document.getElementById("input_cc_email")) data["cc_email"] = (document.getElementById("input_cc_email").value); return(data); } function saveBilling() { var data = getBillingFormDataObject(); creditCardFormInnerHTMLSwap = document.getElementById("div_creditCardForm").innerHTML; creditCardFormDataSwap = getBillingFormDataObject(); document.getElementById("div_creditCardForm").innerHTML = "

Saving billing information..."; getURL('/products-pricing/services/productCart.php?action=saveBillingData&jsondata='+encodeURIComponent(data.toJSONString()), saveBillingHandler); } function saveBillingHandler(status, content, contentType) { if(status != 200 && status != 0) { alert("Something went wrong. Please refresh the page and try again. ("+status+")"); document.getElementById("div_creditCardForm").innerHTML = creditCardFormInnerHTMLSwap; populateCreditCardForm(creditCardFormDataSwap); creditCardFormInnerHTMLSwap = ""; creditCardFormDataSwap = ""; return; } var results = eval('('+content+')'); if(!results["status"]) { alert(results["message"]); document.getElementById("div_creditCardForm").innerHTML = creditCardFormInnerHTMLSwap; populateCreditCardForm(creditCardFormDataSwap); creditCardFormInnerHTMLSwap = ""; creditCardFormDataSwap = ""; return; } document.getElementById("div_creditCardForm").innerHTML = creditCardFormInnerHTMLSwap; if(results["jsondata"]) populateCreditCardForm(results["jsondata"]); else populateCreditCardForm(creditCardFormDataSwap); creditCardFormInnerHTMLSwap = ""; creditCardFormDataSwap = ""; prepareCreditCardForm(); } function prepareCheckoutLoggedInDisplay(accountId, accountCredit) { var html = ""; prepareBillingOptions(accountCredit); prepareCreditCardForm(); } function prepareBillingOptions(accountCredit) { if(accountCredit > 0) { document.getElementById("span_accountCreditAvailable").innerHTML = formatCurrency(accountCredit, true); document.getElementById("span_accountCreditOption").style.display = "block"; } } function populateCreditCardForm(data) { if(document.getElementById("option_ccType_"+data["cc_type"])) document.getElementById("option_ccType_"+data["cc_type"]).selected = "true"; if(document.getElementById("option_ccExpM_"+data["cc_exp_m"])) document.getElementById("option_ccExpM_"+data["cc_exp_m"]).selected = "true"; if(document.getElementById("option_ccExpY_"+data["cc_exp_y"])) document.getElementById("option_ccExpY_"+data["cc_exp_y"]).selected = "true"; if(document.getElementById("option_ccCountry_"+data["cc_country"])) document.getElementById("option_ccCountry_"+data["cc_country"]).selected = "true"; if(document.getElementById("input_cc_phone")) document.getElementById("input_cc_phone").value = data["cc_phone"] if(document.getElementById("input_cc_address")) document.getElementById("input_cc_address").value = data["cc_address"] if(document.getElementById("input_cc_city")) document.getElementById("input_cc_city").value = data["cc_city"] if(document.getElementById("input_cc_state")) document.getElementById("input_cc_state").value = data["cc_state"] if(document.getElementById("input_cc_zip")) document.getElementById("input_cc_zip").value = data["cc_zip"] if(document.getElementById("input_cc_name")) document.getElementById("input_cc_name").value = data["cc_name"] if(document.getElementById("input_cc_number")) document.getElementById("input_cc_number").value = data["cc_number"] if(document.getElementById("input_cc_cvm")) document.getElementById("input_cc_cvm").value = data["cc_cvm"] if(document.getElementById("input_cc_email")) document.getElementById("input_cc_email").value = data["cc_email"] } function prepareCheckoutLoggedIn(ignorePrepareCheckoutLoggedIn) { if(!ignorePrepareCheckoutLoggedIn) ignorePrepareCheckoutLoggedIn = ""; document.getElementById("LoadingDiv").style.display = 'block'; getURL('/products-pricing/services/productCart.php?action=checkSpecialTldRequirements&ignorePrepareCheckoutLoggedIn='+ignorePrepareCheckoutLoggedIn, checkSpecialTldRequirementsHandler); } function checkSpecialTldRequirementsHandler(status, content, contentType) { if(status != 200 && status != 0) { alert("Something went wrong. Please refresh the page and try again. ("+status+")"); document.getElementById("LoadingDiv").style.display='none'; return; } var results = eval('('+content+')'); var haveIncomplete = 0; if(results["status"]) { var html = ""; var specialTldArrayLength = results["specialTldArray"].length; html += "

Special TLD Requirements

"; html += "The following TLDs have special requirements. Before continuing you must complete the requirements for each of them if you have not already done so. Items with an orange border require completion.

"; html += ""; html += ""; for(var i = 0; i < specialTldArrayLength; i++) { var tld = results["specialTldArray"][i]; var editRequirementsLink = (results["specialTldInfoArray"][tld]["complete"]) ? "Edit Requirements" : "Complete Requirements"; var borderHtml = ""; if(!results["specialTldInfoArray"][tld]["complete"]) { borderHtml = "border:2px solid #FF6800;" haveIncomplete = 1; } html += ""; } html += "
TLDRequirementsAction
"+tld+""+results["specialTldInfoArray"][tld]["requirements"]+"

"+editRequirementsLink+"
"; if(!results["ignorePrepareCheckoutLoggedIn"] && document.getElementById("div_loggedInContainer")) { document.getElementById("div_loggedInContainer").style.display = 'none'; document.getElementById("div_loggedOutContainer").style.display = 'none'; document.getElementById("div_loggedOutContainerSecondary").style.display = 'none'; } if(document.getElementById("div_specialTldRequirementsContainer")) { document.getElementById("div_specialTldRequirementsContainer").innerHTML = html; document.getElementById("div_specialTldRequirementsContainer").style.display = 'block'; document.getElementById("div_specialTldRequirementsNotice").style.display = 'block'; } resetLoadingDiv(); if(haveIncomplete) return; } else { if(document.getElementById("div_specialTldRequirementsContainer")) { document.getElementById("div_specialTldRequirementsContainer").innerHTML = ""; document.getElementById("div_specialTldRequirementsContainer").style.display = ''; document.getElementById("div_specialTldRequirementsNotice").style.display = 'none'; } } if(!results["ignorePrepareCheckoutLoggedIn"]) { getURL('/account/services/account.php?action=check', prepareCheckoutLoggedInHandler); } else resetLoadingDiv(); } function prepareCheckoutLoggedInHandler(status, content, contentType) { if(status != 200 && status != 0) { alert("Something went wrong. Please refresh the page and try again. ("+status+")"); document.getElementById("LoadingDiv").style.display='none'; return; } var results = eval('('+content+')'); if(!results["status"]) { if(document.getElementById("div_loggedInContainer") && document.getElementById("div_loggedOutContainer")) { document.getElementById("div_loggedInContainer").style.display = 'none'; document.getElementById("div_loggedOutContainer").style.display = 'block'; document.getElementById("div_loggedOutContainerSecondary").style.display = 'block'; } if(results["message"]) { alert(results["message"]); if(results["redirUrl"]) { window.location = (results["redirUrl"]); return; } } resetLoadingDiv(); return; } if(document.getElementById("div_loggedInContainer") && document.getElementById("div_loggedOutContainer")) { document.getElementById("div_loggedInContainer").style.display = 'block'; document.getElementById("div_loggedOutContainer").style.display = 'none'; document.getElementById("div_loggedOutContainerSecondary").style.display = 'none'; prepareCheckoutLoggedInDisplay(results["accountId"], results["accountCredit"]); } resetLoadingDiv(); } function processCheckoutLogin(event) { if(event && event.keyCode != "13") return; var username = document.getElementById("input_username").value; var password = document.getElementById("input_password").value; username = username.trim(); password = password.trim(); if(!username || !password) return; document.getElementById("LoadingDiv").style.display = 'block'; getURL('/account/services/account.php?action=login&username='+username+'&password='+password+'', processCheckoutLoginHandler); } function processCheckoutLoginHandler(status, content, contentType) { if(status != 200 && status != 0) { alert("Something went wrong. Please refresh the page and try again. ("+status+")"); document.getElementById("LoadingDiv").style.display='none'; return; } var results = eval('('+content+')'); if(!results["status"]) { if(results["message"]) { alert(results["message"]); if(results["redirUrl"]) { window.location = (results["redirUrl"]); return; } } resetLoadingDiv(); return; } document.getElementById("Login").innerHTML = "
Hello "+results["username"]+"!
If you are not "+results["username"]+",click here to logout."; document.getElementById("Login").style.textAlign = "left"; showAddonDomainList("account", globalCurrentAddOnProductName, globalCurrentAddOnProductType); prepareCheckoutLoggedIn(); } function showBatchTransferNames(id) { if(document.getElementById("batchTransferNames_"+id).style.display == "none") { document.getElementById("batchTransferNames_"+id).style.display = ""; document.getElementById("showBatchTransferNamesLink").innerHTML = "hide domains"; } else { document.getElementById("batchTransferNames_"+id).style.display = "none"; document.getElementById("showBatchTransferNamesLink").innerHTML = "show domains"; } } function googleAppsSwapHandler(status, content, contentType) { if(status != 200 && status != 0) { alert("Something went wrong. Please refresh the page and try again. ("+status+")"); document.getElementById("LoadingDiv").style.display='none'; return; } var results = eval('('+content+')'); if(!results["status"]) { alert(results["message"]); resetLoadingDiv(); return; } var cartRowId = results["cartRowId"]; if(cartRowId) { var tag = results["tag"]; if(tag != "hidden_product") { var name = results["name"]; var type = results["type"]; var duration = results["duration"]; var price = results["price"]; insertCartRow(document.getElementById("tr_cartTable"), name, type, duration, 0, 0, price, cartRowId, tag); } } resetLoadingDiv(); } function privateWhoisSwapHandler(status, content, contentType) { if(status != 200 && status != 0) { alert("Something went wrong. Please refresh the page and try again. ("+status+")"); document.getElementById("LoadingDiv").style.display='none'; return; } var results = eval('('+content+')'); if(!results["status"]) { alert(results["message"]); resetLoadingDiv(); return; } var action = results["action"]; var name = results["name"]; var price = results["price"]; var currentPrice = 0; var newPrice = 0; var currentHiddenPrice = 0; var newHiddenPrice = 0; if(document.getElementById("span_checkoutProductPrice_"+name)) { currentPrice = document.getElementById("span_checkoutProductPrice_"+name).innerHTML; currentHiddenPrice = document.getElementById("span_checkoutProductPriceHidden_"+name).innerHTML; if(action == "add") { newPrice = parseFloat(currentPrice) + parseFloat(price); newHiddenPrice = parseFloat(currentHiddenPrice) + parseFloat(price); } else if(action == "remove") { newPrice = parseFloat(currentPrice) - parseFloat(price); newHiddenPrice = parseFloat(currentHiddenPrice) - parseFloat(price); } else { newPrice = currentPrice; newHiddenPrice = currentHiddenPrice; } document.getElementById("span_checkoutProductPrice_"+name).innerHTML = formatCurrency(newPrice, true); document.getElementById("span_checkoutProductPriceHidden_"+name).innerHTML = formatCurrency(newHiddenPrice, true); } if(document.getElementById("span_checkoutProductPriceAlternative_"+name)) { currentPrice = document.getElementById("span_checkoutProductPriceAlternative_"+name).innerHTML; currentHiddenPrice = document.getElementById("span_checkoutProductPriceHiddenAlternative_"+name).innerHTML; if(action == "add") { newPrice = parseFloat(currentPrice) + parseFloat(price); newHiddenPrice = parseFloat(currentHiddenPrice) + parseFloat(price); } else if(action == "remove") { newPrice = parseFloat(currentPrice) - parseFloat(price); newHiddenPrice = parseFloat(currentHiddenPrice) - parseFloat(price); } else { newPrice = currentPrice; newHiddenPrice = currentHiddenPrice; } document.getElementById("span_checkoutProductPriceAlternative_"+name).innerHTML = formatCurrency(newPrice, true); document.getElementById("span_checkoutProductPriceHiddenAlternative_"+name).innerHTML = formatCurrency(newHiddenPrice, true); } setShoppingCartInfo(results["productTotalPrice"], results["productCount"]); resetLoadingDiv(); }