Volume Delay Function In Javascript With Parameters