Javascript rewrite: switch to full Javascript when possible, wpml object.