// Formularpruefung step 01 - Produktauswahl

function checkSelect1() {
// Standard nichts gewaehlt
 if (document.CalcForm.dtraeger.options[0].selected == true) {
  document.CalcForm.qntt.disabled = true;
  document.CalcForm.qntt.value = "";
  document.CalcForm.lprnt.disabled = true;
  document.CalcForm.lprnt.options.selectedIndex = 0;
  document.getElementById('frbzhl').style.display = 'none';
 } else {
  document.CalcForm.qntt.disabled = false;
  document.CalcForm.qntt.focus();
  document.CalcForm.lprnt.disabled = false;
  } 
}

function checkSelect2() {
 if(document.CalcForm.lprnt.selectedIndex == 1) {
  document.getElementById('frbzhl').style.display = 'block';
  } else {
   document.getElementById('frbzhl').style.display = 'none';
   }

 }

// prüft ob Stückzahl eine Zahl ist und nicht leer
function checkZahl() {
 if (document.CalcForm.qntt.value == "") {
  alert('Bitte Stückzahl angeben!');
  document.CalcForm.qntt.focus();
  document.CalcForm.qntt.style.border = '2px solid red';
  return false;
  } else {
   document.CalcForm.qntt.style.border = '1px solid #bcbcbe';
   }

// prüft ob Eingabe eine Zahl ist
 var chkZ = 1;
  for (i = 0; i < document.CalcForm.qntt.value.length; ++i)
    if (document.CalcForm.qntt.value.charAt(i) < "0" ||
        document.CalcForm.qntt.value.charAt(i) > "9")
      chkZ = -1;
  if (chkZ == -1) {
    alert("Stückzahl keine Zahl!");
    document.CalcForm.qntt.focus();
    return false;
  } else {
   document.CalcForm.qntt.style.border = '1px solid #bcbcbe';
   }


 if (document.CalcForm.lprnt.options.selectedIndex == 0) {
  alert('Bitte Bedruckung wählen!');
  document.CalcForm.lprnt.focus();
  document.CalcForm.lprnt.style.border = '2px solid red';
  return false;
  } else {
   document.CalcForm.lprnt.style.border = '1px solid #bcbcbe';
   }

}


