var fc5 = 1;
function doLess2(sep, sex, sez)
{ var op = document.fm.elements["pOption5[]"];
  var ox = document.fm.elements["pOption6[]"];
  var oz = document.fm.elements["pOption7[]"];
  var qt = document.fm.elements["pQty5[]"];
  var s = "";
  lg = op.length - 1;
  if (op[lg].value == "no selection") {s="Please select " + sep + ".";}
  if (ox[lg].value == "no selection") {s="Please select " + sex + ".";}
  if (oz[lg].value == "no selection") {s="Please select " + sez + ".";}
  else if (qt[lg].value == 0) {s="Please select quantity."; qt[lg].focus(); qt[lg].select();}
  if (s.length>2) {return popAlert(s);} else {x = doMore2(2);}
  return false; }
function doMore2(n)
{ var newdiv = document.createElement("div");
  newdiv.innerHTML = document.getElementById("fline2").innerHTML;
  var container = document.getElementById("flines2");
  container.appendChild(newdiv);
  ++fc5; ns = "|" + fc5;
  var op = document.fm.elements["pOption5[]"][fc5];
  for (c=1; c < op.length; c++) { op.options[c].value += ns; }
  return false; }


function reDecProduct(o)
{ f = getFline(o.value);
  i = document.fm.elements["pOption[]"][f].selectedIndex;
 if (i>0) { --i;
    document.fm.elements["pNum[]"][f].value = pNums[i];
    document.fm.elements["pName[]"][f].value = pNames[i]; } }

function reDecHandle(o)
{ x = o.value;
{ a = x.split("|"); if (a[1]) {f = a[1];} else {f = 1;} }
  i = document.fm.elements["pOption5[]"][f].selectedIndex;
 if (i>0) { --i;
    document.fm.elements["pNum5[]"][f].value = pNums5[i];
    document.fm.elements["pName5[]"][f].value = pNames5[i];
    if (i==1)
    { document.fm.elements["pOption6[]"][f].selectedIndex = 1; 
      document.fm.elements["pOption6[]"][f].disabled = true; }
    else
    { document.fm.elements["pOption6[]"][f].selectedIndex = 0; 
      document.fm.elements["pOption6[]"][f].disabled = false; }
 } }

function verifyMe2(sea, seb, sec, sed, see, sef)
{ var bTotal = 0;
  var bv = document.fm.elements["bQty[]"];
  var bx = document.fm.elements["bOption[]"];
  if (bv)
  { for (i=0; i<bv.length; i++)
    { bTotal += bv[i].value;
	if (bv[i].value>0)
	{ if (bx[i].value == "no selection")
	  { x = popAlert("Please select " + sef + "."); 
	    bv[i].focus(); bv[i].select(); return false; } }
	if (bx[i].selectedIndex > 0 && bv[i].value<1)
	  { x = popAlert("Please select quantity."); 
	    bv[i].focus(); bv[i].select(); return false; }
 } }
  var qt = document.fm.elements["pQty[]"];
  var op = document.fm.elements["pOption[]"];
  var ox = document.fm.elements["pOption2[]"];
  var pTotal = 0;
  for (i=0; i<qt.length; i++)
  { if (qt[i].value > 0)
    { pTotal += qt[i].value;
	if (op[i].value == "no selection")
	{ x = popAlert("Please select " + sea + "."); 
	  qt[i].focus(); qt[i].select(); return false; }
	else if (ox[i].value == "no selection")
	{ x = popAlert("Please select " + seb + "."); 
	  qt[i].focus(); qt[i].select(); return false; } } }
  var qt = document.fm.elements["pQty5[]"];
  var op = document.fm.elements["pOption5[]"];
  var ox = document.fm.elements["pOption6[]"];
  var oz = document.fm.elements["pOption7[]"];
  for (i=0; i<qt.length; i++)
  { if (qt[i].value > 0)
    { pTotal += qt[i].value;
	if (op[i].value == "no selection")
	{ x = popAlert("Please select " + sec + "."); 
	  qt[i].focus(); qt[i].select(); return false; }
	else if (ox[i].value == "no selection")
	{ x = popAlert("Please select " + sed + "."); 
	  qt[i].focus(); qt[i].select(); return false; }
	else if (oz[i].value == "no selection")
	{ x = popAlert("Please select " + see + "."); 
	  qt[i].focus(); qt[i].select(); return false; }
    } }
  if ((pTotal + bTotal) == 0) { return popAlert("You must input a quantity for something."); }
  return true; }

