Carbon dating dictionary javascript code for validating radio buttons