function ajaxRequest(){
	var activexmodes=["Msxml2.XMLHTTP", "Microsoft.XMLHTTP"];
	if (window.ActiveXObject)	{
		for (var i=0; i<activexmodes.length; i++){
			try{
				return new ActiveXObject(activexmodes[i])
			}catch(e){}
		}
	}
	else if (window.XMLHttpRequest)
			return new XMLHttpRequest()
		else
			return false
}
var current = 0;

function get_text(k) {
	
	var xml = ajaxRequest();
	xml.open("GET", "get.php?p="+k.toString(), true);
	xml.onreadystatechange=function(){
		if (xml.readyState==4){
			document.getElementById("result").innerHTML = xml.responseText;
		}
	}
	xml.send(null);
}
function counter() {
	get_text(current);
	current++;
}
window.onload = function(){
	setInterval("counter()", 10000);
}
 function printpage()
  {
  window.print()
  }
