haha.No genius in this thread.I dont know either.I will use google to know the code of this.Or try searching some forums about javascript.goodluck to your quest
However, if you want to be creative, just make a CSS layer and have a php include to your ad, and have a little button that says close on it ^^ That's what I do on the sites I code for, and it works well!