var current_theme	= 1;
var timing 			= setInterval("nextTheme()", 5000);

function changeTheme(id) {
	for (i = 1; i <= $(".theme_item").size(); i++) {
		if (i != id) {
			$(".theme_item:nth-child(" + i + ")").fadeOut();
		} else {
			$(".theme_item:nth-child(" + i + ")").fadeIn();
		}
	}
	
	$("#scroll_status").css('backgroundPosition', '0 -' + (id - 1) * parseInt($("#scroll_status").css('height')) + 'px');
}

function nextTheme() {
	current_theme++;
	if (current_theme > $(".theme_item").size()) {
		current_theme = 1;
	}
	
	changeTheme(current_theme);
}

function previousTheme() {
	current_theme--;
	if (current_theme < 1) {
		current_theme = $(".theme_item").size();
	}
	
	changeTheme(current_theme);
}

function clearTiming() {
	clearInterval(timing);
}
