<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">


<script type="text/javascript" src="{global:PATH}js/tiny_mce/tiny_mce.js"></script>
<script type="text/javascript">
tinyMCE.init({
	// General options
	mode : "textareas",
	theme : "advanced",
	plugins : "safari,spellchecker,pagebreak,style,layer,table,save,advhr,advimage,advlink,emotions,iespell,inlinepopups,insertdatetime,preview,media,searchreplace,print,contextmenu,paste,directionality,fullscreen,noneditable,visualchars,nonbreaking,xhtmlxtras,template,imagemanager,filemanager",
	editor_selector : "Editor",
	file_browser_callback : "mcImageManager.filebrowserCallBack",
	//document_base_url: "http://old_mail/",
	remove_script_host : false,
	relative_urls : false,
	//convert_urls : false,

	// Theme options
	theme_advanced_buttons1 : "save,newdocument,|,bold,italic,underline,strikethrough,|,justifyleft,justifycenter,justifyright,justifyfull,|,styleselect,formatselect,fontselect,fontsizeselect",
	theme_advanced_buttons2 : "cut,copy,paste,pastetext,pasteword,|,search,replace,|,bullist,numlist,|,outdent,indent,blockquote,|,undo,redo,|,link,unlink,anchor,image,cleanup,code,|,insertdate,inserttime,preview,|,forecolor,backcolor",
	theme_advanced_buttons3 : "tablecontrols,|,hr,removeformat,visualaid,|,sub,sup,|,charmap,emotions,iespell,media,advhr,|,print,|,ltr,rtl,|,fullscreen",
	theme_advanced_buttons4 : "insertlayer,moveforward,movebackward,absolute,|,styleprops,spellchecker,|,cite,abbr,acronym,del,ins,attribs,|,visualchars,nonbreaking,template,blockquote,pagebreak,|,insertfile,insertimage",
	theme_advanced_toolbar_location : "top",
	theme_advanced_toolbar_align : "left",
	theme_advanced_statusbar_location : "bottom",
	theme_advanced_resizing : false

	// Example content CSS (should be your site CSS)
	//content_css : "css/example.css",

	// Drop lists for link/image/media/template dialogs
	//template_external_list_url : "js/template_list.js",
	//external_link_list_url : "js/link_list.js",
	//external_image_list_url : "js/image_list.js",
	//media_external_list_url : "js/media_list.js",

	// Replace values for the template plugin
	//template_replace_values : {
	//	username : "Some User",
	//	staffid : "991234"
	//}
});
</script>
		{ERROR}
		<form method="post" id="editForm" enctype="multipart/form-data">
		<table width="100%" cellspacing="0" cellpadding="5" border="0">
		<tr>
		<td><div class="labelBox">{rs:TITLE}<span class="red">*</span>:</div></td>
		<td><div class="inputBox"><input type="text" name="r[title]" value="{title}"></div></td>
		</tr>

		<tr><td colspan="2"><img src="{global:PATH}img/spacer.gif" width="1" height="10" border="0" alt=""></td></tr>
		<tr class="header"><td colspan="2">{rs:TEXT_VERSION}</td></tr>

		<tr class="line">
		<td colspan="2">
			<div class="labelBox">{rs:CONTENT}:</div>
			<div class="textareaBox"><textarea name="r[text_content]" rows="30">{text_content}</textarea></div>
		</td>
		</tr>

		<tr><td colspan="2"><img src="{global:PATH}img/spacer.gif" width="1" height="10" border="0" alt=""></td></tr>
		<tr class="header"><td colspan="2">{rs:HTML_VERSION}</td></tr>


		<tr class="line">
		<td colspan="2">
			<div class="labelBox">{rs:CONTENT}:</div>
			<div class="editorBox"><textarea name="r[html_content]" rows="5" class="Editor">{html_content}</textarea></div>
			<div id="variablesBox">
				<span id="variablesButton">{rs:LIST_OF_VARIABLES}</span>
				{include:templates/codes.tpl}
			</div>
		</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>
</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}";
	});
	$("#variablesButton").click(function() {
		$("#variablesList").slideToggle('fast');
	});
	$("#editForm").keydown(function(event) {
  		if (event.keyCode == '13' && event.target.nodeName!='TEXTAREA') $(".actionSave").triggerHandler('click');
  		if (event.keyCode == '27') {
			$(".actionCancel").triggerHandler('click');
		}
	});
</script>
