docs/autodocs/source/aibs_sphinx/static/external_assets/javascript/portal.js
/*
 * Checks to ensure global javascript vars _pImagePath, _pMoreProjectsId, _pTabId are defined,
 * then uses _pTabId to select the designated project tab.
 *
 * This function needs to be called directly from the host HTML page, in response to a JavaScript "onload"
 * event.
 *
 * Valid values of _pTabId are:
 *   pHome, pMouseBrain, pMouseSpinalCord, pDevelopingMouseBrain, pHumanBrain, pMoreProjects, pSleep, etc.
 */
Checks to ensure global javascript vars _pImagePath, _pMoreProjectsId, _pTabId are defined,
then uses _pTabId to select the designated project tab.

This function needs to be called directly from the host HTML page, in response to a JavaScript "onload"
event.


Checks to ensure global javascript vars _pImagePath _pMoreProjectsId _pTabId are defined then uses _pTabId to select the designated project tab . This function needs to be called directly from the host HTML page in response to a JavaScript " onload " event .
function _pPortalOnLoad() {
    var error;
    var theTab;
    try {
        if (_pImagePath) {
            if (_pImagePath.charAt(_pImagePath.length - 1) != "/") {
                throw "noSlash";
            }
        }
        else if (_pImagePath == undefined) {
            throw "undefined";
        }
        else if (_pImagePath == "") {
            throw "emptyString";
        }
    }
    catch (error) {
        if (error == "noSlash") {
            alert("Javascript var _pImagePath needs to be terminated with a '/'");
        }
        else if (error == "emptyString") {
            alert("Javascript var _pImagePath is an empty String");
        }
        else {
            alert("Javascript var _pImagePath is undeclared or undefined");
        }
        return;
    }
    try {
        if (_pMoreProjectsId) {
        }
        else if (_pMoreProjectsId == undefined) {
            throw "undefined";
        }
        else if (_pMoreProjectsId == "") {
            throw "emptyString";
        }
    }
    catch (error) {
        if (error == "emptyString") {
            alert("Javascript var _pMoreProjectsId is an empty String");
        }
        else {
            alert("Javascript var _pMoreProjectsId is undeclared or undefined");
        }
        return;
    }
    try {
        if (_pTabId) {
            var tabName = _pTabNames[_pTabId];
            theTab = _pSetSelectedTab(_pTabId, "pTabSelected", tabName);
            if (theTab == null) {
                throw "null";
            }
        }
        else if (_pTabId == undefined) {
            throw "undefined";
        }
        else if (_pTabId == "") {
            throw "emptyString";
        }
    }
    catch (error) {
        if (error == "null") {
            alert("Element for menu item _pTabId = " + _pTabId + " was not found in the DOM");
        }
        else if (error == "emptyString") {
            alert("Javascript var _pTabId is an empty String");
        }
        else {
            alert("_pTabId is undeclared or undefined");
        }
        return;
    }
}
function _pPortalOnLoad ( ) { var error ; var theTab ; try { if ( _pImagePath ) { if ( _pImagePath . charAt ( _pImagePath . length - 1 ) != "/" ) { throw "noSlash" ; } } else if ( _pImagePath == undefined ) { throw "undefined" ; } else if ( _pImagePath == "" ) { throw "emptyString" ; } } catch ( error ) { if ( error == "noSlash" ) { alert ( "Javascript var _pImagePath needs to be terminated with a '/'" ) ; } else if ( error == "emptyString" ) { alert ( "Javascript var _pImagePath is an empty String" ) ; } else { alert ( "Javascript var _pImagePath is undeclared or undefined" ) ; } return ; } try { if ( _pMoreProjectsId ) { } else if ( _pMoreProjectsId == undefined ) { throw "undefined" ; } else if ( _pMoreProjectsId == "" ) { throw "emptyString" ; } } catch ( error ) { if ( error == "emptyString" ) { alert ( "Javascript var _pMoreProjectsId is an empty String" ) ; } else { alert ( "Javascript var _pMoreProjectsId is undeclared or undefined" ) ; } return ; } try { if ( _pTabId ) { var tabName = _pTabNames [ _pTabId ] ; theTab = _pSetSelectedTab ( _pTabId , "pTabSelected" , tabName ) ; if ( theTab == null ) { throw "null" ; } } else if ( _pTabId == undefined ) { throw "undefined" ; } else if ( _pTabId == "" ) { throw "emptyString" ; } } catch ( error ) { if ( error == "null" ) { alert ( "Element for menu item _pTabId = " + _pTabId + " was not found in the DOM" ) ; } else if ( error == "emptyString" ) { alert ( "Javascript var _pTabId is an empty String" ) ; } else { alert ( "_pTabId is undeclared or undefined" ) ; } return ; } }
Checks to ensure global javascript vars _pImagePath, _pMoreProjectsId, _pTabId are defined,
 then uses _pTabId to select the designated project tab.
Checks to ensure global javascript vars _pImagePath _pMoreProjectsId _pTabId are defined then uses _pTabId to select the designated project tab .
// ***** use javascript vars defined on main HTML page: _pTabId, _pMoreProjectsId, _pImagePath ******** // ***** Note: pImagePath must end in a "/" ******** // validate _pImagePath // validate _pMoreProjectsId // do nothing, it has a value // validate _pMoreProjectsId