

	
  tinyMCE.init({
			   
	// umlaute nicht in htmlcode umwandeln da utf8
	entity_encoding : "raw",
	
	// new line mit br anstatt p /p dann aber alles ohne p
	//force_br_newlines : true,
	//forced_root_block : '',
	
	mode : "specific_textareas",
	theme : "advanced",
	editor_selector: "textareaTiny",
	// theme_advanced_blockformats : "p,div,h1,h2,h3,h4,h5,h6,blockquote,dt,dd,code,samp"
	theme_advanced_blockformats : "p,h1,h2,h3",
	theme_advanced_buttons1 : "formatselect,styleselect,bold,italic,link,unlink,image,anchor,bullist,numlist,removeformat,undo,redo,code",
	theme_advanced_buttons2 : "",
	theme_advanced_buttons3 : "",
	theme_advanced_toolbar_location : "top",
	theme_advanced_toolbar_align : "left",
	
	// styles einbinden 
	content_css : "scripta/tiny_textareas.css", // alle .color_ ... werden automatisch gelistet
	
	file_browser_callback : 'myFileBrowser',
	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]"
	
  });



	// Custom event handler
	function myCustomExecCommandHandler(editor_id, elm, command, user_interface, value) {
		var linkElm, imageElm, inst;

		switch (command) {
			case "mceLink":
				inst = tinyMCE.getInstanceById(editor_id);
				linkElm = tinyMCE.getParentElement(inst.selection.getFocusElement(), "a");

				if (linkElm)
					alert("Link dialog has been overriden. Found link href: " + tinyMCE.getAttrib(linkElm, "href"));
				else
					alert("Link dialog has been overriden.");

				return true;

			case "mceImage":
				inst = tinyMCE.getInstanceById(editor_id);
				imageElm = tinyMCE.getParentElement(inst.selection.getFocusElement(), "img");

				if (imageElm)
					alert("Image dialog has been overriden. Found image src: " + tinyMCE.getAttrib(imageElm, "src"));
				else
					alert("Image dialog has been overriden.");

				return true;
		}

		return false; // Pass to next handler in chain
	}

	// Custom save callback, gets called when the contents is to be submitted
	function customSave(id, content) {
		alert(id + "=" + content);
	}
