/*-----------------------------Affiche ou masque un element------------------*/
function affiche_element(element,etat0){

if(etat0==0)
{
var action= window.document.getElementById(element).style.display ;
}
else
{
var action=etat0 ;
}

if(action=='block'){
	 window.document.getElementById(element).style.display = "none";}
	 
if(action=='none'){	
	  window.document.getElementById(element).style.display = "block";}
}

function rempli_textarea(texte_news)
{
  window.document.getElementById('textarea_edit_news').innerHTML="";
  window.document.getElementById('textarea_edit_news').innerHTML="<form method='post'><textarea name='editor_edit_news' id='textarea_news'>"+ texte_news +"</textarea><input type='submit' /></form>";
CKEDITOR.replace( 'editor_edit_news' );
}

function coloriseMenu(idboite)
{
window.document.getElementById(idboite).setAttribute("style", "background-color:#d71f28;");
window.document.getElementById(idboite+"lien").setAttribute("style", "color:#fff;");
}

function checklabox(idBox)
{
window.document.getElementById(idBox).checked= true;
}

function FreadOnly(idInput)
{

var action= window.document.getElementById(idInput).getAttribute("readonly") ;

if(action=='readonly')
{
	window.document.getElementById(idInput).removeAttribute('readonly');
	window.document.getElementById(idInput).setAttribute("style", "border:1px solid #000;");
}
else
{
	window.document.getElementById(idInput).setAttribute('readonly', 'readonly');
	window.document.getElementById(idInput).removeAttribute("style");
}

}

