var savepref;
var search_condition;
var default_area;
var switch13 = 0;
function return_area(){
	switch13 = 0;
	$("Area").innerHTML = default_area;
}
function Pload(){
	default_area = $("Area").innerHTML;
	AreaOrHome();
}
function AreaOrHome(number){
	if(number == 1){
		$("home_Area").style.display = "block"; 
		$("Area").style.display = "none"; 
	}
	else{
		$("home_Area").style.display = "none"; 
		$("Area").style.display = "block"; 
	}

}
function $(tagId)
{
	return document.getElementById(tagId);
}
function plef_district(lavel,id){
	if(id == 13 && switch13 != 1){
		search_condition = "●エリア："+lavel;
		savepref = search_condition;
		district_city(lavel,'23区',13,1)
	}
	else{
		httpObj3 = createXMLHttpRequest(areaData);
		if (httpObj3)
		{	
			search_condition = "●エリア："+lavel;
			savepref = search_condition;
			httpObj3.open("POST","temple/map_php/home_pref_district.php",true);
			httpObj3.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
			var sendData = "&pref_id="+encodeURI(id);
			sendData += "&lavel="+encodeURI(lavel);
			sendData += "&pref="+encodeURI(search_condition);
			httpObj3.send(sendData);
		}
	}
}
function district_city(lavel,dlavel,pref_id,id){
	httpObj3 = createXMLHttpRequest(areaData);
	if (httpObj3)
	{
		switch13 = 1;
		httpObj3.open("POST","temple/map_php/home_district_city.php",true);
		httpObj3.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
		var sendData = "&district_id="+encodeURI(id);
		sendData += "&pref_id="+encodeURI(pref_id);
		sendData += "&lavel="+encodeURI(lavel);
		sendData += "&dlavel="+encodeURI(dlavel);
		sendData += "&pref="+encodeURI(search_condition);
		httpObj3.send(sendData);
	}
	
}
function areaData(){
	if ((httpObj3.readyState == 4) && (httpObj3.status == 200))
	{
		$("Area").innerHTML = get_response_text(httpObj3);
	}else{
		$("Area").innerHTML = "";
	}
}
