function kontrolle(theForm){

  if (theForm.obwahl2.value == "")  {

    alert("Geben Sie die Angebotsnummer ein.");

    theForm.obwahl2.focus();

    return (false);

  }

  if (theForm.obwahl2.value.length < 5)

  {

    alert("Bitte geben Sie mindestens 5 Zahlen ein.");

    theForm.obwahl2.focus();

    theForm.obwahl2.select();      



    return (false);

  }

  

   var bcd = document.forms[0].obwahl2.value;

   for (var i = 0; i < bcd.length; i++){      

    var abc = bcd.substring(i, i + 1); 

        if ((i == 0)&&(abc != 1)&&(abc != 5)){

            alert("\nDie Angebotsnummer beginnt mit einer 1 oder 5\n\n" +

            "Bitte trage Deine richtige Angebotsnummer ein.");          

            document.forms[0].obwahl2.select();         

            document.forms[0].obwahl2.focus();         

            return false;      

     }           

    if (abc < "0" || "9" < abc){   

       alert("\nDie Angebotsnummer setzt sich aus Zahlen zusammen.\n\n" +

            "Bitte trage Deine richtige Angebotsnummer ein.");          

            document.forms[0].obwahl2.select();         

            document.forms[0].obwahl2.focus();         

            return false;         

     } 

    } 

 return (true);

}
