function agreeToTerms(radioName, frmName, alertMsg) {
 var theForm = eval('document.'+frmName);
 var checkedValue = getCheckedValue(theForm.elements[radioName]);
 if (checkedValue == 0) {
 	alert(alertMsg);
	theForm.submit.disabled = true;
 } else if(checkedValue == 1) {
	theForm.submit.disabled = false;
 } 
}

function getCheckedValue(radioObj) {
	if(!radioObj)
		return "";
	var radioLength = radioObj.length;
	if(radioLength == undefined)
		if(radioObj.checked)
			return radioObj.value;
		else
			return "";
	for(var i = 0; i < radioLength; i++) {
		if(radioObj[i].checked) {
			return radioObj[i].value;
		}
	}
	return "";
}

function updateDescription(counterId, frmTextBox, varLimit, frmName) {
 var counter_value = document.getElementById(counterId).value;
 var text_length = eval('document.'+frmName+'.'+frmTextBox+'.value.length');
 document.getElementById(counterId).value=text_length;
 document.getElementById(counterId).firstChild.nodeValue=varLimit-document.getElementById(counterId).value
 if(document.getElementById(counterId).value > varLimit && counter_value <= varLimit) {
   alert('Your description is longer than '+varLimit+' characters!');
   if(document.styleSheets) {
     document.getElementById(counterId).style.color = '#ff0000'; 
   } 
 } else if(document.getElementById(counterId).value <= varLimit && counter_value > varLimit && document.styleSheets ) {
     document.getElementById(counterId).style.color = '#000000'; 
 } 
}