//var baseURL = "http://www.hankyu-travel.com/tour/search_d.php?p_hatsu=104&p_sdp=3&p_bunrui=814,030";
var baseURL = "http://www.hankyu-travel.com/tour/search_d.php?p_hei=10&p_sdp=3&p_bunrui=814&p_bunrui=030";
country_array = [

//指定しない
[["指定しない",""]],

//北海道
[["北海道全域","&p_dest=10"],
["北海道","&p_prefecture=01"]],

//東北
[["東北全域","&p_dest=11"],
["青森県","&p_prefecture=02"],
["秋田県","&p_prefecture=05"],
["岩手県","&p_prefecture=03"],
["宮城県","&p_prefecture=04"],
["山形県","&p_prefecture=06"],
["福島県","&p_prefecture=07"]],

//関東・伊豆・箱根
[["関東全域","&p_prefecture=10,09,08,11,13,12,14,19,22"],
["群馬県","&p_prefecture=10"],
["栃木県","&p_prefecture=09"],
//["茨城県","&p_prefecture=08"],
["千葉県","&p_prefecture=12"],
["山梨県","&p_prefecture=19"],
["伊豆・箱根","&p_prefecture=22,14"]],

//中部・北陸
[["中部・北陸全域","&p_prefecture=22,20,15,21,17,16,18"],
["静岡県","&p_prefecture=22"],
["長野県","&p_prefecture=20"],
["新潟県","&p_prefecture=15"],
["岐阜県","&p_prefecture=21"],
["石川県","&p_prefecture=17"],
["富山県","&p_prefecture=16"],
["福井県","&p_prefecture=18"]],
//["愛知県","&p_prefecture=23"],

//近畿・南紀・伊勢
[["近畿・南紀・伊勢全域","&p_prefecture=27,26,28,25,24,30"],
["大阪府","&p_prefecture=27"],
["京都府","&p_prefecture=26"],
["兵庫県","&p_prefecture=28"],
//["滋賀県","&p_prefecture=25"],
["三重県","&p_prefecture=24"],
["和歌山県","&p_prefecture=30"]],

//山陰・山陽・四国
[["山陰山陽四国全域","&p_dest=17&p_dest=18"],
["山陰山陽全域","&p_prefecture=31,32,33,34,35"],
["広島県","&p_prefecture=34"],
["岡山県","&p_prefecture=33"],
["島根県","&p_prefecture=32"],
["鳥取県","&p_prefecture=31"],
["山口県","&p_prefecture=35"],
["四国全域","&p_prefecture=36,37,38,39"],
["愛媛県","&p_prefecture=38"],
["香川県","&p_prefecture=37"],
["徳島県","&p_prefecture=36"],
["高知県","&p_prefecture=39"]],

//九州
[["九州全域","&p_dest=19"],
["福岡県","&p_prefecture=40"],
["長崎県","&p_prefecture=42"],
["大分県","&p_prefecture=44"],
["佐賀県","&p_prefecture=41"],
["熊本県","&p_prefecture=43"],
["宮崎県","&p_prefecture=45"],
["鹿児島県","&p_prefecture=46"]],

];



var area_array = new Array();

area_array[1] = [

//北海道全域
[["北海道全域",""]],

//札幌
[["北海道全域",""],
["札幌","&p_city=01101"],
["函館","&p_city=01001,01006"],
["湯の川温泉","&p_city=01002"]],

];

