refresh_tip_button = document.getElementById('refresh_tip');
refresh_tip_body = document.getElementById('tip_body');

refresh_tip_button.onclick = startRefreshTip;

function startRefreshTip(event)
{
	if (!event) event = window.event;
	refresh_tip_button.style.backgroundImage = "url('/mod/site/images/refresh_anim.gif')";

	window.httpRequester = getAjaxRequester();
	window.httpRequester.open("GET", document.getElementById('SITE_URL').innerHTML + 'ajax_request/?interface=enciclopedia&action=getTip&module=regular&template=ajax_tip.tpl', true)
    window.httpRequester.onreadystatechange = refreshTip;
    httpRequester.send(null);

	event.target.blur();
	refresh_tip_button.onclick = fake;
	event.preventDefault();
	return false;
}

function refreshTip()
{
	if(httpRequester.readyState == 4)
	{
		refresh_tip_body.innerHTML = httpRequester.responseText;
		refresh_tip_button.style.backgroundImage = "url('/mod/site/images/refresh.gif')";
		refresh_tip_button.onclick = startRefreshTip;
    }
}
