//Extend the String object so that we can use the trim() function like; sVar.trim();
String.prototype.trim = function() {
  a = this.replace(/^\s+/, '');
  return a.replace(/\s+$/, '');
};

