	var area = {
		0: {'label': '地域を選択してください', 'hotelNo': [0, 31510, 31520, 31630, 31550, 31540, 31570, 31660, 31580, 31680, 31590, 31640,31600, 31650, 31610, 31530, 31690, 31620, 31700]},
		1: {'label': '北海道エリア'		, 'hotelNo': [0, 31510, 31520, 31630, 31550, 31540]},
		2: {'label': '東北エリア'			, 'hotelNo': [0, 31570]},
		3: {'label': '関東エリア'			, 'hotelNo': [0, 31660, 31580]},
		4: {'label': '東海・中部・北陸エリア', 'hotelNo': [0, 31680,31590, 31640]},
		5: {'label': '近畿エリア'			, 'hotelNo': [0, 31600, 31650, 31610, 31530, 31690]},
		6: {'label': '九州・沖縄エリア'		, 'hotelNo': [0, 31620, 31700]}
	};

	// ホテルコードの連想配列 hotelNo: 'ホテル名'
	var hotel = {
		0		: 'ホテル名を選択してください',
		31510	: '札幌グランドホテル',
		31520	: '札幌パークホテル',
		31630	: '章月グランドホテル',
		31550	: 'ホテルコムズ 新千歳空港',
		31540	: '旭川グランドホテル',
		31570	: 'ホテルコムズ 仙台アネックス',
		31660	: '鴨川シーワールドホテル',
		31580	: 'ホテルコムズ 銀座',
		31680	: 'ホテル談露館',
		31590	: 'ホテルコムズ 名古屋',
		31640	: '黒部観光ホテル',
		31600	: 'ホテルコムズ 大津',
		31650	: '白良荘グランドホテル',
		31610	: 'ホテルコムズ 大阪',
		31530	: 'ホテル大阪ベイタワー',
		31690	: 'ホテル・ザ・ルーテル',
		31620	: 'ホテルコムズ 福岡',
		31700	: 'エアラインホテル'
	};

$(function(){
	$("#s_area").html("<select name='hotel' id='select_area'></select>");
	select_area = $("#select_area").get(0);
	
	var rows = area.length;
	for( var i in area ){
		select_area.options[i] = new Option(area[i]['label'],i);
	}
	$("#s_hotel").html("<select name='hotel' id='selcet_hotel'></select>");
	select_hotel = $("#selcet_hotel").get(0);
	area_value = $("#select_area").val();
	for( var i in area[area_value]["hotelNo"]){
		select_hotel.options[i] = new Option(hotel[area[area_value]["hotelNo"][i]],area[area_value]["hotelNo"][i]);
	}
	
	if(hotel_no && hotel_no != 0){
		for(var i in area){
			if(i != 0){
				for(var j in area[i]["hotelNo"]){
					if(area[i]["hotelNo"][j] == hotel_no){
						$("#select_area").val(i);
						change_hotel(i);
						$("#selcet_hotel").val(hotel_no);
						break;
					}
				}
			}
		}
	}

	$("#select_area").change(function (){
		var id = $(this).attr('value');
		change_hotel(id);
	});
	function change_hotel(id){
		$("#s_hotel").html("");
		$("#s_hotel").html("<select name='hotel' id='selcet_hotel'></select>");
		select_hotel = $("#selcet_hotel").get(0);
		for( var i in area[id]["hotelNo"]){
			if(hotel[area[id]["hotelNo"][i]]){
				select_hotel.options[i] = new Option(hotel[area[id]["hotelNo"][i]],area[id]["hotelNo"][i]);
			}
		}
	}
});

