But can you tell me if these legends were after the genesis story of the rainbow?
They are obviously much earlier, inasmuch as the Genesis stories in general offer an Israelite reworking of several myths which can be traced to distinct origins (Mesopotamian or Levantine for instance).
I would think it would be hard to date as we don't really know in what year the genesis account was written. I know some will say a few thousand years ago but I myself am an old earth believer. I think Genesis was written much earlier.
The datation of Genesis is quite independent of the issue of "old vs. young earth". Most of the stories are now dated from the 8th century onward, the final redaction of Genesis being clearly post-exilic.
Also, Narkissos, where do you get your information about the ancient legends that seem to show the same stories as the bible?
Both the Enuma Elish and the Gilgamesh Epic can be read in English translation online.
http://www.crivoice.org/enumaelish.html
http://www.ancienttexts.org/library/mesopotamian/gilgamesh/ (see tablet XI for the Flood story).
I'm not the best source for English books but I can recommend Mark Smith's Early History of God for a general approach of OT literary sources.