/***********************************************************
 * JTBHPトップページ：検索BOX用スクリプト：column1.js
 * ※事前に読み込みが必要なJSファイル
 * 		/common/js/swfobject.js
 * 		/common/js/swfmw.js
 * 		/toppageparts2/index.js
 * 
 * 2009/10/27 H.INOUE  release
 * 2009/10/28 H.INOUE  edit
 * 2009/11/09 H.INOUE  海外航空券→トルノス切替準備
 * 2009/12/10 H.INOUE  「人気の方面」表示制御
 * 2009/12/10 H.INOUE  海外航空券→トルノス切替リリース
 * 2009/12/17 H.INOUE  bugfix
 * 2010/02/23 H.INOUE  海外航空券トルノスパラメータ追加(link)＋fitair-tr\Config.xml変更
 * 2010/03/08 H.INOUE  海外ホテル→トルノス切替
 * 2010/08/09 T.FUJITA 「海外旅行」「国内旅行」を選択したときに、商材ボタンが表示初期化されない不具合修正
***********************************************************/

// **************
//      関数
// **************

// 変数初期化
	function column1_setVarInit()
	{
		yadoSubArea.length = 0;
		domtourPref.length = 0;
		domdpData.length = 0;
		tktPref.length = 0;
		busArea.length = 0;

		xDocA = null;
		xDocJ = null;
		xDocL = null;
		xDocAir = null;
		xDocAir_cr = null;
		xDocAir_ct = null;
		xDocHotel = null;
		xDocHotel_cr = null;
		xDocHotel_ct = null;
		xDocTour = null;
		xDocTour_cr = null;
		xDocTour_ct = null;

		domdp_rsv = null;
		domdp_datemin = null;
		domdp_datemax = null;

		ovstour_country = null;
		ovstour_city = null;
		ovstour_country_cd = null;
		ovstour_country_name_jpn = null;
		ovstour_city_cd = null;
		ovstour_city_name_jpn = null;

		fitair_country = null;
		fitair_city = null;
		fitair_country_cd = null;
		fitair_country_name_jpn = null;
		fitair_city_cd = null;
		fitair_city_name_jpn = null;

		fithotel_country = null;
		fithotel_city = null;
		fithotel_country_cd = null;
		fithotel_country_name_jpn = null;
		fithotel_city_cd = null;
		fithotel_city_name_jpn = null;

		fittour_country = null;
		fittour_city = null;
		fittour_country_cd = null;
		fittour_country_name_jpn = null;
		fittour_city_cd = null;
		fittour_city_name_jpn = null;
	}

// 検索タブ（国内旅行・海外旅行）セット
	function column1_setTab( tab, nested )
	{
		switch ( tab )
		{
			// 国内旅行
			case 1:
				SetImage( "tab1", "/images2/tab_kokunai_stay.gif" );
				SetImage( "tab2", "/images2/tab_kaigai.gif" );
				$("radioArea1").style.display = "block";
				$("radioArea2").style.display = "none";
				$("column1_kokunaitab").style.display = "block";
				$("column1_kaigaitab").style.display = "none";
				$("synergy_dom").style.display = "block";
				$("synergy_ovs").style.display = "none";
				if ( shozaino > 5 ) shozaino = 1;
				break;
			// 海外旅行
			case 2:
				SetImage( "tab1", "/images2/tab_kokunai.gif" );
				SetImage( "tab2", "/images2/tab_kaigai_stay.gif" );
				$("radioArea1").style.display = "none";
				$("radioArea2").style.display = "block";
				$("column1_kokunaitab").style.display = "none";
				$("column1_kaigaitab").style.display = "block";
				$("synergy_dom").style.display = "none";
				$("synergy_ovs").style.display = "block";
				if ( shozaino < 6 ) shozaino = 6;
				break;
			// デフォルト
			default:
				SetImage( "tab1", "/images2/tab_kokunai_stay.gif" );
				SetImage( "tab2", "/images2/tab_kaigai.gif" );
				$("radioArea1").style.display = "block";
				$("radioArea2").style.display = "none";
				$("column1_kokunaitab").style.display = "block";
				$("column1_kaigaitab").style.display = "none";
				$("synergy_dom").style.display = "block";
				$("synergy_ovs").style.display = "none";
				shozaino = 1;
				break;
		}
		// 相互にタブ切り替え制御があるため nested=true でループしないようにする
		if( column2_setTab && !nested )
			column2_setTab(tab, true);
		var _elem = document.getElementById('s' + shozaino);
		if( _elem && _elem.onclick ){
			// ボタンをマウスオーバー状態にする
			overShozai( _elem.id );
			// ボタンを押す
			_elem.onclick();
		}else
			column1_setShozai( shozaino );
	}

// 商材毎に表示を制御する
	function column1_setShozai( s )
	{
		shozaino = parseInt(s, 10);

		// トルノス対応
		if ( shozaino == 7 && document.TornosChangeForm.tr.value == "1" ) shozaino = 10;
		if ( shozaino == 10 && document.TornosChangeForm.tr.value == "0" ) shozaino = 7;
		if ( shozaino == 8 && document.TornosChangeForm.tr.value == "1" ) shozaino = 11;
		if ( shozaino == 11 && document.TornosChangeForm.tr.value == "0" ) shozaino = 8;
		
		// クッキーセット
		setTimeout( function(){ setCookie( "SHOZAI", shozaino, getExpDate( 30, 0, 0 ), "/", ".jtb.co.jp" ) } , 1 ) ;
		
		// ラジオボタンセット
		// $( "s" + aShozai[ shozaino ].no ).checked = true;
		
		// titleimg1属性に値が無ければ、「××を地図から探す」画像を表示しない
		$( "map_img" ).style.display = "block";
		if ( aShozai[ shozaino ].titleimg1 == "" )
		{
			$( "TitleImage1" ).style.display = "none";
		}
		else
		{
			$( "TitleImage1" ).style.display = "block";
			$( "TitleImage1" ).innerHTML = aShozai[ shozaino ].titleimg1;
		}
		
		// titleimg2属性に値が無ければ、「××を条件から探す」ブロックを全て表示しない
		if ( aShozai[ shozaino ].titleimg2 == "" )
		{
			$( "search-condition1" ).style.display = "none";
		}
		else
		{
			$( "search-condition1" ).style.display = "block";
			$( "TitleImage2" ).innerHTML = aShozai[ shozaino ].titleimg2;
			
			// 商材毎の初期化処理
			column1_setVarInit();
			switch ( shozaino )
			{
				// 旅館・ホテル
				case 1:
					setYadoSubArea();
					var today = new Date();
					document.bsForm2.datemin.value = ( today.getHours() < 23 ) ? "0" : "1";
					yado_onChangePim();
					yado_onChangeJk( document.bsForm.jk[document.bsForm.jk.selectedIndex].value );
					break;
				// 国内ツアー
				case 2:
					setDomTourPref();
					domtour_onChangePim();
					domtour_onChangeArea( document.domtourForm.area[document.domtourForm.area.selectedIndex].value );
					break;
				// JR・航空＋宿泊
				case 3:
					setRsv();
					//domdp_onChangePim();
					break;
				// レジャーチケット
				case 4:
					setTktPref();
					ticket_onChangeLargeArea(document.tktForm.largearea[document.tktForm.largearea.selectedIndex].value);
					break;
				// 高速路線バス
				case 5:
					setBusArea();
					bus_setAnft();
					bus_onChangePim();
					break;
				// 海外ツアー
				case 6:
					ovstour_country = document.ovstourForm.destcountrycd;
					ovstour_city    = document.ovstourForm.destcitycd;
					ovstour_onChangePim();
					ovstour_onChangeArea( document.ovstourForm.destareacd[document.ovstourForm.destareacd.selectedIndex].value )
					break;
				// 海外航空券
				case 7:
					fitair_country = document.fitairForm.destcountrycd;
					fitair_city    = document.fitairForm.destcitycd;
					fitair_onChangePim();
					fitair_onChangeArea( document.fitairForm.destareacd[document.fitairForm.destareacd.selectedIndex].value );
					break;
				// 海外ホテル
				case 8:
					fithotel_country = document.fithotelForm.destcountrycd;
					fithotel_city    = document.fithotelForm.destcitycd;
					fithotel_SetPID();
					fithotel_GetCountry( document.fithotelForm.destareacd[document.fithotelForm.destareacd.selectedIndex].value );
					break;
				// 海外現地ツアー
				case 9:
					fittour_country = document.fittourForm.destcountrycd;
					fittour_city    = document.fittourForm.destcitycd;
					fittour_SetPID();
					fittour_GetCountry( document.fittourForm.destareacd[document.fittourForm.destareacd.selectedIndex].value );
					break;
				// 海外航空券（トルノス）
				case 10:
					//fitair_country = document.fitairTrForm.destcountrycd;
					//fitair_city    = document.fitairTrForm.destcitycd;
					//fitair_tr_onChangePim();
					//fitair_tr_onChangeArea( document.fitairTrForm.destareacd[document.fitairTrForm.destareacd.selectedIndex].value );
					
					tornossearch_Init();
					break;
				// 海外ホテル（トルノス）
				case 11:
					tornoshotel_Init();
					break;
				default:
					break;
			}
		}
		
		// titleimg3属性に値が無ければ、「××をキーワード から探す」ブロックを全て表示しない
		if ( aShozai[ shozaino ].titleimg3 == "" )
		{
			$( "search-condition2" ).style.display = "none";
		}
		else
		{
			$( "search-condition2" ).style.display = "block";
			$( "TitleImage3" ).style.display = "block";
			$( "TitleImage3" ).innerHTML = aShozai[ shozaino ].titleimg3;
		}
		
		// ラジオボタンで選択された商材のみ表示させる（column1.asp側では全て display:none に設定済み）
		for ( var i = 1; i < aShozai.length; i++ )
		{
			if ( i == shozaino )
			{
				$( "TitleImage2" ).style.display = "block";
				$( "search1-" + aShozai[i].code ).style.display = "block";
				$( "search2-" + aShozai[i].code ).style.display = "block";
			}
			else
			{
				$( "search1-" + aShozai[i].code ).style.display = "none";
				$( "search2-" + aShozai[i].code ).style.display = "none";
			}
		}
		// 地図フラッシュ表示
		column1_showMap();
	}

// 地図フラッシュ表示
	function column1_showMap()
	{
		var showmap_dom = new Ajax.Request( "/toppageparts2/" + aShozai[ shozaino ].code + "/" + aShozai[ shozaino ].cityxml,
			{
				method: "get",
				onSuccess: function( httpObj )
				{
					$( "mapimg" ).style.display = "block";
					var so = new SWFObject( "/toppageparts2/" + aShozai[ shozaino ].code + "/index.swf", "index", "258", aShozai[ shozaino ].mapwidth, aShozai[ shozaino ].flashvar, "#FFFFFF" );
					if ( aShozai[ shozaino ].tab == 1 )
					{
						so.addParam( "allowFullScreen"   , "false"      );
						so.addParam( "allowScriptAccess" , "sameDomain" );
						so.addParam( "menu"              , "false"      );
						so.addParam( "flashVars"         , "xmlPath=/toppageparts2/" + aShozai[ shozaino ].code + "/map.xml" );
						so.write('flashmap');
					}
					else
					{
						so.addParam( "menu"   , "false"   );
						so.addParam( "scale"  , "noscale" );
						so.addParam( "salign" , "lt"      );
						so.addVariable( "basexml"      , "/kaigai/map/"    + aShozai[ shozaino ].cityxml);
						so.addVariable( "countryxml"   , "/toppageparts2/" + aShozai[ shozaino ].code + "/fmap_country.xml");
						so.addVariable( "twoletterxml" , "/toppageparts2/" + aShozai[ shozaino ].code + "/two_letter.xml");
						so.write('flashmap');
						var swfmw = new SWFMW( so );
					}
				},
				onFailure: function( httpObj )
				{
					$( "mapimg" ).style.display = "none";
				}
			}
		);
		
		
		// 「人気のエリア」表示制御
		//   「宿泊」のみ行動ターゲティングを採用
		//
		if ( shozaino == 1 )
		{
			$( "favoritearea" ).style.display = "none";
			$( "favoritearea_yado" ).style.display = "block";
		}
		else if ( aShozai[ shozaino ].favotite != "" )
		{
			$( "favoritearea_yado" ).style.display = "none";
			var showfavorite = new Ajax.Request( "/toppageparts2/" + aShozai[ shozaino ].code + "/favoritearea.xml",
				{
					method: "get",
					onComplete: function( httpObj )
					{
						$( "favoritearea" ).innerHTML = httpObj.responseXML.getElementsByTagName( "favoritearea" )[0].firstChild.nodeValue;
						$( "favoritearea" ).style.display = "block";
					}
				}
			);
		}
		else
		{
			$( "favoritearea" ).style.display = "none";
			$( "favoritearea_yado" ).style.display = "none";
			if ( aShozai[ shozaino ].titleimg1 == "" )
				$( "map_img" ).style.display = "none";
		}
	}

	function setPID( f1, f2, fm1, fm2, b1, b2, pad )
	{
		var pim = eval( "document." + f1 + "." + fm1 );
		var pid = eval( "document." + f1 + "." + fm2 );
		pid.length = 0;
		if ( pim.length >= 0 && pim.selectedIndex >= 0 ) eval( "document." + f2 + ".pim" ).value = pim[pim.selectedIndex].value;
		if ( pid.length >= 0 && pid.selectedIndex >= 0 ) eval( "document." + f2 + ".pid" ).value = pid[pid.selectedIndex].value;
		var yyyymm2 = eval( "document." + f2 + ".pim" ).value;
		var dd2     = eval( "document." + f2 + ".pid" ).value;
		dd2 = "";
		
		var yobi = new Array ( "日", "月", "火", "水", "木", "金", "土" );
		var today = new Date();
		var datemin = eval( "document." + f2 + ".datemin" ).value;
		var datemax = eval( "document." + f2 + ".datemax" ).value;
		var daymin = new Date( today.getFullYear(), today.getMonth(), today.getDate() + parseInt( datemin, 10 ) );
		var daymax = new Date( today.getFullYear(), today.getMonth(), today.getDate() + parseInt( datemax, 10 ) );
		var datenow;
		var daynow;
		if ( yyyymm2 != "" && dd2 != "" )
		{
			daynow = new Date( parseInt( yyyymm2.substr( 0, 4 ), 10 ), parseInt( yyyymm2.substr( 4, 2 ), 10 ) - 1, parseInt( dd2, 10 ) );
			datenow = daysBetween( today, daynow );
		}
		else
		{
			try
			{
				datenow = eval( "document." + f2 + ".datenow" ).value;
				daynow = datenow == "" ? "" : new Date( today.getFullYear(), today.getMonth(), today.getDate() + parseInt( datenow, 10 ) );
			}
			catch(e)
			{
				datenow = "";
				daynow = "";
			}
		}
		eval( "document." + f2 + ".datenow" ).value = "";
		
		//if ( yyyymm2 == "" )
		{
			pim.length = 0;
			if ( eval( b1 ) ) pim[pim.length] = new Option( "指定なし", "", true, true );
			for ( var i = 0; i < Math.ceil( parseInt( datemax, 10 ) / 30 ) ; i++ )
			{
				var d = ( i == 0 ) ? daymin.getDate() : 1;
				var newDate = new Date( daymin.getFullYear(), daymin.getMonth() + i, d );
				var yyyymm = newDate.getFullYear() * 100 + newDate.getMonth() + 1;
				var yyyymm_now = datenow == "" ? "" : daynow.getFullYear() * 100 + daynow.getMonth() + 1;
				var stryyyymm = yyyymm.toString().substr(0,4) + "年" + yyyymm.toString().substr(4,2) + "月";
				
				if ( newDate >= daymin && newDate <= daymax )
				{
					if ( yyyymm == eval( "document." + f2 + ".pim" ).value || yyyymm == yyyymm_now )
					{
						pim[pim.length] = new Option(stryyyymm, yyyymm, true, true);
						pim.selectedIndex = pim.length - 1;
					}
					else
						pim[pim.length] = new Option(stryyyymm, yyyymm, false, false);
				}
			}
			eval( "document." + f2 + ".pim" ).value = pim[pim.selectedIndex].value;
			yyyymm2 = eval( "document." + f2 + ".pim" ).value;
		}
		pid.length = 0;
		if ( yyyymm2 == "" )
		{
			pid[pid.length] = new Option( "指定なし", "" , true, true );
			pid.selectedIndex = 0;
		}else{

			//追加 S.Hirano 2010/09/07
			if( eval( b2 ) )pid[pid.length] = new Option( '指定なし' , '' , false , false );

			var y = parseInt( yyyymm2.substr( 0, 4 ), 10 );
			var m = parseInt( yyyymm2.substr( 4, 2 ), 10 );
			var days = getDays( y, m );
			for ( var i = 1; i <= days ; i++ )
			{
				var newDate = new Date( y, m - 1, i );
				var dd = i < 10 ? pad + i : i;
				var d_now = datenow == "" ? 0 : daynow.getDate();
				if ( newDate >= daymin && newDate <= daymax )
					if ( dd == eval( "document." + f2 + ".pid" ).value || i == d_now )
					{
						pid[pid.length] = new Option(i.toString()+"日("+yobi[newDate.getDay()]+")", dd, true, true);
						pid.selectedIndex = pid.length - 1;
					}
					else
					{
						pid[pid.length] = new Option(i.toString()+"日("+yobi[newDate.getDay()]+")", dd, false, false);
					}
			}
			eval( "document." + f2 + ".pid" ).value = pid[pid.selectedIndex].value;
		}
	}
	function SetCalendar( f1, f2, fm1, fm2, b1, b2, pad, ym, dd )
	{
		if ( f1 == "fitairTrForm" )
		{
			SetCalendar_tr( f1, f2, fm1, fm2, b1, b2, pad, ym, dd );
		}
		else
		{
			var pim = eval( "document." + f1 + "." + fm1 );
			var pid = eval( "document." + f1 + "." + fm2 );
			for ( var i = 0; i < pim.length; i++ )
			{
				if ( pim[i].value == ym )
				{
					pim.selectedIndex = i;
					break;
				}
			}
			setPID( f1, f2, fm1, fm2, b1, b2, pad );
			for ( var i = 0; i < pid.length; i++ )
			{
				if ( pid[i].value == dd )
				{
					pid.selectedIndex = i;
					break;
				}
			}
		}
	}
	function Counter( pointer )
	{
		var counter = new Ajax.Request( "/webservice/counter/index.aspx?url=" + pointer,
			{
				method: "get",
				onComplete: function( httpObj )
				{
					// 
				}
			}
		);
	}


// **************
//      商材
// **************

