fixed userGroups == null issue
moved code into checkgroups.js, added jquery validator