		tinyMCE.init({
			mode : "exact",
			elements : "tresc",
			theme : "advanced",
			plugins : "advimage,advlink,media,contextmenu,media, template, save, print, table, style, paste",
			theme_advanced_buttons1_add_before : "newdocument,separator",
			theme_advanced_buttons1_add : "fontselect,fontsizeselect",
			theme_advanced_buttons2_add : "separator,forecolor,backcolor,liststyle",
			theme_advanced_buttons2_add_before: "cut,copy,separator,",
			theme_advanced_buttons3_add_before : "",
			theme_advanced_buttons3_add : "media",
			theme_advanced_buttons1_add_before : "styleprops,forecolor,backcolor",
			theme_advanced_buttons1_add : "separator,hr,removeformat,visualaid,separator,sub,sup,separator,charmap,print,cancel",
       	 	theme_advanced_buttons2_add : "insertdate,inserttime,bullist,numlist,separator,outdent,indent,separator,undo,redo,separator",
			theme_advanced_buttons2_add_before : "template",
			theme_advanced_buttons3_add_before : " table, media, tablecontrols, styleprops, pastetext, pasteword, selectall",
			theme_advanced_blockformats : "p,div,h1,h2,h3,h4,h5,h6,blockquote,dt,dd,code,samp",
			theme_advanced_toolbar_location : "top",
			theme_advanced_toolbar_align : "left",
			extended_valid_elements : "hr[class|width|size|noshade]",
			file_browser_callback : "ajaxfilemanager",
			paste_use_dialog : false,
			theme_advanced_resizing : true,
			theme_advanced_resize_horizontal : true,
			apply_source_formatting : true,
			force_br_newlines : true,
			force_p_newlines : false,	
			relative_urls : true,
			
			template_templates : [
        {
                title : "Ramy Treści nr. 1 (612 px)",
                src : "resources/szablony_dla_tiny/ramy_tresci_1.php",
                description : "Główne ramy treści. Opisują zazwyczaj stałą szerokość treści, jej tło czy marginesy wewnętrzne."
        },
		{
                title : "HateEMEL2",
                src : "pic/b.php",
                description : "Adds Editors Name and Staff ID"
        }
]
		});

		function ajaxfilemanager(field_name, url, type, win) {
			var ajaxfilemanagerurl = "../../../../jscripts/tiny_mce/plugins/ajaxfilemanager/ajaxfilemanager.php";
			switch (type) {
				case "image":
					break;
				case "media":
					break;
				case "flash": 
					break;
				case "file":
					break;
				default:
					return false;
			}
            tinyMCE.activeEditor.windowManager.open({
                url: "../../../../jscripts/tiny_mce/plugins/ajaxfilemanager/ajaxfilemanager.php",
                width: 782,
                height: 440,
                inline : "yes",
                close_previous : "no"
            },{
                window : win,
                input : field_name
            });
            
/*            return false;			
			var fileBrowserWindow = new Array();
			fileBrowserWindow["file"] = ajaxfilemanagerurl;
			fileBrowserWindow["title"] = "Ajax File Manager";
			fileBrowserWindow["width"] = "782";
			fileBrowserWindow["height"] = "440";
			fileBrowserWindow["close_previous"] = "no";
			tinyMCE.openWindow(fileBrowserWindow, {
			  window : win,
			  input : field_name,
			  resizable : "yes",
			  inline : "yes",
			  editor_id : tinyMCE.getWindowArg("editor_id")
			});
			
			return false;*/
		}

