var req;
var ele_id;

function showFull(id, title){
	var uri = 'article.php?id='+id+'&title='+title+'&mode=fragment';	
	ele_id = 'a'+id;
	loadXMLDoc(uri);		
}

function loadXMLDoc(url){ 	  
  if (window.XMLHttpRequest) {
  	// branch for native XMLHttpRequest object  
    req = new XMLHttpRequest();
    req.onreadystatechange = processReqChange;
    req.open("GET", url, true);
    req.send(null);    
  } 
  else if (window.ActiveXObject) { 
  	// branch for IE/Windows ActiveX version
    req = new ActiveXObject("Microsoft.XMLHTTP");
    if (req) {
      req.onreadystatechange = processReqChange;
      req.open("GET", url, true);
      req.send();
    }
  }
}

function processReqChange() {   
	if (req.readyState==4) { // only if req shows "complete"   
		if (req.status==200) { // only if "OK"
			result = '--- NOT FOUND ---';
			try {
				result = req.responseText; // this should be readily formatted HTML
			}
			catch(e) {}
			document.getElementById(ele_id).innerHTML = result;
		}  
		else
			alert('There was a problem retrieving the XML data:\n' + req.statusText);
	}
}
