dojo.addOnLoad(function() {
	
	dojo.xhrGet({
		url: '/files/sponsors/images.php',
		handleAs: 'json',
		sync: false,
		load: function(logos) {
			var timeout = 5;
			var index = Math.round(Math.random()*(logos.length-1));
			
			function changeLogo() {
                		dojo.attr(dojo.byId('Sponsorimg'),'src',logos[index]);
                		window.setTimeout(changeLogo, timeout*1000);
                		index++;
                		if (index > logos.length-1)
                        		index = 0;
        		}


			changeLogo();
		}
	});

});

