$(document).ready(function(){
	var tabContent = $('.glossary_def');
	
	var selectedTab = function(){
		switch(document.location.hash)
		{
			case	'#a-e'	: return 0;	break;
			case	'#f-o'	: return 1;	break;
			case	'#p-z'	: return 2;	break;
			default			: return 0; break;
		}
	};
	
	tabContent.hide().filter(':eq(' + selectedTab() + ')').show();
	
	$('.glossary_links a').click(function(){
		tabContent.hide().filter(this.hash).show();				
		return false;
	});
	
	$('a.view_all').click(function(){
		if($(this).text() == 'View All')
		{
			$(this).text('View Less');
			$('.glossary_def').show();
		}
		else
		{
			$(this).text('View All');
			$('.glossary_def').hide();
			$('#a_e').show();
		}
		return false;
	});
	
	
	

	
});