	tinyMCE.init({
		mode: "specific_textareas",
		editor_selector : "mce_enabled",
		theme : "advanced",
		plugins : "media,style,layer,table,save,advhr,advimage,advlink,iespell,preview,searchreplace,zoom,print,contextmenu,paste,directionality,fullscreen,noneditable",
		theme_advanced_buttons1_add_before : "preview,save,print,separator,removeformat",
		theme_advanced_buttons1_add: "forecolor,media",
		theme_advanced_buttons2_add_before: "cut,copy,paste,pastetext,pasteword,separator,zoom,search,replace,separator",
		theme_advanced_buttons3_add_before : "tablecontrols,_separator",
		theme_advanced_buttons3_add : "iespell,advhr,separator,ltr,rtl,separator,fullscreen,media",
		theme_advanced_toolbar_location : "top",
		theme_advanced_toolbar_align : "left",
		theme_advanced_path_location : "bottom",
		content_css : "web/css/content_style.css",
		extended_valid_elements : "hr[class|width|size|noshade],font[face|size|color|style],span[class|align|style],script[src|language|type]",
		external_link_list_url : "content_links.js",
		external_image_list_url : "content_images.js",
		file_browser_callback : "fileBrowserCallBack",
		theme_advanced_resize_horizontal : true,
		theme_advanced_resize_vertical : true,
		theme_advanced_resizing : true,
        theme_advanced_blockformats : "p, h2, h3, blockquote",
		convert_urls : false,
  		relative_urls : true
	});
	tinyMCE.init({
		mode: "specific_textareas",
		editor_selector : "mce_nobars",
		theme : "advanced",
        theme_advanced_buttons1 : " ",
		content_css : "web/css/content_style.css"
	});

	function fileBrowserCallBack(field_name, url, type, win) {
        
		var fileBrowserWindow = new Array();

		var searchString = window.location.search;  // possible parameters
		if (searchString.length < 1) {
			// add "?" to the URL to include parameters (in other words: create a search string because there wasn't one before)
			searchString = "?";
		}
        if(type=="image") {
    		fileBrowserWindow["file"] = "../../../../admin.php?rm=imagepick";
        } else {
    		fileBrowserWindow["file"] = "../../../../admin.php?rm=filepick";
        }
		fileBrowserWindow["title"] = "File Browser";
		fileBrowserWindow["width"] = "420";
		fileBrowserWindow["height"] = "400";
		fileBrowserWindow["close_previous"] = "no";
		tinyMCE.openWindow(fileBrowserWindow, {
		  window : win,
		  input : field_name,
		  resizable : "yes",
          scrollbars: "yes",
		  inline : "yes"
		});
		return false;
	}
