<!--

var T_SUBMENU = "subMenu";
var nw="";

//--------------------------------------
// Forward
//--------------------------------------
function onForward(ac){
	var theForm = document.forms[0];

	theForm.target = "_self";
	theForm.action = ac;
	theForm.method = "POST";
	theForm.submit();
}

//--------------------------------------
// Refine
//--------------------------------------
function onRefine(ac){
	var theForm = document.forms[0];
	//result(FLUG for download)
	if (theForm.downloadFlg) {
		if (theForm.downloadFlg.value=="true") {

			var confirmMsg = "As the search conditions will change, the download list will be cleared. Proceed with the change?";
			if (theForm.locale.value == "ja") {
				confirmMsg = "検索条件が変わる為、ダウンロードリストをクリアします。よろしいですか？";
			}

			if(!confirm(confirmMsg)){
				return;
			}
		}
	}
	theForm.target = "_self";
	theForm.action = ac;
	theForm.method = "POST";
	theForm.submit();
}

//--------------------------------------
//子ウインドウを開く
//-------------------------------------- 
function open_Window(URL, TARGET, OPTION) {
	nw = window.open(URL, TARGET, OPTION);
	nw.focus();
}

//--------------------------------------
// DDBJ HELPのオープン
//--------------------------------------
function openHelp(url){
	var WIN_OPTION = "scrollbars=1, status=1, top=5, left=100, width=900, height=650, resizable=1";
	open_Window(url, "help", WIN_OPTION);
}



//--------------------------------------------
// ワンポイントヘルプのオープン
//--------------------------------------------
function openOnePointHelp(url){
	var WIN_OPTION = "scrollbars=1, status=1, top=5, left=200, width=680, height=620, resizable=1";
	open_Window(url, "onepointhelp", WIN_OPTION);
}

//--------------------------------------------
// UpdateInfoのオープン
//--------------------------------------------
function openUpdateInfo(ac) {
	var WIN_OPTION = "scrollbars=1, status=1, top=5, left=200, width=800, height=620, resizable=1";
	open_Window(ac, "updateinfo", WIN_OPTION);
}


//--------------------------------------
// TSV Download
//--------------------------------------
function downloadTsv() {
	var theForm = document.forms[0];
	theForm.target = "_self";
	theForm.action = "CsvDownload";
	theForm.submit();
}

//--------------------------------------
// "AddtoDownloadList"メニューのオープン
//--------------------------------------
function openDownloadMenu(){

	var accNumList = getCheckboxValue();
	var filetype = getDownFileTypeValue(); 

	if ( filetype == "" ) {
		filetype = "flatfile";
	}

	// 判定フラグ
	var theForm = document.forms[0];
	theForm.downloadFlg.value="true";

	document.forms[0].accNumber.value = accNumList;
	document.forms[0].DownType.value = filetype;
		
	var WIN_OPTION = "scrollbars=1, status=1, top=5, left=200, width=800, height=630, resizable=1";
	nw = window.open("", T_SUBMENU, WIN_OPTION);
	nw.focus(); 

	document.forms[0].target = T_SUBMENU;
	document.forms[0].action = "DownloadItemView";
	document.forms[0].method = "POST";
	document.forms[0].submit();
}

//--------------------------------------
// "DownloadList"メニューのオープン
//--------------------------------------
function openDownLoad(){
	var WIN_OPTION = "scrollbars=1, status=1, top=5, left=200, width=800, height=630, resizable=1";
	nw = window.open("", T_SUBMENU, WIN_OPTION);
	nw.focus(); 
	document.forms[0].target = T_SUBMENU;
	document.forms[0].action = "DownloadView?";
	document.forms[0].method = "POST";
	document.forms[0].submit();
	
}

//--------------------------------------
// Qualifier
//--------------------------------------
function openQualifierView(url){ 	
	var URL_Target = url; 
	var WIN_OPTION = "scrollbars=1, status=1, top=5, left=300, width=780, height=650, resizable=1";
	
	open_Window(URL_Target, T_SUBMENU, WIN_OPTION);
}

function openQualifier(url, key){ 	
	var URL_Target = url; 
	var WIN_OPTION = "scrollbars=1, status=1, top=5, left=300, width=780, height=650, resizable=1";
	
	url = URL_Target;
	if (key != '') {
		url += "?key="
		url += key;
	}
	
	open_Window(url, T_SUBMENU, WIN_OPTION);
}

function onQualifierForward(ac, key){
	var theForm = document.forms[0];
	theForm.action = ac + "?key=" + key;
	theForm.method = "POST";
	theForm.submit();
}

//--------------------------------------
//TabMenu
//--------------------------------------
function moveTabMenu(url){
	var theForm = document.forms[0];
	
	//result(FLUG for download)
	if (theForm.downloadFlg) {
		if (theForm.downloadFlg.value=="true") {

			var confirmMsg = "As the search conditions will change, the download list will be cleared. Proceed with the change?";
			if (theForm.locale.value == "ja") {
				confirmMsg = "検索条件が変わる為、ダウンロードリストをクリアします。よろしいですか？";
			}

			if(!confirm(confirmMsg)){
				return;
			}
		}
	}
	
	//result(FLUG for Refine)
	if (theForm.key) {
		theForm.key.value = "";
	}

	theForm.target = "_self";
	theForm.action = url;
	theForm.method = "POST";
	theForm.submit();
}

//--------------------------------------
//ARSA_Logo
//--------------------------------------
function moveLinkMenu(url){
	var theForm = document.forms[0];
	var sessDelFlg = "";
	//result(FLUG for download)
	if (theForm.downloadFlg) {
		if (theForm.downloadFlg.value=="true") {

			var confirmMsg = "As the search conditions will change, the download list will be cleared. Proceed with the change?";
			if (theForm.locale.value == "ja") {
				confirmMsg = "検索条件が変わる為、ダウンロードリストをクリアします。よろしいですか？";
			}

			if(!confirm(confirmMsg)){
				return;
			}
		}
	}
	theForm.target = "_self";
	theForm.action = url;
	theForm.submit();
}

//--------------------------------------
// Viewリンク
//--------------------------------------
function detailLink(accnumber) {
	var theForm = document.forms[0];
	theForm.mode.value = "";
	theForm.accNumber.value = accnumber;
	var WIN_OPTION = "scrollbars=1, status=1, top=5, left=150, width=850, height=600, resizable=1";
	nw = window.open("", getCacheParam(), WIN_OPTION);
	nw.focus();

	document.forms[0].target = nw.name;
	document.forms[0].action = "ViewSearchSystem";
	document.forms[0].method = "POST";
	document.forms[0].submit();

}

//--------------------------------------
// Your Commentsのオープン
//--------------------------------------
function openYourComments(ac){
	var WIN_OPTION = "scrollbars=1, status=1, top=5, left=250, width=750, height=620, resizable=1";
	open_Window(ac, T_SUBMENU, WIN_OPTION);
}

//------------------------------------------
// Viewボタン
//------------------------------------------
function openDetailMenu() {
	
	var theForm = document.forms[0];
	theForm.accNumber.value = getAccNumber();
	theForm.mode.value = "view";
	
	var WIN_OPTION = "scrollbars=1, status=1, top=5, left=150, width=850, height=600, resizable=1";
	nw = window.open("", T_SUBMENU, WIN_OPTION);
	nw.focus();

	document.forms[0].target = T_SUBMENU;
	document.forms[0].action = "ViewSearchSystem";
	document.forms[0].method = "POST";
	document.forms[0].submit();

}

//-->