var reqObj = null;
function createRequest(){
	try {
	   reqObj = new ActiveXObject("Msxml2.XMLHTTP");
	}
	catch (err)	{
			try {
			reqObj = new ActiveXObject("Microsoft.XMLHTTP");
			}
			catch (err2) {
			try {
			   reqObj = new XMLHttpRequest();
			}
			catch (err3) {
			   reqObj = null;
			}
		}
	}
	return reqObj;
}

function livescoreboard(matchid){
	xmlhttp = createRequest();
	if(xmlhttp != null){
		// call open with GET or POST, the URL, and true for asynchronous
		xmlhttp.open("GET", "ajxlivescore.php?matchid="+matchid+"&rand="+Math.random(1,10), true);
		xmlhttp.onreadystatechange = show_scoreboard;
		xmlhttp.send(null);
	}
}

function show_scoreboard(){
	if (xmlhttp.readyState == 4) {
	  if (xmlhttp.status == 200) {
		  var text1  = xmlhttp.responseText;
		  document.getElementById('score_board').innerHTML = text1;
	  }
	}
}

function reloadin3sec(matchid){
	livescoreboard(matchid);
	setTimeout("reloadin3sec('"+matchid+"')",3000);
}

