	var theme_amount 	= 4;
	var theme_index 	= 0;
	var theme_width 	= 817;
	
	var t;
	var ss = 1;
	
	$(document).ready(function(){
    
		$("#theme_left_arrow").click(function(){
			clearTimeout(t);
			animateLeft();
		});

		$("#theme_right_arrow").click(function(){
			clearTimeout(t);
			animateRight();
		});
		
		t = setTimeout("timedScroll()", 5000);

	});
	
	function timedScroll() {
		animateRight();
		t = setTimeout("timedScroll()", 5000);
	}
	
	function animateLeft() {
		if (theme_index > 0) {
			theme_index--;
			animateTheme(false, theme_width, "slow");
		} else {
			theme_index = theme_amount - 1;
			animateTheme(true, theme_width * (theme_amount - 1), "fast");
		}	
	}
	
	function animateRight() {
		if ((theme_index + 1) < theme_amount) {
			theme_index++;
			animateTheme(true, theme_width, "slow");
		} else {
			theme_index = 0;
			animateTheme(false, theme_width * (theme_amount - 1), "fast");
		}	
	}

	function animateTheme(direction, amount, speed) {
		$("#image_scroller").animate({"left": "" + ((direction) ? "-" : "+") + "=" + amount + "px"}, speed);
	}

