function doClear(theText) 
{
     if (theText.value == theText.defaultValue)
	{
         theText.value = ""
	}
}

function checkCheckBox(f)
{
if (f.agree.checked == false )
	{
	alert('Please check the box to continue.');
	return false;
	}else
return true;
}

function countDown(control, maxLen, counter, typeName) {
     var len = control.value.length;
     var txt = control.value;
     var span = document.getElementById(counter);
     span.style.display = '';
     span.innerHTML = (maxLen - len) + ' characters remaining';
     if (len >= (maxLen - 10)) {
          span.style.color = 'red';
          if (len > maxLen) {
               control.innerHTML = txt.substring(0, maxLen);
               span.innerHTML = (maxLen - control.value.length) + ' characters remaining';
               alert(typeName + ' text exceeds the maximum allowed!');
          }
     } else {
          span.style.color = '';
     }
}
