function makeCity(value) {

		// AJAX Request
	    var httpRequest;

        if (window.XMLHttpRequest) { // Mozilla, Safari, ...
            httpRequest = new XMLHttpRequest();
            if (httpRequest.overrideMimeType) {
                httpRequest.overrideMimeType('text/xml');
            }
        } 
        else if (window.ActiveXObject) { // IE
            try {
                httpRequest = new ActiveXObject("Msxml2.XMLHTTP");
                } 
                catch (e) {
                           try {
                                httpRequest = new ActiveXObject("Microsoft.XMLHTTP");
                               } 
                             catch (e) {}
                          }
                                       }

        if (!httpRequest) {
            alert('Giving up :( Cannot create an XMLHTTP instance');
            return false;
        }
		
		// Establish URL to API
		var query='?state=' + value;
		var url='http://' + document.domain + '/template/city.php';
		url=url+query;
		url=url+"&sid="+Math.random();

		
		// Send Request to API
		httpRequest.onreadystatechange = function() { alertCityContents(httpRequest); };
        httpRequest.open('GET', url, true);
        httpRequest.send('');


    function alertCityContents(httpRequest) {

		try {
        if (httpRequest.readyState == 4) {
            if (httpRequest.status == 200) {

		// Eval Statement
		var myCities = eval('(' + httpRequest.responseText + ')');
		
		// Establish div/span id name
		if (document.getElementById('citytext')) {
		if (document.search.city.value == "ENTER CITY" || document.search.city.value == "") {
		var cityinput = document.getElementById('citytext');
		document.getElementById('CityContainer').removeChild(cityinput);
		}
		else {
		return false;
		}
		}
		else if (document.getElementById('citylist')) {
		var cityselect = document.getElementById('citylist');
		document.getElementById('CityContainer').removeChild(cityselect);
		}
		var cityselect = document.createElement("select");
		cityselect.setAttribute("id","citylist");
		cityselect.name = "city";
		cityselect.options[0] = new Option("SELECT CITY","");

		j=1;
		for (var i=0; i<myCities.length; i++) {
        cityselect.options[j] = new Option("" + myCities[i] + "","" + myCities[i] + "");
		j++;
		}
		document.getElementById('CityContainer').appendChild(cityselect);

            } else {
                alert('There was a problem with the request.');
            }
        }
		}
		catch( e ) {
            alert('Caught Exception: ' + e.description);
        }
    }

//document.getElementById('CityContainer').replaceChild(cityselect,cityinput);
}

