// JavaScript Document
function affiche_evenement(elem, indice_jour)
{
	if(document.form_hidden.total_timestamps.value != "")
	{
		tab = document.form_hidden.total_timestamps.value.split('-');
		nb_sections = (tab.length/2);
		cpt = 0;
		while(cpt < tab.length)
		{
			nom_select = document.getElementById('form_affiche_' + tab[cpt]);
			nom_select.style.display = 'none';
			cpt = cpt + 2;
		}
		// elem est soit égal au timestamp de l'événement, soit égal à "aucun"
		cpt = 0;
		while(cpt < tab.length)
		{
			if(elem != "aucun" && indice_jour == tab[cpt+1])
			{
				nom_select = document.getElementById('form_affiche_' + tab[cpt]);
				nom_select.style.display = 'block';
			}
			cpt = cpt + 2;
		}
	}
}

function acces_direct()
{
	nro_page = document.form.nro_page.value;
	annee = document.form.select_date_annee.value;
	mois = document.form.select_date_mois.value;
	if(mois < 10)
	{
		mois = "0" + mois;
	}
	window.location.replace("index.php?page=" + nro_page + "&select_date=" + annee + mois);
}

function affiche_ajout_evenement(annee, mois, jour)
{
	form_affiche_ajout = document.getElementById('form_ajout');
	if(form_affiche_ajout.style.display == 'none')
	{
		form_affiche_ajout.style.display = 'block';
	}
	document.form_ajout.select_date_jour.value = jour;
	document.form_ajout.select_date_mois.value = mois;
	document.form_ajout.select_date_annee.value = annee;
	if(document.form_hidden.total_timestamps.value != "")
	{
		tab = document.form_hidden.total_timestamps.value.split('-');
		nb_sections = (tab.length/2);
		cpt = 0;
		while(cpt < tab.length)
		{
			nom_select = document.getElementById('form_affiche_' + tab[cpt]);
			nom_select.style.display = 'none';
			cpt = cpt + 2;
		}
	}
}
