||define||show_normal_tpl||true||
||ifdef||show_wysiwyg||
	||ifequal||_auto_wysiwyg||true||
		||undef||show_normal_tpl||
	||else||
		||ifequal||msg_alternative||true||
			||undef||show_normal_tpl||		
		||endif||
	||endif||
||endif||

||ifndef||show_normal_tpl||
	||include||wysiwyg.tpl||
||else||
<html>
||undef||draft_msg||
||ifequal||cmd||(msg_draft)||
	||define||draft_msg||true||
||endif||


<script language="JavaScript">
<!--- hide script from old browsers

||ifdef||draft_msg||
	function replace_draft()
	{
		if (confirm("Do you wish to replace the current Draft message??")) {
			document.sendform.cmd.value = 'delitem-||uidl||';
			document.sendform.process.value = "save_draft";
		}
		else
			document.sendform.cmd.value = "save_draft";
		document.sendform.submit();
	}
||endif||


function start()
{
//	if (top.stats) {
//		if (top.stats.document) {
//			top.stats.Message(0);
//		}
//	}

||ifdef||email||
	str = "||email||";
	ptr = str;
	for (i=0;i<str.length;i++) {
		if (str.substr(i,1) == ':') {
			i++;
			ptr = str.substr(i,str.length-i);
		}
	}
	str = ptr;
	for (i=0;i<str.length;i++) {
		if (str.substr(i,1) == '?') {
			ptr = str.substr(0,i);
		}
	}
	document.sendform.to.value = ptr;
||endif||

	focus();
}

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

function mysubmit(cmd, msg)
{
	if (top.stats) {
		if (top.stats.document) {
			top.stats.Message(msg);
		}
	}
	document.sendform.cmd.value = cmd;
	document.sendform.submit();
}

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;
	msgWindow.focus();
}
// end hiding from old browsers -->
</script>

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

||ifdef||background||
<body background="||nwimg||/||background||" onLoad="start()">
||else||
<body onLoad="start()">
||endif||

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

||ifequal||email_sent||max_email_sends||
	<center>
	<table border="1">
		<tr>	<td><img src="||nwimg||/attention.gif">
			<td bgcolor="ffffff">You have reached your maximum allowed number of sends per day (||max_email_sends||)</td>
		</tr>
	</table>
	</center>
||endif||

<form name="sendform" method="post" action="||action||">
	<input type="hidden" name="utoken" value="||utoken||">
	<input type="hidden" name="fld" value="||folder||">
	<input type="hidden" name="answered" value="||answered||">
	<input type="hidden" name="cmd" value="">
	<input type="hidden" name="page" value="">
	<input type="hidden" name="process" value="">

	<input type="hidden" name="force_connection" value="true">
<!--	<input type=hidden name="header_charset" value="iso-8859-2">  -->
	<h3>Create new message.</h3>
	<table><tr><td>
		<table>
			<tr><td align="right">To:</td>
				<td align="left"><input 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>

||ifequal||modify_from||true||
	||ifdef||from||
		||define||myfrom||from||
	||else||
		||ifinstr||dflt_reply||"||
			||define||myfrom||(||dflt_reply||)||
		||else||
		||ifnempty||_real_name||
			||ifinstr||_real_name||"||
				||define||myfrom||(||_real_name|| <||dflt_reply||>)||
			||else||
				||define||myfrom||("||_real_name||" <||dflt_reply||>)||
			||endif||
		||else||
			||define||myfrom||(||dflt_reply||)||
		||endif||
		||endif||

	||endif||
			<tr><td align="right">From:</td>
				<td align="left"><input name="from" size="24" value="||html_text||myfrom||"></td></tr>
||endif||

			<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> ||dflt_reply|| </option>
			        <!--        <option> ||host_user0||@||host_name0|| </option> --->
					||ifdef||host_name1||
				            <option> ||host_user1||@||host_name1|| </option>
				    ||endif||
					||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||||html_text||my_subject||">
		</td>
		<td>	<table cellspacing="0">
			<tr>	<td align="right">Priority:</td>
				<td><select name="priority">
						<option value="normal">Normal</option>
					||ifequal||priority||urgent||
						<option value="urgent" selected>Urgent</option>
					||else||
						<option value="urgent">Urgent</option>
					||endif||
					</select>
				</td>
			</tr>
		    	<tr>	<td align="right">Confirm:</td>
				<td>	<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>
		<td> </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">
		||ifdef||show_wysiwyg||
			<input type="image" border="0" src="||nwimg||/wysiwyg.gif" name="wysiwyg">
		||endif||
	</table>

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


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

||endif||||quote_body||||my_body||</textarea><br>
		    <td>
			||ifdef||draft_msg||
				<a href="javascript:replace_draft()"><img border="0" src="||nwimg||/draft.gif" name="save_draft"></a><br>
			||else||
				<input type="image" border="0" src="||nwimg||/draft.gif" name="save_draft"><br>
			||endif||

			<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"><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></td></tr>
		<tr><td><input type="checkbox" name="sig_first" value="true"> Place Signature at the top of the EMail</td></tr>
		<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>
||endif||