Stats validation

So this is hyper naive, but it's a start ... what do you think? My javascript is awful.