<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>
				<div class="button" id="actionNew">
					<div class="buttonRight">
						<div class="buttonMiddle">{rs:ACTION_AUTORESPONDER}</div>
					</div>
				</div>
			</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>
			</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_date}" class="{sort_date_img}">{rs:DATE_CREATED}</a></td>
		<td><a href="{sort_by_title}" class="{sort_title_img}">{rs:NEWSLETTER}</a></td>
		<td><a href="{sort_by_start}" class="{sort_start_img}">{rs:START}</a></td>
		<td><a href="{sort_by_end}" class="{sort_end_img}">{rs:END}</a></td>
		<td>&nbsp;</td>
		</tr>

		{row:LINE}
		<tr class="line{if:disabled} grey{/if}">
		<td><input type="checkbox" name="del[]" value="{id}"></td>
		<td align="center">{date_created}</td>
		<td class="title">{newsletter_title}</td>
		<td align="center">{start}</td>
		<td align="center">{end}{if:!end}-{/if}</td>
		<td class="action"><a href="{global:LINK}{if:global:LINK}&{/if}{unless:global:LINK}?{/unless}edit={id}">{rs:ACTION_EDIT}</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="60" height="1" border="0" /></td>
		<td width="100%"><img src="{global:PATH}img/spacer.gif" width="100" height="1" border="0" /></td>
		<td><img src="{global:PATH}img/spacer.gif" width="60" height="1" border="0" /></td>
		<td><img src="{global:PATH}img/spacer.gif" width="60" 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 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='_cp']").change(function() {
		$("#filterForm").submit();
	});
	$("#actionOk").click(function() {$("#filterForm").submit();});
	$("#actionNew").click(function() {window.location.href="{global:LINK}{if:LINK}&{/if}{unless:LINK}?{/unless}edit=0";});
	$(".actionDelete").click(function() {
		if (confirm("{rs:SURE_DELETE_TEMPLATES}")) {
		$("#recordsList").find("input[name='act']").attr('value', 'del');
		$("#recordsList").submit();
		}
	});
	$("input[name='all']").click(function() {
		$("input[name*='del']").attr('checked', this.checked);
	});
</script>
