jQuery(document).ready(function($) {
	$('#tabs-content div:first').show(); // Show the first div
	$('#tabs-list li:first').addClass('active'); // Set the class of the first link to active
	$('#tabs-list a').click(function(){ //When any link is clicked
		if (!($(this).parent().hasClass('active'))) {
			$('#tabs-list li').removeClass('active'); // Remove active class from all links
			$(this).parent().addClass('active'); //Set clicked link class to active
			var currentTab = $(this).attr('href'); // Set variable currentTab to value of href attribute of clicked link
			$('#tabs-content > div').fadeOut(250); // Hide all divs
			$(currentTab).delay(300).fadeIn(500); // Show div with id equal to variable currentTab
		}
		return false;
	});

	$('a[href$="pdf"]').addClass('pdf-link').attr('target','_blank');
		
	$('#menu-item-741 a').click(function(){
		$('#searchform').slideToggle('fast');
		$(this).toggleClass('active');		
		return false;
	});
	$('#menu-main-navigation > li').has('ul').addClass('menu-parent');
	
	$('#menu-main-navigation .menu-parent').mouseenter(function(){
		$(this).find('ul').stop().fadeTo('fast', 1.0);
	});

	$('#menu-main-navigation .menu-parent').mouseleave(function(){
		$(this).find('ul').stop().fadeTo('fast', 0);
	});	
	
	$('#menu-main-navigation .menu-parent > a').click(function(){
		return false;
	});
	
	$('#tabs-list a').after('<span></span>');
});

