/* ================================================================ 
Menu principal
=================================================================== */
$(document).ready(function(){

$("#dropline li.current").children("ul")	.css("left", "0px")
								.show();
$("#dropline li.current").children(":first-child").css("color", "#fff")


$("#dropline li").hover(function(){
	if(this.className.indexOf("current") == -1)  {
		getCurrent = $(this).parent().children("li.current:eq(0)");
		if(this.className.indexOf("top") != -1)  {
			$(this).children("a:eq(0)").css("color","#fff");
		}
		else {
			$(this).children("a:eq(0)").css("color","#fff");
		}
		if (getCurrent = 1 ) {
			$(this).parent().children("li.current:eq(0)").children("ul").hide();;
		}
	$(this).children("ul:eq(0)").css("left", "0px")
								.show();
	}
},function(){
	if(this.className.indexOf("current") == -1)  {
		getCurrent = $(this).parent().children("li.current:eq(0)");
		if(this.className.indexOf("top") != -1) {
			$(this).children("a:eq(0)").css("color","#fff");
		}
		else {
			$(this).children("a:eq(0)").css("color","#fff");
		}
		if (getCurrent = 1 ) {
			$(this).parent().children("li.current:eq(0)").children("ul").show();;
		}
$(this).children("ul:eq(0)").css("left", "-99999px")
							.hide();
	}
});


});
/* ]]> */



$(document).ready(function(){
closetimer = 0;

	if($("#nav")) {

		$("#nav li div").each(function(i) {
		eheight = $(this).height();
		$(this).children().css("top",-eheight+"px");
		});

		$("#nav li.nosub").mouseover(function() {
			eheight = $("#nav b.clicked").next().children().height()+20;
			$("#nav b.clicked").next().children().animate({"top":-eheight+"px"}, {queue:false,duration:(100)});
			$("#nav b.clicked").next().slideUp(50);
			$("#nav b").removeClass("clicked");
		});

		$("#nav b").mouseover(function() {
		clearTimeout(closetimer);
			if(this.className.indexOf("clicked") != -1) {
				eheight = $(this).next().children().height()+20;
				$(this).next().children().animate({"top": -eheight+"px"}, {queue:false,duration:(50)}, "swing");
				$(this).next().slideUp(50);
				$(this).removeClass("clicked");
			}
			else {
				eheight = $("#nav b.clicked").next().children().height()+20;
				$("#nav b.clicked").next().children().animate({"top": -eheight+"px"}, {queue:false,duration:(50)}, "swing");
				$("#nav b.clicked").next().slideUp(50);
				$("#nav b").removeClass();
				$(this).addClass("clicked");
				$(this).next().slideDown(10);
				eheight = $("#nav b.clicked").next().children().height();
				$(this).next().children().animate({"top":"0px"}, {queue:false,duration:(50)}, "swing");
			}
		});
		$("#nav").mouseover(function() {
		clearTimeout(closetimer);
		});
		$("#nav").mouseout(function() {
			closetimer = window.setTimeout(function(){
			eheight = $("#nav b.clicked").next().children().height()+20;
			$("#nav b.clicked").next().children().animate({"top":-eheight+"px"}, {queue:false,duration:(50)}, "swing");
			$("#nav b.clicked").next().slideUp(50);
			$("#nav b").removeClass("clicked");
			}, 2000);
		}); 
	}
});

