$(document).ready(function($) {
    
// HOME PAGE banner
	// Enter Page, Grow is Highlighted
	$('ul#banner-nav li:first a').addClass("on");
	$('ul#banner li#panel-1').show();
	
	var delay = 7000; // milliseconds
	var cycle = setInterval(function() {
		// Find the next link after the one that is on
		var next = $('ul#banner-nav li a.on').parent().next();
		// if we are at the last link go back to the begining
		if (!next.length) {
			next = $('ul#banner-nav li:first');
		}
		// fire the switch
		next.find('a').trigger('switch');
	}, delay);
	
	
	// Add On State to Main Nav
	$('ul#banner-nav li a').click(function () {
		$(this).trigger('switch');
		clearInterval(cycle);
		return false;
	});
	
	
	$('ul#banner-nav li a').bind('switch', function() {
		//console.log(this);
		$('ul#banner-nav li a.on').removeClass();
		$('ul#banner li').fadeOut();
		$('ul#banner li .bannerContent ul li').stop().show();
		$($(this).attr('href')).stop().fadeOut();
		$($(this).attr('href')).stop().fadeIn();
		$(this).addClass("on");
	});
	
	
	
	
	
	
	
	
// HOME PAGE LOGO banner

	$('#user3-home ul li:first').show();
	$('#user3-home ul li:first').addClass('up');
	
	var logosdelay = 4000; // milliseconds
	var logoscycle = setInterval(function() {
		// Find the next list item after the one that is on
		var next = $('#user3-home ul li.up').next();
		// if we are at the last link go back to the begining
		if (!next.length) {
			next = $('#user3-home ul li:first');
		}
		
		$('#user3-home ul li').fadeOut();
		$('#user3-home ul li.up').removeClass();
		next.addClass('up');
		next.fadeIn();
		
	}, logosdelay);
	
	

});
