function chkNotNull() { var i, campo, nombre, errors; errors = chkNotNull.arguments[0]; msg = chkNotNull.arguments[1]; for (i=2; i< chkNotNull.arguments.length; i += 2) { campo = chkNotNull.arguments[i]; nombre = chkNotNull.arguments[i+1]; if ( !campo.value ) errors += '- '+ nombre +': ' + msg + '\n'; } return errors; }