// JavaScript Document

tinyMCE.init({
			// General options
		mode : "textareas",
    	editor_selector : "mceEditor",
 		theme : "advanced",
 		language : "de",
		skin : "o2k7",
		plugins : "safari,style,table,save,advhr,advimage,advlink,preview,searchreplace,contextmenu,paste,directionality,noneditable,visualchars,xhtmlxtras,inlinepopups",

		// Theme options
		theme_advanced_buttons1 : "preview,|,cut,copy,paste,pastetext,|,undo,redo,|,link,unlink,|,image,advhr,charmap,|,search,replace,|,cleanup,code,removeformat",
		theme_advanced_buttons2 : "bold,italic,underline,strikethrough,|,justifyleft,justifycenter,justifyright,justifyfull,|,bullist,numlist,|,outdent,indent,|,forecolor,backcolor,|,sub,sup",
		theme_advanced_buttons3 : "styleselect,|,tablecontrols",
		theme_advanced_toolbar_location : "top",
		theme_advanced_toolbar_align : "left",
		theme_advanced_statusbar_location : "bottom",
		theme_advanced_resizing : false,
		

		// Example content CSS (should be your site CSS)
		content_css : "css/tinymce_content.css",
		file_browser_callback : 'myFileBrowser',
		
		visual_table_class : "standardtabelle",
		
		cleanup_on_startup : true,
		remove_linebreaks : true,
		force_p_newlines : true,

		convert_urls : false
	});
	
	var v = location.search.substring(1, location.search.length).split('&');
	var sessid = v.pop();  // possible parameters
	function myFileBrowser(field_name, url, type, win){
	   		//alert("Field_Name: " + field_name + "\nURL: " + url + "\nType: " + type + "\nWin: " + win); // debug/testing

		 tinyMCE.activeEditor.windowManager.open({
			file : "popup.php?type=" + type + "&" + sessid, // PHP session ID is now included if there is one at all
			width : 520,  // Your dimensions may differ - toy around with them!
			height : 400,
			resizable : "yes",
			inline : "yes",  // This parameter only has an effect if you use the inlinepopups plugin!
			close_previous : "no"
    	}, {
			window : win,
			input : field_name
		});
		return false;
  }