// ----------------------------------------------
// yado
// ----------------------------------------------
	function setYadoSubArea()
	{
		yadoSubArea[yadoSubArea.length] = { jk: "01", sa: [
				{ code: "0101", name: "札幌・定山渓" },
				{ code: "0102", name: "小樽・積丹・ニセコ" },
				{ code: "0103", name: "支笏・洞爺・登別・室蘭" },
				{ code: "0104", name: "函館・渡島・檜山・奥尻" },
				{ code: "0105", name: "旭川・富良野・夕張" },
				{ code: "0106", name: "帯広・然別湖・日高" },
				{ code: "0107", name: "釧路・阿寒・摩周" },
				{ code: "0108", name: "知床・網走・北見・紋別" },
				{ code: "0109", name: "稚内・利尻・礼文・留萌" }
			]
		};
		yadoSubArea[yadoSubArea.length] = { jk: "02", sa: [
				{ code: "0201", name: "青森と東津軽" },
				{ code: "0202", name: "十和田湖・八甲田" },
				{ code: "0203", name: "八戸・三沢・十和田市" },
				{ code: "0205", name: "五所川原と北津軽・西津軽" },
				{ code: "0206", name: "弘前・黒石と中津軽・南津軽" },
				{ code: "0207", name: "むつ市と下北半島" }
			]
		};
		yadoSubArea[yadoSubArea.length] = { jk: "03", sa: [
				{ code: "0301", name: "盛岡" },
				{ code: "0302", name: "花巻・遠野" },
				{ code: "0303", name: "北上・江刺・湯田" },
				{ code: "0304", name: "一関・平泉" },
				{ code: "0306", name: "陸中海岸" },
				{ code: "0308", name: "県北・安比・八幡平" }
			]
		};
		yadoSubArea[yadoSubArea.length] = { jk: "04", sa: [
				{ code: "0401", name: "仙台・作並・秋保" },
				{ code: "0403", name: "松島・塩竈・気仙沼" },
				{ code: "0405", name: "古川・登米" },
				{ code: "0406", name: "鳴子・栗駒" },
				{ code: "0407", name: "宮城蔵王・白石" }
			]
		};
		yadoSubArea[yadoSubArea.length] = { jk: "05", sa: [
				{ code: "0501", name: "秋田市" },
				{ code: "0502", name: "男鹿半島・八郎潟" },
				{ code: "0504", name: "大館・能代" },
				{ code: "0506", name: "八幡平・鹿角・十和田湖" },
				{ code: "0507", name: "田沢湖・角館・大曲" },
				{ code: "0508", name: "横手・湯沢" },
				{ code: "0509", name: "本荘・象潟・鳥海山" }
			]
		};
		yadoSubArea[yadoSubArea.length] = { jk: "06", sa: [
				{ code: "0601", name: "山形・上山・蔵王" },
				{ code: "0602", name: "米沢・白布・赤湯温泉" },
				{ code: "0603", name: "天童・寒河江・尾花沢" },
				{ code: "0604", name: "新庄・最上" },
				{ code: "0605", name: "庄内平野・出羽三山・鳥海山" }
			]
		};
		yadoSubArea[yadoSubArea.length] = { jk: "07", sa: [
				{ code: "0701", name: "福島・二本松周辺" },
				{ code: "0702", name: "郡山・三春周辺" },
				{ code: "0703", name: "白河周辺" },
				{ code: "0704", name: "いわき・相馬" },
				{ code: "0705", name: "会津若松周辺" },
				{ code: "0706", name: "喜多方・西会津周辺・只見" },
				{ code: "0707", name: "南会津" }
			]
		};
		yadoSubArea[yadoSubArea.length] = { jk: "08", sa: [
				{ code: "0801", name: "水戸・笠間" },
				{ code: "0802", name: "北茨城・奥久慈周辺" },
				{ code: "0803", name: "常総・古河" },
				{ code: "0804", name: "つくば・土浦・牛久" },
				{ code: "0805", name: "鹿島・水郷周辺" }
			]
		};
		yadoSubArea[yadoSubArea.length] = { jk: "09", sa: [
				{ code: "0901", name: "宇都宮・鹿沼" },
				{ code: "0903", name: "日光・鬼怒川" },
				{ code: "0905", name: "真岡・益子・烏山" },
				{ code: "0907", name: "栃木・佐野・足利" },
				{ code: "0908", name: "那須・塩原" }
			]
		};
		yadoSubArea[yadoSubArea.length] = { jk: "10", sa: [
				{ code: "1001", name: "前橋・高崎" },
				{ code: "1002", name: "伊香保・榛名" },
				{ code: "1003", name: "四万・吾妻・川原湯" },
				{ code: "1004", name: "草津・万座・北軽井沢" },
				{ code: "1005", name: "磯部・妙義山・下仁田" },
				{ code: "1006", name: "水上・谷川・奥利根" },
				{ code: "1007", name: "赤城・沼田・尾瀬" },
				{ code: "1008", name: "桐生・渡良瀬・館林" }
			]
		};
		yadoSubArea[yadoSubArea.length] = { jk: "11", sa: [
				{ code: "1101", name: "さいたま市・川口・戸田" },
				{ code: "1103", name: "上尾・桶川" },
				{ code: "1104", name: "熊谷・本庄" },
				{ code: "1105", name: "川越・所沢" },
				{ code: "1106", name: "東松山・森林公園" },
				{ code: "1107", name: "草加・越谷" },
				{ code: "1108", name: "春日部・久喜" },
				{ code: "1110", name: "JR八高線沿線" },
				{ code: "1111", name: "秩父・長瀞" }
			]
		};
		yadoSubArea[yadoSubArea.length] = { jk: "12", sa: [
				{ code: "1201", name: "千葉タウン・ベイエリア" },
				{ code: "1202", name: "松戸・柏" },
				{ code: "1203", name: "佐倉・成田" },
				{ code: "1204", name: "市原・木更津・富津" },
				{ code: "1205", name: "館山・白浜・千倉" },
				{ code: "1206", name: "鴨川・勝浦・御宿" },
				{ code: "1207", name: "茂原・東金・九十九里" },
				{ code: "1208", name: "銚子・佐原" }
			]
		};
		yadoSubArea[yadoSubArea.length] = { jk: "13", sa: [
				{ code: "1301", name: "東京駅・銀座・お台場" },
				{ code: "1302", name: "新宿・渋谷・六本木" },
				{ code: "1303", name: "上野・浅草・葛飾・葛西" },
				{ code: "1304", name: "池袋・飯田橋・巣鴨・練馬" },
				{ code: "1305", name: "品川・羽田・蒲田・自由が丘" },
				{ code: "1306", name: "下北沢・中野・高円寺・吉祥寺" },
				{ code: "1307", name: "立川・調布" },
				{ code: "1308", name: "町田・八王子・高尾" },
				{ code: "1309", name: "奥多摩" },
				{ code: "1310", name: "伊豆七島・小笠原" }
			]
		};
		yadoSubArea[yadoSubArea.length] = { jk: "14", sa: [
				{ code: "1401", name: "横浜・川崎" },
				{ code: "1402", name: "三浦半島" },
				{ code: "1403", name: "鎌倉・湘南" },
				{ code: "1404", name: "相模原・相模湖" },
				{ code: "1405", name: "厚木・丹沢" },
				{ code: "1406", name: "小田原・箱根" }
			]
		};
		yadoSubArea[yadoSubArea.length] = { jk: "15", sa: [
				{ code: "1501", name: "新潟・弥彦" },
				{ code: "1502", name: "阿賀野川ライン・新発田" },
				{ code: "1503", name: "下越・村上" },
				{ code: "1504", name: "三条・燕・長岡・柏崎" },
				{ code: "1505", name: "越後湯沢・奥只見" },
				{ code: "1506", name: "十日町・津南・松之山" },
				{ code: "1507", name: "上越・妙高高原・糸魚川" },
				{ code: "1508", name: "佐渡" }
			]
		};
		yadoSubArea[yadoSubArea.length] = { jk: "16", sa: [
				{ code: "1601", name: "富山・八尾周辺" },
				{ code: "1602", name: "黒部・宇奈月周辺" },
				{ code: "1603", name: "立山黒部アルペンルート" },
				{ code: "1604", name: "高岡・氷見周辺" },
				{ code: "1605", name: "砺波・五箇山" }
			]
		};
		yadoSubArea[yadoSubArea.length] = { jk: "17", sa: [
				{ code: "1701", name: "金沢" },
				{ code: "1702", name: "能登南部" },
				{ code: "1703", name: "能登北部" },
				{ code: "1705", name: "加賀・白山" }
			]
		};
		yadoSubArea[yadoSubArea.length] = { jk: "18", sa: [
				{ code: "1801", name: "福井市・芦原・永平寺" },
				{ code: "1803", name: "勝山・大野周辺" },
				{ code: "1804", name: "武生・鯖江周辺" },
				{ code: "1805", name: "敦賀・若狭周辺" }
			]
		};
		yadoSubArea[yadoSubArea.length] = { jk: "19", sa: [
				{ code: "1901", name: "甲府・昇仙峡・甲府盆地" },
				{ code: "1902", name: "勝沼・石和・西沢渓谷" },
				{ code: "1903", name: "富士五湖・忍野・富士吉田" },
				{ code: "1904", name: "大月・都留・道志渓谷" },
				{ code: "1905", name: "身延・下部温泉" },
				{ code: "1906", name: "南アルプス山麓" },
				{ code: "1907", name: "小淵沢・甲斐大泉・清里" }
			]
		};
		yadoSubArea[yadoSubArea.length] = { jk: "20", sa: [
				{ code: "2001", name: "長野・戸隠・須坂・菅平高原" },
				{ code: "2002", name: "松本・上高地・美ケ原" },
				{ code: "2003", name: "上田・別所・小諸" },
				{ code: "2004", name: "蓼科・八ケ岳・諏訪" },
				{ code: "2005", name: "志賀高原・野沢・小布施" },
				{ code: "2006", name: "白馬・大町・安曇野" },
				{ code: "2007", name: "軽井沢・佐久・小海線沿線" },
				{ code: "2008", name: "伊那路" },
				{ code: "2009", name: "木曽路" }
			]
		};
		yadoSubArea[yadoSubArea.length] = { jk: "21", sa: [
				{ code: "2101", name: "岐阜・大垣周辺" },
				{ code: "2102", name: "美濃加茂・郡上" },
				{ code: "2103", name: "白川郷周辺" },
				{ code: "2104", name: "多治見・恵那・中津川" },
				{ code: "2105", name: "奥飛騨温泉郷" },
				{ code: "2106", name: "高山・飛騨古川" },
				{ code: "2107", name: "下呂" }
			]
		};
		yadoSubArea[yadoSubArea.length] = { jk: "22", sa: [
				{ code: "2201", name: "静岡・清水・焼津" },
				{ code: "2202", name: "富士山・御殿場・富士宮" },
				{ code: "2203", name: "熱海・伊東" },
				{ code: "2204", name: "東伊豆" },
				{ code: "2205", name: "南伊豆" },
				{ code: "2206", name: "中伊豆" },
				{ code: "2207", name: "西伊豆" },
				{ code: "2208", name: "御前崎・大井川" },
				{ code: "2209", name: "浜松・浜名湖・天竜" }
			]
		};
		yadoSubArea[yadoSubArea.length] = { jk: "23", sa: [
				{ code: "2301", name: "名古屋市" },
				{ code: "2302", name: "犬山・瀬戸・一宮・津島" },
				{ code: "2303", name: "知多半島" },
				{ code: "2304", name: "三河湾・豊橋・渥美半島" },
				{ code: "2305", name: "岡崎・豊田・足助" },
				{ code: "2306", name: "奥三河" }
			]
		};
		yadoSubArea[yadoSubArea.length] = { jk: "24", sa: [
				{ code: "2401", name: "伊勢・二見" },
				{ code: "2402", name: "鳥羽" },
				{ code: "2403", name: "志摩" },
				{ code: "2404", name: "北伊勢" },
				{ code: "2405", name: "中伊勢" },
				{ code: "2406", name: "伊賀" },
				{ code: "2407", name: "熊野" }
			]
		};
		yadoSubArea[yadoSubArea.length] = { jk: "25", sa: [
				{ code: "2501", name: "大津周辺" },
				{ code: "2502", name: "甲賀・湖南" },
				{ code: "2505", name: "湖東" },
				{ code: "2506", name: "湖北" },
				{ code: "2507", name: "湖西" }
			]
		};
		yadoSubArea[yadoSubArea.length] = { jk: "26", sa: [
				{ code: "2601", name: "京都駅・四条河原町・京都御所" },
				{ code: "2602", name: "清水・祇園・銀閣寺" },
				{ code: "2603", name: "下鴨・上賀茂・大原・鞍馬" },
				{ code: "2604", name: "金閣寺・嵐山・高雄" },
				{ code: "2605", name: "伏見・醍醐" },
				{ code: "2606", name: "宇治・南山城" },
				{ code: "2607", name: "亀岡・京丹波・福知山" },
				{ code: "2608", name: "天橋立・丹後半島" }
			]
		};
		yadoSubArea[yadoSubArea.length] = { jk: "27", sa: [
				{ code: "2701", name: "キタ・新大阪" },
				{ code: "2702", name: "ミナミ・ベイエリア" },
				{ code: "2703", name: "江坂・豊中・高槻" },
				{ code: "2704", name: "北河内・東大阪" },
				{ code: "2705", name: "南河内" },
				{ code: "2706", name: "堺・泉南" }
			]
		};
		yadoSubArea[yadoSubArea.length] = { jk: "28", sa: [
				{ code: "2801", name: "神戸・六甲" },
				{ code: "2802", name: "宝塚・西宮" },
				{ code: "2804", name: "明石・東播磨" },
				{ code: "2805", name: "姫路・西播磨" },
				{ code: "2806", name: "丹波篠山" },
				{ code: "2807", name: "但馬山地" },
				{ code: "2808", name: "城崎・山陰海岸" },
				{ code: "2809", name: "淡路島" }
			]
		};
		yadoSubArea[yadoSubArea.length] = { jk: "29", sa: [
				{ code: "2901", name: "奈良市" },
				{ code: "2902", name: "生駒・斑鳩" },
				{ code: "2903", name: "橿原・飛鳥" },
				{ code: "2904", name: "山の辺" },
				{ code: "2905", name: "室生・宇陀・長谷" },
				{ code: "2906", name: "五條・吉野山" },
				{ code: "2907", name: "大峰・大台ケ原" }
			]
		};
		yadoSubArea[yadoSubArea.length] = { jk: "30", sa: [
				{ code: "3001", name: "和歌山市周辺" },
				{ code: "3002", name: "海南・有田路" },
				{ code: "3003", name: "御坊市周辺" },
				{ code: "3004", name: "白浜・田辺周辺" },
				{ code: "3005", name: "高野路" },
				{ code: "3006", name: "串本・勝浦" },
				{ code: "3007", name: "熊野路・瀞峡" }
			]
		};
		yadoSubArea[yadoSubArea.length] = { jk: "31", sa: [
				{ code: "3101", name: "鳥取県東部・鳥取市" },
				{ code: "3102", name: "倉吉市・三朝温泉周辺" },
				{ code: "3103", name: "米子・境港・大山周辺" }
			]
		};
		yadoSubArea[yadoSubArea.length] = { jk: "32", sa: [
				{ code: "3201", name: "松江市周辺と島根半島" },
				{ code: "3203", name: "安来市周辺" },
				{ code: "3204", name: "奥出雲" },
				{ code: "3205", name: "出雲市周辺" },
				{ code: "3206", name: "隠岐の島々" },
				{ code: "3207", name: "浜田・江津・大田周辺" },
				{ code: "3208", name: "益田・津和野周辺" }
			]
		};
		yadoSubArea[yadoSubArea.length] = { jk: "33", sa: [
				{ code: "3301", name: "岡山市と吉備路" },
				{ code: "3303", name: "高梁・新見" },
				{ code: "3304", name: "蒜山高原" },
				{ code: "3305", name: "津山・奥津" },
				{ code: "3306", name: "東美作" },
				{ code: "3307", name: "吉備高原" },
				{ code: "3308", name: "牛窓・備前" },
				{ code: "3309", name: "倉敷・瀬戸大橋" },
				{ code: "3310", name: "笠岡・井原" }
			]
		};
		yadoSubArea[yadoSubArea.length] = { jk: "34", sa: [
				{ code: "3401", name: "広島・宮島" },
				{ code: "3402", name: "呉・江田島" },
				{ code: "3403", name: "芸予諸島" },
				{ code: "3404", name: "竹原・三原" },
				{ code: "3405", name: "尾道・福山・鞆の浦" },
				{ code: "3406", name: "三段峡・芸北" },
				{ code: "3407", name: "三次・上下町" },
				{ code: "3408", name: "庄原・帝釈峡" }
			]
		};
		yadoSubArea[yadoSubArea.length] = { jk: "35", sa: [
				{ code: "3502", name: "岩国・柳井" },
				{ code: "3503", name: "徳山周辺" },
				{ code: "3504", name: "山口・防府・秋吉台" },
				{ code: "3505", name: "萩" },
				{ code: "3506", name: "長門・下関" }
			]
		};
		yadoSubArea[yadoSubArea.length] = { jk: "36", sa: [
				{ code: "3601", name: "徳島・鳴門" },
				{ code: "3602", name: "吉野川流域" },
				{ code: "3603", name: "祖谷渓・剣山" },
				{ code: "3604", name: "阿南・日和佐" }
			]
		};
		yadoSubArea[yadoSubArea.length] = { jk: "37", sa: [
				{ code: "3701", name: "高松" },
				{ code: "3702", name: "東讃" },
				{ code: "3703", name: "坂出・丸亀・塩飽諸島" },
				{ code: "3704", name: "観音寺・琴平周辺" },
				{ code: "3705", name: "小豆島" }
			]
		};
		yadoSubArea[yadoSubArea.length] = { jk: "38", sa: [
				{ code: "3801", name: "松山市周辺" },
				{ code: "3802", name: "今治・しまなみ海道" },
				{ code: "3803", name: "西条・石鎚山・新居浜" },
				{ code: "3805", name: "内子・大洲・佐田岬" },
				{ code: "3806", name: "久万・面河渓・四国カルスト" },
				{ code: "3807", name: "宇和島・南レク" }
			]
		};
		yadoSubArea[yadoSubArea.length] = { jk: "39", sa: [
				{ code: "3901", name: "高知・伊野" },
				{ code: "3902", name: "南国・龍河洞・嶺北" },
				{ code: "3903", name: "安芸・室戸岬" },
				{ code: "3904", name: "土佐・横浪・四国カルスト" },
				{ code: "3905", name: "中村・四万十川流域" },
				{ code: "3906", name: "足摺岬・竜串・宿毛" }
			]
		};
		yadoSubArea[yadoSubArea.length] = { jk: "40", sa: [
				{ code: "4001", name: "福岡・太宰府" },
				{ code: "4003", name: "北九州市周辺" },
				{ code: "4004", name: "筑豊" },
				{ code: "4005", name: "久留米・柳川・筑後" }
			]
		};
		yadoSubArea[yadoSubArea.length] = { jk: "41", sa: [
				{ code: "4101", name: "佐賀市周辺" },
				{ code: "4103", name: "鳥栖" },
				{ code: "4104", name: "多久" },
				{ code: "4105", name: "唐津・呼子" },
				{ code: "4106", name: "伊万里・有田" },
				{ code: "4107", name: "武雄・嬉野" },
				{ code: "4108", name: "鹿島" }
			]
		};
		yadoSubArea[yadoSubArea.length] = { jk: "42", sa: [
				{ code: "4201", name: "長崎市・西彼杵半島" },
				{ code: "4203", name: "諫早・大村" },
				{ code: "4204", name: "雲仙・島原" },
				{ code: "4205", name: "佐世保・平戸" },
				{ code: "4206", name: "五島・壱岐・対馬" }
			]
		};
		yadoSubArea[yadoSubArea.length] = { jk: "43", sa: [
				{ code: "4301", name: "熊本市周辺" },
				{ code: "4302", name: "菊池川流域" },
				{ code: "4303", name: "阿蘇" },
				{ code: "4304", name: "八代・水俣・球磨川流域" },
				{ code: "4305", name: "天草" }
			]
		};
		yadoSubArea[yadoSubArea.length] = { jk: "44", sa: [
				{ code: "4401", name: "大分市・佐賀関" },
				{ code: "4402", name: "豊後大野・竹田" },
				{ code: "4403", name: "臼杵・佐伯" },
				{ code: "4404", name: "別府" },
				{ code: "4408", name: "湯布院" },
				{ code: "4405", name: "日田・天ケ瀬・九重" },
				{ code: "4406", name: "宇佐・中津・耶馬溪" },
				{ code: "4407", name: "国東半島・豊後高田" }
			]
		};
		yadoSubArea[yadoSubArea.length] = { jk: "45", sa: [
				{ code: "4501", name: "宮崎市周辺" },
				{ code: "4502", name: "日南海岸" },
				{ code: "4503", name: "西都・日向灘沿岸" },
				{ code: "4504", name: "日向市・奥日向・椎葉" },
				{ code: "4505", name: "延岡・高千穂" },
				{ code: "4506", name: "えびの高原・霧島" },
				{ code: "4507", name: "都城・北諸県" }
			]
		};
		yadoSubArea[yadoSubArea.length] = { jk: "46", sa: [
				{ code: "4601", name: "鹿児島・桜島" },
				{ code: "4602", name: "霧島・国分" },
				{ code: "4603", name: "大隅半島" },
				{ code: "4604", name: "南薩摩・指宿" },
				{ code: "4605", name: "北薩摩・川内" },
				{ code: "4606", name: "鹿児島の島々" }
			]
		};
		yadoSubArea[yadoSubArea.length] = { jk: "47", sa: [
				{ code: "4701", name: "那覇・本島南部" },
				{ code: "4702", name: "本島中部" },
				{ code: "4703", name: "本島北部" },
				{ code: "4704", name: "久米島・慶良間諸島" },
				{ code: "4705", name: "先島諸島" }
			]
		};
	}
	function yado_onChangePim()
	{
		setPID( "bsForm", "bsForm2", "pim", "pid", "false", "false", "0" );
	}
	function yado_onChangePid( pid )
	{
		document.bsForm2.pid.value = pid;
	}
	function yado_onChangeSn( sn )
	{
		document.bsForm2.sn.value = sn;
	}
	function yado_onChangePn( pn )
	{
		document.bsForm2.pn.value = pn;
	}
	function yado_onChangeRn( rn )
	{
		document.bsForm2.rn.value = rn;
	}
	function yado_onChangeJk( jk )
	{
		var sa = document.bsForm.sa;
		sa.length = 0;
		sa[sa.length] = new Option( "指定なし", "", false, false );
		for ( var i = 0; i < yadoSubArea.length; i++ )
		{
			if ( yadoSubArea[i].jk == jk )
			{
				for ( var j = 0; j < yadoSubArea[i].sa.length; j++ )
				{
					sa[sa.length] = new Option( yadoSubArea[i].sa[j].name, yadoSubArea[i].sa[j].code, false, false );
				}
			}
		}
	}
	function yado_onChangeSa( sa )
	{
		document.bsForm2.sa.value = sa;
	}
	function yado2_onRadioCustomSubmit( f, radioItem, val)
	{
		for( var i = 0; i < radioItem.length; i++ )
		{
			if( radioItem[i].checked )
			{
				location = f.action + "?" + radioItem[i].value + "=" + escape(val) + "&cdl=1";
				break;
			}
		}
		return false;
	}

