$.fn.tinymce = function(options){
    return this.each(function(){
        // I don't think the style declaration is not really used in this sense, but I left it anyway
        preString = "<div class='jqHTML_frame' style='width:"+$(this).css("width")+"px;height:" + ($(this).css("height")+20) + "px;'>";
        postString = "</div>";
        $(this).wrap(preString + postString);
		// + 'Height:' + $(this).css("height"));
        // this comes last to avoid IE7 bug
        //tinyMCE.addMCEControl(document.getElementById(this.id), this.id);
        tinyMCE.execCommand('mceAddControl',false,this.id);
    });
}
function initMCE()
{
    tinyMCE.init({ mode : "none",
       theme : "advanced",
       plugins : "spellchecker",
       theme_advanced_layout_manager : "SimpleLayout",
       theme_advanced_disable: "hr,",
       theme_advanced_buttons1: "bold,italic,underline,separator,link,separator,bullist,numlist,outdent,indent,separator,justifyleft,justifycenter,justifyright,justifyfull,separator,removeformat,separator,charmap,separator,image",
       theme_advanced_buttons2: "",
       theme_advanced_buttons3: "",
       theme_advanced_toolbar_location : "top",
       theme_advanced_toolbar_align : "left",
       file_browser_callback: "tinyBrowser",
       content_css : _mce_css});
}
// initialize tiny mce
initMCE();