/**
 * JS
 * @author Darío Ruellan <druellan@ecimtech.com>
 * @copyright ecimTech 2009
 */

$(function()
{
	// Cacheamos
	var mainmap = $("#map img.mainmap");
	var areas = $("#map .areas a");
	
	// Iniciammos tooltips
	$(areas).each(function()
	{
		if ( $(this).hasClass("north") )
			var grav = "n";
		if ( $(this).hasClass("east") )
			var grav = "e";
		if ( $(this).hasClass("west") )
			var grav = "w";
		if ( $(this).hasClass("south") )
			var grav = "s";
		$(this).tipsy(
		{
			fade: true,
			gravity: grav
		});
	});
	
	// Armamos lógica del mapejo
	$(areas).hover(function()
	{
		$(this).show();
		$(mainmap).add(areas).not(this).stop(true).animate({ opacity: 0.3 }, "fast");
	}, function()
	{
		$(mainmap).add(areas).not(this).animate({ opacity: 1 }, "normal");
	});
	
});
