//*************************************************************
// システム名     電子入札物品コアシステム
// サブシステム名 電子入札・開札システム
//
// 紙入札移行情報入力機能
// @author NEC
// @version 1.0, 2003.01.15, 新規作成<BR>
//          1.1, 2003.06.14, V3-総合-183対応<BR>
//          1.2, 2003.06.14, V3-総合-189対応<BR>
//          1.3, 2003.06.17, V3-結合-026対応<BR>
//          1.4, 2003.06.17, V3-総合-213対応<BR>
//          1.5, 2003.06.18, V3-結合-032対応<BR>
//          3.1, 2003.10.20, V3.1-総合-016対応<BR>
//          3.1, 2003.10.30, V3.1-総合-060対応<BR>
//          4.0, 2004.01.30, V4.0複数落札対応<BR>
//          4.0, 2004.02.25, V4-統合-012対応<BR>
//*************************************************************
var updateIndex;

//--------------------------------------------------
// HTML読込み時の初期処理
//--------------------------------------------------
function onStart()
{
  // 読込み時共通処理
  onLoad();

  // 予定価格表示処理
  showPlannedPrice();

  // 複数落札方式なら
  if (plural == true) {
    // 落札数量表示
    showAmountValue();
  }
}//onStart

//--------------------------------------------------
// 調達案件情報照会画面表示
//--------------------------------------------------
function showProjectInfo()
{
  dispatchPopup( document.formRegist, "H509HPR005" );
}//showProjectInfo

//--------------------------------------------------
// 予定価格入力画面表示
//--------------------------------------------------
function onPlannedPrice()
{
  var form=createSubmitForm( 'H631HPC002' );

  if( form!=null )
  {
    addParam( form, "processType", "5" );
    request();
  }
}//onPlannedPrice

//--------------------------------------------------
// 紙入札情報の削除
//--------------------------------------------------
function onDelete( srcElement )
{
  if( !setCommandFormObj( document.formRegist ) )
    return;

  try
  {
    if( !confirm('削除しますか？') )
      return;

    var deleteForm= document.formEdit.tagName=="FORM";// Netscape用処理

    var srcTR=getParent( srcElement, "TR" );
    var rowIndex=srcTR.rowIndex;
    srcTR.parentNode.deleteRow( rowIndex );

    if( deleteForm && document.formEdit ) delete document.formEdit;// Netscape用処理

    // No.再割当て
    for( var i=rowIndex-1, cnt=getEditDataCount() ; i<cnt ; )
    {
      getParent( getEditData(i), "TR" ).cells[0].innerHTML=String(++i);
    }
  }
  finally{
    resetCommandFormObj();
  }
}//onDelete

//--------------------------------------------------
// 親ノードを取得する
//--------------------------------------------------
function getParent( o, tagName )
{
  for( ; o!=typeof(undefined) ; o=o.parentNode )
    if( tagName==o.tagName )
      return o;

  return null;
}//getParent

//--------------------------------------------------
// 編集データ数を取得する
//--------------------------------------------------
function getEditDataCount()
{
  if( !document.formEdit )
    return 0;

  if( "FORM"==document.formEdit.tagName )
    return 1;

  return document.formEdit.length;
}//getEditDataCount

//--------------------------------------------------
// 編集データを取得する
//--------------------------------------------------
function getEditData( idx )
{
  return document.formEdit.tagName=="FORM" ? document.formEdit : document.formEdit[idx];
}//getEditData

//--------------------------------------------------
// 執行回数を+1する
//--------------------------------------------------
function onNext()
{
  for( var i=0 ; i<document.formEditResult.bidResultNumber.length ; i++ )
  {
    if( document.formEditResult.bidResultNumber[i].checked )
    {
      var form=createSubmitForm( 'H6321HPC003' );

      if( form!=null )
      {
        // 更新要求
        addParam( form, "processType", "2" );

        request();
      }

      return;
    }
  }

  alert('落札判定結果を選択して下さい');
}//onNext

