Added prototype trim function to appease IE around line 109