$_tinyMCEBasePath = $_g2BasePath + "/lib/tiny_mce";

function initTinyMCE(id) {
	tinyMCE.init({
			content_css : $_g2BasePath + "/themes/viva/tinymceinit.css",
			theme : "advanced",
			mode : "exact",
			elements: id,
			theme_advanced_buttons1 : "bold,italic,underline,separator,justifyleft,justifyright,justifycenter,justifyfull,"+
					"separator,fontselect,fontsizeselect,separator,forecolor,backcolor,separator,link,unlink,separator,emotions",
			theme_advanced_buttons2 : "",
			theme_advanced_buttons3 : "",
			plugins: "emotions",
			theme_advanced_toolbar_location : "top",
			theme_advanced_statusbar_location: "bottom",
			theme_advanced_resizing: true,
			theme_advanced_resize_horizontal : false,
			theme_advanced_resize_vertical : true,
			relative_urls: false,
			convert_urls: false
		});
}


function initTinyMCE4Theme(id) {
tinyMCE.init({
		mode : "exact",
		elements: id,
		theme : "advanced",
		plugins : "spellchecker,style,layer,table,save,advhr,advimage,advlink,emotions,iespell,insertdatetime,preview,zoom,media,searchreplace,print,contextmenu,paste,directionality,fullscreen,noneditable,visualchars,nonbreaking,xhtmlxtras,template",
		theme_advanced_buttons1_add_before : "newdocument,separator",
		theme_advanced_buttons1_add : "fontselect,fontsizeselect",
		theme_advanced_buttons2_add : "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,ltr,rtl,separator,fullscreen",
		theme_advanced_buttons4 : "insertlayer,moveforward,movebackward,absolute,|,styleprops,|,spellchecker,cite,abbr,acronym,del,ins,attribs,|,visualchars,nonbreaking,template,|,insertfile,insertimage",
		theme_advanced_toolbar_location : "top",
		theme_advanced_toolbar_align : "left",
		theme_advanced_path_location : "bottom",
	    plugin_insertdate_dateFormat : "%Y-%m-%d",
	    plugin_insertdate_timeFormat : "%H:%M:%S",
		extended_valid_elements : "hr[class|width|size|noshade],font[face|size|color|style],span[class|align|style],p[lang]",
		theme_advanced_resize_horizontal : false,
		theme_advanced_resizing : true,
		apply_source_formatting : true,
		verify_html : false,
		relative_urls : false,
		convert_urls: false,
		spellchecker_languages : "+English=en"
	});
}