function date_dropdown_make(year_and_month_id, day_id, add_day, ym_change_func, d_change_func) {
//■■年月セレクトボックス作成
if (navigator.platform.indexOf("Win") != -1){
  if(navigator.userAgent.indexOf("Safari") != -1){ 
    gy = new Date().getYear();
    gy += 1900;
  }else{
    gy = new Date().getFullYear();
  }
}else{
  gy = new Date().getYear();
  if (navigator.appName == "Microsoft Internet Explorer"){
  }else{
    gy += 1900;
  }
}
  gm = new Date().getMonth()+1;

str = ""
sgm = ""
str = "<select name='dt_yyyymm' id='ir_rsv_yyyymm' size='1' class='form_02'>"
//str = str + "<option value='2005/03/01' selected >-------- </option>"

for (i=1; i <= 12; i++ ){

	if(gm > 12){
		gm = 1;
		gy = gy + 1;
	}
	if(gm < 10){
		sgm="0" + gm;
	}
	else {
		sgm="" + gm;
	}
	str=str + "<option value=" + gy + "/" + sgm + "/" + "01 >" + gy + "年 " + sgm + "月" + "</option>"
	gm=gm+1;
}

str = str + "</select>　"
document.write(str);

//■日セレクトボックス作成
str = ""
str = "<select name='dt_dd' id='ir_rsv_dd' size='1' class='form_03'>"
//str = str + "<option value='1' selected >--</option>"

  gd = new Date().getDate();
for (i=1; i <= 31; i++ ){
	sgm=""+ i

	if(sgm==gd){
		str=str + "<option value=" + sgm + " selected >" + i + "日" + "</option>";
	}
	else {
		str=str + "<option value=" + sgm + " >" + i + "日" + "</option>";
	}
}

str = str + "</select>"
document.write(str);
}

/**
 * ホテルのドロップダウンリストをエリアに絞る
 */
function change_hotels_from_area() {

	var area_no = document.getElementById('area').options[document.getElementById('area').selectedIndex].value;

	var areas =
		[
			"エリアを選択してください",
			"北海道",
			"東北",
			"甲信越",
			"北陸",
			"首都圏",
			"関西",
			"九州",
			"沖縄"
		];

	var hotels =
		[
//-- <optgroup>タグによるレイアウト崩れ防止対応
//-- commented by n-tec ---------------------------------------------------
//			[["ホテルグレイスリー札幌",               30, 1],
//			["藤田観光ワシントンホテル旭川",         5,   1],
//			["帯広ワシントンホテル",                 10,  1],
//
//			["青森ワシントンホテル",                 3,   2],
//			["八戸第1・2ワシントンホテル",           21,  2],
//			["山形七日町ワシントンホテル",           26,  2],
//			["山形駅西口ワシントンホテル",           25,  2],
//			["鶴岡ワシントンホテル",                 19,  2],
//			["郡山ワシントンホテル",                 12,  2],
//			["会津若松ワシントンホテル",             2,   2],
//			["いわきワシントンホテル",               7,   2],
//
//			["燕三条ワシントンホテル",               18,  3],
//
//			["ホテルフジタ福井",                     24,  4],
//
//			["秋葉原ワシントンホテル",               4,   5],
//			["ホテルグレイスリー銀座",               29,  5],
//			["ホテルグレイスリー田町",               31,  5],
//			["新宿ワシントンホテル",                 14,  5],
//			["東京ベイ有明ワシントンホテル",         6,   5],
//			["ホテルアジュール竹芝",                 23,  5],
//			["立川ワシントンホテル",                 16,  5],
//			["横浜伊勢佐木町ワシントンホテル",       27,  5],
//			["横浜桜木町ワシントンホテル",           28,  5],
//			["浦和ワシントンホテル",                 8,   5],
//			["千葉ワシントンホテル",                 17,  5],
//
//			["関西エアポートワシントンホテル",       11,  6],
//			["宝塚ワシントンホテル",                 15,  6],
//
//			["キャナルシティ・福岡ワシントンホテル", 22,  7],
//			["佐世保ワシントンホテル",               13,  7],
//			["長崎ワシントンホテル",                 20,  7],
//
//			["沖縄ワシントンホテル",                 9,   8]],
//-- commented by n-tec ---------------------------------------------------

//-- <optgroup>タグによるレイアウト崩れ防止対応
//-- added by n-tec ---------------------------------------------------
			[["ホテルを選択してください", '0', '0']],
//-- added by n-tec ---------------------------------------------------

			[["藤田観光ワシントンホテル旭川",         5,   1],
			["帯広ワシントンホテル",                 10,  1],
			["ホテルグレイスリー札幌",               30, 1]],

			[["青森ワシントンホテル",                 3,   2],
			["八戸第1・2ワシントンホテル",           21,  2],
			["山形七日町ワシントンホテル",           26,  2],
			["山形駅西口ワシントンホテル",           25,  2],
			["鶴岡ワシントンホテル",                 19,  2],
			["会津若松ワシントンホテル",             2,   2],
			["郡山ワシントンホテル",                 12,  2],
			["いわきワシントンホテル",               7,   2]],

			[["燕三条ワシントンホテル",               18,  3]],

			[["ホテルフジタ福井",                     24,  4]],

			[["千葉ワシントンホテル",                 17,  5],
			["浦和ワシントンホテル",                 8,   5],
			["秋葉原ワシントンホテル",               4,   5],
			["ホテルグレイスリー銀座",               29,  5],
			["ホテルグレイスリー田町",               31,  5],
			["東京ベイ有明ワシントンホテル",         6,   5],
			["ホテルアジュール竹芝",                 23,  5],
			["新宿ワシントンホテル",                 14,  5],
			["立川ワシントンホテル",                 16,  5],
			["横浜桜木町ワシントンホテル",           28,  5],
			["横浜伊勢佐木町ワシントンホテル",       27,  5]],

			[["宝塚ワシントンホテル",                 15,  6],
			["関西エアポートワシントンホテル",       11,  6]],

			[["キャナルシティ・福岡ワシントンホテル", 22,  7],
			["長崎ワシントンホテル",                 20,  7],
			["佐世保ワシントンホテル",               13,  7]],

			[["沖縄ワシントンホテル",                 9,   8]]

		];


	var ddl_hotels = document.getElementById('hi_id');
	ddl_hotels.disabled = false;

	removeChildren(ddl_hotels);

	var i;
	var bef_area = -1;

	for (i = 0 ; i < hotels[area_no].length ; i ++) {
//-- <optgroup>タグによるレイアウト崩れ防止対応
//-- commented by n-tec ---------------------------------------------------
//		if (bef_area != hotels[area_no][i][2]) {
//			var optgp = document.createElement('optgroup');
//			optgp.label = areas[hotels[area_no][i][2]];
//
//			ddl_hotels.appendChild(optgp);
//			bef_area = hotels[area_no][i][2];
//		}
//-- commented by n-tec ---------------------------------------------------

		ddl_hotels.options[ddl_hotels.options.length] = new Option(hotels[area_no][i][0], hotels[area_no][i][1]);
	}

}

//	以下関数
function add_action_name_hms(form_name, action) {
	var now = new Date();
	document.getElementById(form_name).action = action + "#" + now.getHours() + now.getMinutes() + now.getSeconds();
	return true;
}

/**
 * 子要素をすべて削除
 */
function removeChildren(x)
{
    if (x.hasChildNodes()) {
        while (x.childNodes.length > 0) {
            x.removeChild(x.firstChild)
        }
    }
}

