<!--
//変数定義----------------------------------------
now_infowindowopen = -1;			//現在開かれている簡易マーカー番号(0〜)
pre_infowindowopen = -1;			//クリックされた簡易マーカー番号(0〜)

search_checked = 0;					//検索分類
max_kosuu = 300;					//最大マーカー表示数
scrollable_div = "menu";		//現在スクロール可能なdiv名(for Mobile)

//関数定義----------------------------------------

function $(id){return (typeof id =='string')?document.getElementById(id):id;}

init_no_load_flag = 1;
function initialize(){
	geocoder = new google.maps.Geocoder();
	var myOptions = {
		zoom: 8,
		center: new google.maps.LatLng(35.681391,139.766103),
		mapTypeId: google.maps.MapTypeId.ROADMAP,
		navigationControl: true,
		navigationControlOptions: {
			position: google.maps.ControlPosition.LEFT
		},
		mapTypeControl: true,
		mapTypeControlOptions: {
			style: google.maps.MapTypeControlStyle.HORIZONTAL_BAR,
			position: google.maps.ControlPosition.BOTTOM
		},
		scaleControl: true,
		scaleControlOptions: {
			position: google.maps.ControlPosition.TOP_RIGHT
		}
	};
	map = new google.maps.Map(document.getElementById("map_canvas"), myOptions);


	google.maps.event.addListener(map, 'bounds_changed', function(){
		function finished(){
			google.maps.event.trigger(map, 'moveend');
		}
		clearTimeout(this.timeout);
		this.timeout = setTimeout(finished, 1000);
	});
	google.maps.event.addListener(map, 'moveend', function(){
		//取得範囲を取得
		wbounds = map.getBounds();
		sw = wbounds.getSouthWest();
		ne = wbounds.getNorthEast();
		if(init_no_load_flag){
			init_no_load_flag = 0;
			show_status("この地図はマウスで自由に動かすことができます");
		}else{
			search_ajax(1,ne.lng(),ne.lat(),sw.lng(),sw.lat());
		}
	});

	onload_map();
}

function pz(tmp_lon,tmp_lat){//panto and zoom
	map.set_center(new google.maps.LatLng(tmp_lat,tmp_lon));
	map.setZoom(map.getZoom()+1);

}

function oi(tmp_num,tmp_lon,tmp_lat){
	//自作OpenInfowindow関数
	//infowindowopen前に実行しておく

	//地点遷移時の読み込み防止
	pre_infowindowopen = tmp_num;
	//簡易マーカーを消す
	clearSimpleOverlays();

	search_ajax(2,tmp_lon,tmp_lat);
}

