subject_id = '';

function handleHttpResponse() {
	if (http.readyState == 4) {
		if (subject_id != '') {
			var content = http.responseText;
			if(subject_id == 'output_locations') {
				part = content.split("~");
				document.getElementById(subject_id).innerHTML = part[0];
				if(part[1] != "") { document.getElementById('city').value = part[1]; }
				if(part[2] != "") { document.getElementById('state').value = part[2]; }
				content = part[0];
				fetchData('P');	
			}
			if(subject_id == 'output_programs') {
				document.getElementById(subject_id).innerHTML = content;
			}
			document.getElementById('code').disabled = false;			
		}
	}
		
}

function getHTTPObject() {
	var xmlhttp;
	/*@cc_on
	@if (@_jscript_version >= 5)
		try {
			xmlhttp = new ActiveXObject("Msxml2.XMLHTTP");
		} catch (e) {
			try {
				xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
			} catch (E) {
				xmlhttp = false;
			}
		}
	@else
	xmlhttp = false;
	@end @*/
	if (!xmlhttp && typeof XMLHttpRequest != 'undefined') {
		try {
			xmlhttp = new XMLHttpRequest();
		} catch (e) {
			xmlhttp = false;
		}
	}
	return xmlhttp;
}
var http = getHTTPObject(); // We create the HTTP Object