	timerestart = false;
	nextitem = 0;
	timing = 4000;
	restart = 500;
	
	function rotate_items(){
		$("a",".current").removeClass("hover");
		$(".potty",".potty_bg").removeClass("tele");
		$("div",".current_img").hide();
		
		$("#"+nextitem).addClass("hover");
		$( "#bu"+nextitem).addClass("tele");
		$("#img"+nextitem).fadeIn("slow");
	
		nextitem++;
		if (nextitem >= links.length) nextitem = 0;
	}
	
	function startinterval(){
		nextitem++;
		timer = window.setInterval("rotate_items()",timing);
	}						
	
	$("document").ready(function(){
	
		//links
		$("a",".current").mouseover(function(){
			clearInterval(timer);
			$("a",".current").removeClass("hover");
			$(".potty",".potty_bg").removeClass("tele");
			$("div",".current_img").hide();
			
			$(this).addClass("hover");
			$( "#bu"+$(this).attr("id") ).addClass("tele");
			$( "#img"+$(this).attr("id") ).show();
			
			nextitem=$(this).attr("id");
			if (timerestart) clearTimeout(timerestart);
			//timerestart = setTimeout("startinterval()",restart);
		}).mouseout(function(){
			if (timerestart) clearTimeout(timerestart);
			timerestart = setTimeout("startinterval()",restart);		
		});
		
		
		//bullets
		$(".potty",".potty_bg").mouseover(function(){
			clearInterval(timer);
			$("a",".current").removeClass("hover");
			$(".potty",".potty_bg").removeClass("tele");
			$("div",".current_img").hide();

			$( "#"+$(this).attr("id").replace("bu","") ).addClass("hover");
			$(this).addClass("tele");
			$( "#img"+$(this).attr("id").replace("bu","") ).show();
			
			nextitem=$(this).attr("id").replace("bu","");
			if (timerestart) clearTimeout(timerestart);
			//timerestart = setTimeout("startinterval()",restart);
		}).mouseout(function(){
			if (timerestart) clearTimeout(timerestart);
			timerestart = setTimeout("startinterval()",restart);		
		});		
		
		//.replace("bu","");
	
		//init
		links = $("a",".current");
		$("a:first",".current").addClass("hover");
		images = $("div",".current_img");
		$("div:first",".current_img").show();		
		bullets = $(".potty",".potty_bg");
		$(".potty:first",".potty_bg").addClass("tele");				
		
		index=0;
		$("a",".current").each(function(){
			$(this).attr("id",index);
			index++;
		})
		
		index=0;
		$("div",".current_img").each(function(){
			$(this).attr("id","img"+index);
			index++;
		})
		
		index=0;
		$(".potty",".potty_bg").each(function(){
			$(this).attr("id","bu"+index);
			index++;
		})		
		
		startinterval();
	});						
						

