// JavaScript Document
var testimonial_array = new Array();
testimonial_array[0] = new Array("Murray","We have dealt with JLS Media for three years and are very happy with the service we have received.....", "Dale Rose");
testimonial_array[1] = new Array("JK","We have been using JLS Media for many years, and continue to use them.....", "John Kennedy");
testimonial_array[2] = new Array("Akron","JLS Media has been helpful on many occasions. They helped redesign our home page.....", "Bill Hardgrove");
testimonial_array[3] = new Array("Frankel","JLS Media was attentive to our needs and provided us with a very effective online presence for our company.....", "Rod Frankel");
testimonial_array[4] = new Array("LJA","I recommend JLS Media without question.....", "James A. LeBaube");
var lastid = "";
var lastdiv = "";
var fadediv = "";

window.addEvent('domready',function(){
	var myTimer = (function(){show_testimonial(); }).periodical(10000);
	$('div1').setStyles({
			opacity: '0'
		});
	$('div2').setStyles({
			opacity: '0'
	});
	//set first one
	show_testimonial();
});

function show_testimonial(){
var idshow = getid();
var testimonial_hold = '<blockquote cite="#"><div><q><a href="testimonials.html#' +  testimonial_array[idshow][0] +'">'
	+ '&quot;' + testimonial_array[idshow][1] + '&quot;</a></q></div>'
	+ '<div><cite>' + testimonial_array[idshow][2] + '</cite></div></blockquote>'
	+ '<div class="more"><a href="testimonials.html#' +  testimonial_array[idshow][0] +'">'
	+ 'Read More</a></div>';
								
if (lastdiv == "div1"){
	lastdiv = "div2";
	fadediv = "div1";
}else{
	lastdiv = "div1";
	fadediv = "div2";
}
$(fadediv).set('html',testimonial_hold);
$(lastdiv).fade('out');
$(fadediv).fade('in');
}

function getid(){
	var idhold = $random(0, testimonial_array.length - 1);
	if (idhold == lastid){
		idhold = getid();
	}
	lastid = idhold;
	return lastid;
}