(3489,222,0.16,'smarty','0','Page created.',1110965792,3,'24.10.217.227','{assign var=\"hideWidgets\" value=0}\r\n{assign var=\"hideUserBox\" value=\"false\"}\r\n{assign var=\"showCompanyNews\" value=\"true\"}\r\n{assign var=\"pgLayout\" value=\"layouts/withLeftNav.tpl\"}\r\n\r\n{include_php file=\"shared_handle:competition.load\"}\r\n{if $competition.userId eq $user->id or $acm->isDomainAdmin()}\r\n	{assign var=\"isManager\" value=\"true\"}\r\n	<!-- ismanager -->\r\n	{include_php file=\"shared_handle:competition.management\"}\r\n{/if}\r\n\r\n<table width=\"100%\" cellpadding=\"0\" cellspacing=\"0\" border=\"0\">\r\n	<tr>\r\n		<td valign=\"top\" width=\"260\">\r\n		<br />\r\n		<h2 class=\"withBG\">\r\n			<div class=\"topRight hideShow\">\r\n					<a href=\"javascript:toggle(\'leaderBoard\', \'\', \'showHide\');\"><img id=\"leaderBoard_img\" src=\"./img/blank.gif\" class=\"showHide_on\" alt=\"show/hide\" border=\"0\" /></a>\r\n				</div>\r\n			Leaders\r\n		</h2>\r\n		{if $competition.dateOfObject}<div align=\"right\"><small><i>as of {$competition.dateOfObject|date_format2:\"n/j/Y g:i A\"}</i></small></div>{/if}\r\n		<div id=\"leaderBoard\" style=\"display:block;\">\r\n		{if $competition.style eq \'Group-vs-Group\'}\r\n			<div style=\"white-space:nowrap;display:block;\">\r\n			<span class=\"cellHeadTiny\">#</span>\r\n			<span class=\"cellHeadBig\">Team</span>\r\n			<span class=\"cellHeadTiny\">{if $competition.scoringMethod eq \'Percentage Weight Lost\'}%\r\n					{elseif $competition.scoringMethod eq \'Weight Lost\' or $competition.scoringMethod eq \'Weight Gained\'}Lbs\r\n					{elseif $competition.scoringMethod eq \'Minutes Exercise\'}Min\r\n					{elseif $competition.scoringMethod eq \'Distance Exercised\'}Dist\r\n			{/if}</span>\r\n			<span class=\"cellHeadTiny\">#Pl</span>\r\n			</div>\r\n			{foreach name=\"rankLoop\" from=$competition.teams item=\"teams\" key=\"teamName\"}\r\n				{if $teams.name ne \"Waiting to Join\"}\r\n					{if not $teams.userCount}\r\n						{assign var=\"score\" value=\"-\"}\r\n					{elseif $competition.scoringMethod eq \'Percentage Weight Lost\'}\r\n						{assign var=\"score\" value=$teams.averagePercentLost|number_format:\"2\"|default:\"-\"}\r\n					{elseif $competition.scoringMethod eq \'Weight Lost\'}\r\n						{assign var=\"score\" value=$teams.averageWeightLost|number_format:\"2\"|default:\"-\"}\r\n					{elseif $competition.scoringMethod eq \'Weight Gained\'}\r\n						{assign var=\"score\" value=$teams.averageWeightGain|number_format:\"2\"|default:\"-\"}\r\n					{elseif $competition.scoringMethod eq \'Minutes Exercise\'}\r\n						{assign var=\"score\" value=$teams.averageExercise|number_format:\"2\"|default:\"-\"}\r\n					{elseif $competition.scoringMethod eq \'Distance Exercised\'}\r\n						{assign var=\"score\" value=$teams.averageDistance|number_format:\"2\"|default:\"-\"}\r\n					{/if}\r\n					<div style=\"white-space:nowrap;display:block;\">\r\n						<span class=\"cellTiny\" style=\"clear:left;\"><small>{$smarty.foreach.rankLoop.iteration}</small></span>\r\n						<span class=\"cellBig\"><small class=\"mini\">{$teams.name|default:\"&nbsp;\"}</small></span>\r\n						<span class=\"cellTiny\"><small>{$score|replace:\".00\":\"\"}</small></span>\r\n						<span class=\"cellTiny\"><small>{$teams.userCount|default:\"0\"}</small></span>\r\n					</div>\r\n				{/if}\r\n			{/foreach}\r\n		{else}\r\n			<div style=\"white-space:nowrap;display:block;\">\r\n			<span class=\"cellHeadTiny\">#</span>\r\n			<span class=\"cellHeadSmall\">Name</span>\r\n			<span class=\"cellHeadTiny\">{if $competition.scoringMethod eq \'Percentage Weight Lost\'}%\r\n					{elseif $competition.scoringMethod eq \'Weight Lost\' or $competition.scoringMethod eq \'Weight Gained\'}Lbs\r\n					{elseif $competition.scoringMethod eq \'Minutes Exercise\'}Min\r\n					{elseif $competition.scoringMethod eq \'Distance Exercised\'}Dist\r\n			{/if}</span>\r\n			<span class=\"cellHeadSmall\">Update</span>\r\n			</div>\r\n			{foreach from=$competition.users item=\"compUser\" key=\"username\" name=\"dateUpdated\"}\r\n			{if $smarty.foreach.dateUpdated.iteration eq 21}\r\n			</div>\r\n			<br />\r\n			<h2 class=\"withBG\">\r\n				<div class=\"topRight hideShow\">\r\n					<a href=\"javascript:toggle(\'runnerUps\', \'\', \'showHide\');\"><img id=\"runnerUps_img\" src=\"./img/blank.gif\" class=\"showHide_off\" alt=\"show/hide\" border=\"0\" /></a>\r\n				</div>\r\n				Runner Ups\r\n			</h2>\r\n			<div id=\"runnerUps\" style=\"display:none;\">\r\n			{/if}\r\n			<span class=\"cellTiny\" style=\"clear:left;\"><small>{$smarty.foreach.dateUpdated.iteration}</small></span>\r\n			<span class=\"cellSmall\"><small class=\"mini\">{$username}</small></span>\r\n			<span class=\"cellTiny\"><small>{if $scoringMethod eq \"Percentage Weight Lost\"}{$compUser.$scoringMethod|number_format:\"2\"|replace:\".00\":\"\"|default:\"-\"}{else}{$compUser.$scoringMethod|replace:\".00\":\"\"|default:\"-\"}{/if}</small></span>\r\n			<span class=\"cellSmall\"><small>{if $compUser.dateOfEntry}{$compUser.dateOfEntry|date_format2:\"n/j/y\"}{else}-Never-{/if}</small></span>\r\n			{/foreach}\r\n		{/if}\r\n		</div>\r\n		<div align=\"right\"><small><i><a href=\"?pg=faq#comp\">How is the competition scored?</a></i></small></div>\r\n		<img src=\"./img/blank.gif\" width=\"168\" height=\"1\" alt=\"\" />\r\n		{if $isManager}\r\n		<h2 class=\"withBG\">\r\n			<div class=\"topRight hideShow\">\r\n				<a href=\"javascript:toggle(\'managePlayers\', \'\', \'showHide\');\"><img id=\"managePlayers_img\" src=\"./img/blank.gif\" class=\"showHide_off\" alt=\"show/hide\" border=\"0\" /></a>\r\n			</div> \r\n			Manage\r\n		</h2>\r\n		<div id=\"managePlayers\" style=\"display:none;\">\r\n					<form name=\"managePlayers[]\" action=\"index.php\" method=\"POST\" style=\"margin:0px;\">\r\n					<input type=\"hidden\" name=\"pg\" value=\"{$page.name}\">\r\n					<input type=\"hidden\" name=\"cid\" value=\"{$competition.id}\">\r\n					<input type=\"hidden\" name=\"no_expire\" value=\"true\">\r\n					<input type=\"hidden\" name=\"style\" value=\"{$competition.style}\">\r\n							{if $competition.style eq \'Group-vs-Group\'}\r\n								<span class=\"cellHeadTiny\" style=\"clear:left;\">Del</span>\r\n								<span class=\"cellHead\">View Stats</span>\r\n								<span class=\"cellHeadSmall\">-</span><br />\r\n								{foreach from=$competition.teams item=\"teams\" key=\"teamName\"}\r\n									{foreach from=$teams.users item=\"users\" key=\"userName\"}\r\n										<span class=\"cellTiny\" style=\"clear:left;\"><small><input type=\"checkbox\" name=\"managePlayers[delete][]\" value=\"{$userName}\" style=\"width:14px; height:14px;margin:0px 2px;\"></small></span>\r\n										<span class=\"cell\"><small><a href=\"?pg=myhome&cid={$competition.id}&userId={$users.id}&hideComps=1\">{$userName}</a></small></span>\r\n										<span class=\"cellSmall\"><small><a href=\"mailto:{$users.email}\">email</a></small></span><br />\r\n									{/foreach}\r\n								{/foreach}\r\n							{else}\r\n								<span class=\"cellHeadTiny\" style=\"clear:left;\">Del</span>\r\n								<span class=\"cellHead\">View Stats</span>\r\n								<span class=\"cellHeadSmall\">-</span><br />\r\n								{foreach from=$competition.users item=\"compUser\" key=\"username\" name=\"dateUpdated\"}\r\n									<span class=\"cellTiny\" style=\"clear:left;\"><small><input type=\"checkbox\" name=\"managePlayers[delete][]\" value=\"{$username}\" style=\"width:14px;height:14px;margin:0px 2px;\"></small></span>\r\n									<span class=\"cell\"><small><a href=\"?pg=myhome&cid={$competition.id}&userId={$compUser.id}&hideComps=1\">{$username}</a></small></span>\r\n									<span class=\"cellSmall\"><small><a href=\"mailto:{$compUser.email}\">email</a></small></span><br />\r\n								{/foreach}\r\n							{/if}\r\n					<div style=\"text-align:center;\">\r\n                                                <br />\r\n						<input type=\"submit\" class=\"button\" value=\"Delete Selected\">\r\n					</div>\r\n					</form>\r\n		</div><br/>\r\n		{/if}\r\n		{* End new section for Player management. *}\r\n		\r\n		{* Begin new section for Team management.  This can be moved where ever. *}\r\n		{* ******************************** TEAM MANAGEMENT ***************************************** *}\r\n		{if $isManager and $competition.style eq \'Group-vs-Group\'}\r\n		<h2 class=\"withBG\">\r\n			<div class=\"topRight hideShow\">\r\n				<a href=\"javascript:toggle(\'teamManagement\', \'\', \'showHide\');\"><img id=\"teamManagement_img\" src=\"./img/blank.gif\" class=\"showHide_{if $smarty.request.showTeamManagement}on{else}off{/if}\" alt=\"show/hide\" border=\"0\" /></a>\r\n			</div>\r\n			Teams</h2>\r\n		<div id=\"teamManagement\" style=\"display:{if $smarty.request.showTeamManagement}block{else}none{/if};\">\r\n			<form name=\"manageTeam[]\" action=\"index.php\" method=\"POST\" style=\"margin:0px;\">\r\n			<input type=\"hidden\" name=\"pg\" value=\"{$page.name}\">\r\n			<input type=\"hidden\" name=\"cid\" value=\"{$competition.id}\">\r\n			<input type=\"hidden\" name=\"no_expire\" value=\"true\">\r\n			<div id=\"playersList{counter}\">\r\n				<span class=\"cellHeadTiny\">Del</span>\r\n				<span class=\"cellHeadLarge\" style=\"width:134px;\">Team Name</span><br />\r\n				{foreach from=$competition.teams item=\"teams\" key=\"teamName\"}\r\n					{counter name=\"counterI\" start=\"0\" print=0}\r\n					{if $teams.name ne \"Waiting to Join\"}\r\n						<span class=\"cellTiny\" style=\"clear:left;\"><small><input type=\"checkbox\" name=\"manageTeam[delete][]\" value=\"{$teams.name}\"></small></span>\r\n						<span class=\"cellLarge\" style=\"width:134px;\"><small><input id=\"renameTeam\" type=\"text\" value=\"{$teams.name}\" name=\"manageTeam[rename][{$teams.name}]\" size=\"10\" style=\"width:124px;height:12px\"></small></span><br />\r\n					{/if}\r\n				{/foreach}\r\n			</div>\r\n                        <br />\r\n			<div style=\"text-align:center;\">New Team: <input id=\"addTeam\" type=\"text\" name=\"manageTeam[addTeam]\" size=\"10\"><br />\r\n			<br />\r\n                        <input type=\"submit\" class=\"button\" value=\"Submit Changes\"></div>\r\n			</form>\r\n		</div><br />\r\n		{/if}\r\n		{* End new section for Team management. *}\r\n\r\n		\r\n		{if !$isManager AND $competition.users|@count lt 45}{include file=\"layouts/ads.tpl\"}{assign var=\"adsShown\" value=\"1\"}{/if}\r\n\r\n			<h2 class=\"withBG\">Competition Stats</h2>\r\n			<span class=\"cellHeadLarge\">Category</span><span class=\"cellHeadSmall\">Result</span><br />\r\n			<span class=\"cellLarge\"><small>start weight</small></span>\r\n			<span class=\"cellSmall\"><small>{$competition.groupStartWeight|default:0} lbs</small></span><br />\r\n			<span class=\"cellLarge\"><small>weight lost</small></span>\r\n			<span class=\"cellSmall\"><small>{$competition.groupWeightLost|default:0} lbs</small></span><br />\r\n			{if $competition.groupPercentageWeightLost gt 0}<span class=\"cellLarge\"><small>% lost</small></span>\r\n			<span class=\"cellSmall\"><small>{$competition.groupPercentageWeightLost|default:0|number_format:\"2\"}</small></span><br />{/if}\r\n			<span class=\"cellLarge\"><small>fat intake</small></span>\r\n			<span class=\"cellSmall\"><small>{$competition.groupFat|default:0}</small></span><br />\r\n			<span class=\"cellLarge\"><small>calorie intake</small></span>\r\n			<span class=\"cellSmall\"><small>{$competition.groupCalories|default:0}</small></span><br />\r\n			<span class=\"cellLarge\"><small>minutes exercised</small></span>\r\n			<span class=\"cellSmall\"><small>{$competition.groupExercise|default:0}</small></span><br />\r\n			<span class=\"cellLarge\"><small>miles exercised</small></span>\r\n			<span class=\"cellSmall\"><small>{$competition.groupDistanceExercised|default:0}</small></span><br />\r\n			<img src=\"./img/blank.gif\" width=\"165\" height=\"1\" alt=\"\" />\r\n		</td>\r\n		<td width=\"100%\" valign=\"top\">\r\n			<div id=\"contentBox\" class=\"centerBox\" style=\"margin-left:10px;\"><div class=\"topRightTreasure\">\r\n				{include_php file=\"shared_handle:competition.verifyInitialPot\"}\r\n<div id=\"jackpot\">{if $competition.potAmount gt 0}${$competition.potAmount|number_format:2}{/if}</div>\r\n<h1 class=\"underline\">{$competition.title|default:\"Competition Title\"}</h1>\r\n\r\n{* ******************************** COMPETITION END *********************************** *}\r\n{if $competition.endDate lt $smarty.now}   {* COMPETITION IS OVER *}\r\n	{if $competition.results.winners|@count eq 1}\r\n		{* There was one winner, either by scoringMethod or tieBreakerMethod *}\r\n\r\n		{math assign=\"daysOfCompetition\" equation=\"(x - y) / z\" x=$competition.endDate|default:\"0\" y=$competition.startDate|default:\"0\" z=\"86400\"}\r\n		{math assign=\"marginOfVictory\" equation=\"x - y\" x=$competition.results.winningStat|default:\"0\" y=$competition.results.secondPlaceStat|default:\"0\"}\r\n\r\n		{foreach from=$competition.results.winners item=\"winnerName\"}    {*key=\"winnerName\"*}\r\n			{assign var=\"winnerData\" value=$competitions.users.$winnerName}\r\n			\r\n			{if $competition.style eq \"Group-vs-Group\"}\r\n				{assign var=\"description\" value=\"Winning Team\"}\r\n				{assign var=\"avg\" value=\"average\"}\r\n			{else}\r\n				{assign var=\"description\" value=\"Winner\"}\r\n			{/if}\r\n\r\n			<h2><br /><b>{$winnerName}</b> is the {$description}{if $competition.potAmount}, taking home <b>$<i>{$competition.potAmount|number_format:2}</i></b>{/if}!</h2>\r\n			<br />\r\n			{strip}\r\n			{if not $competition.results.isTie}   {* Not a Tie *}\r\n				After a difficult <b>{$daysOfCompetition|number_format:0}</b> days of \r\n				fierce competition, <b>{$winnerName}</b> is the \r\n				{$description}!	Based on \r\n				<b>{$competition.results.winningMethod}</b>, <b>{$winnerName}</b> \r\n				won with <b>{$competition.results.winningStat|number_format:2} \r\n				{if $competition.results.winningMethod eq \"Weight Lost\"}{$avg} pounds lost\r\n				{elseif $competition.results.winningMethod eq \"Percentage Weight Lost\"}{$avg} % body weight lost\r\n				{elseif $competition.results.winningMethod eq \"Minutes Exercise\"}{$avg} minutes exercised\r\n				{elseif $competition.results.winningMethod eq \"Distance Exercised\"}{$avg} miles exercised\r\n				{elseif $competition.results.winningMethod eq \"Weight Gained\"}{$avg} pounds gained\r\n				{/if}</b>.\r\n			{else}                                {* A Tie! *}\r\n				{assign var=\"weightLost\" value=\"Weight Lost\"}\r\n				{assign var=\"percentLost\" value=\"Percentage Weight Lost\"}\r\n\r\n				After a difficult <b>{$daysOfCompetition|number_format:0}</b> \r\n				days of fierce competition, there was a tie in the judging \r\n				method, <b>{$competition.scoringMethod}</b>. To break this \r\n				tie, the selected tie breaking method, \r\n				<b>{$competition.tieBreakerMethod}</b>, was used to determine \r\n				<b>{$winnerName}</b> as the {$description}. <b>{$winnerName}</b> \r\n				won with <b>{$competition.results.winningStat|number_format:2}\r\n				{if $competition.results.winningMethod eq \"Weight Lost\"}{$avg} pounds lost\r\n				{elseif $competition.results.winningMethod eq \"Percentage Weight Lost\"}{$avg} % body weight lost\r\n				{elseif $competition.results.winningMethod eq \"Minutes Exercise\"}{$avg} minutes exercised\r\n				{elseif $competition.results.winningMethod eq \"Distance Exercised\"}{$avg} miles exercised\r\n				{elseif $competition.results.winningMethod eq \"Weight Gained\"}{$avg} pounds gained\r\n				{/if}</b>.\r\n				<!--\r\n				<b>{$winnerData.$weightLost|number_format:0} pounds</b>, which \r\n				was <b>{$winnerData.$percentLost|number_format:4}%</b> body weight.\r\n				-->\r\n			{/if}\r\n			{/strip}\r\n			<br />\r\n			<br />\r\n			<b>{$winnerName}</b> won with a <b>{$marginOfVictory|number_format:3}</b> margin over <b>{$competition.results.secondPlaceUser}</b>.\r\n			\r\n			<h2><br />Congratulations to you all!</h2>\r\n			<br />\r\n			<div class=\"underline\"></div>\r\n		{/foreach}\r\n\r\n	{elseif $competition.results.winners|@count gt 1}\r\n		{* There were multiple winners, even after tieBreakerMethod (should RARELY happen) *}\r\n	\r\n		<h2>There was a tie in this competition. The winners, by <b>{$competition.results.winningMethod}</b> having lost <b>{$competition.results.winningStat}</b>, are:<br /></h2>\r\n		<ul>\r\n		{foreach from=$competition.results.winners item=\"winnerData\" key=\"winnerName\"}\r\n			<li>{$winnerName}</li>\r\n		{/foreach}\r\n		</ul>\r\n		\r\n	{else}\r\n		{* For some reason, there were no winners *}\r\n\r\n		<h2><br />\r\n		Winner information is currently unavailable.<br />\r\n		Please check back soon.\r\n		<br /><br /></h2>\r\n	{/if}\r\n	This competition has ended and is no longer active.<br />\r\n{/if}\r\n{* ************************************************************************************ *}\r\n\r\n<div id=\"prizeDesc\">{$competition.potDescription}<br />\r\n{if $competition.potAmount}<small style=\"color:#FFF;\">(${$competition.individualPotAmount} from {$competition.potMethod})</small>{/if}</div>\r\n\r\n{if $competition.startDate lt $smarty.now}\r\n	Time remaining: <b>{$competition.timeLeft}</b><br />\r\n{else}\r\n	This competition has not yet started!<br />\r\n{/if}\r\n\r\nStart{if $competition.startDate lt $smarty.now}ed{else}s{/if}: <b>{$competition.startDate|date_format2:\"n/j/Y\"}</b> &nbsp; \r\nEnd{if $competition.endDate lt $smarty.now}ed{else}s{/if}: <b>{$competition.endDate|date_format2:\"n/j/Y\"}</b><br />\r\n{if $competition.calculationMode neq \"Real-Time\"}Competition stats/scoring updated as of {$competition.dateOfObject|date_format2:\"n/j/Y g:i A\"}{if $isManager} (<a href=\"?pg=competition&cid={$smarty.request.cid}&nocache=1\">Update Now!</a>){/if}<br />{/if}\r\n<div style=\"font-size:5px;clear:left;\">&nbsp;</div>\r\n{assign var=\"scoringMethod\" value=$competition.scoringMethod}\r\n{assign var=\"tieBreakerMethod\" value=$competition.tieBreakerMethod}\r\n{assign var=\"weeklyWinnersMethod1\" value=$competition.weeklyWinnersMethod1}\r\n{assign var=\"weeklyWinnersMethod2\" value=$competition.weeklyWinnersMethod2}\r\n\r\n{* ******************** WEEKLY WINNERS ********************* *}\r\n{if $competition.weeklyWinners}\r\n	{if $weeklyWinnersMethod1}             {* DON\'T FORGET TO REMOVE THE ACM CHECK WHEN READY!!! *}\r\n		<h2 class=\"withBG\">\r\n			<div class=\"topRight hideShow\">\r\n			<a href=\"javascript:toggle(\'weeklyWinners\', \'\', \'showHide\');\"><img id=\"weeklyWinners_img\" src=\"./img/blank.gif\" class=\"showHide_on\" alt=\"show/hide\" border=\"0\" /></a></div>\r\n			Last Week\'s Winners<i>!</i> <small style=\"color:#000; font-size:11px;\">(<i><b>{$competition.weeklyWinners.startDate|date_format2:\"D n/j\"}</b> through <b>{$competition.weeklyWinners.endDate|date_format2:\"D n/j\"}</b></i>)</small></h2> \r\n		<div id=\"weeklyWinners\">\r\n		<table width=\"100%\" cellpadding=\"3\" cellspacing=\"0\"><tr>\r\n		<td valign=\"top\" width=\"50%\">\r\n		<div class=\"cellHeadLarge\" style=\"width:auto;float:none;\">{$weeklyWinnersMethod1}</div>\r\n		<img src=\"{$skinFolder}images/winner_1.gif\" style=\"float:left;\" />\r\n		{strip}\r\n		{foreach name=\"method1\" from=$competition.weeklyWinners.$weeklyWinnersMethod1 item=\"username\"}\r\n			{assign var=\"userValue\" value=$competition.weeklyWinners.users.$username.$weeklyWinnersMethod1}\r\n			{if $smarty.foreach.method1.iteration gt 3 OR $userValue lte 0}{if $smarty.foreach.method1.iteration eq 1}Don\'t forget to update your progress so there will be winners next week{/if}<i>!</i>{php}break;{/php}\r\n			{elseif $smarty.foreach.method1.iteration eq 1}\r\n				<b>{$username|default:\"[ ?? ]\"|ucfirst}</b> led the way last week by \r\n				{if $weeklyWinnersMethod1 eq \'Weight Lost\'}losing <b>{$userValue}</b> pounds{elseif $weeklyWinnersMethod1 eq \'Percentage Weight Lost\'}losing <b>{$userValue|number_format:\"2\"}%</b> body weight{elseif $weeklyWinnersMethod1 eq \'Minutes Exercise\'}exercising <b>{$userValue}</b> minutes{elseif $weeklyWinnersMethod1 eq \'Distance Exercised\'}exercising <b>{$userValue}</b> miles{elseif $weeklyWinnersMethod1 eq \'Weight Gained\'}gaining <b>{$userValue}</b> pounds{else}<b>default</b>{/if}\r\n			{else}\r\n				{if $smarty.foreach.method1.iteration eq 2}, followed by <b>{$username|default:\"[ ?? ]\"|ucfirst}</b> with \r\n				{else} and <b>{$username|default:\"[ ?? ]\"|ucfirst}</b> with \r\n				{/if}\r\n				{if $weeklyWinnersMethod1 eq \'Weight Lost\'}<b>{$userValue}</b> pounds{elseif $weeklyWinnersMethod1 eq \'Percentage Weight Lost\'}<b>{$userValue|number_format:\"2\"}%</b>{elseif $weeklyWinnersMethod1 eq \'Minutes Exercise\'}<b>{$userValue}</b> minutes{elseif $weeklyWinnersMethod1 eq \'Distance Exercised\'}<b>{$userValue}</b> miles{elseif $weeklyWinnersMethod1 eq \'Weight Gained\'}<b>{$userValue}</b> pounds{/if}\r\n			{/if}\r\n		{/foreach}\r\n		{/strip}\r\n		</td>\r\n	{/if}\r\n	{if $weeklyWinnersMethod2} \r\n		<td valign=\"top\" width=\"50%\">\r\n		<div class=\"cellHeadLarge\" style=\"width:auto;float:none;\">{$weeklyWinnersMethod2}</div>\r\n		<img src=\"{$skinFolder}images/winner_2.gif\" style=\"float:left;\" />\r\n		{* display var=$competition.weeklyWinners.users *}\r\n		{strip}\r\n		{foreach name=\"method2\" from=$competition.weeklyWinners.$weeklyWinnersMethod2 item=\"username\"}\r\n			{assign var=\"userValue\" value=$competition.weeklyWinners.users.$username.$weeklyWinnersMethod2}\r\n			\r\n			{if $smarty.foreach.method2.iteration gt 3 OR $userValue lte 0}{if $smarty.foreach.method2.iteration eq 1}Don\'t forget to update your progress so there will be winners next week{/if}<i>!</i>{php}break;{/php}\r\n			{elseif $smarty.foreach.method2.iteration eq 1}\r\n				<b>{$username|default:\"[ ?? ]\"|ucfirst}</b> won by \r\n				{if $weeklyWinnersMethod2 eq \'Weight Lost\'}losing <b>{$userValue}</b> pounds{elseif $weeklyWinnersMethod2 eq \'Percentage Weight Lost\'}losing <b>{$userValue|number_format:\"2\"}%</b> body weight{elseif $weeklyWinnersMethod2 eq \'Minutes Exercise\'}exercising <b>{$userValue}</b> minutes{elseif $weeklyWinnersMethod2 eq \'Distance Exercised\'}exercising <b>{$userValue}</b> miles{elseif $weeklyWinnersMethod2 eq \'Weight Gained\'}gaining <b>{$userValue}</b> pounds{/if}\r\n			{else}\r\n				{if $smarty.foreach.method2.iteration eq 2}, followed by <b>{$username|default:\"[ ?? ]\"|ucfirst}</b> with \r\n				{else} and <b>{$username|default:\"[ ?? ]\"|ucfirst}</b> with \r\n				{/if}\r\n				{if $weeklyWinnersMethod2 eq \'Weight Lost\'}<b>{$userValue}</b> pounds{elseif $weeklyWinnersMethod2 eq \'Percentage Weight Lost\'}<b>{$userValue|number_format:\"2\"}%</b>{elseif $weeklyWinnersMethod2 eq \'Minutes Exercise\'}<b>{$userValue}</b> minutes{elseif $weeklyWinnersMethod2 eq \'Distance Exercised\'}<b>{$userValue}</b> miles{elseif $weeklyWinnersMethod2 eq \'Weight Gained\'}<b>{$userValue}</b> pounds{/if}\r\n			{/if}\r\n		{/foreach}\r\n		{/strip}\r\n		</td>\r\n	{/if}\r\n	{if $weeklyWinnersMethod1}\r\n	</tr></table></div>{/if}\r\n{/if}\r\n{* ********************************************************* *}\r\n\r\n{if $acm->isDomainAdmin() and $smarty.request.debug}\r\n	{display var=$competition}\r\n{/if} \r\n\r\n{* ******************************** COMPARISON GRAPHS ***************************************** *}\r\n{if $competition.availableGraphs|@count}\r\n{include_php file=\"shared_handle:competition.graphs\"}\r\n<h2 class=\"withBG\"><a name=\"graph\"></a>\r\n	<div class=\"topRight hideShow\">\r\n		<a href=\"javascript:toggle(\'graphs\', \'\', \'showHide\');\"><img id=\"graphs_img\" src=\"./img/blank.gif\" class=\"showHide_on\" alt=\"show/hide\" border=\"0\" /></a></div> \r\n	Comparison Graphs &nbsp; <small><i>No graph? <a href=\"http://www.macromedia.com/shockwave/download/download.cgi?P1_Prod_Version=ShockwaveFlash\" target=\"_blank\">click here</a> to download the free Flash Player plug-in.</i></small></h2>\r\n<div id=\"graphs\" style=\"display:block;\">\r\n	<table border=\"0\" cellpadding=\"0\" width=\"100%\">\r\n		{assign var=\"graphURL\" value=\"?pg=flashgraph-frame&format=wide\"}\r\n	<tr>\r\n		<td><div style=\"border:#999 1px solid;background-color:#FFF;padding:5px;\"><iframe name=\"graphwindow\" src=\"{$graphURL}\" frameborder=\"0\" width=\"625\" height=\"222\" scrollbars=\"no\"></iframe></div></td>\r\n	</tr>\r\n	<tr>\r\n		<td valign=\"top\" align=\"center\" width=\"100%\">\r\n		<small>\r\n		{foreach name=\"graphTypes\" from=$competition.availableGraphs key=\"graphType\" item=\"graphParams\"}\r\n		<a href=\"?pg=flashgraph-frame&compId={$competition.id}&{$graphParams}\" target=\"graphwindow\">{$graphType}</a>{if $smarty.foreach.graphTypes.iteration neq $competition.availableGraphs|@count} | {/if}\r\n		{/foreach}\r\n		</small></td>\r\n	</tr>\r\n	</table>\r\n<br />\r\n</div>\r\n{/if}\r\n\r\n{* ******************************** GROUP TEAMS/PLAYERS SUMMARY W/MOVING ***************************************** *}\r\n{if $competition.style eq \'Group-vs-Group\'}\r\n<h2 class=\"withBG\">\r\n	<div class=\"topRight hideShow\">\r\n		<a href=\"javascript:toggle(\'teams\', \'\', \'showHide\');\"><img id=\"teams_img\" src=\"./img/blank.gif\" class=\"showHide_on\" alt=\"show/hide\" border=\"0\" /></a></div> \r\n	The Teams &nbsp; <small><i>Assignments and statistics</i></small></h2>\r\n<div id=\"teams\" style=\"display:block;\">\r\n<table cellpadding=\"0\" cellspacing=\"0\" width=\"100%\" border=\"0\"><tr><td>\r\n	{if $isManager}\r\n		<form name=\"changeTeam\" action=\"index.php\" method=\"POST\" style=\"margin:0px;\">\r\n			<input type=\"hidden\" name=\"pg\" value=\"{$page.name}\">\r\n			<input type=\"hidden\" name=\"cid\" value=\"{$competition.id}\">\r\n			<input type=\"hidden\" name=\"no_expire\" value=\"true\">\r\n	{/if}\r\n		{assign var=\"minEx\" value=\"Minutes Exercise\"}\r\n		{assign var=\"distEx\" value=\"Distance Exercised\"}\r\n		{assign var=\"pctLst\" value=\"Percentage Weight Lost\"}\r\n		{assign var=\"wtLst\" value=\"Percentage Weight Lost\"}\r\n		{foreach from=$competition.teams name=\"teamsLoop\" item=\"teams\" key=\"teamName\"}\r\n			<div id=\"playersList{$smarty.foreach.teamsLoop.iteration}\" style=\"float:left;width:310px;overflow:hidden;word-wrap:nowrap; margin:0px 5px 5px 0px;\">\r\n			<h4>{if $teams.name eq \"Waiting to Join\"}Not assigned to a team{else}{$teams.name|default:\"&nbsp;\"}{/if}</h4>\r\n		{if $scoringMethod|regex_match:\"/exercise/i\"}\r\n			<span class=\"cellHeadLarge\">Name</span>\r\n			<span class=\"cellHeadSmall\">Min.</span>\r\n			<span class=\"cellHeadSmall\">Dist.</span>\r\n			<span class=\"cellHeadSmall\">Update</span><br />\r\n			{foreach from=$teams.users item=\"users\" key=\"userName\"}\r\n				<span class=\"cellLarge\" style=\"text-align:left;\"><small>{if $isManager}<input type=\"checkbox\" name=\"changeTeam[players][{$userName}]\" style=\"width:14px;height:14px;margin:0px 2px;\" />{/if}{$userName}</small></span>\r\n				<span class=\"cellSmall\"><small>{$users.$minEx|default:\"-\"|replace:\".00\":\"\"}</small></span>\r\n				<span class=\"cellSmall\"><small>{$users.$distEx|default:\"-\"|replace:\".00\":\"\"}</small></span>\r\n				<span class=\"cellSmall\"><small>{if $users.dateOfEntry}{$users.dateOfEntry|date_format2:\"n/j/y\"}{else}Never{/if}</small></span>\r\n			{foreachelse}\r\n				{* No players assigned to this team. *}\r\n			{/foreach}\r\n		{else}\r\n			<span class=\"cellHeadLarge\">Name</span>\r\n			<span class=\"cellHeadTiny\">%</span>\r\n			<span class=\"cellHeadSmall\">Update</span><br />\r\n			{foreach from=$teams.users item=\"users\" key=\"userName\"}\r\n				<span class=\"cellLarge\" style=\"clear:left;text-align:left;\"><small>{if $isManager}<input type=\"checkbox\" name=\"changeTeam[players][{$userName}]\" />{/if}{$userName}</small></span>\r\n				<span class=\"cellTiny\"><small>{if $users.hideInitialWeight neq \"Yes\"}{$users.$pctLst|number_format:\"2\"|replace:\".00\":\"\"}{else}-{/if}</small></span>\r\n				<span class=\"cellSmall\"><small>{if $users.dateOfEntry}{$users.dateOfEntry|date_format2:\"n/j/y\"}{else}Never{/if}</small></span><br />\r\n			{foreachelse}\r\n				{* No players assigned to this team. *}\r\n			{/foreach}\r\n		{/if}\r\n			</div>\r\n		{/foreach}\r\n	{if $isManager}\r\n		<br />\r\n		<select name=\"changeTeam[team]\">\r\n			<option value=\"\">Move selected players to...</option>\r\n			{foreach from=$competition.teams item=\"newTeams\" key=\"newTeamName\"}\r\n				{*if $newTeams.name ne $teams.name and $newTeams.name ne \"Waiting to Join\"*}\r\n				{if $newTeams.name ne \"Waiting to Join\"}\r\n					<option value=\"{$newTeams.name}\">{$newTeams.name}</option>\r\n				{/if}\r\n			{/foreach}\r\n		</select><br />\r\n		<input type=\"submit\" class=\"button\" value=\"Submit Changes\">\r\n		</form>\r\n	{/if}\r\n</td></tr></table>\r\n</div>\r\n{/if}\r\n</div></div></td>\r\n</tr></table>\r\n	\r\n	{* ******************************** DISCUSSION BOARD ***************************************** *}\r\n\r\n<h2 class=\"withBG\">\r\n	<div class=\"topRight hideShow\">\r\n		<a href=\"javascript:toggle(\'discuss\', \'\', \'showHide\');\"><img id=\"discuss_img\" src=\"./img/blank.gif\" class=\"showHide_on\" alt=\"show/hide\" border=\"0\" /></a></div> \r\n	Discussion Board</h2>\r\n<div id=\"discuss\" style=\"display:block;\">\r\n	<table cellpadding=\"0\" width=\"100%\" border=\"0\"><tr><td><iframe src=\"?pg=competition/forum\" id=\"discussionBoard\" frameborder=\"0\" scrolling=\"yes\" style=\"width:100%;\"></iframe></td></tr></table>\r\n</div>'),(3490,220,0.20,'smarty','0','added content',1111007671,16,'128.187.0.165','{assign var=\"pgLayout\" value=\"layouts/withLeftNav.tpl\"}\r\n\r\n<h1>{$page.title}</h1>\r\n\r\n<img src=\"{$skinFolder}images/doctorClipboard.jpg\" align=\"right\" alt=\"\" class=\"img1\" hspace=\"20\" vspace=\"20\"/><br />\r\n\r\n\r\n<p>Health Care providers have used health risk assessments (HRA) for over 20 years to educate patients on potential health risks that are related to lifestyle and family history. </p>\r\n<p>Our online HRA asks a series of questions that will help determine each individual’s health risk. The questions fall into the following categories: Behaviors that have an effect on health, Family medical history and current health status, such as cholesterol levels, blood pressure readings and weight. </p>\r\n<p>Once the HRA has been completed the answers are used to calculate individual risk using studies from well-recognized organizations. </p> \r\n<p><b>Benefits to HRA’s include:</b> possibility to discover health risk factors that an individual might not have known about; Alerting individuals to aspects of their health that may need more attention; Potential to avoid more serious health complications; Allowing management to determine what types of programs need to be implemented to help improve employee health. </p>\r\n<ul>\r\n<li>Score 100 – 85: Low Risk Level</li>\r\n<li>Score 86 – 75: Medium Risk Level</li>\r\n<li>Score 76- 0: High Risk Level</li>\r\n</ul>\r\n\r\n\r\n\r\n<p> Below you will find answers to commonly asked questions about health. Many of the questions on the HRA are found below.</p>\r\n\r\n\r\n\r\n\r\n<p><b>Q.  What does BMI stand for and what is a healthy BMI for me? </b></p>\r\n<p><b>A.</b>  BMI stands for Body Mass Index and is a ratio of weight to height, used to estimate the relationship of body composition to risk factors of certain diseases. Use our calculator to determine what your BMI is and refer to the chart below to see what category you are in.\r\n<ul>\r\n<li>18.5 or less is Under Weight </li>\r\n<li>18.5 to 24.9 is Normal </li>\r\n<li>25.0 to 29.9 is Overweight </li>\r\n<li>30.0 to 34.9 is Level 1 Obese </li>\r\n<li>35.0 to 39.9 is Level 2 Obese </li>\r\n<li>40 or greater is Extreme Obese</li>\r\n</ul>\r\n</p><p><b>Q.  How accurate is the BMI measurement? \r\n</p><p>A.</b>  For the vast majority of average individuals, the BMI is a useful and accurate measurement. The drawback lies in the fact that short, muscular individuals may be falsely labeled as obese, and tall lean individuals as underweight.\r\n\r\n\r\n</p><p><b>Q.  What is a healthy blood pressure? \r\n</p><p>A.</b>  According to national guidelines, normal blood pressure is below 120/80 mmHg. Blood pressure above 140/90 mmHg is diagnosed as hypertension, or high blood pressure. Someone with hypertension is at higher risk of having strokes, heart attacks and kidney failure.\r\n\r\n</p><p><b>Q.  How can I lower blood pressure besides medication?\r\n</p><p>A.</b>  Hypertension can be treated through increased exercise and a better diet. Many recent studies have shown that regular aerobic exercise (workouts like brisk walking that use large muscles for an extended period) over several months may modestly lower blood pressure. According to a recent National Institutes of Health conference, aerobic exercise reduces resting (nonexercise) blood pressure in people who have hypertension by an average of 11 points off the top number and 9 points off the bottom number. That could be enough to lower high blood pressure to normal. Reducing sodium(salt) in your diet can also help to lower blood pressure.\r\n\r\n</p><p><b>Q.  Where should my cholesterol levels be?\r\n</p><p>A. </b> Your TOTAL blood cholesterol will fall into one of these categories:\r\n<ul>\r\n<li>Desirable is Less than 200 mg/dL </li>\r\n<li>Borderline high risk is 200 to 239 mg/dL </li>\r\n<li>High risk is 240 mg/dL and over</li>\r\n</ul>\r\nThere are two types of cholesterol in your body: LDL is bad cholesterol and contributes to artery clogging. You want Low LDL levels (below 100 is optimal). HDL is good cholesterol and helps to clear arterial blockage. You want High HDL levels. (Less than 40 is too low) To lower your LDL and raise your HDL levels you can: \r\n<ul>\r\n<li>Quit Smoking </li>\r\n<li>Lose weight (or maintain a healthy weight) </li>\r\n<li>Be physically active for at least 30 to 60 minutes a day on most or all days of the week. </li>\r\n</ul>\r\n\r\n\r\n</p><p><b>Q.  How much exercise do I need to do to lose weight?\r\n</p><p>A.</b>  This depends on how many calories you are consuming. To lose weight you need to burn more calories than you take in. It takes 3500 calories burned to lose 1 pound. That’s going into a deficit of 1,000 calories a day if you want to lose 2 lbs a week. This can be done by eating 500 calories less than you normally do and burning 500 calories per day more through exercise. That is equivalent to about a 45 minute jog.\r\nExercising 30 to 60 minutes 5 days a week is a good guideline to follow and will not only aid in weight loss but will also reduce your risk for several diseases including heart disease, diabetes and colon cancer.\r\n\r\n\r\n</p><p><b>Q.  What is the best type of exercise to lose body fat?\r\n</p><p>A.</b>  When your body is engaged in aerobic exercise, it utilizes fat as its fuel. So if your goal is to lose body fat, your main modes of exercise should be walking, jogging, biking or swimming in your target heart rate zone.\r\n\r\n\r\n</p><p><b>Q.  How can I know what my body fat percentage is?\r\n</p><p>A.</b>  There are several different methods used to determine body fat percentage. Hydrostatic or underwater weighing is probably the most accurate and widely used. There are other methods and devices including the DEXA machine, the Bod Pod, Tanita scales, hand held devices and Skin Calipers. The key is to use the same method consistently so that you can see the change in your body fat percentage. \r\n\r\n</p><p><b>Q.  What is heart disease and how does exercise and nutrition affect my risks?\r\n</p><p>A.</b>  Heart disease occurs because of inadequate blood flow to the heart muscle. This occurs when the arteries that supply the heart muscle (the coronary arteries) become partially or completely blocked. Obese people are at increased risk of heart disease due to their higher rates of hypercholesterolemia, diabetes and hypertension. Several studies have proven the beneficial effects of exercise on heart diseases. Not only will it reduce body fat, but it will also help to lower blood cholesterol, blood pressure and regulate glucose metabolism. Eating a diet high low in saturated fat and cholesterol and high in dietary fiber will lower your risk for heart disease.\r\n\r\n</p><p><b>Q.  What is the Target Heart Rate zone? \r\n</p><p>A.</b>  The Target Heart Rate zone refers to the range that you want your heart rate to be in while you are doing aerobic exercise. This is the best zone to be in to burn body fat. Calculate your target heart rate zone using our calculator.\r\n\r\n\r\n</p><p><b>Q.  Do I really need to lift weights?\r\n</p><p>A.</b>  There are many benefits to strength training including:\r\n<ul>\r\n<li>Higher metabolism</li>\r\n<li>Stronger bones</li>\r\n<li>Increased muscle strength and endurance</li>\r\n<li>Increased balance, flexibility and stability</li>\r\n<li>Decreased risk of coronary heart disease</li>\r\n<li>Injury prevention</li>\r\n<li>Feel and look better</li>\r\n<li>Strength training will help you with weight loss because the more muscle you have the more calories you burn at rest.</li>\r\n</ul>\r\n\r\n</p><p><b>Q.  What if I just don\'t have time to exercise?\r\n<p>A.</b>  We all have busy schedules and the trick with exercising is plan, plan, plan. Schedule it in before your busy week begins. Make it a priority. Set aside time one day a week to plan when, where and for how long you will exercise. It may require getting up half hour earlier, or taking a little longer lunch break. If there is absolutely no time in your schedule for a formal exercise session you can do little tricks like parking farther away at the store, not taking the elevator, etc. Every little bit helps.\r\n\r\n\r\n</p><p><b>Q.  If I am overweight or obese, what diseases am I at risk for?\r\n</p><p>A.</b>  Obesity places you at risk for several diseases including heart disease, diabetes, some forms of cancer, sleep apnea, abdominal hernias, varicose veins, gout, gall bladder disease, respiratory problems, and liver malfunction. Losing just 10% of your body weight will significantly lower your risk for these diseases.\r\n</p>\r\n'),(3491,220,0.21,'smarty','0','added content',1111007757,16,'128.187.0.165','{assign var=\"pgLayout\" value=\"layouts/withLeftNav.tpl\"}\r\n\r\n<h1>{$page.title}</h1>\r\n\r\n<img src=\"{$skinFolder}images/doctorClipboard.jpg\" align=\"right\" alt=\"\" class=\"img1\" hspace=\"20\" vspace=\"20\"/><br />\r\n\r\n\r\n<p>Health Care providers have used health risk assessments (HRA) for over 20 years to educate patients on potential health risks that are related to lifestyle and family history. </p>\r\n<p>Our online HRA asks a series of questions that will help determine each individual’s health risk. The questions fall into the following categories: Behaviors that have an effect on health, Family medical history and current health status. </p>\r\n<p>Once the HRA has been completed the answers are used to calculate individual risk using studies from well-recognized organizations. </p> \r\n<p><b>Benefits to HRA’s include:</b> possibility to discover health risk factors that an individual might not have known about; Alerting individuals to aspects of their health that may need more attention; Potential to avoid more serious health complications; Allowing management to determine what types of programs need to be implemented to help improve employee health. </p>\r\n<ul>\r\n<li>Score 100 – 85: Low Risk Level</li>\r\n<li>Score 86 – 75: Medium Risk Level</li>\r\n<li>Score 76- 0: High Risk Level</li>\r\n</ul>\r\n\r\n\r\n\r\n<p> Below you will find answers to commonly asked questions about health. Many of the questions on the HRA are found below.</p>\r\n\r\n\r\n\r\n\r\n<p><b>Q.  What does BMI stand for and what is a healthy BMI for me? </b></p>\r\n<p><b>A.</b>  BMI stands for Body Mass Index and is a ratio of weight to height, used to estimate the relationship of body composition to risk factors of certain diseases. Use our calculator to determine what your BMI is and refer to the chart below to see what category you are in.\r\n<ul>\r\n<li>18.5 or less is Under Weight </li>\r\n<li>18.5 to 24.9 is Normal </li>\r\n<li>25.0 to 29.9 is Overweight </li>\r\n<li>30.0 to 34.9 is Level 1 Obese </li>\r\n<li>35.0 to 39.9 is Level 2 Obese </li>\r\n<li>40 or greater is Extreme Obese</li>\r\n</ul>\r\n</p><p><b>Q.  How accurate is the BMI measurement? \r\n</p><p>A.</b>  For the vast majority of average individuals, the BMI is a useful and accurate measurement. The drawback lies in the fact that short, muscular individuals may be falsely labeled as obese, and tall lean individuals as underweight.\r\n\r\n\r\n</p><p><b>Q.  What is a healthy blood pressure? \r\n</p><p>A.</b>  According to national guidelines, normal blood pressure is below 120/80 mmHg. Blood pressure above 140/90 mmHg is diagnosed as hypertension, or high blood pressure. Someone with hypertension is at higher risk of having strokes, heart attacks and kidney failure.\r\n\r\n</p><p><b>Q.  How can I lower blood pressure besides medication?\r\n</p><p>A.</b>  Hypertension can be treated through increased exercise and a better diet. Many recent studies have shown that regular aerobic exercise (workouts like brisk walking that use large muscles for an extended period) over several months may modestly lower blood pressure. According to a recent National Institutes of Health conference, aerobic exercise reduces resting (nonexercise) blood pressure in people who have hypertension by an average of 11 points off the top number and 9 points off the bottom number. That could be enough to lower high blood pressure to normal. Reducing sodium(salt) in your diet can also help to lower blood pressure.\r\n\r\n</p><p><b>Q.  Where should my cholesterol levels be?\r\n</p><p>A. </b> Your TOTAL blood cholesterol will fall into one of these categories:\r\n<ul>\r\n<li>Desirable is Less than 200 mg/dL </li>\r\n<li>Borderline high risk is 200 to 239 mg/dL </li>\r\n<li>High risk is 240 mg/dL and over</li>\r\n</ul>\r\nThere are two types of cholesterol in your body: LDL is bad cholesterol and contributes to artery clogging. You want Low LDL levels (below 100 is optimal). HDL is good cholesterol and helps to clear arterial blockage. You want High HDL levels. (Less than 40 is too low) To lower your LDL and raise your HDL levels you can: \r\n<ul>\r\n<li>Quit Smoking </li>\r\n<li>Lose weight (or maintain a healthy weight) </li>\r\n<li>Be physically active for at least 30 to 60 minutes a day on most or all days of the week. </li>\r\n</ul>\r\n\r\n\r\n</p><p><b>Q.  How much exercise do I need to do to lose weight?\r\n</p><p>A.</b>  This depends on how many calories you are consuming. To lose weight you need to burn more calories than you take in. It takes 3500 calories burned to lose 1 pound. That’s going into a deficit of 1,000 calories a day if you want to lose 2 lbs a week. This can be done by eating 500 calories less than you normally do and burning 500 calories per day more through exercise. That is equivalent to about a 45 minute jog.\r\nExercising 30 to 60 minutes 5 days a week is a good guideline to follow and will not only aid in weight loss but will also reduce your risk for several diseases including heart disease, diabetes and colon cancer.\r\n\r\n\r\n</p><p><b>Q.  What is the best type of exercise to lose body fat?\r\n</p><p>A.</b>  When your body is engaged in aerobic exercise, it utilizes fat as its fuel. So if your goal is to lose body fat, your main modes of exercise should be walking, jogging, biking or swimming in your target heart rate zone.\r\n\r\n\r\n</p><p><b>Q.  How can I know what my body fat percentage is?\r\n</p><p>A.</b>  There are several different methods used to determine body fat percentage. Hydrostatic or underwater weighing is probably the most accurate and widely used. There are other methods and devices including the DEXA machine, the Bod Pod, Tanita scales, hand held devices and Skin Calipers. The key is to use the same method consistently so that you can see the change in your body fat percentage. \r\n\r\n</p><p><b>Q.  What is heart disease and how does exercise and nutrition affect my risks?\r\n</p><p>A.</b>  Heart disease occurs because of inadequate blood flow to the heart muscle. This occurs when the arteries that supply the heart muscle (the coronary arteries) become partially or completely blocked. Obese people are at increased risk of heart disease due to their higher rates of hypercholesterolemia, diabetes and hypertension. Several studies have proven the beneficial effects of exercise on heart diseases. Not only will it reduce body fat, but it will also help to lower blood cholesterol, blood pressure and regulate glucose metabolism. Eating a diet high low in saturated fat and cholesterol and high in dietary fiber will lower your risk for heart disease.\r\n\r\n</p><p><b>Q.  What is the Target Heart Rate zone? \r\n</p><p>A.</b>  The Target Heart Rate zone refers to the range that you want your heart rate to be in while you are doing aerobic exercise. This is the best zone to be in to burn body fat. Calculate your target heart rate zone using our calculator.\r\n\r\n\r\n</p><p><b>Q.  Do I really need to lift weights?\r\n</p><p>A.</b>  There are many benefits to strength training including:\r\n<ul>\r\n<li>Higher metabolism</li>\r\n<li>Stronger bones</li>\r\n<li>Increased muscle strength and endurance</li>\r\n<li>Increased balance, flexibility and stability</li>\r\n<li>Decreased risk of coronary heart disease</li>\r\n<li>Injury prevention</li>\r\n<li>Feel and look better</li>\r\n<li>Strength training will help you with weight loss because the more muscle you have the more calories you burn at rest.</li>\r\n</ul>\r\n\r\n</p><p><b>Q.  What if I just don\'t have time to exercise?\r\n<p>A.</b>  We all have busy schedules and the trick with exercising is plan, plan, plan. Schedule it in before your busy week begins. Make it a priority. Set aside time one day a week to plan when, where and for how long you will exercise. It may require getting up half hour earlier, or taking a little longer lunch break. If there is absolutely no time in your schedule for a formal exercise session you can do little tricks like parking farther away at the store, not taking the elevator, etc. Every little bit helps.\r\n\r\n\r\n</p><p><b>Q.  If I am overweight or obese, what diseases am I at risk for?\r\n</p><p>A.</b>  Obesity places you at risk for several diseases including heart disease, diabetes, some forms of cancer, sleep apnea, abdominal hernias, varicose veins, gout, gall bladder disease, respiratory problems, and liver malfunction. Losing just 10% of your body weight will significantly lower your risk for these diseases.\r\n</p>\r\n'),(3492,220,0.22,'smarty','0','added content',1111007815,16,'128.187.0.165','{assign var=\"pgLayout\" value=\"layouts/withLeftNav.tpl\"}\r\n\r\n<h1>{$page.title}</h1>\r\n\r\n<img src=\"{$skinFolder}images/doctorClipboard.jpg\" align=\"right\" alt=\"\" class=\"img1\" hspace=\"20\" vspace=\"20\"/><br />\r\n\r\n\r\n<p>Health Care providers have used health risk assessments (HRA) for over 20 years to educate patients on potential health risks that are related to lifestyle and family history. </p>\r\n<p>Our online HRA asks a series of questions that will help determine each individual’s health risk. The questions fall into the following categories: Behaviors that have an effect on health, Family medical history and current health status. </p>\r\n<p>Once the HRA has been completed the answers are used to calculate individual risk using studies from well-recognized organizations. </p> \r\n<p><b>Benefits to HRA’s include:</b> possibility to discover health risk factors that an individual might not have known about; Alerting individuals to aspects of their health that may need more attention; Potential to avoid more serious health complications; Allowing management to determine what types of programs need to be implemented to help improve employee health. </p>\r\n<ul>\r\n<li>Score 100 – 85: Low Risk Level</li>\r\n<li>Score 86 – 75: Medium Risk Level</li>\r\n<li>Score 76- 0: High Risk Level</li>\r\n</ul>\r\n\r\n\r\n\r\n<p> Below you will find answers to commonly asked questions about health. Many of the questions on the HRA are found below.</p>\r\n\r\n\r\n\r\n</p><p><b>Q.  What is a healthy blood pressure? \r\n</p><p>A.</b>  According to national guidelines, normal blood pressure is below 120/80 mmHg. Blood pressure above 140/90 mmHg is diagnosed as hypertension, or high blood pressure. Someone with hypertension is at higher risk of having strokes, heart attacks and kidney failure.\r\n\r\n</p><p><b>Q.  How can I lower blood pressure besides medication?\r\n</p><p>A.</b>  Hypertension can be treated through increased exercise and a better diet. Many recent studies have shown that regular aerobic exercise (workouts like brisk walking that use large muscles for an extended period) over several months may modestly lower blood pressure. According to a recent National Institutes of Health conference, aerobic exercise reduces resting (nonexercise) blood pressure in people who have hypertension by an average of 11 points off the top number and 9 points off the bottom number. That could be enough to lower high blood pressure to normal. Reducing sodium(salt) in your diet can also help to lower blood pressure.\r\n\r\n</p><p><b>Q.  Where should my cholesterol levels be?\r\n</p><p>A. </b> Your TOTAL blood cholesterol will fall into one of these categories:\r\n<ul>\r\n<li>Desirable is Less than 200 mg/dL </li>\r\n<li>Borderline high risk is 200 to 239 mg/dL </li>\r\n<li>High risk is 240 mg/dL and over</li>\r\n</ul>\r\nThere are two types of cholesterol in your body: LDL is bad cholesterol and contributes to artery clogging. You want Low LDL levels (below 100 is optimal). HDL is good cholesterol and helps to clear arterial blockage. You want High HDL levels. (Less than 40 is too low) To lower your LDL and raise your HDL levels you can: \r\n<ul>\r\n<li>Quit Smoking </li>\r\n<li>Lose weight (or maintain a healthy weight) </li>\r\n<li>Be physically active for at least 30 to 60 minutes a day on most or all days of the week. </li>\r\n</ul>\r\n\r\n<p><b>Q.  What does BMI stand for and what is a healthy BMI for me? </b></p>\r\n<p><b>A.</b>  BMI stands for Body Mass Index and is a ratio of weight to height, used to estimate the relationship of body composition to risk factors of certain diseases. Use our calculator to determine what your BMI is and refer to the chart below to see what category you are in.\r\n<ul>\r\n<li>18.5 or less is Under Weight </li>\r\n<li>18.5 to 24.9 is Normal </li>\r\n<li>25.0 to 29.9 is Overweight </li>\r\n<li>30.0 to 34.9 is Level 1 Obese </li>\r\n<li>35.0 to 39.9 is Level 2 Obese </li>\r\n<li>40 or greater is Extreme Obese</li>\r\n</ul>\r\n</p><p><b>Q.  How accurate is the BMI measurement? \r\n</p><p>A.</b>  For the vast majority of average individuals, the BMI is a useful and accurate measurement. The drawback lies in the fact that short, muscular individuals may be falsely labeled as obese, and tall lean individuals as underweight.\r\n\r\n\r\n\r\n</p><p><b>Q.  How much exercise do I need to do to lose weight?\r\n</p><p>A.</b>  This depends on how many calories you are consuming. To lose weight you need to burn more calories than you take in. It takes 3500 calories burned to lose 1 pound. That’s going into a deficit of 1,000 calories a day if you want to lose 2 lbs a week. This can be done by eating 500 calories less than you normally do and burning 500 calories per day more through exercise. That is equivalent to about a 45 minute jog.\r\nExercising 30 to 60 minutes 5 days a week is a good guideline to follow and will not only aid in weight loss but will also reduce your risk for several diseases including heart disease, diabetes and colon cancer.\r\n\r\n\r\n</p><p><b>Q.  What is the best type of exercise to lose body fat?\r\n</p><p>A.</b>  When your body is engaged in aerobic exercise, it utilizes fat as its fuel. So if your goal is to lose body fat, your main modes of exercise should be walking, jogging, biking or swimming in your target heart rate zone.\r\n\r\n\r\n</p><p><b>Q.  How can I know what my body fat percentage is?\r\n</p><p>A.</b>  There are several different methods used to determine body fat percentage. Hydrostatic or underwater weighing is probably the most accurate and widely used. There are other methods and devices including the DEXA machine, the Bod Pod, Tanita scales, hand held devices and Skin Calipers. The key is to use the same method consistently so that you can see the change in your body fat percentage. \r\n\r\n</p><p><b>Q.  What is heart disease and how does exercise and nutrition affect my risks?\r\n</p><p>A.</b>  Heart disease occurs because of inadequate blood flow to the heart muscle. This occurs when the arteries that supply the heart muscle (the coronary arteries) become partially or completely blocked. Obese people are at increased risk of heart disease due to their higher rates of hypercholesterolemia, diabetes and hypertension. Several studies have proven the beneficial effects of exercise on heart diseases. Not only will it reduce body fat, but it will also help to lower blood cholesterol, blood pressure and regulate glucose metabolism. Eating a diet high low in saturated fat and cholesterol and high in dietary fiber will lower your risk for heart disease.\r\n\r\n</p><p><b>Q.  What is the Target Heart Rate zone? \r\n</p><p>A.</b>  The Target Heart Rate zone refers to the range that you want your heart rate to be in while you are doing aerobic exercise. This is the best zone to be in to burn body fat. Calculate your target heart rate zone using our calculator.\r\n\r\n\r\n</p><p><b>Q.  Do I really need to lift weights?\r\n</p><p>A.</b>  There are many benefits to strength training including:\r\n<ul>\r\n<li>Higher metabolism</li>\r\n<li>Stronger bones</li>\r\n<li>Increased muscle strength and endurance</li>\r\n<li>Increased balance, flexibility and stability</li>\r\n<li>Decreased risk of coronary heart disease</li>\r\n<li>Injury prevention</li>\r\n<li>Feel and look better</li>\r\n<li>Strength training will help you with weight loss because the more muscle you have the more calories you burn at rest.</li>\r\n</ul>\r\n\r\n</p><p><b>Q.  What if I just don\'t have time to exercise?\r\n<p>A.</b>  We all have busy schedules and the trick with exercising is plan, plan, plan. Schedule it in before your busy week begins. Make it a priority. Set aside time one day a week to plan when, where and for how long you will exercise. It may require getting up half hour earlier, or taking a little longer lunch break. If there is absolutely no time in your schedule for a formal exercise session you can do little tricks like parking farther away at the store, not taking the elevator, etc. Every little bit helps.\r\n\r\n\r\n</p><p><b>Q.  If I am overweight or obese, what diseases am I at risk for?\r\n</p><p>A.</b>  Obesity places you at risk for several diseases including heart disease, diabetes, some forms of cancer, sleep apnea, abdominal hernias, varicose veins, gout, gall bladder disease, respiratory problems, and liver malfunction. Losing just 10% of your body weight will significantly lower your risk for these diseases.\r\n</p>\r\n'),(3493,198,0.24,'smarty','0','added content.',1111009367,16,'128.187.0.165','{include file=\"layouts/forceLoggedIn.tpl\"}\r\n{assign var=\"pgLayout\" value=\"layouts/withLeftNav.tpl\"}\r\n<h1>{$page.title}</h1>\r\n\r\n<table>\r\n<tr><td valign=\"top\">\r\n	<img src=\"blank.gif\" width=\"1\" height=\"1\" alt=\"\" class=\"iconJoggers\" /> \r\n	<p>Its time to get Active!  Below you will find links that can help you understand ways to get exercise and be safe. Remember, the most difficult hurdle to exercise is time - but you must make time. Check out the \"At the Office\" link for things you can do at work.</p>\r\n	<br />\r\n	<br />\r\n	<blockquote>\r\n	<ul>\r\n	{toc_display start_id=$page.id level_limit=1 hide_start=1}\r\n	{literal}\r\n		<li><a href=\"?pg={$toc_pageName}\">{$toc_title}</a></li>\r\n	{/literal}\r\n	{/toc_display}\r\n		{*\r\n		<li><a href=\"#\">Fitness Tips</a></li>\r\n		<li><a href=\"#\">Excercises</a></li>\r\n		<li><a href=\"#\">At the Office</a></li>\r\n		<li><a href=\"#\">Personal Trainer</a></li>\r\n		<li><a href=\"#\">In Your Company</a></li>\r\n		*}\r\n	</ul>\r\n	</blockquote>\r\n</td><td valign=\"top\" align=\"right\">\r\n	<img src=\"blank.gif\" width=\"1\" height=\"1\" alt=\"\" class=\"MISC006.JPG\" /><br />\r\n	<a href=\"?pg=my_shop&sub=&tma=VIEW&eids=8\">Buy a Pedometer</a>\r\n</td></tr>\r\n</table>'),(3494,198,0.25,'smarty','0','added content.',1111009396,16,'128.187.0.165','{include file=\"layouts/forceLoggedIn.tpl\"}\r\n{assign var=\"pgLayout\" value=\"layouts/withLeftNav.tpl\"}\r\n<h1>{$page.title}</h1>\r\n\r\n<table>\r\n<tr><td valign=\"top\">\r\n	<img src=\"blank.gif\" width=\"1\" height=\"1\" alt=\"\" class=\"iconJoggers\" /> \r\n	<p>Its time to get Active!  Below you will find links that can help you understand ways to get exercise and be safe. Remember, the most difficult hurdle to exercise is time - but you must make time. Check out the \"At the Office\" link for things you can do at work.</p>\r\n	<br />\r\n	<br />\r\n	<blockquote>\r\n	<ul>\r\n	{toc_display start_id=$page.id level_limit=1 hide_start=1}\r\n	{literal}\r\n		<li><a href=\"?pg={$toc_pageName}\">{$toc_title}</a></li>\r\n	{/literal}\r\n	{/toc_display}\r\n		{*\r\n		<li><a href=\"#\">Fitness Tips</a></li>\r\n		<li><a href=\"#\">Excercises</a></li>\r\n		<li><a href=\"#\">At the Office</a></li>\r\n		<li><a href=\"#\">Personal Trainer</a></li>\r\n		<li><a href=\"#\">In Your Company</a></li>\r\n		*}\r\n	</ul>\r\n	</blockquote>\r\n</td><td valign=\"top\" align=\"right\">\r\n	<img src=\"blank.gif\" width=\"1\" height=\"1\" alt=\"\" class=\"MISC006.jpg\" /><br />\r\n	<a href=\"?pg=my_shop&sub=&tma=VIEW&eids=8\">Buy a Pedometer</a>\r\n</td></tr>\r\n</table>'),(3495,198,0.26,'smarty','0','added content.',1111009423,16,'128.187.0.165','{include file=\"layouts/forceLoggedIn.tpl\"}\r\n{assign var=\"pgLayout\" value=\"layouts/withLeftNav.tpl\"}\r\n<h1>{$page.title}</h1>\r\n\r\n<table>\r\n<tr><td valign=\"top\">\r\n	<img src=\"blank.gif\" width=\"1\" height=\"1\" alt=\"\" class=\"iconJoggers\" /> \r\n	<p>Its time to get Active!  Below you will find links that can help you understand ways to get exercise and be safe. Remember, the most difficult hurdle to exercise is time - but you must make time. Check out the \"At the Office\" link for things you can do at work.</p>\r\n	<br />\r\n	<br />\r\n	<blockquote>\r\n	<ul>\r\n	{toc_display start_id=$page.id level_limit=1 hide_start=1}\r\n	{literal}\r\n		<li><a href=\"?pg={$toc_pageName}\">{$toc_title}</a></li>\r\n	{/literal}\r\n	{/toc_display}\r\n		{*\r\n		<li><a href=\"#\">Fitness Tips</a></li>\r\n		<li><a href=\"#\">Excercises</a></li>\r\n		<li><a href=\"#\">At the Office</a></li>\r\n		<li><a href=\"#\">Personal Trainer</a></li>\r\n		<li><a href=\"#\">In Your Company</a></li>\r\n		*}\r\n	</ul>\r\n	</blockquote>\r\n</td><td valign=\"top\" align=\"right\">\r\n	<img src=\"MISC006.jpg\" width=\"1\" height=\"1\" alt=\"\" class=\"\" /><br />\r\n	<a href=\"?pg=my_shop&sub=&tma=VIEW&eids=8\">Buy a Pedometer</a>\r\n</td></tr>\r\n</table>'),(3496,198,0.27,'smarty','0','added content.',1111011738,3,'67.166.75.78','{include file=\"layouts/forceLoggedIn.tpl\"}\r\n{assign var=\"pgLayout\" value=\"layouts/withLeftNav.tpl\"}\r\n<h1>{$page.title}</h1>\r\n\r\n<table>\r\n<tr><td valign=\"top\">\r\n	<img src=\"blank.gif\" width=\"1\" height=\"1\" alt=\"\" class=\"iconJoggers\" /> \r\n	<p>Its time to get Active!  Below you will find links that can help you understand ways to get exercise and be safe. Remember, the most difficult hurdle to exercise is time - but you must make time. Check out the \"At the Office\" link for things you can do at work.</p>\r\n	<br />\r\n	<br />\r\n	<blockquote>\r\n	<ul>\r\n	{toc_display start_id=$page.id level_limit=1 hide_start=1}\r\n	{literal}\r\n		<li><a href=\"?pg={$toc_pageName}\">{$toc_title}</a></li>\r\n	{/literal}\r\n	{/toc_display}\r\n	</ul>\r\n	</blockquote>\r\n</td><td valign=\"top\" align=\"right\">\r\n	<img src=\"{$skinFolder}images/shop/MISC006.jpg\" width=\"1\" height=\"1\" alt=\"\" class=\"\" /><br />\r\n	<a href=\"?pg=my_shop&sub=&tma=VIEW&eids=8\">Buy a Pedometer</a>\r\n</td></tr>\r\n</table>'),(3497,198,0.28,'smarty','0','added content.',1111011767,3,'67.166.75.78','{include file=\"layouts/forceLoggedIn.tpl\"}\r\n{assign var=\"pgLayout\" value=\"layouts/withLeftNav.tpl\"}\r\n<h1>{$page.title}</h1>\r\n\r\n<table>\r\n<tr><td valign=\"top\">\r\n	<img src=\"blank.gif\" width=\"1\" height=\"1\" alt=\"\" class=\"iconJoggers\" /> \r\n	<p>Its time to get Active!  Below you will find links that can help you understand ways to get exercise and be safe. Remember, the most difficult hurdle to exercise is time - but you must make time. Check out the \"At the Office\" link for things you can do at work.</p>\r\n	<br />\r\n	<br />\r\n	<blockquote>\r\n	<ul>\r\n	{toc_display start_id=$page.id level_limit=1 hide_start=1}\r\n	{literal}\r\n		<li><a href=\"?pg={$toc_pageName}\">{$toc_title}</a></li>\r\n	{/literal}\r\n	{/toc_display}\r\n	</ul>\r\n	</blockquote>\r\n</td><td valign=\"top\" align=\"right\">\r\n	<img id=\"pedometerDealImg\" src=\"blank.gif\" width=\"1\" height=\"1\" alt=\"\" border=\"0\" /><br />\r\n	<a href=\"?pg=my_shop&sub=&tma=VIEW&eids=8\">Buy a Pedometer</a>\r\n</td></tr>\r\n</table>'),(3498,102,0.64,'smarty','0','Changed note for',1111012681,16,'128.187.0.165','{assign var=\"pgLayout\" value=\"layouts/default.tpl\"}\r\n{stored_object name=$smarty.session.session_id|truncate:10:\"\" type=\"signup\" from=\"signup\" assign=\"signup\"}\r\n<!-- return:{$smarty.request.signup.return} -->\r\n{if $smarty.request.confirmReset}{stored_object name=$smarty.session.session_id|truncate:10:\"\" type=\"signup\" destroy=\"true\"}{/if}\r\n\r\n<h1 class=\"underline\">Sign Up - Step 2 - Your Profile</h1>\r\n<p>This step includes recording you initial weight and goals. Each field will be used to calculate \r\nother factors including your Body Mass Index. To hide your body weight from others select \'Yes.\' \r\nBy selecting \'Yes\' others will only see your change in weight (i.e. -5 lbs).<br />\r\n<br />\r\n<small> * indicates a required field</small></p>\r\n\r\n{include_php file=\"shared_handle:signup.details\"}\r\n\r\n<div>\r\n\r\n{toc_next assign=\"next\"}\r\n{toc_prev assign=\"prev\"}\r\n<form name=\"signup\" method=\"post\" action=\"index.php\" style=\"margin:0px;\">\r\n<input type=\"hidden\" name=\"pg\" value=\"{$next.pageName}\">\r\n<input type=\"hidden\" name=\"no_expire\" value=\"true\">\r\n\r\n<table cellpadding=\"0\" cellspacing=\"0\" align=\"center\"><tr><td>\r\n\r\n<div class=\"chunk300\" style=\"width:310px;\">\r\n<h2 class=\"withBG\">Personal Profile</h2>\r\n*Date of Birth:\r\n{get_month name=\"signup[dob][month]\"}\r\n{get_day   name=\"signup[dob][day]\"}\r\n{math assign=\"end_year\" equation=\"x - 18\" x=$smarty.now|date_format2:\"Y\"}  {* Minimum age is 18 years for now *}\r\n{get_year  name=\"signup[dob][year]\" start=\"1915\" end=$end_year}<br />\r\n\r\n*Gender: \r\n<input type=\"radio\" name=\"signup[gender]\" value=\"not specified\" checked />Not Specified &nbsp;<input type=\"radio\" name=\"signup[gender]\" value=\"male\" />Male &nbsp; <input type=\"radio\" name=\"signup[gender]\" value=\"female\" />Female &nbsp;<br />\r\n\r\n*Current Weight:\r\n<input type=\"text\" name=\"signup[initialWeight]\" size=\"4\" maxlength=\"3\" class=\"textInput\" style=\"width:25px;\" /><br />\r\n\r\n*Hide Weight From Others?:\r\n<input type=\"radio\" name=\"signup[hideInitialWeight]\" value=\"Yes\"{if $signup[hideInitialWeight] neq \"No\"} checked{/if} /> Yes &nbsp;<input type=\"radio\" name=\"signup[hideInitialWeight]\" value=\"No\"{if $signup[hideInitialWeight] eq \"No\"} checked{/if} /> No &nbsp;<br />\r\n\r\n*Goal Weight:\r\n<input type=\"text\" name=\"signup[goalWeight]\" size=\"4\" maxlength=\"3\" class=\"textInput\" style=\"width:25px;\" /><br />\r\n\r\n*Height:\r\n<input type=\"text\" name=\"signup[height][feet]\" class=\"textInput\" maxlength=\"1\" style=\"width:18px;\" /> feet, \r\n<input type=\"text\" name=\"signup[height][inches]\" class=\"textInput\" maxlength=\"2\" style=\"width:20px;\" /> inches<br />\r\n</div>\r\n\r\n<div class=\"chunk300\">\r\n	<h2 class=\"withBG\">Department and Personal Goal</h2>\r\n        Please enter the name of the department you work in and also your personal goal.  Your department name will be used to put you onto a team.\r\n	<textarea name=\"signup[personalGoal]\" cols=\"30\" rows=\"5\" style=\"width:295px; height:125px;\"></textarea><br />\r\n</div>\r\n\r\n<div class=\"chunk300\">\r\n	<h2 class=\"withBG\">Personal Motto</h2>\r\n        This will show up on your about page, and can be changed often.\r\n	<textarea name=\"signup[personalSaying]\" cols=\"30\" rows=\"5\" style=\"width:295px; height:125px;\"></textarea><br />\r\n</div>\r\n\r\n<div class=\"chunk300\">\r\n	<h2 class=\"withBG\">Your Signature</h2>\r\n        Be creative with your signature! This will go at the bottom of the messages you post on the discussion board and can be changed often.\r\n	<textarea name=\"signup[signature]\" cols=\"30\" rows=\"5\" style=\"width:295px; height:125px;\"></textarea><br />\r\n</div>\r\n</td></tr></table>\r\n\r\n<div class=\"hBox\" align=\"right\">\r\n	<br />\r\n	{if $prev.pageName}<input type=\"image\" src=\"{$skinFolder}images/btn_back.gif\" class=\"btn_image\" onclick=\"pg.value=\'{$prev.pageName}\';\">&nbsp; {/if}\r\n	{if $next.pageName}<input type=\"image\" src=\"{$skinFolder}images/btn_next.gif\" class=\"btn_image\">{/if}\r\n</div>\r\n\r\n{stored_object_fill_form object=$signup name=\"signup\"}\r\n\r\n</form>\r\n</div>'),(3877,202,0.77,'smarty','0','added small gif as heart rate monitor',1118362858,16,'216.194.127.150','{assign var=\"pgLayout\" value=\"layouts/withLeftNav.tpl\"}\r\n\r\n{if $smarty.request.showNewMenu eq \"true\"}\r\n<div class=\"rightSideMenu\">\r\n	<div class=\"rightMenuBox\">\r\n	<h3>EHC News</h3>\r\n		<div class=\"rightMenuItem\">\r\n		<span class=\"floatLeft iconNew\"></span>\r\n		<small><a href=\"#\">Portion Control Article in the nutrition corner. Click here to read</a></small>\r\n		</div>\r\n		<div class=\"rightMenuItem\">\r\n		<small><a href=\"#\">Learn more about carbohydrates and how they affect your body.</a></small>\r\n		</div>	\r\n	</div>\r\n	<div class=\"rightMenuBox\">\r\n	<h3>Product Highlight</h3>\r\n		<div class=\"rightMenuItem\">\r\n		<img src=\"{$skinFolder}images/rypHeartMonitor.jpg\" align=\"right\" class=\"img1\" alt=\"\" height=\"13.81\" width=\"10.84\" /><br />\r\n		<small><a href=\"#\">Heart Rate Monitors can help improve your exercise, click here to learn more.</a></small>\r\n		</div>\r\n	</div>\r\n	<div class=\"rightMenuBox\">\r\n	<h3>To Do List:</h3>\r\n		<div class=\"rightMenuItem\">\r\n		<small><a href=\"#\">Update your progress</a><br />\r\n		<a href=\"#\">Earn more incentive points</a><br />\r\n		<a href=\"#\">Check out the competition</a><br />\r\n		<a href=\"#\">Read New Articles</a></small>\r\n		</div>\r\n	</div>\r\n</div>\r\n{/if}\r\n\r\n{if $user->isLoggedIn()}\r\n	<img src=\"{$skinFolder}images/ehc/corporateBuilding_sm.jpg\" width=\"100\" height=\"131\" style=\"margin-right:10px; float:left; border:#CCC 1px solid;\" />\r\n\r\n	{include_php file=\"shared_handle:company/announcements\"}\r\n	<h2 class=\"uline\">Company Announcements:</h2>\r\n\r\n	<blockquote>\r\n		<dl>\r\n		{foreach from=$announcements item=\"current\"}\r\n			<dt><div style=\"float:right;\"><small><i>{$current.postedDate|date_format2:\"D, M j\"}</i></small></div>\r\n			    {$current.title}</dt>\r\n			<dd>{$current.description}</dd>\r\n		{foreachelse}\r\n			<dt>No announcements at this time</dt>\r\n		{/foreach}\r\n		</dl>\r\n	</blockquote>\r\n\r\n	{include_php file=\"shared_handle:company/companySurveyList\"}\r\n	<h2 class=\"uline\">Company Surveys:</h2>\r\n	<blockquote>\r\n	<table>\r\n	<tr><td colspan=\"2\">\r\n		<h3>Available Surveys:</h3></td>\r\n	    <td valign=\"middle\"></td></tr>\r\n	{foreach from=$surveys item=item name=\"loopSurveys\"}<tr><td nowrap>\r\n	<tr><td valign=\"top\" nowrap=\"nowrap\">\r\n		{if $item.dateAvailable gt 0}\r\n			<img class=\"icoSurvey\" src=\"blank.gif\" width=\"1\" height=\"1\" alt=\"\" border=\"0\" /></td>\r\n		   <td valign=\"top\"><b><u>{$item.surveyName}</u>:</b> {if $item.frequency eq \"Once\"}Taken{elseif (($item.dateAvailable - $smarty.now) < 43000)}<small>Available At:</small> {$item.dateAvailable|date_format2:\"g:i A\"}{else}<small>Available On:</small> {$item.dateAvailable|date_format2:\"m/d/y\"}{/if}<br />\r\n			{$item.feedbackTitle|default:\"No feedback available.\"}<br />\r\n			<a href=\"?pg=my_feedback&surveyId={$item.id}&amp;feedbackId={$item.feedbackId}\">Click here to learn more<b><i>!</i></b></a><br />\r\n			<br /></td>\r\n		   <td valign=\"middle\" align=\"right\"><em>{$item.pointsEarned}</em></td></tr>\r\n		{else}\r\n			<a href=\"javascript://\" onclick=\"openSurvey({$item.id});\"><img class=\"icoSurvey\" src=\"blank.gif\" width=\"1\" height=\"1\" alt=\"\" border=\"0\" /></a></td>\r\n		   <td valign=\"top\" nowrap=\"nowrap\"><b><u>{$item.surveyName}</u>:</b> <a href=\"javascript://\" onclick=\"openSurvey({$item.id});\">Available Now</a><br />\r\n			{$item.feedbackTitle|default:\"No feedback available.\"}<br />\r\n			<a href=\"?pg=my_feedback&surveyId={$item.id}&amp;feedbackId={$item.feedbackId}\">Click here to learn more<b><i>!</i></b></a><br />\r\n			<br /></td>\r\n		   <td valign=\"middle\" align=\"right\"><em>{$item.pointsEarned}</em></td></tr>\r\n		{/if}\r\n	{foreachelse}\r\n	<tr><td valign=\"top\" colspan=\"3\">\r\n		None found.</td></tr>\r\n	{/foreach}\r\n	</table>\r\n	</blockquote>\r\n\r\n	<h2 class=\"uline\">eHealthCompete Highlights:</h2>\r\n	\r\n	<table>\r\n	<tr><td valign=\"middle\">\r\n	<blockquote>\r\n	<dl>	\r\n		<dt>Pedometer Deal</dt>\r\n		<dd>eHealthCompete has just negotiated a great deal on RYP Pedometers.  If you have been looking to purchase a pedometer the eHealthCompete price and quality could be your best bet.  This deal is only available to members of EHC.</dd>\r\n		\r\n	</dl>\r\n	</blockquote></td>\r\n	<td valign=\"top\" align=\"center\">\r\n		<a href=\"?pg=my_shop&sub=&tma=VIEW&eids=9\">\r\n		<img id=\"pedometerDealImg\" src=\"blank.gif\" width=\"1\" height=\"1\" alt=\"\" border=\"0\" /><br />\r\n		Buy one now</a>\r\n	</td></tr></table>\r\n{else}\r\n	{assign var=\"hideLogin\" value=\"true\"}\r\n		<script language=\"JavaScript\">{literal}\r\n			function doForgotPassword(boxId, formName) {\r\n				if (!formName) formName = \'loginForm\';\r\n				if (!boxId) boxId = \'usernameBox\';\r\n\r\n				var df = document.forms[formName];\r\n				var obj = document.getElementById(boxId);\r\n		\r\n				if (obj.value == \'\') {\r\n					obj.value = prompt(\'Enter your username:\', \'\');\r\n				}\r\n				\r\n\r\n				df.forgotPassword.value = \'true\';\r\n				df.submit();	\r\n			}\r\n\r\n		{/literal}</script>\r\n	<table align=\"center\" width=\"305\" cellpadding=\"0\" cellspacing=\"0\">\r\n	<tr><td align=\"center\">\r\n		<h2>{$smarty.session.company.companyName}</h2>\r\n	</td></tr>\r\n	<tr><td>\r\n		<div align=\"center\" class=\"chunk300\">\r\n			<form name=\"loginForm2\" method=\"post\" action=\"index.php\" style=\"margin:3px;\">\r\n			<input type=\"hidden\" name=\"pg\" value=\"my_login\" />\r\n			<input type=\"hidden\" name=\"return\" value=\"{$smarty.request.return|default:$signup.return|default:\"home\"}\" />\r\n			<input type=\"hidden\" name=\"no_expire\" value=\"true\" />\r\n			<input type=\"hidden\" name=\"forgotPassword\" value=\"\" />\r\n		\r\n			<h2 class=\"withBG\">Log In:</h2>\r\n				Username: <input id=\"usernameBox2\" type=\"text\" name=\"username\" value=\"{$smarty.request.username}\" class=\"textInput\" size=\"12\" /><br />\r\n				Password: <input type=\"password\" name=\"password\" class=\"textInput\" size=\"12\" /><br />\r\n				<div class=\"underline\">&nbsp;</div>\r\n				<a href=\"javascript:document.forms[\'loginForm2\'].submit();\">Submit</a> | <a href=\"javascript:doForgotPassword(\'usernameBox2\', \'loginForm2\');\">Forgot Password?</a>\r\n				<input type=\"submit\" name=\"loginSubmit\" value=\"Submit\" style=\"position:absolute; top:-300px; left:-300px;\" />\r\n			</form>\r\n			<script language=\"javascript\">\r\n				document.forms.loginForm2.username.focus();\r\n			</script>\r\n		</div>\r\n	</td></tr>\r\n	<tr><td align=\"right\">\r\n		<br />\r\n		{if $smarty.session.company.companyName}\r\n			<small>Not registered yet?</small> <a href=\"?pg=signup/begin\">Sign Up Now!</a> &nbsp;\r\n		{else}\r\n			<!-- Place holder for sign up info content. -->\r\n		{/if}\r\n	</td></tr>\r\n	</table>\r\n{/if}'),(3500,220,0.23,'smarty','0','added content',1111076205,16,'128.187.244.57','{assign var=\"pgLayout\" value=\"layouts/withLeftNav.tpl\"}\r\n\r\n<h1>{$page.title}</h1>\r\n\r\n<img src=\"{$skinFolder}images/doctorClipboard.jpg\" align=\"right\" alt=\"\" class=\"img1\" hspace=\"20\" vspace=\"20\"/><br />\r\n\r\n\r\n<p>Health Care providers have used health risk assessments (HRA) for over 20 years to educate patients on potential health risks that are related to lifestyle and family history. </p>\r\n<p>Our online HRA asks a series of questions that will help determine each individual’s health risk. The questions fall into the following categories: Behaviors that have an effect on health, Family medical history and current health status. </p>\r\n<p>Once the HRA has been completed the answers are used to calculate individual risk using studies from well-recognized organizations. </p> \r\n<p><b>Benefits to HRA’s include:</b> possibility to discover health risk factors that an individual might not have known about; Alerting individuals to aspects of their health that may need more attention; Potential to avoid more serious health complications; Allowing management to determine what types of programs need to be implemented to help improve employee health. </p>\r\n<ul>\r\n<li>Score 100 – 85: Low Risk Level</li>\r\n<li>Score 84 – 75: Medium Risk Level</li>\r\n<li>Score 74 - 0: High Risk Level</li>\r\n</ul>\r\n\r\n\r\n\r\n<p> Below you will find answers to commonly asked questions about health. Many of the questions on the HRA are found below.</p>\r\n\r\n\r\n\r\n</p><p><b>Q.  What is a healthy blood pressure? \r\n</p><p>A.</b>  According to national guidelines, normal blood pressure is below 120/80 mmHg. Blood pressure above 140/90 mmHg is diagnosed as hypertension, or high blood pressure. Someone with hypertension is at higher risk of having strokes, heart attacks and kidney failure.\r\n\r\n</p><p><b>Q.  How can I lower blood pressure besides medication?\r\n</p><p>A.</b>  Hypertension can be treated through increased exercise and a better diet. Many recent studies have shown that regular aerobic exercise (workouts like brisk walking that use large muscles for an extended period) over several months may modestly lower blood pressure. According to a recent National Institutes of Health conference, aerobic exercise reduces resting (nonexercise) blood pressure in people who have hypertension by an average of 11 points off the top number and 9 points off the bottom number. That could be enough to lower high blood pressure to normal. Reducing sodium(salt) in your diet can also help to lower blood pressure.\r\n\r\n</p><p><b>Q.  Where should my cholesterol levels be?\r\n</p><p>A. </b> Your TOTAL blood cholesterol will fall into one of these categories:\r\n<ul>\r\n<li>Desirable is Less than 200 mg/dL </li>\r\n<li>Borderline high risk is 200 to 239 mg/dL </li>\r\n<li>High risk is 240 mg/dL and over</li>\r\n</ul>\r\nThere are two types of cholesterol in your body: LDL is bad cholesterol and contributes to artery clogging. You want Low LDL levels (below 100 is optimal). HDL is good cholesterol and helps to clear arterial blockage. You want High HDL levels. (Less than 40 is too low) To lower your LDL and raise your HDL levels you can: \r\n<ul>\r\n<li>Quit Smoking </li>\r\n<li>Lose weight (or maintain a healthy weight) </li>\r\n<li>Be physically active for at least 30 to 60 minutes a day on most or all days of the week. </li>\r\n</ul>\r\n\r\n<p><b>Q.  What does BMI stand for and what is a healthy BMI for me? </b></p>\r\n<p><b>A.</b>  BMI stands for Body Mass Index and is a ratio of weight to height, used to estimate the relationship of body composition to risk factors of certain diseases. Use our calculator to determine what your BMI is and refer to the chart below to see what category you are in.\r\n<ul>\r\n<li>18.5 or less is Under Weight </li>\r\n<li>18.5 to 24.9 is Normal </li>\r\n<li>25.0 to 29.9 is Overweight </li>\r\n<li>30.0 to 34.9 is Level 1 Obese </li>\r\n<li>35.0 to 39.9 is Level 2 Obese </li>\r\n<li>40 or greater is Extreme Obese</li>\r\n</ul>\r\n</p><p><b>Q.  How accurate is the BMI measurement? \r\n</p><p>A.</b>  For the vast majority of average individuals, the BMI is a useful and accurate measurement. The drawback lies in the fact that short, muscular individuals may be falsely labeled as obese, and tall lean individuals as underweight.\r\n\r\n\r\n\r\n</p><p><b>Q.  How much exercise do I need to do to lose weight?\r\n</p><p>A.</b>  This depends on how many calories you are consuming. To lose weight you need to burn more calories than you take in. It takes 3500 calories burned to lose 1 pound. That’s going into a deficit of 1,000 calories a day if you want to lose 2 lbs a week. This can be done by eating 500 calories less than you normally do and burning 500 calories per day more through exercise. That is equivalent to about a 45 minute jog.\r\nExercising 30 to 60 minutes 5 days a week is a good guideline to follow and will not only aid in weight loss but will also reduce your risk for several diseases including heart disease, diabetes and colon cancer.\r\n\r\n\r\n</p><p><b>Q.  What is the best type of exercise to lose body fat?\r\n</p><p>A.</b>  When your body is engaged in aerobic exercise, it utilizes fat as its fuel. So if your goal is to lose body fat, your main modes of exercise should be walking, jogging, biking or swimming in your target heart rate zone.\r\n\r\n\r\n</p><p><b>Q.  How can I know what my body fat percentage is?\r\n</p><p>A.</b>  There are several different methods used to determine body fat percentage. Hydrostatic or underwater weighing is probably the most accurate and widely used. There are other methods and devices including the DEXA machine, the Bod Pod, Tanita scales, hand held devices and Skin Calipers. The key is to use the same method consistently so that you can see the change in your body fat percentage. \r\n\r\n</p><p><b>Q.  What is heart disease and how does exercise and nutrition affect my risks?\r\n</p><p>A.</b>  Heart disease occurs because of inadequate blood flow to the heart muscle. This occurs when the arteries that supply the heart muscle (the coronary arteries) become partially or completely blocked. Obese people are at increased risk of heart disease due to their higher rates of hypercholesterolemia, diabetes and hypertension. Several studies have proven the beneficial effects of exercise on heart diseases. Not only will it reduce body fat, but it will also help to lower blood cholesterol, blood pressure and regulate glucose metabolism. Eating a diet high low in saturated fat and cholesterol and high in dietary fiber will lower your risk for heart disease.\r\n\r\n</p><p><b>Q.  What is the Target Heart Rate zone? \r\n</p><p>A.</b>  The Target Heart Rate zone refers to the range that you want your heart rate to be in while you are doing aerobic exercise. This is the best zone to be in to burn body fat. Calculate your target heart rate zone using our calculator.\r\n\r\n\r\n</p><p><b>Q.  Do I really need to lift weights?\r\n</p><p>A.</b>  There are many benefits to strength training including:\r\n<ul>\r\n<li>Higher metabolism</li>\r\n<li>Stronger bones</li>\r\n<li>Increased muscle strength and endurance</li>\r\n<li>Increased balance, flexibility and stability</li>\r\n<li>Decreased risk of coronary heart disease</li>\r\n<li>Injury prevention</li>\r\n<li>Feel and look better</li>\r\n<li>Strength training will help you with weight loss because the more muscle you have the more calories you burn at rest.</li>\r\n</ul>\r\n\r\n</p><p><b>Q.  What if I just don\'t have time to exercise?\r\n<p>A.</b>  We all have busy schedules and the trick with exercising is plan, plan, plan. Schedule it in before your busy week begins. Make it a priority. Set aside time one day a week to plan when, where and for how long you will exercise. It may require getting up half hour earlier, or taking a little longer lunch break. If there is absolutely no time in your schedule for a formal exercise session you can do little tricks like parking farther away at the store, not taking the elevator, etc. Every little bit helps.\r\n\r\n\r\n</p><p><b>Q.  If I am overweight or obese, what diseases am I at risk for?\r\n</p><p>A.</b>  Obesity places you at risk for several diseases including heart disease, diabetes, some forms of cancer, sleep apnea, abdominal hernias, varicose veins, gout, gall bladder disease, respiratory problems, and liver malfunction. Losing just 10% of your body weight will significantly lower your risk for these diseases.\r\n</p>\r\n'),(3501,1,2.95,'smarty','1','Temporary fix to send ABC corp to new my_home',1111111699,3,'24.10.217.227','{if $user->isLoggedIn()}\r\n	{store_messages}\r\n	{* TEMPORARY FIX *}\r\n	{* if $smarty.session.company.companyVanity eq \"abc\" *}\r\n		{redirect href=\"?pg=my_home\"}\r\n	{* else}	\r\n		{redirect href=\"?pg=myhome\"}\r\n	{/if *}\r\n{elseif $smarty.session.company.companyName}\r\n	{store_messages}\r\n	{redirect href=\"?pg=my_login\"}\r\n{/if}\r\n{if not $errors|@count}\r\n	{assign var=\"pgLayout\" value=\"file:./layouts/home.tpl\"}\r\n{/if}'),(3879,202,0.79,'smarty','0','added small gif as heart rate monitor',1118363291,16,'216.194.127.150','{assign var=\"pgLayout\" value=\"layouts/withLeftNav.tpl\"}\r\n\r\n{if $smarty.request.showNewMenu eq \"true\"}\r\n<div class=\"rightSideMenu\">\r\n	<div class=\"rightMenuBox\">\r\n	<h3>EHC News</h3>\r\n		<div class=\"rightMenuItem\">\r\n		<span class=\"floatLeft iconNew\"></span>\r\n		<small><a href=\"#\">Portion Control Article in the nutrition corner. Click here to read</a></small>\r\n		</div>\r\n		<div class=\"rightMenuItem\">\r\n		<small><a href=\"#\">Learn more about carbohydrates and how they affect your body.</a></small>\r\n		</div>	\r\n	</div>\r\n	<div class=\"rightMenuBox\">\r\n	<h3>Product Highlight</h3>\r\n		<div class=\"rightMenuItem\">\r\n		<img src=\"{$skinFolder}images/rypHeartMonitor_small.jpg\" align=\"right\" class=\"img1\" alt=\"\" /><br />\r\n		<small><a href=\"#\">Heart Rate Monitors can help improve your exercise, click here to learn more.</a></small>\r\n		</div>\r\n	</div>\r\n	<div class=\"rightMenuBox\">\r\n	<h3>To Do List:</h3>\r\n		<div class=\"rightMenuItem\">\r\n		<small><a href=\"#\">Update your progress</a><br />\r\n		<a href=\"#\">Earn more incentive points</a><br />\r\n		<a href=\"#\">Check out the competition</a><br />\r\n		<a href=\"#\">Read New Articles</a></small>\r\n		</div>\r\n	</div>\r\n</div>\r\n{/if}\r\n\r\n{if $user->isLoggedIn()}\r\n	<img src=\"{$skinFolder}images/ehc/corporateBuilding_sm.jpg\" width=\"100\" height=\"131\" style=\"margin-right:10px; float:left; border:#CCC 1px solid;\" />\r\n\r\n	{include_php file=\"shared_handle:company/announcements\"}\r\n	<h2 class=\"uline\">Company Announcements:</h2>\r\n\r\n	<blockquote>\r\n		<dl>\r\n		{foreach from=$announcements item=\"current\"}\r\n			<dt><div style=\"float:right;\"><small><i>{$current.postedDate|date_format2:\"D, M j\"}</i></small></div>\r\n			    {$current.title}</dt>\r\n			<dd>{$current.description}</dd>\r\n		{foreachelse}\r\n			<dt>No announcements at this time</dt>\r\n		{/foreach}\r\n		</dl>\r\n	</blockquote>\r\n\r\n	{include_php file=\"shared_handle:company/companySurveyList\"}\r\n	<h2 class=\"uline\">Company Surveys:</h2>\r\n	<blockquote>\r\n	<table>\r\n	<tr><td colspan=\"2\">\r\n		<h3>Available Surveys:</h3></td>\r\n	    <td valign=\"middle\"></td></tr>\r\n	{foreach from=$surveys item=item name=\"loopSurveys\"}<tr><td nowrap>\r\n	<tr><td valign=\"top\" nowrap=\"nowrap\">\r\n		{if $item.dateAvailable gt 0}\r\n			<img class=\"icoSurvey\" src=\"blank.gif\" width=\"1\" height=\"1\" alt=\"\" border=\"0\" /></td>\r\n		   <td valign=\"top\"><b><u>{$item.surveyName}</u>:</b> {if $item.frequency eq \"Once\"}Taken{elseif (($item.dateAvailable - $smarty.now) < 43000)}<small>Available At:</small> {$item.dateAvailable|date_format2:\"g:i A\"}{else}<small>Available On:</small> {$item.dateAvailable|date_format2:\"m/d/y\"}{/if}<br />\r\n			{$item.feedbackTitle|default:\"No feedback available.\"}<br />\r\n			<a href=\"?pg=my_feedback&surveyId={$item.id}&amp;feedbackId={$item.feedbackId}\">Click here to learn more<b><i>!</i></b></a><br />\r\n			<br /></td>\r\n		   <td valign=\"middle\" align=\"right\"><em>{$item.pointsEarned}</em></td></tr>\r\n		{else}\r\n			<a href=\"javascript://\" onclick=\"openSurvey({$item.id});\"><img class=\"icoSurvey\" src=\"blank.gif\" width=\"1\" height=\"1\" alt=\"\" border=\"0\" /></a></td>\r\n		   <td valign=\"top\" nowrap=\"nowrap\"><b><u>{$item.surveyName}</u>:</b> <a href=\"javascript://\" onclick=\"openSurvey({$item.id});\">Available Now</a><br />\r\n			{$item.feedbackTitle|default:\"No feedback available.\"}<br />\r\n			<a href=\"?pg=my_feedback&surveyId={$item.id}&amp;feedbackId={$item.feedbackId}\">Click here to learn more<b><i>!</i></b></a><br />\r\n			<br /></td>\r\n		   <td valign=\"middle\" align=\"right\"><em>{$item.pointsEarned}</em></td></tr>\r\n		{/if}\r\n	{foreachelse}\r\n	<tr><td valign=\"top\" colspan=\"3\">\r\n		None found.</td></tr>\r\n	{/foreach}\r\n	</table>\r\n	</blockquote>\r\n\r\n	<h2 class=\"uline\">eHealthCompete Highlights:</h2>\r\n	\r\n	<table>\r\n	<tr><td valign=\"middle\">\r\n	<blockquote>\r\n	<dl>	\r\n		<dt>Pedometer Deal</dt>\r\n		<dd>eHealthCompete has just negotiated a great deal on RYP Pedometers.  If you have been looking to purchase a pedometer the eHealthCompete price and quality could be your best bet.  This deal is only available to members of EHC.</dd>\r\n		\r\n	</dl>\r\n	</blockquote></td>\r\n	<td valign=\"top\" align=\"center\">\r\n		<a href=\"?pg=my_shop&sub=&tma=VIEW&eids=9\">\r\n		<img id=\"pedometerDealImg\" src=\"blank.gif\" width=\"1\" height=\"1\" alt=\"\" border=\"0\" /><br />\r\n		Buy one now</a>\r\n	</td></tr></table>\r\n{else}\r\n	{assign var=\"hideLogin\" value=\"true\"}\r\n		<script language=\"JavaScript\">{literal}\r\n			function doForgotPassword(boxId, formName) {\r\n				if (!formName) formName = \'loginForm\';\r\n				if (!boxId) boxId = \'usernameBox\';\r\n\r\n				var df = document.forms[formName];\r\n				var obj = document.getElementById(boxId);\r\n		\r\n				if (obj.value == \'\') {\r\n					obj.value = prompt(\'Enter your username:\', \'\');\r\n				}\r\n				\r\n\r\n				df.forgotPassword.value = \'true\';\r\n				df.submit();	\r\n			}\r\n\r\n		{/literal}</script>\r\n	<table align=\"center\" width=\"305\" cellpadding=\"0\" cellspacing=\"0\">\r\n	<tr><td align=\"center\">\r\n		<h2>{$smarty.session.company.companyName}</h2>\r\n	</td></tr>\r\n	<tr><td>\r\n		<div align=\"center\" class=\"chunk300\">\r\n			<form name=\"loginForm2\" method=\"post\" action=\"index.php\" style=\"margin:3px;\">\r\n			<input type=\"hidden\" name=\"pg\" value=\"my_login\" />\r\n			<input type=\"hidden\" name=\"return\" value=\"{$smarty.request.return|default:$signup.return|default:\"home\"}\" />\r\n			<input type=\"hidden\" name=\"no_expire\" value=\"true\" />\r\n			<input type=\"hidden\" name=\"forgotPassword\" value=\"\" />\r\n		\r\n			<h2 class=\"withBG\">Log In:</h2>\r\n				Username: <input id=\"usernameBox2\" type=\"text\" name=\"username\" value=\"{$smarty.request.username}\" class=\"textInput\" size=\"12\" /><br />\r\n				Password: <input type=\"password\" name=\"password\" class=\"textInput\" size=\"12\" /><br />\r\n				<div class=\"underline\">&nbsp;</div>\r\n				<a href=\"javascript:document.forms[\'loginForm2\'].submit();\">Submit</a> | <a href=\"javascript:doForgotPassword(\'usernameBox2\', \'loginForm2\');\">Forgot Password?</a>\r\n				<input type=\"submit\" name=\"loginSubmit\" value=\"Submit\" style=\"position:absolute; top:-300px; left:-300px;\" />\r\n			</form>\r\n			<script language=\"javascript\">\r\n				document.forms.loginForm2.username.focus();\r\n			</script>\r\n		</div>\r\n	</td></tr>\r\n	<tr><td align=\"right\">\r\n		<br />\r\n		{if $smarty.session.company.companyName}\r\n			<small>Not registered yet?</small> <a href=\"?pg=signup/begin\">Sign Up Now!</a> &nbsp;\r\n		{else}\r\n			<!-- Place holder for sign up info content. -->\r\n		{/if}\r\n	</td></tr>\r\n	</table>\r\n{/if}'),(3520,195,0.51,'smarty','0','added april fools joke for Chad :)',1112714663,16,'128.187.0.165','\r\n{include file=\"layouts/forceLoggedIn.tpl\"}\r\n{include_php file=\"shared_handle:myHome\"}\r\n{include_php file=\"shared_handle:getProfile\"}\r\n{assign var=\"pgLayout\" value=\"layouts/withLeftNav.tpl\"}\r\n<h1>{$page.title} - {$userProfile.firstName} {$userProfile.lastName} ({$userProfile.username})</h1>\r\n\r\n{select_query return=\"row\" assign=\"aHRA\"}\r\n	dateTaken, pointsEarned FROM surveys_taken\r\n		WHERE userId = {$user->id}\r\n		AND surveyId = 8\r\n		ORDER BY dateTaken DESC\r\n		LIMIT 1\r\n{/select_query}\r\n\r\n<table width=\"700\">\r\n<tr><td width=\"205\" valign=\"top\">\r\n	<div id=\"UserProfileColumn\" class=\"contentColumn\">\r\n	<h2 class=\"withBG\">Your Profile</h2>\r\n		<span class=\"cellHeadLarge\">Age:</span><span class=\"cellSmall\">{$userProfile.age|default:\"-\"}</span><br />\r\n		<span class=\"cellHeadLarge\">Height:</span><span class=\"cellSmall\">{$userProfile.heightFeet|default:\"-\"}\'{$userProfile.heightInches|default:\"-\"}&quot;</span><br />\r\n		<span class=\"cellHeadLarge\">Start BMI:</span><span class=\"cellSmall\">{$userProfile.startBMI|default:\"-\"}</span><br />\r\n		<span class=\"cellHeadLarge\">Start Weight:</span><span class=\"cellSmall\">{$userProfile.initialWeight|default:\"-\"}</span><br /><span class=\"cellHeadLarge\">Goal Weight:</span><span class=\"cellSmall\">{$userProfile.goalWeight|default:\"-\"}</span><br />\r\n		<span class=\"cellHeadLarge\">Current Weight:</span><span class=\"cellSmall\">{$userProfile.currentWeight|default:\"-\"}</span><br />\r\n		<span class=\"cellHeadLarge\">HRA Score:</span><span class=\"cellSmall\">{$aHRA.pointsEarned|default:\"-\"}</span><br />\r\n\r\n		<a href=\"?pg=my_profile\" class=\"link\"><img src=\"{$skinFolder}images/btn_profile.gif\" border=\"0\" alt=\"Update Profile\" vspace=\"10\" /></a><br />\r\n		<a href=\"?pg=my_settings\" class=\"link\"><img src=\"{$skinFolder}images/btn_settings.gif\" border=\"0\" alt=\"Account Settings\" vspace=\"0\" /></a>\r\n	</div>\r\n</td><td valign=\"top\" align=\"center\">\r\n	<div id=\"graphContainer\">\r\n	<iframe name=\"graphwindow\" src=\"?pg=flashgraph-frame&compId={$compData.id}&format=small{* &type=weight&fillPrevious=1&precision=1&totalChange=0&userIds={$userProfile.id} *}\" frameborder=\"0\" width=\"425\" height=\"230\" scrollbars=\"no\"></iframe></div>\r\n	<small>\r\n		<a href=\"?pg=flashgraph-frame&compId={$compData.id}&format=small&userIds={$userProfile.id}&type=weight&fillPrevious=1&precision=1&totalChange=1\" target=\"graphwindow\">Change in Weight</a> |\r\n		<a href=\"?pg=flashgraph-frame&compId={$compData.id}&format=small&userIds={$userProfile.id}&type=weight&fillPrevious=1&precision=1\" target=\"graphwindow\">Weight</a> |\r\n		<a href=\"?pg=flashgraph-frame&compId={$compData.id}&format=small&userIds={$userProfile.id}&type=fat&fillPrevious=0&precision=1\" target=\"graphwindow\">Fat Intake</a> |\r\n		<a href=\"?pg=flashgraph-frame&compId={$compData.id}&format=small&userIds={$userProfile.id}&type=calories&fillPrevious=0&precision=1\" target=\"graphwindow\">Calorie Intake</a> |\r\n		<a href=\"?pg=flashgraph-frame&compId={$compData.id}&format=small&userIds={$userProfile.id}&type=carbs&fillPrevious=0&precision=1\" target=\"graphwindow\">Carb Intake</a><br />\r\n		<a href=\"?pg=flashgraph-frame&compId={$compData.id}&format=small&userIds={$userProfile.id}&type=water&fillPrevious=0&precision=1\" target=\"graphwindow\">Water Intake</a> |\r\n		<a href=\"?pg=flashgraph-frame&compId={$compData.id}&format=small&userIds={$userProfile.id}&type=minutesExercise&fillPrevious=0&precision=1\" target=\"graphwindow\">Exercise Min</a> |\r\n		<a href=\"?pg=flashgraph-frame&compId={$compData.id}&format=small&userIds={$userProfile.id}&type=distanceExercised&fillPrevious=0&precision=1\" target=\"graphwindow\">Distance Exercised</a>\r\n	</small>\r\n</td></tr>\r\n<tr><td colspan=\"2\">\r\n<div id=\"statsContainer\">\r\n	<a name=\"updateStats\"></a>\r\n	<iframe name=\"profileUpdateFrame\" src=\"?pg=myprofile/update&userId={$smarty.request.userId|default:$userProfile.id}\" frameborder=\"0\" width=\"700\" height=\"440\" scrollbars=\"no\"></iframe>\r\n</div>\r\n<blockquote>\r\n<dl>\r\n	<dt>Motto:</dt>\r\n	<dd>{$userProfile.personalSaying|default:\"- Not Set - Click on the <i><b>Update my Profile</b></i> button toward the top of this page to set your goal\"}</dd>\r\n	<dt>Nutrition Goal:</dt>\r\n	<dd>{$userProfile.nutritionGoal|default:\"- Not Set - Click on the <i><b>Update my Profile</b></i> button toward the top of this page to set your goal\"}</dd>\r\n	<dt>Fitness Goal:</dt>\r\n	<dd>{$userProfile.fitnessGoal|default:\"- Not Set - Click on the <i><b>Update my Profile</b></i> button toward the top of this page to set your goal\"}</dd>\r\n	<dt>Lifestyle Goal:</dt>\r\n	<dd>{$userProfile.lifestyleGoal|default:\"- Not Set - Click on the <i><b>Update my Profile</b></i> button toward the top of this page to set your goal\"}</dd>\r\n</dl>\r\n</blockquote>\r\n</td></tr>\r\n</table>'),(3523,224,0.12,'smarty','0','Page created.',1112831368,3,'67.166.75.78','{assign var=\"pgLayout\" value=\"layouts/withLeftNav.tpl\"}\r\n<h1>Consumer Tools</h1>\r\n\r\n<p>Coming soon.</p>'),(3524,224,0.13,'smarty','0','Page created.',1112831834,3,'67.166.75.78','{assign var=\"pgLayout\" value=\"layouts/withLeftNav.tpl\"}\r\n<h1>Consumer Tools</h1>\r\n\r\n{include_php file=\"shared_handle:company/listForums\"}\r\n<p>Coming soon.</p>\r\n\r\n{display var=$companyForums}'),(3525,224,0.14,'smarty','0','Page created.',1112831916,3,'67.166.75.78','{assign var=\"pgLayout\" value=\"layouts/withLeftNav.tpl\"}\r\n<h1>Consumer Tools</h1>\r\n\r\n{include_php file=\"shared_handle:company/listForums\"}\r\n<p>Coming soon.</p>\r\n\r\n{display var=$companyForums}\r\n\r\n?'),(3526,224,0.15,'smarty','0','Page created.',1112831979,3,'67.166.75.78','{assign var=\"pgLayout\" value=\"layouts/withLeftNav.tpl\"}\r\n<h1>Consumer Tools</h1>\r\n\r\n{include_php file=\"shared_handle:company/forumsList\"}\r\n<p>Coming soon.</p>\r\n\r\n{display var=$companyForums}\r\n\r\n?'),(3527,224,0.16,'smarty','0','Page created.',1112832151,3,'67.166.75.78','{assign var=\"pgLayout\" value=\"layouts/withLeftNav.tpl\"}\r\n<h1>Consumer Tools</h1>\r\n{include_php file=\"shared_handle:company/forumsList\"}\r\n<p>Coming soon.</p>\r\n\r\n<h3>Company Forums:</h3>\r\n<ul>\r\n{foreach loop=$companyForums item=\"cForum\"}\r\n<li><a href=\"?pg=company_forum&fId={$cForum.id}\">{$cForum.name}</a></li>\r\n{/foreach}\r\n</ul>'),(3528,224,0.17,'smarty','0','Page created.',1112832167,3,'67.166.75.78','{assign var=\"pgLayout\" value=\"layouts/withLeftNav.tpl\"}\r\n<h1>Consumer Tools</h1>\r\n{include_php file=\"shared_handle:company/forumsList\"}\r\n<p>Coming soon.</p>\r\n\r\n<h3>Company Forums:</h3>\r\n<ul>\r\n{foreach from=$companyForums item=\"cForum\"}\r\n<li><a href=\"?pg=company_forum&fId={$cForum.id}\">{$cForum.name}</a></li>\r\n{/foreach}\r\n</ul>'),(3503,98,1.95,'smarty','0','Made default graph the select image.',1111125689,3,'24.10.217.227','{redirect href=\"?pg=my_home\"}\r\n\r\n{assign var=\"pgLayout\" value=\"layouts/myhome_layout2.tpl\"}\r\n{include_php file=\"shared_handle:acceptRejectRequests\"} \r\n{include_php file=\"shared_handle:myHome\"}\r\n\r\n{assign var=\"hideUserBox\" value=\"false\"}\r\n{assign var=\"showCompanyNews\" value=\"true\"}\r\n{assign var=\"hideWLWLinks\" value=\"true\"}\r\n{assign var=\"hideWidgets\" value=\"true\"}\r\n\r\n{* getProfile is included by getStats *}\r\n{* include_php file=\"shared_handle:getStats\" *}\r\n\r\n{* Now getting only Profile because getStats does TONS of unneccesary processing *}\r\n{include_php file=\"shared_handle:getProfile\"}\r\n\r\n{if $smarty.request.debug}\r\n	{display var=$competitions}\r\n{/if}\r\n\r\n<h1 class=\"underline\">My Home - {$userProfile.firstName} {$userProfile.lastName} ({$userProfile.username})</h1>\r\n<br />\r\n\r\n{$user->firstName}, this is your personal Wellness &quot;Home&quot;.\r\nFrom this page you can manage the competitions you are in, and update your wellness profile. \r\nClick on the \'Update Profile\' button to change your Motto, and other information about yourself, or \'Account Settings\' to change your password.<br />\r\n<br />\r\n<script language=\"javascript\">{literal}\r\nfunction goNewGraph() {\r\n	var obj = document.getElementById(\'graphDropdown\');\r\n	var url;\r\n\r\n	for (var x = 0; x < obj.options.length; x++) {\r\n		if (obj.options[x].selected)\r\n			url = obj.options[x].value;\r\n	}\r\n\r\n	graphwindow.location.replace(url);\r\n\r\n	obj.selectedIndex = 0;\r\n}{/literal}\r\n</script>\r\n\r\n<table border=\"0\">\r\n<tr>\r\n	<td valign=\"top\">\r\n		<div id=\"UserProfileColumn\" class=\"contentColumn\">\r\n			<h2 class=\"withBG\">Your Profile</h2>\r\n			<span class=\"cellHeadLarge\">Age:</span><span class=\"cellSmall\">{$userProfile.age}</span><br />\r\n			<span class=\"cellHeadLarge\">Start Weight:</span><span class=\"cellSmall\">{$userProfile.initialWeight}</span><br />\r\n			<span class=\"cellHeadLarge\">Height:</span><span class=\"cellSmall\">{$userProfile.heightFeet}\'{$userProfile.heightInches}&quot;</span><br />\r\n			<span class=\"cellHeadLarge\">Start BMI:</span><span class=\"cellSmall\">{$userProfile.startBMI}</span><br />\r\n			<span class=\"cellHeadLarge\">Goal Weight:</span><span class=\"cellSmall\">{$userProfile.goalWeight}</span><br />\r\n		<br />\r\n                {* <form name=\"notUsed\" style=\"margin:0px;\">\r\n		<select id=\"graphDropdown\" onchange=\"goNewGraph();\">\r\n			<option value=\"\">(Change Graph)</option>\r\n			<option value=\"?pg=flashgraph-frame&compId={$compData.id}&format=small&userIds={$userProfile.id}&type=weight&fillPrevious=1&precision=0&totalChange=1\">Change in Weight</option>\r\n			<option value=\"?pg=flashgraph-frame&compId={$compData.id}&format=small&userIds={$userProfile.id}&type=weight&fillPrevious=1&precision=0\" target=\"graphwindow\">Weight</option>\r\n			<option value=\"?pg=flashgraph-frame&compId={$compData.id}&format=small&userIds={$userProfile.id}&type=fat&fillPrevious=0&precision=1\" target=\"graphwindow\">Fat Intake</option>\r\n			<option value=\"?pg=flashgraph-frame&compId={$compData.id}&format=small&userIds={$userProfile.id}&type=calories&fillPrevious=0&precision=1\" target=\"graphwindow\">Calorie Intake</option>\r\n			<option value=\"?pg=flashgraph-frame&compId={$compData.id}&format=small&userIds={$userProfile.id}&type=carbs&fillPrevious=0&precision=1\" target=\"graphwindow\">Carb Intake</option>\r\n			<option value=\"?pg=flashgraph-frame&compId={$compData.id}&format=small&userIds={$userProfile.id}&type=minutesExercise&fillPrevious=0&precision=1\" target=\"graphwindow\">Exercise Min</option>\r\n			<option value=\"?pg=flashgraph-frame&compId={$compData.id}&format=small&userIds={$userProfile.id}&type=distanceExercised&fillPrevious=0&precision=1\" target=\"graphwindow\">Distance Exercised</option>\r\n		</select>\r\n		</form> *}\r\n		<h2 class=\"withBG\">Links</h2>\r\n		<small>\r\n		&nbsp;&middot; <a href=\"?pg=tips\">Weight Loss Tips</a><br /> \r\n		&nbsp;&middot; <a href=\"?pg=calculators\">Calculators</a><br />\r\n		&nbsp;&middot; <a href=\"?pg=recipes\">Recipes</a><br />\r\n		&nbsp;&middot; <a href=\"?pg=nutrition\">Nutrition Data</a><br />\r\n		&nbsp;&middot; <a href=\"?pg=ptinfo\">Customized Fitness Plan</a><br />\r\n		&nbsp;&middot; <a href=\"?pg=dietitianinfo\">Personal Nutrition Coach</a><br />\r\n		</small>\r\n                </div>\r\n               	</td>\r\n	<td align=\"center\">\r\n		<div style=\"margin:0px 10px;padding:5px;background-color:#FFF;border:#999 1px solid;\">\r\n		<iframe name=\"graphwindow\" src=\"?pg=flashgraph-frame&compId={$compData.id}&format=small{* &type=weight&fillPrevious=1&precision=1&totalChange=0&userIds={$userProfile.id} *}\" frameborder=\"0\" width=\"425\" height=\"230\" scrollbars=\"no\"></iframe></div>\r\n		<small>\r\n			<a href=\"?pg=flashgraph-frame&compId={$compData.id}&format=small&userIds={$userProfile.id}&type=weight&fillPrevious=1&precision=1&totalChange=1\" target=\"graphwindow\">Change in Weight</a> |\r\n			<a href=\"?pg=flashgraph-frame&compId={$compData.id}&format=small&userIds={$userProfile.id}&type=weight&fillPrevious=1&precision=1\" target=\"graphwindow\">Weight</a> |\r\n			<a href=\"?pg=flashgraph-frame&compId={$compData.id}&format=small&userIds={$userProfile.id}&type=fat&fillPrevious=0&precision=1\" target=\"graphwindow\">Fat Intake</a> |\r\n			<a href=\"?pg=flashgraph-frame&compId={$compData.id}&format=small&userIds={$userProfile.id}&type=calories&fillPrevious=0&precision=1\" target=\"graphwindow\">Calorie Intake</a> |\r\n			<a href=\"?pg=flashgraph-frame&compId={$compData.id}&format=small&userIds={$userProfile.id}&type=carbs&fillPrevious=0&precision=1\" target=\"graphwindow\">Carb Intake</a><br />\r\n			<a href=\"?pg=flashgraph-frame&compId={$compData.id}&format=small&userIds={$userProfile.id}&type=water&fillPrevious=0&precision=1\" target=\"graphwindow\">Water Intake</a> |\r\n			<a href=\"?pg=flashgraph-frame&compId={$compData.id}&format=small&userIds={$userProfile.id}&type=minutesExercise&fillPrevious=0&precision=1\" target=\"graphwindow\">Exercise Min</a> |\r\n			<a href=\"?pg=flashgraph-frame&compId={$compData.id}&format=small&userIds={$userProfile.id}&type=distanceExercised&fillPrevious=0&precision=1\" target=\"graphwindow\">Distance Exercised</a>\r\n		</small>\r\n</td>\r\n	<td valign=\"top\" width=\"100%\" style=\"padding:5px;background-color:#FFF;border:#999 1px solid;\">\r\n		<h2><i>\"{$userProfile.personalSaying|default:\"Your personal motto goes here.\"|replace:\'\"\':\'\'}\"</i></h2>\r\n		</td>\r\n</tr>\r\n</table>\r\n<br />\r\n{if $smarty.request.hideComps neq \"1\"}\r\n<table width=\"100%\"><tr><td valign=\"top\">\r\n{* ********************************* COMPETITIONS I AM IN ********************************** *}\r\n<h2 class=\"withBG\">\r\n	<div class=\"topRight hideShow\">\r\n		<a href=\"javascript:toggle(\'inComps\', \'\', \'showHide\');\"><img id=\"inComps_img\" src=\"./img/blank.gif\" class=\"showHide_on\" alt=\"show/hide\" border=\"0\" /></a></div> \r\n	Competitions I Am In</h2>\r\nHere are the competitions you have signed up to participate in. If you have an ID of a competition you would like to join, enter it below.<br />\r\n<div id=\"inComps\" style=\"display:block;\">	\r\n	<div style=\"margin:10px;padding:5px;background-color:#FFF;border:#999 1px solid;\">\r\n	<table cellspacing=\"0\" cellpadding=\"1\" align=\"center\">\r\n	<tr>\r\n		<td class=\"underline2\"><span>&nbsp;<b>ID</b></span></td>\r\n		<td class=\"underline2\"><span>&nbsp;<b>Title</b></span></td>\r\n		{*\r\n		<td class=\"underline2\"><span>&nbsp;<b>Type</b></span></td>\r\n		*}\r\n		<td class=\"underline2\"><span>&nbsp;<b>Style</b></span></td>\r\n		{* <td class=\"underline2\"><span>&nbsp;<b>Rank</b></span></td> *}\r\n		{* <td class=\"underline2\" nowrap><span>&nbsp;<b>Time Remaining</b></span></td> *}\r\n		<td class=\"underline2\" nowrap><span>&nbsp;<b>Ends</b></span></td>\r\n		{* <td class=\"underline2\" nowrap><span>&nbsp;<b>Prize</b></span></td> *}\r\n	</tr>\r\n	{* Set up the warning period... 7 days from now (604800 = 7 days in seconds) *}\r\n	{math assign=\"endsSoon\" equation=\"x + y\" x=$smarty.now y=\"604800\"}\r\n	{foreach from=$competitions item=\"comp\"}\r\n	<tr>\r\n		<td nowrap=\"nowrap\"><span><small>&nbsp;<a href=\"?pg=competition&cid={$comp.id}\">{$comp.id}</a> &nbsp;</small></span></td>\r\n		<td nowrap=\"nowrap\"><span><small>&nbsp;<a href=\"?pg=competition&cid={$comp.id}\">{$comp.title|truncate:35:\"...\"}</a> &nbsp;</small></span></td>\r\n		{*\r\n		<td nowrap=\"nowrap\"><span><small>&nbsp;{$comp.type|niceText}</small> &nbsp;</span></td>\r\n		*}\r\n		<td nowrap=\"nowrap\"><span><small>&nbsp;{if $comp.style eq \"Group-vs-Group\"}Team{else}Individual{/if}</small> &nbsp;</span></td>\r\n		{* <td nowrap=\"nowrap\"><span><small>&nbsp;{if $comp.rank ne \"N/A\"}{$comp.rank}/{$comp.rankOutOf}{else}N/A{/if}</small> &nbsp;</span></td> *}\r\n		{* <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> *}\r\n		<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>\r\n		{* <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> *}\r\n	</tr>\r\n	{foreachelse}\r\n	<tr>\r\n		<td colspan=\"6\"><span><small>You have not joined any competitions.</small></span></td>\r\n	</tr>\r\n	{/foreach}\r\n	</table>\r\n	</div>\r\n	<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>\r\n\r\n	<div style=\"text-align:right;\">\r\n	<form name=\"joinCompForm\" method=\"post\" style=\"margin:4px;\">\r\n		<input type=\"hidden\" name=\"pg\" value=\"competition/join\" />\r\n		<input type=\"hidden\" name=\"no_expire\" value=\"true\" />\r\n		<b>Competition ID#</b> <input type=\"text\" class=\"textInput\" name=\"cid\"> <a href=\"javascript:document.joinCompForm.submit();\" class=\"button\">Join</a><br />\r\n	</form>\r\n	-<i>or</i>- see a list of all <a href=\"?pg=availableCompetitions\">Available Competitions</a>!\r\n	</div>\r\n</div>\r\n</td><td valign=\"top\" style=\"margin-left:10px;\">\r\n{* ********************************* COMPETITIONS I HAVE STARTED ********************************** *}\r\n{if $user->inGroupName(\'coordinators\')}\r\n<form name=\"requestsForm\" action=\"index.php\" method=\"post\" style=\"margin:0px;\">\r\n<input type=\"hidden\" name=\"pg\" value=\"{$page.name}\">\r\n<input type=\"hidden\" name=\"no_expire\" value=\"true\">\r\n<input type=\"hidden\" name=\"acceptReject\" value=\"\">\r\n\r\n<h2 class=\"withBG\">\r\n	<div class=\"topRight hideShow\">\r\n		<a href=\"javascript:toggle(\'myComps\', \'\', \'showHide\');\"><img id=\"myComps_img\" src=\"./img/blank.gif\" class=\"showHide_on\" alt=\"show/hide\" border=\"0\" /></a></div> \r\n	Competitions I Have Started</h2>\r\n\r\n<div id=\"myComps\" style=\"display:block;\">\r\n{if $myCompetitions|@count gt 0}\r\n	<div style=\"margin:0px;padding:5px;background-color:#FFF;border:#999 1px solid;\">\r\n	<table cellspacing=\"0\" cellpadding=\"1\" align=\"center\">\r\n	<tr>\r\n		<td class=\"underline2\" nowrap><span>&nbsp;<b>ID</b> &nbsp;</span></td>\r\n		<td class=\"underline2\" nowrap><span>&nbsp;<b>Title</b> &nbsp;</span></td>\r\n		<td class=\"underline2\" nowrap><span>&nbsp;<b>Type</b> &nbsp;</span></td>\r\n		<td class=\"underline2\" nowrap><span>&nbsp;<b>People wanting to join</b> &nbsp;</span></td>\r\n	</tr>\r\n	{foreach from=$myCompetitions item=\"comp\"}\r\n	<tr>\r\n		<td valign=\"top\"><span>&nbsp;<small><a href=\"?pg=competition&cid={$comp.id}\">{$comp.id}</a></small></span></td>\r\n		<td valign=\"top\" nowrap=\"nowrap\" style=\"overflow:hidden;\"><span>&nbsp;<small><a href=\"?pg=competition&cid={$comp.id}\">{$comp.title}</a></small></span></td>\r\n		<td valign=\"top\" nowrap=\"nowrap\">&nbsp;<span><small>{$comp.type}</small></td>\r\n		<td valign=\"top\" style=\"border-left:1px solid #000;\"><span>{if $comp.requests|@count}{assign var=\"isRequests\" value=\"true\"}{/if}{foreach from=$comp.requests item=\"request\"}<div class=\"hangingIndent\"><input type=\"checkbox\" name=\"request[{$comp.id}][]\" value=\"{$request.id}\"><small>({$request.dateAdded|date_format2:\"n/j/y\"}) {$request.name} &lt;{mailto address=$request.email encode=\"javascript\"}&gt;: &quot;<i>{$request.comment|strip_tags}</i>&quot;</small></div>{foreachelse}&nbsp;None right now.{/foreach}</span></td>\r\n	</tr>\r\n	{/foreach}\r\n	{if $isRequests}\r\n	<tr>\r\n		<td colspan=\"4\" align=\"center\">\r\n			<span><br /><a href=\"javascript://\" onclick=\"acceptReject.value=\'accept\';requestsForm.submit();return false;\" class=\"button\">Accept Selected</a>\r\n			<a href=\"javascript://\" onclick=\"acceptReject.value=\'reject\';requestsForm.submit();return false;\" class=\"button\">Reject Selected</a><small><br /><br /></small></span></td>\r\n	</tr>\r\n	{/if}\r\n	</table>\r\n	</div>\r\n{else}\r\n	<div class=\"underline2\">&nbsp;</div>\r\n	<small>&nbsp; &nbsp; You have not created any competitions.</small>\r\n{/if}\r\n{/if}\r\n</div>\r\n<br />\r\n</form>\r\n\r\n{* ********************************* INCENTIVES PROGRAM ********************************** *}\r\n<h2 class=\"withBG\">\r\n	<div class=\"topRight hideShow\">\r\n		<a href=\"javascript:toggle(\'myIncentives\', \'\', \'showHide\');\"><img id=\"myIncentives_img\" src=\"./img/blank.gif\" class=\"showHide_on\" alt=\"show/hide\" border=\"0\" /></a></div> \r\n	My Incentives Program</h2>\r\n\r\n<div id=\"myIncentives\" style=\"display:block;\">\r\n        <div style=\"margin:0px;padding:5px;background-color:#FFF;border:#999 1px solid;\">\r\n	\r\n	{include_php file=\"shared_handle:company/participationPoints\"}\r\n\r\n	{if $scores|@count gt 0}\r\n	<h3>Participation Points</h3>\r\n        <table id=\"surveyContainer\" width=\"100%\">\r\n           <thead>\r\n               <tr><td width=\"100%\"><u> Category </u></td><td><u> Points </u></td><td nowrap><u> Total </u></td></tr>\r\n           </thead>\r\n           <tbody>\r\n           {foreach from=$scores item=\"score\" key=\"category\" name=\"loopScores\"}<tr><td nowrap>\r\n		<small>{$category|niceText}</small></td><td align=\"right\"><small>{$score}</small></td>\r\n		{if $smarty.foreach.loopScores.first}<td rowspan=\"999\" align=\"center\"><em>{$participationPointsEarned|default:0}</em></td>{/if}</tr>\r\n           {foreachelse}\r\n		None found.</td><td colspan=\"2\">&nbsp;</td></tr>\r\n           {/foreach}\r\n           </tbody>\r\n        </table>\r\n	<div class=\"underline\"></div>\r\n	<br />\r\n	{/if}\r\n\r\n	<h3>Survey Points</h3>\r\n        <table id=\"surveyContainer\" width=\"100%\">\r\n           {include_php file=\"shared_handle:company/surveyList\"}\r\n           <thead>\r\n               <tr><td width=\"100%\"><u> Survey Name </u></td><td><u> Available </u></td><td nowrap><u> Total </u></td></tr>\r\n           </thead>\r\n           <tbody>\r\n           {foreach from=$surveys item=item name=\"loopSurveys\"}<tr><td nowrap>\r\n		{if $item.dateAvailable gt 0}\r\n		<small>{$item.surveyName}</small></td><td align=\"center\"><small>{if $item.frequency eq \"Once\"}Taken{elseif (($item.dateAvailable - $smarty.now) < 43000)}{$item.dateAvailable|date_format2:\"g:i A\"}{else}{$item.dateAvailable|date_format2:\"m/d/y\"}{/if}</small></td>\r\n		{else}\r\n		<small><a href=\"javascript://\" onclick=\"openSurvey({$item.id});\">{$item.surveyName}</a></small></td><td align=\"center\"><small>Now</small></td>\r\n		{/if}{if $smarty.foreach.loopSurveys.first}<td rowspan=\"999\" align=\"center\"><em>{$surveyPointsEarned|default:0}</em></td>{/if}</tr>\r\n                {foreachelse}\r\n		None found.</td><td colspan=\"2\">&nbsp;</td></tr>\r\n               {/foreach}\r\n           </tbody>\r\n        </table>\r\n	<div class=\"underline\"></div>\r\n	<span><small><a href=\"javascript://\" onclick=\"viewSurveys();\">View My Survey History</a></small></span>\r\n	\r\n	<br /><br />\r\n	<div align=\"right\"><b>Your total points: </b><span style=\"font-size:18px;font-weight:bold;border:1px solid gray;padding:3px;\">{$surveyPointsEarned+$participationPointsEarned}</span></div>\r\n\r\n        </div>\r\n</div>\r\n</td></tr></table>\r\n{/if}'),(3506,222,0.18,'smarty','0','Page created.',1111172348,3,'24.10.217.227','{assign var=\"hideWidgets\" value=0}\r\n{assign var=\"hideUserBox\" value=\"false\"}\r\n{assign var=\"showCompanyNews\" value=\"true\"}\r\n{assign var=\"pgLayout\" value=\"layouts/withLeftNav.tpl\"}\r\n\r\n{include_php file=\"shared_handle:competition.load\"}\r\n{if $competition.userId eq $user->id or $acm->isDomainAdmin()}\r\n	{assign var=\"isManager\" value=\"true\"}\r\n	<!-- ismanager -->\r\n	{include_php file=\"shared_handle:competition.management\"}\r\n{/if}\r\n\r\n<table width=\"100%\" cellpadding=\"0\" cellspacing=\"0\" border=\"0\">\r\n	<tr>\r\n		<td valign=\"top\" width=\"260\">\r\n		<br />\r\n		<h2 class=\"withBG\">\r\n			<div class=\"topRight hideShow\">\r\n					<a href=\"javascript:toggle(\'leaderBoard\', \'\', \'showHide\');\"><img id=\"leaderBoard_img\" src=\"./img/blank.gif\" class=\"showHide_on\" alt=\"show/hide\" border=\"0\" /></a>\r\n				</div>\r\n			Leaders\r\n		</h2>\r\n		{if $competition.dateOfObject}<div align=\"right\"><small><i>as of {$competition.dateOfObject|date_format2:\"n/j/Y g:i A\"}</i></small></div>{/if}\r\n		<div id=\"leaderBoard\" style=\"display:block;\">\r\n		{if $competition.style eq \'Group-vs-Group\'}\r\n			<div style=\"white-space:nowrap;display:block;\">\r\n			<span class=\"cellHeadTiny\">#</span>\r\n			<span class=\"cellHeadBig\">Team</span>\r\n			<span class=\"cellHeadTiny\">{if $competition.scoringMethod eq \'Percentage Weight Lost\'}%\r\n					{elseif $competition.scoringMethod eq \'Weight Lost\' or $competition.scoringMethod eq \'Weight Gained\'}Lbs\r\n					{elseif $competition.scoringMethod eq \'Minutes Exercise\'}Min\r\n					{elseif $competition.scoringMethod eq \'Distance Exercised\'}Dist\r\n			{/if}</span>\r\n			<span class=\"cellHeadTiny\">#Pl</span>\r\n			</div>\r\n			{foreach name=\"rankLoop\" from=$competition.teams item=\"teams\" key=\"teamName\"}\r\n				{if $teams.name ne \"Waiting to Join\"}\r\n					{if not $teams.userCount}\r\n						{assign var=\"score\" value=\"-\"}\r\n					{elseif $competition.scoringMethod eq \'Percentage Weight Lost\'}\r\n						{assign var=\"score\" value=$teams.averagePercentLost|number_format:\"2\"|default:\"-\"}\r\n					{elseif $competition.scoringMethod eq \'Weight Lost\'}\r\n						{assign var=\"score\" value=$teams.averageWeightLost|number_format:\"2\"|default:\"-\"}\r\n					{elseif $competition.scoringMethod eq \'Weight Gained\'}\r\n						{assign var=\"score\" value=$teams.averageWeightGain|number_format:\"2\"|default:\"-\"}\r\n					{elseif $competition.scoringMethod eq \'Minutes Exercise\'}\r\n						{assign var=\"score\" value=$teams.averageExercise|number_format:\"2\"|default:\"-\"}\r\n					{elseif $competition.scoringMethod eq \'Distance Exercised\'}\r\n						{assign var=\"score\" value=$teams.averageDistance|number_format:\"2\"|default:\"-\"}\r\n					{/if}\r\n					<div style=\"white-space:nowrap;display:block;\">\r\n						<span class=\"cellTiny\" style=\"clear:left;\"><small>{$smarty.foreach.rankLoop.iteration}</small></span>\r\n						<span class=\"cellBig\"><small class=\"mini\">{$teams.name|default:\"&nbsp;\"}</small></span>\r\n						<span class=\"cellTiny\"><small>{$score|replace:\".00\":\"\"}</small></span>\r\n						<span class=\"cellTiny\"><small>{$teams.userCount|default:\"0\"}</small></span>\r\n					</div>\r\n				{/if}\r\n			{/foreach}\r\n		{else}\r\n			<div style=\"white-space:nowrap;display:block;\">\r\n			<span class=\"cellHeadTiny\">#</span>\r\n			<span class=\"cellHeadSmall\">Name</span>\r\n			<span class=\"cellHeadTiny\">{if $competition.scoringMethod eq \'Percentage Weight Lost\'}%\r\n					{elseif $competition.scoringMethod eq \'Weight Lost\' or $competition.scoringMethod eq \'Weight Gained\'}Lbs\r\n					{elseif $competition.scoringMethod eq \'Minutes Exercise\'}Min\r\n					{elseif $competition.scoringMethod eq \'Distance Exercised\'}Dist\r\n			{/if}</span>\r\n			<span class=\"cellHeadSmall\">Update</span>\r\n			</div>\r\n			{foreach from=$competition.users item=\"compUser\" key=\"username\" name=\"dateUpdated\"}\r\n			{if $smarty.foreach.dateUpdated.iteration eq 21}\r\n			</div>\r\n			<br />\r\n			<h2 class=\"withBG\">\r\n				<div class=\"topRight hideShow\">\r\n					<a href=\"javascript:toggle(\'runnerUps\', \'\', \'showHide\');\"><img id=\"runnerUps_img\" src=\"./img/blank.gif\" class=\"showHide_off\" alt=\"show/hide\" border=\"0\" /></a>\r\n				</div>\r\n				Runner Ups\r\n			</h2>\r\n			<div id=\"runnerUps\" style=\"display:none;\">\r\n			{/if}\r\n			<span class=\"cellTiny\" style=\"clear:left;\"><small>{$smarty.foreach.dateUpdated.iteration}</small></span>\r\n			<span class=\"cellSmall\"><small class=\"mini\">{$username}</small></span>\r\n			<span class=\"cellTiny\"><small>{if $scoringMethod eq \"Percentage Weight Lost\"}{$compUser.$scoringMethod|number_format:\"2\"|replace:\".00\":\"\"|default:\"-\"}{else}{$compUser.$scoringMethod|replace:\".00\":\"\"|default:\"-\"}{/if}</small></span>\r\n			<span class=\"cellSmall\"><small>{if $compUser.dateOfEntry}{$compUser.dateOfEntry|date_format2:\"n/j/y\"}{else}-Never-{/if}</small></span>\r\n			{/foreach}\r\n		{/if}\r\n		</div>\r\n		<div align=\"right\"><small><i><a href=\"?pg=faq#comp\">How is the competition scored?</a></i></small></div>\r\n		<img src=\"./img/blank.gif\" width=\"168\" height=\"1\" alt=\"\" />\r\n		{if $isManager}\r\n		<h2 class=\"withBG\">\r\n			<div class=\"topRight hideShow\">\r\n				<a href=\"javascript:toggle(\'managePlayers\', \'\', \'showHide\');\"><img id=\"managePlayers_img\" src=\"./img/blank.gif\" class=\"showHide_off\" alt=\"show/hide\" border=\"0\" /></a>\r\n			</div> \r\n			Manage\r\n		</h2>\r\n		<div id=\"managePlayers\" style=\"display:none;\">\r\n					<form name=\"managePlayers[]\" action=\"index.php\" method=\"POST\" style=\"margin:0px;\">\r\n					<input type=\"hidden\" name=\"pg\" value=\"{$page.name}\">\r\n					<input type=\"hidden\" name=\"cid\" value=\"{$competition.id}\">\r\n					<input type=\"hidden\" name=\"no_expire\" value=\"true\">\r\n					<input type=\"hidden\" name=\"style\" value=\"{$competition.style}\">\r\n							{if $competition.style eq \'Group-vs-Group\'}\r\n								<span class=\"cellHeadTiny\" style=\"clear:left;\">Del</span>\r\n								<span class=\"cellHead\">View Stats</span>\r\n								<span class=\"cellHeadSmall\">-</span><br />\r\n								{foreach from=$competition.teams item=\"teams\" key=\"teamName\"}\r\n									{foreach from=$teams.users item=\"users\" key=\"userName\"}\r\n										<span class=\"cellTiny\" style=\"clear:left;\"><small><input type=\"checkbox\" name=\"managePlayers[delete][]\" value=\"{$userName}\" style=\"width:14px; height:14px;margin:0px 2px;\"></small></span>\r\n										<span class=\"cell\"><small><a href=\"?pg=myhome&cid={$competition.id}&userId={$users.id}&hideComps=1\">{$userName}</a></small></span>\r\n										<span class=\"cellSmall\"><small><a href=\"mailto:{$users.email}\">email</a></small></span><br />\r\n									{/foreach}\r\n								{/foreach}\r\n							{else}\r\n								<span class=\"cellHeadTiny\" style=\"clear:left;\">Del</span>\r\n								<span class=\"cellHead\">View Stats</span>\r\n								<span class=\"cellHeadSmall\">-</span><br />\r\n								{foreach from=$competition.users item=\"compUser\" key=\"username\" name=\"dateUpdated\"}\r\n									<span class=\"cellTiny\" style=\"clear:left;\"><small><input type=\"checkbox\" name=\"managePlayers[delete][]\" value=\"{$username}\" style=\"width:14px;height:14px;margin:0px 2px;\"></small></span>\r\n									<span class=\"cell\"><small><a href=\"?pg=myhome&cid={$competition.id}&userId={$compUser.id}&hideComps=1\">{$username}</a></small></span>\r\n									<span class=\"cellSmall\"><small><a href=\"mailto:{$compUser.email}\">email</a></small></span><br />\r\n								{/foreach}\r\n							{/if}\r\n					<div style=\"text-align:center;\">\r\n                                                <br />\r\n						<input type=\"submit\" class=\"button\" value=\"Delete Selected\">\r\n					</div>\r\n					</form>\r\n		</div><br/>\r\n		{/if}\r\n		{* End new section for Player management. *}\r\n		\r\n		{* Begin new section for Team management.  This can be moved where ever. *}\r\n		{* ******************************** TEAM MANAGEMENT ***************************************** *}\r\n		{if $isManager and $competition.style eq \'Group-vs-Group\'}\r\n		<h2 class=\"withBG\">\r\n			<div class=\"topRight hideShow\">\r\n				<a href=\"javascript:toggle(\'teamManagement\', \'\', \'showHide\');\"><img id=\"teamManagement_img\" src=\"./img/blank.gif\" class=\"showHide_{if $smarty.request.showTeamManagement}on{else}off{/if}\" alt=\"show/hide\" border=\"0\" /></a>\r\n			</div>\r\n			Teams</h2>\r\n		<div id=\"teamManagement\" style=\"display:{if $smarty.request.showTeamManagement}block{else}none{/if};\">\r\n			<form name=\"manageTeam[]\" action=\"index.php\" method=\"POST\" style=\"margin:0px;\">\r\n			<input type=\"hidden\" name=\"pg\" value=\"{$page.name}\">\r\n			<input type=\"hidden\" name=\"cid\" value=\"{$competition.id}\">\r\n			<input type=\"hidden\" name=\"no_expire\" value=\"true\">\r\n			<div id=\"playersList{counter}\">\r\n				<span class=\"cellHeadTiny\">Del</span>\r\n				<span class=\"cellHeadLarge\" style=\"width:134px;\">Team Name</span><br />\r\n				{foreach from=$competition.teams item=\"teams\" key=\"teamName\"}\r\n					{counter name=\"counterI\" start=\"0\" print=0}\r\n					{if $teams.name ne \"Waiting to Join\"}\r\n						<span class=\"cellTiny\" style=\"clear:left;\"><small><input type=\"checkbox\" name=\"manageTeam[delete][]\" value=\"{$teams.name}\"></small></span>\r\n						<span class=\"cellLarge\" style=\"width:134px;\"><small><input id=\"renameTeam\" type=\"text\" value=\"{$teams.name}\" name=\"manageTeam[rename][{$teams.name}]\" size=\"10\" style=\"width:124px;height:12px\"></small></span><br />\r\n					{/if}\r\n				{/foreach}\r\n			</div>\r\n                        <br />\r\n			<div style=\"text-align:center;\">New Team: <input id=\"addTeam\" type=\"text\" name=\"manageTeam[addTeam]\" size=\"10\"><br />\r\n			<br />\r\n                        <input type=\"submit\" class=\"button\" value=\"Submit Changes\"></div>\r\n			</form>\r\n		</div><br />\r\n		{/if}\r\n		{* End new section for Team management. *}\r\n\r\n		\r\n		{if !$isManager AND $competition.users|@count lt 45}{include file=\"layouts/ads.tpl\"}{assign var=\"adsShown\" value=\"1\"}{/if}\r\n\r\n			<h2 class=\"withBG\">Competition Stats</h2>\r\n			<span class=\"cellHeadLarge\">Category</span><span class=\"cellHeadSmall\">Result</span><br />\r\n			<span class=\"cellLarge\"><small>start weight</small></span>\r\n			<span class=\"cellSmall\"><small>{$competition.groupStartWeight|default:0} lbs</small></span><br />\r\n			<span class=\"cellLarge\"><small>weight lost</small></span>\r\n			<span class=\"cellSmall\"><small>{$competition.groupWeightLost|default:0} lbs</small></span><br />\r\n			{if $competition.groupPercentageWeightLost gt 0}<span class=\"cellLarge\"><small>% lost</small></span>\r\n			<span class=\"cellSmall\"><small>{$competition.groupPercentageWeightLost|default:0|number_format:\"2\"}</small></span><br />{/if}\r\n			<span class=\"cellLarge\"><small>fat intake</small></span>\r\n			<span class=\"cellSmall\"><small>{$competition.groupFat|default:0}</small></span><br />\r\n			<span class=\"cellLarge\"><small>calorie intake</small></span>\r\n			<span class=\"cellSmall\"><small>{$competition.groupCalories|default:0}</small></span><br />\r\n			<span class=\"cellLarge\"><small>minutes exercised</small></span>\r\n			<span class=\"cellSmall\"><small>{$competition.groupExercise|default:0}</small></span><br />\r\n			<span class=\"cellLarge\"><small>miles exercised</small></span>\r\n			<span class=\"cellSmall\"><small>{$competition.groupDistanceExercised|default:0}</small></span><br />\r\n			<img src=\"./img/blank.gif\" width=\"165\" height=\"1\" alt=\"\" />\r\n		</td>\r\n		<td width=\"100%\" valign=\"top\">\r\n			<div id=\"contentBox\" class=\"centerBox\" style=\"margin-left:10px;\"><div class=\"topRightTreasure\">\r\n				{include_php file=\"shared_handle:competition.verifyInitialPot\"}\r\n<div id=\"jackpot\">{if $competition.potAmount gt 0}${$competition.potAmount|number_format:2}{/if}</div>\r\n<h1 class=\"underline\">{$competition.title|default:\"Competition Title\"}</h1>\r\n\r\n{* ******************************** COMPETITION END *********************************** *}\r\n{if $competition.endDate lt $smarty.now}   {* COMPETITION IS OVER *}\r\n	{if $competition.results.winners|@count eq 1}\r\n		{* There was one winner, either by scoringMethod or tieBreakerMethod *}\r\n\r\n		{math assign=\"daysOfCompetition\" equation=\"(x - y) / z\" x=$competition.endDate|default:\"0\" y=$competition.startDate|default:\"0\" z=\"86400\"}\r\n		{math assign=\"marginOfVictory\" equation=\"x - y\" x=$competition.results.winningStat|default:\"0\" y=$competition.results.secondPlaceStat|default:\"0\"}\r\n\r\n		{foreach from=$competition.results.winners item=\"winnerName\"}    {*key=\"winnerName\"*}\r\n			{assign var=\"winnerData\" value=$competitions.users.$winnerName}\r\n			\r\n			{if $competition.style eq \"Group-vs-Group\"}\r\n				{assign var=\"description\" value=\"Winning Team\"}\r\n				{assign var=\"avg\" value=\"average\"}\r\n			{else}\r\n				{assign var=\"description\" value=\"Winner\"}\r\n			{/if}\r\n\r\n			<h2><br /><b>{$winnerName}</b> is the {$description}{if $competition.potAmount}, taking home <b>$<i>{$competition.potAmount|number_format:2}</i></b>{/if}!</h2>\r\n			<br />\r\n			{strip}\r\n			{if not $competition.results.isTie}   {* Not a Tie *}\r\n				After a difficult <b>{$daysOfCompetition|number_format:0}</b> days of \r\n				fierce competition, <b>{$winnerName}</b> is the \r\n				{$description}!	Based on \r\n				<b>{$competition.results.winningMethod}</b>, <b>{$winnerName}</b> \r\n				won with <b>{$competition.results.winningStat|number_format:2} \r\n				{if $competition.results.winningMethod eq \"Weight Lost\"}{$avg} pounds lost\r\n				{elseif $competition.results.winningMethod eq \"Percentage Weight Lost\"}{$avg} % body weight lost\r\n				{elseif $competition.results.winningMethod eq \"Minutes Exercise\"}{$avg} minutes exercised\r\n				{elseif $competition.results.winningMethod eq \"Distance Exercised\"}{$avg} miles exercised\r\n				{elseif $competition.results.winningMethod eq \"Weight Gained\"}{$avg} pounds gained\r\n				{/if}</b>.\r\n			{else}                                {* A Tie! *}\r\n				{assign var=\"weightLost\" value=\"Weight Lost\"}\r\n				{assign var=\"percentLost\" value=\"Percentage Weight Lost\"}\r\n\r\n				After a difficult <b>{$daysOfCompetition|number_format:0}</b> \r\n				days of fierce competition, there was a tie in the judging \r\n				method, <b>{$competition.scoringMethod}</b>. To break this \r\n				tie, the selected tie breaking method, \r\n				<b>{$competition.tieBreakerMethod}</b>, was used to determine \r\n				<b>{$winnerName}</b> as the {$description}. <b>{$winnerName}</b> \r\n				won with <b>{$competition.results.winningStat|number_format:2}\r\n				{if $competition.results.winningMethod eq \"Weight Lost\"}{$avg} pounds lost\r\n				{elseif $competition.results.winningMethod eq \"Percentage Weight Lost\"}{$avg} % body weight lost\r\n				{elseif $competition.results.winningMethod eq \"Minutes Exercise\"}{$avg} minutes exercised\r\n				{elseif $competition.results.winningMethod eq \"Distance Exercised\"}{$avg} miles exercised\r\n				{elseif $competition.results.winningMethod eq \"Weight Gained\"}{$avg} pounds gained\r\n				{/if}</b>.\r\n				<!--\r\n				<b>{$winnerData.$weightLost|number_format:0} pounds</b>, which \r\n				was <b>{$winnerData.$percentLost|number_format:4}%</b> body weight.\r\n				-->\r\n			{/if}\r\n			{/strip}\r\n			<br />\r\n			<br />\r\n			<b>{$winnerName}</b> won with a <b>{$marginOfVictory|number_format:3}</b> margin over <b>{$competition.results.secondPlaceUser}</b>.\r\n			\r\n			<h2><br />Congratulations to you all!</h2>\r\n			<br />\r\n			<div class=\"underline\"></div>\r\n		{/foreach}\r\n\r\n	{elseif $competition.results.winners|@count gt 1}\r\n		{* There were multiple winners, even after tieBreakerMethod (should RARELY happen) *}\r\n	\r\n		<h2>There was a tie in this competition. The winners, by <b>{$competition.results.winningMethod}</b> having lost <b>{$competition.results.winningStat}</b>, are:<br /></h2>\r\n		<ul>\r\n		{foreach from=$competition.results.winners item=\"winnerData\" key=\"winnerName\"}\r\n			<li>{$winnerName}</li>\r\n		{/foreach}\r\n		</ul>\r\n		\r\n	{else}\r\n		{* For some reason, there were no winners *}\r\n\r\n		<h2><br />\r\n		Winner information is currently unavailable.<br />\r\n		Please check back soon.\r\n		<br /><br /></h2>\r\n	{/if}\r\n	This competition has ended and is no longer active.<br />\r\n{/if}\r\n{* ************************************************************************************ *}\r\n\r\n<div id=\"prizeDesc\">{$competition.potDescription}<br />\r\n{if $competition.potAmount}<small style=\"color:#FFF;\">(${$competition.individualPotAmount} from {$competition.potMethod})</small>{/if}</div>\r\n\r\n{if $competition.startDate lt $smarty.now}\r\n	Time remaining: <b>{$competition.timeLeft}</b><br />\r\n{else}\r\n	This competition has not yet started!<br />\r\n{/if}\r\n\r\nStart{if $competition.startDate lt $smarty.now}ed{else}s{/if}: <b>{$competition.startDate|date_format2:\"n/j/Y\"}</b> &nbsp; \r\nEnd{if $competition.endDate lt $smarty.now}ed{else}s{/if}: <b>{$competition.endDate|date_format2:\"n/j/Y\"}</b><br />\r\n{if $competition.calculationMode neq \"Real-Time\"}Competition stats/scoring updated as of {$competition.dateOfObject|date_format2:\"n/j/Y g:i A\"}{if $isManager} (<a href=\"?pg=competition&cid={$smarty.request.cid}&nocache=1\">Update Now!</a>){/if}<br />{/if}\r\n<div style=\"font-size:5px;clear:left;\">&nbsp;</div>\r\n{assign var=\"scoringMethod\" value=$competition.scoringMethod}\r\n{assign var=\"tieBreakerMethod\" value=$competition.tieBreakerMethod}\r\n{assign var=\"weeklyWinnersMethod1\" value=$competition.weeklyWinnersMethod1}\r\n{assign var=\"weeklyWinnersMethod2\" value=$competition.weeklyWinnersMethod2}\r\n\r\n{* ******************** WEEKLY WINNERS ********************* *}\r\n{if $competition.weeklyWinners}\r\n	{if $weeklyWinnersMethod1}             {* DON\'T FORGET TO REMOVE THE ACM CHECK WHEN READY!!! *}\r\n		<h2 class=\"withBG\">\r\n			<div class=\"topRight hideShow\">\r\n			<a href=\"javascript:toggle(\'weeklyWinners\', \'\', \'showHide\');\"><img id=\"weeklyWinners_img\" src=\"./img/blank.gif\" class=\"showHide_on\" alt=\"show/hide\" border=\"0\" /></a></div>\r\n			Last Week\'s Winners<i>!</i> <small style=\"color:#000; font-size:11px;\">(<i><b>{$competition.weeklyWinners.startDate|date_format2:\"D n/j\"}</b> through <b>{$competition.weeklyWinners.endDate|date_format2:\"D n/j\"}</b></i>)</small></h2> \r\n		<div id=\"weeklyWinners\">\r\n		<table width=\"100%\" cellpadding=\"3\" cellspacing=\"0\"><tr>\r\n		<td valign=\"top\" width=\"50%\">\r\n		<div class=\"cellHeadLarge\" style=\"width:auto;float:none;\">{$weeklyWinnersMethod1}</div>\r\n		<img src=\"{$skinFolder}images/winner_1.gif\" style=\"float:left;\" />\r\n		{strip}\r\n		{foreach name=\"method1\" from=$competition.weeklyWinners.$weeklyWinnersMethod1 item=\"username\"}\r\n			{assign var=\"userValue\" value=$competition.weeklyWinners.users.$username.$weeklyWinnersMethod1}\r\n			{if $smarty.foreach.method1.iteration gt 3 OR $userValue lte 0}{if $smarty.foreach.method1.iteration eq 1}Don\'t forget to update your progress so there will be winners next week{/if}<i>!</i>{php}break;{/php}\r\n			{elseif $smarty.foreach.method1.iteration eq 1}\r\n				<b>{$username|default:\"[ ?? ]\"|ucfirst}</b> led the way last week by \r\n				{if $weeklyWinnersMethod1 eq \'Weight Lost\'}losing <b>{$userValue}</b> pounds{elseif $weeklyWinnersMethod1 eq \'Percentage Weight Lost\'}losing <b>{$userValue|number_format:\"2\"}%</b> body weight{elseif $weeklyWinnersMethod1 eq \'Minutes Exercise\'}exercising <b>{$userValue}</b> minutes{elseif $weeklyWinnersMethod1 eq \'Distance Exercised\'}exercising <b>{$userValue}</b> miles{elseif $weeklyWinnersMethod1 eq \'Weight Gained\'}gaining <b>{$userValue}</b> pounds{else}<b>default</b>{/if}\r\n			{else}\r\n				{if $smarty.foreach.method1.iteration eq 2}, followed by <b>{$username|default:\"[ ?? ]\"|ucfirst}</b> with \r\n				{else} and <b>{$username|default:\"[ ?? ]\"|ucfirst}</b> with \r\n				{/if}\r\n				{if $weeklyWinnersMethod1 eq \'Weight Lost\'}<b>{$userValue}</b> pounds{elseif $weeklyWinnersMethod1 eq \'Percentage Weight Lost\'}<b>{$userValue|number_format:\"2\"}%</b>{elseif $weeklyWinnersMethod1 eq \'Minutes Exercise\'}<b>{$userValue}</b> minutes{elseif $weeklyWinnersMethod1 eq \'Distance Exercised\'}<b>{$userValue}</b> miles{elseif $weeklyWinnersMethod1 eq \'Weight Gained\'}<b>{$userValue}</b> pounds{/if}\r\n			{/if}\r\n		{/foreach}\r\n		{/strip}\r\n		</td>\r\n	{/if}\r\n	{if $weeklyWinnersMethod2} \r\n		<td valign=\"top\" width=\"50%\">\r\n		<div class=\"cellHeadLarge\" style=\"width:auto;float:none;\">{$weeklyWinnersMethod2}</div>\r\n		<img src=\"{$skinFolder}images/winner_2.gif\" style=\"float:left;\" />\r\n		{* display var=$competition.weeklyWinners.users *}\r\n		{strip}\r\n		{foreach name=\"method2\" from=$competition.weeklyWinners.$weeklyWinnersMethod2 item=\"username\"}\r\n			{assign var=\"userValue\" value=$competition.weeklyWinners.users.$username.$weeklyWinnersMethod2}\r\n			\r\n			{if $smarty.foreach.method2.iteration gt 3 OR $userValue lte 0}{if $smarty.foreach.method2.iteration eq 1}Don\'t forget to update your progress so there will be winners next week{/if}<i>!</i>{php}break;{/php}\r\n			{elseif $smarty.foreach.method2.iteration eq 1}\r\n				<b>{$username|default:\"[ ?? ]\"|ucfirst}</b> won by \r\n				{if $weeklyWinnersMethod2 eq \'Weight Lost\'}losing <b>{$userValue}</b> pounds{elseif $weeklyWinnersMethod2 eq \'Percentage Weight Lost\'}losing <b>{$userValue|number_format:\"2\"}%</b> body weight{elseif $weeklyWinnersMethod2 eq \'Minutes Exercise\'}exercising <b>{$userValue}</b> minutes{elseif $weeklyWinnersMethod2 eq \'Distance Exercised\'}exercising <b>{$userValue}</b> miles{elseif $weeklyWinnersMethod2 eq \'Weight Gained\'}gaining <b>{$userValue}</b> pounds{/if}\r\n			{else}\r\n				{if $smarty.foreach.method2.iteration eq 2}, followed by <b>{$username|default:\"[ ?? ]\"|ucfirst}</b> with \r\n				{else} and <b>{$username|default:\"[ ?? ]\"|ucfirst}</b> with \r\n				{/if}\r\n				{if $weeklyWinnersMethod2 eq \'Weight Lost\'}<b>{$userValue}</b> pounds{elseif $weeklyWinnersMethod2 eq \'Percentage Weight Lost\'}<b>{$userValue|number_format:\"2\"}%</b>{elseif $weeklyWinnersMethod2 eq \'Minutes Exercise\'}<b>{$userValue}</b> minutes{elseif $weeklyWinnersMethod2 eq \'Distance Exercised\'}<b>{$userValue}</b> miles{elseif $weeklyWinnersMethod2 eq \'Weight Gained\'}<b>{$userValue}</b> pounds{/if}\r\n			{/if}\r\n		{/foreach}\r\n		{/strip}\r\n		</td>\r\n	{/if}\r\n	{if $weeklyWinnersMethod1}\r\n	</tr></table></div>{/if}\r\n{/if}\r\n{* ********************************************************* *}\r\n\r\n{if $acm->isDomainAdmin() and $smarty.request.debug}\r\n	{display var=$competition}\r\n{/if} \r\n\r\n{* ******************************** COMPARISON GRAPHS ***************************************** *}\r\n{if $competition.availableGraphs|@count}\r\n{include_php file=\"shared_handle:competition.graphs\"}\r\n<h2 class=\"withBG\"><a name=\"graph\"></a>\r\n	<div class=\"topRight hideShow\">\r\n		<a href=\"javascript:toggle(\'graphs\', \'\', \'showHide\');\"><img id=\"graphs_img\" src=\"./img/blank.gif\" class=\"showHide_on\" alt=\"show/hide\" border=\"0\" /></a></div> \r\n	Comparison Graphs &nbsp; <small><i>No graph? <a href=\"http://www.macromedia.com/shockwave/download/download.cgi?P1_Prod_Version=ShockwaveFlash\" target=\"_blank\">click here</a> to download the free Flash Player plug-in.</i></small></h2>\r\n<div id=\"graphs\" style=\"display:block;\">\r\n	<table border=\"0\" cellpadding=\"0\" width=\"100%\">\r\n		{assign var=\"graphURL\" value=\"?pg=flashgraph-frame&format=wide\"}\r\n	<tr>\r\n		<td><div style=\"border:#999 1px solid;background-color:#FFF;padding:5px;\"><iframe name=\"graphwindow\" src=\"{$graphURL}\" frameborder=\"0\" width=\"625\" height=\"222\" scrollbars=\"no\"></iframe></div></td>\r\n	</tr>\r\n	<tr>\r\n		<td valign=\"top\" align=\"center\" width=\"100%\">\r\n		<small>\r\n		{foreach name=\"graphTypes\" from=$competition.availableGraphs key=\"graphType\" item=\"graphParams\"}\r\n		<a href=\"?pg=flashgraph-frame&compId={$competition.id}&{$graphParams}\" target=\"graphwindow\">{$graphType}</a>{if $smarty.foreach.graphTypes.iteration neq $competition.availableGraphs|@count} | {/if}\r\n		{/foreach}\r\n		</small></td>\r\n	</tr>\r\n	</table>\r\n<br />\r\n</div>\r\n{/if}\r\n\r\n{* ******************************** GROUP TEAMS/PLAYERS SUMMARY W/MOVING ***************************************** *}\r\n{if $competition.style eq \'Group-vs-Group\'}\r\n<h2 class=\"withBG\">\r\n	<div class=\"topRight hideShow\">\r\n		<a href=\"javascript:toggle(\'teams\', \'\', \'showHide\');\"><img id=\"teams_img\" src=\"./img/blank.gif\" class=\"showHide_on\" alt=\"show/hide\" border=\"0\" /></a></div> \r\n	The Teams &nbsp; <small><i>Assignments and statistics</i></small></h2>\r\n<div id=\"teams\" style=\"display:block;\">\r\n<table cellpadding=\"0\" cellspacing=\"0\" width=\"100%\" border=\"0\"><tr><td>\r\n	{if $isManager}\r\n		<form name=\"changeTeam\" action=\"index.php\" method=\"POST\" style=\"margin:0px;\">\r\n			<input type=\"hidden\" name=\"pg\" value=\"{$page.name}\">\r\n			<input type=\"hidden\" name=\"cid\" value=\"{$competition.id}\">\r\n			<input type=\"hidden\" name=\"no_expire\" value=\"true\">\r\n	{/if}\r\n		{assign var=\"minEx\" value=\"Minutes Exercise\"}\r\n		{assign var=\"distEx\" value=\"Distance Exercised\"}\r\n		{assign var=\"pctLst\" value=\"Percentage Weight Lost\"}\r\n		{assign var=\"wtLst\" value=\"Percentage Weight Lost\"}\r\n		{foreach from=$competition.teams name=\"teamsLoop\" item=\"teams\" key=\"teamName\"}\r\n			<div id=\"playersList{$smarty.foreach.teamsLoop.iteration}\" style=\"float:left;width:310px;overflow:hidden;word-wrap:nowrap; margin:0px 5px 5px 0px;\">\r\n			<h4>{if $teams.name eq \"Waiting to Join\"}Not assigned to a team{else}{$teams.name|default:\"&nbsp;\"}{/if}</h4>\r\n		{if $scoringMethod|regex_match:\"/exercise/i\"}\r\n			<span class=\"cellHeadLarge\">Name</span>\r\n			<span class=\"cellHeadSmall\">Min.</span>\r\n			<span class=\"cellHeadSmall\">Dist.</span>\r\n			<span class=\"cellHeadSmall\">Update</span><br />\r\n			{foreach from=$teams.users item=\"users\" key=\"userName\"}\r\n				<span class=\"cellLarge\" style=\"text-align:left;\"><small>{if $isManager}<input type=\"checkbox\" name=\"changeTeam[players][{$userName}]\" style=\"width:14px;height:14px;margin:0px 2px;\" />{/if}{$userName}</small></span>\r\n				<span class=\"cellSmall\"><small>{$users.$minEx|default:\"-\"|replace:\".00\":\"\"}</small></span>\r\n				<span class=\"cellSmall\"><small>{$users.$distEx|default:\"-\"|replace:\".00\":\"\"}</small></span>\r\n				<span class=\"cellSmall\"><small>{if $users.dateOfEntry}{$users.dateOfEntry|date_format2:\"n/j/y\"}{else}Never{/if}</small></span>\r\n			{foreachelse}\r\n				{* No players assigned to this team. *}\r\n			{/foreach}\r\n		{else}\r\n			<span class=\"cellHeadLarge\">Name</span>\r\n			<span class=\"cellHeadTiny\">%</span>\r\n			<span class=\"cellHeadSmall\">Update</span><br />\r\n			{foreach from=$teams.users item=\"users\" key=\"userName\"}\r\n				<span class=\"cellLarge\" style=\"clear:left;text-align:left;\"><small>{if $isManager}<input type=\"checkbox\" name=\"changeTeam[players][{$userName}]\" />{/if}{$userName}</small></span>\r\n				<span class=\"cellTiny\"><small>{if $users.hideInitialWeight neq \"Yes\"}{$users.$pctLst|number_format:\"2\"|replace:\".00\":\"\"}{else}-{/if}</small></span>\r\n				<span class=\"cellSmall\"><small>{if $users.dateOfEntry}{$users.dateOfEntry|date_format2:\"n/j/y\"}{else}Never{/if}</small></span><br />\r\n			{foreachelse}\r\n				{* No players assigned to this team. *}\r\n			{/foreach}\r\n		{/if}\r\n			</div>\r\n		{/foreach}\r\n	{if $isManager}\r\n		<br />\r\n		<select name=\"changeTeam[team]\">\r\n			<option value=\"\">Move selected players to...</option>\r\n			{foreach from=$competition.teams item=\"newTeams\" key=\"newTeamName\"}\r\n				{*if $newTeams.name ne $teams.name and $newTeams.name ne \"Waiting to Join\"*}\r\n				{if $newTeams.name ne \"Waiting to Join\"}\r\n					<option value=\"{$newTeams.name}\">{$newTeams.name}</option>\r\n				{/if}\r\n			{/foreach}\r\n		</select><br />\r\n		<input type=\"submit\" class=\"button\" value=\"Submit Changes\">\r\n		</form>\r\n	{/if}\r\n</td></tr></table>\r\n</div>\r\n{/if}\r\n</div>\r\n	{* ******************************** DISCUSSION BOARD ***************************************** *}\r\n<br />\r\n<h2 class=\"withBG\">\r\n	<div class=\"topRight hideShow\">\r\n		<a href=\"javascript:toggle(\'discuss\', \'\', \'showHide\');\"><img id=\"discuss_img\" src=\"./img/blank.gif\" class=\"showHide_on\" alt=\"show/hide\" border=\"0\" /></a></div> \r\n	Discussion Board</h2>\r\n<div id=\"discuss\" style=\"display:block;\">\r\n	<table cellpadding=\"0\" width=\"100%\" border=\"0\"><tr><td><iframe src=\"?pg=competition/forum\" id=\"discussionBoard\" frameborder=\"0\" scrolling=\"yes\" style=\"width:100%;\"></iframe></td></tr></table>\r\n</div>\r\n\r\n</div></td>\r\n</tr></table>'),(5154,195,0.80,'smarty','0','Testing graph links.',1159384042,16,'216.194.127.150','{if $smarty.session.company.preferences.hide_home eq \"yes\"}{include file=\"file:layouts/hiddenPageRedirector.tpl\"}{/if}\r\n{include file=\"layouts/forceLoggedIn.tpl\"}\r\n{include_php file=\"shared_handle:myHome\"}\r\n{include_php file=\"shared_handle:getProfile\"}\r\n{assign var=\"pgLayout\" value=\"layouts/withLeftNav.tpl\"}\r\n<h1>{$page.title} - {$userProfile.firstName} {$userProfile.lastName} ({$userProfile.username})</h1>\r\n\r\n{select_query return=\"row\" assign=\"aHRA\"}\r\n	dateTaken, pointsEarned FROM surveys_taken\r\n		WHERE userId = {$user->id}\r\n		AND surveyId = 8\r\n		ORDER BY dateTaken DESC\r\n		LIMIT 1\r\n{/select_query}\r\n\r\n<table width=\"700\">\r\n<tr>\r\n	<td>\r\n	<div id=\"statsContainer\" style=\"overflow:hidden;\">\r\n		<a name=\"updateStats\"></a>\r\n		<iframe name=\"profileUpdateFrame\" id=\"profileUpdateIFrame\" src=\"?pg=my_statistics/update&userId={$smarty.request.userId|default:$userProfile.id}\" frameborder=\"0\" width=\"700\" height=\"440\" scrolling=\"no\"></iframe>\r\n	</div>\r\n	</td>\r\n</tr>\r\n</table>\r\n\r\n<table width=\"700\">\r\n<tr><td>\r\n<h2 class=\"withBG\">\r\n	<div class=\"topRight hideShow\">\r\n		<a href=\"javascript:toggle(\'profileGraphTable\', \'\', \'showHide\');\"><img id=\"profileGraphTable_img\" src=\"blank.gif\" class=\"showHide_on\" alt=\"show/hide\" border=\"0\" /></a>\r\n	</div>User Profile &amp; Graphs</h2>\r\n</td></tr></table>\r\n\r\n<table id=\"profileGraphTable\" width=\"700\">\r\n<tr><td width=\"205\" valign=\"top\">\r\n	<div id=\"UserProfileColumn\" class=\"contentColumn\">\r\n	<h2 class=\"withBG\">Your Profile</h2>\r\n		<span class=\"cellHeadLarge\">Age:</span><span class=\"cellSmall\">{$userProfile.age|default:\"-\"}</span><br />\r\n		<span class=\"cellHeadLarge\">Height:</span><span class=\"cellSmall\">{$userProfile.heightFeet|default:\"-\"}\'{$userProfile.heightInches|default:\"-\"}&quot;</span><br />\r\n		<span class=\"cellHeadLarge\">Start BMI:</span><span class=\"cellSmall\">{$userProfile.startBMI|default:\"-\"}</span><br />\r\n		<span class=\"cellHeadLarge\">Start Weight:</span><span class=\"cellSmall\">{$userProfile.initialWeight|default:\"-\"}</span><br /><span class=\"cellHeadLarge\">Goal Weight:</span><span class=\"cellSmall\">{$userProfile.goalWeight|default:\"-\"}</span><br />\r\n		<span class=\"cellHeadLarge\">Current Weight:</span><span class=\"cellSmall\">{$userProfile.currentWeight|default:\"-\"}</span><br />\r\n		<span class=\"cellHeadLarge\">HRA Score:</span><span class=\"cellSmall\">{$aHRA.pointsEarned|default:\"-\"}</span><br />\r\n\r\n		<a href=\"?pg=my_profile\" class=\"link\"><img src=\"{$skinFolder}images/btn_profile.gif\" border=\"0\" alt=\"Update Profile\" vspace=\"10\" /></a><br />\r\n		<a href=\"?pg=my_settings\" class=\"link\"><img src=\"{$skinFolder}images/btn_settings.gif\" border=\"0\" alt=\"Account Settings\" vspace=\"0\" /></a>\r\n	</div>\r\n</td><td valign=\"top\" align=\"center\">	\r\n	<div id=\"graphContainer\">\r\n	<iframe name=\"graphwindow\" src=\"?pg=flashgraph-frame&compId={$compData.id}&format=small\" frameborder=\"0\" width=\"425\" height=\"240\" scrollbars=\"no\"></iframe></div>\r\n	{if true OR $user->username eq \"chad\" OR $user->username eq \"trave\"}\r\n	{include_php file=\"shared_handle:estats/getEstatsInfo\"}\r\n	<div id=\"graphLinksDiv\">\r\n		<table width=\"100%\">\r\n		<tr>\r\n			<td width=\"100%\" align=\"center\"><small>\r\n			{foreach from=$aEstats item=\"es\" name=\"loopEstats\"}\r\n				<a href=\"?pg=flashgraph-frame&format=small&userIds={$userProfile.id}&esId={$es.id}&type={$es.name|niceText|htmlspecialchars}&fillPrevious={if $es.assumeConstantValues eq \"yes\"}1{else}0{/if}&precision={$es.units.decimalPlaces|default:1}\" target=\"graphwindow\">{$es.name|niceText|replace:\" \":\"&nbsp;\"}</a> {if !$smarty.foreach.loopEstats.last}|{/if}\r\n			{foreachelse}\r\n				<b>No Available eStat Graphs</b>\r\n			{/foreach}\r\n			</small></td>\r\n		</tr>\r\n		</table>\r\n	</div>\r\n	{else} {* OLD GRAPH LISTINGS *}\r\n	<small>\r\n		<a href=\"?pg=flashgraph-frame&compId={$compData.id}&format=small&userIds={$userProfile.id}&type=weight&fillPrevious=1&precision=1&totalChange=1\" target=\"graphwindow\">Change in Weight</a> |\r\n		<a href=\"?pg=flashgraph-frame&compId={$compData.id}&format=small&userIds={$userProfile.id}&type=weight&fillPrevious=1&precision=1\" target=\"graphwindow\">Weight</a> |\r\n		<a href=\"?pg=flashgraph-frame&compId={$compData.id}&format=small&userIds={$userProfile.id}&type=fat&fillPrevious=0&precision=1\" target=\"graphwindow\">Fat Intake</a> |\r\n		<a href=\"?pg=flashgraph-frame&compId={$compData.id}&format=small&userIds={$userProfile.id}&type=calories&fillPrevious=0&precision=1\" target=\"graphwindow\">Calorie Intake</a> |\r\n		<a href=\"?pg=flashgraph-frame&compId={$compData.id}&format=small&userIds={$userProfile.id}&type=carbs&fillPrevious=0&precision=1\" target=\"graphwindow\">Carb Intake</a><br />\r\n		<a href=\"?pg=flashgraph-frame&compId={$compData.id}&format=small&userIds={$userProfile.id}&type=water&fillPrevious=0&precision=1\" target=\"graphwindow\">Water Intake</a> |\r\n		<a href=\"?pg=flashgraph-frame&compId={$compData.id}&format=small&userIds={$userProfile.id}&type=minutesExercise&fillPrevious=0&precision=1\" target=\"graphwindow\">Exercise Min</a> |\r\n		<a href=\"?pg=flashgraph-frame&compId={$compData.id}&format=small&userIds={$userProfile.id}&type=distanceExercised&fillPrevious=0&precision=1\" target=\"graphwindow\">Distance Exercised</a>\r\n	</small>\r\n	{/if}\r\n</td></tr>\r\n</table>\r\n<br />\r\n<table width=\"700\">\r\n<tr><td colspan=\"2\">\r\n<h2 class=\"withBG\">\r\n	<div class=\"topRight hideShow\">\r\n		<a href=\"javascript:toggle(\'goalsMottosBlock\', \'\', \'showHide\');\"><img id=\"goalsMottosBlock_img\" src=\"blank.gif\" class=\"showHide_on\" alt=\"show/hide\" border=\"0\" /></a>\r\n	</div>\r\n	Goals &amp; Mottos</h2>\r\n<blockquote id=\"goalsMottosBlock\" style=\"display:block;\">\r\n<dl>\r\n	<dt>Motto:</dt>\r\n	<dd>{$userProfile.personalSaying|default:\"- Not Set - <u><a href=\\\"http://partners.ehealthcompete.com/index.php?pg=my_profile\\\">Click here to update now</a></u>\"}</dd>\r\n	<dt>Nutrition Goal:</dt>\r\n	<dd>{$userProfile.nutritionGoal|default:\"- Not Set - Click on the <i><b>Update my Profile</b></i> button toward the top of this page to set your goal\"}</dd>\r\n	<dt>Fitness Goal:</dt>\r\n	<dd>{$userProfile.fitnessGoal|default:\"- Not Set - Click on the <i><b>Update my Profile</b></i> button toward the top of this page to set your goal\"}</dd>\r\n	<dt>Lifestyle Goal:</dt>\r\n	<dd>{$userProfile.lifestyleGoal|default:\"- Not Set - Click on the <i><b>Update my Profile</b></i> button toward the top of this page to set your goal\"}</dd>\r\n</dl>\r\n</blockquote>\r\n</td></tr>\r\n</table>\r\n\r\n<script type=\"text/javascript\">\r\n	function updateGraphLinks(s) {ldelim}\r\n		//s.replace(/\\[userId\\]/gi, \'{$userProfile.id}\'); \r\n		document.getElementById(\'graphLinksDiv\').innerHTML = s;\r\n	{rdelim}\r\n</script>'),(3878,202,0.78,'smarty','0','added small gif as heart rate monitor',1118363229,16,'216.194.127.150','{assign var=\"pgLayout\" value=\"layouts/withLeftNav.tpl\"}\r\n\r\n{if $smarty.request.showNewMenu eq \"true\"}\r\n<div class=\"rightSideMenu\">\r\n	<div class=\"rightMenuBox\">\r\n	<h3>EHC News</h3>\r\n		<div class=\"rightMenuItem\">\r\n		<span class=\"floatLeft iconNew\"></span>\r\n		<small><a href=\"#\">Portion Control Article in the nutrition corner. Click here to read</a></small>\r\n		</div>\r\n		<div class=\"rightMenuItem\">\r\n		<small><a href=\"#\">Learn more about carbohydrates and how they affect your body.</a></small>\r\n		</div>	\r\n	</div>\r\n	<div class=\"rightMenuBox\">\r\n	<h3>Product Highlight</h3>\r\n		<div class=\"rightMenuItem\">\r\n		<img src=\"{$skinFolder}images/rypReebokHRMonitor.jpg\" align=\"right\" class=\"img1\" alt=\"\" /><br />\r\n		<small><a href=\"#\">Heart Rate Monitors can help improve your exercise, click here to learn more.</a></small>\r\n		</div>\r\n	</div>\r\n	<div class=\"rightMenuBox\">\r\n	<h3>To Do List:</h3>\r\n		<div class=\"rightMenuItem\">\r\n		<small><a href=\"#\">Update your progress</a><br />\r\n		<a href=\"#\">Earn more incentive points</a><br />\r\n		<a href=\"#\">Check out the competition</a><br />\r\n		<a href=\"#\">Read New Articles</a></small>\r\n		</div>\r\n	</div>\r\n</div>\r\n{/if}\r\n\r\n{if $user->isLoggedIn()}\r\n	<img src=\"{$skinFolder}images/ehc/corporateBuilding_sm.jpg\" width=\"100\" height=\"131\" style=\"margin-right:10px; float:left; border:#CCC 1px solid;\" />\r\n\r\n	{include_php file=\"shared_handle:company/announcements\"}\r\n	<h2 class=\"uline\">Company Announcements:</h2>\r\n\r\n	<blockquote>\r\n		<dl>\r\n		{foreach from=$announcements item=\"current\"}\r\n			<dt><div style=\"float:right;\"><small><i>{$current.postedDate|date_format2:\"D, M j\"}</i></small></div>\r\n			    {$current.title}</dt>\r\n			<dd>{$current.description}</dd>\r\n		{foreachelse}\r\n			<dt>No announcements at this time</dt>\r\n		{/foreach}\r\n		</dl>\r\n	</blockquote>\r\n\r\n	{include_php file=\"shared_handle:company/companySurveyList\"}\r\n	<h2 class=\"uline\">Company Surveys:</h2>\r\n	<blockquote>\r\n	<table>\r\n	<tr><td colspan=\"2\">\r\n		<h3>Available Surveys:</h3></td>\r\n	    <td valign=\"middle\"></td></tr>\r\n	{foreach from=$surveys item=item name=\"loopSurveys\"}<tr><td nowrap>\r\n	<tr><td valign=\"top\" nowrap=\"nowrap\">\r\n		{if $item.dateAvailable gt 0}\r\n			<img class=\"icoSurvey\" src=\"blank.gif\" width=\"1\" height=\"1\" alt=\"\" border=\"0\" /></td>\r\n		   <td valign=\"top\"><b><u>{$item.surveyName}</u>:</b> {if $item.frequency eq \"Once\"}Taken{elseif (($item.dateAvailable - $smarty.now) < 43000)}<small>Available At:</small> {$item.dateAvailable|date_format2:\"g:i A\"}{else}<small>Available On:</small> {$item.dateAvailable|date_format2:\"m/d/y\"}{/if}<br />\r\n			{$item.feedbackTitle|default:\"No feedback available.\"}<br />\r\n			<a href=\"?pg=my_feedback&surveyId={$item.id}&amp;feedbackId={$item.feedbackId}\">Click here to learn more<b><i>!</i></b></a><br />\r\n			<br /></td>\r\n		   <td valign=\"middle\" align=\"right\"><em>{$item.pointsEarned}</em></td></tr>\r\n		{else}\r\n			<a href=\"javascript://\" onclick=\"openSurvey({$item.id});\"><img class=\"icoSurvey\" src=\"blank.gif\" width=\"1\" height=\"1\" alt=\"\" border=\"0\" /></a></td>\r\n		   <td valign=\"top\" nowrap=\"nowrap\"><b><u>{$item.surveyName}</u>:</b> <a href=\"javascript://\" onclick=\"openSurvey({$item.id});\">Available Now</a><br />\r\n			{$item.feedbackTitle|default:\"No feedback available.\"}<br />\r\n			<a href=\"?pg=my_feedback&surveyId={$item.id}&amp;feedbackId={$item.feedbackId}\">Click here to learn more<b><i>!</i></b></a><br />\r\n			<br /></td>\r\n		   <td valign=\"middle\" align=\"right\"><em>{$item.pointsEarned}</em></td></tr>\r\n		{/if}\r\n	{foreachelse}\r\n	<tr><td valign=\"top\" colspan=\"3\">\r\n		None found.</td></tr>\r\n	{/foreach}\r\n	</table>\r\n	</blockquote>\r\n\r\n	<h2 class=\"uline\">eHealthCompete Highlights:</h2>\r\n	\r\n	<table>\r\n	<tr><td valign=\"middle\">\r\n	<blockquote>\r\n	<dl>	\r\n		<dt>Pedometer Deal</dt>\r\n		<dd>eHealthCompete has just negotiated a great deal on RYP Pedometers.  If you have been looking to purchase a pedometer the eHealthCompete price and quality could be your best bet.  This deal is only available to members of EHC.</dd>\r\n		\r\n	</dl>\r\n	</blockquote></td>\r\n	<td valign=\"top\" align=\"center\">\r\n		<a href=\"?pg=my_shop&sub=&tma=VIEW&eids=9\">\r\n		<img id=\"pedometerDealImg\" src=\"blank.gif\" width=\"1\" height=\"1\" alt=\"\" border=\"0\" /><br />\r\n		Buy one now</a>\r\n	</td></tr></table>\r\n{else}\r\n	{assign var=\"hideLogin\" value=\"true\"}\r\n		<script language=\"JavaScript\">{literal}\r\n			function doForgotPassword(boxId, formName) {\r\n				if (!formName) formName = \'loginForm\';\r\n				if (!boxId) boxId = \'usernameBox\';\r\n\r\n				var df = document.forms[formName];\r\n				var obj = document.getElementById(boxId);\r\n		\r\n				if (obj.value == \'\') {\r\n					obj.value = prompt(\'Enter your username:\', \'\');\r\n				}\r\n				\r\n\r\n				df.forgotPassword.value = \'true\';\r\n				df.submit();	\r\n			}\r\n\r\n		{/literal}</script>\r\n	<table align=\"center\" width=\"305\" cellpadding=\"0\" cellspacing=\"0\">\r\n	<tr><td align=\"center\">\r\n		<h2>{$smarty.session.company.companyName}</h2>\r\n	</td></tr>\r\n	<tr><td>\r\n		<div align=\"center\" class=\"chunk300\">\r\n			<form name=\"loginForm2\" method=\"post\" action=\"index.php\" style=\"margin:3px;\">\r\n			<input type=\"hidden\" name=\"pg\" value=\"my_login\" />\r\n			<input type=\"hidden\" name=\"return\" value=\"{$smarty.request.return|default:$signup.return|default:\"home\"}\" />\r\n			<input type=\"hidden\" name=\"no_expire\" value=\"true\" />\r\n			<input type=\"hidden\" name=\"forgotPassword\" value=\"\" />\r\n		\r\n			<h2 class=\"withBG\">Log In:</h2>\r\n				Username: <input id=\"usernameBox2\" type=\"text\" name=\"username\" value=\"{$smarty.request.username}\" class=\"textInput\" size=\"12\" /><br />\r\n				Password: <input type=\"password\" name=\"password\" class=\"textInput\" size=\"12\" /><br />\r\n				<div class=\"underline\">&nbsp;</div>\r\n				<a href=\"javascript:document.forms[\'loginForm2\'].submit();\">Submit</a> | <a href=\"javascript:doForgotPassword(\'usernameBox2\', \'loginForm2\');\">Forgot Password?</a>\r\n				<input type=\"submit\" name=\"loginSubmit\" value=\"Submit\" style=\"position:absolute; top:-300px; left:-300px;\" />\r\n			</form>\r\n			<script language=\"javascript\">\r\n				document.forms.loginForm2.username.focus();\r\n			</script>\r\n		</div>\r\n	</td></tr>\r\n	<tr><td align=\"right\">\r\n		<br />\r\n		{if $smarty.session.company.companyName}\r\n			<small>Not registered yet?</small> <a href=\"?pg=signup/begin\">Sign Up Now!</a> &nbsp;\r\n		{else}\r\n			<!-- Place holder for sign up info content. -->\r\n		{/if}\r\n	</td></tr>\r\n	</table>\r\n{/if}'),(5156,195,0.82,'smarty','0','Testing graph links.',1159384172,16,'216.194.127.150','{if $smarty.session.company.preferences.hide_home eq \"yes\"}{include file=\"file:layouts/hiddenPageRedirector.tpl\"}{/if}\r\n{include file=\"layouts/forceLoggedIn.tpl\"}\r\n{include_php file=\"shared_handle:myHome\"}\r\n{include_php file=\"shared_handle:getProfile\"}\r\n{assign var=\"pgLayout\" value=\"layouts/withLeftNav.tpl\"}\r\n<h1>{$page.title} - {$userProfile.firstName} {$userProfile.lastName} ({$userProfile.username})</h1>\r\n\r\n{select_query return=\"row\" assign=\"aHRA\"}\r\n	dateTaken, pointsEarned FROM surveys_taken\r\n		WHERE userId = {$user->id}\r\n		AND surveyId = 8\r\n		ORDER BY dateTaken DESC\r\n		LIMIT 1\r\n{/select_query}\r\n\r\n<table width=\"700\">\r\n<tr>\r\n	<td>\r\n	<div id=\"statsContainer\" style=\"overflow:hidden;\">\r\n		<a name=\"updateStats\"></a>\r\n		<iframe name=\"profileUpdateFrame\" id=\"profileUpdateIFrame\" src=\"?pg=my_statistics/update&userId={$smarty.request.userId|default:$userProfile.id}\" frameborder=\"0\" width=\"700\" height=\"440\" scrolling=\"no\"></iframe>\r\n	</div>\r\n	</td>\r\n</tr>\r\n</table>\r\n\r\n<table width=\"700\">\r\n<tr><td>\r\n<h2 class=\"withBG\">\r\n	<div class=\"topRight hideShow\">\r\n		<a href=\"javascript:toggle(\'profileGraphTable\', \'\', \'showHide\');\"><img id=\"profileGraphTable_img\" src=\"blank.gif\" class=\"showHide_on\" alt=\"show/hide\" border=\"0\" /></a>\r\n	</div>User Profile &amp; Graphs</h2>\r\n</td></tr></table>\r\n\r\n<table id=\"profileGraphTable\" width=\"700\">\r\n<tr><td width=\"205\" valign=\"top\">\r\n	<div id=\"UserProfileColumn\" class=\"contentColumn\">\r\n	<h2 class=\"withBG\">Your Profile</h2>\r\n		<span class=\"cellHeadLarge\">Age:</span><span class=\"cellSmall\">{$userProfile.age|default:\"-\"}</span><br />\r\n		<span class=\"cellHeadLarge\">Height:</span><span class=\"cellSmall\">{$userProfile.heightFeet|default:\"-\"}\'{$userProfile.heightInches|default:\"-\"}&quot;</span><br />\r\n		<span class=\"cellHeadLarge\">Start BMI:</span><span class=\"cellSmall\">{$userProfile.startBMI|default:\"-\"}</span><br />\r\n		<span class=\"cellHeadLarge\">Start Weight:</span><span class=\"cellSmall\">{$userProfile.initialWeight|default:\"-\"}</span><br /><span class=\"cellHeadLarge\">Goal Weight:</span><span class=\"cellSmall\">{$userProfile.goalWeight|default:\"-\"}</span><br />\r\n		<span class=\"cellHeadLarge\">Current Weight:</span><span class=\"cellSmall\">{$userProfile.currentWeight|default:\"-\"}</span><br />\r\n		<span class=\"cellHeadLarge\">HRA Score:</span><span class=\"cellSmall\">{$aHRA.pointsEarned|default:\"-\"}</span><br />\r\n\r\n		<a href=\"?pg=my_profile\" class=\"link\"><img src=\"{$skinFolder}images/btn_profile.gif\" border=\"0\" alt=\"Update Profile\" vspace=\"10\" /></a><br />\r\n		<a href=\"?pg=my_settings\" class=\"link\"><img src=\"{$skinFolder}images/btn_settings.gif\" border=\"0\" alt=\"Account Settings\" vspace=\"0\" /></a>\r\n	</div>\r\n</td><td valign=\"top\" align=\"center\">	\r\n	<div id=\"graphContainer\">\r\n	<iframe name=\"graphwindow\" src=\"?pg=flashgraph-frame&compId={$compData.id}&format=small\" frameborder=\"0\" width=\"425\" height=\"240\" scrollbars=\"no\"></iframe></div>\r\n	{if true OR $user->username eq \"chad\" OR $user->username eq \"trave\"}\r\n	{include_php file=\"shared_handle:estats/getEstatsInfo\"}\r\n	<div id=\"graphLinksDiv\">\r\n		<table width=\"100%\">\r\n		<tr>\r\n			<td width=\"100%\" align=\"center\"><small>\r\n			{foreach from=$aEstats item=\"es\" name=\"loopEstats\"}\r\n				<a href=\"?pg=flashgraph-frame&format=small&userIds={$userProfile.id}&esId={$es.id}&type={$es.name|niceText|htmlspecialchars}&fillPrevious={if $es.assumeConstantValues eq \"yes\"}1{else}0{/if}&precision={$es.units.decimalPlaces|default:1}\" target=\"graphwindow\">{$es.name|niceText|replace:\" \":\"&nbsp;\"}</a> {if !$smarty.foreach.loopEstats.last}|{/if}\r\n			{foreachelse}\r\n				<b>No Available eStat Graphs</b>\r\n			{/foreach}\r\n			</small></td>\r\n		</tr>\r\n		</table>\r\n	</div>\r\n	{else} {* OLD GRAPH LISTINGS *}\r\n	<small>\r\n		<a href=\"?pg=flashgraph-frame&compId={$compData.id}&format=small&userIds={$userProfile.id}&type=weight&fillPrevious=1&precision=1&totalChange=1\" target=\"graphwindow\">Change in Weight</a> |\r\n		<a href=\"?pg=flashgraph-frame&compId={$compData.id}&format=small&userIds={$userProfile.id}&type=weight&fillPrevious=1&precision=1\" target=\"graphwindow\">Weight</a> |\r\n		<a href=\"?pg=flashgraph-frame&compId={$compData.id}&format=small&userIds={$userProfile.id}&type=fat&fillPrevious=0&precision=1\" target=\"graphwindow\">Fat Intake</a> |\r\n		<a href=\"?pg=flashgraph-frame&compId={$compData.id}&format=small&userIds={$userProfile.id}&type=calories&fillPrevious=0&precision=1\" target=\"graphwindow\">Calorie Intake</a> |\r\n		<a href=\"?pg=flashgraph-frame&compId={$compData.id}&format=small&userIds={$userProfile.id}&type=carbs&fillPrevious=0&precision=1\" target=\"graphwindow\">Carb Intake</a><br />\r\n		<a href=\"?pg=flashgraph-frame&compId={$compData.id}&format=small&userIds={$userProfile.id}&type=water&fillPrevious=0&precision=1\" target=\"graphwindow\">Water Intake</a> |\r\n		<a href=\"?pg=flashgraph-frame&compId={$compData.id}&format=small&userIds={$userProfile.id}&type=minutesExercise&fillPrevious=0&precision=1\" target=\"graphwindow\">Exercise Min</a> |\r\n		<a href=\"?pg=flashgraph-frame&compId={$compData.id}&format=small&userIds={$userProfile.id}&type=distanceExercised&fillPrevious=0&precision=1\" target=\"graphwindow\">Distance Exercised</a>\r\n	</small>\r\n	{/if}\r\n</td></tr>\r\n</table>\r\n<br />\r\n<table width=\"700\">\r\n<tr><td colspan=\"2\">\r\n<h2 class=\"withBG\">\r\n	<div class=\"topRight hideShow\">\r\n		<a href=\"javascript:toggle(\'goalsMottosBlock\', \'\', \'showHide\');\"><img id=\"goalsMottosBlock_img\" src=\"blank.gif\" class=\"showHide_on\" alt=\"show/hide\" border=\"0\" /></a>\r\n	</div>\r\n	Goals &amp; Mottos</h2>\r\n<blockquote id=\"goalsMottosBlock\" style=\"display:block;\">\r\n<dl>\r\n	<dt>Motto:</dt>\r\n	<dd>{$userProfile.personalSaying|default:\"- Not Set - <a href=\\\"http://partners.ehealthcompete.com/index.php?pg=my_profile\\\">Click here to update now</a>\"}</dd>\r\n	<dt>Nutrition Goal:</dt>\r\n	<dd>{$userProfile.nutritionGoal|default:\"- Not Set - <a href=\\\"http://partners.ehealthcompete.com/index.php?pg=my_profile\\\">Click here to update now</a>\"}</dd>\r\n	<dt>Fitness Goal:</dt>\r\n	<dd>{$userProfile.fitnessGoal|default:\"- Not Set - <a href=\\\"http://partners.ehealthcompete.com/index.php?pg=my_profile\\\">Click here to update now</a>\"}</dd>\r\n	<dt>Lifestyle Goal:</dt>\r\n	<dd>{$userProfile.lifestyleGoal|default:\"- Not Set - <a href=\\\"http://partners.ehealthcompete.com/index.php?pg=my_profile\\\">Click here to update now</a>\"}</dd>\r\n</dl>\r\n</blockquote>\r\n</td></tr>\r\n</table>\r\n\r\n<script type=\"text/javascript\">\r\n	function updateGraphLinks(s) {ldelim}\r\n		//s.replace(/\\[userId\\]/gi, \'{$userProfile.id}\'); \r\n		document.getElementById(\'graphLinksDiv\').innerHTML = s;\r\n	{rdelim}\r\n</script>'),(5264,195,0.84,'smarty','1','Testing graph links.',1207928025,16,'208.53.57.52','{if $smarty.session.company.preferences.hide_home eq \"yes\"}{include file=\"file:layouts/hiddenPageRedirector.tpl\"}{/if}\r\n{include file=\"layouts/forceLoggedIn.tpl\"}\r\n{include_php file=\"shared_handle:myHome\"}\r\n{include_php file=\"shared_handle:getProfile\"}\r\n{assign var=\"pgLayout\" value=\"layouts/withLeftNav.tpl\"}\r\n<h1>{$page.title} - {$userProfile.firstName} {$userProfile.lastName} ({$userProfile.username})</h1>\r\n\r\n{select_query return=\"row\" assign=\"aHRA\"}\r\n	dateTaken, pointsEarned FROM surveys_taken\r\n		WHERE userId = {$user->id}\r\n		AND surveyId = 8\r\n		ORDER BY dateTaken DESC\r\n		LIMIT 1\r\n{/select_query}\r\n\r\n<table width=\"700\">\r\n<tr>\r\n	<td>\r\n	<div id=\"statsContainer\" style=\"overflow:hidden;\">\r\n		<a name=\"updateStats\"></a>\r\n		<iframe name=\"profileUpdateFrame\" id=\"profileUpdateIFrame\" src=\"?pg=my_statistics/update&userId={$smarty.request.userId|default:$userProfile.id}\" frameborder=\"0\" width=\"700\" height=\"440\" scrolling=\"no\"></iframe>\r\n	</div>\r\n	</td>\r\n</tr>\r\n</table>\r\n\r\n<table width=\"700\">\r\n<tr><td>\r\n<h2 class=\"withBG\">\r\n	<div class=\"topRight hideShow\">\r\n		<a href=\"javascript:toggle(\'profileGraphTable\', \'\', \'showHide\');\"><img id=\"profileGraphTable_img\" src=\"blank.gif\" class=\"showHide_on\" alt=\"show/hide\" border=\"0\" /></a>\r\n	</div>User Profile &amp; Graphs</h2>\r\n</td></tr></table>\r\n\r\n<table id=\"profileGraphTable\" width=\"700\">\r\n<tr><td width=\"205\" valign=\"top\">\r\n	<div id=\"UserProfileColumn\" class=\"contentColumn\">\r\n	<h2 class=\"withBG\">Your Profile</h2>\r\n		<span class=\"cellHeadLarge\">Age:</span><span class=\"cellSmall\">{$userProfile.age|default:\"-\"}</span><br />\r\n		<span class=\"cellHeadLarge\">Height:</span><span class=\"cellSmall\">{$userProfile.heightFeet|default:\"-\"}\'{$userProfile.heightInches|default:\"-\"}&quot;</span><br />\r\n		<span class=\"cellHeadLarge\">Start BMI:</span><span class=\"cellSmall\">{$userProfile.startBMI|default:\"-\"}</span><br />\r\n		<span class=\"cellHeadLarge\">Start Weight:</span><span class=\"cellSmall\">{$userProfile.initialWeight|default:\"-\"}</span><br /><span class=\"cellHeadLarge\">Goal Weight:</span><span class=\"cellSmall\">{$userProfile.goalWeight|default:\"-\"}</span><br />\r\n		<span class=\"cellHeadLarge\">Current Weight:</span><span class=\"cellSmall\">{$userProfile.currentWeight|default:\"-\"}</span><br />\r\n		<span class=\"cellHeadLarge\">-----</span><span class=\"cellSmall\">{$aHRA.pointsEarned|default:\"-\"}</span><br />\r\n\r\n		<a href=\"?pg=my_profile\" class=\"link\"><img src=\"{$skinFolder}images/btn_profile.gif\" border=\"0\" alt=\"Update Profile\" vspace=\"10\" /></a><br />\r\n		<a href=\"?pg=my_settings\" class=\"link\"><img src=\"{$skinFolder}images/btn_settings.gif\" border=\"0\" alt=\"Account Settings\" vspace=\"0\" /></a>\r\n	</div>\r\n</td><td valign=\"top\" align=\"center\">	\r\n	<div id=\"graphContainer\">\r\n	<iframe name=\"graphwindow\" src=\"?pg=flashgraph-frame&compId={$compData.id}&format=small\" frameborder=\"0\" width=\"425\" height=\"240\" scrollbars=\"no\"></iframe></div>\r\n	{if true OR $user->username eq \"chad\" OR $user->username eq \"trave\"}\r\n	{include_php file=\"shared_handle:estats/getEstatsInfo\"}\r\n	<div id=\"graphLinksDiv\">\r\n		<table width=\"100%\">\r\n		<tr>\r\n			<td width=\"100%\" align=\"center\"><small>\r\n			{foreach from=$aEstats item=\"es\" name=\"loopEstats\"}\r\n				<a href=\"?pg=flashgraph-frame&format=small&userIds={$userProfile.id}&esId={$es.id}&type={$es.name|niceText|htmlspecialchars}&fillPrevious={if $es.assumeConstantValues eq \"yes\"}1{else}0{/if}&precision={$es.units.decimalPlaces|default:1}\" target=\"graphwindow\">{$es.name|niceText|replace:\" \":\"&nbsp;\"}</a> {if !$smarty.foreach.loopEstats.last}|{/if}\r\n			{foreachelse}\r\n				<b>No Available eStat Graphs</b>\r\n			{/foreach}\r\n			</small></td>\r\n		</tr>\r\n		</table>\r\n	</div>\r\n	{else} {* OLD GRAPH LISTINGS *}\r\n	<small>\r\n		<a href=\"?pg=flashgraph-frame&compId={$compData.id}&format=small&userIds={$userProfile.id}&type=weight&fillPrevious=1&precision=1&totalChange=1\" target=\"graphwindow\">Change in Weight</a> |\r\n		<a href=\"?pg=flashgraph-frame&compId={$compData.id}&format=small&userIds={$userProfile.id}&type=weight&fillPrevious=1&precision=1\" target=\"graphwindow\">Weight</a> |\r\n		<a href=\"?pg=flashgraph-frame&compId={$compData.id}&format=small&userIds={$userProfile.id}&type=fat&fillPrevious=0&precision=1\" target=\"graphwindow\">Fat Intake</a> |\r\n		<a href=\"?pg=flashgraph-frame&compId={$compData.id}&format=small&userIds={$userProfile.id}&type=calories&fillPrevious=0&precision=1\" target=\"graphwindow\">Calorie Intake</a> |\r\n		<a href=\"?pg=flashgraph-frame&compId={$compData.id}&format=small&userIds={$userProfile.id}&type=carbs&fillPrevious=0&precision=1\" target=\"graphwindow\">Carb Intake</a><br />\r\n		<a href=\"?pg=flashgraph-frame&compId={$compData.id}&format=small&userIds={$userProfile.id}&type=water&fillPrevious=0&precision=1\" target=\"graphwindow\">Water Intake</a> |\r\n		<a href=\"?pg=flashgraph-frame&compId={$compData.id}&format=small&userIds={$userProfile.id}&type=minutesExercise&fillPrevious=0&precision=1\" target=\"graphwindow\">Exercise Min</a> |\r\n		<a href=\"?pg=flashgraph-frame&compId={$compData.id}&format=small&userIds={$userProfile.id}&type=distanceExercised&fillPrevious=0&precision=1\" target=\"graphwindow\">Distance Exercised</a>\r\n	</small>\r\n	{/if}\r\n</td></tr>\r\n</table>\r\n<br />\r\n<table width=\"700\">\r\n<tr><td colspan=\"2\">\r\n<h2 class=\"withBG\">\r\n	<div class=\"topRight hideShow\">\r\n		<a href=\"javascript:toggle(\'goalsMottosBlock\', \'\', \'showHide\');\"><img id=\"goalsMottosBlock_img\" src=\"blank.gif\" class=\"showHide_on\" alt=\"show/hide\" border=\"0\" /></a>\r\n	</div>\r\n	Goals &amp; Mottos</h2>\r\n<blockquote id=\"goalsMottosBlock\" style=\"display:block;\">\r\n<dl>\r\n	<dt>Motto:</dt>\r\n	<dd>{$userProfile.personalSaying|default:\"- Not Set - <a href=\\\"http://partners.ehealthcompete.com/index.php?pg=my_profile\\\">Click here to update now</a>\"}</dd>\r\n	<dt>Nutrition Goal:</dt>\r\n	<dd>{$userProfile.nutritionGoal|default:\"- Not Set - <a href=\\\"http://partners.ehealthcompete.com/index.php?pg=my_profile\\\">Click here to update now</a>\"}</dd>\r\n	<dt>Fitness Goal:</dt>\r\n	<dd>{$userProfile.fitnessGoal|default:\"- Not Set - <a href=\\\"http://partners.ehealthcompete.com/index.php?pg=my_profile\\\">Click here to update now</a>\"}</dd>\r\n	<dt>Lifestyle Goal:</dt>\r\n	<dd>{$userProfile.lifestyleGoal|default:\"- Not Set - <a href=\\\"http://partners.ehealthcompete.com/index.php?pg=my_profile\\\">Click here to update now</a>\"}</dd>\r\n</dl>\r\n</blockquote>\r\n</td></tr>\r\n</table>\r\n\r\n<script type=\"text/javascript\">\r\n	function updateGraphLinks(s) {ldelim}\r\n		//s.replace(/\\[userId\\]/gi, \'{$userProfile.id}\'); \r\n		document.getElementById(\'graphLinksDiv\').innerHTML = s;\r\n	{rdelim}\r\n</script>'),(3557,222,0.20,'smarty','0','Page created.',1113336319,3,'24.10.217.227','{assign var=\"hideWidgets\" value=0}\r\n{assign var=\"hideUserBox\" value=\"false\"}\r\n{assign var=\"showCompanyNews\" value=\"true\"}\r\n{assign var=\"pgLayout\" value=\"layouts/withLeftNav.tpl\"}\r\n\r\n{include_php file=\"shared_handle:competition.load\"}\r\n{if $competition.userId eq $user->id or $acm->isDomainAdmin()}\r\n	{assign var=\"isManager\" value=\"true\"}\r\n	<!-- ismanager -->\r\n	{include_php file=\"shared_handle:competition.management\"}\r\n{/if}\r\n\r\n{include_php file=\"shared_handle:competition.verifyInitialPot\"}\r\n\r\n<table width=\"100%\" cellpadding=\"0\" cellspacing=\"0\" border=\"0\">\r\n	<tr>\r\n		<td valign=\"top\" width=\"260\">\r\n		<br />\r\n		<h2 class=\"withBG\">\r\n			<div class=\"topRight hideShow\">\r\n					<a href=\"javascript:toggle(\'leaderBoard\', \'\', \'showHide\');\"><img id=\"leaderBoard_img\" src=\"./img/blank.gif\" class=\"showHide_on\" alt=\"show/hide\" border=\"0\" /></a>\r\n				</div>\r\n			Leaders\r\n		</h2>\r\n		{if $competition.dateOfObject}<div align=\"right\"><small><i>as of {$competition.dateOfObject|date_format2:\"n/j/Y g:i A\"}</i></small></div>{/if}\r\n		<div id=\"leaderBoard\" style=\"display:block;\">\r\n		{if $competition.style eq \'Group-vs-Group\'}\r\n			<div style=\"white-space:nowrap;display:block;\">\r\n			<span class=\"cellHeadTiny\">#</span>\r\n			<span class=\"cellHeadBig\">Team</span>\r\n			<span class=\"cellHeadTiny\">{if $competition.scoringMethod eq \'Percentage Weight Lost\'}%\r\n					{elseif $competition.scoringMethod eq \'Weight Lost\' or $competition.scoringMethod eq \'Weight Gained\'}Lbs\r\n					{elseif $competition.scoringMethod eq \'Minutes Exercise\'}Min\r\n					{elseif $competition.scoringMethod eq \'Distance Exercised\'}Dist\r\n			{/if}</span>\r\n			<span class=\"cellHeadTiny\">#Pl</span>\r\n			</div>\r\n			{foreach name=\"rankLoop\" from=$competition.teams item=\"teams\" key=\"teamName\"}\r\n				{if $teams.name ne \"Waiting to Join\"}\r\n					{if not $teams.userCount}\r\n						{assign var=\"score\" value=\"-\"}\r\n					{elseif $competition.scoringMethod eq \'Percentage Weight Lost\'}\r\n						{assign var=\"score\" value=$teams.averagePercentLost|number_format:\"2\"|default:\"-\"}\r\n					{elseif $competition.scoringMethod eq \'Weight Lost\'}\r\n						{assign var=\"score\" value=$teams.averageWeightLost|number_format:\"2\"|default:\"-\"}\r\n					{elseif $competition.scoringMethod eq \'Weight Gained\'}\r\n						{assign var=\"score\" value=$teams.averageWeightGain|number_format:\"2\"|default:\"-\"}\r\n					{elseif $competition.scoringMethod eq \'Minutes Exercise\'}\r\n						{assign var=\"score\" value=$teams.averageExercise|number_format:\"2\"|default:\"-\"}\r\n					{elseif $competition.scoringMethod eq \'Distance Exercised\'}\r\n						{assign var=\"score\" value=$teams.averageDistance|number_format:\"2\"|default:\"-\"}\r\n					{/if}\r\n					<div style=\"white-space:nowrap;display:block;\">\r\n						<span class=\"cellTiny\" style=\"clear:left;\"><small>{$smarty.foreach.rankLoop.iteration}</small></span>\r\n						<span class=\"cellBig\"><small class=\"mini\">{$teams.name|default:\"&nbsp;\"}</small></span>\r\n						<span class=\"cellTiny\"><small>{$score|replace:\".00\":\"\"}</small></span>\r\n						<span class=\"cellTiny\"><small>{$teams.userCount|default:\"0\"}</small></span>\r\n					</div>\r\n				{/if}\r\n			{/foreach}\r\n		{else}\r\n			<div style=\"white-space:nowrap;display:block;\">\r\n			<span class=\"cellHeadTiny\">#</span>\r\n			<span class=\"cellHeadSmall\">Name</span>\r\n			<span class=\"cellHeadTiny\">{if $competition.scoringMethod eq \'Percentage Weight Lost\'}%\r\n					{elseif $competition.scoringMethod eq \'Weight Lost\' or $competition.scoringMethod eq \'Weight Gained\'}Lbs\r\n					{elseif $competition.scoringMethod eq \'Minutes Exercise\'}Min\r\n					{elseif $competition.scoringMethod eq \'Distance Exercised\'}Dist\r\n			{/if}</span>\r\n			<span class=\"cellHeadSmall\">Update</span>\r\n			</div>\r\n			{foreach from=$competition.users item=\"compUser\" key=\"username\" name=\"dateUpdated\"}\r\n			{if $smarty.foreach.dateUpdated.iteration eq 21}\r\n			</div>\r\n			<br />\r\n			<h2 class=\"withBG\">\r\n				<div class=\"topRight hideShow\">\r\n					<a href=\"javascript:toggle(\'runnerUps\', \'\', \'showHide\');\"><img id=\"runnerUps_img\" src=\"./img/blank.gif\" class=\"showHide_off\" alt=\"show/hide\" border=\"0\" /></a>\r\n				</div>\r\n				Runner Ups\r\n			</h2>\r\n			<div id=\"runnerUps\" style=\"display:none;\">\r\n			{/if}\r\n			<span class=\"cellTiny\" style=\"clear:left;\"><small>{$smarty.foreach.dateUpdated.iteration}</small></span>\r\n			<span class=\"cellSmall\"><small class=\"mini\">{$username}</small></span>\r\n			<span class=\"cellTiny\"><small>{if $scoringMethod eq \"Percentage Weight Lost\"}{$compUser.$scoringMethod|number_format:\"2\"|replace:\".00\":\"\"|default:\"-\"}{else}{$compUser.$scoringMethod|replace:\".00\":\"\"|default:\"-\"}{/if}</small></span>\r\n			<span class=\"cellSmall\"><small>{if $compUser.dateOfEntry}{$compUser.dateOfEntry|date_format2:\"n/j/y\"}{else}-Never-{/if}</small></span>\r\n			{/foreach}\r\n		{/if}\r\n		</div> \r\n		<div align=\"right\"><small><i><a href=\"?pg=faq#comp\">How is the competition scored?</a></i></small></div>\r\n		<img src=\"./img/blank.gif\" width=\"168\" height=\"1\" alt=\"\" />\r\n		{if $isManager}\r\n		<h2 class=\"withBG\">\r\n			<div class=\"topRight hideShow\">\r\n				<a href=\"javascript:toggle(\'managePlayers\', \'\', \'showHide\');\"><img id=\"managePlayers_img\" src=\"./img/blank.gif\" class=\"showHide_off\" alt=\"show/hide\" border=\"0\" /></a>\r\n			</div> \r\n			Manage\r\n		</h2>\r\n		<div id=\"managePlayers\" style=\"display:none;\">\r\n					<form name=\"managePlayers[]\" action=\"index.php\" method=\"POST\" style=\"margin:0px;\">\r\n					<input type=\"hidden\" name=\"pg\" value=\"{$page.name}\">\r\n					<input type=\"hidden\" name=\"cid\" value=\"{$competition.id}\">\r\n					<input type=\"hidden\" name=\"no_expire\" value=\"true\">\r\n					<input type=\"hidden\" name=\"style\" value=\"{$competition.style}\">\r\n							{if $competition.style eq \'Group-vs-Group\'}\r\n								<span class=\"cellHeadTiny\" style=\"clear:left;\">Del</span>\r\n								<span class=\"cellHead\">View Stats</span>\r\n								<span class=\"cellHeadSmall\">-</span><br />\r\n								{foreach from=$competition.teams item=\"teams\" key=\"teamName\"}\r\n									{foreach from=$teams.users item=\"users\" key=\"userName\"}\r\n										<span class=\"cellTiny\" style=\"clear:left;\"><small><input type=\"checkbox\" name=\"managePlayers[delete][]\" value=\"{$userName}\" style=\"width:14px; height:14px;margin:0px 2px;\"></small></span>\r\n										<span class=\"cell\"><small><a href=\"?pg=myhome&cid={$competition.id}&userId={$users.id}&hideComps=1\">{$userName}</a></small></span>\r\n										<span class=\"cellSmall\"><small><a href=\"mailto:{$users.email}\">email</a></small></span><br />\r\n									{/foreach}\r\n								{/foreach}\r\n							{else}\r\n								<span class=\"cellHeadTiny\" style=\"clear:left;\">Del</span>\r\n								<span class=\"cellHead\">View Stats</span>\r\n								<span class=\"cellHeadSmall\">-</span><br />\r\n								{foreach from=$competition.users item=\"compUser\" key=\"username\" name=\"dateUpdated\"}\r\n									<span class=\"cellTiny\" style=\"clear:left;\"><small><input type=\"checkbox\" name=\"managePlayers[delete][]\" value=\"{$username}\" style=\"width:14px;height:14px;margin:0px 2px;\"></small></span>\r\n									<span class=\"cell\"><small><a href=\"?pg=myhome&cid={$competition.id}&userId={$compUser.id}&hideComps=1\">{$username}</a></small></span>\r\n									<span class=\"cellSmall\"><small><a href=\"mailto:{$compUser.email}\">email</a></small></span><br />\r\n								{/foreach}\r\n							{/if}\r\n					<div style=\"text-align:center;\">\r\n                                                <br />\r\n						<input type=\"submit\" class=\"button\" value=\"Delete Selected\">\r\n					</div>\r\n					</form>\r\n		</div><br/>\r\n		{/if}\r\n		{* End new section for Player management. *}\r\n		\r\n		{* Begin new section for Team management.  This can be moved where ever. *}\r\n		{* ******************************** TEAM MANAGEMENT ***************************************** *}\r\n		{if $isManager and $competition.style eq \'Group-vs-Group\'}\r\n		<h2 class=\"withBG\">\r\n			<div class=\"topRight hideShow\">\r\n				<a href=\"javascript:toggle(\'teamManagement\', \'\', \'showHide\');\"><img id=\"teamManagement_img\" src=\"./img/blank.gif\" class=\"showHide_{if $smarty.request.showTeamManagement}on{else}off{/if}\" alt=\"show/hide\" border=\"0\" /></a>\r\n			</div>\r\n			Teams</h2>\r\n		<div id=\"teamManagement\" style=\"display:{if $smarty.request.showTeamManagement}block{else}none{/if};\">\r\n			<form name=\"manageTeam[]\" action=\"index.php\" method=\"POST\" style=\"margin:0px;\">\r\n			<input type=\"hidden\" name=\"pg\" value=\"{$page.name}\">\r\n			<input type=\"hidden\" name=\"cid\" value=\"{$competition.id}\">\r\n			<input type=\"hidden\" name=\"no_expire\" value=\"true\">\r\n			<div id=\"playersList{counter}\">\r\n				<span class=\"cellHeadTiny\">Del</span>\r\n				<span class=\"cellHeadLarge\" style=\"width:134px;\">Team Name</span><br />\r\n				{foreach from=$competition.teams item=\"teams\" key=\"teamName\"}\r\n					{counter name=\"counterI\" start=\"0\" print=0}\r\n					{if $teams.name ne \"Waiting to Join\"}\r\n						<span class=\"cellTiny\" style=\"clear:left;\"><small><input type=\"checkbox\" name=\"manageTeam[delete][]\" value=\"{$teams.name}\"></small></span>\r\n						<span class=\"cellLarge\" style=\"width:134px;\"><small><input id=\"renameTeam\" type=\"text\" value=\"{$teams.name}\" name=\"manageTeam[rename][{$teams.name}]\" size=\"10\" style=\"width:124px;height:12px\"></small></span><br />\r\n					{/if}\r\n				{/foreach}\r\n			</div>\r\n                        <br />\r\n			<div style=\"text-align:center;\">New Team: <input id=\"addTeam\" type=\"text\" name=\"manageTeam[addTeam]\" size=\"10\"><br />\r\n			<br />\r\n                        <input type=\"submit\" class=\"button\" value=\"Submit Changes\"></div>\r\n			</form>\r\n		</div><br />\r\n		{/if}\r\n		{* End new section for Team management. *}\r\n\r\n		\r\n		{if !$isManager AND $competition.users|@count lt 45}{include file=\"layouts/ads.tpl\"}{assign var=\"adsShown\" value=\"1\"}{/if}\r\n\r\n			<h2 class=\"withBG\">Competition Stats</h2>\r\n			<span class=\"cellHeadLarge\">Category</span><span class=\"cellHeadSmall\">Result</span><br />\r\n			<span class=\"cellLarge\"><small>start weight</small></span>\r\n			<span class=\"cellSmall\"><small>{$competition.groupStartWeight|default:0} lbs</small></span><br />\r\n			<span class=\"cellLarge\"><small>weight lost</small></span>\r\n			<span class=\"cellSmall\"><small>{$competition.groupWeightLost|default:0} lbs</small></span><br />\r\n			{if $competition.groupPercentageWeightLost gt 0}<span class=\"cellLarge\"><small>% lost</small></span>\r\n			<span class=\"cellSmall\"><small>{$competition.groupPercentageWeightLost|default:0|number_format:\"2\"}</small></span><br />{/if}\r\n			<span class=\"cellLarge\"><small>fat intake</small></span>\r\n			<span class=\"cellSmall\"><small>{$competition.groupFat|default:0}</small></span><br />\r\n			<span class=\"cellLarge\"><small>calorie intake</small></span>\r\n			<span class=\"cellSmall\"><small>{$competition.groupCalories|default:0}</small></span><br />\r\n			<span class=\"cellLarge\"><small>minutes exercised</small></span>\r\n			<span class=\"cellSmall\"><small>{$competition.groupExercise|default:0}</small></span><br />\r\n			<span class=\"cellLarge\"><small>miles exercised</small></span>\r\n			<span class=\"cellSmall\"><small>{$competition.groupDistanceExercised|default:0}</small></span><br />\r\n			<img src=\"./img/blank.gif\" width=\"165\" height=\"1\" alt=\"\" />\r\n		</td>\r\n		<td width=\"100%\" valign=\"top\">\r\n			<div id=\"contentBox\" class=\"centerBox\" style=\"margin-left:10px;\"><div class=\"topRightTreasure\">\r\n<div id=\"jackpot\">{if $competition.potAmount gt 0}${$competition.potAmount|number_format:2}{/if}</div>\r\n<h1 class=\"underline\">{$competition.title|default:\"Competition Title\"}</h1>\r\n\r\n{* ******************************** COMPETITION END *********************************** *}\r\n{if $competition.endDate lt $smarty.now}   {* COMPETITION IS OVER *}\r\n	{if $competition.results.winners|@count eq 1}\r\n		{* There was one winner, either by scoringMethod or tieBreakerMethod *}\r\n\r\n		{math assign=\"daysOfCompetition\" equation=\"(x - y) / z\" x=$competition.endDate|default:\"0\" y=$competition.startDate|default:\"0\" z=\"86400\"}\r\n		{math assign=\"marginOfVictory\" equation=\"x - y\" x=$competition.results.winningStat|default:\"0\" y=$competition.results.secondPlaceStat|default:\"0\"}\r\n\r\n		{foreach from=$competition.results.winners item=\"winnerName\"}    {*key=\"winnerName\"*}\r\n			{assign var=\"winnerData\" value=$competitions.users.$winnerName}\r\n			\r\n			{if $competition.style eq \"Group-vs-Group\"}\r\n				{assign var=\"description\" value=\"Winning Team\"}\r\n				{assign var=\"avg\" value=\"average\"}\r\n			{else}\r\n				{assign var=\"description\" value=\"Winner\"}\r\n			{/if}\r\n\r\n			<h2><br /><b>{$winnerName}</b> is the {$description}{if $competition.potAmount}, taking home <b>$<i>{$competition.potAmount|number_format:2}</i></b>{/if}!</h2>\r\n			<br />\r\n			{strip}\r\n			{if not $competition.results.isTie}   {* Not a Tie *}\r\n				After a difficult <b>{$daysOfCompetition|number_format:0}</b> days of \r\n				fierce competition, <b>{$winnerName}</b> is the \r\n				{$description}!	Based on \r\n				<b>{$competition.results.winningMethod}</b>, <b>{$winnerName}</b> \r\n				won with <b>{$competition.results.winningStat|number_format:2} \r\n				{if $competition.results.winningMethod eq \"Weight Lost\"}{$avg} pounds lost\r\n				{elseif $competition.results.winningMethod eq \"Percentage Weight Lost\"}{$avg} % body weight lost\r\n				{elseif $competition.results.winningMethod eq \"Minutes Exercise\"}{$avg} minutes exercised\r\n				{elseif $competition.results.winningMethod eq \"Distance Exercised\"}{$avg} miles exercised\r\n				{elseif $competition.results.winningMethod eq \"Weight Gained\"}{$avg} pounds gained\r\n				{/if}</b>.\r\n			{else}                                {* A Tie! *}\r\n				{assign var=\"weightLost\" value=\"Weight Lost\"}\r\n				{assign var=\"percentLost\" value=\"Percentage Weight Lost\"}\r\n\r\n				After a difficult <b>{$daysOfCompetition|number_format:0}</b> \r\n				days of fierce competition, there was a tie in the judging \r\n				method, <b>{$competition.scoringMethod}</b>. To break this \r\n				tie, the selected tie breaking method, \r\n				<b>{$competition.tieBreakerMethod}</b>, was used to determine \r\n				<b>{$winnerName}</b> as the {$description}. <b>{$winnerName}</b> \r\n				won with <b>{$competition.results.winningStat|number_format:2}\r\n				{if $competition.results.winningMethod eq \"Weight Lost\"}{$avg} pounds lost\r\n				{elseif $competition.results.winningMethod eq \"Percentage Weight Lost\"}{$avg} % body weight lost\r\n				{elseif $competition.results.winningMethod eq \"Minutes Exercise\"}{$avg} minutes exercised\r\n				{elseif $competition.results.winningMethod eq \"Distance Exercised\"}{$avg} miles exercised\r\n				{elseif $competition.results.winningMethod eq \"Weight Gained\"}{$avg} pounds gained\r\n				{/if}</b>.\r\n				<!--\r\n				<b>{$winnerData.$weightLost|number_format:0} pounds</b>, which \r\n				was <b>{$winnerData.$percentLost|number_format:4}%</b> body weight.\r\n				-->\r\n			{/if}\r\n			{/strip}\r\n			<br />\r\n			<br />\r\n			<b>{$winnerName}</b> won with a <b>{$marginOfVictory|number_format:3}</b> margin over <b>{$competition.results.secondPlaceUser}</b>.\r\n			\r\n			<h2><br />Congratulations to you all!</h2>\r\n			<br />\r\n			<div class=\"underline\"></div>\r\n		{/foreach}\r\n\r\n	{elseif $competition.results.winners|@count gt 1}\r\n		{* There were multiple winners, even after tieBreakerMethod (should RARELY happen) *}\r\n	\r\n		<h2>There was a tie in this competition. The winners, by <b>{$competition.results.winningMethod}</b> having lost <b>{$competition.results.winningStat}</b>, are:<br /></h2>\r\n		<ul>\r\n		{foreach from=$competition.results.winners item=\"winnerData\" key=\"winnerName\"}\r\n			<li>{$winnerName}</li>\r\n		{/foreach}\r\n		</ul>\r\n		\r\n	{else}\r\n		{* For some reason, there were no winners *}\r\n\r\n		<h2><br />\r\n		Winner information is currently unavailable.<br />\r\n		Please check back soon.\r\n		<br /><br /></h2>\r\n	{/if}\r\n	This competition has ended and is no longer active.<br />\r\n{/if}\r\n{* ************************************************************************************ *}\r\n\r\n<div id=\"prizeDesc\">{$competition.potDescription}<br />\r\n{if $competition.potAmount}<small style=\"color:#FFF;\">(${$competition.individualPotAmount} from {$competition.potMethod})</small>{/if}</div>\r\n\r\n{if $competition.startDate lt $smarty.now}\r\n	Time remaining: <b>{$competition.timeLeft}</b><br />\r\n{else}\r\n	This competition has not yet started!<br />\r\n{/if}\r\n\r\nStart{if $competition.startDate lt $smarty.now}ed{else}s{/if}: <b>{$competition.startDate|date_format2:\"n/j/Y\"}</b> &nbsp; \r\nEnd{if $competition.endDate lt $smarty.now}ed{else}s{/if}: <b>{$competition.endDate|date_format2:\"n/j/Y\"}</b><br />\r\n{if $competition.calculationMode neq \"Real-Time\"}Competition stats/scoring updated as of {$competition.dateOfObject|date_format2:\"n/j/Y g:i A\"}{if $isManager} (<a href=\"?pg=competition&cid={$smarty.request.cid}&nocache=1\">Update Now!</a>){/if}<br />{/if}\r\n<div style=\"font-size:5px;clear:left;\">&nbsp;</div>\r\n{assign var=\"scoringMethod\" value=$competition.scoringMethod}\r\n{assign var=\"tieBreakerMethod\" value=$competition.tieBreakerMethod}\r\n{assign var=\"weeklyWinnersMethod1\" value=$competition.weeklyWinnersMethod1}\r\n{assign var=\"weeklyWinnersMethod2\" value=$competition.weeklyWinnersMethod2}\r\n\r\n{* ******************** WEEKLY WINNERS ********************* *}\r\n{if $competition.weeklyWinners}\r\n	{if $weeklyWinnersMethod1}             {* DON\'T FORGET TO REMOVE THE ACM CHECK WHEN READY!!! *}\r\n		<h2 class=\"withBG\">\r\n			<div class=\"topRight hideShow\">\r\n			<a href=\"javascript:toggle(\'weeklyWinners\', \'\', \'showHide\');\"><img id=\"weeklyWinners_img\" src=\"./img/blank.gif\" class=\"showHide_on\" alt=\"show/hide\" border=\"0\" /></a></div>\r\n			Last Week\'s Winners<i>!</i> <small style=\"color:#000; font-size:11px;\">(<i><b>{$competition.weeklyWinners.startDate|date_format2:\"D n/j\"}</b> through <b>{$competition.weeklyWinners.endDate|date_format2:\"D n/j\"}</b></i>)</small></h2> \r\n		<div id=\"weeklyWinners\">\r\n		<table width=\"100%\" cellpadding=\"3\" cellspacing=\"0\"><tr>\r\n		<td valign=\"top\" width=\"50%\">\r\n		<div class=\"cellHeadLarge\" style=\"width:auto;float:none;\">{$weeklyWinnersMethod1}</div>\r\n		<img src=\"{$skinFolder}images/winner_1.gif\" style=\"float:left;\" />\r\n		{strip}\r\n		{foreach name=\"method1\" from=$competition.weeklyWinners.$weeklyWinnersMethod1 item=\"username\"}\r\n			{assign var=\"userValue\" value=$competition.weeklyWinners.users.$username.$weeklyWinnersMethod1}\r\n			{if $smarty.foreach.method1.iteration gt 3 OR $userValue lte 0}{if $smarty.foreach.method1.iteration eq 1}Don\'t forget to update your progress so there will be winners next week{/if}<i>!</i>{php}break;{/php}\r\n			{elseif $smarty.foreach.method1.iteration eq 1}\r\n				<b>{$username|default:\"[ ?? ]\"|ucfirst}</b> led the way last week by \r\n				{if $weeklyWinnersMethod1 eq \'Weight Lost\'}losing <b>{$userValue}</b> pounds{elseif $weeklyWinnersMethod1 eq \'Percentage Weight Lost\'}losing <b>{$userValue|number_format:\"2\"}%</b> body weight{elseif $weeklyWinnersMethod1 eq \'Minutes Exercise\'}exercising <b>{$userValue}</b> minutes{elseif $weeklyWinnersMethod1 eq \'Distance Exercised\'}exercising <b>{$userValue}</b> miles{elseif $weeklyWinnersMethod1 eq \'Weight Gained\'}gaining <b>{$userValue}</b> pounds{else}<b>default</b>{/if}\r\n			{else}\r\n				{if $smarty.foreach.method1.iteration eq 2}, followed by <b>{$username|default:\"[ ?? ]\"|ucfirst}</b> with \r\n				{else} and <b>{$username|default:\"[ ?? ]\"|ucfirst}</b> with \r\n				{/if}\r\n				{if $weeklyWinnersMethod1 eq \'Weight Lost\'}<b>{$userValue}</b> pounds{elseif $weeklyWinnersMethod1 eq \'Percentage Weight Lost\'}<b>{$userValue|number_format:\"2\"}%</b>{elseif $weeklyWinnersMethod1 eq \'Minutes Exercise\'}<b>{$userValue}</b> minutes{elseif $weeklyWinnersMethod1 eq \'Distance Exercised\'}<b>{$userValue}</b> miles{elseif $weeklyWinnersMethod1 eq \'Weight Gained\'}<b>{$userValue}</b> pounds{/if}\r\n			{/if}\r\n		{/foreach}\r\n		{/strip}\r\n		</td>\r\n	{/if}\r\n	{if $weeklyWinnersMethod2} \r\n		<td valign=\"top\" width=\"50%\">\r\n		<div class=\"cellHeadLarge\" style=\"width:auto;float:none;\">{$weeklyWinnersMethod2}</div>\r\n		<img src=\"{$skinFolder}images/winner_2.gif\" style=\"float:left;\" />\r\n		{* display var=$competition.weeklyWinners.users *}\r\n		{strip}\r\n		{foreach name=\"method2\" from=$competition.weeklyWinners.$weeklyWinnersMethod2 item=\"username\"}\r\n			{assign var=\"userValue\" value=$competition.weeklyWinners.users.$username.$weeklyWinnersMethod2}\r\n			\r\n			{if $smarty.foreach.method2.iteration gt 3 OR $userValue lte 0}{if $smarty.foreach.method2.iteration eq 1}Don\'t forget to update your progress so there will be winners next week{/if}<i>!</i>{php}break;{/php}\r\n			{elseif $smarty.foreach.method2.iteration eq 1}\r\n				<b>{$username|default:\"[ ?? ]\"|ucfirst}</b> won by \r\n				{if $weeklyWinnersMethod2 eq \'Weight Lost\'}losing <b>{$userValue}</b> pounds{elseif $weeklyWinnersMethod2 eq \'Percentage Weight Lost\'}losing <b>{$userValue|number_format:\"2\"}%</b> body weight{elseif $weeklyWinnersMethod2 eq \'Minutes Exercise\'}exercising <b>{$userValue}</b> minutes{elseif $weeklyWinnersMethod2 eq \'Distance Exercised\'}exercising <b>{$userValue}</b> miles{elseif $weeklyWinnersMethod2 eq \'Weight Gained\'}gaining <b>{$userValue}</b> pounds{/if}\r\n			{else}\r\n				{if $smarty.foreach.method2.iteration eq 2}, followed by <b>{$username|default:\"[ ?? ]\"|ucfirst}</b> with \r\n				{else} and <b>{$username|default:\"[ ?? ]\"|ucfirst}</b> with \r\n				{/if}\r\n				{if $weeklyWinnersMethod2 eq \'Weight Lost\'}<b>{$userValue}</b> pounds{elseif $weeklyWinnersMethod2 eq \'Percentage Weight Lost\'}<b>{$userValue|number_format:\"2\"}%</b>{elseif $weeklyWinnersMethod2 eq \'Minutes Exercise\'}<b>{$userValue}</b> minutes{elseif $weeklyWinnersMethod2 eq \'Distance Exercised\'}<b>{$userValue}</b> miles{elseif $weeklyWinnersMethod2 eq \'Weight Gained\'}<b>{$userValue}</b> pounds{/if}\r\n			{/if}\r\n		{/foreach}\r\n		{/strip}\r\n		</td>\r\n	{/if}\r\n	{if $weeklyWinnersMethod1}\r\n	</tr></table></div>{/if}\r\n{/if}\r\n{* ********************************************************* *}\r\n\r\n{if $acm->isDomainAdmin() and $smarty.request.debug}\r\n	{display var=$competition}\r\n{/if} \r\n\r\n{* ******************************** COMPARISON GRAPHS ***************************************** *}\r\n{if $competition.availableGraphs|@count}\r\n{include_php file=\"shared_handle:competition.graphs\"}\r\n<h2 class=\"withBG\"><a name=\"graph\"></a>\r\n	<div class=\"topRight hideShow\">\r\n		<a href=\"javascript:toggle(\'graphs\', \'\', \'showHide\');\"><img id=\"graphs_img\" src=\"./img/blank.gif\" class=\"showHide_on\" alt=\"show/hide\" border=\"0\" /></a></div> \r\n	Comparison Graphs &nbsp; <small><i>No graph? <a href=\"http://www.macromedia.com/shockwave/download/download.cgi?P1_Prod_Version=ShockwaveFlash\" target=\"_blank\">click here</a> to download the free Flash Player plug-in.</i></small></h2>\r\n<div id=\"graphs\" style=\"display:block;\">\r\n	<table border=\"0\" cellpadding=\"0\" width=\"100%\">\r\n		{assign var=\"graphURL\" value=\"?pg=flashgraph-frame&format=wide\"}\r\n	<tr>\r\n		<td><div style=\"border:#999 1px solid;background-color:#FFF;padding:5px;\"><iframe name=\"graphwindow\" src=\"{$graphURL}\" frameborder=\"0\" width=\"625\" height=\"222\" scrollbars=\"no\"></iframe></div></td>\r\n	</tr>\r\n	<tr>\r\n		<td valign=\"top\" align=\"center\" width=\"100%\">\r\n		<small>\r\n		{foreach name=\"graphTypes\" from=$competition.availableGraphs key=\"graphType\" item=\"graphParams\"}\r\n		<a href=\"?pg=flashgraph-frame&compId={$competition.id}&{$graphParams}\" target=\"graphwindow\">{$graphType}</a>{if $smarty.foreach.graphTypes.iteration neq $competition.availableGraphs|@count} | {/if}\r\n		{/foreach}\r\n		</small></td>\r\n	</tr>\r\n	</table>\r\n<br />\r\n</div>\r\n{/if}\r\n\r\n{* ******************************** GROUP TEAMS/PLAYERS SUMMARY W/MOVING ***************************************** *}\r\n{if $competition.style eq \'Group-vs-Group\'}\r\n<h2 class=\"withBG\">\r\n	<div class=\"topRight hideShow\">\r\n		<a href=\"javascript:toggle(\'teams\', \'\', \'showHide\');\"><img id=\"teams_img\" src=\"./img/blank.gif\" class=\"showHide_on\" alt=\"show/hide\" border=\"0\" /></a></div> \r\n	The Teams &nbsp; <small><i>Assignments and statistics</i></small></h2>\r\n<div id=\"teams\" style=\"display:block;\">\r\n<table cellpadding=\"0\" cellspacing=\"0\" width=\"100%\" border=\"0\"><tr><td>\r\n	{if $isManager}\r\n		<form name=\"changeTeam\" action=\"index.php\" method=\"POST\" style=\"margin:0px;\">\r\n			<input type=\"hidden\" name=\"pg\" value=\"{$page.name}\">\r\n			<input type=\"hidden\" name=\"cid\" value=\"{$competition.id}\">\r\n			<input type=\"hidden\" name=\"no_expire\" value=\"true\">\r\n	{/if}\r\n		{assign var=\"minEx\" value=\"Minutes Exercise\"}\r\n		{assign var=\"distEx\" value=\"Distance Exercised\"}\r\n		{assign var=\"pctLst\" value=\"Percentage Weight Lost\"}\r\n		{assign var=\"wtLst\" value=\"Percentage Weight Lost\"}\r\n		{foreach from=$competition.teams name=\"teamsLoop\" item=\"teams\" key=\"teamName\"}\r\n			<div id=\"playersList{$smarty.foreach.teamsLoop.iteration}\" style=\"float:left;width:310px;overflow:hidden;word-wrap:nowrap; margin:0px 5px 5px 0px;\">\r\n			<h4>{if $teams.name eq \"Waiting to Join\"}Not assigned to a team{else}{$teams.name|default:\"&nbsp;\"}{/if}</h4>\r\n		{if $scoringMethod|regex_match:\"/exercise/i\"}\r\n			<span class=\"cellHeadLarge\">Name</span>\r\n			<span class=\"cellHeadSmall\">Min.</span>\r\n			<span class=\"cellHeadSmall\">Dist.</span>\r\n			<span class=\"cellHeadSmall\">Update</span><br />\r\n			{foreach from=$teams.users item=\"users\" key=\"userName\"}\r\n				<span class=\"cellLarge\" style=\"text-align:left;\"><small>{if $isManager}<input type=\"checkbox\" name=\"changeTeam[players][{$userName}]\" style=\"width:14px;height:14px;margin:0px 2px;\" />{/if}{$userName}</small></span>\r\n				<span class=\"cellSmall\"><small>{$users.$minEx|default:\"-\"|replace:\".00\":\"\"}</small></span>\r\n				<span class=\"cellSmall\"><small>{$users.$distEx|default:\"-\"|replace:\".00\":\"\"}</small></span>\r\n				<span class=\"cellSmall\"><small>{if $users.dateOfEntry}{$users.dateOfEntry|date_format2:\"n/j/y\"}{else}Never{/if}</small></span>\r\n			{foreachelse}\r\n				{* No players assigned to this team. *}\r\n			{/foreach}\r\n		{else}\r\n			<span class=\"cellHeadLarge\">Name</span>\r\n			<span class=\"cellHeadTiny\">%</span>\r\n			<span class=\"cellHeadSmall\">Update</span><br />\r\n			{foreach from=$teams.users item=\"users\" key=\"userName\"}\r\n				<span class=\"cellLarge\" style=\"clear:left;text-align:left;\"><small>{if $isManager}<input type=\"checkbox\" name=\"changeTeam[players][{$userName}]\" />{/if}{$userName}</small></span>\r\n				<span class=\"cellTiny\"><small>{if $users.hideInitialWeight neq \"Yes\"}{$users.$pctLst|number_format:\"2\"|replace:\".00\":\"\"}{else}-{/if}</small></span>\r\n				<span class=\"cellSmall\"><small>{if $users.dateOfEntry}{$users.dateOfEntry|date_format2:\"n/j/y\"}{else}Never{/if}</small></span><br />\r\n			{foreachelse}\r\n				{* No players assigned to this team. *}\r\n			{/foreach}\r\n		{/if}\r\n			</div>\r\n		{/foreach}\r\n	{if $isManager}\r\n		<br />\r\n		<select name=\"changeTeam[team]\">\r\n			<option value=\"\">Move selected players to...</option>\r\n			{foreach from=$competition.teams item=\"newTeams\" key=\"newTeamName\"}\r\n				{*if $newTeams.name ne $teams.name and $newTeams.name ne \"Waiting to Join\"*}\r\n				{if $newTeams.name ne \"Waiting to Join\"}\r\n					<option value=\"{$newTeams.name}\">{$newTeams.name}</option>\r\n				{/if}\r\n			{/foreach}\r\n		</select><br />\r\n		<input type=\"submit\" class=\"button\" value=\"Submit Changes\">\r\n		</form>\r\n	{/if}\r\n</td></tr></table>\r\n</div>\r\n{/if}\r\n</div>\r\n	{* ******************************** DISCUSSION BOARD ***************************************** *}\r\n<br />\r\n<h2 class=\"withBG\">\r\n	<div class=\"topRight hideShow\">\r\n		<a href=\"javascript:toggle(\'discuss\', \'\', \'showHide\');\"><img id=\"discuss_img\" src=\"./img/blank.gif\" class=\"showHide_on\" alt=\"show/hide\" border=\"0\" /></a></div> \r\n	Discussion Board</h2>\r\n<div id=\"discuss\" style=\"display:block;\">\r\n	<table cellpadding=\"0\" width=\"100%\" border=\"0\"><tr><td><iframe src=\"?pg=competition/forum\" id=\"discussionBoard\" frameborder=\"0\" scrolling=\"yes\" style=\"width:100%;\"></iframe></td></tr></table>\r\n</div>\r\n\r\n</div></td>\r\n</tr></table>'),(3558,222,0.21,'smarty','0','Page created.',1113336814,3,'24.10.217.227','{assign var=\"hideWidgets\" value=0}\r\n{assign var=\"hideUserBox\" value=\"false\"}\r\n{assign var=\"showCompanyNews\" value=\"true\"}\r\n{assign var=\"pgLayout\" value=\"layouts/withLeftNav.tpl\"}\r\n\r\n{include_php file=\"shared_handle:competition.load\"}\r\n{if $competition.userId eq $user->id or $acm->isDomainAdmin()}\r\n	{assign var=\"isManager\" value=\"true\"}\r\n	<!-- ismanager -->\r\n	{include_php file=\"shared_handle:competition.management\"}\r\n{/if}\r\n\r\n{include_php file=\"shared_handle:competition.verifyInitialPot\"}\r\n\r\n<table width=\"100%\" cellpadding=\"0\" cellspacing=\"0\" border=\"0\">\r\n	<tr>\r\n		<td valign=\"top\" width=\"260\">\r\n		<br />\r\n		<h2 class=\"withBG\">\r\n			<div class=\"topRight hideShow\">\r\n					<a href=\"javascript:toggle(\'leaderBoard\', \'\', \'showHide\');\"><img id=\"leaderBoard_img\" src=\"./img/blank.gif\" class=\"showHide_on\" alt=\"show/hide\" border=\"0\" /></a>\r\n				</div>\r\n			Leaders\r\n		</h2>\r\n		{if $competition.dateOfObject}<div align=\"right\"><small><i>as of {$competition.dateOfObject|date_format2:\"n/j/Y g:i A\"}</i></small></div>{/if}\r\n		<div id=\"leaderBoard\" style=\"display:block;\">\r\n		{if $competition.style eq \'Group-vs-Group\'}\r\n			<div style=\"white-space:nowrap;display:block;\">\r\n			<span class=\"cellHeadTiny\">#</span>\r\n			<span class=\"cellHeadBig\">Team</span>\r\n			<span class=\"cellHeadTiny\">{if $competition.scoringMethod eq \'Percentage Weight Lost\'}%\r\n					{elseif $competition.scoringMethod eq \'Weight Lost\' or $competition.scoringMethod eq \'Weight Gained\'}Lbs\r\n					{elseif $competition.scoringMethod eq \'Minutes Exercise\'}Min\r\n					{elseif $competition.scoringMethod eq \'Distance Exercised\'}Dist\r\n			{/if}</span>\r\n			<span class=\"cellHeadTiny\">#Pl</span>\r\n			</div>\r\n			{foreach name=\"rankLoop\" from=$competition.teams item=\"teams\" key=\"teamName\"}\r\n				{if $teams.name ne \"Waiting to Join\"}\r\n					{if not $teams.userCount}\r\n						{assign var=\"score\" value=\"~\"}\r\n					{elseif $competition.scoringMethod eq \'Percentage Weight Lost\'}\r\n						{assign var=\"score\" value=$teams.averagePercentLost|number_format:\"2\"|default:\"-\"}\r\n					{elseif $competition.scoringMethod eq \'Weight Lost\'}\r\n						{assign var=\"score\" value=$teams.averageWeightLost|number_format:\"2\"|default:\"-\"}\r\n					{elseif $competition.scoringMethod eq \'Weight Gained\'}\r\n						{assign var=\"score\" value=$teams.averageWeightGain|number_format:\"2\"|default:\"-\"}\r\n					{elseif $competition.scoringMethod eq \'Minutes Exercise\'}\r\n						{assign var=\"score\" value=$teams.averageExercise|number_format:\"2\"|default:\"-\"}\r\n					{elseif $competition.scoringMethod eq \'Distance Exercised\'}\r\n						{assign var=\"score\" value=$teams.averageDistance|number_format:\"2\"|default:\"-\"}\r\n					{/if}\r\n					<div style=\"white-space:nowrap;display:block;\">\r\n						<span class=\"cellTiny\" style=\"clear:left;\"><small>{$smarty.foreach.rankLoop.iteration}</small></span>\r\n						<span class=\"cellBig\"><small class=\"mini\">{$teams.name|default:\"&nbsp;\"}</small></span>\r\n						<span class=\"cellTiny\"><small>{$score|replace:\".00\":\"\"}</small></span>\r\n						<span class=\"cellTiny\"><small>{$teams.userCount|default:\"0\"}</small></span>\r\n					</div>\r\n				{/if}\r\n			{/foreach}\r\n		{else}\r\n			<div style=\"white-space:nowrap;display:block;\">\r\n			<span class=\"cellHeadTiny\">#</span>\r\n			<span class=\"cellHeadSmall\">Name</span>\r\n			<span class=\"cellHeadTiny\">{if $competition.scoringMethod eq \'Percentage Weight Lost\'}%\r\n					{elseif $competition.scoringMethod eq \'Weight Lost\' or $competition.scoringMethod eq \'Weight Gained\'}Lbs\r\n					{elseif $competition.scoringMethod eq \'Minutes Exercise\'}Min\r\n					{elseif $competition.scoringMethod eq \'Distance Exercised\'}Dist\r\n			{/if}</span>\r\n			<span class=\"cellHeadSmall\">Update</span>\r\n			</div>\r\n			{foreach from=$competition.users item=\"compUser\" key=\"username\" name=\"dateUpdated\"}\r\n			{if $smarty.foreach.dateUpdated.iteration eq 21}\r\n			</div>\r\n			<br />\r\n			<h2 class=\"withBG\">\r\n				<div class=\"topRight hideShow\">\r\n					<a href=\"javascript:toggle(\'runnerUps\', \'\', \'showHide\');\"><img id=\"runnerUps_img\" src=\"./img/blank.gif\" class=\"showHide_off\" alt=\"show/hide\" border=\"0\" /></a>\r\n				</div>\r\n				Runner Ups\r\n			</h2>\r\n			<div id=\"runnerUps\" style=\"display:none;\">\r\n			{/if}\r\n			<span class=\"cellTiny\" style=\"clear:left;\"><small>{$smarty.foreach.dateUpdated.iteration}</small></span>\r\n			<span class=\"cellSmall\"><small class=\"mini\">{$username}</small></span>\r\n			<span class=\"cellTiny\"><small>{if $scoringMethod eq \"Percentage Weight Lost\"}{$compUser.$scoringMethod|number_format:\"2\"|replace:\".00\":\"\"|default:\"-\"}{else}{$compUser.$scoringMethod|replace:\".00\":\"\"|default:\"-\"}{/if}</small></span>\r\n			<span class=\"cellSmall\"><small>{if $compUser.dateOfEntry}{$compUser.dateOfEntry|date_format2:\"n/j/y\"}{else}-Never-{/if}</small></span>\r\n			{/foreach}\r\n		{/if}\r\n		</div> \r\n		<div align=\"right\"><small><i><a href=\"?pg=faq#comp\">How is the competition scored?</a></i></small></div>\r\n		<img src=\"./img/blank.gif\" width=\"168\" height=\"1\" alt=\"\" />\r\n		{if $isManager}\r\n		<h2 class=\"withBG\">\r\n			<div class=\"topRight hideShow\">\r\n				<a href=\"javascript:toggle(\'managePlayers\', \'\', \'showHide\');\"><img id=\"managePlayers_img\" src=\"./img/blank.gif\" class=\"showHide_off\" alt=\"show/hide\" border=\"0\" /></a>\r\n			</div> \r\n			Manage\r\n		</h2>\r\n		<div id=\"managePlayers\" style=\"display:none;\">\r\n					<form name=\"managePlayers[]\" action=\"index.php\" method=\"POST\" style=\"margin:0px;\">\r\n					<input type=\"hidden\" name=\"pg\" value=\"{$page.name}\">\r\n					<input type=\"hidden\" name=\"cid\" value=\"{$competition.id}\">\r\n					<input type=\"hidden\" name=\"no_expire\" value=\"true\">\r\n					<input type=\"hidden\" name=\"style\" value=\"{$competition.style}\">\r\n							{if $competition.style eq \'Group-vs-Group\'}\r\n								<span class=\"cellHeadTiny\" style=\"clear:left;\">Del</span>\r\n								<span class=\"cellHead\">View Stats</span>\r\n								<span class=\"cellHeadSmall\">-</span><br />\r\n								{foreach from=$competition.teams item=\"teams\" key=\"teamName\"}\r\n									{foreach from=$teams.users item=\"users\" key=\"userName\"}\r\n										<span class=\"cellTiny\" style=\"clear:left;\"><small><input type=\"checkbox\" name=\"managePlayers[delete][]\" value=\"{$userName}\" style=\"width:14px; height:14px;margin:0px 2px;\"></small></span>\r\n										<span class=\"cell\"><small><a href=\"?pg=myhome&cid={$competition.id}&userId={$users.id}&hideComps=1\">{$userName}</a></small></span>\r\n										<span class=\"cellSmall\"><small><a href=\"mailto:{$users.email}\">email</a></small></span><br />\r\n									{/foreach}\r\n								{/foreach}\r\n							{else}\r\n								<span class=\"cellHeadTiny\" style=\"clear:left;\">Del</span>\r\n								<span class=\"cellHead\">View Stats</span>\r\n								<span class=\"cellHeadSmall\">-</span><br />\r\n								{foreach from=$competition.users item=\"compUser\" key=\"username\" name=\"dateUpdated\"}\r\n									<span class=\"cellTiny\" style=\"clear:left;\"><small><input type=\"checkbox\" name=\"managePlayers[delete][]\" value=\"{$username}\" style=\"width:14px;height:14px;margin:0px 2px;\"></small></span>\r\n									<span class=\"cell\"><small><a href=\"?pg=myhome&cid={$competition.id}&userId={$compUser.id}&hideComps=1\">{$username}</a></small></span>\r\n									<span class=\"cellSmall\"><small><a href=\"mailto:{$compUser.email}\">email</a></small></span><br />\r\n								{/foreach}\r\n							{/if}\r\n					<div style=\"text-align:center;\">\r\n                                                <br />\r\n						<input type=\"submit\" class=\"button\" value=\"Delete Selected\">\r\n					</div>\r\n					</form>\r\n		</div><br/>\r\n		{/if}\r\n		{* End new section for Player management. *}\r\n		\r\n		{* Begin new section for Team management.  This can be moved where ever. *}\r\n		{* ******************************** TEAM MANAGEMENT ***************************************** *}\r\n		{if $isManager and $competition.style eq \'Group-vs-Group\'}\r\n		<h2 class=\"withBG\">\r\n			<div class=\"topRight hideShow\">\r\n				<a href=\"javascript:toggle(\'teamManagement\', \'\', \'showHide\');\"><img id=\"teamManagement_img\" src=\"./img/blank.gif\" class=\"showHide_{if $smarty.request.showTeamManagement}on{else}off{/if}\" alt=\"show/hide\" border=\"0\" /></a>\r\n			</div>\r\n			Teams</h2>\r\n		<div id=\"teamManagement\" style=\"display:{if $smarty.request.showTeamManagement}block{else}none{/if};\">\r\n			<form name=\"manageTeam[]\" action=\"index.php\" method=\"POST\" style=\"margin:0px;\">\r\n			<input type=\"hidden\" name=\"pg\" value=\"{$page.name}\">\r\n			<input type=\"hidden\" name=\"cid\" value=\"{$competition.id}\">\r\n			<input type=\"hidden\" name=\"no_expire\" value=\"true\">\r\n			<div id=\"playersList{counter}\">\r\n				<span class=\"cellHeadTiny\">Del</span>\r\n				<span class=\"cellHeadLarge\" style=\"width:134px;\">Team Name</span><br />\r\n				{foreach from=$competition.teams item=\"teams\" key=\"teamName\"}\r\n					{counter name=\"counterI\" start=\"0\" print=0}\r\n					{if $teams.name ne \"Waiting to Join\"}\r\n						<span class=\"cellTiny\" style=\"clear:left;\"><small><input type=\"checkbox\" name=\"manageTeam[delete][]\" value=\"{$teams.name}\"></small></span>\r\n						<span class=\"cellLarge\" style=\"width:134px;\"><small><input id=\"renameTeam\" type=\"text\" value=\"{$teams.name}\" name=\"manageTeam[rename][{$teams.name}]\" size=\"10\" style=\"width:124px;height:12px\"></small></span><br />\r\n					{/if}\r\n				{/foreach}\r\n			</div>\r\n                        <br />\r\n			<div style=\"text-align:center;\">New Team: <input id=\"addTeam\" type=\"text\" name=\"manageTeam[addTeam]\" size=\"10\"><br />\r\n			<br />\r\n                        <input type=\"submit\" class=\"button\" value=\"Submit Changes\"></div>\r\n			</form>\r\n		</div><br />\r\n		{/if}\r\n		{* End new section for Team management. *}\r\n\r\n		\r\n		{if !$isManager AND $competition.users|@count lt 45}{include file=\"layouts/ads.tpl\"}{assign var=\"adsShown\" value=\"1\"}{/if}\r\n\r\n			<h2 class=\"withBG\">Competition Stats</h2>\r\n			<span class=\"cellHeadLarge\">Category</span><span class=\"cellHeadSmall\">Result</span><br />\r\n			<span class=\"cellLarge\"><small>start weight</small></span>\r\n			<span class=\"cellSmall\"><small>{$competition.groupStartWeight|default:0} lbs</small></span><br />\r\n			<span class=\"cellLarge\"><small>weight lost</small></span>\r\n			<span class=\"cellSmall\"><small>{$competition.groupWeightLost|default:0} lbs</small></span><br />\r\n			{if $competition.groupPercentageWeightLost gt 0}<span class=\"cellLarge\"><small>% lost</small></span>\r\n			<span class=\"cellSmall\"><small>{$competition.groupPercentageWeightLost|default:0|number_format:\"2\"}</small></span><br />{/if}\r\n			<span class=\"cellLarge\"><small>fat intake</small></span>\r\n			<span class=\"cellSmall\"><small>{$competition.groupFat|default:0}</small></span><br />\r\n			<span class=\"cellLarge\"><small>calorie intake</small></span>\r\n			<span class=\"cellSmall\"><small>{$competition.groupCalories|default:0}</small></span><br />\r\n			<span class=\"cellLarge\"><small>minutes exercised</small></span>\r\n			<span class=\"cellSmall\"><small>{$competition.groupExercise|default:0}</small></span><br />\r\n			<span class=\"cellLarge\"><small>miles exercised</small></span>\r\n			<span class=\"cellSmall\"><small>{$competition.groupDistanceExercised|default:0}</small></span><br />\r\n			<img src=\"./img/blank.gif\" width=\"165\" height=\"1\" alt=\"\" />\r\n		</td>\r\n		<td width=\"100%\" valign=\"top\">\r\n			<div id=\"contentBox\" class=\"centerBox\" style=\"margin-left:10px;\"><div class=\"topRightTreasure\">\r\n<div id=\"jackpot\">{if $competition.potAmount gt 0}${$competition.potAmount|number_format:2}{/if}</div>\r\n<h1 class=\"underline\">{$competition.title|default:\"Competition Title\"}</h1>\r\n\r\n{* ******************************** COMPETITION END *********************************** *}\r\n{if $competition.endDate lt $smarty.now}   {* COMPETITION IS OVER *}\r\n	{if $competition.results.winners|@count eq 1}\r\n		{* There was one winner, either by scoringMethod or tieBreakerMethod *}\r\n\r\n		{math assign=\"daysOfCompetition\" equation=\"(x - y) / z\" x=$competition.endDate|default:\"0\" y=$competition.startDate|default:\"0\" z=\"86400\"}\r\n		{math assign=\"marginOfVictory\" equation=\"x - y\" x=$competition.results.winningStat|default:\"0\" y=$competition.results.secondPlaceStat|default:\"0\"}\r\n\r\n		{foreach from=$competition.results.winners item=\"winnerName\"}    {*key=\"winnerName\"*}\r\n			{assign var=\"winnerData\" value=$competitions.users.$winnerName}\r\n			\r\n			{if $competition.style eq \"Group-vs-Group\"}\r\n				{assign var=\"description\" value=\"Winning Team\"}\r\n				{assign var=\"avg\" value=\"average\"}\r\n			{else}\r\n				{assign var=\"description\" value=\"Winner\"}\r\n			{/if}\r\n\r\n			<h2><br /><b>{$winnerName}</b> is the {$description}{if $competition.potAmount}, taking home <b>$<i>{$competition.potAmount|number_format:2}</i></b>{/if}!</h2>\r\n			<br />\r\n			{strip}\r\n			{if not $competition.results.isTie}   {* Not a Tie *}\r\n				After a difficult <b>{$daysOfCompetition|number_format:0}</b> days of \r\n				fierce competition, <b>{$winnerName}</b> is the \r\n				{$description}!	Based on \r\n				<b>{$competition.results.winningMethod}</b>, <b>{$winnerName}</b> \r\n				won with <b>{$competition.results.winningStat|number_format:2} \r\n				{if $competition.results.winningMethod eq \"Weight Lost\"}{$avg} pounds lost\r\n				{elseif $competition.results.winningMethod eq \"Percentage Weight Lost\"}{$avg} % body weight lost\r\n				{elseif $competition.results.winningMethod eq \"Minutes Exercise\"}{$avg} minutes exercised\r\n				{elseif $competition.results.winningMethod eq \"Distance Exercised\"}{$avg} miles exercised\r\n				{elseif $competition.results.winningMethod eq \"Weight Gained\"}{$avg} pounds gained\r\n				{/if}</b>.\r\n			{else}                                {* A Tie! *}\r\n				{assign var=\"weightLost\" value=\"Weight Lost\"}\r\n				{assign var=\"percentLost\" value=\"Percentage Weight Lost\"}\r\n\r\n				After a difficult <b>{$daysOfCompetition|number_format:0}</b> \r\n				days of fierce competition, there was a tie in the judging \r\n				method, <b>{$competition.scoringMethod}</b>. To break this \r\n				tie, the selected tie breaking method, \r\n				<b>{$competition.tieBreakerMethod}</b>, was used to determine \r\n				<b>{$winnerName}</b> as the {$description}. <b>{$winnerName}</b> \r\n				won with <b>{$competition.results.winningStat|number_format:2}\r\n				{if $competition.results.winningMethod eq \"Weight Lost\"}{$avg} pounds lost\r\n				{elseif $competition.results.winningMethod eq \"Percentage Weight Lost\"}{$avg} % body weight lost\r\n				{elseif $competition.results.winningMethod eq \"Minutes Exercise\"}{$avg} minutes exercised\r\n				{elseif $competition.results.winningMethod eq \"Distance Exercised\"}{$avg} miles exercised\r\n				{elseif $competition.results.winningMethod eq \"Weight Gained\"}{$avg} pounds gained\r\n				{/if}</b>.\r\n				<!--\r\n				<b>{$winnerData.$weightLost|number_format:0} pounds</b>, which \r\n				was <b>{$winnerData.$percentLost|number_format:4}%</b> body weight.\r\n				-->\r\n			{/if}\r\n			{/strip}\r\n			<br />\r\n			<br />\r\n			<b>{$winnerName}</b> won with a <b>{$marginOfVictory|number_format:3}</b> margin over <b>{$competition.results.secondPlaceUser}</b>.\r\n			\r\n			<h2><br />Congratulations to you all!</h2>\r\n			<br />\r\n			<div class=\"underline\"></div>\r\n		{/foreach}\r\n\r\n	{elseif $competition.results.winners|@count gt 1}\r\n		{* There were multiple winners, even after tieBreakerMethod (should RARELY happen) *}\r\n	\r\n		<h2>There was a tie in this competition. The winners, by <b>{$competition.results.winningMethod}</b> having lost <b>{$competition.results.winningStat}</b>, are:<br /></h2>\r\n		<ul>\r\n		{foreach from=$competition.results.winners item=\"winnerData\" key=\"winnerName\"}\r\n			<li>{$winnerName}</li>\r\n		{/foreach}\r\n		</ul>\r\n		\r\n	{else}\r\n		{* For some reason, there were no winners *}\r\n\r\n		<h2><br />\r\n		Winner information is currently unavailable.<br />\r\n		Please check back soon.\r\n		<br /><br /></h2>\r\n	{/if}\r\n	This competition has ended and is no longer active.<br />\r\n{/if}\r\n{* ************************************************************************************ *}\r\n\r\n<div id=\"prizeDesc\">{$competition.potDescription}<br />\r\n{if $competition.potAmount}<small style=\"color:#FFF;\">(${$competition.individualPotAmount} from {$competition.potMethod})</small>{/if}</div>\r\n\r\n{if $competition.startDate lt $smarty.now}\r\n	Time remaining: <b>{$competition.timeLeft}</b><br />\r\n{else}\r\n	This competition has not yet started!<br />\r\n{/if}\r\n\r\nStart{if $competition.startDate lt $smarty.now}ed{else}s{/if}: <b>{$competition.startDate|date_format2:\"n/j/Y\"}</b> &nbsp; \r\nEnd{if $competition.endDate lt $smarty.now}ed{else}s{/if}: <b>{$competition.endDate|date_format2:\"n/j/Y\"}</b><br />\r\n{if $competition.calculationMode neq \"Real-Time\"}Competition stats/scoring updated as of {$competition.dateOfObject|date_format2:\"n/j/Y g:i A\"}{if $isManager} (<a href=\"?pg=competition&cid={$smarty.request.cid}&nocache=1\">Update Now!</a>){/if}<br />{/if}\r\n<div style=\"font-size:5px;clear:left;\">&nbsp;</div>\r\n{assign var=\"scoringMethod\" value=$competition.scoringMethod}\r\n{assign var=\"tieBreakerMethod\" value=$competition.tieBreakerMethod}\r\n{assign var=\"weeklyWinnersMethod1\" value=$competition.weeklyWinnersMethod1}\r\n{assign var=\"weeklyWinnersMethod2\" value=$competition.weeklyWinnersMethod2}\r\n\r\n{* ******************** WEEKLY WINNERS ********************* *}\r\n{if $competition.weeklyWinners}\r\n	{if $weeklyWinnersMethod1}             {* DON\'T FORGET TO REMOVE THE ACM CHECK WHEN READY!!! *}\r\n		<h2 class=\"withBG\">\r\n			<div class=\"topRight hideShow\">\r\n			<a href=\"javascript:toggle(\'weeklyWinners\', \'\', \'showHide\');\"><img id=\"weeklyWinners_img\" src=\"./img/blank.gif\" class=\"showHide_on\" alt=\"show/hide\" border=\"0\" /></a></div>\r\n			Last Week\'s Winners<i>!</i> <small style=\"color:#000; font-size:11px;\">(<i><b>{$competition.weeklyWinners.startDate|date_format2:\"D n/j\"}</b> through <b>{$competition.weeklyWinners.endDate|date_format2:\"D n/j\"}</b></i>)</small></h2> \r\n		<div id=\"weeklyWinners\">\r\n		<table width=\"100%\" cellpadding=\"3\" cellspacing=\"0\"><tr>\r\n		<td valign=\"top\" width=\"50%\">\r\n		<div class=\"cellHeadLarge\" style=\"width:auto;float:none;\">{$weeklyWinnersMethod1}</div>\r\n		<img src=\"{$skinFolder}images/winner_1.gif\" style=\"float:left;\" />\r\n		{strip}\r\n		{foreach name=\"method1\" from=$competition.weeklyWinners.$weeklyWinnersMethod1 item=\"username\"}\r\n			{assign var=\"userValue\" value=$competition.weeklyWinners.users.$username.$weeklyWinnersMethod1}\r\n			{if $smarty.foreach.method1.iteration gt 3 OR $userValue lte 0}{if $smarty.foreach.method1.iteration eq 1}Don\'t forget to update your progress so there will be winners next week{/if}<i>!</i>{php}break;{/php}\r\n			{elseif $smarty.foreach.method1.iteration eq 1}\r\n				<b>{$username|default:\"[ ?? ]\"|ucfirst}</b> led the way last week by \r\n				{if $weeklyWinnersMethod1 eq \'Weight Lost\'}losing <b>{$userValue}</b> pounds{elseif $weeklyWinnersMethod1 eq \'Percentage Weight Lost\'}losing <b>{$userValue|number_format:\"2\"}%</b> body weight{elseif $weeklyWinnersMethod1 eq \'Minutes Exercise\'}exercising <b>{$userValue}</b> minutes{elseif $weeklyWinnersMethod1 eq \'Distance Exercised\'}exercising <b>{$userValue}</b> miles{elseif $weeklyWinnersMethod1 eq \'Weight Gained\'}gaining <b>{$userValue}</b> pounds{else}<b>default</b>{/if}\r\n			{else}\r\n				{if $smarty.foreach.method1.iteration eq 2}, followed by <b>{$username|default:\"[ ?? ]\"|ucfirst}</b> with \r\n				{else} and <b>{$username|default:\"[ ?? ]\"|ucfirst}</b> with \r\n				{/if}\r\n				{if $weeklyWinnersMethod1 eq \'Weight Lost\'}<b>{$userValue}</b> pounds{elseif $weeklyWinnersMethod1 eq \'Percentage Weight Lost\'}<b>{$userValue|number_format:\"2\"}%</b>{elseif $weeklyWinnersMethod1 eq \'Minutes Exercise\'}<b>{$userValue}</b> minutes{elseif $weeklyWinnersMethod1 eq \'Distance Exercised\'}<b>{$userValue}</b> miles{elseif $weeklyWinnersMethod1 eq \'Weight Gained\'}<b>{$userValue}</b> pounds{/if}\r\n			{/if}\r\n		{/foreach}\r\n		{/strip}\r\n		</td>\r\n	{/if}\r\n	{if $weeklyWinnersMethod2} \r\n		<td valign=\"top\" width=\"50%\">\r\n		<div class=\"cellHeadLarge\" style=\"width:auto;float:none;\">{$weeklyWinnersMethod2}</div>\r\n		<img src=\"{$skinFolder}images/winner_2.gif\" style=\"float:left;\" />\r\n		{* display var=$competition.weeklyWinners.users *}\r\n		{strip}\r\n		{foreach name=\"method2\" from=$competition.weeklyWinners.$weeklyWinnersMethod2 item=\"username\"}\r\n			{assign var=\"userValue\" value=$competition.weeklyWinners.users.$username.$weeklyWinnersMethod2}\r\n			\r\n			{if $smarty.foreach.method2.iteration gt 3 OR $userValue lte 0}{if $smarty.foreach.method2.iteration eq 1}Don\'t forget to update your progress so there will be winners next week{/if}<i>!</i>{php}break;{/php}\r\n			{elseif $smarty.foreach.method2.iteration eq 1}\r\n				<b>{$username|default:\"[ ?? ]\"|ucfirst}</b> won by \r\n				{if $weeklyWinnersMethod2 eq \'Weight Lost\'}losing <b>{$userValue}</b> pounds{elseif $weeklyWinnersMethod2 eq \'Percentage Weight Lost\'}losing <b>{$userValue|number_format:\"2\"}%</b> body weight{elseif $weeklyWinnersMethod2 eq \'Minutes Exercise\'}exercising <b>{$userValue}</b> minutes{elseif $weeklyWinnersMethod2 eq \'Distance Exercised\'}exercising <b>{$userValue}</b> miles{elseif $weeklyWinnersMethod2 eq \'Weight Gained\'}gaining <b>{$userValue}</b> pounds{/if}\r\n			{else}\r\n				{if $smarty.foreach.method2.iteration eq 2}, followed by <b>{$username|default:\"[ ?? ]\"|ucfirst}</b> with \r\n				{else} and <b>{$username|default:\"[ ?? ]\"|ucfirst}</b> with \r\n				{/if}\r\n				{if $weeklyWinnersMethod2 eq \'Weight Lost\'}<b>{$userValue}</b> pounds{elseif $weeklyWinnersMethod2 eq \'Percentage Weight Lost\'}<b>{$userValue|number_format:\"2\"}%</b>{elseif $weeklyWinnersMethod2 eq \'Minutes Exercise\'}<b>{$userValue}</b> minutes{elseif $weeklyWinnersMethod2 eq \'Distance Exercised\'}<b>{$userValue}</b> miles{elseif $weeklyWinnersMethod2 eq \'Weight Gained\'}<b>{$userValue}</b> pounds{/if}\r\n			{/if}\r\n		{/foreach}\r\n		{/strip}\r\n		</td>\r\n	{/if}\r\n	{if $weeklyWinnersMethod1}\r\n	</tr></table></div>{/if}\r\n{/if}\r\n{* ********************************************************* *}\r\n\r\n{if $acm->isDomainAdmin() and $smarty.request.debug}\r\n	{display var=$competition}\r\n{/if} \r\n\r\n{* ******************************** COMPARISON GRAPHS ***************************************** *}\r\n{if $competition.availableGraphs|@count}\r\n{include_php file=\"shared_handle:competition.graphs\"}\r\n<h2 class=\"withBG\"><a name=\"graph\"></a>\r\n	<div class=\"topRight hideShow\">\r\n		<a href=\"javascript:toggle(\'graphs\', \'\', \'showHide\');\"><img id=\"graphs_img\" src=\"./img/blank.gif\" class=\"showHide_on\" alt=\"show/hide\" border=\"0\" /></a></div> \r\n	Comparison Graphs &nbsp; <small><i>No graph? <a href=\"http://www.macromedia.com/shockwave/download/download.cgi?P1_Prod_Version=ShockwaveFlash\" target=\"_blank\">click here</a> to download the free Flash Player plug-in.</i></small></h2>\r\n<div id=\"graphs\" style=\"display:block;\">\r\n	<table border=\"0\" cellpadding=\"0\" width=\"100%\">\r\n		{assign var=\"graphURL\" value=\"?pg=flashgraph-frame&format=wide\"}\r\n	<tr>\r\n		<td><div style=\"border:#999 1px solid;background-color:#FFF;padding:5px;\"><iframe name=\"graphwindow\" src=\"{$graphURL}\" frameborder=\"0\" width=\"625\" height=\"222\" scrollbars=\"no\"></iframe></div></td>\r\n	</tr>\r\n	<tr>\r\n		<td valign=\"top\" align=\"center\" width=\"100%\">\r\n		<small>\r\n		{foreach name=\"graphTypes\" from=$competition.availableGraphs key=\"graphType\" item=\"graphParams\"}\r\n		<a href=\"?pg=flashgraph-frame&compId={$competition.id}&{$graphParams}\" target=\"graphwindow\">{$graphType}</a>{if $smarty.foreach.graphTypes.iteration neq $competition.availableGraphs|@count} | {/if}\r\n		{/foreach}\r\n		</small></td>\r\n	</tr>\r\n	</table>\r\n<br />\r\n</div>\r\n{/if}\r\n\r\n{* ******************************** GROUP TEAMS/PLAYERS SUMMARY W/MOVING ***************************************** *}\r\n{if $competition.style eq \'Group-vs-Group\'}\r\n<h2 class=\"withBG\">\r\n	<div class=\"topRight hideShow\">\r\n		<a href=\"javascript:toggle(\'teams\', \'\', \'showHide\');\"><img id=\"teams_img\" src=\"./img/blank.gif\" class=\"showHide_on\" alt=\"show/hide\" border=\"0\" /></a></div> \r\n	The Teams &nbsp; <small><i>Assignments and statistics</i></small></h2>\r\n<div id=\"teams\" style=\"display:block;\">\r\n<table cellpadding=\"0\" cellspacing=\"0\" width=\"100%\" border=\"0\"><tr><td>\r\n	{if $isManager}\r\n		<form name=\"changeTeam\" action=\"index.php\" method=\"POST\" style=\"margin:0px;\">\r\n			<input type=\"hidden\" name=\"pg\" value=\"{$page.name}\">\r\n			<input type=\"hidden\" name=\"cid\" value=\"{$competition.id}\">\r\n			<input type=\"hidden\" name=\"no_expire\" value=\"true\">\r\n	{/if}\r\n		{assign var=\"minEx\" value=\"Minutes Exercise\"}\r\n		{assign var=\"distEx\" value=\"Distance Exercised\"}\r\n		{assign var=\"pctLst\" value=\"Percentage Weight Lost\"}\r\n		{assign var=\"wtLst\" value=\"Percentage Weight Lost\"}\r\n		{foreach from=$competition.teams name=\"teamsLoop\" item=\"teams\" key=\"teamName\"}\r\n			<div id=\"playersList{$smarty.foreach.teamsLoop.iteration}\" style=\"float:left;width:310px;overflow:hidden;word-wrap:nowrap; margin:0px 5px 5px 0px;\">\r\n			<h4>{if $teams.name eq \"Waiting to Join\"}Not assigned to a team{else}{$teams.name|default:\"&nbsp;\"}{/if}</h4>\r\n		{if $scoringMethod|regex_match:\"/exercise/i\"}\r\n			<span class=\"cellHeadLarge\">Name</span>\r\n			<span class=\"cellHeadSmall\">Min.</span>\r\n			<span class=\"cellHeadSmall\">Dist.</span>\r\n			<span class=\"cellHeadSmall\">Update</span><br />\r\n			{foreach from=$teams.users item=\"users\" key=\"userName\"}\r\n				<span class=\"cellLarge\" style=\"text-align:left;\"><small>{if $isManager}<input type=\"checkbox\" name=\"changeTeam[players][{$userName}]\" style=\"width:14px;height:14px;margin:0px 2px;\" />{/if}{$userName}</small></span>\r\n				<span class=\"cellSmall\"><small>{$users.$minEx|default:\"-\"|replace:\".00\":\"\"}</small></span>\r\n				<span class=\"cellSmall\"><small>{$users.$distEx|default:\"-\"|replace:\".00\":\"\"}</small></span>\r\n				<span class=\"cellSmall\"><small>{if $users.dateOfEntry}{$users.dateOfEntry|date_format2:\"n/j/y\"}{else}Never{/if}</small></span>\r\n			{foreachelse}\r\n				{* No players assigned to this team. *}\r\n			{/foreach}\r\n		{else}\r\n			<span class=\"cellHeadLarge\">Name</span>\r\n			<span class=\"cellHeadTiny\">%</span>\r\n			<span class=\"cellHeadSmall\">Update</span><br />\r\n			{foreach from=$teams.users item=\"users\" key=\"userName\"}\r\n				<span class=\"cellLarge\" style=\"clear:left;text-align:left;\"><small>{if $isManager}<input type=\"checkbox\" name=\"changeTeam[players][{$userName}]\" />{/if}{$userName}</small></span>\r\n				<span class=\"cellTiny\"><small>{if $users.hideInitialWeight neq \"Yes\"}{$users.$pctLst|number_format:\"2\"|replace:\".00\":\"\"}{else}-{/if}</small></span>\r\n				<span class=\"cellSmall\"><small>{if $users.dateOfEntry}{$users.dateOfEntry|date_format2:\"n/j/y\"}{else}Never{/if}</small></span><br />\r\n			{foreachelse}\r\n				{* No players assigned to this team. *}\r\n			{/foreach}\r\n		{/if}\r\n			</div>\r\n		{/foreach}\r\n	{if $isManager}\r\n		<br />\r\n		<select name=\"changeTeam[team]\">\r\n			<option value=\"\">Move selected players to...</option>\r\n			{foreach from=$competition.teams item=\"newTeams\" key=\"newTeamName\"}\r\n				{*if $newTeams.name ne $teams.name and $newTeams.name ne \"Waiting to Join\"*}\r\n				{if $newTeams.name ne \"Waiting to Join\"}\r\n					<option value=\"{$newTeams.name}\">{$newTeams.name}</option>\r\n				{/if}\r\n			{/foreach}\r\n		</select><br />\r\n		<input type=\"submit\" class=\"button\" value=\"Submit Changes\">\r\n		</form>\r\n	{/if}\r\n</td></tr></table>\r\n</div>\r\n{/if}\r\n</div>\r\n	{* ******************************** DISCUSSION BOARD ***************************************** *}\r\n<br />\r\n<h2 class=\"withBG\">\r\n	<div class=\"topRight hideShow\">\r\n		<a href=\"javascript:toggle(\'discuss\', \'\', \'showHide\');\"><img id=\"discuss_img\" src=\"./img/blank.gif\" class=\"showHide_on\" alt=\"show/hide\" border=\"0\" /></a></div> \r\n	Discussion Board</h2>\r\n<div id=\"discuss\" style=\"display:block;\">\r\n	<table cellpadding=\"0\" width=\"100%\" border=\"0\"><tr><td><iframe src=\"?pg=competition/forum\" id=\"discussionBoard\" frameborder=\"0\" scrolling=\"yes\" style=\"width:100%;\"></iframe></td></tr></table>\r\n</div>\r\n\r\n</div></td>\r\n</tr></table>'),(3559,222,0.22,'smarty','0','Page created.',1113336868,3,'24.10.217.227','{assign var=\"hideWidgets\" value=0}\r\n{assign var=\"hideUserBox\" value=\"false\"}\r\n{assign var=\"showCompanyNews\" value=\"true\"}\r\n{assign var=\"pgLayout\" value=\"layouts/withLeftNav.tpl\"}\r\n\r\n{include_php file=\"shared_handle:competition.load\"}\r\n{if $competition.userId eq $user->id or $acm->isDomainAdmin()}\r\n	{assign var=\"isManager\" value=\"true\"}\r\n	<!-- ismanager -->\r\n	{include_php file=\"shared_handle:competition.management\"}\r\n{/if}\r\n\r\n{include_php file=\"shared_handle:competition.verifyInitialPot\"}\r\n\r\n<table width=\"100%\" cellpadding=\"0\" cellspacing=\"0\" border=\"0\">\r\n	<tr>\r\n		<td valign=\"top\" width=\"260\">\r\n		<br />\r\n		<h2 class=\"withBG\">\r\n			<div class=\"topRight hideShow\">\r\n					<a href=\"javascript:toggle(\'leaderBoard\', \'\', \'showHide\');\"><img id=\"leaderBoard_img\" src=\"./img/blank.gif\" class=\"showHide_on\" alt=\"show/hide\" border=\"0\" /></a>\r\n				</div>\r\n			Leaders\r\n		</h2>\r\n		{if $competition.dateOfObject}<div align=\"right\"><small><i>as of {$competition.dateOfObject|date_format2:\"n/j/Y g:i A\"}</i></small></div>{/if}\r\n		<div id=\"leaderBoard\" style=\"display:block;\">\r\n		{if $competition.style eq \'Group-vs-Group\'}\r\n			<div style=\"white-space:nowrap;display:block;\">\r\n			<span class=\"cellHeadTiny\">#</span>\r\n			<span class=\"cellHeadBig\">Team</span>\r\n			<span class=\"cellHeadTiny\">{if $competition.scoringMethod eq \'Percentage Weight Lost\'}%\r\n					{elseif $competition.scoringMethod eq \'Weight Lost\' or $competition.scoringMethod eq \'Weight Gained\'}Lbs\r\n					{elseif $competition.scoringMethod eq \'Minutes Exercise\'}Min\r\n					{elseif $competition.scoringMethod eq \'Distance Exercised\'}Dist\r\n			{/if}</span>\r\n			<span class=\"cellHeadTiny\">#Pl</span>\r\n			</div>\r\n			{foreach name=\"rankLoop\" from=$competition.teams item=\"teams\" key=\"teamName\"}\r\n				{if $teams.name ne \"Waiting to Join\"}\r\n					{if not $teams.userCount}\r\n						{assign var=\"score\" value=\"-\"}\r\n					{elseif $competition.scoringMethod eq \'Percentage Weight Lost\'}\r\n						{assign var=\"score\" value=$teams.averagePercentLost|number_format:\"2\"|default:\"~\"}\r\n					{elseif $competition.scoringMethod eq \'Weight Lost\'}\r\n						{assign var=\"score\" value=$teams.averageWeightLost|number_format:\"2\"|default:\"-\"}\r\n					{elseif $competition.scoringMethod eq \'Weight Gained\'}\r\n						{assign var=\"score\" value=$teams.averageWeightGain|number_format:\"2\"|default:\"-\"}\r\n					{elseif $competition.scoringMethod eq \'Minutes Exercise\'}\r\n						{assign var=\"score\" value=$teams.averageExercise|number_format:\"2\"|default:\"-\"}\r\n					{elseif $competition.scoringMethod eq \'Distance Exercised\'}\r\n						{assign var=\"score\" value=$teams.averageDistance|number_format:\"2\"|default:\"-\"}\r\n					{/if}\r\n					<div style=\"white-space:nowrap;display:block;\">\r\n						<span class=\"cellTiny\" style=\"clear:left;\"><small>{$smarty.foreach.rankLoop.iteration}</small></span>\r\n						<span class=\"cellBig\"><small class=\"mini\">{$teams.name|default:\"&nbsp;\"}</small></span>\r\n						<span class=\"cellTiny\"><small>{$score|replace:\".00\":\"\"}</small></span>\r\n						<span class=\"cellTiny\"><small>{$teams.userCount|default:\"0\"}</small></span>\r\n					</div>\r\n				{/if}\r\n			{/foreach}\r\n		{else}\r\n			<div style=\"white-space:nowrap;display:block;\">\r\n			<span class=\"cellHeadTiny\">#</span>\r\n			<span class=\"cellHeadSmall\">Name</span>\r\n			<span class=\"cellHeadTiny\">{if $competition.scoringMethod eq \'Percentage Weight Lost\'}%\r\n					{elseif $competition.scoringMethod eq \'Weight Lost\' or $competition.scoringMethod eq \'Weight Gained\'}Lbs\r\n					{elseif $competition.scoringMethod eq \'Minutes Exercise\'}Min\r\n					{elseif $competition.scoringMethod eq \'Distance Exercised\'}Dist\r\n			{/if}</span>\r\n			<span class=\"cellHeadSmall\">Update</span>\r\n			</div>\r\n			{foreach from=$competition.users item=\"compUser\" key=\"username\" name=\"dateUpdated\"}\r\n			{if $smarty.foreach.dateUpdated.iteration eq 21}\r\n			</div>\r\n			<br />\r\n			<h2 class=\"withBG\">\r\n				<div class=\"topRight hideShow\">\r\n					<a href=\"javascript:toggle(\'runnerUps\', \'\', \'showHide\');\"><img id=\"runnerUps_img\" src=\"./img/blank.gif\" class=\"showHide_off\" alt=\"show/hide\" border=\"0\" /></a>\r\n				</div>\r\n				Runner Ups\r\n			</h2>\r\n			<div id=\"runnerUps\" style=\"display:none;\">\r\n			{/if}\r\n			<span class=\"cellTiny\" style=\"clear:left;\"><small>{$smarty.foreach.dateUpdated.iteration}</small></span>\r\n			<span class=\"cellSmall\"><small class=\"mini\">{$username}</small></span>\r\n			<span class=\"cellTiny\"><small>{if $scoringMethod eq \"Percentage Weight Lost\"}{$compUser.$scoringMethod|number_format:\"2\"|replace:\".00\":\"\"|default:\"-\"}{else}{$compUser.$scoringMethod|replace:\".00\":\"\"|default:\"-\"}{/if}</small></span>\r\n			<span class=\"cellSmall\"><small>{if $compUser.dateOfEntry}{$compUser.dateOfEntry|date_format2:\"n/j/y\"}{else}-Never-{/if}</small></span>\r\n			{/foreach}\r\n		{/if}\r\n		</div> \r\n		<div align=\"right\"><small><i><a href=\"?pg=faq#comp\">How is the competition scored?</a></i></small></div>\r\n		<img src=\"./img/blank.gif\" width=\"168\" height=\"1\" alt=\"\" />\r\n		{if $isManager}\r\n		<h2 class=\"withBG\">\r\n			<div class=\"topRight hideShow\">\r\n				<a href=\"javascript:toggle(\'managePlayers\', \'\', \'showHide\');\"><img id=\"managePlayers_img\" src=\"./img/blank.gif\" class=\"showHide_off\" alt=\"show/hide\" border=\"0\" /></a>\r\n			</div> \r\n			Manage\r\n		</h2>\r\n		<div id=\"managePlayers\" style=\"display:none;\">\r\n					<form name=\"managePlayers[]\" action=\"index.php\" method=\"POST\" style=\"margin:0px;\">\r\n					<input type=\"hidden\" name=\"pg\" value=\"{$page.name}\">\r\n					<input type=\"hidden\" name=\"cid\" value=\"{$competition.id}\">\r\n					<input type=\"hidden\" name=\"no_expire\" value=\"true\">\r\n					<input type=\"hidden\" name=\"style\" value=\"{$competition.style}\">\r\n							{if $competition.style eq \'Group-vs-Group\'}\r\n								<span class=\"cellHeadTiny\" style=\"clear:left;\">Del</span>\r\n								<span class=\"cellHead\">View Stats</span>\r\n								<span class=\"cellHeadSmall\">-</span><br />\r\n								{foreach from=$competition.teams item=\"teams\" key=\"teamName\"}\r\n									{foreach from=$teams.users item=\"users\" key=\"userName\"}\r\n										<span class=\"cellTiny\" style=\"clear:left;\"><small><input type=\"checkbox\" name=\"managePlayers[delete][]\" value=\"{$userName}\" style=\"width:14px; height:14px;margin:0px 2px;\"></small></span>\r\n										<span class=\"cell\"><small><a href=\"?pg=myhome&cid={$competition.id}&userId={$users.id}&hideComps=1\">{$userName}</a></small></span>\r\n										<span class=\"cellSmall\"><small><a href=\"mailto:{$users.email}\">email</a></small></span><br />\r\n									{/foreach}\r\n								{/foreach}\r\n							{else}\r\n								<span class=\"cellHeadTiny\" style=\"clear:left;\">Del</span>\r\n								<span class=\"cellHead\">View Stats</span>\r\n								<span class=\"cellHeadSmall\">-</span><br />\r\n								{foreach from=$competition.users item=\"compUser\" key=\"username\" name=\"dateUpdated\"}\r\n									<span class=\"cellTiny\" style=\"clear:left;\"><small><input type=\"checkbox\" name=\"managePlayers[delete][]\" value=\"{$username}\" style=\"width:14px;height:14px;margin:0px 2px;\"></small></span>\r\n									<span class=\"cell\"><small><a href=\"?pg=myhome&cid={$competition.id}&userId={$compUser.id}&hideComps=1\">{$username}</a></small></span>\r\n									<span class=\"cellSmall\"><small><a href=\"mailto:{$compUser.email}\">email</a></small></span><br />\r\n								{/foreach}\r\n							{/if}\r\n					<div style=\"text-align:center;\">\r\n                                                <br />\r\n						<input type=\"submit\" class=\"button\" value=\"Delete Selected\">\r\n					</div>\r\n					</form>\r\n		</div><br/>\r\n		{/if}\r\n		{* End new section for Player management. *}\r\n		\r\n		{* Begin new section for Team management.  This can be moved where ever. *}\r\n		{* ******************************** TEAM MANAGEMENT ***************************************** *}\r\n		{if $isManager and $competition.style eq \'Group-vs-Group\'}\r\n		<h2 class=\"withBG\">\r\n			<div class=\"topRight hideShow\">\r\n				<a href=\"javascript:toggle(\'teamManagement\', \'\', \'showHide\');\"><img id=\"teamManagement_img\" src=\"./img/blank.gif\" class=\"showHide_{if $smarty.request.showTeamManagement}on{else}off{/if}\" alt=\"show/hide\" border=\"0\" /></a>\r\n			</div>\r\n			Teams</h2>\r\n		<div id=\"teamManagement\" style=\"display:{if $smarty.request.showTeamManagement}block{else}none{/if};\">\r\n			<form name=\"manageTeam[]\" action=\"index.php\" method=\"POST\" style=\"margin:0px;\">\r\n			<input type=\"hidden\" name=\"pg\" value=\"{$page.name}\">\r\n			<input type=\"hidden\" name=\"cid\" value=\"{$competition.id}\">\r\n			<input type=\"hidden\" name=\"no_expire\" value=\"true\">\r\n			<div id=\"playersList{counter}\">\r\n				<span class=\"cellHeadTiny\">Del</span>\r\n				<span class=\"cellHeadLarge\" style=\"width:134px;\">Team Name</span><br />\r\n				{foreach from=$competition.teams item=\"teams\" key=\"teamName\"}\r\n					{counter name=\"counterI\" start=\"0\" print=0}\r\n					{if $teams.name ne \"Waiting to Join\"}\r\n						<span class=\"cellTiny\" style=\"clear:left;\"><small><input type=\"checkbox\" name=\"manageTeam[delete][]\" value=\"{$teams.name}\"></small></span>\r\n						<span class=\"cellLarge\" style=\"width:134px;\"><small><input id=\"renameTeam\" type=\"text\" value=\"{$teams.name}\" name=\"manageTeam[rename][{$teams.name}]\" size=\"10\" style=\"width:124px;height:12px\"></small></span><br />\r\n					{/if}\r\n				{/foreach}\r\n			</div>\r\n                        <br />\r\n			<div style=\"text-align:center;\">New Team: <input id=\"addTeam\" type=\"text\" name=\"manageTeam[addTeam]\" size=\"10\"><br />\r\n			<br />\r\n                        <input type=\"submit\" class=\"button\" value=\"Submit Changes\"></div>\r\n			</form>\r\n		</div><br />\r\n		{/if}\r\n		{* End new section for Team management. *}\r\n\r\n		\r\n		{if !$isManager AND $competition.users|@count lt 45}{include file=\"layouts/ads.tpl\"}{assign var=\"adsShown\" value=\"1\"}{/if}\r\n\r\n			<h2 class=\"withBG\">Competition Stats</h2>\r\n			<span class=\"cellHeadLarge\">Category</span><span class=\"cellHeadSmall\">Result</span><br />\r\n			<span class=\"cellLarge\"><small>start weight</small></span>\r\n			<span class=\"cellSmall\"><small>{$competition.groupStartWeight|default:0} lbs</small></span><br />\r\n			<span class=\"cellLarge\"><small>weight lost</small></span>\r\n			<span class=\"cellSmall\"><small>{$competition.groupWeightLost|default:0} lbs</small></span><br />\r\n			{if $competition.groupPercentageWeightLost gt 0}<span class=\"cellLarge\"><small>% lost</small></span>\r\n			<span class=\"cellSmall\"><small>{$competition.groupPercentageWeightLost|default:0|number_format:\"2\"}</small></span><br />{/if}\r\n			<span class=\"cellLarge\"><small>fat intake</small></span>\r\n			<span class=\"cellSmall\"><small>{$competition.groupFat|default:0}</small></span><br />\r\n			<span class=\"cellLarge\"><small>calorie intake</small></span>\r\n			<span class=\"cellSmall\"><small>{$competition.groupCalories|default:0}</small></span><br />\r\n			<span class=\"cellLarge\"><small>minutes exercised</small></span>\r\n			<span class=\"cellSmall\"><small>{$competition.groupExercise|default:0}</small></span><br />\r\n			<span class=\"cellLarge\"><small>miles exercised</small></span>\r\n			<span class=\"cellSmall\"><small>{$competition.groupDistanceExercised|default:0}</small></span><br />\r\n			<img src=\"./img/blank.gif\" width=\"165\" height=\"1\" alt=\"\" />\r\n		</td>\r\n		<td width=\"100%\" valign=\"top\">\r\n			<div id=\"contentBox\" class=\"centerBox\" style=\"margin-left:10px;\"><div class=\"topRightTreasure\">\r\n<div id=\"jackpot\">{if $competition.potAmount gt 0}${$competition.potAmount|number_format:2}{/if}</div>\r\n<h1 class=\"underline\">{$competition.title|default:\"Competition Title\"}</h1>\r\n\r\n{* ******************************** COMPETITION END *********************************** *}\r\n{if $competition.endDate lt $smarty.now}   {* COMPETITION IS OVER *}\r\n	{if $competition.results.winners|@count eq 1}\r\n		{* There was one winner, either by scoringMethod or tieBreakerMethod *}\r\n\r\n		{math assign=\"daysOfCompetition\" equation=\"(x - y) / z\" x=$competition.endDate|default:\"0\" y=$competition.startDate|default:\"0\" z=\"86400\"}\r\n		{math assign=\"marginOfVictory\" equation=\"x - y\" x=$competition.results.winningStat|default:\"0\" y=$competition.results.secondPlaceStat|default:\"0\"}\r\n\r\n		{foreach from=$competition.results.winners item=\"winnerName\"}    {*key=\"winnerName\"*}\r\n			{assign var=\"winnerData\" value=$competitions.users.$winnerName}\r\n			\r\n			{if $competition.style eq \"Group-vs-Group\"}\r\n				{assign var=\"description\" value=\"Winning Team\"}\r\n				{assign var=\"avg\" value=\"average\"}\r\n			{else}\r\n				{assign var=\"description\" value=\"Winner\"}\r\n			{/if}\r\n\r\n			<h2><br /><b>{$winnerName}</b> is the {$description}{if $competition.potAmount}, taking home <b>$<i>{$competition.potAmount|number_format:2}</i></b>{/if}!</h2>\r\n			<br />\r\n			{strip}\r\n			{if not $competition.results.isTie}   {* Not a Tie *}\r\n				After a difficult <b>{$daysOfCompetition|number_format:0}</b> days of \r\n				fierce competition, <b>{$winnerName}</b> is the \r\n				{$description}!	Based on \r\n				<b>{$competition.results.winningMethod}</b>, <b>{$winnerName}</b> \r\n				won with <b>{$competition.results.winningStat|number_format:2} \r\n				{if $competition.results.winningMethod eq \"Weight Lost\"}{$avg} pounds lost\r\n				{elseif $competition.results.winningMethod eq \"Percentage Weight Lost\"}{$avg} % body weight lost\r\n				{elseif $competition.results.winningMethod eq \"Minutes Exercise\"}{$avg} minutes exercised\r\n				{elseif $competition.results.winningMethod eq \"Distance Exercised\"}{$avg} miles exercised\r\n				{elseif $competition.results.winningMethod eq \"Weight Gained\"}{$avg} pounds gained\r\n				{/if}</b>.\r\n			{else}                                {* A Tie! *}\r\n				{assign var=\"weightLost\" value=\"Weight Lost\"}\r\n				{assign var=\"percentLost\" value=\"Percentage Weight Lost\"}\r\n\r\n				After a difficult <b>{$daysOfCompetition|number_format:0}</b> \r\n				days of fierce competition, there was a tie in the judging \r\n				method, <b>{$competition.scoringMethod}</b>. To break this \r\n				tie, the selected tie breaking method, \r\n				<b>{$competition.tieBreakerMethod}</b>, was used to determine \r\n				<b>{$winnerName}</b> as the {$description}. <b>{$winnerName}</b> \r\n				won with <b>{$competition.results.winningStat|number_format:2}\r\n				{if $competition.results.winningMethod eq \"Weight Lost\"}{$avg} pounds lost\r\n				{elseif $competition.results.winningMethod eq \"Percentage Weight Lost\"}{$avg} % body weight lost\r\n				{elseif $competition.results.winningMethod eq \"Minutes Exercise\"}{$avg} minutes exercised\r\n				{elseif $competition.results.winningMethod eq \"Distance Exercised\"}{$avg} miles exercised\r\n				{elseif $competition.results.winningMethod eq \"Weight Gained\"}{$avg} pounds gained\r\n				{/if}</b>.\r\n				<!--\r\n				<b>{$winnerData.$weightLost|number_format:0} pounds</b>, which \r\n				was <b>{$winnerData.$percentLost|number_format:4}%</b> body weight.\r\n				-->\r\n			{/if}\r\n			{/strip}\r\n			<br />\r\n			<br />\r\n			<b>{$winnerName}</b> won with a <b>{$marginOfVictory|number_format:3}</b> margin over <b>{$competition.results.secondPlaceUser}</b>.\r\n			\r\n			<h2><br />Congratulations to you all!</h2>\r\n			<br />\r\n			<div class=\"underline\"></div>\r\n		{/foreach}\r\n\r\n	{elseif $competition.results.winners|@count gt 1}\r\n		{* There were multiple winners, even after tieBreakerMethod (should RARELY happen) *}\r\n	\r\n		<h2>There was a tie in this competition. The winners, by <b>{$competition.results.winningMethod}</b> having lost <b>{$competition.results.winningStat}</b>, are:<br /></h2>\r\n		<ul>\r\n		{foreach from=$competition.results.winners item=\"winnerData\" key=\"winnerName\"}\r\n			<li>{$winnerName}</li>\r\n		{/foreach}\r\n		</ul>\r\n		\r\n	{else}\r\n		{* For some reason, there were no winners *}\r\n\r\n		<h2><br />\r\n		Winner information is currently unavailable.<br />\r\n		Please check back soon.\r\n		<br /><br /></h2>\r\n	{/if}\r\n	This competition has ended and is no longer active.<br />\r\n{/if}\r\n{* ************************************************************************************ *}\r\n\r\n<div id=\"prizeDesc\">{$competition.potDescription}<br />\r\n{if $competition.potAmount}<small style=\"color:#FFF;\">(${$competition.individualPotAmount} from {$competition.potMethod})</small>{/if}</div>\r\n\r\n{if $competition.startDate lt $smarty.now}\r\n	Time remaining: <b>{$competition.timeLeft}</b><br />\r\n{else}\r\n	This competition has not yet started!<br />\r\n{/if}\r\n\r\nStart{if $competition.startDate lt $smarty.now}ed{else}s{/if}: <b>{$competition.startDate|date_format2:\"n/j/Y\"}</b> &nbsp; \r\nEnd{if $competition.endDate lt $smarty.now}ed{else}s{/if}: <b>{$competition.endDate|date_format2:\"n/j/Y\"}</b><br />\r\n{if $competition.calculationMode neq \"Real-Time\"}Competition stats/scoring updated as of {$competition.dateOfObject|date_format2:\"n/j/Y g:i A\"}{if $isManager} (<a href=\"?pg=competition&cid={$smarty.request.cid}&nocache=1\">Update Now!</a>){/if}<br />{/if}\r\n<div style=\"font-size:5px;clear:left;\">&nbsp;</div>\r\n{assign var=\"scoringMethod\" value=$competition.scoringMethod}\r\n{assign var=\"tieBreakerMethod\" value=$competition.tieBreakerMethod}\r\n{assign var=\"weeklyWinnersMethod1\" value=$competition.weeklyWinnersMethod1}\r\n{assign var=\"weeklyWinnersMethod2\" value=$competition.weeklyWinnersMethod2}\r\n\r\n{* ******************** WEEKLY WINNERS ********************* *}\r\n{if $competition.weeklyWinners}\r\n	{if $weeklyWinnersMethod1}             {* DON\'T FORGET TO REMOVE THE ACM CHECK WHEN READY!!! *}\r\n		<h2 class=\"withBG\">\r\n			<div class=\"topRight hideShow\">\r\n			<a href=\"javascript:toggle(\'weeklyWinners\', \'\', \'showHide\');\"><img id=\"weeklyWinners_img\" src=\"./img/blank.gif\" class=\"showHide_on\" alt=\"show/hide\" border=\"0\" /></a></div>\r\n			Last Week\'s Winners<i>!</i> <small style=\"color:#000; font-size:11px;\">(<i><b>{$competition.weeklyWinners.startDate|date_format2:\"D n/j\"}</b> through <b>{$competition.weeklyWinners.endDate|date_format2:\"D n/j\"}</b></i>)</small></h2> \r\n		<div id=\"weeklyWinners\">\r\n		<table width=\"100%\" cellpadding=\"3\" cellspacing=\"0\"><tr>\r\n		<td valign=\"top\" width=\"50%\">\r\n		<div class=\"cellHeadLarge\" style=\"width:auto;float:none;\">{$weeklyWinnersMethod1}</div>\r\n		<img src=\"{$skinFolder}images/winner_1.gif\" style=\"float:left;\" />\r\n		{strip}\r\n		{foreach name=\"method1\" from=$competition.weeklyWinners.$weeklyWinnersMethod1 item=\"username\"}\r\n			{assign var=\"userValue\" value=$competition.weeklyWinners.users.$username.$weeklyWinnersMethod1}\r\n			{if $smarty.foreach.method1.iteration gt 3 OR $userValue lte 0}{if $smarty.foreach.method1.iteration eq 1}Don\'t forget to update your progress so there will be winners next week{/if}<i>!</i>{php}break;{/php}\r\n			{elseif $smarty.foreach.method1.iteration eq 1}\r\n				<b>{$username|default:\"[ ?? ]\"|ucfirst}</b> led the way last week by \r\n				{if $weeklyWinnersMethod1 eq \'Weight Lost\'}losing <b>{$userValue}</b> pounds{elseif $weeklyWinnersMethod1 eq \'Percentage Weight Lost\'}losing <b>{$userValue|number_format:\"2\"}%</b> body weight{elseif $weeklyWinnersMethod1 eq \'Minutes Exercise\'}exercising <b>{$userValue}</b> minutes{elseif $weeklyWinnersMethod1 eq \'Distance Exercised\'}exercising <b>{$userValue}</b> miles{elseif $weeklyWinnersMethod1 eq \'Weight Gained\'}gaining <b>{$userValue}</b> pounds{else}<b>default</b>{/if}\r\n			{else}\r\n				{if $smarty.foreach.method1.iteration eq 2}, followed by <b>{$username|default:\"[ ?? ]\"|ucfirst}</b> with \r\n				{else} and <b>{$username|default:\"[ ?? ]\"|ucfirst}</b> with \r\n				{/if}\r\n				{if $weeklyWinnersMethod1 eq \'Weight Lost\'}<b>{$userValue}</b> pounds{elseif $weeklyWinnersMethod1 eq \'Percentage Weight Lost\'}<b>{$userValue|number_format:\"2\"}%</b>{elseif $weeklyWinnersMethod1 eq \'Minutes Exercise\'}<b>{$userValue}</b> minutes{elseif $weeklyWinnersMethod1 eq \'Distance Exercised\'}<b>{$userValue}</b> miles{elseif $weeklyWinnersMethod1 eq \'Weight Gained\'}<b>{$userValue}</b> pounds{/if}\r\n			{/if}\r\n		{/foreach}\r\n		{/strip}\r\n		</td>\r\n	{/if}\r\n	{if $weeklyWinnersMethod2} \r\n		<td valign=\"top\" width=\"50%\">\r\n		<div class=\"cellHeadLarge\" style=\"width:auto;float:none;\">{$weeklyWinnersMethod2}</div>\r\n		<img src=\"{$skinFolder}images/winner_2.gif\" style=\"float:left;\" />\r\n		{* display var=$competition.weeklyWinners.users *}\r\n		{strip}\r\n		{foreach name=\"method2\" from=$competition.weeklyWinners.$weeklyWinnersMethod2 item=\"username\"}\r\n			{assign var=\"userValue\" value=$competition.weeklyWinners.users.$username.$weeklyWinnersMethod2}\r\n			\r\n			{if $smarty.foreach.method2.iteration gt 3 OR $userValue lte 0}{if $smarty.foreach.method2.iteration eq 1}Don\'t forget to update your progress so there will be winners next week{/if}<i>!</i>{php}break;{/php}\r\n			{elseif $smarty.foreach.method2.iteration eq 1}\r\n				<b>{$username|default:\"[ ?? ]\"|ucfirst}</b> won by \r\n				{if $weeklyWinnersMethod2 eq \'Weight Lost\'}losing <b>{$userValue}</b> pounds{elseif $weeklyWinnersMethod2 eq \'Percentage Weight Lost\'}losing <b>{$userValue|number_format:\"2\"}%</b> body weight{elseif $weeklyWinnersMethod2 eq \'Minutes Exercise\'}exercising <b>{$userValue}</b> minutes{elseif $weeklyWinnersMethod2 eq \'Distance Exercised\'}exercising <b>{$userValue}</b> miles{elseif $weeklyWinnersMethod2 eq \'Weight Gained\'}gaining <b>{$userValue}</b> pounds{/if}\r\n			{else}\r\n				{if $smarty.foreach.method2.iteration eq 2}, followed by <b>{$username|default:\"[ ?? ]\"|ucfirst}</b> with \r\n				{else} and <b>{$username|default:\"[ ?? ]\"|ucfirst}</b> with \r\n				{/if}\r\n				{if $weeklyWinnersMethod2 eq \'Weight Lost\'}<b>{$userValue}</b> pounds{elseif $weeklyWinnersMethod2 eq \'Percentage Weight Lost\'}<b>{$userValue|number_format:\"2\"}%</b>{elseif $weeklyWinnersMethod2 eq \'Minutes Exercise\'}<b>{$userValue}</b> minutes{elseif $weeklyWinnersMethod2 eq \'Distance Exercised\'}<b>{$userValue}</b> miles{elseif $weeklyWinnersMethod2 eq \'Weight Gained\'}<b>{$userValue}</b> pounds{/if}\r\n			{/if}\r\n		{/foreach}\r\n		{/strip}\r\n		</td>\r\n	{/if}\r\n	{if $weeklyWinnersMethod1}\r\n	</tr></table></div>{/if}\r\n{/if}\r\n{* ********************************************************* *}\r\n\r\n{if $acm->isDomainAdmin() and $smarty.request.debug}\r\n	{display var=$competition}\r\n{/if} \r\n\r\n{* ******************************** COMPARISON GRAPHS ***************************************** *}\r\n{if $competition.availableGraphs|@count}\r\n{include_php file=\"shared_handle:competition.graphs\"}\r\n<h2 class=\"withBG\"><a name=\"graph\"></a>\r\n	<div class=\"topRight hideShow\">\r\n		<a href=\"javascript:toggle(\'graphs\', \'\', \'showHide\');\"><img id=\"graphs_img\" src=\"./img/blank.gif\" class=\"showHide_on\" alt=\"show/hide\" border=\"0\" /></a></div> \r\n	Comparison Graphs &nbsp; <small><i>No graph? <a href=\"http://www.macromedia.com/shockwave/download/download.cgi?P1_Prod_Version=ShockwaveFlash\" target=\"_blank\">click here</a> to download the free Flash Player plug-in.</i></small></h2>\r\n<div id=\"graphs\" style=\"display:block;\">\r\n	<table border=\"0\" cellpadding=\"0\" width=\"100%\">\r\n		{assign var=\"graphURL\" value=\"?pg=flashgraph-frame&format=wide\"}\r\n	<tr>\r\n		<td><div style=\"border:#999 1px solid;background-color:#FFF;padding:5px;\"><iframe name=\"graphwindow\" src=\"{$graphURL}\" frameborder=\"0\" width=\"625\" height=\"222\" scrollbars=\"no\"></iframe></div></td>\r\n	</tr>\r\n	<tr>\r\n		<td valign=\"top\" align=\"center\" width=\"100%\">\r\n		<small>\r\n		{foreach name=\"graphTypes\" from=$competition.availableGraphs key=\"graphType\" item=\"graphParams\"}\r\n		<a href=\"?pg=flashgraph-frame&compId={$competition.id}&{$graphParams}\" target=\"graphwindow\">{$graphType}</a>{if $smarty.foreach.graphTypes.iteration neq $competition.availableGraphs|@count} | {/if}\r\n		{/foreach}\r\n		</small></td>\r\n	</tr>\r\n	</table>\r\n<br />\r\n</div>\r\n{/if}\r\n\r\n{* ******************************** GROUP TEAMS/PLAYERS SUMMARY W/MOVING ***************************************** *}\r\n{if $competition.style eq \'Group-vs-Group\'}\r\n<h2 class=\"withBG\">\r\n	<div class=\"topRight hideShow\">\r\n		<a href=\"javascript:toggle(\'teams\', \'\', \'showHide\');\"><img id=\"teams_img\" src=\"./img/blank.gif\" class=\"showHide_on\" alt=\"show/hide\" border=\"0\" /></a></div> \r\n	The Teams &nbsp; <small><i>Assignments and statistics</i></small></h2>\r\n<div id=\"teams\" style=\"display:block;\">\r\n<table cellpadding=\"0\" cellspacing=\"0\" width=\"100%\" border=\"0\"><tr><td>\r\n	{if $isManager}\r\n		<form name=\"changeTeam\" action=\"index.php\" method=\"POST\" style=\"margin:0px;\">\r\n			<input type=\"hidden\" name=\"pg\" value=\"{$page.name}\">\r\n			<input type=\"hidden\" name=\"cid\" value=\"{$competition.id}\">\r\n			<input type=\"hidden\" name=\"no_expire\" value=\"true\">\r\n	{/if}\r\n		{assign var=\"minEx\" value=\"Minutes Exercise\"}\r\n		{assign var=\"distEx\" value=\"Distance Exercised\"}\r\n		{assign var=\"pctLst\" value=\"Percentage Weight Lost\"}\r\n		{assign var=\"wtLst\" value=\"Percentage Weight Lost\"}\r\n		{foreach from=$competition.teams name=\"teamsLoop\" item=\"teams\" key=\"teamName\"}\r\n			<div id=\"playersList{$smarty.foreach.teamsLoop.iteration}\" style=\"float:left;width:310px;overflow:hidden;word-wrap:nowrap; margin:0px 5px 5px 0px;\">\r\n			<h4>{if $teams.name eq \"Waiting to Join\"}Not assigned to a team{else}{$teams.name|default:\"&nbsp;\"}{/if}</h4>\r\n		{if $scoringMethod|regex_match:\"/exercise/i\"}\r\n			<span class=\"cellHeadLarge\">Name</span>\r\n			<span class=\"cellHeadSmall\">Min.</span>\r\n			<span class=\"cellHeadSmall\">Dist.</span>\r\n			<span class=\"cellHeadSmall\">Update</span><br />\r\n			{foreach from=$teams.users item=\"users\" key=\"userName\"}\r\n				<span class=\"cellLarge\" style=\"text-align:left;\"><small>{if $isManager}<input type=\"checkbox\" name=\"changeTeam[players][{$userName}]\" style=\"width:14px;height:14px;margin:0px 2px;\" />{/if}{$userName}</small></span>\r\n				<span class=\"cellSmall\"><small>{$users.$minEx|default:\"-\"|replace:\".00\":\"\"}</small></span>\r\n				<span class=\"cellSmall\"><small>{$users.$distEx|default:\"-\"|replace:\".00\":\"\"}</small></span>\r\n				<span class=\"cellSmall\"><small>{if $users.dateOfEntry}{$users.dateOfEntry|date_format2:\"n/j/y\"}{else}Never{/if}</small></span>\r\n			{foreachelse}\r\n				{* No players assigned to this team. *}\r\n			{/foreach}\r\n		{else}\r\n			<span class=\"cellHeadLarge\">Name</span>\r\n			<span class=\"cellHeadTiny\">%</span>\r\n			<span class=\"cellHeadSmall\">Update</span><br />\r\n			{foreach from=$teams.users item=\"users\" key=\"userName\"}\r\n				<span class=\"cellLarge\" style=\"clear:left;text-align:left;\"><small>{if $isManager}<input type=\"checkbox\" name=\"changeTeam[players][{$userName}]\" />{/if}{$userName}</small></span>\r\n				<span class=\"cellTiny\"><small>{if $users.hideInitialWeight neq \"Yes\"}{$users.$pctLst|number_format:\"2\"|replace:\".00\":\"\"}{else}-{/if}</small></span>\r\n				<span class=\"cellSmall\"><small>{if $users.dateOfEntry}{$users.dateOfEntry|date_format2:\"n/j/y\"}{else}Never{/if}</small></span><br />\r\n			{foreachelse}\r\n				{* No players assigned to this team. *}\r\n			{/foreach}\r\n		{/if}\r\n			</div>\r\n		{/foreach}\r\n	{if $isManager}\r\n		<br />\r\n		<select name=\"changeTeam[team]\">\r\n			<option value=\"\">Move selected players to...</option>\r\n			{foreach from=$competition.teams item=\"newTeams\" key=\"newTeamName\"}\r\n				{*if $newTeams.name ne $teams.name and $newTeams.name ne \"Waiting to Join\"*}\r\n				{if $newTeams.name ne \"Waiting to Join\"}\r\n					<option value=\"{$newTeams.name}\">{$newTeams.name}</option>\r\n				{/if}\r\n			{/foreach}\r\n		</select><br />\r\n		<input type=\"submit\" class=\"button\" value=\"Submit Changes\">\r\n		</form>\r\n	{/if}\r\n</td></tr></table>\r\n</div>\r\n{/if}\r\n</div>\r\n	{* ******************************** DISCUSSION BOARD ***************************************** *}\r\n<br />\r\n<h2 class=\"withBG\">\r\n	<div class=\"topRight hideShow\">\r\n		<a href=\"javascript:toggle(\'discuss\', \'\', \'showHide\');\"><img id=\"discuss_img\" src=\"./img/blank.gif\" class=\"showHide_on\" alt=\"show/hide\" border=\"0\" /></a></div> \r\n	Discussion Board</h2>\r\n<div id=\"discuss\" style=\"display:block;\">\r\n	<table cellpadding=\"0\" width=\"100%\" border=\"0\"><tr><td><iframe src=\"?pg=competition/forum\" id=\"discussionBoard\" frameborder=\"0\" scrolling=\"yes\" style=\"width:100%;\"></iframe></td></tr></table>\r\n</div>\r\n\r\n</div></td>\r\n</tr></table>'),(3560,222,0.23,'smarty','0','Page created.',1113336968,3,'24.10.217.227','{assign var=\"hideWidgets\" value=0}\r\n{assign var=\"hideUserBox\" value=\"false\"}\r\n{assign var=\"showCompanyNews\" value=\"true\"}\r\n{assign var=\"pgLayout\" value=\"layouts/withLeftNav.tpl\"}\r\n\r\n{include_php file=\"shared_handle:competition.load\"}\r\n{if $competition.userId eq $user->id or $acm->isDomainAdmin()}\r\n	{assign var=\"isManager\" value=\"true\"}\r\n	<!-- ismanager -->\r\n	{include_php file=\"shared_handle:competition.management\"}\r\n{/if}\r\n\r\n{include_php file=\"shared_handle:competition.verifyInitialPot\"}\r\n\r\n<table width=\"100%\" cellpadding=\"0\" cellspacing=\"0\" border=\"0\">\r\n	<tr>\r\n		<td valign=\"top\" width=\"260\">\r\n		<br />\r\n		<h2 class=\"withBG\">\r\n			<div class=\"topRight hideShow\">\r\n					<a href=\"javascript:toggle(\'leaderBoard\', \'\', \'showHide\');\"><img id=\"leaderBoard_img\" src=\"./img/blank.gif\" class=\"showHide_on\" alt=\"show/hide\" border=\"0\" /></a>\r\n				</div>\r\n			Leaders\r\n		</h2>\r\n		{if $competition.dateOfObject}<div align=\"right\"><small><i>as of {$competition.dateOfObject|date_format2:\"n/j/Y g:i A\"}</i></small></div>{/if}\r\n		<div id=\"leaderBoard\" style=\"display:block;\">\r\n		{if $competition.style eq \'Group-vs-Group\'}\r\n			<div style=\"white-space:nowrap;display:block;\">\r\n			<span class=\"cellHeadTiny\">#</span>\r\n			<span class=\"cellHeadBig\">Team</span>\r\n			<span class=\"cellHeadTiny\">{if $competition.scoringMethod eq \'Percentage Weight Lost\'}%\r\n					{elseif $competition.scoringMethod eq \'Weight Lost\' or $competition.scoringMethod eq \'Weight Gained\'}Lbs\r\n					{elseif $competition.scoringMethod eq \'Minutes Exercise\'}Min\r\n					{elseif $competition.scoringMethod eq \'Distance Exercised\'}Dist\r\n			{/if}</span>\r\n			<span class=\"cellHeadTiny\">#Pl</span>\r\n			</div>\r\n			{foreach name=\"rankLoop\" from=$competition.teams item=\"teams\" key=\"teamName\"}\r\n				{if $teams.name ne \"Waiting to Join\"}\r\n					{if not $teams.userCount}\r\n						{assign var=\"score\" value=\"-\"}\r\n					{elseif $competition.scoringMethod eq \'Percentage Weight Lost\'}\r\n						{assign var=\"score\" value=$teams.averagePercentLost|number_format:\"2\"|default:\"-\"}\r\n					{elseif $competition.scoringMethod eq \'Weight Lost\'}\r\n						{assign var=\"score\" value=$teams.averageWeightLost|number_format:\"2\"|default:\"-\"}\r\n					{elseif $competition.scoringMethod eq \'Weight Gained\'}\r\n						{assign var=\"score\" value=$teams.averageWeightGain|number_format:\"2\"|default:\"-\"}\r\n					{elseif $competition.scoringMethod eq \'Minutes Exercise\'}\r\n						{assign var=\"score\" value=$teams.averageExercise|number_format:\"2\"|default:\"-\"}\r\n					{elseif $competition.scoringMethod eq \'Distance Exercised\'}\r\n						{assign var=\"score\" value=$teams.averageDistance|number_format:\"2\"|default:\"-\"}\r\n					{/if}\r\n					<div style=\"white-space:nowrap;display:block;\">\r\n						<span class=\"cellTiny\" style=\"clear:left;\"><small>{$smarty.foreach.rankLoop.iteration}</small></span>\r\n						<span class=\"cellBig\"><small class=\"mini\">{$teams.name|default:\"&nbsp;\"}</small></span>\r\n						<span class=\"cellTiny\"><small>{$score|replace:\".00\":\"\"}</small></span>\r\n						<span class=\"cellTiny\"><small>{$teams.userCount|default:\"0\"}</small></span>\r\n					</div>\r\n				{/if}\r\n			{/foreach}\r\n		{else}\r\n			<div style=\"white-space:nowrap;display:block;\">\r\n			<span class=\"cellHeadTiny\">#</span>\r\n			<span class=\"cellHeadSmall\">Name</span>\r\n			<span class=\"cellHeadTiny\">{if $competition.scoringMethod eq \'Percentage Weight Lost\'}%\r\n					{elseif $competition.scoringMethod eq \'Weight Lost\' or $competition.scoringMethod eq \'Weight Gained\'}Lbs\r\n					{elseif $competition.scoringMethod eq \'Minutes Exercise\'}Min\r\n					{elseif $competition.scoringMethod eq \'Distance Exercised\'}Dist\r\n			{/if}</span>\r\n			<span class=\"cellHeadSmall\">Update</span>\r\n			</div>\r\n			{foreach from=$competition.users item=\"compUser\" key=\"username\" name=\"dateUpdated\"}\r\n			{if $smarty.foreach.dateUpdated.iteration eq 21}\r\n			</div>\r\n			<br />\r\n			<h2 class=\"withBG\">\r\n				<div class=\"topRight hideShow\">\r\n					<a href=\"javascript:toggle(\'runnerUps\', \'\', \'showHide\');\"><img id=\"runnerUps_img\" src=\"./img/blank.gif\" class=\"showHide_off\" alt=\"show/hide\" border=\"0\" /></a>\r\n				</div>\r\n				Runner Ups\r\n			</h2>\r\n			<div id=\"runnerUps\" style=\"display:none;\">\r\n			{/if}\r\n			<span class=\"cellTiny\" style=\"clear:left;\"><small>{$smarty.foreach.dateUpdated.iteration}</small></span>\r\n			<span class=\"cellSmall\"><small class=\"mini\">{$username}</small></span>\r\n			<span class=\"cellTiny\"><small>{if $scoringMethod eq \"Percentage Weight Lost\"}{$compUser.$scoringMethod|number_format:\"2\"|replace:\".00\":\"\"|default:\"~\"}{else}{$compUser.$scoringMethod|replace:\".00\":\"\"|default:\"-\"}{/if}</small></span>\r\n			<span class=\"cellSmall\"><small>{if $compUser.dateOfEntry}{$compUser.dateOfEntry|date_format2:\"n/j/y\"}{else}-Never-{/if}</small></span>\r\n			{/foreach}\r\n		{/if}\r\n		</div> \r\n		<div align=\"right\"><small><i><a href=\"?pg=faq#comp\">How is the competition scored?</a></i></small></div>\r\n		<img src=\"./img/blank.gif\" width=\"168\" height=\"1\" alt=\"\" />\r\n		{if $isManager}\r\n		<h2 class=\"withBG\">\r\n			<div class=\"topRight hideShow\">\r\n				<a href=\"javascript:toggle(\'managePlayers\', \'\', \'showHide\');\"><img id=\"managePlayers_img\" src=\"./img/blank.gif\" class=\"showHide_off\" alt=\"show/hide\" border=\"0\" /></a>\r\n			</div> \r\n			Manage\r\n		</h2>\r\n		<div id=\"managePlayers\" style=\"display:none;\">\r\n					<form name=\"managePlayers[]\" action=\"index.php\" method=\"POST\" style=\"margin:0px;\">\r\n					<input type=\"hidden\" name=\"pg\" value=\"{$page.name}\">\r\n					<input type=\"hidden\" name=\"cid\" value=\"{$competition.id}\">\r\n					<input type=\"hidden\" name=\"no_expire\" value=\"true\">\r\n					<input type=\"hidden\" name=\"style\" value=\"{$competition.style}\">\r\n							{if $competition.style eq \'Group-vs-Group\'}\r\n								<span class=\"cellHeadTiny\" style=\"clear:left;\">Del</span>\r\n								<span class=\"cellHead\">View Stats</span>\r\n								<span class=\"cellHeadSmall\">-</span><br />\r\n								{foreach from=$competition.teams item=\"teams\" key=\"teamName\"}\r\n									{foreach from=$teams.users item=\"users\" key=\"userName\"}\r\n										<span class=\"cellTiny\" style=\"clear:left;\"><small><input type=\"checkbox\" name=\"managePlayers[delete][]\" value=\"{$userName}\" style=\"width:14px; height:14px;margin:0px 2px;\"></small></span>\r\n										<span class=\"cell\"><small><a href=\"?pg=myhome&cid={$competition.id}&userId={$users.id}&hideComps=1\">{$userName}</a></small></span>\r\n										<span class=\"cellSmall\"><small><a href=\"mailto:{$users.email}\">email</a></small></span><br />\r\n									{/foreach}\r\n								{/foreach}\r\n							{else}\r\n								<span class=\"cellHeadTiny\" style=\"clear:left;\">Del</span>\r\n								<span class=\"cellHead\">View Stats</span>\r\n								<span class=\"cellHeadSmall\">-</span><br />\r\n								{foreach from=$competition.users item=\"compUser\" key=\"username\" name=\"dateUpdated\"}\r\n									<span class=\"cellTiny\" style=\"clear:left;\"><small><input type=\"checkbox\" name=\"managePlayers[delete][]\" value=\"{$username}\" style=\"width:14px;height:14px;margin:0px 2px;\"></small></span>\r\n									<span class=\"cell\"><small><a href=\"?pg=myhome&cid={$competition.id}&userId={$compUser.id}&hideComps=1\">{$username}</a></small></span>\r\n									<span class=\"cellSmall\"><small><a href=\"mailto:{$compUser.email}\">email</a></small></span><br />\r\n								{/foreach}\r\n							{/if}\r\n					<div style=\"text-align:center;\">\r\n                                                <br />\r\n						<input type=\"submit\" class=\"button\" value=\"Delete Selected\">\r\n					</div>\r\n					</form>\r\n		</div><br/>\r\n		{/if}\r\n		{* End new section for Player management. *}\r\n		\r\n		{* Begin new section for Team management.  This can be moved where ever. *}\r\n		{* ******************************** TEAM MANAGEMENT ***************************************** *}\r\n		{if $isManager and $competition.style eq \'Group-vs-Group\'}\r\n		<h2 class=\"withBG\">\r\n			<div class=\"topRight hideShow\">\r\n				<a href=\"javascript:toggle(\'teamManagement\', \'\', \'showHide\');\"><img id=\"teamManagement_img\" src=\"./img/blank.gif\" class=\"showHide_{if $smarty.request.showTeamManagement}on{else}off{/if}\" alt=\"show/hide\" border=\"0\" /></a>\r\n			</div>\r\n			Teams</h2>\r\n		<div id=\"teamManagement\" style=\"display:{if $smarty.request.showTeamManagement}block{else}none{/if};\">\r\n			<form name=\"manageTeam[]\" action=\"index.php\" method=\"POST\" style=\"margin:0px;\">\r\n			<input type=\"hidden\" name=\"pg\" value=\"{$page.name}\">\r\n			<input type=\"hidden\" name=\"cid\" value=\"{$competition.id}\">\r\n			<input type=\"hidden\" name=\"no_expire\" value=\"true\">\r\n			<div id=\"playersList{counter}\">\r\n				<span class=\"cellHeadTiny\">Del</span>\r\n				<span class=\"cellHeadLarge\" style=\"width:134px;\">Team Name</span><br />\r\n				{foreach from=$competition.teams item=\"teams\" key=\"teamName\"}\r\n					{counter name=\"counterI\" start=\"0\" print=0}\r\n					{if $teams.name ne \"Waiting to Join\"}\r\n						<span class=\"cellTiny\" style=\"clear:left;\"><small><input type=\"checkbox\" name=\"manageTeam[delete][]\" value=\"{$teams.name}\"></small></span>\r\n						<span class=\"cellLarge\" style=\"width:134px;\"><small><input id=\"renameTeam\" type=\"text\" value=\"{$teams.name}\" name=\"manageTeam[rename][{$teams.name}]\" size=\"10\" style=\"width:124px;height:12px\"></small></span><br />\r\n					{/if}\r\n				{/foreach}\r\n			</div>\r\n                        <br />\r\n			<div style=\"text-align:center;\">New Team: <input id=\"addTeam\" type=\"text\" name=\"manageTeam[addTeam]\" size=\"10\"><br />\r\n			<br />\r\n                        <input type=\"submit\" class=\"button\" value=\"Submit Changes\"></div>\r\n			</form>\r\n		</div><br />\r\n		{/if}\r\n		{* End new section for Team management. *}\r\n\r\n		\r\n		{if !$isManager AND $competition.users|@count lt 45}{include file=\"layouts/ads.tpl\"}{assign var=\"adsShown\" value=\"1\"}{/if}\r\n\r\n			<h2 class=\"withBG\">Competition Stats</h2>\r\n			<span class=\"cellHeadLarge\">Category</span><span class=\"cellHeadSmall\">Result</span><br />\r\n			<span class=\"cellLarge\"><small>start weight</small></span>\r\n			<span class=\"cellSmall\"><small>{$competition.groupStartWeight|default:0} lbs</small></span><br />\r\n			<span class=\"cellLarge\"><small>weight lost</small></span>\r\n			<span class=\"cellSmall\"><small>{$competition.groupWeightLost|default:0} lbs</small></span><br />\r\n			{if $competition.groupPercentageWeightLost gt 0}<span class=\"cellLarge\"><small>% lost</small></span>\r\n			<span class=\"cellSmall\"><small>{$competition.groupPercentageWeightLost|default:0|number_format:\"2\"}</small></span><br />{/if}\r\n			<span class=\"cellLarge\"><small>fat intake</small></span>\r\n			<span class=\"cellSmall\"><small>{$competition.groupFat|default:0}</small></span><br />\r\n			<span class=\"cellLarge\"><small>calorie intake</small></span>\r\n			<span class=\"cellSmall\"><small>{$competition.groupCalories|default:0}</small></span><br />\r\n			<span class=\"cellLarge\"><small>minutes exercised</small></span>\r\n			<span class=\"cellSmall\"><small>{$competition.groupExercise|default:0}</small></span><br />\r\n			<span class=\"cellLarge\"><small>miles exercised</small></span>\r\n			<span class=\"cellSmall\"><small>{$competition.groupDistanceExercised|default:0}</small></span><br />\r\n			<img src=\"./img/blank.gif\" width=\"165\" height=\"1\" alt=\"\" />\r\n		</td>\r\n		<td width=\"100%\" valign=\"top\">\r\n			<div id=\"contentBox\" class=\"centerBox\" style=\"margin-left:10px;\"><div class=\"topRightTreasure\">\r\n<div id=\"jackpot\">{if $competition.potAmount gt 0}${$competition.potAmount|number_format:2}{/if}</div>\r\n<h1 class=\"underline\">{$competition.title|default:\"Competition Title\"}</h1>\r\n\r\n{* ******************************** COMPETITION END *********************************** *}\r\n{if $competition.endDate lt $smarty.now}   {* COMPETITION IS OVER *}\r\n	{if $competition.results.winners|@count eq 1}\r\n		{* There was one winner, either by scoringMethod or tieBreakerMethod *}\r\n\r\n		{math assign=\"daysOfCompetition\" equation=\"(x - y) / z\" x=$competition.endDate|default:\"0\" y=$competition.startDate|default:\"0\" z=\"86400\"}\r\n		{math assign=\"marginOfVictory\" equation=\"x - y\" x=$competition.results.winningStat|default:\"0\" y=$competition.results.secondPlaceStat|default:\"0\"}\r\n\r\n		{foreach from=$competition.results.winners item=\"winnerName\"}    {*key=\"winnerName\"*}\r\n			{assign var=\"winnerData\" value=$competitions.users.$winnerName}\r\n			\r\n			{if $competition.style eq \"Group-vs-Group\"}\r\n				{assign var=\"description\" value=\"Winning Team\"}\r\n				{assign var=\"avg\" value=\"average\"}\r\n			{else}\r\n				{assign var=\"description\" value=\"Winner\"}\r\n			{/if}\r\n\r\n			<h2><br /><b>{$winnerName}</b> is the {$description}{if $competition.potAmount}, taking home <b>$<i>{$competition.potAmount|number_format:2}</i></b>{/if}!</h2>\r\n			<br />\r\n			{strip}\r\n			{if not $competition.results.isTie}   {* Not a Tie *}\r\n				After a difficult <b>{$daysOfCompetition|number_format:0}</b> days of \r\n				fierce competition, <b>{$winnerName}</b> is the \r\n				{$description}!	Based on \r\n				<b>{$competition.results.winningMethod}</b>, <b>{$winnerName}</b> \r\n				won with <b>{$competition.results.winningStat|number_format:2} \r\n				{if $competition.results.winningMethod eq \"Weight Lost\"}{$avg} pounds lost\r\n				{elseif $competition.results.winningMethod eq \"Percentage Weight Lost\"}{$avg} % body weight lost\r\n				{elseif $competition.results.winningMethod eq \"Minutes Exercise\"}{$avg} minutes exercised\r\n				{elseif $competition.results.winningMethod eq \"Distance Exercised\"}{$avg} miles exercised\r\n				{elseif $competition.results.winningMethod eq \"Weight Gained\"}{$avg} pounds gained\r\n				{/if}</b>.\r\n			{else}                                {* A Tie! *}\r\n				{assign var=\"weightLost\" value=\"Weight Lost\"}\r\n				{assign var=\"percentLost\" value=\"Percentage Weight Lost\"}\r\n\r\n				After a difficult <b>{$daysOfCompetition|number_format:0}</b> \r\n				days of fierce competition, there was a tie in the judging \r\n				method, <b>{$competition.scoringMethod}</b>. To break this \r\n				tie, the selected tie breaking method, \r\n				<b>{$competition.tieBreakerMethod}</b>, was used to determine \r\n				<b>{$winnerName}</b> as the {$description}. <b>{$winnerName}</b> \r\n				won with <b>{$competition.results.winningStat|number_format:2}\r\n				{if $competition.results.winningMethod eq \"Weight Lost\"}{$avg} pounds lost\r\n				{elseif $competition.results.winningMethod eq \"Percentage Weight Lost\"}{$avg} % body weight lost\r\n				{elseif $competition.results.winningMethod eq \"Minutes Exercise\"}{$avg} minutes exercised\r\n				{elseif $competition.results.winningMethod eq \"Distance Exercised\"}{$avg} miles exercised\r\n				{elseif $competition.results.winningMethod eq \"Weight Gained\"}{$avg} pounds gained\r\n				{/if}</b>.\r\n				<!--\r\n				<b>{$winnerData.$weightLost|number_format:0} pounds</b>, which \r\n				was <b>{$winnerData.$percentLost|number_format:4}%</b> body weight.\r\n				-->\r\n			{/if}\r\n			{/strip}\r\n			<br />\r\n			<br />\r\n			<b>{$winnerName}</b> won with a <b>{$marginOfVictory|number_format:3}</b> margin over <b>{$competition.results.secondPlaceUser}</b>.\r\n			\r\n			<h2><br />Congratulations to you all!</h2>\r\n			<br />\r\n			<div class=\"underline\"></div>\r\n		{/foreach}\r\n\r\n	{elseif $competition.results.winners|@count gt 1}\r\n		{* There were multiple winners, even after tieBreakerMethod (should RARELY happen) *}\r\n	\r\n		<h2>There was a tie in this competition. The winners, by <b>{$competition.results.winningMethod}</b> having lost <b>{$competition.results.winningStat}</b>, are:<br /></h2>\r\n		<ul>\r\n		{foreach from=$competition.results.winners item=\"winnerData\" key=\"winnerName\"}\r\n			<li>{$winnerName}</li>\r\n		{/foreach}\r\n		</ul>\r\n		\r\n	{else}\r\n		{* For some reason, there were no winners *}\r\n\r\n		<h2><br />\r\n		Winner information is currently unavailable.<br />\r\n		Please check back soon.\r\n		<br /><br /></h2>\r\n	{/if}\r\n	This competition has ended and is no longer active.<br />\r\n{/if}\r\n{* ************************************************************************************ *}\r\n\r\n<div id=\"prizeDesc\">{$competition.potDescription}<br />\r\n{if $competition.potAmount}<small style=\"color:#FFF;\">(${$competition.individualPotAmount} from {$competition.potMethod})</small>{/if}</div>\r\n\r\n{if $competition.startDate lt $smarty.now}\r\n	Time remaining: <b>{$competition.timeLeft}</b><br />\r\n{else}\r\n	This competition has not yet started!<br />\r\n{/if}\r\n\r\nStart{if $competition.startDate lt $smarty.now}ed{else}s{/if}: <b>{$competition.startDate|date_format2:\"n/j/Y\"}</b> &nbsp; \r\nEnd{if $competition.endDate lt $smarty.now}ed{else}s{/if}: <b>{$competition.endDate|date_format2:\"n/j/Y\"}</b><br />\r\n{if $competition.calculationMode neq \"Real-Time\"}Competition stats/scoring updated as of {$competition.dateOfObject|date_format2:\"n/j/Y g:i A\"}{if $isManager} (<a href=\"?pg=competition&cid={$smarty.request.cid}&nocache=1\">Update Now!</a>){/if}<br />{/if}\r\n<div style=\"font-size:5px;clear:left;\">&nbsp;</div>\r\n{assign var=\"scoringMethod\" value=$competition.scoringMethod}\r\n{assign var=\"tieBreakerMethod\" value=$competition.tieBreakerMethod}\r\n{assign var=\"weeklyWinnersMethod1\" value=$competition.weeklyWinnersMethod1}\r\n{assign var=\"weeklyWinnersMethod2\" value=$competition.weeklyWinnersMethod2}\r\n\r\n{* ******************** WEEKLY WINNERS ********************* *}\r\n{if $competition.weeklyWinners}\r\n	{if $weeklyWinnersMethod1}             {* DON\'T FORGET TO REMOVE THE ACM CHECK WHEN READY!!! *}\r\n		<h2 class=\"withBG\">\r\n			<div class=\"topRight hideShow\">\r\n			<a href=\"javascript:toggle(\'weeklyWinners\', \'\', \'showHide\');\"><img id=\"weeklyWinners_img\" src=\"./img/blank.gif\" class=\"showHide_on\" alt=\"show/hide\" border=\"0\" /></a></div>\r\n			Last Week\'s Winners<i>!</i> <small style=\"color:#000; font-size:11px;\">(<i><b>{$competition.weeklyWinners.startDate|date_format2:\"D n/j\"}</b> through <b>{$competition.weeklyWinners.endDate|date_format2:\"D n/j\"}</b></i>)</small></h2> \r\n		<div id=\"weeklyWinners\">\r\n		<table width=\"100%\" cellpadding=\"3\" cellspacing=\"0\"><tr>\r\n		<td valign=\"top\" width=\"50%\">\r\n		<div class=\"cellHeadLarge\" style=\"width:auto;float:none;\">{$weeklyWinnersMethod1}</div>\r\n		<img src=\"{$skinFolder}images/winner_1.gif\" style=\"float:left;\" />\r\n		{strip}\r\n		{foreach name=\"method1\" from=$competition.weeklyWinners.$weeklyWinnersMethod1 item=\"username\"}\r\n			{assign var=\"userValue\" value=$competition.weeklyWinners.users.$username.$weeklyWinnersMethod1}\r\n			{if $smarty.foreach.method1.iteration gt 3 OR $userValue lte 0}{if $smarty.foreach.method1.iteration eq 1}Don\'t forget to update your progress so there will be winners next week{/if}<i>!</i>{php}break;{/php}\r\n			{elseif $smarty.foreach.method1.iteration eq 1}\r\n				<b>{$username|default:\"[ ?? ]\"|ucfirst}</b> led the way last week by \r\n				{if $weeklyWinnersMethod1 eq \'Weight Lost\'}losing <b>{$userValue}</b> pounds{elseif $weeklyWinnersMethod1 eq \'Percentage Weight Lost\'}losing <b>{$userValue|number_format:\"2\"}%</b> body weight{elseif $weeklyWinnersMethod1 eq \'Minutes Exercise\'}exercising <b>{$userValue}</b> minutes{elseif $weeklyWinnersMethod1 eq \'Distance Exercised\'}exercising <b>{$userValue}</b> miles{elseif $weeklyWinnersMethod1 eq \'Weight Gained\'}gaining <b>{$userValue}</b> pounds{else}<b>default</b>{/if}\r\n			{else}\r\n				{if $smarty.foreach.method1.iteration eq 2}, followed by <b>{$username|default:\"[ ?? ]\"|ucfirst}</b> with \r\n				{else} and <b>{$username|default:\"[ ?? ]\"|ucfirst}</b> with \r\n				{/if}\r\n				{if $weeklyWinnersMethod1 eq \'Weight Lost\'}<b>{$userValue}</b> pounds{elseif $weeklyWinnersMethod1 eq \'Percentage Weight Lost\'}<b>{$userValue|number_format:\"2\"}%</b>{elseif $weeklyWinnersMethod1 eq \'Minutes Exercise\'}<b>{$userValue}</b> minutes{elseif $weeklyWinnersMethod1 eq \'Distance Exercised\'}<b>{$userValue}</b> miles{elseif $weeklyWinnersMethod1 eq \'Weight Gained\'}<b>{$userValue}</b> pounds{/if}\r\n			{/if}\r\n		{/foreach}\r\n		{/strip}\r\n		</td>\r\n	{/if}\r\n	{if $weeklyWinnersMethod2} \r\n		<td valign=\"top\" width=\"50%\">\r\n		<div class=\"cellHeadLarge\" style=\"width:auto;float:none;\">{$weeklyWinnersMethod2}</div>\r\n		<img src=\"{$skinFolder}images/winner_2.gif\" style=\"float:left;\" />\r\n		{* display var=$competition.weeklyWinners.users *}\r\n		{strip}\r\n		{foreach name=\"method2\" from=$competition.weeklyWinners.$weeklyWinnersMethod2 item=\"username\"}\r\n			{assign var=\"userValue\" value=$competition.weeklyWinners.users.$username.$weeklyWinnersMethod2}\r\n			\r\n			{if $smarty.foreach.method2.iteration gt 3 OR $userValue lte 0}{if $smarty.foreach.method2.iteration eq 1}Don\'t forget to update your progress so there will be winners next week{/if}<i>!</i>{php}break;{/php}\r\n			{elseif $smarty.foreach.method2.iteration eq 1}\r\n				<b>{$username|default:\"[ ?? ]\"|ucfirst}</b> won by \r\n				{if $weeklyWinnersMethod2 eq \'Weight Lost\'}losing <b>{$userValue}</b> pounds{elseif $weeklyWinnersMethod2 eq \'Percentage Weight Lost\'}losing <b>{$userValue|number_format:\"2\"}%</b> body weight{elseif $weeklyWinnersMethod2 eq \'Minutes Exercise\'}exercising <b>{$userValue}</b> minutes{elseif $weeklyWinnersMethod2 eq \'Distance Exercised\'}exercising <b>{$userValue}</b> miles{elseif $weeklyWinnersMethod2 eq \'Weight Gained\'}gaining <b>{$userValue}</b> pounds{/if}\r\n			{else}\r\n				{if $smarty.foreach.method2.iteration eq 2}, followed by <b>{$username|default:\"[ ?? ]\"|ucfirst}</b> with \r\n				{else} and <b>{$username|default:\"[ ?? ]\"|ucfirst}</b> with \r\n				{/if}\r\n				{if $weeklyWinnersMethod2 eq \'Weight Lost\'}<b>{$userValue}</b> pounds{elseif $weeklyWinnersMethod2 eq \'Percentage Weight Lost\'}<b>{$userValue|number_format:\"2\"}%</b>{elseif $weeklyWinnersMethod2 eq \'Minutes Exercise\'}<b>{$userValue}</b> minutes{elseif $weeklyWinnersMethod2 eq \'Distance Exercised\'}<b>{$userValue}</b> miles{elseif $weeklyWinnersMethod2 eq \'Weight Gained\'}<b>{$userValue}</b> pounds{/if}\r\n			{/if}\r\n		{/foreach}\r\n		{/strip}\r\n		</td>\r\n	{/if}\r\n	{if $weeklyWinnersMethod1}\r\n	</tr></table></div>{/if}\r\n{/if}\r\n{* ********************************************************* *}\r\n\r\n{if $acm->isDomainAdmin() and $smarty.request.debug}\r\n	{display var=$competition}\r\n{/if} \r\n\r\n{* ******************************** COMPARISON GRAPHS ***************************************** *}\r\n{if $competition.availableGraphs|@count}\r\n{include_php file=\"shared_handle:competition.graphs\"}\r\n<h2 class=\"withBG\"><a name=\"graph\"></a>\r\n	<div class=\"topRight hideShow\">\r\n		<a href=\"javascript:toggle(\'graphs\', \'\', \'showHide\');\"><img id=\"graphs_img\" src=\"./img/blank.gif\" class=\"showHide_on\" alt=\"show/hide\" border=\"0\" /></a></div> \r\n	Comparison Graphs &nbsp; <small><i>No graph? <a href=\"http://www.macromedia.com/shockwave/download/download.cgi?P1_Prod_Version=ShockwaveFlash\" target=\"_blank\">click here</a> to download the free Flash Player plug-in.</i></small></h2>\r\n<div id=\"graphs\" style=\"display:block;\">\r\n	<table border=\"0\" cellpadding=\"0\" width=\"100%\">\r\n		{assign var=\"graphURL\" value=\"?pg=flashgraph-frame&format=wide\"}\r\n	<tr>\r\n		<td><div style=\"border:#999 1px solid;background-color:#FFF;padding:5px;\"><iframe name=\"graphwindow\" src=\"{$graphURL}\" frameborder=\"0\" width=\"625\" height=\"222\" scrollbars=\"no\"></iframe></div></td>\r\n	</tr>\r\n	<tr>\r\n		<td valign=\"top\" align=\"center\" width=\"100%\">\r\n		<small>\r\n		{foreach name=\"graphTypes\" from=$competition.availableGraphs key=\"graphType\" item=\"graphParams\"}\r\n		<a href=\"?pg=flashgraph-frame&compId={$competition.id}&{$graphParams}\" target=\"graphwindow\">{$graphType}</a>{if $smarty.foreach.graphTypes.iteration neq $competition.availableGraphs|@count} | {/if}\r\n		{/foreach}\r\n		</small></td>\r\n	</tr>\r\n	</table>\r\n<br />\r\n</div>\r\n{/if}\r\n\r\n{* ******************************** GROUP TEAMS/PLAYERS SUMMARY W/MOVING ***************************************** *}\r\n{if $competition.style eq \'Group-vs-Group\'}\r\n<h2 class=\"withBG\">\r\n	<div class=\"topRight hideShow\">\r\n		<a href=\"javascript:toggle(\'teams\', \'\', \'showHide\');\"><img id=\"teams_img\" src=\"./img/blank.gif\" class=\"showHide_on\" alt=\"show/hide\" border=\"0\" /></a></div> \r\n	The Teams &nbsp; <small><i>Assignments and statistics</i></small></h2>\r\n<div id=\"teams\" style=\"display:block;\">\r\n<table cellpadding=\"0\" cellspacing=\"0\" width=\"100%\" border=\"0\"><tr><td>\r\n	{if $isManager}\r\n		<form name=\"changeTeam\" action=\"index.php\" method=\"POST\" style=\"margin:0px;\">\r\n			<input type=\"hidden\" name=\"pg\" value=\"{$page.name}\">\r\n			<input type=\"hidden\" name=\"cid\" value=\"{$competition.id}\">\r\n			<input type=\"hidden\" name=\"no_expire\" value=\"true\">\r\n	{/if}\r\n		{assign var=\"minEx\" value=\"Minutes Exercise\"}\r\n		{assign var=\"distEx\" value=\"Distance Exercised\"}\r\n		{assign var=\"pctLst\" value=\"Percentage Weight Lost\"}\r\n		{assign var=\"wtLst\" value=\"Percentage Weight Lost\"}\r\n		{foreach from=$competition.teams name=\"teamsLoop\" item=\"teams\" key=\"teamName\"}\r\n			<div id=\"playersList{$smarty.foreach.teamsLoop.iteration}\" style=\"float:left;width:310px;overflow:hidden;word-wrap:nowrap; margin:0px 5px 5px 0px;\">\r\n			<h4>{if $teams.name eq \"Waiting to Join\"}Not assigned to a team{else}{$teams.name|default:\"&nbsp;\"}{/if}</h4>\r\n		{if $scoringMethod|regex_match:\"/exercise/i\"}\r\n			<span class=\"cellHeadLarge\">Name</span>\r\n			<span class=\"cellHeadSmall\">Min.</span>\r\n			<span class=\"cellHeadSmall\">Dist.</span>\r\n			<span class=\"cellHeadSmall\">Update</span><br />\r\n			{foreach from=$teams.users item=\"users\" key=\"userName\"}\r\n				<span class=\"cellLarge\" style=\"text-align:left;\"><small>{if $isManager}<input type=\"checkbox\" name=\"changeTeam[players][{$userName}]\" style=\"width:14px;height:14px;margin:0px 2px;\" />{/if}{$userName}</small></span>\r\n				<span class=\"cellSmall\"><small>{$users.$minEx|default:\"-\"|replace:\".00\":\"\"}</small></span>\r\n				<span class=\"cellSmall\"><small>{$users.$distEx|default:\"-\"|replace:\".00\":\"\"}</small></span>\r\n				<span class=\"cellSmall\"><small>{if $users.dateOfEntry}{$users.dateOfEntry|date_format2:\"n/j/y\"}{else}Never{/if}</small></span>\r\n			{foreachelse}\r\n				{* No players assigned to this team. *}\r\n			{/foreach}\r\n		{else}\r\n			<span class=\"cellHeadLarge\">Name</span>\r\n			<span class=\"cellHeadTiny\">%</span>\r\n			<span class=\"cellHeadSmall\">Update</span><br />\r\n			{foreach from=$teams.users item=\"users\" key=\"userName\"}\r\n				<span class=\"cellLarge\" style=\"clear:left;text-align:left;\"><small>{if $isManager}<input type=\"checkbox\" name=\"changeTeam[players][{$userName}]\" />{/if}{$userName}</small></span>\r\n				<span class=\"cellTiny\"><small>{if $users.hideInitialWeight neq \"Yes\"}{$users.$pctLst|number_format:\"2\"|replace:\".00\":\"\"}{else}-{/if}</small></span>\r\n				<span class=\"cellSmall\"><small>{if $users.dateOfEntry}{$users.dateOfEntry|date_format2:\"n/j/y\"}{else}Never{/if}</small></span><br />\r\n			{foreachelse}\r\n				{* No players assigned to this team. *}\r\n			{/foreach}\r\n		{/if}\r\n			</div>\r\n		{/foreach}\r\n	{if $isManager}\r\n		<br />\r\n		<select name=\"changeTeam[team]\">\r\n			<option value=\"\">Move selected players to...</option>\r\n			{foreach from=$competition.teams item=\"newTeams\" key=\"newTeamName\"}\r\n				{*if $newTeams.name ne $teams.name and $newTeams.name ne \"Waiting to Join\"*}\r\n				{if $newTeams.name ne \"Waiting to Join\"}\r\n					<option value=\"{$newTeams.name}\">{$newTeams.name}</option>\r\n				{/if}\r\n			{/foreach}\r\n		</select><br />\r\n		<input type=\"submit\" class=\"button\" value=\"Submit Changes\">\r\n		</form>\r\n	{/if}\r\n</td></tr></table>\r\n</div>\r\n{/if}\r\n</div>\r\n	{* ******************************** DISCUSSION BOARD ***************************************** *}\r\n<br />\r\n<h2 class=\"withBG\">\r\n	<div class=\"topRight hideShow\">\r\n		<a href=\"javascript:toggle(\'discuss\', \'\', \'showHide\');\"><img id=\"discuss_img\" src=\"./img/blank.gif\" class=\"showHide_on\" alt=\"show/hide\" border=\"0\" /></a></div> \r\n	Discussion Board</h2>\r\n<div id=\"discuss\" style=\"display:block;\">\r\n	<table cellpadding=\"0\" width=\"100%\" border=\"0\"><tr><td><iframe src=\"?pg=competition/forum\" id=\"discussionBoard\" frameborder=\"0\" scrolling=\"yes\" style=\"width:100%;\"></iframe></td></tr></table>\r\n</div>\r\n\r\n</div></td>\r\n</tr></table>'),(3561,222,0.24,'smarty','0','Page created.',1113343730,3,'24.10.217.227','{assign var=\"hideWidgets\" value=0}\r\n{assign var=\"hideUserBox\" value=\"false\"}\r\n{assign var=\"showCompanyNews\" value=\"true\"}\r\n{assign var=\"pgLayout\" value=\"layouts/withLeftNav.tpl\"}\r\n\r\n{include_php file=\"shared_handle:competition.load\"}\r\n{if $competition.userId eq $user->id or $acm->isDomainAdmin()}\r\n	{assign var=\"isManager\" value=\"true\"}\r\n	<!-- ismanager -->\r\n	{include_php file=\"shared_handle:competition.management\"}\r\n{/if}\r\n\r\n{include_php file=\"shared_handle:competition.verifyInitialPot\"}\r\n\r\n<table width=\"100%\" cellpadding=\"0\" cellspacing=\"0\" border=\"0\">\r\n	<tr>\r\n		<td valign=\"top\" width=\"260\">\r\n		<br />\r\n		<h2 class=\"withBG\">\r\n			<div class=\"topRight hideShow\">\r\n					<a href=\"javascript:toggle(\'leaderBoard\', \'\', \'showHide\');\"><img id=\"leaderBoard_img\" src=\"./img/blank.gif\" class=\"showHide_on\" alt=\"show/hide\" border=\"0\" /></a>\r\n				</div>\r\n			Leaders\r\n		</h2>\r\n		{if $competition.dateOfObject}<div align=\"right\"><small><i>as of {$competition.dateOfObject|date_format2:\"n/j/Y g:i A\"}</i></small></div>{/if}\r\n		<div id=\"leaderBoard\" style=\"display:block;\">\r\n		{if $competition.style eq \'Group-vs-Group\'}\r\n			<div style=\"white-space:nowrap;display:block;\">\r\n			<span class=\"cellHeadTiny\">#</span>\r\n			<span class=\"cellHeadBig\">Team</span>\r\n			<span class=\"cellHeadTiny\">{if $competition.scoringMethod eq \'Percentage Weight Lost\'}%\r\n					{elseif $competition.scoringMethod eq \'Weight Lost\' or $competition.scoringMethod eq \'Weight Gained\'}Lbs\r\n					{elseif $competition.scoringMethod eq \'Minutes Exercise\'}Min\r\n					{elseif $competition.scoringMethod eq \'Distance Exercised\'}Dist\r\n			{/if}</span>\r\n			<span class=\"cellHeadTiny\">#Pl</span>\r\n			</div>\r\n			{foreach name=\"rankLoop\" from=$competition.teams item=\"teams\" key=\"teamName\"}\r\n				{if $teams.name ne \"Waiting to Join\"}\r\n					{if not $teams.userCount}\r\n						{assign var=\"score\" value=\"-\"}\r\n					{elseif $competition.scoringMethod eq \'Percentage Weight Lost\'}\r\n						{assign var=\"score\" value=$teams.averagePercentLost|number_format:\"2\"|default:\"-\"}\r\n					{elseif $competition.scoringMethod eq \'Weight Lost\'}\r\n						{assign var=\"score\" value=$teams.averageWeightLost|number_format:\"2\"|default:\"-\"}\r\n					{elseif $competition.scoringMethod eq \'Weight Gained\'}\r\n						{assign var=\"score\" value=$teams.averageWeightGain|number_format:\"2\"|default:\"-\"}\r\n					{elseif $competition.scoringMethod eq \'Minutes Exercise\'}\r\n						{assign var=\"score\" value=$teams.averageExercise|number_format:\"2\"|default:\"-\"}\r\n					{elseif $competition.scoringMethod eq \'Distance Exercised\'}\r\n						{assign var=\"score\" value=$teams.averageDistance|number_format:\"2\"|default:\"-\"}\r\n					{/if}\r\n					<div style=\"white-space:nowrap;display:block;\">\r\n						<span class=\"cellTiny\" style=\"clear:left;\"><small>{$smarty.foreach.rankLoop.iteration}</small></span>\r\n						<span class=\"cellBig\"><small class=\"mini\">{$teams.name|default:\"&nbsp;\"}</small></span>\r\n						<span class=\"cellTiny\"><small>{$score|replace:\".00\":\"\"}</small></span>\r\n						<span class=\"cellTiny\"><small>{$teams.userCount|default:\"0\"}</small></span>\r\n					</div>\r\n				{/if}\r\n			{/foreach}\r\n		{else}\r\n			{if $user->username eq \"trave\"}{display $competition}{/if}\r\n			<div style=\"white-space:nowrap;display:block;\">\r\n			<span class=\"cellHeadTiny\">#</span>\r\n			<span class=\"cellHeadSmall\">Name</span>\r\n			<span class=\"cellHeadTiny\">{if $competition.scoringMethod eq \'Percentage Weight Lost\'}%\r\n					{elseif $competition.scoringMethod eq \'Weight Lost\' or $competition.scoringMethod eq \'Weight Gained\'}Lbs\r\n					{elseif $competition.scoringMethod eq \'Minutes Exercise\'}Min\r\n					{elseif $competition.scoringMethod eq \'Distance Exercised\'}Dist\r\n			{/if}</span>\r\n			<span class=\"cellHeadSmall\">Update</span>\r\n			</div>\r\n			{foreach from=$competition.users item=\"compUser\" key=\"username\" name=\"dateUpdated\"}\r\n			{if $smarty.foreach.dateUpdated.iteration eq 21}\r\n			</div>\r\n			<br />\r\n			<h2 class=\"withBG\">\r\n				<div class=\"topRight hideShow\">\r\n					<a href=\"javascript:toggle(\'runnerUps\', \'\', \'showHide\');\"><img id=\"runnerUps_img\" src=\"./img/blank.gif\" class=\"showHide_off\" alt=\"show/hide\" border=\"0\" /></a>\r\n				</div>\r\n				Runner Ups\r\n			</h2>\r\n			<div id=\"runnerUps\" style=\"display:none;\">\r\n			{/if}\r\n			<span class=\"cellTiny\" style=\"clear:left;\"><small>{$smarty.foreach.dateUpdated.iteration}</small></span>\r\n			<span class=\"cellSmall\"><small class=\"mini\">{$username}</small></span>\r\n			<span class=\"cellTiny\"><small>{if $scoringMethod eq \"Percentage Weight Lost\"}{$compUser.$scoringMethod|number_format:\"2\"|replace:\".00\":\"\"|default:\"~\"}{else}{$compUser.$scoringMethod|replace:\".00\":\"\"|default:\"-\"}{/if}</small></span>\r\n			<span class=\"cellSmall\"><small>{if $compUser.dateOfEntry}{$compUser.dateOfEntry|date_format2:\"n/j/y\"}{else}-Never-{/if}</small></span>\r\n			{/foreach}\r\n		{/if}\r\n		</div> \r\n		<div align=\"right\"><small><i><a href=\"?pg=faq#comp\">How is the competition scored?</a></i></small></div>\r\n		<img src=\"./img/blank.gif\" width=\"168\" height=\"1\" alt=\"\" />\r\n		{if $isManager}\r\n		<h2 class=\"withBG\">\r\n			<div class=\"topRight hideShow\">\r\n				<a href=\"javascript:toggle(\'managePlayers\', \'\', \'showHide\');\"><img id=\"managePlayers_img\" src=\"./img/blank.gif\" class=\"showHide_off\" alt=\"show/hide\" border=\"0\" /></a>\r\n			</div> \r\n			Manage\r\n		</h2>\r\n		<div id=\"managePlayers\" style=\"display:none;\">\r\n					<form name=\"managePlayers[]\" action=\"index.php\" method=\"POST\" style=\"margin:0px;\">\r\n					<input type=\"hidden\" name=\"pg\" value=\"{$page.name}\">\r\n					<input type=\"hidden\" name=\"cid\" value=\"{$competition.id}\">\r\n					<input type=\"hidden\" name=\"no_expire\" value=\"true\">\r\n					<input type=\"hidden\" name=\"style\" value=\"{$competition.style}\">\r\n							{if $competition.style eq \'Group-vs-Group\'}\r\n								<span class=\"cellHeadTiny\" style=\"clear:left;\">Del</span>\r\n								<span class=\"cellHead\">View Stats</span>\r\n								<span class=\"cellHeadSmall\">-</span><br />\r\n								{foreach from=$competition.teams item=\"teams\" key=\"teamName\"}\r\n									{foreach from=$teams.users item=\"users\" key=\"userName\"}\r\n										<span class=\"cellTiny\" style=\"clear:left;\"><small><input type=\"checkbox\" name=\"managePlayers[delete][]\" value=\"{$userName}\" style=\"width:14px; height:14px;margin:0px 2px;\"></small></span>\r\n										<span class=\"cell\"><small><a href=\"?pg=myhome&cid={$competition.id}&userId={$users.id}&hideComps=1\">{$userName}</a></small></span>\r\n										<span class=\"cellSmall\"><small><a href=\"mailto:{$users.email}\">email</a></small></span><br />\r\n									{/foreach}\r\n								{/foreach}\r\n							{else}\r\n								<span class=\"cellHeadTiny\" style=\"clear:left;\">Del</span>\r\n								<span class=\"cellHead\">View Stats</span>\r\n								<span class=\"cellHeadSmall\">-</span><br />\r\n								{foreach from=$competition.users item=\"compUser\" key=\"username\" name=\"dateUpdated\"}\r\n									<span class=\"cellTiny\" style=\"clear:left;\"><small><input type=\"checkbox\" name=\"managePlayers[delete][]\" value=\"{$username}\" style=\"width:14px;height:14px;margin:0px 2px;\"></small></span>\r\n									<span class=\"cell\"><small><a href=\"?pg=myhome&cid={$competition.id}&userId={$compUser.id}&hideComps=1\">{$username}</a></small></span>\r\n									<span class=\"cellSmall\"><small><a href=\"mailto:{$compUser.email}\">email</a></small></span><br />\r\n								{/foreach}\r\n							{/if}\r\n					<div style=\"text-align:center;\">\r\n                                                <br />\r\n						<input type=\"submit\" class=\"button\" value=\"Delete Selected\">\r\n					</div>\r\n					</form>\r\n		</div><br/>\r\n		{/if}\r\n		{* End new section for Player management. *}\r\n		\r\n		{* Begin new section for Team management.  This can be moved where ever. *}\r\n		{* ******************************** TEAM MANAGEMENT ***************************************** *}\r\n		{if $isManager and $competition.style eq \'Group-vs-Group\'}\r\n		<h2 class=\"withBG\">\r\n			<div class=\"topRight hideShow\">\r\n				<a href=\"javascript:toggle(\'teamManagement\', \'\', \'showHide\');\"><img id=\"teamManagement_img\" src=\"./img/blank.gif\" class=\"showHide_{if $smarty.request.showTeamManagement}on{else}off{/if}\" alt=\"show/hide\" border=\"0\" /></a>\r\n			</div>\r\n			Teams</h2>\r\n		<div id=\"teamManagement\" style=\"display:{if $smarty.request.showTeamManagement}block{else}none{/if};\">\r\n			<form name=\"manageTeam[]\" action=\"index.php\" method=\"POST\" style=\"margin:0px;\">\r\n			<input type=\"hidden\" name=\"pg\" value=\"{$page.name}\">\r\n			<input type=\"hidden\" name=\"cid\" value=\"{$competition.id}\">\r\n			<input type=\"hidden\" name=\"no_expire\" value=\"true\">\r\n			<div id=\"playersList{counter}\">\r\n				<span class=\"cellHeadTiny\">Del</span>\r\n				<span class=\"cellHeadLarge\" style=\"width:134px;\">Team Name</span><br />\r\n				{foreach from=$competition.teams item=\"teams\" key=\"teamName\"}\r\n					{counter name=\"counterI\" start=\"0\" print=0}\r\n					{if $teams.name ne \"Waiting to Join\"}\r\n						<span class=\"cellTiny\" style=\"clear:left;\"><small><input type=\"checkbox\" name=\"manageTeam[delete][]\" value=\"{$teams.name}\"></small></span>\r\n						<span class=\"cellLarge\" style=\"width:134px;\"><small><input id=\"renameTeam\" type=\"text\" value=\"{$teams.name}\" name=\"manageTeam[rename][{$teams.name}]\" size=\"10\" style=\"width:124px;height:12px\"></small></span><br />\r\n					{/if}\r\n				{/foreach}\r\n			</div>\r\n                        <br />\r\n			<div style=\"text-align:center;\">New Team: <input id=\"addTeam\" type=\"text\" name=\"manageTeam[addTeam]\" size=\"10\"><br />\r\n			<br />\r\n                        <input type=\"submit\" class=\"button\" value=\"Submit Changes\"></div>\r\n			</form>\r\n		</div><br />\r\n		{/if}\r\n		{* End new section for Team management. *}\r\n\r\n		\r\n		{if !$isManager AND $competition.users|@count lt 45}{include file=\"layouts/ads.tpl\"}{assign var=\"adsShown\" value=\"1\"}{/if}\r\n\r\n			<h2 class=\"withBG\">Competition Stats</h2>\r\n			<span class=\"cellHeadLarge\">Category</span><span class=\"cellHeadSmall\">Result</span><br />\r\n			<span class=\"cellLarge\"><small>start weight</small></span>\r\n			<span class=\"cellSmall\"><small>{$competition.groupStartWeight|default:0} lbs</small></span><br />\r\n			<span class=\"cellLarge\"><small>weight lost</small></span>\r\n			<span class=\"cellSmall\"><small>{$competition.groupWeightLost|default:0} lbs</small></span><br />\r\n			{if $competition.groupPercentageWeightLost gt 0}<span class=\"cellLarge\"><small>% lost</small></span>\r\n			<span class=\"cellSmall\"><small>{$competition.groupPercentageWeightLost|default:0|number_format:\"2\"}</small></span><br />{/if}\r\n			<span class=\"cellLarge\"><small>fat intake</small></span>\r\n			<span class=\"cellSmall\"><small>{$competition.groupFat|default:0}</small></span><br />\r\n			<span class=\"cellLarge\"><small>calorie intake</small></span>\r\n			<span class=\"cellSmall\"><small>{$competition.groupCalories|default:0}</small></span><br />\r\n			<span class=\"cellLarge\"><small>minutes exercised</small></span>\r\n			<span class=\"cellSmall\"><small>{$competition.groupExercise|default:0}</small></span><br />\r\n			<span class=\"cellLarge\"><small>miles exercised</small></span>\r\n			<span class=\"cellSmall\"><small>{$competition.groupDistanceExercised|default:0}</small></span><br />\r\n			<img src=\"./img/blank.gif\" width=\"165\" height=\"1\" alt=\"\" />\r\n		</td>\r\n		<td width=\"100%\" valign=\"top\">\r\n			<div id=\"contentBox\" class=\"centerBox\" style=\"margin-left:10px;\"><div class=\"topRightTreasure\">\r\n<div id=\"jackpot\">{if $competition.potAmount gt 0}${$competition.potAmount|number_format:2}{/if}</div>\r\n<h1 class=\"underline\">{$competition.title|default:\"Competition Title\"}</h1>\r\n\r\n{* ******************************** COMPETITION END *********************************** *}\r\n{if $competition.endDate lt $smarty.now}   {* COMPETITION IS OVER *}\r\n	{if $competition.results.winners|@count eq 1}\r\n		{* There was one winner, either by scoringMethod or tieBreakerMethod *}\r\n\r\n		{math assign=\"daysOfCompetition\" equation=\"(x - y) / z\" x=$competition.endDate|default:\"0\" y=$competition.startDate|default:\"0\" z=\"86400\"}\r\n		{math assign=\"marginOfVictory\" equation=\"x - y\" x=$competition.results.winningStat|default:\"0\" y=$competition.results.secondPlaceStat|default:\"0\"}\r\n\r\n		{foreach from=$competition.results.winners item=\"winnerName\"}    {*key=\"winnerName\"*}\r\n			{assign var=\"winnerData\" value=$competitions.users.$winnerName}\r\n			\r\n			{if $competition.style eq \"Group-vs-Group\"}\r\n				{assign var=\"description\" value=\"Winning Team\"}\r\n				{assign var=\"avg\" value=\"average\"}\r\n			{else}\r\n				{assign var=\"description\" value=\"Winner\"}\r\n			{/if}\r\n\r\n			<h2><br /><b>{$winnerName}</b> is the {$description}{if $competition.potAmount}, taking home <b>$<i>{$competition.potAmount|number_format:2}</i></b>{/if}!</h2>\r\n			<br />\r\n			{strip}\r\n			{if not $competition.results.isTie}   {* Not a Tie *}\r\n				After a difficult <b>{$daysOfCompetition|number_format:0}</b> days of \r\n				fierce competition, <b>{$winnerName}</b> is the \r\n				{$description}!	Based on \r\n				<b>{$competition.results.winningMethod}</b>, <b>{$winnerName}</b> \r\n				won with <b>{$competition.results.winningStat|number_format:2} \r\n				{if $competition.results.winningMethod eq \"Weight Lost\"}{$avg} pounds lost\r\n				{elseif $competition.results.winningMethod eq \"Percentage Weight Lost\"}{$avg} % body weight lost\r\n				{elseif $competition.results.winningMethod eq \"Minutes Exercise\"}{$avg} minutes exercised\r\n				{elseif $competition.results.winningMethod eq \"Distance Exercised\"}{$avg} miles exercised\r\n				{elseif $competition.results.winningMethod eq \"Weight Gained\"}{$avg} pounds gained\r\n				{/if}</b>.\r\n			{else}                                {* A Tie! *}\r\n				{assign var=\"weightLost\" value=\"Weight Lost\"}\r\n				{assign var=\"percentLost\" value=\"Percentage Weight Lost\"}\r\n\r\n				After a difficult <b>{$daysOfCompetition|number_format:0}</b> \r\n				days of fierce competition, there was a tie in the judging \r\n				method, <b>{$competition.scoringMethod}</b>. To break this \r\n				tie, the selected tie breaking method, \r\n				<b>{$competition.tieBreakerMethod}</b>, was used to determine \r\n				<b>{$winnerName}</b> as the {$description}. <b>{$winnerName}</b> \r\n				won with <b>{$competition.results.winningStat|number_format:2}\r\n				{if $competition.results.winningMethod eq \"Weight Lost\"}{$avg} pounds lost\r\n				{elseif $competition.results.winningMethod eq \"Percentage Weight Lost\"}{$avg} % body weight lost\r\n				{elseif $competition.results.winningMethod eq \"Minutes Exercise\"}{$avg} minutes exercised\r\n				{elseif $competition.results.winningMethod eq \"Distance Exercised\"}{$avg} miles exercised\r\n				{elseif $competition.results.winningMethod eq \"Weight Gained\"}{$avg} pounds gained\r\n				{/if}</b>.\r\n				<!--\r\n				<b>{$winnerData.$weightLost|number_format:0} pounds</b>, which \r\n				was <b>{$winnerData.$percentLost|number_format:4}%</b> body weight.\r\n				-->\r\n			{/if}\r\n			{/strip}\r\n			<br />\r\n			<br />\r\n			<b>{$winnerName}</b> won with a <b>{$marginOfVictory|number_format:3}</b> margin over <b>{$competition.results.secondPlaceUser}</b>.\r\n			\r\n			<h2><br />Congratulations to you all!</h2>\r\n			<br />\r\n			<div class=\"underline\"></div>\r\n		{/foreach}\r\n\r\n	{elseif $competition.results.winners|@count gt 1}\r\n		{* There were multiple winners, even after tieBreakerMethod (should RARELY happen) *}\r\n	\r\n		<h2>There was a tie in this competition. The winners, by <b>{$competition.results.winningMethod}</b> having lost <b>{$competition.results.winningStat}</b>, are:<br /></h2>\r\n		<ul>\r\n		{foreach from=$competition.results.winners item=\"winnerData\" key=\"winnerName\"}\r\n			<li>{$winnerName}</li>\r\n		{/foreach}\r\n		</ul>\r\n		\r\n	{else}\r\n		{* For some reason, there were no winners *}\r\n\r\n		<h2><br />\r\n		Winner information is currently unavailable.<br />\r\n		Please check back soon.\r\n		<br /><br /></h2>\r\n	{/if}\r\n	This competition has ended and is no longer active.<br />\r\n{/if}\r\n{* ************************************************************************************ *}\r\n\r\n<div id=\"prizeDesc\">{$competition.potDescription}<br />\r\n{if $competition.potAmount}<small style=\"color:#FFF;\">(${$competition.individualPotAmount} from {$competition.potMethod})</small>{/if}</div>\r\n\r\n{if $competition.startDate lt $smarty.now}\r\n	Time remaining: <b>{$competition.timeLeft}</b><br />\r\n{else}\r\n	This competition has not yet started!<br />\r\n{/if}\r\n\r\nStart{if $competition.startDate lt $smarty.now}ed{else}s{/if}: <b>{$competition.startDate|date_format2:\"n/j/Y\"}</b> &nbsp; \r\nEnd{if $competition.endDate lt $smarty.now}ed{else}s{/if}: <b>{$competition.endDate|date_format2:\"n/j/Y\"}</b><br />\r\n{if $competition.calculationMode neq \"Real-Time\"}Competition stats/scoring updated as of {$competition.dateOfObject|date_format2:\"n/j/Y g:i A\"}{if $isManager} (<a href=\"?pg=competition&cid={$smarty.request.cid}&nocache=1\">Update Now!</a>){/if}<br />{/if}\r\n<div style=\"font-size:5px;clear:left;\">&nbsp;</div>\r\n{assign var=\"scoringMethod\" value=$competition.scoringMethod}\r\n{assign var=\"tieBreakerMethod\" value=$competition.tieBreakerMethod}\r\n{assign var=\"weeklyWinnersMethod1\" value=$competition.weeklyWinnersMethod1}\r\n{assign var=\"weeklyWinnersMethod2\" value=$competition.weeklyWinnersMethod2}\r\n\r\n{* ******************** WEEKLY WINNERS ********************* *}\r\n{if $competition.weeklyWinners}\r\n	{if $weeklyWinnersMethod1}             {* DON\'T FORGET TO REMOVE THE ACM CHECK WHEN READY!!! *}\r\n		<h2 class=\"withBG\">\r\n			<div class=\"topRight hideShow\">\r\n			<a href=\"javascript:toggle(\'weeklyWinners\', \'\', \'showHide\');\"><img id=\"weeklyWinners_img\" src=\"./img/blank.gif\" class=\"showHide_on\" alt=\"show/hide\" border=\"0\" /></a></div>\r\n			Last Week\'s Winners<i>!</i> <small style=\"color:#000; font-size:11px;\">(<i><b>{$competition.weeklyWinners.startDate|date_format2:\"D n/j\"}</b> through <b>{$competition.weeklyWinners.endDate|date_format2:\"D n/j\"}</b></i>)</small></h2> \r\n		<div id=\"weeklyWinners\">\r\n		<table width=\"100%\" cellpadding=\"3\" cellspacing=\"0\"><tr>\r\n		<td valign=\"top\" width=\"50%\">\r\n		<div class=\"cellHeadLarge\" style=\"width:auto;float:none;\">{$weeklyWinnersMethod1}</div>\r\n		<img src=\"{$skinFolder}images/winner_1.gif\" style=\"float:left;\" />\r\n		{strip}\r\n		{foreach name=\"method1\" from=$competition.weeklyWinners.$weeklyWinnersMethod1 item=\"username\"}\r\n			{assign var=\"userValue\" value=$competition.weeklyWinners.users.$username.$weeklyWinnersMethod1}\r\n			{if $smarty.foreach.method1.iteration gt 3 OR $userValue lte 0}{if $smarty.foreach.method1.iteration eq 1}Don\'t forget to update your progress so there will be winners next week{/if}<i>!</i>{php}break;{/php}\r\n			{elseif $smarty.foreach.method1.iteration eq 1}\r\n				<b>{$username|default:\"[ ?? ]\"|ucfirst}</b> led the way last week by \r\n				{if $weeklyWinnersMethod1 eq \'Weight Lost\'}losing <b>{$userValue}</b> pounds{elseif $weeklyWinnersMethod1 eq \'Percentage Weight Lost\'}losing <b>{$userValue|number_format:\"2\"}%</b> body weight{elseif $weeklyWinnersMethod1 eq \'Minutes Exercise\'}exercising <b>{$userValue}</b> minutes{elseif $weeklyWinnersMethod1 eq \'Distance Exercised\'}exercising <b>{$userValue}</b> miles{elseif $weeklyWinnersMethod1 eq \'Weight Gained\'}gaining <b>{$userValue}</b> pounds{else}<b>default</b>{/if}\r\n			{else}\r\n				{if $smarty.foreach.method1.iteration eq 2}, followed by <b>{$username|default:\"[ ?? ]\"|ucfirst}</b> with \r\n				{else} and <b>{$username|default:\"[ ?? ]\"|ucfirst}</b> with \r\n				{/if}\r\n				{if $weeklyWinnersMethod1 eq \'Weight Lost\'}<b>{$userValue}</b> pounds{elseif $weeklyWinnersMethod1 eq \'Percentage Weight Lost\'}<b>{$userValue|number_format:\"2\"}%</b>{elseif $weeklyWinnersMethod1 eq \'Minutes Exercise\'}<b>{$userValue}</b> minutes{elseif $weeklyWinnersMethod1 eq \'Distance Exercised\'}<b>{$userValue}</b> miles{elseif $weeklyWinnersMethod1 eq \'Weight Gained\'}<b>{$userValue}</b> pounds{/if}\r\n			{/if}\r\n		{/foreach}\r\n		{/strip}\r\n		</td>\r\n	{/if}\r\n	{if $weeklyWinnersMethod2} \r\n		<td valign=\"top\" width=\"50%\">\r\n		<div class=\"cellHeadLarge\" style=\"width:auto;float:none;\">{$weeklyWinnersMethod2}</div>\r\n		<img src=\"{$skinFolder}images/winner_2.gif\" style=\"float:left;\" />\r\n		{* display var=$competition.weeklyWinners.users *}\r\n		{strip}\r\n		{foreach name=\"method2\" from=$competition.weeklyWinners.$weeklyWinnersMethod2 item=\"username\"}\r\n			{assign var=\"userValue\" value=$competition.weeklyWinners.users.$username.$weeklyWinnersMethod2}\r\n			\r\n			{if $smarty.foreach.method2.iteration gt 3 OR $userValue lte 0}{if $smarty.foreach.method2.iteration eq 1}Don\'t forget to update your progress so there will be winners next week{/if}<i>!</i>{php}break;{/php}\r\n			{elseif $smarty.foreach.method2.iteration eq 1}\r\n				<b>{$username|default:\"[ ?? ]\"|ucfirst}</b> won by \r\n				{if $weeklyWinnersMethod2 eq \'Weight Lost\'}losing <b>{$userValue}</b> pounds{elseif $weeklyWinnersMethod2 eq \'Percentage Weight Lost\'}losing <b>{$userValue|number_format:\"2\"}%</b> body weight{elseif $weeklyWinnersMethod2 eq \'Minutes Exercise\'}exercising <b>{$userValue}</b> minutes{elseif $weeklyWinnersMethod2 eq \'Distance Exercised\'}exercising <b>{$userValue}</b> miles{elseif $weeklyWinnersMethod2 eq \'Weight Gained\'}gaining <b>{$userValue}</b> pounds{/if}\r\n			{else}\r\n				{if $smarty.foreach.method2.iteration eq 2}, followed by <b>{$username|default:\"[ ?? ]\"|ucfirst}</b> with \r\n				{else} and <b>{$username|default:\"[ ?? ]\"|ucfirst}</b> with \r\n				{/if}\r\n				{if $weeklyWinnersMethod2 eq \'Weight Lost\'}<b>{$userValue}</b> pounds{elseif $weeklyWinnersMethod2 eq \'Percentage Weight Lost\'}<b>{$userValue|number_format:\"2\"}%</b>{elseif $weeklyWinnersMethod2 eq \'Minutes Exercise\'}<b>{$userValue}</b> minutes{elseif $weeklyWinnersMethod2 eq \'Distance Exercised\'}<b>{$userValue}</b> miles{elseif $weeklyWinnersMethod2 eq \'Weight Gained\'}<b>{$userValue}</b> pounds{/if}\r\n			{/if}\r\n		{/foreach}\r\n		{/strip}\r\n		</td>\r\n	{/if}\r\n	{if $weeklyWinnersMethod1}\r\n	</tr></table></div>{/if}\r\n{/if}\r\n{* ********************************************************* *}\r\n\r\n{if $acm->isDomainAdmin() and $smarty.request.debug}\r\n	{display var=$competition}\r\n{/if} \r\n\r\n{* ******************************** COMPARISON GRAPHS ***************************************** *}\r\n{if $competition.availableGraphs|@count}\r\n{include_php file=\"shared_handle:competition.graphs\"}\r\n<h2 class=\"withBG\"><a name=\"graph\"></a>\r\n	<div class=\"topRight hideShow\">\r\n		<a href=\"javascript:toggle(\'graphs\', \'\', \'showHide\');\"><img id=\"graphs_img\" src=\"./img/blank.gif\" class=\"showHide_on\" alt=\"show/hide\" border=\"0\" /></a></div> \r\n	Comparison Graphs &nbsp; <small><i>No graph? <a href=\"http://www.macromedia.com/shockwave/download/download.cgi?P1_Prod_Version=ShockwaveFlash\" target=\"_blank\">click here</a> to download the free Flash Player plug-in.</i></small></h2>\r\n<div id=\"graphs\" style=\"display:block;\">\r\n	<table border=\"0\" cellpadding=\"0\" width=\"100%\">\r\n		{assign var=\"graphURL\" value=\"?pg=flashgraph-frame&format=wide\"}\r\n	<tr>\r\n		<td><div style=\"border:#999 1px solid;background-color:#FFF;padding:5px;\"><iframe name=\"graphwindow\" src=\"{$graphURL}\" frameborder=\"0\" width=\"625\" height=\"222\" scrollbars=\"no\"></iframe></div></td>\r\n	</tr>\r\n	<tr>\r\n		<td valign=\"top\" align=\"center\" width=\"100%\">\r\n		<small>\r\n		{foreach name=\"graphTypes\" from=$competition.availableGraphs key=\"graphType\" item=\"graphParams\"}\r\n		<a href=\"?pg=flashgraph-frame&compId={$competition.id}&{$graphParams}\" target=\"graphwindow\">{$graphType}</a>{if $smarty.foreach.graphTypes.iteration neq $competition.availableGraphs|@count} | {/if}\r\n		{/foreach}\r\n		</small></td>\r\n	</tr>\r\n	</table>\r\n<br />\r\n</div>\r\n{/if}\r\n\r\n{* ******************************** GROUP TEAMS/PLAYERS SUMMARY W/MOVING ***************************************** *}\r\n{if $competition.style eq \'Group-vs-Group\'}\r\n<h2 class=\"withBG\">\r\n	<div class=\"topRight hideShow\">\r\n		<a href=\"javascript:toggle(\'teams\', \'\', \'showHide\');\"><img id=\"teams_img\" src=\"./img/blank.gif\" class=\"showHide_on\" alt=\"show/hide\" border=\"0\" /></a></div> \r\n	The Teams &nbsp; <small><i>Assignments and statistics</i></small></h2>\r\n<div id=\"teams\" style=\"display:block;\">\r\n<table cellpadding=\"0\" cellspacing=\"0\" width=\"100%\" border=\"0\"><tr><td>\r\n	{if $isManager}\r\n		<form name=\"changeTeam\" action=\"index.php\" method=\"POST\" style=\"margin:0px;\">\r\n			<input type=\"hidden\" name=\"pg\" value=\"{$page.name}\">\r\n			<input type=\"hidden\" name=\"cid\" value=\"{$competition.id}\">\r\n			<input type=\"hidden\" name=\"no_expire\" value=\"true\">\r\n	{/if}\r\n		{assign var=\"minEx\" value=\"Minutes Exercise\"}\r\n		{assign var=\"distEx\" value=\"Distance Exercised\"}\r\n		{assign var=\"pctLst\" value=\"Percentage Weight Lost\"}\r\n		{assign var=\"wtLst\" value=\"Percentage Weight Lost\"}\r\n		{foreach from=$competition.teams name=\"teamsLoop\" item=\"teams\" key=\"teamName\"}\r\n			<div id=\"playersList{$smarty.foreach.teamsLoop.iteration}\" style=\"float:left;width:310px;overflow:hidden;word-wrap:nowrap; margin:0px 5px 5px 0px;\">\r\n			<h4>{if $teams.name eq \"Waiting to Join\"}Not assigned to a team{else}{$teams.name|default:\"&nbsp;\"}{/if}</h4>\r\n		{if $scoringMethod|regex_match:\"/exercise/i\"}\r\n			<span class=\"cellHeadLarge\">Name</span>\r\n			<span class=\"cellHeadSmall\">Min.</span>\r\n			<span class=\"cellHeadSmall\">Dist.</span>\r\n			<span class=\"cellHeadSmall\">Update</span><br />\r\n			{foreach from=$teams.users item=\"users\" key=\"userName\"}\r\n				<span class=\"cellLarge\" style=\"text-align:left;\"><small>{if $isManager}<input type=\"checkbox\" name=\"changeTeam[players][{$userName}]\" style=\"width:14px;height:14px;margin:0px 2px;\" />{/if}{$userName}</small></span>\r\n				<span class=\"cellSmall\"><small>{$users.$minEx|default:\"-\"|replace:\".00\":\"\"}</small></span>\r\n				<span class=\"cellSmall\"><small>{$users.$distEx|default:\"-\"|replace:\".00\":\"\"}</small></span>\r\n				<span class=\"cellSmall\"><small>{if $users.dateOfEntry}{$users.dateOfEntry|date_format2:\"n/j/y\"}{else}Never{/if}</small></span>\r\n			{foreachelse}\r\n				{* No players assigned to this team. *}\r\n			{/foreach}\r\n		{else}\r\n			<span class=\"cellHeadLarge\">Name</span>\r\n			<span class=\"cellHeadTiny\">%</span>\r\n			<span class=\"cellHeadSmall\">Update</span><br />\r\n			{foreach from=$teams.users item=\"users\" key=\"userName\"}\r\n				<span class=\"cellLarge\" style=\"clear:left;text-align:left;\"><small>{if $isManager}<input type=\"checkbox\" name=\"changeTeam[players][{$userName}]\" />{/if}{$userName}</small></span>\r\n				<span class=\"cellTiny\"><small>{if $users.hideInitialWeight neq \"Yes\"}{$users.$pctLst|number_format:\"2\"|replace:\".00\":\"\"}{else}-{/if}</small></span>\r\n				<span class=\"cellSmall\"><small>{if $users.dateOfEntry}{$users.dateOfEntry|date_format2:\"n/j/y\"}{else}Never{/if}</small></span><br />\r\n			{foreachelse}\r\n				{* No players assigned to this team. *}\r\n			{/foreach}\r\n		{/if}\r\n			</div>\r\n		{/foreach}\r\n	{if $isManager}\r\n		<br />\r\n		<select name=\"changeTeam[team]\">\r\n			<option value=\"\">Move selected players to...</option>\r\n			{foreach from=$competition.teams item=\"newTeams\" key=\"newTeamName\"}\r\n				{*if $newTeams.name ne $teams.name and $newTeams.name ne \"Waiting to Join\"*}\r\n				{if $newTeams.name ne \"Waiting to Join\"}\r\n					<option value=\"{$newTeams.name}\">{$newTeams.name}</option>\r\n				{/if}\r\n			{/foreach}\r\n		</select><br />\r\n		<input type=\"submit\" class=\"button\" value=\"Submit Changes\">\r\n		</form>\r\n	{/if}\r\n</td></tr></table>\r\n</div>\r\n{/if}\r\n</div>\r\n	{* ******************************** DISCUSSION BOARD ***************************************** *}\r\n<br />\r\n<h2 class=\"withBG\">\r\n	<div class=\"topRight hideShow\">\r\n		<a href=\"javascript:toggle(\'discuss\', \'\', \'showHide\');\"><img id=\"discuss_img\" src=\"./img/blank.gif\" class=\"showHide_on\" alt=\"show/hide\" border=\"0\" /></a></div> \r\n	Discussion Board</h2>\r\n<div id=\"discuss\" style=\"display:block;\">\r\n	<table cellpadding=\"0\" width=\"100%\" border=\"0\"><tr><td><iframe src=\"?pg=competition/forum\" id=\"discussionBoard\" frameborder=\"0\" scrolling=\"yes\" style=\"width:100%;\"></iframe></td></tr></table>\r\n</div>\r\n\r\n</div></td>\r\n</tr></table>'),(3562,222,0.25,'smarty','0','Page created.',1113343757,3,'24.10.217.227','{assign var=\"hideWidgets\" value=0}\r\n{assign var=\"hideUserBox\" value=\"false\"}\r\n{assign var=\"showCompanyNews\" value=\"true\"}\r\n{assign var=\"pgLayout\" value=\"layouts/withLeftNav.tpl\"}\r\n\r\n{include_php file=\"shared_handle:competition.load\"}\r\n{if $competition.userId eq $user->id or $acm->isDomainAdmin()}\r\n	{assign var=\"isManager\" value=\"true\"}\r\n	<!-- ismanager -->\r\n	{include_php file=\"shared_handle:competition.management\"}\r\n{/if}\r\n\r\n{include_php file=\"shared_handle:competition.verifyInitialPot\"}\r\n\r\n<table width=\"100%\" cellpadding=\"0\" cellspacing=\"0\" border=\"0\">\r\n	<tr>\r\n		<td valign=\"top\" width=\"260\">\r\n		<br />\r\n		<h2 class=\"withBG\">\r\n			<div class=\"topRight hideShow\">\r\n					<a href=\"javascript:toggle(\'leaderBoard\', \'\', \'showHide\');\"><img id=\"leaderBoard_img\" src=\"./img/blank.gif\" class=\"showHide_on\" alt=\"show/hide\" border=\"0\" /></a>\r\n				</div>\r\n			Leaders\r\n		</h2>\r\n		{if $competition.dateOfObject}<div align=\"right\"><small><i>as of {$competition.dateOfObject|date_format2:\"n/j/Y g:i A\"}</i></small></div>{/if}\r\n		<div id=\"leaderBoard\" style=\"display:block;\">\r\n		{if $competition.style eq \'Group-vs-Group\'}\r\n			<div style=\"white-space:nowrap;display:block;\">\r\n			<span class=\"cellHeadTiny\">#</span>\r\n			<span class=\"cellHeadBig\">Team</span>\r\n			<span class=\"cellHeadTiny\">{if $competition.scoringMethod eq \'Percentage Weight Lost\'}%\r\n					{elseif $competition.scoringMethod eq \'Weight Lost\' or $competition.scoringMethod eq \'Weight Gained\'}Lbs\r\n					{elseif $competition.scoringMethod eq \'Minutes Exercise\'}Min\r\n					{elseif $competition.scoringMethod eq \'Distance Exercised\'}Dist\r\n			{/if}</span>\r\n			<span class=\"cellHeadTiny\">#Pl</span>\r\n			</div>\r\n			{foreach name=\"rankLoop\" from=$competition.teams item=\"teams\" key=\"teamName\"}\r\n				{if $teams.name ne \"Waiting to Join\"}\r\n					{if not $teams.userCount}\r\n						{assign var=\"score\" value=\"-\"}\r\n					{elseif $competition.scoringMethod eq \'Percentage Weight Lost\'}\r\n						{assign var=\"score\" value=$teams.averagePercentLost|number_format:\"2\"|default:\"-\"}\r\n					{elseif $competition.scoringMethod eq \'Weight Lost\'}\r\n						{assign var=\"score\" value=$teams.averageWeightLost|number_format:\"2\"|default:\"-\"}\r\n					{elseif $competition.scoringMethod eq \'Weight Gained\'}\r\n						{assign var=\"score\" value=$teams.averageWeightGain|number_format:\"2\"|default:\"-\"}\r\n					{elseif $competition.scoringMethod eq \'Minutes Exercise\'}\r\n						{assign var=\"score\" value=$teams.averageExercise|number_format:\"2\"|default:\"-\"}\r\n					{elseif $competition.scoringMethod eq \'Distance Exercised\'}\r\n						{assign var=\"score\" value=$teams.averageDistance|number_format:\"2\"|default:\"-\"}\r\n					{/if}\r\n					<div style=\"white-space:nowrap;display:block;\">\r\n						<span class=\"cellTiny\" style=\"clear:left;\"><small>{$smarty.foreach.rankLoop.iteration}</small></span>\r\n						<span class=\"cellBig\"><small class=\"mini\">{$teams.name|default:\"&nbsp;\"}</small></span>\r\n						<span class=\"cellTiny\"><small>{$score|replace:\".00\":\"\"}</small></span>\r\n						<span class=\"cellTiny\"><small>{$teams.userCount|default:\"0\"}</small></span>\r\n					</div>\r\n				{/if}\r\n			{/foreach}\r\n		{else}\r\n			{if $user->username eq \"trave\"}{display var=$competition}{/if}\r\n			<div style=\"white-space:nowrap;display:block;\">\r\n			<span class=\"cellHeadTiny\">#</span>\r\n			<span class=\"cellHeadSmall\">Name</span>\r\n			<span class=\"cellHeadTiny\">{if $competition.scoringMethod eq \'Percentage Weight Lost\'}%\r\n					{elseif $competition.scoringMethod eq \'Weight Lost\' or $competition.scoringMethod eq \'Weight Gained\'}Lbs\r\n					{elseif $competition.scoringMethod eq \'Minutes Exercise\'}Min\r\n					{elseif $competition.scoringMethod eq \'Distance Exercised\'}Dist\r\n			{/if}</span>\r\n			<span class=\"cellHeadSmall\">Update</span>\r\n			</div>\r\n			{foreach from=$competition.users item=\"compUser\" key=\"username\" name=\"dateUpdated\"}\r\n			{if $smarty.foreach.dateUpdated.iteration eq 21}\r\n			</div>\r\n			<br />\r\n			<h2 class=\"withBG\">\r\n				<div class=\"topRight hideShow\">\r\n					<a href=\"javascript:toggle(\'runnerUps\', \'\', \'showHide\');\"><img id=\"runnerUps_img\" src=\"./img/blank.gif\" class=\"showHide_off\" alt=\"show/hide\" border=\"0\" /></a>\r\n				</div>\r\n				Runner Ups\r\n			</h2>\r\n			<div id=\"runnerUps\" style=\"display:none;\">\r\n			{/if}\r\n			<span class=\"cellTiny\" style=\"clear:left;\"><small>{$smarty.foreach.dateUpdated.iteration}</small></span>\r\n			<span class=\"cellSmall\"><small class=\"mini\">{$username}</small></span>\r\n			<span class=\"cellTiny\"><small>{if $scoringMethod eq \"Percentage Weight Lost\"}{$compUser.$scoringMethod|number_format:\"2\"|replace:\".00\":\"\"|default:\"~\"}{else}{$compUser.$scoringMethod|replace:\".00\":\"\"|default:\"-\"}{/if}</small></span>\r\n			<span class=\"cellSmall\"><small>{if $compUser.dateOfEntry}{$compUser.dateOfEntry|date_format2:\"n/j/y\"}{else}-Never-{/if}</small></span>\r\n			{/foreach}\r\n		{/if}\r\n		</div> \r\n		<div align=\"right\"><small><i><a href=\"?pg=faq#comp\">How is the competition scored?</a></i></small></div>\r\n		<img src=\"./img/blank.gif\" width=\"168\" height=\"1\" alt=\"\" />\r\n		{if $isManager}\r\n		<h2 class=\"withBG\">\r\n			<div class=\"topRight hideShow\">\r\n				<a href=\"javascript:toggle(\'managePlayers\', \'\', \'showHide\');\"><img id=\"managePlayers_img\" src=\"./img/blank.gif\" class=\"showHide_off\" alt=\"show/hide\" border=\"0\" /></a>\r\n			</div> \r\n			Manage\r\n		</h2>\r\n		<div id=\"managePlayers\" style=\"display:none;\">\r\n					<form name=\"managePlayers[]\" action=\"index.php\" method=\"POST\" style=\"margin:0px;\">\r\n					<input type=\"hidden\" name=\"pg\" value=\"{$page.name}\">\r\n					<input type=\"hidden\" name=\"cid\" value=\"{$competition.id}\">\r\n					<input type=\"hidden\" name=\"no_expire\" value=\"true\">\r\n					<input type=\"hidden\" name=\"style\" value=\"{$competition.style}\">\r\n							{if $competition.style eq \'Group-vs-Group\'}\r\n								<span class=\"cellHeadTiny\" style=\"clear:left;\">Del</span>\r\n								<span class=\"cellHead\">View Stats</span>\r\n								<span class=\"cellHeadSmall\">-</span><br />\r\n								{foreach from=$competition.teams item=\"teams\" key=\"teamName\"}\r\n									{foreach from=$teams.users item=\"users\" key=\"userName\"}\r\n										<span class=\"cellTiny\" style=\"clear:left;\"><small><input type=\"checkbox\" name=\"managePlayers[delete][]\" value=\"{$userName}\" style=\"width:14px; height:14px;margin:0px 2px;\"></small></span>\r\n										<span class=\"cell\"><small><a href=\"?pg=myhome&cid={$competition.id}&userId={$users.id}&hideComps=1\">{$userName}</a></small></span>\r\n										<span class=\"cellSmall\"><small><a href=\"mailto:{$users.email}\">email</a></small></span><br />\r\n									{/foreach}\r\n								{/foreach}\r\n							{else}\r\n								<span class=\"cellHeadTiny\" style=\"clear:left;\">Del</span>\r\n								<span class=\"cellHead\">View Stats</span>\r\n								<span class=\"cellHeadSmall\">-</span><br />\r\n								{foreach from=$competition.users item=\"compUser\" key=\"username\" name=\"dateUpdated\"}\r\n									<span class=\"cellTiny\" style=\"clear:left;\"><small><input type=\"checkbox\" name=\"managePlayers[delete][]\" value=\"{$username}\" style=\"width:14px;height:14px;margin:0px 2px;\"></small></span>\r\n									<span class=\"cell\"><small><a href=\"?pg=myhome&cid={$competition.id}&userId={$compUser.id}&hideComps=1\">{$username}</a></small></span>\r\n									<span class=\"cellSmall\"><small><a href=\"mailto:{$compUser.email}\">email</a></small></span><br />\r\n								{/foreach}\r\n							{/if}\r\n					<div style=\"text-align:center;\">\r\n                                                <br />\r\n						<input type=\"submit\" class=\"button\" value=\"Delete Selected\">\r\n					</div>\r\n					</form>\r\n		</div><br/>\r\n		{/if}\r\n		{* End new section for Player management. *}\r\n		\r\n		{* Begin new section for Team management.  This can be moved where ever. *}\r\n		{* ******************************** TEAM MANAGEMENT ***************************************** *}\r\n		{if $isManager and $competition.style eq \'Group-vs-Group\'}\r\n		<h2 class=\"withBG\">\r\n			<div class=\"topRight hideShow\">\r\n				<a href=\"javascript:toggle(\'teamManagement\', \'\', \'showHide\');\"><img id=\"teamManagement_img\" src=\"./img/blank.gif\" class=\"showHide_{if $smarty.request.showTeamManagement}on{else}off{/if}\" alt=\"show/hide\" border=\"0\" /></a>\r\n			</div>\r\n			Teams</h2>\r\n		<div id=\"teamManagement\" style=\"display:{if $smarty.request.showTeamManagement}block{else}none{/if};\">\r\n			<form name=\"manageTeam[]\" action=\"index.php\" method=\"POST\" style=\"margin:0px;\">\r\n			<input type=\"hidden\" name=\"pg\" value=\"{$page.name}\">\r\n			<input type=\"hidden\" name=\"cid\" value=\"{$competition.id}\">\r\n			<input type=\"hidden\" name=\"no_expire\" value=\"true\">\r\n			<div id=\"playersList{counter}\">\r\n				<span class=\"cellHeadTiny\">Del</span>\r\n				<span class=\"cellHeadLarge\" style=\"width:134px;\">Team Name</span><br />\r\n				{foreach from=$competition.teams item=\"teams\" key=\"teamName\"}\r\n					{counter name=\"counterI\" start=\"0\" print=0}\r\n					{if $teams.name ne \"Waiting to Join\"}\r\n						<span class=\"cellTiny\" style=\"clear:left;\"><small><input type=\"checkbox\" name=\"manageTeam[delete][]\" value=\"{$teams.name}\"></small></span>\r\n						<span class=\"cellLarge\" style=\"width:134px;\"><small><input id=\"renameTeam\" type=\"text\" value=\"{$teams.name}\" name=\"manageTeam[rename][{$teams.name}]\" size=\"10\" style=\"width:124px;height:12px\"></small></span><br />\r\n					{/if}\r\n				{/foreach}\r\n			</div>\r\n                        <br />\r\n			<div style=\"text-align:center;\">New Team: <input id=\"addTeam\" type=\"text\" name=\"manageTeam[addTeam]\" size=\"10\"><br />\r\n			<br />\r\n                        <input type=\"submit\" class=\"button\" value=\"Submit Changes\"></div>\r\n			</form>\r\n		</div><br />\r\n		{/if}\r\n		{* End new section for Team management. *}\r\n\r\n		\r\n		{if !$isManager AND $competition.users|@count lt 45}{include file=\"layouts/ads.tpl\"}{assign var=\"adsShown\" value=\"1\"}{/if}\r\n\r\n			<h2 class=\"withBG\">Competition Stats</h2>\r\n			<span class=\"cellHeadLarge\">Category</span><span class=\"cellHeadSmall\">Result</span><br />\r\n			<span class=\"cellLarge\"><small>start weight</small></span>\r\n			<span class=\"cellSmall\"><small>{$competition.groupStartWeight|default:0} lbs</small></span><br />\r\n			<span class=\"cellLarge\"><small>weight lost</small></span>\r\n			<span class=\"cellSmall\"><small>{$competition.groupWeightLost|default:0} lbs</small></span><br />\r\n			{if $competition.groupPercentageWeightLost gt 0}<span class=\"cellLarge\"><small>% lost</small></span>\r\n			<span class=\"cellSmall\"><small>{$competition.groupPercentageWeightLost|default:0|number_format:\"2\"}</small></span><br />{/if}\r\n			<span class=\"cellLarge\"><small>fat intake</small></span>\r\n			<span class=\"cellSmall\"><small>{$competition.groupFat|default:0}</small></span><br />\r\n			<span class=\"cellLarge\"><small>calorie intake</small></span>\r\n			<span class=\"cellSmall\"><small>{$competition.groupCalories|default:0}</small></span><br />\r\n			<span class=\"cellLarge\"><small>minutes exercised</small></span>\r\n			<span class=\"cellSmall\"><small>{$competition.groupExercise|default:0}</small></span><br />\r\n			<span class=\"cellLarge\"><small>miles exercised</small></span>\r\n			<span class=\"cellSmall\"><small>{$competition.groupDistanceExercised|default:0}</small></span><br />\r\n			<img src=\"./img/blank.gif\" width=\"165\" height=\"1\" alt=\"\" />\r\n		</td>\r\n		<td width=\"100%\" valign=\"top\">\r\n			<div id=\"contentBox\" class=\"centerBox\" style=\"margin-left:10px;\"><div class=\"topRightTreasure\">\r\n<div id=\"jackpot\">{if $competition.potAmount gt 0}${$competition.potAmount|number_format:2}{/if}</div>\r\n<h1 class=\"underline\">{$competition.title|default:\"Competition Title\"}</h1>\r\n\r\n{* ******************************** COMPETITION END *********************************** *}\r\n{if $competition.endDate lt $smarty.now}   {* COMPETITION IS OVER *}\r\n	{if $competition.results.winners|@count eq 1}\r\n		{* There was one winner, either by scoringMethod or tieBreakerMethod *}\r\n\r\n		{math assign=\"daysOfCompetition\" equation=\"(x - y) / z\" x=$competition.endDate|default:\"0\" y=$competition.startDate|default:\"0\" z=\"86400\"}\r\n		{math assign=\"marginOfVictory\" equation=\"x - y\" x=$competition.results.winningStat|default:\"0\" y=$competition.results.secondPlaceStat|default:\"0\"}\r\n\r\n		{foreach from=$competition.results.winners item=\"winnerName\"}    {*key=\"winnerName\"*}\r\n			{assign var=\"winnerData\" value=$competitions.users.$winnerName}\r\n			\r\n			{if $competition.style eq \"Group-vs-Group\"}\r\n				{assign var=\"description\" value=\"Winning Team\"}\r\n				{assign var=\"avg\" value=\"average\"}\r\n			{else}\r\n				{assign var=\"description\" value=\"Winner\"}\r\n			{/if}\r\n\r\n			<h2><br /><b>{$winnerName}</b> is the {$description}{if $competition.potAmount}, taking home <b>$<i>{$competition.potAmount|number_format:2}</i></b>{/if}!</h2>\r\n			<br />\r\n			{strip}\r\n			{if not $competition.results.isTie}   {* Not a Tie *}\r\n				After a difficult <b>{$daysOfCompetition|number_format:0}</b> days of \r\n				fierce competition, <b>{$winnerName}</b> is the \r\n				{$description}!	Based on \r\n				<b>{$competition.results.winningMethod}</b>, <b>{$winnerName}</b> \r\n				won with <b>{$competition.results.winningStat|number_format:2} \r\n				{if $competition.results.winningMethod eq \"Weight Lost\"}{$avg} pounds lost\r\n				{elseif $competition.results.winningMethod eq \"Percentage Weight Lost\"}{$avg} % body weight lost\r\n				{elseif $competition.results.winningMethod eq \"Minutes Exercise\"}{$avg} minutes exercised\r\n				{elseif $competition.results.winningMethod eq \"Distance Exercised\"}{$avg} miles exercised\r\n				{elseif $competition.results.winningMethod eq \"Weight Gained\"}{$avg} pounds gained\r\n				{/if}</b>.\r\n			{else}                                {* A Tie! *}\r\n				{assign var=\"weightLost\" value=\"Weight Lost\"}\r\n				{assign var=\"percentLost\" value=\"Percentage Weight Lost\"}\r\n\r\n				After a difficult <b>{$daysOfCompetition|number_format:0}</b> \r\n				days of fierce competition, there was a tie in the judging \r\n				method, <b>{$competition.scoringMethod}</b>. To break this \r\n				tie, the selected tie breaking method, \r\n				<b>{$competition.tieBreakerMethod}</b>, was used to determine \r\n				<b>{$winnerName}</b> as the {$description}. <b>{$winnerName}</b> \r\n				won with <b>{$competition.results.winningStat|number_format:2}\r\n				{if $competition.results.winningMethod eq \"Weight Lost\"}{$avg} pounds lost\r\n				{elseif $competition.results.winningMethod eq \"Percentage Weight Lost\"}{$avg} % body weight lost\r\n				{elseif $competition.results.winningMethod eq \"Minutes Exercise\"}{$avg} minutes exercised\r\n				{elseif $competition.results.winningMethod eq \"Distance Exercised\"}{$avg} miles exercised\r\n				{elseif $competition.results.winningMethod eq \"Weight Gained\"}{$avg} pounds gained\r\n				{/if}</b>.\r\n				<!--\r\n				<b>{$winnerData.$weightLost|number_format:0} pounds</b>, which \r\n				was <b>{$winnerData.$percentLost|number_format:4}%</b> body weight.\r\n				-->\r\n			{/if}\r\n			{/strip}\r\n			<br />\r\n			<br />\r\n			<b>{$winnerName}</b> won with a <b>{$marginOfVictory|number_format:3}</b> margin over <b>{$competition.results.secondPlaceUser}</b>.\r\n			\r\n			<h2><br />Congratulations to you all!</h2>\r\n			<br />\r\n			<div class=\"underline\"></div>\r\n		{/foreach}\r\n\r\n	{elseif $competition.results.winners|@count gt 1}\r\n		{* There were multiple winners, even after tieBreakerMethod (should RARELY happen) *}\r\n	\r\n		<h2>There was a tie in this competition. The winners, by <b>{$competition.results.winningMethod}</b> having lost <b>{$competition.results.winningStat}</b>, are:<br /></h2>\r\n		<ul>\r\n		{foreach from=$competition.results.winners item=\"winnerData\" key=\"winnerName\"}\r\n			<li>{$winnerName}</li>\r\n		{/foreach}\r\n		</ul>\r\n		\r\n	{else}\r\n		{* For some reason, there were no winners *}\r\n\r\n		<h2><br />\r\n		Winner information is currently unavailable.<br />\r\n		Please check back soon.\r\n		<br /><br /></h2>\r\n	{/if}\r\n	This competition has ended and is no longer active.<br />\r\n{/if}\r\n{* ************************************************************************************ *}\r\n\r\n<div id=\"prizeDesc\">{$competition.potDescription}<br />\r\n{if $competition.potAmount}<small style=\"color:#FFF;\">(${$competition.individualPotAmount} from {$competition.potMethod})</small>{/if}</div>\r\n\r\n{if $competition.startDate lt $smarty.now}\r\n	Time remaining: <b>{$competition.timeLeft}</b><br />\r\n{else}\r\n	This competition has not yet started!<br />\r\n{/if}\r\n\r\nStart{if $competition.startDate lt $smarty.now}ed{else}s{/if}: <b>{$competition.startDate|date_format2:\"n/j/Y\"}</b> &nbsp; \r\nEnd{if $competition.endDate lt $smarty.now}ed{else}s{/if}: <b>{$competition.endDate|date_format2:\"n/j/Y\"}</b><br />\r\n{if $competition.calculationMode neq \"Real-Time\"}Competition stats/scoring updated as of {$competition.dateOfObject|date_format2:\"n/j/Y g:i A\"}{if $isManager} (<a href=\"?pg=competition&cid={$smarty.request.cid}&nocache=1\">Update Now!</a>){/if}<br />{/if}\r\n<div style=\"font-size:5px;clear:left;\">&nbsp;</div>\r\n{assign var=\"scoringMethod\" value=$competition.scoringMethod}\r\n{assign var=\"tieBreakerMethod\" value=$competition.tieBreakerMethod}\r\n{assign var=\"weeklyWinnersMethod1\" value=$competition.weeklyWinnersMethod1}\r\n{assign var=\"weeklyWinnersMethod2\" value=$competition.weeklyWinnersMethod2}\r\n\r\n{* ******************** WEEKLY WINNERS ********************* *}\r\n{if $competition.weeklyWinners}\r\n	{if $weeklyWinnersMethod1}             {* DON\'T FORGET TO REMOVE THE ACM CHECK WHEN READY!!! *}\r\n		<h2 class=\"withBG\">\r\n			<div class=\"topRight hideShow\">\r\n			<a href=\"javascript:toggle(\'weeklyWinners\', \'\', \'showHide\');\"><img id=\"weeklyWinners_img\" src=\"./img/blank.gif\" class=\"showHide_on\" alt=\"show/hide\" border=\"0\" /></a></div>\r\n			Last Week\'s Winners<i>!</i> <small style=\"color:#000; font-size:11px;\">(<i><b>{$competition.weeklyWinners.startDate|date_format2:\"D n/j\"}</b> through <b>{$competition.weeklyWinners.endDate|date_format2:\"D n/j\"}</b></i>)</small></h2> \r\n		<div id=\"weeklyWinners\">\r\n		<table width=\"100%\" cellpadding=\"3\" cellspacing=\"0\"><tr>\r\n		<td valign=\"top\" width=\"50%\">\r\n		<div class=\"cellHeadLarge\" style=\"width:auto;float:none;\">{$weeklyWinnersMethod1}</div>\r\n		<img src=\"{$skinFolder}images/winner_1.gif\" style=\"float:left;\" />\r\n		{strip}\r\n		{foreach name=\"method1\" from=$competition.weeklyWinners.$weeklyWinnersMethod1 item=\"username\"}\r\n			{assign var=\"userValue\" value=$competition.weeklyWinners.users.$username.$weeklyWinnersMethod1}\r\n			{if $smarty.foreach.method1.iteration gt 3 OR $userValue lte 0}{if $smarty.foreach.method1.iteration eq 1}Don\'t forget to update your progress so there will be winners next week{/if}<i>!</i>{php}break;{/php}\r\n			{elseif $smarty.foreach.method1.iteration eq 1}\r\n				<b>{$username|default:\"[ ?? ]\"|ucfirst}</b> led the way last week by \r\n				{if $weeklyWinnersMethod1 eq \'Weight Lost\'}losing <b>{$userValue}</b> pounds{elseif $weeklyWinnersMethod1 eq \'Percentage Weight Lost\'}losing <b>{$userValue|number_format:\"2\"}%</b> body weight{elseif $weeklyWinnersMethod1 eq \'Minutes Exercise\'}exercising <b>{$userValue}</b> minutes{elseif $weeklyWinnersMethod1 eq \'Distance Exercised\'}exercising <b>{$userValue}</b> miles{elseif $weeklyWinnersMethod1 eq \'Weight Gained\'}gaining <b>{$userValue}</b> pounds{else}<b>default</b>{/if}\r\n			{else}\r\n				{if $smarty.foreach.method1.iteration eq 2}, followed by <b>{$username|default:\"[ ?? ]\"|ucfirst}</b> with \r\n				{else} and <b>{$username|default:\"[ ?? ]\"|ucfirst}</b> with \r\n				{/if}\r\n				{if $weeklyWinnersMethod1 eq \'Weight Lost\'}<b>{$userValue}</b> pounds{elseif $weeklyWinnersMethod1 eq \'Percentage Weight Lost\'}<b>{$userValue|number_format:\"2\"}%</b>{elseif $weeklyWinnersMethod1 eq \'Minutes Exercise\'}<b>{$userValue}</b> minutes{elseif $weeklyWinnersMethod1 eq \'Distance Exercised\'}<b>{$userValue}</b> miles{elseif $weeklyWinnersMethod1 eq \'Weight Gained\'}<b>{$userValue}</b> pounds{/if}\r\n			{/if}\r\n		{/foreach}\r\n		{/strip}\r\n		</td>\r\n	{/if}\r\n	{if $weeklyWinnersMethod2} \r\n		<td valign=\"top\" width=\"50%\">\r\n		<div class=\"cellHeadLarge\" style=\"width:auto;float:none;\">{$weeklyWinnersMethod2}</div>\r\n		<img src=\"{$skinFolder}images/winner_2.gif\" style=\"float:left;\" />\r\n		{* display var=$competition.weeklyWinners.users *}\r\n		{strip}\r\n		{foreach name=\"method2\" from=$competition.weeklyWinners.$weeklyWinnersMethod2 item=\"username\"}\r\n			{assign var=\"userValue\" value=$competition.weeklyWinners.users.$username.$weeklyWinnersMethod2}\r\n			\r\n			{if $smarty.foreach.method2.iteration gt 3 OR $userValue lte 0}{if $smarty.foreach.method2.iteration eq 1}Don\'t forget to update your progress so there will be winners next week{/if}<i>!</i>{php}break;{/php}\r\n			{elseif $smarty.foreach.method2.iteration eq 1}\r\n				<b>{$username|default:\"[ ?? ]\"|ucfirst}</b> won by \r\n				{if $weeklyWinnersMethod2 eq \'Weight Lost\'}losing <b>{$userValue}</b> pounds{elseif $weeklyWinnersMethod2 eq \'Percentage Weight Lost\'}losing <b>{$userValue|number_format:\"2\"}%</b> body weight{elseif $weeklyWinnersMethod2 eq \'Minutes Exercise\'}exercising <b>{$userValue}</b> minutes{elseif $weeklyWinnersMethod2 eq \'Distance Exercised\'}exercising <b>{$userValue}</b> miles{elseif $weeklyWinnersMethod2 eq \'Weight Gained\'}gaining <b>{$userValue}</b> pounds{/if}\r\n			{else}\r\n				{if $smarty.foreach.method2.iteration eq 2}, followed by <b>{$username|default:\"[ ?? ]\"|ucfirst}</b> with \r\n				{else} and <b>{$username|default:\"[ ?? ]\"|ucfirst}</b> with \r\n				{/if}\r\n				{if $weeklyWinnersMethod2 eq \'Weight Lost\'}<b>{$userValue}</b> pounds{elseif $weeklyWinnersMethod2 eq \'Percentage Weight Lost\'}<b>{$userValue|number_format:\"2\"}%</b>{elseif $weeklyWinnersMethod2 eq \'Minutes Exercise\'}<b>{$userValue}</b> minutes{elseif $weeklyWinnersMethod2 eq \'Distance Exercised\'}<b>{$userValue}</b> miles{elseif $weeklyWinnersMethod2 eq \'Weight Gained\'}<b>{$userValue}</b> pounds{/if}\r\n			{/if}\r\n		{/foreach}\r\n		{/strip}\r\n		</td>\r\n	{/if}\r\n	{if $weeklyWinnersMethod1}\r\n	</tr></table></div>{/if}\r\n{/if}\r\n{* ********************************************************* *}\r\n\r\n{if $acm->isDomainAdmin() and $smarty.request.debug}\r\n	{display var=$competition}\r\n{/if} \r\n\r\n{* ******************************** COMPARISON GRAPHS ***************************************** *}\r\n{if $competition.availableGraphs|@count}\r\n{include_php file=\"shared_handle:competition.graphs\"}\r\n<h2 class=\"withBG\"><a name=\"graph\"></a>\r\n	<div class=\"topRight hideShow\">\r\n		<a href=\"javascript:toggle(\'graphs\', \'\', \'showHide\');\"><img id=\"graphs_img\" src=\"./img/blank.gif\" class=\"showHide_on\" alt=\"show/hide\" border=\"0\" /></a></div> \r\n	Comparison Graphs &nbsp; <small><i>No graph? <a href=\"http://www.macromedia.com/shockwave/download/download.cgi?P1_Prod_Version=ShockwaveFlash\" target=\"_blank\">click here</a> to download the free Flash Player plug-in.</i></small></h2>\r\n<div id=\"graphs\" style=\"display:block;\">\r\n	<table border=\"0\" cellpadding=\"0\" width=\"100%\">\r\n		{assign var=\"graphURL\" value=\"?pg=flashgraph-frame&format=wide\"}\r\n	<tr>\r\n		<td><div style=\"border:#999 1px solid;background-color:#FFF;padding:5px;\"><iframe name=\"graphwindow\" src=\"{$graphURL}\" frameborder=\"0\" width=\"625\" height=\"222\" scrollbars=\"no\"></iframe></div></td>\r\n	</tr>\r\n	<tr>\r\n		<td valign=\"top\" align=\"center\" width=\"100%\">\r\n		<small>\r\n		{foreach name=\"graphTypes\" from=$competition.availableGraphs key=\"graphType\" item=\"graphParams\"}\r\n		<a href=\"?pg=flashgraph-frame&compId={$competition.id}&{$graphParams}\" target=\"graphwindow\">{$graphType}</a>{if $smarty.foreach.graphTypes.iteration neq $competition.availableGraphs|@count} | {/if}\r\n		{/foreach}\r\n		</small></td>\r\n	</tr>\r\n	</table>\r\n<br />\r\n</div>\r\n{/if}\r\n\r\n{* ******************************** GROUP TEAMS/PLAYERS SUMMARY W/MOVING ***************************************** *}\r\n{if $competition.style eq \'Group-vs-Group\'}\r\n<h2 class=\"withBG\">\r\n	<div class=\"topRight hideShow\">\r\n		<a href=\"javascript:toggle(\'teams\', \'\', \'showHide\');\"><img id=\"teams_img\" src=\"./img/blank.gif\" class=\"showHide_on\" alt=\"show/hide\" border=\"0\" /></a></div> \r\n	The Teams &nbsp; <small><i>Assignments and statistics</i></small></h2>\r\n<div id=\"teams\" style=\"display:block;\">\r\n<table cellpadding=\"0\" cellspacing=\"0\" width=\"100%\" border=\"0\"><tr><td>\r\n	{if $isManager}\r\n		<form name=\"changeTeam\" action=\"index.php\" method=\"POST\" style=\"margin:0px;\">\r\n			<input type=\"hidden\" name=\"pg\" value=\"{$page.name}\">\r\n			<input type=\"hidden\" name=\"cid\" value=\"{$competition.id}\">\r\n			<input type=\"hidden\" name=\"no_expire\" value=\"true\">\r\n	{/if}\r\n		{assign var=\"minEx\" value=\"Minutes Exercise\"}\r\n		{assign var=\"distEx\" value=\"Distance Exercised\"}\r\n		{assign var=\"pctLst\" value=\"Percentage Weight Lost\"}\r\n		{assign var=\"wtLst\" value=\"Percentage Weight Lost\"}\r\n		{foreach from=$competition.teams name=\"teamsLoop\" item=\"teams\" key=\"teamName\"}\r\n			<div id=\"playersList{$smarty.foreach.teamsLoop.iteration}\" style=\"float:left;width:310px;overflow:hidden;word-wrap:nowrap; margin:0px 5px 5px 0px;\">\r\n			<h4>{if $teams.name eq \"Waiting to Join\"}Not assigned to a team{else}{$teams.name|default:\"&nbsp;\"}{/if}</h4>\r\n		{if $scoringMethod|regex_match:\"/exercise/i\"}\r\n			<span class=\"cellHeadLarge\">Name</span>\r\n			<span class=\"cellHeadSmall\">Min.</span>\r\n			<span class=\"cellHeadSmall\">Dist.</span>\r\n			<span class=\"cellHeadSmall\">Update</span><br />\r\n			{foreach from=$teams.users item=\"users\" key=\"userName\"}\r\n				<span class=\"cellLarge\" style=\"text-align:left;\"><small>{if $isManager}<input type=\"checkbox\" name=\"changeTeam[players][{$userName}]\" style=\"width:14px;height:14px;margin:0px 2px;\" />{/if}{$userName}</small></span>\r\n				<span class=\"cellSmall\"><small>{$users.$minEx|default:\"-\"|replace:\".00\":\"\"}</small></span>\r\n				<span class=\"cellSmall\"><small>{$users.$distEx|default:\"-\"|replace:\".00\":\"\"}</small></span>\r\n				<span class=\"cellSmall\"><small>{if $users.dateOfEntry}{$users.dateOfEntry|date_format2:\"n/j/y\"}{else}Never{/if}</small></span>\r\n			{foreachelse}\r\n				{* No players assigned to this team. *}\r\n			{/foreach}\r\n		{else}\r\n			<span class=\"cellHeadLarge\">Name</span>\r\n			<span class=\"cellHeadTiny\">%</span>\r\n			<span class=\"cellHeadSmall\">Update</span><br />\r\n			{foreach from=$teams.users item=\"users\" key=\"userName\"}\r\n				<span class=\"cellLarge\" style=\"clear:left;text-align:left;\"><small>{if $isManager}<input type=\"checkbox\" name=\"changeTeam[players][{$userName}]\" />{/if}{$userName}</small></span>\r\n				<span class=\"cellTiny\"><small>{if $users.hideInitialWeight neq \"Yes\"}{$users.$pctLst|number_format:\"2\"|replace:\".00\":\"\"}{else}-{/if}</small></span>\r\n				<span class=\"cellSmall\"><small>{if $users.dateOfEntry}{$users.dateOfEntry|date_format2:\"n/j/y\"}{else}Never{/if}</small></span><br />\r\n			{foreachelse}\r\n				{* No players assigned to this team. *}\r\n			{/foreach}\r\n		{/if}\r\n			</div>\r\n		{/foreach}\r\n	{if $isManager}\r\n		<br />\r\n		<select name=\"changeTeam[team]\">\r\n			<option value=\"\">Move selected players to...</option>\r\n			{foreach from=$competition.teams item=\"newTeams\" key=\"newTeamName\"}\r\n				{*if $newTeams.name ne $teams.name and $newTeams.name ne \"Waiting to Join\"*}\r\n				{if $newTeams.name ne \"Waiting to Join\"}\r\n					<option value=\"{$newTeams.name}\">{$newTeams.name}</option>\r\n				{/if}\r\n			{/foreach}\r\n		</select><br />\r\n		<input type=\"submit\" class=\"button\" value=\"Submit Changes\">\r\n		</form>\r\n	{/if}\r\n</td></tr></table>\r\n</div>\r\n{/if}\r\n</div>\r\n	{* ******************************** DISCUSSION BOARD ***************************************** *}\r\n<br />\r\n<h2 class=\"withBG\">\r\n	<div class=\"topRight hideShow\">\r\n		<a href=\"javascript:toggle(\'discuss\', \'\', \'showHide\');\"><img id=\"discuss_img\" src=\"./img/blank.gif\" class=\"showHide_on\" alt=\"show/hide\" border=\"0\" /></a></div> \r\n	Discussion Board</h2>\r\n<div id=\"discuss\" style=\"display:block;\">\r\n	<table cellpadding=\"0\" width=\"100%\" border=\"0\"><tr><td><iframe src=\"?pg=competition/forum\" id=\"discussionBoard\" frameborder=\"0\" scrolling=\"yes\" style=\"width:100%;\"></iframe></td></tr></table>\r\n</div>\r\n\r\n</div></td>\r\n</tr></table>'),(3563,222,0.26,'smarty','0','Page created.',1113343909,3,'24.10.217.227','{assign var=\"hideWidgets\" value=0}\r\n{assign var=\"hideUserBox\" value=\"false\"}\r\n{assign var=\"showCompanyNews\" value=\"true\"}\r\n{assign var=\"pgLayout\" value=\"layouts/withLeftNav.tpl\"}\r\n\r\n{include_php file=\"shared_handle:competition.load\"}\r\n{if $competition.userId eq $user->id or $acm->isDomainAdmin()}\r\n	{assign var=\"isManager\" value=\"true\"}\r\n	<!-- ismanager -->\r\n	{include_php file=\"shared_handle:competition.management\"}\r\n{/if}\r\n\r\n{include_php file=\"shared_handle:competition.verifyInitialPot\"}\r\n\r\n<table width=\"100%\" cellpadding=\"0\" cellspacing=\"0\" border=\"0\">\r\n	<tr>\r\n		<td valign=\"top\" width=\"260\">\r\n		<br />\r\n		<h2 class=\"withBG\">\r\n			<div class=\"topRight hideShow\">\r\n					<a href=\"javascript:toggle(\'leaderBoard\', \'\', \'showHide\');\"><img id=\"leaderBoard_img\" src=\"./img/blank.gif\" class=\"showHide_on\" alt=\"show/hide\" border=\"0\" /></a>\r\n				</div>\r\n			Leaders\r\n		</h2>\r\n		{if $competition.dateOfObject}<div align=\"right\"><small><i>as of {$competition.dateOfObject|date_format2:\"n/j/Y g:i A\"}</i></small></div>{/if}\r\n		<div id=\"leaderBoard\" style=\"display:block;\">\r\n		{if $competition.style eq \'Group-vs-Group\'}\r\n			<div style=\"white-space:nowrap;display:block;\">\r\n			<span class=\"cellHeadTiny\">#</span>\r\n			<span class=\"cellHeadBig\">Team</span>\r\n			<span class=\"cellHeadTiny\">{if $competition.scoringMethod eq \'Percentage Weight Lost\'}%\r\n					{elseif $competition.scoringMethod eq \'Weight Lost\' or $competition.scoringMethod eq \'Weight Gained\'}Lbs\r\n					{elseif $competition.scoringMethod eq \'Minutes Exercise\'}Min\r\n					{elseif $competition.scoringMethod eq \'Distance Exercised\'}Dist\r\n			{/if}</span>\r\n			<span class=\"cellHeadTiny\">#Pl</span>\r\n			</div>\r\n			{foreach name=\"rankLoop\" from=$competition.teams item=\"teams\" key=\"teamName\"}\r\n				{if $teams.name ne \"Waiting to Join\"}\r\n					{if not $teams.userCount}\r\n						{assign var=\"score\" value=\"-\"}\r\n					{elseif $competition.scoringMethod eq \'Percentage Weight Lost\'}\r\n						{assign var=\"score\" value=$teams.averagePercentLost|number_format:\"2\"|default:\"-\"}\r\n					{elseif $competition.scoringMethod eq \'Weight Lost\'}\r\n						{assign var=\"score\" value=$teams.averageWeightLost|number_format:\"2\"|default:\"-\"}\r\n					{elseif $competition.scoringMethod eq \'Weight Gained\'}\r\n						{assign var=\"score\" value=$teams.averageWeightGain|number_format:\"2\"|default:\"-\"}\r\n					{elseif $competition.scoringMethod eq \'Minutes Exercise\'}\r\n						{assign var=\"score\" value=$teams.averageExercise|number_format:\"2\"|default:\"-\"}\r\n					{elseif $competition.scoringMethod eq \'Distance Exercised\'}\r\n						{assign var=\"score\" value=$teams.averageDistance|number_format:\"2\"|default:\"-\"}\r\n					{/if}\r\n					<div style=\"white-space:nowrap;display:block;\">\r\n						<span class=\"cellTiny\" style=\"clear:left;\"><small>{$smarty.foreach.rankLoop.iteration}</small></span>\r\n						<span class=\"cellBig\"><small class=\"mini\">{$teams.name|default:\"&nbsp;\"}</small></span>\r\n						<span class=\"cellTiny\"><small>{$score|replace:\".00\":\"\"}</small></span>\r\n						<span class=\"cellTiny\"><small>{$teams.userCount|default:\"0\"}</small></span>\r\n					</div>\r\n				{/if}\r\n			{/foreach}\r\n		{else}\r\n			<div style=\"white-space:nowrap;display:block;\">\r\n			<span class=\"cellHeadTiny\">#</span>\r\n			<span class=\"cellHeadSmall\">Name</span>\r\n			<span class=\"cellHeadTiny\">{if $competition.scoringMethod eq \'Percentage Weight Lost\'}%\r\n					{elseif $competition.scoringMethod eq \'Weight Lost\' or $competition.scoringMethod eq \'Weight Gained\'}Lbs\r\n					{elseif $competition.scoringMethod eq \'Minutes Exercise\'}Min\r\n					{elseif $competition.scoringMethod eq \'Distance Exercised\'}Dist\r\n			{/if}</span>\r\n			<span class=\"cellHeadSmall\">Update</span>\r\n			</div>\r\n			{foreach from=$competition.users item=\"compUser\" key=\"username\" name=\"dateUpdated\"}\r\n			{if $user->username eq \"trave\"}{display var=$compUser}{/if}\r\n			{if $smarty.foreach.dateUpdated.iteration eq 21}\r\n			</div>\r\n			<br />\r\n			<h2 class=\"withBG\">\r\n				<div class=\"topRight hideShow\">\r\n					<a href=\"javascript:toggle(\'runnerUps\', \'\', \'showHide\');\"><img id=\"runnerUps_img\" src=\"./img/blank.gif\" class=\"showHide_off\" alt=\"show/hide\" border=\"0\" /></a>\r\n				</div>\r\n				Runner Ups\r\n			</h2>\r\n			<div id=\"runnerUps\" style=\"display:none;\">\r\n			{/if}\r\n			<span class=\"cellTiny\" style=\"clear:left;\"><small>{$smarty.foreach.dateUpdated.iteration}</small></span>\r\n			<span class=\"cellSmall\"><small class=\"mini\">{$username}</small></span>\r\n			<span class=\"cellTiny\"><small>{if $scoringMethod eq \"Percentage Weight Lost\"}{$compUser.$scoringMethod|number_format:\"2\"|replace:\".00\":\"\"|default:\"~\"}{else}{$compUser.$scoringMethod|replace:\".00\":\"\"|default:\"-\"}{/if}</small></span>\r\n			<span class=\"cellSmall\"><small>{if $compUser.dateOfEntry}{$compUser.dateOfEntry|date_format2:\"n/j/y\"}{else}-Never-{/if}</small></span>\r\n			{/foreach}\r\n		{/if}\r\n		</div> \r\n		<div align=\"right\"><small><i><a href=\"?pg=faq#comp\">How is the competition scored?</a></i></small></div>\r\n		<img src=\"./img/blank.gif\" width=\"168\" height=\"1\" alt=\"\" />\r\n		{if $isManager}\r\n		<h2 class=\"withBG\">\r\n			<div class=\"topRight hideShow\">\r\n				<a href=\"javascript:toggle(\'managePlayers\', \'\', \'showHide\');\"><img id=\"managePlayers_img\" src=\"./img/blank.gif\" class=\"showHide_off\" alt=\"show/hide\" border=\"0\" /></a>\r\n			</div> \r\n			Manage\r\n		</h2>\r\n		<div id=\"managePlayers\" style=\"display:none;\">\r\n					<form name=\"managePlayers[]\" action=\"index.php\" method=\"POST\" style=\"margin:0px;\">\r\n					<input type=\"hidden\" name=\"pg\" value=\"{$page.name}\">\r\n					<input type=\"hidden\" name=\"cid\" value=\"{$competition.id}\">\r\n					<input type=\"hidden\" name=\"no_expire\" value=\"true\">\r\n					<input type=\"hidden\" name=\"style\" value=\"{$competition.style}\">\r\n							{if $competition.style eq \'Group-vs-Group\'}\r\n								<span class=\"cellHeadTiny\" style=\"clear:left;\">Del</span>\r\n								<span class=\"cellHead\">View Stats</span>\r\n								<span class=\"cellHeadSmall\">-</span><br />\r\n								{foreach from=$competition.teams item=\"teams\" key=\"teamName\"}\r\n									{foreach from=$teams.users item=\"users\" key=\"userName\"}\r\n										<span class=\"cellTiny\" style=\"clear:left;\"><small><input type=\"checkbox\" name=\"managePlayers[delete][]\" value=\"{$userName}\" style=\"width:14px; height:14px;margin:0px 2px;\"></small></span>\r\n										<span class=\"cell\"><small><a href=\"?pg=myhome&cid={$competition.id}&userId={$users.id}&hideComps=1\">{$userName}</a></small></span>\r\n										<span class=\"cellSmall\"><small><a href=\"mailto:{$users.email}\">email</a></small></span><br />\r\n									{/foreach}\r\n								{/foreach}\r\n							{else}\r\n								<span class=\"cellHeadTiny\" style=\"clear:left;\">Del</span>\r\n								<span class=\"cellHead\">View Stats</span>\r\n								<span class=\"cellHeadSmall\">-</span><br />\r\n								{foreach from=$competition.users item=\"compUser\" key=\"username\" name=\"dateUpdated\"}\r\n									<span class=\"cellTiny\" style=\"clear:left;\"><small><input type=\"checkbox\" name=\"managePlayers[delete][]\" value=\"{$username}\" style=\"width:14px;height:14px;margin:0px 2px;\"></small></span>\r\n									<span class=\"cell\"><small><a href=\"?pg=myhome&cid={$competition.id}&userId={$compUser.id}&hideComps=1\">{$username}</a></small></span>\r\n									<span class=\"cellSmall\"><small><a href=\"mailto:{$compUser.email}\">email</a></small></span><br />\r\n								{/foreach}\r\n							{/if}\r\n					<div style=\"text-align:center;\">\r\n                                                <br />\r\n						<input type=\"submit\" class=\"button\" value=\"Delete Selected\">\r\n					</div>\r\n					</form>\r\n		</div><br/>\r\n		{/if}\r\n		{* End new section for Player management. *}\r\n		\r\n		{* Begin new section for Team management.  This can be moved where ever. *}\r\n		{* ******************************** TEAM MANAGEMENT ***************************************** *}\r\n		{if $isManager and $competition.style eq \'Group-vs-Group\'}\r\n		<h2 class=\"withBG\">\r\n			<div class=\"topRight hideShow\">\r\n				<a href=\"javascript:toggle(\'teamManagement\', \'\', \'showHide\');\"><img id=\"teamManagement_img\" src=\"./img/blank.gif\" class=\"showHide_{if $smarty.request.showTeamManagement}on{else}off{/if}\" alt=\"show/hide\" border=\"0\" /></a>\r\n			</div>\r\n			Teams</h2>\r\n		<div id=\"teamManagement\" style=\"display:{if $smarty.request.showTeamManagement}block{else}none{/if};\">\r\n			<form name=\"manageTeam[]\" action=\"index.php\" method=\"POST\" style=\"margin:0px;\">\r\n			<input type=\"hidden\" name=\"pg\" value=\"{$page.name}\">\r\n			<input type=\"hidden\" name=\"cid\" value=\"{$competition.id}\">\r\n			<input type=\"hidden\" name=\"no_expire\" value=\"true\">\r\n			<div id=\"playersList{counter}\">\r\n				<span class=\"cellHeadTiny\">Del</span>\r\n				<span class=\"cellHeadLarge\" style=\"width:134px;\">Team Name</span><br />\r\n				{foreach from=$competition.teams item=\"teams\" key=\"teamName\"}\r\n					{counter name=\"counterI\" start=\"0\" print=0}\r\n					{if $teams.name ne \"Waiting to Join\"}\r\n						<span class=\"cellTiny\" style=\"clear:left;\"><small><input type=\"checkbox\" name=\"manageTeam[delete][]\" value=\"{$teams.name}\"></small></span>\r\n						<span class=\"cellLarge\" style=\"width:134px;\"><small><input id=\"renameTeam\" type=\"text\" value=\"{$teams.name}\" name=\"manageTeam[rename][{$teams.name}]\" size=\"10\" style=\"width:124px;height:12px\"></small></span><br />\r\n					{/if}\r\n				{/foreach}\r\n			</div>\r\n                        <br />\r\n			<div style=\"text-align:center;\">New Team: <input id=\"addTeam\" type=\"text\" name=\"manageTeam[addTeam]\" size=\"10\"><br />\r\n			<br />\r\n                        <input type=\"submit\" class=\"button\" value=\"Submit Changes\"></div>\r\n			</form>\r\n		</div><br />\r\n		{/if}\r\n		{* End new section for Team management. *}\r\n\r\n		\r\n		{if !$isManager AND $competition.users|@count lt 45}{include file=\"layouts/ads.tpl\"}{assign var=\"adsShown\" value=\"1\"}{/if}\r\n\r\n			<h2 class=\"withBG\">Competition Stats</h2>\r\n			<span class=\"cellHeadLarge\">Category</span><span class=\"cellHeadSmall\">Result</span><br />\r\n			<span class=\"cellLarge\"><small>start weight</small></span>\r\n			<span class=\"cellSmall\"><small>{$competition.groupStartWeight|default:0} lbs</small></span><br />\r\n			<span class=\"cellLarge\"><small>weight lost</small></span>\r\n			<span class=\"cellSmall\"><small>{$competition.groupWeightLost|default:0} lbs</small></span><br />\r\n			{if $competition.groupPercentageWeightLost gt 0}<span class=\"cellLarge\"><small>% lost</small></span>\r\n			<span class=\"cellSmall\"><small>{$competition.groupPercentageWeightLost|default:0|number_format:\"2\"}</small></span><br />{/if}\r\n			<span class=\"cellLarge\"><small>fat intake</small></span>\r\n			<span class=\"cellSmall\"><small>{$competition.groupFat|default:0}</small></span><br />\r\n			<span class=\"cellLarge\"><small>calorie intake</small></span>\r\n			<span class=\"cellSmall\"><small>{$competition.groupCalories|default:0}</small></span><br />\r\n			<span class=\"cellLarge\"><small>minutes exercised</small></span>\r\n			<span class=\"cellSmall\"><small>{$competition.groupExercise|default:0}</small></span><br />\r\n			<span class=\"cellLarge\"><small>miles exercised</small></span>\r\n			<span class=\"cellSmall\"><small>{$competition.groupDistanceExercised|default:0}</small></span><br />\r\n			<img src=\"./img/blank.gif\" width=\"165\" height=\"1\" alt=\"\" />\r\n		</td>\r\n		<td width=\"100%\" valign=\"top\">\r\n			<div id=\"contentBox\" class=\"centerBox\" style=\"margin-left:10px;\"><div class=\"topRightTreasure\">\r\n<div id=\"jackpot\">{if $competition.potAmount gt 0}${$competition.potAmount|number_format:2}{/if}</div>\r\n<h1 class=\"underline\">{$competition.title|default:\"Competition Title\"}</h1>\r\n\r\n{* ******************************** COMPETITION END *********************************** *}\r\n{if $competition.endDate lt $smarty.now}   {* COMPETITION IS OVER *}\r\n	{if $competition.results.winners|@count eq 1}\r\n		{* There was one winner, either by scoringMethod or tieBreakerMethod *}\r\n\r\n		{math assign=\"daysOfCompetition\" equation=\"(x - y) / z\" x=$competition.endDate|default:\"0\" y=$competition.startDate|default:\"0\" z=\"86400\"}\r\n		{math assign=\"marginOfVictory\" equation=\"x - y\" x=$competition.results.winningStat|default:\"0\" y=$competition.results.secondPlaceStat|default:\"0\"}\r\n\r\n		{foreach from=$competition.results.winners item=\"winnerName\"}    {*key=\"winnerName\"*}\r\n			{assign var=\"winnerData\" value=$competitions.users.$winnerName}\r\n			\r\n			{if $competition.style eq \"Group-vs-Group\"}\r\n				{assign var=\"description\" value=\"Winning Team\"}\r\n				{assign var=\"avg\" value=\"average\"}\r\n			{else}\r\n				{assign var=\"description\" value=\"Winner\"}\r\n			{/if}\r\n\r\n			<h2><br /><b>{$winnerName}</b> is the {$description}{if $competition.potAmount}, taking home <b>$<i>{$competition.potAmount|number_format:2}</i></b>{/if}!</h2>\r\n			<br />\r\n			{strip}\r\n			{if not $competition.results.isTie}   {* Not a Tie *}\r\n				After a difficult <b>{$daysOfCompetition|number_format:0}</b> days of \r\n				fierce competition, <b>{$winnerName}</b> is the \r\n				{$description}!	Based on \r\n				<b>{$competition.results.winningMethod}</b>, <b>{$winnerName}</b> \r\n				won with <b>{$competition.results.winningStat|number_format:2} \r\n				{if $competition.results.winningMethod eq \"Weight Lost\"}{$avg} pounds lost\r\n				{elseif $competition.results.winningMethod eq \"Percentage Weight Lost\"}{$avg} % body weight lost\r\n				{elseif $competition.results.winningMethod eq \"Minutes Exercise\"}{$avg} minutes exercised\r\n				{elseif $competition.results.winningMethod eq \"Distance Exercised\"}{$avg} miles exercised\r\n				{elseif $competition.results.winningMethod eq \"Weight Gained\"}{$avg} pounds gained\r\n				{/if}</b>.\r\n			{else}                                {* A Tie! *}\r\n				{assign var=\"weightLost\" value=\"Weight Lost\"}\r\n				{assign var=\"percentLost\" value=\"Percentage Weight Lost\"}\r\n\r\n				After a difficult <b>{$daysOfCompetition|number_format:0}</b> \r\n				days of fierce competition, there was a tie in the judging \r\n				method, <b>{$competition.scoringMethod}</b>. To break this \r\n				tie, the selected tie breaking method, \r\n				<b>{$competition.tieBreakerMethod}</b>, was used to determine \r\n				<b>{$winnerName}</b> as the {$description}. <b>{$winnerName}</b> \r\n				won with <b>{$competition.results.winningStat|number_format:2}\r\n				{if $competition.results.winningMethod eq \"Weight Lost\"}{$avg} pounds lost\r\n				{elseif $competition.results.winningMethod eq \"Percentage Weight Lost\"}{$avg} % body weight lost\r\n				{elseif $competition.results.winningMethod eq \"Minutes Exercise\"}{$avg} minutes exercised\r\n				{elseif $competition.results.winningMethod eq \"Distance Exercised\"}{$avg} miles exercised\r\n				{elseif $competition.results.winningMethod eq \"Weight Gained\"}{$avg} pounds gained\r\n				{/if}</b>.\r\n				<!--\r\n				<b>{$winnerData.$weightLost|number_format:0} pounds</b>, which \r\n				was <b>{$winnerData.$percentLost|number_format:4}%</b> body weight.\r\n				-->\r\n			{/if}\r\n			{/strip}\r\n			<br />\r\n			<br />\r\n			<b>{$winnerName}</b> won with a <b>{$marginOfVictory|number_format:3}</b> margin over <b>{$competition.results.secondPlaceUser}</b>.\r\n			\r\n			<h2><br />Congratulations to you all!</h2>\r\n			<br />\r\n			<div class=\"underline\"></div>\r\n		{/foreach}\r\n\r\n	{elseif $competition.results.winners|@count gt 1}\r\n		{* There were multiple winners, even after tieBreakerMethod (should RARELY happen) *}\r\n	\r\n		<h2>There was a tie in this competition. The winners, by <b>{$competition.results.winningMethod}</b> having lost <b>{$competition.results.winningStat}</b>, are:<br /></h2>\r\n		<ul>\r\n		{foreach from=$competition.results.winners item=\"winnerData\" key=\"winnerName\"}\r\n			<li>{$winnerName}</li>\r\n		{/foreach}\r\n		</ul>\r\n		\r\n	{else}\r\n		{* For some reason, there were no winners *}\r\n\r\n		<h2><br />\r\n		Winner information is currently unavailable.<br />\r\n		Please check back soon.\r\n		<br /><br /></h2>\r\n	{/if}\r\n	This competition has ended and is no longer active.<br />\r\n{/if}\r\n{* ************************************************************************************ *}\r\n\r\n<div id=\"prizeDesc\">{$competition.potDescription}<br />\r\n{if $competition.potAmount}<small style=\"color:#FFF;\">(${$competition.individualPotAmount} from {$competition.potMethod})</small>{/if}</div>\r\n\r\n{if $competition.startDate lt $smarty.now}\r\n	Time remaining: <b>{$competition.timeLeft}</b><br />\r\n{else}\r\n	This competition has not yet started!<br />\r\n{/if}\r\n\r\nStart{if $competition.startDate lt $smarty.now}ed{else}s{/if}: <b>{$competition.startDate|date_format2:\"n/j/Y\"}</b> &nbsp; \r\nEnd{if $competition.endDate lt $smarty.now}ed{else}s{/if}: <b>{$competition.endDate|date_format2:\"n/j/Y\"}</b><br />\r\n{if $competition.calculationMode neq \"Real-Time\"}Competition stats/scoring updated as of {$competition.dateOfObject|date_format2:\"n/j/Y g:i A\"}{if $isManager} (<a href=\"?pg=competition&cid={$smarty.request.cid}&nocache=1\">Update Now!</a>){/if}<br />{/if}\r\n<div style=\"font-size:5px;clear:left;\">&nbsp;</div>\r\n{assign var=\"scoringMethod\" value=$competition.scoringMethod}\r\n{assign var=\"tieBreakerMethod\" value=$competition.tieBreakerMethod}\r\n{assign var=\"weeklyWinnersMethod1\" value=$competition.weeklyWinnersMethod1}\r\n{assign var=\"weeklyWinnersMethod2\" value=$competition.weeklyWinnersMethod2}\r\n\r\n{* ******************** WEEKLY WINNERS ********************* *}\r\n{if $competition.weeklyWinners}\r\n	{if $weeklyWinnersMethod1}             {* DON\'T FORGET TO REMOVE THE ACM CHECK WHEN READY!!! *}\r\n		<h2 class=\"withBG\">\r\n			<div class=\"topRight hideShow\">\r\n			<a href=\"javascript:toggle(\'weeklyWinners\', \'\', \'showHide\');\"><img id=\"weeklyWinners_img\" src=\"./img/blank.gif\" class=\"showHide_on\" alt=\"show/hide\" border=\"0\" /></a></div>\r\n			Last Week\'s Winners<i>!</i> <small style=\"color:#000; font-size:11px;\">(<i><b>{$competition.weeklyWinners.startDate|date_format2:\"D n/j\"}</b> through <b>{$competition.weeklyWinners.endDate|date_format2:\"D n/j\"}</b></i>)</small></h2> \r\n		<div id=\"weeklyWinners\">\r\n		<table width=\"100%\" cellpadding=\"3\" cellspacing=\"0\"><tr>\r\n		<td valign=\"top\" width=\"50%\">\r\n		<div class=\"cellHeadLarge\" style=\"width:auto;float:none;\">{$weeklyWinnersMethod1}</div>\r\n		<img src=\"{$skinFolder}images/winner_1.gif\" style=\"float:left;\" />\r\n		{strip}\r\n		{foreach name=\"method1\" from=$competition.weeklyWinners.$weeklyWinnersMethod1 item=\"username\"}\r\n			{assign var=\"userValue\" value=$competition.weeklyWinners.users.$username.$weeklyWinnersMethod1}\r\n			{if $smarty.foreach.method1.iteration gt 3 OR $userValue lte 0}{if $smarty.foreach.method1.iteration eq 1}Don\'t forget to update your progress so there will be winners next week{/if}<i>!</i>{php}break;{/php}\r\n			{elseif $smarty.foreach.method1.iteration eq 1}\r\n				<b>{$username|default:\"[ ?? ]\"|ucfirst}</b> led the way last week by \r\n				{if $weeklyWinnersMethod1 eq \'Weight Lost\'}losing <b>{$userValue}</b> pounds{elseif $weeklyWinnersMethod1 eq \'Percentage Weight Lost\'}losing <b>{$userValue|number_format:\"2\"}%</b> body weight{elseif $weeklyWinnersMethod1 eq \'Minutes Exercise\'}exercising <b>{$userValue}</b> minutes{elseif $weeklyWinnersMethod1 eq \'Distance Exercised\'}exercising <b>{$userValue}</b> miles{elseif $weeklyWinnersMethod1 eq \'Weight Gained\'}gaining <b>{$userValue}</b> pounds{else}<b>default</b>{/if}\r\n			{else}\r\n				{if $smarty.foreach.method1.iteration eq 2}, followed by <b>{$username|default:\"[ ?? ]\"|ucfirst}</b> with \r\n				{else} and <b>{$username|default:\"[ ?? ]\"|ucfirst}</b> with \r\n				{/if}\r\n				{if $weeklyWinnersMethod1 eq \'Weight Lost\'}<b>{$userValue}</b> pounds{elseif $weeklyWinnersMethod1 eq \'Percentage Weight Lost\'}<b>{$userValue|number_format:\"2\"}%</b>{elseif $weeklyWinnersMethod1 eq \'Minutes Exercise\'}<b>{$userValue}</b> minutes{elseif $weeklyWinnersMethod1 eq \'Distance Exercised\'}<b>{$userValue}</b> miles{elseif $weeklyWinnersMethod1 eq \'Weight Gained\'}<b>{$userValue}</b> pounds{/if}\r\n			{/if}\r\n		{/foreach}\r\n		{/strip}\r\n		</td>\r\n	{/if}\r\n	{if $weeklyWinnersMethod2} \r\n		<td valign=\"top\" width=\"50%\">\r\n		<div class=\"cellHeadLarge\" style=\"width:auto;float:none;\">{$weeklyWinnersMethod2}</div>\r\n		<img src=\"{$skinFolder}images/winner_2.gif\" style=\"float:left;\" />\r\n		{* display var=$competition.weeklyWinners.users *}\r\n		{strip}\r\n		{foreach name=\"method2\" from=$competition.weeklyWinners.$weeklyWinnersMethod2 item=\"username\"}\r\n			{assign var=\"userValue\" value=$competition.weeklyWinners.users.$username.$weeklyWinnersMethod2}\r\n			\r\n			{if $smarty.foreach.method2.iteration gt 3 OR $userValue lte 0}{if $smarty.foreach.method2.iteration eq 1}Don\'t forget to update your progress so there will be winners next week{/if}<i>!</i>{php}break;{/php}\r\n			{elseif $smarty.foreach.method2.iteration eq 1}\r\n				<b>{$username|default:\"[ ?? ]\"|ucfirst}</b> won by \r\n				{if $weeklyWinnersMethod2 eq \'Weight Lost\'}losing <b>{$userValue}</b> pounds{elseif $weeklyWinnersMethod2 eq \'Percentage Weight Lost\'}losing <b>{$userValue|number_format:\"2\"}%</b> body weight{elseif $weeklyWinnersMethod2 eq \'Minutes Exercise\'}exercising <b>{$userValue}</b> minutes{elseif $weeklyWinnersMethod2 eq \'Distance Exercised\'}exercising <b>{$userValue}</b> miles{elseif $weeklyWinnersMethod2 eq \'Weight Gained\'}gaining <b>{$userValue}</b> pounds{/if}\r\n			{else}\r\n				{if $smarty.foreach.method2.iteration eq 2}, followed by <b>{$username|default:\"[ ?? ]\"|ucfirst}</b> with \r\n				{else} and <b>{$username|default:\"[ ?? ]\"|ucfirst}</b> with \r\n				{/if}\r\n				{if $weeklyWinnersMethod2 eq \'Weight Lost\'}<b>{$userValue}</b> pounds{elseif $weeklyWinnersMethod2 eq \'Percentage Weight Lost\'}<b>{$userValue|number_format:\"2\"}%</b>{elseif $weeklyWinnersMethod2 eq \'Minutes Exercise\'}<b>{$userValue}</b> minutes{elseif $weeklyWinnersMethod2 eq \'Distance Exercised\'}<b>{$userValue}</b> miles{elseif $weeklyWinnersMethod2 eq \'Weight Gained\'}<b>{$userValue}</b> pounds{/if}\r\n			{/if}\r\n		{/foreach}\r\n		{/strip}\r\n		</td>\r\n	{/if}\r\n	{if $weeklyWinnersMethod1}\r\n	</tr></table></div>{/if}\r\n{/if}\r\n{* ********************************************************* *}\r\n\r\n{if $acm->isDomainAdmin() and $smarty.request.debug}\r\n	{display var=$competition}\r\n{/if} \r\n\r\n{* ******************************** COMPARISON GRAPHS ***************************************** *}\r\n{if $competition.availableGraphs|@count}\r\n{include_php file=\"shared_handle:competition.graphs\"}\r\n<h2 class=\"withBG\"><a name=\"graph\"></a>\r\n	<div class=\"topRight hideShow\">\r\n		<a href=\"javascript:toggle(\'graphs\', \'\', \'showHide\');\"><img id=\"graphs_img\" src=\"./img/blank.gif\" class=\"showHide_on\" alt=\"show/hide\" border=\"0\" /></a></div> \r\n	Comparison Graphs &nbsp; <small><i>No graph? <a href=\"http://www.macromedia.com/shockwave/download/download.cgi?P1_Prod_Version=ShockwaveFlash\" target=\"_blank\">click here</a> to download the free Flash Player plug-in.</i></small></h2>\r\n<div id=\"graphs\" style=\"display:block;\">\r\n	<table border=\"0\" cellpadding=\"0\" width=\"100%\">\r\n		{assign var=\"graphURL\" value=\"?pg=flashgraph-frame&format=wide\"}\r\n	<tr>\r\n		<td><div style=\"border:#999 1px solid;background-color:#FFF;padding:5px;\"><iframe name=\"graphwindow\" src=\"{$graphURL}\" frameborder=\"0\" width=\"625\" height=\"222\" scrollbars=\"no\"></iframe></div></td>\r\n	</tr>\r\n	<tr>\r\n		<td valign=\"top\" align=\"center\" width=\"100%\">\r\n		<small>\r\n		{foreach name=\"graphTypes\" from=$competition.availableGraphs key=\"graphType\" item=\"graphParams\"}\r\n		<a href=\"?pg=flashgraph-frame&compId={$competition.id}&{$graphParams}\" target=\"graphwindow\">{$graphType}</a>{if $smarty.foreach.graphTypes.iteration neq $competition.availableGraphs|@count} | {/if}\r\n		{/foreach}\r\n		</small></td>\r\n	</tr>\r\n	</table>\r\n<br />\r\n</div>\r\n{/if}\r\n\r\n{* ******************************** GROUP TEAMS/PLAYERS SUMMARY W/MOVING ***************************************** *}\r\n{if $competition.style eq \'Group-vs-Group\'}\r\n<h2 class=\"withBG\">\r\n	<div class=\"topRight hideShow\">\r\n		<a href=\"javascript:toggle(\'teams\', \'\', \'showHide\');\"><img id=\"teams_img\" src=\"./img/blank.gif\" class=\"showHide_on\" alt=\"show/hide\" border=\"0\" /></a></div> \r\n	The Teams &nbsp; <small><i>Assignments and statistics</i></small></h2>\r\n<div id=\"teams\" style=\"display:block;\">\r\n<table cellpadding=\"0\" cellspacing=\"0\" width=\"100%\" border=\"0\"><tr><td>\r\n	{if $isManager}\r\n		<form name=\"changeTeam\" action=\"index.php\" method=\"POST\" style=\"margin:0px;\">\r\n			<input type=\"hidden\" name=\"pg\" value=\"{$page.name}\">\r\n			<input type=\"hidden\" name=\"cid\" value=\"{$competition.id}\">\r\n			<input type=\"hidden\" name=\"no_expire\" value=\"true\">\r\n	{/if}\r\n		{assign var=\"minEx\" value=\"Minutes Exercise\"}\r\n		{assign var=\"distEx\" value=\"Distance Exercised\"}\r\n		{assign var=\"pctLst\" value=\"Percentage Weight Lost\"}\r\n		{assign var=\"wtLst\" value=\"Percentage Weight Lost\"}\r\n		{foreach from=$competition.teams name=\"teamsLoop\" item=\"teams\" key=\"teamName\"}\r\n			<div id=\"playersList{$smarty.foreach.teamsLoop.iteration}\" style=\"float:left;width:310px;overflow:hidden;word-wrap:nowrap; margin:0px 5px 5px 0px;\">\r\n			<h4>{if $teams.name eq \"Waiting to Join\"}Not assigned to a team{else}{$teams.name|default:\"&nbsp;\"}{/if}</h4>\r\n		{if $scoringMethod|regex_match:\"/exercise/i\"}\r\n			<span class=\"cellHeadLarge\">Name</span>\r\n			<span class=\"cellHeadSmall\">Min.</span>\r\n			<span class=\"cellHeadSmall\">Dist.</span>\r\n			<span class=\"cellHeadSmall\">Update</span><br />\r\n			{foreach from=$teams.users item=\"users\" key=\"userName\"}\r\n				<span class=\"cellLarge\" style=\"text-align:left;\"><small>{if $isManager}<input type=\"checkbox\" name=\"changeTeam[players][{$userName}]\" style=\"width:14px;height:14px;margin:0px 2px;\" />{/if}{$userName}</small></span>\r\n				<span class=\"cellSmall\"><small>{$users.$minEx|default:\"-\"|replace:\".00\":\"\"}</small></span>\r\n				<span class=\"cellSmall\"><small>{$users.$distEx|default:\"-\"|replace:\".00\":\"\"}</small></span>\r\n				<span class=\"cellSmall\"><small>{if $users.dateOfEntry}{$users.dateOfEntry|date_format2:\"n/j/y\"}{else}Never{/if}</small></span>\r\n			{foreachelse}\r\n				{* No players assigned to this team. *}\r\n			{/foreach}\r\n		{else}\r\n			<span class=\"cellHeadLarge\">Name</span>\r\n			<span class=\"cellHeadTiny\">%</span>\r\n			<span class=\"cellHeadSmall\">Update</span><br />\r\n			{foreach from=$teams.users item=\"users\" key=\"userName\"}\r\n				<span class=\"cellLarge\" style=\"clear:left;text-align:left;\"><small>{if $isManager}<input type=\"checkbox\" name=\"changeTeam[players][{$userName}]\" />{/if}{$userName}</small></span>\r\n				<span class=\"cellTiny\"><small>{if $users.hideInitialWeight neq \"Yes\"}{$users.$pctLst|number_format:\"2\"|replace:\".00\":\"\"}{else}-{/if}</small></span>\r\n				<span class=\"cellSmall\"><small>{if $users.dateOfEntry}{$users.dateOfEntry|date_format2:\"n/j/y\"}{else}Never{/if}</small></span><br />\r\n			{foreachelse}\r\n				{* No players assigned to this team. *}\r\n			{/foreach}\r\n		{/if}\r\n			</div>\r\n		{/foreach}\r\n	{if $isManager}\r\n		<br />\r\n		<select name=\"changeTeam[team]\">\r\n			<option value=\"\">Move selected players to...</option>\r\n			{foreach from=$competition.teams item=\"newTeams\" key=\"newTeamName\"}\r\n				{*if $newTeams.name ne $teams.name and $newTeams.name ne \"Waiting to Join\"*}\r\n				{if $newTeams.name ne \"Waiting to Join\"}\r\n					<option value=\"{$newTeams.name}\">{$newTeams.name}</option>\r\n				{/if}\r\n			{/foreach}\r\n		</select><br />\r\n		<input type=\"submit\" class=\"button\" value=\"Submit Changes\">\r\n		</form>\r\n	{/if}\r\n</td></tr></table>\r\n</div>\r\n{/if}\r\n</div>\r\n	{* ******************************** DISCUSSION BOARD ***************************************** *}\r\n<br />\r\n<h2 class=\"withBG\">\r\n	<div class=\"topRight hideShow\">\r\n		<a href=\"javascript:toggle(\'discuss\', \'\', \'showHide\');\"><img id=\"discuss_img\" src=\"./img/blank.gif\" class=\"showHide_on\" alt=\"show/hide\" border=\"0\" /></a></div> \r\n	Discussion Board</h2>\r\n<div id=\"discuss\" style=\"display:block;\">\r\n	<table cellpadding=\"0\" width=\"100%\" border=\"0\"><tr><td><iframe src=\"?pg=competition/forum\" id=\"discussionBoard\" frameborder=\"0\" scrolling=\"yes\" style=\"width:100%;\"></iframe></td></tr></table>\r\n</div>\r\n\r\n</div></td>\r\n</tr></table>'),(3564,222,0.27,'smarty','0','Page created.',1113343999,3,'24.10.217.227','{assign var=\"hideWidgets\" value=0}\r\n{assign var=\"hideUserBox\" value=\"false\"}\r\n{assign var=\"showCompanyNews\" value=\"true\"}\r\n{assign var=\"pgLayout\" value=\"layouts/withLeftNav.tpl\"}\r\n\r\n{include_php file=\"shared_handle:competition.load\"}\r\n{if $competition.userId eq $user->id or $acm->isDomainAdmin()}\r\n	{assign var=\"isManager\" value=\"true\"}\r\n	<!-- ismanager -->\r\n	{include_php file=\"shared_handle:competition.management\"}\r\n{/if}\r\n\r\n{include_php file=\"shared_handle:competition.verifyInitialPot\"}\r\n\r\n<table width=\"100%\" cellpadding=\"0\" cellspacing=\"0\" border=\"0\">\r\n	<tr>\r\n		<td valign=\"top\" width=\"260\">\r\n		<br />\r\n		<h2 class=\"withBG\">\r\n			<div class=\"topRight hideShow\">\r\n					<a href=\"javascript:toggle(\'leaderBoard\', \'\', \'showHide\');\"><img id=\"leaderBoard_img\" src=\"./img/blank.gif\" class=\"showHide_on\" alt=\"show/hide\" border=\"0\" /></a>\r\n				</div>\r\n			Leaders\r\n		</h2>\r\n		{if $competition.dateOfObject}<div align=\"right\"><small><i>as of {$competition.dateOfObject|date_format2:\"n/j/Y g:i A\"}</i></small></div>{/if}\r\n		<div id=\"leaderBoard\" style=\"display:block;\">\r\n		{if $competition.style eq \'Group-vs-Group\'}\r\n			<div style=\"white-space:nowrap;display:block;\">\r\n			<span class=\"cellHeadTiny\">#</span>\r\n			<span class=\"cellHeadBig\">Team</span>\r\n			<span class=\"cellHeadTiny\">{if $competition.scoringMethod eq \'Percentage Weight Lost\'}%\r\n					{elseif $competition.scoringMethod eq \'Weight Lost\' or $competition.scoringMethod eq \'Weight Gained\'}Lbs\r\n					{elseif $competition.scoringMethod eq \'Minutes Exercise\'}Min\r\n					{elseif $competition.scoringMethod eq \'Distance Exercised\'}Dist\r\n			{/if}</span>\r\n			<span class=\"cellHeadTiny\">#Pl</span>\r\n			</div>\r\n			{foreach name=\"rankLoop\" from=$competition.teams item=\"teams\" key=\"teamName\"}\r\n				{if $teams.name ne \"Waiting to Join\"}\r\n					{if not $teams.userCount}\r\n						{assign var=\"score\" value=\"-\"}\r\n					{elseif $competition.scoringMethod eq \'Percentage Weight Lost\'}\r\n						{assign var=\"score\" value=$teams.averagePercentLost|number_format:\"2\"|default:\"-\"}\r\n					{elseif $competition.scoringMethod eq \'Weight Lost\'}\r\n						{assign var=\"score\" value=$teams.averageWeightLost|number_format:\"2\"|default:\"-\"}\r\n					{elseif $competition.scoringMethod eq \'Weight Gained\'}\r\n						{assign var=\"score\" value=$teams.averageWeightGain|number_format:\"2\"|default:\"-\"}\r\n					{elseif $competition.scoringMethod eq \'Minutes Exercise\'}\r\n						{assign var=\"score\" value=$teams.averageExercise|number_format:\"2\"|default:\"-\"}\r\n					{elseif $competition.scoringMethod eq \'Distance Exercised\'}\r\n						{assign var=\"score\" value=$teams.averageDistance|number_format:\"2\"|default:\"-\"}\r\n					{/if}\r\n					<div style=\"white-space:nowrap;display:block;\">\r\n						<span class=\"cellTiny\" style=\"clear:left;\"><small>{$smarty.foreach.rankLoop.iteration}</small></span>\r\n						<span class=\"cellBig\"><small class=\"mini\">{$teams.name|default:\"&nbsp;\"}</small></span>\r\n						<span class=\"cellTiny\"><small>{$score|replace:\".00\":\"\"}</small></span>\r\n						<span class=\"cellTiny\"><small>{$teams.userCount|default:\"0\"}</small></span>\r\n					</div>\r\n				{/if}\r\n			{/foreach}\r\n		{else}\r\n			<div style=\"white-space:nowrap;display:block;\">\r\n			<span class=\"cellHeadTiny\">#</span>\r\n			<span class=\"cellHeadSmall\">Name</span>\r\n			<span class=\"cellHeadTiny\">{if $competition.scoringMethod eq \'Percentage Weight Lost\'}%\r\n					{elseif $competition.scoringMethod eq \'Weight Lost\' or $competition.scoringMethod eq \'Weight Gained\'}Lbs\r\n					{elseif $competition.scoringMethod eq \'Minutes Exercise\'}Min\r\n					{elseif $competition.scoringMethod eq \'Distance Exercised\'}Dist\r\n			{/if}</span>\r\n			<span class=\"cellHeadSmall\">Update</span>\r\n			</div>\r\n			{foreach from=$competition.users item=\"compUser\" key=\"username\" name=\"dateUpdated\"}\r\n			{if $user->username eq \"trave\"}{display var=$compUser}{/if}\r\n			{if $smarty.foreach.dateUpdated.iteration eq 21}\r\n			</div>\r\n			<br />\r\n			<h2 class=\"withBG\">\r\n				<div class=\"topRight hideShow\">\r\n					<a href=\"javascript:toggle(\'runnerUps\', \'\', \'showHide\');\"><img id=\"runnerUps_img\" src=\"./img/blank.gif\" class=\"showHide_off\" alt=\"show/hide\" border=\"0\" /></a>\r\n				</div>\r\n				Runner Ups\r\n			</h2>\r\n			<div id=\"runnerUps\" style=\"display:none;\">\r\n			{/if}\r\n			<span class=\"cellTiny\" style=\"clear:left;\"><small>{$smarty.foreach.dateUpdated.iteration}</small></span>\r\n			<span class=\"cellSmall\"><small class=\"mini\">{$username}</small></span>\r\n			<span class=\"cellTiny\"><small>{if $competition.scoringMethod eq \"Percentage Weight Lost\"}{$compUser.$scoringMethod|number_format:\"2\"|replace:\".00\":\"\"|default:\"~\"}{else}{$compUser.$scoringMethod|replace:\".00\":\"\"|default:\"-\"}{/if}</small></span>\r\n			<span class=\"cellSmall\"><small>{if $compUser.dateOfEntry}{$compUser.dateOfEntry|date_format2:\"n/j/y\"}{else}-Never-{/if}</small></span>\r\n			{/foreach}\r\n		{/if}\r\n		</div> \r\n		<div align=\"right\"><small><i><a href=\"?pg=faq#comp\">How is the competition scored?</a></i></small></div>\r\n		<img src=\"./img/blank.gif\" width=\"168\" height=\"1\" alt=\"\" />\r\n		{if $isManager}\r\n		<h2 class=\"withBG\">\r\n			<div class=\"topRight hideShow\">\r\n				<a href=\"javascript:toggle(\'managePlayers\', \'\', \'showHide\');\"><img id=\"managePlayers_img\" src=\"./img/blank.gif\" class=\"showHide_off\" alt=\"show/hide\" border=\"0\" /></a>\r\n			</div> \r\n			Manage\r\n		</h2>\r\n		<div id=\"managePlayers\" style=\"display:none;\">\r\n					<form name=\"managePlayers[]\" action=\"index.php\" method=\"POST\" style=\"margin:0px;\">\r\n					<input type=\"hidden\" name=\"pg\" value=\"{$page.name}\">\r\n					<input type=\"hidden\" name=\"cid\" value=\"{$competition.id}\">\r\n					<input type=\"hidden\" name=\"no_expire\" value=\"true\">\r\n					<input type=\"hidden\" name=\"style\" value=\"{$competition.style}\">\r\n							{if $competition.style eq \'Group-vs-Group\'}\r\n								<span class=\"cellHeadTiny\" style=\"clear:left;\">Del</span>\r\n								<span class=\"cellHead\">View Stats</span>\r\n								<span class=\"cellHeadSmall\">-</span><br />\r\n								{foreach from=$competition.teams item=\"teams\" key=\"teamName\"}\r\n									{foreach from=$teams.users item=\"users\" key=\"userName\"}\r\n										<span class=\"cellTiny\" style=\"clear:left;\"><small><input type=\"checkbox\" name=\"managePlayers[delete][]\" value=\"{$userName}\" style=\"width:14px; height:14px;margin:0px 2px;\"></small></span>\r\n										<span class=\"cell\"><small><a href=\"?pg=myhome&cid={$competition.id}&userId={$users.id}&hideComps=1\">{$userName}</a></small></span>\r\n										<span class=\"cellSmall\"><small><a href=\"mailto:{$users.email}\">email</a></small></span><br />\r\n									{/foreach}\r\n								{/foreach}\r\n							{else}\r\n								<span class=\"cellHeadTiny\" style=\"clear:left;\">Del</span>\r\n								<span class=\"cellHead\">View Stats</span>\r\n								<span class=\"cellHeadSmall\">-</span><br />\r\n								{foreach from=$competition.users item=\"compUser\" key=\"username\" name=\"dateUpdated\"}\r\n									<span class=\"cellTiny\" style=\"clear:left;\"><small><input type=\"checkbox\" name=\"managePlayers[delete][]\" value=\"{$username}\" style=\"width:14px;height:14px;margin:0px 2px;\"></small></span>\r\n									<span class=\"cell\"><small><a href=\"?pg=myhome&cid={$competition.id}&userId={$compUser.id}&hideComps=1\">{$username}</a></small></span>\r\n									<span class=\"cellSmall\"><small><a href=\"mailto:{$compUser.email}\">email</a></small></span><br />\r\n								{/foreach}\r\n							{/if}\r\n					<div style=\"text-align:center;\">\r\n                                                <br />\r\n						<input type=\"submit\" class=\"button\" value=\"Delete Selected\">\r\n					</div>\r\n					</form>\r\n		</div><br/>\r\n		{/if}\r\n		{* End new section for Player management. *}\r\n		\r\n		{* Begin new section for Team management.  This can be moved where ever. *}\r\n		{* ******************************** TEAM MANAGEMENT ***************************************** *}\r\n		{if $isManager and $competition.style eq \'Group-vs-Group\'}\r\n		<h2 class=\"withBG\">\r\n			<div class=\"topRight hideShow\">\r\n				<a href=\"javascript:toggle(\'teamManagement\', \'\', \'showHide\');\"><img id=\"teamManagement_img\" src=\"./img/blank.gif\" class=\"showHide_{if $smarty.request.showTeamManagement}on{else}off{/if}\" alt=\"show/hide\" border=\"0\" /></a>\r\n			</div>\r\n			Teams</h2>\r\n		<div id=\"teamManagement\" style=\"display:{if $smarty.request.showTeamManagement}block{else}none{/if};\">\r\n			<form name=\"manageTeam[]\" action=\"index.php\" method=\"POST\" style=\"margin:0px;\">\r\n			<input type=\"hidden\" name=\"pg\" value=\"{$page.name}\">\r\n			<input type=\"hidden\" name=\"cid\" value=\"{$competition.id}\">\r\n			<input type=\"hidden\" name=\"no_expire\" value=\"true\">\r\n			<div id=\"playersList{counter}\">\r\n				<span class=\"cellHeadTiny\">Del</span>\r\n				<span class=\"cellHeadLarge\" style=\"width:134px;\">Team Name</span><br />\r\n				{foreach from=$competition.teams item=\"teams\" key=\"teamName\"}\r\n					{counter name=\"counterI\" start=\"0\" print=0}\r\n					{if $teams.name ne \"Waiting to Join\"}\r\n						<span class=\"cellTiny\" style=\"clear:left;\"><small><input type=\"checkbox\" name=\"manageTeam[delete][]\" value=\"{$teams.name}\"></small></span>\r\n						<span class=\"cellLarge\" style=\"width:134px;\"><small><input id=\"renameTeam\" type=\"text\" value=\"{$teams.name}\" name=\"manageTeam[rename][{$teams.name}]\" size=\"10\" style=\"width:124px;height:12px\"></small></span><br />\r\n					{/if}\r\n				{/foreach}\r\n			</div>\r\n                        <br />\r\n			<div style=\"text-align:center;\">New Team: <input id=\"addTeam\" type=\"text\" name=\"manageTeam[addTeam]\" size=\"10\"><br />\r\n			<br />\r\n                        <input type=\"submit\" class=\"button\" value=\"Submit Changes\"></div>\r\n			</form>\r\n		</div><br />\r\n		{/if}\r\n		{* End new section for Team management. *}\r\n\r\n		\r\n		{if !$isManager AND $competition.users|@count lt 45}{include file=\"layouts/ads.tpl\"}{assign var=\"adsShown\" value=\"1\"}{/if}\r\n\r\n			<h2 class=\"withBG\">Competition Stats</h2>\r\n			<span class=\"cellHeadLarge\">Category</span><span class=\"cellHeadSmall\">Result</span><br />\r\n			<span class=\"cellLarge\"><small>start weight</small></span>\r\n			<span class=\"cellSmall\"><small>{$competition.groupStartWeight|default:0} lbs</small></span><br />\r\n			<span class=\"cellLarge\"><small>weight lost</small></span>\r\n			<span class=\"cellSmall\"><small>{$competition.groupWeightLost|default:0} lbs</small></span><br />\r\n			{if $competition.groupPercentageWeightLost gt 0}<span class=\"cellLarge\"><small>% lost</small></span>\r\n			<span class=\"cellSmall\"><small>{$competition.groupPercentageWeightLost|default:0|number_format:\"2\"}</small></span><br />{/if}\r\n			<span class=\"cellLarge\"><small>fat intake</small></span>\r\n			<span class=\"cellSmall\"><small>{$competition.groupFat|default:0}</small></span><br />\r\n			<span class=\"cellLarge\"><small>calorie intake</small></span>\r\n			<span class=\"cellSmall\"><small>{$competition.groupCalories|default:0}</small></span><br />\r\n			<span class=\"cellLarge\"><small>minutes exercised</small></span>\r\n			<span class=\"cellSmall\"><small>{$competition.groupExercise|default:0}</small></span><br />\r\n			<span class=\"cellLarge\"><small>miles exercised</small></span>\r\n			<span class=\"cellSmall\"><small>{$competition.groupDistanceExercised|default:0}</small></span><br />\r\n			<img src=\"./img/blank.gif\" width=\"165\" height=\"1\" alt=\"\" />\r\n		</td>\r\n		<td width=\"100%\" valign=\"top\">\r\n			<div id=\"contentBox\" class=\"centerBox\" style=\"margin-left:10px;\"><div class=\"topRightTreasure\">\r\n<div id=\"jackpot\">{if $competition.potAmount gt 0}${$competition.potAmount|number_format:2}{/if}</div>\r\n<h1 class=\"underline\">{$competition.title|default:\"Competition Title\"}</h1>\r\n\r\n{* ******************************** COMPETITION END *********************************** *}\r\n{if $competition.endDate lt $smarty.now}   {* COMPETITION IS OVER *}\r\n	{if $competition.results.winners|@count eq 1}\r\n		{* There was one winner, either by scoringMethod or tieBreakerMethod *}\r\n\r\n		{math assign=\"daysOfCompetition\" equation=\"(x - y) / z\" x=$competition.endDate|default:\"0\" y=$competition.startDate|default:\"0\" z=\"86400\"}\r\n		{math assign=\"marginOfVictory\" equation=\"x - y\" x=$competition.results.winningStat|default:\"0\" y=$competition.results.secondPlaceStat|default:\"0\"}\r\n\r\n		{foreach from=$competition.results.winners item=\"winnerName\"}    {*key=\"winnerName\"*}\r\n			{assign var=\"winnerData\" value=$competitions.users.$winnerName}\r\n			\r\n			{if $competition.style eq \"Group-vs-Group\"}\r\n				{assign var=\"description\" value=\"Winning Team\"}\r\n				{assign var=\"avg\" value=\"average\"}\r\n			{else}\r\n				{assign var=\"description\" value=\"Winner\"}\r\n			{/if}\r\n\r\n			<h2><br /><b>{$winnerName}</b> is the {$description}{if $competition.potAmount}, taking home <b>$<i>{$competition.potAmount|number_format:2}</i></b>{/if}!</h2>\r\n			<br />\r\n			{strip}\r\n			{if not $competition.results.isTie}   {* Not a Tie *}\r\n				After a difficult <b>{$daysOfCompetition|number_format:0}</b> days of \r\n				fierce competition, <b>{$winnerName}</b> is the \r\n				{$description}!	Based on \r\n				<b>{$competition.results.winningMethod}</b>, <b>{$winnerName}</b> \r\n				won with <b>{$competition.results.winningStat|number_format:2} \r\n				{if $competition.results.winningMethod eq \"Weight Lost\"}{$avg} pounds lost\r\n				{elseif $competition.results.winningMethod eq \"Percentage Weight Lost\"}{$avg} % body weight lost\r\n				{elseif $competition.results.winningMethod eq \"Minutes Exercise\"}{$avg} minutes exercised\r\n				{elseif $competition.results.winningMethod eq \"Distance Exercised\"}{$avg} miles exercised\r\n				{elseif $competition.results.winningMethod eq \"Weight Gained\"}{$avg} pounds gained\r\n				{/if}</b>.\r\n			{else}                                {* A Tie! *}\r\n				{assign var=\"weightLost\" value=\"Weight Lost\"}\r\n				{assign var=\"percentLost\" value=\"Percentage Weight Lost\"}\r\n\r\n				After a difficult <b>{$daysOfCompetition|number_format:0}</b> \r\n				days of fierce competition, there was a tie in the judging \r\n				method, <b>{$competition.scoringMethod}</b>. To break this \r\n				tie, the selected tie breaking method, \r\n				<b>{$competition.tieBreakerMethod}</b>, was used to determine \r\n				<b>{$winnerName}</b> as the {$description}. <b>{$winnerName}</b> \r\n				won with <b>{$competition.results.winningStat|number_format:2}\r\n				{if $competition.results.winningMethod eq \"Weight Lost\"}{$avg} pounds lost\r\n				{elseif $competition.results.winningMethod eq \"Percentage Weight Lost\"}{$avg} % body weight lost\r\n				{elseif $competition.results.winningMethod eq \"Minutes Exercise\"}{$avg} minutes exercised\r\n				{elseif $competition.results.winningMethod eq \"Distance Exercised\"}{$avg} miles exercised\r\n				{elseif $competition.results.winningMethod eq \"Weight Gained\"}{$avg} pounds gained\r\n				{/if}</b>.\r\n				<!--\r\n				<b>{$winnerData.$weightLost|number_format:0} pounds</b>, which \r\n				was <b>{$winnerData.$percentLost|number_format:4}%</b> body weight.\r\n				-->\r\n			{/if}\r\n			{/strip}\r\n			<br />\r\n			<br />\r\n			<b>{$winnerName}</b> won with a <b>{$marginOfVictory|number_format:3}</b> margin over <b>{$competition.results.secondPlaceUser}</b>.\r\n			\r\n			<h2><br />Congratulations to you all!</h2>\r\n			<br />\r\n			<div class=\"underline\"></div>\r\n		{/foreach}\r\n\r\n	{elseif $competition.results.winners|@count gt 1}\r\n		{* There were multiple winners, even after tieBreakerMethod (should RARELY happen) *}\r\n	\r\n		<h2>There was a tie in this competition. The winners, by <b>{$competition.results.winningMethod}</b> having lost <b>{$competition.results.winningStat}</b>, are:<br /></h2>\r\n		<ul>\r\n		{foreach from=$competition.results.winners item=\"winnerData\" key=\"winnerName\"}\r\n			<li>{$winnerName}</li>\r\n		{/foreach}\r\n		</ul>\r\n		\r\n	{else}\r\n		{* For some reason, there were no winners *}\r\n\r\n		<h2><br />\r\n		Winner information is currently unavailable.<br />\r\n		Please check back soon.\r\n		<br /><br /></h2>\r\n	{/if}\r\n	This competition has ended and is no longer active.<br />\r\n{/if}\r\n{* ************************************************************************************ *}\r\n\r\n<div id=\"prizeDesc\">{$competition.potDescription}<br />\r\n{if $competition.potAmount}<small style=\"color:#FFF;\">(${$competition.individualPotAmount} from {$competition.potMethod})</small>{/if}</div>\r\n\r\n{if $competition.startDate lt $smarty.now}\r\n	Time remaining: <b>{$competition.timeLeft}</b><br />\r\n{else}\r\n	This competition has not yet started!<br />\r\n{/if}\r\n\r\nStart{if $competition.startDate lt $smarty.now}ed{else}s{/if}: <b>{$competition.startDate|date_format2:\"n/j/Y\"}</b> &nbsp; \r\nEnd{if $competition.endDate lt $smarty.now}ed{else}s{/if}: <b>{$competition.endDate|date_format2:\"n/j/Y\"}</b><br />\r\n{if $competition.calculationMode neq \"Real-Time\"}Competition stats/scoring updated as of {$competition.dateOfObject|date_format2:\"n/j/Y g:i A\"}{if $isManager} (<a href=\"?pg=competition&cid={$smarty.request.cid}&nocache=1\">Update Now!</a>){/if}<br />{/if}\r\n<div style=\"font-size:5px;clear:left;\">&nbsp;</div>\r\n{assign var=\"scoringMethod\" value=$competition.scoringMethod}\r\n{assign var=\"tieBreakerMethod\" value=$competition.tieBreakerMethod}\r\n{assign var=\"weeklyWinnersMethod1\" value=$competition.weeklyWinnersMethod1}\r\n{assign var=\"weeklyWinnersMethod2\" value=$competition.weeklyWinnersMethod2}\r\n\r\n{* ******************** WEEKLY WINNERS ********************* *}\r\n{if $competition.weeklyWinners}\r\n	{if $weeklyWinnersMethod1}             {* DON\'T FORGET TO REMOVE THE ACM CHECK WHEN READY!!! *}\r\n		<h2 class=\"withBG\">\r\n			<div class=\"topRight hideShow\">\r\n			<a href=\"javascript:toggle(\'weeklyWinners\', \'\', \'showHide\');\"><img id=\"weeklyWinners_img\" src=\"./img/blank.gif\" class=\"showHide_on\" alt=\"show/hide\" border=\"0\" /></a></div>\r\n			Last Week\'s Winners<i>!</i> <small style=\"color:#000; font-size:11px;\">(<i><b>{$competition.weeklyWinners.startDate|date_format2:\"D n/j\"}</b> through <b>{$competition.weeklyWinners.endDate|date_format2:\"D n/j\"}</b></i>)</small></h2> \r\n		<div id=\"weeklyWinners\">\r\n		<table width=\"100%\" cellpadding=\"3\" cellspacing=\"0\"><tr>\r\n		<td valign=\"top\" width=\"50%\">\r\n		<div class=\"cellHeadLarge\" style=\"width:auto;float:none;\">{$weeklyWinnersMethod1}</div>\r\n		<img src=\"{$skinFolder}images/winner_1.gif\" style=\"float:left;\" />\r\n		{strip}\r\n		{foreach name=\"method1\" from=$competition.weeklyWinners.$weeklyWinnersMethod1 item=\"username\"}\r\n			{assign var=\"userValue\" value=$competition.weeklyWinners.users.$username.$weeklyWinnersMethod1}\r\n			{if $smarty.foreach.method1.iteration gt 3 OR $userValue lte 0}{if $smarty.foreach.method1.iteration eq 1}Don\'t forget to update your progress so there will be winners next week{/if}<i>!</i>{php}break;{/php}\r\n			{elseif $smarty.foreach.method1.iteration eq 1}\r\n				<b>{$username|default:\"[ ?? ]\"|ucfirst}</b> led the way last week by \r\n				{if $weeklyWinnersMethod1 eq \'Weight Lost\'}losing <b>{$userValue}</b> pounds{elseif $weeklyWinnersMethod1 eq \'Percentage Weight Lost\'}losing <b>{$userValue|number_format:\"2\"}%</b> body weight{elseif $weeklyWinnersMethod1 eq \'Minutes Exercise\'}exercising <b>{$userValue}</b> minutes{elseif $weeklyWinnersMethod1 eq \'Distance Exercised\'}exercising <b>{$userValue}</b> miles{elseif $weeklyWinnersMethod1 eq \'Weight Gained\'}gaining <b>{$userValue}</b> pounds{else}<b>default</b>{/if}\r\n			{else}\r\n				{if $smarty.foreach.method1.iteration eq 2}, followed by <b>{$username|default:\"[ ?? ]\"|ucfirst}</b> with \r\n				{else} and <b>{$username|default:\"[ ?? ]\"|ucfirst}</b> with \r\n				{/if}\r\n				{if $weeklyWinnersMethod1 eq \'Weight Lost\'}<b>{$userValue}</b> pounds{elseif $weeklyWinnersMethod1 eq \'Percentage Weight Lost\'}<b>{$userValue|number_format:\"2\"}%</b>{elseif $weeklyWinnersMethod1 eq \'Minutes Exercise\'}<b>{$userValue}</b> minutes{elseif $weeklyWinnersMethod1 eq \'Distance Exercised\'}<b>{$userValue}</b> miles{elseif $weeklyWinnersMethod1 eq \'Weight Gained\'}<b>{$userValue}</b> pounds{/if}\r\n			{/if}\r\n		{/foreach}\r\n		{/strip}\r\n		</td>\r\n	{/if}\r\n	{if $weeklyWinnersMethod2} \r\n		<td valign=\"top\" width=\"50%\">\r\n		<div class=\"cellHeadLarge\" style=\"width:auto;float:none;\">{$weeklyWinnersMethod2}</div>\r\n		<img src=\"{$skinFolder}images/winner_2.gif\" style=\"float:left;\" />\r\n		{* display var=$competition.weeklyWinners.users *}\r\n		{strip}\r\n		{foreach name=\"method2\" from=$competition.weeklyWinners.$weeklyWinnersMethod2 item=\"username\"}\r\n			{assign var=\"userValue\" value=$competition.weeklyWinners.users.$username.$weeklyWinnersMethod2}\r\n			\r\n			{if $smarty.foreach.method2.iteration gt 3 OR $userValue lte 0}{if $smarty.foreach.method2.iteration eq 1}Don\'t forget to update your progress so there will be winners next week{/if}<i>!</i>{php}break;{/php}\r\n			{elseif $smarty.foreach.method2.iteration eq 1}\r\n				<b>{$username|default:\"[ ?? ]\"|ucfirst}</b> won by \r\n				{if $weeklyWinnersMethod2 eq \'Weight Lost\'}losing <b>{$userValue}</b> pounds{elseif $weeklyWinnersMethod2 eq \'Percentage Weight Lost\'}losing <b>{$userValue|number_format:\"2\"}%</b> body weight{elseif $weeklyWinnersMethod2 eq \'Minutes Exercise\'}exercising <b>{$userValue}</b> minutes{elseif $weeklyWinnersMethod2 eq \'Distance Exercised\'}exercising <b>{$userValue}</b> miles{elseif $weeklyWinnersMethod2 eq \'Weight Gained\'}gaining <b>{$userValue}</b> pounds{/if}\r\n			{else}\r\n				{if $smarty.foreach.method2.iteration eq 2}, followed by <b>{$username|default:\"[ ?? ]\"|ucfirst}</b> with \r\n				{else} and <b>{$username|default:\"[ ?? ]\"|ucfirst}</b> with \r\n				{/if}\r\n				{if $weeklyWinnersMethod2 eq \'Weight Lost\'}<b>{$userValue}</b> pounds{elseif $weeklyWinnersMethod2 eq \'Percentage Weight Lost\'}<b>{$userValue|number_format:\"2\"}%</b>{elseif $weeklyWinnersMethod2 eq \'Minutes Exercise\'}<b>{$userValue}</b> minutes{elseif $weeklyWinnersMethod2 eq \'Distance Exercised\'}<b>{$userValue}</b> miles{elseif $weeklyWinnersMethod2 eq \'Weight Gained\'}<b>{$userValue}</b> pounds{/if}\r\n			{/if}\r\n		{/foreach}\r\n		{/strip}\r\n		</td>\r\n	{/if}\r\n	{if $weeklyWinnersMethod1}\r\n	</tr></table></div>{/if}\r\n{/if}\r\n{* ********************************************************* *}\r\n\r\n{if $acm->isDomainAdmin() and $smarty.request.debug}\r\n	{display var=$competition}\r\n{/if} \r\n\r\n{* ******************************** COMPARISON GRAPHS ***************************************** *}\r\n{if $competition.availableGraphs|@count}\r\n{include_php file=\"shared_handle:competition.graphs\"}\r\n<h2 class=\"withBG\"><a name=\"graph\"></a>\r\n	<div class=\"topRight hideShow\">\r\n		<a href=\"javascript:toggle(\'graphs\', \'\', \'showHide\');\"><img id=\"graphs_img\" src=\"./img/blank.gif\" class=\"showHide_on\" alt=\"show/hide\" border=\"0\" /></a></div> \r\n	Comparison Graphs &nbsp; <small><i>No graph? <a href=\"http://www.macromedia.com/shockwave/download/download.cgi?P1_Prod_Version=ShockwaveFlash\" target=\"_blank\">click here</a> to download the free Flash Player plug-in.</i></small></h2>\r\n<div id=\"graphs\" style=\"display:block;\">\r\n	<table border=\"0\" cellpadding=\"0\" width=\"100%\">\r\n		{assign var=\"graphURL\" value=\"?pg=flashgraph-frame&format=wide\"}\r\n	<tr>\r\n		<td><div style=\"border:#999 1px solid;background-color:#FFF;padding:5px;\"><iframe name=\"graphwindow\" src=\"{$graphURL}\" frameborder=\"0\" width=\"625\" height=\"222\" scrollbars=\"no\"></iframe></div></td>\r\n	</tr>\r\n	<tr>\r\n		<td valign=\"top\" align=\"center\" width=\"100%\">\r\n		<small>\r\n		{foreach name=\"graphTypes\" from=$competition.availableGraphs key=\"graphType\" item=\"graphParams\"}\r\n		<a href=\"?pg=flashgraph-frame&compId={$competition.id}&{$graphParams}\" target=\"graphwindow\">{$graphType}</a>{if $smarty.foreach.graphTypes.iteration neq $competition.availableGraphs|@count} | {/if}\r\n		{/foreach}\r\n		</small></td>\r\n	</tr>\r\n	</table>\r\n<br />\r\n</div>\r\n{/if}\r\n\r\n{* ******************************** GROUP TEAMS/PLAYERS SUMMARY W/MOVING ***************************************** *}\r\n{if $competition.style eq \'Group-vs-Group\'}\r\n<h2 class=\"withBG\">\r\n	<div class=\"topRight hideShow\">\r\n		<a href=\"javascript:toggle(\'teams\', \'\', \'showHide\');\"><img id=\"teams_img\" src=\"./img/blank.gif\" class=\"showHide_on\" alt=\"show/hide\" border=\"0\" /></a></div> \r\n	The Teams &nbsp; <small><i>Assignments and statistics</i></small></h2>\r\n<div id=\"teams\" style=\"display:block;\">\r\n<table cellpadding=\"0\" cellspacing=\"0\" width=\"100%\" border=\"0\"><tr><td>\r\n	{if $isManager}\r\n		<form name=\"changeTeam\" action=\"index.php\" method=\"POST\" style=\"margin:0px;\">\r\n			<input type=\"hidden\" name=\"pg\" value=\"{$page.name}\">\r\n			<input type=\"hidden\" name=\"cid\" value=\"{$competition.id}\">\r\n			<input type=\"hidden\" name=\"no_expire\" value=\"true\">\r\n	{/if}\r\n		{assign var=\"minEx\" value=\"Minutes Exercise\"}\r\n		{assign var=\"distEx\" value=\"Distance Exercised\"}\r\n		{assign var=\"pctLst\" value=\"Percentage Weight Lost\"}\r\n		{assign var=\"wtLst\" value=\"Percentage Weight Lost\"}\r\n		{foreach from=$competition.teams name=\"teamsLoop\" item=\"teams\" key=\"teamName\"}\r\n			<div id=\"playersList{$smarty.foreach.teamsLoop.iteration}\" style=\"float:left;width:310px;overflow:hidden;word-wrap:nowrap; margin:0px 5px 5px 0px;\">\r\n			<h4>{if $teams.name eq \"Waiting to Join\"}Not assigned to a team{else}{$teams.name|default:\"&nbsp;\"}{/if}</h4>\r\n		{if $scoringMethod|regex_match:\"/exercise/i\"}\r\n			<span class=\"cellHeadLarge\">Name</span>\r\n			<span class=\"cellHeadSmall\">Min.</span>\r\n			<span class=\"cellHeadSmall\">Dist.</span>\r\n			<span class=\"cellHeadSmall\">Update</span><br />\r\n			{foreach from=$teams.users item=\"users\" key=\"userName\"}\r\n				<span class=\"cellLarge\" style=\"text-align:left;\"><small>{if $isManager}<input type=\"checkbox\" name=\"changeTeam[players][{$userName}]\" style=\"width:14px;height:14px;margin:0px 2px;\" />{/if}{$userName}</small></span>\r\n				<span class=\"cellSmall\"><small>{$users.$minEx|default:\"-\"|replace:\".00\":\"\"}</small></span>\r\n				<span class=\"cellSmall\"><small>{$users.$distEx|default:\"-\"|replace:\".00\":\"\"}</small></span>\r\n				<span class=\"cellSmall\"><small>{if $users.dateOfEntry}{$users.dateOfEntry|date_format2:\"n/j/y\"}{else}Never{/if}</small></span>\r\n			{foreachelse}\r\n				{* No players assigned to this team. *}\r\n			{/foreach}\r\n		{else}\r\n			<span class=\"cellHeadLarge\">Name</span>\r\n			<span class=\"cellHeadTiny\">%</span>\r\n			<span class=\"cellHeadSmall\">Update</span><br />\r\n			{foreach from=$teams.users item=\"users\" key=\"userName\"}\r\n				<span class=\"cellLarge\" style=\"clear:left;text-align:left;\"><small>{if $isManager}<input type=\"checkbox\" name=\"changeTeam[players][{$userName}]\" />{/if}{$userName}</small></span>\r\n				<span class=\"cellTiny\"><small>{if $users.hideInitialWeight neq \"Yes\"}{$users.$pctLst|number_format:\"2\"|replace:\".00\":\"\"}{else}-{/if}</small></span>\r\n				<span class=\"cellSmall\"><small>{if $users.dateOfEntry}{$users.dateOfEntry|date_format2:\"n/j/y\"}{else}Never{/if}</small></span><br />\r\n			{foreachelse}\r\n				{* No players assigned to this team. *}\r\n			{/foreach}\r\n		{/if}\r\n			</div>\r\n		{/foreach}\r\n	{if $isManager}\r\n		<br />\r\n		<select name=\"changeTeam[team]\">\r\n			<option value=\"\">Move selected players to...</option>\r\n			{foreach from=$competition.teams item=\"newTeams\" key=\"newTeamName\"}\r\n				{*if $newTeams.name ne $teams.name and $newTeams.name ne \"Waiting to Join\"*}\r\n				{if $newTeams.name ne \"Waiting to Join\"}\r\n					<option value=\"{$newTeams.name}\">{$newTeams.name}</option>\r\n				{/if}\r\n			{/foreach}\r\n		</select><br />\r\n		<input type=\"submit\" class=\"button\" value=\"Submit Changes\">\r\n		</form>\r\n	{/if}\r\n</td></tr></table>\r\n</div>\r\n{/if}\r\n</div>\r\n	{* ******************************** DISCUSSION BOARD ***************************************** *}\r\n<br />\r\n<h2 class=\"withBG\">\r\n	<div class=\"topRight hideShow\">\r\n		<a href=\"javascript:toggle(\'discuss\', \'\', \'showHide\');\"><img id=\"discuss_img\" src=\"./img/blank.gif\" class=\"showHide_on\" alt=\"show/hide\" border=\"0\" /></a></div> \r\n	Discussion Board</h2>\r\n<div id=\"discuss\" style=\"display:block;\">\r\n	<table cellpadding=\"0\" width=\"100%\" border=\"0\"><tr><td><iframe src=\"?pg=competition/forum\" id=\"discussionBoard\" frameborder=\"0\" scrolling=\"yes\" style=\"width:100%;\"></iframe></td></tr></table>\r\n</div>\r\n\r\n</div></td>\r\n</tr></table>'),(3565,222,0.28,'smarty','0','Page created.',1113344132,3,'24.10.217.227','{assign var=\"hideWidgets\" value=0}\r\n{assign var=\"hideUserBox\" value=\"false\"}\r\n{assign var=\"showCompanyNews\" value=\"true\"}\r\n{assign var=\"pgLayout\" value=\"layouts/withLeftNav.tpl\"}\r\n\r\n{include_php file=\"shared_handle:competition.load\"}\r\n{if $competition.userId eq $user->id or $acm->isDomainAdmin()}\r\n	{assign var=\"isManager\" value=\"true\"}\r\n	<!-- ismanager -->\r\n	{include_php file=\"shared_handle:competition.management\"}\r\n{/if}\r\n\r\n{include_php file=\"shared_handle:competition.verifyInitialPot\"}\r\n\r\n<table width=\"100%\" cellpadding=\"0\" cellspacing=\"0\" border=\"0\">\r\n	<tr>\r\n		<td valign=\"top\" width=\"260\">\r\n		<br />\r\n		<h2 class=\"withBG\">\r\n			<div class=\"topRight hideShow\">\r\n					<a href=\"javascript:toggle(\'leaderBoard\', \'\', \'showHide\');\"><img id=\"leaderBoard_img\" src=\"./img/blank.gif\" class=\"showHide_on\" alt=\"show/hide\" border=\"0\" /></a>\r\n				</div>\r\n			Leaders\r\n		</h2>\r\n		{if $competition.dateOfObject}<div align=\"right\"><small><i>as of {$competition.dateOfObject|date_format2:\"n/j/Y g:i A\"}</i></small></div>{/if}\r\n		<div id=\"leaderBoard\" style=\"display:block;\">\r\n		{if $competition.style eq \'Group-vs-Group\'}\r\n			<div style=\"white-space:nowrap;display:block;\">\r\n			<span class=\"cellHeadTiny\">#</span>\r\n			<span class=\"cellHeadBig\">Team</span>\r\n			<span class=\"cellHeadTiny\">{if $competition.scoringMethod eq \'Percentage Weight Lost\'}%\r\n					{elseif $competition.scoringMethod eq \'Weight Lost\' or $competition.scoringMethod eq \'Weight Gained\'}Lbs\r\n					{elseif $competition.scoringMethod eq \'Minutes Exercise\'}Min\r\n					{elseif $competition.scoringMethod eq \'Distance Exercised\'}Dist\r\n			{/if}</span>\r\n			<span class=\"cellHeadTiny\">#Pl</span>\r\n			</div>\r\n			{foreach name=\"rankLoop\" from=$competition.teams item=\"teams\" key=\"teamName\"}\r\n				{if $teams.name ne \"Waiting to Join\"}\r\n					{if not $teams.userCount}\r\n						{assign var=\"score\" value=\"-\"}\r\n					{elseif $competition.scoringMethod eq \'Percentage Weight Lost\'}\r\n						{assign var=\"score\" value=$teams.averagePercentLost|number_format:\"2\"|default:\"-\"}\r\n					{elseif $competition.scoringMethod eq \'Weight Lost\'}\r\n						{assign var=\"score\" value=$teams.averageWeightLost|number_format:\"2\"|default:\"-\"}\r\n					{elseif $competition.scoringMethod eq \'Weight Gained\'}\r\n						{assign var=\"score\" value=$teams.averageWeightGain|number_format:\"2\"|default:\"-\"}\r\n					{elseif $competition.scoringMethod eq \'Minutes Exercise\'}\r\n						{assign var=\"score\" value=$teams.averageExercise|number_format:\"2\"|default:\"-\"}\r\n					{elseif $competition.scoringMethod eq \'Distance Exercised\'}\r\n						{assign var=\"score\" value=$teams.averageDistance|number_format:\"2\"|default:\"-\"}\r\n					{/if}\r\n					<div style=\"white-space:nowrap;display:block;\">\r\n						<span class=\"cellTiny\" style=\"clear:left;\"><small>{$smarty.foreach.rankLoop.iteration}</small></span>\r\n						<span class=\"cellBig\"><small class=\"mini\">{$teams.name|default:\"&nbsp;\"}</small></span>\r\n						<span class=\"cellTiny\"><small>{$score|replace:\".00\":\"\"}</small></span>\r\n						<span class=\"cellTiny\"><small>{$teams.userCount|default:\"0\"}</small></span>\r\n					</div>\r\n				{/if}\r\n			{/foreach}\r\n		{else}\r\n			<div style=\"white-space:nowrap;display:block;\">\r\n			<span class=\"cellHeadTiny\">#</span>\r\n			<span class=\"cellHeadSmall\">Name</span>\r\n			<span class=\"cellHeadTiny\">{if $competition.scoringMethod eq \'Percentage Weight Lost\'}%\r\n					{elseif $competition.scoringMethod eq \'Weight Lost\' or $competition.scoringMethod eq \'Weight Gained\'}Lbs\r\n					{elseif $competition.scoringMethod eq \'Minutes Exercise\'}Min\r\n					{elseif $competition.scoringMethod eq \'Distance Exercised\'}Dist\r\n			{/if}</span>\r\n			<span class=\"cellHeadSmall\">Update</span>\r\n			</div>\r\n			{foreach from=$competition.users item=\"compUser\" key=\"username\" name=\"dateUpdated\"}\r\n			{* if $user->username eq \"trave\"}{display var=$compUser}{/if *}\r\n			{if $smarty.foreach.dateUpdated.iteration eq 21}\r\n			</div>\r\n			<br />\r\n			<h2 class=\"withBG\">\r\n				<div class=\"topRight hideShow\">\r\n					<a href=\"javascript:toggle(\'runnerUps\', \'\', \'showHide\');\"><img id=\"runnerUps_img\" src=\"./img/blank.gif\" class=\"showHide_off\" alt=\"show/hide\" border=\"0\" /></a>\r\n				</div>\r\n				Runner Ups\r\n			</h2>\r\n			<div id=\"runnerUps\" style=\"display:none;\">\r\n			{/if}\r\n			<span class=\"cellTiny\" style=\"clear:left;\"><small>{$smarty.foreach.dateUpdated.iteration}</small></span>\r\n			<span class=\"cellSmall\"><small class=\"mini\">{$username}</small></span>\r\n			<span class=\"cellTiny\"><small>{if $competition.scoringMethod eq \'Percentage Weight Lost\'}{$compUser[$scoringMethod]|number_format:\"2\"|replace:\".00\":\"\"|default:\"~\"}{else}{$compUser.$scoringMethod|replace:\".00\":\"\"|default:\"/\"}{/if}</small></span>\r\n			<span class=\"cellSmall\"><small>{if $compUser.dateOfEntry}{$compUser.dateOfEntry|date_format2:\"n/j/y\"}{else}-Never-{/if}</small></span>\r\n			{/foreach}\r\n		{/if}\r\n		</div> \r\n		<div align=\"right\"><small><i><a href=\"?pg=faq#comp\">How is the competition scored?</a></i></small></div>\r\n		<img src=\"./img/blank.gif\" width=\"168\" height=\"1\" alt=\"\" />\r\n		{if $isManager}\r\n		<h2 class=\"withBG\">\r\n			<div class=\"topRight hideShow\">\r\n				<a href=\"javascript:toggle(\'managePlayers\', \'\', \'showHide\');\"><img id=\"managePlayers_img\" src=\"./img/blank.gif\" class=\"showHide_off\" alt=\"show/hide\" border=\"0\" /></a>\r\n			</div> \r\n			Manage\r\n		</h2>\r\n		<div id=\"managePlayers\" style=\"display:none;\">\r\n					<form name=\"managePlayers[]\" action=\"index.php\" method=\"POST\" style=\"margin:0px;\">\r\n					<input type=\"hidden\" name=\"pg\" value=\"{$page.name}\">\r\n					<input type=\"hidden\" name=\"cid\" value=\"{$competition.id}\">\r\n					<input type=\"hidden\" name=\"no_expire\" value=\"true\">\r\n					<input type=\"hidden\" name=\"style\" value=\"{$competition.style}\">\r\n							{if $competition.style eq \'Group-vs-Group\'}\r\n								<span class=\"cellHeadTiny\" style=\"clear:left;\">Del</span>\r\n								<span class=\"cellHead\">View Stats</span>\r\n								<span class=\"cellHeadSmall\">-</span><br />\r\n								{foreach from=$competition.teams item=\"teams\" key=\"teamName\"}\r\n									{foreach from=$teams.users item=\"users\" key=\"userName\"}\r\n										<span class=\"cellTiny\" style=\"clear:left;\"><small><input type=\"checkbox\" name=\"managePlayers[delete][]\" value=\"{$userName}\" style=\"width:14px; height:14px;margin:0px 2px;\"></small></span>\r\n										<span class=\"cell\"><small><a href=\"?pg=myhome&cid={$competition.id}&userId={$users.id}&hideComps=1\">{$userName}</a></small></span>\r\n										<span class=\"cellSmall\"><small><a href=\"mailto:{$users.email}\">email</a></small></span><br />\r\n									{/foreach}\r\n								{/foreach}\r\n							{else}\r\n								<span class=\"cellHeadTiny\" style=\"clear:left;\">Del</span>\r\n								<span class=\"cellHead\">View Stats</span>\r\n								<span class=\"cellHeadSmall\">-</span><br />\r\n								{foreach from=$competition.users item=\"compUser\" key=\"username\" name=\"dateUpdated\"}\r\n									<span class=\"cellTiny\" style=\"clear:left;\"><small><input type=\"checkbox\" name=\"managePlayers[delete][]\" value=\"{$username}\" style=\"width:14px;height:14px;margin:0px 2px;\"></small></span>\r\n									<span class=\"cell\"><small><a href=\"?pg=myhome&cid={$competition.id}&userId={$compUser.id}&hideComps=1\">{$username}</a></small></span>\r\n									<span class=\"cellSmall\"><small><a href=\"mailto:{$compUser.email}\">email</a></small></span><br />\r\n								{/foreach}\r\n							{/if}\r\n					<div style=\"text-align:center;\">\r\n                                                <br />\r\n						<input type=\"submit\" class=\"button\" value=\"Delete Selected\">\r\n					</div>\r\n					</form>\r\n		</div><br/>\r\n		{/if}\r\n		{* End new section for Player management. *}\r\n		\r\n		{* Begin new section for Team management.  This can be moved where ever. *}\r\n		{* ******************************** TEAM MANAGEMENT ***************************************** *}\r\n		{if $isManager and $competition.style eq \'Group-vs-Group\'}\r\n		<h2 class=\"withBG\">\r\n			<div class=\"topRight hideShow\">\r\n				<a href=\"javascript:toggle(\'teamManagement\', \'\', \'showHide\');\"><img id=\"teamManagement_img\" src=\"./img/blank.gif\" class=\"showHide_{if $smarty.request.showTeamManagement}on{else}off{/if}\" alt=\"show/hide\" border=\"0\" /></a>\r\n			</div>\r\n			Teams</h2>\r\n		<div id=\"teamManagement\" style=\"display:{if $smarty.request.showTeamManagement}block{else}none{/if};\">\r\n			<form name=\"manageTeam[]\" action=\"index.php\" method=\"POST\" style=\"margin:0px;\">\r\n			<input type=\"hidden\" name=\"pg\" value=\"{$page.name}\">\r\n			<input type=\"hidden\" name=\"cid\" value=\"{$competition.id}\">\r\n			<input type=\"hidden\" name=\"no_expire\" value=\"true\">\r\n			<div id=\"playersList{counter}\">\r\n				<span class=\"cellHeadTiny\">Del</span>\r\n				<span class=\"cellHeadLarge\" style=\"width:134px;\">Team Name</span><br />\r\n				{foreach from=$competition.teams item=\"teams\" key=\"teamName\"}\r\n					{counter name=\"counterI\" start=\"0\" print=0}\r\n					{if $teams.name ne \"Waiting to Join\"}\r\n						<span class=\"cellTiny\" style=\"clear:left;\"><small><input type=\"checkbox\" name=\"manageTeam[delete][]\" value=\"{$teams.name}\"></small></span>\r\n						<span class=\"cellLarge\" style=\"width:134px;\"><small><input id=\"renameTeam\" type=\"text\" value=\"{$teams.name}\" name=\"manageTeam[rename][{$teams.name}]\" size=\"10\" style=\"width:124px;height:12px\"></small></span><br />\r\n					{/if}\r\n				{/foreach}\r\n			</div>\r\n                        <br />\r\n			<div style=\"text-align:center;\">New Team: <input id=\"addTeam\" type=\"text\" name=\"manageTeam[addTeam]\" size=\"10\"><br />\r\n			<br />\r\n                        <input type=\"submit\" class=\"button\" value=\"Submit Changes\"></div>\r\n			</form>\r\n		</div><br />\r\n		{/if}\r\n		{* End new section for Team management. *}\r\n\r\n		\r\n		{if !$isManager AND $competition.users|@count lt 45}{include file=\"layouts/ads.tpl\"}{assign var=\"adsShown\" value=\"1\"}{/if}\r\n\r\n			<h2 class=\"withBG\">Competition Stats</h2>\r\n			<span class=\"cellHeadLarge\">Category</span><span class=\"cellHeadSmall\">Result</span><br />\r\n			<span class=\"cellLarge\"><small>start weight</small></span>\r\n			<span class=\"cellSmall\"><small>{$competition.groupStartWeight|default:0} lbs</small></span><br />\r\n			<span class=\"cellLarge\"><small>weight lost</small></span>\r\n			<span class=\"cellSmall\"><small>{$competition.groupWeightLost|default:0} lbs</small></span><br />\r\n			{if $competition.groupPercentageWeightLost gt 0}<span class=\"cellLarge\"><small>% lost</small></span>\r\n			<span class=\"cellSmall\"><small>{$competition.groupPercentageWeightLost|default:0|number_format:\"2\"}</small></span><br />{/if}\r\n			<span class=\"cellLarge\"><small>fat intake</small></span>\r\n			<span class=\"cellSmall\"><small>{$competition.groupFat|default:0}</small></span><br />\r\n			<span class=\"cellLarge\"><small>calorie intake</small></span>\r\n			<span class=\"cellSmall\"><small>{$competition.groupCalories|default:0}</small></span><br />\r\n			<span class=\"cellLarge\"><small>minutes exercised</small></span>\r\n			<span class=\"cellSmall\"><small>{$competition.groupExercise|default:0}</small></span><br />\r\n			<span class=\"cellLarge\"><small>miles exercised</small></span>\r\n			<span class=\"cellSmall\"><small>{$competition.groupDistanceExercised|default:0}</small></span><br />\r\n			<img src=\"./img/blank.gif\" width=\"165\" height=\"1\" alt=\"\" />\r\n		</td>\r\n		<td width=\"100%\" valign=\"top\">\r\n			<div id=\"contentBox\" class=\"centerBox\" style=\"margin-left:10px;\"><div class=\"topRightTreasure\">\r\n<div id=\"jackpot\">{if $competition.potAmount gt 0}${$competition.potAmount|number_format:2}{/if}</div>\r\n<h1 class=\"underline\">{$competition.title|default:\"Competition Title\"}</h1>\r\n\r\n{* ******************************** COMPETITION END *********************************** *}\r\n{if $competition.endDate lt $smarty.now}   {* COMPETITION IS OVER *}\r\n	{if $competition.results.winners|@count eq 1}\r\n		{* There was one winner, either by scoringMethod or tieBreakerMethod *}\r\n\r\n		{math assign=\"daysOfCompetition\" equation=\"(x - y) / z\" x=$competition.endDate|default:\"0\" y=$competition.startDate|default:\"0\" z=\"86400\"}\r\n		{math assign=\"marginOfVictory\" equation=\"x - y\" x=$competition.results.winningStat|default:\"0\" y=$competition.results.secondPlaceStat|default:\"0\"}\r\n\r\n		{foreach from=$competition.results.winners item=\"winnerName\"}    {*key=\"winnerName\"*}\r\n			{assign var=\"winnerData\" value=$competitions.users.$winnerName}\r\n			\r\n			{if $competition.style eq \"Group-vs-Group\"}\r\n				{assign var=\"description\" value=\"Winning Team\"}\r\n				{assign var=\"avg\" value=\"average\"}\r\n			{else}\r\n				{assign var=\"description\" value=\"Winner\"}\r\n			{/if}\r\n\r\n			<h2><br /><b>{$winnerName}</b> is the {$description}{if $competition.potAmount}, taking home <b>$<i>{$competition.potAmount|number_format:2}</i></b>{/if}!</h2>\r\n			<br />\r\n			{strip}\r\n			{if not $competition.results.isTie}   {* Not a Tie *}\r\n				After a difficult <b>{$daysOfCompetition|number_format:0}</b> days of \r\n				fierce competition, <b>{$winnerName}</b> is the \r\n				{$description}!	Based on \r\n				<b>{$competition.results.winningMethod}</b>, <b>{$winnerName}</b> \r\n				won with <b>{$competition.results.winningStat|number_format:2} \r\n				{if $competition.results.winningMethod eq \"Weight Lost\"}{$avg} pounds lost\r\n				{elseif $competition.results.winningMethod eq \"Percentage Weight Lost\"}{$avg} % body weight lost\r\n				{elseif $competition.results.winningMethod eq \"Minutes Exercise\"}{$avg} minutes exercised\r\n				{elseif $competition.results.winningMethod eq \"Distance Exercised\"}{$avg} miles exercised\r\n				{elseif $competition.results.winningMethod eq \"Weight Gained\"}{$avg} pounds gained\r\n				{/if}</b>.\r\n			{else}                                {* A Tie! *}\r\n				{assign var=\"weightLost\" value=\"Weight Lost\"}\r\n				{assign var=\"percentLost\" value=\"Percentage Weight Lost\"}\r\n\r\n				After a difficult <b>{$daysOfCompetition|number_format:0}</b> \r\n				days of fierce competition, there was a tie in the judging \r\n				method, <b>{$competition.scoringMethod}</b>. To break this \r\n				tie, the selected tie breaking method, \r\n				<b>{$competition.tieBreakerMethod}</b>, was used to determine \r\n				<b>{$winnerName}</b> as the {$description}. <b>{$winnerName}</b> \r\n				won with <b>{$competition.results.winningStat|number_format:2}\r\n				{if $competition.results.winningMethod eq \"Weight Lost\"}{$avg} pounds lost\r\n				{elseif $competition.results.winningMethod eq \"Percentage Weight Lost\"}{$avg} % body weight lost\r\n				{elseif $competition.results.winningMethod eq \"Minutes Exercise\"}{$avg} minutes exercised\r\n				{elseif $competition.results.winningMethod eq \"Distance Exercised\"}{$avg} miles exercised\r\n				{elseif $competition.results.winningMethod eq \"Weight Gained\"}{$avg} pounds gained\r\n				{/if}</b>.\r\n				<!--\r\n				<b>{$winnerData.$weightLost|number_format:0} pounds</b>, which \r\n				was <b>{$winnerData.$percentLost|number_format:4}%</b> body weight.\r\n				-->\r\n			{/if}\r\n			{/strip}\r\n			<br />\r\n			<br />\r\n			<b>{$winnerName}</b> won with a <b>{$marginOfVictory|number_format:3}</b> margin over <b>{$competition.results.secondPlaceUser}</b>.\r\n			\r\n			<h2><br />Congratulations to you all!</h2>\r\n			<br />\r\n			<div class=\"underline\"></div>\r\n		{/foreach}\r\n\r\n	{elseif $competition.results.winners|@count gt 1}\r\n		{* There were multiple winners, even after tieBreakerMethod (should RARELY happen) *}\r\n	\r\n		<h2>There was a tie in this competition. The winners, by <b>{$competition.results.winningMethod}</b> having lost <b>{$competition.results.winningStat}</b>, are:<br /></h2>\r\n		<ul>\r\n		{foreach from=$competition.results.winners item=\"winnerData\" key=\"winnerName\"}\r\n			<li>{$winnerName}</li>\r\n		{/foreach}\r\n		</ul>\r\n		\r\n	{else}\r\n		{* For some reason, there were no winners *}\r\n\r\n		<h2><br />\r\n		Winner information is currently unavailable.<br />\r\n		Please check back soon.\r\n		<br /><br /></h2>\r\n	{/if}\r\n	This competition has ended and is no longer active.<br />\r\n{/if}\r\n{* ************************************************************************************ *}\r\n\r\n<div id=\"prizeDesc\">{$competition.potDescription}<br />\r\n{if $competition.potAmount}<small style=\"color:#FFF;\">(${$competition.individualPotAmount} from {$competition.potMethod})</small>{/if}</div>\r\n\r\n{if $competition.startDate lt $smarty.now}\r\n	Time remaining: <b>{$competition.timeLeft}</b><br />\r\n{else}\r\n	This competition has not yet started!<br />\r\n{/if}\r\n\r\nStart{if $competition.startDate lt $smarty.now}ed{else}s{/if}: <b>{$competition.startDate|date_format2:\"n/j/Y\"}</b> &nbsp; \r\nEnd{if $competition.endDate lt $smarty.now}ed{else}s{/if}: <b>{$competition.endDate|date_format2:\"n/j/Y\"}</b><br />\r\n{if $competition.calculationMode neq \"Real-Time\"}Competition stats/scoring updated as of {$competition.dateOfObject|date_format2:\"n/j/Y g:i A\"}{if $isManager} (<a href=\"?pg=competition&cid={$smarty.request.cid}&nocache=1\">Update Now!</a>){/if}<br />{/if}\r\n<div style=\"font-size:5px;clear:left;\">&nbsp;</div>\r\n{assign var=\"scoringMethod\" value=$competition.scoringMethod}\r\n{assign var=\"tieBreakerMethod\" value=$competition.tieBreakerMethod}\r\n{assign var=\"weeklyWinnersMethod1\" value=$competition.weeklyWinnersMethod1}\r\n{assign var=\"weeklyWinnersMethod2\" value=$competition.weeklyWinnersMethod2}\r\n\r\n{* ******************** WEEKLY WINNERS ********************* *}\r\n{if $competition.weeklyWinners}\r\n	{if $weeklyWinnersMethod1}             {* DON\'T FORGET TO REMOVE THE ACM CHECK WHEN READY!!! *}\r\n		<h2 class=\"withBG\">\r\n			<div class=\"topRight hideShow\">\r\n			<a href=\"javascript:toggle(\'weeklyWinners\', \'\', \'showHide\');\"><img id=\"weeklyWinners_img\" src=\"./img/blank.gif\" class=\"showHide_on\" alt=\"show/hide\" border=\"0\" /></a></div>\r\n			Last Week\'s Winners<i>!</i> <small style=\"color:#000; font-size:11px;\">(<i><b>{$competition.weeklyWinners.startDate|date_format2:\"D n/j\"}</b> through <b>{$competition.weeklyWinners.endDate|date_format2:\"D n/j\"}</b></i>)</small></h2> \r\n		<div id=\"weeklyWinners\">\r\n		<table width=\"100%\" cellpadding=\"3\" cellspacing=\"0\"><tr>\r\n		<td valign=\"top\" width=\"50%\">\r\n		<div class=\"cellHeadLarge\" style=\"width:auto;float:none;\">{$weeklyWinnersMethod1}</div>\r\n		<img src=\"{$skinFolder}images/winner_1.gif\" style=\"float:left;\" />\r\n		{strip}\r\n		{foreach name=\"method1\" from=$competition.weeklyWinners.$weeklyWinnersMethod1 item=\"username\"}\r\n			{assign var=\"userValue\" value=$competition.weeklyWinners.users.$username.$weeklyWinnersMethod1}\r\n			{if $smarty.foreach.method1.iteration gt 3 OR $userValue lte 0}{if $smarty.foreach.method1.iteration eq 1}Don\'t forget to update your progress so there will be winners next week{/if}<i>!</i>{php}break;{/php}\r\n			{elseif $smarty.foreach.method1.iteration eq 1}\r\n				<b>{$username|default:\"[ ?? ]\"|ucfirst}</b> led the way last week by \r\n				{if $weeklyWinnersMethod1 eq \'Weight Lost\'}losing <b>{$userValue}</b> pounds{elseif $weeklyWinnersMethod1 eq \'Percentage Weight Lost\'}losing <b>{$userValue|number_format:\"2\"}%</b> body weight{elseif $weeklyWinnersMethod1 eq \'Minutes Exercise\'}exercising <b>{$userValue}</b> minutes{elseif $weeklyWinnersMethod1 eq \'Distance Exercised\'}exercising <b>{$userValue}</b> miles{elseif $weeklyWinnersMethod1 eq \'Weight Gained\'}gaining <b>{$userValue}</b> pounds{else}<b>default</b>{/if}\r\n			{else}\r\n				{if $smarty.foreach.method1.iteration eq 2}, followed by <b>{$username|default:\"[ ?? ]\"|ucfirst}</b> with \r\n				{else} and <b>{$username|default:\"[ ?? ]\"|ucfirst}</b> with \r\n				{/if}\r\n				{if $weeklyWinnersMethod1 eq \'Weight Lost\'}<b>{$userValue}</b> pounds{elseif $weeklyWinnersMethod1 eq \'Percentage Weight Lost\'}<b>{$userValue|number_format:\"2\"}%</b>{elseif $weeklyWinnersMethod1 eq \'Minutes Exercise\'}<b>{$userValue}</b> minutes{elseif $weeklyWinnersMethod1 eq \'Distance Exercised\'}<b>{$userValue}</b> miles{elseif $weeklyWinnersMethod1 eq \'Weight Gained\'}<b>{$userValue}</b> pounds{/if}\r\n			{/if}\r\n		{/foreach}\r\n		{/strip}\r\n		</td>\r\n	{/if}\r\n	{if $weeklyWinnersMethod2} \r\n		<td valign=\"top\" width=\"50%\">\r\n		<div class=\"cellHeadLarge\" style=\"width:auto;float:none;\">{$weeklyWinnersMethod2}</div>\r\n		<img src=\"{$skinFolder}images/winner_2.gif\" style=\"float:left;\" />\r\n		{* display var=$competition.weeklyWinners.users *}\r\n		{strip}\r\n		{foreach name=\"method2\" from=$competition.weeklyWinners.$weeklyWinnersMethod2 item=\"username\"}\r\n			{assign var=\"userValue\" value=$competition.weeklyWinners.users.$username.$weeklyWinnersMethod2}\r\n			\r\n			{if $smarty.foreach.method2.iteration gt 3 OR $userValue lte 0}{if $smarty.foreach.method2.iteration eq 1}Don\'t forget to update your progress so there will be winners next week{/if}<i>!</i>{php}break;{/php}\r\n			{elseif $smarty.foreach.method2.iteration eq 1}\r\n				<b>{$username|default:\"[ ?? ]\"|ucfirst}</b> won by \r\n				{if $weeklyWinnersMethod2 eq \'Weight Lost\'}losing <b>{$userValue}</b> pounds{elseif $weeklyWinnersMethod2 eq \'Percentage Weight Lost\'}losing <b>{$userValue|number_format:\"2\"}%</b> body weight{elseif $weeklyWinnersMethod2 eq \'Minutes Exercise\'}exercising <b>{$userValue}</b> minutes{elseif $weeklyWinnersMethod2 eq \'Distance Exercised\'}exercising <b>{$userValue}</b> miles{elseif $weeklyWinnersMethod2 eq \'Weight Gained\'}gaining <b>{$userValue}</b> pounds{/if}\r\n			{else}\r\n				{if $smarty.foreach.method2.iteration eq 2}, followed by <b>{$username|default:\"[ ?? ]\"|ucfirst}</b> with \r\n				{else} and <b>{$username|default:\"[ ?? ]\"|ucfirst}</b> with \r\n				{/if}\r\n				{if $weeklyWinnersMethod2 eq \'Weight Lost\'}<b>{$userValue}</b> pounds{elseif $weeklyWinnersMethod2 eq \'Percentage Weight Lost\'}<b>{$userValue|number_format:\"2\"}%</b>{elseif $weeklyWinnersMethod2 eq \'Minutes Exercise\'}<b>{$userValue}</b> minutes{elseif $weeklyWinnersMethod2 eq \'Distance Exercised\'}<b>{$userValue}</b> miles{elseif $weeklyWinnersMethod2 eq \'Weight Gained\'}<b>{$userValue}</b> pounds{/if}\r\n			{/if}\r\n		{/foreach}\r\n		{/strip}\r\n		</td>\r\n	{/if}\r\n	{if $weeklyWinnersMethod1}\r\n	</tr></table></div>{/if}\r\n{/if}\r\n{* ********************************************************* *}\r\n\r\n{if $acm->isDomainAdmin() and $smarty.request.debug}\r\n	{display var=$competition}\r\n{/if} \r\n\r\n{* ******************************** COMPARISON GRAPHS ***************************************** *}\r\n{if $competition.availableGraphs|@count}\r\n{include_php file=\"shared_handle:competition.graphs\"}\r\n<h2 class=\"withBG\"><a name=\"graph\"></a>\r\n	<div class=\"topRight hideShow\">\r\n		<a href=\"javascript:toggle(\'graphs\', \'\', \'showHide\');\"><img id=\"graphs_img\" src=\"./img/blank.gif\" class=\"showHide_on\" alt=\"show/hide\" border=\"0\" /></a></div> \r\n	Comparison Graphs &nbsp; <small><i>No graph? <a href=\"http://www.macromedia.com/shockwave/download/download.cgi?P1_Prod_Version=ShockwaveFlash\" target=\"_blank\">click here</a> to download the free Flash Player plug-in.</i></small></h2>\r\n<div id=\"graphs\" style=\"display:block;\">\r\n	<table border=\"0\" cellpadding=\"0\" width=\"100%\">\r\n		{assign var=\"graphURL\" value=\"?pg=flashgraph-frame&format=wide\"}\r\n	<tr>\r\n		<td><div style=\"border:#999 1px solid;background-color:#FFF;padding:5px;\"><iframe name=\"graphwindow\" src=\"{$graphURL}\" frameborder=\"0\" width=\"625\" height=\"222\" scrollbars=\"no\"></iframe></div></td>\r\n	</tr>\r\n	<tr>\r\n		<td valign=\"top\" align=\"center\" width=\"100%\">\r\n		<small>\r\n		{foreach name=\"graphTypes\" from=$competition.availableGraphs key=\"graphType\" item=\"graphParams\"}\r\n		<a href=\"?pg=flashgraph-frame&compId={$competition.id}&{$graphParams}\" target=\"graphwindow\">{$graphType}</a>{if $smarty.foreach.graphTypes.iteration neq $competition.availableGraphs|@count} | {/if}\r\n		{/foreach}\r\n		</small></td>\r\n	</tr>\r\n	</table>\r\n<br />\r\n</div>\r\n{/if}\r\n\r\n{* ******************************** GROUP TEAMS/PLAYERS SUMMARY W/MOVING ***************************************** *}\r\n{if $competition.style eq \'Group-vs-Group\'}\r\n<h2 class=\"withBG\">\r\n	<div class=\"topRight hideShow\">\r\n		<a href=\"javascript:toggle(\'teams\', \'\', \'showHide\');\"><img id=\"teams_img\" src=\"./img/blank.gif\" class=\"showHide_on\" alt=\"show/hide\" border=\"0\" /></a></div> \r\n	The Teams &nbsp; <small><i>Assignments and statistics</i></small></h2>\r\n<div id=\"teams\" style=\"display:block;\">\r\n<table cellpadding=\"0\" cellspacing=\"0\" width=\"100%\" border=\"0\"><tr><td>\r\n	{if $isManager}\r\n		<form name=\"changeTeam\" action=\"index.php\" method=\"POST\" style=\"margin:0px;\">\r\n			<input type=\"hidden\" name=\"pg\" value=\"{$page.name}\">\r\n			<input type=\"hidden\" name=\"cid\" value=\"{$competition.id}\">\r\n			<input type=\"hidden\" name=\"no_expire\" value=\"true\">\r\n	{/if}\r\n		{assign var=\"minEx\" value=\"Minutes Exercise\"}\r\n		{assign var=\"distEx\" value=\"Distance Exercised\"}\r\n		{assign var=\"pctLst\" value=\"Percentage Weight Lost\"}\r\n		{assign var=\"wtLst\" value=\"Percentage Weight Lost\"}\r\n		{foreach from=$competition.teams name=\"teamsLoop\" item=\"teams\" key=\"teamName\"}\r\n			<div id=\"playersList{$smarty.foreach.teamsLoop.iteration}\" style=\"float:left;width:310px;overflow:hidden;word-wrap:nowrap; margin:0px 5px 5px 0px;\">\r\n			<h4>{if $teams.name eq \"Waiting to Join\"}Not assigned to a team{else}{$teams.name|default:\"&nbsp;\"}{/if}</h4>\r\n		{if $scoringMethod|regex_match:\"/exercise/i\"}\r\n			<span class=\"cellHeadLarge\">Name</span>\r\n			<span class=\"cellHeadSmall\">Min.</span>\r\n			<span class=\"cellHeadSmall\">Dist.</span>\r\n			<span class=\"cellHeadSmall\">Update</span><br />\r\n			{foreach from=$teams.users item=\"users\" key=\"userName\"}\r\n				<span class=\"cellLarge\" style=\"text-align:left;\"><small>{if $isManager}<input type=\"checkbox\" name=\"changeTeam[players][{$userName}]\" style=\"width:14px;height:14px;margin:0px 2px;\" />{/if}{$userName}</small></span>\r\n				<span class=\"cellSmall\"><small>{$users.$minEx|default:\"-\"|replace:\".00\":\"\"}</small></span>\r\n				<span class=\"cellSmall\"><small>{$users.$distEx|default:\"-\"|replace:\".00\":\"\"}</small></span>\r\n				<span class=\"cellSmall\"><small>{if $users.dateOfEntry}{$users.dateOfEntry|date_format2:\"n/j/y\"}{else}Never{/if}</small></span>\r\n			{foreachelse}\r\n				{* No players assigned to this team. *}\r\n			{/foreach}\r\n		{else}\r\n			<span class=\"cellHeadLarge\">Name</span>\r\n			<span class=\"cellHeadTiny\">%</span>\r\n			<span class=\"cellHeadSmall\">Update</span><br />\r\n			{foreach from=$teams.users item=\"users\" key=\"userName\"}\r\n				<span class=\"cellLarge\" style=\"clear:left;text-align:left;\"><small>{if $isManager}<input type=\"checkbox\" name=\"changeTeam[players][{$userName}]\" />{/if}{$userName}</small></span>\r\n				<span class=\"cellTiny\"><small>{if $users.hideInitialWeight neq \"Yes\"}{$users.$pctLst|number_format:\"2\"|replace:\".00\":\"\"}{else}-{/if}</small></span>\r\n				<span class=\"cellSmall\"><small>{if $users.dateOfEntry}{$users.dateOfEntry|date_format2:\"n/j/y\"}{else}Never{/if}</small></span><br />\r\n			{foreachelse}\r\n				{* No players assigned to this team. *}\r\n			{/foreach}\r\n		{/if}\r\n			</div>\r\n		{/foreach}\r\n	{if $isManager}\r\n		<br />\r\n		<select name=\"changeTeam[team]\">\r\n			<option value=\"\">Move selected players to...</option>\r\n			{foreach from=$competition.teams item=\"newTeams\" key=\"newTeamName\"}\r\n				{*if $newTeams.name ne $teams.name and $newTeams.name ne \"Waiting to Join\"*}\r\n				{if $newTeams.name ne \"Waiting to Join\"}\r\n					<option value=\"{$newTeams.name}\">{$newTeams.name}</option>\r\n				{/if}\r\n			{/foreach}\r\n		</select><br />\r\n		<input type=\"submit\" class=\"button\" value=\"Submit Changes\">\r\n		</form>\r\n	{/if}\r\n</td></tr></table>\r\n</div>\r\n{/if}\r\n</div>\r\n	{* ******************************** DISCUSSION BOARD ***************************************** *}\r\n<br />\r\n<h2 class=\"withBG\">\r\n	<div class=\"topRight hideShow\">\r\n		<a href=\"javascript:toggle(\'discuss\', \'\', \'showHide\');\"><img id=\"discuss_img\" src=\"./img/blank.gif\" class=\"showHide_on\" alt=\"show/hide\" border=\"0\" /></a></div> \r\n	Discussion Board</h2>\r\n<div id=\"discuss\" style=\"display:block;\">\r\n	<table cellpadding=\"0\" width=\"100%\" border=\"0\"><tr><td><iframe src=\"?pg=competition/forum\" id=\"discussionBoard\" frameborder=\"0\" scrolling=\"yes\" style=\"width:100%;\"></iframe></td></tr></table>\r\n</div>\r\n\r\n</div></td>\r\n</tr></table>'),(3566,222,0.29,'smarty','0','Page created.',1113344193,3,'24.10.217.227','{assign var=\"hideWidgets\" value=0}\r\n{assign var=\"hideUserBox\" value=\"false\"}\r\n{assign var=\"showCompanyNews\" value=\"true\"}\r\n{assign var=\"pgLayout\" value=\"layouts/withLeftNav.tpl\"}\r\n\r\n{include_php file=\"shared_handle:competition.load\"}\r\n{if $competition.userId eq $user->id or $acm->isDomainAdmin()}\r\n	{assign var=\"isManager\" value=\"true\"}\r\n	<!-- ismanager -->\r\n	{include_php file=\"shared_handle:competition.management\"}\r\n{/if}\r\n\r\n{include_php file=\"shared_handle:competition.verifyInitialPot\"}\r\n\r\n<table width=\"100%\" cellpadding=\"0\" cellspacing=\"0\" border=\"0\">\r\n	<tr>\r\n		<td valign=\"top\" width=\"260\">\r\n		<br />\r\n		<h2 class=\"withBG\">\r\n			<div class=\"topRight hideShow\">\r\n					<a href=\"javascript:toggle(\'leaderBoard\', \'\', \'showHide\');\"><img id=\"leaderBoard_img\" src=\"./img/blank.gif\" class=\"showHide_on\" alt=\"show/hide\" border=\"0\" /></a>\r\n				</div>\r\n			Leaders\r\n		</h2>\r\n		{if $competition.dateOfObject}<div align=\"right\"><small><i>as of {$competition.dateOfObject|date_format2:\"n/j/Y g:i A\"}</i></small></div>{/if}\r\n		<div id=\"leaderBoard\" style=\"display:block;\">\r\n		{if $competition.style eq \'Group-vs-Group\'}\r\n			<div style=\"white-space:nowrap;display:block;\">\r\n			<span class=\"cellHeadTiny\">#</span>\r\n			<span class=\"cellHeadBig\">Team</span>\r\n			<span class=\"cellHeadTiny\">{if $competition.scoringMethod eq \'Percentage Weight Lost\'}%\r\n					{elseif $competition.scoringMethod eq \'Weight Lost\' or $competition.scoringMethod eq \'Weight Gained\'}Lbs\r\n					{elseif $competition.scoringMethod eq \'Minutes Exercise\'}Min\r\n					{elseif $competition.scoringMethod eq \'Distance Exercised\'}Dist\r\n			{/if}</span>\r\n			<span class=\"cellHeadTiny\">#Pl</span>\r\n			</div>\r\n			{foreach name=\"rankLoop\" from=$competition.teams item=\"teams\" key=\"teamName\"}\r\n				{if $teams.name ne \"Waiting to Join\"}\r\n					{if not $teams.userCount}\r\n						{assign var=\"score\" value=\"-\"}\r\n					{elseif $competition.scoringMethod eq \'Percentage Weight Lost\'}\r\n						{assign var=\"score\" value=$teams.averagePercentLost|number_format:\"2\"|default:\"-\"}\r\n					{elseif $competition.scoringMethod eq \'Weight Lost\'}\r\n						{assign var=\"score\" value=$teams.averageWeightLost|number_format:\"2\"|default:\"-\"}\r\n					{elseif $competition.scoringMethod eq \'Weight Gained\'}\r\n						{assign var=\"score\" value=$teams.averageWeightGain|number_format:\"2\"|default:\"-\"}\r\n					{elseif $competition.scoringMethod eq \'Minutes Exercise\'}\r\n						{assign var=\"score\" value=$teams.averageExercise|number_format:\"2\"|default:\"-\"}\r\n					{elseif $competition.scoringMethod eq \'Distance Exercised\'}\r\n						{assign var=\"score\" value=$teams.averageDistance|number_format:\"2\"|default:\"-\"}\r\n					{/if}\r\n					<div style=\"white-space:nowrap;display:block;\">\r\n						<span class=\"cellTiny\" style=\"clear:left;\"><small>{$smarty.foreach.rankLoop.iteration}</small></span>\r\n						<span class=\"cellBig\"><small class=\"mini\">{$teams.name|default:\"&nbsp;\"}</small></span>\r\n						<span class=\"cellTiny\"><small>{$score|replace:\".00\":\"\"}</small></span>\r\n						<span class=\"cellTiny\"><small>{$teams.userCount|default:\"0\"}</small></span>\r\n					</div>\r\n				{/if}\r\n			{/foreach}\r\n		{else}\r\n			<div style=\"white-space:nowrap;display:block;\">\r\n			<span class=\"cellHeadTiny\">#</span>\r\n			<span class=\"cellHeadSmall\">Name</span>\r\n			<span class=\"cellHeadTiny\">{if $competition.scoringMethod eq \'Percentage Weight Lost\'}%\r\n					{elseif $competition.scoringMethod eq \'Weight Lost\' or $competition.scoringMethod eq \'Weight Gained\'}Lbs\r\n					{elseif $competition.scoringMethod eq \'Minutes Exercise\'}Min\r\n					{elseif $competition.scoringMethod eq \'Distance Exercised\'}Dist\r\n			{/if}</span>\r\n			<span class=\"cellHeadSmall\">Update</span>\r\n			</div>\r\n			{foreach from=$competition.users item=\"compUser\" key=\"username\" name=\"dateUpdated\"}\r\n			{if $user->username eq \"trave\"}{display var=$compUser}{/if}\r\n			{if $smarty.foreach.dateUpdated.iteration eq 21}\r\n			</div>\r\n			<br />\r\n			<h2 class=\"withBG\">\r\n				<div class=\"topRight hideShow\">\r\n					<a href=\"javascript:toggle(\'runnerUps\', \'\', \'showHide\');\"><img id=\"runnerUps_img\" src=\"./img/blank.gif\" class=\"showHide_off\" alt=\"show/hide\" border=\"0\" /></a>\r\n				</div>\r\n				Runner Ups\r\n			</h2>\r\n			<div id=\"runnerUps\" style=\"display:none;\">\r\n			{/if}\r\n			<span class=\"cellTiny\" style=\"clear:left;\"><small>{$smarty.foreach.dateUpdated.iteration}</small></span>\r\n			<span class=\"cellSmall\"><small class=\"mini\">{$username}</small></span>\r\n			<span class=\"cellTiny\"><small>{if $competition.scoringMethod eq \'Percentage Weight Lost\'}{$compUser[$scoringMethod]|number_format:\"2\"|replace:\".00\":\"\"|default:\"~\"}{else}{$compUser.$scoringMethod|replace:\".00\":\"\"|default:\"/\"}{/if}</small></span>\r\n			<span class=\"cellSmall\"><small>{if $compUser.dateOfEntry}{$compUser.dateOfEntry|date_format2:\"n/j/y\"}{else}-Never-{/if}</small></span>\r\n			{/foreach}\r\n		{/if}\r\n		</div> \r\n		<div align=\"right\"><small><i><a href=\"?pg=faq#comp\">How is the competition scored?</a></i></small></div>\r\n		<img src=\"./img/blank.gif\" width=\"168\" height=\"1\" alt=\"\" />\r\n		{if $isManager}\r\n		<h2 class=\"withBG\">\r\n			<div class=\"topRight hideShow\">\r\n				<a href=\"javascript:toggle(\'managePlayers\', \'\', \'showHide\');\"><img id=\"managePlayers_img\" src=\"./img/blank.gif\" class=\"showHide_off\" alt=\"show/hide\" border=\"0\" /></a>\r\n			</div> \r\n			Manage\r\n		</h2>\r\n		<div id=\"managePlayers\" style=\"display:none;\">\r\n					<form name=\"managePlayers[]\" action=\"index.php\" method=\"POST\" style=\"margin:0px;\">\r\n					<input type=\"hidden\" name=\"pg\" value=\"{$page.name}\">\r\n					<input type=\"hidden\" name=\"cid\" value=\"{$competition.id}\">\r\n					<input type=\"hidden\" name=\"no_expire\" value=\"true\">\r\n					<input type=\"hidden\" name=\"style\" value=\"{$competition.style}\">\r\n							{if $competition.style eq \'Group-vs-Group\'}\r\n								<span class=\"cellHeadTiny\" style=\"clear:left;\">Del</span>\r\n								<span class=\"cellHead\">View Stats</span>\r\n								<span class=\"cellHeadSmall\">-</span><br />\r\n								{foreach from=$competition.teams item=\"teams\" key=\"teamName\"}\r\n									{foreach from=$teams.users item=\"users\" key=\"userName\"}\r\n										<span class=\"cellTiny\" style=\"clear:left;\"><small><input type=\"checkbox\" name=\"managePlayers[delete][]\" value=\"{$userName}\" style=\"width:14px; height:14px;margin:0px 2px;\"></small></span>\r\n										<span class=\"cell\"><small><a href=\"?pg=myhome&cid={$competition.id}&userId={$users.id}&hideComps=1\">{$userName}</a></small></span>\r\n										<span class=\"cellSmall\"><small><a href=\"mailto:{$users.email}\">email</a></small></span><br />\r\n									{/foreach}\r\n								{/foreach}\r\n							{else}\r\n								<span class=\"cellHeadTiny\" style=\"clear:left;\">Del</span>\r\n								<span class=\"cellHead\">View Stats</span>\r\n								<span class=\"cellHeadSmall\">-</span><br />\r\n								{foreach from=$competition.users item=\"compUser\" key=\"username\" name=\"dateUpdated\"}\r\n									<span class=\"cellTiny\" style=\"clear:left;\"><small><input type=\"checkbox\" name=\"managePlayers[delete][]\" value=\"{$username}\" style=\"width:14px;height:14px;margin:0px 2px;\"></small></span>\r\n									<span class=\"cell\"><small><a href=\"?pg=myhome&cid={$competition.id}&userId={$compUser.id}&hideComps=1\">{$username}</a></small></span>\r\n									<span class=\"cellSmall\"><small><a href=\"mailto:{$compUser.email}\">email</a></small></span><br />\r\n								{/foreach}\r\n							{/if}\r\n					<div style=\"text-align:center;\">\r\n                                                <br />\r\n						<input type=\"submit\" class=\"button\" value=\"Delete Selected\">\r\n					</div>\r\n					</form>\r\n		</div><br/>\r\n		{/if}\r\n		{* End new section for Player management. *}\r\n		\r\n		{* Begin new section for Team management.  This can be moved where ever. *}\r\n		{* ******************************** TEAM MANAGEMENT ***************************************** *}\r\n		{if $isManager and $competition.style eq \'Group-vs-Group\'}\r\n		<h2 class=\"withBG\">\r\n			<div class=\"topRight hideShow\">\r\n				<a href=\"javascript:toggle(\'teamManagement\', \'\', \'showHide\');\"><img id=\"teamManagement_img\" src=\"./img/blank.gif\" class=\"showHide_{if $smarty.request.showTeamManagement}on{else}off{/if}\" alt=\"show/hide\" border=\"0\" /></a>\r\n			</div>\r\n			Teams</h2>\r\n		<div id=\"teamManagement\" style=\"display:{if $smarty.request.showTeamManagement}block{else}none{/if};\">\r\n			<form name=\"manageTeam[]\" action=\"index.php\" method=\"POST\" style=\"margin:0px;\">\r\n			<input type=\"hidden\" name=\"pg\" value=\"{$page.name}\">\r\n			<input type=\"hidden\" name=\"cid\" value=\"{$competition.id}\">\r\n			<input type=\"hidden\" name=\"no_expire\" value=\"true\">\r\n			<div id=\"playersList{counter}\">\r\n				<span class=\"cellHeadTiny\">Del</span>\r\n				<span class=\"cellHeadLarge\" style=\"width:134px;\">Team Name</span><br />\r\n				{foreach from=$competition.teams item=\"teams\" key=\"teamName\"}\r\n					{counter name=\"counterI\" start=\"0\" print=0}\r\n					{if $teams.name ne \"Waiting to Join\"}\r\n						<span class=\"cellTiny\" style=\"clear:left;\"><small><input type=\"checkbox\" name=\"manageTeam[delete][]\" value=\"{$teams.name}\"></small></span>\r\n						<span class=\"cellLarge\" style=\"width:134px;\"><small><input id=\"renameTeam\" type=\"text\" value=\"{$teams.name}\" name=\"manageTeam[rename][{$teams.name}]\" size=\"10\" style=\"width:124px;height:12px\"></small></span><br />\r\n					{/if}\r\n				{/foreach}\r\n			</div>\r\n                        <br />\r\n			<div style=\"text-align:center;\">New Team: <input id=\"addTeam\" type=\"text\" name=\"manageTeam[addTeam]\" size=\"10\"><br />\r\n			<br />\r\n                        <input type=\"submit\" class=\"button\" value=\"Submit Changes\"></div>\r\n			</form>\r\n		</div><br />\r\n		{/if}\r\n		{* End new section for Team management. *}\r\n\r\n		\r\n		{if !$isManager AND $competition.users|@count lt 45}{include file=\"layouts/ads.tpl\"}{assign var=\"adsShown\" value=\"1\"}{/if}\r\n\r\n			<h2 class=\"withBG\">Competition Stats</h2>\r\n			<span class=\"cellHeadLarge\">Category</span><span class=\"cellHeadSmall\">Result</span><br />\r\n			<span class=\"cellLarge\"><small>start weight</small></span>\r\n			<span class=\"cellSmall\"><small>{$competition.groupStartWeight|default:0} lbs</small></span><br />\r\n			<span class=\"cellLarge\"><small>weight lost</small></span>\r\n			<span class=\"cellSmall\"><small>{$competition.groupWeightLost|default:0} lbs</small></span><br />\r\n			{if $competition.groupPercentageWeightLost gt 0}<span class=\"cellLarge\"><small>% lost</small></span>\r\n			<span class=\"cellSmall\"><small>{$competition.groupPercentageWeightLost|default:0|number_format:\"2\"}</small></span><br />{/if}\r\n			<span class=\"cellLarge\"><small>fat intake</small></span>\r\n			<span class=\"cellSmall\"><small>{$competition.groupFat|default:0}</small></span><br />\r\n			<span class=\"cellLarge\"><small>calorie intake</small></span>\r\n			<span class=\"cellSmall\"><small>{$competition.groupCalories|default:0}</small></span><br />\r\n			<span class=\"cellLarge\"><small>minutes exercised</small></span>\r\n			<span class=\"cellSmall\"><small>{$competition.groupExercise|default:0}</small></span><br />\r\n			<span class=\"cellLarge\"><small>miles exercised</small></span>\r\n			<span class=\"cellSmall\"><small>{$competition.groupDistanceExercised|default:0}</small></span><br />\r\n			<img src=\"./img/blank.gif\" width=\"165\" height=\"1\" alt=\"\" />\r\n		</td>\r\n		<td width=\"100%\" valign=\"top\">\r\n			<div id=\"contentBox\" class=\"centerBox\" style=\"margin-left:10px;\"><div class=\"topRightTreasure\">\r\n<div id=\"jackpot\">{if $competition.potAmount gt 0}${$competition.potAmount|number_format:2}{/if}</div>\r\n<h1 class=\"underline\">{$competition.title|default:\"Competition Title\"}</h1>\r\n\r\n{* ******************************** COMPETITION END *********************************** *}\r\n{if $competition.endDate lt $smarty.now}   {* COMPETITION IS OVER *}\r\n	{if $competition.results.winners|@count eq 1}\r\n		{* There was one winner, either by scoringMethod or tieBreakerMethod *}\r\n\r\n		{math assign=\"daysOfCompetition\" equation=\"(x - y) / z\" x=$competition.endDate|default:\"0\" y=$competition.startDate|default:\"0\" z=\"86400\"}\r\n		{math assign=\"marginOfVictory\" equation=\"x - y\" x=$competition.results.winningStat|default:\"0\" y=$competition.results.secondPlaceStat|default:\"0\"}\r\n\r\n		{foreach from=$competition.results.winners item=\"winnerName\"}    {*key=\"winnerName\"*}\r\n			{assign var=\"winnerData\" value=$competitions.users.$winnerName}\r\n			\r\n			{if $competition.style eq \"Group-vs-Group\"}\r\n				{assign var=\"description\" value=\"Winning Team\"}\r\n				{assign var=\"avg\" value=\"average\"}\r\n			{else}\r\n				{assign var=\"description\" value=\"Winner\"}\r\n			{/if}\r\n\r\n			<h2><br /><b>{$winnerName}</b> is the {$description}{if $competition.potAmount}, taking home <b>$<i>{$competition.potAmount|number_format:2}</i></b>{/if}!</h2>\r\n			<br />\r\n			{strip}\r\n			{if not $competition.results.isTie}   {* Not a Tie *}\r\n				After a difficult <b>{$daysOfCompetition|number_format:0}</b> days of \r\n				fierce competition, <b>{$winnerName}</b> is the \r\n				{$description}!	Based on \r\n				<b>{$competition.results.winningMethod}</b>, <b>{$winnerName}</b> \r\n				won with <b>{$competition.results.winningStat|number_format:2} \r\n				{if $competition.results.winningMethod eq \"Weight Lost\"}{$avg} pounds lost\r\n				{elseif $competition.results.winningMethod eq \"Percentage Weight Lost\"}{$avg} % body weight lost\r\n				{elseif $competition.results.winningMethod eq \"Minutes Exercise\"}{$avg} minutes exercised\r\n				{elseif $competition.results.winningMethod eq \"Distance Exercised\"}{$avg} miles exercised\r\n				{elseif $competition.results.winningMethod eq \"Weight Gained\"}{$avg} pounds gained\r\n				{/if}</b>.\r\n			{else}                                {* A Tie! *}\r\n				{assign var=\"weightLost\" value=\"Weight Lost\"}\r\n				{assign var=\"percentLost\" value=\"Percentage Weight Lost\"}\r\n\r\n				After a difficult <b>{$daysOfCompetition|number_format:0}</b> \r\n				days of fierce competition, there was a tie in the judging \r\n				method, <b>{$competition.scoringMethod}</b>. To break this \r\n				tie, the selected tie breaking method, \r\n				<b>{$competition.tieBreakerMethod}</b>, was used to determine \r\n				<b>{$winnerName}</b> as the {$description}. <b>{$winnerName}</b> \r\n				won with <b>{$competition.results.winningStat|number_format:2}\r\n				{if $competition.results.winningMethod eq \"Weight Lost\"}{$avg} pounds lost\r\n				{elseif $competition.results.winningMethod eq \"Percentage Weight Lost\"}{$avg} % body weight lost\r\n				{elseif $competition.results.winningMethod eq \"Minutes Exercise\"}{$avg} minutes exercised\r\n				{elseif $competition.results.winningMethod eq \"Distance Exercised\"}{$avg} miles exercised\r\n				{elseif $competition.results.winningMethod eq \"Weight Gained\"}{$avg} pounds gained\r\n				{/if}</b>.\r\n				<!--\r\n				<b>{$winnerData.$weightLost|number_format:0} pounds</b>, which \r\n				was <b>{$winnerData.$percentLost|number_format:4}%</b> body weight.\r\n				-->\r\n			{/if}\r\n			{/strip}\r\n			<br />\r\n			<br />\r\n			<b>{$winnerName}</b> won with a <b>{$marginOfVictory|number_format:3}</b> margin over <b>{$competition.results.secondPlaceUser}</b>.\r\n			\r\n			<h2><br />Congratulations to you all!</h2>\r\n			<br />\r\n			<div class=\"underline\"></div>\r\n		{/foreach}\r\n\r\n	{elseif $competition.results.winners|@count gt 1}\r\n		{* There were multiple winners, even after tieBreakerMethod (should RARELY happen) *}\r\n	\r\n		<h2>There was a tie in this competition. The winners, by <b>{$competition.results.winningMethod}</b> having lost <b>{$competition.results.winningStat}</b>, are:<br /></h2>\r\n		<ul>\r\n		{foreach from=$competition.results.winners item=\"winnerData\" key=\"winnerName\"}\r\n			<li>{$winnerName}</li>\r\n		{/foreach}\r\n		</ul>\r\n		\r\n	{else}\r\n		{* For some reason, there were no winners *}\r\n\r\n		<h2><br />\r\n		Winner information is currently unavailable.<br />\r\n		Please check back soon.\r\n		<br /><br /></h2>\r\n	{/if}\r\n	This competition has ended and is no longer active.<br />\r\n{/if}\r\n{* ************************************************************************************ *}\r\n\r\n<div id=\"prizeDesc\">{$competition.potDescription}<br />\r\n{if $competition.potAmount}<small style=\"color:#FFF;\">(${$competition.individualPotAmount} from {$competition.potMethod})</small>{/if}</div>\r\n\r\n{if $competition.startDate lt $smarty.now}\r\n	Time remaining: <b>{$competition.timeLeft}</b><br />\r\n{else}\r\n	This competition has not yet started!<br />\r\n{/if}\r\n\r\nStart{if $competition.startDate lt $smarty.now}ed{else}s{/if}: <b>{$competition.startDate|date_format2:\"n/j/Y\"}</b> &nbsp; \r\nEnd{if $competition.endDate lt $smarty.now}ed{else}s{/if}: <b>{$competition.endDate|date_format2:\"n/j/Y\"}</b><br />\r\n{if $competition.calculationMode neq \"Real-Time\"}Competition stats/scoring updated as of {$competition.dateOfObject|date_format2:\"n/j/Y g:i A\"}{if $isManager} (<a href=\"?pg=competition&cid={$smarty.request.cid}&nocache=1\">Update Now!</a>){/if}<br />{/if}\r\n<div style=\"font-size:5px;clear:left;\">&nbsp;</div>\r\n{assign var=\"scoringMethod\" value=$competition.scoringMethod}\r\n{assign var=\"tieBreakerMethod\" value=$competition.tieBreakerMethod}\r\n{assign var=\"weeklyWinnersMethod1\" value=$competition.weeklyWinnersMethod1}\r\n{assign var=\"weeklyWinnersMethod2\" value=$competition.weeklyWinnersMethod2}\r\n\r\n{* ******************** WEEKLY WINNERS ********************* *}\r\n{if $competition.weeklyWinners}\r\n	{if $weeklyWinnersMethod1}             {* DON\'T FORGET TO REMOVE THE ACM CHECK WHEN READY!!! *}\r\n		<h2 class=\"withBG\">\r\n			<div class=\"topRight hideShow\">\r\n			<a href=\"javascript:toggle(\'weeklyWinners\', \'\', \'showHide\');\"><img id=\"weeklyWinners_img\" src=\"./img/blank.gif\" class=\"showHide_on\" alt=\"show/hide\" border=\"0\" /></a></div>\r\n			Last Week\'s Winners<i>!</i> <small style=\"color:#000; font-size:11px;\">(<i><b>{$competition.weeklyWinners.startDate|date_format2:\"D n/j\"}</b> through <b>{$competition.weeklyWinners.endDate|date_format2:\"D n/j\"}</b></i>)</small></h2> \r\n		<div id=\"weeklyWinners\">\r\n		<table width=\"100%\" cellpadding=\"3\" cellspacing=\"0\"><tr>\r\n		<td valign=\"top\" width=\"50%\">\r\n		<div class=\"cellHeadLarge\" style=\"width:auto;float:none;\">{$weeklyWinnersMethod1}</div>\r\n		<img src=\"{$skinFolder}images/winner_1.gif\" style=\"float:left;\" />\r\n		{strip}\r\n		{foreach name=\"method1\" from=$competition.weeklyWinners.$weeklyWinnersMethod1 item=\"username\"}\r\n			{assign var=\"userValue\" value=$competition.weeklyWinners.users.$username.$weeklyWinnersMethod1}\r\n			{if $smarty.foreach.method1.iteration gt 3 OR $userValue lte 0}{if $smarty.foreach.method1.iteration eq 1}Don\'t forget to update your progress so there will be winners next week{/if}<i>!</i>{php}break;{/php}\r\n			{elseif $smarty.foreach.method1.iteration eq 1}\r\n				<b>{$username|default:\"[ ?? ]\"|ucfirst}</b> led the way last week by \r\n				{if $weeklyWinnersMethod1 eq \'Weight Lost\'}losing <b>{$userValue}</b> pounds{elseif $weeklyWinnersMethod1 eq \'Percentage Weight Lost\'}losing <b>{$userValue|number_format:\"2\"}%</b> body weight{elseif $weeklyWinnersMethod1 eq \'Minutes Exercise\'}exercising <b>{$userValue}</b> minutes{elseif $weeklyWinnersMethod1 eq \'Distance Exercised\'}exercising <b>{$userValue}</b> miles{elseif $weeklyWinnersMethod1 eq \'Weight Gained\'}gaining <b>{$userValue}</b> pounds{else}<b>default</b>{/if}\r\n			{else}\r\n				{if $smarty.foreach.method1.iteration eq 2}, followed by <b>{$username|default:\"[ ?? ]\"|ucfirst}</b> with \r\n				{else} and <b>{$username|default:\"[ ?? ]\"|ucfirst}</b> with \r\n				{/if}\r\n				{if $weeklyWinnersMethod1 eq \'Weight Lost\'}<b>{$userValue}</b> pounds{elseif $weeklyWinnersMethod1 eq \'Percentage Weight Lost\'}<b>{$userValue|number_format:\"2\"}%</b>{elseif $weeklyWinnersMethod1 eq \'Minutes Exercise\'}<b>{$userValue}</b> minutes{elseif $weeklyWinnersMethod1 eq \'Distance Exercised\'}<b>{$userValue}</b> miles{elseif $weeklyWinnersMethod1 eq \'Weight Gained\'}<b>{$userValue}</b> pounds{/if}\r\n			{/if}\r\n		{/foreach}\r\n		{/strip}\r\n		</td>\r\n	{/if}\r\n	{if $weeklyWinnersMethod2} \r\n		<td valign=\"top\" width=\"50%\">\r\n		<div class=\"cellHeadLarge\" style=\"width:auto;float:none;\">{$weeklyWinnersMethod2}</div>\r\n		<img src=\"{$skinFolder}images/winner_2.gif\" style=\"float:left;\" />\r\n		{* display var=$competition.weeklyWinners.users *}\r\n		{strip}\r\n		{foreach name=\"method2\" from=$competition.weeklyWinners.$weeklyWinnersMethod2 item=\"username\"}\r\n			{assign var=\"userValue\" value=$competition.weeklyWinners.users.$username.$weeklyWinnersMethod2}\r\n			\r\n			{if $smarty.foreach.method2.iteration gt 3 OR $userValue lte 0}{if $smarty.foreach.method2.iteration eq 1}Don\'t forget to update your progress so there will be winners next week{/if}<i>!</i>{php}break;{/php}\r\n			{elseif $smarty.foreach.method2.iteration eq 1}\r\n				<b>{$username|default:\"[ ?? ]\"|ucfirst}</b> won by \r\n				{if $weeklyWinnersMethod2 eq \'Weight Lost\'}losing <b>{$userValue}</b> pounds{elseif $weeklyWinnersMethod2 eq \'Percentage Weight Lost\'}losing <b>{$userValue|number_format:\"2\"}%</b> body weight{elseif $weeklyWinnersMethod2 eq \'Minutes Exercise\'}exercising <b>{$userValue}</b> minutes{elseif $weeklyWinnersMethod2 eq \'Distance Exercised\'}exercising <b>{$userValue}</b> miles{elseif $weeklyWinnersMethod2 eq \'Weight Gained\'}gaining <b>{$userValue}</b> pounds{/if}\r\n			{else}\r\n				{if $smarty.foreach.method2.iteration eq 2}, followed by <b>{$username|default:\"[ ?? ]\"|ucfirst}</b> with \r\n				{else} and <b>{$username|default:\"[ ?? ]\"|ucfirst}</b> with \r\n				{/if}\r\n				{if $weeklyWinnersMethod2 eq \'Weight Lost\'}<b>{$userValue}</b> pounds{elseif $weeklyWinnersMethod2 eq \'Percentage Weight Lost\'}<b>{$userValue|number_format:\"2\"}%</b>{elseif $weeklyWinnersMethod2 eq \'Minutes Exercise\'}<b>{$userValue}</b> minutes{elseif $weeklyWinnersMethod2 eq \'Distance Exercised\'}<b>{$userValue}</b> miles{elseif $weeklyWinnersMethod2 eq \'Weight Gained\'}<b>{$userValue}</b> pounds{/if}\r\n			{/if}\r\n		{/foreach}\r\n		{/strip}\r\n		</td>\r\n	{/if}\r\n	{if $weeklyWinnersMethod1}\r\n	</tr></table></div>{/if}\r\n{/if}\r\n{* ********************************************************* *}\r\n\r\n{if $acm->isDomainAdmin() and $smarty.request.debug}\r\n	{display var=$competition}\r\n{/if} \r\n\r\n{* ******************************** COMPARISON GRAPHS ***************************************** *}\r\n{if $competition.availableGraphs|@count}\r\n{include_php file=\"shared_handle:competition.graphs\"}\r\n<h2 class=\"withBG\"><a name=\"graph\"></a>\r\n	<div class=\"topRight hideShow\">\r\n		<a href=\"javascript:toggle(\'graphs\', \'\', \'showHide\');\"><img id=\"graphs_img\" src=\"./img/blank.gif\" class=\"showHide_on\" alt=\"show/hide\" border=\"0\" /></a></div> \r\n	Comparison Graphs &nbsp; <small><i>No graph? <a href=\"http://www.macromedia.com/shockwave/download/download.cgi?P1_Prod_Version=ShockwaveFlash\" target=\"_blank\">click here</a> to download the free Flash Player plug-in.</i></small></h2>\r\n<div id=\"graphs\" style=\"display:block;\">\r\n	<table border=\"0\" cellpadding=\"0\" width=\"100%\">\r\n		{assign var=\"graphURL\" value=\"?pg=flashgraph-frame&format=wide\"}\r\n	<tr>\r\n		<td><div style=\"border:#999 1px solid;background-color:#FFF;padding:5px;\"><iframe name=\"graphwindow\" src=\"{$graphURL}\" frameborder=\"0\" width=\"625\" height=\"222\" scrollbars=\"no\"></iframe></div></td>\r\n	</tr>\r\n	<tr>\r\n		<td valign=\"top\" align=\"center\" width=\"100%\">\r\n		<small>\r\n		{foreach name=\"graphTypes\" from=$competition.availableGraphs key=\"graphType\" item=\"graphParams\"}\r\n		<a href=\"?pg=flashgraph-frame&compId={$competition.id}&{$graphParams}\" target=\"graphwindow\">{$graphType}</a>{if $smarty.foreach.graphTypes.iteration neq $competition.availableGraphs|@count} | {/if}\r\n		{/foreach}\r\n		</small></td>\r\n	</tr>\r\n	</table>\r\n<br />\r\n</div>\r\n{/if}\r\n\r\n{* ******************************** GROUP TEAMS/PLAYERS SUMMARY W/MOVING ***************************************** *}\r\n{if $competition.style eq \'Group-vs-Group\'}\r\n<h2 class=\"withBG\">\r\n	<div class=\"topRight hideShow\">\r\n		<a href=\"javascript:toggle(\'teams\', \'\', \'showHide\');\"><img id=\"teams_img\" src=\"./img/blank.gif\" class=\"showHide_on\" alt=\"show/hide\" border=\"0\" /></a></div> \r\n	The Teams &nbsp; <small><i>Assignments and statistics</i></small></h2>\r\n<div id=\"teams\" style=\"display:block;\">\r\n<table cellpadding=\"0\" cellspacing=\"0\" width=\"100%\" border=\"0\"><tr><td>\r\n	{if $isManager}\r\n		<form name=\"changeTeam\" action=\"index.php\" method=\"POST\" style=\"margin:0px;\">\r\n			<input type=\"hidden\" name=\"pg\" value=\"{$page.name}\">\r\n			<input type=\"hidden\" name=\"cid\" value=\"{$competition.id}\">\r\n			<input type=\"hidden\" name=\"no_expire\" value=\"true\">\r\n	{/if}\r\n		{assign var=\"minEx\" value=\"Minutes Exercise\"}\r\n		{assign var=\"distEx\" value=\"Distance Exercised\"}\r\n		{assign var=\"pctLst\" value=\"Percentage Weight Lost\"}\r\n		{assign var=\"wtLst\" value=\"Percentage Weight Lost\"}\r\n		{foreach from=$competition.teams name=\"teamsLoop\" item=\"teams\" key=\"teamName\"}\r\n			<div id=\"playersList{$smarty.foreach.teamsLoop.iteration}\" style=\"float:left;width:310px;overflow:hidden;word-wrap:nowrap; margin:0px 5px 5px 0px;\">\r\n			<h4>{if $teams.name eq \"Waiting to Join\"}Not assigned to a team{else}{$teams.name|default:\"&nbsp;\"}{/if}</h4>\r\n		{if $scoringMethod|regex_match:\"/exercise/i\"}\r\n			<span class=\"cellHeadLarge\">Name</span>\r\n			<span class=\"cellHeadSmall\">Min.</span>\r\n			<span class=\"cellHeadSmall\">Dist.</span>\r\n			<span class=\"cellHeadSmall\">Update</span><br />\r\n			{foreach from=$teams.users item=\"users\" key=\"userName\"}\r\n				<span class=\"cellLarge\" style=\"text-align:left;\"><small>{if $isManager}<input type=\"checkbox\" name=\"changeTeam[players][{$userName}]\" style=\"width:14px;height:14px;margin:0px 2px;\" />{/if}{$userName}</small></span>\r\n				<span class=\"cellSmall\"><small>{$users.$minEx|default:\"-\"|replace:\".00\":\"\"}</small></span>\r\n				<span class=\"cellSmall\"><small>{$users.$distEx|default:\"-\"|replace:\".00\":\"\"}</small></span>\r\n				<span class=\"cellSmall\"><small>{if $users.dateOfEntry}{$users.dateOfEntry|date_format2:\"n/j/y\"}{else}Never{/if}</small></span>\r\n			{foreachelse}\r\n				{* No players assigned to this team. *}\r\n			{/foreach}\r\n		{else}\r\n			<span class=\"cellHeadLarge\">Name</span>\r\n			<span class=\"cellHeadTiny\">%</span>\r\n			<span class=\"cellHeadSmall\">Update</span><br />\r\n			{foreach from=$teams.users item=\"users\" key=\"userName\"}\r\n				<span class=\"cellLarge\" style=\"clear:left;text-align:left;\"><small>{if $isManager}<input type=\"checkbox\" name=\"changeTeam[players][{$userName}]\" />{/if}{$userName}</small></span>\r\n				<span class=\"cellTiny\"><small>{if $users.hideInitialWeight neq \"Yes\"}{$users.$pctLst|number_format:\"2\"|replace:\".00\":\"\"}{else}-{/if}</small></span>\r\n				<span class=\"cellSmall\"><small>{if $users.dateOfEntry}{$users.dateOfEntry|date_format2:\"n/j/y\"}{else}Never{/if}</small></span><br />\r\n			{foreachelse}\r\n				{* No players assigned to this team. *}\r\n			{/foreach}\r\n		{/if}\r\n			</div>\r\n		{/foreach}\r\n	{if $isManager}\r\n		<br />\r\n		<select name=\"changeTeam[team]\">\r\n			<option value=\"\">Move selected players to...</option>\r\n			{foreach from=$competition.teams item=\"newTeams\" key=\"newTeamName\"}\r\n				{*if $newTeams.name ne $teams.name and $newTeams.name ne \"Waiting to Join\"*}\r\n				{if $newTeams.name ne \"Waiting to Join\"}\r\n					<option value=\"{$newTeams.name}\">{$newTeams.name}</option>\r\n				{/if}\r\n			{/foreach}\r\n		</select><br />\r\n		<input type=\"submit\" class=\"button\" value=\"Submit Changes\">\r\n		</form>\r\n	{/if}\r\n</td></tr></table>\r\n</div>\r\n{/if}\r\n</div>\r\n	{* ******************************** DISCUSSION BOARD ***************************************** *}\r\n<br />\r\n<h2 class=\"withBG\">\r\n	<div class=\"topRight hideShow\">\r\n		<a href=\"javascript:toggle(\'discuss\', \'\', \'showHide\');\"><img id=\"discuss_img\" src=\"./img/blank.gif\" class=\"showHide_on\" alt=\"show/hide\" border=\"0\" /></a></div> \r\n	Discussion Board</h2>\r\n<div id=\"discuss\" style=\"display:block;\">\r\n	<table cellpadding=\"0\" width=\"100%\" border=\"0\"><tr><td><iframe src=\"?pg=competition/forum\" id=\"discussionBoard\" frameborder=\"0\" scrolling=\"yes\" style=\"width:100%;\"></iframe></td></tr></table>\r\n</div>\r\n\r\n</div></td>\r\n</tr></table>'),(3567,222,0.30,'smarty','0','Page created.',1113344290,3,'24.10.217.227','{assign var=\"hideWidgets\" value=0}\r\n{assign var=\"hideUserBox\" value=\"false\"}\r\n{assign var=\"showCompanyNews\" value=\"true\"}\r\n{assign var=\"pgLayout\" value=\"layouts/withLeftNav.tpl\"}\r\n\r\n{include_php file=\"shared_handle:competition.load\"}\r\n{if $competition.userId eq $user->id or $acm->isDomainAdmin()}\r\n	{assign var=\"isManager\" value=\"true\"}\r\n	<!-- ismanager -->\r\n	{include_php file=\"shared_handle:competition.management\"}\r\n{/if}\r\n\r\n{include_php file=\"shared_handle:competition.verifyInitialPot\"}\r\n\r\n<table width=\"100%\" cellpadding=\"0\" cellspacing=\"0\" border=\"0\">\r\n	<tr>\r\n		<td valign=\"top\" width=\"260\">\r\n		<br />\r\n		<h2 class=\"withBG\">\r\n			<div class=\"topRight hideShow\">\r\n					<a href=\"javascript:toggle(\'leaderBoard\', \'\', \'showHide\');\"><img id=\"leaderBoard_img\" src=\"./img/blank.gif\" class=\"showHide_on\" alt=\"show/hide\" border=\"0\" /></a>\r\n				</div>\r\n			Leaders\r\n		</h2>\r\n		{if $competition.dateOfObject}<div align=\"right\"><small><i>as of {$competition.dateOfObject|date_format2:\"n/j/Y g:i A\"}</i></small></div>{/if}\r\n		<div id=\"leaderBoard\" style=\"display:block;\">\r\n		{if $competition.style eq \'Group-vs-Group\'}\r\n			<div style=\"white-space:nowrap;display:block;\">\r\n			<span class=\"cellHeadTiny\">#</span>\r\n			<span class=\"cellHeadBig\">Team</span>\r\n			<span class=\"cellHeadTiny\">{if $competition.scoringMethod eq \'Percentage Weight Lost\'}%\r\n					{elseif $competition.scoringMethod eq \'Weight Lost\' or $competition.scoringMethod eq \'Weight Gained\'}Lbs\r\n					{elseif $competition.scoringMethod eq \'Minutes Exercise\'}Min\r\n					{elseif $competition.scoringMethod eq \'Distance Exercised\'}Dist\r\n			{/if}</span>\r\n			<span class=\"cellHeadTiny\">#Pl</span>\r\n			</div>\r\n			{foreach name=\"rankLoop\" from=$competition.teams item=\"teams\" key=\"teamName\"}\r\n				{if $teams.name ne \"Waiting to Join\"}\r\n					{if not $teams.userCount}\r\n						{assign var=\"score\" value=\"-\"}\r\n					{elseif $competition.scoringMethod eq \'Percentage Weight Lost\'}\r\n						{assign var=\"score\" value=$teams.averagePercentLost|number_format:\"2\"|default:\"-\"}\r\n					{elseif $competition.scoringMethod eq \'Weight Lost\'}\r\n						{assign var=\"score\" value=$teams.averageWeightLost|number_format:\"2\"|default:\"-\"}\r\n					{elseif $competition.scoringMethod eq \'Weight Gained\'}\r\n						{assign var=\"score\" value=$teams.averageWeightGain|number_format:\"2\"|default:\"-\"}\r\n					{elseif $competition.scoringMethod eq \'Minutes Exercise\'}\r\n						{assign var=\"score\" value=$teams.averageExercise|number_format:\"2\"|default:\"-\"}\r\n					{elseif $competition.scoringMethod eq \'Distance Exercised\'}\r\n						{assign var=\"score\" value=$teams.averageDistance|number_format:\"2\"|default:\"-\"}\r\n					{/if}\r\n					<div style=\"white-space:nowrap;display:block;\">\r\n						<span class=\"cellTiny\" style=\"clear:left;\"><small>{$smarty.foreach.rankLoop.iteration}</small></span>\r\n						<span class=\"cellBig\"><small class=\"mini\">{$teams.name|default:\"&nbsp;\"}</small></span>\r\n						<span class=\"cellTiny\"><small>{$score|replace:\".00\":\"\"}</small></span>\r\n						<span class=\"cellTiny\"><small>{$teams.userCount|default:\"0\"}</small></span>\r\n					</div>\r\n				{/if}\r\n			{/foreach}\r\n		{else}\r\n			<div style=\"white-space:nowrap;display:block;\">\r\n			<span class=\"cellHeadTiny\">#</span>\r\n			<span class=\"cellHeadSmall\">Name</span>\r\n			<span class=\"cellHeadTiny\">{if $competition.scoringMethod eq \'Percentage Weight Lost\'}%\r\n					{elseif $competition.scoringMethod eq \'Weight Lost\' or $competition.scoringMethod eq \'Weight Gained\'}Lbs\r\n					{elseif $competition.scoringMethod eq \'Minutes Exercise\'}Min\r\n					{elseif $competition.scoringMethod eq \'Distance Exercised\'}Dist\r\n			{/if}</span>\r\n			<span class=\"cellHeadSmall\">Update</span>\r\n			</div>\r\n			{foreach from=$competition.users item=\"compUser\" key=\"username\" name=\"dateUpdated\"}\r\n			{if $user->username eq \"trave\"}{$scoringMethod}{display var=$compUser}{/if}\r\n			{if $smarty.foreach.dateUpdated.iteration eq 21}\r\n			</div>\r\n			<br />\r\n			<h2 class=\"withBG\">\r\n				<div class=\"topRight hideShow\">\r\n					<a href=\"javascript:toggle(\'runnerUps\', \'\', \'showHide\');\"><img id=\"runnerUps_img\" src=\"./img/blank.gif\" class=\"showHide_off\" alt=\"show/hide\" border=\"0\" /></a>\r\n				</div>\r\n				Runner Ups\r\n			</h2>\r\n			<div id=\"runnerUps\" style=\"display:none;\">\r\n			{/if}\r\n			<span class=\"cellTiny\" style=\"clear:left;\"><small>{$smarty.foreach.dateUpdated.iteration}</small></span>\r\n			<span class=\"cellSmall\"><small class=\"mini\">{$username}</small></span>\r\n			<span class=\"cellTiny\"><small>{if $competition.scoringMethod eq \'Percentage Weight Lost\'}{$compUser[$scoringMethod]|number_format:\"2\"|replace:\".00\":\"\"|default:\"~\"}{else}{$compUser.$scoringMethod|replace:\".00\":\"\"|default:\"/\"}{/if}</small></span>\r\n			<span class=\"cellSmall\"><small>{if $compUser.dateOfEntry}{$compUser.dateOfEntry|date_format2:\"n/j/y\"}{else}-Never-{/if}</small></span>\r\n			{/foreach}\r\n		{/if}\r\n		</div> \r\n		<div align=\"right\"><small><i><a href=\"?pg=faq#comp\">How is the competition scored?</a></i></small></div>\r\n		<img src=\"./img/blank.gif\" width=\"168\" height=\"1\" alt=\"\" />\r\n		{if $isManager}\r\n		<h2 class=\"withBG\">\r\n			<div class=\"topRight hideShow\">\r\n				<a href=\"javascript:toggle(\'managePlayers\', \'\', \'showHide\');\"><img id=\"managePlayers_img\" src=\"./img/blank.gif\" class=\"showHide_off\" alt=\"show/hide\" border=\"0\" /></a>\r\n			</div> \r\n			Manage\r\n		</h2>\r\n		<div id=\"managePlayers\" style=\"display:none;\">\r\n					<form name=\"managePlayers[]\" action=\"index.php\" method=\"POST\" style=\"margin:0px;\">\r\n					<input type=\"hidden\" name=\"pg\" value=\"{$page.name}\">\r\n					<input type=\"hidden\" name=\"cid\" value=\"{$competition.id}\">\r\n					<input type=\"hidden\" name=\"no_expire\" value=\"true\">\r\n					<input type=\"hidden\" name=\"style\" value=\"{$competition.style}\">\r\n							{if $competition.style eq \'Group-vs-Group\'}\r\n								<span class=\"cellHeadTiny\" style=\"clear:left;\">Del</span>\r\n								<span class=\"cellHead\">View Stats</span>\r\n								<span class=\"cellHeadSmall\">-</span><br />\r\n								{foreach from=$competition.teams item=\"teams\" key=\"teamName\"}\r\n									{foreach from=$teams.users item=\"users\" key=\"userName\"}\r\n										<span class=\"cellTiny\" style=\"clear:left;\"><small><input type=\"checkbox\" name=\"managePlayers[delete][]\" value=\"{$userName}\" style=\"width:14px; height:14px;margin:0px 2px;\"></small></span>\r\n										<span class=\"cell\"><small><a href=\"?pg=myhome&cid={$competition.id}&userId={$users.id}&hideComps=1\">{$userName}</a></small></span>\r\n										<span class=\"cellSmall\"><small><a href=\"mailto:{$users.email}\">email</a></small></span><br />\r\n									{/foreach}\r\n								{/foreach}\r\n							{else}\r\n								<span class=\"cellHeadTiny\" style=\"clear:left;\">Del</span>\r\n								<span class=\"cellHead\">View Stats</span>\r\n								<span class=\"cellHeadSmall\">-</span><br />\r\n								{foreach from=$competition.users item=\"compUser\" key=\"username\" name=\"dateUpdated\"}\r\n									<span class=\"cellTiny\" style=\"clear:left;\"><small><input type=\"checkbox\" name=\"managePlayers[delete][]\" value=\"{$username}\" style=\"width:14px;height:14px;margin:0px 2px;\"></small></span>\r\n									<span class=\"cell\"><small><a href=\"?pg=myhome&cid={$competition.id}&userId={$compUser.id}&hideComps=1\">{$username}</a></small></span>\r\n									<span class=\"cellSmall\"><small><a href=\"mailto:{$compUser.email}\">email</a></small></span><br />\r\n								{/foreach}\r\n							{/if}\r\n					<div style=\"text-align:center;\">\r\n                                                <br />\r\n						<input type=\"submit\" class=\"button\" value=\"Delete Selected\">\r\n					</div>\r\n					</form>\r\n		</div><br/>\r\n		{/if}\r\n		{* End new section for Player management. *}\r\n		\r\n		{* Begin new section for Team management.  This can be moved where ever. *}\r\n		{* ******************************** TEAM MANAGEMENT ***************************************** *}\r\n		{if $isManager and $competition.style eq \'Group-vs-Group\'}\r\n		<h2 class=\"withBG\">\r\n			<div class=\"topRight hideShow\">\r\n				<a href=\"javascript:toggle(\'teamManagement\', \'\', \'showHide\');\"><img id=\"teamManagement_img\" src=\"./img/blank.gif\" class=\"showHide_{if $smarty.request.showTeamManagement}on{else}off{/if}\" alt=\"show/hide\" border=\"0\" /></a>\r\n			</div>\r\n			Teams</h2>\r\n		<div id=\"teamManagement\" style=\"display:{if $smarty.request.showTeamManagement}block{else}none{/if};\">\r\n			<form name=\"manageTeam[]\" action=\"index.php\" method=\"POST\" style=\"margin:0px;\">\r\n			<input type=\"hidden\" name=\"pg\" value=\"{$page.name}\">\r\n			<input type=\"hidden\" name=\"cid\" value=\"{$competition.id}\">\r\n			<input type=\"hidden\" name=\"no_expire\" value=\"true\">\r\n			<div id=\"playersList{counter}\">\r\n				<span class=\"cellHeadTiny\">Del</span>\r\n				<span class=\"cellHeadLarge\" style=\"width:134px;\">Team Name</span><br />\r\n				{foreach from=$competition.teams item=\"teams\" key=\"teamName\"}\r\n					{counter name=\"counterI\" start=\"0\" print=0}\r\n					{if $teams.name ne \"Waiting to Join\"}\r\n						<span class=\"cellTiny\" style=\"clear:left;\"><small><input type=\"checkbox\" name=\"manageTeam[delete][]\" value=\"{$teams.name}\"></small></span>\r\n						<span class=\"cellLarge\" style=\"width:134px;\"><small><input id=\"renameTeam\" type=\"text\" value=\"{$teams.name}\" name=\"manageTeam[rename][{$teams.name}]\" size=\"10\" style=\"width:124px;height:12px\"></small></span><br />\r\n					{/if}\r\n				{/foreach}\r\n			</div>\r\n                        <br />\r\n			<div style=\"text-align:center;\">New Team: <input id=\"addTeam\" type=\"text\" name=\"manageTeam[addTeam]\" size=\"10\"><br />\r\n			<br />\r\n                        <input type=\"submit\" class=\"button\" value=\"Submit Changes\"></div>\r\n			</form>\r\n		</div><br />\r\n		{/if}\r\n		{* End new section for Team management. *}\r\n\r\n		\r\n		{if !$isManager AND $competition.users|@count lt 45}{include file=\"layouts/ads.tpl\"}{assign var=\"adsShown\" value=\"1\"}{/if}\r\n\r\n			<h2 class=\"withBG\">Competition Stats</h2>\r\n			<span class=\"cellHeadLarge\">Category</span><span class=\"cellHeadSmall\">Result</span><br />\r\n			<span class=\"cellLarge\"><small>start weight</small></span>\r\n			<span class=\"cellSmall\"><small>{$competition.groupStartWeight|default:0} lbs</small></span><br />\r\n			<span class=\"cellLarge\"><small>weight lost</small></span>\r\n			<span class=\"cellSmall\"><small>{$competition.groupWeightLost|default:0} lbs</small></span><br />\r\n			{if $competition.groupPercentageWeightLost gt 0}<span class=\"cellLarge\"><small>% lost</small></span>\r\n			<span class=\"cellSmall\"><small>{$competition.groupPercentageWeightLost|default:0|number_format:\"2\"}</small></span><br />{/if}\r\n			<span class=\"cellLarge\"><small>fat intake</small></span>\r\n			<span class=\"cellSmall\"><small>{$competition.groupFat|default:0}</small></span><br />\r\n			<span class=\"cellLarge\"><small>calorie intake</small></span>\r\n			<span class=\"cellSmall\"><small>{$competition.groupCalories|default:0}</small></span><br />\r\n			<span class=\"cellLarge\"><small>minutes exercised</small></span>\r\n			<span class=\"cellSmall\"><small>{$competition.groupExercise|default:0}</small></span><br />\r\n			<span class=\"cellLarge\"><small>miles exercised</small></span>\r\n			<span class=\"cellSmall\"><small>{$competition.groupDistanceExercised|default:0}</small></span><br />\r\n			<img src=\"./img/blank.gif\" width=\"165\" height=\"1\" alt=\"\" />\r\n		</td>\r\n		<td width=\"100%\" valign=\"top\">\r\n			<div id=\"contentBox\" class=\"centerBox\" style=\"margin-left:10px;\"><div class=\"topRightTreasure\">\r\n<div id=\"jackpot\">{if $competition.potAmount gt 0}${$competition.potAmount|number_format:2}{/if}</div>\r\n<h1 class=\"underline\">{$competition.title|default:\"Competition Title\"}</h1>\r\n\r\n{* ******************************** COMPETITION END *********************************** *}\r\n{if $competition.endDate lt $smarty.now}   {* COMPETITION IS OVER *}\r\n	{if $competition.results.winners|@count eq 1}\r\n		{* There was one winner, either by scoringMethod or tieBreakerMethod *}\r\n\r\n		{math assign=\"daysOfCompetition\" equation=\"(x - y) / z\" x=$competition.endDate|default:\"0\" y=$competition.startDate|default:\"0\" z=\"86400\"}\r\n		{math assign=\"marginOfVictory\" equation=\"x - y\" x=$competition.results.winningStat|default:\"0\" y=$competition.results.secondPlaceStat|default:\"0\"}\r\n\r\n		{foreach from=$competition.results.winners item=\"winnerName\"}    {*key=\"winnerName\"*}\r\n			{assign var=\"winnerData\" value=$competitions.users.$winnerName}\r\n			\r\n			{if $competition.style eq \"Group-vs-Group\"}\r\n				{assign var=\"description\" value=\"Winning Team\"}\r\n				{assign var=\"avg\" value=\"average\"}\r\n			{else}\r\n				{assign var=\"description\" value=\"Winner\"}\r\n			{/if}\r\n\r\n			<h2><br /><b>{$winnerName}</b> is the {$description}{if $competition.potAmount}, taking home <b>$<i>{$competition.potAmount|number_format:2}</i></b>{/if}!</h2>\r\n			<br />\r\n			{strip}\r\n			{if not $competition.results.isTie}   {* Not a Tie *}\r\n				After a difficult <b>{$daysOfCompetition|number_format:0}</b> days of \r\n				fierce competition, <b>{$winnerName}</b> is the \r\n				{$description}!	Based on \r\n				<b>{$competition.results.winningMethod}</b>, <b>{$winnerName}</b> \r\n				won with <b>{$competition.results.winningStat|number_format:2} \r\n				{if $competition.results.winningMethod eq \"Weight Lost\"}{$avg} pounds lost\r\n				{elseif $competition.results.winningMethod eq \"Percentage Weight Lost\"}{$avg} % body weight lost\r\n				{elseif $competition.results.winningMethod eq \"Minutes Exercise\"}{$avg} minutes exercised\r\n				{elseif $competition.results.winningMethod eq \"Distance Exercised\"}{$avg} miles exercised\r\n				{elseif $competition.results.winningMethod eq \"Weight Gained\"}{$avg} pounds gained\r\n				{/if}</b>.\r\n			{else}                                {* A Tie! *}\r\n				{assign var=\"weightLost\" value=\"Weight Lost\"}\r\n				{assign var=\"percentLost\" value=\"Percentage Weight Lost\"}\r\n\r\n				After a difficult <b>{$daysOfCompetition|number_format:0}</b> \r\n				days of fierce competition, there was a tie in the judging \r\n				method, <b>{$competition.scoringMethod}</b>. To break this \r\n				tie, the selected tie breaking method, \r\n				<b>{$competition.tieBreakerMethod}</b>, was used to determine \r\n				<b>{$winnerName}</b> as the {$description}. <b>{$winnerName}</b> \r\n				won with <b>{$competition.results.winningStat|number_format:2}\r\n				{if $competition.results.winningMethod eq \"Weight Lost\"}{$avg} pounds lost\r\n				{elseif $competition.results.winningMethod eq \"Percentage Weight Lost\"}{$avg} % body weight lost\r\n				{elseif $competition.results.winningMethod eq \"Minutes Exercise\"}{$avg} minutes exercised\r\n				{elseif $competition.results.winningMethod eq \"Distance Exercised\"}{$avg} miles exercised\r\n				{elseif $competition.results.winningMethod eq \"Weight Gained\"}{$avg} pounds gained\r\n				{/if}</b>.\r\n				<!--\r\n				<b>{$winnerData.$weightLost|number_format:0} pounds</b>, which \r\n				was <b>{$winnerData.$percentLost|number_format:4}%</b> body weight.\r\n				-->\r\n			{/if}\r\n			{/strip}\r\n			<br />\r\n			<br />\r\n			<b>{$winnerName}</b> won with a <b>{$marginOfVictory|number_format:3}</b> margin over <b>{$competition.results.secondPlaceUser}</b>.\r\n			\r\n			<h2><br />Congratulations to you all!</h2>\r\n			<br />\r\n			<div class=\"underline\"></div>\r\n		{/foreach}\r\n\r\n	{elseif $competition.results.winners|@count gt 1}\r\n		{* There were multiple winners, even after tieBreakerMethod (should RARELY happen) *}\r\n	\r\n		<h2>There was a tie in this competition. The winners, by <b>{$competition.results.winningMethod}</b> having lost <b>{$competition.results.winningStat}</b>, are:<br /></h2>\r\n		<ul>\r\n		{foreach from=$competition.results.winners item=\"winnerData\" key=\"winnerName\"}\r\n			<li>{$winnerName}</li>\r\n		{/foreach}\r\n		</ul>\r\n		\r\n	{else}\r\n		{* For some reason, there were no winners *}\r\n\r\n		<h2><br />\r\n		Winner information is currently unavailable.<br />\r\n		Please check back soon.\r\n		<br /><br /></h2>\r\n	{/if}\r\n	This competition has ended and is no longer active.<br />\r\n{/if}\r\n{* ************************************************************************************ *}\r\n\r\n<div id=\"prizeDesc\">{$competition.potDescription}<br />\r\n{if $competition.potAmount}<small style=\"color:#FFF;\">(${$competition.individualPotAmount} from {$competition.potMethod})</small>{/if}</div>\r\n\r\n{if $competition.startDate lt $smarty.now}\r\n	Time remaining: <b>{$competition.timeLeft}</b><br />\r\n{else}\r\n	This competition has not yet started!<br />\r\n{/if}\r\n\r\nStart{if $competition.startDate lt $smarty.now}ed{else}s{/if}: <b>{$competition.startDate|date_format2:\"n/j/Y\"}</b> &nbsp; \r\nEnd{if $competition.endDate lt $smarty.now}ed{else}s{/if}: <b>{$competition.endDate|date_format2:\"n/j/Y\"}</b><br />\r\n{if $competition.calculationMode neq \"Real-Time\"}Competition stats/scoring updated as of {$competition.dateOfObject|date_format2:\"n/j/Y g:i A\"}{if $isManager} (<a href=\"?pg=competition&cid={$smarty.request.cid}&nocache=1\">Update Now!</a>){/if}<br />{/if}\r\n<div style=\"font-size:5px;clear:left;\">&nbsp;</div>\r\n{assign var=\"scoringMethod\" value=$competition.scoringMethod}\r\n{assign var=\"tieBreakerMethod\" value=$competition.tieBreakerMethod}\r\n{assign var=\"weeklyWinnersMethod1\" value=$competition.weeklyWinnersMethod1}\r\n{assign var=\"weeklyWinnersMethod2\" value=$competition.weeklyWinnersMethod2}\r\n\r\n{* ******************** WEEKLY WINNERS ********************* *}\r\n{if $competition.weeklyWinners}\r\n	{if $weeklyWinnersMethod1}             {* DON\'T FORGET TO REMOVE THE ACM CHECK WHEN READY!!! *}\r\n		<h2 class=\"withBG\">\r\n			<div class=\"topRight hideShow\">\r\n			<a href=\"javascript:toggle(\'weeklyWinners\', \'\', \'showHide\');\"><img id=\"weeklyWinners_img\" src=\"./img/blank.gif\" class=\"showHide_on\" alt=\"show/hide\" border=\"0\" /></a></div>\r\n			Last Week\'s Winners<i>!</i> <small style=\"color:#000; font-size:11px;\">(<i><b>{$competition.weeklyWinners.startDate|date_format2:\"D n/j\"}</b> through <b>{$competition.weeklyWinners.endDate|date_format2:\"D n/j\"}</b></i>)</small></h2> \r\n		<div id=\"weeklyWinners\">\r\n		<table width=\"100%\" cellpadding=\"3\" cellspacing=\"0\"><tr>\r\n		<td valign=\"top\" width=\"50%\">\r\n		<div class=\"cellHeadLarge\" style=\"width:auto;float:none;\">{$weeklyWinnersMethod1}</div>\r\n		<img src=\"{$skinFolder}images/winner_1.gif\" style=\"float:left;\" />\r\n		{strip}\r\n		{foreach name=\"method1\" from=$competition.weeklyWinners.$weeklyWinnersMethod1 item=\"username\"}\r\n			{assign var=\"userValue\" value=$competition.weeklyWinners.users.$username.$weeklyWinnersMethod1}\r\n			{if $smarty.foreach.method1.iteration gt 3 OR $userValue lte 0}{if $smarty.foreach.method1.iteration eq 1}Don\'t forget to update your progress so there will be winners next week{/if}<i>!</i>{php}break;{/php}\r\n			{elseif $smarty.foreach.method1.iteration eq 1}\r\n				<b>{$username|default:\"[ ?? ]\"|ucfirst}</b> led the way last week by \r\n				{if $weeklyWinnersMethod1 eq \'Weight Lost\'}losing <b>{$userValue}</b> pounds{elseif $weeklyWinnersMethod1 eq \'Percentage Weight Lost\'}losing <b>{$userValue|number_format:\"2\"}%</b> body weight{elseif $weeklyWinnersMethod1 eq \'Minutes Exercise\'}exercising <b>{$userValue}</b> minutes{elseif $weeklyWinnersMethod1 eq \'Distance Exercised\'}exercising <b>{$userValue}</b> miles{elseif $weeklyWinnersMethod1 eq \'Weight Gained\'}gaining <b>{$userValue}</b> pounds{else}<b>default</b>{/if}\r\n			{else}\r\n				{if $smarty.foreach.method1.iteration eq 2}, followed by <b>{$username|default:\"[ ?? ]\"|ucfirst}</b> with \r\n				{else} and <b>{$username|default:\"[ ?? ]\"|ucfirst}</b> with \r\n				{/if}\r\n				{if $weeklyWinnersMethod1 eq \'Weight Lost\'}<b>{$userValue}</b> pounds{elseif $weeklyWinnersMethod1 eq \'Percentage Weight Lost\'}<b>{$userValue|number_format:\"2\"}%</b>{elseif $weeklyWinnersMethod1 eq \'Minutes Exercise\'}<b>{$userValue}</b> minutes{elseif $weeklyWinnersMethod1 eq \'Distance Exercised\'}<b>{$userValue}</b> miles{elseif $weeklyWinnersMethod1 eq \'Weight Gained\'}<b>{$userValue}</b> pounds{/if}\r\n			{/if}\r\n		{/foreach}\r\n		{/strip}\r\n		</td>\r\n	{/if}\r\n	{if $weeklyWinnersMethod2} \r\n		<td valign=\"top\" width=\"50%\">\r\n		<div class=\"cellHeadLarge\" style=\"width:auto;float:none;\">{$weeklyWinnersMethod2}</div>\r\n		<img src=\"{$skinFolder}images/winner_2.gif\" style=\"float:left;\" />\r\n		{* display var=$competition.weeklyWinners.users *}\r\n		{strip}\r\n		{foreach name=\"method2\" from=$competition.weeklyWinners.$weeklyWinnersMethod2 item=\"username\"}\r\n			{assign var=\"userValue\" value=$competition.weeklyWinners.users.$username.$weeklyWinnersMethod2}\r\n			\r\n			{if $smarty.foreach.method2.iteration gt 3 OR $userValue lte 0}{if $smarty.foreach.method2.iteration eq 1}Don\'t forget to update your progress so there will be winners next week{/if}<i>!</i>{php}break;{/php}\r\n			{elseif $smarty.foreach.method2.iteration eq 1}\r\n				<b>{$username|default:\"[ ?? ]\"|ucfirst}</b> won by \r\n				{if $weeklyWinnersMethod2 eq \'Weight Lost\'}losing <b>{$userValue}</b> pounds{elseif $weeklyWinnersMethod2 eq \'Percentage Weight Lost\'}losing <b>{$userValue|number_format:\"2\"}%</b> body weight{elseif $weeklyWinnersMethod2 eq \'Minutes Exercise\'}exercising <b>{$userValue}</b> minutes{elseif $weeklyWinnersMethod2 eq \'Distance Exercised\'}exercising <b>{$userValue}</b> miles{elseif $weeklyWinnersMethod2 eq \'Weight Gained\'}gaining <b>{$userValue}</b> pounds{/if}\r\n			{else}\r\n				{if $smarty.foreach.method2.iteration eq 2}, followed by <b>{$username|default:\"[ ?? ]\"|ucfirst}</b> with \r\n				{else} and <b>{$username|default:\"[ ?? ]\"|ucfirst}</b> with \r\n				{/if}\r\n				{if $weeklyWinnersMethod2 eq \'Weight Lost\'}<b>{$userValue}</b> pounds{elseif $weeklyWinnersMethod2 eq \'Percentage Weight Lost\'}<b>{$userValue|number_format:\"2\"}%</b>{elseif $weeklyWinnersMethod2 eq \'Minutes Exercise\'}<b>{$userValue}</b> minutes{elseif $weeklyWinnersMethod2 eq \'Distance Exercised\'}<b>{$userValue}</b> miles{elseif $weeklyWinnersMethod2 eq \'Weight Gained\'}<b>{$userValue}</b> pounds{/if}\r\n			{/if}\r\n		{/foreach}\r\n		{/strip}\r\n		</td>\r\n	{/if}\r\n	{if $weeklyWinnersMethod1}\r\n	</tr></table></div>{/if}\r\n{/if}\r\n{* ********************************************************* *}\r\n\r\n{if $acm->isDomainAdmin() and $smarty.request.debug}\r\n	{display var=$competition}\r\n{/if} \r\n\r\n{* ******************************** COMPARISON GRAPHS ***************************************** *}\r\n{if $competition.availableGraphs|@count}\r\n{include_php file=\"shared_handle:competition.graphs\"}\r\n<h2 class=\"withBG\"><a name=\"graph\"></a>\r\n	<div class=\"topRight hideShow\">\r\n		<a href=\"javascript:toggle(\'graphs\', \'\', \'showHide\');\"><img id=\"graphs_img\" src=\"./img/blank.gif\" class=\"showHide_on\" alt=\"show/hide\" border=\"0\" /></a></div> \r\n	Comparison Graphs &nbsp; <small><i>No graph? <a href=\"http://www.macromedia.com/shockwave/download/download.cgi?P1_Prod_Version=ShockwaveFlash\" target=\"_blank\">click here</a> to download the free Flash Player plug-in.</i></small></h2>\r\n<div id=\"graphs\" style=\"display:block;\">\r\n	<table border=\"0\" cellpadding=\"0\" width=\"100%\">\r\n		{assign var=\"graphURL\" value=\"?pg=flashgraph-frame&format=wide\"}\r\n	<tr>\r\n		<td><div style=\"border:#999 1px solid;background-color:#FFF;padding:5px;\"><iframe name=\"graphwindow\" src=\"{$graphURL}\" frameborder=\"0\" width=\"625\" height=\"222\" scrollbars=\"no\"></iframe></div></td>\r\n	</tr>\r\n	<tr>\r\n		<td valign=\"top\" align=\"center\" width=\"100%\">\r\n		<small>\r\n		{foreach name=\"graphTypes\" from=$competition.availableGraphs key=\"graphType\" item=\"graphParams\"}\r\n		<a href=\"?pg=flashgraph-frame&compId={$competition.id}&{$graphParams}\" target=\"graphwindow\">{$graphType}</a>{if $smarty.foreach.graphTypes.iteration neq $competition.availableGraphs|@count} | {/if}\r\n		{/foreach}\r\n		</small></td>\r\n	</tr>\r\n	</table>\r\n<br />\r\n</div>\r\n{/if}\r\n\r\n{* ******************************** GROUP TEAMS/PLAYERS SUMMARY W/MOVING ***************************************** *}\r\n{if $competition.style eq \'Group-vs-Group\'}\r\n<h2 class=\"withBG\">\r\n	<div class=\"topRight hideShow\">\r\n		<a href=\"javascript:toggle(\'teams\', \'\', \'showHide\');\"><img id=\"teams_img\" src=\"./img/blank.gif\" class=\"showHide_on\" alt=\"show/hide\" border=\"0\" /></a></div> \r\n	The Teams &nbsp; <small><i>Assignments and statistics</i></small></h2>\r\n<div id=\"teams\" style=\"display:block;\">\r\n<table cellpadding=\"0\" cellspacing=\"0\" width=\"100%\" border=\"0\"><tr><td>\r\n	{if $isManager}\r\n		<form name=\"changeTeam\" action=\"index.php\" method=\"POST\" style=\"margin:0px;\">\r\n			<input type=\"hidden\" name=\"pg\" value=\"{$page.name}\">\r\n			<input type=\"hidden\" name=\"cid\" value=\"{$competition.id}\">\r\n			<input type=\"hidden\" name=\"no_expire\" value=\"true\">\r\n	{/if}\r\n		{assign var=\"minEx\" value=\"Minutes Exercise\"}\r\n		{assign var=\"distEx\" value=\"Distance Exercised\"}\r\n		{assign var=\"pctLst\" value=\"Percentage Weight Lost\"}\r\n		{assign var=\"wtLst\" value=\"Percentage Weight Lost\"}\r\n		{foreach from=$competition.teams name=\"teamsLoop\" item=\"teams\" key=\"teamName\"}\r\n			<div id=\"playersList{$smarty.foreach.teamsLoop.iteration}\" style=\"float:left;width:310px;overflow:hidden;word-wrap:nowrap; margin:0px 5px 5px 0px;\">\r\n			<h4>{if $teams.name eq \"Waiting to Join\"}Not assigned to a team{else}{$teams.name|default:\"&nbsp;\"}{/if}</h4>\r\n		{if $scoringMethod|regex_match:\"/exercise/i\"}\r\n			<span class=\"cellHeadLarge\">Name</span>\r\n			<span class=\"cellHeadSmall\">Min.</span>\r\n			<span class=\"cellHeadSmall\">Dist.</span>\r\n			<span class=\"cellHeadSmall\">Update</span><br />\r\n			{foreach from=$teams.users item=\"users\" key=\"userName\"}\r\n				<span class=\"cellLarge\" style=\"text-align:left;\"><small>{if $isManager}<input type=\"checkbox\" name=\"changeTeam[players][{$userName}]\" style=\"width:14px;height:14px;margin:0px 2px;\" />{/if}{$userName}</small></span>\r\n				<span class=\"cellSmall\"><small>{$users.$minEx|default:\"-\"|replace:\".00\":\"\"}</small></span>\r\n				<span class=\"cellSmall\"><small>{$users.$distEx|default:\"-\"|replace:\".00\":\"\"}</small></span>\r\n				<span class=\"cellSmall\"><small>{if $users.dateOfEntry}{$users.dateOfEntry|date_format2:\"n/j/y\"}{else}Never{/if}</small></span>\r\n			{foreachelse}\r\n				{* No players assigned to this team. *}\r\n			{/foreach}\r\n		{else}\r\n			<span class=\"cellHeadLarge\">Name</span>\r\n			<span class=\"cellHeadTiny\">%</span>\r\n			<span class=\"cellHeadSmall\">Update</span><br />\r\n			{foreach from=$teams.users item=\"users\" key=\"userName\"}\r\n				<span class=\"cellLarge\" style=\"clear:left;text-align:left;\"><small>{if $isManager}<input type=\"checkbox\" name=\"changeTeam[players][{$userName}]\" />{/if}{$userName}</small></span>\r\n				<span class=\"cellTiny\"><small>{if $users.hideInitialWeight neq \"Yes\"}{$users.$pctLst|number_format:\"2\"|replace:\".00\":\"\"}{else}-{/if}</small></span>\r\n				<span class=\"cellSmall\"><small>{if $users.dateOfEntry}{$users.dateOfEntry|date_format2:\"n/j/y\"}{else}Never{/if}</small></span><br />\r\n			{foreachelse}\r\n				{* No players assigned to this team. *}\r\n			{/foreach}\r\n		{/if}\r\n			</div>\r\n		{/foreach}\r\n	{if $isManager}\r\n		<br />\r\n		<select name=\"changeTeam[team]\">\r\n			<option value=\"\">Move selected players to...</option>\r\n			{foreach from=$competition.teams item=\"newTeams\" key=\"newTeamName\"}\r\n				{*if $newTeams.name ne $teams.name and $newTeams.name ne \"Waiting to Join\"*}\r\n				{if $newTeams.name ne \"Waiting to Join\"}\r\n					<option value=\"{$newTeams.name}\">{$newTeams.name}</option>\r\n				{/if}\r\n			{/foreach}\r\n		</select><br />\r\n		<input type=\"submit\" class=\"button\" value=\"Submit Changes\">\r\n		</form>\r\n	{/if}\r\n</td></tr></table>\r\n</div>\r\n{/if}\r\n</div>\r\n	{* ******************************** DISCUSSION BOARD ***************************************** *}\r\n<br />\r\n<h2 class=\"withBG\">\r\n	<div class=\"topRight hideShow\">\r\n		<a href=\"javascript:toggle(\'discuss\', \'\', \'showHide\');\"><img id=\"discuss_img\" src=\"./img/blank.gif\" class=\"showHide_on\" alt=\"show/hide\" border=\"0\" /></a></div> \r\n	Discussion Board</h2>\r\n<div id=\"discuss\" style=\"display:block;\">\r\n	<table cellpadding=\"0\" width=\"100%\" border=\"0\"><tr><td><iframe src=\"?pg=competition/forum\" id=\"discussionBoard\" frameborder=\"0\" scrolling=\"yes\" style=\"width:100%;\"></iframe></td></tr></table>\r\n</div>\r\n\r\n</div></td>\r\n</tr></table>'),