// ----------------------------------------------
// domtour
// ----------------------------------------------
	function setDomTourPref()
	{
		domtourPref[domtourPref.length] = { area: "A01", areaname: "北海道", pref: "01", prefname: "北海道" };
		domtourPref[domtourPref.length] = { area: "A02", areaname: "東北", pref: "02", prefname: "青森県" };
		domtourPref[domtourPref.length] = { area: "A02", areaname: "東北", pref: "03", prefname: "岩手県" };
		domtourPref[domtourPref.length] = { area: "A02", areaname: "東北", pref: "04", prefname: "宮城県" };
		domtourPref[domtourPref.length] = { area: "A02", areaname: "東北", pref: "05", prefname: "秋田県" };
		domtourPref[domtourPref.length] = { area: "A02", areaname: "東北", pref: "06", prefname: "山形県" };
		domtourPref[domtourPref.length] = { area: "A02", areaname: "東北", pref: "07", prefname: "福島県" };
		domtourPref[domtourPref.length] = { area: "A03", areaname: "北関東", pref: "08", prefname: "茨城県" };
		domtourPref[domtourPref.length] = { area: "A03", areaname: "北関東", pref: "09", prefname: "栃木県" };
		domtourPref[domtourPref.length] = { area: "A03", areaname: "北関東", pref: "10", prefname: "群馬県" };
		domtourPref[domtourPref.length] = { area: "A04", areaname: "首都圏", pref: "11", prefname: "埼玉県" };
		domtourPref[domtourPref.length] = { area: "A04", areaname: "首都圏", pref: "12", prefname: "千葉県" };
		domtourPref[domtourPref.length] = { area: "A04", areaname: "首都圏", pref: "13", prefname: "東京都" };
		domtourPref[domtourPref.length] = { area: "A04", areaname: "首都圏", pref: "14", prefname: "神奈川県" };
		domtourPref[domtourPref.length] = { area: "A05", areaname: "甲信越", pref: "15", prefname: "新潟県" };
		domtourPref[domtourPref.length] = { area: "A07", areaname: "北陸", pref: "16", prefname: "富山県" };
		domtourPref[domtourPref.length] = { area: "A07", areaname: "北陸", pref: "17", prefname: "石川県" };
		domtourPref[domtourPref.length] = { area: "A07", areaname: "北陸", pref: "18", prefname: "福井県" };
		domtourPref[domtourPref.length] = { area: "A05", areaname: "甲信越", pref: "19", prefname: "山梨県" };
		domtourPref[domtourPref.length] = { area: "A05", areaname: "甲信越", pref: "20", prefname: "長野県" };
		domtourPref[domtourPref.length] = { area: "A06", areaname: "東海", pref: "21", prefname: "岐阜県" };
		domtourPref[domtourPref.length] = { area: "A06", areaname: "東海", pref: "22", prefname: "静岡県" };
		domtourPref[domtourPref.length] = { area: "A06", areaname: "東海", pref: "23", prefname: "愛知県" };
		domtourPref[domtourPref.length] = { area: "A06", areaname: "東海", pref: "24", prefname: "三重県" };
		domtourPref[domtourPref.length] = { area: "A08", areaname: "近畿", pref: "25", prefname: "滋賀県" };
		domtourPref[domtourPref.length] = { area: "A08", areaname: "近畿", pref: "26", prefname: "京都府" };
		domtourPref[domtourPref.length] = { area: "A08", areaname: "近畿", pref: "27", prefname: "大阪府" };
		domtourPref[domtourPref.length] = { area: "A08", areaname: "近畿", pref: "28", prefname: "兵庫県" };
		domtourPref[domtourPref.length] = { area: "A08", areaname: "近畿", pref: "29", prefname: "奈良県" };
		domtourPref[domtourPref.length] = { area: "A08", areaname: "近畿", pref: "30", prefname: "和歌山県" };
		domtourPref[domtourPref.length] = { area: "A09", areaname: "中国", pref: "31", prefname: "鳥取県" };
		domtourPref[domtourPref.length] = { area: "A09", areaname: "中国", pref: "32", prefname: "島根県" };
		domtourPref[domtourPref.length] = { area: "A09", areaname: "中国", pref: "33", prefname: "岡山県" };
		domtourPref[domtourPref.length] = { area: "A09", areaname: "中国", pref: "34", prefname: "広島県" };
		domtourPref[domtourPref.length] = { area: "A09", areaname: "中国", pref: "35", prefname: "山口県" };
		domtourPref[domtourPref.length] = { area: "A10", areaname: "四国", pref: "36", prefname: "徳島県" };
		domtourPref[domtourPref.length] = { area: "A10", areaname: "四国", pref: "37", prefname: "香川県" };
		domtourPref[domtourPref.length] = { area: "A10", areaname: "四国", pref: "38", prefname: "愛媛県" };
		domtourPref[domtourPref.length] = { area: "A10", areaname: "四国", pref: "39", prefname: "高知県" };
		domtourPref[domtourPref.length] = { area: "A11", areaname: "九州", pref: "40", prefname: "福岡県" };
		domtourPref[domtourPref.length] = { area: "A11", areaname: "九州", pref: "41", prefname: "佐賀県" };
		domtourPref[domtourPref.length] = { area: "A11", areaname: "九州", pref: "42", prefname: "長崎県" };
		domtourPref[domtourPref.length] = { area: "A11", areaname: "九州", pref: "43", prefname: "熊本県" };
		domtourPref[domtourPref.length] = { area: "A11", areaname: "九州", pref: "44", prefname: "大分県" };
		domtourPref[domtourPref.length] = { area: "A11", areaname: "九州", pref: "45", prefname: "宮崎県" };
		domtourPref[domtourPref.length] = { area: "A11", areaname: "九州", pref: "46", prefname: "鹿児島県" };
		domtourPref[domtourPref.length] = { area: "A12", areaname: "沖縄", pref: "47", prefname: "沖縄県" };
	}
	function domtour_onChangePim()
	{
		setPID( "domtourForm", "domtourForm2", "dmonth", "ddate", "true", "false", "" );
	}
	function domtour_onChangePid( pid )
	{
		document.domtourForm2.pid.value = pid;
	}
	function domtour_onChangeDept( dept )
	{
		document.domtourForm2.dept.value = dept;
	}
	function domtour_onChangeArea( area )
	{
		document.domtourForm2.area.value = area;
		var p = document.domtourForm2.pref.value;
		var pref = document.domtourForm.pref;
		pref.length = 0;
		pref[pref.length] = new Option( "指定なし", "", false, false );
		for ( var i = 0; i < domtourPref.length; i++ )
		{
			if ( domtourPref[i].area == area )
			{
				if ( p == domtourPref[i].pref )
				{
					pref[pref.length] = new Option( domtourPref[i].prefname, domtourPref[i].pref, true, true );
					pref.selectedIndex = pref.length - 1;
				}
				else
					pref[pref.length] = new Option( domtourPref[i].prefname, domtourPref[i].pref, false, false );
			}
		}
		domtour_onChangePref( pref[pref.selectedIndex].value );
	}
	function domtour_onChangePref( pref )
	{
		document.domtourForm2.pref.value = pref;
	}
	function domtour2_funcPlanSearch()
	{
		var oForm = window.document.FormPlanSearch;
		var s = "";
		if ( $("keyword").checked )
		{
			s = "キーワード";
			$("keyorplan").name = "SetKeyword";
		}
		else
		{
			s = "コース番号・プランコード";
			$("keyorplan").name = "plansearch";
		}
		
		if($("keyorplan").value == '')
		{
			alert(s+'を入力して下さい');
			return(false);
		}
		else
		{
			return(true);
		}
	}

// ----------------------------------------------
// domdp
// ----------------------------------------------
	function domdp_onChangePim()
	{
		setPID( "domdpForm", "domdpForm2", "pim", "pid", "true", "false", "0" );
	}
	function domdp_onChangePid( pid )
	{
		document.domdpForm2.pid.value = pid;
	}
	function setRsv()
	{
		domdp_rsv = "";
		for ( var i = 0; i < document.domdpForm.rsv.length; i++ )
		{
			if ( document.domdpForm.rsv[i].checked )
			{
				domdp_rsv = document.domdpForm.rsv[i].value;
				break;
			}
		}
		domdp_datemin = parseInt( eval( "document.domdpForm2.domdp_datemin" + domdp_rsv ).value, 10 );
		domdp_datemax = parseInt( eval( "document.domdpForm2.domdp_datemax" + domdp_rsv ).value, 10 );
		document.domdpForm2.datemin.value = domdp_datemin;
		document.domdpForm2.datemax.value = domdp_datemax;
		//document.domdpForm.pim.selectedIndex = 0;
		//document.domdpForm.pid.selectedIndex = 0;
		domdp_onChangePim();
		domdp_getData( domdp_rsv );
	}
	function domdp_getData( rsv )
	{
		xDocA = null;
		xDocJ = null;
		switch ( rsv )
		{
			case "":
				var dataA = new Ajax.Request( "/toppageparts2/domdp/air/data.xml",
					{
						method: "get",
						onComplete: function( httpObj )
						{
							xDocA = httpObj.responseXML;
							var dataJ = new Ajax.Request( "/toppageparts2/domdp/jr/data.xml",
								{
									method: "get",
									onComplete: function( httpObj )
									{
										xDocJ = httpObj.responseXML;
										domdp_setData( rsv );
									}
								}
							);
						}
					}
				);
				break;
			case "A":
				var dataA = new Ajax.Request( "/toppageparts2/domdp/air/data.xml",
					{
						method: "get",
						onComplete: function( httpObj )
						{
							xDocA = httpObj.responseXML;
							domdp_setData( rsv );
						}
					}
				);
				break;
			case "J":
				var dataJ = new Ajax.Request( "/toppageparts2/domdp/jr/data.xml",
					{
						method: "get",
						onComplete: function( httpObj )
						{
							xDocJ = httpObj.responseXML;
							domdp_setData( rsv );
						}
					}
				);
				break;
			default:
				break;
		}
	}
	function domdp_setData( rsv )
	{
		domdpData.length = 0;
		
		if ( rsv == "" || rsv == "A" )
		{
			var  a1 = xDocA.getElementsByTagName( "dept" );
			var  a2 = xDocA.getElementsByTagName( "deptname" );
			var  a3 = xDocA.getElementsByTagName( "area" );
			var  a4 = xDocA.getElementsByTagName( "areaname" );
			var  a5 = xDocA.getElementsByTagName( "jk" );
			var  a6 = xDocA.getElementsByTagName( "jkname" );
			var  a7 = xDocA.getElementsByTagName( "sa" );
			var  a8 = xDocA.getElementsByTagName( "saname" );
			var  a9 = xDocA.getElementsByTagName( "deptorder" );
			var a10 = xDocA.getElementsByTagName( "areaorder" );
			
			for ( var i = 0; i < a1.length; i++ )
			{
				domdpData[domdpData.length] = 
				{
					dept:       a1[i].firstChild.nodeValue,
					deptname:   a2[i].firstChild.nodeValue,
					area:       a3[i].firstChild.nodeValue,
					areaname:   a4[i].firstChild.nodeValue,
					jk:         a5[i].firstChild.nodeValue,
					jkname:     a6[i].firstChild.nodeValue,
					sa:         a7[i].firstChild.nodeValue,
					saname:     a8[i].firstChild.nodeValue,
					deptorder:  a9[i].firstChild.nodeValue,
					areaorder: a10[i].firstChild.nodeValue
				}
			}
		}
		
		if ( rsv == "" || rsv == "J" )
		{
			var  j0 = xDocJ.getElementsByTagName( "jr" );
			var  j1 = xDocJ.getElementsByTagName( "dept" );
			var  j2 = xDocJ.getElementsByTagName( "deptname" );
			var  j3 = xDocJ.getElementsByTagName( "area" );
			var  j4 = xDocJ.getElementsByTagName( "areaname" );
			var  j5 = xDocJ.getElementsByTagName( "jk" );
			var  j6 = xDocJ.getElementsByTagName( "jkname" );
			var  j7 = xDocJ.getElementsByTagName( "sa" );
			var  j8 = xDocJ.getElementsByTagName( "saname" );
			var  j9 = xDocJ.getElementsByTagName( "deptorder" );
			var j10 = xDocJ.getElementsByTagName( "areaorder" );
			
			for ( var i = 0; i < j1.length; i++ )
			{
				domdpData[domdpData.length] = 
				{
					dept:       j1[i].firstChild.nodeValue,
					deptname:   j2[i].firstChild.nodeValue,
					area:       j3[i].firstChild.nodeValue,
					areaname:   j4[i].firstChild.nodeValue,
					jk:         j5[i].firstChild.nodeValue,
					jkname:     j6[i].firstChild.nodeValue,
					sa:         j7[i].firstChild.nodeValue,
					saname:     j8[i].firstChild.nodeValue,
					deptorder:  j9[i].firstChild.nodeValue,
					areaorder: j10[i].firstChild.nodeValue
				}
			}
		}
		
		domdpData.sort( domdp_compare );
		
		var domdp_dept = document.domdpForm.dept.options;
		domdp_dept.length = 0;
		//domdp_dept[domdp_dept.length] = new Option( "指定なし", "", false, false );
		for ( var i = 0; i < domdpData.length; i++ )
		{
			var isnew = false;
			for ( var j = 0; j < domdp_dept.length; j++ )
			{
				if ( domdpData[i].dept == domdp_dept[j].value )
				{
					isnew = false;
					break;
				}
				else
					isnew = true;
			}
			if ( domdp_dept.length == 0 || isnew )
			{
				if ( document.domdpForm2.dept.value == domdpData[i].dept )
				{
					domdp_dept[domdp_dept.length] = new Option( domdpData[i].deptname, domdpData[i].dept, true, true );
					domdp_dept.selectedIndex = domdp_dept.length - 1;
				}
				else
					domdp_dept[domdp_dept.length] = new Option( domdpData[i].deptname, domdpData[i].dept, false, false );
			}
		}
		domdp_onChangeDept( domdp_dept[domdp_dept.selectedIndex].value );
	}
	function domdp_compare( a, b )
	{
		return ( parseInt( a.deptorder, 10 ) * 100000000 + parseInt( a.areaorder, 10 ) * 1000000 + parseInt( a.jk, 10 ) * 10000 + parseInt( a.sa, 10 ) )
		     - ( parseInt( b.deptorder, 10 ) * 100000000 + parseInt( b.areaorder, 10 ) * 1000000 + parseInt( b.jk, 10 ) * 10000 + parseInt( b.sa, 10 ) );
	}
	function domdp_compare1( a, b )
	{
		return ( parseInt( a.deptorder, 10 ) - parseInt( b.deptorder, 10 ) );
	}
	
	function domdp_onChangeDept( dept )
	{
		document.domdpForm2.dept.value = dept;
		var domdp_area = document.domdpForm.area.options;
		domdp_area.length = 0;
		//domdp_area[domdp_area.length] = new Option( "指定なし", "", false, false );
		for ( var i = 0; i < domdpData.length; i++ )
		{
			if ( domdpData[i].dept == dept )
			{
				var isnew = false;
				for ( var j = 0; j < domdp_area.length; j++ )
				{
					if ( domdpData[i].area == domdp_area[j].value )
					{
						isnew = false;
						break;
					}
					else
						isnew = true;
				}
				if ( domdp_area.length == 0 || isnew )
				{
					if ( document.domdpForm2.area.value == domdpData[i].area )
					{
						domdp_area[domdp_area.length] = new Option( domdpData[i].areaname, domdpData[i].area, true, true );
						domdp_area.selectedIndex = domdp_area.length - 1;
					}
					else
						domdp_area[domdp_area.length] = new Option( domdpData[i].areaname, domdpData[i].area, false, false );
				}
			}
		}
		domdp_onChangeArea( domdp_area[domdp_area.selectedIndex].value );
	}
	function domdp_onChangeArea( area )
	{
		document.domdpForm2.area.value = area;
		var domdp_jk = document.domdpForm.jk.options;
		domdp_jk.length = 0;
		//domdp_jk[domdp_jk.length] = new Option( "指定なし", "", false, false );
		for ( var i = 0; i < domdpData.length; i++ )
		{
			if ( domdpData[i].dept == document.domdpForm2.dept.value && domdpData[i].area == area )
			{
				var isnew = false;
				for ( var j = 0; j < domdp_jk.length; j++ )
				{
					if ( domdpData[i].jk == domdp_jk[j].value )
					{
						isnew = false;
						break;
					}
					else
						isnew = true;
				}
				if ( domdp_jk.length == 0 || isnew )
					if ( document.domdpForm2.jk.value == domdpData[i].jk )
					{
						domdp_jk[domdp_jk.length] = new Option( domdpData[i].jkname, domdpData[i].jk, true, true );
						domdp_jk.selectedIndex = domdp_jk.length - 1;
					}
					else
						domdp_jk[domdp_jk.length] = new Option( domdpData[i].jkname, domdpData[i].jk, false, false );
			}
		}
		domdp_onChangeKen( domdp_jk[domdp_jk.selectedIndex].value );
	}
	function domdp_onChangeKen( jk )
	{
		document.domdpForm2.jk.value = jk;
		var domdp_sa = document.domdpForm.sa.options;
		domdp_sa.length = 0;
		domdp_sa[domdp_sa.length] = new Option( "指定なし", "", false, false );
		for ( var i = 0; i < domdpData.length; i++ )
		{
			if ( domdpData[i].dept == document.domdpForm2.dept.value && domdpData[i].area == document.domdpForm2.area.value && domdpData[i].jk == jk )
			{
				var isnew = false;
				for ( var j = 0; j < domdp_sa.length; j++ )
				{
					if ( domdpData[i].sa == domdp_sa[j].value )
					{
						isnew = false;
						break;
					}
					else
						isnew = true;
				}
				if ( domdp_sa.length == 0 || isnew )
					if ( document.domdpForm2.sa.value == domdpData[i].sa )
					{
						domdp_sa[domdp_sa.length] = new Option( domdpData[i].saname, domdpData[i].sa, true, true );
						domdp_sa.selectedIndex = domdp_sa.length - 1;
					}
					else
						domdp_sa[domdp_sa.length] = new Option( domdpData[i].saname, domdpData[i].sa, false, false );
			}
		}
		domdp_onChangeMesh( domdp_sa[domdp_sa.selectedIndex].value );
	}
	function domdp_onChangeMesh( sa )
	{
		document.domdpForm2.sa.value = sa;
	}

