Radio button validation in javascript

HTML
                     <input type="radio" name="paymenttype" id="paymenttype"  value="Payment through Gayeway"/>Payment By Card
                      <input type="radio" name="paymenttype" id="paymenttype"  value="Payment through Check" />Payment By Check

Script

 if (!checkRadio())
 {
 alert('You have to select payment type');
 return false;
 }


    function checkRadio () {
 var radios = document["frmUser"].elements["paymenttype"];
 for (var i=0; i <radios.length; i++) {
  if (radios[i].checked) {
  document.getElementById("hdn").value=radios[i].value;
//alert(document.getElementById("hdn").value)
   return true;
  }
 }
 return false;
}