{stored_object name=$blah|cat:'u':$user->id type="newcomp" from="newcomp" assign="newcomp"}

{if $smarty.request.confirmReset}{stored_object name=$blah|cat:'u':$user->id type="signup" destroy="true"}{/if}

{include_php file="shared_handle:newcomp.prepareInvitation"}

<h1 class="pageHead2">Create a Competition: Step 3</h1>

<h2>Send Your Invitation Letter:</h2>

<div style="margin-left:15px;">
	<br />Enter the contact information for as many friends as you would like to send your invitation to.
</div>

<form name="compStartForm" method="post">
<input type="hidden" name="pg" value="{toc_next}">
<input type="hidden" name="no_expire" value="true">

{toc_next assign="next"}
{toc_prev assign="prev"}

<table align="center">
<tr>
	<td><div>
		<table style="border:1px solid #AAAAAA;background-color:#CCCCCC;" width="350">
		<tr>
			<td><div>
				<h2>Your Letter</h2>
			</div></td>
		</tr>
		<tr>
			<td align="left">
				<div id="letter" align="left" style="padding:8px;border:1px solid #CCCCCC;background-color:#FFFFFF;">
					{eval var=$newcomp.invitationLetter|nl2br}
					</div>
			</td>
		</tr>
		</table>
	</div></td>
	<td align="center">
		<table>
		<tr>
			<td><div>&nbsp;</div></td>
			<td><div>Name</div></td>
			<td><div>E-Mail</div></td>
			<td><div>Relation</div></td>
		</tr> 
		{section name="contactLoop" loop=$addCount}  {* $addCount is assigned by the handler... *}
		<tr>
			<td><div>Competitor {$smarty.section.contactLoop.iteration}</div></td>
			<td><div><input type="text" size="18" name="newcomp[invite][name][{$smarty.section.contactLoop.iteration}]"></div></td>
			<td><div><input type="text" size="25" name="newcomp[invite][email][{$smarty.section.contactLoop.iteration}]"></div></td>
			<td><div><input type="text" size="15" name="newcomp[invite][relation][{$smarty.section.contactLoop.iteration}]"></div></td>
		</tr>
		{/section}
		</table>
	</td>
	<td>
	</td>
</tr>
</table>

{stored_object_fill_form object=$newcomp name="newcomp"}

<div align="right">
	<br />
	{if $prev.pageName}<input type="image" src="{$skinFolder}images/btn_back.gif" class="btn_image" onclick="pg.value='{$prev.pageName}';">&nbsp; {/if}
	{if $next.pageName}<input type="image" src="{$skinFolder}images/btn_next.gif" class="btn_image" onclick="pg.value='{$next.pageName}';">{/if}	
</div>


</form>