var ddsettings = [];

$(document).ready(function() {
	$(".DropDownLinkList ul").hide();
	
	$(".DropDownLinkList a.toplink").click(function() {
		$(this).next("ul").slideToggle(250);
	});
	
	//initMenuDropDown();

	//png fix for ie6
    //DD_belatedPNG.fix('div, img');
    
    // Redesign test nav js
    
    $("ul.topnav li .trigger").click(function(e) { 
		e.preventDefault();

		/*$(this).parent().find("ul.subnav").slideDown('slow').show(); 

		$(this).parent().hover(function() {
		}, function(){	
			$(this).parent().find("ul.subnav").slideUp('slow'); 
		});

		
		}).hover(function() { 
			$(this).addClass("subhover"); 
		}, function(){	//On Hover Out
			$(this).removeClass("subhover"); */
	});

}); 

function initMenuDropDown() {
	$(".navbar-item").each(function() {
		var dropdown = $(this).parent().find(".navbar-dropdown");

		var id = $(this).attr("id");
		if (ddsettings[id] == null)
		ddsettings[id] = dropdown.height();
		dropdown.css("height", "0px");
	
	});
	
	$(".navbar-item").click(function(element) {
		var dropdown = $(this).parent().find(".navbar-dropdown");
		dropdown.hide();
		dropdown.stop();
	});
	
	$(".navbar-item").mouseenter(function(element) {
		var id = $(this).attr("id");
		var dropdown = $(this).parent().find(".navbar-dropdown");
		var left = $(this).position().left;
		dropdown.css("left", left + "px");
	
		if (dropdown.queue("fx").length == 0) {
			dropdown.hide().css("height", "0px").delay(700).animate({ height: ddsettings[id] + "px" }, 300);
		}else {
			dropdown.stop().animate({height: ddsettings[id] + "px"}, 300);
		}
	})
	
	$(".navbar-item").mouseleave(function() {
		var dropdown = $(this).parent().find(".navbar-dropdown");
		dropdown.clearQueue("fx");
		dropdown.stop().slideUp(300);
	})
	
} 




