var current_feature = 0;

Event.observe(window,"load",function() {
	
	$$("#featured_text_wrapper span a").invoke("observe","click",function(ev) {
		ev.stop();
		el = ev.element();
		moveFeature(el);
	});
	
});

function moveFeature(el) {
		pos = el.readAttribute("name") - 1;
		x = 0;
		$$("#featured_text_wrapper span a").each(function(el) { el.className = el.className.replace("_active",""); });
		c = $$("#featured_text_wrapper span")[0].down("a",pos);
		c.className = c.className + "_active";

		new Effect.Fade($("featured_text_wrapper").down("div",current_feature));
		new Effect.Appear($("featured_text_wrapper").down("div",pos));
		new Effect.SmoothScroll("featured_image_wrapper", { x: pos * 600, y: 0 });		

		current_feature = pos;
}
	
setInterval('if ((current_feature+1) == $$("#featured_text_wrapper span a").length) { newf = 0; } else { newf = current_feature + 1; } moveFeature($$("#featured_text_wrapper span a")[newf]);',10000);