Hi,
Some time ago, I had a discussion with Amit regarding inserting AdSense referral code in blog post.
[details in this thread:- http://www.labnol.org/forums/topic/regarding-adsense-policies-violation?replies=5
later on found that Amit has written an article how to do so [note the warning] at http://labnol.blogspot.com/2007/08/how-to-add-google-adsense-ad-units-in.html
But, This can be done in an other way without violating TOS of AdSense. i.e. using named anchor tags. [more details:- http://fundubytes.blogspot.com/2007/11/tips-tricks-to-earn-more-through.html