/**
 * @author Didier
 */

//////////////////////////////////////////////////////// choix article /////////////////////////////////
// affichage des editors
/*function afficheEditors() {
	//alert('ok5');
	 var oFCKeditor = new FCKeditor( 'FCKechos' ) ;
    oFCKeditor.BasePath = "fckeditor/" ;
    oFCKeditor.ReplaceTextarea() ;
		
}


//

//
function afficheEchos(transport)
	{
	$('formModifEchos').enable();//mettre enable le formulaire de modif
	//remplir le formulaire de modif

	$('IDPage').value = transport.responseXML.getElementsByTagName('identite')[0].getAttribute('ID');
	var contenuEditorial=transport.responseXML.getElementsByTagName("item")[1].firstChild.nodeValue;
	//alert(contenuExtrait);
	// on nettoie p des text area
	$('pIntroduction').innerHTML ="";
	
	// on remet des textearea
	var debut = $('pIntroduction');
	var texterea = document.createElement("textarea");
	texterea.id ="FCKpage";
	texterea.name ="FCKpage";
	texterea.appendChild(document.createTextNode(contenuEditorial));
	debut.appendChild(texterea);
	//alert('ok1');
	// onselevt les textarea et met nouvelle valeur
	var TxtEditorial = $('FCKpage');
	//alert('ok2');
	TxtEditorial.value = contenuEditorial;
	//alert('ok3');
	//alert('ok4');
	//affcihage des editor
	//editorial
	
	afficheEditors();
	
}
////
function choixEchos(e) {
	var pars = $('formChoixEchos').serialize(true);
	new Ajax.Request('WXmlEchos.php',
		{
			
			method: 'get',
			parameters: pars,
			onSuccess: function(transport) {
				afficheEchos(transport);
				}
		});
} // projet

//////

/////////////////////////////////////////////////////////////////////////////
/////////////////
///////////////
///////////// mofi article
function afficheResultat(transport)
	{
		
	alert('modification complete');
	// on recharge la liste
	Liste();
}
//////
function modifEchos(e) {
	var oFCKeditorial = FCKeditorAPI.GetInstance('FCKpage') ;    // Get the editor instance that we want to interact with
	contentsEditorial =  oFCKeditorial.GetXHTML( true );
	
	var ID =$('IDPage').value;
	
	
	var donnees ='&ID='+ID+'&FCKpage='+escape(contentsEditorial);
	new Ajax.Request('baseModifPage.php',
		{
			
			method: 'post',
			postBody:donnees,
			onSuccess: function(transport) {
				afficheResultat(transport);
				}
		});
} // projet*/
/////////////////////////////////
function PrepareProjet(e) {
	//mise en place du lien pour la modification admin
	var lien = $('modif');
	lien.href = 'Admin/modifIndex.php?choix=18';
	
	
}




Event.observe(window, "load", PrepareProjet);



