/*  
*	REQUIRES: /min/g=phoenix.js.utilities
*
*	LAST MODIFIED: 2010-7-9
*/

$(document).ready(function(){

// Because IE7 sucks, hide second columns for all groups
$(".widget-alumni-quick-links .links .ui-helper-hidden-accessible .column-2").addClass("ui-helper-hidden-accessible");
$(".widget-alumni-quick-links .links .active .column-2").removeClass("ui-helper-hidden-accessible");

/*
*	Hover Event
*
* 	DESCRIPTION: When a user hovers over a category swap classnames of the links
*/

$(".widget-alumni-quick-links .categories ul li").mouseover(function(){

	// Adjust category classnames
	
		// Remove all active classnames
		$(this).parent().children("li").removeClass("active");
		
		// Add active classname to the hovered item
		$(this).addClass("active");
	
	
	// Adjust link classnames within the group
	
		// Determine the target classname from the anchor tag
		var $targetClass = "."+ $(this).children("a").attr("href").substr(1);
				
		// Hide the active set of links
		$(this).parent().parent().parent().children(".links").children(".active").addClass("ui-helper-hidden-accessible");
		$(this).parent().parent().parent().children(".links").children(".active").removeClass("active");
	
		// Because IE7 sucks, hide second columns for all groups
		$(this).parent().parent().parent().children(".links").children(".columns").children(".column-2").addClass("ui-helper-hidden-accessible");
	
		// Show the new set of links
		$(this).parent().parent().parent().children(".links").children($targetClass).removeClass("ui-helper-hidden-accessible");
		$(this).parent().parent().parent().children(".links").children($targetClass).addClass("active");

		// Because IE7 sucks, hide second columns for all groups
		$(this).parent().parent().parent().children(".links").children($targetClass).children(".column-2").removeClass("ui-helper-hidden-accessible");
	
});
		

});
