$(document).ready(function() {
	$("ul.sub-menu").parent().addClass('nav-arrow');
	$('ul.sub-menu li:first-child').addClass( 'first' );
	$('ul.sub-menu li:last-child').addClass( 'last' );
	
	$("ul.topnav li ul").css({display: "none"}); // Opera Fix
    $("ul.topnav li").hover(function(){
			$(this).addClass('current-page').find('ul:first').slideDown(300);
			}, function() {
	 		$(this).removeClass('current-page').find('ul:first').stop(true, true).slideUp(100);
	});
	
	$("ul.dsp-diagram li a").append('<span class="hover"></span>');
	$("ul.dsp-diagram li span.hover").css({opacity: "0"});
	$("ul.dsp-diagram li a").hover(function() {
	
		// Stuff that happens when you hover on + the stop()
		$("span.hover", this).stop().animate({
			'opacity': 1
			}, 300, 'swing')
	
	},function() {
	
		// Stuff that happens when you unhover + the stop()
		$("span.hover", this).stop().animate({
			'opacity': 0
			}, 200, 'swing')
	
	});
	$("ul.esa-diagram li a").append('<span class="hover"></span>');
	$("ul.esa-diagram li span.hover").css({opacity: "0"});
	$("ul.esa-diagram li a").hover(function() {
	
		// Stuff that happens when you hover on + the stop()
		$("span.hover", this).stop().animate({
			'opacity': 1
			}, 300, 'swing')
	
	},function() {
	
		// Stuff that happens when you unhover + the stop()
		$("span.hover", this).stop().animate({
			'opacity': 0
			}, 200, 'swing')
	
	});
});
