function copyText(text) {
        if (window.clipboardData) { // Internet Explorer
                window.clipboardData.setData("Text", ""+ text); // stupid IE... won't work without the ""+ ?!?!?
        } else if (window.netscape) { // Mozilla
                try {
                        netscape.security.PrivilegeManager.enablePrivilege('UniversalXPConnect');

                        var gClipboardHelper = Components.classes["@mozilla.org/widget/clipboardhelper;1"].getService(Components.interfaces.nsIClipboardHelper);

                        gClipboardHelper.copyString(text);
                } catch(e) {
                        return alert(e +'\n\nPlease type: "about:config" in your address bar.\nThen filter by "signed".\nChange the value of "signed.applets.codebase_principal_support" to true.\nYou should then be able to use this feature.');
                }
        } else {
                return alert("Your browser does not support this feature");
        }
}
