/* Cross-browser wrapper for console logging: benalman.com/projects/javascript-debug-console-log */ window.debug=(function(){var i=this,b=Array.prototype.slice,d=i.console,h={},f,g,m=9,c=["error","warn","info","debug","log"],l="assert clear count dir dirxml exception group groupCollapsed groupEnd profile profileEnd table time timeEnd trace".split(" "),j=l.length,a=[];while(--j>=0){(function(n){h[n]=function(){m!==0&&d&&d[n]&&d[n].apply(d,arguments)}})(l[j])}j=c.length;while(--j>=0){(function(n,o){h[o]=function(){var q=b.call(arguments),p=[o].concat(q);a.push(p);e(p);if(!d||!k(n)){return}d.firebug?d[o].apply(i,q):d[o]?d[o](q):d.log(q)}})(j,c[j])}function e(n){if(f&&(g||!d||!d.log)){f.apply(i,n)}}h.setLevel=function(n){m=typeof n==="number"?n:9};function k(n){return m>0?m>n:c.length+m<=n}h.setCallback=function(){var o=b.call(arguments),n=a.length,p=n;f=o.shift()||null;g=typeof o[0]==="boolean"?o.shift():false;p-=typeof o[0]==="number"?o.shift():n;while(p= 0; }; // jQuery Cookie plugin July 08, 2011: https://github.com/carhartl/jquery-cookie jQuery.cookie=function(a,b,c){if(arguments.length>1&&String(b)!=="[object Object]"){c=jQuery.extend({},c);if(b===null||b===undefined){c.expires=-1}if(typeof c.expires==="number"){var d=c.expires,e=c.expires=new Date;e.setDate(e.getDate()+d)}b=String(b);return document.cookie=[encodeURIComponent(a),"=",c.raw?b:encodeURIComponent(b),c.expires?"; expires="+c.expires.toUTCString():"",c.path?"; path="+c.path:"",c.domain?"; domain="+c.domain:"",c.secure?"; secure":""].join("")}c=b||{};var f,g=c.raw?function(a){return a}:decodeURIComponent;return(f=(new RegExp("(?:^|; )"+encodeURIComponent(a)+"=([^;]*)")).exec(document.cookie))?g(f[1]):null} } /* |-------------------------------------------------------------------------- | ExpertPlan Global Object |-------------------------------------------------------------------------- */ /** * The EP global namespace object. If EP is already defined, the * existing EP object will not be overwritten so that defined * namespaces are preserved. */ if (typeof EP == "undefined" || !EP) { var EP = {}; } /** * Returns the namespace specified and creates it if it doesn't exist * * @method namespace * @static * @param {String*} arguments 1-n namespaces to create * @return {Object} A reference to the last namespace object created */ EP.namespace = function() { var a = arguments, o = null, i, j, d; for (i = 0; i < a.length; i = i + 1) { d = ("" + a[i]).split("."); o = EP; // EP is implied, so it is ignored if it is included for (j = (d[0] == "EP") ? 1 : 0; j < d.length; j = j + 1) { o[d[j]] = o[d[j]] || {}; o = o[d[j]]; } } return o; }; /* |-------------------------------------------------------------------------- | ExpertPlan Dialog Widget Module |-------------------------------------------------------------------------- */ EP.namespace("widget.dialog"); EP.widget.dialog = (function (parent, $) { return { init: function() { // If the current page is inside an iframe if ( window != window.top ) { try { debug.info('The current page is in an iframe...'); // will throw an error if on a different domain var isSameDomain = ( window.parent.location.href.indexOf(window.location.hostname) !== -1 ) ? true : false, isModalPage = false; // Check if the current window is contained with iframe[name='modal-frame'] for ( var i = 0, max = window.parent.frames.length; i < max; i++ ) { if ( window.parent.frames[i].name == 'modal-frame' ) { isModalPage = (window.parent.frames[i].window == window); break; } } debug.info('Same domain? ' + isSameDomain + ', Is modal page? ' + isModalPage); // Handle session timeout in modal dialog by redirecting the parent to the location of the current window if ( isSameDomain && isModalPage) { // Don't persist the notify bar across pages inside the dialog if ( $('div.notify-bar', window.parent.document).is(':visible') ) { $('div.notify-bar', window.parent.document).fadeOut(); } // Dialog pages are rendered in standards mode, while the old pages // were written in quirks mode. If the current page is rendered in quirks // mode and is inside an iframe, reload it in the parent window if ( window.document.compatMode !== 'CSS1Compat' ) { debug.info("The page inside the iframe is " + window.document.compatMode); // Do not show the content of the page within the modal dialog if ( window.parent.$('#modal-dialog', window.parent.document).length ) { window.parent.$('#modal-dialog', window.parent.document).dialog('close'); } $('body').hide(); window.parent.location.href = window.location.href; } // Abort modal dialog initialization return; } } catch (e) { debug.warn( e ); } } // ------------------------------------------------------------------------- // Markup for the modal dialog, loader animation, and notification bar var html = [ '', '', '
', '
  
' ]; // Append the markup into the $('body').append( html.join('') ); // FIX: Notification bars don't appear in correct locations b/c position: fixed does not work in IE quirks mode if ( $.browser.msie ) { $('div.notify-bar').css({position: 'absolute'}); } // Cache selectors var $dialog = $('#modal-dialog'), $frame = $('#modal-frame'), $loader = $('#modal-loader'), dialogOpts = { autoOpen : false, modal : true, dialogClass : 'reset-dialog', width : ( $.browser.msie) ? 870 + 26 : 870, // IE quirks mode fix height : ( $.browser.msie) ? 620 + 150 : 620, // IE quirks mode fix draggable : false, resizable : false, open : function(event, ui) { $loader.hide(); //$(this).parent().css({position: 'fixed'}); }, close : function(event, ui) { // When the dialog is closed, ensure that when it is reopened it reverts to the default size $(this).dialog('option', 'width', ( $.browser.msie ) ? 870 + 26 : 870); $(this).dialog('option', 'position', 'center'); } }; // Set dialog options $dialog.dialog(dialogOpts); // Events $('body').delegate('a.open-modal', 'click', load); $('body').delegate('a.trigger-modal', 'modal:open', load); $('body').delegate('a.close-modal', 'click modal:close', close); // In IE8 the loading animation does not disappear due to faulty resize event if ( ! $.browser.msie && $.browser.version !== '8.0' ) { // when the window is resized, reposition the loader animation $(window).bind('resize', function () { // only reposition if the dialog is not open and the loader is active if ( ! $dialog.dialog('isOpen') && $loader.length && $loader.is(":visible") ) { centerLoader(); } }); } // Ensure that the dialog is always visible even when the window is too small $(window).bind('load resize', checkVisible); // Modal Dialog Spinner Animation $('body').delegate('#modal-loader', 'load', hideLoader); // ----------------------------------------------------------------------- // Notification Bar $('body').delegate('div.notify-bar:not(.persist)', 'click', function () { if ( $(this).data().timeout ) { clearTimeout( $(this).data().timeout ); } $(this).fadeOut(); }); $('body').delegate('div.bar-bottom input', 'click', function () { $(this).closest('div.notify-bar').slideToggle(function () { $(this).remove(); }); }); // ------------------------------------------------------------------------- function load(e, params) { e.preventDefault(); // Show the loader animation showLoader(); var path = ''; if ( params && params.url) { path = params.url; } else { path = this.href.substr( this.href.lastIndexOf('/') + 1 ); } debug.info('Loading ' + path + ' in modal dialog...'); // Load the href of the clicked link in the modal dialog's iframe $frame.attr( 'src', path ); // Open the dialog $frame.load(open); } function open() { hideLoader(); //$dialog.parent().css({position: 'fixed'}).end().dialog('open'); $dialog.dialog('open'); checkVisible(); } function close(e, params) { e.preventDefault(); // Close the notify bar if ( $('div.notify-bar', window.document).is(':visible') ) { $('div.notify-bar', window.document).fadeOut(); } $dialog.dialog('close'); // reset the dialog options $dialog.dialog(dialogOpts); if ( params && params.redirect) { window.location.href = params.redirect; } } function showLoader() { if ( ! $dialog.dialog('isOpen') ) { // Position the loader in the absolute center of the window centerLoader(); // Show the loader $loader.appendTo('body').fadeIn('slow'); // fallback -- automatically hide loader after 60 sec setTimeout(function () { $loader.hide(); }, 60000); } } function centerLoader() { // CSS measurements will be faster because you have to wait for the // image to be downloaded first before obtaining the dimensions with // .width() and .height() var width = $loader.css('width').replace(/[^-\d\.]/g, ''), height = $loader.css('height').replace(/[^-\d\.]/g, ''), xPos = ( $(window).width() / 2 ) - (width / 2), yPos = ( $(window).height() / 2 ) - (height / 2); $loader .css({ top : yPos + 'px', left : xPos + 'px' }); } function hideLoader() { $loader.hide(); } function checkVisible(e) { if ( $dialog.dialog( 'isOpen' ) ) { if ( $(window).width() < $dialog.data('dialog').options.width ) { // If the window is too small, we reposition the offset to 0 because it gets cut offon the left side... BUG? $dialog.closest('div.ui-dialog').offset({left: 0}); } else { $dialog.dialog('option', 'position', 'center'); } // Ensure the modal dialog is not cut off vertically if ( ! $.browser.msie && parseInt( $dialog.parent().css('top'), 10 ) < 0 ) { $dialog.parent().css('top', 0); } } } }, print: function () { window.print(); }, placeholder: function () {} }; }(EP.widget.dialog || {}, jQuery)); //------------------------------------------------------------------------------------------------ /* |-------------------------------------------------------------------------- | ExpertPlan Utility Module |-------------------------------------------------------------------------- */ EP.namespace("util"); EP.util = (function (u, $) { // Query string parameters u.params = u.params || {}; (function () { var e, a = /\+/g, r = /([^&;=]+)=?([^&;]*)/g, d = function (s) { return decodeURIComponent(s.replace(a, " ")); }, q = window.location.search.substring(1); while (e = r.exec(q)) u.params[d(e[1])] = d(e[2]); })(); // Browser detection: quirksmode.org/js/detect.html u.BrowserDetect=u.BrowserDetect||{};u.BrowserDetect={init:function(){this.browser=this.searchString(this.dataBrowser)||"An unknown browser";this.version=this.searchVersion(navigator.userAgent)||this.searchVersion(navigator.appVersion)||"an unknown version";this.OS=this.searchString(this.dataOS)||"an unknown OS"},searchString:function(d){for(var a=0;a Contribution Processing) if ( $('a.open-modal[href="payroll_groups.mvc"]').length ) { $('a[href="payroll0.jsp"]') .addClass('open-modal') .attr('href', 'payroll_groups.mvc'); } if ( $('a:contains(Administer a Plan)').length > 0 && $('a:contains(Vesting Maintenance)').length > 0) { var tpaVesting = { init: function () { $('body').delegate('a[href^="tpavestingupload.jsp"]', 'click', tpaVesting.handler); }, handler: function (e) { e.preventDefault(); var $t = $(this), cache = $(this).data().cache; if ( cache === undefined ) { $.ajax( $(this).attr('href'), { cache: false, dataType: 'json', success : function (data) { tpaVesting.doAction(data, $t); } }); } else { debug.info( 'Loading from cache... ' + $t.data().cache ); tpaVesting.doAction(cache, $t); } }, doAction: function (data, $t) { if ( data.modal === true ) { $t .addClass('trigger-modal') .trigger('modal:open', {url: data.url}); // Cache the response for subsequent clicks if ( $t.data().cache === undefined ) { $t.data('cache', data); } } else { location.href = data.forwardUrl; } } }; tpaVesting.init(); } // Notification Bar - Open link in modal dialog $('a.modal-link').live('click', function (e) { e.preventDefault(); window.document.getElementById("modal-frame").src = $(this).attr('href'); }); //Filter asterik if ETF symbol present $('table.datagrid').find('img[src$="etf.gif"] + span').remove(); }); // Assets loaded $(window).bind("load", function () { }); })(jQuery);