// JavaScript Document

window.addEvent('domready', function() {
    var toggler = $$('.suite');
	var element = $$('.com-actu');
	
	var AccordionObject = new Accordion(toggler, element, {
	show: 'none',
	height : true,
	width : false,
	opacity: false,
	fixedHeight: false, 
	fixedWidth: false,
	alwaysHide: true
	});
	
	var toggler2 = $$('.b-missions');
	var element2 = $$('.txt-missions');
	
	var AccordionObject = new Accordion(toggler2, element2, {
	show: 0,
	height : true,
	width : false,
	opacity: false,
	fixedHeight: false, 
	fixedWidth: false,
	alwaysHide: true
	});
	
	var toggler3 = $$('.accomp');
	var element3 = $$('.txt-accomp');
	
	var AccordionObject = new Accordion(toggler3, element3, {
	show: 'none',
	height : true,
	width : false,
	opacity: false,
	fixedHeight: false, 
	fixedWidth: false,
	alwaysHide: true
	});
});

function afficheListeCom(idArticle) {
	var option = {  url: "/ajax/div_commentaire.php?article="+idArticle,
					method : 'get' ,
					update: $('div_comment3'),
					success: showDivCommentaire(),
					evalScripts: true
	};
	var requestPanier= new Request.HTML( option );
	requestPanier.send();
}

function ajoutCom(idArticle) {
	var option = {  url: "/ajax/div_ajout_commentaire.php?article="+idArticle,
					method : 'get' ,
					update: $('div_comment3'),
					success: showDivCommentaire(),
					evalScripts: true
	};
	var requestPanier= new Request.HTML( option );
	requestPanier.send();
}


function showDivCommentaire() {
	$('Layer_comment').style.visibility='visible';
}

function cacheDivCommentaire() {
	$('Layer_comment').style.visibility='hidden';
}