
// Shameless! This is the slideshow from http://fuzzco.com/ copyright and so forth.
// I liked the specific transition and pager behaviour - easier than re-writing another gallery/slideshow/cycle plugin
// but now i realise it's terribly written and i shouldve gone the other way. hey ho.

var featured_user_changed = false;
var featured_position = 0;
var featured_offset = globals.imageWidth;

function featured(){
	if(!featured_user_changed){
		if((featured_position + 1) == $('#featured #fc .item').size())
			featured_position = 0;
		else
			featured_position++;
		featured_show(featured_position);
	}
	setTimeout('featured()', globals.fuzzcoTimer);
}

function featured_click(element){
	var $el = $(element);
	var num = $el.index();
	featured_show(num);
	featured_user_changed = true;
}

function featured_show(num){
	$("#featured #fc").animate({ 
		marginLeft: ("-" + (featured_offset * num) + "px")
	}, 1000);
	$('#featured .select a img').attr('src', globals.bulletOff);
	$($('#featured .select a')[num]).find("img").attr('src', globals.bulletOn);
}

