<script language="JavaScript">
<!--- hide script from old browsers
function newwindow()
{
	msgWindow = open('||action||?cmd=addr_only&utoken=||putoken||&&','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;
}

function do_copy(sel)
{
	var i;
	document.sendform.reply.value = "crap"
	for (i=0; i<sel.options.length; i++) {
		if (sel.options[i].selected==true) {
			document.sendform.reply.value = sel.options[i].text;
		}
	}
}

// end hiding from old browsers -->
</script>

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

<body onload="focus()">

||include||nfmenu.tpl||

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


<form name="sendform" ENCTYPE="multipart/form-data" method=post action="||action||"> 
<!--	<input type=hidden name="cmd" value="send">  -->
	<input type=hidden name="utoken" value="||utoken||" > 
	<h3>Create new message.</h3>
	<table><tr><td>
		<table>
			<tr><td align=right>To:</td>
				<td align=left><input type="text" name="to" size=24 value="||html_text||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="||html_text||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="||html_text||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="||html_text||reply||" onFocus="document.sendform.oo[3].checked = true">
					<INPUT TYPE=RADIO NAME="oo" VALUE="r"><br>
				||ifdef||host_name0||
					<select name="replyx" size="1" onchange="do_copy(this)">
				            <option> ||reply|| </option>
			        <!--        <option> ||host_user0||@||host_name0|| </option> --->
				            <option> ||host_user1||@||host_name1|| </option>
					||ifdef||host_name2||
				            <option> ||host_user2||@||host_name2|| </option>
					||endif||
					||ifdef||host_name3||
				            <option> ||host_user3||@||host_name3|| </option>
					||endif||
					||ifdef||host_name4||
					    <option> ||host_user4||@||host_name4|| </option>
					||endif||
					</select>
				||endif||
		
				</td></tr>
			<tr><td align=right>Attach:</td>
			<td align=left>
			||ifequal||attach_num||0||
				(none)
			||else||
				||begin_attach||
					<b>||attach_name||</b> (||attach_ksize||k),<br>
				||end_attach||
			||endif||

			<tr><td></td>
			<td align=left><input type=image border="0" src="||nwimg||/addattach.gif" name="add_attach" value="Add Attachment"></td></tr>
		</table>

	<td>Pick List (and Distribution List)<br>
		<img border="0" src="||nwimg||/clear.gif" alt="Clear" usemap="#Clearfield">
		<map name="Clearfield"><area coords="0,0,100,100" href="javascript:dele()"></map>

		<img border="0" src="||nwimg||/addrsbk.gif"  alt="Address Book" name="Display Address" usemap="#ABooks"><br>
		<map name="ABooks"><area coords="0,0,100,100" href="javascript:newwindow()"></map>

		<select name="tolist" size=5 onChange="setto(this)">
			<option>||picklist||</option> 
		</select>
	</table>

	<table><tr><td>
		Subject: <input name="subject" size=40 value="||html_text||h_subject||">
		</td>
		<td>Priority:
			<select name="priority">
				<option value="normal">Normal</option>
				<option value="urgent">Urgent</option>
			</select></td>
		<td>
			<input type=image border="0" src="||nwimg||/send.gif" name=send>
		</td>
		
		<tr><td colspan="2">Enter your message text here: (press enter at the end of each line)

			<input type=image border="0" src="||nwimg||/spellchk.gif" name=spell_check>
	</table>


	<table>
		<tr><td><textarea wrap="physical" name="message" cols=64 rows=12>||ifdef||message_headers||


----- Message Forwarded on ||date_today||date_layout|| -----
From: ||from||
To: ||to||
||ifdef||cc||
Cc: ||cc||
||endif||
Subject: ||subject||
Date: ||date||

||endif||||quote_body||</textarea><br>
	
		    <td><input type=image border="0" src="||nwimg||/draft.gif" name="save_draft" alt="Save Draft"><br>
			<select name="dstfld" size="1">
				<option>||xfldlist||</option>
			</select>
	</table>

	<hr>
	<table>
		<tr><td><input type=image border="0" src="||nwimg||/send.gif" name="send" alt="Send Message"><br>
		<td align=right>Content-type: 
		<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>
		<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>
		<tr><td><input type=checkbox name="send_autocc" value="on" ||send_autocc||> Send CC to self for confirmation</td></tr>
		<tr><td colspan="2"><input type=checkbox name="copyself" value="on" ||copyself||> Save a copy in copies to self folder</td></tr>
	</table>
</form>

||copyright||
</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>