$(document).ready(function() {
	$('ul#filter a').click(function() { // When clicking ul#filter anchor link
		$('ul#filter .current').removeClass('current'); // Remove the class 'current' from any elements in ul#filter
		$(this).parent().addClass('current'); // Add the class 'current' to the <li> of the anchor just clicked
		
		var filterVal = $(this).text().toLowerCase().replace(' ','-'); // Get the name of the anchor link clicked (.text), convert it to lowercase and replace any spaces with a '-'
		
		if(filterVal == 'all') { // If the anchor link is called 'all'
			$('dl#vacancyList dt.hidden').fadeIn('slow').removeClass('hidden'); // Remove all classes called 'hidden' from <li> elements inside ul#vacancyList (Reveals all tables)
		} else { // ..otherwise..
			$('dl#vacancyList dt').each(function() { // 
				if(!$(this).hasClass(filterVal)) { // 
					$(this).fadeOut('normal').addClass('hidden');
				} else {
					$(this).fadeIn('slow').removeClass('hidden');
				}
			});
		}
		
		return false;
	});
});