function runTimer() {
    $('#next img').trigger('click');
    var timeout = setTimeout("runTimer()",4000);
    }
runTimer();
current = 0;
current_slide=1;
$(document).ready(function(){
	width=925;
	var totalSlides=$(".slider ul li").length;
	$(".slider ul").removeAttr('width');
	$(".slider ul").attr('width',width*totalSlides);
	$('#next img').click(function(){
		current_slide++;
		current -= width;
		if(current_slide>totalSlides)
			{
				current=0;
				current_slide=1;
				//$(".slider ul").css('left',(totalSlides)*width);	
				$(".slider ul").animate({"left":current+"px"}, "slow");
			}
		else
			$(".slider ul").animate({"left":current+"px"}, "slow");
	});
	$('#prev img').click(function(){
		current_slide--;
		current += width;
		if (current_slide < 1) 
			{
				current = (totalSlides-1)*(-width);
				current_slide = totalSlides;
				$(".slider ul").animate({"left":current+"px"}, "slow");
			}
		else
			$(".slider ul").animate({"left":current+"px"}, "slow");	
	});
}); 
