window.addEvent('domready', function() {
		
	//$('didyouknow-home').set('text', aText[0]);
	var iRand = 1;
	var sUrl = "/_include/didyouknow.php";
	
	//We can use one Request object many times.
	var req = new Request.HTML({method: 'get',
							   url:"/_include/didyouknow.php", 
		onSuccess: function(html) {
			//Clear the text currently inside the results div.
			$('didyouknow-home').set('html', '');
			//Inject the new DOM elements into the results div.
			$('didyouknow-home').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() {
			$('didyouknow-home').set('html', 'The request failed.');
		}
	}).send("iArticleId="+aId[0]);
	
	var myPeriodical = (function(){
		
		iRand < (aId.length)-1 ? iRand++ : iRand=0;
		//sUrl = "/_include/didyouknow.php?iArticleId="+aId[iRand];
		req.send("iArticleId="+aId[iRand]);
	}).periodical(20000);

});