// **********************************************************************************
//	e3 : h_inf02.htm用 JavaScript
// **********************************************************************************
function clickHotelDetail() {
	var strLocation = "";
	var strPara = "";

	//ロケーション
	strLocation = '../h/h_inf02.php';
	
	//パラメータ受け渡し用変数に値を設定
//	strPara = '?areacd=' + document.main.areacd.value;
//	strPara = strPara + '&natcd=' + document.main.natcd.value;
//	strPara = strPara + '&citycd=' + document.main.citycd.value;
//	strPara = strPara + '&zonecd=' + document.main.zone.value;
//	strPara = strPara + '&checkin_date=' + document.main.checkin_date.value;
//	strPara = strPara + '&jhcno=' + document.main.jhcno.value;
	strPara = strPara + '?jhcno=' + document.main.jhcno.value;

//	window.location.href = strLocation + strPara;

	document.main.action = strLocation + strPara;
	document.main.method="post";
	document.main.target="_self";
	document.main.submit();	

}

function clickPrice() {
	var strLocation = "";
	var strPara = "";

	//ロケーション
	strLocation = '../h/h_inf03.php';
	
	//パラメータ受け渡し用変数に値を設定
//	strPara = '?areacd=' + document.main.areacd.value;
//	strPara = strPara + '&natcd=' + document.main.natcd.value;
//	strPara = strPara + '&citycd=' + document.main.citycd.value;
//	strPara = strPara + '&zonecd=' + document.main.zonecd.value;
//	strPara = strPara + '&checkin_date=' + document.main.checkin_date.value;
//	strPara = strPara + '&jhcno=' + document.main.jhcno.value;
	strPara = strPara + '?jhcno=' + document.main.jhcno.value;

//	window.location.href = strLocation + strPara;

	document.main.action = strLocation + strPara;
	document.main.method="post";
	document.main.target="_self";
	document.main.submit();	

}

function clickViewMap() {
	var strLocation = "";
	var strPara = "";

	//ロケーション
	strLocation = '../h/h_inf04.php';
	
	//パラメータ受け渡し用変数に値を設定
//	strPara = '?areacd=' + document.main.areacd.value;
//	strPara = strPara + '&natcd=' + document.main.natcd.value;
//	strPara = strPara + '&citycd=' + document.main.citycd.value;
//	strPara = strPara + '&zonecd=' + document.main.zonecd.value;
//	strPara = strPara + '&checkin_date=' + document.main.checkin_date.value;
//	strPara = strPara + '&jhcno=' + document.main.jhcno.value;
	strPara = strPara + '?jhcno=' + document.main.jhcno.value;

//	window.location.href = strLocation + strPara;

	document.main.action = strLocation + strPara;
	document.main.method="post";
	document.main.target="_self";
	document.main.submit();	


}

// 空室照会
//function clickVacant(ps_jhcno, ps_areacd, ps_natcd, ps_city, ps_zone) {
function clickVacant(ps_jhcno) {
	var strLocation = "";
	var strLinkPara = "";

	strLocation = '../h/h_inf01.php';

	strLinkPara = '?jhcno=' + ps_jhcno;
//	strLinkPara = strLinkPara + '&areacd=' + ps_areacd;
//	strLinkPara = strLinkPara + '&natcd='  + ps_natcd;
//	strLinkPara = strLinkPara + '&citycd=' + ps_city;
//	strLinkPara = strLinkPara + '&zonecd=' + ps_zone;

	document.vacant.action = strLocation + strLinkPara;
	document.vacant.method="post";
	document.vacant.target="_self";
	document.vacant.submit();	

}

// 戻る
function clickBack() {
	var strUrl = "";

	strUrl = document.main.back_url.value;
	window.location.href = strUrl;

}

