// Easing equation, borrowed from jQuery easing plugin
// http://gsgd.co.uk/sandbox/jquery/easing/
jQuery.easing.easeOutQuart = function (x, t, b, c, d) {
	return -c * ((t=t/d-1)*t*t*t - 1) + b;
};

jQuery(function( $ ){
	$('#mainscroller').serialScroll({
		items:'li.scroller',
		duration:600,
		force:true,
		stop:true,
		cycle:true,
		easing:'easeOutQuart', //use this easing equation for a funny effect
		interval: 12000,
		lock: true,
		step: 1,
		onBefore:function( e, elem, $pane, $items, pos ){
			$('#navscroller li').removeClass('current');
			$('li#navscr'+(pos+1)).addClass('current');
		},
		onAfter:function( elem ){
		}
	});

$('div.ffcomments a span').each(function(index) {
	$(this).remove();
});
$('div.ffcomments a').each(function(index) {
	var str = $(this).html();
	if (str.indexOf('Comments (')>-1) {
		var arr = str.split('(');
		str = arr[1];
		if (str.indexOf(')')>-1) {
			arr = str.split(')');
			$(this).html(arr[0]);
		} else {
			$(this).html(str);
		}
	}
});

});
