function mouseOverHandler()
{
	var tooltip = $('.placeInfo-' + $(this).attr('class'));
	if ($.browser.msie)
	{
		tooltip.show();
	}
	else
	{
		tooltip.css({display: 'block'});
		tooltip.stop(true).fadeTo(200, 1);
	}
	$('#mapDirections').stop(true).fadeOut(1000);
}

function mouseOutHandler()
{
	var tooltip = $('.placeInfo-' + $(this).attr('class'));
	if ($.browser.msie)
	{
		tooltip.hide();
	}
	else
	{
		tooltip.fadeOut(300, resetOpacity);
	}
}

function resetOpacity()
{
	$(this).css({opacity: 0});
}

function clickHandler()
{
	return false;
}

function showDirections()
{
	var src = $.browser.msie ? '/images/area-map/directions.gif' : '/images/area-map/directions.png';
	var img = new Image(200, 96);
	img.src = src;
	img = $(img);
	img
	.attr({'id': 'mapDirections',title:'Click to hide'})
	.css({cursor:'pointer', zIndex: 500})
	.click(function(){
			$(this).stop().fadeOut(1000)
	})

	$('#location-area-map-content-area').append(img);
	img.fadeIn(500).fadeTo(3000, 1).animate({backgroundPosition: 0}, 2500).fadeOut(1000);
}

function documentReadyHandler()
{
	showDirections();
	$('area').mouseover(mouseOverHandler).mouseout(mouseOutHandler).click(clickHandler);
	
	if (!$.browser.msie)
	{
		$('.placeInfo').css({opacity: 0});
	}
}

$(document).ready(documentReadyHandler);