I haven't read up in this thread, however if I recall correctly, there's a patent on in-ebook-ads. I also remember an outcry about it being issued a few years ago.
I'd check up on that before you have some people knocking on your door.
Also, it'll just mean that your book is ripped and re-released asap