area_array[2] = [

//東北全域
[["東北全域",""]],

//青森県
[["青森県全域",""],
//["大鰐温泉","&p_city=02011"],
//["古牧温泉","&p_key=%8c%c3%96q&p_encode=SJIS"],
//["鰺ヶ沢温泉","&p_city=02012"],
//["十和田湖","&p_city=05005,02008"],
//["八戸市内","&p_city=02007"]],
["弘前市内","&p_city=02003"]],
//["十和田湖畔温泉","&p_key=%8F%5C%98a%93c%8C%CE%94%C8%89%B7%90%F2&p_encode=SJIS"]],
//["鯵ヶ沢高原温泉","&p_key=%88%B1%83%96%91%F2%8D%82%8C%B4%89%B7%90%F2&p_encode=SJIS"]],

//秋田県
[["秋田県全域",""],
["田沢湖温泉郷","&p_city=05013&p_key=%E7%94%B0%E6%B2%A2%E6%B9%96"],
["玉川温泉","&p_key=%8b%ca%90%ec%89%b7%90%f2+%93%92%8e%a1&p_encode=SJIS"],
["乳頭温泉郷","&p_key=%93%fb%93%aa&p_encode=SJIS"]],
//["湯瀬温泉","&p_city=05006"],
//["秋田市内","&p_city=05001"]],
//["湯瀬温泉","&p_key=%93%92%90%a3&p_encode=SJIS"]],
//["大潟温泉","&p_key=%91%E5%8A%83&p_encode=SJIS"]],

//岩手県
[["岩手県全域",""],
["雫石高倉温泉","&p_city=03006"],
["安比高原温泉","&p_key=%88%c0%94%e4&p_encode=SJIS"],
["花巻温泉郷","&p_key=%89%d4%8a%aa%89%b7%90%f2&p_encode=SJIS"],
["新鉛温泉","&p_key=%89%94%89%B7%90%F2&p_encode=SJIS"],
["八幡平温泉郷","&p_key=%94%AA%94%A6%95%BD%89%B7%90%F2%8B%BD&p_encode=SJIS"],
["鶯宿温泉沢内高原温泉","&p_key=%E9%F2%8Fh%89%B7%90%F2&p_encode=SJIS"],
//["志戸平温泉","&p_key=%8eu%8c%cb%95%bd&p_encode=SJIS"],
["奥州平泉温泉","&p_key=%89%9c%8fB%95%bd%90%f2&p_encode=SJIS"],
["つなぎ温泉","&p_key=%E3%81%A4%E3%81%AA%E3%81%8E%E6%B8%A9%E6%B3%89"]],
//["金田一温泉","&p_key=%E9%87%91%E7%94%B0%E4%B8%80"],
//["気仙沼","&p_city=04005"],
//["盛岡市内","&p_city=03001"]],
//["松川温泉","&p_key=%8F%BC%90%EC&p_encode=SJIS"]],

//宮城県
[["宮城県全域",""],
["作並温泉","&p_key=%8D%EC%95%C0%89%B7%90%F2&p_encode=SJIS"],
["鳴子温泉","&p_key=%96%C2%8Eq%89%B7%90%F2&p_encode=SJIS"],
["秋保温泉","&p_city=04002"],
["宮城蔵王","&p_key=%8B%7B%8F%E9%91%A0%89%A4&p_encode=SJIS"],
["遠刈田温泉","&p_key=%89%93%8A%A0%93c%89%B7%90%F2&p_encode=SJIS"],
//["鎌先温泉","&p_key=%E9%8E%8C%E5%85%88%E6%B8%A9%E6%B3%89"],
["南三陸・気仙沼","&p_city=04005"],
["松島","&p_city=04004"],
//["鬼首温泉","&p_city=04010"],
//["小原温泉","&p_key=%8f%ac%8c%b4&p_encode=SJIS"],
//["鎌先温泉","&p_key=%8a%99%90%e6&p_encode=SJIS"],
["仙台","&p_city=04001"]],

//山形県
[["山形県全域",""],
["蔵王温泉","&p_key=%91%A0%89%A4%89%B7%90%F2&p_encode=SJIS"],
["天童温泉","&p_city=06007"],
//["銀山温泉","&p_city=06008"],
//["月岡温泉","&p_key=%8c%8e%89%aa&p_encode=SJIS"],
["白布温泉","&p_key=%94%92%95z%89%b7%90%f2&p_encode=SJIS"],
["由良温泉","&p_key=%97R%97%c7%89%b7%90%f2&p_encode=SJIS"],
["小野川温泉","&p_key=%E5%B0%8F%E9%87%8E%E5%B7%9D%E6%B8%A9%E6%B3%89"],
["赤湯温泉","&p_city=06011"],
["五色温泉","&p_key=%8c%dc%90F%89%b7%90%f2&p_sdp=3"],
["かみのやま温泉","&p_city=06004"],
["あつみ温泉","&p_city=06010"]],

//福島県
[["福島県全域",""],
["裏磐梯・磐梯高原","&p_city=07006&p_key=%94%D6%92%F2&p_encode=SJIS"],
//["小原温泉","&p_key=%8f%ac%8c%b4&p_encode=SJIS%89%b7%90%f2"],
["会津","&p_city=07003,07011"],
//["会津高原","&p_key=%E4%BC%9A%E6%B4%A5%E9%AB%98%E5%8E%9F"],
["岳温泉","&p_key=%E5%B2%B3%E6%B8%A9%E6%B3%89"],
["いわき湯本温泉","&p_city=07008"],
//["猪苗代温泉","&p_city=07004"],
//["会津東山温泉","&p_key=%93%8c%8eR&p_encode=SJIS"],
//["五色温泉","&p_key=%8c%dc%90F%89%b7%90%f2"],
["飯坂温泉","&p_key=%94%D1%8D%E2%89%B7%90%F2&p_encode=SJIS"],
["高湯温泉","&p_key=%8D%82%93%92%89%B7%90%F2&p_encode=SJIS"],
["土湯温泉","&p_key=%93y%93%92%89%B7%90%F2&p_encode=SJIS"],
["猪苗代","&p_city=07004"],
["磐梯熱海温泉","&p_city=07009"],
["福島市内","&p_city=07001"]],

];

