polyfill for js trim function

For IE< 9