<jsp:directive.page pageEncoding="UTF-8" />
<script type="text/javascript">
	function getMailCookie() {
		var key   = "MAIL_SIGNATURE=" ;
		var value = document.cookie + ";" ;

		var start = value.indexOf( key );
		if( start != -1 ) {
			var end = value.indexOf( ";",start );
			return unescape( value.substring( start + key.length, end) );
		}
		else {
			return "";
		}
	}

	function setMailCookie() {
		var txarea = document.getElementById("signature");
		var key   = "MAIL_SIGNATURE=" ;

		document.cookie=key + escape( txarea.value ) +";expires=Wed, 01 Jan 2020 00:00:01 GMT"
	}

</script>

<table border="0" frame="border" summary="form" >
<tr>
	<og:input name="from" size="50" lbl="From" colspan="5"
				value="{@USER.JNAME}&lt;{@USER.ID}&#064;{@SYS.COMMON_MAIL_SERVER}&gt;" />
</tr>
<tr><og:input name="bcc"     lbl="Bcc"     value="{@bcc}"      size="80" colspan="5" /></tr>
<tr><og:input name="replyTo" lbl="ReplyTo" value="{@replyTo}"  size="80" colspan="5" /></tr>

<tr><og:input  name="host"    value="{@SYS.COMMON_MAIL_SERVER}"   lbl="Host" />
	<og:select name="useLDAP" value="false" lbl="useLDAP">
		<og:option value="true"  lbl="True"  />
		<og:option value="false" lbl="False" />
	</og:select>
	<og:input  name="ldapKey"    value="uid"   lbl="ldapKey" />
</tr>
<tr>
	<og:select name="charset" value="{@SYS.MAIL_DEFAULT_CHARSET}" lbl="Charset">
		<og:option value=""            lbl=""            />
		<og:option value="Windows-31J" lbl="Windows-31J" />
		<og:option value="ISO-2022-JP" lbl="ISO-2022-JP" />
	</og:select>
	<og:space />
	<og:input  name="ldapVals"    value="cn,mail"         lbl="ldapVals" />
</tr>
<tr>
	<og:input  name="smtpPort"    value=""   lbl="smtpPort" />
</tr>
<tr>
	<og:input  name="authType"    value=""   lbl="authType" />
	<og:input  name="authPort"    value=""   lbl="authPort" />
</tr>
<tr>
	<og:input  name="authUser"    value=""   lbl="authUser" />
	<og:input  name="authPass"    value=""   lbl="authPass" />
</tr>
</table>

<table>
<tr><og:textarea name="signature" rows="10" cols="60" /></tr>
<tr><td id="label">Cookie On</td><td><input type="checkbox" onClick="setMailCookie();" /></td></tr>
</table>

<script type="text/javascript">
	var txarea = document.getElementById("signature");
	txarea.value=getMailCookie() ;
</script>
