String.prototype.trim = function () {
 var sString = this;
 while (sString.substring(0,1) == ' ') sString = sString.substring(1, sString.length);
 while (sString.substring(sString.length-1, sString.length) == ' ') sString = sString.substring(0,sString.length-1);
 return sString;
}
Array.prototype.noEmpty = function (f) {
 if (!f) return true;
 var
      i = this.length,
      g = f.elements,
      n = true;
 for (j = 0; j < i; j++) {
  if (typeof(g[this[j]]) == 'undefined') continue;
  if (g[this[j]].value.trim() == '') {
   g[this[j]].style.backgroundColor = '#FF0000';
   n = false;
  }
  else g[this[j]].style.backgroundColor = '';
 }
 return n;
}