$(document).ready(function(){
	/**
	 * Affichage du menu général (haut)
	 */
	$('.espace_deploiement').hide();

	$('#espacepro').hover(function() {
		$(this).children('.espace_deploiement').slideToggle('800');
	});

	$('#espacepart').hover(function() {
		$(this).children('.espace_deploiement').slideToggle('800');
	});

	/**
	 * Initialisation du menu
	 * Il y a un bug avec IE6 sur le deuxième niveau
	 */
	$('#menu').find('ul').parent().each(function(){
		var submenu = $(this).find('ul:eq(0)');
		var alink = $(this).find('a:eq(0)');
		$(this).hover(
			function(){
				submenu.fadeIn('fast');
			},
			function(){
				submenu.fadeOut('fast');
			}
		);
	});

	/**
	 * Gestion du formulaire de newsletter
	 */
	var mailings_email = $('#mailings_email').attr('value');
	var mailings_societe= $('#mailings_societe').attr('value');
	var mailings_codepostal = $('#mailings_codepostal').attr('value');
	$('#mailings_email').click(function() {
		$(this).attr('value', '');
	});
	$('#mailings_email').blur(function() {
		if ($(this).attr('value')=='') {
			$(this).attr('value', mailings_email);
		}
	});
	$('#mailings_societe').click(function() {
		$(this).attr('value', '');
	});
	$('#mailings_societe').blur(function() {
		if ($(this).attr('value')=='') {
			$(this).attr('value', mailings_societe);
		}
	});
	$('#mailings_codepostal').click(function() {
		$(this).attr('value', '');
	});
	$('#mailings_codepostal').blur(function() {
		if ($(this).attr('value')=='') {
			$(this).attr('value', mailings_codepostal);
		}
	});
});

