

tinymce.create('tinymce.plugins.CustomDropDown', {
	createControl: function(n, cm) {
		switch (n) {
			case 'customdropdown': {
			  var c = cm.createMenuButton('customdropdown', {
					title : 'Custom dropdown-menu',
					image : 'http://www.ghaan.com/modules/TinyMCE/images/customdropdown.gif',
					icons : false
				});
				c.onRenderMenu.add(function(c, m) {				
    					m.add({title : 'Start expand/collapse-area', onclick : function() {
	  					tinyMCE.activeEditor.execCommand('mceInsertContent', false, '{startExpandCollapse id=\'expand1\' title=\'This is my expandable area\'}');
					}});
    					m.add({title : 'End expand/collapse-area', onclick : function() {
	  					tinyMCE.activeEditor.execCommand('mceInsertContent', false, '{stopExpandCollapse}');
					}});
  					m.addSeparator();
    					m.add({title : 'Insert CMS version info', onclick : function() {
	  					tinyMCE.activeEditor.execCommand('mceInsertContent', false, '{cms_version} {cms_versionname}');
					}});
  					m.addSeparator();
  	  				m.add({title : 'Insert Smarty {literal} around selection', onclick : function() {
              var sel=tinyMCE.activeEditor.selection.getContent();
	  					tinyMCE.activeEditor.execCommand('mceInsertContent', false, '{literal}'+sel+'{/literal}');
					}});

 				});
 				return c;
			}			
		}
		return null;
		
	}
});
// Register plugin with a short name

