$(document).ready(function() {
						   
	// Settings for the script
	var animation_speed = "slow";
	var curpage = "asia";
//Menu Click Functions

//Asia
	$("#tab_asia").click(function(){
		window.curpage = "asia";
		$("#lcont").fadeOut("slow");
		$("#rights").attr('style', 'background-image:url(/images/locations/asmain.png)');
		
		$(".lmnu").each(function(){
			// Loop through all items with the class of menu
			$(this).attr('src', '/images/'+this.id+'.png');
		});
		
		
		$("#lcont").load("/includes/asia.php",function(){
						$("#lcont").fadeIn("slow");
					});
		
		$('#tab_asia').attr('src', '/images/tab_asia_on.png');
	});
	
//South America
	$("#tab_samerica").click(function(id){
		window.curpage = "samerica";
		$("#lcont").fadeOut("slow");
		
		$("#rights").attr('style', 'background-image:url(/images/locations/samain.png)');

		$(".lmnu").each(function(){
			// Loop through all items with the class of menu
			$(this).attr('src', '/images/'+this.id+'.png');
		});		
		$("#lcont").load("/includes/samerica.php",function(){
						$("#lcont").fadeIn("slow");
					});
		
		$("#tab_samerica").attr('src', '/images/tab_samerica_on.png');
	});
	
//Antarctica
	$("#tab_antarctica").click(function(id){
		window.curpage = "antarctica";
		$("#lcont").fadeOut("slow");
		
		$("#rights").attr('style', 'background-image:url(/images/locations/antmain.png)');
		
		$(".lmnu").each(function(){
			// Loop through all items with the class of menu
			$(this).attr('src', '/images/'+this.id+'.png');
		});		
		$("#lcont").load("/includes/antarctica.php",function(){
						$("#lcont").fadeIn("slow");
					});
		
		$("#tab_antarctica").attr('src', '/images/tab_antarctica_on.png');
	});
	
//Arctic
	$("#tab_arctic").click(function(id){
		window.curpage = "arctic";
		$("#lcont").fadeOut("slow");
		$("#rights").attr('style', 'background-image:url(/images/locations/arcmain.png)');
		
		$(".lmnu").each(function(){
			// Loop through all items with the class of menu
			$(this).attr('src', '/images/'+this.id+'.png');
		});
		
		$("#lcont").load("/includes/arctic.php",function(){
						$("#lcont").fadeIn("slow");
					});
		
		$("#tab_arctic").attr('src', '/images/tab_arctic_on.png');
	});
	
//North America
	$("#tab_namerica").click(function(id){
		window.curpage = "namerica";
		$("#lcont").fadeOut("slow");
		
		$("#rights").attr('style', 'background-image:url(/images/locations/namain.png)');
		
		$(".lmnu").each(function(){
			// Loop through all items with the class of menu
			$(this).attr('src', '/images/'+this.id+'.png');
		});
		
		$("#lcont").load("/includes/namerica.php",function(){
						$("#lcont").fadeIn("slow");
					});
		
		$("#tab_namerica").attr('src', '/images/tab_namerica_on.png');
	});
	
//Europe
	$("#tab_europe").click(function(id){
		window.curpage = "europe";
		$("#lcont").fadeOut("slow");
		
		$("#rights").attr('style', 'background-image:url(/images/locations/eumain.png)');
		
		$(".lmnu").each(function(){
			// Loop through all items with the class of menu
			$(this).attr('src', '/images/'+this.id+'.png');
		});
		
		$("#lcont").load("/includes/europe.php",function(){
						$("#lcont").fadeIn("slow");
					});
		
		$("#tab_europe").attr('src', '/images/tab_europe_on.png');
	});
	
//Africa
	$("#tab_africa").click(function(id){
		window.curpage = "africa";
		$("#lcont").fadeOut("slow");
		$("#rights").attr('style', 'background-image:url(/images/locations/afmain.png)');
		
		$(".lmnu").each(function(){
			// Loop through all items with the class of menu
			$(this).attr('src', '/images/'+this.id+'.png');
		});
		
		$("#lcont").load("/includes/africa.php",function(){
						$("#lcont").fadeIn("slow");
					});
		
		$("#tab_africa").attr('src', '/images/tab_africa_on.png');
	});
	
//Australia
	$("#tab_australia").click(function(id){
		window.curpage = "australia";
		$("#lcont").fadeOut("slow");
		$("#rights").attr('style', 'background-image:url(/images/locations/ausmain.png)');
		
		$(".lmnu").each(function(){
			// Loop through all items with the class of menu
			$(this).attr('src', '/images/'+this.id+'.png');
		});
		
		$("#lcont").load("/includes/australia.php",function(){
						$("#lcont").fadeIn("slow");
					});
		
		$("#tab_australia").attr('src', '/images/tab_australia_on.png');
	});
	
	//Asia
	
		$("#tab_asia").hover(function(){
		$("#tab_asia").attr('src', '/images/tab_asia_on.png');
		},
		function(){
		$("#tab_asia").attr('src', '/images/tab_asia.png');
		$("#tab_"+window.curpage+"").attr('src', '/images/tab_'+window.curpage+'_on.png');
		});
	
		
	//South America

		$("#tab_samerica").hover(function(){
		$("#tab_samerica").attr('src', '/images/tab_samerica_on.png');
		}, 
		function(){

		$("#tab_samerica").attr('src', '/images/tab_samerica.png');
		$("#tab_"+window.curpage+"").attr('src', '/images/tab_'+window.curpage+'_on.png');

		});
		
	//Antarctica

		$("#tab_antarctica").hover(function(){
		$("#tab_antarctica").attr('src', '/images/tab_antarctica_on.png');
		}, 
		function(){

	$("#tab_antarctica").attr('src', '/images/tab_antarctica.png');
		$("#tab_"+window.curpage+"").attr('src', '/images/tab_'+window.curpage+'_on.png');

	});
	
	//Arctic

		$("#tab_arctic").hover(function(){
		$("#tab_arctic").attr('src', '/images/tab_arctic_on.png');
		}, 
		function(){

		$("#tab_arctic").attr('src', '/images/tab_arctic.png');
			$("#tab_"+window.curpage+"").attr('src', '/images/tab_'+window.curpage+'_on.png');

		});
	
	//North America

		$("#tab_namerica").hover(function(){
		$("#tab_namerica").attr('src', '/images/tab_namerica_on.png');
		}, 
		function(){

		$("#tab_namerica").attr('src', '/images/tab_namerica.png');
		$("#tab_"+window.curpage+"").attr('src', '/images/tab_'+window.curpage+'_on.png');

		});
	
	//Europe


		$("#tab_europe").hover(function(){
		$("#tab_europe").attr('src', '/images/tab_europe_on.png');
		}, 
		function(){
		$("#tab_europe").attr('src', '/images/tab_europe.png');
		$("#tab_"+window.curpage+"").attr('src', '/images/tab_'+window.curpage+'_on.png');

		
	});
	
	//Africa & Middle East


		$("#tab_africa").hover(function(){
		$("#tab_africa").attr('src', '/images/tab_africa_on.png');
		}, 
		function(){
		$("#tab_africa").attr('src', '/images/tab_africa.png');
		$("#tab_"+window.curpage+"").attr('src', '/images/tab_'+window.curpage+'_on.png');

		});
	
	//Australia Pacific


		$("#tab_australia").hover(function(){
		$("#tab_australia").attr('src', '/images/tab_australia_on.png');
		}, 
		function(){
		$("#tab_australia").attr('src', '/images/tab_australia.png');
		$("#tab_"+window.curpage+"").attr('src', '/images/tab_'+window.curpage+'_on.png');


		});
	
	
	
	
});