function make_simple_marker(data_type_flag){//1:,通常3:クラスタリング済みデータ。[2]が異なる。

	clearSimpleOverlays();
	marker_results_html = "";
	marker_results_array = new Array();
	all_tag_array = new Array();
	tag_max_count = new Array();
	hotel_num_length = 0;
	hotel_num_list = new Array();//15件づつ格納

	for(i=0;i<get_data_split.length;i++){
		if(!get_data_split[i]){break;}
		get_data_detail = get_data_split[i].split(",");

		if(data_type_flag == "3" && get_data_detail[2] == "c"){
			style_class = "c";style_delta = new Array(10,10);style_a = "<img src='./img/search.png' width='16' height='16' border='0' />";
			a_behavior = " onclick='pz("+get_data_detail[0]+","+get_data_detail[1]+")'";
		}else{
			style_class = "f";style_delta = new Array(3,5);style_a = "●";
			a_behavior = "";// onclick='oi("+i+","+get_data_detail[0]+","+get_data_detail[1]+")'
		}

		var tmp_x = Math.floor(((eval(get_data_detail[0])-sw.lng())/(ne.lng()-sw.lng()))*(size_x-x_0))+x_0-style_delta[0];
		var tmp_y = Math.floor((size_y-y_0)-((eval(get_data_detail[1])-sw.lat())/(ne.lat()-sw.lat()))*(size_y-y_0))+y_0-style_delta[1];

		var nlayoj = document.createElement('div');
		nlayoj.setAttribute('id',"nlayoj"+i);
		nlayoj.innerHTML      = "<A href='javascript:void(0)' class='"+style_class+"' "+a_behavior+">"+style_a+"</A>";
		nlayoj.style.position = 'absolute';
		nlayoj.style.left     = tmp_x+'px';
		nlayoj.style.top      = tmp_y+'px';
		nlayoj.style.width    = '10px';
		nlayoj.style.height   = '10px';
  
		//divをbodyへ追加
		document.body.appendChild(nlayoj);

		if(get_data_split.length <= 50 && data_type_flag == "1"){
			//結果が50件未満なら結果出力
			if(get_data_detail[6]){
			//タグ情報あり
				get_tags_array = get_data_detail[6].split("|");
				all_tag_array[eval(get_data_detail[4])] = new Array();
				for(t=0;t<get_tags_array.length;t++){
					get_this_tag = get_tags_array[t].split("-");
					all_tag_array[eval(get_data_detail[4])][get_this_tag[0]] = eval(get_this_tag[1]);
					if(!tag_max_count[get_this_tag[0]] || tag_max_count[get_this_tag[0]] < get_this_tag[1]){tag_max_count[get_this_tag[0]] = eval(get_this_tag[1]);}
				}
				//marker_results_html += "<LI><A href='javascript:push_favorite(\""+get_data_detail[4]+"\",\""+get_data_detail[2]+"\",\""+get_data_detail[3]+"\");'>★</A><A href='javascript:map_panto("+get_data_detail[1]+","+get_data_detail[0]+")' onmouseover='map_preview(1,"+get_data_detail[1]+","+get_data_detail[0]+")' onmouseout='map_preview(0,0,0);'>[Map]</A><A href='http://xn--u9jth3b6dxa3ez495a.com/"+get_data_detail[3]+"'>"+get_data_detail[2]+"</A></LI>";
			}
			marker_results_array[eval(get_data_detail[4])] = "<LI><A href='http://xn--u9jth3b6dxa3ez495a.com/"+get_data_detail[3]+"' onmouseover='map_preview(1,"+get_data_detail[1]+","+get_data_detail[0]+")' onmouseout='map_preview(0,0,0);' target='_blank'>"+get_data_detail[2]+"</A></LI><div style='text-align:right;font-size:12px;'><a href='./redirect_official.php?q="+encodeURI(get_data_detail[2])+"' target='_blank' title='公式ホームページと思われるページにジャンプします'>公式HP</a></div>";

			if(get_data_detail[5]){
			//楽ID情報あり（料金出力用）
				marker_results_array[eval(get_data_detail[4])] += "<div id='price_"+get_data_detail[5]+"' style='font-size:80%'></div>";
				hotel_num_length++;
				if(hotel_num_list[Math.floor((hotel_num_length-1)/15)]){hotel_num_list[Math.floor((hotel_num_length-1)/15)] += ",";}else{hotel_num_list[Math.floor((hotel_num_length-1)/15)] = "";}
				hotel_num_list[Math.floor((hotel_num_length-1)/15)] += get_data_detail[5];//ra_id
			}
		}
	}

	if(get_data_split.length <= 50 && data_type_flag == "1"){
		//結果が50件未満なら結果出力
		show_status("左のリストからお好みのホテルをお選びください．");
		for(key1 in marker_results_array){
			show_topx = 5;
			nowcc = 0;
			tmp_replace_html = "<font style='font-size:80%'>";
			if(all_tag_array[key1]){
				for(key2 in all_tag_array[key1]){
					this_count_percent = all_tag_array[key1][key2]/tag_max_count[key2];
					if(this_count_percent > 0.9){bar_color = "4";}else if(this_count_percent > 0.75){bar_color = "3";}else if(this_count_percent > 0.5){bar_color = "2";}else{bar_color = "1";}

					this_img_length = Math.floor(60*this_count_percent);
					tmp_replace_html += '<img id="bar1" src="img/percentImage.png" class="percentImage'+bar_color+'" style="background-position:-'+(120-this_img_length)+'px 0pt;" width="62" height="6"> '+key2+'<br />';
					nowcc++;
					if(nowcc >= show_topx){break;}
				}
			}
			tmp_replace_html += "</font>";
			marker_results_html += marker_results_array[key1]+tmp_replace_html;
		}
		
		for(key1 in marker_results_array){
		}
		search_list_show("<UL>"+marker_results_html+"</UL>");
		get_rakuten_api();
	}else{
		show_status("さらに50件以下に絞ると範囲内の全ホテルを比較できます．<a href='javascript:map.setZoom(map.getZoom()+1)'>→拡大</a>");
		search_list_show();
	}

}

