// JavaScript Document

$(document).ready(function() {
  $("#menu").children().children("li").each(function () {
    if ($(this).find("ul").size()!=0)
       $(this).find("ul").hide("normal");
	   
  });  
  $("a.abrir").click(function(e) {
   if ($(this).parent().find("ul").size()!=0)
   {
	 if ($(this).parent().find("ul").css("display")=="none"){
	   
	   $(this).parent().find("ul").show("slow");

	   $(this).parent().css({ color: "#B70B0B", fontSize:"18px" , background: "#FFF" });
	   $(this).parent().find("a").css({ color: "#B70B0B", fontSize:"18px" , background: "#FFF" });
	   $(this).parent().find("a.abrir").css({ color: "#B70B0B", fontSize:"12px" , backgroundImage: "url(../imagenes/abierto.jpg)" });
	   $(this).parent().find(".cant_titulo").css({ color: "#374261" });
	   $(this).parent().find("ul li a").css({ color: "#374261", fontSize:"12px" , background: "#FFF" });
	   
	 }else{
	   $(this).parent().find("ul").hide("normal"); 
	   $(this).parent().css({ color: "#FFF", fontSize:"14px" , background: "#374261" });
	   $(this).parent().find("a").css({ color: "#FFF", fontSize:"14px" , background: "#374261" });
	   $(this).parent().find("a.abrir").css({ color: "#B70B0B", fontSize:"12px" , backgroundImage: "url(../imagenes/abrir.png)" });
	   $(this).parent().find(".cant_titulo").css({ color: "#FFF" });
	   
	 }
	   
   }
      
  })  
})


