tinyMCE.init({
	mode : "specific_textareas",
	theme : "advanced",
	editor_selector : 'tinymce',
	plugins : "spellchecker, simplepaste",
	spellchecker_rpc_url : "/document/spell",
	spellchecker_languages : "+English=en",
	theme_advanced_buttons1 : "bold,italic,underline,separator,link,unlink",
	theme_advanced_buttons2 : "",
	theme_advanced_buttons3 : "",
	theme_advanced_toolbar_location : "top",
	theme_advanced_toolbar_align : "left",
	init_instance_callback : "addWrappingPTags",
	relative_urls : false,
	convert_urls : false,
	document_base_url : "http://",
	convert_newlines_to_brs : false,
	force_br_newlines : false,
	force_p_newlines : true,
	forced_root_block : 'p', 
	paste_create_paragraphs : false,
	paste_create_linebreaks : true,
	paste_use_dialog : false,
	valid_elements : ("+a[href],strong,b,i,u,br,p")
});

tinyMCE.init({
	mode : "specific_textareas",
	theme : "advanced",
	editor_selector : 'tinymce_with_lists',
	plugins : "spellchecker, simplepaste",
	spellchecker_rpc_url : "/document/spell",
	spellchecker_languages : "+English=en",
	theme_advanced_buttons1 : "bold,italic,underline,separator,bullist,numlist,separator,link,unlink",
	theme_advanced_buttons2 : "",
	theme_advanced_buttons3 : "",
	theme_advanced_toolbar_location : "top",
	theme_advanced_toolbar_align : "left",
	init_instance_callback : "addWrappingPTags",
	relative_urls : false,
	convert_urls : false,
	document_base_url : "http://",
	convert_newlines_to_brs : false,
	force_br_newlines : false,
	force_p_newlines : true,
	forced_root_block : 'p', 
	paste_create_paragraphs : false,
	paste_create_linebreaks : true,
	paste_use_dialog : false,
	valid_elements : ("+a[href],strong,b,i,u,br,p,ul,ol,li")
});

tinyMCE.init({
	mode : "specific_textareas",
	theme : "advanced",
	editor_selector : 'spell_check',
	spellchecker_rpc_url : "/document/spell",
	spellchecker_languages : "+English=en",
	plugins : "spellchecker, simplepaste",
	theme_advanced_toolbar_location: 'external',
	theme_advanced_buttons1 : "",
	theme_advanced_buttons2 : "",
	theme_advanced_buttons3 : "",
	init_instance_callback : "addWrappingPTags",
	relative_urls : false,
	convert_urls : false,
	document_base_url : "http://",
	convert_newlines_to_brs : false,
	force_br_newlines : false,
	force_p_newlines : true,
	forced_root_block : 'p', 
	paste_create_paragraphs : false,
	paste_create_linebreaks : true,
	paste_use_dialog : false,
	valid_elements : ("+a[href],strong,b,i,u,br,p")
 });

function addWrappingPTags(inst) {
	value = inst.getElement().value;
	if(value && value.substr(0,3) != '<p>')
		inst.setContent('<p>' + value + '</p>');
}

  