//--------------------------------------------------
// 紙入札移行情報登録内容確認画面を表示する
//--------------------------------------------------
function onRegist()
{
  for( var i=0 ; i<document.formEditResult.bidResultNumber.length ; i++ )
  {
    if( document.formEditResult.bidResultNumber[i].checked )
    {
      var form=createSubmitForm( 'H633HPC004' );

      if( form!=null )
      {
        // 更新要求
        request();
      }

      return;
    }
  }

  alert("落札判定結果を選択して下さい");
}//onRegist

//-------------------------------------------------------------
// クリアボタン押下時処理
//-------------------------------------------------------------
function onClear()
{
  document.formSearch.searchCompanyNumber.value="";
  document.formSearch.searchCompanyName.value="";
  document.formSearch.searchCompanyTelephone.value="";
  document.formSearch.searchCompanyAddress.value="";
  document.formSearch.searchCompanyNumber.focus();
}//onClear

//-------------------------------------------------------------
// 検索ボタン押下時処理
//-------------------------------------------------------------
function onSearch()
{
  var errmsg="";
  
  // 要求処理初期設定
  if( !prepareDispatch( document.formRegist, 'H6322HPC003' ) )
    return;

  //検索企業IDの入力チェック
  if( !checkId( document.formSearch.searchCompanyNumber.value ) )
    errmsg+="検索企業IDは半角数字で入力してください\n";

  //検索代表者電話番号の入力チェック
  if( !checkTelephone( document.formSearch.searchCompanyTelephone.value ) )
    errmsg+="検索代表者電話番号は半角数字で入力してください\n";
  
  if( errmsg!="" )
  {
    alert( errmsg );
    resetCommandFormObj();
    return;
  }

  // ポップアップ検索要求処理呼出し
  callSubmitCall( 'submitCallPopUpSearch' );
}//onSearch

//-------------------------------------------------------------
// ポップアップ検索要求処理
//-------------------------------------------------------------
function submitCallPopUpSearch()
{
  doSubmit();

  // 選択可能な業者番号
  var limit="";
  var prefix="companyNumber_"+String(editExecuteCount-1)+"_";
  var prefix_decline="declineFlag_"+String(editExecuteCount-1)+"_";
  var prefix_invalid="invalidFlag_"+String(editExecuteCount-1)+"_";
  var prefix_success="successfulBidFlag_"+String(editExecuteCount-1)+"_";

  for( var i=0 ; ; i++ )
  {
    var input=document.formHidden[prefix+String(i)];

    if( !input )
      break;

    // 辞退、無効、落札業者は選択不可能
    if( "1"==document.formHidden[prefix_decline+String(i)].value || 
        "1"==document.formHidden[prefix_invalid+String(i)].value ||
        "1"==document.formHidden[prefix_success+String(i)].value )
      continue;

    if( limit!="" )
      limit+=","+input.value;
    else
      limit=input.value;
  }

  // 選択不可能な業者番号
  var unavailable="";

  for( var i=0, cnt=getEditDataCount() ; i<cnt ; i++ )
  {
    var data=getEditData(i);

    if( unavailable!="" )
      unavailable+=","+data.companyNumber.value;
    else
      unavailable=data.companyNumber.value;
  }

  // ポップアップウィンドウ作成
  createPopupWindow( 
    800, 570,

    // init
     "document.formRequest.searchCompanyNumber.value=opener.top.wpMain.document.formSearch.searchCompanyNumber.value;"
    +"document.formRequest.searchCompanyName.value=opener.top.wpMain.document.formSearch.searchCompanyName.value;"
    +"document.formRequest.searchCompanyTelephone.value=opener.top.wpMain.document.formSearch.searchCompanyTelephone.value;"
    +"document.formRequest.searchCompanyAddress.value=opener.top.wpMain.document.formSearch.searchCompanyAddress.value;"
    +"submitCall();",

    // params
     getStdParams()
    +"<INPUT type='hidden' name='estimate' value='" + estimate + "'>"
    +"<INPUT type='hidden' name='plural' value='" + plural + "'>"
    +"<INPUT type='hidden' name='generalEstimation' value='" + generalEstimation + "'>"
    +"<INPUT type='hidden' name='editExecuteCount' value='" + editExecuteCount + "'>"
    +"<INPUT type='hidden' name='withoutDecline' value='" + withoutDecline + "'>"
    +"<INPUT type='hidden' name='searchCompanyNumber'>"
    +"<INPUT type='hidden' name='searchCompanyName'>"
    +"<INPUT type='hidden' name='searchCompanyTelephone'>"
    +"<INPUT type='hidden' name='searchCompanyAddress'>"
    +"<INPUT type='hidden' name='limit' value='" + limit + "'>"
    +"<INPUT type='hidden' name='unavailable' value='" + unavailable + "'>"
  );

  //NN対策
  focusSubWindow();

}//submitCallPopUpSearch

