$(document).ready(function(){

	var t = null;

	$("#navi a").hover(function(event) {
	
		var popupId = $(this).children("span").attr("id");
		var cnt = 0;
		$("#naviContent_"+popupId+" div").each(function(index) { cnt++; });
	
		if(cnt > 0) {
	
			$("#popupCol1").html("");
			$("#popupCol2").html("");
			$("#popupCol3").html("");
			
			$("#naviContent_"+popupId + " div").each(function(index) {
				var temp = $(this).clone();
				var col = index % 3 + 1;
				$("#popupCol"+col).append(temp);
			});
		
		
			$("#naviPopup").fadeIn("fast");
			$("#navi .over").removeClass("over");
			$(this).addClass("over");
			clearTimeout(timer);
		}
    }, function(event) {
		timer = setTimeout("hidePopup()", 250);
	});
	
	$("#naviPopup").hover(function(event) {
		clearTimeout(timer);
    }, function(event) {
		timer = setTimeout("hidePopup()", 50);
	});
	
	
	
});

function hidePopup() {
	$("#naviPopup").fadeOut("fast");
	$("#navi .over").removeClass("over");
}
