    var Data = new Array();
    var Header = new Array();
    var numData, numHeader;
    var indLast, indFirst, indConstit, indComm, indEmail, indDepart;
    var indCat, indConNum, indOffice, indPhone, indFax, indTitle, indRemark;
        
    function makeRequest(url) {
        var httpRequest;

        if (window.XMLHttpRequest) { // Mozilla, Safari, ...
            httpRequest = new XMLHttpRequest();
            if (httpRequest.overrideMimeType) {
                httpRequest.overrideMimeType('text/xml');
                // See note below about this line
            }
        } 
        else if (window.ActiveXObject) { // IE
            try {
                httpRequest = new ActiveXObject("Msxml2.XMLHTTP");
                } 
                catch (e) {
                           try {
                                httpRequest = new ActiveXObject("Microsoft.XMLHTTP");
                               } 
                             catch (e) {}
                          }
                                       }

        if (!httpRequest) {
            alert('Giving up :( Cannot create an XMLHTTP instance');
            return false;
        }
        httpRequest.onreadystatechange = function() { displayContents(httpRequest); };
        httpRequest.open('GET', url, true);
        httpRequest.send(null);

    }

    function displayContents(httpRequest) {
        var strText = "", strTable = "";
        if (httpRequest.readyState == 4) {
            if (httpRequest.status == 200) {            	
                strText = httpRequest.responseText;
                makeData(strText);
                //strTable = makeTable();
                //document.getElementById ('dataArea').innerHTML = strTable;
                displayData();
            } else {
                alert('There was a problem with the request.');
            }
        }

    }
    
    function makeData(strText) {
    	var i, j, len;
    	var FileData = new Array();
    	FileData = strText.split('\n');
    	Header = FileData[0].split('\t');	
    	numHeader = Header.length - 1;
    	for (j=0; j < numHeader; j++) {
    		switch (Header[j]) {
    			case "Last":
    				indLast = j;
    				break;
    			case "First":
    				indFirst = j;
    				break;
    			case "Constituency":
    				indConstit = j;
    				break;
    			case "Department":
    				indDepart = j;
    				break;
    			case "Committee":
    				indComm = j;
    				break;
    			case "Email":
    				indEmail = j;
    				break;
    			case "ConNum":
    				indConNum = j;
    				break;
    			case "Cat":
    				indCat = j;
    				break;
    			case "Office":
    				indOffice = j;
    				break;
    			case "Phone":
    				indPhone = j;
    				break;
    			case "Fax":
    				indFax = j;
    				break;
    			case "Title":
    				indTitle = j;
    				break;
    			case "Remark":
    				indRemark = j;
    				break;
    			default:
    		}
    	}
    	numData = FileData.length - 2;
    	for (i=0; i < numData; i++){
    		Data[i] = FileData[i+1].split('\t');
    		if (Data[i].length > indRemark) {
    			if (Data[i][indRemark].indexOf('"') != -1) { // remove double quotes
    				var re = new RegExp('"', "g");
    				Data[i][indRemark] = Data[i][indRemark].replace(re, '');
    			}
    		}		
    	}
    }
