function UBBEditor () {
¡@¡@var textArea;
¡@¡@this.setTextArea = function (textarea) {
¡@¡@ textArea = textarea;
¡@¡@}
¡@¡@this.insertImageLabel = function () {
¡@¡@ var p = showImageSelector();
¡@¡@ if (p!=null) {
¡@¡@ this.setLabel("IMAGE", null, null, [["?±µ", "SRC", p]]);
¡@¡@ }
¡@¡@}
¡@¡@function showImageSelector () {
¡@¡@ var r = window.showModalDialog("fmsSelectFrame.jsp"); 
¡@¡@ if(r!=null) {
¡@¡@ return r;
¡@¡@ } else {
¡@¡@ return "";
¡@¡@ }
¡@¡@}
¡@¡@this.setLabel = function (labelHead, labelEnd, text, attributes) {
¡@¡@ var ra = null;
¡@¡@ if (document.selection && document.selection.type.toUpperCase()=="TEXT") {
¡@¡@ ra = document.selection.createRange();
¡@¡@ }
¡@¡@ var sAtts = "";
¡@¡@ if (attributes+""!="undefined") {
¡@¡@ for (var i=0; i<attributes.length; i++) {
¡@¡@ var at = attributes[i];
¡@¡@ var promptText = at[0] + "";
¡@¡@ var key = at[1] + "";
¡@¡@ var value = at[2] + "";
¡@¡@ if (value=="undefined") {
¡@¡@ value = prompt(promptText, "") + "";
¡@¡@ if (value=="undefined") {
¡@¡@ value = "";
¡@¡@ }
¡@¡@ }
¡@¡@ if (attributes.length==1) {
¡@¡@ sAtts = "=" + value + "";
¡@¡@ } else {
¡@¡@ sAtts += " " + key + "=" + value + "";
¡@¡@ }
¡@¡@ }
¡@¡@ }
¡@¡@ if (ra!=null) {
¡@¡@ if (text==null && text+""!="undefined") {
¡@¡@ text = ra.text;
¡@¡@ }
¡@¡@ var finalText = "[" + labelHead + sAtts + "]" + text;
¡@¡@ if (labelEnd!=null) {
¡@¡@ finalText += "[/" + labelEnd + "]";
¡@¡@ }
¡@¡@ ra.text = finalText;
¡@¡@ } else {
¡@¡@ if (text==null && text+""!="undefined") {
¡@¡@ text = textArea.innerHTML;
¡@¡@ }
¡@¡@ var finalText = "[" + labelHead + sAtts + "]" + text;
¡@¡@ if (labelEnd!=null) {
¡@¡@ finalText += "[/" + labelEnd + "]";
¡@¡@ }
¡@¡@ textArea.innerHTML = finalText;
¡@¡@ }
¡@¡@}
¡@¡@}