tinymce.PluginManager.add('customdropdown', tinymce.plugins.CustomDropDown);

		
//Creates a new plugin class and a custom listbox
tinymce.create('tinymce.plugins.CMSLinkerPlugin', {
	createControl: function(n, cm) {	
		switch (n) {
			case 'cmslinker':			
				var c = cm.createMenuButton('cmslinker', {
					title : 'Insert link to cmsms-page',
					image : 'http://www.ghaan.com/modules/TinyMCE/images/cmsmslink.gif',
					icons : false
				});

				c.onRenderMenu.add(function(c, m) {
					var mm = m.addMenu({title : '1 Accueil'});

					mm.add({title : '1 Accueil', onclick : function() {
						var sel=tinyMCE.activeEditor.selection.getContent();
						if (sel=='') sel='Accueil';
						tinyMCE.activeEditor.execCommand('mceInsertContent', false, '<a href="http://www.ghaan.com/accueil.html">'+sel+'</a>');
					}});
					mm.addSeparator();

					mm.add({title : '1.1 Informations', onclick : function() {
						var sel=tinyMCE.activeEditor.selection.getContent();
						if (sel=='') sel='Informations';
						tinyMCE.activeEditor.execCommand('mceInsertContent', false, '<a href="http://www.ghaan.com/accueil/informations.html">'+sel+'</a>');
					}});
					var mm = m.addMenu({title : '2 PrÃ©sentation'});

					mm.add({title : '2 PrÃ©sentation', onclick : function() {
						var sel=tinyMCE.activeEditor.selection.getContent();
						if (sel=='') sel='Pr&Atilde;&copy;sentation';
						tinyMCE.activeEditor.execCommand('mceInsertContent', false, '<a href="http://www.ghaan.com/presentation.html">'+sel+'</a>');
					}});
					mm.addSeparator();

					mm.add({title : '2.1 AndrÃ© Nocquet', onclick : function() {
						var sel=tinyMCE.activeEditor.selection.getContent();
						if (sel=='') sel='Andr&Atilde;&copy; Nocquet';
						tinyMCE.activeEditor.execCommand('mceInsertContent', false, '<a href="http://www.ghaan.com/presentation/andre-nocquet.html">'+sel+'</a>');
					}});

					mm.add({title : '2.2 Le GHAAN', onclick : function() {
						var sel=tinyMCE.activeEditor.selection.getContent();
						if (sel=='') sel='Le GHAAN';
						tinyMCE.activeEditor.execCommand('mceInsertContent', false, '<a href="http://www.ghaan.com/presentation/ghaan.html">'+sel+'</a>');
					}});
					var mmm = mm.addMenu({title : '2.3 Techniciens'});

					mmm.add({title : '2.3 Techniciens', onclick : function() {
						var sel=tinyMCE.activeEditor.selection.getContent();
						if (sel=='') sel='Techniciens';
						tinyMCE.activeEditor.execCommand('mceInsertContent', false, '<a href="http://www.ghaan.com/presentation/techniciens.html">'+sel+'</a>');
					}});
					mmm.addSeparator();

					mmm.add({title : '2.3.1 Claude GENTIL - 7Ã¨me da &#133;', onclick : function() {
						var sel=tinyMCE.activeEditor.selection.getContent();
						if (sel=='') sel='Claude GENTIL - 7&Atilde;&uml;me dan';
						tinyMCE.activeEditor.execCommand('mceInsertContent', false, '<a href="http://www.ghaan.com/presentation/techniciens/claude-gentil.html">'+sel+'</a>');
					}});

					mmm.add({title : '2.3.2 HervÃ© DIZIEN - 6Ã¨me da &#133;', onclick : function() {
						var sel=tinyMCE.activeEditor.selection.getContent();
						if (sel=='') sel='Herv&Atilde;&copy; DIZIEN - 6&Atilde;&uml;me dan';
						tinyMCE.activeEditor.execCommand('mceInsertContent', false, '<a href="http://www.ghaan.com/presentation/techniciens/herve-dizien.html">'+sel+'</a>');
					}});

					mmm.add({title : '2.3.3 Claude CÃ‰BILLE - 6Ã¨me  &#133;', onclick : function() {
						var sel=tinyMCE.activeEditor.selection.getContent();
						if (sel=='') sel='Claude C&Atilde;‰BILLE - 6&Atilde;&uml;me dan';
						tinyMCE.activeEditor.execCommand('mceInsertContent', false, '<a href="http://www.ghaan.com/presentation/techniciens/claude-cebille.html">'+sel+'</a>');
					}});

					mmm.add({title : '2.3.4 Jean-Luc DELABY - 6Ã¨me  &#133;', onclick : function() {
						var sel=tinyMCE.activeEditor.selection.getContent();
						if (sel=='') sel='Jean-Luc DELABY - 6&Atilde;&uml;me dan';
						tinyMCE.activeEditor.execCommand('mceInsertContent', false, '<a href="http://www.ghaan.com/presentation/techniciens/jean-luc-delaby.html">'+sel+'</a>');
					}});

					mmm.add({title : '2.3.5 Michel DESROCHES - 6Ã¨me &#133;', onclick : function() {
						var sel=tinyMCE.activeEditor.selection.getContent();
						if (sel=='') sel='Michel DESROCHES - 6&Atilde;&uml;me dan';
						tinyMCE.activeEditor.execCommand('mceInsertContent', false, '<a href="http://www.ghaan.com/presentation/techniciens/michel-desroches.html">'+sel+'</a>');
					}});

					mmm.add({title : '2.3.6 Jean-Pierre DATIGNY - 6Ã &#133;', onclick : function() {
						var sel=tinyMCE.activeEditor.selection.getContent();
						if (sel=='') sel='Jean-Pierre DATIGNY - 6&Atilde;&uml;me dan';
						tinyMCE.activeEditor.execCommand('mceInsertContent', false, '<a href="http://www.ghaan.com/presentation/techniciens/jean-pierre-datigny.html">'+sel+'</a>');
					}});

					mmm.add({title : '2.3.7 Mohamed BELAYACHI - 5Ã¨m &#133;', onclick : function() {
						var sel=tinyMCE.activeEditor.selection.getContent();
						if (sel=='') sel='Mohamed BELAYACHI - 5&Atilde;&uml;me dan';
						tinyMCE.activeEditor.execCommand('mceInsertContent', false, '<a href="http://www.ghaan.com/presentation/techniciens/mohamed-belayachi.html">'+sel+'</a>');
					}});

					mmm.add({title : '2.3.8 Pascal HEYDACKER - 5Ã¨me &#133;', onclick : function() {
						var sel=tinyMCE.activeEditor.selection.getContent();
						if (sel=='') sel='Pascal HEYDACKER - 5&Atilde;&uml;me dan';
						tinyMCE.activeEditor.execCommand('mceInsertContent', false, '<a href="http://www.ghaan.com/presentation/techniciens/pascal-heydacker.html">'+sel+'</a>');
					}});

					mmm.add({title : '2.3.9 Patrice MORAND - 5Ã¨me d &#133;', onclick : function() {
						var sel=tinyMCE.activeEditor.selection.getContent();
						if (sel=='') sel='Patrice MORAND - 5&Atilde;&uml;me dan';
						tinyMCE.activeEditor.execCommand('mceInsertContent', false, '<a href="http://www.ghaan.com/presentation/techniciens/patrice-morand.html">'+sel+'</a>');
					}});

					mmm.add({title : '2.3.10 Roland GILABEL - 5Ã¨me  &#133;', onclick : function() {
						var sel=tinyMCE.activeEditor.selection.getContent();
						if (sel=='') sel='Roland GILABEL - 5&Atilde;&uml;me dan';
						tinyMCE.activeEditor.execCommand('mceInsertContent', false, '<a href="http://www.ghaan.com/presentation/techniciens/roland-gilabel.html">'+sel+'</a>');
					}});
					var mmm = mm.addMenu({title : '2.4 ComitÃ© directeur'});

					mmm.add({title : '2.4 ComitÃ© directeur', onclick : function() {
						var sel=tinyMCE.activeEditor.selection.getContent();
						if (sel=='') sel='Comit&Atilde;&copy; directeur';
						tinyMCE.activeEditor.execCommand('mceInsertContent', false, '<a href="http://www.ghaan.com/presentation/comite-directeur.html">'+sel+'</a>');
					}});
					mmm.addSeparator();

					mmm.add({title : '2.4.1 Lucien Rambaud, prÃ©side &#133;', onclick : function() {
						var sel=tinyMCE.activeEditor.selection.getContent();
						if (sel=='') sel='Lucien Rambaud, pr&Atilde;&copy;sident d&#039;honneur';
						tinyMCE.activeEditor.execCommand('mceInsertContent', false, '<a href="http://www.ghaan.com/presentation/comite-directeur/lucien-rambaud.html">'+sel+'</a>');
					}});

					mmm.add({title : '2.4.2 Alain Floure, prÃ©sident', onclick : function() {
						var sel=tinyMCE.activeEditor.selection.getContent();
						if (sel=='') sel='Alain Floure, pr&Atilde;&copy;sident';
						tinyMCE.activeEditor.execCommand('mceInsertContent', false, '<a href="http://www.ghaan.com/presentation/comite-directeur/alain-floure.html">'+sel+'</a>');
					}});

					mmm.add({title : '2.4.3 Thierry Geoffroy, secrÃ© &#133;', onclick : function() {
						var sel=tinyMCE.activeEditor.selection.getContent();
						if (sel=='') sel='Thierry Geoffroy, secr&Atilde;&copy;taire g&Atilde;&copy;n&Atilde;&copy;ral';
						tinyMCE.activeEditor.execCommand('mceInsertContent', false, '<a href="http://www.ghaan.com/presentation/comite-directeur/thierry-geoffroy.html">'+sel+'</a>');
					}});

					mmm.add({title : '2.4.4 Isabelle Di Romano, trÃ© &#133;', onclick : function() {
						var sel=tinyMCE.activeEditor.selection.getContent();
						if (sel=='') sel='Isabelle Di Romano, tr&Atilde;&copy;sori&Atilde;&uml;re';
						tinyMCE.activeEditor.execCommand('mceInsertContent', false, '<a href="http://www.ghaan.com/presentation/comite-directeur/isabelle-di-romano.html">'+sel+'</a>');
					}});

					mmm.add({title : '2.4.5 Alexandre Dumont, respon &#133;', onclick : function() {
						var sel=tinyMCE.activeEditor.selection.getContent();
						if (sel=='') sel='Alexandre Dumont, responsable juridique';
						tinyMCE.activeEditor.execCommand('mceInsertContent', false, '<a href="http://www.ghaan.com/presentation/comite-directeur/alexandre-dumont.html">'+sel+'</a>');
					}});

					mmm.add({title : '2.4.6 GÃ©rard Foulon, responsa &#133;', onclick : function() {
						var sel=tinyMCE.activeEditor.selection.getContent();
						if (sel=='') sel='G&Atilde;&copy;rard Foulon, responsable communication';
						tinyMCE.activeEditor.execCommand('mceInsertContent', false, '<a href="http://www.ghaan.com/presentation/comite-directeur/gerard-foulond-responsable-communication.html">'+sel+'</a>');
					}});

					mmm.add({title : '2.4.7 Mohamed Boumaza', onclick : function() {
						var sel=tinyMCE.activeEditor.selection.getContent();
						if (sel=='') sel='Mohamed Boumaza';
						tinyMCE.activeEditor.execCommand('mceInsertContent', false, '<a href="http://www.ghaan.com/presentation/comite-directeur/mohamed-boumaza.html">'+sel+'</a>');
					}});

					mmm.add({title : '2.4.8 Benoit Desroches', onclick : function() {
						var sel=tinyMCE.activeEditor.selection.getContent();
						if (sel=='') sel='Benoit Desroches';
						tinyMCE.activeEditor.execCommand('mceInsertContent', false, '<a href="http://www.ghaan.com/presentation/comite-directeur/benoit-desroches.html">'+sel+'</a>');
					}});

					mmm.add({title : '2.4.9 Gilbert Menon', onclick : function() {
						var sel=tinyMCE.activeEditor.selection.getContent();
						if (sel=='') sel='Gilbert Menon';
						tinyMCE.activeEditor.execCommand('mceInsertContent', false, '<a href="http://www.ghaan.com/presentation/comite-directeur/gilbert-menon.html">'+sel+'</a>');
					}});

					mmm.add({title : '2.4.10 Yannick Podevin', onclick : function() {
						var sel=tinyMCE.activeEditor.selection.getContent();
						if (sel=='') sel='Yannick Podevin';
						tinyMCE.activeEditor.execCommand('mceInsertContent', false, '<a href="http://www.ghaan.com/presentation/comite-directeur/yannick-podevin.html">'+sel+'</a>');
					}});

					mmm.add({title : '2.4.11 Damien Gauthier', onclick : function() {
						var sel=tinyMCE.activeEditor.selection.getContent();
						if (sel=='') sel='Damien Gauthier';
						tinyMCE.activeEditor.execCommand('mceInsertContent', false, '<a href="http://www.ghaan.com/presentation/comite-directeur/damien-gauthier.html">'+sel+'</a>');
					}});
					var mm = m.addMenu({title : '3 Pratique'});

					mm.add({title : '3 Pratique', onclick : function() {
						var sel=tinyMCE.activeEditor.selection.getContent();
						if (sel=='') sel='Pratique';
						tinyMCE.activeEditor.execCommand('mceInsertContent', false, '<a href="http://www.ghaan.com/pratique.html">'+sel+'</a>');
					}});
					mm.addSeparator();

					mm.add({title : '3.1 Clubs', onclick : function() {
						var sel=tinyMCE.activeEditor.selection.getContent();
						if (sel=='') sel='Clubs';
						tinyMCE.activeEditor.execCommand('mceInsertContent', false, '<a href="http://www.ghaan.com/pratique/clubs.html">'+sel+'</a>');
					}});

					mm.add({title : '3.2 Calendrier', onclick : function() {
						var sel=tinyMCE.activeEditor.selection.getContent();
						if (sel=='') sel='Calendrier';
						tinyMCE.activeEditor.execCommand('mceInsertContent', false, '<a href="http://www.ghaan.com/pratique/calendrier.html">'+sel+'</a>');
					}});

					mm.add({title : '3.3 Contact', onclick : function() {
						var sel=tinyMCE.activeEditor.selection.getContent();
						if (sel=='') sel='Contact';
						tinyMCE.activeEditor.execCommand('mceInsertContent', false, '<a href="http://www.ghaan.com/pratique/contact.html">'+sel+'</a>');
					}});
					var mm = m.addMenu({title : '4 MultimÃ©dia'});

					mm.add({title : '4 MultimÃ©dia', onclick : function() {
						var sel=tinyMCE.activeEditor.selection.getContent();
						if (sel=='') sel='Multim&Atilde;&copy;dia';
						tinyMCE.activeEditor.execCommand('mceInsertContent', false, '<a href="http://www.ghaan.com/multimedia.html">'+sel+'</a>');
					}});
					mm.addSeparator();

					mm.add({title : '4.1 MaÃ®tre Nocquet : DÃ©monst &#133;', onclick : function() {
						var sel=tinyMCE.activeEditor.selection.getContent();
						if (sel=='') sel='Ma&Atilde;&reg;tre Nocquet : D&Atilde;&copy;monstrations &Atilde;&nbsp; Bercy';
						tinyMCE.activeEditor.execCommand('mceInsertContent', false, '<a href="http://www.ghaan.com/multimedia/demonstrations.html">'+sel+'</a>');
					}});

					mm.add({title : '4.2 MaÃ®tre Nocquet : vidÃ©os  &#133;', onclick : function() {
						var sel=tinyMCE.activeEditor.selection.getContent();
						if (sel=='') sel='Ma&Atilde;&reg;tre Nocquet : vid&Atilde;&copy;os techniques';
						tinyMCE.activeEditor.execCommand('mceInsertContent', false, '<a href="http://www.ghaan.com/multimedia/videos-techniques-nocquet.html">'+sel+'</a>');
					}});

					mm.add({title : '4.3 MaÃ®tre Nocquet : photogra &#133;', onclick : function() {
						var sel=tinyMCE.activeEditor.selection.getContent();
						if (sel=='') sel='Ma&Atilde;&reg;tre Nocquet : photographies';
						tinyMCE.activeEditor.execCommand('mceInsertContent', false, '<a href="http://www.ghaan.com/multimedia/photographies-nocquet.html">'+sel+'</a>');
					}});

					mm.add({title : '4.4 Techniciens : photographie &#133;', onclick : function() {
						var sel=tinyMCE.activeEditor.selection.getContent();
						if (sel=='') sel='Techniciens : photographies';
						tinyMCE.activeEditor.execCommand('mceInsertContent', false, '<a href="http://www.ghaan.com/multimedia/photographies-rtn.html">'+sel+'</a>');
					}});

					mm.add({title : '4.5 Techniciens : vidÃ©os', onclick : function() {
						var sel=tinyMCE.activeEditor.selection.getContent();
						if (sel=='') sel='Techniciens : vid&Atilde;&copy;os';
						tinyMCE.activeEditor.execCommand('mceInsertContent', false, '<a href="http://www.ghaan.com/multimedia/videos-techniciens.html">'+sel+'</a>');
					}});

					mm.add({title : '4.6 VidÃ©os sur internet', onclick : function() {
						var sel=tinyMCE.activeEditor.selection.getContent();
						if (sel=='') sel='Vid&Atilde;&copy;os sur internet';
						tinyMCE.activeEditor.execCommand('mceInsertContent', false, '<a href="http://www.ghaan.com/multimedia/videos-internet.html">'+sel+'</a>');
					}});

					m.add({title : '5 Articles', onclick : function() {
						var sel=tinyMCE.activeEditor.selection.getContent();
						if (sel=='') sel='Articles';
						tinyMCE.activeEditor.execCommand('mceInsertContent', false, '<a href="http://www.ghaan.com/articles.html">'+sel+'</a>');
					}});

					m.add({title : '13 Mentions lÃ©gales', onclick : function() {
						var sel=tinyMCE.activeEditor.selection.getContent();
						if (sel=='') sel='Mentions l&Atilde;&copy;gales';
						tinyMCE.activeEditor.execCommand('mceInsertContent', false, '<a href="http://www.ghaan.com/mentions-legales.html">'+sel+'</a>');
					}});

					m.add({title : '14 Recherche', onclick : function() {
						var sel=tinyMCE.activeEditor.selection.getContent();
						if (sel=='') sel='Recherche';
						tinyMCE.activeEditor.execCommand('mceInsertContent', false, '<a href="http://www.ghaan.com/recherche.html">'+sel+'</a>');
					}});

					m.add({title : '16 Suivre...', onclick : function() {
						var sel=tinyMCE.activeEditor.selection.getContent();
						if (sel=='') sel='Suivre...';
						tinyMCE.activeEditor.execCommand('mceInsertContent', false, '<a href="http://www.ghaan.com/suivre.html">'+sel+'</a>');
					}});

					m.add({title : '17 Plan', onclick : function() {
						var sel=tinyMCE.activeEditor.selection.getContent();
						if (sel=='') sel='Plan';
						tinyMCE.activeEditor.execCommand('mceInsertContent', false, '<a href="http://www.ghaan.com/plan.html">'+sel+'</a>');
					}});

					m.add({title : '18 test', onclick : function() {
						var sel=tinyMCE.activeEditor.selection.getContent();
						if (sel=='') sel='test';
						tinyMCE.activeEditor.execCommand('mceInsertContent', false, '<a href="http://www.ghaan.com/test.html">'+sel+'</a>');
					}});

				});

				// Return the new menu button instance
				return c;
		}

		return null;
	}
});

