var dia_tinyMCE_Conf = {
		mode : "textareas",
		editor_selector : "dia_inputHTML",
		theme : "advanced",
		language : "pl",
		plugins : "table,advimage,preview,contextmenu",
		theme_advanced_buttons1 : "formatselect,separator,fontselect",
		theme_advanced_buttons2 : "fontsizeselect,separator,styleselect,separator,removeformat,cleanup",
		theme_advanced_buttons3 : "bold,italic,underline,strikethrough,separator,justifyleft,justifycenter,justifyright,justifyfull,separator,bullist,numlist,outdent,indent,separator,backcolor,forecolor",
		theme_advanced_buttons4 : "cut,copy,paste,undo,redo,separator,link,unlink,separator,image",
		theme_advanced_buttons5 : "tablecontrols,separator",
		theme_advanced_toolbar_location : "top",
		theme_advanced_toolbar_align : "left",
		theme_advanced_statusbar_location : "bottom",
		content_css : DIA_THEME_DIR+"/css/editor.css",
	    plugi2n_insertdate_dateFormat : "%Y-%m-%d",
	    plugi2n_insertdate_timeFormat : "%H:%M:%S",
		extended_valid_elements : "a[name|href|target|title|onclick],hr[class|width|size|noshade],font[face|size|color|style],span[class|align|style]",
		advimage_image_browser_callback : "dia_ImageBrowserCallback",
		table_image_browser_callback : "dia_ImageBrowserCallback",
		paste_use_dialog : false,
		theme_advanced_resizing : true,
		theme_advanced_resize_horizontal : false,
		paste_auto_cleanup_on_paste : true,
		paste_convert_headers_to_strong : false,
		paste_strip_class_attributes : "all"
};

function dia_ImageBrowserCallback(field_name, url, type, win)
{
	var urlStr  = dia_getWebsiteHomeURL();
		urlStr += 'imageBrowser.php?formname=0&elementnames=' + field_name;
		
	imageBroswerWin = win.open(urlStr,'DiamondCMSImageBrowser','width=560,height=400,menubar=no,resizeable=no,scrollbars=no');
}

tinyMCE.init(dia_tinyMCE_Conf);