//-------------------------------------------------------------
// 開き元が現在、紙入札移行情報入力画面か判断する
//-------------------------------------------------------------
function isValidOpener()
{
  return opener && opener.top && opener.top.wpMain && opener.top.wpMain.document.common && "HPC003"==opener.top.wpMain.getScreenID() ? true : false;
}//isValidOpener

//-------------------------------------------------------------
// 紙入札情報入力画面初期処理
//-------------------------------------------------------------
function onInputStart()
{
  // 通信中ダイアログを閉じる
  if( document.common )
  {
    onLoadPopup();
  }
  else
  {
    opener.top.wpMain.closeSubWindow();
    opener.top.wpMain.resetCommandFormObj();
  }

  // 金額入力フィールドにイベントを設定
  if( document.formRegist )
  {
    setPriceTextEvent(
      document.formRegist.bidPrice,
      document.formRegist.bidPriceJp,
      document.formRegist.bidPriceComma );

    document.formRegist.bidPrice.focus();
  }

  // 複数落札時初期処理
  if( document.formRegist && document.formRegist.bidAmount )
  {
    // 金額のMaxlength変化
    document.formRegist.bidPrice.maxLength = DEF_BID_PLURAL_LENGTH;

    // 残数量セット(親画面より取得し表示)
    document.formRegist.goodsAmountRestDisp.value = "（" + Number(opener.top.wpMain.document.formHPC003.goodsAmountRest.value) + "）";
  }

}//onInputStart

//-------------------------------------------------------------
// 紙入札情報追加処理(追加ボタン押下時処理)
//-------------------------------------------------------------
function onInsert()
{
  if( checkInputBidData() && isValidOpener() )
  {
    opener.top.wpMain.dispatchInsertRequest( document.formRegist );

    window.close();
  }
}//onInsert

//-------------------------------------------------------------
// 紙入札情報追加要求処理
//-------------------------------------------------------------
function dispatchInsertRequest( input )
{
  var form=createSubmitForm('H6321HPC003');

  if( form==null )
    return;

  addParam( form, "inputCompanyNumber", input.companyNumber.value );
  addParam( form, "inputCompanyName"  , input.companyName.value );
  addParam( form, "inputBidPrice"     , checkNumberDecimal( input.bidPrice.value ) ? input.bidPrice.value : "" );

  if( input.bidAmount )
    addParam( form, "inputBidAmount", checkNumber( input.bidAmount.value ) ? input.bidAmount.value : "" );

  if( input.successfulBidAmount )
    addParam( form, "inputSuccessfulBidAmount", checkNumber( input.successfulBidAmount.value ) ? input.successfulBidAmount.value : "" );

  if( input.assessmentPoint )
    addParam( form, "inputAssessmentPoint", checkNumber( input.assessmentPoint.value ) ? input.assessmentPoint.value : "" );

  if( input.declineFlag && input.declineFlag.checked )
    addParam( form, "inputDeclineFlag", "1" );

  if( input.successfulBidFlag && input.successfulBidFlag.checked )
    addParam( form, "inputSuccessfulBidFlag", "1" );

  if( input.invalidFlag.checked )
    addParam( form, "inputInvalidFlag", "1" );

  // 追加要求
  addParam( form, "processType", "1" );

  request();
}//dispatchInsertRequest

