
function rexCustomFileBrowser(field_name, url, type, win)
{
	if (type == 'image' || type == 'media')
	{
		cmsURL = "index.php?page=mediapool&tinymce=true&opener_input_field="+field_name+"&clang="+0;
		popupTitle = 'Medienpool';
	}
	if (type == 'file')
	{
		cmsURL = "index.php?page=linkmap&tinymce=true&opener_input_field="+field_name+"&clang="+0;
		popupTitle = 'Linkmap';
	}

	tinyMCE.activeEditor.windowManager.open({
		file : cmsURL,
		title : popupTitle,
		width : 760,  // Your dimensions may differ - toy around with them!
		height : 500,
		resizable : "yes",
		inline : "yes",  // This parameter only has an effect if you use the inlinepopups plugin!
		close_previous : "no"
	}, {
		window : win,
		typeid : type,
		input : field_name
	});

	return false;
}

/*
function rexCustomURLConverter(url, node, on_save) {

	if (url.substr(0,6) == 'files/')
	{
		url = '../' + url;
	}

	// Return new URL
	return url;
}
*/

tinyMCEInitArray = {
  language: 'de',
  mode : 'specific_textareas',
  editor_selector : 'tinyMCEEditor',
  document_base_url : 'http://www.playce.de/',
  relative_urls : true,
  file_browser_callback : 'rexCustomFileBrowser',
  theme : 'advanced',
  theme_advanced_toolbar_location : 'top',
  theme_advanced_toolbar_align : 'left',
  theme_advanced_statusbar_location : 'bottom',
  theme_advanced_resizing : true,
  theme_advanced_buttons1 : 'bold,italic,underline,strikethrough,sub,sup,|,forecolor,backcolor,styleselect,formatselect,|,charmap,cleanup,removeformat,|,preview,code,fullscreen',
  theme_advanced_buttons2 : 'cut,copy,paste,pastetext,pasteword,|,justifyleft,justifycenter,justifyright,justifyfull,|,bullist,numlist,|,link,unlink,redaxoMedia,redaxoEmail,anchor,|,advhr,image,emotions,media',
  theme_advanced_buttons3 : '',
  theme_advanced_buttons4 : '',
  theme_advanced_source_editor_width : 760,
  theme_advanced_source_editor_height : 500,
  plugins : 'advhr,advimage,advlink,contextmenu,fullscreen,inlinepopups,paste,preview,redaxo,safari,visualchars,emotions,media',
  content_css : '../files/addons/tinymce/content.css',
extended_valid_elements : ""
+"img[align<bottom?left?middle?right?top|alt|border|class|dir<ltr?rtl|height"
  +"|hspace|id|ismap|lang|longdesc|name|onclick|ondblclick|onkeydown"
  +"|onkeypress|onkeyup|onmousedown|onmousemove|onmouseout|onmouseover"
  +"|onmouseup|src|style|title|usemap|vspace|width],",
  plugin_preview_width : 760,
  plugin_preview_height : 500,
  template_popup_width : 760,
  template_popup_height : 500,
  media_use_script : true,
  accessibility_warnings : false,
  apply_source_formatting : true,
  cleanup : true,
  fix_list_elements : true,
  fix_nesting : true,
  dialog_type : 'modal',
  skin : 'o2k7',
  skin_variant : 'black' 
}
tinyMCE.init(tinyMCEInitArray);