// Place your application-specific JavaScript functions and classes here
// This file is automatically included by javascript_include_tag :defaults

var testimonialDelay = 10000;
var curQuote = -1;
var curTimeout;

function changeTestimonial() {
	var testimonials = $$('.testimonial');
	if(testimonials.length > 0) {
		prevQuote = curQuote;
		curQuote = ((curQuote + 1) % testimonials.length);
		if (prevQuote > -1) {
			new Effect.Fade(testimonials[prevQuote], {duration:2.0, queue: 'front'});
			new Effect.Appear(testimonials[curQuote], {duration:2.0, queue: 'end'});
		}
		curTimeout = setTimeout("changeTestimonial()", testimonialDelay);
	}
}

function spin(id_prefix){
	if(id_prefix === undefined){id_prefix=''};
	Element.toggle(id_prefix+'processing');
	Element.toggle(id_prefix+'submit');
}