{include file="layouts/forceLoggedIn.tpl"}
{assign var="pgLayout" value="layouts/withLeftNav.tpl"}
{include_php file="shared_handle:acceptRejectRequests"} 
{include_php file="shared_handle:myHome"}
<h1>{$page.title}</h1>

<table width="100%"><tr><td valign="top">
	<img class="iconRacers" src="blank.gif" width="1" height="1" alt="" />
</td><td valign="top" width="100%">
	<h2 class="withBG">
		<div class="topRight hideShow">
		<a href="javascript:toggle('inComps', '', 'showHide');"><img id="inComps_img" src="./img/blank.gif" class="showHide_on" alt="show/hide" border="0" /></a></div> 
		Competitions I Am In</h2>
	
<div id="inComps" style="display:block;">	
	<div style="margin:10px;padding:5px;background-color:#FFF;border:#999 1px solid;">
	<table cellspacing="0" cellpadding="1" align="center">
	<tr>
		<td class="underline2"><span>&nbsp;<b>ID</b></span></td>
		<td class="underline2"><span>&nbsp;<b>Title</b></span></td>
		{*
		<td class="underline2"><span>&nbsp;<b>Type</b></span></td>
		*}
		<td class="underline2"><span>&nbsp;<b>Style</b></span></td>
		{* <td class="underline2"><span>&nbsp;<b>Rank</b></span></td> *}
		{* <td class="underline2" nowrap><span>&nbsp;<b>Time Remaining</b></span></td> *}
		<td class="underline2" nowrap><span>&nbsp;<b>Ends</b></span></td>
		{* <td class="underline2" nowrap><span>&nbsp;<b>Prize</b></span></td> *}
	</tr>
	{* Set up the warning period... 7 days from now (604800 = 7 days in seconds) *}
	{math assign="endsSoon" equation="x + y" x=$smarty.now y="604800"}
	{foreach from=$competitions item="comp"}
	<tr>
		<td nowrap="nowrap"><span><small>&nbsp;<a href="?pg=competition&cid={$comp.id}">{$comp.id}</a> &nbsp;</small></span></td>
		<td nowrap="nowrap"><span><small>&nbsp;<a href="?pg=competition&cid={$comp.id}">{$comp.title|truncate:35:"..."}</a> &nbsp;</small></span></td>
		{*
		<td nowrap="nowrap"><span><small>&nbsp;{$comp.type|niceText}</small> &nbsp;</span></td>
		*}
		<td nowrap="nowrap"><span><small>&nbsp;{if $comp.style eq "Group-vs-Group"}Team{else}Individual{/if}</small> &nbsp;</span></td>
		{* <td nowrap="nowrap"><span><small>&nbsp;{if $comp.rank ne "N/A"}{$comp.rank}/{$comp.rankOutOf}{else}N/A{/if}</small> &nbsp;</span></td> *}
		{* <td nowrap><span><small{if $comp.endDate lt $smarty.now} style="font-weight:bold;"{elseif $comp.endDate lt $endsSoon} style="color:#C00;font-weight:bold;"{/if}>&nbsp;{$comp.timeLeft}</small> &nbsp;</span></td> *}
		<td nowrap="nowrap"><span><small{if $comp.endDate lt $smarty.now} style="font-weight:bold;"{elseif $comp.endDate lt $endsSoon} style="color:#C00;font-weight:bold;"{/if}>&nbsp;{$comp.endDate|date_format2:"D n/j/y"}</small> &nbsp;</span></td>
		{* <td nowrap="nowrap" align="right"><span><small>&nbsp;{if not $comp.potAmount and $comp.potDescription}(Special){else}{math assign="fontSizeFactor" equation="x / y" x=$comp.potAmount y="100"}{math assign="fontSize" equation="x + y" x="11" y=$fontSizeFactor|number_format:"0"}<span style="font-size:{$fontSize}px;">${$comp.potAmount|number_format:"0"}</span>{/if}</small> &nbsp;</span></td> *}
	</tr>
	{foreachelse}
	<tr>
		<td colspan="6"><span><small>You have not joined any competitions.</small></span></td>
	</tr>
	{/foreach}
	</table>
	</div>
	<span style="margin-left:65px;"><small>(NOTE: <b>Bold Date</b> = Ended, <span style="color:#C00;"><b>Red Date</b></span> = Ends Soon)</small></span>

	<div style="text-align:right;">
	<form name="joinCompForm" method="post" style="margin:4px;">
		<input type="hidden" name="pg" value="competition/join" />
		<input type="hidden" name="no_expire" value="true" />
		<b>Competition ID#</b> <input type="text" class="textInput" name="cid"> <a href="javascript:document.joinCompForm.submit();" class="button">Join</a><br />
	</form>
	-<i>or</i>- see a list of all <a href="?pg=availableCompetitions">Available Competitions</a>!
	</div>
</div>
</td></tr>
</table>

<blockquote>
<table width="100%">
<tr><td valign="top" width="50%">
	<img src="blank.gif" width="1" height="1" alt="" class="icoMedal" />
	Click below to join in on the competitions your company has created.
	<a href="?pg=my_competitions/available">Available Competitions</a></td>
    <td valign="top" width="50%">
	{*
	<img src="blank.gif" width="1" height="1" alt="" class="icoClick" />
	<a href="#">Competitions I have started</a>
	*}</td>
</tr>
</table>
</blockquote>

</div>