Refactored trim() to adhere with standards
IE6 doesn't have a short syntax for string indexing