
<br />
<script type="text/javascript">
<!--
var url = '{$core.rel_url}new.php?cat=associate&';

function removeEmails(f)
{
    if (!hasOneChecked(f, 'emails[]')) {
        alert('{t escape=js}Please choose which entries need to be removed.{/t}');
        return false;
    }
    // loop through all of the form elements and build a dynamic url
    for (var i = 0; i < f.elements.length; i++) {
        if ((f.elements[i].name == 'emails[]') && (!f.elements[i].checked)) {
            url += 'item[]=' + f.elements[i].value + '&';
        }
    }
    window.location.href = url;
}
//-->
</script>

      <table class="bordered medium">
        <tr class="title">
          <th colspan="3">
            {t}Attached Emails{/t}
          </th>
        </tr>
        <tr>
            <th width="10">{t}Remove?{/t}</th>
            <th>{t}Sender{/t}</th>
            <th>{t}Subject{/t}</th>
            <th width="10"><nobr>{t}Notify Sender?{/t}</nobr></th>
          </tr>
          {section name="i" loop=$emails}
          <tr class="{cycle values='odd,even'}">
            <td align="center">
              <input type="checkbox" name="emails[]" value="{$emails[i].sup_id}">
            </td>
            <td width="30%">
              {$emails[i].sup_from|escape:"html"}
            </td>
            <td width="50%">
              {$emails[i].sup_subject|escape:"html"}
            </td>
                <td align="center">
                  <input type="checkbox" name="notify_senders[]" value="{$emails[i].sup_id}">
                </td>
              </tr>
              {/section}
              <tr>
                <td colspan="4">
                  <input type="button" value="{t}Remove Selected{/t}" onClick="removeEmails(this.form);">
                </td>
              </tr>
          </td>
        </tr>
</table>

