function sendAjaxRequest (filename, POST, returnFunction) { var xmlHttpObject = false; if (typeof xmlHttpObject != 'undefined') { xmlHttpObject = new XMLHttpRequest(); } if (!xmlHttpObject) { try { xmlHttpObject = new ActiveXObject("Msxml2.XMLHTTP"); } catch(e) { try { xmlHttpObject = new ActiveXObject("Microsoft.XMLHTTP"); } catch(e) { xmlHttpObject = null; } } } if (POST == null) { xmlHttpObject.open('GET', filename, true); xmlHttpObject.onreadystatechange = function() {returnResponse(returnFunction)}; xmlHttpObject.send(null); } else { xmlHttpObject.open('POST', filename, true); xmlHttpObject.onreadystatechange = function() {returnResponse()}; xmlHttpObject.setRequestHeader("Content-Type", "application/x-www-form-urlencoded"); xmlHttpObject.send(POST); } function returnResponse () { if (xmlHttpObject.readyState == 4) { if (returnFunction != null) { returnFunction(xmlHttpObject.responseText); } } } }