//リンク関数
// 通常の画面遷移
function call_view(unit_Id)
{
	//alert("Unit_ID = " + unit_Id );
	document.main.unit_id.value = unit_Id;
	document.main.page.value = "";
	document.main.tour_id.value = "";
	document.main.hotel_id.value = "";
	document.main.region_pattern.value = "";
	
	document.main.submit();
}
// ページアンカーによる画面遷移
function call(unit_Id, page){
	//alert("Unit_ID = " + unit_Id + " page = " + page );
	document.select.unit_id.value = unit_Id;
	document.select.page.value = page;
	document.main.tour_id.value = "";
	document.main.hotel_id.value = "";
	
	document.select.submit();
}
// 詳細画面への画面遷移
function call2(unit_Id, code){
	//alert("Unit_ID = " + unit_Id + " code = " + code);
	document.main.unit_id.value = unit_Id;
	document.main.page.value = "";
	document.main.tour_id.value = code;
	document.main.hotel_id.value = code;
	document.main.region_pattern.value = "";
	
	document.main.submit();
}
// 場所による検索の画面遷移
function call3(unit_Id, region_pattern){
	//alert("Unit_ID = " + unit_Id + " Region_Pattern = " + region_pattern);
	document.select.unit_id.value = unit_Id;
	document.select.page.value = "";
	document.main.tour_id.value = "";
	document.main.hotel_id.value = "";
	document.select.region_pattern.value = region_pattern;
	
	document.select.submit();
}
// 条件を入力した検索の画面遷移
function call_select(unit_Id, page){
	//alert("Unit_ID = " + unit_Id + " page = " + page );
	document.select.unit_id.value = unit_Id;
	document.select.page.value = page;
	document.main.tour_id.value = "";
	document.main.hotel_id.value = "";
	document.main.region_pattern.value = "";
	
	document.select.submit();
}

//******************************************************************//
//   処理 : 問い合わせフォーム、申込フォームへの画面遷移
//   引数 : unitID ユニットID
//        : typeCD 種別
//        :   1=問い合わせ
//        :   2=パックツアー
//        :   3=オプショナルツアー
//        :   4=ホテル手配
//        :   5=台湾新幹線手配
//        :   6=台湾列車手配
//        :   7=阿里山森林鉄道手配
//        :   8=送迎車手配
//        :   9=貸切車手配
//        :  11=台湾国内線手配
//        :  12=阿里山パックツアー
//        : code   次面へ引き渡しコード１
//        : code2  次画面へ引き渡しコード２
//******************************************************************//
function call_ssl_view(unitID, typeCD, code, code2)
{
	//alert("Unit_ID = " + unitID + " type = " + typeCD + " code1 = " + code + " code2 = " + code2);
	switch (arguments.length) {
	case 4:
		document.ssl_page.code2.value = code2;
	case 3:
		document.ssl_page.code.value = code;
	case 2:
		document.ssl_page.type.value = typeCD;
	case 1:
		document.ssl_page.unit_id.value = unitID;
	default:
	}
	document.ssl_page.submit();
}

// _HpbJumpURLinNewWindow: 新規ウィンドウを開いて指定したURLにジャンプします。
function jumpURLinNewWindow(url) 
{
  if (url != '')
  {
    window.open(url, '_blank');
  }
}

// 拡大画像イメージ表示
function imageOpen(image_Pash,image_Name,image_Title,tour_Name){
	
	var tImg= new Image();
	tImg.src=image_Pash + image_Name;
	
	if(navigator.userAgent.indexOf("MSIE") != -1){
		wid = tImg.width;
		hei = tImg.height;
	}else{
		wid = tImg.naturalWidth;
		hei = tImg.naturalHeight;
	}
	
	var w = self.open('', '', 'width=' + wid + ',height=' + hei + ',scrollbars=no,resizable=yes');   /* new window */
	
	w.document.open();
	w.document.write('<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN">');

	w.document.write('<head>');
	w.document.write('<title>' + tour_Name + '[' + image_Title + ']</title>');
	w.document.write('<link rel="stylesheet" type="text/css" href="./view/css/basic.css" media="all" />');
	w.document.write('</head>');

	w.document.write('<body onclick="self.close(); ">');
	w.document.write('<p><img src="' + image_Pash + image_Name + '" alt="' + image_Title + '"><p>');
	
	w.document.write('</body>');
	w.document.close();
	
	return false;
}

// トップ画面のツアー詳細への遷移用
function call_view3(unitID, tourID)
{
	document.top_form.unit_id.value = unitID;
	document.top_form.tour_id.value = tourID;
	document.top_form.submit();
}

//ENTERによるイベント発火を防ぐ
function funcformonkeydown(){
	var src = window.event.srcElement;
	if(event.keyCode == 13) {
		if (src.type == '' ) {
			src.click();
		}
		else if (src.type != 'submit' && src.type != 'button' && src.type != 'textarea' ) {
			return false;
		}
	}
}

function submitStop(e){
	if (!e) var e = window.event;
	
	if(e.keyCode == 13)
		return false;
}