( function( $ ) {

  $(document).ready(function($){

  	// News ticker.
  	var $news_ticker = $('#news-ticker');
  	if ( $news_ticker.length > 0 ) {
  		$news_ticker.easyTicker({
  			direction: 'up',
  			easing: 'swing',
  			speed: 'slow',
  			interval: 3000,
  			height: 'auto',
  			visible: 1,
  			mousePause: 1
  		});
  	}

  	// Team hover.
  	$('.thumb-summary-wrap').hover( function(){
  		$(this).children('.our-team-summary').stop().slideDown(300);
  	}, function(){
  		$(this).children('.our-team-summary').stop().slideUp(300);
  	});

	// Fixed header.
	if( true === $('body').hasClass('enabled-sticky-primary-menu') ) {
	  $(window).on( 'scroll',function () {
	  	if( $(window).scrollTop() > $('.site-header').offset().top && !($('.site-header').hasClass('fixed'))){
	  		$('.site-header').addClass('fixed');
	  	}

	  	else if ( 0 === $(window).scrollTop() ){
	  		$('.site-header').removeClass('fixed');
	  	}
	  });
	}

    // Implement go to top.
    if ( 1 === parseInt( universityHubCustomOptions.go_to_top_status, 10 ) ) {
    	var $scroll_obj = $( '#btn-scrollup' );
    	$( window ).on( 'scroll',function(){
    		if ( $( this ).scrollTop() > 100 ) {
    			$scroll_obj.fadeIn();
    		} else {
    			$scroll_obj.fadeOut();
    		}
    	});

    	$scroll_obj.on( 'click',function(){
    		$( 'html, body' ).animate( { scrollTop: 0 }, 600 );
    		return false;
    	});
    } // End if go to top.

  });

} )( jQuery );
