function problemValidate() {
  field = document.submitProblem.fullname;
  if (isBlank(field, "Full Name")) return false;
  
  field = document.submitProblem.company;
  if (isBlank(field, "Company")) return false;
  
  field = document.submitProblem.email;
  if (isBlank(field, "Email")) return false;
  
  field = document.submitProblem.phone;
  if (isBlank(field, "Phone")) return false;
  
  field = document.submitProblem.problem;
  if (isBlank(field, "Problem")) return false;
  
  return true;
}
function trimLeft(s) {
  var whitespaces = " \t\n\r";
  for(n = 0; n < s.length; n++) { if (whitespaces.indexOf(s.charAt(n)) == -1) return (n > 0) ? s.substring(n, s.length) : s; }
  return("");
}

function trimRight(s){
  var whitespaces = " \t\n\r";
  for(n = s.length - 1; n  > -1; n--) { if (whitespaces.indexOf(s.charAt(n)) == -1) return (n < (s.length - 1)) ? s.substring(0, n+1) : s; }
  return("");
}

function trim(s) {return ((s == null) ? "" : trimRight(trimLeft(s))); }

function isBlank(field, strFieldName) {
  strTrimmed = trim(field.value);
  if (strTrimmed.length > 0 ) return false;
  alert("\"" + strFieldName + "\" is a required field. Please fill it out.");
  field.focus();
  return true;
}

function checkRadio (frmName, rbGroupName, strReturnValue) { 
 // Usage Example
 // if (checkRadio('submitProblem','dbcomponent','Is there a DB or cash balance component')) return false;
 
 var radios = document[frmName].elements[rbGroupName]; 
 for (var i=0; i <radios.length; i++) { 
  if (radios[i].checked) { 
   return false; 
  } 
 }
 alert("\"" + strReturnValue + "\" is a required field. Please fill it out."); 
 return true; 
} 