// --------------------- check_form_input_1 --------------
// check the input for part 1 - cheshbon, snif and bank
  function check_form_input_1()
  {
    // check account
   if (!digitCheck(document.part1.acct.value))  // check for digits/empty
      {
       window.alert("(נא למלא מספר חשבון (ספרות בלבד")
       document.part1.acct.focus();
       return false;										  
      }
    // check snif
   if (!digitCheck(document.part1.snif.value))  // check for digits/empty
      {
       window.alert("(נא למלא מספר סניף (ספרות בלבד")
       document.part1.snif.focus();
       return false;										  
      }
   if (!digitCheck(document.part1.bank.value))  // check for digits/empty
      {
       window.alert("(נא למלא קוד בנק (ספרות בלבד")
       document.part1.bank.focus();
       return false;										  
      }
   if (document.part1.acct.value<1)  // check for 00
      {
       window.alert("(נא למלא מספר חשבון (ספרות בלבד")
       document.part1.acct.select();
       document.part1.acct.focus();
       return false;										  
      }
   if (document.part1.snif.value<1)  // check for 00
      {
       window.alert("(נא למלא מספר סניף (ספרות בלבד")
       document.part1.snif.select();
       document.part1.snif.focus();
       return false;										  
      }
   if (document.part1.bank.value<1)  // check for 00
      {
       window.alert("(נא למלא קוד בנק (ספרות בלבד")
       document.part1.bank.select();
       document.part1.bank.focus();
       return false;										  
      }
}

// --------------------- check_form_input_2 --------------
// check the input for part 2 - id number
  function check_form_input_2()
  {
    // check p_id
   if (!digitCheck(document.part2.p_id.value))  // check for digits/empty
      {
       window.alert("(נא למלא מספר תאגיד/ת.ז. (ספרות בלבד")
       document.part2.p_id.focus();
       return false;										  
      }
}
// this function is to check numeric input
 function digitCheck(number)
  {
   //this string stores all the numbers which are valid, each entered number will be checked 
   //against this list for validity
   var validInput = "0123456789"; 
   if (number=="")
      {
       return false  // empty input
      }
	  //loop through 'number' checking that the only digits there are valid
      for (i=0; i < number.length; i++) 
          {
          var character = number.charAt(i);        // check if evry num from input exsist in validInput
          if (validInput.indexOf(character) == -1) // if exsist we get the position (who cares) if not, -1.
             {
              return false;  // invalid input
             }
          }
      return true;  // valid input
  }

