$(document).ready(function()
{

	$("#language").click(function (event)
	{ 
		$("#language-options").slideToggle('fast').show();
	});
	$("#language").hover
	(
		function ()
		{
			$("#language-options").slideDown('fast').show();
		}, 
		function ()
		{
			//check if the menu is down, if not then do this
			$("#language-options").slideUp('fast').show();
		}
	);
	$('.menu .page_item:not(.current_page_item):not(.current_page_parent):not(li ul li)').hover
	(
		function () {
			$(this).animate({ 
				borderBottom: "8px solid rgb(19,181,234)",
				paddingBottom: "3px",
				color: "#fff"
				}, 100 );
			// $('.menu .current_page_item ul').fadeOut(100);
			// set z-index here
			// $("ul", this).fadeIn(100).show();
			}, 
		function () {
			$(this).animate({ 
				borderBottom: "0px solid rgb(19,181,234)",
				// paddingBottom: "0",
				// color: "#fff"
				}, 100 );	
			// $('.menu .current_page_item ul').fadeIn(0);
			// $("ul", this).fadeOut(100).show();
			// $("ul", this).stop(true);
			}
	);
	$('.menu .page_item ul').each
	(
		function () {
			var newMargin = ($(this).width()/2) - ($(this).parent().width()/2) + 10;
			$(this).css({'margin-left' : '-'+ newMargin +'px'});

		}
	);
	$('.menu .current_page_item ul').fadeIn('fast');
	$('.menu .current_page_parent ul').fadeIn('fast');
});
