<!--
/*
// 物件詳細画面の画像を切り替える
// 引数: 画像番号、画像ファイル名、画像表示幅、画像表示高さ、画像説明
function changePicture(picNo, dispPictureFileName, dispPictureWidth, dispPictureHeight, strDispCaption) {
	var seaArtSeqNo = document.getElementById('art_seqno').value;
	
	// 一旦「読み込み中」の表示にする
	document.getElementById('spanImage').style.display = 'none';
	//document.getElementById('spanMap').style.display = 'none';
	document.getElementById('picLoadInformation').style.display = '';
	
	var targetNode = document.getElementById('dispCaption');
	
	while (targetNode.childNodes.length > 0) {
		targetNode.removeChild(targetNode.childNodes[0]);
	}
	
	var textNode = document.createTextNode(strDispCaption);												// 画像キャプション
	targetNode.appendChild(textNode);
	
	// 選択された画像によって処理を分ける
	switch (picNo) {
		// 地図
		case 'map':
			//document.getElementById('spanMap').style.display = '';
			break;
		// それ以外
		default:
			document.getElementById('imgImage').src = '/files/article/img/d' + seaArtSeqNo + '/' + dispPictureFileName;
			document.getElementById('imgImage').width = dispPictureWidth;
			document.getElementById('imgImage').height = dispPictureHeight;
			document.getElementById('imgImage').alt = strDispCaption;
			
			document.getElementById('spanImage').style.display = '';
			break;
	}
	
	document.getElementById('picLoadInformation').style.display = 'none';
	
	// 選択中の画像番号を設定する
	document.getElementById('seaPicNo').value = picNo;
}

*/

// 物件詳細画面の画像を切り替える
// 引数: 画像ファイルパス、画像タイトル、画像表示幅、画像表示高さ
function changePicture(picPath, title, dispPictureWidth, dispPictureHeight) {
	// 一旦「読み込み中」の表示にする
	document.getElementById('spanImage').style.display = 'none';
	
	//画像タイトル生成
	var targetNode = document.getElementById('dispCaption');
	while (targetNode.childNodes.length > 0) {
		targetNode.removeChild(targetNode.childNodes[0]);
	}
	var textNode = document.createTextNode(title);					// 画像キャプション
	targetNode.appendChild(textNode);
	//画像(大)を表示する
	document.getElementById('imgImage').src = picPath;
	document.getElementById('imgImage').alt = title;
	document.getElementById('imgImage').width = dispPictureWidth;
	document.getElementById('imgImage').height = dispPictureHeight;
	
	document.getElementById('spanImage').style.display = '';
	
}

// オンライン予約画面を開く
function openContactDetail(art_title,art_seqno) {
	document.getElementById('art_title').value = art_title;
	document.getElementById('art_seqno').value = art_seqno;
	document.getElementById('open_contact_detail').submit();
}
// TOPからオンライン予約画面を開く
function openContactDetailTop(seqNo){
	var reserveNo = document.getElementById('wp2_c1_seqNo'+ String(seqNo)).innerText;
	var reserveTitle = document.getElementById('wp2_c1_title'+ seqNo).innerText;
	//FireFoxではinnerTextが使えない。textContentを使う
	if(typeof reserveNo =='undefined'){
		reserveNo = document.getElementById('wp2_c1_seqNo'+ String(seqNo)).textContent;
	}
	if(typeof reserveTitle =='undefined'){
		reserveTitle = document.getElementById('wp2_c1_title'+ seqNo).textContent;
	}
	
	document.getElementById('art_title').value = reserveTitle;
	document.getElementById('art_seqno').value = reserveNo;
	document.getElementById('open_contact_detail').submit();
	
}



// 物件詳細画面を開いたときの処理
function loadProcDetail() {
	// GoogleMapがページ内に存在する場合
	if (!!document.getElementById('detailMap')) {
		setupMapDetail();
	}
	
}

// 物件詳細画面を閉じたときの処理
function closeProcDetail() {
	// GoogleMapがページ内に存在する場合
	if (!!document.getElementById('detailMap')) {
		unloadMapDetail();
	}
}

// 地図セットアップ(物件詳細画面)
function setupMapDetail() {
	if (GBrowserIsCompatible()) {
		var mapflg, mapplat, mapplon, mapclat, mapclon, mapzoom;										// 地図データ
		
		mapflg = document.getElementById("mapflg").value;												// 地図有無フラグ
		
		if (mapflg == "1") {
			mapplat = document.getElementById("mapplat").value;											// ポインタ緯度
			mapplon = document.getElementById("mapplon").value;											// ポインタ経度
			mapclat = document.getElementById("mapclat").value;											// 中心点緯度
			mapclon = document.getElementById("mapclon").value;											// 中心点経度
			mapzoom = document.getElementById("mapzoom").value;											// ズーム
			// ズームを数値に変換する
			if (mapzoom != "") {
				mapzoom = Number(mapzoom);
			} else {
				mapzoom = 13;
			}
			
			var objMap = new GMap2(document.getElementById("detailMap"));
			
			// 地図にコントロールを追加する
			// 位置移動（小）、ズーム（小）
			objMap.addControl(new GSmallMapControl());
			// 縮尺表示
			objMap.addControl(new GScaleControl());
			// 地図タイプ切り替え（地図、航空写真、デュアル）
			objMap.addControl(new GMapTypeControl());
			
			// 地図の中心点を設定する
			objMap.setCenter(new GLatLng(mapclat, mapclon), mapzoom);
			
			// ポインタの緯度と経度が設定されている場合は地図にマーカーを表示する
			if (mapplat != "" && mapplon != "") {
				var point = new GLatLng(mapplat, mapplon);
				objMap.addOverlay(new GMarker(point));
			}
		} else {
			return false;
		}
	}
}

// 地図アンロード(物件詳細画面)
function unloadMapDetail() {
	GUnload();
}






// -->

