// JavaScript Document
//jquery
$(document).ready(function() {
	$("#navigation li:last").css("width","138px");
	
	//fix les class pour les tableau s'il est pair ou impair
	$("#content tbody tr:odd").addClass("odd");
	$("#content tbody tr:even").addClass("even");
	
	//cahnge le background de header
	var tabBackground = ["header.jpg","header-blue.jpg","header-jaune.jpg","header-rose.jpg","header-turquoise.jpg"];
	var nbre = Math.floor(Math.random() * tabBackground.length);
	$("#header").css({backgroundImage:"url(/css/images/"+tabBackground[nbre]+")"});
});

$(function() {
	$('a[rel*=lightbox]').lightBox();
});

function searchReset() {
	document.getElementById("search").value ="";
}

function displayBox(name,idBox,nbreBox) {
	var box = document.getElementById(name+idBox);
	
	for(var i=0; i <= nbreBox; i++) {
			document.getElementById(name+i).style.display='none';
	}
	
	box.style.display ='block';
}