<script language="JavaScript">
	var emailString = '{$STRING.wrong_email}';

{literal}
	function checkForm(frm) {
		if (frm.email.value == '') {
			alert(emailString);
			return false;
		}
		if ( frm.email.value != frm.email2.value ) {
			alert(emailString);
			return false;
		}
		return true;
	}

{/literal}
</script>

<h2>{$TITLE.newinvite}</h2>
<form action="{$smarty.server.PHP_SELF}" method="post" onSubmit="return checkForm(this)">
<input type="hidden" name="createaccount" value="1">
<input type="hidden" name="id" value="{$project_id}">
<input type="hidden" name="do" value="manage_invite">
<input type="hidden" name="stage" value={$stage}>
 <table border="0">
	{if $error}
		<tr>
			<td class="error" colspan="2">{$error}</td>
		</tr>
	{/if}
	{if !EMAIL_IS_LOGIN}
		<tr>
			<td align="right">{$STRING.givelogin}: </td>
			<td>
				<input type="text"  name="login" value="{$smarty.post.login|stripslashes}">
			</td>
		</tr>
	{/if}
	<tr>
		<td align="right">{$STRING.giveemail}: </td>
		<td><input type="text" name="email" value="{$smarty.post.email|stripslashes}"></td>
	</tr>
	<tr>
		<td align="right">{$STRING.giveemailagain}: </td>
		<td><input type="text" name="email2" value="{$smarty.post.email2|stripslashes}"></td>
	</tr>
	{if $stage=="confirm_creation"}
	<tr>
		<td align="right">{$STRING.givename} :</td>
		<td>
			<input type="text" name="lastname" value="{$smarty.post.lastname|stripslashes}">
		</td>
	</tr>
	<tr>
		<td align="right">{$STRING.giveFirstName} ({$STRING.optional}):</td>
		<td>
			<input type="text" name="firstname" value="{$smarty.post.firstname|stripslashes}">
		</td>
	</tr>
	{/if}
</table>
<input type="Submit" name="Submit" value="{$TITLE.newinvite}">
{if $stage=="confirm_only_invite"}
<INPUT TYPE="Button" Value={$STRING.back} OnClick="window.location.href='{$smarty.server.PHP_SELF}?op=mail&id={$project_id}'">
{/if}
</form>
