var server_path = '/ftparea/';
var server_path_img = server_path;
var server_path_links = server_path;
var server_path_flash = server_path;

initTa= function() {
	var oFCKeditor = [];
	var TextA = AJS.$bytc("textarea", "wysiwyg");
	for (var i=0; i<TextA.length; i++) {
		var ta=TextA[i];
		oFCKeditor[i] = new FCKeditor(ta.id);
		oFCKeditor[i].BasePath	= '/javascript/fckeditor/' ;
		oFCKeditor[i].PluginsPath ='/FCKplugins/' ;
		oFCKeditor[i].Config["CustomConfigurationsPath"] = "/javascript/fckeditorconfig.js"  ;
		oFCKeditor[i].Height = "400";
		oFCKeditor[i].Config['SkinPath'] = oFCKeditor[i].BasePath + 'editor/skins/office2003/' ;
		oFCKeditor[i].Config['ImageBrowserURL'] = '/filemanager/browser/default/browser.html?Connector=connectors/php/connector.php&Type=Image&ServerPath='+server_path_img;
	    oFCKeditor[i].Config['LinkBrowserURL'] = '/filemanager/browser/default/browser.html?Connector=connectors/php/connector.php&ServerPath='+server_path_links;
	    oFCKeditor[i].Config['FlashBrowserURL'] = '/filemanager/browser/default/browser.html?Connector=connectors/php/connector.php&Type=Flash&ServerPath='+server_path_flash;
		
		oFCKeditor[i].ReplaceTextarea();
	}
	
	var ominiFCKeditor = [];
	var TextA = AJS.$bytc("textarea", "wysiwyg_mini");
	for (var i=0; i<TextA.length; i++) {
		var ta=TextA[i];
		ominiFCKeditor[i] = new FCKeditor(ta.id);
		ominiFCKeditor[i].BasePath	= '/javascript/fckeditor/' ;
		ominiFCKeditor[i].PluginsPath ='/FCKplugins/' ;
		ominiFCKeditor[i].Config['SkinPath'] = ominiFCKeditor[i].BasePath + 'editor/skins/office2003/' ;
		ominiFCKeditor[i].Config["CustomConfigurationsPath"] = "/javascript/fckeditorconfig.js"  ;
		ominiFCKeditor[i].ToolbarSet = 'Basic' ;
		ominiFCKeditor[i].ReplaceTextarea();
	}
	if (navigator.product != "Gecko") {
		var ominiFCKeditor = [];
		var TextA = AJS.$bytc("textarea", "wysiwyg_mini_hide");
		for (var i=0; i<TextA.length; i++) {
			var ta=TextA[i];
			ominiFCKeditor[i] = new FCKeditor(ta.id);
			ominiFCKeditor[i].BasePath	= '/javascript/fckeditor/' ;
			ominiFCKeditor[i].PluginsPath ='/FCKplugins/' ;
			ominiFCKeditor[i].Config['SkinPath'] = ominiFCKeditor[i].BasePath + 'editor/skins/office2003/' ;
			ominiFCKeditor[i].Config["CustomConfigurationsPath"] = "/javascript/fckeditorconfig.js"  ;
			ominiFCKeditor[i].ToolbarSet = 'Basic' ;
			ominiFCKeditor[i].ReplaceTextarea();
		}
	}
	
	//var oFCKeditor = new FCKeditor('MyTextarea');
	//oFCKeditor.ReplaceTextarea();
} 

activate_bar = function(taId,mini) {
	if (navigator.product == "Gecko") {
		var ta = AJS.$(taId);
		if (ta.style.display!='none') {
			var oFCKeditor= new FCKeditor(ta.id);
			oFCKeditor.BasePath	= '/javascript/fckeditor/' ;
			oFCKeditor.PluginsPath ='/FCKplugins/' ;
			oFCKeditor.Config['SkinPath'] = oFCKeditor.BasePath + 'editor/skins/office2003/' ;
			oFCKeditor.Config["CustomConfigurationsPath"] = "/javascript/fckeditorconfig.js"  ;
			if (mini) oFCKeditor.ToolbarSet = 'Basic' ;
			oFCKeditor.ReplaceTextarea();
			}
	}
}

onloadfunctions.push(initTa);
