﻿$(function(){
	// intialize news & events by showing each one's first item
	$(".dedman-event:first, .dedman-news:first").css("display", "block");
	$(".arrow-nav li:first-child a").addClass("selected");

	$("a.select-a-department").hover(function() {
			$('#departments').show('slow');
			return false;
		},
		function(){
			return false;

	});

	$('#departments').hover(function(){
		return false;
	},
	function(){
		$('#departments').hide(300);
	}

	);


});

function ToggleWidget(aObj,widgetIndex) {
	// hide everything
	$(aObj).closest('div').hide();
	$(aObj).closest('div').parent(0).find('a').removeClass("selected");

	// show selected
	$(aObj).closest('div').parents('div').children('div:eq(' + widgetIndex + ')').show();
$(aObj).closest('div').parents('div').children('div:eq(' + widgetIndex + ')').find('ul').children('li:eq(' + widgetIndex + ')').children('a').addClass("selected");
}

function QuickView(divid) {

	// IE6 choked on the nice, animated menus so it gets the basic branch below
	if (document.all) {

		document.getElementById('quick-departments').style.display='none';
		document.getElementById('quick-majors').style.display='none';
		document.getElementById('quick-minors').style.display='none';

		document.getElementById(divid).style.display='block';
	
	} else {

		$('#quick-departments').hide('slow');
		$('#quick-majors').hide('slow');
		$('#quick-minors').hide('slow');

		$('#' + divid).show('slow');

	}

}


function QuickViewClose(divid) {

	// IE6 choked on the nice, animated menus so it gets the basic branch below
	if (document.all) {
		document.getElementById(divid).style.display='none';
	} else {
		$('#' + divid).hide('slow');
	}

}

