adding all-time trend js function