<script language="Javascript" type="text/javascript">
<!--//
function check_uncheck(status)
{
if ( status == -1 )
{
var checked = document.post.select_all.checked;
for ( i = 0; i < document.post.elements.length; i++ )
{
if ( document.post.elements[i].name == 'delete_box[]' )
{
document.post.elements[i].checked = checked;
}
}
}
else if ( !status )
{
document.post.select_all.checked = false;
}
else
{
checked = true;
for ( i = 0; (i < document.post.elements.length) && checked; i++ )
{
if ( document.post.elements[i].name == 'delete_box[]' )
{
checked =  document.post.elements[i].checked;
}
}
document.post.select_all.checked = checked;
}
}
//-->
</script>

<table cellpadding="4" cellspacing="1" border="0" width="100%" class="forumline">
<colgroup>
<col width="40%">
<col width="60%">
</colgroup>
<tr>
<th colspan="2" class="thHead"><?php $this->_echo($d['.'][0]['L_FORM']); ?></th>
</tr>
<?php $this->_echo($d['.'][0]['SEARCH_FORM']); ?>
<tr>
<td class="catBottom" colspan="2" align="center"><span class="gensmall">&nbsp;
<?php if($_buttons_count = count($d['buttons'])) {for ($_buttons_i = 0; $_buttons_i < $_buttons_count; $_buttons_i++){ ?><input type="image" src="<?php $this->_echo($d['buttons'][$_buttons_i]['I_BUTTON']); ?>" name="<?php $this->_echo($d['buttons'][$_buttons_i]['BUTTON']); ?>" title="<?php $this->_echo($d['buttons'][$_buttons_i]['L_BUTTON']); ?>" <?php if($_accesskey_count = count($d['buttons'][$_buttons_i]['accesskey'])) {for ($_accesskey_i = 0; $_accesskey_i < $_accesskey_count; $_accesskey_i++){ ?>accesskey="<?php $this->_echo($d['buttons'][$_buttons_i]['S_BUTTON']); ?>"<?php }} ?> />&nbsp;<?php }} ?>
</span></td>
</tr>
</table>
<br style="font-size: 2px" />

