Used strip() from prototype.js rather than trim()