// create an simple ajax connections
var xmlHttp;

function createHttpRequest(url) {
	xmlHttp = GetXmlHttpObject();
	if (xmlHttp == null) {
		alert("Browser does not support HTTP Request");
		return;
	}
	xmlHttp.onreadystatechange = function () {
		if (xmlHttp.readyState == 4 || xmlHttp.readyState == "complete") {
			if (xmlHttp.status == 200) {
				document.getElementById("pdf_reader").innerHTML = xmlHttp.responseText;
			}
			else {
				alert("There was a problem with the request.");
			}
		}
	};
	xmlHttp.open("GET", url, true);
	xmlHttp.send(null);
}


function GetXmlHttpObject() {
	var objXMLHttp = null;
	if (window.XMLHttpRequest) {
		try {
			objXMLHttp = new XMLHttpRequest();
		}
		catch(e) {
			objXMLHttp = false;
		}
	}
	else if (window.ActiveXObject) {
		try {
			objXMLHttp = new ActiveXObject("Msxml2.XMLHTTP");
		}
		catch(e) {
			try {
				objXMLHttp = new ActiveXObject("Microsoft.XMLHTTP");
			}
			catch(e) {
				objXMLHttp = false;
			}
		}
	}
	return objXMLHttp;
}
