function showMyMapsSlider(pDivElement, pNumMapID, pObjScale)
{
    // Verify if the user is logged in. If so, perform the download. Otherwise, prompt for login.
    if (!boolLoggedIn)
    {
        if (boolFirstLogin)
            doLoginMyMaps();
        else
            document.getElementById('mmdivLoginErrorMsg').style.display = "";
    }
}

function doLoginMyMaps()
{
    var strUrl = "./jsp/showLoginForm.jsp";
    var strUrlParams = "action=mm&lang=" + strLang;

    // Create a new XML HTTP object for AJAX operation.
    var oTempXmlHttp = getNewXmlHTTPObject();

    // Process the AJAX request.
    if (!isXmlHTTPNull(oTempXmlHttp))
    {
        logMsg("Processing login. url: " + encodeURIComponent(strUrl + "?" + strUrlParams), "info", "sliderDownload.js (doLoginDownload)");
        doXMLRequest(oTempXmlHttp, strUrl, strUrlParams, "post", false, "application/x-www-form-urlencoded");
    }

    document.getElementById("divMyMapsHierarchy").innerHTML = oTempXmlHttp.responseText;

    if (!boolFirstLogin)
        document.getElementById("divMMLoginErrorMsg").style.display = "";
}

// Show the My Maps hierarchy.
function getMyMapsHierarchy(pNumMapID, pObjDiv)
{
    // Verify if the user is logged in and a valid object is passed in.
    if ((!boolLoggedIn) || (pObjDiv == null) || (pObjDiv == undefined))
        return;

    var strUrl = "./jsp/showSliderMyMapsHierarchy.jsp";
    var strUrlParams = "mapID=" + pNumMapID + "&lang=" + strLang;

    // Create a new XML HTTP object for AJAX operation.
    var oTempXmlHttp = getNewXmlHTTPObject();

    // Process the AJAX request.
    if (!isXmlHTTPNull(oTempXmlHttp))
    {
        logMsg("Retrieving custom views hierarchy. url: " + encodeURIComponent(strUrl + "?" + strUrlParams), "info", "sliderMyMapsHierarchy.js (getMyMapsHierarchy)");
        doXMLRequest(oTempXmlHttp, strUrl, strUrlParams, "post", false, "application/x-www-form-urlencoded");
    }

    // Show the hierarchy in the div.
    pObjDiv.innerHTML = oTempXmlHttp.responseText;

    oTempXmlHttp = null;
}

function doMyMapAction(pNumMapID, pStrRole, pStrUserID, pStrAction)
{
    // If no map ID is specified, set the ID to "blank".
    if (pNumMapID == null)
        pNumMapID = "";

    // Check to see if a "delete" action has been specified.
    if (pStrAction.trim().toUpperCase() == "DELETE")
    {
        if (!confirm(strMyMapConfirmDelete))
            return;

        var strUrl = "./jsp/processMyMaps.jsp";
        var strUrlParams = "action=delete&mapID=" + pNumMapID + "&lang=" + strLang;

        // Create a new XML HTTP object for AJAX operation.
        var oTempXmlHttp = getNewXmlHTTPObject();

        // Process the AJAX request.
        if (!isXmlHTTPNull(oTempXmlHttp))
        {
            logMsg("Deleting custom map. url: " + encodeURIComponent(strUrl + "?" + strUrlParams), "info", "sliderMyMapsHierarchy.js (doMyMapAction)");
            doXMLRequest(oTempXmlHttp, strUrl, strUrlParams, "post", false, "application/x-www-form-urlencoded");
            logMsg("*** result: " + encodeURI(oTempXmlHttp.responseText), "info", "sliderMyMapsHierarchy.js (doMyMapAction)");
        }

        // Get the response from the request.
        var strResult = oTempXmlHttp.responseText;

        oTempXmlHttp = null;

        if (strResult == 1)
        {
            // If the user is removing the selected "My Map", then reset to the default map.
            if (pNumMapID == numMapID)
            {
                // Change to the default view.
                changeMap(numDefaultMapID);

                // Reset the map hierarchy list.
                getHierarchy(numDefaultMapID, document.getElementById("divMapHierarchy"));
            }

            // Refresh the "My Maps" hierarchy list.
            getMyMapsHierarchy(numDefaultMapID, document.getElementById("divMyMapsHierarchy"));
        }
    }
    else
    {
        logMsg("Loading custom map authoring tool...", "info", "sliderMyMapsHierarchy.js (doMyMapAction)");

        doPostForm("frmMapAuthor", "_self", strMapAuthorUrl, ["mapID$" + pNumMapID, "role$" + pStrRole, "lang$" + strLang])

        boolLoadMapAuthor = true;
    }
}