function make_marker(){

	//仕様変更でget_data_splitは選択された一個のみである為あまり意味はない
	for(i=0;i<get_data_split.length;i++){
		if(!get_data_split[i]){break;}
		get_data_detail = get_data_split[i].split(",");

		var point = new GLatLng(get_data_detail[1],get_data_detail[0]);
		var pophtml = '<div style="width: 250px;height: 250px; font-size: 12px"><B style="font-size:15px">'+get_data_detail[2]+'</B> (評価：'+get_data_detail[6]+')<BR />'+get_data_detail[7]+'<BR /><DIV style="text-align:center"><A href="http://xn--u9jth3b6dxa3ez495a.com/'+get_data_detail[3]+'"><IMG src="'+get_data_detail[5]+'" height="150"><BR />クリックすると詳細や口コミを表示します</A></DIV><BR /><A href="javascript:push_favorite(\''+get_data_detail[4]+'\',\''+get_data_detail[2]+'\',\""+get_data_detail[3]+"\")">★このホテルをマイリストに追加し後で見る</A></div>';
		var marker = show_marker(point,pophtml);
		map.addOverlay(marker);
	}

	//仕様変更で選択された一個のみふきだし表示の為即表示する
	now_infowindowopen = pre_infowindowopen;
	marker.openInfoWindowHtml(pophtml);

}

function show_marker(point,pophtml){

	var icon = new GIcon(baseIcon);
	icon.image = "http://xn--u9jth3b6dxa3ez495a.com/img/marker_1.png";

	var marker = new GMarker(point,icon);

	//仕様変更で選択された一個のみふきだし表示の為即表示する
	//GEvent.addListener(marker, "click", function() {
	//	now_infowindowopen = 1;
	//	marker.openInfoWindowHtml(pophtml);
	//});
	return marker;
}


function search_ajax(mode,a,b,c,d){
	show_status('<img src="./img/loading.gif" width="16" height="22"> 通信中です ... お待ちください ...');

	//mode:1→簡易マーカーモード,2→詳細マーカーモード(GMapノーマル)
	httpObj = createXMLHttpRequest(res_search_ajax);
	if(httpObj){
		if(!c || !d){c=d="";}
		httpObj.open("GET","pc_map_ajax.php?mode=marker&mmode="+mode+"&maxlon="+a+"&maxlat="+b+"&minlon="+c+"&minlat="+d+"&time="+new Date().getTime(),true);
		httpObj.send(null);
	}
}
function res_search_ajax(){
	if((httpObj.readyState == 4) && (httpObj.status == 200)){

	if(now_infowindowopen != -1){return false;}
	now_tag_search_submit = 0;

		all_get_data = httpObj.responseText.split("<<>>");

		$("res").innerHTML = all_get_data[0];

		if(all_get_data[2]){

			//CLEAR OVERLAY
			//map.clearOverlays();

			get_data_split = all_get_data[2].split("<>");
			if(!get_data_split[get_data_split.length]){get_data_split.pop();}
	
			if(all_get_data[1] == 2){
				make_marker();
			}else{
				show_status('マーカーを表示しています ...');
				setTimeout("make_simple_marker(all_get_data[1]);",10);
			}
		}else{
			if(all_get_data[0] == "0"){
				show_status("この縮尺ではホテルは見つかりませんでした .<a href='javascript:map.setZoom(map.getZoom()-1)'>→縮小</a>");
			}else{
				show_status("左メニューからこの範囲内のランキングを表示するか，300件以下に絞る(<a href='javascript:map.setZoom(map.getZoom()+1)'>→拡大</a>)ことで範囲内全ホテルを表示します .");
			}
			clearSimpleOverlays();
			search_list_show();
		}

	}
}

function clearSimpleOverlays(){

	for(i=0;i<max_kosuu;i++){
		if ($("nlayoj"+i)){
			document.body.removeChild($("nlayoj"+i));
		}else{break;}
	}

}


