
	<form method="post" action="index.php?Step=3" onSubmit="return CheckStep2()">

	<input type="hidden" name="templateHeader" value="%%GLOBAL_templateHeader%%" />
	<input type="hidden" name="templateFooter" value="%%GLOBAL_templateFooter%%" />

	<TABLE id="Table5" cellSpacing="0" cellPadding="0" width="95%" align="center">
		<TR>
			<TD class="Heading1">Step 2 of 4: Site Settings</TD>
		</TR>
		<TR>
			<TD class="Intro">
				<div>
				Please set up your site and template in the form shown below.<br />
				These template settings will be applied to the application to make it suite your company or site.<br/>
				</div>
				<div>
				<b>Note:</b> If you choose to use UTF-8 as your character set, you will need
				to make sure your database is created using UTF-8 as the default
				character set otherwise you may have problems with some letters
				not displaying correctly.
				</div>
			</TD>
		</TR>
		<TR>
			<TD>
				<TABLE class="Panel" id="Table7" width="98%">
					<TR>
						<TD class="Heading2" colSpan="2">Site Settings</TD>
					</TR>
					<tr>
						<td class="FieldLabel">
							<span class="Required">*</span>&nbsp;Knowledgebase Name:
						</td>
						<td>
							<input type="text" name="knowledgebaseName" id="knowledgebaseName" value="" class="Field300">
							<img onMouseOut="HideHelp(this)" onMouseOver="ShowHelp(this, 'Knowledgebase Name', 'The name of your knowledgebase, which is displayed in various locations.')" src="images/help.gif" width="24" height="16" border="0">
						</td>
					</tr>
					<tr>
						<td class="FieldLabel">
							<span class="Required">*</span>&nbsp;Knowledgebase URL:
						</td>
						<td>
							<input type="text" name="pathToKB" id="pathToKB" class="Field300" value="%%GLOBAL_PathToKB%%">
							<img onMouseOut="HideHelp(this)" onMouseOver="ShowHelp(this, 'Knowledgebase URL', 'The URL of your knowledgebase, used to create links.')" src="images/help.gif" width="24" height="16" border="0">
						</td>
					</tr>
					<tr>
						<td class="FieldLabel">
							<span class="Required">*</span>&nbsp;%%LNG_CharacterSet%%:
						</td>
						<td>
							<select name="charset" id="charset" class="Field300">
								%%GLOBAL_CharSetOptions%%
							</select>
							<img onMouseOut="HideHelp(this)" onMouseOver="ShowHelp(this, '%%LNG_CharacterSet%%', '%%LNG_CharacterSetHelp%%')" src="images/help.gif" width="24" height="16" border="0" alt="help">
						</td>
					</tr>
					<tr>
						<td class="FieldLabel">
							&nbsp;&nbsp;&nbsp;%%LNG_EnableRightToLeft%%:
						</td>
						<td>
							<img src="images/nodejoin.gif" height="20" width="20" alt="stalk">
							<input type="checkbox" name="rightToLeft" %%GLOBAL_YesRightToLeft%%> %%LNG_YesRightToLeft%%
							&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
							<img onMouseOut="HideHelp(this)" onMouseOver="ShowHelp(this, '%%LNG_EnableRightToLeft%%', '%%LNG_EnableRightToLeftHelp%%')" src="images/help.gif" width="24" height="16" border="0" alt="help">
						</td>
					</tr>
					<tr>
						<td class="FieldLabel">
							<span class="Required">*</span>&nbsp;Template:
						</td>
						<td>
							<select onChange="UpdateTemplate()" name="template" id="template" class="Field300" id="template">
								%%GLOBAL_TemplateOptions%%
							</select>
						</td>
					</tr>
					<tr>
						<td class="FieldLabel">
							&nbsp;
						</td>
						<td>
							<img width="300" id="templatePreview" src="../../templates/Classic/Preview.jpg"><br>
							<a href="javascript:PreviewTemplate()"><img border="0" hspace="3" src="images/magnify.gif" width="10" height="11">Click to Enlarge</a>
						</td>
					</tr>
					<tr>
						<td class="FieldLabel">
							<span class="Required">*</span>&nbsp;%%LNG_TemplateHeader%%:
						</td>
						<td>
							<input type="text" name="templateHeader" id="tHeader" class="Field300" value="%%GLOBAL_templateHeader%%" disabled="disabled" />
							<img onMouseOut="HideHelp(this)" onMouseOver="ShowHelp(this, '%%LNG_TemplateHeader%%', '%%LNG_TemplateEmbeddedHeaderHelp%%')" src="images/help.gif" width="24" height="16" border="0" alt="help">
						</td>
					</tr>
					<tr>
						<td class="FieldLabel">
							<span class="Required">*</span>&nbsp;%%LNG_TemplateFooter%%:
						</td>
						<td>
							<input type="text" name="templateFooter" id="tFooter" class="Field300" value="%%GLOBAL_templateFooter%%" disabled="disabled" />
							<img onMouseOut="HideHelp(this)" onMouseOver="ShowHelp(this, '%%LNG_TemplateFooter%%', '%%LNG_TemplateEmbeddedFooterHelp%%')" src="images/help.gif" width="24" height="16" border="0" alt="help">
						</td>
					</tr>
					<tr>
						<td class="FieldLabel">
							<span class="Required">*</span>&nbsp;%%LNG_SendDetails%%:
						</td>
						<td>
							<input type="hidden" name="sendStats" value="false" />
							<input type="checkbox" name="sendStats" value="true" id="sstats" checked="checked" /><label for="sstats">%%LNG_SendAnonStats%%</label>
							<img onMouseOut="HideHelp(this)" onMouseOver="ShowHelp(this, '%%LNG_SendDetails%%', '%%LNG_SendDetailsHelp%%')" src="images/help.gif" width="24" height="16" border="0" alt="help">
						</td>
					</tr>
					<TR>

					<TR>
						<TD class="Gap" colSpan="2"></TD>
					</TR>
					<TR>
						<TD class="FieldLabel"></TD>
						<TD>
							<input type="submit" name="Step1NextButton" value="Next >>" class="FormButton">&nbsp;<INPUT class="FormButton" id="Step1FinishButton" disabled type="button" value="Finish" name="Step1FinishButton">&nbsp;
						</TD>
					</TR>
					<TR>
						<TD class="Gap" colSpan="2"></TD>
					</TR>
				</TABLE>
			</TD>
		</TR>
	</TABLE>
	</form>

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

		function CheckStep2()
		{
			if (document.getElementById("knowledgebaseName").value == "") {
				alert("Please enter your knowledgebase name.");
				document.getElementById("knowledgebaseName").focus();
				return false;
			}

			if (document.getElementById("pathToKB").value == "") {
				alert("Please enter your knowledgebase URL.");
				document.getElementById("pathToKB").focus();
				return false;
			}

			if ((isEmbeddedTemplate()) && (($('#tHeader').value == "") || ($('#tFooter').value == ""))) {
				alert("%%LNG_BlankEmbeddedURL%%");
				return false;
			}

			return true;
		}

		function isEmbeddedTemplate() {
			return (FV('template').substring(0,3) == "EMB");
		}

		function UpdateTemplate()
		{
			if (isEmbeddedTemplate()) {
				document.getElementById('tHeader').disabled = false;
				document.getElementById('tFooter').disabled = false;

				var tname = FV('template').substring(4);
			} else {
				document.getElementById('tHeader').disabled = true;
				document.getElementById('tFooter').disabled = true;

				var tname = FV('template');
			}

			document.getElementById('templatePreview').src = '../templates/' + tname + '/Preview.jpg';
		}

		function PreviewTemplate()
		{
			if (isEmbeddedTemplate()) {
				var imgPath = '../templates/' + FV('template').substring(4) + '/Preview_large.jpg';
			} else {
				var imgPath = '../templates/' + FV('template') + '/Preview_large.jpg';
			}

			window.open(imgPath, 'previewImage');
		}

		if (isEmbeddedTemplate()) {
			document.getElementById('tHeader').disabled = false;
			document.getElementById('tFooter').disabled = false;
		}

		UpdateTemplate();

	</script>
