//*********************************************************************
// @(h) bkn-list.js   ver 1.0 ( 2009.09.08 (C) 2009 OHBEC Co.,Ltd. )
// @(s)
// 動画登録JavaScriptモジュール
//*********************************************************************

//*********************************************************************
// @(f)
// 機能      : 物件ナビ閲覧　詳細情報
// 引き数    : 
//           : 
//           : 
// 返り値    : なし
// 機能説明  : イメージを表示して動画を非表示にする
// 備考      :
//*********************************************************************
function imgchange(imgpath, imgfile){
	var imgfilepath = imgpath + imgfile;
//alert(imgfilepath);
	document.all.img1.style.visibility = "visible";
	document.all.img1.style.height = "267";
	document.all.img1.style.width = "400";
	document.all.img1.src = imgfilepath;

	document.all.link.href = imgfilepath;
}

//*********************************************************************
// @(f)
// 機能      : 物件ナビ閲覧　詳細情報
// 引き数    : 
//           : 
//           : 
// 返り値    : なし
// 機能説明  :  動画を表示してイメージを非表示にする
// 備考      :
//*********************************************************************
//function moviechange(maiidx){
function moviechange(categorykind,mapcidx,maiidx,a_DrChihou,a_DrChiiki,a_DrShicho,a_DrCityInfo){
////		document.all.chottoMovie.style.visibility = "visible";
////		document.all.img1.style.visibility = "hidden";
////		document.all.img1.style.height = "0";
////		document.all.img1.style.width = "0";
//	document.location.href="bkn_detail_photo.php?maiidx=" + maiidx;
	document.location.href="krsb_top.php?MENU=40&categorykind=" + categorykind + "&mapcidx=" + mapcidx + "&maiidx=" + maiidx + "&a_DrChihou=" + a_DrChihou + "&a_DrChiiki=" + a_DrChiiki + "&a_DrShicho=" + a_DrShicho + "&a_DrCityInfo=" + a_DrCityInfo;
}

