﻿//株式会社南西楽園ツーリスト殿　WEB検索用Javascript
//ver 1.30 re:071126A


//------------------
// ツアー検索用パラメータの設定
//------------------
function searchTour() {

// 配列の宣言
var sp1 = new Array(6) ; //ツアー検索用配列

// 出発地
if(document.form1.ftc.options[document.form1.ftc.selectedIndex].value != ""){
	sp1[0] = "ftc="+document.form1.ftc.options[document.form1.ftc.selectedIndex].value;
} else {
	sp1[0] = "";
}

//目的地
if(document.form1.mc.options[document.form1.mc.selectedIndex].value != ""){
	sp1[1] = "mc="+document.form1.mc.options[document.form1.mc.selectedIndex].value;
} else {
	sp1[1] = "";
}

//出発日(年,月,日)
if(document.form1.ddy.options[document.form1.ddy.selectedIndex].value != ""){
	sp1[2] = "ddy="+document.form1.ddy.options[document.form1.ddy.selectedIndex].value;
} else {
	sp1[2] = "";
}

if(document.form1.ddm.options[document.form1.ddm.selectedIndex].value != ""){
	sp1[3] = "ddm="+document.form1.ddm.options[document.form1.ddm.selectedIndex].value;
} else {
	sp1[3] = "";
}

if(document.form1.ddd.options[document.form1.ddd.selectedIndex].value != ""){
	sp1[4] = "ddd="+document.form1.ddd.options[document.form1.ddd.selectedIndex].value;
} else {
	sp1[4] = "";
}

//旅行期間
//ver 1.30 re:071126A 修正
if (document.form1.hfht.options[document.form1.hfht.selectedIndex].value == 1) {
	sp1[5] = "hf=1&ht=1";
} else if (document.form1.hfht.options[document.form1.hfht.selectedIndex].value == 2) {
	sp1[5] = "hf=2&ht=2";
} else if (document.form1.hfht.options[document.form1.hfht.selectedIndex].value == 3) {
	sp1[5] = "hf=3&ht=3";
} else if (document.form1.hfht.options[document.form1.hfht.selectedIndex].value == 4) {
	sp1[5] = "hf=4&ht=4";	
} else if (document.form1.hfht.options[document.form1.hfht.selectedIndex].value == 5) {
	sp1[5] = "hf=5&ht=5";
} else if (document.form1.hfht.options[document.form1.hfht.selectedIndex].value == 6) {
	sp1[5] = "hf=6&ht=6";
} else {
	sp1[5] = "";
}

//ホテル名
if(document.form1.htl.options[document.form1.htl.selectedIndex].value != ""){
	sp1[6] = "htl="+document.form1.htl.options[document.form1.htl.selectedIndex].value;
} else {
	sp1[6] = "";
}

//渡すURLを準備
$url = "http://www2.nanseirakuen.jp/tourlist.aspx?";

$flga = 0;
for ($i=0; $i<sp1.length; $i++) {
	if ($i==0) {
		if (sp1[0] != "") {
			$url = $url+sp1[0];
			$flga++;
		}
	} else {
		if (sp1[$i] != "") {
			if ($flga >= 1) {
				$url = $url+"&"+sp1[$i];
				$flga++;
			} else {
				$url = $url+sp1[$i];
				$flga++;
			}
		}
	}
}


//アクセス！
location.href = $url;

}




//------------------
// 宿泊検索用パラメータの設定
//------------------

function stayTour() {

// 配列の宣言
var sp2 = new Array(6) ; //宿泊検索用配列

//ホテル名
if(document.form2.htl.options[document.form2.htl.selectedIndex].value != ""){
	sp2[0] = "htl="+document.form2.htl.options[document.form2.htl.selectedIndex].value;
} else {
	sp2[0] = "";
}

//出発日(年,月,日)
if(document.form2.ddy.options[document.form2.ddy.selectedIndex].value != ""){
	sp2[1] = "ddy="+document.form2.ddy.options[document.form2.ddy.selectedIndex].value;
} else {
	sp2[1] = "";
}

if(document.form2.ddm.options[document.form2.ddm.selectedIndex].value != ""){
	sp2[2] = "ddm="+document.form2.ddm.options[document.form2.ddm.selectedIndex].value;
} else {
	sp2[2] = "";
}

if(document.form2.ddd.options[document.form2.ddd.selectedIndex].value != ""){
	sp2[3] = "ddd="+document.form2.ddd.options[document.form2.ddd.selectedIndex].value;
} else {
	sp2[3] = "";
}

//旅行期間
if (document.form2.hfht2.options[document.form2.hfht2.selectedIndex].value == 1) {
	sp2[4] = "hf=1&ht=1";
} else if (document.form2.hfht2.options[document.form2.hfht2.selectedIndex].value == 2) {
	sp2[4] = "hf=2&ht=2";
} else if (document.form2.hfht2.options[document.form2.hfht2.selectedIndex].value == 3) {
	sp2[4] = "hf=3&ht=3";
} else if (document.form2.hfht2.options[document.form2.hfht2.selectedIndex].value == 4) {
	sp2[4] = "hf=4&ht=4";
} else if (document.form2.hfht2.options[document.form2.hfht2.selectedIndex].value == 5) {
	sp2[4] = "hf=5&ht=5";	
} else if (document.form2.hfht2.options[document.form2.hfht2.selectedIndex].value == 6) {
	sp2[4] = "hf=6&ht=6";
} else if (document.form2.hfht2.options[document.form2.hfht2.selectedIndex].value == 7) {
	sp2[4] = "hf=7&ht=7";
} else {
	sp2[4] = "";
}



//渡すURLを準備
$url = "http://www2.nanseirakuen.jp/planlist.aspx?";





$flgb = 0;
for ($i=0; $i<sp2.length; $i++) {
	if ($i==0) {
		if (sp2[0] != "") {
			$url = $url+sp2[0];
			$flgb++;
		}
	} else {
		if (sp2[$i] != "") {
			if ($flgb >= 1) {
				$url = $url+"&"+sp2[$i];
				$flgb++;
			} else {
				$url = $url+sp2[$i];
				$flgb++;
			}
		}
	}
}


//アクセス！
location.href = $url;

}





