$(document).ready(function() {
						   
	
	// transfer value of click action from menu link to menu block
	$("div.search-restaurant").click(function() {
		if (!($(this).hasClass("linkover"))) { // if clicking on the block but not the link
			window.location.href = $(this).find("a").eq(0).attr("href");
		}
	});
	
	// when the mouse is clicks the link, the click action on the menu block is redundant
	// a class is used as a flag to determine the target of the click
	$("a.morelink").hover(
		function() { $(this).parent().addClass("linkover"); },
		function() { $(this).parent().removeClass("linkover"); }
	);

	// transfer value of click action from menu link to menu block
	$("div.button").click(function() {
		if (!($(this).hasClass("linkover"))) { // if clicking on the block but not the link
			window.location.href = $(this).find("a").eq(0).attr("href");
		}
	});
	
	// when the mouse is clicks the link, the click action on the menu block is redundant
	// a class is used as a flag to determine the target of the click
	$("a").hover(
		function() { $(this).parent().addClass("linkover"); },
		function() { $(this).parent().removeClass("linkover"); }
	);
	});	
