// JavaScript Document


$(function() {

	$('.program-hub-summary:nth-child(3n)').css('margin-right','0');


});	

$(window).load(function() {
    $('#slider').nivoSlider({
		directionNav:false,
		controlNav:false,
		controlNavThumbs:false,
        controlNavThumbsFromRel:false,
		pauseTime:8000,
		animSpeed:300,
		pauseOnHover:false,
		effect: 'slideInRight'	
		
//		sliceDown
//    	sliceDownLeft
//    	sliceUp
//    	sliceUpLeft
//    	sliceUpDown
//    	sliceUpDownLeft
//    	fold
//    	fade
//    	random
//    	slideInRight
//    	slideInLeft

	});
	
	//sticky footer
	function stickyFooter(){
	
		var windowHeight = $(window).height();
		var headerHeight = $('#header').outerHeight();
		var sliderHeight = $('#slider-wrap').outerHeight();
		var footerHeight = $('#footer').outerHeight();
		var mainContentHeight = $('#main-content').outerHeight();
		var tecContentHeight = $('#tec-content').outerHeight();
		var mainContentVPadding = $('#main-content').innerHeight() - $('#main-content').height();
		var totalHeight = headerHeight + sliderHeight + mainContentHeight + tecContentHeight + footerHeight;
		
			
		 	
		if (totalHeight < windowHeight){
			$('#main-content, #tec-content').height(windowHeight - headerHeight - sliderHeight - footerHeight - mainContentVPadding);
		}
		
		/*
if (totalHeight < windowHeight){
			$('#tec-content').height(windowHeight - headerHeight - footerHeight - mainContentVPadding);
		}
*/
	}
	
	stickyFooter();
	//$(window).resize(stickyFooter);
	
		
	$('#programs').equalHeights();
	
	//hover intent!!!
	function menuHoverIn(){
		$('> .sub-menu', this).css('display', 'block');
		$('> a', this).css('background-color','#554E84');
	}
	
	function menuHoverOut(){
		$('> .sub-menu', this).css('display', 'none');
		$('> a', this).css('background-color','');		
	}
	
	var hIConfig = {
		sensitivity: 20,
		over: menuHoverIn,
		out: menuHoverOut,
		timeout: 200	
	}
	
		function menuHoverInSub(){
		$('> .sub-menu', this).css('display', 'block');
		$('> a', this).css('background-color','#EFBF58');
	}
	
	function menuHoverOutSub(){
		$('> .sub-menu', this).css('display', 'none');
		$('> a', this).css('background-color','');		
	}

	var hIConfigSub = {
		sensitivity: 20,
		over: menuHoverInSub,
		out: menuHoverOutSub,
		timeout: 100	
	}
	
	$('#menu-ispace-menu > li').hoverIntent(hIConfig);
	$('#menu-ispace-menu > li > .sub-menu > li').hoverIntent(hIConfigSub);
	
	
	
	
});