//-------------------------------------------------------------
// 紙入札情報修正画面表示
//-------------------------------------------------------------
function showUpdate( srcElement )
{
  if( !setCommandFormObj(document.formHPC003) )
    return;

  updateIndex=getParent( srcElement, "TR" ).rowIndex-1;

  // 通信中ダイアログ表示
  openSubWindow();

  // ポップアップウィンドウ作成
  createPopupWindow( 
    800, 255, 

    // init
     "submitCall();",

    // params
     "<INPUT type='hidden' name='estimate' value='" + estimate + "'>"
    +"<INPUT type='hidden' name='plural' value='" + plural + "'>"
    +"<INPUT type='hidden' name='generalEstimation' value='" + generalEstimation + "'>"
    +"<INPUT type='hidden' name='editExecuteCount' value='" + editExecuteCount + "'>"
    +"<INPUT type='hidden' name='withoutDecline' value='" + withoutDecline + "'>",

    // action
    contextPath + "/ebidmlit/jsp/goods/HPC003/EbA1HPC003Update.jsp"
  );

  //NN対策
  focusSubWindow();

}//showUpdate

//-------------------------------------------------------------
// 紙入札情報修正画面初期処理
//-------------------------------------------------------------
function onUpdateStart()
{
  // 更新入札情報表示
  onInputStart();

  if( !showUpdateBidData() )
  {
    resetCommandFormObj();

    // 入力画面閉じる
    onInputClose();
  }
}//onUpdateStart

//-------------------------------------------------------------
// 更新入札情報表示
//-------------------------------------------------------------
function showUpdateBidData()
{
  // check if updateIndex is valid
  if( !isValidOpener() || opener.top.wpMain.getEditDataCount() <= opener.top.wpMain.updateIndex )
    return false;

  // show select data
  var src=opener.top.wpMain.getEditData( opener.top.wpMain.updateIndex );
  var dst=document.formRegist;

  setInputCompany( src.companyNumber.value, src.companyName.value );
  setPriceText( dst.bidPrice, src.bidPrice.value );

  if( src.bidAmount && dst.bidAmount )
    dst.bidAmount.value=src.bidAmount.value;

  if( src.successfulBidAmount && dst.successfulBidAmount )
    dst.successfulBidAmount.value=src.successfulBidAmount.value;

  if( src.assessmentPoint && dst.assessmentPoint )
    dst.assessmentPoint.value=src.assessmentPoint.value;

  if( src.declineFlag && dst.declineFlag )
    dst.declineFlag.checked= "1"==src.declineFlag.value;

  if( src.successfulBidFlag && dst.successfulBidFlag )
    dst.successfulBidFlag.checked= "1"==src.successfulBidFlag.value;

  if( src.invalidFlag && dst.invalidFlag )
    dst.invalidFlag.checked= "1"==src.invalidFlag.value;

  return true;
}//showUpdateBidData

//-------------------------------------------------------------
// 紙入札情報更新処理(入力画面用)
//-------------------------------------------------------------
function onUpdate()
{
  if( checkInputBidData() && isValidOpener() && setCommandFormObj( document.formRegist ) )
  {
    opener.top.wpMain.updateBidData( document.formRegist );
    window.close();
  }
}//onUpdate

