
function enableCity() {
	document.getElementById("city").disabled = false;
	updateCitiesState(document.getElementById("prefecture").value);
}
function updateCitiesState(iid) {
	http4.open("GET", url4 + escape(iid), true);
	http4.onreadystatechange = handleHttpResponse4;
	http4.send(null);
}
var url4 = "citiesForPrefecturesxmlFRONT.action?id=";
var http4 = getHTTPObject(); // We create the HTTP Object
function getHTTPObject() {
	var xmlhttp;
	if (!xmlhttp && typeof XMLHttpRequest != "undefined") {
		try {
			xmlhttp = new XMLHttpRequest();
		}
		catch (e) {
			xmlhttp = false;
		}
	}
	return xmlhttp;
}
function handleHttpResponse4() {
	if (http4.readyState == 4) {
		results = http4.responseText.split(",");
		cleanCity();
		var metritis = results[0]*2 + 2;
		for (var i = 1; i <= metritis; i = i + 2) {
			var value = results[i];
			var description = results[i + 1];
			addCityOption(description, value);
		}
	}
}
function addCityOption(theText, theValue) {
	var theSel = document.getElementById("city");
	var newOpt = new Option(theText, theValue);
	var selLength = theSel.length;
	theSel.options[selLength] = newOpt;
}
function cleanCity() {
	var elSel = document.getElementById("city");
	while (elSel.length > 0) {
		elSel.remove(elSel.length - 1);
	}
}
function enablePrefecture() {
	document.getElementById("prefecture").disabled = false;
	updatePrefecturesState(document.getElementById("region").value);
}
function updatePrefecturesState(iid) {
	http3.open("GET", url3 + escape(iid), true);
	http3.onreadystatechange = handleHttpResponse3;
	http3.send(null);
}
var url3 = "prefecturesForRegionsxmlFRONT.action?id=";
var http3 = getHTTPObject(); // We create the HTTP Object
function getHTTPObject() {
	var xmlhttp;
	if (!xmlhttp && typeof XMLHttpRequest != "undefined") {
		try {
			xmlhttp = new XMLHttpRequest();
		}
		catch (e) {
			xmlhttp = false;
		}
	}
	return xmlhttp;
}
function handleHttpResponse3() {
	if (http3.readyState == 4) {
		results = http3.responseText.split(",");
		cleanPrefecture();
		var metritis = results[0]*2 + 2;
		for (var i = 1; i <= metritis; i = i + 2) {
			var value = results[i];
			var description = results[i + 1];
			addPrefectureOption(description, value);
		}
	}
}
function addPrefectureOption(theText, theValue) {
	var theSel = document.getElementById("prefecture");
	var newOpt = new Option(theText, theValue);
	var selLength = theSel.length;
	theSel.options[selLength] = newOpt;
}
function cleanPrefecture() {
	var elSel = document.getElementById("prefecture");
	while (elSel.length > 0) {
		elSel.remove(elSel.length - 1);
	}
}


