$(document).ready(function() {

var numRand = Math.floor(Math.random()*3)+1
$('#'+numRand).show();
$('.dot').attr("src", "/wp-content/themes/TwoTurtles/imgs/dotOut.png");
$('#dot'+numRand).attr("src", "/wp-content/themes/TwoTurtles/imgs/dot.png");


setInterval(function(){
		var features = $('.feature');
		var currentFeature = $("div.feature:visible").attr("id");
		$('#'+currentFeature).hide();
		if (currentFeature == features.length)
		{
			nextFeature = 1;
		}
		else
		{		
		var nextFeature = parseInt(currentFeature)+1;
		}
		$('#'+nextFeature).fadeIn(750);
		$('#dot'+currentFeature).attr("src", "/wp-content/themes/TwoTurtles/imgs/dotOut.png");
		$('#dot'+nextFeature).attr("src", "/wp-content/themes/TwoTurtles/imgs/dot.png");
 }, 5000); 

$('.dot').click(function() {
	var currentFeature = $("div.feature:visible").attr("id");
	var selectedHighlight = $(this).attr('id').substring(3,4);
	$('#'+currentFeature).hide();
	$('#'+selectedHighlight).show();
	$('.dot').attr("src", "/wp-content/themes/TwoTurtles/imgs/dotOut.png");
	$('#dot'+selectedHighlight).attr("src", "/wp-content/themes/TwoTurtles/imgs/dot.png");
});
 
});