//-------------------------------------------------------------
// 紙入札情報更新処理
//-------------------------------------------------------------
function updateBidData( src )
{
  for( var i=0, cnt=getEditDataCount() ; i<cnt ; i++ )
  {
    var dst=getEditData(i);

    if( dst.companyNumber.value==src.companyNumber.value )
    {
      // HIDDEN項目更新
      dst.bidPrice.value=checkNumberDecimal( src.bidPrice.value ) ? src.bidPrice.value : "";

      if( src.bidAmount && dst.bidAmount )
      {
        dst.bidAmount.value=checkNumber( src.bidAmount.value ) ? src.bidAmount.value : "";
      }

      if( src.successfulBidAmount && dst.successfulBidAmount )
      {
        dst.successfulBidAmount.value=checkNumber( src.successfulBidAmount.value ) ? src.successfulBidAmount.value : "";
        dst.successfulBidFlag.value= Number(dst.successfulBidAmount.value)>0 ? "1" : "0";
      }

      if( src.assessmentPoint && dst.assessmentPoint )
        dst.assessmentPoint.value=checkNumber( src.assessmentPoint.value ) ? src.assessmentPoint.value : "" ;

      if( src.declineFlag && dst.declineFlag )
        dst.declineFlag.value= src.declineFlag.checked ? "1" : "0";

      if( src.successfulBidFlag && dst.successfulBidFlag )
        dst.successfulBidFlag.value= src.successfulBidFlag.checked ? "1" : "0";

      if( src.invalidFlag && dst.invalidFlag )
        dst.invalidFlag.value= src.invalidFlag.checked ? "1" : "0";

      // 画面表示更新
      var form=createSubmitForm('H6321HPC003');

      if( form==null )
        return;

      // 表示処理要求
      addParam( form, "processType", "5" );

      request();

      return;
    }
  }

  resetCommandFormObj();
}//updateBidData

