	var xDoc;
	var country_cd;
	var country_name_jpn;
	var city_cd;
	var city_name_jpn;
	function index_pkg_onLoad()
	{
		if ( document.searchForm2.destareacd.value != "" )
			index_pkg_onChangeArea( document.searchForm2.destareacd.value );
//		else
//				index_pkg_onChangeArea( document.searchForm.destareacd[document.searchForm.destareacd.selectedIndex].value );
		
		index_pkg_SetCityCk();
	}
	function index_pkg_onChangeArea( area )
	{
		document.searchForm2.destareacd.value = area;
		document.searchForm.destcitycd.length = 0;
		document.searchForm.destcitycd[document.searchForm.destcitycd.length] = new Option( "都市を指定", "", true, true );
		document.searchForm.destcountrycd.length = 0;
		document.searchForm.destcountrycd[document.searchForm.destcountrycd.length] = new Option( "国（地域）を指定", "", true, true );
		var ajax = new Ajax.Request( "/toppageparts/LOOK/" + area + ".xml",
			{
				method: "get",
				onComplete: function( httpObj )
				{
					xDoc = httpObj.responseXML;
					country_cd       = xDoc.getElementsByTagName( "COUNTRY_CD" );
					country_name_jpn = xDoc.getElementsByTagName( "COUNTRY_NAME_JPN" );
					for ( var i = 0; i < country_cd.length; i++ )
					{
						if ( country_cd[i].childNodes.length > 0 )
							if ( document.searchForm.destcountrycd[document.searchForm.destcountrycd.length-1].value != country_cd[i].firstChild.nodeValue )
								if ( country_cd[i].firstChild.nodeValue == document.searchForm2.destcountrycd.value )
									document.searchForm.destcountrycd[document.searchForm.destcountrycd.length] = new Option( country_name_jpn[i].firstChild.nodeValue, country_cd[i].firstChild.nodeValue, true, true );
								else
									document.searchForm.destcountrycd[document.searchForm.destcountrycd.length] = new Option( country_name_jpn[i].firstChild.nodeValue, country_cd[i].firstChild.nodeValue, false, false );
					}
					if ( document.searchForm.destcountrycd.selectedIndex > 0 )
						index_pkg_onChangeCountry( document.searchForm.destcountrycd[document.searchForm.destcountrycd.selectedIndex].value );
				}
			}
		);
	}
	function index_pkg_onChangeCountry( country )
	{
		document.searchForm2.destcountrycd.value = country;
		document.searchForm.destcitycd.length = 0;
		document.searchForm.destcitycd[document.searchForm.destcitycd.length] = new Option( "都市を指定", "", true, true );
		
		city_cd       = xDoc.getElementsByTagName( "CITY_CD" );
		city_name_jpn = xDoc.getElementsByTagName( "CITY_NAME_JPN" );
		
		for (var i = 0; i < city_cd.length; i++)
		{
			if ( city_cd[i].childNodes.length > 0 && country_cd[i].firstChild.nodeValue == country )
				if ( document.searchForm.destcitycd[document.searchForm.destcitycd.length-1].value != city_cd[i].firstChild.nodeValue )
					if ( city_cd[i].firstChild.nodeValue == document.searchForm2.destcitycd.value )
						document.searchForm.destcitycd[document.searchForm.destcitycd.length] = new Option( city_name_jpn[i].firstChild.nodeValue, city_cd[i].firstChild.nodeValue, true, true );
					else
						document.searchForm.destcitycd[document.searchForm.destcitycd.length] = new Option( city_name_jpn[i].firstChild.nodeValue, city_cd[i].firstChild.nodeValue, false, false );
		}
		index_pkg_SetCityCk();
	}
	function index_pkg_onChangeCity( city )
	{
		document.searchForm2.destcitycd.value = city;
		index_pkg_SetCityCk();
	}
	function index_pkg_SetCityCk()
	{
		if ( document.searchForm.destcitycd.selectedIndex == 0 )
		{
			document.searchForm.cityck.disabled = "disabled";
			document.getElementById("labelcityck").style.color = "gray";
		}
		else
		{
			document.searchForm.cityck.disabled = null;
			document.getElementById("labelcityck").style.color = "black";
		}
	}
	function index_pkg_SetMinMax( elem1, idx1, elem2, idx2 )
	{
		if ( idx1 * idx2 > 0 )
		{
			elem1.selectedIndex = idx1 > idx2 ? idx2 : idx1;
			elem2.selectedIndex = idx1 > idx2 ? idx1 : idx2;
		}
	}
	function index_pkg_SetMinMax2( elem1, idx1, elem2, idx2, minmax )
	{
		if ( idx1 * idx2 > 0 )
		{
			if ( minmax == 0 )
				elem2.selectedIndex = idx1 > idx2 ? idx1 : idx2;
			if ( minmax == 1 )
				elem1.selectedIndex = idx1 > idx2 ? idx2 : idx1;
		}
	}


// 2010/03/03 H.INOUE 出発日追加
	function index_pkg_onChangePim()
	{
		setPID( "searchForm", "searchForm2", "deptyearmon", "deptdate", "true", "true", "0" );
	}
	function index_pkg_onChangePid( pid )
	{
		document.searchForm2.pid.value = pid;
	}

