changing some js stuff to be ie8 friendly