<div class="actionPanelLeft">
	<div class="actionPanelRight p16">
		<div id="actionTop">
			<form action="{FILTER_LINK}" method="POST" id="filterForm">
			<table width="100%" cellspacing="0" cellpadding="0" border="0">
			<tr>
			<td><img src="{global:PATH}img/spacer.gif" width="1" height="1" border="0" /></td>

			<td class="space"><div class="labelBox">{rs:TITLE_NEWSLETTERS}:</div></td>
			<td>
				<select name="n_id" id="n_id_field">
				<option value="0">{rs:ANY}</option>
				{row:NEWSLETTERS_SELECT}
				<option value="{id}"{selected}>{title}</option>
				{/row}
				</select>
			</td>

			<td class="space"><div class="labelBox">{rs:COUNT_PER_PAGE}:</div></td>
			<td>
				<select name="_cp">
				{row:REC_COUNT}
				<option value="{title}" {selected}>{title}</option>
				{/row}
				</select>
			</td>
			</tr>

			<tr>
			<td width="100%"><img src="{global:PATH}img/spacer.gif" width="1" height="1" border="0" /></td>
			<td><img src="{global:PATH}img/spacer.gif" width="1" height="1" border="0" /></td>
			<td><img src="{global:PATH}img/spacer.gif" width="1" height="1" border="0" /></td>
			<td><img src="{global:PATH}img/spacer.gif" width="1" height="1" border="0" /></td>
			<td><img src="{global:PATH}img/spacer.gif" width="1" height="1" border="0" /></td>
			</tr>
			</table>
			<input type="hidden" name="_search" value="{search}">
			</form>
		</div>
	</div>
</div>
<div class="middleLeft">
	<div class="middleRight p16">

		{ERROR}
		{MESSAGE}
		<form action="{LINK}" method="POST" id="recordsList">
		<input type="hidden" name="act" value="">
		<table width="100%" cellspacing="0" cellpadding="5" border="0" class="table">
		<tr class="header">
		<td><input type="checkbox" name="all" value=""></td>
		<td><a href="{sort_by_id}" class="{sort_id_img}">ID</a></td>
		<td><a href="{sort_by_date}" class="{sort_date_img}">{rs:DATE}</a></td>
		<td><a href="{sort_by_mail}" class="{sort_mail_img}">{rs:MAIL}</a></td>
		<td><a href="{sort_by_name}" class="{sort_name_img}">{rs:NEWSLETTER}</a></td>
		<td>&nbsp;</td>
		</tr>

		{row:LINE}
		<tr class="line{if:disabled} grey{/if}">
		<td><input type="checkbox" name="id[]" value="{id}"></td>
		<td align="right">{id}</td>
		<td align="center">{last_update}</td>
		<td>{mail_to}</td>
		<td class="title">{name}</td>
		<td class="action"><a href="{global:LINK}{if:global:LINK}&{/if}{unless:global:LINK}?{/unless}edit={id}">{rs:ACTION_DETAILS}</a></td>
		</tr>
		{/row}

		{if:!count}<tr><td class="emptyResult" colspan="6">{rs:EMPTY}</td></tr>{/if}

		<tr>
		<td><img src="{global:PATH}img/spacer.gif" width="20" height="1" border="0" /></td>
		<td><img src="{global:PATH}img/spacer.gif" width="30" height="1" border="0" /></td>
		<td><img src="{global:PATH}img/spacer.gif" width="60" height="1" border="0" /></td>
		<td width="50%"><img src="{global:PATH}img/spacer.gif" width="100" height="1" border="0" /></td>
		<td width="50%"><img src="{global:PATH}img/spacer.gif" width="100" height="1" border="0" /></td>
		<td><img src="{global:PATH}img/spacer.gif" width="50" height="1" border="0" /></td>
		</tr>
		</table>
		</form>
		{if:offset}<div class="offset">{offset}</div>{/if}
	</div>
</div>
<div class="actionPanelLeft">
	<div class="actionPanelRight">
		<div class="actionPanelBottom">
			<div class="actionPanelBottomLeft">
				<div class="actionPanelBottomRight p16">
					<div id="actionBottom">
						{if:is_restore}
						<div class="button actionRestore">
							<div class="buttonRight">
								<div class="buttonMiddle">{rs:ACTION_RESTORE}</div>
							</div>
						</div>
						{/if}
						<div class="button actionReSend">
							<div class="buttonRight">
								<div class="buttonMiddle">{rs:ACTION_RESEND}</div>
							</div>
						</div>
						<div class="button actionDelete">
							<div class="buttonRight">
								<div class="buttonMiddle">{rs:ACTION_DEL}</div>
							</div>
						</div>
						<div class="br"><img src="{global:PATH}img/spacer.gif" width="1" height="1" border="0" /></div>
					</div>
				</div>
			</div>
		</div>
	</div>
</div>

<script>
	$("#filterForm").submit(function() {$(this).find("input[name='_search']").val($("input[name='_searchContainer']").attr('value'));});
	$("#filterForm").find("select[name='n_id'],select[name='_cp']").change(function() {$("#filterForm").submit();})
	$("#actionOk").click(function() {$("#filterForm").submit();});
	$(".actionRestore").click(function() {
		$("#recordsList").find("input[name='act']").attr('value', 'restore');
		$("#recordsList").submit();
	});
	$(".actionReSend").click(function() {
		$("#recordsList").find("input[name='act']").attr('value', 'send');
		$("#recordsList").submit();
	});
	$(".actionDelete").click(function() {
		if (confirm("{rs:SURE}")) {
			$("#recordsList").find("input[name='act']").attr('value', 'del');
			$("#recordsList").submit();
		}
	});
	$("input[name='all']").click(function() {
		$("input[name*='id']").attr('checked', this.checked);
	});
</script>