$(document).ready(function(){
	var idName, cheminImgSrc, cheminImgAlt = "";
	
	function showSubMenu(className)
	{
		if($("div."+escape(className)).css("display") == "none") 
		{
			$("div.sub_menu").hide();	
			$("div."+escape(className)).show();		
		}else
		{
			$("div.sub_menu").hide();		
		}
		
		if(className == "anim")
		{
			$("a[rel='rel_"+escape(className)+"']").colorbox({
				slideshowStart:"Lancer le diapo",
				slideshowStop:"Arrêter le diapo",
				current:"Animation {current} sur {total}",
				previous:"Précédent",		
				next:"Suivant",
				close:"Fermer",
				transition:"fade",
				inline:true,
				slideshow:false
			});	
		}else
		{
			$("a[rel='rel_"+escape(className)+"']").colorbox({
				slideshowStart:"Lancer le diapo",
				slideshowStop:"Arrêter le diapo",
				current:"{title} {current} sur {total}",
				previous:"Précédent",		
				next:"Suivant",
				close:"Fermer",
				transition:"fade",
				title: false,
				slideshow:false
			});	
		}		
	}
	
	$("#menu_principal li a").click(function(){
		idName = $(this).attr("id");
		showSubMenu(idName);
	});
	
	$("img.min").live("mouseover", function(){
		cheminImgAlt = $(this).attr("alt");
		cheminImgSrc = $(this).attr("src");
		$(this).attr("src", cheminImgAlt);
		$(this).attr("alt", cheminImgSrc);
	}).live("mouseout", function(){
		cheminImgAlt = $(this).attr("alt");
		cheminImgSrc = $(this).attr("src");
		$(this).attr("src", cheminImgAlt);
		$(this).attr("alt", cheminImgSrc);
	});
});
