function executeXhr(callback, url) { req = false; req = createHttpRequest(); if (req) { req.onreadystatechange = callback; req.open("GET", url, true); req.send(null); } else { alert("Error initializing XMLHttpRequest!"); } } function createHttpRequest() { var httpRequest = false; if (window.XMLHttpRequest) { // branch for native XMLHttpRequest object httpRequest = new XMLHttpRequest(); } else if (window.ActiveXObject) { // branch for IE/Windows ActiveX version httpRequest = new ActiveXObject("Microsoft.XMLHTTP"); if (!httpRequest) { httpRequest = new ActiveXObject("Msxml2.XMLHTTP"); } } return httpRequest; } function buildOptions(xmlDoc,id) { var selectObj = document.getElementById(id); if (!selectObj || selectObj.tagName!="TR") { return; } var selectObjNew = selectObj.childNodes[3].childNodes[1] var options = xmlDoc.getElementsByTagName("option"); //clear select object // for (var i = selectObj.length-1 ; i >= 0 ; i--){ // selectObj.options[i] = null; // } selectObj.length = 0; for (var i=0; i