<div class="actionPanelLeft">
	<div class="actionPanelRight p16">
		<div id="actionTop" class="right">
			<div class="button actionSave">
				<div class="buttonRight">
					<div class="buttonMiddle">{rs:ACTION_SAVE}</div>
				</div>
			</div>

			<div class="button actionCancel">
				<div class="buttonRight">
					<div class="buttonMiddle">{rs:ACTION_CANCEL}</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 class="line">
		<td><div class="labelBox">{rs:NEWSLETTER}:</div></td>
        	<td>
                	<select name="r[newsletter_id]">
                	{row:NEWSLETTER_SELECT}
                	<option value="{id}"{selected}>{title}</option>
                	{/row}
                	</select>
        	</td>
        	</tr>

        	<tr class="line">
        	<td><div class="labelBox">{rs:ENABLED}:</div></td>
        	<td><input type="checkbox" name="r[enabled]" value="1"{if:enabled} checked{/if}></td>
        	</tr>

        	<tr class="line">
        	<td><div class="labelBox">{rs:TYPE}:</div></td>
        	<td>
                	<select name="r[type]" onchange="save.value=0; submit();">
                	{row:TYPE_SELECT}<option value="{id}" {selected}>{title}</option>{/row}
                	</select>
        	</td>
        	</tr>

       		<tr class="line">
        	<td><div class="labelBox">{rs:START_TIME}<span class="red">*</span>:</div></td>
        	<td>
			<div class="inputBox time left"><input type="text" name="r[start_time]" value="{start_time}" maxlength="5"></div>
                	<div class="fieldInfo">hh:mm</div>
			<div class="br"><img src="{global:PATH}img/spacer.gif" width="1" height="1" border="0" /></div>
 	        </td>
		</tr>

        	<tr class="line">
        	<td><div class="labelBox">{rs:START_DATE}<span class="red">*</span>:</div></td>
        	<td>
			<div class="inputBox date"><input type="text" name="r[start_date]" id="r[start_date]" value="{start_date}" readonly="readonly" maxlength="10"></div>
        	</td>
        	</tr>

        	{if:show_end}
        	<tr class="line">
        	<td><div class="labelBox">{rs:END_TIME}:</div></td>
        	<td>
			<div class="inputBox time left"><input type="text" name="r[end_time]" value="{end_time}" maxlength="5"></div>
                	<div class="fieldInfo">hh:mm</div>
			<div class="br"><img src="{global:PATH}img/spacer.gif" width="1" height="1" border="0" /></div>
		</td>
	        </tr>

        	<tr class="line">
        	<td><div class="labelBox">{rs:END_DATE}:</div></td>
        	<td>
                	<div class="inputBox date"><input type="text" name="r[end_date]" id="r[end_date]" value="{end_date}" readonly="readonly" maxlength="10"></div>
	        </td>
		</tr>
		{/if}

        	{if:period_type}
        	<tr class="line">
        	<td><div class="labelBox">{rs:EVERY}:</div></td>
        	<td>
                	<div class="inputBox small left"><input type="text" name="r[period]" value="{period}" maxlength="2"></div>
                	<div class="fieldInfo">{period_type}</div>
		</td>
        	</tr>
        	{/if}

        	{if:list_title}
        	<tr class="line">
        	<td valign="top"><div class="labelBox">{list_title}:</div></td>
		<td>
			<div class="checkBoxItem">
				<div class="checkBox"><input type="checkbox" name="all_list" id="all_list" value=""></div>
				<div class="label"><label for="all_groups"><b>{rs:SELECT_ALL}</b></label></div>
			</div>
			{row:LIST}
			<div class="checkBoxItem">
				<div class="checkBox"><input type="checkbox" name="r[list][]" id="list_{id}" value="{id}"{if:selected} checked{/if}></div>
				<div class="label"><label for="list_{id}">{title}</label></div>
			</div>
			{/row}
			<div class="br"><img src="{global:PATH}img/spacer.gif" width="1" height="1" border="0"></div>
	        </td>
		</tr>
		{/if}

        	<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="`" height="1" border="0" alt=""></td>
        	</tr>
        	</table>
		<input type="hidden" name="save" value="1" class="hidden">
        	</form>

		<div class="info">
			{if:!id}{rs:INFO_AUTORESPONDER_CREATE}{/if}
			{if:id}{rs:INFO_AUTORESPONDER_EDIT}{/if}
		</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 actionSave">
							<div class="buttonRight">
								<div class="buttonMiddle">{rs:ACTION_SAVE}</div>
							</div>
						</div>

						<div class="button actionCancel">
							<div class="buttonRight">
								<div class="buttonMiddle">{rs:ACTION_CANCEL}</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 language="JavaScript" src="{global:PATH}js/attach.js"></script>
<script language="JavaScript">
	$(".date").find("input").click(function() {
		Calendar.Create($(this).attr('name'), $(this).parent().offset().left+$(this).parent().outerWidth()+10, $(this).parent().offset().top);
	});
	$(".actionSave").click(function() {
		$("#editForm").submit();
	});
	$(".actionCancel").click(function() {
		if (confirm("{rs:SURE_CANCEL_EDIT}")) window.location.href="{global:BACK_LINK}";
	});
	$("input[name='all_list']").click(function() {
		$("input[name*='r[list]']").attr('checked', this.checked);
	});
	$("#editForm").keydown(function(event) {
  		if (event.keyCode == '13' && event.target.nodeName!='TEXTAREA') $(".actionSave").triggerHandler('click');
  		if (event.keyCode == '27') {
			$(".actionCancel").triggerHandler('click');
		}
	});
</script>

