function TinyMCE() {
tinyMCE.init({
		language : "pl",
		skin : "o2k7",
		mode : "specific_textareas",
		editor_selector : "mce",
		theme : "advanced",
		skin_variant: "silver",
		width: "620",
		height: "200",
		forced_root_block : "div",
		force_br_newlines : 'br',
		plugins : "safari,pagebreak,style,table,advhr,advimage,advlink,iespell,inlinepopups,insertdatetime,media,contextmenu,paste,directionality,noneditable,visualchars,nonbreaking,xhtmlxtras,video,pages",
		theme_advanced_buttons1 : "code,undo,redo,bold,italic,underline,strikethrough,sub,sup,justifyleft,justifycenter,justifyright,justifyfullcut,forecolor,backcolor,formatselect,fontselect,fontsizeselect",
		theme_advanced_buttons2 : "pages,bullist,numlist,outdent,indent,ltr,rtl,pastetext,pasteword,insertdate,inserttime,charmap,advhr,link,unlink,image,video,tablecontrols",
		theme_advanced_buttons3 : "",
		theme_advanced_toolbar_location : "top",
		theme_advanced_toolbar_align : "left",
		theme_advanced_statusbar_location : "bottom",
		theme_advanced_resizing : true,
		theme_advanced_resize_horizontal : false,
		content_css : "css/tinymce.css",
		file_browser_callback : "CMSFileBrwoser",
		template_replace_values : {
		username : "Admin",
		staffid : "991234"
		}
	});
}
function CMSFileBrwoser(field_name, url, type, win) {
    var cmsURL = $('CMSExplorer') ? $('CMSExplorer').value : "index.php?lang="+Config.Lang+"&section=standard&action=file_explorer&version=1.0&explorer=mce";
    tinyMCE.activeEditor.windowManager.open({file : cmsURL, title : 'CMSFileBrwoser', width : 670, height : 400, resizable : "no", inline : "yes", close_previous : "no"}, {window : win, input : field_name});
    return false;
}
function CMSFileExplorer(cmsURL, title) {
	tinyMCE.activeEditor.windowManager.open({file : cmsURL, title : (title ? title : 'CMSFileBrwoser'), width : 670, height : 400, resizable : "no", inline : "yes", close_previous : "no"});
}
