//送信フラグ
send_flag=false;

/**
 * 二重サブミット防止<p>
 */
function send(){
	//送信フラグがtrue（二回目以降のサブミット）のときは、falseを戻す
	if(send_flag) {
		alert("送信済みです");
		//falseを戻すことにより、サブミットが無効になる
		return false;
	}

	//一回目のサブミット時は、送信フラグをtrueに設定する
	send_flag=true;

	//trueを戻すことにより、サブミットが成立する
	return true;
}

/**
 * 二重サブミット防止(英語)<p>
 */
function sendE(){
	//送信フラグがtrue（二回目以降のサブミット）のときは、falseを戻す
	if(send_flag) {
		alert("The following data has already been sent.");
		//falseを戻すことにより、サブミットが無効になる
		return false;
	}

	//一回目のサブミット時は、送信フラグをtrueに設定する
	send_flag=true;

	//trueを戻すことにより、サブミットが成立する
	return true;
}

/**
 * 必須入力エラー処理<p>
 * @param objNm 項目名
 * @param obj 項目
 */
function inNotNullErr(objNm,obj){
	alert(objNm+'が未入力です。');
	obj.focus();
}

function inNotNullErrE(objNm,obj){
	alert(objNm+' is Non-input');
	obj.focus();
}

/**
 * 空白除去<p>
 * @param str 変換元文字列
 * @return    変換後文字列
 */
function trim(str){
  str = lTrim(str); //行頭空白
  str = rTrim(str); //行頭空白
  return str;
}

/**
 * 行頭空白除去<p>
 * @param str 変換元文字列
 * @return    変換後文字列
 */
function lTrim(str){
  str = str.replace(RegExp("^ *"),"");  //行頭空白
  return str;
}

/**
 * 行末空白除去<p>
 * @param str 変換元文字列
 * @return    変換後文字列
 */
function rTrim(str){
  str = str.replace(RegExp(" *$"),"");  //行末空白
  return str;
}

/* リストの展開                  */
function switchList(id) {
	//非表示→表示
	if(id.style.display == "none"){
		id.style.display = "";
	//表示→非表示
	}else{
		id.style.display = "none";
	}
	window.event.cancelBubble = true;
}

/* エラーメッセージのクリア    */
function msgClear() {
	if (window.parent.FrameMsg.MsgArea != null) {
    	window.parent.FrameMsg.MsgArea.MsgCD[0].value = "";
    	window.parent.FrameMsg.MsgArea.MsgCD[1].value = "";
	}
}

/* リストＢｏｘからのＬｉｎｋ    */
function link(selmenu){
	
    if(selmenu == "AAHM0000") {
       top.location.href = "AAHM0000.jsp"
       top.FrameMain.location.href = "Main.jsp?uji.verb=cmdMainStartup&uji.bean=com.seibu.bean.as.AAHM0000InfBean";
    } 
    if(selmenu == "AAHM0010") {
       self.location.href = "AAHM0010.jsp";
       top.FrameMain.location.href = "Main.jsp?uji.verb=cmdMainStartup&uji.bean=com.seibu.bean.as.AAHM0000InfBean";
    } 
    if(selmenu == "AAHM0020") {
       self.location.href = "AAHM0020.jsp";
       top.FrameMain.location.href = "Main.jsp?uji.verb=cmdMainStartup&uji.bean=com.seibu.bean.as.AAHM0000InfBean";
    } 
    if(selmenu == "AAHM0030") {
       self.location.href = "AAHM0030.jsp";
       top.FrameMain.location.href = "Main.jsp?uji.verb=cmdMainStartup&uji.bean=com.seibu.bean.as.AAHM0000InfBean";
    } 
    if(selmenu == "AAHM0040") {
       self.location.href = "AAHM0040.jsp";
       top.FrameMain.location.href = "Main.jsp?uji.verb=cmdMainStartup&uji.bean=com.seibu.bean.as.AAHM0000InfBean";
    } 
    if(selmenu == "AAHM0050") {
       self.location.href = "AAHM0050.jsp";
       top.FrameMain.location.href = "Main.jsp?uji.verb=cmdMainStartup&uji.bean=com.seibu.bean.as.AAHM0000InfBean";
    } 
    if(selmenu == "AAHM0060") {
       self.location.href = "AAHM0060.jsp";
       top.FrameMain.location.href = "Main.jsp?uji.verb=cmdMainStartup&uji.bean=com.seibu.bean.as.AAHM0000InfBean";
    } 
    if(selmenu == "AAHM0100") {
       self.location.href = "AAHM0100.jsp";
       top.FrameMain.location.href = "Main.jsp?uji.verb=cmdMainStartup&uji.bean=com.seibu.bean.as.AAHM0000InfBean";
    } 
    if(selmenu == "AAHM0110") {
       self.location.href = "AAHM0110.jsp";
       top.FrameMain.location.href = "Main.jsp?uji.verb=cmdMainStartup&uji.bean=com.seibu.bean.as.AAHM0000InfBean";
    } 
    if(selmenu == "AAHM0120") {
       self.location.href = "AAHM0120.jsp";
       top.FrameMain.location.href = "Main.jsp?uji.verb=cmdMainStartup&uji.bean=com.seibu.bean.as.AAHM0000InfBean";
    } 
    if(selmenu == "AAHM0130") {
       self.location.href = "AAHM0130.jsp";
       top.FrameMain.location.href = "Main.jsp?uji.verb=cmdMainStartup&uji.bean=com.seibu.bean.as.AAHM0000InfBean";
    } 
    if(selmenu == "AAHM0800") {
       self.location.href = "AAHM0800.jsp";
       top.FrameMain.location.href = "Main.jsp?uji.verb=cmdMainStartup&uji.bean=com.seibu.bean.as.AAHM0000InfBean";
    } 
    if(selmenu == "AAHM0900") {
       self.location.href = "AAHM0900.jsp";
       top.FrameMain.location.href = "Main.jsp?uji.verb=cmdMainStartup&uji.bean=com.seibu.bean.as.AAHM0000InfBean";
    } 
    if(selmenu == "AAHM8000") {
       self.location.href = "AAHM8000.jsp";
       top.FrameMain.location.href = "Main.jsp?uji.verb=cmdMainStartup&uji.bean=com.seibu.bean.as.AAHM0000InfBean";
    } 
/**　2010.11.08 J.Sakamoto START 国際ＳＰ廃止に伴う修正 **/
/**    if(selmenu == "AAHM9000") {
       self.location.href = "AAHM9000.jsp";
       top.FrameMain.location.href = "Main.jsp?uji.verb=cmdMainStartup&uji.bean=com.seibu.bean.as.AAHM0000InfBean";
    }
**/ 
/**　2010.11.08 J.Sakamoto END 国際ＳＰ廃止に伴う修正 **/
    if(selmenu == "home") {
       top.location.href = "Main.jsp"
    } 
  }

/**
 * システムメニューのログインチェック<p>
 */
function loginCheck(userID, password) {
    var USER_ID = "seibu";
    var PASS_WD = "seibu";
	if (userID != USER_ID || password != PASS_WD) {
		alert("認証に失敗しました");
		return false;
	}
	return true;
}

/**
 * 入力者権限のチェック<p>
 */
function authorityCheck( gamenID ) {
	top.FrameMain.location.href = "Main.jsp?uji.verb=AAHP0010_start&uji.bean=com.seibu.bean.as.AAHP0010Bean&strNextId=" + gamenID;
}

