﻿ function hsearch(){
	txt = document.in_form.x.value;
	if (txt == "") {
	alert ("経度が入力されていません");
	return;
	}
	for (i=0; i<txt.length; i++) {
		c = txt.charAt(i);
		if ("0123456789.-".indexOf(c, 0) < 0) {
			alert ("経度に正しくない値が入力されています");
			return;
		}
	}
	txt = document.in_form.y.value;
	if (txt == "") {
		alert ("緯度が入力されていません");
		return;
	}
	for (i=0; i<txt.length; i++) {
		c = txt.charAt(i);
		if ("0123456789.-".indexOf(c, 0) < 0) {
			alert ("緯度に正しくない値が入力されています");
			return;
		}
	}
	document.hotel2.x.value = document.in_form.x.value;
   	document.hotel2.y.value = document.in_form.y.value;
   	document.hotel2.r.value = document.in_form.r.value;
   	document.hotel2.stay_date.value = document.in_form.stay_date.value;
   	document.hotel2.stay_count.value = document.in_form.stay_count.value;
   	document.hotel2.room_count.value = document.in_form.room_count.value;
   	document.hotel2.adult_num.value = document.in_form.adult_num.value;
   	document.hotel2.sc_num.value = document.in_form.sc_num.value;
   	document.hotel2.lc_num_bed_meal.value = document.in_form.lc_num_bed_meal.value;
   	document.hotel2.h_type.value = document.in_form.h_type.value;
   	if (document.in_form.onsen.checked) {
   		document.hotel2.onsen.value = document.in_form.onsen.value;
	}
   	if (document.in_form.o_bath.checked) {
   		document.hotel2.o_bath.value = document.in_form.o_bath.value;
	}
   	if (document.in_form.pour.checked) {
   		document.hotel2.pour.value = document.in_form.pour.value;
	}
   	if (document.in_form.cloudy.checked) {
   		document.hotel2.cloudy.value = document.in_form.cloudy.value;
	}
   	if (document.in_form.sauna.checked) {
   		document.hotel2.sauna.value = document.in_form.sauna.value;
	}
   	if (document.in_form.mssg.checked) {
   		document.hotel2.mssg.value = document.in_form.mssg.value;
	}
   	if (document.in_form.esthe.checked) {
   		document.hotel2.esthe.value = document.in_form.esthe.value;
	}
   	if (document.in_form.limo.checked) {
   		document.hotel2.limo.value = document.in_form.limo.value;
	}
   	if (document.in_form.high.checked) {
   		document.hotel2.high.value = document.in_form.high.value;
	}
    for (i=0;i<=4;i++) if (document.in_form.meal[i].checked) n = i;
    document.hotel2.meal.value = n;
   	if (document.in_form.pet.checked) {
   		document.hotel2.pet.value = document.in_form.pet.value;
	}
   	document.hotel2.submit();
}
function input_check(){
	txt = document.in_form.stay_date.value;
	if (txt == "") {
		alert ("宿泊開始日が入力されていません");
		return false;
	}
	txt = document.in_form.stay_count.value;
	if (txt == "") {
		alert ("宿泊日数が入力されていません");
		return false;
	}
	txt = document.in_form.room_count.value;
	if (txt == "") {
		alert ("部屋数が入力されていません");
		return false;
	}
}
function go_hotel(id){
    document.hotel.h_id.value = id;
    document.hotel.stay_date.value = document.in_form.stay_date.value;
    document.hotel.stay_count.value = document.in_form.stay_count.value;
    document.hotel.room_count.value = document.in_form.room_count.value;
    document.hotel.adult_num.value = document.in_form.adult_num.value;
    document.hotel.sc_num.value = document.in_form.sc_num.value;
    document.hotel.lc_num_bed_meal.value = document.in_form.lc_num_bed_meal.value;
    for (i=0;i<=4;i++) if (document.in_form.meal[i].checked) n = i;
    document.hotel.meal.value = n;
   	document.hotel.submit();
}
function go_hotel2(x,y,r){
    document.hotel2.x.value = x;
    document.hotel2.y.value = y;
    document.hotel2.r.value = r;
    document.hotel2.submit();
}
function hotel_map(){
    document.hotel_search2.x.value = document.in_form.x.value;
    document.hotel_search2.y.value = document.in_form.y.value;
    document.hotel_search2.r.value = document.in_form.r.value;
    document.hotel_search2.submit();
}
function kodawari() {
	Kodawari=window.open("kodawari.html","kodawari","width=600,height=120,scrollbars=no,resizable=no,location=no,menubar=no");
   	Kodawari.focus();
}

