var headline_count;
var headline_interval;
var current_headline = 0;
var old_headline = 0;

var taille_texte = 8.5;

function changerTaille(modif) {
	taille_texte = taille_texte + modif;
	document.getElementById("ventre_droit").style.fontSize = taille_texte + "pt";
}


$(document).ready( function () {

	// second simple Accordion with special markup
	jQuery('#navigation').Accordion({
		active: false,
		header: '.head',
		alwaysOpen: false,
		navigation: true
	});
	
	// bind to change event of select to control first and seconds accordion
	// similar to tab's plugin triggerTab(), without an extra method
	jQuery('#switch select').change(function() {
		jQuery('#navigation').activate( this.selectedIndex-1 );
	});
	jQuery('#close').click(function() {
		jQuery('#navigation').activate(-1);
	});
	jQuery('#switch2').change(function() {
		jQuery('#navigation').activate(this.value);
	});
	
	
	$("a.lire_edito").click(function(){
		if ($("div#edito_bottom").is(":hidden")) {
		$("div#edito_bottom").slideDown("slow");
		} else {
		$("div#edito_bottom").slideUp("slow");
		}
		return false;
	});

	// RORATION DES FLASHS INFO EN PAGE D'ACCUEIL
	headline_count = $("div.headline").size();
	$("div.headline:eq("+current_headline+")").css('top', '5px');

	headline_interval = setInterval(headline_rotate,5000);
	$('#scrollup').hover(function() {
		clearInterval(headline_interval);
	}, function() {
		headline_interval = setInterval(headline_rotate,5000);
		headline_rotate();
	});
	

// OUVERTURE D'UNE THICKBOX LORS D'UN CLIC SUR "ADHESIONS"
	$(".adherer").click( function () {
		tb_show('', 'squelettes/formulaires/form_adhesion.html?TB_iframe=true&height=520&width=460', 'false');
		return false;
	});

	
// OUVERTURE D'UNE THICKBOX LORS D'UN CLIC SUR "NOUS ECRIRE"
	$(".nous_ecrire").click( function () {
		tb_show('', 'squelettes/formulaires/form_ecrire.html?TB_iframe=true&height=500&width=460', 'false');
		return false;
	});
	
	
} ) ;

// FONCTION DE ROTATION DES FLASHS INFO DE LA PAGE D'ACCUEIL
function headline_rotate() {
	current_headline = (old_headline + 1) % headline_count;

	$("div.headline:eq(" + old_headline + ")")
	.animate({top: -200},"slow", function() {
		$(this).css('top', '205px');
	});

	$("div.headline:eq(" + current_headline + ")")
		.animate({top: 5},"slow"); 
		old_headline = current_headline;
}
