$(document).ready(function(){
	$("a.trigger").click(function(){
		$("#about_more").toggle('slow');
		$("a.linkswitch").toggle();
		return false;
	});

	//this dirt-cool script: http://enure.net/dev/hide-all-except-one/, modified slightly for our purposes
	$(document).ready(function() {
		var hash = window.location.hash;

		(!hash) ?  
		hideAllExcept('#' + $('#toggleThis > div:first').attr('id')) 
		: hideAllExcept(window.location.hash);

		$('a.toggle').click(function() {
			var href = $(this).attr('href');
			hideAllExcept(href);
			$(this).addClass("selected");
			if (href != "#map"){
				$('#tab2').addClass('selected');
			}
			return false;
		});
	});

	function hideAllExcept(el) {
		$('#toggleThis div').addClass('hide');
		$(el).removeClass('hide');
		$('#map_canvas').removeClass('hide');

		$('a.toggle').removeClass('active');
		$('a.toggle').removeClass('selected');
		$('a[href="' + el + '"]').addClass('active');
		$('a[href="' + el + '"]').addClass('selected');

	}
	
});


