Just save the following as banner_rotate.js and link to it with
<script language="JavaScript" src="banner_rotate.js"></script>
To see it in action, you can visit a website I designed, and I used it to rotate three banners at the top.
http://www.unityelectronics.com
P.S.-- They have hired someone new to do graphics now, so if you see something that sucks... that would be the new guy's work, not mine! haa haaaaaaaaaaaaaa
------------------------------------------------------------------------------
<!--
function banner() { } ; b = new banner() ; n = 0
b[n++]= "<a href='category-category_id/2'><img src='images/mainpromo_4.jpg' width='174' height='120' border='0'></a>"
b[n++]= "<a href='category-category_id/233'><img src='images/mainpromo_37.gif' width='174' height='120' border='0'></a>"
i=Math.floor(Math.random() * n) ;
document.write( b[i] )
//-->