// JavaScript Document

function maphover(map,image){
	$('#'+map+' area').each(function(){
		$(this).mouseover(function(){
			coords = $(this).attr("coords").split(",");
			style = "position:absolute;";
			topPos = parseInt($('#'+image).position().top);
			leftPos = parseInt($('#'+image).position().left);
			leftoffset = ((280-Math.abs(parseInt(coords[2]) - parseInt(coords[0])))/2)*-1;
			
			style += "width:280px; border:4px solid #052f4d; padding:8px; background-color:#fff;";
			style += "top:"+(topPos+parseInt(coords[3]))+"px;";
			style += "left:"+(leftPos+parseInt(coords[0])+leftoffset)+"px;";			
			$('#'+image).parent().append("<div id=\"map-hover\" style=\""+style+"\"><p style=\"text-align:center;\">loading...</p></div>");
			$('#map-hover').load("/getContent.php?id="+$(this).attr("alt"),function(){
				imageFrame('#map-hover');
				imageFrameThin('#map-hover');
			});
		});
		$(this).mouseout(function(){
			$('#map-hover').remove();
		});
	});
}