<?php $this->_include('pagination_box.tpl'); ?>
<table cellpadding="4" cellspacing="1" border="0" width="100%" class="forumline">
<colgroup>
<col width="1%">
<col width="30%">
<col width="19%">
<col width="19%">
<col width="30%">
<col width="1%">
</colgroup>
<tr>
<th class="thCornerL">&nbsp;#&nbsp;</th>
<th class="thTop"><?php $this->_echo($d['.'][0]['L_FILE_NAME']); ?></th>
<th class="thTop"><?php $this->_echo($d['.'][0]['L_FILE_SIZE']); ?></th>
<th class="thTop"><?php $this->_echo($d['.'][0]['L_DOWNLOAD_COUNT']); ?></th>
<th class="thTop"><?php $this->_echo($d['.'][0]['L_LOCATION']); ?></th>
<th class="thCornerR"><input type="checkbox" name="select_all" onChange="javascript:check_uncheck(-1);" /></th>
</tr>
<?php if($_row_count = count($d['row'])) {for ($_row_i = 0; $_row_i < $_row_count; $_row_i++){ ?>
<tr>
<td class="<?php if($_light_count = count($d['row'][$_row_i]['light'])) {for ($_light_i = 0; $_light_i < $_light_count; $_light_i++){ ?>row1<?php }} else { ?>row2<?php } ?>" align="center"><span class="gen">
<?php $this->_echo($d['row'][$_row_i]['ROW_NUMBER']); ?>
</span></td>
<td class="<?php if($_light_count = count($d['row'][$_row_i]['light'])) {for ($_light_i = 0; $_light_i < $_light_count; $_light_i++){ ?>row1<?php }} else { ?>row2<?php } ?>"><span class="gen">
<a href="<?php $this->_echo($d['row'][$_row_i]['U_FILE_NAME']); ?>" title="<?php $this->_echo($d['.'][0]['L_DOWNLOAD']); ?>" class="gen" target="attachdownload"><?php $this->_echo($d['row'][$_row_i]['FILE_NAME']); ?></a>&nbsp;(<?php $this->_echo($d['row'][$_row_i]['EXTENSION']); ?>)<br />
<input type="text" class="post" name="file_comments[]" value="<?php $this->_echo($d['row'][$_row_i]['FILE_COMMENT']); ?>" size="40" />
</span></td>
<td class="<?php if($_light_count = count($d['row'][$_row_i]['light'])) {for ($_light_i = 0; $_light_i < $_light_count; $_light_i++){ ?>row1<?php }} else { ?>row2<?php } ?>" align="center"><span class="gen">
<?php $this->_echo($d['row'][$_row_i]['FILE_SIZE']); ?>&nbsp;<?php $this->_echo($d['row'][$_row_i]['UNIT']); ?>
</span></td>
<td class="<?php if($_light_count = count($d['row'][$_row_i]['light'])) {for ($_light_i = 0; $_light_i < $_light_count; $_light_i++){ ?>row1<?php }} else { ?>row2<?php } ?>" align="center"><span class="gen">
<input type="text" name="download_counts[]" value="<?php $this->_echo($d['row'][$_row_i]['DOWNLOAD_COUNT']); ?>" size="5" />
</span></td>
<td nowrap="nowrap" class="<?php if($_light_count = count($d['row'][$_row_i]['light'])) {for ($_light_i = 0; $_light_i < $_light_count; $_light_i++){ ?>row1<?php }} else { ?>row2<?php } ?>" align="center"><span class="gen">
<?php if($_privmsgs_count = count($d['row'][$_row_i]['privmsgs'])) {for ($_privmsgs_i = 0; $_privmsgs_i < $_privmsgs_count; $_privmsgs_i++){ ?>
<?php $this->_echo($d['.'][0]['L_PRIVMSGS']);if($_received_count = count($d['row'][$_row_i]['privmsgs'][$_privmsgs_i]['received'])) {for ($_received_i = 0; $_received_i < $_received_count; $_received_i++){ ?>&nbsp;(<?php $this->_echo($d['row'][$_row_i]['ATTACH_COUNT']); ?>)<?php }}}} else { ?>
<a href="<?php $this->_echo($d['row'][$_row_i]['U_VIEW_POST']); ?>" title="<?php $this->_echo($d['.'][0]['L_VIEW_POST']); ?>" class="gen"><?php $this->_echo($d['row'][$_row_i]['TOPIC_TITLE']); ?></a>
<?php } ?>
</span><br /><span class="gensmall">
<?php $this->_echo($d['row'][$_row_i]['FILE_TIME']); ?><br >
<?php if($_user_link_count = count($d['row'][$_row_i]['user_link'])) {for ($_user_link_i = 0; $_user_link_i < $_user_link_count; $_user_link_i++){ ?><a href="<?php $this->_echo($d['row'][$_row_i]['U_USERNAME']); ?>" title="<?php $this->_echo($d['.'][0]['L_USERNAME']); ?>" class="gensmall"><?php }}$this->_echo($d['row'][$_row_i]['USERNAME']);if($_user_link_count = count($d['row'][$_row_i]['user_link'])) {for ($_user_link_i = 0; $_user_link_i < $_user_link_count; $_user_link_i++){ ?></a><?php }} ?>
</span></td>
<td nowrap="nowrap" class="<?php if($_light_count = count($d['row'][$_row_i]['light'])) {for ($_light_i = 0; $_light_i < $_light_count; $_light_i++){ ?>row1<?php }} else { ?>row2<?php } ?>" align="center"><span class="gen">
<input type="checkbox" name="delete_box[]" value="<?php $this->_echo($d['row'][$_row_i]['ATTACH_ID']); ?>" onChange="javascript:check_uncheck(this.checked);" />
</span></td>
</tr>
<?php }} else { ?>
<tr>
<td colspan="6" height="45" align="center" class="row1"><span class="gen"><?php $this->_echo($d['.'][0]['L_NO_MATCHES']); ?></span></td>
</tr>
<?php } ?>
<tr>
<td class="catBottom" colspan="6" align="center"><?php if($_row_count = count($d['row'])) {for ($_row_i = 0; $_row_i < $_row_count; $_row_i++){ ?><input type="hidden" name="attach_ids[]" value="<?php $this->_echo($d['row'][$_row_i]['ATTACH_ID']); ?>"><?php }} ?><span class="genmed">&nbsp;<?php if($_details_count = count($d['details'])) {for ($_details_i = 0; $_details_i < $_details_count; $_details_i++){if($_buttons_count = count($d['details'][$_details_i]['buttons'])) {for ($_buttons_i = 0; $_buttons_i < $_buttons_count; $_buttons_i++){ ?><input type="image" src="<?php $this->_echo($d['details'][$_details_i]['buttons'][$_buttons_i]['I_BUTTON']); ?>" name="<?php $this->_echo($d['details'][$_details_i]['buttons'][$_buttons_i]['BUTTON']); ?>" title="<?php $this->_echo($d['details'][$_details_i]['buttons'][$_buttons_i]['L_BUTTON']); ?>" <?php if($_accesskey_count = count($d['details'][$_details_i]['buttons'][$_buttons_i]['accesskey'])) {for ($_accesskey_i = 0; $_accesskey_i < $_accesskey_count; $_accesskey_i++){ ?>accesskey="<?php $this->_echo($d['details'][$_details_i]['buttons'][$_buttons_i]['S_BUTTON']); ?>"<?php }} ?> />&nbsp;<?php }}}} ?></span></td>
</tr>
</table>
<?php $this->_include('pagination_box.tpl'); ?>
<br clear="all" />