var version

function initXMLHttpRequest2(){
        var objHTTP = null
        if (window.XMLHttpRequest) {
        try{
          objHTTP = new XMLHttpRequest()
        }catch(e){}
        }else if(window.ActiveXObject){
                if(version){
                        objHTTP = new ActiveXObject(version)
                }else{
                   var xmlhttp = new Array('Msxml2.XMLHTTP.7.0','Msxml2.XMLHTTP.6.0','Msxml2.XMLHTTP.5.0','Msxml2.XMLHTTP.4.0','MSXML2.XMLHTTP.3.0','MSXML2.XMLHTTP','Microsoft.XMLHTTP')
                        for(var i = 0; i < xmlhttp.length; i++){
                                try{
                                        objHTTP = new ActiveXObject(xmlhttp[i]);
                                        if(objHTTP != null){
                                                version = xmlhttp[i]
                                                break
                                        }
                                }catch(e){}
                        }
                }
        }
        return objHTTP
}

function alertContents2(oXmlHttp) {
  if (oXmlHttp.readyState == 4) {
    if (oXmlHttp.status == 200) {
      document.getElementById('forum').innerHTML=oXmlHttp.responseText
    } else {
//			alert('Wystąpił problem z zapytaniem.')
    }
  }
}

function no_to_go(funk){
  oXmlHttp=initXMLHttpRequest2()
  oXmlHttp.onreadystatechange = function() { alertContents2(oXmlHttp) }
  tym='fun='+funk //encodeURIComponent
  oXmlHttp.open("GET",'./forum_get.php',true)
  oXmlHttp.setRequestHeader('Content-Type', 'text/html; charset=iso-8859-2')
  oXmlHttp.send(tym)
}

window.setInterval("no_to_go('1')",1000*60*5)

