// JavaScript Document
var banactivo;
$(document).ready(function()
{
	//slides the element with class "menu_body" when paragraph with class "menu_head" is clicked 
	$("#firstpane p.menu_head").click(function()
    {
		if(banactivo!=undefined){
			$("#flechitagde"+banactivo).hide();
		}
		$(this).next("div.menu_body").slideToggle(300).siblings("div.menu_body").slideUp("slow");
        $("#flechitagde"+$(this).attr('id')).show();
		banactivo=$(this).attr('id');
		$(this).siblings().css({backgroundImage:"url(left.png)"});
	});
	//slides the element with class "menu_body" when mouse is over the paragraph
	$("#secondpane p.menu_head").click(function()
    {
	     $(this).css({backgroundImage:"url(/images/flechagde.png)"}).next("div.menu_body").slideDown(500).siblings("div.menu_body").slideUp("slow");
         $(this).siblings().css({backgroundImage:"url(left.png)"});
	
	});
	
	function despliegamenu (id){
		
		
		//$("#a"+id).next("div.menu_body").slideToggle(300).siblings("div.menu_body").slideUp("slow");
		$("#a"+id).next("div.menu_body").show();
		$("#flechitagdea"+id).show();
		banactivo="a"+id;
       
	}
	despliegamenu (idmenu);
});
