window.addEvent('domready', function() {
	
var timer = 6; 
// periodical and dummy variables for later use
var periodical, dummy; 
var log = $('splash');


	// You can skip the following two lines of code. We need them to make sure demos
	// are runnable on MooTools demos web page.
	if (!window.demo_path) window.demo_path = '/';
	var demo_path = window.demo_path;
	// --
		
	//We can use one Request object many times.
	var req = new Request.HTML({url:demo_path+'splash.php', 
		onSuccess: function(html) {
			//Clear the text currently inside the results div.
			log.set('text', '');
			//Inject the new DOM elements into the results div.
			log.adopt(html);
		},
		//Our request will most likely succeed, but just in case, we'll add an
		//onFailure method which will let the user know what happened.
		onFailure: function() {
			log.set('text', '');
		}
	});
	var refresh = (function() {
		// dummy to prevent caching of php
		req.send();
		
	});
	
	
	
	// prevent insane clicks to start numerous requests
	 
	
	//req.send();
	// the periodical starts here, the * 1000 is because milliseconds required
	periodical = refresh.periodical(timer * 1000, refresh()); 
 
	// this is the first only request, later on will be only the periodical and refresh 
	// that do the request. If we don't do this way, we have to wait for 4 seconds before 
	// the first request.	
	
	
	
});