	tinyMCE.init({
		mode : "exact",
		theme : "advanced",
		elements : "elm1",
		media_strict : false,
		plugins : "table,advhr,advimage,advlink,preview,zoom,searchreplace,print,contextmenu,paste,directionality,fullscreen,paste",
		theme_advanced_buttons1_add_before : "fullscreen,preview,separator,search,replace,separator,",
		theme_advanced_buttons2_add : "forecolor,backcolor,separator,flash,advhr,",
		theme_advanced_buttons3_add : "pastetext,pasteword,selectall,pastetext,",
		theme_advanced_toolbar_location : "top",
		theme_advanced_toolbar_align : "left",
		theme_advanced_path_location : "bottom",
		content_css : "/media/styles/avt.css",
		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],embed,script[type|language|src]",
		file_browser_callback : "fileBrowserCallBack",
		theme_advanced_resize_horizontal : false,
		theme_advanced_resizing : true,
		cleanup : false, 		//sa nu mai modifice continutul (de ex linkurile)
		convert_urls : false	//sa nu mai modifice linkurile
	});

	/*
	function fileBrowserCallBack(field_name, url, type, win) {
		// This is where you insert your custom filebrowser logic
		alert("Example of filebrowser callback: field_name: " + field_name + ", url: " + url + ", type: " + type);

		// Insert new URL, this would normaly be done in a popup
		win.document.forms[0].elements[field_name].value = "someurl.htm";
	}
	*/
function fileBrowserCallBack(field_name, url, type, win) {
    var connector = "../../filemanager/browser.html?Connector=connectors/php/connector.php";
    var enableAutoTypeSelection = true;
    
    var cType;
    //tinymcpuk_field = field_name;
    //tinymcpuk = win;
    
    tinyfck_field = field_name;
    tinyfck = win;    
				
    switch (type) 
    {
	case "image":
	    cType = "images";
	    break;
	case "flash":
	    cType = "Flash";
	    break;
	case "file":
	    cType = "File";
	    break;
    }
															
    if (enableAutoTypeSelection && cType) 
    {
    	connector += "&Type=" + cType;
    }
																	
    //window.open(connector, "tinymcpuk", "modal,width=800,height=600");
    window.open(connector, "tinyfck", "modal,width=800,height=600");
}
