var inp = document.getElementsByTagName('input');

for (i=0;i<inp.length;i++) {
var test = inp[i].parentNode.getElementsByTagName('input');
var test2 = 0;
for (j=0;j<test.length;j++) {
if (test[j].getAttribute('type') == "radio") {
test2++;
}
}
if (inp[i].getAttribute('type') == "radio" && test2==1) {
inp[i].parentNode.className = 'radio';
// inp[i].className = 'radio';
}
}
