use js urls for rewriting if posible. Removed unnecessary hacks for ie.