popup = {
    defaultwidth : 917,
    defaultheight: 738,
    popwin : null,
    
    open : function(aObj, w, h)
    {

        if (typeof(aObj) == 'undefined')
            return false;

        if (typeof(w) != 'undefined' && typeof(h) != 'undefined')
        {

            var my = screen.height - 35;   // Assume some sort of taskbar
            var mx = screen.width;
            
            if (w > mx)
                w = mx;
            if (h > my)
                h = my;
        }
        else
        {
            w = this.defaultwidth;
            h = this.defaultheight;
        }
        
        this.popwin = open(aObj.href, 'folder', 'width=' + w + ',height=' + h + ',status=no,resizable=yes,scrollbars=yes,toolbar=no,menubar=no,location=no');
        return false;
    },
    
    redirect : function(aObj)
    {
       
        if (typeof(aObj) == 'undefined')
            return false;
            
        if (opener.closed)
            return true;    // Lost my parent :(

        opener.location.href = aObj.href;
        close();
        
        return false;
    }
}

