<div class="BodyContainer">

	<script language="JavaScript" type="text/javascript">

		function ConfirmCancel()
		{
			if(confirm('%%LNG_TemplateCancelMessage%%'))
			{
				document.location.href='index.php?ToDo=viewTemplates';
			}
			else
			{
				return false;
			}
		}

		function CheckEditTemplateForm()
		{
			// Make sure that all of the form variables, etc are valid
			var f = document.frmTpl;

			if(f.filedata.value.length == 0)
			{
				alert('%%LNG_NoTemplateData%%');
				f.filedata.focus();
				f.filedata.select();
				return false;
			}

			// Everything is OK, return true
			return true;
		}

	</script>

	<form action="index.php?ToDo=saveUpdatedTemplate" onSubmit="return CheckEditTemplateForm()" name="frmTpl" method="post">
	<input type="hidden" name="template" value="%%GLOBAL_Template%%">
	<input type="hidden" name="file" value="%%GLOBAL_File%%">
	<table class="OuterPanel" cellspacing="0" cellpadding="0" border="0">
	  <tr>
		<td class="Heading1" id="tdHeading">%%LNG_EditTemplateTitle%%</td>
		</tr>
		<tr>
		<td class="Intro">
			<div>%%LNG_EditTemplateIntro%%</div>
			%%GLOBAL_Message%%
			<div>
			<input type="submit" name="Save" value="%%LNG_Save%%" class="FormButton">
			<input type="submit" name="SaveExit" value="%%LNG_SaveExit%%" class="FormButton">
			<input type="button" name="CancelButton1" value="%%LNG_Cancel%%" class="FormButton" onClick="ConfirmCancel()">
			</div>
		</td>
	  </tr>
		<tr>
			<td>
			  <table class="Panel">
				<tr>
				  <td class="Heading2" colspan=2>%%GLOBAL_ContentsHeader%%</td>
				</tr>
					<tr>
						<td colspan="2">
							<textarea name="filedata" rows="30" class="Field500" style="font-family:Courier New;font-size:10pt;width:100%;width: 100%">%%GLOBAL_FileData%%</textarea>
						</td>
					</tr>
					<tr>
						<td colspan="2" class="Gap"><div><input type="submit" name="Save" value="%%LNG_Save%%" class="FormButton">&nbsp; <input type="submit" name="SaveExit" value="%%LNG_SaveExit%%" class="FormButton">&nbsp; <input type="button" name="CancelButton1" value="%%LNG_Cancel%%" class="FormButton" onClick="ConfirmCancel()"></div>
						</td>
					</tr>
					<tr><td class="Gap"></td></tr>
			 </table>
			</td>
		</tr>
	</table>
	</form>

</div>