function openWindow(value, target)
{
    window.open(value, target, 
        "outerHeight=750,outerWidth=700,scrollbars=1,resizable=1");
}


function gotoMenuLocation(aSelectList)
{
    var value = aSelectList.options[aSelectList.selectedIndex].value;
    if (value == "")
    {
        aSelectList.selectedIndex = 0;
        return;
    }

    // If there are matching braces, use the text in between as the text of
    // a confirmation dialog.
    if (value.charAt(0) == '{' && value.length > 1)
    {
        var index = value.indexOf("}", 1);
        if (index != -1)
        {
            var message = value.substring(1, index);
            value = value.substring(index + 1);
            if (!confirm(message))
            {
                aSelectList.selectedIndex = 0;
                return;
            }
        }
    }

    // If the rest of the value starts with an at-sign, use the text
    // between that an a following at-sign as the window target.
    if (value.charAt(0) == '@' && value.length > 3)
    {
        var index = value.indexOf("@", 1);
        if (index != -1)
        {
            var target = value.substring(1, index);
            value = value.substring(index + 1);
            aSelectList.selectedIndex = 0;
            openWindow(value, target)
        }
        else
        {
            aSelectList.selectedIndex = 0;
            window.location.href = value;
        }
    }
    else
    {    
        aSelectList.selectedIndex = 0;
        window.location.href = value;
    }
}


function setCloseTimer(aTimeoutSeconds)
{
    if (aTimeoutSeconds > 0)
      setTimeout("window.close()", aTimeoutSeconds * 1000);
}


function setRedirectTimer(aTimeoutSeconds, aRedirectUrl)
{
    if (aTimeoutSeconds > 0 && aRedirectUrl)
    {
        timer = setTimeout("window.location.href='" + aRedirectUrl + "'",
            aTimeoutSeconds * 1000);
    }
}