area_array[3] = [

//関東全域
[["関東全域",""]],

//群馬県
[["群馬県全域",""],
//["嬬恋","&p_key=%92%DA%97%F6%83v%83%8A%83%93%83X&p_encode=SJIS"],
["水上","&p_key=%90%85%8F%E3&p_encode=SJIS"],
["万座温泉","&p_key=%96%9c%8d%c0&p_encode=SJIS"],
["草津温泉","&p_city=10003"],
["伊香保温泉","&p_key=%88%c9%8d%81%95%db&p_encode=SJIS"],
["四万温泉","&p_key=%8el%96%9c&p_encode=SJIS"],
//["老神温泉","&p_key=%98V%90_%89%b7%90%f2&p_encode=SJIS"],
["北軽井沢","&p_city=10005"],
["猿ヶ京温泉","&p_city=10014,10015"]],
//["軽井沢","&p_key=%8Cy%88%E4%91%F2&p_encode=SJIS"]],

//栃木県
[["栃木県全域",""],
//["川治温泉","&p_key=%90%EC%8E%A1%89%B7%90%F2&p_encode=SJIS"],
//["日光","&p_city=09002"],
["鬼怒川温泉","&p_key=%8BS%93%7B%90%EC%89%B7%90%F2&p_encode=SJIS"],
["那須塩原","&p_city=09005"]],

//茨城県
//[["茨城県全域",""],
//["大洗","&p_key=%91%e5%90%f4&p_encode=SJIS"]],

//千葉県
[["千葉県全域",""],
["房総","&p_city=12005,12006,12007,12008"]],
//["銚子・犬吠崎","&p_city=12004"]],

//山梨県
[["山梨県全域",""],
["石和温泉","&p_key=%90%CE%98a&p_encode=SJIS"],
//["甲府","&p_city=19001"],
["八ヶ岳","&p_key=%94%aa%83%96%8ax&p_encode=SJIS"],
["河口湖","&p_city=19005"]],

//伊豆・箱根
[["伊豆・箱根全域",""],
//["箱根・強羅温泉","&p_key=%8b%ad%97%85%89%b7%90%f2&p_country=%90_%93%de%90%ec%8c%a7&p_encode=SJIS"],
//["湯河原温泉","&p_key=%93%92%89%cd%8c%b4"],
["箱根","&p_prefecture=22,14&p_city=14005"],
["湯河原温泉","&p_prefecture=22,14&p_key=%E6%B9%AF%E6%B2%B3%E5%8E%9F%E6%B8%A9%E6%B3%89"],
["熱海温泉","&p_key=%94M%8aC%89%b7%90%f2&p_encode=SJIS"],
["蓮台寺温泉","&p_key=%98%40%91%e4%8e%9b%89%b7%90%f2&p_encode=SJIS"],
["下田温泉","&p_key=%89%BA%93c%89%B7%90%F2&p_encode=SJIS"],
["今井浜温泉","&p_key=%8D%A1%88%E4%95l%89%B7%90%F2&p_encode=SJIS"],
["熱川温泉","&p_key=%94M%90%ec%89%b7%90%f2&p_encode=SJIS"],
["北川温泉","&p_key=%96k%90%EC%89%B7%90%F2&p_encode=SJIS"],
["下賀茂温泉","&p_key=%89%BA%89%EA%96%CE%89%B7%90%F2&p_encode=SJIS"],
["伊東温泉","&p_key=%88%C9%93%8C%89%B7%90%F2&p_encode=SJIS"],
["伊豆稲取温泉","&p_key=%88%ee%8e%e6&p_encode=SJIS"],
["伊豆網代温泉","&p_key=%96%d4%91%e3&p_encode=SJIS"],
["伊豆長岡温泉","&p_key=%88%C9%93%A4%92%B7%89%AA%89%B7%90%F2&p_encode=SJIS"],
//["中伊豆温泉","&p_key=%92%86%88%C9%93%A4%89%B7%90%F2&p_encode=SJIS"],
["修善寺温泉","&p_key=%E4%BF%AE%E5%96%84%E5%AF%BA&p_encode=SJIS"],
["伊豆高原","&p_city=22003"]],

];


