<!--
/*
ein Script von massa :D
 _ __ ___   __ _ ___ ___  __ _ 
| '_ ` _ \ / _` / __/ __|/ _` |
| | | | | | (_| \__ \__ \ (_| |
|_| |_| |_|\__,_|___/___/\__,_|*/

//str_replace von php für javascript zugänglich machen
function str_replace(search, replace, subject) {
    return subject.split(search).join(replace);
}

function sendRequest(id) {
	  try {
	  	  //unterscheiden zwischen IE und anderen browsern
	  	  req = window.XMLHttpRequest ? new XMLHttpRequest() : new ActiveXObject("Microsoft.XMLHTTP");
	  } catch (e) {
			  //Kein AJAX Support
			   document.getElementById('latestmatches').innerHTML = 'AJAX wird von Ihrem Browser nicht unterst&uuml;tzt';
	  }
	  req.onreadystatechange = handleResp; //antwort verarbeiten
	 if('0'==id) {
		 req.open('get', 'm_latestmatches_echo.php');
	 }else{
		 req.open('get', 'm_latestmatches_echo.php?sp='+id);
	 }
	  req.send(null);
}

function handleResp() {
 /* 0 (nicht initialisiert)
  * 1 (lade)
  * 2 (geladen)
  * 3 (interaktiv)
  * 4 (vollständig)
  */
	  //es wird geladen
	  if (req.readyState != 4) {
			  document.getElementById('latestmatches').innerHTML = '<center><img src="images/icons/loading.gif"><\/center>';
	  }
	  //wenn vollkommen geladen
	  if ((req.readyState == 4) && (req.status == 200)) {
	  		  var divtext;
			  divtext = str_replace('ä', '&auml;', req.responseText);
			  divtext = str_replace('ü', '&uuml;', divtext);
			  divtext = str_replace('ö', '&ouml;', divtext);
			  document.getElementById('latestmatches').innerHTML = divtext;
	  }
}

sendRequest('0');
//-->