refactored ajaxbox for generic dialog usage