//**************************************************
// 体験談ボタン
//**************************************************
function moveExp(s_type,jhcno,areacd,natcd,citycd) {

	//追加するGET引数を設定
	addget = "?s_type=" + s_type + "&jhcno=" + jhcno + "&areacd=" + areacd +
				"&natcd=" + natcd + "&citycd=" + citycd;

	//移動するURL文字列を作成
	jumpurl = "../c/c_exp01.php" + addget;

	//体験談画面を新しいウィンドウで開く
	window.open(jumpurl,'体験談');
}

//**************************************************
// お気に入り
//**************************************************
function addFav(cntcd,gdsno,areacd,natcd,citycd,zonecd,areanm,natnm,citynm,zonenm,gdsnm){

	document.favform.product_type.value = cntcd;	//コンテンツコード
													//ホテルは、"H" 固定

	document.favform.areacd.value = areacd;			//地域コード
	document.favform.natcd.value = natcd;			//国コード
	document.favform.citycd.value = citycd;			//都市コード
	document.favform.zonecd.value = zonecd;			//地区コード
	document.favform.jhc_code.value = gdsno;		//お気に入りコード
													//ホテルは、JHCNo・とらは商品コード
		
	document.favform.area_name.value = areanm;		//地域名
	document.favform.nation_name.value = natnm;		//国名
	document.favform.city_name.value = citynm;		//都市名
	document.favform.zone_name.value = zonenm;		//地区名
	document.favform.product_name.value = gdsnm;	//商品名
		
	document.favform.action_type.value = "add";
	document.favform.action = "../c/c_fav01.php?action_type=add&gdsno=" + gdsno;
	document.favform.method = "post";
	document.favform.target = "_self";
	document.favform.submit();
}

//**************************************************
// 地図拡大縮小リンク
//**************************************************
function clickMapResize(pn_mode) {
	var pnOrgWidth   = parseInt(document.mapSIZE.map_org_width.value);
	var pnOrgHeigth  = parseInt(document.mapSIZE.map_org_heigth.value);
	var pnCurrentDspRate = parseInt(document.mapSIZE.map_disp_rate.value);
	
//	alert("pn_mode          : " + pn_mode);
//	alert("pnOrgWidth       : " + pnOrgWidth);
//	alert("pnOrgHeigth      : " + pnOrgHeigth);
//	alert("pnCurrentDspRate : " + pnCurrentDspRate);

	var pnSetDspRate = 0;
	var pnSetWidth   = 0;
	var pnSetHeigth  = 0;

	pnSetDspRate = pnCurrentDspRate;

	if ( pn_mode == 1 ) {		//縮小
		if ( pnCurrentDspRate >= 50 ) {
			pnSetDspRate = pnCurrentDspRate - 10;
		}
	}
	else if ( pn_mode == 2 ) {	//拡大
		if ( pnCurrentDspRate < 150 ) {
			pnSetDspRate = pnCurrentDspRate + 10;
		}
	}
	else if ( pn_mode == 3 ) {	//等倍
			pnSetDspRate = 100;
	}
	
	if ( pnCurrentDspRate != pnSetDspRate ) {
		//サイズ計算
		pnSetWidth   = parseInt(pnOrgWidth  * pnSetDspRate / 100);
		pnSetHeigth  = parseInt(pnOrgHeigth * pnSetDspRate / 100);

		//画像リサイズ
		document.mapSIZE.mapIMAGE.width  = pnSetWidth;
		document.mapSIZE.mapIMAGE.height = pnSetHeigth;

		//現在の拡大/縮小率を保存
		document.mapSIZE.map_disp_rate.value   = pnSetDspRate;
	}
	
}
//**************************************************
// 印刷ボタン
//**************************************************
function clickPrint(ps_jhcno, ps_checkin_date) {
	var strLocation = "";
	var strLinkPara = "";

	strLocation = '../h/h_inf04_print.php';

	strLinkPara = '?jhcno=' + ps_jhcno;
	strLinkPara = strLinkPara + '&checkin_date='  + ps_checkin_date;

	window.open(strLocation + strLinkPara,"h_inf04_print","toolbar=0, scrollbars=1, location=0,statusbar=0,menubar=0,resizable=1,width=755,height=705,left = 1,top = 1");

}
