
function GetChatQuestion()
{
    //alert('1');
    url = document.location + '?getquestion=1';
    var myAjax = new Ajax.Request(
		url, 
		{
			method: 'get', 
			onComplete: showQuestion
		});
	//alert('10');
}

function showQuestion(o)
{
    var strQuestion = o.responseText;
    $('chat_question').innerHTML = strQuestion;
}

function InitChatQuestion()
{
    // get current question
    GetChatQuestion();
    
    // keep getting new question every 45 seconds
    new PeriodicalExecuter(GetChatQuestion,45);
    
}
addLoadEvent(InitChatQuestion)