function getCCType(number) { var firstDigit = (number + "").substr(0, 1); switch (firstDigit) { case '5': return "MC"; break; case '4': return "V"; break; case '3': return "AMX"; break; case '6': return "DSC"; break; default: return null; break; } } function encodeURL(url) { return escape((url + "").replace(" ", "+")); } function submitTriligiantValues() { if (!document.orderform) { alert("orderform not defined"); return; } var forma = document.orderform; var url = 'triligiant.html?ref=C_TRILIGIANT_INTERSTITIAL_ID'; var ccMonth = parseInt(forma.rec_cc_month.value); if (!ccMonth) ccMonth = '00'; else if (ccMonth <= 9) ccMonth = '0' + ccMonth; var ccYear = parseInt(forma.rec_cc_year.value); if (!ccYear) ccYear = '0000'; else if (ccYear < 100) ccYear = '20' + ccYear; var params = new Array(); params.push("service_id", "C_TRILIGIANT_IID"); params.push("ref_code", "C_TRILIGIANT_INTERSTITIAL_ID"); params.push("first_name", forma.bill_fname.value); params.push("last_name", forma.bill_lname.value); params.push("CreditCardNumber", forma.rec_cc.value); params.push("address", forma.bill_address1.value + " " + forma.bill_address2.value); params.push("opt_in_out", ""); params.push("CCtype", getCCType(forma.rec_cc.value)); params.push("city", forma.bill_city.value); params.push("State", forma.bill_state.value); params.push("zip", forma.bill_zip.value); params.push("email_address", forma.bill_email.value); params.push("email_verify", forma.bill_email.value); params.push("complete_phone_number", forma.bill_phone_prefix.value + forma.bill_phone_body.value.replace(/\D/, '')); params.push("CCexpiremonth", ccMonth); params.push("CCexpireyear", ccYear); params.push("area_code", forma.bill_phone_prefix.value.replace(/\D/, '')); params.push("phone_exchange", forma.bill_phone_body.value.replace(/\D/, '').substr(0,3)); params.push("phone_number", forma.bill_phone_body.value.replace(/\D/, '').substr(3,4)); params.push("phone_ext", forma.bill_phone_prefix.value.replace(/\D/, '')); var popupUrl = url; for (var i=0; i