$j.jQRTE = {
    iconList: ["popup_html", "popup_bgcolor", "popup_forecolor", "bold", "italic", "underline", "justifyleft", "justifycenter", "justifyright", "justifyfull", "insertHorizontalRule", "insertorderedlist", "insertunorderedlist", "indent", "outdent", "popup_addlink", "unlink", "removeformat", "strikethrough", "superscript", "subscript", "popup_addtable", "popup_uploadfile", "popup_addimage", "popup_uploadimage", "popup_emotion", "popup_character", "popup_copyright"],
    rangeObj: null,
    element: null,
    selectionObj: null,
    boxy: {},
    backcolor: "#ffffff",
    forecolor: "#000000",
    backcolorList: {},
    forecolorList: {},
    init: function(element) {
        document.getElementById(element).contentWindow.document.designMode = "on";
        document.getElementById(element).contentWindow.document.contentEditable = true;
        $j(document.getElementById(element).contentWindow.document).keyup(function(e) {
            $j.jQRTE.saveRange(element);

            var box = element.split("_");
            var textid = "";
            for (var i = 0; i < box.length - 1; i++) {
                textid += "_" + box[i]
                }
            textid = textid.substr(1);
            checkTextAreaLen(document.getElementById(textid));
            });
        $j(document.getElementById(element).contentWindow.document).click(function(e) {
            $j.jQRTE.saveRange(element)
            });
        $j(document.getElementById(element).contentWindow.document).focus(function(e) {
            $j.jQRTE.saveRange(element)
            })
        },
    saveRange: function(element) {
        var iframe = document.getElementById(element);
        var doc = document.getElementById(element).contentDocument || document.getElementById(element).contentWindow.document;
        var selection = doc.selection || iframe.contentWindow.document.body;
        var range = selection.createRange ? selection.createRange() : selection.getRangeAt;
        var box = element.split("_");
        var textid = "";
        for (var i = 0; i < box.length - 1; i++) {
            textid += "_" + box[i]
            }
        textid = textid.substr(1);
        if (iframe.contentWindow.document.body != null)
           $j("#" + textid).text(document.getElementById(element).contentWindow.document.body.innerHTML);
        $j.jQRTE.rangeObj = range;
        $j.jQRTE.selectionObj = selection
    },
    restoreRange: function(element) {
        document.getElementById(element).contentWindow.focus();
        if (navigator.userAgent.indexOf("Firefox") != -1) {
            if ($j.jQRTE.rangeObj) {
                $j.jQRTE.selectionObj.removeAllRanges();
                $j.jQRTE.selectionObj.addRange($j.jQRTE.rangeObj)
            }
        } else {
            if ($j.jQRTE.rangeObj) {
                $j.jQRTE.rangeObj.select()
                document.getElementById(element).contentWindow.focus();
            }
        }
    },
    setIconNotLoggedIn: function(element) {
        for (var i = 0; i < $j.jQRTE.iconList.length; i++) {
            var checkpopup = ($j.jQRTE.iconList[i]).substr(0, 5);
            if (checkpopup == "popup") {
                var fn;
                var id = ($j.jQRTE.iconList[i]).substr(6);
                if (id == "bgcolor" || id == "forecolor") {
                    fn = "handle_color"
                } else {
                    fn = "handle_" + id
                }
                $j("#" + element + "_" + ($j.jQRTE.iconList[i]).substr(6)).html('<span id="' + element + "_" + $j.jQRTE.iconList[i].substr(6) + "_btn" + '" style="background-position: ' + ( - 18) * (i) + 'px 0px;" class="icons"></span>')
            } else {
                $j("#" + element + "_" + $j.jQRTE.iconList[i]).html('<span id="' + element + "_" + $j.jQRTE.iconList[i] + '_btn" style="background-position: ' + ( - 18) * (i) + 'px 0px;" class="icons"></span>')
            }
        }
    },
    setIcon: function(element) {
        for (var i = 0; i < $j.jQRTE.iconList.length; i++) {
            var checkpopup = ($j.jQRTE.iconList[i]).substr(0, 5);
            if (checkpopup == "popup") {
                var fn;
                var id = ($j.jQRTE.iconList[i]).substr(6);
                if (id == "bgcolor" || id == "forecolor") {
                    fn = "handle_color"
                } else {
                    fn = "handle_" + id
                }
                $j("#" + element + "_" + ($j.jQRTE.iconList[i]).substr(6)).html('<span id="' + element + "_" + $j.jQRTE.iconList[i].substr(6) + "_btn\" onclick='$j.jQRTE.jqp_c();$j.jQRTE." + fn + '("' + id + '","' + element + '");\' style="background-position: ' + ( - 18) * (i) + 'px 0px;" class="icons"></span>')
                } else {
                $j("#" + element + "_" + $j.jQRTE.iconList[i]).html('<span id="' + element + "_" + $j.jQRTE.iconList[i] + '_btn" onclick=\'$j.jQRTE.setCommand("' + $j.jQRTE.iconList[i] + '",null,"' + element + '");\' style="background-position: ' + ( - 18) * (i) + 'px 0px;" class="icons"></span>')
                }
        }
        $j("#" + element + "_fontsize").change(function() {
            $j.jQRTE.setCommand("fontsize", this.value, element);
            $j(this).val("")
            });
        $j("#" + element + "_fontname").change(function() {
            $j.jQRTE.setCommand("fontname", this.value, element);
            $j(this).val("")
            });
        $j("#" + element + "_formatblock").change(function() {
            $j.jQRTE.setCommand("formatblock", this.value, element);
            $j(this).val("")
            })
        },
    setContent: function(element) {
        var rid = element.split("_");
        var textid = "";
        for (var i = 0; i < rid.length - 1; i++) {
            textid += "_" + rid[i]
            }
        textid = textid.substr(1);
        var content = $j("#" + textid).text();
        if (content != "") {
            document.getElementById(element).contentWindow.document.open();
            document.getElementById(element).contentWindow.document.write(content);
            document.getElementById(element).contentWindow.document.close()
            }
    },
    setCommand: function(id, value, element) {
        $j.jQRTE.restoreRange(element);
        document.getElementById(element).contentWindow.document.execCommand(id, false, value);
        $j.jQRTE.restoreRange(element);
        var box = element.split("_");
        var textid = "";
        for (var i = 0; i < box.length - 1; i++) {
            textid += "_" + box[i]
            }
        textid = textid.substr(1);
        $j("#" + textid).text(document.getElementById(element).contentWindow.document.body.innerHTML)
        },
    jqp_o: function(id, element, btn_id) {
        $j.jQRTE.boxy[id] = id;
        $j("#" + id).jqpopup_open(element + "_" + btn_id + "_btn");
        $j.jQRTE.element = element
    },
    jqp_c: function() {
        $j.each($j.jQRTE.boxy, function() {
            $j("#" + this).jqpopup_close()
            });
        $j.jQRTE.boxy = {}
    },
    handle_color: function(id, element) {
        var rid = id;
        if (id == "bgcolor" && navigator.userAgent.indexOf("MSIE") != -1) {
            rid = "backColor"
        } else {
            if (id == "bgcolor") {
                rid = "hiliteColor"
            }
        }
        $j.jQRTE.jqp_o("color_div", element, id);
        if (id == "bgcolor") {
            if ($j.jQRTE.backcolorList[element] == null) {
                $j.jQRTE.backcolorList[element] = $j.jQRTE.backcolor
            }
            $j("#color_value").jqcp_setColor($j.jQRTE.backcolorList[element])
            } else {
            if (id == "forecolor") {
                if ($j.jQRTE.forecolorList[element] == null) {
                    $j.jQRTE.forecolorList[element] = $j.jQRTE.forecolor
                }
                $j("#color_value").jqcp_setColor($j.jQRTE.forecolorList[element])
                }
        }
        $j("#color_btn").unbind("click");
        $j("#color_btn").bind("click", function() {
            if (rid == "backColor" || rid == "hiliteColor") {
                $j.jQRTE.backcolorList[element] = $j("#color_value").val()
                } else {
                $j.jQRTE.forecolorList[element] = $j("#color_value").val()
                }
            $j.jQRTE.setCommand(rid, $j("#color_value").val(), element);
            $j.jQRTE.jqp_c()
            })
        },
    handle_character: function(id, element) {
        $j.jQRTE.jqp_o(id + "_div", element, id);
        $j(".character").unbind("click");
        $j(".character").bind("click", function() {
            $j.jQRTE.htmlHandler(this.id.toString(), element);
            var box = element.split("_");
            var textid = "";
            for (var i = 0; i < box.length - 1; i++) {
                textid += "_" + box[i]
                }
            textid = textid.substr(1);
            checkTextAreaLen(document.getElementById(textid));
            $j.jQRTE.jqp_c()
            })
        },
    handle_emotion: function(id, element) {
        $j.jQRTE.jqp_o(id + "_div", element, id);
        $j(".emoticon").unbind("click");
        $j(".emoticon").bind("click", function() {
            var str = '<img src="' + this.src + '" title="' + this.title + '"/>';
            $j.jQRTE.htmlHandler(str, element);
            $j.jQRTE.jqp_c()
            })
        },
    handle_html: function(id, element) {
        $j.jQRTE.jqp_o(id + "_div", element, id);
        if (navigator.userAgent.indexOf("MSIE") != -1) {
            $j("#html_content").text(document.getElementById(element).contentWindow.document.body.innerHTML)
            } else {
            $j("#html_content").val(document.getElementById(element).contentWindow.document.body.innerHTML)
            }
        $j("#" + id + "_btn").unbind("click");
        $j("#" + id + "_btn").bind("click", function() {
            var rid = element.split("_");
            var textid = "";
            for (var i = 0; i < rid.length - 1; i++) {
                textid += "_" + rid[i]
                }
            textid = textid.substr(1);
            if (navigator.userAgent.indexOf("MSIE") != -1) {
                $j("#" + textid).text($j("#html_content").text())
                } else {
                $j("#" + textid).text($j("#html_content").val())
                }
            if (navigator.userAgent.indexOf("MSIE") != -1) {
                $j(document.getElementById(element).contentWindow.document.body).html($j("#html_content").text())
                } else {
                var content = $j("#html_content").val();
                $j(document.getElementById(element).contentWindow.document.body).html("<pre>" + content + "</pre>")
                }
            $j.jQRTE.jqp_c()
            })
        },
    handle_addimage: function(id, element) {
        $j.jQRTE.jqp_o(id + "_div", element, id);
        $j("#" + id + "_btn").unbind("click");
        $j("#" + id + "_btn").bind("click", function() {
            var str = " <img";
            str += ' src="' + $j("#addimage_url").val() + '"';
            str += ' title="' + $j("#addimage_desc").val() + '"';
            str += ' align="' + $j("#addimage_alignment").val() + '"';
            str += ' border="' + $j("#addimage_border").val() + '"';
            str += "/>";
            $j.jQRTE.htmlHandler(str, element);
            $j.jQRTE.jqp_c()
            })
        },
    handle_addlink: function(id, element) {
        $j.jQRTE.jqp_o(id + "_div", element, id);
        $j("#addlink_url").val('');
        $j("#addlink_name").val('');

        $j("#" + id + "_btn").unbind("click");
        $j("#" + id + "_btn").bind("click", function() {

            if (isValidUrl( $j("#addlink_url").val())){
                var str = '<a href="' + $j("#addlink_url").val() + '"';
                str += ' target="' + $j("#addlink_target").val() + '"';
                str += ">";
                str += $j("#addlink_name").val();
                str += "</a>";
                $j.jQRTE.htmlHandler(str, element);
                var box = element.split("_");
                var textid = "";
                for (var i = 0; i < box.length - 1; i++) {
                    textid += "_" + box[i]
                    }
                textid = textid.substr(1);
                checkTextAreaLen(document.getElementById(textid));
                $j.jQRTE.jqp_c()
            }
            else{
                $j('#addlink_div_pc #addlink_div #addlink_error #errorMessage').html('Please enter a valid URL. ie http://www.example.com');
                $j('#addlink_div_pc #addlink_div #addlink_error').show();
                window.setTimeout( function(){ $j('#addlink_div_pc #addlink_div #addlink_error').fadeOut() }, 4000 );
                return false;
            }
        })
    },
    handle_copyright: function(id, element) {
        window.open("http://www.jqframework.com/", "_new")
        },
    handle_addtable: function(id, element) {
        $j.jQRTE.jqp_o(id + "_div", element, id);
        $j("#" + id + "_btn").unbind("click");
        $j("#" + id + "_btn").bind("click", function() {
            var str = "<table";
            str += ' cellpadding="' + $j("#addtable_cellpadding").val() + '"';
            str += ' cellspacing="' + $j("#addtable_cellspacing").val() + '"';
            str += ' width="' + $j("#addtable_width").val() + $j("#addtable_width_format").val() + '"';
            str += ' border="' + $j("#addtable_border").val() + '"';
            str += ' align="' + $j("#addtable_alignment").val() + '"';
            str += ">";
            for (var i = 0; i < $j("#addtable_row").val(); i++) {
                str += "<tr>";
                for (var j = 0; j < $j("#addtable_column").val(); j++) {
                    str += "<td>&nbsp;</td>"
                }
                str += "</tr>"
            }
            str += "</table>";
            $j.jQRTE.htmlHandler(str, element);
            $j.jQRTE.jqp_c()
            })
        },
    handle_uploadimage: function(id, element) {
        $j.jQRTE.jqp_o(id + "_div", element, id);
        if (typeof resetUploadImageInputTypeFile == 'function')
            resetUploadImageInputTypeFile();
        $j("#" + id + "_btn").unbind("click");
        $j("#" + id + "_btn").bind("click", function() {
            $j.jQRTE.uploads("image", element)
            })
        },
    handle_uploadimageReturn: function(element, uniqid, imageSrc ) {
        var str = " <img";
        str += ' src="' + $j("#uploadimage_url").val() + '"';
        str += ' id="' + uniqid + '"';
        str += ' longdesc="' + imageSrc + '"';
        str += ' title="' + $j("#uploadimage_desc").val() + '"';
        str += ' align="' + $j("#uploadimage_alignment").val() + '"';
        str += ' border="' + $j("#uploadimage_border").val() + '"';
        str += "/>";
        $j.jQRTE.htmlHandler(str, element);
        $j.jQRTE.jqp_c()
        },
    handle_uploadfile: function(id, element) {
        $j.jQRTE.jqp_o(id + "_div", element, id);
        $j("#" + id + "_btn").unbind("click");
        $j("#" + id + "_btn").bind("click", function() {
            $j.jQRTE.uploads("file", element)
            })
        },
    handle_uploadfileReturn: function(element) {
        var str = '<a href="' + $j("#uploadfile_url").val() + '"><img';
        str += ' src="images/attachment.gif"';
        str += ' title="' + $j("#uploadfile_name").val() + '"';
        str += ' border="0"/>';
        str += $j("#uploadfile_name").val();
        str += "</a>";
        $j.jQRTE.htmlHandler(str, element);
        $j.jQRTE.jqp_c()
        },
    htmlHandler: function(html_content, element) {
        $j.jQRTE.restoreRange(element);
        if (navigator.userAgent.indexOf("MSIE") != -1) {
            document.getElementById(element).contentWindow.document.selection.createRange().pasteHTML(html_content)
        }
        else {
            var success = false;
            try {
                document.getElementById(element).contentWindow.document.execCommand("insertHTML", false, html_content);
                success = true
            }
            catch(e) {}
            if (!success) {
                try {
                    document.getElementById(element).contentWindow.document.execCommand("insertText", false, html_content)
                }
                catch(e) {}
            }
        }
        $j.jQRTE.restoreRange(element);
        var box = element.split("_");
        var textid = "";
        for (var i = 0; i < box.length - 1; i++) {
            textid += "_" + box[i]
            }
        textid = textid.substr(1);
        $j("#" + textid).text(document.getElementById(element).contentWindow.document.body.innerHTML)
        },
    uploads: function(fname, element) {
        var uid = fname.toLowerCase();

        var url = "/image/uploadimage";

        if ( fname == "image"){
            var inputTypeFile = $j('#uploadimage_div_pc #uploadimage_div #uploadimage_fileToUpload');
            var isThereAFile = ( (typeof inputTypeFile.val() == "undefined") || (inputTypeFile.val() == '' )) ? 'false' : 'true';

            if (isThereAFile == 'false'){
                $j('#uploadimage_div_pc #uploadimage_div #uploadimage_error').html('Please select an image');
                $j('#uploadimage_div_pc #uploadimage_div #uploadimage_error').show();
                window.setTimeout( function(){ $j('#uploadimage_div_pc #uploadimage_div #uploadimage_error').fadeOut() }, 4000 );
                return false;
            }
            var categoryLevel2Id = $j('#categoryLevel2Id').val(); // for questions
            var questionId = $j('#question-list #answerFormQuestionId').val(); // for answers

            var box = element.split("_");
            var textid = "";
            for (var i = 0; i < box.length - 1; i++) {
                textid += "_" + box[i]
                }
            imageType = textid.substr(1);

            url = url + '?isThereAFile=' + isThereAFile + '&imageType=' + imageType + '&categoryLevel2Id=' + categoryLevel2Id + '&questionId=' + questionId;
        }

        $j.blockUI({ css: {
            border: 'none',
            padding: '15px',
            backgroundColor: '#000',
            '-webkit-border-radius': '10px',
            '-moz-border-radius': '10px',
            opacity: .5,
            color: '#fff'
        } });

        $j.jQRTE.ajaxFileUpload({
            url: url,
            secureuri: false,
            fileElementId: "upload" + uid + "_fileToUpload",
            dataType: "json",
            success: function(data, status) {
                $j.unblockUI({
                    onUnblock: function(){
                        if (typeof(data.error) != "undefined") {
                            if (data.error.value != "") {
                                if ( document.getElementById('uploadFileError') ){
                                    $j.facebox(document.getElementById('uploadFileError').innerHTML);
                                    $j('#facebox .body').css({'width':'335px' });
                                    $j('#facebox .footer').css({'width':'335px' });
                                    $j('#facebox').css({'left':($j(window).width() - $j('#facebox').width()) / 2})
                                }
                            } else {

                                var imageSrc = data.imagepath.value;
                                if (data.uploadingImage.value == "true"){
                                    imageSrc = "/images/ajax-loader.gif";
                                }

                                var uniqid = data.uniqid.value;

                                $j("#upload" + uid + "_url").val(imageSrc);
                                eval("$j.jQRTE.handle_upload" + fname + "Return('" + element + "', '" + uniqid + "','" + data.imagepath.value + "' );");

                                if (data.uploadingImage.value == "true"){
                                    window.setTimeout( function (){ requestQuestionAnswerImage( data.imagepath.value, imageType, uniqid);}, 15000);
                                }
                            }
                        }
                    }
                });
            },
            error: function(data, status, e) {
                $j.unblockUI({
                    onUnblock: function(){
                        if ( document.getElementById('uploadFileErrorPlugin') ){
                            $j.facebox(document.getElementById('uploadFileErrorPlugin').innerHTML);
                            $j('#facebox .body').css({'width':'335px' });
                            $j('#facebox .footer').css({'width':'335px' });
                            $j('#facebox').css({'left':($j(window).width() - $j('#facebox').width()) / 2})
                        }
                    }
                });
            }
        });
        return false
    },
    uploadIframe: function(id, uri) {
        var frameId = "jUploadFrame" + id;
        if (window.ActiveXObject) {
            var io = document.createElement('<iframe id="' + frameId + '" name="' + frameId + '" />');
            if (typeof uri == "boolean") {
                io.src = "javascript:false"
            } else {
                if (typeof uri == "string") {
                    io.src = uri
                }
            }
        } else {
            var io = document.createElement("iframe");
            io.id = frameId;
            io.name = frameId
        }
        io.style.position = "absolute";
        io.style.top = "-1000px";
        io.style.left = "-1000px";
        document.body.appendChild(io);
        return io
    },
    uploadForm: function(id, fileElementId) {
        var formId = "jUploadForm" + id;
        var fileId = "jUploadFile" + id;
        var form = $j('<form  action="" method="POST" name="' + formId + '" id="' + formId + '" enctype="multipart/form-data"></form>');
        var oldElement = $j("#" + fileElementId);
        var newElement = $j(oldElement).clone();
        $j(oldElement).attr("id", fileId);
        $j(oldElement).before(newElement);
        $j(oldElement).appendTo(form);
        $j(form).css("position", "absolute");
        $j(form).css("top", "-1200px");
        $j(form).css("left", "-1200px");
        $j(form).appendTo("body");
        return form
    },
    ajaxFileUpload: function(s) {
        s = $j.extend({}, $j.ajaxSettings, s);
        var id = new Date().getTime();
        var form = $j.jQRTE.uploadForm(id, s.fileElementId);
        var io = $j.jQRTE.uploadIframe(id, s.secureuri);
        var frameId = "jUploadFrame" + id;
        var formId = "jUploadForm" + id;
        if (s.global && !$j.active++) {
            $j.event.trigger("ajaxStart")
            }
        var requestDone = false;
        var xml = {};
        if (s.global) {
            $j.event.trigger("ajaxSend", [xml, s])
            }
        var uploadCallback = function(isTimeout) {
            var io = document.getElementById(frameId);
            try {
                if (io.contentWindow) {
                    xml.responseText = io.contentWindow.document.body ? io.contentWindow.document.body.innerHTML: null;
                    xml.responseXML = io.contentWindow.document.XMLDocument ? io.contentWindow.document.XMLDocument: io.contentWindow.document
                } else {
                    if (io.contentDocument) {
                        xml.responseText = io.contentDocument.document.body ? io.contentDocument.document.body.innerHTML: null;
                        xml.responseXML = io.contentDocument.document.XMLDocument ? io.contentDocument.document.XMLDocument: io.contentDocument.document
                    }
                }
            } catch(e) {
                $j.handleError(s, xml, null, e)
                }
            if (xml || isTimeout == "timeout") {
                requestDone = true;
                var status;
                try {
                    status = isTimeout != "timeout" ? "success": "error";
                    if (status != "error") {
                        var data = $j.jQRTE.uploadHttpData(xml, s.dataType);
                        if (s.success) {
                            s.success(data, status)
                            }
                        if (s.global) {
                            $j.event.trigger("ajaxSuccess", [xml, s])
                            }
                    } else {
                        $j.handleError(s, xml, status)
                        }
                } catch(e) {
                    status = "error";
                    $j.handleError(s, xml, status, e)
                    }
                if (s.global) {
                    $j.event.trigger("ajaxComplete", [xml, s])
                    }
                if (s.global && !--$j.active) {
                    $j.event.trigger("ajaxStop")
                    }
                if (s.complete) {
                    s.complete(xml, status)
                    }
                $j(io).unbind();
                setTimeout(function() {
                    try {
                        $j(io).remove();
                        $j(form).remove()
                        } catch(e) {
                        $j.handleError(s, xml, null, e)
                        }
                }, 100);
                xml = null
            }
        };
        if (s.timeout > 0) {
            setTimeout(function() {
                if (!requestDone) {
                    uploadCallback("timeout")
                    }
            }, s.timeout)
            }
        try {
            var form = $j("#" + formId);
            $j(form).attr("action", s.url);
            $j(form).attr("method", "POST");
            $j(form).attr("target", frameId);
            if (form.encoding) {
                form.encoding = "multipart/form-data"
            } else {
                form.enctype = "multipart/form-data"
            }
            $j(form).submit()
            } catch(e) {
            $j.handleError(s, xml, null, e)
            }
        if (window.attachEvent) {
            document.getElementById(frameId).attachEvent("onload", uploadCallback)
            } else {
            document.getElementById(frameId).addEventListener("load", uploadCallback, false)
            }
        return {
            abort: function() {}
        }
    },
    uploadHttpData: function(r, type) {
        var data = !type;
        data = type == "xml" || data ? r.responseXML: r.responseText;
        if (type == "script") {
            $j.globalEval(data)
            }
        if (type == "json") {
            eval("data = " + data)
            }
        if (type == "html") {
            $j("<div>").html(data).evalScripts()
            }
        return data
    }
};
$j.fn.extend({
    jqrte: function() {
        return this.each(function() {
            $j.jQRTE.init(this.id)
            })
        },
    jqrte_setIconNotLoggedIn: function() {
        return this.each(function() {
            $j.jQRTE.setIconNotLoggedIn(this.id)
            })
        },
    jqrte_setIcon: function() {
        return this.each(function() {
            $j.jQRTE.setIcon(this.id)
            })
        },
    jqrte_setContent: function() {
        return this.each(function() {
            $j.jQRTE.setContent(this.id)
            })
        },
    jqpopup_close: function() {
        return this.each(function() {
            try {
                $j.jQRTE.restoreRange($j.jQRTE.element)
                } catch(e) {}
            $j.jQpopup.close(this.id)
            })
        }
});
function specialcharacter() {
    var cols = 15;
    var j = 0;
    var tablebox = '<table cellpadding="1" cellspacing="1" border="1">';

    tablebox += "<tr>"
    tablebox += '<td class="character" id="&#177;">&#177;</td>';
    tablebox += '<td class="character" id="&#8734;">&#8734;</td>';
    tablebox += '<td class="character" id="&#8800;">&#8800;</td>';
    tablebox += '<td class="character" id="&#126;">&#126;</td>';
    tablebox += '<td class="character" id="&#215;">&#215;</td>';
    tablebox += '<td class="character" id="&#247;">&#247;</td>';
    tablebox += '<td class="character" id="&#8804;">&#8804;</td>';
    tablebox += '<td class="character" id="&#8805;">&#8805;</td>';
    tablebox += '<td class="character" id="&#8723;">&#8723;</td>';
    tablebox += '<td class="character" id="&#8773;">&#8773;</td>';
    tablebox += '<td class="character" id="&#8706;">&#8706;</td>';
    tablebox += '<td class="character" id="&#8730;">&#8730;</td>';
    tablebox += '<td class="character" id="&#8594;">&#8594;</td>';
    tablebox += "</tr>"
    tablebox += "<tr>"
    tablebox += '<td class="character" id="&#8596;">&#8596;</td>';
    tablebox += '<td class="character" id="&#945;">&#945;</td>';
    tablebox += '<td class="character" id="&#946;">&#946;</td>';
    tablebox += '<td class="character" id="&#947;">&#947;</td>';
    tablebox += '<td class="character" id="&#948;">&#948;</td>';
    tablebox += '<td class="character" id="&#949;">&#949;</td>';
    tablebox += '<td class="character" id="&#952;">&#952;</td>';
    tablebox += '<td class="character" id="&#977;">&#977;</td>';
    tablebox += '<td class="character" id="&#956;">&#956;</td>';
    tablebox += '<td class="character" id="&#960;">&#960;</td>';
    tablebox += '<td class="character" id="&#961;">&#961;</td>';
    tablebox += '<td class="character" id="&#963;">&#963;</td>';
    tablebox += '<td class="character" id="&#964;">&#964;</td>';
    tablebox += "</tr>"
    tablebox += "<tr>"
    tablebox += '<td class="character" id="&#966;">&#966;</td>';
    tablebox += '<td class="character" id="&#969;">&#969;</td>';
    tablebox += '<td colspan="11">&nbsp;</td>';
    tablebox += "</tr>";
    tablebox += "</table>";
    $j("#character_div").html(tablebox)
    }

$j(document).ready(function() {
//    $j("#color_picker").jqcp();
//    $j("#color_value").jqcp_setObject();
    specialcharacter();
    $j(".jqrte_menu td").mouseover(function() {
        $j(this).toggleClass("jqrte_active")
        });
    $j(".jqrte_menu td").mouseout(function() {
        $j(this).toggleClass("jqrte_active")
        })
    });

$j("#color_picker").ready(function() {
 try{
        $j("#color_picker").jqcp();
        }catch(err) {}
});

$j("#color_value").ready(function() {
 try{
    $j("#color_value").jqcp_setObject();
    }catch(err) {}
});

