$(document).ready(function() {

	$("#carteform").validate();


	$('#slider').nivoSlider({pauseTime:5000});

	$("#logos-rest a:not(.active)").hover(function(){
    	$(this).filter(':not(:animated)').fadeTo('slow', 0.33);
	}, function() {
    	$(this).fadeTo('slow', 1);
	});
	
	$('#slideshow ul li a').fadeTo('fast', 0.66);
	
	$("a.fancy").fancybox({
		'centerOnScroll': true,
		'overlayOpacity': 0.5,
		'overlayColor': '#000',
		'margin': 10,
		'titlePosition': 'inside'
	});
	
	//Acordion banner menu de jour _______INICIO____
	$("#div-sugestao,#div-vinhos").hide();
	
	$("#sugestao").toggle(
		function(){
			$("#div-sugestao").slideDown("normal");
			$("#div-vinhos").slideUp("normal");
		},
		function(){
			$("#div-sugestao,#div-vinhos").slideUp("normal");
		}
	);
	
	$("#vinhos").toggle(
		function(){
			$("#div-vinhos").slideDown("normal");
			$("#div-sugestao,").slideUp("normal");
		},
		function(){
			$("#div-sugestao,#div-vinhos").slideUp("normal");
		}
	);
	//Acordion banner menu de jour _______FIM____
	
	
	
	
	//Acordion CARTA DE VINHOS _______INICIO____
	$(".lista-carta div").hide();
	$(".lista-carta h2").css("cursor","pointer")
	
	$(".lista-carta h2").toggle(
		function(){
			$('.lista-carta div').slideUp("normal");
			$(this).next('p').next('div').slideDown("normal");
		},
		function(){
			$(this).next('p').next('div').slideUp("normal");
		}
	);
	
	
	
	
	//Acordion CARTA DE VINHOS _______FIM____
	
	$('marquee').marquee();

	$(".dialog_open").dialog({
		bgiframe: false,
		modal: true,
		autoOpen: true,
		show: 'drop',
		hide: 'drop',
		resizable: false,
		buttons: {
				'Fermer': function() {
					$(this).dialog('close');
				}
		}
		
	});

	$(".dialog_form").dialog({
		bgiframe: false,
		modal: true,
		autoOpen: false,
		show: 'drop',
		hide: 'drop',
		resizable: false,
		buttons: {
				'Envoyer': function() {
					$('#form_recomendar').submit();
				},
				'Fermer': function() {
					$(this).dialog('close');
				}
		}
		
	});

	$("a.bt-recomendar").live('click', function() {
		$('.dialog_form').dialog('open');
	});

	

	/* FORM */

	$('#menu-nav  li:last-child a').css({backgroundImage: 'none'});
	$('#logos-rest  li:last-child  a').css({marginRight: 0});

	//$('.box, .box-bottom, .box-eventos').corner("keep");

	$("#nome_newsletter").attr('value','Votre nom');
	$("#nome_newsletter").blur(function() { if((this.value=='')) this.value='Votre nom'; });
	$("#nome_newsletter").focus(function() { if((this.value=='Votre nom')) this.value=''; });

	$("#email_newsletter").attr('value','Votre adresse e-mail');
	$("#email_newsletter").blur(function() { if((this.value=='')) this.value='Votre adresse e-mail'; });
	$("#email_newsletter").focus(function() { if((this.value=='Votre adresse e-mail')) this.value=''; });

	$("#nome_reserva").attr('value','Nom');
	$("#nome_reserva").blur(function() { if((this.value=='')) this.value='Nom'; });
	$("#nome_reserva").focus(function() { if((this.value=='Nom')) this.value=''; });

	$("#email_reserva").attr('value','E-mail');
	$("#email_reserva").blur(function() { if((this.value=='')) this.value='E-mail'; });
	$("#email_reserva").focus(function() { if((this.value=='E-mail')) this.value=''; });

	$("#telefone_reserva").attr('value','Téléphone');
	$("#telefone_reserva").blur(function() { if((this.value=='')) this.value='Téléphone'; });
	$("#telefone_reserva").focus(function() { if((this.value=='Téléphone')) this.value=''; });

	$("#data_reserva").attr('value','Date');
	$("#data_reserva").blur(function() { if((this.value=='')) this.value='Date'; });
	$("#data_reserva").focus(function() { if((this.value=='Date')) this.value=''; });

	$("#hora_reserva").attr('value','Heure');
	$("#hora_reserva").blur(function() { if((this.value=='')) this.value='Heure'; });
	$("#hora_reserva").focus(function() { if((this.value=='Heure')) this.value=''; });

	$("#pessoas_reserva").attr('value','Nombre de Personnes');
	$("#pessoas_reserva").blur(function() { if((this.value=='')) this.value='Nombre de Personnes'; });
	$("#pessoas_reserva").focus(function() { if((this.value=='Nombre de Personnes')) this.value=''; });

	$("#comentarios_reserva").attr('value','Commentaires');
	$("#comentarios_reserva").blur(function() { if((this.value=='')) this.value='Commentaires'; });
	$("#comentarios_reserva").focus(function() { if((this.value=='Commentaires')) this.value=''; });

});