function checkAccept() {
	if (document.form1.chkAccept.checked == false)
	{
		alert("Your application cannot be submitted if you do not accept the terms and conditions.");
		document.form1.chkAccept.focus();
		return false;
	}
	else
		return true;
}

function doCancel(){
	return confirm('Any changes made will be lost! Do you want to continue?')
}

function checkTextLength(oObject, iLenAllowed)
{
	var iLen = oObject.value.length;
	if ( iLen > iLenAllowed )
	{
		alert("Text entered for field " + oObject.name.toUpperCase() + " exceeds maximum allowed length of " + iLenAllowed + " characters by " + ( iLen - iLenAllowed) + " characters.\nPlease edit your text.");
		oObject.focus();
		return false;
	}
	else
		return true;
}

function CheckMaxLength(Object, MaxLen)
{
  if(Object.value.length > MaxLen)
  {     
    Object.value = Object.value.substring(0, MaxLen);
  }
}

function isAllSpaces(s) {
   var j;
   for (j = 0; j < s.length; j++ ) {
      if (s.charAt(j) != ' ' && s.charAt(j) != '\n' && s.charAt(j) != '\r' ) {
         return false;
      }
   }                     
   return true;
}