var OLBonly = false; var OLBCallStat = true; var ExpireError = false; var ExpireErrorBus = false; var birth_date = ""; var eStatCall = true; var birthError; var balProInd = ""; var nextPanel; var eStatFull; var olbFull; var enc = '/cgi-bin/common-ws/rbcServices/service.cgi/cardencrypt'; var url = '/cgi-bin/common-ws/rbcServices/service.cgi/occacardelig'; var url2 = '/cgi-bin/common-ws/rbcServices/service.cgi/occaauthquestion'; var url3 = '/cgi-bin/common-ws/rbcServices/service.cgi/occaproductelig'; var url4 = '/cgi-bin/common-ws/rbcServices/service.cgi/occacardactivate'; var url5 = '/cgi-bin/common-ws/rbcServices/service.cgi/occacardactivatebusiness'; var balPro = '/cgi-bin/common-ws/rbcServices/service.cgi/occaproductfulfillbal'; var eStatURL = '/cgi-bin/common-ws/rbcServices/service.cgi/occaproductfulfillstat'; var OLB = '/cgi-bin/apply/occa/apply.cgi/ProductfulOLB'; var olbcheck = '/cgi-bin/common-ws/rbcServices/service.cgi/occacustloginvalid'; var lastName; var firstName; var cardnum; var cardname; var addr1; var addr2; var city; var prov; var postal; var country; var birth_date; var currDate; var timeout; var BalDecision; var eDocDecision; var focusableElementsString; jQuery(document).bind('keypress keydown', function (e) { if (e.which === 13) { e.stopPropagation(); e.preventDefault(); $("#startActivation").click(); return false; } }); $(document).ready(function(){ focusableElementsString ="a[href], area[href], input:not([disabled]), select:not([disabled]), textarea:not([disabled]), button:not([disabled]), iframe, object, embed, *[tabindex], *[contenteditable]"; $("#accordion").find("h3").attr("tabindex","-1"); if(lang == "fr"){ $(".fr_space").show(); } else { $(".fr_space").hide(); } var session_expire = 1991; var session_msg = "Expired"; timeout = setTimeout(function(){ error(session_expire,session_msg); }, 1200000); $('body').mousedown(function() { window.clearTimeout(timeout); timeout = setTimeout(function(){ error(session_expire,session_msg); }, 1200000); }); $('input').keyup(function(e){ if(e.which==39) $(this).closest('td').next().find('input, select').focus(); else if(e.which==37) $(this).closest('td').prev().find('input, select').focus(); else if(e.which==40) $(this).closest('tr').next().find('td:eq('+$(this).closest('td').index()+')').find('input, select').focus(); else if(e.which==38) $(this).closest('tr').prev().find('td:eq('+$(this).closest('td').index()+')').find('input, select').focus(); }); $(".cancelanchor").click(function(){ $(".buttonfloatright").hide(); if(nextPanel == 0){ $(".submit_button_area").hide(); $(".cancel_warning_notice_olb").show(); var setfocus = $(".warninganchor"); setfocus.focus(); void(0); } else { $(".submit_button_area").hide(); $(".cancel_warning_notice").show(); var setfocus = $(".warninganchor"); setfocus.focus(); void(0); } }); $(".cancelContinue").click(function(){ $("#user_agreed_id").change(function(event){ if($(this).is(":checked")){ $(".submit-enabled").show(); $(".submit-disabled").hide(); } else{ $(".submit-disabled").show(); $(".submit-enabled").hide(); } }); $(".submit_button_area").show(); $(".buttonfloatright").show(); $('.cancel_warning_notice').hide(); $('.cancel_warning_notice_olb').hide(); var setfocus = $('cancelanchor'); setfocus.focus(); void(0); }); $("#olbSignInURL").click(function(){ if(lang == "fr"){ window.location = olbsignURL + "?F6=1&F7=IB&F21=IB&F22=IB&REQUEST=ClientSignin&LANGUAGE=FRENCH"; } else { window.location = olbsignURL + "?F6=1&F7=IB&F21=IB&F22=IB&REQUEST=ClientSignin&LANGUAGE=ENGLISH"; } }); $("#cancel").click(function(){ if(nextPanel == 0){ window.location = "/cgi-bin/apply/cardapp/apply.cgi/" } else { $(".submit_button_area").hide(); $(".cancel_warning_notice").show(); var setfocus = $(".warninganchor"); setfocus.focus(); void(0); } }); $(".cancelContinue_bal").click(function(){ $(".submit_button_area_bal").show(); $(".submit_area").show(); $('.cancel_warning_notice_bal').hide(); var setfocus = $('cancelanchor'); setfocus.focus(); void(0); }); $(".owner1_home_phoneE").hide(); $(".owner1_driverslicenseE").hide(); $(".owner1_bus_phoneE").hide(); $(".owner1_sinE").hide(); $(".usernameE").hide(); $(".userPassE").hide(); $(".confirmUserPassE").hide(); $(".owner1_emailE").hide(); //TOGGLE HELP LINKS // $("#expDateHelp , #closeExpHelp").click(function(){ toggleHelpInline('apExpDate_helprow','expDateHelp'); return false; }); $("#threeDigitCodeHelp , #closeCCVHelp").click(function(){ toggleHelpInline('apCCV_helprow','threeDigitCodeHelp'); return false; }); $("#usernameHelp , #closeUserNameHelp").click(function(){ toggleHelpInline('apUsername_helprow','usernameHelp'); return false; }); $("#userpassHelp , #closeUserPassHelp").click(function(){ toggleHelpInline('apUserPass_helprow','userpassHelp'); return false; }); $("#userEmailHelp , #closeEmailHelp").click(function(){ toggleHelpInline('apEmail_helprow','userEmailHelp'); return false; }); // Toggle Balance Protection $("#icon1").click(function(){ toggleIcon('benefits','icon1'); return false; }); $("#icon2").click(function(){ toggleIcon('cost','icon2'); return false; }); $("#printBalProApp").click(function(){ location.href = "/cgi-bin/apply/occa/pdf/pdf-creator.cgi?lastName=" + lastName + "&firstName=" + firstName + "&cardnum=" + cardnum + "&cardname=" + cardname + "&addr1=" + addr1 + "&addr2=" + addr2 + "&city=" + city + "&prov=" + prov + "&postal=" + postal + "&country=" + country + "&birth_date=" + birth_date + "&currdate=" + currDate; }); $("#printBalProApp_fr").click(function(){ location.href = "/cgi-bin/apply/occa/pdf/pdf-creator_fr.cgi?lastName=" + lastName + "&firstName=" + firstName + "&cardnum=" + cardnum + "&cardname=" + cardname + "&addr1=" + addr1 + "&addr2=" + addr2 + "&city=" + city + "&prov=" + prov + "&postal=" + postal + "&country=" + country + "&birth_date=" + birth_date + "&currdate=" + currDate; }); $("#icon4").click(function(){ toggleIcon('cancel','icon4'); return false; }); $("#tool-textresize-extralarge").click(function(){ setActiveStyleSheet('textsize-extralarge'); }); $("#tool-textresize-large").click(function(){ setActiveStyleSheet('textsize-large'); }); $("#tool-textresize-normal").click(function(){ setActiveStyleSheet('', 1); ; }); $("#owner1_home_phone_id").keydown(phoneFormatting); $("#owner1_bus_phone_id").keydown(phoneFormatting); $("#card_doe_id").keydown(function(event) { dateFormatting(this, $(this), event); }); $("#owner1_dob_id").keydown(function(event) { dateFormatting2(this, $(this), event); }); $("#card_doe_yyyy_id, #card_doe_mm_id").change(function(){ if( ( $("#card_doe_yyyy_id").value() == new Date().getFullYear() && $("#card_doe_mm_id").value() <= new Date().getMonth() ) || $("#card_doe_yyyy_id").value() < new Date().getFullYear()) { ExpireError = true; } else { ExpireError = false; } }); $("#card_doe_yyyy_bus_id, #card_doe_mm_bus_id").change(function(){ if( ( $("#card_doe_yyyy_bus_id").value() == new Date().getFullYear() && $("#card_doe_mm_bus_id").value() <= new Date().getMonth() ) || $("#card_doe_yyyy_bus_id").value() < new Date().getFullYear()) { ExpireErrorBus = true; } else { ExpireErrorBus = false; } }); $("#owner1_dob_mmm_id, #owner1_dob_dd_id , #owner1_dob_yyyy_id").change(function(){ birth_date = $("#owner1_dob_yyyy_id").val() + "-" + $("#owner1_dob_mmm_id").val() + "-" + $("#owner1_dob_dd_id").val(); if($("#owner1_dob_mmm_id").val() == "" && $("#owner1_dob_dd_id").val() == "" && $("#owner1_dob_yyyy_id").val() == ""){ birthError = true; }else if(constraints.date(birth_date , ["ymd"]) == false || constraints.notfuture(birth_date,["ymd"]) == false){ birthError = true; } else { birthError = false; } }); $("input[name=owner1_RBCproducts]").change(function(event){ if(event.target.value == "NoOtherRBCAcct"){ $("input[name=owner1_RBCproducts][value!=NoOtherRBCAcct]").prop("checked", false); } else { $("input[name=owner1_RBCproducts][value=NoOtherRBCAcct]").prop("checked", false); } }); var processOLB = true; var processEstat = true;; $("input[name=balance_protector]").change(function(){ $("#balanceterms").hide(); if($("#balance_protector_id").value() == "Y"){ balProInd = true; $("#balproterms").show(); $(".cancel_warning_notice_bal").hide(); $(".submit_button_area_bal").show(); var setfocus = $(".warninganchor_bal"); setfocus.focus(); void(0); processOLB = false; } if($("#balance_protector_id").value() == "N"){ $("#balproterms").hide(); $(".cancel_warning_notice_bal").show(); $(".submit_button_area_bal").hide(); var setfocus = $(".warninganchor_bal"); setfocus.focus(); void(0); $("#owner1_tos_id").prop("checked", false); processOLB = true; } }); $("input[name=eStatement]").change(function(){ $("#onlineProfileTerms").hide(); if($("#eStatement_id").value() == "Y"){ $("#estatementterms").show(); processEstat = false; } if($("#eStatement_id").value() == "N"){ $("#estatementterms").hide(); $("#owner1_tos2_id").prop("checked", false); processEstat = true; } }); $('.regular').attr({"aria-hidden": "false"}); $('.BalProNum').attr({"aria-hidden": "true"}); $("#startActivation").click(function(){ $("#validate-card-elig").hide(); if($("#page-1").valid()) { $("#submit_modal_index").animate({opacity: 'show'}, "fast", "linear", function() { $("#validate-form").hide(); try { cardEncryption(enc); } catch(err) { var XML_Data = $.parseJSON(err); var status = XML_Data["result_code"]; var msg = data["result_content"]; error(status,msg); } try { activationData(url); } catch(err) { var XML_Data = $.parseJSON(err); var status = XML_Data["result_code"]; var msg = data["result_content"]; error(status,msg); } }); } else { location.href="#top" $("#validate-form").show(); $(".break").show(); $(".contentframework-required-icon").show(); } }); $(".owner1_tosE").hide(); $(".owner1_tos2E").hide(); var h3 = $("#accordion h3"); $("#Continue-1").click(function(){ $("#validate-card-activate").hide(); if($("#panel-1-content").valid() && ExpireError == false && birthError == false) { if($("#owner1_dob_mmm_id").val() == "" && $("#owner1_dob_dd_id").val() == "" && $("#owner1_dob_yyyy_id").val() == ""){ $("#owner1_dob_mmm_id").show_error(false,content.owner1_dob_mmm[$("#lang_id").value()].errors.required); $(".birthDateErrorBr").show(); } else if( constraints.date(birth_date , ["ymd"]) == false || constraints.notfuture(birth_date,["ymd"]) == false){ $("#owner1_dob_mmm_id").show_error(false,content.owner1_dob_mmm[$("#lang_id").value()].errors.match); $("#owner1_dob_yyyy_id").addClass("qk-error"); $("#owner1_dob_dd_id").addClass("qk-error"); $(".birthDateErrorBr").show(); } if($("#card_doe_yyyy_id").val() == "" && $("#card_doe_mm_id").val() == ""){ $("#card_doe_mm_id").show_error(false,content.card_doe_yyyy[$("#lang_id").value()].errors.required); $("#card_doe_mm_id").addClass("qk-error"); $("#card_doe_yyyy_id").addClass("qk-error"); } else if($("#card_doe_yyyy_id").val() == "" || $("#card_doe_mm_id").val() == ""){ $("#card_doe_mm_id").show_error(false,content.card_doe_yyyy[$("#lang_id").value()].errors.expiry); $("#card_doe_mm_id").addClass("qk-error"); $("#card_doe_yyyy_id").addClass("qk-error"); } else if(ExpireError){ $("#card_doe_mm_id").show_error(false,content.card_doe_yyyy[$("#lang_id").value()].errors.expiry); $("#card_doe_mm_id").addClass("qk-error"); $("#card_doe_yyyy_id").addClass("qk-error"); } $(".balance_protectorE").show(); $("#validate-activation").hide(); $("#submit_modal").animate({opacity: 'show'}, "fast", "linear", function() { $("#number1").hide(); $("#number1passive").show(); $("#link-1").hide(); $("#cardHolderE").hide(); $("#link-1-passive").show(); $("#editbutton-1").hide(); $("#cardHolderE").hide(); $("#securityE").hide(); $(h3[0]).removeClass('activated'); nextPanel = cardActivate(url4); if(nextPanel == 0 && OLBonly == false){ $('#section1').attr({"aria-hidden": "true"}); $('#section2').attr({"aria-hidden": "false"}); $(".BalProNum").show(); $(".submit_button_area").hide(); $('.regular').attr({"aria-hidden": "true"}); $('.BalProNum').attr({"aria-hidden": "false"}); $(".regular").hide(); $("#submit_modal").hide(); goTo(1); $("#accordion").find("h3").attr("tabindex","-1"); } else if(nextPanel == 0 && OLBonly) { $("#submit_modal").hide(); showModalWindow2("#BalProModal"); //goToOLB(3); } }); } else { location.href="#top"; if(!$("#card_doe_mm_id").valid() || !$("#card_doe_yyyy_id").valid() || !$("#ccv_id").valid()){ $("#cardHolderE").show(); } else { $("#cardHolderE").hide(); } if(!$("#securityQ").valid() || !$("#owner1_dob_mmm_id").valid() || !$("#owner1_dob_dd_id").valid() || !$("#owner1_dob_yyyy_id").valid()){ $("#securityE").show(); } else { $("#securityE").hide(); } if($("#card_doe_yyyy_id").val() == "" && $("#card_doe_mm_id").val() == ""){ $("#card_doe_mm_id").show_error(false,content.card_doe_yyyy[$("#lang_id").value()].errors.required); $("#card_doe_mm_id").addClass("qk-error"); $("#card_doe_yyyy_id").addClass("qk-error"); } else if($("#card_doe_yyyy_id").val() == "" || $("#card_doe_mm_id").val() == ""){ $("#card_doe_mm_id").show_error(false,content.card_doe_yyyy[$("#lang_id").value()].errors.expiry); $("#card_doe_mm_id").addClass("qk-error"); $("#card_doe_yyyy_id").addClass("qk-error"); } else if(ExpireError){ $("#card_doe_mm_id").show_error(false,content.card_doe_yyyy[$("#lang_id").value()].errors.expiry); $("#card_doe_mm_id").addClass("qk-error"); $("#card_doe_yyyy_id").addClass("qk-error"); } if($("#owner1_dob_mmm_id").val() == "" && $("#owner1_dob_dd_id").val() == "" && $("#owner1_dob_yyyy_id").val() == ""){ $("#owner1_dob_mmm_id").show_error(false,content.owner1_dob_mmm[$("#lang_id").value()].errors.required); $(".birthDateErrorBr").show(); $("#securityE").show(); } else if( constraints.date(birth_date , ["ymd"]) == false || constraints.notfuture(birth_date,["ymd"]) == false){ $("#owner1_dob_mmm_id").show_error(false,content.owner1_dob_mmm[$("#lang_id").value()].errors.match); $("#owner1_dob_yyyy_id").addClass("qk-error"); $("#owner1_dob_dd_id").addClass("qk-error"); $(".birthDateErrorBr").show(); $("#securityE").show(); } $(".balance_protectorE").hide(); $(".owner1_tosE").hide(); $(".usernameE").hide(); $(".userPassE").hide(); $(".confirmUserPassE").hide(); $(".owner1_emailE").hide(); $(".eStatementE").hide(); $(".owner1_tos2E").hide(); $("#validate-activation").show(); $(h3[1]).removeClass('activated'); $(h3[2]).removeClass('activated'); $("#number2").hide(); $("#number2passive").show(); $(".break_cardHolder").show(); $("#expDateGeneralBr").show(); $("#expDateErrorBr").show(); $(".cardHolder").show(); $("#link-2").hide(); $("#link-2-passive").show(); $("#editbutton-2").hide(); } }); $(".BalProCont").click(function(){ if(processOLB == false) { if($("#owner1_tos_id").value() == "Y"){ processOLB = true; } else { $("#owner1_tos_id").show_error(false,content.owner1_tos[$("#lang_id").value()].errors.required); } } if($("#secondContent").valid() && processOLB) { $("#validate-activation").hide(); $(".BalProNum").hide(); $(".submit_button_area").show(); $(".regular").show(); $("#balance_protectorE").hide(); $(".owner1_tosE").hide(); $("#balE").hide(); $("#submit_modal").animate({opacity: 'show'}, "fast", "linear", function() { $(".eStatementE").show(); $("#number2").hide(); $("#number2passive").show(); $("#number2passive").append(''); $("#link-2").hide(); $("#link-2-passive").show(); $("#editbutton-2").hide(); $(h3[2]).addClass('activated'); if($("#owner1_tos_id").value() == "Y"){ BalDecision = "Accepted"; var balElig = FullfillBalPro(balPro); if(balElig == 0){ $("#BalProConfirm").show(); document.getElementById("BalProFinal").value = "Y"; dcsMultiTrack('DCS.dcsuri', '/public/occa/modal-now-active-with-bp.htm'); //console.log("modal-now-active-with-bp.htm"); } } else { BalDecision = "NotAccepted"; FullfillBalPro(balPro); $("#BalProConfirm").hide(); document.getElementById("BalProFinal").value = "N"; dcsMultiTrack('DCS.dcsuri', '/public/occa/modal-now-active-declined-bp.htm'); //console.log("modal-now-active-declined-bp.htm"); } $("#submit_modal").hide(); showModalWindow2("#BalProModal"); $('#section1').attr({"aria-hidden": "true"}); $('#section2').attr({"aria-hidden": "true"}); $('#section3').attr({"aria-hidden": "false"}); $('.regular').attr({"aria-hidden": "false"}); $('.BalProNum').attr({"aria-hidden": "true"}); }); } else { location.href="#top"; $(".owner1_dobE").hide(); $(".owner1_home_phoneE").hide(); $(".owner1_driverslicenseE").hide(); $(".owner1_bus_phoneE").hide(); $(".owner1_sinE").hide(); $(".owner1_RBCproductsE").hide(); $(".usernameE").hide(); $(".userPassE").hide(); $(".confirmUserPassE").hide(); $(".owner1_emailE").hide(); $(".eStatementE").hide(); $(".owner1_tos2E").hide(); $("#validate-activation").show(); $("#balE").show(); $(h3[2]).removeClass('activated'); $("#number3").hide(); $("#number3passive").show(); $(".balance").show(); $(".break").show(); $("#balanceterms").show(); $("#link-3").hide(); $("#link-3-passive").show(); $("#editbutton-3").hide(); } }); $("#congrats").click(function(){ $("#balE").hide(); $(".balance_protectorE").hide(); if(processEstat == false) { if($("#owner1_tos2_id").value() == "Y"){ processEstat = true; $("#onlineProfileTerms").hide(); $("#eStatE").hide(); $("#owner1_tos2_id").show_error(true,content.owner1_tos2[$("#lang_id").value()].errors.required); } else { $("#onlineProfileTerms").show(); $("#eStatE").show(); $("#owner1_tos2_id").show_error(false,content.owner1_tos2[$("#lang_id").value()].errors.required); } } if($("#lastContent").valid() && processEstat) { $("#validate-activation").hide(); /// Removing the availability results // $("#invalidOLBName").hide(); $("#validOLBName").hide(); $("#invalidOLBService").hide(); ////////////////////////////////////////// $("#submit_modal").animate({opacity: 'show'}, "fast", "linear", function() { $(".owner1_tos2E").hide(); olbFull = FullfillOLB(OLB); if(olbFull == 6){ $("#submit_modal").hide(); $("#validate-activation").show(); $("#OLBE").show(); $(".onlineProfile").show(); $(".break-online").show(); $("#username_id").show_error(false,content.username[$("#lang_id").value()].errors.notavailable); $("#username_id").addClass("qk-error"); $("#missingU").hide(); $("#invalidU").show(); } if(eStatCall && olbFull == 0){ if($("#owner1_tos2_id").value() == "Y"){ eDocDecision = "Accepted"; eStatFull = FullfilleStat(eStatURL); if(eStatFull == 0){ document.getElementById("eStat").value = "Y"; } } else { eDocDecision = "NotAccepted"; eStatFull = FullfilleStat(eStatURL); document.getElementById("eStat").value = "N"; } } if(olbFull == 0){ $("#submit_modal").hide(); $("#OLBind2").val($("#OLBind").val()); $("#BalProFinal2").val($("#BalProFinal").val()); $("#eStat2").val($("#eStat").val()); document.getElementById("page_2_post").submit(); } }); } else { location.href="#top"; $(".balance_protectorE").hide(); $("#validate-activation").show(); //////// HOPEFULLY WILL BE GONE ///////// var unness = $(".usernameE").find("span").text(); var unness2 = $(".userPassE").find("span").text(); if(unness != ""){ if(lang == "fr"){ var temp = unness.split(" "); unness = temp[1]; } unness = unness.substring(0,1); if(unness == "M" || unness == "m" || unness == "U"){ $("#missingU").show(); $("#invalidU").hide(); } else { $("#missingU").hide(); $("#invalidU").show(); } } if(unness2 != ""){ if(lang == "fr"){ var temp2 = unness2.split(" "); unness2 = temp2[3]; } unness2 = unness2.substring(0,1); if(unness2 == "M" || unness2 == "Y" || unness2 == "m" || unness2 == "p"){ $("#missingP").show(); $("#invalidP").hide(); } else { $("#missingP").hide(); $("#invalidP").show(); } } //////////////////////////////////////// $("#OLBE").show(); $("#eStatE").show(); if(eStatCall == false){ $("#eStatE").hide(); } else if($("#eStatement_id").value() == "Y" && $("#owner1_tos2_id").value() == ""){ $("#eStatE").show(); } else if($("#eStatement_id").value() == "N"){ $("#eStatE").hide(); } else if($("#eStatement_id").value() != ""){ $("#eStatE").show(); } /// Removing the availability results // $("#invalidOLBName").hide(); $("#validOLBName").hide(); $("#invalidOLBService").hide(); ////////////////////////////////////////// if($("#OLBprofile").valid()){ $("#OLBE").hide(); } $(".onlineProfile").show(); $(".break-online").show(); if(olbFull == 6 && $("#username_id").valid()){ $("#OLBE").show(); $("#username_id").show_error(false,content.username[$("#lang_id").value()].errors.notavailable); $("#username_id").addClass("qk-error"); $("#missingU").hide(); $("#invalidU").show(); } if($("#eStatement_id").value() == "Y" && $("#owner1_tos2_id").value() != ""){ $("#eStatE").hide(); } } }); $("#checkOLB").click(function(){ $(".eStatementE").hide(); if($("#username_id").valid()){ $("#submit_modal").animate({opacity: 'show'}, "fast", "linear", function() { var oldID = olbIDcheck(olbcheck); if(oldID == 0){ $("#submit_modal").hide(); $("#invalidOLBName").show(); $("#validOLBName").hide(); $("#invalidOLBService").hide(); } else if(oldID == 2){ $("#submit_modal").hide(); $("#invalidOLBService").show(); $("#invalidOLBName").hide(); $("#validOLBName").hide(); } else { $("#submit_modal").hide(); $("#validOLBName").show(); $("#invalidOLBService").hide(); $("#invalidOLBName").hide(); } }); } else { $(".olbValid").show(); $(".break-online").show(); $("#validOLBName").hide(); $("#invalidOLBName").hide(); $("#invalidOLBService").hide(); } }); $("#skipThisStep").click(function(){ //showModalWindow2("#submit_modal"); dcsMultiTrack('DCS.dcsuri', '/public/occa/skip-step-btn.htm'); //console.log("skip-step-btn.htm"); document.getElementById("page_1").submit(); }); $("#hardRight").click(function(){ dcsMultiTrack('DCS.dcsuri', '/public/mobile/occa/sign-into-olb-btn.htm'); }); $("#submitCard").click(function(){ //showModalWindow2("#submit_modal"); document.getElementById("page_2").submit(); }); //////////////////////////////////////////////////////////////////////////////////////////////////////////////// $("#Continue-direct").click(function(){ $("#validate-card-activate").hide(); if($("#cardHolderInfo").valid() && ExpireError == false && birthError == false) { if($("#owner1_dob_mmm_id").val() == "" && $("#owner1_dob_dd_id").val() == "" && $("#owner1_dob_yyyy_id").val() == ""){ $("#owner1_dob_mmm_id").show_error(false,content.owner1_dob_mmm[$("#lang_id").value()].errors.required); $(".birthDateErrorBr").show(); } else if( constraints.date(birth_date , ["ymd"]) == false || constraints.notfuture(birth_date,["ymd"]) == false){ $("#owner1_dob_mmm_id").show_error(false,content.owner1_dob_mmm[$("#lang_id").value()].errors.match); $("#owner1_dob_yyyy_id").addClass("qk-error"); $("#owner1_dob_dd_id").addClass("qk-error"); $(".birthDateErrorBr").show(); } if($("#card_doe_yyyy_id").val() == "" && $("#card_doe_mm_id").val() == ""){ $("#card_doe_mm_id").show_error(false,content.card_doe_yyyy[$("#lang_id").value()].errors.required); $("#card_doe_mm_id").addClass("qk-error"); $("#card_doe_yyyy_id").addClass("qk-error"); } else if($("#card_doe_yyyy_id").val() == "" || $("#card_doe_mm_id").val() == ""){ $("#card_doe_mm_id").show_error(false,content.card_doe_yyyy[$("#lang_id").value()].errors.expiry); $("#card_doe_mm_id").addClass("qk-error"); $("#card_doe_yyyy_id").addClass("qk-error"); } else if(ExpireError){ $("#card_doe_mm_id").show_error(false,content.card_doe_yyyy[$("#lang_id").value()].errors.expiry); $("#card_doe_mm_id").addClass("qk-error"); $("#card_doe_yyyy_id").addClass("qk-error"); } $("#validate-activation").hide(); $("#submit_modal").animate({opacity: 'show'}, "fast", "linear", function() { if(cardActivate(url4) == 0){ dcsMultiTrack('DCS.dcsuri', '/public/occa/modal-now-active.htm'); //console.log("modal-now-active.htm"); showModalWindow2("#BalProModal"); } }); } else { location.href="#top"; if(!$("#card_doe_mm_id").valid() || !$("#card_doe_yyyy_id").valid() || !$("#ccv_id").valid()){ $("#cardHolderE").show(); } else { $("#cardHolderE").hide(); } if(!$("#securityQ").valid() || !$("#owner1_dob_mmm_id").valid() || !$("#owner1_dob_dd_id").valid() || !$("#owner1_dob_yyyy_id").valid()){ $("#securityE").show(); } else { $("#securityE").hide(); } if($("#card_doe_yyyy_id").val() == "" && $("#card_doe_mm_id").val() == ""){ $("#card_doe_mm_id").show_error(false,content.card_doe_yyyy[$("#lang_id").value()].errors.required); $("#card_doe_mm_id").addClass("qk-error"); $("#card_doe_yyyy_id").addClass("qk-error"); } else if($("#card_doe_yyyy_id").val() == "" || $("#card_doe_mm_id").val() == ""){ $("#card_doe_mm_id").show_error(false,content.card_doe_yyyy[$("#lang_id").value()].errors.expiry); $("#card_doe_mm_id").addClass("qk-error"); $("#card_doe_yyyy_id").addClass("qk-error"); } else if(ExpireError){ $("#card_doe_mm_id").show_error(false,content.card_doe_yyyy[$("#lang_id").value()].errors.expiry); $("#card_doe_mm_id").addClass("qk-error"); $("#card_doe_yyyy_id").addClass("qk-error"); } if($("#owner1_dob_mmm_id").val() == "" && $("#owner1_dob_dd_id").val() == "" && $("#owner1_dob_yyyy_id").val() == ""){ $("#owner1_dob_mmm_id").show_error(false,content.owner1_dob_mmm[$("#lang_id").value()].errors.required); $(".birthDateErrorBr").show(); } else if( constraints.date(birth_date , ["ymd"]) == false || constraints.notfuture(birth_date,["ymd"]) == false){ $("#owner1_dob_mmm_id").show_error(false,content.owner1_dob_mmm[$("#lang_id").value()].errors.match); $("#owner1_dob_yyyy_id").addClass("qk-error"); $("#owner1_dob_dd_id").addClass("qk-error"); $(".birthDateErrorBr").show(); } $(".balance_protectorE").hide(); $(".owner1_tosE").hide(); $(".usernameE").hide(); $(".userPassE").hide(); $(".confirmUserPassE").hide(); $(".owner1_emailE").hide(); $(".eStatementE").hide(); $(".owner1_tos2E").hide(); $(".cardHolder").show(); $("#validate-activation").show(); $(".break_cardHolder").show(); $("#expDateGeneralBr").show(); $("#expDateErrorBr").show(); $(".cardHolder").show(); } }); //////////////////////////////////////////////////////////////////////////////////////////////////////////////// $("#activate-business").click(function(){ $("#validate-card-activate").hide(); if($("#business").valid() && ExpireErrorBus == false) { if($("#card_doe_yyyy_bus_id").val() == "" && $("#card_doe_mm_bus_id").val() == ""){ $("#card_doe_mm_bus_id").show_error(false,content.card_doe_yyyy_bus[$("#lang_id").value()].errors.required); $("#card_doe_mm_bus_id").addClass("qk-error"); $("#card_doe_yyyy_bus_id").addClass("qk-error"); } else if($("#card_doe_yyyy_bus_id").val() == "" || $("#card_doe_mm_bus_id").val() == ""){ $("#card_doe_mm_bus_id").show_error(false,content.card_doe_mm_bus[$("#lang_id").value()].errors.expiry); $("#card_doe_mm_bus_id").addClass("qk-error"); $("#card_doe_yyyy_bus_id").addClass("qk-error"); } else if(ExpireErrorBus){ $("#card_doe_mm_bus_id").show_error(false,content.card_doe_mm_bus[$("#lang_id").value()].errors.expiry); $("#card_doe_mm_bus_id").addClass("qk-error"); $("#card_doe_yyyy_bus_id").addClass("qk-error"); } $("#validate-activation").hide(); $("#submit_modal").animate({opacity: 'show'}, "fast", "linear", function() { if(cardActivateBusiness(url5) == 0){ $("#goOLB").show(); $("#submitCard").hide(); $("#continue").hide(); $(".rbc-modalwindow-close").hide(); $("#submit_modal").hide(); dcsMultiTrack('DCS.dcsuri', '/public/occa/modal-now-active.htm'); //console.log("modal-now-active-with-bp.htm"); showModalWindow2("#BalProModal"); } }); } else { location.href="#top" $(".cardHolder").show(); $(".break_cardHolder").show(); $("#validate-activation").show(); if($("#card_doe_yyyy_bus_id").val() == "" && $("#card_doe_mm_bus_id").val() == ""){ $("#card_doe_mm_bus_id").show_error(false,content.card_doe_yyyy_bus[$("#lang_id").value()].errors.required); $("#card_doe_mm_bus_id").addClass("qk-error"); $("#card_doe_yyyy_bus_id").addClass("qk-error"); } else if($("#card_doe_yyyy_bus_id").val() == "" || $("#card_doe_mm_bus_id").val() == ""){ $("#card_doe_mm_bus_id").show_error(false,content.card_doe_mm_bus[$("#lang_id").value()].errors.expiry); $("#card_doe_mm_bus_id").addClass("qk-error"); $("#card_doe_yyyy_bus_id").addClass("qk-error"); } else if(ExpireErrorBus){ $("#card_doe_mm_bus_id").show_error(false,content.card_doe_mm_bus[$("#lang_id").value()].errors.expiry); $("#card_doe_mm_bus_id").addClass("qk-error"); $("#card_doe_yyyy_bus_id").addClass("qk-error"); } $("#cardHolderE").show(); } }); }); /** HELPER FUNCTIONS **/ function edit(panel) { var panelplus = panel +1; var edit = $(".edit"); var activated = $(".activated"); var h3 = $("#accordion h3"); if ($(h3[panel]).hasClass('activated')) { $( "#accordion" ).accordion({ active: panel }); $(activated).show(); $(edit[panel]).hide(); $(h3).removeClass('current'); $(h3[panel]).addClass('current'); } } function dateFormatting(object_js, object, event) { if(numOnly(event) && (object.val().length == 4)) { object.val(object.val()+"-"); } if(event.keyCode == 8) { object.val(''); } } function activeDate() { var isActive = $(".ui-datepicker").is(":visible"); $(".ui-datepicker-trigger").toggle(!isActive); $(".ui-datepicker-trigger-active").toggle(isActive); } function dateFormatting2(object_js, object, event) { if(numOnly(event) && (object.val().length == 4 || object.val().length == 7)) { object.val(object.val()+"-"); } if(event.keyCode == 8) { object.val(''); } } function phoneFormatting(event) { if (numOnly(event)) { var value = $(event.target).val(); if(value.length >= 4 && value.substring(3,4) != '-') { value = value.substring(0,3) + "-" + value.substring(3,value.length); } if(value.length >= 8 && value.substring(7,8) != '-') { value = value.substring(0,7) + "-" + value.substring(7,value.length); } $(event.target).val(value); } } function numOnly(event){ if ( event.keyCode == 46 || event.keyCode == 8 || event.keyCode == 9 || event.keyCode == 27 || event.keyCode == 13 || event.keyCode == 109 || (event.keyCode == 65 && event.ctrlKey === true) || (event.keyCode == 86 && event.ctrlKey === true) || (event.keyCode >= 35 && event.keyCode <= 39)) { return true; } else { if (event.shiftKey || (event.keyCode < 48 || event.keyCode > 57) && (event.keyCode < 96 || event.keyCode > 105 )) { event.preventDefault(); return false; } return true; } } function activationData(url){ var secObjId = $("#secObjId").value(); var encCardNum = $("#encCardNum").value(); var data = { 'secObjId': secObjId , 'encCardNum' : encCardNum}; jQuery.ajax({ url: url, type: "POST", dataType: 'text', data: ({ "data" : JSON.stringify(data) }), success: function(response) { var data = $.parseJSON(response); var status = data["result_code"]; if(status == ""){ status = 999; var msg = data["result_content"]; error(status,msg); } if(status == 0){ $("#owner1_client_card_num_id").show_error(true,content.owner1_client_card_num[$("#lang_id").value()].errors.client_card); $(".contentframework-required-icon").hide(); $("#validate-card-elig").hide(); var processID = data["processID"]; document.getElementById("processID").value = processID; var OLBInd = data["OLBInd"]; var acctType = data["acctType"]; document.getElementById("acctType").value = acctType; var prodCode = data["prodCode"]; document.getElementById("prodCode").value = prodCode; if(OLBInd == 1 && acctType != "Business"){ $("#submit_modal_index").hide(); showModalWindow2("#signin-modal"); } else{ document.getElementById("page_1").submit(); } } else if(status == -800305) { $("#submit_modal_index").hide(); dcsMultiTrack('DCS.dcsuri', '/public/occa/modal-already-active.htm'); //console.log("modal-already-active.htm"); showModalWindow2("#activated"); }else if(status == -800304) { var acctType = data["acctType"]; var prodCode = data["prodCode"]; if(prodCode == "PBI"){ var msg = data["result_content"]; status = 1881; error(status,msg); } else { var msg = data["result_content"]; error(status,msg); } } else if(status == 2300){ location.href="#top"; $("#submit_modal_index").hide(); $("#validate-form").hide(); $("#validate-card-elig").show(); $(".contentframework-required-icon").show(); $("#owner1_client_card_num_id").show_error(false,content.owner1_client_card_num[$("#lang_id").value()].errors.client_card); } else { var msg = data["result_content"]; error(status,msg); } }, error:function(response) { var XML_Data = $.parseJSON(response); var status = XML_Data["result_code"]; var msg = data["result_content"]; error(status,msg); }, async: false }); } function cardEncryption(url){ var card = $("#owner1_client_card_num_id").value(); var data = { 'cardNum': card }; jQuery.ajax({ url: url, type: "POST", dataType: 'text', data: ({ "data" : JSON.stringify(data) }), success: function(response) { var data = $.parseJSON(response); var status = data["result_code"]; if(status == ""){ status = 999; var msg = data["result_content"]; error(status,msg); } if(status == 0){ var secObjId = data["secObjId"]; var encCardNum = data["encCardNum"]; document.getElementById("secObjId").value = secObjId; document.getElementById("encCardNum").value = encCardNum; document.getElementById("PARM1").value = encCardNum; var temp_sec = secObjId.split(":"); document.getElementById("PARM2").value = temp_sec[2]; } else { var msg = data["result_content"]; error(status,msg); } }, error:function(response) { var XML_Data = $.parseJSON(response); var status = XML_Data["result_code"]; var msg = data["result_content"]; error(status,msg); }, async: false }); } function FullfillBalPro(url){ var processID = $("#processID").value(); var status = ""; var data = { 'processID': processID, 'decision': BalDecision, 'lang' : lang }; var success = false; jQuery.ajax({ url: url, type: "POST", dataType: 'text', data: ({ "data" : JSON.stringify(data) }), success: function(response) { var data = $.parseJSON(response); status = data["result_code"]; if(status == ""){ status = 999; var msg = data["result_content"]; error(status,msg); } if(status == 0){ success = true; data = data["result_content"]; var processID = data["processID"]; document.getElementById("processID").value = processID; if(BalDecision == "Accepted"){ lastName = escape((data["lastName"])); firstName= escape((data["firstName"])); cardnum = (data["cardnum"]); cardnum = cardnum.slice(0, 4) + "*" + cardnum.slice(5, cardnum.length); cardnum = cardnum.slice(0, 5) + "*" + cardnum.slice(6, cardnum.length); cardname = (data["cardname"]); cardname = cardname.replace(/‡/gi, " "); cardname = cardname.replace(/®/gi, " "); cardname = cardname.replace(/\ /gi, " "); cardname = cardname.replace(/\<\/sup\> /gi, " "); cardname = cardname.replace(/ \/gi, " "); cardname = cardname.replace(/ \<\/sup\>/gi, " "); cardname = cardname.replace(/ \ /gi, " "); cardname = cardname.replace(/ \<\/sup\> /gi, " "); cardname = cardname.replace(/\/gi, " "); cardname = cardname.replace(/\<\/sup\>/gi, " "); cardname = escape(cardname); addr1 = escape((data["addr1"])); addr2 = escape((data["addr2"])); if(addr1 == "" && addr2 != ""){ addr1 = addr2; } city = escape((data["city"])); prov = escape((data["prov"])); postal = escape((data["postal"])); country = escape((data["country"])); var birth_mm = $("#owner1_dob_mmm_id").value(); var birth_yyyy = $("#owner1_dob_yyyy_id").value(); var birht_dd = $("#owner1_dob_dd_id").value(); birth_date = birth_mm + "/" + birht_dd + "/" + birth_yyyy; var objDate = new Date(birth_date); var objDate2 = new Date(); var day = objDate2.getDate(); var month = objDate2.getMonth(); var yy = objDate2.getYear(); var year = (yy < 1000) ? yy + 1900 : yy; if(lang == "en"){ var monthNames = [ "January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December" ]; currDate = monthNames[objDate2.getMonth()] + " " + day + "," + year; birth_date = monthNames[objDate.getMonth()] + " " + birht_dd + "," + birth_yyyy; } else { currDate = day + "-" + month + "-" + year; birth_date = birht_dd + "-" + birth_mm + "-" + birth_yyyy; } } } else { var msg = data["result_content"]; error(status,msg); } }, error:function(response) { var XML_Data = $.parseJSON(response); var status = XML_Data["result_code"]; var msg = data["result_content"]; error(status,msg); }, async: false }); if(success){ return status; } } function FullfillOLB(url){ var processID = $("#processID").value(); var rbcxcq0_user = $("#username_id").val(); rbcxcq0_user = rbcxcq0_user.replace(/(^\s+|\s+$)/g,''); var rbcxcq0_pass = $("#userPass_id").value(); var email = $("#owner1_email_id").value(); var status = ""; var success = false; jQuery.ajax({ url: url, type: "POST", contentType: "application/x-www-form-urlencoded;charset=UTF-8", data: "processID=" + processID + "&rbcxcq0_user=" + escape(rbcxcq0_user) + "&rbcxcq0_pass=" + rbcxcq0_pass + "&owner1_email=" + email + "&lang=" + lang, success: function(response) { var data = $.parseJSON(response); status = data["result_code"]; if(status == ""){ status = 999; var msg = data["result_content"]; error(status,msg); } if(status == 0){ success = true; data = data["result_content"]; var processID = data["processID"]; document.getElementById("processID").value = processID; } else if(status == 6){ success = true; } else { status = 2000; var msg = data["result_content"]; error(status,msg); } }, error:function(response) { var XML_Data = $.parseJSON(response); var status = XML_Data["result_code"]; var msg = data["result_content"]; error(status,msg); }, async: false }); if(success){ return status; } } function FullfilleStat(url){ var processID = $("#processID").value(); var data = { 'processID': processID, 'decision': eDocDecision }; var success = false; var status = ""; jQuery.ajax({ url: url, type: "POST", dataType: 'text', data: ({ "data" : JSON.stringify(data) }), success: function(response) { var data = $.parseJSON(response); status = data["result_code"]; if(status == ""){ status = 999; var msg = data["result_content"]; error(status,msg); } if(status == 0){ success = true; data = data["result_content"]; var processID = data["processID"]; document.getElementById("processID").value = processID; } else { status = 2001; var msg = data["result_content"]; error(status,msg); } }, error:function(response) { var XML_Data = $.parseJSON(response); var status = XML_Data["result_code"]; var msg = XML_Data["result_content"]; error(status,msg); }, async: false }); if(success){ return status; } } function olbIDcheck(url){ var processID = $("#processID").value(); var OLBid = $("#username_id").val(); OLBid = OLBid.replace(/(^\s+|\s+$)/g,''); var data = { 'processID': processID, 'OLBID' : OLBid}; var success = false; var validOLB = ""; jQuery.ajax({ url: url, type: "POST", dataType: 'text', data: ({ "data" : JSON.stringify(data) }), success: function(response) { var data = $.parseJSON(response); var status = data["result_code"]; if(status == ""){ status = 999; var msg = data["result_content"]; error(status,msg); } if(status == 0){ success = true; data = data["result_content"]; var processID = data["processID"]; document.getElementById("processID").value = processID; validOLB = data["validOLB"]; } else { success = true; validOLB = "2"; } }, async: false }); if(success){ return validOLB; } } function cardActivate(url){ var processID = $("#processID").value(); var status = ""; var products = ""; var success = false; var exp_mm = $("#card_doe_mm_id").value(); var exp_yyyy = $("#card_doe_yyyy_id").value(); var exp_date = exp_yyyy + "-" + exp_mm; var authAns = ""; var ccv = $("#ccv_id").value(); var birth_mm = $("#owner1_dob_mmm_id").value(); var birth_yyyy = $("#owner1_dob_yyyy_id").value(); var birht_dd = $("#owner1_dob_dd_id").value(); var birth_date = birth_yyyy + "-" + birth_mm + "-" + birht_dd; if($("#owner1_driverslicense_id").value()) { var authAns= $("#owner1_driverslicense_id").value(); } else if($("#owner1_sin_id").value()){ var authAns = $("#owner1_sin_id").value(); } else if($("#owner1_home_phone_id").value()){ var homePhone = $("#owner1_home_phone_id").value(); var area = homePhone.substr(0,3); var first = homePhone.substr(4,3); var second = homePhone.substr(8,4); authAns = area + "-" + first + second + "+0000"; } else if($("#owner1_bus_phone_id").value()){ var workPhone = $("#owner1_bus_phone_id").value(); var area = workPhone.substr(0,3); var first = workPhone.substr(4,3); var second = workPhone.substr(8,4); authAns = area + "-" + first + second + "+0000"; } for (i = 0; i < page_2.owner1_RBCproducts.length; i++) if (page_2.owner1_RBCproducts[i].checked){ products += "" + page_2.owner1_RBCproducts[i].value + ""; } var data = { 'processID': processID , 'ccv': ccv, 'expDate': exp_date, 'birthDate': birth_date, 'authAns': authAns, 'products': encodeURIComponent(products)}; jQuery.ajax({ url: url, type: "POST", dataType: 'text', data: ({ "data" : JSON.stringify(data) }), success: function(response) { var data = $.parseJSON(response); status = data["result_code"]; if(status == ""){ status = 999; var msg = data["result_content"]; error(status,msg); } if(status == 0){ var processID = data["processID"]; document.getElementById("processID").value = processID; $("#validate-card-activate").hide(); $("#panel-1-content table tr").addClass("contentframework-altrow"); //$("tr:nth-child(odd)").css("background","#F6F4EF"); success = true; } else if(status == 1740){ location.href="#top"; $("#submit_modal").hide(); $("#validate-activation").hide(); $("#validate-card-activate").show(); $("#panel-1-content table tr").removeClass("contentframework-altrow"); $("#panel-1-content table tr").css("background-color","#F1E5E5"); } else if(status == 1880 && $("#prodCode").val() == "PBI"){ var msg = data["result_content"]; status = 1881; error(status,msg); } else { var msg = data["result_content"]; error(status,msg); } }, error:function(response) { var XML_Data = $.parseJSON(response); var status = XML_Data["result_code"]; var msg = data["result_content"]; error(status,msg); }, async: false }); if(success){ return status; } } function cardActivateBusiness(url){ var processID = $("#processID").value(); var status = ""; var success = false; var exp_mm = $("#card_doe_mm_bus_id").value(); var exp_yyyy = $("#card_doe_yyyy_bus_id").value(); var exp_date = exp_yyyy + "-" + exp_mm; var ccv = $("#ccv_bus_id").value(); var data = { 'processID': processID , 'ccv': ccv, 'expDate': exp_date}; jQuery.ajax({ url: url, type: "POST", dataType: 'text', data: ({ "data" : JSON.stringify(data) }), success: function(response) { var data = $.parseJSON(response); status = data["result_code"]; if(status == ""){ status = 999; var msg = data["result_content"]; error(status,msg); } if(status == 0){ var processID = data["processID"]; document.getElementById("processID").value = processID; $("#validate-card-activate").hide(); $("#panel-1-content table tr").addClass("contentframework-altrow"); success = true; } else if(status == 1740){ location.href="#top"; $("#submit_modal").hide(); $("#validate-activation").hide(); $("#validate-card-activate").show(); $("#panel-1-content table tr").removeClass("contentframework-altrow"); $("#panel-1-content table tr").css("background-color","#F1E5E5"); } else if(status == 1880 && $("#prodCode").val() == "PBI"){ var msg = data["result_content"]; status = 1881; error(status,msg); } else { var msg = data["result_content"]; error(status,msg); } }, error:function(response) { var XML_Data = $.parseJSON(response); var status = XML_Data["result_code"]; var msg = data["result_content"]; error(status,msg); }, async: false }); if(success){ return status; } } function authQuestion(url){ var processID = $("#processID").value(); var data = { 'processID': processID }; jQuery.ajax({ url: url, type: "POST", dataType: 'text', data: ({ "data" : JSON.stringify(data) }), success: function(response) { var data = $.parseJSON(response); var status = data["result_code"]; if(status == ""){ status = 999; var msg = data["result_content"]; error(status,msg); } if(status == 0){ var processID = data["processID"]; document.getElementById("processID").value = processID; var question = data["result_content"]; if(question == 0){ $("#sin").show(); $("#home_phone").empty(); $(".owner1_home_phone").empty(); $("#work_phone").empty(); $(".owner1_bus_phone").empty(); $("#drivers").empty(); $(".owner1_driverslicense").empty(); } else if(question == 1){ $("#drivers").show(); $("#home_phone").empty(); $(".owner1_home_phone").empty(); $("#sin").empty(); $(".owner1_sin").empty(); $("#work_phone").empty(); $(".owner1_bus_phone").empty(); } else if(question == 2){ $("#home_phone").show(); $("#sin").empty(); $(".owner1_sin").empty(); $("#work_phone").empty(); $(".owner1_bus_phone").empty(); $("#drivers").empty(); $(".owner1_driverslicense").empty(); } else if(question == 3){ $("#work_phone").show(); $("#home_phone").empty(); $(".owner1_home_phone").empty(); $("#sin").empty(); $(".owner1_sin").empty(); $("#drivers").empty(); $(".owner1_driverslicense").empty(); } } else { var msg = data["result_content"]; error(status,msg); } }, error:function(response) { var XML_Data = $.parseJSON(response); var status = XML_Data["result_code"]; var msg = data["result_content"]; error(status,msg); }, async: false }); } function retrieveProducts(url){ var processID = $("#processID").value(); var data = { 'processID': processID }; var indicator = $("#OLBind").val(); jQuery.ajax({ url: url, type: "POST", dataType: 'text', data: ({ "data" : JSON.stringify(data) }), success: function(response) { var XML_Data = $.parseJSON(response); var status = XML_Data["result_code"]; if(status == ""){ status = 999; var msg = data["result_content"]; error(status,msg); } if(status == 0){ var processID = XML_Data["processID"]; document.getElementById("processID").value = processID; var productOLB = XML_Data["OLB"]; var productBalPro = XML_Data["BalPro"]; var productEsat = XML_Data["Estat"]; if(productOLB != ""){ document.getElementById("OLBind").value = "Y"; } if(productOLB != "" && productEsat != ""){ document.getElementById("OLBind").value = "Y"; $("#section3").show(); $("#continue").show(); // } else if(productOLB == "" && productEsat != ""){ // OLBCallStat = false; // $("#section3").show(); // $("#continue").show(); // $("#OLBprofile").empty(); // $("#importantInfo").empty(); // $(".usernameE").empty(); // $(".userPassE").empty(); // $(".confirmUserPassE").empty(); // $(".owner1_emailE").empty(); } else if(productOLB != "" && productEsat == ""){ document.getElementById("OLBind").value = "Y"; $("#section3").show(); $("#continue").show(); $(".estatOnly").empty(); $(".eStatementE").empty(); $(".eStatementE").hide(); eStatCall = false; } else { $("#section3").empty(); $("#goOLB").show(); } if(productBalPro != ""){ $("#section2").show(); } else { $("#section2").empty(); } if(productBalPro == "" && productOLB != "" && productEsat != ""){ dcsMultiTrack('DCS.dcsuri', '/public/occa/card-activation-plus-olb-estatement.htm'); //console.log("card-activation-plus-olb-estatement"); } if(productBalPro != "" && productOLB != ""){ dcsMultiTrack('DCS.dcsuri', '/public/occa/card-activation-plus-bp-olb.htm'); //console.log("card-activation-plus-bp-olb.htm"); } if(productBalPro == "" && productOLB != "" && productEsat == ""){ OLBonly = true; document.getElementById("OLBnumber").innerHTML = "2"; document.getElementById("OLBind").value = "Y"; $("#section3").show(); $("#continueOLB").show(); $("#continue").hide(); $(".estatOnly").empty(); $("#submitCard").hide(); $(".rbc-modalwindow-close").hide(); $(".eStatementE").empty(); } else if(productBalPro == "" && productOLB != ""){ OLBonly = true; document.getElementById("OLBnumber").innerHTML = "2"; $("#continueOLB").show(); $("#continue").hide(); $("#submitCard").hide(); $(".rbc-modalwindow-close").hide(); } else if(productBalPro != "" && productOLB == ""){ dcsMultiTrack('DCS.dcsuri', '/public/occa/card-activation-plus-bp.htm'); //console.log("card-activation-plus-bp.htm"); $("#goOLB").show(); $("#submitCard").hide(); $(".rbc-modalwindow-close").hide(); // } else if(productEsat != "" && productOLB == "" && productBalPro == ""){ // OLBonly = true; // document.getElementById("OLBnumber").innerHTML = "2"; // $("#continueOLB").show(); // $("#continue").hide(); // $("#submitCard").hide(); // $(".rbc-modalwindow-close").hide(); // $("#section3").show(); // $("#OLBprofile").empty(); // $("#importantInfo").empty(); // $(".usernameE").hide(); // $(".userPassE").hide(); // $(".confirmUserPassE").hide(); // $(".owner1_emailE").hide(); } else if(productOLB == "" && productBalPro == ""){ dcsMultiTrack('DCS.dcsuri', '/public/occa/card-activation.htm'); //console.log("card-activation"); $("#Continue-1").hide(); $("#Continue-direct").show(); $("#goOLB").show(); $("#submitCard").hide(); $(".rbc-modalwindow-close").hide(); } } else { var msg = XML_Data["result_content"]; error(status,msg); } }, error:function(response) { var XML_Data = $.parseJSON(response); var status = XML_Data["result_code"]; }, async: false }); } function dependCheck() { var businessInd = document.getElementById("acctType").value; if(businessInd != 'Business'){ authQuestion(url2); retrieveProducts(url3); } $("#submit_modal").hide(); $("#wrapper").show(); } function error(code,msg) { var lang = $("#lang_id").val(); document.write("
"); document.getElementById("error").submit(); } function enrolledProducts() { var OLBEnrolled = $("#OLBind").val(); var BalProEnrolled = $("#BalProFinal").val(); var eStatEnrolled = $("#eStat").val(); if(OLBEnrolled == "Y"){ $("#OLBEnrolled").show(); } if(BalProEnrolled == "Y"){ $("#BalProEnrolled").show(); } if(eStatEnrolled == "Y"){ $("#eStatementEnrolled").show(); } if(OLBEnrolled != "Y" && BalProEnrolled != "Y" && eStatEnrolled != "Y"){ $("#any_prods").hide(); } }