var testimonials = [
	[{
		'description': 'I like to work with people who are not only talented and know their trade well, but also responsible and fair.',
		'from': 'Molly Chen, PocMarketing.net'
	}],
	[{
		'description': 'htmlBoutique does excellent work. They code quickly and accurately, paying close attention to detail. Very highly recommended.',
		'from': 'Steve Barnes, Graphic Designer'
	}],
	[{
		'description': 'Alex and his team is first rate. I always use them for my slicing needs. They provide fast, quality work at a fair price. ',
		'from': 'Jonathan Taub, ezloandocs.com'
	}],
	[{
		'description': 'htmlBoutique have undertaken work for us over the last 6 months and we cannot fault their quality of work.',
		'from': 'Ross Kernick, AnimationTechnologies.co.uk'
	}],
];

var curr = 0;
$(document).ready(function(){
	if ( $( '#testimonials' ).length > 0 ) {
		$( '.testimonial' ).show();
		show_testimonial();
		
		window.setInterval(function(){
			show_testimonial();
		}, 8000);
	}
});

function show_testimonial() {
	$( '#testimonials' ).fadeOut( 'dev', function(){
		if ( curr == testimonials.length-1 ) curr = 0;
		
		var testimonial = testimonials[curr][0];
		var html = '<p>"' + testimonial['description']  + '" - <span class="from">' + testimonial['from'] + '</span>';
		
		$( this ).html( html ).fadeIn( 'dev' );
		
		curr++;
	});
}