//*********************************************************************
// @(f)
// 機能      : カテゴリーの表示順の入れ替え
// 引き数    : ARG-1:[orderNo]番号
//           : ARG-2:[updown]0:▲/1:▼
//           : ARG-3:[unlinkno]リンクしない番号(1つしか対応していません。)
// 返り値    : なし
// 機能説明  : 動画管理-TOP PAGE動画配列
// 備考      :
//*********************************************************************
function Java_ChangeBknOrder(orderNo,updown,unlinkno){
// updown: 0が▲　1が▼
var tmpTitle;
var tmpKey;

	var a_bw = Java_CheckBrowser();
	if (a_bw == "M") {
		g_BrowserKind = 1;
	} else {
		g_BrowserKind = 2;
	}

	if (updown==1){
		if(document.all || document.getElementById){
			if(document.all){
				tmpTitle = document.all("title" + orderNo).value;
				tmpKey = document.all("rec_key" + orderNo).value;
//alert("tmpTitle=" + tmpTitle + " | tmpKey=" + tmpKey);
//alert("title" + (orderNo+1) + "=" + document.all("title" + (orderNo+1)).value + " | rec_key" + (orderNo+1) + "=" + document.all("rec_key" + (orderNo+1)).value);
				document.all("title" + orderNo).value = document.all("title" + (orderNo+1)).value;
				document.all("rec_key" + orderNo).value = document.all("rec_key" + (orderNo+1)).value;
				document.all("title" + (orderNo+1)).value = tmpTitle;
				document.all("rec_key" + (orderNo+1)).value = tmpKey;
			}else{
				tmpTitle = document.getElementById("title" + orderNo).value;
				tmpKey = document.getElementById("rec_key" + orderNo).value;
				document.getElementById("title" + orderNo).value = document.getElementById("title" + (orderNo+1)).value;
				document.getElementById("rec_key" + orderNo).value = document.getElementById("rec_key" + (orderNo+1)).value;
				document.getElementById("title" + (orderNo+1)).value = tmpTitle;
				document.getElementById("rec_key" + (orderNo+1)).value = tmpKey;
			}

			if(document.all("rec_key" + (orderNo+1)).value == unlinkno){
				document.getElementById("title" + (orderNo+1)).setAttribute('onclick','');
				document.getElementById("title" + (orderNo+1)).style.color = "#000000";
				document.getElementById("title" + (orderNo+1)).style.textDecoration = "none";
				document.getElementById("title" + (orderNo+1)).style.cursor = "default";

				if(g_BrowserKind == 1){
				// IE
					document.getElementById("title" + (orderNo)).setAttribute('onclick',new Function("Java_OpenArticleDataDetail(" + document.all("rec_key" + (orderNo)).value + ");"));
				}else{
				// FireFox, Netscape
					document.getElementById("title" + (orderNo)).setAttribute('onclick',new Function("Java_OpenArticleDataDetail(" + document.all("rec_key" + (orderNo)).value + ");"));
				}
				document.getElementById("title" + (orderNo)).style.color = "#0000ff";
				document.getElementById("title" + (orderNo)).style.textDecoration = "underline";
				document.getElementById("title" + (orderNo)).style.cursor = "pointer";
			}else{
				if(document.all("rec_key" + (orderNo)).value == unlinkno){
					document.getElementById("title" + (orderNo)).setAttribute('onclick','');
					document.getElementById("title" + (orderNo)).style.color = "#000000";
					document.getElementById("title" + (orderNo)).style.textDecoration = "none";
					document.getElementById("title" + (orderNo)).style.cursor = "default";

					if(g_BrowserKind == 1){
					// IE
						document.getElementById("title" + (orderNo+1)).setAttribute('onclick',new Function("Java_OpenArticleDataDetail(" + document.all("rec_key" + (orderNo+1)).value + ");"));
					}else{
					// FireFox, Netscape
						document.getElementById("title" + (orderNo+1)).setAttribute('onclick',"Java_OpenArticleDataDetail(" + document.all("rec_key" + (orderNo+1)).value + ");");
					}
					document.getElementById("title" + (orderNo+1)).style.color = "#0000ff";
					document.getElementById("title" + (orderNo+1)).style.textDecoration = "underline";
					document.getElementById("title" + (orderNo+1)).style.cursor = "pointer";
				}else{
					if(g_BrowserKind == 1){
					// IE
						document.getElementById("title" + (orderNo)).setAttribute('onclick',new Function("Java_OpenArticleDataDetail(" + document.all("rec_key" + (orderNo)).value + ");"));
						document.getElementById("title" + (orderNo+1)).setAttribute('onclick',new Function("Java_OpenArticleDataDetail(" + document.all("rec_key" + (orderNo+1)).value + ");"));
					}else{
					// FireFox, Netscape
						document.getElementById("title" + (orderNo)).setAttribute('onclick',"Java_OpenArticleDataDetail(" + document.all("rec_key" + (orderNo)).value + ");");
						document.getElementById("title" + (orderNo+1)).setAttribute('onclick',"Java_OpenArticleDataDetail(" + document.all("rec_key" + (orderNo+1)).value + ");");
					}
					document.getElementById("title" + (orderNo)).style.color = "#0000ff";
					document.getElementById("title" + (orderNo)).style.textDecoration = "underline";
					document.getElementById("title" + (orderNo)).style.cursor = "pointer";
					document.getElementById("title" + (orderNo+1)).style.color = "#0000ff";
					document.getElementById("title" + (orderNo+1)).style.textDecoration = "underline";
					document.getElementById("title" + (orderNo+1)).style.cursor = "pointer";
				}
			}
		}
	}else{
		if(document.all || document.getElementById){
			if(document.all){
				tmpTitle = document.all("title" + orderNo).value;
				tmpKey = document.all("rec_key" + orderNo).value;
				document.all("title" + orderNo).value = document.all("title" + (orderNo-1)).value;
				document.all("rec_key" + orderNo).value = document.all("rec_key" + (orderNo-1)).value;
				document.all("title" + (orderNo-1)).value = tmpTitle;
				document.all("rec_key" + (orderNo-1)).value = tmpKey;
			} else {
				tmpTitle = document.getElementById("title" + orderNo).value;
				tmpKey = document.getElementById("rec_key" + orderNo).value;
				document.getElementById("title" + orderNo).value = document.getElementById("title" + (orderNo-1)).value;
				document.getElementById("rec_key" + orderNo).value = document.getElementById("rec_key" + (orderNo-1)).value;
				document.getElementById("title" + (orderNo-1)).value = tmpTitle;
				document.getElementById("rec_key" + (orderNo-1)).value = tmpKey;
			}

			if(document.all("rec_key" + (orderNo-1)).value == unlinkno){
				document.getElementById("title" + (orderNo-1)).setAttribute('onclick','');
				document.getElementById("title" + (orderNo-1)).style.color = "#000000";
				document.getElementById("title" + (orderNo-1)).style.textDecoration = "none";
				document.getElementById("title" + (orderNo-1)).style.cursor = "none";

				if(g_BrowserKind == 1){
				// IE
					document.getElementById("title" + (orderNo)).setAttribute('onclick',new Function("Java_OpenArticleDataDetail(" + document.all("rec_key" + (orderNo)).value + ");"));
				}else{
				// FireFox, Netscape
					document.getElementById("title" + (orderNo)).setAttribute('onclick',"Java_OpenArticleDataDetail(" + document.all("rec_key" + (orderNo)).value + ");");
				}
				document.getElementById("title" + (orderNo)).style.color = "#0000ff";
				document.getElementById("title" + (orderNo)).style.textDecoration = "underline";
				document.getElementById("title" + (orderNo)).style.cursor = "pointer";
			}else{
				if(document.all("rec_key" + (orderNo)).value == unlinkno){
					document.getElementById("title" + (orderNo)).setAttribute('onclick','');
					document.getElementById("title" + (orderNo)).style.color = "#000000";
					document.getElementById("title" + (orderNo)).style.textDecoration = "none";
					document.getElementById("title" + (orderNo)).style.cursor = "none";

					if(g_BrowserKind == 1){
					// IE
						document.getElementById("title" + (orderNo-1)).setAttribute('onclick',new Function("Java_OpenArticleDataDetail(" + document.all("rec_key" + (orderNo-1)).value + ");"));
					}else{
					// FireFox, Netscape
						document.getElementById("title" + (orderNo-1)).setAttribute('onclick',"Java_OpenArticleDataDetail(" + document.all("rec_key" + (orderNo-1)).value + ");");
					}
					document.getElementById("title" + (orderNo-1)).style.color = "#0000ff";
					document.getElementById("title" + (orderNo-1)).style.textDecoration = "underline";
					document.getElementById("title" + (orderNo-1)).style.cursor = "pointer";
				}else{
					if(g_BrowserKind == 1){
					// IE
						document.getElementById("title" + (orderNo)).setAttribute('onclick',new Function("Java_OpenArticleDataDetail(" + document.all("rec_key" + (orderNo)).value + ");"));
						document.getElementById("title" + (orderNo-1)).setAttribute('onclick',new Function("Java_OpenArticleDataDetail(" + document.all("rec_key" + (orderNo-1)).value + ");"));
					}else{
					// FireFox, Netscape
						document.getElementById("title" + (orderNo)).setAttribute('onclick',"Java_OpenArticleDataDetail(" + document.all("rec_key" + (orderNo)).value + ");");
						document.getElementById("title" + (orderNo-1)).setAttribute('onclick',"Java_OpenArticleDataDetail(" + document.all("rec_key" + (orderNo-1)).value + ");");
					}
					document.getElementById("title" + (orderNo)).style.color = "#0000ff";
					document.getElementById("title" + (orderNo)).style.textDecoration = "underline";
					document.getElementById("title" + (orderNo)).style.cursor = "pointer";
					document.getElementById("title" + (orderNo-1)).style.color = "#0000ff";
					document.getElementById("title" + (orderNo-1)).style.textDecoration = "underline";
					document.getElementById("title" + (orderNo-1)).style.cursor = "pointer";
				}
			}
		}
	}
}

