$(document).ready(function(){ 	
	$('a.avec-submenu','#menu-references-portfolio').css('cursor','pointer').click(function () {
        $('ul.sub-nav-list').removeClass('open');           //replie tous les menus
		$(this).next('ul.sub-nav-list').addClass('open');   //deplie le menu clique
		InitMenu();
	});
	
	$('#acceuil-context').innerfade({
		animationtype: 'fade',
		speed: 'normal',
		timeout: 11000, //18000,   //22000, //4000,
		type: 'sequence'  //type: 'random'
	});
	
	$('a','#menu-list-actu').click(function(){
		/*href = $(this).attr('href').replace('#','');
		$('.bloc-actu','#bloc-actu').removeClass('activ');
		$('#'+href).addClass('activ');
		InitNews();*/
		
	});
	
	
	InitMenu();
	//InitNews();
});

function InitNews(){
	$('.bloc-actu','#bloc-actu').each(function(){
		if ($(this).hasClass("activ")){
			// $(this).show();
			$(this).fadeIn("slow");
		} else{
			if ($(this).is(":visible")) {
				$(this).fadeOut("fast");
			}
			// $(this).hide();
		}
	});
}

function InitMenu(){
	$('ul.sub-nav-list','#menu-references-portfolio').each(function(){
		if ($(this).hasClass("open")){
			$(this).show();
			// $(this).slideDown();
		} else{
			$(this).hide();
		}
	});
}