// JavaScript Document
function set_text(e)	{
	current_class = $("#mapInfo").attr('class');
	
	// Print link
	
	print_link = $("#closeBar .printDist").attr("href") + '' + e + '&printVersion=true';
	$("#closeBar .printDist").attr("href", print_link)
	//$("#mapInfo #closeBar .printDist").attr("href", print_link);
	//alert($("#closeBar .printDist").attr("href") + '' + e);
	
	// First visit to map
	if(current_class == 'off')	{	
		$("#mapInfo").load("getMapinfo.cfm?id=" + e);
		setTimeout(function()	{	
								if($("#mapInfoWrapper").height() > 450)	{
									$("#mapInfoWrapper").height(450);
									$("#mapInfoWrapper").css("overflow", "scroll");
								}
							 $("#mapInfoWrapper").css("opacity", ".9");
							 $("#mapInfoWrapper").fadeIn("slow");
							 }, '500');
		$("#mapInfo").attr('class', 'active_' + e);
	// You've clicked on a country, and want to click on a new one
	} else {
		splitIt = current_class.split('_');
		new_id = splitIt[1] + '_' + splitIt[2];	
		$("#mapInfoWrapper").fadeOut("slow");
		setTimeout(function()	{
							 $("#mapInfo").html('');
							 $("#mapInfo").load("getMapinfo.cfm?id=" + e, '', function()	{
																					   if($("#mapInfoWrapper").height() > 450)	{
																							$("#mapInfoWrapper").height(450);
																							$("#mapInfoWrapper").css("overflow", "scroll");
																						}
																					   $("#mapInfoWrapper").fadeIn("slow");
																					   });							 
							 }, '500');
		$("#mapInfo").attr('class', 'active_' + e);		
	}
}
$(document).ready(function()	{
	$(".closeBtn").click(function(e)	{							  
							   e.preventDefault();
							   $("#mapInfoWrapper").fadeOut("slow");
							   });
});
