// JavaScript Document

function init_accueil() {
	var $news = $('#news-ticker');//we'll re use it a lot, so better save it to a var.
	$news.serialScroll({
		items:'li',
		duration:1000, 
		force:true,
		cycle:true,
		axis:'y',
		easing:'linear',
		lazy:true,// NOTE: it's set to true, meaning you can add/remove/reorder items and the changes are taken into account.
		interval:6000, // yeah! I now added auto-scrolling
		step:1 // scroll 2 news each time
	});	

	//$("#header, #main_nav, #side, #poles_nav").hide();
	
	$("#conteneur").css('visibility','visible');
	show_accueil();
	
}

// GESTION DU FLASH

function show_accueil() {
	/*$("#header").show('drop',{direction: 'up' },1000);
	$("#main_nav").show('drop',{direction: 'down' },1000);
	$("#side").show('drop',{direction: 'down' },1000);
	$("#footer").show('drop',{direction: 'down' },1000);*/
	
	//setTimeout("cache_flash()",1000);
	
	$('#btn_menu_fermer,#barre_menu_left').hide();
	open_menu_accueil();
	open_colonne_accueil();
}
/*
function cache_flash() {
	
	$("#poles_nav").show();
	$("#conteneur_flash").css('display','none');
}*/

function lance_intro() {
	// normalement elle se lance par défaut
	//$("#footer").hide();
}

function skip_intro() {
	//cache_flash();
	//show_accueil();
}

function open_menu_accueil() {
	
	$("#left_menu").stop().animate({ 
        left:0
    }, 800, function () {
		//timer_footer_1 = setTimeout("close_menu()",4000); /* Se replie au bout de 4sec si le on mouse move ne se declenche pas */;
		
	});
}

function flash_step1() {
	//open_colonne_accueil();
}

function open_colonne_accueil() {
	$("#colonne_accueil").css('margin-left',-500); // on décale (pour la page d'accueil)
	$("#colonne_accueil").stop().animate({ 
        marginLeft:240
    }, 800);
}

//$(document).ready(function(){
function windowReady_local() {
	$("#conteneur").css('visibility','hidden');
	init_accueil();
		
	
	//hash_en_cours = document.location.hash.substring(1);
	/*
	if(document.location.hash.substring(1) == "intro") {
		//lance_intro()
		show_accueil();
	} else {
		//skip_intro();
		show_accueil();
	}*/
}
//});




