<div class="BodyContainer">

<form action="index.php?ToDo=saveCustomField" name="frmAddUser" method="post">

	<table class="OuterPanel" cellspacing="0" cellpadding="0" border="0">
		<tr>
			<td class="Heading1">%%GLOBAL_CustomFieldHeading%%</td>
		</tr>
		<tr>
			<td class="Intro">
				<div>%%LNG_CustomFieldsIntroAddEdit%%</div>
				<div>
					<input type="submit" name="SubmitButton1" value="%%LNG_Save%%" class="FormButton">
					<input type="button" name="CancelButton1" value="%%LNG_Cancel%%" class="FormButton" onClick="ConfirmCancel()">
				</div>
			</td>
		</tr>
		<tr>
			<td>
				%%GLOBAL_Message%%
			</td>
		</tr>
		<tr>
			<td>
				<table class="Panel">
					<tr>
						<td class="Heading2" colspan="2">%%LNG_CustomFieldDetails%%</td>
					</tr>
					<tr>
						<td class="FieldLabel">
							<span class="Required">*</span>&nbsp;%%LNG_CustomFieldName%%:
						</td>
						<td>
							<input type="text" name="name" class="Field" style="width: 423px;" value="%%GLOBAL_CustomFieldName%%">
						</td>
					</tr>

					<tr>
						<td class="FieldLabel">
							<span class="Required">*</span>&nbsp;%%LNG_CustomFieldType%%:
						</td>
						<td>
							<input type="hidden" name="type" value="freeform" />
							<input type="checkbox" name="type" value="multi_check" id="multicheck" %%GLOBAL_multicheck_checked%% onclick="javascript: toggleMulti(this);" /><label for="multicheck">%%LNG_CustomFieldMultiDescription%%</label>
						</td>
					</tr>
					<tr id="multcheckShow">
						<td>&nbsp;</td>
						<td valign="top">
							<table cellpadding="0" cellspacing="0">
								<tr>
									<td valign="top"><img style="margin-right: 3px;" src="images/nodejoin.gif" height="20" width="20" alt="stalk" /></td>
									<td valign="top">
										%%GLOBAL_ExistingCFData%%
										%%GLOBAL_NoCFData%%
										<textarea class="Field400" name="addMultiCFCheck" rows="7">%%GLOBAL_multiCFCheck%%</textarea>
										<br /><em style="margin-bottom:10px;">%%LNG_MultiLineInstructions%%</em><br /><br />
									</td>
									<td valign="top">
										<img onmouseout="HideHelp(this)" onmouseover="ShowHelp(this, '%%LNG_CustomFieldsMultipleOptions%%', '%%LNG_CustomFieldsMultipleOptionsHelp%%')" src="images/help.gif" width="24" height="16" border="0" alt="help" />
									</td>
								</tr>
							</table>
						</td>
					</tr>
					<tr>
						<td class="FieldLabel"></td>
						<td>
							<input type="submit" name="SubmitButton2" value="%%LNG_Save%%" class="FormButton" />
							<input type="button" name="CancelButton2" value="%%LNG_Cancel%%" class="FormButton" onclick="ConfirmCancel()" />
						</td>
					</tr>
				</table>
			</td>
		</tr>
	</table>

	<input type="hidden" name="cfid" value="%%GLOBAL_cfid%%" />
</form>

<script language="javascript">

//Do a check for the multiple checked components.
toggleMulti(document.getElementById('multicheck'));

function toggleMulti(passedObj) {
	if (passedObj.checked) {
		$('#multcheckShow').show();
	} else {
		$('#multcheckShow').hide();
	}
}

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

function RemoveCFData(passedId) {
	var existingName = $('#' + passedId + ' :text')[0].name;
	var newName = existingName.replace("cfdataArray","deletedArray");
	$('#' + passedId + ' :text')[0].name = newName;
	$('#' + passedId).hide();
}

</script>

</div>