$(document).ready(function () {
	// get the default top value
	var top_val = 10;
	
	// easing type
	var easing_type = 'easeSine';
	
	// animate the selected menu item
	$('#main_tab ul li a.selected').children('a').stop().animate({top:0}, {easing: easing_type, duration:500});
	
	$('#main_tab ul li').hover(
		function () {
			// animate the menu item with 0 top value
			$(this).children('a').stop().animate({top:0}, {easing: easing_type, duration:500});
		},
		function () {
			// set the position to default
			$(this).children('a').stop().animate({top:top_val}, {easing: easing_type, duration:500});
			
			// always keep the previously selected item in fixed position			
			$('#main_tab ul li').children('a.selected').stop().animate({top:0}, {easing: easing_type, duration:500});
		}
	);
	
});

jQuery.extend( jQuery.easing, {
	easeSine: function (p, t, s, e, d) {
		return e*Math.sin(t/d*Math.PI/2) + s;
	}
});
