$(document).ready(function() {
	// Menues desplegables
	$("ul.topnav li span").mouseover(function() { //When trigger is clicked...

		// Following events are applied to the subnav itself (moving subnav up and down)
		$(this).parent().find("ul.subnav").slideDown().show(); //Drop down the subnav on click
		$(this).parent().hover(function() {}, function() {
			$(this).parent().find("ul.subnav").slideUp(); //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"
	});

	// Mantiene OVER e boton cuando se abren los dropdowns
	$(".sub1 ul.subnav ").hover(function() {
		$(".atencion").addClass("seleccionadoAtencion");
	  }, function() {
		$(".atencion").removeClass("seleccionadoAtencion");
	});

	$(".sub2 ul.subnav").hover(function() {
		$(".glow1").addClass("seleccionadoAtencion1");
	  }, function() {
		$(".glow1").removeClass("seleccionadoAtencion1");
	});

	$(".sub3 ul.subnav").hover(function() {
		$(".glow3").addClass("seleccionadoAtencion3");
	  }, function() {
		$(".glow3").removeClass("seleccionadoAtencion3");
	});

	$(".sub4 ul.subnav").hover(function() {
		$(".glow4").addClass("seleccionadoAtencion4");
	  }, function() {
		$(".glow4").removeClass("seleccionadoAtencion4");
	});

	$(".sub5 ul.subnav").hover(function() {
		$(".glow5").addClass("seleccionadoAtencion5");
	  }, function() {
		$(".glow5").removeClass("seleccionadoAtencion5");
	});
});