// ----------------------------------------------
// ticket
// ----------------------------------------------
	function setTktPref()
	{
		tktPref[tktPref.length] = { area: "A01", areaname: "北海道", pref: "01", prefname: "北海道" };
		tktPref[tktPref.length] = { area: "A02", areaname: "東北", pref: "02", prefname: "青森県" };
		tktPref[tktPref.length] = { area: "A02", areaname: "東北", pref: "03", prefname: "岩手県" };
		tktPref[tktPref.length] = { area: "A02", areaname: "東北", pref: "04", prefname: "宮城県" };
		tktPref[tktPref.length] = { area: "A02", areaname: "東北", pref: "05", prefname: "秋田県" };
		tktPref[tktPref.length] = { area: "A02", areaname: "東北", pref: "06", prefname: "山形県" };
		tktPref[tktPref.length] = { area: "A02", areaname: "東北", pref: "07", prefname: "福島県" };
		tktPref[tktPref.length] = { area: "A03", areaname: "北関東", pref: "08", prefname: "茨城県" };
		tktPref[tktPref.length] = { area: "A03", areaname: "北関東", pref: "09", prefname: "栃木県" };
		tktPref[tktPref.length] = { area: "A03", areaname: "北関東", pref: "10", prefname: "群馬県" };
		tktPref[tktPref.length] = { area: "A04", areaname: "首都圏", pref: "11", prefname: "埼玉県" };
		tktPref[tktPref.length] = { area: "A04", areaname: "首都圏", pref: "12", prefname: "千葉県" };
		tktPref[tktPref.length] = { area: "A04", areaname: "首都圏", pref: "13", prefname: "東京都" };
		tktPref[tktPref.length] = { area: "A04", areaname: "首都圏", pref: "14", prefname: "神奈川県" };
		tktPref[tktPref.length] = { area: "A05", areaname: "甲信越", pref: "15", prefname: "新潟県" };
		tktPref[tktPref.length] = { area: "A07", areaname: "北陸", pref: "16", prefname: "富山県" };
		tktPref[tktPref.length] = { area: "A07", areaname: "北陸", pref: "17", prefname: "石川県" };
		tktPref[tktPref.length] = { area: "A07", areaname: "北陸", pref: "18", prefname: "福井県" };
		tktPref[tktPref.length] = { area: "A05", areaname: "甲信越", pref: "19", prefname: "山梨県" };
		tktPref[tktPref.length] = { area: "A05", areaname: "甲信越", pref: "20", prefname: "長野県" };
		tktPref[tktPref.length] = { area: "A06", areaname: "東海", pref: "21", prefname: "岐阜県" };
		tktPref[tktPref.length] = { area: "A06", areaname: "東海", pref: "22", prefname: "静岡県" };
		tktPref[tktPref.length] = { area: "A06", areaname: "東海", pref: "23", prefname: "愛知県" };
		tktPref[tktPref.length] = { area: "A06", areaname: "東海", pref: "24", prefname: "三重県" };
		tktPref[tktPref.length] = { area: "A08", areaname: "近畿", pref: "25", prefname: "滋賀県" };
		tktPref[tktPref.length] = { area: "A08", areaname: "近畿", pref: "26", prefname: "京都府" };
		tktPref[tktPref.length] = { area: "A08", areaname: "近畿", pref: "27", prefname: "大阪府" };
		tktPref[tktPref.length] = { area: "A08", areaname: "近畿", pref: "28", prefname: "兵庫県" };
		tktPref[tktPref.length] = { area: "A08", areaname: "近畿", pref: "29", prefname: "奈良県" };
		tktPref[tktPref.length] = { area: "A08", areaname: "近畿", pref: "30", prefname: "和歌山県" };
		tktPref[tktPref.length] = { area: "A09", areaname: "中国", pref: "31", prefname: "鳥取県" };
		tktPref[tktPref.length] = { area: "A09", areaname: "中国", pref: "32", prefname: "島根県" };
		tktPref[tktPref.length] = { area: "A09", areaname: "中国", pref: "33", prefname: "岡山県" };
		tktPref[tktPref.length] = { area: "A09", areaname: "中国", pref: "34", prefname: "広島県" };
		tktPref[tktPref.length] = { area: "A09", areaname: "中国", pref: "35", prefname: "山口県" };
		tktPref[tktPref.length] = { area: "A10", areaname: "四国", pref: "36", prefname: "徳島県" };
		tktPref[tktPref.length] = { area: "A10", areaname: "四国", pref: "37", prefname: "香川県" };
		tktPref[tktPref.length] = { area: "A10", areaname: "四国", pref: "38", prefname: "愛媛県" };
		tktPref[tktPref.length] = { area: "A10", areaname: "四国", pref: "39", prefname: "高知県" };
		tktPref[tktPref.length] = { area: "A11", areaname: "九州", pref: "40", prefname: "福岡県" };
		tktPref[tktPref.length] = { area: "A11", areaname: "九州", pref: "41", prefname: "佐賀県" };
		tktPref[tktPref.length] = { area: "A11", areaname: "九州", pref: "42", prefname: "長崎県" };
		tktPref[tktPref.length] = { area: "A11", areaname: "九州", pref: "43", prefname: "熊本県" };
		tktPref[tktPref.length] = { area: "A11", areaname: "九州", pref: "44", prefname: "大分県" };
		tktPref[tktPref.length] = { area: "A11", areaname: "九州", pref: "45", prefname: "宮崎県" };
		tktPref[tktPref.length] = { area: "A11", areaname: "九州", pref: "46", prefname: "鹿児島県" };
		tktPref[tktPref.length] = { area: "A12", areaname: "沖縄", pref: "47", prefname: "沖縄県" };
	}
	function ticket_onChangeLargeArea( la )
	{
		var pref = document.tktForm.pref;
		pref.length = 0;
		pref[pref.length] = new Option( "指定なし", "", true, false );
		for ( var i = 0; i < tktPref.length; i++ )
		{
			if ( la == tktPref[i].area )
				pref[pref.length] = new Option( tktPref[i].prefname, tktPref[i].pref, false, false );
		}
	}

// ----------------------------------------------
// bus
// ----------------------------------------------
	function setBusArea()
	{
		busArea[busArea.length] = { anft: "01", amft: "北海道", antt: "01", amtt: "北海道" };
		busArea[busArea.length] = { anft: "02", amft: "東北"  , antt: "02", amtt: "東北"   };
		busArea[busArea.length] = { anft: "02", amft: "東北"  , antt: "03", amtt: "関東"   };
		busArea[busArea.length] = { anft: "02", amft: "東北"  , antt: "04", amtt: "東海・甲信越" };
		busArea[busArea.length] = { anft: "02", amft: "東北"  , antt: "05", amtt: "北陸"   };
		busArea[busArea.length] = { anft: "02", amft: "東北"  , antt: "06", amtt: "近畿"   };
		busArea[busArea.length] = { anft: "03", amft: "関東"  , antt: "02", amtt: "東北"   };
		busArea[busArea.length] = { anft: "03", amft: "関東"  , antt: "03", amtt: "関東"   };
		busArea[busArea.length] = { anft: "03", amft: "関東"  , antt: "04", amtt: "東海・甲信越" };
		busArea[busArea.length] = { anft: "03", amft: "関東"  , antt: "05", amtt: "北陸"   };
		busArea[busArea.length] = { anft: "03", amft: "関東"  , antt: "06", amtt: "近畿"   };
		busArea[busArea.length] = { anft: "03", amft: "関東"  , antt: "07", amtt: "中国"   };
		busArea[busArea.length] = { anft: "03", amft: "関東"  , antt: "08", amtt: "四国"   };
		busArea[busArea.length] = { anft: "04", amft: "東海・甲信越" , antt: "02", amtt: "東北"   };
		busArea[busArea.length] = { anft: "04", amft: "東海・甲信越" , antt: "03", amtt: "関東"   };
		busArea[busArea.length] = { anft: "04", amft: "東海・甲信越" , antt: "04", amtt: "東海・甲信越" };
		busArea[busArea.length] = { anft: "04", amft: "東海・甲信越" , antt: "05", amtt: "北陸"   };
		busArea[busArea.length] = { anft: "04", amft: "東海・甲信越" , antt: "06", amtt: "近畿"   };
		busArea[busArea.length] = { anft: "04", amft: "東海・甲信越" , antt: "07", amtt: "中国"   };
		busArea[busArea.length] = { anft: "04", amft: "東海・甲信越" , antt: "08", amtt: "四国"   };
		busArea[busArea.length] = { anft: "05", amft: "北陸" , antt: "02", amtt: "東北"   };
		busArea[busArea.length] = { anft: "05", amft: "北陸" , antt: "03", amtt: "関東"   };
		busArea[busArea.length] = { anft: "05", amft: "北陸" , antt: "04", amtt: "東海・甲信越" };
		busArea[busArea.length] = { anft: "05", amft: "北陸" , antt: "06", amtt: "近畿"   };
		busArea[busArea.length] = { anft: "06", amft: "近畿" , antt: "02", amtt: "東北"   };
		busArea[busArea.length] = { anft: "06", amft: "近畿" , antt: "03", amtt: "関東"   };
		busArea[busArea.length] = { anft: "06", amft: "近畿" , antt: "04", amtt: "東海・甲信越" };
		busArea[busArea.length] = { anft: "06", amft: "近畿" , antt: "05", amtt: "北陸"   };
		busArea[busArea.length] = { anft: "06", amft: "近畿" , antt: "06", amtt: "近畿"   };
		busArea[busArea.length] = { anft: "06", amft: "近畿" , antt: "07", amtt: "中国"   };
		busArea[busArea.length] = { anft: "06", amft: "近畿" , antt: "08", amtt: "四国"   };
		busArea[busArea.length] = { anft: "06", amft: "近畿" , antt: "09", amtt: "九州"   };
		busArea[busArea.length] = { anft: "07", amft: "中国" , antt: "03", amtt: "関東"   };
		busArea[busArea.length] = { anft: "07", amft: "中国" , antt: "04", amtt: "東海・甲信越" };
		busArea[busArea.length] = { anft: "07", amft: "中国" , antt: "06", amtt: "近畿"   };
		busArea[busArea.length] = { anft: "07", amft: "中国" , antt: "08", amtt: "四国"   };
		busArea[busArea.length] = { anft: "07", amft: "中国" , antt: "09", amtt: "九州"   };
		busArea[busArea.length] = { anft: "08", amft: "四国" , antt: "03", amtt: "関東"   };
		busArea[busArea.length] = { anft: "08", amft: "四国" , antt: "04", amtt: "東海・甲信越" };
		busArea[busArea.length] = { anft: "08", amft: "四国" , antt: "06", amtt: "近畿"   };
		busArea[busArea.length] = { anft: "08", amft: "四国" , antt: "07", amtt: "中国"   };
		busArea[busArea.length] = { anft: "08", amft: "四国" , antt: "09", amtt: "九州"   };
		busArea[busArea.length] = { anft: "09", amft: "九州" , antt: "06", amtt: "近畿"   };
		busArea[busArea.length] = { anft: "09", amft: "九州" , antt: "07", amtt: "中国"   };
		busArea[busArea.length] = { anft: "09", amft: "九州" , antt: "08", amtt: "四国"   };
	}
	function bus_onChangePim()
	{
		setPID( "busForm2", "busForm3", "pim", "pid", "false", "false", "0" );
	}
	function bus_onChangePid( pid )
	{
		document.busForm3.pid.value = pid;
	}
	function bus_setAnft()
	{
		var anft = document.busForm1.anft;
		anft.length = 0;
		for ( var i = 0; i < busArea.length; i++ )
		{
			var isnew = false;
			for ( var j = 0; j < anft.length; j++ )
			{
				if ( busArea[i].anft == anft[j].value )
				{
					isnew = false;
					break;
				}
				else
					isnew = true;
			}
			if ( anft.length == 0 || isnew )
				if ( busArea[i].anft == document.busForm3.anft.value )
				{
					anft[anft.length] = new Option( busArea[i].amft, busArea[i].anft, true, true );
					anft.selectedIndex = anft.length - 1;
				}
				else
					anft[anft.length] = new Option( busArea[i].amft, busArea[i].anft, false, false );
		}
		bus_onChangeAnft( anft[anft.selectedIndex].value );
	}
	function bus_onChangeAnft( anft )
	{
		document.busForm3.anft.value = anft;
		var antt = document.busForm1.antt;
		antt.length = 0;
		antt.length = 0;
		for ( var i = 0; i < busArea.length; i++ )
		{
			if ( anft == busArea[i].anft )
				if ( busArea[i].antt == document.busForm3.antt.value )
				{
					antt[antt.length] = new Option( busArea[i].amtt, busArea[i].antt, true, true );
					antt.selectedIndex = antt.length - 1;
				}
				else
					antt[antt.length] = new Option( busArea[i].amtt, busArea[i].antt, false, false );
		}
	}
	function bus_onChangeAntt( antt )
	{
		document.busForm3.antt.value = antt;
	}
	function bus_onsubmit( f1, f2 )
	{
		try
		{
			for ( var i = 0; i < busArea.length; i++ )
			{
				if ( busArea[i].anft == f1.anft[f1.anft.selectedIndex].value )
				{
					f1.amft.value = busArea[i].amft;
					break;
				}
			}
			for ( var i = 0; i < busArea.length; i++ )
			{
				if ( busArea[i].antt == f1.antt[f1.antt.selectedIndex].value )
				{
					f1.amtt.value = busArea[i].amtt;
					break;
				}
			}
			f1.sthz.value = f2.pim[f2.pim.selectedIndex].value + f2.pid[f2.pid.selectedIndex].value;
			return true;
		}
		catch(e){return false;}
	}

