/*
     $Revision$
     $Id$
*/

function BI(bikey, pkey, akey)
{
   this.bikey = bikey;
   this.pkey = pkey;
   this.akey = akey;
}

function checkInput(evt)
{
  evt = evt || window.event;
  var obj = evt.srcElement || evt.target;
  var val = obj.value;

  var i = obj.id.substring(3);
  var remaining = parseInt(document.getElementById('rem'+i).value,10);
  if( val == "" || val == 0 || (!isNaN(val) && isGoodNumber(val,true,false,-1,-1) &&
      ((remaining > 0 && parseInt(val,10) >= 0) || (remaining < 0 && parseInt(val,10) <= 0)))) {
    if( val == "" ) val = 0;
    if( (remaining > 0 && val > remaining) || (remaining < 0 && val < remaining) ){
        FcltMgr.alert(L("lcl_bes_exceed_value"),
                        { fnafterclose: function() {obj.focus();}
                        }
                     );
        return false;
    }
    return true;
  }
  else
  {
    FcltMgr.alert(L("lcl_bes_bad_value"),
                        { fnafterclose: function() {obj.focus();}
                        }
                 );

    return false;
  }
}

function complete()
{
 var cnt = document.u2.max_o_i.value;
 for (i = 0; i < cnt; i ++)
 {
   rem_value = document.u2['rem'+i].value;
   document.u2['cnt'+i].value = rem_value;
 }
}
