function dumpObject(obj){ var output = ''; for (i in obj){ output = output + i+':'+obj[i]+"\n"; } return output; } // global flag var isIE = false; // global zipuest and XML document objects var zip; // retrieve XML document (reusable generic function); // parameter is URL string (relative or complete) to // an .xml file whose Content-Type is a valid XML // type, such as text/xml; XML source must be from // same domain as HTML file function loadZipDoc(url) { // branch for native XMLHttpRequest object if (window.XMLHttpRequest) { zip = new XMLHttpRequest(); zip.onreadystatechange = processReqChange; zip.open("GET", url, true); zip.send(null); // branch for IE/Windows ActiveX version } else if (window.ActiveXObject) { isIE = true; zip = new ActiveXObject("Microsoft.XMLHTTP"); if (zip) { zip.onreadystatechange = processReqChange; zip.open("GET", url, true); zip.send(); } } } // handle onreadystatechange event of zip object function processReqChange() { // only if zip shows "loaded" if (zip.readyState == 4) { // only if "OK" if (zip.status == 200) { processZip(); } else { alert("There was a problem retrieving the XML data:\n" + zip.statusText); } } } // invoked by "Category" select element change; // loads chosen XML document, clears Topics select // element, loads new items into Topics select element function loadDoc(evt) { if (document.getElementById("country").value != "United States") { return; } // equalize W3C/IE event models to get event object evt = (evt) ? evt : ((window.event) ? window.event : null); if (evt) { // equalize W3C/IE models to get event target reference var elem = (evt.target) ? evt.target : ((evt.srcElement) ? evt.srcElement : null); if (elem) { try { if (elem.value != '') { //Load from specific URL loadZipDoc('/xmljs/flprocess_zip.asp?zip='+elem.value); } } catch(e) { var msg = (typeof e == "string") ? e : ((e.message) ? e.message : "Unknown Error"); // alert("Unable to get XML data:\n" + msg); return; } } } } function processZip() { var city = zip.responseXML.getElementsByTagName('city')[0].firstChild; var state = zip.responseXML.getElementsByTagName('state')[0].firstChild if (!city && !state) return; city = city.nodeValue; state = state.nodeValue; if (city && state) { document.getElementById('city').value = city; var stateobj = document.getElementById('state'); for (i=0; i