tinyMCE.init({
	theme : "advanced",
	mode : "textareas",
	editor_selector : "editor",
	plugins : "advimage,advlink,paste",
	theme_advanced_toolbar_location : "top",
	theme_advanced_toolbar_align : "left",
	theme_advanced_buttons1 : "bold, italic, underline, strikethrough, separator, bullist, numlist, separator, outdent, indent, separator,image",
	theme_advanced_buttons2 : "copy, cut, paste, undo, redo, separator, link, unlink, anchor, separator, charmap, sub, sup, separator, code, cleanup, separator",
	theme_advanced_buttons3 : "",
	width : "320",
	height : "250",
	convert_urls : false,
	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;",
	apply_source_formatting : true,
	advlink_styles:'externe link = doc'
});

function fileBrowserCallBack(field_name, url, type, win) {
	var connector = "../../filemanager/browser.html?Connector=connectors/php/connector.php";
	var enableAutoTypeSelection = true;
	
	var cType;
	tinyfck_field = field_name;
	tinyfck = win;
	
	switch (type) {
		case "image":
			cType = "Image";
			break;
		case "flash":
			cType = "Flash";
			break;
		case "file":
			cType = "File";
			break;
	}
	
	if (enableAutoTypeSelection && cType) {
		connector += "&Type=" + cType;
	}
	
	window.open(connector, "tinyfck", "modal,width=600,height=400");
}
