function createRequestObject(){
	var request_o; //declare the variable to hold the object.
	var browser = navigator.appName; //find the browser name
	if(browser == "Microsoft Internet Explorer"){
		/* Create the object using MSIE's method */
		request_o = new ActiveXObject("Microsoft.XMLHTTP");
	}else{
		/* Create the object using other browser's method */
		request_o = new XMLHttpRequest();
	}
	return request_o; //return the object
}

/* The variable http will hold our new XMLHttpRequest object. */
var http = createRequestObject(); 

function getNextStory(){

	http.open('get', '?page=content&mode=ajaxview&ajax=ajax');
	
	http.onreadystatechange = handleStory; 
	
	http.send(null);
}

function handleStory(){

	if(http.readyState == 4){ //Finished loading the response
        
		var response = http.responseText;
	    	
		document.getElementById('stories').innerHTML = response;
		
	}
}