function map_preview(show_flag,tmp_y,tmp_x){
	if(show_flag){
		if(sw.lng() > tmp_x || ne.lng() < tmp_x || sw.lat() > tmp_y || ne.lat() < tmp_y){return false;}
		var tmp_x2 = Math.floor(((tmp_x-sw.lng())/(ne.lng()-sw.lng()))*(size_x-x_0))+x_0-10;
		var tmp_y2 = Math.floor((size_y-y_0)-((tmp_y-sw.lat())/(ne.lat()-sw.lat()))*(size_y-y_0))+y_0-10;

		var nlayoj = document.createElement('div');
		nlayoj.setAttribute('id',"preview");
		nlayoj.innerHTML      = "<font color='#ff00ff' style='font-size:20px'>●</font>";
		nlayoj.style.position = 'absolute';
		nlayoj.style.left     = tmp_x2+'px';
		nlayoj.style.top      = tmp_y2+'px';
		nlayoj.style.width    = '20px';
		nlayoj.style.height   = '20px';
  
		//divをbodyへ追加
		document.body.appendChild(nlayoj);
	}else{
		if($("preview")){document.body.removeChild($("preview"));}
	}
}


function show_status(tmp_infomsg){
	clearTimeout(this.timermsg);
	this.timermsg = setTimeout(hidden_msg, 6000);
	$('info').style.display = "block";
	if(tmp_infomsg.length >= 100){tmp_infomsg = "<font style='font-size:80%'>"+tmp_infomsg+"</font>";}
	$("status").innerHTML = tmp_infomsg;
}

function hidden_msg(){
	if($('info').style.display == "block"){$('info').style.display = "none";}
}

function search_list_show(tmp_innertext){
	if(!tmp_innertext){
		tmp_innertext = "";
		scrollable_div = "menu";
		$("menu").style.display = "block";
		$("search_list").style.display = "none";
		$("search_list").innerHTML = "";
	}else if($("search_list").style.display == "none"){
		scrollable_div = "search_list";
		$("search_list").style.display = "block";
		$("menu").style.display = "none";
	}
	$("search_list").innerHTML = "<div class='menu_bar'>地図上のホテル<a href='javascript:void(0)' onclick='search_list_show()'>[×]</a></div><div style='text-align:right'><font style='font-size:80%;color:gray;'>※ホテル名をクリックすると特徴語抽出に用いた口コミを閲覧できます。</font></div>"+tmp_innertext;
}
function searchhotel_list_show(tmp_innertext){
	if(!tmp_innertext){
		tmp_innertext = "";
		$("searchhotel_list").style.display = "none";
		$("searchhotel_list").innerHTML = "";
	}else if($("searchhotel_list").style.display == "none"){
		$("searchhotel_list").style.display = "block";
	}
	$("searchhotel_list").innerHTML = "<div class='menu_bar'>ホテル検索結果 <a href='javascript:void(0)' onclick='searchhotel_list_show()'>[×]</a></div>"+tmp_innertext;
}

function resize(){
	get_win_size();
	$("map_canvas").style.width = (size_x-210)+"px";
	$("info").style.width = (size_x-210)+"px";
	if($("scroll_down")){$("scroll_down").style.top = (size_y-40)+"px";}
	//$("map_canvas").style.height = size_y+"px";
}

function codeAddress(){
	var address = $("search").value;
	
	if(search_checked == 1){
		//ホテル名検索
			socket_url = "search.php?q="+address+"&time="+new Date().getTime();
			httpObjsh = createXMLHttpRequest(res_searchbox_ajax);
			if(httpObjsh){
				httpObjsh.open("GET",socket_url,true);
				httpObjsh.send(null);
			}
	}else if(geocoder){
		//地名検索
		geocoder.geocode( { 'address': address}, function(results, status){
			if(status == google.maps.GeocoderStatus.OK){
				map.setCenter(results[0].geometry.location);
				if(map.getZoom() < 12){map.setZoom(10);}
			}else{
				show_status("場所を特定できません。別の語句を試してください。");
			}
		});
	}
}
function res_searchbox_ajax(){
	if((httpObjsh.readyState == 4) && (httpObjsh.status == 200)){
		searchhotel_list_show(httpObjsh.responseText);
	}
}

function map_panto(lat,lon){
	map.setCenter(new google.maps.LatLng(lat,lon));
}

// HTTP通信用、共通関数
function createXMLHttpRequest(cbFunc){
	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;
			}
		}
	}
	if (XMLhttpObject) XMLhttpObject.onreadystatechange = cbFunc;
	return XMLhttpObject;
}

//------------------------------------------------------------
//for mobile

