$(function() {

	//ajax example

	//$.post('?test', {email:'email',user:'user'}, function(response) {

	//	alert(response);

	//});

	

	//ajax example

	//$.get('?get_featured_rant', function(response) {

		//alert(response);

	//});

	

	//each example

	//$("#frm_manage_users input[@type=checkbox]").each(function(){

		//alert($(this).val());

	//});

	

	$(".submenu li").hoverClass ("selected");

	

	$(".nav").hover(

		function(){ 

			//hide all menus and over

			HideMenus();

			

			var menu_id = $(this).attr("id").substr(10);

			$(this).attr("src", HTTP + LAYOUTS + "images/menu-" + menu_id + "-over.jpg");

			$("#drop-menu-" + menu_id).fadeIn("fast"); 

		}, 

		function() { } 

	);

	

	$("#drop-menu-01").hover(

		function(){  }, 

		function() { 

			$("#menu-item-01").attr("src", HTTP + LAYOUTS + "images/menu-01.jpg");

			$("#drop-menu-01").fadeOut("fast"); 

		} 

	);

	

	$("#drop-menu-02").hover(

		function(){  }, 

		function() { 

			$("#menu-item-02").attr("src", HTTP + LAYOUTS + "images/menu-02.jpg");

			$("#drop-menu-02").fadeOut("fast"); 

		} 

	);

	

	$("#drop-menu-03").hover(

		function(){  }, 

		function() { 

			$("#menu-item-03").attr("src", HTTP + LAYOUTS + "images/menu-03.jpg");

			$("#drop-menu-03").fadeOut("fast"); 

		} 

	);

	

})



function HideMenus(){

	$("#menu .invisible").css({

		'display' : 'none'							  

	});

	

	$("img.nav").each(function(){

		image_src = $(this).attr("src");

		if(image_src.indexOf("-over") != -1)

			$(this).attr("src", image_src.replace("-over", ""));

	});

}



$.fn.hoverClass = function(c) {

	return this.each(function(){

		$(this).hover( 

			function() { $(this).addClass(c);  },

			function() { $(this).removeClass(c); }

		);

	});

};	






