// Radio Button Validation
// copyright Stephen Chapman, 15th Nov 2004,14th Sep 2005
// you may copy this function but please keep the copyright notice with it

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 valForm(form) {
	form = document.getElementById(form);
	var btn = valButton(form.optionId);

	if (btn == null){
		//alert('No radio button selected');
		document.getElementById('errorRed').style.display = 'block';
	}
	else {
		form.submit();
	}
}
