// JavaScript Document
$(document).ready( function(){
	
	// Fade du menu 
	$(".menu").children("li").hover(
		
            function(){
				var that = $(this);
                $(that).children("ul").css("display","block");
				if(!$(that).hasClass('current-menu-item')){
					 $(that).addClass('current-menu-item');
				}
				
            },
            function(){
				var that = $(this);
                $(that).children("ul").fadeOut('slow', function(){
					if(!$(that).hasClass('current_page_item')){
						$(that).removeClass('current-menu-item')
					}
					});
			}
    );
	
	// Scroll to Top
	$('.line_block .block:last').last().css('margin-right','0');
	$('a[href=#top_site]').click(function(){
                       $('html, body').animate({scrollTop:0}, 'slow');
                       return false;
    });
	$("#location_search_form input").removeAttr('value');
	
	// Affiché le champ de résultats des lieux
	 $("#location_search_form").submit(function() {
      if (($("#location_search_city_field").val() != "") || ($("#location_search_address_field").val() != "")) {
		console.log('ok');
        $('#list_restaurant').show('fast');
        return true;
      }
	  else {
		console.log($("#location_search_form input").val());
		$('#list_restaurant').hide('fast'); 
		return false;
	  }
    });
});


