'); } } } } }); if(!('indexOf' in Array.prototype)) { Array.prototype.indexOf= function(find, i ) { if(i === undefined) i = 0; if(i < 0) i += this.length; if(i < 0) i = 0; for(var n = this.length; i < n; i++) { if(i in this && this[i] === find) return i; } return -1; }; } Number.prototype.number_format = function(decPlaces, thouSeparator, decSeparator, currencySymbol) { var n = this, decPlaces = isNaN(decPlaces = Math.abs(decPlaces)) ? 2 : decPlaces, decSeparator = decSeparator == undefined ? "." : decSeparator, thouSeparator = thouSeparator == undefined ? "," : thouSeparator, currencySymbol = currencySymbol == undefined ? "" : currencySymbol, sign = n < 0 ? "-" : "", i = parseInt(n = Math.abs(+n || 0).toFixed(decPlaces)) + "", j = (j = i.length) > 3 ? (j % 3 > 0 ? 2 : 3) : 0; return sign + currencySymbol + (j ? i.substr(0, j) + thouSeparator : "") + i.substr(j).replace(/(\d{3})(?=\d)/g, "$1" + thouSeparator) + (decPlaces ? decSeparator + Math.abs(n - i).toFixed(decPlaces).slice(2) : ""); }; var savequote = ''; $('.loader').click(function(e) { $('#loadbox').removeClass('hide').attr('aria-hidden', 'false'); }); $('form').submit(function(e) { var form = this; e.preventDefault(); $('#loadbox').focus(); form.submit(); }); $.ajaxSetup({ cache: false, async: false }); var removeNotification = function(e) { $('.' + e).remove(); if (!document.cookie.match(/no-notify/)) document.cookie = "no-notify=" + e + "; path=/"; else { if (!document.cookie.match(new RegExp(e))) { var c = document.cookie.split(/;/); for (var i = 0; i < c.length; i++) { if (c[i].match(/no-notify/)) document.cookie = "no-notify=" + c[i].split(/=/)[1] + ' ' + e + "; path=/"; } } } if ($('.news').length == 0 && $('.promo').length == 0 && $('.sysmain').length == 0) $('.article-container').hide(); removeBorder(); }, removeBorder = function() { if ($('.news').length != 0 && $('.promo').length == 0 && $('.sysmain').length == 0) $('.news').addClass('no-bottom-border'); if ($('.promo').length != 0 && $('.sysmain').length == 0) $('.promo').addClass('no-bottom-border'); }; if (document.cookie.match(/news/)) removeNotification('news'); if (document.cookie.match(/promo/)) removeNotification('promo'); if (document.cookie.match(/sysmain/)) removeNotification('sysmain'); $('.close-article').click(function(e){ e.preventDefault(); removeNotification($(this).data('article-id')); }); removeBorder(); $('select').keydown(function(e){ (e.keyCode == 8 || e.which == 8) && e.preventDefault(); }); $(document).ready(function(e) { $('#mb_back').remove(); $('#dk_back, #mb_back, .jsclick').click(function(e){ e.preventDefault(); let loc_url; try { loc_url = new URL ('https:\/\/www.e-benefit.com' + $(this).data('href')); window.location.href = loc_url.href; } catch (error) { return false; } }); $('.digit, .numeric').bind('input', function(){ this.value = this.value.replace(/[^\d]/g, ''); }).bind('blur', function(){ if (this.value != '' && this.getAttribute('maxlength') == 2) this.value = this.value.padStart(this.getAttribute('maxlength'), 0); }); $('#aff_confirm').click(function(){ window.location.href = '/en/plandirect/about_plandirect.html?wl='; }); $('#aff_confirm').focus(); $('#aff_modal_left_lock').bind('focus', function(){ $('#aff_confirm').focus(); }); $('#aff_modal_right_lock').bind('focus', function(){ $('#aff_confirm').focus(); }); $('.error').each(function(){ var aria_id = ($(this).data('aria-id') !== undefined) ? $(this).data('aria-id') : this.id; if($(this).data('skip-aria-required') == true) { if($(this).attr('type') != 'radio') $(this).attr({'aria-describedby' : 'err_' + aria_id, 'aria-invalid' : true}); else $('div[role=radiogroup]').attr({'aria-describedby' : 'err_' + aria_id}); } else { if($(this).attr('type') != 'radio') $(this).attr({'aria-describedby' : 'err_' + aria_id, 'aria-invalid' : true, 'aria-required' : true}); } if($(this).attr('type') == 'radio') return; }); if (($('.error-header').text() != '' && !$('.error-header').hasClass('.error-inline-holder')) || $('.error-inline').first().text() != '') setTimeout(function(){ $('.error').first().focus(); if ($('.error').first().hasClass('telephone') || $('.error').first().hasClass('datetime')) $(document).scrollTop($('.error').first().offset().top - 50, 0); }, 500); $('select:not(.hide)').each(function(){ $(this).find('option[value=""]').attr('disabled', true); $(this).after('
'); }); var has_focus, location_expired, extension_count = parseInt('0'); $('#cancel_btn').bind('keydown', function(e){ if (e.which === 9 || e.keyCode === 9) { e.preventDefault(); e.stopImmediatePropagation(); e.stopPropagation(); $(this).prev().focus(); } }); $('#extend_btn').bind('keydown', function(e){ if (e.shiftKey && (e.which === 9 || e.keyCode === 9)) { e.preventDefault(); e.stopImmediatePropagation(); e.stopPropagation(); $(this).next().focus(); } }); $('#extend_btn').bind('click', function(e) { e.preventDefault(); clearTimeout(location_expired); $.get('/en/plandirect/about_plandirect.html?wl=&terms=1&433107d37c9ae91c31a3bc4484a93a8221c33c73', function() { extension_count++; $('.message').addClass('success').attr({'aria-describedby': 'is_extended', 'tabindex': 0}).focus(); $('#do_extend').addClass('hide').attr({'aria-hidden': 'true'}); $('#is_extended').removeClass('hide').attr({'aria-hidden': 'false'}); setTimeout(function(){ $('.message').removeClass('success').attr({'aria-describedby': 'do_extend'}).removeAttr('tabindex'); $('#extend_timer, #is_extended').addClass('hide').attr({'aria-hidden': 'true'}); $('#do_extend').removeClass('hide').attr({'aria-hidden': 'false'}); has_focus.focus(); }, 3000); }); }); var extendTimerPrompt = function() { if (!$('#extend_timer').hasClass('hide')) return; has_focus = $(document.activeElement); if (extension_count < 11) { $('#extend_timer').removeClass('hide').attr({'aria-hidden': 'false'}).bind('keyup', function(e){ if (e.which == 27 || e.keyCode == 27) $('#cancel_btn').trigger('click'); }); $('#extend_btn').focus(); $('#extend_timer .shader').bind('mousedown', function(e){ e.preventDefault(); e.stopImmediatePropagation(); e.stopPropagation(); }); } location_expired = setTimeout(function(){ window.location.href = '/en/eb/expired.html?wl='; }, 60000); }; var showPrompt = setInterval(extendTimerPrompt, '1440000'); var refreshRateTime = 30, refreshRate = function(){ if (refreshRateTime > 0) refreshRateTime--; else clearInterval(refreshCounter); }; var refreshCounter = setInterval(refreshRate, 1000); var refreshSesTimer = function() { if (refreshRateTime == 0) { $.ajax({url: '/en/plandirect/about_plandirect.html?wl=&terms=1&extm=1', type: 'get', async: true}); clearInterval(showPrompt); showPrompt = setInterval(extendTimerPrompt, '1440000'); refreshRateTime = 30; refreshCounter = setInterval(refreshRate, 1000); } }; $('input[type=text], input[type=radio], input[type=checkbox], textarea, select').focus(function() { refreshSesTimer(); }); $('input[type=radio], input[type=checkbox]').change(function() { refreshSesTimer(); }); $('#cancel_btn').bind('click', function(e) { e.preventDefault(); $('#extend_timer').addClass('hide').attr({'aria-hidden': 'true'}); clearInterval(showPrompt); refreshSesTimer = function(){ return false; }; refreshRateTime = 30; clearInterval(refreshCounter); has_focus.focus(); }); $('body').append(''); $('form, iframe').css({'display':'inherit'}); if(e.which == 13) { $("*:focus").siblings('input').click(); } $('a').click(function(e){ if(typeof $(this).attr('href') != 'undefined' && $(this).attr('href').match(/(gap_comparison)/)) { e.preventDefault(); window.open($(this).attr('href'), 'newin', 'width=690, height=725, scrollbars=1'); } }); if($('.email-sent').length > 0) $('.email-sent').stop().delay(5000).fadeOut('slow'); $('.loader').click(function(){ if($(this).hasClass('loader')) { $('#loadbox').removeClass('hide').attr('aria-hidden', 'false'); } }); });