 // addOnloadEvent function that aloows for convenient
    // addition of multiple fuctions that are all supposed to be triggered
    // on window.onload event.
    // takes function name as the argument. e.g. addOnLoadEvent(doPopups);
    // addOnLoadEvent(function() { myFunctionName('myArgument') });
    function addOnLoadEvent(fnc) {
        if (typeof window.addEventListener != "undefined")
            window.addEventListener("load", fnc, false);
        else if (typeof window.attachEvent != "undefined") {
            window.attachEvent("onload", fnc);
        }
        else {
            if (window.onload != null) {
                var oldOnload = window.onload;
                window.onload = function(e) {
                    oldOnload(e);
                    window[fnc]();
                };
            }
            else
                window.onload = fnc;
        }
    } 
