Simple javascript functions that rewrite URLs.