
   var http4_request = false;
function makePOSTRequest4(url, parameters, tourid) {
      http4_request = false;
      if (window.XMLHttpRequest) { // Mozilla, Safari,...
         http4_request = new XMLHttpRequest();
         if (http4_request.overrideMimeType) {
         	// set type accordingly to anticipated content type
            //http4_request.overrideMimeType('text/xml');
            http4_request.overrideMimeType('text/html');
         }
      } else if (window.ActiveXObject) { // IE
         try {
            http4_request = new ActiveXObject("Msxml4.XMLHTTP");
         } catch (e) {
            try {
               http4_request = new ActiveXObject("Microsoft.XMLHTTP");
            } catch (e) {}
         }
      }
      if (!http4_request) {
         alert('Cannot create XMLHTTP instance');
         return false;
      }
 

      document.getElementById("matchblock").innerHTML="<br><br><br><br><img src=\"ajax/ajax-loader.gif\">";
      http4_request.onreadystatechange = alertContents4;
      http4_request.open('POST', url, true);
      http4_request.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
      http4_request.setRequestHeader("Content-length", parameters.length);
      http4_request.setRequestHeader("Connection", "close");
      http4_request.send(parameters);
openmatches(tourid,'1',''); 
    }
 
   function alertContents4() {
      if (http4_request.readyState == 4) {
         if (http4_request.status == 200) {
            //alert(http4_request.responseText);
            result = http4_request.responseText;        
		 } else {
            alert('There was a problem with the request.');
         }
 
      }
  }
 
   function getsavescore(obj,amount,tourid,status) {
	  var atheid = '';
	  var theid = '1';
      var poststr = "amount="+ amount +"&tourid="+tourid+"&status="+ status +"&posted=1&";
	  
	  while(theid<amount)
	  {
	if(theid=='1')
	{  
	atheid=status + theid;
	poststr = poststr + atheid +"=" + encodeURI( document.getElementById(atheid).value );
	}
	else
	{
	atheid = status+theid;
	poststr = poststr+ "&" + atheid + "=" + encodeURI( document.getElementById(atheid).value );
	}
	 theid++;
	  }
   makePOSTRequest4('ajax/first/matches.php', poststr, tourid);
   }
