var testimonialIndex;
var testimonialIds;

function initTestimonials(index, ids) {
	testimonialIndex = index;
	testimonialIds = ids;
}

function nextTestimonial() {
	if( testimonialIndex < testimonialIds.length - 1 ) {
		testimonialIndex++;
	}
	else {
		testimonialIndex = 0;
	}
	
	loadTestimonial();
}

function previousTestimonial() {
	if( testimonialIndex > 0 ) {
		testimonialIndex--;	
	}
	else {
		testimonialIndex = testimonialIds.length - 1;
	}

	loadTestimonial();
}

function loadTestimonial() {
	var url = "/canada/common/scripts/testimonial.php?t=" + testimonialIds[testimonialIndex];
	var callback = {
		success: function(o) {
			document.getElementById("testimonial").innerHTML = o.responseText;
		},
		failure: function(o) {
		
		}
	}
	
	var request = YAHOO.util.Connect.asyncRequest("GET", url, callback);
}
