ie 7 & 8 compatibility update

removed use of trim() method
added fix for ie 8 not existing Event.preventDefault