$(function () {

	var location = "" + window.location;

	//alert(location);


	$("#nav li a")
			.find("span").hide().end()
			.hover(function () {
				$(this).find("span").fadeIn("fast");
			}, function () {
				$(this).find("span").fadeOut("fast");
			});



	$("#main-nav li a").click(function () {
		$("#nav li").removeClass("activeButton");
		$(this).parent().addClass("activeButton");
	});



	if ($("#li_button_one").hasClass("activeButton")) { $("#li_button_one").removeClass("activeButton"); }
	if ($("#li_button_two").hasClass("activeButton")) { $("#li_button_two").removeClass("activeButton"); }
	if ($("#li_button_three").hasClass("activeButton")) { $("#li_button_three").removeClass("activeButton"); }
	if ($("#li_button_four").hasClass("activeButton")) { $("#li_button_four").removeClass("activeButton"); }
	if ($("#li_button_five").hasClass("activeButton")) { $("#li_button_five").removeClass("activeButton"); }

	if (location.indexOf("Default") > 0 || location.indexOf("default") > 0) {
		$("#li_button_one").addClass("activeButton");
	} else if (location.indexOf("LiveFeedMap") > 0 || location.indexOf("livefeedmap") > 0) {
		$("#li_button_two").addClass("activeButton");
	} else if (location.indexOf("Events") > 0 || location.indexOf("events") > 0) {
		$("#li_button_three").addClass("activeButton");
	}
	else if (location.indexOf("Purpose") > 0 || location.indexOf("purpose") > 0) {
		$("#li_button_five").addClass("activeButton");
	} else {
		$("#li_button_one").addClass("activeButton");
	}

	$('.event').hover(function() {
		$(this).find('.box-pattern').html('<img src="Images/border_pattern.png" width="27" height="105">');
		
		
	}, function() {
			$(this).find('.box-pattern').html('<img src="Images/border_pattern_grey.png" width="27" height="105">');
	
	});
	
	

});


