Here's a simple one that displays them randomly, it's PHP.
PHP:<?php $adcode = array( 'Ad code one', 'Ad code two', 'Ad code three', 'And so on' ); shuffle($adcode); echo $adcode[1]; ?>
But you didn't really give us enough details of what you want.
Why would you need to rotate Google ads? They change everytime the page loads anyway...