
var colorArray = new Array("0063b1","4fc99a","4f2f92","ef433f","871471","40cabd","339933");
$(document).ready(function(){
    timer = 0; 
    var _timer = setInterval(function() { 
		timer++; 
		if (timer == 10) { 
			clearInterval(_timer); 
			align_menus();
		} 
    }, 1); 



	$("#nav ul li").hover(
		function () {
			$(this).find("ul").fadeIn("fast");
		},
		function () {
			$(this).find("ul").hide();
	});
	
	
	
	
	
	$("#"+lightup).find("> a").each(
		function() {
			var menucolor = "#"+colorArray[parseInt($(this).attr("id"))];
			$(this).css("color", menucolor)
		}
	);

	//$("#"+lightup).find("a").css({"color": colorArray[parseInt($(this).attr("id"))]})
			
});



function align_menus() {
	
	$("#nav > ul > li").each(function(){
		
		/*
		$(this).hover(
			function () {
				if ($(this).attr("id")){
					$(this).find("> a").css("color","#"+colorArray[parseInt($(this).attr("id"))]);
				}
			},
			function () {
				if ($(this).attr("id")){
					$(this).find("> a").css("color","#666");
				}
			}
		)
		*/
		
		$(this).find("ul").css("width", ($(this).width()+32)+"px");
	});
	
	
	//alert(lightup);
//	$("#"+lightup).find("> a").each( function() { alert($(this).attr("href")); alert(colorArray[parseInt($(this).attr("id"))]); } );;
}