area_array[4] = [

//中部・北陸全域
[["中部・北陸全域",""]],


//静岡県
[["静岡県全域",""],
["浜名湖","&p_key=%95l%96%BC%8C%CE&p_encode=SJIS"]],
//["寸又峡温泉","&p_key=%90%a1%96%94%8b%ac%89%b7%90%f2&p_encode=SJIS"]],

//長野県
[["長野県全域",""],
["軽井沢","p_key=%8cy%88%e4%91%f2&p_encode=SJIS"],
//["白馬","&p_city=20009"],
["斑尾高原","&p_city=20028"],
//["蓼科温泉","&p_city=20012"],
//["志賀高原","&p_city=20003"],
//["白馬","&p_city=20009&p_prefecture=20"],
//["大町温泉","&p_key=%E5%A4%A7%E7%94%BA%E6%B8%A9%E6%B3%89&p_encode=SJIS"],
["信州松代温泉","&p_key=%8F%BC%91%E3&p_encode=SJIS"],
//["斑尾高原","&p_key=%94%c1%94%f6&p_encode=SJIS"],
//["白馬","&p_key=%94%92%94n&p_encode=SJIS"],
//["志賀高原","&p_key=%8eu%89%ea%8d%82%8c%b4&p_encode=SJIS"],
//["斑尾温泉","&p_key=%94%c1%94%f6&p_encode=SJIS"],
//["別所温泉","&p_city=20008&p_key=%95%CA%8F%8A%89%B7%90%F2%89w&p_encode=SJIS"],
//["戸倉上山田温泉","&p_key=%8C%CB%91q%8F%E3%8ER%93c%89%B7%90%F2&p_encode=SJIS"],
//["上諏訪温泉","&p_key=%8f%e3%90z%96K"],
//["七味温泉","&p_key=%E4%B8%83%E5%91%B3"],
//["浅間温泉","&p_key=%90%f3%8a%d4&p_encode=SJIS"],
//["戸倉上山田温泉","&p_key=%8c%cb%91q&p_encode=SJIS"],
["湯田中温泉","&p_key=%93%92%93c%92%86%89%B7%90%F2&p_encode=SJIS"],
["熊の湯ほたる温泉","&p_key=%E7%86%8A%E3%81%AE%E6%B9%AF%E3%81%BB%E3%81%9F%E3%82%8B"],
["松本","&p_city=20015"],
["白骨温泉","&p_city=20016"],
["戸倉上山田温泉","&p_city=20026"]],

//新潟県
[["新潟県全域",""],
//["赤倉温泉","&p_key=%90%D4%91q%89%B7%90%F2&p_encode=SJIS"],
//["瀬波温泉","&p_key=%90%A3%94g%89%B7%90%F2&p_encode=SJIS"],
//["弥彦温泉","&p_key=%E5%BC%A5%E5%BD%A6%E6%B8%A9%E6%B3%89"],
//["月岡温泉","&p_key=%8c%8e%89%aa&p_encode=SJIS%89%b7%90%f2"],
//["湯田上温泉","&p_key=%E6%B9%AF%E7%94%B0%E4%B8%8A"],
["越後湯沢","&p_key=%89z%8c%e3%93%92%91%f2&p_encode=SJIS"],
["六日町温泉","&p_city=15007"],
["湯田上温泉","&p_key=%E6%B9%AF%E7%94%B0%E4%B8%8A"],
["瀬波温泉","&p_city=15016"],
["月岡温泉","&p_city=15014"],
["弥彦温泉・岩室温泉","&p_city=15002"]],
//["岩室温泉","&p_key=%E5%B2%A9%E5%AE%A4%E6%B8%A9%E6%B3%89"]],
//["佐渡","&p_key=%8D%B2%93n&p_encode=SJIS"]],

//岐阜県
[["岐阜県全域",""],
["奥飛騨・新穂高温泉","&p_city=21003"],
["飛騨高山","&p_city=21002"]],
//["下呂温泉","&p_key=%89%BA%98C%89%B7%90%F2&p_encode=SJIS"]],

//石川県
[["石川県全域",""],
["金沢市内","&p_city=17001"],
//["加賀温泉郷","&p_city=17003"],
["和倉温泉","&p_city=17008"],
["片山津温泉・山代温泉","&p_city=17003"],
["粟津温泉","&p_city=17002"]],

//富山県
[["富山県全域",""],
["宇奈月温泉","&p_key=%89F%93%de%8c%8e&p_encode=SJIS"],
["金太郎温泉","&p_key=%8b%e0%91%be%98Y%89%b7%90%f2&p_encode=SJIS"],
["富山市内","&p_key=%95x%8ER%8Es%93%E0&p_encode=SJIS"]],

//福井県
[["福井県全域",""]],

//愛知県
//[["愛知県全域","&p_prefecture=23"],
//["西浦温泉","&p_key=%E8%A5%BF%E6%B5%A6%E6%B8%A9%E6%B3%89"]],

];

