// Super hover
function superHover(obj, speed, dir) {
	var speed = typeof(speed) == 'number'?speed:400;
	
	if (dir == 'reverse')
	{
		$(obj).css('opacity', 1);
		
		$(obj).hover(
			function() {	$(this).animate({opacity: 0}, speed);	},
			function() { 	$(this).animate({opacity: 1}, speed); 	}
		);
	} else {
		$(obj).css('opacity', 0);
		
		$(obj).hover(
			function() {	$(this).animate({opacity: 1}, speed);	},
			function() { 	$(this).animate({opacity: 0}, speed); 	}
		);
	}
}

function yellowButton(obj, speed) {
	var speed = typeof(speed) == 'number'?speed:400;
	
	$(obj).hover(
		function() {	$(this).animate({opacity: 0.75}, speed);	},
		function() { 	$(this).animate({opacity: 1}, speed); 	}
	);
}

jQuery(function($) {
	// give zebra stripes to table rows
	$('tr:odd td').addClass('odd');
	
	// define last table cell in a row
	$('tr td:last, tr th:last').addClass('last');
	
	// Making super-hovers
	superHover($('.logo img'), 350);
	// Engage only inactive menu items
	superHover($('#nav li').not('.active').find('a span'), 330);
	
	//Making advanced yellow buttons
	yellowButton('.y-btn', 330);
});

