$(document).ready(function(){
	
	
	function navFade($el){
		
		var duration =  200;
		var easing = 'linear';
		
		if($el.hasClass('mouseOver') == false){
			$el.parent().siblings().children().removeClass('mouseOver');// remove from other a
			$el.addClass('mouseOver');
			$el.stop().animate(
					{ backgroundColor: '#71BCDA', color:'#FFF' }, // what we are animating
					{
					duration: duration, // how fast we are animating
					easing: easing	
			});
		}else{
			$el.removeClass('mouseOver');
			$el.stop().animate(
					{ backgroundColor: '#d1d1d2', color:'#000' }, // what we are animating
					{
					duration: duration, // how fast we are animating
					easing: easing	
			});
		}		
	}
	
	$('.no-csstransitions #main-nav ul li:not(.selected, .current_page_item) a').each(function(){
		$(this).bind({
			mouseover: function() {
				navFade($(this));
			},
			mouseout: function() {
				navFade($(this));
			}
		});
	});
	
	// home page only
	if(jQuery.fn.cycle){

		if($('#home #banner p').length > 0){
			
			$('#home #banner p').cycle({ 
			    timeout: 5000,
			    speed: 800,
			    fit: 1,
			    pause: 1 // enable pause on hover
			});
		}
	}

});
