javascript message manipulation cascading