var isW3C = (document.getElementById) ? true : false
var isAll = (document.all) ? true : false

/** 
 * Responsible for confirming the existence of an object
 * which is passed in by name.
 *
 * For example, a span area is defined in the HTML with 
 * an id of optionsEquipCost.  To confirm its existence, do:
 *
 *     if (objectExists('optionsEquipCost')) { // do work }
 *
 * This must be called AFTER the declaration of the object
 * in the HTML (or after the HTML has loaded).  Otherwise,
 * the return value may be false.
 */
function objectExists(elemID) {
    var elem = (isW3C) ? document.getElementById(elemID) : ((isAll) ? document.all[elemID] : null);
    if (elem) {
        return true;
    } else {
        return false;
    }
}

/** 
 * Responsible for confirming the existence of a function
 * which is passed in by name.
 *
 * For example, a function is defined in the HTML with 
 * the name of doPersonalInfoOnLoad().
 * To confirm its existence, do:
 *
 *     if (functionExists('doPersonalInfoOnLoad')) { // do work }
 */
function functionExists(elemID) {
    return (typeof(window[elemID])!='undefined');
}