// ----------------------------------------------
// ovstour
// ----------------------------------------------
	function ovstour_onChangePim()
	{
		setPID( "ovstourForm", "ovstourForm2", "deptyearmon", "deptdate", "true", "true", "0" );
	}
	function ovstour_onChangePid( pid )
	{
		document.ovstourForm2.pid.value = pid;
	}
	function ovstour_onChangeDept( dept )
	{
		document.ovstourForm2.dept.value = dept;
	}
	function ovstour_onChangeArea( area )
	{
		document.ovstourForm2.area.value = area;
		ovstour_country.length = 0;
		ovstour_country[ovstour_country.length] = new Option( "国(地域)を指定", "", false, false );
		ovstour_city.length = 0;
		ovstour_city[ovstour_city.length] = new Option( "都市を指定", "", false, false );
		ovstour_GetData( area );
	}
	function ovstour_GetData( area )
	{
		xDocL = null;
		var ajax = new Ajax.Request( "/toppageparts/LOOK/" + area + ".xml",
			{
				method: "get",
				onComplete: function( httpObj )
				{
					xDocL = httpObj.responseXML;
					ovstour_SetCountry();
				}
			}
		);
	}
	function ovstour_SetCountry()
	{
		ovstour_country_cd       = xDocL.getElementsByTagName( "COUNTRY_CD" );
		ovstour_country_name_jpn = xDocL.getElementsByTagName( "COUNTRY_NAME_JPN" );
		
		for (var i = 0; i < ovstour_country_cd.length; i++)
		{
			if ( ovstour_country_cd[i].childNodes.length > 0 )
			{
				if ( ovstour_country[ovstour_country.length-1].value != ovstour_country_cd[i].firstChild.nodeValue )
				{
					if ( ovstour_country_cd[i].firstChild.nodeValue == document.ovstourForm2.country.value )
					{
						ovstour_country[ovstour_country.length] = new Option( ovstour_country_name_jpn[i].firstChild.nodeValue, ovstour_country_cd[i].firstChild.nodeValue, true, true );
						ovstour_country.selectedIndex = ovstour_country.length - 1;
					}
					else
						ovstour_country[ovstour_country.length] = new Option( ovstour_country_name_jpn[i].firstChild.nodeValue, ovstour_country_cd[i].firstChild.nodeValue, false, false );
				}
			}
		}
		ovstour_onChangeCountry( ovstour_country[ovstour_country.selectedIndex].value );
	}
	function ovstour_onChangeCountry( country )
	{
		document.ovstourForm2.country.value = country;
		ovstour_city.length = 0;
		ovstour_city[ovstour_city.length] = new Option( "都市を指定", "", false, false );
		
		ovstour_city_cd       = xDocL.getElementsByTagName( "CITY_CD" );
		ovstour_city_name_jpn = xDocL.getElementsByTagName( "CITY_NAME_JPN" );
		
		for (var i = 0; i < ovstour_city_cd.length; i++)
		{
			if ( ovstour_city_cd[i].childNodes.length > 0 && ovstour_country_cd[i].firstChild.nodeValue == country )
			{
				if ( ovstour_city[ovstour_city.length-1].value != ovstour_city_cd[i].firstChild.nodeValue )
				{
					if ( ovstour_city_cd[i].firstChild.nodeValue == document.ovstourForm2.city.value )
					{
						ovstour_city[ovstour_city.length] = new Option( ovstour_city_name_jpn[i].firstChild.nodeValue, ovstour_city_cd[i].firstChild.nodeValue, true, true );
						ovstour_city.selectedIndex = ovstour_city.length - 1;
					}
						ovstour_city[ovstour_city.length] = new Option( ovstour_city_name_jpn[i].firstChild.nodeValue, ovstour_city_cd[i].firstChild.nodeValue, false, false );
				}
			}
		}
		ovstour_onChangeCity( ovstour_city[ovstour_city.selectedIndex].value );
	}
	function ovstour_onChangeCity( city )
	{
		document.ovstourForm2.city.value = city;
	}

// ----------------------------------------------
// fitair
// ----------------------------------------------
	function fitair_onChangePim()
	{
		if ( document.fitairForm.dd1.selectedIndex >= 0 )
			document.fitairForm2.pim.value = document.fitairForm.dd1[document.fitairForm.dd1.selectedIndex].value;
		if ( document.fitairForm.dd2.selectedIndex >= 0 )
			document.fitairForm2.pid.value = document.fitairForm.dd2[document.fitairForm.dd2.selectedIndex].value;
		if ( document.fitairForm.ha1.selectedIndex >= 0 )
			document.fitairForm3.pim.value = document.fitairForm.ha1[document.fitairForm.ha1.selectedIndex].value;
		if ( document.fitairForm.ha2.selectedIndex >= 0 )
			document.fitairForm3.pid.value = document.fitairForm.ha2[document.fitairForm.ha2.selectedIndex].value;
		
		setPID( "fitairForm", "fitairForm2", "dd1", "dd2", "false", "false", "0" );
		
		var yyyymm2 = document.fitairForm2.pim.value;
		var dd2     = document.fitairForm2.pid.value;
		var d2 = new Date( parseInt( yyyymm2.substr( 0, 4 ), 10 ), parseInt( yyyymm2.substr( 4, 2 ), 10 ) - 1, parseInt( dd2, 10 ) + 2 );
		var yyyymm3 = document.fitairForm3.pim.value;
		var dd3     = document.fitairForm3.pid.value;
		var d3 = new Date();
		if ( yyyymm3.length * dd3.length > 0 )
			d3 = new Date( parseInt( yyyymm3.substr( 0, 4 ), 10 ), parseInt( yyyymm3.substr( 4, 2 ), 10 ) - 1, parseInt( dd3, 10 )  );
		var d0 = new Date();
		var d1 = new Date( parseInt( yyyymm2.substr( 0, 4 ), 10 ), parseInt( yyyymm2.substr( 4, 2 ), 10 ) - 1, parseInt( dd2, 10 ) + parseInt( document.fitairForm3.daysbetween.value, 10 ) );
		document.fitairForm3.datemin.value = daysBetween( d0, d1 );
		if ( d2 > d3 )
		{
			document.fitairForm3.datenow.value = daysBetween( d0, d1 );
		}
		
		setPID( "fitairForm", "fitairForm3", "ha1", "ha2", "false", "false", "0" );
		
		document.fitairForm2.datenow.value = "";
		document.fitairForm3.datenow.value = "";
	}
	function fitair_onChangePid1( pid )
	{
		document.fitairForm2.pid.value = pid;
		fitair_onChangePim()
	}
	function fitair_onChangePid2( pid )
	{
		document.fitairForm3.pid.value = pid;
	}
	function fitair_GetData( area )
	{
		xDocAir = null;
		var ajax = new Ajax.Request( "/kaigai/map/city.xml",
			{
				method: "get",
				onComplete: function( httpObj )
				{
					xDocAir = httpObj.responseXML;
					fitair_SetCountry( area );
				}
			}
		);
	}
	function fitair_SetDept( dept )
	{
		document.fitairForm2.dept.value = dept;
	}
	function fitair_onChangeArea( area )
	{
		document.fitairForm2.destareacd.value = area;
		fitair_country.length = 0;
		fitair_city.length = 0;
		fitair_GetData(area);
	}
	function fitair_SetCountry( ar )
	{
		var area = xDocAir.getElementsByTagName( "Area" );
		for ( var i = 0; i < area.length; i++ )
		{
			if ( area[i].childNodes.length > 0 )
			{
				if ( area[i].getElementsByTagName( "AreaCode" )[0].firstChild.nodeValue == ar )
				{
					xDocAir_cr = area[i].getElementsByTagName( "Country" );
					for (var j = 0; j < xDocAir_cr.length; j++)
					{
						fitair_country_cd       = xDocAir_cr[j].getElementsByTagName( "CountryCD" )[0].firstChild.nodeValue;
						fitair_country_name_jpn = xDocAir_cr[j].getElementsByTagName( "CountryName" )[0].firstChild.nodeValue;
						
						if ( fitair_country_cd != "J01" )
							if ( fitair_country_cd == document.fitairForm2.destcountrycd.value )
							{
								fitair_country[fitair_country.length] = new Option( fitair_country_name_jpn, fitair_country_cd, true, true );
								fitair_country.selectedIndex = fitair_country.length - 1;
							}
							else
								fitair_country[fitair_country.length] = new Option( fitair_country_name_jpn, fitair_country_cd, false, false );
					}
					break;
				}
			}
		}
		fitair_onChangeCountry( fitair_country[fitair_country.selectedIndex].value );
	}
	function fitair_onChangeCountry( country )
	{
		document.fitairForm2.destcountrycd.value = country;
		fitair_city.length = 0;
		
		for (var i = 0; i < xDocAir_cr.length; i++)
		{
			if ( xDocAir_cr[i].getElementsByTagName( "CountryCD" )[0].firstChild.nodeValue == country )
			{
				xDocAir_ct = xDocAir_cr[i].getElementsByTagName( "City" );
				for (var j = 0; j < xDocAir_ct.length; j++)
				{
					fitair_city_cd       = xDocAir_ct[j].getElementsByTagName( "City3Letter" )[0].firstChild.nodeValue;
					fitair_city_name_jpn = xDocAir_ct[j].getElementsByTagName( "CityName" )[0].firstChild.nodeValue;
					if ( fitair_city_cd == document.fitairForm2.destcitycd.value )
					{
						fitair_city[fitair_city.length] = new Option( fitair_city_name_jpn, fitair_city_cd, true, true );
						fitair_city.selectedIndex = fitair_city.length - 1;
					}
					else
						fitair_city[fitair_city.length] = new Option( fitair_city_name_jpn, fitair_city_cd, false, false );
				}
				break;
			}
		}
		fitair_onChangeCity( fitair_city[fitair_city.selectedIndex].value )
	}
	function fitair_onChangeCity( city )
	{
		document.fitairForm2.destcitycd.value = city;
	}
	function fitair_goSearch(form)
	{
		var depaptj = form.depaptj[form.depaptj.selectedIndex].value;
		var arraptj = form.destcitycd[form.destcitycd.selectedIndex].value;
		var dt      = form.dd1[form.dd1.selectedIndex].value + form.dd2[form.dd2.selectedIndex].value;
		var dtback  = form.ha1[form.ha1.selectedIndex].value + form.ha2[form.ha2.selectedIndex].value;
		var seat;
		for ( var i = 0; i < form.seat.length; i++ )
		{
			if ( form.seat[i].checked )
			{
				seat = form.seat[i].value;
				break;
			}
		}
		var url = form.action + "?ib=1&spnl=1&tt=0&depaptj=" + depaptj + "&arraptj=" + arraptj + "&dt=" + dt + "&dtback=" + dtback + "&seat=" + seat + "&fl=3&stav=1";
		location = url;
	}

// ----------------------------------------------
// fithotel
// ----------------------------------------------
	function fithotel_SetPID()
	{
		setPID( "fithotelForm", "fithotelForm2", "pim", "pid", "false", "false", "0" );
	}
	function fithotel_onChangePid( pid )
	{
		document.fithotelForm2.pid.value = pid;
	}
	function fithotel_GetData( area )
	{
		xDocHotel = null;
		var ajax = new Ajax.Request( "/kaigai/map/city.xml",
			{
				method: "get",
				onComplete: function( httpObj )
				{
					xDocHotel = httpObj.responseXML;
					fithotel_SetCountry( area );
				}
			}
		);
	}
	function fithotel_SetDept( dept )
	{
		document.fithotelForm2.dept.value = dept;
	}
	function fithotel_GetCountry( area )
	{
		document.fithotelForm2.destareacd.value = area;
		fithotel_country.length = 0;
		fithotel_city.length = 0;
		fithotel_GetData( area );
	}
	function fithotel_SetCountry( ar )
	{
		var area = xDocHotel.getElementsByTagName( "Area" );
		for ( var i = 0; i < area.length; i++ )
		{
			if ( area[i].childNodes.length > 0 )
			{
				if ( area[i].getElementsByTagName( "AreaCode" )[0].firstChild.nodeValue == ar )
				{
					xDocHotel_cr = area[i].getElementsByTagName( "Country" );
					for (var j = 0; j < xDocHotel_cr.length; j++)
					{
						fithotel_country_cd       = xDocHotel_cr[j].getElementsByTagName( "CountryCD" )[0].firstChild.nodeValue;
						fithotel_country_name_jpn = xDocHotel_cr[j].getElementsByTagName( "CountryName" )[0].firstChild.nodeValue;
						
						if ( fithotel_country_cd != "J01" )
							if ( fithotel_country_cd == document.fithotelForm2.destcountrycd.value )
							{
								fithotel_country[fithotel_country.length] = new Option( fithotel_country_name_jpn, fithotel_country_cd, true, true );
								fithotel_country.selectedIndex = fithotel_country.length - 1;
							}
							else
								fithotel_country[fithotel_country.length] = new Option( fithotel_country_name_jpn, fithotel_country_cd, false, false );
					}
					break;
				}
			}
		}
		fithotel_SetCity( fithotel_country[fithotel_country.selectedIndex].value );
	}
	function fithotel_SetCity( country )
	{
		document.fithotelForm2.destcountrycd.value = country;
		fithotel_city.length = 0;
		
		for (var i = 0; i < xDocHotel_cr.length; i++)
		{
			if ( xDocHotel_cr[i].getElementsByTagName( "CountryCD" )[0].firstChild.nodeValue == country )
			{
				xDocHotel_ct = xDocHotel_cr[i].getElementsByTagName( "City" );
				for (var j = 0; j < xDocHotel_ct.length; j++)
				{
					fithotel_city_cd       = xDocHotel_ct[j].getElementsByTagName( "City3Letter" )[0].firstChild.nodeValue;
					fithotel_city_name_jpn = xDocHotel_ct[j].getElementsByTagName( "CityName" )[0].firstChild.nodeValue;
					if ( fithotel_city_cd == document.fithotelForm2.destcitycd.value )
					{
						fithotel_city[fithotel_city.length] = new Option( fithotel_city_name_jpn, fithotel_city_cd, true, true );
						fithotel_city.selectedIndex = fithotel_city.length - 1;
					}
					else
						fithotel_city[fithotel_city.length] = new Option( fithotel_city_name_jpn, fithotel_city_cd, false, false );
				}
				break;
			}
		}
		fithotel_SetCity2( fithotel_city[fithotel_city.selectedIndex].value )
	}
	function fithotel_SetCity2( city )
	{
		document.fithotelForm2.destcitycd.value = city;
	}
	function fithotel_goSearch( f )
	{
		var area    = f.destareacd[f.destareacd.selectedIndex].value;
		var country = f.destcountrycd[f.destcountrycd.selectedIndex].value;
		var city    = f.destcitycd[f.destcitycd.selectedIndex].value;
		var pim     = f.pim[f.pim.selectedIndex].value;
		var pid     = f.pid[f.pid.selectedIndex].value;
		var sn      = f.sn[f.sn.selectedIndex].value;
		var room    = f.room[f.room.selectedIndex].value;
		
		var d2 = new Date( parseInt( pim.substr( 0, 4 ), 10 ), parseInt( pim.substr( 4, 2 ), 10 ) - 1, parseInt( pid, 10 ) + parseInt( sn, 10 ) );
		var rdate   = d2.getFullYear() * 10000 + ( d2.getMonth() + 1 ) * 100 + d2.getDate();
		
		var url = f.action + "?AreaCD=" + area + "&CountryCD=" + country + "&CityCD=" + city + "&DeptDate=" + pim + pid + "&RetnDate=" + rdate + "&r=" + room + "&NumStay=" + sn + "&proc=1";
		location = url;
	}

// ----------------------------------------------
// fittour
// ----------------------------------------------
	function fittour_SetPID()
	{
		setPID( "fittourForm", "fittourForm2", "pim", "pid", "true", "false", "0" );
	}
	function fittour_onChangePid( pid )
	{
		document.fittourForm2.pid.value = pid;
	}
	function fittour_GetData( area )
	{
		xDocTour = null;
		var ajax = new Ajax.Request( "/kaigai/map/city_opt.xml",
			{
				method: "get",
				onComplete: function( httpObj )
				{
					xDocTour = httpObj.responseXML;
					fittour_SetCountry( area );
				}
			}
		);
	}
	function fittour_SetDept( dept )
	{
		document.fittourForm2.dept.value = dept;
	}
	function fittour_GetCountry( area )
	{
		document.fittourForm2.destareacd.value = area;
		fittour_country.length = 0;
		fittour_city.length = 0;
		fittour_GetData( area );
	}
	function fittour_SetCountry( ar )
	{
		fittour_country[fittour_country.length] = new Option( "国(地域)を指定", "", false, false );
		var area = xDocTour.getElementsByTagName( "Area" );
		for ( var i = 0; i < area.length; i++ )
		{
			if ( area[i].childNodes.length > 0 )
			{
				if ( area[i].getElementsByTagName( "AreaCode" )[0].firstChild.nodeValue == ar )
				{
					xDocTour_cr = area[i].getElementsByTagName( "Country" );
					for (var j = 0; j < xDocTour_cr.length; j++)
					{
						fittour_country_cd       = xDocTour_cr[j].getElementsByTagName( "CountryCD" )[0].firstChild.nodeValue;
						fittour_country_name_jpn = xDocTour_cr[j].getElementsByTagName( "CountryName" )[0].firstChild.nodeValue;
						
						if ( fittour_country_cd != "J01" )
							if ( fittour_country_cd == document.fittourForm2.destcountrycd.value )
							{
								fittour_country[fittour_country.length] = new Option( fittour_country_name_jpn, fittour_country_cd, true, true );
								fittour_country.selectedIndex = fittour_country.length - 1;
							}
							else
								fittour_country[fittour_country.length] = new Option( fittour_country_name_jpn, fittour_country_cd, false, false );
					}
					break;
				}
			}
		}
		fittour_SetCity( fittour_country[fittour_country.selectedIndex].value );
	}
	function fittour_SetCity( country )
	{
		document.fittourForm2.destcountrycd.value = country;
		fittour_city.length = 0;
		fittour_city[fittour_city.length] = new Option( "都市を指定", "", false, false );
		
		for (var i = 0; i < xDocTour_cr.length; i++)
		{
			if ( xDocTour_cr[i].getElementsByTagName( "CountryCD" )[0].firstChild.nodeValue == country )
			{
				xDocTour_ct = xDocTour_cr[i].getElementsByTagName( "City" );
				for (var j = 0; j < xDocTour_ct.length; j++)
				{
					fittour_city_cd       = xDocTour_ct[j].getElementsByTagName( "City3Letter" )[0].firstChild.nodeValue;
					fittour_city_name_jpn = xDocTour_ct[j].getElementsByTagName( "CityName" )[0].firstChild.nodeValue;
					if ( fittour_city_cd == document.fittourForm2.destcitycd.value )
					{
						fittour_city[fittour_city.length] = new Option( fittour_city_name_jpn, fittour_city_cd, true, true );
						fittour_city.selectedIndex = fittour_city.length - 1;
					}
					else
						fittour_city[fittour_city.length] = new Option( fittour_city_name_jpn, fittour_city_cd, false, false );
				}
				break;
			}
		}
		fittour_SetCity2( fittour_city[fittour_city.selectedIndex].value )
	}
	function fittour_SetCity2( city )
	{
		document.fittourForm2.destcitycd.value = city;
	}
	function fittour_goSearch( f )
	{
		var area    = f.destareacd[f.destareacd.selectedIndex].value;
		var country = f.destcountrycd[f.destcountrycd.selectedIndex].value;
		var city    = f.destcitycd[f.destcitycd.selectedIndex].value;
		var pim     = f.pim[f.pim.selectedIndex].value;
		var pid     = f.pid[f.pid.selectedIndex].value;
		
		var ymid = "";
		if ( pim != "" )
		{
			var today = new Date();
			var y = today.getFullYear();
			var m = today.getMonth() + 1;
			var y1 = parseInt( pim.substr( 0, 4 ), 10 );
			var m1 = parseInt( pim.substr( 4, 2 ), 10 );
			ymid = ( y1 - y ) * 12 + m1 - m;
		}
		var did  = ( pid == "" ) ? "" : parseInt( pid, 10 );
		
		var url = f.action + "?AreaCD=" + area + "&CountryCD=" + country + "&CityCD=" + city + "&YearMonthId=" + ymid + "&DayId=" + did + "&VacantFlag=True";
		location = url;
	}

