
	tinyMCE.init({
		// General options
		//oninit : "editor_ready",
		mode : "exact",
		elements : "cs_message",
		theme : "advanced",
		skin : "o2k7",
		language : "fr",
		//plugins : "safari,inlinepopups,cromaxfabimage",
		plugins : "safari,pagebreak,style,layer,save,advhr,advimage,advlink,emotions,iespell,insertdatetime,preview,media,searchreplace,print,contextmenu,paste,directionality,fullscreen,noneditable,visualchars,nonbreaking,xhtmlxtras,template,inlinepopups,cromaxfabimage",

		// Theme options
		theme_advanced_buttons1 : "bold,italic,underline,strikethrough,|,justifyleft,justifycenter,justifyright,justifyfull,formatselect,fontselect,fontsizeselect,|,forecolor,backcolor,|,charmap",
		theme_advanced_buttons2 : "undo,redo,|,crxfw,|,crxf,|,crxfg,|,crxfu,|,crxfmg",
		theme_advanced_buttons3 : "",
		theme_advanced_toolbar_location : "top",
		theme_advanced_toolbar_align : "left",
		theme_advanced_statusbar_location : "bottom",
		theme_advanced_resizing : true,
		theme_advanced_blockformats : "p,address,h1,h2,h3,h4,h5,h6",
		theme_advanced_fonts : "Andale Mono=andale mono,times;Arial=arial,helvetica,sans-serif;Arial Black=arial black,avant garde;Book Antiqua=book antiqua,palatino;Comic Sans MS=comic sans ms,sans-serif;Courier New=courier new,courier;Georgia=georgia,palatino;Helvetica=helvetica;Impact=impact,chicago;Lucida Calligraphy=lucida calligraphy, arial;Symbol=symbol;Tahoma=tahoma,arial,helvetica,sans-serif;Terminal=terminal,monaco;Times New Roman=times new roman,times;Trebuchet MS=trebuchet ms,geneva;Verdana=verdana,geneva;Webdings=webdings;Wingdings=wingdings,zapf dingbats",
		//width : "590",
		height : "400",
		theme_advanced_resize_horizontal : false,
		font_size_classes : "fontSize1,fontSize2,fontSize3,fontSize4,fontSize5,fontSize6,fontSize7",
		convert_fonts_to_spans : false,
		//convert_urls : false,
		//forced_root_block : 'div',
		//invalid_elements : "p",
		//inline_styles : true,
		//force_p_newlines : true,
 		//force_br_newlines : true,
  		//forced_root_block : false,
  		//convert_newlines_to_brs: true,
  		//remove_linebreaks : false,

		// Example content CSS (should be your site CSS)
		content_css : "css/box_text.css",
		//cleanup: false,
		//cleanup_callback : "myCustomCleanup",
		extended_valid_elements : "&,object[classid|codebase|width|height|align|data|type],param[name|value],embed[quality|type|pluginspage|width|height|src|align],iframe[src|style|width|height|scrolling|marginwidth|marginheight|frameborder|allowtransparency]",

		// Drop lists for link/image/media/template dialogs
		template_external_list_url : "lists/template_list.js",
		external_link_list_url : "lists/link_list.js",
		external_image_list_url : "lists/image_list.js",
		media_external_list_url : "lists/media_list.js",
		
		setup : function(ed) {
      ed.onKeyPress.add(function(ed, e) {
          showid2('bt_del','block');
		  showid2('bt_del_hid','none');
      });
	  ed.addCommand('change_skin', function(skin_name,width_skin) {
	  var path='resource/skin/'+skin_name+'/';
	var name_css=skin_name+'.css';
	if(skin_name!=''){
	try {
			//tinyMCE.activeEditor.dom.loadCSS(path+name_css);
			tinyMCE.get('cs_message').dom.loadCSS(path+name_css);
			document.getElementById('cs_message_tbl').style.width=width_skin+"px";
			//alert(name_css);
			}catch(err) {
			//div_id='error_load_page_perso';
			//ShowDivCenterPage('error_load',1,1);
			//restarting=(setTimeout("editor_restart()",5000));
			//showid2('error_load','block');
			//alert('Désolé ! une erreur est survenue, <a style=\"text-decoration:none;\" href=\"javascript:start_editor();rload();\">{\'send_card_reload_editor\'}</a>');
			//start_editor();
			//rload();
			}
		}
      });
	  ed.addCommand('del_all', function() {
	  tinyMCE.execCommand('SelectAll',false,'');
		var cont=tinyMCE.get('cs_message').selection.getContent({format : 'text'});
		tinyMCE.execCommand('mceFocus',false,'cs_message');
	if(cont!=''){
		tinyMCE.execCommand('mceReplaceContent',false,'');
		tinyMCE.execCommand('mceFocus',false,'cs_message'); 
		showid2('bt_del','none');
		showid2('bt_del_hid','block');
		}
      });
	  ed.onClick.add(function(ed) {
	  //tinyMCE.execCommand('SelectAll',false,'');
	  var my_text=tinyMCE.get('cs_message').getContent();
	  var default_message='<p class="default_text">Votre texte ici. Votre texte peut &eacute;tre bien plus long que celui pr&eacute;sent&eacute; ici.Vous pouvez ajouter des &eacute;moticons comme &ccedil;a <img src="resource/richedit/smileys/YahooIM/1.gif" alt="" border="0" /> ou &ccedil;a <img src="resource/richedit/smileys/YahooIM/8.gif" alt="" border="0" /> pour rendre votre message plus beau.</p>';
	  if (my_text==default_message && my_text!=''){
	  //tinyMCE.activeEditor.dom.removeClass(tinyMCE.activeEditor.dom.select('p'), 'default_text');
	  tinyMCE.execCommand('SelectAll',false,'');
	  tinyMCE.execCommand('mceReplaceContent',false,'');
	  showid2('bt_del','none');
	  showid2('bt_del_hid','block');
	  }
	 // tinyMCE.execCommand('mycommand',false,'');
	  /*if (skin==""){
	  rclass(default_skin_name,default_width_skin);
	  }else{
		rclass(skin,new_width_skin);
		}*/
	  });
   },


		// Replace values for the template plugin
		template_replace_values : {
			username : "Some User",
			staffid : "991234"
		}
	});	
	
