var currentStandOutId = '1_simple';

//featured highlights
$(document).ready(function(){
    $('div#keyfeatureshighlight ul li a').click(function () {
		if ( $(this).parent().children().get(1).id != currentStandOutId ) {
			var targetDiv = $(this).parent().children().get(1);
			$("#"+currentStandOutId).fadeOut(400 , function(){ 
		        $('div#keyfeatureshighlight ul > li').removeClass('active');
				$(targetDiv).parent().addClass('active');
				currentStandOutId = targetDiv.id;
				$("#"+currentStandOutId).fadeIn(400);
			});
		}
        return false;
    });
    
    
    
    
    
    
    
    
    


/*testimonials*/
	$("#nexttestimonial").click(function() {
		var testimonials  = $("#testimonials ul").children();	
		var i = getActiveTestimonial(testimonials);
		setNextTestimonial(i , testimonials);
		return false;
	});
});

function getActiveTestimonial(testimonials) {
		for( var i = 0 ; i < testimonials.length ; i++)	{
			if (testimonials.get(i).className == "active")
				return i;
		}
		return false;
}

function setNextTestimonial(index , testimonials) {
	if ( (index + 1) < testimonials.length)
		$(testimonials.get(index + 1)).addClass('active');
	else
		$(testimonials.get(0)).addClass('active');
	$(testimonials.get(index)).removeClass('active');
}