tinyMCE.init({

//styleselect 

	mode : "textareas",
	plugins: "filemanager,fullscreen,zoom,ibrowser",
	textarea_trigger : "title",
	language : "en",
	width : "100%",
	theme : "advanced",
	content_css : "../admin/s/editor.css",
	theme_advanced_buttons1 : "formatselect,removeformat,bold,italic,strikethrough,separator,bullist,numlist,outdent,indent,separator,justifyleft,justifycenter,justifyright,separator,link,unlink,image,separator,undo,redo,separator,code",
	theme_advanced_buttons2 : "ibrowser,separator,fullscreen,zoom",
	theme_advanced_buttons3 : "",
	theme_advanced_toolbar_location : "top",
	theme_advanced_toolbar_align : "left",
	theme_advanced_path_location : "bottom",
	file_browser_callback : "fileBrowserCallBack",
	theme_advanced_resizing : true,
	browsers : "msie,gecko,opera",
	dialog_type : "modal",
	theme_advanced_resize_horizontal : false,
	theme_advanced_styles : "Titolo=e_titolo;Sottotitolo=e_sottotitolo;Evidenziato=e_evidenziato;TitoloBlu=e_titoloblu;Titolineato=e_titolobordato;Spannato=e_spannato;SpanBlu=e_spanblu",
	//theme_advanced_styles : "",
	entity_encoding : "named",
	relative_urls : false,
	remove_script_host : false,
	force_p_newlines : true,
	force_br_newlines : false,
	convert_newlines_to_brs : false,
	fix_table_elements : true,
	remove_linebreaks : true,
	valid_elements :"-a[id|href|title|rel|target],-strong/b,-em/i,-strike,-del,-u,p[class|align|dir],-ol,-ul,-li,br,img[class|src|alt|title|width|height|align],-sub,-sup,-blockquote[dir],-table[border|cellspacing|cellpadding|width|height|class|align|dir],thead[class|rowspan|width|height|align|valign|dir],tr[class|rowspan|width|height|align|valign|dir],th[dir|class|colspan|rowspan|width|height|align|valign|scope],td[dir|class|colspan|rowspan|width|height|align|valign],-div[dir|class|align],-span[class|align],-pre[class],-code[class],-address,-h1[class|align|dir],-h2[class|align|dir],-h3[class|align|dir],-h4[class|align|dir],-h5[class|align|dir],-h6[class|align|dir],hr"
		
	})
	
	;

	function fileBrowserCallBack(field_name, url, type, win) {
		// This is where you insert your custom filebrowser logic
		alert("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;
		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");
	}
	
	

