function show(id) {
	close_all_menu();
	if ($('sm' + id).style.display == 'none') {
		$('sm' + id).blindDown();
		$('i' + id).src = 'images/arrow_down.gif';
	}
}

function close_all_menu() {
	for(i = 1; i < 100; i++) {
		if ($('sm' + i) != undefined) {
			if ($('sm' + i).style.display != 'none') {
				$('sm' + i).blindUp();
				$('i' + i).src = 'images/arrow_right.gif';
			}
		}
	}
}

function show_topic(topic) {
	$('topics').update('<center><img src="images/ajax-loader.gif" border=0/></center>');
	var url = 'pages/getAllArticlesFromTopic.php?topic=' + topic;
	new Ajax.Request(url, { method: 'post', onSuccess: function (transport) {
		                                                   var ret = eval(transport.responseText);
		                                                   var txt = '';
		                                                   if (ret.length == 0) {
		                                                      txt = "<div style='color:white;'>Il n'y a aucun article dans cette rubrique. Veuillez revenir plus tard pour voir si un article a été écrit.</div>";
		                                                   } else {
		                                                      for(i = 0; i < ret.length; i++) {
		                                                         formated_date = ret[i][0].substr(8, 2) + '/' + ret[i][0].substr(5, 2) + '/' + ret[i][0].substr(0, 4);
		                                                         txt = txt + "<div style='margin-bottom:10px; color:white;'>" + formated_date + " - <b>" + ret[i][1] + "</b></div><div style='color:white;'>" + ret[i][2] + "</div><div style='clear:both; border-bottom:2px dashed #999; margin-bottom:10px; color:white;'>Tags : " + ret[i][3] + "</div>";
		                                                      }
		                                                   }
		                                                   $('topics').update(txt);
	                                                   } });
}