//*********************************************************************
// @(f)
// 機能      : 表示順を確定するかの確認
// 引き数    : なし
// 返り値    : なし
// 機能説明  : 物件管理-物件情報一覧
// 備考      :
//*********************************************************************
function Java_CheckBknOrder(){

	if(confirm("表示順を登録します。\nよろしいですか？")){
		return true;
	}else{
		return false;
	}

}

//*********************************************************************
// @(f)
// 機能      : 物件のデータ詳細を開く
// 引き数    : ARG-1[h_maiidx]:データのインデックス
// 返り値    : なし
// 機能説明  : 物件管理-物件一覧
// 備考      :
//*********************************************************************
function Java_OpenArticleDataDetail(h_maiidx){

	var a_doc = document.frmInput;

//	document.location.href="bkn-edit.php?h_maiidx=" + h_maiidx;
	document.location.href="krsb_admin.php?MENU=11&SMNU1=43&SMNU2=UPDATE&h_maiidx=" + h_maiidx;

}

//*********************************************************************
// @(f)
// 機能      : 削除ボタン押下時の処理
// 引き数    : ARG-1:[h_mno]区分
// 　　　    : ARG-2:[h_msub]実行区分
// 　　　    : ARG-3:[h_idx]削除対象インデックス
// 返り値    : なし
// 機能説明  : 削除ボタン押下時の処理
// 備考      :
//*********************************************************************
function Java_Delete(h_mno, h_msub, h_idx){
//alert("h_mno=" + h_mno + " h_msub=" + h_msub);

	var a_doc = document.frmInput;
//alert("h_mno=" + h_mno);
//alert("h_msub=" + h_msub);
//alert("h_idx=" + h_idx);

	if(confirm("データを削除します。\nよろしいですか？") == true){
		// 物件情報一覧へ戻る
//		a_doc.action="data_exec.php?mno=" + h_mno + "&h_msub=" + h_msub + "&h_eno=" + h_idx;
		a_doc.action="krsb_admin.php?MENU=11&SMNU1=43&SMNU2=3&mno=" + h_mno + "&h_msub=" + h_msub + "&h_eno=" + h_idx;

//alert("mno=" + a_mno + " msub=" + h_msub);
		a_doc.hdnMySave.value = "3";
		a_doc.submit();
	}else{
		return false;
	}

}

//*********************************************************************
// @(f)
// 機能      : 物件ナビ一覧のコンボ選択時の絞込みを行う
// 引き数    : 
// 　　　    : 
// 　　　    : 
// 返り値    : なし
// 機能説明  : コンボ選択時の絞込みを行う
// 備考      :
//*********************************************************************
function Java_BknnviCnbChange(){

	var a_doc = document.frmInput;
//alert("コンボ選択");
//	a_doc.action="krsb_admin.php?MENU=11&SMNU1=43&SMNU2=3&mno=" + h_mno + "&h_msub=" + h_msub + "&h_eno=" + h_idx;
//	a_doc.hdnMySave.value = "3";
	a_doc.submit();
}