//-------------------------------------------------------------
// 紙入札情報入力チェック処理
//-------------------------------------------------------------
function checkInputBidData()
{
  // 業者が指定されている？
  if( document.formRegist.companyNumber.value=="" )
  {
    alert( "業者を指定して下さい." );
    return false;
  }

  // 辞退？
  if( document.formRegist.declineFlag && document.formRegist.declineFlag.checked )
    return true;// 辞退の場合はOK

  var errmsg="";
  var tenderOrEstimateName=document.formRegist.tenderOrEstimateName.value;
  var invalidFlag=false;
  
  //無効フラグの設定
  if( document.formRegist.invalidFlag && document.formRegist.invalidFlag.checked )
  {
    invalidFlag = true;
  }

  // 入札金額チェック
  if( document.formRegist.bidPrice.value=="")
  {
    if( invalidFlag )
    {
      // 無効の場合は未入力を可能とする
    }
    else
    {
      errmsg += tenderOrEstimateName+"金額が未入力です。" + tenderOrEstimateName+"金額を入力して下さい.\n";
    }
  }
  else if( Number( document.formRegist.bidPrice.value )<=0 )
  {
    errmsg+=tenderOrEstimateName+"金額には0より大きい値を入力して下さい.\n";
  }
  else if( document.formRegist.bidAmount )
  {
    // 複数落札の場合：桁数20
    if( document.formRegist.bidPrice.value.length > DEF_BID_PLURAL_LENGTH ){
      errmsg+=tenderOrEstimateName+"金額が長すぎます。" + DEF_BID_PLURAL_LENGTH + "桁以下で入力して下さい.\n";
    }
    else if( !checkNumberDecimal( document.formRegist.bidPrice.value ) ){
      errmsg+=tenderOrEstimateName + "金額が不正です。再入力してください.\n";
    }
    else if( !checkIntegerBidLengthDef(document.formRegist.bidPrice.value) ){
      errmsg+=tenderOrEstimateName + "金額には整数部" + DEF_BID_PLURAL_INTEGER_LENGTH + "桁までの値を入力して下さい.\n";
    }
    else if( !checkDecimalBidLengthDef(document.formRegist.bidPrice.value) ){
      errmsg+=tenderOrEstimateName + "金額には小数点第" + DEF_BID_PLURAL_DECIMAL_LENGTH + "位までの値を入力して下さい.\n";
    }
  }
  else
  {
    // 複数落札以外の場合
    if( document.formRegist.bidPrice.value.length > DEF_BID_NONPLURAL_LENGTH ){
      errmsg+=tenderOrEstimateName+"金額が長すぎます。" + DEF_BID_NONPLURAL_LENGTH + "桁以下で入力して下さい.\n";
    }
    // 複数落札以外の場合、整数かチェック
    else if( !checkNumber( document.formRegist.bidPrice.value ) ){
      errmsg+=tenderOrEstimateName+"金額が不正です。再入力してください.\n";
    }
  }

  // 入札数量チェック
  if( document.formRegist.bidAmount )
  {
    if( document.formRegist.bidAmount.value=="" )
    {
      if( invalidFlag )
      {
        // 無効の場合は未入力を可能とする
      }
      else
      {
        errmsg+=tenderOrEstimateName + "数量が未入力です。" + tenderOrEstimateName + "数量を入力して下さい.\n";
      }
    }
    else if( Number( document.formRegist.bidAmount.value )<=0 ){
      errmsg+=tenderOrEstimateName+"数量には0より大きい値を入力して下さい.\n";
    }
    else if( !checkNumber( document.formRegist.bidAmount.value ) ){
      errmsg+=tenderOrEstimateName+"数量が不正です。再入力して下さい.\n";
    }
    else if( Number(document.formRegist.bidAmount.value) > Number(opener.top.wpMain.document.formHPC003.goodsAmountRest.value) ){
      errmsg+=tenderOrEstimateName + "数量には" + opener.top.wpMain.document.formHPC003.goodsAmountRest.value + "以下の値を入力してください.\n";
    }
  }

  // 落札数量チェック
  if( document.formRegist.successfulBidAmount )
  {
    if( document.formRegist.successfulBidAmount.value!="" )
    {
      if( !checkNumber( document.formRegist.successfulBidAmount.value ) )
        errmsg+="落札数量が不正です。再入力して下さい.\n";
      else if( Number( document.formRegist.successfulBidAmount.value )>Number( document.formRegist.bidAmount.value ) )
        errmsg+="落札数量は" + tenderOrEstimateName + "数量より多くは設定できません.\n";
      else if( document.formRegist.invalidFlag && document.formRegist.invalidFlag.checked )
        errmsg+="落札者を無効に指定できません.\n";
    }
  }

  // 評価点チェック
  if( document.formRegist.assessmentPoint )
  {
    if( document.formRegist.assessmentPoint.value=="" )
    {
      if( invalidFlag )
      {
        // 無効の場合は未入力を可能とする
      }
      else
      {
        errmsg+="評価点を入力して下さい.\n";
      }
    }
    else if( !checkNumber( document.formRegist.assessmentPoint.value ) )
      errmsg+="評価点が不正です。再入力してください.\n";

    else if( Number( document.formRegist.assessmentPoint.value )<=0 )
      errmsg+="評価点には0より大きい値を入力して下さい.\n";

    else if( Number( document.formRegist.assessmentPoint.value ) > Number( opener.top.wpMain.document.formHidden.fullmarkPoint.value ) )
      errmsg+="評価点は評価点満点以下の整数を入力して下さい.\n";
  }

  if( errmsg!="" )
  {
    alert( errmsg );
    return false;
  }

  return true;
}//checkInputBidData

//-------------------------------------------------------------
// 紙入札情報入力企業情報設定
//-------------------------------------------------------------
function setInputCompany( companyNumber, companyName )
{
  document.getElementById("spanCompanyNumber").innerHTML=companyNumber;
  document.getElementById("spanCompanyName"  ).innerHTML=companyName;
  document.formRegist.companyNumber.value=companyNumber;
  document.formRegist.companyName  .value=companyName;
}//setInputCompany

//-------------------------------------------------------------
// 紙入札情報入力画面閉じる処理
//-------------------------------------------------------------
function onInputClose()
{
  window.close();
}//onInputClose

