Here is the code for the overall header. The ad code is in red near the bottom
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "
http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="
http://www.w3.org/1999/xhtml" dir="{S_CONTENT_DIRECTION}">
<head>
<meta http-equiv="Content-Type" content="text/html; charset={S_CONTENT_ENCODING}">
<meta http-equiv="Content-Style-Type" content="text/css">
{META}
{NAV_LINKS}
<title>{SITENAME} :: {PAGE_TITLE}</title>
<link rel="stylesheet" href="templates/cs_red/{T_HEAD_STYLESHEET}" type="text/css">
<script language="javascript" type="text/javascript" src="templates/cs_red/scripts.js"></script>
<script language="javascript" type="text/javascript" src="templates/cs_red/formStyle.js"></script>
<link rel="icon" href="templates/cs_red/images/favicon.ico" />
<!-- BEGIN switch_enable_pm_popup -->
<script language="Javascript" type="text/javascript">
<!--
if ( {PRIVATE_MESSAGE_NEW_FLAG} )
{
/* window.open('{U_PRIVATEMSGS_POPUP}', '_phpbbprivmsg', 'HEIGHT=225,resizable=yes,WIDTH=400'); */
}
//-->
</script>
<!-- END switch_enable_pm_popup -->
</head>
<body>
<a name="top"></a> <img id="formStyleTestImage" src="templates/cs_red/images/spacer.gif" />
<table width="{T_BODY_BACKGROUND}" cellspacing="0" cellpadding="0" border="0" align="center" id="maintable">
<tr>
<td valign="top" class="content-row"><table border="0" width="100%" cellspacing="0" cellpadding="0" id="logotable">
<tr>
<td align="center" class="logorow1"><div class="logorow2"><a href="{U_INDEX}"><img src="templates/cs_red/images/logo_mid.gif" height="88" alt="{L_INDEX}" /></a></div></td>
</tr>
</table>
<table border="0" width="100%" cellspacing="0" cellpadding="0" id="buttonstable">
<tr>
<td align="center" valign="middle" width="100%" id="header-buttons">
<!-- BEGIN switch_user_logged_out -->
<a href="{U_REGISTER}">{L_REGISTER}</a> •
<!-- END switch_user_logged_out -->
<!-- BEGIN switch_user_logged_in -->
<a href="{U_PROFILE}">{L_PROFILE}</a> •
<a href="{U_PRIVATEMSGS}">{L_PRIVATEMSGS}</a> •
<!-- END switch_user_logged_in -->
<a href="{U_SEARCH}">{L_SEARCH}</a> •
<a href="{U_FAQ}">{L_FAQ}</a> •
<a href="{U_MEMBERLIST}">{L_MEMBERLIST}</a> •
<a href="{U_GROUP_CP}">{L_USERGROUPS}</a> •
<a href="{U_LOGIN_LOGOUT}">{L_LOGIN_LOGOUT}</a>
</td>
</tr>
</table>
<table border="0" width="100%" cellspacing="0" cellpadding="0" class="content">
<tr>
<td class="content" valign="top">
<!-- BEGIN switch_user_logged_in -->
<center><div class="pm-{PRIVMSG_IMG}"><a href="{U_PRIVATEMSGS}">{PRIVATE_MESSAGE_INFO}</a></div></center>
<!-- END switch_user_logged_in -->
<!-- AD HERE --><div align="center">
<script language='JavaScript' type='text/javascript' src='http://x10hosting.com/advert/adx.js'></script>
<script language='JavaScript' type='text/javascript'>
<!--
if (!document.phpAds_used) document.phpAds_used = ',';
phpAds_random = new String (Math.random()); phpAds_random = phpAds_random.substring(2,11);
document.write ("<" + "script language='JavaScript' type='text/javascript' src='");
document.write ("http://x10hosting.com/advert/adjs.php?n=" + phpAds_random);
document.write ("&what=zone:1&target=_blank");
document.write ("&exclude=" + document.phpAds_used);
if (document.referrer)
document.write ("&referer=" + escape(document.referrer));
document.write ("'><" + "/script>");
//-->
</script><noscript><a href='http://x10hosting.com/advert/adclick.php?n=a7fb3e9d' target='_blank'><img src='http://x10hosting.com/advert/adview.php?what=zone:1&n=a7fb3e9d' border='0' alt=''></a></noscript>
<!-- AD END HERE -->
<p />
</div>