function navigate(pUrl)
{
    window.location = pUrl;
}

function submitForm(pFormName)
{
    var form = document.forms[pFormName];
    if (form == null)
        return false;
    var pLoading = id(pFormName + "_loading");
    if (pLoading != null)
    {
        pLoading.style.display = "";
    }
    var pButton = id(pFormName + "_button");
    if (pButton != null)
    {
        pButton.style.display = "none";
    }
    var onsubmit = form.onsubmit;
    if (onsubmit != null)
    {
        if (onsubmit())
            return false;
    }
    form.submit();
    return false;
}

function promptSubmitForm(pFormName, pMessage)
{
    if (confirm(pMessage))
    {
        return submitForm(pFormName);
    }
    return false;
}

function openPopup(pUrl, pName, pFlags)
{
    var newWindow = window.open(pUrl, pName, pFlags);
    if (newWindow == null)
    {
        alert("Unable to open window - window blocked by popup blocker\n\nIf you are using Internet Explorer, please click Tools -> Pop-up Blocker -> Always Allow Pop-Ups from This Site");
    }
    else
    {
        newWindow.focus();
    }
}
