
function valButton(btn) {
    var cnt = -1;
    for (var i=btn.length-1; i > -1; i--) {
        if (btn[i].checked) {cnt = i; i = -1;}
    }
    if (cnt > -1) return btn[cnt].value;
    else return null;
}

function valid_all()
{  
	var i ,noerror;
	i = 0;
	noerror = 0; 

	for(i=0;i<nodecount;i++)
	{
		document.getElementById("err_"+ node[i]).style.visibility="hidden";
		if( valButton(document.getElementsByName(node[i])) == null )
		{ 
			document.getElementById("err_"+ node[i]).style.visibility="visible"; 
			noerror = 1;
		}  
	}
	
	if ( noerror == 0)
	{
 		document.frmSubmit.submit();
 	}
 	
	else
	{
		alert("Please fill in all the required fields");
	}
	
	return true;
}





