ww.form.editor = {
	plugin_list: new Array(),
	registerPlugin: function( plugin_name ) {
		ww.form.editor.plugin_list.push( plugin_name );
	},
	small: function( node_id ) {
		tinyMCE.init( {
			mode: "exact",
			elements: node_id,
			theme: "advanced",
			plugins: "searchreplac,paste,inlinepopups",
			theme_advanced_buttons1_add_before: "newdocument,separator",
			theme_advanced_buttons1: "bold,italic,underline,strikethrough,separator,cut,copy,paste,pastetext,pasteword,separator,search,replace,undo,redo",
			theme_advanced_buttons2: "",
			theme_advanced_buttons3: "",
			theme_advanced_toolbar_location: "top",
			theme_advanced_toolbar_align: "left",
			theme_advanced_statusbar_location: "bottom",
			skin: "o2k7",
			skin_variant: "silver",
			apply_source_formatting: true,
			theme_advanced_resize_horizontal: false,
			theme_advanced_resizing: true,
			force_p_newlines: true,
			entity_encoding: "raw",
			document_base_url: ww.baseURL(),
			content_css: ww.baseURL() + "css/main.css",
			body_class: $( 'body' ).attr( 'class' ),
			body_id: $( 'body' ).attr( 'id' ),
			language: ww.getLanguage(),
			width: "100%",
			height: "200"
		} );
	},
	big: function( node_id ) {
		var plugin_name = ww.form.editor.plugin_list.toString();
		var plugins = "";
		if( plugin_name.length ) {
			plugins = '-' + plugin_name.replace( ',', ',-' ) + ',';
		}
		tinyMCE.init( {
			mode: "exact",
			elements: node_id,
			theme: "advanced",
			/*
			plugins : "safari,spellchecker,style,layer,table,save,advhr,advimage,advlink,emotions,iespell,inlinepopups,insertdatetime,preview,media,searchreplace,print,contextmenu,paste,directionality,fullscreen,noneditable,visualchars,nonbreaking,xhtmlxtras,template,pagebreak",
			theme_advanced_buttons1_add_before : "newdocument,separator",
			theme_advanced_buttons1_add : "fontselect,fontsizeselect",
			theme_advanced_buttons2_add : "separator,insertdate,inserttime,preview,separator,forecolor,backcolor",
			theme_advanced_buttons2_add_before: "cut,copy,paste,pastetext,pasteword,separator,search,replace,separator",
			theme_advanced_buttons3_add_before : "tablecontrols,separator",
			theme_advanced_buttons3_add : "emotions,iespell,media,advhr,separator,print,separator,ltr,rtl,separator,fullscreen",
			theme_advanced_buttons4 : "insertlayer,moveforward,movebackward,absolute,|,styleprops,|,spellchecker,cite,abbr,acronym,del,ins,attribs,|,visualchars,nonbreaking,template,blockquote,pagebreak,|,insertfile,insertimage",
			*/
			plugins: plugins + "safari,style,table,save,advimage,advlink,emotions,inlinepopups,preview,searchreplace,contextmenu,paste,fullscreen,noneditable,visualchars,nonbreaking,xhtmlxtras",
			theme_advanced_buttons1_add_before: "newdocument,separator",
			theme_advanced_buttons1_add: "",
			theme_advanced_buttons2_add_before: "cut,copy,paste,pastetext,pasteword,separator,search,replace,separator",
			theme_advanced_buttons2_add: plugin_name,
			theme_advanced_buttons3_add_before: "tablecontrols,separator",
			theme_advanced_buttons3_add: "separator,emotions,fullscreen",
//			theme_advanced_buttons4_add: plugin_name,
//			theme_advanced_buttons4 : "insertlayer,moveforward,movebackward,absolute,|,styleprops,|,spellchecker,cite,abbr,acronym,del,ins,attribs,|,visualchars,nonbreaking,template,blockquote,pagebreak,|,insertfile,insertimage",
			theme_advanced_toolbar_location: "top",
			theme_advanced_toolbar_align: "left",
			theme_advanced_statusbar_location: "bottom",
			theme_advanced_resize_horizontal: false,
			theme_advanced_resizing: true,
			apply_source_formatting: true,
			skin: "o2k7",
			skin_variant: "silver",
			force_p_newlines: true,
			entity_encoding: "raw",
			document_base_url: ww.baseURL(),
			file_browser_callback: 'ww.store.tinyMCEBrowser',
			content_css: ww.baseURL() + "css/main.css",
			body_class: $( 'body' ).attr( 'class' ),
			body_id: $( 'body' ).attr( 'id' ),
			language: ww.getLanguage(), 
			width: "100%",
			height: "500"
		} );
	}
}
