<!--
//////////////////////////////////////////////
// ajax site search
//////////////////////////////////////////////
	function zipSelect(){
		var obj = document.forms["mapType"];
		httpObj = createXMLHttpRequest();
		httpObj.onreadystatechange = getZip;
		httpObj.open("GET","/assessment/commons/getzip.cgi?code="+encodeURI(obj.elements["form[area]"].value)+"&town="+encodeURI(obj.elements["form[municipality]"].value)+"&burg="+encodeURI(obj.elements["form[towns]"].value),true);
		httpObj.send(null);
		return false;
	}
	function getZip(){
		var obj = document.forms["mapType"];
		if ((httpObj.readyState == 4) && (httpObj.status == 200)) {
			var obj = document.forms["mapType"];
			var getAddress = decodeURI(httpObj.responseText);
		}
	}
	function townSelect(selectobj){
//		var obj = document.forms["mapType"];
		var obj = $(selectobj).parents('form:first')[0];
		obj.elements["form[towns]"].options.length = 1;
		obj.elements["form[towns]"].options[0].text = "読み込み中";
		obj.elements["form[towns]"].options[0].value = "";
		httpObj = createXMLHttpRequest();
		httpObj.onreadystatechange = function() {
			if ((httpObj.readyState == 4) && (httpObj.status == 200)) {
//				var obj = document.forms["mapType"];
				var getAddress = decodeURI(httpObj.responseText);
				var getAddressGroup = new Array();
				getAddressGroup = getAddress.split(",");
				obj.elements["form[towns]"].options.length = getAddressGroup.length+1;
				obj.elements["form[towns]"].options[0].value = "";
				obj.elements["form[towns]"].options[0].text = "4.町字丁目";
				for(i=0;i<getAddressGroup.length;i++){
					obj.elements["form[towns]"].options[i+1].value = getAddressGroup[i];
					obj.elements["form[towns]"].options[i+1].text = getAddressGroup[i];
				}
				obj.elements["form[towns]"].disabled = false;
			}
	}
		httpObj.open("GET","/cgi/gettown.cgi?code="+encodeURI(obj.elements["form[area]"].value)+"&town="+encodeURI(obj.elements["form[municipality]"].value),true);
		httpObj.send(null);
		return false;
	}
	function areaSelect(selectobj){
//		var obj = document.forms["mapType"];
		var obj = $(selectobj).parents('form:first')[0];
		var areaName = obj.elements["form[area]"].value;
		obj.elements["form[municipality]"].options.length = 1;
		obj.elements["form[municipality]"].options[0].text = "読み込み中";
		obj.elements["form[municipality]"].options[0].value = "";
		obj.elements["form[towns]"].options.length = 0;
		obj.elements["form[area]"].value = areaName;
		httpObj = createXMLHttpRequest();
		httpObj.onreadystatechange = function() {
			if ((httpObj.readyState == 4) && (httpObj.status == 200)) {
				var getAddress = decodeURI(httpObj.responseText);
				var getAddressGroup = new Array();
				getAddressGroup = getAddress.split(",");
				obj.elements["form[municipality]"].options.length = getAddressGroup.length+1;
				obj.elements["form[municipality]"].options[0].value = "";
				obj.elements["form[municipality]"].options[0].text = "3.市区町村";
				for(i=0;i<getAddressGroup.length;i++){
					obj.elements["form[municipality]"].options[i+1].value = getAddressGroup[i];
					obj.elements["form[municipality]"].options[i+1].text = getAddressGroup[i];
				}
				obj.elements["form[municipality]"].disabled = false;
			}
}
		httpObj.open("GET","/cgi/getaddress.cgi?"+encodeURI(areaName),true);
		httpObj.send(null);
		return false;
	}
	function createXMLHttp() {
		try {
			return new ActiveXObject ("Microsoft.XMLHTTP");
		}catch(e){
			try {
				return new XMLHttpRequest();
			}catch(e) {
				return null;
			}
		}
		return null;
	}
	function createXMLHttpRequest(){
		var XMLhttpObject = null;
		try{
			XMLhttpObject = new XMLHttpRequest();
		}
		catch(e){
			try{
				XMLhttpObject = new ActiveXObject("Msxml2.XMLHTTP");
			}
			catch(e){
				try{
					XMLhttpObject = new ActiveXObject("Microsoft.XMLHTTP");
				}
				catch(e){
					return null;
				}
			}
		}
		return XMLhttpObject;
	}
//////////////////////////////////////////////
//-->
