Javascript : in easy steps