var bukEPP_SelectCard = (function(window, jQuery, parent) { parent.activeIndex = null; parent.initialize = function() { window.scrollTo(0,0); if(jQuery("#accounts").length == 1) { jQuery('#accounts').change(function(){ jQuery("#tooltip").jfpwidget('destroy'); jQuery.ajax({ url: getContextPath() + "/CBOL/loa/bukepp/flow.action", type:"post", data:{"activeIndex": this.value}, success:function(data){ window.scrollTo(0,0); jQuery('#jfpBody').parent().html(data); jQuery('#bookEPPSelectCardSpinner').jfpwidget('block', '.cS-structMainContainer'); jQuery(data).remove('.cF-bottomNav'); jQuery('#flowExecutionKey').val(jQuery('#flowExecutionKey', data).val()); jQuery('#eventId').val(jQuery('#eventId', data).val()); alternateRowColor(); setDefaultRadioStatus(); jQuery('#bookEPPTable').delegate('input', 'click', radioStatusHandler); jQuery('#bookEPPTable').delegate('input', 'focus', radioStatusHandler); jQuery('#bookEPPSelectCardSpinner').jfpwidget('unblock'); }, error:function(){} }); }); } if(parent.activeIndex) { jQuery('#accounts').jfpwidget('widget').value(parent.activeIndex) } if(jQuery('#accounts > option').length == 1) { jQuery('#accounts').jfpwidget('disable'); } alternateRowColor(); jQuery('#bookEPPTable').delegate('input', 'click', radioStatusHandler); jQuery('#bookEPPTable').delegate('input', 'focus', radioStatusHandler); setDefaultRadioStatus(); }; parent.bukEPP = function() { jQuery('#bookEPPAuthorizationDialogueBox').remove(); jQuery('#bookEPPAuthorizationDialogueBox').parent().remove(); if(jQuery('input:radio:checked').length != 0) { jQuery.ajax({ url: getContextPath() + "/CBOL/loa/bukepp/flow.action", type:"post", data:jQuery('#bookEPP_SelectCard').serialize() + '&eppTransactionIndex=' + jQuery('input:radio:checked').val(), success:function(data){ window.scrollTo(0,0); jQuery('#jfpBody').parent().html(data); }, error:function(){} }); } else { jQuery("#radioTooltip").jfpwidget('show'); } }; function alternateRowColor() { if(jQuery('#bookEPPTable.cT-alternateRowColor table > tbody > tr').length != 2) { jQuery('#bookEPPTable.cT-alternateRowColor table > tbody > tr:odd').addClass('cT-odd'); } } function setDefaultRadioStatus() { jQuery('input:radio:checked').each( function() { jQuery(this).attr('checked', false); } ); jQuery('input:radio:first').attr('checked', 'checked'); } function getContextPath() { var pathName = document.location.pathname; var index = pathName.substr(1).indexOf("/"); var contextPath = pathName.substr(0,index+1); return contextPath; } function radioStatusHandler() { jQuery('#bookEPPTable table > tbody > tr input:radio').each( function() { jQuery(this).attr('checked', false); } ); jQuery(this).attr('checked', true); } return parent; }(window, window.jQuery, window.bukEPP_SelectCard || {})); var bukEPP_Make = (function(window, jQuery, parent) { parent.checkboxErrorMsg = ''; var payments = null; var popupWindow = null; parent.initialize = function(pageName) { window.scrollTo(0,0); setupProgressWidget(); jQuery('#bookEPP_MakeSpinner').jfpwidget('block', '#bookEPP_Make'); if (pageName == 'verify') { jQuery('#bookEPP_VerifyNext').click(function(){ if (!jQuery('#chkTermsAndConditions').attr('checked')) { var invalidFields = [{fieldId: 'chkTermsAndConditions', error: parent.checkboxErrorMsg}]; renderFrontEndErrors('bookEPP_Verify', invalidFields); } else { jQuery.ajax({ url: getContextPath() + "/CBOL/loa/bukepp/flow.action", type:"post", data:jQuery('#bookEPP_Verify').serialize(), success:function(data){ if(data.indexOf('bookEPPOTPEnabledFlag')!= -1){ window.scrollTo(0,0); jQuery('#jfpBody').parent().html(data); } }, error:function(){} }); } }); jQuery('#termsAndConditionsSlider').jfpwidget('show'); jQuery('#termsAndConditionsSlider').jfpwidget('refresh'); } if (pageName == 'make') { if(parent.defaultPayment) { jQuery('#payments').jfpwidget('widget').value(parent.defaultPayment); } } jQuery('#bookEPP_MakeSpinner').jfpwidget('unblock'); }; parent.changeInterestRate = function(paymentValue) { jQuery.ajax({ url: getContextPath() + "/CBOL/loa/bukepp/flow.action", type:"post", data:{"calculateEPPDetailsFlag": "true","payment":paymentValue,"_eventId":"submit","_flowExecutionKey":jQuery("#flowExecutionKey").val()}, success:function(data){ window.scrollTo(0,0); jQuery('#interestRate').html(jQuery('#interestRate', data).html()); jQuery('#assFee').hide(); if(jQuery('#fee', data).html()!=null){ jQuery('#associatedFee').html(jQuery('#fee', data).html()); jQuery('#associatedFeeDiv').show(); }else{ jQuery('#associatedFeeDiv').hide(); } jQuery('#flowExecutionKey').val(jQuery('#flowExecutionKey', data).val()); jQuery('#eventId').val(jQuery('#eventId', data).val()); jQuery('#paymentAmount').html(jQuery('#paymentAmount', data).html()); }, error:function(){} }); jQuery('#bookEPP_MakeSpinner').jfpwidget('block', '#bookEPP_Make'); jQuery('#bookEPP_MakeSpinner').jfpwidget('unblock'); }; parent.gotoNextStep = function() { jQuery('#bookEPPAuthorizationDialogueBox').remove(); jQuery('#bookEPPAuthorizationDialogueBox').parent().remove(); jQuery.ajax({ url: getContextPath() + "/CBOL/loa/bukepp/flow.action", type:"post", data:jQuery('#bookEPP_Make').serialize(), success:function(data){ window.scrollTo(0,0); jQuery('#jfpBody').parent().html(data); }, error:function(){} }); }; parent.chageDetails = function() { jQuery('#bookEPPAuthorizationDialogueBox').remove(); jQuery('#bookEPPAuthorizationDialogueBox').parent().remove(); jQuery('#eventId').val('changedetailssingle'); jQuery.ajax({ url: getContextPath() + "/CBOL/loa/bukepp/flow.action", type:"post", data:jQuery('#bookEPP_Verify').serialize(), success:function(data){ window.scrollTo(0,0); jQuery('#jfpBody').parent().html(data); }, error:function(){} }); }; parent.openAmortizationPopup = function() { }; parent.openTermsConditionsPopup = function() { if(!popupWindow || popupWindow.closed) { var html = jQuery('html').html(); html = html.replace(jQuery('.cF-leftNavContent').html(), jQuery('#termsAndConditions').html()); var innerHTML = "" + html + ""; popupWindow = window.open("about:blank", "TermsAndConditions", "width=625, height=600, top=50, left=250, scrollbars=yes"); popupWindow.document.write(innerHTML); popupWindow.document.close(); } }; function postProcess(data){ if(data.indexOf('ab8befbf-6ac7-499c-8fc8-7b4417db1f8f_error')!= -1){ $jq('body').html(data); } } function setupProgressWidget() { var currentSection = jQuery('#bookEPPProgressIndicator').jfpwidget().oCfg.currentSection; jQuery('#bookEPPProgressIndicator ul li:nth-child(' + currentSection + ')').addClass('cM-progressbar-currentStep'); if (currentSection == 2) { jQuery('#bookEPPProgressIndicator #cM-progressbar-tabs-1.cM-progressbar-active').addClass('cM-progressbar-hover'); jQuery('#bookEPPProgressIndicator').delegate('#cM-progressbar-tabs-1', 'mousedown', function(click) { if (click.which == 1) { parent.chageDetails(); } if (click.which == 2)console.log('right button'); }); } var maxWidth = 0; jQuery('#bookEPPProgressIndicator ul li').each(function(index) { if(jQuery(this).width() > maxWidth) maxWidth = jQuery(this).width(); }); jQuery('#bookEPPProgressIndicator ul li').each(function(index) { jQuery(this).width(maxWidth); }); } function populatePaymentsDropdown() { jQuery('#payments').html(""); for ( var x = 0; x < payments.length; x++) { jQuery('#payments').append( ''); } jQuery('#payments').jfpwidget("refresh"); } function getContextPath() { var pathName = document.location.pathname; var index = pathName.substr(1).indexOf("/"); var contextPath = pathName.substr(0,index+1); return contextPath; } function renderFrontEndErrors(formId, invalidFields){ var errorToolTipWrapper; for(var x=0; x< invalidFields.length;x++) { jQuery('#'+formId).undelegate('#'+invalidFields[x].fieldId, 'focusin'); jQuery('#'+formId).undelegate('#'+invalidFields[x].fieldId, 'click'); jQuery('#'+invalidFields[x].fieldId).jfpwidget('hide'); jQuery('#'+formId+' .cF-frontEndErrorText:not([id])').attr('id',invalidFields[x].fieldId+'-info'); errorToolTipWrapper = '#'+invalidFields[x].fieldId; errorValue = jQuery(errorToolTipWrapper).val(); jQuery('#'+formId + ' > fieldset').append('
'); jQuery('#'+formId).delegate(errorToolTipWrapper, 'focusin', {error: invalidFields[x].error, wrapper: errorToolTipWrapper}, function(e){ if(!jQuery(e.data.wrapper).hasClass('ui-tooltip-shown')) { jQuery('.ui-tooltip.qtip').qtip('hide'); jQuery('.ui-tooltip-shown').removeClass('ui-tooltip-shown'); displayFrontEndErrorTooltip(formId, e.data.wrapper, e.data.error); } }); jQuery('#'+formId).delegate(errorToolTipWrapper, 'click', {wrapper: errorToolTipWrapper}, function(e){ if(jQuery(errorToolTipWrapper).attr('checked')) { var wrapper = e.data.wrapper; x = 0; jQuery('#'+invalidFields[x].fieldId).parent().find('input').removeClass('cF-InvalidInputBackground'); setTimeout(function(){ jQuery('#'+formId).undelegate(wrapper, 'focusin'); jQuery('#'+formId).undelegate(wrapper, 'click'); jQuery(wrapper).jfpwidget('hide'); }, 0); } }); jQuery('#'+invalidFields[x].fieldId).parent().find('input').addClass('cF-InvalidInputBackground'); } errorToolTipWrapper = '#'+invalidFields[0].fieldId; setTimeout(function(){ jQuery(errorToolTipWrapper)[0].focus(); }, 0); } function displayFrontEndErrorTooltip(formId, toolTipWrapper, errorText){ jQuery(toolTipWrapper+'-info.cF-frontEndErrorText').html(errorText); if(jQuery(toolTipWrapper).jfpwidget() == undefined) { jQuery(toolTipWrapper).jfpwidget(new CJW.jfp.widget.Tooltip( { wrapperSet: toolTipWrapper }, { show: { solo: true, event: false, ready: true }, events: { show: function() { jQuery(toolTipWrapper).addClass('ui-tooltip-shown'); }, hide: function(){ jQuery(toolTipWrapper).removeClass('ui-tooltip-shown'); } }, type: 'error', position: { my: 'right center', at: 'left center' }, style: { tip: true }, hide: { event: false } } )); } jQuery(toolTipWrapper).jfpwidget('show'); } return parent; }(window, window.jQuery, window.bukEPP_Make || {})); var eppTermsAndConditions = (function(window, jQuery, parent) { parent.closeTermsAndConditions = function () { jQuery('#termsAndConditions').jfpwidget('close'); }; parent.renderOverlay = function() { jQuery('#termsAndConditionsOverlay').jfpwidget('open'); jQuery('#eppTermsAndConditionsSlider').jfpwidget('show'); jQuery('#eppTermsAndConditionsSlider').jfpwidget('refresh'); }; parent.printTermsConditions = function () { }; return parent; }(window, window.jQuery, window.eppTermsAndConditions || {})); var eppDialogueBox = (function(window, jQuery, parent) { parent.renderDialogueBox = function() { jQuery('#bookEPPAuthorizationDialogueBox').jfpwidget('open'); jQuery('.cS-dialogueBoxStandardContainer .cM-spriteBase.cN-primaryNavButton').blur(); }; parent.closeDialogueBox = function () { jQuery('#bookEPPAuthorizationDialogueBox').jfpwidget('close'); }; return parent; }(window, window.jQuery, window.eppDialogueBox || {} ));