$(document).ready(function() {

	$('div#homepage-rotation ul').innerfade({
		speed: 1000,
		timeout: 2000,
		type: 'sequence',
		containerheight: '152px'
	});

	//add 1 px to the width of the first nav item so that it lines up with the search box.
	$('div#navigation ul.right-options li a').each(function(i) {
		if (i == 0) $(this).css({width: $(this).width()+1});
	});
	
	//navigation animation
	$('div#navigation ul.left-options li a')
		.css( {backgroundPosition: "0 0"} )
		.mouseover(function(){
			$(this).stop().animate({
				backgroundPosition:"(-120px 0)"
			}, {
				duration:500
			})
		})
		.mouseout(function(){
			$(this).stop().animate({
				backgroundPosition:"(-240px 0)"
			}, {
				duration:400, 
				complete:function(){
					$(this).css({backgroundPosition: "0 0"
				})
			}
		})
	})
	
	//navigation animation - right
	$('div#navigation ul.right-options li a')
		.css( {backgroundPosition: "0 0"} )
		.mouseover(function(){
			$(this).stop().animate({
				backgroundPosition:"(-190px 0)"
			}, {
				duration:500
			})
		})
		.mouseout(function(){
			$(this).stop().animate({
				backgroundPosition:"(-320px 0)"
			}, {
				duration:400, 
				complete:function(){
					$(this).css({backgroundPosition: "0 0"
				})
			}
		})
	})
		
		
});