function scroll_div(doing){

	if(doing == "up"){
		$(scrollable_div).scrollTop-=100;
	}else if(doing == "down"){
		$(scrollable_div).scrollTop+=100;
	}

}

//------------------------------------------------------------
//タグサーチ関係
//------------------------------------------------------------

now_tag_search_submit = 0;
function tag_search_ajax(){
	if(now_tag_search_submit){return;}
	if(now_tag_choice_length == 0){alert("最低1つは条件を指定してください");return;}
	now_tag_search_submit = 1;
	tag_list_txt = "";
	for(t=0;t<tag_list.length;t++){
		if(tag_list[t]['choice']){
			tag_list_txt += "&tag[]="+tag_list[t]['tname'];
		}else{break;}
	}

	sw = wbounds.getSouthWest();
	ne = wbounds.getNorthEast();
	
	show_status('<img src="./img/loading.gif" width="16" height="22"> 通信中です ... お待ちください ...');

	httpObj = createXMLHttpRequest(res_search_ajax);
	if(httpObj){
		httpObj.open("GET","pc_map_ajax.php?mode=search&maxlon="+ne.lng()+"&maxlat="+ne.lat()+"&minlon="+sw.lng()+"&minlat="+sw.lat()+tag_list_txt,true);
		httpObj.send(null);
	}
}

	now_tag_choice_length = 0;
	first_tag_list = ["s:総合評価","t:安い","t:美味しい","t:近い","t:広い","t:静か","t:良い","t:満足"];
	tag_list = [];
	for(t=0;t<first_tag_list.length;t++){
		tag_list[t] = [];
		tag_list[t]['tid'] = t;
		if(first_tag_list[t].charAt(0) == "s"){tag_list[t]['choice'] = 1;now_tag_choice_length++;}else{tag_list[t]['choice'] = 0;}
		tag_list[t]['tname'] = first_tag_list[t];
	}

function tag_search_div(){

	made_tag_search_div = "";
	for(t=0;t<tag_list.length;t++){
		rank_change_enable = [1,1];//0:up,1:down
		if(tag_list[t]['choice']){checked_txt = ' checked="checked";';checked_color = '';}else{checked_txt = '';checked_color = 'gray';rank_change_enable = [0,0];}
		if(rank_change_enable[0] && typeof(tag_list[t-1]) == "undefined"){rank_change_enable[0] = 0;}
		if(rank_change_enable[1]){
			if(typeof(tag_list[t+1]) == "undefined"){rank_change_enable[1] = 0;
			}else if(!tag_list[t+1]['choice']){rank_change_enable[1] = 0;}
		}
		
		rank_change_link = [];
		if(rank_change_enable[0]){rank_change_link[0] = '<a href="javascript:;" onclick="tag_search_change('+tag_list[t]['tid']+',\'up\');">↑</a>';}else{rank_change_link[0] = '<font color="gray">↑</font>';}
		if(rank_change_enable[1]){rank_change_link[1] = '<a href="javascript:;" onclick="tag_search_change('+tag_list[t]['tid']+',\'down\');">↓</a>';}else{rank_change_link[1] = '<font color="gray">↓</font>';}
		tmp_tname = tag_list[t]['tname'].split(":");
		if(tmp_tname[0] == "t"){tmp_tname[1] = "口コミで<b>"+tmp_tname[1]+"</b>と評判";}
		made_tag_search_div += rank_change_link[0]+rank_change_link[1]+'<input type="checkbox" name="tag[]" value="'+tmp_tname[1]+'" id="tag_'+t+'" onclick="tag_search_change('+tag_list[t]['tid']+',\'check\');"'+checked_txt+'><label for="tag_'+t+'" style="cursor:hand;cursor:pointer";><font color="'+checked_color+'"> '+tmp_tname[1]+'</font></label><br />';
	}
	$('tag_search_div').innerHTML = "優先順位【高】<br />"+made_tag_search_div+"優先順位【低】";

}

