// JavaScript Document - Common JS Elements. AoEC.com

$(document).ready(function() {	
						   
		$('#directorycontent').hide();			   
		
		// Directory Toggle
		$('#showhidedirectory').toggle(
		function(){ 
		$("#showhidedirectory").css('background-image','url(../common/interface/directory_hide.jpg)'); 
		$('#directorycontent').animate({height:'show'},'100');
		},
		function(){ 
		$("#showhidedirectory").css('background-image','url(../common/interface/directory_show.jpg)'); 
		$('#directorycontent').animate({height:'hide'},'100');
		}
		);
		
		//Menu Accordian
		$(document).ready(function()
		{
			
		$('#firstpane div.menu_body').hide();
		$('#secondpane div.menu_body').hide();
		
		//slides the element with class "menu_body" when paragraph with class "menu_head" is clicked 
		$("#firstpane p.menu_head").click(function()
		{
		$(this).css({backgroundImage:"url(down.png)"}).next("div.menu_body").slideToggle(300).siblings("div.menu_body").slideUp("slow");
		$(this).siblings().css({backgroundImage:"url(left.png)"});
		});
		
		//slides the element with class "menu_body" when mouse is over the paragraph
		$("#secondpane p.menu_head").mouseover(function()
		{
		 $(this).css({backgroundImage:"url(down.png)"}).next("div.menu_body").slideDown(500).siblings("div.menu_body").slideUp("slow");
		 $(this).siblings().css({backgroundImage:"url(left.png)"});
			});
		});
		
		
});

