function kapch(id) {
    // Create new JsHttpRequest object.
    var req = new JsHttpRequest();
    // Code automatically called on load finishing.
    req.onreadystatechange = function() {
        if (req.readyState == 4) {
		  var response = req.responseText;
    	  myDiv = document.getElementById("kapch");
    	  myDiv.innerHTML = response;
        }
    }
    // Prepare request object (automatically choose GET or POST).
    req.open(null, 'kapch.php', true);

    // Send data to backend.
    req.send( { id: id } );
}
