The <body onload=""> would need to be added to:
Control Panel » Display Options » HTML Includes » Body Onload as such:
HTML
bannerchanger('banner');

Do you just want the banner to appear at the top of every page? That's what I have (check my site), and I have my code in the Default Header section like below. This is basically a table that on the left has my site logo, and on the right I have banners rotating on every page of the forums.
HTML
<BR />

<TABLE align="center" width="800">
<TR>
<TD align="center" valign="middle" width="325">
<a href="http://www.gangsterbb.net/threads/ubbthreads.php?ubb=cfrm" target="_top">
<IMG width="300" height="50" src="images/title_gangster-bb.gif" 
border="0" alt="GangsterBB.NET" align="left"></a>
</TD>
<TD align="center" valign="middle">

<!-- BANNER ROTATION -->

<SCRIPT LANGUAGE="JavaScript">

<!-- This script and many more are available free online at -->
<!-- The JavaScript Source!! http://javascript.internet.com -->

<!-- Begin

var how_many_ads = 3;
var now = new Date()
var sec = now.getSeconds()
var ad = sec % how_many_ads;
var border = 0;
ad +=1;


if (ad==1) {
txt="Search over 400,000 posters, photos, t-shirts, gifts, and more!"; 
url="http://www.MobPosters.com/";
alt="MobPosters";
banner="http://www.MobPosters.com/img/468x60-anim.gif";
width="468";
height="60";
}

if (ad==2) {
txt="2008 CALENDARS: Search for Scarface (GF sold out!)"; 
url="http://www.anrdoezrs.net/click-2207240-10481683";
alt="2008 Calendars";
banner="http://www.awltovhc.com/image-2207240-10481683";
width="468";
height="60";
border="0";
}

if (ad==3) {
txt="TEXT THAT SHOWS UNDERNEATH THE AD"; 
url="THE URL PEOPLE ARE SENT TO";
alt="SHORT TEXT IF IMAGE ISN'T LOADED";
banner="LOCATION/OF/THE/BANNER.GIF";
width="468";
height="60";
border="0";
}


document.write('<center>');
document.write('<a href=\"' + url + '\" target=\"_blank\">');
document.write('<img src=\"' + banner + '\" width=')
document.write(width + ' height=' + height + ' ');
document.write('border=' + border + ' ');
document.write('alt=\"' + alt + '\" border=0><br>');
document.write('<small>' + txt + '</small></a>');
document.write('</center>');
// End -->

</SCRIPT>
</TD></TR></TABLE>
<BR />


If that's all you need, you can just modify the code I use to include however many banners you want to rotate by changing this: var how_many_ads = 3;

You wouldn't need the Body Onload section using this.

If you want the ads somewhere else, then there'd be a different procedure....




GangsterBB.NET (Ver. 7.6.1.1)
PHP Version 5.6.40 / MySQL 5.7.23-23 (was 5.6.41-84.1) / Apache 2.4.54
2007 Content Rulez Contest - Hon Mention
UBB.classic 6.7.2 - RIP