<div class="actionPanelLeft">
	<div class="actionPanelRight p16">
		<div id="actionTop" class="right">
			<div class="button actionNext">
				<div class="buttonRight">
					<div class="buttonMiddle">{rs:NEXT}</div>
				</div>
			</div>
			<div class="br"><img src="{global:PATH}img/spacer.gif" width="1" height="1" border="0" /></div>
		</div>
	</div>
</div>
<div class="middleLeft">
	<div class="middleRight p16">
		{ERROR}
		<form method="post" enctype="multipart/form-data" id="editForm">
		<table width="100%" cellspacing="0" cellpadding="5" border="0">
		<tr>
		<td colspan="2">
			<div class="labelBox">{rs:ADD_TO_MAILING_GROUPS}:</div>
			{if:mg_list}
			<div class="checkBoxItem">
				<div class="checkBox"><input type="checkbox" name="all_groups" id="all_groups" value=""></div>
				<div class="label"><label for="all_groups"><b>{rs:SELECT_ALL}</b></label></div>
			</div>
			{/if}
			{if:!mg_list}<b>{rs:NO_MG_LIST}</b>{/if}
			{row:GROUPS_SELECT}
			<div class="checkBoxItem">
				<div class="checkBox"><input type="checkbox" name="r[add_groups][]" id="add_groups_{id}" value="{id}"{if:selected} checked{/if}></div>
				<div class="label"><label for="add_groups_{id}">{title}</label></div>
			</div>
			{/row}
			<div class="br"><img src="{global:PATH}img/spacer.gif" width="1" height="10" border="0"></div>
		</td>
		</tr>

		<tr>
		<td><div class="inputBox"><input type="text" name="r[new_group]" value="{new_group}"></div></td>
		<td>
			<div class="button actionAdd">
				<div class="buttonRight">
					<div class="buttonMiddle">{rs:ACTION_ADD} {rs:MAILING_GROUP}</div>
				</div>
			</div>
			<div class="br"><img src="{global:PATH}img/spacer.gif" width="1" height="1" border="0" /></div>	
		</td>
		</tr>

		<tr>
		<td><img src="{global:PATH}img/spacer.gif" width="200" height="1" border="0" alt=""></td>
		<td width="100%"><img src="{global:PATH}img/spacer.gif" width="100" height="1" border="0" alt=""></td>
		</tr>
		</table>
		<input type="hidden" name="save" value="1" class="hidden">
		</form>
		<div class="info">{rs:INFO_EXPORT}</div>
	</div>
</div>
<div class="actionPanelLeft">
	<div class="actionPanelRight">
		<div class="actionPanelBottom">
			<div class="actionPanelBottomLeft">
				<div class="actionPanelBottomRight p16">
					<div id="actionBottom" class="right">
						<div class="button actionNext">
							<div class="buttonRight">
								<div class="buttonMiddle">{rs:NEXT}</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>
	$(".actionAdd").click(function() {
		$("#editForm").find("input[name='save']").attr('value', '0');
		$("#editForm").submit();
	});
	$(".actionNext").click(function() {
		$("#editForm").submit();
	});
	$("input[name='all_groups']").click(function() {
		$("input[name*='r[add_groups]']").attr('checked', this.checked);
	});
	$("#editForm").keydown(function(event) {
  		if (event.keyCode == '13' && event.target.nodeName!='TEXTAREA') $(".actionNext").triggerHandler('click');
	});
</script>
