  //Gets the browser specific XmlHttpRequest Object
function getXmlHttpRequestObject() {
	if (window.XMLHttpRequest) {
		return new XMLHttpRequest(); //Not IE
	} else if(window.ActiveXObject) {
		return new ActiveXObject("Microsoft.XMLHTTP"); //IE
	} else {
		//Display your error message here. 
		//and inform the user they might want to upgrade
		//their browser.
		alert("Your browser doesn't support the XmlHttpRequest object.  Better upgrade to Firefox.");
	}
}

//Get our browser specific XmlHttpRequest object.
var receiveReq = getXmlHttpRequestObject();

//Initiate the asyncronous request.
function getFile(fileName) {
	//If our XmlHttpRequest object is not in the middle of a request, start the new asyncronous call.
	if (receiveReq.readyState == 4 || receiveReq.readyState == 0) {
		//Setup the connection as a GET call to SayHello.html.
		//True explicity sets the request to asyncronous (default).
		receiveReq.open("GET", fileName, true);
		//Set the function that will be called when the XmlHttpRequest objects state changes.
		receiveReq.onreadystatechange = handleFile; 
		//Make the actual request.
		receiveReq.send(null);
	}			
}

//Called every time our XmlHttpRequest objects state changes.
function handleFile() {
	//Check to see if the XmlHttpRequests state is finished.
	if (receiveReq.readyState == 4) {
		
		var theCode = receiveReq.responseText;
		var startPost = theCode.indexOf('<h2 class="date-header">');
		var endPost = theCode.indexOf('End .post') + 14;

		var thePost = theCode.substring(startPost,endPost);
		
		document.getElementById('theBlogPost').innerHTML = thePost;
	}
}