<html>
<head>

<script language="javascript">
<!--
function newwindow()
{
	msgWindow = open('||action||?cmd=addr_only&utoken=||putoken||&force_connection=true&&','ADDRESSBOOK','width=500,height=150,toolbar=no,location=no,directories=no,status=no,menubar=no,resizable=no,scrollbars=yes','POPUP');
	if (msgWindow.opener == null){
		msgWindow.opener = self;
	}
	if (msgWindow.opener.sendform == null){
        msgWindow.opener.sendform = document.sendform;
	}
	msgWindow.focus();
}
//-->
</script>

<title>Create new message </title>
</head>

<body>

<table border="0" cellpadding="0" cellspacing="0" rules="none">
<tr valign="top">
	<td>||include||nfmenu.tpl||</td><td>&nbsp;</td>
</tr>
<tr>
	<td>

		||ifdef||error||
			<center>
			<table border="10">		
			<tr>	
				<td><img src="||nwimg||/attention.gif"></td>
				<td bgcolor="ffffff">||error||</td>
			</tr>
			</table>
			</center>
		||endif||


		<form name="sendform" ENCTYPE="multipart/form-data" method=post action="||action||"> 
		<input type="hidden" name="answered" value="||answered||">
		<input type="hidden" name="folder" value="||folder||">
		<input type=hidden name="force_connection" value="true">
		<input type=hidden name="utoken" value="||utoken||" > 
		<input type=hidden name="cmd" value="" > 
		<table border="0" >
		<tr>
			<td>
				<table border="0">
				<tr>
					<td align=right>To:</td>
					<td align=left>
						<input name="to" size=24 value="||h_from||" onFocus="document.sendform.oo[0].checked = true">
						<INPUT TYPE=RADIO NAME="oo" VALUE="t" CHECKED>
					</td>
				</tr>
				<tr>
					<td align=right>CC:</td>
					<td align=left>
						<input name="cc" size=24 value="||h_cc||" onFocus="document.sendform.oo[1].checked = true">
						<INPUT TYPE=RADIO NAME="oo" VALUE="c">
					</td>
				</tr>
				<tr>
					<td align=right>BCC:</td>
					<td align=left>
						<input name="bcc" size=24 value="||h_bcc||" onFocus="document.sendform.oo[2].checked = true">
						<INPUT TYPE=RADIO NAME="oo" VALUE="b">
					</td>
				</tr>
				<tr>
					<td align=right>Reply-To:</td>
					<td align=left>
						<input name="reply" size=24 value="||reply||" onFocus="document.sendform.oo[3].checked = true">
						<INPUT TYPE=RADIO NAME="oo" VALUE="r">
					</td>
				</tr>
				<tr>
					<td align=right>Attach:</td>
					<td align=left><input type=file name="attach" value="||prev_attach||" size=24></td>
				</tr>
				</table>
			</td>
			<td>
				<table border="0">
				<tr>
					<td><input type="button" value="Clear" name="clearfield" onclick="dele();"></td>
					<td><input type="button" value="Address Book" name="Display Address" onclick="newwindow()"></td>
				</tr>
				<tr>
					<td>
						<select name="tolist" size=5 onChange="setto(this)">
							<option>||picklist||</option> 
						</select>
					</td>
 					<td width="100" >Click entries to add them to the selected field</td>
				</tr>
				</table>
			</td>
		</tr>
		</table>

		Subject: <input name="subject" size=66 value="||h_subject||"><br>
		Enter your message text here: (press enter at the end of each line)

		
		<table>
		<tr>
			<td><textarea name="message" cols=64 rows=12 wrap="physical">||quote_body||</textarea></td>
			<td>
				<table height="100%">
				<tr>
					<td><input type="submit" name="send" value="Send Now"></td>
				</tr>
				<tr>
					<td><input type="submit" name="spell_check" value="Check Spelling"><input type="hidden" name="force_connection" value="true"></td>
				</tr>
				<tr>
					<td>
						<input type="submit" name="save_draft" value="Save Draft"><br>
						<select name="dstfld" size="1">
							<option>||xfldlist||</option>
						</select>
					</td>
				</tr>
				<tr>
					<td>
						Confirm:
						<select name="confirm">
							<option value="none">None</option>
							||ifequal||confirm||read||
								<option value="read" selected>Reading</option>
							||else||
								<option value="read">Reading</option>
							||endif||
						</select>
					</td>
				</tr>
				</table>
			</td>
		</tr>
		</table>

		<hr>
		<table>
		<tr>
			<td>
				<input type=checkbox name="addsig" value="on" ||addsig||> Add Sig file
				<select name="_default_profile" size=1">
				||begin_profile||
					||ifnequal||_default_profile||profile_name||
						<option>||profile_name||</option>
					||else||
						<option selected>||profile_name||</option>
					||endif||
				||end_profile||
				</select>
			</td>
			<td align=right>Content-type: </td>
			<td>
				<select name="content_type" size="1">
					<option selected></option>
					<option>text/html</option>
					<option>text/plain; charset="iso-8859-1"</option>
					<option>text/plain; charset="iso-2022-jp"</option>    
				</select>
			</td>
		</tr>
	    <tr>
			<td><input type=checkbox name="send_autocc" value="on" ||send_autocc||> Send CC to self for confirmation</td>
			<td align=right>Attach 2: </td>
			<td align=left><input type=file name="attach" value="" size=24></td>
		</tr>
	    <tr>
			<td><input type=checkbox name="copyself" value="on" ||copyself||> Save a copy in copies to self folder</td>
			<td align=right>Attach 3: </td>
			<td align=left><input type=file name="attach" value="" size=24></td>
		</tr>
		</table>
		</form>

		||copyright||
	</td>
</tr>
</table>
</body>
</html>

<script language="JavaScript">
<!--- hide script from old browsers
function dele()
{
	var i = 0, j;
  
	for (j=0; j<4; j++)
		if (document.sendform.oo[j].checked == true) i = j;  

	if (i==0)
		document.sendform.to.value = "";
	if (i==1)
		document.sendform.cc.value = "";
	if (i==2)
		document.sendform.bcc.value = "";
	if (i==3)
		document.sendform.reply.value = "";
	document.sendform.tolist.options[0].selected = true;
}

function setto(sel) 
{
	var option;
	var i;
	for (i=0; i<sel.options.length; i++) {
		if (sel.options[i].selected==true) {
			if (document.sendform.oo[0].checked == true) {
				if (document.sendform.to.value != "")
					document.sendform.to.value = ", " + document.sendform.to.value;
				document.sendform.to.value = sel.options[i].value + document.sendform.to.value;
			}
			if (document.sendform.oo[1].checked == true) {
				if (document.sendform.cc.value != "")
					document.sendform.cc.value = ", " + document.sendform.cc.value;
				document.sendform.cc.value = sel.options[i].value + document.sendform.cc.value;
			}
			if (document.sendform.oo[2].checked == true) {
				if (document.sendform.bcc.value != "")
					document.sendform.bcc.value = ", " + document.sendform.bcc.value;
				document.sendform.bcc.value = sel.options[i].value + document.sendform.bcc.value;
			}
			if (document.sendform.oo[3].checked == true) {
				if (document.sendform.reply.value != "")
					document.sendform.reply.value = ", " + document.sendform.reply.value;
				document.sendform.reply.value = sel.options[i].value + document.sendform.reply.value;
			}
		}
	}
	if (sel.options[0].selected==true) {
		dele();
	}
}
// end hiding from old browsers -->
</script>