<form method="post" action="pm.php?action=delete&folder=$folder">
<input type="hidden" name="formhash" value="{FORMHASH}">
<div class="spaceborder spacebottom" style="width: 100%">
<table cellspacing="{INNERBORDERWIDTH}" cellpadding="{TABLESPACE}" width="100%" style="table-layout: fixed; word-break: break-all; border-collapse: separate">
<tr align="center" class="header"><td width="60"><input class="checkbox" type="checkbox" name="chkall" class="header" onclick="checkall(this.form)">{lang delete_check}</td>
<td>{lang subject}</td>
<td width="15%"><!--{if $folder != 'outbox' && $folder != 'track'}-->{lang from}<!--{else}-->{lang to}<!--{/if}--></td>
<td width="20%">{lang time}</td></tr>
<!--{loop $pmlist $pm}-->
	<tr class="row" valign="top" id="pm_$pm[pmid]">
	<!--{if $folder == 'inbox' && $pm['announce']}-->
		<td align="center">&nbsp;</td><td><a href="pm.php?action=view&folder=announce&pmid=$pm[pmid]" onclick="showpm(event, this)" id="pm_view_$pm[pmid]">$pm[subject]</a>
	<!--{else}-->
		<td align="center"><input class="checkbox" type="checkbox" name="delete[]" value="$pm[pmid]"></td>
		<td>
		<!--{if $folder == 'outbox'}-->
			<a href="pm.php?action=send&folder=outbox&pmid=$pm[pmid]">$pm[subject]</a>
		<!--{else}-->
			<a href="pm.php?action=view&folder=$folder&pmid=$pm[pmid]" onclick="showpm(event, this)" id="pm_view_$pm[pmid]">$pm[subject]</a>
		<!--{/if}-->
	<!--{/if}-->
	</td>
	<td align="center">
	<!--{if $folder == 'inbox'}-->
		<!--{if $pm['announce']}-->
			{lang pm_announce}
		<!--{else}-->
			<a href="space.php?uid=$pm[msgfromid]">$pm[msgfrom]</a>
		<!--{/if}-->
	<!--{else}-->
		<a href="space.php?uid=$pm[msgtoid]">$pm[msgto]</a>
	<!--{/if}-->
	</td>
	<td align="center"><span class="smalltxt">$pm[dateline]</span></td>
	</tr>
<!--{/loop}-->
</table></div>

<table cellspacing="0" cellpadding="0" border="0" width="100%" style="margin-top: {TABLESPACE}px">
<tr><td>$multipage</td></tr>
<tr><td><br><div class="option" style="width: 100%"><div class="submitbutton"><input class="button" type="submit" value="{lang submit}"></div></div></td></tr>
</table>
</form>

<br>
<div class="spaceborder" style="padding-right:1px !important;padding-right:4px; width: 100%; height: 29px !important; height: 36px; {CATBGCODE};border: 1px solid {CATBORDER}; text-align: left;">
<div class="right" style="padding-right:4px !important;padding-right:0px; margin-top: 7px;">{lang pm_total}: <span id="pm_total">$pm_total</span> {lang pm_storage}: $maxpmnum</div>
<div class="tableborder" style="width: 60%; margin: 4px; float: left">
<div style="width: $storage_percent; height: 22px; line-height: 0px; font-size: 0px; float: left" class="header"></div>
</div>
</div>
<!--{if $folder != 'outbox'}-->
	<script type="text/javascript">
	var prepmdiv = '';
	var folder = '$folder';
	function showpm(e, obj) {
		var url = obj.href + '&inajax=yes';
		var currpmdiv = obj.id + '_div';
		if(!$(currpmdiv)) {
			var x = new Ajax();
			x.get(url, function(s){
				//debug 确定表格和当前所在行，插入行，列。
				var table1 = obj.parentNode.parentNode.parentNode.parentNode;
				var row1 = table1.insertRow(obj.parentNode.parentNode.rowIndex + 1);
				row1.id = currpmdiv;
				row1.className = 'row';
				var cell1 = row1.insertCell(0);
				cell1.innerHTML = '&nbsp;';
				cell1.className = 'altbg1';
				var cell2 = row1.insertCell(1);
				cell2.colSpan = '3';
				cell2.innerHTML = s;
				cell2.className = 'altbg1';

				if(prepmdiv) {
					$(prepmdiv).style.display = 'none';
				}
				changestatus(obj);
				prepmdiv = currpmdiv;
			})
		} else {
			if($(currpmdiv).style.display == 'none') {
				$(currpmdiv).style.display = '';
				changestatus(obj);
				if(prepmdiv) {
					$(prepmdiv).style.display = 'none';
				}
				prepmdiv = currpmdiv;
			} else {
				$(currpmdiv).style.display = 'none';
				prepmdiv = '';
			}
		}
		doane(e);
	}
	function deletepm(obj) {
		var pmid = obj.id.substr(obj.id.lastIndexOf('_'));
		$('pm' + pmid).style.display = 'none';
		$('pm_view' + pmid + '_div').style.display = 'none';
		if(folder == 'inbox') {
			$('pm_inbox').innerHTML = parseInt($('pm_inbox').innerHTML) - 1;
			$('pm_total').innerHTML = parseInt($('pm_total').innerHTML) - 1;
		}
	}
	function markunread(obj) {
		var pmid = obj.id.substr(obj.id.lastIndexOf('_'));
		$('pm_view' + pmid).innerHTML = '<b>' + $('pm_view' + pmid).innerHTML + '</b>';
		$('pm_view' + pmid + '_div').style.display = 'none';
		prepmdiv = '';
		if(folder == 'inbox') $('pm_unread').innerHTML = parseInt($('pm_unread').innerHTML) + 1;
	}
	function changestatus(obj) {
		if(obj.innerHTML.substr(0, 3).toLowerCase() == '<b>') {
			obj.innerHTML = obj.innerHTML.substr(3, obj.innerHTML.length - 7);
			if(folder == 'inbox') $('pm_unread').innerHTML = parseInt($('pm_unread').innerHTML) - 1;
		}
	}
	</script>
<!--{/if}-->