	
function print_chapter(project, data){
	var ajaxRequest;
	try{
		ajaxRequest = new XMLHttpRequest();
	} catch (e){
		try{
			ajaxRequest = new ActiveXObject("Msxml2.XMLHTTP");
		} catch (e) {
			try{
				ajaxRequest = new ActiveXObject("Microsoft.XMLHTTP");
			} catch (e){
				alert("Ajax Error!");
				return false;
			}
		}
	}

	ajaxRequest.onreadystatechange = function(){
				
			if(ajaxRequest.readyState == 1)
			{
			   var ajaxDisplay = document.getElementById('content');
			   var contentDisplay = "<center>Please wait, all articles are collected for printing.<br /><img src='/web/ac/images/loadingAnimation.gif' /><br  /><br /><center>Confirm the print command to print the pages. The page will be reloaded automatically afterwards.</center>";
			   ajaxDisplay.innerHTML = contentDisplay;
  		}
			if(ajaxRequest.readyState == 4){
					
					var parent_node = document.getElementById("content");
					var new_div = document.createElement("div");
					var div_id =  document.createAttribute("class");
							div_id.nodeValue = "print_all";
							new_div.setAttributeNode(div_id);	
					parent_node.appendChild(new_div);
														
					var ajaxDisplay = document.getElementById('content');			   	
			   	ajaxDisplay.innerHTML = ajaxRequest.responseText;
			   	window.print();
			   	setTimeout("document.location.reload()",5000);	       			
  		}
	}

	   var queryString = "?project=" + project + "&data=" + data;
	   ajaxRequest.open("GET", "http://" + document.location.host + "/addons/soap/soap_articles.php" + queryString, true);
	   ajaxRequest.send(null); 

}