var Site = {
	hore: function() {
		if ($('testimonial')) Site.tasty();
	},
	
	tasty: function() {
		var myFx = new Fx.Slide('testimonial', {mode: 'horizontal'});
		
		myFx.hide();
		
		var url = 'ajax-testimonial.php';

		var timer = 15; 
		var periodical, dummy; 

		var ajax = new Request({url:url, 
			method: 'get',
			headers: {'If-Modified-Since': 'Sat, 1 Jan 2000 00:00:00 GMT'},
			onComplete: function(txt) {
				$('testimonial').set('html', txt);
				myFx.slideIn();
			},
			onCancel: function() {
				
			}
		});

		var refresh = (function() {
			myFx.slideOut().chain(function(){
				dummy = $time() + $random(0, 100);
				ajax.send(dummy);
			});
		}); 
		
		$clear(periodical); 
		periodical = refresh.periodical(timer * 1000, this); 
		ajax.send($time());
	}
};
window.addEvent('domready', Site.hore);