Changed several JavaScript references to local