function getElementsByClass(node,searchClass,tag) {
	var classElements = new Array();
	var els = node.getElementsByTagName(tag); // use "*" for all elements
	var elsLen = els.length;
	var pattern = new RegExp("\\b"+searchClass+"\\b");
	for (i = 0, j = 0; i < elsLen; i++) {
		if ( pattern.test(els[i].className) ) {
			classElements[j] = els[i];
			j++;
		}
	}
	return classElements;
}
function displayBlock(blockId, nomClass,balise) { 
	var currBlock = document.getElementById(blockId);
	var currTitle = document.getElementById("titre_" + blockId.toString());
	var allTheBlocks = getElementsByClass(document,nomClass,balise);
	var allTheTitles = getElementsByClass(document,"spip_menu","div");
	
	if (currBlock.style.display == "none"){
			currBlock.style.display = "block";
			currTitle.style.backgroundColor = "#A0AFAD";
			currTitle.style.color = "#FFF";
			currTitle.style.cursor = "pointer";
	}else{
			currBlock.style.display = "none";
			currTitle.style.backgroundColor = "#BBC5C3";
			currTitle.style.color = "#000";
	}    
	
	
	
	// Hide the other elements if not the current one
	for (i=0; i < allTheBlocks.length; i++){
		if (allTheBlocks[i]!=document.getElementById(blockId)) {
			allTheBlocks[i].style.display = "none";
			allTheTitles[i].style.backgroundColor = "#BBC5C3";
			allTheTitles[i].style.color = "#000";
		}
	}
	
}