tinyMCE.init({
mode: "textareas",
theme: "advanced",
language: "en",
plugins: "cmsimple,save,paste,insertdatetime,table,emotions,contextmenu,inlinepopups,searchreplace,print,preview",
theme_advanced_buttons1:"save, separator, cut, copy, paste,pastetext,pasteword, separator, bold, italic, underline, strikethrough, separator, justifyleft, justifycenter, justifyright, justifyfull, separator, outdent, indent, bullist, numlist",
theme_advanced_buttons2:"code, removeformat, cleanup, separator, search,replace,separator,charmap, hr, separator, forecolor, backcolor, visualaid, tablecontrols",
theme_advanced_buttons3:"link, unlink, anchor, separator,image, separator, undo, redo,separator,emotions,separator,insertdate,separator,preview,print",
theme_advanced_buttons4:"cmsimple_insertlink, separator, cmsimple_insertimage, separator, formatselect,separator, styleselect",
//relative_urls : false,
theme_advanced_toolbar_location: "top",
theme_advanced_toolbar_align: "left",
theme_advanced_resizing : false,
theme_advanced_statusbar_location : "top",
content_css: "/specials/?&stylesheet",
plugin_insertdate_dateFormat: "%d-%m-%Y",
plugin_insertdate_timeFormat: "%H:%M:%S",
inline_styles : true,
visual : true,
verify_css_classes: false,
verify_html: false,
trim_span_elements: true,
valid_elements: "*[*]"
});
function cmsimpleselect(control_name,select_array){
	tmp="";	for(var j=0;j<select_array.length;j++)tmp+="<option value=\""+ select_array[j][0]+"\">"+select_array[j][1]+"</option>";
	return "<select id=\"{$editor_id}_"+control_name+"\" name=\"{$editor_id}_"+control_name+"\" onchange=\"tinyMCE.execInstanceCommand('{$editor_id}','"+control_name+"',false,this.options[this.selectedIndex].value);\" class=\"mceSelectList\">"+tmp+"</select>";
}
function TinyMCE_cmsimple_getControlHTML(control_name) {
	switch (control_name) {
		case "cmsimple_insertlink":return cmsimpleselect(control_name,ilink);
		case "cmsimple_insertimage":return cmsimpleselect(control_name,iimage);
	}
	return "";
}
function TinyMCE_cmsimple_execCommand(editor_id, element, command, user_interface, value) {
	switch (command) {
		case "cmsimple_insertlink":
    		tinyMCE.execCommand("mceReplaceContent",false,"<a href=\""+value+"\">{$selection}</a>");return true;
		case "cmsimple_insertimage":
    		tinyMCE.execCommand("mceInsertContent",false,"<img src=\""+value+"\" alt=\"\" title=\"\" border=\"\" />");return true;
	}
	return false;
}
var iimage=[["","-- Images --"]];
var ilink=[["","-- Pages --"],["/specials/?specials","specials"],["/specials/?How_to_create_pages","How to create pages"],["/specials/?How_to_create_pages:An_H2_heading","An H2 heading"],["/specials/?How_to_create_pages:An_H2_heading:An_H3_heading","An H3 heading"],["/specials/?How_to_delete_a_page","How to delete a page"],["/specials/?download=readme.txt","(File 0.6 KB) readme.txt"]];