It is working in firefox though.. but it is kinda hard for me to figure out what is wrong and IE and Opera do not have a nice debugger like Firebug and i don't know much javascript yet...

Code:
<script type="text/javascript" src="/mech7/js/tiny_mce/tiny_mce.js"></script><script type="text/javascript">
tinyMCE.init({
	mode : "none",
	plugins : "fullscreen,advimage,advlink,codeprotect",
	theme : "advanced",
	theme_advanced_buttons1 : "bold,italic,underline,separator,strikethrough,justifyleft,justifycenter,justifyright, justifyfull,bullist,numlist,hr,link,unlink,charmap,image,cleanup,fullscreen,code,|,styleselect,formatselect",
	theme_advanced_buttons2 : "",
	theme_advanced_buttons3 : "",
	theme_advanced_toolbar_location : "top",
	theme_advanced_toolbar_align : "left",	
	theme_advanced_path_location : "bottom",
	file_browser_callback : "ajaxfilemanager",
	content_css : "/mech7/css/editor.css",
	extended_valid_elements : "a[name|href|target|title|onclick],img[class|src|border=0|alt|title|hspace|vspace|width|height|align|onmouseover|onmouseout|name],hr[class|width|size|noshade],font[face|size|color|style],span[class|align|style]",
	theme_advanced_resize_horizontal : false,
	theme_advanced_resizing : true,
	apply_source_formatting : true,
});

function ajaxfilemanager(field_name, url, type, win) {
			var ajaxfilemanagerurl = "../../../../js/tiny_mce/plugins/ajaxfilemanager/ajaxfilemanager.php";
			switch (type) {
				case "image":
					ajaxfilemanagerurl += "?type=img";
					break;
				case "media":
					ajaxfilemanagerurl += "?type=media";
					break;
				case "flash": //for older versions of tinymce
					ajaxfilemanagerurl += "?type=media";
					break;
				case "file":
					ajaxfilemanagerurl += "?type=files";
					break;
				default:
					return false;
			}
			var fileBrowserWindow = new Array();
			fileBrowserWindow["file"] = ajaxfilemanagerurl;
			fileBrowserWindow["title"] = "Ajax File Manager";
			fileBrowserWindow["width"] = "782";
			fileBrowserWindow["height"] = "540";
			fileBrowserWindow["close_previous"] = "no";
			tinyMCE.openWindow(fileBrowserWindow, {
			  window : win,
			  input : field_name,
			  resizable : "yes",
			  inline : "yes",
			  editor_id : tinyMCE.getWindowArg("editor_id")
			});
			
			return false;
}
function toggleEditor(id) {
	var elm = document.getElementById(id);

	if (tinyMCE.getInstanceById(id) == null)
		tinyMCE.execCommand('mceAddControl', false, id);
	else
		tinyMCE.execCommand('mceRemoveControl', false, id);

}

html:

<label for="article">Article <a href="javascript:toggleEditor('articleTextarea');">(wysiwyg)</a></label>

<textarea name="data[Article][article]" rows="10" cols="20" id="articleTextarea"></textarea> </div>
In opera i get this error:

JavaScript - http://localhost/mech7/admin/articles/add
Javascript URL thread: "javascript:toggleEditor('articleTextarea');"
Error:
name: ReferenceError
message: Statement on line 1: Reference to undefined variable: toggleEditor
Backtrace:
Line 1 of unknown script
toggleEditor("articleTextarea");
Does anybody know why this happens?