// ----------------------------------------------
// fitair-tr
// ----------------------------------------------
	function fitair_tr_onChangePim()
	{
		if ( document.fitairTrForm.dd1.selectedIndex >= 0 )
			document.fitairTrForm2.pim.value = document.fitairTrForm.dd1[document.fitairTrForm.dd1.selectedIndex].value;
		if ( document.fitairTrForm.dd2.selectedIndex >= 0 )
			document.fitairTrForm2.pid.value = document.fitairTrForm.dd2[document.fitairTrForm.dd2.selectedIndex].value;
		if ( document.fitairTrForm.ha1.selectedIndex >= 0 )
			document.fitairTrForm3.pim.value = document.fitairTrForm.ha1[document.fitairTrForm.ha1.selectedIndex].value;
		if ( document.fitairTrForm.ha2.selectedIndex >= 0 )
			document.fitairTrForm3.pid.value = document.fitairTrForm.ha2[document.fitairTrForm.ha2.selectedIndex].value;
		
		setPID( "fitairTrForm", "fitairTrForm2", "dd1", "dd2", "false", "false", "0" );
		
		var yyyymm2 = document.fitairTrForm2.pim.value;
		var dd2     = document.fitairTrForm2.pid.value;
		var d2 = new Date( parseInt( yyyymm2.substr( 0, 4 ), 10 ), parseInt( yyyymm2.substr( 4, 2 ), 10 ) - 1, parseInt( dd2, 10 ) + 2 );
		var yyyymm3 = document.fitairTrForm3.pim.value;
		var dd3     = document.fitairTrForm3.pid.value;
		var d3 = new Date();
		if ( yyyymm3.length * dd3.length > 0 )
			d3 = new Date( parseInt( yyyymm3.substr( 0, 4 ), 10 ), parseInt( yyyymm3.substr( 4, 2 ), 10 ) - 1, parseInt( dd3, 10 )  );
		var d0 = new Date();
		var d1 = new Date( parseInt( yyyymm2.substr( 0, 4 ), 10 ), parseInt( yyyymm2.substr( 4, 2 ), 10 ) - 1, parseInt( dd2, 10 ) + parseInt( document.fitairTrForm3.daysbetween.value, 10 ) );
		document.fitairTrForm3.datemin.value = daysBetween( d0, d1 );
		if ( d2 > d3 )
		{
			document.fitairTrForm3.datenow.value = daysBetween( d0, d1 );
		}
		
		setPID( "fitairTrForm", "fitairTrForm3", "ha1", "ha2", "false", "false", "0" );
		
		document.fitairTrForm2.datenow.value = "";
		document.fitairTrForm3.datenow.value = "";
	}
	function fitair_tr_onChangePid1( pid )
	{
		document.fitairTrForm2.pid.value = pid;
		fitair_tr_onChangePim()
	}
	function fitair_tr_onChangePid2( pid )
	{
		document.fitairTrForm3.pid.value = pid;
	}
	function fitair_GetData( area )
	{
		xDocAir = null;
		var ajax = new Ajax.Request( "/kaigai/map/city.xml",
			{
				method: "get",
				onComplete: function( httpObj )
				{
					xDocAir = httpObj.responseXML;
					fitair_SetCountry( area );
				}
			}
		);
	}
	function fitair_SetDept( dept )
	{
		document.fitairTrForm2.dept.value = dept;
	}
	function fitair_tr_onChangeArea( area )
	{
		document.fitairTrForm2.destareacd.value = area;
		fitair_country.length = 0;
		fitair_city.length = 0;
		fitair_GetData(area);
	}
	function fitair_SetCountry( ar )
	{
		var area = xDocAir.getElementsByTagName( "Area" );
		for ( var i = 0; i < area.length; i++ )
		{
			if ( area[i].childNodes.length > 0 )
			{
				if ( area[i].getElementsByTagName( "AreaCode" )[0].firstChild.nodeValue == ar )
				{
					xDocAir_cr = area[i].getElementsByTagName( "Country" );
					for (var j = 0; j < xDocAir_cr.length; j++)
					{
						fitair_country_cd       = xDocAir_cr[j].getElementsByTagName( "CountryCD" )[0].firstChild.nodeValue;
						fitair_country_name_jpn = xDocAir_cr[j].getElementsByTagName( "CountryName" )[0].firstChild.nodeValue;
						
						if ( fitair_country_cd != "J01" )
							if ( fitair_country_cd == document.fitairTrForm2.destcountrycd.value )
							{
								fitair_country[fitair_country.length] = new Option( fitair_country_name_jpn, fitair_country_cd, true, true );
								fitair_country.selectedIndex = fitair_country.length - 1;
							}
							else
								fitair_country[fitair_country.length] = new Option( fitair_country_name_jpn, fitair_country_cd, false, false );
					}
					break;
				}
			}
		}
		fitair_tr_onChangeCountry( fitair_country[fitair_country.selectedIndex].value );
	}
	function fitair_tr_onChangeCountry( country )
	{
		document.fitairTrForm2.destcountrycd.value = country;
		fitair_city.length = 0;
		
		for (var i = 0; i < xDocAir_cr.length; i++)
		{
			if ( xDocAir_cr[i].getElementsByTagName( "CountryCD" )[0].firstChild.nodeValue == country )
			{
				xDocAir_ct = xDocAir_cr[i].getElementsByTagName( "City" );
				for (var j = 0; j < xDocAir_ct.length; j++)
				{
					fitair_city_cd       = xDocAir_ct[j].getElementsByTagName( "City3Letter" )[0].firstChild.nodeValue;
					fitair_city_name_jpn = xDocAir_ct[j].getElementsByTagName( "CityName" )[0].firstChild.nodeValue;
					if ( fitair_city_cd == document.fitairTrForm2.destcitycd.value )
					{
						fitair_city[fitair_city.length] = new Option( fitair_city_name_jpn, fitair_city_cd, true, true );
						fitair_city.selectedIndex = fitair_city.length - 1;
					}
					else
						fitair_city[fitair_city.length] = new Option( fitair_city_name_jpn, fitair_city_cd, false, false );
				}
				break;
			}
		}
		fitair_tr_onChangeCity( fitair_city[fitair_city.selectedIndex].value )
	}
	function fitair_tr_onChangeCity( city )
	{
		document.fitairTrForm2.destcitycd.value = city;
	}
	function fitair_tr_goSearch(form)
	{
		var depaptj = form.depaptj[form.depaptj.selectedIndex].value;
		var arraptj = form.destcitycd[form.destcitycd.selectedIndex].value;
		var dt      = form.dd1[form.dd1.selectedIndex].value + form.dd2[form.dd2.selectedIndex].value;
		var dtback  = form.ha1[form.ha1.selectedIndex].value + form.ha2[form.ha2.selectedIndex].value;
		var seat;
		for ( var i = 0; i < form.seat.length; i++ )
		{
			if ( form.seat[i].checked )
			{
				seat = form.seat[i].value;
				break;
			}
		}
		var url = "/toppageparts2/fitair-tr/othersite.asp?target=" + form.action + "?cm=getAirUrl&from0=" + depaptj + "&to0=" + arraptj + "&from1=" + arraptj + "&to1=" + depaptj + "&date0=" + dt + "&date1=" + dtback + "&class=" + seat + "&adl_num=1";
		//location = url;
		window.open( url );
	}

// ----------------------------------------------
// fitair-tr
// ----------------------------------------------
	function tornossearch_Init()
	{
		form0 = document.fitairTrForm;
		
		$( "tornossearch_arrival_errmsg" ).style.display = "none";
		$( "tornossearch_arrival"        ).className = "arrival";
		//$( "tornossearch_arrival_img"    ).src = "images/ti_arrival.gif";
		tornossearch_SetConfig();
		
		tornossearch_SetDomAirport( form0.from0 );
		tornossearch_SetArea( form0.to0area );
		//tornossearch_SetCabin( form0.cabin );
	}
	function tornossearch_SetConfig()
	{
		xDoc1 = null;
		var ajax = new Ajax.Request( xmlpath + "Config.xml",
			{
				method: "get",
				onSuccess: function( httpObj )
				{
					try
					{
						xDoc1 = httpObj.responseXML;
						var Config = xDoc1.getElementsByTagName( "Config" );
						var link = Config[0].getElementsByTagName( "link" );
						var cid1 = Config[0].getElementsByTagName( "cid" );
						var num1 = Config[0].getElementsByTagName( "PassengerMaxNum" );
						var dept = Config[0].getElementsByTagName( "Departure" );
						var retn = Config[0].getElementsByTagName( "Return" );
						var top1 = cid1[0].getElementsByTagName( "JTB_TOP" );
						var min1 = dept[0].getElementsByTagName( "Min" );
						var max1 = dept[0].getElementsByTagName( "Max" );
						var min2 = retn[0].getElementsByTagName( "Min" );
						var max2 = retn[0].getElementsByTagName( "Max" );
						if ( link.length > 0 )
							form0.tornossearch_link.value              = link[0].firstChild.nodeValue;
						form0.tornossearch_cid.value                   = top1[0].firstChild.nodeValue;
						form0.tornossearch_PassengerMaxNum.value       = num1[0].firstChild.nodeValue;
						form0.tornossearch_Departure_Min_Pattern.value = min1[0].getAttribute("Pattern");
						form0.tornossearch_Departure_Min_Value.value   = min1[0].firstChild.nodeValue;
						form0.tornossearch_Departure_Max_Pattern.value = max1[0].getAttribute("Pattern");
						form0.tornossearch_Departure_Max_Value.value   = max1[0].firstChild.nodeValue;
						form0.tornossearch_Return_Min_Pattern.value    = min2[0].getAttribute("Pattern");
						form0.tornossearch_Return_Min_Value.value      = min2[0].firstChild.nodeValue;
						form0.tornossearch_Return_Max_Pattern.value    = max2[0].getAttribute("Pattern");
						form0.tornossearch_Return_Max_Value.value      = max2[0].firstChild.nodeValue;
						
						if ( parseInt( "0" + form0.tornossearch_PassengerMaxNum.value, 10 ) == 0 )
						{
							form0.tornossearch_PassengerMaxNum.value = "9";
						}
						var adl_num = form0.adl_num;
						adl_num.length = 0;
						for ( var i = 1; i <= parseInt( form0.tornossearch_PassengerMaxNum.value, 10 ); i++ )
						{
							adl_num[adl_num.length] = new Option( i + "名", i, false, false );
						}
						
						tornossearch_onChangePid( "true" );
						
						var tornos = "http://";
						switch ( location.hostname )
						{
							case "st-www.jtb.co.jp" :
								tornos += "202.143.76.218";
								break;
							default :
								tornos += "www.tornos.jp";
								break;
						}
						$( "tornos_air_link1" ).href = tornos + "/fr/DFR01AIR01V00_Init.do?link=" + form0.tornossearch_link.value + "&cid=jtb_air_003";
						document.tornosForm.action = tornos + "/fr/DFR01AIR01V01_GetAirUrl.do?cm=getAirUrl";
					}
					catch(e)
					{
						alert(e);
					}
				},
				onFailure: function()
				{
					alert("onFailure");
				}
			}
		);
	}
	function tornossearch_SetDomAirport( elm )
	{
		xDoc2 = null;
		var ajax = new Ajax.Request( xmlpath + "DomAirport.xml",
			{
				method: "get",
				onSuccess: function( httpObj )
				{
					try
					{
						xDoc2 = httpObj.responseXML;
						var DomAirport = xDoc2.getElementsByTagName( "DomAirport" );
						elm.length = 0;
						for ( var i = 0; i < DomAirport.length; i++ )
						{
							elm[elm.length] = new Option( DomAirport[i].firstChild.nodeValue, DomAirport[i].getAttribute("DomAirportCode"), false, false );
							elm[elm.length-1].title = DomAirport[i].firstChild.nodeValue;
							elm[elm.length-1].onmouseover = function(){ new Tooltip( elm[elm.length-1] ); };
						}
					}
					catch(e)
					{
						alert(e);
					}
				},
				onFailure: function()
				{
					alert("onFailure");
				}
			}
		);
	}
	function tornossearch_SetArea( elm )
	{
		elm.length = 0;
		elm[elm.length] = new Option( "地域を選択してください", "", false, false );
		xDoc3 = null;
		var ajax = new Ajax.Request( xmlpath + "Area.xml",
			{
				method: "get",
				onSuccess: function( httpObj )
				{
					try
					{
						xDoc3 = httpObj.responseXML;
						var area = xDoc3.getElementsByTagName( "Area" );
						for ( var i = 0; i < area.length; i++ )
						{
							elm[elm.length] = new Option( area[i].firstChild.nodeValue, area[i].getAttribute("AreaCode"), false, false );
							elm[elm.length-1].title = area[i].firstChild.nodeValue;
							elm[elm.length-1].onmouseover = function(){ new Tooltip( elm[elm.length-1] ); };
						}
						if ( form0.tornossearch_CityCode.value != "" )
						{
							xDoc8 = null;
							var ajax2 = new Ajax.Request( xmlpath + "City.xml",
								{
									method: "get",
									onSuccess: function( httpObj )
									{
										try
										{
											xDoc8 = httpObj.responseXML;
											var country = xDoc8.getElementsByTagName( "Country" );
											var countrycode = "";
											for ( var i = 0; i < country.length; i++ )
											{
												var city = country[i].getElementsByTagName( "City" );
												for ( var j = 0; j < city.length; j++ )
												{
													if ( city[j].getAttribute("CityCode") == form0.tornossearch_CityCode.value )
													{
														countrycode = country[i].getAttribute("CountryCode");
														break;
													}
												}
												if ( countrycode != "" ) break;
											}
											form0.tornossearch_CountryCode.value = countrycode;
											if ( countrycode != "" )
											{
												xDoc9 = null;
												var ajax3 = new Ajax.Request( xmlpath + "Country.xml",
													{
														method: "get",
														onSuccess: function( httpObj )
														{
															try
															{
																xDoc9 = httpObj.responseXML;
																var area = xDoc9.getElementsByTagName( "Area" );
																var areacode = "";
																for ( var i = 0; i < area.length; i++ )
																{
																	country = area[i].getElementsByTagName( "Country" );
																	for ( var j = 0; j < country.length; j++ )
																	{
																		if ( country[j].getAttribute("CountryCode") == form0.tornossearch_CountryCode.value )
																		{
																			areacode = area[i].getAttribute("AreaCode");
																			break;
																		}
																	}
																	if ( areacode != "" ) break;
																}
																
																for ( var i = 0; i < elm.length; i++ )
																	if ( elm[i].value == areacode ) elm.selectedIndex = i;
																tornossearch_onChangeArea( areacode );
															}
															catch(e)
															{
																alert(e);
															}
														},
														onFailure: function()
														{
															alert("onFailure3");
														}
													}
												);
											}
										}
										catch(e)
										{
											alert(e);
										}
									},
									onFailure: function()
									{
										alert("onFailure2");
									}
								}
							);
						}
					}
					catch(e)
					{
						alert(e);
					}
				},
				onFailure: function()
				{
					alert("onFailure1");
				}
			}
		);
	}
	function tornossearch_onChangeArea( areacode )
	{
		form0.tornossearch_AreaCode.value = areacode;
		var to0country = form0.to0country;
		to0country.length = 0;
		to0country[to0country.length] = new Option( "国を選択してください", "", false, false );
		xDoc4 = null;
		if ( areacode != "" )
			var ajax = new Ajax.Request( xmlpath + "Country.xml",
				{
					method: "get",
					onSuccess: function( httpObj )
					{
						try
						{
							xDoc4 = httpObj.responseXML;
							var area = xDoc4.getElementsByTagName( "Area" );
							for ( var i = 0; i < area.length; i++ )
							{
								if ( areacode == area[i].getAttribute("AreaCode") )
								{
									var country = area[i].getElementsByTagName( "Country" );
									for ( var j = 0; j < country.length; j++ )
									{
										to0country[to0country.length] = new Option( country[j].firstChild.nodeValue, country[j].getAttribute("CountryCode"), false, false );
										to0country[to0country.length-1].title = country[j].firstChild.nodeValue;
										to0country[to0country.length-1].onmouseover = function(){ new Tooltip( elm[elm.length-1] ); };
										if ( country[j].getAttribute("CountryCode") == form0.tornossearch_CountryCode.value ) to0country.selectedIndex = to0country.length - 1;
									}
								}
								
							}
							tornossearch_onChangeCountry( to0country[to0country.selectedIndex].value );
						}
						catch(e)
						{
							alert(e);
						}
					},
					onFailure: function()
					{
						alert("onFailure");
					}
				}
			);
	}
	function tornossearch_onChangeCountry( countrycode )
	{
		form0.tornossearch_CountryCode.value = countrycode;
		var to0 = form0.to0;
		to0.length = 0;
		to0[to0.length] = new Option( "都市・空港を選択してください", "", false, false );
		xDoc5 = null;
		if ( countrycode != "" )
			var ajax = new Ajax.Request( xmlpath + "City.xml",
				{
					method: "get",
					onSuccess: function( httpObj )
					{
						try
						{
							xDoc5 = httpObj.responseXML;
							var country = xDoc5.getElementsByTagName( "Country" );
							for ( var i = 0; i < country.length; i++ )
							{
								if ( countrycode == country[i].getAttribute("CountryCode") )
								{
									var city = country[i].getElementsByTagName( "City" );
									for ( var j = 0; j < city.length; j++ )
									{
										to0[to0.length] = new Option( city[j].firstChild.nodeValue, city[j].getAttribute("CityCode"), false, false );
										to0[to0.length-1].title = city[j].firstChild.nodeValue;
										to0[to0.length-1].onmouseover = function(){ new Tooltip( elm[elm.length-1] ); };
										if ( city[j].getAttribute("CityCode") == form0.tornossearch_CityCode.value ) to0.selectedIndex = to0.length - 1;
									}
								}
							}
							tornossearch_onChangeCity( to0[to0.selectedIndex].value )
						}
						catch(e)
						{
							alert(e);
						}
					},
					onFailure: function()
					{
						alert("onFailure");
					}
				}
			);
	}
	function tornossearch_onChangeCity( citycode )
	{
		form0.tornossearch_CityCode.value = citycode;
	}
	function tornossearch_SetCabin( elm )
	{
		elm.length = 0;
		xDoc6 = null;
		var ajax = new Ajax.Request( xmlpath + "Cabin.xml",
				{
				method: "get",
				onSuccess: function( httpObj )
				{
					try
					{
						xDoc6 = httpObj.responseXML;
						var Cabin = xDoc6.getElementsByTagName( "Cabin" );
						for ( var i = 0; i < Cabin.length; i++ )
						{
							elm[elm.length] = new Option( Cabin[i].firstChild.nodeValue, Cabin[i].getAttribute("CabinCode"), false, false );
							elm[elm.length-1].title = Cabin[i].firstChild.nodeValue;
							elm[elm.length-1].onmouseover = function(){ new Tooltip( elm[elm.length-1] ); };
						}
						
						//tornossearch_SetCarrier( form0.carrier0 );
					}
					catch(e)
					{
						alert(e);
					}
				},
				onFailure: function()
				{
					alert("onFailure");
				}
			}
		);
	}
	function tornossearch_SetCarrier( elm )
	{
		elm.length = 0;
		elm[elm.length] = new Option( "指定しない", "", false, false );
		xDoc7 = null;
		var ajax = new Ajax.Request( xmlpath + "Carrier.xml",
			{
				method: "get",
				onSuccess: function( httpObj )
				{
					try
					{
						xDoc7 = httpObj.responseXML;
						var Carrier = xDoc7.getElementsByTagName( "Carrier" );
						for ( var i = 0; i < Carrier.length; i++ )
						{
							elm[elm.length] = new Option( Carrier[i].firstChild.nodeValue, Carrier[i].getAttribute("CarrierCode"), false, false );
							elm[elm.length-1].title = Carrier[i].firstChild.nodeValue;
							elm[elm.length-1].onmouseover = function(){ new Tooltip( elm[elm.length-1] ); };
						}
					}
					catch(e)
					{
						alert(e);
					}
				},
				onFailure: function()
				{
					alert("onFailure");
				}
			}
		);
	}
	function tornossearch_onSubmit( form )
	{
		var adl_num = form.adl_num[form.adl_num.selectedIndex].value;
		var depaptj = form.from0[form.from0.selectedIndex].value;
		var arraptj = form.to0[form.to0.selectedIndex].value;
		var dt      = form.dd1[form.dd1.selectedIndex].value + form.dd2[form.dd2.selectedIndex].value;
		var dtback  = form.ha1[form.ha1.selectedIndex].value + form.ha2[form.ha2.selectedIndex].value;
		//var cabin   = form.cabin[form.cabin.selectedIndex].value;
		var cabin = "";
		for ( var i = 0; i < form.cabin.length; i++ )
		{
			if ( form.cabin[i].checked )
			{
				cabin = form.cabin[i].value;
				break;
			}
		}
		//var carrier = form.carrier0[form.carrier0.selectedIndex].value;
		//var direct  = form.direct[form.direct.selectedIndex].value;
		var direct = "";;
		for ( var i = 0; i < form.direct.length; i++ )
		{
			if ( form.direct[i].checked )
			{
				direct = form.direct[i].value;
				break;
			}
		}
		var cid = form.tornossearch_cid.value;
		var link = form.tornossearch_link.value;
		
/*		// トルノスへ直接飛ばすので不要になった
		var url = "http://";
		switch ( location.hostname )
		{
			case "www.jtb.co.jp" :
				url += "ovs.jtb.co.jp";
				break;
			case "st-www.jtb.co.jp" :
				url += "pre-ovs.jtb.co.jp";
				break;
			default :
				url += "st-ovs.i.jtb.co.jp";
				break;
		}
		url += "/common_ovs/othersite/tornossite.asp";
		url += "?from0="    + depaptj;
		url += "&to0="      + arraptj;
		url += "&from1="    + arraptj;
		url += "&to1="      + depaptj;
		url += "&date0="    + dt;
		url += "&date1="    + dtback;
		url += "&class="    + cabin;
		//url += "&carrier0=" + carrier;
		url += "&adl_num="  + adl_num;
		url += "&direct="   + direct;
		url += "&cid="      + cid;
		url += "&link="     + link;
*/		
		if ( arraptj == "" )
		{
			$( "tornossearch_arrival_errmsg" ).style.display = "block";
			$( "tornossearch_arrival"        ).className = "arrival error";
			//$( "tornossearch_arrival_img"    ).src = "images/ti_arrival_err.gif";
			form.to0area.focus();
		}
		else
		{
			$( "tornossearch_arrival_errmsg" ).style.display = "none";
			$( "tornossearch_arrival"        ).className = "arrival";
			//$( "tornossearch_arrival_img"    ).src = "images/ti_arrival.gif";
			//location = url;
			//window.open( url );
			var f = document.tornosForm;
			f.adl_num.value = adl_num;
			f.date0.value = dt;
			f.from0.value = depaptj;
			f.to0.value = arraptj;
			f.date1.value = dtback;
			f.from1.value = arraptj;
			f.to1.value = depaptj;
			//f.class.value = cabin;
			f.elements[7].value = cabin;
			f.direct.value = direct;
			f.cid.value = cid;
			f.link.value = link;
			f.submit();
		}
	}
	
	function tornossearch_onChangePid( flg )
	{
		SetPID_tr( 0, "true" );
		SetPID_tr( 1, flg );
	}
	function SetPID_tr( idx, flg )
	{
		var s = [ "Departure", "Return" ];
		var pim = [ form0.dd1, form0.ha1 ];
		var pid = [ form0.dd2, form0.ha2 ];
		var yyyymm1 = pim[0].selectedIndex < 0 ? "" : pim[0][pim[0].selectedIndex].value;
		var dd1     = pid[0].selectedIndex < 0 ? "" : pid[0][pid[0].selectedIndex].value;
		var yyyymm2 = pim[idx].selectedIndex < 0 ? "" : pim[idx][pim[idx].selectedIndex].value;
		var dd2     = pid[idx].selectedIndex < 0 ? "" : pid[idx][pid[idx].selectedIndex].value;
		var yyyymmdd1 = yyyymm1 + "" + dd1;
		var yyyymmdd2 = yyyymm2 + "" + dd2;
		
		var yobi = new Array ( "日", "月", "火", "水", "木", "金", "土" );
		var today = new Date();
		
		var datemin = eval( "form0.tornossearch_" + s[idx] + "_Min_Value" ).value;
		var datemax = eval( "form0.tornossearch_" + s[idx] + "_Max_Value" ).value;
		var datedef = eval( "form0.tornossearch_" + s[idx] + "_Def_Value" ).value;
		
		var daymin = eval( "form0.tornossearch_" + s[idx] + "_Min_Pattern" ).value == "DateAdd" ? new Date( today.getFullYear(), today.getMonth(), today.getDate() + parseInt( datemin, 10 ) ) : today;
		var daymax = eval( "form0.tornossearch_" + s[idx] + "_Max_Pattern" ).value == "DateAdd" ? new Date( today.getFullYear(), today.getMonth(), today.getDate() + parseInt( datemax, 10 ) ) : new Date( today.getFullYear() + 1, today.getMonth(), today.getDate() );
		var daydef = eval( "form0.tornossearch_" + s[idx] + "_Def_Pattern" ).value == "DateAdd" ? new Date( today.getFullYear(), today.getMonth(), today.getDate() + parseInt( datedef, 10 ) ) : daymin;
		
		if ( eval( "form0.tornossearch_" + s[idx] + "_Min_Pattern" ).value == "YYYYMMDD" )
			daymin = new Date( parseInt( datemin.substr( 0, 4 ), 10 ), parseInt( datemin.substr( 4, 2 ), 10 ) - 1, parseInt( datemin.substr( 6, 2 ), 10 ) );
		var day1 = yyyymmdd1 == "" ? today : new Date( parseInt( yyyymmdd1.substr( 0, 4 ), 10 ), parseInt( yyyymmdd1.substr( 4, 2 ), 10 ) - 1, parseInt( yyyymmdd1.substr( 6, 2 ), 10 ) );
		if ( idx == 1 && day1.getTime() >= daymin.getTime() )
		{
			//daymin = new Date( parseInt( yyyymmdd1.substr( 0, 4 ), 10 ), parseInt( yyyymmdd1.substr( 4, 2 ), 10 ) - 1, parseInt( yyyymmdd1.substr( 6, 2 ), 10 ) + 1 );
			daymin = new Date( parseInt( yyyymmdd1.substr( 0, 4 ), 10 ), parseInt( yyyymmdd1.substr( 4, 2 ), 10 ) - 1, parseInt( yyyymmdd1.substr( 6, 2 ), 10 ) );
		}
		if ( eval( "form0.tornossearch_" + s[idx] + "_Max_Pattern" ).value == "YYYYMMDD" )
			daymax = new Date( parseInt( datemax.substr( 0, 4 ), 10 ), parseInt( datemax.substr( 4, 2 ), 10 ) - 1, parseInt( datemax.substr( 6, 2 ), 10 ) );
		
		//var datenow = 0;
		//var daynow  = today;
		var daynow  = daydef;
		var datenow = daysBetween( today, daynow );
		if ( yyyymm2 != "" && dd2 != "" )
		{
			daynow = new Date( parseInt( yyyymm2.substr( 0, 4 ), 10 ), parseInt( yyyymm2.substr( 4, 2 ), 10 ) - 1, parseInt( dd2, 10 ) );
			datenow = daysBetween( today, daynow );
		}
		
		pim[idx].length = 0;
		for ( var i = 0; i < Math.ceil( parseInt( daysBetween( today, daymax ), 10 ) / 30 ) ; i++ )
		{
			var d = ( i == 0 ) ? daymin.getDate() : 1;
			var newDate = new Date( daymin.getFullYear(), daymin.getMonth() + i, d );
			var yyyymm = newDate.getFullYear() * 100 + newDate.getMonth() + 1;
			var yyyymm_now = datenow == 0 ? "" : daynow.getFullYear() * 100 + daynow.getMonth() + 1;
			var stryyyymm = yyyymm.toString().substr(0,4) + "年" + yyyymm.toString().substr(4,2) + "月";
			
			if ( newDate >= daymin && newDate <= daymax )
			{
				if ( yyyymm == yyyymm_now )
				{
					pim[idx][pim[idx].length] = new Option(stryyyymm, yyyymm, true, true);
					pim[idx].selectedIndex = pim[idx].length - 1;
				}
				else
					pim[idx][pim[idx].length] = new Option(stryyyymm, yyyymm, false, false);
			}
		}
		yyyymm2 = pim[idx][pim[idx].selectedIndex].value;
		
		pid[idx].length = 0;
		var y = parseInt( yyyymm2.substr( 0, 4 ), 10 );
		var m = parseInt( yyyymm2.substr( 4, 2 ), 10 );
		var days = getDays( y, m );
		var d_now = datenow == "" ? 0 : daynow.getDate();
		for ( var i = 1; i <= days ; i++ )
		{
			var newDate = new Date( y, m - 1, i );
			var dd = i < 10 ? "0" + i : i;
			if ( newDate >= daymin && newDate <= daymax )
			{
				if (i == d_now )
				{
					pid[idx][pid[idx].length] = new Option(i.toString()+"日("+yobi[newDate.getDay()]+")", dd, true, true);
					pid[idx].selectedIndex = pid[idx].length - 1;
				}
				else
				{
					pid[idx][pid[idx].length] = new Option(i.toString()+"日("+yobi[newDate.getDay()]+")", dd, false, false);
				}
			}
		}
		//if ( idx == 1 && flg == "true" ) pid[idx].selectedIndex = 0;
	}
	function SetCalendar_tr( f1, f2, fm1, fm2, b1, b2, pad, ym, dd )
	{
		var pim = eval( "form0." + fm1 );
		var pid = eval( "form0." + fm2 );
		for ( var i = 0; i < pim.length; i++ )
		{
			if ( pim[i].value == ym )
			{
				pim.selectedIndex = i;
				break;
			}
		}
		tornossearch_onChangePid(b1);
		for ( var i = 0; i < pid.length; i++ )
		{
			if ( parseInt( pid[i].value, 10 ) == dd )
			{
				pid.selectedIndex = i;
				break;
			}
		}
		tornossearch_onChangePid(b1);
	}
	function GetDaysFromToday_tr( nm )
	{
		var pat = eval( "form0.tornossearch_" + nm + "_Pattern" ).value;
		var val = eval( "form0.tornossearch_" + nm + "_Value" ).value;
		if ( pat == "DateAdd" )
		{
			return val;
		}
		else
		{
			var today = new Date();
			return daysBetween( today, getNewDate( val ) );
		}
	}

