/* Message Box */

function MsgBox (textstring) { alert (textstring); }

/* Count Characters */

function countCharacters(textArea, counterField, maxLength){		
	if(textArea !=null && textArea.value != null) {
		if (textArea.value.length > maxLength){
			alert("Your message may not exceed " +  maxLength +" characters in length.");
			textArea.value = textArea.value.substring( 0, maxLength);
		} else {
			counterField.value = maxLength - textArea.value.length;
		}
	}
}

/* Required Fields */

function checkrequired(which) {
  var pass=true;
  for (i=0;i<which.length;i++) {
    var tempobj=which.elements[i];
	/* tempobj.name */
    if (tempobj.name.substring(0,8)=="required") {
      if (((tempobj.type=="text"||tempobj.type=="textarea")&&
          tempobj.value=='')||(tempobj.type.toString().charAt(0)=="s"&&
          tempobj.selectedIndex==0)) {
        pass=false;
        break;
      }
    }
  }
  if (!pass) {
    /* shortFieldName=tempobj.name.substring(8,30).toUpperCase(); */
	shortFieldName=tempobj.name.substring(0,30);
    alert("The "+shortFieldName+" field is a required field.");
    return false;
  } else {
  return true;
  }
}