We have a custom XOOPS module that enables our clients to edit pages on their site. Pages are divided into categories. To edit a page a standard TinyMCE editor is used in simple mode. We want to add the possibility to turn text into links using a link button and a popup-window. These links can either be to external websites, where the link needs to have a target="_blank". Or they can be to an internal category/page contained in the database who need to be openend in the same window. Users must be able to browse to such a page and select it in the pop-up. Full cross-browser compatibility is a must. Code generated must be well documented using phpDoc.