var sm_is_in_box = false;
var sm_is_over_text = false;
	
$jQ(function() {
	$jQ("#footer_site_map")
	.mouseenter(function() { sm_is_over_text=true; showFooter(); })
	.mouseleave(function() { sm_is_over_text=false; hideCheck(); });
	
	$jQ(".div_site_map")
	.mouseenter(function() { sm_is_in_box=true; })
	.mouseleave(function() { sm_is_in_box=false; hideCheck(); });
	
	function showFooter()
	{
		$jQ(".div_site_map").css({ top: "-"+$jQ(".div_site_map").outerHeight()+"px", left:0 }).show();
	}
	
	function hideCheck()
	{
		setTimeout("hideFooter()", 500);
	}
	
	if ($jQ(".prj").length > 0)
	{
		var classToAdd = '';
		
		if ($jQ(".cote").length > 0)
			classToAdd = 'cote';
		else if ($jQ(".bagot").length > 0)
			classToAdd = 'bagot';
		else if ($jQ(".versants").length > 0)
			classToAdd = 'versants';
		else if ($jQ(".val").length > 0)
			classToAdd = 'val';
			
		$jQ(".td_content_zone_center").addClass(classToAdd);
	}
});

function hideFooter()
{
	if (!sm_is_in_box && !sm_is_over_text)
	{
		$jQ(".div_site_map").hide();
	}
}
