// JavaScript Document
tinyMCE.init({
	  //mode : "none",
	  mode : "textareas",
		theme : "advanced",
	
		theme_advanced_toolbar_location : "top",
		theme_advanced_toolbar_align : "left",
		theme_advanced_statusbar_location : "bottom",
		
		plugins : "table,fullscreen,advhr,advimage,advlink,emotions,iespell,insertdatetime,flash,contextmenu,paste,directionality",
		theme_advanced_buttons1_add_before : "separator,tablecontrols",
		 theme_advanced_buttons1_add : "emotions,iespell,flash,advhr,separator",
		
		theme_advanced_buttons2_add : "forecolor,backcolor,cut,separator,styleselect,fontsizeselect,fullscreen",
		theme_advanced_buttons2_add_before: "",

		//theme_advanced_buttons2_add : "separator,insertdate,inserttime",
	//	theme_advanced_buttons2_add_before: "separator,forecolor,backcolor,cut,copy,paste,separator,tablecontrols",
		
	//	theme_advanced_buttons3_add_before : "",
	//	theme_advanced_buttons3_add : "emotions,iespell,flash,advhr,separator",
		

//        content_css : "includes/js/tinyfck/style.css",
       content_css : "../style.css",
	    plugi2n_insertdate_dateFormat : "%Y-%m-%d",
	    plugi2n_insertdate_timeFormat : "%H:%M:%S",
	//	extended_valid_elements : "hr[class|width|size|noshade],font[face|size|color|style],span[class|align|style]",
		// external_link_list_url : "admin/includes/javascript/tinyfck/link_list.js",
		//external_image_list_url : "admin/includes/javascript/tinyfck/image_list.js",
		// flash_external_list_url : "admin/includes/javascript/tinyfck/flash_list.js",
		file_browser_callback : "fileBrowserCallBack",
		paste_use_dialog : false,
		theme_advanced_resizing : true,
		theme_advanced_resize_horizontal : false,
		theme_advanced_link_targets : "_something=My somthing;_something2=My somthing2;_something3=My somthing3;",
		paste_auto_cleanup_on_paste : true,
		paste_convert_headers_to_strong : false,
	
		/*
       extended_valid_elements : "img[class|src|border=0|alt|title|hspace|vspace|width|height|align|onmouseover|onmouseout|name|obj|param|embed],object[classid|codebase|width|height],param[name|value],embed[src|quality|width|height|type|pluginspage|bgcolor]",
       flash_wmode : "transparent",
       flash_quality : "high",
*/

		paste_strip_class_attributes : "all"
	});


function fileBrowserCallBack(field_name, url, type, win) {
		tinyfck_field = field_name;
		tinyfck = win;
		window.open("../../filemanager/browser.html?Connector=connectors/php/connector.php", "tinyfck", "modal,width=600,height=400");
	}

function showMCE(id,linkObj) {
    if (tinyMCE.getInstanceById(id) == null) {
        linkObj.innerHTML = "Text Mode";
        tinyMCE.execCommand('mceAddControl', false, id);
    }
    else {
        linkObj.innerHTML = "Graphic Mode";
        tinyMCE.execCommand('mceRemoveControl', false, id);
    }
}

function showMCE_1(id,linkObj,id2) {
        tinyMCE.execCommand('mceAddControl', false, id);
 }

function HideMCE_1(id,linkObj) {
       tinyMCE.execCommand('mceRemoveControl', false, id);
}
