var xmlHttp
var results
var count
function updateTopics()
{xmlHttp=GetXmlHttpObject()
count=0
if(xmlHttp==null)
{alert("Browser does not support HTTP Request")
return}
var url="modules/ForumFetch/gettopics.php"
url=url+"?sid="+Math.random()
xmlHttp.onreadystatechange=stateChanged
xmlHttp.open("GET",url,true)
xmlHttp.send(null)}
function stateChanged()
{if(xmlHttp.readyState==4||xmlHttp.readyState=="complete")
{parseResults(results)}}
function parseResults(){eval('json = '+xmlHttp.responseText);results=""
if(count==30){count=0}
for(i=count;i<=count+5;i++){results=results+'<table width="180" border="0" cellspacing="0" cellpadding="0">'
results=results+'<tr>'
results=results+'<td style="height:10px">&nbsp;</td>'
results=results+'</tr>'
results=results+'<tr>'
results=results+'<td class="tx_date">'+json.data[i+1].topic_last_post_time+'</td>'
results=results+'</tr>'
results=results+'<tr>'
results=results+'<td style="text-align:left"><a href="http://www.overspeed.lt/forum/viewtopic.php?f=8&t='+json.data[i+1].topic_id+'" target="_blank" class="tx2">'+json.data[i+1].topic_title+' ('+json.data[i+1].topic_replies+')</a></td>'
results=results+'</tr>'
results=results+'</table>'}
count=count+5
document.getElementById("forumTopics").innerHTML=results
startAnimation()}
function GetXmlHttpObject()
{var xmlHttp=null;try
{xmlHttp=new XMLHttpRequest();}
catch(e)
{try
{xmlHttp=new ActiveXObject("Msxml2.XMLHTTP");}
catch(e)
{xmlHttp=new ActiveXObject("Microsoft.XMLHTTP");}}
return xmlHttp;}
function setOpacity(value){document.getElementById("forumTopics").style.opacity=value/10;}
function fadeIn(){for(var i=0;i<=100;i++)
setTimeout('setOpacity('+(i/10)+')',8*i);}
function fadeOut(){for(var i=0;i<=100;i++){setTimeout('setOpacity('+(10-i/10)+')',8*i);}
setTimeout('close()',800);}
function close(){document.getElementById("forumTopics").style.display="none"
setTimeout("stateChanged()",1000);}
function startAnimation(){setOpacity(0);document.getElementById("forumTopics").style.display="block";fadeIn();setTimeout('fadeOut()',10000);}
