<script type="text/javascript">
	editorWelcomeEmail = null;
	function ChangeTemplateType(input){	
		val = confirm('[l]Are you sure you want to change template.[/l]');
		if(val){
			RetrieveTemplate(input.value);
			return false;
		}
		input.value = '{TEMPLATEORIGINALVALUE}';
		return false;
	}
</script>

<form method="post" action="index.php?fuse=clients&amp;action=SendEmail" enctype="multipart/form-data">

	<input name="emailTo" value="{CUSTOMEREMAIL}" type="hidden">
	<table border="0" cellpadding="2" cellspacing="0">
		<tbody>
			<tr>
				<td width="70">[l]To[/l]:</td>
				<td>{CUSTOMERNAME}</td>
			</tr>
			<tr>
				<td>[l]From[/l]:</td>
				<td valign="top">
					<input size="35" name="adminEmail" class="body" value="{ADMINEMAIL}" type="text">
					<input name="bcc" type="checkbox"><font class="body7">[l]BCC[/l]</font>&nbsp;&nbsp;<a href="javascript:void(0);" onmouseover="return overlib('[l]Click on this checkbox if you want a BCC, Blind Carbon Copy, of this E-mail sent to you.[/l]',FIXY,_mousePosY+5,FIXX,_mousePosX+13,DELAY,310,BGCOLOR, '#FFCC00', FGCOLOR, '#FFFFCC',BORDER,1,TEXTCOLOR,'#000000');" onmouseout="return nd();"><img src="templates/images/question.gif" style="position: relative; left: 0px; top: 2px;" border="0"></a>
				</td>
			</tr>
			<tr>
				<td>[l]Subject[/l]:</td>
				<td><input size="35" id="emailSubject" class="body" name="emailSubject" value="{EMAILSUBJECT}" type="text"></td>
			</tr>
		</tbody>
	</table>
			
	<table border="0" cellpadding="2" cellspacing="0">
		<tbody>
			<tr>
				<td width="70">[l]Template[/l]:</td>			
				<td>
					<select style="width:195px;" id="emailtemplate" onchange="ChangeTemplateType(this);">
						<option value='none' selected="true">[l]None[/l]</option>
						<!-- BEGIN DYNAMIC BLOCK: templateoption -->
						<option value='{TEMPLATEOPTIONVALUE}'>[l]{TEMPLATEOPTIONNAME}[/l]&nbsp;&nbsp;&nbsp;&nbsp;</option>
						<!-- END DYNAMIC BLOCK: templateoption -->
					</select>
				</td>
			</tr>
		</tbody>
	</table>
	<div id ="customTemplateFields" style="display:none;"></div>		
						
	<table border="0" cellpadding="0" cellspacing="0">
		<tbody>			
			<tr>
				<td colspan="2"><br/>
					<textarea id="emailMessage" name="emailMessage" rows="15" cols="80">{ADMINSIGNATURE}</textarea>
					<!-- BEGIN DYNAMIC BLOCK: emailMessageHTMLEditor -->
					<script type="text/javascript">
						showRichTextEditor('editorWelcomeEmail', 600, 300
											,['Undo','Redo','|','Hyperlink','|','JustifyLeft','JustifyCenter','JustifyRight','JustifyFull','|','Numbering','Bullets','|','LTR','RTL','|'
											,'XHTMLFullSource','StyleAndFormatting','TextFormatting','ListFormatting','BoxFormatting','ParagraphFormatting','CssText','|','FontName'
											,'FontSize','|','Bold','Italic','Underline','|','ForeColor','BackColor'], 'emailMessage');
					</script>
					<!-- END DYNAMIC BLOCK: emailMessageHTMLEditor -->
				</td>
			</tr>
		</tbody>
	</table>		

	<table border="0" cellpadding="0" cellspacing="0">
		<tbody>		
			<tr>
				<td><br>[l]Priority[/l]: 
					<select name="emailpriority" class="body">
					<option value="5">[l]Low[/l]</option>
					<option value="3" selected="selected">[l]Normal[/l]&nbsp;&nbsp;&nbsp;</option>
					<option value="1">[l]High[/l]</option>
					</select>
				</td>
				<td><br>[l]Confirm Receipt[/l]: 
					<select name="emailconfirmreceipt" class="body"><option value="0" selected="selected">[l]No[/l]</option>
					<option value="1">[l]Yes[/l]</option>
					</select>
				</td>			
			</tr>
			<tr>
				<td colspan="2">
					<br>[l]Attach File[/l]&nbsp;&nbsp;<input name="file" id="file" type="file">&nbsp;&nbsp;[l]Max file size[/l]: {MAXFILESIZE} <a href="javascript:void(0);" onmouseover="return overlib('[l]Max file size limit can be changed in php.ini - directive <b>upload_max_filesize</b>[/l]',FIXY,_mousePosY+5,FIXX,_mousePosX+13,DELAY,310,BGCOLOR, '#FFCC00', FGCOLOR, '#FFFFCC',BORDER,1,TEXTCOLOR,'#000000');" onmouseout="return nd();"><img src="templates/images/question.gif" style="position: relative; left: 0px; top: 2px;" border="0"></a>
				</td>
			</tr>
			<tr>
				<td colspan="2">
					<br><br><input class="button_large" value="[l]Send E-mail[/l]" type="submit">
				</td>
			</tr>
		</tbody>
	</table>

</form>
