browser compatibility

I added some shims so it should work in IE 7 & 8 too (testling tests didn't run yet...).