CMS: Javascript rewrite