
$(document).ready(function() {
	$("*.jhidden").fadeOut("slow");
	show_layer();

	// Si on clique sur une ligne dans un tableau
	$(".tab .click").click(
		function() {
			$(this).toggleClass("selected");
		}
	)

    $('.sidebar h3').next('div').hide();
    $(".sidebar h3").click(function () {
        $(this).next('div').toggle();
    });

    $('#gallery>a').lightBox(); //{fixedNavigation:true});
})

/*	Affiche ou cache un calque
 */
function swap_layer(id) {
	var layer = $(document.getElementById(id));
	if (layer.is(':visible')) {
		layer.hide("slow");
	} else {
		layer.show("slow");
	}
}

/*	Affiche tous les calques demandés selon les param passé par l'url (après #)
 */
function show_layer() {
	var prm = new Array();
	var tmp = unescape(window.location.hash).substr(1).split(",");
	var inter;
	for (i = 0; i < tmp.length; i++) {
		if (tmp[i]) {
			var layer = $(document.getElementById(tmp[i]));
			layer.show("slow");
		}
	}
	return i;
}

/*	Créé un popup
 */
function popup(url, option) {
	option = option ? option : 'alwaysRaised=yes,dependent=yes,toolbar=no,height=420,width=800,menubar=no,resizable=yes,scrollbars=yes,status=no';
	window.open(url,'help', option);
}

/*	Désactive un élément en fonction de l'état d'une case à cocher
 */
function test(check, id) {
	elem0 = document.getElementById(check);
	elem1 = document.getElementById(id);
	elem1.disabled = (elem0.checked) ? false : true;
}

/* On récupère l'ID de l'objet
 */
function getID(id) {
	var_nav = (document.getElementById && document.all) ? 'document.all.' + id : 'document.getElementById(\'' + id + '\')';
	return var_nav;
}
