// COMMUNITY FUNCTIONS ----------------------------------------------------------------------------------
path_to_infoblock = "/elements/infoblock/";

function loadInfoBlockFile(file,div){
	var ajax = new Ajax.Updater(
         div,        // DIV id (XXX: doesnt work?)
         path_to_infoblock+file+'.php',       // URL
         {                // options
         asynchronous: true,
		 onComplete: showResponse
		 });

	function showResponse(req){
		$(div).innerHTML = req.responseText;
	}
}

function getOnlineStats(){
	var ajax = new Ajax.PeriodicalUpdater(
         'infostats',        // DIV id (XXX: doesnt work?)
         path_to_infoblock+'stats.php',       // URL
         {                // options
         asynchronous: true,
		 frequency:60,
		 onComplete: showResponse
		 });

	function showResponse(req){
		$('infostats').innerHTML = req.responseText;
	}
}

function loadInfoBlock(){
	loadInfoBlockFile("poll","forum_poll");

	getOnlineStats();
}