Javascript code for validating radio buttons