Javascript based grade calculator