$(document).ready(function() {	
	$("ul.stepButtons li").each(function(){
										 
		/*Setting the background of the li to the button of is index */
		$(this).css('background','url(/assets/img/Air-Purifier-Tabletop/button_'+($('.stepButtons li').index(this)+1)+'.png) no-repeat');
		
		/*Rollover function / Mouseover */
		$(this).mouseenter(function(){
			/*Sets all background to default*/
			$("ul.stepButtons li").css('background-position','0 0');
			
			/*Sets current background to active state*/
			$(this).css('background-position','0 -32px');
			
			/*Fades all infomation to invisible*/
			$("ul.steps li").stop().fadeTo(100,0);
			
			/*Fades all current to visible*/
			$("ul.steps li:eq("+$('.stepButtons li').index(this)+")").fadeTo(200,1);
		}).css('cursor','pointer');/*sets hover of the li to pointer*/
	});
	
	/*Setting the initail state of the widget (Hiding all but the first li) */
	$("ul.steps li").fadeTo(10,0);
	$("ul.steps li:eq(0)").fadeTo(200,1);
	
	/*Setting the initail state of the buttons (Making all but the first inactive) */
	$("ul.stepButtons li:eq(0)").css('background-position','0 -32px');
});