I think it could be done with a plugin and I know it could be done with a skin modification and a plugin. If you modified the skin you could change the attachment box command to a custom plugin command, otherwise you may have to use the render_page hook or maybe the JS before* hook.