function tag_search_change(tid,doing){
	for(t=0;t<tag_list.length;t++){
		if(tag_list[t]['tid'] == tid){
			tmp_tag_list = [];
			if(doing == "up"){
				if(tag_list[t-1] && tag_list[t-1]['choice']){
					tmp_tag_list['tid'] = tag_list[t]['tid'];
					tmp_tag_list['tname'] = tag_list[t]['tname'];
					tag_list[t]['tid'] = tag_list[t-1]['tid'];
					tag_list[t]['tname'] = tag_list[t-1]['tname'];
					tag_list[t-1]['tid'] = tmp_tag_list['tid'];
					tag_list[t-1]['tname'] = tmp_tag_list['tname'];
				}
			}else if(doing == "down"){
				if(tag_list[t+1] && tag_list[t+1]['choice']){
					tmp_tag_list['tid'] = tag_list[t]['tid'];
					tmp_tag_list['tname'] = tag_list[t]['tname'];
					tag_list[t]['tid'] = tag_list[t+1]['tid'];
					tag_list[t]['tname'] = tag_list[t+1]['tname'];
					tag_list[t+1]['tid'] = tmp_tag_list['tid'];
					tag_list[t+1]['tname'] = tmp_tag_list['tname'];
				}
			}else if(doing == "check"){
				if(!tag_list[t]['choice']){
					if(now_tag_choice_length >= 4){
						alert("5つ以上は選択できません");
					}else{
						tag_list[t]['choice'] = 1;
						now_tag_choice_length++;
					}
				}else{
					tag_list[t]['choice'] = 0;
					now_tag_choice_length--;
				}
				//choice sort
				tag_list.sort( function (b1, b2) { return b1['choice'] < b2['choice'] ? 1 : -1; } );
			
			}
			break;
		}
	}
	tag_search_div();

}



//------------------------------------------------------------

now_suggest = "";
function suggest_related_word(){
	if(now_suggest == $('search').value || search_checked){return;}
	now_suggest = $('search').value;

	httpObjs2 = createXMLHttpRequest(res_suggest_related_word);
	if(httpObjs2){
		httpObjs2.open("GET","http://xn--u9jth3b6dxa3ez495a.com/getrelatedwords_server.php?q="+encodeURI(now_suggest),true);
		httpObjs2.send(null);
	}
}
function res_suggest_related_word(){
	if((httpObjs2.readyState == 4) && (httpObjs2.status == 200)){
		save_li = [];
		get_realted_words = httpObjs2.responseText.split("<>");
		for(gr=0;gr<get_realted_words.length;gr++){
			if(!get_realted_words[gr]){continue;}
			get_realted_words_array = get_realted_words[gr].split(",");
			if(!get_realted_words_array[1]){continue;}
			save_li[save_li.length] = "<li><a href='javascript:void(0)' onclick='suggest_click(\""+get_realted_words_array[1]+"\",\""+get_realted_words_array[2]+"\",\""+get_realted_words_array[3]+"\")'>"+get_realted_words_array[1]+"</a></li>";
		}
		make_li();
	}
}


function make_li(){
	return_suggest_html = "";
	if(save_li.length != 0){
		for(sw=0;sw<save_li.length;sw++){
			return_suggest_html += save_li[sw];
		}
		$('suggest').innerHTML = return_suggest_html;
		$('suggest').style.display = "block";
	}else{
		$('suggest').style.display = "none";
	}
}
function suggest_click(cwords,clat,clon){
	$('suggest').style.display = "none";
	$('search').value = cwords;
	if(!clat){codeAddress();}else{map_panto(clat,clon);if(map.getZoom() < 14){map.setZoom(14);}}
}


//------------------------------------------------------------

function get_rakuten_api(){
	//removeChild
	for(j=0;j<hotel_num_list.length;j++){
		var d=document;
		var s=d.createElement('script');
		s.src='http://api.rakuten.co.jp/rws/3.0/json?developerId=d1390c3ea613acdd8ede2b075a52088f&operation=SimpleHotelSearch&version=2009-09-09&hotelNo='+hotel_num_list[j]+'&responseType=small&callBack=return_rakuten_api';
		d.getElementsByTagName('head')[0].appendChild(s);
	}
}

function return_rakuten_api(data){
	if(data.Header.Status == "Success"){
		var hotelList = data.Body.SimpleHotelSearch.hotel;
		for(var i = 0; i < hotelList.length; i++) {
			var hotelNo = hotelList[i].hotelBasicInfo.hotelNo;
			var hotelMinCharge = hotelList[i].hotelBasicInfo.hotelMinCharge;
			if(hotelMinCharge != null){$('price_'+hotelNo).innerHTML = hotelMinCharge+"円";}
		}
	}

}


//-->