$(document).ready(function(){
	// menu
	$('#menu li.frst_lv').hover(
		function(){
			$(this).children('ul:hidden').slideDown(150);
			$(this).children('a').css("color", "#ccc");
						
			}
		,
		function(){
			$(this).children('ul:visible').slideUp(50);
			$(this).children('a').css("color", "#000");
						
			}
		);
		

	// Charger l'agenda 
	$("#agenda").load("spip.php?page=agenda_perso");
	
	// gallerie 
	// le hover sur les vignettes 
	$('#documents_portfolio #tt_tips li').css({opacity:0.7});
	$('#documents_portfolio #tt_tips li').hover(function(e){
		//e.preventDefault();
		$(this).css({opacity:1});
		//if ($(this).children('div').html() != ' '){		
		$(this).children('div:not(:empty)').show(); //}
		},
		function(){
		$(this).css({'opacity':0.7});
		$(this).children('div').hide();
		}
		);
	
			
	$('#documents_portfolio a').fancybox({
		'titlePosition' 		: 'inside'		
		});
	
	//$('#defil_box marquee').marquee();
	$('div#defil_box marquee').marquee('pointer').mouseover(function () {
		  $(this).trigger('stop');
		}).mouseout(function () {
		  $(this).trigger('start');
		}).mousemove(function (event) {
		  if ($(this).data('drag') == true) {
		    this.scrollLeft = $(this).data('scrollX') + ($(this).data('x') - event.clientX);
		  }
		}).mousedown(function (event) {
		  $(this).data('drag', true).data('x', event.clientX).data('scrollX', this.scrollLeft);
		}).mouseup(function () {
		  $(this).data('drag', false);
		});

	$('#diaporama_innerfade').innerfade({ 
				'speed'				: 800, 
				'timeout'			: 3500, 
				'type'				: 'sequence',
				'containerheight'	: '389px' 
				});
			

});


function chg(arg){
		var url ="spip.php?page=agenda_perso&date="+arg;
		$("#agenda").load(url);
	}