area_array[5] = [

//近畿・南紀・伊勢全域
[["近畿・南紀・伊勢全域",""]],

//大阪府
[["大阪府全域",""],
//["ユニバーサル・スタジオ・ジャパン&trade;","&p_key=%83%86%83j%83o%81%5B%83T%83%8B%81E%83X%83%5E%83W%83I%81E%83W%83%83%83p%83%93&trade;&p_encode=SJIS"], 
["大阪市内",""]],

//京都府
[["京都府全域",""],
["京都市内",""]],

//兵庫県
[["兵庫県全域",""],
//["神戸",""],	
//["城崎温泉","&p_city=28010"]],
["神戸市内","&p_city=28001"]],

//滋賀県
//[["滋賀県全域",""]],
//["琵琶湖","&p_country=%8e%a0%89%ea%8c%a7"]],

//三重県
[["三重県全域",""],
["伊勢志摩","&p_city=24002"],
["鳥羽","&p_key=%92%B9%89H&p_encode=SJIS"]],

//和歌山県
[["和歌山県全域",""],
["南紀勝浦温泉","&p_key=%8f%9f%89Y&p_encode=SJIS"]],
//["紀州みなべ千里浜温泉","&p_key=%93%ec%95%94&p_encode=SJIS"]],
];

area_array[6] = [

//山陰山陽四国全域
[["山陰山陽四国全域",""]],

//山陰山陽全域
[["山陰山陽全域",""]],

//広島県
[["広島県全域",""],
["広島市内","&p_city=34001"]],

//岡山県
[["岡山県全域",""],
["倉敷市内","&p_city=33002"]],

//島根県
[["島根県全域",""]],
//鳥取県
[["鳥取県全域",""]],
//山口県
[["山口県全域",""]],
//四国全域
[["四国全域",""]],
//愛媛県
[["愛媛県全域",""]],
//香川県
[["香川県全域",""]],
//徳島県
[["徳島県全域",""]],
//高知県
[["高知県全域",""]],
];

