function addb(s_cec,s_exten,s_item,s_date,s_price_orig,s_status,i_minimum,i_increment,s_action)
{
if (s_action=="c")
  {
  var s_desc="&x="+document.getElementById("ta_cus_desc").value.trim();
  var o_qty=document.getElementById("t_cus_qty");
  s_price_orig=document.getElementById("t_cus_bbb_orig").value.trim();
  var o_bbb=document.getElementById("t_cus_bbb");
  var s_skid=document.getElementById("t_cus_skid").value;
  }
else
  {
  if (s_action=="a")
    {
    }
  else
    {
    var s_desc=""
    var o_qty=document.getElementById("t"+s_item+s_date+"qty");
    var o_bbb=document.getElementById("t"+s_item+s_date+"bbb");
    var s_skid=document.getElementById("t"+s_item+s_date+"skid").value;
    };
  };


var s_qty=o_qty.value.trim();
if (s_qty=="")
  {
  s_qty="x";
  }
else
  {
  if (s_qty==parseInt(s_qty))
    {
    s_qty=parseInt(s_qty);
    if (0==(s_qty%i_increment))
      {
      if (s_qty<i_minimum)
        {
        s_qty="x";
        };
      }
    else
      {
      s_qty="x";
      };
    }
  else
    {
    s_qty="x";
    };
  };

if (s_price_orig=="")
  {
  s_price_orig="x";
  };


var s_bbb=o_bbb.value.trim();
if (s_bbb=="")
  {
  s_bbb="x";
  }
else
  {
  if (isNaN(s_bbb)||(s_bbb>=s_price_orig))
    {
    s_bbb="x";
    }
  else
    {
    s_temp=parseInt(s_bbb*100);
    if (s_temp!=(s_bbb*100))
      {
      s_bbb="x";
      };
    };
  };

if (s_desc=="&x=")
  {
  window.alert("Please enter a description!");
  o_qty.focus();
  o_qty.select();
  }
else
  {
  if (isNaN(s_qty))
    {
    window.alert("Please enter a numeric quantity\nwith a minimum of "+i_minimum+"\nand multiples of "+i_increment+"!");
    o_qty.focus();
    o_qty.select();
    }
  else
    {
    if (isNaN(s_bbb))
      {
      if (isNaN(s_price_orig))
        {
        window.alert("Please enter a numeric List dollar amount!");
        }
      else
        {
        window.alert("Please enter a numeric BBB dollar amount of\nless than the original price of "+s_price_orig+"!");
        };
      o_bbb.focus();
      o_bbb.select();
      }
    else
      {
      window.location="bbbmaint.asp"+s_cec+s_exten+"a="+s_action+"&i="+s_item+"&d="+s_date+"&q="+s_qty+"&o="+s_price_orig+"&b="+s_bbb+"&s="+s_skid+"&st="+s_status+s_desc;
      };
    };
  };
}
