<form action="{ACTION}" method="post">
	<div class="il_ButtonGroup">
	<input class="submit" type="submit" name="cmd[searchUsers]" value="{BUTTON_TO}"/>
				<input class="submit" type="submit" name="cmd[searchCoursesTo]" value="{BUTTON_COURSES_TO}"/>
				<input class="submit" type="submit" name="cmd[searchGroupsTo]" value="{BUTTON_GROUPS_TO}"/>
	</div>
	<br/>	
	<input type="hidden" name="m_type[]" value="normal" />
	<table class="std">
	<!-- BEGIN search -->
	<tr>
		<td id="header-search" class="option" align="right">{TXT_SEARCH_FOR}
		</td>
		<td headers="header-search" class="option_value">
			<input name="search" value="{VALUE_SEARCH_FOR}" size="30" width="80%"/><br/>
			<input type="checkbox" name="type_addressbook" value="address" checked="checked"/>{TXT_SEARCH_ADDRESS}<br/>
			<input type="checkbox" name="type_system" value="system"/>{TXT_SEARCH_SYSTEM}<br/>
			<input class="submit" type="submit" name="cmd[search]" value="{BUTTON_SEARCH}"/>
			<input class="submit" type="submit" name="cmd[cancelSearch]" value="{BUTTON_CANCEL}"/>
		</td>
	</tr>
	<!-- END search -->
	<tr>
		<td id="header-to" class="option" >{TXT_RECIPIENT}</a></td>
		<td headers="header-to" class="option_value" >
		<input name="rcp_to" value="{RCP_TO}" size="50" width="80%"/>
		</td>
	</tr>
	<tr>
		<td id="header-cc" class="option" >{TXT_CC}</a></td>
		<td headers="header-cc" class="option_value">
		<input name="rcp_cc" value="{RCP_CC}" size="50" width="80%"/>
		</td>
	</tr>
	<tr>
		<td id="header-bcc" class="option" >{TXT_BC}</a></td>
		<td headers="header-bcc" class="option_value">
		<input name="rcp_bcc" value="{RCP_BCC}" size="50" width="80%"/>
		</td>
	</tr>
	<tr>
		<td id="header-subject" class="option" >{TXT_SUBJECT}</td>
		<td headers="header-subject" class="option_value"><input name="m_subject" value="{M_SUBJECT}" size="50" width="80%"/></td>
	</tr>
	<!-- BEGIN system_message -->
	<tr>
		<td id="header-type" class="option" >{SYSTEM_TXT_TYPE}</td>
		<td headers="header-type" class="option_value">
		<input type="checkbox" name="m_type[]" value="system" {CHECKED_SYSTEM}/>{TXT_SYSTEM}
		</td>
	</tr>
	<!-- END system_message -->
	<tr>
		<td id="header-attachment" class="option" >{TXT_ATTACHMENT}</td>
		<td headers="header-attachment" class="option_value">
		<!-- BEGIN files -->{FILES}<br /><!-- BEGIN hidden -->
		<input type="hidden" name="attachments[]" value="{ATTACHMENTS}"/>
		<!-- END hidden -->
		<!-- END files -->
		<input class="submit" type="submit" name="cmd[editAttachments]" value="{BUTTON_EDIT}"/>
		</td>
	</tr>
	<tr>
		<td id="header-content" class="option" >{TXT_MSG_CONTENT}</td>
		<td headers="header-content" class="option_value">
			<textarea name="m_message" id="m_message" rows="10" cols="60">{M_MESSAGE}</textarea>
			<br /><input type="checkbox" name="use_placeholders" onclick="togglePlaceholdersBox(this.checked);" value="1"{CHECKED_USE_PLACEHOLDERS} />{TXT_ACTIVATE_PLACEHOLDERS}
		</td>
	</tr>
	<tr>
		<td class="submit" colspan="2" align="right">
		<input class="submit" type="submit" name="cmd[sendMessage]" value="{TXT_SEND}"/>&nbsp;
		<input class="submit" type="submit" name="cmd[saveDraft]" value="{TXT_MSG_SAVE}"/>
		</td>
	</tr>
	<tr<!-- BEGIN hide_placeholders --> style="display: none;"<!-- END hide_placeholders --> id="placeholders_box">
		<td class="option_value" colspan="2">
			<div class="il_Description">
			<b>{TXT_USE_PLACEHOLDERS}</b>:<br />
			{TXT_PLACEHOLDERS_ADVISE}<br />
			<b><a href="#" onclick="insertTextIntoTextField(this.innerHTML, 'm_message'); return false;">[MAIL_SALUTATION]</a></b>: {TXT_MAIL_SALUTATION}<br />
			<b><a href="#" onclick="insertTextIntoTextField(this.innerHTML, 'm_message'); return false;">[FIRST_NAME]</a></b>: {TXT_FIRST_NAME}<br />
			<b><a href="#" onclick="insertTextIntoTextField(this.innerHTML, 'm_message'); return false;">[LAST_NAME]</a></b>: {TXT_LAST_NAME}<br />
			<b><a href="#" onclick="insertTextIntoTextField(this.innerHTML, 'm_message'); return false;">[LOGIN]</a></b>: {TXT_LOGIN}<br />			
			<b><a href="#" onclick="insertTextIntoTextField(this.innerHTML, 'm_message'); return false;">[ILIAS_URL]</a></b>: {TXT_ILIAS_URL}<br />
			<b><a href="#" onclick="insertTextIntoTextField(this.innerHTML, 'm_message'); return false;">[CLIENT_NAME]</a></b>: {TXT_CLIENT_NAME}			
			</div>
		</td>
	</tr>
	</table>
</form>

<script type="text/javascript" language="JavaScript">
function togglePlaceholdersBox(status)
{
	phObj = document.getElementById('placeholders_box');

	if (phObj)
	{
		if (status == true && phObj.style.display == 'none')
		{
			 phObj.style.display = '';
		}
		else
		{
			phObj.style.display = 'none';
		}
	}
}

function insertTextIntoTextField(text, obj_id)
{
    if (text && obj_id)
    {
		var objTextField = document.getElementById(obj_id);
		
		if (document.selection)
		{
        	objTextField.focus();
            sel = document.selection.createRange();
            sel.text = text;
        }
        else if (objTextField.selectionStart || objTextField.selectionStart == '0')
        {
            var startPos = objTextField.selectionStart;
            var endPos = objTextField.selectionEnd;
            var TextFieldValue = objTextField.value;

            objTextField.value = TextFieldValue.substring(0, startPos) + text + TextFieldValue.substring(endPos, TextFieldValue.length);
        }
        else
        {
            objTextField.value += text;
        }
    }
}
</script>