replace javascript calls to trim() with $.trim(..) for IE8 compatibility