
/*----------------------------*/
 function textfeld_check(min, max, obj) /*(Minlänge, Maxlänge, Objekt)*/
 {
  if (obj.value.length>=min &obj.value.length<=max)
    obj.style.backgroundColor="#ffffff";
  else
    obj.style.backgroundColor="#F0E68C";
 }
/*----------------------------*/
 function zahlenfeld_check(min,max,obj) /*(Minlänge, Maxlänge, Objekt)*/
 {
   if(isNaN(obj.value) || obj.value.length<min || obj.value.length>max)
    obj.style.backgroundColor="#F0E68C";
  else
    obj.style.backgroundColor="#ffffff";
 }
/*----------------------------*/
 function dropdownfeld_check(obj)
 {

   for(var i = 0;i < obj.length;i++){
      if(obj.options[i].selected == true){
        ausgewaehlt = obj.options[i].value;
      }
    }

   if(ausgewaehlt=="Keine Angabe")
    obj.style.backgroundColor="#F0E68C";
  else
    obj.style.backgroundColor="#ffffff";
 }
/*----------------------------*/
function email_check(pflicht,obj)
{
 var a = false;
 var res = false;
 if(typeof(RegExp) == 'function')
 {
  var b = new RegExp('abc');
  if(b.test('abc') == true){a = true;}
  }

 if(a == true)
 {
  reg = new RegExp('^([a-zA-Z0-9\\-\\.\\_]+)'+
                   '(\\@)([a-zA-Z0-9\\-\\.]+)'+
                   '(\\.)([a-zA-Z]{2,4})$');
  res = (reg.test(obj.value));
 }
 else
 {
  res = (obj.search('@') >= 1 &&
         obj.lastIndexOf('.') > obj.search('@') &&
         obj.lastIndexOf('.') >= obj.length-5)
 }

 if (res==true || (pflicht==0 && obj.value==""))
     obj.style.backgroundColor="#ffffff";
  else
    obj.style.backgroundColor="#F0E68C";
}
