function checkCommentForm(theForm) {
    var why = ""; 
    why += isEmpty(theForm.comment.value,"Please fill in your comments.\n");
    var wc = countIt(theForm.comment.value);
 
    if (why != "") {
       alert(why);
       return false;
    }
    return true;
}

function isEmpty(strng,err) {
var error = "";
  if (strng.length == 0) {
     error = err;
  }
return error;
}

function countIt(strng){

   var error = "";
   strng=strng.split(" ")
   var words = 0;
   words = strng.length;
   if (words > 250) {
      error = "You have entered "+words+" words in the short story!\n Please reduce the number of maximum words to 250!!!\n";
      alert(error);
      return false;
   } else {
      return true;
   }
}

