def heading(title, fgcol, bgcol,extras='',add='&nbsp;<br>'):
    """Format a page heading."""
    return '''
    <table width="100%%" cellspacing=0 cellpadding=2 border=0
    summary="heading">
    <tr bgcolor="%s">
    <td valign=bottom>%s
    <font color="%s" face="helvetica, arial">&nbsp;<br>%s</font></td
    ><td align=right valign=bottom
    ><font color="%s" face="helvetica, arial">%s</font></td></tr></table>
    ''' % (bgcol, add,fgcol, title, fgcol, extras or '&nbsp;')