// JavaScript Document
$(document).ready(function(){
	
	//alert("ok");
	$("#navigation ul li a:first").hover(function(){
		//alert("ok");
		$("#content").css("background","url(images/topRoundHomeHover1.png) no-repeat center top");
	},
	function(){
		$("#content").css("background","url(images/topRoundHomeHover.png) no-repeat center top");	
	}
	);
	
	
	$(".blackNavigation ul li a").click(function(){
			var tabClasss = $(this).attr("id");
			$(".blackNavigation ul li a").removeClass("active");
			$(".blackNavigation ul li a").css("color","#FF9933");
			$(".blackNavigation ul li a").css("background","url(images/blackTabBg.png) no-repeat center bottom");
			$(this).css("color","#000000");
			$(this).css("background","url(images/blackTabHover.png) no-repeat center bottom");
			$(this).addClass("active");
			$(".blackArea > div").css("display", "none");
			$("."+tabClasss).css("display", "block");
			if($(this).attr("rel") != "")
			{
				eval($(this).attr("rel") + "()");
			}
			return false;
		});

	// For IE Control
	$(".blackNavigation ul li a").hover(function(){
		if ($(this).hasClass("active")){
			$(this).css("color","#000000");
			$(this).css("background","url(images/blackTabHover.png) no-repeat center bottom");
			}
		else {
			$(this).css("color","#000000");
			$(this).css("background","url(images/blackTabHover.png) no-repeat center bottom");
		}
	});

	$(".blackNavigation ul li a").mouseout(function(){
		if ($(this).hasClass("active")){
			$(this).css("color","#000000");
			$(this).css("background","url(images/blackTabHover.png) no-repeat center bottom");
			}
		else {
			$(this).css("color","#FF9933");
			$(this).css("background","url(images/blackTabBg.png) no-repeat center bottom");
		}
	});
	
	
	
	
	
	
	
	
	
	
	$(".table_show_welling, .table_show_charlton, .table_show_greenwich").attr({"href":"javascript: void(0);"});
	
	$(".table_show_welling").click(function(){
		$(".welling_tables, .welling_h2").hide();
		var table_to_show = $(this).attr('rel');
		$("table#" + table_to_show + ", h2#h2_" + table_to_show).show();
	})
	
	$(".table_show_charlton").click(function(){
		$(".charlton_tables, .charlton_h2").hide();
		var table_to_show = $(this).attr('rel');
		$("table#" + table_to_show + ", h2#h2_" + table_to_show).show();
		
		if($(this).hasClass('a'))
		{
			$("#charlton_map_link_b").hide();
			$("#mapTwoB").hide();
			$("#charlton_image_link_b").hide();
			$("#imageTwoB").hide();
			$("#venue_b").hide();
			
			$("#charlton_map_link_a").show();
			$("#mapTwoA").show();
			$("#charlton_image_link_a").hide();
			$("#imageTwoA").hide();
			$("#venue_a").show();
			
			map_two_a_gmap();
		}
		else
		{
		
			$("#charlton_image_link_a").hide();
			$("#imageTwoA").hide();
			$("#charlton_map_link_a").hide();
			$("#mapTwoA").hide();
			$("#venue_a").hide();
			
			
			$("#charlton_map_link_b").show();
			$("#mapTwoB").show();
			$("#charlton_image_link_b").hide();
			$("#imageTwoB").hide();
			$("#venue_b").show();
			
			map_two_b_gmap();
		}
		
	})
	
	$(".table_show_greenwich").click(function(){
		$(".greenwich_tables, .greenwich_h2").hide();
		var table_to_show = $(this).attr('rel');
		$("table#" + table_to_show + ", h2#h2_" + table_to_show).show();
	})
	
	$("#welling_image_link").click(function(){
		$("#welling_image_link , #imageOne").hide();
		$("#welling_map_link , #mapOne").show();
	})
	
	$("#welling_map_link").click(function(){
		$("#welling_map_link , #mapOne").hide();
		$("#welling_image_link , #imageOne").show();
	})

	$("#charlton_image_link_a").click(function(){
		$("#charlton_image_link_a , #imageTwoA").hide();
		$("#charlton_map_link_a , #mapTwoA").show();
	})

	$("#charlton_map_link_a").click(function(){
		$("#charlton_map_link_a , #mapTwoA").hide();
		$("#charlton_image_link_a , #imageTwoA").show();
	})

	$("#charlton_image_link_b").click(function(){
		$("#charlton_image_link_b , #imageTwoB").hide();
		$("#charlton_map_link_b , #mapTwoB").show();
	})

	$("#charlton_map_link_b").click(function(){
		$("#charlton_map_link_b , #mapTwoB").hide();
		$("#charlton_image_link_b , #imageTwoB").show();
	})
	
	$("#greenwich_image_link").click(function(){
		$("#greenwich_image_link , #imageThree").hide();
		$("#greenwich_map_link , #mapThree").show();
	})
	
	$("#greenwich_map_link").click(function(){
		$("#greenwich_map_link , #mapThree").hide();
		$("#greenwich_image_link , #imageThree").show();
	})
	
	
	
});