area_array[7] = [

//九州全域
[["九州全域",""]],
//福岡県
[["福岡県全域",""]],
//長崎県
[["長崎県全域",""]],
//大分県
[["大分県全域",""]],
//佐賀県
[["佐賀県全域",""]],
//熊本県
[["熊本県全域",""]],
//宮崎県
[["宮崎県全域",""]],
//鹿児島県
[["鹿児島県全域",""]],

];

// 年月設定用関数
var d = new Date();
var dy = d.getYear();
function monthmenu(){
	dy = d.getYear();
	var dm = d.getMonth();
	var mm ="";
	var mv = "";
	if ( dy < 2000 ) {
		dy = dy - 100 + 2000;
	}
	for( i=1; i<13 ; i++ ) {
		dm = dm +1;
		if ( dm >12 ) {
			dm = 1;
			dy = dy + 1;
		}
		if ( dm <10 ) {
			mm = "0" + dm;
			mv = dm + "  ";
		} else {
			mm = dm;
			mv = dm;
		}
		this.document.jrForm.p_month.options[i] = new Option( dy+"年"+ mm, dy+"/"+ mm +"/01" );
	}
}

// 日付設定用関数
function datemenu() {
	document.jrForm.p_dd.length = 1;
	document.jrForm.p_dd.options[0].text = " 　";
	selMonthTemp = document.jrForm.p_month.options[document.jrForm.p_month.selectedIndex].value;
	selMonthTemp = selMonthTemp.split('/')
	selMonth = selMonthTemp[1];
	if ( selMonth != "" ) { 
		mld = new Date(dy, selMonth, 1);
		mld.setDate(0);
		brk = mld.getDate();
		for ( i = 1 ; i <= brk ; i++) {
			document.jrForm.p_dd.length = i +1;
			document.jrForm.p_dd.options[i].text = i ;
		}
	}
}

// 都道府県設定用関数
var n_dest;
function set_country(n) {
	while(document.jrForm.p_dest_country.options.length > 0){
		menuLength = document.jrForm.p_dest_country.options.length;
		for(creaCnt=0; creaCnt<menuLength; creaCnt++){
			document.jrForm.p_dest_country.options[creaCnt] = null;
		}
	}
	for(i=0;i< country_array[n].length;i++){
		document.jrForm.p_dest_country.options[i] = new Option(country_array[n][i][0], country_array[n][i][1]);
		document.jrForm.p_dest_country.options[i].disabled=false;
	}
	n_dest = n;
	set_area(0);
	document.jrForm.p_dest_country.options.selectedIndex = 0;
}

// 都市温泉地設定用関数
function set_area(x) {
	while(document.jrForm.p_city.options.length > 1){
		menuLength = document.jrForm.p_city.options.length;
		for(creaCnt=1; creaCnt<menuLength; creaCnt++){
			document.jrForm.p_city.options[creaCnt] = null;
		}
	}
	for(i=0;i< area_array[n_dest][x].length;i++){
		document.jrForm.p_city.options[i] = new Option(area_array[n_dest][x][i][0], area_array[n_dest][x][i][1]);
		document.jrForm.p_city.options[i].disabled=false;
	}
document.jrForm.p_city.options.selectedIndex = 0;
}

