
      function validate(f){
       catch_error = false;
       catch_error = validate_one(f, 'name') ? true : catch_error;
       catch_error = validate_one(f, 'company') ? true : catch_error;
       catch_error = validate_one(f, 'email') ? true : catch_error;
       catch_error = validate_one(f, 'industry') ? true : catch_error;
       catch_error = validate_one(f, 'entity') ? true : catch_error;
       catch_error = validate_one(f, 'state') ? true : catch_error;
       catch_error = validate_one(f, 'annual_2004') ? true : catch_error;
       catch_error = validate_one(f, 'annual_2005') ? true : catch_error;
       catch_error = validate_one(f, 'annual_2006') ? true : catch_error;
       catch_error = validate_one(f, 'year_begin') ? true : catch_error;
       catch_error = validate_one(f, 'country') ? true : catch_error;
       catch_error = validate_one(f, 'employees') ? true : catch_error;

       return catch_error ? false : true;
      }

      function validate_one(f, field_name){
       err = 0;
       if(f[field_name].tagName == 'SELECT' && f[field_name].options[f[field_name].selectedIndex].value == 0){
        err = 1;
       }else if(!trim(f[field_name].value)){
        err = 1;
       }

       if(err){
        if(field = document.getElementById(field_name + "_text")){
         field.style.color = '#FF0000';
         field.style.fontWeight = 'bold';
        }
        return true;
       }else{
        if(field = document.getElementById(field_name + "_text")){
         field.style.cssText = '';
        } 
       }

      }

      function trim(s){
       while(s.substring(0, 1) == ' ' || s.substring(0, 1) == '\n' || s.substring(0, 1) == '\r')
        s = s.substring(1, s.length);
       while (s.substring(s.length-1, s.length) == ' ' || s.substring(s.length-1, s.length) == '\n' || s.substring(s.length-1, s.length) == '\r')
        s = s.substring(0, s.length-1);
       return s;
      }