;(function($){
  $(document).ready(function() {

	$(".vwd-main-drop").hover(function() {
	    $(this).children('.dropdown').addClass('active');
		$(this).children('.vwd-mainnode').addClass('active');
	  },function() {
	    $(this).children('.dropdown').removeClass('active');
		$(this).children('.vwd-mainnode').removeClass('active');
	});
  
	$(".nav-brands").hover(function() {
	    $(this).children('.flyout').addClass('active');
		$(this).children('.vwd-subnode').addClass('active');
	  },function() {
	    $(this).children('.flyout').removeClass('active');
		$(this).children('.vwd-subnode').removeClass('active');
	});
	
	$('.vwd-left-nav-container').hide(); //Hide/close all containers
	$('.vwd-trigger:first').addClass('active').next().show(); //Add "active" class to first trigger, then show/open the immediate next container

	//On Click
	$('.vwd-trigger').click(function(){
		if( $(this).next().is(':hidden') ) { //If immediate next container is closed...
			$('.vwd-trigger').removeClass('active').next().slideUp(); //Remove all .acc_trigger classes and slide up the immediate next container
			$(this).toggleClass('active').next().slideDown(); //Add .acc_trigger class to clicked trigger and slide down the immediate next container
		}
		return false; //Prevent the browser jump to the link anchor
	});

  });
})(jQuery);
