animated sinwaves with javascript