var searchReq = false;
        
// If the user is using Mozilla/Firefox/Safari/etc
if (window.XMLHttpRequest) {
        //Intiate the object
        searchReq = new XMLHttpRequest();

}
// If the user is using IE
else if (window.ActiveXObject) {
        //Intiate the object
        searchReq = new ActiveXObject("Microsoft.XMLHTTP");
}

//-------------------------------------------------------------------------------------------
function statusSearch(rid) {
		
    //If the form data is *not* blank, query the DB and return the results
	if(rid !== "") {
	
        //This sets a variable with the URL (and query strings) to our PHP script
		var url = 'fetchdoc1.php?docid=' + rid + '&id' + Math.random();

        //Open the URL above "asynchronously" (that's what the "true" is for) using the GET method
		searchReq.open('GET',   url, true);
                //Check that the PHP script has finished sending us the result
		searchReq.onreadystatechange = function() {
			if(searchReq.readyState == 4 && searchReq.status == 200) {

			} 
		};
		searchReq.send(null);  
	}
}
//-------------------------------------------------------------------------------------------

