function checkCustomValue(c, t) {
   if(t == 1) {
      cwVal = 0;
      cwiVal = 0;
      w = document.getElementById('sWidth'+c);
      cw = document.getElementById('cWidth'+c);
      cwi = document.getElementById('cWidthInch'+c);
      cwVal = (cw.value.length > 0) ? parseInt(cw.value) : 0;
      cwiVal = (cwi[cwi.selectedIndex].value.length > 0) ? eval(cwi[cwi.selectedIndex].value) : 0;
      if(((cwVal + cwiVal) - w[w.selectedIndex].value) > 1) {
         alert('Please go to next size!');
         cw.value = 0;
         cwi.selectedIndex = 0;
      }
   } else {
      chVal = 0;
      chiVal = 0;
      h = document.getElementById('sHeight'+c);
      ch = document.getElementById('cHeight'+c);
      chi = document.getElementById('cHeightInch'+c);
      chVal = (ch.value.length > 0) ? parseInt(ch.value) : 0;
      chiVal = (chi[chi.selectedIndex].value.length > 0) ? eval(chi[chi.selectedIndex].value) : 0;
      if(((chVal + chiVal) - h.value) > 1) {
         alert('Please go to next size!');
         ch.value = 0;
         chi.selectedIndex = 0;
      }
   }
}



function checkCustomValue8100(c, t) {
   if(t == 1) {
      cwVal = 0;
      cwiVal = 0;
      w = document.getElementById('sWidth'+c);
      cw = document.getElementById('cWidth'+c);
      cwi = document.getElementById('cWidthInch' + c);
      cwVal = (cw.value.length > 0) ? parseInt(cw.value) : 0;

      if((cwVal > 0 && cwVal < 17) || (cwVal > 51)) {
         alert('Width must be between 17 and 51. Please correct');
         cw.value = '';
         cw.focus();
         return false;
      }

      cwiVal = (cwi[cwi.selectedIndex].value.length > 0) ? eval(cwi[cwi.selectedIndex].value) : 0;
      if(((cwVal + cwiVal) - w[w.selectedIndex].value) > 1) {
         alert('Please go to next size!');
         cw.value = 0;
         cwi.selectedIndex = 0;
      }
   } else {
      chVal = 0;
      chiVal = 0;
      h = document.getElementById('sHeight'+c);
      ch = document.getElementById('cHeight'+c);
      chi = document.getElementById('cHeightInch'+c);
      chVal = (ch.value.length > 0) ? parseInt(ch.value) : 0;
      if((chVal > 0 && chVal < 24) || (chVal > 74)) {
         alert('Height must be between 24 and 74. Please correct');
         ch.value = '';
         ch.focus();
         return false;
      }
      chiVal = (chi[chi.selectedIndex].value.length > 0) ? eval(chi[chi.selectedIndex].value) : 0;
      if(((chVal + chiVal) - h.value) > 1) {
         alert('Please go to next size!');
         ch.value = 0;
         chi.selectedIndex = 0;
      }
   }
}