function openPopup( aUrl, aWidth, aHeight )
{
    if( !aUrl ) return false;
    if(top && typeof(top.Page) != "undefined")
    {
        if( aUrl.match( /[\&\?]page=/ ) )
        {
            aUrl = aUrl.replace( /([\&\?]page=)[^\&]*/, "$1"+top.Page );
        }
        else
        {
            aUrl += ( aUrl.indexOf("?")==-1 ? "?" : "&" ) +"page="+top.Page;
        }
    }
    if(!aWidth) aWidth=575;
    if(!aHeight) aHeight=450;
    window.open(aUrl, "",
        "location=no,menubar=no,width="+aWidth+",height="+aHeight+",status=no,scrollbars=yes,resizable=yes");
    return false;
}

function updateTopbar( )
{
    if(!top.topbar) return;
    var doc = top.topbar.document;
    if(!doc) return;

    try
    {
        if(top.Page==0)
        {
            doc.getElementById('delete_enabled').style.display = 'none';
            doc.getElementById('delete_disabled').style.display = '';
        }
        else
        {
            doc.getElementById('delete_enabled').style.display = '';
            doc.getElementById('delete_disabled').style.display = 'none';
        }
    }
    catch(ex) { }
}
