var testimonialIndex = 0;
var testimonials = new Array();

jQuery(document).ready(function() {
	jQuery("#sidebartestimonialsinner").html(testimonials[testimonialIndex]);
	if(testimonials.length > 1) setInterval("testimonialSwitch()", 8000);
}); 

function wordcount(x) {
	wordsleft = 250 - x.value.split(" ").length;
	if(wordsleft > 0) document.getElementById('wordcounter').innerHTML = wordsleft + ' words remaining';
	else document.getElementById('wordcounter').innerHTML = '<b><span style="color:red;">Over 250 Words</span></b>';
}

function testimonialSwitch() {
	testimonialIndex = (testimonialIndex + 1) % testimonials.length;
	jQuery("#sidebartestimonialsinner").fadeOut(800, function() { jQuery("#sidebartestimonialsinner").html(testimonials[testimonialIndex]); jQuery("#sidebartestimonialsinner").fadeIn(800); });
	return false;
}

