$(document).ready(function(){



        $("#main_menu a").hover(
            function()
            {
                $(this).css('background-position', 'bottom center');
            },
            function ()
            {
                $(this).css('background-position', 'top center');
            }
        )

	/*
	$("#main_menu li").hover(
		function()
		{
			if(!$(this).hasClass('active'))
			{
				$(this).addClass('active corner hover');
				applyCorner('.corner',5,false);
				//jQuery(this,"a").css('color','#000');
				//$(this).find('a').attr('style', 'color: #000 !important');

			}
		},
		function()
		{
			if($(this).hasClass('hover'))
			{
				$(this).removeClass('active corner hover');
				//jQuery("a", $(this)).removeClass('active');
			}
		}		
	);*/
	
	applyCorner('.top_corner',5,true);
	applyCorner('.corner',5,false);
	
	function applyCorner(selector,px,top_only)
	{
	
		if (jQuery.browser.msie)
		{
			var corner_settings = {
				  tl: {radius: px},
				  tr: {radius: px},
				  bl: {radius: px},
				  br: {radius: px},
				  antiAlias: true
			};

			var top_corner_settings = {
				tl: { radius: px },
				tr: { radius: px },
				bl: { radius: 0 },
				br: { radius: 0 },
				antiAlias: true
			};
			
		
			try
			{
				if(top_only)
					curvyCorners(top_corner_settings, selector);
				else
					curvyCorners(corner_settings, selector);

			}
			catch(e)	
			{
				alert(e);
			}
		}
		else
		{
			if(top_only)
				$(selector).corner("top "+px+"px");
			else
				$(selector).corner(px+"px");
		}
	};
	
});	