$(document).ready(function()
{
	/*$("ul.sub").each(function()
	{
		$(this).css('left', $(this).parent().offset().left);
//		$(this).slideUp('medium');
	});
	
	$("li.menu_item").mouseenter(function()
	{
		$("ul.sub",this).slideDown('medium');
		
		//get the index, set the selector, add class
		if ($("li.menu_item").index(this) != 4)
		{
			$(this).addClass('menuover');
		}
		if ($("li.menu_item").index(this) == 0)
		{
			$('#menu-corner').attr('src', "images/menu_left_over.gif");
		}
	}) 
	.mouseleave(function()
	{
		$("ul.sub",this).slideUp('medium');
		
		if ($("li.menu_item").index(this) != 4)
		{
			$(this).removeClass('menuover');
		}
		if ($("li.menu_item").index(this) == 0)
		{
			$('#menu-corner').attr('src', "images/menu_left.gif");
		}
	});
	
	$("ul.sub").slideUp();
	$("li.menu_item").hover(function()
	{
		$("ul.sub",this).toggle('medium');
	});*/
	
	$("ul li.menu_item") .mouseover(function() { //When trigger is clicked...
		//Following events are applied to the subnav itself (moving subnav up and down)
		$(this).find("ul.sub").slideDown('fast').show(); //Drop down the subnav on click
		$(this).hover(function() {
		}, function(){	
			$(this).find("ul.sub").slideUp('medium'); //When the mouse hovers out of the subnav, move it back up
		});
		//Following events are applied to the trigger (Hover events for the trigger)
		}).hover(function() { 
			$(this).addClass("subhover"); //On hover over, add class "subhover"
		}, function(){	//On Hover Out
			$(this).removeClass("subhover"); //On hover out, remove class "subhover"
		});
	/*$("ul li.menu_item ul.sub li.sub_li").mouseover(function() {
		$(this).css("background","#006690");
	}).hover(function() {
		$(this).css("background","transparent");
	});*/
	
});