// 期間設定用関数
//p_kikan_fr p_kikan_toに値を入れる
//p_kikan_nullはbunrui=d183の振り分け用
function setkikan(selOBJ) {
	n = selOBJ.selectedIndex;

	switch (n) {
		case 1:
			document.jrForm.p_kikan_fr.value = "2";
			document.jrForm.p_kikan_to.value = "2";
			document.jrForm.p_kikan_null.value = "0";
			break;
		case 2:
			document.jrForm.p_kikan_fr.value = "3";
			document.jrForm.p_kikan_to.value = "3";
			document.jrForm.p_kikan_null.value = "0";
			break;
		case 3:
			document.jrForm.p_kikan_fr.value = "4";
			document.jrForm.p_kikan_to.value = "4";
			document.jrForm.p_kikan_null.value = "0";
			break;
		case 4:
			document.jrForm.p_kikan_fr.value = "";
			document.jrForm.p_kikan_to.value = "";
			document.jrForm.p_kikan_null.value = "1";
			break;
		default:
			document.jrForm.p_kikan_fr.value = "";
			document.jrForm.p_kikan_to.value = "";
			document.jrForm.p_kikan_null.value = "0";
			break;
		}
		
}

// submit用関数
function junp(){
	//bunruiの配列をカンマ区切りにする
	var tmp = "";
	var tmp = $("input[name=bunrui]:checked").map( function() {
		return $(this).val();
	}).get().join(",");
	
	var tmp2 = $("input[name=key]:checked").map( function() {
		return $(this).val();
	}).get().join(",");
	
	dest = document.jrForm.p_dest_country.options[document.jrForm.p_dest_country.options.selectedIndex].value;
	city = document.jrForm.p_city.options[document.jrForm.p_city.options.selectedIndex].value;
	p_kikan_fr = "&p_kikan_fr=" + document.jrForm.p_kikan_fr.value;
	p_kikan_to = "&p_kikan_to=" + document.jrForm.p_kikan_to.value;

	var kikan_null = document.jrForm.p_kikan_null.value;

	
	if(kikan_null == "1"){//bunrui=d183をセットする
		if(tmp !== ""){//他にbunruiがチェックされていたら
			p_bunrui = "&p_bunrui=814,030," + tmp +",d183";//最後にカンマとvalueをプラス
		}
		else{
			p_bunrui = "&p_bunrui=814,030," + "d183";
		}
	}
	else{
		if(tmp !== ""){//他にbunruiがチェックされていたら
			p_bunrui = "&p_bunrui=814,030," + tmp;
		}
		else{
			p_bunrui = "&p_bunrui=814,030";
		}
	}
	



	p_key = "&p_key=" + tmp2;
	p_month = "&p_month=" + document.jrForm.p_month.options[document.jrForm.p_month.options.selectedIndex].value;
	p_dd = "&p_dd=" + document.jrForm.p_dd.options[document.jrForm.p_dd.options.selectedIndex].value;
	location.href = baseURL + dest + city + p_kikan_fr + p_kikan_to + p_month + p_dd + p_bunrui + p_key;
}

// onload用関数
function init(){
	monthmenu();
	document.jrForm.reset();
	if(document.jrForm.p_dest){document.jrForm.p_dest.selectedIndex = '0';}
	document.jrForm.p_dest_country.selectedIndex = '0';
	document.jrForm.p_city.selectedIndex = '0';
	document.jrForm.p_month.selectedIndex = '0';
	document.jrForm.p_dd.selectedIndex = '0';
	document.jrForm.bunrui.checked = false;
	document.jrForm.p_kikan.selectedIndex = '0';
	
	var url = location.pathname;
	url.match(/.*\/(.*)\.php/);
	path = RegExp.$1;
	
	switch(path) {
		case 'hokkaido':
			set_country(1);
			break;
		case 'tohoku':
			set_country(2);
			break;
		case 'kanto':
			set_country(3);
			break;
		case 'chubu-hokuriku':
			set_country(4);
			break;
		case 'kinki':
			set_country(5);
			break;
		default:
			break;
	}
}

$(document).ready(function(){
init();
});


