function checkrequired(which) {
 var pass=true;
 if (document.images) {
  for (count=0;count<which.length;count++) {
   var tempobj=which.elements[count];
   if (tempobj.name.substring(0,8)=="required") {
    shortFieldName=tempobj.name.substring(8,30).toUpperCase();
    if (( tempobj.value.length<6)) {
     pass=false;
     alert("The "+shortFieldName+" field requires 6 characters.");
     return false;
     break;
    }
    if(tempobj.value.indexOf(' ')>-1) {
     alert("The "+shortFieldName+" can't have any spaces");
     return false;
     break;
    }
    var checkOKNum = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789";
    var checkOKNoNum = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz";
    var checkStr = tempobj.value;
    var allValid = true;
    for (i = 0;  i < tempobj.value.length;  i++) {
     if (i==0) {
      checkOK=checkOKNoNum
     }
     else {
      checkOK=checkOKNum
     }
     ch = checkStr.charAt(i);
     for (j = 0;  j <= checkOK.length;  j++) {
      if (ch == checkOK.charAt(j)) {
       break;
      }
      if (j == checkOK.length) {
       allValid = false;
      }
      if (!allValid) {
       alert("Please enter only letter and numeric characters in the "+shortFieldName+" field. The first character cannot be numeric");
       return (false);
      }
     }
    }
   }
   if (tempobj.name.substring(0,8)=="numfield") {
    shortNumField=tempobj.name.substring(8,30).toUpperCase();
    if (( tempobj.value.length<1)) {
     pass=false;
     alert("You have not entered a "+shortNumField+" value.");
     return false;
     break;
    }
    if(tempobj.value.indexOf(' ')>-1) { 
     alert("The "+shortNumField+" can't have any spaces");
     return false;
     break;
    }
    var checkOK = "0123456789.";
    var checkStr = tempobj.value;
    var allValid = true;
    for (i = 0;  i < tempobj.value.length;  i++) {
     ch = checkStr.charAt(i);
     for (j = 0;  j <= checkOK.length;  j++) {
      if (ch == checkOK.charAt(j)) {
       break;
      }
      if (j == checkOK.length) {
       allValid = false;
      }
      if (!allValid) {
       alert("Please enter only numeric characters in the " + shortNumField +" field.");
       return (false);
      }
     }
    }
   }
   if (tempobj.name.substring(0,10)=="phonefield") {
    shortPhoneField=tempobj.name.substring(10,50).toUpperCase();
    var checkNotOK = "'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz";
    var checkStr = tempobj.value;
    var allValid = true;
    for (i = 0;  i < tempobj.value.length;  i++) {
     ch = checkStr.charAt(i); 
     for (j = 0;  j <= checkNotOK.length;  j++) {
     if (ch == checkNotOK.charAt(j)) {
      allValid = false;
     }
     if (j == checkNotOK.length) {
      allValid = true;
      break;
     }
     if (!allValid) {
      alert("Alphabetical characters are not allowed in " +shortPhoneField+" field.");
      return (false);
     }
    }
   }
  }
  if (tempobj.name.substring(0,8)=="urlfield") {
   shortURLField=tempobj.name.substring(8,50).toUpperCase();
   var checkNotOK = "'";
   var checkStr = tempobj.value;
   var allValid = true;
   for (i = 0;  i < tempobj.value.length;  i++) {
    ch = checkStr.charAt(i);
    for (j = 0;  j <= checkNotOK.length;  j++) {
     if (ch == checkNotOK.charAt(j)) {
      allValid = false;
     }
     if (j == checkNotOK.length) {
      allValid = true;
      break;
     }
     if (!allValid) {
      alert("The ' character is not allowed in " +shortURLField+" field.");
      return (false);
     }
    }
   }
  }
  if (tempobj.name.substring(0,9)=="namefield") {
   shortNameField=tempobj.name.substring(9,50).toUpperCase();
   if (( tempobj.value.length<1)) {
    pass=false;
    alert("You have not entered a "+shortNameField+" value.");
    return false;
    break;
   }
   var checkNotOK = "'";
   var checkStr = tempobj.value;
   var allValid = true;
   for (i = 0;  i < tempobj.value.length;  i++) {
    ch = checkStr.charAt(i);
    for (j = 0;  j <= checkNotOK.length;  j++) {
     if (ch == checkNotOK.charAt(j)) {
      allValid = false;
     }
     if (j == checkNotOK.length)  {
      allValid = true;
      break;
     }
     if (!allValid) {
      alert("The ' character not allowed in " +shortNameField+" field.");
      return (false);
     }
    }
   }
  }
  if (tempobj.name.substring(0,9)=="descfield") {
   shortDescField=tempobj.name.substring(9,50).toUpperCase();
   if (( tempobj.value.length>250)) {
    pass=false;
    alert("The "+shortDescField+" field is too long.");
    return false;
    break;
   }
   if (( tempobj.value.length<1)) {
    pass=false;
    alert("The "+shortDescField+" cannot be blank.");
    return false;
    break;
   }
   var checkNotOK = "'";
   var checkStr = tempobj.value;
   var allValid = true;
   for (i = 0;  i < tempobj.value.length;  i++) {
    ch = checkStr.charAt(i);
    for (j = 0;  j <= checkNotOK.length;  j++) {
     if (ch == checkNotOK.charAt(j)) {
      allValid = false;
     }
     if (j == checkNotOK.length) {
      allValid = true;
      break;
     }
     if (!allValid) {
      alert("The ' character is not allowed in " +shortDescField+" field.");
      return (false);
     }
    }
   }
  }
 }
}
}

function CheckDelete(msg1,msg2) {
 var CanDelete = false; 
 CanDelete = window.confirm(msg1); 
 if (msg2 != "") { 
  if (CanDelete == true) { 
   CanDelete = window.confirm(msg2); 
  }
 }
 return CanDelete;
}



