/**
 * @author simon.gilhooly
 */
	window.onload=init;
	
	function init(){
		getScoreCard(window.location.search);
	}
	
	function getScoreCard(matchId){
		if (matchId != "") {
			var url = "/getScoreCard.php" + matchId;
			scoreXHR = createXmlHttpRequest();
			scoreXHR.open("GET", url, true);
			scoreXHR.onreadystatechange = processScoreCard;
			scoreXHR.send(null);
		}
	}
	
	function processScoreCard(){
		var scoreCard = new String;
		if (scoreXHR.readyState == 4 && scoreXHR.status == 200)
		{
			ajaxResultText = scoreXHR.responseText;
			scoreCard = ajaxResultText.slice(ajaxResultText.indexOf("<!--HEADER"), ajaxResultText.lastIndexOf("<!--HIDDEN"));
			document.getElementById("scorecard").innerHTML = scoreCard;		
		}
	}
