/* Author: Dominique De Brandt */

$(window).load(function() {
});
$(document).ready(function(){
/*	$('.nav_enseignants').hover(
		function() {
			$(this).stop().animate({backgroundColor: '#ffffff', color: '#0C1975'}, 'fast');
		}, 
		function() {
			if (!$(this).hasClass('bottom_nav_selected')) {
				$(this).stop().animate({backgroundColor: '#0C1975', color: '#ffffff'}, 'fast');
			}
		}
	);
	$('.nav_kt').hover(
		function() {
			$(this).stop().animate({backgroundColor: '#ffffff', color: '#FF0093'}, 'fast');
		}, 
		function() {
			if (!$(this).hasClass('bottom_nav_selected')) {
				$(this).stop().animate({backgroundColor: '#FF0093', color: '#ffffff'}, 'fast');
			}
		}
	);
	$('.nav_jeunes').hover(
		function() {
			$(this).stop().animate({backgroundColor: '#ffffff', color: '#00AACC'}, 'fast');
		}, 
		function() {
			if (!$(this).hasClass('bottom_nav_selected')) {
				$(this).stop().animate({backgroundColor: '#00AACC', color: '#ffffff'}, 'fast');
			}
		}
	);
	$('.nav_msm').hover(
		function() {
			$(this).stop().animate({backgroundColor: '#ffffff none no-repeat', color: '#F47836'}, 'fast');
		}, 
		function() {
			if (!$(this).hasClass('bottom_nav_selected')) {
				$(this).stop().animate({backgroundColor: '#F47836 url(img/fond_nav_msm.png) no-repeat', color: '#ffffff'}, 'fast');
			}
		}
	);*/
	$('.flexslider').flexslider({
		directionNav: false,
		controlNav: false
	});
	//slideMenu.build('sm',720,10,10,1);
	/*
	1er: l'id de la liste, 
	2ème: largeur de l'accordéon (en pixels)
	3ème: délais de vitesse d'appel de la fonction de glissement
	4ème: vitesse de l'animation (1 étant le plus rapide)
	5ème: numéro de la liste à ouvrir par défaut
	*/
	$('.nav_btn').each(
		function() {
			$(this).hover(
				function() {
					$(this).stop().animate({backgroundColor: '#A7A9AC', color: '#ffffff'}, 'fast');
				}, 
				function() {
					if (!$(this).hasClass('bottom_nav_selected')) {
						$(this).stop().animate({backgroundColor: '#ffffff', color: '#4b4b4b'}, 'fast');
					}
				}
			);
		}
	);
	$('#news').hover(
		function() {
			$('.nav_news').addClass('bottom_nav_selected');
			$('#listeNews').fadeIn('fast');
		}, 
		function() {
			$('.nav_news').removeClass('bottom_nav_selected').stop().animate({backgroundColor: '#ffffff', color: '#4b4b4b'}, 'fast');
			$('#listeNews').fadeOut('fast');
		}
	);
	$('#programmes').hover(
		function() {
			$('.nav_programmes').addClass('bottom_nav_selected');
			$('#listeProgrammes').fadeIn('fast');
		}, 
		function() {
			$('.nav_programmes').removeClass('bottom_nav_selected').stop().animate({backgroundColor: '#ffffff', color: '#4b4b4b'}, 'fast');
			$('#listeProgrammes').fadeOut('fast');
		}
	);
	$('#dossiers').hover(
		function() {
			$('.nav_dossiers').addClass('bottom_nav_selected');
			$('#listeDossiers').fadeIn('fast');
		}, 
		function() {
			$('.nav_dossiers').removeClass('bottom_nav_selected').stop().animate({backgroundColor: '#ffffff', color: '#4b4b4b'}, 'fast');
			$('#listeDossiers').fadeOut('fast');
		}
	);
	$('article.news').each(function() {
		$(this).hover(
			function() {
				$(this).stop().animate({backgroundColor: '#E7E8E8'}, 'fast');
			}, 
			function() {
				if (!$(this).hasClass('bottom_nav_selected')) {
					$(this).stop().animate({backgroundColor: '#ffffff'}, 'fast');
				}
			}
		);
	});
	/*$('.nav_enseignants').hover(
		function() {
			$(this).fadeOut();
		}, 
		function() {
			$(this).fadeIn();
		}
	)*/
});

function voirPlus(voir, contenu) {
	$('#'+contenu+'').slideToggle('fast');
}

function afficherJeux() {
	document.getElementById('jeux').style.display = 'block';
}
function masquerJeux() {
	document.getElementById('jeux').style.display = 'none';
}

function popup(adresse) {
	winl = (screen.width - 1000) / 2;
	wint = (screen.height - 770) / 2;
	window.open(adresse,'','toolbar=0,location=0,directories=0,status=0,scrollbars=0,resizable=0,menuBar=0,top='+wint+',left='+winl+',width=1000,height=770')
}