// Register plugin with a short name
tinymce.PluginManager.add('cmslinker', tinymce.plugins.CMSLinkerPlugin);
		 tinyMCE.init({ 
    mode : "exact",
  elements : "",
  body_class : "CMSMSBody",
  content_css : "http://www.ghaan.com/modules/TinyMCE/stylesheet.php?templateid=19&amp;mediatype=screen&amp;bogus=1284049765",

    entity_encoding : "raw", 
  button_tile_map : true, //performance update

		
  theme : "advanced",
  skin : "default",
  skin_variant : "",
  theme_advanced_toolbar_location : "top",
  theme_advanced_toolbar_align : "left",
  visual : true,
	      
  accessibility_warnings : false,
      			
  fix_list_elements : true,
  verify_html : true,
  verify_css_classes : false,
  
  plugins : "-cmslinker,-customdropdown,paste,advimage,advlink,contextmenu,inlinepopups",
  
  paste_auto_cleanup_on_pasteÂ : true,
  paste_remove_spans : true,
  paste_remove_styles : true,

  

  theme_advanced_buttons1 : "cut,paste,pastetext,pasteword,copy,separator,justifyleft,justifycenter,justifyright,justifyfull,separator,fontsizeselect",
  theme_advanced_buttons2 : "bold,italic,underline,strikethrough,advhr,separator,bullist,numlist,separator,outdent,indent,separator,undo,redo,separator,link,unlink,anchor,charmap,cleanup,separator,forecolor,backcolor",
  theme_advanced_buttons3 : "",
  theme_advanced_buttons4 : "",


  theme_advanced_blockformats : "p,div,h1,h2,h3,h4,h5,h6,div,blockquote,dt,dd,code,samp",
  document_base_url : "http://www.ghaan.com/",

  relative_urls : true,
  remove_script_host : true,
  	
  language: "fr",
  dialog_type: "modal",
  apply_source_formatting : true,

  theme_advanced_statusbar_location : 'bottom',
  theme_advanced_path : true,
			
		
	force_br_newlines : false,
  force_p_newlines : true,		
			 
  forced_root_block : false,		
		
  plugin_insertdate_dateFormat : "%Y-%m-%d",
  plugin_insertdate_timeFormat : "%H:%M:%S"



    
});
  
	
  
function toggleEditor(id) {
  if (!tinyMCE.getInstanceById(id))
    tinyMCE.execCommand('mceAddControl', false, id);
  else
    tinyMCE.execCommand('mceRemoveControl', false, id);
}
  

  