// ----------------------------------------------
// fithotel-tr
// ----------------------------------------------
	function tornoshotel_Init()
	{
		form0 = document.fithotelTrForm;
		tornoshotel_SetConfig();
	}
	function tornoshotel_SetConfig()
	{
		xDoc1 = null;
		var ajax = new Ajax.Request(xmlpath2 + "Config.xml",
			{
				method: "get",
				onSuccess: function(httpObj) {
					try {
						xDoc1 = httpObj.responseXML;
						var Config = xDoc1.getElementsByTagName("Config");

						var link = Config[0].getElementsByTagName("link");
						var cid0 = Config[0].getElementsByTagName("cid");
						var cty0 = Config[0].getElementsByTagName("Default_CityCode");
						var cin0 = Config[0].getElementsByTagName("CheckIn");
						var lgn0 = Config[0].getElementsByTagName("LodgeNum");
						var rmn0 = Config[0].getElementsByTagName("Room_Num");
						var adn0 = Config[0].getElementsByTagName("Adult_Num");
						var cdn0 = Config[0].getElementsByTagName("Child_Num");
						
						if ( form0.pickupCityFlag.value == "1" )
						{
							var areainfo = Config[0].getElementsByTagName("AreaInfo");
							var area = areainfo[0].getElementsByTagName("Area");
							for ( var i = 0; i < area.length; i++ )
							{
								$("areaname"+i).innerHTML = area[i].getAttribute("value");
								var city = area[i].getElementsByTagName("City");
								for ( var j = 0; j < city.length; j++ )
								{
									$("city"+i+j).value = city[j].getAttribute("CityCode");
									$("label"+i+j).innerHTML = city[j].firstChild.nodeValue;
								}
							}
						}

						// デフォルト値セット
						if (link.length > 0)
							form0.tornoshotel_link.value = link[0].firstChild.nodeValue;
						if (cid0.length > 0) {
							// 2010/03/17 Modify Author:Sakaki
							// 
							// http://www.jtb.co.jp/ の場合は、タグは「JTB_TOP」
							// http://www.jtb.co.jp/kaigai/htl/ の場合は、タグは「OVS_TOP」
							// 
							// 井上さんが不在なので、さかきが修正
							// 
							// 2010/03/17 Modify Author:Sakaki
							if (location.href.indexOf("/kaigai/htl") == -1) {
								var top0 = cid0[0].getElementsByTagName("JTB_TOP");
							} else {
								var top0 = cid0[0].getElementsByTagName("OVS_TOP");
							}
							if (top0.length > 0)
								form0.tornoshotel_cid.value = top0[0].firstChild.nodeValue;
						}
						if (cty0.length > 0) {
							var area0 = cty0[0].getElementsByTagName("AreaCode");
							if (area0.length > 0)
								form0.tornoshotel_AreaCode.value = area0[0].firstChild.nodeValue;
							var ctry0 = cty0[0].getElementsByTagName("CountryCode");
							if (ctry0.length > 0)
								form0.tornoshotel_CountryCode.value = ctry0[0].firstChild.nodeValue;
							var city0 = cty0[0].getElementsByTagName("CityCode");
							if (city0.length > 0)
								form0.tornoshotel_CityCode.value = city0[0].firstChild.nodeValue;
						}
						var pat0 = Config[0].getElementsByTagName("Default_SearchPattern");
						if (pat0.length > 0)
							form0.tornoshotel_SearchPattern.value = pat0[0].firstChild.nodeValue;
						if (cid0.length > 0) {
							var cin1 = cin0[0].getElementsByTagName("Min");
							if (cin1.length > 0) {
								form0.tornoshotel_CheckIn_Min_Pattern.value = cin1[0].getAttribute("Pattern");
								form0.tornoshotel_CheckIn_Min_Value.value = cin1[0].firstChild.nodeValue;
							}
							var cin2 = cin0[0].getElementsByTagName("Max");
							if (cin2.length > 0) {
								form0.tornoshotel_CheckIn_Max_Pattern.value = cin2[0].getAttribute("Pattern");
								form0.tornoshotel_CheckIn_Max_Value.value = cin2[0].firstChild.nodeValue;
							}
							var cin3 = cin0[0].getElementsByTagName("Default");
							if (cin3.length > 0) {
								form0.tornoshotel_CheckIn_Def_Pattern.value = cin3[0].getAttribute("Pattern");
								form0.tornoshotel_CheckIn_Def_Value.value = cin3[0].firstChild.nodeValue;
							}
						}
						if (lgn0.length > 0) {
							var lgn1 = lgn0[0].getElementsByTagName("Min");
							if (lgn1.length > 0) {
								form0.tornoshotel_LodgeNum_Min.value = lgn1[0].firstChild.nodeValue;
							}
							var lgn2 = lgn0[0].getElementsByTagName("Max");
							if (lgn2.length > 0) {
								form0.tornoshotel_LodgeNum_Max.value = lgn2[0].firstChild.nodeValue;
							}
							var lgn3 = lgn0[0].getElementsByTagName("Default");
							if (lgn3.length > 0) {
								form0.tornoshotel_LodgeNum_Def.value = lgn3[0].firstChild.nodeValue;
							}
						}
						if (rmn0.length > 0) {
							var rmn1 = rmn0[0].getElementsByTagName("Min");
							if (rmn1.length > 0) {
								form0.tornoshotel_RoomNum_Min.value = rmn1[0].firstChild.nodeValue;
							}
							var rmn2 = rmn0[0].getElementsByTagName("Max");
							if (rmn2.length > 0) {
								form0.tornoshotel_RoomNum_Max.value = rmn2[0].firstChild.nodeValue;
							}
							var rmn3 = rmn0[0].getElementsByTagName("Default");
							if (rmn3.length > 0) {
								form0.tornoshotel_RoomNum_Def.value = rmn3[0].firstChild.nodeValue;
							}
						}
						if (adn0.length > 0) {
							var adn1 = adn0[0].getElementsByTagName("Min");
							if (adn1.length > 0) {
								form0.tornoshotel_AdultNum_Min.value = adn1[0].firstChild.nodeValue;
							}
							var adn2 = adn0[0].getElementsByTagName("Max");
							if (adn2.length > 0) {
								form0.tornoshotel_AdultNum_Max.value = adn2[0].firstChild.nodeValue;
							}
							var adn3 = adn0[0].getElementsByTagName("Default");
							if (adn3.length > 0) {
								form0.tornoshotel_AdultNum_Def.value = adn3[0].firstChild.nodeValue;
							}
						}
						if (cdn0.length > 0) {
							var cdn1 = cdn0[0].getElementsByTagName("Min");
							if (cdn1.length > 0) {
								form0.tornoshotel_ChildNum_Min.value = cdn1[0].firstChild.nodeValue;
							}
							var cdn2 = cdn0[0].getElementsByTagName("Max");
							if (cdn2.length > 0) {
								form0.tornoshotel_ChildNum_Max.value = cdn2[0].firstChild.nodeValue;
							}
							var cdn3 = cdn0[0].getElementsByTagName("Default");
							if (cdn3.length > 0) {
								form0.tornoshotel_ChildNum_Def.value = cdn3[0].firstChild.nodeValue;
							}
						}

						// 各フォームセット
						form0.tornoshotel_cal.value = $("tornoshotel_cal").href;
						tornoshotel_SetArea(form0.to0area);
						form0.search_avail_flg.checked = form0.tornoshotel_SearchPattern.value == "0" ? false : true;
						tornoshotel_onClickFlg();
						tornoshotel_SetPID();

						form0.sn.length = 0;
						for (var i = parseInt(form0.tornoshotel_LodgeNum_Min.value, 10); i <= parseInt(form0.tornoshotel_LodgeNum_Max.value, 10); i++) {
							if (i == parseInt(form0.tornoshotel_LodgeNum_Def.value, 10))
								form0.sn[form0.sn.length] = new Option(i + "泊", i, true, true);
							else
								form0.sn[form0.sn.length] = new Option(i + "泊", i, false, false);
						}
						form0.room.length = 0;
						for (var i = parseInt(form0.tornoshotel_RoomNum_Min.value, 10); i <= parseInt(form0.tornoshotel_RoomNum_Max.value, 10); i++) {
							if (i == parseInt(form0.tornoshotel_RoomNum_Def.value, 10))
								form0.room[form0.room.length] = new Option(i + "室", i, true, true);
							else
								form0.room[form0.room.length] = new Option(i + "室", i, false, false);
							var adult = eval("form0.adult" + i);
							adult.length = 0;
							for (var j = parseInt(form0.tornoshotel_AdultNum_Min.value, 10); j <= parseInt(form0.tornoshotel_AdultNum_Max.value, 10); j++) {
								if (j == parseInt(form0.tornoshotel_AdultNum_Def.value, 10))
								{
									adult[adult.length] = new Option(j + "名", j, true, true);
								}
								else
									adult[adult.length] = new Option(j + "名", j, false, false);
							}
							adult.selectedIndex = parseInt(form0.tornoshotel_AdultNum_Def.value, 10) - 1;
							var child = eval("form0.child" + i);
							child.length = 0;
							for (var j = parseInt(form0.tornoshotel_ChildNum_Min.value, 10); j <= parseInt(form0.tornoshotel_ChildNum_Max.value, 10); j++) {
								if (j == parseInt(form0.tornoshotel_ChildNum_Def.value, 10))
									child[child.length] = new Option(j + "名", j, true, true);
								else
									child[child.length] = new Option(j + "名", j, false, false);
							}
						}
						tornoshotel_onChangeRoom(form0.room[form0.room.selectedIndex].value);

						var tornos = "http://";
						switch (location.hostname) {
							case "st-www.jtb.co.jp":
								tornos += "202.143.76.218";
								break;
							default:
								tornos += "www.tornos.jp";
								break;
						}
						document.tornoshotelForm.action = tornos + "/fr/DFR01HTL11V00_GetHtlUrl.do?cm=getHtlUrl";
					}
					catch (e) {
						alert(e.Message);
					}
				},
				onFailure: function() {
					alert("onFailure@Config.xml");
				}
			}
		);
	}
	function tornoshotel_SetArea( elm )
	{
		elm.length = 0;
		xDoc3 = null;
		var ajax = new Ajax.Request( xmlpath2 + "Area.xml",
			{
				method: "get",
				onSuccess: function( httpObj )
				{
					try
					{
						xDoc3 = httpObj.responseXML;
						var area = xDoc3.getElementsByTagName( "Area" );
						for ( var i = 0; i < area.length; i++ )
						{
							elm[elm.length] = new Option( area[i].firstChild.nodeValue, area[i].getAttribute("AreaCode"), false, false );
							elm[elm.length-1].title = area[i].firstChild.nodeValue;
							elm[elm.length-1].onmouseover = function(){ new Tooltip( elm[elm.length-1] ); };
						}
						if ( form0.tornoshotel_CityCode.value != "" )
						{
							xDoc8 = null;
							var ajax2 = new Ajax.Request( xmlpath2 + "City.xml",
								{
									method: "get",
									onSuccess: function( httpObj )
									{
										try
										{
											xDoc8 = httpObj.responseXML;
											var country = xDoc8.getElementsByTagName( "Country" );
											var countrycode = "";
											for ( var i = 0; i < country.length; i++ )
											{
												var city = country[i].getElementsByTagName( "City" );
												for ( var j = 0; j < city.length; j++ )
												{
													if ( city[j].getAttribute("CityCode") == form0.tornoshotel_CityCode.value )
													{
														countrycode = country[i].getAttribute("CountryCode");
														break;
													}
												}
												if ( countrycode != "" ) break;
											}
											form0.tornoshotel_CountryCode.value = countrycode;
											if ( countrycode != "" )
											{
												xDoc9 = null;
												var ajax3 = new Ajax.Request( xmlpath2 + "Country.xml",
													{
														method: "get",
														onSuccess: function( httpObj )
														{
															try
															{
																xDoc9 = httpObj.responseXML;
																var area = xDoc9.getElementsByTagName( "Area" );
																var areacode = "";
																for ( var i = 0; i < area.length; i++ )
																{
																	country = area[i].getElementsByTagName( "Country" );
																	for ( var j = 0; j < country.length; j++ )
																	{
																		if ( country[j].getAttribute("CountryCode") == form0.tornoshotel_CountryCode.value )
																		{
																			areacode = area[i].getAttribute("AreaCode");
																			break;
																		}
																	}
																	if ( areacode != "" ) break;
																}
																
																for ( var i = 0; i < elm.length; i++ )
																	if ( elm[i].value == areacode ) elm.selectedIndex = i;
																tornoshotel_onChangeArea( areacode );
															}
															catch(e)
															{
																alert(e);
															}
														},
														onFailure: function()
														{
															alert("onFailure@Country.xml");
														}
													}
												);
											}
										}
										catch(e)
										{
											alert(e);
										}
									},
									onFailure: function()
									{
										alert("onFailure@City.xml");
									}
								}
							);
						}
					}
					catch(e)
					{
						alert(e);
					}
				},
				onFailure: function()
				{
					alert("onFailure@Area.xml");
				}
			}
		);
	}
	function tornoshotel_onChangeArea( areacode )
	{
		form0.tornoshotel_AreaCode.value = areacode;
		var to0country = form0.to0country;
		to0country.length = 0;
		xDoc4 = null;
		if ( areacode != "" )
			var ajax = new Ajax.Request( xmlpath2 + "Country.xml",
				{
					method: "get",
					onSuccess: function( httpObj )
					{
						try
						{
							xDoc4 = httpObj.responseXML;
							var area = xDoc4.getElementsByTagName( "Area" );
							for ( var i = 0; i < area.length; i++ )
							{
								if ( areacode == area[i].getAttribute("AreaCode") )
								{
									var country = area[i].getElementsByTagName( "Country" );
									for ( var j = 0; j < country.length; j++ )
									{
										to0country[to0country.length] = new Option( country[j].firstChild.nodeValue, country[j].getAttribute("CountryCode"), false, false );
										to0country[to0country.length-1].title = country[j].firstChild.nodeValue;
										to0country[to0country.length-1].onmouseover = function(){ new Tooltip( elm[elm.length-1] ); };
										if ( country[j].getAttribute("CountryCode") == form0.tornoshotel_CountryCode.value ) to0country.selectedIndex = to0country.length - 1;
									}
								}
								
							}
							tornoshotel_onChangeCountry( to0country[to0country.selectedIndex].value );
						}
						catch(e)
						{
							alert(e);
						}
					},
					onFailure: function()
					{
						alert("onFailure@Country.xml");
					}
				}
			);
	}
	function tornoshotel_onChangeCountry( countrycode )
	{
		form0.tornoshotel_CountryCode.value = countrycode;
		var to0 = form0.to0;
		to0.length = 0;
		xDoc5 = null;
		if ( countrycode != "" )
			var ajax = new Ajax.Request( xmlpath2 + "City.xml",
				{
					method: "get",
					onSuccess: function( httpObj )
					{
						try
						{
							xDoc5 = httpObj.responseXML;
							var country = xDoc5.getElementsByTagName( "Country" );
							for ( var i = 0; i < country.length; i++ )
							{
								if ( countrycode == country[i].getAttribute("CountryCode") )
								{
									var city = country[i].getElementsByTagName( "City" );
									for ( var j = 0; j < city.length; j++ )
									{
										to0[to0.length] = new Option( city[j].firstChild.nodeValue, city[j].getAttribute("CityCode"), false, false );
										to0[to0.length-1].title = city[j].firstChild.nodeValue;
										to0[to0.length-1].onmouseover = function(){ new Tooltip( elm[elm.length-1] ); };
										if ( city[j].getAttribute("CityCode") == form0.tornoshotel_CityCode.value ) to0.selectedIndex = to0.length - 1;
									}
								}
							}
							tornoshotel_onChangeCity( to0[to0.selectedIndex].value )
						}
						catch(e)
						{
							alert(e);
						}
					},
					onFailure: function()
					{
						alert("onFailure@City.xml");
					}
				}
			);
	}
	function tornoshotel_onChangeCity( citycode )
	{
		form0.tornoshotel_CityCode.value = citycode;
	}
	function tornoshotel_onChangeRoom(rm)
	{
		switch (rm) {
			case "4":
				$("room1").style.display = "block";
				$("room2").style.display = "block";
				$("room3").style.display = "block";
				$("room4").style.display = "block";
				break;
			case "3":
				$("room1").style.display = "block";
				$("room2").style.display = "block";
				$("room3").style.display = "block";
				$("room4").style.display = "none";
				break;
			case "2":
				$("room1").style.display = "block";
				$("room2").style.display = "block";
				$("room3").style.display = "none";
				$("room4").style.display = "none";
				break;
			default:
				$("room1").style.display = "block";
				$("room2").style.display = "none";
				$("room3").style.display = "none";
				$("room4").style.display = "none";
				break;
		}
	}
	function tornoshotel_onSubmit( form )
	{
		var f = document.tornoshotelForm;
		f.search_avail_flg.value = "0";
		if (form0.search_avail_flg.checked) {
			f.search_avail_flg.value = "1";
			f.check_in_date.value = form.pim[form.pim.selectedIndex].value + form.pid[form.pid.selectedIndex].value;
			f.lodgeNum.value = form.sn[form.sn.selectedIndex].value;
			var rm = form.room[form.room.selectedIndex].value;
			f.room_num.value = rm;
			switch (rm) {
				case "4":
					f.adl_num_rm3.value = form.adult4[form.adult4.selectedIndex].value;
					f.chd_num_rm3.value = form.child4[form.child4.selectedIndex].value;
				case "3":
					f.adl_num_rm2.value = form.adult3[form.adult3.selectedIndex].value;
					f.chd_num_rm2.value = form.child3[form.child3.selectedIndex].value;
				case "2":
					f.adl_num_rm1.value = form.adult2[form.adult2.selectedIndex].value;
					f.chd_num_rm1.value = form.child2[form.child2.selectedIndex].value;
				default:
					f.adl_num_rm0.value = form.adult1[form.adult1.selectedIndex].value;
					f.chd_num_rm0.value = form.child1[form.child1.selectedIndex].value;
			}
		}
		if ( form.pickupCityFlag.value == "1" ) tornoshotel_setPickupCity(form);
		f.city.value = form.pickupCity.value == "" ? form.to0[form.to0.selectedIndex].value : form.pickupCity.value;
		f.cid.value = form.tornoshotel_cid.value;
		f.link.value = form.tornoshotel_link.value;
		f.submit();
	}

	function tornoshotel_SetPID()
	{
		tornoshotel_setPID1("fithotelTrForm", "fithotelTrForm2", "pim", "pid", "false", "false", "0");
	}
	function tornoshotel_onChangePid(pid) {
		document.fithotelTrForm2.pid.value = pid;
	}
	function tornoshotel_setPID1(f1, f2, fm1, fm2, b1, b2, pad)
	{
		var pim = eval("document." + f1 + "." + fm1);
		var pid = eval("document." + f1 + "." + fm2);
		pid.length = 0;
		if (pim.length >= 0 && pim.selectedIndex >= 0) eval("document." + f2 + ".pim").value = pim[pim.selectedIndex].value;
		if (pid.length >= 0 && pid.selectedIndex >= 0) eval("document." + f2 + ".pid").value = pid[pid.selectedIndex].value;
		var yyyymm2 = eval("document." + f2 + ".pim").value;
		var dd2 = eval("document." + f2 + ".pid").value;

		var yobi = new Array("日", "月", "火", "水", "木", "金", "土");
		var today = new Date();
		var datemin = eval("document." + f2 + ".datemin").value;
		datemin = datemin == "" ? form0.tornoshotel_CheckIn_Min_Value.value : datemin;
		var datemax = eval("document." + f2 + ".datemax").value;
		datemax = datemax == "" ? form0.tornoshotel_CheckIn_Max_Value.value : datemax;
		var daymin = form0.tornoshotel_CheckIn_Min_Pattern.value == "DateAdd" ? new Date(today.getFullYear(), today.getMonth(), today.getDate() + parseInt(datemin, 10)) : today;
		var daymax = form0.tornoshotel_CheckIn_Max_Pattern.value == "DateAdd" ? new Date(today.getFullYear(), today.getMonth(), today.getDate() + parseInt(datemax, 10)) : new Date(Date.parse(datemax.toString().substr(0, 4) + "/" + datemax.toString().substr(4, 2) + "/" + datemax.toString().substr(6, 2)));
		var datenow;
		var daynow;
		if (yyyymm2 != "" && dd2 != "") {
			//daynow = new Date(parseInt(yyyymm2.substr(0, 4), 10), parseInt(yyyymm2.substr(4, 2), 10) - 1, parseInt(dd2, 10));
			daynow = new Date(parseInt(yyyymm2.substr(0, 4), 10), parseInt(yyyymm2.substr(4, 2), 10) - 1, 1);
			datenow = daysBetween(today, daynow);
		}
		else {
			try {
				datenow = eval("document." + f2 + ".datenow").value;
				datenow = datenow == "" ? form0.tornoshotel_CheckIn_Def_Value.value : datenow;
				daynow = form0.tornoshotel_CheckIn_Def_Pattern.value == "DateAdd" ? new Date(today.getFullYear(), today.getMonth(), today.getDate() + parseInt(datenow, 10)) : new Date(Date.parse(datenow.toString().substr(0, 4) + "/" + datenow.toString().substr(4, 2) + "/" + datenow.toString().substr(6, 2)));
			}
			catch (e) {
				datenow = "";
				daynow = "";
			}
		}
		//eval("document." + f2 + ".datenow").value = "";
		eval("document." + f2 + ".datenow").value = datenow;

		//if ( yyyymm2 == "" )
		{
			pim.length = 0;
			if (eval(b1)) pim[pim.length] = new Option("指定なし", "", true, true);
			for (var i = 0; i <= (daymax.getYear() * 100 + daymax.getMonth()) - (daymin.getYear() * 100 + daymin.getMonth()); i++) {
				var d = (i == 0) ? daymin.getDate() : 1;
				var newDate = new Date(daymin.getFullYear(), daymin.getMonth() + i, d);
				var yyyymm = newDate.getFullYear() * 100 + newDate.getMonth() + 1;
				var yyyymm_now = datenow == "" ? "" : daynow.getFullYear() * 100 + daynow.getMonth() + 1;
				var stryyyymm = yyyymm.toString().substr(0, 4) + "年" + yyyymm.toString().substr(4, 2) + "月";

				if (newDate >= daymin && newDate <= daymax) {
					if (yyyymm == eval("document." + f2 + ".pim").value || yyyymm == yyyymm_now) {
						pim[pim.length] = new Option(stryyyymm, yyyymm, true, true);
						pim.selectedIndex = pim.length - 1;
					}
					else
						pim[pim.length] = new Option(stryyyymm, yyyymm, false, false);
				}
			}
			eval("document." + f2 + ".pim").value = pim[pim.selectedIndex].value;
			yyyymm2 = eval("document." + f2 + ".pim").value;
		}
		pid.length = 0;
		if (yyyymm2 == "") {
			pid[pid.length] = new Option("指定なし", "", true, true);
			pid.selectedIndex = 0;
		}
		else {
			var y = parseInt(yyyymm2.substr(0, 4), 10);
			var m = parseInt(yyyymm2.substr(4, 2), 10);
			var days = getDays(y, m);
			for (var i = 1; i <= days; i++) {
				var newDate = new Date(y, m - 1, i);
				var dd = i < 10 ? pad + i : i;
				var d_now = datenow == "" ? 0 : daynow.getDate();
				if (newDate >= daymin && newDate <= daymax) {
					if (i == d_now) {
						pid[pid.length] = new Option(i.toString() + "日(" + yobi[newDate.getDay()] + ")", dd, true, true);
						pid.selectedIndex = pid.length - 1;
					}
					else {
						pid[pid.length] = new Option(i.toString() + "日(" + yobi[newDate.getDay()] + ")", dd, false, false);
					}
				}
			}
			eval("document." + f2 + ".pid").value = pid[pid.selectedIndex].value;
		}
	}
	function tornoshotel_onClickFlg() {
		if (form0.search_avail_flg.checked) {
			form0.pim.disabled = "";
			form0.pid.disabled = "";
			form0.sn.disabled = "";
			form0.room.disabled = "";
			form0.adult1.disabled = "";
			form0.child1.disabled = "";
			$("tornoshotel_cal").href = form0.tornoshotel_cal.value;

		}
		else {
			form0.room.selectedIndex = 0;
			tornoshotel_onChangeRoom("1");
			form0.pim.disabled = "disabled";
			form0.pid.disabled = "disabled";
			form0.sn.disabled = "disabled";
			form0.room.disabled = "disabled";
			form0.adult1.disabled = "disabled";
			form0.child1.disabled = "disabled";
			$("tornoshotel_cal").removeAttribute("href");
		}
	}
	function tornoshotel_setPickupCity(form)
	{
		for ( var i = 0; i < form.pcity.length; i++ )
		{
			if ( form.pcity[i].checked )
			{
				form.pickupCity.value = form.pcity[i].value;
				break;
			}
		}
	}
	function tornoshotel_showOtherArea(flag)
	{
		$( "otherarea" ).style.display = flag ? "block" : "none";
	}

