var cur_theme_index = 0;
var wInternal;
var themes = new Array();


function beginWalkingThemes() {
	clearInterval(wInternal);
	wInternal = setInterval("walkThemes()", 9000);
}


function walkThemes() {
	cur_theme_index++;

	if (cur_theme_index == themes.length) {
		cur_theme_index = 0;
	}

	changeTheme(cur_theme_index, false);
}


function changeTheme(index, stop_walking) {
	$('#testimonials h1').html(themes[index][0]);
	$('#testimonials p').html(themes[index][1]);
	$('#navigation').css('background-image', 'url(' + themes[index][2] + ')');

	$('#testimonials ul li a').each(function (i) {
		if (i == index) {
			$(this).addClass('current');
		} else {
			$(this).removeClass('current');
		}
	});

	cur_theme_index = index;

	if (stop_walking) {
		clearInterval(wInternal);
		setTimeout("beginWalkingThemes()", 15000);
	}
}
