$(document).ready(function() {

//Left Column Expandable Menus
$('.academic .third-level').hide();
$('.academic .fourth-level').hide();
$('.academic .current .third-level').show();
$('.academic .current .third-level ul.fourth-level').hide();
$('.academic .current .third-level .current .fourth-level').show();

//Left Nav - Contact Box
$('#contact .expandable').hide();
$('#contact h4').addClass('closed');
$('#contact h4').click(function(){
	$(this).toggleClass('closed');
	$(this).siblings('div.expandable').toggle();
});

//Tabbed Content
	//Center column	
	
	$('article .tabbed section').not(':first').hide();
	$('#news-events section').not(':first').hide();;
	$('#home-news-events section').not(':first').hide();
	$('.tabs a').click(function(){
		var thisContent = $(this).attr('class');
		$(this).parent('li').parent('ul').siblings('section').hide();
		$(this).parent('li').parent('ul').siblings('section#'+thisContent).show();
		$(this).parent('li').siblings('li').addClass('off');
		$(this).parent('li').removeClass('off');		
		return false;
	});

	$('#inner-slider').nivoSlider({
		effect: 'fade',
		animSpeed: 700, // Slide transition speed
		pauseTime: 10000, // How long each slide will show
		startSlide: 0 // Set starting Slide (0 index)
		});
			
// Mega Dropdown
	$('.dropdown-container div').hide();
	$('#main-nav a').mouseenter(function(){
		$(this).parent('li').siblings('li').children('a').removeClass('hover');
		var thisDropdown = $(this).attr('id');
		if (thisDropdown == 'athletics') {
			$('.dropdown-container').hide();
		} else {
			$('.dropdown-container').hide();
			$('.dropdown-container div').hide();
			$('.dropdown-container').show();
			$('.dropdown-'+thisDropdown).show();
			$(this).addClass('hover');
		}
	});

	$('.dropdown-container').mouseleave(function(e){
		$("#main-nav li a").removeClass('hover');
		$('.dropdown-container').hide();
		$('.dropdown-container div').hide();
	});
	
	$('.header-main').mouseenter(function(){
		$("#main-nav li a").removeClass('hover');
		$('.dropdown-container').hide();
		$('.dropdown-container div').hide();
	});
	
// Expandable left nav
	$('.academic .expandable ul').hide();
	$('.academic .expandable.current ul:first').show();
	$('.academic .expandable.current').addClass('opened');
	$('.academic .expandable.current').children('ul').children('li').addClass('closed');
	$('.academic .toggle').click(function(){
		$(this).parent('li').toggleClass('opened');
		if ($(this).parent('li').hasClass('closed')) {
			$(this).toggleClass('opened');
		}
		if ($(this).siblings('ul').is(':visible')) {
			$(this).siblings('ul').hide();
		} else {
			$(this).siblings('ul').show();
		}
		return false;
	});
	
// Zebra on standard table
	$('table tbody tr:even').addClass('alt');
	
//jquery accordion
/*
$(".accordion").accordion( {
  active: false,
  alwaysOpen: false,
  autoHeight: false,
  collapsible: true,
  navigation: true
});
*/

//jquery tabs
/*
$(function() {
  $(".tabs").tabs();
});
*/

//jquery cycle
/*
$('.slideshow-fade').cycle({
  fx: 'fade',
  random: 1,
  speed: 3000,
  timeout: 3000
  });
*/
    	
//fancybox
$("#programsPop").fancybox({
	'titlePosition'		: 'inside',
	'transitionIn'		: 'none',
	'transitionOut'		: 'none'
});

$("#genericPop").fancybox({
	'titlePosition'		: 'inside',
	'transitionIn'		: 'none',
	'transitionOut'		: 'none'
});
  
$(".extLink").fancybox({
	 'width' : 600,
	 'height' : 1000,
	 'autoScale' : false,
	 'transitionIn' : 'none',
	 'transitionOut' : 'none',
	 'type' : 'iframe'
 });

// Video Showcase
/*
	$('.stories').cycle({
		fx:    'fade',
		pager:  '.slideshow .storyNav ul', 
		pagerAnchorBuilder: function(idx, slide) { 
		return '<li><a href="#"></a></li>'; 
		}
	});
*/	
/*
	$('.faculty').cycle({
		fx:    'fade',
		pager:  '#faculty .storyNav ul', 
		pagerAnchorBuilder: function(idx, slide) { 
		return '<li><a href="#"></a></li>'; 
		}
	});
	
	$('.students').cycle({
		pager:  '#student .storyNav ul', 
		pagerAnchorBuilder: function(idx, slide) { 
		return '<li><a href="#"></a></li>'; 
		}
	});
*/

});

$(window).load(function() {
// Homepage Slideshow
	$('#home-slider').nivoSlider({
		effect: 'fade',
		animSpeed: 700, // Slide transition speed
		pauseTime: 10000, // How long each slide will show
		startSlide: 0 // Set starting Slide (0 index)
	});
});	





