//$(document).ready(
//				function() {
				
					var catList = $("#mainCats").children();
					var hideMenu;
					
					for(i=0; i < catList.length; i++) {
						var catLink = $(catList[i]);
						
						if(catLink.children("ul").children("li").length > 0) {
							try{
							var ulL = catLink.children("ul").children("li").length;
							var wrap = $('<div class="menuPopDown"></div>');
							var col1 = $('<ul class="menuPopDownCol1"></ul>');
							var col2 = $('<ul class="menuPopDownCol2"></ul>');
							var leftColMax = Math.ceil(ulL	/ 2);
							for(m = 0; m < ulL; m++) {
								var mlink = catLink.children("ul").children("li")[m];
								if(m < leftColMax) {
									col1.append($(mlink).clone());
								} else {
									col2.append($(mlink).clone());
								}
							}
							col1.css("display", "block");
							col2.css("display", "block");

							wrap.append(col1);
							if(catLink.children("ul").children("li").length > 1) 
								wrap.append(col2);
							
							catLink.prepend(wrap);
							
							$(catList[i]).attr("id", "mainCats_" + i);
							wrap.attr("id", "subCats_" + i);
							wrap.hide();
							
							$(catList[i]).hover(
								function() {
									clearTimeout(hideMenu);
									var opened = $(".menuPopDown:visible").length > 0;
									$(".menuPopDown").hide();
									var id = $(this).attr("id").split("_")[1];
									if(!opened) {
										 $("#subCats_" + id).fadeIn("fast");
									} else {
										 $("#subCats_" + id).show();
									}
								}, 
								function() {
									hideMenu = setTimeout(
										function() {
											var opened = $(".menuPopDown:visible").length > 0;
											if(opened) { $(".menuPopDown").fadeOut("fast"); }
										}, 300
									);
									//var id = $(this).attr("id").split("_")[1]
									
								}
							);
							} catch(e) {
								
							}
						}
						
						catLink.children("ul").remove();
						
						
					}
//				}
//			);