function getRepair_old(theform) {
   var selcnt = 0;
   if (theform.nextday && theform.nextday.checked) { 
      if (theform.nextdayqty.value <= 0) {
         alert("Please entery a quantity for repair option Next Day Emergency Service");
         theform.nextdayqty.focus();
         return false;
      }
      selcnt = selcnt + 1;
   }
   if (theform.fiveday && theform.fiveday.checked) { 
      if (theform.fivedayqty.value <= 0) {
         alert("Please entery a quantity for repair option 5 Day Priority Service");
         theform.fivedayqty.focus();
         return false;
      }
      selcnt = selcnt + 1;
   }
   if (theform.nextday && theform.tenday.checked) { 
      if (theform.tendayqty.value <= 0) {
         alert("Please entery a quantity for repair option 7-10 Day Standard Service");
         theform.tendayqty.focus();
         return false;
      }
      selcnt = selcnt + 1;
   }
   if (theform.calibration && theform.calibration.checked) { 
      if (theform.calibrationqty.value <= 0) {
         alert("Please entery a quantity for repair option Calibration Only");
         theform.calibrationqty.focus();
         return false;
      }
      selcnt = selcnt + 1;
   }
   if (selcnt == 0) {
      alert("Please select one or more repair options.");
      return false;
   }
   return true;
}

function getRepair(theform) {
   var selcnt = 0;
   if (theform.nextdayqty && theform.nextdayqty.value > 0) { 
      selcnt = selcnt + 1;
   }
   if (theform.fivedayqty && theform.fivedayqty.value > 0) {
      selcnt = selcnt + 1;
   }
   if (theform.tendayqty && theform.tendayqty.value > 0) { 
      selcnt = selcnt + 1;
   }
   if (theform.twentydayqty && theform.twentydayqty.value > 0) { 
      selcnt = selcnt + 1;
   }
   if (theform.calibrationqty && theform.calibrationqty.value > 0) {
      selcnt = selcnt + 1;
   }
   if (theform.evalqty && theform.evalqty.value > 0) {
      selcnt = selcnt + 1;
   }
   if (selcnt == 0) {
      alert("Please enter a quantity for one or more repair options.");
      return false;
   }
   return true;
}

function qtyFocus(chkbox,inputfield) {
   if (chkbox.checked) {
      inputfield.disabled = false;
      inputfield.focus();
      inputfield.select();
   } else {
      inputfield.blur();
      inputfield.disabled = true;
   }
}

function validComplaint(item_count) {
   var i;
   var fieldID;
   var errCnt = 0;
   for (i = 1; i <= item_count; i++) {
       fieldID = 'cust_complaint' + i;
       if (document.getElementById(fieldID) && errCnt == 0) {
          if (document.getElementById(fieldID).value == '') {
             document.getElementById('errormsg').style.display = 'block';
             document.getElementById('errormsg').innerHTML = 'Please enter failure symptoms. If failure symptoms are unavailable, please enter \"Unknown\".';
             document.getElementById(fieldID).focus();
             errCnt = errCnt + 1;
             break;
          }
       }
   }
   return (errCnt == 0);
}

function printAndHide (last_seq) {
   var i;
   var fieldID;
   window.print();
   /*for (i = 1; i <= last_seq; i++) {
       fieldID = "print" + i;
       if (document.getElementById(fieldID)) {
          document.getElementById(fieldID).style.display = 'none';
       }
   }*/
}