//-------------------------------------------------------------
// 紙入札情報送信用フォーム作成処理
//-------------------------------------------------------------
function createSubmitForm( next_id )
{
  if( commandFormObj!=null )
    return false;

  var form=document.formHPC003;
  commandFormObj=form;

  form.innerHTML="";

  addParam( form, "RandomRequestKey", "" );
  addParam( form, "omeBeforeRequestName", "" );
  addParam( form, "omeParameterID", "" );
  addParam( form, "clientKind", "" );
  addParam( form, "screenID", "" );
  addParam( form, "projectNumber", document.formRegist.projectNumber.value );
  addParam( form, "editExecuteCount", editExecuteCount );

  var inputBidResult='';

  // add not edit bid data and result
  var elements=document.formHidden.elements;

  for( var i=0 ; i<elements.length ; i++ )
  {
    var e=document.formHidden.elements[i];
    addParam( form, e.name, e.value );
  }

  // add input bid result
  var inputBidResult="";

  for( var i=0 ; i<document.formEditResult.bidResultNumber.length ; i++ )
  {
    if( document.formEditResult.bidResultNumber[i].checked )
    {
      inputBidResult=document.formEditResult.bidResultNumber[i].value;
      break;
    }
  }

  addParam( form, "bidResultNumber_"+String(editExecuteCount), inputBidResult );

  // add edit bid data
  for( var i=0, cnt=getEditDataCount() ; i<cnt ; i++ )
  {
    var src=getEditData(i);
    var prefix=String(editExecuteCount)+"_"+String(i);

    addParam( form, "companyNumber_"+prefix, src.companyNumber.value );
    addParam( form, "companyName_"  +prefix, src.companyName.value );
    addParam( form, "bidPrice_"     +prefix, src.bidPrice.value );

    if( plural )
    {
      addParam( form, "bidAmount_"          +prefix, src.bidAmount.value );
      addParam( form, "successfulBidAmount_"+prefix, src.successfulBidAmount.value );
    }
    else if( src.assessmentPoint )
    {
      addParam( form, "assessmentPoint_"+prefix, src.assessmentPoint.value );
    }

    addParam( form, "declineFlag_"      +prefix, src.declineFlag.value );
    addParam( form, "successfulBidFlag_"+prefix, src.successfulBidFlag.value );
    addParam( form, "invalidFlag_"      +prefix, src.invalidFlag.value );
  }

  commandFormObj=null;
  return prepareDispatch( form, next_id ) ? form : null;
}//createSubmitForm

//-------------------------------------------------------------
// フォームにパラメータを追加します
//-------------------------------------------------------------
function addParam( form, name, value )
{
  var input=document.createElement("INPUT");

  input.type ="hidden";
  input.name =name;
  input.value=value;

  form.appendChild(input);
  form[name]=input;
}//addParam

//-------------------------------------------------------------
// 落札数量表示処理
//-------------------------------------------------------------
function showAmountValue()
{
  var amount=0;

  var tmpEdtFrm;
  var tmpVal;
  for (var i = 0; i < getEditDataCount(); i++)
  {
    tmpEdtFrm = getEditData(i);
//    tmpVal = document.formRegist["successfulBidAmount_"+i].value
    tmpVal = tmpEdtFrm.successfulBidAmount.value;
    //数値以外の入力、マイナス値の入力、小数点の入力があった場合
    if (isNaN(tmpVal)
      || Number(tmpVal) < 0
      || tmpVal.indexOf('.') != -1) {
      //合計値を空に設定し計算終了
      amount = "";
      break;
    }
    //通常入力
    else {
//      amount += Number(document.formRegist["successfulBidAmount_"+i].value);
      amount += Number(tmpEdtFrm.successfulBidAmount.value);
    }
  }
  if( document.getElementById('totalAmount') )
  {
    document.getElementById('totalAmount').innerHTML=amount;
  }
}//showAmountValue
