<inp2:m_Set skip_last_template="1"/>
<inp2:m_include t="incs/header"/>
<inp2:m_RenderElement name="combined_header" prefix="trans" section="in-portal:root" title_preset="trans_edit"/>

<!-- ToolBar -->
<table class="toolbar" height="30" cellspacing="0" cellpadding="0" width="100%" border="0">
<tbody>
	<tr>
	  	<td>
	  		<script type="text/javascript">
					a_toolbar = new ToolBar();

	  				a_toolbar.AddButton( new ToolBarButton('select', '<inp2:m_phrase label="la_ToolTip_Save" escape="1"/>', function() {
								document.getElementById('frm').submit();
							}
						) );
					a_toolbar.AddButton( new ToolBarButton('cancel', '<inp2:m_phrase label="la_ToolTip_Cancel" escape="1"/>', function() {
								window_close();
							}
					 	) );

					a_toolbar.Render();
			</script>

		</td>
	</tr>
</tbody>
</table>
</form>

<div id="scroll_container" style="">
<table class="edit-form">
	<tr><td style="padding: 0px">
		<script type="text/javascript">
			var $TargetField = '<inp2:m_Get var="TargetField"/>';

			function FCKeditor_OnComplete( editorInstance )
			{
				var $opener = getWindowOpener(window);

				if ($opener && !$opener.closed) {
					current = $opener.document.getElementById($TargetField).value;
					editorInstance.SetHTML(current);
				}
				else {
					window_close();
				}

				Form.Resize();
			}

			function update_opener()
			{
				d = document.getElementById('Content');
				if (d.form) {
					if (d.form.onsubmit) {
						d.form.onsubmit()
					}
				}

				var $opener = getWindowOpener(window);

				if (!$opener) {
					return;
				}

				if (!$opener.closed) {
					current = $opener.document.getElementById($TargetField);
					current.value = document.getElementById('Content').value;
				}

				window_close();
			}

		</script>
		<form name="frm" id="frm" action="javascript:update_opener();">
			<inp2:m_if check="adm_UsePopups">
				<inp2:adm_FCKEditor name="Content" width="100%" height="100" late_load="1"/>
			<inp2:m_else/>
				<inp2:adm_FCKEditor name="Content" width="100%" height="100" height="500"/>
			</inp2:m_if>
		</form>
		<script type="text/javascript">
			Form.addControl('Content___Frame');
		</script>
	</td></tr>
</table>
</div>
<inp2:m_Set _force_popup="1"/>
<inp2:m_include t="incs/footer"/>