JavaScript checking, starting small