function ajax(x,t) { var xmlhttp = newxmlhttp(); xmlhttp.open("GET",'ajax.php'+x+'&PHPSESSID=j7dkr2ouuhk1pjma53p1nj5gvm',true); xmlhttp.onreadystatechange = function() { if (this.readyState == 4 && this.status == 200) { var e = document.getElementById('tartalom'); e.innerHTML = this.responseText; frissit(x,t); } } xmlhttp.send(null); } function frissit(x,t) { setTimeout(function(){ajax(x,t);},t*1000); } function newxmlhttp() { if (window.XMLHttpRequest) xmlhttp = new XMLHttpRequest(); else if (window.ActiveXObject) xmlhttp = new ActiveXObject("Microsoft.XMLHTTP"); return xmlhttp; }