function handle_cat1(result) {
  document.getElementById('load1').innerHTML = result;
  parseCat2();
}

function handle_cat2(result) {
  document.getElementById('load2').innerHTML = result;
  parseCat3();
}

function handle_cat3(result) {
  document.getElementById('load3').innerHTML = result;
  parseCat4();
}

function handle_cat4(result) {
  document.getElementById('load4').innerHTML = result;
  parseCat5();
}

function handle_cat5(result) {
  document.getElementById('load5').innerHTML = result;
  parseCat6();
}

function handle_cat6(result) {
  document.getElementById('load6').innerHTML = result;
 parseCat7();
}

function handle_cat7(result) {
  document.getElementById('load7').innerHTML = result;
 parseCat8();
}

function handle_cat8(result) {
  document.getElementById('load8').innerHTML = result;
 parseCat9();
}

function handle_cat9(result) {
  document.getElementById('load9').innerHTML = result;
 parseCat10();
}

function handle_cat10(result) {
  document.getElementById('load10').innerHTML = result;
 parseCat11();
}

function handle_cat11(result) {
  document.getElementById('load11').innerHTML = result;
 parseCat12();
}

function handle_cat12(result) {
  document.getElementById('load12').innerHTML = result;
 parseCat13();
}

function handle_cat13(result) {
  document.getElementById('load13').innerHTML = result;
}

function parseCat1(){
  make_request("ajax.php", "handle_cat1", "POST", "id=1");
}
  
function parseCat2(){
  make_request("ajax.php", "handle_cat2", "POST", "id=2");
}
  
function parseCat3(){
  make_request("ajax.php", "handle_cat3", "POST", "id=3");
}
  
function parseCat4(){
  make_request("ajax.php", "handle_cat4", "POST", "id=4");
}
  
function parseCat5(){
  make_request("ajax.php", "handle_cat5", "POST", "id=5");
}

function parseCat6(){
  make_request("ajax.php", "handle_cat6", "POST", "id=6");
}

function parseCat7(){
  make_request("ajax.php", "handle_cat7", "POST", "id=7");
}

function parseCat8(){
  make_request("ajax.php", "handle_cat8", "POST", "id=8");
}

function parseCat9(){
  make_request("ajax.php", "handle_cat9", "POST", "id=9");
}

function parseCat10(){
  make_request("ajax.php", "handle_cat10", "POST", "id=10");
}

function parseCat11(){
  make_request("ajax.php", "handle_cat11", "POST", "id=11");
}

function parseCat12(){
  make_request("ajax.php", "handle_cat12", "POST", "id=12");
}

function parseCat13(){
  make_request("ajax.php", "handle_cat13", "POST", "id=13");
}

function create_http_object() {
  var ActiveXTypes = [
    "Microsoft.XMLHTTP",
    "MSXML2.XMLHTTP.5.0",
    "MSXML2.XMLHTTP.4.0",
    "MSXML2.XMLHTTP.3.0",
    "MSXML2.XMLHTTP"
  ];

  for( var i = 0; i < ActiveXTypes.length; i++ ) {
    try {
      return new ActiveXObject( ActiveXTypes[i] );
    } catch( e ) { 
	
	}
  }

  try {
    return new XMLHttpRequest();
  } catch( e ) { 
  
  }

  return false;
}

function make_request(url, callback_function, http_method, post_values, return_xml) {
  http = create_http_object();

  if(!http) {
    alert('Uw browser ondersteunt dit script niet.');
    return false;
  }

  http.onreadystatechange = function() {
    if(http.readyState == 4) {
	  if(http.status == 200) {
        if(callback_function) {
          if(return_xml) {
            eval(callback_function + '(http.responseXML)');
          } else {
            eval(callback_function + '(http.responseText)');
          }
        }
      }
    }
  }

  if(!post_values) {
    post_values = null;
  }
  
  if(!http_method) {
    http_method = "GET";
  }

  http.open(http_method, url, true);

  if(http_method == "POST") {
    http.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');
  }

  http.send(post_values);
}  
