<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" id="editForm">
		<table width="100%" cellspacing="0" cellpadding="5" border="0">
		<tr class="line">
		<td><div class="labelBox">{rs:TITLE}<span class="red">*</span>:</div></td>
		<td><div class="inputBox"><input type="text" name="r[title]" value="{title}" class="big"></div></td>
		</tr>

		<tr class="line">
		<td><div class="labelBox">{rs:POSITION}:</div></td>
		<td><div class="inputBox"><input type="text" name="r[position]" value="{position}" class="small"></div></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:DEF_VALUE}:</div></td>
		<td><div class="inputBox"><input type="text" name="r[def_value]" value="{def_value}" class="big"></div></td>
		</tr>

{if:!is_list_val}
		<tr class="line">
		<td><div class="labelBox">{rs:VALIDATION}:</div></td>
		<td class="td_value">
			<select name="r[validation]">
			{row:VALIDATION_SELECT}
			<option value="{id}"{selected}>{title}</option>
			{/row}
			</select>
		</td>
		</tr>
{/if}

{if:is_list_val}
		<tr class="line">
		<td><div class="labelBox" valign="center">{rs:LIST_VAL}<span class="red">*</span>:</div></td>
		<td><div class="textareaBox"><textarea name="r[list_val]" rows="3" class="big">{list_val}</textarea></div></td>
		</tr>
{/if}

		<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:NOT_NULL}:</div></td>
		<td><input type="checkbox" name="r[not_null]" value="1"{if:not_null} checked{/if}></td>
		</tr>

		<tr>
		<td><img src="{global:PATH}img/spacer.gif" width="200" height="1" border="0" alt=""></td>
		<td align="right" width="100%"><img src="{global:PATH}img/spacer.gif" width="1" 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_USERS_CREATE}{/if}
			{if:id}{rs:INFO_USERS_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>
	$(".actionSave").click(function() {
		$("#editForm").submit();
	});
	$(".actionCancel").click(function() {
		if (confirm("{rs:SURE_CANCEL_EDIT}")) window.location.href="{global:BACK_LINK}";
	});
	$("#editForm").keydown(function(event) {
  		if (event.keyCode == '13' && event.target.nodeName!='TEXTAREA') $(".actionSave").triggerHandler('click');
  		if (event.keyCode == '27') {
			$(".actionCancel").triggerHandler('click');
		}
	});
</script>