//追加//
function overShozai(elem){
   if(document.getElementById) {
var obj = document.getElementById(elem);
if(obj) {
            obj.src = obj.src.replace("_top.gif","_top_on.gif") ;
         }
}
}

function outShozai(elem){
   if(document.getElementById) {
var obj = document.getElementById(elem);
if(obj) {
            obj.src = obj.src.replace("_top_on.gif","_top.gif") ;
         }
}
}

function setShozaiBtn(elem1,elem2,elem3,elem4,elem5) {
   if(document.getElementById) {
         var obj1 = document.getElementById(elem1);
         var obj2 = document.getElementById(elem2);
         var obj3 = document.getElementById(elem3);
         var obj4 = document.getElementById(elem4);
         var obj5 = document.getElementById(elem5);
         if(obj1) {
            obj1.src = obj1.src.replace("_top_on.gif","_top_stay.gif") ;
         }
         if(obj2) {
            obj2.src = obj2.src.replace("_top_stay.gif","_top.gif") ;
         }
         if(obj3) {
            obj3.src = obj3.src.replace("_top_stay.gif","_top.gif") ;
         }
         if(obj4) {
            obj4.src = obj4.src.replace("_top_stay.gif","_top.gif") ;
         }
         if(obj5) {
            obj5.src = obj5.src.replace("_top_stay.gif","_top.gif") ;
         }
   }
}



